DaoCasino/bankroller-core

View on GitHub
data/dapps/dicespec/public/lib/DC.js

Summary

Maintainability
A
0 mins
Test Coverage
!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="/",__webpack_require__(__webpack_require__.s=1360)}([function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license  MIT\n */\n/* eslint-disable no-proto */\n\n\n\nvar base64 = __webpack_require__(621)\nvar ieee754 = __webpack_require__(412)\nvar isArray = __webpack_require__(431)\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n *   === true    Use Uint8Array implementation (fastest)\n *   === false   Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n *     incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n  ? global.TYPED_ARRAY_SUPPORT\n  : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n  try {\n    var arr = new Uint8Array(1)\n    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n    return arr.foo() === 42 && // typed array instances can be augmented\n        typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n  } catch (e) {\n    return false\n  }\n}\n\nfunction kMaxLength () {\n  return Buffer.TYPED_ARRAY_SUPPORT\n    ? 0x7fffffff\n    : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n  if (kMaxLength() < length) {\n    throw new RangeError('Invalid typed array length')\n  }\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    // Return an augmented `Uint8Array` instance, for best performance\n    that = new Uint8Array(length)\n    that.__proto__ = Buffer.prototype\n  } else {\n    // Fallback: Return an object instance of the Buffer class\n    if (that === null) {\n      that = new Buffer(length)\n    }\n    that.length = length\n  }\n\n  return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n    return new Buffer(arg, encodingOrOffset, length)\n  }\n\n  // Common case.\n  if (typeof arg === 'number') {\n    if (typeof encodingOrOffset === 'string') {\n      throw new Error(\n        'If encoding is specified then the first argument must be a string'\n      )\n    }\n    return allocUnsafe(this, arg)\n  }\n  return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n  arr.__proto__ = Buffer.prototype\n  return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n  if (typeof value === 'number') {\n    throw new TypeError('\"value\" argument must not be a number')\n  }\n\n  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n    return fromArrayBuffer(that, value, encodingOrOffset, length)\n  }\n\n  if (typeof value === 'string') {\n    return fromString(that, value, encodingOrOffset)\n  }\n\n  return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n  return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n  Buffer.prototype.__proto__ = Uint8Array.prototype\n  Buffer.__proto__ = Uint8Array\n  if (typeof Symbol !== 'undefined' && Symbol.species &&\n      Buffer[Symbol.species] === Buffer) {\n    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n    Object.defineProperty(Buffer, Symbol.species, {\n      value: null,\n      configurable: true\n    })\n  }\n}\n\nfunction assertSize (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('\"size\" argument must be a number')\n  } else if (size < 0) {\n    throw new RangeError('\"size\" argument must not be negative')\n  }\n}\n\nfunction alloc (that, size, fill, encoding) {\n  assertSize(size)\n  if (size <= 0) {\n    return createBuffer(that, size)\n  }\n  if (fill !== undefined) {\n    // Only pay attention to encoding if it's a string. This\n    // prevents accidentally sending in a number that would\n    // be interpretted as a start offset.\n    return typeof encoding === 'string'\n      ? createBuffer(that, size).fill(fill, encoding)\n      : createBuffer(that, size).fill(fill)\n  }\n  return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n  return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n  assertSize(size)\n  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) {\n    for (var i = 0; i < size; ++i) {\n      that[i] = 0\n    }\n  }\n  return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n  return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n  return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n  if (typeof encoding !== 'string' || encoding === '') {\n    encoding = 'utf8'\n  }\n\n  if (!Buffer.isEncoding(encoding)) {\n    throw new TypeError('\"encoding\" must be a valid string encoding')\n  }\n\n  var length = byteLength(string, encoding) | 0\n  that = createBuffer(that, length)\n\n  var actual = that.write(string, encoding)\n\n  if (actual !== length) {\n    // Writing a hex string, for example, that contains invalid characters will\n    // cause everything after the first invalid character to be ignored. (e.g.\n    // 'abxxcd' will be treated as 'ab')\n    that = that.slice(0, actual)\n  }\n\n  return that\n}\n\nfunction fromArrayLike (that, array) {\n  var length = array.length < 0 ? 0 : checked(array.length) | 0\n  that = createBuffer(that, length)\n  for (var i = 0; i < length; i += 1) {\n    that[i] = array[i] & 255\n  }\n  return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n  array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n  if (byteOffset < 0 || array.byteLength < byteOffset) {\n    throw new RangeError('\\'offset\\' is out of bounds')\n  }\n\n  if (array.byteLength < byteOffset + (length || 0)) {\n    throw new RangeError('\\'length\\' is out of bounds')\n  }\n\n  if (byteOffset === undefined && length === undefined) {\n    array = new Uint8Array(array)\n  } else if (length === undefined) {\n    array = new Uint8Array(array, byteOffset)\n  } else {\n    array = new Uint8Array(array, byteOffset, length)\n  }\n\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    // Return an augmented `Uint8Array` instance, for best performance\n    that = array\n    that.__proto__ = Buffer.prototype\n  } else {\n    // Fallback: Return an object instance of the Buffer class\n    that = fromArrayLike(that, array)\n  }\n  return that\n}\n\nfunction fromObject (that, obj) {\n  if (Buffer.isBuffer(obj)) {\n    var len = checked(obj.length) | 0\n    that = createBuffer(that, len)\n\n    if (that.length === 0) {\n      return that\n    }\n\n    obj.copy(that, 0, 0, len)\n    return that\n  }\n\n  if (obj) {\n    if ((typeof ArrayBuffer !== 'undefined' &&\n        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n      if (typeof obj.length !== 'number' || isnan(obj.length)) {\n        return createBuffer(that, 0)\n      }\n      return fromArrayLike(that, obj)\n    }\n\n    if (obj.type === 'Buffer' && isArray(obj.data)) {\n      return fromArrayLike(that, obj.data)\n    }\n  }\n\n  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n  // Note: cannot use `length < kMaxLength()` here because that fails when\n  // length is NaN (which is otherwise coerced to zero.)\n  if (length >= kMaxLength()) {\n    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n                         'size: 0x' + kMaxLength().toString(16) + ' bytes')\n  }\n  return length | 0\n}\n\nfunction SlowBuffer (length) {\n  if (+length != length) { // eslint-disable-line eqeqeq\n    length = 0\n  }\n  return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n  return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n    throw new TypeError('Arguments must be Buffers')\n  }\n\n  if (a === b) return 0\n\n  var x = a.length\n  var y = b.length\n\n  for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n    if (a[i] !== b[i]) {\n      x = a[i]\n      y = b[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n  switch (String(encoding).toLowerCase()) {\n    case 'hex':\n    case 'utf8':\n    case 'utf-8':\n    case 'ascii':\n    case 'latin1':\n    case 'binary':\n    case 'base64':\n    case 'ucs2':\n    case 'ucs-2':\n    case 'utf16le':\n    case 'utf-16le':\n      return true\n    default:\n      return false\n  }\n}\n\nBuffer.concat = function concat (list, length) {\n  if (!isArray(list)) {\n    throw new TypeError('\"list\" argument must be an Array of Buffers')\n  }\n\n  if (list.length === 0) {\n    return Buffer.alloc(0)\n  }\n\n  var i\n  if (length === undefined) {\n    length = 0\n    for (i = 0; i < list.length; ++i) {\n      length += list[i].length\n    }\n  }\n\n  var buffer = Buffer.allocUnsafe(length)\n  var pos = 0\n  for (i = 0; i < list.length; ++i) {\n    var buf = list[i]\n    if (!Buffer.isBuffer(buf)) {\n      throw new TypeError('\"list\" argument must be an Array of Buffers')\n    }\n    buf.copy(buffer, pos)\n    pos += buf.length\n  }\n  return buffer\n}\n\nfunction byteLength (string, encoding) {\n  if (Buffer.isBuffer(string)) {\n    return string.length\n  }\n  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n    return string.byteLength\n  }\n  if (typeof string !== 'string') {\n    string = '' + string\n  }\n\n  var len = string.length\n  if (len === 0) return 0\n\n  // Use a for loop to avoid recursion\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'ascii':\n      case 'latin1':\n      case 'binary':\n        return len\n      case 'utf8':\n      case 'utf-8':\n      case undefined:\n        return utf8ToBytes(string).length\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return len * 2\n      case 'hex':\n        return len >>> 1\n      case 'base64':\n        return base64ToBytes(string).length\n      default:\n        if (loweredCase) return utf8ToBytes(string).length // assume utf8\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n  var loweredCase = false\n\n  // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n  // property of a typed array.\n\n  // This behaves neither like String nor Uint8Array in that we set start/end\n  // to their upper/lower bounds if the value passed is out of range.\n  // undefined is handled specially as per ECMA-262 6th Edition,\n  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n  if (start === undefined || start < 0) {\n    start = 0\n  }\n  // Return early if start > this.length. Done here to prevent potential uint32\n  // coercion fail below.\n  if (start > this.length) {\n    return ''\n  }\n\n  if (end === undefined || end > this.length) {\n    end = this.length\n  }\n\n  if (end <= 0) {\n    return ''\n  }\n\n  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n  end >>>= 0\n  start >>>= 0\n\n  if (end <= start) {\n    return ''\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  while (true) {\n    switch (encoding) {\n      case 'hex':\n        return hexSlice(this, start, end)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Slice(this, start, end)\n\n      case 'ascii':\n        return asciiSlice(this, start, end)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Slice(this, start, end)\n\n      case 'base64':\n        return base64Slice(this, start, end)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return utf16leSlice(this, start, end)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = (encoding + '').toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n  var i = b[n]\n  b[n] = b[m]\n  b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n  var len = this.length\n  if (len % 2 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 16-bits')\n  }\n  for (var i = 0; i < len; i += 2) {\n    swap(this, i, i + 1)\n  }\n  return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n  var len = this.length\n  if (len % 4 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 32-bits')\n  }\n  for (var i = 0; i < len; i += 4) {\n    swap(this, i, i + 3)\n    swap(this, i + 1, i + 2)\n  }\n  return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n  var len = this.length\n  if (len % 8 !== 0) {\n    throw new RangeError('Buffer size must be a multiple of 64-bits')\n  }\n  for (var i = 0; i < len; i += 8) {\n    swap(this, i, i + 7)\n    swap(this, i + 1, i + 6)\n    swap(this, i + 2, i + 5)\n    swap(this, i + 3, i + 4)\n  }\n  return this\n}\n\nBuffer.prototype.toString = function toString () {\n  var length = this.length | 0\n  if (length === 0) return ''\n  if (arguments.length === 0) return utf8Slice(this, 0, length)\n  return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n  if (this === b) return true\n  return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n  var str = ''\n  var max = exports.INSPECT_MAX_BYTES\n  if (this.length > 0) {\n    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n    if (this.length > max) str += ' ... '\n  }\n  return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n  if (!Buffer.isBuffer(target)) {\n    throw new TypeError('Argument must be a Buffer')\n  }\n\n  if (start === undefined) {\n    start = 0\n  }\n  if (end === undefined) {\n    end = target ? target.length : 0\n  }\n  if (thisStart === undefined) {\n    thisStart = 0\n  }\n  if (thisEnd === undefined) {\n    thisEnd = this.length\n  }\n\n  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n    throw new RangeError('out of range index')\n  }\n\n  if (thisStart >= thisEnd && start >= end) {\n    return 0\n  }\n  if (thisStart >= thisEnd) {\n    return -1\n  }\n  if (start >= end) {\n    return 1\n  }\n\n  start >>>= 0\n  end >>>= 0\n  thisStart >>>= 0\n  thisEnd >>>= 0\n\n  if (this === target) return 0\n\n  var x = thisEnd - thisStart\n  var y = end - start\n  var len = Math.min(x, y)\n\n  var thisCopy = this.slice(thisStart, thisEnd)\n  var targetCopy = target.slice(start, end)\n\n  for (var i = 0; i < len; ++i) {\n    if (thisCopy[i] !== targetCopy[i]) {\n      x = thisCopy[i]\n      y = targetCopy[i]\n      break\n    }\n  }\n\n  if (x < y) return -1\n  if (y < x) return 1\n  return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n  // Empty buffer means no match\n  if (buffer.length === 0) return -1\n\n  // Normalize byteOffset\n  if (typeof byteOffset === 'string') {\n    encoding = byteOffset\n    byteOffset = 0\n  } else if (byteOffset > 0x7fffffff) {\n    byteOffset = 0x7fffffff\n  } else if (byteOffset < -0x80000000) {\n    byteOffset = -0x80000000\n  }\n  byteOffset = +byteOffset  // Coerce to Number.\n  if (isNaN(byteOffset)) {\n    // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n    byteOffset = dir ? 0 : (buffer.length - 1)\n  }\n\n  // Normalize byteOffset: negative offsets start from the end of the buffer\n  if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n  if (byteOffset >= buffer.length) {\n    if (dir) return -1\n    else byteOffset = buffer.length - 1\n  } else if (byteOffset < 0) {\n    if (dir) byteOffset = 0\n    else return -1\n  }\n\n  // Normalize val\n  if (typeof val === 'string') {\n    val = Buffer.from(val, encoding)\n  }\n\n  // Finally, search either indexOf (if dir is true) or lastIndexOf\n  if (Buffer.isBuffer(val)) {\n    // Special case: looking for empty string/buffer always fails\n    if (val.length === 0) {\n      return -1\n    }\n    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n  } else if (typeof val === 'number') {\n    val = val & 0xFF // Search for a byte value [0-255]\n    if (Buffer.TYPED_ARRAY_SUPPORT &&\n        typeof Uint8Array.prototype.indexOf === 'function') {\n      if (dir) {\n        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n      } else {\n        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n      }\n    }\n    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n  }\n\n  throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n  var indexSize = 1\n  var arrLength = arr.length\n  var valLength = val.length\n\n  if (encoding !== undefined) {\n    encoding = String(encoding).toLowerCase()\n    if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n        encoding === 'utf16le' || encoding === 'utf-16le') {\n      if (arr.length < 2 || val.length < 2) {\n        return -1\n      }\n      indexSize = 2\n      arrLength /= 2\n      valLength /= 2\n      byteOffset /= 2\n    }\n  }\n\n  function read (buf, i) {\n    if (indexSize === 1) {\n      return buf[i]\n    } else {\n      return buf.readUInt16BE(i * indexSize)\n    }\n  }\n\n  var i\n  if (dir) {\n    var foundIndex = -1\n    for (i = byteOffset; i < arrLength; i++) {\n      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n        if (foundIndex === -1) foundIndex = i\n        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n      } else {\n        if (foundIndex !== -1) i -= i - foundIndex\n        foundIndex = -1\n      }\n    }\n  } else {\n    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n    for (i = byteOffset; i >= 0; i--) {\n      var found = true\n      for (var j = 0; j < valLength; j++) {\n        if (read(arr, i + j) !== read(val, j)) {\n          found = false\n          break\n        }\n      }\n      if (found) return i\n    }\n  }\n\n  return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n  return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n  offset = Number(offset) || 0\n  var remaining = buf.length - offset\n  if (!length) {\n    length = remaining\n  } else {\n    length = Number(length)\n    if (length > remaining) {\n      length = remaining\n    }\n  }\n\n  // must be an even number of digits\n  var strLen = string.length\n  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n  if (length > strLen / 2) {\n    length = strLen / 2\n  }\n  for (var i = 0; i < length; ++i) {\n    var parsed = parseInt(string.substr(i * 2, 2), 16)\n    if (isNaN(parsed)) return i\n    buf[offset + i] = parsed\n  }\n  return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n  return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n  return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n  return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n  // Buffer#write(string)\n  if (offset === undefined) {\n    encoding = 'utf8'\n    length = this.length\n    offset = 0\n  // Buffer#write(string, encoding)\n  } else if (length === undefined && typeof offset === 'string') {\n    encoding = offset\n    length = this.length\n    offset = 0\n  // Buffer#write(string, offset[, length][, encoding])\n  } else if (isFinite(offset)) {\n    offset = offset | 0\n    if (isFinite(length)) {\n      length = length | 0\n      if (encoding === undefined) encoding = 'utf8'\n    } else {\n      encoding = length\n      length = undefined\n    }\n  // legacy write(string, encoding, offset, length) - remove in v0.13\n  } else {\n    throw new Error(\n      'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n    )\n  }\n\n  var remaining = this.length - offset\n  if (length === undefined || length > remaining) length = remaining\n\n  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n    throw new RangeError('Attempt to write outside buffer bounds')\n  }\n\n  if (!encoding) encoding = 'utf8'\n\n  var loweredCase = false\n  for (;;) {\n    switch (encoding) {\n      case 'hex':\n        return hexWrite(this, string, offset, length)\n\n      case 'utf8':\n      case 'utf-8':\n        return utf8Write(this, string, offset, length)\n\n      case 'ascii':\n        return asciiWrite(this, string, offset, length)\n\n      case 'latin1':\n      case 'binary':\n        return latin1Write(this, string, offset, length)\n\n      case 'base64':\n        // Warning: maxLength not taken into account in base64Write\n        return base64Write(this, string, offset, length)\n\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return ucs2Write(this, string, offset, length)\n\n      default:\n        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n        encoding = ('' + encoding).toLowerCase()\n        loweredCase = true\n    }\n  }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n  return {\n    type: 'Buffer',\n    data: Array.prototype.slice.call(this._arr || this, 0)\n  }\n}\n\nfunction base64Slice (buf, start, end) {\n  if (start === 0 && end === buf.length) {\n    return base64.fromByteArray(buf)\n  } else {\n    return base64.fromByteArray(buf.slice(start, end))\n  }\n}\n\nfunction utf8Slice (buf, start, end) {\n  end = Math.min(buf.length, end)\n  var res = []\n\n  var i = start\n  while (i < end) {\n    var firstByte = buf[i]\n    var codePoint = null\n    var bytesPerSequence = (firstByte > 0xEF) ? 4\n      : (firstByte > 0xDF) ? 3\n      : (firstByte > 0xBF) ? 2\n      : 1\n\n    if (i + bytesPerSequence <= end) {\n      var secondByte, thirdByte, fourthByte, tempCodePoint\n\n      switch (bytesPerSequence) {\n        case 1:\n          if (firstByte < 0x80) {\n            codePoint = firstByte\n          }\n          break\n        case 2:\n          secondByte = buf[i + 1]\n          if ((secondByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n            if (tempCodePoint > 0x7F) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 3:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n              codePoint = tempCodePoint\n            }\n          }\n          break\n        case 4:\n          secondByte = buf[i + 1]\n          thirdByte = buf[i + 2]\n          fourthByte = buf[i + 3]\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n              codePoint = tempCodePoint\n            }\n          }\n      }\n    }\n\n    if (codePoint === null) {\n      // we did not generate a valid codePoint so insert a\n      // replacement char (U+FFFD) and advance only 1 byte\n      codePoint = 0xFFFD\n      bytesPerSequence = 1\n    } else if (codePoint > 0xFFFF) {\n      // encode to utf16 (surrogate pair dance)\n      codePoint -= 0x10000\n      res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n      codePoint = 0xDC00 | codePoint & 0x3FF\n    }\n\n    res.push(codePoint)\n    i += bytesPerSequence\n  }\n\n  return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n  var len = codePoints.length\n  if (len <= MAX_ARGUMENTS_LENGTH) {\n    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n  }\n\n  // Decode in chunks to avoid \"call stack size exceeded\".\n  var res = ''\n  var i = 0\n  while (i < len) {\n    res += String.fromCharCode.apply(\n      String,\n      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n    )\n  }\n  return res\n}\n\nfunction asciiSlice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i] & 0x7F)\n  }\n  return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n  var ret = ''\n  end = Math.min(buf.length, end)\n\n  for (var i = start; i < end; ++i) {\n    ret += String.fromCharCode(buf[i])\n  }\n  return ret\n}\n\nfunction hexSlice (buf, start, end) {\n  var len = buf.length\n\n  if (!start || start < 0) start = 0\n  if (!end || end < 0 || end > len) end = len\n\n  var out = ''\n  for (var i = start; i < end; ++i) {\n    out += toHex(buf[i])\n  }\n  return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n  var bytes = buf.slice(start, end)\n  var res = ''\n  for (var i = 0; i < bytes.length; i += 2) {\n    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n  }\n  return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n  var len = this.length\n  start = ~~start\n  end = end === undefined ? len : ~~end\n\n  if (start < 0) {\n    start += len\n    if (start < 0) start = 0\n  } else if (start > len) {\n    start = len\n  }\n\n  if (end < 0) {\n    end += len\n    if (end < 0) end = 0\n  } else if (end > len) {\n    end = len\n  }\n\n  if (end < start) end = start\n\n  var newBuf\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    newBuf = this.subarray(start, end)\n    newBuf.__proto__ = Buffer.prototype\n  } else {\n    var sliceLen = end - start\n    newBuf = new Buffer(sliceLen, undefined)\n    for (var i = 0; i < sliceLen; ++i) {\n      newBuf[i] = this[i + start]\n    }\n  }\n\n  return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    checkOffset(offset, byteLength, this.length)\n  }\n\n  var val = this[offset + --byteLength]\n  var mul = 1\n  while (byteLength > 0 && (mul *= 0x100)) {\n    val += this[offset + --byteLength] * mul\n  }\n\n  return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return ((this[offset]) |\n      (this[offset + 1] << 8) |\n      (this[offset + 2] << 16)) +\n      (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] * 0x1000000) +\n    ((this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var val = this[offset]\n  var mul = 1\n  var i = 0\n  while (++i < byteLength && (mul *= 0x100)) {\n    val += this[offset + i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n  var i = byteLength\n  var mul = 1\n  var val = this[offset + --i]\n  while (i > 0 && (mul *= 0x100)) {\n    val += this[offset + --i] * mul\n  }\n  mul *= 0x80\n\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n  return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 1, this.length)\n  if (!(this[offset] & 0x80)) return (this[offset])\n  return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset] | (this[offset + 1] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 2, this.length)\n  var val = this[offset + 1] | (this[offset] << 8)\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset]) |\n    (this[offset + 1] << 8) |\n    (this[offset + 2] << 16) |\n    (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n\n  return (this[offset] << 24) |\n    (this[offset + 1] << 16) |\n    (this[offset + 2] << 8) |\n    (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 4, this.length)\n  return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n  if (!noAssert) checkOffset(offset, 8, this.length)\n  return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n  if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n  if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var mul = 1\n  var i = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  byteLength = byteLength | 0\n  if (!noAssert) {\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    this[offset + i] = (value / mul) & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n  if (value < 0) value = 0xffff + value + 1\n  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n      (littleEndian ? i : 1 - i) * 8\n  }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n  } else {\n    objectWriteUInt16(this, value, offset, true)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 8)\n    this[offset + 1] = (value & 0xff)\n  } else {\n    objectWriteUInt16(this, value, offset, false)\n  }\n  return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n  if (value < 0) value = 0xffffffff + value + 1\n  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n  }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset + 3] = (value >>> 24)\n    this[offset + 2] = (value >>> 16)\n    this[offset + 1] = (value >>> 8)\n    this[offset] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, true)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 24)\n    this[offset + 1] = (value >>> 16)\n    this[offset + 2] = (value >>> 8)\n    this[offset + 3] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, false)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) {\n    var limit = Math.pow(2, 8 * byteLength - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = 0\n  var mul = 1\n  var sub = 0\n  this[offset] = value & 0xFF\n  while (++i < byteLength && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) {\n    var limit = Math.pow(2, 8 * byteLength - 1)\n\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\n  }\n\n  var i = byteLength - 1\n  var mul = 1\n  var sub = 0\n  this[offset + i] = value & 0xFF\n  while (--i >= 0 && (mul *= 0x100)) {\n    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n      sub = 1\n    }\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n  }\n\n  return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n  if (value < 0) value = 0xff + value + 1\n  this[offset] = (value & 0xff)\n  return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n  } else {\n    objectWriteUInt16(this, value, offset, true)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 8)\n    this[offset + 1] = (value & 0xff)\n  } else {\n    objectWriteUInt16(this, value, offset, false)\n  }\n  return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value & 0xff)\n    this[offset + 1] = (value >>> 8)\n    this[offset + 2] = (value >>> 16)\n    this[offset + 3] = (value >>> 24)\n  } else {\n    objectWriteUInt32(this, value, offset, true)\n  }\n  return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n  value = +value\n  offset = offset | 0\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n  if (value < 0) value = 0xffffffff + value + 1\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\n    this[offset] = (value >>> 24)\n    this[offset + 1] = (value >>> 16)\n    this[offset + 2] = (value >>> 8)\n    this[offset + 3] = (value & 0xff)\n  } else {\n    objectWriteUInt32(this, value, offset, false)\n  }\n  return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n  if (offset + ext > buf.length) throw new RangeError('Index out of range')\n  if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 23, 4)\n  return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n  return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n  if (!noAssert) {\n    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n  }\n  ieee754.write(buf, value, offset, littleEndian, 52, 8)\n  return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n  return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n  if (!start) start = 0\n  if (!end && end !== 0) end = this.length\n  if (targetStart >= target.length) targetStart = target.length\n  if (!targetStart) targetStart = 0\n  if (end > 0 && end < start) end = start\n\n  // Copy 0 bytes; we're done\n  if (end === start) return 0\n  if (target.length === 0 || this.length === 0) return 0\n\n  // Fatal error conditions\n  if (targetStart < 0) {\n    throw new RangeError('targetStart out of bounds')\n  }\n  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n  if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n  // Are we oob?\n  if (end > this.length) end = this.length\n  if (target.length - targetStart < end - start) {\n    end = target.length - targetStart + start\n  }\n\n  var len = end - start\n  var i\n\n  if (this === target && start < targetStart && targetStart < end) {\n    // descending copy from end\n    for (i = len - 1; i >= 0; --i) {\n      target[i + targetStart] = this[i + start]\n    }\n  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n    // ascending copy from start\n    for (i = 0; i < len; ++i) {\n      target[i + targetStart] = this[i + start]\n    }\n  } else {\n    Uint8Array.prototype.set.call(\n      target,\n      this.subarray(start, start + len),\n      targetStart\n    )\n  }\n\n  return len\n}\n\n// Usage:\n//    buffer.fill(number[, offset[, end]])\n//    buffer.fill(buffer[, offset[, end]])\n//    buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n  // Handle string cases:\n  if (typeof val === 'string') {\n    if (typeof start === 'string') {\n      encoding = start\n      start = 0\n      end = this.length\n    } else if (typeof end === 'string') {\n      encoding = end\n      end = this.length\n    }\n    if (val.length === 1) {\n      var code = val.charCodeAt(0)\n      if (code < 256) {\n        val = code\n      }\n    }\n    if (encoding !== undefined && typeof encoding !== 'string') {\n      throw new TypeError('encoding must be a string')\n    }\n    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n      throw new TypeError('Unknown encoding: ' + encoding)\n    }\n  } else if (typeof val === 'number') {\n    val = val & 255\n  }\n\n  // Invalid ranges are not set to a default, so can range check early.\n  if (start < 0 || this.length < start || this.length < end) {\n    throw new RangeError('Out of range index')\n  }\n\n  if (end <= start) {\n    return this\n  }\n\n  start = start >>> 0\n  end = end === undefined ? this.length : end >>> 0\n\n  if (!val) val = 0\n\n  var i\n  if (typeof val === 'number') {\n    for (i = start; i < end; ++i) {\n      this[i] = val\n    }\n  } else {\n    var bytes = Buffer.isBuffer(val)\n      ? val\n      : utf8ToBytes(new Buffer(val, encoding).toString())\n    var len = bytes.length\n    for (i = 0; i < end - start; ++i) {\n      this[i + start] = bytes[i % len]\n    }\n  }\n\n  return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n  // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n  str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n  // Node converts strings with length < 2 to ''\n  if (str.length < 2) return ''\n  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n  while (str.length % 4 !== 0) {\n    str = str + '='\n  }\n  return str\n}\n\nfunction stringtrim (str) {\n  if (str.trim) return str.trim()\n  return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n  if (n < 16) return '0' + n.toString(16)\n  return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n  units = units || Infinity\n  var codePoint\n  var length = string.length\n  var leadSurrogate = null\n  var bytes = []\n\n  for (var i = 0; i < length; ++i) {\n    codePoint = string.charCodeAt(i)\n\n    // is surrogate component\n    if (codePoint > 0xD7FF && codePoint < 0xE000) {\n      // last char was a lead\n      if (!leadSurrogate) {\n        // no lead yet\n        if (codePoint > 0xDBFF) {\n          // unexpected trail\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        } else if (i + 1 === length) {\n          // unpaired lead\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n          continue\n        }\n\n        // valid lead\n        leadSurrogate = codePoint\n\n        continue\n      }\n\n      // 2 leads in a row\n      if (codePoint < 0xDC00) {\n        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n        leadSurrogate = codePoint\n        continue\n      }\n\n      // valid surrogate pair\n      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n    } else if (leadSurrogate) {\n      // valid bmp char, but last char was a lead\n      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n    }\n\n    leadSurrogate = null\n\n    // encode utf8\n    if (codePoint < 0x80) {\n      if ((units -= 1) < 0) break\n      bytes.push(codePoint)\n    } else if (codePoint < 0x800) {\n      if ((units -= 2) < 0) break\n      bytes.push(\n        codePoint >> 0x6 | 0xC0,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x10000) {\n      if ((units -= 3) < 0) break\n      bytes.push(\n        codePoint >> 0xC | 0xE0,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else if (codePoint < 0x110000) {\n      if ((units -= 4) < 0) break\n      bytes.push(\n        codePoint >> 0x12 | 0xF0,\n        codePoint >> 0xC & 0x3F | 0x80,\n        codePoint >> 0x6 & 0x3F | 0x80,\n        codePoint & 0x3F | 0x80\n      )\n    } else {\n      throw new Error('Invalid code point')\n    }\n  }\n\n  return bytes\n}\n\nfunction asciiToBytes (str) {\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    // Node's code seems to be doing this and not & 0x7F..\n    byteArray.push(str.charCodeAt(i) & 0xFF)\n  }\n  return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n  var c, hi, lo\n  var byteArray = []\n  for (var i = 0; i < str.length; ++i) {\n    if ((units -= 2) < 0) break\n\n    c = str.charCodeAt(i)\n    hi = c >> 8\n    lo = c % 256\n    byteArray.push(lo)\n    byteArray.push(hi)\n  }\n\n  return byteArray\n}\n\nfunction base64ToBytes (str) {\n  return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n  for (var i = 0; i < length; ++i) {\n    if ((i + offset >= dst.length) || (i >= src.length)) break\n    dst[i + offset] = src[i]\n  }\n  return i\n}\n\nfunction isnan (val) {\n  return val !== val // eslint-disable-line no-self-compare\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-libs-browser/~/buffer/index.js\n// module id = 0\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-libs-browser/node_modules/buffer/index.js")},function(module,exports,__webpack_require__){eval("/* eslint-disable node/no-deprecated-api */\nvar buffer = __webpack_require__(0)\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n  for (var key in src) {\n    dst[key] = src[key]\n  }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n  module.exports = buffer\n} else {\n  // Copy properties from require('buffer')\n  copyProps(buffer, exports)\n  exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n  return Buffer(arg, encodingOrOffset, length)\n}\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n  if (typeof arg === 'number') {\n    throw new TypeError('Argument must not be a number')\n  }\n  return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  var buf = Buffer(size)\n  if (fill !== undefined) {\n    if (typeof encoding === 'string') {\n      buf.fill(fill, encoding)\n    } else {\n      buf.fill(fill)\n    }\n  } else {\n    buf.fill(0)\n  }\n  return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n  if (typeof size !== 'number') {\n    throw new TypeError('Argument must be a number')\n  }\n  return buffer.SlowBuffer(size)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/safe-buffer/index.js\n// module id = 1\n// module chunks = 0\n\n//# sourceURL=../node_modules/safe-buffer/index.js")},function(module,exports){eval('var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function("return this")() || (1,eval)("this");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === "object")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it\'s\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/global.js\n// module id = 2\n// module chunks = 0\n\n//# sourceURL=../node_modules/webpack/buildin/global.js')},function(module,exports){eval("if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/inherits/inherits_browser.js\n// module id = 3\n// module chunks = 0\n\n//# sourceURL=../node_modules/inherits/inherits_browser.js")},function(module,exports){eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things.  But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals.  It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n    throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n    throw new Error('clearTimeout has not been defined');\n}\n(function () {\n    try {\n        if (typeof setTimeout === 'function') {\n            cachedSetTimeout = setTimeout;\n        } else {\n            cachedSetTimeout = defaultSetTimout;\n        }\n    } catch (e) {\n        cachedSetTimeout = defaultSetTimout;\n    }\n    try {\n        if (typeof clearTimeout === 'function') {\n            cachedClearTimeout = clearTimeout;\n        } else {\n            cachedClearTimeout = defaultClearTimeout;\n        }\n    } catch (e) {\n        cachedClearTimeout = defaultClearTimeout;\n    }\n} ())\nfunction runTimeout(fun) {\n    if (cachedSetTimeout === setTimeout) {\n        //normal enviroments in sane situations\n        return setTimeout(fun, 0);\n    }\n    // if setTimeout wasn't available but was latter defined\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n        cachedSetTimeout = setTimeout;\n        return setTimeout(fun, 0);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedSetTimeout(fun, 0);\n    } catch(e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n            return cachedSetTimeout.call(null, fun, 0);\n        } catch(e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n            return cachedSetTimeout.call(this, fun, 0);\n        }\n    }\n\n\n}\nfunction runClearTimeout(marker) {\n    if (cachedClearTimeout === clearTimeout) {\n        //normal enviroments in sane situations\n        return clearTimeout(marker);\n    }\n    // if clearTimeout wasn't available but was latter defined\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n        cachedClearTimeout = clearTimeout;\n        return clearTimeout(marker);\n    }\n    try {\n        // when when somebody has screwed with setTimeout but no I.E. maddness\n        return cachedClearTimeout(marker);\n    } catch (e){\n        try {\n            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally\n            return cachedClearTimeout.call(null, marker);\n        } catch (e){\n            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n            return cachedClearTimeout.call(this, marker);\n        }\n    }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n    if (!draining || !currentQueue) {\n        return;\n    }\n    draining = false;\n    if (currentQueue.length) {\n        queue = currentQueue.concat(queue);\n    } else {\n        queueIndex = -1;\n    }\n    if (queue.length) {\n        drainQueue();\n    }\n}\n\nfunction drainQueue() {\n    if (draining) {\n        return;\n    }\n    var timeout = runTimeout(cleanUpNextTick);\n    draining = true;\n\n    var len = queue.length;\n    while(len) {\n        currentQueue = queue;\n        queue = [];\n        while (++queueIndex < len) {\n            if (currentQueue) {\n                currentQueue[queueIndex].run();\n            }\n        }\n        queueIndex = -1;\n        len = queue.length;\n    }\n    currentQueue = null;\n    draining = false;\n    runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n    var args = new Array(arguments.length - 1);\n    if (arguments.length > 1) {\n        for (var i = 1; i < arguments.length; i++) {\n            args[i - 1] = arguments[i];\n        }\n    }\n    queue.push(new Item(fun, args));\n    if (queue.length === 1 && !draining) {\n        runTimeout(drainQueue);\n    }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n    this.fun = fun;\n    this.array = array;\n}\nItem.prototype.run = function () {\n    this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n    throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n    throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-libs-browser/~/process/browser.js\n// module id = 4\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-libs-browser/node_modules/process/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(800);\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n               && 'undefined' != typeof chrome.storage\n                  ? chrome.storage.local\n                  : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n  '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',\n  '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',\n  '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',\n  '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',\n  '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',\n  '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',\n  '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',\n  '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',\n  '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',\n  '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',\n  '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n    return true;\n  }\n\n  // Internet Explorer and Edge do not support colors.\n  if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n    return false;\n  }\n\n  // is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n    // is firebug? http://stackoverflow.com/a/398120/376773\n    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n    // is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n    // double check webkit in userAgent just in case we are in a worker\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n  try {\n    return JSON.stringify(v);\n  } catch (err) {\n    return '[UnexpectedJSONParseError]: ' + err.message;\n  }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n  var useColors = this.useColors;\n\n  args[0] = (useColors ? '%c' : '')\n    + this.namespace\n    + (useColors ? ' %c' : ' ')\n    + args[0]\n    + (useColors ? '%c ' : ' ')\n    + '+' + exports.humanize(this.diff);\n\n  if (!useColors) return;\n\n  var c = 'color: ' + this.color;\n  args.splice(1, 0, c, 'color: inherit')\n\n  // the final \"%c\" is somewhat tricky, because there could be other\n  // arguments passed either before or after the %c, so we need to\n  // figure out the correct index to insert the CSS into\n  var index = 0;\n  var lastC = 0;\n  args[0].replace(/%[a-zA-Z%]/g, function(match) {\n    if ('%%' === match) return;\n    index++;\n    if ('%c' === match) {\n      // we only are interested in the *last* %c\n      // (the user may have provided their own)\n      lastC = index;\n    }\n  });\n\n  args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n  // this hackery is required for IE8/9, where\n  // the `console.log` function doesn't have 'apply'\n  return 'object' === typeof console\n    && console.log\n    && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n  try {\n    if (null == namespaces) {\n      exports.storage.removeItem('debug');\n    } else {\n      exports.storage.debug = namespaces;\n    }\n  } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n  var r;\n  try {\n    r = exports.storage.debug;\n  } catch(e) {}\n\n  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n  if (!r && typeof process !== 'undefined' && 'env' in process) {\n    r = __webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}).DEBUG;\n  }\n\n  return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n  try {\n    return window.localStorage;\n  } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/debug/src/browser.js\n// module id = 5\n// module chunks = 0\n\n//# sourceURL=../node_modules/debug/src/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar sources  = __webpack_require__(1185)\nvar sinks    = __webpack_require__(1179)\nvar throughs = __webpack_require__(1191)\n\nexports = module.exports = __webpack_require__(518)\n\nexports.pull = exports\n\nfor(var k in sources)\n  exports[k] = sources[k]\n\nfor(var k in throughs)\n  exports[k] = throughs[k]\n\nfor(var k in sinks)\n  exports[k] = sinks[k]\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/index.js\n// module id = 6\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/index.js")},function(module,exports){eval("/**\n * Node.js module for Forge.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2016 Digital Bazaar, Inc.\n */\nmodule.exports = {\n  // default options\n  options: {\n    usePureJavaScript: false\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/forge.js\n// module id = 7\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/forge.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _setImmediate = __webpack_require__(222);\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `setImmediate`.  In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name setImmediate\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.nextTick]{@link module:Utils.nextTick}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n *     call_order.push('two');\n *     // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n *     // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nexports.default = _setImmediate2.default;\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/setImmediate.js\n// module id = 8\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/setImmediate.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process, setImmediate, Buffer) {/**\n * Utility functions for web applications.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2018 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\nvar baseN = __webpack_require__(1125);\n\n/* Utilities API */\nvar util = module.exports = forge.util = forge.util || {};\n\n// define setImmediate and nextTick\n(function() {\n  // use native nextTick\n  if(typeof process !== 'undefined' && process.nextTick) {\n    util.nextTick = process.nextTick;\n    if(typeof setImmediate === 'function') {\n      util.setImmediate = setImmediate;\n    } else {\n      // polyfill setImmediate with nextTick, older versions of node\n      // (those w/o setImmediate) won't totally starve IO\n      util.setImmediate = util.nextTick;\n    }\n    return;\n  }\n\n  // polyfill nextTick with native setImmediate\n  if(typeof setImmediate === 'function') {\n    util.setImmediate = function() { return setImmediate.apply(undefined, arguments); };\n    util.nextTick = function(callback) {\n      return setImmediate(callback);\n    };\n    return;\n  }\n\n  /* Note: A polyfill upgrade pattern is used here to allow combining\n  polyfills. For example, MutationObserver is fast, but blocks UI updates,\n  so it needs to allow UI updates periodically, so it falls back on\n  postMessage or setTimeout. */\n\n  // polyfill with setTimeout\n  util.setImmediate = function(callback) {\n    setTimeout(callback, 0);\n  };\n\n  // upgrade polyfill to use postMessage\n  if(typeof window !== 'undefined' &&\n    typeof window.postMessage === 'function') {\n    var msg = 'forge.setImmediate';\n    var callbacks = [];\n    util.setImmediate = function(callback) {\n      callbacks.push(callback);\n      // only send message when one hasn't been sent in\n      // the current turn of the event loop\n      if(callbacks.length === 1) {\n        window.postMessage(msg, '*');\n      }\n    };\n    function handler(event) {\n      if(event.source === window && event.data === msg) {\n        event.stopPropagation();\n        var copy = callbacks.slice();\n        callbacks.length = 0;\n        copy.forEach(function(callback) {\n          callback();\n        });\n      }\n    }\n    window.addEventListener('message', handler, true);\n  }\n\n  // upgrade polyfill to use MutationObserver\n  if(typeof MutationObserver !== 'undefined') {\n    // polyfill with MutationObserver\n    var now = Date.now();\n    var attr = true;\n    var div = document.createElement('div');\n    var callbacks = [];\n    new MutationObserver(function() {\n      var copy = callbacks.slice();\n      callbacks.length = 0;\n      copy.forEach(function(callback) {\n        callback();\n      });\n    }).observe(div, {attributes: true});\n    var oldSetImmediate = util.setImmediate;\n    util.setImmediate = function(callback) {\n      if(Date.now() - now > 15) {\n        now = Date.now();\n        oldSetImmediate(callback);\n      } else {\n        callbacks.push(callback);\n        // only trigger observer when it hasn't been triggered in\n        // the current turn of the event loop\n        if(callbacks.length === 1) {\n          div.setAttribute('a', attr = !attr);\n        }\n      }\n    };\n  }\n\n  util.nextTick = util.setImmediate;\n})();\n\n// check if running under Node.js\nutil.isNodejs =\n  typeof process !== 'undefined' && process.versions && process.versions.node;\n\n// define isArray\nutil.isArray = Array.isArray || function(x) {\n  return Object.prototype.toString.call(x) === '[object Array]';\n};\n\n// define isArrayBuffer\nutil.isArrayBuffer = function(x) {\n  return typeof ArrayBuffer !== 'undefined' && x instanceof ArrayBuffer;\n};\n\n// define isArrayBufferView\nutil.isArrayBufferView = function(x) {\n  return x && util.isArrayBuffer(x.buffer) && x.byteLength !== undefined;\n};\n\n/**\n * Ensure a bits param is 8, 16, 24, or 32. Used to validate input for\n * algorithms where bit manipulation, JavaScript limitations, and/or algorithm\n * design only allow for byte operations of a limited size.\n *\n * @param n number of bits.\n *\n * Throw Error if n invalid.\n */\nfunction _checkBitsParam(n) {\n  if(!(n === 8 || n === 16 || n === 24 || n === 32)) {\n    throw new Error('Only 8, 16, 24, or 32 bits supported: ' + n);\n  }\n}\n\n// TODO: set ByteBuffer to best available backing\nutil.ByteBuffer = ByteStringBuffer;\n\n/** Buffer w/BinaryString backing */\n\n/**\n * Constructor for a binary string backed byte buffer.\n *\n * @param [b] the bytes to wrap (either encoded as string, one byte per\n *          character, or as an ArrayBuffer or Typed Array).\n */\nfunction ByteStringBuffer(b) {\n  // TODO: update to match DataBuffer API\n\n  // the data in this buffer\n  this.data = '';\n  // the pointer for reading from this buffer\n  this.read = 0;\n\n  if(typeof b === 'string') {\n    this.data = b;\n  } else if(util.isArrayBuffer(b) || util.isArrayBufferView(b)) {\n    if(typeof Buffer !== 'undefined' && b instanceof Buffer) {\n      this.data = b.toString('binary');\n    } else {\n      // convert native buffer to forge buffer\n      // FIXME: support native buffers internally instead\n      var arr = new Uint8Array(b);\n      try {\n        this.data = String.fromCharCode.apply(null, arr);\n      } catch(e) {\n        for(var i = 0; i < arr.length; ++i) {\n          this.putByte(arr[i]);\n        }\n      }\n    }\n  } else if(b instanceof ByteStringBuffer ||\n    (typeof b === 'object' && typeof b.data === 'string' &&\n    typeof b.read === 'number')) {\n    // copy existing buffer\n    this.data = b.data;\n    this.read = b.read;\n  }\n\n  // used for v8 optimization\n  this._constructedStringLength = 0;\n}\nutil.ByteStringBuffer = ByteStringBuffer;\n\n/* Note: This is an optimization for V8-based browsers. When V8 concatenates\n  a string, the strings are only joined logically using a \"cons string\" or\n  \"constructed/concatenated string\". These containers keep references to one\n  another and can result in very large memory usage. For example, if a 2MB\n  string is constructed by concatenating 4 bytes together at a time, the\n  memory usage will be ~44MB; so ~22x increase. The strings are only joined\n  together when an operation requiring their joining takes place, such as\n  substr(). This function is called when adding data to this buffer to ensure\n  these types of strings are periodically joined to reduce the memory\n  footprint. */\nvar _MAX_CONSTRUCTED_STRING_LENGTH = 4096;\nutil.ByteStringBuffer.prototype._optimizeConstructedString = function(x) {\n  this._constructedStringLength += x;\n  if(this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) {\n    // this substr() should cause the constructed string to join\n    this.data.substr(0, 1);\n    this._constructedStringLength = 0;\n  }\n};\n\n/**\n * Gets the number of bytes in this buffer.\n *\n * @return the number of bytes in this buffer.\n */\nutil.ByteStringBuffer.prototype.length = function() {\n  return this.data.length - this.read;\n};\n\n/**\n * Gets whether or not this buffer is empty.\n *\n * @return true if this buffer is empty, false if not.\n */\nutil.ByteStringBuffer.prototype.isEmpty = function() {\n  return this.length() <= 0;\n};\n\n/**\n * Puts a byte in this buffer.\n *\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putByte = function(b) {\n  return this.putBytes(String.fromCharCode(b));\n};\n\n/**\n * Puts a byte in this buffer N times.\n *\n * @param b the byte to put.\n * @param n the number of bytes of value b to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.fillWithByte = function(b, n) {\n  b = String.fromCharCode(b);\n  var d = this.data;\n  while(n > 0) {\n    if(n & 1) {\n      d += b;\n    }\n    n >>>= 1;\n    if(n > 0) {\n      b += b;\n    }\n  }\n  this.data = d;\n  this._optimizeConstructedString(n);\n  return this;\n};\n\n/**\n * Puts bytes in this buffer.\n *\n * @param bytes the bytes (as a UTF-8 encoded string) to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putBytes = function(bytes) {\n  this.data += bytes;\n  this._optimizeConstructedString(bytes.length);\n  return this;\n};\n\n/**\n * Puts a UTF-16 encoded string into this buffer.\n *\n * @param str the string to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putString = function(str) {\n  return this.putBytes(util.encodeUtf8(str));\n};\n\n/**\n * Puts a 16-bit integer in this buffer in big-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt16 = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 24-bit integer in this buffer in big-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt24 = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i >> 16 & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 32-bit integer in this buffer in big-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt32 = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i >> 24 & 0xFF) +\n    String.fromCharCode(i >> 16 & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i & 0xFF));\n};\n\n/**\n * Puts a 16-bit integer in this buffer in little-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt16Le = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF));\n};\n\n/**\n * Puts a 24-bit integer in this buffer in little-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt24Le = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i >> 16 & 0xFF));\n};\n\n/**\n * Puts a 32-bit integer in this buffer in little-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt32Le = function(i) {\n  return this.putBytes(\n    String.fromCharCode(i & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i >> 16 & 0xFF) +\n    String.fromCharCode(i >> 24 & 0xFF));\n};\n\n/**\n * Puts an n-bit integer in this buffer in big-endian order.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putInt = function(i, n) {\n  _checkBitsParam(n);\n  var bytes = '';\n  do {\n    n -= 8;\n    bytes += String.fromCharCode((i >> n) & 0xFF);\n  } while(n > 0);\n  return this.putBytes(bytes);\n};\n\n/**\n * Puts a signed n-bit integer in this buffer in big-endian order. Two's\n * complement representation is used.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putSignedInt = function(i, n) {\n  // putInt checks n\n  if(i < 0) {\n    i += 2 << (n - 1);\n  }\n  return this.putInt(i, n);\n};\n\n/**\n * Puts the given buffer into this buffer.\n *\n * @param buffer the buffer to put into this one.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.putBuffer = function(buffer) {\n  return this.putBytes(buffer.getBytes());\n};\n\n/**\n * Gets a byte from this buffer and advances the read pointer by 1.\n *\n * @return the byte.\n */\nutil.ByteStringBuffer.prototype.getByte = function() {\n  return this.data.charCodeAt(this.read++);\n};\n\n/**\n * Gets a uint16 from this buffer in big-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.ByteStringBuffer.prototype.getInt16 = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) << 8 ^\n    this.data.charCodeAt(this.read + 1));\n  this.read += 2;\n  return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in big-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.ByteStringBuffer.prototype.getInt24 = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) << 16 ^\n    this.data.charCodeAt(this.read + 1) << 8 ^\n    this.data.charCodeAt(this.read + 2));\n  this.read += 3;\n  return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in big-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.ByteStringBuffer.prototype.getInt32 = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) << 24 ^\n    this.data.charCodeAt(this.read + 1) << 16 ^\n    this.data.charCodeAt(this.read + 2) << 8 ^\n    this.data.charCodeAt(this.read + 3));\n  this.read += 4;\n  return rval;\n};\n\n/**\n * Gets a uint16 from this buffer in little-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.ByteStringBuffer.prototype.getInt16Le = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) ^\n    this.data.charCodeAt(this.read + 1) << 8);\n  this.read += 2;\n  return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in little-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.ByteStringBuffer.prototype.getInt24Le = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) ^\n    this.data.charCodeAt(this.read + 1) << 8 ^\n    this.data.charCodeAt(this.read + 2) << 16);\n  this.read += 3;\n  return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in little-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.ByteStringBuffer.prototype.getInt32Le = function() {\n  var rval = (\n    this.data.charCodeAt(this.read) ^\n    this.data.charCodeAt(this.read + 1) << 8 ^\n    this.data.charCodeAt(this.read + 2) << 16 ^\n    this.data.charCodeAt(this.read + 3) << 24);\n  this.read += 4;\n  return rval;\n};\n\n/**\n * Gets an n-bit integer from this buffer in big-endian order and advances the\n * read pointer by ceil(n/8).\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.ByteStringBuffer.prototype.getInt = function(n) {\n  _checkBitsParam(n);\n  var rval = 0;\n  do {\n    // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits.\n    rval = (rval << 8) + this.data.charCodeAt(this.read++);\n    n -= 8;\n  } while(n > 0);\n  return rval;\n};\n\n/**\n * Gets a signed n-bit integer from this buffer in big-endian order, using\n * two's complement, and advances the read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.ByteStringBuffer.prototype.getSignedInt = function(n) {\n  // getInt checks n\n  var x = this.getInt(n);\n  var max = 2 << (n - 2);\n  if(x >= max) {\n    x -= max << 1;\n  }\n  return x;\n};\n\n/**\n * Reads bytes out into a UTF-8 string and clears them from the buffer.\n *\n * @param count the number of bytes to read, undefined or null for all.\n *\n * @return a UTF-8 string of bytes.\n */\nutil.ByteStringBuffer.prototype.getBytes = function(count) {\n  var rval;\n  if(count) {\n    // read count bytes\n    count = Math.min(this.length(), count);\n    rval = this.data.slice(this.read, this.read + count);\n    this.read += count;\n  } else if(count === 0) {\n    rval = '';\n  } else {\n    // read all bytes, optimize to only copy when needed\n    rval = (this.read === 0) ? this.data : this.data.slice(this.read);\n    this.clear();\n  }\n  return rval;\n};\n\n/**\n * Gets a UTF-8 encoded string of the bytes from this buffer without modifying\n * the read pointer.\n *\n * @param count the number of bytes to get, omit to get all.\n *\n * @return a string full of UTF-8 encoded characters.\n */\nutil.ByteStringBuffer.prototype.bytes = function(count) {\n  return (typeof(count) === 'undefined' ?\n    this.data.slice(this.read) :\n    this.data.slice(this.read, this.read + count));\n};\n\n/**\n * Gets a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n *\n * @return the byte.\n */\nutil.ByteStringBuffer.prototype.at = function(i) {\n  return this.data.charCodeAt(this.read + i);\n};\n\n/**\n * Puts a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.setAt = function(i, b) {\n  this.data = this.data.substr(0, this.read + i) +\n    String.fromCharCode(b) +\n    this.data.substr(this.read + i + 1);\n  return this;\n};\n\n/**\n * Gets the last byte without modifying the read pointer.\n *\n * @return the last byte.\n */\nutil.ByteStringBuffer.prototype.last = function() {\n  return this.data.charCodeAt(this.data.length - 1);\n};\n\n/**\n * Creates a copy of this buffer.\n *\n * @return the copy.\n */\nutil.ByteStringBuffer.prototype.copy = function() {\n  var c = util.createBuffer(this.data);\n  c.read = this.read;\n  return c;\n};\n\n/**\n * Compacts this buffer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.compact = function() {\n  if(this.read > 0) {\n    this.data = this.data.slice(this.read);\n    this.read = 0;\n  }\n  return this;\n};\n\n/**\n * Clears this buffer.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.clear = function() {\n  this.data = '';\n  this.read = 0;\n  return this;\n};\n\n/**\n * Shortens this buffer by triming bytes off of the end of this buffer.\n *\n * @param count the number of bytes to trim off.\n *\n * @return this buffer.\n */\nutil.ByteStringBuffer.prototype.truncate = function(count) {\n  var len = Math.max(0, this.length() - count);\n  this.data = this.data.substr(this.read, len);\n  this.read = 0;\n  return this;\n};\n\n/**\n * Converts this buffer to a hexadecimal string.\n *\n * @return a hexadecimal string.\n */\nutil.ByteStringBuffer.prototype.toHex = function() {\n  var rval = '';\n  for(var i = this.read; i < this.data.length; ++i) {\n    var b = this.data.charCodeAt(i);\n    if(b < 16) {\n      rval += '0';\n    }\n    rval += b.toString(16);\n  }\n  return rval;\n};\n\n/**\n * Converts this buffer to a UTF-16 string (standard JavaScript string).\n *\n * @return a UTF-16 string.\n */\nutil.ByteStringBuffer.prototype.toString = function() {\n  return util.decodeUtf8(this.bytes());\n};\n\n/** End Buffer w/BinaryString backing */\n\n/** Buffer w/UInt8Array backing */\n\n/**\n * FIXME: Experimental. Do not use yet.\n *\n * Constructor for an ArrayBuffer-backed byte buffer.\n *\n * The buffer may be constructed from a string, an ArrayBuffer, DataView, or a\n * TypedArray.\n *\n * If a string is given, its encoding should be provided as an option,\n * otherwise it will default to 'binary'. A 'binary' string is encoded such\n * that each character is one byte in length and size.\n *\n * If an ArrayBuffer, DataView, or TypedArray is given, it will be used\n * *directly* without any copying. Note that, if a write to the buffer requires\n * more space, the buffer will allocate a new backing ArrayBuffer to\n * accommodate. The starting read and write offsets for the buffer may be\n * given as options.\n *\n * @param [b] the initial bytes for this buffer.\n * @param options the options to use:\n *          [readOffset] the starting read offset to use (default: 0).\n *          [writeOffset] the starting write offset to use (default: the\n *            length of the first parameter).\n *          [growSize] the minimum amount, in bytes, to grow the buffer by to\n *            accommodate writes (default: 1024).\n *          [encoding] the encoding ('binary', 'utf8', 'utf16', 'hex') for the\n *            first parameter, if it is a string (default: 'binary').\n */\nfunction DataBuffer(b, options) {\n  // default options\n  options = options || {};\n\n  // pointers for read from/write to buffer\n  this.read = options.readOffset || 0;\n  this.growSize = options.growSize || 1024;\n\n  var isArrayBuffer = util.isArrayBuffer(b);\n  var isArrayBufferView = util.isArrayBufferView(b);\n  if(isArrayBuffer || isArrayBufferView) {\n    // use ArrayBuffer directly\n    if(isArrayBuffer) {\n      this.data = new DataView(b);\n    } else {\n      // TODO: adjust read/write offset based on the type of view\n      // or specify that this must be done in the options ... that the\n      // offsets are byte-based\n      this.data = new DataView(b.buffer, b.byteOffset, b.byteLength);\n    }\n    this.write = ('writeOffset' in options ?\n      options.writeOffset : this.data.byteLength);\n    return;\n  }\n\n  // initialize to empty array buffer and add any given bytes using putBytes\n  this.data = new DataView(new ArrayBuffer(0));\n  this.write = 0;\n\n  if(b !== null && b !== undefined) {\n    this.putBytes(b);\n  }\n\n  if('writeOffset' in options) {\n    this.write = options.writeOffset;\n  }\n}\nutil.DataBuffer = DataBuffer;\n\n/**\n * Gets the number of bytes in this buffer.\n *\n * @return the number of bytes in this buffer.\n */\nutil.DataBuffer.prototype.length = function() {\n  return this.write - this.read;\n};\n\n/**\n * Gets whether or not this buffer is empty.\n *\n * @return true if this buffer is empty, false if not.\n */\nutil.DataBuffer.prototype.isEmpty = function() {\n  return this.length() <= 0;\n};\n\n/**\n * Ensures this buffer has enough empty space to accommodate the given number\n * of bytes. An optional parameter may be given that indicates a minimum\n * amount to grow the buffer if necessary. If the parameter is not given,\n * the buffer will be grown by some previously-specified default amount\n * or heuristic.\n *\n * @param amount the number of bytes to accommodate.\n * @param [growSize] the minimum amount, in bytes, to grow the buffer by if\n *          necessary.\n */\nutil.DataBuffer.prototype.accommodate = function(amount, growSize) {\n  if(this.length() >= amount) {\n    return this;\n  }\n  growSize = Math.max(growSize || this.growSize, amount);\n\n  // grow buffer\n  var src = new Uint8Array(\n    this.data.buffer, this.data.byteOffset, this.data.byteLength);\n  var dst = new Uint8Array(this.length() + growSize);\n  dst.set(src);\n  this.data = new DataView(dst.buffer);\n\n  return this;\n};\n\n/**\n * Puts a byte in this buffer.\n *\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putByte = function(b) {\n  this.accommodate(1);\n  this.data.setUint8(this.write++, b);\n  return this;\n};\n\n/**\n * Puts a byte in this buffer N times.\n *\n * @param b the byte to put.\n * @param n the number of bytes of value b to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.fillWithByte = function(b, n) {\n  this.accommodate(n);\n  for(var i = 0; i < n; ++i) {\n    this.data.setUint8(b);\n  }\n  return this;\n};\n\n/**\n * Puts bytes in this buffer. The bytes may be given as a string, an\n * ArrayBuffer, a DataView, or a TypedArray.\n *\n * @param bytes the bytes to put.\n * @param [encoding] the encoding for the first parameter ('binary', 'utf8',\n *          'utf16', 'hex'), if it is a string (default: 'binary').\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putBytes = function(bytes, encoding) {\n  if(util.isArrayBufferView(bytes)) {\n    var src = new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength);\n    var len = src.byteLength - src.byteOffset;\n    this.accommodate(len);\n    var dst = new Uint8Array(this.data.buffer, this.write);\n    dst.set(src);\n    this.write += len;\n    return this;\n  }\n\n  if(util.isArrayBuffer(bytes)) {\n    var src = new Uint8Array(bytes);\n    this.accommodate(src.byteLength);\n    var dst = new Uint8Array(this.data.buffer);\n    dst.set(src, this.write);\n    this.write += src.byteLength;\n    return this;\n  }\n\n  // bytes is a util.DataBuffer or equivalent\n  if(bytes instanceof util.DataBuffer ||\n    (typeof bytes === 'object' &&\n    typeof bytes.read === 'number' && typeof bytes.write === 'number' &&\n    util.isArrayBufferView(bytes.data))) {\n    var src = new Uint8Array(bytes.data.byteLength, bytes.read, bytes.length());\n    this.accommodate(src.byteLength);\n    var dst = new Uint8Array(bytes.data.byteLength, this.write);\n    dst.set(src);\n    this.write += src.byteLength;\n    return this;\n  }\n\n  if(bytes instanceof util.ByteStringBuffer) {\n    // copy binary string and process as the same as a string parameter below\n    bytes = bytes.data;\n    encoding = 'binary';\n  }\n\n  // string conversion\n  encoding = encoding || 'binary';\n  if(typeof bytes === 'string') {\n    var view;\n\n    // decode from string\n    if(encoding === 'hex') {\n      this.accommodate(Math.ceil(bytes.length / 2));\n      view = new Uint8Array(this.data.buffer, this.write);\n      this.write += util.binary.hex.decode(bytes, view, this.write);\n      return this;\n    }\n    if(encoding === 'base64') {\n      this.accommodate(Math.ceil(bytes.length / 4) * 3);\n      view = new Uint8Array(this.data.buffer, this.write);\n      this.write += util.binary.base64.decode(bytes, view, this.write);\n      return this;\n    }\n\n    // encode text as UTF-8 bytes\n    if(encoding === 'utf8') {\n      // encode as UTF-8 then decode string as raw binary\n      bytes = util.encodeUtf8(bytes);\n      encoding = 'binary';\n    }\n\n    // decode string as raw binary\n    if(encoding === 'binary' || encoding === 'raw') {\n      // one byte per character\n      this.accommodate(bytes.length);\n      view = new Uint8Array(this.data.buffer, this.write);\n      this.write += util.binary.raw.decode(view);\n      return this;\n    }\n\n    // encode text as UTF-16 bytes\n    if(encoding === 'utf16') {\n      // two bytes per character\n      this.accommodate(bytes.length * 2);\n      view = new Uint16Array(this.data.buffer, this.write);\n      this.write += util.text.utf16.encode(view);\n      return this;\n    }\n\n    throw new Error('Invalid encoding: ' + encoding);\n  }\n\n  throw Error('Invalid parameter: ' + bytes);\n};\n\n/**\n * Puts the given buffer into this buffer.\n *\n * @param buffer the buffer to put into this one.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putBuffer = function(buffer) {\n  this.putBytes(buffer);\n  buffer.clear();\n  return this;\n};\n\n/**\n * Puts a string into this buffer.\n *\n * @param str the string to put.\n * @param [encoding] the encoding for the string (default: 'utf16').\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putString = function(str) {\n  return this.putBytes(str, 'utf16');\n};\n\n/**\n * Puts a 16-bit integer in this buffer in big-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt16 = function(i) {\n  this.accommodate(2);\n  this.data.setInt16(this.write, i);\n  this.write += 2;\n  return this;\n};\n\n/**\n * Puts a 24-bit integer in this buffer in big-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt24 = function(i) {\n  this.accommodate(3);\n  this.data.setInt16(this.write, i >> 8 & 0xFFFF);\n  this.data.setInt8(this.write, i >> 16 & 0xFF);\n  this.write += 3;\n  return this;\n};\n\n/**\n * Puts a 32-bit integer in this buffer in big-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt32 = function(i) {\n  this.accommodate(4);\n  this.data.setInt32(this.write, i);\n  this.write += 4;\n  return this;\n};\n\n/**\n * Puts a 16-bit integer in this buffer in little-endian order.\n *\n * @param i the 16-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt16Le = function(i) {\n  this.accommodate(2);\n  this.data.setInt16(this.write, i, true);\n  this.write += 2;\n  return this;\n};\n\n/**\n * Puts a 24-bit integer in this buffer in little-endian order.\n *\n * @param i the 24-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt24Le = function(i) {\n  this.accommodate(3);\n  this.data.setInt8(this.write, i >> 16 & 0xFF);\n  this.data.setInt16(this.write, i >> 8 & 0xFFFF, true);\n  this.write += 3;\n  return this;\n};\n\n/**\n * Puts a 32-bit integer in this buffer in little-endian order.\n *\n * @param i the 32-bit integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt32Le = function(i) {\n  this.accommodate(4);\n  this.data.setInt32(this.write, i, true);\n  this.write += 4;\n  return this;\n};\n\n/**\n * Puts an n-bit integer in this buffer in big-endian order.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putInt = function(i, n) {\n  _checkBitsParam(n);\n  this.accommodate(n / 8);\n  do {\n    n -= 8;\n    this.data.setInt8(this.write++, (i >> n) & 0xFF);\n  } while(n > 0);\n  return this;\n};\n\n/**\n * Puts a signed n-bit integer in this buffer in big-endian order. Two's\n * complement representation is used.\n *\n * @param i the n-bit integer.\n * @param n the number of bits in the integer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.putSignedInt = function(i, n) {\n  _checkBitsParam(n);\n  this.accommodate(n / 8);\n  if(i < 0) {\n    i += 2 << (n - 1);\n  }\n  return this.putInt(i, n);\n};\n\n/**\n * Gets a byte from this buffer and advances the read pointer by 1.\n *\n * @return the byte.\n */\nutil.DataBuffer.prototype.getByte = function() {\n  return this.data.getInt8(this.read++);\n};\n\n/**\n * Gets a uint16 from this buffer in big-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.DataBuffer.prototype.getInt16 = function() {\n  var rval = this.data.getInt16(this.read);\n  this.read += 2;\n  return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in big-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.DataBuffer.prototype.getInt24 = function() {\n  var rval = (\n    this.data.getInt16(this.read) << 8 ^\n    this.data.getInt8(this.read + 2));\n  this.read += 3;\n  return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in big-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.DataBuffer.prototype.getInt32 = function() {\n  var rval = this.data.getInt32(this.read);\n  this.read += 4;\n  return rval;\n};\n\n/**\n * Gets a uint16 from this buffer in little-endian order and advances the read\n * pointer by 2.\n *\n * @return the uint16.\n */\nutil.DataBuffer.prototype.getInt16Le = function() {\n  var rval = this.data.getInt16(this.read, true);\n  this.read += 2;\n  return rval;\n};\n\n/**\n * Gets a uint24 from this buffer in little-endian order and advances the read\n * pointer by 3.\n *\n * @return the uint24.\n */\nutil.DataBuffer.prototype.getInt24Le = function() {\n  var rval = (\n    this.data.getInt8(this.read) ^\n    this.data.getInt16(this.read + 1, true) << 8);\n  this.read += 3;\n  return rval;\n};\n\n/**\n * Gets a uint32 from this buffer in little-endian order and advances the read\n * pointer by 4.\n *\n * @return the word.\n */\nutil.DataBuffer.prototype.getInt32Le = function() {\n  var rval = this.data.getInt32(this.read, true);\n  this.read += 4;\n  return rval;\n};\n\n/**\n * Gets an n-bit integer from this buffer in big-endian order and advances the\n * read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.DataBuffer.prototype.getInt = function(n) {\n  _checkBitsParam(n);\n  var rval = 0;\n  do {\n    // TODO: Use (rval * 0x100) if adding support for 33 to 53 bits.\n    rval = (rval << 8) + this.data.getInt8(this.read++);\n    n -= 8;\n  } while(n > 0);\n  return rval;\n};\n\n/**\n * Gets a signed n-bit integer from this buffer in big-endian order, using\n * two's complement, and advances the read pointer by n/8.\n *\n * @param n the number of bits in the integer (8, 16, 24, or 32).\n *\n * @return the integer.\n */\nutil.DataBuffer.prototype.getSignedInt = function(n) {\n  // getInt checks n\n  var x = this.getInt(n);\n  var max = 2 << (n - 2);\n  if(x >= max) {\n    x -= max << 1;\n  }\n  return x;\n};\n\n/**\n * Reads bytes out into a UTF-8 string and clears them from the buffer.\n *\n * @param count the number of bytes to read, undefined or null for all.\n *\n * @return a UTF-8 string of bytes.\n */\nutil.DataBuffer.prototype.getBytes = function(count) {\n  // TODO: deprecate this method, it is poorly named and\n  // this.toString('binary') replaces it\n  // add a toTypedArray()/toArrayBuffer() function\n  var rval;\n  if(count) {\n    // read count bytes\n    count = Math.min(this.length(), count);\n    rval = this.data.slice(this.read, this.read + count);\n    this.read += count;\n  } else if(count === 0) {\n    rval = '';\n  } else {\n    // read all bytes, optimize to only copy when needed\n    rval = (this.read === 0) ? this.data : this.data.slice(this.read);\n    this.clear();\n  }\n  return rval;\n};\n\n/**\n * Gets a UTF-8 encoded string of the bytes from this buffer without modifying\n * the read pointer.\n *\n * @param count the number of bytes to get, omit to get all.\n *\n * @return a string full of UTF-8 encoded characters.\n */\nutil.DataBuffer.prototype.bytes = function(count) {\n  // TODO: deprecate this method, it is poorly named, add \"getString()\"\n  return (typeof(count) === 'undefined' ?\n    this.data.slice(this.read) :\n    this.data.slice(this.read, this.read + count));\n};\n\n/**\n * Gets a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n *\n * @return the byte.\n */\nutil.DataBuffer.prototype.at = function(i) {\n  return this.data.getUint8(this.read + i);\n};\n\n/**\n * Puts a byte at the given index without modifying the read pointer.\n *\n * @param i the byte index.\n * @param b the byte to put.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.setAt = function(i, b) {\n  this.data.setUint8(i, b);\n  return this;\n};\n\n/**\n * Gets the last byte without modifying the read pointer.\n *\n * @return the last byte.\n */\nutil.DataBuffer.prototype.last = function() {\n  return this.data.getUint8(this.write - 1);\n};\n\n/**\n * Creates a copy of this buffer.\n *\n * @return the copy.\n */\nutil.DataBuffer.prototype.copy = function() {\n  return new util.DataBuffer(this);\n};\n\n/**\n * Compacts this buffer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.compact = function() {\n  if(this.read > 0) {\n    var src = new Uint8Array(this.data.buffer, this.read);\n    var dst = new Uint8Array(src.byteLength);\n    dst.set(src);\n    this.data = new DataView(dst);\n    this.write -= this.read;\n    this.read = 0;\n  }\n  return this;\n};\n\n/**\n * Clears this buffer.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.clear = function() {\n  this.data = new DataView(new ArrayBuffer(0));\n  this.read = this.write = 0;\n  return this;\n};\n\n/**\n * Shortens this buffer by triming bytes off of the end of this buffer.\n *\n * @param count the number of bytes to trim off.\n *\n * @return this buffer.\n */\nutil.DataBuffer.prototype.truncate = function(count) {\n  this.write = Math.max(0, this.length() - count);\n  this.read = Math.min(this.read, this.write);\n  return this;\n};\n\n/**\n * Converts this buffer to a hexadecimal string.\n *\n * @return a hexadecimal string.\n */\nutil.DataBuffer.prototype.toHex = function() {\n  var rval = '';\n  for(var i = this.read; i < this.data.byteLength; ++i) {\n    var b = this.data.getUint8(i);\n    if(b < 16) {\n      rval += '0';\n    }\n    rval += b.toString(16);\n  }\n  return rval;\n};\n\n/**\n * Converts this buffer to a string, using the given encoding. If no\n * encoding is given, 'utf8' (UTF-8) is used.\n *\n * @param [encoding] the encoding to use: 'binary', 'utf8', 'utf16', 'hex',\n *          'base64' (default: 'utf8').\n *\n * @return a string representation of the bytes in this buffer.\n */\nutil.DataBuffer.prototype.toString = function(encoding) {\n  var view = new Uint8Array(this.data, this.read, this.length());\n  encoding = encoding || 'utf8';\n\n  // encode to string\n  if(encoding === 'binary' || encoding === 'raw') {\n    return util.binary.raw.encode(view);\n  }\n  if(encoding === 'hex') {\n    return util.binary.hex.encode(view);\n  }\n  if(encoding === 'base64') {\n    return util.binary.base64.encode(view);\n  }\n\n  // decode to text\n  if(encoding === 'utf8') {\n    return util.text.utf8.decode(view);\n  }\n  if(encoding === 'utf16') {\n    return util.text.utf16.decode(view);\n  }\n\n  throw new Error('Invalid encoding: ' + encoding);\n};\n\n/** End Buffer w/UInt8Array backing */\n\n/**\n * Creates a buffer that stores bytes. A value may be given to put into the\n * buffer that is either a string of bytes or a UTF-16 string that will\n * be encoded using UTF-8 (to do the latter, specify 'utf8' as the encoding).\n *\n * @param [input] the bytes to wrap (as a string) or a UTF-16 string to encode\n *          as UTF-8.\n * @param [encoding] (default: 'raw', other: 'utf8').\n */\nutil.createBuffer = function(input, encoding) {\n  // TODO: deprecate, use new ByteBuffer() instead\n  encoding = encoding || 'raw';\n  if(input !== undefined && encoding === 'utf8') {\n    input = util.encodeUtf8(input);\n  }\n  return new util.ByteBuffer(input);\n};\n\n/**\n * Fills a string with a particular value. If you want the string to be a byte\n * string, pass in String.fromCharCode(theByte).\n *\n * @param c the character to fill the string with, use String.fromCharCode\n *          to fill the string with a byte value.\n * @param n the number of characters of value c to fill with.\n *\n * @return the filled string.\n */\nutil.fillString = function(c, n) {\n  var s = '';\n  while(n > 0) {\n    if(n & 1) {\n      s += c;\n    }\n    n >>>= 1;\n    if(n > 0) {\n      c += c;\n    }\n  }\n  return s;\n};\n\n/**\n * Performs a per byte XOR between two byte strings and returns the result as a\n * string of bytes.\n *\n * @param s1 first string of bytes.\n * @param s2 second string of bytes.\n * @param n the number of bytes to XOR.\n *\n * @return the XOR'd result.\n */\nutil.xorBytes = function(s1, s2, n) {\n  var s3 = '';\n  var b = '';\n  var t = '';\n  var i = 0;\n  var c = 0;\n  for(; n > 0; --n, ++i) {\n    b = s1.charCodeAt(i) ^ s2.charCodeAt(i);\n    if(c >= 10) {\n      s3 += t;\n      t = '';\n      c = 0;\n    }\n    t += String.fromCharCode(b);\n    ++c;\n  }\n  s3 += t;\n  return s3;\n};\n\n/**\n * Converts a hex string into a 'binary' encoded string of bytes.\n *\n * @param hex the hexadecimal string to convert.\n *\n * @return the binary-encoded string of bytes.\n */\nutil.hexToBytes = function(hex) {\n  // TODO: deprecate: \"Deprecated. Use util.binary.hex.decode instead.\"\n  var rval = '';\n  var i = 0;\n  if(hex.length & 1 == 1) {\n    // odd number of characters, convert first character alone\n    i = 1;\n    rval += String.fromCharCode(parseInt(hex[0], 16));\n  }\n  // convert 2 characters (1 byte) at a time\n  for(; i < hex.length; i += 2) {\n    rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n  }\n  return rval;\n};\n\n/**\n * Converts a 'binary' encoded string of bytes to hex.\n *\n * @param bytes the byte string to convert.\n *\n * @return the string of hexadecimal characters.\n */\nutil.bytesToHex = function(bytes) {\n  // TODO: deprecate: \"Deprecated. Use util.binary.hex.encode instead.\"\n  return util.createBuffer(bytes).toHex();\n};\n\n/**\n * Converts an 32-bit integer to 4-big-endian byte string.\n *\n * @param i the integer.\n *\n * @return the byte string.\n */\nutil.int32ToBytes = function(i) {\n  return (\n    String.fromCharCode(i >> 24 & 0xFF) +\n    String.fromCharCode(i >> 16 & 0xFF) +\n    String.fromCharCode(i >> 8 & 0xFF) +\n    String.fromCharCode(i & 0xFF));\n};\n\n// base64 characters, reverse mapping\nvar _base64 =\n  'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nvar _base64Idx = [\n/*43 -43 = 0*/\n/*'+',  1,  2,  3,'/' */\n   62, -1, -1, -1, 63,\n\n/*'0','1','2','3','4','5','6','7','8','9' */\n   52, 53, 54, 55, 56, 57, 58, 59, 60, 61,\n\n/*15, 16, 17,'=', 19, 20, 21 */\n  -1, -1, -1, 64, -1, -1, -1,\n\n/*65 - 43 = 22*/\n/*'A','B','C','D','E','F','G','H','I','J','K','L','M', */\n   0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12,\n\n/*'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' */\n   13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,\n\n/*91 - 43 = 48 */\n/*48, 49, 50, 51, 52, 53 */\n  -1, -1, -1, -1, -1, -1,\n\n/*97 - 43 = 54*/\n/*'a','b','c','d','e','f','g','h','i','j','k','l','m' */\n   26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n\n/*'n','o','p','q','r','s','t','u','v','w','x','y','z' */\n   39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51\n];\n\n// base58 characters (Bitcoin alphabet)\nvar _base58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';\n\n/**\n * Base64 encodes a 'binary' encoded string of bytes.\n *\n * @param input the binary encoded string of bytes to base64-encode.\n * @param maxline the maximum number of encoded characters per line to use,\n *          defaults to none.\n *\n * @return the base64-encoded output.\n */\nutil.encode64 = function(input, maxline) {\n  // TODO: deprecate: \"Deprecated. Use util.binary.base64.encode instead.\"\n  var line = '';\n  var output = '';\n  var chr1, chr2, chr3;\n  var i = 0;\n  while(i < input.length) {\n    chr1 = input.charCodeAt(i++);\n    chr2 = input.charCodeAt(i++);\n    chr3 = input.charCodeAt(i++);\n\n    // encode 4 character group\n    line += _base64.charAt(chr1 >> 2);\n    line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4));\n    if(isNaN(chr2)) {\n      line += '==';\n    } else {\n      line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6));\n      line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63);\n    }\n\n    if(maxline && line.length > maxline) {\n      output += line.substr(0, maxline) + '\\r\\n';\n      line = line.substr(maxline);\n    }\n  }\n  output += line;\n  return output;\n};\n\n/**\n * Base64 decodes a string into a 'binary' encoded string of bytes.\n *\n * @param input the base64-encoded input.\n *\n * @return the binary encoded string.\n */\nutil.decode64 = function(input) {\n  // TODO: deprecate: \"Deprecated. Use util.binary.base64.decode instead.\"\n\n  // remove all non-base64 characters\n  input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n  var output = '';\n  var enc1, enc2, enc3, enc4;\n  var i = 0;\n\n  while(i < input.length) {\n    enc1 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc2 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc3 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc4 = _base64Idx[input.charCodeAt(i++) - 43];\n\n    output += String.fromCharCode((enc1 << 2) | (enc2 >> 4));\n    if(enc3 !== 64) {\n      // decoded at least 2 bytes\n      output += String.fromCharCode(((enc2 & 15) << 4) | (enc3 >> 2));\n      if(enc4 !== 64) {\n        // decoded 3 bytes\n        output += String.fromCharCode(((enc3 & 3) << 6) | enc4);\n      }\n    }\n  }\n\n  return output;\n};\n\n/**\n * UTF-8 encodes the given UTF-16 encoded string (a standard JavaScript\n * string). Non-ASCII characters will be encoded as multiple bytes according\n * to UTF-8.\n *\n * @param str the string to encode.\n *\n * @return the UTF-8 encoded string.\n */\nutil.encodeUtf8 = function(str) {\n  return unescape(encodeURIComponent(str));\n};\n\n/**\n * Decodes a UTF-8 encoded string into a UTF-16 string.\n *\n * @param str the string to decode.\n *\n * @return the UTF-16 encoded string (standard JavaScript string).\n */\nutil.decodeUtf8 = function(str) {\n  return decodeURIComponent(escape(str));\n};\n\n// binary encoding/decoding tools\n// FIXME: Experimental. Do not use yet.\nutil.binary = {\n  raw: {},\n  hex: {},\n  base64: {},\n  base58: {},\n  baseN : {\n    encode: baseN.encode,\n    decode: baseN.decode\n  }\n};\n\n/**\n * Encodes a Uint8Array as a binary-encoded string. This encoding uses\n * a value between 0 and 255 for each character.\n *\n * @param bytes the Uint8Array to encode.\n *\n * @return the binary-encoded string.\n */\nutil.binary.raw.encode = function(bytes) {\n  return String.fromCharCode.apply(null, bytes);\n};\n\n/**\n * Decodes a binary-encoded string to a Uint8Array. This encoding uses\n * a value between 0 and 255 for each character.\n *\n * @param str the binary-encoded string to decode.\n * @param [output] an optional Uint8Array to write the output to; if it\n *          is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.raw.decode = function(str, output, offset) {\n  var out = output;\n  if(!out) {\n    out = new Uint8Array(str.length);\n  }\n  offset = offset || 0;\n  var j = offset;\n  for(var i = 0; i < str.length; ++i) {\n    out[j++] = str.charCodeAt(i);\n  }\n  return output ? (j - offset) : out;\n};\n\n/**\n * Encodes a 'binary' string, ArrayBuffer, DataView, TypedArray, or\n * ByteBuffer as a string of hexadecimal characters.\n *\n * @param bytes the bytes to convert.\n *\n * @return the string of hexadecimal characters.\n */\nutil.binary.hex.encode = util.bytesToHex;\n\n/**\n * Decodes a hex-encoded string to a Uint8Array.\n *\n * @param hex the hexadecimal string to convert.\n * @param [output] an optional Uint8Array to write the output to; if it\n *          is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.hex.decode = function(hex, output, offset) {\n  var out = output;\n  if(!out) {\n    out = new Uint8Array(Math.ceil(hex.length / 2));\n  }\n  offset = offset || 0;\n  var i = 0, j = offset;\n  if(hex.length & 1) {\n    // odd number of characters, convert first character alone\n    i = 1;\n    out[j++] = parseInt(hex[0], 16);\n  }\n  // convert 2 characters (1 byte) at a time\n  for(; i < hex.length; i += 2) {\n    out[j++] = parseInt(hex.substr(i, 2), 16);\n  }\n  return output ? (j - offset) : out;\n};\n\n/**\n * Base64-encodes a Uint8Array.\n *\n * @param input the Uint8Array to encode.\n * @param maxline the maximum number of encoded characters per line to use,\n *          defaults to none.\n *\n * @return the base64-encoded output string.\n */\nutil.binary.base64.encode = function(input, maxline) {\n  var line = '';\n  var output = '';\n  var chr1, chr2, chr3;\n  var i = 0;\n  while(i < input.byteLength) {\n    chr1 = input[i++];\n    chr2 = input[i++];\n    chr3 = input[i++];\n\n    // encode 4 character group\n    line += _base64.charAt(chr1 >> 2);\n    line += _base64.charAt(((chr1 & 3) << 4) | (chr2 >> 4));\n    if(isNaN(chr2)) {\n      line += '==';\n    } else {\n      line += _base64.charAt(((chr2 & 15) << 2) | (chr3 >> 6));\n      line += isNaN(chr3) ? '=' : _base64.charAt(chr3 & 63);\n    }\n\n    if(maxline && line.length > maxline) {\n      output += line.substr(0, maxline) + '\\r\\n';\n      line = line.substr(maxline);\n    }\n  }\n  output += line;\n  return output;\n};\n\n/**\n * Decodes a base64-encoded string to a Uint8Array.\n *\n * @param input the base64-encoded input string.\n * @param [output] an optional Uint8Array to write the output to; if it\n *          is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.binary.base64.decode = function(input, output, offset) {\n  var out = output;\n  if(!out) {\n    out = new Uint8Array(Math.ceil(input.length / 4) * 3);\n  }\n\n  // remove all non-base64 characters\n  input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n\n  offset = offset || 0;\n  var enc1, enc2, enc3, enc4;\n  var i = 0, j = offset;\n\n  while(i < input.length) {\n    enc1 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc2 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc3 = _base64Idx[input.charCodeAt(i++) - 43];\n    enc4 = _base64Idx[input.charCodeAt(i++) - 43];\n\n    out[j++] = (enc1 << 2) | (enc2 >> 4);\n    if(enc3 !== 64) {\n      // decoded at least 2 bytes\n      out[j++] = ((enc2 & 15) << 4) | (enc3 >> 2);\n      if(enc4 !== 64) {\n        // decoded 3 bytes\n        out[j++] = ((enc3 & 3) << 6) | enc4;\n      }\n    }\n  }\n\n  // make sure result is the exact decoded length\n  return output ? (j - offset) : out.subarray(0, j);\n};\n\n// add support for base58 encoding/decoding with Bitcoin alphabet\nutil.binary.base58.encode = function(input, maxline) {\n  return util.binary.baseN.encode(input, _base58, maxline);\n};\nutil.binary.base58.decode = function(input, maxline) {\n  return util.binary.baseN.decode(input, _base58, maxline);\n};\n\n// text encoding/decoding tools\n// FIXME: Experimental. Do not use yet.\nutil.text = {\n  utf8: {},\n  utf16: {}\n};\n\n/**\n * Encodes the given string as UTF-8 in a Uint8Array.\n *\n * @param str the string to encode.\n * @param [output] an optional Uint8Array to write the output to; if it\n *          is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.text.utf8.encode = function(str, output, offset) {\n  str = util.encodeUtf8(str);\n  var out = output;\n  if(!out) {\n    out = new Uint8Array(str.length);\n  }\n  offset = offset || 0;\n  var j = offset;\n  for(var i = 0; i < str.length; ++i) {\n    out[j++] = str.charCodeAt(i);\n  }\n  return output ? (j - offset) : out;\n};\n\n/**\n * Decodes the UTF-8 contents from a Uint8Array.\n *\n * @param bytes the Uint8Array to decode.\n *\n * @return the resulting string.\n */\nutil.text.utf8.decode = function(bytes) {\n  return util.decodeUtf8(String.fromCharCode.apply(null, bytes));\n};\n\n/**\n * Encodes the given string as UTF-16 in a Uint8Array.\n *\n * @param str the string to encode.\n * @param [output] an optional Uint8Array to write the output to; if it\n *          is too small, an exception will be thrown.\n * @param [offset] the start offset for writing to the output (default: 0).\n *\n * @return the Uint8Array or the number of bytes written if output was given.\n */\nutil.text.utf16.encode = function(str, output, offset) {\n  var out = output;\n  if(!out) {\n    out = new Uint8Array(str.length * 2);\n  }\n  var view = new Uint16Array(out.buffer);\n  offset = offset || 0;\n  var j = offset;\n  var k = offset;\n  for(var i = 0; i < str.length; ++i) {\n    view[k++] = str.charCodeAt(i);\n    j += 2;\n  }\n  return output ? (j - offset) : out;\n};\n\n/**\n * Decodes the UTF-16 contents from a Uint8Array.\n *\n * @param bytes the Uint8Array to decode.\n *\n * @return the resulting string.\n */\nutil.text.utf16.decode = function(bytes) {\n  return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer));\n};\n\n/**\n * Deflates the given data using a flash interface.\n *\n * @param api the flash interface.\n * @param bytes the data.\n * @param raw true to return only raw deflate data, false to include zlib\n *          header and trailer.\n *\n * @return the deflated data as a string.\n */\nutil.deflate = function(api, bytes, raw) {\n  bytes = util.decode64(api.deflate(util.encode64(bytes)).rval);\n\n  // strip zlib header and trailer if necessary\n  if(raw) {\n    // zlib header is 2 bytes (CMF,FLG) where FLG indicates that\n    // there is a 4-byte DICT (alder-32) block before the data if\n    // its 5th bit is set\n    var start = 2;\n    var flg = bytes.charCodeAt(1);\n    if(flg & 0x20) {\n      start = 6;\n    }\n    // zlib trailer is 4 bytes of adler-32\n    bytes = bytes.substring(start, bytes.length - 4);\n  }\n\n  return bytes;\n};\n\n/**\n * Inflates the given data using a flash interface.\n *\n * @param api the flash interface.\n * @param bytes the data.\n * @param raw true if the incoming data has no zlib header or trailer and is\n *          raw DEFLATE data.\n *\n * @return the inflated data as a string, null on error.\n */\nutil.inflate = function(api, bytes, raw) {\n  // TODO: add zlib header and trailer if necessary/possible\n  var rval = api.inflate(util.encode64(bytes)).rval;\n  return (rval === null) ? null : util.decode64(rval);\n};\n\n/**\n * Sets a storage object.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param obj the storage object, null to remove.\n */\nvar _setStorageObject = function(api, id, obj) {\n  if(!api) {\n    throw new Error('WebStorage not available.');\n  }\n\n  var rval;\n  if(obj === null) {\n    rval = api.removeItem(id);\n  } else {\n    // json-encode and base64-encode object\n    obj = util.encode64(JSON.stringify(obj));\n    rval = api.setItem(id, obj);\n  }\n\n  // handle potential flash error\n  if(typeof(rval) !== 'undefined' && rval.rval !== true) {\n    var error = new Error(rval.error.message);\n    error.id = rval.error.id;\n    error.name = rval.error.name;\n    throw error;\n  }\n};\n\n/**\n * Gets a storage object.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n *\n * @return the storage object entry or null if none exists.\n */\nvar _getStorageObject = function(api, id) {\n  if(!api) {\n    throw new Error('WebStorage not available.');\n  }\n\n  // get the existing entry\n  var rval = api.getItem(id);\n\n  /* Note: We check api.init because we can't do (api == localStorage)\n    on IE because of \"Class doesn't support Automation\" exception. Only\n    the flash api has an init method so this works too, but we need a\n    better solution in the future. */\n\n  // flash returns item wrapped in an object, handle special case\n  if(api.init) {\n    if(rval.rval === null) {\n      if(rval.error) {\n        var error = new Error(rval.error.message);\n        error.id = rval.error.id;\n        error.name = rval.error.name;\n        throw error;\n      }\n      // no error, but also no item\n      rval = null;\n    } else {\n      rval = rval.rval;\n    }\n  }\n\n  // handle decoding\n  if(rval !== null) {\n    // base64-decode and json-decode data\n    rval = JSON.parse(util.decode64(rval));\n  }\n\n  return rval;\n};\n\n/**\n * Stores an item in local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param data the data for the item (any javascript object/primitive).\n */\nvar _setItem = function(api, id, key, data) {\n  // get storage object\n  var obj = _getStorageObject(api, id);\n  if(obj === null) {\n    // create a new storage object\n    obj = {};\n  }\n  // update key\n  obj[key] = data;\n\n  // set storage object\n  _setStorageObject(api, id, obj);\n};\n\n/**\n * Gets an item from local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n *\n * @return the item.\n */\nvar _getItem = function(api, id, key) {\n  // get storage object\n  var rval = _getStorageObject(api, id);\n  if(rval !== null) {\n    // return data at key\n    rval = (key in rval) ? rval[key] : null;\n  }\n\n  return rval;\n};\n\n/**\n * Removes an item from local storage.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n */\nvar _removeItem = function(api, id, key) {\n  // get storage object\n  var obj = _getStorageObject(api, id);\n  if(obj !== null && key in obj) {\n    // remove key\n    delete obj[key];\n\n    // see if entry has no keys remaining\n    var empty = true;\n    for(var prop in obj) {\n      empty = false;\n      break;\n    }\n    if(empty) {\n      // remove entry entirely if no keys are left\n      obj = null;\n    }\n\n    // set storage object\n    _setStorageObject(api, id, obj);\n  }\n};\n\n/**\n * Clears the local disk storage identified by the given ID.\n *\n * @param api the storage interface.\n * @param id the storage ID to use.\n */\nvar _clearItems = function(api, id) {\n  _setStorageObject(api, id, null);\n};\n\n/**\n * Calls a storage function.\n *\n * @param func the function to call.\n * @param args the arguments for the function.\n * @param location the location argument.\n *\n * @return the return value from the function.\n */\nvar _callStorageFunction = function(func, args, location) {\n  var rval = null;\n\n  // default storage types\n  if(typeof(location) === 'undefined') {\n    location = ['web', 'flash'];\n  }\n\n  // apply storage types in order of preference\n  var type;\n  var done = false;\n  var exception = null;\n  for(var idx in location) {\n    type = location[idx];\n    try {\n      if(type === 'flash' || type === 'both') {\n        if(args[0] === null) {\n          throw new Error('Flash local storage not available.');\n        }\n        rval = func.apply(this, args);\n        done = (type === 'flash');\n      }\n      if(type === 'web' || type === 'both') {\n        args[0] = localStorage;\n        rval = func.apply(this, args);\n        done = true;\n      }\n    } catch(ex) {\n      exception = ex;\n    }\n    if(done) {\n      break;\n    }\n  }\n\n  if(!done) {\n    throw exception;\n  }\n\n  return rval;\n};\n\n/**\n * Stores an item on local disk.\n *\n * The available types of local storage include 'flash', 'web', and 'both'.\n *\n * The type 'flash' refers to flash local storage (SharedObject). In order\n * to use flash local storage, the 'api' parameter must be valid. The type\n * 'web' refers to WebStorage, if supported by the browser. The type 'both'\n * refers to storing using both 'flash' and 'web', not just one or the\n * other.\n *\n * The location array should list the storage types to use in order of\n * preference:\n *\n * ['flash']: flash only storage\n * ['web']: web only storage\n * ['both']: try to store in both\n * ['flash','web']: store in flash first, but if not available, 'web'\n * ['web','flash']: store in web first, but if not available, 'flash'\n *\n * The location array defaults to: ['web', 'flash']\n *\n * @param api the flash interface, null to use only WebStorage.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param data the data for the item (any javascript object/primitive).\n * @param location an array with the preferred types of storage to use.\n */\nutil.setItem = function(api, id, key, data, location) {\n  _callStorageFunction(_setItem, arguments, location);\n};\n\n/**\n * Gets an item on local disk.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface, null to use only WebStorage.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param location an array with the preferred types of storage to use.\n *\n * @return the item.\n */\nutil.getItem = function(api, id, key, location) {\n  return _callStorageFunction(_getItem, arguments, location);\n};\n\n/**\n * Removes an item on local disk.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface.\n * @param id the storage ID to use.\n * @param key the key for the item.\n * @param location an array with the preferred types of storage to use.\n */\nutil.removeItem = function(api, id, key, location) {\n  _callStorageFunction(_removeItem, arguments, location);\n};\n\n/**\n * Clears the local disk storage identified by the given ID.\n *\n * Set setItem() for details on storage types.\n *\n * @param api the flash interface if flash is available.\n * @param id the storage ID to use.\n * @param location an array with the preferred types of storage to use.\n */\nutil.clearItems = function(api, id, location) {\n  _callStorageFunction(_clearItems, arguments, location);\n};\n\n/**\n * Parses the scheme, host, and port from an http(s) url.\n *\n * @param str the url string.\n *\n * @return the parsed url object or null if the url is invalid.\n */\nutil.parseUrl = function(str) {\n  // FIXME: this regex looks a bit broken\n  var regex = /^(https?):\\/\\/([^:&^\\/]*):?(\\d*)(.*)$/g;\n  regex.lastIndex = 0;\n  var m = regex.exec(str);\n  var url = (m === null) ? null : {\n    full: str,\n    scheme: m[1],\n    host: m[2],\n    port: m[3],\n    path: m[4]\n  };\n  if(url) {\n    url.fullHost = url.host;\n    if(url.port) {\n      if(url.port !== 80 && url.scheme === 'http') {\n        url.fullHost += ':' + url.port;\n      } else if(url.port !== 443 && url.scheme === 'https') {\n        url.fullHost += ':' + url.port;\n      }\n    } else if(url.scheme === 'http') {\n      url.port = 80;\n    } else if(url.scheme === 'https') {\n      url.port = 443;\n    }\n    url.full = url.scheme + '://' + url.fullHost;\n  }\n  return url;\n};\n\n/* Storage for query variables */\nvar _queryVariables = null;\n\n/**\n * Returns the window location query variables. Query is parsed on the first\n * call and the same object is returned on subsequent calls. The mapping\n * is from keys to an array of values. Parameters without values will have\n * an object key set but no value added to the value array. Values are\n * unescaped.\n *\n * ...?k1=v1&k2=v2:\n * {\n *   \"k1\": [\"v1\"],\n *   \"k2\": [\"v2\"]\n * }\n *\n * ...?k1=v1&k1=v2:\n * {\n *   \"k1\": [\"v1\", \"v2\"]\n * }\n *\n * ...?k1=v1&k2:\n * {\n *   \"k1\": [\"v1\"],\n *   \"k2\": []\n * }\n *\n * ...?k1=v1&k1:\n * {\n *   \"k1\": [\"v1\"]\n * }\n *\n * ...?k1&k1:\n * {\n *   \"k1\": []\n * }\n *\n * @param query the query string to parse (optional, default to cached\n *          results from parsing window location search query).\n *\n * @return object mapping keys to variables.\n */\nutil.getQueryVariables = function(query) {\n  var parse = function(q) {\n    var rval = {};\n    var kvpairs = q.split('&');\n    for(var i = 0; i < kvpairs.length; i++) {\n      var pos = kvpairs[i].indexOf('=');\n      var key;\n      var val;\n      if(pos > 0) {\n        key = kvpairs[i].substring(0, pos);\n        val = kvpairs[i].substring(pos + 1);\n      } else {\n        key = kvpairs[i];\n        val = null;\n      }\n      if(!(key in rval)) {\n        rval[key] = [];\n      }\n      // disallow overriding object prototype keys\n      if(!(key in Object.prototype) && val !== null) {\n        rval[key].push(unescape(val));\n      }\n    }\n    return rval;\n  };\n\n   var rval;\n   if(typeof(query) === 'undefined') {\n     // set cached variables if needed\n     if(_queryVariables === null) {\n       if(typeof(window) !== 'undefined' && window.location && window.location.search) {\n          // parse window search query\n          _queryVariables = parse(window.location.search.substring(1));\n       } else {\n          // no query variables available\n          _queryVariables = {};\n       }\n     }\n     rval = _queryVariables;\n   } else {\n     // parse given query\n     rval = parse(query);\n   }\n   return rval;\n};\n\n/**\n * Parses a fragment into a path and query. This method will take a URI\n * fragment and break it up as if it were the main URI. For example:\n *    /bar/baz?a=1&b=2\n * results in:\n *    {\n *       path: [\"bar\", \"baz\"],\n *       query: {\"k1\": [\"v1\"], \"k2\": [\"v2\"]}\n *    }\n *\n * @return object with a path array and query object.\n */\nutil.parseFragment = function(fragment) {\n  // default to whole fragment\n  var fp = fragment;\n  var fq = '';\n  // split into path and query if possible at the first '?'\n  var pos = fragment.indexOf('?');\n  if(pos > 0) {\n    fp = fragment.substring(0, pos);\n    fq = fragment.substring(pos + 1);\n  }\n  // split path based on '/' and ignore first element if empty\n  var path = fp.split('/');\n  if(path.length > 0 && path[0] === '') {\n    path.shift();\n  }\n  // convert query into object\n  var query = (fq === '') ? {} : util.getQueryVariables(fq);\n\n  return {\n    pathString: fp,\n    queryString: fq,\n    path: path,\n    query: query\n  };\n};\n\n/**\n * Makes a request out of a URI-like request string. This is intended to\n * be used where a fragment id (after a URI '#') is parsed as a URI with\n * path and query parts. The string should have a path beginning and\n * delimited by '/' and optional query parameters following a '?'. The\n * query should be a standard URL set of key value pairs delimited by\n * '&'. For backwards compatibility the initial '/' on the path is not\n * required. The request object has the following API, (fully described\n * in the method code):\n *    {\n *       path: <the path string part>.\n *       query: <the query string part>,\n *       getPath(i): get part or all of the split path array,\n *       getQuery(k, i): get part or all of a query key array,\n *       getQueryLast(k, _default): get last element of a query key array.\n *    }\n *\n * @return object with request parameters.\n */\nutil.makeRequest = function(reqString) {\n  var frag = util.parseFragment(reqString);\n  var req = {\n    // full path string\n    path: frag.pathString,\n    // full query string\n    query: frag.queryString,\n    /**\n     * Get path or element in path.\n     *\n     * @param i optional path index.\n     *\n     * @return path or part of path if i provided.\n     */\n    getPath: function(i) {\n      return (typeof(i) === 'undefined') ? frag.path : frag.path[i];\n    },\n    /**\n     * Get query, values for a key, or value for a key index.\n     *\n     * @param k optional query key.\n     * @param i optional query key index.\n     *\n     * @return query, values for a key, or value for a key index.\n     */\n    getQuery: function(k, i) {\n      var rval;\n      if(typeof(k) === 'undefined') {\n        rval = frag.query;\n      } else {\n        rval = frag.query[k];\n        if(rval && typeof(i) !== 'undefined') {\n           rval = rval[i];\n        }\n      }\n      return rval;\n    },\n    getQueryLast: function(k, _default) {\n      var rval;\n      var vals = req.getQuery(k);\n      if(vals) {\n        rval = vals[vals.length - 1];\n      } else {\n        rval = _default;\n      }\n      return rval;\n    }\n  };\n  return req;\n};\n\n/**\n * Makes a URI out of a path, an object with query parameters, and a\n * fragment. Uses jQuery.param() internally for query string creation.\n * If the path is an array, it will be joined with '/'.\n *\n * @param path string path or array of strings.\n * @param query object with query parameters. (optional)\n * @param fragment fragment string. (optional)\n *\n * @return string object with request parameters.\n */\nutil.makeLink = function(path, query, fragment) {\n  // join path parts if needed\n  path = jQuery.isArray(path) ? path.join('/') : path;\n\n  var qstr = jQuery.param(query || {});\n  fragment = fragment || '';\n  return path +\n    ((qstr.length > 0) ? ('?' + qstr) : '') +\n    ((fragment.length > 0) ? ('#' + fragment) : '');\n};\n\n/**\n * Follows a path of keys deep into an object hierarchy and set a value.\n * If a key does not exist or it's value is not an object, create an\n * object in it's place. This can be destructive to a object tree if\n * leaf nodes are given as non-final path keys.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n * @param value the value to set.\n */\nutil.setPath = function(object, keys, value) {\n  // need to start at an object\n  if(typeof(object) === 'object' && object !== null) {\n    var i = 0;\n    var len = keys.length;\n    while(i < len) {\n      var next = keys[i++];\n      if(i == len) {\n        // last\n        object[next] = value;\n      } else {\n        // more\n        var hasNext = (next in object);\n        if(!hasNext ||\n          (hasNext && typeof(object[next]) !== 'object') ||\n          (hasNext && object[next] === null)) {\n          object[next] = {};\n        }\n        object = object[next];\n      }\n    }\n  }\n};\n\n/**\n * Follows a path of keys deep into an object hierarchy and return a value.\n * If a key does not exist, create an object in it's place.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n * @param _default value to return if path not found.\n *\n * @return the value at the path if found, else default if given, else\n *         undefined.\n */\nutil.getPath = function(object, keys, _default) {\n  var i = 0;\n  var len = keys.length;\n  var hasNext = true;\n  while(hasNext && i < len &&\n    typeof(object) === 'object' && object !== null) {\n    var next = keys[i++];\n    hasNext = next in object;\n    if(hasNext) {\n      object = object[next];\n    }\n  }\n  return (hasNext ? object : _default);\n};\n\n/**\n * Follow a path of keys deep into an object hierarchy and delete the\n * last one. If a key does not exist, do nothing.\n * Used to avoid exceptions from missing parts of the path.\n *\n * @param object the starting object.\n * @param keys an array of string keys.\n */\nutil.deletePath = function(object, keys) {\n  // need to start at an object\n  if(typeof(object) === 'object' && object !== null) {\n    var i = 0;\n    var len = keys.length;\n    while(i < len) {\n      var next = keys[i++];\n      if(i == len) {\n        // last\n        delete object[next];\n      } else {\n        // more\n        if(!(next in object) ||\n          (typeof(object[next]) !== 'object') ||\n          (object[next] === null)) {\n           break;\n        }\n        object = object[next];\n      }\n    }\n  }\n};\n\n/**\n * Check if an object is empty.\n *\n * Taken from:\n * http://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object-from-json/679937#679937\n *\n * @param object the object to check.\n */\nutil.isEmpty = function(obj) {\n  for(var prop in obj) {\n    if(obj.hasOwnProperty(prop)) {\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * Format with simple printf-style interpolation.\n *\n * %%: literal '%'\n * %s,%o: convert next argument into a string.\n *\n * @param format the string to format.\n * @param ... arguments to interpolate into the format string.\n */\nutil.format = function(format) {\n  var re = /%./g;\n  // current match\n  var match;\n  // current part\n  var part;\n  // current arg index\n  var argi = 0;\n  // collected parts to recombine later\n  var parts = [];\n  // last index found\n  var last = 0;\n  // loop while matches remain\n  while((match = re.exec(format))) {\n    part = format.substring(last, re.lastIndex - 2);\n    // don't add empty strings (ie, parts between %s%s)\n    if(part.length > 0) {\n      parts.push(part);\n    }\n    last = re.lastIndex;\n    // switch on % code\n    var code = match[0][1];\n    switch(code) {\n    case 's':\n    case 'o':\n      // check if enough arguments were given\n      if(argi < arguments.length) {\n        parts.push(arguments[argi++ + 1]);\n      } else {\n        parts.push('<?>');\n      }\n      break;\n    // FIXME: do proper formating for numbers, etc\n    //case 'f':\n    //case 'd':\n    case '%':\n      parts.push('%');\n      break;\n    default:\n      parts.push('<%' + code + '?>');\n    }\n  }\n  // add trailing part of format string\n  parts.push(format.substring(last));\n  return parts.join('');\n};\n\n/**\n * Formats a number.\n *\n * http://snipplr.com/view/5945/javascript-numberformat--ported-from-php/\n */\nutil.formatNumber = function(number, decimals, dec_point, thousands_sep) {\n  // http://kevin.vanzonneveld.net\n  // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n  // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n  // +     bugfix by: Michael White (http://crestidg.com)\n  // +     bugfix by: Benjamin Lupton\n  // +     bugfix by: Allan Jensen (http://www.winternet.no)\n  // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)\n  // *     example 1: number_format(1234.5678, 2, '.', '');\n  // *     returns 1: 1234.57\n\n  var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;\n  var d = dec_point === undefined ? ',' : dec_point;\n  var t = thousands_sep === undefined ?\n   '.' : thousands_sep, s = n < 0 ? '-' : '';\n  var i = parseInt((n = Math.abs(+n || 0).toFixed(c)), 10) + '';\n  var j = (i.length > 3) ? i.length % 3 : 0;\n  return s + (j ? i.substr(0, j) + t : '') +\n    i.substr(j).replace(/(\\d{3})(?=\\d)/g, '$1' + t) +\n    (c ? d + Math.abs(n - i).toFixed(c).slice(2) : '');\n};\n\n/**\n * Formats a byte size.\n *\n * http://snipplr.com/view/5949/format-humanize-file-byte-size-presentation-in-javascript/\n */\nutil.formatSize = function(size) {\n  if(size >= 1073741824) {\n    size = util.formatNumber(size / 1073741824, 2, '.', '') + ' GiB';\n  } else if(size >= 1048576) {\n    size = util.formatNumber(size / 1048576, 2, '.', '') + ' MiB';\n  } else if(size >= 1024) {\n    size = util.formatNumber(size / 1024, 0) + ' KiB';\n  } else {\n    size = util.formatNumber(size, 0) + ' bytes';\n  }\n  return size;\n};\n\n/**\n * Converts an IPv4 or IPv6 string representation into bytes (in network order).\n *\n * @param ip the IPv4 or IPv6 address to convert.\n *\n * @return the 4-byte IPv6 or 16-byte IPv6 address or null if the address can't\n *         be parsed.\n */\nutil.bytesFromIP = function(ip) {\n  if(ip.indexOf('.') !== -1) {\n    return util.bytesFromIPv4(ip);\n  }\n  if(ip.indexOf(':') !== -1) {\n    return util.bytesFromIPv6(ip);\n  }\n  return null;\n};\n\n/**\n * Converts an IPv4 string representation into bytes (in network order).\n *\n * @param ip the IPv4 address to convert.\n *\n * @return the 4-byte address or null if the address can't be parsed.\n */\nutil.bytesFromIPv4 = function(ip) {\n  ip = ip.split('.');\n  if(ip.length !== 4) {\n    return null;\n  }\n  var b = util.createBuffer();\n  for(var i = 0; i < ip.length; ++i) {\n    var num = parseInt(ip[i], 10);\n    if(isNaN(num)) {\n      return null;\n    }\n    b.putByte(num);\n  }\n  return b.getBytes();\n};\n\n/**\n * Converts an IPv6 string representation into bytes (in network order).\n *\n * @param ip the IPv6 address to convert.\n *\n * @return the 16-byte address or null if the address can't be parsed.\n */\nutil.bytesFromIPv6 = function(ip) {\n  var blanks = 0;\n  ip = ip.split(':').filter(function(e) {\n    if(e.length === 0) ++blanks;\n    return true;\n  });\n  var zeros = (8 - ip.length + blanks) * 2;\n  var b = util.createBuffer();\n  for(var i = 0; i < 8; ++i) {\n    if(!ip[i] || ip[i].length === 0) {\n      b.fillWithByte(0, zeros);\n      zeros = 0;\n      continue;\n    }\n    var bytes = util.hexToBytes(ip[i]);\n    if(bytes.length < 2) {\n      b.putByte(0);\n    }\n    b.putBytes(bytes);\n  }\n  return b.getBytes();\n};\n\n/**\n * Converts 4-bytes into an IPv4 string representation or 16-bytes into\n * an IPv6 string representation. The bytes must be in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv4 or IPv6 string representation if 4 or 16 bytes,\n *         respectively, are given, otherwise null.\n */\nutil.bytesToIP = function(bytes) {\n  if(bytes.length === 4) {\n    return util.bytesToIPv4(bytes);\n  }\n  if(bytes.length === 16) {\n    return util.bytesToIPv6(bytes);\n  }\n  return null;\n};\n\n/**\n * Converts 4-bytes into an IPv4 string representation. The bytes must be\n * in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv4 string representation or null for an invalid # of bytes.\n */\nutil.bytesToIPv4 = function(bytes) {\n  if(bytes.length !== 4) {\n    return null;\n  }\n  var ip = [];\n  for(var i = 0; i < bytes.length; ++i) {\n    ip.push(bytes.charCodeAt(i));\n  }\n  return ip.join('.');\n};\n\n/**\n * Converts 16-bytes into an IPv16 string representation. The bytes must be\n * in network order.\n *\n * @param bytes the bytes to convert.\n *\n * @return the IPv16 string representation or null for an invalid # of bytes.\n */\nutil.bytesToIPv6 = function(bytes) {\n  if(bytes.length !== 16) {\n    return null;\n  }\n  var ip = [];\n  var zeroGroups = [];\n  var zeroMaxGroup = 0;\n  for(var i = 0; i < bytes.length; i += 2) {\n    var hex = util.bytesToHex(bytes[i] + bytes[i + 1]);\n    // canonicalize zero representation\n    while(hex[0] === '0' && hex !== '0') {\n      hex = hex.substr(1);\n    }\n    if(hex === '0') {\n      var last = zeroGroups[zeroGroups.length - 1];\n      var idx = ip.length;\n      if(!last || idx !== last.end + 1) {\n        zeroGroups.push({start: idx, end: idx});\n      } else {\n        last.end = idx;\n        if((last.end - last.start) >\n          (zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start)) {\n          zeroMaxGroup = zeroGroups.length - 1;\n        }\n      }\n    }\n    ip.push(hex);\n  }\n  if(zeroGroups.length > 0) {\n    var group = zeroGroups[zeroMaxGroup];\n    // only shorten group of length > 0\n    if(group.end - group.start > 0) {\n      ip.splice(group.start, group.end - group.start + 1, '');\n      if(group.start === 0) {\n        ip.unshift('');\n      }\n      if(group.end === 7) {\n        ip.push('');\n      }\n    }\n  }\n  return ip.join(':');\n};\n\n/**\n * Estimates the number of processes that can be run concurrently. If\n * creating Web Workers, keep in mind that the main JavaScript process needs\n * its own core.\n *\n * @param options the options to use:\n *          update true to force an update (not use the cached value).\n * @param callback(err, max) called once the operation completes.\n */\nutil.estimateCores = function(options, callback) {\n  if(typeof options === 'function') {\n    callback = options;\n    options = {};\n  }\n  options = options || {};\n  if('cores' in util && !options.update) {\n    return callback(null, util.cores);\n  }\n  if(typeof navigator !== 'undefined' &&\n    'hardwareConcurrency' in navigator &&\n    navigator.hardwareConcurrency > 0) {\n    util.cores = navigator.hardwareConcurrency;\n    return callback(null, util.cores);\n  }\n  if(typeof Worker === 'undefined') {\n    // workers not available\n    util.cores = 1;\n    return callback(null, util.cores);\n  }\n  if(typeof Blob === 'undefined') {\n    // can't estimate, default to 2\n    util.cores = 2;\n    return callback(null, util.cores);\n  }\n\n  // create worker concurrency estimation code as blob\n  var blobUrl = URL.createObjectURL(new Blob(['(',\n    function() {\n      self.addEventListener('message', function(e) {\n        // run worker for 4 ms\n        var st = Date.now();\n        var et = st + 4;\n        while(Date.now() < et);\n        self.postMessage({st: st, et: et});\n      });\n    }.toString(),\n  ')()'], {type: 'application/javascript'}));\n\n  // take 5 samples using 16 workers\n  sample([], 5, 16);\n\n  function sample(max, samples, numWorkers) {\n    if(samples === 0) {\n      // get overlap average\n      var avg = Math.floor(max.reduce(function(avg, x) {\n        return avg + x;\n      }, 0) / max.length);\n      util.cores = Math.max(1, avg);\n      URL.revokeObjectURL(blobUrl);\n      return callback(null, util.cores);\n    }\n    map(numWorkers, function(err, results) {\n      max.push(reduce(numWorkers, results));\n      sample(max, samples - 1, numWorkers);\n    });\n  }\n\n  function map(numWorkers, callback) {\n    var workers = [];\n    var results = [];\n    for(var i = 0; i < numWorkers; ++i) {\n      var worker = new Worker(blobUrl);\n      worker.addEventListener('message', function(e) {\n        results.push(e.data);\n        if(results.length === numWorkers) {\n          for(var i = 0; i < numWorkers; ++i) {\n            workers[i].terminate();\n          }\n          callback(null, results);\n        }\n      });\n      workers.push(worker);\n    }\n    for(var i = 0; i < numWorkers; ++i) {\n      workers[i].postMessage(i);\n    }\n  }\n\n  function reduce(numWorkers, results) {\n    // find overlapping time windows\n    var overlaps = [];\n    for(var n = 0; n < numWorkers; ++n) {\n      var r1 = results[n];\n      var overlap = overlaps[n] = [];\n      for(var i = 0; i < numWorkers; ++i) {\n        if(n === i) {\n          continue;\n        }\n        var r2 = results[i];\n        if((r1.st > r2.st && r1.st < r2.et) ||\n          (r2.st > r1.st && r2.st < r1.et)) {\n          overlap.push(i);\n        }\n      }\n    }\n    // get maximum overlaps ... don't include overlapping worker itself\n    // as the main JS process was also being scheduled during the work and\n    // would have to be subtracted from the estimate anyway\n    return overlaps.reduce(function(max, overlap) {\n      return Math.max(max, overlap.length);\n    }, 0);\n  }\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(25).setImmediate, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/util.js\n// module id = 9\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/util.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * @license\n * lodash 3.10.1 (Custom Build) <https://lodash.com/>\n * Build: `lodash modern -d -o ./index.js`\n * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n * Available under MIT license <https://lodash.com/license>\n */\n;(function() {\n\n  /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n  var undefined;\n\n  /** Used as the semantic version number. */\n  var VERSION = '3.10.1';\n\n  /** Used to compose bitmasks for wrapper metadata. */\n  var BIND_FLAG = 1,\n      BIND_KEY_FLAG = 2,\n      CURRY_BOUND_FLAG = 4,\n      CURRY_FLAG = 8,\n      CURRY_RIGHT_FLAG = 16,\n      PARTIAL_FLAG = 32,\n      PARTIAL_RIGHT_FLAG = 64,\n      ARY_FLAG = 128,\n      REARG_FLAG = 256;\n\n  /** Used as default options for `_.trunc`. */\n  var DEFAULT_TRUNC_LENGTH = 30,\n      DEFAULT_TRUNC_OMISSION = '...';\n\n  /** Used to detect when a function becomes hot. */\n  var HOT_COUNT = 150,\n      HOT_SPAN = 16;\n\n  /** Used as the size to enable large array optimizations. */\n  var LARGE_ARRAY_SIZE = 200;\n\n  /** Used to indicate the type of lazy iteratees. */\n  var LAZY_FILTER_FLAG = 1,\n      LAZY_MAP_FLAG = 2;\n\n  /** Used as the `TypeError` message for \"Functions\" methods. */\n  var FUNC_ERROR_TEXT = 'Expected a function';\n\n  /** Used as the internal argument placeholder. */\n  var PLACEHOLDER = '__lodash_placeholder__';\n\n  /** `Object#toString` result references. */\n  var argsTag = '[object Arguments]',\n      arrayTag = '[object Array]',\n      boolTag = '[object Boolean]',\n      dateTag = '[object Date]',\n      errorTag = '[object Error]',\n      funcTag = '[object Function]',\n      mapTag = '[object Map]',\n      numberTag = '[object Number]',\n      objectTag = '[object Object]',\n      regexpTag = '[object RegExp]',\n      setTag = '[object Set]',\n      stringTag = '[object String]',\n      weakMapTag = '[object WeakMap]';\n\n  var arrayBufferTag = '[object ArrayBuffer]',\n      float32Tag = '[object Float32Array]',\n      float64Tag = '[object Float64Array]',\n      int8Tag = '[object Int8Array]',\n      int16Tag = '[object Int16Array]',\n      int32Tag = '[object Int32Array]',\n      uint8Tag = '[object Uint8Array]',\n      uint8ClampedTag = '[object Uint8ClampedArray]',\n      uint16Tag = '[object Uint16Array]',\n      uint32Tag = '[object Uint32Array]';\n\n  /** Used to match empty string literals in compiled template source. */\n  var reEmptyStringLeading = /\\b__p \\+= '';/g,\n      reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n      reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n  /** Used to match HTML entities and HTML characters. */\n  var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g,\n      reUnescapedHtml = /[&<>\"'`]/g,\n      reHasEscapedHtml = RegExp(reEscapedHtml.source),\n      reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n  /** Used to match template delimiters. */\n  var reEscape = /<%-([\\s\\S]+?)%>/g,\n      reEvaluate = /<%([\\s\\S]+?)%>/g,\n      reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n  /** Used to match property names within property paths. */\n  var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\n\\\\]|\\\\.)*?\\1)\\]/,\n      reIsPlainProp = /^\\w*$/,\n      rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\n\\\\]|\\\\.)*?)\\2)\\]/g;\n\n  /**\n   * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)\n   * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).\n   */\n  var reRegExpChars = /^[:!,]|[\\\\^$.*+?()[\\]{}|\\/]|(^[0-9a-fA-Fnrtuvx])|([\\n\\r\\u2028\\u2029])/g,\n      reHasRegExpChars = RegExp(reRegExpChars.source);\n\n  /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */\n  var reComboMark = /[\\u0300-\\u036f\\ufe20-\\ufe23]/g;\n\n  /** Used to match backslashes in property paths. */\n  var reEscapeChar = /\\\\(\\\\)?/g;\n\n  /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */\n  var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n  /** Used to match `RegExp` flags from their coerced string values. */\n  var reFlags = /\\w*$/;\n\n  /** Used to detect hexadecimal string values. */\n  var reHasHexPrefix = /^0[xX]/;\n\n  /** Used to detect host constructors (Safari > 5). */\n  var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n  /** Used to detect unsigned integer values. */\n  var reIsUint = /^\\d+$/;\n\n  /** Used to match latin-1 supplementary letters (excluding mathematical operators). */\n  var reLatin1 = /[\\xc0-\\xd6\\xd8-\\xde\\xdf-\\xf6\\xf8-\\xff]/g;\n\n  /** Used to ensure capturing order of template delimiters. */\n  var reNoMatch = /($^)/;\n\n  /** Used to match unescaped characters in compiled string literals. */\n  var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n  /** Used to match words to create compound words. */\n  var reWords = (function() {\n    var upper = '[A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde]',\n        lower = '[a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff]+';\n\n    return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');\n  }());\n\n  /** Used to assign default `context` object properties. */\n  var contextProps = [\n    'Array', 'ArrayBuffer', 'Date', 'Error', 'Float32Array', 'Float64Array',\n    'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Math', 'Number',\n    'Object', 'RegExp', 'Set', 'String', '_', 'clearTimeout', 'isFinite',\n    'parseFloat', 'parseInt', 'setTimeout', 'TypeError', 'Uint8Array',\n    'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap'\n  ];\n\n  /** Used to make template sourceURLs easier to identify. */\n  var templateCounter = -1;\n\n  /** Used to identify `toStringTag` values of typed arrays. */\n  var typedArrayTags = {};\n  typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n  typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n  typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n  typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n  typedArrayTags[uint32Tag] = true;\n  typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n  typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n  typedArrayTags[dateTag] = typedArrayTags[errorTag] =\n  typedArrayTags[funcTag] = typedArrayTags[mapTag] =\n  typedArrayTags[numberTag] = typedArrayTags[objectTag] =\n  typedArrayTags[regexpTag] = typedArrayTags[setTag] =\n  typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n\n  /** Used to identify `toStringTag` values supported by `_.clone`. */\n  var cloneableTags = {};\n  cloneableTags[argsTag] = cloneableTags[arrayTag] =\n  cloneableTags[arrayBufferTag] = cloneableTags[boolTag] =\n  cloneableTags[dateTag] = cloneableTags[float32Tag] =\n  cloneableTags[float64Tag] = cloneableTags[int8Tag] =\n  cloneableTags[int16Tag] = cloneableTags[int32Tag] =\n  cloneableTags[numberTag] = cloneableTags[objectTag] =\n  cloneableTags[regexpTag] = cloneableTags[stringTag] =\n  cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n  cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n  cloneableTags[errorTag] = cloneableTags[funcTag] =\n  cloneableTags[mapTag] = cloneableTags[setTag] =\n  cloneableTags[weakMapTag] = false;\n\n  /** Used to map latin-1 supplementary letters to basic latin letters. */\n  var deburredLetters = {\n    '\\xc0': 'A',  '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n    '\\xe0': 'a',  '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n    '\\xc7': 'C',  '\\xe7': 'c',\n    '\\xd0': 'D',  '\\xf0': 'd',\n    '\\xc8': 'E',  '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n    '\\xe8': 'e',  '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n    '\\xcC': 'I',  '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n    '\\xeC': 'i',  '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n    '\\xd1': 'N',  '\\xf1': 'n',\n    '\\xd2': 'O',  '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n    '\\xf2': 'o',  '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n    '\\xd9': 'U',  '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n    '\\xf9': 'u',  '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n    '\\xdd': 'Y',  '\\xfd': 'y', '\\xff': 'y',\n    '\\xc6': 'Ae', '\\xe6': 'ae',\n    '\\xde': 'Th', '\\xfe': 'th',\n    '\\xdf': 'ss'\n  };\n\n  /** Used to map characters to HTML entities. */\n  var htmlEscapes = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#39;',\n    '`': '&#96;'\n  };\n\n  /** Used to map HTML entities to characters. */\n  var htmlUnescapes = {\n    '&amp;': '&',\n    '&lt;': '<',\n    '&gt;': '>',\n    '&quot;': '\"',\n    '&#39;': \"'\",\n    '&#96;': '`'\n  };\n\n  /** Used to determine if values are of the language type `Object`. */\n  var objectTypes = {\n    'function': true,\n    'object': true\n  };\n\n  /** Used to escape characters for inclusion in compiled regexes. */\n  var regexpEscapes = {\n    '0': 'x30', '1': 'x31', '2': 'x32', '3': 'x33', '4': 'x34',\n    '5': 'x35', '6': 'x36', '7': 'x37', '8': 'x38', '9': 'x39',\n    'A': 'x41', 'B': 'x42', 'C': 'x43', 'D': 'x44', 'E': 'x45', 'F': 'x46',\n    'a': 'x61', 'b': 'x62', 'c': 'x63', 'd': 'x64', 'e': 'x65', 'f': 'x66',\n    'n': 'x6e', 'r': 'x72', 't': 'x74', 'u': 'x75', 'v': 'x76', 'x': 'x78'\n  };\n\n  /** Used to escape characters for inclusion in compiled string literals. */\n  var stringEscapes = {\n    '\\\\': '\\\\',\n    \"'\": \"'\",\n    '\\n': 'n',\n    '\\r': 'r',\n    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  /** Detect free variable `exports`. */\n  var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\n  /** Detect free variable `module`. */\n  var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;\n\n  /** Detect free variable `global` from Node.js. */\n  var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;\n\n  /** Detect free variable `self`. */\n  var freeSelf = objectTypes[typeof self] && self && self.Object && self;\n\n  /** Detect free variable `window`. */\n  var freeWindow = objectTypes[typeof window] && window && window.Object && window;\n\n  /** Detect the popular CommonJS extension `module.exports`. */\n  var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;\n\n  /**\n   * Used as a reference to the global object.\n   *\n   * The `this` value is used if it's the global object to avoid Greasemonkey's\n   * restricted `window` object, otherwise the `window` object is used.\n   */\n  var root = freeGlobal || ((freeWindow !== (this && this.window)) && freeWindow) || freeSelf || this;\n\n  /*--------------------------------------------------------------------------*/\n\n  /**\n   * The base implementation of `compareAscending` which compares values and\n   * sorts them in ascending order without guaranteeing a stable sort.\n   *\n   * @private\n   * @param {*} value The value to compare.\n   * @param {*} other The other value to compare.\n   * @returns {number} Returns the sort order indicator for `value`.\n   */\n  function baseCompareAscending(value, other) {\n    if (value !== other) {\n      var valIsNull = value === null,\n          valIsUndef = value === undefined,\n          valIsReflexive = value === value;\n\n      var othIsNull = other === null,\n          othIsUndef = other === undefined,\n          othIsReflexive = other === other;\n\n      if ((value > other && !othIsNull) || !valIsReflexive ||\n          (valIsNull && !othIsUndef && othIsReflexive) ||\n          (valIsUndef && othIsReflexive)) {\n        return 1;\n      }\n      if ((value < other && !valIsNull) || !othIsReflexive ||\n          (othIsNull && !valIsUndef && valIsReflexive) ||\n          (othIsUndef && valIsReflexive)) {\n        return -1;\n      }\n    }\n    return 0;\n  }\n\n  /**\n   * The base implementation of `_.findIndex` and `_.findLastIndex` without\n   * support for callback shorthands and `this` binding.\n   *\n   * @private\n   * @param {Array} array The array to search.\n   * @param {Function} predicate The function invoked per iteration.\n   * @param {boolean} [fromRight] Specify iterating from right to left.\n   * @returns {number} Returns the index of the matched value, else `-1`.\n   */\n  function baseFindIndex(array, predicate, fromRight) {\n    var length = array.length,\n        index = fromRight ? length : -1;\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (predicate(array[index], index, array)) {\n        return index;\n      }\n    }\n    return -1;\n  }\n\n  /**\n   * The base implementation of `_.indexOf` without support for binary searches.\n   *\n   * @private\n   * @param {Array} array The array to search.\n   * @param {*} value The value to search for.\n   * @param {number} fromIndex The index to search from.\n   * @returns {number} Returns the index of the matched value, else `-1`.\n   */\n  function baseIndexOf(array, value, fromIndex) {\n    if (value !== value) {\n      return indexOfNaN(array, fromIndex);\n    }\n    var index = fromIndex - 1,\n        length = array.length;\n\n    while (++index < length) {\n      if (array[index] === value) {\n        return index;\n      }\n    }\n    return -1;\n  }\n\n  /**\n   * The base implementation of `_.isFunction` without support for environments\n   * with incorrect `typeof` results.\n   *\n   * @private\n   * @param {*} value The value to check.\n   * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n   */\n  function baseIsFunction(value) {\n    // Avoid a Chakra JIT bug in compatibility modes of IE 11.\n    // See https://github.com/jashkenas/underscore/issues/1621 for more details.\n    return typeof value == 'function' || false;\n  }\n\n  /**\n   * Converts `value` to a string if it's not one. An empty string is returned\n   * for `null` or `undefined` values.\n   *\n   * @private\n   * @param {*} value The value to process.\n   * @returns {string} Returns the string.\n   */\n  function baseToString(value) {\n    return value == null ? '' : (value + '');\n  }\n\n  /**\n   * Used by `_.trim` and `_.trimLeft` to get the index of the first character\n   * of `string` that is not found in `chars`.\n   *\n   * @private\n   * @param {string} string The string to inspect.\n   * @param {string} chars The characters to find.\n   * @returns {number} Returns the index of the first character not found in `chars`.\n   */\n  function charsLeftIndex(string, chars) {\n    var index = -1,\n        length = string.length;\n\n    while (++index < length && chars.indexOf(string.charAt(index)) > -1) {}\n    return index;\n  }\n\n  /**\n   * Used by `_.trim` and `_.trimRight` to get the index of the last character\n   * of `string` that is not found in `chars`.\n   *\n   * @private\n   * @param {string} string The string to inspect.\n   * @param {string} chars The characters to find.\n   * @returns {number} Returns the index of the last character not found in `chars`.\n   */\n  function charsRightIndex(string, chars) {\n    var index = string.length;\n\n    while (index-- && chars.indexOf(string.charAt(index)) > -1) {}\n    return index;\n  }\n\n  /**\n   * Used by `_.sortBy` to compare transformed elements of a collection and stable\n   * sort them in ascending order.\n   *\n   * @private\n   * @param {Object} object The object to compare.\n   * @param {Object} other The other object to compare.\n   * @returns {number} Returns the sort order indicator for `object`.\n   */\n  function compareAscending(object, other) {\n    return baseCompareAscending(object.criteria, other.criteria) || (object.index - other.index);\n  }\n\n  /**\n   * Used by `_.sortByOrder` to compare multiple properties of a value to another\n   * and stable sort them.\n   *\n   * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,\n   * a value is sorted in ascending order if its corresponding order is \"asc\", and\n   * descending if \"desc\".\n   *\n   * @private\n   * @param {Object} object The object to compare.\n   * @param {Object} other The other object to compare.\n   * @param {boolean[]} orders The order to sort by for each property.\n   * @returns {number} Returns the sort order indicator for `object`.\n   */\n  function compareMultiple(object, other, orders) {\n    var index = -1,\n        objCriteria = object.criteria,\n        othCriteria = other.criteria,\n        length = objCriteria.length,\n        ordersLength = orders.length;\n\n    while (++index < length) {\n      var result = baseCompareAscending(objCriteria[index], othCriteria[index]);\n      if (result) {\n        if (index >= ordersLength) {\n          return result;\n        }\n        var order = orders[index];\n        return result * ((order === 'asc' || order === true) ? 1 : -1);\n      }\n    }\n    // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n    // that causes it, under certain circumstances, to provide the same value for\n    // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n    // for more details.\n    //\n    // This also ensures a stable sort in V8 and other engines.\n    // See https://code.google.com/p/v8/issues/detail?id=90 for more details.\n    return object.index - other.index;\n  }\n\n  /**\n   * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.\n   *\n   * @private\n   * @param {string} letter The matched letter to deburr.\n   * @returns {string} Returns the deburred letter.\n   */\n  function deburrLetter(letter) {\n    return deburredLetters[letter];\n  }\n\n  /**\n   * Used by `_.escape` to convert characters to HTML entities.\n   *\n   * @private\n   * @param {string} chr The matched character to escape.\n   * @returns {string} Returns the escaped character.\n   */\n  function escapeHtmlChar(chr) {\n    return htmlEscapes[chr];\n  }\n\n  /**\n   * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.\n   *\n   * @private\n   * @param {string} chr The matched character to escape.\n   * @param {string} leadingChar The capture group for a leading character.\n   * @param {string} whitespaceChar The capture group for a whitespace character.\n   * @returns {string} Returns the escaped character.\n   */\n  function escapeRegExpChar(chr, leadingChar, whitespaceChar) {\n    if (leadingChar) {\n      chr = regexpEscapes[chr];\n    } else if (whitespaceChar) {\n      chr = stringEscapes[chr];\n    }\n    return '\\\\' + chr;\n  }\n\n  /**\n   * Used by `_.template` to escape characters for inclusion in compiled string literals.\n   *\n   * @private\n   * @param {string} chr The matched character to escape.\n   * @returns {string} Returns the escaped character.\n   */\n  function escapeStringChar(chr) {\n    return '\\\\' + stringEscapes[chr];\n  }\n\n  /**\n   * Gets the index at which the first occurrence of `NaN` is found in `array`.\n   *\n   * @private\n   * @param {Array} array The array to search.\n   * @param {number} fromIndex The index to search from.\n   * @param {boolean} [fromRight] Specify iterating from right to left.\n   * @returns {number} Returns the index of the matched `NaN`, else `-1`.\n   */\n  function indexOfNaN(array, fromIndex, fromRight) {\n    var length = array.length,\n        index = fromIndex + (fromRight ? 0 : -1);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      var other = array[index];\n      if (other !== other) {\n        return index;\n      }\n    }\n    return -1;\n  }\n\n  /**\n   * Checks if `value` is object-like.\n   *\n   * @private\n   * @param {*} value The value to check.\n   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n   */\n  function isObjectLike(value) {\n    return !!value && typeof value == 'object';\n  }\n\n  /**\n   * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a\n   * character code is whitespace.\n   *\n   * @private\n   * @param {number} charCode The character code to inspect.\n   * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.\n   */\n  function isSpace(charCode) {\n    return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 ||\n      (charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279)));\n  }\n\n  /**\n   * Replaces all `placeholder` elements in `array` with an internal placeholder\n   * and returns an array of their indexes.\n   *\n   * @private\n   * @param {Array} array The array to modify.\n   * @param {*} placeholder The placeholder to replace.\n   * @returns {Array} Returns the new array of placeholder indexes.\n   */\n  function replaceHolders(array, placeholder) {\n    var index = -1,\n        length = array.length,\n        resIndex = -1,\n        result = [];\n\n    while (++index < length) {\n      if (array[index] === placeholder) {\n        array[index] = PLACEHOLDER;\n        result[++resIndex] = index;\n      }\n    }\n    return result;\n  }\n\n  /**\n   * An implementation of `_.uniq` optimized for sorted arrays without support\n   * for callback shorthands and `this` binding.\n   *\n   * @private\n   * @param {Array} array The array to inspect.\n   * @param {Function} [iteratee] The function invoked per iteration.\n   * @returns {Array} Returns the new duplicate-value-free array.\n   */\n  function sortedUniq(array, iteratee) {\n    var seen,\n        index = -1,\n        length = array.length,\n        resIndex = -1,\n        result = [];\n\n    while (++index < length) {\n      var value = array[index],\n          computed = iteratee ? iteratee(value, index, array) : value;\n\n      if (!index || seen !== computed) {\n        seen = computed;\n        result[++resIndex] = value;\n      }\n    }\n    return result;\n  }\n\n  /**\n   * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace\n   * character of `string`.\n   *\n   * @private\n   * @param {string} string The string to inspect.\n   * @returns {number} Returns the index of the first non-whitespace character.\n   */\n  function trimmedLeftIndex(string) {\n    var index = -1,\n        length = string.length;\n\n    while (++index < length && isSpace(string.charCodeAt(index))) {}\n    return index;\n  }\n\n  /**\n   * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace\n   * character of `string`.\n   *\n   * @private\n   * @param {string} string The string to inspect.\n   * @returns {number} Returns the index of the last non-whitespace character.\n   */\n  function trimmedRightIndex(string) {\n    var index = string.length;\n\n    while (index-- && isSpace(string.charCodeAt(index))) {}\n    return index;\n  }\n\n  /**\n   * Used by `_.unescape` to convert HTML entities to characters.\n   *\n   * @private\n   * @param {string} chr The matched character to unescape.\n   * @returns {string} Returns the unescaped character.\n   */\n  function unescapeHtmlChar(chr) {\n    return htmlUnescapes[chr];\n  }\n\n  /*--------------------------------------------------------------------------*/\n\n  /**\n   * Create a new pristine `lodash` function using the given `context` object.\n   *\n   * @static\n   * @memberOf _\n   * @category Utility\n   * @param {Object} [context=root] The context object.\n   * @returns {Function} Returns a new `lodash` function.\n   * @example\n   *\n   * _.mixin({ 'foo': _.constant('foo') });\n   *\n   * var lodash = _.runInContext();\n   * lodash.mixin({ 'bar': lodash.constant('bar') });\n   *\n   * _.isFunction(_.foo);\n   * // => true\n   * _.isFunction(_.bar);\n   * // => false\n   *\n   * lodash.isFunction(lodash.foo);\n   * // => false\n   * lodash.isFunction(lodash.bar);\n   * // => true\n   *\n   * // using `context` to mock `Date#getTime` use in `_.now`\n   * var mock = _.runInContext({\n   *   'Date': function() {\n   *     return { 'getTime': getTimeMock };\n   *   }\n   * });\n   *\n   * // or creating a suped-up `defer` in Node.js\n   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n   */\n  function runInContext(context) {\n    // Avoid issues with some ES3 environments that attempt to use values, named\n    // after built-in constructors like `Object`, for the creation of literals.\n    // ES5 clears this up by stating that literals must use built-in constructors.\n    // See https://es5.github.io/#x11.1.5 for more details.\n    context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;\n\n    /** Native constructor references. */\n    var Array = context.Array,\n        Date = context.Date,\n        Error = context.Error,\n        Function = context.Function,\n        Math = context.Math,\n        Number = context.Number,\n        Object = context.Object,\n        RegExp = context.RegExp,\n        String = context.String,\n        TypeError = context.TypeError;\n\n    /** Used for native method references. */\n    var arrayProto = Array.prototype,\n        objectProto = Object.prototype,\n        stringProto = String.prototype;\n\n    /** Used to resolve the decompiled source of functions. */\n    var fnToString = Function.prototype.toString;\n\n    /** Used to check objects for own properties. */\n    var hasOwnProperty = objectProto.hasOwnProperty;\n\n    /** Used to generate unique IDs. */\n    var idCounter = 0;\n\n    /**\n     * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)\n     * of values.\n     */\n    var objToString = objectProto.toString;\n\n    /** Used to restore the original `_` reference in `_.noConflict`. */\n    var oldDash = root._;\n\n    /** Used to detect if a method is native. */\n    var reIsNative = RegExp('^' +\n      fnToString.call(hasOwnProperty).replace(/[\\\\^$.*+?()[\\]{}|]/g, '\\\\$&')\n      .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n    );\n\n    /** Native method references. */\n    var ArrayBuffer = context.ArrayBuffer,\n        clearTimeout = context.clearTimeout,\n        parseFloat = context.parseFloat,\n        pow = Math.pow,\n        propertyIsEnumerable = objectProto.propertyIsEnumerable,\n        Set = getNative(context, 'Set'),\n        setTimeout = context.setTimeout,\n        splice = arrayProto.splice,\n        Uint8Array = context.Uint8Array,\n        WeakMap = getNative(context, 'WeakMap');\n\n    /* Native method references for those with the same name as other `lodash` methods. */\n    var nativeCeil = Math.ceil,\n        nativeCreate = getNative(Object, 'create'),\n        nativeFloor = Math.floor,\n        nativeIsArray = getNative(Array, 'isArray'),\n        nativeIsFinite = context.isFinite,\n        nativeKeys = getNative(Object, 'keys'),\n        nativeMax = Math.max,\n        nativeMin = Math.min,\n        nativeNow = getNative(Date, 'now'),\n        nativeParseInt = context.parseInt,\n        nativeRandom = Math.random;\n\n    /** Used as references for `-Infinity` and `Infinity`. */\n    var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY,\n        POSITIVE_INFINITY = Number.POSITIVE_INFINITY;\n\n    /** Used as references for the maximum length and index of an array. */\n    var MAX_ARRAY_LENGTH = 4294967295,\n        MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n        HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n    /**\n     * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)\n     * of an array-like value.\n     */\n    var MAX_SAFE_INTEGER = 9007199254740991;\n\n    /** Used to store function metadata. */\n    var metaMap = WeakMap && new WeakMap;\n\n    /** Used to lookup unminified function names. */\n    var realNames = {};\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a `lodash` object which wraps `value` to enable implicit chaining.\n     * Methods that operate on and return arrays, collections, and functions can\n     * be chained together. Methods that retrieve a single value or may return a\n     * primitive value will automatically end the chain returning the unwrapped\n     * value. Explicit chaining may be enabled using `_.chain`. The execution of\n     * chained methods is lazy, that is, execution is deferred until `_#value`\n     * is implicitly or explicitly called.\n     *\n     * Lazy evaluation allows several methods to support shortcut fusion. Shortcut\n     * fusion is an optimization strategy which merge iteratee calls; this can help\n     * to avoid the creation of intermediate data structures and greatly reduce the\n     * number of iteratee executions.\n     *\n     * Chaining is supported in custom builds as long as the `_#value` method is\n     * directly or indirectly included in the build.\n     *\n     * In addition to lodash methods, wrappers have `Array` and `String` methods.\n     *\n     * The wrapper `Array` methods are:\n     * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,\n     * `splice`, and `unshift`\n     *\n     * The wrapper `String` methods are:\n     * `replace` and `split`\n     *\n     * The wrapper methods that support shortcut fusion are:\n     * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,\n     * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,\n     * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,\n     * and `where`\n     *\n     * The chainable wrapper methods are:\n     * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,\n     * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,\n     * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,\n     * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,\n     * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,\n     * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,\n     * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,\n     * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,\n     * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,\n     * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,\n     * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,\n     * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,\n     * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,\n     * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,\n     * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,\n     * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,\n     * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`\n     *\n     * The wrapper methods that are **not** chainable by default are:\n     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,\n     * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,\n     * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,\n     * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,\n     * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,\n     * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,\n     * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,\n     * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,\n     * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,\n     * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,\n     * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,\n     * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,\n     * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,\n     * `unescape`, `uniqueId`, `value`, and `words`\n     *\n     * The wrapper method `sample` will return a wrapped value when `n` is provided,\n     * otherwise an unwrapped value is returned.\n     *\n     * @name _\n     * @constructor\n     * @category Chain\n     * @param {*} value The value to wrap in a `lodash` instance.\n     * @returns {Object} Returns the new `lodash` wrapper instance.\n     * @example\n     *\n     * var wrapped = _([1, 2, 3]);\n     *\n     * // returns an unwrapped value\n     * wrapped.reduce(function(total, n) {\n     *   return total + n;\n     * });\n     * // => 6\n     *\n     * // returns a wrapped value\n     * var squares = wrapped.map(function(n) {\n     *   return n * n;\n     * });\n     *\n     * _.isArray(squares);\n     * // => false\n     *\n     * _.isArray(squares.value());\n     * // => true\n     */\n    function lodash(value) {\n      if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n        if (value instanceof LodashWrapper) {\n          return value;\n        }\n        if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {\n          return wrapperClone(value);\n        }\n      }\n      return new LodashWrapper(value);\n    }\n\n    /**\n     * The function whose prototype all chaining wrappers inherit from.\n     *\n     * @private\n     */\n    function baseLodash() {\n      // No operation performed.\n    }\n\n    /**\n     * The base constructor for creating `lodash` wrapper objects.\n     *\n     * @private\n     * @param {*} value The value to wrap.\n     * @param {boolean} [chainAll] Enable chaining for all wrapper methods.\n     * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.\n     */\n    function LodashWrapper(value, chainAll, actions) {\n      this.__wrapped__ = value;\n      this.__actions__ = actions || [];\n      this.__chain__ = !!chainAll;\n    }\n\n    /**\n     * An object environment feature flags.\n     *\n     * @static\n     * @memberOf _\n     * @type Object\n     */\n    var support = lodash.support = {};\n\n    /**\n     * By default, the template delimiters used by lodash are like those in\n     * embedded Ruby (ERB). Change the following template settings to use\n     * alternative delimiters.\n     *\n     * @static\n     * @memberOf _\n     * @type Object\n     */\n    lodash.templateSettings = {\n\n      /**\n       * Used to detect `data` property values to be HTML-escaped.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'escape': reEscape,\n\n      /**\n       * Used to detect code to be evaluated.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'evaluate': reEvaluate,\n\n      /**\n       * Used to detect `data` property values to inject.\n       *\n       * @memberOf _.templateSettings\n       * @type RegExp\n       */\n      'interpolate': reInterpolate,\n\n      /**\n       * Used to reference the data object in the template text.\n       *\n       * @memberOf _.templateSettings\n       * @type string\n       */\n      'variable': '',\n\n      /**\n       * Used to import variables into the compiled template.\n       *\n       * @memberOf _.templateSettings\n       * @type Object\n       */\n      'imports': {\n\n        /**\n         * A reference to the `lodash` function.\n         *\n         * @memberOf _.templateSettings.imports\n         * @type Function\n         */\n        '_': lodash\n      }\n    };\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n     *\n     * @private\n     * @param {*} value The value to wrap.\n     */\n    function LazyWrapper(value) {\n      this.__wrapped__ = value;\n      this.__actions__ = [];\n      this.__dir__ = 1;\n      this.__filtered__ = false;\n      this.__iteratees__ = [];\n      this.__takeCount__ = POSITIVE_INFINITY;\n      this.__views__ = [];\n    }\n\n    /**\n     * Creates a clone of the lazy wrapper object.\n     *\n     * @private\n     * @name clone\n     * @memberOf LazyWrapper\n     * @returns {Object} Returns the cloned `LazyWrapper` object.\n     */\n    function lazyClone() {\n      var result = new LazyWrapper(this.__wrapped__);\n      result.__actions__ = arrayCopy(this.__actions__);\n      result.__dir__ = this.__dir__;\n      result.__filtered__ = this.__filtered__;\n      result.__iteratees__ = arrayCopy(this.__iteratees__);\n      result.__takeCount__ = this.__takeCount__;\n      result.__views__ = arrayCopy(this.__views__);\n      return result;\n    }\n\n    /**\n     * Reverses the direction of lazy iteration.\n     *\n     * @private\n     * @name reverse\n     * @memberOf LazyWrapper\n     * @returns {Object} Returns the new reversed `LazyWrapper` object.\n     */\n    function lazyReverse() {\n      if (this.__filtered__) {\n        var result = new LazyWrapper(this);\n        result.__dir__ = -1;\n        result.__filtered__ = true;\n      } else {\n        result = this.clone();\n        result.__dir__ *= -1;\n      }\n      return result;\n    }\n\n    /**\n     * Extracts the unwrapped value from its lazy wrapper.\n     *\n     * @private\n     * @name value\n     * @memberOf LazyWrapper\n     * @returns {*} Returns the unwrapped value.\n     */\n    function lazyValue() {\n      var array = this.__wrapped__.value(),\n          dir = this.__dir__,\n          isArr = isArray(array),\n          isRight = dir < 0,\n          arrLength = isArr ? array.length : 0,\n          view = getView(0, arrLength, this.__views__),\n          start = view.start,\n          end = view.end,\n          length = end - start,\n          index = isRight ? end : (start - 1),\n          iteratees = this.__iteratees__,\n          iterLength = iteratees.length,\n          resIndex = 0,\n          takeCount = nativeMin(length, this.__takeCount__);\n\n      if (!isArr || arrLength < LARGE_ARRAY_SIZE || (arrLength == length && takeCount == length)) {\n        return baseWrapperValue((isRight && isArr) ? array.reverse() : array, this.__actions__);\n      }\n      var result = [];\n\n      outer:\n      while (length-- && resIndex < takeCount) {\n        index += dir;\n\n        var iterIndex = -1,\n            value = array[index];\n\n        while (++iterIndex < iterLength) {\n          var data = iteratees[iterIndex],\n              iteratee = data.iteratee,\n              type = data.type,\n              computed = iteratee(value);\n\n          if (type == LAZY_MAP_FLAG) {\n            value = computed;\n          } else if (!computed) {\n            if (type == LAZY_FILTER_FLAG) {\n              continue outer;\n            } else {\n              break outer;\n            }\n          }\n        }\n        result[resIndex++] = value;\n      }\n      return result;\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a cache object to store key/value pairs.\n     *\n     * @private\n     * @static\n     * @name Cache\n     * @memberOf _.memoize\n     */\n    function MapCache() {\n      this.__data__ = {};\n    }\n\n    /**\n     * Removes `key` and its value from the cache.\n     *\n     * @private\n     * @name delete\n     * @memberOf _.memoize.Cache\n     * @param {string} key The key of the value to remove.\n     * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.\n     */\n    function mapDelete(key) {\n      return this.has(key) && delete this.__data__[key];\n    }\n\n    /**\n     * Gets the cached value for `key`.\n     *\n     * @private\n     * @name get\n     * @memberOf _.memoize.Cache\n     * @param {string} key The key of the value to get.\n     * @returns {*} Returns the cached value.\n     */\n    function mapGet(key) {\n      return key == '__proto__' ? undefined : this.__data__[key];\n    }\n\n    /**\n     * Checks if a cached value for `key` exists.\n     *\n     * @private\n     * @name has\n     * @memberOf _.memoize.Cache\n     * @param {string} key The key of the entry to check.\n     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n     */\n    function mapHas(key) {\n      return key != '__proto__' && hasOwnProperty.call(this.__data__, key);\n    }\n\n    /**\n     * Sets `value` to `key` of the cache.\n     *\n     * @private\n     * @name set\n     * @memberOf _.memoize.Cache\n     * @param {string} key The key of the value to cache.\n     * @param {*} value The value to cache.\n     * @returns {Object} Returns the cache object.\n     */\n    function mapSet(key, value) {\n      if (key != '__proto__') {\n        this.__data__[key] = value;\n      }\n      return this;\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     *\n     * Creates a cache object to store unique values.\n     *\n     * @private\n     * @param {Array} [values] The values to cache.\n     */\n    function SetCache(values) {\n      var length = values ? values.length : 0;\n\n      this.data = { 'hash': nativeCreate(null), 'set': new Set };\n      while (length--) {\n        this.push(values[length]);\n      }\n    }\n\n    /**\n     * Checks if `value` is in `cache` mimicking the return signature of\n     * `_.indexOf` by returning `0` if the value is found, else `-1`.\n     *\n     * @private\n     * @param {Object} cache The cache to search.\n     * @param {*} value The value to search for.\n     * @returns {number} Returns `0` if `value` is found, else `-1`.\n     */\n    function cacheIndexOf(cache, value) {\n      var data = cache.data,\n          result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value];\n\n      return result ? 0 : -1;\n    }\n\n    /**\n     * Adds `value` to the cache.\n     *\n     * @private\n     * @name push\n     * @memberOf SetCache\n     * @param {*} value The value to cache.\n     */\n    function cachePush(value) {\n      var data = this.data;\n      if (typeof value == 'string' || isObject(value)) {\n        data.set.add(value);\n      } else {\n        data.hash[value] = true;\n      }\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a new array joining `array` with `other`.\n     *\n     * @private\n     * @param {Array} array The array to join.\n     * @param {Array} other The other array to join.\n     * @returns {Array} Returns the new concatenated array.\n     */\n    function arrayConcat(array, other) {\n      var index = -1,\n          length = array.length,\n          othIndex = -1,\n          othLength = other.length,\n          result = Array(length + othLength);\n\n      while (++index < length) {\n        result[index] = array[index];\n      }\n      while (++othIndex < othLength) {\n        result[index++] = other[othIndex];\n      }\n      return result;\n    }\n\n    /**\n     * Copies the values of `source` to `array`.\n     *\n     * @private\n     * @param {Array} source The array to copy values from.\n     * @param {Array} [array=[]] The array to copy values to.\n     * @returns {Array} Returns `array`.\n     */\n    function arrayCopy(source, array) {\n      var index = -1,\n          length = source.length;\n\n      array || (array = Array(length));\n      while (++index < length) {\n        array[index] = source[index];\n      }\n      return array;\n    }\n\n    /**\n     * A specialized version of `_.forEach` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array} Returns `array`.\n     */\n    function arrayEach(array, iteratee) {\n      var index = -1,\n          length = array.length;\n\n      while (++index < length) {\n        if (iteratee(array[index], index, array) === false) {\n          break;\n        }\n      }\n      return array;\n    }\n\n    /**\n     * A specialized version of `_.forEachRight` for arrays without support for\n     * callback shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array} Returns `array`.\n     */\n    function arrayEachRight(array, iteratee) {\n      var length = array.length;\n\n      while (length--) {\n        if (iteratee(array[length], length, array) === false) {\n          break;\n        }\n      }\n      return array;\n    }\n\n    /**\n     * A specialized version of `_.every` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {boolean} Returns `true` if all elements pass the predicate check,\n     *  else `false`.\n     */\n    function arrayEvery(array, predicate) {\n      var index = -1,\n          length = array.length;\n\n      while (++index < length) {\n        if (!predicate(array[index], index, array)) {\n          return false;\n        }\n      }\n      return true;\n    }\n\n    /**\n     * A specialized version of `baseExtremum` for arrays which invokes `iteratee`\n     * with one argument: (value).\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {Function} comparator The function used to compare values.\n     * @param {*} exValue The initial extremum value.\n     * @returns {*} Returns the extremum value.\n     */\n    function arrayExtremum(array, iteratee, comparator, exValue) {\n      var index = -1,\n          length = array.length,\n          computed = exValue,\n          result = computed;\n\n      while (++index < length) {\n        var value = array[index],\n            current = +iteratee(value);\n\n        if (comparator(current, computed)) {\n          computed = current;\n          result = value;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * A specialized version of `_.filter` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {Array} Returns the new filtered array.\n     */\n    function arrayFilter(array, predicate) {\n      var index = -1,\n          length = array.length,\n          resIndex = -1,\n          result = [];\n\n      while (++index < length) {\n        var value = array[index];\n        if (predicate(value, index, array)) {\n          result[++resIndex] = value;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * A specialized version of `_.map` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array} Returns the new mapped array.\n     */\n    function arrayMap(array, iteratee) {\n      var index = -1,\n          length = array.length,\n          result = Array(length);\n\n      while (++index < length) {\n        result[index] = iteratee(array[index], index, array);\n      }\n      return result;\n    }\n\n    /**\n     * Appends the elements of `values` to `array`.\n     *\n     * @private\n     * @param {Array} array The array to modify.\n     * @param {Array} values The values to append.\n     * @returns {Array} Returns `array`.\n     */\n    function arrayPush(array, values) {\n      var index = -1,\n          length = values.length,\n          offset = array.length;\n\n      while (++index < length) {\n        array[offset + index] = values[index];\n      }\n      return array;\n    }\n\n    /**\n     * A specialized version of `_.reduce` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {*} [accumulator] The initial value.\n     * @param {boolean} [initFromArray] Specify using the first element of `array`\n     *  as the initial value.\n     * @returns {*} Returns the accumulated value.\n     */\n    function arrayReduce(array, iteratee, accumulator, initFromArray) {\n      var index = -1,\n          length = array.length;\n\n      if (initFromArray && length) {\n        accumulator = array[++index];\n      }\n      while (++index < length) {\n        accumulator = iteratee(accumulator, array[index], index, array);\n      }\n      return accumulator;\n    }\n\n    /**\n     * A specialized version of `_.reduceRight` for arrays without support for\n     * callback shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {*} [accumulator] The initial value.\n     * @param {boolean} [initFromArray] Specify using the last element of `array`\n     *  as the initial value.\n     * @returns {*} Returns the accumulated value.\n     */\n    function arrayReduceRight(array, iteratee, accumulator, initFromArray) {\n      var length = array.length;\n      if (initFromArray && length) {\n        accumulator = array[--length];\n      }\n      while (length--) {\n        accumulator = iteratee(accumulator, array[length], length, array);\n      }\n      return accumulator;\n    }\n\n    /**\n     * A specialized version of `_.some` for arrays without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {boolean} Returns `true` if any element passes the predicate check,\n     *  else `false`.\n     */\n    function arraySome(array, predicate) {\n      var index = -1,\n          length = array.length;\n\n      while (++index < length) {\n        if (predicate(array[index], index, array)) {\n          return true;\n        }\n      }\n      return false;\n    }\n\n    /**\n     * A specialized version of `_.sum` for arrays without support for callback\n     * shorthands and `this` binding..\n     *\n     * @private\n     * @param {Array} array The array to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {number} Returns the sum.\n     */\n    function arraySum(array, iteratee) {\n      var length = array.length,\n          result = 0;\n\n      while (length--) {\n        result += +iteratee(array[length]) || 0;\n      }\n      return result;\n    }\n\n    /**\n     * Used by `_.defaults` to customize its `_.assign` use.\n     *\n     * @private\n     * @param {*} objectValue The destination object property value.\n     * @param {*} sourceValue The source object property value.\n     * @returns {*} Returns the value to assign to the destination object.\n     */\n    function assignDefaults(objectValue, sourceValue) {\n      return objectValue === undefined ? sourceValue : objectValue;\n    }\n\n    /**\n     * Used by `_.template` to customize its `_.assign` use.\n     *\n     * **Note:** This function is like `assignDefaults` except that it ignores\n     * inherited property values when checking if a property is `undefined`.\n     *\n     * @private\n     * @param {*} objectValue The destination object property value.\n     * @param {*} sourceValue The source object property value.\n     * @param {string} key The key associated with the object and source values.\n     * @param {Object} object The destination object.\n     * @returns {*} Returns the value to assign to the destination object.\n     */\n    function assignOwnDefaults(objectValue, sourceValue, key, object) {\n      return (objectValue === undefined || !hasOwnProperty.call(object, key))\n        ? sourceValue\n        : objectValue;\n    }\n\n    /**\n     * A specialized version of `_.assign` for customizing assigned values without\n     * support for argument juggling, multiple sources, and `this` binding `customizer`\n     * functions.\n     *\n     * @private\n     * @param {Object} object The destination object.\n     * @param {Object} source The source object.\n     * @param {Function} customizer The function to customize assigned values.\n     * @returns {Object} Returns `object`.\n     */\n    function assignWith(object, source, customizer) {\n      var index = -1,\n          props = keys(source),\n          length = props.length;\n\n      while (++index < length) {\n        var key = props[index],\n            value = object[key],\n            result = customizer(value, source[key], key, object, source);\n\n        if ((result === result ? (result !== value) : (value === value)) ||\n            (value === undefined && !(key in object))) {\n          object[key] = result;\n        }\n      }\n      return object;\n    }\n\n    /**\n     * The base implementation of `_.assign` without support for argument juggling,\n     * multiple sources, and `customizer` functions.\n     *\n     * @private\n     * @param {Object} object The destination object.\n     * @param {Object} source The source object.\n     * @returns {Object} Returns `object`.\n     */\n    function baseAssign(object, source) {\n      return source == null\n        ? object\n        : baseCopy(source, keys(source), object);\n    }\n\n    /**\n     * The base implementation of `_.at` without support for string collections\n     * and individual key arguments.\n     *\n     * @private\n     * @param {Array|Object} collection The collection to iterate over.\n     * @param {number[]|string[]} props The property names or indexes of elements to pick.\n     * @returns {Array} Returns the new array of picked elements.\n     */\n    function baseAt(collection, props) {\n      var index = -1,\n          isNil = collection == null,\n          isArr = !isNil && isArrayLike(collection),\n          length = isArr ? collection.length : 0,\n          propsLength = props.length,\n          result = Array(propsLength);\n\n      while(++index < propsLength) {\n        var key = props[index];\n        if (isArr) {\n          result[index] = isIndex(key, length) ? collection[key] : undefined;\n        } else {\n          result[index] = isNil ? undefined : collection[key];\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Copies properties of `source` to `object`.\n     *\n     * @private\n     * @param {Object} source The object to copy properties from.\n     * @param {Array} props The property names to copy.\n     * @param {Object} [object={}] The object to copy properties to.\n     * @returns {Object} Returns `object`.\n     */\n    function baseCopy(source, props, object) {\n      object || (object = {});\n\n      var index = -1,\n          length = props.length;\n\n      while (++index < length) {\n        var key = props[index];\n        object[key] = source[key];\n      }\n      return object;\n    }\n\n    /**\n     * The base implementation of `_.callback` which supports specifying the\n     * number of arguments to provide to `func`.\n     *\n     * @private\n     * @param {*} [func=_.identity] The value to convert to a callback.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param {number} [argCount] The number of arguments to provide to `func`.\n     * @returns {Function} Returns the callback.\n     */\n    function baseCallback(func, thisArg, argCount) {\n      var type = typeof func;\n      if (type == 'function') {\n        return thisArg === undefined\n          ? func\n          : bindCallback(func, thisArg, argCount);\n      }\n      if (func == null) {\n        return identity;\n      }\n      if (type == 'object') {\n        return baseMatches(func);\n      }\n      return thisArg === undefined\n        ? property(func)\n        : baseMatchesProperty(func, thisArg);\n    }\n\n    /**\n     * The base implementation of `_.clone` without support for argument juggling\n     * and `this` binding `customizer` functions.\n     *\n     * @private\n     * @param {*} value The value to clone.\n     * @param {boolean} [isDeep] Specify a deep clone.\n     * @param {Function} [customizer] The function to customize cloning values.\n     * @param {string} [key] The key of `value`.\n     * @param {Object} [object] The object `value` belongs to.\n     * @param {Array} [stackA=[]] Tracks traversed source objects.\n     * @param {Array} [stackB=[]] Associates clones with source counterparts.\n     * @returns {*} Returns the cloned value.\n     */\n    function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {\n      var result;\n      if (customizer) {\n        result = object ? customizer(value, key, object) : customizer(value);\n      }\n      if (result !== undefined) {\n        return result;\n      }\n      if (!isObject(value)) {\n        return value;\n      }\n      var isArr = isArray(value);\n      if (isArr) {\n        result = initCloneArray(value);\n        if (!isDeep) {\n          return arrayCopy(value, result);\n        }\n      } else {\n        var tag = objToString.call(value),\n            isFunc = tag == funcTag;\n\n        if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n          result = initCloneObject(isFunc ? {} : value);\n          if (!isDeep) {\n            return baseAssign(result, value);\n          }\n        } else {\n          return cloneableTags[tag]\n            ? initCloneByTag(value, tag, isDeep)\n            : (object ? value : {});\n        }\n      }\n      // Check for circular references and return its corresponding clone.\n      stackA || (stackA = []);\n      stackB || (stackB = []);\n\n      var length = stackA.length;\n      while (length--) {\n        if (stackA[length] == value) {\n          return stackB[length];\n        }\n      }\n      // Add the source value to the stack of traversed objects and associate it with its clone.\n      stackA.push(value);\n      stackB.push(result);\n\n      // Recursively populate clone (susceptible to call stack limits).\n      (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) {\n        result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.create` without support for assigning\n     * properties to the created object.\n     *\n     * @private\n     * @param {Object} prototype The object to inherit from.\n     * @returns {Object} Returns the new object.\n     */\n    var baseCreate = (function() {\n      function object() {}\n      return function(prototype) {\n        if (isObject(prototype)) {\n          object.prototype = prototype;\n          var result = new object;\n          object.prototype = undefined;\n        }\n        return result || {};\n      };\n    }());\n\n    /**\n     * The base implementation of `_.delay` and `_.defer` which accepts an index\n     * of where to slice the arguments to provide to `func`.\n     *\n     * @private\n     * @param {Function} func The function to delay.\n     * @param {number} wait The number of milliseconds to delay invocation.\n     * @param {Object} args The arguments provide to `func`.\n     * @returns {number} Returns the timer id.\n     */\n    function baseDelay(func, wait, args) {\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      return setTimeout(function() { func.apply(undefined, args); }, wait);\n    }\n\n    /**\n     * The base implementation of `_.difference` which accepts a single array\n     * of values to exclude.\n     *\n     * @private\n     * @param {Array} array The array to inspect.\n     * @param {Array} values The values to exclude.\n     * @returns {Array} Returns the new array of filtered values.\n     */\n    function baseDifference(array, values) {\n      var length = array ? array.length : 0,\n          result = [];\n\n      if (!length) {\n        return result;\n      }\n      var index = -1,\n          indexOf = getIndexOf(),\n          isCommon = indexOf == baseIndexOf,\n          cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null,\n          valuesLength = values.length;\n\n      if (cache) {\n        indexOf = cacheIndexOf;\n        isCommon = false;\n        values = cache;\n      }\n      outer:\n      while (++index < length) {\n        var value = array[index];\n\n        if (isCommon && value === value) {\n          var valuesIndex = valuesLength;\n          while (valuesIndex--) {\n            if (values[valuesIndex] === value) {\n              continue outer;\n            }\n          }\n          result.push(value);\n        }\n        else if (indexOf(values, value, 0) < 0) {\n          result.push(value);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.forEach` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array|Object|string} Returns `collection`.\n     */\n    var baseEach = createBaseEach(baseForOwn);\n\n    /**\n     * The base implementation of `_.forEachRight` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array|Object|string} Returns `collection`.\n     */\n    var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n    /**\n     * The base implementation of `_.every` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {boolean} Returns `true` if all elements pass the predicate check,\n     *  else `false`\n     */\n    function baseEvery(collection, predicate) {\n      var result = true;\n      baseEach(collection, function(value, index, collection) {\n        result = !!predicate(value, index, collection);\n        return result;\n      });\n      return result;\n    }\n\n    /**\n     * Gets the extremum value of `collection` invoking `iteratee` for each value\n     * in `collection` to generate the criterion by which the value is ranked.\n     * The `iteratee` is invoked with three arguments: (value, index|key, collection).\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {Function} comparator The function used to compare values.\n     * @param {*} exValue The initial extremum value.\n     * @returns {*} Returns the extremum value.\n     */\n    function baseExtremum(collection, iteratee, comparator, exValue) {\n      var computed = exValue,\n          result = computed;\n\n      baseEach(collection, function(value, index, collection) {\n        var current = +iteratee(value, index, collection);\n        if (comparator(current, computed) || (current === exValue && current === result)) {\n          computed = current;\n          result = value;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.fill` without an iteratee call guard.\n     *\n     * @private\n     * @param {Array} array The array to fill.\n     * @param {*} value The value to fill `array` with.\n     * @param {number} [start=0] The start position.\n     * @param {number} [end=array.length] The end position.\n     * @returns {Array} Returns `array`.\n     */\n    function baseFill(array, value, start, end) {\n      var length = array.length;\n\n      start = start == null ? 0 : (+start || 0);\n      if (start < 0) {\n        start = -start > length ? 0 : (length + start);\n      }\n      end = (end === undefined || end > length) ? length : (+end || 0);\n      if (end < 0) {\n        end += length;\n      }\n      length = start > end ? 0 : (end >>> 0);\n      start >>>= 0;\n\n      while (start < length) {\n        array[start++] = value;\n      }\n      return array;\n    }\n\n    /**\n     * The base implementation of `_.filter` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {Array} Returns the new filtered array.\n     */\n    function baseFilter(collection, predicate) {\n      var result = [];\n      baseEach(collection, function(value, index, collection) {\n        if (predicate(value, index, collection)) {\n          result.push(value);\n        }\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,\n     * without support for callback shorthands and `this` binding, which iterates\n     * over `collection` using the provided `eachFunc`.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {Function} predicate The function invoked per iteration.\n     * @param {Function} eachFunc The function to iterate over `collection`.\n     * @param {boolean} [retKey] Specify returning the key of the found element\n     *  instead of the element itself.\n     * @returns {*} Returns the found element or its key, else `undefined`.\n     */\n    function baseFind(collection, predicate, eachFunc, retKey) {\n      var result;\n      eachFunc(collection, function(value, key, collection) {\n        if (predicate(value, key, collection)) {\n          result = retKey ? key : value;\n          return false;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.flatten` with added support for restricting\n     * flattening and specifying the start index.\n     *\n     * @private\n     * @param {Array} array The array to flatten.\n     * @param {boolean} [isDeep] Specify a deep flatten.\n     * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.\n     * @param {Array} [result=[]] The initial result value.\n     * @returns {Array} Returns the new flattened array.\n     */\n    function baseFlatten(array, isDeep, isStrict, result) {\n      result || (result = []);\n\n      var index = -1,\n          length = array.length;\n\n      while (++index < length) {\n        var value = array[index];\n        if (isObjectLike(value) && isArrayLike(value) &&\n            (isStrict || isArray(value) || isArguments(value))) {\n          if (isDeep) {\n            // Recursively flatten arrays (susceptible to call stack limits).\n            baseFlatten(value, isDeep, isStrict, result);\n          } else {\n            arrayPush(result, value);\n          }\n        } else if (!isStrict) {\n          result[result.length] = value;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `baseForIn` and `baseForOwn` which iterates\n     * over `object` properties returned by `keysFunc` invoking `iteratee` for\n     * each property. Iteratee functions may exit iteration early by explicitly\n     * returning `false`.\n     *\n     * @private\n     * @param {Object} object The object to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {Function} keysFunc The function to get the keys of `object`.\n     * @returns {Object} Returns `object`.\n     */\n    var baseFor = createBaseFor();\n\n    /**\n     * This function is like `baseFor` except that it iterates over properties\n     * in the opposite order.\n     *\n     * @private\n     * @param {Object} object The object to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {Function} keysFunc The function to get the keys of `object`.\n     * @returns {Object} Returns `object`.\n     */\n    var baseForRight = createBaseFor(true);\n\n    /**\n     * The base implementation of `_.forIn` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Object} object The object to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Object} Returns `object`.\n     */\n    function baseForIn(object, iteratee) {\n      return baseFor(object, iteratee, keysIn);\n    }\n\n    /**\n     * The base implementation of `_.forOwn` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Object} object The object to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Object} Returns `object`.\n     */\n    function baseForOwn(object, iteratee) {\n      return baseFor(object, iteratee, keys);\n    }\n\n    /**\n     * The base implementation of `_.forOwnRight` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Object} object The object to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Object} Returns `object`.\n     */\n    function baseForOwnRight(object, iteratee) {\n      return baseForRight(object, iteratee, keys);\n    }\n\n    /**\n     * The base implementation of `_.functions` which creates an array of\n     * `object` function property names filtered from those provided.\n     *\n     * @private\n     * @param {Object} object The object to inspect.\n     * @param {Array} props The property names to filter.\n     * @returns {Array} Returns the new array of filtered property names.\n     */\n    function baseFunctions(object, props) {\n      var index = -1,\n          length = props.length,\n          resIndex = -1,\n          result = [];\n\n      while (++index < length) {\n        var key = props[index];\n        if (isFunction(object[key])) {\n          result[++resIndex] = key;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `get` without support for string paths\n     * and default values.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @param {Array} path The path of the property to get.\n     * @param {string} [pathKey] The key representation of path.\n     * @returns {*} Returns the resolved value.\n     */\n    function baseGet(object, path, pathKey) {\n      if (object == null) {\n        return;\n      }\n      if (pathKey !== undefined && pathKey in toObject(object)) {\n        path = [pathKey];\n      }\n      var index = 0,\n          length = path.length;\n\n      while (object != null && index < length) {\n        object = object[path[index++]];\n      }\n      return (index && index == length) ? object : undefined;\n    }\n\n    /**\n     * The base implementation of `_.isEqual` without support for `this` binding\n     * `customizer` functions.\n     *\n     * @private\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @param {Function} [customizer] The function to customize comparing values.\n     * @param {boolean} [isLoose] Specify performing partial comparisons.\n     * @param {Array} [stackA] Tracks traversed `value` objects.\n     * @param {Array} [stackB] Tracks traversed `other` objects.\n     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n     */\n    function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {\n      if (value === other) {\n        return true;\n      }\n      if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n        return value !== value && other !== other;\n      }\n      return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);\n    }\n\n    /**\n     * A specialized version of `baseIsEqual` for arrays and objects which performs\n     * deep comparisons and tracks traversed objects enabling objects with circular\n     * references to be compared.\n     *\n     * @private\n     * @param {Object} object The object to compare.\n     * @param {Object} other The other object to compare.\n     * @param {Function} equalFunc The function to determine equivalents of values.\n     * @param {Function} [customizer] The function to customize comparing objects.\n     * @param {boolean} [isLoose] Specify performing partial comparisons.\n     * @param {Array} [stackA=[]] Tracks traversed `value` objects.\n     * @param {Array} [stackB=[]] Tracks traversed `other` objects.\n     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n     */\n    function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n      var objIsArr = isArray(object),\n          othIsArr = isArray(other),\n          objTag = arrayTag,\n          othTag = arrayTag;\n\n      if (!objIsArr) {\n        objTag = objToString.call(object);\n        if (objTag == argsTag) {\n          objTag = objectTag;\n        } else if (objTag != objectTag) {\n          objIsArr = isTypedArray(object);\n        }\n      }\n      if (!othIsArr) {\n        othTag = objToString.call(other);\n        if (othTag == argsTag) {\n          othTag = objectTag;\n        } else if (othTag != objectTag) {\n          othIsArr = isTypedArray(other);\n        }\n      }\n      var objIsObj = objTag == objectTag,\n          othIsObj = othTag == objectTag,\n          isSameTag = objTag == othTag;\n\n      if (isSameTag && !(objIsArr || objIsObj)) {\n        return equalByTag(object, other, objTag);\n      }\n      if (!isLoose) {\n        var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n            othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n        if (objIsWrapped || othIsWrapped) {\n          return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);\n        }\n      }\n      if (!isSameTag) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      // For more information on detecting circular references see https://es5.github.io/#JO.\n      stackA || (stackA = []);\n      stackB || (stackB = []);\n\n      var length = stackA.length;\n      while (length--) {\n        if (stackA[length] == object) {\n          return stackB[length] == other;\n        }\n      }\n      // Add `object` and `other` to the stack of traversed objects.\n      stackA.push(object);\n      stackB.push(other);\n\n      var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);\n\n      stackA.pop();\n      stackB.pop();\n\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.isMatch` without support for callback\n     * shorthands and `this` binding.\n     *\n     * @private\n     * @param {Object} object The object to inspect.\n     * @param {Array} matchData The propery names, values, and compare flags to match.\n     * @param {Function} [customizer] The function to customize comparing objects.\n     * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n     */\n    function baseIsMatch(object, matchData, customizer) {\n      var index = matchData.length,\n          length = index,\n          noCustomizer = !customizer;\n\n      if (object == null) {\n        return !length;\n      }\n      object = toObject(object);\n      while (index--) {\n        var data = matchData[index];\n        if ((noCustomizer && data[2])\n              ? data[1] !== object[data[0]]\n              : !(data[0] in object)\n            ) {\n          return false;\n        }\n      }\n      while (++index < length) {\n        data = matchData[index];\n        var key = data[0],\n            objValue = object[key],\n            srcValue = data[1];\n\n        if (noCustomizer && data[2]) {\n          if (objValue === undefined && !(key in object)) {\n            return false;\n          }\n        } else {\n          var result = customizer ? customizer(objValue, srcValue, key) : undefined;\n          if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {\n            return false;\n          }\n        }\n      }\n      return true;\n    }\n\n    /**\n     * The base implementation of `_.map` without support for callback shorthands\n     * and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {Array} Returns the new mapped array.\n     */\n    function baseMap(collection, iteratee) {\n      var index = -1,\n          result = isArrayLike(collection) ? Array(collection.length) : [];\n\n      baseEach(collection, function(value, key, collection) {\n        result[++index] = iteratee(value, key, collection);\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.matches` which does not clone `source`.\n     *\n     * @private\n     * @param {Object} source The object of property values to match.\n     * @returns {Function} Returns the new function.\n     */\n    function baseMatches(source) {\n      var matchData = getMatchData(source);\n      if (matchData.length == 1 && matchData[0][2]) {\n        var key = matchData[0][0],\n            value = matchData[0][1];\n\n        return function(object) {\n          if (object == null) {\n            return false;\n          }\n          return object[key] === value && (value !== undefined || (key in toObject(object)));\n        };\n      }\n      return function(object) {\n        return baseIsMatch(object, matchData);\n      };\n    }\n\n    /**\n     * The base implementation of `_.matchesProperty` which does not clone `srcValue`.\n     *\n     * @private\n     * @param {string} path The path of the property to get.\n     * @param {*} srcValue The value to compare.\n     * @returns {Function} Returns the new function.\n     */\n    function baseMatchesProperty(path, srcValue) {\n      var isArr = isArray(path),\n          isCommon = isKey(path) && isStrictComparable(srcValue),\n          pathKey = (path + '');\n\n      path = toPath(path);\n      return function(object) {\n        if (object == null) {\n          return false;\n        }\n        var key = pathKey;\n        object = toObject(object);\n        if ((isArr || !isCommon) && !(key in object)) {\n          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n          if (object == null) {\n            return false;\n          }\n          key = last(path);\n          object = toObject(object);\n        }\n        return object[key] === srcValue\n          ? (srcValue !== undefined || (key in object))\n          : baseIsEqual(srcValue, object[key], undefined, true);\n      };\n    }\n\n    /**\n     * The base implementation of `_.merge` without support for argument juggling,\n     * multiple sources, and `this` binding `customizer` functions.\n     *\n     * @private\n     * @param {Object} object The destination object.\n     * @param {Object} source The source object.\n     * @param {Function} [customizer] The function to customize merged values.\n     * @param {Array} [stackA=[]] Tracks traversed source objects.\n     * @param {Array} [stackB=[]] Associates values with source counterparts.\n     * @returns {Object} Returns `object`.\n     */\n    function baseMerge(object, source, customizer, stackA, stackB) {\n      if (!isObject(object)) {\n        return object;\n      }\n      var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),\n          props = isSrcArr ? undefined : keys(source);\n\n      arrayEach(props || source, function(srcValue, key) {\n        if (props) {\n          key = srcValue;\n          srcValue = source[key];\n        }\n        if (isObjectLike(srcValue)) {\n          stackA || (stackA = []);\n          stackB || (stackB = []);\n          baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);\n        }\n        else {\n          var value = object[key],\n              result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n              isCommon = result === undefined;\n\n          if (isCommon) {\n            result = srcValue;\n          }\n          if ((result !== undefined || (isSrcArr && !(key in object))) &&\n              (isCommon || (result === result ? (result !== value) : (value === value)))) {\n            object[key] = result;\n          }\n        }\n      });\n      return object;\n    }\n\n    /**\n     * A specialized version of `baseMerge` for arrays and objects which performs\n     * deep merges and tracks traversed objects enabling objects with circular\n     * references to be merged.\n     *\n     * @private\n     * @param {Object} object The destination object.\n     * @param {Object} source The source object.\n     * @param {string} key The key of the value to merge.\n     * @param {Function} mergeFunc The function to merge values.\n     * @param {Function} [customizer] The function to customize merged values.\n     * @param {Array} [stackA=[]] Tracks traversed source objects.\n     * @param {Array} [stackB=[]] Associates values with source counterparts.\n     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n     */\n    function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {\n      var length = stackA.length,\n          srcValue = source[key];\n\n      while (length--) {\n        if (stackA[length] == srcValue) {\n          object[key] = stackB[length];\n          return;\n        }\n      }\n      var value = object[key],\n          result = customizer ? customizer(value, srcValue, key, object, source) : undefined,\n          isCommon = result === undefined;\n\n      if (isCommon) {\n        result = srcValue;\n        if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {\n          result = isArray(value)\n            ? value\n            : (isArrayLike(value) ? arrayCopy(value) : []);\n        }\n        else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n          result = isArguments(value)\n            ? toPlainObject(value)\n            : (isPlainObject(value) ? value : {});\n        }\n        else {\n          isCommon = false;\n        }\n      }\n      // Add the source value to the stack of traversed objects and associate\n      // it with its merged value.\n      stackA.push(srcValue);\n      stackB.push(result);\n\n      if (isCommon) {\n        // Recursively merge objects and arrays (susceptible to call stack limits).\n        object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);\n      } else if (result === result ? (result !== value) : (value === value)) {\n        object[key] = result;\n      }\n    }\n\n    /**\n     * The base implementation of `_.property` without support for deep paths.\n     *\n     * @private\n     * @param {string} key The key of the property to get.\n     * @returns {Function} Returns the new function.\n     */\n    function baseProperty(key) {\n      return function(object) {\n        return object == null ? undefined : object[key];\n      };\n    }\n\n    /**\n     * A specialized version of `baseProperty` which supports deep paths.\n     *\n     * @private\n     * @param {Array|string} path The path of the property to get.\n     * @returns {Function} Returns the new function.\n     */\n    function basePropertyDeep(path) {\n      var pathKey = (path + '');\n      path = toPath(path);\n      return function(object) {\n        return baseGet(object, path, pathKey);\n      };\n    }\n\n    /**\n     * The base implementation of `_.pullAt` without support for individual\n     * index arguments and capturing the removed elements.\n     *\n     * @private\n     * @param {Array} array The array to modify.\n     * @param {number[]} indexes The indexes of elements to remove.\n     * @returns {Array} Returns `array`.\n     */\n    function basePullAt(array, indexes) {\n      var length = array ? indexes.length : 0;\n      while (length--) {\n        var index = indexes[length];\n        if (index != previous && isIndex(index)) {\n          var previous = index;\n          splice.call(array, index, 1);\n        }\n      }\n      return array;\n    }\n\n    /**\n     * The base implementation of `_.random` without support for argument juggling\n     * and returning floating-point numbers.\n     *\n     * @private\n     * @param {number} min The minimum possible value.\n     * @param {number} max The maximum possible value.\n     * @returns {number} Returns the random number.\n     */\n    function baseRandom(min, max) {\n      return min + nativeFloor(nativeRandom() * (max - min + 1));\n    }\n\n    /**\n     * The base implementation of `_.reduce` and `_.reduceRight` without support\n     * for callback shorthands and `this` binding, which iterates over `collection`\n     * using the provided `eachFunc`.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {*} accumulator The initial value.\n     * @param {boolean} initFromCollection Specify using the first or last element\n     *  of `collection` as the initial value.\n     * @param {Function} eachFunc The function to iterate over `collection`.\n     * @returns {*} Returns the accumulated value.\n     */\n    function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {\n      eachFunc(collection, function(value, index, collection) {\n        accumulator = initFromCollection\n          ? (initFromCollection = false, value)\n          : iteratee(accumulator, value, index, collection);\n      });\n      return accumulator;\n    }\n\n    /**\n     * The base implementation of `setData` without support for hot loop detection.\n     *\n     * @private\n     * @param {Function} func The function to associate metadata with.\n     * @param {*} data The metadata.\n     * @returns {Function} Returns `func`.\n     */\n    var baseSetData = !metaMap ? identity : function(func, data) {\n      metaMap.set(func, data);\n      return func;\n    };\n\n    /**\n     * The base implementation of `_.slice` without an iteratee call guard.\n     *\n     * @private\n     * @param {Array} array The array to slice.\n     * @param {number} [start=0] The start position.\n     * @param {number} [end=array.length] The end position.\n     * @returns {Array} Returns the slice of `array`.\n     */\n    function baseSlice(array, start, end) {\n      var index = -1,\n          length = array.length;\n\n      start = start == null ? 0 : (+start || 0);\n      if (start < 0) {\n        start = -start > length ? 0 : (length + start);\n      }\n      end = (end === undefined || end > length) ? length : (+end || 0);\n      if (end < 0) {\n        end += length;\n      }\n      length = start > end ? 0 : ((end - start) >>> 0);\n      start >>>= 0;\n\n      var result = Array(length);\n      while (++index < length) {\n        result[index] = array[index + start];\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.some` without support for callback shorthands\n     * and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {boolean} Returns `true` if any element passes the predicate check,\n     *  else `false`.\n     */\n    function baseSome(collection, predicate) {\n      var result;\n\n      baseEach(collection, function(value, index, collection) {\n        result = predicate(value, index, collection);\n        return !result;\n      });\n      return !!result;\n    }\n\n    /**\n     * The base implementation of `_.sortBy` which uses `comparer` to define\n     * the sort order of `array` and replaces criteria objects with their\n     * corresponding values.\n     *\n     * @private\n     * @param {Array} array The array to sort.\n     * @param {Function} comparer The function to define sort order.\n     * @returns {Array} Returns `array`.\n     */\n    function baseSortBy(array, comparer) {\n      var length = array.length;\n\n      array.sort(comparer);\n      while (length--) {\n        array[length] = array[length].value;\n      }\n      return array;\n    }\n\n    /**\n     * The base implementation of `_.sortByOrder` without param guards.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n     * @param {boolean[]} orders The sort orders of `iteratees`.\n     * @returns {Array} Returns the new sorted array.\n     */\n    function baseSortByOrder(collection, iteratees, orders) {\n      var callback = getCallback(),\n          index = -1;\n\n      iteratees = arrayMap(iteratees, function(iteratee) { return callback(iteratee); });\n\n      var result = baseMap(collection, function(value) {\n        var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); });\n        return { 'criteria': criteria, 'index': ++index, 'value': value };\n      });\n\n      return baseSortBy(result, function(object, other) {\n        return compareMultiple(object, other, orders);\n      });\n    }\n\n    /**\n     * The base implementation of `_.sum` without support for callback shorthands\n     * and `this` binding.\n     *\n     * @private\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @returns {number} Returns the sum.\n     */\n    function baseSum(collection, iteratee) {\n      var result = 0;\n      baseEach(collection, function(value, index, collection) {\n        result += +iteratee(value, index, collection) || 0;\n      });\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.uniq` without support for callback shorthands\n     * and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to inspect.\n     * @param {Function} [iteratee] The function invoked per iteration.\n     * @returns {Array} Returns the new duplicate-value-free array.\n     */\n    function baseUniq(array, iteratee) {\n      var index = -1,\n          indexOf = getIndexOf(),\n          length = array.length,\n          isCommon = indexOf == baseIndexOf,\n          isLarge = isCommon && length >= LARGE_ARRAY_SIZE,\n          seen = isLarge ? createCache() : null,\n          result = [];\n\n      if (seen) {\n        indexOf = cacheIndexOf;\n        isCommon = false;\n      } else {\n        isLarge = false;\n        seen = iteratee ? [] : result;\n      }\n      outer:\n      while (++index < length) {\n        var value = array[index],\n            computed = iteratee ? iteratee(value, index, array) : value;\n\n        if (isCommon && value === value) {\n          var seenIndex = seen.length;\n          while (seenIndex--) {\n            if (seen[seenIndex] === computed) {\n              continue outer;\n            }\n          }\n          if (iteratee) {\n            seen.push(computed);\n          }\n          result.push(value);\n        }\n        else if (indexOf(seen, computed, 0) < 0) {\n          if (iteratee || isLarge) {\n            seen.push(computed);\n          }\n          result.push(value);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.values` and `_.valuesIn` which creates an\n     * array of `object` property values corresponding to the property names\n     * of `props`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @param {Array} props The property names to get values for.\n     * @returns {Object} Returns the array of property values.\n     */\n    function baseValues(object, props) {\n      var index = -1,\n          length = props.length,\n          result = Array(length);\n\n      while (++index < length) {\n        result[index] = object[props[index]];\n      }\n      return result;\n    }\n\n    /**\n     * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,\n     * and `_.takeWhile` without support for callback shorthands and `this` binding.\n     *\n     * @private\n     * @param {Array} array The array to query.\n     * @param {Function} predicate The function invoked per iteration.\n     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Array} Returns the slice of `array`.\n     */\n    function baseWhile(array, predicate, isDrop, fromRight) {\n      var length = array.length,\n          index = fromRight ? length : -1;\n\n      while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}\n      return isDrop\n        ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n        : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n    }\n\n    /**\n     * The base implementation of `wrapperValue` which returns the result of\n     * performing a sequence of actions on the unwrapped `value`, where each\n     * successive action is supplied the return value of the previous.\n     *\n     * @private\n     * @param {*} value The unwrapped value.\n     * @param {Array} actions Actions to peform to resolve the unwrapped value.\n     * @returns {*} Returns the resolved value.\n     */\n    function baseWrapperValue(value, actions) {\n      var result = value;\n      if (result instanceof LazyWrapper) {\n        result = result.value();\n      }\n      var index = -1,\n          length = actions.length;\n\n      while (++index < length) {\n        var action = actions[index];\n        result = action.func.apply(action.thisArg, arrayPush([result], action.args));\n      }\n      return result;\n    }\n\n    /**\n     * Performs a binary search of `array` to determine the index at which `value`\n     * should be inserted into `array` in order to maintain its sort order.\n     *\n     * @private\n     * @param {Array} array The sorted array to inspect.\n     * @param {*} value The value to evaluate.\n     * @param {boolean} [retHighest] Specify returning the highest qualified index.\n     * @returns {number} Returns the index at which `value` should be inserted\n     *  into `array`.\n     */\n    function binaryIndex(array, value, retHighest) {\n      var low = 0,\n          high = array ? array.length : low;\n\n      if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n        while (low < high) {\n          var mid = (low + high) >>> 1,\n              computed = array[mid];\n\n          if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) {\n            low = mid + 1;\n          } else {\n            high = mid;\n          }\n        }\n        return high;\n      }\n      return binaryIndexBy(array, value, identity, retHighest);\n    }\n\n    /**\n     * This function is like `binaryIndex` except that it invokes `iteratee` for\n     * `value` and each element of `array` to compute their sort ranking. The\n     * iteratee is invoked with one argument; (value).\n     *\n     * @private\n     * @param {Array} array The sorted array to inspect.\n     * @param {*} value The value to evaluate.\n     * @param {Function} iteratee The function invoked per iteration.\n     * @param {boolean} [retHighest] Specify returning the highest qualified index.\n     * @returns {number} Returns the index at which `value` should be inserted\n     *  into `array`.\n     */\n    function binaryIndexBy(array, value, iteratee, retHighest) {\n      value = iteratee(value);\n\n      var low = 0,\n          high = array ? array.length : 0,\n          valIsNaN = value !== value,\n          valIsNull = value === null,\n          valIsUndef = value === undefined;\n\n      while (low < high) {\n        var mid = nativeFloor((low + high) / 2),\n            computed = iteratee(array[mid]),\n            isDef = computed !== undefined,\n            isReflexive = computed === computed;\n\n        if (valIsNaN) {\n          var setLow = isReflexive || retHighest;\n        } else if (valIsNull) {\n          setLow = isReflexive && isDef && (retHighest || computed != null);\n        } else if (valIsUndef) {\n          setLow = isReflexive && (retHighest || isDef);\n        } else if (computed == null) {\n          setLow = false;\n        } else {\n          setLow = retHighest ? (computed <= value) : (computed < value);\n        }\n        if (setLow) {\n          low = mid + 1;\n        } else {\n          high = mid;\n        }\n      }\n      return nativeMin(high, MAX_ARRAY_INDEX);\n    }\n\n    /**\n     * A specialized version of `baseCallback` which only supports `this` binding\n     * and specifying the number of arguments to provide to `func`.\n     *\n     * @private\n     * @param {Function} func The function to bind.\n     * @param {*} thisArg The `this` binding of `func`.\n     * @param {number} [argCount] The number of arguments to provide to `func`.\n     * @returns {Function} Returns the callback.\n     */\n    function bindCallback(func, thisArg, argCount) {\n      if (typeof func != 'function') {\n        return identity;\n      }\n      if (thisArg === undefined) {\n        return func;\n      }\n      switch (argCount) {\n        case 1: return function(value) {\n          return func.call(thisArg, value);\n        };\n        case 3: return function(value, index, collection) {\n          return func.call(thisArg, value, index, collection);\n        };\n        case 4: return function(accumulator, value, index, collection) {\n          return func.call(thisArg, accumulator, value, index, collection);\n        };\n        case 5: return function(value, other, key, object, source) {\n          return func.call(thisArg, value, other, key, object, source);\n        };\n      }\n      return function() {\n        return func.apply(thisArg, arguments);\n      };\n    }\n\n    /**\n     * Creates a clone of the given array buffer.\n     *\n     * @private\n     * @param {ArrayBuffer} buffer The array buffer to clone.\n     * @returns {ArrayBuffer} Returns the cloned array buffer.\n     */\n    function bufferClone(buffer) {\n      var result = new ArrayBuffer(buffer.byteLength),\n          view = new Uint8Array(result);\n\n      view.set(new Uint8Array(buffer));\n      return result;\n    }\n\n    /**\n     * Creates an array that is the composition of partially applied arguments,\n     * placeholders, and provided arguments into a single array of arguments.\n     *\n     * @private\n     * @param {Array|Object} args The provided arguments.\n     * @param {Array} partials The arguments to prepend to those provided.\n     * @param {Array} holders The `partials` placeholder indexes.\n     * @returns {Array} Returns the new array of composed arguments.\n     */\n    function composeArgs(args, partials, holders) {\n      var holdersLength = holders.length,\n          argsIndex = -1,\n          argsLength = nativeMax(args.length - holdersLength, 0),\n          leftIndex = -1,\n          leftLength = partials.length,\n          result = Array(leftLength + argsLength);\n\n      while (++leftIndex < leftLength) {\n        result[leftIndex] = partials[leftIndex];\n      }\n      while (++argsIndex < holdersLength) {\n        result[holders[argsIndex]] = args[argsIndex];\n      }\n      while (argsLength--) {\n        result[leftIndex++] = args[argsIndex++];\n      }\n      return result;\n    }\n\n    /**\n     * This function is like `composeArgs` except that the arguments composition\n     * is tailored for `_.partialRight`.\n     *\n     * @private\n     * @param {Array|Object} args The provided arguments.\n     * @param {Array} partials The arguments to append to those provided.\n     * @param {Array} holders The `partials` placeholder indexes.\n     * @returns {Array} Returns the new array of composed arguments.\n     */\n    function composeArgsRight(args, partials, holders) {\n      var holdersIndex = -1,\n          holdersLength = holders.length,\n          argsIndex = -1,\n          argsLength = nativeMax(args.length - holdersLength, 0),\n          rightIndex = -1,\n          rightLength = partials.length,\n          result = Array(argsLength + rightLength);\n\n      while (++argsIndex < argsLength) {\n        result[argsIndex] = args[argsIndex];\n      }\n      var offset = argsIndex;\n      while (++rightIndex < rightLength) {\n        result[offset + rightIndex] = partials[rightIndex];\n      }\n      while (++holdersIndex < holdersLength) {\n        result[offset + holders[holdersIndex]] = args[argsIndex++];\n      }\n      return result;\n    }\n\n    /**\n     * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.\n     *\n     * @private\n     * @param {Function} setter The function to set keys and values of the accumulator object.\n     * @param {Function} [initializer] The function to initialize the accumulator object.\n     * @returns {Function} Returns the new aggregator function.\n     */\n    function createAggregator(setter, initializer) {\n      return function(collection, iteratee, thisArg) {\n        var result = initializer ? initializer() : {};\n        iteratee = getCallback(iteratee, thisArg, 3);\n\n        if (isArray(collection)) {\n          var index = -1,\n              length = collection.length;\n\n          while (++index < length) {\n            var value = collection[index];\n            setter(result, value, iteratee(value, index, collection), collection);\n          }\n        } else {\n          baseEach(collection, function(value, key, collection) {\n            setter(result, value, iteratee(value, key, collection), collection);\n          });\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Creates a `_.assign`, `_.defaults`, or `_.merge` function.\n     *\n     * @private\n     * @param {Function} assigner The function to assign values.\n     * @returns {Function} Returns the new assigner function.\n     */\n    function createAssigner(assigner) {\n      return restParam(function(object, sources) {\n        var index = -1,\n            length = object == null ? 0 : sources.length,\n            customizer = length > 2 ? sources[length - 2] : undefined,\n            guard = length > 2 ? sources[2] : undefined,\n            thisArg = length > 1 ? sources[length - 1] : undefined;\n\n        if (typeof customizer == 'function') {\n          customizer = bindCallback(customizer, thisArg, 5);\n          length -= 2;\n        } else {\n          customizer = typeof thisArg == 'function' ? thisArg : undefined;\n          length -= (customizer ? 1 : 0);\n        }\n        if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n          customizer = length < 3 ? undefined : customizer;\n          length = 1;\n        }\n        while (++index < length) {\n          var source = sources[index];\n          if (source) {\n            assigner(object, source, customizer);\n          }\n        }\n        return object;\n      });\n    }\n\n    /**\n     * Creates a `baseEach` or `baseEachRight` function.\n     *\n     * @private\n     * @param {Function} eachFunc The function to iterate over a collection.\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Function} Returns the new base function.\n     */\n    function createBaseEach(eachFunc, fromRight) {\n      return function(collection, iteratee) {\n        var length = collection ? getLength(collection) : 0;\n        if (!isLength(length)) {\n          return eachFunc(collection, iteratee);\n        }\n        var index = fromRight ? length : -1,\n            iterable = toObject(collection);\n\n        while ((fromRight ? index-- : ++index < length)) {\n          if (iteratee(iterable[index], index, iterable) === false) {\n            break;\n          }\n        }\n        return collection;\n      };\n    }\n\n    /**\n     * Creates a base function for `_.forIn` or `_.forInRight`.\n     *\n     * @private\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Function} Returns the new base function.\n     */\n    function createBaseFor(fromRight) {\n      return function(object, iteratee, keysFunc) {\n        var iterable = toObject(object),\n            props = keysFunc(object),\n            length = props.length,\n            index = fromRight ? length : -1;\n\n        while ((fromRight ? index-- : ++index < length)) {\n          var key = props[index];\n          if (iteratee(iterable[key], key, iterable) === false) {\n            break;\n          }\n        }\n        return object;\n      };\n    }\n\n    /**\n     * Creates a function that wraps `func` and invokes it with the `this`\n     * binding of `thisArg`.\n     *\n     * @private\n     * @param {Function} func The function to bind.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @returns {Function} Returns the new bound function.\n     */\n    function createBindWrapper(func, thisArg) {\n      var Ctor = createCtorWrapper(func);\n\n      function wrapper() {\n        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n        return fn.apply(thisArg, arguments);\n      }\n      return wrapper;\n    }\n\n    /**\n     * Creates a `Set` cache object to optimize linear searches of large arrays.\n     *\n     * @private\n     * @param {Array} [values] The values to cache.\n     * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.\n     */\n    function createCache(values) {\n      return (nativeCreate && Set) ? new SetCache(values) : null;\n    }\n\n    /**\n     * Creates a function that produces compound words out of the words in a\n     * given string.\n     *\n     * @private\n     * @param {Function} callback The function to combine each word.\n     * @returns {Function} Returns the new compounder function.\n     */\n    function createCompounder(callback) {\n      return function(string) {\n        var index = -1,\n            array = words(deburr(string)),\n            length = array.length,\n            result = '';\n\n        while (++index < length) {\n          result = callback(result, array[index], index);\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function that produces an instance of `Ctor` regardless of\n     * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n     *\n     * @private\n     * @param {Function} Ctor The constructor to wrap.\n     * @returns {Function} Returns the new wrapped function.\n     */\n    function createCtorWrapper(Ctor) {\n      return function() {\n        // Use a `switch` statement to work with class constructors.\n        // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n        // for more details.\n        var args = arguments;\n        switch (args.length) {\n          case 0: return new Ctor;\n          case 1: return new Ctor(args[0]);\n          case 2: return new Ctor(args[0], args[1]);\n          case 3: return new Ctor(args[0], args[1], args[2]);\n          case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n          case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n          case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n          case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n        }\n        var thisBinding = baseCreate(Ctor.prototype),\n            result = Ctor.apply(thisBinding, args);\n\n        // Mimic the constructor's `return` behavior.\n        // See https://es5.github.io/#x13.2.2 for more details.\n        return isObject(result) ? result : thisBinding;\n      };\n    }\n\n    /**\n     * Creates a `_.curry` or `_.curryRight` function.\n     *\n     * @private\n     * @param {boolean} flag The curry bit flag.\n     * @returns {Function} Returns the new curry function.\n     */\n    function createCurry(flag) {\n      function curryFunc(func, arity, guard) {\n        if (guard && isIterateeCall(func, arity, guard)) {\n          arity = undefined;\n        }\n        var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);\n        result.placeholder = curryFunc.placeholder;\n        return result;\n      }\n      return curryFunc;\n    }\n\n    /**\n     * Creates a `_.defaults` or `_.defaultsDeep` function.\n     *\n     * @private\n     * @param {Function} assigner The function to assign values.\n     * @param {Function} customizer The function to customize assigned values.\n     * @returns {Function} Returns the new defaults function.\n     */\n    function createDefaults(assigner, customizer) {\n      return restParam(function(args) {\n        var object = args[0];\n        if (object == null) {\n          return object;\n        }\n        args.push(customizer);\n        return assigner.apply(undefined, args);\n      });\n    }\n\n    /**\n     * Creates a `_.max` or `_.min` function.\n     *\n     * @private\n     * @param {Function} comparator The function used to compare values.\n     * @param {*} exValue The initial extremum value.\n     * @returns {Function} Returns the new extremum function.\n     */\n    function createExtremum(comparator, exValue) {\n      return function(collection, iteratee, thisArg) {\n        if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n          iteratee = undefined;\n        }\n        iteratee = getCallback(iteratee, thisArg, 3);\n        if (iteratee.length == 1) {\n          collection = isArray(collection) ? collection : toIterable(collection);\n          var result = arrayExtremum(collection, iteratee, comparator, exValue);\n          if (!(collection.length && result === exValue)) {\n            return result;\n          }\n        }\n        return baseExtremum(collection, iteratee, comparator, exValue);\n      };\n    }\n\n    /**\n     * Creates a `_.find` or `_.findLast` function.\n     *\n     * @private\n     * @param {Function} eachFunc The function to iterate over a collection.\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Function} Returns the new find function.\n     */\n    function createFind(eachFunc, fromRight) {\n      return function(collection, predicate, thisArg) {\n        predicate = getCallback(predicate, thisArg, 3);\n        if (isArray(collection)) {\n          var index = baseFindIndex(collection, predicate, fromRight);\n          return index > -1 ? collection[index] : undefined;\n        }\n        return baseFind(collection, predicate, eachFunc);\n      };\n    }\n\n    /**\n     * Creates a `_.findIndex` or `_.findLastIndex` function.\n     *\n     * @private\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Function} Returns the new find function.\n     */\n    function createFindIndex(fromRight) {\n      return function(array, predicate, thisArg) {\n        if (!(array && array.length)) {\n          return -1;\n        }\n        predicate = getCallback(predicate, thisArg, 3);\n        return baseFindIndex(array, predicate, fromRight);\n      };\n    }\n\n    /**\n     * Creates a `_.findKey` or `_.findLastKey` function.\n     *\n     * @private\n     * @param {Function} objectFunc The function to iterate over an object.\n     * @returns {Function} Returns the new find function.\n     */\n    function createFindKey(objectFunc) {\n      return function(object, predicate, thisArg) {\n        predicate = getCallback(predicate, thisArg, 3);\n        return baseFind(object, predicate, objectFunc, true);\n      };\n    }\n\n    /**\n     * Creates a `_.flow` or `_.flowRight` function.\n     *\n     * @private\n     * @param {boolean} [fromRight] Specify iterating from right to left.\n     * @returns {Function} Returns the new flow function.\n     */\n    function createFlow(fromRight) {\n      return function() {\n        var wrapper,\n            length = arguments.length,\n            index = fromRight ? length : -1,\n            leftIndex = 0,\n            funcs = Array(length);\n\n        while ((fromRight ? index-- : ++index < length)) {\n          var func = funcs[leftIndex++] = arguments[index];\n          if (typeof func != 'function') {\n            throw new TypeError(FUNC_ERROR_TEXT);\n          }\n          if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {\n            wrapper = new LodashWrapper([], true);\n          }\n        }\n        index = wrapper ? -1 : length;\n        while (++index < length) {\n          func = funcs[index];\n\n          var funcName = getFuncName(func),\n              data = funcName == 'wrapper' ? getData(func) : undefined;\n\n          if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {\n            wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n          } else {\n            wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func);\n          }\n        }\n        return function() {\n          var args = arguments,\n              value = args[0];\n\n          if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {\n            return wrapper.plant(value).value();\n          }\n          var index = 0,\n              result = length ? funcs[index].apply(this, args) : value;\n\n          while (++index < length) {\n            result = funcs[index].call(this, result);\n          }\n          return result;\n        };\n      };\n    }\n\n    /**\n     * Creates a function for `_.forEach` or `_.forEachRight`.\n     *\n     * @private\n     * @param {Function} arrayFunc The function to iterate over an array.\n     * @param {Function} eachFunc The function to iterate over a collection.\n     * @returns {Function} Returns the new each function.\n     */\n    function createForEach(arrayFunc, eachFunc) {\n      return function(collection, iteratee, thisArg) {\n        return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n          ? arrayFunc(collection, iteratee)\n          : eachFunc(collection, bindCallback(iteratee, thisArg, 3));\n      };\n    }\n\n    /**\n     * Creates a function for `_.forIn` or `_.forInRight`.\n     *\n     * @private\n     * @param {Function} objectFunc The function to iterate over an object.\n     * @returns {Function} Returns the new each function.\n     */\n    function createForIn(objectFunc) {\n      return function(object, iteratee, thisArg) {\n        if (typeof iteratee != 'function' || thisArg !== undefined) {\n          iteratee = bindCallback(iteratee, thisArg, 3);\n        }\n        return objectFunc(object, iteratee, keysIn);\n      };\n    }\n\n    /**\n     * Creates a function for `_.forOwn` or `_.forOwnRight`.\n     *\n     * @private\n     * @param {Function} objectFunc The function to iterate over an object.\n     * @returns {Function} Returns the new each function.\n     */\n    function createForOwn(objectFunc) {\n      return function(object, iteratee, thisArg) {\n        if (typeof iteratee != 'function' || thisArg !== undefined) {\n          iteratee = bindCallback(iteratee, thisArg, 3);\n        }\n        return objectFunc(object, iteratee);\n      };\n    }\n\n    /**\n     * Creates a function for `_.mapKeys` or `_.mapValues`.\n     *\n     * @private\n     * @param {boolean} [isMapKeys] Specify mapping keys instead of values.\n     * @returns {Function} Returns the new map function.\n     */\n    function createObjectMapper(isMapKeys) {\n      return function(object, iteratee, thisArg) {\n        var result = {};\n        iteratee = getCallback(iteratee, thisArg, 3);\n\n        baseForOwn(object, function(value, key, object) {\n          var mapped = iteratee(value, key, object);\n          key = isMapKeys ? mapped : key;\n          value = isMapKeys ? value : mapped;\n          result[key] = value;\n        });\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function for `_.padLeft` or `_.padRight`.\n     *\n     * @private\n     * @param {boolean} [fromRight] Specify padding from the right.\n     * @returns {Function} Returns the new pad function.\n     */\n    function createPadDir(fromRight) {\n      return function(string, length, chars) {\n        string = baseToString(string);\n        return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);\n      };\n    }\n\n    /**\n     * Creates a `_.partial` or `_.partialRight` function.\n     *\n     * @private\n     * @param {boolean} flag The partial bit flag.\n     * @returns {Function} Returns the new partial function.\n     */\n    function createPartial(flag) {\n      var partialFunc = restParam(function(func, partials) {\n        var holders = replaceHolders(partials, partialFunc.placeholder);\n        return createWrapper(func, flag, undefined, partials, holders);\n      });\n      return partialFunc;\n    }\n\n    /**\n     * Creates a function for `_.reduce` or `_.reduceRight`.\n     *\n     * @private\n     * @param {Function} arrayFunc The function to iterate over an array.\n     * @param {Function} eachFunc The function to iterate over a collection.\n     * @returns {Function} Returns the new each function.\n     */\n    function createReduce(arrayFunc, eachFunc) {\n      return function(collection, iteratee, accumulator, thisArg) {\n        var initFromArray = arguments.length < 3;\n        return (typeof iteratee == 'function' && thisArg === undefined && isArray(collection))\n          ? arrayFunc(collection, iteratee, accumulator, initFromArray)\n          : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);\n      };\n    }\n\n    /**\n     * Creates a function that wraps `func` and invokes it with optional `this`\n     * binding of, partial application, and currying.\n     *\n     * @private\n     * @param {Function|string} func The function or method name to reference.\n     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param {Array} [partials] The arguments to prepend to those provided to the new function.\n     * @param {Array} [holders] The `partials` placeholder indexes.\n     * @param {Array} [partialsRight] The arguments to append to those provided to the new function.\n     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n     * @param {Array} [argPos] The argument positions of the new function.\n     * @param {number} [ary] The arity cap of `func`.\n     * @param {number} [arity] The arity of `func`.\n     * @returns {Function} Returns the new wrapped function.\n     */\n    function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n      var isAry = bitmask & ARY_FLAG,\n          isBind = bitmask & BIND_FLAG,\n          isBindKey = bitmask & BIND_KEY_FLAG,\n          isCurry = bitmask & CURRY_FLAG,\n          isCurryBound = bitmask & CURRY_BOUND_FLAG,\n          isCurryRight = bitmask & CURRY_RIGHT_FLAG,\n          Ctor = isBindKey ? undefined : createCtorWrapper(func);\n\n      function wrapper() {\n        // Avoid `arguments` object use disqualifying optimizations by\n        // converting it to an array before providing it to other functions.\n        var length = arguments.length,\n            index = length,\n            args = Array(length);\n\n        while (index--) {\n          args[index] = arguments[index];\n        }\n        if (partials) {\n          args = composeArgs(args, partials, holders);\n        }\n        if (partialsRight) {\n          args = composeArgsRight(args, partialsRight, holdersRight);\n        }\n        if (isCurry || isCurryRight) {\n          var placeholder = wrapper.placeholder,\n              argsHolders = replaceHolders(args, placeholder);\n\n          length -= argsHolders.length;\n          if (length < arity) {\n            var newArgPos = argPos ? arrayCopy(argPos) : undefined,\n                newArity = nativeMax(arity - length, 0),\n                newsHolders = isCurry ? argsHolders : undefined,\n                newHoldersRight = isCurry ? undefined : argsHolders,\n                newPartials = isCurry ? args : undefined,\n                newPartialsRight = isCurry ? undefined : args;\n\n            bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG);\n            bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);\n\n            if (!isCurryBound) {\n              bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);\n            }\n            var newData = [func, bitmask, thisArg, newPartials, newsHolders, newPartialsRight, newHoldersRight, newArgPos, ary, newArity],\n                result = createHybridWrapper.apply(undefined, newData);\n\n            if (isLaziable(func)) {\n              setData(result, newData);\n            }\n            result.placeholder = placeholder;\n            return result;\n          }\n        }\n        var thisBinding = isBind ? thisArg : this,\n            fn = isBindKey ? thisBinding[func] : func;\n\n        if (argPos) {\n          args = reorder(args, argPos);\n        }\n        if (isAry && ary < args.length) {\n          args.length = ary;\n        }\n        if (this && this !== root && this instanceof wrapper) {\n          fn = Ctor || createCtorWrapper(func);\n        }\n        return fn.apply(thisBinding, args);\n      }\n      return wrapper;\n    }\n\n    /**\n     * Creates the padding required for `string` based on the given `length`.\n     * The `chars` string is truncated if the number of characters exceeds `length`.\n     *\n     * @private\n     * @param {string} string The string to create padding for.\n     * @param {number} [length=0] The padding length.\n     * @param {string} [chars=' '] The string used as padding.\n     * @returns {string} Returns the pad for `string`.\n     */\n    function createPadding(string, length, chars) {\n      var strLength = string.length;\n      length = +length;\n\n      if (strLength >= length || !nativeIsFinite(length)) {\n        return '';\n      }\n      var padLength = length - strLength;\n      chars = chars == null ? ' ' : (chars + '');\n      return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);\n    }\n\n    /**\n     * Creates a function that wraps `func` and invokes it with the optional `this`\n     * binding of `thisArg` and the `partials` prepended to those provided to\n     * the wrapper.\n     *\n     * @private\n     * @param {Function} func The function to partially apply arguments to.\n     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.\n     * @param {*} thisArg The `this` binding of `func`.\n     * @param {Array} partials The arguments to prepend to those provided to the new function.\n     * @returns {Function} Returns the new bound function.\n     */\n    function createPartialWrapper(func, bitmask, thisArg, partials) {\n      var isBind = bitmask & BIND_FLAG,\n          Ctor = createCtorWrapper(func);\n\n      function wrapper() {\n        // Avoid `arguments` object use disqualifying optimizations by\n        // converting it to an array before providing it `func`.\n        var argsIndex = -1,\n            argsLength = arguments.length,\n            leftIndex = -1,\n            leftLength = partials.length,\n            args = Array(leftLength + argsLength);\n\n        while (++leftIndex < leftLength) {\n          args[leftIndex] = partials[leftIndex];\n        }\n        while (argsLength--) {\n          args[leftIndex++] = arguments[++argsIndex];\n        }\n        var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n        return fn.apply(isBind ? thisArg : this, args);\n      }\n      return wrapper;\n    }\n\n    /**\n     * Creates a `_.ceil`, `_.floor`, or `_.round` function.\n     *\n     * @private\n     * @param {string} methodName The name of the `Math` method to use when rounding.\n     * @returns {Function} Returns the new round function.\n     */\n    function createRound(methodName) {\n      var func = Math[methodName];\n      return function(number, precision) {\n        precision = precision === undefined ? 0 : (+precision || 0);\n        if (precision) {\n          precision = pow(10, precision);\n          return func(number * precision) / precision;\n        }\n        return func(number);\n      };\n    }\n\n    /**\n     * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.\n     *\n     * @private\n     * @param {boolean} [retHighest] Specify returning the highest qualified index.\n     * @returns {Function} Returns the new index function.\n     */\n    function createSortedIndex(retHighest) {\n      return function(array, value, iteratee, thisArg) {\n        var callback = getCallback(iteratee);\n        return (iteratee == null && callback === baseCallback)\n          ? binaryIndex(array, value, retHighest)\n          : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);\n      };\n    }\n\n    /**\n     * Creates a function that either curries or invokes `func` with optional\n     * `this` binding and partially applied arguments.\n     *\n     * @private\n     * @param {Function|string} func The function or method name to reference.\n     * @param {number} bitmask The bitmask of flags.\n     *  The bitmask may be composed of the following flags:\n     *     1 - `_.bind`\n     *     2 - `_.bindKey`\n     *     4 - `_.curry` or `_.curryRight` of a bound function\n     *     8 - `_.curry`\n     *    16 - `_.curryRight`\n     *    32 - `_.partial`\n     *    64 - `_.partialRight`\n     *   128 - `_.rearg`\n     *   256 - `_.ary`\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param {Array} [partials] The arguments to be partially applied.\n     * @param {Array} [holders] The `partials` placeholder indexes.\n     * @param {Array} [argPos] The argument positions of the new function.\n     * @param {number} [ary] The arity cap of `func`.\n     * @param {number} [arity] The arity of `func`.\n     * @returns {Function} Returns the new wrapped function.\n     */\n    function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n      var isBindKey = bitmask & BIND_KEY_FLAG;\n      if (!isBindKey && typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      var length = partials ? partials.length : 0;\n      if (!length) {\n        bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);\n        partials = holders = undefined;\n      }\n      length -= (holders ? holders.length : 0);\n      if (bitmask & PARTIAL_RIGHT_FLAG) {\n        var partialsRight = partials,\n            holdersRight = holders;\n\n        partials = holders = undefined;\n      }\n      var data = isBindKey ? undefined : getData(func),\n          newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity];\n\n      if (data) {\n        mergeData(newData, data);\n        bitmask = newData[1];\n        arity = newData[9];\n      }\n      newData[9] = arity == null\n        ? (isBindKey ? 0 : func.length)\n        : (nativeMax(arity - length, 0) || 0);\n\n      if (bitmask == BIND_FLAG) {\n        var result = createBindWrapper(newData[0], newData[2]);\n      } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {\n        result = createPartialWrapper.apply(undefined, newData);\n      } else {\n        result = createHybridWrapper.apply(undefined, newData);\n      }\n      var setter = data ? baseSetData : setData;\n      return setter(result, newData);\n    }\n\n    /**\n     * A specialized version of `baseIsEqualDeep` for arrays with support for\n     * partial deep comparisons.\n     *\n     * @private\n     * @param {Array} array The array to compare.\n     * @param {Array} other The other array to compare.\n     * @param {Function} equalFunc The function to determine equivalents of values.\n     * @param {Function} [customizer] The function to customize comparing arrays.\n     * @param {boolean} [isLoose] Specify performing partial comparisons.\n     * @param {Array} [stackA] Tracks traversed `value` objects.\n     * @param {Array} [stackB] Tracks traversed `other` objects.\n     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n     */\n    function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {\n      var index = -1,\n          arrLength = array.length,\n          othLength = other.length;\n\n      if (arrLength != othLength && !(isLoose && othLength > arrLength)) {\n        return false;\n      }\n      // Ignore non-index properties.\n      while (++index < arrLength) {\n        var arrValue = array[index],\n            othValue = other[index],\n            result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;\n\n        if (result !== undefined) {\n          if (result) {\n            continue;\n          }\n          return false;\n        }\n        // Recursively compare arrays (susceptible to call stack limits).\n        if (isLoose) {\n          if (!arraySome(other, function(othValue) {\n                return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);\n              })) {\n            return false;\n          }\n        } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {\n          return false;\n        }\n      }\n      return true;\n    }\n\n    /**\n     * A specialized version of `baseIsEqualDeep` for comparing objects of\n     * the same `toStringTag`.\n     *\n     * **Note:** This function only supports comparing values with tags of\n     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n     *\n     * @private\n     * @param {Object} object The object to compare.\n     * @param {Object} other The other object to compare.\n     * @param {string} tag The `toStringTag` of the objects to compare.\n     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n     */\n    function equalByTag(object, other, tag) {\n      switch (tag) {\n        case boolTag:\n        case dateTag:\n          // Coerce dates and booleans to numbers, dates to milliseconds and booleans\n          // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.\n          return +object == +other;\n\n        case errorTag:\n          return object.name == other.name && object.message == other.message;\n\n        case numberTag:\n          // Treat `NaN` vs. `NaN` as equal.\n          return (object != +object)\n            ? other != +other\n            : object == +other;\n\n        case regexpTag:\n        case stringTag:\n          // Coerce regexes to strings and treat strings primitives and string\n          // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.\n          return object == (other + '');\n      }\n      return false;\n    }\n\n    /**\n     * A specialized version of `baseIsEqualDeep` for objects with support for\n     * partial deep comparisons.\n     *\n     * @private\n     * @param {Object} object The object to compare.\n     * @param {Object} other The other object to compare.\n     * @param {Function} equalFunc The function to determine equivalents of values.\n     * @param {Function} [customizer] The function to customize comparing values.\n     * @param {boolean} [isLoose] Specify performing partial comparisons.\n     * @param {Array} [stackA] Tracks traversed `value` objects.\n     * @param {Array} [stackB] Tracks traversed `other` objects.\n     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n     */\n    function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {\n      var objProps = keys(object),\n          objLength = objProps.length,\n          othProps = keys(other),\n          othLength = othProps.length;\n\n      if (objLength != othLength && !isLoose) {\n        return false;\n      }\n      var index = objLength;\n      while (index--) {\n        var key = objProps[index];\n        if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {\n          return false;\n        }\n      }\n      var skipCtor = isLoose;\n      while (++index < objLength) {\n        key = objProps[index];\n        var objValue = object[key],\n            othValue = other[key],\n            result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined;\n\n        // Recursively compare objects (susceptible to call stack limits).\n        if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {\n          return false;\n        }\n        skipCtor || (skipCtor = key == 'constructor');\n      }\n      if (!skipCtor) {\n        var objCtor = object.constructor,\n            othCtor = other.constructor;\n\n        // Non `Object` object instances with different constructors are not equal.\n        if (objCtor != othCtor &&\n            ('constructor' in object && 'constructor' in other) &&\n            !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n              typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n          return false;\n        }\n      }\n      return true;\n    }\n\n    /**\n     * Gets the appropriate \"callback\" function. If the `_.callback` method is\n     * customized this function returns the custom method, otherwise it returns\n     * the `baseCallback` function. If arguments are provided the chosen function\n     * is invoked with them and its result is returned.\n     *\n     * @private\n     * @returns {Function} Returns the chosen function or its result.\n     */\n    function getCallback(func, thisArg, argCount) {\n      var result = lodash.callback || callback;\n      result = result === callback ? baseCallback : result;\n      return argCount ? result(func, thisArg, argCount) : result;\n    }\n\n    /**\n     * Gets metadata for `func`.\n     *\n     * @private\n     * @param {Function} func The function to query.\n     * @returns {*} Returns the metadata for `func`.\n     */\n    var getData = !metaMap ? noop : function(func) {\n      return metaMap.get(func);\n    };\n\n    /**\n     * Gets the name of `func`.\n     *\n     * @private\n     * @param {Function} func The function to query.\n     * @returns {string} Returns the function name.\n     */\n    function getFuncName(func) {\n      var result = func.name,\n          array = realNames[result],\n          length = array ? array.length : 0;\n\n      while (length--) {\n        var data = array[length],\n            otherFunc = data.func;\n        if (otherFunc == null || otherFunc == func) {\n          return data.name;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Gets the appropriate \"indexOf\" function. If the `_.indexOf` method is\n     * customized this function returns the custom method, otherwise it returns\n     * the `baseIndexOf` function. If arguments are provided the chosen function\n     * is invoked with them and its result is returned.\n     *\n     * @private\n     * @returns {Function|number} Returns the chosen function or its result.\n     */\n    function getIndexOf(collection, target, fromIndex) {\n      var result = lodash.indexOf || indexOf;\n      result = result === indexOf ? baseIndexOf : result;\n      return collection ? result(collection, target, fromIndex) : result;\n    }\n\n    /**\n     * Gets the \"length\" property value of `object`.\n     *\n     * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)\n     * that affects Safari on at least iOS 8.1-8.3 ARM64.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @returns {*} Returns the \"length\" value.\n     */\n    var getLength = baseProperty('length');\n\n    /**\n     * Gets the propery names, values, and compare flags of `object`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the match data of `object`.\n     */\n    function getMatchData(object) {\n      var result = pairs(object),\n          length = result.length;\n\n      while (length--) {\n        result[length][2] = isStrictComparable(result[length][1]);\n      }\n      return result;\n    }\n\n    /**\n     * Gets the native function at `key` of `object`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @param {string} key The key of the method to get.\n     * @returns {*} Returns the function if it's native, else `undefined`.\n     */\n    function getNative(object, key) {\n      var value = object == null ? undefined : object[key];\n      return isNative(value) ? value : undefined;\n    }\n\n    /**\n     * Gets the view, applying any `transforms` to the `start` and `end` positions.\n     *\n     * @private\n     * @param {number} start The start of the view.\n     * @param {number} end The end of the view.\n     * @param {Array} transforms The transformations to apply to the view.\n     * @returns {Object} Returns an object containing the `start` and `end`\n     *  positions of the view.\n     */\n    function getView(start, end, transforms) {\n      var index = -1,\n          length = transforms.length;\n\n      while (++index < length) {\n        var data = transforms[index],\n            size = data.size;\n\n        switch (data.type) {\n          case 'drop':      start += size; break;\n          case 'dropRight': end -= size; break;\n          case 'take':      end = nativeMin(end, start + size); break;\n          case 'takeRight': start = nativeMax(start, end - size); break;\n        }\n      }\n      return { 'start': start, 'end': end };\n    }\n\n    /**\n     * Initializes an array clone.\n     *\n     * @private\n     * @param {Array} array The array to clone.\n     * @returns {Array} Returns the initialized clone.\n     */\n    function initCloneArray(array) {\n      var length = array.length,\n          result = new array.constructor(length);\n\n      // Add array properties assigned by `RegExp#exec`.\n      if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n        result.index = array.index;\n        result.input = array.input;\n      }\n      return result;\n    }\n\n    /**\n     * Initializes an object clone.\n     *\n     * @private\n     * @param {Object} object The object to clone.\n     * @returns {Object} Returns the initialized clone.\n     */\n    function initCloneObject(object) {\n      var Ctor = object.constructor;\n      if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {\n        Ctor = Object;\n      }\n      return new Ctor;\n    }\n\n    /**\n     * Initializes an object clone based on its `toStringTag`.\n     *\n     * **Note:** This function only supports cloning values with tags of\n     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n     *\n     * @private\n     * @param {Object} object The object to clone.\n     * @param {string} tag The `toStringTag` of the object to clone.\n     * @param {boolean} [isDeep] Specify a deep clone.\n     * @returns {Object} Returns the initialized clone.\n     */\n    function initCloneByTag(object, tag, isDeep) {\n      var Ctor = object.constructor;\n      switch (tag) {\n        case arrayBufferTag:\n          return bufferClone(object);\n\n        case boolTag:\n        case dateTag:\n          return new Ctor(+object);\n\n        case float32Tag: case float64Tag:\n        case int8Tag: case int16Tag: case int32Tag:\n        case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n          var buffer = object.buffer;\n          return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);\n\n        case numberTag:\n        case stringTag:\n          return new Ctor(object);\n\n        case regexpTag:\n          var result = new Ctor(object.source, reFlags.exec(object));\n          result.lastIndex = object.lastIndex;\n      }\n      return result;\n    }\n\n    /**\n     * Invokes the method at `path` on `object`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @param {Array|string} path The path of the method to invoke.\n     * @param {Array} args The arguments to invoke the method with.\n     * @returns {*} Returns the result of the invoked method.\n     */\n    function invokePath(object, path, args) {\n      if (object != null && !isKey(path, object)) {\n        path = toPath(path);\n        object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n        path = last(path);\n      }\n      var func = object == null ? object : object[path];\n      return func == null ? undefined : func.apply(object, args);\n    }\n\n    /**\n     * Checks if `value` is array-like.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n     */\n    function isArrayLike(value) {\n      return value != null && isLength(getLength(value));\n    }\n\n    /**\n     * Checks if `value` is a valid array-like index.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n     */\n    function isIndex(value, length) {\n      value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;\n      length = length == null ? MAX_SAFE_INTEGER : length;\n      return value > -1 && value % 1 == 0 && value < length;\n    }\n\n    /**\n     * Checks if the provided arguments are from an iteratee call.\n     *\n     * @private\n     * @param {*} value The potential iteratee value argument.\n     * @param {*} index The potential iteratee index or key argument.\n     * @param {*} object The potential iteratee object argument.\n     * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.\n     */\n    function isIterateeCall(value, index, object) {\n      if (!isObject(object)) {\n        return false;\n      }\n      var type = typeof index;\n      if (type == 'number'\n          ? (isArrayLike(object) && isIndex(index, object.length))\n          : (type == 'string' && index in object)) {\n        var other = object[index];\n        return value === value ? (value === other) : (other !== other);\n      }\n      return false;\n    }\n\n    /**\n     * Checks if `value` is a property name and not a property path.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @param {Object} [object] The object to query keys on.\n     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n     */\n    function isKey(value, object) {\n      var type = typeof value;\n      if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') {\n        return true;\n      }\n      if (isArray(value)) {\n        return false;\n      }\n      var result = !reIsDeepProp.test(value);\n      return result || (object != null && value in toObject(object));\n    }\n\n    /**\n     * Checks if `func` has a lazy counterpart.\n     *\n     * @private\n     * @param {Function} func The function to check.\n     * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.\n     */\n    function isLaziable(func) {\n      var funcName = getFuncName(func);\n      if (!(funcName in LazyWrapper.prototype)) {\n        return false;\n      }\n      var other = lodash[funcName];\n      if (func === other) {\n        return true;\n      }\n      var data = getData(other);\n      return !!data && func === data[0];\n    }\n\n    /**\n     * Checks if `value` is a valid array-like length.\n     *\n     * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n     */\n    function isLength(value) {\n      return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n    }\n\n    /**\n     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n     *\n     * @private\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` if suitable for strict\n     *  equality comparisons, else `false`.\n     */\n    function isStrictComparable(value) {\n      return value === value && !isObject(value);\n    }\n\n    /**\n     * Merges the function metadata of `source` into `data`.\n     *\n     * Merging metadata reduces the number of wrappers required to invoke a function.\n     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n     * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`\n     * augment function arguments, making the order in which they are executed important,\n     * preventing the merging of metadata. However, we make an exception for a safe\n     * common case where curried functions have `_.ary` and or `_.rearg` applied.\n     *\n     * @private\n     * @param {Array} data The destination metadata.\n     * @param {Array} source The source metadata.\n     * @returns {Array} Returns `data`.\n     */\n    function mergeData(data, source) {\n      var bitmask = data[1],\n          srcBitmask = source[1],\n          newBitmask = bitmask | srcBitmask,\n          isCommon = newBitmask < ARY_FLAG;\n\n      var isCombo =\n        (srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG) ||\n        (srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8]) ||\n        (srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG);\n\n      // Exit early if metadata can't be merged.\n      if (!(isCommon || isCombo)) {\n        return data;\n      }\n      // Use source `thisArg` if available.\n      if (srcBitmask & BIND_FLAG) {\n        data[2] = source[2];\n        // Set when currying a bound function.\n        newBitmask |= (bitmask & BIND_FLAG) ? 0 : CURRY_BOUND_FLAG;\n      }\n      // Compose partial arguments.\n      var value = source[3];\n      if (value) {\n        var partials = data[3];\n        data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);\n        data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);\n      }\n      // Compose partial right arguments.\n      value = source[5];\n      if (value) {\n        partials = data[5];\n        data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);\n        data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);\n      }\n      // Use source `argPos` if available.\n      value = source[7];\n      if (value) {\n        data[7] = arrayCopy(value);\n      }\n      // Use source `ary` if it's smaller.\n      if (srcBitmask & ARY_FLAG) {\n        data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n      }\n      // Use source `arity` if one is not provided.\n      if (data[9] == null) {\n        data[9] = source[9];\n      }\n      // Use source `func` and merge bitmasks.\n      data[0] = source[0];\n      data[1] = newBitmask;\n\n      return data;\n    }\n\n    /**\n     * Used by `_.defaultsDeep` to customize its `_.merge` use.\n     *\n     * @private\n     * @param {*} objectValue The destination object property value.\n     * @param {*} sourceValue The source object property value.\n     * @returns {*} Returns the value to assign to the destination object.\n     */\n    function mergeDefaults(objectValue, sourceValue) {\n      return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);\n    }\n\n    /**\n     * A specialized version of `_.pick` which picks `object` properties specified\n     * by `props`.\n     *\n     * @private\n     * @param {Object} object The source object.\n     * @param {string[]} props The property names to pick.\n     * @returns {Object} Returns the new object.\n     */\n    function pickByArray(object, props) {\n      object = toObject(object);\n\n      var index = -1,\n          length = props.length,\n          result = {};\n\n      while (++index < length) {\n        var key = props[index];\n        if (key in object) {\n          result[key] = object[key];\n        }\n      }\n      return result;\n    }\n\n    /**\n     * A specialized version of `_.pick` which picks `object` properties `predicate`\n     * returns truthy for.\n     *\n     * @private\n     * @param {Object} object The source object.\n     * @param {Function} predicate The function invoked per iteration.\n     * @returns {Object} Returns the new object.\n     */\n    function pickByCallback(object, predicate) {\n      var result = {};\n      baseForIn(object, function(value, key, object) {\n        if (predicate(value, key, object)) {\n          result[key] = value;\n        }\n      });\n      return result;\n    }\n\n    /**\n     * Reorder `array` according to the specified indexes where the element at\n     * the first index is assigned as the first element, the element at\n     * the second index is assigned as the second element, and so on.\n     *\n     * @private\n     * @param {Array} array The array to reorder.\n     * @param {Array} indexes The arranged array indexes.\n     * @returns {Array} Returns `array`.\n     */\n    function reorder(array, indexes) {\n      var arrLength = array.length,\n          length = nativeMin(indexes.length, arrLength),\n          oldArray = arrayCopy(array);\n\n      while (length--) {\n        var index = indexes[length];\n        array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n      }\n      return array;\n    }\n\n    /**\n     * Sets metadata for `func`.\n     *\n     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n     * period of time, it will trip its breaker and transition to an identity function\n     * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)\n     * for more details.\n     *\n     * @private\n     * @param {Function} func The function to associate metadata with.\n     * @param {*} data The metadata.\n     * @returns {Function} Returns `func`.\n     */\n    var setData = (function() {\n      var count = 0,\n          lastCalled = 0;\n\n      return function(key, value) {\n        var stamp = now(),\n            remaining = HOT_SPAN - (stamp - lastCalled);\n\n        lastCalled = stamp;\n        if (remaining > 0) {\n          if (++count >= HOT_COUNT) {\n            return key;\n          }\n        } else {\n          count = 0;\n        }\n        return baseSetData(key, value);\n      };\n    }());\n\n    /**\n     * A fallback implementation of `Object.keys` which creates an array of the\n     * own enumerable property names of `object`.\n     *\n     * @private\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property names.\n     */\n    function shimKeys(object) {\n      var props = keysIn(object),\n          propsLength = props.length,\n          length = propsLength && object.length;\n\n      var allowIndexes = !!length && isLength(length) &&\n        (isArray(object) || isArguments(object));\n\n      var index = -1,\n          result = [];\n\n      while (++index < propsLength) {\n        var key = props[index];\n        if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {\n          result.push(key);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Converts `value` to an array-like object if it's not one.\n     *\n     * @private\n     * @param {*} value The value to process.\n     * @returns {Array|Object} Returns the array-like object.\n     */\n    function toIterable(value) {\n      if (value == null) {\n        return [];\n      }\n      if (!isArrayLike(value)) {\n        return values(value);\n      }\n      return isObject(value) ? value : Object(value);\n    }\n\n    /**\n     * Converts `value` to an object if it's not one.\n     *\n     * @private\n     * @param {*} value The value to process.\n     * @returns {Object} Returns the object.\n     */\n    function toObject(value) {\n      return isObject(value) ? value : Object(value);\n    }\n\n    /**\n     * Converts `value` to property path array if it's not one.\n     *\n     * @private\n     * @param {*} value The value to process.\n     * @returns {Array} Returns the property path array.\n     */\n    function toPath(value) {\n      if (isArray(value)) {\n        return value;\n      }\n      var result = [];\n      baseToString(value).replace(rePropName, function(match, number, quote, string) {\n        result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n      });\n      return result;\n    }\n\n    /**\n     * Creates a clone of `wrapper`.\n     *\n     * @private\n     * @param {Object} wrapper The wrapper to clone.\n     * @returns {Object} Returns the cloned wrapper.\n     */\n    function wrapperClone(wrapper) {\n      return wrapper instanceof LazyWrapper\n        ? wrapper.clone()\n        : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates an array of elements split into groups the length of `size`.\n     * If `collection` can't be split evenly, the final chunk will be the remaining\n     * elements.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to process.\n     * @param {number} [size=1] The length of each chunk.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the new array containing chunks.\n     * @example\n     *\n     * _.chunk(['a', 'b', 'c', 'd'], 2);\n     * // => [['a', 'b'], ['c', 'd']]\n     *\n     * _.chunk(['a', 'b', 'c', 'd'], 3);\n     * // => [['a', 'b', 'c'], ['d']]\n     */\n    function chunk(array, size, guard) {\n      if (guard ? isIterateeCall(array, size, guard) : size == null) {\n        size = 1;\n      } else {\n        size = nativeMax(nativeFloor(size) || 1, 1);\n      }\n      var index = 0,\n          length = array ? array.length : 0,\n          resIndex = -1,\n          result = Array(nativeCeil(length / size));\n\n      while (index < length) {\n        result[++resIndex] = baseSlice(array, index, (index += size));\n      }\n      return result;\n    }\n\n    /**\n     * Creates an array with all falsey values removed. The values `false`, `null`,\n     * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to compact.\n     * @returns {Array} Returns the new array of filtered values.\n     * @example\n     *\n     * _.compact([0, 1, false, 2, '', 3]);\n     * // => [1, 2, 3]\n     */\n    function compact(array) {\n      var index = -1,\n          length = array ? array.length : 0,\n          resIndex = -1,\n          result = [];\n\n      while (++index < length) {\n        var value = array[index];\n        if (value) {\n          result[++resIndex] = value;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Creates an array of unique `array` values not included in the other\n     * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to inspect.\n     * @param {...Array} [values] The arrays of values to exclude.\n     * @returns {Array} Returns the new array of filtered values.\n     * @example\n     *\n     * _.difference([1, 2, 3], [4, 2]);\n     * // => [1, 3]\n     */\n    var difference = restParam(function(array, values) {\n      return (isObjectLike(array) && isArrayLike(array))\n        ? baseDifference(array, baseFlatten(values, false, true))\n        : [];\n    });\n\n    /**\n     * Creates a slice of `array` with `n` elements dropped from the beginning.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {number} [n=1] The number of elements to drop.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.drop([1, 2, 3]);\n     * // => [2, 3]\n     *\n     * _.drop([1, 2, 3], 2);\n     * // => [3]\n     *\n     * _.drop([1, 2, 3], 5);\n     * // => []\n     *\n     * _.drop([1, 2, 3], 0);\n     * // => [1, 2, 3]\n     */\n    function drop(array, n, guard) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (guard ? isIterateeCall(array, n, guard) : n == null) {\n        n = 1;\n      }\n      return baseSlice(array, n < 0 ? 0 : n);\n    }\n\n    /**\n     * Creates a slice of `array` with `n` elements dropped from the end.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {number} [n=1] The number of elements to drop.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.dropRight([1, 2, 3]);\n     * // => [1, 2]\n     *\n     * _.dropRight([1, 2, 3], 2);\n     * // => [1]\n     *\n     * _.dropRight([1, 2, 3], 5);\n     * // => []\n     *\n     * _.dropRight([1, 2, 3], 0);\n     * // => [1, 2, 3]\n     */\n    function dropRight(array, n, guard) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (guard ? isIterateeCall(array, n, guard) : n == null) {\n        n = 1;\n      }\n      n = length - (+n || 0);\n      return baseSlice(array, 0, n < 0 ? 0 : n);\n    }\n\n    /**\n     * Creates a slice of `array` excluding elements dropped from the end.\n     * Elements are dropped until `predicate` returns falsey. The predicate is\n     * bound to `thisArg` and invoked with three arguments: (value, index, array).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that match the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.dropRightWhile([1, 2, 3], function(n) {\n     *   return n > 1;\n     * });\n     * // => [1]\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': true },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': false }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');\n     * // => ['barney', 'fred']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.dropRightWhile(users, 'active', false), 'user');\n     * // => ['barney']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.dropRightWhile(users, 'active'), 'user');\n     * // => ['barney', 'fred', 'pebbles']\n     */\n    function dropRightWhile(array, predicate, thisArg) {\n      return (array && array.length)\n        ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true)\n        : [];\n    }\n\n    /**\n     * Creates a slice of `array` excluding elements dropped from the beginning.\n     * Elements are dropped until `predicate` returns falsey. The predicate is\n     * bound to `thisArg` and invoked with three arguments: (value, index, array).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.dropWhile([1, 2, 3], function(n) {\n     *   return n < 3;\n     * });\n     * // => [3]\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': false },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': true }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');\n     * // => ['fred', 'pebbles']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.dropWhile(users, 'active', false), 'user');\n     * // => ['pebbles']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.dropWhile(users, 'active'), 'user');\n     * // => ['barney', 'fred', 'pebbles']\n     */\n    function dropWhile(array, predicate, thisArg) {\n      return (array && array.length)\n        ? baseWhile(array, getCallback(predicate, thisArg, 3), true)\n        : [];\n    }\n\n    /**\n     * Fills elements of `array` with `value` from `start` up to, but not\n     * including, `end`.\n     *\n     * **Note:** This method mutates `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to fill.\n     * @param {*} value The value to fill `array` with.\n     * @param {number} [start=0] The start position.\n     * @param {number} [end=array.length] The end position.\n     * @returns {Array} Returns `array`.\n     * @example\n     *\n     * var array = [1, 2, 3];\n     *\n     * _.fill(array, 'a');\n     * console.log(array);\n     * // => ['a', 'a', 'a']\n     *\n     * _.fill(Array(3), 2);\n     * // => [2, 2, 2]\n     *\n     * _.fill([4, 6, 8], '*', 1, 2);\n     * // => [4, '*', 8]\n     */\n    function fill(array, value, start, end) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n        start = 0;\n        end = length;\n      }\n      return baseFill(array, value, start, end);\n    }\n\n    /**\n     * This method is like `_.find` except that it returns the index of the first\n     * element `predicate` returns truthy for instead of the element itself.\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {number} Returns the index of the found element, else `-1`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': false },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': true }\n     * ];\n     *\n     * _.findIndex(users, function(chr) {\n     *   return chr.user == 'barney';\n     * });\n     * // => 0\n     *\n     * // using the `_.matches` callback shorthand\n     * _.findIndex(users, { 'user': 'fred', 'active': false });\n     * // => 1\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.findIndex(users, 'active', false);\n     * // => 0\n     *\n     * // using the `_.property` callback shorthand\n     * _.findIndex(users, 'active');\n     * // => 2\n     */\n    var findIndex = createFindIndex();\n\n    /**\n     * This method is like `_.findIndex` except that it iterates over elements\n     * of `collection` from right to left.\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {number} Returns the index of the found element, else `-1`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': true },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': false }\n     * ];\n     *\n     * _.findLastIndex(users, function(chr) {\n     *   return chr.user == 'pebbles';\n     * });\n     * // => 2\n     *\n     * // using the `_.matches` callback shorthand\n     * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n     * // => 0\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.findLastIndex(users, 'active', false);\n     * // => 2\n     *\n     * // using the `_.property` callback shorthand\n     * _.findLastIndex(users, 'active');\n     * // => 0\n     */\n    var findLastIndex = createFindIndex(true);\n\n    /**\n     * Gets the first element of `array`.\n     *\n     * @static\n     * @memberOf _\n     * @alias head\n     * @category Array\n     * @param {Array} array The array to query.\n     * @returns {*} Returns the first element of `array`.\n     * @example\n     *\n     * _.first([1, 2, 3]);\n     * // => 1\n     *\n     * _.first([]);\n     * // => undefined\n     */\n    function first(array) {\n      return array ? array[0] : undefined;\n    }\n\n    /**\n     * Flattens a nested array. If `isDeep` is `true` the array is recursively\n     * flattened, otherwise it is only flattened a single level.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to flatten.\n     * @param {boolean} [isDeep] Specify a deep flatten.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the new flattened array.\n     * @example\n     *\n     * _.flatten([1, [2, 3, [4]]]);\n     * // => [1, 2, 3, [4]]\n     *\n     * // using `isDeep`\n     * _.flatten([1, [2, 3, [4]]], true);\n     * // => [1, 2, 3, 4]\n     */\n    function flatten(array, isDeep, guard) {\n      var length = array ? array.length : 0;\n      if (guard && isIterateeCall(array, isDeep, guard)) {\n        isDeep = false;\n      }\n      return length ? baseFlatten(array, isDeep) : [];\n    }\n\n    /**\n     * Recursively flattens a nested array.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to recursively flatten.\n     * @returns {Array} Returns the new flattened array.\n     * @example\n     *\n     * _.flattenDeep([1, [2, 3, [4]]]);\n     * // => [1, 2, 3, 4]\n     */\n    function flattenDeep(array) {\n      var length = array ? array.length : 0;\n      return length ? baseFlatten(array, true) : [];\n    }\n\n    /**\n     * Gets the index at which the first occurrence of `value` is found in `array`\n     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n     * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`\n     * performs a faster binary search.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to search.\n     * @param {*} value The value to search for.\n     * @param {boolean|number} [fromIndex=0] The index to search from or `true`\n     *  to perform a binary search on a sorted array.\n     * @returns {number} Returns the index of the matched value, else `-1`.\n     * @example\n     *\n     * _.indexOf([1, 2, 1, 2], 2);\n     * // => 1\n     *\n     * // using `fromIndex`\n     * _.indexOf([1, 2, 1, 2], 2, 2);\n     * // => 3\n     *\n     * // performing a binary search\n     * _.indexOf([1, 1, 2, 2], 2, true);\n     * // => 2\n     */\n    function indexOf(array, value, fromIndex) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return -1;\n      }\n      if (typeof fromIndex == 'number') {\n        fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;\n      } else if (fromIndex) {\n        var index = binaryIndex(array, value);\n        if (index < length &&\n            (value === value ? (value === array[index]) : (array[index] !== array[index]))) {\n          return index;\n        }\n        return -1;\n      }\n      return baseIndexOf(array, value, fromIndex || 0);\n    }\n\n    /**\n     * Gets all but the last element of `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.initial([1, 2, 3]);\n     * // => [1, 2]\n     */\n    function initial(array) {\n      return dropRight(array, 1);\n    }\n\n    /**\n     * Creates an array of unique values that are included in all of the provided\n     * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {...Array} [arrays] The arrays to inspect.\n     * @returns {Array} Returns the new array of shared values.\n     * @example\n     * _.intersection([1, 2], [4, 2], [2, 1]);\n     * // => [2]\n     */\n    var intersection = restParam(function(arrays) {\n      var othLength = arrays.length,\n          othIndex = othLength,\n          caches = Array(length),\n          indexOf = getIndexOf(),\n          isCommon = indexOf == baseIndexOf,\n          result = [];\n\n      while (othIndex--) {\n        var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];\n        caches[othIndex] = (isCommon && value.length >= 120) ? createCache(othIndex && value) : null;\n      }\n      var array = arrays[0],\n          index = -1,\n          length = array ? array.length : 0,\n          seen = caches[0];\n\n      outer:\n      while (++index < length) {\n        value = array[index];\n        if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {\n          var othIndex = othLength;\n          while (--othIndex) {\n            var cache = caches[othIndex];\n            if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {\n              continue outer;\n            }\n          }\n          if (seen) {\n            seen.push(value);\n          }\n          result.push(value);\n        }\n      }\n      return result;\n    });\n\n    /**\n     * Gets the last element of `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @returns {*} Returns the last element of `array`.\n     * @example\n     *\n     * _.last([1, 2, 3]);\n     * // => 3\n     */\n    function last(array) {\n      var length = array ? array.length : 0;\n      return length ? array[length - 1] : undefined;\n    }\n\n    /**\n     * This method is like `_.indexOf` except that it iterates over elements of\n     * `array` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to search.\n     * @param {*} value The value to search for.\n     * @param {boolean|number} [fromIndex=array.length-1] The index to search from\n     *  or `true` to perform a binary search on a sorted array.\n     * @returns {number} Returns the index of the matched value, else `-1`.\n     * @example\n     *\n     * _.lastIndexOf([1, 2, 1, 2], 2);\n     * // => 3\n     *\n     * // using `fromIndex`\n     * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n     * // => 1\n     *\n     * // performing a binary search\n     * _.lastIndexOf([1, 1, 2, 2], 2, true);\n     * // => 3\n     */\n    function lastIndexOf(array, value, fromIndex) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return -1;\n      }\n      var index = length;\n      if (typeof fromIndex == 'number') {\n        index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;\n      } else if (fromIndex) {\n        index = binaryIndex(array, value, true) - 1;\n        var other = array[index];\n        if (value === value ? (value === other) : (other !== other)) {\n          return index;\n        }\n        return -1;\n      }\n      if (value !== value) {\n        return indexOfNaN(array, index, true);\n      }\n      while (index--) {\n        if (array[index] === value) {\n          return index;\n        }\n      }\n      return -1;\n    }\n\n    /**\n     * Removes all provided values from `array` using\n     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons.\n     *\n     * **Note:** Unlike `_.without`, this method mutates `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to modify.\n     * @param {...*} [values] The values to remove.\n     * @returns {Array} Returns `array`.\n     * @example\n     *\n     * var array = [1, 2, 3, 1, 2, 3];\n     *\n     * _.pull(array, 2, 3);\n     * console.log(array);\n     * // => [1, 1]\n     */\n    function pull() {\n      var args = arguments,\n          array = args[0];\n\n      if (!(array && array.length)) {\n        return array;\n      }\n      var index = 0,\n          indexOf = getIndexOf(),\n          length = args.length;\n\n      while (++index < length) {\n        var fromIndex = 0,\n            value = args[index];\n\n        while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {\n          splice.call(array, fromIndex, 1);\n        }\n      }\n      return array;\n    }\n\n    /**\n     * Removes elements from `array` corresponding to the given indexes and returns\n     * an array of the removed elements. Indexes may be specified as an array of\n     * indexes or as individual arguments.\n     *\n     * **Note:** Unlike `_.at`, this method mutates `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to modify.\n     * @param {...(number|number[])} [indexes] The indexes of elements to remove,\n     *  specified as individual indexes or arrays of indexes.\n     * @returns {Array} Returns the new array of removed elements.\n     * @example\n     *\n     * var array = [5, 10, 15, 20];\n     * var evens = _.pullAt(array, 1, 3);\n     *\n     * console.log(array);\n     * // => [5, 15]\n     *\n     * console.log(evens);\n     * // => [10, 20]\n     */\n    var pullAt = restParam(function(array, indexes) {\n      indexes = baseFlatten(indexes);\n\n      var result = baseAt(array, indexes);\n      basePullAt(array, indexes.sort(baseCompareAscending));\n      return result;\n    });\n\n    /**\n     * Removes all elements from `array` that `predicate` returns truthy for\n     * and returns an array of the removed elements. The predicate is bound to\n     * `thisArg` and invoked with three arguments: (value, index, array).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * **Note:** Unlike `_.filter`, this method mutates `array`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to modify.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the new array of removed elements.\n     * @example\n     *\n     * var array = [1, 2, 3, 4];\n     * var evens = _.remove(array, function(n) {\n     *   return n % 2 == 0;\n     * });\n     *\n     * console.log(array);\n     * // => [1, 3]\n     *\n     * console.log(evens);\n     * // => [2, 4]\n     */\n    function remove(array, predicate, thisArg) {\n      var result = [];\n      if (!(array && array.length)) {\n        return result;\n      }\n      var index = -1,\n          indexes = [],\n          length = array.length;\n\n      predicate = getCallback(predicate, thisArg, 3);\n      while (++index < length) {\n        var value = array[index];\n        if (predicate(value, index, array)) {\n          result.push(value);\n          indexes.push(index);\n        }\n      }\n      basePullAt(array, indexes);\n      return result;\n    }\n\n    /**\n     * Gets all but the first element of `array`.\n     *\n     * @static\n     * @memberOf _\n     * @alias tail\n     * @category Array\n     * @param {Array} array The array to query.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.rest([1, 2, 3]);\n     * // => [2, 3]\n     */\n    function rest(array) {\n      return drop(array, 1);\n    }\n\n    /**\n     * Creates a slice of `array` from `start` up to, but not including, `end`.\n     *\n     * **Note:** This method is used instead of `Array#slice` to support node\n     * lists in IE < 9 and to ensure dense arrays are returned.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to slice.\n     * @param {number} [start=0] The start position.\n     * @param {number} [end=array.length] The end position.\n     * @returns {Array} Returns the slice of `array`.\n     */\n    function slice(array, start, end) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n        start = 0;\n        end = length;\n      }\n      return baseSlice(array, start, end);\n    }\n\n    /**\n     * Uses a binary search to determine the lowest index at which `value` should\n     * be inserted into `array` in order to maintain its sort order. If an iteratee\n     * function is provided it is invoked for `value` and each element of `array`\n     * to compute their sort ranking. The iteratee is bound to `thisArg` and\n     * invoked with one argument; (value).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The sorted array to inspect.\n     * @param {*} value The value to evaluate.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {number} Returns the index at which `value` should be inserted\n     *  into `array`.\n     * @example\n     *\n     * _.sortedIndex([30, 50], 40);\n     * // => 1\n     *\n     * _.sortedIndex([4, 4, 5, 5], 5);\n     * // => 2\n     *\n     * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };\n     *\n     * // using an iteratee function\n     * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {\n     *   return this.data[word];\n     * }, dict);\n     * // => 1\n     *\n     * // using the `_.property` callback shorthand\n     * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');\n     * // => 1\n     */\n    var sortedIndex = createSortedIndex();\n\n    /**\n     * This method is like `_.sortedIndex` except that it returns the highest\n     * index at which `value` should be inserted into `array` in order to\n     * maintain its sort order.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The sorted array to inspect.\n     * @param {*} value The value to evaluate.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {number} Returns the index at which `value` should be inserted\n     *  into `array`.\n     * @example\n     *\n     * _.sortedLastIndex([4, 4, 5, 5], 5);\n     * // => 4\n     */\n    var sortedLastIndex = createSortedIndex(true);\n\n    /**\n     * Creates a slice of `array` with `n` elements taken from the beginning.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {number} [n=1] The number of elements to take.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.take([1, 2, 3]);\n     * // => [1]\n     *\n     * _.take([1, 2, 3], 2);\n     * // => [1, 2]\n     *\n     * _.take([1, 2, 3], 5);\n     * // => [1, 2, 3]\n     *\n     * _.take([1, 2, 3], 0);\n     * // => []\n     */\n    function take(array, n, guard) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (guard ? isIterateeCall(array, n, guard) : n == null) {\n        n = 1;\n      }\n      return baseSlice(array, 0, n < 0 ? 0 : n);\n    }\n\n    /**\n     * Creates a slice of `array` with `n` elements taken from the end.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {number} [n=1] The number of elements to take.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.takeRight([1, 2, 3]);\n     * // => [3]\n     *\n     * _.takeRight([1, 2, 3], 2);\n     * // => [2, 3]\n     *\n     * _.takeRight([1, 2, 3], 5);\n     * // => [1, 2, 3]\n     *\n     * _.takeRight([1, 2, 3], 0);\n     * // => []\n     */\n    function takeRight(array, n, guard) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (guard ? isIterateeCall(array, n, guard) : n == null) {\n        n = 1;\n      }\n      n = length - (+n || 0);\n      return baseSlice(array, n < 0 ? 0 : n);\n    }\n\n    /**\n     * Creates a slice of `array` with elements taken from the end. Elements are\n     * taken until `predicate` returns falsey. The predicate is bound to `thisArg`\n     * and invoked with three arguments: (value, index, array).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.takeRightWhile([1, 2, 3], function(n) {\n     *   return n > 1;\n     * });\n     * // => [2, 3]\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': true },\n     *   { 'user': 'fred',    'active': false },\n     *   { 'user': 'pebbles', 'active': false }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');\n     * // => ['pebbles']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.takeRightWhile(users, 'active', false), 'user');\n     * // => ['fred', 'pebbles']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.takeRightWhile(users, 'active'), 'user');\n     * // => []\n     */\n    function takeRightWhile(array, predicate, thisArg) {\n      return (array && array.length)\n        ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true)\n        : [];\n    }\n\n    /**\n     * Creates a slice of `array` with elements taken from the beginning. Elements\n     * are taken until `predicate` returns falsey. The predicate is bound to\n     * `thisArg` and invoked with three arguments: (value, index, array).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to query.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the slice of `array`.\n     * @example\n     *\n     * _.takeWhile([1, 2, 3], function(n) {\n     *   return n < 3;\n     * });\n     * // => [1, 2]\n     *\n     * var users = [\n     *   { 'user': 'barney',  'active': false },\n     *   { 'user': 'fred',    'active': false},\n     *   { 'user': 'pebbles', 'active': true }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');\n     * // => ['barney']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.takeWhile(users, 'active', false), 'user');\n     * // => ['barney', 'fred']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.takeWhile(users, 'active'), 'user');\n     * // => []\n     */\n    function takeWhile(array, predicate, thisArg) {\n      return (array && array.length)\n        ? baseWhile(array, getCallback(predicate, thisArg, 3))\n        : [];\n    }\n\n    /**\n     * Creates an array of unique values, in order, from all of the provided arrays\n     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {...Array} [arrays] The arrays to inspect.\n     * @returns {Array} Returns the new array of combined values.\n     * @example\n     *\n     * _.union([1, 2], [4, 2], [2, 1]);\n     * // => [1, 2, 4]\n     */\n    var union = restParam(function(arrays) {\n      return baseUniq(baseFlatten(arrays, false, true));\n    });\n\n    /**\n     * Creates a duplicate-free version of an array, using\n     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons, in which only the first occurence of each element\n     * is kept. Providing `true` for `isSorted` performs a faster search algorithm\n     * for sorted arrays. If an iteratee function is provided it is invoked for\n     * each element in the array to generate the criterion by which uniqueness\n     * is computed. The `iteratee` is bound to `thisArg` and invoked with three\n     * arguments: (value, index, array).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias unique\n     * @category Array\n     * @param {Array} array The array to inspect.\n     * @param {boolean} [isSorted] Specify the array is sorted.\n     * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the new duplicate-value-free array.\n     * @example\n     *\n     * _.uniq([2, 1, 2]);\n     * // => [2, 1]\n     *\n     * // using `isSorted`\n     * _.uniq([1, 1, 2], true);\n     * // => [1, 2]\n     *\n     * // using an iteratee function\n     * _.uniq([1, 2.5, 1.5, 2], function(n) {\n     *   return this.floor(n);\n     * }, Math);\n     * // => [1, 2.5]\n     *\n     * // using the `_.property` callback shorthand\n     * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n     * // => [{ 'x': 1 }, { 'x': 2 }]\n     */\n    function uniq(array, isSorted, iteratee, thisArg) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      if (isSorted != null && typeof isSorted != 'boolean') {\n        thisArg = iteratee;\n        iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;\n        isSorted = false;\n      }\n      var callback = getCallback();\n      if (!(iteratee == null && callback === baseCallback)) {\n        iteratee = callback(iteratee, thisArg, 3);\n      }\n      return (isSorted && getIndexOf() == baseIndexOf)\n        ? sortedUniq(array, iteratee)\n        : baseUniq(array, iteratee);\n    }\n\n    /**\n     * This method is like `_.zip` except that it accepts an array of grouped\n     * elements and creates an array regrouping the elements to their pre-zip\n     * configuration.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array of grouped elements to process.\n     * @returns {Array} Returns the new array of regrouped elements.\n     * @example\n     *\n     * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);\n     * // => [['fred', 30, true], ['barney', 40, false]]\n     *\n     * _.unzip(zipped);\n     * // => [['fred', 'barney'], [30, 40], [true, false]]\n     */\n    function unzip(array) {\n      if (!(array && array.length)) {\n        return [];\n      }\n      var index = -1,\n          length = 0;\n\n      array = arrayFilter(array, function(group) {\n        if (isArrayLike(group)) {\n          length = nativeMax(group.length, length);\n          return true;\n        }\n      });\n      var result = Array(length);\n      while (++index < length) {\n        result[index] = arrayMap(array, baseProperty(index));\n      }\n      return result;\n    }\n\n    /**\n     * This method is like `_.unzip` except that it accepts an iteratee to specify\n     * how regrouped values should be combined. The `iteratee` is bound to `thisArg`\n     * and invoked with four arguments: (accumulator, value, index, group).\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array of grouped elements to process.\n     * @param {Function} [iteratee] The function to combine regrouped values.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the new array of regrouped elements.\n     * @example\n     *\n     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n     * // => [[1, 10, 100], [2, 20, 200]]\n     *\n     * _.unzipWith(zipped, _.add);\n     * // => [3, 30, 300]\n     */\n    function unzipWith(array, iteratee, thisArg) {\n      var length = array ? array.length : 0;\n      if (!length) {\n        return [];\n      }\n      var result = unzip(array);\n      if (iteratee == null) {\n        return result;\n      }\n      iteratee = bindCallback(iteratee, thisArg, 4);\n      return arrayMap(result, function(group) {\n        return arrayReduce(group, iteratee, undefined, true);\n      });\n    }\n\n    /**\n     * Creates an array excluding all provided values using\n     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {Array} array The array to filter.\n     * @param {...*} [values] The values to exclude.\n     * @returns {Array} Returns the new array of filtered values.\n     * @example\n     *\n     * _.without([1, 2, 1, 3], 1, 2);\n     * // => [3]\n     */\n    var without = restParam(function(array, values) {\n      return isArrayLike(array)\n        ? baseDifference(array, values)\n        : [];\n    });\n\n    /**\n     * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n     * of the provided arrays.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {...Array} [arrays] The arrays to inspect.\n     * @returns {Array} Returns the new array of values.\n     * @example\n     *\n     * _.xor([1, 2], [4, 2]);\n     * // => [1, 4]\n     */\n    function xor() {\n      var index = -1,\n          length = arguments.length;\n\n      while (++index < length) {\n        var array = arguments[index];\n        if (isArrayLike(array)) {\n          var result = result\n            ? arrayPush(baseDifference(result, array), baseDifference(array, result))\n            : array;\n        }\n      }\n      return result ? baseUniq(result) : [];\n    }\n\n    /**\n     * Creates an array of grouped elements, the first of which contains the first\n     * elements of the given arrays, the second of which contains the second elements\n     * of the given arrays, and so on.\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {...Array} [arrays] The arrays to process.\n     * @returns {Array} Returns the new array of grouped elements.\n     * @example\n     *\n     * _.zip(['fred', 'barney'], [30, 40], [true, false]);\n     * // => [['fred', 30, true], ['barney', 40, false]]\n     */\n    var zip = restParam(unzip);\n\n    /**\n     * The inverse of `_.pairs`; this method returns an object composed from arrays\n     * of property names and values. Provide either a single two dimensional array,\n     * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names\n     * and one of corresponding values.\n     *\n     * @static\n     * @memberOf _\n     * @alias object\n     * @category Array\n     * @param {Array} props The property names.\n     * @param {Array} [values=[]] The property values.\n     * @returns {Object} Returns the new object.\n     * @example\n     *\n     * _.zipObject([['fred', 30], ['barney', 40]]);\n     * // => { 'fred': 30, 'barney': 40 }\n     *\n     * _.zipObject(['fred', 'barney'], [30, 40]);\n     * // => { 'fred': 30, 'barney': 40 }\n     */\n    function zipObject(props, values) {\n      var index = -1,\n          length = props ? props.length : 0,\n          result = {};\n\n      if (length && !values && !isArray(props[0])) {\n        values = [];\n      }\n      while (++index < length) {\n        var key = props[index];\n        if (values) {\n          result[key] = values[index];\n        } else if (key) {\n          result[key[0]] = key[1];\n        }\n      }\n      return result;\n    }\n\n    /**\n     * This method is like `_.zip` except that it accepts an iteratee to specify\n     * how grouped values should be combined. The `iteratee` is bound to `thisArg`\n     * and invoked with four arguments: (accumulator, value, index, group).\n     *\n     * @static\n     * @memberOf _\n     * @category Array\n     * @param {...Array} [arrays] The arrays to process.\n     * @param {Function} [iteratee] The function to combine grouped values.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the new array of grouped elements.\n     * @example\n     *\n     * _.zipWith([1, 2], [10, 20], [100, 200], _.add);\n     * // => [111, 222]\n     */\n    var zipWith = restParam(function(arrays) {\n      var length = arrays.length,\n          iteratee = length > 2 ? arrays[length - 2] : undefined,\n          thisArg = length > 1 ? arrays[length - 1] : undefined;\n\n      if (length > 2 && typeof iteratee == 'function') {\n        length -= 2;\n      } else {\n        iteratee = (length > 1 && typeof thisArg == 'function') ? (--length, thisArg) : undefined;\n        thisArg = undefined;\n      }\n      arrays.length = length;\n      return unzipWith(arrays, iteratee, thisArg);\n    });\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a `lodash` object that wraps `value` with explicit method\n     * chaining enabled.\n     *\n     * @static\n     * @memberOf _\n     * @category Chain\n     * @param {*} value The value to wrap.\n     * @returns {Object} Returns the new `lodash` wrapper instance.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'age': 36 },\n     *   { 'user': 'fred',    'age': 40 },\n     *   { 'user': 'pebbles', 'age': 1 }\n     * ];\n     *\n     * var youngest = _.chain(users)\n     *   .sortBy('age')\n     *   .map(function(chr) {\n     *     return chr.user + ' is ' + chr.age;\n     *   })\n     *   .first()\n     *   .value();\n     * // => 'pebbles is 1'\n     */\n    function chain(value) {\n      var result = lodash(value);\n      result.__chain__ = true;\n      return result;\n    }\n\n    /**\n     * This method invokes `interceptor` and returns `value`. The interceptor is\n     * bound to `thisArg` and invoked with one argument; (value). The purpose of\n     * this method is to \"tap into\" a method chain in order to perform operations\n     * on intermediate results within the chain.\n     *\n     * @static\n     * @memberOf _\n     * @category Chain\n     * @param {*} value The value to provide to `interceptor`.\n     * @param {Function} interceptor The function to invoke.\n     * @param {*} [thisArg] The `this` binding of `interceptor`.\n     * @returns {*} Returns `value`.\n     * @example\n     *\n     * _([1, 2, 3])\n     *  .tap(function(array) {\n     *    array.pop();\n     *  })\n     *  .reverse()\n     *  .value();\n     * // => [2, 1]\n     */\n    function tap(value, interceptor, thisArg) {\n      interceptor.call(thisArg, value);\n      return value;\n    }\n\n    /**\n     * This method is like `_.tap` except that it returns the result of `interceptor`.\n     *\n     * @static\n     * @memberOf _\n     * @category Chain\n     * @param {*} value The value to provide to `interceptor`.\n     * @param {Function} interceptor The function to invoke.\n     * @param {*} [thisArg] The `this` binding of `interceptor`.\n     * @returns {*} Returns the result of `interceptor`.\n     * @example\n     *\n     * _('  abc  ')\n     *  .chain()\n     *  .trim()\n     *  .thru(function(value) {\n     *    return [value];\n     *  })\n     *  .value();\n     * // => ['abc']\n     */\n    function thru(value, interceptor, thisArg) {\n      return interceptor.call(thisArg, value);\n    }\n\n    /**\n     * Enables explicit method chaining on the wrapper object.\n     *\n     * @name chain\n     * @memberOf _\n     * @category Chain\n     * @returns {Object} Returns the new `lodash` wrapper instance.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 40 }\n     * ];\n     *\n     * // without explicit chaining\n     * _(users).first();\n     * // => { 'user': 'barney', 'age': 36 }\n     *\n     * // with explicit chaining\n     * _(users).chain()\n     *   .first()\n     *   .pick('user')\n     *   .value();\n     * // => { 'user': 'barney' }\n     */\n    function wrapperChain() {\n      return chain(this);\n    }\n\n    /**\n     * Executes the chained sequence and returns the wrapped result.\n     *\n     * @name commit\n     * @memberOf _\n     * @category Chain\n     * @returns {Object} Returns the new `lodash` wrapper instance.\n     * @example\n     *\n     * var array = [1, 2];\n     * var wrapped = _(array).push(3);\n     *\n     * console.log(array);\n     * // => [1, 2]\n     *\n     * wrapped = wrapped.commit();\n     * console.log(array);\n     * // => [1, 2, 3]\n     *\n     * wrapped.last();\n     * // => 3\n     *\n     * console.log(array);\n     * // => [1, 2, 3]\n     */\n    function wrapperCommit() {\n      return new LodashWrapper(this.value(), this.__chain__);\n    }\n\n    /**\n     * Creates a new array joining a wrapped array with any additional arrays\n     * and/or values.\n     *\n     * @name concat\n     * @memberOf _\n     * @category Chain\n     * @param {...*} [values] The values to concatenate.\n     * @returns {Array} Returns the new concatenated array.\n     * @example\n     *\n     * var array = [1];\n     * var wrapped = _(array).concat(2, [3], [[4]]);\n     *\n     * console.log(wrapped.value());\n     * // => [1, 2, 3, [4]]\n     *\n     * console.log(array);\n     * // => [1]\n     */\n    var wrapperConcat = restParam(function(values) {\n      values = baseFlatten(values);\n      return this.thru(function(array) {\n        return arrayConcat(isArray(array) ? array : [toObject(array)], values);\n      });\n    });\n\n    /**\n     * Creates a clone of the chained sequence planting `value` as the wrapped value.\n     *\n     * @name plant\n     * @memberOf _\n     * @category Chain\n     * @returns {Object} Returns the new `lodash` wrapper instance.\n     * @example\n     *\n     * var array = [1, 2];\n     * var wrapped = _(array).map(function(value) {\n     *   return Math.pow(value, 2);\n     * });\n     *\n     * var other = [3, 4];\n     * var otherWrapped = wrapped.plant(other);\n     *\n     * otherWrapped.value();\n     * // => [9, 16]\n     *\n     * wrapped.value();\n     * // => [1, 4]\n     */\n    function wrapperPlant(value) {\n      var result,\n          parent = this;\n\n      while (parent instanceof baseLodash) {\n        var clone = wrapperClone(parent);\n        if (result) {\n          previous.__wrapped__ = clone;\n        } else {\n          result = clone;\n        }\n        var previous = clone;\n        parent = parent.__wrapped__;\n      }\n      previous.__wrapped__ = value;\n      return result;\n    }\n\n    /**\n     * Reverses the wrapped array so the first element becomes the last, the\n     * second element becomes the second to last, and so on.\n     *\n     * **Note:** This method mutates the wrapped array.\n     *\n     * @name reverse\n     * @memberOf _\n     * @category Chain\n     * @returns {Object} Returns the new reversed `lodash` wrapper instance.\n     * @example\n     *\n     * var array = [1, 2, 3];\n     *\n     * _(array).reverse().value()\n     * // => [3, 2, 1]\n     *\n     * console.log(array);\n     * // => [3, 2, 1]\n     */\n    function wrapperReverse() {\n      var value = this.__wrapped__;\n\n      var interceptor = function(value) {\n        return (wrapped && wrapped.__dir__ < 0) ? value : value.reverse();\n      };\n      if (value instanceof LazyWrapper) {\n        var wrapped = value;\n        if (this.__actions__.length) {\n          wrapped = new LazyWrapper(this);\n        }\n        wrapped = wrapped.reverse();\n        wrapped.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });\n        return new LodashWrapper(wrapped, this.__chain__);\n      }\n      return this.thru(interceptor);\n    }\n\n    /**\n     * Produces the result of coercing the unwrapped value to a string.\n     *\n     * @name toString\n     * @memberOf _\n     * @category Chain\n     * @returns {string} Returns the coerced string value.\n     * @example\n     *\n     * _([1, 2, 3]).toString();\n     * // => '1,2,3'\n     */\n    function wrapperToString() {\n      return (this.value() + '');\n    }\n\n    /**\n     * Executes the chained sequence to extract the unwrapped value.\n     *\n     * @name value\n     * @memberOf _\n     * @alias run, toJSON, valueOf\n     * @category Chain\n     * @returns {*} Returns the resolved unwrapped value.\n     * @example\n     *\n     * _([1, 2, 3]).value();\n     * // => [1, 2, 3]\n     */\n    function wrapperValue() {\n      return baseWrapperValue(this.__wrapped__, this.__actions__);\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates an array of elements corresponding to the given keys, or indexes,\n     * of `collection`. Keys may be specified as individual arguments or as arrays\n     * of keys.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {...(number|number[]|string|string[])} [props] The property names\n     *  or indexes of elements to pick, specified individually or in arrays.\n     * @returns {Array} Returns the new array of picked elements.\n     * @example\n     *\n     * _.at(['a', 'b', 'c'], [0, 2]);\n     * // => ['a', 'c']\n     *\n     * _.at(['barney', 'fred', 'pebbles'], 0, 2);\n     * // => ['barney', 'pebbles']\n     */\n    var at = restParam(function(collection, props) {\n      return baseAt(collection, baseFlatten(props));\n    });\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of `collection` through `iteratee`. The corresponding value\n     * of each key is the number of times the key was returned by `iteratee`.\n     * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * _.countBy([4.3, 6.1, 6.4], function(n) {\n     *   return Math.floor(n);\n     * });\n     * // => { '4': 1, '6': 2 }\n     *\n     * _.countBy([4.3, 6.1, 6.4], function(n) {\n     *   return this.floor(n);\n     * }, Math);\n     * // => { '4': 1, '6': 2 }\n     *\n     * _.countBy(['one', 'two', 'three'], 'length');\n     * // => { '3': 2, '5': 1 }\n     */\n    var countBy = createAggregator(function(result, value, key) {\n      hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1);\n    });\n\n    /**\n     * Checks if `predicate` returns truthy for **all** elements of `collection`.\n     * The predicate is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias all\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {boolean} Returns `true` if all elements pass the predicate check,\n     *  else `false`.\n     * @example\n     *\n     * _.every([true, 1, null, 'yes'], Boolean);\n     * // => false\n     *\n     * var users = [\n     *   { 'user': 'barney', 'active': false },\n     *   { 'user': 'fred',   'active': false }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.every(users, { 'user': 'barney', 'active': false });\n     * // => false\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.every(users, 'active', false);\n     * // => true\n     *\n     * // using the `_.property` callback shorthand\n     * _.every(users, 'active');\n     * // => false\n     */\n    function every(collection, predicate, thisArg) {\n      var func = isArray(collection) ? arrayEvery : baseEvery;\n      if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n        predicate = undefined;\n      }\n      if (typeof predicate != 'function' || thisArg !== undefined) {\n        predicate = getCallback(predicate, thisArg, 3);\n      }\n      return func(collection, predicate);\n    }\n\n    /**\n     * Iterates over elements of `collection`, returning an array of all elements\n     * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n     * invoked with three arguments: (value, index|key, collection).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias select\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the new filtered array.\n     * @example\n     *\n     * _.filter([4, 5, 6], function(n) {\n     *   return n % 2 == 0;\n     * });\n     * // => [4, 6]\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36, 'active': true },\n     *   { 'user': 'fred',   'age': 40, 'active': false }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');\n     * // => ['barney']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.filter(users, 'active', false), 'user');\n     * // => ['fred']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.filter(users, 'active'), 'user');\n     * // => ['barney']\n     */\n    function filter(collection, predicate, thisArg) {\n      var func = isArray(collection) ? arrayFilter : baseFilter;\n      predicate = getCallback(predicate, thisArg, 3);\n      return func(collection, predicate);\n    }\n\n    /**\n     * Iterates over elements of `collection`, returning the first element\n     * `predicate` returns truthy for. The predicate is bound to `thisArg` and\n     * invoked with three arguments: (value, index|key, collection).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias detect\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {*} Returns the matched element, else `undefined`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney',  'age': 36, 'active': true },\n     *   { 'user': 'fred',    'age': 40, 'active': false },\n     *   { 'user': 'pebbles', 'age': 1,  'active': true }\n     * ];\n     *\n     * _.result(_.find(users, function(chr) {\n     *   return chr.age < 40;\n     * }), 'user');\n     * // => 'barney'\n     *\n     * // using the `_.matches` callback shorthand\n     * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');\n     * // => 'pebbles'\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.result(_.find(users, 'active', false), 'user');\n     * // => 'fred'\n     *\n     * // using the `_.property` callback shorthand\n     * _.result(_.find(users, 'active'), 'user');\n     * // => 'barney'\n     */\n    var find = createFind(baseEach);\n\n    /**\n     * This method is like `_.find` except that it iterates over elements of\n     * `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {*} Returns the matched element, else `undefined`.\n     * @example\n     *\n     * _.findLast([1, 2, 3, 4], function(n) {\n     *   return n % 2 == 1;\n     * });\n     * // => 3\n     */\n    var findLast = createFind(baseEachRight, true);\n\n    /**\n     * Performs a deep comparison between each element in `collection` and the\n     * source object, returning the first element that has equivalent property\n     * values.\n     *\n     * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n     * numbers, `Object` objects, regexes, and strings. Objects are compared by\n     * their own, not inherited, enumerable properties. For comparing a single\n     * own or inherited property value see `_.matchesProperty`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {Object} source The object of property values to match.\n     * @returns {*} Returns the matched element, else `undefined`.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36, 'active': true },\n     *   { 'user': 'fred',   'age': 40, 'active': false }\n     * ];\n     *\n     * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');\n     * // => 'barney'\n     *\n     * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');\n     * // => 'fred'\n     */\n    function findWhere(collection, source) {\n      return find(collection, baseMatches(source));\n    }\n\n    /**\n     * Iterates over elements of `collection` invoking `iteratee` for each element.\n     * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection). Iteratee functions may exit iteration early\n     * by explicitly returning `false`.\n     *\n     * **Note:** As with other \"Collections\" methods, objects with a \"length\" property\n     * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`\n     * may be used for object iteration.\n     *\n     * @static\n     * @memberOf _\n     * @alias each\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array|Object|string} Returns `collection`.\n     * @example\n     *\n     * _([1, 2]).forEach(function(n) {\n     *   console.log(n);\n     * }).value();\n     * // => logs each value from left to right and returns the array\n     *\n     * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {\n     *   console.log(n, key);\n     * });\n     * // => logs each value-key pair and returns the object (iteration order is not guaranteed)\n     */\n    var forEach = createForEach(arrayEach, baseEach);\n\n    /**\n     * This method is like `_.forEach` except that it iterates over elements of\n     * `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @alias eachRight\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array|Object|string} Returns `collection`.\n     * @example\n     *\n     * _([1, 2]).forEachRight(function(n) {\n     *   console.log(n);\n     * }).value();\n     * // => logs each value from right to left and returns the array\n     */\n    var forEachRight = createForEach(arrayEachRight, baseEachRight);\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of `collection` through `iteratee`. The corresponding value\n     * of each key is an array of the elements responsible for generating the key.\n     * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * _.groupBy([4.2, 6.1, 6.4], function(n) {\n     *   return Math.floor(n);\n     * });\n     * // => { '4': [4.2], '6': [6.1, 6.4] }\n     *\n     * _.groupBy([4.2, 6.1, 6.4], function(n) {\n     *   return this.floor(n);\n     * }, Math);\n     * // => { '4': [4.2], '6': [6.1, 6.4] }\n     *\n     * // using the `_.property` callback shorthand\n     * _.groupBy(['one', 'two', 'three'], 'length');\n     * // => { '3': ['one', 'two'], '5': ['three'] }\n     */\n    var groupBy = createAggregator(function(result, value, key) {\n      if (hasOwnProperty.call(result, key)) {\n        result[key].push(value);\n      } else {\n        result[key] = [value];\n      }\n    });\n\n    /**\n     * Checks if `value` is in `collection` using\n     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)\n     * for equality comparisons. If `fromIndex` is negative, it is used as the offset\n     * from the end of `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @alias contains, include\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {*} target The value to search for.\n     * @param {number} [fromIndex=0] The index to search from.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n     * @returns {boolean} Returns `true` if a matching element is found, else `false`.\n     * @example\n     *\n     * _.includes([1, 2, 3], 1);\n     * // => true\n     *\n     * _.includes([1, 2, 3], 1, 2);\n     * // => false\n     *\n     * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n     * // => true\n     *\n     * _.includes('pebbles', 'eb');\n     * // => true\n     */\n    function includes(collection, target, fromIndex, guard) {\n      var length = collection ? getLength(collection) : 0;\n      if (!isLength(length)) {\n        collection = values(collection);\n        length = collection.length;\n      }\n      if (typeof fromIndex != 'number' || (guard && isIterateeCall(target, fromIndex, guard))) {\n        fromIndex = 0;\n      } else {\n        fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);\n      }\n      return (typeof collection == 'string' || !isArray(collection) && isString(collection))\n        ? (fromIndex <= length && collection.indexOf(target, fromIndex) > -1)\n        : (!!length && getIndexOf(collection, target, fromIndex) > -1);\n    }\n\n    /**\n     * Creates an object composed of keys generated from the results of running\n     * each element of `collection` through `iteratee`. The corresponding value\n     * of each key is the last element responsible for generating the key. The\n     * iteratee function is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns the composed aggregate object.\n     * @example\n     *\n     * var keyData = [\n     *   { 'dir': 'left', 'code': 97 },\n     *   { 'dir': 'right', 'code': 100 }\n     * ];\n     *\n     * _.indexBy(keyData, 'dir');\n     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n     *\n     * _.indexBy(keyData, function(object) {\n     *   return String.fromCharCode(object.code);\n     * });\n     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n     *\n     * _.indexBy(keyData, function(object) {\n     *   return this.fromCharCode(object.code);\n     * }, String);\n     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n     */\n    var indexBy = createAggregator(function(result, value, key) {\n      result[key] = value;\n    });\n\n    /**\n     * Invokes the method at `path` of each element in `collection`, returning\n     * an array of the results of each invoked method. Any additional arguments\n     * are provided to each invoked method. If `methodName` is a function it is\n     * invoked for, and `this` bound to, each element in `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Array|Function|string} path The path of the method to invoke or\n     *  the function invoked per iteration.\n     * @param {...*} [args] The arguments to invoke the method with.\n     * @returns {Array} Returns the array of results.\n     * @example\n     *\n     * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');\n     * // => [[1, 5, 7], [1, 2, 3]]\n     *\n     * _.invoke([123, 456], String.prototype.split, '');\n     * // => [['1', '2', '3'], ['4', '5', '6']]\n     */\n    var invoke = restParam(function(collection, path, args) {\n      var index = -1,\n          isFunc = typeof path == 'function',\n          isProp = isKey(path),\n          result = isArrayLike(collection) ? Array(collection.length) : [];\n\n      baseEach(collection, function(value) {\n        var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined);\n        result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);\n      });\n      return result;\n    });\n\n    /**\n     * Creates an array of values by running each element in `collection` through\n     * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three\n     * arguments: (value, index|key, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * Many lodash methods are guarded to work as iteratees for methods like\n     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n     *\n     * The guarded methods are:\n     * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,\n     * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,\n     * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,\n     * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,\n     * `sum`, `uniq`, and `words`\n     *\n     * @static\n     * @memberOf _\n     * @alias collect\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the new mapped array.\n     * @example\n     *\n     * function timesThree(n) {\n     *   return n * 3;\n     * }\n     *\n     * _.map([1, 2], timesThree);\n     * // => [3, 6]\n     *\n     * _.map({ 'a': 1, 'b': 2 }, timesThree);\n     * // => [3, 6] (iteration order is not guaranteed)\n     *\n     * var users = [\n     *   { 'user': 'barney' },\n     *   { 'user': 'fred' }\n     * ];\n     *\n     * // using the `_.property` callback shorthand\n     * _.map(users, 'user');\n     * // => ['barney', 'fred']\n     */\n    function map(collection, iteratee, thisArg) {\n      var func = isArray(collection) ? arrayMap : baseMap;\n      iteratee = getCallback(iteratee, thisArg, 3);\n      return func(collection, iteratee);\n    }\n\n    /**\n     * Creates an array of elements split into two groups, the first of which\n     * contains elements `predicate` returns truthy for, while the second of which\n     * contains elements `predicate` returns falsey for. The predicate is bound\n     * to `thisArg` and invoked with three arguments: (value, index|key, collection).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the array of grouped elements.\n     * @example\n     *\n     * _.partition([1, 2, 3], function(n) {\n     *   return n % 2;\n     * });\n     * // => [[1, 3], [2]]\n     *\n     * _.partition([1.2, 2.3, 3.4], function(n) {\n     *   return this.floor(n) % 2;\n     * }, Math);\n     * // => [[1.2, 3.4], [2.3]]\n     *\n     * var users = [\n     *   { 'user': 'barney',  'age': 36, 'active': false },\n     *   { 'user': 'fred',    'age': 40, 'active': true },\n     *   { 'user': 'pebbles', 'age': 1,  'active': false }\n     * ];\n     *\n     * var mapper = function(array) {\n     *   return _.pluck(array, 'user');\n     * };\n     *\n     * // using the `_.matches` callback shorthand\n     * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);\n     * // => [['pebbles'], ['barney', 'fred']]\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.map(_.partition(users, 'active', false), mapper);\n     * // => [['barney', 'pebbles'], ['fred']]\n     *\n     * // using the `_.property` callback shorthand\n     * _.map(_.partition(users, 'active'), mapper);\n     * // => [['fred'], ['barney', 'pebbles']]\n     */\n    var partition = createAggregator(function(result, value, key) {\n      result[key ? 0 : 1].push(value);\n    }, function() { return [[], []]; });\n\n    /**\n     * Gets the property value of `path` from all elements in `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Array|string} path The path of the property to pluck.\n     * @returns {Array} Returns the property values.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 40 }\n     * ];\n     *\n     * _.pluck(users, 'user');\n     * // => ['barney', 'fred']\n     *\n     * var userIndex = _.indexBy(users, 'user');\n     * _.pluck(userIndex, 'age');\n     * // => [36, 40] (iteration order is not guaranteed)\n     */\n    function pluck(collection, path) {\n      return map(collection, property(path));\n    }\n\n    /**\n     * Reduces `collection` to a value which is the accumulated result of running\n     * each element in `collection` through `iteratee`, where each successive\n     * invocation is supplied the return value of the previous. If `accumulator`\n     * is not provided the first element of `collection` is used as the initial\n     * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:\n     * (accumulator, value, index|key, collection).\n     *\n     * Many lodash methods are guarded to work as iteratees for methods like\n     * `_.reduce`, `_.reduceRight`, and `_.transform`.\n     *\n     * The guarded methods are:\n     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,\n     * and `sortByOrder`\n     *\n     * @static\n     * @memberOf _\n     * @alias foldl, inject\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [accumulator] The initial value.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * _.reduce([1, 2], function(total, n) {\n     *   return total + n;\n     * });\n     * // => 3\n     *\n     * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {\n     *   result[key] = n * 3;\n     *   return result;\n     * }, {});\n     * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)\n     */\n    var reduce = createReduce(arrayReduce, baseEach);\n\n    /**\n     * This method is like `_.reduce` except that it iterates over elements of\n     * `collection` from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @alias foldr\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [accumulator] The initial value.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * var array = [[0, 1], [2, 3], [4, 5]];\n     *\n     * _.reduceRight(array, function(flattened, other) {\n     *   return flattened.concat(other);\n     * }, []);\n     * // => [4, 5, 2, 3, 0, 1]\n     */\n    var reduceRight = createReduce(arrayReduceRight, baseEachRight);\n\n    /**\n     * The opposite of `_.filter`; this method returns the elements of `collection`\n     * that `predicate` does **not** return truthy for.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Array} Returns the new filtered array.\n     * @example\n     *\n     * _.reject([1, 2, 3, 4], function(n) {\n     *   return n % 2 == 0;\n     * });\n     * // => [1, 3]\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36, 'active': false },\n     *   { 'user': 'fred',   'age': 40, 'active': true }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');\n     * // => ['barney']\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.pluck(_.reject(users, 'active', false), 'user');\n     * // => ['fred']\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.reject(users, 'active'), 'user');\n     * // => ['barney']\n     */\n    function reject(collection, predicate, thisArg) {\n      var func = isArray(collection) ? arrayFilter : baseFilter;\n      predicate = getCallback(predicate, thisArg, 3);\n      return func(collection, function(value, index, collection) {\n        return !predicate(value, index, collection);\n      });\n    }\n\n    /**\n     * Gets a random element or `n` random elements from a collection.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to sample.\n     * @param {number} [n] The number of elements to sample.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {*} Returns the random sample(s).\n     * @example\n     *\n     * _.sample([1, 2, 3, 4]);\n     * // => 2\n     *\n     * _.sample([1, 2, 3, 4], 2);\n     * // => [3, 1]\n     */\n    function sample(collection, n, guard) {\n      if (guard ? isIterateeCall(collection, n, guard) : n == null) {\n        collection = toIterable(collection);\n        var length = collection.length;\n        return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;\n      }\n      var index = -1,\n          result = toArray(collection),\n          length = result.length,\n          lastIndex = length - 1;\n\n      n = nativeMin(n < 0 ? 0 : (+n || 0), length);\n      while (++index < n) {\n        var rand = baseRandom(index, lastIndex),\n            value = result[rand];\n\n        result[rand] = result[index];\n        result[index] = value;\n      }\n      result.length = n;\n      return result;\n    }\n\n    /**\n     * Creates an array of shuffled values, using a version of the\n     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to shuffle.\n     * @returns {Array} Returns the new shuffled array.\n     * @example\n     *\n     * _.shuffle([1, 2, 3, 4]);\n     * // => [4, 1, 3, 2]\n     */\n    function shuffle(collection) {\n      return sample(collection, POSITIVE_INFINITY);\n    }\n\n    /**\n     * Gets the size of `collection` by returning its length for array-like\n     * values or the number of own enumerable properties for objects.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to inspect.\n     * @returns {number} Returns the size of `collection`.\n     * @example\n     *\n     * _.size([1, 2, 3]);\n     * // => 3\n     *\n     * _.size({ 'a': 1, 'b': 2 });\n     * // => 2\n     *\n     * _.size('pebbles');\n     * // => 7\n     */\n    function size(collection) {\n      var length = collection ? getLength(collection) : 0;\n      return isLength(length) ? length : keys(collection).length;\n    }\n\n    /**\n     * Checks if `predicate` returns truthy for **any** element of `collection`.\n     * The function returns as soon as it finds a passing value and does not iterate\n     * over the entire collection. The predicate is bound to `thisArg` and invoked\n     * with three arguments: (value, index|key, collection).\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias any\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {boolean} Returns `true` if any element passes the predicate check,\n     *  else `false`.\n     * @example\n     *\n     * _.some([null, 0, 'yes', false], Boolean);\n     * // => true\n     *\n     * var users = [\n     *   { 'user': 'barney', 'active': true },\n     *   { 'user': 'fred',   'active': false }\n     * ];\n     *\n     * // using the `_.matches` callback shorthand\n     * _.some(users, { 'user': 'barney', 'active': false });\n     * // => false\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.some(users, 'active', false);\n     * // => true\n     *\n     * // using the `_.property` callback shorthand\n     * _.some(users, 'active');\n     * // => true\n     */\n    function some(collection, predicate, thisArg) {\n      var func = isArray(collection) ? arraySome : baseSome;\n      if (thisArg && isIterateeCall(collection, predicate, thisArg)) {\n        predicate = undefined;\n      }\n      if (typeof predicate != 'function' || thisArg !== undefined) {\n        predicate = getCallback(predicate, thisArg, 3);\n      }\n      return func(collection, predicate);\n    }\n\n    /**\n     * Creates an array of elements, sorted in ascending order by the results of\n     * running each element in a collection through `iteratee`. This method performs\n     * a stable sort, that is, it preserves the original sort order of equal elements.\n     * The `iteratee` is bound to `thisArg` and invoked with three arguments:\n     * (value, index|key, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the new sorted array.\n     * @example\n     *\n     * _.sortBy([1, 2, 3], function(n) {\n     *   return Math.sin(n);\n     * });\n     * // => [3, 1, 2]\n     *\n     * _.sortBy([1, 2, 3], function(n) {\n     *   return this.sin(n);\n     * }, Math);\n     * // => [3, 1, 2]\n     *\n     * var users = [\n     *   { 'user': 'fred' },\n     *   { 'user': 'pebbles' },\n     *   { 'user': 'barney' }\n     * ];\n     *\n     * // using the `_.property` callback shorthand\n     * _.pluck(_.sortBy(users, 'user'), 'user');\n     * // => ['barney', 'fred', 'pebbles']\n     */\n    function sortBy(collection, iteratee, thisArg) {\n      if (collection == null) {\n        return [];\n      }\n      if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n        iteratee = undefined;\n      }\n      var index = -1;\n      iteratee = getCallback(iteratee, thisArg, 3);\n\n      var result = baseMap(collection, function(value, key, collection) {\n        return { 'criteria': iteratee(value, key, collection), 'index': ++index, 'value': value };\n      });\n      return baseSortBy(result, compareAscending);\n    }\n\n    /**\n     * This method is like `_.sortBy` except that it can sort by multiple iteratees\n     * or property names.\n     *\n     * If a property name is provided for an iteratee the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If an object is provided for an iteratee the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees\n     *  The iteratees to sort by, specified as individual values or arrays of values.\n     * @returns {Array} Returns the new sorted array.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'fred',   'age': 48 },\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 42 },\n     *   { 'user': 'barney', 'age': 34 }\n     * ];\n     *\n     * _.map(_.sortByAll(users, ['user', 'age']), _.values);\n     * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]\n     *\n     * _.map(_.sortByAll(users, 'user', function(chr) {\n     *   return Math.floor(chr.age / 10);\n     * }), _.values);\n     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n     */\n    var sortByAll = restParam(function(collection, iteratees) {\n      if (collection == null) {\n        return [];\n      }\n      var guard = iteratees[2];\n      if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {\n        iteratees.length = 1;\n      }\n      return baseSortByOrder(collection, baseFlatten(iteratees), []);\n    });\n\n    /**\n     * This method is like `_.sortByAll` except that it allows specifying the\n     * sort orders of the iteratees to sort by. If `orders` is unspecified, all\n     * values are sorted in ascending order. Otherwise, a value is sorted in\n     * ascending order if its corresponding order is \"asc\", and descending if \"desc\".\n     *\n     * If a property name is provided for an iteratee the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If an object is provided for an iteratee the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n     * @param {boolean[]} [orders] The sort orders of `iteratees`.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.\n     * @returns {Array} Returns the new sorted array.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'fred',   'age': 48 },\n     *   { 'user': 'barney', 'age': 34 },\n     *   { 'user': 'fred',   'age': 42 },\n     *   { 'user': 'barney', 'age': 36 }\n     * ];\n     *\n     * // sort by `user` in ascending order and by `age` in descending order\n     * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);\n     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n     */\n    function sortByOrder(collection, iteratees, orders, guard) {\n      if (collection == null) {\n        return [];\n      }\n      if (guard && isIterateeCall(iteratees, orders, guard)) {\n        orders = undefined;\n      }\n      if (!isArray(iteratees)) {\n        iteratees = iteratees == null ? [] : [iteratees];\n      }\n      if (!isArray(orders)) {\n        orders = orders == null ? [] : [orders];\n      }\n      return baseSortByOrder(collection, iteratees, orders);\n    }\n\n    /**\n     * Performs a deep comparison between each element in `collection` and the\n     * source object, returning an array of all elements that have equivalent\n     * property values.\n     *\n     * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n     * numbers, `Object` objects, regexes, and strings. Objects are compared by\n     * their own, not inherited, enumerable properties. For comparing a single\n     * own or inherited property value see `_.matchesProperty`.\n     *\n     * @static\n     * @memberOf _\n     * @category Collection\n     * @param {Array|Object|string} collection The collection to search.\n     * @param {Object} source The object of property values to match.\n     * @returns {Array} Returns the new filtered array.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },\n     *   { 'user': 'fred',   'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }\n     * ];\n     *\n     * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');\n     * // => ['barney']\n     *\n     * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');\n     * // => ['fred']\n     */\n    function where(collection, source) {\n      return filter(collection, baseMatches(source));\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Gets the number of milliseconds that have elapsed since the Unix epoch\n     * (1 January 1970 00:00:00 UTC).\n     *\n     * @static\n     * @memberOf _\n     * @category Date\n     * @example\n     *\n     * _.defer(function(stamp) {\n     *   console.log(_.now() - stamp);\n     * }, _.now());\n     * // => logs the number of milliseconds it took for the deferred function to be invoked\n     */\n    var now = nativeNow || function() {\n      return new Date().getTime();\n    };\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * The opposite of `_.before`; this method creates a function that invokes\n     * `func` once it is called `n` or more times.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {number} n The number of calls before `func` is invoked.\n     * @param {Function} func The function to restrict.\n     * @returns {Function} Returns the new restricted function.\n     * @example\n     *\n     * var saves = ['profile', 'settings'];\n     *\n     * var done = _.after(saves.length, function() {\n     *   console.log('done saving!');\n     * });\n     *\n     * _.forEach(saves, function(type) {\n     *   asyncSave({ 'type': type, 'complete': done });\n     * });\n     * // => logs 'done saving!' after the two async saves have completed\n     */\n    function after(n, func) {\n      if (typeof func != 'function') {\n        if (typeof n == 'function') {\n          var temp = n;\n          n = func;\n          func = temp;\n        } else {\n          throw new TypeError(FUNC_ERROR_TEXT);\n        }\n      }\n      n = nativeIsFinite(n = +n) ? n : 0;\n      return function() {\n        if (--n < 1) {\n          return func.apply(this, arguments);\n        }\n      };\n    }\n\n    /**\n     * Creates a function that accepts up to `n` arguments ignoring any\n     * additional arguments.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to cap arguments for.\n     * @param {number} [n=func.length] The arity cap.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n     * // => [6, 8, 10]\n     */\n    function ary(func, n, guard) {\n      if (guard && isIterateeCall(func, n, guard)) {\n        n = undefined;\n      }\n      n = (func && n == null) ? func.length : nativeMax(+n || 0, 0);\n      return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);\n    }\n\n    /**\n     * Creates a function that invokes `func`, with the `this` binding and arguments\n     * of the created function, while it is called less than `n` times. Subsequent\n     * calls to the created function return the result of the last `func` invocation.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {number} n The number of calls at which `func` is no longer invoked.\n     * @param {Function} func The function to restrict.\n     * @returns {Function} Returns the new restricted function.\n     * @example\n     *\n     * jQuery('#add').on('click', _.before(5, addContactToList));\n     * // => allows adding up to 4 contacts to the list\n     */\n    function before(n, func) {\n      var result;\n      if (typeof func != 'function') {\n        if (typeof n == 'function') {\n          var temp = n;\n          n = func;\n          func = temp;\n        } else {\n          throw new TypeError(FUNC_ERROR_TEXT);\n        }\n      }\n      return function() {\n        if (--n > 0) {\n          result = func.apply(this, arguments);\n        }\n        if (n <= 1) {\n          func = undefined;\n        }\n        return result;\n      };\n    }\n\n    /**\n     * Creates a function that invokes `func` with the `this` binding of `thisArg`\n     * and prepends any additional `_.bind` arguments to those provided to the\n     * bound function.\n     *\n     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n     * may be used as a placeholder for partially applied arguments.\n     *\n     * **Note:** Unlike native `Function#bind` this method does not set the \"length\"\n     * property of bound functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to bind.\n     * @param {*} thisArg The `this` binding of `func`.\n     * @param {...*} [partials] The arguments to be partially applied.\n     * @returns {Function} Returns the new bound function.\n     * @example\n     *\n     * var greet = function(greeting, punctuation) {\n     *   return greeting + ' ' + this.user + punctuation;\n     * };\n     *\n     * var object = { 'user': 'fred' };\n     *\n     * var bound = _.bind(greet, object, 'hi');\n     * bound('!');\n     * // => 'hi fred!'\n     *\n     * // using placeholders\n     * var bound = _.bind(greet, object, _, '!');\n     * bound('hi');\n     * // => 'hi fred!'\n     */\n    var bind = restParam(function(func, thisArg, partials) {\n      var bitmask = BIND_FLAG;\n      if (partials.length) {\n        var holders = replaceHolders(partials, bind.placeholder);\n        bitmask |= PARTIAL_FLAG;\n      }\n      return createWrapper(func, bitmask, thisArg, partials, holders);\n    });\n\n    /**\n     * Binds methods of an object to the object itself, overwriting the existing\n     * method. Method names may be specified as individual arguments or as arrays\n     * of method names. If no method names are provided all enumerable function\n     * properties, own and inherited, of `object` are bound.\n     *\n     * **Note:** This method does not set the \"length\" property of bound functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Object} object The object to bind and assign the bound methods to.\n     * @param {...(string|string[])} [methodNames] The object method names to bind,\n     *  specified as individual method names or arrays of method names.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * var view = {\n     *   'label': 'docs',\n     *   'onClick': function() {\n     *     console.log('clicked ' + this.label);\n     *   }\n     * };\n     *\n     * _.bindAll(view);\n     * jQuery('#docs').on('click', view.onClick);\n     * // => logs 'clicked docs' when the element is clicked\n     */\n    var bindAll = restParam(function(object, methodNames) {\n      methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);\n\n      var index = -1,\n          length = methodNames.length;\n\n      while (++index < length) {\n        var key = methodNames[index];\n        object[key] = createWrapper(object[key], BIND_FLAG, object);\n      }\n      return object;\n    });\n\n    /**\n     * Creates a function that invokes the method at `object[key]` and prepends\n     * any additional `_.bindKey` arguments to those provided to the bound function.\n     *\n     * This method differs from `_.bind` by allowing bound functions to reference\n     * methods that may be redefined or don't yet exist.\n     * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n     * for more details.\n     *\n     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n     * builds, may be used as a placeholder for partially applied arguments.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Object} object The object the method belongs to.\n     * @param {string} key The key of the method.\n     * @param {...*} [partials] The arguments to be partially applied.\n     * @returns {Function} Returns the new bound function.\n     * @example\n     *\n     * var object = {\n     *   'user': 'fred',\n     *   'greet': function(greeting, punctuation) {\n     *     return greeting + ' ' + this.user + punctuation;\n     *   }\n     * };\n     *\n     * var bound = _.bindKey(object, 'greet', 'hi');\n     * bound('!');\n     * // => 'hi fred!'\n     *\n     * object.greet = function(greeting, punctuation) {\n     *   return greeting + 'ya ' + this.user + punctuation;\n     * };\n     *\n     * bound('!');\n     * // => 'hiya fred!'\n     *\n     * // using placeholders\n     * var bound = _.bindKey(object, 'greet', _, '!');\n     * bound('hi');\n     * // => 'hiya fred!'\n     */\n    var bindKey = restParam(function(object, key, partials) {\n      var bitmask = BIND_FLAG | BIND_KEY_FLAG;\n      if (partials.length) {\n        var holders = replaceHolders(partials, bindKey.placeholder);\n        bitmask |= PARTIAL_FLAG;\n      }\n      return createWrapper(key, bitmask, object, partials, holders);\n    });\n\n    /**\n     * Creates a function that accepts one or more arguments of `func` that when\n     * called either invokes `func` returning its result, if all `func` arguments\n     * have been provided, or returns a function that accepts one or more of the\n     * remaining `func` arguments, and so on. The arity of `func` may be specified\n     * if `func.length` is not sufficient.\n     *\n     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n     * may be used as a placeholder for provided arguments.\n     *\n     * **Note:** This method does not set the \"length\" property of curried functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to curry.\n     * @param {number} [arity=func.length] The arity of `func`.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Function} Returns the new curried function.\n     * @example\n     *\n     * var abc = function(a, b, c) {\n     *   return [a, b, c];\n     * };\n     *\n     * var curried = _.curry(abc);\n     *\n     * curried(1)(2)(3);\n     * // => [1, 2, 3]\n     *\n     * curried(1, 2)(3);\n     * // => [1, 2, 3]\n     *\n     * curried(1, 2, 3);\n     * // => [1, 2, 3]\n     *\n     * // using placeholders\n     * curried(1)(_, 3)(2);\n     * // => [1, 2, 3]\n     */\n    var curry = createCurry(CURRY_FLAG);\n\n    /**\n     * This method is like `_.curry` except that arguments are applied to `func`\n     * in the manner of `_.partialRight` instead of `_.partial`.\n     *\n     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n     * builds, may be used as a placeholder for provided arguments.\n     *\n     * **Note:** This method does not set the \"length\" property of curried functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to curry.\n     * @param {number} [arity=func.length] The arity of `func`.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Function} Returns the new curried function.\n     * @example\n     *\n     * var abc = function(a, b, c) {\n     *   return [a, b, c];\n     * };\n     *\n     * var curried = _.curryRight(abc);\n     *\n     * curried(3)(2)(1);\n     * // => [1, 2, 3]\n     *\n     * curried(2, 3)(1);\n     * // => [1, 2, 3]\n     *\n     * curried(1, 2, 3);\n     * // => [1, 2, 3]\n     *\n     * // using placeholders\n     * curried(3)(1, _)(2);\n     * // => [1, 2, 3]\n     */\n    var curryRight = createCurry(CURRY_RIGHT_FLAG);\n\n    /**\n     * Creates a debounced function that delays invoking `func` until after `wait`\n     * milliseconds have elapsed since the last time the debounced function was\n     * invoked. The debounced function comes with a `cancel` method to cancel\n     * delayed invocations. Provide an options object to indicate that `func`\n     * should be invoked on the leading and/or trailing edge of the `wait` timeout.\n     * Subsequent calls to the debounced function return the result of the last\n     * `func` invocation.\n     *\n     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n     * on the trailing edge of the timeout only if the the debounced function is\n     * invoked more than once during the `wait` timeout.\n     *\n     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n     * for details over the differences between `_.debounce` and `_.throttle`.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to debounce.\n     * @param {number} [wait=0] The number of milliseconds to delay.\n     * @param {Object} [options] The options object.\n     * @param {boolean} [options.leading=false] Specify invoking on the leading\n     *  edge of the timeout.\n     * @param {number} [options.maxWait] The maximum time `func` is allowed to be\n     *  delayed before it is invoked.\n     * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n     *  edge of the timeout.\n     * @returns {Function} Returns the new debounced function.\n     * @example\n     *\n     * // avoid costly calculations while the window size is in flux\n     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n     *\n     * // invoke `sendMail` when the click event is fired, debouncing subsequent calls\n     * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {\n     *   'leading': true,\n     *   'trailing': false\n     * }));\n     *\n     * // ensure `batchLog` is invoked once after 1 second of debounced calls\n     * var source = new EventSource('/stream');\n     * jQuery(source).on('message', _.debounce(batchLog, 250, {\n     *   'maxWait': 1000\n     * }));\n     *\n     * // cancel a debounced call\n     * var todoChanges = _.debounce(batchLog, 1000);\n     * Object.observe(models.todo, todoChanges);\n     *\n     * Object.observe(models, function(changes) {\n     *   if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {\n     *     todoChanges.cancel();\n     *   }\n     * }, ['delete']);\n     *\n     * // ...at some point `models.todo` is changed\n     * models.todo.completed = true;\n     *\n     * // ...before 1 second has passed `models.todo` is deleted\n     * // which cancels the debounced `todoChanges` call\n     * delete models.todo;\n     */\n    function debounce(func, wait, options) {\n      var args,\n          maxTimeoutId,\n          result,\n          stamp,\n          thisArg,\n          timeoutId,\n          trailingCall,\n          lastCalled = 0,\n          maxWait = false,\n          trailing = true;\n\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      wait = wait < 0 ? 0 : (+wait || 0);\n      if (options === true) {\n        var leading = true;\n        trailing = false;\n      } else if (isObject(options)) {\n        leading = !!options.leading;\n        maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);\n        trailing = 'trailing' in options ? !!options.trailing : trailing;\n      }\n\n      function cancel() {\n        if (timeoutId) {\n          clearTimeout(timeoutId);\n        }\n        if (maxTimeoutId) {\n          clearTimeout(maxTimeoutId);\n        }\n        lastCalled = 0;\n        maxTimeoutId = timeoutId = trailingCall = undefined;\n      }\n\n      function complete(isCalled, id) {\n        if (id) {\n          clearTimeout(id);\n        }\n        maxTimeoutId = timeoutId = trailingCall = undefined;\n        if (isCalled) {\n          lastCalled = now();\n          result = func.apply(thisArg, args);\n          if (!timeoutId && !maxTimeoutId) {\n            args = thisArg = undefined;\n          }\n        }\n      }\n\n      function delayed() {\n        var remaining = wait - (now() - stamp);\n        if (remaining <= 0 || remaining > wait) {\n          complete(trailingCall, maxTimeoutId);\n        } else {\n          timeoutId = setTimeout(delayed, remaining);\n        }\n      }\n\n      function maxDelayed() {\n        complete(trailing, timeoutId);\n      }\n\n      function debounced() {\n        args = arguments;\n        stamp = now();\n        thisArg = this;\n        trailingCall = trailing && (timeoutId || !leading);\n\n        if (maxWait === false) {\n          var leadingCall = leading && !timeoutId;\n        } else {\n          if (!maxTimeoutId && !leading) {\n            lastCalled = stamp;\n          }\n          var remaining = maxWait - (stamp - lastCalled),\n              isCalled = remaining <= 0 || remaining > maxWait;\n\n          if (isCalled) {\n            if (maxTimeoutId) {\n              maxTimeoutId = clearTimeout(maxTimeoutId);\n            }\n            lastCalled = stamp;\n            result = func.apply(thisArg, args);\n          }\n          else if (!maxTimeoutId) {\n            maxTimeoutId = setTimeout(maxDelayed, remaining);\n          }\n        }\n        if (isCalled && timeoutId) {\n          timeoutId = clearTimeout(timeoutId);\n        }\n        else if (!timeoutId && wait !== maxWait) {\n          timeoutId = setTimeout(delayed, wait);\n        }\n        if (leadingCall) {\n          isCalled = true;\n          result = func.apply(thisArg, args);\n        }\n        if (isCalled && !timeoutId && !maxTimeoutId) {\n          args = thisArg = undefined;\n        }\n        return result;\n      }\n      debounced.cancel = cancel;\n      return debounced;\n    }\n\n    /**\n     * Defers invoking the `func` until the current call stack has cleared. Any\n     * additional arguments are provided to `func` when it is invoked.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to defer.\n     * @param {...*} [args] The arguments to invoke the function with.\n     * @returns {number} Returns the timer id.\n     * @example\n     *\n     * _.defer(function(text) {\n     *   console.log(text);\n     * }, 'deferred');\n     * // logs 'deferred' after one or more milliseconds\n     */\n    var defer = restParam(function(func, args) {\n      return baseDelay(func, 1, args);\n    });\n\n    /**\n     * Invokes `func` after `wait` milliseconds. Any additional arguments are\n     * provided to `func` when it is invoked.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to delay.\n     * @param {number} wait The number of milliseconds to delay invocation.\n     * @param {...*} [args] The arguments to invoke the function with.\n     * @returns {number} Returns the timer id.\n     * @example\n     *\n     * _.delay(function(text) {\n     *   console.log(text);\n     * }, 1000, 'later');\n     * // => logs 'later' after one second\n     */\n    var delay = restParam(function(func, wait, args) {\n      return baseDelay(func, wait, args);\n    });\n\n    /**\n     * Creates a function that returns the result of invoking the provided\n     * functions with the `this` binding of the created function, where each\n     * successive invocation is supplied the return value of the previous.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {...Function} [funcs] Functions to invoke.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * function square(n) {\n     *   return n * n;\n     * }\n     *\n     * var addSquare = _.flow(_.add, square);\n     * addSquare(1, 2);\n     * // => 9\n     */\n    var flow = createFlow();\n\n    /**\n     * This method is like `_.flow` except that it creates a function that\n     * invokes the provided functions from right to left.\n     *\n     * @static\n     * @memberOf _\n     * @alias backflow, compose\n     * @category Function\n     * @param {...Function} [funcs] Functions to invoke.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * function square(n) {\n     *   return n * n;\n     * }\n     *\n     * var addSquare = _.flowRight(square, _.add);\n     * addSquare(1, 2);\n     * // => 9\n     */\n    var flowRight = createFlow(true);\n\n    /**\n     * Creates a function that memoizes the result of `func`. If `resolver` is\n     * provided it determines the cache key for storing the result based on the\n     * arguments provided to the memoized function. By default, the first argument\n     * provided to the memoized function is coerced to a string and used as the\n     * cache key. The `func` is invoked with the `this` binding of the memoized\n     * function.\n     *\n     * **Note:** The cache is exposed as the `cache` property on the memoized\n     * function. Its creation may be customized by replacing the `_.memoize.Cache`\n     * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)\n     * method interface of `get`, `has`, and `set`.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to have its output memoized.\n     * @param {Function} [resolver] The function to resolve the cache key.\n     * @returns {Function} Returns the new memoizing function.\n     * @example\n     *\n     * var upperCase = _.memoize(function(string) {\n     *   return string.toUpperCase();\n     * });\n     *\n     * upperCase('fred');\n     * // => 'FRED'\n     *\n     * // modifying the result cache\n     * upperCase.cache.set('fred', 'BARNEY');\n     * upperCase('fred');\n     * // => 'BARNEY'\n     *\n     * // replacing `_.memoize.Cache`\n     * var object = { 'user': 'fred' };\n     * var other = { 'user': 'barney' };\n     * var identity = _.memoize(_.identity);\n     *\n     * identity(object);\n     * // => { 'user': 'fred' }\n     * identity(other);\n     * // => { 'user': 'fred' }\n     *\n     * _.memoize.Cache = WeakMap;\n     * var identity = _.memoize(_.identity);\n     *\n     * identity(object);\n     * // => { 'user': 'fred' }\n     * identity(other);\n     * // => { 'user': 'barney' }\n     */\n    function memoize(func, resolver) {\n      if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      var memoized = function() {\n        var args = arguments,\n            key = resolver ? resolver.apply(this, args) : args[0],\n            cache = memoized.cache;\n\n        if (cache.has(key)) {\n          return cache.get(key);\n        }\n        var result = func.apply(this, args);\n        memoized.cache = cache.set(key, result);\n        return result;\n      };\n      memoized.cache = new memoize.Cache;\n      return memoized;\n    }\n\n    /**\n     * Creates a function that runs each argument through a corresponding\n     * transform function.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to wrap.\n     * @param {...(Function|Function[])} [transforms] The functions to transform\n     * arguments, specified as individual functions or arrays of functions.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * function doubled(n) {\n     *   return n * 2;\n     * }\n     *\n     * function square(n) {\n     *   return n * n;\n     * }\n     *\n     * var modded = _.modArgs(function(x, y) {\n     *   return [x, y];\n     * }, square, doubled);\n     *\n     * modded(1, 2);\n     * // => [1, 4]\n     *\n     * modded(5, 10);\n     * // => [25, 20]\n     */\n    var modArgs = restParam(function(func, transforms) {\n      transforms = baseFlatten(transforms);\n      if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      var length = transforms.length;\n      return restParam(function(args) {\n        var index = nativeMin(args.length, length);\n        while (index--) {\n          args[index] = transforms[index](args[index]);\n        }\n        return func.apply(this, args);\n      });\n    });\n\n    /**\n     * Creates a function that negates the result of the predicate `func`. The\n     * `func` predicate is invoked with the `this` binding and arguments of the\n     * created function.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} predicate The predicate to negate.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * function isEven(n) {\n     *   return n % 2 == 0;\n     * }\n     *\n     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n     * // => [1, 3, 5]\n     */\n    function negate(predicate) {\n      if (typeof predicate != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      return function() {\n        return !predicate.apply(this, arguments);\n      };\n    }\n\n    /**\n     * Creates a function that is restricted to invoking `func` once. Repeat calls\n     * to the function return the value of the first call. The `func` is invoked\n     * with the `this` binding and arguments of the created function.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to restrict.\n     * @returns {Function} Returns the new restricted function.\n     * @example\n     *\n     * var initialize = _.once(createApplication);\n     * initialize();\n     * initialize();\n     * // `initialize` invokes `createApplication` once\n     */\n    function once(func) {\n      return before(2, func);\n    }\n\n    /**\n     * Creates a function that invokes `func` with `partial` arguments prepended\n     * to those provided to the new function. This method is like `_.bind` except\n     * it does **not** alter the `this` binding.\n     *\n     * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n     * builds, may be used as a placeholder for partially applied arguments.\n     *\n     * **Note:** This method does not set the \"length\" property of partially\n     * applied functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to partially apply arguments to.\n     * @param {...*} [partials] The arguments to be partially applied.\n     * @returns {Function} Returns the new partially applied function.\n     * @example\n     *\n     * var greet = function(greeting, name) {\n     *   return greeting + ' ' + name;\n     * };\n     *\n     * var sayHelloTo = _.partial(greet, 'hello');\n     * sayHelloTo('fred');\n     * // => 'hello fred'\n     *\n     * // using placeholders\n     * var greetFred = _.partial(greet, _, 'fred');\n     * greetFred('hi');\n     * // => 'hi fred'\n     */\n    var partial = createPartial(PARTIAL_FLAG);\n\n    /**\n     * This method is like `_.partial` except that partially applied arguments\n     * are appended to those provided to the new function.\n     *\n     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n     * builds, may be used as a placeholder for partially applied arguments.\n     *\n     * **Note:** This method does not set the \"length\" property of partially\n     * applied functions.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to partially apply arguments to.\n     * @param {...*} [partials] The arguments to be partially applied.\n     * @returns {Function} Returns the new partially applied function.\n     * @example\n     *\n     * var greet = function(greeting, name) {\n     *   return greeting + ' ' + name;\n     * };\n     *\n     * var greetFred = _.partialRight(greet, 'fred');\n     * greetFred('hi');\n     * // => 'hi fred'\n     *\n     * // using placeholders\n     * var sayHelloTo = _.partialRight(greet, 'hello', _);\n     * sayHelloTo('fred');\n     * // => 'hello fred'\n     */\n    var partialRight = createPartial(PARTIAL_RIGHT_FLAG);\n\n    /**\n     * Creates a function that invokes `func` with arguments arranged according\n     * to the specified indexes where the argument value at the first index is\n     * provided as the first argument, the argument value at the second index is\n     * provided as the second argument, and so on.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to rearrange arguments for.\n     * @param {...(number|number[])} indexes The arranged argument indexes,\n     *  specified as individual indexes or arrays of indexes.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var rearged = _.rearg(function(a, b, c) {\n     *   return [a, b, c];\n     * }, 2, 0, 1);\n     *\n     * rearged('b', 'c', 'a')\n     * // => ['a', 'b', 'c']\n     *\n     * var map = _.rearg(_.map, [1, 0]);\n     * map(function(n) {\n     *   return n * 3;\n     * }, [1, 2, 3]);\n     * // => [3, 6, 9]\n     */\n    var rearg = restParam(function(func, indexes) {\n      return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));\n    });\n\n    /**\n     * Creates a function that invokes `func` with the `this` binding of the\n     * created function and arguments from `start` and beyond provided as an array.\n     *\n     * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters).\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to apply a rest parameter to.\n     * @param {number} [start=func.length-1] The start position of the rest parameter.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var say = _.restParam(function(what, names) {\n     *   return what + ' ' + _.initial(names).join(', ') +\n     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n     * });\n     *\n     * say('hello', 'fred', 'barney', 'pebbles');\n     * // => 'hello fred, barney, & pebbles'\n     */\n    function restParam(func, start) {\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0);\n      return function() {\n        var args = arguments,\n            index = -1,\n            length = nativeMax(args.length - start, 0),\n            rest = Array(length);\n\n        while (++index < length) {\n          rest[index] = args[start + index];\n        }\n        switch (start) {\n          case 0: return func.call(this, rest);\n          case 1: return func.call(this, args[0], rest);\n          case 2: return func.call(this, args[0], args[1], rest);\n        }\n        var otherArgs = Array(start + 1);\n        index = -1;\n        while (++index < start) {\n          otherArgs[index] = args[index];\n        }\n        otherArgs[start] = rest;\n        return func.apply(this, otherArgs);\n      };\n    }\n\n    /**\n     * Creates a function that invokes `func` with the `this` binding of the created\n     * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).\n     *\n     * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator).\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to spread arguments over.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var say = _.spread(function(who, what) {\n     *   return who + ' says ' + what;\n     * });\n     *\n     * say(['fred', 'hello']);\n     * // => 'fred says hello'\n     *\n     * // with a Promise\n     * var numbers = Promise.all([\n     *   Promise.resolve(40),\n     *   Promise.resolve(36)\n     * ]);\n     *\n     * numbers.then(_.spread(function(x, y) {\n     *   return x + y;\n     * }));\n     * // => a Promise of 76\n     */\n    function spread(func) {\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      return function(array) {\n        return func.apply(this, array);\n      };\n    }\n\n    /**\n     * Creates a throttled function that only invokes `func` at most once per\n     * every `wait` milliseconds. The throttled function comes with a `cancel`\n     * method to cancel delayed invocations. Provide an options object to indicate\n     * that `func` should be invoked on the leading and/or trailing edge of the\n     * `wait` timeout. Subsequent calls to the throttled function return the\n     * result of the last `func` call.\n     *\n     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked\n     * on the trailing edge of the timeout only if the the throttled function is\n     * invoked more than once during the `wait` timeout.\n     *\n     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)\n     * for details over the differences between `_.throttle` and `_.debounce`.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {Function} func The function to throttle.\n     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n     * @param {Object} [options] The options object.\n     * @param {boolean} [options.leading=true] Specify invoking on the leading\n     *  edge of the timeout.\n     * @param {boolean} [options.trailing=true] Specify invoking on the trailing\n     *  edge of the timeout.\n     * @returns {Function} Returns the new throttled function.\n     * @example\n     *\n     * // avoid excessively updating the position while scrolling\n     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n     *\n     * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\n     * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {\n     *   'trailing': false\n     * }));\n     *\n     * // cancel a trailing throttled call\n     * jQuery(window).on('popstate', throttled.cancel);\n     */\n    function throttle(func, wait, options) {\n      var leading = true,\n          trailing = true;\n\n      if (typeof func != 'function') {\n        throw new TypeError(FUNC_ERROR_TEXT);\n      }\n      if (options === false) {\n        leading = false;\n      } else if (isObject(options)) {\n        leading = 'leading' in options ? !!options.leading : leading;\n        trailing = 'trailing' in options ? !!options.trailing : trailing;\n      }\n      return debounce(func, wait, { 'leading': leading, 'maxWait': +wait, 'trailing': trailing });\n    }\n\n    /**\n     * Creates a function that provides `value` to the wrapper function as its\n     * first argument. Any additional arguments provided to the function are\n     * appended to those provided to the wrapper function. The wrapper is invoked\n     * with the `this` binding of the created function.\n     *\n     * @static\n     * @memberOf _\n     * @category Function\n     * @param {*} value The value to wrap.\n     * @param {Function} wrapper The wrapper function.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var p = _.wrap(_.escape, function(func, text) {\n     *   return '<p>' + func(text) + '</p>';\n     * });\n     *\n     * p('fred, barney, & pebbles');\n     * // => '<p>fred, barney, &amp; pebbles</p>'\n     */\n    function wrap(value, wrapper) {\n      wrapper = wrapper == null ? identity : wrapper;\n      return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,\n     * otherwise they are assigned by reference. If `customizer` is provided it is\n     * invoked to produce the cloned values. If `customizer` returns `undefined`\n     * cloning is handled by the method instead. The `customizer` is bound to\n     * `thisArg` and invoked with two argument; (value [, index|key, object]).\n     *\n     * **Note:** This method is loosely based on the\n     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).\n     * The enumerable properties of `arguments` objects and objects created by\n     * constructors other than `Object` are cloned to plain `Object` objects. An\n     * empty object is returned for uncloneable values such as functions, DOM nodes,\n     * Maps, Sets, and WeakMaps.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to clone.\n     * @param {boolean} [isDeep] Specify a deep clone.\n     * @param {Function} [customizer] The function to customize cloning values.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {*} Returns the cloned value.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney' },\n     *   { 'user': 'fred' }\n     * ];\n     *\n     * var shallow = _.clone(users);\n     * shallow[0] === users[0];\n     * // => true\n     *\n     * var deep = _.clone(users, true);\n     * deep[0] === users[0];\n     * // => false\n     *\n     * // using a customizer callback\n     * var el = _.clone(document.body, function(value) {\n     *   if (_.isElement(value)) {\n     *     return value.cloneNode(false);\n     *   }\n     * });\n     *\n     * el === document.body\n     * // => false\n     * el.nodeName\n     * // => BODY\n     * el.childNodes.length;\n     * // => 0\n     */\n    function clone(value, isDeep, customizer, thisArg) {\n      if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {\n        isDeep = false;\n      }\n      else if (typeof isDeep == 'function') {\n        thisArg = customizer;\n        customizer = isDeep;\n        isDeep = false;\n      }\n      return typeof customizer == 'function'\n        ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 1))\n        : baseClone(value, isDeep);\n    }\n\n    /**\n     * Creates a deep clone of `value`. If `customizer` is provided it is invoked\n     * to produce the cloned values. If `customizer` returns `undefined` cloning\n     * is handled by the method instead. The `customizer` is bound to `thisArg`\n     * and invoked with two argument; (value [, index|key, object]).\n     *\n     * **Note:** This method is loosely based on the\n     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).\n     * The enumerable properties of `arguments` objects and objects created by\n     * constructors other than `Object` are cloned to plain `Object` objects. An\n     * empty object is returned for uncloneable values such as functions, DOM nodes,\n     * Maps, Sets, and WeakMaps.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to deep clone.\n     * @param {Function} [customizer] The function to customize cloning values.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {*} Returns the deep cloned value.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney' },\n     *   { 'user': 'fred' }\n     * ];\n     *\n     * var deep = _.cloneDeep(users);\n     * deep[0] === users[0];\n     * // => false\n     *\n     * // using a customizer callback\n     * var el = _.cloneDeep(document.body, function(value) {\n     *   if (_.isElement(value)) {\n     *     return value.cloneNode(true);\n     *   }\n     * });\n     *\n     * el === document.body\n     * // => false\n     * el.nodeName\n     * // => BODY\n     * el.childNodes.length;\n     * // => 20\n     */\n    function cloneDeep(value, customizer, thisArg) {\n      return typeof customizer == 'function'\n        ? baseClone(value, true, bindCallback(customizer, thisArg, 1))\n        : baseClone(value, true);\n    }\n\n    /**\n     * Checks if `value` is greater than `other`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.\n     * @example\n     *\n     * _.gt(3, 1);\n     * // => true\n     *\n     * _.gt(3, 3);\n     * // => false\n     *\n     * _.gt(1, 3);\n     * // => false\n     */\n    function gt(value, other) {\n      return value > other;\n    }\n\n    /**\n     * Checks if `value` is greater than or equal to `other`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.\n     * @example\n     *\n     * _.gte(3, 1);\n     * // => true\n     *\n     * _.gte(3, 3);\n     * // => true\n     *\n     * _.gte(1, 3);\n     * // => false\n     */\n    function gte(value, other) {\n      return value >= other;\n    }\n\n    /**\n     * Checks if `value` is classified as an `arguments` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isArguments(function() { return arguments; }());\n     * // => true\n     *\n     * _.isArguments([1, 2, 3]);\n     * // => false\n     */\n    function isArguments(value) {\n      return isObjectLike(value) && isArrayLike(value) &&\n        hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');\n    }\n\n    /**\n     * Checks if `value` is classified as an `Array` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isArray([1, 2, 3]);\n     * // => true\n     *\n     * _.isArray(function() { return arguments; }());\n     * // => false\n     */\n    var isArray = nativeIsArray || function(value) {\n      return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;\n    };\n\n    /**\n     * Checks if `value` is classified as a boolean primitive or object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isBoolean(false);\n     * // => true\n     *\n     * _.isBoolean(null);\n     * // => false\n     */\n    function isBoolean(value) {\n      return value === true || value === false || (isObjectLike(value) && objToString.call(value) == boolTag);\n    }\n\n    /**\n     * Checks if `value` is classified as a `Date` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isDate(new Date);\n     * // => true\n     *\n     * _.isDate('Mon April 23 2012');\n     * // => false\n     */\n    function isDate(value) {\n      return isObjectLike(value) && objToString.call(value) == dateTag;\n    }\n\n    /**\n     * Checks if `value` is a DOM element.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n     * @example\n     *\n     * _.isElement(document.body);\n     * // => true\n     *\n     * _.isElement('<body>');\n     * // => false\n     */\n    function isElement(value) {\n      return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);\n    }\n\n    /**\n     * Checks if `value` is empty. A value is considered empty unless it is an\n     * `arguments` object, array, string, or jQuery-like collection with a length\n     * greater than `0` or an object with own enumerable properties.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {Array|Object|string} value The value to inspect.\n     * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n     * @example\n     *\n     * _.isEmpty(null);\n     * // => true\n     *\n     * _.isEmpty(true);\n     * // => true\n     *\n     * _.isEmpty(1);\n     * // => true\n     *\n     * _.isEmpty([1, 2, 3]);\n     * // => false\n     *\n     * _.isEmpty({ 'a': 1 });\n     * // => false\n     */\n    function isEmpty(value) {\n      if (value == null) {\n        return true;\n      }\n      if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) ||\n          (isObjectLike(value) && isFunction(value.splice)))) {\n        return !value.length;\n      }\n      return !keys(value).length;\n    }\n\n    /**\n     * Performs a deep comparison between two values to determine if they are\n     * equivalent. If `customizer` is provided it is invoked to compare values.\n     * If `customizer` returns `undefined` comparisons are handled by the method\n     * instead. The `customizer` is bound to `thisArg` and invoked with three\n     * arguments: (value, other [, index|key]).\n     *\n     * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n     * numbers, `Object` objects, regexes, and strings. Objects are compared by\n     * their own, not inherited, enumerable properties. Functions and DOM nodes\n     * are **not** supported. Provide a customizer function to extend support\n     * for comparing other values.\n     *\n     * @static\n     * @memberOf _\n     * @alias eq\n     * @category Lang\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @param {Function} [customizer] The function to customize value comparisons.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n     * @example\n     *\n     * var object = { 'user': 'fred' };\n     * var other = { 'user': 'fred' };\n     *\n     * object == other;\n     * // => false\n     *\n     * _.isEqual(object, other);\n     * // => true\n     *\n     * // using a customizer callback\n     * var array = ['hello', 'goodbye'];\n     * var other = ['hi', 'goodbye'];\n     *\n     * _.isEqual(array, other, function(value, other) {\n     *   if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {\n     *     return true;\n     *   }\n     * });\n     * // => true\n     */\n    function isEqual(value, other, customizer, thisArg) {\n      customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;\n      var result = customizer ? customizer(value, other) : undefined;\n      return  result === undefined ? baseIsEqual(value, other, customizer) : !!result;\n    }\n\n    /**\n     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n     * `SyntaxError`, `TypeError`, or `URIError` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n     * @example\n     *\n     * _.isError(new Error);\n     * // => true\n     *\n     * _.isError(Error);\n     * // => false\n     */\n    function isError(value) {\n      return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;\n    }\n\n    /**\n     * Checks if `value` is a finite primitive number.\n     *\n     * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n     * @example\n     *\n     * _.isFinite(10);\n     * // => true\n     *\n     * _.isFinite('10');\n     * // => false\n     *\n     * _.isFinite(true);\n     * // => false\n     *\n     * _.isFinite(Object(10));\n     * // => false\n     *\n     * _.isFinite(Infinity);\n     * // => false\n     */\n    function isFinite(value) {\n      return typeof value == 'number' && nativeIsFinite(value);\n    }\n\n    /**\n     * Checks if `value` is classified as a `Function` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isFunction(_);\n     * // => true\n     *\n     * _.isFunction(/abc/);\n     * // => false\n     */\n    function isFunction(value) {\n      // The use of `Object#toString` avoids issues with the `typeof` operator\n      // in older versions of Chrome and Safari which return 'function' for regexes\n      // and Safari 8 equivalents which return 'object' for typed array constructors.\n      return isObject(value) && objToString.call(value) == funcTag;\n    }\n\n    /**\n     * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n     * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n     * @example\n     *\n     * _.isObject({});\n     * // => true\n     *\n     * _.isObject([1, 2, 3]);\n     * // => true\n     *\n     * _.isObject(1);\n     * // => false\n     */\n    function isObject(value) {\n      // Avoid a V8 JIT bug in Chrome 19-20.\n      // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n      var type = typeof value;\n      return !!value && (type == 'object' || type == 'function');\n    }\n\n    /**\n     * Performs a deep comparison between `object` and `source` to determine if\n     * `object` contains equivalent property values. If `customizer` is provided\n     * it is invoked to compare values. If `customizer` returns `undefined`\n     * comparisons are handled by the method instead. The `customizer` is bound\n     * to `thisArg` and invoked with three arguments: (value, other, index|key).\n     *\n     * **Note:** This method supports comparing properties of arrays, booleans,\n     * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions\n     * and DOM nodes are **not** supported. Provide a customizer function to extend\n     * support for comparing other values.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {Object} object The object to inspect.\n     * @param {Object} source The object of property values to match.\n     * @param {Function} [customizer] The function to customize value comparisons.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n     * @example\n     *\n     * var object = { 'user': 'fred', 'age': 40 };\n     *\n     * _.isMatch(object, { 'age': 40 });\n     * // => true\n     *\n     * _.isMatch(object, { 'age': 36 });\n     * // => false\n     *\n     * // using a customizer callback\n     * var object = { 'greeting': 'hello' };\n     * var source = { 'greeting': 'hi' };\n     *\n     * _.isMatch(object, source, function(value, other) {\n     *   return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;\n     * });\n     * // => true\n     */\n    function isMatch(object, source, customizer, thisArg) {\n      customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;\n      return baseIsMatch(object, getMatchData(source), customizer);\n    }\n\n    /**\n     * Checks if `value` is `NaN`.\n     *\n     * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)\n     * which returns `true` for `undefined` and other non-numeric values.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n     * @example\n     *\n     * _.isNaN(NaN);\n     * // => true\n     *\n     * _.isNaN(new Number(NaN));\n     * // => true\n     *\n     * isNaN(undefined);\n     * // => true\n     *\n     * _.isNaN(undefined);\n     * // => false\n     */\n    function isNaN(value) {\n      // An `NaN` primitive is the only value that is not equal to itself.\n      // Perform the `toStringTag` check first to avoid errors with some host objects in IE.\n      return isNumber(value) && value != +value;\n    }\n\n    /**\n     * Checks if `value` is a native function.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a native function, else `false`.\n     * @example\n     *\n     * _.isNative(Array.prototype.push);\n     * // => true\n     *\n     * _.isNative(_);\n     * // => false\n     */\n    function isNative(value) {\n      if (value == null) {\n        return false;\n      }\n      if (isFunction(value)) {\n        return reIsNative.test(fnToString.call(value));\n      }\n      return isObjectLike(value) && reIsHostCtor.test(value);\n    }\n\n    /**\n     * Checks if `value` is `null`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n     * @example\n     *\n     * _.isNull(null);\n     * // => true\n     *\n     * _.isNull(void 0);\n     * // => false\n     */\n    function isNull(value) {\n      return value === null;\n    }\n\n    /**\n     * Checks if `value` is classified as a `Number` primitive or object.\n     *\n     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified\n     * as numbers, use the `_.isFinite` method.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isNumber(8.4);\n     * // => true\n     *\n     * _.isNumber(NaN);\n     * // => true\n     *\n     * _.isNumber('8.4');\n     * // => false\n     */\n    function isNumber(value) {\n      return typeof value == 'number' || (isObjectLike(value) && objToString.call(value) == numberTag);\n    }\n\n    /**\n     * Checks if `value` is a plain object, that is, an object created by the\n     * `Object` constructor or one with a `[[Prototype]]` of `null`.\n     *\n     * **Note:** This method assumes objects created by the `Object` constructor\n     * have no inherited enumerable properties.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     * }\n     *\n     * _.isPlainObject(new Foo);\n     * // => false\n     *\n     * _.isPlainObject([1, 2, 3]);\n     * // => false\n     *\n     * _.isPlainObject({ 'x': 0, 'y': 0 });\n     * // => true\n     *\n     * _.isPlainObject(Object.create(null));\n     * // => true\n     */\n    function isPlainObject(value) {\n      var Ctor;\n\n      // Exit early for non `Object` objects.\n      if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) ||\n          (!hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor)))) {\n        return false;\n      }\n      // IE < 9 iterates inherited properties before own properties. If the first\n      // iterated property is an object's own property then there are no inherited\n      // enumerable properties.\n      var result;\n      // In most environments an object's own properties are iterated before\n      // its inherited properties. If the last iterated property is an object's\n      // own property then there are no inherited enumerable properties.\n      baseForIn(value, function(subValue, key) {\n        result = key;\n      });\n      return result === undefined || hasOwnProperty.call(value, result);\n    }\n\n    /**\n     * Checks if `value` is classified as a `RegExp` object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isRegExp(/abc/);\n     * // => true\n     *\n     * _.isRegExp('/abc/');\n     * // => false\n     */\n    function isRegExp(value) {\n      return isObject(value) && objToString.call(value) == regexpTag;\n    }\n\n    /**\n     * Checks if `value` is classified as a `String` primitive or object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isString('abc');\n     * // => true\n     *\n     * _.isString(1);\n     * // => false\n     */\n    function isString(value) {\n      return typeof value == 'string' || (isObjectLike(value) && objToString.call(value) == stringTag);\n    }\n\n    /**\n     * Checks if `value` is classified as a typed array.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.\n     * @example\n     *\n     * _.isTypedArray(new Uint8Array);\n     * // => true\n     *\n     * _.isTypedArray([]);\n     * // => false\n     */\n    function isTypedArray(value) {\n      return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];\n    }\n\n    /**\n     * Checks if `value` is `undefined`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to check.\n     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n     * @example\n     *\n     * _.isUndefined(void 0);\n     * // => true\n     *\n     * _.isUndefined(null);\n     * // => false\n     */\n    function isUndefined(value) {\n      return value === undefined;\n    }\n\n    /**\n     * Checks if `value` is less than `other`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.\n     * @example\n     *\n     * _.lt(1, 3);\n     * // => true\n     *\n     * _.lt(3, 3);\n     * // => false\n     *\n     * _.lt(3, 1);\n     * // => false\n     */\n    function lt(value, other) {\n      return value < other;\n    }\n\n    /**\n     * Checks if `value` is less than or equal to `other`.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to compare.\n     * @param {*} other The other value to compare.\n     * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.\n     * @example\n     *\n     * _.lte(1, 3);\n     * // => true\n     *\n     * _.lte(3, 3);\n     * // => true\n     *\n     * _.lte(3, 1);\n     * // => false\n     */\n    function lte(value, other) {\n      return value <= other;\n    }\n\n    /**\n     * Converts `value` to an array.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to convert.\n     * @returns {Array} Returns the converted array.\n     * @example\n     *\n     * (function() {\n     *   return _.toArray(arguments).slice(1);\n     * }(1, 2, 3));\n     * // => [2, 3]\n     */\n    function toArray(value) {\n      var length = value ? getLength(value) : 0;\n      if (!isLength(length)) {\n        return values(value);\n      }\n      if (!length) {\n        return [];\n      }\n      return arrayCopy(value);\n    }\n\n    /**\n     * Converts `value` to a plain object flattening inherited enumerable\n     * properties of `value` to own properties of the plain object.\n     *\n     * @static\n     * @memberOf _\n     * @category Lang\n     * @param {*} value The value to convert.\n     * @returns {Object} Returns the converted plain object.\n     * @example\n     *\n     * function Foo() {\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.assign({ 'a': 1 }, new Foo);\n     * // => { 'a': 1, 'b': 2 }\n     *\n     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n     * // => { 'a': 1, 'b': 2, 'c': 3 }\n     */\n    function toPlainObject(value) {\n      return baseCopy(value, keysIn(value));\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Recursively merges own enumerable properties of the source object(s), that\n     * don't resolve to `undefined` into the destination object. Subsequent sources\n     * overwrite property assignments of previous sources. If `customizer` is\n     * provided it is invoked to produce the merged values of the destination and\n     * source properties. If `customizer` returns `undefined` merging is handled\n     * by the method instead. The `customizer` is bound to `thisArg` and invoked\n     * with five arguments: (objectValue, sourceValue, key, object, source).\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The destination object.\n     * @param {...Object} [sources] The source objects.\n     * @param {Function} [customizer] The function to customize assigned values.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * var users = {\n     *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n     * };\n     *\n     * var ages = {\n     *   'data': [{ 'age': 36 }, { 'age': 40 }]\n     * };\n     *\n     * _.merge(users, ages);\n     * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n     *\n     * // using a customizer callback\n     * var object = {\n     *   'fruits': ['apple'],\n     *   'vegetables': ['beet']\n     * };\n     *\n     * var other = {\n     *   'fruits': ['banana'],\n     *   'vegetables': ['carrot']\n     * };\n     *\n     * _.merge(object, other, function(a, b) {\n     *   if (_.isArray(a)) {\n     *     return a.concat(b);\n     *   }\n     * });\n     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n     */\n    var merge = createAssigner(baseMerge);\n\n    /**\n     * Assigns own enumerable properties of source object(s) to the destination\n     * object. Subsequent sources overwrite property assignments of previous sources.\n     * If `customizer` is provided it is invoked to produce the assigned values.\n     * The `customizer` is bound to `thisArg` and invoked with five arguments:\n     * (objectValue, sourceValue, key, object, source).\n     *\n     * **Note:** This method mutates `object` and is based on\n     * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).\n     *\n     * @static\n     * @memberOf _\n     * @alias extend\n     * @category Object\n     * @param {Object} object The destination object.\n     * @param {...Object} [sources] The source objects.\n     * @param {Function} [customizer] The function to customize assigned values.\n     * @param {*} [thisArg] The `this` binding of `customizer`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });\n     * // => { 'user': 'fred', 'age': 40 }\n     *\n     * // using a customizer callback\n     * var defaults = _.partialRight(_.assign, function(value, other) {\n     *   return _.isUndefined(value) ? other : value;\n     * });\n     *\n     * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n     * // => { 'user': 'barney', 'age': 36 }\n     */\n    var assign = createAssigner(function(object, source, customizer) {\n      return customizer\n        ? assignWith(object, source, customizer)\n        : baseAssign(object, source);\n    });\n\n    /**\n     * Creates an object that inherits from the given `prototype` object. If a\n     * `properties` object is provided its own enumerable properties are assigned\n     * to the created object.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} prototype The object to inherit from.\n     * @param {Object} [properties] The properties to assign to the object.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Object} Returns the new object.\n     * @example\n     *\n     * function Shape() {\n     *   this.x = 0;\n     *   this.y = 0;\n     * }\n     *\n     * function Circle() {\n     *   Shape.call(this);\n     * }\n     *\n     * Circle.prototype = _.create(Shape.prototype, {\n     *   'constructor': Circle\n     * });\n     *\n     * var circle = new Circle;\n     * circle instanceof Circle;\n     * // => true\n     *\n     * circle instanceof Shape;\n     * // => true\n     */\n    function create(prototype, properties, guard) {\n      var result = baseCreate(prototype);\n      if (guard && isIterateeCall(prototype, properties, guard)) {\n        properties = undefined;\n      }\n      return properties ? baseAssign(result, properties) : result;\n    }\n\n    /**\n     * Assigns own enumerable properties of source object(s) to the destination\n     * object for all destination properties that resolve to `undefined`. Once a\n     * property is set, additional values of the same property are ignored.\n     *\n     * **Note:** This method mutates `object`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The destination object.\n     * @param {...Object} [sources] The source objects.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n     * // => { 'user': 'barney', 'age': 36 }\n     */\n    var defaults = createDefaults(assign, assignDefaults);\n\n    /**\n     * This method is like `_.defaults` except that it recursively assigns\n     * default properties.\n     *\n     * **Note:** This method mutates `object`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The destination object.\n     * @param {...Object} [sources] The source objects.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });\n     * // => { 'user': { 'name': 'barney', 'age': 36 } }\n     *\n     */\n    var defaultsDeep = createDefaults(merge, mergeDefaults);\n\n    /**\n     * This method is like `_.find` except that it returns the key of the first\n     * element `predicate` returns truthy for instead of the element itself.\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.\n     * @example\n     *\n     * var users = {\n     *   'barney':  { 'age': 36, 'active': true },\n     *   'fred':    { 'age': 40, 'active': false },\n     *   'pebbles': { 'age': 1,  'active': true }\n     * };\n     *\n     * _.findKey(users, function(chr) {\n     *   return chr.age < 40;\n     * });\n     * // => 'barney' (iteration order is not guaranteed)\n     *\n     * // using the `_.matches` callback shorthand\n     * _.findKey(users, { 'age': 1, 'active': true });\n     * // => 'pebbles'\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.findKey(users, 'active', false);\n     * // => 'fred'\n     *\n     * // using the `_.property` callback shorthand\n     * _.findKey(users, 'active');\n     * // => 'barney'\n     */\n    var findKey = createFindKey(baseForOwn);\n\n    /**\n     * This method is like `_.findKey` except that it iterates over elements of\n     * a collection in the opposite order.\n     *\n     * If a property name is provided for `predicate` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `predicate` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to search.\n     * @param {Function|Object|string} [predicate=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.\n     * @example\n     *\n     * var users = {\n     *   'barney':  { 'age': 36, 'active': true },\n     *   'fred':    { 'age': 40, 'active': false },\n     *   'pebbles': { 'age': 1,  'active': true }\n     * };\n     *\n     * _.findLastKey(users, function(chr) {\n     *   return chr.age < 40;\n     * });\n     * // => returns `pebbles` assuming `_.findKey` returns `barney`\n     *\n     * // using the `_.matches` callback shorthand\n     * _.findLastKey(users, { 'age': 36, 'active': true });\n     * // => 'barney'\n     *\n     * // using the `_.matchesProperty` callback shorthand\n     * _.findLastKey(users, 'active', false);\n     * // => 'fred'\n     *\n     * // using the `_.property` callback shorthand\n     * _.findLastKey(users, 'active');\n     * // => 'pebbles'\n     */\n    var findLastKey = createFindKey(baseForOwnRight);\n\n    /**\n     * Iterates over own and inherited enumerable properties of an object invoking\n     * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked\n     * with three arguments: (value, key, object). Iteratee functions may exit\n     * iteration early by explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.forIn(new Foo, function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)\n     */\n    var forIn = createForIn(baseFor);\n\n    /**\n     * This method is like `_.forIn` except that it iterates over properties of\n     * `object` in the opposite order.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.forInRight(new Foo, function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'\n     */\n    var forInRight = createForIn(baseForRight);\n\n    /**\n     * Iterates over own enumerable properties of an object invoking `iteratee`\n     * for each property. The `iteratee` is bound to `thisArg` and invoked with\n     * three arguments: (value, key, object). Iteratee functions may exit iteration\n     * early by explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.forOwn(new Foo, function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'a' and 'b' (iteration order is not guaranteed)\n     */\n    var forOwn = createForOwn(baseForOwn);\n\n    /**\n     * This method is like `_.forOwn` except that it iterates over properties of\n     * `object` in the opposite order.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.forOwnRight(new Foo, function(value, key) {\n     *   console.log(key);\n     * });\n     * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'\n     */\n    var forOwnRight = createForOwn(baseForOwnRight);\n\n    /**\n     * Creates an array of function property names from all enumerable properties,\n     * own and inherited, of `object`.\n     *\n     * @static\n     * @memberOf _\n     * @alias methods\n     * @category Object\n     * @param {Object} object The object to inspect.\n     * @returns {Array} Returns the new array of property names.\n     * @example\n     *\n     * _.functions(_);\n     * // => ['after', 'ary', 'assign', ...]\n     */\n    function functions(object) {\n      return baseFunctions(object, keysIn(object));\n    }\n\n    /**\n     * Gets the property value at `path` of `object`. If the resolved value is\n     * `undefined` the `defaultValue` is used in its place.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @param {Array|string} path The path of the property to get.\n     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n     * @returns {*} Returns the resolved value.\n     * @example\n     *\n     * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n     *\n     * _.get(object, 'a[0].b.c');\n     * // => 3\n     *\n     * _.get(object, ['a', '0', 'b', 'c']);\n     * // => 3\n     *\n     * _.get(object, 'a.b.c', 'default');\n     * // => 'default'\n     */\n    function get(object, path, defaultValue) {\n      var result = object == null ? undefined : baseGet(object, toPath(path), path + '');\n      return result === undefined ? defaultValue : result;\n    }\n\n    /**\n     * Checks if `path` is a direct property.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @param {Array|string} path The path to check.\n     * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.\n     * @example\n     *\n     * var object = { 'a': { 'b': { 'c': 3 } } };\n     *\n     * _.has(object, 'a');\n     * // => true\n     *\n     * _.has(object, 'a.b.c');\n     * // => true\n     *\n     * _.has(object, ['a', 'b', 'c']);\n     * // => true\n     */\n    function has(object, path) {\n      if (object == null) {\n        return false;\n      }\n      var result = hasOwnProperty.call(object, path);\n      if (!result && !isKey(path)) {\n        path = toPath(path);\n        object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n        if (object == null) {\n          return false;\n        }\n        path = last(path);\n        result = hasOwnProperty.call(object, path);\n      }\n      return result || (isLength(object.length) && isIndex(path, object.length) &&\n        (isArray(object) || isArguments(object)));\n    }\n\n    /**\n     * Creates an object composed of the inverted keys and values of `object`.\n     * If `object` contains duplicate values, subsequent values overwrite property\n     * assignments of previous values unless `multiValue` is `true`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to invert.\n     * @param {boolean} [multiValue] Allow multiple values per key.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Object} Returns the new inverted object.\n     * @example\n     *\n     * var object = { 'a': 1, 'b': 2, 'c': 1 };\n     *\n     * _.invert(object);\n     * // => { '1': 'c', '2': 'b' }\n     *\n     * // with `multiValue`\n     * _.invert(object, true);\n     * // => { '1': ['a', 'c'], '2': ['b'] }\n     */\n    function invert(object, multiValue, guard) {\n      if (guard && isIterateeCall(object, multiValue, guard)) {\n        multiValue = undefined;\n      }\n      var index = -1,\n          props = keys(object),\n          length = props.length,\n          result = {};\n\n      while (++index < length) {\n        var key = props[index],\n            value = object[key];\n\n        if (multiValue) {\n          if (hasOwnProperty.call(result, value)) {\n            result[value].push(key);\n          } else {\n            result[value] = [key];\n          }\n        }\n        else {\n          result[value] = key;\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Creates an array of the own enumerable property names of `object`.\n     *\n     * **Note:** Non-object values are coerced to objects. See the\n     * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)\n     * for more details.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property names.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.keys(new Foo);\n     * // => ['a', 'b'] (iteration order is not guaranteed)\n     *\n     * _.keys('hi');\n     * // => ['0', '1']\n     */\n    var keys = !nativeKeys ? shimKeys : function(object) {\n      var Ctor = object == null ? undefined : object.constructor;\n      if ((typeof Ctor == 'function' && Ctor.prototype === object) ||\n          (typeof object != 'function' && isArrayLike(object))) {\n        return shimKeys(object);\n      }\n      return isObject(object) ? nativeKeys(object) : [];\n    };\n\n    /**\n     * Creates an array of the own and inherited enumerable property names of `object`.\n     *\n     * **Note:** Non-object values are coerced to objects.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property names.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.keysIn(new Foo);\n     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n     */\n    function keysIn(object) {\n      if (object == null) {\n        return [];\n      }\n      if (!isObject(object)) {\n        object = Object(object);\n      }\n      var length = object.length;\n      length = (length && isLength(length) &&\n        (isArray(object) || isArguments(object)) && length) || 0;\n\n      var Ctor = object.constructor,\n          index = -1,\n          isProto = typeof Ctor == 'function' && Ctor.prototype === object,\n          result = Array(length),\n          skipIndexes = length > 0;\n\n      while (++index < length) {\n        result[index] = (index + '');\n      }\n      for (var key in object) {\n        if (!(skipIndexes && isIndex(key, length)) &&\n            !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n          result.push(key);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * The opposite of `_.mapValues`; this method creates an object with the\n     * same values as `object` and keys generated by running each own enumerable\n     * property of `object` through `iteratee`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns the new mapped object.\n     * @example\n     *\n     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n     *   return key + value;\n     * });\n     * // => { 'a1': 1, 'b2': 2 }\n     */\n    var mapKeys = createObjectMapper(true);\n\n    /**\n     * Creates an object with the same keys as `object` and values generated by\n     * running each own enumerable property of `object` through `iteratee`. The\n     * iteratee function is bound to `thisArg` and invoked with three arguments:\n     * (value, key, object).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to iterate over.\n     * @param {Function|Object|string} [iteratee=_.identity] The function invoked\n     *  per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Object} Returns the new mapped object.\n     * @example\n     *\n     * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {\n     *   return n * 3;\n     * });\n     * // => { 'a': 3, 'b': 6 }\n     *\n     * var users = {\n     *   'fred':    { 'user': 'fred',    'age': 40 },\n     *   'pebbles': { 'user': 'pebbles', 'age': 1 }\n     * };\n     *\n     * // using the `_.property` callback shorthand\n     * _.mapValues(users, 'age');\n     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n     */\n    var mapValues = createObjectMapper();\n\n    /**\n     * The opposite of `_.pick`; this method creates an object composed of the\n     * own and inherited enumerable properties of `object` that are not omitted.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The source object.\n     * @param {Function|...(string|string[])} [predicate] The function invoked per\n     *  iteration or property names to omit, specified as individual property\n     *  names or arrays of property names.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Object} Returns the new object.\n     * @example\n     *\n     * var object = { 'user': 'fred', 'age': 40 };\n     *\n     * _.omit(object, 'age');\n     * // => { 'user': 'fred' }\n     *\n     * _.omit(object, _.isNumber);\n     * // => { 'user': 'fred' }\n     */\n    var omit = restParam(function(object, props) {\n      if (object == null) {\n        return {};\n      }\n      if (typeof props[0] != 'function') {\n        var props = arrayMap(baseFlatten(props), String);\n        return pickByArray(object, baseDifference(keysIn(object), props));\n      }\n      var predicate = bindCallback(props[0], props[1], 3);\n      return pickByCallback(object, function(value, key, object) {\n        return !predicate(value, key, object);\n      });\n    });\n\n    /**\n     * Creates a two dimensional array of the key-value pairs for `object`,\n     * e.g. `[[key1, value1], [key2, value2]]`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the new array of key-value pairs.\n     * @example\n     *\n     * _.pairs({ 'barney': 36, 'fred': 40 });\n     * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)\n     */\n    function pairs(object) {\n      object = toObject(object);\n\n      var index = -1,\n          props = keys(object),\n          length = props.length,\n          result = Array(length);\n\n      while (++index < length) {\n        var key = props[index];\n        result[index] = [key, object[key]];\n      }\n      return result;\n    }\n\n    /**\n     * Creates an object composed of the picked `object` properties. Property\n     * names may be specified as individual arguments or as arrays of property\n     * names. If `predicate` is provided it is invoked for each property of `object`\n     * picking the properties `predicate` returns truthy for. The predicate is\n     * bound to `thisArg` and invoked with three arguments: (value, key, object).\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The source object.\n     * @param {Function|...(string|string[])} [predicate] The function invoked per\n     *  iteration or property names to pick, specified as individual property\n     *  names or arrays of property names.\n     * @param {*} [thisArg] The `this` binding of `predicate`.\n     * @returns {Object} Returns the new object.\n     * @example\n     *\n     * var object = { 'user': 'fred', 'age': 40 };\n     *\n     * _.pick(object, 'user');\n     * // => { 'user': 'fred' }\n     *\n     * _.pick(object, _.isString);\n     * // => { 'user': 'fred' }\n     */\n    var pick = restParam(function(object, props) {\n      if (object == null) {\n        return {};\n      }\n      return typeof props[0] == 'function'\n        ? pickByCallback(object, bindCallback(props[0], props[1], 3))\n        : pickByArray(object, baseFlatten(props));\n    });\n\n    /**\n     * This method is like `_.get` except that if the resolved value is a function\n     * it is invoked with the `this` binding of its parent object and its result\n     * is returned.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @param {Array|string} path The path of the property to resolve.\n     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.\n     * @returns {*} Returns the resolved value.\n     * @example\n     *\n     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n     *\n     * _.result(object, 'a[0].b.c1');\n     * // => 3\n     *\n     * _.result(object, 'a[0].b.c2');\n     * // => 4\n     *\n     * _.result(object, 'a.b.c', 'default');\n     * // => 'default'\n     *\n     * _.result(object, 'a.b.c', _.constant('default'));\n     * // => 'default'\n     */\n    function result(object, path, defaultValue) {\n      var result = object == null ? undefined : object[path];\n      if (result === undefined) {\n        if (object != null && !isKey(path, object)) {\n          path = toPath(path);\n          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n          result = object == null ? undefined : object[last(path)];\n        }\n        result = result === undefined ? defaultValue : result;\n      }\n      return isFunction(result) ? result.call(object) : result;\n    }\n\n    /**\n     * Sets the property value of `path` on `object`. If a portion of `path`\n     * does not exist it is created.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to augment.\n     * @param {Array|string} path The path of the property to set.\n     * @param {*} value The value to set.\n     * @returns {Object} Returns `object`.\n     * @example\n     *\n     * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n     *\n     * _.set(object, 'a[0].b.c', 4);\n     * console.log(object.a[0].b.c);\n     * // => 4\n     *\n     * _.set(object, 'x[0].y.z', 5);\n     * console.log(object.x[0].y.z);\n     * // => 5\n     */\n    function set(object, path, value) {\n      if (object == null) {\n        return object;\n      }\n      var pathKey = (path + '');\n      path = (object[pathKey] != null || isKey(path, object)) ? [pathKey] : toPath(path);\n\n      var index = -1,\n          length = path.length,\n          lastIndex = length - 1,\n          nested = object;\n\n      while (nested != null && ++index < length) {\n        var key = path[index];\n        if (isObject(nested)) {\n          if (index == lastIndex) {\n            nested[key] = value;\n          } else if (nested[key] == null) {\n            nested[key] = isIndex(path[index + 1]) ? [] : {};\n          }\n        }\n        nested = nested[key];\n      }\n      return object;\n    }\n\n    /**\n     * An alternative to `_.reduce`; this method transforms `object` to a new\n     * `accumulator` object which is the result of running each of its own enumerable\n     * properties through `iteratee`, with each invocation potentially mutating\n     * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked\n     * with four arguments: (accumulator, value, key, object). Iteratee functions\n     * may exit iteration early by explicitly returning `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Array|Object} object The object to iterate over.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [accumulator] The custom accumulator value.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {*} Returns the accumulated value.\n     * @example\n     *\n     * _.transform([2, 3, 4], function(result, n) {\n     *   result.push(n *= n);\n     *   return n % 2 == 0;\n     * });\n     * // => [4, 9]\n     *\n     * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {\n     *   result[key] = n * 3;\n     * });\n     * // => { 'a': 3, 'b': 6 }\n     */\n    function transform(object, iteratee, accumulator, thisArg) {\n      var isArr = isArray(object) || isTypedArray(object);\n      iteratee = getCallback(iteratee, thisArg, 4);\n\n      if (accumulator == null) {\n        if (isArr || isObject(object)) {\n          var Ctor = object.constructor;\n          if (isArr) {\n            accumulator = isArray(object) ? new Ctor : [];\n          } else {\n            accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);\n          }\n        } else {\n          accumulator = {};\n        }\n      }\n      (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) {\n        return iteratee(accumulator, value, index, object);\n      });\n      return accumulator;\n    }\n\n    /**\n     * Creates an array of the own enumerable property values of `object`.\n     *\n     * **Note:** Non-object values are coerced to objects.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property values.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.values(new Foo);\n     * // => [1, 2] (iteration order is not guaranteed)\n     *\n     * _.values('hi');\n     * // => ['h', 'i']\n     */\n    function values(object) {\n      return baseValues(object, keys(object));\n    }\n\n    /**\n     * Creates an array of the own and inherited enumerable property values\n     * of `object`.\n     *\n     * **Note:** Non-object values are coerced to objects.\n     *\n     * @static\n     * @memberOf _\n     * @category Object\n     * @param {Object} object The object to query.\n     * @returns {Array} Returns the array of property values.\n     * @example\n     *\n     * function Foo() {\n     *   this.a = 1;\n     *   this.b = 2;\n     * }\n     *\n     * Foo.prototype.c = 3;\n     *\n     * _.valuesIn(new Foo);\n     * // => [1, 2, 3] (iteration order is not guaranteed)\n     */\n    function valuesIn(object) {\n      return baseValues(object, keysIn(object));\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Checks if `n` is between `start` and up to but not including, `end`. If\n     * `end` is not specified it is set to `start` with `start` then set to `0`.\n     *\n     * @static\n     * @memberOf _\n     * @category Number\n     * @param {number} n The number to check.\n     * @param {number} [start=0] The start of the range.\n     * @param {number} end The end of the range.\n     * @returns {boolean} Returns `true` if `n` is in the range, else `false`.\n     * @example\n     *\n     * _.inRange(3, 2, 4);\n     * // => true\n     *\n     * _.inRange(4, 8);\n     * // => true\n     *\n     * _.inRange(4, 2);\n     * // => false\n     *\n     * _.inRange(2, 2);\n     * // => false\n     *\n     * _.inRange(1.2, 2);\n     * // => true\n     *\n     * _.inRange(5.2, 4);\n     * // => false\n     */\n    function inRange(value, start, end) {\n      start = +start || 0;\n      if (end === undefined) {\n        end = start;\n        start = 0;\n      } else {\n        end = +end || 0;\n      }\n      return value >= nativeMin(start, end) && value < nativeMax(start, end);\n    }\n\n    /**\n     * Produces a random number between `min` and `max` (inclusive). If only one\n     * argument is provided a number between `0` and the given number is returned.\n     * If `floating` is `true`, or either `min` or `max` are floats, a floating-point\n     * number is returned instead of an integer.\n     *\n     * @static\n     * @memberOf _\n     * @category Number\n     * @param {number} [min=0] The minimum possible value.\n     * @param {number} [max=1] The maximum possible value.\n     * @param {boolean} [floating] Specify returning a floating-point number.\n     * @returns {number} Returns the random number.\n     * @example\n     *\n     * _.random(0, 5);\n     * // => an integer between 0 and 5\n     *\n     * _.random(5);\n     * // => also an integer between 0 and 5\n     *\n     * _.random(5, true);\n     * // => a floating-point number between 0 and 5\n     *\n     * _.random(1.2, 5.2);\n     * // => a floating-point number between 1.2 and 5.2\n     */\n    function random(min, max, floating) {\n      if (floating && isIterateeCall(min, max, floating)) {\n        max = floating = undefined;\n      }\n      var noMin = min == null,\n          noMax = max == null;\n\n      if (floating == null) {\n        if (noMax && typeof min == 'boolean') {\n          floating = min;\n          min = 1;\n        }\n        else if (typeof max == 'boolean') {\n          floating = max;\n          noMax = true;\n        }\n      }\n      if (noMin && noMax) {\n        max = 1;\n        noMax = false;\n      }\n      min = +min || 0;\n      if (noMax) {\n        max = min;\n        min = 0;\n      } else {\n        max = +max || 0;\n      }\n      if (floating || min % 1 || max % 1) {\n        var rand = nativeRandom();\n        return nativeMin(min + (rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1)))), max);\n      }\n      return baseRandom(min, max);\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to convert.\n     * @returns {string} Returns the camel cased string.\n     * @example\n     *\n     * _.camelCase('Foo Bar');\n     * // => 'fooBar'\n     *\n     * _.camelCase('--foo-bar');\n     * // => 'fooBar'\n     *\n     * _.camelCase('__foo_bar__');\n     * // => 'fooBar'\n     */\n    var camelCase = createCompounder(function(result, word, index) {\n      word = word.toLowerCase();\n      return result + (index ? (word.charAt(0).toUpperCase() + word.slice(1)) : word);\n    });\n\n    /**\n     * Capitalizes the first character of `string`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to capitalize.\n     * @returns {string} Returns the capitalized string.\n     * @example\n     *\n     * _.capitalize('fred');\n     * // => 'Fred'\n     */\n    function capitalize(string) {\n      string = baseToString(string);\n      return string && (string.charAt(0).toUpperCase() + string.slice(1));\n    }\n\n    /**\n     * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n     * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to deburr.\n     * @returns {string} Returns the deburred string.\n     * @example\n     *\n     * _.deburr('déjà vu');\n     * // => 'deja vu'\n     */\n    function deburr(string) {\n      string = baseToString(string);\n      return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');\n    }\n\n    /**\n     * Checks if `string` ends with the given target string.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to search.\n     * @param {string} [target] The string to search for.\n     * @param {number} [position=string.length] The position to search from.\n     * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.\n     * @example\n     *\n     * _.endsWith('abc', 'c');\n     * // => true\n     *\n     * _.endsWith('abc', 'b');\n     * // => false\n     *\n     * _.endsWith('abc', 'b', 2);\n     * // => true\n     */\n    function endsWith(string, target, position) {\n      string = baseToString(string);\n      target = (target + '');\n\n      var length = string.length;\n      position = position === undefined\n        ? length\n        : nativeMin(position < 0 ? 0 : (+position || 0), length);\n\n      position -= target.length;\n      return position >= 0 && string.indexOf(target, position) == position;\n    }\n\n    /**\n     * Converts the characters \"&\", \"<\", \">\", '\"', \"'\", and \"\\`\", in `string` to\n     * their corresponding HTML entities.\n     *\n     * **Note:** No other characters are escaped. To escape additional characters\n     * use a third-party library like [_he_](https://mths.be/he).\n     *\n     * Though the \">\" character is escaped for symmetry, characters like\n     * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n     * unless they're part of a tag or unquoted attribute value.\n     * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n     * (under \"semi-related fun fact\") for more details.\n     *\n     * Backticks are escaped because in Internet Explorer < 9, they can break out\n     * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),\n     * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and\n     * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)\n     * for more details.\n     *\n     * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)\n     * to reduce XSS vectors.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to escape.\n     * @returns {string} Returns the escaped string.\n     * @example\n     *\n     * _.escape('fred, barney, & pebbles');\n     * // => 'fred, barney, &amp; pebbles'\n     */\n    function escape(string) {\n      // Reset `lastIndex` because in IE < 9 `String#replace` does not.\n      string = baseToString(string);\n      return (string && reHasUnescapedHtml.test(string))\n        ? string.replace(reUnescapedHtml, escapeHtmlChar)\n        : string;\n    }\n\n    /**\n     * Escapes the `RegExp` special characters \"\\\", \"/\", \"^\", \"$\", \".\", \"|\", \"?\",\n     * \"*\", \"+\", \"(\", \")\", \"[\", \"]\", \"{\" and \"}\" in `string`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to escape.\n     * @returns {string} Returns the escaped string.\n     * @example\n     *\n     * _.escapeRegExp('[lodash](https://lodash.com/)');\n     * // => '\\[lodash\\]\\(https:\\/\\/lodash\\.com\\/\\)'\n     */\n    function escapeRegExp(string) {\n      string = baseToString(string);\n      return (string && reHasRegExpChars.test(string))\n        ? string.replace(reRegExpChars, escapeRegExpChar)\n        : (string || '(?:)');\n    }\n\n    /**\n     * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to convert.\n     * @returns {string} Returns the kebab cased string.\n     * @example\n     *\n     * _.kebabCase('Foo Bar');\n     * // => 'foo-bar'\n     *\n     * _.kebabCase('fooBar');\n     * // => 'foo-bar'\n     *\n     * _.kebabCase('__foo_bar__');\n     * // => 'foo-bar'\n     */\n    var kebabCase = createCompounder(function(result, word, index) {\n      return result + (index ? '-' : '') + word.toLowerCase();\n    });\n\n    /**\n     * Pads `string` on the left and right sides if it's shorter than `length`.\n     * Padding characters are truncated if they can't be evenly divided by `length`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to pad.\n     * @param {number} [length=0] The padding length.\n     * @param {string} [chars=' '] The string used as padding.\n     * @returns {string} Returns the padded string.\n     * @example\n     *\n     * _.pad('abc', 8);\n     * // => '  abc   '\n     *\n     * _.pad('abc', 8, '_-');\n     * // => '_-abc_-_'\n     *\n     * _.pad('abc', 3);\n     * // => 'abc'\n     */\n    function pad(string, length, chars) {\n      string = baseToString(string);\n      length = +length;\n\n      var strLength = string.length;\n      if (strLength >= length || !nativeIsFinite(length)) {\n        return string;\n      }\n      var mid = (length - strLength) / 2,\n          leftLength = nativeFloor(mid),\n          rightLength = nativeCeil(mid);\n\n      chars = createPadding('', rightLength, chars);\n      return chars.slice(0, leftLength) + string + chars;\n    }\n\n    /**\n     * Pads `string` on the left side if it's shorter than `length`. Padding\n     * characters are truncated if they exceed `length`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to pad.\n     * @param {number} [length=0] The padding length.\n     * @param {string} [chars=' '] The string used as padding.\n     * @returns {string} Returns the padded string.\n     * @example\n     *\n     * _.padLeft('abc', 6);\n     * // => '   abc'\n     *\n     * _.padLeft('abc', 6, '_-');\n     * // => '_-_abc'\n     *\n     * _.padLeft('abc', 3);\n     * // => 'abc'\n     */\n    var padLeft = createPadDir();\n\n    /**\n     * Pads `string` on the right side if it's shorter than `length`. Padding\n     * characters are truncated if they exceed `length`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to pad.\n     * @param {number} [length=0] The padding length.\n     * @param {string} [chars=' '] The string used as padding.\n     * @returns {string} Returns the padded string.\n     * @example\n     *\n     * _.padRight('abc', 6);\n     * // => 'abc   '\n     *\n     * _.padRight('abc', 6, '_-');\n     * // => 'abc_-_'\n     *\n     * _.padRight('abc', 3);\n     * // => 'abc'\n     */\n    var padRight = createPadDir(true);\n\n    /**\n     * Converts `string` to an integer of the specified radix. If `radix` is\n     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,\n     * in which case a `radix` of `16` is used.\n     *\n     * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)\n     * of `parseInt`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} string The string to convert.\n     * @param {number} [radix] The radix to interpret `value` by.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {number} Returns the converted integer.\n     * @example\n     *\n     * _.parseInt('08');\n     * // => 8\n     *\n     * _.map(['6', '08', '10'], _.parseInt);\n     * // => [6, 8, 10]\n     */\n    function parseInt(string, radix, guard) {\n      // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.\n      // Chrome fails to trim leading <BOM> whitespace characters.\n      // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.\n      if (guard ? isIterateeCall(string, radix, guard) : radix == null) {\n        radix = 0;\n      } else if (radix) {\n        radix = +radix;\n      }\n      string = trim(string);\n      return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));\n    }\n\n    /**\n     * Repeats the given string `n` times.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to repeat.\n     * @param {number} [n=0] The number of times to repeat the string.\n     * @returns {string} Returns the repeated string.\n     * @example\n     *\n     * _.repeat('*', 3);\n     * // => '***'\n     *\n     * _.repeat('abc', 2);\n     * // => 'abcabc'\n     *\n     * _.repeat('abc', 0);\n     * // => ''\n     */\n    function repeat(string, n) {\n      var result = '';\n      string = baseToString(string);\n      n = +n;\n      if (n < 1 || !string || !nativeIsFinite(n)) {\n        return result;\n      }\n      // Leverage the exponentiation by squaring algorithm for a faster repeat.\n      // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n      do {\n        if (n % 2) {\n          result += string;\n        }\n        n = nativeFloor(n / 2);\n        string += string;\n      } while (n);\n\n      return result;\n    }\n\n    /**\n     * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to convert.\n     * @returns {string} Returns the snake cased string.\n     * @example\n     *\n     * _.snakeCase('Foo Bar');\n     * // => 'foo_bar'\n     *\n     * _.snakeCase('fooBar');\n     * // => 'foo_bar'\n     *\n     * _.snakeCase('--foo-bar');\n     * // => 'foo_bar'\n     */\n    var snakeCase = createCompounder(function(result, word, index) {\n      return result + (index ? '_' : '') + word.toLowerCase();\n    });\n\n    /**\n     * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to convert.\n     * @returns {string} Returns the start cased string.\n     * @example\n     *\n     * _.startCase('--foo-bar');\n     * // => 'Foo Bar'\n     *\n     * _.startCase('fooBar');\n     * // => 'Foo Bar'\n     *\n     * _.startCase('__foo_bar__');\n     * // => 'Foo Bar'\n     */\n    var startCase = createCompounder(function(result, word, index) {\n      return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));\n    });\n\n    /**\n     * Checks if `string` starts with the given target string.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to search.\n     * @param {string} [target] The string to search for.\n     * @param {number} [position=0] The position to search from.\n     * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.\n     * @example\n     *\n     * _.startsWith('abc', 'a');\n     * // => true\n     *\n     * _.startsWith('abc', 'b');\n     * // => false\n     *\n     * _.startsWith('abc', 'b', 1);\n     * // => true\n     */\n    function startsWith(string, target, position) {\n      string = baseToString(string);\n      position = position == null\n        ? 0\n        : nativeMin(position < 0 ? 0 : (+position || 0), string.length);\n\n      return string.lastIndexOf(target, position) == position;\n    }\n\n    /**\n     * Creates a compiled template function that can interpolate data properties\n     * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n     * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n     * properties may be accessed as free variables in the template. If a setting\n     * object is provided it takes precedence over `_.templateSettings` values.\n     *\n     * **Note:** In the development build `_.template` utilizes\n     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n     * for easier debugging.\n     *\n     * For more information on precompiling templates see\n     * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n     *\n     * For more information on Chrome extension sandboxes see\n     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The template string.\n     * @param {Object} [options] The options object.\n     * @param {RegExp} [options.escape] The HTML \"escape\" delimiter.\n     * @param {RegExp} [options.evaluate] The \"evaluate\" delimiter.\n     * @param {Object} [options.imports] An object to import into the template as free variables.\n     * @param {RegExp} [options.interpolate] The \"interpolate\" delimiter.\n     * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.\n     * @param {string} [options.variable] The data object variable name.\n     * @param- {Object} [otherOptions] Enables the legacy `options` param signature.\n     * @returns {Function} Returns the compiled template function.\n     * @example\n     *\n     * // using the \"interpolate\" delimiter to create a compiled template\n     * var compiled = _.template('hello <%= user %>!');\n     * compiled({ 'user': 'fred' });\n     * // => 'hello fred!'\n     *\n     * // using the HTML \"escape\" delimiter to escape data property values\n     * var compiled = _.template('<b><%- value %></b>');\n     * compiled({ 'value': '<script>' });\n     * // => '<b>&lt;script&gt;</b>'\n     *\n     * // using the \"evaluate\" delimiter to execute JavaScript and generate HTML\n     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\n     * compiled({ 'users': ['fred', 'barney'] });\n     * // => '<li>fred</li><li>barney</li>'\n     *\n     * // using the internal `print` function in \"evaluate\" delimiters\n     * var compiled = _.template('<% print(\"hello \" + user); %>!');\n     * compiled({ 'user': 'barney' });\n     * // => 'hello barney!'\n     *\n     * // using the ES delimiter as an alternative to the default \"interpolate\" delimiter\n     * var compiled = _.template('hello ${ user }!');\n     * compiled({ 'user': 'pebbles' });\n     * // => 'hello pebbles!'\n     *\n     * // using custom template delimiters\n     * _.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\n     * var compiled = _.template('hello {{ user }}!');\n     * compiled({ 'user': 'mustache' });\n     * // => 'hello mustache!'\n     *\n     * // using backslashes to treat delimiters as plain text\n     * var compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\n     * compiled({ 'value': 'ignored' });\n     * // => '<%- value %>'\n     *\n     * // using the `imports` option to import `jQuery` as `jq`\n     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\n     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });\n     * compiled({ 'users': ['fred', 'barney'] });\n     * // => '<li>fred</li><li>barney</li>'\n     *\n     * // using the `sourceURL` option to specify a custom sourceURL for the template\n     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\n     * compiled(data);\n     * // => find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector\n     *\n     * // using the `variable` option to ensure a with-statement isn't used in the compiled template\n     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\n     * compiled.source;\n     * // => function(data) {\n     * //   var __t, __p = '';\n     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n     * //   return __p;\n     * // }\n     *\n     * // using the `source` property to inline compiled templates for meaningful\n     * // line numbers in error messages and a stack trace\n     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\\\n     *   var JST = {\\\n     *     \"main\": ' + _.template(mainText).source + '\\\n     *   };\\\n     * ');\n     */\n    function template(string, options, otherOptions) {\n      // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)\n      // and Laura Doktorova's doT.js (https://github.com/olado/doT).\n      var settings = lodash.templateSettings;\n\n      if (otherOptions && isIterateeCall(string, options, otherOptions)) {\n        options = otherOptions = undefined;\n      }\n      string = baseToString(string);\n      options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);\n\n      var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults),\n          importsKeys = keys(imports),\n          importsValues = baseValues(imports, importsKeys);\n\n      var isEscaping,\n          isEvaluating,\n          index = 0,\n          interpolate = options.interpolate || reNoMatch,\n          source = \"__p += '\";\n\n      // Compile the regexp to match each delimiter.\n      var reDelimiters = RegExp(\n        (options.escape || reNoMatch).source + '|' +\n        interpolate.source + '|' +\n        (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +\n        (options.evaluate || reNoMatch).source + '|$'\n      , 'g');\n\n      // Use a sourceURL for easier debugging.\n      var sourceURL = '//# sourceURL=' +\n        ('sourceURL' in options\n          ? options.sourceURL\n          : ('lodash.templateSources[' + (++templateCounter) + ']')\n        ) + '\\n';\n\n      string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {\n        interpolateValue || (interpolateValue = esTemplateValue);\n\n        // Escape characters that can't be included in string literals.\n        source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);\n\n        // Replace delimiters with snippets.\n        if (escapeValue) {\n          isEscaping = true;\n          source += \"' +\\n__e(\" + escapeValue + \") +\\n'\";\n        }\n        if (evaluateValue) {\n          isEvaluating = true;\n          source += \"';\\n\" + evaluateValue + \";\\n__p += '\";\n        }\n        if (interpolateValue) {\n          source += \"' +\\n((__t = (\" + interpolateValue + \")) == null ? '' : __t) +\\n'\";\n        }\n        index = offset + match.length;\n\n        // The JS engine embedded in Adobe products requires returning the `match`\n        // string in order to produce the correct `offset` value.\n        return match;\n      });\n\n      source += \"';\\n\";\n\n      // If `variable` is not specified wrap a with-statement around the generated\n      // code to add the data object to the top of the scope chain.\n      var variable = options.variable;\n      if (!variable) {\n        source = 'with (obj) {\\n' + source + '\\n}\\n';\n      }\n      // Cleanup code by stripping empty strings.\n      source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)\n        .replace(reEmptyStringMiddle, '$1')\n        .replace(reEmptyStringTrailing, '$1;');\n\n      // Frame code as the function body.\n      source = 'function(' + (variable || 'obj') + ') {\\n' +\n        (variable\n          ? ''\n          : 'obj || (obj = {});\\n'\n        ) +\n        \"var __t, __p = ''\" +\n        (isEscaping\n           ? ', __e = _.escape'\n           : ''\n        ) +\n        (isEvaluating\n          ? ', __j = Array.prototype.join;\\n' +\n            \"function print() { __p += __j.call(arguments, '') }\\n\"\n          : ';\\n'\n        ) +\n        source +\n        'return __p\\n}';\n\n      var result = attempt(function() {\n        return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);\n      });\n\n      // Provide the compiled function's source by its `toString` method or\n      // the `source` property as a convenience for inlining compiled templates.\n      result.source = source;\n      if (isError(result)) {\n        throw result;\n      }\n      return result;\n    }\n\n    /**\n     * Removes leading and trailing whitespace or specified characters from `string`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to trim.\n     * @param {string} [chars=whitespace] The characters to trim.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {string} Returns the trimmed string.\n     * @example\n     *\n     * _.trim('  abc  ');\n     * // => 'abc'\n     *\n     * _.trim('-_-abc-_-', '_-');\n     * // => 'abc'\n     *\n     * _.map(['  foo  ', '  bar  '], _.trim);\n     * // => ['foo', 'bar']\n     */\n    function trim(string, chars, guard) {\n      var value = string;\n      string = baseToString(string);\n      if (!string) {\n        return string;\n      }\n      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n        return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);\n      }\n      chars = (chars + '');\n      return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);\n    }\n\n    /**\n     * Removes leading whitespace or specified characters from `string`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to trim.\n     * @param {string} [chars=whitespace] The characters to trim.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {string} Returns the trimmed string.\n     * @example\n     *\n     * _.trimLeft('  abc  ');\n     * // => 'abc  '\n     *\n     * _.trimLeft('-_-abc-_-', '_-');\n     * // => 'abc-_-'\n     */\n    function trimLeft(string, chars, guard) {\n      var value = string;\n      string = baseToString(string);\n      if (!string) {\n        return string;\n      }\n      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n        return string.slice(trimmedLeftIndex(string));\n      }\n      return string.slice(charsLeftIndex(string, (chars + '')));\n    }\n\n    /**\n     * Removes trailing whitespace or specified characters from `string`.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to trim.\n     * @param {string} [chars=whitespace] The characters to trim.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {string} Returns the trimmed string.\n     * @example\n     *\n     * _.trimRight('  abc  ');\n     * // => '  abc'\n     *\n     * _.trimRight('-_-abc-_-', '_-');\n     * // => '-_-abc'\n     */\n    function trimRight(string, chars, guard) {\n      var value = string;\n      string = baseToString(string);\n      if (!string) {\n        return string;\n      }\n      if (guard ? isIterateeCall(value, chars, guard) : chars == null) {\n        return string.slice(0, trimmedRightIndex(string) + 1);\n      }\n      return string.slice(0, charsRightIndex(string, (chars + '')) + 1);\n    }\n\n    /**\n     * Truncates `string` if it's longer than the given maximum string length.\n     * The last characters of the truncated string are replaced with the omission\n     * string which defaults to \"...\".\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to truncate.\n     * @param {Object|number} [options] The options object or maximum string length.\n     * @param {number} [options.length=30] The maximum string length.\n     * @param {string} [options.omission='...'] The string to indicate text is omitted.\n     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {string} Returns the truncated string.\n     * @example\n     *\n     * _.trunc('hi-diddly-ho there, neighborino');\n     * // => 'hi-diddly-ho there, neighbo...'\n     *\n     * _.trunc('hi-diddly-ho there, neighborino', 24);\n     * // => 'hi-diddly-ho there, n...'\n     *\n     * _.trunc('hi-diddly-ho there, neighborino', {\n     *   'length': 24,\n     *   'separator': ' '\n     * });\n     * // => 'hi-diddly-ho there,...'\n     *\n     * _.trunc('hi-diddly-ho there, neighborino', {\n     *   'length': 24,\n     *   'separator': /,? +/\n     * });\n     * // => 'hi-diddly-ho there...'\n     *\n     * _.trunc('hi-diddly-ho there, neighborino', {\n     *   'omission': ' [...]'\n     * });\n     * // => 'hi-diddly-ho there, neig [...]'\n     */\n    function trunc(string, options, guard) {\n      if (guard && isIterateeCall(string, options, guard)) {\n        options = undefined;\n      }\n      var length = DEFAULT_TRUNC_LENGTH,\n          omission = DEFAULT_TRUNC_OMISSION;\n\n      if (options != null) {\n        if (isObject(options)) {\n          var separator = 'separator' in options ? options.separator : separator;\n          length = 'length' in options ? (+options.length || 0) : length;\n          omission = 'omission' in options ? baseToString(options.omission) : omission;\n        } else {\n          length = +options || 0;\n        }\n      }\n      string = baseToString(string);\n      if (length >= string.length) {\n        return string;\n      }\n      var end = length - omission.length;\n      if (end < 1) {\n        return omission;\n      }\n      var result = string.slice(0, end);\n      if (separator == null) {\n        return result + omission;\n      }\n      if (isRegExp(separator)) {\n        if (string.slice(end).search(separator)) {\n          var match,\n              newEnd,\n              substring = string.slice(0, end);\n\n          if (!separator.global) {\n            separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');\n          }\n          separator.lastIndex = 0;\n          while ((match = separator.exec(substring))) {\n            newEnd = match.index;\n          }\n          result = result.slice(0, newEnd == null ? end : newEnd);\n        }\n      } else if (string.indexOf(separator, end) != end) {\n        var index = result.lastIndexOf(separator);\n        if (index > -1) {\n          result = result.slice(0, index);\n        }\n      }\n      return result + omission;\n    }\n\n    /**\n     * The inverse of `_.escape`; this method converts the HTML entities\n     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their\n     * corresponding characters.\n     *\n     * **Note:** No other HTML entities are unescaped. To unescape additional HTML\n     * entities use a third-party library like [_he_](https://mths.be/he).\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to unescape.\n     * @returns {string} Returns the unescaped string.\n     * @example\n     *\n     * _.unescape('fred, barney, &amp; pebbles');\n     * // => 'fred, barney, & pebbles'\n     */\n    function unescape(string) {\n      string = baseToString(string);\n      return (string && reHasEscapedHtml.test(string))\n        ? string.replace(reEscapedHtml, unescapeHtmlChar)\n        : string;\n    }\n\n    /**\n     * Splits `string` into an array of its words.\n     *\n     * @static\n     * @memberOf _\n     * @category String\n     * @param {string} [string=''] The string to inspect.\n     * @param {RegExp|string} [pattern] The pattern to match words.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Array} Returns the words of `string`.\n     * @example\n     *\n     * _.words('fred, barney, & pebbles');\n     * // => ['fred', 'barney', 'pebbles']\n     *\n     * _.words('fred, barney, & pebbles', /[^, ]+/g);\n     * // => ['fred', 'barney', '&', 'pebbles']\n     */\n    function words(string, pattern, guard) {\n      if (guard && isIterateeCall(string, pattern, guard)) {\n        pattern = undefined;\n      }\n      string = baseToString(string);\n      return string.match(pattern || reWords) || [];\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Attempts to invoke `func`, returning either the result or the caught error\n     * object. Any additional arguments are provided to `func` when it is invoked.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Function} func The function to attempt.\n     * @returns {*} Returns the `func` result or error object.\n     * @example\n     *\n     * // avoid throwing errors for invalid selectors\n     * var elements = _.attempt(function(selector) {\n     *   return document.querySelectorAll(selector);\n     * }, '>_>');\n     *\n     * if (_.isError(elements)) {\n     *   elements = [];\n     * }\n     */\n    var attempt = restParam(function(func, args) {\n      try {\n        return func.apply(undefined, args);\n      } catch(e) {\n        return isError(e) ? e : new Error(e);\n      }\n    });\n\n    /**\n     * Creates a function that invokes `func` with the `this` binding of `thisArg`\n     * and arguments of the created function. If `func` is a property name the\n     * created callback returns the property value for a given element. If `func`\n     * is an object the created callback returns `true` for elements that contain\n     * the equivalent object properties, otherwise it returns `false`.\n     *\n     * @static\n     * @memberOf _\n     * @alias iteratee\n     * @category Utility\n     * @param {*} [func=_.identity] The value to convert to a callback.\n     * @param {*} [thisArg] The `this` binding of `func`.\n     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.\n     * @returns {Function} Returns the callback.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 40 }\n     * ];\n     *\n     * // wrap to create custom callback shorthands\n     * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {\n     *   var match = /^(.+?)__([gl]t)(.+)$/.exec(func);\n     *   if (!match) {\n     *     return callback(func, thisArg);\n     *   }\n     *   return function(object) {\n     *     return match[2] == 'gt'\n     *       ? object[match[1]] > match[3]\n     *       : object[match[1]] < match[3];\n     *   };\n     * });\n     *\n     * _.filter(users, 'age__gt36');\n     * // => [{ 'user': 'fred', 'age': 40 }]\n     */\n    function callback(func, thisArg, guard) {\n      if (guard && isIterateeCall(func, thisArg, guard)) {\n        thisArg = undefined;\n      }\n      return isObjectLike(func)\n        ? matches(func)\n        : baseCallback(func, thisArg);\n    }\n\n    /**\n     * Creates a function that returns `value`.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {*} value The value to return from the new function.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var object = { 'user': 'fred' };\n     * var getter = _.constant(object);\n     *\n     * getter() === object;\n     * // => true\n     */\n    function constant(value) {\n      return function() {\n        return value;\n      };\n    }\n\n    /**\n     * This method returns the first argument provided to it.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {*} value Any value.\n     * @returns {*} Returns `value`.\n     * @example\n     *\n     * var object = { 'user': 'fred' };\n     *\n     * _.identity(object) === object;\n     * // => true\n     */\n    function identity(value) {\n      return value;\n    }\n\n    /**\n     * Creates a function that performs a deep comparison between a given object\n     * and `source`, returning `true` if the given object has equivalent property\n     * values, else `false`.\n     *\n     * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n     * numbers, `Object` objects, regexes, and strings. Objects are compared by\n     * their own, not inherited, enumerable properties. For comparing a single\n     * own or inherited property value see `_.matchesProperty`.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Object} source The object of property values to match.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36, 'active': true },\n     *   { 'user': 'fred',   'age': 40, 'active': false }\n     * ];\n     *\n     * _.filter(users, _.matches({ 'age': 40, 'active': false }));\n     * // => [{ 'user': 'fred', 'age': 40, 'active': false }]\n     */\n    function matches(source) {\n      return baseMatches(baseClone(source, true));\n    }\n\n    /**\n     * Creates a function that compares the property value of `path` on a given\n     * object to `value`.\n     *\n     * **Note:** This method supports comparing arrays, booleans, `Date` objects,\n     * numbers, `Object` objects, regexes, and strings. Objects are compared by\n     * their own, not inherited, enumerable properties.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Array|string} path The path of the property to get.\n     * @param {*} srcValue The value to match.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var users = [\n     *   { 'user': 'barney' },\n     *   { 'user': 'fred' }\n     * ];\n     *\n     * _.find(users, _.matchesProperty('user', 'fred'));\n     * // => { 'user': 'fred' }\n     */\n    function matchesProperty(path, srcValue) {\n      return baseMatchesProperty(path, baseClone(srcValue, true));\n    }\n\n    /**\n     * Creates a function that invokes the method at `path` on a given object.\n     * Any additional arguments are provided to the invoked method.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Array|string} path The path of the method to invoke.\n     * @param {...*} [args] The arguments to invoke the method with.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var objects = [\n     *   { 'a': { 'b': { 'c': _.constant(2) } } },\n     *   { 'a': { 'b': { 'c': _.constant(1) } } }\n     * ];\n     *\n     * _.map(objects, _.method('a.b.c'));\n     * // => [2, 1]\n     *\n     * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');\n     * // => [1, 2]\n     */\n    var method = restParam(function(path, args) {\n      return function(object) {\n        return invokePath(object, path, args);\n      };\n    });\n\n    /**\n     * The opposite of `_.method`; this method creates a function that invokes\n     * the method at a given path on `object`. Any additional arguments are\n     * provided to the invoked method.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Object} object The object to query.\n     * @param {...*} [args] The arguments to invoke the method with.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var array = _.times(3, _.constant),\n     *     object = { 'a': array, 'b': array, 'c': array };\n     *\n     * _.map(['a[2]', 'c[0]'], _.methodOf(object));\n     * // => [2, 0]\n     *\n     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));\n     * // => [2, 0]\n     */\n    var methodOf = restParam(function(object, args) {\n      return function(path) {\n        return invokePath(object, path, args);\n      };\n    });\n\n    /**\n     * Adds all own enumerable function properties of a source object to the\n     * destination object. If `object` is a function then methods are added to\n     * its prototype as well.\n     *\n     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to\n     * avoid conflicts caused by modifying the original.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Function|Object} [object=lodash] The destination object.\n     * @param {Object} source The object of functions to add.\n     * @param {Object} [options] The options object.\n     * @param {boolean} [options.chain=true] Specify whether the functions added\n     *  are chainable.\n     * @returns {Function|Object} Returns `object`.\n     * @example\n     *\n     * function vowels(string) {\n     *   return _.filter(string, function(v) {\n     *     return /[aeiou]/i.test(v);\n     *   });\n     * }\n     *\n     * _.mixin({ 'vowels': vowels });\n     * _.vowels('fred');\n     * // => ['e']\n     *\n     * _('fred').vowels().value();\n     * // => ['e']\n     *\n     * _.mixin({ 'vowels': vowels }, { 'chain': false });\n     * _('fred').vowels();\n     * // => ['e']\n     */\n    function mixin(object, source, options) {\n      if (options == null) {\n        var isObj = isObject(source),\n            props = isObj ? keys(source) : undefined,\n            methodNames = (props && props.length) ? baseFunctions(source, props) : undefined;\n\n        if (!(methodNames ? methodNames.length : isObj)) {\n          methodNames = false;\n          options = source;\n          source = object;\n          object = this;\n        }\n      }\n      if (!methodNames) {\n        methodNames = baseFunctions(source, keys(source));\n      }\n      var chain = true,\n          index = -1,\n          isFunc = isFunction(object),\n          length = methodNames.length;\n\n      if (options === false) {\n        chain = false;\n      } else if (isObject(options) && 'chain' in options) {\n        chain = options.chain;\n      }\n      while (++index < length) {\n        var methodName = methodNames[index],\n            func = source[methodName];\n\n        object[methodName] = func;\n        if (isFunc) {\n          object.prototype[methodName] = (function(func) {\n            return function() {\n              var chainAll = this.__chain__;\n              if (chain || chainAll) {\n                var result = object(this.__wrapped__),\n                    actions = result.__actions__ = arrayCopy(this.__actions__);\n\n                actions.push({ 'func': func, 'args': arguments, 'thisArg': object });\n                result.__chain__ = chainAll;\n                return result;\n              }\n              return func.apply(object, arrayPush([this.value()], arguments));\n            };\n          }(func));\n        }\n      }\n      return object;\n    }\n\n    /**\n     * Reverts the `_` variable to its previous value and returns a reference to\n     * the `lodash` function.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @returns {Function} Returns the `lodash` function.\n     * @example\n     *\n     * var lodash = _.noConflict();\n     */\n    function noConflict() {\n      root._ = oldDash;\n      return this;\n    }\n\n    /**\n     * A no-operation function that returns `undefined` regardless of the\n     * arguments it receives.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @example\n     *\n     * var object = { 'user': 'fred' };\n     *\n     * _.noop(object) === undefined;\n     * // => true\n     */\n    function noop() {\n      // No operation performed.\n    }\n\n    /**\n     * Creates a function that returns the property value at `path` on a\n     * given object.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Array|string} path The path of the property to get.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var objects = [\n     *   { 'a': { 'b': { 'c': 2 } } },\n     *   { 'a': { 'b': { 'c': 1 } } }\n     * ];\n     *\n     * _.map(objects, _.property('a.b.c'));\n     * // => [2, 1]\n     *\n     * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n     * // => [1, 2]\n     */\n    function property(path) {\n      return isKey(path) ? baseProperty(path) : basePropertyDeep(path);\n    }\n\n    /**\n     * The opposite of `_.property`; this method creates a function that returns\n     * the property value at a given path on `object`.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {Object} object The object to query.\n     * @returns {Function} Returns the new function.\n     * @example\n     *\n     * var array = [0, 1, 2],\n     *     object = { 'a': array, 'b': array, 'c': array };\n     *\n     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));\n     * // => [2, 0]\n     *\n     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n     * // => [2, 0]\n     */\n    function propertyOf(object) {\n      return function(path) {\n        return baseGet(object, toPath(path), path + '');\n      };\n    }\n\n    /**\n     * Creates an array of numbers (positive and/or negative) progressing from\n     * `start` up to, but not including, `end`. If `end` is not specified it is\n     * set to `start` with `start` then set to `0`. If `end` is less than `start`\n     * a zero-length range is created unless a negative `step` is specified.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {number} [start=0] The start of the range.\n     * @param {number} end The end of the range.\n     * @param {number} [step=1] The value to increment or decrement by.\n     * @returns {Array} Returns the new array of numbers.\n     * @example\n     *\n     * _.range(4);\n     * // => [0, 1, 2, 3]\n     *\n     * _.range(1, 5);\n     * // => [1, 2, 3, 4]\n     *\n     * _.range(0, 20, 5);\n     * // => [0, 5, 10, 15]\n     *\n     * _.range(0, -4, -1);\n     * // => [0, -1, -2, -3]\n     *\n     * _.range(1, 4, 0);\n     * // => [1, 1, 1]\n     *\n     * _.range(0);\n     * // => []\n     */\n    function range(start, end, step) {\n      if (step && isIterateeCall(start, end, step)) {\n        end = step = undefined;\n      }\n      start = +start || 0;\n      step = step == null ? 1 : (+step || 0);\n\n      if (end == null) {\n        end = start;\n        start = 0;\n      } else {\n        end = +end || 0;\n      }\n      // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.\n      // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.\n      var index = -1,\n          length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n          result = Array(length);\n\n      while (++index < length) {\n        result[index] = start;\n        start += step;\n      }\n      return result;\n    }\n\n    /**\n     * Invokes the iteratee function `n` times, returning an array of the results\n     * of each invocation. The `iteratee` is bound to `thisArg` and invoked with\n     * one argument; (index).\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {number} n The number of times to invoke `iteratee`.\n     * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {Array} Returns the array of results.\n     * @example\n     *\n     * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));\n     * // => [3, 6, 4]\n     *\n     * _.times(3, function(n) {\n     *   mage.castSpell(n);\n     * });\n     * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`\n     *\n     * _.times(3, function(n) {\n     *   this.cast(n);\n     * }, mage);\n     * // => also invokes `mage.castSpell(n)` three times\n     */\n    function times(n, iteratee, thisArg) {\n      n = nativeFloor(n);\n\n      // Exit early to avoid a JSC JIT bug in Safari 8\n      // where `Array(0)` is treated as `Array(1)`.\n      if (n < 1 || !nativeIsFinite(n)) {\n        return [];\n      }\n      var index = -1,\n          result = Array(nativeMin(n, MAX_ARRAY_LENGTH));\n\n      iteratee = bindCallback(iteratee, thisArg, 1);\n      while (++index < n) {\n        if (index < MAX_ARRAY_LENGTH) {\n          result[index] = iteratee(index);\n        } else {\n          iteratee(index);\n        }\n      }\n      return result;\n    }\n\n    /**\n     * Generates a unique ID. If `prefix` is provided the ID is appended to it.\n     *\n     * @static\n     * @memberOf _\n     * @category Utility\n     * @param {string} [prefix] The value to prefix the ID with.\n     * @returns {string} Returns the unique ID.\n     * @example\n     *\n     * _.uniqueId('contact_');\n     * // => 'contact_104'\n     *\n     * _.uniqueId();\n     * // => '105'\n     */\n    function uniqueId(prefix) {\n      var id = ++idCounter;\n      return baseToString(prefix) + id;\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * Adds two numbers.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {number} augend The first number to add.\n     * @param {number} addend The second number to add.\n     * @returns {number} Returns the sum.\n     * @example\n     *\n     * _.add(6, 4);\n     * // => 10\n     */\n    function add(augend, addend) {\n      return (+augend || 0) + (+addend || 0);\n    }\n\n    /**\n     * Calculates `n` rounded up to `precision`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {number} n The number to round up.\n     * @param {number} [precision=0] The precision to round up to.\n     * @returns {number} Returns the rounded up number.\n     * @example\n     *\n     * _.ceil(4.006);\n     * // => 5\n     *\n     * _.ceil(6.004, 2);\n     * // => 6.01\n     *\n     * _.ceil(6040, -2);\n     * // => 6100\n     */\n    var ceil = createRound('ceil');\n\n    /**\n     * Calculates `n` rounded down to `precision`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {number} n The number to round down.\n     * @param {number} [precision=0] The precision to round down to.\n     * @returns {number} Returns the rounded down number.\n     * @example\n     *\n     * _.floor(4.006);\n     * // => 4\n     *\n     * _.floor(0.046, 2);\n     * // => 0.04\n     *\n     * _.floor(4060, -2);\n     * // => 4000\n     */\n    var floor = createRound('floor');\n\n    /**\n     * Gets the maximum value of `collection`. If `collection` is empty or falsey\n     * `-Infinity` is returned. If an iteratee function is provided it is invoked\n     * for each value in `collection` to generate the criterion by which the value\n     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three\n     * arguments: (value, index, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {*} Returns the maximum value.\n     * @example\n     *\n     * _.max([4, 2, 8, 6]);\n     * // => 8\n     *\n     * _.max([]);\n     * // => -Infinity\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 40 }\n     * ];\n     *\n     * _.max(users, function(chr) {\n     *   return chr.age;\n     * });\n     * // => { 'user': 'fred', 'age': 40 }\n     *\n     * // using the `_.property` callback shorthand\n     * _.max(users, 'age');\n     * // => { 'user': 'fred', 'age': 40 }\n     */\n    var max = createExtremum(gt, NEGATIVE_INFINITY);\n\n    /**\n     * Gets the minimum value of `collection`. If `collection` is empty or falsey\n     * `Infinity` is returned. If an iteratee function is provided it is invoked\n     * for each value in `collection` to generate the criterion by which the value\n     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three\n     * arguments: (value, index, collection).\n     *\n     * If a property name is provided for `iteratee` the created `_.property`\n     * style callback returns the property value of the given element.\n     *\n     * If a value is also provided for `thisArg` the created `_.matchesProperty`\n     * style callback returns `true` for elements that have a matching property\n     * value, else `false`.\n     *\n     * If an object is provided for `iteratee` the created `_.matches` style\n     * callback returns `true` for elements that have the properties of the given\n     * object, else `false`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {*} Returns the minimum value.\n     * @example\n     *\n     * _.min([4, 2, 8, 6]);\n     * // => 2\n     *\n     * _.min([]);\n     * // => Infinity\n     *\n     * var users = [\n     *   { 'user': 'barney', 'age': 36 },\n     *   { 'user': 'fred',   'age': 40 }\n     * ];\n     *\n     * _.min(users, function(chr) {\n     *   return chr.age;\n     * });\n     * // => { 'user': 'barney', 'age': 36 }\n     *\n     * // using the `_.property` callback shorthand\n     * _.min(users, 'age');\n     * // => { 'user': 'barney', 'age': 36 }\n     */\n    var min = createExtremum(lt, POSITIVE_INFINITY);\n\n    /**\n     * Calculates `n` rounded to `precision`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {number} n The number to round.\n     * @param {number} [precision=0] The precision to round to.\n     * @returns {number} Returns the rounded number.\n     * @example\n     *\n     * _.round(4.006);\n     * // => 4\n     *\n     * _.round(4.006, 2);\n     * // => 4.01\n     *\n     * _.round(4060, -2);\n     * // => 4100\n     */\n    var round = createRound('round');\n\n    /**\n     * Gets the sum of the values in `collection`.\n     *\n     * @static\n     * @memberOf _\n     * @category Math\n     * @param {Array|Object|string} collection The collection to iterate over.\n     * @param {Function|Object|string} [iteratee] The function invoked per iteration.\n     * @param {*} [thisArg] The `this` binding of `iteratee`.\n     * @returns {number} Returns the sum.\n     * @example\n     *\n     * _.sum([4, 6]);\n     * // => 10\n     *\n     * _.sum({ 'a': 4, 'b': 6 });\n     * // => 10\n     *\n     * var objects = [\n     *   { 'n': 4 },\n     *   { 'n': 6 }\n     * ];\n     *\n     * _.sum(objects, function(object) {\n     *   return object.n;\n     * });\n     * // => 10\n     *\n     * // using the `_.property` callback shorthand\n     * _.sum(objects, 'n');\n     * // => 10\n     */\n    function sum(collection, iteratee, thisArg) {\n      if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {\n        iteratee = undefined;\n      }\n      iteratee = getCallback(iteratee, thisArg, 3);\n      return iteratee.length == 1\n        ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee)\n        : baseSum(collection, iteratee);\n    }\n\n    /*------------------------------------------------------------------------*/\n\n    // Ensure wrappers are instances of `baseLodash`.\n    lodash.prototype = baseLodash.prototype;\n\n    LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n    LodashWrapper.prototype.constructor = LodashWrapper;\n\n    LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n    LazyWrapper.prototype.constructor = LazyWrapper;\n\n    // Add functions to the `Map` cache.\n    MapCache.prototype['delete'] = mapDelete;\n    MapCache.prototype.get = mapGet;\n    MapCache.prototype.has = mapHas;\n    MapCache.prototype.set = mapSet;\n\n    // Add functions to the `Set` cache.\n    SetCache.prototype.push = cachePush;\n\n    // Assign cache to `_.memoize`.\n    memoize.Cache = MapCache;\n\n    // Add functions that return wrapped values when chaining.\n    lodash.after = after;\n    lodash.ary = ary;\n    lodash.assign = assign;\n    lodash.at = at;\n    lodash.before = before;\n    lodash.bind = bind;\n    lodash.bindAll = bindAll;\n    lodash.bindKey = bindKey;\n    lodash.callback = callback;\n    lodash.chain = chain;\n    lodash.chunk = chunk;\n    lodash.compact = compact;\n    lodash.constant = constant;\n    lodash.countBy = countBy;\n    lodash.create = create;\n    lodash.curry = curry;\n    lodash.curryRight = curryRight;\n    lodash.debounce = debounce;\n    lodash.defaults = defaults;\n    lodash.defaultsDeep = defaultsDeep;\n    lodash.defer = defer;\n    lodash.delay = delay;\n    lodash.difference = difference;\n    lodash.drop = drop;\n    lodash.dropRight = dropRight;\n    lodash.dropRightWhile = dropRightWhile;\n    lodash.dropWhile = dropWhile;\n    lodash.fill = fill;\n    lodash.filter = filter;\n    lodash.flatten = flatten;\n    lodash.flattenDeep = flattenDeep;\n    lodash.flow = flow;\n    lodash.flowRight = flowRight;\n    lodash.forEach = forEach;\n    lodash.forEachRight = forEachRight;\n    lodash.forIn = forIn;\n    lodash.forInRight = forInRight;\n    lodash.forOwn = forOwn;\n    lodash.forOwnRight = forOwnRight;\n    lodash.functions = functions;\n    lodash.groupBy = groupBy;\n    lodash.indexBy = indexBy;\n    lodash.initial = initial;\n    lodash.intersection = intersection;\n    lodash.invert = invert;\n    lodash.invoke = invoke;\n    lodash.keys = keys;\n    lodash.keysIn = keysIn;\n    lodash.map = map;\n    lodash.mapKeys = mapKeys;\n    lodash.mapValues = mapValues;\n    lodash.matches = matches;\n    lodash.matchesProperty = matchesProperty;\n    lodash.memoize = memoize;\n    lodash.merge = merge;\n    lodash.method = method;\n    lodash.methodOf = methodOf;\n    lodash.mixin = mixin;\n    lodash.modArgs = modArgs;\n    lodash.negate = negate;\n    lodash.omit = omit;\n    lodash.once = once;\n    lodash.pairs = pairs;\n    lodash.partial = partial;\n    lodash.partialRight = partialRight;\n    lodash.partition = partition;\n    lodash.pick = pick;\n    lodash.pluck = pluck;\n    lodash.property = property;\n    lodash.propertyOf = propertyOf;\n    lodash.pull = pull;\n    lodash.pullAt = pullAt;\n    lodash.range = range;\n    lodash.rearg = rearg;\n    lodash.reject = reject;\n    lodash.remove = remove;\n    lodash.rest = rest;\n    lodash.restParam = restParam;\n    lodash.set = set;\n    lodash.shuffle = shuffle;\n    lodash.slice = slice;\n    lodash.sortBy = sortBy;\n    lodash.sortByAll = sortByAll;\n    lodash.sortByOrder = sortByOrder;\n    lodash.spread = spread;\n    lodash.take = take;\n    lodash.takeRight = takeRight;\n    lodash.takeRightWhile = takeRightWhile;\n    lodash.takeWhile = takeWhile;\n    lodash.tap = tap;\n    lodash.throttle = throttle;\n    lodash.thru = thru;\n    lodash.times = times;\n    lodash.toArray = toArray;\n    lodash.toPlainObject = toPlainObject;\n    lodash.transform = transform;\n    lodash.union = union;\n    lodash.uniq = uniq;\n    lodash.unzip = unzip;\n    lodash.unzipWith = unzipWith;\n    lodash.values = values;\n    lodash.valuesIn = valuesIn;\n    lodash.where = where;\n    lodash.without = without;\n    lodash.wrap = wrap;\n    lodash.xor = xor;\n    lodash.zip = zip;\n    lodash.zipObject = zipObject;\n    lodash.zipWith = zipWith;\n\n    // Add aliases.\n    lodash.backflow = flowRight;\n    lodash.collect = map;\n    lodash.compose = flowRight;\n    lodash.each = forEach;\n    lodash.eachRight = forEachRight;\n    lodash.extend = assign;\n    lodash.iteratee = callback;\n    lodash.methods = functions;\n    lodash.object = zipObject;\n    lodash.select = filter;\n    lodash.tail = rest;\n    lodash.unique = uniq;\n\n    // Add functions to `lodash.prototype`.\n    mixin(lodash, lodash);\n\n    /*------------------------------------------------------------------------*/\n\n    // Add functions that return unwrapped values when chaining.\n    lodash.add = add;\n    lodash.attempt = attempt;\n    lodash.camelCase = camelCase;\n    lodash.capitalize = capitalize;\n    lodash.ceil = ceil;\n    lodash.clone = clone;\n    lodash.cloneDeep = cloneDeep;\n    lodash.deburr = deburr;\n    lodash.endsWith = endsWith;\n    lodash.escape = escape;\n    lodash.escapeRegExp = escapeRegExp;\n    lodash.every = every;\n    lodash.find = find;\n    lodash.findIndex = findIndex;\n    lodash.findKey = findKey;\n    lodash.findLast = findLast;\n    lodash.findLastIndex = findLastIndex;\n    lodash.findLastKey = findLastKey;\n    lodash.findWhere = findWhere;\n    lodash.first = first;\n    lodash.floor = floor;\n    lodash.get = get;\n    lodash.gt = gt;\n    lodash.gte = gte;\n    lodash.has = has;\n    lodash.identity = identity;\n    lodash.includes = includes;\n    lodash.indexOf = indexOf;\n    lodash.inRange = inRange;\n    lodash.isArguments = isArguments;\n    lodash.isArray = isArray;\n    lodash.isBoolean = isBoolean;\n    lodash.isDate = isDate;\n    lodash.isElement = isElement;\n    lodash.isEmpty = isEmpty;\n    lodash.isEqual = isEqual;\n    lodash.isError = isError;\n    lodash.isFinite = isFinite;\n    lodash.isFunction = isFunction;\n    lodash.isMatch = isMatch;\n    lodash.isNaN = isNaN;\n    lodash.isNative = isNative;\n    lodash.isNull = isNull;\n    lodash.isNumber = isNumber;\n    lodash.isObject = isObject;\n    lodash.isPlainObject = isPlainObject;\n    lodash.isRegExp = isRegExp;\n    lodash.isString = isString;\n    lodash.isTypedArray = isTypedArray;\n    lodash.isUndefined = isUndefined;\n    lodash.kebabCase = kebabCase;\n    lodash.last = last;\n    lodash.lastIndexOf = lastIndexOf;\n    lodash.lt = lt;\n    lodash.lte = lte;\n    lodash.max = max;\n    lodash.min = min;\n    lodash.noConflict = noConflict;\n    lodash.noop = noop;\n    lodash.now = now;\n    lodash.pad = pad;\n    lodash.padLeft = padLeft;\n    lodash.padRight = padRight;\n    lodash.parseInt = parseInt;\n    lodash.random = random;\n    lodash.reduce = reduce;\n    lodash.reduceRight = reduceRight;\n    lodash.repeat = repeat;\n    lodash.result = result;\n    lodash.round = round;\n    lodash.runInContext = runInContext;\n    lodash.size = size;\n    lodash.snakeCase = snakeCase;\n    lodash.some = some;\n    lodash.sortedIndex = sortedIndex;\n    lodash.sortedLastIndex = sortedLastIndex;\n    lodash.startCase = startCase;\n    lodash.startsWith = startsWith;\n    lodash.sum = sum;\n    lodash.template = template;\n    lodash.trim = trim;\n    lodash.trimLeft = trimLeft;\n    lodash.trimRight = trimRight;\n    lodash.trunc = trunc;\n    lodash.unescape = unescape;\n    lodash.uniqueId = uniqueId;\n    lodash.words = words;\n\n    // Add aliases.\n    lodash.all = every;\n    lodash.any = some;\n    lodash.contains = includes;\n    lodash.eq = isEqual;\n    lodash.detect = find;\n    lodash.foldl = reduce;\n    lodash.foldr = reduceRight;\n    lodash.head = first;\n    lodash.include = includes;\n    lodash.inject = reduce;\n\n    mixin(lodash, (function() {\n      var source = {};\n      baseForOwn(lodash, function(func, methodName) {\n        if (!lodash.prototype[methodName]) {\n          source[methodName] = func;\n        }\n      });\n      return source;\n    }()), false);\n\n    /*------------------------------------------------------------------------*/\n\n    // Add functions capable of returning wrapped and unwrapped values when chaining.\n    lodash.sample = sample;\n\n    lodash.prototype.sample = function(n) {\n      if (!this.__chain__ && n == null) {\n        return sample(this.value());\n      }\n      return this.thru(function(value) {\n        return sample(value, n);\n      });\n    };\n\n    /*------------------------------------------------------------------------*/\n\n    /**\n     * The semantic version number.\n     *\n     * @static\n     * @memberOf _\n     * @type string\n     */\n    lodash.VERSION = VERSION;\n\n    // Assign default placeholders.\n    arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {\n      lodash[methodName].placeholder = lodash;\n    });\n\n    // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.\n    arrayEach(['drop', 'take'], function(methodName, index) {\n      LazyWrapper.prototype[methodName] = function(n) {\n        var filtered = this.__filtered__;\n        if (filtered && !index) {\n          return new LazyWrapper(this);\n        }\n        n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);\n\n        var result = this.clone();\n        if (filtered) {\n          result.__takeCount__ = nativeMin(result.__takeCount__, n);\n        } else {\n          result.__views__.push({ 'size': n, 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') });\n        }\n        return result;\n      };\n\n      LazyWrapper.prototype[methodName + 'Right'] = function(n) {\n        return this.reverse()[methodName](n).reverse();\n      };\n    });\n\n    // Add `LazyWrapper` methods that accept an `iteratee` value.\n    arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {\n      var type = index + 1,\n          isFilter = type != LAZY_MAP_FLAG;\n\n      LazyWrapper.prototype[methodName] = function(iteratee, thisArg) {\n        var result = this.clone();\n        result.__iteratees__.push({ 'iteratee': getCallback(iteratee, thisArg, 1), 'type': type });\n        result.__filtered__ = result.__filtered__ || isFilter;\n        return result;\n      };\n    });\n\n    // Add `LazyWrapper` methods for `_.first` and `_.last`.\n    arrayEach(['first', 'last'], function(methodName, index) {\n      var takeName = 'take' + (index ? 'Right' : '');\n\n      LazyWrapper.prototype[methodName] = function() {\n        return this[takeName](1).value()[0];\n      };\n    });\n\n    // Add `LazyWrapper` methods for `_.initial` and `_.rest`.\n    arrayEach(['initial', 'rest'], function(methodName, index) {\n      var dropName = 'drop' + (index ? '' : 'Right');\n\n      LazyWrapper.prototype[methodName] = function() {\n        return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);\n      };\n    });\n\n    // Add `LazyWrapper` methods for `_.pluck` and `_.where`.\n    arrayEach(['pluck', 'where'], function(methodName, index) {\n      var operationName = index ? 'filter' : 'map',\n          createCallback = index ? baseMatches : property;\n\n      LazyWrapper.prototype[methodName] = function(value) {\n        return this[operationName](createCallback(value));\n      };\n    });\n\n    LazyWrapper.prototype.compact = function() {\n      return this.filter(identity);\n    };\n\n    LazyWrapper.prototype.reject = function(predicate, thisArg) {\n      predicate = getCallback(predicate, thisArg, 1);\n      return this.filter(function(value) {\n        return !predicate(value);\n      });\n    };\n\n    LazyWrapper.prototype.slice = function(start, end) {\n      start = start == null ? 0 : (+start || 0);\n\n      var result = this;\n      if (result.__filtered__ && (start > 0 || end < 0)) {\n        return new LazyWrapper(result);\n      }\n      if (start < 0) {\n        result = result.takeRight(-start);\n      } else if (start) {\n        result = result.drop(start);\n      }\n      if (end !== undefined) {\n        end = (+end || 0);\n        result = end < 0 ? result.dropRight(-end) : result.take(end - start);\n      }\n      return result;\n    };\n\n    LazyWrapper.prototype.takeRightWhile = function(predicate, thisArg) {\n      return this.reverse().takeWhile(predicate, thisArg).reverse();\n    };\n\n    LazyWrapper.prototype.toArray = function() {\n      return this.take(POSITIVE_INFINITY);\n    };\n\n    // Add `LazyWrapper` methods to `lodash.prototype`.\n    baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n      var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName),\n          retUnwrapped = /^(?:first|last)$/.test(methodName),\n          lodashFunc = lodash[retUnwrapped ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName];\n\n      if (!lodashFunc) {\n        return;\n      }\n      lodash.prototype[methodName] = function() {\n        var args = retUnwrapped ? [1] : arguments,\n            chainAll = this.__chain__,\n            value = this.__wrapped__,\n            isHybrid = !!this.__actions__.length,\n            isLazy = value instanceof LazyWrapper,\n            iteratee = args[0],\n            useLazy = isLazy || isArray(value);\n\n        if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {\n          // Avoid lazy use if the iteratee has a \"length\" value other than `1`.\n          isLazy = useLazy = false;\n        }\n        var interceptor = function(value) {\n          return (retUnwrapped && chainAll)\n            ? lodashFunc(value, 1)[0]\n            : lodashFunc.apply(undefined, arrayPush([value], args));\n        };\n\n        var action = { 'func': thru, 'args': [interceptor], 'thisArg': undefined },\n            onlyLazy = isLazy && !isHybrid;\n\n        if (retUnwrapped && !chainAll) {\n          if (onlyLazy) {\n            value = value.clone();\n            value.__actions__.push(action);\n            return func.call(value);\n          }\n          return lodashFunc.call(undefined, this.value())[0];\n        }\n        if (!retUnwrapped && useLazy) {\n          value = onlyLazy ? value : new LazyWrapper(this);\n          var result = func.apply(value, args);\n          result.__actions__.push(action);\n          return new LodashWrapper(result, chainAll);\n        }\n        return this.thru(interceptor);\n      };\n    });\n\n    // Add `Array` and `String` methods to `lodash.prototype`.\n    arrayEach(['join', 'pop', 'push', 'replace', 'shift', 'sort', 'splice', 'split', 'unshift'], function(methodName) {\n      var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName],\n          chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',\n          retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);\n\n      lodash.prototype[methodName] = function() {\n        var args = arguments;\n        if (retUnwrapped && !this.__chain__) {\n          return func.apply(this.value(), args);\n        }\n        return this[chainName](function(value) {\n          return func.apply(value, args);\n        });\n      };\n    });\n\n    // Map minified function names to their real names.\n    baseForOwn(LazyWrapper.prototype, function(func, methodName) {\n      var lodashFunc = lodash[methodName];\n      if (lodashFunc) {\n        var key = lodashFunc.name,\n            names = realNames[key] || (realNames[key] = []);\n\n        names.push({ 'name': methodName, 'func': lodashFunc });\n      }\n    });\n\n    realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }];\n\n    // Add functions to the lazy wrapper.\n    LazyWrapper.prototype.clone = lazyClone;\n    LazyWrapper.prototype.reverse = lazyReverse;\n    LazyWrapper.prototype.value = lazyValue;\n\n    // Add chaining functions to the `lodash` wrapper.\n    lodash.prototype.chain = wrapperChain;\n    lodash.prototype.commit = wrapperCommit;\n    lodash.prototype.concat = wrapperConcat;\n    lodash.prototype.plant = wrapperPlant;\n    lodash.prototype.reverse = wrapperReverse;\n    lodash.prototype.toString = wrapperToString;\n    lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;\n\n    // Add function aliases to the `lodash` wrapper.\n    lodash.prototype.collect = lodash.prototype.map;\n    lodash.prototype.head = lodash.prototype.first;\n    lodash.prototype.select = lodash.prototype.filter;\n    lodash.prototype.tail = lodash.prototype.rest;\n\n    return lodash;\n  }\n\n  /*--------------------------------------------------------------------------*/\n\n  // Export lodash.\n  var _ = runInContext();\n\n  // Some AMD build optimizers like r.js check for condition patterns like the following:\n  if (true) {\n    // Expose lodash to the global object when an AMD loader is present to avoid\n    // errors in cases where lodash is loaded by a script tag and not intended\n    // as an AMD module. See http://requirejs.org/docs/errors.html#mismatch for\n    // more details.\n    root._ = _;\n\n    // Define as an anonymous module so, through path mapping, it can be\n    // referenced as the \"underscore\" module.\n    !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n      return _;\n    }.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  }\n  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.\n  else if (freeExports && freeModule) {\n    // Export for Node.js or RingoJS.\n    if (moduleExports) {\n      (freeModule.exports = _)._ = _;\n    }\n    // Export for Rhino with CommonJS support.\n    else {\n      freeExports._ = _;\n    }\n  }\n  else {\n    // Export for a browser or Rhino.\n    root._ = _;\n  }\n}.call(this));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module), __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/lodash/index.js\n// module id = 10\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/lodash/index.js")},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//     Underscore.js 1.8.3\n//     http://underscorejs.org\n//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n//     Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n  // Baseline setup\n  // --------------\n\n  // Establish the root object, `window` in the browser, or `exports` on the server.\n  var root = this;\n\n  // Save the previous value of the `_` variable.\n  var previousUnderscore = root._;\n\n  // Save bytes in the minified (but not gzipped) version:\n  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\n\n  // Create quick reference variables for speed access to core prototypes.\n  var\n    push             = ArrayProto.push,\n    slice            = ArrayProto.slice,\n    toString         = ObjProto.toString,\n    hasOwnProperty   = ObjProto.hasOwnProperty;\n\n  // All **ECMAScript 5** native function implementations that we hope to use\n  // are declared here.\n  var\n    nativeIsArray      = Array.isArray,\n    nativeKeys         = Object.keys,\n    nativeBind         = FuncProto.bind,\n    nativeCreate       = Object.create;\n\n  // Naked function reference for surrogate-prototype-swapping.\n  var Ctor = function(){};\n\n  // Create a safe reference to the Underscore object for use below.\n  var _ = function(obj) {\n    if (obj instanceof _) return obj;\n    if (!(this instanceof _)) return new _(obj);\n    this._wrapped = obj;\n  };\n\n  // Export the Underscore object for **Node.js**, with\n  // backwards-compatibility for the old `require()` API. If we're in\n  // the browser, add `_` as a global object.\n  if (true) {\n    if (typeof module !== 'undefined' && module.exports) {\n      exports = module.exports = _;\n    }\n    exports._ = _;\n  } else {\n    root._ = _;\n  }\n\n  // Current version.\n  _.VERSION = '1.8.3';\n\n  // Internal function that returns an efficient (for current engines) version\n  // of the passed-in callback, to be repeatedly applied in other Underscore\n  // functions.\n  var optimizeCb = function(func, context, argCount) {\n    if (context === void 0) return func;\n    switch (argCount == null ? 3 : argCount) {\n      case 1: return function(value) {\n        return func.call(context, value);\n      };\n      case 2: return function(value, other) {\n        return func.call(context, value, other);\n      };\n      case 3: return function(value, index, collection) {\n        return func.call(context, value, index, collection);\n      };\n      case 4: return function(accumulator, value, index, collection) {\n        return func.call(context, accumulator, value, index, collection);\n      };\n    }\n    return function() {\n      return func.apply(context, arguments);\n    };\n  };\n\n  // A mostly-internal function to generate callbacks that can be applied\n  // to each element in a collection, returning the desired result — either\n  // identity, an arbitrary callback, a property matcher, or a property accessor.\n  var cb = function(value, context, argCount) {\n    if (value == null) return _.identity;\n    if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n    if (_.isObject(value)) return _.matcher(value);\n    return _.property(value);\n  };\n  _.iteratee = function(value, context) {\n    return cb(value, context, Infinity);\n  };\n\n  // An internal function for creating assigner functions.\n  var createAssigner = function(keysFunc, undefinedOnly) {\n    return function(obj) {\n      var length = arguments.length;\n      if (length < 2 || obj == null) return obj;\n      for (var index = 1; index < length; index++) {\n        var source = arguments[index],\n            keys = keysFunc(source),\n            l = keys.length;\n        for (var i = 0; i < l; i++) {\n          var key = keys[i];\n          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\n        }\n      }\n      return obj;\n    };\n  };\n\n  // An internal function for creating a new object that inherits from another.\n  var baseCreate = function(prototype) {\n    if (!_.isObject(prototype)) return {};\n    if (nativeCreate) return nativeCreate(prototype);\n    Ctor.prototype = prototype;\n    var result = new Ctor;\n    Ctor.prototype = null;\n    return result;\n  };\n\n  var property = function(key) {\n    return function(obj) {\n      return obj == null ? void 0 : obj[key];\n    };\n  };\n\n  // Helper for collection methods to determine whether a collection\n  // should be iterated as an array or as an object\n  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n  var getLength = property('length');\n  var isArrayLike = function(collection) {\n    var length = getLength(collection);\n    return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n  };\n\n  // Collection Functions\n  // --------------------\n\n  // The cornerstone, an `each` implementation, aka `forEach`.\n  // Handles raw objects in addition to array-likes. Treats all\n  // sparse array-likes as if they were dense.\n  _.each = _.forEach = function(obj, iteratee, context) {\n    iteratee = optimizeCb(iteratee, context);\n    var i, length;\n    if (isArrayLike(obj)) {\n      for (i = 0, length = obj.length; i < length; i++) {\n        iteratee(obj[i], i, obj);\n      }\n    } else {\n      var keys = _.keys(obj);\n      for (i = 0, length = keys.length; i < length; i++) {\n        iteratee(obj[keys[i]], keys[i], obj);\n      }\n    }\n    return obj;\n  };\n\n  // Return the results of applying the iteratee to each element.\n  _.map = _.collect = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length,\n        results = Array(length);\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      results[index] = iteratee(obj[currentKey], currentKey, obj);\n    }\n    return results;\n  };\n\n  // Create a reducing function iterating left or right.\n  function createReduce(dir) {\n    // Optimized iterator function as using arguments.length\n    // in the main function will deoptimize the, see #1991.\n    function iterator(obj, iteratee, memo, keys, index, length) {\n      for (; index >= 0 && index < length; index += dir) {\n        var currentKey = keys ? keys[index] : index;\n        memo = iteratee(memo, obj[currentKey], currentKey, obj);\n      }\n      return memo;\n    }\n\n    return function(obj, iteratee, memo, context) {\n      iteratee = optimizeCb(iteratee, context, 4);\n      var keys = !isArrayLike(obj) && _.keys(obj),\n          length = (keys || obj).length,\n          index = dir > 0 ? 0 : length - 1;\n      // Determine the initial value if none is provided.\n      if (arguments.length < 3) {\n        memo = obj[keys ? keys[index] : index];\n        index += dir;\n      }\n      return iterator(obj, iteratee, memo, keys, index, length);\n    };\n  }\n\n  // **Reduce** builds up a single result from a list of values, aka `inject`,\n  // or `foldl`.\n  _.reduce = _.foldl = _.inject = createReduce(1);\n\n  // The right-associative version of reduce, also known as `foldr`.\n  _.reduceRight = _.foldr = createReduce(-1);\n\n  // Return the first value which passes a truth test. Aliased as `detect`.\n  _.find = _.detect = function(obj, predicate, context) {\n    var key;\n    if (isArrayLike(obj)) {\n      key = _.findIndex(obj, predicate, context);\n    } else {\n      key = _.findKey(obj, predicate, context);\n    }\n    if (key !== void 0 && key !== -1) return obj[key];\n  };\n\n  // Return all the elements that pass a truth test.\n  // Aliased as `select`.\n  _.filter = _.select = function(obj, predicate, context) {\n    var results = [];\n    predicate = cb(predicate, context);\n    _.each(obj, function(value, index, list) {\n      if (predicate(value, index, list)) results.push(value);\n    });\n    return results;\n  };\n\n  // Return all the elements for which a truth test fails.\n  _.reject = function(obj, predicate, context) {\n    return _.filter(obj, _.negate(cb(predicate)), context);\n  };\n\n  // Determine whether all of the elements match a truth test.\n  // Aliased as `all`.\n  _.every = _.all = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      if (!predicate(obj[currentKey], currentKey, obj)) return false;\n    }\n    return true;\n  };\n\n  // Determine if at least one element in the object matches a truth test.\n  // Aliased as `any`.\n  _.some = _.any = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = !isArrayLike(obj) && _.keys(obj),\n        length = (keys || obj).length;\n    for (var index = 0; index < length; index++) {\n      var currentKey = keys ? keys[index] : index;\n      if (predicate(obj[currentKey], currentKey, obj)) return true;\n    }\n    return false;\n  };\n\n  // Determine if the array or object contains a given item (using `===`).\n  // Aliased as `includes` and `include`.\n  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\n    if (!isArrayLike(obj)) obj = _.values(obj);\n    if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n    return _.indexOf(obj, item, fromIndex) >= 0;\n  };\n\n  // Invoke a method (with arguments) on every item in a collection.\n  _.invoke = function(obj, method) {\n    var args = slice.call(arguments, 2);\n    var isFunc = _.isFunction(method);\n    return _.map(obj, function(value) {\n      var func = isFunc ? method : value[method];\n      return func == null ? func : func.apply(value, args);\n    });\n  };\n\n  // Convenience version of a common use case of `map`: fetching a property.\n  _.pluck = function(obj, key) {\n    return _.map(obj, _.property(key));\n  };\n\n  // Convenience version of a common use case of `filter`: selecting only objects\n  // containing specific `key:value` pairs.\n  _.where = function(obj, attrs) {\n    return _.filter(obj, _.matcher(attrs));\n  };\n\n  // Convenience version of a common use case of `find`: getting the first object\n  // containing specific `key:value` pairs.\n  _.findWhere = function(obj, attrs) {\n    return _.find(obj, _.matcher(attrs));\n  };\n\n  // Return the maximum element (or element-based computation).\n  _.max = function(obj, iteratee, context) {\n    var result = -Infinity, lastComputed = -Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = isArrayLike(obj) ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value > result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Return the minimum element (or element-based computation).\n  _.min = function(obj, iteratee, context) {\n    var result = Infinity, lastComputed = Infinity,\n        value, computed;\n    if (iteratee == null && obj != null) {\n      obj = isArrayLike(obj) ? obj : _.values(obj);\n      for (var i = 0, length = obj.length; i < length; i++) {\n        value = obj[i];\n        if (value < result) {\n          result = value;\n        }\n      }\n    } else {\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index, list) {\n        computed = iteratee(value, index, list);\n        if (computed < lastComputed || computed === Infinity && result === Infinity) {\n          result = value;\n          lastComputed = computed;\n        }\n      });\n    }\n    return result;\n  };\n\n  // Shuffle a collection, using the modern version of the\n  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n  _.shuffle = function(obj) {\n    var set = isArrayLike(obj) ? obj : _.values(obj);\n    var length = set.length;\n    var shuffled = Array(length);\n    for (var index = 0, rand; index < length; index++) {\n      rand = _.random(0, index);\n      if (rand !== index) shuffled[index] = shuffled[rand];\n      shuffled[rand] = set[index];\n    }\n    return shuffled;\n  };\n\n  // Sample **n** random values from a collection.\n  // If **n** is not specified, returns a single random element.\n  // The internal `guard` argument allows it to work with `map`.\n  _.sample = function(obj, n, guard) {\n    if (n == null || guard) {\n      if (!isArrayLike(obj)) obj = _.values(obj);\n      return obj[_.random(obj.length - 1)];\n    }\n    return _.shuffle(obj).slice(0, Math.max(0, n));\n  };\n\n  // Sort the object's values by a criterion produced by an iteratee.\n  _.sortBy = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    return _.pluck(_.map(obj, function(value, index, list) {\n      return {\n        value: value,\n        index: index,\n        criteria: iteratee(value, index, list)\n      };\n    }).sort(function(left, right) {\n      var a = left.criteria;\n      var b = right.criteria;\n      if (a !== b) {\n        if (a > b || a === void 0) return 1;\n        if (a < b || b === void 0) return -1;\n      }\n      return left.index - right.index;\n    }), 'value');\n  };\n\n  // An internal function used for aggregate \"group by\" operations.\n  var group = function(behavior) {\n    return function(obj, iteratee, context) {\n      var result = {};\n      iteratee = cb(iteratee, context);\n      _.each(obj, function(value, index) {\n        var key = iteratee(value, index, obj);\n        behavior(result, value, key);\n      });\n      return result;\n    };\n  };\n\n  // Groups the object's values by a criterion. Pass either a string attribute\n  // to group by, or a function that returns the criterion.\n  _.groupBy = group(function(result, value, key) {\n    if (_.has(result, key)) result[key].push(value); else result[key] = [value];\n  });\n\n  // Indexes the object's values by a criterion, similar to `groupBy`, but for\n  // when you know that your index values will be unique.\n  _.indexBy = group(function(result, value, key) {\n    result[key] = value;\n  });\n\n  // Counts instances of an object that group by a certain criterion. Pass\n  // either a string attribute to count by, or a function that returns the\n  // criterion.\n  _.countBy = group(function(result, value, key) {\n    if (_.has(result, key)) result[key]++; else result[key] = 1;\n  });\n\n  // Safely create a real, live array from anything iterable.\n  _.toArray = function(obj) {\n    if (!obj) return [];\n    if (_.isArray(obj)) return slice.call(obj);\n    if (isArrayLike(obj)) return _.map(obj, _.identity);\n    return _.values(obj);\n  };\n\n  // Return the number of elements in an object.\n  _.size = function(obj) {\n    if (obj == null) return 0;\n    return isArrayLike(obj) ? obj.length : _.keys(obj).length;\n  };\n\n  // Split a collection into two arrays: one whose elements all satisfy the given\n  // predicate, and one whose elements all do not satisfy the predicate.\n  _.partition = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var pass = [], fail = [];\n    _.each(obj, function(value, key, obj) {\n      (predicate(value, key, obj) ? pass : fail).push(value);\n    });\n    return [pass, fail];\n  };\n\n  // Array Functions\n  // ---------------\n\n  // Get the first element of an array. Passing **n** will return the first N\n  // values in the array. Aliased as `head` and `take`. The **guard** check\n  // allows it to work with `_.map`.\n  _.first = _.head = _.take = function(array, n, guard) {\n    if (array == null) return void 0;\n    if (n == null || guard) return array[0];\n    return _.initial(array, array.length - n);\n  };\n\n  // Returns everything but the last entry of the array. Especially useful on\n  // the arguments object. Passing **n** will return all the values in\n  // the array, excluding the last N.\n  _.initial = function(array, n, guard) {\n    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n  };\n\n  // Get the last element of an array. Passing **n** will return the last N\n  // values in the array.\n  _.last = function(array, n, guard) {\n    if (array == null) return void 0;\n    if (n == null || guard) return array[array.length - 1];\n    return _.rest(array, Math.max(0, array.length - n));\n  };\n\n  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n  // Especially useful on the arguments object. Passing an **n** will return\n  // the rest N values in the array.\n  _.rest = _.tail = _.drop = function(array, n, guard) {\n    return slice.call(array, n == null || guard ? 1 : n);\n  };\n\n  // Trim out all falsy values from an array.\n  _.compact = function(array) {\n    return _.filter(array, _.identity);\n  };\n\n  // Internal implementation of a recursive `flatten` function.\n  var flatten = function(input, shallow, strict, startIndex) {\n    var output = [], idx = 0;\n    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {\n      var value = input[i];\n      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n        //flatten current level of array or arguments object\n        if (!shallow) value = flatten(value, shallow, strict);\n        var j = 0, len = value.length;\n        output.length += len;\n        while (j < len) {\n          output[idx++] = value[j++];\n        }\n      } else if (!strict) {\n        output[idx++] = value;\n      }\n    }\n    return output;\n  };\n\n  // Flatten out an array, either recursively (by default), or just one level.\n  _.flatten = function(array, shallow) {\n    return flatten(array, shallow, false);\n  };\n\n  // Return a version of the array that does not contain the specified value(s).\n  _.without = function(array) {\n    return _.difference(array, slice.call(arguments, 1));\n  };\n\n  // Produce a duplicate-free version of the array. If the array has already\n  // been sorted, you have the option of using a faster algorithm.\n  // Aliased as `unique`.\n  _.uniq = _.unique = function(array, isSorted, iteratee, context) {\n    if (!_.isBoolean(isSorted)) {\n      context = iteratee;\n      iteratee = isSorted;\n      isSorted = false;\n    }\n    if (iteratee != null) iteratee = cb(iteratee, context);\n    var result = [];\n    var seen = [];\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var value = array[i],\n          computed = iteratee ? iteratee(value, i, array) : value;\n      if (isSorted) {\n        if (!i || seen !== computed) result.push(value);\n        seen = computed;\n      } else if (iteratee) {\n        if (!_.contains(seen, computed)) {\n          seen.push(computed);\n          result.push(value);\n        }\n      } else if (!_.contains(result, value)) {\n        result.push(value);\n      }\n    }\n    return result;\n  };\n\n  // Produce an array that contains the union: each distinct element from all of\n  // the passed-in arrays.\n  _.union = function() {\n    return _.uniq(flatten(arguments, true, true));\n  };\n\n  // Produce an array that contains every item shared between all the\n  // passed-in arrays.\n  _.intersection = function(array) {\n    var result = [];\n    var argsLength = arguments.length;\n    for (var i = 0, length = getLength(array); i < length; i++) {\n      var item = array[i];\n      if (_.contains(result, item)) continue;\n      for (var j = 1; j < argsLength; j++) {\n        if (!_.contains(arguments[j], item)) break;\n      }\n      if (j === argsLength) result.push(item);\n    }\n    return result;\n  };\n\n  // Take the difference between one array and a number of other arrays.\n  // Only the elements present in just the first array will remain.\n  _.difference = function(array) {\n    var rest = flatten(arguments, true, true, 1);\n    return _.filter(array, function(value){\n      return !_.contains(rest, value);\n    });\n  };\n\n  // Zip together multiple lists into a single array -- elements that share\n  // an index go together.\n  _.zip = function() {\n    return _.unzip(arguments);\n  };\n\n  // Complement of _.zip. Unzip accepts an array of arrays and groups\n  // each array's elements on shared indices\n  _.unzip = function(array) {\n    var length = array && _.max(array, getLength).length || 0;\n    var result = Array(length);\n\n    for (var index = 0; index < length; index++) {\n      result[index] = _.pluck(array, index);\n    }\n    return result;\n  };\n\n  // Converts lists into objects. Pass either a single array of `[key, value]`\n  // pairs, or two parallel arrays of the same length -- one of keys, and one of\n  // the corresponding values.\n  _.object = function(list, values) {\n    var result = {};\n    for (var i = 0, length = getLength(list); i < length; i++) {\n      if (values) {\n        result[list[i]] = values[i];\n      } else {\n        result[list[i][0]] = list[i][1];\n      }\n    }\n    return result;\n  };\n\n  // Generator function to create the findIndex and findLastIndex functions\n  function createPredicateIndexFinder(dir) {\n    return function(array, predicate, context) {\n      predicate = cb(predicate, context);\n      var length = getLength(array);\n      var index = dir > 0 ? 0 : length - 1;\n      for (; index >= 0 && index < length; index += dir) {\n        if (predicate(array[index], index, array)) return index;\n      }\n      return -1;\n    };\n  }\n\n  // Returns the first index on an array-like that passes a predicate test\n  _.findIndex = createPredicateIndexFinder(1);\n  _.findLastIndex = createPredicateIndexFinder(-1);\n\n  // Use a comparator function to figure out the smallest index at which\n  // an object should be inserted so as to maintain order. Uses binary search.\n  _.sortedIndex = function(array, obj, iteratee, context) {\n    iteratee = cb(iteratee, context, 1);\n    var value = iteratee(obj);\n    var low = 0, high = getLength(array);\n    while (low < high) {\n      var mid = Math.floor((low + high) / 2);\n      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n    }\n    return low;\n  };\n\n  // Generator function to create the indexOf and lastIndexOf functions\n  function createIndexFinder(dir, predicateFind, sortedIndex) {\n    return function(array, item, idx) {\n      var i = 0, length = getLength(array);\n      if (typeof idx == 'number') {\n        if (dir > 0) {\n            i = idx >= 0 ? idx : Math.max(idx + length, i);\n        } else {\n            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n        }\n      } else if (sortedIndex && idx && length) {\n        idx = sortedIndex(array, item);\n        return array[idx] === item ? idx : -1;\n      }\n      if (item !== item) {\n        idx = predicateFind(slice.call(array, i, length), _.isNaN);\n        return idx >= 0 ? idx + i : -1;\n      }\n      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n        if (array[idx] === item) return idx;\n      }\n      return -1;\n    };\n  }\n\n  // Return the position of the first occurrence of an item in an array,\n  // or -1 if the item is not included in the array.\n  // If the array is large and already in sort order, pass `true`\n  // for **isSorted** to use binary search.\n  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n  // Generate an integer Array containing an arithmetic progression. A port of\n  // the native Python `range()` function. See\n  // [the Python documentation](http://docs.python.org/library/functions.html#range).\n  _.range = function(start, stop, step) {\n    if (stop == null) {\n      stop = start || 0;\n      start = 0;\n    }\n    step = step || 1;\n\n    var length = Math.max(Math.ceil((stop - start) / step), 0);\n    var range = Array(length);\n\n    for (var idx = 0; idx < length; idx++, start += step) {\n      range[idx] = start;\n    }\n\n    return range;\n  };\n\n  // Function (ahem) Functions\n  // ------------------\n\n  // Determines whether to execute a function as a constructor\n  // or a normal function with the provided arguments\n  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n    var self = baseCreate(sourceFunc.prototype);\n    var result = sourceFunc.apply(self, args);\n    if (_.isObject(result)) return result;\n    return self;\n  };\n\n  // Create a function bound to a given object (assigning `this`, and arguments,\n  // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n  // available.\n  _.bind = function(func, context) {\n    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\n    if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n    var args = slice.call(arguments, 2);\n    var bound = function() {\n      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\n    };\n    return bound;\n  };\n\n  // Partially apply a function by creating a version that has had some of its\n  // arguments pre-filled, without changing its dynamic `this` context. _ acts\n  // as a placeholder, allowing any combination of arguments to be pre-filled.\n  _.partial = function(func) {\n    var boundArgs = slice.call(arguments, 1);\n    var bound = function() {\n      var position = 0, length = boundArgs.length;\n      var args = Array(length);\n      for (var i = 0; i < length; i++) {\n        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\n      }\n      while (position < arguments.length) args.push(arguments[position++]);\n      return executeBound(func, bound, this, this, args);\n    };\n    return bound;\n  };\n\n  // Bind a number of an object's methods to that object. Remaining arguments\n  // are the method names to be bound. Useful for ensuring that all callbacks\n  // defined on an object belong to it.\n  _.bindAll = function(obj) {\n    var i, length = arguments.length, key;\n    if (length <= 1) throw new Error('bindAll must be passed function names');\n    for (i = 1; i < length; i++) {\n      key = arguments[i];\n      obj[key] = _.bind(obj[key], obj);\n    }\n    return obj;\n  };\n\n  // Memoize an expensive function by storing its results.\n  _.memoize = function(func, hasher) {\n    var memoize = function(key) {\n      var cache = memoize.cache;\n      var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\n      return cache[address];\n    };\n    memoize.cache = {};\n    return memoize;\n  };\n\n  // Delays a function for the given number of milliseconds, and then calls\n  // it with the arguments supplied.\n  _.delay = function(func, wait) {\n    var args = slice.call(arguments, 2);\n    return setTimeout(function(){\n      return func.apply(null, args);\n    }, wait);\n  };\n\n  // Defers a function, scheduling it to run after the current call stack has\n  // cleared.\n  _.defer = _.partial(_.delay, _, 1);\n\n  // Returns a function, that, when invoked, will only be triggered at most once\n  // during a given window of time. Normally, the throttled function will run\n  // as much as it can, without ever going more than once per `wait` duration;\n  // but if you'd like to disable the execution on the leading edge, pass\n  // `{leading: false}`. To disable execution on the trailing edge, ditto.\n  _.throttle = function(func, wait, options) {\n    var context, args, result;\n    var timeout = null;\n    var previous = 0;\n    if (!options) options = {};\n    var later = function() {\n      previous = options.leading === false ? 0 : _.now();\n      timeout = null;\n      result = func.apply(context, args);\n      if (!timeout) context = args = null;\n    };\n    return function() {\n      var now = _.now();\n      if (!previous && options.leading === false) previous = now;\n      var remaining = wait - (now - previous);\n      context = this;\n      args = arguments;\n      if (remaining <= 0 || remaining > wait) {\n        if (timeout) {\n          clearTimeout(timeout);\n          timeout = null;\n        }\n        previous = now;\n        result = func.apply(context, args);\n        if (!timeout) context = args = null;\n      } else if (!timeout && options.trailing !== false) {\n        timeout = setTimeout(later, remaining);\n      }\n      return result;\n    };\n  };\n\n  // Returns a function, that, as long as it continues to be invoked, will not\n  // be triggered. The function will be called after it stops being called for\n  // N milliseconds. If `immediate` is passed, trigger the function on the\n  // leading edge, instead of the trailing.\n  _.debounce = function(func, wait, immediate) {\n    var timeout, args, context, timestamp, result;\n\n    var later = function() {\n      var last = _.now() - timestamp;\n\n      if (last < wait && last >= 0) {\n        timeout = setTimeout(later, wait - last);\n      } else {\n        timeout = null;\n        if (!immediate) {\n          result = func.apply(context, args);\n          if (!timeout) context = args = null;\n        }\n      }\n    };\n\n    return function() {\n      context = this;\n      args = arguments;\n      timestamp = _.now();\n      var callNow = immediate && !timeout;\n      if (!timeout) timeout = setTimeout(later, wait);\n      if (callNow) {\n        result = func.apply(context, args);\n        context = args = null;\n      }\n\n      return result;\n    };\n  };\n\n  // Returns the first function passed as an argument to the second,\n  // allowing you to adjust arguments, run code before and after, and\n  // conditionally execute the original function.\n  _.wrap = function(func, wrapper) {\n    return _.partial(wrapper, func);\n  };\n\n  // Returns a negated version of the passed-in predicate.\n  _.negate = function(predicate) {\n    return function() {\n      return !predicate.apply(this, arguments);\n    };\n  };\n\n  // Returns a function that is the composition of a list of functions, each\n  // consuming the return value of the function that follows.\n  _.compose = function() {\n    var args = arguments;\n    var start = args.length - 1;\n    return function() {\n      var i = start;\n      var result = args[start].apply(this, arguments);\n      while (i--) result = args[i].call(this, result);\n      return result;\n    };\n  };\n\n  // Returns a function that will only be executed on and after the Nth call.\n  _.after = function(times, func) {\n    return function() {\n      if (--times < 1) {\n        return func.apply(this, arguments);\n      }\n    };\n  };\n\n  // Returns a function that will only be executed up to (but not including) the Nth call.\n  _.before = function(times, func) {\n    var memo;\n    return function() {\n      if (--times > 0) {\n        memo = func.apply(this, arguments);\n      }\n      if (times <= 1) func = null;\n      return memo;\n    };\n  };\n\n  // Returns a function that will be executed at most one time, no matter how\n  // often you call it. Useful for lazy initialization.\n  _.once = _.partial(_.before, 2);\n\n  // Object Functions\n  // ----------------\n\n  // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n  var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n  var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n                      'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n  function collectNonEnumProps(obj, keys) {\n    var nonEnumIdx = nonEnumerableProps.length;\n    var constructor = obj.constructor;\n    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;\n\n    // Constructor is a special case.\n    var prop = 'constructor';\n    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n    while (nonEnumIdx--) {\n      prop = nonEnumerableProps[nonEnumIdx];\n      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n        keys.push(prop);\n      }\n    }\n  }\n\n  // Retrieve the names of an object's own properties.\n  // Delegates to **ECMAScript 5**'s native `Object.keys`\n  _.keys = function(obj) {\n    if (!_.isObject(obj)) return [];\n    if (nativeKeys) return nativeKeys(obj);\n    var keys = [];\n    for (var key in obj) if (_.has(obj, key)) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  };\n\n  // Retrieve all the property names of an object.\n  _.allKeys = function(obj) {\n    if (!_.isObject(obj)) return [];\n    var keys = [];\n    for (var key in obj) keys.push(key);\n    // Ahem, IE < 9.\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\n    return keys;\n  };\n\n  // Retrieve the values of an object's properties.\n  _.values = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var values = Array(length);\n    for (var i = 0; i < length; i++) {\n      values[i] = obj[keys[i]];\n    }\n    return values;\n  };\n\n  // Returns the results of applying the iteratee to each element of the object\n  // In contrast to _.map it returns an object\n  _.mapObject = function(obj, iteratee, context) {\n    iteratee = cb(iteratee, context);\n    var keys =  _.keys(obj),\n          length = keys.length,\n          results = {},\n          currentKey;\n      for (var index = 0; index < length; index++) {\n        currentKey = keys[index];\n        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n      }\n      return results;\n  };\n\n  // Convert an object into a list of `[key, value]` pairs.\n  _.pairs = function(obj) {\n    var keys = _.keys(obj);\n    var length = keys.length;\n    var pairs = Array(length);\n    for (var i = 0; i < length; i++) {\n      pairs[i] = [keys[i], obj[keys[i]]];\n    }\n    return pairs;\n  };\n\n  // Invert the keys and values of an object. The values must be serializable.\n  _.invert = function(obj) {\n    var result = {};\n    var keys = _.keys(obj);\n    for (var i = 0, length = keys.length; i < length; i++) {\n      result[obj[keys[i]]] = keys[i];\n    }\n    return result;\n  };\n\n  // Return a sorted list of the function names available on the object.\n  // Aliased as `methods`\n  _.functions = _.methods = function(obj) {\n    var names = [];\n    for (var key in obj) {\n      if (_.isFunction(obj[key])) names.push(key);\n    }\n    return names.sort();\n  };\n\n  // Extend a given object with all the properties in passed-in object(s).\n  _.extend = createAssigner(_.allKeys);\n\n  // Assigns a given object with all the own properties in the passed-in object(s)\n  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n  _.extendOwn = _.assign = createAssigner(_.keys);\n\n  // Returns the first key on an object that passes a predicate test\n  _.findKey = function(obj, predicate, context) {\n    predicate = cb(predicate, context);\n    var keys = _.keys(obj), key;\n    for (var i = 0, length = keys.length; i < length; i++) {\n      key = keys[i];\n      if (predicate(obj[key], key, obj)) return key;\n    }\n  };\n\n  // Return a copy of the object only containing the whitelisted properties.\n  _.pick = function(object, oiteratee, context) {\n    var result = {}, obj = object, iteratee, keys;\n    if (obj == null) return result;\n    if (_.isFunction(oiteratee)) {\n      keys = _.allKeys(obj);\n      iteratee = optimizeCb(oiteratee, context);\n    } else {\n      keys = flatten(arguments, false, false, 1);\n      iteratee = function(value, key, obj) { return key in obj; };\n      obj = Object(obj);\n    }\n    for (var i = 0, length = keys.length; i < length; i++) {\n      var key = keys[i];\n      var value = obj[key];\n      if (iteratee(value, key, obj)) result[key] = value;\n    }\n    return result;\n  };\n\n   // Return a copy of the object without the blacklisted properties.\n  _.omit = function(obj, iteratee, context) {\n    if (_.isFunction(iteratee)) {\n      iteratee = _.negate(iteratee);\n    } else {\n      var keys = _.map(flatten(arguments, false, false, 1), String);\n      iteratee = function(value, key) {\n        return !_.contains(keys, key);\n      };\n    }\n    return _.pick(obj, iteratee, context);\n  };\n\n  // Fill in a given object with default properties.\n  _.defaults = createAssigner(_.allKeys, true);\n\n  // Creates an object that inherits from the given prototype object.\n  // If additional properties are provided then they will be added to the\n  // created object.\n  _.create = function(prototype, props) {\n    var result = baseCreate(prototype);\n    if (props) _.extendOwn(result, props);\n    return result;\n  };\n\n  // Create a (shallow-cloned) duplicate of an object.\n  _.clone = function(obj) {\n    if (!_.isObject(obj)) return obj;\n    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n  };\n\n  // Invokes interceptor with the obj, and then returns obj.\n  // The primary purpose of this method is to \"tap into\" a method chain, in\n  // order to perform operations on intermediate results within the chain.\n  _.tap = function(obj, interceptor) {\n    interceptor(obj);\n    return obj;\n  };\n\n  // Returns whether an object has a given set of `key:value` pairs.\n  _.isMatch = function(object, attrs) {\n    var keys = _.keys(attrs), length = keys.length;\n    if (object == null) return !length;\n    var obj = Object(object);\n    for (var i = 0; i < length; i++) {\n      var key = keys[i];\n      if (attrs[key] !== obj[key] || !(key in obj)) return false;\n    }\n    return true;\n  };\n\n\n  // Internal recursive comparison function for `isEqual`.\n  var eq = function(a, b, aStack, bStack) {\n    // Identical objects are equal. `0 === -0`, but they aren't identical.\n    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n    if (a === b) return a !== 0 || 1 / a === 1 / b;\n    // A strict comparison is necessary because `null == undefined`.\n    if (a == null || b == null) return a === b;\n    // Unwrap any wrapped objects.\n    if (a instanceof _) a = a._wrapped;\n    if (b instanceof _) b = b._wrapped;\n    // Compare `[[Class]]` names.\n    var className = toString.call(a);\n    if (className !== toString.call(b)) return false;\n    switch (className) {\n      // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n      case '[object RegExp]':\n      // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n      case '[object String]':\n        // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n        // equivalent to `new String(\"5\")`.\n        return '' + a === '' + b;\n      case '[object Number]':\n        // `NaN`s are equivalent, but non-reflexive.\n        // Object(NaN) is equivalent to NaN\n        if (+a !== +a) return +b !== +b;\n        // An `egal` comparison is performed for other numeric values.\n        return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n      case '[object Date]':\n      case '[object Boolean]':\n        // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n        // millisecond representations. Note that invalid dates with millisecond representations\n        // of `NaN` are not equivalent.\n        return +a === +b;\n    }\n\n    var areArrays = className === '[object Array]';\n    if (!areArrays) {\n      if (typeof a != 'object' || typeof b != 'object') return false;\n\n      // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n      // from different frames are.\n      var aCtor = a.constructor, bCtor = b.constructor;\n      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\n                               _.isFunction(bCtor) && bCtor instanceof bCtor)\n                          && ('constructor' in a && 'constructor' in b)) {\n        return false;\n      }\n    }\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n    // Initializing stack of traversed objects.\n    // It's done here since we only need them for objects and arrays comparison.\n    aStack = aStack || [];\n    bStack = bStack || [];\n    var length = aStack.length;\n    while (length--) {\n      // Linear search. Performance is inversely proportional to the number of\n      // unique nested structures.\n      if (aStack[length] === a) return bStack[length] === b;\n    }\n\n    // Add the first object to the stack of traversed objects.\n    aStack.push(a);\n    bStack.push(b);\n\n    // Recursively compare objects and arrays.\n    if (areArrays) {\n      // Compare array lengths to determine if a deep comparison is necessary.\n      length = a.length;\n      if (length !== b.length) return false;\n      // Deep compare the contents, ignoring non-numeric properties.\n      while (length--) {\n        if (!eq(a[length], b[length], aStack, bStack)) return false;\n      }\n    } else {\n      // Deep compare objects.\n      var keys = _.keys(a), key;\n      length = keys.length;\n      // Ensure that both objects contain the same number of properties before comparing deep equality.\n      if (_.keys(b).length !== length) return false;\n      while (length--) {\n        // Deep compare each member\n        key = keys[length];\n        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n      }\n    }\n    // Remove the first object from the stack of traversed objects.\n    aStack.pop();\n    bStack.pop();\n    return true;\n  };\n\n  // Perform a deep comparison to check if two objects are equal.\n  _.isEqual = function(a, b) {\n    return eq(a, b);\n  };\n\n  // Is a given array, string, or object empty?\n  // An \"empty\" object has no enumerable own-properties.\n  _.isEmpty = function(obj) {\n    if (obj == null) return true;\n    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n    return _.keys(obj).length === 0;\n  };\n\n  // Is a given value a DOM element?\n  _.isElement = function(obj) {\n    return !!(obj && obj.nodeType === 1);\n  };\n\n  // Is a given value an array?\n  // Delegates to ECMA5's native Array.isArray\n  _.isArray = nativeIsArray || function(obj) {\n    return toString.call(obj) === '[object Array]';\n  };\n\n  // Is a given variable an object?\n  _.isObject = function(obj) {\n    var type = typeof obj;\n    return type === 'function' || type === 'object' && !!obj;\n  };\n\n  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\n  _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) {\n    _['is' + name] = function(obj) {\n      return toString.call(obj) === '[object ' + name + ']';\n    };\n  });\n\n  // Define a fallback version of the method in browsers (ahem, IE < 9), where\n  // there isn't any inspectable \"Arguments\" type.\n  if (!_.isArguments(arguments)) {\n    _.isArguments = function(obj) {\n      return _.has(obj, 'callee');\n    };\n  }\n\n  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n  // IE 11 (#1621), and in Safari 8 (#1929).\n  if (typeof /./ != 'function' && typeof Int8Array != 'object') {\n    _.isFunction = function(obj) {\n      return typeof obj == 'function' || false;\n    };\n  }\n\n  // Is a given object a finite number?\n  _.isFinite = function(obj) {\n    return isFinite(obj) && !isNaN(parseFloat(obj));\n  };\n\n  // Is the given value `NaN`? (NaN is the only number which does not equal itself).\n  _.isNaN = function(obj) {\n    return _.isNumber(obj) && obj !== +obj;\n  };\n\n  // Is a given value a boolean?\n  _.isBoolean = function(obj) {\n    return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n  };\n\n  // Is a given value equal to null?\n  _.isNull = function(obj) {\n    return obj === null;\n  };\n\n  // Is a given variable undefined?\n  _.isUndefined = function(obj) {\n    return obj === void 0;\n  };\n\n  // Shortcut function for checking if an object has a given property directly\n  // on itself (in other words, not on a prototype).\n  _.has = function(obj, key) {\n    return obj != null && hasOwnProperty.call(obj, key);\n  };\n\n  // Utility Functions\n  // -----------------\n\n  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n  // previous owner. Returns a reference to the Underscore object.\n  _.noConflict = function() {\n    root._ = previousUnderscore;\n    return this;\n  };\n\n  // Keep the identity function around for default iteratees.\n  _.identity = function(value) {\n    return value;\n  };\n\n  // Predicate-generating functions. Often useful outside of Underscore.\n  _.constant = function(value) {\n    return function() {\n      return value;\n    };\n  };\n\n  _.noop = function(){};\n\n  _.property = property;\n\n  // Generates a function for a given object that returns a given property.\n  _.propertyOf = function(obj) {\n    return obj == null ? function(){} : function(key) {\n      return obj[key];\n    };\n  };\n\n  // Returns a predicate for checking whether an object has a given set of\n  // `key:value` pairs.\n  _.matcher = _.matches = function(attrs) {\n    attrs = _.extendOwn({}, attrs);\n    return function(obj) {\n      return _.isMatch(obj, attrs);\n    };\n  };\n\n  // Run a function **n** times.\n  _.times = function(n, iteratee, context) {\n    var accum = Array(Math.max(0, n));\n    iteratee = optimizeCb(iteratee, context, 1);\n    for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n    return accum;\n  };\n\n  // Return a random integer between min and max (inclusive).\n  _.random = function(min, max) {\n    if (max == null) {\n      max = min;\n      min = 0;\n    }\n    return min + Math.floor(Math.random() * (max - min + 1));\n  };\n\n  // A (possibly faster) way to get the current timestamp as an integer.\n  _.now = Date.now || function() {\n    return new Date().getTime();\n  };\n\n   // List of HTML entities for escaping.\n  var escapeMap = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;'\n  };\n  var unescapeMap = _.invert(escapeMap);\n\n  // Functions for escaping and unescaping strings to/from HTML interpolation.\n  var createEscaper = function(map) {\n    var escaper = function(match) {\n      return map[match];\n    };\n    // Regexes for identifying a key that needs to be escaped\n    var source = '(?:' + _.keys(map).join('|') + ')';\n    var testRegexp = RegExp(source);\n    var replaceRegexp = RegExp(source, 'g');\n    return function(string) {\n      string = string == null ? '' : '' + string;\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n    };\n  };\n  _.escape = createEscaper(escapeMap);\n  _.unescape = createEscaper(unescapeMap);\n\n  // If the value of the named `property` is a function then invoke it with the\n  // `object` as context; otherwise, return it.\n  _.result = function(object, property, fallback) {\n    var value = object == null ? void 0 : object[property];\n    if (value === void 0) {\n      value = fallback;\n    }\n    return _.isFunction(value) ? value.call(object) : value;\n  };\n\n  // Generate a unique integer id (unique within the entire client session).\n  // Useful for temporary DOM ids.\n  var idCounter = 0;\n  _.uniqueId = function(prefix) {\n    var id = ++idCounter + '';\n    return prefix ? prefix + id : id;\n  };\n\n  // By default, Underscore uses ERB-style template delimiters, change the\n  // following template settings to use alternative delimiters.\n  _.templateSettings = {\n    evaluate    : /<%([\\s\\S]+?)%>/g,\n    interpolate : /<%=([\\s\\S]+?)%>/g,\n    escape      : /<%-([\\s\\S]+?)%>/g\n  };\n\n  // When customizing `templateSettings`, if you don't want to define an\n  // interpolation, evaluation or escaping regex, we need one that is\n  // guaranteed not to match.\n  var noMatch = /(.)^/;\n\n  // Certain characters need to be escaped so that they can be put into a\n  // string literal.\n  var escapes = {\n    \"'\":      \"'\",\n    '\\\\':     '\\\\',\n    '\\r':     'r',\n    '\\n':     'n',\n    '\\u2028': 'u2028',\n    '\\u2029': 'u2029'\n  };\n\n  var escaper = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n  var escapeChar = function(match) {\n    return '\\\\' + escapes[match];\n  };\n\n  // JavaScript micro-templating, similar to John Resig's implementation.\n  // Underscore templating handles arbitrary delimiters, preserves whitespace,\n  // and correctly escapes quotes within interpolated code.\n  // NB: `oldSettings` only exists for backwards compatibility.\n  _.template = function(text, settings, oldSettings) {\n    if (!settings && oldSettings) settings = oldSettings;\n    settings = _.defaults({}, settings, _.templateSettings);\n\n    // Combine delimiters into one regular expression via alternation.\n    var matcher = RegExp([\n      (settings.escape || noMatch).source,\n      (settings.interpolate || noMatch).source,\n      (settings.evaluate || noMatch).source\n    ].join('|') + '|$', 'g');\n\n    // Compile the template source, escaping string literals appropriately.\n    var index = 0;\n    var source = \"__p+='\";\n    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n      source += text.slice(index, offset).replace(escaper, escapeChar);\n      index = offset + match.length;\n\n      if (escape) {\n        source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n      } else if (interpolate) {\n        source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n      } else if (evaluate) {\n        source += \"';\\n\" + evaluate + \"\\n__p+='\";\n      }\n\n      // Adobe VMs need the match returned to produce the correct offest.\n      return match;\n    });\n    source += \"';\\n\";\n\n    // If a variable is not specified, place data values in local scope.\n    if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n    source = \"var __t,__p='',__j=Array.prototype.join,\" +\n      \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n      source + 'return __p;\\n';\n\n    try {\n      var render = new Function(settings.variable || 'obj', '_', source);\n    } catch (e) {\n      e.source = source;\n      throw e;\n    }\n\n    var template = function(data) {\n      return render.call(this, data, _);\n    };\n\n    // Provide the compiled source as a convenience for precompilation.\n    var argument = settings.variable || 'obj';\n    template.source = 'function(' + argument + '){\\n' + source + '}';\n\n    return template;\n  };\n\n  // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n  _.chain = function(obj) {\n    var instance = _(obj);\n    instance._chain = true;\n    return instance;\n  };\n\n  // OOP\n  // ---------------\n  // If Underscore is called as a function, it returns a wrapped object that\n  // can be used OO-style. This wrapper holds altered versions of all the\n  // underscore functions. Wrapped objects may be chained.\n\n  // Helper function to continue chaining intermediate results.\n  var result = function(instance, obj) {\n    return instance._chain ? _(obj).chain() : obj;\n  };\n\n  // Add your own custom functions to the Underscore object.\n  _.mixin = function(obj) {\n    _.each(_.functions(obj), function(name) {\n      var func = _[name] = obj[name];\n      _.prototype[name] = function() {\n        var args = [this._wrapped];\n        push.apply(args, arguments);\n        return result(this, func.apply(_, args));\n      };\n    });\n  };\n\n  // Add all of the Underscore functions to the wrapper object.\n  _.mixin(_);\n\n  // Add all mutator Array functions to the wrapper.\n  _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n    var method = ArrayProto[name];\n    _.prototype[name] = function() {\n      var obj = this._wrapped;\n      method.apply(obj, arguments);\n      if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n      return result(this, obj);\n    };\n  });\n\n  // Add all accessor Array functions to the wrapper.\n  _.each(['concat', 'join', 'slice'], function(name) {\n    var method = ArrayProto[name];\n    _.prototype[name] = function() {\n      return result(this, method.apply(this._wrapped, arguments));\n    };\n  });\n\n  // Extracts the result from a wrapped and chained object.\n  _.prototype.value = function() {\n    return this._wrapped;\n  };\n\n  // Provide unwrapping proxy for some methods used in engine operations\n  // such as arithmetic and JSON stringification.\n  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n  _.prototype.toString = function() {\n    return '' + this._wrapped;\n  };\n\n  // AMD registration happens at the end for compatibility with AMD loaders\n  // that may not enforce next-turn semantics on modules. Even though general\n  // practice for AMD registration is to be anonymous, underscore registers\n  // as a named module because, like jQuery, it is a base library that is\n  // popular enough to be bundled in a third party lib, but not be part of\n  // an AMD load request. Those cases could generate an error when an\n  // anonymous define() is called outside of a loader request.\n  if (true) {\n    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {\n      return _;\n    }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n  }\n}.call(this));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/underscore/underscore.js\n// module id = 11\n// module chunks = 0\n\n//# sourceURL=../node_modules/underscore/underscore.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\n\nexports.default = function (tasks, callback) {\n    callback = (0, _once2.default)(callback || _noop2.default);\n    if (!(0, _isArray2.default)(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n    if (!tasks.length) return callback();\n    var taskIndex = 0;\n\n    function nextTask(args) {\n        var task = (0, _wrapAsync2.default)(tasks[taskIndex++]);\n        args.push((0, _onlyOnce2.default)(next));\n        task.apply(null, args);\n    }\n\n    function next(err /*, ...args*/) {\n        if (err || taskIndex === tasks.length) {\n            return callback.apply(null, arguments);\n        }\n        nextTask((0, _slice2.default)(arguments, 1));\n    }\n\n    nextTask([]);\n};\n\nvar _isArray = __webpack_require__(285);\n\nvar _isArray2 = _interopRequireDefault(_isArray);\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(221);\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n *     function(callback) {\n *         callback(null, 'one', 'two');\n *     },\n *     function(arg1, arg2, callback) {\n *         // arg1 now equals 'one' and arg2 now equals 'two'\n *         callback(null, 'three');\n *     },\n *     function(arg1, callback) {\n *         // arg1 now equals 'three'\n *         callback(null, 'done');\n *     }\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n *     myFirstFunction,\n *     mySecondFunction,\n *     myLastFunction,\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n *     callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n *     // arg1 now equals 'one' and arg2 now equals 'two'\n *     callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n *     // arg1 now equals 'three'\n *     callback(null, 'done');\n * }\n */\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/waterfall.js\n// module id = 12\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/waterfall.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar errors = __webpack_require__(56);\nvar _ = __webpack_require__(10);\n\nmodule.exports = {\n  checkState: function(condition, message) {\n    if (!condition) {\n      throw new errors.InvalidState(message);\n    }\n  },\n  checkArgument: function(condition, argumentName, message, docsPath) {\n    if (!condition) {\n      throw new errors.InvalidArgument(argumentName, message, docsPath);\n    }\n  },\n  checkArgumentType: function(argument, type, argumentName) {\n    argumentName = argumentName || '(unknown name)';\n    if (_.isString(type)) {\n      if (type === 'Buffer') {\n        var BufferUtil = __webpack_require__(18);\n        if (!BufferUtil.isBuffer(argument)) {\n          throw new errors.InvalidArgumentType(argument, type, argumentName);\n        }\n      } else if (typeof argument !== type) {\n        throw new errors.InvalidArgumentType(argument, type, argumentName);\n      }\n    } else {\n      if (!(argument instanceof type)) {\n        throw new errors.InvalidArgumentType(argument, type.name, argumentName);\n      }\n    }\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/util/preconditions.js\n// module id = 13\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/util/preconditions.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(32)\nconst multibase = __webpack_require__(1105)\nconst multicodec = __webpack_require__(1106)\nconst codecs = __webpack_require__(195)\nconst codecVarints = __webpack_require__(474)\nconst multihash = __webpack_require__(32)\nconst CIDUtil = __webpack_require__(671)\n\n/**\n * @typedef {Object} SerializedCID\n * @param {string} codec\n * @param {number} version\n * @param {Buffer} multihash\n *\n */\n\n/**\n * Class representing a CID `<mbase><version><mcodec><mhash>`\n * , as defined in [ipld/cid](https://github.com/ipld/cid).\n * @class CID\n */\nclass CID {\n  /**\n   * Create a new CID.\n   *\n   * The algorithm for argument input is roughly:\n   * ```\n   * if (str)\n   *   if (1st char is on multibase table) -> CID String\n   *   else -> bs58 encoded multihash\n   * else if (Buffer)\n   *   if (0 or 1) -> CID\n   *   else -> multihash\n   * else if (Number)\n   *   -> construct CID by parts\n   *\n   * ..if only JS had traits..\n   * ```\n   *\n   * @param {string|Buffer} version\n   * @param {string} [codec]\n   * @param {Buffer} [multihash]\n   *\n   * @example\n   *\n   * new CID(<version>, <codec>, <multihash>)\n   * new CID(<cidStr>)\n   * new CID(<cid.buffer>)\n   * new CID(<multihash>)\n   * new CID(<bs58 encoded multihash>)\n   * new CID(<cid>)\n   *\n   */\n  constructor (version, codec, multihash) {\n    if (CID.isCID(version)) {\n      let cid = version\n      this.version = cid.version\n      this.codec = cid.codec\n      this.multihash = Buffer.from(cid.multihash)\n      return\n    }\n    if (typeof version === 'string') {\n      if (multibase.isEncoded(version)) { // CID String (encoded with multibase)\n        const cid = multibase.decode(version)\n        version = parseInt(cid.slice(0, 1).toString('hex'), 16)\n        codec = multicodec.getCodec(cid.slice(1))\n        multihash = multicodec.rmPrefix(cid.slice(1))\n      } else { // bs58 string encoded multihash\n        codec = 'dag-pb'\n        multihash = mh.fromB58String(version)\n        version = 0\n      }\n    } else if (Buffer.isBuffer(version)) {\n      const firstByte = version.slice(0, 1)\n      const v = parseInt(firstByte.toString('hex'), 16)\n      if (v === 0 || v === 1) { // CID\n        const cid = version\n        version = v\n        codec = multicodec.getCodec(cid.slice(1))\n        multihash = multicodec.rmPrefix(cid.slice(1))\n      } else { // multihash\n        codec = 'dag-pb'\n        multihash = version\n        version = 0\n      }\n    }\n\n    /**\n     * @type {string}\n     */\n    this.codec = codec\n\n    /**\n     * @type {number}\n     */\n    this.version = version\n\n    /**\n     * @type {Buffer}\n     */\n    this.multihash = multihash\n\n    CID.validateCID(this)\n  }\n\n  /**\n   * The CID as a `Buffer`\n   *\n   * @return {Buffer}\n   * @readonly\n   *\n   * @memberOf CID\n   */\n  get buffer () {\n    switch (this.version) {\n      case 0:\n        return this.multihash\n      case 1:\n        return Buffer.concat([\n          Buffer.from('01', 'hex'),\n          Buffer.from(codecVarints[this.codec]),\n          this.multihash\n        ])\n      default:\n        throw new Error('unsupported version')\n    }\n  }\n\n  /**\n   * Get the prefix of the CID.\n   *\n   * @returns {Buffer}\n   * @readonly\n   */\n  get prefix () {\n    return Buffer.concat([\n      Buffer.from(`0${this.version}`, 'hex'),\n      codecVarints[this.codec],\n      multihash.prefix(this.multihash)\n    ])\n  }\n\n  /**\n   * Convert to a CID of version `0`.\n   *\n   * @returns {CID}\n   */\n  toV0 () {\n    if (this.codec !== 'dag-pb') {\n      throw new Error('Cannot convert a non dag-pb CID to CIDv0')\n    }\n\n    return new CID(0, this.codec, this.multihash)\n  }\n\n  /**\n   * Convert to a CID of version `1`.\n   *\n   * @returns {CID}\n   */\n  toV1 () {\n    return new CID(1, this.codec, this.multihash)\n  }\n\n  /**\n   * Encode the CID into a string.\n   *\n   * @param {string} [base='base58btc'] - Base encoding to use.\n   * @returns {string}\n   */\n  toBaseEncodedString (base) {\n    base = base || 'base58btc'\n\n    switch (this.version) {\n      case 0: {\n        if (base !== 'base58btc') {\n          throw new Error('not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()')\n        }\n        return mh.toB58String(this.multihash)\n      }\n      case 1:\n        return multibase.encode(base, this.buffer).toString()\n      default:\n        throw new Error('Unsupported version')\n    }\n  }\n\n  /**\n   * Serialize to a plain object.\n   *\n   * @returns {SerializedCID}\n   */\n  toJSON () {\n    return {\n      codec: this.codec,\n      version: this.version,\n      hash: this.multihash\n    }\n  }\n\n  /**\n   * Compare equality with another CID.\n   *\n   * @param {CID} other\n   * @returns {bool}\n   */\n  equals (other) {\n    return this.codec === other.codec &&\n      this.version === other.version &&\n      this.multihash.equals(other.multihash)\n  }\n\n  /**\n   * Test if the given input is a CID.\n   *\n   * @param {any} other\n   * @returns {bool}\n   */\n  static isCID (other) {\n    return !(CIDUtil.checkCIDComponents(other))\n  }\n\n  /**\n   * Test if the given input is a valid CID object.\n   * Throws if it is not.\n   *\n   * @param {any} other\n   * @returns {void}\n   */\n  static validateCID (other) {\n    let errorMsg = CIDUtil.checkCIDComponents(other)\n    if (errorMsg) {\n      throw new Error(errorMsg)\n    }\n  }\n}\n\nCID.codecs = codecs\n\nmodule.exports = CID\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/cids/src/index.js\n// module id = 14\n// module chunks = 0\n\n//# sourceURL=../node_modules/cids/src/index.js")},function(module,exports){eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nfunction EventEmitter() {\n  this._events = this._events || {};\n  this._maxListeners = this._maxListeners || undefined;\n}\nmodule.exports = EventEmitter;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nEventEmitter.defaultMaxListeners = 10;\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function(n) {\n  if (!isNumber(n) || n < 0 || isNaN(n))\n    throw TypeError('n must be a positive number');\n  this._maxListeners = n;\n  return this;\n};\n\nEventEmitter.prototype.emit = function(type) {\n  var er, handler, len, args, i, listeners;\n\n  if (!this._events)\n    this._events = {};\n\n  // If there is no 'error' event listener then throw.\n  if (type === 'error') {\n    if (!this._events.error ||\n        (isObject(this._events.error) && !this._events.error.length)) {\n      er = arguments[1];\n      if (er instanceof Error) {\n        throw er; // Unhandled 'error' event\n      } else {\n        // At least give some kind of context to the user\n        var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n        err.context = er;\n        throw err;\n      }\n    }\n  }\n\n  handler = this._events[type];\n\n  if (isUndefined(handler))\n    return false;\n\n  if (isFunction(handler)) {\n    switch (arguments.length) {\n      // fast cases\n      case 1:\n        handler.call(this);\n        break;\n      case 2:\n        handler.call(this, arguments[1]);\n        break;\n      case 3:\n        handler.call(this, arguments[1], arguments[2]);\n        break;\n      // slower\n      default:\n        args = Array.prototype.slice.call(arguments, 1);\n        handler.apply(this, args);\n    }\n  } else if (isObject(handler)) {\n    args = Array.prototype.slice.call(arguments, 1);\n    listeners = handler.slice();\n    len = listeners.length;\n    for (i = 0; i < len; i++)\n      listeners[i].apply(this, args);\n  }\n\n  return true;\n};\n\nEventEmitter.prototype.addListener = function(type, listener) {\n  var m;\n\n  if (!isFunction(listener))\n    throw TypeError('listener must be a function');\n\n  if (!this._events)\n    this._events = {};\n\n  // To avoid recursion in the case that type === \"newListener\"! Before\n  // adding it to the listeners, first emit \"newListener\".\n  if (this._events.newListener)\n    this.emit('newListener', type,\n              isFunction(listener.listener) ?\n              listener.listener : listener);\n\n  if (!this._events[type])\n    // Optimize the case of one listener. Don't need the extra array object.\n    this._events[type] = listener;\n  else if (isObject(this._events[type]))\n    // If we've already got an array, just append.\n    this._events[type].push(listener);\n  else\n    // Adding the second element, need to change to array.\n    this._events[type] = [this._events[type], listener];\n\n  // Check for listener leak\n  if (isObject(this._events[type]) && !this._events[type].warned) {\n    if (!isUndefined(this._maxListeners)) {\n      m = this._maxListeners;\n    } else {\n      m = EventEmitter.defaultMaxListeners;\n    }\n\n    if (m && m > 0 && this._events[type].length > m) {\n      this._events[type].warned = true;\n      console.error('(node) warning: possible EventEmitter memory ' +\n                    'leak detected. %d listeners added. ' +\n                    'Use emitter.setMaxListeners() to increase limit.',\n                    this._events[type].length);\n      if (typeof console.trace === 'function') {\n        // not supported in IE 10\n        console.trace();\n      }\n    }\n  }\n\n  return this;\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.once = function(type, listener) {\n  if (!isFunction(listener))\n    throw TypeError('listener must be a function');\n\n  var fired = false;\n\n  function g() {\n    this.removeListener(type, g);\n\n    if (!fired) {\n      fired = true;\n      listener.apply(this, arguments);\n    }\n  }\n\n  g.listener = listener;\n  this.on(type, g);\n\n  return this;\n};\n\n// emits a 'removeListener' event iff the listener was removed\nEventEmitter.prototype.removeListener = function(type, listener) {\n  var list, position, length, i;\n\n  if (!isFunction(listener))\n    throw TypeError('listener must be a function');\n\n  if (!this._events || !this._events[type])\n    return this;\n\n  list = this._events[type];\n  length = list.length;\n  position = -1;\n\n  if (list === listener ||\n      (isFunction(list.listener) && list.listener === listener)) {\n    delete this._events[type];\n    if (this._events.removeListener)\n      this.emit('removeListener', type, listener);\n\n  } else if (isObject(list)) {\n    for (i = length; i-- > 0;) {\n      if (list[i] === listener ||\n          (list[i].listener && list[i].listener === listener)) {\n        position = i;\n        break;\n      }\n    }\n\n    if (position < 0)\n      return this;\n\n    if (list.length === 1) {\n      list.length = 0;\n      delete this._events[type];\n    } else {\n      list.splice(position, 1);\n    }\n\n    if (this._events.removeListener)\n      this.emit('removeListener', type, listener);\n  }\n\n  return this;\n};\n\nEventEmitter.prototype.removeAllListeners = function(type) {\n  var key, listeners;\n\n  if (!this._events)\n    return this;\n\n  // not listening for removeListener, no need to emit\n  if (!this._events.removeListener) {\n    if (arguments.length === 0)\n      this._events = {};\n    else if (this._events[type])\n      delete this._events[type];\n    return this;\n  }\n\n  // emit removeListener for all listeners on all events\n  if (arguments.length === 0) {\n    for (key in this._events) {\n      if (key === 'removeListener') continue;\n      this.removeAllListeners(key);\n    }\n    this.removeAllListeners('removeListener');\n    this._events = {};\n    return this;\n  }\n\n  listeners = this._events[type];\n\n  if (isFunction(listeners)) {\n    this.removeListener(type, listeners);\n  } else if (listeners) {\n    // LIFO order\n    while (listeners.length)\n      this.removeListener(type, listeners[listeners.length - 1]);\n  }\n  delete this._events[type];\n\n  return this;\n};\n\nEventEmitter.prototype.listeners = function(type) {\n  var ret;\n  if (!this._events || !this._events[type])\n    ret = [];\n  else if (isFunction(this._events[type]))\n    ret = [this._events[type]];\n  else\n    ret = this._events[type].slice();\n  return ret;\n};\n\nEventEmitter.prototype.listenerCount = function(type) {\n  if (this._events) {\n    var evlistener = this._events[type];\n\n    if (isFunction(evlistener))\n      return 1;\n    else if (evlistener)\n      return evlistener.length;\n  }\n  return 0;\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n  return emitter.listenerCount(type);\n};\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/events/events.js\n// module id = 15\n// module chunks = 0\n\n//# sourceURL=../node_modules/events/events.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {\n\n// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js\n// original notice:\n\n/*!\n * The buffer module from node.js, for the browser.\n *\n * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license  MIT\n */\nfunction compare(a, b) {\n  if (a === b) {\n    return 0;\n  }\n\n  var x = a.length;\n  var y = b.length;\n\n  for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n    if (a[i] !== b[i]) {\n      x = a[i];\n      y = b[i];\n      break;\n    }\n  }\n\n  if (x < y) {\n    return -1;\n  }\n  if (y < x) {\n    return 1;\n  }\n  return 0;\n}\nfunction isBuffer(b) {\n  if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {\n    return global.Buffer.isBuffer(b);\n  }\n  return !!(b != null && b._isBuffer);\n}\n\n// based on node assert, original notice:\n\n// http://wiki.commonjs.org/wiki/Unit_Testing/1.0\n//\n// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!\n//\n// Originally from narwhal.js (http://narwhaljs.org)\n// Copyright (c) 2009 Thomas Robinson <280north.com>\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the 'Software'), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar util = __webpack_require__(104);\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar pSlice = Array.prototype.slice;\nvar functionsHaveNames = (function () {\n  return function foo() {}.name === 'foo';\n}());\nfunction pToString (obj) {\n  return Object.prototype.toString.call(obj);\n}\nfunction isView(arrbuf) {\n  if (isBuffer(arrbuf)) {\n    return false;\n  }\n  if (typeof global.ArrayBuffer !== 'function') {\n    return false;\n  }\n  if (typeof ArrayBuffer.isView === 'function') {\n    return ArrayBuffer.isView(arrbuf);\n  }\n  if (!arrbuf) {\n    return false;\n  }\n  if (arrbuf instanceof DataView) {\n    return true;\n  }\n  if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {\n    return true;\n  }\n  return false;\n}\n// 1. The assert module provides functions that throw\n// AssertionError's when particular conditions are not met. The\n// assert module must conform to the following interface.\n\nvar assert = module.exports = ok;\n\n// 2. The AssertionError is defined in assert.\n// new assert.AssertionError({ message: message,\n//                             actual: actual,\n//                             expected: expected })\n\nvar regex = /\\s*function\\s+([^\\(\\s]*)\\s*/;\n// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js\nfunction getName(func) {\n  if (!util.isFunction(func)) {\n    return;\n  }\n  if (functionsHaveNames) {\n    return func.name;\n  }\n  var str = func.toString();\n  var match = str.match(regex);\n  return match && match[1];\n}\nassert.AssertionError = function AssertionError(options) {\n  this.name = 'AssertionError';\n  this.actual = options.actual;\n  this.expected = options.expected;\n  this.operator = options.operator;\n  if (options.message) {\n    this.message = options.message;\n    this.generatedMessage = false;\n  } else {\n    this.message = getMessage(this);\n    this.generatedMessage = true;\n  }\n  var stackStartFunction = options.stackStartFunction || fail;\n  if (Error.captureStackTrace) {\n    Error.captureStackTrace(this, stackStartFunction);\n  } else {\n    // non v8 browsers so we can have a stacktrace\n    var err = new Error();\n    if (err.stack) {\n      var out = err.stack;\n\n      // try to strip useless frames\n      var fn_name = getName(stackStartFunction);\n      var idx = out.indexOf('\\n' + fn_name);\n      if (idx >= 0) {\n        // once we have located the function frame\n        // we need to strip out everything before it (and its line)\n        var next_line = out.indexOf('\\n', idx + 1);\n        out = out.substring(next_line + 1);\n      }\n\n      this.stack = out;\n    }\n  }\n};\n\n// assert.AssertionError instanceof Error\nutil.inherits(assert.AssertionError, Error);\n\nfunction truncate(s, n) {\n  if (typeof s === 'string') {\n    return s.length < n ? s : s.slice(0, n);\n  } else {\n    return s;\n  }\n}\nfunction inspect(something) {\n  if (functionsHaveNames || !util.isFunction(something)) {\n    return util.inspect(something);\n  }\n  var rawname = getName(something);\n  var name = rawname ? ': ' + rawname : '';\n  return '[Function' +  name + ']';\n}\nfunction getMessage(self) {\n  return truncate(inspect(self.actual), 128) + ' ' +\n         self.operator + ' ' +\n         truncate(inspect(self.expected), 128);\n}\n\n// At present only the three keys mentioned above are used and\n// understood by the spec. Implementations or sub modules can pass\n// other keys to the AssertionError's constructor - they will be\n// ignored.\n\n// 3. All of the following functions must throw an AssertionError\n// when a corresponding condition is not met, with a message that\n// may be undefined if not provided.  All assertion methods provide\n// both the actual and expected values to the assertion error for\n// display purposes.\n\nfunction fail(actual, expected, message, operator, stackStartFunction) {\n  throw new assert.AssertionError({\n    message: message,\n    actual: actual,\n    expected: expected,\n    operator: operator,\n    stackStartFunction: stackStartFunction\n  });\n}\n\n// EXTENSION! allows for well behaved errors defined elsewhere.\nassert.fail = fail;\n\n// 4. Pure assertion tests whether a value is truthy, as determined\n// by !!guard.\n// assert.ok(guard, message_opt);\n// This statement is equivalent to assert.equal(true, !!guard,\n// message_opt);. To test strictly for the value true, use\n// assert.strictEqual(true, guard, message_opt);.\n\nfunction ok(value, message) {\n  if (!value) fail(value, true, message, '==', assert.ok);\n}\nassert.ok = ok;\n\n// 5. The equality assertion tests shallow, coercive equality with\n// ==.\n// assert.equal(actual, expected, message_opt);\n\nassert.equal = function equal(actual, expected, message) {\n  if (actual != expected) fail(actual, expected, message, '==', assert.equal);\n};\n\n// 6. The non-equality assertion tests for whether two objects are not equal\n// with != assert.notEqual(actual, expected, message_opt);\n\nassert.notEqual = function notEqual(actual, expected, message) {\n  if (actual == expected) {\n    fail(actual, expected, message, '!=', assert.notEqual);\n  }\n};\n\n// 7. The equivalence assertion tests a deep equality relation.\n// assert.deepEqual(actual, expected, message_opt);\n\nassert.deepEqual = function deepEqual(actual, expected, message) {\n  if (!_deepEqual(actual, expected, false)) {\n    fail(actual, expected, message, 'deepEqual', assert.deepEqual);\n  }\n};\n\nassert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {\n  if (!_deepEqual(actual, expected, true)) {\n    fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);\n  }\n};\n\nfunction _deepEqual(actual, expected, strict, memos) {\n  // 7.1. All identical values are equivalent, as determined by ===.\n  if (actual === expected) {\n    return true;\n  } else if (isBuffer(actual) && isBuffer(expected)) {\n    return compare(actual, expected) === 0;\n\n  // 7.2. If the expected value is a Date object, the actual value is\n  // equivalent if it is also a Date object that refers to the same time.\n  } else if (util.isDate(actual) && util.isDate(expected)) {\n    return actual.getTime() === expected.getTime();\n\n  // 7.3 If the expected value is a RegExp object, the actual value is\n  // equivalent if it is also a RegExp object with the same source and\n  // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).\n  } else if (util.isRegExp(actual) && util.isRegExp(expected)) {\n    return actual.source === expected.source &&\n           actual.global === expected.global &&\n           actual.multiline === expected.multiline &&\n           actual.lastIndex === expected.lastIndex &&\n           actual.ignoreCase === expected.ignoreCase;\n\n  // 7.4. Other pairs that do not both pass typeof value == 'object',\n  // equivalence is determined by ==.\n  } else if ((actual === null || typeof actual !== 'object') &&\n             (expected === null || typeof expected !== 'object')) {\n    return strict ? actual === expected : actual == expected;\n\n  // If both values are instances of typed arrays, wrap their underlying\n  // ArrayBuffers in a Buffer each to increase performance\n  // This optimization requires the arrays to have the same type as checked by\n  // Object.prototype.toString (aka pToString). Never perform binary\n  // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their\n  // bit patterns are not identical.\n  } else if (isView(actual) && isView(expected) &&\n             pToString(actual) === pToString(expected) &&\n             !(actual instanceof Float32Array ||\n               actual instanceof Float64Array)) {\n    return compare(new Uint8Array(actual.buffer),\n                   new Uint8Array(expected.buffer)) === 0;\n\n  // 7.5 For all other Object pairs, including Array objects, equivalence is\n  // determined by having the same number of owned properties (as verified\n  // with Object.prototype.hasOwnProperty.call), the same set of keys\n  // (although not necessarily the same order), equivalent values for every\n  // corresponding key, and an identical 'prototype' property. Note: this\n  // accounts for both named and indexed properties on Arrays.\n  } else if (isBuffer(actual) !== isBuffer(expected)) {\n    return false;\n  } else {\n    memos = memos || {actual: [], expected: []};\n\n    var actualIndex = memos.actual.indexOf(actual);\n    if (actualIndex !== -1) {\n      if (actualIndex === memos.expected.indexOf(expected)) {\n        return true;\n      }\n    }\n\n    memos.actual.push(actual);\n    memos.expected.push(expected);\n\n    return objEquiv(actual, expected, strict, memos);\n  }\n}\n\nfunction isArguments(object) {\n  return Object.prototype.toString.call(object) == '[object Arguments]';\n}\n\nfunction objEquiv(a, b, strict, actualVisitedObjects) {\n  if (a === null || a === undefined || b === null || b === undefined)\n    return false;\n  // if one is a primitive, the other must be same\n  if (util.isPrimitive(a) || util.isPrimitive(b))\n    return a === b;\n  if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n    return false;\n  var aIsArgs = isArguments(a);\n  var bIsArgs = isArguments(b);\n  if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))\n    return false;\n  if (aIsArgs) {\n    a = pSlice.call(a);\n    b = pSlice.call(b);\n    return _deepEqual(a, b, strict);\n  }\n  var ka = objectKeys(a);\n  var kb = objectKeys(b);\n  var key, i;\n  // having the same number of owned properties (keys incorporates\n  // hasOwnProperty)\n  if (ka.length !== kb.length)\n    return false;\n  //the same set of keys (although not necessarily the same order),\n  ka.sort();\n  kb.sort();\n  //~~~cheap key test\n  for (i = ka.length - 1; i >= 0; i--) {\n    if (ka[i] !== kb[i])\n      return false;\n  }\n  //equivalent values for every corresponding key, and\n  //~~~possibly expensive deep test\n  for (i = ka.length - 1; i >= 0; i--) {\n    key = ka[i];\n    if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))\n      return false;\n  }\n  return true;\n}\n\n// 8. The non-equivalence assertion tests for any deep inequality.\n// assert.notDeepEqual(actual, expected, message_opt);\n\nassert.notDeepEqual = function notDeepEqual(actual, expected, message) {\n  if (_deepEqual(actual, expected, false)) {\n    fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);\n  }\n};\n\nassert.notDeepStrictEqual = notDeepStrictEqual;\nfunction notDeepStrictEqual(actual, expected, message) {\n  if (_deepEqual(actual, expected, true)) {\n    fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);\n  }\n}\n\n\n// 9. The strict equality assertion tests strict equality, as determined by ===.\n// assert.strictEqual(actual, expected, message_opt);\n\nassert.strictEqual = function strictEqual(actual, expected, message) {\n  if (actual !== expected) {\n    fail(actual, expected, message, '===', assert.strictEqual);\n  }\n};\n\n// 10. The strict non-equality assertion tests for strict inequality, as\n// determined by !==.  assert.notStrictEqual(actual, expected, message_opt);\n\nassert.notStrictEqual = function notStrictEqual(actual, expected, message) {\n  if (actual === expected) {\n    fail(actual, expected, message, '!==', assert.notStrictEqual);\n  }\n};\n\nfunction expectedException(actual, expected) {\n  if (!actual || !expected) {\n    return false;\n  }\n\n  if (Object.prototype.toString.call(expected) == '[object RegExp]') {\n    return expected.test(actual);\n  }\n\n  try {\n    if (actual instanceof expected) {\n      return true;\n    }\n  } catch (e) {\n    // Ignore.  The instanceof check doesn't work for arrow functions.\n  }\n\n  if (Error.isPrototypeOf(expected)) {\n    return false;\n  }\n\n  return expected.call({}, actual) === true;\n}\n\nfunction _tryBlock(block) {\n  var error;\n  try {\n    block();\n  } catch (e) {\n    error = e;\n  }\n  return error;\n}\n\nfunction _throws(shouldThrow, block, expected, message) {\n  var actual;\n\n  if (typeof block !== 'function') {\n    throw new TypeError('\"block\" argument must be a function');\n  }\n\n  if (typeof expected === 'string') {\n    message = expected;\n    expected = null;\n  }\n\n  actual = _tryBlock(block);\n\n  message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +\n            (message ? ' ' + message : '.');\n\n  if (shouldThrow && !actual) {\n    fail(actual, expected, 'Missing expected exception' + message);\n  }\n\n  var userProvidedMessage = typeof message === 'string';\n  var isUnwantedException = !shouldThrow && util.isError(actual);\n  var isUnexpectedException = !shouldThrow && actual && !expected;\n\n  if ((isUnwantedException &&\n      userProvidedMessage &&\n      expectedException(actual, expected)) ||\n      isUnexpectedException) {\n    fail(actual, expected, 'Got unwanted exception' + message);\n  }\n\n  if ((shouldThrow && actual && expected &&\n      !expectedException(actual, expected)) || (!shouldThrow && actual)) {\n    throw actual;\n  }\n}\n\n// 11. Expected to throw an error:\n// assert.throws(block, Error_opt, message_opt);\n\nassert.throws = function(block, /*optional*/error, /*optional*/message) {\n  _throws(true, block, error, message);\n};\n\n// EXTENSION! This is annoying to write outside this module.\nassert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {\n  _throws(false, block, error, message);\n};\n\nassert.ifError = function(err) { if (err) throw err; };\n\nvar objectKeys = Object.keys || function (obj) {\n  var keys = [];\n  for (var key in obj) {\n    if (hasOwn.call(obj, key)) keys.push(key);\n  }\n  return keys;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/assert/assert.js\n// module id = 16\n// module chunks = 0\n\n//# sourceURL=../node_modules/assert/assert.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(1348).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1).toRed(this);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bn.js/lib/bn.js\n// module id = 17\n// module chunks = 0\n\n//# sourceURL=../node_modules/bn.js/lib/bn.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar buffer = __webpack_require__(0);\nvar assert = __webpack_require__(16);\n\nvar js = __webpack_require__(24);\nvar $ = __webpack_require__(13);\n\nfunction equals(a, b) {\n  if (a.length !== b.length) {\n    return false;\n  }\n  var length = a.length;\n  for (var i = 0; i < length; i++) {\n    if (a[i] !== b[i]) {\n      return false;\n    }\n  }\n  return true;\n}\n\nmodule.exports = {\n  /**\n   * Fill a buffer with a value.\n   *\n   * @param {Buffer} buffer\n   * @param {number} value\n   * @return {Buffer}\n   */\n  fill: function fill(buffer, value) {\n    $.checkArgumentType(buffer, 'Buffer', 'buffer');\n    $.checkArgumentType(value, 'number', 'value');\n    var length = buffer.length;\n    for (var i = 0; i < length; i++) {\n      buffer[i] = value;\n    }\n    return buffer;\n  },\n\n  /**\n   * Return a copy of a buffer\n   *\n   * @param {Buffer} original\n   * @return {Buffer}\n   */\n  copy: function(original) {\n    var buffer = new Buffer(original.length);\n    original.copy(buffer);\n    return buffer;\n  },\n\n  /**\n   * Returns true if the given argument is an instance of a buffer. Tests for\n   * both node's Buffer and Uint8Array\n   *\n   * @param {*} arg\n   * @return {boolean}\n   */\n  isBuffer: function isBuffer(arg) {\n    return buffer.Buffer.isBuffer(arg) || arg instanceof Uint8Array;\n  },\n\n  /**\n   * Returns a zero-filled byte array\n   *\n   * @param {number} bytes\n   * @return {Buffer}\n   */\n  emptyBuffer: function emptyBuffer(bytes) {\n    $.checkArgumentType(bytes, 'number', 'bytes');\n    var result = new buffer.Buffer(bytes);\n    for (var i = 0; i < bytes; i++) {\n      result.write('\\0', i);\n    }\n    return result;\n  },\n\n  /**\n   * Concatenates a buffer\n   *\n   * Shortcut for <tt>buffer.Buffer.concat</tt>\n   */\n  concat: buffer.Buffer.concat,\n\n  equals: equals,\n  equal: equals,\n\n  /**\n   * Transforms a number from 0 to 255 into a Buffer of size 1 with that value\n   *\n   * @param {number} integer\n   * @return {Buffer}\n   */\n  integerAsSingleByteBuffer: function integerAsSingleByteBuffer(integer) {\n    $.checkArgumentType(integer, 'number', 'integer');\n    return new buffer.Buffer([integer & 0xff]);\n  },\n\n  /**\n   * Transform a 4-byte integer into a Buffer of length 4.\n   *\n   * @param {number} integer\n   * @return {Buffer}\n   */\n  integerAsBuffer: function integerAsBuffer(integer) {\n    $.checkArgumentType(integer, 'number', 'integer');\n    var bytes = [];\n    bytes.push((integer >> 24) & 0xff);\n    bytes.push((integer >> 16) & 0xff);\n    bytes.push((integer >> 8) & 0xff);\n    bytes.push(integer & 0xff);\n    return new Buffer(bytes);\n  },\n\n  /**\n   * Transform the first 4 values of a Buffer into a number, in little endian encoding\n   *\n   * @param {Buffer} buffer\n   * @return {number}\n   */\n  integerFromBuffer: function integerFromBuffer(buffer) {\n    $.checkArgumentType(buffer, 'Buffer', 'buffer');\n    return buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];\n  },\n\n  /**\n   * Transforms the first byte of an array into a number ranging from -128 to 127\n   * @param {Buffer} buffer\n   * @return {number}\n   */\n  integerFromSingleByteBuffer: function integerFromBuffer(buffer) {\n    $.checkArgumentType(buffer, 'Buffer', 'buffer');\n    return buffer[0];\n  },\n\n  /**\n   * Transforms a buffer into a string with a number in hexa representation\n   *\n   * Shorthand for <tt>buffer.toString('hex')</tt>\n   *\n   * @param {Buffer} buffer\n   * @return {string}\n   */\n  bufferToHex: function bufferToHex(buffer) {\n    $.checkArgumentType(buffer, 'Buffer', 'buffer');\n    return buffer.toString('hex');\n  },\n\n  /**\n   * Reverse a buffer\n   * @param {Buffer} param\n   * @return {Buffer}\n   */\n  reverse: function reverse(param) {\n    var ret = new buffer.Buffer(param.length);\n    for (var i = 0; i < param.length; i++) {\n      ret[i] = param[param.length - i - 1];\n    }\n    return ret;\n  },\n\n  /**\n   * Transforms an hexa encoded string into a Buffer with binary values\n   *\n   * Shorthand for <tt>Buffer(string, 'hex')</tt>\n   *\n   * @param {string} string\n   * @return {Buffer}\n   */\n  hexToBuffer: function hexToBuffer(string) {\n    assert(js.isHexa(string));\n    return new buffer.Buffer(string, 'hex');\n  }\n};\n\nmodule.exports.NULL_HASH = module.exports.fill(new Buffer(32), 0);\nmodule.exports.EMPTY_BUFFER = new Buffer(0);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/util/buffer.js\n// module id = 18\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/util/buffer.js")},function(module,exports,__webpack_require__){eval("var ERRORS = __webpack_require__(546)\nvar NATIVE = __webpack_require__(311)\n\n// short-hand\nvar tfJSON = ERRORS.tfJSON\nvar TfTypeError = ERRORS.TfTypeError\nvar TfPropertyTypeError = ERRORS.TfPropertyTypeError\nvar tfSubError = ERRORS.tfSubError\nvar getValueTypeName = ERRORS.getValueTypeName\n\nvar TYPES = {\n  arrayOf: function arrayOf (type) {\n    type = compile(type)\n\n    function _arrayOf (array, strict) {\n      if (!NATIVE.Array(array)) return false\n      if (NATIVE.Nil(array)) return false\n\n      return array.every(function (value, i) {\n        try {\n          return typeforce(type, value, strict)\n        } catch (e) {\n          throw tfSubError(e, i)\n        }\n      })\n    }\n    _arrayOf.toJSON = function () { return '[' + tfJSON(type) + ']' }\n\n    return _arrayOf\n  },\n\n  maybe: function maybe (type) {\n    type = compile(type)\n\n    function _maybe (value, strict) {\n      return NATIVE.Nil(value) || type(value, strict, maybe)\n    }\n    _maybe.toJSON = function () { return '?' + tfJSON(type) }\n\n    return _maybe\n  },\n\n  map: function map (propertyType, propertyKeyType) {\n    propertyType = compile(propertyType)\n    if (propertyKeyType) propertyKeyType = compile(propertyKeyType)\n\n    function _map (value, strict) {\n      if (!NATIVE.Object(value)) return false\n      if (NATIVE.Nil(value)) return false\n\n      for (var propertyName in value) {\n        try {\n          if (propertyKeyType) {\n            typeforce(propertyKeyType, propertyName, strict)\n          }\n        } catch (e) {\n          throw tfSubError(e, propertyName, 'key')\n        }\n\n        try {\n          var propertyValue = value[propertyName]\n          typeforce(propertyType, propertyValue, strict)\n        } catch (e) {\n          throw tfSubError(e, propertyName)\n        }\n      }\n\n      return true\n    }\n\n    if (propertyKeyType) {\n      _map.toJSON = function () {\n        return '{' + tfJSON(propertyKeyType) + ': ' + tfJSON(propertyType) + '}'\n      }\n    } else {\n      _map.toJSON = function () { return '{' + tfJSON(propertyType) + '}' }\n    }\n\n    return _map\n  },\n\n  object: function object (uncompiled) {\n    var type = {}\n\n    for (var typePropertyName in uncompiled) {\n      type[typePropertyName] = compile(uncompiled[typePropertyName])\n    }\n\n    function _object (value, strict) {\n      if (!NATIVE.Object(value)) return false\n      if (NATIVE.Nil(value)) return false\n\n      var propertyName\n\n      try {\n        for (propertyName in type) {\n          var propertyType = type[propertyName]\n          var propertyValue = value[propertyName]\n\n          typeforce(propertyType, propertyValue, strict)\n        }\n      } catch (e) {\n        throw tfSubError(e, propertyName)\n      }\n\n      if (strict) {\n        for (propertyName in value) {\n          if (type[propertyName]) continue\n\n          throw new TfPropertyTypeError(undefined, propertyName)\n        }\n      }\n\n      return true\n    }\n    _object.toJSON = function () { return tfJSON(type) }\n\n    return _object\n  },\n\n  oneOf: function oneOf () {\n    var types = [].slice.call(arguments).map(compile)\n\n    function _oneOf (value, strict) {\n      return types.some(function (type) {\n        try {\n          return typeforce(type, value, strict)\n        } catch (e) {\n          return false\n        }\n      })\n    }\n    _oneOf.toJSON = function () { return types.map(tfJSON).join('|') }\n\n    return _oneOf\n  },\n\n  quacksLike: function quacksLike (type) {\n    function _quacksLike (value) {\n      return type === getValueTypeName(value)\n    }\n    _quacksLike.toJSON = function () { return type }\n\n    return _quacksLike\n  },\n\n  tuple: function tuple () {\n    var types = [].slice.call(arguments).map(compile)\n\n    function _tuple (values, strict) {\n      if (NATIVE.Nil(values)) return false\n      if (NATIVE.Nil(values.length)) return false\n      if (strict && (values.length !== types.length)) return false\n\n      return types.every(function (type, i) {\n        try {\n          return typeforce(type, values[i], strict)\n        } catch (e) {\n          throw tfSubError(e, i)\n        }\n      })\n    }\n    _tuple.toJSON = function () { return '(' + types.map(tfJSON).join(', ') + ')' }\n\n    return _tuple\n  },\n\n  value: function value (expected) {\n    function _value (actual) {\n      return actual === expected\n    }\n    _value.toJSON = function () { return expected }\n\n    return _value\n  }\n}\n\nfunction compile (type) {\n  if (NATIVE.String(type)) {\n    if (type[0] === '?') return TYPES.maybe(type.slice(1))\n\n    return NATIVE[type] || TYPES.quacksLike(type)\n  } else if (type && NATIVE.Object(type)) {\n    if (NATIVE.Array(type)) return TYPES.arrayOf(type[0])\n\n    return TYPES.object(type)\n  } else if (NATIVE.Function(type)) {\n    return type\n  }\n\n  return TYPES.value(type)\n}\n\nfunction typeforce (type, value, strict, surrogate) {\n  if (NATIVE.Function(type)) {\n    if (type(value, strict)) return true\n\n    throw new TfTypeError(surrogate || type, value)\n  }\n\n  // JIT\n  return typeforce(compile(type), value, strict)\n}\n\n// assign types to typeforce function\nfor (var typeName in NATIVE) {\n  typeforce[typeName] = NATIVE[typeName]\n}\n\nfor (typeName in TYPES) {\n  typeforce[typeName] = TYPES[typeName]\n}\n\nvar EXTRA = __webpack_require__(1254)\nfor (typeName in EXTRA) {\n  typeforce[typeName] = EXTRA[typeName]\n}\n\n// async wrapper\nfunction __async (type, value, strict, callback) {\n  // default to falsy strict if using shorthand overload\n  if (typeof strict === 'function') return __async(type, value, false, strict)\n\n  try {\n    typeforce(type, value, strict)\n  } catch (e) {\n    return callback(e)\n  }\n\n  callback()\n}\n\ntypeforce.async = __async\ntypeforce.compile = compile\ntypeforce.TfTypeError = TfTypeError\ntypeforce.TfPropertyTypeError = TfPropertyTypeError\n\nmodule.exports = typeforce\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/typeforce/index.js\n// module id = 19\n// module chunks = 0\n\n//# sourceURL=../node_modules/typeforce/index.js")},function(module,exports){eval('module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tif(!module.children) module.children = [];\r\n\t\tObject.defineProperty(module, "loaded", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.l;\r\n\t\t\t}\r\n\t\t});\r\n\t\tObject.defineProperty(module, "id", {\r\n\t\t\tenumerable: true,\r\n\t\t\tget: function() {\r\n\t\t\t\treturn module.i;\r\n\t\t\t}\r\n\t\t});\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n};\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 20\n// module chunks = 0\n\n//# sourceURL=../node_modules/webpack/buildin/module.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst map = __webpack_require__(280)\nconst extend = __webpack_require__(73)\nconst codec = __webpack_require__(1098)\nconst protocols = __webpack_require__(287)\nconst varint = __webpack_require__(29)\nconst bs58 = __webpack_require__(76)\n\nconst NotImplemented = new Error('Sorry, Not Implemented Yet.')\n\nexports = module.exports = Multiaddr\n\n/**\n * Creates a [multiaddr](https://github.com/multiformats/multiaddr) from\n * a Buffer, String or another Multiaddr instance\n * public key.\n * @class Multiaddr\n * @param {(String|Buffer|Multiaddr)} addr - If String or Buffer, needs to adhere\n * to the address format of a [multiaddr](https://github.com/multiformats/multiaddr#string-format)\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n */\nfunction Multiaddr (addr) {\n  if (!(this instanceof Multiaddr)) {\n    return new Multiaddr(addr)\n  }\n\n  // default\n  if (addr == null) {\n    addr = ''\n  }\n\n  if (addr instanceof Buffer) {\n    /**\n     * @type {Buffer} - The raw bytes representing this multiaddress\n     */\n    this.buffer = codec.fromBuffer(addr)\n  } else if (typeof addr === 'string' || addr instanceof String) {\n    this.buffer = codec.fromString(addr)\n  } else if (addr.buffer && addr.protos && addr.protoCodes) { // Multiaddr\n    this.buffer = codec.fromBuffer(addr.buffer) // validate + copy buffer\n  } else {\n    throw new Error('addr must be a string, Buffer, or another Multiaddr')\n  }\n}\n\n/**\n * Returns Multiaddr as a String\n *\n * @returns {String}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').toString()\n * // '/ip4/127.0.0.1/tcp/4001'\n */\nMultiaddr.prototype.toString = function toString () {\n  return codec.bufferToString(this.buffer)\n}\n\n/**\n * Returns Multiaddr as a convinient options object to be used with net.createConnection\n *\n * @returns {{family: String, host: String, transport: String, port: String}}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').toOptions()\n * // { family: 'ipv4', host: '127.0.0.1', transport: 'tcp', port: '4001' }\n */\nMultiaddr.prototype.toOptions = function toOptions () {\n  const opts = {}\n  const parsed = this.toString().split('/')\n  opts.family = parsed[1] === 'ip4' ? 'ipv4' : 'ipv6'\n  opts.host = parsed[2]\n  opts.transport = parsed[3]\n  opts.port = parsed[4]\n  return opts\n}\n\n/**\n * Returns Multiaddr as a human-readable string\n *\n * @returns {String}\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').inspect()\n * // '<Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>'\n */\nMultiaddr.prototype.inspect = function inspect () {\n  return '<Multiaddr ' +\n    this.buffer.toString('hex') + ' - ' +\n    codec.bufferToString(this.buffer) + '>'\n}\n\n/**\n * Returns the protocols the Multiaddr is defined with, as an array of objects, in\n * left-to-right order. Each object contains the protocol code, protocol name,\n * and the size of its address space in bits.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @returns {Array.<Object>} protocols - All the protocols the address is composed of\n * @returns {Number} protocols[].code\n * @returns {Number} protocols[].size\n * @returns {String} protocols[].name\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protos()\n * // [ { code: 4, size: 32, name: 'ip4' },\n * //   { code: 6, size: 16, name: 'tcp' } ]\n */\nMultiaddr.prototype.protos = function protos () {\n  return map(this.protoCodes(), function (code) {\n    return extend(protocols(code))\n    // copy to prevent users from modifying the internal objs.\n  })\n}\n\n/**\n * Returns the codes of the protocols in left-to-right order.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @returns {Array.<Number>} protocol codes\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoCodes()\n * // [ 4, 6 ]\n */\nMultiaddr.prototype.protoCodes = function protoCodes () {\n  const codes = []\n  const buf = this.buffer\n  let i = 0\n  while (i < buf.length) {\n    const code = varint.decode(buf, i)\n    const n = varint.decode.bytes\n\n    const p = protocols(code)\n    const size = codec.sizeForAddr(p, buf.slice(i + n))\n\n    i += (size + n)\n    codes.push(code)\n  }\n\n  return codes\n}\n\n/**\n * Returns the names of the protocols in left-to-right order.\n * [See list of protocols](https://github.com/multiformats/multiaddr/blob/master/protocols.csv)\n *\n * @return {Array.<String>} protocol names\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').protoNames()\n * // [ 'ip4', 'tcp' ]\n */\nMultiaddr.prototype.protoNames = function protoNames () {\n  return map(this.protos(), function (proto) {\n    return proto.name\n  })\n}\n\n/**\n * Returns a tuple of parts\n *\n * @return {Array.<Array>} tuples\n * @return {Number} tuples[].0 code of protocol\n * @return {Buffer} tuples[].1 contents of address\n * @example\n * Multiaddr(\"/ip4/127.0.0.1/tcp/4001\").tuples()\n * // [ [ 4, <Buffer 7f 00 00 01> ], [ 6, <Buffer 0f a1> ] ]\n */\nMultiaddr.prototype.tuples = function tuples () {\n  return codec.bufferToTuples(this.buffer)\n}\n\n/**\n * Returns a tuple of string/number parts\n *\n * @return {Array.<Array>} tuples\n * @return {Number} tuples[].0 code of protocol\n * @return {(String|Number)} tuples[].1 contents of address\n * @example\n * Multiaddr(\"/ip4/127.0.0.1/tcp/4001\").stringTuples()\n * // [ [ 4, '127.0.0.1' ], [ 6, 4001 ] ]\n */\nMultiaddr.prototype.stringTuples = function stringTuples () {\n  const t = codec.bufferToTuples(this.buffer)\n  return codec.tuplesToStringTuples(t)\n}\n\n/**\n * Encapsulates a Multiaddr in another Multiaddr\n *\n * @param {Multiaddr} addr - Multiaddr to add into this Multiaddr\n * @return {Multiaddr}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 0408080808060438047f000001060fa1 - /ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001>\n *\n * mh3.toString()\n * // '/ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001'\n */\nMultiaddr.prototype.encapsulate = function encapsulate (addr) {\n  addr = Multiaddr(addr)\n  return Multiaddr(this.toString() + addr.toString())\n}\n\n/**\n * Decapsulates a Multiaddr from another Multiaddr\n *\n * @param {Multiaddr} addr - Multiaddr to remove from this Multiaddr\n * @return {Multiaddr}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 0408080808060438047f000001060fa1 - /ip4/8.8.8.8/tcp/1080/ip4/127.0.0.1/tcp/4001>\n *\n * mh3.decapsulate(mh2).toString()\n * // '/ip4/8.8.8.8/tcp/1080'\n */\nMultiaddr.prototype.decapsulate = function decapsulate (addr) {\n  addr = addr.toString()\n  const s = this.toString()\n  const i = s.lastIndexOf(addr)\n  if (i < 0) {\n    throw new Error('Address ' + this + ' does not contain subaddress: ' + addr)\n  }\n  return Multiaddr(s.slice(0, i))\n}\n\n/**\n * Extract the peerId if the multiaddr contains one\n *\n * @return {String|null} peerId - The id of the peer or null if invalid or missing from the ma\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080/ipfs/QmValidBase58string>\n *\n * // should return QmValidBase58string or null if the id is missing or invalid\n * const peerId = mh1.getPeerId()\n */\nMultiaddr.prototype.getPeerId = function getPeerId () {\n  let b58str = null\n  try {\n    b58str = this.stringTuples().filter((tuple) => {\n      if (tuple[0] === protocols.names['ipfs'].code) {\n        return true\n      }\n    })[0][1]\n\n    bs58.decode(b58str)\n  } catch (e) {\n    b58str = null\n  }\n\n  return b58str\n}\n\n/**\n * Checks if two Multiaddrs are the same\n *\n * @param {Multiaddr} addr\n * @return {Bool}\n * @example\n * const mh1 = Multiaddr('/ip4/8.8.8.8/tcp/1080')\n * // <Multiaddr 0408080808060438 - /ip4/8.8.8.8/tcp/1080>\n *\n * const mh2 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n *\n * mh1.equals(mh1)\n * // true\n *\n * mh1.equals(mh2)\n * // false\n */\nMultiaddr.prototype.equals = function equals (addr) {\n  return this.buffer.equals(addr.buffer)\n}\n\n/**\n * Gets a Multiaddrs node-friendly address object. Note that protocol information\n * is left out: in Node (and most network systems) the protocol is unknowable\n * given only the address.\n *\n * Has to be a ThinWaist Address, otherwise throws error\n *\n * @returns {{family: String, address: String, port: String}}\n * @throws {Error} Throws error if Multiaddr is not a Thin Waist address\n * @example\n * Multiaddr('/ip4/127.0.0.1/tcp/4001').nodeAddress()\n * // {family: 'IPv4', address: '127.0.0.1', port: '4001'}\n */\nMultiaddr.prototype.nodeAddress = function nodeAddress () {\n  if (!this.isThinWaistAddress()) {\n    throw new Error('Multiaddr must be \"thin waist\" address for nodeAddress.')\n  }\n\n  const codes = this.protoCodes()\n  const parts = this.toString().split('/').slice(1)\n  return {\n    family: (codes[0] === 41) ? 'IPv6' : 'IPv4',\n    address: parts[1], // ip addr\n    port: parts[3] // tcp or udp port\n  }\n}\n\n/**\n * Creates a Multiaddr from a node-friendly address object\n *\n * @param {String} addr\n * @param {String} transport\n * @returns {Multiaddr} multiaddr\n * @throws {Error} Throws error if addr is not truthy\n * @throws {Error} Throws error if transport is not truthy\n * @example\n * Multiaddr.fromNodeAddress({address: '127.0.0.1', port: '4001'}, 'tcp')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n */\nMultiaddr.fromNodeAddress = function fromNodeAddress (addr, transport) {\n  if (!addr) throw new Error('requires node address object')\n  if (!transport) throw new Error('requires transport protocol')\n  const ip = (addr.family === 'IPv6') ? 'ip6' : 'ip4'\n  return Multiaddr('/' + [ip, addr.address, transport, addr.port].join('/'))\n}\n\n// TODO find a better example, not sure about it's good enough\n/**\n * Returns if a Multiaddr is a Thin Waist address or not.\n *\n * Thin Waist is if a Multiaddr adheres to the standard combination of:\n *\n * `{IPv4, IPv6}/{TCP, UDP}`\n *\n * @param {Multiaddr} [addr] - Defaults to using `this` instance\n * @returns {Boolean} isThinWaistAddress\n * @example\n * const mh1 = Multiaddr('/ip4/127.0.0.1/tcp/4001')\n * // <Multiaddr 047f000001060fa1 - /ip4/127.0.0.1/tcp/4001>\n * const mh2 = Multiaddr('/ip4/192.168.2.1/tcp/5001')\n * // <Multiaddr 04c0a80201061389 - /ip4/192.168.2.1/tcp/5001>\n * const mh3 = mh1.encapsulate(mh2)\n * // <Multiaddr 047f000001060fa104c0a80201061389 - /ip4/127.0.0.1/tcp/4001/ip4/192.168.2.1/tcp/5001>\n * mh1.isThinWaistAddress()\n * // true\n * mh2.isThinWaistAddress()\n * // true\n * mh3.isThinWaistAddress()\n * // false\n */\nMultiaddr.prototype.isThinWaistAddress = function isThinWaistAddress (addr) {\n  const protos = (addr || this).protos()\n\n  if (protos.length !== 2) {\n    return false\n  }\n\n  if (protos[0].code !== 4 && protos[0].code !== 41) {\n    return false\n  }\n  if (protos[1].code !== 6 && protos[1].code !== 17) {\n    return false\n  }\n  return true\n}\n\n// TODO rename this to something else than \"stupid string\"\n/**\n * Converts a \"stupid string\" into a Multiaddr.\n *\n * Stupid string format:\n * ```\n * <proto><IPv>://<IP Addr>[:<proto port>]\n * udp4://1.2.3.4:5678\n * ```\n *\n * @param {String} [str] - String in the \"stupid\" format\n * @throws {NotImplemented}\n * @returns {undefined}\n * @todo Not Implemented yet\n */\nMultiaddr.prototype.fromStupidString = function fromStupidString (str) {\n  throw NotImplemented\n}\n\n/**\n * Object containing table, names and codes of all supported protocols.\n * To get the protocol values from a Multiaddr, you can use\n * [`.protos()`](#multiaddrprotos),\n * [`.protoCodes()`](#multiaddrprotocodes) or\n * [`.protoNames()`](#multiaddrprotonames)\n *\n * @instance\n * @returns {{table: Array, names: Object, codes: Object}}\n *\n */\nMultiaddr.protocols = protocols\n\n/**\n * Returns if something is a Multiaddr or not\n *\n * @param {Multiaddr} addr\n * @return {Bool} isMultiaddr\n * @example\n * Multiaddr.isMultiaddr(Multiaddr('/ip4/127.0.0.1/tcp/4001'))\n * // true\n * Multiaddr.isMultiaddr('/ip4/127.0.0.1/tcp/4001')\n * // false\n */\nMultiaddr.isMultiaddr = function isMultiaddr (addr) {\n  if (addr.constructor && addr.constructor.name) {\n    return addr.constructor.name === 'Multiaddr'\n  }\n\n  return Boolean(\n    addr.fromStupidString &&\n    addr.protos\n  )\n}\n\n/**\n * Returns if something is a Multiaddr that is a name\n *\n * @param {Multiaddr} addr\n * @return {Bool} isName\n */\nMultiaddr.isName = function isName (addr) {\n  if (!Multiaddr.isMultiaddr(addr)) {\n    return false\n  }\n\n  // if a part of the multiaddr is resolvable, then return true\n  return addr.protos().some((proto) => proto.resolvable)\n}\n\n/**\n * Returns an array of multiaddrs, by resolving the multiaddr that is a name\n *\n * @param {Multiaddr} addr\n *\n * @param {Function} callback\n * @return {Bool} isName\n */\nMultiaddr.resolve = function resolve (addr, callback) {\n  if (!Multiaddr.isMultiaddr(addr) || !Multiaddr.isName(addr)) {\n    return callback(new Error('not a valid name'))\n  }\n\n  /*\n   * Needs more consideration from spec design:\n   *   - what to return\n   *   - how to achieve it in the browser?\n   */\n  return callback(new Error('not implemented yet'))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiaddr/src/index.js\n// module id = 21\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiaddr/src/index.js")},function(module,exports,__webpack_require__){eval('/** PROMISIFY CALLBACK-STYLE FUNCTIONS TO ES6 PROMISES\r\n*\r\n* EXAMPLE:\r\n* const fn = promisify( (callback) => callback(null, "Hello world!") );\r\n* fn((err, str) => console.log(str));\r\n* fn().then((str) => console.log(str));\r\n* //Both functions, will log \'Hello world!\'\r\n*\r\n* Note: The function you pass, may have any arguments you want, but the latest\r\n* have to be the callback, which you will call with: next(err, value)\r\n*\r\n* @param method: Function/Array/Map = The function(s) to promisify\r\n* @param options: Map =\r\n*  "context" (default is function): The context which to apply the called function\r\n*  "replace" (default is falsy): When passed an array/map, if to replace the original object\r\n*\r\n* @return: A promise if passed a function, otherwise the object with the promises\r\n*\r\n* @license: MIT\r\n* @version: 1.0.3\r\n* @author: Manuel Di Iorio\r\n**/\r\n\r\nvar createCallback = function (method, context) {\r\n    return function () {\r\n        var args = Array.prototype.slice.call(arguments);\r\n        var lastIndex = args.length - 1;\r\n        var lastArg = args && args.length > 0 ? args[lastIndex] : null;\r\n        var cb = typeof lastArg === \'function\' ? lastArg : null;\r\n\r\n        if (cb) {\r\n            return method.apply(context, args);\r\n        }\r\n\r\n        return new Promise(function (resolve, reject) {\r\n            args.push(function (err, val) {\r\n                if (err) return reject(err);\r\n                resolve(val);\r\n            });\r\n\r\n            method.apply(context, args);\r\n        });\r\n    };\r\n};\r\n\r\nif (false) module = {}; // Browserify this module\r\n\r\nmodule.exports = function (methods, options) {\r\n    options = options || {};\r\n    var type = Object.prototype.toString.call(methods);\r\n\r\n    if (type === "[object Object]" || type === "[object Array]") {\r\n        var obj = options.replace ? methods : {};\r\n\r\n        for (var key in methods) {\r\n            if (methods.hasOwnProperty(key)) obj[key] = createCallback(methods[key]);\r\n        }return obj;\r\n    }\r\n\r\n    return createCallback(methods, options.context || methods);\r\n};\r\n\r\n// Browserify this module\r\nif (false) {\r\n    this["promisify"] = module.exports;\r\n}\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/promisify-es6/index.js\n// module id = 22\n// module chunks = 0\n\n//# sourceURL=../node_modules/promisify-es6/index.js')},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar bip66 = __webpack_require__(227)\nvar pushdata = __webpack_require__(524)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar scriptNumber = __webpack_require__(342)\n\nvar OPS = __webpack_require__(33)\nvar REVERSE_OPS = __webpack_require__(625)\nvar OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1\n\nfunction isOPInt (value) {\n  return types.Number(value) &&\n    ((value === OPS.OP_0) ||\n    (value >= OPS.OP_1 && value <= OPS.OP_16) ||\n    (value === OPS.OP_1NEGATE))\n}\n\nfunction isPushOnlyChunk (value) {\n  return types.Buffer(value) || isOPInt(value)\n}\n\nfunction isPushOnly (value) {\n  return types.Array(value) && value.every(isPushOnlyChunk)\n}\n\nfunction asMinimalOP (buffer) {\n  if (buffer.length === 0) return OPS.OP_0\n  if (buffer.length !== 1) return\n  if (buffer[0] >= 1 && buffer[0] <= 16) return OP_INT_BASE + buffer[0]\n  if (buffer[0] === 0x81) return OPS.OP_1NEGATE\n}\n\nfunction compile (chunks) {\n  // TODO: remove me\n  if (Buffer.isBuffer(chunks)) return chunks\n\n  typeforce(types.Array, chunks)\n\n  var bufferSize = chunks.reduce(function (accum, chunk) {\n    // data chunk\n    if (Buffer.isBuffer(chunk)) {\n      // adhere to BIP62.3, minimal push policy\n      if (chunk.length === 1 && asMinimalOP(chunk) !== undefined) {\n        return accum + 1\n      }\n\n      return accum + pushdata.encodingLength(chunk.length) + chunk.length\n    }\n\n    // opcode\n    return accum + 1\n  }, 0.0)\n\n  var buffer = Buffer.allocUnsafe(bufferSize)\n  var offset = 0\n\n  chunks.forEach(function (chunk) {\n    // data chunk\n    if (Buffer.isBuffer(chunk)) {\n      // adhere to BIP62.3, minimal push policy\n      var opcode = asMinimalOP(chunk)\n      if (opcode !== undefined) {\n        buffer.writeUInt8(opcode, offset)\n        offset += 1\n        return\n      }\n\n      offset += pushdata.encode(buffer, chunk.length, offset)\n      chunk.copy(buffer, offset)\n      offset += chunk.length\n\n    // opcode\n    } else {\n      buffer.writeUInt8(chunk, offset)\n      offset += 1\n    }\n  })\n\n  if (offset !== buffer.length) throw new Error('Could not decode chunks')\n  return buffer\n}\n\nfunction decompile (buffer) {\n  // TODO: remove me\n  if (types.Array(buffer)) return buffer\n\n  typeforce(types.Buffer, buffer)\n\n  var chunks = []\n  var i = 0\n\n  while (i < buffer.length) {\n    var opcode = buffer[i]\n\n    // data chunk\n    if ((opcode > OPS.OP_0) && (opcode <= OPS.OP_PUSHDATA4)) {\n      var d = pushdata.decode(buffer, i)\n\n      // did reading a pushDataInt fail? empty script\n      if (d === null) return []\n      i += d.size\n\n      // attempt to read too much data? empty script\n      if (i + d.number > buffer.length) return []\n\n      var data = buffer.slice(i, i + d.number)\n      i += d.number\n\n      // decompile minimally\n      var op = asMinimalOP(data)\n      if (op !== undefined) {\n        chunks.push(op)\n      } else {\n        chunks.push(data)\n      }\n\n    // opcode\n    } else {\n      chunks.push(opcode)\n\n      i += 1\n    }\n  }\n\n  return chunks\n}\n\nfunction toASM (chunks) {\n  if (Buffer.isBuffer(chunks)) {\n    chunks = decompile(chunks)\n  }\n\n  return chunks.map(function (chunk) {\n    // data?\n    if (Buffer.isBuffer(chunk)) {\n      var op = asMinimalOP(chunk)\n      if (op === undefined) return chunk.toString('hex')\n      chunk = op\n    }\n\n    // opcode!\n    return REVERSE_OPS[chunk]\n  }).join(' ')\n}\n\nfunction fromASM (asm) {\n  typeforce(types.String, asm)\n\n  return compile(asm.split(' ').map(function (chunkStr) {\n    // opcode?\n    if (OPS[chunkStr] !== undefined) return OPS[chunkStr]\n    typeforce(types.Hex, chunkStr)\n\n    // data!\n    return Buffer.from(chunkStr, 'hex')\n  }))\n}\n\nfunction toStack (chunks) {\n  chunks = decompile(chunks)\n  typeforce(isPushOnly, chunks)\n\n  return chunks.map(function (op) {\n    if (Buffer.isBuffer(op)) return op\n    if (op === OPS.OP_0) return Buffer.allocUnsafe(0)\n\n    return scriptNumber.encode(op - OP_INT_BASE)\n  })\n}\n\nfunction isCanonicalPubKey (buffer) {\n  if (!Buffer.isBuffer(buffer)) return false\n  if (buffer.length < 33) return false\n\n  switch (buffer[0]) {\n    case 0x02:\n    case 0x03:\n      return buffer.length === 33\n    case 0x04:\n      return buffer.length === 65\n  }\n\n  return false\n}\n\nfunction isDefinedHashType (hashType) {\n  var hashTypeMod = hashType & ~0x80\n\n// return hashTypeMod > SIGHASH_ALL && hashTypeMod < SIGHASH_SINGLE\n  return hashTypeMod > 0x00 && hashTypeMod < 0x04\n}\n\nfunction isCanonicalSignature (buffer) {\n  if (!Buffer.isBuffer(buffer)) return false\n  if (!isDefinedHashType(buffer[buffer.length - 1])) return false\n\n  return bip66.check(buffer.slice(0, -1))\n}\n\nmodule.exports = {\n  compile: compile,\n  decompile: decompile,\n  fromASM: fromASM,\n  toASM: toASM,\n  toStack: toStack,\n\n  number: __webpack_require__(342),\n\n  isCanonicalPubKey: isCanonicalPubKey,\n  isCanonicalSignature: isCanonicalSignature,\n  isPushOnly: isPushOnly,\n  isDefinedHashType: isDefinedHashType\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/script.js\n// module id = 23\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/script.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\n\n/**\n * Determines whether a string contains only hexadecimal values\n *\n * @name JSUtil.isHexa\n * @param {string} value\n * @return {boolean} true if the string is the hexa representation of a number\n */\nvar isHexa = function isHexa(value) {\n  if (!_.isString(value)) {\n    return false;\n  }\n  return /^[0-9a-fA-F]+$/.test(value);\n};\n\n/**\n * @namespace JSUtil\n */\nmodule.exports = {\n  /**\n   * Test if an argument is a valid JSON object. If it is, returns a truthy\n   * value (the json object decoded), so no double JSON.parse call is necessary\n   *\n   * @param {string} arg\n   * @return {Object|boolean} false if the argument is not a JSON string.\n   */\n  isValidJSON: function isValidJSON(arg) {\n    var parsed;\n    if (!_.isString(arg)) {\n      return false;\n    }\n    try {\n      parsed = JSON.parse(arg);\n    } catch (e) {\n      return false;\n    }\n    if (typeof(parsed) === 'object') {\n      return true;\n    }\n    return false;\n  },\n  isHexa: isHexa,\n  isHexaString: isHexa,\n\n  /**\n   * Clone an array\n   */\n  cloneArray: function(array) {\n    return [].concat(array);\n  },\n\n  /**\n   * Define immutable properties on a target object\n   *\n   * @param {Object} target - An object to be extended\n   * @param {Object} values - An object of properties\n   * @return {Object} The target object\n   */\n  defineImmutable: function defineImmutable(target, values) {\n    Object.keys(values).forEach(function(key){\n      Object.defineProperty(target, key, {\n        configurable: false,\n        enumerable: true,\n        value: values[key]\n      });\n    });\n    return target;\n  },\n  /**\n   * Checks that a value is a natural number, a positive integer or zero.\n   *\n   * @param {*} value\n   * @return {Boolean}\n   */\n  isNaturalNumber: function isNaturalNumber(value) {\n    return typeof value === 'number' &&\n      isFinite(value) &&\n      Math.floor(value) === value &&\n      value >= 0;\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/util/js.js\n// module id = 24\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/util/js.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {var apply = Function.prototype.apply;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) {\n  if (timeout) {\n    timeout.close();\n  }\n};\n\nfunction Timeout(id, clearFn) {\n  this._id = id;\n  this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n  this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n  clearTimeout(item._idleTimeoutId);\n  item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n  clearTimeout(item._idleTimeoutId);\n\n  var msecs = item._idleTimeout;\n  if (msecs >= 0) {\n    item._idleTimeoutId = setTimeout(function onTimeout() {\n      if (item._onTimeout)\n        item._onTimeout();\n    }, msecs);\n  }\n};\n\n// setimmediate attaches itself to the global object\n__webpack_require__(534);\n// On some exotic environments, it\'s not clear which object `setimmeidate` was\n// able to install onto.  Search each possibility in the same order as the\n// `setimmediate` library.\nexports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||\n                       (typeof global !== "undefined" && global.setImmediate) ||\n                       (this && this.setImmediate);\nexports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||\n                         (typeof global !== "undefined" && global.clearImmediate) ||\n                         (this && this.clearImmediate);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-libs-browser/~/timers-browserify/main.js\n// module id = 25\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-libs-browser/node_modules/timers-browserify/main.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\n * Id is an object representation of a peer Id. a peer Id is a multihash\n */\n\n\n\nconst mh = __webpack_require__(32)\nconst crypto = __webpack_require__(79)\nconst assert = __webpack_require__(16)\nconst waterfall = __webpack_require__(12)\n\nclass PeerId {\n  constructor (id, privKey, pubKey) {\n    assert(Buffer.isBuffer(id), 'invalid id provided')\n\n    if (privKey && pubKey) {\n      assert(privKey.public.bytes.equals(pubKey.bytes), 'inconsistent arguments')\n    }\n\n    this._id = id\n    this._idB58String = mh.toB58String(this.id)\n    this._privKey = privKey\n    this._pubKey = pubKey\n  }\n\n  get id () {\n    return this._id\n  }\n\n  set id (val) {\n    throw new Error('Id is immutable')\n  }\n\n  get privKey () {\n    return this._privKey\n  }\n\n  set privKey (privKey) {\n    this._privKey = privKey\n  }\n\n  get pubKey () {\n    if (this._pubKey) {\n      return this._pubKey\n    }\n\n    if (this._privKey) {\n      return this._privKey.public\n    }\n  }\n\n  set pubKey (pubKey) {\n    this._pubKey = pubKey\n  }\n\n  // Return the protobuf version of the public key, matching go ipfs formatting\n  marshalPubKey () {\n    if (this.pubKey) {\n      return crypto.keys.marshalPublicKey(this.pubKey)\n    }\n  }\n\n  // Return the protobuf version of the private key, matching go ipfs formatting\n  marshalPrivKey () {\n    if (this.privKey) {\n      return crypto.keys.marshalPrivateKey(this.privKey)\n    }\n  }\n\n  // pretty print\n  toPrint () {\n    return this.toJSON()\n  }\n\n  // return the jsonified version of the key, matching the formatting\n  // of go-ipfs for its config file\n  toJSON () {\n    return {\n      id: this.toB58String(),\n      privKey: toB64Opt(this.marshalPrivKey()),\n      pubKey: toB64Opt(this.marshalPubKey())\n    }\n  }\n\n  // encode/decode functions\n  toHexString () {\n    return mh.toHexString(this.id)\n  }\n\n  toBytes () {\n    return this.id\n  }\n\n  toB58String () {\n    return this._idB58String\n  }\n\n  isEqual (id) {\n    if (Buffer.isBuffer(id)) {\n      return this.id.equals(id)\n    } else if (id.id) {\n      return this.id.equals(id.id)\n    } else {\n      throw new Error('not valid Id')\n    }\n  }\n\n  /*\n   * Check if this PeerId instance is valid (privKey -> pubKey -> Id)\n   */\n  isValid (callback) {\n    // TODO Needs better checking\n    if (this.privKey &&\n      this.privKey.public &&\n      this.privKey.public.bytes &&\n      Buffer.isBuffer(this.pubKey.bytes) &&\n      this.privKey.public.bytes.equals(this.pubKey.bytes)) {\n      callback()\n    } else {\n      callback(new Error('Keys not match'))\n    }\n  }\n}\n\nexports = module.exports = PeerId\n\n// generation\nexports.create = function (opts, callback) {\n  if (typeof opts === 'function') {\n    callback = opts\n    opts = {}\n  }\n  opts = opts || {}\n  opts.bits = opts.bits || 2048\n\n  waterfall([\n    (cb) => crypto.keys.generateKeyPair('RSA', opts.bits, cb),\n    (privKey, cb) => privKey.public.hash((err, digest) => {\n      cb(err, digest, privKey)\n    })\n  ], (err, digest, privKey) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new PeerId(digest, privKey))\n  })\n}\n\nexports.createFromHexString = function (str) {\n  return new PeerId(mh.fromHexString(str))\n}\n\nexports.createFromBytes = function (buf) {\n  return new PeerId(buf)\n}\n\nexports.createFromB58String = function (str) {\n  return new PeerId(mh.fromB58String(str))\n}\n\n// Public Key input will be a buffer\nexports.createFromPubKey = function (key, callback) {\n  if (typeof callback !== 'function') {\n    throw new Error('callback is required')\n  }\n\n  let pubKey\n\n  try {\n    let buf = key\n    if (typeof buf === 'string') {\n      buf = Buffer.from(key, 'base64')\n    }\n\n    if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')\n\n    pubKey = crypto.keys.unmarshalPublicKey(buf)\n  } catch (err) {\n    return callback(err)\n  }\n\n  pubKey.hash((err, digest) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new PeerId(digest, null, pubKey))\n  })\n}\n\n// Private key input will be a string\nexports.createFromPrivKey = function (key, callback) {\n  if (typeof callback !== 'function') {\n    throw new Error('callback is required')\n  }\n\n  let buf = key\n\n  try {\n    if (typeof buf === 'string') {\n      buf = Buffer.from(key, 'base64')\n    }\n\n    if (!Buffer.isBuffer(buf)) throw new Error('Supplied key is neither a base64 string nor a buffer')\n  } catch (err) {\n    return callback(err)\n  }\n\n  waterfall([\n    (cb) => crypto.keys.unmarshalPrivateKey(buf, cb),\n    (privKey, cb) => privKey.public.hash((err, digest) => {\n      cb(err, digest, privKey)\n    })\n  ], (err, digest, privKey) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new PeerId(digest, privKey, privKey.public))\n  })\n}\n\nexports.createFromJSON = function (obj, callback) {\n  if (typeof callback !== 'function') {\n    throw new Error('callback is required')\n  }\n\n  let id\n  let rawPrivKey\n  let rawPubKey\n  let pub\n\n  try {\n    id = mh.fromB58String(obj.id)\n    rawPrivKey = obj.privKey && Buffer.from(obj.privKey, 'base64')\n    rawPubKey = obj.pubKey && Buffer.from(obj.pubKey, 'base64')\n    pub = rawPubKey && crypto.keys.unmarshalPublicKey(rawPubKey)\n  } catch (err) {\n    return callback(err)\n  }\n\n  if (rawPrivKey) {\n    waterfall([\n      (cb) => crypto.keys.unmarshalPrivateKey(rawPrivKey, cb),\n      (priv, cb) => priv.public.hash((err, digest) => {\n        cb(err, digest, priv)\n      }),\n      (privDigest, priv, cb) => {\n        if (pub) {\n          pub.hash((err, pubDigest) => {\n            cb(err, privDigest, priv, pubDigest)\n          })\n        } else {\n          cb(null, privDigest, priv)\n        }\n      }\n    ], (err, privDigest, priv, pubDigest) => {\n      if (err) {\n        return callback(err)\n      }\n\n      if (pub && !privDigest.equals(pubDigest)) {\n        return callback(new Error('Public and private key do not match'))\n      }\n\n      if (id && !privDigest.equals(id)) {\n        return callback(new Error('Id and private key do not match'))\n      }\n\n      callback(null, new PeerId(id, priv, pub))\n    })\n  } else {\n    callback(null, new PeerId(id, null, pub))\n  }\n}\n\nexports.isPeerId = function (peerId) {\n  return Boolean(typeof peerId === 'object' &&\n    peerId._id &&\n    peerId._idB58String)\n}\n\nfunction toB64Opt (val) {\n  if (val) {\n    return val.toString('base64')\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/peer-id/src/index.js\n// module id = 26\n// module chunks = 0\n\n//# sourceURL=../node_modules/peer-id/src/index.js")},function(module,exports,__webpack_require__){eval("var typeforce = __webpack_require__(19)\n\nvar UINT31_MAX = Math.pow(2, 31) - 1\nfunction UInt31 (value) {\n  return typeforce.UInt32(value) && value <= UINT31_MAX\n}\n\nfunction BIP32Path (value) {\n  return typeforce.String(value) && value.match(/^(m\\/)?(\\d+'?\\/)*\\d+'?$/)\n}\nBIP32Path.toJSON = function () { return 'BIP32 derivation path' }\n\nvar SATOSHI_MAX = 21 * 1e14\nfunction Satoshi (value) {\n  return typeforce.UInt53(value) && value <= SATOSHI_MAX\n}\n\n// external dependent types\nvar BigInt = typeforce.quacksLike('BigInteger')\nvar ECPoint = typeforce.quacksLike('Point')\n\n// exposed, external API\nvar ECSignature = typeforce.compile({ r: BigInt, s: BigInt })\nvar Network = typeforce.compile({\n  messagePrefix: typeforce.oneOf(typeforce.Buffer, typeforce.String),\n  bip32: {\n    public: typeforce.UInt32,\n    private: typeforce.UInt32\n  },\n  pubKeyHash: typeforce.UInt8,\n  scriptHash: typeforce.UInt8,\n  wif: typeforce.UInt8\n})\n\n// extend typeforce types with ours\nvar types = {\n  BigInt: BigInt,\n  BIP32Path: BIP32Path,\n  Buffer256bit: typeforce.BufferN(32),\n  ECPoint: ECPoint,\n  ECSignature: ECSignature,\n  Hash160bit: typeforce.BufferN(20),\n  Hash256bit: typeforce.BufferN(32),\n  Network: Network,\n  Satoshi: Satoshi,\n  UInt31: UInt31\n}\n\nfor (var typeName in typeforce) {\n  types[typeName] = typeforce[typeName]\n}\n\nmodule.exports = types\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/types.js\n// module id = 27\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/types.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar elliptic = exports;\n\nelliptic.version = __webpack_require__(833).version;\nelliptic.utils = __webpack_require__(832);\nelliptic.rand = __webpack_require__(350);\nelliptic.curve = __webpack_require__(181);\nelliptic.curves = __webpack_require__(824);\n\n// Protocols\nelliptic.ec = __webpack_require__(825);\nelliptic.eddsa = __webpack_require__(828);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic.js\n// module id = 28\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n    encode: __webpack_require__(1264)\n  , decode: __webpack_require__(1263)\n  , encodingLength: __webpack_require__(1265)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varint/index.js\n// module id = 29\n// module chunks = 0\n\n//# sourceURL=../node_modules/varint/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BN = __webpack_require__(74);\nvar $ = __webpack_require__(13);\nvar _ = __webpack_require__(10);\n\nvar reversebuf = function(buf) {\n  var buf2 = new Buffer(buf.length);\n  for (var i = 0; i < buf.length; i++) {\n    buf2[i] = buf[buf.length - 1 - i];\n  }\n  return buf2;\n};\n\nBN.Zero = new BN(0);\nBN.One = new BN(1);\nBN.Minus1 = new BN(-1);\n\nBN.fromNumber = function(n) {\n  $.checkArgument(_.isNumber(n));\n  return new BN(n);\n};\n\nBN.fromString = function(str, base) {\n  $.checkArgument(_.isString(str));\n  return new BN(str, base);\n};\n\nBN.fromBuffer = function(buf, opts) {\n  if (typeof opts !== 'undefined' && opts.endian === 'little') {\n    buf = reversebuf(buf);\n  }\n  var hex = buf.toString('hex');\n  var bn = new BN(hex, 16);\n  return bn;\n};\n\n/**\n * Instantiate a BigNumber from a \"signed magnitude buffer\"\n * (a buffer where the most significant bit represents the sign (0 = positive, -1 = negative))\n */\nBN.fromSM = function(buf, opts) {\n  var ret;\n  if (buf.length === 0) {\n    return BN.fromBuffer(new Buffer([0]));\n  }\n\n  var endian = 'big';\n  if (opts) {\n    endian = opts.endian;\n  }\n  if (endian === 'little') {\n    buf = reversebuf(buf);\n  }\n\n  if (buf[0] & 0x80) {\n    buf[0] = buf[0] & 0x7f;\n    ret = BN.fromBuffer(buf);\n    ret.neg().copy(ret);\n  } else {\n    ret = BN.fromBuffer(buf);\n  }\n  return ret;\n};\n\n\nBN.prototype.toNumber = function() {\n  return parseInt(this.toString(10), 10);\n};\n\nBN.prototype.toBuffer = function(opts) {\n  var buf, hex;\n  if (opts && opts.size) {\n    hex = this.toString(16, 2);\n    var natlen = hex.length / 2;\n    buf = new Buffer(hex, 'hex');\n\n    if (natlen === opts.size) {\n      buf = buf;\n    } else if (natlen > opts.size) {\n      buf = BN.trim(buf, natlen);\n    } else if (natlen < opts.size) {\n      buf = BN.pad(buf, natlen, opts.size);\n    }\n  } else {\n    hex = this.toString(16, 2);\n    buf = new Buffer(hex, 'hex');\n  }\n\n  if (typeof opts !== 'undefined' && opts.endian === 'little') {\n    buf = reversebuf(buf);\n  }\n\n  return buf;\n};\n\nBN.prototype.toSMBigEndian = function() {\n  var buf;\n  if (this.cmp(BN.Zero) === -1) {\n    buf = this.neg().toBuffer();\n    if (buf[0] & 0x80) {\n      buf = Buffer.concat([new Buffer([0x80]), buf]);\n    } else {\n      buf[0] = buf[0] | 0x80;\n    }\n  } else {\n    buf = this.toBuffer();\n    if (buf[0] & 0x80) {\n      buf = Buffer.concat([new Buffer([0x00]), buf]);\n    }\n  }\n\n  if (buf.length === 1 & buf[0] === 0) {\n    buf = new Buffer([]);\n  }\n  return buf;\n};\n\nBN.prototype.toSM = function(opts) {\n  var endian = opts ? opts.endian : 'big';\n  var buf = this.toSMBigEndian();\n\n  if (endian === 'little') {\n    buf = reversebuf(buf);\n  }\n  return buf;\n};\n\n/**\n * Create a BN from a \"ScriptNum\":\n * This is analogous to the constructor for CScriptNum in bitcoind. Many ops in\n * bitcoind's script interpreter use CScriptNum, which is not really a proper\n * bignum. Instead, an error is thrown if trying to input a number bigger than\n * 4 bytes. We copy that behavior here. A third argument, `size`, is provided to\n * extend the hard limit of 4 bytes, as some usages require more than 4 bytes.\n */\nBN.fromScriptNumBuffer = function(buf, fRequireMinimal, size) {\n  var nMaxNumSize = size || 4;\n  $.checkArgument(buf.length <= nMaxNumSize, new Error('script number overflow'));\n  if (fRequireMinimal && buf.length > 0) {\n    // Check that the number is encoded with the minimum possible\n    // number of bytes.\n    //\n    // If the most-significant-byte - excluding the sign bit - is zero\n    // then we're not minimal. Note how this test also rejects the\n    // negative-zero encoding, 0x80.\n    if ((buf[buf.length - 1] & 0x7f) === 0) {\n      // One exception: if there's more than one byte and the most\n      // significant bit of the second-most-significant-byte is set\n      // it would conflict with the sign bit. An example of this case\n      // is +-255, which encode to 0xff00 and 0xff80 respectively.\n      // (big-endian).\n      if (buf.length <= 1 || (buf[buf.length - 2] & 0x80) === 0) {\n        throw new Error('non-minimally encoded script number');\n      }\n    }\n  }\n  return BN.fromSM(buf, {\n    endian: 'little'\n  });\n};\n\n/**\n * The corollary to the above, with the notable exception that we do not throw\n * an error if the output is larger than four bytes. (Which can happen if\n * performing a numerical operation that results in an overflow to more than 4\n * bytes).\n */\nBN.prototype.toScriptNumBuffer = function() {\n  return this.toSM({\n    endian: 'little'\n  });\n};\n\nBN.prototype.gt = function(b) {\n  return this.cmp(b) > 0;\n};\n\nBN.prototype.gte = function(b) {\n  return this.cmp(b) >= 0;\n};\n\nBN.prototype.lt = function(b) {\n  return this.cmp(b) < 0;\n};\n\nBN.trim = function(buf, natlen) {\n  return buf.slice(natlen - buf.length, buf.length);\n};\n\nBN.pad = function(buf, natlen, size) {\n  var rbuf = new Buffer(size);\n  for (var i = 0; i < buf.length; i++) {\n    rbuf[rbuf.length - 1 - i] = buf[buf.length - 1 - i];\n  }\n  for (i = 0; i < size - natlen; i++) {\n    rbuf[i] = 0;\n  }\n  return rbuf;\n};\n\nmodule.exports = BN;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/bn.js\n// module id = 30\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/bn.js")},function(module,exports){eval("var core = module.exports = { version: '2.5.5' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_core.js\n// module id = 31\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_core.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Multihash implementation in JavaScript.\n *\n * @module multihash\n */\n\n\nconst bs58 = __webpack_require__(76)\n\nconst cs = __webpack_require__(475)\n\nexports.names = cs.names\nexports.codes = cs.codes\nexports.defaultLengths = cs.defaultLengths\n\nconst varint = __webpack_require__(29)\n\n/**\n * Convert the given multihash to a hex encoded string.\n *\n * @param {Buffer} hash\n * @returns {string}\n */\nexports.toHexString = function toHexString (hash) {\n  if (!Buffer.isBuffer(hash)) {\n    throw new Error('must be passed a buffer')\n  }\n\n  return hash.toString('hex')\n}\n\n/**\n * Convert the given hex encoded string to a multihash.\n *\n * @param {string} hash\n * @returns {Buffer}\n */\nexports.fromHexString = function fromHexString (hash) {\n  return Buffer.from(hash, 'hex')\n}\n\n/**\n * Convert the given multihash to a base58 encoded string.\n *\n * @param {Buffer} hash\n * @returns {string}\n */\nexports.toB58String = function toB58String (hash) {\n  if (!Buffer.isBuffer(hash)) {\n    throw new Error('must be passed a buffer')\n  }\n\n  return bs58.encode(hash)\n}\n\n/**\n * Convert the given base58 encoded string to a multihash.\n *\n * @param {string|Buffer} hash\n * @returns {Buffer}\n */\nexports.fromB58String = function fromB58String (hash) {\n  let encoded = hash\n  if (Buffer.isBuffer(hash)) {\n    encoded = hash.toString()\n  }\n\n  return Buffer.from(bs58.decode(encoded))\n}\n\n/**\n * Decode a hash from the given multihash.\n *\n * @param {Buffer} buf\n * @returns {{code: number, name: string, length: number, digest: Buffer}} result\n */\nexports.decode = function decode (buf) {\n  if (!(Buffer.isBuffer(buf))) {\n    throw new Error('multihash must be a Buffer')\n  }\n\n  if (buf.length < 3) {\n    throw new Error('multihash too short. must be > 3 bytes.')\n  }\n\n  let code = varint.decode(buf)\n  if (!exports.isValidCode(code)) {\n    throw new Error(`multihash unknown function code: 0x${code.toString(16)}`)\n  }\n  buf = buf.slice(varint.decode.bytes)\n\n  let len = varint.decode(buf)\n  if (len < 1) {\n    throw new Error(`multihash invalid length: 0x${len.toString(16)}`)\n  }\n  buf = buf.slice(varint.decode.bytes)\n\n  if (buf.length !== len) {\n    throw new Error(`multihash length inconsistent: 0x${buf.toString('hex')}`)\n  }\n\n  return {\n    code: code,\n    name: cs.codes[code],\n    length: len,\n    digest: buf\n  }\n}\n\n/**\n *  Encode a hash digest along with the specified function code.\n *\n * > **Note:** the length is derived from the length of the digest itself.\n *\n * @param {Buffer} digest\n * @param {string|number} code\n * @param {number} [length]\n * @returns {Buffer}\n */\nexports.encode = function encode (digest, code, length) {\n  if (!digest || !code) {\n    throw new Error('multihash encode requires at least two args: digest, code')\n  }\n\n  // ensure it's a hashfunction code.\n  const hashfn = exports.coerceCode(code)\n\n  if (!(Buffer.isBuffer(digest))) {\n    throw new Error('digest should be a Buffer')\n  }\n\n  if (length == null) {\n    length = digest.length\n  }\n\n  if (length && digest.length !== length) {\n    throw new Error('digest length should be equal to specified length.')\n  }\n\n  return Buffer.concat([\n    Buffer.from(varint.encode(hashfn)),\n    Buffer.from(varint.encode(length)),\n    digest\n  ])\n}\n\n/**\n * Converts a hash function name into the matching code.\n * If passed a number it will return the number if it's a valid code.\n * @param {string|number} name\n * @returns {number}\n */\nexports.coerceCode = function coerceCode (name) {\n  let code = name\n\n  if (typeof name === 'string') {\n    if (!cs.names[name]) {\n      throw new Error(`Unrecognized hash function named: ${name}`)\n    }\n    code = cs.names[name]\n  }\n\n  if (typeof code !== 'number') {\n    throw new Error(`Hash function code should be a number. Got: ${code}`)\n  }\n\n  if (!cs.codes[code] && !exports.isAppCode(code)) {\n    throw new Error(`Unrecognized function code: ${code}`)\n  }\n\n  return code\n}\n\n/**\n * Checks wether a code is part of the app range\n *\n * @param {number} code\n * @returns {boolean}\n */\nexports.isAppCode = function appCode (code) {\n  return code > 0 && code < 0x10\n}\n\n/**\n * Checks whether a multihash code is valid.\n *\n * @param {number} code\n * @returns {boolean}\n */\nexports.isValidCode = function validCode (code) {\n  if (exports.isAppCode(code)) {\n    return true\n  }\n\n  if (cs.codes[code]) {\n    return true\n  }\n\n  return false\n}\n\n/**\n * Check if the given buffer is a valid multihash. Throws an error if it is not valid.\n *\n * @param {Buffer} multihash\n * @returns {undefined}\n * @throws {Error}\n */\nfunction validate (multihash) {\n  exports.decode(multihash) // throws if bad.\n}\nexports.validate = validate\n\n/**\n * Returns a prefix from a valid multihash. Throws an error if it is not valid.\n *\n * @param {Buffer} multihash\n * @returns {undefined}\n * @throws {Error}\n */\nexports.prefix = function prefix (multihash) {\n  validate(multihash)\n\n  return multihash.slice(0, 2)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashes/src/index.js\n// module id = 32\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashes/src/index.js")},function(module,exports){eval('module.exports = {"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoin-ops/index.json\n// module id = 33\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoin-ops/index.json')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar errors = __webpack_require__(770);\nvar formatters = __webpack_require__(771);\n\nmodule.exports = {\n    errors: errors,\n    formatters: formatters\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-helpers/src/index.js\n// module id = 34\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-helpers/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar errors = __webpack_require__(1267);\nvar formatters = __webpack_require__(1268);\n\nmodule.exports = {\n    errors: errors,\n    formatters: formatters\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-helpers/src/index.js\n// module id = 35\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-helpers/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar crypto = __webpack_require__(60);\nvar BufferUtil = __webpack_require__(18);\nvar $ = __webpack_require__(13);\n\nvar Hash = module.exports;\n\nHash.sha1 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return crypto.createHash('sha1').update(buf).digest();\n};\n\nHash.sha1.blocksize = 512;\n\nHash.sha256 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return crypto.createHash('sha256').update(buf).digest();\n};\n\nHash.sha256.blocksize = 512;\n\nHash.sha256sha256 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return Hash.sha256(Hash.sha256(buf));\n};\n\nHash.ripemd160 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return crypto.createHash('ripemd160').update(buf).digest();\n};\n\nHash.sha256ripemd160 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return Hash.ripemd160(Hash.sha256(buf));\n};\n\nHash.sha512 = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return crypto.createHash('sha512').update(buf).digest();\n};\n\nHash.sha512.blocksize = 1024;\n\nHash.hmac = function(hashf, data, key) {\n  //http://en.wikipedia.org/wiki/Hash-based_message_authentication_code\n  //http://tools.ietf.org/html/rfc4868#section-2\n  $.checkArgument(BufferUtil.isBuffer(data));\n  $.checkArgument(BufferUtil.isBuffer(key));\n  $.checkArgument(hashf.blocksize);\n\n  var blocksize = hashf.blocksize / 8;\n\n  if (key.length > blocksize) {\n    key = hashf(key);\n  } else if (key < blocksize) {\n    var fill = new Buffer(blocksize);\n    fill.fill(0);\n    key.copy(fill);\n    key = fill;\n  }\n\n  var o_key = new Buffer(blocksize);\n  o_key.fill(0x5c);\n\n  var i_key = new Buffer(blocksize);\n  i_key.fill(0x36);\n\n  var o_key_pad = new Buffer(blocksize);\n  var i_key_pad = new Buffer(blocksize);\n  for (var i = 0; i < blocksize; i++) {\n    o_key_pad[i] = o_key[i] ^ key[i];\n    i_key_pad[i] = i_key[i] ^ key[i];\n  }\n\n  return hashf(Buffer.concat([o_key_pad, hashf(Buffer.concat([i_key_pad, data]))]));\n};\n\nHash.sha256hmac = function(data, key) {\n  return Hash.hmac(Hash.sha256, data, key);\n};\n\nHash.sha512hmac = function(data, key) {\n  return Hash.hmac(Hash.sha512, data, key);\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/hash.js\n// module id = 36\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/hash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.isAsync = undefined;\n\nvar _asyncify = __webpack_require__(161);\n\nvar _asyncify2 = _interopRequireDefault(_asyncify);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar supportsSymbol = typeof Symbol === 'function';\n\nfunction isAsync(fn) {\n    return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction wrapAsync(asyncFn) {\n    return isAsync(asyncFn) ? (0, _asyncify2.default)(asyncFn) : asyncFn;\n}\n\nexports.default = wrapAsync;\nexports.isAsync = isAsync;\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/wrapAsync.js\n// module id = 37\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/wrapAsync.js")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(247)('wks');\nvar uid = __webpack_require__(175);\nvar Symbol = __webpack_require__(42).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n  return store[name] || (store[name] =\n    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks.js\n// module id = 38\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_wks.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.Connection = __webpack_require__(881)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-connection/src/index.js\n// module id = 39\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-connection/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst Key = __webpack_require__(413)\nconst MemoryDatastore = __webpack_require__(882)\nconst utils = __webpack_require__(265)\n\nexports.Key = Key\nexports.MemoryDatastore = MemoryDatastore\nexports.utils = utils\n\n/* ::\n// -- Basics\n\nexport type Callback<Value> = (err: ?Error, ?Value) => void\n\n// eslint-disable-next-line\nexport interface Datastore<Value> {\n  // eslint-disable-next-line\n  put(Key, Value, Callback<void>): void;\n  // eslint-disable-next-line\n  get(Key, Callback<Value>): void;\n  has(Key, Callback<bool>): void;\n  delete(Key, Callback<void>): void;\n  // eslint-disable-next-line\n  query(Query<Value>): QueryResult<Value>;\n\n  // eslint-disable-next-line\n  batch(): Batch<Value>;\n  close(Callback<void>): void;\n  open(Callback<void>): void;\n}\n\n// -- Batch\nexport type Batch<Value> = {\n  put(Key, Value): void,\n  delete(Key): void,\n  commit(Callback<void>): void\n}\n\n// -- Query\n\nexport type Query<Value> = {\n  prefix?: string,\n  filters?: Array<Filter<Value>>,\n  orders?: Array<Order<Value>>,\n  limit?: number,\n  offset?: number,\n  keysOnly?: bool\n}\n\nexport type PullEnd = bool | Error\nexport type PullSource<Val> = (end: ?PullEnd, (end: ?PullEnd, Val) => void) => void\n\nexport type QueryResult<Value> = PullSource<QueryEntry<Value>>\n\nexport type QueryEntry<Value> = {\n  key: Key,\n  value?: Value\n}\n\nexport type Filter<Value> = (QueryEntry<Value>, Callback<bool>) => void\n\nexport type Order<Value> = (QueryResult<Value>, Callback<QueryResult<Value>>) => void\n\n*/\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-datastore/src/index.js\n// module id = 40\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-datastore/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = eachLimit;\n\nvar _eachOf = __webpack_require__(218);\n\nvar _eachOf2 = _interopRequireDefault(_eachOf);\n\nvar _withoutIndex = __webpack_require__(332);\n\nvar _withoutIndex2 = _interopRequireDefault(_withoutIndex);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n *   // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n *     // Perform operation on file here.\n *     console.log('Processing file ' + file);\n *\n *     if( file.length > 32 ) {\n *       console.log('This file name is too long');\n *       callback('File name too long');\n *     } else {\n *       // Do work to process file here\n *       console.log('File processed');\n *       callback();\n *     }\n * }, function(err) {\n *     // if any of the file processing produced an error, err would equal that error\n *     if( err ) {\n *       // One of the iterations produced an error.\n *       // All processing will now stop.\n *       console.log('A file failed to process');\n *     } else {\n *       console.log('All files have been processed successfully');\n *     }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n  (0, _eachOf2.default)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/each.js\n// module id = 41\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/each.js")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n  ? window : typeof self != 'undefined' && self.Math == Math ? self\n  // eslint-disable-next-line no-new-func\n  : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_global.js\n// module id = 42\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_global.js")},function(module,exports){eval("module.exports = assert;\n\nfunction assert(val, msg) {\n  if (!val)\n    throw new Error(msg || 'Assertion failed');\n}\n\nassert.equal = function assertEqual(l, r, msg) {\n  if (l != r)\n    throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/minimalistic-assert/index.js\n// module id = 43\n// module chunks = 0\n\n//# sourceURL=../node_modules/minimalistic-assert/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst PeerId = __webpack_require__(26)\nconst ensureMultiaddr = __webpack_require__(506).ensureMultiaddr\nconst MultiaddrSet = __webpack_require__(1151)\nconst assert = __webpack_require__(16)\n\n// Peer represents a peer on the IPFS network\nclass PeerInfo {\n  constructor (peerId) {\n    assert(peerId, 'Missing peerId. Use Peer.create(cb) to create one')\n\n    this.id = peerId\n    this.multiaddrs = new MultiaddrSet()\n    this.protocols = new Set()\n    this._connectedMultiaddr = undefined\n  }\n\n  // only stores the current multiaddr being used\n  connect (ma) {\n    ma = ensureMultiaddr(ma)\n    if (!this.multiaddrs.has(ma) && ma.toString() !== `/ipfs/${this.id.toB58String()}`) {\n      throw new Error('can\\'t be connected to missing multiaddr from set')\n    }\n    this._connectedMultiaddr = ma\n  }\n\n  disconnect () {\n    this._connectedMultiaddr = undefined\n  }\n\n  isConnected () {\n    return this._connectedMultiaddr\n  }\n}\n\nPeerInfo.create = (peerId, callback) => {\n  if (typeof peerId === 'function') {\n    callback = peerId\n    peerId = null\n\n    PeerId.create((err, id) => {\n      if (err) {\n        return callback(err)\n      }\n\n      callback(null, new PeerInfo(id))\n    })\n    return\n  }\n\n  // Already a PeerId instance\n  if (typeof peerId.toJSON === 'function') {\n    callback(null, new PeerInfo(peerId))\n  } else {\n    PeerId.createFromJSON(peerId, (err, id) => callback(err, new PeerInfo(id)))\n  }\n}\n\nPeerInfo.isPeerInfo = (peerInfo) => {\n  return Boolean(typeof peerInfo === 'object' &&\n    peerInfo.id &&\n    peerInfo.multiaddrs)\n}\n\nmodule.exports = PeerInfo\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/peer-info/src/index.js\n// module id = 44\n// module chunks = 0\n\n//# sourceURL=../node_modules/peer-info/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst encode = __webpack_require__(1171)\nconst d = __webpack_require__(1170)\n\nexports.encode = encode\nexports.decode = d.decode\nexports.decodeFromReader = d.decodeFromReader\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-length-prefixed/src/index.js\n// module id = 45\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-length-prefixed/src/index.js")},function(module,exports,__webpack_require__){eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Stream;\n\nvar EE = __webpack_require__(15).EventEmitter;\nvar inherits = __webpack_require__(3);\n\ninherits(Stream, EE);\nStream.Readable = __webpack_require__(81);\nStream.Writable = __webpack_require__(1216);\nStream.Duplex = __webpack_require__(1211);\nStream.Transform = __webpack_require__(1215);\nStream.PassThrough = __webpack_require__(1214);\n\n// Backwards-compat with node 0.4.x\nStream.Stream = Stream;\n\n\n\n// old-style streams.  Note that the pipe method (the only relevant\n// part of this class) is overridden in the Readable class.\n\nfunction Stream() {\n  EE.call(this);\n}\n\nStream.prototype.pipe = function(dest, options) {\n  var source = this;\n\n  function ondata(chunk) {\n    if (dest.writable) {\n      if (false === dest.write(chunk) && source.pause) {\n        source.pause();\n      }\n    }\n  }\n\n  source.on('data', ondata);\n\n  function ondrain() {\n    if (source.readable && source.resume) {\n      source.resume();\n    }\n  }\n\n  dest.on('drain', ondrain);\n\n  // If the 'end' option is not supplied, dest.end() will be called when\n  // source gets the 'end' or 'close' events.  Only dest.end() once.\n  if (!dest._isStdio && (!options || options.end !== false)) {\n    source.on('end', onend);\n    source.on('close', onclose);\n  }\n\n  var didOnEnd = false;\n  function onend() {\n    if (didOnEnd) return;\n    didOnEnd = true;\n\n    dest.end();\n  }\n\n\n  function onclose() {\n    if (didOnEnd) return;\n    didOnEnd = true;\n\n    if (typeof dest.destroy === 'function') dest.destroy();\n  }\n\n  // don't leave dangling pipes when there are errors.\n  function onerror(er) {\n    cleanup();\n    if (EE.listenerCount(this, 'error') === 0) {\n      throw er; // Unhandled stream error in pipe.\n    }\n  }\n\n  source.on('error', onerror);\n  dest.on('error', onerror);\n\n  // remove all the event listeners that were added.\n  function cleanup() {\n    source.removeListener('data', ondata);\n    dest.removeListener('drain', ondrain);\n\n    source.removeListener('end', onend);\n    source.removeListener('close', onclose);\n\n    source.removeListener('error', onerror);\n    dest.removeListener('error', onerror);\n\n    source.removeListener('end', cleanup);\n    source.removeListener('close', cleanup);\n\n    dest.removeListener('close', cleanup);\n  }\n\n  source.on('end', cleanup);\n  source.on('close', cleanup);\n\n  dest.on('close', cleanup);\n\n  dest.emit('pipe', source);\n\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\n  return dest;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stream-browserify/index.js\n// module id = 46\n// module chunks = 0\n\n//# sourceURL=../node_modules/stream-browserify/index.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file utils.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\nvar _ = __webpack_require__(11);\nvar ethjsUnit = __webpack_require__(408);\nvar utils = __webpack_require__(562);\nvar soliditySha3 = __webpack_require__(1295);\nvar randomHex = __webpack_require__(525);\n\n\n\n/**\n * Fires an error in an event emitter and callback and returns the eventemitter\n *\n * @method _fireError\n * @param {Object} error a string, a error, or an object with {message, data}\n * @param {Object} emitter\n * @param {Function} reject\n * @param {Function} callback\n * @return {Object} the emitter\n */\nvar _fireError = function (error, emitter, reject, callback) {\n    /*jshint maxcomplexity: 10 */\n\n    // add data if given\n    if(_.isObject(error) && !(error instanceof Error) &&  error.data) {\n        if(_.isObject(error.data) || _.isArray(error.data)) {\n            error.data = JSON.stringify(error.data, null, 2);\n        }\n\n        error = error.message +\"\\n\"+ error.data;\n    }\n\n    if(_.isString(error)) {\n        error = new Error(error);\n    }\n\n    if (_.isFunction(callback)) {\n        callback(error);\n    }\n    if (_.isFunction(reject)) {\n        // suppress uncatched error if an error listener is present\n        if (emitter &&\n            _.isFunction(emitter.listeners) &&\n            emitter.listeners('error').length &&\n            _.isFunction(emitter.suppressUnhandledRejections)) {\n            emitter.suppressUnhandledRejections();\n        // OR suppress uncatched error if an callback listener is present\n        } else if(_.isFunction(callback) &&\n            _.isFunction(emitter.suppressUnhandledRejections)) {\n            emitter.suppressUnhandledRejections();\n        }\n        // reject later, to be able to return emitter\n        setTimeout(function () {\n            reject(error);\n        }, 1);\n    }\n\n    if(emitter && _.isFunction(emitter.emit)) {\n        // emit later, to be able to return emitter\n        setTimeout(function () {\n            emitter.emit('error', error);\n            emitter.removeAllListeners();\n        }, 1);\n    }\n\n    return emitter;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method _jsonInterfaceMethodToString\n * @param {Object} json\n * @return {String} full function/event name\n */\nvar _jsonInterfaceMethodToString = function (json) {\n    if (_.isObject(json) && json.name && json.name.indexOf('(') !== -1) {\n        return json.name;\n    }\n\n    var typeName = json.inputs.map(function(i){return i.type; }).join(',');\n    return json.name + '(' + typeName + ')';\n};\n\n\n\n/**\n * Should be called to get ascii from it's hex representation\n *\n * @method hexToAscii\n * @param {String} hex\n * @returns {String} ascii string representation of hex value\n */\nvar hexToAscii = function(hex) {\n    if (!utils.isHexStrict(hex))\n        throw new Error('The parameter must be a valid HEX string.');\n\n    var str = \"\";\n    var i = 0, l = hex.length;\n    if (hex.substring(0, 2) === '0x') {\n        i = 2;\n    }\n    for (; i < l; i+=2) {\n        var code = parseInt(hex.substr(i, 2), 16);\n        str += String.fromCharCode(code);\n    }\n\n    return str;\n};\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of ascii string\n *\n * @method asciiToHex\n * @param {String} str\n * @returns {String} hex representation of input string\n */\nvar asciiToHex = function(str) {\n    if(!str)\n        return \"0x00\";\n    var hex = \"\";\n    for(var i = 0; i < str.length; i++) {\n        var code = str.charCodeAt(i);\n        var n = code.toString(16);\n        hex += n.length < 2 ? '0' + n : n;\n    }\n\n    return \"0x\" + hex;\n};\n\n\n\n/**\n * Returns value of unit in Wei\n *\n * @method getUnitValue\n * @param {String} unit the unit to convert to, default ether\n * @returns {BN} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getUnitValue = function (unit) {\n    unit = unit ? unit.toLowerCase() : 'ether';\n    if (!ethjsUnit.unitMap[unit]) {\n        throw new Error('This unit \"'+ unit +'\" doesn\\'t exist, please use the one of the following units' + JSON.stringify(ethjsUnit.unitMap, null, 2));\n    }\n    return unit;\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n *   SI Short   SI Full        Effigy       Other\n * - kwei       femtoether     babbage\n * - mwei       picoether      lovelace\n * - gwei       nanoether      shannon      nano\n * - --         microether     szabo        micro\n * - --         milliether     finney       milli\n * - ether      --             --\n * - kether                    --           grand\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\n */\nvar fromWei = function(number, unit) {\n    unit = getUnitValue(unit);\n\n    if(!utils.isBN(number) && !_.isString(number)) {\n        throw new Error('Please pass numbers as strings or BigNumber objects to avoid precision errors.');\n    }\n\n    return utils.isBN(number) ? ethjsUnit.fromWei(number, unit) : ethjsUnit.fromWei(number, unit).toString(10);\n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n *   SI Short   SI Full        Effigy       Other\n * - kwei       femtoether     babbage\n * - mwei       picoether      lovelace\n * - gwei       nanoether      shannon      nano\n * - --         microether     szabo        micro\n * - --         microether     szabo        micro\n * - --         milliether     finney       milli\n * - ether      --             --\n * - kether                    --           grand\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BN} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\n */\nvar toWei = function(number, unit) {\n    unit = getUnitValue(unit);\n\n    if(!utils.isBN(number) && !_.isString(number)) {\n        throw new Error('Please pass numbers as strings or BigNumber objects to avoid precision errors.');\n    }\n\n    return utils.isBN(number) ? ethjsUnit.toWei(number, unit) : ethjsUnit.toWei(number, unit).toString(10);\n};\n\n\n\n\n/**\n * Converts to a checksum address\n *\n * @method toChecksumAddress\n * @param {String} address the given HEX address\n * @return {String}\n */\nvar toChecksumAddress = function (address) {\n    if (typeof address === 'undefined') return '';\n\n    if(!/^(0x)?[0-9a-f]{40}$/i.test(address))\n        throw new Error('Given address \"'+ address +'\" is not a valid Ethereum address.');\n\n\n\n    address = address.toLowerCase().replace(/^0x/i,'');\n    var addressHash = utils.sha3(address).replace(/^0x/i,'');\n    var checksumAddress = '0x';\n\n    for (var i = 0; i < address.length; i++ ) {\n        // If ith character is 9 to f then make it uppercase\n        if (parseInt(addressHash[i], 16) > 7) {\n            checksumAddress += address[i].toUpperCase();\n        } else {\n            checksumAddress += address[i];\n        }\n    }\n    return checksumAddress;\n};\n\n\n\nmodule.exports = {\n    _fireError: _fireError,\n    _jsonInterfaceMethodToString: _jsonInterfaceMethodToString,\n    // extractDisplayName: extractDisplayName,\n    // extractTypeName: extractTypeName,\n    randomHex: randomHex,\n    _: _,\n    BN: utils.BN,\n    isBN: utils.isBN,\n    isBigNumber: utils.isBigNumber,\n    isHex: utils.isHex,\n    isHexStrict: utils.isHexStrict,\n    sha3: utils.sha3,\n    keccak256: utils.sha3,\n    soliditySha3: soliditySha3,\n    isAddress: utils.isAddress,\n    checkAddressChecksum: utils.checkAddressChecksum,\n    toChecksumAddress: toChecksumAddress,\n    toHex: utils.toHex,\n    toBN: utils.toBN,\n\n    bytesToHex: utils.bytesToHex,\n    hexToBytes: utils.hexToBytes,\n\n    hexToNumberString: utils.hexToNumberString,\n\n    hexToNumber: utils.hexToNumber,\n    toDecimal: utils.hexToNumber, // alias\n\n    numberToHex: utils.numberToHex,\n    fromDecimal: utils.numberToHex, // alias\n\n    hexToUtf8: utils.hexToUtf8,\n    hexToString: utils.hexToUtf8,\n    toUtf8: utils.hexToUtf8,\n\n    utf8ToHex: utils.utf8ToHex,\n    stringToHex: utils.utf8ToHex,\n    fromUtf8: utils.utf8ToHex,\n\n    hexToAscii: hexToAscii,\n    toAscii: hexToAscii,\n    asciiToHex: asciiToHex,\n    fromAscii: asciiToHex,\n\n    unitMap: ethjsUnit.unitMap,\n    toWei: toWei,\n    fromWei: fromWei,\n\n    padLeft: utils.leftPad,\n    leftPad: utils.leftPad,\n    padRight: utils.rightPad,\n    rightPad: utils.rightPad,\n    toTwosComplement: utils.toTwosComplement\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-utils/src/index.js\n// module id = 47\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-utils/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file utils.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\nvar _ = __webpack_require__(11);\nvar ethjsUnit = __webpack_require__(408);\nvar utils = __webpack_require__(392);\nvar soliditySha3 = __webpack_require__(794);\nvar randomHex = __webpack_require__(525);\n\n\n\n/**\n * Fires an error in an event emitter and callback and returns the eventemitter\n *\n * @method _fireError\n * @param {Object} error a string, a error, or an object with {message, data}\n * @param {Object} emitter\n * @param {Function} reject\n * @param {Function} callback\n * @return {Object} the emitter\n */\nvar _fireError = function (error, emitter, reject, callback) {\n    /*jshint maxcomplexity: 10 */\n\n    // add data if given\n    if(_.isObject(error) && !(error instanceof Error) &&  error.data) {\n        if(_.isObject(error.data) || _.isArray(error.data)) {\n            error.data = JSON.stringify(error.data, null, 2);\n        }\n\n        error = error.message +\"\\n\"+ error.data;\n    }\n\n    if(_.isString(error)) {\n        error = new Error(error);\n    }\n\n    if (_.isFunction(callback)) {\n        callback(error);\n    }\n    if (_.isFunction(reject)) {\n        // suppress uncatched error if an error listener is present\n        // OR suppress uncatched error if an callback listener is present\n        if (emitter &&\n            (_.isFunction(emitter.listeners) &&\n            emitter.listeners('error').length) || _.isFunction(callback)) {\n            emitter.catch(function(){});\n        }\n        // reject later, to be able to return emitter\n        setTimeout(function () {\n            reject(error);\n        }, 1);\n    }\n\n    if(emitter && _.isFunction(emitter.emit)) {\n        // emit later, to be able to return emitter\n        setTimeout(function () {\n            emitter.emit('error', error);\n            emitter.removeAllListeners();\n        }, 1);\n    }\n\n    return emitter;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method _jsonInterfaceMethodToString\n * @param {Object} json\n * @return {String} full function/event name\n */\nvar _jsonInterfaceMethodToString = function (json) {\n    if (_.isObject(json) && json.name && json.name.indexOf('(') !== -1) {\n        return json.name;\n    }\n\n    var typeName = json.inputs.map(function(i){return i.type; }).join(',');\n    return json.name + '(' + typeName + ')';\n};\n\n\n\n/**\n * Should be called to get ascii from it's hex representation\n *\n * @method hexToAscii\n * @param {String} hex\n * @returns {String} ascii string representation of hex value\n */\nvar hexToAscii = function(hex) {\n    if (!utils.isHexStrict(hex))\n        throw new Error('The parameter must be a valid HEX string.');\n\n    var str = \"\";\n    var i = 0, l = hex.length;\n    if (hex.substring(0, 2) === '0x') {\n        i = 2;\n    }\n    for (; i < l; i+=2) {\n        var code = parseInt(hex.substr(i, 2), 16);\n        str += String.fromCharCode(code);\n    }\n\n    return str;\n};\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of ascii string\n *\n * @method asciiToHex\n * @param {String} str\n * @returns {String} hex representation of input string\n */\nvar asciiToHex = function(str) {\n    if(!str)\n        return \"0x00\";\n    var hex = \"\";\n    for(var i = 0; i < str.length; i++) {\n        var code = str.charCodeAt(i);\n        var n = code.toString(16);\n        hex += n.length < 2 ? '0' + n : n;\n    }\n\n    return \"0x\" + hex;\n};\n\n\n\n/**\n * Returns value of unit in Wei\n *\n * @method getUnitValue\n * @param {String} unit the unit to convert to, default ether\n * @returns {BN} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getUnitValue = function (unit) {\n    unit = unit ? unit.toLowerCase() : 'ether';\n    if (!ethjsUnit.unitMap[unit]) {\n        throw new Error('This unit \"'+ unit +'\" doesn\\'t exist, please use the one of the following units' + JSON.stringify(ethjsUnit.unitMap, null, 2));\n    }\n    return unit;\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n *   SI Short   SI Full        Effigy       Other\n * - kwei       femtoether     babbage\n * - mwei       picoether      lovelace\n * - gwei       nanoether      shannon      nano\n * - --         microether     szabo        micro\n * - --         milliether     finney       milli\n * - ether      --             --\n * - kether                    --           grand\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\n */\nvar fromWei = function(number, unit) {\n    unit = getUnitValue(unit);\n\n    if(!utils.isBN(number) && !_.isString(number)) {\n        throw new Error('Please pass numbers as strings or BigNumber objects to avoid precision errors.');\n    }\n\n    return utils.isBN(number) ? ethjsUnit.fromWei(number, unit) : ethjsUnit.fromWei(number, unit).toString(10);\n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n *   SI Short   SI Full        Effigy       Other\n * - kwei       femtoether     babbage\n * - mwei       picoether      lovelace\n * - gwei       nanoether      shannon      nano\n * - --         microether     szabo        micro\n * - --         microether     szabo        micro\n * - --         milliether     finney       milli\n * - ether      --             --\n * - kether                    --           grand\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BN} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\n */\nvar toWei = function(number, unit) {\n    unit = getUnitValue(unit);\n\n    if(!utils.isBN(number) && !_.isString(number)) {\n        throw new Error('Please pass numbers as strings or BigNumber objects to avoid precision errors.');\n    }\n\n    return utils.isBN(number) ? ethjsUnit.toWei(number, unit) : ethjsUnit.toWei(number, unit).toString(10);\n};\n\n\n\n\n/**\n * Converts to a checksum address\n *\n * @method toChecksumAddress\n * @param {String} address the given HEX address\n * @return {String}\n */\nvar toChecksumAddress = function (address) {\n    if (typeof address === 'undefined') return '';\n\n    if(!/^(0x)?[0-9a-f]{40}$/i.test(address))\n        throw new Error('Given address \"'+ address +'\" is not a valid Ethereum address.');\n\n\n\n    address = address.toLowerCase().replace(/^0x/i,'');\n    var addressHash = utils.sha3(address).replace(/^0x/i,'');\n    var checksumAddress = '0x';\n\n    for (var i = 0; i < address.length; i++ ) {\n        // If ith character is 9 to f then make it uppercase\n        if (parseInt(addressHash[i], 16) > 7) {\n            checksumAddress += address[i].toUpperCase();\n        } else {\n            checksumAddress += address[i];\n        }\n    }\n    return checksumAddress;\n};\n\n\n\nmodule.exports = {\n    _fireError: _fireError,\n    _jsonInterfaceMethodToString: _jsonInterfaceMethodToString,\n    // extractDisplayName: extractDisplayName,\n    // extractTypeName: extractTypeName,\n    randomHex: randomHex,\n    _: _,\n    BN: utils.BN,\n    isBN: utils.isBN,\n    isBigNumber: utils.isBigNumber,\n    isHex: utils.isHex,\n    isHexStrict: utils.isHexStrict,\n    sha3: utils.sha3,\n    keccak256: utils.sha3,\n    soliditySha3: soliditySha3,\n    isAddress: utils.isAddress,\n    checkAddressChecksum: utils.checkAddressChecksum,\n    toChecksumAddress: toChecksumAddress,\n    toHex: utils.toHex,\n    toBN: utils.toBN,\n\n    bytesToHex: utils.bytesToHex,\n    hexToBytes: utils.hexToBytes,\n\n    hexToNumberString: utils.hexToNumberString,\n\n    hexToNumber: utils.hexToNumber,\n    toDecimal: utils.hexToNumber, // alias\n\n    numberToHex: utils.numberToHex,\n    fromDecimal: utils.numberToHex, // alias\n\n    hexToUtf8: utils.hexToUtf8,\n    hexToString: utils.hexToUtf8,\n    toUtf8: utils.hexToUtf8,\n\n    utf8ToHex: utils.utf8ToHex,\n    stringToHex: utils.utf8ToHex,\n    fromUtf8: utils.utf8ToHex,\n\n    hexToAscii: hexToAscii,\n    toAscii: hexToAscii,\n    asciiToHex: asciiToHex,\n    fromAscii: asciiToHex,\n\n    unitMap: ethjsUnit.unitMap,\n    toWei: toWei,\n    fromWei: fromWei,\n\n    padLeft: utils.leftPad,\n    leftPad: utils.leftPad,\n    padRight: utils.rightPad,\n    rightPad: utils.rightPad,\n    toTwosComplement: utils.toTwosComplement\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-utils/src/index.js\n// module id = 48\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-utils/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihash = __webpack_require__(32)\nconst crypto = __webpack_require__(1109)\n\nmodule.exports = Multihashing\n\n/**\n * Hash the given `buf` using the algorithm specified\n * by `func`.\n *\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nfunction Multihashing (buf, func, length, callback) {\n  if (typeof length === 'function') {\n    callback = length\n    length = undefined\n  }\n\n  if (!callback) {\n    throw new Error('Missing callback')\n  }\n\n  Multihashing.digest(buf, func, length, (err, digest) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, multihash.encode(digest, func, length))\n  })\n}\n\n/**\n * The `buffer` module for easy use in the browser.\n *\n * @type {Buffer}\n */\nMultihashing.Buffer = Buffer // for browser things\n\n/**\n * Expose multihash itself, to avoid silly double requires.\n */\nMultihashing.multihash = multihash\n\n/**\n * @param {Buffer} buf - The value to hash.\n * @param {number|string} func - The algorithm to use.\n * @param {number} [length] - Optionally trim the result to this length.\n * @param {function(Error, Buffer)} callback\n * @returns {undefined}\n */\nMultihashing.digest = function (buf, func, length, callback) {\n  if (typeof length === 'function') {\n    callback = length\n    length = undefined\n  }\n\n  if (!callback) {\n    throw new Error('Missing callback')\n  }\n\n  let cb = callback\n  if (length) {\n    cb = (err, digest) => {\n      if (err) {\n        return callback(err)\n      }\n\n      callback(null, digest.slice(0, length))\n    }\n  }\n\n  let hash\n  try {\n    hash = Multihashing.createHash(func)\n  } catch (err) {\n    return cb(err)\n  }\n\n  hash(buf, cb)\n}\n\n/**\n * @param {string|number} func\n *\n * @returns {function} - The to `func` corresponding hash function.\n */\nMultihashing.createHash = function (func) {\n  func = multihash.coerceCode(func)\n  if (!Multihashing.functions[func]) {\n    throw new Error('multihash function ' + func + ' not yet supported')\n  }\n\n  return Multihashing.functions[func]\n}\n\n/**\n * Mapping of multihash codes to their hashing functions.\n * @type {Object}\n */\nMultihashing.functions = {\n  // sha1\n  0x11: crypto.sha1,\n  // sha2-256\n  0x12: crypto.sha2256,\n  // sha2-512\n  0x13: crypto.sha2512,\n  // sha3-512\n  0x14: crypto.sha3512,\n  // sha3-384\n  0x15: crypto.sha3384,\n  // sha3-256\n  0x16: crypto.sha3256,\n  // sha3-224\n  0x17: crypto.sha3224,\n  // shake-128\n  0x18: crypto.shake128,\n  // shake-256\n  0x19: crypto.shake256,\n  // keccak-224\n  0x1A: crypto.keccak224,\n  // keccak-256\n  0x1B: crypto.keccak256,\n  // keccak-384\n  0x1C: crypto.keccak384,\n  // keccak-512\n  0x1D: crypto.keccak512,\n  // murmur3-128\n  0x22: crypto.murmur3128,\n  // murmur3-32\n  0x23: crypto.murmur332,\n  // dbl-sha2-256\n  0x56: crypto.dblSha2256\n}\n\n// add blake functions\ncrypto.addBlake(Multihashing.functions)\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashing-async/src/index.js\n// module id = 49\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashing-async/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar bufferUtil = __webpack_require__(18);\nvar assert = __webpack_require__(16);\n\nvar BufferWriter = function BufferWriter(obj) {\n  if (!(this instanceof BufferWriter))\n    return new BufferWriter(obj);\n  if (obj)\n    this.set(obj);\n  else\n    this.bufs = [];\n};\n\nBufferWriter.prototype.set = function(obj) {\n  this.bufs = obj.bufs || this.bufs || [];\n  return this;\n};\n\nBufferWriter.prototype.toBuffer = function() {\n  return this.concat();\n};\n\nBufferWriter.prototype.concat = function() {\n  return Buffer.concat(this.bufs);\n};\n\nBufferWriter.prototype.write = function(buf) {\n  assert(bufferUtil.isBuffer(buf));\n  this.bufs.push(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeReverse = function(buf) {\n  assert(bufferUtil.isBuffer(buf));\n  this.bufs.push(bufferUtil.reverse(buf));\n  return this;\n};\n\nBufferWriter.prototype.writeUInt8 = function(n) {\n  var buf = new Buffer(1);\n  buf.writeUInt8(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt16BE = function(n) {\n  var buf = new Buffer(2);\n  buf.writeUInt16BE(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt16LE = function(n) {\n  var buf = new Buffer(2);\n  buf.writeUInt16LE(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt32BE = function(n) {\n  var buf = new Buffer(4);\n  buf.writeUInt32BE(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeInt32LE = function(n) {\n  var buf = new Buffer(4);\n  buf.writeInt32LE(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt32LE = function(n) {\n  var buf = new Buffer(4);\n  buf.writeUInt32LE(n, 0);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt64BEBN = function(bn) {\n  var buf = bn.toBuffer({size: 8});\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeUInt64LEBN = function(bn) {\n  var buf = bn.toBuffer({size: 8});\n  this.writeReverse(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeVarintNum = function(n) {\n  var buf = BufferWriter.varintBufNum(n);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.prototype.writeVarintBN = function(bn) {\n  var buf = BufferWriter.varintBufBN(bn);\n  this.write(buf);\n  return this;\n};\n\nBufferWriter.varintBufNum = function(n) {\n  var buf = undefined;\n  if (n < 253) {\n    buf = new Buffer(1);\n    buf.writeUInt8(n, 0);\n  } else if (n < 0x10000) {\n    buf = new Buffer(1 + 2);\n    buf.writeUInt8(253, 0);\n    buf.writeUInt16LE(n, 1);\n  } else if (n < 0x100000000) {\n    buf = new Buffer(1 + 4);\n    buf.writeUInt8(254, 0);\n    buf.writeUInt32LE(n, 1);\n  } else {\n    buf = new Buffer(1 + 8);\n    buf.writeUInt8(255, 0);\n    buf.writeInt32LE(n & -1, 1);\n    buf.writeUInt32LE(Math.floor(n / 0x100000000), 5);\n  }\n  return buf;\n};\n\nBufferWriter.varintBufBN = function(bn) {\n  var buf = undefined;\n  var n = bn.toNumber();\n  if (n < 253) {\n    buf = new Buffer(1);\n    buf.writeUInt8(n, 0);\n  } else if (n < 0x10000) {\n    buf = new Buffer(1 + 2);\n    buf.writeUInt8(253, 0);\n    buf.writeUInt16LE(n, 1);\n  } else if (n < 0x100000000) {\n    buf = new Buffer(1 + 4);\n    buf.writeUInt8(254, 0);\n    buf.writeUInt32LE(n, 1);\n  } else {\n    var bw = new BufferWriter();\n    bw.writeUInt8(255);\n    bw.writeUInt64LEBN(bn);\n    var buf = bw.concat();\n  }\n  return buf;\n};\n\nmodule.exports = BufferWriter;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/encoding/bufferwriter.js\n// module id = 50\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/encoding/bufferwriter.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = series;\n\nvar _parallel = __webpack_require__(331);\n\nvar _parallel2 = _interopRequireDefault(_parallel);\n\nvar _eachOfSeries = __webpack_require__(327);\n\nvar _eachOfSeries2 = _interopRequireDefault(_eachOfSeries);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n *  results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @example\n * async.series([\n *     function(callback) {\n *         // do some stuff ...\n *         callback(null, 'one');\n *     },\n *     function(callback) {\n *         // do some more stuff ...\n *         callback(null, 'two');\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // results is now equal to ['one', 'two']\n * });\n *\n * async.series({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback){\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equal to: {one: 1, two: 2}\n * });\n */\nfunction series(tasks, callback) {\n  (0, _parallel2.default)(_eachOfSeries2.default, tasks, callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/series.js\n// module id = 51\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/series.js")},function(module,exports,__webpack_require__){eval("/**\n * An API for getting cryptographically-secure random bytes. The bytes are\n * generated using the Fortuna algorithm devised by Bruce Schneier and\n * Niels Ferguson.\n *\n * Getting strong random bytes is not yet easy to do in javascript. The only\n * truish random entropy that can be collected is from the mouse, keyboard, or\n * from timing with respect to page loads, etc. This generator makes a poor\n * attempt at providing random bytes when those sources haven't yet provided\n * enough entropy to initially seed or to reseed the PRNG.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2009-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(493);\n__webpack_require__(491);\n__webpack_require__(9);\n\n(function() {\n\n// forge.random already defined\nif(forge.random && forge.random.getBytes) {\n  module.exports = forge.random;\n  return;\n}\n\n(function(jQuery) {\n\n// the default prng plugin, uses AES-128\nvar prng_aes = {};\nvar _prng_aes_output = new Array(4);\nvar _prng_aes_buffer = forge.util.createBuffer();\nprng_aes.formatKey = function(key) {\n  // convert the key into 32-bit integers\n  var tmp = forge.util.createBuffer(key);\n  key = new Array(4);\n  key[0] = tmp.getInt32();\n  key[1] = tmp.getInt32();\n  key[2] = tmp.getInt32();\n  key[3] = tmp.getInt32();\n\n  // return the expanded key\n  return forge.aes._expandKey(key, false);\n};\nprng_aes.formatSeed = function(seed) {\n  // convert seed into 32-bit integers\n  var tmp = forge.util.createBuffer(seed);\n  seed = new Array(4);\n  seed[0] = tmp.getInt32();\n  seed[1] = tmp.getInt32();\n  seed[2] = tmp.getInt32();\n  seed[3] = tmp.getInt32();\n  return seed;\n};\nprng_aes.cipher = function(key, seed) {\n  forge.aes._updateBlock(key, seed, _prng_aes_output, false);\n  _prng_aes_buffer.putInt32(_prng_aes_output[0]);\n  _prng_aes_buffer.putInt32(_prng_aes_output[1]);\n  _prng_aes_buffer.putInt32(_prng_aes_output[2]);\n  _prng_aes_buffer.putInt32(_prng_aes_output[3]);\n  return _prng_aes_buffer.getBytes();\n};\nprng_aes.increment = function(seed) {\n  // FIXME: do we care about carry or signed issues?\n  ++seed[3];\n  return seed;\n};\nprng_aes.md = forge.md.sha256;\n\n/**\n * Creates a new PRNG.\n */\nfunction spawnPrng() {\n  var ctx = forge.prng.create(prng_aes);\n\n  /**\n   * Gets random bytes. If a native secure crypto API is unavailable, this\n   * method tries to make the bytes more unpredictable by drawing from data that\n   * can be collected from the user of the browser, eg: mouse movement.\n   *\n   * If a callback is given, this method will be called asynchronously.\n   *\n   * @param count the number of random bytes to get.\n   * @param [callback(err, bytes)] called once the operation completes.\n   *\n   * @return the random bytes in a string.\n   */\n  ctx.getBytes = function(count, callback) {\n    return ctx.generate(count, callback);\n  };\n\n  /**\n   * Gets random bytes asynchronously. If a native secure crypto API is\n   * unavailable, this method tries to make the bytes more unpredictable by\n   * drawing from data that can be collected from the user of the browser,\n   * eg: mouse movement.\n   *\n   * @param count the number of random bytes to get.\n   *\n   * @return the random bytes in a string.\n   */\n  ctx.getBytesSync = function(count) {\n    return ctx.generate(count);\n  };\n\n  return ctx;\n}\n\n// create default prng context\nvar _ctx = spawnPrng();\n\n// add other sources of entropy only if window.crypto.getRandomValues is not\n// available -- otherwise this source will be automatically used by the prng\nvar getRandomValues = null;\nif(typeof window !== 'undefined') {\n  var _crypto = window.crypto || window.msCrypto;\n  if(_crypto && _crypto.getRandomValues) {\n    getRandomValues = function(arr) {\n      return _crypto.getRandomValues(arr);\n    };\n  }\n}\nif(forge.options.usePureJavaScript ||\n  (!forge.util.isNodejs && !getRandomValues)) {\n  // if this is a web worker, do not use weak entropy, instead register to\n  // receive strong entropy asynchronously from the main thread\n  if(typeof window === 'undefined' || window.document === undefined) {\n    // FIXME:\n  }\n\n  // get load time entropy\n  _ctx.collectInt(+new Date(), 32);\n\n  // add some entropy from navigator object\n  if(typeof(navigator) !== 'undefined') {\n    var _navBytes = '';\n    for(var key in navigator) {\n      try {\n        if(typeof(navigator[key]) == 'string') {\n          _navBytes += navigator[key];\n        }\n      } catch(e) {\n        /* Some navigator keys might not be accessible, e.g. the geolocation\n          attribute throws an exception if touched in Mozilla chrome://\n          context.\n\n          Silently ignore this and just don't use this as a source of\n          entropy. */\n      }\n    }\n    _ctx.collect(_navBytes);\n    _navBytes = null;\n  }\n\n  // add mouse and keyboard collectors if jquery is available\n  if(jQuery) {\n    // set up mouse entropy capture\n    jQuery().mousemove(function(e) {\n      // add mouse coords\n      _ctx.collectInt(e.clientX, 16);\n      _ctx.collectInt(e.clientY, 16);\n    });\n\n    // set up keyboard entropy capture\n    jQuery().keypress(function(e) {\n      _ctx.collectInt(e.charCode, 8);\n    });\n  }\n}\n\n/* Random API */\nif(!forge.random) {\n  forge.random = _ctx;\n} else {\n  // extend forge.random with _ctx\n  for(var key in _ctx) {\n    forge.random[key] = _ctx[key];\n  }\n}\n\n// expose spawn PRNG\nforge.random.createInstance = spawnPrng;\n\nmodule.exports = forge.random;\n\n})(typeof(jQuery) !== 'undefined' ? jQuery : null);\n\n})();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/random.js\n// module id = 52\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/random.js")},function(module,exports,__webpack_require__){eval("var wrappy = __webpack_require__(1308)\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n  Object.defineProperty(Function.prototype, 'once', {\n    value: function () {\n      return once(this)\n    },\n    configurable: true\n  })\n\n  Object.defineProperty(Function.prototype, 'onceStrict', {\n    value: function () {\n      return onceStrict(this)\n    },\n    configurable: true\n  })\n})\n\nfunction once (fn) {\n  var f = function () {\n    if (f.called) return f.value\n    f.called = true\n    return f.value = fn.apply(this, arguments)\n  }\n  f.called = false\n  return f\n}\n\nfunction onceStrict (fn) {\n  var f = function () {\n    if (f.called)\n      throw new Error(f.onceError)\n    f.called = true\n    return f.value = fn.apply(this, arguments)\n  }\n  var name = fn.name || 'Function wrapped with `once`'\n  f.onceError = name + \" shouldn't be called more than once\"\n  f.called = false\n  return f\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/once/once.js\n// module id = 53\n// module chunks = 0\n\n//# sourceURL=../node_modules/once/once.js")},function(module,exports){eval("module.exports = pullPushable\n\nfunction pullPushable (separated, onClose) {\n  if (typeof separated === 'function') {\n    onClose = separated\n    separated = false\n  }\n\n  // create a buffer for data\n  // that have been pushed\n  // but not yet pulled.\n  var buffer = []\n\n  // a pushable is a source stream\n  // (abort, cb) => cb(end, data)\n  //\n  // when pushable is pulled,\n  // keep references to abort and cb\n  // so we can call back after\n  // .end(end) or .push(data)\n  var abort, cb\n  function read (_abort, _cb) {\n    if (_abort) {\n      abort = _abort\n      // if there is already a cb waiting, abort it.\n      if (cb) callback(abort)\n    }\n    cb = _cb\n    drain()\n  }\n\n  var ended\n  function end (end) {\n    ended = ended || end || true\n    // attempt to drain\n    drain()\n  }\n\n  function push (data) {\n    if (ended) return\n    // if sink already waiting,\n    // we can call back directly.\n    if (cb) {\n      callback(abort, data)\n      return\n    }\n    // otherwise buffer data\n    buffer.push(data)\n  }\n\n  // Return functions separated from source { push, end, source }\n  if (separated) {\n    return { push: push, end: end, source: read, buffer: buffer }\n  }\n\n  // Return normal\n  read.push = push\n  read.end = end\n  read.buffer = buffer\n  return read\n\n  // `drain` calls back to (if any) waiting\n  // sink with abort, end, or next data.\n  function drain () {\n    if (!cb) return\n\n    if (abort) callback(abort)\n    else if (!buffer.length && ended) callback(ended)\n    else if (buffer.length) callback(null, buffer.shift())\n  }\n\n  // `callback` calls back to waiting sink,\n  // and removes references to sink cb.\n  function callback (err, val) {\n    var _cb = cb\n    // if error and pushable passed onClose, call it\n    // the first time this stream ends or errors.\n    if (err && onClose) {\n      var c = onClose\n      onClose = null\n      c(err === true ? null : err)\n    }\n    cb = null\n    _cb(err, val)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-pushable/index.js\n// module id = 54\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-pushable/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BN = __webpack_require__(30);\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\nvar Signature = function Signature(r, s) {\n  if (!(this instanceof Signature)) {\n    return new Signature(r, s);\n  }\n  if (r instanceof BN) {\n    this.set({\n      r: r,\n      s: s\n    });\n  } else if (r) {\n    var obj = r;\n    this.set(obj);\n  }\n};\n\n/* jshint maxcomplexity: 7 */\nSignature.prototype.set = function(obj) {\n  this.r = obj.r || this.r || undefined;\n  this.s = obj.s || this.s || undefined;\n  this.i = typeof obj.i !== 'undefined' ? obj.i : this.i; //public key recovery parameter in range [0, 3]\n  this.compressed = typeof obj.compressed !== 'undefined' ?\n    obj.compressed : this.compressed; //whether the recovered pubkey is compressed\n  this.nhashtype = obj.nhashtype || this.nhashtype || undefined;\n  return this;\n};\n\nSignature.fromCompact = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf), 'Argument is expected to be a Buffer');\n\n  var sig = new Signature();\n\n  var compressed = true;\n  var i = buf.slice(0, 1)[0] - 27 - 4;\n  if (i < 0) {\n    compressed = false;\n    i = i + 4;\n  }\n\n  var b2 = buf.slice(1, 33);\n  var b3 = buf.slice(33, 65);\n\n  $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be 0, 1, 2, or 3'));\n  $.checkArgument(b2.length === 32, new Error('r must be 32 bytes'));\n  $.checkArgument(b3.length === 32, new Error('s must be 32 bytes'));\n\n  sig.compressed = compressed;\n  sig.i = i;\n  sig.r = BN.fromBuffer(b2);\n  sig.s = BN.fromBuffer(b3);\n\n  return sig;\n};\n\nSignature.fromDER = Signature.fromBuffer = function(buf, strict) {\n  var obj = Signature.parseDER(buf, strict);\n  var sig = new Signature();\n\n  sig.r = obj.r;\n  sig.s = obj.s;\n\n  return sig;\n};\n\n// The format used in a tx\nSignature.fromTxFormat = function(buf) {\n  var nhashtype = buf.readUInt8(buf.length - 1);\n  var derbuf = buf.slice(0, buf.length - 1);\n  var sig = new Signature.fromDER(derbuf, false);\n  sig.nhashtype = nhashtype;\n  return sig;\n};\n\nSignature.fromString = function(str) {\n  var buf = new Buffer(str, 'hex');\n  return Signature.fromDER(buf);\n};\n\n\n/**\n * In order to mimic the non-strict DER encoding of OpenSSL, set strict = false.\n */\nSignature.parseDER = function(buf, strict) {\n  $.checkArgument(BufferUtil.isBuffer(buf), new Error('DER formatted signature should be a buffer'));\n  if (_.isUndefined(strict)) {\n    strict = true;\n  }\n\n  var header = buf[0];\n  $.checkArgument(header === 0x30, new Error('Header byte should be 0x30'));\n\n  var length = buf[1];\n  var buflength = buf.slice(2).length;\n  $.checkArgument(!strict || length === buflength, new Error('Length byte should length of what follows'));\n\n  length = length < buflength ? length : buflength;\n\n  var rheader = buf[2 + 0];\n  $.checkArgument(rheader === 0x02, new Error('Integer byte for r should be 0x02'));\n\n  var rlength = buf[2 + 1];\n  var rbuf = buf.slice(2 + 2, 2 + 2 + rlength);\n  var r = BN.fromBuffer(rbuf);\n  var rneg = buf[2 + 1 + 1] === 0x00 ? true : false;\n  $.checkArgument(rlength === rbuf.length, new Error('Length of r incorrect'));\n\n  var sheader = buf[2 + 2 + rlength + 0];\n  $.checkArgument(sheader === 0x02, new Error('Integer byte for s should be 0x02'));\n\n  var slength = buf[2 + 2 + rlength + 1];\n  var sbuf = buf.slice(2 + 2 + rlength + 2, 2 + 2 + rlength + 2 + slength);\n  var s = BN.fromBuffer(sbuf);\n  var sneg = buf[2 + 2 + rlength + 2 + 2] === 0x00 ? true : false;\n  $.checkArgument(slength === sbuf.length, new Error('Length of s incorrect'));\n\n  var sumlength = 2 + 2 + rlength + 2 + slength;\n  $.checkArgument(length === sumlength - 2, new Error('Length of signature incorrect'));\n\n  var obj = {\n    header: header,\n    length: length,\n    rheader: rheader,\n    rlength: rlength,\n    rneg: rneg,\n    rbuf: rbuf,\n    r: r,\n    sheader: sheader,\n    slength: slength,\n    sneg: sneg,\n    sbuf: sbuf,\n    s: s\n  };\n\n  return obj;\n};\n\n\nSignature.prototype.toCompact = function(i, compressed) {\n  i = typeof i === 'number' ? i : this.i;\n  compressed = typeof compressed === 'boolean' ? compressed : this.compressed;\n\n  if (!(i === 0 || i === 1 || i === 2 || i === 3)) {\n    throw new Error('i must be equal to 0, 1, 2, or 3');\n  }\n\n  var val = i + 27 + 4;\n  if (compressed === false) {\n    val = val - 4;\n  }\n  var b1 = new Buffer([val]);\n  var b2 = this.r.toBuffer({\n    size: 32\n  });\n  var b3 = this.s.toBuffer({\n    size: 32\n  });\n  return Buffer.concat([b1, b2, b3]);\n};\n\nSignature.prototype.toBuffer = Signature.prototype.toDER = function() {\n  var rnbuf = this.r.toBuffer();\n  var snbuf = this.s.toBuffer();\n\n  var rneg = rnbuf[0] & 0x80 ? true : false;\n  var sneg = snbuf[0] & 0x80 ? true : false;\n\n  var rbuf = rneg ? Buffer.concat([new Buffer([0x00]), rnbuf]) : rnbuf;\n  var sbuf = sneg ? Buffer.concat([new Buffer([0x00]), snbuf]) : snbuf;\n\n  var rlength = rbuf.length;\n  var slength = sbuf.length;\n  var length = 2 + rlength + 2 + slength;\n  var rheader = 0x02;\n  var sheader = 0x02;\n  var header = 0x30;\n\n  var der = Buffer.concat([new Buffer([header, length, rheader, rlength]), rbuf, new Buffer([sheader, slength]), sbuf]);\n  return der;\n};\n\nSignature.prototype.toString = function() {\n  var buf = this.toDER();\n  return buf.toString('hex');\n};\n\n/**\n * This function is translated from bitcoind's IsDERSignature and is used in\n * the script interpreter.  This \"DER\" format actually includes an extra byte,\n * the nhashtype, at the end. It is really the tx format, not DER format.\n *\n * A canonical signature exists of: [30] [total len] [02] [len R] [R] [02] [len S] [S] [hashtype]\n * Where R and S are not negative (their first byte has its highest bit not set), and not\n * excessively padded (do not start with a 0 byte, unless an otherwise negative number follows,\n * in which case a single 0 byte is necessary and even required).\n *\n * See https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623\n */\nSignature.isTxDER = function(buf) {\n  if (buf.length < 9) {\n    //  Non-canonical signature: too short\n    return false;\n  }\n  if (buf.length > 73) {\n    // Non-canonical signature: too long\n    return false;\n  }\n  if (buf[0] !== 0x30) {\n    //  Non-canonical signature: wrong type\n    return false;\n  }\n  if (buf[1] !== buf.length - 3) {\n    //  Non-canonical signature: wrong length marker\n    return false;\n  }\n  var nLenR = buf[3];\n  if (5 + nLenR >= buf.length) {\n    //  Non-canonical signature: S length misplaced\n    return false;\n  }\n  var nLenS = buf[5 + nLenR];\n  if ((nLenR + nLenS + 7) !== buf.length) {\n    //  Non-canonical signature: R+S length mismatch\n    return false;\n  }\n\n  var R = buf.slice(4);\n  if (buf[4 - 2] !== 0x02) {\n    //  Non-canonical signature: R value type mismatch\n    return false;\n  }\n  if (nLenR === 0) {\n    //  Non-canonical signature: R length is zero\n    return false;\n  }\n  if (R[0] & 0x80) {\n    //  Non-canonical signature: R value negative\n    return false;\n  }\n  if (nLenR > 1 && (R[0] === 0x00) && !(R[1] & 0x80)) {\n    //  Non-canonical signature: R value excessively padded\n    return false;\n  }\n\n  var S = buf.slice(6 + nLenR);\n  if (buf[6 + nLenR - 2] !== 0x02) {\n    //  Non-canonical signature: S value type mismatch\n    return false;\n  }\n  if (nLenS === 0) {\n    //  Non-canonical signature: S length is zero\n    return false;\n  }\n  if (S[0] & 0x80) {\n    //  Non-canonical signature: S value negative\n    return false;\n  }\n  if (nLenS > 1 && (S[0] === 0x00) && !(S[1] & 0x80)) {\n    //  Non-canonical signature: S value excessively padded\n    return false;\n  }\n  return true;\n};\n\n/**\n * Compares to bitcoind's IsLowDERSignature\n * See also ECDSA signature algorithm which enforces this.\n * See also BIP 62, \"low S values in signatures\"\n */\nSignature.prototype.hasLowS = function() {\n  if (this.s.lt(new BN(1)) ||\n    this.s.gt(new BN('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex'))) {\n    return false;\n  }\n  return true;\n};\n\n/**\n * @returns true if the nhashtype is exactly equal to one of the standard options or combinations thereof.\n * Translated from bitcoind's IsDefinedHashtypeSignature\n */\nSignature.prototype.hasDefinedHashtype = function() {\n  if (!JSUtil.isNaturalNumber(this.nhashtype)) {\n    return false;\n  }\n  // accept with or without Signature.SIGHASH_ANYONECANPAY by ignoring the bit\n  var temp = this.nhashtype & ~Signature.SIGHASH_ANYONECANPAY;\n  if (temp < Signature.SIGHASH_ALL || temp > Signature.SIGHASH_SINGLE) {\n    return false;\n  }\n  return true;\n};\n\nSignature.prototype.toTxFormat = function() {\n  var derbuf = this.toDER();\n  var buf = new Buffer(1);\n  buf.writeUInt8(this.nhashtype, 0);\n  return Buffer.concat([derbuf, buf]);\n};\n\nSignature.SIGHASH_ALL = 0x01;\nSignature.SIGHASH_NONE = 0x02;\nSignature.SIGHASH_SINGLE = 0x03;\nSignature.SIGHASH_ANYONECANPAY = 0x80;\n\nmodule.exports = Signature;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/signature.js\n// module id = 55\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/signature.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\n\nfunction format(message, args) {\n  return message\n    .replace('{0}', args[0])\n    .replace('{1}', args[1])\n    .replace('{2}', args[2]);\n}\nvar traverseNode = function(parent, errorDefinition) {\n  var NodeError = function() {\n    if (_.isString(errorDefinition.message)) {\n      this.message = format(errorDefinition.message, arguments);\n    } else if (_.isFunction(errorDefinition.message)) {\n      this.message = errorDefinition.message.apply(null, arguments);\n    } else {\n      throw new Error('Invalid error definition for ' + errorDefinition.name);\n    }\n    this.stack = this.message + '\\n' + (new Error()).stack;\n  };\n  NodeError.prototype = Object.create(parent.prototype);\n  NodeError.prototype.name = parent.prototype.name + errorDefinition.name;\n  parent[errorDefinition.name] = NodeError;\n  if (errorDefinition.errors) {\n    childDefinitions(NodeError, errorDefinition.errors);\n  }\n  return NodeError;\n};\n\n/* jshint latedef: false */\nvar childDefinitions = function(parent, childDefinitions) {\n  _.each(childDefinitions, function(childDefinition) {\n    traverseNode(parent, childDefinition);\n  });\n};\n/* jshint latedef: true */\n\nvar traverseRoot = function(parent, errorsDefinition) {\n  childDefinitions(parent, errorsDefinition);\n  return parent;\n};\n\n\nvar bitcore = {};\nbitcore.Error = function() {\n  this.message = 'Internal error';\n  this.stack = this.message + '\\n' + (new Error()).stack;\n};\nbitcore.Error.prototype = Object.create(Error.prototype);\nbitcore.Error.prototype.name = 'bitcore.Error';\n\n\nvar data = __webpack_require__(1319);\ntraverseRoot(bitcore.Error, data);\n\nmodule.exports = bitcore.Error;\n\nmodule.exports.extend = function(spec) {\n  return traverseNode(bitcore.Error, spec);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/errors/index.js\n// module id = 56\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/errors/index.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(569);\n\nmodule.exports.Interpreter = __webpack_require__(1320);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/script/index.js\n// module id = 57\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/script/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n  if (Array.isArray) {\n    return Array.isArray(arg);\n  }\n  return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n  return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n  return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n  return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n  return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n  return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n  return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n  return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n  return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n  return arg === null ||\n         typeof arg === 'boolean' ||\n         typeof arg === 'number' ||\n         typeof arg === 'string' ||\n         typeof arg === 'symbol' ||  // ES6 symbol\n         typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n  return Object.prototype.toString.call(o);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-util-is/lib/util.js\n// module id = 58\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-util-is/lib/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar inherits = __webpack_require__(3)\nvar md5 = __webpack_require__(254)\nvar RIPEMD160 = __webpack_require__(306)\nvar sha = __webpack_require__(308)\n\nvar Base = __webpack_require__(77)\n\nfunction HashNoConstructor (hash) {\n  Base.call(this, 'digest')\n\n  this._hash = hash\n  this.buffers = []\n}\n\ninherits(HashNoConstructor, Base)\n\nHashNoConstructor.prototype._update = function (data) {\n  this.buffers.push(data)\n}\n\nHashNoConstructor.prototype._final = function () {\n  var buf = Buffer.concat(this.buffers)\n  var r = this._hash(buf)\n  this.buffers = null\n\n  return r\n}\n\nfunction Hash (hash) {\n  Base.call(this, 'digest')\n\n  this._hash = hash\n}\n\ninherits(Hash, Base)\n\nHash.prototype._update = function (data) {\n  this._hash.update(data)\n}\n\nHash.prototype._final = function () {\n  return this._hash.digest()\n}\n\nmodule.exports = function createHash (alg) {\n  alg = alg.toLowerCase()\n  if (alg === 'md5') return new HashNoConstructor(md5)\n  if (alg === 'rmd160' || alg === 'ripemd160') return new Hash(new RIPEMD160())\n\n  return new Hash(sha(alg))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-hash/browser.js\n// module id = 59\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-hash/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(80)\nexports.createHash = exports.Hash = __webpack_require__(59)\nexports.createHmac = exports.Hmac = __webpack_require__(140)\n\nvar algos = __webpack_require__(666)\nvar algoKeys = Object.keys(algos)\nvar hashes = ['sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'md5', 'rmd160'].concat(algoKeys)\nexports.getHashes = function () {\n  return hashes\n}\n\nvar p = __webpack_require__(297)\nexports.pbkdf2 = p.pbkdf2\nexports.pbkdf2Sync = p.pbkdf2Sync\n\nvar aes = __webpack_require__(663)\n\nexports.Cipher = aes.Cipher\nexports.createCipher = aes.createCipher\nexports.Cipheriv = aes.Cipheriv\nexports.createCipheriv = aes.createCipheriv\nexports.Decipher = aes.Decipher\nexports.createDecipher = aes.createDecipher\nexports.Decipheriv = aes.Decipheriv\nexports.createDecipheriv = aes.createDecipheriv\nexports.getCiphers = aes.getCiphers\nexports.listCiphers = aes.listCiphers\n\nvar dh = __webpack_require__(812)\n\nexports.DiffieHellmanGroup = dh.DiffieHellmanGroup\nexports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup\nexports.getDiffieHellman = dh.getDiffieHellman\nexports.createDiffieHellman = dh.createDiffieHellman\nexports.DiffieHellman = dh.DiffieHellman\n\nvar sign = __webpack_require__(667)\n\nexports.createSign = sign.createSign\nexports.Sign = sign.Sign\nexports.createVerify = sign.createVerify\nexports.Verify = sign.Verify\n\nexports.createECDH = __webpack_require__(717)\n\nvar publicEncrypt = __webpack_require__(1164)\n\nexports.publicEncrypt = publicEncrypt.publicEncrypt\nexports.privateEncrypt = publicEncrypt.privateEncrypt\nexports.publicDecrypt = publicEncrypt.publicDecrypt\nexports.privateDecrypt = publicEncrypt.privateDecrypt\n\n// the least I can do is make error messages for the rest of the node.js/crypto api.\n// ;[\n//   'createCredentials'\n// ].forEach(function (name) {\n//   exports[name] = function () {\n//     throw new Error([\n//       'sorry, ' + name + ' is not implemented yet',\n//       'we accept pull requests',\n//       'https://github.com/crypto-browserify/crypto-browserify'\n//     ].join('\\n'))\n//   }\n// })\n\nvar rf = __webpack_require__(1208)\n\nexports.randomFill = rf.randomFill\nexports.randomFillSync = rf.randomFillSync\n\nexports.createCredentials = function () {\n  throw new Error([\n    'sorry, createCredentials is not implemented yet',\n    'we accept pull requests',\n    'https://github.com/crypto-browserify/crypto-browserify'\n  ].join('\\n'))\n}\n\nexports.constants = {\n  'DH_CHECK_P_NOT_SAFE_PRIME': 2,\n  'DH_CHECK_P_NOT_PRIME': 1,\n  'DH_UNABLE_TO_CHECK_GENERATOR': 4,\n  'DH_NOT_SUITABLE_GENERATOR': 8,\n  'NPN_ENABLED': 1,\n  'ALPN_ENABLED': 1,\n  'RSA_PKCS1_PADDING': 1,\n  'RSA_SSLV23_PADDING': 2,\n  'RSA_NO_PADDING': 3,\n  'RSA_PKCS1_OAEP_PADDING': 4,\n  'RSA_X931_PADDING': 5,\n  'RSA_PKCS1_PSS_PADDING': 6,\n  'POINT_CONVERSION_COMPRESSED': 2,\n  'POINT_CONVERSION_UNCOMPRESSED': 4,\n  'POINT_CONVERSION_HYBRID': 6\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/crypto-browserify/index.js\n// module id = 60\n// module chunks = 0\n\n//# sourceURL=../node_modules/crypto-browserify/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file formatters.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@frozeman.de>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(48);\nvar BN = __webpack_require__(141);\nvar SolidityParam = __webpack_require__(386);\n\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BN} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n    if(_.isNumber(value)) {\n        value = Math.trunc(value);\n    }\n    return new SolidityParam(utils.toTwosComplement(value).replace('0x',''));\n};\n\n/**\n * Formats input bytes\n *\n * @method formatInputBytes\n * @param {String} value\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n    if(!utils.isHexStrict(value)) {\n        throw new Error('Given parameter is not bytes: \"'+ value + '\"');\n    }\n\n    var result = value.replace(/^0x/i,'');\n\n    if(result.length % 2 !== 0) {\n        throw new Error('Given parameter bytes has an invalid length: \"'+ value + '\"');\n    }\n\n    if (result.length > 64) {\n        throw new Error('Given parameter bytes is too long: \"' + value + '\"');\n    }\n\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(result);\n};\n\n/**\n * Formats input bytes\n *\n * @method formatDynamicInputBytes\n * @param {String} value\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n    if(!utils.isHexStrict(value)) {\n        throw new Error('Given parameter is not bytes: \"'+ value + '\"');\n    }\n\n    var result = value.replace(/^0x/i,'');\n\n    if(result.length % 2 !== 0) {\n        throw new Error('Given parameter bytes has an invalid length: \"'+ value + '\"');\n    }\n\n    var length = result.length / 2;\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(formatInputInt(length).value + result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputString\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputString = function (value) {\n    if(!_.isString(value)) {\n        throw new Error('Given parameter is not a valid string: ' + value);\n    }\n\n    var result = utils.utf8ToHex(value).replace(/^0x/i,'');\n    var length = result.length / 2;\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(formatInputInt(length).value + result);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n    var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ?  '1' : '0');\n    return new SolidityParam(result);\n};\n\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n    return (new BN(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BN} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    // check if it's negative number\n    // it it is, return two's complement\n    if (signedIsNegative(value)) {\n        return new BN(value, 16).fromTwos(256).toString(10);\n    }\n    return new BN(value, 16).toString(10);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam} param\n * @returns {BN} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param, name) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return new BN(value, 16).toString(10);\n};\n\n\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam} param\n * @param {String} name type name\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param, name) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return (value === '0000000000000000000000000000000000000000000000000000000000000001');\n};\n\n/**\n * Should be used to format output bytes\n *\n * @method formatOutputBytes\n * @param {SolidityParam} param left-aligned hex representation of string\n * @param {String} name type name\n * @returns {String} hex string\n */\nvar formatOutputBytes = function (param, name) {\n    var matches = name.match(/^bytes([0-9]*)/);\n    var size = parseInt(matches[1]);\n\n    if(param.staticPart().slice(0, 2 * size).length !== size * 2) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue + ' The size doesn\\'t match.');\n    }\n\n    return '0x' + param.staticPart().slice(0, 2 * size);\n};\n\n/**\n * Should be used to format output bytes\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} param left-aligned hex representation of string\n * @param {String} name type name\n * @returns {String} hex string\n */\nvar formatOutputDynamicBytes = function (param, name) {\n    var hex = param.dynamicPart().slice(0, 64);\n\n    if (!hex) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    var length = (new BN(hex, 16)).toNumber() * 2;\n    return '0x' + param.dynamicPart().substr(64, length);\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputString\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputString = function (param) {\n    var hex = param.dynamicPart().slice(0, 64);\n\n    if(!hex) {\n        throw new Error('ERROR: The returned value is not a convertible string:'+ hex);\n    }\n\n    var length = (new BN(hex, 16)).toNumber() * 2;\n    return length ? utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, '')) : '';\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} param right-aligned input bytes\n * @param {String} name type name\n * @returns {String} address\n */\nvar formatOutputAddress = function (param, name) {\n    var value = param.staticPart();\n\n    if (!value) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return utils.toChecksumAddress(\"0x\" + value.slice(value.length - 40, value.length));\n};\n\nmodule.exports = {\n    formatInputInt: formatInputInt,\n    formatInputBytes: formatInputBytes,\n    formatInputDynamicBytes: formatInputDynamicBytes,\n    formatInputString: formatInputString,\n    formatInputBool: formatInputBool,\n    formatOutputInt: formatOutputInt,\n    formatOutputUInt: formatOutputUInt,\n    formatOutputBool: formatOutputBool,\n    formatOutputBytes: formatOutputBytes,\n    formatOutputDynamicBytes: formatOutputDynamicBytes,\n    formatOutputString: formatOutputString,\n    formatOutputAddress: formatOutputAddress,\n    toTwosComplement: utils.toTwosComplement\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/formatters.js\n// module id = 61\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/formatters.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assert = __webpack_require__(43);\nvar inherits = __webpack_require__(3);\n\nexports.inherits = inherits;\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg === 'string') {\n    if (!enc) {\n      for (var i = 0; i < msg.length; i++) {\n        var c = msg.charCodeAt(i);\n        var hi = c >> 8;\n        var lo = c & 0xff;\n        if (hi)\n          res.push(hi, lo);\n        else\n          res.push(lo);\n      }\n    } else if (enc === 'hex') {\n      msg = msg.replace(/[^a-z0-9]+/ig, '');\n      if (msg.length % 2 !== 0)\n        msg = '0' + msg;\n      for (i = 0; i < msg.length; i += 2)\n        res.push(parseInt(msg[i] + msg[i + 1], 16));\n    }\n  } else {\n    for (i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n  }\n  return res;\n}\nexports.toArray = toArray;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nexports.toHex = toHex;\n\nfunction htonl(w) {\n  var res = (w >>> 24) |\n            ((w >>> 8) & 0xff00) |\n            ((w << 8) & 0xff0000) |\n            ((w & 0xff) << 24);\n  return res >>> 0;\n}\nexports.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++) {\n    var w = msg[i];\n    if (endian === 'little')\n      w = htonl(w);\n    res += zero8(w.toString(16));\n  }\n  return res;\n}\nexports.toHex32 = toHex32;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nexports.zero2 = zero2;\n\nfunction zero8(word) {\n  if (word.length === 7)\n    return '0' + word;\n  else if (word.length === 6)\n    return '00' + word;\n  else if (word.length === 5)\n    return '000' + word;\n  else if (word.length === 4)\n    return '0000' + word;\n  else if (word.length === 3)\n    return '00000' + word;\n  else if (word.length === 2)\n    return '000000' + word;\n  else if (word.length === 1)\n    return '0000000' + word;\n  else\n    return word;\n}\nexports.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n  var len = end - start;\n  assert(len % 4 === 0);\n  var res = new Array(len / 4);\n  for (var i = 0, k = start; i < res.length; i++, k += 4) {\n    var w;\n    if (endian === 'big')\n      w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n    else\n      w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n    res[i] = w >>> 0;\n  }\n  return res;\n}\nexports.join32 = join32;\n\nfunction split32(msg, endian) {\n  var res = new Array(msg.length * 4);\n  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n    var m = msg[i];\n    if (endian === 'big') {\n      res[k] = m >>> 24;\n      res[k + 1] = (m >>> 16) & 0xff;\n      res[k + 2] = (m >>> 8) & 0xff;\n      res[k + 3] = m & 0xff;\n    } else {\n      res[k + 3] = m >>> 24;\n      res[k + 2] = (m >>> 16) & 0xff;\n      res[k + 1] = (m >>> 8) & 0xff;\n      res[k] = m & 0xff;\n    }\n  }\n  return res;\n}\nexports.split32 = split32;\n\nfunction rotr32(w, b) {\n  return (w >>> b) | (w << (32 - b));\n}\nexports.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n  return (w << b) | (w >>> (32 - b));\n}\nexports.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n  return (a + b) >>> 0;\n}\nexports.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n  return (a + b + c) >>> 0;\n}\nexports.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n  return (a + b + c + d) >>> 0;\n}\nexports.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n  return (a + b + c + d + e) >>> 0;\n}\nexports.sum32_5 = sum32_5;\n\nfunction sum64(buf, pos, ah, al) {\n  var bh = buf[pos];\n  var bl = buf[pos + 1];\n\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  buf[pos] = hi >>> 0;\n  buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  return hi >>> 0;\n}\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n  var lo = al + bl;\n  return lo >>> 0;\n}\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + carry;\n  return hi >>> 0;\n}\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n  var lo = al + bl + cl + dl;\n  return lo >>> 0;\n}\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n  lo = (lo + el) >>> 0;\n  carry += lo < el ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + eh + carry;\n  return hi >>> 0;\n}\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var lo = al + bl + cl + dl + el;\n\n  return lo >>> 0;\n}\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n  var r = (al << (32 - num)) | (ah >>> num);\n  return r >>> 0;\n}\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n  return ah >>> num;\n}\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n}\nexports.shr64_lo = shr64_lo;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/utils.js\n// module id = 62\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/utils.js")},function(module,exports){eval("/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n  // No operation performed.\n}\n\nmodule.exports = noop;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/noop.js\n// module id = 63\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/noop.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar schema = __webpack_require__(1155)\nvar compile = __webpack_require__(1163)\n\nvar flatten = function (values) {\n  if (!values) return null\n  var result = {}\n  Object.keys(values).forEach(function (k) {\n    result[k] = values[k].value\n  })\n  return result\n}\n\nmodule.exports = function (proto, opts) {\n  if (!opts) opts = {}\n  if (!proto) throw new Error('Pass in a .proto string or a protobuf-schema parsed object')\n\n  var sch = (typeof proto === 'object' && !Buffer.isBuffer(proto)) ? proto : schema.parse(proto)\n\n  // to not make toString,toJSON enumarable we make a fire-and-forget prototype\n  var Messages = function () {\n    var self = this\n\n    compile(sch, opts.encodings || {}).forEach(function (m) {\n      self[m.name] = flatten(m.values) || m\n    })\n  }\n\n  Messages.prototype.toString = function () {\n    return schema.stringify(sch)\n  }\n\n  Messages.prototype.toJSON = function () {\n    return sch\n  }\n\n  return new Messages()\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/index.js\n// module id = 64\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file formatters.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@frozeman.de>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(47);\nvar BN = __webpack_require__(1275);\nvar SolidityParam = __webpack_require__(555);\n\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BN} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n    if(_.isNumber(value)) {\n        value = Math.trunc(value);\n    }\n    return new SolidityParam(utils.toTwosComplement(value).replace('0x',''));\n};\n\n/**\n * Formats input bytes\n *\n * @method formatInputBytes\n * @param {String} value\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n    if(!utils.isHexStrict(value)) {\n        throw new Error('Given parameter is not bytes: \"'+ value + '\"');\n    }\n\n    var result = value.replace(/^0x/i,'');\n\n    if(result.length % 2 !== 0) {\n        throw new Error('Given parameter bytes has an invalid length: \"'+ value + '\"');\n    }\n\n    if (result.length > 64) {\n        throw new Error('Given parameter bytes is too long: \"' + value + '\"');\n    }\n\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(result);\n};\n\n/**\n * Formats input bytes\n *\n * @method formatDynamicInputBytes\n * @param {String} value\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n    if(!utils.isHexStrict(value)) {\n        throw new Error('Given parameter is not bytes: \"'+ value + '\"');\n    }\n\n    var result = value.replace(/^0x/i,'');\n\n    if(result.length % 2 !== 0) {\n        throw new Error('Given parameter bytes has an invalid length: \"'+ value + '\"');\n    }\n\n    var length = result.length / 2;\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(formatInputInt(length).value + result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputString\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputString = function (value) {\n    if(!_.isString(value)) {\n        throw new Error('Given parameter is not a valid string: ' + value);\n    }\n\n    var result = utils.utf8ToHex(value).replace(/^0x/i,'');\n    var length = result.length / 2;\n    var l = Math.floor((result.length + 63) / 64);\n    result = utils.padRight(result, l * 64);\n    return new SolidityParam(formatInputInt(length).value + result);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n    var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ?  '1' : '0');\n    return new SolidityParam(result);\n};\n\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n    return (new BN(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BN} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    // check if it's negative number\n    // it it is, return two's complement\n    if (signedIsNegative(value)) {\n        return new BN(value, 16).fromTwos(256).toString(10);\n    }\n    return new BN(value, 16).toString(10);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam} param\n * @returns {BN} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param, name) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return new BN(value, 16).toString(10);\n};\n\n\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam} param\n * @param {String} name type name\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param, name) {\n    var value = param.staticPart();\n\n    if(!value && !param.rawValue) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return (value === '0000000000000000000000000000000000000000000000000000000000000001');\n};\n\n/**\n * Should be used to format output bytes\n *\n * @method formatOutputBytes\n * @param {SolidityParam} param left-aligned hex representation of string\n * @param {String} name type name\n * @returns {String} hex string\n */\nvar formatOutputBytes = function (param, name) {\n    var matches = name.match(/^bytes([0-9]*)/);\n    var size = parseInt(matches[1]);\n\n    if(param.staticPart().slice(0, 2 * size).length !== size * 2) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue + ' The size doesn\\'t match.');\n    }\n\n    return '0x' + param.staticPart().slice(0, 2 * size);\n};\n\n/**\n * Should be used to format output bytes\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} param left-aligned hex representation of string\n * @param {String} name type name\n * @returns {String} hex string\n */\nvar formatOutputDynamicBytes = function (param, name) {\n    var hex = param.dynamicPart().slice(0, 64);\n\n    if (!hex) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    var length = (new BN(hex, 16)).toNumber() * 2;\n    return '0x' + param.dynamicPart().substr(64, length);\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputString\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputString = function (param) {\n    var hex = param.dynamicPart().slice(0, 64);\n\n    if(!hex) {\n        throw new Error('ERROR: The returned value is not a convertible string:'+ hex);\n    }\n\n    var length = (new BN(hex, 16)).toNumber() * 2;\n    return length ? utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, '')) : '';\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} param right-aligned input bytes\n * @param {String} name type name\n * @returns {String} address\n */\nvar formatOutputAddress = function (param, name) {\n    var value = param.staticPart();\n\n    if (!value) {\n        throw new Error('Couldn\\'t decode '+ name +' from ABI: 0x'+ param.rawValue);\n    }\n\n    return utils.toChecksumAddress(\"0x\" + value.slice(value.length - 40, value.length));\n};\n\nmodule.exports = {\n    formatInputInt: formatInputInt,\n    formatInputBytes: formatInputBytes,\n    formatInputDynamicBytes: formatInputDynamicBytes,\n    formatInputString: formatInputString,\n    formatInputBool: formatInputBool,\n    formatOutputInt: formatOutputInt,\n    formatOutputUInt: formatOutputUInt,\n    formatOutputBool: formatOutputBool,\n    formatOutputBytes: formatOutputBytes,\n    formatOutputDynamicBytes: formatOutputDynamicBytes,\n    formatOutputString: formatOutputString,\n    formatOutputAddress: formatOutputAddress,\n    toTwosComplement: utils.toTwosComplement\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/formatters.js\n// module id = 65\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/formatters.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BN = __webpack_require__(30);\nvar Point = __webpack_require__(125);\nvar Hash = __webpack_require__(36);\nvar JSUtil = __webpack_require__(24);\nvar Network = __webpack_require__(109);\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\n\n/**\n * Instantiate a PublicKey from a {@link PrivateKey}, {@link Point}, `string`, or `Buffer`.\n *\n * There are two internal properties, `network` and `compressed`, that deal with importing\n * a PublicKey from a PrivateKey in WIF format. More details described on {@link PrivateKey}\n *\n * @example\n * ```javascript\n * // instantiate from a private key\n * var key = PublicKey(privateKey, true);\n *\n * // export to as a DER hex encoded string\n * var exported = key.toString();\n *\n * // import the public key\n * var imported = PublicKey.fromString(exported);\n * ```\n *\n * @param {string} data - The encoded data in various formats\n * @param {Object} extra - additional options\n * @param {Network=} extra.network - Which network should the address for this public key be for\n * @param {String=} extra.compressed - If the public key is compressed\n * @returns {PublicKey} A new valid instance of an PublicKey\n * @constructor\n */\nfunction PublicKey(data, extra) {\n\n  if (!(this instanceof PublicKey)) {\n    return new PublicKey(data, extra);\n  }\n\n  $.checkArgument(data, 'First argument is required, please include public key data.');\n\n  if (data instanceof PublicKey) {\n    // Return copy, but as it's an immutable object, return same argument\n    return data;\n  }\n  extra = extra || {};\n\n  var info = this._classifyArgs(data, extra);\n\n  // validation\n  info.point.validate();\n\n  JSUtil.defineImmutable(this, {\n    point: info.point,\n    compressed: info.compressed,\n    network: info.network || Network.defaultNetwork\n  });\n\n  return this;\n};\n\n/**\n * Internal function to differentiate between arguments passed to the constructor\n * @param {*} data\n * @param {Object} extra\n */\nPublicKey.prototype._classifyArgs = function(data, extra) {\n  /* jshint maxcomplexity: 10 */\n  var info = {\n    compressed: _.isUndefined(extra.compressed) || extra.compressed\n  };\n\n  // detect type of data\n  if (data instanceof Point) {\n    info.point = data;\n  } else if (data.x && data.y) {\n    info = PublicKey._transformObject(data);\n  } else if (typeof(data) === 'string') {\n    info = PublicKey._transformDER(new Buffer(data, 'hex'));\n  } else if (PublicKey._isBuffer(data)) {\n    info = PublicKey._transformDER(data);\n  } else if (PublicKey._isPrivateKey(data)) {\n    info = PublicKey._transformPrivateKey(data);\n  } else {\n    throw new TypeError('First argument is an unrecognized data format.');\n  }\n  if (!info.network) {\n    info.network = _.isUndefined(extra.network) ? undefined : Network.get(extra.network);\n  }\n  return info;\n};\n\n/**\n * Internal function to detect if an object is a {@link PrivateKey}\n *\n * @param {*} param - object to test\n * @returns {boolean}\n * @private\n */\nPublicKey._isPrivateKey = function(param) {\n  var PrivateKey = __webpack_require__(215);\n  return param instanceof PrivateKey;\n};\n\n/**\n * Internal function to detect if an object is a Buffer\n *\n * @param {*} param - object to test\n * @returns {boolean}\n * @private\n */\nPublicKey._isBuffer = function(param) {\n  return (param instanceof Buffer) || (param instanceof Uint8Array);\n};\n\n/**\n * Internal function to transform a private key into a public key point\n *\n * @param {PrivateKey} privkey - An instance of PrivateKey\n * @returns {Object} An object with keys: point and compressed\n * @private\n */\nPublicKey._transformPrivateKey = function(privkey) {\n  $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey');\n  var info = {};\n  info.point = Point.getG().mul(privkey.bn);\n  info.compressed = privkey.compressed;\n  info.network = privkey.network;\n  return info;\n};\n\n/**\n * Internal function to transform DER into a public key point\n *\n * @param {Buffer} buf - An hex encoded buffer\n * @param {bool=} strict - if set to false, will loosen some conditions\n * @returns {Object} An object with keys: point and compressed\n * @private\n */\nPublicKey._transformDER = function(buf, strict) {\n  /* jshint maxstatements: 30 */\n  /* jshint maxcomplexity: 12 */\n  $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key');\n  var info = {};\n\n  strict = _.isUndefined(strict) ? true : strict;\n\n  var x;\n  var y;\n  var xbuf;\n  var ybuf;\n\n  if (buf[0] === 0x04 || (!strict && (buf[0] === 0x06 || buf[0] === 0x07))) {\n    xbuf = buf.slice(1, 33);\n    ybuf = buf.slice(33, 65);\n    if (xbuf.length !== 32 || ybuf.length !== 32 || buf.length !== 65) {\n      throw new TypeError('Length of x and y must be 32 bytes');\n    }\n    x = new BN(xbuf);\n    y = new BN(ybuf);\n    info.point = new Point(x, y);\n    info.compressed = false;\n  } else if (buf[0] === 0x03) {\n    xbuf = buf.slice(1);\n    x = new BN(xbuf);\n    info = PublicKey._transformX(true, x);\n    info.compressed = true;\n  } else if (buf[0] === 0x02) {\n    xbuf = buf.slice(1);\n    x = new BN(xbuf);\n    info = PublicKey._transformX(false, x);\n    info.compressed = true;\n  } else {\n    throw new TypeError('Invalid DER format public key');\n  }\n  return info;\n};\n\n/**\n * Internal function to transform X into a public key point\n *\n * @param {Boolean} odd - If the point is above or below the x axis\n * @param {Point} x - The x point\n * @returns {Object} An object with keys: point and compressed\n * @private\n */\nPublicKey._transformX = function(odd, x) {\n  $.checkArgument(typeof odd === 'boolean', 'Must specify whether y is odd or not (true or false)');\n  var info = {};\n  info.point = Point.fromX(odd, x);\n  return info;\n};\n\n/**\n * Internal function to transform a JSON into a public key point\n *\n * @param {String|Object} json - a JSON string or plain object\n * @returns {Object} An object with keys: point and compressed\n * @private\n */\nPublicKey._transformObject = function(json) {\n  var x = new BN(json.x, 'hex');\n  var y = new BN(json.y, 'hex');\n  var point = new Point(x, y);\n  return new PublicKey(point, {\n    compressed: json.compressed\n  });\n};\n\n/**\n * Instantiate a PublicKey from a PrivateKey\n *\n * @param {PrivateKey} privkey - An instance of PrivateKey\n * @returns {PublicKey} A new valid instance of PublicKey\n */\nPublicKey.fromPrivateKey = function(privkey) {\n  $.checkArgument(PublicKey._isPrivateKey(privkey), 'Must be an instance of PrivateKey');\n  var info = PublicKey._transformPrivateKey(privkey);\n  return new PublicKey(info.point, {\n    compressed: info.compressed,\n    network: info.network\n  });\n};\n\n/**\n * Instantiate a PublicKey from a Buffer\n * @param {Buffer} buf - A DER hex buffer\n * @param {bool=} strict - if set to false, will loosen some conditions\n * @returns {PublicKey} A new valid instance of PublicKey\n */\nPublicKey.fromDER = PublicKey.fromBuffer = function(buf, strict) {\n  $.checkArgument(PublicKey._isBuffer(buf), 'Must be a hex buffer of DER encoded public key');\n  var info = PublicKey._transformDER(buf, strict);\n  return new PublicKey(info.point, {\n    compressed: info.compressed\n  });\n};\n\n/**\n * Instantiate a PublicKey from a Point\n *\n * @param {Point} point - A Point instance\n * @param {boolean=} compressed - whether to store this public key as compressed format\n * @returns {PublicKey} A new valid instance of PublicKey\n */\nPublicKey.fromPoint = function(point, compressed) {\n  $.checkArgument(point instanceof Point, 'First argument must be an instance of Point.');\n  return new PublicKey(point, {\n    compressed: compressed\n  });\n};\n\n/**\n * Instantiate a PublicKey from a DER hex encoded string\n *\n * @param {string} str - A DER hex string\n * @param {String=} encoding - The type of string encoding\n * @returns {PublicKey} A new valid instance of PublicKey\n */\nPublicKey.fromString = function(str, encoding) {\n  var buf = new Buffer(str, encoding || 'hex');\n  var info = PublicKey._transformDER(buf);\n  return new PublicKey(info.point, {\n    compressed: info.compressed\n  });\n};\n\n/**\n * Instantiate a PublicKey from an X Point\n *\n * @param {Boolean} odd - If the point is above or below the x axis\n * @param {Point} x - The x point\n * @returns {PublicKey} A new valid instance of PublicKey\n */\nPublicKey.fromX = function(odd, x) {\n  var info = PublicKey._transformX(odd, x);\n  return new PublicKey(info.point, {\n    compressed: info.compressed\n  });\n};\n\n/**\n * Check if there would be any errors when initializing a PublicKey\n *\n * @param {string} data - The encoded data in various formats\n * @returns {null|Error} An error if exists\n */\nPublicKey.getValidationError = function(data) {\n  var error;\n  try {\n    /* jshint nonew: false */\n    new PublicKey(data);\n  } catch (e) {\n    error = e;\n  }\n  return error;\n};\n\n/**\n * Check if the parameters are valid\n *\n * @param {string} data - The encoded data in various formats\n * @returns {Boolean} If the public key would be valid\n */\nPublicKey.isValid = function(data) {\n  return !PublicKey.getValidationError(data);\n};\n\n/**\n * @returns {Object} A plain object of the PublicKey\n */\nPublicKey.prototype.toObject = PublicKey.prototype.toJSON = function toObject() {\n  return {\n    x: this.point.getX().toString('hex', 2),\n    y: this.point.getY().toString('hex', 2),\n    compressed: this.compressed\n  };\n};\n\n/**\n * Will output the PublicKey to a DER Buffer\n *\n * @returns {Buffer} A DER hex encoded buffer\n */\nPublicKey.prototype.toBuffer = PublicKey.prototype.toDER = function() {\n  var x = this.point.getX();\n  var y = this.point.getY();\n\n  var xbuf = x.toBuffer({\n    size: 32\n  });\n  var ybuf = y.toBuffer({\n    size: 32\n  });\n\n  var prefix;\n  if (!this.compressed) {\n    prefix = new Buffer([0x04]);\n    return Buffer.concat([prefix, xbuf, ybuf]);\n  } else {\n    var odd = ybuf[ybuf.length - 1] % 2;\n    if (odd) {\n      prefix = new Buffer([0x03]);\n    } else {\n      prefix = new Buffer([0x02]);\n    }\n    return Buffer.concat([prefix, xbuf]);\n  }\n};\n\n/**\n * Will return a sha256 + ripemd160 hash of the serialized public key\n * @see https://github.com/bitcoin/bitcoin/blob/master/src/pubkey.h#L141\n * @returns {Buffer}\n */\nPublicKey.prototype._getID = function _getID() {\n  return Hash.sha256ripemd160(this.toBuffer());\n};\n\n/**\n * Will return an address for the public key\n *\n * @param {String|Network=} network - Which network should the address be for\n * @returns {Address} An address generated from the public key\n */\nPublicKey.prototype.toAddress = function(network) {\n  var Address = __webpack_require__(108);\n  return Address.fromPublicKey(this, network || this.network);\n};\n\n/**\n * Will output the PublicKey to a DER encoded hex string\n *\n * @returns {string} A DER hex encoded string\n */\nPublicKey.prototype.toString = function() {\n  return this.toDER().toString('hex');\n};\n\n/**\n * Will return a string formatted for the console\n *\n * @returns {string} Public key\n */\nPublicKey.prototype.inspect = function() {\n  return '<PublicKey: ' + this.toString() +\n    (this.compressed ? '' : ', uncompressed') + '>';\n};\n\n\nmodule.exports = PublicKey;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/publickey.js\n// module id = 66\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/publickey.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar elliptic = exports;\n\nelliptic.version = __webpack_require__(1346).version;\nelliptic.utils = __webpack_require__(1339);\nelliptic.rand = __webpack_require__(1340);\nelliptic.hmacDRBG = __webpack_require__(1337);\nelliptic.curve = __webpack_require__(217);\nelliptic.curves = __webpack_require__(1333);\n\n// Protocols\nelliptic.ec = __webpack_require__(1334);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic.js\n// module id = 67\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic.js")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(91);\nmodule.exports = function (it) {\n  if (!isObject(it)) throw TypeError(it + ' is not an object!');\n  return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_an-object.js\n// module id = 68\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_an-object.js")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(42);\nvar core = __webpack_require__(31);\nvar ctx = __webpack_require__(136);\nvar hide = __webpack_require__(90);\nvar has = __webpack_require__(89);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n  var IS_FORCED = type & $export.F;\n  var IS_GLOBAL = type & $export.G;\n  var IS_STATIC = type & $export.S;\n  var IS_PROTO = type & $export.P;\n  var IS_BIND = type & $export.B;\n  var IS_WRAP = type & $export.W;\n  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n  var expProto = exports[PROTOTYPE];\n  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n  var key, own, out;\n  if (IS_GLOBAL) source = name;\n  for (key in source) {\n    // contains in native\n    own = !IS_FORCED && target && target[key] !== undefined;\n    if (own && has(exports, key)) continue;\n    // export native or passed\n    out = own ? target[key] : source[key];\n    // prevent global pollution for namespaces\n    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n    // bind timers to global for call from export context\n    : IS_BIND && own ? ctx(out, global)\n    // wrap global constructors for prevent change them in library\n    : IS_WRAP && target[key] == out ? (function (C) {\n      var F = function (a, b, c) {\n        if (this instanceof C) {\n          switch (arguments.length) {\n            case 0: return new C();\n            case 1: return new C(a);\n            case 2: return new C(a, b);\n          } return new C(a, b, c);\n        } return C.apply(this, arguments);\n      };\n      F[PROTOTYPE] = C[PROTOTYPE];\n      return F;\n    // make static versions for prototype methods\n    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n    if (IS_PROTO) {\n      (exports.virtual || (exports.virtual = {}))[key] = out;\n      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n    }\n  }\n};\n// type bitmap\n$export.F = 1;   // forced\n$export.G = 2;   // global\n$export.S = 4;   // static\n$export.P = 8;   // proto\n$export.B = 16;  // bind\n$export.W = 32;  // wrap\n$export.U = 64;  // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_export.js\n// module id = 69\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_export.js")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(68);\nvar IE8_DOM_DEFINE = __webpack_require__(360);\nvar toPrimitive = __webpack_require__(250);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(78) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n  anObject(O);\n  P = toPrimitive(P, true);\n  anObject(Attributes);\n  if (IE8_DOM_DEFINE) try {\n    return dP(O, P, Attributes);\n  } catch (e) { /* empty */ }\n  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n  if ('value' in Attributes) O[P] = Attributes.value;\n  return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-dp.js\n// module id = 70\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-dp.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of Abstract Syntax Notation Number One.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n *\n * An API for storing data using the Abstract Syntax Notation Number One\n * format using DER (Distinguished Encoding Rules) encoding. This encoding is\n * commonly used to store data for PKI, i.e. X.509 Certificates, and this\n * implementation exists for that purpose.\n *\n * Abstract Syntax Notation Number One (ASN.1) is used to define the abstract\n * syntax of information without restricting the way the information is encoded\n * for transmission. It provides a standard that allows for open systems\n * communication. ASN.1 defines the syntax of information data and a number of\n * simple data types as well as a notation for describing them and specifying\n * values for them.\n *\n * The RSA algorithm creates public and private keys that are often stored in\n * X.509 or PKCS#X formats -- which use ASN.1 (encoded in DER format). This\n * class provides the most basic functionality required to store and load DSA\n * keys that are encoded according to ASN.1.\n *\n * The most common binary encodings for ASN.1 are BER (Basic Encoding Rules)\n * and DER (Distinguished Encoding Rules). DER is just a subset of BER that\n * has stricter requirements for how data must be encoded.\n *\n * Each ASN.1 structure has a tag (a byte identifying the ASN.1 structure type)\n * and a byte array for the value of this ASN1 structure which may be data or a\n * list of ASN.1 structures.\n *\n * Each ASN.1 structure using BER is (Tag-Length-Value):\n *\n * | byte 0 | bytes X | bytes Y |\n * |--------|---------|----------\n * |  tag   | length  |  value  |\n *\n * ASN.1 allows for tags to be of \"High-tag-number form\" which allows a tag to\n * be two or more octets, but that is not supported by this class. A tag is\n * only 1 byte. Bits 1-5 give the tag number (ie the data type within a\n * particular 'class'), 6 indicates whether or not the ASN.1 value is\n * constructed from other ASN.1 values, and bits 7 and 8 give the 'class'. If\n * bits 7 and 8 are both zero, the class is UNIVERSAL. If only bit 7 is set,\n * then the class is APPLICATION. If only bit 8 is set, then the class is\n * CONTEXT_SPECIFIC. If both bits 7 and 8 are set, then the class is PRIVATE.\n * The tag numbers for the data types for the class UNIVERSAL are listed below:\n *\n * UNIVERSAL 0 Reserved for use by the encoding rules\n * UNIVERSAL 1 Boolean type\n * UNIVERSAL 2 Integer type\n * UNIVERSAL 3 Bitstring type\n * UNIVERSAL 4 Octetstring type\n * UNIVERSAL 5 Null type\n * UNIVERSAL 6 Object identifier type\n * UNIVERSAL 7 Object descriptor type\n * UNIVERSAL 8 External type and Instance-of type\n * UNIVERSAL 9 Real type\n * UNIVERSAL 10 Enumerated type\n * UNIVERSAL 11 Embedded-pdv type\n * UNIVERSAL 12 UTF8String type\n * UNIVERSAL 13 Relative object identifier type\n * UNIVERSAL 14-15 Reserved for future editions\n * UNIVERSAL 16 Sequence and Sequence-of types\n * UNIVERSAL 17 Set and Set-of types\n * UNIVERSAL 18-22, 25-30 Character string types\n * UNIVERSAL 23-24 Time types\n *\n * The length of an ASN.1 structure is specified after the tag identifier.\n * There is a definite form and an indefinite form. The indefinite form may\n * be used if the encoding is constructed and not all immediately available.\n * The indefinite form is encoded using a length byte with only the 8th bit\n * set. The end of the constructed object is marked using end-of-contents\n * octets (two zero bytes).\n *\n * The definite form looks like this:\n *\n * The length may take up 1 or more bytes, it depends on the length of the\n * value of the ASN.1 structure. DER encoding requires that if the ASN.1\n * structure has a value that has a length greater than 127, more than 1 byte\n * will be used to store its length, otherwise just one byte will be used.\n * This is strict.\n *\n * In the case that the length of the ASN.1 value is less than 127, 1 octet\n * (byte) is used to store the \"short form\" length. The 8th bit has a value of\n * 0 indicating the length is \"short form\" and not \"long form\" and bits 7-1\n * give the length of the data. (The 8th bit is the left-most, most significant\n * bit: also known as big endian or network format).\n *\n * In the case that the length of the ASN.1 value is greater than 127, 2 to\n * 127 octets (bytes) are used to store the \"long form\" length. The first\n * byte's 8th bit is set to 1 to indicate the length is \"long form.\" Bits 7-1\n * give the number of additional octets. All following octets are in base 256\n * with the most significant digit first (typical big-endian binary unsigned\n * integer storage). So, for instance, if the length of a value was 257, the\n * first byte would be set to:\n *\n * 10000010 = 130 = 0x82.\n *\n * This indicates there are 2 octets (base 256) for the length. The second and\n * third bytes (the octets just mentioned) would store the length in base 256:\n *\n * octet 2: 00000001 = 1 * 256^1 = 256\n * octet 3: 00000001 = 1 * 256^0 = 1\n * total = 257\n *\n * The algorithm for converting a js integer value of 257 to base-256 is:\n *\n * var value = 257;\n * var bytes = [];\n * bytes[0] = (value >>> 8) & 0xFF; // most significant byte first\n * bytes[1] = value & 0xFF;        // least significant byte last\n *\n * On the ASN.1 UNIVERSAL Object Identifier (OID) type:\n *\n * An OID can be written like: \"value1.value2.value3...valueN\"\n *\n * The DER encoding rules:\n *\n * The first byte has the value 40 * value1 + value2.\n * The following bytes, if any, encode the remaining values. Each value is\n * encoded in base 128, most significant digit first (big endian), with as\n * few digits as possible, and the most significant bit of each byte set\n * to 1 except the last in each value's encoding. For example: Given the\n * OID \"1.2.840.113549\", its DER encoding is (remember each byte except the\n * last one in each encoding is OR'd with 0x80):\n *\n * byte 1: 40 * 1 + 2 = 42 = 0x2A.\n * bytes 2-3: 128 * 6 + 72 = 840 = 6 72 = 6 72 = 0x0648 = 0x8648\n * bytes 4-6: 16384 * 6 + 128 * 119 + 13 = 6 119 13 = 0x06770D = 0x86F70D\n *\n * The final value is: 0x2A864886F70D.\n * The full OID (including ASN.1 tag and length of 6 bytes) is:\n * 0x06062A864886F70D\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n__webpack_require__(101);\n\n/* ASN.1 API */\nvar asn1 = module.exports = forge.asn1 = forge.asn1 || {};\n\n/**\n * ASN.1 classes.\n */\nasn1.Class = {\n  UNIVERSAL:        0x00,\n  APPLICATION:      0x40,\n  CONTEXT_SPECIFIC: 0x80,\n  PRIVATE:          0xC0\n};\n\n/**\n * ASN.1 types. Not all types are supported by this implementation, only\n * those necessary to implement a simple PKI are implemented.\n */\nasn1.Type = {\n  NONE:             0,\n  BOOLEAN:          1,\n  INTEGER:          2,\n  BITSTRING:        3,\n  OCTETSTRING:      4,\n  NULL:             5,\n  OID:              6,\n  ODESC:            7,\n  EXTERNAL:         8,\n  REAL:             9,\n  ENUMERATED:      10,\n  EMBEDDED:        11,\n  UTF8:            12,\n  ROID:            13,\n  SEQUENCE:        16,\n  SET:             17,\n  PRINTABLESTRING: 19,\n  IA5STRING:       22,\n  UTCTIME:         23,\n  GENERALIZEDTIME: 24,\n  BMPSTRING:       30\n};\n\n/**\n * Creates a new asn1 object.\n *\n * @param tagClass the tag class for the object.\n * @param type the data type (tag number) for the object.\n * @param constructed true if the asn1 object is in constructed form.\n * @param value the value for the object, if it is not constructed.\n * @param [options] the options to use:\n *          [bitStringContents] the plain BIT STRING content including padding\n *            byte.\n *\n * @return the asn1 object.\n */\nasn1.create = function(tagClass, type, constructed, value, options) {\n  /* An asn1 object has a tagClass, a type, a constructed flag, and a\n    value. The value's type depends on the constructed flag. If\n    constructed, it will contain a list of other asn1 objects. If not,\n    it will contain the ASN.1 value as an array of bytes formatted\n    according to the ASN.1 data type. */\n\n  // remove undefined values\n  if(forge.util.isArray(value)) {\n    var tmp = [];\n    for(var i = 0; i < value.length; ++i) {\n      if(value[i] !== undefined) {\n        tmp.push(value[i]);\n      }\n    }\n    value = tmp;\n  }\n\n  var obj = {\n    tagClass: tagClass,\n    type: type,\n    constructed: constructed,\n    composed: constructed || forge.util.isArray(value),\n    value: value\n  };\n  if(options && 'bitStringContents' in options) {\n    // TODO: copy byte buffer if it's a buffer not a string\n    obj.bitStringContents = options.bitStringContents;\n    // TODO: add readonly flag to avoid this overhead\n    // save copy to detect changes\n    obj.original = asn1.copy(obj);\n  }\n  return obj;\n};\n\n/**\n * Copies an asn1 object.\n *\n * @param obj the asn1 object.\n * @param [options] copy options:\n *          [excludeBitStringContents] true to not copy bitStringContents\n *\n * @return the a copy of the asn1 object.\n */\nasn1.copy = function(obj, options) {\n  var copy;\n\n  if(forge.util.isArray(obj)) {\n    copy = [];\n    for(var i = 0; i < obj.length; ++i) {\n      copy.push(asn1.copy(obj[i], options));\n    }\n    return copy;\n  }\n\n  if(typeof obj === 'string') {\n    // TODO: copy byte buffer if it's a buffer not a string\n    return obj;\n  }\n\n  copy = {\n    tagClass: obj.tagClass,\n    type: obj.type,\n    constructed: obj.constructed,\n    composed: obj.composed,\n    value: asn1.copy(obj.value, options)\n  };\n  if(options && !options.excludeBitStringContents) {\n    // TODO: copy byte buffer if it's a buffer not a string\n    copy.bitStringContents = obj.bitStringContents;\n  }\n  return copy;\n};\n\n/**\n * Compares asn1 objects for equality.\n *\n * Note this function does not run in constant time.\n *\n * @param obj1 the first asn1 object.\n * @param obj2 the second asn1 object.\n * @param [options] compare options:\n *          [includeBitStringContents] true to compare bitStringContents\n *\n * @return true if the asn1 objects are equal.\n */\nasn1.equals = function(obj1, obj2, options) {\n  if(forge.util.isArray(obj1)) {\n    if(!forge.util.isArray(obj2)) {\n      return false;\n    }\n    if(obj1.length !== obj2.length) {\n      return false;\n    }\n    for(var i = 0; i < obj1.length; ++i) {\n      if(!asn1.equals(obj1[i], obj2[i])) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  if(typeof obj1 !== typeof obj2) {\n    return false;\n  }\n\n  if(typeof obj1 === 'string') {\n    return obj1 === obj2;\n  }\n\n  var equal = obj1.tagClass === obj2.tagClass &&\n    obj1.type === obj2.type &&\n    obj1.constructed === obj2.constructed &&\n    obj1.composed === obj2.composed &&\n    asn1.equals(obj1.value, obj2.value);\n  if(options && options.includeBitStringContents) {\n    equal = equal && (obj1.bitStringContents === obj2.bitStringContents);\n  }\n\n  return equal;\n};\n\n/**\n * Gets the length of a BER-encoded ASN.1 value.\n *\n * In case the length is not specified, undefined is returned.\n *\n * @param b the BER-encoded ASN.1 byte buffer, starting with the first\n *          length byte.\n *\n * @return the length of the BER-encoded ASN.1 value or undefined.\n */\nasn1.getBerValueLength = function(b) {\n  // TODO: move this function and related DER/BER functions to a der.js\n  // file; better abstract ASN.1 away from der/ber.\n  var b2 = b.getByte();\n  if(b2 === 0x80) {\n    return undefined;\n  }\n\n  // see if the length is \"short form\" or \"long form\" (bit 8 set)\n  var length;\n  var longForm = b2 & 0x80;\n  if(!longForm) {\n    // length is just the first byte\n    length = b2;\n  } else {\n    // the number of bytes the length is specified in bits 7 through 1\n    // and each length byte is in big-endian base-256\n    length = b.getInt((b2 & 0x7F) << 3);\n  }\n  return length;\n};\n\n/**\n * Check if the byte buffer has enough bytes. Throws an Error if not.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the bytes remaining in the current parsing state.\n * @param n the number of bytes the buffer must have.\n */\nfunction _checkBufferLength(bytes, remaining, n) {\n  if(n > remaining) {\n    var error = new Error('Too few bytes to parse DER.');\n    error.available = bytes.length();\n    error.remaining = remaining;\n    error.requested = n;\n    throw error;\n  }\n}\n\n/**\n * Gets the length of a BER-encoded ASN.1 value.\n *\n * In case the length is not specified, undefined is returned.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the bytes remaining in the current parsing state.\n *\n * @return the length of the BER-encoded ASN.1 value or undefined.\n */\nvar _getValueLength = function(bytes, remaining) {\n  // TODO: move this function and related DER/BER functions to a der.js\n  // file; better abstract ASN.1 away from der/ber.\n  // fromDer already checked that this byte exists\n  var b2 = bytes.getByte();\n  remaining--;\n  if(b2 === 0x80) {\n    return undefined;\n  }\n\n  // see if the length is \"short form\" or \"long form\" (bit 8 set)\n  var length;\n  var longForm = b2 & 0x80;\n  if(!longForm) {\n    // length is just the first byte\n    length = b2;\n  } else {\n    // the number of bytes the length is specified in bits 7 through 1\n    // and each length byte is in big-endian base-256\n    var longFormBytes = b2 & 0x7F;\n    _checkBufferLength(bytes, remaining, longFormBytes);\n    length = bytes.getInt(longFormBytes << 3);\n  }\n  // FIXME: this will only happen for 32 bit getInt with high bit set\n  if(length < 0) {\n    throw new Error('Negative length: ' + length);\n  }\n  return length;\n};\n\n/**\n * Parses an asn1 object from a byte buffer in DER format.\n *\n * @param bytes the byte buffer to parse from.\n * @param [strict] true to be strict when checking value lengths, false to\n *          allow truncated values (default: true).\n * @param [options] object with options or boolean strict flag\n *          [strict] true to be strict when checking value lengths, false to\n *            allow truncated values (default: true).\n *          [decodeBitStrings] true to attempt to decode the content of\n *            BIT STRINGs (not OCTET STRINGs) using strict mode. Note that\n *            without schema support to understand the data context this can\n *            erroneously decode values that happen to be valid ASN.1. This\n *            flag will be deprecated or removed as soon as schema support is\n *            available. (default: true)\n *\n * @return the parsed asn1 object.\n */\nasn1.fromDer = function(bytes, options) {\n  if(options === undefined) {\n    options = {\n      strict: true,\n      decodeBitStrings: true\n    };\n  }\n  if(typeof options === 'boolean') {\n    options = {\n      strict: options,\n      decodeBitStrings: true\n    };\n  }\n  if(!('strict' in options)) {\n    options.strict = true;\n  }\n  if(!('decodeBitStrings' in options)) {\n    options.decodeBitStrings = true;\n  }\n\n  // wrap in buffer if needed\n  if(typeof bytes === 'string') {\n    bytes = forge.util.createBuffer(bytes);\n  }\n\n  return _fromDer(bytes, bytes.length(), 0, options);\n};\n\n/**\n * Internal function to parse an asn1 object from a byte buffer in DER format.\n *\n * @param bytes the byte buffer to parse from.\n * @param remaining the number of bytes remaining for this chunk.\n * @param depth the current parsing depth.\n * @param options object with same options as fromDer().\n *\n * @return the parsed asn1 object.\n */\nfunction _fromDer(bytes, remaining, depth, options) {\n  // temporary storage for consumption calculations\n  var start;\n\n  // minimum length for ASN.1 DER structure is 2\n  _checkBufferLength(bytes, remaining, 2);\n\n  // get the first byte\n  var b1 = bytes.getByte();\n  // consumed one byte\n  remaining--;\n\n  // get the tag class\n  var tagClass = (b1 & 0xC0);\n\n  // get the type (bits 1-5)\n  var type = b1 & 0x1F;\n\n  // get the variable value length and adjust remaining bytes\n  start = bytes.length();\n  var length = _getValueLength(bytes, remaining);\n  remaining -= start - bytes.length();\n\n  // ensure there are enough bytes to get the value\n  if(length !== undefined && length > remaining) {\n    if(options.strict) {\n      var error = new Error('Too few bytes to read ASN.1 value.');\n      error.available = bytes.length();\n      error.remaining = remaining;\n      error.requested = length;\n      throw error;\n    }\n    // Note: be lenient with truncated values and use remaining state bytes\n    length = remaining;\n  }\n\n  // value storage\n  var value;\n  // possible BIT STRING contents storage\n  var bitStringContents;\n\n  // constructed flag is bit 6 (32 = 0x20) of the first byte\n  var constructed = ((b1 & 0x20) === 0x20);\n  if(constructed) {\n    // parse child asn1 objects from the value\n    value = [];\n    if(length === undefined) {\n      // asn1 object of indefinite length, read until end tag\n      for(;;) {\n        _checkBufferLength(bytes, remaining, 2);\n        if(bytes.bytes(2) === String.fromCharCode(0, 0)) {\n          bytes.getBytes(2);\n          remaining -= 2;\n          break;\n        }\n        start = bytes.length();\n        value.push(_fromDer(bytes, remaining, depth + 1, options));\n        remaining -= start - bytes.length();\n      }\n    } else {\n      // parsing asn1 object of definite length\n      while(length > 0) {\n        start = bytes.length();\n        value.push(_fromDer(bytes, length, depth + 1, options));\n        remaining -= start - bytes.length();\n        length -= start - bytes.length();\n      }\n    }\n  }\n\n  // if a BIT STRING, save the contents including padding\n  if(value === undefined && tagClass === asn1.Class.UNIVERSAL &&\n    type === asn1.Type.BITSTRING) {\n    bitStringContents = bytes.bytes(length);\n  }\n\n  // determine if a non-constructed value should be decoded as a composed\n  // value that contains other ASN.1 objects. BIT STRINGs (and OCTET STRINGs)\n  // can be used this way.\n  if(value === undefined && options.decodeBitStrings &&\n    tagClass === asn1.Class.UNIVERSAL &&\n    // FIXME: OCTET STRINGs not yet supported here\n    // .. other parts of forge expect to decode OCTET STRINGs manually\n    (type === asn1.Type.BITSTRING /*|| type === asn1.Type.OCTETSTRING*/) &&\n    length > 1) {\n    // save read position\n    var savedRead = bytes.read;\n    var savedRemaining = remaining;\n    var unused = 0;\n    if(type === asn1.Type.BITSTRING) {\n      /* The first octet gives the number of bits by which the length of the\n        bit string is less than the next multiple of eight (this is called\n        the \"number of unused bits\").\n\n        The second and following octets give the value of the bit string\n        converted to an octet string. */\n      _checkBufferLength(bytes, remaining, 1);\n      unused = bytes.getByte();\n      remaining--;\n    }\n    // if all bits are used, maybe the BIT/OCTET STRING holds ASN.1 objs\n    if(unused === 0) {\n      try {\n        // attempt to parse child asn1 object from the value\n        // (stored in array to signal composed value)\n        start = bytes.length();\n        var subOptions = {\n          // enforce strict mode to avoid parsing ASN.1 from plain data\n          verbose: options.verbose,\n          strict: true,\n          decodeBitStrings: true\n        };\n        var composed = _fromDer(bytes, remaining, depth + 1, subOptions);\n        var used = start - bytes.length();\n        remaining -= used;\n        if(type == asn1.Type.BITSTRING) {\n          used++;\n        }\n\n        // if the data all decoded and the class indicates UNIVERSAL or\n        // CONTEXT_SPECIFIC then assume we've got an encapsulated ASN.1 object\n        var tc = composed.tagClass;\n        if(used === length &&\n          (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) {\n          value = [composed];\n        }\n      } catch(ex) {\n      }\n    }\n    if(value === undefined) {\n      // restore read position\n      bytes.read = savedRead;\n      remaining = savedRemaining;\n    }\n  }\n\n  if(value === undefined) {\n    // asn1 not constructed or composed, get raw value\n    // TODO: do DER to OID conversion and vice-versa in .toDer?\n\n    if(length === undefined) {\n      if(options.strict) {\n        throw new Error('Non-constructed ASN.1 object of indefinite length.');\n      }\n      // be lenient and use remaining state bytes\n      length = remaining;\n    }\n\n    if(type === asn1.Type.BMPSTRING) {\n      value = '';\n      for(; length > 0; length -= 2) {\n        _checkBufferLength(bytes, remaining, 2);\n        value += String.fromCharCode(bytes.getInt16());\n        remaining -= 2;\n      }\n    } else {\n      value = bytes.getBytes(length);\n    }\n  }\n\n  // add BIT STRING contents if available\n  var asn1Options = bitStringContents === undefined ?  null : {\n    bitStringContents: bitStringContents\n  };\n\n  // create and return asn1 object\n  return asn1.create(tagClass, type, constructed, value, asn1Options);\n}\n\n/**\n * Converts the given asn1 object to a buffer of bytes in DER format.\n *\n * @param asn1 the asn1 object to convert to bytes.\n *\n * @return the buffer of bytes.\n */\nasn1.toDer = function(obj) {\n  var bytes = forge.util.createBuffer();\n\n  // build the first byte\n  var b1 = obj.tagClass | obj.type;\n\n  // for storing the ASN.1 value\n  var value = forge.util.createBuffer();\n\n  // use BIT STRING contents if available and data not changed\n  var useBitStringContents = false;\n  if('bitStringContents' in obj) {\n    useBitStringContents = true;\n    if(obj.original) {\n      useBitStringContents = asn1.equals(obj, obj.original);\n    }\n  }\n\n  if(useBitStringContents) {\n    value.putBytes(obj.bitStringContents);\n  } else if(obj.composed) {\n    // if composed, use each child asn1 object's DER bytes as value\n    // turn on 6th bit (0x20 = 32) to indicate asn1 is constructed\n    // from other asn1 objects\n    if(obj.constructed) {\n      b1 |= 0x20;\n    } else {\n      // type is a bit string, add unused bits of 0x00\n      value.putByte(0x00);\n    }\n\n    // add all of the child DER bytes together\n    for(var i = 0; i < obj.value.length; ++i) {\n      if(obj.value[i] !== undefined) {\n        value.putBuffer(asn1.toDer(obj.value[i]));\n      }\n    }\n  } else {\n    // use asn1.value directly\n    if(obj.type === asn1.Type.BMPSTRING) {\n      for(var i = 0; i < obj.value.length; ++i) {\n        value.putInt16(obj.value.charCodeAt(i));\n      }\n    } else {\n      // ensure integer is minimally-encoded\n      // TODO: should all leading bytes be stripped vs just one?\n      // .. ex '00 00 01' => '01'?\n      if(obj.type === asn1.Type.INTEGER &&\n        obj.value.length > 1 &&\n        // leading 0x00 for positive integer\n        ((obj.value.charCodeAt(0) === 0 &&\n        (obj.value.charCodeAt(1) & 0x80) === 0) ||\n        // leading 0xFF for negative integer\n        (obj.value.charCodeAt(0) === 0xFF &&\n        (obj.value.charCodeAt(1) & 0x80) === 0x80))) {\n        value.putBytes(obj.value.substr(1));\n      } else {\n        value.putBytes(obj.value);\n      }\n    }\n  }\n\n  // add tag byte\n  bytes.putByte(b1);\n\n  // use \"short form\" encoding\n  if(value.length() <= 127) {\n    // one byte describes the length\n    // bit 8 = 0 and bits 7-1 = length\n    bytes.putByte(value.length() & 0x7F);\n  } else {\n    // use \"long form\" encoding\n    // 2 to 127 bytes describe the length\n    // first byte: bit 8 = 1 and bits 7-1 = # of additional bytes\n    // other bytes: length in base 256, big-endian\n    var len = value.length();\n    var lenBytes = '';\n    do {\n      lenBytes += String.fromCharCode(len & 0xFF);\n      len = len >>> 8;\n    } while(len > 0);\n\n    // set first byte to # bytes used to store the length and turn on\n    // bit 8 to indicate long-form length is used\n    bytes.putByte(lenBytes.length | 0x80);\n\n    // concatenate length bytes in reverse since they were generated\n    // little endian and we need big endian\n    for(var i = lenBytes.length - 1; i >= 0; --i) {\n      bytes.putByte(lenBytes.charCodeAt(i));\n    }\n  }\n\n  // concatenate value bytes\n  bytes.putBuffer(value);\n  return bytes;\n};\n\n/**\n * Converts an OID dot-separated string to a byte buffer. The byte buffer\n * contains only the DER-encoded value, not any tag or length bytes.\n *\n * @param oid the OID dot-separated string.\n *\n * @return the byte buffer.\n */\nasn1.oidToDer = function(oid) {\n  // split OID into individual values\n  var values = oid.split('.');\n  var bytes = forge.util.createBuffer();\n\n  // first byte is 40 * value1 + value2\n  bytes.putByte(40 * parseInt(values[0], 10) + parseInt(values[1], 10));\n  // other bytes are each value in base 128 with 8th bit set except for\n  // the last byte for each value\n  var last, valueBytes, value, b;\n  for(var i = 2; i < values.length; ++i) {\n    // produce value bytes in reverse because we don't know how many\n    // bytes it will take to store the value\n    last = true;\n    valueBytes = [];\n    value = parseInt(values[i], 10);\n    do {\n      b = value & 0x7F;\n      value = value >>> 7;\n      // if value is not last, then turn on 8th bit\n      if(!last) {\n        b |= 0x80;\n      }\n      valueBytes.push(b);\n      last = false;\n    } while(value > 0);\n\n    // add value bytes in reverse (needs to be in big endian)\n    for(var n = valueBytes.length - 1; n >= 0; --n) {\n      bytes.putByte(valueBytes[n]);\n    }\n  }\n\n  return bytes;\n};\n\n/**\n * Converts a DER-encoded byte buffer to an OID dot-separated string. The\n * byte buffer should contain only the DER-encoded value, not any tag or\n * length bytes.\n *\n * @param bytes the byte buffer.\n *\n * @return the OID dot-separated string.\n */\nasn1.derToOid = function(bytes) {\n  var oid;\n\n  // wrap in buffer if needed\n  if(typeof bytes === 'string') {\n    bytes = forge.util.createBuffer(bytes);\n  }\n\n  // first byte is 40 * value1 + value2\n  var b = bytes.getByte();\n  oid = Math.floor(b / 40) + '.' + (b % 40);\n\n  // other bytes are each value in base 128 with 8th bit set except for\n  // the last byte for each value\n  var value = 0;\n  while(bytes.length() > 0) {\n    b = bytes.getByte();\n    value = value << 7;\n    // not the last byte for the value\n    if(b & 0x80) {\n      value += b & 0x7F;\n    } else {\n      // last byte\n      oid += '.' + (value + b);\n      value = 0;\n    }\n  }\n\n  return oid;\n};\n\n/**\n * Converts a UTCTime value to a date.\n *\n * Note: GeneralizedTime has 4 digits for the year and is used for X.509\n * dates past 2049. Parsing that structure hasn't been implemented yet.\n *\n * @param utc the UTCTime value to convert.\n *\n * @return the date.\n */\nasn1.utcTimeToDate = function(utc) {\n  /* The following formats can be used:\n\n    YYMMDDhhmmZ\n    YYMMDDhhmm+hh'mm'\n    YYMMDDhhmm-hh'mm'\n    YYMMDDhhmmssZ\n    YYMMDDhhmmss+hh'mm'\n    YYMMDDhhmmss-hh'mm'\n\n    Where:\n\n    YY is the least significant two digits of the year\n    MM is the month (01 to 12)\n    DD is the day (01 to 31)\n    hh is the hour (00 to 23)\n    mm are the minutes (00 to 59)\n    ss are the seconds (00 to 59)\n    Z indicates that local time is GMT, + indicates that local time is\n    later than GMT, and - indicates that local time is earlier than GMT\n    hh' is the absolute value of the offset from GMT in hours\n    mm' is the absolute value of the offset from GMT in minutes */\n  var date = new Date();\n\n  // if YY >= 50 use 19xx, if YY < 50 use 20xx\n  var year = parseInt(utc.substr(0, 2), 10);\n  year = (year >= 50) ? 1900 + year : 2000 + year;\n  var MM = parseInt(utc.substr(2, 2), 10) - 1; // use 0-11 for month\n  var DD = parseInt(utc.substr(4, 2), 10);\n  var hh = parseInt(utc.substr(6, 2), 10);\n  var mm = parseInt(utc.substr(8, 2), 10);\n  var ss = 0;\n\n  // not just YYMMDDhhmmZ\n  if(utc.length > 11) {\n    // get character after minutes\n    var c = utc.charAt(10);\n    var end = 10;\n\n    // see if seconds are present\n    if(c !== '+' && c !== '-') {\n      // get seconds\n      ss = parseInt(utc.substr(10, 2), 10);\n      end += 2;\n    }\n  }\n\n  // update date\n  date.setUTCFullYear(year, MM, DD);\n  date.setUTCHours(hh, mm, ss, 0);\n\n  if(end) {\n    // get +/- after end of time\n    c = utc.charAt(end);\n    if(c === '+' || c === '-') {\n      // get hours+minutes offset\n      var hhoffset = parseInt(utc.substr(end + 1, 2), 10);\n      var mmoffset = parseInt(utc.substr(end + 4, 2), 10);\n\n      // calculate offset in milliseconds\n      var offset = hhoffset * 60 + mmoffset;\n      offset *= 60000;\n\n      // apply offset\n      if(c === '+') {\n        date.setTime(+date - offset);\n      } else {\n        date.setTime(+date + offset);\n      }\n    }\n  }\n\n  return date;\n};\n\n/**\n * Converts a GeneralizedTime value to a date.\n *\n * @param gentime the GeneralizedTime value to convert.\n *\n * @return the date.\n */\nasn1.generalizedTimeToDate = function(gentime) {\n  /* The following formats can be used:\n\n    YYYYMMDDHHMMSS\n    YYYYMMDDHHMMSS.fff\n    YYYYMMDDHHMMSSZ\n    YYYYMMDDHHMMSS.fffZ\n    YYYYMMDDHHMMSS+hh'mm'\n    YYYYMMDDHHMMSS.fff+hh'mm'\n    YYYYMMDDHHMMSS-hh'mm'\n    YYYYMMDDHHMMSS.fff-hh'mm'\n\n    Where:\n\n    YYYY is the year\n    MM is the month (01 to 12)\n    DD is the day (01 to 31)\n    hh is the hour (00 to 23)\n    mm are the minutes (00 to 59)\n    ss are the seconds (00 to 59)\n    .fff is the second fraction, accurate to three decimal places\n    Z indicates that local time is GMT, + indicates that local time is\n    later than GMT, and - indicates that local time is earlier than GMT\n    hh' is the absolute value of the offset from GMT in hours\n    mm' is the absolute value of the offset from GMT in minutes */\n  var date = new Date();\n\n  var YYYY = parseInt(gentime.substr(0, 4), 10);\n  var MM = parseInt(gentime.substr(4, 2), 10) - 1; // use 0-11 for month\n  var DD = parseInt(gentime.substr(6, 2), 10);\n  var hh = parseInt(gentime.substr(8, 2), 10);\n  var mm = parseInt(gentime.substr(10, 2), 10);\n  var ss = parseInt(gentime.substr(12, 2), 10);\n  var fff = 0;\n  var offset = 0;\n  var isUTC = false;\n\n  if(gentime.charAt(gentime.length - 1) === 'Z') {\n    isUTC = true;\n  }\n\n  var end = gentime.length - 5, c = gentime.charAt(end);\n  if(c === '+' || c === '-') {\n    // get hours+minutes offset\n    var hhoffset = parseInt(gentime.substr(end + 1, 2), 10);\n    var mmoffset = parseInt(gentime.substr(end + 4, 2), 10);\n\n    // calculate offset in milliseconds\n    offset = hhoffset * 60 + mmoffset;\n    offset *= 60000;\n\n    // apply offset\n    if(c === '+') {\n      offset *= -1;\n    }\n\n    isUTC = true;\n  }\n\n  // check for second fraction\n  if(gentime.charAt(14) === '.') {\n    fff = parseFloat(gentime.substr(14), 10) * 1000;\n  }\n\n  if(isUTC) {\n    date.setUTCFullYear(YYYY, MM, DD);\n    date.setUTCHours(hh, mm, ss, fff);\n\n    // apply offset\n    date.setTime(+date + offset);\n  } else {\n    date.setFullYear(YYYY, MM, DD);\n    date.setHours(hh, mm, ss, fff);\n  }\n\n  return date;\n};\n\n/**\n * Converts a date to a UTCTime value.\n *\n * Note: GeneralizedTime has 4 digits for the year and is used for X.509\n * dates past 2049. Converting to a GeneralizedTime hasn't been\n * implemented yet.\n *\n * @param date the date to convert.\n *\n * @return the UTCTime value.\n */\nasn1.dateToUtcTime = function(date) {\n  // TODO: validate; currently assumes proper format\n  if(typeof date === 'string') {\n    return date;\n  }\n\n  var rval = '';\n\n  // create format YYMMDDhhmmssZ\n  var format = [];\n  format.push(('' + date.getUTCFullYear()).substr(2));\n  format.push('' + (date.getUTCMonth() + 1));\n  format.push('' + date.getUTCDate());\n  format.push('' + date.getUTCHours());\n  format.push('' + date.getUTCMinutes());\n  format.push('' + date.getUTCSeconds());\n\n  // ensure 2 digits are used for each format entry\n  for(var i = 0; i < format.length; ++i) {\n    if(format[i].length < 2) {\n      rval += '0';\n    }\n    rval += format[i];\n  }\n  rval += 'Z';\n\n  return rval;\n};\n\n/**\n * Converts a date to a GeneralizedTime value.\n *\n * @param date the date to convert.\n *\n * @return the GeneralizedTime value as a string.\n */\nasn1.dateToGeneralizedTime = function(date) {\n  // TODO: validate; currently assumes proper format\n  if(typeof date === 'string') {\n    return date;\n  }\n\n  var rval = '';\n\n  // create format YYYYMMDDHHMMSSZ\n  var format = [];\n  format.push('' + date.getUTCFullYear());\n  format.push('' + (date.getUTCMonth() + 1));\n  format.push('' + date.getUTCDate());\n  format.push('' + date.getUTCHours());\n  format.push('' + date.getUTCMinutes());\n  format.push('' + date.getUTCSeconds());\n\n  // ensure 2 digits are used for each format entry\n  for(var i = 0; i < format.length; ++i) {\n    if(format[i].length < 2) {\n      rval += '0';\n    }\n    rval += format[i];\n  }\n  rval += 'Z';\n\n  return rval;\n};\n\n/**\n * Converts a javascript integer to a DER-encoded byte buffer to be used\n * as the value for an INTEGER type.\n *\n * @param x the integer.\n *\n * @return the byte buffer.\n */\nasn1.integerToDer = function(x) {\n  var rval = forge.util.createBuffer();\n  if(x >= -0x80 && x < 0x80) {\n    return rval.putSignedInt(x, 8);\n  }\n  if(x >= -0x8000 && x < 0x8000) {\n    return rval.putSignedInt(x, 16);\n  }\n  if(x >= -0x800000 && x < 0x800000) {\n    return rval.putSignedInt(x, 24);\n  }\n  if(x >= -0x80000000 && x < 0x80000000) {\n    return rval.putSignedInt(x, 32);\n  }\n  var error = new Error('Integer too large; max is 32-bits.');\n  error.integer = x;\n  throw error;\n};\n\n/**\n * Converts a DER-encoded byte buffer to a javascript integer. This is\n * typically used to decode the value of an INTEGER type.\n *\n * @param bytes the byte buffer.\n *\n * @return the integer.\n */\nasn1.derToInteger = function(bytes) {\n  // wrap in buffer if needed\n  if(typeof bytes === 'string') {\n    bytes = forge.util.createBuffer(bytes);\n  }\n\n  var n = bytes.length() * 8;\n  if(n > 32) {\n    throw new Error('Integer too large; max is 32-bits.');\n  }\n  return bytes.getSignedInt(n);\n};\n\n/**\n * Validates that the given ASN.1 object is at least a super set of the\n * given ASN.1 structure. Only tag classes and types are checked. An\n * optional map may also be provided to capture ASN.1 values while the\n * structure is checked.\n *\n * To capture an ASN.1 value, set an object in the validator's 'capture'\n * parameter to the key to use in the capture map. To capture the full\n * ASN.1 object, specify 'captureAsn1'. To capture BIT STRING bytes, including\n * the leading unused bits counter byte, specify 'captureBitStringContents'.\n * To capture BIT STRING bytes, without the leading unused bits counter byte,\n * specify 'captureBitStringValue'.\n *\n * Objects in the validator may set a field 'optional' to true to indicate\n * that it isn't necessary to pass validation.\n *\n * @param obj the ASN.1 object to validate.\n * @param v the ASN.1 structure validator.\n * @param capture an optional map to capture values in.\n * @param errors an optional array for storing validation errors.\n *\n * @return true on success, false on failure.\n */\nasn1.validate = function(obj, v, capture, errors) {\n  var rval = false;\n\n  // ensure tag class and type are the same if specified\n  if((obj.tagClass === v.tagClass || typeof(v.tagClass) === 'undefined') &&\n    (obj.type === v.type || typeof(v.type) === 'undefined')) {\n    // ensure constructed flag is the same if specified\n    if(obj.constructed === v.constructed ||\n      typeof(v.constructed) === 'undefined') {\n      rval = true;\n\n      // handle sub values\n      if(v.value && forge.util.isArray(v.value)) {\n        var j = 0;\n        for(var i = 0; rval && i < v.value.length; ++i) {\n          rval = v.value[i].optional || false;\n          if(obj.value[j]) {\n            rval = asn1.validate(obj.value[j], v.value[i], capture, errors);\n            if(rval) {\n              ++j;\n            } else if(v.value[i].optional) {\n              rval = true;\n            }\n          }\n          if(!rval && errors) {\n            errors.push(\n              '[' + v.name + '] ' +\n              'Tag class \"' + v.tagClass + '\", type \"' +\n              v.type + '\" expected value length \"' +\n              v.value.length + '\", got \"' +\n              obj.value.length + '\"');\n          }\n        }\n      }\n\n      if(rval && capture) {\n        if(v.capture) {\n          capture[v.capture] = obj.value;\n        }\n        if(v.captureAsn1) {\n          capture[v.captureAsn1] = obj;\n        }\n        if(v.captureBitStringContents && 'bitStringContents' in obj) {\n          capture[v.captureBitStringContents] = obj.bitStringContents;\n        }\n        if(v.captureBitStringValue && 'bitStringContents' in obj) {\n          var value;\n          if(obj.bitStringContents.length < 2) {\n            capture[v.captureBitStringValue] = '';\n          } else {\n            // FIXME: support unused bits with data shifting\n            var unused = obj.bitStringContents.charCodeAt(0);\n            if(unused !== 0) {\n              throw new Error(\n                'captureBitStringValue only supported for zero unused bits');\n            }\n            capture[v.captureBitStringValue] = obj.bitStringContents.slice(1);\n          }\n        }\n      }\n    } else if(errors) {\n      errors.push(\n        '[' + v.name + '] ' +\n        'Expected constructed \"' + v.constructed + '\", got \"' +\n        obj.constructed + '\"');\n    }\n  } else if(errors) {\n    if(obj.tagClass !== v.tagClass) {\n      errors.push(\n        '[' + v.name + '] ' +\n        'Expected tag class \"' + v.tagClass + '\", got \"' +\n        obj.tagClass + '\"');\n    }\n    if(obj.type !== v.type) {\n      errors.push(\n        '[' + v.name + '] ' +\n        'Expected type \"' + v.type + '\", got \"' + obj.type + '\"');\n    }\n  }\n  return rval;\n};\n\n// regex for testing for non-latin characters\nvar _nonLatinRegex = /[^\\\\u0000-\\\\u00ff]/;\n\n/**\n * Pretty prints an ASN.1 object to a string.\n *\n * @param obj the object to write out.\n * @param level the level in the tree.\n * @param indentation the indentation to use.\n *\n * @return the string.\n */\nasn1.prettyPrint = function(obj, level, indentation) {\n  var rval = '';\n\n  // set default level and indentation\n  level = level || 0;\n  indentation = indentation || 2;\n\n  // start new line for deep levels\n  if(level > 0) {\n    rval += '\\n';\n  }\n\n  // create indent\n  var indent = '';\n  for(var i = 0; i < level * indentation; ++i) {\n    indent += ' ';\n  }\n\n  // print class:type\n  rval += indent + 'Tag: ';\n  switch(obj.tagClass) {\n  case asn1.Class.UNIVERSAL:\n    rval += 'Universal:';\n    break;\n  case asn1.Class.APPLICATION:\n    rval += 'Application:';\n    break;\n  case asn1.Class.CONTEXT_SPECIFIC:\n    rval += 'Context-Specific:';\n    break;\n  case asn1.Class.PRIVATE:\n    rval += 'Private:';\n    break;\n  }\n\n  if(obj.tagClass === asn1.Class.UNIVERSAL) {\n    rval += obj.type;\n\n    // known types\n    switch(obj.type) {\n    case asn1.Type.NONE:\n      rval += ' (None)';\n      break;\n    case asn1.Type.BOOLEAN:\n      rval += ' (Boolean)';\n      break;\n    case asn1.Type.INTEGER:\n      rval += ' (Integer)';\n      break;\n    case asn1.Type.BITSTRING:\n      rval += ' (Bit string)';\n      break;\n    case asn1.Type.OCTETSTRING:\n      rval += ' (Octet string)';\n      break;\n    case asn1.Type.NULL:\n      rval += ' (Null)';\n      break;\n    case asn1.Type.OID:\n      rval += ' (Object Identifier)';\n      break;\n    case asn1.Type.ODESC:\n      rval += ' (Object Descriptor)';\n      break;\n    case asn1.Type.EXTERNAL:\n      rval += ' (External or Instance of)';\n      break;\n    case asn1.Type.REAL:\n      rval += ' (Real)';\n      break;\n    case asn1.Type.ENUMERATED:\n      rval += ' (Enumerated)';\n      break;\n    case asn1.Type.EMBEDDED:\n      rval += ' (Embedded PDV)';\n      break;\n    case asn1.Type.UTF8:\n      rval += ' (UTF8)';\n      break;\n    case asn1.Type.ROID:\n      rval += ' (Relative Object Identifier)';\n      break;\n    case asn1.Type.SEQUENCE:\n      rval += ' (Sequence)';\n      break;\n    case asn1.Type.SET:\n      rval += ' (Set)';\n      break;\n    case asn1.Type.PRINTABLESTRING:\n      rval += ' (Printable String)';\n      break;\n    case asn1.Type.IA5String:\n      rval += ' (IA5String (ASCII))';\n      break;\n    case asn1.Type.UTCTIME:\n      rval += ' (UTC time)';\n      break;\n    case asn1.Type.GENERALIZEDTIME:\n      rval += ' (Generalized time)';\n      break;\n    case asn1.Type.BMPSTRING:\n      rval += ' (BMP String)';\n      break;\n    }\n  } else {\n    rval += obj.type;\n  }\n\n  rval += '\\n';\n  rval += indent + 'Constructed: ' + obj.constructed + '\\n';\n\n  if(obj.composed) {\n    var subvalues = 0;\n    var sub = '';\n    for(var i = 0; i < obj.value.length; ++i) {\n      if(obj.value[i] !== undefined) {\n        subvalues += 1;\n        sub += asn1.prettyPrint(obj.value[i], level + 1, indentation);\n        if((i + 1) < obj.value.length) {\n          sub += ',';\n        }\n      }\n    }\n    rval += indent + 'Sub values: ' + subvalues + sub;\n  } else {\n    rval += indent + 'Value: ';\n    if(obj.type === asn1.Type.OID) {\n      var oid = asn1.derToOid(obj.value);\n      rval += oid;\n      if(forge.pki && forge.pki.oids) {\n        if(oid in forge.pki.oids) {\n          rval += ' (' + forge.pki.oids[oid] + ') ';\n        }\n      }\n    }\n    if(obj.type === asn1.Type.INTEGER) {\n      try {\n        rval += asn1.derToInteger(obj.value);\n      } catch(ex) {\n        rval += '0x' + forge.util.bytesToHex(obj.value);\n      }\n    } else if(obj.type === asn1.Type.BITSTRING) {\n      // TODO: shift bits as needed to display without padding\n      if(obj.value.length > 1) {\n        // remove unused bits field\n        rval += '0x' + forge.util.bytesToHex(obj.value.slice(1));\n      } else {\n        rval += '(none)';\n      }\n      // show unused bit count\n      if(obj.value.length > 0) {\n        var unused = obj.value.charCodeAt(0);\n        if(unused == 1) {\n          rval += ' (1 unused bit shown)';\n        } else if(unused > 1) {\n          rval += ' (' + unused + ' unused bits shown)';\n        }\n      }\n    } else if(obj.type === asn1.Type.OCTETSTRING) {\n      if(!_nonLatinRegex.test(obj.value)) {\n        rval += '(' + obj.value + ') ';\n      }\n      rval += '0x' + forge.util.bytesToHex(obj.value);\n    } else if(obj.type === asn1.Type.UTF8) {\n      rval += forge.util.decodeUtf8(obj.value);\n    } else if(obj.type === asn1.Type.PRINTABLESTRING ||\n      obj.type === asn1.Type.IA5String) {\n      rval += obj.value;\n    } else if(_nonLatinRegex.test(obj.value)) {\n      rval += '0x' + forge.util.bytesToHex(obj.value);\n    } else if(obj.value.length === 0) {\n      rval += '[null]';\n    } else {\n      rval += obj.value;\n    }\n  }\n\n  return rval;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/asn1.js\n// module id = 71\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/asn1.js")},function(module,exports,__webpack_require__){eval("/**\n * Node.js module for Forge message digests.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2017 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n\nmodule.exports = forge.md = forge.md || {};\nforge.md.algorithms = forge.md.algorithms || {};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/md.js\n// module id = 72\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/md.js")},function(module,exports){eval("module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n    var target = {}\n\n    for (var i = 0; i < arguments.length; i++) {\n        var source = arguments[i]\n\n        for (var key in source) {\n            if (hasOwnProperty.call(source, key)) {\n                target[key] = source[key]\n            }\n        }\n    }\n\n    return target\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xtend/immutable.js\n// module id = 73\n// module chunks = 0\n\n//# sourceURL=../node_modules/xtend/immutable.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n\n'use strict';\n\n// Utils\n\nfunction assert(val, msg) {\n  if (!val)\n    throw new Error(msg || 'Assertion failed');\n}\n\n// Could use `inherits` module, but don't want to move from single file\n// architecture yet.\nfunction inherits(ctor, superCtor) {\n  ctor.super_ = superCtor;\n  var TempCtor = function () {};\n  TempCtor.prototype = superCtor.prototype;\n  ctor.prototype = new TempCtor();\n  ctor.prototype.constructor = ctor;\n}\n\n// BN\n\nfunction BN(number, base, endian) {\n  // May be `new BN(bn)` ?\n  if (number !== null &&\n      typeof number === 'object' &&\n      Array.isArray(number.words)) {\n    return number;\n  }\n\n  this.sign = false;\n  this.words = null;\n  this.length = 0;\n\n  // Reduction context\n  this.red = null;\n\n  if (base === 'le' || base === 'be') {\n    endian = base;\n    base = 10;\n  }\n\n  if (number !== null)\n    this._init(number || 0, base || 10, endian || 'be');\n}\nif (typeof module === 'object')\n  module.exports = BN;\nelse\n  exports.BN = BN;\n\nBN.BN = BN;\nBN.wordSize = 26;\n\nBN.prototype._init = function init(number, base, endian) {\n  if (typeof number === 'number') {\n    if (number < 0) {\n      this.sign = true;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n    return;\n  } else if (typeof number === 'object') {\n    return this._initArray(number, base, endian);\n  }\n  if (base === 'hex')\n    base = 16;\n  assert(base === (base | 0) && base >= 2 && base <= 36);\n\n  number = number.toString().replace(/\\s+/g, '');\n  var start = 0;\n  if (number[0] === '-')\n    start++;\n\n  if (base === 16)\n    this._parseHex(number, start);\n  else\n    this._parseBase(number, base, start);\n\n  if (number[0] === '-')\n    this.sign = true;\n\n  this.strip();\n};\n\nBN.prototype._initArray = function _initArray(number, base, endian) {\n  // Perhaps a Uint8Array\n  assert(typeof number.length === 'number');\n  if (number.length <= 0) {\n    this.words = [ 0 ];\n    this.length = 1;\n    return this;\n  }\n\n  this.length = Math.ceil(number.length / 3);\n  this.words = new Array(this.length);\n  for (var i = 0; i < this.length; i++)\n    this.words[i] = 0;\n\n  var off = 0;\n  if (endian === 'be') {\n    for (var i = number.length - 1, j = 0; i >= 0; i -= 3) {\n      var w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n  } else if (endian === 'le') {\n    for (var i = 0, j = 0; i < number.length; i += 3) {\n      var w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n  }\n  return this.strip();\n};\n\nfunction parseHex(str, start, end) {\n  var r = 0;\n  var len = Math.min(str.length, end);\n  for (var i = start; i < len; i++) {\n    var c = str.charCodeAt(i) - 48;\n\n    r <<= 4;\n\n    // 'a' - 'f'\n    if (c >= 49 && c <= 54)\n      r |= c - 49 + 0xa;\n\n    // 'A' - 'F'\n    else if (c >= 17 && c <= 22)\n      r |= c - 17 + 0xa;\n\n    // '0' - '9'\n    else\n      r |= c & 0xf;\n  }\n  return r;\n}\n\nBN.prototype._parseHex = function _parseHex(number, start) {\n  // Create possibly bigger array to ensure that it fits the number\n  this.length = Math.ceil((number.length - start) / 6);\n  this.words = new Array(this.length);\n  for (var i = 0; i < this.length; i++)\n    this.words[i] = 0;\n\n  // Scan 24-bit chunks and add them to the number\n  var off = 0;\n  for (var i = number.length - 6, j = 0; i >= start; i -= 6) {\n    var w = parseHex(number, i, i + 6);\n    this.words[j] |= (w << off) & 0x3ffffff;\n    this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    off += 24;\n    if (off >= 26) {\n      off -= 26;\n      j++;\n    }\n  }\n  if (i + 6 !== start) {\n    var w = parseHex(number, start, i + 6);\n    this.words[j] |= (w << off) & 0x3ffffff;\n    this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n  }\n  this.strip();\n};\n\nfunction parseBase(str, start, end, mul) {\n  var r = 0;\n  var len = Math.min(str.length, end);\n  for (var i = start; i < len; i++) {\n    var c = str.charCodeAt(i) - 48;\n\n    r *= mul;\n\n    // 'a'\n    if (c >= 49)\n      r += c - 49 + 0xa;\n\n    // 'A'\n    else if (c >= 17)\n      r += c - 17 + 0xa;\n\n    // '0' - '9'\n    else\n      r += c;\n  }\n  return r;\n}\n\nBN.prototype._parseBase = function _parseBase(number, base, start) {\n  // Initialize as zero\n  this.words = [ 0 ];\n  this.length = 1;\n\n  // Find length of limb in base\n  for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base)\n    limbLen++;\n  limbLen--;\n  limbPow = (limbPow / base) | 0;\n\n  var total = number.length - start;\n  var mod = total % limbLen;\n  var end = Math.min(total, total - mod) + start;\n\n  var word = 0;\n  for (var i = start; i < end; i += limbLen) {\n    word = parseBase(number, i, i + limbLen, base);\n\n    this.imuln(limbPow);\n    if (this.words[0] + word < 0x4000000)\n      this.words[0] += word;\n    else\n      this._iaddn(word);\n  }\n\n  if (mod !== 0) {\n    var pow = 1;\n    var word = parseBase(number, i, number.length, base);\n\n    for (var i = 0; i < mod; i++)\n      pow *= base;\n    this.imuln(pow);\n    if (this.words[0] + word < 0x4000000)\n      this.words[0] += word;\n    else\n      this._iaddn(word);\n  }\n};\n\nBN.prototype.copy = function copy(dest) {\n  dest.words = new Array(this.length);\n  for (var i = 0; i < this.length; i++)\n    dest.words[i] = this.words[i];\n  dest.length = this.length;\n  dest.sign = this.sign;\n  dest.red = this.red;\n};\n\nBN.prototype.clone = function clone() {\n  var r = new BN(null);\n  this.copy(r);\n  return r;\n};\n\n// Remove leading `0` from `this`\nBN.prototype.strip = function strip() {\n  while (this.length > 1 && this.words[this.length - 1] === 0)\n    this.length--;\n  return this._normSign();\n};\n\nBN.prototype._normSign = function _normSign() {\n  // -0 = 0\n  if (this.length === 1 && this.words[0] === 0)\n    this.sign = false;\n  return this;\n};\n\nBN.prototype.inspect = function inspect() {\n  return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n};\n\n/*\n\nvar zeros = [];\nvar groupSizes = [];\nvar groupBases = [];\n\nvar s = '';\nvar i = -1;\nwhile (++i < BN.wordSize) {\n  zeros[i] = s;\n  s += '0';\n}\ngroupSizes[0] = 0;\ngroupSizes[1] = 0;\ngroupBases[0] = 0;\ngroupBases[1] = 0;\nvar base = 2 - 1;\nwhile (++base < 36 + 1) {\n  var groupSize = 0;\n  var groupBase = 1;\n  while (groupBase < (1 << BN.wordSize) / base) {\n    groupBase *= base;\n    groupSize += 1;\n  }\n  groupSizes[base] = groupSize;\n  groupBases[base] = groupBase;\n}\n\n*/\n\nvar zeros = [\n  '',\n  '0',\n  '00',\n  '000',\n  '0000',\n  '00000',\n  '000000',\n  '0000000',\n  '00000000',\n  '000000000',\n  '0000000000',\n  '00000000000',\n  '000000000000',\n  '0000000000000',\n  '00000000000000',\n  '000000000000000',\n  '0000000000000000',\n  '00000000000000000',\n  '000000000000000000',\n  '0000000000000000000',\n  '00000000000000000000',\n  '000000000000000000000',\n  '0000000000000000000000',\n  '00000000000000000000000',\n  '000000000000000000000000',\n  '0000000000000000000000000'\n];\n\nvar groupSizes = [\n  0, 0,\n  25, 16, 12, 11, 10, 9, 8,\n  8, 7, 7, 7, 7, 6, 6,\n  6, 6, 6, 6, 6, 5, 5,\n  5, 5, 5, 5, 5, 5, 5,\n  5, 5, 5, 5, 5, 5, 5\n];\n\nvar groupBases = [\n  0, 0,\n  33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n  43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n  16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n  6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n  24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n];\n\nBN.prototype.toString = function toString(base, padding) {\n  base = base || 10;\n  if (base === 16 || base === 'hex') {\n    var out = '';\n    var off = 0;\n    var padding = padding | 0 || 1;\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = this.words[i];\n      var word = (((w << off) | carry) & 0xffffff).toString(16);\n      carry = (w >>> (24 - off)) & 0xffffff;\n      if (carry !== 0 || i !== this.length - 1)\n        out = zeros[6 - word.length] + word + out;\n      else\n        out = word + out;\n      off += 2;\n      if (off >= 26) {\n        off -= 26;\n        i--;\n      }\n    }\n    if (carry !== 0)\n      out = carry.toString(16) + out;\n    while (out.length % padding !== 0)\n      out = '0' + out;\n    if (this.sign)\n      out = '-' + out;\n    return out;\n  } else if (base === (base | 0) && base >= 2 && base <= 36) {\n    // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n    var groupSize = groupSizes[base];\n    // var groupBase = Math.pow(base, groupSize);\n    var groupBase = groupBases[base];\n    var out = '';\n    var c = this.clone();\n    c.sign = false;\n    while (c.cmpn(0) !== 0) {\n      var r = c.modn(groupBase).toString(base);\n      c = c.idivn(groupBase);\n\n      if (c.cmpn(0) !== 0)\n        out = zeros[groupSize - r.length] + r + out;\n      else\n        out = r + out;\n    }\n    if (this.cmpn(0) === 0)\n      out = '0' + out;\n    if (this.sign)\n      out = '-' + out;\n    return out;\n  } else {\n    assert(false, 'Base should be between 2 and 36');\n  }\n};\n\nBN.prototype.toJSON = function toJSON() {\n  return this.toString(16);\n};\n\nBN.prototype.toArray = function toArray() {\n  this.strip();\n  var res = new Array(this.byteLength());\n  res[0] = 0;\n\n  var q = this.clone();\n  for (var i = 0; q.cmpn(0) !== 0; i++) {\n    var b = q.andln(0xff);\n    q.ishrn(8);\n\n    // Assume big-endian\n    res[res.length - i - 1] = b;\n  }\n\n  return res;\n};\n\nif (Math.clz32) {\n  BN.prototype._countBits = function _countBits(w) {\n    return 32 - Math.clz32(w);\n  };\n} else {\n  BN.prototype._countBits = function _countBits(w) {\n    var t = w;\n    var r = 0;\n    if (t >= 0x1000) {\n      r += 13;\n      t >>>= 13;\n    }\n    if (t >= 0x40) {\n      r += 7;\n      t >>>= 7;\n    }\n    if (t >= 0x8) {\n      r += 4;\n      t >>>= 4;\n    }\n    if (t >= 0x02) {\n      r += 2;\n      t >>>= 2;\n    }\n    return r + t;\n  };\n}\n\nBN.prototype._zeroBits = function _zeroBits(w) {\n  // Short-cut\n  if (w === 0)\n    return 26;\n\n  var t = w;\n  var r = 0;\n  if ((t & 0x1fff) === 0) {\n    r += 13;\n    t >>>= 13;\n  }\n  if ((t & 0x7f) === 0) {\n    r += 7;\n    t >>>= 7;\n  }\n  if ((t & 0xf) === 0) {\n    r += 4;\n    t >>>= 4;\n  }\n  if ((t & 0x3) === 0) {\n    r += 2;\n    t >>>= 2;\n  }\n  if ((t & 0x1) === 0)\n    r++;\n  return r;\n};\n\n// Return number of used bits in a BN\nBN.prototype.bitLength = function bitLength() {\n  var hi = 0;\n  var w = this.words[this.length - 1];\n  var hi = this._countBits(w);\n  return (this.length - 1) * 26 + hi;\n};\n\n// Number of trailing zero bits\nBN.prototype.zeroBits = function zeroBits() {\n  if (this.cmpn(0) === 0)\n    return 0;\n\n  var r = 0;\n  for (var i = 0; i < this.length; i++) {\n    var b = this._zeroBits(this.words[i]);\n    r += b;\n    if (b !== 26)\n      break;\n  }\n  return r;\n};\n\nBN.prototype.byteLength = function byteLength() {\n  return Math.ceil(this.bitLength() / 8);\n};\n\n// Return negative clone of `this`\nBN.prototype.neg = function neg() {\n  if (this.cmpn(0) === 0)\n    return this.clone();\n\n  var r = this.clone();\n  r.sign = !this.sign;\n  return r;\n};\n\n\n// Or `num` with `this` in-place\nBN.prototype.ior = function ior(num) {\n  this.sign = this.sign || num.sign;\n\n  while (this.length < num.length)\n    this.words[this.length++] = 0;\n\n  for (var i = 0; i < num.length; i++)\n    this.words[i] = this.words[i] | num.words[i];\n\n  return this.strip();\n};\n\n\n// Or `num` with `this`\nBN.prototype.or = function or(num) {\n  if (this.length > num.length)\n    return this.clone().ior(num);\n  else\n    return num.clone().ior(this);\n};\n\n\n// And `num` with `this` in-place\nBN.prototype.iand = function iand(num) {\n  this.sign = this.sign && num.sign;\n\n  // b = min-length(num, this)\n  var b;\n  if (this.length > num.length)\n    b = num;\n  else\n    b = this;\n\n  for (var i = 0; i < b.length; i++)\n    this.words[i] = this.words[i] & num.words[i];\n\n  this.length = b.length;\n\n  return this.strip();\n};\n\n\n// And `num` with `this`\nBN.prototype.and = function and(num) {\n  if (this.length > num.length)\n    return this.clone().iand(num);\n  else\n    return num.clone().iand(this);\n};\n\n\n// Xor `num` with `this` in-place\nBN.prototype.ixor = function ixor(num) {\n  this.sign = this.sign || num.sign;\n\n  // a.length > b.length\n  var a;\n  var b;\n  if (this.length > num.length) {\n    a = this;\n    b = num;\n  } else {\n    a = num;\n    b = this;\n  }\n\n  for (var i = 0; i < b.length; i++)\n    this.words[i] = a.words[i] ^ b.words[i];\n\n  if (this !== a)\n    for (; i < a.length; i++)\n      this.words[i] = a.words[i];\n\n  this.length = a.length;\n\n  return this.strip();\n};\n\n\n// Xor `num` with `this`\nBN.prototype.xor = function xor(num) {\n  if (this.length > num.length)\n    return this.clone().ixor(num);\n  else\n    return num.clone().ixor(this);\n};\n\n\n// Set `bit` of `this`\nBN.prototype.setn = function setn(bit, val) {\n  assert(typeof bit === 'number' && bit >= 0);\n\n  var off = (bit / 26) | 0;\n  var wbit = bit % 26;\n\n  while (this.length <= off)\n    this.words[this.length++] = 0;\n\n  if (val)\n    this.words[off] = this.words[off] | (1 << wbit);\n  else\n    this.words[off] = this.words[off] & ~(1 << wbit);\n\n  return this.strip();\n};\n\n\n// Add `num` to `this` in-place\nBN.prototype.iadd = function iadd(num) {\n  // negative + positive\n  if (this.sign && !num.sign) {\n    this.sign = false;\n    var r = this.isub(num);\n    this.sign = !this.sign;\n    return this._normSign();\n\n  // positive + negative\n  } else if (!this.sign && num.sign) {\n    num.sign = false;\n    var r = this.isub(num);\n    num.sign = true;\n    return r._normSign();\n  }\n\n  // a.length > b.length\n  var a;\n  var b;\n  if (this.length > num.length) {\n    a = this;\n    b = num;\n  } else {\n    a = num;\n    b = this;\n  }\n\n  var carry = 0;\n  for (var i = 0; i < b.length; i++) {\n    var r = a.words[i] + b.words[i] + carry;\n    this.words[i] = r & 0x3ffffff;\n    carry = r >>> 26;\n  }\n  for (; carry !== 0 && i < a.length; i++) {\n    var r = a.words[i] + carry;\n    this.words[i] = r & 0x3ffffff;\n    carry = r >>> 26;\n  }\n\n  this.length = a.length;\n  if (carry !== 0) {\n    this.words[this.length] = carry;\n    this.length++;\n  // Copy the rest of the words\n  } else if (a !== this) {\n    for (; i < a.length; i++)\n      this.words[i] = a.words[i];\n  }\n\n  return this;\n};\n\n// Add `num` to `this`\nBN.prototype.add = function add(num) {\n  if (num.sign && !this.sign) {\n    num.sign = false;\n    var res = this.sub(num);\n    num.sign = true;\n    return res;\n  } else if (!num.sign && this.sign) {\n    this.sign = false;\n    var res = num.sub(this);\n    this.sign = true;\n    return res;\n  }\n\n  if (this.length > num.length)\n    return this.clone().iadd(num);\n  else\n    return num.clone().iadd(this);\n};\n\n// Subtract `num` from `this` in-place\nBN.prototype.isub = function isub(num) {\n  // this - (-num) = this + num\n  if (num.sign) {\n    num.sign = false;\n    var r = this.iadd(num);\n    num.sign = true;\n    return r._normSign();\n\n  // -this - num = -(this + num)\n  } else if (this.sign) {\n    this.sign = false;\n    this.iadd(num);\n    this.sign = true;\n    return this._normSign();\n  }\n\n  // At this point both numbers are positive\n  var cmp = this.cmp(num);\n\n  // Optimization - zeroify\n  if (cmp === 0) {\n    this.sign = false;\n    this.length = 1;\n    this.words[0] = 0;\n    return this;\n  }\n\n  // a > b\n  var a;\n  var b;\n  if (cmp > 0) {\n    a = this;\n    b = num;\n  } else {\n    a = num;\n    b = this;\n  }\n\n  var carry = 0;\n  for (var i = 0; i < b.length; i++) {\n    var r = a.words[i] - b.words[i] + carry;\n    carry = r >> 26;\n    this.words[i] = r & 0x3ffffff;\n  }\n  for (; carry !== 0 && i < a.length; i++) {\n    var r = a.words[i] + carry;\n    carry = r >> 26;\n    this.words[i] = r & 0x3ffffff;\n  }\n\n  // Copy rest of the words\n  if (carry === 0 && i < a.length && a !== this)\n    for (; i < a.length; i++)\n      this.words[i] = a.words[i];\n  this.length = Math.max(this.length, i);\n\n  if (a !== this)\n    this.sign = true;\n\n  return this.strip();\n};\n\n// Subtract `num` from `this`\nBN.prototype.sub = function sub(num) {\n  return this.clone().isub(num);\n};\n\n/*\n// NOTE: This could be potentionally used to generate loop-less multiplications\nfunction _genCombMulTo(alen, blen) {\n  var len = alen + blen - 1;\n  var src = [\n    'var a = this.words, b = num.words, o = out.words, c = 0, w, ' +\n        'mask = 0x3ffffff, shift = 0x4000000;',\n    'out.length = ' + len + ';'\n  ];\n  for (var k = 0; k < len; k++) {\n    var minJ = Math.max(0, k - alen + 1);\n    var maxJ = Math.min(k, blen - 1);\n\n    for (var j = minJ; j <= maxJ; j++) {\n      var i = k - j;\n      var mul = 'a[' + i + '] * b[' + j + ']';\n\n      if (j === minJ) {\n        src.push('w = ' + mul + ' + c;');\n        src.push('c = (w / shift) | 0;');\n      } else {\n        src.push('w += ' + mul + ';');\n        src.push('c += (w / shift) | 0;');\n      }\n      src.push('w &= mask;');\n    }\n    src.push('o[' + k + '] = w;');\n  }\n  src.push('if (c !== 0) {',\n           '  o[' + k + '] = c;',\n           '  out.length++;',\n           '}',\n           'return out;');\n\n  return src.join('\\n');\n}\n*/\n\nBN.prototype._smallMulTo = function _smallMulTo(num, out) {\n  out.sign = num.sign !== this.sign;\n  out.length = this.length + num.length;\n\n  var carry = 0;\n  for (var k = 0; k < out.length - 1; k++) {\n    // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n    // note that ncarry could be >= 0x3ffffff\n    var ncarry = carry >>> 26;\n    var rword = carry & 0x3ffffff;\n    var maxJ = Math.min(k, num.length - 1);\n    for (var j = Math.max(0, k - this.length + 1); j <= maxJ; j++) {\n      var i = k - j;\n      var a = this.words[i] | 0;\n      var b = num.words[j] | 0;\n      var r = a * b;\n\n      var lo = r & 0x3ffffff;\n      ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n      lo = (lo + rword) | 0;\n      rword = lo & 0x3ffffff;\n      ncarry = (ncarry + (lo >>> 26)) | 0;\n    }\n    out.words[k] = rword;\n    carry = ncarry;\n  }\n  if (carry !== 0) {\n    out.words[k] = carry;\n  } else {\n    out.length--;\n  }\n\n  return out.strip();\n};\n\nBN.prototype._bigMulTo = function _bigMulTo(num, out) {\n  out.sign = num.sign !== this.sign;\n  out.length = this.length + num.length;\n\n  var carry = 0;\n  var hncarry = 0;\n  for (var k = 0; k < out.length - 1; k++) {\n    // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n    // note that ncarry could be >= 0x3ffffff\n    var ncarry = hncarry;\n    hncarry = 0;\n    var rword = carry & 0x3ffffff;\n    var maxJ = Math.min(k, num.length - 1);\n    for (var j = Math.max(0, k - this.length + 1); j <= maxJ; j++) {\n      var i = k - j;\n      var a = this.words[i] | 0;\n      var b = num.words[j] | 0;\n      var r = a * b;\n\n      var lo = r & 0x3ffffff;\n      ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n      lo = (lo + rword) | 0;\n      rword = lo & 0x3ffffff;\n      ncarry = (ncarry + (lo >>> 26)) | 0;\n\n      hncarry += ncarry >>> 26;\n      ncarry &= 0x3ffffff;\n    }\n    out.words[k] = rword;\n    carry = ncarry;\n    ncarry = hncarry;\n  }\n  if (carry !== 0) {\n    out.words[k] = carry;\n  } else {\n    out.length--;\n  }\n\n  return out.strip();\n};\n\nBN.prototype.mulTo = function mulTo(num, out) {\n  var res;\n  if (this.length + num.length < 63)\n    res = this._smallMulTo(num, out);\n  else\n    res = this._bigMulTo(num, out);\n  return res;\n};\n\n// Multiply `this` by `num`\nBN.prototype.mul = function mul(num) {\n  var out = new BN(null);\n  out.words = new Array(this.length + num.length);\n  return this.mulTo(num, out);\n};\n\n// In-place Multiplication\nBN.prototype.imul = function imul(num) {\n  if (this.cmpn(0) === 0 || num.cmpn(0) === 0) {\n    this.words[0] = 0;\n    this.length = 1;\n    return this;\n  }\n\n  var tlen = this.length;\n  var nlen = num.length;\n\n  this.sign = num.sign !== this.sign;\n  this.length = this.length + num.length;\n  this.words[this.length - 1] = 0;\n\n  for (var k = this.length - 2; k >= 0; k--) {\n    // Sum all words with the same `i + j = k` and accumulate `carry`,\n    // note that carry could be >= 0x3ffffff\n    var carry = 0;\n    var rword = 0;\n    var maxJ = Math.min(k, nlen - 1);\n    for (var j = Math.max(0, k - tlen + 1); j <= maxJ; j++) {\n      var i = k - j;\n      var a = this.words[i];\n      var b = num.words[j];\n      var r = a * b;\n\n      var lo = r & 0x3ffffff;\n      carry += (r / 0x4000000) | 0;\n      lo += rword;\n      rword = lo & 0x3ffffff;\n      carry += lo >>> 26;\n    }\n    this.words[k] = rword;\n    this.words[k + 1] += carry;\n    carry = 0;\n  }\n\n  // Propagate overflows\n  var carry = 0;\n  for (var i = 1; i < this.length; i++) {\n    var w = this.words[i] + carry;\n    this.words[i] = w & 0x3ffffff;\n    carry = w >>> 26;\n  }\n\n  return this.strip();\n};\n\nBN.prototype.imuln = function imuln(num) {\n  assert(typeof num === 'number');\n\n  // Carry\n  var carry = 0;\n  for (var i = 0; i < this.length; i++) {\n    var w = this.words[i] * num;\n    var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n    carry >>= 26;\n    carry += (w / 0x4000000) | 0;\n    // NOTE: lo is 27bit maximum\n    carry += lo >>> 26;\n    this.words[i] = lo & 0x3ffffff;\n  }\n\n  if (carry !== 0) {\n    this.words[i] = carry;\n    this.length++;\n  }\n\n  return this;\n};\n\n// `this` * `this`\nBN.prototype.sqr = function sqr() {\n  return this.mul(this);\n};\n\n// `this` * `this` in-place\nBN.prototype.isqr = function isqr() {\n  return this.mul(this);\n};\n\n// Shift-left in-place\nBN.prototype.ishln = function ishln(bits) {\n  assert(typeof bits === 'number' && bits >= 0);\n  var r = bits % 26;\n  var s = (bits - r) / 26;\n  var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n\n  if (r !== 0) {\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var newCarry = this.words[i] & carryMask;\n      var c = (this.words[i] - newCarry) << r;\n      this.words[i] = c | carry;\n      carry = newCarry >>> (26 - r);\n    }\n    if (carry) {\n      this.words[i] = carry;\n      this.length++;\n    }\n  }\n\n  if (s !== 0) {\n    for (var i = this.length - 1; i >= 0; i--)\n      this.words[i + s] = this.words[i];\n    for (var i = 0; i < s; i++)\n      this.words[i] = 0;\n    this.length += s;\n  }\n\n  return this.strip();\n};\n\n// Shift-right in-place\n// NOTE: `hint` is a lowest bit before trailing zeroes\n// NOTE: if `extended` is present - it will be filled with destroyed bits\nBN.prototype.ishrn = function ishrn(bits, hint, extended) {\n  assert(typeof bits === 'number' && bits >= 0);\n  var h;\n  if (hint)\n    h = (hint - (hint % 26)) / 26;\n  else\n    h = 0;\n\n  var r = bits % 26;\n  var s = Math.min((bits - r) / 26, this.length);\n  var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n  var maskedWords = extended;\n\n  h -= s;\n  h = Math.max(0, h);\n\n  // Extended mode, copy masked part\n  if (maskedWords) {\n    for (var i = 0; i < s; i++)\n      maskedWords.words[i] = this.words[i];\n    maskedWords.length = s;\n  }\n\n  if (s === 0) {\n    // No-op, we should not move anything at all\n  } else if (this.length > s) {\n    this.length -= s;\n    for (var i = 0; i < this.length; i++)\n      this.words[i] = this.words[i + s];\n  } else {\n    this.words[0] = 0;\n    this.length = 1;\n  }\n\n  var carry = 0;\n  for (var i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n    var word = this.words[i];\n    this.words[i] = (carry << (26 - r)) | (word >>> r);\n    carry = word & mask;\n  }\n\n  // Push carried bits as a mask\n  if (maskedWords && carry !== 0)\n    maskedWords.words[maskedWords.length++] = carry;\n\n  if (this.length === 0) {\n    this.words[0] = 0;\n    this.length = 1;\n  }\n\n  this.strip();\n\n  return this;\n};\n\n// Shift-left\nBN.prototype.shln = function shln(bits) {\n  return this.clone().ishln(bits);\n};\n\n// Shift-right\nBN.prototype.shrn = function shrn(bits) {\n  return this.clone().ishrn(bits);\n};\n\n// Test if n bit is set\nBN.prototype.testn = function testn(bit) {\n  assert(typeof bit === 'number' && bit >= 0);\n  var r = bit % 26;\n  var s = (bit - r) / 26;\n  var q = 1 << r;\n\n  // Fast case: bit is much higher than all existing words\n  if (this.length <= s) {\n    return false;\n  }\n\n  // Check bit and return\n  var w = this.words[s];\n\n  return !!(w & q);\n};\n\n// Return only lowers bits of number (in-place)\nBN.prototype.imaskn = function imaskn(bits) {\n  assert(typeof bits === 'number' && bits >= 0);\n  var r = bits % 26;\n  var s = (bits - r) / 26;\n\n  assert(!this.sign, 'imaskn works only with positive numbers');\n\n  if (r !== 0)\n    s++;\n  this.length = Math.min(s, this.length);\n\n  if (r !== 0) {\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    this.words[this.length - 1] &= mask;\n  }\n\n  return this.strip();\n};\n\n// Return only lowers bits of number\nBN.prototype.maskn = function maskn(bits) {\n  return this.clone().imaskn(bits);\n};\n\n// Add plain number `num` to `this`\nBN.prototype.iaddn = function iaddn(num) {\n  assert(typeof num === 'number');\n  if (num < 0)\n    return this.isubn(-num);\n\n  // Possible sign change\n  if (this.sign) {\n    if (this.length === 1 && this.words[0] < num) {\n      this.words[0] = num - this.words[0];\n      this.sign = false;\n      return this;\n    }\n\n    this.sign = false;\n    this.isubn(num);\n    this.sign = true;\n    return this;\n  }\n\n  // Add without checks\n  return this._iaddn(num);\n};\n\nBN.prototype._iaddn = function _iaddn(num) {\n  this.words[0] += num;\n\n  // Carry\n  for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n    this.words[i] -= 0x4000000;\n    if (i === this.length - 1)\n      this.words[i + 1] = 1;\n    else\n      this.words[i + 1]++;\n  }\n  this.length = Math.max(this.length, i + 1);\n\n  return this;\n};\n\n// Subtract plain number `num` from `this`\nBN.prototype.isubn = function isubn(num) {\n  assert(typeof num === 'number');\n  if (num < 0)\n    return this.iaddn(-num);\n\n  if (this.sign) {\n    this.sign = false;\n    this.iaddn(num);\n    this.sign = true;\n    return this;\n  }\n\n  this.words[0] -= num;\n\n  // Carry\n  for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n    this.words[i] += 0x4000000;\n    this.words[i + 1] -= 1;\n  }\n\n  return this.strip();\n};\n\nBN.prototype.addn = function addn(num) {\n  return this.clone().iaddn(num);\n};\n\nBN.prototype.subn = function subn(num) {\n  return this.clone().isubn(num);\n};\n\nBN.prototype.iabs = function iabs() {\n  this.sign = false;\n\n  return this;\n};\n\nBN.prototype.abs = function abs() {\n  return this.clone().iabs();\n};\n\nBN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {\n  // Bigger storage is needed\n  var len = num.length + shift;\n  var i;\n  if (this.words.length < len) {\n    var t = new Array(len);\n    for (var i = 0; i < this.length; i++)\n      t[i] = this.words[i];\n    this.words = t;\n  } else {\n    i = this.length;\n  }\n\n  // Zeroify rest\n  this.length = Math.max(this.length, len);\n  for (; i < this.length; i++)\n    this.words[i] = 0;\n\n  var carry = 0;\n  for (var i = 0; i < num.length; i++) {\n    var w = this.words[i + shift] + carry;\n    var right = num.words[i] * mul;\n    w -= right & 0x3ffffff;\n    carry = (w >> 26) - ((right / 0x4000000) | 0);\n    this.words[i + shift] = w & 0x3ffffff;\n  }\n  for (; i < this.length - shift; i++) {\n    var w = this.words[i + shift] + carry;\n    carry = w >> 26;\n    this.words[i + shift] = w & 0x3ffffff;\n  }\n\n  if (carry === 0)\n    return this.strip();\n\n  // Subtraction overflow\n  assert(carry === -1);\n  carry = 0;\n  for (var i = 0; i < this.length; i++) {\n    var w = -this.words[i] + carry;\n    carry = w >> 26;\n    this.words[i] = w & 0x3ffffff;\n  }\n  this.sign = true;\n\n  return this.strip();\n};\n\nBN.prototype._wordDiv = function _wordDiv(num, mode) {\n  var shift = this.length - num.length;\n\n  var a = this.clone();\n  var b = num;\n\n  // Normalize\n  var bhi = b.words[b.length - 1];\n  var bhiBits = this._countBits(bhi);\n  shift = 26 - bhiBits;\n  if (shift !== 0) {\n    b = b.shln(shift);\n    a.ishln(shift);\n    bhi = b.words[b.length - 1];\n  }\n\n  // Initialize quotient\n  var m = a.length - b.length;\n  var q;\n\n  if (mode !== 'mod') {\n    q = new BN(null);\n    q.length = m + 1;\n    q.words = new Array(q.length);\n    for (var i = 0; i < q.length; i++)\n      q.words[i] = 0;\n  }\n\n  var diff = a.clone()._ishlnsubmul(b, 1, m);\n  if (!diff.sign) {\n    a = diff;\n    if (q)\n      q.words[m] = 1;\n  }\n\n  for (var j = m - 1; j >= 0; j--) {\n    var qj = a.words[b.length + j] * 0x4000000 + a.words[b.length + j - 1];\n\n    // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n    // (0x7ffffff)\n    qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n    a._ishlnsubmul(b, qj, j);\n    while (a.sign) {\n      qj--;\n      a.sign = false;\n      a._ishlnsubmul(b, 1, j);\n      if (a.cmpn(0) !== 0)\n        a.sign = !a.sign;\n    }\n    if (q)\n      q.words[j] = qj;\n  }\n  if (q)\n    q.strip();\n  a.strip();\n\n  // Denormalize\n  if (mode !== 'div' && shift !== 0)\n    a.ishrn(shift);\n  return { div: q ? q : null, mod: a };\n};\n\nBN.prototype.divmod = function divmod(num, mode) {\n  assert(num.cmpn(0) !== 0);\n\n  if (this.sign && !num.sign) {\n    var res = this.neg().divmod(num, mode);\n    var div;\n    var mod;\n    if (mode !== 'mod')\n      div = res.div.neg();\n    if (mode !== 'div')\n      mod = res.mod.cmpn(0) === 0 ? res.mod : num.sub(res.mod);\n    return {\n      div: div,\n      mod: mod\n    };\n  } else if (!this.sign && num.sign) {\n    var res = this.divmod(num.neg(), mode);\n    var div;\n    if (mode !== 'mod')\n      div = res.div.neg();\n    return { div: div, mod: res.mod };\n  } else if (this.sign && num.sign) {\n    return this.neg().divmod(num.neg(), mode);\n  }\n\n  // Both numbers are positive at this point\n\n  // Strip both numbers to approximate shift value\n  if (num.length > this.length || this.cmp(num) < 0)\n    return { div: new BN(0), mod: this };\n\n  // Very short reduction\n  if (num.length === 1) {\n    if (mode === 'div')\n      return { div: this.divn(num.words[0]), mod: null };\n    else if (mode === 'mod')\n      return { div: null, mod: new BN(this.modn(num.words[0])) };\n    return {\n      div: this.divn(num.words[0]),\n      mod: new BN(this.modn(num.words[0]))\n    };\n  }\n\n  return this._wordDiv(num, mode);\n};\n\n// Find `this` / `num`\nBN.prototype.div = function div(num) {\n  return this.divmod(num, 'div').div;\n};\n\n// Find `this` % `num`\nBN.prototype.mod = function mod(num) {\n  return this.divmod(num, 'mod').mod;\n};\n\n// Find Round(`this` / `num`)\nBN.prototype.divRound = function divRound(num) {\n  var dm = this.divmod(num);\n\n  // Fast case - exact division\n  if (dm.mod.cmpn(0) === 0)\n    return dm.div;\n\n  var mod = dm.div.sign ? dm.mod.isub(num) : dm.mod;\n\n  var half = num.shrn(1);\n  var r2 = num.andln(1);\n  var cmp = mod.cmp(half);\n\n  // Round down\n  if (cmp < 0 || r2 === 1 && cmp === 0)\n    return dm.div;\n\n  // Round up\n  return dm.div.sign ? dm.div.isubn(1) : dm.div.iaddn(1);\n};\n\nBN.prototype.modn = function modn(num) {\n  assert(num <= 0x3ffffff);\n  var p = (1 << 26) % num;\n\n  var acc = 0;\n  for (var i = this.length - 1; i >= 0; i--)\n    acc = (p * acc + this.words[i]) % num;\n\n  return acc;\n};\n\n// In-place division by number\nBN.prototype.idivn = function idivn(num) {\n  assert(num <= 0x3ffffff);\n\n  var carry = 0;\n  for (var i = this.length - 1; i >= 0; i--) {\n    var w = this.words[i] + carry * 0x4000000;\n    this.words[i] = (w / num) | 0;\n    carry = w % num;\n  }\n\n  return this.strip();\n};\n\nBN.prototype.divn = function divn(num) {\n  return this.clone().idivn(num);\n};\n\nBN.prototype.egcd = function egcd(p) {\n  assert(!p.sign);\n  assert(p.cmpn(0) !== 0);\n\n  var x = this;\n  var y = p.clone();\n\n  if (x.sign)\n    x = x.mod(p);\n  else\n    x = x.clone();\n\n  // A * x + B * y = x\n  var A = new BN(1);\n  var B = new BN(0);\n\n  // C * x + D * y = y\n  var C = new BN(0);\n  var D = new BN(1);\n\n  var g = 0;\n\n  while (x.isEven() && y.isEven()) {\n    x.ishrn(1);\n    y.ishrn(1);\n    ++g;\n  }\n\n  var yp = y.clone();\n  var xp = x.clone();\n\n  while (x.cmpn(0) !== 0) {\n    while (x.isEven()) {\n      x.ishrn(1);\n      if (A.isEven() && B.isEven()) {\n        A.ishrn(1);\n        B.ishrn(1);\n      } else {\n        A.iadd(yp).ishrn(1);\n        B.isub(xp).ishrn(1);\n      }\n    }\n\n    while (y.isEven()) {\n      y.ishrn(1);\n      if (C.isEven() && D.isEven()) {\n        C.ishrn(1);\n        D.ishrn(1);\n      } else {\n        C.iadd(yp).ishrn(1);\n        D.isub(xp).ishrn(1);\n      }\n    }\n\n    if (x.cmp(y) >= 0) {\n      x.isub(y);\n      A.isub(C);\n      B.isub(D);\n    } else {\n      y.isub(x);\n      C.isub(A);\n      D.isub(B);\n    }\n  }\n\n  return {\n    a: C,\n    b: D,\n    gcd: y.ishln(g)\n  };\n};\n\n// This is reduced incarnation of the binary EEA\n// above, designated to invert members of the\n// _prime_ fields F(p) at a maximal speed\nBN.prototype._invmp = function _invmp(p) {\n  assert(!p.sign);\n  assert(p.cmpn(0) !== 0);\n\n  var a = this;\n  var b = p.clone();\n\n  if (a.sign)\n    a = a.mod(p);\n  else\n    a = a.clone();\n\n  var x1 = new BN(1);\n  var x2 = new BN(0);\n\n  var delta = b.clone();\n\n  while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n    while (a.isEven()) {\n      a.ishrn(1);\n      if (x1.isEven())\n        x1.ishrn(1);\n      else\n        x1.iadd(delta).ishrn(1);\n    }\n    while (b.isEven()) {\n      b.ishrn(1);\n      if (x2.isEven())\n        x2.ishrn(1);\n      else\n        x2.iadd(delta).ishrn(1);\n    }\n    if (a.cmp(b) >= 0) {\n      a.isub(b);\n      x1.isub(x2);\n    } else {\n      b.isub(a);\n      x2.isub(x1);\n    }\n  }\n  if (a.cmpn(1) === 0)\n    return x1;\n  else\n    return x2;\n};\n\nBN.prototype.gcd = function gcd(num) {\n  if (this.cmpn(0) === 0)\n    return num.clone();\n  if (num.cmpn(0) === 0)\n    return this.clone();\n\n  var a = this.clone();\n  var b = num.clone();\n  a.sign = false;\n  b.sign = false;\n\n  // Remove common factor of two\n  for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n    a.ishrn(1);\n    b.ishrn(1);\n  }\n\n  do {\n    while (a.isEven())\n      a.ishrn(1);\n    while (b.isEven())\n      b.ishrn(1);\n\n    var r = a.cmp(b);\n    if (r < 0) {\n      // Swap `a` and `b` to make `a` always bigger than `b`\n      var t = a;\n      a = b;\n      b = t;\n    } else if (r === 0 || b.cmpn(1) === 0) {\n      break;\n    }\n\n    a.isub(b);\n  } while (true);\n\n  return b.ishln(shift);\n};\n\n// Invert number in the field F(num)\nBN.prototype.invm = function invm(num) {\n  return this.egcd(num).a.mod(num);\n};\n\nBN.prototype.isEven = function isEven() {\n  return (this.words[0] & 1) === 0;\n};\n\nBN.prototype.isOdd = function isOdd() {\n  return (this.words[0] & 1) === 1;\n};\n\n// And first word and num\nBN.prototype.andln = function andln(num) {\n  return this.words[0] & num;\n};\n\n// Increment at the bit position in-line\nBN.prototype.bincn = function bincn(bit) {\n  assert(typeof bit === 'number');\n  var r = bit % 26;\n  var s = (bit - r) / 26;\n  var q = 1 << r;\n\n  // Fast case: bit is much higher than all existing words\n  if (this.length <= s) {\n    for (var i = this.length; i < s + 1; i++)\n      this.words[i] = 0;\n    this.words[s] |= q;\n    this.length = s + 1;\n    return this;\n  }\n\n  // Add bit and propagate, if needed\n  var carry = q;\n  for (var i = s; carry !== 0 && i < this.length; i++) {\n    var w = this.words[i];\n    w += carry;\n    carry = w >>> 26;\n    w &= 0x3ffffff;\n    this.words[i] = w;\n  }\n  if (carry !== 0) {\n    this.words[i] = carry;\n    this.length++;\n  }\n  return this;\n};\n\nBN.prototype.cmpn = function cmpn(num) {\n  var sign = num < 0;\n  if (sign)\n    num = -num;\n\n  if (this.sign && !sign)\n    return -1;\n  else if (!this.sign && sign)\n    return 1;\n\n  num &= 0x3ffffff;\n  this.strip();\n\n  var res;\n  if (this.length > 1) {\n    res = 1;\n  } else {\n    var w = this.words[0];\n    res = w === num ? 0 : w < num ? -1 : 1;\n  }\n  if (this.sign)\n    res = -res;\n  return res;\n};\n\n// Compare two numbers and return:\n// 1 - if `this` > `num`\n// 0 - if `this` == `num`\n// -1 - if `this` < `num`\nBN.prototype.cmp = function cmp(num) {\n  if (this.sign && !num.sign)\n    return -1;\n  else if (!this.sign && num.sign)\n    return 1;\n\n  var res = this.ucmp(num);\n  if (this.sign)\n    return -res;\n  else\n    return res;\n};\n\n// Unsigned comparison\nBN.prototype.ucmp = function ucmp(num) {\n  // At this point both numbers have the same sign\n  if (this.length > num.length)\n    return 1;\n  else if (this.length < num.length)\n    return -1;\n\n  var res = 0;\n  for (var i = this.length - 1; i >= 0; i--) {\n    var a = this.words[i];\n    var b = num.words[i];\n\n    if (a === b)\n      continue;\n    if (a < b)\n      res = -1;\n    else if (a > b)\n      res = 1;\n    break;\n  }\n  return res;\n};\n\n//\n// A reduce context, could be using montgomery or something better, depending\n// on the `m` itself.\n//\nBN.red = function red(num) {\n  return new Red(num);\n};\n\nBN.prototype.toRed = function toRed(ctx) {\n  assert(!this.red, 'Already a number in reduction context');\n  assert(!this.sign, 'red works only with positives');\n  return ctx.convertTo(this)._forceRed(ctx);\n};\n\nBN.prototype.fromRed = function fromRed() {\n  assert(this.red, 'fromRed works only with numbers in reduction context');\n  return this.red.convertFrom(this);\n};\n\nBN.prototype._forceRed = function _forceRed(ctx) {\n  this.red = ctx;\n  return this;\n};\n\nBN.prototype.forceRed = function forceRed(ctx) {\n  assert(!this.red, 'Already a number in reduction context');\n  return this._forceRed(ctx);\n};\n\nBN.prototype.redAdd = function redAdd(num) {\n  assert(this.red, 'redAdd works only with red numbers');\n  return this.red.add(this, num);\n};\n\nBN.prototype.redIAdd = function redIAdd(num) {\n  assert(this.red, 'redIAdd works only with red numbers');\n  return this.red.iadd(this, num);\n};\n\nBN.prototype.redSub = function redSub(num) {\n  assert(this.red, 'redSub works only with red numbers');\n  return this.red.sub(this, num);\n};\n\nBN.prototype.redISub = function redISub(num) {\n  assert(this.red, 'redISub works only with red numbers');\n  return this.red.isub(this, num);\n};\n\nBN.prototype.redShl = function redShl(num) {\n  assert(this.red, 'redShl works only with red numbers');\n  return this.red.shl(this, num);\n};\n\nBN.prototype.redMul = function redMul(num) {\n  assert(this.red, 'redMul works only with red numbers');\n  this.red._verify2(this, num);\n  return this.red.mul(this, num);\n};\n\nBN.prototype.redIMul = function redIMul(num) {\n  assert(this.red, 'redMul works only with red numbers');\n  this.red._verify2(this, num);\n  return this.red.imul(this, num);\n};\n\nBN.prototype.redSqr = function redSqr() {\n  assert(this.red, 'redSqr works only with red numbers');\n  this.red._verify1(this);\n  return this.red.sqr(this);\n};\n\nBN.prototype.redISqr = function redISqr() {\n  assert(this.red, 'redISqr works only with red numbers');\n  this.red._verify1(this);\n  return this.red.isqr(this);\n};\n\n// Square root over p\nBN.prototype.redSqrt = function redSqrt() {\n  assert(this.red, 'redSqrt works only with red numbers');\n  this.red._verify1(this);\n  return this.red.sqrt(this);\n};\n\nBN.prototype.redInvm = function redInvm() {\n  assert(this.red, 'redInvm works only with red numbers');\n  this.red._verify1(this);\n  return this.red.invm(this);\n};\n\n// Return negative clone of `this` % `red modulo`\nBN.prototype.redNeg = function redNeg() {\n  assert(this.red, 'redNeg works only with red numbers');\n  this.red._verify1(this);\n  return this.red.neg(this);\n};\n\nBN.prototype.redPow = function redPow(num) {\n  assert(this.red && !num.red, 'redPow(normalNum)');\n  this.red._verify1(this);\n  return this.red.pow(this, num);\n};\n\n// Prime numbers with efficient reduction\nvar primes = {\n  k256: null,\n  p224: null,\n  p192: null,\n  p25519: null\n};\n\n// Pseudo-Mersenne prime\nfunction MPrime(name, p) {\n  // P = 2 ^ N - K\n  this.name = name;\n  this.p = new BN(p, 16);\n  this.n = this.p.bitLength();\n  this.k = new BN(1).ishln(this.n).isub(this.p);\n\n  this.tmp = this._tmp();\n}\n\nMPrime.prototype._tmp = function _tmp() {\n  var tmp = new BN(null);\n  tmp.words = new Array(Math.ceil(this.n / 13));\n  return tmp;\n};\n\nMPrime.prototype.ireduce = function ireduce(num) {\n  // Assumes that `num` is less than `P^2`\n  // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n  var r = num;\n  var rlen;\n\n  do {\n    this.split(r, this.tmp);\n    r = this.imulK(r);\n    r = r.iadd(this.tmp);\n    rlen = r.bitLength();\n  } while (rlen > this.n);\n\n  var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n  if (cmp === 0) {\n    r.words[0] = 0;\n    r.length = 1;\n  } else if (cmp > 0) {\n    r.isub(this.p);\n  } else {\n    r.strip();\n  }\n\n  return r;\n};\n\nMPrime.prototype.split = function split(input, out) {\n  input.ishrn(this.n, 0, out);\n};\n\nMPrime.prototype.imulK = function imulK(num) {\n  return num.imul(this.k);\n};\n\nfunction K256() {\n  MPrime.call(\n    this,\n    'k256',\n    'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n}\ninherits(K256, MPrime);\n\nK256.prototype.split = function split(input, output) {\n  // 256 = 9 * 26 + 22\n  var mask = 0x3fffff;\n\n  var outLen = Math.min(input.length, 9);\n  for (var i = 0; i < outLen; i++)\n    output.words[i] = input.words[i];\n  output.length = outLen;\n\n  if (input.length <= 9) {\n    input.words[0] = 0;\n    input.length = 1;\n    return;\n  }\n\n  // Shift by 9 limbs\n  var prev = input.words[9];\n  output.words[output.length++] = prev & mask;\n\n  for (var i = 10; i < input.length; i++) {\n    var next = input.words[i];\n    input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n    prev = next;\n  }\n  input.words[i - 10] = prev >>> 22;\n  input.length -= 9;\n};\n\nK256.prototype.imulK = function imulK(num) {\n  // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n  num.words[num.length] = 0;\n  num.words[num.length + 1] = 0;\n  num.length += 2;\n\n  // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n  var hi;\n  var lo = 0;\n  for (var i = 0; i < num.length; i++) {\n    var w = num.words[i];\n    hi = w * 0x40;\n    lo += w * 0x3d1;\n    hi += (lo / 0x4000000) | 0;\n    lo &= 0x3ffffff;\n\n    num.words[i] = lo;\n\n    lo = hi;\n  }\n\n  // Fast length reduction\n  if (num.words[num.length - 1] === 0) {\n    num.length--;\n    if (num.words[num.length - 1] === 0)\n      num.length--;\n  }\n  return num;\n};\n\nfunction P224() {\n  MPrime.call(\n    this,\n    'p224',\n    'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n}\ninherits(P224, MPrime);\n\nfunction P192() {\n  MPrime.call(\n    this,\n    'p192',\n    'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n}\ninherits(P192, MPrime);\n\nfunction P25519() {\n  // 2 ^ 255 - 19\n  MPrime.call(\n    this,\n    '25519',\n    '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n}\ninherits(P25519, MPrime);\n\nP25519.prototype.imulK = function imulK(num) {\n  // K = 0x13\n  var carry = 0;\n  for (var i = 0; i < num.length; i++) {\n    var hi = num.words[i] * 0x13 + carry;\n    var lo = hi & 0x3ffffff;\n    hi >>>= 26;\n\n    num.words[i] = lo;\n    carry = hi;\n  }\n  if (carry !== 0)\n    num.words[num.length++] = carry;\n  return num;\n};\n\n// Exported mostly for testing purposes, use plain name instead\nBN._prime = function prime(name) {\n  // Cached version of prime\n  if (primes[name])\n    return primes[name];\n\n  var prime;\n  if (name === 'k256')\n    prime = new K256();\n  else if (name === 'p224')\n    prime = new P224();\n  else if (name === 'p192')\n    prime = new P192();\n  else if (name === 'p25519')\n    prime = new P25519();\n  else\n    throw new Error('Unknown prime ' + name);\n  primes[name] = prime;\n\n  return prime;\n};\n\n//\n// Base reduction engine\n//\nfunction Red(m) {\n  if (typeof m === 'string') {\n    var prime = BN._prime(m);\n    this.m = prime.p;\n    this.prime = prime;\n  } else {\n    this.m = m;\n    this.prime = null;\n  }\n}\n\nRed.prototype._verify1 = function _verify1(a) {\n  assert(!a.sign, 'red works only with positives');\n  assert(a.red, 'red works only with red numbers');\n};\n\nRed.prototype._verify2 = function _verify2(a, b) {\n  assert(!a.sign && !b.sign, 'red works only with positives');\n  assert(a.red && a.red === b.red,\n         'red works only with red numbers');\n};\n\nRed.prototype.imod = function imod(a) {\n  if (this.prime)\n    return this.prime.ireduce(a)._forceRed(this);\n  return a.mod(this.m)._forceRed(this);\n};\n\nRed.prototype.neg = function neg(a) {\n  var r = a.clone();\n  r.sign = !r.sign;\n  return r.iadd(this.m)._forceRed(this);\n};\n\nRed.prototype.add = function add(a, b) {\n  this._verify2(a, b);\n\n  var res = a.add(b);\n  if (res.cmp(this.m) >= 0)\n    res.isub(this.m);\n  return res._forceRed(this);\n};\n\nRed.prototype.iadd = function iadd(a, b) {\n  this._verify2(a, b);\n\n  var res = a.iadd(b);\n  if (res.cmp(this.m) >= 0)\n    res.isub(this.m);\n  return res;\n};\n\nRed.prototype.sub = function sub(a, b) {\n  this._verify2(a, b);\n\n  var res = a.sub(b);\n  if (res.cmpn(0) < 0)\n    res.iadd(this.m);\n  return res._forceRed(this);\n};\n\nRed.prototype.isub = function isub(a, b) {\n  this._verify2(a, b);\n\n  var res = a.isub(b);\n  if (res.cmpn(0) < 0)\n    res.iadd(this.m);\n  return res;\n};\n\nRed.prototype.shl = function shl(a, num) {\n  this._verify1(a);\n  return this.imod(a.shln(num));\n};\n\nRed.prototype.imul = function imul(a, b) {\n  this._verify2(a, b);\n  return this.imod(a.imul(b));\n};\n\nRed.prototype.mul = function mul(a, b) {\n  this._verify2(a, b);\n  return this.imod(a.mul(b));\n};\n\nRed.prototype.isqr = function isqr(a) {\n  return this.imul(a, a);\n};\n\nRed.prototype.sqr = function sqr(a) {\n  return this.mul(a, a);\n};\n\nRed.prototype.sqrt = function sqrt(a) {\n  if (a.cmpn(0) === 0)\n    return a.clone();\n\n  var mod3 = this.m.andln(3);\n  assert(mod3 % 2 === 1);\n\n  // Fast case\n  if (mod3 === 3) {\n    var pow = this.m.add(new BN(1)).ishrn(2);\n    var r = this.pow(a, pow);\n    return r;\n  }\n\n  // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n  //\n  // Find Q and S, that Q * 2 ^ S = (P - 1)\n  var q = this.m.subn(1);\n  var s = 0;\n  while (q.cmpn(0) !== 0 && q.andln(1) === 0) {\n    s++;\n    q.ishrn(1);\n  }\n  assert(q.cmpn(0) !== 0);\n\n  var one = new BN(1).toRed(this);\n  var nOne = one.redNeg();\n\n  // Find quadratic non-residue\n  // NOTE: Max is such because of generalized Riemann hypothesis.\n  var lpow = this.m.subn(1).ishrn(1);\n  var z = this.m.bitLength();\n  z = new BN(2 * z * z).toRed(this);\n  while (this.pow(z, lpow).cmp(nOne) !== 0)\n    z.redIAdd(nOne);\n\n  var c = this.pow(z, q);\n  var r = this.pow(a, q.addn(1).ishrn(1));\n  var t = this.pow(a, q);\n  var m = s;\n  while (t.cmp(one) !== 0) {\n    var tmp = t;\n    for (var i = 0; tmp.cmp(one) !== 0; i++)\n      tmp = tmp.redSqr();\n    assert(i < m);\n    var b = this.pow(c, new BN(1).ishln(m - i - 1));\n\n    r = r.redMul(b);\n    c = b.redSqr();\n    t = t.redMul(c);\n    m = i;\n  }\n\n  return r;\n};\n\nRed.prototype.invm = function invm(a) {\n  var inv = a._invmp(this.m);\n  if (inv.sign) {\n    inv.sign = false;\n    return this.imod(inv).redNeg();\n  } else {\n    return this.imod(inv);\n  }\n};\n\nRed.prototype.pow = function pow(a, num) {\n  var w = [];\n\n  if (num.cmpn(0) === 0)\n    return new BN(1);\n\n  var q = num.clone();\n\n  while (q.cmpn(0) !== 0) {\n    w.push(q.andln(1));\n    q.ishrn(1);\n  }\n\n  // Skip leading zeroes\n  var res = a;\n  for (var i = 0; i < w.length; i++, res = this.sqr(res))\n    if (w[i] !== 0)\n      break;\n\n  if (++i < w.length) {\n    for (var q = this.sqr(res); i < w.length; i++, q = this.sqr(q)) {\n      if (w[i] === 0)\n        continue;\n      res = this.mul(res, q);\n    }\n  }\n\n  return res;\n};\n\nRed.prototype.convertTo = function convertTo(num) {\n  return num.clone();\n};\n\nRed.prototype.convertFrom = function convertFrom(num) {\n  var res = num.clone();\n  res.red = null;\n  return res;\n};\n\n//\n// Montgomery method engine\n//\n\nBN.mont = function mont(num) {\n  return new Mont(num);\n};\n\nfunction Mont(m) {\n  Red.call(this, m);\n\n  this.shift = this.m.bitLength();\n  if (this.shift % 26 !== 0)\n    this.shift += 26 - (this.shift % 26);\n  this.r = new BN(1).ishln(this.shift);\n  this.r2 = this.imod(this.r.sqr());\n  this.rinv = this.r._invmp(this.m);\n\n  this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n  this.minv.sign = true;\n  this.minv = this.minv.mod(this.r);\n}\ninherits(Mont, Red);\n\nMont.prototype.convertTo = function convertTo(num) {\n  return this.imod(num.shln(this.shift));\n};\n\nMont.prototype.convertFrom = function convertFrom(num) {\n  var r = this.imod(num.mul(this.rinv));\n  r.red = null;\n  return r;\n};\n\nMont.prototype.imul = function imul(a, b) {\n  if (a.cmpn(0) === 0 || b.cmpn(0) === 0) {\n    a.words[0] = 0;\n    a.length = 1;\n    return a;\n  }\n\n  var t = a.imul(b);\n  var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n  var u = t.isub(c).ishrn(this.shift);\n  var res = u;\n  if (u.cmp(this.m) >= 0)\n    res = u.isub(this.m);\n  else if (u.cmpn(0) < 0)\n    res = u.iadd(this.m);\n\n  return res._forceRed(this);\n};\n\nMont.prototype.mul = function mul(a, b) {\n  if (a.cmpn(0) === 0 || b.cmpn(0) === 0)\n    return new BN(0)._forceRed(this);\n\n  var t = a.mul(b);\n  var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n  var u = t.isub(c).ishrn(this.shift);\n  var res = u;\n  if (u.cmp(this.m) >= 0)\n    res = u.isub(this.m);\n  else if (u.cmpn(0) < 0)\n    res = u.iadd(this.m);\n\n  return res._forceRed(this);\n};\n\nMont.prototype.invm = function invm(a) {\n  // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n  var res = this.imod(a._invmp(this.m).mul(this.r2));\n  return res._forceRed(this);\n};\n\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/bn.js/lib/bn.js\n// module id = 74\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/bn.js/lib/bn.js")},function(module,exports){eval("if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/inherits/inherits_browser.js\n// module id = 75\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/inherits/inherits_browser.js")},function(module,exports,__webpack_require__){eval("var basex = __webpack_require__(339)\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\n\nmodule.exports = basex(ALPHABET)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bs58/index.js\n// module id = 76\n// module chunks = 0\n\n//# sourceURL=../node_modules/bs58/index.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(46).Transform\nvar StringDecoder = __webpack_require__(156).StringDecoder\nvar inherits = __webpack_require__(3)\n\nfunction CipherBase (hashMode) {\n  Transform.call(this)\n  this.hashMode = typeof hashMode === 'string'\n  if (this.hashMode) {\n    this[hashMode] = this._finalOrDigest\n  } else {\n    this.final = this._finalOrDigest\n  }\n  if (this._final) {\n    this.__final = this._final\n    this._final = null\n  }\n  this._decoder = null\n  this._encoding = null\n}\ninherits(CipherBase, Transform)\n\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\n  if (typeof data === 'string') {\n    data = Buffer.from(data, inputEnc)\n  }\n\n  var outData = this._update(data)\n  if (this.hashMode) return this\n\n  if (outputEnc) {\n    outData = this._toString(outData, outputEnc)\n  }\n\n  return outData\n}\n\nCipherBase.prototype.setAutoPadding = function () {}\nCipherBase.prototype.getAuthTag = function () {\n  throw new Error('trying to get auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAuthTag = function () {\n  throw new Error('trying to set auth tag in unsupported state')\n}\n\nCipherBase.prototype.setAAD = function () {\n  throw new Error('trying to set aad in unsupported state')\n}\n\nCipherBase.prototype._transform = function (data, _, next) {\n  var err\n  try {\n    if (this.hashMode) {\n      this._update(data)\n    } else {\n      this.push(this._update(data))\n    }\n  } catch (e) {\n    err = e\n  } finally {\n    next(err)\n  }\n}\nCipherBase.prototype._flush = function (done) {\n  var err\n  try {\n    this.push(this.__final())\n  } catch (e) {\n    err = e\n  }\n\n  done(err)\n}\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\n  var outData = this.__final() || Buffer.alloc(0)\n  if (outputEnc) {\n    outData = this._toString(outData, outputEnc, true)\n  }\n  return outData\n}\n\nCipherBase.prototype._toString = function (value, enc, fin) {\n  if (!this._decoder) {\n    this._decoder = new StringDecoder(enc)\n    this._encoding = enc\n  }\n\n  if (this._encoding !== enc) throw new Error('can\\'t switch encodings')\n\n  var out = this._decoder.write(value)\n  if (fin) {\n    out += this._decoder.end()\n  }\n\n  return out\n}\n\nmodule.exports = CipherBase\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/cipher-base/index.js\n// module id = 77\n// module chunks = 0\n\n//# sourceURL=../node_modules/cipher-base/index.js")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(116)(function () {\n  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_descriptors.js\n// module id = 78\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_descriptors.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst hmac = __webpack_require__(442)\nconst aes = __webpack_require__(984)\nconst keys = __webpack_require__(990)\n\nexports = module.exports\n\nexports.aes = aes\nexports.hmac = hmac\nexports.keys = keys\nexports.randomBytes = __webpack_require__(444)\nexports.pbkdf2 = __webpack_require__(994)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/index.js\n// module id = 79\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\nfunction oldBrowser () {\n  throw new Error('Secure random number generation is not supported by this browser.\\nUse Chrome, Firefox or Internet Explorer 11')\n}\n\nvar Buffer = __webpack_require__(1).Buffer\nvar crypto = global.crypto || global.msCrypto\n\nif (crypto && crypto.getRandomValues) {\n  module.exports = randomBytes\n} else {\n  module.exports = oldBrowser\n}\n\nfunction randomBytes (size, cb) {\n  // phantomjs needs to throw\n  if (size > 65536) throw new Error('requested too many random bytes')\n  // in case browserify  isn't using the Uint8Array version\n  var rawBytes = new global.Uint8Array(size)\n\n  // This will not work in older browsers.\n  // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\n  if (size > 0) {  // getRandomValues fails on IE if size == 0\n    crypto.getRandomValues(rawBytes)\n  }\n\n  // XXX: phantomjs doesn't like a buffer being passed here\n  var bytes = Buffer.from(rawBytes.buffer)\n\n  if (typeof cb === 'function') {\n    return process.nextTick(function () {\n      cb(null, bytes)\n    })\n  }\n\n  return bytes\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/randombytes/browser.js\n// module id = 80\n// module chunks = 0\n\n//# sourceURL=../node_modules/randombytes/browser.js")},function(module,exports,__webpack_require__){eval("exports = module.exports = __webpack_require__(526);\nexports.Stream = exports;\nexports.Readable = exports;\nexports.Writable = __webpack_require__(305);\nexports.Duplex = __webpack_require__(103);\nexports.Transform = __webpack_require__(527);\nexports.PassThrough = __webpack_require__(1212);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/readable-browser.js\n// module id = 81\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/readable-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar BufferUtil = __webpack_require__(18);\nvar BN = __webpack_require__(30);\n\nvar BufferReader = function BufferReader(buf) {\n  if (!(this instanceof BufferReader)) {\n    return new BufferReader(buf);\n  }\n  if (_.isUndefined(buf)) {\n    return;\n  }\n  if (Buffer.isBuffer(buf)) {\n    this.set({\n      buf: buf\n    });\n  } else if (_.isString(buf)) {\n    this.set({\n      buf: new Buffer(buf, 'hex'),\n    });\n  } else if (_.isObject(buf)) {\n    var obj = buf;\n    this.set(obj);\n  } else {\n    throw new TypeError('Unrecognized argument for BufferReader');\n  }\n};\n\nBufferReader.prototype.set = function(obj) {\n  this.buf = obj.buf || this.buf || undefined;\n  this.pos = obj.pos || this.pos || 0;\n  return this;\n};\n\nBufferReader.prototype.eof = function() {\n  return this.pos >= this.buf.length;\n};\n\nBufferReader.prototype.finished = BufferReader.prototype.eof;\n\nBufferReader.prototype.read = function(len) {\n  $.checkArgument(!_.isUndefined(len), 'Must specify a length');\n  var buf = this.buf.slice(this.pos, this.pos + len);\n  this.pos = this.pos + len;\n  return buf;\n};\n\nBufferReader.prototype.readAll = function() {\n  var buf = this.buf.slice(this.pos, this.buf.length);\n  this.pos = this.buf.length;\n  return buf;\n};\n\nBufferReader.prototype.readUInt8 = function() {\n  var val = this.buf.readUInt8(this.pos);\n  this.pos = this.pos + 1;\n  return val;\n};\n\nBufferReader.prototype.readUInt16BE = function() {\n  var val = this.buf.readUInt16BE(this.pos);\n  this.pos = this.pos + 2;\n  return val;\n};\n\nBufferReader.prototype.readUInt16LE = function() {\n  var val = this.buf.readUInt16LE(this.pos);\n  this.pos = this.pos + 2;\n  return val;\n};\n\nBufferReader.prototype.readUInt32BE = function() {\n  var val = this.buf.readUInt32BE(this.pos);\n  this.pos = this.pos + 4;\n  return val;\n};\n\nBufferReader.prototype.readUInt32LE = function() {\n  var val = this.buf.readUInt32LE(this.pos);\n  this.pos = this.pos + 4;\n  return val;\n};\n\nBufferReader.prototype.readUInt64BEBN = function() {\n  var buf = this.buf.slice(this.pos, this.pos + 8);\n  var bn = BN.fromBuffer(buf);\n  this.pos = this.pos + 8;\n  return bn;\n};\n\nBufferReader.prototype.readUInt64LEBN = function() {\n  var second = this.buf.readUInt32LE(this.pos);\n  var first = this.buf.readUInt32LE(this.pos + 4);\n  var combined = (first * 0x100000000) + second;\n  // Instantiating an instance of BN with a number is faster than with an\n  // array or string. However, the maximum safe number for a double precision\n  // floating point is 2 ^ 52 - 1 (0x1fffffffffffff), thus we can safely use\n  // non-floating point numbers less than this amount (52 bits). And in the case\n  // that the number is larger, we can instatiate an instance of BN by passing\n  // an array from the buffer (slower) and specifying the endianness.\n  var bn;\n  if (combined <= 0x1fffffffffffff) {\n    bn = new BN(combined);\n  } else {\n    var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8);\n    bn = new BN(data, 10, 'le');\n  }\n  this.pos = this.pos + 8;\n  return bn;\n};\n\nBufferReader.prototype.readVarintNum = function() {\n  var first = this.readUInt8();\n  switch (first) {\n    case 0xFD:\n      return this.readUInt16LE();\n    case 0xFE:\n      return this.readUInt32LE();\n    case 0xFF:\n      var bn = this.readUInt64LEBN();\n      var n = bn.toNumber();\n      if (n <= Math.pow(2, 53)) {\n        return n;\n      } else {\n        throw new Error('number too large to retain precision - use readVarintBN');\n      }\n      break;\n    default:\n      return first;\n  }\n};\n\n/**\n * reads a length prepended buffer\n */\nBufferReader.prototype.readVarLengthBuffer = function() {\n  var len = this.readVarintNum();\n  var buf = this.read(len);\n  $.checkState(buf.length === len, 'Invalid length while reading varlength buffer. ' +\n    'Expected to read: ' + len + ' and read ' + buf.length);\n  return buf;\n};\n\nBufferReader.prototype.readVarintBuf = function() {\n  var first = this.buf.readUInt8(this.pos);\n  switch (first) {\n    case 0xFD:\n      return this.read(1 + 2);\n    case 0xFE:\n      return this.read(1 + 4);\n    case 0xFF:\n      return this.read(1 + 8);\n    default:\n      return this.read(1);\n  }\n};\n\nBufferReader.prototype.readVarintBN = function() {\n  var first = this.readUInt8();\n  switch (first) {\n    case 0xFD:\n      return new BN(this.readUInt16LE());\n    case 0xFE:\n      return new BN(this.readUInt32LE());\n    case 0xFF:\n      return this.readUInt64LEBN();\n    default:\n      return new BN(first);\n  }\n};\n\nBufferReader.prototype.reverse = function() {\n  var buf = new Buffer(this.buf.length);\n  for (var i = 0; i < buf.length; i++) {\n    buf[i] = this.buf[this.buf.length - 1 - i];\n  }\n  this.buf = buf;\n  return this;\n};\n\nBufferReader.prototype.readReverse = function(len) {\n  if (_.isUndefined(len)) {\n    len = this.buf.length;\n  }\n  var buf = this.buf.slice(this.pos, this.pos + len);\n  this.pos = this.pos + len;\n  return BufferUtil.reverse(buf);\n};\n\nmodule.exports = BufferReader;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/encoding/bufferreader.js\n// module id = 82\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/encoding/bufferreader.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar BN = __webpack_require__(30);\nvar buffer = __webpack_require__(0);\nvar bufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\nvar BufferWriter = __webpack_require__(50);\nvar Script = __webpack_require__(57);\nvar $ = __webpack_require__(13);\nvar errors = __webpack_require__(56);\n\nvar MAX_SAFE_INTEGER = 0x1fffffffffffff;\n\nfunction Output(args) {\n  if (!(this instanceof Output)) {\n    return new Output(args);\n  }\n  if (_.isObject(args)) {\n    this.satoshis = args.satoshis;\n    if (bufferUtil.isBuffer(args.script)) {\n      this._scriptBuffer = args.script;\n    } else {\n      var script;\n      if (_.isString(args.script) && JSUtil.isHexa(args.script)) {\n        script = new buffer.Buffer(args.script, 'hex');\n      } else {\n        script = args.script;\n      }\n      this.setScript(script);\n    }\n  } else {\n    throw new TypeError('Unrecognized argument for Output');\n  }\n}\n\nObject.defineProperty(Output.prototype, 'script', {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    if (this._script) {\n      return this._script;\n    } else {\n      this.setScriptFromBuffer(this._scriptBuffer);\n      return this._script;\n    }\n\n  }\n});\n\nObject.defineProperty(Output.prototype, 'satoshis', {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    return this._satoshis;\n  },\n  set: function(num) {\n    if (num instanceof BN) {\n      this._satoshisBN = num;\n      this._satoshis = num.toNumber();\n    } else if (_.isString(num)) {\n      this._satoshis = parseInt(num);\n      this._satoshisBN = BN.fromNumber(this._satoshis);\n    } else {\n      $.checkArgument(\n        JSUtil.isNaturalNumber(num),\n        'Output satoshis is not a natural number'\n      );\n      this._satoshisBN = BN.fromNumber(num);\n      this._satoshis = num;\n    }\n    $.checkState(\n      JSUtil.isNaturalNumber(this._satoshis),\n      'Output satoshis is not a natural number'\n    );\n  }\n});\n\nOutput.prototype.invalidSatoshis = function() {\n  if (this._satoshis > MAX_SAFE_INTEGER) {\n    return 'transaction txout satoshis greater than max safe integer';\n  }\n  if (this._satoshis !== this._satoshisBN.toNumber()) {\n    return 'transaction txout satoshis has corrupted value';\n  }\n  if (this._satoshis < 0) {\n    return 'transaction txout negative';\n  }\n  return false;\n};\n\nOutput.prototype.toObject = Output.prototype.toJSON = function toObject() {\n  var obj = {\n    satoshis: this.satoshis\n  };\n  obj.script = this._scriptBuffer.toString('hex');\n  return obj;\n};\n\nOutput.fromObject = function(data) {\n  return new Output(data);\n};\n\nOutput.prototype.setScriptFromBuffer = function(buffer) {\n  this._scriptBuffer = buffer;\n  try {\n    this._script = Script.fromBuffer(this._scriptBuffer);\n    this._script._isOutput = true;\n  } catch(e) {\n    if (e instanceof errors.Script.InvalidBuffer) {\n      this._script = null;\n    } else {\n      throw e;\n    }\n  }\n};\n\nOutput.prototype.setScript = function(script) {\n  if (script instanceof Script) {\n    this._scriptBuffer = script.toBuffer();\n    this._script = script;\n    this._script._isOutput = true;\n  } else if (_.isString(script)) {\n    this._script = Script.fromString(script);\n    this._scriptBuffer = this._script.toBuffer();\n    this._script._isOutput = true;\n  } else if (bufferUtil.isBuffer(script)) {\n    this.setScriptFromBuffer(script);\n  } else {\n    throw new TypeError('Invalid argument type: script');\n  }\n  return this;\n};\n\nOutput.prototype.inspect = function() {\n  var scriptStr;\n  if (this.script) {\n    scriptStr = this.script.inspect();\n  } else {\n    scriptStr = this._scriptBuffer.toString('hex');\n  }\n  return '<Output (' + this.satoshis + ' sats) ' + scriptStr + '>';\n};\n\nOutput.fromBufferReader = function(br) {\n  var obj = {};\n  obj.satoshis = br.readUInt64LEBN();\n  var size = br.readVarintNum();\n  if (size !== 0) {\n    obj.script = br.read(size);\n  } else {\n    obj.script = new buffer.Buffer([]);\n  }\n  return new Output(obj);\n};\n\nOutput.prototype.toBufferWriter = function(writer) {\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  writer.writeUInt64LEBN(this._satoshisBN);\n  var script = this._scriptBuffer;\n  writer.writeVarintNum(script.length);\n  writer.write(script);\n  return writer;\n};\n\nmodule.exports = Output;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/output.js\n// module id = 83\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/output.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar buffer = __webpack_require__(0);\n\nvar Signature = __webpack_require__(55);\nvar Script = __webpack_require__(57);\nvar Output = __webpack_require__(83);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar BN = __webpack_require__(30);\nvar Hash = __webpack_require__(36);\nvar ECDSA = __webpack_require__(566);\nvar $ = __webpack_require__(13);\nvar _ = __webpack_require__(10);\n\nvar SIGHASH_SINGLE_BUG = '0000000000000000000000000000000000000000000000000000000000000001';\nvar BITS_64_ON = 'ffffffffffffffff';\n\n/**\n * Returns a buffer of length 32 bytes with the hash that needs to be signed\n * for OP_CHECKSIG.\n *\n * @name Signing.sighash\n * @param {Transaction} transaction the transaction to sign\n * @param {number} sighashType the type of the hash\n * @param {number} inputNumber the input index for the signature\n * @param {Script} subscript the script that will be signed\n */\nvar sighash = function sighash(transaction, sighashType, inputNumber, subscript) {\n  var Transaction = __webpack_require__(319);\n  var Input = __webpack_require__(318);\n\n  var i;\n  // Copy transaction\n  var txcopy = Transaction.shallowCopy(transaction);\n\n  // Copy script\n  subscript = new Script(subscript);\n  subscript.removeCodeseparators();\n\n  for (i = 0; i < txcopy.inputs.length; i++) {\n    // Blank signatures for other inputs\n    txcopy.inputs[i] = new Input(txcopy.inputs[i]).setScript(Script.empty());\n  }\n\n  txcopy.inputs[inputNumber] = new Input(txcopy.inputs[inputNumber]).setScript(subscript);\n\n  if ((sighashType & 31) === Signature.SIGHASH_NONE ||\n    (sighashType & 31) === Signature.SIGHASH_SINGLE) {\n\n    // clear all sequenceNumbers\n    for (i = 0; i < txcopy.inputs.length; i++) {\n      if (i !== inputNumber) {\n        txcopy.inputs[i].sequenceNumber = 0;\n      }\n    }\n  }\n\n  if ((sighashType & 31) === Signature.SIGHASH_NONE) {\n    txcopy.outputs = [];\n\n  } else if ((sighashType & 31) === Signature.SIGHASH_SINGLE) {\n    // The SIGHASH_SINGLE bug.\n    // https://bitcointalk.org/index.php?topic=260595.0\n    if (inputNumber >= txcopy.outputs.length) {\n      return new Buffer(SIGHASH_SINGLE_BUG, 'hex');\n    }\n\n    txcopy.outputs.length = inputNumber + 1;\n\n    for (i = 0; i < inputNumber; i++) {\n      txcopy.outputs[i] = new Output({\n        satoshis: BN.fromBuffer(new buffer.Buffer(BITS_64_ON, 'hex')),\n        script: Script.empty()\n      });\n    }\n  }\n\n  if (sighashType & Signature.SIGHASH_ANYONECANPAY) {\n    txcopy.inputs = [txcopy.inputs[inputNumber]];\n  }\n\n  var buf = new BufferWriter()\n    .write(txcopy.toBuffer())\n    .writeInt32LE(sighashType)\n    .toBuffer();\n  var ret = Hash.sha256sha256(buf);\n  ret = new BufferReader(ret).readReverse();\n  return ret;\n};\n\n/**\n * Create a signature\n *\n * @name Signing.sign\n * @param {Transaction} transaction\n * @param {PrivateKey} privateKey\n * @param {number} sighash\n * @param {number} inputIndex\n * @param {Script} subscript\n * @return {Signature}\n */\nfunction sign(transaction, privateKey, sighashType, inputIndex, subscript) {\n  var hashbuf = sighash(transaction, sighashType, inputIndex, subscript);\n  var sig = ECDSA.sign(hashbuf, privateKey, 'little').set({\n    nhashtype: sighashType\n  });\n  return sig;\n}\n\n/**\n * Verify a signature\n *\n * @name Signing.verify\n * @param {Transaction} transaction\n * @param {Signature} signature\n * @param {PublicKey} publicKey\n * @param {number} inputIndex\n * @param {Script} subscript\n * @return {boolean}\n */\nfunction verify(transaction, signature, publicKey, inputIndex, subscript) {\n  $.checkArgument(!_.isUndefined(transaction));\n  $.checkArgument(!_.isUndefined(signature) && !_.isUndefined(signature.nhashtype));\n  var hashbuf = sighash(transaction, signature.nhashtype, inputIndex, subscript);\n  return ECDSA.verify(hashbuf, signature, publicKey, 'little');\n}\n\n/**\n * @namespace Signing\n */\nmodule.exports = {\n  sighash: sighash,\n  sign: sign,\n  verify: verify\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/sighash.js\n// module id = 84\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/sighash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = parallelLimit;\n\nvar _eachOf = __webpack_require__(218);\n\nvar _eachOf2 = _interopRequireDefault(_eachOf);\n\nvar _parallel = __webpack_require__(331);\n\nvar _parallel2 = _interopRequireDefault(_parallel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code.  If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series.  Any synchronous setup\n * sections for each task will happen one after the other.  JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n *\n * @example\n * async.parallel([\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // the results array will equal ['one','two'] even though\n *     // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equals to: {one: 1, two: 2}\n * });\n */\nfunction parallelLimit(tasks, callback) {\n  (0, _parallel2.default)(_eachOf2.default, tasks, callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/parallel.js\n// module id = 85\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/parallel.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n  if (!(instance instanceof Constructor)) {\n    throw new TypeError("Cannot call a class as a function");\n  }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/classCallCheck.js\n// module id = 86\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/classCallCheck.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(614);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n  function defineProperties(target, props) {\n    for (var i = 0; i < props.length; i++) {\n      var descriptor = props[i];\n      descriptor.enumerable = descriptor.enumerable || false;\n      descriptor.configurable = true;\n      if ("value" in descriptor) descriptor.writable = true;\n      (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n    }\n  }\n\n  return function (Constructor, protoProps, staticProps) {\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\n    if (staticProps) defineProperties(Constructor, staticProps);\n    return Constructor;\n  };\n}();\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/createClass.js\n// module id = 87\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/createClass.js')},function(module,exports,__webpack_require__){eval("var BigInteger = __webpack_require__(340)\n\n//addons\n__webpack_require__(623)\n\nmodule.exports = BigInteger\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bigi/lib/index.js\n// module id = 88\n// module chunks = 0\n\n//# sourceURL=../node_modules/bigi/lib/index.js")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n  return hasOwnProperty.call(it, key);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_has.js\n// module id = 89\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_has.js")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(70);\nvar createDesc = __webpack_require__(138);\nmodule.exports = __webpack_require__(78) ? function (object, key, value) {\n  return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n  object[key] = value;\n  return object;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_hide.js\n// module id = 90\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_hide.js")},function(module,exports){eval("module.exports = function (it) {\n  return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-object.js\n// module id = 91\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_is-object.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(34).errors;\nvar formatters = __webpack_require__(34).formatters;\nvar utils = __webpack_require__(48);\nvar promiEvent = __webpack_require__(383);\nvar Subscriptions = __webpack_require__(179).subscriptions;\n\nvar TIMEOUTBLOCK = 50;\nvar POLLINGTIMEOUT = 15 * TIMEOUTBLOCK; // ~average block time (seconds) * TIMEOUTBLOCK\nvar CONFIRMATIONBLOCKS = 24;\n\nvar Method = function Method(options) {\n\n    if(!options.call || !options.name) {\n        throw new Error('When creating a method you need to provide at least the \"name\" and \"call\" property.');\n    }\n\n    this.name = options.name;\n    this.call = options.call;\n    this.params = options.params || 0;\n    this.inputFormatter = options.inputFormatter;\n    this.outputFormatter = options.outputFormatter;\n    this.transformPayload = options.transformPayload;\n    this.extraFormatters = options.extraFormatters;\n\n    this.requestManager = options.requestManager;\n\n    // reference to eth.accounts\n    this.accounts = options.accounts;\n\n    this.defaultBlock = options.defaultBlock || 'latest';\n    this.defaultAccount = options.defaultAccount || null;\n};\n\nMethod.prototype.setRequestManager = function (requestManager, accounts) {\n    this.requestManager = requestManager;\n\n    // reference to eth.accounts\n    if (accounts) {\n        this.accounts = accounts;\n    }\n\n};\n\nMethod.prototype.createFunction = function (requestManager, accounts) {\n    var func = this.buildCall();\n    func.call = this.call;\n\n    this.setRequestManager(requestManager || this.requestManager, accounts || this.accounts);\n\n    return func;\n};\n\nMethod.prototype.attachToObject = function (obj) {\n    var func = this.buildCall();\n    func.call = this.call;\n    var name = this.name.split('.');\n    if (name.length > 1) {\n        obj[name[0]] = obj[name[0]] || {};\n        obj[name[0]][name[1]] = func;\n    } else {\n        obj[name[0]] = func;\n    }\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n    return _.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n    if (_.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n *\n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n    if (args.length !== this.params) {\n        throw errors.InvalidNumberOfParams(args.length, this.params, this.name);\n    }\n};\n\n/**\n * Should be called to format input args of method\n *\n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n    var _this = this;\n\n    if (!this.inputFormatter) {\n        return args;\n    }\n\n    return this.inputFormatter.map(function (formatter, index) {\n        // bind this for defaultBlock, and defaultAccount\n        return formatter ? formatter.call(_this, args[index]) : args[index];\n    });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n    var _this = this;\n\n    if(_.isArray(result)) {\n        return result.map(function(res){\n            return _this.outputFormatter && res ? _this.outputFormatter(res) : res;\n        });\n    } else {\n        return this.outputFormatter && result ? this.outputFormatter(result) : result;\n    }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n    var call = this.getCall(args);\n    var callback = this.extractCallback(args);\n    var params = this.formatInput(args);\n    this.validateArgs(params);\n\n    var payload = {\n        method: call,\n        params: params,\n        callback: callback\n    };\n\n    if (this.transformPayload) {\n        payload = this.transformPayload(payload);\n    }\n\n    return payload;\n};\n\n\nMethod.prototype._confirmTransaction = function (defer, result, payload) {\n    var method = this,\n        promiseResolved = false,\n        canUnsubscribe = true,\n        timeoutCount = 0,\n        confirmationCount = 0,\n        intervalId = null,\n        gasProvided = (_.isObject(payload.params[0]) && payload.params[0].gas) ? payload.params[0].gas : null,\n        isContractDeployment = _.isObject(payload.params[0]) &&\n            payload.params[0].data &&\n            payload.params[0].from &&\n            !payload.params[0].to;\n\n\n    // add custom send Methods\n    var _ethereumCalls = [\n        new Method({\n            name: 'getTransactionReceipt',\n            call: 'eth_getTransactionReceipt',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatters.outputTransactionReceiptFormatter\n        }),\n        new Method({\n            name: 'getCode',\n            call: 'eth_getCode',\n            params: 2,\n            inputFormatter: [formatters.inputAddressFormatter, formatters.inputDefaultBlockNumberFormatter]\n        }),\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'eth',\n            subscriptions: {\n                'newBlockHeaders': {\n                    subscriptionName: 'newHeads', // replace subscription with this name\n                    params: 0,\n                    outputFormatter: formatters.outputBlockFormatter\n                }\n            }\n        })\n    ];\n    // attach methods to this._ethereumCall\n    var _ethereumCall = {};\n    _.each(_ethereumCalls, function (mthd) {\n        mthd.attachToObject(_ethereumCall);\n        mthd.requestManager = method.requestManager; // assign rather than call setRequestManager()\n    });\n\n\n    // fire \"receipt\" and confirmation events and resolve after\n    var checkConfirmation = function (existingReceipt, isPolling, err, blockHeader, sub) {\n        if (!err) {\n            // create fake unsubscribe\n            if (!sub) {\n                sub = {\n                    unsubscribe: function () {\n                        clearInterval(intervalId);\n                    }\n                };\n            }\n            // if we have a valid receipt we don't need to send a request\n            return (existingReceipt ? promiEvent.resolve(existingReceipt) : _ethereumCall.getTransactionReceipt(result))\n            // catch error from requesting receipt\n            .catch(function (err) {\n                sub.unsubscribe();\n                promiseResolved = true;\n                utils._fireError({message: 'Failed to check for transaction receipt:', data: err}, defer.eventEmitter, defer.reject);\n            })\n            // if CONFIRMATION listener exists check for confirmations, by setting canUnsubscribe = false\n            .then(function(receipt) {\n                if (!receipt || !receipt.blockHash) {\n                    throw new Error('Receipt missing or blockHash null');\n                }\n\n                // apply extra formatters\n                if (method.extraFormatters && method.extraFormatters.receiptFormatter) {\n                    receipt = method.extraFormatters.receiptFormatter(receipt);\n                }\n\n                // check if confirmation listener exists\n                if (defer.eventEmitter.listeners('confirmation').length > 0) {\n\n                    // If there was an immediately retrieved receipt, it's already\n                    // been confirmed by the direct call to checkConfirmation needed\n                    // for parity instant-seal\n                    if (existingReceipt === undefined || confirmationCount !== 0){\n                        defer.eventEmitter.emit('confirmation', confirmationCount, receipt);\n                    }\n\n                    canUnsubscribe = false;\n                    confirmationCount++;\n\n                    if (confirmationCount === CONFIRMATIONBLOCKS + 1) { // add 1 so we account for conf 0\n                        sub.unsubscribe();\n                        defer.eventEmitter.removeAllListeners();\n                    }\n                }\n\n                return receipt;\n            })\n            // CHECK for CONTRACT DEPLOYMENT\n            .then(function(receipt) {\n\n                if (isContractDeployment && !promiseResolved) {\n\n                    if (!receipt.contractAddress) {\n\n                        if (canUnsubscribe) {\n                            sub.unsubscribe();\n                            promiseResolved = true;\n                        }\n\n                        utils._fireError(new Error('The transaction receipt didn\\'t contain a contract address.'), defer.eventEmitter, defer.reject);\n                        return;\n                    }\n\n                    _ethereumCall.getCode(receipt.contractAddress, function (e, code) {\n\n                        if (!code) {\n                            return;\n                        }\n\n\n                        if (code.length > 2) {\n                            defer.eventEmitter.emit('receipt', receipt);\n\n                            // if contract, return instance instead of receipt\n                            if (method.extraFormatters && method.extraFormatters.contractDeployFormatter) {\n                                defer.resolve(method.extraFormatters.contractDeployFormatter(receipt));\n                            } else {\n                                defer.resolve(receipt);\n                            }\n\n                            // need to remove listeners, as they aren't removed automatically when succesfull\n                            if (canUnsubscribe) {\n                                defer.eventEmitter.removeAllListeners();\n                            }\n\n                        } else {\n                            utils._fireError(new Error('The contract code couldn\\'t be stored, please check your gas limit.'), defer.eventEmitter, defer.reject);\n                        }\n\n                        if (canUnsubscribe) {\n                            sub.unsubscribe();\n                        }\n                        promiseResolved = true;\n                    });\n                }\n\n                return receipt;\n            })\n            // CHECK for normal tx check for receipt only\n            .then(function(receipt) {\n\n                if (!isContractDeployment && !promiseResolved) {\n\n                    if(!receipt.outOfGas &&\n                        (!gasProvided || gasProvided !== receipt.gasUsed) &&\n                        (receipt.status === true || receipt.status === '0x1' || typeof receipt.status === 'undefined')) {\n                        defer.eventEmitter.emit('receipt', receipt);\n                        defer.resolve(receipt);\n\n                        // need to remove listeners, as they aren't removed automatically when succesfull\n                        if (canUnsubscribe) {\n                            defer.eventEmitter.removeAllListeners();\n                        }\n\n                    } else {\n                        if(receipt) {\n                            receipt = JSON.stringify(receipt, null, 2);\n                        }\n                        if (receipt.status === false || receipt.status === '0x0') {\n                            utils._fireError(new Error(\"Transaction has been reverted by the EVM:\\n\" + receipt),\n                                defer.eventEmitter, defer.reject);\n                        } else {\n                            utils._fireError(\n                                new Error(\"Transaction ran out of gas. Please provide more gas:\\n\" + receipt),\n                                defer.eventEmitter, defer.reject);\n                        }\n                    }\n\n                    if (canUnsubscribe) {\n                        sub.unsubscribe();\n                    }\n                    promiseResolved = true;\n                }\n\n            })\n            // time out the transaction if not mined after 50 blocks\n            .catch(function () {\n                timeoutCount++;\n\n                // check to see if we are http polling\n                if(!!isPolling) {\n                    // polling timeout is different than TIMEOUTBLOCK blocks since we are triggering every second\n                    if (timeoutCount - 1 >= POLLINGTIMEOUT) {\n                        sub.unsubscribe();\n                        promiseResolved = true;\n                        utils._fireError(new Error('Transaction was not mined within' + POLLINGTIMEOUT + ' seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject);\n                    }\n                } else {\n                    if (timeoutCount - 1 >= TIMEOUTBLOCK) {\n                        sub.unsubscribe();\n                        promiseResolved = true;\n                        utils._fireError(new Error('Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject);\n                    }\n                }\n            });\n\n\n        } else {\n            sub.unsubscribe();\n            promiseResolved = true;\n            utils._fireError({message: 'Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.', data: err}, defer.eventEmitter, defer.reject);\n        }\n    };\n\n    // start watching for confirmation depending on the support features of the provider\n    var startWatching = function(existingReceipt) {\n        // if provider allows PUB/SUB\n        if (_.isFunction(this.requestManager.provider.on)) {\n            _ethereumCall.subscribe('newBlockHeaders', checkConfirmation.bind(null, existingReceipt, false));\n        } else {\n            intervalId = setInterval(checkConfirmation.bind(null, existingReceipt, true), 1000);\n        }\n    }.bind(this);\n\n\n    // first check if we already have a confirmed transaction\n    _ethereumCall.getTransactionReceipt(result)\n    .then(function(receipt) {\n        if (receipt && receipt.blockHash) {\n            if (defer.eventEmitter.listeners('confirmation').length > 0) {\n                // We must keep on watching for new Blocks, if a confirmation listener is present\n                startWatching(receipt);\n            }\n            checkConfirmation(receipt, false);\n\n        } else if (!promiseResolved) {\n            startWatching();\n        }\n    })\n    .catch(function(){\n        if (!promiseResolved) startWatching();\n    });\n\n};\n\n\nvar getWallet = function(from, accounts) {\n    var wallet = null;\n\n    // is index given\n    if (_.isNumber(from)) {\n        wallet = accounts.wallet[from];\n\n        // is account given\n    } else if (_.isObject(from) && from.address && from.privateKey) {\n        wallet = from;\n\n        // search in wallet for address\n    } else {\n        wallet = accounts.wallet[from.toLowerCase()];\n    }\n\n    return wallet;\n};\n\nMethod.prototype.buildCall = function() {\n    var method = this,\n        isSendTx = (method.call === 'eth_sendTransaction' || method.call === 'eth_sendRawTransaction'); // || method.call === 'personal_sendTransaction'\n\n    // actual send function\n    var send = function () {\n        var defer = promiEvent(!isSendTx),\n            payload = method.toPayload(Array.prototype.slice.call(arguments));\n\n\n        // CALLBACK function\n        var sendTxCallback = function (err, result) {\n            try {\n                result = method.formatOutput(result);\n            } catch(e) {\n                err = e;\n            }\n\n            if (result instanceof Error) {\n                err = result;\n            }\n\n            if (!err) {\n                if (payload.callback) {\n                    payload.callback(null, result);\n                }\n            } else {\n                if(err.error) {\n                    err = err.error;\n                }\n\n                return utils._fireError(err, defer.eventEmitter, defer.reject, payload.callback);\n            }\n\n            // return PROMISE\n            if (!isSendTx) {\n\n                if (!err) {\n                    defer.resolve(result);\n\n                }\n\n                // return PROMIEVENT\n            } else {\n                defer.eventEmitter.emit('transactionHash', result);\n\n                method._confirmTransaction(defer, result, payload);\n            }\n\n        };\n\n        // SENDS the SIGNED SIGNATURE\n        var sendSignedTx = function(sign){\n\n            var signedPayload = _.extend({}, payload, {\n                method: 'eth_sendRawTransaction',\n                params: [sign.rawTransaction]\n            });\n\n            method.requestManager.send(signedPayload, sendTxCallback);\n        };\n\n\n        var sendRequest = function(payload, method) {\n\n            if (method && method.accounts && method.accounts.wallet && method.accounts.wallet.length) {\n                var wallet;\n\n                // ETH_SENDTRANSACTION\n                if (payload.method === 'eth_sendTransaction') {\n                    var tx = payload.params[0];\n                    wallet = getWallet((_.isObject(tx)) ? tx.from : null, method.accounts);\n\n\n                    // If wallet was found, sign tx, and send using sendRawTransaction\n                    if (wallet && wallet.privateKey) {\n                        return method.accounts.signTransaction(_.omit(tx, 'from'), wallet.privateKey).then(sendSignedTx);\n                    }\n\n                    // ETH_SIGN\n                } else if (payload.method === 'eth_sign') {\n                    var data = payload.params[1];\n                    wallet = getWallet(payload.params[0], method.accounts);\n\n                    // If wallet was found, sign tx, and send using sendRawTransaction\n                    if (wallet && wallet.privateKey) {\n                        var sign = method.accounts.sign(data, wallet.privateKey);\n\n                        if (payload.callback) {\n                            payload.callback(null, sign.signature);\n                        }\n\n                        defer.resolve(sign.signature);\n                        return;\n                    }\n\n\n                }\n            }\n\n            return method.requestManager.send(payload, sendTxCallback);\n        };\n\n        // Send the actual transaction\n        if(isSendTx && _.isObject(payload.params[0]) && !payload.params[0].gasPrice) {\n\n            var getGasPrice = (new Method({\n                name: 'getGasPrice',\n                call: 'eth_gasPrice',\n                params: 0\n            })).createFunction(method.requestManager);\n\n            getGasPrice(function (err, gasPrice) {\n\n                if (gasPrice) {\n                    payload.params[0].gasPrice = gasPrice;\n                }\n                sendRequest(payload, method);\n            });\n\n        } else {\n            sendRequest(payload, method);\n        }\n\n\n        return defer.eventEmitter;\n    };\n\n    // necessary to attach things to the method\n    send.method = method;\n    // necessary for batch requests\n    send.request = this.request.bind(this);\n    return send;\n};\n\n/**\n * Should be called to create the pure JSONRPC request which can be used in a batch request\n *\n * @method request\n * @return {Object} jsonrpc request\n */\nMethod.prototype.request = function () {\n    var payload = this.toPayload(Array.prototype.slice.call(arguments));\n    payload.format = this.formatOutput.bind(this);\n    return payload;\n};\n\nmodule.exports = Method;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-method/src/index.js\n// module id = 92\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-method/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar requestManager = __webpack_require__(774);\nvar extend = __webpack_require__(776);\n\nmodule.exports = {\n    packageInit: function (pkg, args) {\n        args = Array.prototype.slice.call(args);\n\n        if (!pkg) {\n            throw new Error('You need to instantiate using the \"new\" keyword.');\n        }\n\n\n        // make property of pkg._provider, which can properly set providers\n        Object.defineProperty(pkg, 'currentProvider', {\n            get: function () {\n                return pkg._provider;\n            },\n            set: function (value) {\n                return pkg.setProvider(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n\n        // inherit from web3 umbrella package\n        if (args[0] && args[0]._requestManager) {\n            pkg._requestManager = new requestManager.Manager(args[0].currentProvider);\n\n        // set requestmanager on package\n        } else {\n            pkg._requestManager = new requestManager.Manager();\n            pkg._requestManager.setProvider(args[0], args[1]);\n        }\n\n        // add givenProvider\n        pkg.givenProvider = requestManager.Manager.givenProvider;\n        pkg.providers = requestManager.Manager.providers;\n\n         pkg._provider =  pkg._requestManager.provider;\n\n        // add SETPROVIDER function (don't overwrite if already existing)\n        if (!pkg.setProvider) {\n            pkg.setProvider = function (provider, net) {\n                pkg._requestManager.setProvider(provider, net);\n                pkg._provider = pkg._requestManager.provider;\n                return true;\n            };\n        }\n\n        // attach batch request creation\n        pkg.BatchRequest = requestManager.BatchManager.bind(null, pkg._requestManager);\n\n        // attach extend function\n        pkg.extend = extend(pkg);\n    },\n    addProviders: function (pkg) {\n        pkg.givenProvider = requestManager.Manager.givenProvider;\n        pkg.providers = requestManager.Manager.providers;\n    }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core/src/index.js\n// module id = 93\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core/src/index.js")},function(module,exports,__webpack_require__){eval('var f = __webpack_require__(61);\nvar SolidityParam = __webpack_require__(386);\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n    this._inputFormatter = config.inputFormatter;\n    this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given name\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n    throw "This method should be overwritten for type " + name;\n};\n\n/**\n * Should be used to determine what is the length of static part in given type\n *\n * @method staticPartLength\n * @param {String} name\n * @return {Number} length of static part in bytes\n */\nSolidityType.prototype.staticPartLength = function (name) {\n    // If name isn\'t an array then treat it like a single element array.\n    return (this.nestedTypes(name) || [\'[1]\'])\n        .map(function (type) {\n            // the length of the nested array\n            return parseInt(type.slice(1, -1), 10) || 1;\n        })\n        .reduce(function (previous, current) {\n            return previous * current;\n        // all basic types are 32 bytes long\n        }, 32);\n};\n\n/**\n * Should be used to determine if type is dynamic array\n * eg:\n * "type[]" => true\n * "type[4]" => false\n *\n * @method isDynamicArray\n * @param {String} name\n * @return {Bool} true if the type is dynamic array\n */\nSolidityType.prototype.isDynamicArray = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    return !!nestedTypes && !nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\n};\n\n/**\n * Should be used to determine if type is static array\n * eg:\n * "type[]" => false\n * "type[4]" => true\n *\n * @method isStaticArray\n * @param {String} name\n * @return {Bool} true if the type is static array\n */\nSolidityType.prototype.isStaticArray = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    return !!nestedTypes && !!nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\n};\n\n/**\n * Should return length of static array\n * eg.\n * "int[32]" => 32\n * "int256[14]" => 14\n * "int[2][3]" => 3\n * "int" => 1\n * "int[1]" => 1\n * "int[]" => 1\n *\n * @method staticArrayLength\n * @param {String} name\n * @return {Number} static array length\n */\nSolidityType.prototype.staticArrayLength = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    if (nestedTypes) {\n       return parseInt(nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g) || 1);\n    }\n    return 1;\n};\n\n/**\n * Should return nested type\n * eg.\n * "int[32]" => "int"\n * "int256[14]" => "int256"\n * "int[2][3]" => "int[2]"\n * "int" => "int"\n * "int[]" => "int"\n *\n * @method nestedName\n * @param {String} name\n * @return {String} nested name\n */\nSolidityType.prototype.nestedName = function (name) {\n    // remove last [] in name\n    var nestedTypes = this.nestedTypes(name);\n    if (!nestedTypes) {\n        return name;\n    }\n\n    return name.substr(0, name.length - nestedTypes[nestedTypes.length - 1].length);\n};\n\n/**\n * Should return true if type has dynamic size by default\n * such types are "string", "bytes"\n *\n * @method isDynamicType\n * @param {String} name\n * @return {Bool} true if is dynamic, otherwise false\n */\nSolidityType.prototype.isDynamicType = function () {\n    return false;\n};\n\n/**\n * Should return array of nested types\n * eg.\n * "int[2][3][]" => ["[2]", "[3]", "[]"]\n * "int[] => ["[]"]\n * "int" => null\n *\n * @method nestedTypes\n * @param {String} name\n * @return {Array} array of nested types\n */\nSolidityType.prototype.nestedTypes = function (name) {\n    // return list of strings eg. "[]", "[3]", "[]", "[2]"\n    return name.match(/(\\[[0-9]*\\])/g);\n};\n\n/**\n * Should be used to encode the value\n *\n * @method encode\n * @param {Object} value\n * @param {String} name\n * @return {String} encoded value\n */\nSolidityType.prototype.encode = function (value, name) {\n    var self = this;\n    if (this.isDynamicArray(name)) {\n\n        return (function () {\n            var length = value.length;                          // in int\n            var nestedName = self.nestedName(name);\n\n            var result = [];\n            result.push(f.formatInputInt(length).encode());\n\n            value.forEach(function (v) {\n                result.push(self.encode(v, nestedName));\n            });\n\n            return result;\n        })();\n\n    } else if (this.isStaticArray(name)) {\n\n        return (function () {\n            var length = self.staticArrayLength(name);          // in int\n            var nestedName = self.nestedName(name);\n\n            var result = [];\n            for (var i = 0; i < length; i++) {\n                result.push(self.encode(value[i], nestedName));\n            }\n\n            return result;\n        })();\n\n    }\n\n    return this._inputFormatter(value, name).encode();\n};\n\n/**\n * Should be used to decode value from bytes\n *\n * @method decode\n * @param {String} bytes\n * @param {Number} offset in bytes\n * @param {String} name type name\n * @returns {Object} decoded value\n */\nSolidityType.prototype.decode = function (bytes, offset, name) {\n    var self = this;\n\n    if (this.isDynamicArray(name)) {\n\n        return (function () {\n            var arrayOffset = parseInt(\'0x\' + bytes.substr(offset * 2, 64)); // in bytes\n            var length = parseInt(\'0x\' + bytes.substr(arrayOffset * 2, 64)); // in int\n            var arrayStart = arrayOffset + 32; // array starts after length; // in bytes\n\n            var nestedName = self.nestedName(name);\n            var nestedStaticPartLength = self.staticPartLength(nestedName);  // in bytes\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\n            var result = [];\n\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\n            }\n\n            return result;\n        })();\n\n    } else if (this.isStaticArray(name)) {\n\n        return (function () {\n            var length = self.staticArrayLength(name);                      // in int\n            var arrayStart = offset;                                        // in bytes\n\n            var nestedName = self.nestedName(name);\n            var nestedStaticPartLength = self.staticPartLength(nestedName); // in bytes\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\n            var result = [];\n\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\n            }\n\n            return result;\n        })();\n    } else if (this.isDynamicType(name)) {\n\n        return (function () {\n            var dynamicOffset = parseInt(\'0x\' + bytes.substr(offset * 2, 64));      // in bytes\n            var length = parseInt(\'0x\' + bytes.substr(dynamicOffset * 2, 64));      // in bytes\n            var roundedLength = Math.floor((length + 31) / 32);                     // in int\n            var param = new SolidityParam(bytes.substr(dynamicOffset * 2, ( 1 + roundedLength) * 64), 0, bytes);\n            return self._outputFormatter(param, name);\n        })();\n    }\n\n    var length = this.staticPartLength(name);\n    var param = new SolidityParam(bytes.substr(offset * 2, length * 2), undefined, bytes);\n    return this._outputFormatter(param, name);\n};\n\nmodule.exports = SolidityType;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/type.js\n// module id = 94\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/type.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst protons = __webpack_require__(64)\nconst pb = protons(__webpack_require__(931))\n// encode/decode\nconst unixfsData = pb.Data\n// const unixfsMetadata = pb.MetaData // encode/decode\n\nconst types = [\n  'raw',\n  'directory',\n  'file',\n  'metadata',\n  'symlink',\n  'hamt-sharded-directory'\n]\n\nconst dirTypes = [\n  'directory',\n  'hamt-sharded-directory'\n]\n\nfunction Data (type, data) {\n  if (!(this instanceof Data)) {\n    return new Data(type, data)\n  }\n  if (types.indexOf(type) === -1) {\n    throw new Error('Type: ' + type + ' is not valid')\n  }\n\n  this.type = type\n  this.data = data\n  this.blockSizes = []\n\n  this.addBlockSize = (size) => {\n    this.blockSizes.push(size)\n  }\n\n  this.removeBlockSize = (index) => {\n    this.blockSizes.splice(index, 1)\n  }\n\n  // data.length + blockSizes\n  this.fileSize = () => {\n    if (dirTypes.indexOf(this.type) >= 0) {\n      // dirs don't have file size\n      return undefined\n    }\n\n    let sum = 0\n    this.blockSizes.forEach((size) => {\n      sum += size\n    })\n    if (data) {\n      sum += data.length\n    }\n    return sum\n  }\n\n  // encode to protobuf\n  this.marshal = () => {\n    let type\n\n    switch (this.type) {\n      case 'raw': type = unixfsData.DataType.Raw; break\n      case 'directory': type = unixfsData.DataType.Directory; break\n      case 'file': type = unixfsData.DataType.File; break\n      case 'metadata': type = unixfsData.DataType.Metadata; break\n      case 'symlink': type = unixfsData.DataType.Symlink; break\n      case 'hamt-sharded-directory': type = unixfsData.DataType.HAMTShard; break\n      default:\n        throw new Error(`Unkown type: \"${this.type}\"`)\n    }\n    let fileSize = this.fileSize()\n\n    let data = this.data\n\n    if (!this.data || !this.data.length) {\n      data = undefined\n    }\n\n    let blockSizes = this.blockSizes\n\n    if (!this.blockSizes || !this.blockSizes.length) {\n      blockSizes = undefined\n    }\n\n    return unixfsData.encode({\n      Type: type,\n      Data: data,\n      filesize: fileSize,\n      blocksizes: blockSizes,\n      hashType: this.hashType,\n      fanout: this.fanout\n    })\n  }\n}\n\n// decode from protobuf https://github.com/ipfs/go-ipfs/blob/master/unixfs/format.go#L24\nData.unmarshal = (marsheled) => {\n  const decoded = unixfsData.decode(marsheled)\n  if (!decoded.Data) {\n    decoded.Data = undefined\n  }\n  const obj = new Data(types[decoded.Type], decoded.Data)\n  obj.blockSizes = decoded.blocksizes\n  return obj\n}\n\nexports = module.exports = Data\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs/src/index.js\n// module id = 95\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(32)\nconst assert = __webpack_require__(16)\n\n// Link represents an IPFS Merkle DAG Link between Nodes.\nclass DAGLink {\n  constructor (name, size, multihash) {\n    assert(multihash, 'A link requires a multihash to point to')\n    // assert(size, 'A link requires a size')\n    //  note - links should include size, but this assert is disabled\n    //  for now to maintain consistency with go-ipfs pinset\n\n    this._name = name\n    this._size = size\n\n    if (typeof multihash === 'string') {\n      this._multihash = mh.fromB58String(multihash)\n    } else if (Buffer.isBuffer(multihash)) {\n      this._multihash = multihash\n    }\n  }\n\n  toString () {\n    const mhStr = mh.toB58String(this.multihash)\n    return `DAGLink <${mhStr} - name: \"${this.name}\", size: ${this.size}>`\n  }\n\n  toJSON () {\n    return {\n      name: this.name,\n      size: this.size,\n      multihash: mh.toB58String(this._multihash)\n    }\n  }\n\n  get name () {\n    return this._name\n  }\n\n  set name (name) {\n    throw new Error(\"Can't set property: 'name' is immutable\")\n  }\n\n  get size () {\n    return this._size\n  }\n\n  set size (size) {\n    throw new Error(\"Can't set property: 'size' is immutable\")\n  }\n\n  get multihash () {\n    return this._multihash\n  }\n\n  set multihash (multihash) {\n    throw new Error(\"Can't set property: 'multihash' is immutable\")\n  }\n}\n\nexports = module.exports = DAGLink\nexports.create = __webpack_require__(935)\nexports.util = __webpack_require__(936)\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-link/index.js\n// module id = 96\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-link/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.ethAccountSnapshot = __webpack_require__(419)\nexports.ethBlock = __webpack_require__(420)\nexports.ethBlockList = __webpack_require__(942)\nexports.ethStateTrie = __webpack_require__(943)\nexports.ethStorageTrie = __webpack_require__(944)\nexports.ethTx = __webpack_require__(421)\nexports.ethTxTrie = __webpack_require__(945)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/src/index.js\n// module id = 97\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/src/index.js")},function(module,exports,__webpack_require__){eval("var isFunction = __webpack_require__(466),\n    isLength = __webpack_require__(467);\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isArrayLike.js\n// module id = 98\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isArrayLike.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multiaddr = __webpack_require__(21)\n\n/*\n * Valid combinations\n */\nconst DNS4 = base('dns4')\nconst DNS6 = base('dns6')\nconst _DNS = or(\n  base('dnsaddr'),\n  DNS4,\n  DNS6\n)\n\nconst IP = or(base('ip4'), base('ip6'))\nconst TCP = and(IP, base('tcp'))\nconst UDP = and(IP, base('udp'))\nconst UTP = and(UDP, base('utp'))\n\nconst DNS = or(\n  and(_DNS, base('tcp')),\n  _DNS\n)\n\nconst WebSockets = or(\n  and(TCP, base('ws')),\n  and(DNS, base('ws'))\n)\n\nconst WebSocketsSecure = or(\n  and(TCP, base('wss')),\n  and(DNS, base('wss'))\n)\n\nconst HTTP = or(\n  and(TCP, base('http')),\n  and(DNS),\n  and(DNS, base('http'))\n)\n\nconst WebRTCStar = or(\n  and(WebSockets, base('p2p-webrtc-star'), base('ipfs')),\n  and(WebSocketsSecure, base('p2p-webrtc-star'), base('ipfs'))\n)\n\nconst WebSocketStar = or(\n  and(WebSockets, base('p2p-websocket-star'), base('ipfs')),\n  and(WebSocketsSecure, base('p2p-websocket-star'), base('ipfs')),\n  and(WebSockets, base('p2p-websocket-star')),\n  and(WebSocketsSecure, base('p2p-websocket-star'))\n)\n\nconst WebRTCDirect = and(HTTP, base('p2p-webrtc-direct'))\n\nconst Reliable = or(\n  WebSockets,\n  WebSocketsSecure,\n  HTTP,\n  WebRTCStar,\n  WebRTCDirect,\n  TCP,\n  UTP\n)\n\nlet _IPFS = or(\n  and(Reliable, base('ipfs')),\n  WebRTCStar,\n  base('ipfs')\n)\n\nconst _Circuit = or(\n  and(_IPFS, base('p2p-circuit'), _IPFS),\n  and(_IPFS, base('p2p-circuit')),\n  and(base('p2p-circuit'), _IPFS),\n  and(Reliable, base('p2p-circuit')),\n  and(base('p2p-circuit'), Reliable),\n  base('p2p-circuit')\n)\n\nconst CircuitRecursive = () => or(\n  and(_Circuit, CircuitRecursive),\n  _Circuit\n)\n\nconst Circuit = CircuitRecursive()\n\nconst IPFS = or(\n  and(Circuit, _IPFS, Circuit),\n  and(_IPFS, Circuit),\n  and(Circuit, _IPFS),\n  Circuit,\n  _IPFS\n)\n\nexports.DNS = DNS\nexports.DNS4 = DNS4\nexports.DNS6 = DNS6\nexports.IP = IP\nexports.TCP = TCP\nexports.UDP = UDP\nexports.UTP = UTP\nexports.HTTP = HTTP\nexports.WebSockets = WebSockets\nexports.WebSocketsSecure = WebSocketsSecure\nexports.WebSocketStar = WebSocketStar\nexports.WebRTCStar = WebRTCStar\nexports.WebRTCDirect = WebRTCDirect\nexports.Reliable = Reliable\nexports.Circuit = Circuit\nexports.IPFS = IPFS\n\n/*\n * Validation funcs\n */\n\nfunction and () {\n  const args = Array.from(arguments)\n\n  function matches (a) {\n    if (typeof a === 'string') {\n      a = multiaddr(a)\n    }\n    let out = partialMatch(a.protoNames())\n    if (out === null) {\n      return false\n    }\n    return out.length === 0\n  }\n\n  function partialMatch (a) {\n    if (a.length < args.length) {\n      return null\n    }\n    args.some((arg) => {\n      a = typeof arg === 'function'\n        ? arg().partialMatch(a)\n        : arg.partialMatch(a)\n\n      if (a === null) {\n        return true\n      }\n    })\n\n    return a\n  }\n\n  return {\n    input: args,\n    matches: matches,\n    partialMatch: partialMatch\n  }\n}\n\nfunction or () {\n  const args = Array.from(arguments)\n\n  function matches (a) {\n    if (typeof a === 'string') {\n      a = multiaddr(a)\n    }\n    const out = partialMatch(a.protoNames())\n    if (out === null) {\n      return false\n    }\n    return out.length === 0\n  }\n\n  function partialMatch (a) {\n    let out = null\n    args.some((arg) => {\n      const res = typeof arg === 'function'\n        ? arg().partialMatch(a)\n        : arg.partialMatch(a)\n      if (res) {\n        out = res\n        return true\n      }\n    })\n\n    return out\n  }\n\n  const result = {\n    toString: function () { return '{ ' + args.join(' ') + ' }' },\n    input: args,\n    matches: matches,\n    partialMatch: partialMatch\n  }\n\n  return result\n}\n\nfunction base (n) {\n  const name = n\n\n  function matches (a) {\n    if (typeof a === 'string') {\n      a = multiaddr(a)\n    }\n\n    const pnames = a.protoNames()\n    if (pnames.length === 1 && pnames[0] === name) {\n      return true\n    }\n    return false\n  }\n\n  function partialMatch (protos) {\n    if (protos.length === 0) {\n      return null\n    }\n\n    if (protos[0] === name) {\n      return protos.slice(1)\n    }\n    return null\n  }\n\n  return {\n    toString: function () { return name },\n    matches: matches,\n    partialMatch: partialMatch\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/mafmt/src/index.js\n// module id = 99\n// module chunks = 0\n\n//# sourceURL=../node_modules/mafmt/src/index.js")},function(module,exports,__webpack_require__){eval("/**\n * Advanced Encryption Standard (AES) implementation.\n *\n * This implementation is based on the public domain library 'jscrypto' which\n * was written by:\n *\n * Emily Stark (estark@stanford.edu)\n * Mike Hamburg (mhamburg@stanford.edu)\n * Dan Boneh (dabo@cs.stanford.edu)\n *\n * Parts of this code are based on the OpenSSL implementation of AES:\n * http://www.openssl.org\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(289);\n__webpack_require__(481);\n__webpack_require__(9);\n\n/* AES API */\nmodule.exports = forge.aes = forge.aes || {};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('AES-<mode>', key);\n * cipher.start({iv: iv});\n *\n * Creates an AES cipher object to encrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as a string of bytes, an array of bytes,\n * a byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.startEncrypting = function(key, iv, output, mode) {\n  var cipher = _createCipher({\n    key: key,\n    output: output,\n    decrypt: false,\n    mode: mode\n  });\n  cipher.start(iv);\n  return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('AES-<mode>', key);\n *\n * Creates an AES cipher object to encrypt data using the given symmetric key.\n *\n * The key may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.createEncryptionCipher = function(key, mode) {\n  return _createCipher({\n    key: key,\n    output: null,\n    decrypt: false,\n    mode: mode\n  });\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('AES-<mode>', key);\n * decipher.start({iv: iv});\n *\n * Creates an AES cipher object to decrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as a string of bytes, an array of bytes,\n * a byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.startDecrypting = function(key, iv, output, mode) {\n  var cipher = _createCipher({\n    key: key,\n    output: output,\n    decrypt: true,\n    mode: mode\n  });\n  cipher.start(iv);\n  return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('AES-<mode>', key);\n *\n * Creates an AES cipher object to decrypt data using the given symmetric key.\n *\n * The key may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param key the symmetric key to use.\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.aes.createDecryptionCipher = function(key, mode) {\n  return _createCipher({\n    key: key,\n    output: null,\n    decrypt: true,\n    mode: mode\n  });\n};\n\n/**\n * Creates a new AES cipher algorithm object.\n *\n * @param name the name of the algorithm.\n * @param mode the mode factory function.\n *\n * @return the AES algorithm object.\n */\nforge.aes.Algorithm = function(name, mode) {\n  if(!init) {\n    initialize();\n  }\n  var self = this;\n  self.name = name;\n  self.mode = new mode({\n    blockSize: 16,\n    cipher: {\n      encrypt: function(inBlock, outBlock) {\n        return _updateBlock(self._w, inBlock, outBlock, false);\n      },\n      decrypt: function(inBlock, outBlock) {\n        return _updateBlock(self._w, inBlock, outBlock, true);\n      }\n    }\n  });\n  self._init = false;\n};\n\n/**\n * Initializes this AES algorithm by expanding its key.\n *\n * @param options the options to use.\n *          key the key to use with this algorithm.\n *          decrypt true if the algorithm should be initialized for decryption,\n *            false for encryption.\n */\nforge.aes.Algorithm.prototype.initialize = function(options) {\n  if(this._init) {\n    return;\n  }\n\n  var key = options.key;\n  var tmp;\n\n  /* Note: The key may be a string of bytes, an array of bytes, a byte\n    buffer, or an array of 32-bit integers. If the key is in bytes, then\n    it must be 16, 24, or 32 bytes in length. If it is in 32-bit\n    integers, it must be 4, 6, or 8 integers long. */\n\n  if(typeof key === 'string' &&\n    (key.length === 16 || key.length === 24 || key.length === 32)) {\n    // convert key string into byte buffer\n    key = forge.util.createBuffer(key);\n  } else if(forge.util.isArray(key) &&\n    (key.length === 16 || key.length === 24 || key.length === 32)) {\n    // convert key integer array into byte buffer\n    tmp = key;\n    key = forge.util.createBuffer();\n    for(var i = 0; i < tmp.length; ++i) {\n      key.putByte(tmp[i]);\n    }\n  }\n\n  // convert key byte buffer into 32-bit integer array\n  if(!forge.util.isArray(key)) {\n    tmp = key;\n    key = [];\n\n    // key lengths of 16, 24, 32 bytes allowed\n    var len = tmp.length();\n    if(len === 16 || len === 24 || len === 32) {\n      len = len >>> 2;\n      for(var i = 0; i < len; ++i) {\n        key.push(tmp.getInt32());\n      }\n    }\n  }\n\n  // key must be an array of 32-bit integers by now\n  if(!forge.util.isArray(key) ||\n    !(key.length === 4 || key.length === 6 || key.length === 8)) {\n    throw new Error('Invalid key parameter.');\n  }\n\n  // encryption operation is always used for these modes\n  var mode = this.mode.name;\n  var encryptOp = (['CFB', 'OFB', 'CTR', 'GCM'].indexOf(mode) !== -1);\n\n  // do key expansion\n  this._w = _expandKey(key, options.decrypt && !encryptOp);\n  this._init = true;\n};\n\n/**\n * Expands a key. Typically only used for testing.\n *\n * @param key the symmetric key to expand, as an array of 32-bit words.\n * @param decrypt true to expand for decryption, false for encryption.\n *\n * @return the expanded key.\n */\nforge.aes._expandKey = function(key, decrypt) {\n  if(!init) {\n    initialize();\n  }\n  return _expandKey(key, decrypt);\n};\n\n/**\n * Updates a single block. Typically only used for testing.\n *\n * @param w the expanded key to use.\n * @param input an array of block-size 32-bit words.\n * @param output an array of block-size 32-bit words.\n * @param decrypt true to decrypt, false to encrypt.\n */\nforge.aes._updateBlock = _updateBlock;\n\n/** Register AES algorithms **/\n\nregisterAlgorithm('AES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('AES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('AES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('AES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('AES-CTR', forge.cipher.modes.ctr);\nregisterAlgorithm('AES-GCM', forge.cipher.modes.gcm);\n\nfunction registerAlgorithm(name, mode) {\n  var factory = function() {\n    return new forge.aes.Algorithm(name, mode);\n  };\n  forge.cipher.registerAlgorithm(name, factory);\n}\n\n/** AES implementation **/\n\nvar init = false; // not yet initialized\nvar Nb = 4;       // number of words comprising the state (AES = 4)\nvar sbox;         // non-linear substitution table used in key expansion\nvar isbox;        // inversion of sbox\nvar rcon;         // round constant word array\nvar mix;          // mix-columns table\nvar imix;         // inverse mix-columns table\n\n/**\n * Performs initialization, ie: precomputes tables to optimize for speed.\n *\n * One way to understand how AES works is to imagine that 'addition' and\n * 'multiplication' are interfaces that require certain mathematical\n * properties to hold true (ie: they are associative) but they might have\n * different implementations and produce different kinds of results ...\n * provided that their mathematical properties remain true. AES defines\n * its own methods of addition and multiplication but keeps some important\n * properties the same, ie: associativity and distributivity. The\n * explanation below tries to shed some light on how AES defines addition\n * and multiplication of bytes and 32-bit words in order to perform its\n * encryption and decryption algorithms.\n *\n * The basics:\n *\n * The AES algorithm views bytes as binary representations of polynomials\n * that have either 1 or 0 as the coefficients. It defines the addition\n * or subtraction of two bytes as the XOR operation. It also defines the\n * multiplication of two bytes as a finite field referred to as GF(2^8)\n * (Note: 'GF' means \"Galois Field\" which is a field that contains a finite\n * number of elements so GF(2^8) has 256 elements).\n *\n * This means that any two bytes can be represented as binary polynomials;\n * when they multiplied together and modularly reduced by an irreducible\n * polynomial of the 8th degree, the results are the field GF(2^8). The\n * specific irreducible polynomial that AES uses in hexadecimal is 0x11b.\n * This multiplication is associative with 0x01 as the identity:\n *\n * (b * 0x01 = GF(b, 0x01) = b).\n *\n * The operation GF(b, 0x02) can be performed at the byte level by left\n * shifting b once and then XOR'ing it (to perform the modular reduction)\n * with 0x11b if b is >= 128. Repeated application of the multiplication\n * of 0x02 can be used to implement the multiplication of any two bytes.\n *\n * For instance, multiplying 0x57 and 0x13, denoted as GF(0x57, 0x13), can\n * be performed by factoring 0x13 into 0x01, 0x02, and 0x10. Then these\n * factors can each be multiplied by 0x57 and then added together. To do\n * the multiplication, values for 0x57 multiplied by each of these 3 factors\n * can be precomputed and stored in a table. To add them, the values from\n * the table are XOR'd together.\n *\n * AES also defines addition and multiplication of words, that is 4-byte\n * numbers represented as polynomials of 3 degrees where the coefficients\n * are the values of the bytes.\n *\n * The word [a0, a1, a2, a3] is a polynomial a3x^3 + a2x^2 + a1x + a0.\n *\n * Addition is performed by XOR'ing like powers of x. Multiplication\n * is performed in two steps, the first is an algebriac expansion as\n * you would do normally (where addition is XOR). But the result is\n * a polynomial larger than 3 degrees and thus it cannot fit in a word. So\n * next the result is modularly reduced by an AES-specific polynomial of\n * degree 4 which will always produce a polynomial of less than 4 degrees\n * such that it will fit in a word. In AES, this polynomial is x^4 + 1.\n *\n * The modular product of two polynomials 'a' and 'b' is thus:\n *\n * d(x) = d3x^3 + d2x^2 + d1x + d0\n * with\n * d0 = GF(a0, b0) ^ GF(a3, b1) ^ GF(a2, b2) ^ GF(a1, b3)\n * d1 = GF(a1, b0) ^ GF(a0, b1) ^ GF(a3, b2) ^ GF(a2, b3)\n * d2 = GF(a2, b0) ^ GF(a1, b1) ^ GF(a0, b2) ^ GF(a3, b3)\n * d3 = GF(a3, b0) ^ GF(a2, b1) ^ GF(a1, b2) ^ GF(a0, b3)\n *\n * As a matrix:\n *\n * [d0] = [a0 a3 a2 a1][b0]\n * [d1]   [a1 a0 a3 a2][b1]\n * [d2]   [a2 a1 a0 a3][b2]\n * [d3]   [a3 a2 a1 a0][b3]\n *\n * Special polynomials defined by AES (0x02 == {02}):\n * a(x)    = {03}x^3 + {01}x^2 + {01}x + {02}\n * a^-1(x) = {0b}x^3 + {0d}x^2 + {09}x + {0e}.\n *\n * These polynomials are used in the MixColumns() and InverseMixColumns()\n * operations, respectively, to cause each element in the state to affect\n * the output (referred to as diffusing).\n *\n * RotWord() uses: a0 = a1 = a2 = {00} and a3 = {01}, which is the\n * polynomial x3.\n *\n * The ShiftRows() method modifies the last 3 rows in the state (where\n * the state is 4 words with 4 bytes per word) by shifting bytes cyclically.\n * The 1st byte in the second row is moved to the end of the row. The 1st\n * and 2nd bytes in the third row are moved to the end of the row. The 1st,\n * 2nd, and 3rd bytes are moved in the fourth row.\n *\n * More details on how AES arithmetic works:\n *\n * In the polynomial representation of binary numbers, XOR performs addition\n * and subtraction and multiplication in GF(2^8) denoted as GF(a, b)\n * corresponds with the multiplication of polynomials modulo an irreducible\n * polynomial of degree 8. In other words, for AES, GF(a, b) will multiply\n * polynomial 'a' with polynomial 'b' and then do a modular reduction by\n * an AES-specific irreducible polynomial of degree 8.\n *\n * A polynomial is irreducible if its only divisors are one and itself. For\n * the AES algorithm, this irreducible polynomial is:\n *\n * m(x) = x^8 + x^4 + x^3 + x + 1,\n *\n * or {01}{1b} in hexadecimal notation, where each coefficient is a bit:\n * 100011011 = 283 = 0x11b.\n *\n * For example, GF(0x57, 0x83) = 0xc1 because\n *\n * 0x57 = 87  = 01010111 = x^6 + x^4 + x^2 + x + 1\n * 0x85 = 131 = 10000101 = x^7 + x + 1\n *\n * (x^6 + x^4 + x^2 + x + 1) * (x^7 + x + 1)\n * =  x^13 + x^11 + x^9 + x^8 + x^7 +\n *    x^7 + x^5 + x^3 + x^2 + x +\n *    x^6 + x^4 + x^2 + x + 1\n * =  x^13 + x^11 + x^9 + x^8 + x^6 + x^5 + x^4 + x^3 + 1 = y\n *    y modulo (x^8 + x^4 + x^3 + x + 1)\n * =  x^7 + x^6 + 1.\n *\n * The modular reduction by m(x) guarantees the result will be a binary\n * polynomial of less than degree 8, so that it can fit in a byte.\n *\n * The operation to multiply a binary polynomial b with x (the polynomial\n * x in binary representation is 00000010) is:\n *\n * b_7x^8 + b_6x^7 + b_5x^6 + b_4x^5 + b_3x^4 + b_2x^3 + b_1x^2 + b_0x^1\n *\n * To get GF(b, x) we must reduce that by m(x). If b_7 is 0 (that is the\n * most significant bit is 0 in b) then the result is already reduced. If\n * it is 1, then we can reduce it by subtracting m(x) via an XOR.\n *\n * It follows that multiplication by x (00000010 or 0x02) can be implemented\n * by performing a left shift followed by a conditional bitwise XOR with\n * 0x1b. This operation on bytes is denoted by xtime(). Multiplication by\n * higher powers of x can be implemented by repeated application of xtime().\n *\n * By adding intermediate results, multiplication by any constant can be\n * implemented. For instance:\n *\n * GF(0x57, 0x13) = 0xfe because:\n *\n * xtime(b) = (b & 128) ? (b << 1 ^ 0x11b) : (b << 1)\n *\n * Note: We XOR with 0x11b instead of 0x1b because in javascript our\n * datatype for b can be larger than 1 byte, so a left shift will not\n * automatically eliminate bits that overflow a byte ... by XOR'ing the\n * overflow bit with 1 (the extra one from 0x11b) we zero it out.\n *\n * GF(0x57, 0x02) = xtime(0x57) = 0xae\n * GF(0x57, 0x04) = xtime(0xae) = 0x47\n * GF(0x57, 0x08) = xtime(0x47) = 0x8e\n * GF(0x57, 0x10) = xtime(0x8e) = 0x07\n *\n * GF(0x57, 0x13) = GF(0x57, (0x01 ^ 0x02 ^ 0x10))\n *\n * And by the distributive property (since XOR is addition and GF() is\n * multiplication):\n *\n * = GF(0x57, 0x01) ^ GF(0x57, 0x02) ^ GF(0x57, 0x10)\n * = 0x57 ^ 0xae ^ 0x07\n * = 0xfe.\n */\nfunction initialize() {\n  init = true;\n\n  /* Populate the Rcon table. These are the values given by\n    [x^(i-1),{00},{00},{00}] where x^(i-1) are powers of x (and x = 0x02)\n    in the field of GF(2^8), where i starts at 1.\n\n    rcon[0] = [0x00, 0x00, 0x00, 0x00]\n    rcon[1] = [0x01, 0x00, 0x00, 0x00] 2^(1-1) = 2^0 = 1\n    rcon[2] = [0x02, 0x00, 0x00, 0x00] 2^(2-1) = 2^1 = 2\n    ...\n    rcon[9]  = [0x1B, 0x00, 0x00, 0x00] 2^(9-1)  = 2^8 = 0x1B\n    rcon[10] = [0x36, 0x00, 0x00, 0x00] 2^(10-1) = 2^9 = 0x36\n\n    We only store the first byte because it is the only one used.\n  */\n  rcon = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36];\n\n  // compute xtime table which maps i onto GF(i, 0x02)\n  var xtime = new Array(256);\n  for(var i = 0; i < 128; ++i) {\n    xtime[i] = i << 1;\n    xtime[i + 128] = (i + 128) << 1 ^ 0x11B;\n  }\n\n  // compute all other tables\n  sbox = new Array(256);\n  isbox = new Array(256);\n  mix = new Array(4);\n  imix = new Array(4);\n  for(var i = 0; i < 4; ++i) {\n    mix[i] = new Array(256);\n    imix[i] = new Array(256);\n  }\n  var e = 0, ei = 0, e2, e4, e8, sx, sx2, me, ime;\n  for(var i = 0; i < 256; ++i) {\n    /* We need to generate the SubBytes() sbox and isbox tables so that\n      we can perform byte substitutions. This requires us to traverse\n      all of the elements in GF, find their multiplicative inverses,\n      and apply to each the following affine transformation:\n\n      bi' = bi ^ b(i + 4) mod 8 ^ b(i + 5) mod 8 ^ b(i + 6) mod 8 ^\n            b(i + 7) mod 8 ^ ci\n      for 0 <= i < 8, where bi is the ith bit of the byte, and ci is the\n      ith bit of a byte c with the value {63} or {01100011}.\n\n      It is possible to traverse every possible value in a Galois field\n      using what is referred to as a 'generator'. There are many\n      generators (128 out of 256): 3,5,6,9,11,82 to name a few. To fully\n      traverse GF we iterate 255 times, multiplying by our generator\n      each time.\n\n      On each iteration we can determine the multiplicative inverse for\n      the current element.\n\n      Suppose there is an element in GF 'e'. For a given generator 'g',\n      e = g^x. The multiplicative inverse of e is g^(255 - x). It turns\n      out that if use the inverse of a generator as another generator\n      it will produce all of the corresponding multiplicative inverses\n      at the same time. For this reason, we choose 5 as our inverse\n      generator because it only requires 2 multiplies and 1 add and its\n      inverse, 82, requires relatively few operations as well.\n\n      In order to apply the affine transformation, the multiplicative\n      inverse 'ei' of 'e' can be repeatedly XOR'd (4 times) with a\n      bit-cycling of 'ei'. To do this 'ei' is first stored in 's' and\n      'x'. Then 's' is left shifted and the high bit of 's' is made the\n      low bit. The resulting value is stored in 's'. Then 'x' is XOR'd\n      with 's' and stored in 'x'. On each subsequent iteration the same\n      operation is performed. When 4 iterations are complete, 'x' is\n      XOR'd with 'c' (0x63) and the transformed value is stored in 'x'.\n      For example:\n\n      s = 01000001\n      x = 01000001\n\n      iteration 1: s = 10000010, x ^= s\n      iteration 2: s = 00000101, x ^= s\n      iteration 3: s = 00001010, x ^= s\n      iteration 4: s = 00010100, x ^= s\n      x ^= 0x63\n\n      This can be done with a loop where s = (s << 1) | (s >> 7). However,\n      it can also be done by using a single 16-bit (in this case 32-bit)\n      number 'sx'. Since XOR is an associative operation, we can set 'sx'\n      to 'ei' and then XOR it with 'sx' left-shifted 1,2,3, and 4 times.\n      The most significant bits will flow into the high 8 bit positions\n      and be correctly XOR'd with one another. All that remains will be\n      to cycle the high 8 bits by XOR'ing them all with the lower 8 bits\n      afterwards.\n\n      At the same time we're populating sbox and isbox we can precompute\n      the multiplication we'll need to do to do MixColumns() later.\n    */\n\n    // apply affine transformation\n    sx = ei ^ (ei << 1) ^ (ei << 2) ^ (ei << 3) ^ (ei << 4);\n    sx = (sx >> 8) ^ (sx & 255) ^ 0x63;\n\n    // update tables\n    sbox[e] = sx;\n    isbox[sx] = e;\n\n    /* Mixing columns is done using matrix multiplication. The columns\n      that are to be mixed are each a single word in the current state.\n      The state has Nb columns (4 columns). Therefore each column is a\n      4 byte word. So to mix the columns in a single column 'c' where\n      its rows are r0, r1, r2, and r3, we use the following matrix\n      multiplication:\n\n      [2 3 1 1]*[r0,c]=[r'0,c]\n      [1 2 3 1] [r1,c] [r'1,c]\n      [1 1 2 3] [r2,c] [r'2,c]\n      [3 1 1 2] [r3,c] [r'3,c]\n\n      r0, r1, r2, and r3 are each 1 byte of one of the words in the\n      state (a column). To do matrix multiplication for each mixed\n      column c' we multiply the corresponding row from the left matrix\n      with the corresponding column from the right matrix. In total, we\n      get 4 equations:\n\n      r0,c' = 2*r0,c + 3*r1,c + 1*r2,c + 1*r3,c\n      r1,c' = 1*r0,c + 2*r1,c + 3*r2,c + 1*r3,c\n      r2,c' = 1*r0,c + 1*r1,c + 2*r2,c + 3*r3,c\n      r3,c' = 3*r0,c + 1*r1,c + 1*r2,c + 2*r3,c\n\n      As usual, the multiplication is as previously defined and the\n      addition is XOR. In order to optimize mixing columns we can store\n      the multiplication results in tables. If you think of the whole\n      column as a word (it might help to visualize by mentally rotating\n      the equations above by counterclockwise 90 degrees) then you can\n      see that it would be useful to map the multiplications performed on\n      each byte (r0, r1, r2, r3) onto a word as well. For instance, we\n      could map 2*r0,1*r0,1*r0,3*r0 onto a word by storing 2*r0 in the\n      highest 8 bits and 3*r0 in the lowest 8 bits (with the other two\n      respectively in the middle). This means that a table can be\n      constructed that uses r0 as an index to the word. We can do the\n      same with r1, r2, and r3, creating a total of 4 tables.\n\n      To construct a full c', we can just look up each byte of c in\n      their respective tables and XOR the results together.\n\n      Also, to build each table we only have to calculate the word\n      for 2,1,1,3 for every byte ... which we can do on each iteration\n      of this loop since we will iterate over every byte. After we have\n      calculated 2,1,1,3 we can get the results for the other tables\n      by cycling the byte at the end to the beginning. For instance\n      we can take the result of table 2,1,1,3 and produce table 3,2,1,1\n      by moving the right most byte to the left most position just like\n      how you can imagine the 3 moved out of 2,1,1,3 and to the front\n      to produce 3,2,1,1.\n\n      There is another optimization in that the same multiples of\n      the current element we need in order to advance our generator\n      to the next iteration can be reused in performing the 2,1,1,3\n      calculation. We also calculate the inverse mix column tables,\n      with e,9,d,b being the inverse of 2,1,1,3.\n\n      When we're done, and we need to actually mix columns, the first\n      byte of each state word should be put through mix[0] (2,1,1,3),\n      the second through mix[1] (3,2,1,1) and so forth. Then they should\n      be XOR'd together to produce the fully mixed column.\n    */\n\n    // calculate mix and imix table values\n    sx2 = xtime[sx];\n    e2 = xtime[e];\n    e4 = xtime[e2];\n    e8 = xtime[e4];\n    me =\n      (sx2 << 24) ^  // 2\n      (sx << 16) ^   // 1\n      (sx << 8) ^    // 1\n      (sx ^ sx2);    // 3\n    ime =\n      (e2 ^ e4 ^ e8) << 24 ^  // E (14)\n      (e ^ e8) << 16 ^        // 9\n      (e ^ e4 ^ e8) << 8 ^    // D (13)\n      (e ^ e2 ^ e8);          // B (11)\n    // produce each of the mix tables by rotating the 2,1,1,3 value\n    for(var n = 0; n < 4; ++n) {\n      mix[n][e] = me;\n      imix[n][sx] = ime;\n      // cycle the right most byte to the left most position\n      // ie: 2,1,1,3 becomes 3,2,1,1\n      me = me << 24 | me >>> 8;\n      ime = ime << 24 | ime >>> 8;\n    }\n\n    // get next element and inverse\n    if(e === 0) {\n      // 1 is the inverse of 1\n      e = ei = 1;\n    } else {\n      // e = 2e + 2*2*2*(10e)) = multiply e by 82 (chosen generator)\n      // ei = ei + 2*2*ei = multiply ei by 5 (inverse generator)\n      e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]];\n      ei ^= xtime[xtime[ei]];\n    }\n  }\n}\n\n/**\n * Generates a key schedule using the AES key expansion algorithm.\n *\n * The AES algorithm takes the Cipher Key, K, and performs a Key Expansion\n * routine to generate a key schedule. The Key Expansion generates a total\n * of Nb*(Nr + 1) words: the algorithm requires an initial set of Nb words,\n * and each of the Nr rounds requires Nb words of key data. The resulting\n * key schedule consists of a linear array of 4-byte words, denoted [wi ],\n * with i in the range 0 ≤ i < Nb(Nr + 1).\n *\n * KeyExpansion(byte key[4*Nk], word w[Nb*(Nr+1)], Nk)\n * AES-128 (Nb=4, Nk=4, Nr=10)\n * AES-192 (Nb=4, Nk=6, Nr=12)\n * AES-256 (Nb=4, Nk=8, Nr=14)\n * Note: Nr=Nk+6.\n *\n * Nb is the number of columns (32-bit words) comprising the State (or\n * number of bytes in a block). For AES, Nb=4.\n *\n * @param key the key to schedule (as an array of 32-bit words).\n * @param decrypt true to modify the key schedule to decrypt, false not to.\n *\n * @return the generated key schedule.\n */\nfunction _expandKey(key, decrypt) {\n  // copy the key's words to initialize the key schedule\n  var w = key.slice(0);\n\n  /* RotWord() will rotate a word, moving the first byte to the last\n    byte's position (shifting the other bytes left).\n\n    We will be getting the value of Rcon at i / Nk. 'i' will iterate\n    from Nk to (Nb * Nr+1). Nk = 4 (4 byte key), Nb = 4 (4 words in\n    a block), Nr = Nk + 6 (10). Therefore 'i' will iterate from\n    4 to 44 (exclusive). Each time we iterate 4 times, i / Nk will\n    increase by 1. We use a counter iNk to keep track of this.\n   */\n\n  // go through the rounds expanding the key\n  var temp, iNk = 1;\n  var Nk = w.length;\n  var Nr1 = Nk + 6 + 1;\n  var end = Nb * Nr1;\n  for(var i = Nk; i < end; ++i) {\n    temp = w[i - 1];\n    if(i % Nk === 0) {\n      // temp = SubWord(RotWord(temp)) ^ Rcon[i / Nk]\n      temp =\n        sbox[temp >>> 16 & 255] << 24 ^\n        sbox[temp >>> 8 & 255] << 16 ^\n        sbox[temp & 255] << 8 ^\n        sbox[temp >>> 24] ^ (rcon[iNk] << 24);\n      iNk++;\n    } else if(Nk > 6 && (i % Nk === 4)) {\n      // temp = SubWord(temp)\n      temp =\n        sbox[temp >>> 24] << 24 ^\n        sbox[temp >>> 16 & 255] << 16 ^\n        sbox[temp >>> 8 & 255] << 8 ^\n        sbox[temp & 255];\n    }\n    w[i] = w[i - Nk] ^ temp;\n  }\n\n   /* When we are updating a cipher block we always use the code path for\n     encryption whether we are decrypting or not (to shorten code and\n     simplify the generation of look up tables). However, because there\n     are differences in the decryption algorithm, other than just swapping\n     in different look up tables, we must transform our key schedule to\n     account for these changes:\n\n     1. The decryption algorithm gets its key rounds in reverse order.\n     2. The decryption algorithm adds the round key before mixing columns\n       instead of afterwards.\n\n     We don't need to modify our key schedule to handle the first case,\n     we can just traverse the key schedule in reverse order when decrypting.\n\n     The second case requires a little work.\n\n     The tables we built for performing rounds will take an input and then\n     perform SubBytes() and MixColumns() or, for the decrypt version,\n     InvSubBytes() and InvMixColumns(). But the decrypt algorithm requires\n     us to AddRoundKey() before InvMixColumns(). This means we'll need to\n     apply some transformations to the round key to inverse-mix its columns\n     so they'll be correct for moving AddRoundKey() to after the state has\n     had its columns inverse-mixed.\n\n     To inverse-mix the columns of the state when we're decrypting we use a\n     lookup table that will apply InvSubBytes() and InvMixColumns() at the\n     same time. However, the round key's bytes are not inverse-substituted\n     in the decryption algorithm. To get around this problem, we can first\n     substitute the bytes in the round key so that when we apply the\n     transformation via the InvSubBytes()+InvMixColumns() table, it will\n     undo our substitution leaving us with the original value that we\n     want -- and then inverse-mix that value.\n\n     This change will correctly alter our key schedule so that we can XOR\n     each round key with our already transformed decryption state. This\n     allows us to use the same code path as the encryption algorithm.\n\n     We make one more change to the decryption key. Since the decryption\n     algorithm runs in reverse from the encryption algorithm, we reverse\n     the order of the round keys to avoid having to iterate over the key\n     schedule backwards when running the encryption algorithm later in\n     decryption mode. In addition to reversing the order of the round keys,\n     we also swap each round key's 2nd and 4th rows. See the comments\n     section where rounds are performed for more details about why this is\n     done. These changes are done inline with the other substitution\n     described above.\n  */\n  if(decrypt) {\n    var tmp;\n    var m0 = imix[0];\n    var m1 = imix[1];\n    var m2 = imix[2];\n    var m3 = imix[3];\n    var wnew = w.slice(0);\n    end = w.length;\n    for(var i = 0, wi = end - Nb; i < end; i += Nb, wi -= Nb) {\n      // do not sub the first or last round key (round keys are Nb\n      // words) as no column mixing is performed before they are added,\n      // but do change the key order\n      if(i === 0 || i === (end - Nb)) {\n        wnew[i] = w[wi];\n        wnew[i + 1] = w[wi + 3];\n        wnew[i + 2] = w[wi + 2];\n        wnew[i + 3] = w[wi + 1];\n      } else {\n        // substitute each round key byte because the inverse-mix\n        // table will inverse-substitute it (effectively cancel the\n        // substitution because round key bytes aren't sub'd in\n        // decryption mode) and swap indexes 3 and 1\n        for(var n = 0; n < Nb; ++n) {\n          tmp = w[wi + n];\n          wnew[i + (3&-n)] =\n            m0[sbox[tmp >>> 24]] ^\n            m1[sbox[tmp >>> 16 & 255]] ^\n            m2[sbox[tmp >>> 8 & 255]] ^\n            m3[sbox[tmp & 255]];\n        }\n      }\n    }\n    w = wnew;\n  }\n\n  return w;\n}\n\n/**\n * Updates a single block (16 bytes) using AES. The update will either\n * encrypt or decrypt the block.\n *\n * @param w the key schedule.\n * @param input the input block (an array of 32-bit words).\n * @param output the updated output block.\n * @param decrypt true to decrypt the block, false to encrypt it.\n */\nfunction _updateBlock(w, input, output, decrypt) {\n  /*\n  Cipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)])\n  begin\n    byte state[4,Nb]\n    state = in\n    AddRoundKey(state, w[0, Nb-1])\n    for round = 1 step 1 to Nr–1\n      SubBytes(state)\n      ShiftRows(state)\n      MixColumns(state)\n      AddRoundKey(state, w[round*Nb, (round+1)*Nb-1])\n    end for\n    SubBytes(state)\n    ShiftRows(state)\n    AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n    out = state\n  end\n\n  InvCipher(byte in[4*Nb], byte out[4*Nb], word w[Nb*(Nr+1)])\n  begin\n    byte state[4,Nb]\n    state = in\n    AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n    for round = Nr-1 step -1 downto 1\n      InvShiftRows(state)\n      InvSubBytes(state)\n      AddRoundKey(state, w[round*Nb, (round+1)*Nb-1])\n      InvMixColumns(state)\n    end for\n    InvShiftRows(state)\n    InvSubBytes(state)\n    AddRoundKey(state, w[0, Nb-1])\n    out = state\n  end\n  */\n\n  // Encrypt: AddRoundKey(state, w[0, Nb-1])\n  // Decrypt: AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n  var Nr = w.length / 4 - 1;\n  var m0, m1, m2, m3, sub;\n  if(decrypt) {\n    m0 = imix[0];\n    m1 = imix[1];\n    m2 = imix[2];\n    m3 = imix[3];\n    sub = isbox;\n  } else {\n    m0 = mix[0];\n    m1 = mix[1];\n    m2 = mix[2];\n    m3 = mix[3];\n    sub = sbox;\n  }\n  var a, b, c, d, a2, b2, c2;\n  a = input[0] ^ w[0];\n  b = input[decrypt ? 3 : 1] ^ w[1];\n  c = input[2] ^ w[2];\n  d = input[decrypt ? 1 : 3] ^ w[3];\n  var i = 3;\n\n  /* In order to share code we follow the encryption algorithm when both\n    encrypting and decrypting. To account for the changes required in the\n    decryption algorithm, we use different lookup tables when decrypting\n    and use a modified key schedule to account for the difference in the\n    order of transformations applied when performing rounds. We also get\n    key rounds in reverse order (relative to encryption). */\n  for(var round = 1; round < Nr; ++round) {\n    /* As described above, we'll be using table lookups to perform the\n      column mixing. Each column is stored as a word in the state (the\n      array 'input' has one column as a word at each index). In order to\n      mix a column, we perform these transformations on each row in c,\n      which is 1 byte in each word. The new column for c0 is c'0:\n\n               m0      m1      m2      m3\n      r0,c'0 = 2*r0,c0 + 3*r1,c0 + 1*r2,c0 + 1*r3,c0\n      r1,c'0 = 1*r0,c0 + 2*r1,c0 + 3*r2,c0 + 1*r3,c0\n      r2,c'0 = 1*r0,c0 + 1*r1,c0 + 2*r2,c0 + 3*r3,c0\n      r3,c'0 = 3*r0,c0 + 1*r1,c0 + 1*r2,c0 + 2*r3,c0\n\n      So using mix tables where c0 is a word with r0 being its upper\n      8 bits and r3 being its lower 8 bits:\n\n      m0[c0 >> 24] will yield this word: [2*r0,1*r0,1*r0,3*r0]\n      ...\n      m3[c0 & 255] will yield this word: [1*r3,1*r3,3*r3,2*r3]\n\n      Therefore to mix the columns in each word in the state we\n      do the following (& 255 omitted for brevity):\n      c'0,r0 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n      c'0,r1 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n      c'0,r2 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n      c'0,r3 = m0[c0 >> 24] ^ m1[c1 >> 16] ^ m2[c2 >> 8] ^ m3[c3]\n\n      However, before mixing, the algorithm requires us to perform\n      ShiftRows(). The ShiftRows() transformation cyclically shifts the\n      last 3 rows of the state over different offsets. The first row\n      (r = 0) is not shifted.\n\n      s'_r,c = s_r,(c + shift(r, Nb) mod Nb\n      for 0 < r < 4 and 0 <= c < Nb and\n      shift(1, 4) = 1\n      shift(2, 4) = 2\n      shift(3, 4) = 3.\n\n      This causes the first byte in r = 1 to be moved to the end of\n      the row, the first 2 bytes in r = 2 to be moved to the end of\n      the row, the first 3 bytes in r = 3 to be moved to the end of\n      the row:\n\n      r1: [c0 c1 c2 c3] => [c1 c2 c3 c0]\n      r2: [c0 c1 c2 c3]    [c2 c3 c0 c1]\n      r3: [c0 c1 c2 c3]    [c3 c0 c1 c2]\n\n      We can make these substitutions inline with our column mixing to\n      generate an updated set of equations to produce each word in the\n      state (note the columns have changed positions):\n\n      c0 c1 c2 c3 => c0 c1 c2 c3\n      c0 c1 c2 c3    c1 c2 c3 c0  (cycled 1 byte)\n      c0 c1 c2 c3    c2 c3 c0 c1  (cycled 2 bytes)\n      c0 c1 c2 c3    c3 c0 c1 c2  (cycled 3 bytes)\n\n      Therefore:\n\n      c'0 = 2*r0,c0 + 3*r1,c1 + 1*r2,c2 + 1*r3,c3\n      c'0 = 1*r0,c0 + 2*r1,c1 + 3*r2,c2 + 1*r3,c3\n      c'0 = 1*r0,c0 + 1*r1,c1 + 2*r2,c2 + 3*r3,c3\n      c'0 = 3*r0,c0 + 1*r1,c1 + 1*r2,c2 + 2*r3,c3\n\n      c'1 = 2*r0,c1 + 3*r1,c2 + 1*r2,c3 + 1*r3,c0\n      c'1 = 1*r0,c1 + 2*r1,c2 + 3*r2,c3 + 1*r3,c0\n      c'1 = 1*r0,c1 + 1*r1,c2 + 2*r2,c3 + 3*r3,c0\n      c'1 = 3*r0,c1 + 1*r1,c2 + 1*r2,c3 + 2*r3,c0\n\n      ... and so forth for c'2 and c'3. The important distinction is\n      that the columns are cycling, with c0 being used with the m0\n      map when calculating c0, but c1 being used with the m0 map when\n      calculating c1 ... and so forth.\n\n      When performing the inverse we transform the mirror image and\n      skip the bottom row, instead of the top one, and move upwards:\n\n      c3 c2 c1 c0 => c0 c3 c2 c1  (cycled 3 bytes) *same as encryption\n      c3 c2 c1 c0    c1 c0 c3 c2  (cycled 2 bytes)\n      c3 c2 c1 c0    c2 c1 c0 c3  (cycled 1 byte)  *same as encryption\n      c3 c2 c1 c0    c3 c2 c1 c0\n\n      If you compare the resulting matrices for ShiftRows()+MixColumns()\n      and for InvShiftRows()+InvMixColumns() the 2nd and 4th columns are\n      different (in encrypt mode vs. decrypt mode). So in order to use\n      the same code to handle both encryption and decryption, we will\n      need to do some mapping.\n\n      If in encryption mode we let a=c0, b=c1, c=c2, d=c3, and r<N> be\n      a row number in the state, then the resulting matrix in encryption\n      mode for applying the above transformations would be:\n\n      r1: a b c d\n      r2: b c d a\n      r3: c d a b\n      r4: d a b c\n\n      If we did the same in decryption mode we would get:\n\n      r1: a d c b\n      r2: b a d c\n      r3: c b a d\n      r4: d c b a\n\n      If instead we swap d and b (set b=c3 and d=c1), then we get:\n\n      r1: a b c d\n      r2: d a b c\n      r3: c d a b\n      r4: b c d a\n\n      Now the 1st and 3rd rows are the same as the encryption matrix. All\n      we need to do then to make the mapping exactly the same is to swap\n      the 2nd and 4th rows when in decryption mode. To do this without\n      having to do it on each iteration, we swapped the 2nd and 4th rows\n      in the decryption key schedule. We also have to do the swap above\n      when we first pull in the input and when we set the final output. */\n    a2 =\n      m0[a >>> 24] ^\n      m1[b >>> 16 & 255] ^\n      m2[c >>> 8 & 255] ^\n      m3[d & 255] ^ w[++i];\n    b2 =\n      m0[b >>> 24] ^\n      m1[c >>> 16 & 255] ^\n      m2[d >>> 8 & 255] ^\n      m3[a & 255] ^ w[++i];\n    c2 =\n      m0[c >>> 24] ^\n      m1[d >>> 16 & 255] ^\n      m2[a >>> 8 & 255] ^\n      m3[b & 255] ^ w[++i];\n    d =\n      m0[d >>> 24] ^\n      m1[a >>> 16 & 255] ^\n      m2[b >>> 8 & 255] ^\n      m3[c & 255] ^ w[++i];\n    a = a2;\n    b = b2;\n    c = c2;\n  }\n\n  /*\n    Encrypt:\n    SubBytes(state)\n    ShiftRows(state)\n    AddRoundKey(state, w[Nr*Nb, (Nr+1)*Nb-1])\n\n    Decrypt:\n    InvShiftRows(state)\n    InvSubBytes(state)\n    AddRoundKey(state, w[0, Nb-1])\n   */\n   // Note: rows are shifted inline\n  output[0] =\n    (sub[a >>> 24] << 24) ^\n    (sub[b >>> 16 & 255] << 16) ^\n    (sub[c >>> 8 & 255] << 8) ^\n    (sub[d & 255]) ^ w[++i];\n  output[decrypt ? 3 : 1] =\n    (sub[b >>> 24] << 24) ^\n    (sub[c >>> 16 & 255] << 16) ^\n    (sub[d >>> 8 & 255] << 8) ^\n    (sub[a & 255]) ^ w[++i];\n  output[2] =\n    (sub[c >>> 24] << 24) ^\n    (sub[d >>> 16 & 255] << 16) ^\n    (sub[a >>> 8 & 255] << 8) ^\n    (sub[b & 255]) ^ w[++i];\n  output[decrypt ? 1 : 3] =\n    (sub[d >>> 24] << 24) ^\n    (sub[a >>> 16 & 255] << 16) ^\n    (sub[b >>> 8 & 255] << 8) ^\n    (sub[c & 255]) ^ w[++i];\n}\n\n/**\n * Deprecated. Instead, use:\n *\n * forge.cipher.createCipher('AES-<mode>', key);\n * forge.cipher.createDecipher('AES-<mode>', key);\n *\n * Creates a deprecated AES cipher object. This object's mode will default to\n * CBC (cipher-block-chaining).\n *\n * The key and iv may be given as a string of bytes, an array of bytes, a\n * byte buffer, or an array of 32-bit words.\n *\n * @param options the options to use.\n *          key the symmetric key to use.\n *          output the buffer to write to.\n *          decrypt true for decryption, false for encryption.\n *          mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nfunction _createCipher(options) {\n  options = options || {};\n  var mode = (options.mode || 'CBC').toUpperCase();\n  var algorithm = 'AES-' + mode;\n\n  var cipher;\n  if(options.decrypt) {\n    cipher = forge.cipher.createDecipher(algorithm, options.key);\n  } else {\n    cipher = forge.cipher.createCipher(algorithm, options.key);\n  }\n\n  // backwards compatible start API\n  var start = cipher.start;\n  cipher.start = function(iv, options) {\n    // backwards compatibility: support second arg as output buffer\n    var output = null;\n    if(options instanceof forge.util.ByteBuffer) {\n      output = options;\n      options = {};\n    }\n    options = options || {};\n    options.output = output;\n    options.iv = iv;\n    start.call(cipher, options);\n  };\n\n  return cipher;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/aes.js\n// module id = 100\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/aes.js")},function(module,exports,__webpack_require__){eval("/**\n * Object IDs for ASN.1.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n\nforge.pki = forge.pki || {};\nvar oids = module.exports = forge.pki.oids = forge.oids = forge.oids || {};\n\n// set id to name mapping and name to id mapping\nfunction _IN(id, name) {\n  oids[id] = name;\n  oids[name] = id;\n}\n// set id to name mapping only\nfunction _I_(id, name) {\n  oids[id] = name;\n}\n\n// algorithm OIDs\n_IN('1.2.840.113549.1.1.1', 'rsaEncryption');\n// Note: md2 & md4 not implemented\n//_IN('1.2.840.113549.1.1.2', 'md2WithRSAEncryption');\n//_IN('1.2.840.113549.1.1.3', 'md4WithRSAEncryption');\n_IN('1.2.840.113549.1.1.4', 'md5WithRSAEncryption');\n_IN('1.2.840.113549.1.1.5', 'sha1WithRSAEncryption');\n_IN('1.2.840.113549.1.1.7', 'RSAES-OAEP');\n_IN('1.2.840.113549.1.1.8', 'mgf1');\n_IN('1.2.840.113549.1.1.9', 'pSpecified');\n_IN('1.2.840.113549.1.1.10', 'RSASSA-PSS');\n_IN('1.2.840.113549.1.1.11', 'sha256WithRSAEncryption');\n_IN('1.2.840.113549.1.1.12', 'sha384WithRSAEncryption');\n_IN('1.2.840.113549.1.1.13', 'sha512WithRSAEncryption');\n\n_IN('1.2.840.10040.4.3', 'dsa-with-sha1');\n\n_IN('1.3.14.3.2.7', 'desCBC');\n\n_IN('1.3.14.3.2.26', 'sha1');\n_IN('2.16.840.1.101.3.4.2.1', 'sha256');\n_IN('2.16.840.1.101.3.4.2.2', 'sha384');\n_IN('2.16.840.1.101.3.4.2.3', 'sha512');\n_IN('1.2.840.113549.2.5', 'md5');\n\n// pkcs#7 content types\n_IN('1.2.840.113549.1.7.1', 'data');\n_IN('1.2.840.113549.1.7.2', 'signedData');\n_IN('1.2.840.113549.1.7.3', 'envelopedData');\n_IN('1.2.840.113549.1.7.4', 'signedAndEnvelopedData');\n_IN('1.2.840.113549.1.7.5', 'digestedData');\n_IN('1.2.840.113549.1.7.6', 'encryptedData');\n\n// pkcs#9 oids\n_IN('1.2.840.113549.1.9.1', 'emailAddress');\n_IN('1.2.840.113549.1.9.2', 'unstructuredName');\n_IN('1.2.840.113549.1.9.3', 'contentType');\n_IN('1.2.840.113549.1.9.4', 'messageDigest');\n_IN('1.2.840.113549.1.9.5', 'signingTime');\n_IN('1.2.840.113549.1.9.6', 'counterSignature');\n_IN('1.2.840.113549.1.9.7', 'challengePassword');\n_IN('1.2.840.113549.1.9.8', 'unstructuredAddress');\n_IN('1.2.840.113549.1.9.14', 'extensionRequest');\n\n_IN('1.2.840.113549.1.9.20', 'friendlyName');\n_IN('1.2.840.113549.1.9.21', 'localKeyId');\n_IN('1.2.840.113549.1.9.22.1', 'x509Certificate');\n\n// pkcs#12 safe bags\n_IN('1.2.840.113549.1.12.10.1.1', 'keyBag');\n_IN('1.2.840.113549.1.12.10.1.2', 'pkcs8ShroudedKeyBag');\n_IN('1.2.840.113549.1.12.10.1.3', 'certBag');\n_IN('1.2.840.113549.1.12.10.1.4', 'crlBag');\n_IN('1.2.840.113549.1.12.10.1.5', 'secretBag');\n_IN('1.2.840.113549.1.12.10.1.6', 'safeContentsBag');\n\n// password-based-encryption for pkcs#12\n_IN('1.2.840.113549.1.5.13', 'pkcs5PBES2');\n_IN('1.2.840.113549.1.5.12', 'pkcs5PBKDF2');\n\n_IN('1.2.840.113549.1.12.1.1', 'pbeWithSHAAnd128BitRC4');\n_IN('1.2.840.113549.1.12.1.2', 'pbeWithSHAAnd40BitRC4');\n_IN('1.2.840.113549.1.12.1.3', 'pbeWithSHAAnd3-KeyTripleDES-CBC');\n_IN('1.2.840.113549.1.12.1.4', 'pbeWithSHAAnd2-KeyTripleDES-CBC');\n_IN('1.2.840.113549.1.12.1.5', 'pbeWithSHAAnd128BitRC2-CBC');\n_IN('1.2.840.113549.1.12.1.6', 'pbewithSHAAnd40BitRC2-CBC');\n\n// hmac OIDs\n_IN('1.2.840.113549.2.7', 'hmacWithSHA1');\n_IN('1.2.840.113549.2.8', 'hmacWithSHA224');\n_IN('1.2.840.113549.2.9', 'hmacWithSHA256');\n_IN('1.2.840.113549.2.10', 'hmacWithSHA384');\n_IN('1.2.840.113549.2.11', 'hmacWithSHA512');\n\n// symmetric key algorithm oids\n_IN('1.2.840.113549.3.7', 'des-EDE3-CBC');\n_IN('2.16.840.1.101.3.4.1.2', 'aes128-CBC');\n_IN('2.16.840.1.101.3.4.1.22', 'aes192-CBC');\n_IN('2.16.840.1.101.3.4.1.42', 'aes256-CBC');\n\n// certificate issuer/subject OIDs\n_IN('2.5.4.3', 'commonName');\n_IN('2.5.4.5', 'serialName');\n_IN('2.5.4.6', 'countryName');\n_IN('2.5.4.7', 'localityName');\n_IN('2.5.4.8', 'stateOrProvinceName');\n_IN('2.5.4.10', 'organizationName');\n_IN('2.5.4.11', 'organizationalUnitName');\n\n// X.509 extension OIDs\n_IN('2.16.840.1.113730.1.1', 'nsCertType');\n_I_('2.5.29.1', 'authorityKeyIdentifier'); // deprecated, use .35\n_I_('2.5.29.2', 'keyAttributes'); // obsolete use .37 or .15\n_I_('2.5.29.3', 'certificatePolicies'); // deprecated, use .32\n_I_('2.5.29.4', 'keyUsageRestriction'); // obsolete use .37 or .15\n_I_('2.5.29.5', 'policyMapping'); // deprecated use .33\n_I_('2.5.29.6', 'subtreesConstraint'); // obsolete use .30\n_I_('2.5.29.7', 'subjectAltName'); // deprecated use .17\n_I_('2.5.29.8', 'issuerAltName'); // deprecated use .18\n_I_('2.5.29.9', 'subjectDirectoryAttributes');\n_I_('2.5.29.10', 'basicConstraints'); // deprecated use .19\n_I_('2.5.29.11', 'nameConstraints'); // deprecated use .30\n_I_('2.5.29.12', 'policyConstraints'); // deprecated use .36\n_I_('2.5.29.13', 'basicConstraints'); // deprecated use .19\n_IN('2.5.29.14', 'subjectKeyIdentifier');\n_IN('2.5.29.15', 'keyUsage');\n_I_('2.5.29.16', 'privateKeyUsagePeriod');\n_IN('2.5.29.17', 'subjectAltName');\n_IN('2.5.29.18', 'issuerAltName');\n_IN('2.5.29.19', 'basicConstraints');\n_I_('2.5.29.20', 'cRLNumber');\n_I_('2.5.29.21', 'cRLReason');\n_I_('2.5.29.22', 'expirationDate');\n_I_('2.5.29.23', 'instructionCode');\n_I_('2.5.29.24', 'invalidityDate');\n_I_('2.5.29.25', 'cRLDistributionPoints'); // deprecated use .31\n_I_('2.5.29.26', 'issuingDistributionPoint'); // deprecated use .28\n_I_('2.5.29.27', 'deltaCRLIndicator');\n_I_('2.5.29.28', 'issuingDistributionPoint');\n_I_('2.5.29.29', 'certificateIssuer');\n_I_('2.5.29.30', 'nameConstraints');\n_IN('2.5.29.31', 'cRLDistributionPoints');\n_IN('2.5.29.32', 'certificatePolicies');\n_I_('2.5.29.33', 'policyMappings');\n_I_('2.5.29.34', 'policyConstraints'); // deprecated use .36\n_IN('2.5.29.35', 'authorityKeyIdentifier');\n_I_('2.5.29.36', 'policyConstraints');\n_IN('2.5.29.37', 'extKeyUsage');\n_I_('2.5.29.46', 'freshestCRL');\n_I_('2.5.29.54', 'inhibitAnyPolicy');\n\n// extKeyUsage purposes\n_IN('1.3.6.1.4.1.11129.2.4.2', 'timestampList');\n_IN('1.3.6.1.5.5.7.1.1', 'authorityInfoAccess');\n_IN('1.3.6.1.5.5.7.3.1', 'serverAuth');\n_IN('1.3.6.1.5.5.7.3.2', 'clientAuth');\n_IN('1.3.6.1.5.5.7.3.3', 'codeSigning');\n_IN('1.3.6.1.5.5.7.3.4', 'emailProtection');\n_IN('1.3.6.1.5.5.7.3.8', 'timeStamping');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/oids.js\n// module id = 101\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/oids.js")},function(module,exports,__webpack_require__){eval("var Reader = __webpack_require__(516)\nvar Writer = __webpack_require__(54)\nvar cat = __webpack_require__(300)\nvar pair = __webpack_require__(205)\n\nfunction once (cb) {\n  var called = 0\n  return function (a, b, c) {\n    if(called++) return\n    cb(a, b, c)\n  }\n}\n\nfunction isFunction (f) {\n  return 'function' === typeof f\n}\n\nmodule.exports = function (opts, _cb) {\n  if(isFunction(opts)) _cb = opts, opts = {}\n  _cb = once(_cb || function noop () {})\n  var reader = Reader(opts && opts.timeout || 5e3)\n  var writer = Writer(function (err) {\n    if(err) _cb(err)\n  })\n\n  var p = pair()\n\n  return {\n    handshake: {\n      read: reader.read,\n      abort: function (err) {\n        writer.end(err)\n        reader.abort(err, function (err) {\n        })\n        _cb(err)\n      },\n      write: writer.push,\n      rest: function () {\n        writer.end()\n        return {\n          source: reader.read(),\n          sink: p.sink\n        }\n      }\n    },\n    sink: reader,\n    source: cat([writer, p.source])\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-handshake/index.js\n// module id = 102\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-handshake/index.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\n\n\n/*<replacement>*/\n\nvar processNextTick = __webpack_require__(203).nextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n  var keys = [];\n  for (var key in obj) {\n    keys.push(key);\n  }return keys;\n};\n/*</replacement>*/\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nvar Readable = __webpack_require__(526);\nvar Writable = __webpack_require__(305);\n\nutil.inherits(Duplex, Readable);\n\nvar keys = objectKeys(Writable.prototype);\nfor (var v = 0; v < keys.length; v++) {\n  var method = keys[v];\n  if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\n}\n\nfunction Duplex(options) {\n  if (!(this instanceof Duplex)) return new Duplex(options);\n\n  Readable.call(this, options);\n  Writable.call(this, options);\n\n  if (options && options.readable === false) this.readable = false;\n\n  if (options && options.writable === false) this.writable = false;\n\n  this.allowHalfOpen = true;\n  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\n\n  this.once('end', onend);\n}\n\n// the no-half-open enforcer\nfunction onend() {\n  // if we allow half-open state, or if the writable side ended,\n  // then we're ok.\n  if (this.allowHalfOpen || this._writableState.ended) return;\n\n  // no more data can be written.\n  // But allow more writes to happen in this tick.\n  processNextTick(onEndNT, this);\n}\n\nfunction onEndNT(self) {\n  self.end();\n}\n\nObject.defineProperty(Duplex.prototype, 'destroyed', {\n  get: function () {\n    if (this._readableState === undefined || this._writableState === undefined) {\n      return false;\n    }\n    return this._readableState.destroyed && this._writableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (this._readableState === undefined || this._writableState === undefined) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._readableState.destroyed = value;\n    this._writableState.destroyed = value;\n  }\n});\n\nDuplex.prototype._destroy = function (err, cb) {\n  this.push(null);\n  this.end();\n\n  processNextTick(cb, err);\n};\n\nfunction forEach(xs, f) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    f(xs[i], i);\n  }\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_duplex.js\n// module id = 103\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/_stream_duplex.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n  if (!isString(f)) {\n    var objects = [];\n    for (var i = 0; i < arguments.length; i++) {\n      objects.push(inspect(arguments[i]));\n    }\n    return objects.join(' ');\n  }\n\n  var i = 1;\n  var args = arguments;\n  var len = args.length;\n  var str = String(f).replace(formatRegExp, function(x) {\n    if (x === '%%') return '%';\n    if (i >= len) return x;\n    switch (x) {\n      case '%s': return String(args[i++]);\n      case '%d': return Number(args[i++]);\n      case '%j':\n        try {\n          return JSON.stringify(args[i++]);\n        } catch (_) {\n          return '[Circular]';\n        }\n      default:\n        return x;\n    }\n  });\n  for (var x = args[i]; i < len; x = args[++i]) {\n    if (isNull(x) || !isObject(x)) {\n      str += ' ' + x;\n    } else {\n      str += ' ' + inspect(x);\n    }\n  }\n  return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n  // Allow for deprecating things in the process of starting up.\n  if (isUndefined(global.process)) {\n    return function() {\n      return exports.deprecate(fn, msg).apply(this, arguments);\n    };\n  }\n\n  if (process.noDeprecation === true) {\n    return fn;\n  }\n\n  var warned = false;\n  function deprecated() {\n    if (!warned) {\n      if (process.throwDeprecation) {\n        throw new Error(msg);\n      } else if (process.traceDeprecation) {\n        console.trace(msg);\n      } else {\n        console.error(msg);\n      }\n      warned = true;\n    }\n    return fn.apply(this, arguments);\n  }\n\n  return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n  if (isUndefined(debugEnviron))\n    debugEnviron = __webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}).NODE_DEBUG || '';\n  set = set.toUpperCase();\n  if (!debugs[set]) {\n    if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n      var pid = process.pid;\n      debugs[set] = function() {\n        var msg = exports.format.apply(exports, arguments);\n        console.error('%s %d: %s', set, pid, msg);\n      };\n    } else {\n      debugs[set] = function() {};\n    }\n  }\n  return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n  // default options\n  var ctx = {\n    seen: [],\n    stylize: stylizeNoColor\n  };\n  // legacy...\n  if (arguments.length >= 3) ctx.depth = arguments[2];\n  if (arguments.length >= 4) ctx.colors = arguments[3];\n  if (isBoolean(opts)) {\n    // legacy...\n    ctx.showHidden = opts;\n  } else if (opts) {\n    // got an \"options\" object\n    exports._extend(ctx, opts);\n  }\n  // set default options\n  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n  if (isUndefined(ctx.depth)) ctx.depth = 2;\n  if (isUndefined(ctx.colors)) ctx.colors = false;\n  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n  if (ctx.colors) ctx.stylize = stylizeWithColor;\n  return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n  'bold' : [1, 22],\n  'italic' : [3, 23],\n  'underline' : [4, 24],\n  'inverse' : [7, 27],\n  'white' : [37, 39],\n  'grey' : [90, 39],\n  'black' : [30, 39],\n  'blue' : [34, 39],\n  'cyan' : [36, 39],\n  'green' : [32, 39],\n  'magenta' : [35, 39],\n  'red' : [31, 39],\n  'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n  'special': 'cyan',\n  'number': 'yellow',\n  'boolean': 'yellow',\n  'undefined': 'grey',\n  'null': 'bold',\n  'string': 'green',\n  'date': 'magenta',\n  // \"name\": intentionally not styling\n  'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n  var style = inspect.styles[styleType];\n\n  if (style) {\n    return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n           '\\u001b[' + inspect.colors[style][1] + 'm';\n  } else {\n    return str;\n  }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n  return str;\n}\n\n\nfunction arrayToHash(array) {\n  var hash = {};\n\n  array.forEach(function(val, idx) {\n    hash[val] = true;\n  });\n\n  return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n  // Provide a hook for user-specified inspect functions.\n  // Check that value is an object with an inspect function on it\n  if (ctx.customInspect &&\n      value &&\n      isFunction(value.inspect) &&\n      // Filter out the util module, it's inspect function is special\n      value.inspect !== exports.inspect &&\n      // Also filter out any prototype objects using the circular check.\n      !(value.constructor && value.constructor.prototype === value)) {\n    var ret = value.inspect(recurseTimes, ctx);\n    if (!isString(ret)) {\n      ret = formatValue(ctx, ret, recurseTimes);\n    }\n    return ret;\n  }\n\n  // Primitive types cannot have properties\n  var primitive = formatPrimitive(ctx, value);\n  if (primitive) {\n    return primitive;\n  }\n\n  // Look up the keys of the object.\n  var keys = Object.keys(value);\n  var visibleKeys = arrayToHash(keys);\n\n  if (ctx.showHidden) {\n    keys = Object.getOwnPropertyNames(value);\n  }\n\n  // IE doesn't make error fields non-enumerable\n  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n  if (isError(value)\n      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n    return formatError(value);\n  }\n\n  // Some type of object without properties can be shortcutted.\n  if (keys.length === 0) {\n    if (isFunction(value)) {\n      var name = value.name ? ': ' + value.name : '';\n      return ctx.stylize('[Function' + name + ']', 'special');\n    }\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    }\n    if (isDate(value)) {\n      return ctx.stylize(Date.prototype.toString.call(value), 'date');\n    }\n    if (isError(value)) {\n      return formatError(value);\n    }\n  }\n\n  var base = '', array = false, braces = ['{', '}'];\n\n  // Make Array say that they are Array\n  if (isArray(value)) {\n    array = true;\n    braces = ['[', ']'];\n  }\n\n  // Make functions say that they are functions\n  if (isFunction(value)) {\n    var n = value.name ? ': ' + value.name : '';\n    base = ' [Function' + n + ']';\n  }\n\n  // Make RegExps say that they are RegExps\n  if (isRegExp(value)) {\n    base = ' ' + RegExp.prototype.toString.call(value);\n  }\n\n  // Make dates with properties first say the date\n  if (isDate(value)) {\n    base = ' ' + Date.prototype.toUTCString.call(value);\n  }\n\n  // Make error with message first say the error\n  if (isError(value)) {\n    base = ' ' + formatError(value);\n  }\n\n  if (keys.length === 0 && (!array || value.length == 0)) {\n    return braces[0] + base + braces[1];\n  }\n\n  if (recurseTimes < 0) {\n    if (isRegExp(value)) {\n      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n    } else {\n      return ctx.stylize('[Object]', 'special');\n    }\n  }\n\n  ctx.seen.push(value);\n\n  var output;\n  if (array) {\n    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n  } else {\n    output = keys.map(function(key) {\n      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n    });\n  }\n\n  ctx.seen.pop();\n\n  return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n  if (isUndefined(value))\n    return ctx.stylize('undefined', 'undefined');\n  if (isString(value)) {\n    var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n                                             .replace(/'/g, \"\\\\'\")\n                                             .replace(/\\\\\"/g, '\"') + '\\'';\n    return ctx.stylize(simple, 'string');\n  }\n  if (isNumber(value))\n    return ctx.stylize('' + value, 'number');\n  if (isBoolean(value))\n    return ctx.stylize('' + value, 'boolean');\n  // For some reason typeof null is \"object\", so special case here.\n  if (isNull(value))\n    return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n  return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n  var output = [];\n  for (var i = 0, l = value.length; i < l; ++i) {\n    if (hasOwnProperty(value, String(i))) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          String(i), true));\n    } else {\n      output.push('');\n    }\n  }\n  keys.forEach(function(key) {\n    if (!key.match(/^\\d+$/)) {\n      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n          key, true));\n    }\n  });\n  return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n  var name, str, desc;\n  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n  if (desc.get) {\n    if (desc.set) {\n      str = ctx.stylize('[Getter/Setter]', 'special');\n    } else {\n      str = ctx.stylize('[Getter]', 'special');\n    }\n  } else {\n    if (desc.set) {\n      str = ctx.stylize('[Setter]', 'special');\n    }\n  }\n  if (!hasOwnProperty(visibleKeys, key)) {\n    name = '[' + key + ']';\n  }\n  if (!str) {\n    if (ctx.seen.indexOf(desc.value) < 0) {\n      if (isNull(recurseTimes)) {\n        str = formatValue(ctx, desc.value, null);\n      } else {\n        str = formatValue(ctx, desc.value, recurseTimes - 1);\n      }\n      if (str.indexOf('\\n') > -1) {\n        if (array) {\n          str = str.split('\\n').map(function(line) {\n            return '  ' + line;\n          }).join('\\n').substr(2);\n        } else {\n          str = '\\n' + str.split('\\n').map(function(line) {\n            return '   ' + line;\n          }).join('\\n');\n        }\n      }\n    } else {\n      str = ctx.stylize('[Circular]', 'special');\n    }\n  }\n  if (isUndefined(name)) {\n    if (array && key.match(/^\\d+$/)) {\n      return str;\n    }\n    name = JSON.stringify('' + key);\n    if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n      name = name.substr(1, name.length - 2);\n      name = ctx.stylize(name, 'name');\n    } else {\n      name = name.replace(/'/g, \"\\\\'\")\n                 .replace(/\\\\\"/g, '\"')\n                 .replace(/(^\"|\"$)/g, \"'\");\n      name = ctx.stylize(name, 'string');\n    }\n  }\n\n  return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n  var numLinesEst = 0;\n  var length = output.reduce(function(prev, cur) {\n    numLinesEst++;\n    if (cur.indexOf('\\n') >= 0) numLinesEst++;\n    return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n  }, 0);\n\n  if (length > 60) {\n    return braces[0] +\n           (base === '' ? '' : base + '\\n ') +\n           ' ' +\n           output.join(',\\n  ') +\n           ' ' +\n           braces[1];\n  }\n\n  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n  return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n  return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n  return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n  return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n  return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n  return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n  return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n  return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n  return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n  return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n  return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n  return isObject(e) &&\n      (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n  return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n  return arg === null ||\n         typeof arg === 'boolean' ||\n         typeof arg === 'number' ||\n         typeof arg === 'string' ||\n         typeof arg === 'symbol' ||  // ES6 symbol\n         typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(1260);\n\nfunction objectToString(o) {\n  return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n  return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n              'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n  var d = new Date();\n  var time = [pad(d.getHours()),\n              pad(d.getMinutes()),\n              pad(d.getSeconds())].join(':');\n  return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n *     prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(1259);\n\nexports._extend = function(origin, add) {\n  // Don't do anything if add isn't an object\n  if (!add || !isObject(add)) return origin;\n\n  var keys = Object.keys(add);\n  var i = keys.length;\n  while (i--) {\n    origin[keys[i]] = add[keys[i]];\n  }\n  return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/util/util.js\n// module id = 104\n// module chunks = 0\n\n//# sourceURL=../node_modules/util/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(35).errors;\nvar formatters = __webpack_require__(35).formatters;\nvar utils = __webpack_require__(47);\nvar promiEvent = __webpack_require__(552);\nvar Subscriptions = __webpack_require__(210).subscriptions;\n\nvar TIMEOUTBLOCK = 50;\nvar CONFIRMATIONBLOCKS = 24;\n\nvar Method = function Method(options) {\n\n    if(!options.call || !options.name) {\n        throw new Error('When creating a method you need to provide at least the \"name\" and \"call\" property.');\n    }\n\n    this.name = options.name;\n    this.call = options.call;\n    this.params = options.params || 0;\n    this.inputFormatter = options.inputFormatter;\n    this.outputFormatter = options.outputFormatter;\n    this.transformPayload = options.transformPayload;\n    this.extraFormatters = options.extraFormatters;\n\n    this.requestManager = options.requestManager;\n\n    // reference to eth.accounts\n    this.accounts = options.accounts;\n\n    this.defaultBlock = options.defaultBlock || 'latest';\n    this.defaultAccount = options.defaultAccount || null;\n};\n\nMethod.prototype.setRequestManager = function (requestManager, accounts) {\n    this.requestManager = requestManager;\n\n    // reference to eth.accounts\n    if (accounts) {\n        this.accounts = accounts;\n    }\n\n};\n\nMethod.prototype.createFunction = function (requestManager, accounts) {\n    var func = this.buildCall();\n    func.call = this.call;\n\n    this.setRequestManager(requestManager || this.requestManager, accounts || this.accounts);\n\n    return func;\n};\n\nMethod.prototype.attachToObject = function (obj) {\n    var func = this.buildCall();\n    func.call = this.call;\n    var name = this.name.split('.');\n    if (name.length > 1) {\n        obj[name[0]] = obj[name[0]] || {};\n        obj[name[0]][name[1]] = func;\n    } else {\n        obj[name[0]] = func;\n    }\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n    return _.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n    if (_.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n *\n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n    if (args.length !== this.params) {\n        throw errors.InvalidNumberOfParams(args.length, this.params, this.name);\n    }\n};\n\n/**\n * Should be called to format input args of method\n *\n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n    var _this = this;\n\n    if (!this.inputFormatter) {\n        return args;\n    }\n\n    return this.inputFormatter.map(function (formatter, index) {\n        // bind this for defaultBlock, and defaultAccount\n        return formatter ? formatter.call(_this, args[index]) : args[index];\n    });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n    var _this = this;\n\n    if(_.isArray(result)) {\n        return result.map(function(res){\n            return _this.outputFormatter && res ? _this.outputFormatter(res) : res;\n        });\n    } else {\n        return this.outputFormatter && result ? this.outputFormatter(result) : result;\n    }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n    var call = this.getCall(args);\n    var callback = this.extractCallback(args);\n    var params = this.formatInput(args);\n    this.validateArgs(params);\n\n    var payload = {\n        method: call,\n        params: params,\n        callback: callback\n    };\n\n    if (this.transformPayload) {\n        payload = this.transformPayload(payload);\n    }\n\n    return payload;\n};\n\n\nMethod.prototype._confirmTransaction = function (defer, result, payload) {\n    var method = this,\n        promiseResolved = false,\n        canUnsubscribe = true,\n        timeoutCount = 0,\n        confirmationCount = 0,\n        intervalId = null,\n        gasProvided = (_.isObject(payload.params[0]) && payload.params[0].gas) ? payload.params[0].gas : null,\n        isContractDeployment = _.isObject(payload.params[0]) &&\n            payload.params[0].data &&\n            payload.params[0].from &&\n            !payload.params[0].to;\n\n\n    // add custom send Methods\n    var _ethereumCalls = [\n        new Method({\n            name: 'getTransactionReceipt',\n            call: 'eth_getTransactionReceipt',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatters.outputTransactionReceiptFormatter\n        }),\n        new Method({\n            name: 'getCode',\n            call: 'eth_getCode',\n            params: 2,\n            inputFormatter: [formatters.inputAddressFormatter, formatters.inputDefaultBlockNumberFormatter]\n        }),\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'eth',\n            subscriptions: {\n                'newBlockHeaders': {\n                    subscriptionName: 'newHeads', // replace subscription with this name\n                    params: 0,\n                    outputFormatter: formatters.outputBlockFormatter\n                }\n            }\n        })\n    ];\n    // attach methods to this._ethereumCall\n    var _ethereumCall = {};\n    _.each(_ethereumCalls, function (mthd) {\n        mthd.attachToObject(_ethereumCall);\n        mthd.requestManager = method.requestManager; // assign rather than call setRequestManager()\n    });\n\n\n    // fire \"receipt\" and confirmation events and resolve after\n    var checkConfirmation = function (err, blockHeader, sub, existingReceipt) {\n        if (!err) {\n            // create fake unsubscribe\n            if (!sub) {\n                sub = {\n                    unsubscribe: function () {\n                        clearInterval(intervalId);\n                    }\n                };\n            }\n            // if we have a valid receipt we don't need to send a request\n            return (existingReceipt ? promiEvent.resolve(existingReceipt) : _ethereumCall.getTransactionReceipt(result))\n            // catch error from requesting receipt\n            .catch(function (err) {\n                sub.unsubscribe();\n                promiseResolved = true;\n                utils._fireError({message: 'Failed to check for transaction receipt:', data: err}, defer.eventEmitter, defer.reject);\n            })\n            // if CONFIRMATION listener exists check for confirmations, by setting canUnsubscribe = false\n            .then(function(receipt) {\n\n                if (!receipt || !receipt.blockHash) {\n                    throw new Error('Receipt missing or blockHash null');\n                }\n\n                // apply extra formatters\n                if (method.extraFormatters && method.extraFormatters.receiptFormatter) {\n                    receipt = method.extraFormatters.receiptFormatter(receipt);\n                }\n\n                // check if confirmation listener exists\n                if (defer.eventEmitter.listeners('confirmation').length > 0) {\n\n                    defer.eventEmitter.emit('confirmation', confirmationCount, receipt);\n\n                    canUnsubscribe = false;\n                    confirmationCount++;\n\n                    if (confirmationCount === CONFIRMATIONBLOCKS + 1) { // add 1 so we account for conf 0\n                        sub.unsubscribe();\n                        defer.eventEmitter.removeAllListeners();\n                    }\n                }\n\n                return receipt;\n            })\n            // CHECK for CONTRACT DEPLOYMENT\n            .then(function(receipt) {\n\n                if (isContractDeployment && !promiseResolved) {\n\n                    if (!receipt.contractAddress) {\n\n                        if (canUnsubscribe) {\n                            sub.unsubscribe();\n                            promiseResolved = true;\n                        }\n\n                        return utils._fireError(new Error('The transaction receipt didn\\'t contain a contract address.'), defer.eventEmitter, defer.reject);\n                    }\n\n                    _ethereumCall.getCode(receipt.contractAddress, function (e, code) {\n\n                        if (!code) {\n                            return;\n                        }\n\n\n                        if (code.length > 2) {\n                            defer.eventEmitter.emit('receipt', receipt);\n\n                            // if contract, return instance instead of receipt\n                            if (method.extraFormatters && method.extraFormatters.contractDeployFormatter) {\n                                defer.resolve(method.extraFormatters.contractDeployFormatter(receipt));\n                            } else {\n                                defer.resolve(receipt);\n                            }\n\n                            // need to remove listeners, as they aren't removed automatically when succesfull\n                            if (canUnsubscribe) {\n                                defer.eventEmitter.removeAllListeners();\n                            }\n\n                        } else {\n                            utils._fireError(new Error('The contract code couldn\\'t be stored, please check your gas limit.'), defer.eventEmitter, defer.reject);\n                        }\n\n                        if (canUnsubscribe) {\n                            sub.unsubscribe();\n                        }\n                        promiseResolved = true;\n                    });\n                }\n\n                return receipt;\n            })\n            // CHECK for normal tx check for receipt only\n            .then(function(receipt) {\n\n                if (!isContractDeployment && !promiseResolved) {\n\n                    if(!receipt.outOfGas &&\n                       (!gasProvided || gasProvided !== receipt.gasUsed)) {\n                        defer.eventEmitter.emit('receipt', receipt);\n                        defer.resolve(receipt);\n\n                        // need to remove listeners, as they aren't removed automatically when succesfull\n                        if (canUnsubscribe) {\n                            defer.eventEmitter.removeAllListeners();\n                        }\n\n                    } else {\n                        if(receipt) {\n                            receipt = JSON.stringify(receipt, null, 2);\n                        }\n                        utils._fireError(new Error(\"Transaction ran out of gas. Please provide more gas:\\n\"+ receipt), defer.eventEmitter, defer.reject);\n                    }\n\n                    if (canUnsubscribe) {\n                        sub.unsubscribe();\n                    }\n                    promiseResolved = true;\n                }\n\n            })\n            // time out the transaction if not mined after 50 blocks\n            .catch(function () {\n                timeoutCount++;\n\n                if (timeoutCount - 1 >= TIMEOUTBLOCK) {\n                    sub.unsubscribe();\n                    promiseResolved = true;\n                    return utils._fireError(new Error('Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!'), defer.eventEmitter, defer.reject);\n                }\n            });\n\n\n        } else {\n            sub.unsubscribe();\n            promiseResolved = true;\n            return utils._fireError({message: 'Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.', data: err}, defer.eventEmitter, defer.reject);\n        }\n    };\n\n  // start watching for confirmation depending on the support features of the provider\n  var startWatching = function() {\n      // if provider allows PUB/SUB\n      if (_.isFunction(this.requestManager.provider.on)) {\n          _ethereumCall.subscribe('newBlockHeaders', checkConfirmation);\n      } else {\n          intervalId = setInterval(checkConfirmation, 1000);\n      }\n  }.bind(this);\n\n\n  // first check if we already have a confirmed transaction\n  _ethereumCall.getTransactionReceipt(result)\n  .then(function(receipt) {\n      if (receipt && receipt.blockHash) {\n          if (defer.eventEmitter.listeners('confirmation').length > 0) {\n              // if the promise has not been resolved we must keep on watching for new Blocks, if a confrimation listener is present\n              setTimeout(function(){\n                  if (!promiseResolved) startWatching();\n              }, 1000);\n          }\n\n          return checkConfirmation(null, null, null, receipt);\n      } else if (!promiseResolved) {\n          startWatching();\n      }\n  })\n  .catch(function(){\n      if (!promiseResolved) startWatching();\n  });\n\n};\n\n\nvar getWallet = function(from, accounts) {\n    var wallet = null;\n\n    // is index given\n    if (_.isNumber(from)) {\n        wallet = accounts.wallet[from];\n\n        // is account given\n    } else if (_.isObject(from) && from.address && from.privateKey) {\n        wallet = from;\n\n        // search in wallet for address\n    } else {\n        wallet = accounts.wallet[from.toLowerCase()];\n    }\n\n    return wallet;\n};\n\nMethod.prototype.buildCall = function() {\n    var method = this,\n        isSendTx = (method.call === 'eth_sendTransaction' || method.call === 'eth_sendRawTransaction'); // || method.call === 'personal_sendTransaction'\n\n    // actual send function\n    var send = function () {\n        var defer = promiEvent(!isSendTx),\n            payload = method.toPayload(Array.prototype.slice.call(arguments));\n\n\n        // CALLBACK function\n        var sendTxCallback = function (err, result) {\n            try {\n                result = method.formatOutput(result);\n            } catch(e) {\n                err = e;\n            }\n\n            if (result instanceof Error) {\n                err = result;\n            }\n\n            if (!err) {\n                if (payload.callback) {\n                    payload.callback(null, result);\n                }\n            } else {\n                if(err.error) {\n                    err = err.error;\n                }\n\n                return utils._fireError(err, defer.eventEmitter, defer.reject, payload.callback);\n            }\n\n            // return PROMISE\n            if (!isSendTx) {\n\n                if (!err) {\n                    defer.resolve(result);\n\n                }\n\n            // return PROMIEVENT\n            } else {\n                defer.eventEmitter.emit('transactionHash', result);\n\n                method._confirmTransaction(defer, result, payload);\n            }\n\n        };\n\n        // SENDS the SIGNED SIGNATURE\n        var sendSignedTx = function(sign){\n\n            var signedPayload = _.extend({}, payload, {\n                method: 'eth_sendRawTransaction',\n                params: [sign.rawTransaction]\n            });\n\n            method.requestManager.send(signedPayload, sendTxCallback);\n        };\n\n\n        var sendRequest = function(payload, method) {\n\n            if (method && method.accounts && method.accounts.wallet && method.accounts.wallet.length) {\n                var wallet;\n\n                // ETH_SENDTRANSACTION\n                if (payload.method === 'eth_sendTransaction') {\n                    var tx = payload.params[0];\n                    wallet = getWallet((_.isObject(tx)) ? tx.from : null, method.accounts);\n\n\n                    // If wallet was found, sign tx, and send using sendRawTransaction\n                    if (wallet && wallet.privateKey) {\n                        return method.accounts.signTransaction(_.omit(tx, 'from'), wallet.privateKey).then(sendSignedTx);\n                    }\n\n                // ETH_SIGN\n                } else if (payload.method === 'eth_sign') {\n                    var data = payload.params[1];\n                    wallet = getWallet(payload.params[0], method.accounts);\n\n                    // If wallet was found, sign tx, and send using sendRawTransaction\n                    if (wallet && wallet.privateKey) {\n                        var sign = method.accounts.sign(data, wallet.privateKey);\n\n                        if (payload.callback) {\n                            payload.callback(null, sign.signature);\n                        }\n\n                        defer.resolve(sign.signature);\n                        return;\n                    }\n\n\n                }\n            }\n\n            return method.requestManager.send(payload, sendTxCallback);\n        };\n\n        // Send the actual transaction\n        if(isSendTx && _.isObject(payload.params[0]) && !payload.params[0].gasPrice) {\n\n            var getGasPrice = (new Method({\n                name: 'getGasPrice',\n                call: 'eth_gasPrice',\n                params: 0\n            })).createFunction(method.requestManager);\n\n            getGasPrice(function (err, gasPrice) {\n\n                if (gasPrice) {\n                    payload.params[0].gasPrice = gasPrice;\n                }\n                sendRequest(payload, method);\n            });\n\n        } else {\n            sendRequest(payload, method);\n        }\n\n\n        return defer.eventEmitter;\n    };\n\n    // necessary to attach things to the method\n    send.method = method;\n    // necessary for batch requests\n    send.request = this.request.bind(this);\n    return send;\n};\n\n/**\n * Should be called to create the pure JSONRPC request which can be used in a batch request\n *\n * @method request\n * @return {Object} jsonrpc request\n */\nMethod.prototype.request = function () {\n    var payload = this.toPayload(Array.prototype.slice.call(arguments));\n    payload.format = this.formatOutput.bind(this);\n    return payload;\n};\n\nmodule.exports = Method;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-method/src/index.js\n// module id = 105\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-method/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar requestManager = __webpack_require__(1272);\nvar extend = __webpack_require__(1274);\n\nmodule.exports = {\n    packageInit: function (pkg, args) {\n        args = Array.prototype.slice.call(args);\n\n        if (!pkg) {\n            throw new Error('You need to instantiate using the \"new\" keyword.');\n        }\n\n\n        // make property of pkg._provider, which can properly set providers\n        Object.defineProperty(pkg, 'currentProvider', {\n            get: function () {\n                return pkg._provider;\n            },\n            set: function (value) {\n                return pkg.setProvider(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n\n        // inherit from web3 umbrella package\n        if (args[0] && args[0]._requestManager) {\n            pkg._requestManager = new requestManager.Manager(args[0].currentProvider);\n\n        // set requestmanager on package\n        } else {\n            pkg._requestManager = new requestManager.Manager();\n            pkg._requestManager.setProvider(args[0], args[1]);\n        }\n\n        // add givenProvider\n        pkg.givenProvider = requestManager.Manager.givenProvider;\n        pkg.providers = requestManager.Manager.providers;\n\n         pkg._provider =  pkg._requestManager.provider;\n\n        // add SETPROVIDER function (don't overwrite if already existing)\n        if (!pkg.setProvider) {\n            pkg.setProvider = function (provider, net) {\n                pkg._requestManager.setProvider(provider, net);\n                pkg._provider = pkg._requestManager.provider;\n                return true;\n            };\n        }\n\n        // attach batch request creation\n        pkg.BatchRequest = requestManager.BatchManager.bind(null, pkg._requestManager);\n\n        // attach extend function\n        pkg.extend = extend(pkg);\n    },\n    addProviders: function (pkg) {\n        pkg.givenProvider = requestManager.Manager.givenProvider;\n        pkg.providers = requestManager.Manager.providers;\n    }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core/src/index.js\n// module id = 106\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core/src/index.js")},function(module,exports,__webpack_require__){eval('var f = __webpack_require__(65);\nvar SolidityParam = __webpack_require__(555);\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n    this._inputFormatter = config.inputFormatter;\n    this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given name\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n    throw "This method should be overwritten for type " + name;\n};\n\n/**\n * Should be used to determine what is the length of static part in given type\n *\n * @method staticPartLength\n * @param {String} name\n * @return {Number} length of static part in bytes\n */\nSolidityType.prototype.staticPartLength = function (name) {\n    // If name isn\'t an array then treat it like a single element array.\n    return (this.nestedTypes(name) || [\'[1]\'])\n        .map(function (type) {\n            // the length of the nested array\n            return parseInt(type.slice(1, -1), 10) || 1;\n        })\n        .reduce(function (previous, current) {\n            return previous * current;\n        // all basic types are 32 bytes long\n        }, 32);\n};\n\n/**\n * Should be used to determine if type is dynamic array\n * eg:\n * "type[]" => true\n * "type[4]" => false\n *\n * @method isDynamicArray\n * @param {String} name\n * @return {Bool} true if the type is dynamic array\n */\nSolidityType.prototype.isDynamicArray = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    return !!nestedTypes && !nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\n};\n\n/**\n * Should be used to determine if type is static array\n * eg:\n * "type[]" => false\n * "type[4]" => true\n *\n * @method isStaticArray\n * @param {String} name\n * @return {Bool} true if the type is static array\n */\nSolidityType.prototype.isStaticArray = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    return !!nestedTypes && !!nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\n};\n\n/**\n * Should return length of static array\n * eg.\n * "int[32]" => 32\n * "int256[14]" => 14\n * "int[2][3]" => 3\n * "int" => 1\n * "int[1]" => 1\n * "int[]" => 1\n *\n * @method staticArrayLength\n * @param {String} name\n * @return {Number} static array length\n */\nSolidityType.prototype.staticArrayLength = function (name) {\n    var nestedTypes = this.nestedTypes(name);\n    if (nestedTypes) {\n       return parseInt(nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g) || 1);\n    }\n    return 1;\n};\n\n/**\n * Should return nested type\n * eg.\n * "int[32]" => "int"\n * "int256[14]" => "int256"\n * "int[2][3]" => "int[2]"\n * "int" => "int"\n * "int[]" => "int"\n *\n * @method nestedName\n * @param {String} name\n * @return {String} nested name\n */\nSolidityType.prototype.nestedName = function (name) {\n    // remove last [] in name\n    var nestedTypes = this.nestedTypes(name);\n    if (!nestedTypes) {\n        return name;\n    }\n\n    return name.substr(0, name.length - nestedTypes[nestedTypes.length - 1].length);\n};\n\n/**\n * Should return true if type has dynamic size by default\n * such types are "string", "bytes"\n *\n * @method isDynamicType\n * @param {String} name\n * @return {Bool} true if is dynamic, otherwise false\n */\nSolidityType.prototype.isDynamicType = function () {\n    return false;\n};\n\n/**\n * Should return array of nested types\n * eg.\n * "int[2][3][]" => ["[2]", "[3]", "[]"]\n * "int[] => ["[]"]\n * "int" => null\n *\n * @method nestedTypes\n * @param {String} name\n * @return {Array} array of nested types\n */\nSolidityType.prototype.nestedTypes = function (name) {\n    // return list of strings eg. "[]", "[3]", "[]", "[2]"\n    return name.match(/(\\[[0-9]*\\])/g);\n};\n\n/**\n * Should be used to encode the value\n *\n * @method encode\n * @param {Object} value\n * @param {String} name\n * @return {String} encoded value\n */\nSolidityType.prototype.encode = function (value, name) {\n    var self = this;\n    if (this.isDynamicArray(name)) {\n\n        return (function () {\n            var length = value.length;                          // in int\n            var nestedName = self.nestedName(name);\n\n            var result = [];\n            result.push(f.formatInputInt(length).encode());\n\n            value.forEach(function (v) {\n                result.push(self.encode(v, nestedName));\n            });\n\n            return result;\n        })();\n\n    } else if (this.isStaticArray(name)) {\n\n        return (function () {\n            var length = self.staticArrayLength(name);          // in int\n            var nestedName = self.nestedName(name);\n\n            var result = [];\n            for (var i = 0; i < length; i++) {\n                result.push(self.encode(value[i], nestedName));\n            }\n\n            return result;\n        })();\n\n    }\n\n    return this._inputFormatter(value, name).encode();\n};\n\n/**\n * Should be used to decode value from bytes\n *\n * @method decode\n * @param {String} bytes\n * @param {Number} offset in bytes\n * @param {String} name type name\n * @returns {Object} decoded value\n */\nSolidityType.prototype.decode = function (bytes, offset, name) {\n    var self = this;\n\n    if (this.isDynamicArray(name)) {\n\n        return (function () {\n            var arrayOffset = parseInt(\'0x\' + bytes.substr(offset * 2, 64)); // in bytes\n            var length = parseInt(\'0x\' + bytes.substr(arrayOffset * 2, 64)); // in int\n            var arrayStart = arrayOffset + 32; // array starts after length; // in bytes\n\n            var nestedName = self.nestedName(name);\n            var nestedStaticPartLength = self.staticPartLength(nestedName);  // in bytes\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\n            var result = [];\n\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\n            }\n\n            return result;\n        })();\n\n    } else if (this.isStaticArray(name)) {\n\n        return (function () {\n            var length = self.staticArrayLength(name);                      // in int\n            var arrayStart = offset;                                        // in bytes\n\n            var nestedName = self.nestedName(name);\n            var nestedStaticPartLength = self.staticPartLength(nestedName); // in bytes\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\n            var result = [];\n\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\n            }\n\n            return result;\n        })();\n    } else if (this.isDynamicType(name)) {\n\n        return (function () {\n            var dynamicOffset = parseInt(\'0x\' + bytes.substr(offset * 2, 64));      // in bytes\n            var length = parseInt(\'0x\' + bytes.substr(dynamicOffset * 2, 64));      // in bytes\n            var roundedLength = Math.floor((length + 31) / 32);                     // in int\n            var param = new SolidityParam(bytes.substr(dynamicOffset * 2, ( 1 + roundedLength) * 64), 0, bytes);\n            return self._outputFormatter(param, name);\n        })();\n    }\n\n    var length = this.staticPartLength(name);\n    var param = new SolidityParam(bytes.substr(offset * 2, length * 2), undefined, bytes);\n    return this._outputFormatter(param, name);\n};\n\nmodule.exports = SolidityType;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/type.js\n// module id = 107\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/type.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar errors = __webpack_require__(56);\nvar Base58Check = __webpack_require__(158);\nvar Networks = __webpack_require__(109);\nvar Hash = __webpack_require__(36);\nvar JSUtil = __webpack_require__(24);\nvar PublicKey = __webpack_require__(66);\n\n/**\n * Instantiate an address from an address String or Buffer, a public key or script hash Buffer,\n * or an instance of {@link PublicKey} or {@link Script}.\n *\n * This is an immutable class, and if the first parameter provided to this constructor is an\n * `Address` instance, the same argument will be returned.\n *\n * An address has two key properties: `network` and `type`. The type is either\n * `Address.PayToPublicKeyHash` (value is the `'pubkeyhash'` string)\n * or `Address.PayToScriptHash` (the string `'scripthash'`). The network is an instance of {@link Network}.\n * You can quickly check whether an address is of a given kind by using the methods\n * `isPayToPublicKeyHash` and `isPayToScriptHash`\n *\n * @example\n * ```javascript\n * // validate that an input field is valid\n * var error = Address.getValidationError(input, 'testnet');\n * if (!error) {\n *   var address = Address(input, 'testnet');\n * } else {\n *   // invalid network or checksum (typo?)\n *   var message = error.messsage;\n * }\n *\n * // get an address from a public key\n * var address = Address(publicKey, 'testnet').toString();\n * ```\n *\n * @param {*} data - The encoded data in various formats\n * @param {Network|String|number=} network - The network: 'livenet' or 'testnet'\n * @param {string=} type - The type of address: 'script' or 'pubkey'\n * @returns {Address} A new valid and frozen instance of an Address\n * @constructor\n */\nfunction Address(data, network, type) {\n  /* jshint maxcomplexity: 12 */\n  /* jshint maxstatements: 20 */\n\n  if (!(this instanceof Address)) {\n    return new Address(data, network, type);\n  }\n\n  if (_.isArray(data) && _.isNumber(network)) {\n    return Address.createMultisig(data, network, type);\n  }\n\n  if (data instanceof Address) {\n    // Immutable instance\n    return data;\n  }\n\n  $.checkArgument(data, 'First argument is required, please include address data.', 'guide/address.html');\n\n  if (network && !Networks.get(network)) {\n    throw new TypeError('Second argument must be \"livenet\" or \"testnet\".');\n  }\n\n  if (type && (type !== Address.PayToPublicKeyHash && type !== Address.PayToScriptHash)) {\n    throw new TypeError('Third argument must be \"pubkeyhash\" or \"scripthash\".');\n  }\n\n  var info = this._classifyArguments(data, network, type);\n\n  // set defaults if not set\n  info.network = info.network || Networks.get(network) || Networks.defaultNetwork;\n  info.type = info.type || type || Address.PayToPublicKeyHash;\n\n  JSUtil.defineImmutable(this, {\n    hashBuffer: info.hashBuffer,\n    network: info.network,\n    type: info.type\n  });\n\n  return this;\n}\n\n/**\n * Internal function used to split different kinds of arguments of the constructor\n * @param {*} data - The encoded data in various formats\n * @param {Network|String|number=} network - The network: 'livenet' or 'testnet'\n * @param {string=} type - The type of address: 'script' or 'pubkey'\n * @returns {Object} An \"info\" object with \"type\", \"network\", and \"hashBuffer\"\n */\nAddress.prototype._classifyArguments = function(data, network, type) {\n  /* jshint maxcomplexity: 10 */\n  // transform and validate input data\n  if ((data instanceof Buffer || data instanceof Uint8Array) && data.length === 20) {\n    return Address._transformHash(data);\n  } else if ((data instanceof Buffer || data instanceof Uint8Array) && data.length === 21) {\n    return Address._transformBuffer(data, network, type);\n  } else if (data instanceof PublicKey) {\n    return Address._transformPublicKey(data);\n  } else if (data instanceof Script) {\n    return Address._transformScript(data, network);\n  } else if (typeof(data) === 'string') {\n    return Address._transformString(data, network, type);\n  } else if (_.isObject(data)) {\n    return Address._transformObject(data);\n  } else {\n    throw new TypeError('First argument is an unrecognized data format.');\n  }\n};\n\n/** @static */\nAddress.PayToPublicKeyHash = 'pubkeyhash';\n/** @static */\nAddress.PayToScriptHash = 'scripthash';\n\n/**\n * @param {Buffer} hash - An instance of a hash Buffer\n * @returns {Object} An object with keys: hashBuffer\n * @private\n */\nAddress._transformHash = function(hash) {\n  var info = {};\n  if (!(hash instanceof Buffer) && !(hash instanceof Uint8Array)) {\n    throw new TypeError('Address supplied is not a buffer.');\n  }\n  if (hash.length !== 20) {\n    throw new TypeError('Address hashbuffers must be exactly 20 bytes.');\n  }\n  info.hashBuffer = hash;\n  return info;\n};\n\n/**\n * Deserializes an address serialized through `Address#toObject()`\n * @param {Object} data\n * @param {string} data.hash - the hash that this address encodes\n * @param {string} data.type - either 'pubkeyhash' or 'scripthash'\n * @param {Network=} data.network - the name of the network associated\n * @return {Address}\n */\nAddress._transformObject = function(data) {\n  $.checkArgument(data.hash || data.hashBuffer, 'Must provide a `hash` or `hashBuffer` property');\n  $.checkArgument(data.type, 'Must provide a `type` property');\n  return {\n    hashBuffer: data.hash ? new Buffer(data.hash, 'hex') : data.hashBuffer,\n    network: Networks.get(data.network) || Networks.defaultNetwork,\n    type: data.type\n  };\n};\n\n/**\n * Internal function to discover the network and type based on the first data byte\n *\n * @param {Buffer} buffer - An instance of a hex encoded address Buffer\n * @returns {Object} An object with keys: network and type\n * @private\n */\nAddress._classifyFromVersion = function(buffer) {\n  var version = {};\n\n  var prefix = buffer[0]*256 + buffer[1];\n  var pubkeyhashNetwork = Networks.get(prefix, 'pubkeyhash');\n  var scripthashNetwork = Networks.get(prefix, 'scripthash');\n\n  if (pubkeyhashNetwork) {\n    version.network = pubkeyhashNetwork;\n    version.type = Address.PayToPublicKeyHash;\n  } else if (scripthashNetwork) {\n    version.network = scripthashNetwork;\n    version.type = Address.PayToScriptHash;\n  }\n\n  return version;\n};\n\n/**\n * Internal function to transform a bitcoin address buffer\n *\n * @param {Buffer} buffer - An instance of a hex encoded address Buffer\n * @param {string=} network - The network: 'livenet' or 'testnet'\n * @param {string=} type - The type: 'pubkeyhash' or 'scripthash'\n * @returns {Object} An object with keys: hashBuffer, network and type\n * @private\n */\nAddress._transformBuffer = function(buffer, network, type) {\n  /* jshint maxcomplexity: 9 */\n  var info = {};\n  if (!(buffer instanceof Buffer) && !(buffer instanceof Uint8Array)) {\n    throw new TypeError('Address supplied is not a buffer.');\n  }\n  if (buffer.length !== 2 + 20) {\n    throw new TypeError('Address buffers must be exactly 22 bytes.');\n  }\n\n  network = Networks.get(network);\n  var bufferVersion = Address._classifyFromVersion(buffer);\n\n  if (!bufferVersion.network || (network && network !== bufferVersion.network)) {\n    throw new TypeError('Address has mismatched network type.');\n  }\n\n  if (!bufferVersion.type || (type && type !== bufferVersion.type)) {\n    throw new TypeError('Address has mismatched type.');\n  }\n\n  info.hashBuffer = buffer.slice(2);\n  info.network = bufferVersion.network;\n  info.type = bufferVersion.type;\n  return info;\n};\n\n/**\n * Internal function to transform a {@link PublicKey}\n *\n * @param {PublicKey} pubkey - An instance of PublicKey\n * @returns {Object} An object with keys: hashBuffer, type\n * @private\n */\nAddress._transformPublicKey = function(pubkey) {\n  var info = {};\n  if (!(pubkey instanceof PublicKey)) {\n    throw new TypeError('Address must be an instance of PublicKey.');\n  }\n  info.hashBuffer = Hash.sha256ripemd160(pubkey.toBuffer());\n  info.type = Address.PayToPublicKeyHash;\n  return info;\n};\n\n/**\n * Internal function to transform a {@link Script} into a `info` object.\n *\n * @param {Script} script - An instance of Script\n * @returns {Object} An object with keys: hashBuffer, type\n * @private\n */\nAddress._transformScript = function(script, network) {\n  $.checkArgument(script instanceof Script, 'script must be a Script instance');\n  var info = script.getAddressInfo(network);\n  if (!info) {\n    throw new errors.Script.CantDeriveAddress(script);\n  }\n  return info;\n};\n\n/**\n * Creates a P2SH address from a set of public keys and a threshold.\n *\n * The addresses will be sorted lexicographically, as that is the trend in bitcoin.\n * To create an address from unsorted public keys, use the {@link Script#buildMultisigOut}\n * interface.\n *\n * @param {Array} publicKeys - a set of public keys to create an address\n * @param {number} threshold - the number of signatures needed to release the funds\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @return {Address}\n */\nAddress.createMultisig = function(publicKeys, threshold, network) {\n  network = network || publicKeys[0].network || Networks.defaultNetwork;\n  return Address.payingTo(Script.buildMultisigOut(publicKeys, threshold), network);\n};\n\n/**\n * Internal function to transform a bitcoin address string\n *\n * @param {string} data\n * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet'\n * @param {string=} type - The type: 'pubkeyhash' or 'scripthash'\n * @returns {Object} An object with keys: hashBuffer, network and type\n * @private\n */\nAddress._transformString = function(data, network, type) {\n  if (typeof(data) !== 'string') {\n    throw new TypeError('data parameter supplied is not a string.');\n  }\n  data = data.trim();\n  var addressBuffer = Base58Check.decode(data);\n  var info = Address._transformBuffer(addressBuffer, network, type);\n  return info;\n};\n\n/**\n * Instantiate an address from a PublicKey instance\n *\n * @param {PublicKey} data\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromPublicKey = function(data, network) {\n  var info = Address._transformPublicKey(data);\n  network = network || Networks.defaultNetwork;\n  return new Address(info.hashBuffer, network, info.type);\n};\n\n/**\n * Instantiate an address from a ripemd160 public key hash\n *\n * @param {Buffer} hash - An instance of buffer of the hash\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromPublicKeyHash = function(hash, network) {\n  var info = Address._transformHash(hash);\n  return new Address(info.hashBuffer, network, Address.PayToPublicKeyHash);\n};\n\n/**\n * Instantiate an address from a ripemd160 script hash\n *\n * @param {Buffer} hash - An instance of buffer of the hash\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromScriptHash = function(hash, network) {\n  $.checkArgument(hash, 'hash parameter is required');\n  var info = Address._transformHash(hash);\n  return new Address(info.hashBuffer, network, Address.PayToScriptHash);\n};\n\n/**\n * Builds a p2sh address paying to script. This will hash the script and\n * use that to create the address.\n * If you want to extract an address associated with a script instead,\n * see {{Address#fromScript}}\n *\n * @param {Script} script - An instance of Script\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.payingTo = function(script, network) {\n  $.checkArgument(script, 'script is required');\n  $.checkArgument(script instanceof Script, 'script must be instance of Script');\n\n  return Address.fromScriptHash(Hash.sha256ripemd160(script.toBuffer()), network);\n};\n\n/**\n * Extract address from a Script. The script must be of one\n * of the following types: p2pkh input, p2pkh output, p2sh input\n * or p2sh output.\n * This will analyze the script and extract address information from it.\n * If you want to transform any script to a p2sh Address paying\n * to that script's hash instead, use {{Address#payingTo}}\n *\n * @param {Script} script - An instance of Script\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromScript = function(script, network) {\n  $.checkArgument(script instanceof Script, 'script must be a Script instance');\n  var info = Address._transformScript(script, network);\n  return new Address(info.hashBuffer, network, info.type);\n};\n\n/**\n * Instantiate an address from a buffer of the address\n *\n * @param {Buffer} buffer - An instance of buffer of the address\n * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet'\n * @param {string=} type - The type of address: 'script' or 'pubkey'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromBuffer = function(buffer, network, type) {\n  var info = Address._transformBuffer(buffer, network, type);\n  return new Address(info.hashBuffer, info.network, info.type);\n};\n\n/**\n * Instantiate an address from an address string\n *\n * @param {string} str - An string of the bitcoin address\n * @param {String|Network=} network - either a Network instance, 'livenet', or 'testnet'\n * @param {string=} type - The type of address: 'script' or 'pubkey'\n * @returns {Address} A new valid and frozen instance of an Address\n */\nAddress.fromString = function(str, network, type) {\n  var info = Address._transformString(str, network, type);\n  return new Address(info.hashBuffer, info.network, info.type);\n};\n\n/**\n * Instantiate an address from an Object\n *\n * @param {string} json - An JSON string or Object with keys: hash, network and type\n * @returns {Address} A new valid instance of an Address\n */\nAddress.fromObject = function fromObject(obj) {\n  $.checkState(\n    JSUtil.isHexa(obj.hash),\n    'Unexpected hash property, \"' + obj.hash + '\", expected to be hex.'\n  );\n  var hashBuffer = new Buffer(obj.hash, 'hex');\n  return new Address(hashBuffer, obj.network, obj.type);\n};\n\n/**\n * Will return a validation error if exists\n *\n * @example\n * ```javascript\n * // a network mismatch error\n * var error = Address.getValidationError('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'testnet');\n * ```\n *\n * @param {string} data - The encoded data\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @param {string} type - The type of address: 'script' or 'pubkey'\n * @returns {null|Error} The corresponding error message\n */\nAddress.getValidationError = function(data, network, type) {\n  var error;\n  try {\n    /* jshint nonew: false */\n    new Address(data, network, type);\n  } catch (e) {\n    error = e;\n  }\n  return error;\n};\n\n/**\n * Will return a boolean if an address is valid\n *\n * @example\n * ```javascript\n * assert(Address.isValid('15vkcKf7gB23wLAnZLmbVuMiiVDc1Nm4a2', 'livenet'));\n * ```\n *\n * @param {string} data - The encoded data\n * @param {String|Network} network - either a Network instance, 'livenet', or 'testnet'\n * @param {string} type - The type of address: 'script' or 'pubkey'\n * @returns {boolean} The corresponding error message\n */\nAddress.isValid = function(data, network, type) {\n  return !Address.getValidationError(data, network, type);\n};\n\n/**\n * Returns true if an address is of pay to public key hash type\n * @return boolean\n */\nAddress.prototype.isPayToPublicKeyHash = function() {\n  return this.type === Address.PayToPublicKeyHash;\n};\n\n/**\n * Returns true if an address is of pay to script hash type\n * @return boolean\n */\nAddress.prototype.isPayToScriptHash = function() {\n  return this.type === Address.PayToScriptHash;\n};\n\n/**\n * Will return a buffer representation of the address\n *\n * @returns {Buffer} Bitcoin address buffer\n */\nAddress.prototype.toBuffer = function() {\n  var version = new Buffer(this.network[this.type].toString(16), 'hex');\n  var buf = Buffer.concat([version, this.hashBuffer]);\n  return buf;\n};\n\n/**\n * @returns {Object} A plain object with the address information\n */\nAddress.prototype.toObject = Address.prototype.toJSON = function toObject() {\n  return {\n    hash: this.hashBuffer.toString('hex'),\n    type: this.type,\n    network: this.network.toString()\n  };\n};\n\n/**\n * Will return a the string representation of the address\n *\n * @returns {string} Bitcoin address\n */\nAddress.prototype.toString = function() {\n  return Base58Check.encode(this.toBuffer());\n};\n\n/**\n * Will return a string formatted for the console\n *\n * @returns {string} Bitcoin address\n */\nAddress.prototype.inspect = function() {\n  return '<Address: ' + this.toString() + ', type: ' + this.type + ', network: ' + this.network + '>';\n};\n\nmodule.exports = Address;\n\nvar Script = __webpack_require__(57);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/address.js\n// module id = 108\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/address.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar _ = __webpack_require__(10);\n\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\nvar networks = [];\nvar networkMaps = {};\n\n/**\n * A network is merely a map containing values that correspond to version\n * numbers for each bitcoin network. Currently only supporting \"livenet\"\n * (a.k.a. \"mainnet\") and \"testnet\".\n * @constructor\n */\nfunction Network() {}\n\nNetwork.prototype.toString = function toString() {\n  return this.name;\n};\n\n/**\n * @function\n * @member Networks#get\n * Retrieves the network associated with a magic number or string.\n * @param {string|number|Network} arg\n * @param {string|Array} keys - if set, only check if the magic number associated with this name matches\n * @return Network\n */\nfunction get(arg, keys) {\n  if (~networks.indexOf(arg)) {\n    return arg;\n  }\n  if (keys) {\n    if (!_.isArray(keys)) {\n      keys = [keys];\n    }\n    var containsArg = function(key) {\n      return networks[index][key] === arg;\n    };\n    for (var index in networks) {\n      if (_.any(keys, containsArg)) {\n        return networks[index];\n      }\n    }\n    return undefined;\n  }\n  return networkMaps[arg];\n}\n\n/**\n * @function\n * @member Networks#add\n * Will add a custom Network\n * @param {Object} data\n * @param {string} data.name - The name of the network\n * @param {string} data.alias - The aliased name of the network\n * @param {Number} data.pubkeyhash - The publickey hash prefix\n * @param {Number} data.privatekey - The privatekey prefix\n * @param {Number} data.scripthash - The scripthash prefix\n * @param {Number} data.xpubkey - The extended public key magic\n * @param {Number} data.xprivkey - The extended private key magic\n * @param {Number} data.zaddr - The Zcash payment address prefix\n * @param {Number} data.zkey - The Zcash spending key prefix\n * @param {Number} data.networkMagic - The network magic number\n * @param {Number} data.port - The network port\n * @param {Array}  data.dnsSeeds - An array of dns seeds\n * @return Network\n */\nfunction addNetwork(data) {\n\n  var network = new Network();\n\n  JSUtil.defineImmutable(network, {\n    name: data.name,\n    alias: data.alias,\n    pubkeyhash: data.pubkeyhash,\n    privatekey: data.privatekey,\n    scripthash: data.scripthash,\n    xpubkey: data.xpubkey,\n    xprivkey: data.xprivkey,\n    zaddr: data.zaddr,\n    zkey: data.zkey\n  });\n\n  if (data.networkMagic) {\n    JSUtil.defineImmutable(network, {\n      networkMagic: BufferUtil.integerAsBuffer(data.networkMagic)\n    });\n  }\n\n  if (data.port) {\n    JSUtil.defineImmutable(network, {\n      port: data.port\n    });\n  }\n\n  if (data.dnsSeeds) {\n    JSUtil.defineImmutable(network, {\n      dnsSeeds: data.dnsSeeds\n    });\n  }\n  _.each(network, function(value) {\n    if (!_.isUndefined(value) && !_.isObject(value)) {\n      networkMaps[value] = network;\n    }\n  });\n\n  networks.push(network);\n\n  return network;\n\n}\n\n/**\n * @function\n * @member Networks#remove\n * Will remove a custom network\n * @param {Network} network\n */\nfunction removeNetwork(network) {\n  for (var i = 0; i < networks.length; i++) {\n    if (networks[i] === network) {\n      networks.splice(i, 1);\n    }\n  }\n  for (var key in networkMaps) {\n    if (networkMaps[key] === network) {\n      delete networkMaps[key];\n    }\n  }\n}\n\naddNetwork({\n  name: 'livenet',\n  alias: 'mainnet',\n  pubkeyhash: 0x1cb8,\n  privatekey: 0x80,\n  scripthash: 0x1cbd,\n  xpubkey: 0x0488b21e,\n  xprivkey: 0x0488ade4,\n  zaddr: 0x169a,\n  zkey: 0xab36,\n  networkMagic: 0xf91bacab,\n  port: 8233,\n  dnsSeeds: [\n//    'seed.bitcoin.sipa.be',\n//    'dnsseed.bluematt.me',\n//    'dnsseed.bitcoin.dashjr.org',\n//    'seed.bitcoinstats.com',\n//    'seed.bitnodes.io',\n//    'bitseed.xf2.org'\n  ]\n});\n\n/**\n * @instance\n * @member Networks#livenet\n */\nvar livenet = get('livenet');\n\naddNetwork({\n  name: 'testnet',\n  alias: 'regtest',\n  pubkeyhash: 0x1d25,\n  privatekey: 0xef,\n  scripthash: 0x1cba,\n  xpubkey: 0x043587cf,\n  xprivkey: 0x04358394,\n  zaddr: 0x16b6,\n  zkey: 0xac08,\n});\n\n/**\n * @instance\n * @member Networks#testnet\n */\nvar testnet = get('testnet');\n\n// Add configurable values for testnet/regtest\n\nvar TESTNET = {\n  PORT: 18233,\n  NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xf99f24b6),\n  DNS_SEEDS: [\n    'dnsseed.testnet.z.cash',\n  ]\n};\n\nfor (var key in TESTNET) {\n  if (!_.isObject(TESTNET[key])) {\n    networkMaps[TESTNET[key]] = testnet;\n  }\n}\n\nvar REGTEST = {\n  PORT: 18444,\n  NETWORK_MAGIC: BufferUtil.integerAsBuffer(0xaae83f5f),\n  DNS_SEEDS: []\n};\n\nfor (var key in REGTEST) {\n  if (!_.isObject(REGTEST[key])) {\n    networkMaps[REGTEST[key]] = testnet;\n  }\n}\n\nObject.defineProperty(testnet, 'port', {\n  enumerable: true,\n  configurable: false,\n  get: function() {\n    if (this.regtestEnabled) {\n      return REGTEST.PORT;\n    } else {\n      return TESTNET.PORT;\n    }\n  }\n});\n\nObject.defineProperty(testnet, 'networkMagic', {\n  enumerable: true,\n  configurable: false,\n  get: function() {\n    if (this.regtestEnabled) {\n      return REGTEST.NETWORK_MAGIC;\n    } else {\n      return TESTNET.NETWORK_MAGIC;\n    }\n  }\n});\n\nObject.defineProperty(testnet, 'dnsSeeds', {\n  enumerable: true,\n  configurable: false,\n  get: function() {\n    if (this.regtestEnabled) {\n      return REGTEST.DNS_SEEDS;\n    } else {\n      return TESTNET.DNS_SEEDS;\n    }\n  }\n});\n\n/**\n * @function\n * @member Networks#enableRegtest\n * Will enable regtest features for testnet\n */\nfunction enableRegtest() {\n  testnet.regtestEnabled = true;\n}\n\n/**\n * @function\n * @member Networks#disableRegtest\n * Will disable regtest features for testnet\n */\nfunction disableRegtest() {\n  testnet.regtestEnabled = false;\n}\n\n/**\n * @namespace Networks\n */\nmodule.exports = {\n  add: addNetwork,\n  remove: removeNetwork,\n  defaultNetwork: livenet,\n  livenet: livenet,\n  mainnet: livenet,\n  testnet: testnet,\n  get: get,\n  enableRegtest: enableRegtest,\n  disableRegtest: disableRegtest\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/networks.js\n// module id = 109\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/networks.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst asn1 = exports;\n\nasn1.bignum = __webpack_require__(17);\n\nasn1.define = __webpack_require__(580).define;\nasn1.base = __webpack_require__(127);\nasn1.constants = __webpack_require__(323);\nasn1.decoders = __webpack_require__(584);\nasn1.encoders = __webpack_require__(586);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1.js\n// module id = 110\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = onlyOnce;\nfunction onlyOnce(fn) {\n    return function () {\n        if (fn === null) throw new Error("Callback was already called.");\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, arguments);\n    };\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/onlyOnce.js\n// module id = 111\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/onlyOnce.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = slice;\nfunction slice(arrayLike, start) {\n    start = start | 0;\n    var newLen = Math.max(arrayLike.length - start, 0);\n    var newArr = Array(newLen);\n    for (var idx = 0; idx < newLen; idx++) {\n        newArr[idx] = arrayLike[start + idx];\n    }\n    return newArr;\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/slice.js\n// module id = 112\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/slice.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar config = void 0;\n\nif (false) {\n  config = require('./local/config');\n}\n\nif (true) {\n  config = __webpack_require__(608);\n}\n\nmodule.exports = config;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/config.js\n// module id = 113\n// module chunks = 0\n\n//# sourceURL=config/config.js")},function(module,exports,__webpack_require__){eval("var createHash = __webpack_require__(59)\n\nfunction ripemd160 (buffer) {\n  return createHash('rmd160').update(buffer).digest()\n}\n\nfunction sha1 (buffer) {\n  return createHash('sha1').update(buffer).digest()\n}\n\nfunction sha256 (buffer) {\n  return createHash('sha256').update(buffer).digest()\n}\n\nfunction hash160 (buffer) {\n  return ripemd160(sha256(buffer))\n}\n\nfunction hash256 (buffer) {\n  return sha256(sha256(buffer))\n}\n\nmodule.exports = {\n  hash160: hash160,\n  hash256: hash256,\n  ripemd160: ripemd160,\n  sha1: sha1,\n  sha256: sha256\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/crypto.js\n// module id = 114\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/crypto.js")},function(module,exports,__webpack_require__){eval("\r\n/**\r\n * Expose `Emitter`.\r\n */\r\n\r\nif (true) {\r\n  module.exports = Emitter;\r\n}\r\n\r\n/**\r\n * Initialize a new `Emitter`.\r\n *\r\n * @api public\r\n */\r\n\r\nfunction Emitter(obj) {\r\n  if (obj) return mixin(obj);\r\n};\r\n\r\n/**\r\n * Mixin the emitter properties.\r\n *\r\n * @param {Object} obj\r\n * @return {Object}\r\n * @api private\r\n */\r\n\r\nfunction mixin(obj) {\r\n  for (var key in Emitter.prototype) {\r\n    obj[key] = Emitter.prototype[key];\r\n  }\r\n  return obj;\r\n}\r\n\r\n/**\r\n * Listen on the given `event` with `fn`.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.on =\r\nEmitter.prototype.addEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\r\n    .push(fn);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Adds an `event` listener that will be invoked a single\r\n * time then automatically removed.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.once = function(event, fn){\r\n  function on() {\r\n    this.off(event, on);\r\n    fn.apply(this, arguments);\r\n  }\r\n\r\n  on.fn = fn;\r\n  this.on(event, on);\r\n  return this;\r\n};\r\n\r\n/**\r\n * Remove the given callback for `event` or all\r\n * registered callbacks.\r\n *\r\n * @param {String} event\r\n * @param {Function} fn\r\n * @return {Emitter}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.off =\r\nEmitter.prototype.removeListener =\r\nEmitter.prototype.removeAllListeners =\r\nEmitter.prototype.removeEventListener = function(event, fn){\r\n  this._callbacks = this._callbacks || {};\r\n\r\n  // all\r\n  if (0 == arguments.length) {\r\n    this._callbacks = {};\r\n    return this;\r\n  }\r\n\r\n  // specific event\r\n  var callbacks = this._callbacks['$' + event];\r\n  if (!callbacks) return this;\r\n\r\n  // remove all handlers\r\n  if (1 == arguments.length) {\r\n    delete this._callbacks['$' + event];\r\n    return this;\r\n  }\r\n\r\n  // remove specific handler\r\n  var cb;\r\n  for (var i = 0; i < callbacks.length; i++) {\r\n    cb = callbacks[i];\r\n    if (cb === fn || cb.fn === fn) {\r\n      callbacks.splice(i, 1);\r\n      break;\r\n    }\r\n  }\r\n  return this;\r\n};\r\n\r\n/**\r\n * Emit `event` with the given args.\r\n *\r\n * @param {String} event\r\n * @param {Mixed} ...\r\n * @return {Emitter}\r\n */\r\n\r\nEmitter.prototype.emit = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  var args = [].slice.call(arguments, 1)\r\n    , callbacks = this._callbacks['$' + event];\r\n\r\n  if (callbacks) {\r\n    callbacks = callbacks.slice(0);\r\n    for (var i = 0, len = callbacks.length; i < len; ++i) {\r\n      callbacks[i].apply(this, args);\r\n    }\r\n  }\r\n\r\n  return this;\r\n};\r\n\r\n/**\r\n * Return array of callbacks for `event`.\r\n *\r\n * @param {String} event\r\n * @return {Array}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.listeners = function(event){\r\n  this._callbacks = this._callbacks || {};\r\n  return this._callbacks['$' + event] || [];\r\n};\r\n\r\n/**\r\n * Check if this emitter has `event` handlers.\r\n *\r\n * @param {String} event\r\n * @return {Boolean}\r\n * @api public\r\n */\r\n\r\nEmitter.prototype.hasListeners = function(event){\r\n  return !! this.listeners(event).length;\r\n};\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-emitter/index.js\n// module id = 115\n// module chunks = 0\n\n//# sourceURL=../node_modules/component-emitter/index.js")},function(module,exports){eval("module.exports = function (exec) {\n  try {\n    return !!exec();\n  } catch (e) {\n    return true;\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_fails.js\n// module id = 116\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_fails.js")},function(module,exports){eval("module.exports = {};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iterators.js\n// module id = 117\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iterators.js")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(361);\nvar defined = __webpack_require__(241);\nmodule.exports = function (it) {\n  return IObject(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-iobject.js\n// module id = 118\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-iobject.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Module dependencies.\n */\n\nvar keys = __webpack_require__(839);\nvar hasBinary = __webpack_require__(409);\nvar sliceBuffer = __webpack_require__(578);\nvar after = __webpack_require__(575);\nvar utf8 = __webpack_require__(840);\n\nvar base64encoder;\nif (global && global.ArrayBuffer) {\n  base64encoder = __webpack_require__(620);\n}\n\n/**\n * Check if we are running an android browser. That requires us to use\n * ArrayBuffer with polling transports...\n *\n * http://ghinda.net/jpeg-blob-ajax-android/\n */\n\nvar isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);\n\n/**\n * Check if we are running in PhantomJS.\n * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n * https://github.com/ariya/phantomjs/issues/11395\n * @type boolean\n */\nvar isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);\n\n/**\n * When true, avoids using Blobs to encode payloads.\n * @type boolean\n */\nvar dontSendBlobs = isAndroid || isPhantomJS;\n\n/**\n * Current protocol version.\n */\n\nexports.protocol = 3;\n\n/**\n * Packet types.\n */\n\nvar packets = exports.packets = {\n    open:     0    // non-ws\n  , close:    1    // non-ws\n  , ping:     2\n  , pong:     3\n  , message:  4\n  , upgrade:  5\n  , noop:     6\n};\n\nvar packetslist = keys(packets);\n\n/**\n * Premade error packet.\n */\n\nvar err = { type: 'error', data: 'parser error' };\n\n/**\n * Create a blob api even for blob builder when vendor prefixes exist\n */\n\nvar Blob = __webpack_require__(649);\n\n/**\n * Encodes a packet.\n *\n *     <packet type id> [ <data> ]\n *\n * Example:\n *\n *     5hello world\n *     3\n *     4\n *\n * Binary is encoded in an identical principle\n *\n * @api private\n */\n\nexports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = false;\n  }\n\n  if (typeof utf8encode === 'function') {\n    callback = utf8encode;\n    utf8encode = null;\n  }\n\n  var data = (packet.data === undefined)\n    ? undefined\n    : packet.data.buffer || packet.data;\n\n  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n    return encodeArrayBuffer(packet, supportsBinary, callback);\n  } else if (Blob && data instanceof global.Blob) {\n    return encodeBlob(packet, supportsBinary, callback);\n  }\n\n  // might be an object with { base64: true, data: dataAsBase64String }\n  if (data && data.base64) {\n    return encodeBase64Object(packet, callback);\n  }\n\n  // Sending data as a utf-8 string\n  var encoded = packets[packet.type];\n\n  // data fragment is optional\n  if (undefined !== packet.data) {\n    encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);\n  }\n\n  return callback('' + encoded);\n\n};\n\nfunction encodeBase64Object(packet, callback) {\n  // packet data is an object { base64: true, data: dataAsBase64String }\n  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n  return callback(message);\n}\n\n/**\n * Encode packet helpers for binary types\n */\n\nfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var data = packet.data;\n  var contentArray = new Uint8Array(data);\n  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\n  resultBuffer[0] = packets[packet.type];\n  for (var i = 0; i < contentArray.length; i++) {\n    resultBuffer[i+1] = contentArray[i];\n  }\n\n  return callback(resultBuffer.buffer);\n}\n\nfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  var fr = new FileReader();\n  fr.onload = function() {\n    packet.data = fr.result;\n    exports.encodePacket(packet, supportsBinary, true, callback);\n  };\n  return fr.readAsArrayBuffer(packet.data);\n}\n\nfunction encodeBlob(packet, supportsBinary, callback) {\n  if (!supportsBinary) {\n    return exports.encodeBase64Packet(packet, callback);\n  }\n\n  if (dontSendBlobs) {\n    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n  }\n\n  var length = new Uint8Array(1);\n  length[0] = packets[packet.type];\n  var blob = new Blob([length.buffer, packet.data]);\n\n  return callback(blob);\n}\n\n/**\n * Encodes a packet with binary data in a base64 string\n *\n * @param {Object} packet, has `type` and `data`\n * @return {String} base64 encoded message\n */\n\nexports.encodeBase64Packet = function(packet, callback) {\n  var message = 'b' + exports.packets[packet.type];\n  if (Blob && packet.data instanceof global.Blob) {\n    var fr = new FileReader();\n    fr.onload = function() {\n      var b64 = fr.result.split(',')[1];\n      callback(message + b64);\n    };\n    return fr.readAsDataURL(packet.data);\n  }\n\n  var b64data;\n  try {\n    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n  } catch (e) {\n    // iPhone Safari doesn't let you apply with typed arrays\n    var typed = new Uint8Array(packet.data);\n    var basic = new Array(typed.length);\n    for (var i = 0; i < typed.length; i++) {\n      basic[i] = typed[i];\n    }\n    b64data = String.fromCharCode.apply(null, basic);\n  }\n  message += global.btoa(b64data);\n  return callback(message);\n};\n\n/**\n * Decodes a packet. Changes format to Blob if requested.\n *\n * @return {Object} with `type` and `data` (if any)\n * @api private\n */\n\nexports.decodePacket = function (data, binaryType, utf8decode) {\n  if (data === undefined) {\n    return err;\n  }\n  // String data\n  if (typeof data === 'string') {\n    if (data.charAt(0) === 'b') {\n      return exports.decodeBase64Packet(data.substr(1), binaryType);\n    }\n\n    if (utf8decode) {\n      data = tryDecode(data);\n      if (data === false) {\n        return err;\n      }\n    }\n    var type = data.charAt(0);\n\n    if (Number(type) != type || !packetslist[type]) {\n      return err;\n    }\n\n    if (data.length > 1) {\n      return { type: packetslist[type], data: data.substring(1) };\n    } else {\n      return { type: packetslist[type] };\n    }\n  }\n\n  var asArray = new Uint8Array(data);\n  var type = asArray[0];\n  var rest = sliceBuffer(data, 1);\n  if (Blob && binaryType === 'blob') {\n    rest = new Blob([rest]);\n  }\n  return { type: packetslist[type], data: rest };\n};\n\nfunction tryDecode(data) {\n  try {\n    data = utf8.decode(data, { strict: false });\n  } catch (e) {\n    return false;\n  }\n  return data;\n}\n\n/**\n * Decodes a packet encoded in a base64 string\n *\n * @param {String} base64 encoded message\n * @return {Object} with `type` and `data` (if any)\n */\n\nexports.decodeBase64Packet = function(msg, binaryType) {\n  var type = packetslist[msg.charAt(0)];\n  if (!base64encoder) {\n    return { type: type, data: { base64: true, data: msg.substr(1) } };\n  }\n\n  var data = base64encoder.decode(msg.substr(1));\n\n  if (binaryType === 'blob' && Blob) {\n    data = new Blob([data]);\n  }\n\n  return { type: type, data: data };\n};\n\n/**\n * Encodes multiple messages (payload).\n *\n *     <length>:data\n *\n * Example:\n *\n *     11:hello world2:hi\n *\n * If any contents are binary, they will be encoded as base64 strings. Base64\n * encoded strings are marked with a b before the length specifier\n *\n * @param {Array} packets\n * @api private\n */\n\nexports.encodePayload = function (packets, supportsBinary, callback) {\n  if (typeof supportsBinary === 'function') {\n    callback = supportsBinary;\n    supportsBinary = null;\n  }\n\n  var isBinary = hasBinary(packets);\n\n  if (supportsBinary && isBinary) {\n    if (Blob && !dontSendBlobs) {\n      return exports.encodePayloadAsBlob(packets, callback);\n    }\n\n    return exports.encodePayloadAsArrayBuffer(packets, callback);\n  }\n\n  if (!packets.length) {\n    return callback('0:');\n  }\n\n  function setLengthHeader(message) {\n    return message.length + ':' + message;\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {\n      doneCallback(null, setLengthHeader(message));\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(results.join(''));\n  });\n};\n\n/**\n * Async array map using after\n */\n\nfunction map(ary, each, done) {\n  var result = new Array(ary.length);\n  var next = after(ary.length, done);\n\n  var eachWithIndex = function(i, el, cb) {\n    each(el, function(error, msg) {\n      result[i] = msg;\n      cb(error, result);\n    });\n  };\n\n  for (var i = 0; i < ary.length; i++) {\n    eachWithIndex(i, ary[i], next);\n  }\n}\n\n/*\n * Decodes data when a payload is maybe expected. Possible binary contents are\n * decoded from their base64 representation\n *\n * @param {String} data, callback method\n * @api public\n */\n\nexports.decodePayload = function (data, binaryType, callback) {\n  if (typeof data !== 'string') {\n    return exports.decodePayloadAsBinary(data, binaryType, callback);\n  }\n\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var packet;\n  if (data === '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n  var length = '', n, msg;\n\n  for (var i = 0, l = data.length; i < l; i++) {\n    var chr = data.charAt(i);\n\n    if (chr !== ':') {\n      length += chr;\n      continue;\n    }\n\n    if (length === '' || (length != (n = Number(length)))) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    msg = data.substr(i + 1, n);\n\n    if (length != msg.length) {\n      // parser error - ignoring payload\n      return callback(err, 0, 1);\n    }\n\n    if (msg.length) {\n      packet = exports.decodePacket(msg, binaryType, false);\n\n      if (err.type === packet.type && err.data === packet.data) {\n        // parser error in individual packet - ignoring payload\n        return callback(err, 0, 1);\n      }\n\n      var ret = callback(packet, i + n, l);\n      if (false === ret) return;\n    }\n\n    // advance cursor\n    i += n;\n    length = '';\n  }\n\n  if (length !== '') {\n    // parser error - ignoring payload\n    return callback(err, 0, 1);\n  }\n\n};\n\n/**\n * Encodes multiple messages (payload) as binary.\n *\n * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n * 255><data>\n *\n * Example:\n * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n *\n * @param {Array} packets\n * @return {ArrayBuffer} encoded payload\n * @api private\n */\n\nexports.encodePayloadAsArrayBuffer = function(packets, callback) {\n  if (!packets.length) {\n    return callback(new ArrayBuffer(0));\n  }\n\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(data) {\n      return doneCallback(null, data);\n    });\n  }\n\n  map(packets, encodeOne, function(err, encodedPackets) {\n    var totalLength = encodedPackets.reduce(function(acc, p) {\n      var len;\n      if (typeof p === 'string'){\n        len = p.length;\n      } else {\n        len = p.byteLength;\n      }\n      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n    }, 0);\n\n    var resultArray = new Uint8Array(totalLength);\n\n    var bufferIndex = 0;\n    encodedPackets.forEach(function(p) {\n      var isString = typeof p === 'string';\n      var ab = p;\n      if (isString) {\n        var view = new Uint8Array(p.length);\n        for (var i = 0; i < p.length; i++) {\n          view[i] = p.charCodeAt(i);\n        }\n        ab = view.buffer;\n      }\n\n      if (isString) { // not true binary\n        resultArray[bufferIndex++] = 0;\n      } else { // true binary\n        resultArray[bufferIndex++] = 1;\n      }\n\n      var lenStr = ab.byteLength.toString();\n      for (var i = 0; i < lenStr.length; i++) {\n        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n      }\n      resultArray[bufferIndex++] = 255;\n\n      var view = new Uint8Array(ab);\n      for (var i = 0; i < view.length; i++) {\n        resultArray[bufferIndex++] = view[i];\n      }\n    });\n\n    return callback(resultArray.buffer);\n  });\n};\n\n/**\n * Encode as Blob\n */\n\nexports.encodePayloadAsBlob = function(packets, callback) {\n  function encodeOne(packet, doneCallback) {\n    exports.encodePacket(packet, true, true, function(encoded) {\n      var binaryIdentifier = new Uint8Array(1);\n      binaryIdentifier[0] = 1;\n      if (typeof encoded === 'string') {\n        var view = new Uint8Array(encoded.length);\n        for (var i = 0; i < encoded.length; i++) {\n          view[i] = encoded.charCodeAt(i);\n        }\n        encoded = view.buffer;\n        binaryIdentifier[0] = 0;\n      }\n\n      var len = (encoded instanceof ArrayBuffer)\n        ? encoded.byteLength\n        : encoded.size;\n\n      var lenStr = len.toString();\n      var lengthAry = new Uint8Array(lenStr.length + 1);\n      for (var i = 0; i < lenStr.length; i++) {\n        lengthAry[i] = parseInt(lenStr[i]);\n      }\n      lengthAry[lenStr.length] = 255;\n\n      if (Blob) {\n        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n        doneCallback(null, blob);\n      }\n    });\n  }\n\n  map(packets, encodeOne, function(err, results) {\n    return callback(new Blob(results));\n  });\n};\n\n/*\n * Decodes data when a payload is maybe expected. Strings are decoded by\n * interpreting each byte as a key code for entries marked to start with 0. See\n * description of encodePayloadAsBinary\n *\n * @param {ArrayBuffer} data, callback method\n * @api public\n */\n\nexports.decodePayloadAsBinary = function (data, binaryType, callback) {\n  if (typeof binaryType === 'function') {\n    callback = binaryType;\n    binaryType = null;\n  }\n\n  var bufferTail = data;\n  var buffers = [];\n\n  while (bufferTail.byteLength > 0) {\n    var tailArray = new Uint8Array(bufferTail);\n    var isString = tailArray[0] === 0;\n    var msgLength = '';\n\n    for (var i = 1; ; i++) {\n      if (tailArray[i] === 255) break;\n\n      // 310 = char length of Number.MAX_VALUE\n      if (msgLength.length > 310) {\n        return callback(err, 0, 1);\n      }\n\n      msgLength += tailArray[i];\n    }\n\n    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n    msgLength = parseInt(msgLength);\n\n    var msg = sliceBuffer(bufferTail, 0, msgLength);\n    if (isString) {\n      try {\n        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n      } catch (e) {\n        // iPhone Safari doesn't let you apply to typed arrays\n        var typed = new Uint8Array(msg);\n        msg = '';\n        for (var i = 0; i < typed.length; i++) {\n          msg += String.fromCharCode(typed[i]);\n        }\n      }\n    }\n\n    buffers.push(msg);\n    bufferTail = sliceBuffer(bufferTail, msgLength);\n  }\n\n  var total = buffers.length;\n  buffers.forEach(function(buffer, i) {\n    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n  });\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/browser.js\n// module id = 119\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-parser/lib/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\n\n/**\n * Creates a logger for the given subsystem\n *\n * @param {PeerId} [id]\n * @param {string} [subsystem]\n * @returns {debug}\n *\n * @private\n */\nexports.logger = (id, subsystem) => {\n  const name = ['bitswap']\n  if (subsystem) {\n    name.push(subsystem)\n  }\n  if (id) {\n    name.push(`${id.toB58String().slice(0, 8)}`)\n  }\n  const logger = debug(name.join(':'))\n  logger.error = debug(name.concat(['error']).join(':'))\n\n  return logger\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/utils.js\n// module id = 120\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.DAGNode = __webpack_require__(269)\nexports.DAGLink = __webpack_require__(96)\n\n/*\n * Functions to fulfil IPLD Format interface\n * https://github.com/ipld/interface-ipld-format\n */\nexports.resolver = __webpack_require__(941)\nexports.util = __webpack_require__(270)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/index.js\n// module id = 121\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a duplex stream is just a stream that is both readable and writable.\n// Since JS doesn't have multiple prototypal inheritance, this class\n// prototypally inherits from Readable, and then parasitically from\n// Writable.\n\nmodule.exports = Duplex;\n\n/*<replacement>*/\nvar objectKeys = Object.keys || function (obj) {\n  var keys = [];\n  for (var key in obj) keys.push(key);\n  return keys;\n}\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nvar Readable = __webpack_require__(433);\nvar Writable = __webpack_require__(435);\n\nutil.inherits(Duplex, Readable);\n\nforEach(objectKeys(Writable.prototype), function(method) {\n  if (!Duplex.prototype[method])\n    Duplex.prototype[method] = Writable.prototype[method];\n});\n\nfunction Duplex(options) {\n  if (!(this instanceof Duplex))\n    return new Duplex(options);\n\n  Readable.call(this, options);\n  Writable.call(this, options);\n\n  if (options && options.readable === false)\n    this.readable = false;\n\n  if (options && options.writable === false)\n    this.writable = false;\n\n  this.allowHalfOpen = true;\n  if (options && options.allowHalfOpen === false)\n    this.allowHalfOpen = false;\n\n  this.once('end', onend);\n}\n\n// the no-half-open enforcer\nfunction onend() {\n  // if we allow half-open state, or if the writable side ended,\n  // then we're ok.\n  if (this.allowHalfOpen || this._writableState.ended)\n    return;\n\n  // no more data can be written.\n  // But allow more writes to happen in this tick.\n  process.nextTick(this.end.bind(this));\n}\n\nfunction forEach (xs, f) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    f(xs[i], i);\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/lib/_stream_duplex.js\n// module id = 122\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/lib/_stream_duplex.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of basic PEM (Privacy Enhanced Mail) algorithms.\n *\n * See: RFC 1421.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2013-2014 Digital Bazaar, Inc.\n *\n * A Forge PEM object has the following fields:\n *\n * type: identifies the type of message (eg: \"RSA PRIVATE KEY\").\n *\n * procType: identifies the type of processing performed on the message,\n *   it has two subfields: version and type, eg: 4,ENCRYPTED.\n *\n * contentDomain: identifies the type of content in the message, typically\n *   only uses the value: \"RFC822\".\n *\n * dekInfo: identifies the message encryption algorithm and mode and includes\n *   any parameters for the algorithm, it has two subfields: algorithm and\n *   parameters, eg: DES-CBC,F8143EDE5960C597.\n *\n * headers: contains all other PEM encapsulated headers -- where order is\n *   significant (for pairing data like recipient ID + key info).\n *\n * body: the binary-encoded body.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\n// shortcut for pem API\nvar pem = module.exports = forge.pem = forge.pem || {};\n\n/**\n * Encodes (serializes) the given PEM object.\n *\n * @param msg the PEM message object to encode.\n * @param options the options to use:\n *          maxline the maximum characters per line for the body, (default: 64).\n *\n * @return the PEM-formatted string.\n */\npem.encode = function(msg, options) {\n  options = options || {};\n  var rval = '-----BEGIN ' + msg.type + '-----\\r\\n';\n\n  // encode special headers\n  var header;\n  if(msg.procType) {\n    header = {\n      name: 'Proc-Type',\n      values: [String(msg.procType.version), msg.procType.type]\n    };\n    rval += foldHeader(header);\n  }\n  if(msg.contentDomain) {\n    header = {name: 'Content-Domain', values: [msg.contentDomain]};\n    rval += foldHeader(header);\n  }\n  if(msg.dekInfo) {\n    header = {name: 'DEK-Info', values: [msg.dekInfo.algorithm]};\n    if(msg.dekInfo.parameters) {\n      header.values.push(msg.dekInfo.parameters);\n    }\n    rval += foldHeader(header);\n  }\n\n  if(msg.headers) {\n    // encode all other headers\n    for(var i = 0; i < msg.headers.length; ++i) {\n      rval += foldHeader(msg.headers[i]);\n    }\n  }\n\n  // terminate header\n  if(msg.procType) {\n    rval += '\\r\\n';\n  }\n\n  // add body\n  rval += forge.util.encode64(msg.body, options.maxline || 64) + '\\r\\n';\n\n  rval += '-----END ' + msg.type + '-----\\r\\n';\n  return rval;\n};\n\n/**\n * Decodes (deserializes) all PEM messages found in the given string.\n *\n * @param str the PEM-formatted string to decode.\n *\n * @return the PEM message objects in an array.\n */\npem.decode = function(str) {\n  var rval = [];\n\n  // split string into PEM messages (be lenient w/EOF on BEGIN line)\n  var rMessage = /\\s*-----BEGIN ([A-Z0-9- ]+)-----\\r?\\n?([\\x21-\\x7e\\s]+?(?:\\r?\\n\\r?\\n))?([:A-Za-z0-9+\\/=\\s]+?)-----END \\1-----/g;\n  var rHeader = /([\\x21-\\x7e]+):\\s*([\\x21-\\x7e\\s^:]+)/;\n  var rCRLF = /\\r?\\n/;\n  var match;\n  while(true) {\n    match = rMessage.exec(str);\n    if(!match) {\n      break;\n    }\n\n    var msg = {\n      type: match[1],\n      procType: null,\n      contentDomain: null,\n      dekInfo: null,\n      headers: [],\n      body: forge.util.decode64(match[3])\n    };\n    rval.push(msg);\n\n    // no headers\n    if(!match[2]) {\n      continue;\n    }\n\n    // parse headers\n    var lines = match[2].split(rCRLF);\n    var li = 0;\n    while(match && li < lines.length) {\n      // get line, trim any rhs whitespace\n      var line = lines[li].replace(/\\s+$/, '');\n\n      // RFC2822 unfold any following folded lines\n      for(var nl = li + 1; nl < lines.length; ++nl) {\n        var next = lines[nl];\n        if(!/\\s/.test(next[0])) {\n          break;\n        }\n        line += next;\n        li = nl;\n      }\n\n      // parse header\n      match = line.match(rHeader);\n      if(match) {\n        var header = {name: match[1], values: []};\n        var values = match[2].split(',');\n        for(var vi = 0; vi < values.length; ++vi) {\n          header.values.push(ltrim(values[vi]));\n        }\n\n        // Proc-Type must be the first header\n        if(!msg.procType) {\n          if(header.name !== 'Proc-Type') {\n            throw new Error('Invalid PEM formatted message. The first ' +\n              'encapsulated header must be \"Proc-Type\".');\n          } else if(header.values.length !== 2) {\n            throw new Error('Invalid PEM formatted message. The \"Proc-Type\" ' +\n              'header must have two subfields.');\n          }\n          msg.procType = {version: values[0], type: values[1]};\n        } else if(!msg.contentDomain && header.name === 'Content-Domain') {\n          // special-case Content-Domain\n          msg.contentDomain = values[0] || '';\n        } else if(!msg.dekInfo && header.name === 'DEK-Info') {\n          // special-case DEK-Info\n          if(header.values.length === 0) {\n            throw new Error('Invalid PEM formatted message. The \"DEK-Info\" ' +\n              'header must have at least one subfield.');\n          }\n          msg.dekInfo = {algorithm: values[0], parameters: values[1] || null};\n        } else {\n          msg.headers.push(header);\n        }\n      }\n\n      ++li;\n    }\n\n    if(msg.procType === 'ENCRYPTED' && !msg.dekInfo) {\n      throw new Error('Invalid PEM formatted message. The \"DEK-Info\" ' +\n        'header must be present if \"Proc-Type\" is \"ENCRYPTED\".');\n    }\n  }\n\n  if(rval.length === 0) {\n    throw new Error('Invalid PEM formatted message.');\n  }\n\n  return rval;\n};\n\nfunction foldHeader(header) {\n  var rval = header.name + ': ';\n\n  // ensure values with CRLF are folded\n  var values = [];\n  var insertSpace = function(match, $1) {\n    return ' ' + $1;\n  };\n  for(var i = 0; i < header.values.length; ++i) {\n    values.push(header.values[i].replace(/^(\\S+\\r\\n)/, insertSpace));\n  }\n  rval += values.join(',') + '\\r\\n';\n\n  // do folding\n  var length = 0;\n  var candidate = -1;\n  for(var i = 0; i < rval.length; ++i, ++length) {\n    if(length > 65 && candidate !== -1) {\n      var insert = rval[candidate];\n      if(insert === ',') {\n        ++candidate;\n        rval = rval.substr(0, candidate) + '\\r\\n ' + rval.substr(candidate);\n      } else {\n        rval = rval.substr(0, candidate) +\n          '\\r\\n' + insert + rval.substr(candidate + 1);\n      }\n      length = (i - candidate - 1);\n      candidate = -1;\n      ++i;\n    } else if(rval[i] === ' ' || rval[i] === '\\t' || rval[i] === ',') {\n      candidate = i;\n    }\n  }\n\n  return rval;\n}\n\nfunction ltrim(str) {\n  return str.replace(/^\\s+/, '');\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pem.js\n// module id = 123\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pem.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\n\n// prototype class for hash functions\nfunction Hash (blockSize, finalSize) {\n  this._block = Buffer.alloc(blockSize)\n  this._finalSize = finalSize\n  this._blockSize = blockSize\n  this._len = 0\n}\n\nHash.prototype.update = function (data, enc) {\n  if (typeof data === 'string') {\n    enc = enc || 'utf8'\n    data = Buffer.from(data, enc)\n  }\n\n  var block = this._block\n  var blockSize = this._blockSize\n  var length = data.length\n  var accum = this._len\n\n  for (var offset = 0; offset < length;) {\n    var assigned = accum % blockSize\n    var remainder = Math.min(length - offset, blockSize - assigned)\n\n    for (var i = 0; i < remainder; i++) {\n      block[assigned + i] = data[offset + i]\n    }\n\n    accum += remainder\n    offset += remainder\n\n    if ((accum % blockSize) === 0) {\n      this._update(block)\n    }\n  }\n\n  this._len += length\n  return this\n}\n\nHash.prototype.digest = function (enc) {\n  var rem = this._len % this._blockSize\n\n  this._block[rem] = 0x80\n\n  // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\n  // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\n  this._block.fill(0, rem + 1)\n\n  if (rem >= this._finalSize) {\n    this._update(this._block)\n    this._block.fill(0)\n  }\n\n  var bits = this._len * 8\n\n  // uint32\n  if (bits <= 0xffffffff) {\n    this._block.writeUInt32BE(bits, this._blockSize - 4)\n\n  // uint64\n  } else {\n    var lowBits = (bits & 0xffffffff) >>> 0\n    var highBits = (bits - lowBits) / 0x100000000\n\n    this._block.writeUInt32BE(highBits, this._blockSize - 8)\n    this._block.writeUInt32BE(lowBits, this._blockSize - 4)\n  }\n\n  this._update(this._block)\n  var hash = this._hash()\n\n  return enc ? hash.toString(enc) : hash\n}\n\nHash.prototype._update = function () {\n  throw new Error('_update must be implemented by subclass')\n}\n\nmodule.exports = Hash\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/hash.js\n// module id = 124\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/hash.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BN = __webpack_require__(30);\nvar BufferUtil = __webpack_require__(18);\nvar ec = __webpack_require__(67).curves.secp256k1;\nvar ecPoint = ec.curve.point.bind(ec.curve);\nvar ecPointFromX = ec.curve.pointFromX.bind(ec.curve);\n\n/**\n *\n * Instantiate a valid secp256k1 Point from the X and Y coordinates.\n *\n * @param {BN|String} x - The X coordinate\n * @param {BN|String} y - The Y coordinate\n * @link https://github.com/indutny/elliptic\n * @augments elliptic.curve.point\n * @throws {Error} A validation error if exists\n * @returns {Point} An instance of Point\n * @constructor\n */\nvar Point = function Point(x, y, isRed) {\n  var point = ecPoint(x, y, isRed);\n  point.validate();\n  return point;\n};\n\nPoint.prototype = Object.getPrototypeOf(ec.curve.point());\n\n/**\n *\n * Instantiate a valid secp256k1 Point from only the X coordinate\n *\n * @param {boolean} odd - If the Y coordinate is odd\n * @param {BN|String} x - The X coordinate\n * @throws {Error} A validation error if exists\n * @returns {Point} An instance of Point\n */\nPoint.fromX = function fromX(odd, x){\n  var point = ecPointFromX(odd, x);\n  point.validate();\n  return point;\n};\n\n/**\n *\n * Will return a secp256k1 ECDSA base point.\n *\n * @link https://en.bitcoin.it/wiki/Secp256k1\n * @returns {Point} An instance of the base point.\n */\nPoint.getG = function getG() {\n  return ec.curve.g;\n};\n\n/**\n *\n * Will return the max of range of valid private keys as governed by the secp256k1 ECDSA standard.\n *\n * @link https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys\n * @returns {BN} A BN instance of the number of points on the curve\n */\nPoint.getN = function getN() {\n  return new BN(ec.curve.n.toArray());\n};\n\nPoint.prototype._getX = Point.prototype.getX;\n\n/**\n *\n * Will return the X coordinate of the Point\n *\n * @returns {BN} A BN instance of the X coordinate\n */\nPoint.prototype.getX = function getX() {\n  return new BN(this._getX().toArray());\n};\n\nPoint.prototype._getY = Point.prototype.getY;\n\n/**\n *\n * Will return the Y coordinate of the Point\n *\n * @returns {BN} A BN instance of the Y coordinate\n */\nPoint.prototype.getY = function getY() {\n  return new BN(this._getY().toArray());\n};\n\n/**\n *\n * Will determine if the point is valid\n *\n * @link https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf\n * @param {Point} An instance of Point\n * @throws {Error} A validation error if exists\n * @returns {Point} An instance of the same Point\n */\nPoint.prototype.validate = function validate() {\n\n  if (this.isInfinity()){\n    throw new Error('Point cannot be equal to Infinity');\n  }\n\n  if (this.getX().cmp(BN.Zero) === 0 || this.getY().cmp(BN.Zero) === 0){\n    throw new Error('Invalid x,y value for curve, cannot equal 0.');\n  }\n\n  var p2 = ecPointFromX(this.getY().isOdd(), this.getX());\n\n  if (p2.y.cmp(this.y) !== 0) {\n    throw new Error('Invalid y value for curve.');\n  }\n\n  var xValidRange = (this.getX().gt(BN.Minus1) && this.getX().lt(Point.getN()));\n  var yValidRange = (this.getY().gt(BN.Minus1) && this.getY().lt(Point.getN()));\n\n  if ( !xValidRange || !yValidRange ) {\n    throw new Error('Point does not lie on the curve');\n  }\n\n  //todo: needs test case\n  if (!(this.mul(Point.getN()).isInfinity())) {\n    throw new Error('Point times N must be infinity');\n  }\n\n  return this;\n\n};\n\nPoint.pointToCompressed = function pointToCompressed(point) {\n  var xbuf = point.getX().toBuffer({size: 32});\n  var ybuf = point.getY().toBuffer({size: 32});\n\n  var prefix;\n  var odd = ybuf[ybuf.length - 1] % 2;\n  if (odd) {\n    prefix = new Buffer([0x03]);\n  } else {\n    prefix = new Buffer([0x02]);\n  }\n  return BufferUtil.concat([prefix, xbuf]);\n};\n\nmodule.exports = Point;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/point.js\n// module id = 125\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/point.js")},function(module,exports,__webpack_require__){eval("var hash = exports;\n\nhash.utils = __webpack_require__(1345);\nhash.common = __webpack_require__(1341);\nhash.sha = __webpack_require__(1344);\nhash.ripemd = __webpack_require__(1343);\nhash.hmac = __webpack_require__(1342);\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash.js\n// module id = 126\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst base = exports;\n\nbase.Reporter = __webpack_require__(582).Reporter;\nbase.DecoderBuffer = __webpack_require__(322).DecoderBuffer;\nbase.EncoderBuffer = __webpack_require__(322).EncoderBuffer;\nbase.Node = __webpack_require__(581);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/base/index.js\n// module id = 127\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/base/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _doParallel = __webpack_require__(163);\n\nvar _doParallel2 = _interopRequireDefault(_doParallel);\n\nvar _map = __webpack_require__(597);\n\nvar _map2 = _interopRequireDefault(_map);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array.  The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n *     // results is now an array of stats for each file\n * });\n */\nexports.default = (0, _doParallel2.default)(_map2.default);\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/map.js\n// module id = 128\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/map.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.concatUint8Array = exports.makeSeed = exports.add0x = exports.remove0x = exports.buf2bytes32 = exports.buf2hex = exports.pad = exports.hexToString = exports.hexToNum = exports.numToHex = exports.toFixed = exports.hashName = exports.checksum = exports.debugLog = exports.sha3 = undefined;\n\nvar _toConsumableArray2 = __webpack_require__(338);\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nexports.dec2bet = dec2bet;\nexports.bet2dec = bet2dec;\nexports.clearcode = clearcode;\n\nvar _debug = __webpack_require__(5);\n\nvar _debug2 = _interopRequireDefault(_debug);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar web3_utils = __webpack_require__(47);\n// const web3sha3 = require('web3-utils/src/soliditySha3.js')\n\nvar sha3 = exports.sha3 = web3_utils.soliditySha3;\n\nvar debugLog = exports.debugLog = function debugLog(data) {\n  var loglevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _config3.default.loglevel;\n  var enable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n  var log = (0, _debug2.default)(_config3.default.logname);\n\n  if (loglevel === 'hight') log.enabled = true;\n\n  loglevel === 'light' && !enable ? log.enabled = false : log.enabled = true;\n\n  if (loglevel === 'error') {\n    log = (0, _debug2.default)(loglevel);\n    log.enabled = true;\n  }\n\n  if (loglevel === 'none') log.enabled = false;\n\n  if (Array.isArray(data)) return log.apply(undefined, (0, _toConsumableArray3.default)(data));\n\n  return log(data);\n};\n\n/**\n * Convert BET from decimal, to \"human\" format, ex: 110000000 = 1.1BET\n * @param  {number} bets\n * @param  {number} toFixed - values after zero\n * @return {number} - bet in human format\n */\nfunction dec2bet(val) {\n  var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n\n  if (!val) return 0;\n  var n = web3_utils.fromWei(val + '');\n  return (+n).toFixed(r);\n}\n\n/**\n * Conver decimal, to BET format\n *\n * @export\n * @param {number} val - value in decimal format\n * @returns {number} - value in BETS FIRMAT\n *\n * @example\n * DCLib.Utils.bet2dec(31024891841492)\n * return: 310248.92\n */\nfunction bet2dec(val) {\n  var b = web3_utils.toWei(val + ''); // '' + (val * 100000000)\n  if (b.indexOf('.') > -1) {\n    b = b.split('.')[0] * 1;\n  }\n  return b * 1;\n}\n\n/**\n * @ignore\n */\nfunction clearcode(string) {\n  return string.toString().split('\\t').join('').split('\\n').join('').split('  ').join(' ');\n}\n\nvar checksum = exports.checksum = function checksum(string) {\n  return sha3(clearcode(string));\n};\n\nvar hashName = exports.hashName = function hashName(name) {\n  return sha3(name).substr(2, 8);\n};\n\nvar toFixed = exports.toFixed = function toFixed(value, precision) {\n  precision = Math.pow(10, precision);\n  return Math.ceil(value * precision) / precision;\n};\n\nvar numToHex = exports.numToHex = function numToHex(num) {\n  return num.toString(16);\n};\n\nvar hexToNum = exports.hexToNum = function hexToNum(str) {\n  return parseInt(str, 16);\n};\n\nvar hexToString = exports.hexToString = function hexToString(hex) {\n  var str = '';\n  for (var i = 0; i < hex.length; i += 2) {\n    str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\n  }\n  return str;\n};\n\nvar pad = exports.pad = function pad(num, size) {\n  var s = num + '';\n  while (s.length < size) {\n    s = '0' + s;\n  }return s;\n};\n\nvar buf2hex = exports.buf2hex = function buf2hex(buffer) {\n  return Array.prototype.map.call(new Uint8Array(buffer), function (x) {\n    return ('00' + x.toString(16)).slice(-2);\n  }).join('');\n};\nvar buf2bytes32 = exports.buf2bytes32 = function buf2bytes32(buffer) {\n  return '0x' + buf2hex(buffer);\n};\n\nvar remove0x = exports.remove0x = function remove0x(str) {\n  if (str.length > 2 && str.substr(0, 2) === '0x') {\n    str = str.substr(2);\n  }\n  return str;\n};\n\nvar add0x = exports.add0x = function add0x(str) {\n  if (str.substr(0, 2) !== '0x') {\n    str = '0x' + str;\n  }\n  return str;\n};\n\nvar makeSeed = exports.makeSeed = function makeSeed() {\n  var str = '0x';\n  var possible = 'abcdef0123456789';\n\n  for (var i = 0; i < 64; i++) {\n    if (new Date().getTime() % 2 === 0) {\n      str += possible.charAt(Math.floor(Math.random() * possible.length));\n    } else {\n      str += possible.charAt(Math.floor(Math.random() * (possible.length - 1)));\n    }\n  }\n\n  return sha3(numToHex(str));\n};\n\nvar concatUint8Array = exports.concatUint8Array = function concatUint8Array(buffer1, buffer2) {\n  var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\n  tmp.set(new Uint8Array(buffer1), 0);\n  tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\n  return tmp.buffer;\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/utils/utils.js\n// module id = 129\n// module chunks = 0\n\n//# sourceURL=utils/utils.js")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(679), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/promise.js\n// module id = 130\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/promise.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _promise = __webpack_require__(130);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (fn) {\n  return function () {\n    var gen = fn.apply(this, arguments);\n    return new _promise2.default(function (resolve, reject) {\n      function step(key, arg) {\n        try {\n          var info = gen[key](arg);\n          var value = info.value;\n        } catch (error) {\n          reject(error);\n          return;\n        }\n\n        if (info.done) {\n          resolve(value);\n        } else {\n          return _promise2.default.resolve(value).then(function (value) {\n            step("next", value);\n          }, function (err) {\n            step("throw", err);\n          });\n        }\n      }\n\n      return step("next");\n    });\n  };\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/asyncToGenerator.js\n// module id = 131\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/asyncToGenerator.js')},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1217);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/regenerator/index.js\n// module id = 132\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/regenerator/index.js")},function(module,exports){eval("// https://en.bitcoin.it/wiki/List_of_address_prefixes\n// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731\n\nmodule.exports = {\n  bitcoin: {\n    messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n    bech32: 'bc',\n    bip32: {\n      public: 0x0488b21e,\n      private: 0x0488ade4\n    },\n    pubKeyHash: 0x00,\n    scriptHash: 0x05,\n    wif: 0x80\n  },\n  testnet: {\n    messagePrefix: '\\x18Bitcoin Signed Message:\\n',\n    bech32: 'tb',\n    bip32: {\n      public: 0x043587cf,\n      private: 0x04358394\n    },\n    pubKeyHash: 0x6f,\n    scriptHash: 0xc4,\n    wif: 0xef\n  },\n  litecoin: {\n    messagePrefix: '\\x19Litecoin Signed Message:\\n',\n    bip32: {\n      public: 0x019da462,\n      private: 0x019d9cfe\n    },\n    pubKeyHash: 0x30,\n    scriptHash: 0x32,\n    wif: 0xb0\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/networks.js\n// module id = 133\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/networks.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {\n  var length = Math.min(a.length, b.length)\n  var buffer = new Buffer(length)\n\n  for (var i = 0; i < length; ++i) {\n    buffer[i] = a[i] ^ b[i]\n  }\n\n  return buffer\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/buffer-xor/index.js\n// module id = 134\n// module chunks = 0\n\n//# sourceURL=../node_modules/buffer-xor/index.js")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n  return toString.call(it).slice(8, -1);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_cof.js\n// module id = 135\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_cof.js")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(170);\nmodule.exports = function (fn, that, length) {\n  aFunction(fn);\n  if (that === undefined) return fn;\n  switch (length) {\n    case 1: return function (a) {\n      return fn.call(that, a);\n    };\n    case 2: return function (a, b) {\n      return fn.call(that, a, b);\n    };\n    case 3: return function (a, b, c) {\n      return fn.call(that, a, b, c);\n    };\n  }\n  return function (/* ...args */) {\n    return fn.apply(that, arguments);\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ctx.js\n// module id = 136\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_ctx.js")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(368);\nvar enumBugKeys = __webpack_require__(243);\n\nmodule.exports = Object.keys || function keys(O) {\n  return $keys(O, enumBugKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys.js\n// module id = 137\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-keys.js")},function(module,exports){eval("module.exports = function (bitmap, value) {\n  return {\n    enumerable: !(bitmap & 1),\n    configurable: !(bitmap & 2),\n    writable: !(bitmap & 4),\n    value: value\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_property-desc.js\n// module id = 138\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_property-desc.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(702)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(364)(String, 'String', function (iterated) {\n  this._t = String(iterated); // target\n  this._i = 0;                // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n  var O = this._t;\n  var index = this._i;\n  var point;\n  if (index >= O.length) return { value: undefined, done: true };\n  point = $at(O, index);\n  this._i += point.length;\n  return { value: point, done: false };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.string.iterator.js\n// module id = 139\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.string.iterator.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar inherits = __webpack_require__(3)\nvar Legacy = __webpack_require__(719)\nvar Base = __webpack_require__(77)\nvar Buffer = __webpack_require__(1).Buffer\nvar md5 = __webpack_require__(254)\nvar RIPEMD160 = __webpack_require__(306)\n\nvar sha = __webpack_require__(308)\n\nvar ZEROS = Buffer.alloc(128)\n\nfunction Hmac (alg, key) {\n  Base.call(this, 'digest')\n  if (typeof key === 'string') {\n    key = Buffer.from(key)\n  }\n\n  var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n  this._alg = alg\n  this._key = key\n  if (key.length > blocksize) {\n    var hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n    key = hash.update(key).digest()\n  } else if (key.length < blocksize) {\n    key = Buffer.concat([key, ZEROS], blocksize)\n  }\n\n  var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n  var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n  for (var i = 0; i < blocksize; i++) {\n    ipad[i] = key[i] ^ 0x36\n    opad[i] = key[i] ^ 0x5C\n  }\n  this._hash = alg === 'rmd160' ? new RIPEMD160() : sha(alg)\n  this._hash.update(ipad)\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n  this._hash.update(data)\n}\n\nHmac.prototype._final = function () {\n  var h = this._hash.digest()\n  var hash = this._alg === 'rmd160' ? new RIPEMD160() : sha(this._alg)\n  return hash.update(this._opad).update(h).digest()\n}\n\nmodule.exports = function createHmac (alg, key) {\n  alg = alg.toLowerCase()\n  if (alg === 'rmd160' || alg === 'ripemd160') {\n    return new Hmac('rmd160', key)\n  }\n  if (alg === 'md5') {\n    return new Legacy(md5, key)\n  }\n  return new Hmac(alg, key)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-hmac/browser.js\n// module id = 140\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-hmac/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(0).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/bn.js/lib/bn.js\n// module id = 141\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/bn.js/lib/bn.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst CID = __webpack_require__(14)\nconst multihashes = __webpack_require__(32)\n\nmodule.exports = function (codec, rawhash) {\n  const multihash = multihashes.encode(rawhash, 'keccak-256')\n  const cidVersion = 1\n  return new CID(cidVersion, codec, multihash)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eth-hash-to-cid/src/index.js\n// module id = 142\n// module chunks = 0\n\n//# sourceURL=../node_modules/eth-hash-to-cid/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar assert = __webpack_require__(43);\n\nfunction BlockHash() {\n  this.pending = null;\n  this.pendingTotal = 0;\n  this.blockSize = this.constructor.blockSize;\n  this.outSize = this.constructor.outSize;\n  this.hmacStrength = this.constructor.hmacStrength;\n  this.padLength = this.constructor.padLength / 8;\n  this.endian = 'big';\n\n  this._delta8 = this.blockSize / 8;\n  this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n  // Convert message to array, pad it, and join into 32bit blocks\n  msg = utils.toArray(msg, enc);\n  if (!this.pending)\n    this.pending = msg;\n  else\n    this.pending = this.pending.concat(msg);\n  this.pendingTotal += msg.length;\n\n  // Enough data, try updating\n  if (this.pending.length >= this._delta8) {\n    msg = this.pending;\n\n    // Process pending data in blocks\n    var r = msg.length % this._delta8;\n    this.pending = msg.slice(msg.length - r, msg.length);\n    if (this.pending.length === 0)\n      this.pending = null;\n\n    msg = utils.join32(msg, 0, msg.length - r, this.endian);\n    for (var i = 0; i < msg.length; i += this._delta32)\n      this._update(msg, i, i + this._delta32);\n  }\n\n  return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n  this.update(this._pad());\n  assert(this.pending === null);\n\n  return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n  var len = this.pendingTotal;\n  var bytes = this._delta8;\n  var k = bytes - ((len + this.padLength) % bytes);\n  var res = new Array(k + this.padLength);\n  res[0] = 0x80;\n  for (var i = 1; i < k; i++)\n    res[i] = 0;\n\n  // Append length\n  len <<= 3;\n  if (this.endian === 'big') {\n    for (var t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = len & 0xff;\n  } else {\n    res[i++] = len & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n\n    for (t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n  }\n\n  return res;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/common.js\n// module id = 143\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/common.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst waterfall = __webpack_require__(12)\nconst createIsLink = __webpack_require__(423)\nconst createUtil = __webpack_require__(424)\n\nmodule.exports = createResolver\n\nfunction createResolver (multicodec, EthObjClass, mapFromEthObject) {\n  const util = createUtil(multicodec, EthObjClass)\n  const resolver = {\n    multicodec: multicodec,\n    resolve: resolve,\n    tree: tree,\n    isLink: createIsLink(resolve),\n    _resolveFromEthObject: resolveFromEthObject,\n    _treeFromEthObject: treeFromEthObject,\n    _mapFromEthObject: mapFromEthObject\n  }\n\n  return {\n    resolver: resolver,\n    util: util,\n  }\n\n  /*\n   * tree: returns a flattened array with paths: values of the project. options\n   * are option (i.e. nestness)\n   */\n\n  function tree (binaryBlob, options, callback) {\n    // parse arguments\n    if (typeof options === 'function') {\n      callback = options\n      options = undefined\n    }\n    if (!options) {\n      options = {}\n    }\n\n    waterfall([\n      (cb) => util.deserialize(binaryBlob, cb),\n      (ethObj, cb) => treeFromEthObject(ethObj, options, cb)\n    ], callback)\n  }\n\n  function treeFromEthObject (ethObj, options, callback) {\n    waterfall([\n      (cb) => mapFromEthObject(ethObj, options, cb),\n      (tuples, cb) => cb(null, tuples.map((tuple) => tuple.path))\n    ], callback)\n  }\n\n  /*\n   * resolve: receives a path and a binary blob and returns the value on path,\n   * throw if not possible. `binaryBlob`` is an Ethereum binary block.\n   */\n\n  function resolve (binaryBlob, path, callback) {\n    waterfall([\n      (cb) => util.deserialize(binaryBlob, cb),\n      (ethObj, cb) => resolveFromEthObject(ethObj, path, cb)\n    ], callback)\n  }\n\n  function resolveFromEthObject (ethObj, path, callback) {\n    // root\n    if (!path || path === '/') {\n      const result = { value: ethObj, remainderPath: '' }\n      return callback(null, result)\n    }\n\n    // check tree results\n    mapFromEthObject(ethObj, {}, (err, paths) => {\n      if (err) return callback(err)\n\n      // parse path\n      const pathParts = path.split('/')\n      // find potential matches\n      let matches = paths.filter((child) => child.path === path.slice(0, child.path.length))\n      // only match whole path chunks\n      matches = matches.filter((child) => child.path.split('/').every((part, index) => part === pathParts[index]))\n      // take longest match\n      const sortedMatches = matches.sort((a, b) => a.path.length < b.path.length)\n      const treeResult = sortedMatches[0]\n\n      if (!treeResult) {\n        let err = new Error('Path not found (\"' + path + '\").')\n        return callback(err)\n      }\n\n      // slice off remaining path (after match and following slash)\n      const remainderPath = path.slice(treeResult.path.length + 1)\n\n      const result = {\n        value: treeResult.value,\n        remainderPath: remainderPath\n      }\n\n      return callback(null, result)\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/createResolver.js\n// module id = 144\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/createResolver.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multiaddr = __webpack_require__(21)\nconst PeerInfo = __webpack_require__(44)\nconst PeerId = __webpack_require__(26)\nconst proto = __webpack_require__(146)\n\nmodule.exports = function (swarm) {\n  /**\n   * Get b58 string from multiaddr or peerinfo\n   *\n   * @param {Multiaddr|PeerInfo} peer\n   * @return {*}\n   */\n  function getB58String (peer) {\n    let b58Id = null\n    if (multiaddr.isMultiaddr(peer)) {\n      const relayMa = multiaddr(peer)\n      b58Id = relayMa.getPeerId()\n    } else if (PeerInfo.isPeerInfo(peer)) {\n      b58Id = peer.id.toB58String()\n    }\n\n    return b58Id\n  }\n\n  /**\n   * Helper to make a peer info from a multiaddrs\n   *\n   * @param {Multiaddr|PeerInfo|PeerId} ma\n   * @param {Swarm} swarm\n   * @return {PeerInfo}\n   * @private\n   */\n  // TODO: this is ripped off of libp2p, should probably be a generally available util function\n  function peerInfoFromMa (peer) {\n    let p\n    // PeerInfo\n    if (PeerInfo.isPeerInfo(peer)) {\n      p = peer\n      // Multiaddr instance (not string)\n    } else if (multiaddr.isMultiaddr(peer)) {\n      const peerIdB58Str = peer.getPeerId()\n      try {\n        p = swarm._peerBook.get(peerIdB58Str)\n      } catch (err) {\n        p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))\n      }\n      p.multiaddrs.add(peer)\n      // PeerId\n    } else if (PeerId.isPeerId(peer)) {\n      const peerIdB58Str = peer.toB58String()\n      p = swarm._peerBook.has(peerIdB58Str) ? swarm._peerBook.get(peerIdB58Str) : peer\n    }\n\n    return p\n  }\n\n  /**\n   * Checks if peer has an existing connection\n   *\n   * @param {String} peerId\n   * @param {Swarm} swarm\n   * @return {Boolean}\n   */\n  function isPeerConnected (peerId) {\n    return swarm.muxedConns[peerId] || swarm.conns[peerId]\n  }\n\n  /**\n   * Write a response\n   *\n   * @param {StreamHandler} streamHandler\n   * @param {CircuitRelay.Status} status\n   * @param {Function} cb\n   * @returns {*}\n   */\n  function writeResponse (streamHandler, status, cb) {\n    cb = cb || (() => {})\n    streamHandler.write(proto.CircuitRelay.encode({\n      type: proto.CircuitRelay.Type.STATUS,\n      code: status\n    }))\n    return cb()\n  }\n\n  /**\n   * Validate incomming HOP/STOP message\n   *\n   * @param {CircuitRelay} msg\n   * @param {StreamHandler} streamHandler\n   * @param {CircuitRelay.Type} type\n   * @returns {*}\n   * @param {Function} cb\n   */\n  function validateAddrs (msg, streamHandler, type, cb) {\n    try {\n      msg.dstPeer.addrs.forEach((addr) => {\n        return multiaddr(addr)\n      })\n    } catch (err) {\n      writeResponse(streamHandler, type === proto.CircuitRelay.Type.HOP\n        ? proto.CircuitRelay.Status.HOP_DST_MULTIADDR_INVALID\n        : proto.CircuitRelay.Status.STOP_DST_MULTIADDR_INVALID)\n      return cb(err)\n    }\n\n    try {\n      msg.srcPeer.addrs.forEach((addr) => {\n        return multiaddr(addr)\n      })\n    } catch (err) {\n      writeResponse(streamHandler, type === proto.CircuitRelay.Type.HOP\n        ? proto.CircuitRelay.Status.HOP_SRC_MULTIADDR_INVALID\n        : proto.CircuitRelay.Status.STOP_SRC_MULTIADDR_INVALID)\n      return cb(err)\n    }\n\n    return cb(null)\n  }\n\n  return {\n    getB58String: getB58String,\n    peerInfoFromMa: peerInfoFromMa,\n    isPeerConnected: isPeerConnected,\n    validateAddrs: validateAddrs,\n    writeResponse: writeResponse\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit/utils.js\n// module id = 145\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst protobuf = __webpack_require__(64)\nmodule.exports = protobuf(__webpack_require__(980))\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/protocol/index.js\n// module id = 146\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/protocol/index.js")},function(module,exports){eval("/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isObject.js\n// module id = 147\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isObject.js")},function(module,exports,__webpack_require__){eval("/**\n * Hash-based Message Authentication Code implementation. Requires a message\n * digest object that can be obtained, for example, from forge.md.sha1 or\n * forge.md.md5.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(72);\n__webpack_require__(9);\n\n/* HMAC API */\nvar hmac = module.exports = forge.hmac = forge.hmac || {};\n\n/**\n * Creates an HMAC object that uses the given message digest object.\n *\n * @return an HMAC object.\n */\nhmac.create = function() {\n  // the hmac key to use\n  var _key = null;\n\n  // the message digest to use\n  var _md = null;\n\n  // the inner padding\n  var _ipadding = null;\n\n  // the outer padding\n  var _opadding = null;\n\n  // hmac context\n  var ctx = {};\n\n  /**\n   * Starts or restarts the HMAC with the given key and message digest.\n   *\n   * @param md the message digest to use, null to reuse the previous one,\n   *           a string to use builtin 'sha1', 'md5', 'sha256'.\n   * @param key the key to use as a string, array of bytes, byte buffer,\n   *           or null to reuse the previous key.\n   */\n  ctx.start = function(md, key) {\n    if(md !== null) {\n      if(typeof md === 'string') {\n        // create builtin message digest\n        md = md.toLowerCase();\n        if(md in forge.md.algorithms) {\n          _md = forge.md.algorithms[md].create();\n        } else {\n          throw new Error('Unknown hash algorithm \"' + md + '\"');\n        }\n      } else {\n        // store message digest\n        _md = md;\n      }\n    }\n\n    if(key === null) {\n      // reuse previous key\n      key = _key;\n    } else {\n      if(typeof key === 'string') {\n        // convert string into byte buffer\n        key = forge.util.createBuffer(key);\n      } else if(forge.util.isArray(key)) {\n        // convert byte array into byte buffer\n        var tmp = key;\n        key = forge.util.createBuffer();\n        for(var i = 0; i < tmp.length; ++i) {\n          key.putByte(tmp[i]);\n        }\n      }\n\n      // if key is longer than blocksize, hash it\n      var keylen = key.length();\n      if(keylen > _md.blockLength) {\n        _md.start();\n        _md.update(key.bytes());\n        key = _md.digest();\n      }\n\n      // mix key into inner and outer padding\n      // ipadding = [0x36 * blocksize] ^ key\n      // opadding = [0x5C * blocksize] ^ key\n      _ipadding = forge.util.createBuffer();\n      _opadding = forge.util.createBuffer();\n      keylen = key.length();\n      for(var i = 0; i < keylen; ++i) {\n        var tmp = key.at(i);\n        _ipadding.putByte(0x36 ^ tmp);\n        _opadding.putByte(0x5C ^ tmp);\n      }\n\n      // if key is shorter than blocksize, add additional padding\n      if(keylen < _md.blockLength) {\n        var tmp = _md.blockLength - keylen;\n        for(var i = 0; i < tmp; ++i) {\n          _ipadding.putByte(0x36);\n          _opadding.putByte(0x5C);\n        }\n      }\n      _key = key;\n      _ipadding = _ipadding.bytes();\n      _opadding = _opadding.bytes();\n    }\n\n    // digest is done like so: hash(opadding | hash(ipadding | message))\n\n    // prepare to do inner hash\n    // hash(ipadding | message)\n    _md.start();\n    _md.update(_ipadding);\n  };\n\n  /**\n   * Updates the HMAC with the given message bytes.\n   *\n   * @param bytes the bytes to update with.\n   */\n  ctx.update = function(bytes) {\n    _md.update(bytes);\n  };\n\n  /**\n   * Produces the Message Authentication Code (MAC).\n   *\n   * @return a byte buffer containing the digest value.\n   */\n  ctx.getMac = function() {\n    // digest is done like so: hash(opadding | hash(ipadding | message))\n    // here we do the outer hashing\n    var inner = _md.digest().bytes();\n    _md.start();\n    _md.update(_opadding);\n    _md.update(inner);\n    return _md.digest();\n  };\n  // alias for getMac\n  ctx.digest = ctx.getMac;\n\n  return ctx;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/hmac.js\n// module id = 148\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/hmac.js")},function(module,exports,__webpack_require__){eval("/**\n * Node.js module for Forge.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2016 Digital Bazaar, Inc.\n */\nmodule.exports = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(1124);\n__webpack_require__(71);\n__webpack_require__(289);\n__webpack_require__(482);\n__webpack_require__(197);\n__webpack_require__(1126);\n__webpack_require__(148);\n__webpack_require__(1127);\n__webpack_require__(483);\n__webpack_require__(1128);\n__webpack_require__(484);\n__webpack_require__(291);\n__webpack_require__(123);\n__webpack_require__(486);\n__webpack_require__(487);\n__webpack_require__(1130);\n__webpack_require__(489);\n__webpack_require__(490);\n__webpack_require__(491);\n__webpack_require__(292);\n__webpack_require__(52);\n__webpack_require__(492);\n__webpack_require__(1131);\n__webpack_require__(1132);\n__webpack_require__(495);\n__webpack_require__(9);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/index.js\n// module id = 149\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/index.js")},function(module,exports,__webpack_require__){eval("/**\n * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(72);\n__webpack_require__(9);\n\nvar sha1 = module.exports = forge.sha1 = forge.sha1 || {};\nforge.md.sha1 = forge.md.algorithms.sha1 = sha1;\n\n/**\n * Creates a SHA-1 message digest object.\n *\n * @return a message digest object.\n */\nsha1.create = function() {\n  // do initialization as necessary\n  if(!_initialized) {\n    _init();\n  }\n\n  // SHA-1 state contains five 32-bit integers\n  var _state = null;\n\n  // input buffer\n  var _input = forge.util.createBuffer();\n\n  // used for word storage\n  var _w = new Array(80);\n\n  // message digest object\n  var md = {\n    algorithm: 'sha1',\n    blockLength: 64,\n    digestLength: 20,\n    // 56-bit length of message so far (does not including padding)\n    messageLength: 0,\n    // true message length\n    fullMessageLength: null,\n    // size of message length in bytes\n    messageLengthSize: 8\n  };\n\n  /**\n   * Starts the digest.\n   *\n   * @return this digest object.\n   */\n  md.start = function() {\n    // up to 56-bit message length for convenience\n    md.messageLength = 0;\n\n    // full message length (set md.messageLength64 for backwards-compatibility)\n    md.fullMessageLength = md.messageLength64 = [];\n    var int32s = md.messageLengthSize / 4;\n    for(var i = 0; i < int32s; ++i) {\n      md.fullMessageLength.push(0);\n    }\n    _input = forge.util.createBuffer();\n    _state = {\n      h0: 0x67452301,\n      h1: 0xEFCDAB89,\n      h2: 0x98BADCFE,\n      h3: 0x10325476,\n      h4: 0xC3D2E1F0\n    };\n    return md;\n  };\n  // start digest automatically for first time\n  md.start();\n\n  /**\n   * Updates the digest with the given message input. The given input can\n   * treated as raw input (no encoding will be applied) or an encoding of\n   * 'utf8' maybe given to encode the input using UTF-8.\n   *\n   * @param msg the message input to update with.\n   * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n   *\n   * @return this digest object.\n   */\n  md.update = function(msg, encoding) {\n    if(encoding === 'utf8') {\n      msg = forge.util.encodeUtf8(msg);\n    }\n\n    // update message length\n    var len = msg.length;\n    md.messageLength += len;\n    len = [(len / 0x100000000) >>> 0, len >>> 0];\n    for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n      md.fullMessageLength[i] += len[1];\n      len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n      md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n      len[0] = ((len[1] / 0x100000000) >>> 0);\n    }\n\n    // add bytes to input buffer\n    _input.putBytes(msg);\n\n    // process bytes\n    _update(_state, _w, _input);\n\n    // compact input buffer every 2K or if empty\n    if(_input.read > 2048 || _input.length() === 0) {\n      _input.compact();\n    }\n\n    return md;\n  };\n\n   /**\n    * Produces the digest.\n    *\n    * @return a byte buffer containing the digest value.\n    */\n   md.digest = function() {\n    /* Note: Here we copy the remaining bytes in the input buffer and\n    add the appropriate SHA-1 padding. Then we do the final update\n    on a copy of the state so that if the user wants to get\n    intermediate digests they can do so. */\n\n    /* Determine the number of bytes that must be added to the message\n    to ensure its length is congruent to 448 mod 512. In other words,\n    the data to be digested must be a multiple of 512 bits (or 128 bytes).\n    This data includes the message, some padding, and the length of the\n    message. Since the length of the message will be encoded as 8 bytes (64\n    bits), that means that the last segment of the data must have 56 bytes\n    (448 bits) of message and padding. Therefore, the length of the message\n    plus the padding must be congruent to 448 mod 512 because\n    512 - 128 = 448.\n\n    In order to fill up the message length it must be filled with\n    padding that begins with 1 bit followed by all 0 bits. Padding\n    must *always* be present, so if the message length is already\n    congruent to 448 mod 512, then 512 padding bits must be added. */\n\n    var finalBlock = forge.util.createBuffer();\n    finalBlock.putBytes(_input.bytes());\n\n    // compute remaining size to be digested (include message length size)\n    var remaining = (\n      md.fullMessageLength[md.fullMessageLength.length - 1] +\n      md.messageLengthSize);\n\n    // add padding for overflow blockSize - overflow\n    // _padding starts with 1 byte with first bit is set (byte value 128), then\n    // there may be up to (blockSize - 1) other pad bytes\n    var overflow = remaining & (md.blockLength - 1);\n    finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n    // serialize message length in bits in big-endian order; since length\n    // is stored in bytes we multiply by 8 and add carry from next int\n    var next, carry;\n    var bits = md.fullMessageLength[0] * 8;\n    for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n      next = md.fullMessageLength[i + 1] * 8;\n      carry = (next / 0x100000000) >>> 0;\n      bits += carry;\n      finalBlock.putInt32(bits >>> 0);\n      bits = next >>> 0;\n    }\n    finalBlock.putInt32(bits);\n\n    var s2 = {\n      h0: _state.h0,\n      h1: _state.h1,\n      h2: _state.h2,\n      h3: _state.h3,\n      h4: _state.h4\n    };\n    _update(s2, _w, finalBlock);\n    var rval = forge.util.createBuffer();\n    rval.putInt32(s2.h0);\n    rval.putInt32(s2.h1);\n    rval.putInt32(s2.h2);\n    rval.putInt32(s2.h3);\n    rval.putInt32(s2.h4);\n    return rval;\n  };\n\n  return md;\n};\n\n// sha-1 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n  // create padding\n  _padding = String.fromCharCode(128);\n  _padding += forge.util.fillString(String.fromCharCode(0x00), 64);\n\n  // now initialized\n  _initialized = true;\n}\n\n/**\n * Updates a SHA-1 state with the given byte buffer.\n *\n * @param s the SHA-1 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n  // consume 512 bit (64 byte) chunks\n  var t, a, b, c, d, e, f, i;\n  var len = bytes.length();\n  while(len >= 64) {\n    // the w array will be populated with sixteen 32-bit big-endian words\n    // and then extended into 80 32-bit words according to SHA-1 algorithm\n    // and for 32-79 using Max Locktyukhin's optimization\n\n    // initialize hash value for this chunk\n    a = s.h0;\n    b = s.h1;\n    c = s.h2;\n    d = s.h3;\n    e = s.h4;\n\n    // round 1\n    for(i = 0; i < 16; ++i) {\n      t = bytes.getInt32();\n      w[i] = t;\n      f = d ^ (b & (c ^ d));\n      t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n    for(; i < 20; ++i) {\n      t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);\n      t = (t << 1) | (t >>> 31);\n      w[i] = t;\n      f = d ^ (b & (c ^ d));\n      t = ((a << 5) | (a >>> 27)) + f + e + 0x5A827999 + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n    // round 2\n    for(; i < 32; ++i) {\n      t = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);\n      t = (t << 1) | (t >>> 31);\n      w[i] = t;\n      f = b ^ c ^ d;\n      t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n    for(; i < 40; ++i) {\n      t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n      t = (t << 2) | (t >>> 30);\n      w[i] = t;\n      f = b ^ c ^ d;\n      t = ((a << 5) | (a >>> 27)) + f + e + 0x6ED9EBA1 + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n    // round 3\n    for(; i < 60; ++i) {\n      t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n      t = (t << 2) | (t >>> 30);\n      w[i] = t;\n      f = (b & c) | (d & (b ^ c));\n      t = ((a << 5) | (a >>> 27)) + f + e + 0x8F1BBCDC + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n    // round 4\n    for(; i < 80; ++i) {\n      t = (w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32]);\n      t = (t << 2) | (t >>> 30);\n      w[i] = t;\n      f = b ^ c ^ d;\n      t = ((a << 5) | (a >>> 27)) + f + e + 0xCA62C1D6 + t;\n      e = d;\n      d = c;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      c = ((b << 30) | (b >>> 2)) >>> 0;\n      b = a;\n      a = t;\n    }\n\n    // update hash state\n    s.h0 = (s.h0 + a) | 0;\n    s.h1 = (s.h1 + b) | 0;\n    s.h2 = (s.h2 + c) | 0;\n    s.h3 = (s.h3 + d) | 0;\n    s.h4 = (s.h4 + e) | 0;\n\n    len -= 64;\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/sha1.js\n// module id = 150\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/sha1.js")},function(module,exports,__webpack_require__){eval("var asn1 = exports;\n\nasn1.bignum = __webpack_require__(17);\n\nasn1.define = __webpack_require__(1141).define;\nasn1.base = __webpack_require__(152);\nasn1.constants = __webpack_require__(498);\nasn1.decoders = __webpack_require__(1145);\nasn1.encoders = __webpack_require__(1147);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1.js\n// module id = 151\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1.js")},function(module,exports,__webpack_require__){eval("var base = exports;\n\nbase.Reporter = __webpack_require__(1143).Reporter;\nbase.DecoderBuffer = __webpack_require__(497).DecoderBuffer;\nbase.EncoderBuffer = __webpack_require__(497).EncoderBuffer;\nbase.Node = __webpack_require__(1142);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/index.js\n// module id = 152\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function drain (op, done) {\n  var read, abort\n\n  function sink (_read) {\n    read = _read\n    if(abort) return sink.abort()\n    //this function is much simpler to write if you\n    //just use recursion, but by using a while loop\n    //we do not blow the stack if the stream happens to be sync.\n    ;(function next() {\n        var loop = true, cbed = false\n        while(loop) {\n          cbed = false\n          read(null, function (end, data) {\n            cbed = true\n            if(end = end || abort) {\n              loop = false\n              if(done) done(end === true ? null : end)\n              else if(end && end !== true)\n                throw end\n            }\n            else if(op && false === op(data) || abort) {\n              loop = false\n              read(abort || true, done || function () {})\n            }\n            else if(!loop){\n              next()\n            }\n          })\n          if(!cbed) {\n            loop = false\n            return\n          }\n        }\n      })()\n  }\n\n  sink.abort = function (err, cb) {\n    if('function' == typeof err)\n      cb = err, err = true\n    abort = err || true\n    if(read) return read(abort, cb || function () {})\n  }\n\n  return sink\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/drain.js\n// module id = 153\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/drain.js")},function(module,exports){eval("module.exports = function prop (key) {\n  return key && (\n    'string' == typeof key\n    ? function (data) { return data[key] }\n    : 'object' === typeof key && 'function' === typeof key.exec //regexp\n    ? function (data) { var v = key.exec(data); return v && v[0] }\n    : key\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/util/prop.js\n// module id = 154\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/util/prop.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const assert = __webpack_require__(16)\n/**\n * RLP Encoding based on: https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP\n * This function takes in a data, convert it to buffer if not, and a length for recursion\n *\n * @param {Buffer,String,Integer,Array} data - will be converted to buffer\n * @returns {Buffer} - returns buffer of encoded data\n **/\nexports.encode = function (input) {\n  if (input instanceof Array) {\n    var output = []\n    for (var i = 0; i < input.length; i++) {\n      output.push(exports.encode(input[i]))\n    }\n    var buf = Buffer.concat(output)\n    return Buffer.concat([encodeLength(buf.length, 192), buf])\n  } else {\n    input = toBuffer(input)\n    if (input.length === 1 && input[0] < 128) {\n      return input\n    } else {\n      return Buffer.concat([encodeLength(input.length, 128), input])\n    }\n  }\n}\n\nfunction safeParseInt (v, base) {\n  if (v.slice(0, 2) === '00') {\n    throw (new Error('invalid RLP: extra zeros'))\n  }\n\n  return parseInt(v, base)\n}\n\nfunction encodeLength (len, offset) {\n  if (len < 56) {\n    return new Buffer([len + offset])\n  } else {\n    var hexLength = intToHex(len)\n    var lLength = hexLength.length / 2\n    var firstByte = intToHex(offset + 55 + lLength)\n    return new Buffer(firstByte + hexLength, 'hex')\n  }\n}\n\n/**\n * RLP Decoding based on: {@link https://github.com/ethereum/wiki/wiki/%5BEnglish%5D-RLP|RLP}\n * @param {Buffer,String,Integer,Array} data - will be converted to buffer\n * @returns {Array} - returns decode Array of Buffers containg the original message\n **/\nexports.decode = function (input, stream) {\n  if (!input || input.length === 0) {\n    return new Buffer([])\n  }\n\n  input = toBuffer(input)\n  var decoded = _decode(input)\n\n  if (stream) {\n    return decoded\n  }\n\n  assert.equal(decoded.remainder.length, 0, 'invalid remainder')\n  return decoded.data\n}\n\nexports.getLength = function (input) {\n  if (!input || input.length === 0) {\n    return new Buffer([])\n  }\n\n  input = toBuffer(input)\n  var firstByte = input[0]\n  if (firstByte <= 0x7f) {\n    return input.length\n  } else if (firstByte <= 0xb7) {\n    return firstByte - 0x7f\n  } else if (firstByte <= 0xbf) {\n    return firstByte - 0xb6\n  } else if (firstByte <= 0xf7) {\n    // a list between  0-55 bytes long\n    return firstByte - 0xbf\n  } else {\n    // a list  over 55 bytes long\n    var llength = firstByte - 0xf6\n    var length = safeParseInt(input.slice(1, llength).toString('hex'), 16)\n    return llength + length\n  }\n}\n\nfunction _decode (input) {\n  var length, llength, data, innerRemainder, d\n  var decoded = []\n  var firstByte = input[0]\n\n  if (firstByte <= 0x7f) {\n    // a single byte whose value is in the [0x00, 0x7f] range, that byte is its own RLP encoding.\n    return {\n      data: input.slice(0, 1),\n      remainder: input.slice(1)\n    }\n  } else if (firstByte <= 0xb7) {\n    // string is 0-55 bytes long. A single byte with value 0x80 plus the length of the string followed by the string\n    // The range of the first byte is [0x80, 0xb7]\n    length = firstByte - 0x7f\n\n    // set 0x80 null to 0\n    if (firstByte === 0x80) {\n      data = new Buffer([])\n    } else {\n      data = input.slice(1, length)\n    }\n\n    if (length === 2 && data[0] < 0x80) {\n      throw new Error('invalid rlp encoding: byte must be less 0x80')\n    }\n\n    return {\n      data: data,\n      remainder: input.slice(length)\n    }\n  } else if (firstByte <= 0xbf) {\n    llength = firstByte - 0xb6\n    length = safeParseInt(input.slice(1, llength).toString('hex'), 16)\n    data = input.slice(llength, length + llength)\n    if (data.length < length) {\n      throw (new Error('invalid RLP'))\n    }\n\n    return {\n      data: data,\n      remainder: input.slice(length + llength)\n    }\n  } else if (firstByte <= 0xf7) {\n    // a list between  0-55 bytes long\n    length = firstByte - 0xbf\n    innerRemainder = input.slice(1, length)\n    while (innerRemainder.length) {\n      d = _decode(innerRemainder)\n      decoded.push(d.data)\n      innerRemainder = d.remainder\n    }\n\n    return {\n      data: decoded,\n      remainder: input.slice(length)\n    }\n  } else {\n    // a list  over 55 bytes long\n    llength = firstByte - 0xf6\n    length = safeParseInt(input.slice(1, llength).toString('hex'), 16)\n    var totalLength = llength + length\n    if (totalLength > input.length) {\n      throw new Error('invalid rlp: total length is larger than the data')\n    }\n\n    innerRemainder = input.slice(llength, totalLength)\n    if (innerRemainder.length === 0) {\n      throw new Error('invalid rlp, List has a invalid length')\n    }\n\n    while (innerRemainder.length) {\n      d = _decode(innerRemainder)\n      decoded.push(d.data)\n      innerRemainder = d.remainder\n    }\n    return {\n      data: decoded,\n      remainder: input.slice(totalLength)\n    }\n  }\n}\n\nfunction isHexPrefixed (str) {\n  return str.slice(0, 2) === '0x'\n}\n\n// Removes 0x from a given String\nfunction stripHexPrefix (str) {\n  if (typeof str !== 'string') {\n    return str\n  }\n  return isHexPrefixed(str) ? str.slice(2) : str\n}\n\nfunction intToHex (i) {\n  var hex = i.toString(16)\n  if (hex.length % 2) {\n    hex = '0' + hex\n  }\n\n  return hex\n}\n\nfunction padToEven (a) {\n  if (a.length % 2) a = '0' + a\n  return a\n}\n\nfunction intToBuffer (i) {\n  var hex = intToHex(i)\n  return new Buffer(hex, 'hex')\n}\n\nfunction toBuffer (v) {\n  if (!Buffer.isBuffer(v)) {\n    if (typeof v === 'string') {\n      if (isHexPrefixed(v)) {\n        v = new Buffer(padToEven(stripHexPrefix(v)), 'hex')\n      } else {\n        v = new Buffer(v)\n      }\n    } else if (typeof v === 'number') {\n      if (!v) {\n        v = new Buffer([])\n      } else {\n        v = intToBuffer(v)\n      }\n    } else if (v === null || v === undefined) {\n      v = new Buffer([])\n    } else if (v.toArray) {\n      // converts a BN to a Buffer\n      v = new Buffer(v.toArray())\n    } else {\n      throw new Error('invalid type')\n    }\n  }\n  return v\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/rlp/index.js\n// module id = 155\n// module chunks = 0\n\n//# sourceURL=../node_modules/rlp/index.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(1).Buffer;\n/*</replacement>*/\n\nvar isEncoding = Buffer.isEncoding || function (encoding) {\n  encoding = '' + encoding;\n  switch (encoding && encoding.toLowerCase()) {\n    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':\n      return true;\n    default:\n      return false;\n  }\n};\n\nfunction _normalizeEncoding(enc) {\n  if (!enc) return 'utf8';\n  var retried;\n  while (true) {\n    switch (enc) {\n      case 'utf8':\n      case 'utf-8':\n        return 'utf8';\n      case 'ucs2':\n      case 'ucs-2':\n      case 'utf16le':\n      case 'utf-16le':\n        return 'utf16le';\n      case 'latin1':\n      case 'binary':\n        return 'latin1';\n      case 'base64':\n      case 'ascii':\n      case 'hex':\n        return enc;\n      default:\n        if (retried) return; // undefined\n        enc = ('' + enc).toLowerCase();\n        retried = true;\n    }\n  }\n};\n\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\n// modules monkey-patch it to support additional encodings\nfunction normalizeEncoding(enc) {\n  var nenc = _normalizeEncoding(enc);\n  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);\n  return nenc || enc;\n}\n\n// StringDecoder provides an interface for efficiently splitting a series of\n// buffers into a series of JS strings without breaking apart multi-byte\n// characters.\nexports.StringDecoder = StringDecoder;\nfunction StringDecoder(encoding) {\n  this.encoding = normalizeEncoding(encoding);\n  var nb;\n  switch (this.encoding) {\n    case 'utf16le':\n      this.text = utf16Text;\n      this.end = utf16End;\n      nb = 4;\n      break;\n    case 'utf8':\n      this.fillLast = utf8FillLast;\n      nb = 4;\n      break;\n    case 'base64':\n      this.text = base64Text;\n      this.end = base64End;\n      nb = 3;\n      break;\n    default:\n      this.write = simpleWrite;\n      this.end = simpleEnd;\n      return;\n  }\n  this.lastNeed = 0;\n  this.lastTotal = 0;\n  this.lastChar = Buffer.allocUnsafe(nb);\n}\n\nStringDecoder.prototype.write = function (buf) {\n  if (buf.length === 0) return '';\n  var r;\n  var i;\n  if (this.lastNeed) {\n    r = this.fillLast(buf);\n    if (r === undefined) return '';\n    i = this.lastNeed;\n    this.lastNeed = 0;\n  } else {\n    i = 0;\n  }\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\n  return r || '';\n};\n\nStringDecoder.prototype.end = utf8End;\n\n// Returns only complete characters in a Buffer\nStringDecoder.prototype.text = utf8Text;\n\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\nStringDecoder.prototype.fillLast = function (buf) {\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\n  this.lastNeed -= buf.length;\n};\n\n// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a\n// continuation byte. If an invalid byte is detected, -2 is returned.\nfunction utf8CheckByte(byte) {\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n  return byte >> 6 === 0x02 ? -1 : -2;\n}\n\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\n// needed to complete the UTF-8 character (if applicable) are returned.\nfunction utf8CheckIncomplete(self, buf, i) {\n  var j = buf.length - 1;\n  if (j < i) return 0;\n  var nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 1;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) self.lastNeed = nb - 2;\n    return nb;\n  }\n  if (--j < i || nb === -2) return 0;\n  nb = utf8CheckByte(buf[j]);\n  if (nb >= 0) {\n    if (nb > 0) {\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\n    }\n    return nb;\n  }\n  return 0;\n}\n\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\n// needed or are available. If we see a non-continuation byte where we expect\n// one, we \"replace\" the validated continuation bytes we've seen so far with\n// a single UTF-8 replacement character ('\\ufffd'), to match v8's UTF-8 decoding\n// behavior. The continuation byte check is included three times in the case\n// where all of the continuation bytes for a character exist in the same buffer.\n// It is also done this way as a slight performance increase instead of using a\n// loop.\nfunction utf8CheckExtraBytes(self, buf, p) {\n  if ((buf[0] & 0xC0) !== 0x80) {\n    self.lastNeed = 0;\n    return '\\ufffd';\n  }\n  if (self.lastNeed > 1 && buf.length > 1) {\n    if ((buf[1] & 0xC0) !== 0x80) {\n      self.lastNeed = 1;\n      return '\\ufffd';\n    }\n    if (self.lastNeed > 2 && buf.length > 2) {\n      if ((buf[2] & 0xC0) !== 0x80) {\n        self.lastNeed = 2;\n        return '\\ufffd';\n      }\n    }\n  }\n}\n\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\nfunction utf8FillLast(buf) {\n  var p = this.lastTotal - this.lastNeed;\n  var r = utf8CheckExtraBytes(this, buf, p);\n  if (r !== undefined) return r;\n  if (this.lastNeed <= buf.length) {\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\n  }\n  buf.copy(this.lastChar, p, 0, buf.length);\n  this.lastNeed -= buf.length;\n}\n\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\n// partial character, the character's bytes are buffered until the required\n// number of bytes are available.\nfunction utf8Text(buf, i) {\n  var total = utf8CheckIncomplete(this, buf, i);\n  if (!this.lastNeed) return buf.toString('utf8', i);\n  this.lastTotal = total;\n  var end = buf.length - (total - this.lastNeed);\n  buf.copy(this.lastChar, 0, end);\n  return buf.toString('utf8', i, end);\n}\n\n// For UTF-8, a replacement character is added when ending on a partial\n// character.\nfunction utf8End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + '\\ufffd';\n  return r;\n}\n\n// UTF-16LE typically needs two bytes per character, but even if we have an even\n// number of bytes available, we need to check if we end on a leading/high\n// surrogate. In that case, we need to wait for the next two bytes in order to\n// decode the last character properly.\nfunction utf16Text(buf, i) {\n  if ((buf.length - i) % 2 === 0) {\n    var r = buf.toString('utf16le', i);\n    if (r) {\n      var c = r.charCodeAt(r.length - 1);\n      if (c >= 0xD800 && c <= 0xDBFF) {\n        this.lastNeed = 2;\n        this.lastTotal = 4;\n        this.lastChar[0] = buf[buf.length - 2];\n        this.lastChar[1] = buf[buf.length - 1];\n        return r.slice(0, -1);\n      }\n    }\n    return r;\n  }\n  this.lastNeed = 1;\n  this.lastTotal = 2;\n  this.lastChar[0] = buf[buf.length - 1];\n  return buf.toString('utf16le', i, buf.length - 1);\n}\n\n// For UTF-16LE we do not explicitly append special replacement characters if we\n// end on a partial character, we simply let v8 handle that.\nfunction utf16End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) {\n    var end = this.lastTotal - this.lastNeed;\n    return r + this.lastChar.toString('utf16le', 0, end);\n  }\n  return r;\n}\n\nfunction base64Text(buf, i) {\n  var n = (buf.length - i) % 3;\n  if (n === 0) return buf.toString('base64', i);\n  this.lastNeed = 3 - n;\n  this.lastTotal = 3;\n  if (n === 1) {\n    this.lastChar[0] = buf[buf.length - 1];\n  } else {\n    this.lastChar[0] = buf[buf.length - 2];\n    this.lastChar[1] = buf[buf.length - 1];\n  }\n  return buf.toString('base64', i, buf.length - n);\n}\n\nfunction base64End(buf) {\n  var r = buf && buf.length ? this.write(buf) : '';\n  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);\n  return r;\n}\n\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\nfunction simpleWrite(buf) {\n  return buf.toString(this.encoding);\n}\n\nfunction simpleEnd(buf) {\n  return buf && buf.length ? this.write(buf) : '';\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/string_decoder/lib/string_decoder.js\n// module id = 156\n// module chunks = 0\n\n//# sourceURL=../node_modules/string_decoder/lib/string_decoder.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar punycode = __webpack_require__(1133);\nvar util = __webpack_require__(1256);\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n\nfunction Url() {\n  this.protocol = null;\n  this.slashes = null;\n  this.auth = null;\n  this.host = null;\n  this.port = null;\n  this.hostname = null;\n  this.hash = null;\n  this.search = null;\n  this.query = null;\n  this.pathname = null;\n  this.path = null;\n  this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n// define these here so at least they only have to be\n// compiled once on the first module load.\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n    portPattern = /:[0-9]*$/,\n\n    // Special case for a simple path URL\n    simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/,\n\n    // RFC 2396: characters reserved for delimiting URLs.\n    // We actually just auto-escape these.\n    delims = ['<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'],\n\n    // RFC 2396: characters not allowed for various reasons.\n    unwise = ['{', '}', '|', '\\\\', '^', '`'].concat(delims),\n\n    // Allowed by RFCs, but cause of XSS attacks.  Always escape these.\n    autoEscape = ['\\''].concat(unwise),\n    // Characters that are never ever allowed in a hostname.\n    // Note that any invalid chars are also handled, but these\n    // are the ones that are *expected* to be seen, so we fast-path\n    // them.\n    nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape),\n    hostEndingChars = ['/', '?', '#'],\n    hostnameMaxLen = 255,\n    hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n    hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n    // protocols that can allow \"unsafe\" and \"unwise\" chars.\n    unsafeProtocol = {\n      'javascript': true,\n      'javascript:': true\n    },\n    // protocols that never have a hostname.\n    hostlessProtocol = {\n      'javascript': true,\n      'javascript:': true\n    },\n    // protocols that always contain a // bit.\n    slashedProtocol = {\n      'http': true,\n      'https': true,\n      'ftp': true,\n      'gopher': true,\n      'file': true,\n      'http:': true,\n      'https:': true,\n      'ftp:': true,\n      'gopher:': true,\n      'file:': true\n    },\n    querystring = __webpack_require__(1207);\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n  if (url && util.isObject(url) && url instanceof Url) return url;\n\n  var u = new Url;\n  u.parse(url, parseQueryString, slashesDenoteHost);\n  return u;\n}\n\nUrl.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {\n  if (!util.isString(url)) {\n    throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n  }\n\n  // Copy chrome, IE, opera backslash-handling behavior.\n  // Back slashes before the query string get converted to forward slashes\n  // See: https://code.google.com/p/chromium/issues/detail?id=25916\n  var queryIndex = url.indexOf('?'),\n      splitter =\n          (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#',\n      uSplit = url.split(splitter),\n      slashRegex = /\\\\/g;\n  uSplit[0] = uSplit[0].replace(slashRegex, '/');\n  url = uSplit.join(splitter);\n\n  var rest = url;\n\n  // trim before proceeding.\n  // This is to support parse stuff like \"  http://foo.com  \\n\"\n  rest = rest.trim();\n\n  if (!slashesDenoteHost && url.split('#').length === 1) {\n    // Try fast path regexp\n    var simplePath = simplePathPattern.exec(rest);\n    if (simplePath) {\n      this.path = rest;\n      this.href = rest;\n      this.pathname = simplePath[1];\n      if (simplePath[2]) {\n        this.search = simplePath[2];\n        if (parseQueryString) {\n          this.query = querystring.parse(this.search.substr(1));\n        } else {\n          this.query = this.search.substr(1);\n        }\n      } else if (parseQueryString) {\n        this.search = '';\n        this.query = {};\n      }\n      return this;\n    }\n  }\n\n  var proto = protocolPattern.exec(rest);\n  if (proto) {\n    proto = proto[0];\n    var lowerProto = proto.toLowerCase();\n    this.protocol = lowerProto;\n    rest = rest.substr(proto.length);\n  }\n\n  // figure out if it's got a host\n  // user@server is *always* interpreted as a hostname, and url\n  // resolution will treat //foo/bar as host=foo,path=bar because that's\n  // how the browser resolves relative URLs.\n  if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n    var slashes = rest.substr(0, 2) === '//';\n    if (slashes && !(proto && hostlessProtocol[proto])) {\n      rest = rest.substr(2);\n      this.slashes = true;\n    }\n  }\n\n  if (!hostlessProtocol[proto] &&\n      (slashes || (proto && !slashedProtocol[proto]))) {\n\n    // there's a hostname.\n    // the first instance of /, ?, ;, or # ends the host.\n    //\n    // If there is an @ in the hostname, then non-host chars *are* allowed\n    // to the left of the last @ sign, unless some host-ending character\n    // comes *before* the @-sign.\n    // URLs are obnoxious.\n    //\n    // ex:\n    // http://a@b@c/ => user:a@b host:c\n    // http://a@b?@c => user:a host:c path:/?@c\n\n    // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n    // Review our test case against browsers more comprehensively.\n\n    // find the first instance of any hostEndingChars\n    var hostEnd = -1;\n    for (var i = 0; i < hostEndingChars.length; i++) {\n      var hec = rest.indexOf(hostEndingChars[i]);\n      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n        hostEnd = hec;\n    }\n\n    // at this point, either we have an explicit point where the\n    // auth portion cannot go past, or the last @ char is the decider.\n    var auth, atSign;\n    if (hostEnd === -1) {\n      // atSign can be anywhere.\n      atSign = rest.lastIndexOf('@');\n    } else {\n      // atSign must be in auth portion.\n      // http://a@b/c@d => host:b auth:a path:/c@d\n      atSign = rest.lastIndexOf('@', hostEnd);\n    }\n\n    // Now we have a portion which is definitely the auth.\n    // Pull that off.\n    if (atSign !== -1) {\n      auth = rest.slice(0, atSign);\n      rest = rest.slice(atSign + 1);\n      this.auth = decodeURIComponent(auth);\n    }\n\n    // the host is the remaining to the left of the first non-host char\n    hostEnd = -1;\n    for (var i = 0; i < nonHostChars.length; i++) {\n      var hec = rest.indexOf(nonHostChars[i]);\n      if (hec !== -1 && (hostEnd === -1 || hec < hostEnd))\n        hostEnd = hec;\n    }\n    // if we still have not hit it, then the entire thing is a host.\n    if (hostEnd === -1)\n      hostEnd = rest.length;\n\n    this.host = rest.slice(0, hostEnd);\n    rest = rest.slice(hostEnd);\n\n    // pull out port.\n    this.parseHost();\n\n    // we've indicated that there is a hostname,\n    // so even if it's empty, it has to be present.\n    this.hostname = this.hostname || '';\n\n    // if hostname begins with [ and ends with ]\n    // assume that it's an IPv6 address.\n    var ipv6Hostname = this.hostname[0] === '[' &&\n        this.hostname[this.hostname.length - 1] === ']';\n\n    // validate a little.\n    if (!ipv6Hostname) {\n      var hostparts = this.hostname.split(/\\./);\n      for (var i = 0, l = hostparts.length; i < l; i++) {\n        var part = hostparts[i];\n        if (!part) continue;\n        if (!part.match(hostnamePartPattern)) {\n          var newpart = '';\n          for (var j = 0, k = part.length; j < k; j++) {\n            if (part.charCodeAt(j) > 127) {\n              // we replace non-ASCII char with a temporary placeholder\n              // we need this to make sure size of hostname is not\n              // broken by replacing non-ASCII by nothing\n              newpart += 'x';\n            } else {\n              newpart += part[j];\n            }\n          }\n          // we test again with ASCII char only\n          if (!newpart.match(hostnamePartPattern)) {\n            var validParts = hostparts.slice(0, i);\n            var notHost = hostparts.slice(i + 1);\n            var bit = part.match(hostnamePartStart);\n            if (bit) {\n              validParts.push(bit[1]);\n              notHost.unshift(bit[2]);\n            }\n            if (notHost.length) {\n              rest = '/' + notHost.join('.') + rest;\n            }\n            this.hostname = validParts.join('.');\n            break;\n          }\n        }\n      }\n    }\n\n    if (this.hostname.length > hostnameMaxLen) {\n      this.hostname = '';\n    } else {\n      // hostnames are always lower case.\n      this.hostname = this.hostname.toLowerCase();\n    }\n\n    if (!ipv6Hostname) {\n      // IDNA Support: Returns a punycoded representation of \"domain\".\n      // It only converts parts of the domain name that\n      // have non-ASCII characters, i.e. it doesn't matter if\n      // you call it with a domain that already is ASCII-only.\n      this.hostname = punycode.toASCII(this.hostname);\n    }\n\n    var p = this.port ? ':' + this.port : '';\n    var h = this.hostname || '';\n    this.host = h + p;\n    this.href += this.host;\n\n    // strip [ and ] from the hostname\n    // the host field still retains them, though\n    if (ipv6Hostname) {\n      this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n      if (rest[0] !== '/') {\n        rest = '/' + rest;\n      }\n    }\n  }\n\n  // now rest is set to the post-host stuff.\n  // chop off any delim chars.\n  if (!unsafeProtocol[lowerProto]) {\n\n    // First, make 100% sure that any \"autoEscape\" chars get\n    // escaped, even if encodeURIComponent doesn't think they\n    // need to be.\n    for (var i = 0, l = autoEscape.length; i < l; i++) {\n      var ae = autoEscape[i];\n      if (rest.indexOf(ae) === -1)\n        continue;\n      var esc = encodeURIComponent(ae);\n      if (esc === ae) {\n        esc = escape(ae);\n      }\n      rest = rest.split(ae).join(esc);\n    }\n  }\n\n\n  // chop off from the tail first.\n  var hash = rest.indexOf('#');\n  if (hash !== -1) {\n    // got a fragment string.\n    this.hash = rest.substr(hash);\n    rest = rest.slice(0, hash);\n  }\n  var qm = rest.indexOf('?');\n  if (qm !== -1) {\n    this.search = rest.substr(qm);\n    this.query = rest.substr(qm + 1);\n    if (parseQueryString) {\n      this.query = querystring.parse(this.query);\n    }\n    rest = rest.slice(0, qm);\n  } else if (parseQueryString) {\n    // no query string, but parseQueryString still requested\n    this.search = '';\n    this.query = {};\n  }\n  if (rest) this.pathname = rest;\n  if (slashedProtocol[lowerProto] &&\n      this.hostname && !this.pathname) {\n    this.pathname = '/';\n  }\n\n  //to support http.request\n  if (this.pathname || this.search) {\n    var p = this.pathname || '';\n    var s = this.search || '';\n    this.path = p + s;\n  }\n\n  // finally, reconstruct the href based on what has been validated.\n  this.href = this.format();\n  return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n  // ensure it's an object, and not a string url.\n  // If it's an obj, this is a no-op.\n  // this way, you can call url_format() on strings\n  // to clean up potentially wonky urls.\n  if (util.isString(obj)) obj = urlParse(obj);\n  if (!(obj instanceof Url)) return Url.prototype.format.call(obj);\n  return obj.format();\n}\n\nUrl.prototype.format = function() {\n  var auth = this.auth || '';\n  if (auth) {\n    auth = encodeURIComponent(auth);\n    auth = auth.replace(/%3A/i, ':');\n    auth += '@';\n  }\n\n  var protocol = this.protocol || '',\n      pathname = this.pathname || '',\n      hash = this.hash || '',\n      host = false,\n      query = '';\n\n  if (this.host) {\n    host = auth + this.host;\n  } else if (this.hostname) {\n    host = auth + (this.hostname.indexOf(':') === -1 ?\n        this.hostname :\n        '[' + this.hostname + ']');\n    if (this.port) {\n      host += ':' + this.port;\n    }\n  }\n\n  if (this.query &&\n      util.isObject(this.query) &&\n      Object.keys(this.query).length) {\n    query = querystring.stringify(this.query);\n  }\n\n  var search = this.search || (query && ('?' + query)) || '';\n\n  if (protocol && protocol.substr(-1) !== ':') protocol += ':';\n\n  // only the slashedProtocols get the //.  Not mailto:, xmpp:, etc.\n  // unless they had them to begin with.\n  if (this.slashes ||\n      (!protocol || slashedProtocol[protocol]) && host !== false) {\n    host = '//' + (host || '');\n    if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname;\n  } else if (!host) {\n    host = '';\n  }\n\n  if (hash && hash.charAt(0) !== '#') hash = '#' + hash;\n  if (search && search.charAt(0) !== '?') search = '?' + search;\n\n  pathname = pathname.replace(/[?#]/g, function(match) {\n    return encodeURIComponent(match);\n  });\n  search = search.replace('#', '%23');\n\n  return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n  return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function(relative) {\n  return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n  if (!source) return relative;\n  return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function(relative) {\n  if (util.isString(relative)) {\n    var rel = new Url();\n    rel.parse(relative, false, true);\n    relative = rel;\n  }\n\n  var result = new Url();\n  var tkeys = Object.keys(this);\n  for (var tk = 0; tk < tkeys.length; tk++) {\n    var tkey = tkeys[tk];\n    result[tkey] = this[tkey];\n  }\n\n  // hash is always overridden, no matter what.\n  // even href=\"\" will remove it.\n  result.hash = relative.hash;\n\n  // if the relative url is empty, then there's nothing left to do here.\n  if (relative.href === '') {\n    result.href = result.format();\n    return result;\n  }\n\n  // hrefs like //foo/bar always cut to the protocol.\n  if (relative.slashes && !relative.protocol) {\n    // take everything except the protocol from relative\n    var rkeys = Object.keys(relative);\n    for (var rk = 0; rk < rkeys.length; rk++) {\n      var rkey = rkeys[rk];\n      if (rkey !== 'protocol')\n        result[rkey] = relative[rkey];\n    }\n\n    //urlParse appends trailing / to urls like http://www.example.com\n    if (slashedProtocol[result.protocol] &&\n        result.hostname && !result.pathname) {\n      result.path = result.pathname = '/';\n    }\n\n    result.href = result.format();\n    return result;\n  }\n\n  if (relative.protocol && relative.protocol !== result.protocol) {\n    // if it's a known url protocol, then changing\n    // the protocol does weird things\n    // first, if it's not file:, then we MUST have a host,\n    // and if there was a path\n    // to begin with, then we MUST have a path.\n    // if it is file:, then the host is dropped,\n    // because that's known to be hostless.\n    // anything else is assumed to be absolute.\n    if (!slashedProtocol[relative.protocol]) {\n      var keys = Object.keys(relative);\n      for (var v = 0; v < keys.length; v++) {\n        var k = keys[v];\n        result[k] = relative[k];\n      }\n      result.href = result.format();\n      return result;\n    }\n\n    result.protocol = relative.protocol;\n    if (!relative.host && !hostlessProtocol[relative.protocol]) {\n      var relPath = (relative.pathname || '').split('/');\n      while (relPath.length && !(relative.host = relPath.shift()));\n      if (!relative.host) relative.host = '';\n      if (!relative.hostname) relative.hostname = '';\n      if (relPath[0] !== '') relPath.unshift('');\n      if (relPath.length < 2) relPath.unshift('');\n      result.pathname = relPath.join('/');\n    } else {\n      result.pathname = relative.pathname;\n    }\n    result.search = relative.search;\n    result.query = relative.query;\n    result.host = relative.host || '';\n    result.auth = relative.auth;\n    result.hostname = relative.hostname || relative.host;\n    result.port = relative.port;\n    // to support http.request\n    if (result.pathname || result.search) {\n      var p = result.pathname || '';\n      var s = result.search || '';\n      result.path = p + s;\n    }\n    result.slashes = result.slashes || relative.slashes;\n    result.href = result.format();\n    return result;\n  }\n\n  var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'),\n      isRelAbs = (\n          relative.host ||\n          relative.pathname && relative.pathname.charAt(0) === '/'\n      ),\n      mustEndAbs = (isRelAbs || isSourceAbs ||\n                    (result.host && relative.pathname)),\n      removeAllDots = mustEndAbs,\n      srcPath = result.pathname && result.pathname.split('/') || [],\n      relPath = relative.pathname && relative.pathname.split('/') || [],\n      psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n  // if the url is a non-slashed url, then relative\n  // links like ../.. should be able\n  // to crawl up to the hostname, as well.  This is strange.\n  // result.protocol has already been set by now.\n  // Later on, put the first path part into the host field.\n  if (psychotic) {\n    result.hostname = '';\n    result.port = null;\n    if (result.host) {\n      if (srcPath[0] === '') srcPath[0] = result.host;\n      else srcPath.unshift(result.host);\n    }\n    result.host = '';\n    if (relative.protocol) {\n      relative.hostname = null;\n      relative.port = null;\n      if (relative.host) {\n        if (relPath[0] === '') relPath[0] = relative.host;\n        else relPath.unshift(relative.host);\n      }\n      relative.host = null;\n    }\n    mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n  }\n\n  if (isRelAbs) {\n    // it's absolute.\n    result.host = (relative.host || relative.host === '') ?\n                  relative.host : result.host;\n    result.hostname = (relative.hostname || relative.hostname === '') ?\n                      relative.hostname : result.hostname;\n    result.search = relative.search;\n    result.query = relative.query;\n    srcPath = relPath;\n    // fall through to the dot-handling below.\n  } else if (relPath.length) {\n    // it's relative\n    // throw away the existing file, and take the new path instead.\n    if (!srcPath) srcPath = [];\n    srcPath.pop();\n    srcPath = srcPath.concat(relPath);\n    result.search = relative.search;\n    result.query = relative.query;\n  } else if (!util.isNullOrUndefined(relative.search)) {\n    // just pull out the search.\n    // like href='?foo'.\n    // Put this after the other two cases because it simplifies the booleans\n    if (psychotic) {\n      result.hostname = result.host = srcPath.shift();\n      //occationaly the auth can get stuck only in host\n      //this especially happens in cases like\n      //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n      var authInHost = result.host && result.host.indexOf('@') > 0 ?\n                       result.host.split('@') : false;\n      if (authInHost) {\n        result.auth = authInHost.shift();\n        result.host = result.hostname = authInHost.shift();\n      }\n    }\n    result.search = relative.search;\n    result.query = relative.query;\n    //to support http.request\n    if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n      result.path = (result.pathname ? result.pathname : '') +\n                    (result.search ? result.search : '');\n    }\n    result.href = result.format();\n    return result;\n  }\n\n  if (!srcPath.length) {\n    // no path at all.  easy.\n    // we've already handled the other stuff above.\n    result.pathname = null;\n    //to support http.request\n    if (result.search) {\n      result.path = '/' + result.search;\n    } else {\n      result.path = null;\n    }\n    result.href = result.format();\n    return result;\n  }\n\n  // if a url ENDs in . or .., then it must get a trailing slash.\n  // however, if it ends in anything else non-slashy,\n  // then it must NOT get a trailing slash.\n  var last = srcPath.slice(-1)[0];\n  var hasTrailingSlash = (\n      (result.host || relative.host || srcPath.length > 1) &&\n      (last === '.' || last === '..') || last === '');\n\n  // strip single dots, resolve double dots to parent dir\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = srcPath.length; i >= 0; i--) {\n    last = srcPath[i];\n    if (last === '.') {\n      srcPath.splice(i, 1);\n    } else if (last === '..') {\n      srcPath.splice(i, 1);\n      up++;\n    } else if (up) {\n      srcPath.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (!mustEndAbs && !removeAllDots) {\n    for (; up--; up) {\n      srcPath.unshift('..');\n    }\n  }\n\n  if (mustEndAbs && srcPath[0] !== '' &&\n      (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n    srcPath.unshift('');\n  }\n\n  if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n    srcPath.push('');\n  }\n\n  var isAbsolute = srcPath[0] === '' ||\n      (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n  // put the host back\n  if (psychotic) {\n    result.hostname = result.host = isAbsolute ? '' :\n                                    srcPath.length ? srcPath.shift() : '';\n    //occationaly the auth can get stuck only in host\n    //this especially happens in cases like\n    //url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n    var authInHost = result.host && result.host.indexOf('@') > 0 ?\n                     result.host.split('@') : false;\n    if (authInHost) {\n      result.auth = authInHost.shift();\n      result.host = result.hostname = authInHost.shift();\n    }\n  }\n\n  mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n  if (mustEndAbs && !isAbsolute) {\n    srcPath.unshift('');\n  }\n\n  if (!srcPath.length) {\n    result.pathname = null;\n    result.path = null;\n  } else {\n    result.pathname = srcPath.join('/');\n  }\n\n  //to support request.http\n  if (!util.isNull(result.pathname) || !util.isNull(result.search)) {\n    result.path = (result.pathname ? result.pathname : '') +\n                  (result.search ? result.search : '');\n  }\n  result.auth = relative.auth || result.auth;\n  result.slashes = result.slashes || relative.slashes;\n  result.href = result.format();\n  return result;\n};\n\nUrl.prototype.parseHost = function() {\n  var host = this.host;\n  var port = portPattern.exec(host);\n  if (port) {\n    port = port[0];\n    if (port !== ':') {\n      this.port = port.substr(1);\n    }\n    host = host.substr(0, host.length - port.length);\n  }\n  if (host) this.hostname = host;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/url/url.js\n// module id = 157\n// module chunks = 0\n\n//# sourceURL=../node_modules/url/url.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar Base58 = __webpack_require__(214);\nvar buffer = __webpack_require__(0);\nvar sha256sha256 = __webpack_require__(36).sha256sha256;\n\nvar Base58Check = function Base58Check(obj) {\n  if (!(this instanceof Base58Check))\n    return new Base58Check(obj);\n  if (Buffer.isBuffer(obj)) {\n    var buf = obj;\n    this.fromBuffer(buf);\n  } else if (typeof obj === 'string') {\n    var str = obj;\n    this.fromString(str);\n  } else if (obj) {\n    this.set(obj);\n  }\n};\n\nBase58Check.prototype.set = function(obj) {\n  this.buf = obj.buf || this.buf || undefined;\n  return this;\n};\n\nBase58Check.validChecksum = function validChecksum(data, checksum) {\n  if (_.isString(data)) {\n    data = new buffer.Buffer(Base58.decode(data));\n  }\n  if (_.isString(checksum)) {\n    checksum = new buffer.Buffer(Base58.decode(checksum));\n  }\n  if (!checksum) {\n    checksum = data.slice(-4);\n    data = data.slice(0, -4);\n  }\n  return Base58Check.checksum(data).toString('hex') === checksum.toString('hex');\n};\n\nBase58Check.decode = function(s) {\n  if (typeof s !== 'string')\n    throw new Error('Input must be a string');\n\n  var buf = new Buffer(Base58.decode(s));\n\n  if (buf.length < 4)\n    throw new Error(\"Input string too short\");\n\n  var data = buf.slice(0, -4);\n  var csum = buf.slice(-4);\n\n  var hash = sha256sha256(data);\n  var hash4 = hash.slice(0, 4);\n\n  if (csum.toString('hex') !== hash4.toString('hex'))\n    throw new Error(\"Checksum mismatch\");\n\n  return data;\n};\n\nBase58Check.checksum = function(buffer) {\n  return sha256sha256(buffer).slice(0, 4);\n};\n\nBase58Check.encode = function(buf) {\n  if (!Buffer.isBuffer(buf))\n    throw new Error('Input must be a buffer');\n  var checkedBuf = new Buffer(buf.length + 4);\n  var hash = Base58Check.checksum(buf);\n  buf.copy(checkedBuf);\n  hash.copy(checkedBuf, buf.length);\n  return Base58.encode(checkedBuf);\n};\n\nBase58Check.prototype.fromBuffer = function(buf) {\n  this.buf = buf;\n  return this;\n};\n\nBase58Check.prototype.fromString = function(str) {\n  var buf = Base58Check.decode(str);\n  this.buf = buf;\n  return this;\n};\n\nBase58Check.prototype.toBuffer = function() {\n  return this.buf;\n};\n\nBase58Check.prototype.toString = function() {\n  return Base58Check.encode(this.buf);\n};\n\nmodule.exports = Base58Check;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/encoding/base58check.js\n// module id = 158\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/encoding/base58check.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar errors = __webpack_require__(56);\nvar BufferWriter = __webpack_require__(50);\nvar buffer = __webpack_require__(0);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\nvar Script = __webpack_require__(57);\nvar Sighash = __webpack_require__(84);\nvar Output = __webpack_require__(83);\n\nvar MAXINT = 0xffffffff; // Math.pow(2, 32) - 1;\nvar DEFAULT_RBF_SEQNUMBER = MAXINT - 2;\nvar DEFAULT_SEQNUMBER = MAXINT;\nvar DEFAULT_LOCKTIME_SEQNUMBER = MAXINT - 1;\n\nfunction Input(params) {\n  if (!(this instanceof Input)) {\n    return new Input(params);\n  }\n  if (params) {\n    return this._fromObject(params);\n  }\n}\n\nInput.MAXINT = MAXINT;\nInput.DEFAULT_SEQNUMBER = DEFAULT_SEQNUMBER;\nInput.DEFAULT_LOCKTIME_SEQNUMBER = DEFAULT_LOCKTIME_SEQNUMBER;\nInput.DEFAULT_RBF_SEQNUMBER = DEFAULT_RBF_SEQNUMBER;\n\nObject.defineProperty(Input.prototype, 'script', {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    if (this.isNull()) {\n      return null;\n    }\n    if (!this._script) {\n      this._script = new Script(this._scriptBuffer);\n      this._script._isInput = true;\n    }\n    return this._script;\n  }\n});\n\nInput.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj));\n  var input = new Input();\n  return input._fromObject(obj);\n};\n\nInput.prototype._fromObject = function(params) {\n  var prevTxId;\n  if (_.isString(params.prevTxId) && JSUtil.isHexa(params.prevTxId)) {\n    prevTxId = new buffer.Buffer(params.prevTxId, 'hex');\n  } else {\n    prevTxId = params.prevTxId;\n  }\n  this.output = params.output ?\n    (params.output instanceof Output ? params.output : new Output(params.output)) : undefined;\n  this.prevTxId = prevTxId || params.txidbuf;\n  this.outputIndex = _.isUndefined(params.outputIndex) ? params.txoutnum : params.outputIndex;\n  this.sequenceNumber = _.isUndefined(params.sequenceNumber) ?\n    (_.isUndefined(params.seqnum) ? DEFAULT_SEQNUMBER : params.seqnum) : params.sequenceNumber;\n  if (_.isUndefined(params.script) && _.isUndefined(params.scriptBuffer)) {\n    throw new errors.Transaction.Input.MissingScript();\n  }\n  this.setScript(params.scriptBuffer || params.script);\n  return this;\n};\n\nInput.prototype.toObject = Input.prototype.toJSON = function toObject() {\n  var obj = {\n    prevTxId: this.prevTxId.toString('hex'),\n    outputIndex: this.outputIndex,\n    sequenceNumber: this.sequenceNumber,\n    script: this._scriptBuffer.toString('hex'),\n  };\n  // add human readable form if input contains valid script\n  if (this.script) {\n    obj.scriptString = this.script.toString();\n  }\n  if (this.output) {\n    obj.output = this.output.toObject();\n  }\n  return obj;\n};\n\nInput.fromBufferReader = function(br) {\n  var input = new Input();\n  input.prevTxId = br.readReverse(32);\n  input.outputIndex = br.readUInt32LE();\n  input._scriptBuffer = br.readVarLengthBuffer();\n  input.sequenceNumber = br.readUInt32LE();\n  // TODO: return different classes according to which input it is\n  // e.g: CoinbaseInput, PublicKeyHashInput, MultiSigScriptHashInput, etc.\n  return input;\n};\n\nInput.prototype.toBufferWriter = function(writer) {\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  writer.writeReverse(this.prevTxId);\n  writer.writeUInt32LE(this.outputIndex);\n  var script = this._scriptBuffer;\n  writer.writeVarintNum(script.length);\n  writer.write(script);\n  writer.writeUInt32LE(this.sequenceNumber);\n  return writer;\n};\n\nInput.prototype.setScript = function(script) {\n  this._script = null;\n  if (script instanceof Script) {\n    this._script = script;\n    this._script._isInput = true;\n    this._scriptBuffer = script.toBuffer();\n  } else if (JSUtil.isHexa(script)) {\n    // hex string script\n    this._scriptBuffer = new buffer.Buffer(script, 'hex');\n  } else if (_.isString(script)) {\n    // human readable string script\n    this._script = new Script(script);\n    this._script._isInput = true;\n    this._scriptBuffer = this._script.toBuffer();\n  } else if (BufferUtil.isBuffer(script)) {\n    // buffer script\n    this._scriptBuffer = new buffer.Buffer(script);\n  } else {\n    throw new TypeError('Invalid argument type: script');\n  }\n  return this;\n};\n\n/**\n * Retrieve signatures for the provided PrivateKey.\n *\n * @param {Transaction} transaction - the transaction to be signed\n * @param {PrivateKey} privateKey - the private key to use when signing\n * @param {number} inputIndex - the index of this input in the provided transaction\n * @param {number} sigType - defaults to Signature.SIGHASH_ALL\n * @param {Buffer} addressHash - if provided, don't calculate the hash of the\n *     public key associated with the private key provided\n * @abstract\n */\nInput.prototype.getSignatures = function() {\n  throw new errors.AbstractMethodInvoked(\n    'Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported)' +\n    ' for input: ' + JSON.stringify(this)\n  );\n};\n\nInput.prototype.isFullySigned = function() {\n  throw new errors.AbstractMethodInvoked('Input#isFullySigned');\n};\n\nInput.prototype.isFinal = function() {\n  return this.sequenceNumber !== 4294967295;\n};\n\nInput.prototype.addSignature = function() {\n  throw new errors.AbstractMethodInvoked('Input#addSignature');\n};\n\nInput.prototype.clearSignatures = function() {\n  throw new errors.AbstractMethodInvoked('Input#clearSignatures');\n};\n\nInput.prototype.isValidSignature = function(transaction, signature) {\n  // FIXME: Refactor signature so this is not necessary\n  signature.signature.nhashtype = signature.sigtype;\n  return Sighash.verify(\n    transaction,\n    signature.signature,\n    signature.publicKey,\n    signature.inputIndex,\n    this.output.script\n  );\n};\n\n/**\n * @returns true if this is a coinbase input (represents no input)\n */\nInput.prototype.isNull = function() {\n  return this.prevTxId.toString('hex') === '0000000000000000000000000000000000000000000000000000000000000000' &&\n    this.outputIndex === 0xffffffff;\n};\n\nInput.prototype._estimateSize = function() {\n  return this.toBufferWriter().toBuffer().length;\n};\n\nmodule.exports = Input;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/input.js\n// module id = 159\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/input.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar inherits = __webpack_require__(75);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\nvar PublicKey = __webpack_require__(66);\nvar errors = __webpack_require__(56);\nvar Signature = __webpack_require__(55);\n\n/**\n * @desc\n * Wrapper around Signature with fields related to signing a transaction specifically\n *\n * @param {Object|string|TransactionSignature} arg\n * @constructor\n */\nfunction TransactionSignature(arg) {\n  if (!(this instanceof TransactionSignature)) {\n    return new TransactionSignature(arg);\n  }\n  if (arg instanceof TransactionSignature) {\n    return arg;\n  }\n  if (_.isObject(arg)) {\n    return this._fromObject(arg);\n  }\n  throw new errors.InvalidArgument('TransactionSignatures must be instantiated from an object');\n}\ninherits(TransactionSignature, Signature);\n\nTransactionSignature.prototype._fromObject = function(arg) {\n  this._checkObjectArgs(arg);\n  this.publicKey = new PublicKey(arg.publicKey);\n  this.prevTxId = BufferUtil.isBuffer(arg.prevTxId) ? arg.prevTxId : new Buffer(arg.prevTxId, 'hex');\n  this.outputIndex = arg.outputIndex;\n  this.inputIndex = arg.inputIndex;\n  this.signature = (arg.signature instanceof Signature) ? arg.signature :\n                     BufferUtil.isBuffer(arg.signature) ? Signature.fromBuffer(arg.signature) :\n                     Signature.fromString(arg.signature);\n  this.sigtype = arg.sigtype;\n  return this;\n};\n\nTransactionSignature.prototype._checkObjectArgs = function(arg) {\n  $.checkArgument(PublicKey(arg.publicKey), 'publicKey');\n  $.checkArgument(!_.isUndefined(arg.inputIndex), 'inputIndex');\n  $.checkArgument(!_.isUndefined(arg.outputIndex), 'outputIndex');\n  $.checkState(_.isNumber(arg.inputIndex), 'inputIndex must be a number');\n  $.checkState(_.isNumber(arg.outputIndex), 'outputIndex must be a number');\n  $.checkArgument(arg.signature, 'signature');\n  $.checkArgument(arg.prevTxId, 'prevTxId');\n  $.checkState(arg.signature instanceof Signature ||\n               BufferUtil.isBuffer(arg.signature) ||\n               JSUtil.isHexa(arg.signature), 'signature must be a buffer or hexa value');\n  $.checkState(BufferUtil.isBuffer(arg.prevTxId) ||\n               JSUtil.isHexa(arg.prevTxId), 'prevTxId must be a buffer or hexa value');\n  $.checkArgument(arg.sigtype, 'sigtype');\n  $.checkState(_.isNumber(arg.sigtype), 'sigtype must be a number');\n};\n\n/**\n * Serializes a transaction to a plain JS object\n * @return {Object}\n */\nTransactionSignature.prototype.toObject = TransactionSignature.prototype.toJSON = function toObject() {\n  return {\n    publicKey: this.publicKey.toString(),\n    prevTxId: this.prevTxId.toString('hex'),\n    outputIndex: this.outputIndex,\n    inputIndex: this.inputIndex,\n    signature: this.signature.toString(),\n    sigtype: this.sigtype\n  };\n};\n\n/**\n * Builds a TransactionSignature from an object\n * @param {Object} object\n * @return {TransactionSignature}\n */\nTransactionSignature.fromObject = function(object) {\n  $.checkArgument(object);\n  return new TransactionSignature(object);\n};\n\nmodule.exports = TransactionSignature;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/signature.js\n// module id = 160\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/signature.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = asyncify;\n\nvar _isObject = __webpack_require__(147);\n\nvar _isObject2 = _interopRequireDefault(_isObject);\n\nvar _initialParams = __webpack_require__(330);\n\nvar _initialParams2 = _interopRequireDefault(_initialParams);\n\nvar _setImmediate = __webpack_require__(222);\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises\'s\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n *     async.apply(fs.readFile, filename, "utf8"),\n *     async.asyncify(JSON.parse),\n *     function (data, next) {\n *         // data is the result of parsing the text.\n *         // If there was a parsing error, it would have been caught.\n *     }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n *     async.apply(fs.readFile, filename, "utf8"),\n *     async.asyncify(function (contents) {\n *         return db.model.create(contents);\n *     }),\n *     function (model, next) {\n *         // `model` is the instantiated model object.\n *         // If there was an error, this function would be skipped.\n *     }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n *     var intermediateStep = await processFile(file);\n *     return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n    return (0, _initialParams2.default)(function (args, callback) {\n        var result;\n        try {\n            result = func.apply(this, args);\n        } catch (e) {\n            return callback(e);\n        }\n        // if result is Promise object\n        if ((0, _isObject2.default)(result) && typeof result.then === \'function\') {\n            result.then(function (value) {\n                invokeCallback(callback, null, value);\n            }, function (err) {\n                invokeCallback(callback, err.message ? err : new Error(err));\n            });\n        } else {\n            callback(null, result);\n        }\n    });\n}\n\nfunction invokeCallback(callback, error, value) {\n    try {\n        callback(error, value);\n    } catch (e) {\n        (0, _setImmediate2.default)(rethrow, e);\n    }\n}\n\nfunction rethrow(error) {\n    throw error;\n}\nmodule.exports = exports[\'default\'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/asyncify.js\n// module id = 161\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/asyncify.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _eachLimit = __webpack_require__(591);\n\nvar _eachLimit2 = _interopRequireDefault(_eachLimit);\n\nvar _doLimit = __webpack_require__(220);\n\nvar _doLimit2 = _interopRequireDefault(_doLimit);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nexports.default = (0, _doLimit2.default)(_eachLimit2.default, 1);\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/eachSeries.js\n// module id = 162\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/eachSeries.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = doParallel;\n\nvar _eachOf = __webpack_require__(218);\n\nvar _eachOf2 = _interopRequireDefault(_eachOf);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction doParallel(fn) {\n    return function (obj, iteratee, callback) {\n        return fn(_eachOf2.default, obj, (0, _wrapAsync2.default)(iteratee), callback);\n    };\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/doParallel.js\n// module id = 163\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/doParallel.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = whilst;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns undefined\n * @example\n *\n * var count = 0;\n * async.whilst(\n *     function() { return count < 5; },\n *     function(callback) {\n *         count++;\n *         setTimeout(function() {\n *             callback(null, count);\n *         }, 1000);\n *     },\n *     function (err, n) {\n *         // 5 seconds have passed, n = 5\n *     }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n    callback = (0, _onlyOnce2.default)(callback || _noop2.default);\n    var _iteratee = (0, _wrapAsync2.default)(iteratee);\n    if (!test()) return callback(null);\n    var next = function (err /*, ...args*/) {\n        if (err) return callback(err);\n        if (test()) return _iteratee(next);\n        var args = (0, _slice2.default)(arguments, 1);\n        callback.apply(null, [null].concat(args));\n    };\n    _iteratee(next);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/whilst.js\n// module id = 164\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/whilst.js")},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;;(function (globalObject) {\r\n    'use strict';\r\n\r\n/*\r\n *      bignumber.js v6.0.0\r\n *      A JavaScript library for arbitrary-precision arithmetic.\r\n *      https://github.com/MikeMcl/bignumber.js\r\n *      Copyright (c) 2018 Michael Mclaughlin <M8ch88l@gmail.com>\r\n *      MIT Licensed.\r\n *\r\n *      BigNumber.prototype methods     |  BigNumber methods\r\n *                                      |\r\n *      absoluteValue            abs    |  clone\r\n *      comparedTo                      |  config               set\r\n *      decimalPlaces            dp     |      DECIMAL_PLACES\r\n *      dividedBy                div    |      ROUNDING_MODE\r\n *      dividedToIntegerBy       idiv   |      EXPONENTIAL_AT\r\n *      exponentiatedBy          pow    |      RANGE\r\n *      integerValue                    |      CRYPTO\r\n *      isEqualTo                eq     |      MODULO_MODE\r\n *      isFinite                        |      POW_PRECISION\r\n *      isGreaterThan            gt     |      FORMAT\r\n *      isGreaterThanOrEqualTo   gte    |      ALPHABET\r\n *      isInteger                       |  isBigNumber\r\n *      isLessThan               lt     |  maximum              max\r\n *      isLessThanOrEqualTo      lte    |  minimum              min\r\n *      isNaN                           |  random\r\n *      isNegative                      |\r\n *      isPositive                      |\r\n *      isZero                          |\r\n *      minus                           |\r\n *      modulo                   mod    |\r\n *      multipliedBy             times  |\r\n *      negated                         |\r\n *      plus                            |\r\n *      precision                sd     |\r\n *      shiftedBy                       |\r\n *      squareRoot               sqrt   |\r\n *      toExponential                   |\r\n *      toFixed                         |\r\n *      toFormat                        |\r\n *      toFraction                      |\r\n *      toJSON                          |\r\n *      toNumber                        |\r\n *      toPrecision                     |\r\n *      toString                        |\r\n *      valueOf                         |\r\n *\r\n */\r\n\r\n\r\n    var BigNumber,\r\n        isNumeric = /^-?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?$/i,\r\n\r\n        mathceil = Math.ceil,\r\n        mathfloor = Math.floor,\r\n\r\n        bignumberError = '[BigNumber Error] ',\r\n        tooManyDigits = bignumberError + 'Number primitive has more than 15 significant digits: ',\r\n\r\n        BASE = 1e14,\r\n        LOG_BASE = 14,\r\n        MAX_SAFE_INTEGER = 0x1fffffffffffff,         // 2^53 - 1\r\n        // MAX_INT32 = 0x7fffffff,                   // 2^31 - 1\r\n        POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\r\n        SQRT_BASE = 1e7,\r\n\r\n        // EDITABLE\r\n        // The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\r\n        // the arguments to toExponential, toFixed, toFormat, and toPrecision.\r\n        MAX = 1E9;                                   // 0 to MAX_INT32\r\n\r\n\r\n    /*\r\n     * Create and return a BigNumber constructor.\r\n     */\r\n    function clone(configObject) {\r\n        var div, convertBase, parseNumeric,\r\n            P = BigNumber.prototype,\r\n            ONE = new BigNumber(1),\r\n\r\n\r\n            //----------------------------- EDITABLE CONFIG DEFAULTS -------------------------------\r\n\r\n\r\n            // The default values below must be integers within the inclusive ranges stated.\r\n            // The values can also be changed at run-time using BigNumber.set.\r\n\r\n            // The maximum number of decimal places for operations involving division.\r\n            DECIMAL_PLACES = 20,                     // 0 to MAX\r\n\r\n            // The rounding mode used when rounding to the above decimal places, and when using\r\n            // toExponential, toFixed, toFormat and toPrecision, and round (default value).\r\n            // UP         0 Away from zero.\r\n            // DOWN       1 Towards zero.\r\n            // CEIL       2 Towards +Infinity.\r\n            // FLOOR      3 Towards -Infinity.\r\n            // HALF_UP    4 Towards nearest neighbour. If equidistant, up.\r\n            // HALF_DOWN  5 Towards nearest neighbour. If equidistant, down.\r\n            // HALF_EVEN  6 Towards nearest neighbour. If equidistant, towards even neighbour.\r\n            // HALF_CEIL  7 Towards nearest neighbour. If equidistant, towards +Infinity.\r\n            // HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\r\n            ROUNDING_MODE = 4,                       // 0 to 8\r\n\r\n            // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\r\n\r\n            // The exponent value at and beneath which toString returns exponential notation.\r\n            // Number type: -7\r\n            TO_EXP_NEG = -7,                         // 0 to -MAX\r\n\r\n            // The exponent value at and above which toString returns exponential notation.\r\n            // Number type: 21\r\n            TO_EXP_POS = 21,                         // 0 to MAX\r\n\r\n            // RANGE : [MIN_EXP, MAX_EXP]\r\n\r\n            // The minimum exponent value, beneath which underflow to zero occurs.\r\n            // Number type: -324  (5e-324)\r\n            MIN_EXP = -1e7,                          // -1 to -MAX\r\n\r\n            // The maximum exponent value, above which overflow to Infinity occurs.\r\n            // Number type:  308  (1.7976931348623157e+308)\r\n            // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\r\n            MAX_EXP = 1e7,                           // 1 to MAX\r\n\r\n            // Whether to use cryptographically-secure random number generation, if available.\r\n            CRYPTO = false,                          // true or false\r\n\r\n            // The modulo mode used when calculating the modulus: a mod n.\r\n            // The quotient (q = a / n) is calculated according to the corresponding rounding mode.\r\n            // The remainder (r) is calculated as: r = a - n * q.\r\n            //\r\n            // UP        0 The remainder is positive if the dividend is negative, else is negative.\r\n            // DOWN      1 The remainder has the same sign as the dividend.\r\n            //             This modulo mode is commonly known as 'truncated division' and is\r\n            //             equivalent to (a % n) in JavaScript.\r\n            // FLOOR     3 The remainder has the same sign as the divisor (Python %).\r\n            // HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\r\n            // EUCLID    9 Euclidian division. q = sign(n) * floor(a / abs(n)).\r\n            //             The remainder is always positive.\r\n            //\r\n            // The truncated division, floored division, Euclidian division and IEEE 754 remainder\r\n            // modes are commonly used for the modulus operation.\r\n            // Although the other rounding modes can also be used, they may not give useful results.\r\n            MODULO_MODE = 1,                         // 0 to 9\r\n\r\n            // The maximum number of significant digits of the result of the exponentiatedBy operation.\r\n            // If POW_PRECISION is 0, there will be unlimited significant digits.\r\n            POW_PRECISION = 0,                    // 0 to MAX\r\n\r\n            // The format specification used by the BigNumber.prototype.toFormat method.\r\n            FORMAT = {\r\n                decimalSeparator: '.',\r\n                groupSeparator: ',',\r\n                groupSize: 3,\r\n                secondaryGroupSize: 0,\r\n                fractionGroupSeparator: '\\xA0',      // non-breaking space\r\n                fractionGroupSize: 0\r\n            },\r\n\r\n            // The alphabet used for base conversion.\r\n            // It must be at least 2 characters long, with no '.' or repeated character.\r\n            // '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_'\r\n            ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyz';\r\n\r\n\r\n        //------------------------------------------------------------------------------------------\r\n\r\n\r\n        // CONSTRUCTOR\r\n\r\n\r\n        /*\r\n         * The BigNumber constructor and exported function.\r\n         * Create and return a new instance of a BigNumber object.\r\n         *\r\n         * n {number|string|BigNumber} A numeric value.\r\n         * [b] {number} The base of n. Integer, 2 to ALPHABET.length inclusive.\r\n         */\r\n        function BigNumber( n, b ) {\r\n            var alphabet, c, e, i, isNum, len, str,\r\n                x = this;\r\n\r\n            // Enable constructor usage without new.\r\n            if ( !( x instanceof BigNumber ) ) {\r\n\r\n                // Don't throw on constructor call without new (#81).\r\n                // '[BigNumber Error] Constructor call without new: {n}'\r\n                //throw Error( bignumberError + ' Constructor call without new: ' + n );\r\n                return new BigNumber( n, b );\r\n            }\r\n\r\n            if ( b == null ) {\r\n\r\n                // Duplicate.\r\n                if ( n instanceof BigNumber ) {\r\n                    x.s = n.s;\r\n                    x.e = n.e;\r\n                    x.c = ( n = n.c ) ? n.slice() : n;\r\n                    return;\r\n                }\r\n\r\n                isNum = typeof n == 'number';\r\n\r\n                if ( isNum && n * 0 == 0 ) {\r\n\r\n                    // Use `1 / n` to handle minus zero also.\r\n                    x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;\r\n\r\n                    // Faster path for integers.\r\n                    if ( n === ~~n ) {\r\n                        for ( e = 0, i = n; i >= 10; i /= 10, e++ );\r\n                        x.e = e;\r\n                        x.c = [n];\r\n                        return;\r\n                    }\r\n\r\n                    str = n + '';\r\n                } else {\r\n                    if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, isNum );\r\n                    x.s = str.charCodeAt(0) == 45 ? ( str = str.slice(1), -1 ) : 1;\r\n                }\r\n\r\n            } else {\r\n\r\n                // '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n                intCheck( b, 2, ALPHABET.length, 'Base' );\r\n                str = n + '';\r\n\r\n                // Allow exponential notation to be used with base 10 argument, while\r\n                // also rounding to DECIMAL_PLACES as with other bases.\r\n                if ( b == 10 ) {\r\n                    x = new BigNumber( n instanceof BigNumber ? n : str );\r\n                    return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );\r\n                }\r\n\r\n                isNum = typeof n == 'number';\r\n\r\n                if (isNum) {\r\n\r\n                    // Avoid potential interpretation of Infinity and NaN as base 44+ values.\r\n                    if ( n * 0 != 0 ) return parseNumeric( x, str, isNum, b );\r\n\r\n                    x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;\r\n\r\n                    // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n                    if ( str.replace( /^0\\.0*|\\./, '' ).length > 15 ) {\r\n                        throw Error\r\n                          ( tooManyDigits + n );\r\n                    }\r\n\r\n                    // Prevent later check for length on converted number.\r\n                    isNum = false;\r\n                } else {\r\n                    x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;\r\n\r\n                    // Allow e.g. hexadecimal 'FF' as well as 'ff'.\r\n                    if ( b > 10 && b < 37 ) str = str.toLowerCase();\r\n                }\r\n\r\n                alphabet = ALPHABET.slice( 0, b );\r\n                e = i = 0;\r\n\r\n                // Check that str is a valid base b number.\r\n                // Don't use RegExp so alphabet can contain special characters.\r\n                for ( len = str.length; i < len; i++ ) {\r\n                    if ( alphabet.indexOf( c = str.charAt(i) ) < 0 ) {\r\n                        if ( c == '.' ) {\r\n\r\n                            // If '.' is not the first character and it has not be found before.\r\n                            if ( i > e ) {\r\n                                e = len;\r\n                                continue;\r\n                            }\r\n                        }\r\n\r\n                        return parseNumeric( x, n + '', isNum, b );\r\n                    }\r\n                }\r\n\r\n                str = convertBase( str, b, 10, x.s );\r\n            }\r\n\r\n            // Decimal point?\r\n            if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );\r\n\r\n            // Exponential form?\r\n            if ( ( i = str.search( /e/i ) ) > 0 ) {\r\n\r\n                // Determine exponent.\r\n                if ( e < 0 ) e = i;\r\n                e += +str.slice( i + 1 );\r\n                str = str.substring( 0, i );\r\n            } else if ( e < 0 ) {\r\n\r\n                // Integer.\r\n                e = str.length;\r\n            }\r\n\r\n            // Determine leading zeros.\r\n            for ( i = 0; str.charCodeAt(i) === 48; i++ );\r\n\r\n            // Determine trailing zeros.\r\n            for ( len = str.length; str.charCodeAt(--len) === 48; );\r\n            str = str.slice( i, len + 1 );\r\n\r\n            if (str) {\r\n                len = str.length;\r\n\r\n                // '[BigNumber Error] Number primitive has more than 15 significant digits: {n}'\r\n                if ( isNum && len > 15 && ( n > MAX_SAFE_INTEGER || n !== mathfloor(n) ) ) {\r\n                    throw Error\r\n                      ( tooManyDigits + ( x.s * n ) );\r\n                }\r\n\r\n                e = e - i - 1;\r\n\r\n                 // Overflow?\r\n                if ( e > MAX_EXP ) {\r\n\r\n                    // Infinity.\r\n                    x.c = x.e = null;\r\n\r\n                // Underflow?\r\n                } else if ( e < MIN_EXP ) {\r\n\r\n                    // Zero.\r\n                    x.c = [ x.e = 0 ];\r\n                } else {\r\n                    x.e = e;\r\n                    x.c = [];\r\n\r\n                    // Transform base\r\n\r\n                    // e is the base 10 exponent.\r\n                    // i is where to slice str to get the first element of the coefficient array.\r\n                    i = ( e + 1 ) % LOG_BASE;\r\n                    if ( e < 0 ) i += LOG_BASE;\r\n\r\n                    if ( i < len ) {\r\n                        if (i) x.c.push( +str.slice( 0, i ) );\r\n\r\n                        for ( len -= LOG_BASE; i < len; ) {\r\n                            x.c.push( +str.slice( i, i += LOG_BASE ) );\r\n                        }\r\n\r\n                        str = str.slice(i);\r\n                        i = LOG_BASE - str.length;\r\n                    } else {\r\n                        i -= len;\r\n                    }\r\n\r\n                    for ( ; i--; str += '0' );\r\n                    x.c.push( +str );\r\n                }\r\n            } else {\r\n\r\n                // Zero.\r\n                x.c = [ x.e = 0 ];\r\n            }\r\n        }\r\n\r\n\r\n        // CONSTRUCTOR PROPERTIES\r\n\r\n\r\n        BigNumber.clone = clone;\r\n\r\n        BigNumber.ROUND_UP = 0;\r\n        BigNumber.ROUND_DOWN = 1;\r\n        BigNumber.ROUND_CEIL = 2;\r\n        BigNumber.ROUND_FLOOR = 3;\r\n        BigNumber.ROUND_HALF_UP = 4;\r\n        BigNumber.ROUND_HALF_DOWN = 5;\r\n        BigNumber.ROUND_HALF_EVEN = 6;\r\n        BigNumber.ROUND_HALF_CEIL = 7;\r\n        BigNumber.ROUND_HALF_FLOOR = 8;\r\n        BigNumber.EUCLID = 9;\r\n\r\n\r\n        /*\r\n         * Configure infrequently-changing library-wide settings.\r\n         *\r\n         * Accept an object with the following optional properties (if the value of a property is\r\n         * a number, it must be an integer within the inclusive range stated):\r\n         *\r\n         *   DECIMAL_PLACES   {number}           0 to MAX\r\n         *   ROUNDING_MODE    {number}           0 to 8\r\n         *   EXPONENTIAL_AT   {number|number[]}  -MAX to MAX  or  [-MAX to 0, 0 to MAX]\r\n         *   RANGE            {number|number[]}  -MAX to MAX (not zero)  or  [-MAX to -1, 1 to MAX]\r\n         *   CRYPTO           {boolean}          true or false\r\n         *   MODULO_MODE      {number}           0 to 9\r\n         *   POW_PRECISION       {number}           0 to MAX\r\n         *   ALPHABET         {string}           A string of two or more unique characters, and not\r\n         *                                       containing '.'. The empty string, null or undefined\r\n         *                                       resets the alphabet to its default value.\r\n         *   FORMAT           {object}           An object with some of the following properties:\r\n         *      decimalSeparator       {string}\r\n         *      groupSeparator         {string}\r\n         *      groupSize              {number}\r\n         *      secondaryGroupSize     {number}\r\n         *      fractionGroupSeparator {string}\r\n         *      fractionGroupSize      {number}\r\n         *\r\n         * (The values assigned to the above FORMAT object properties are not checked for validity.)\r\n         *\r\n         * E.g.\r\n         * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\r\n         *\r\n         * Ignore properties/parameters set to null or undefined, except for ALPHABET.\r\n         *\r\n         * Return an object with the properties current values.\r\n         */\r\n        BigNumber.config = BigNumber.set = function (obj) {\r\n            var p, v;\r\n\r\n            if ( obj != null ) {\r\n\r\n                if ( typeof obj == 'object' ) {\r\n\r\n                    // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\r\n                    // '[BigNumber Error] DECIMAL_PLACES {not a primitive number|not an integer|out of range}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'DECIMAL_PLACES' ) ) {\r\n                        v = obj[p];\r\n                        intCheck( v, 0, MAX, p );\r\n                        DECIMAL_PLACES = v;\r\n                    }\r\n\r\n                    // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\r\n                    // '[BigNumber Error] ROUNDING_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'ROUNDING_MODE' ) ) {\r\n                        v = obj[p];\r\n                        intCheck( v, 0, 8, p );\r\n                        ROUNDING_MODE = v;\r\n                    }\r\n\r\n                    // EXPONENTIAL_AT {number|number[]}\r\n                    // Integer, -MAX to MAX inclusive or\r\n                    // [integer -MAX to 0 inclusive, 0 to MAX inclusive].\r\n                    // '[BigNumber Error] EXPONENTIAL_AT {not a primitive number|not an integer|out of range}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'EXPONENTIAL_AT' ) ) {\r\n                        v = obj[p];\r\n                        if ( isArray(v) ) {\r\n                            intCheck( v[0], -MAX, 0, p );\r\n                            intCheck( v[1], 0, MAX, p );\r\n                            TO_EXP_NEG = v[0];\r\n                            TO_EXP_POS = v[1];\r\n                        } else {\r\n                            intCheck( v, -MAX, MAX, p );\r\n                            TO_EXP_NEG = -( TO_EXP_POS = v < 0 ? -v : v );\r\n                        }\r\n                    }\r\n\r\n                    // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\r\n                    // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\r\n                    // '[BigNumber Error] RANGE {not a primitive number|not an integer|out of range|cannot be zero}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'RANGE' ) ) {\r\n                        v = obj[p];\r\n                        if ( isArray(v) ) {\r\n                            intCheck( v[0], -MAX, -1, p );\r\n                            intCheck( v[1], 1, MAX, p );\r\n                            MIN_EXP = v[0];\r\n                            MAX_EXP = v[1];\r\n                        } else {\r\n                            intCheck( v, -MAX, MAX, p );\r\n                            if (v) {\r\n                                MIN_EXP = -( MAX_EXP = v < 0 ? -v : v );\r\n                            } else {\r\n                                throw Error\r\n                                  ( bignumberError + p + ' cannot be zero: ' + v );\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    // CRYPTO {boolean} true or false.\r\n                    // '[BigNumber Error] CRYPTO not true or false: {v}'\r\n                    // '[BigNumber Error] crypto unavailable'\r\n                    if ( obj.hasOwnProperty( p = 'CRYPTO' ) ) {\r\n                        v = obj[p];\r\n                        if ( v === !!v ) {\r\n                            if (v) {\r\n                                if ( typeof crypto != 'undefined' && crypto &&\r\n                                  (crypto.getRandomValues || crypto.randomBytes) ) {\r\n                                    CRYPTO = v;\r\n                                } else {\r\n                                    CRYPTO = !v;\r\n                                    throw Error\r\n                                      ( bignumberError + 'crypto unavailable' );\r\n                                }\r\n                            } else {\r\n                                CRYPTO = v;\r\n                            }\r\n                        } else {\r\n                            throw Error\r\n                              ( bignumberError + p + ' not true or false: ' + v );\r\n                        }\r\n                    }\r\n\r\n                    // MODULO_MODE {number} Integer, 0 to 9 inclusive.\r\n                    // '[BigNumber Error] MODULO_MODE {not a primitive number|not an integer|out of range}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'MODULO_MODE' ) ) {\r\n                        v = obj[p];\r\n                        intCheck( v, 0, 9, p );\r\n                        MODULO_MODE = v;\r\n                    }\r\n\r\n                    // POW_PRECISION {number} Integer, 0 to MAX inclusive.\r\n                    // '[BigNumber Error] POW_PRECISION {not a primitive number|not an integer|out of range}: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'POW_PRECISION' ) ) {\r\n                        v = obj[p];\r\n                        intCheck( v, 0, MAX, p );\r\n                        POW_PRECISION = v;\r\n                    }\r\n\r\n                    // FORMAT {object}\r\n                    // '[BigNumber Error] FORMAT not an object: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'FORMAT' ) ) {\r\n                        v = obj[p];\r\n                        if ( typeof v == 'object' ) FORMAT = v;\r\n                        else throw Error\r\n                          ( bignumberError + p + ' not an object: ' + v );\r\n                    }\r\n\r\n                    // ALPHABET {string}\r\n                    // '[BigNumber Error] ALPHABET invalid: {v}'\r\n                    if ( obj.hasOwnProperty( p = 'ALPHABET' ) ) {\r\n                        v = obj[p];\r\n\r\n                        // Disallow if only one character, or contains '.' or a repeated character.\r\n                        if ( typeof v == 'string' && !/^.$|\\.|(.).*\\1/.test(v) ) {\r\n                            ALPHABET = v;\r\n                        } else {\r\n                            throw Error\r\n                              ( bignumberError + p + ' invalid: ' + v );\r\n                        }\r\n                    }\r\n\r\n                } else {\r\n\r\n                    // '[BigNumber Error] Object expected: {v}'\r\n                    throw Error\r\n                      ( bignumberError + 'Object expected: ' + obj );\r\n                }\r\n            }\r\n\r\n            return {\r\n                DECIMAL_PLACES: DECIMAL_PLACES,\r\n                ROUNDING_MODE: ROUNDING_MODE,\r\n                EXPONENTIAL_AT: [ TO_EXP_NEG, TO_EXP_POS ],\r\n                RANGE: [ MIN_EXP, MAX_EXP ],\r\n                CRYPTO: CRYPTO,\r\n                MODULO_MODE: MODULO_MODE,\r\n                POW_PRECISION: POW_PRECISION,\r\n                FORMAT: FORMAT,\r\n                ALPHABET: ALPHABET\r\n            };\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if v is a BigNumber instance, otherwise return false.\r\n         *\r\n         * v {any}\r\n         */\r\n        BigNumber.isBigNumber = function (v) {\r\n            return v instanceof BigNumber || v && v._isBigNumber === true || false;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the maximum of the arguments.\r\n         *\r\n         * arguments {number|string|BigNumber}\r\n         */\r\n        BigNumber.maximum = BigNumber.max = function () {\r\n            return maxOrMin( arguments, P.lt );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the minimum of the arguments.\r\n         *\r\n         * arguments {number|string|BigNumber}\r\n         */\r\n        BigNumber.minimum = BigNumber.min = function () {\r\n            return maxOrMin( arguments, P.gt );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\r\n         * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\r\n         * zeros are produced).\r\n         *\r\n         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp}'\r\n         * '[BigNumber Error] crypto unavailable'\r\n         */\r\n        BigNumber.random = (function () {\r\n            var pow2_53 = 0x20000000000000;\r\n\r\n            // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\r\n            // Check if Math.random() produces more than 32 bits of randomness.\r\n            // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\r\n            // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\r\n            var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\r\n              ? function () { return mathfloor( Math.random() * pow2_53 ); }\r\n              : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\r\n                  (Math.random() * 0x800000 | 0); };\r\n\r\n            return function (dp) {\r\n                var a, b, e, k, v,\r\n                    i = 0,\r\n                    c = [],\r\n                    rand = new BigNumber(ONE);\r\n\r\n                if ( dp == null ) dp = DECIMAL_PLACES;\r\n                else intCheck( dp, 0, MAX );\r\n\r\n                k = mathceil( dp / LOG_BASE );\r\n\r\n                if (CRYPTO) {\r\n\r\n                    // Browsers supporting crypto.getRandomValues.\r\n                    if (crypto.getRandomValues) {\r\n\r\n                        a = crypto.getRandomValues( new Uint32Array( k *= 2 ) );\r\n\r\n                        for ( ; i < k; ) {\r\n\r\n                            // 53 bits:\r\n                            // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\r\n                            // 11111 11111111 11111111 11111111 11100000 00000000 00000000\r\n                            // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\r\n                            //                                     11111 11111111 11111111\r\n                            // 0x20000 is 2^21.\r\n                            v = a[i] * 0x20000 + (a[i + 1] >>> 11);\r\n\r\n                            // Rejection sampling:\r\n                            // 0 <= v < 9007199254740992\r\n                            // Probability that v >= 9e15, is\r\n                            // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\r\n                            if ( v >= 9e15 ) {\r\n                                b = crypto.getRandomValues( new Uint32Array(2) );\r\n                                a[i] = b[0];\r\n                                a[i + 1] = b[1];\r\n                            } else {\r\n\r\n                                // 0 <= v <= 8999999999999999\r\n                                // 0 <= (v % 1e14) <= 99999999999999\r\n                                c.push( v % 1e14 );\r\n                                i += 2;\r\n                            }\r\n                        }\r\n                        i = k / 2;\r\n\r\n                    // Node.js supporting crypto.randomBytes.\r\n                    } else if (crypto.randomBytes) {\r\n\r\n                        // buffer\r\n                        a = crypto.randomBytes( k *= 7 );\r\n\r\n                        for ( ; i < k; ) {\r\n\r\n                            // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\r\n                            // 0x100000000 is 2^32, 0x1000000 is 2^24\r\n                            // 11111 11111111 11111111 11111111 11111111 11111111 11111111\r\n                            // 0 <= v < 9007199254740992\r\n                            v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) +\r\n                                  ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) +\r\n                                  ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6];\r\n\r\n                            if ( v >= 9e15 ) {\r\n                                crypto.randomBytes(7).copy( a, i );\r\n                            } else {\r\n\r\n                                // 0 <= (v % 1e14) <= 99999999999999\r\n                                c.push( v % 1e14 );\r\n                                i += 7;\r\n                            }\r\n                        }\r\n                        i = k / 7;\r\n                    } else {\r\n                        CRYPTO = false;\r\n                        throw Error\r\n                          ( bignumberError + 'crypto unavailable' );\r\n                    }\r\n                }\r\n\r\n                // Use Math.random.\r\n                if (!CRYPTO) {\r\n\r\n                    for ( ; i < k; ) {\r\n                        v = random53bitInt();\r\n                        if ( v < 9e15 ) c[i++] = v % 1e14;\r\n                    }\r\n                }\r\n\r\n                k = c[--i];\r\n                dp %= LOG_BASE;\r\n\r\n                // Convert trailing digits to zeros according to dp.\r\n                if ( k && dp ) {\r\n                    v = POWS_TEN[LOG_BASE - dp];\r\n                    c[i] = mathfloor( k / v ) * v;\r\n                }\r\n\r\n                // Remove trailing elements which are zero.\r\n                for ( ; c[i] === 0; c.pop(), i-- );\r\n\r\n                // Zero?\r\n                if ( i < 0 ) {\r\n                    c = [ e = 0 ];\r\n                } else {\r\n\r\n                    // Remove leading elements which are zero and adjust exponent accordingly.\r\n                    for ( e = -1 ; c[0] === 0; c.splice(0, 1), e -= LOG_BASE);\r\n\r\n                    // Count the digits of the first element of c to determine leading zeros, and...\r\n                    for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);\r\n\r\n                    // adjust the exponent accordingly.\r\n                    if ( i < LOG_BASE ) e -= LOG_BASE - i;\r\n                }\r\n\r\n                rand.e = e;\r\n                rand.c = c;\r\n                return rand;\r\n            };\r\n        })();\r\n\r\n\r\n        // PRIVATE FUNCTIONS\r\n\r\n\r\n        // Called by BigNumber and BigNumber.prototype.toString.\r\n        convertBase = ( function () {\r\n            var decimal = '0123456789';\r\n\r\n            /*\r\n             * Convert string of baseIn to an array of numbers of baseOut.\r\n             * Eg. toBaseOut('255', 10, 16) returns [15, 15].\r\n             * Eg. toBaseOut('ff', 16, 10) returns [2, 5, 5].\r\n             */\r\n            function toBaseOut( str, baseIn, baseOut, alphabet ) {\r\n                var j,\r\n                    arr = [0],\r\n                    arrL,\r\n                    i = 0,\r\n                    len = str.length;\r\n\r\n                for ( ; i < len; ) {\r\n                    for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\r\n\r\n                    arr[0] += alphabet.indexOf( str.charAt( i++ ) );\r\n\r\n                    for ( j = 0; j < arr.length; j++ ) {\r\n\r\n                        if ( arr[j] > baseOut - 1 ) {\r\n                            if ( arr[j + 1] == null ) arr[j + 1] = 0;\r\n                            arr[j + 1] += arr[j] / baseOut | 0;\r\n                            arr[j] %= baseOut;\r\n                        }\r\n                    }\r\n                }\r\n\r\n                return arr.reverse();\r\n            }\r\n\r\n            // Convert a numeric string of baseIn to a numeric string of baseOut.\r\n            // If the caller is toString, we are converting from base 10 to baseOut.\r\n            // If the caller is BigNumber, we are converting from baseIn to base 10.\r\n            return function ( str, baseIn, baseOut, sign, callerIsToString ) {\r\n                var alphabet, d, e, k, r, x, xc, y,\r\n                    i = str.indexOf( '.' ),\r\n                    dp = DECIMAL_PLACES,\r\n                    rm = ROUNDING_MODE;\r\n\r\n                // Non-integer.\r\n                if ( i >= 0 ) {\r\n                    k = POW_PRECISION;\r\n\r\n                    // Unlimited precision.\r\n                    POW_PRECISION = 0;\r\n                    str = str.replace( '.', '' );\r\n                    y = new BigNumber(baseIn);\r\n                    x = y.pow( str.length - i );\r\n                    POW_PRECISION = k;\r\n\r\n                    // Convert str as if an integer, then restore the fraction part by dividing the\r\n                    // result by its base raised to a power.\r\n\r\n                    y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e, '0' ),\r\n                      10, baseOut, decimal );\r\n                    y.e = y.c.length;\r\n                }\r\n\r\n                // Convert the number as integer.\r\n\r\n                xc = toBaseOut( str, baseIn, baseOut, callerIsToString\r\n                  ? ( alphabet = ALPHABET, decimal )\r\n                  : ( alphabet = decimal, ALPHABET ) );\r\n\r\n\r\n                // xc now represents str as an integer and converted to baseOut. e is the exponent.\r\n                e = k = xc.length;\r\n\r\n                // Remove trailing zeros.\r\n                for ( ; xc[--k] == 0; xc.pop() );\r\n\r\n                // Zero?\r\n                if ( !xc[0] ) return alphabet.charAt(0);\r\n\r\n                // Does str represent an integer? If so, no need for the division.\r\n                if ( i < 0 ) {\r\n                    --e;\r\n                } else {\r\n                    x.c = xc;\r\n                    x.e = e;\r\n\r\n                    // The sign is needed for correct rounding.\r\n                    x.s = sign;\r\n                    x = div( x, y, dp, rm, baseOut );\r\n                    xc = x.c;\r\n                    r = x.r;\r\n                    e = x.e;\r\n                }\r\n\r\n                // xc now represents str converted to baseOut.\r\n\r\n                // THe index of the rounding digit.\r\n                d = e + dp + 1;\r\n\r\n                // The rounding digit: the digit to the right of the digit that may be rounded up.\r\n                i = xc[d];\r\n\r\n                // Look at the rounding digits and mode to determine whether to round up.\r\n\r\n                k = baseOut / 2;\r\n                r = r || d < 0 || xc[d + 1] != null;\r\n\r\n                r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n                           : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n                             rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n                // If the index of the rounding digit is not greater than zero, or xc represents\r\n                // zero, then the result of the base conversion is zero or, if rounding up, a value\r\n                // such as 0.00001.\r\n                if ( d < 1 || !xc[0] ) {\r\n\r\n                    // 1^-dp or 0\r\n                    str = r ? toFixedPoint( alphabet.charAt(1), -dp, alphabet.charAt(0) )\r\n                            : alphabet.charAt(0);\r\n                } else {\r\n\r\n                    // Truncate xc to the required number of decimal places.\r\n                    xc.length = d;\r\n\r\n                    // Round up?\r\n                    if (r) {\r\n\r\n                        // Rounding up may mean the previous digit has to be rounded up and so on.\r\n                        for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n                            xc[d] = 0;\r\n\r\n                            if ( !d ) {\r\n                                ++e;\r\n                                xc = [1].concat(xc);\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    // Determine trailing zeros.\r\n                    for ( k = xc.length; !xc[--k]; );\r\n\r\n                    // E.g. [4, 11, 15] becomes 4bf.\r\n                    for ( i = 0, str = ''; i <= k; str += alphabet.charAt( xc[i++] ) );\r\n\r\n                    // Add leading zeros, decimal point and trailing zeros as required.\r\n                    str = toFixedPoint( str, e, alphabet.charAt(0) );\r\n                }\r\n\r\n                // The caller will add the sign.\r\n                return str;\r\n            };\r\n        })();\r\n\r\n\r\n        // Perform division in the specified base. Called by div and convertBase.\r\n        div = (function () {\r\n\r\n            // Assume non-zero x and k.\r\n            function multiply( x, k, base ) {\r\n                var m, temp, xlo, xhi,\r\n                    carry = 0,\r\n                    i = x.length,\r\n                    klo = k % SQRT_BASE,\r\n                    khi = k / SQRT_BASE | 0;\r\n\r\n                for ( x = x.slice(); i--; ) {\r\n                    xlo = x[i] % SQRT_BASE;\r\n                    xhi = x[i] / SQRT_BASE | 0;\r\n                    m = khi * xlo + xhi * klo;\r\n                    temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry;\r\n                    carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi;\r\n                    x[i] = temp % base;\r\n                }\r\n\r\n                if (carry) x = [carry].concat(x);\r\n\r\n                return x;\r\n            }\r\n\r\n            function compare( a, b, aL, bL ) {\r\n                var i, cmp;\r\n\r\n                if ( aL != bL ) {\r\n                    cmp = aL > bL ? 1 : -1;\r\n                } else {\r\n\r\n                    for ( i = cmp = 0; i < aL; i++ ) {\r\n\r\n                        if ( a[i] != b[i] ) {\r\n                            cmp = a[i] > b[i] ? 1 : -1;\r\n                            break;\r\n                        }\r\n                    }\r\n                }\r\n                return cmp;\r\n            }\r\n\r\n            function subtract( a, b, aL, base ) {\r\n                var i = 0;\r\n\r\n                // Subtract b from a.\r\n                for ( ; aL--; ) {\r\n                    a[aL] -= i;\r\n                    i = a[aL] < b[aL] ? 1 : 0;\r\n                    a[aL] = i * base + a[aL] - b[aL];\r\n                }\r\n\r\n                // Remove leading zeros.\r\n                for ( ; !a[0] && a.length > 1; a.splice(0, 1) );\r\n            }\r\n\r\n            // x: dividend, y: divisor.\r\n            return function ( x, y, dp, rm, base ) {\r\n                var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\r\n                    yL, yz,\r\n                    s = x.s == y.s ? 1 : -1,\r\n                    xc = x.c,\r\n                    yc = y.c;\r\n\r\n                // Either NaN, Infinity or 0?\r\n                if ( !xc || !xc[0] || !yc || !yc[0] ) {\r\n\r\n                    return new BigNumber(\r\n\r\n                      // Return NaN if either NaN, or both Infinity or 0.\r\n                      !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN :\r\n\r\n                        // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\r\n                        xc && xc[0] == 0 || !yc ? s * 0 : s / 0\r\n                    );\r\n                }\r\n\r\n                q = new BigNumber(s);\r\n                qc = q.c = [];\r\n                e = x.e - y.e;\r\n                s = dp + e + 1;\r\n\r\n                if ( !base ) {\r\n                    base = BASE;\r\n                    e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE );\r\n                    s = s / LOG_BASE | 0;\r\n                }\r\n\r\n                // Result exponent may be one less then the current value of e.\r\n                // The coefficients of the BigNumbers from convertBase may have trailing zeros.\r\n                for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ );\r\n\r\n                if ( yc[i] > ( xc[i] || 0 ) ) e--;\r\n\r\n                if ( s < 0 ) {\r\n                    qc.push(1);\r\n                    more = true;\r\n                } else {\r\n                    xL = xc.length;\r\n                    yL = yc.length;\r\n                    i = 0;\r\n                    s += 2;\r\n\r\n                    // Normalise xc and yc so highest order digit of yc is >= base / 2.\r\n\r\n                    n = mathfloor( base / ( yc[0] + 1 ) );\r\n\r\n                    // Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1.\r\n                    // if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) {\r\n                    if ( n > 1 ) {\r\n                        yc = multiply( yc, n, base );\r\n                        xc = multiply( xc, n, base );\r\n                        yL = yc.length;\r\n                        xL = xc.length;\r\n                    }\r\n\r\n                    xi = yL;\r\n                    rem = xc.slice( 0, yL );\r\n                    remL = rem.length;\r\n\r\n                    // Add zeros to make remainder as long as divisor.\r\n                    for ( ; remL < yL; rem[remL++] = 0 );\r\n                    yz = yc.slice();\r\n                    yz = [0].concat(yz);\r\n                    yc0 = yc[0];\r\n                    if ( yc[1] >= base / 2 ) yc0++;\r\n                    // Not necessary, but to prevent trial digit n > base, when using base 3.\r\n                    // else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15;\r\n\r\n                    do {\r\n                        n = 0;\r\n\r\n                        // Compare divisor and remainder.\r\n                        cmp = compare( yc, rem, yL, remL );\r\n\r\n                        // If divisor < remainder.\r\n                        if ( cmp < 0 ) {\r\n\r\n                            // Calculate trial digit, n.\r\n\r\n                            rem0 = rem[0];\r\n                            if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 );\r\n\r\n                            // n is how many times the divisor goes into the current remainder.\r\n                            n = mathfloor( rem0 / yc0 );\r\n\r\n                            //  Algorithm:\r\n                            //  1. product = divisor * trial digit (n)\r\n                            //  2. if product > remainder: product -= divisor, n--\r\n                            //  3. remainder -= product\r\n                            //  4. if product was < remainder at 2:\r\n                            //    5. compare new remainder and divisor\r\n                            //    6. If remainder > divisor: remainder -= divisor, n++\r\n\r\n                            if ( n > 1 ) {\r\n\r\n                                // n may be > base only when base is 3.\r\n                                if (n >= base) n = base - 1;\r\n\r\n                                // product = divisor * trial digit.\r\n                                prod = multiply( yc, n, base );\r\n                                prodL = prod.length;\r\n                                remL = rem.length;\r\n\r\n                                // Compare product and remainder.\r\n                                // If product > remainder.\r\n                                // Trial digit n too high.\r\n                                // n is 1 too high about 5% of the time, and is not known to have\r\n                                // ever been more than 1 too high.\r\n                                while ( compare( prod, rem, prodL, remL ) == 1 ) {\r\n                                    n--;\r\n\r\n                                    // Subtract divisor from product.\r\n                                    subtract( prod, yL < prodL ? yz : yc, prodL, base );\r\n                                    prodL = prod.length;\r\n                                    cmp = 1;\r\n                                }\r\n                            } else {\r\n\r\n                                // n is 0 or 1, cmp is -1.\r\n                                // If n is 0, there is no need to compare yc and rem again below,\r\n                                // so change cmp to 1 to avoid it.\r\n                                // If n is 1, leave cmp as -1, so yc and rem are compared again.\r\n                                if ( n == 0 ) {\r\n\r\n                                    // divisor < remainder, so n must be at least 1.\r\n                                    cmp = n = 1;\r\n                                }\r\n\r\n                                // product = divisor\r\n                                prod = yc.slice();\r\n                                prodL = prod.length;\r\n                            }\r\n\r\n                            if ( prodL < remL ) prod = [0].concat(prod);\r\n\r\n                            // Subtract product from remainder.\r\n                            subtract( rem, prod, remL, base );\r\n                            remL = rem.length;\r\n\r\n                             // If product was < remainder.\r\n                            if ( cmp == -1 ) {\r\n\r\n                                // Compare divisor and new remainder.\r\n                                // If divisor < new remainder, subtract divisor from remainder.\r\n                                // Trial digit n too low.\r\n                                // n is 1 too low about 5% of the time, and very rarely 2 too low.\r\n                                while ( compare( yc, rem, yL, remL ) < 1 ) {\r\n                                    n++;\r\n\r\n                                    // Subtract divisor from remainder.\r\n                                    subtract( rem, yL < remL ? yz : yc, remL, base );\r\n                                    remL = rem.length;\r\n                                }\r\n                            }\r\n                        } else if ( cmp === 0 ) {\r\n                            n++;\r\n                            rem = [0];\r\n                        } // else cmp === 1 and n will be 0\r\n\r\n                        // Add the next digit, n, to the result array.\r\n                        qc[i++] = n;\r\n\r\n                        // Update the remainder.\r\n                        if ( rem[0] ) {\r\n                            rem[remL++] = xc[xi] || 0;\r\n                        } else {\r\n                            rem = [ xc[xi] ];\r\n                            remL = 1;\r\n                        }\r\n                    } while ( ( xi++ < xL || rem[0] != null ) && s-- );\r\n\r\n                    more = rem[0] != null;\r\n\r\n                    // Leading zero?\r\n                    if ( !qc[0] ) qc.splice(0, 1);\r\n                }\r\n\r\n                if ( base == BASE ) {\r\n\r\n                    // To calculate q.e, first get the number of digits of qc[0].\r\n                    for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ );\r\n\r\n                    round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more );\r\n\r\n                // Caller is convertBase.\r\n                } else {\r\n                    q.e = e;\r\n                    q.r = +more;\r\n                }\r\n\r\n                return q;\r\n            };\r\n        })();\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of BigNumber n in fixed-point or exponential\r\n         * notation rounded to the specified decimal places or significant digits.\r\n         *\r\n         * n: a BigNumber.\r\n         * i: the index of the last digit required (i.e. the digit that may be rounded up).\r\n         * rm: the rounding mode.\r\n         * id: 1 (toExponential) or 2 (toPrecision).\r\n         */\r\n        function format( n, i, rm, id ) {\r\n            var c0, e, ne, len, str;\r\n\r\n            if ( rm == null ) rm = ROUNDING_MODE;\r\n            else intCheck( rm, 0, 8 );\r\n\r\n            if ( !n.c ) return n.toString();\r\n\r\n            c0 = n.c[0];\r\n            ne = n.e;\r\n\r\n            if ( i == null ) {\r\n                str = coeffToString( n.c );\r\n                str = id == 1 || id == 2 && ne <= TO_EXP_NEG\r\n                  ? toExponential( str, ne )\r\n                  : toFixedPoint( str, ne, '0' );\r\n            } else {\r\n                n = round( new BigNumber(n), i, rm );\r\n\r\n                // n.e may have changed if the value was rounded up.\r\n                e = n.e;\r\n\r\n                str = coeffToString( n.c );\r\n                len = str.length;\r\n\r\n                // toPrecision returns exponential notation if the number of significant digits\r\n                // specified is less than the number of digits necessary to represent the integer\r\n                // part of the value in fixed-point notation.\r\n\r\n                // Exponential notation.\r\n                if ( id == 1 || id == 2 && ( i <= e || e <= TO_EXP_NEG ) ) {\r\n\r\n                    // Append zeros?\r\n                    for ( ; len < i; str += '0', len++ );\r\n                    str = toExponential( str, e );\r\n\r\n                // Fixed-point notation.\r\n                } else {\r\n                    i -= ne;\r\n                    str = toFixedPoint( str, e, '0' );\r\n\r\n                    // Append zeros?\r\n                    if ( e + 1 > len ) {\r\n                        if ( --i > 0 ) for ( str += '.'; i--; str += '0' );\r\n                    } else {\r\n                        i += e - len;\r\n                        if ( i > 0 ) {\r\n                            if ( e + 1 == len ) str += '.';\r\n                            for ( ; i--; str += '0' );\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            return n.s < 0 && c0 ? '-' + str : str;\r\n        }\r\n\r\n\r\n        // Handle BigNumber.max and BigNumber.min.\r\n        function maxOrMin( args, method ) {\r\n            var m, n,\r\n                i = 0;\r\n\r\n            if ( isArray( args[0] ) ) args = args[0];\r\n            m = new BigNumber( args[0] );\r\n\r\n            for ( ; ++i < args.length; ) {\r\n                n = new BigNumber( args[i] );\r\n\r\n                // If any number is NaN, return NaN.\r\n                if ( !n.s ) {\r\n                    m = n;\r\n                    break;\r\n                } else if ( method.call( m, n ) ) {\r\n                    m = n;\r\n                }\r\n            }\r\n\r\n            return m;\r\n        }\r\n\r\n\r\n        /*\r\n         * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\r\n         * Called by minus, plus and times.\r\n         */\r\n        function normalise( n, c, e ) {\r\n            var i = 1,\r\n                j = c.length;\r\n\r\n             // Remove trailing zeros.\r\n            for ( ; !c[--j]; c.pop() );\r\n\r\n            // Calculate the base 10 exponent. First get the number of digits of c[0].\r\n            for ( j = c[0]; j >= 10; j /= 10, i++ );\r\n\r\n            // Overflow?\r\n            if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) {\r\n\r\n                // Infinity.\r\n                n.c = n.e = null;\r\n\r\n            // Underflow?\r\n            } else if ( e < MIN_EXP ) {\r\n\r\n                // Zero.\r\n                n.c = [ n.e = 0 ];\r\n            } else {\r\n                n.e = e;\r\n                n.c = c;\r\n            }\r\n\r\n            return n;\r\n        }\r\n\r\n\r\n        // Handle values that fail the validity test in BigNumber.\r\n        parseNumeric = (function () {\r\n            var basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\r\n                dotAfter = /^([^.]+)\\.$/,\r\n                dotBefore = /^\\.([^.]+)$/,\r\n                isInfinityOrNaN = /^-?(Infinity|NaN)$/,\r\n                whitespaceOrPlus = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\r\n\r\n            return function ( x, str, isNum, b ) {\r\n                var base,\r\n                    s = isNum ? str : str.replace( whitespaceOrPlus, '' );\r\n\r\n                // No exception on ±Infinity or NaN.\r\n                if ( isInfinityOrNaN.test(s) ) {\r\n                    x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\r\n                    x.c = x.e = null;\r\n                } else {\r\n                    if ( !isNum ) {\r\n\r\n                        // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\r\n                        s = s.replace( basePrefix, function ( m, p1, p2 ) {\r\n                            base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\r\n                            return !b || b == base ? p1 : m;\r\n                        });\r\n\r\n                        if (b) {\r\n                            base = b;\r\n\r\n                            // E.g. '1.' to '1', '.1' to '0.1'\r\n                            s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' );\r\n                        }\r\n\r\n                        if ( str != s ) return new BigNumber( s, base );\r\n                    }\r\n\r\n                    // '[BigNumber Error] Not a number: {n}'\r\n                    // '[BigNumber Error] Not a base {b} number: {n}'\r\n                    throw Error\r\n                      ( bignumberError + 'Not a' + ( b ? ' base ' + b : '' ) + ' number: ' + str );\r\n                }\r\n            }\r\n        })();\r\n\r\n\r\n        /*\r\n         * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\r\n         * If r is truthy, it is known that there are more digits after the rounding digit.\r\n         */\r\n        function round( x, sd, rm, r ) {\r\n            var d, i, j, k, n, ni, rd,\r\n                xc = x.c,\r\n                pows10 = POWS_TEN;\r\n\r\n            // if x is not Infinity or NaN...\r\n            if (xc) {\r\n\r\n                // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\r\n                // n is a base 1e14 number, the value of the element of array x.c containing rd.\r\n                // ni is the index of n within x.c.\r\n                // d is the number of digits of n.\r\n                // i is the index of rd within n including leading zeros.\r\n                // j is the actual index of rd within n (if < 0, rd is a leading zero).\r\n                out: {\r\n\r\n                    // Get the number of digits of the first element of xc.\r\n                    for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ );\r\n                    i = sd - d;\r\n\r\n                    // If the rounding digit is in the first element of xc...\r\n                    if ( i < 0 ) {\r\n                        i += LOG_BASE;\r\n                        j = sd;\r\n                        n = xc[ ni = 0 ];\r\n\r\n                        // Get the rounding digit at index j of n.\r\n                        rd = n / pows10[ d - j - 1 ] % 10 | 0;\r\n                    } else {\r\n                        ni = mathceil( ( i + 1 ) / LOG_BASE );\r\n\r\n                        if ( ni >= xc.length ) {\r\n\r\n                            if (r) {\r\n\r\n                                // Needed by sqrt.\r\n                                for ( ; xc.length <= ni; xc.push(0) );\r\n                                n = rd = 0;\r\n                                d = 1;\r\n                                i %= LOG_BASE;\r\n                                j = i - LOG_BASE + 1;\r\n                            } else {\r\n                                break out;\r\n                            }\r\n                        } else {\r\n                            n = k = xc[ni];\r\n\r\n                            // Get the number of digits of n.\r\n                            for ( d = 1; k >= 10; k /= 10, d++ );\r\n\r\n                            // Get the index of rd within n.\r\n                            i %= LOG_BASE;\r\n\r\n                            // Get the index of rd within n, adjusted for leading zeros.\r\n                            // The number of leading zeros of n is given by LOG_BASE - d.\r\n                            j = i - LOG_BASE + d;\r\n\r\n                            // Get the rounding digit at index j of n.\r\n                            rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0;\r\n                        }\r\n                    }\r\n\r\n                    r = r || sd < 0 ||\r\n\r\n                    // Are there any non-zero digits after the rounding digit?\r\n                    // The expression  n % pows10[ d - j - 1 ]  returns all digits of n to the right\r\n                    // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\r\n                      xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] );\r\n\r\n                    r = rm < 4\r\n                      ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n                      : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 &&\r\n\r\n                        // Check whether the digit to the left of the rounding digit is odd.\r\n                        ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 ||\r\n                          rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n                    if ( sd < 1 || !xc[0] ) {\r\n                        xc.length = 0;\r\n\r\n                        if (r) {\r\n\r\n                            // Convert sd to decimal places.\r\n                            sd -= x.e + 1;\r\n\r\n                            // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n                            xc[0] = pows10[ ( LOG_BASE - sd % LOG_BASE ) % LOG_BASE ];\r\n                            x.e = -sd || 0;\r\n                        } else {\r\n\r\n                            // Zero.\r\n                            xc[0] = x.e = 0;\r\n                        }\r\n\r\n                        return x;\r\n                    }\r\n\r\n                    // Remove excess digits.\r\n                    if ( i == 0 ) {\r\n                        xc.length = ni;\r\n                        k = 1;\r\n                        ni--;\r\n                    } else {\r\n                        xc.length = ni + 1;\r\n                        k = pows10[ LOG_BASE - i ];\r\n\r\n                        // E.g. 56700 becomes 56000 if 7 is the rounding digit.\r\n                        // j > 0 means i > number of leading zeros of n.\r\n                        xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0;\r\n                    }\r\n\r\n                    // Round up?\r\n                    if (r) {\r\n\r\n                        for ( ; ; ) {\r\n\r\n                            // If the digit to be rounded up is in the first element of xc...\r\n                            if ( ni == 0 ) {\r\n\r\n                                // i will be the length of xc[0] before k is added.\r\n                                for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ );\r\n                                j = xc[0] += k;\r\n                                for ( k = 1; j >= 10; j /= 10, k++ );\r\n\r\n                                // if i != k the length has increased.\r\n                                if ( i != k ) {\r\n                                    x.e++;\r\n                                    if ( xc[0] == BASE ) xc[0] = 1;\r\n                                }\r\n\r\n                                break;\r\n                            } else {\r\n                                xc[ni] += k;\r\n                                if ( xc[ni] != BASE ) break;\r\n                                xc[ni--] = 0;\r\n                                k = 1;\r\n                            }\r\n                        }\r\n                    }\r\n\r\n                    // Remove trailing zeros.\r\n                    for ( i = xc.length; xc[--i] === 0; xc.pop() );\r\n                }\r\n\r\n                // Overflow? Infinity.\r\n                if ( x.e > MAX_EXP ) {\r\n                    x.c = x.e = null;\r\n\r\n                // Underflow? Zero.\r\n                } else if ( x.e < MIN_EXP ) {\r\n                    x.c = [ x.e = 0 ];\r\n                }\r\n            }\r\n\r\n            return x;\r\n        }\r\n\r\n\r\n        // PROTOTYPE/INSTANCE METHODS\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the absolute value of this BigNumber.\r\n         */\r\n        P.absoluteValue = P.abs = function () {\r\n            var x = new BigNumber(this);\r\n            if ( x.s < 0 ) x.s = 1;\r\n            return x;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return\r\n         *   1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n         *   -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n         *   0 if they have the same value,\r\n         *   or null if the value of either is NaN.\r\n         */\r\n        P.comparedTo = function ( y, b ) {\r\n            return compare( this, new BigNumber( y, b ) );\r\n        };\r\n\r\n\r\n        /*\r\n         * If dp is undefined or null or true or false, return the number of decimal places of the\r\n         * value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n         *\r\n         * Otherwise, if dp is a number, return a new BigNumber whose value is the value of this\r\n         * BigNumber rounded to a maximum of dp decimal places using rounding mode rm, or\r\n         * ROUNDING_MODE if rm is omitted.\r\n         *\r\n         * [dp] {number} Decimal places: integer, 0 to MAX inclusive.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n         */\r\n        P.decimalPlaces = P.dp = function ( dp, rm ) {\r\n            var c, n, v,\r\n                x = this;\r\n\r\n            if ( dp != null ) {\r\n                intCheck( dp, 0, MAX );\r\n                if ( rm == null ) rm = ROUNDING_MODE;\r\n                else intCheck( rm, 0, 8 );\r\n\r\n                return round( new BigNumber(x), dp + x.e + 1, rm );\r\n            }\r\n\r\n            if ( !( c = x.c ) ) return null;\r\n            n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE;\r\n\r\n            // Subtract the number of trailing zeros of the last number.\r\n            if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- );\r\n            if ( n < 0 ) n = 0;\r\n\r\n            return n;\r\n        };\r\n\r\n\r\n        /*\r\n         *  n / 0 = I\r\n         *  n / N = N\r\n         *  n / I = 0\r\n         *  0 / n = 0\r\n         *  0 / 0 = N\r\n         *  0 / N = N\r\n         *  0 / I = 0\r\n         *  N / n = N\r\n         *  N / 0 = N\r\n         *  N / N = N\r\n         *  N / I = N\r\n         *  I / n = I\r\n         *  I / 0 = I\r\n         *  I / N = N\r\n         *  I / I = N\r\n         *\r\n         * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\r\n         * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n         */\r\n        P.dividedBy = P.div = function ( y, b ) {\r\n            return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the integer part of dividing the value of this\r\n         * BigNumber by the value of BigNumber(y, b).\r\n         */\r\n        P.dividedToIntegerBy = P.idiv = function ( y, b ) {\r\n            return div( this, new BigNumber( y, b ), 0, 1 );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\r\n         * otherwise return false.\r\n         */\r\n        P.isEqualTo = P.eq = function ( y, b ) {\r\n            return compare( this, new BigNumber( y, b ) ) === 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the value of this BigNumber rounded to an integer\r\n         * using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n         *\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {rm}'\r\n         */\r\n        P.integerValue = function (rm) {\r\n            var n = new BigNumber(this);\r\n            if ( rm == null ) rm = ROUNDING_MODE;\r\n            else intCheck( rm, 0, 8 );\r\n            return round( n, n.e + 1, rm );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\r\n         * otherwise return false.\r\n         */\r\n        P.isGreaterThan = P.gt = function ( y, b ) {\r\n            return compare( this, new BigNumber( y, b ) ) > 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is greater than or equal to the value of\r\n         * BigNumber(y, b), otherwise return false.\r\n         */\r\n        P.isGreaterThanOrEqualTo = P.gte = function ( y, b ) {\r\n            return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0;\r\n\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is a finite number, otherwise return false.\r\n         */\r\n        P.isFinite = function () {\r\n            return !!this.c;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is an integer, otherwise return false.\r\n         */\r\n        P.isInteger = function () {\r\n            return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is NaN, otherwise return false.\r\n         */\r\n        P.isNaN = function () {\r\n            return !this.s;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is negative, otherwise return false.\r\n         */\r\n        P.isNegative = function () {\r\n            return this.s < 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is positive, otherwise return false.\r\n         */\r\n        P.isPositive = function () {\r\n            return this.s > 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is 0 or -0, otherwise return false.\r\n         */\r\n        P.isZero = function () {\r\n            return !!this.c && this.c[0] == 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\r\n         * otherwise return false.\r\n         */\r\n        P.isLessThan = P.lt = function ( y, b ) {\r\n            return compare( this, new BigNumber( y, b ) ) < 0;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return true if the value of this BigNumber is less than or equal to the value of\r\n         * BigNumber(y, b), otherwise return false.\r\n         */\r\n        P.isLessThanOrEqualTo = P.lte = function ( y, b ) {\r\n            return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0;\r\n        };\r\n\r\n\r\n        /*\r\n         *  n - 0 = n\r\n         *  n - N = N\r\n         *  n - I = -I\r\n         *  0 - n = -n\r\n         *  0 - 0 = 0\r\n         *  0 - N = N\r\n         *  0 - I = -I\r\n         *  N - n = N\r\n         *  N - 0 = N\r\n         *  N - N = N\r\n         *  N - I = N\r\n         *  I - n = I\r\n         *  I - 0 = I\r\n         *  I - N = N\r\n         *  I - I = N\r\n         *\r\n         * Return a new BigNumber whose value is the value of this BigNumber minus the value of\r\n         * BigNumber(y, b).\r\n         */\r\n        P.minus = function ( y, b ) {\r\n            var i, j, t, xLTy,\r\n                x = this,\r\n                a = x.s;\r\n\r\n            y = new BigNumber( y, b );\r\n            b = y.s;\r\n\r\n            // Either NaN?\r\n            if ( !a || !b ) return new BigNumber(NaN);\r\n\r\n            // Signs differ?\r\n            if ( a != b ) {\r\n                y.s = -b;\r\n                return x.plus(y);\r\n            }\r\n\r\n            var xe = x.e / LOG_BASE,\r\n                ye = y.e / LOG_BASE,\r\n                xc = x.c,\r\n                yc = y.c;\r\n\r\n            if ( !xe || !ye ) {\r\n\r\n                // Either Infinity?\r\n                if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN );\r\n\r\n                // Either zero?\r\n                if ( !xc[0] || !yc[0] ) {\r\n\r\n                    // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n                    return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x :\r\n\r\n                      // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\r\n                      ROUNDING_MODE == 3 ? -0 : 0 );\r\n                }\r\n            }\r\n\r\n            xe = bitFloor(xe);\r\n            ye = bitFloor(ye);\r\n            xc = xc.slice();\r\n\r\n            // Determine which is the bigger number.\r\n            if ( a = xe - ye ) {\r\n\r\n                if ( xLTy = a < 0 ) {\r\n                    a = -a;\r\n                    t = xc;\r\n                } else {\r\n                    ye = xe;\r\n                    t = yc;\r\n                }\r\n\r\n                t.reverse();\r\n\r\n                // Prepend zeros to equalise exponents.\r\n                for ( b = a; b--; t.push(0) );\r\n                t.reverse();\r\n            } else {\r\n\r\n                // Exponents equal. Check digit by digit.\r\n                j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b;\r\n\r\n                for ( a = b = 0; b < j; b++ ) {\r\n\r\n                    if ( xc[b] != yc[b] ) {\r\n                        xLTy = xc[b] < yc[b];\r\n                        break;\r\n                    }\r\n                }\r\n            }\r\n\r\n            // x < y? Point xc to the array of the bigger number.\r\n            if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\r\n\r\n            b = ( j = yc.length ) - ( i = xc.length );\r\n\r\n            // Append zeros to xc if shorter.\r\n            // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\r\n            if ( b > 0 ) for ( ; b--; xc[i++] = 0 );\r\n            b = BASE - 1;\r\n\r\n            // Subtract yc from xc.\r\n            for ( ; j > a; ) {\r\n\r\n                if ( xc[--j] < yc[j] ) {\r\n                    for ( i = j; i && !xc[--i]; xc[i] = b );\r\n                    --xc[i];\r\n                    xc[j] += BASE;\r\n                }\r\n\r\n                xc[j] -= yc[j];\r\n            }\r\n\r\n            // Remove leading zeros and adjust exponent accordingly.\r\n            for ( ; xc[0] == 0; xc.splice(0, 1), --ye );\r\n\r\n            // Zero?\r\n            if ( !xc[0] ) {\r\n\r\n                // Following IEEE 754 (2008) 6.3,\r\n                // n - n = +0  but  n - n = -0  when rounding towards -Infinity.\r\n                y.s = ROUNDING_MODE == 3 ? -1 : 1;\r\n                y.c = [ y.e = 0 ];\r\n                return y;\r\n            }\r\n\r\n            // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\r\n            // for finite x and y.\r\n            return normalise( y, xc, ye );\r\n        };\r\n\r\n\r\n        /*\r\n         *   n % 0 =  N\r\n         *   n % N =  N\r\n         *   n % I =  n\r\n         *   0 % n =  0\r\n         *  -0 % n = -0\r\n         *   0 % 0 =  N\r\n         *   0 % N =  N\r\n         *   0 % I =  0\r\n         *   N % n =  N\r\n         *   N % 0 =  N\r\n         *   N % N =  N\r\n         *   N % I =  N\r\n         *   I % n =  N\r\n         *   I % 0 =  N\r\n         *   I % N =  N\r\n         *   I % I =  N\r\n         *\r\n         * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\r\n         * BigNumber(y, b). The result depends on the value of MODULO_MODE.\r\n         */\r\n        P.modulo = P.mod = function ( y, b ) {\r\n            var q, s,\r\n                x = this;\r\n\r\n            y = new BigNumber( y, b );\r\n\r\n            // Return NaN if x is Infinity or NaN, or y is NaN or zero.\r\n            if ( !x.c || !y.s || y.c && !y.c[0] ) {\r\n                return new BigNumber(NaN);\r\n\r\n            // Return x if y is Infinity or x is zero.\r\n            } else if ( !y.c || x.c && !x.c[0] ) {\r\n                return new BigNumber(x);\r\n            }\r\n\r\n            if ( MODULO_MODE == 9 ) {\r\n\r\n                // Euclidian division: q = sign(y) * floor(x / abs(y))\r\n                // r = x - qy    where  0 <= r < abs(y)\r\n                s = y.s;\r\n                y.s = 1;\r\n                q = div( x, y, 0, 3 );\r\n                y.s = s;\r\n                q.s *= s;\r\n            } else {\r\n                q = div( x, y, 0, MODULO_MODE );\r\n            }\r\n\r\n            return x.minus( q.times(y) );\r\n        };\r\n\r\n\r\n        /*\r\n         *  n * 0 = 0\r\n         *  n * N = N\r\n         *  n * I = I\r\n         *  0 * n = 0\r\n         *  0 * 0 = 0\r\n         *  0 * N = N\r\n         *  0 * I = N\r\n         *  N * n = N\r\n         *  N * 0 = N\r\n         *  N * N = N\r\n         *  N * I = N\r\n         *  I * n = I\r\n         *  I * 0 = N\r\n         *  I * N = N\r\n         *  I * I = I\r\n         *\r\n         * Return a new BigNumber whose value is the value of this BigNumber multiplied by the value\r\n         * of BigNumber(y, b).\r\n         */\r\n        P.multipliedBy = P.times = function ( y, b ) {\r\n            var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\r\n                base, sqrtBase,\r\n                x = this,\r\n                xc = x.c,\r\n                yc = ( y = new BigNumber( y, b ) ).c;\r\n\r\n            // Either NaN, ±Infinity or ±0?\r\n            if ( !xc || !yc || !xc[0] || !yc[0] ) {\r\n\r\n                // Return NaN if either is NaN, or one is 0 and the other is Infinity.\r\n                if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) {\r\n                    y.c = y.e = y.s = null;\r\n                } else {\r\n                    y.s *= x.s;\r\n\r\n                    // Return ±Infinity if either is ±Infinity.\r\n                    if ( !xc || !yc ) {\r\n                        y.c = y.e = null;\r\n\r\n                    // Return ±0 if either is ±0.\r\n                    } else {\r\n                        y.c = [0];\r\n                        y.e = 0;\r\n                    }\r\n                }\r\n\r\n                return y;\r\n            }\r\n\r\n            e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE );\r\n            y.s *= x.s;\r\n            xcL = xc.length;\r\n            ycL = yc.length;\r\n\r\n            // Ensure xc points to longer array and xcL to its length.\r\n            if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\r\n\r\n            // Initialise the result array with zeros.\r\n            for ( i = xcL + ycL, zc = []; i--; zc.push(0) );\r\n\r\n            base = BASE;\r\n            sqrtBase = SQRT_BASE;\r\n\r\n            for ( i = ycL; --i >= 0; ) {\r\n                c = 0;\r\n                ylo = yc[i] % sqrtBase;\r\n                yhi = yc[i] / sqrtBase | 0;\r\n\r\n                for ( k = xcL, j = i + k; j > i; ) {\r\n                    xlo = xc[--k] % sqrtBase;\r\n                    xhi = xc[k] / sqrtBase | 0;\r\n                    m = yhi * xlo + xhi * ylo;\r\n                    xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c;\r\n                    c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi;\r\n                    zc[j--] = xlo % base;\r\n                }\r\n\r\n                zc[j] = c;\r\n            }\r\n\r\n            if (c) {\r\n                ++e;\r\n            } else {\r\n                zc.splice(0, 1);\r\n            }\r\n\r\n            return normalise( y, zc, e );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the value of this BigNumber negated,\r\n         * i.e. multiplied by -1.\r\n         */\r\n        P.negated = function () {\r\n            var x = new BigNumber(this);\r\n            x.s = -x.s || null;\r\n            return x;\r\n        };\r\n\r\n\r\n        /*\r\n         *  n + 0 = n\r\n         *  n + N = N\r\n         *  n + I = I\r\n         *  0 + n = n\r\n         *  0 + 0 = 0\r\n         *  0 + N = N\r\n         *  0 + I = I\r\n         *  N + n = N\r\n         *  N + 0 = N\r\n         *  N + N = N\r\n         *  N + I = N\r\n         *  I + n = I\r\n         *  I + 0 = I\r\n         *  I + N = N\r\n         *  I + I = I\r\n         *\r\n         * Return a new BigNumber whose value is the value of this BigNumber plus the value of\r\n         * BigNumber(y, b).\r\n         */\r\n        P.plus = function ( y, b ) {\r\n            var t,\r\n                x = this,\r\n                a = x.s;\r\n\r\n            y = new BigNumber( y, b );\r\n            b = y.s;\r\n\r\n            // Either NaN?\r\n            if ( !a || !b ) return new BigNumber(NaN);\r\n\r\n            // Signs differ?\r\n             if ( a != b ) {\r\n                y.s = -b;\r\n                return x.minus(y);\r\n            }\r\n\r\n            var xe = x.e / LOG_BASE,\r\n                ye = y.e / LOG_BASE,\r\n                xc = x.c,\r\n                yc = y.c;\r\n\r\n            if ( !xe || !ye ) {\r\n\r\n                // Return ±Infinity if either ±Infinity.\r\n                if ( !xc || !yc ) return new BigNumber( a / 0 );\r\n\r\n                // Either zero?\r\n                // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\r\n                if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 );\r\n            }\r\n\r\n            xe = bitFloor(xe);\r\n            ye = bitFloor(ye);\r\n            xc = xc.slice();\r\n\r\n            // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\r\n            if ( a = xe - ye ) {\r\n                if ( a > 0 ) {\r\n                    ye = xe;\r\n                    t = yc;\r\n                } else {\r\n                    a = -a;\r\n                    t = xc;\r\n                }\r\n\r\n                t.reverse();\r\n                for ( ; a--; t.push(0) );\r\n                t.reverse();\r\n            }\r\n\r\n            a = xc.length;\r\n            b = yc.length;\r\n\r\n            // Point xc to the longer array, and b to the shorter length.\r\n            if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a;\r\n\r\n            // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\r\n            for ( a = 0; b; ) {\r\n                a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0;\r\n                xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;\r\n            }\r\n\r\n            if (a) {\r\n                xc = [a].concat(xc);\r\n                ++ye;\r\n            }\r\n\r\n            // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n            // ye = MAX_EXP + 1 possible\r\n            return normalise( y, xc, ye );\r\n        };\r\n\r\n\r\n        /*\r\n         * If sd is undefined or null or true or false, return the number of significant digits of\r\n         * the value of this BigNumber, or null if the value of this BigNumber is ±Infinity or NaN.\r\n         * If sd is true include integer-part trailing zeros in the count.\r\n         *\r\n         * Otherwise, if sd is a number, return a new BigNumber whose value is the value of this\r\n         * BigNumber rounded to a maximum of sd significant digits using rounding mode rm, or\r\n         * ROUNDING_MODE if rm is omitted.\r\n         *\r\n         * sd {number|boolean} number: significant digits: integer, 1 to MAX inclusive.\r\n         *                     boolean: whether to count integer-part trailing zeros: true or false.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n         */\r\n        P.precision = P.sd = function ( sd, rm ) {\r\n            var c, n, v,\r\n                x = this;\r\n\r\n            if ( sd != null && sd !== !!sd ) {\r\n                intCheck( sd, 1, MAX );\r\n                if ( rm == null ) rm = ROUNDING_MODE;\r\n                else intCheck( rm, 0, 8 );\r\n\r\n                return round( new BigNumber(x), sd, rm );\r\n            }\r\n\r\n            if ( !( c = x.c ) ) return null;\r\n            v = c.length - 1;\r\n            n = v * LOG_BASE + 1;\r\n\r\n            if ( v = c[v] ) {\r\n\r\n                // Subtract the number of trailing zeros of the last element.\r\n                for ( ; v % 10 == 0; v /= 10, n-- );\r\n\r\n                // Add the number of digits of the first element.\r\n                for ( v = c[0]; v >= 10; v /= 10, n++ );\r\n            }\r\n\r\n            if ( sd && x.e + 1 > n ) n = x.e + 1;\r\n\r\n            return n;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\r\n         * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\r\n         *\r\n         * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'\r\n         */\r\n        P.shiftedBy = function (k) {\r\n            intCheck( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER );\r\n            return this.times( '1e' + k );\r\n        };\r\n\r\n\r\n        /*\r\n         *  sqrt(-n) =  N\r\n         *  sqrt( N) =  N\r\n         *  sqrt(-I) =  N\r\n         *  sqrt( I) =  I\r\n         *  sqrt( 0) =  0\r\n         *  sqrt(-0) = -0\r\n         *\r\n         * Return a new BigNumber whose value is the square root of the value of this BigNumber,\r\n         * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\r\n         */\r\n        P.squareRoot = P.sqrt = function () {\r\n            var m, n, r, rep, t,\r\n                x = this,\r\n                c = x.c,\r\n                s = x.s,\r\n                e = x.e,\r\n                dp = DECIMAL_PLACES + 4,\r\n                half = new BigNumber('0.5');\r\n\r\n            // Negative/NaN/Infinity/zero?\r\n            if ( s !== 1 || !c || !c[0] ) {\r\n                return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 );\r\n            }\r\n\r\n            // Initial estimate.\r\n            s = Math.sqrt( +x );\r\n\r\n            // Math.sqrt underflow/overflow?\r\n            // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\r\n            if ( s == 0 || s == 1 / 0 ) {\r\n                n = coeffToString(c);\r\n                if ( ( n.length + e ) % 2 == 0 ) n += '0';\r\n                s = Math.sqrt(n);\r\n                e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 );\r\n\r\n                if ( s == 1 / 0 ) {\r\n                    n = '1e' + e;\r\n                } else {\r\n                    n = s.toExponential();\r\n                    n = n.slice( 0, n.indexOf('e') + 1 ) + e;\r\n                }\r\n\r\n                r = new BigNumber(n);\r\n            } else {\r\n                r = new BigNumber( s + '' );\r\n            }\r\n\r\n            // Check for zero.\r\n            // r could be zero if MIN_EXP is changed after the this value was created.\r\n            // This would cause a division by zero (x/t) and hence Infinity below, which would cause\r\n            // coeffToString to throw.\r\n            if ( r.c[0] ) {\r\n                e = r.e;\r\n                s = e + dp;\r\n                if ( s < 3 ) s = 0;\r\n\r\n                // Newton-Raphson iteration.\r\n                for ( ; ; ) {\r\n                    t = r;\r\n                    r = half.times( t.plus( div( x, t, dp, 1 ) ) );\r\n\r\n                    if ( coeffToString( t.c   ).slice( 0, s ) === ( n =\r\n                         coeffToString( r.c ) ).slice( 0, s ) ) {\r\n\r\n                        // The exponent of r may here be one less than the final result exponent,\r\n                        // e.g 0.0009999 (e-4) --\x3e 0.001 (e-3), so adjust s so the rounding digits\r\n                        // are indexed correctly.\r\n                        if ( r.e < e ) --s;\r\n                        n = n.slice( s - 3, s + 1 );\r\n\r\n                        // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\r\n                        // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\r\n                        // iteration.\r\n                        if ( n == '9999' || !rep && n == '4999' ) {\r\n\r\n                            // On the first iteration only, check to see if rounding up gives the\r\n                            // exact result as the nines may infinitely repeat.\r\n                            if ( !rep ) {\r\n                                round( t, t.e + DECIMAL_PLACES + 2, 0 );\r\n\r\n                                if ( t.times(t).eq(x) ) {\r\n                                    r = t;\r\n                                    break;\r\n                                }\r\n                            }\r\n\r\n                            dp += 4;\r\n                            s += 4;\r\n                            rep = 1;\r\n                        } else {\r\n\r\n                            // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\r\n                            // result. If not, then there are further digits and m will be truthy.\r\n                            if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) {\r\n\r\n                                // Truncate to the first rounding digit.\r\n                                round( r, r.e + DECIMAL_PLACES + 2, 1 );\r\n                                m = !r.times(r).eq(x);\r\n                            }\r\n\r\n                            break;\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of this BigNumber in exponential notation and\r\n         * rounded using ROUNDING_MODE to dp fixed decimal places.\r\n         *\r\n         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n         */\r\n        P.toExponential = function ( dp, rm ) {\r\n            if ( dp != null ) {\r\n                intCheck( dp, 0, MAX );\r\n                dp++;\r\n            }\r\n            return format( this, dp, rm, 1 );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of this BigNumber in fixed-point notation rounding\r\n         * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\r\n         *\r\n         * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\r\n         * but e.g. (-0.00001).toFixed(0) is '-0'.\r\n         *\r\n         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n         */\r\n        P.toFixed = function ( dp, rm ) {\r\n            if ( dp != null ) {\r\n                intCheck( dp, 0, MAX );\r\n                dp = dp + this.e + 1;\r\n            }\r\n            return format( this, dp, rm );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of this BigNumber in fixed-point notation rounded\r\n         * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\r\n         * of the FORMAT object (see BigNumber.set).\r\n         *\r\n         * FORMAT = {\r\n         *      decimalSeparator : '.',\r\n         *      groupSeparator : ',',\r\n         *      groupSize : 3,\r\n         *      secondaryGroupSize : 0,\r\n         *      fractionGroupSeparator : '\\xA0',    // non-breaking space\r\n         *      fractionGroupSize : 0\r\n         * };\r\n         *\r\n         * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {dp|rm}'\r\n         */\r\n        P.toFormat = function ( dp, rm ) {\r\n            var str = this.toFixed( dp, rm );\r\n\r\n            if ( this.c ) {\r\n                var i,\r\n                    arr = str.split('.'),\r\n                    g1 = +FORMAT.groupSize,\r\n                    g2 = +FORMAT.secondaryGroupSize,\r\n                    groupSeparator = FORMAT.groupSeparator,\r\n                    intPart = arr[0],\r\n                    fractionPart = arr[1],\r\n                    isNeg = this.s < 0,\r\n                    intDigits = isNeg ? intPart.slice(1) : intPart,\r\n                    len = intDigits.length;\r\n\r\n                if (g2) i = g1, g1 = g2, g2 = i, len -= i;\r\n\r\n                if ( g1 > 0 && len > 0 ) {\r\n                    i = len % g1 || g1;\r\n                    intPart = intDigits.substr( 0, i );\r\n\r\n                    for ( ; i < len; i += g1 ) {\r\n                        intPart += groupSeparator + intDigits.substr( i, g1 );\r\n                    }\r\n\r\n                    if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i);\r\n                    if (isNeg) intPart = '-' + intPart;\r\n                }\r\n\r\n                str = fractionPart\r\n                  ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize )\r\n                    ? fractionPart.replace( new RegExp( '\\\\d{' + g2 + '}\\\\B', 'g' ),\r\n                      '$&' + FORMAT.fractionGroupSeparator )\r\n                    : fractionPart )\r\n                  : intPart;\r\n            }\r\n\r\n            return str;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string array representing the value of this BigNumber as a simple fraction with\r\n         * an integer numerator and an integer denominator. The denominator will be a positive\r\n         * non-zero value less than or equal to the specified maximum denominator. If a maximum\r\n         * denominator is not specified, the denominator will be the lowest value necessary to\r\n         * represent the number exactly.\r\n         *\r\n         * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator.\r\n         *\r\n         * '[BigNumber Error] Argument {not an integer|out of range} : {md}'\r\n         */\r\n        P.toFraction = function (md) {\r\n            var arr, d, d0, d1, d2, e, exp, n, n0, n1, q, s,\r\n                x = this,\r\n                xc = x.c;\r\n\r\n            if ( md != null ) {\r\n                n = new BigNumber(md);\r\n\r\n                if ( !n.isInteger() || n.lt(ONE) ) {\r\n                    throw Error\r\n                      ( bignumberError + 'Argument ' +\r\n                        ( n.isInteger() ? 'out of range: ' : 'not an integer: ' ) + md );\r\n                }\r\n            }\r\n\r\n            if ( !xc ) return x.toString();\r\n\r\n            d = new BigNumber(ONE);\r\n            n1 = d0 = new BigNumber(ONE);\r\n            d1 = n0 = new BigNumber(ONE);\r\n            s = coeffToString(xc);\r\n\r\n            // Determine initial denominator.\r\n            // d is a power of 10 and the minimum max denominator that specifies the value exactly.\r\n            e = d.e = s.length - x.e - 1;\r\n            d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ];\r\n            md = !md || n.comparedTo(d) > 0 ? ( e > 0 ? d : n1 ) : n;\r\n\r\n            exp = MAX_EXP;\r\n            MAX_EXP = 1 / 0;\r\n            n = new BigNumber(s);\r\n\r\n            // n0 = d1 = 0\r\n            n0.c[0] = 0;\r\n\r\n            for ( ; ; )  {\r\n                q = div( n, d, 0, 1 );\r\n                d2 = d0.plus( q.times(d1) );\r\n                if ( d2.comparedTo(md) == 1 ) break;\r\n                d0 = d1;\r\n                d1 = d2;\r\n                n1 = n0.plus( q.times( d2 = n1 ) );\r\n                n0 = d2;\r\n                d = n.minus( q.times( d2 = d ) );\r\n                n = d2;\r\n            }\r\n\r\n            d2 = div( md.minus(d0), d1, 0, 1 );\r\n            n0 = n0.plus( d2.times(n1) );\r\n            d0 = d0.plus( d2.times(d1) );\r\n            n0.s = n1.s = x.s;\r\n            e *= 2;\r\n\r\n            // Determine which fraction is closer to x, n0/d0 or n1/d1\r\n            arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().comparedTo(\r\n                  div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1\r\n                    ? [ n1.toString(), d1.toString() ]\r\n                    : [ n0.toString(), d0.toString() ];\r\n\r\n            MAX_EXP = exp;\r\n            return arr;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return the value of this BigNumber converted to a number primitive.\r\n         */\r\n        P.toNumber = function () {\r\n            return +this;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a BigNumber whose value is the value of this BigNumber exponentiated by n.\r\n         *\r\n         * If m is present, return the result modulo m.\r\n         * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\r\n         * If POW_PRECISION is non-zero and m is not present, round to POW_PRECISION using ROUNDING_MODE.\r\n         *\r\n         * The modular power operation works efficiently when x, n, and m are positive integers,\r\n         * otherwise it is equivalent to calculating x.exponentiatedBy(n).modulo(m) with a POW_PRECISION of 0.\r\n         *\r\n         * n {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\r\n         * [m] {number|string|BigNumber} The modulus.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {n}'\r\n         *\r\n         * Performs 54 loop iterations for n of 9007199254740991.\r\n         */\r\n        P.exponentiatedBy = P.pow = function ( n, m ) {\r\n            var i, k, y, z,\r\n                x = this;\r\n\r\n            intCheck( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER );\r\n            if ( m != null ) m = new BigNumber(m);\r\n\r\n            if (m) {\r\n                if ( n > 1 && x.gt(ONE) && x.isInteger() && m.gt(ONE) && m.isInteger() ) {\r\n                    x = x.mod(m);\r\n                } else {\r\n                    z = m;\r\n\r\n                    // Nullify m so only a single mod operation is performed at the end.\r\n                    m = null;\r\n                }\r\n            } else if (POW_PRECISION) {\r\n\r\n                // Truncating each coefficient array to a length of k after each multiplication\r\n                // equates to truncating significant digits to POW_PRECISION + [28, 41],\r\n                // i.e. there will be a minimum of 28 guard digits retained.\r\n                //k = mathceil( POW_PRECISION / LOG_BASE + 1.5 );   // gives [9, 21] guard digits.\r\n                k = mathceil( POW_PRECISION / LOG_BASE + 2 );\r\n            }\r\n\r\n            y = new BigNumber(ONE);\r\n\r\n            for ( i = mathfloor( n < 0 ? -n : n ); ; ) {\r\n                if ( i % 2 ) {\r\n                    y = y.times(x);\r\n                    if ( !y.c ) break;\r\n                    if (k) {\r\n                        if ( y.c.length > k ) y.c.length = k;\r\n                    } else if (m) {\r\n                        y = y.mod(m);\r\n                    }\r\n                }\r\n\r\n                i = mathfloor( i / 2 );\r\n                if ( !i ) break;\r\n                x = x.times(x);\r\n                if (k) {\r\n                    if ( x.c && x.c.length > k ) x.c.length = k;\r\n                } else if (m) {\r\n                    x = x.mod(m);\r\n                }\r\n            }\r\n\r\n            if (m) return y;\r\n            if ( n < 0 ) y = ONE.div(y);\r\n\r\n            return z ? y.mod(z) : k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of this BigNumber rounded to sd significant digits\r\n         * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\r\n         * necessary to represent the integer part of the value in fixed-point notation, then use\r\n         * exponential notation.\r\n         *\r\n         * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\r\n         * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\r\n         *\r\n         * '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {sd|rm}'\r\n         */\r\n        P.toPrecision = function ( sd, rm ) {\r\n            if ( sd != null ) intCheck( sd, 1, MAX );\r\n            return format( this, sd, rm, 2 );\r\n        };\r\n\r\n\r\n        /*\r\n         * Return a string representing the value of this BigNumber in base b, or base 10 if b is\r\n         * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\r\n         * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\r\n         * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\r\n         * TO_EXP_NEG, return exponential notation.\r\n         *\r\n         * [b] {number} Integer, 2 to ALPHABET.length inclusive.\r\n         *\r\n         * '[BigNumber Error] Base {not a primitive number|not an integer|out of range}: {b}'\r\n         */\r\n        P.toString = function (b) {\r\n            var str,\r\n                n = this,\r\n                s = n.s,\r\n                e = n.e;\r\n\r\n            // Infinity or NaN?\r\n            if ( e === null ) {\r\n\r\n                if (s) {\r\n                    str = 'Infinity';\r\n                    if ( s < 0 ) str = '-' + str;\r\n                } else {\r\n                    str = 'NaN';\r\n                }\r\n            } else {\r\n                str = coeffToString( n.c );\r\n\r\n                if ( b == null ) {\r\n                    str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n                      ? toExponential( str, e )\r\n                      : toFixedPoint( str, e, '0' );\r\n                } else {\r\n                    intCheck( b, 2, ALPHABET.length, 'Base' );\r\n                    str = convertBase( toFixedPoint( str, e, '0' ), 10, b, s, true );\r\n                }\r\n\r\n                if ( s < 0 && n.c[0] ) str = '-' + str;\r\n            }\r\n\r\n            return str;\r\n        };\r\n\r\n\r\n        /*\r\n         * Return as toString, but do not accept a base argument, and include the minus sign for\r\n         * negative zero.\r\n         */\r\n        P.valueOf = P.toJSON = function () {\r\n            var str,\r\n                n = this,\r\n                e = n.e;\r\n\r\n            if ( e === null ) return n.toString();\r\n\r\n            str = coeffToString( n.c );\r\n\r\n            str = e <= TO_EXP_NEG || e >= TO_EXP_POS\r\n                ? toExponential( str, e )\r\n                : toFixedPoint( str, e, '0' );\r\n\r\n            return n.s < 0 ? '-' + str : str;\r\n        };\r\n\r\n\r\n        P._isBigNumber = true;\r\n\r\n        if ( configObject != null ) BigNumber.set(configObject);\r\n\r\n        return BigNumber;\r\n    }\r\n\r\n\r\n    // PRIVATE HELPER FUNCTIONS\r\n\r\n\r\n    function bitFloor(n) {\r\n        var i = n | 0;\r\n        return n > 0 || n === i ? i : i - 1;\r\n    }\r\n\r\n\r\n    // Return a coefficient array as a string of base 10 digits.\r\n    function coeffToString(a) {\r\n        var s, z,\r\n            i = 1,\r\n            j = a.length,\r\n            r = a[0] + '';\r\n\r\n        for ( ; i < j; ) {\r\n            s = a[i++] + '';\r\n            z = LOG_BASE - s.length;\r\n            for ( ; z--; s = '0' + s );\r\n            r += s;\r\n        }\r\n\r\n        // Determine trailing zeros.\r\n        for ( j = r.length; r.charCodeAt(--j) === 48; );\r\n        return r.slice( 0, j + 1 || 1 );\r\n    }\r\n\r\n\r\n    // Compare the value of BigNumbers x and y.\r\n    function compare( x, y ) {\r\n        var a, b,\r\n            xc = x.c,\r\n            yc = y.c,\r\n            i = x.s,\r\n            j = y.s,\r\n            k = x.e,\r\n            l = y.e;\r\n\r\n        // Either NaN?\r\n        if ( !i || !j ) return null;\r\n\r\n        a = xc && !xc[0];\r\n        b = yc && !yc[0];\r\n\r\n        // Either zero?\r\n        if ( a || b ) return a ? b ? 0 : -j : i;\r\n\r\n        // Signs differ?\r\n        if ( i != j ) return i;\r\n\r\n        a = i < 0;\r\n        b = k == l;\r\n\r\n        // Either Infinity?\r\n        if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1;\r\n\r\n        // Compare exponents.\r\n        if ( !b ) return k > l ^ a ? 1 : -1;\r\n\r\n        j = ( k = xc.length ) < ( l = yc.length ) ? k : l;\r\n\r\n        // Compare digit by digit.\r\n        for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1;\r\n\r\n        // Compare lengths.\r\n        return k == l ? 0 : k > l ^ a ? 1 : -1;\r\n    }\r\n\r\n\r\n    /*\r\n     * Check that n is a primitive number, an integer, and in range, otherwise throw.\r\n     */\r\n    function intCheck( n, min, max, name ) {\r\n        if ( n < min || n > max || n !== ( n < 0 ? mathceil(n) : mathfloor(n) ) ) {\r\n            throw Error\r\n              ( bignumberError + ( name || 'Argument' ) + ( typeof n == 'number'\r\n                  ? n < min || n > max ? ' out of range: ' : ' not an integer: '\r\n                  : ' not a primitive number: ' ) + n );\r\n        }\r\n    }\r\n\r\n\r\n    function isArray(obj) {\r\n        return Object.prototype.toString.call(obj) == '[object Array]';\r\n    }\r\n\r\n\r\n    function toExponential( str, e ) {\r\n        return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) +\r\n          ( e < 0 ? 'e' : 'e+' ) + e;\r\n    }\r\n\r\n\r\n    function toFixedPoint( str, e, z ) {\r\n        var len, zs;\r\n\r\n        // Negative exponent?\r\n        if ( e < 0 ) {\r\n\r\n            // Prepend zeros.\r\n            for ( zs = z + '.'; ++e; zs += z );\r\n            str = zs + str;\r\n\r\n        // Positive exponent\r\n        } else {\r\n            len = str.length;\r\n\r\n            // Append zeros.\r\n            if ( ++e > len ) {\r\n                for ( zs = z, e -= len; --e; zs += z );\r\n                str += zs;\r\n            } else if ( e < len ) {\r\n                str = str.slice( 0, e ) + '.' + str.slice(e);\r\n            }\r\n        }\r\n\r\n        return str;\r\n    }\r\n\r\n\r\n    // EXPORT\r\n\r\n\r\n    BigNumber = clone();\r\n    BigNumber['default'] = BigNumber.BigNumber = BigNumber;\r\n\r\n\r\n    // AMD.\r\n    if ( true ) {\r\n        !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return BigNumber; }.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\r\n    // Node.js and other environments that support module.exports.\r\n    } else if ( typeof module != 'undefined' && module.exports ) {\r\n        module.exports = BigNumber;\r\n\r\n    // Browser.\r\n    } else {\r\n        if ( !globalObject ) {\r\n            globalObject = typeof self != 'undefined' ? self : Function('return this')();\r\n        }\r\n\r\n        globalObject.BigNumber = BigNumber;\r\n    }\r\n})(this);\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bignumber.js/bignumber.js\n// module id = 165\n// module chunks = 0\n\n//# sourceURL=../node_modules/bignumber.js/bignumber.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Bignumber = __webpack_require__(165)\n\nexports.MT = {\n  POS_INT: 0,\n  NEG_INT: 1,\n  BYTE_STRING: 2,\n  UTF8_STRING: 3,\n  ARRAY: 4,\n  MAP: 5,\n  TAG: 6,\n  SIMPLE_FLOAT: 7\n}\n\nexports.TAG = {\n  DATE_STRING: 0,\n  DATE_EPOCH: 1,\n  POS_BIGINT: 2,\n  NEG_BIGINT: 3,\n  DECIMAL_FRAC: 4,\n  BIGFLOAT: 5,\n  BASE64URL_EXPECTED: 21,\n  BASE64_EXPECTED: 22,\n  BASE16_EXPECTED: 23,\n  CBOR: 24,\n  URI: 32,\n  BASE64URL: 33,\n  BASE64: 34,\n  REGEXP: 35,\n  MIME: 36\n}\n\nexports.NUMBYTES = {\n  ZERO: 0,\n  ONE: 24,\n  TWO: 25,\n  FOUR: 26,\n  EIGHT: 27,\n  INDEFINITE: 31\n}\n\nexports.SIMPLE = {\n  FALSE: 20,\n  TRUE: 21,\n  NULL: 22,\n  UNDEFINED: 23\n}\n\nexports.SYMS = {\n  NULL: Symbol('null'),\n  UNDEFINED: Symbol('undef'),\n  PARENT: Symbol('parent'),\n  BREAK: Symbol('break'),\n  STREAM: Symbol('stream')\n}\n\nexports.SHIFT32 = Math.pow(2, 32)\nexports.SHIFT16 = Math.pow(2, 16)\n\nexports.MAX_SAFE_HIGH = 0x1fffff\nexports.NEG_ONE = new Bignumber(-1)\nexports.TEN = new Bignumber(10)\nexports.TWO = new Bignumber(2)\n\nexports.PARENT = {\n  ARRAY: 0,\n  OBJECT: 1,\n  MAP: 2,\n  TAG: 3,\n  BYTE_STRING: 4,\n  UTF8_STRING: 5\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/constants.js\n// module id = 166\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/constants.js")},function(module,exports,__webpack_require__){eval("// based on the aes implimentation in triple sec\n// https://github.com/keybase/triplesec\n// which is in turn based on the one from crypto-js\n// https://code.google.com/p/crypto-js/\n\nvar Buffer = __webpack_require__(1).Buffer\n\nfunction asUInt32Array (buf) {\n  if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n\n  var len = (buf.length / 4) | 0\n  var out = new Array(len)\n\n  for (var i = 0; i < len; i++) {\n    out[i] = buf.readUInt32BE(i * 4)\n  }\n\n  return out\n}\n\nfunction scrubVec (v) {\n  for (var i = 0; i < v.length; v++) {\n    v[i] = 0\n  }\n}\n\nfunction cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {\n  var SUB_MIX0 = SUB_MIX[0]\n  var SUB_MIX1 = SUB_MIX[1]\n  var SUB_MIX2 = SUB_MIX[2]\n  var SUB_MIX3 = SUB_MIX[3]\n\n  var s0 = M[0] ^ keySchedule[0]\n  var s1 = M[1] ^ keySchedule[1]\n  var s2 = M[2] ^ keySchedule[2]\n  var s3 = M[3] ^ keySchedule[3]\n  var t0, t1, t2, t3\n  var ksRow = 4\n\n  for (var round = 1; round < nRounds; round++) {\n    t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]\n    t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]\n    t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]\n    t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]\n    s0 = t0\n    s1 = t1\n    s2 = t2\n    s3 = t3\n  }\n\n  t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]\n  t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]\n  t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]\n  t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]\n  t0 = t0 >>> 0\n  t1 = t1 >>> 0\n  t2 = t2 >>> 0\n  t3 = t3 >>> 0\n\n  return [t0, t1, t2, t3]\n}\n\n// AES constants\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]\nvar G = (function () {\n  // Compute double table\n  var d = new Array(256)\n  for (var j = 0; j < 256; j++) {\n    if (j < 128) {\n      d[j] = j << 1\n    } else {\n      d[j] = (j << 1) ^ 0x11b\n    }\n  }\n\n  var SBOX = []\n  var INV_SBOX = []\n  var SUB_MIX = [[], [], [], []]\n  var INV_SUB_MIX = [[], [], [], []]\n\n  // Walk GF(2^8)\n  var x = 0\n  var xi = 0\n  for (var i = 0; i < 256; ++i) {\n    // Compute sbox\n    var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)\n    sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63\n    SBOX[x] = sx\n    INV_SBOX[sx] = x\n\n    // Compute multiplication\n    var x2 = d[x]\n    var x4 = d[x2]\n    var x8 = d[x4]\n\n    // Compute sub bytes, mix columns tables\n    var t = (d[sx] * 0x101) ^ (sx * 0x1010100)\n    SUB_MIX[0][x] = (t << 24) | (t >>> 8)\n    SUB_MIX[1][x] = (t << 16) | (t >>> 16)\n    SUB_MIX[2][x] = (t << 8) | (t >>> 24)\n    SUB_MIX[3][x] = t\n\n    // Compute inv sub bytes, inv mix columns tables\n    t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)\n    INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)\n    INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)\n    INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)\n    INV_SUB_MIX[3][sx] = t\n\n    if (x === 0) {\n      x = xi = 1\n    } else {\n      x = x2 ^ d[d[d[x8 ^ x2]]]\n      xi ^= d[d[xi]]\n    }\n  }\n\n  return {\n    SBOX: SBOX,\n    INV_SBOX: INV_SBOX,\n    SUB_MIX: SUB_MIX,\n    INV_SUB_MIX: INV_SUB_MIX\n  }\n})()\n\nfunction AES (key) {\n  this._key = asUInt32Array(key)\n  this._reset()\n}\n\nAES.blockSize = 4 * 4\nAES.keySize = 256 / 8\nAES.prototype.blockSize = AES.blockSize\nAES.prototype.keySize = AES.keySize\nAES.prototype._reset = function () {\n  var keyWords = this._key\n  var keySize = keyWords.length\n  var nRounds = keySize + 6\n  var ksRows = (nRounds + 1) * 4\n\n  var keySchedule = []\n  for (var k = 0; k < keySize; k++) {\n    keySchedule[k] = keyWords[k]\n  }\n\n  for (k = keySize; k < ksRows; k++) {\n    var t = keySchedule[k - 1]\n\n    if (k % keySize === 0) {\n      t = (t << 8) | (t >>> 24)\n      t =\n        (G.SBOX[t >>> 24] << 24) |\n        (G.SBOX[(t >>> 16) & 0xff] << 16) |\n        (G.SBOX[(t >>> 8) & 0xff] << 8) |\n        (G.SBOX[t & 0xff])\n\n      t ^= RCON[(k / keySize) | 0] << 24\n    } else if (keySize > 6 && k % keySize === 4) {\n      t =\n        (G.SBOX[t >>> 24] << 24) |\n        (G.SBOX[(t >>> 16) & 0xff] << 16) |\n        (G.SBOX[(t >>> 8) & 0xff] << 8) |\n        (G.SBOX[t & 0xff])\n    }\n\n    keySchedule[k] = keySchedule[k - keySize] ^ t\n  }\n\n  var invKeySchedule = []\n  for (var ik = 0; ik < ksRows; ik++) {\n    var ksR = ksRows - ik\n    var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]\n\n    if (ik < 4 || ksR <= 4) {\n      invKeySchedule[ik] = tt\n    } else {\n      invKeySchedule[ik] =\n        G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^\n        G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^\n        G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^\n        G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]\n    }\n  }\n\n  this._nRounds = nRounds\n  this._keySchedule = keySchedule\n  this._invKeySchedule = invKeySchedule\n}\n\nAES.prototype.encryptBlockRaw = function (M) {\n  M = asUInt32Array(M)\n  return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)\n}\n\nAES.prototype.encryptBlock = function (M) {\n  var out = this.encryptBlockRaw(M)\n  var buf = Buffer.allocUnsafe(16)\n  buf.writeUInt32BE(out[0], 0)\n  buf.writeUInt32BE(out[1], 4)\n  buf.writeUInt32BE(out[2], 8)\n  buf.writeUInt32BE(out[3], 12)\n  return buf\n}\n\nAES.prototype.decryptBlock = function (M) {\n  M = asUInt32Array(M)\n\n  // swap\n  var m1 = M[1]\n  M[1] = M[3]\n  M[3] = m1\n\n  var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)\n  var buf = Buffer.allocUnsafe(16)\n  buf.writeUInt32BE(out[0], 0)\n  buf.writeUInt32BE(out[3], 4)\n  buf.writeUInt32BE(out[2], 8)\n  buf.writeUInt32BE(out[1], 12)\n  return buf\n}\n\nAES.prototype.scrub = function () {\n  scrubVec(this._keySchedule)\n  scrubVec(this._invKeySchedule)\n  scrubVec(this._key)\n}\n\nmodule.exports.AES = AES\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/aes.js\n// module id = 167\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/aes.js")},function(module,exports,__webpack_require__){eval("var ciphers = __webpack_require__(655)\nvar deciphers = __webpack_require__(654)\nvar modes = __webpack_require__(354)\n\nfunction getCiphers () {\n  return Object.keys(modes)\n}\n\nexports.createCipher = exports.Cipher = ciphers.createCipher\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv\nexports.createDecipher = exports.Decipher = deciphers.createDecipher\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv\nexports.listCiphers = exports.getCiphers = getCiphers\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/browser.js\n// module id = 168\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/browser.js")},function(module,exports){eval("\nmodule.exports = function(a, b){\n  var fn = function(){};\n  fn.prototype = b.prototype;\n  a.prototype = new fn;\n  a.prototype.constructor = a;\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-inherit/index.js\n// module id = 169\n// module chunks = 0\n\n//# sourceURL=../node_modules/component-inherit/index.js")},function(module,exports){eval("module.exports = function (it) {\n  if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n  return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_a-function.js\n// module id = 170\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_a-function.js")},function(module,exports){eval("module.exports = true;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_library.js\n// module id = 171\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_library.js")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-pie.js\n// module id = 172\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-pie.js")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(70).f;\nvar has = __webpack_require__(89);\nvar TAG = __webpack_require__(38)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_set-to-string-tag.js\n// module id = 173\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_set-to-string-tag.js")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(241);\nmodule.exports = function (it) {\n  return Object(defined(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-object.js\n// module id = 174\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-object.js")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_uid.js\n// module id = 175\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_uid.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(707);\nvar global = __webpack_require__(42);\nvar hide = __webpack_require__(90);\nvar Iterators = __webpack_require__(117);\nvar TO_STRING_TAG = __webpack_require__(38)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n  'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n  'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n  'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n  'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n  var NAME = DOMIterables[i];\n  var Collection = global[NAME];\n  var proto = Collection && Collection.prototype;\n  if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n  Iterators[NAME] = Iterators.Array;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/web.dom.iterable.js\n// module id = 176\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/web.dom.iterable.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst pull = __webpack_require__(6)\n\n/* ::\nimport type {Key, Datastore, Batch, Query, QueryResult, Callback} from 'interface-datastore'\n*/\n\n/**\n * An object with a pair of functions for (invertibly) transforming keys\n */\n/* ::\ntype KeyTransform = {\n  convert: KeyMapping,\n  invert: KeyMapping\n}\n*/\n\n/**\n * Map one key onto another key.\n */\n/* ::\ntype KeyMapping = (Key) => Key\n*/\n\n/**\n * A datastore shim, that wraps around a given datastore, changing\n * the way keys look to the user, for example namespacing\n * keys, reversing them, etc.\n */\nclass KeyTransformDatastore /* :: <Value> */ {\n  /* :: child: Datastore<Value> */\n  /* :: transform: KeyTransform */\n\n  constructor (child /* : Datastore<Value> */, transform /* : KeyTransform */) {\n    this.child = child\n    this.transform = transform\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    this.child.open(callback)\n  }\n\n  put (key /* : Key */, val /* : Value */, callback /* : Callback<void> */) /* : void */ {\n    this.child.put(this.transform.convert(key), val, callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Value> */) /* : void */ {\n    this.child.get(this.transform.convert(key), callback)\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    this.child.has(this.transform.convert(key), callback)\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    this.child.delete(this.transform.convert(key), callback)\n  }\n\n  batch () /* : Batch<Value> */ {\n    const b = this.child.batch()\n    return {\n      put: (key /* : Key */, value /* : Value */) /* : void */ => {\n        b.put(this.transform.convert(key), value)\n      },\n      delete: (key /* : Key */) /* : void */ => {\n        b.delete(this.transform.convert(key))\n      },\n      commit: (callback /* : Callback<void> */) /* : void */ => {\n        b.commit(callback)\n      }\n    }\n  }\n\n  query (q /* : Query<Value> */) /* : QueryResult<Value> */ {\n    return pull(\n      this.child.query(q),\n      pull.map(e => {\n        e.key = this.transform.invert(e.key)\n        return e\n      })\n    )\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    this.child.close(callback)\n  }\n}\n\nmodule.exports = KeyTransformDatastore\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/keytransform.js\n// module id = 177\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/keytransform.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* @flow */\n\n\n/* :: import type {Callback, Batch, Query, QueryResult, QueryEntry} from 'interface-datastore' */\n\nconst pull = __webpack_require__(6)\nconst levelup = __webpack_require__(974)\n\nconst asyncFilter = __webpack_require__(40).utils.asyncFilter\nconst asyncSort = __webpack_require__(40).utils.asyncSort\nconst Key = __webpack_require__(40).Key\n\n/**\n * A datastore backed by leveldb.\n */\n/* :: export type LevelOptions = {\n  createIfMissing?: bool,\n  errorIfExists?: bool,\n  compression?: bool,\n  cacheSize?: number,\n  db?: Object\n} */\nclass LevelDatastore {\n  /* :: db: levelup */\n\n  constructor (path /* : string */, opts /* : ?LevelOptions */) {\n    this.db = levelup(path, Object.assign({}, opts, {\n      compression: false, // same default as go\n      valueEncoding: 'binary'\n    }))\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    this.db.open(callback)\n  }\n\n  put (key /* : Key */, value /* : Buffer */, callback /* : Callback<void> */) /* : void */ {\n    this.db.put(key.toString(), value, callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Buffer> */) /* : void */ {\n    this.db.get(key.toString(), callback)\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    this.db.get(key.toString(), (err, res) => {\n      if (err) {\n        if (err.notFound) {\n          callback(null, false)\n          return\n        }\n        callback(err)\n        return\n      }\n\n      callback(null, true)\n    })\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    this.db.del(key.toString(), callback)\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    this.db.close(callback)\n  }\n\n  batch () /* : Batch<Buffer> */ {\n    const ops = []\n    return {\n      put: (key /* : Key */, value /* : Buffer */) /* : void */ => {\n        ops.push({\n          type: 'put',\n          key: key.toString(),\n          value: value\n        })\n      },\n      delete: (key /* : Key */) /* : void */ => {\n        ops.push({\n          type: 'del',\n          key: key.toString()\n        })\n      },\n      commit: (callback /* : Callback<void> */) /* : void */ => {\n        this.db.batch(ops, callback)\n      }\n    }\n  }\n\n  query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ {\n    let values = true\n    if (q.keysOnly != null) {\n      values = !q.keysOnly\n    }\n\n    const iter = this.db.db.iterator({\n      keys: true,\n      values: values,\n      keyAsBuffer: true\n    })\n\n    const rawStream = (end, cb) => {\n      if (end) {\n        return iter.end((err) => {\n          cb(err || end)\n        })\n      }\n\n      iter.next((err, key, value) => {\n        if (err) {\n          return cb(err)\n        }\n\n        if (err == null && key == null && value == null) {\n          return iter.end((err) => {\n            cb(err || true)\n          })\n        }\n\n        const res /* : QueryEntry<Buffer> */ = {\n          key: new Key(key, false)\n        }\n\n        if (values) {\n          res.value = Buffer.from(value)\n        }\n\n        cb(null, res)\n      })\n    }\n\n    let tasks = [rawStream]\n    let filters = []\n\n    if (q.prefix != null) {\n      const prefix = q.prefix\n      filters.push((e, cb) => cb(null, e.key.toString().startsWith(prefix)))\n    }\n\n    if (q.filters != null) {\n      filters = filters.concat(q.filters)\n    }\n\n    tasks = tasks.concat(filters.map(f => asyncFilter(f)))\n\n    if (q.orders != null) {\n      tasks = tasks.concat(q.orders.map(o => asyncSort(o)))\n    }\n\n    if (q.offset != null) {\n      let i = 0\n      tasks.push(pull.filter(() => i++ >= q.offset))\n    }\n\n    if (q.limit != null) {\n      tasks.push(pull.take(q.limit))\n    }\n\n    return pull.apply(null, tasks)\n  }\n}\n\nmodule.exports = LevelDatastore\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-level/src/index.js\n// module id = 178\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-level/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar Subscription = __webpack_require__(775);\n\n\nvar Subscriptions = function Subscriptions(options) {\n    this.name = options.name;\n    this.type = options.type;\n    this.subscriptions = options.subscriptions || {};\n    this.requestManager = null;\n};\n\n\nSubscriptions.prototype.setRequestManager = function (rm) {\n    this.requestManager = rm;\n};\n\n\nSubscriptions.prototype.attachToObject = function (obj) {\n    var func = this.buildCall();\n    func.call = this.call;\n    var name = this.name.split('.');\n    if (name.length > 1) {\n        obj[name[0]] = obj[name[0]] || {};\n        obj[name[0]][name[1]] = func;\n    } else {\n        obj[name[0]] = func;\n    }\n};\n\n\nSubscriptions.prototype.buildCall = function() {\n    var _this = this;\n\n    return function(){\n        if(!_this.subscriptions[arguments[0]]) {\n            console.warn('Subscription '+ JSON.stringify(arguments[0]) +' doesn\\'t exist. Subscribing anyway.');\n        }\n\n        var subscription = new Subscription({\n            subscription: _this.subscriptions[arguments[0]],\n            requestManager: _this.requestManager,\n            type: _this.type\n        });\n\n        return subscription.subscribe.apply(subscription, arguments);\n    };\n};\n\n\nmodule.exports = {\n    subscriptions: Subscriptions,\n    subscription: Subscription\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-subscriptions/src/index.js\n// module id = 179\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-subscriptions/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(93);\nvar Method = __webpack_require__(92);\nvar utils = __webpack_require__(48);\n\n\nvar Net = function () {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n\n    [\n        new Method({\n            name: 'getId',\n            call: 'net_version',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'isListening',\n            call: 'net_listening',\n            params: 0\n        }),\n        new Method({\n            name: 'getPeerCount',\n            call: 'net_peerCount',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        })\n    ].forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n    });\n\n};\n\ncore.addProviders(Net);\n\n\nmodule.exports = Net;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-net/src/index.js\n// module id = 180\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-net/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = exports;\n\ncurve.base = __webpack_require__(820);\ncurve.short = __webpack_require__(823);\ncurve.mont = __webpack_require__(822);\ncurve.edwards = __webpack_require__(821);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curve/index.js\n// module id = 181\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar createKeccakHash = __webpack_require__(959);\nvar secp256k1 = __webpack_require__(1222);\nvar assert = __webpack_require__(16);\nvar rlp = __webpack_require__(155);\nvar BN = __webpack_require__(17);\nvar createHash = __webpack_require__(59);\nvar Buffer = __webpack_require__(1).Buffer;\nObject.assign(exports, __webpack_require__(863));\n\n/**\n * the max integer that this VM can handle (a ```BN```)\n * @var {BN} MAX_INTEGER\n */\nexports.MAX_INTEGER = new BN('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16);\n\n/**\n * 2^256 (a ```BN```)\n * @var {BN} TWO_POW256\n */\nexports.TWO_POW256 = new BN('10000000000000000000000000000000000000000000000000000000000000000', 16);\n\n/**\n * Keccak-256 hash of null (a ```String```)\n * @var {String} KECCAK256_NULL_S\n */\nexports.KECCAK256_NULL_S = 'c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';\nexports.SHA3_NULL_S = exports.KECCAK256_NULL_S;\n\n/**\n * Keccak-256 hash of null (a ```Buffer```)\n * @var {Buffer} KECCAK256_NULL\n */\nexports.KECCAK256_NULL = Buffer.from(exports.KECCAK256_NULL_S, 'hex');\nexports.SHA3_NULL = exports.KECCAK256_NULL;\n\n/**\n * Keccak-256 of an RLP of an empty array (a ```String```)\n * @var {String} KECCAK256_RLP_ARRAY_S\n */\nexports.KECCAK256_RLP_ARRAY_S = '1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347';\nexports.SHA3_RLP_ARRAY_S = exports.KECCAK256_RLP_ARRAY_S;\n\n/**\n * Keccak-256 of an RLP of an empty array (a ```Buffer```)\n * @var {Buffer} KECCAK256_RLP_ARRAY\n */\nexports.KECCAK256_RLP_ARRAY = Buffer.from(exports.KECCAK256_RLP_ARRAY_S, 'hex');\nexports.SHA3_RLP_ARRAY = exports.KECCAK256_RLP_ARRAY;\n\n/**\n * Keccak-256 hash of the RLP of null  (a ```String```)\n * @var {String} KECCAK256_RLP_S\n */\nexports.KECCAK256_RLP_S = '56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421';\nexports.SHA3_RLP_S = exports.KECCAK256_RLP_S;\n\n/**\n * Keccak-256 hash of the RLP of null (a ```Buffer```)\n * @var {Buffer} KECCAK256_RLP\n */\nexports.KECCAK256_RLP = Buffer.from(exports.KECCAK256_RLP_S, 'hex');\nexports.SHA3_RLP = exports.KECCAK256_RLP;\n\n/**\n * [`BN`](https://github.com/indutny/bn.js)\n * @var {Function}\n */\nexports.BN = BN;\n\n/**\n * [`rlp`](https://github.com/ethereumjs/rlp)\n * @var {Function}\n */\nexports.rlp = rlp;\n\n/**\n * [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node/)\n * @var {Object}\n */\nexports.secp256k1 = secp256k1;\n\n/**\n * Returns a buffer filled with 0s\n * @method zeros\n * @param {Number} bytes  the number of bytes the buffer should be\n * @return {Buffer}\n */\nexports.zeros = function (bytes) {\n  return Buffer.allocUnsafe(bytes).fill(0);\n};\n\n/**\n  * Returns a zero address\n  * @method zeroAddress\n  * @return {String}\n  */\nexports.zeroAddress = function () {\n  var addressLength = 20;\n  var zeroAddress = exports.zeros(addressLength);\n  return exports.bufferToHex(zeroAddress);\n};\n\n/**\n * Left Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.\n * Or it truncates the beginning if it exceeds.\n * @method lsetLength\n * @param {Buffer|Array} msg the value to pad\n * @param {Number} length the number of bytes the output should be\n * @param {Boolean} [right=false] whether to start padding form the left or right\n * @return {Buffer|Array}\n */\nexports.setLengthLeft = exports.setLength = function (msg, length, right) {\n  var buf = exports.zeros(length);\n  msg = exports.toBuffer(msg);\n  if (right) {\n    if (msg.length < length) {\n      msg.copy(buf);\n      return buf;\n    }\n    return msg.slice(0, length);\n  } else {\n    if (msg.length < length) {\n      msg.copy(buf, length - msg.length);\n      return buf;\n    }\n    return msg.slice(-length);\n  }\n};\n\n/**\n * Right Pads an `Array` or `Buffer` with leading zeros till it has `length` bytes.\n * Or it truncates the beginning if it exceeds.\n * @param {Buffer|Array} msg the value to pad\n * @param {Number} length the number of bytes the output should be\n * @return {Buffer|Array}\n */\nexports.setLengthRight = function (msg, length) {\n  return exports.setLength(msg, length, true);\n};\n\n/**\n * Trims leading zeros from a `Buffer` or an `Array`\n * @param {Buffer|Array|String} a\n * @return {Buffer|Array|String}\n */\nexports.unpad = exports.stripZeros = function (a) {\n  a = exports.stripHexPrefix(a);\n  var first = a[0];\n  while (a.length > 0 && first.toString() === '0') {\n    a = a.slice(1);\n    first = a[0];\n  }\n  return a;\n};\n/**\n * Attempts to turn a value into a `Buffer`. As input it supports `Buffer`, `String`, `Number`, null/undefined, `BN` and other objects with a `toArray()` method.\n * @param {*} v the value\n */\nexports.toBuffer = function (v) {\n  if (!Buffer.isBuffer(v)) {\n    if (Array.isArray(v)) {\n      v = Buffer.from(v);\n    } else if (typeof v === 'string') {\n      if (exports.isHexString(v)) {\n        v = Buffer.from(exports.padToEven(exports.stripHexPrefix(v)), 'hex');\n      } else {\n        v = Buffer.from(v);\n      }\n    } else if (typeof v === 'number') {\n      v = exports.intToBuffer(v);\n    } else if (v === null || v === undefined) {\n      v = Buffer.allocUnsafe(0);\n    } else if (BN.isBN(v)) {\n      v = v.toArrayLike(Buffer);\n    } else if (v.toArray) {\n      // converts a BN to a Buffer\n      v = Buffer.from(v.toArray());\n    } else {\n      throw new Error('invalid type');\n    }\n  }\n  return v;\n};\n\n/**\n * Converts a `Buffer` to a `Number`\n * @param {Buffer} buf\n * @return {Number}\n * @throws If the input number exceeds 53 bits.\n */\nexports.bufferToInt = function (buf) {\n  return new BN(exports.toBuffer(buf)).toNumber();\n};\n\n/**\n * Converts a `Buffer` into a hex `String`\n * @param {Buffer} buf\n * @return {String}\n */\nexports.bufferToHex = function (buf) {\n  buf = exports.toBuffer(buf);\n  return '0x' + buf.toString('hex');\n};\n\n/**\n * Interprets a `Buffer` as a signed integer and returns a `BN`. Assumes 256-bit numbers.\n * @param {Buffer} num\n * @return {BN}\n */\nexports.fromSigned = function (num) {\n  return new BN(num).fromTwos(256);\n};\n\n/**\n * Converts a `BN` to an unsigned integer and returns it as a `Buffer`. Assumes 256-bit numbers.\n * @param {BN} num\n * @return {Buffer}\n */\nexports.toUnsigned = function (num) {\n  return Buffer.from(num.toTwos(256).toArray());\n};\n\n/**\n * Creates Keccak hash of the input\n * @param {Buffer|Array|String|Number} a the input data\n * @param {Number} [bits=256] the Keccak width\n * @return {Buffer}\n */\nexports.keccak = function (a, bits) {\n  a = exports.toBuffer(a);\n  if (!bits) bits = 256;\n\n  return createKeccakHash('keccak' + bits).update(a).digest();\n};\n\n/**\n * Creates Keccak-256 hash of the input, alias for keccak(a, 256)\n * @param {Buffer|Array|String|Number} a the input data\n * @return {Buffer}\n */\nexports.keccak256 = function (a) {\n  return exports.keccak(a);\n};\n\n/**\n * Creates SHA-3 (Keccak) hash of the input [OBSOLETE]\n * @param {Buffer|Array|String|Number} a the input data\n * @param {Number} [bits=256] the SHA-3 width\n * @return {Buffer}\n */\nexports.sha3 = exports.keccak;\n\n/**\n * Creates SHA256 hash of the input\n * @param {Buffer|Array|String|Number} a the input data\n * @return {Buffer}\n */\nexports.sha256 = function (a) {\n  a = exports.toBuffer(a);\n  return createHash('sha256').update(a).digest();\n};\n\n/**\n * Creates RIPEMD160 hash of the input\n * @param {Buffer|Array|String|Number} a the input data\n * @param {Boolean} padded whether it should be padded to 256 bits or not\n * @return {Buffer}\n */\nexports.ripemd160 = function (a, padded) {\n  a = exports.toBuffer(a);\n  var hash = createHash('rmd160').update(a).digest();\n  if (padded === true) {\n    return exports.setLength(hash, 32);\n  } else {\n    return hash;\n  }\n};\n\n/**\n * Creates SHA-3 hash of the RLP encoded version of the input\n * @param {Buffer|Array|String|Number} a the input data\n * @return {Buffer}\n */\nexports.rlphash = function (a) {\n  return exports.keccak(rlp.encode(a));\n};\n\n/**\n * Checks if the private key satisfies the rules of the curve secp256k1.\n * @param {Buffer} privateKey\n * @return {Boolean}\n */\nexports.isValidPrivate = function (privateKey) {\n  return secp256k1.privateKeyVerify(privateKey);\n};\n\n/**\n * Checks if the public key satisfies the rules of the curve secp256k1\n * and the requirements of Ethereum.\n * @param {Buffer} publicKey The two points of an uncompressed key, unless sanitize is enabled\n * @param {Boolean} [sanitize=false] Accept public keys in other formats\n * @return {Boolean}\n */\nexports.isValidPublic = function (publicKey, sanitize) {\n  if (publicKey.length === 64) {\n    // Convert to SEC1 for secp256k1\n    return secp256k1.publicKeyVerify(Buffer.concat([Buffer.from([4]), publicKey]));\n  }\n\n  if (!sanitize) {\n    return false;\n  }\n\n  return secp256k1.publicKeyVerify(publicKey);\n};\n\n/**\n * Returns the ethereum address of a given public key.\n * Accepts \"Ethereum public keys\" and SEC1 encoded keys.\n * @param {Buffer} pubKey The two points of an uncompressed key, unless sanitize is enabled\n * @param {Boolean} [sanitize=false] Accept public keys in other formats\n * @return {Buffer}\n */\nexports.pubToAddress = exports.publicToAddress = function (pubKey, sanitize) {\n  pubKey = exports.toBuffer(pubKey);\n  if (sanitize && pubKey.length !== 64) {\n    pubKey = secp256k1.publicKeyConvert(pubKey, false).slice(1);\n  }\n  assert(pubKey.length === 64);\n  // Only take the lower 160bits of the hash\n  return exports.keccak(pubKey).slice(-20);\n};\n\n/**\n * Returns the ethereum public key of a given private key\n * @param {Buffer} privateKey A private key must be 256 bits wide\n * @return {Buffer}\n */\nvar privateToPublic = exports.privateToPublic = function (privateKey) {\n  privateKey = exports.toBuffer(privateKey);\n  // skip the type flag and use the X, Y points\n  return secp256k1.publicKeyCreate(privateKey, false).slice(1);\n};\n\n/**\n * Converts a public key to the Ethereum format.\n * @param {Buffer} publicKey\n * @return {Buffer}\n */\nexports.importPublic = function (publicKey) {\n  publicKey = exports.toBuffer(publicKey);\n  if (publicKey.length !== 64) {\n    publicKey = secp256k1.publicKeyConvert(publicKey, false).slice(1);\n  }\n  return publicKey;\n};\n\n/**\n * ECDSA sign\n * @param {Buffer} msgHash\n * @param {Buffer} privateKey\n * @return {Object}\n */\nexports.ecsign = function (msgHash, privateKey) {\n  var sig = secp256k1.sign(msgHash, privateKey);\n\n  var ret = {};\n  ret.r = sig.signature.slice(0, 32);\n  ret.s = sig.signature.slice(32, 64);\n  ret.v = sig.recovery + 27;\n  return ret;\n};\n\n/**\n * Returns the keccak-256 hash of `message`, prefixed with the header used by the `eth_sign` RPC call.\n * The output of this function can be fed into `ecsign` to produce the same signature as the `eth_sign`\n * call for a given `message`, or fed to `ecrecover` along with a signature to recover the public key\n * used to produce the signature.\n * @param message\n * @returns {Buffer} hash\n */\nexports.hashPersonalMessage = function (message) {\n  var prefix = exports.toBuffer('\\x19Ethereum Signed Message:\\n' + message.length.toString());\n  return exports.keccak(Buffer.concat([prefix, message]));\n};\n\n/**\n * ECDSA public key recovery from signature\n * @param {Buffer} msgHash\n * @param {Number} v\n * @param {Buffer} r\n * @param {Buffer} s\n * @return {Buffer} publicKey\n */\nexports.ecrecover = function (msgHash, v, r, s) {\n  var signature = Buffer.concat([exports.setLength(r, 32), exports.setLength(s, 32)], 64);\n  var recovery = v - 27;\n  if (recovery !== 0 && recovery !== 1) {\n    throw new Error('Invalid signature v value');\n  }\n  var senderPubKey = secp256k1.recover(msgHash, signature, recovery);\n  return secp256k1.publicKeyConvert(senderPubKey, false).slice(1);\n};\n\n/**\n * Convert signature parameters into the format of `eth_sign` RPC method\n * @param {Number} v\n * @param {Buffer} r\n * @param {Buffer} s\n * @return {String} sig\n */\nexports.toRpcSig = function (v, r, s) {\n  // NOTE: with potential introduction of chainId this might need to be updated\n  if (v !== 27 && v !== 28) {\n    throw new Error('Invalid recovery id');\n  }\n\n  // geth (and the RPC eth_sign method) uses the 65 byte format used by Bitcoin\n  // FIXME: this might change in the future - https://github.com/ethereum/go-ethereum/issues/2053\n  return exports.bufferToHex(Buffer.concat([exports.setLengthLeft(r, 32), exports.setLengthLeft(s, 32), exports.toBuffer(v - 27)]));\n};\n\n/**\n * Convert signature format of the `eth_sign` RPC method to signature parameters\n * NOTE: all because of a bug in geth: https://github.com/ethereum/go-ethereum/issues/2053\n * @param {String} sig\n * @return {Object}\n */\nexports.fromRpcSig = function (sig) {\n  sig = exports.toBuffer(sig);\n\n  // NOTE: with potential introduction of chainId this might need to be updated\n  if (sig.length !== 65) {\n    throw new Error('Invalid signature length');\n  }\n\n  var v = sig[64];\n  // support both versions of `eth_sign` responses\n  if (v < 27) {\n    v += 27;\n  }\n\n  return {\n    v: v,\n    r: sig.slice(0, 32),\n    s: sig.slice(32, 64)\n  };\n};\n\n/**\n * Returns the ethereum address of a given private key\n * @param {Buffer} privateKey A private key must be 256 bits wide\n * @return {Buffer}\n */\nexports.privateToAddress = function (privateKey) {\n  return exports.publicToAddress(privateToPublic(privateKey));\n};\n\n/**\n * Checks if the address is a valid. Accepts checksummed addresses too\n * @param {String} address\n * @return {Boolean}\n */\nexports.isValidAddress = function (address) {\n  return (/^0x[0-9a-fA-F]{40}$/.test(address)\n  );\n};\n\n/**\n  * Checks if a given address is a zero address\n  * @method isZeroAddress\n  * @param {String} address\n  * @return {Boolean}\n  */\nexports.isZeroAddress = function (address) {\n  var zeroAddress = exports.zeroAddress();\n  return zeroAddress === exports.addHexPrefix(address);\n};\n\n/**\n * Returns a checksummed address\n * @param {String} address\n * @return {String}\n */\nexports.toChecksumAddress = function (address) {\n  address = exports.stripHexPrefix(address).toLowerCase();\n  var hash = exports.keccak(address).toString('hex');\n  var ret = '0x';\n\n  for (var i = 0; i < address.length; i++) {\n    if (parseInt(hash[i], 16) >= 8) {\n      ret += address[i].toUpperCase();\n    } else {\n      ret += address[i];\n    }\n  }\n\n  return ret;\n};\n\n/**\n * Checks if the address is a valid checksummed address\n * @param {Buffer} address\n * @return {Boolean}\n */\nexports.isValidChecksumAddress = function (address) {\n  return exports.isValidAddress(address) && exports.toChecksumAddress(address) === address;\n};\n\n/**\n * Generates an address of a newly created contract\n * @param {Buffer} from the address which is creating this new address\n * @param {Buffer} nonce the nonce of the from account\n * @return {Buffer}\n */\nexports.generateAddress = function (from, nonce) {\n  from = exports.toBuffer(from);\n  nonce = new BN(nonce);\n\n  if (nonce.isZero()) {\n    // in RLP we want to encode null in the case of zero nonce\n    // read the RLP documentation for an answer if you dare\n    nonce = null;\n  } else {\n    nonce = Buffer.from(nonce.toArray());\n  }\n\n  // Only take the lower 160bits of the hash\n  return exports.rlphash([from, nonce]).slice(-20);\n};\n\n/**\n * Returns true if the supplied address belongs to a precompiled account (Byzantium)\n * @param {Buffer|String} address\n * @return {Boolean}\n */\nexports.isPrecompiled = function (address) {\n  var a = exports.unpad(address);\n  return a.length === 1 && a[0] >= 1 && a[0] <= 8;\n};\n\n/**\n * Adds \"0x\" to a given `String` if it does not already start with \"0x\"\n * @param {String} str\n * @return {String}\n */\nexports.addHexPrefix = function (str) {\n  if (typeof str !== 'string') {\n    return str;\n  }\n\n  return exports.isHexPrefixed(str) ? str : '0x' + str;\n};\n\n/**\n * Validate ECDSA signature\n * @method isValidSignature\n * @param {Buffer} v\n * @param {Buffer} r\n * @param {Buffer} s\n * @param {Boolean} [homestead=true]\n * @return {Boolean}\n */\n\nexports.isValidSignature = function (v, r, s, homestead) {\n  var SECP256K1_N_DIV_2 = new BN('7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', 16);\n  var SECP256K1_N = new BN('fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141', 16);\n\n  if (r.length !== 32 || s.length !== 32) {\n    return false;\n  }\n\n  if (v !== 27 && v !== 28) {\n    return false;\n  }\n\n  r = new BN(r);\n  s = new BN(s);\n\n  if (r.isZero() || r.gt(SECP256K1_N) || s.isZero() || s.gt(SECP256K1_N)) {\n    return false;\n  }\n\n  if (homestead === false && new BN(s).cmp(SECP256K1_N_DIV_2) === 1) {\n    return false;\n  }\n\n  return true;\n};\n\n/**\n * Converts a `Buffer` or `Array` to JSON\n * @param {Buffer|Array} ba\n * @return {Array|String|null}\n */\nexports.baToJSON = function (ba) {\n  if (Buffer.isBuffer(ba)) {\n    return '0x' + ba.toString('hex');\n  } else if (ba instanceof Array) {\n    var array = [];\n    for (var i = 0; i < ba.length; i++) {\n      array.push(exports.baToJSON(ba[i]));\n    }\n    return array;\n  }\n};\n\n/**\n * Defines properties on a `Object`. It make the assumption that underlying data is binary.\n * @param {Object} self the `Object` to define properties on\n * @param {Array} fields an array fields to define. Fields can contain:\n * * `name` - the name of the properties\n * * `length` - the number of bytes the field can have\n * * `allowLess` - if the field can be less than the length\n * * `allowEmpty`\n * @param {*} data data to be validated against the definitions\n */\nexports.defineProperties = function (self, fields, data) {\n  self.raw = [];\n  self._fields = [];\n\n  // attach the `toJSON`\n  self.toJSON = function (label) {\n    if (label) {\n      var obj = {};\n      self._fields.forEach(function (field) {\n        obj[field] = '0x' + self[field].toString('hex');\n      });\n      return obj;\n    }\n    return exports.baToJSON(this.raw);\n  };\n\n  self.serialize = function serialize() {\n    return rlp.encode(self.raw);\n  };\n\n  fields.forEach(function (field, i) {\n    self._fields.push(field.name);\n    function getter() {\n      return self.raw[i];\n    }\n    function setter(v) {\n      v = exports.toBuffer(v);\n\n      if (v.toString('hex') === '00' && !field.allowZero) {\n        v = Buffer.allocUnsafe(0);\n      }\n\n      if (field.allowLess && field.length) {\n        v = exports.stripZeros(v);\n        assert(field.length >= v.length, 'The field ' + field.name + ' must not have more ' + field.length + ' bytes');\n      } else if (!(field.allowZero && v.length === 0) && field.length) {\n        assert(field.length === v.length, 'The field ' + field.name + ' must have byte length of ' + field.length);\n      }\n\n      self.raw[i] = v;\n    }\n\n    Object.defineProperty(self, field.name, {\n      enumerable: true,\n      configurable: true,\n      get: getter,\n      set: setter\n    });\n\n    if (field.default) {\n      self[field.name] = field.default;\n    }\n\n    // attach alias\n    if (field.alias) {\n      Object.defineProperty(self, field.alias, {\n        enumerable: false,\n        configurable: true,\n        set: setter,\n        get: getter\n      });\n    }\n  });\n\n  // if the constuctor is passed data\n  if (data) {\n    if (typeof data === 'string') {\n      data = Buffer.from(exports.stripHexPrefix(data), 'hex');\n    }\n\n    if (Buffer.isBuffer(data)) {\n      data = rlp.decode(data);\n    }\n\n    if (Array.isArray(data)) {\n      if (data.length > self._fields.length) {\n        throw new Error('wrong number of fields in data');\n      }\n\n      // make sure all the items are buffers\n      data.forEach(function (d, i) {\n        self[self._fields[i]] = exports.toBuffer(d);\n      });\n    } else if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {\n      var keys = Object.keys(data);\n      fields.forEach(function (field) {\n        if (keys.indexOf(field.name) !== -1) self[field.name] = data[field.name];\n        if (keys.indexOf(field.alias) !== -1) self[field.alias] = data[field.alias];\n      });\n    } else {\n      throw new Error('invalid data');\n    }\n  }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereumjs-util/dist/index.js\n// module id = 182\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereumjs-util/dist/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//\n// We store our EE objects in a plain object whose properties are event names.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// `~` to make sure that the built-in object properties are not overridden or\n// used as an attack vector.\n// We also assume that `Object.create(null)` is available when the event name\n// is an ES6 Symbol.\n//\nvar prefix = typeof Object.create !== 'function' ? '~' : false;\n\n/**\n * Representation of a single EventEmitter function.\n *\n * @param {Function} fn Event handler to be called.\n * @param {Mixed} context Context for function execution.\n * @param {Boolean} once Only emit once\n * @api private\n */\nfunction EE(fn, context, once) {\n  this.fn = fn;\n  this.context = context;\n  this.once = once || false;\n}\n\n/**\n * Minimal EventEmitter interface that is molded against the Node.js\n * EventEmitter interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() { /* Nothing to set */ }\n\n/**\n * Holds the assigned EventEmitters by name.\n *\n * @type {Object}\n * @private\n */\nEventEmitter.prototype._events = undefined;\n\n/**\n * Return a list of assigned event listeners.\n *\n * @param {String} event The events that should be listed.\n * @param {Boolean} exists We only need to know if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n  var evt = prefix ? prefix + event : event\n    , available = this._events && this._events[evt];\n\n  if (exists) return !!available;\n  if (!available) return [];\n  if (available.fn) return [available.fn];\n\n  for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n    ee[i] = available[i].fn;\n  }\n\n  return ee;\n};\n\n/**\n * Emit an event to all registered event listeners.\n *\n * @param {String} event The name of the event.\n * @returns {Boolean} Indication if we've emitted an event.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events || !this._events[evt]) return false;\n\n  var listeners = this._events[evt]\n    , len = arguments.length\n    , args\n    , i;\n\n  if ('function' === typeof listeners.fn) {\n    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n    switch (len) {\n      case 1: return listeners.fn.call(listeners.context), true;\n      case 2: return listeners.fn.call(listeners.context, a1), true;\n      case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n    }\n\n    for (i = 1, args = new Array(len -1); i < len; i++) {\n      args[i - 1] = arguments[i];\n    }\n\n    listeners.fn.apply(listeners.context, args);\n  } else {\n    var length = listeners.length\n      , j;\n\n    for (i = 0; i < length; i++) {\n      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n      switch (len) {\n        case 1: listeners[i].fn.call(listeners[i].context); break;\n        case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n        default:\n          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n            args[j - 1] = arguments[j];\n          }\n\n          listeners[i].fn.apply(listeners[i].context, args);\n      }\n    }\n  }\n\n  return true;\n};\n\n/**\n * Register a new EventListener for the given event.\n *\n * @param {String} event Name of the event.\n * @param {Functon} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n  var listener = new EE(fn, context || this)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events) this._events = prefix ? {} : Object.create(null);\n  if (!this._events[evt]) this._events[evt] = listener;\n  else {\n    if (!this._events[evt].fn) this._events[evt].push(listener);\n    else this._events[evt] = [\n      this._events[evt], listener\n    ];\n  }\n\n  return this;\n};\n\n/**\n * Add an EventListener that's only called once.\n *\n * @param {String} event Name of the event.\n * @param {Function} fn Callback function.\n * @param {Mixed} context The context of the function.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n  var listener = new EE(fn, context || this, true)\n    , evt = prefix ? prefix + event : event;\n\n  if (!this._events) this._events = prefix ? {} : Object.create(null);\n  if (!this._events[evt]) this._events[evt] = listener;\n  else {\n    if (!this._events[evt].fn) this._events[evt].push(listener);\n    else this._events[evt] = [\n      this._events[evt], listener\n    ];\n  }\n\n  return this;\n};\n\n/**\n * Remove event listeners.\n *\n * @param {String} event The event we want to remove.\n * @param {Function} fn The listener that we need to find.\n * @param {Mixed} context Only remove listeners matching this context.\n * @param {Boolean} once Only remove once listeners.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n  var evt = prefix ? prefix + event : event;\n\n  if (!this._events || !this._events[evt]) return this;\n\n  var listeners = this._events[evt]\n    , events = [];\n\n  if (fn) {\n    if (listeners.fn) {\n      if (\n           listeners.fn !== fn\n        || (once && !listeners.once)\n        || (context && listeners.context !== context)\n      ) {\n        events.push(listeners);\n      }\n    } else {\n      for (var i = 0, length = listeners.length; i < length; i++) {\n        if (\n             listeners[i].fn !== fn\n          || (once && !listeners[i].once)\n          || (context && listeners[i].context !== context)\n        ) {\n          events.push(listeners[i]);\n        }\n      }\n    }\n  }\n\n  //\n  // Reset the array, or remove it completely if we have no more listeners.\n  //\n  if (events.length) {\n    this._events[evt] = events.length === 1 ? events[0] : events;\n  } else {\n    delete this._events[evt];\n  }\n\n  return this;\n};\n\n/**\n * Remove all listeners or only the listeners for the specified event.\n *\n * @param {String} event The event want to remove all listeners for.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n  if (!this._events) return this;\n\n  if (event) delete this._events[prefix ? prefix + event : event];\n  else this._events = prefix ? {} : Object.create(null);\n\n  return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n  return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Expose the module.\n//\nif (true) {\n  module.exports = EventEmitter;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eventemitter3/index.js\n// module id = 183\n// module chunks = 0\n\n//# sourceURL=../node_modules/eventemitter3/index.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar MD5 = __webpack_require__(1093)\n\n/* eslint-disable camelcase */\nfunction EVP_BytesToKey (password, salt, keyBits, ivLen) {\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, 'binary')\n  if (salt) {\n    if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, 'binary')\n    if (salt.length !== 8) throw new RangeError('salt should be Buffer with 8 byte length')\n  }\n\n  var keyLen = keyBits / 8\n  var key = Buffer.alloc(keyLen)\n  var iv = Buffer.alloc(ivLen || 0)\n  var tmp = Buffer.alloc(0)\n\n  while (keyLen > 0 || ivLen > 0) {\n    var hash = new MD5()\n    hash.update(tmp)\n    hash.update(password)\n    if (salt) hash.update(salt)\n    tmp = hash.digest()\n\n    var used = 0\n\n    if (keyLen > 0) {\n      var keyStart = key.length - keyLen\n      used = Math.min(keyLen, tmp.length)\n      tmp.copy(key, keyStart, 0, used)\n      keyLen -= used\n    }\n\n    if (used < tmp.length && ivLen > 0) {\n      var ivStart = iv.length - ivLen\n      var length = Math.min(ivLen, tmp.length - used)\n      tmp.copy(iv, ivStart, used, used + length)\n      ivLen -= length\n    }\n  }\n\n  tmp.fill(0)\n  return { key: key, iv: iv }\n}\n\nmodule.exports = EVP_BytesToKey\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/evp_bytestokey/index.js\n// module id = 184\n// module chunks = 0\n\n//# sourceURL=../node_modules/evp_bytestokey/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar common = __webpack_require__(143);\nvar shaCommon = __webpack_require__(411);\nvar assert = __webpack_require__(43);\n\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar ch32 = shaCommon.ch32;\nvar maj32 = shaCommon.maj32;\nvar s0_256 = shaCommon.s0_256;\nvar s1_256 = shaCommon.s1_256;\nvar g0_256 = shaCommon.g0_256;\nvar g1_256 = shaCommon.g1_256;\n\nvar BlockHash = common.BlockHash;\n\nvar sha256_K = [\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nfunction SHA256() {\n  if (!(this instanceof SHA256))\n    return new SHA256();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\n  ];\n  this.k = sha256_K;\n  this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nmodule.exports = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i++)\n    W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n  var f = this.h[5];\n  var g = this.h[6];\n  var h = this.h[7];\n\n  assert(this.k.length === W.length);\n  for (i = 0; i < W.length; i++) {\n    var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n    var T2 = sum32(s0_256(a), maj32(a, b, c));\n    h = g;\n    g = f;\n    f = e;\n    e = sum32(d, T1);\n    d = c;\n    c = b;\n    b = a;\n    a = sum32(T1, T2);\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n  this.h[5] = sum32(this.h[5], f);\n  this.h[6] = sum32(this.h[6], g);\n  this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/256.js\n// module id = 185\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/256.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst protons = __webpack_require__(64)\nconst Block = __webpack_require__(188)\nconst isEqualWith = __webpack_require__(1042)\nconst assert = __webpack_require__(16)\nconst each = __webpack_require__(41)\nconst CID = __webpack_require__(14)\nconst codecName = __webpack_require__(472)\nconst vd = __webpack_require__(1262)\nconst multihashing = __webpack_require__(49)\n\nconst pbm = protons(__webpack_require__(892))\nconst Entry = __webpack_require__(891)\n\nclass BitswapMessage {\n  constructor (full) {\n    this.full = full\n    this.wantlist = new Map()\n    this.blocks = new Map()\n  }\n\n  get empty () {\n    return this.blocks.size === 0 &&\n           this.wantlist.size === 0\n  }\n\n  addEntry (cid, priority, cancel) {\n    assert(cid && CID.isCID(cid), 'must be a valid cid')\n    const cidStr = cid.buffer.toString()\n\n    const entry = this.wantlist.get(cidStr)\n\n    if (entry) {\n      entry.priority = priority\n      entry.cancel = Boolean(cancel)\n    } else {\n      this.wantlist.set(cidStr, new Entry(cid, priority, cancel))\n    }\n  }\n\n  addBlock (block) {\n    assert(Block.isBlock(block), 'must be a valid cid')\n    const cidStr = block.cid.buffer.toString()\n    this.blocks.set(cidStr, block)\n  }\n\n  cancel (cid) {\n    assert(CID.isCID(cid), 'must be a valid cid')\n    const cidStr = cid.buffer.toString()\n    this.wantlist.delete(cidStr)\n    this.addEntry(cid, 0, true)\n  }\n\n  /*\n   * Serializes to Bitswap Message protobuf of\n   * version 1.0.0\n   */\n  serializeToBitswap100 () {\n    const msg = {\n      wantlist: {\n        entries: Array.from(this.wantlist.values()).map((entry) => {\n          return {\n            block: entry.cid.buffer, // cid\n            priority: Number(entry.priority),\n            cancel: Boolean(entry.cancel)\n          }\n        })\n      },\n      blocks: Array.from(this.blocks.values())\n        .map((block) => block.data)\n    }\n\n    if (this.full) {\n      msg.wantlist.full = true\n    }\n\n    return pbm.Message.encode(msg)\n  }\n\n  /*\n   * Serializes to Bitswap Message protobuf of\n   * version 1.1.0\n   */\n  serializeToBitswap110 () {\n    const msg = {\n      wantlist: {\n        entries: Array.from(this.wantlist.values()).map((entry) => {\n          return {\n            block: entry.cid.buffer, // cid\n            priority: Number(entry.priority),\n            cancel: Boolean(entry.cancel)\n          }\n        })\n      },\n      payload: []\n    }\n\n    if (this.full) {\n      msg.wantlist.full = true\n    }\n\n    this.blocks.forEach((block) => {\n      msg.payload.push({\n        prefix: block.cid.prefix,\n        data: block.data\n      })\n    })\n\n    return pbm.Message.encode(msg)\n  }\n\n  equals (other) {\n    const cmp = (a, b) => {\n      if (a.equals && typeof a.equals === 'function') {\n        return a.equals(b)\n      }\n    }\n\n    if (this.full !== other.full ||\n        !isEqualWith(this.wantlist, other.wantlist, cmp) ||\n        !isEqualWith(this.blocks, other.blocks, cmp)\n    ) {\n      return false\n    }\n\n    return true\n  }\n\n  get [Symbol.toStringTag] () {\n    const list = Array.from(this.wantlist.keys())\n    const blocks = Array.from(this.blocks.keys())\n    return `BitswapMessage <full: ${this.full}, list: ${list}, blocks: ${blocks}>`\n  }\n}\n\nBitswapMessage.deserialize = (raw, callback) => {\n  let decoded\n  try {\n    decoded = pbm.Message.decode(raw)\n  } catch (err) {\n    return setImmediate(() => callback(err))\n  }\n\n  const isFull = (decoded.wantlist && decoded.wantlist.full) || false\n  const msg = new BitswapMessage(isFull)\n\n  if (decoded.wantlist) {\n    decoded.wantlist.entries.forEach((entry) => {\n      // note: entry.block is the CID here\n      const cid = new CID(entry.block)\n      msg.addEntry(cid, entry.priority, entry.cancel)\n    })\n  }\n\n  // Bitswap 1.0.0\n  // decoded.blocks are just the byte arrays\n  if (decoded.blocks.length > 0) {\n    return each(decoded.blocks, (b, cb) => {\n      multihashing(b, 'sha2-256', (err, hash) => {\n        if (err) {\n          return cb(err)\n        }\n        const cid = new CID(hash)\n        msg.addBlock(new Block(b, cid))\n        cb()\n      })\n    }, (err) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, msg)\n    })\n  }\n\n  // Bitswap 1.1.0\n  if (decoded.payload.length > 0) {\n    return each(decoded.payload, (p, cb) => {\n      if (!p.prefix || !p.data) {\n        cb()\n      }\n      const values = vd(p.prefix)\n      const cidVersion = values[0]\n      const multicodec = values[1]\n      const hashAlg = values[2]\n      // const hashLen = values[3] // We haven't need to use this so far\n      multihashing(p.data, hashAlg, (err, hash) => {\n        if (err) {\n          return cb(err)\n        }\n\n        const cid = new CID(cidVersion, codecName[multicodec.toString('16')], hash)\n\n        msg.addBlock(new Block(p.data, cid))\n        cb()\n      })\n    }, (err) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, msg)\n    })\n  }\n\n  callback(null, msg)\n}\n\nBitswapMessage.Entry = Entry\nmodule.exports = BitswapMessage\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/types/message/index.js\n// module id = 186\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/types/message/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst sort = __webpack_require__(1046)\nconst Entry = __webpack_require__(893)\n\nclass Wantlist {\n  constructor (stats) {\n    this.set = new Map()\n    this._stats = stats\n  }\n\n  get length () {\n    return this.set.size\n  }\n\n  add (cid, priority) {\n    const cidStr = cid.buffer.toString()\n    const entry = this.set.get(cidStr)\n\n    if (entry) {\n      entry.inc()\n      entry.priority = priority\n    } else {\n      this.set.set(cidStr, new Entry(cid, priority))\n      if (this._stats) {\n        this._stats.push(null, 'wantListSize', 1)\n      }\n    }\n  }\n\n  remove (cid) {\n    const cidStr = cid.buffer.toString()\n    const entry = this.set.get(cidStr)\n\n    if (!entry) {\n      return\n    }\n\n    entry.dec()\n\n    // only delete when no refs are held\n    if (entry.hasRefs()) {\n      return\n    }\n\n    this.set.delete(cidStr)\n    if (this._stats) {\n      this._stats.push(null, 'wantListSize', -1)\n    }\n  }\n\n  removeForce (cidStr) {\n    if (this.set.has(cidStr)) {\n      this.set.delete(cidStr)\n    }\n  }\n\n  forEach (fn) {\n    return this.set.forEach(fn)\n  }\n\n  entries () {\n    return this.set.entries()\n  }\n\n  sortedEntries () {\n    return new Map(\n      sort(Array.from(this.set.entries()), (o) => {\n        return o[1].key\n      })\n    )\n  }\n\n  contains (cid) {\n    const cidStr = cid.buffer.toString()\n    return this.set.get(cidStr)\n  }\n}\n\nWantlist.Entry = Entry\nmodule.exports = Wantlist\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/types/wantlist/index.js\n// module id = 187\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/types/wantlist/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(14)\n\n/**\n * Represents an immutable block of data that is uniquely referenced with a cid.\n *\n * @constructor\n * @param {Buffer} data - The data to be stored in the block as a buffer.\n * @param {CID} cid - The cid of the data\n *\n * @example\n * const block = new Block(new Buffer('a012d83b20f9371...'))\n */\nclass Block {\n  constructor (data, cid) {\n    if (!data || !Buffer.isBuffer(data)) {\n      throw new Error('first argument  must be a buffer')\n    }\n\n    if (!cid || !CID.isCID(cid)) {\n      throw new Error('second argument must be a CID')\n    }\n\n    this._data = data\n    this._cid = cid\n  }\n\n  /**\n   * The data of this block.\n   *\n   * @type {Buffer}\n   */\n  get data () {\n    return this._data\n  }\n\n  set data (val) {\n    throw new Error('Tried to change an immutable block')\n  }\n\n  /**\n   * The cid of the data this block represents.\n   *\n   * @type {CID}\n   */\n  get cid () {\n    return this._cid\n  }\n\n  set cid (val) {\n    throw new Error('Tried to change an immutable block')\n  }\n\n  /**\n   * Check if the given value is a Block.\n   *\n   * @param {any} other\n   * @returns {bool}\n   */\n  static isBlock (other) {\n    return other && other.constructor.name === 'Block'\n  }\n}\n\nmodule.exports = Block\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-block/src/index.js\n// module id = 188\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-block/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihashing = __webpack_require__(49)\nconst sort = __webpack_require__(1242)\nconst dagPBUtil = __webpack_require__(270)\nconst serialize = dagPBUtil.serialize\nconst dagNodeUtil = __webpack_require__(190)\nconst linkSort = dagNodeUtil.linkSort\nconst DAGNode = __webpack_require__(269)\nconst DAGLink = __webpack_require__(96)\n\nfunction create (data, dagLinks, hashAlg, callback) {\n  if (typeof data === 'function') {\n    callback = data\n    data = undefined\n  } else if (typeof data === 'string') {\n    data = Buffer.from(data)\n  }\n  if (typeof dagLinks === 'function') {\n    callback = dagLinks\n    dagLinks = []\n  }\n  if (typeof hashAlg === 'function') {\n    callback = hashAlg\n    hashAlg = undefined\n  }\n\n  if (!Buffer.isBuffer(data)) {\n    return callback(new Error('Passed \\'data\\' is not a buffer or a string!'))\n  }\n\n  if (!hashAlg) {\n    hashAlg = 'sha2-256'\n  }\n\n  const links = dagLinks.map((link) => {\n    return DAGLink.util.isDagLink(link) ? link : DAGLink.util.createDagLinkFromB58EncodedHash(link)\n  })\n  const sortedLinks = sort(links, linkSort)\n\n  serialize({\n    data: data,\n    links: sortedLinks\n  }, (err, serialized) => {\n    if (err) {\n      return callback(err)\n    }\n    multihashing(serialized, hashAlg, (err, multihash) => {\n      if (err) {\n        return callback(err)\n      }\n      const dagNode = new DAGNode(data, sortedLinks, serialized, multihash)\n      callback(null, dagNode)\n    })\n  })\n}\n\nmodule.exports = create\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/create.js\n// module id = 189\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/create.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst DAGLink = __webpack_require__(96)\n\nexports = module.exports\n\nfunction cloneData (dagNode) {\n  let data\n\n  if (dagNode.data && dagNode.data.length > 0) {\n    data = Buffer.alloc(dagNode.data.length)\n    dagNode.data.copy(data)\n  } else {\n    data = Buffer.alloc(0)\n  }\n\n  return data\n}\n\nfunction cloneLinks (dagNode) {\n  return dagNode.links.slice()\n}\n\nfunction linkSort (a, b) {\n  const aBuf = Buffer.from(a.name || '')\n  const bBuf = Buffer.from(b.name || '')\n\n  return aBuf.compare(bBuf)\n}\n\n/*\n * toDAGLink converts a DAGNode to a DAGLink\n */\nfunction toDAGLink (node) {\n  return new DAGLink('', node.size, node.multihash)\n}\n\nexports.cloneData = cloneData\nexports.cloneLinks = cloneLinks\nexports.linkSort = linkSort\nexports.toDAGLink = toDAGLink\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/util.js\n// module id = 190\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst SmartBuffer = __webpack_require__(209).SmartBuffer\nconst multihashes = __webpack_require__(475)\nconst multicodecs = __webpack_require__(195)\nconst multihash = __webpack_require__(32)\nconst CID = __webpack_require__(14)\n\nexports = module.exports\n\nexports.SHA1_LENGTH = multihashes.defaultLengths[multihashes.names.sha1]\n\nexports.find = (buf, byte) => {\n  for (let i = 0; i < buf.length; i++) {\n    if (buf[i] === byte) {\n      return i\n    }\n  }\n  return -1\n}\n\nexports.parsePersonLine = (line) => {\n  let matched = line.match(/^(([^<]+)\\s)?\\s?<([^>]+)>\\s?(\\d+\\s[+\\-\\d]+)?$/)\n  if (matched === null) {\n    return null\n  }\n\n  return {\n    name: matched[2],\n    email: matched[3],\n    date: matched[4]\n  }\n}\n\nexports.serializePersonLine = (node) => {\n  let parts = []\n  if (node.name) {\n    parts.push(node.name)\n  }\n  parts.push('<' + node.email + '>')\n  if (node.date) {\n    parts.push(node.date)\n  }\n\n  return parts.join(' ')\n}\n\nexports.shaToCid = (buf) => {\n  let mhashBuf = new SmartBuffer()\n  mhashBuf.writeUInt8(1)\n  mhashBuf.writeBuffer(multicodecs['git-raw'])\n  mhashBuf.writeUInt8(multihashes.names.sha1)\n  mhashBuf.writeUInt8(exports.SHA1_LENGTH)\n  mhashBuf.writeBuffer(buf)\n  return mhashBuf.toBuffer()\n}\n\nexports.cidToSha = (cidBuf) => {\n  let mh = multihash.decode(new CID(cidBuf).multihash)\n  if (mh.name !== 'sha1') {\n    return null\n  }\n\n  return mh.digest\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/util/util.js\n// module id = 191\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/util/util.js")},function(module,exports,__webpack_require__){eval("/* Copyright (c) 2012-2017 LevelUP contributors\n * See list at <https://github.com/rvagg/node-levelup#contributing>\n * MIT License\n * <https://github.com/rvagg/node-levelup/blob/master/LICENSE.md>\n */\n\nvar createError   = __webpack_require__(842).create\n  , LevelUPError  = createError('LevelUPError')\n  , NotFoundError = createError('NotFoundError', LevelUPError)\n\nNotFoundError.prototype.notFound = true\nNotFoundError.prototype.status   = 404\n\nmodule.exports = {\n    LevelUPError        : LevelUPError\n  , InitializationError : createError('InitializationError', LevelUPError)\n  , OpenError           : createError('OpenError', LevelUPError)\n  , ReadError           : createError('ReadError', LevelUPError)\n  , WriteError          : createError('WriteError', LevelUPError)\n  , NotFoundError       : NotFoundError\n  , EncodingError       : createError('EncodingError', LevelUPError)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-errors/errors.js\n// module id = 192\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-errors/errors.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {module.exports = Level\n\nvar AbstractLevelDOWN = __webpack_require__(439).AbstractLevelDOWN\nvar util = __webpack_require__(104)\nvar Iterator = __webpack_require__(971)\nvar xtend = __webpack_require__(73)\n\nfunction Level(location) {\n  if (!(this instanceof Level)) return new Level(location)\n\n  AbstractLevelDOWN.call(this, location)\n}\n\nutil.inherits(Level, AbstractLevelDOWN)\n\n/**\n * Open a database and optionally create if missing.\n *\n * @param {Object} [options]  storeName and other options passed to indexedDB\n *                            open and createObjectStore.\n * @param {Function} callback  First parameter will be an error object or null.\n */\nLevel.prototype._open = function(options, callback) {\n  var self = this\n\n  // assume createIfMissing and errorIfExists are initialized by abstract-leveldown\n  this._idbOpts = xtend({\n    storeName: this.location,\n    keyEncoding: 'none',\n    valueEncoding: 'none'\n  }, options)\n\n  // support passing an open database\n  if (this._idbOpts.idb) {\n    onsuccess(this._idbOpts.idb)\n  } else {\n    var req = indexedDB.open(this.location) // use the databases current version\n    req.onerror = onerror\n    req.onsuccess = function() {\n      onsuccess(req.result)\n    }\n  }\n\n  function onerror(ev) {\n    callback(ev.target.error)\n  }\n\n  // if the store does not exist and createIfMissing is true, create the object store\n  function onsuccess(db) {\n    self._db = db\n\n    var exists = self._db.objectStoreNames.contains(self._idbOpts.storeName)\n\n    if (options.errorIfExists && exists) {\n      self._db.close()\n      callback(new Error('store already exists'))\n      return\n    }\n\n    if (!options.createIfMissing && !exists) {\n      self._db.close()\n      callback(new Error('store does not exist'))\n      return\n    }\n\n    if (options.createIfMissing && !exists) {\n      self._db.close()\n\n      var req2 = indexedDB.open(self.location, self._db.version + 1)\n\n      req2.onerror = function(ev) {\n        callback(ev.target.error)\n      }\n\n      req2.onupgradeneeded = function() {\n        var db = req2.result\n        db.createObjectStore(self._idbOpts.storeName, self._idbOpts)\n      }\n\n      req2.onsuccess = function() {\n        self._db = req2.result\n        callback(null, self)\n      }\n\n      return\n    }\n\n    callback(null, self)\n  }\n}\n\nLevel.prototype._get = function(key, options, callback) {\n  options = xtend(this._idbOpts, options)\n\n  var origKey = key\n\n  // support binary keys for any iterable type via array (ArrayBuffers as keys are only supported in IndexedDB Second Edition)\n  if (options.keyEncoding === 'binary' && !Array.isArray(key)) key = Array.prototype.slice.call(key)\n\n  var tx = this._db.transaction(this._idbOpts.storeName)\n  var req = tx.objectStore(this._idbOpts.storeName).openCursor(IDBKeyRange.only(key))\n\n  tx.onabort = function() {\n    callback(tx.error)\n  }\n\n  req.onsuccess = function() {\n    var cursor = req.result\n    if (cursor) {\n      var value = cursor.value\n\n      // automatically convert Uint8Array values to Buffer\n      if (value instanceof Uint8Array) value = new Buffer(value)\n      if (options.valueEncoding === 'binary' && !Buffer.isBuffer(value)) value = new Buffer(value)\n\n      if (options.asBuffer && !Buffer.isBuffer(value)) {\n        if (value == null)                     value = new Buffer(0)\n        else if (typeof value === 'string')    value = new Buffer(value) // defaults to utf8, should the encoding be utf16? (DOMString)\n        else if (typeof value === 'boolean')   value = new Buffer(String(value)) // compatible with leveldb\n        else if (typeof value === 'number')    value = new Buffer(String(value)) // compatible with leveldb\n        else if (Array.isArray(value))         value = new Buffer(String(value)) // compatible with leveldb\n        else if (value instanceof Uint8Array)  value = new Buffer(value)\n        else return void callback(new TypeError('can\\'t coerce `' + value.constructor.name + '` into a Buffer'))\n      }\n      return void callback(null, value, origKey)\n    } else {\n      // 'NotFound' error, consistent with LevelDOWN API\n      return void callback(new Error('NotFound'))\n    }\n  }\n}\n\nLevel.prototype._del = function(key, options, callback) {\n  options = xtend(this._idbOpts, options)\n\n  // support binary keys for any iterable type via array (ArrayBuffers as keys are only supported in IndexedDB Second Edition)\n  if (options.keyEncoding === 'binary' && !Array.isArray(key)) key = Array.prototype.slice.call(key)\n\n  var mode = 'readwrite'\n  if (options.sync === true) {\n    mode = 'readwriteflush' // only supported in Firefox (with \"dom.indexedDB.experimental\" pref set to true)\n  }\n  var tx = this._db.transaction(this._idbOpts.storeName, mode)\n  var req = tx.objectStore(this._idbOpts.storeName).delete(key)\n\n  tx.onabort = function() {\n    callback(tx.error)\n  }\n\n  tx.oncomplete = function() {\n    callback()\n  }\n}\n\nLevel.prototype._put = function(key, value, options, callback) {\n  options = xtend(this._idbOpts, options)\n\n  // support binary keys for any iterable type via array (ArrayBuffers as keys are only supported in IndexedDB Second Edition)\n  if (options.keyEncoding === 'binary' && !Array.isArray(key)) key = Array.prototype.slice.call(key)\n\n  var mode = 'readwrite'\n  if (options.sync === true) {\n    mode = 'readwriteflush' // only supported in Firefox (with \"dom.indexedDB.experimental\" pref set to true)\n  }\n  var tx = this._db.transaction(this._idbOpts.storeName, mode)\n  var req = tx.objectStore(this._idbOpts.storeName).put(value, key)\n\n  tx.onabort = function() {\n    callback(tx.error)\n  }\n\n  tx.oncomplete = function() {\n    callback()\n  }\n}\n\nLevel.prototype._iterator = function(options) {\n  return new Iterator(this, options)\n}\n\n// only support sync: true on batch level, not operation level\nLevel.prototype._batch = function(array, options, callback) {\n  if (array.length === 0) return process.nextTick(callback)\n\n  var mode = 'readwrite'\n  if (options.sync === true) {\n    mode = 'readwriteflush' // only supported in Firefox (with \"dom.indexedDB.experimental\" pref set to true)\n  }\n  var tx = this._db.transaction(this._idbOpts.storeName, mode)\n  var store = tx.objectStore(this._idbOpts.storeName)\n\n  tx.onabort = function() {\n    callback(tx.error)\n  }\n\n  tx.oncomplete = function() {\n    callback()\n  }\n\n  array.forEach(function(currentOp) {\n    var opts = xtend(options, currentOp)\n\n    // support binary keys for any iterable type via array (ArrayBuffers as keys are only supported in IndexedDB Second Edition)\n    if (opts.keyEncoding === 'binary' && !Array.isArray(currentOp.key)) currentOp.key = Array.prototype.slice.call(currentOp.key)\n\n    if (currentOp.type === 'del') {\n      store.delete(currentOp.key)\n    } else {\n      store.put(currentOp.value, currentOp.key)\n    }\n  })\n}\n\nLevel.prototype._close = function (callback) {\n  this._db.close()\n  process.nextTick(callback)\n}\n\nLevel.prototype._approximateSize = function (start, end, callback) {\n  var err = new Error('Not implemented')\n  if (callback)\n    return void process.nextTick(function() {\n      callback(err)\n    })\n\n  throw err\n}\n\n/**\n * Destroy the object store and the database if no other object stores exist.\n *\n * @param {String|Object} location  Name of the database or a database instance.\n */\nLevel.destroy = function(db, callback) {\n  var idbOpts\n  if (db != null && typeof db === 'object') {\n    idbOpts = xtend({\n      location: db.location,\n      storeName: db.location\n    }, db._idbOpts)\n  } else if (typeof db === 'string') {\n    idbOpts = {\n      location: db,\n      storeName: db\n    }\n  } else {\n    throw new TypeError('location must be a string or an object')\n  }\n\n  if (typeof idbOpts.location !== 'string') throw new TypeError('location must be a string')\n  if (typeof idbOpts.storeName !== 'string') throw new TypeError('db.storeName must be a string')\n\n  var req = indexedDB.open(idbOpts.location) // use the databases current version\n\n  req.onerror = function(ev) {\n    callback(ev.target.error)\n  }\n\n  // if the database contains no other stores, delete the database as well\n  req.onsuccess = function() {\n    var db = req.result\n\n    function deleteDatabase(name) {\n      var req2 = indexedDB.deleteDatabase(name)\n      req2.onerror = function(ev) {\n        callback(ev.target.error)\n      }\n      req2.onsuccess = function() {\n        callback()\n      }\n    }\n\n    db.close()\n\n    if (db.objectStoreNames.length === 0) return void deleteDatabase(idbOpts.location)\n    if (!db.objectStoreNames.contains(idbOpts.storeName)) return void callback()\n\n    // delete object store, and if no object stores remain, delete database\n    var req2 = indexedDB.open(idbOpts.location, db.version + 1)\n\n    req2.onerror = function(ev) {\n      callback(ev.target.error)\n    }\n\n    req2.onupgradeneeded = function() {\n      db = req2.result\n      db.deleteObjectStore(idbOpts.storeName)\n    }\n\n    req2.onsuccess = function() {\n      db = req2.result\n      db.close()\n\n      if (db.objectStoreNames.length === 0) deleteDatabase(idbOpts.location)\n      else callback()\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/index.js\n// module id = 193\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multistream = __webpack_require__(288)\n\nmodule.exports = function protocolMuxer (protocols, conn) {\n  const ms = new multistream.Listener()\n\n  Object.keys(protocols).forEach((protocol) => {\n    if (!protocol) {\n      return\n    }\n\n    ms.addHandler(protocol, protocols[protocol].handlerFunc, protocols[protocol].matchFunc)\n  })\n\n  ms.handle(conn, (err) => {\n    if (err) {\n      // the multistream handshake failed\n    }\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/protocol-muxer.js\n// module id = 194\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/protocol-muxer.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\n// spec and table at: https://github.com/multiformats/multicodec\n\nexports = module.exports\n\n// Miscellaneous\nexports['raw'] = Buffer.from('55', 'hex')\n\n// bases encodings\nexports['base1'] = Buffer.from('01', 'hex')\nexports['base2'] = Buffer.from('00', 'hex')\nexports['base8'] = Buffer.from('07', 'hex')\nexports['base10'] = Buffer.from('09', 'hex')\n\n// Serialization formats\nexports['cbor'] = Buffer.from('51', 'hex')\nexports['protobuf'] = Buffer.from('50', 'hex')\nexports['rlp'] = Buffer.from('60', 'hex')\nexports['bencode'] = Buffer.from('63', 'hex')\n\n// Multiformats\nexports['multicodec'] = Buffer.from('30', 'hex')\nexports['multihash'] = Buffer.from('31', 'hex')\nexports['multiaddr'] = Buffer.from('32', 'hex')\nexports['multibase'] = Buffer.from('33', 'hex')\nexports['md4'] = Buffer.from('d4', 'hex')\nexports['md5'] = Buffer.from('d5', 'hex')\n\n// multihashes\nexports['sha1'] = Buffer.from('11', 'hex')\nexports['sha2-256'] = Buffer.from('12', 'hex')\nexports['sha2-512'] = Buffer.from('13', 'hex')\nexports['dbl-sha2-256'] = Buffer.from('56', 'hex')\nexports['sha3-224'] = Buffer.from('17', 'hex')\nexports['sha3-256'] = Buffer.from('16', 'hex')\nexports['sha3-384'] = Buffer.from('15', 'hex')\nexports['sha3-512'] = Buffer.from('14', 'hex')\nexports['shake-128'] = Buffer.from('18', 'hex')\nexports['shake-256'] = Buffer.from('19', 'hex')\nexports['keccak-224'] = Buffer.from('1a', 'hex')\nexports['keccak-256'] = Buffer.from('1b', 'hex')\nexports['keccak-384'] = Buffer.from('1c', 'hex')\nexports['keccak-512'] = Buffer.from('1d', 'hex')\nexports['murmur3'] = Buffer.from('22', 'hex')\nexports['blake2b-8'] = Buffer.from('b201', 'hex')\nexports['blake2b-16'] = Buffer.from('b202', 'hex')\nexports['blake2b-24'] = Buffer.from('b203', 'hex')\nexports['blake2b-32'] = Buffer.from('b204', 'hex')\nexports['blake2b-40'] = Buffer.from('b205', 'hex')\nexports['blake2b-48'] = Buffer.from('b206', 'hex')\nexports['blake2b-56'] = Buffer.from('b207', 'hex')\nexports['blake2b-64'] = Buffer.from('b208', 'hex')\nexports['blake2b-72'] = Buffer.from('b209', 'hex')\nexports['blake2b-80'] = Buffer.from('b20a', 'hex')\nexports['blake2b-88'] = Buffer.from('b20b', 'hex')\nexports['blake2b-96'] = Buffer.from('b20c', 'hex')\nexports['blake2b-104'] = Buffer.from('b20d', 'hex')\nexports['blake2b-112'] = Buffer.from('b20e', 'hex')\nexports['blake2b-120'] = Buffer.from('b20f', 'hex')\nexports['blake2b-128'] = Buffer.from('b210', 'hex')\nexports['blake2b-136'] = Buffer.from('b211', 'hex')\nexports['blake2b-144'] = Buffer.from('b212', 'hex')\nexports['blake2b-152'] = Buffer.from('b213', 'hex')\nexports['blake2b-160'] = Buffer.from('b214', 'hex')\nexports['blake2b-168'] = Buffer.from('b215', 'hex')\nexports['blake2b-176'] = Buffer.from('b216', 'hex')\nexports['blake2b-184'] = Buffer.from('b217', 'hex')\nexports['blake2b-192'] = Buffer.from('b218', 'hex')\nexports['blake2b-200'] = Buffer.from('b219', 'hex')\nexports['blake2b-208'] = Buffer.from('b21a', 'hex')\nexports['blake2b-216'] = Buffer.from('b21b', 'hex')\nexports['blake2b-224'] = Buffer.from('b21c', 'hex')\nexports['blake2b-232'] = Buffer.from('b21d', 'hex')\nexports['blake2b-240'] = Buffer.from('b21e', 'hex')\nexports['blake2b-248'] = Buffer.from('b21f', 'hex')\nexports['blake2b-256'] = Buffer.from('b220', 'hex')\nexports['blake2b-264'] = Buffer.from('b221', 'hex')\nexports['blake2b-272'] = Buffer.from('b222', 'hex')\nexports['blake2b-280'] = Buffer.from('b223', 'hex')\nexports['blake2b-288'] = Buffer.from('b224', 'hex')\nexports['blake2b-296'] = Buffer.from('b225', 'hex')\nexports['blake2b-304'] = Buffer.from('b226', 'hex')\nexports['blake2b-312'] = Buffer.from('b227', 'hex')\nexports['blake2b-320'] = Buffer.from('b228', 'hex')\nexports['blake2b-328'] = Buffer.from('b229', 'hex')\nexports['blake2b-336'] = Buffer.from('b22a', 'hex')\nexports['blake2b-344'] = Buffer.from('b22b', 'hex')\nexports['blake2b-352'] = Buffer.from('b22c', 'hex')\nexports['blake2b-360'] = Buffer.from('b22d', 'hex')\nexports['blake2b-368'] = Buffer.from('b22e', 'hex')\nexports['blake2b-376'] = Buffer.from('b22f', 'hex')\nexports['blake2b-384'] = Buffer.from('b230', 'hex')\nexports['blake2b-392'] = Buffer.from('b231', 'hex')\nexports['blake2b-400'] = Buffer.from('b232', 'hex')\nexports['blake2b-408'] = Buffer.from('b233', 'hex')\nexports['blake2b-416'] = Buffer.from('b234', 'hex')\nexports['blake2b-424'] = Buffer.from('b235', 'hex')\nexports['blake2b-432'] = Buffer.from('b236', 'hex')\nexports['blake2b-440'] = Buffer.from('b237', 'hex')\nexports['blake2b-448'] = Buffer.from('b238', 'hex')\nexports['blake2b-456'] = Buffer.from('b239', 'hex')\nexports['blake2b-464'] = Buffer.from('b23a', 'hex')\nexports['blake2b-472'] = Buffer.from('b23b', 'hex')\nexports['blake2b-480'] = Buffer.from('b23c', 'hex')\nexports['blake2b-488'] = Buffer.from('b23d', 'hex')\nexports['blake2b-496'] = Buffer.from('b23e', 'hex')\nexports['blake2b-504'] = Buffer.from('b23f', 'hex')\nexports['blake2b-512'] = Buffer.from('b240', 'hex')\nexports['blake2s-8'] = Buffer.from('b241', 'hex')\nexports['blake2s-16'] = Buffer.from('b242', 'hex')\nexports['blake2s-24'] = Buffer.from('b243', 'hex')\nexports['blake2s-32'] = Buffer.from('b244', 'hex')\nexports['blake2s-40'] = Buffer.from('b245', 'hex')\nexports['blake2s-48'] = Buffer.from('b246', 'hex')\nexports['blake2s-56'] = Buffer.from('b247', 'hex')\nexports['blake2s-64'] = Buffer.from('b248', 'hex')\nexports['blake2s-72'] = Buffer.from('b249', 'hex')\nexports['blake2s-80'] = Buffer.from('b24a', 'hex')\nexports['blake2s-88'] = Buffer.from('b24b', 'hex')\nexports['blake2s-96'] = Buffer.from('b24c', 'hex')\nexports['blake2s-104'] = Buffer.from('b24d', 'hex')\nexports['blake2s-112'] = Buffer.from('b24e', 'hex')\nexports['blake2s-120'] = Buffer.from('b24f', 'hex')\nexports['blake2s-128'] = Buffer.from('b250', 'hex')\nexports['blake2s-136'] = Buffer.from('b251', 'hex')\nexports['blake2s-144'] = Buffer.from('b252', 'hex')\nexports['blake2s-152'] = Buffer.from('b253', 'hex')\nexports['blake2s-160'] = Buffer.from('b254', 'hex')\nexports['blake2s-168'] = Buffer.from('b255', 'hex')\nexports['blake2s-176'] = Buffer.from('b256', 'hex')\nexports['blake2s-184'] = Buffer.from('b257', 'hex')\nexports['blake2s-192'] = Buffer.from('b258', 'hex')\nexports['blake2s-200'] = Buffer.from('b259', 'hex')\nexports['blake2s-208'] = Buffer.from('b25a', 'hex')\nexports['blake2s-216'] = Buffer.from('b25b', 'hex')\nexports['blake2s-224'] = Buffer.from('b25c', 'hex')\nexports['blake2s-232'] = Buffer.from('b25d', 'hex')\nexports['blake2s-240'] = Buffer.from('b25e', 'hex')\nexports['blake2s-248'] = Buffer.from('b25f', 'hex')\nexports['blake2s-256'] = Buffer.from('b260', 'hex')\nexports['skein256-8'] = Buffer.from('b301', 'hex')\nexports['skein256-16'] = Buffer.from('b302', 'hex')\nexports['skein256-24'] = Buffer.from('b303', 'hex')\nexports['skein256-32'] = Buffer.from('b304', 'hex')\nexports['skein256-40'] = Buffer.from('b305', 'hex')\nexports['skein256-48'] = Buffer.from('b306', 'hex')\nexports['skein256-56'] = Buffer.from('b307', 'hex')\nexports['skein256-64'] = Buffer.from('b308', 'hex')\nexports['skein256-72'] = Buffer.from('b309', 'hex')\nexports['skein256-80'] = Buffer.from('b30a', 'hex')\nexports['skein256-88'] = Buffer.from('b30b', 'hex')\nexports['skein256-96'] = Buffer.from('b30c', 'hex')\nexports['skein256-104'] = Buffer.from('b30d', 'hex')\nexports['skein256-112'] = Buffer.from('b30e', 'hex')\nexports['skein256-120'] = Buffer.from('b30f', 'hex')\nexports['skein256-128'] = Buffer.from('b310', 'hex')\nexports['skein256-136'] = Buffer.from('b311', 'hex')\nexports['skein256-144'] = Buffer.from('b312', 'hex')\nexports['skein256-152'] = Buffer.from('b313', 'hex')\nexports['skein256-160'] = Buffer.from('b314', 'hex')\nexports['skein256-168'] = Buffer.from('b315', 'hex')\nexports['skein256-176'] = Buffer.from('b316', 'hex')\nexports['skein256-184'] = Buffer.from('b317', 'hex')\nexports['skein256-192'] = Buffer.from('b318', 'hex')\nexports['skein256-200'] = Buffer.from('b319', 'hex')\nexports['skein256-208'] = Buffer.from('b31a', 'hex')\nexports['skein256-216'] = Buffer.from('b31b', 'hex')\nexports['skein256-224'] = Buffer.from('b31c', 'hex')\nexports['skein256-232'] = Buffer.from('b31d', 'hex')\nexports['skein256-240'] = Buffer.from('b31e', 'hex')\nexports['skein256-248'] = Buffer.from('b31f', 'hex')\nexports['skein256-256'] = Buffer.from('b320', 'hex')\nexports['skein512-8'] = Buffer.from('b321', 'hex')\nexports['skein512-16'] = Buffer.from('b322', 'hex')\nexports['skein512-24'] = Buffer.from('b323', 'hex')\nexports['skein512-32'] = Buffer.from('b324', 'hex')\nexports['skein512-40'] = Buffer.from('b325', 'hex')\nexports['skein512-48'] = Buffer.from('b326', 'hex')\nexports['skein512-56'] = Buffer.from('b327', 'hex')\nexports['skein512-64'] = Buffer.from('b328', 'hex')\nexports['skein512-72'] = Buffer.from('b329', 'hex')\nexports['skein512-80'] = Buffer.from('b32a', 'hex')\nexports['skein512-88'] = Buffer.from('b32b', 'hex')\nexports['skein512-96'] = Buffer.from('b32c', 'hex')\nexports['skein512-104'] = Buffer.from('b32d', 'hex')\nexports['skein512-112'] = Buffer.from('b32e', 'hex')\nexports['skein512-120'] = Buffer.from('b32f', 'hex')\nexports['skein512-128'] = Buffer.from('b330', 'hex')\nexports['skein512-136'] = Buffer.from('b331', 'hex')\nexports['skein512-144'] = Buffer.from('b332', 'hex')\nexports['skein512-152'] = Buffer.from('b333', 'hex')\nexports['skein512-160'] = Buffer.from('b334', 'hex')\nexports['skein512-168'] = Buffer.from('b335', 'hex')\nexports['skein512-176'] = Buffer.from('b336', 'hex')\nexports['skein512-184'] = Buffer.from('b337', 'hex')\nexports['skein512-192'] = Buffer.from('b338', 'hex')\nexports['skein512-200'] = Buffer.from('b339', 'hex')\nexports['skein512-208'] = Buffer.from('b33a', 'hex')\nexports['skein512-216'] = Buffer.from('b33b', 'hex')\nexports['skein512-224'] = Buffer.from('b33c', 'hex')\nexports['skein512-232'] = Buffer.from('b33d', 'hex')\nexports['skein512-240'] = Buffer.from('b33e', 'hex')\nexports['skein512-248'] = Buffer.from('b33f', 'hex')\nexports['skein512-256'] = Buffer.from('b340', 'hex')\nexports['skein512-264'] = Buffer.from('b341', 'hex')\nexports['skein512-272'] = Buffer.from('b342', 'hex')\nexports['skein512-280'] = Buffer.from('b343', 'hex')\nexports['skein512-288'] = Buffer.from('b344', 'hex')\nexports['skein512-296'] = Buffer.from('b345', 'hex')\nexports['skein512-304'] = Buffer.from('b346', 'hex')\nexports['skein512-312'] = Buffer.from('b347', 'hex')\nexports['skein512-320'] = Buffer.from('b348', 'hex')\nexports['skein512-328'] = Buffer.from('b349', 'hex')\nexports['skein512-336'] = Buffer.from('b34a', 'hex')\nexports['skein512-344'] = Buffer.from('b34b', 'hex')\nexports['skein512-352'] = Buffer.from('b34c', 'hex')\nexports['skein512-360'] = Buffer.from('b34d', 'hex')\nexports['skein512-368'] = Buffer.from('b34e', 'hex')\nexports['skein512-376'] = Buffer.from('b34f', 'hex')\nexports['skein512-384'] = Buffer.from('b350', 'hex')\nexports['skein512-392'] = Buffer.from('b351', 'hex')\nexports['skein512-400'] = Buffer.from('b352', 'hex')\nexports['skein512-408'] = Buffer.from('b353', 'hex')\nexports['skein512-416'] = Buffer.from('b354', 'hex')\nexports['skein512-424'] = Buffer.from('b355', 'hex')\nexports['skein512-432'] = Buffer.from('b356', 'hex')\nexports['skein512-440'] = Buffer.from('b357', 'hex')\nexports['skein512-448'] = Buffer.from('b358', 'hex')\nexports['skein512-456'] = Buffer.from('b359', 'hex')\nexports['skein512-464'] = Buffer.from('b35a', 'hex')\nexports['skein512-472'] = Buffer.from('b35b', 'hex')\nexports['skein512-480'] = Buffer.from('b35c', 'hex')\nexports['skein512-488'] = Buffer.from('b35d', 'hex')\nexports['skein512-496'] = Buffer.from('b35e', 'hex')\nexports['skein512-504'] = Buffer.from('b35f', 'hex')\nexports['skein512-512'] = Buffer.from('b360', 'hex')\nexports['skein1024-8'] = Buffer.from('b361', 'hex')\nexports['skein1024-16'] = Buffer.from('b362', 'hex')\nexports['skein1024-24'] = Buffer.from('b363', 'hex')\nexports['skein1024-32'] = Buffer.from('b364', 'hex')\nexports['skein1024-40'] = Buffer.from('b365', 'hex')\nexports['skein1024-48'] = Buffer.from('b366', 'hex')\nexports['skein1024-56'] = Buffer.from('b367', 'hex')\nexports['skein1024-64'] = Buffer.from('b368', 'hex')\nexports['skein1024-72'] = Buffer.from('b369', 'hex')\nexports['skein1024-80'] = Buffer.from('b36a', 'hex')\nexports['skein1024-88'] = Buffer.from('b36b', 'hex')\nexports['skein1024-96'] = Buffer.from('b36c', 'hex')\nexports['skein1024-104'] = Buffer.from('b36d', 'hex')\nexports['skein1024-112'] = Buffer.from('b36e', 'hex')\nexports['skein1024-120'] = Buffer.from('b36f', 'hex')\nexports['skein1024-128'] = Buffer.from('b370', 'hex')\nexports['skein1024-136'] = Buffer.from('b371', 'hex')\nexports['skein1024-144'] = Buffer.from('b372', 'hex')\nexports['skein1024-152'] = Buffer.from('b373', 'hex')\nexports['skein1024-160'] = Buffer.from('b374', 'hex')\nexports['skein1024-168'] = Buffer.from('b375', 'hex')\nexports['skein1024-176'] = Buffer.from('b376', 'hex')\nexports['skein1024-184'] = Buffer.from('b377', 'hex')\nexports['skein1024-192'] = Buffer.from('b378', 'hex')\nexports['skein1024-200'] = Buffer.from('b379', 'hex')\nexports['skein1024-208'] = Buffer.from('b37a', 'hex')\nexports['skein1024-216'] = Buffer.from('b37b', 'hex')\nexports['skein1024-224'] = Buffer.from('b37c', 'hex')\nexports['skein1024-232'] = Buffer.from('b37d', 'hex')\nexports['skein1024-240'] = Buffer.from('b37e', 'hex')\nexports['skein1024-248'] = Buffer.from('b37f', 'hex')\nexports['skein1024-256'] = Buffer.from('b380', 'hex')\nexports['skein1024-264'] = Buffer.from('b381', 'hex')\nexports['skein1024-272'] = Buffer.from('b382', 'hex')\nexports['skein1024-280'] = Buffer.from('b383', 'hex')\nexports['skein1024-288'] = Buffer.from('b384', 'hex')\nexports['skein1024-296'] = Buffer.from('b385', 'hex')\nexports['skein1024-304'] = Buffer.from('b386', 'hex')\nexports['skein1024-312'] = Buffer.from('b387', 'hex')\nexports['skein1024-320'] = Buffer.from('b388', 'hex')\nexports['skein1024-328'] = Buffer.from('b389', 'hex')\nexports['skein1024-336'] = Buffer.from('b38a', 'hex')\nexports['skein1024-344'] = Buffer.from('b38b', 'hex')\nexports['skein1024-352'] = Buffer.from('b38c', 'hex')\nexports['skein1024-360'] = Buffer.from('b38d', 'hex')\nexports['skein1024-368'] = Buffer.from('b38e', 'hex')\nexports['skein1024-376'] = Buffer.from('b38f', 'hex')\nexports['skein1024-384'] = Buffer.from('b390', 'hex')\nexports['skein1024-392'] = Buffer.from('b391', 'hex')\nexports['skein1024-400'] = Buffer.from('b392', 'hex')\nexports['skein1024-408'] = Buffer.from('b393', 'hex')\nexports['skein1024-416'] = Buffer.from('b394', 'hex')\nexports['skein1024-424'] = Buffer.from('b395', 'hex')\nexports['skein1024-432'] = Buffer.from('b396', 'hex')\nexports['skein1024-440'] = Buffer.from('b397', 'hex')\nexports['skein1024-448'] = Buffer.from('b398', 'hex')\nexports['skein1024-456'] = Buffer.from('b399', 'hex')\nexports['skein1024-464'] = Buffer.from('b39a', 'hex')\nexports['skein1024-472'] = Buffer.from('b39b', 'hex')\nexports['skein1024-480'] = Buffer.from('b39c', 'hex')\nexports['skein1024-488'] = Buffer.from('b39d', 'hex')\nexports['skein1024-496'] = Buffer.from('b39e', 'hex')\nexports['skein1024-504'] = Buffer.from('b39f', 'hex')\nexports['skein1024-512'] = Buffer.from('b3a0', 'hex')\nexports['skein1024-520'] = Buffer.from('b3a1', 'hex')\nexports['skein1024-528'] = Buffer.from('b3a2', 'hex')\nexports['skein1024-536'] = Buffer.from('b3a3', 'hex')\nexports['skein1024-544'] = Buffer.from('b3a4', 'hex')\nexports['skein1024-552'] = Buffer.from('b3a5', 'hex')\nexports['skein1024-560'] = Buffer.from('b3a6', 'hex')\nexports['skein1024-568'] = Buffer.from('b3a7', 'hex')\nexports['skein1024-576'] = Buffer.from('b3a8', 'hex')\nexports['skein1024-584'] = Buffer.from('b3a9', 'hex')\nexports['skein1024-592'] = Buffer.from('b3aa', 'hex')\nexports['skein1024-600'] = Buffer.from('b3ab', 'hex')\nexports['skein1024-608'] = Buffer.from('b3ac', 'hex')\nexports['skein1024-616'] = Buffer.from('b3ad', 'hex')\nexports['skein1024-624'] = Buffer.from('b3ae', 'hex')\nexports['skein1024-632'] = Buffer.from('b3af', 'hex')\nexports['skein1024-640'] = Buffer.from('b3b0', 'hex')\nexports['skein1024-648'] = Buffer.from('b3b1', 'hex')\nexports['skein1024-656'] = Buffer.from('b3b2', 'hex')\nexports['skein1024-664'] = Buffer.from('b3b3', 'hex')\nexports['skein1024-672'] = Buffer.from('b3b4', 'hex')\nexports['skein1024-680'] = Buffer.from('b3b5', 'hex')\nexports['skein1024-688'] = Buffer.from('b3b6', 'hex')\nexports['skein1024-696'] = Buffer.from('b3b7', 'hex')\nexports['skein1024-704'] = Buffer.from('b3b8', 'hex')\nexports['skein1024-712'] = Buffer.from('b3b9', 'hex')\nexports['skein1024-720'] = Buffer.from('b3ba', 'hex')\nexports['skein1024-728'] = Buffer.from('b3bb', 'hex')\nexports['skein1024-736'] = Buffer.from('b3bc', 'hex')\nexports['skein1024-744'] = Buffer.from('b3bd', 'hex')\nexports['skein1024-752'] = Buffer.from('b3be', 'hex')\nexports['skein1024-760'] = Buffer.from('b3bf', 'hex')\nexports['skein1024-768'] = Buffer.from('b3c0', 'hex')\nexports['skein1024-776'] = Buffer.from('b3c1', 'hex')\nexports['skein1024-784'] = Buffer.from('b3c2', 'hex')\nexports['skein1024-792'] = Buffer.from('b3c3', 'hex')\nexports['skein1024-800'] = Buffer.from('b3c4', 'hex')\nexports['skein1024-808'] = Buffer.from('b3c5', 'hex')\nexports['skein1024-816'] = Buffer.from('b3c6', 'hex')\nexports['skein1024-824'] = Buffer.from('b3c7', 'hex')\nexports['skein1024-832'] = Buffer.from('b3c8', 'hex')\nexports['skein1024-840'] = Buffer.from('b3c9', 'hex')\nexports['skein1024-848'] = Buffer.from('b3ca', 'hex')\nexports['skein1024-856'] = Buffer.from('b3cb', 'hex')\nexports['skein1024-864'] = Buffer.from('b3cc', 'hex')\nexports['skein1024-872'] = Buffer.from('b3cd', 'hex')\nexports['skein1024-880'] = Buffer.from('b3ce', 'hex')\nexports['skein1024-888'] = Buffer.from('b3cf', 'hex')\nexports['skein1024-896'] = Buffer.from('b3d0', 'hex')\nexports['skein1024-904'] = Buffer.from('b3d1', 'hex')\nexports['skein1024-912'] = Buffer.from('b3d2', 'hex')\nexports['skein1024-920'] = Buffer.from('b3d3', 'hex')\nexports['skein1024-928'] = Buffer.from('b3d4', 'hex')\nexports['skein1024-936'] = Buffer.from('b3d5', 'hex')\nexports['skein1024-944'] = Buffer.from('b3d6', 'hex')\nexports['skein1024-952'] = Buffer.from('b3d7', 'hex')\nexports['skein1024-960'] = Buffer.from('b3d8', 'hex')\nexports['skein1024-968'] = Buffer.from('b3d9', 'hex')\nexports['skein1024-976'] = Buffer.from('b3da', 'hex')\nexports['skein1024-984'] = Buffer.from('b3db', 'hex')\nexports['skein1024-992'] = Buffer.from('b3dc', 'hex')\nexports['skein1024-1000'] = Buffer.from('b3dd', 'hex')\nexports['skein1024-1008'] = Buffer.from('b3de', 'hex')\nexports['skein1024-1016'] = Buffer.from('b3df', 'hex')\nexports['skein1024-1024'] = Buffer.from('b3e0', 'hex')\n\n// multiaddrs\nexports['ip4'] = Buffer.from('04', 'hex')\nexports['ip6'] = Buffer.from('29', 'hex')\nexports['tcp'] = Buffer.from('06', 'hex')\nexports['udp'] = Buffer.from('0111', 'hex')\nexports['dccp'] = Buffer.from('21', 'hex')\nexports['sctp'] = Buffer.from('84', 'hex')\nexports['udt'] = Buffer.from('012d', 'hex')\nexports['utp'] = Buffer.from('012e', 'hex')\nexports['ipfs'] = Buffer.from('01a5', 'hex')\nexports['http'] = Buffer.from('01e0', 'hex')\nexports['https'] = Buffer.from('01bb', 'hex')\nexports['quic'] = Buffer.from('01cc', 'hex')\nexports['ws'] = Buffer.from('01dd', 'hex')\nexports['onion'] = Buffer.from('01bc', 'hex')\nexports['p2p-circuit'] = Buffer.from('0122', 'hex')\n\n// archiving formats\n\n// image formats\n\n// video formats\n\n// VCS formats\nexports['git-raw'] = Buffer.from('78', 'hex')\n\n// IPLD formats\nexports['dag-pb'] = Buffer.from('70', 'hex')\nexports['dag-cbor'] = Buffer.from('71', 'hex')\nexports['git-raw'] = Buffer.from('78', 'hex')\nexports['eth-block'] = Buffer.from('90', 'hex')\nexports['eth-block-list'] = Buffer.from('91', 'hex')\nexports['eth-tx-trie'] = Buffer.from('92', 'hex')\nexports['eth-tx'] = Buffer.from('93', 'hex')\nexports['eth-tx-receipt-trie'] = Buffer.from('94', 'hex')\nexports['eth-tx-receipt'] = Buffer.from('95', 'hex')\nexports['eth-state-trie'] = Buffer.from('96', 'hex')\nexports['eth-account-snapshot'] = Buffer.from('97', 'hex')\nexports['eth-storage-trie'] = Buffer.from('98', 'hex')\n\nexports['bitcoin-block'] = Buffer.from('b0', 'hex')\nexports['bitcoin-tx'] = Buffer.from('b1', 'hex')\nexports['zcash-block'] = Buffer.from('c0', 'hex')\nexports['zcash-tx'] = Buffer.from('c1', 'hex')\nexports['stellar-block'] = Buffer.from('d0', 'hex')\nexports['stellar-tx'] = Buffer.from('d1', 'hex')\n\nexports['torrent-info'] = Buffer.from('7b', 'hex')\nexports['torrent-file'] = Buffer.from('7c', 'hex')\nexports['ed25519-pub'] = Buffer.from('ed', 'hex')\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multicodec/src/base-table.js\n// module id = 195\n// module chunks = 0\n\n//# sourceURL=../node_modules/multicodec/src/base-table.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(6)\nconst pullLP = __webpack_require__(45)\nconst debug = __webpack_require__(5)\n\nexports = module.exports\n\nfunction randomId () {\n  return ((~~(Math.random() * 1e9)).toString(36))\n}\n\n// prefixes a message with a varint\n// TODO this is a pull-stream 'creep' (pull stream to add a byte?')\nfunction encode (msg, callback) {\n  const values = Buffer.isBuffer(msg) ? [msg] : [Buffer.from(msg)]\n\n  pull(\n    pull.values(values),\n    pullLP.encode(),\n    pull.collect((err, encoded) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, encoded[0])\n    })\n  )\n}\n\nexports.writeEncoded = (writer, msg, callback) => {\n  encode(msg, (err, msg) => {\n    if (err) {\n      return callback(err)\n    }\n    writer.write(msg)\n  })\n}\n\nfunction createLogger (type) {\n  const rId = randomId()\n\n  function printer (logger) {\n    return (msg) => {\n      if (Array.isArray(msg)) {\n        msg = msg.join(' ')\n      }\n      logger('(%s) %s', rId, msg)\n    }\n  }\n\n  const log = printer(debug('mss:' + type))\n  log.error = printer(debug('mss:' + type + ':error'))\n\n  return log\n}\n\nexports.log = {}\n\nexports.log.dialer = () => {\n  return createLogger('dialer\\t')\n}\nexports.log.listener = () => {\n  return createLogger('listener\\t')\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/util.js\n// module id = 196\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/util.js")},function(module,exports,__webpack_require__){eval("/**\n * DES (Data Encryption Standard) implementation.\n *\n * This implementation supports DES as well as 3DES-EDE in ECB and CBC mode.\n * It is based on the BSD-licensed implementation by Paul Tero:\n *\n * Paul Tero, July 2001\n * http://www.tero.co.uk/des/\n *\n * Optimised for performance with large blocks by Michael Hayworth, November 2001\n * http://www.netdealing.com\n *\n * THIS SOFTWARE IS PROVIDED \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * @author Stefan Siegl\n * @author Dave Longley\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n * Copyright (c) 2012-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(289);\n__webpack_require__(481);\n__webpack_require__(9);\n\n/* DES API */\nmodule.exports = forge.des = forge.des || {};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('DES-<mode>', key);\n * cipher.start({iv: iv});\n *\n * Creates an DES cipher object to encrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as binary-encoded strings of bytes or\n * byte buffers.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC' if IV is\n *          given, 'ECB' if null).\n *\n * @return the cipher.\n */\nforge.des.startEncrypting = function(key, iv, output, mode) {\n  var cipher = _createCipher({\n    key: key,\n    output: output,\n    decrypt: false,\n    mode: mode || (iv === null ? 'ECB' : 'CBC')\n  });\n  cipher.start(iv);\n  return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var cipher = forge.cipher.createCipher('DES-<mode>', key);\n *\n * Creates an DES cipher object to encrypt data using the given symmetric key.\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.des.createEncryptionCipher = function(key, mode) {\n  return _createCipher({\n    key: key,\n    output: null,\n    decrypt: false,\n    mode: mode\n  });\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('DES-<mode>', key);\n * decipher.start({iv: iv});\n *\n * Creates an DES cipher object to decrypt data using the given symmetric key.\n * The output will be stored in the 'output' member of the returned cipher.\n *\n * The key and iv may be given as binary-encoded strings of bytes or\n * byte buffers.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n * @param mode the cipher mode to use (default: 'CBC' if IV is\n *          given, 'ECB' if null).\n *\n * @return the cipher.\n */\nforge.des.startDecrypting = function(key, iv, output, mode) {\n  var cipher = _createCipher({\n    key: key,\n    output: output,\n    decrypt: true,\n    mode: mode || (iv === null ? 'ECB' : 'CBC')\n  });\n  cipher.start(iv);\n  return cipher;\n};\n\n/**\n * Deprecated. Instead, use:\n *\n * var decipher = forge.cipher.createDecipher('DES-<mode>', key);\n *\n * Creates an DES cipher object to decrypt data using the given symmetric key.\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param key the symmetric key to use (64 or 192 bits).\n * @param mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nforge.des.createDecryptionCipher = function(key, mode) {\n  return _createCipher({\n    key: key,\n    output: null,\n    decrypt: true,\n    mode: mode\n  });\n};\n\n/**\n * Creates a new DES cipher algorithm object.\n *\n * @param name the name of the algorithm.\n * @param mode the mode factory function.\n *\n * @return the DES algorithm object.\n */\nforge.des.Algorithm = function(name, mode) {\n  var self = this;\n  self.name = name;\n  self.mode = new mode({\n    blockSize: 8,\n    cipher: {\n      encrypt: function(inBlock, outBlock) {\n        return _updateBlock(self._keys, inBlock, outBlock, false);\n      },\n      decrypt: function(inBlock, outBlock) {\n        return _updateBlock(self._keys, inBlock, outBlock, true);\n      }\n    }\n  });\n  self._init = false;\n};\n\n/**\n * Initializes this DES algorithm by expanding its key.\n *\n * @param options the options to use.\n *          key the key to use with this algorithm.\n *          decrypt true if the algorithm should be initialized for decryption,\n *            false for encryption.\n */\nforge.des.Algorithm.prototype.initialize = function(options) {\n  if(this._init) {\n    return;\n  }\n\n  var key = forge.util.createBuffer(options.key);\n  if(this.name.indexOf('3DES') === 0) {\n    if(key.length() !== 24) {\n      throw new Error('Invalid Triple-DES key size: ' + key.length() * 8);\n    }\n  }\n\n  // do key expansion to 16 or 48 subkeys (single or triple DES)\n  this._keys = _createKeys(key);\n  this._init = true;\n};\n\n/** Register DES algorithms **/\n\nregisterAlgorithm('DES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('DES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('DES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('DES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('DES-CTR', forge.cipher.modes.ctr);\n\nregisterAlgorithm('3DES-ECB', forge.cipher.modes.ecb);\nregisterAlgorithm('3DES-CBC', forge.cipher.modes.cbc);\nregisterAlgorithm('3DES-CFB', forge.cipher.modes.cfb);\nregisterAlgorithm('3DES-OFB', forge.cipher.modes.ofb);\nregisterAlgorithm('3DES-CTR', forge.cipher.modes.ctr);\n\nfunction registerAlgorithm(name, mode) {\n  var factory = function() {\n    return new forge.des.Algorithm(name, mode);\n  };\n  forge.cipher.registerAlgorithm(name, factory);\n}\n\n/** DES implementation **/\n\nvar spfunction1 = [0x1010400,0,0x10000,0x1010404,0x1010004,0x10404,0x4,0x10000,0x400,0x1010400,0x1010404,0x400,0x1000404,0x1010004,0x1000000,0x4,0x404,0x1000400,0x1000400,0x10400,0x10400,0x1010000,0x1010000,0x1000404,0x10004,0x1000004,0x1000004,0x10004,0,0x404,0x10404,0x1000000,0x10000,0x1010404,0x4,0x1010000,0x1010400,0x1000000,0x1000000,0x400,0x1010004,0x10000,0x10400,0x1000004,0x400,0x4,0x1000404,0x10404,0x1010404,0x10004,0x1010000,0x1000404,0x1000004,0x404,0x10404,0x1010400,0x404,0x1000400,0x1000400,0,0x10004,0x10400,0,0x1010004];\nvar spfunction2 = [-0x7fef7fe0,-0x7fff8000,0x8000,0x108020,0x100000,0x20,-0x7fefffe0,-0x7fff7fe0,-0x7fffffe0,-0x7fef7fe0,-0x7fef8000,-0x80000000,-0x7fff8000,0x100000,0x20,-0x7fefffe0,0x108000,0x100020,-0x7fff7fe0,0,-0x80000000,0x8000,0x108020,-0x7ff00000,0x100020,-0x7fffffe0,0,0x108000,0x8020,-0x7fef8000,-0x7ff00000,0x8020,0,0x108020,-0x7fefffe0,0x100000,-0x7fff7fe0,-0x7ff00000,-0x7fef8000,0x8000,-0x7ff00000,-0x7fff8000,0x20,-0x7fef7fe0,0x108020,0x20,0x8000,-0x80000000,0x8020,-0x7fef8000,0x100000,-0x7fffffe0,0x100020,-0x7fff7fe0,-0x7fffffe0,0x100020,0x108000,0,-0x7fff8000,0x8020,-0x80000000,-0x7fefffe0,-0x7fef7fe0,0x108000];\nvar spfunction3 = [0x208,0x8020200,0,0x8020008,0x8000200,0,0x20208,0x8000200,0x20008,0x8000008,0x8000008,0x20000,0x8020208,0x20008,0x8020000,0x208,0x8000000,0x8,0x8020200,0x200,0x20200,0x8020000,0x8020008,0x20208,0x8000208,0x20200,0x20000,0x8000208,0x8,0x8020208,0x200,0x8000000,0x8020200,0x8000000,0x20008,0x208,0x20000,0x8020200,0x8000200,0,0x200,0x20008,0x8020208,0x8000200,0x8000008,0x200,0,0x8020008,0x8000208,0x20000,0x8000000,0x8020208,0x8,0x20208,0x20200,0x8000008,0x8020000,0x8000208,0x208,0x8020000,0x20208,0x8,0x8020008,0x20200];\nvar spfunction4 = [0x802001,0x2081,0x2081,0x80,0x802080,0x800081,0x800001,0x2001,0,0x802000,0x802000,0x802081,0x81,0,0x800080,0x800001,0x1,0x2000,0x800000,0x802001,0x80,0x800000,0x2001,0x2080,0x800081,0x1,0x2080,0x800080,0x2000,0x802080,0x802081,0x81,0x800080,0x800001,0x802000,0x802081,0x81,0,0,0x802000,0x2080,0x800080,0x800081,0x1,0x802001,0x2081,0x2081,0x80,0x802081,0x81,0x1,0x2000,0x800001,0x2001,0x802080,0x800081,0x2001,0x2080,0x800000,0x802001,0x80,0x800000,0x2000,0x802080];\nvar spfunction5 = [0x100,0x2080100,0x2080000,0x42000100,0x80000,0x100,0x40000000,0x2080000,0x40080100,0x80000,0x2000100,0x40080100,0x42000100,0x42080000,0x80100,0x40000000,0x2000000,0x40080000,0x40080000,0,0x40000100,0x42080100,0x42080100,0x2000100,0x42080000,0x40000100,0,0x42000000,0x2080100,0x2000000,0x42000000,0x80100,0x80000,0x42000100,0x100,0x2000000,0x40000000,0x2080000,0x42000100,0x40080100,0x2000100,0x40000000,0x42080000,0x2080100,0x40080100,0x100,0x2000000,0x42080000,0x42080100,0x80100,0x42000000,0x42080100,0x2080000,0,0x40080000,0x42000000,0x80100,0x2000100,0x40000100,0x80000,0,0x40080000,0x2080100,0x40000100];\nvar spfunction6 = [0x20000010,0x20400000,0x4000,0x20404010,0x20400000,0x10,0x20404010,0x400000,0x20004000,0x404010,0x400000,0x20000010,0x400010,0x20004000,0x20000000,0x4010,0,0x400010,0x20004010,0x4000,0x404000,0x20004010,0x10,0x20400010,0x20400010,0,0x404010,0x20404000,0x4010,0x404000,0x20404000,0x20000000,0x20004000,0x10,0x20400010,0x404000,0x20404010,0x400000,0x4010,0x20000010,0x400000,0x20004000,0x20000000,0x4010,0x20000010,0x20404010,0x404000,0x20400000,0x404010,0x20404000,0,0x20400010,0x10,0x4000,0x20400000,0x404010,0x4000,0x400010,0x20004010,0,0x20404000,0x20000000,0x400010,0x20004010];\nvar spfunction7 = [0x200000,0x4200002,0x4000802,0,0x800,0x4000802,0x200802,0x4200800,0x4200802,0x200000,0,0x4000002,0x2,0x4000000,0x4200002,0x802,0x4000800,0x200802,0x200002,0x4000800,0x4000002,0x4200000,0x4200800,0x200002,0x4200000,0x800,0x802,0x4200802,0x200800,0x2,0x4000000,0x200800,0x4000000,0x200800,0x200000,0x4000802,0x4000802,0x4200002,0x4200002,0x2,0x200002,0x4000000,0x4000800,0x200000,0x4200800,0x802,0x200802,0x4200800,0x802,0x4000002,0x4200802,0x4200000,0x200800,0,0x2,0x4200802,0,0x200802,0x4200000,0x800,0x4000002,0x4000800,0x800,0x200002];\nvar spfunction8 = [0x10001040,0x1000,0x40000,0x10041040,0x10000000,0x10001040,0x40,0x10000000,0x40040,0x10040000,0x10041040,0x41000,0x10041000,0x41040,0x1000,0x40,0x10040000,0x10000040,0x10001000,0x1040,0x41000,0x40040,0x10040040,0x10041000,0x1040,0,0,0x10040040,0x10000040,0x10001000,0x41040,0x40000,0x41040,0x40000,0x10041000,0x1000,0x40,0x10040040,0x1000,0x41040,0x10001000,0x40,0x10000040,0x10040000,0x10040040,0x10000000,0x40000,0x10001040,0,0x10041040,0x40040,0x10000040,0x10040000,0x10001000,0x10001040,0,0x10041040,0x41000,0x41000,0x1040,0x1040,0x40040,0x10000000,0x10041000];\n\n/**\n * Create necessary sub keys.\n *\n * @param key the 64-bit or 192-bit key.\n *\n * @return the expanded keys.\n */\nfunction _createKeys(key) {\n  var pc2bytes0  = [0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204],\n      pc2bytes1  = [0,0x1,0x100000,0x100001,0x4000000,0x4000001,0x4100000,0x4100001,0x100,0x101,0x100100,0x100101,0x4000100,0x4000101,0x4100100,0x4100101],\n      pc2bytes2  = [0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808,0,0x8,0x800,0x808,0x1000000,0x1000008,0x1000800,0x1000808],\n      pc2bytes3  = [0,0x200000,0x8000000,0x8200000,0x2000,0x202000,0x8002000,0x8202000,0x20000,0x220000,0x8020000,0x8220000,0x22000,0x222000,0x8022000,0x8222000],\n      pc2bytes4  = [0,0x40000,0x10,0x40010,0,0x40000,0x10,0x40010,0x1000,0x41000,0x1010,0x41010,0x1000,0x41000,0x1010,0x41010],\n      pc2bytes5  = [0,0x400,0x20,0x420,0,0x400,0x20,0x420,0x2000000,0x2000400,0x2000020,0x2000420,0x2000000,0x2000400,0x2000020,0x2000420],\n      pc2bytes6  = [0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002,0,0x10000000,0x80000,0x10080000,0x2,0x10000002,0x80002,0x10080002],\n      pc2bytes7  = [0,0x10000,0x800,0x10800,0x20000000,0x20010000,0x20000800,0x20010800,0x20000,0x30000,0x20800,0x30800,0x20020000,0x20030000,0x20020800,0x20030800],\n      pc2bytes8  = [0,0x40000,0,0x40000,0x2,0x40002,0x2,0x40002,0x2000000,0x2040000,0x2000000,0x2040000,0x2000002,0x2040002,0x2000002,0x2040002],\n      pc2bytes9  = [0,0x10000000,0x8,0x10000008,0,0x10000000,0x8,0x10000008,0x400,0x10000400,0x408,0x10000408,0x400,0x10000400,0x408,0x10000408],\n      pc2bytes10 = [0,0x20,0,0x20,0x100000,0x100020,0x100000,0x100020,0x2000,0x2020,0x2000,0x2020,0x102000,0x102020,0x102000,0x102020],\n      pc2bytes11 = [0,0x1000000,0x200,0x1000200,0x200000,0x1200000,0x200200,0x1200200,0x4000000,0x5000000,0x4000200,0x5000200,0x4200000,0x5200000,0x4200200,0x5200200],\n      pc2bytes12 = [0,0x1000,0x8000000,0x8001000,0x80000,0x81000,0x8080000,0x8081000,0x10,0x1010,0x8000010,0x8001010,0x80010,0x81010,0x8080010,0x8081010],\n      pc2bytes13 = [0,0x4,0x100,0x104,0,0x4,0x100,0x104,0x1,0x5,0x101,0x105,0x1,0x5,0x101,0x105];\n\n  // how many iterations (1 for des, 3 for triple des)\n  // changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n  var iterations = key.length() > 8 ? 3 : 1;\n\n  // stores the return keys\n  var keys = [];\n\n  // now define the left shifts which need to be done\n  var shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n\n  var n = 0, tmp;\n  for(var j = 0; j < iterations; j++) {\n    var left = key.getInt32();\n    var right = key.getInt32();\n\n    tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n    right ^= tmp;\n    left ^= (tmp << 4);\n\n    tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n    left ^= tmp;\n    right ^= (tmp << -16);\n\n    tmp = ((left >>> 2) ^ right) & 0x33333333;\n    right ^= tmp;\n    left ^= (tmp << 2);\n\n    tmp = ((right >>> -16) ^ left) & 0x0000ffff;\n    left ^= tmp;\n    right ^= (tmp << -16);\n\n    tmp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= tmp;\n    left ^= (tmp << 1);\n\n    tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n    left ^= tmp;\n    right ^= (tmp << 8);\n\n    tmp = ((left >>> 1) ^ right) & 0x55555555;\n    right ^= tmp;\n    left ^= (tmp << 1);\n\n    // right needs to be shifted and OR'd with last four bits of left\n    tmp = (left << 8) | ((right >>> 20) & 0x000000f0);\n\n    // left needs to be put upside down\n    left = ((right << 24) | ((right << 8) & 0xff0000) |\n      ((right >>> 8) & 0xff00) | ((right >>> 24) & 0xf0));\n    right = tmp;\n\n    // now go through and perform these shifts on the left and right keys\n    for(var i = 0; i < shifts.length; ++i) {\n      //shift the keys either one or two bits to the left\n      if(shifts[i]) {\n        left = (left << 2) | (left >>> 26);\n        right = (right << 2) | (right >>> 26);\n      } else {\n        left = (left << 1) | (left >>> 27);\n        right = (right << 1) | (right >>> 27);\n      }\n      left &= -0xf;\n      right &= -0xf;\n\n      // now apply PC-2, in such a way that E is easier when encrypting or\n      // decrypting this conversion will look like PC-2 except only the last 6\n      // bits of each byte are used rather than 48 consecutive bits and the\n      // order of lines will be according to how the S selection functions will\n      // be applied: S2, S4, S6, S8, S1, S3, S5, S7\n      var lefttmp = (\n        pc2bytes0[left >>> 28] | pc2bytes1[(left >>> 24) & 0xf] |\n        pc2bytes2[(left >>> 20) & 0xf] | pc2bytes3[(left >>> 16) & 0xf] |\n        pc2bytes4[(left >>> 12) & 0xf] | pc2bytes5[(left >>> 8) & 0xf] |\n        pc2bytes6[(left >>> 4) & 0xf]);\n      var righttmp = (\n        pc2bytes7[right >>> 28] | pc2bytes8[(right >>> 24) & 0xf] |\n        pc2bytes9[(right >>> 20) & 0xf] | pc2bytes10[(right >>> 16) & 0xf] |\n        pc2bytes11[(right >>> 12) & 0xf] | pc2bytes12[(right >>> 8) & 0xf] |\n        pc2bytes13[(right >>> 4) & 0xf]);\n      tmp = ((righttmp >>> 16) ^ lefttmp) & 0x0000ffff;\n      keys[n++] = lefttmp ^ tmp;\n      keys[n++] = righttmp ^ (tmp << 16);\n    }\n  }\n\n  return keys;\n}\n\n/**\n * Updates a single block (1 byte) using DES. The update will either\n * encrypt or decrypt the block.\n *\n * @param keys the expanded keys.\n * @param input the input block (an array of 32-bit words).\n * @param output the updated output block.\n * @param decrypt true to decrypt the block, false to encrypt it.\n */\nfunction _updateBlock(keys, input, output, decrypt) {\n  // set up loops for single or triple DES\n  var iterations = keys.length === 32 ? 3 : 9;\n  var looping;\n  if(iterations === 3) {\n    looping = decrypt ? [30, -2, -2] : [0, 32, 2];\n  } else {\n    looping = (decrypt ?\n      [94, 62, -2, 32, 64, 2, 30, -2, -2] :\n      [0, 32, 2, 62, 30, -2, 64, 96, 2]);\n  }\n\n  var tmp;\n\n  var left = input[0];\n  var right = input[1];\n\n  // first each 64 bit chunk of the message must be permuted according to IP\n  tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n  right ^= tmp;\n  left ^= (tmp << 4);\n\n  tmp = ((left >>> 16) ^ right) & 0x0000ffff;\n  right ^= tmp;\n  left ^= (tmp << 16);\n\n  tmp = ((right >>> 2) ^ left) & 0x33333333;\n  left ^= tmp;\n  right ^= (tmp << 2);\n\n  tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n  left ^= tmp;\n  right ^= (tmp << 8);\n\n  tmp = ((left >>> 1) ^ right) & 0x55555555;\n  right ^= tmp;\n  left ^= (tmp << 1);\n\n  // rotate left 1 bit\n  left = ((left << 1) | (left >>> 31));\n  right = ((right << 1) | (right >>> 31));\n\n  for(var j = 0; j < iterations; j += 3) {\n    var endloop = looping[j + 1];\n    var loopinc = looping[j + 2];\n\n    // now go through and perform the encryption or decryption\n    for(var i = looping[j]; i != endloop; i += loopinc) {\n      var right1 = right ^ keys[i];\n      var right2 = ((right >>> 4) | (right << 28)) ^ keys[i + 1];\n\n      // passing these bytes through the S selection functions\n      tmp = left;\n      left = right;\n      right = tmp ^ (\n        spfunction2[(right1 >>> 24) & 0x3f] |\n        spfunction4[(right1 >>> 16) & 0x3f] |\n        spfunction6[(right1 >>>  8) & 0x3f] |\n        spfunction8[right1 & 0x3f] |\n        spfunction1[(right2 >>> 24) & 0x3f] |\n        spfunction3[(right2 >>> 16) & 0x3f] |\n        spfunction5[(right2 >>>  8) & 0x3f] |\n        spfunction7[right2 & 0x3f]);\n    }\n    // unreverse left and right\n    tmp = left;\n    left = right;\n    right = tmp;\n  }\n\n  // rotate right 1 bit\n  left = ((left >>> 1) | (left << 31));\n  right = ((right >>> 1) | (right << 31));\n\n  // now perform IP-1, which is IP in the opposite direction\n  tmp = ((left >>> 1) ^ right) & 0x55555555;\n  right ^= tmp;\n  left ^= (tmp << 1);\n\n  tmp = ((right >>> 8) ^ left) & 0x00ff00ff;\n  left ^= tmp;\n  right ^= (tmp << 8);\n\n  tmp = ((right >>> 2) ^ left) & 0x33333333;\n  left ^= tmp;\n  right ^= (tmp << 2);\n\n  tmp = ((left >>> 16) ^ right) & 0x0000ffff;\n  right ^= tmp;\n  left ^= (tmp << 16);\n\n  tmp = ((left >>> 4) ^ right) & 0x0f0f0f0f;\n  right ^= tmp;\n  left ^= (tmp << 4);\n\n  output[0] = left;\n  output[1] = right;\n}\n\n/**\n * Deprecated. Instead, use:\n *\n * forge.cipher.createCipher('DES-<mode>', key);\n * forge.cipher.createDecipher('DES-<mode>', key);\n *\n * Creates a deprecated DES cipher object. This object's mode will default to\n * CBC (cipher-block-chaining).\n *\n * The key may be given as a binary-encoded string of bytes or a byte buffer.\n *\n * @param options the options to use.\n *          key the symmetric key to use (64 or 192 bits).\n *          output the buffer to write to.\n *          decrypt true for decryption, false for encryption.\n *          mode the cipher mode to use (default: 'CBC').\n *\n * @return the cipher.\n */\nfunction _createCipher(options) {\n  options = options || {};\n  var mode = (options.mode || 'CBC').toUpperCase();\n  var algorithm = 'DES-' + mode;\n\n  var cipher;\n  if(options.decrypt) {\n    cipher = forge.cipher.createDecipher(algorithm, options.key);\n  } else {\n    cipher = forge.cipher.createCipher(algorithm, options.key);\n  }\n\n  // backwards compatible start API\n  var start = cipher.start;\n  cipher.start = function(iv, options) {\n    // backwards compatibility: support second arg as output buffer\n    var output = null;\n    if(options instanceof forge.util.ByteBuffer) {\n      output = options;\n      options = {};\n    }\n    options = options || {};\n    options.output = output;\n    options.iv = iv;\n    start.call(cipher, options);\n  };\n\n  return cipher;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/des.js\n// module id = 197\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/des.js")},function(module,exports,__webpack_require__){eval('// Copyright (c) 2005  Tom Wu\n// All Rights Reserved.\n// See "LICENSE" for details.\n\n// Basic JavaScript BN library - subset useful for RSA encryption.\n\n/*\nLicensing (LICENSE)\n-------------------\n\nThis software is covered under the following copyright:\n*/\n/*\n * Copyright (c) 2003-2005  Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * "Software"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n/*\nAddress all questions regarding this license to:\n\n  Tom Wu\n  tjw@cs.Stanford.EDU\n*/\nvar forge = __webpack_require__(7);\n\nmodule.exports = forge.jsbn = forge.jsbn || {};\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = ((canary&0xffffff)==0xefcafe);\n\n// (public) Constructor\nfunction BigInteger(a,b,c) {\n  this.data = [];\n  if(a != null)\n    if("number" == typeof a) this.fromNumber(a,b,c);\n    else if(b == null && "string" != typeof a) this.fromString(a,256);\n    else this.fromString(a,b);\n}\nforge.jsbn.BigInteger = BigInteger;\n\n// return new, unset BigInteger\nfunction nbi() { return new BigInteger(null); }\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i,x,w,j,c,n) {\n  while(--n >= 0) {\n    var v = x*this.data[i++]+w.data[j]+c;\n    c = Math.floor(v/0x4000000);\n    w.data[j++] = v&0x3ffffff;\n  }\n  return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i,x,w,j,c,n) {\n  var xl = x&0x7fff, xh = x>>15;\n  while(--n >= 0) {\n    var l = this.data[i]&0x7fff;\n    var h = this.data[i++]>>15;\n    var m = xh*l+h*xl;\n    l = xl*l+((m&0x7fff)<<15)+w.data[j]+(c&0x3fffffff);\n    c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n    w.data[j++] = l&0x3fffffff;\n  }\n  return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i,x,w,j,c,n) {\n  var xl = x&0x3fff, xh = x>>14;\n  while(--n >= 0) {\n    var l = this.data[i]&0x3fff;\n    var h = this.data[i++]>>14;\n    var m = xh*l+h*xl;\n    l = xl*l+((m&0x3fff)<<14)+w.data[j]+c;\n    c = (l>>28)+(m>>14)+xh*h;\n    w.data[j++] = l&0xfffffff;\n  }\n  return c;\n}\n\n// node.js (no browser)\nif(typeof(navigator) === \'undefined\')\n{\n   BigInteger.prototype.am = am3;\n   dbits = 28;\n} else if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {\n  BigInteger.prototype.am = am2;\n  dbits = 30;\n} else if(j_lm && (navigator.appName != "Netscape")) {\n  BigInteger.prototype.am = am1;\n  dbits = 26;\n} else { // Mozilla/Netscape seems to prefer am3\n  BigInteger.prototype.am = am3;\n  dbits = 28;\n}\n\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = ((1<<dbits)-1);\nBigInteger.prototype.DV = (1<<dbits);\n\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2,BI_FP);\nBigInteger.prototype.F1 = BI_FP-dbits;\nBigInteger.prototype.F2 = 2*dbits-BI_FP;\n\n// Digit conversions\nvar BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";\nvar BI_RC = new Array();\nvar rr,vv;\nrr = "0".charCodeAt(0);\nfor(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\nrr = "a".charCodeAt(0);\nfor(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\nrr = "A".charCodeAt(0);\nfor(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\n\nfunction int2char(n) { return BI_RM.charAt(n); }\nfunction intAt(s,i) {\n  var c = BI_RC[s.charCodeAt(i)];\n  return (c==null)?-1:c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n  for(var i = this.t-1; i >= 0; --i) r.data[i] = this.data[i];\n  r.t = this.t;\n  r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n  this.t = 1;\n  this.s = (x<0)?-1:0;\n  if(x > 0) this.data[0] = x;\n  else if(x < -1) this.data[0] = x+this.DV;\n  else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n// (protected) set from string and radix\nfunction bnpFromString(s,b) {\n  var k;\n  if(b == 16) k = 4;\n  else if(b == 8) k = 3;\n  else if(b == 256) k = 8; // byte array\n  else if(b == 2) k = 1;\n  else if(b == 32) k = 5;\n  else if(b == 4) k = 2;\n  else { this.fromRadix(s,b); return; }\n  this.t = 0;\n  this.s = 0;\n  var i = s.length, mi = false, sh = 0;\n  while(--i >= 0) {\n    var x = (k==8)?s[i]&0xff:intAt(s,i);\n    if(x < 0) {\n      if(s.charAt(i) == "-") mi = true;\n      continue;\n    }\n    mi = false;\n    if(sh == 0)\n      this.data[this.t++] = x;\n    else if(sh+k > this.DB) {\n      this.data[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;\n      this.data[this.t++] = (x>>(this.DB-sh));\n    } else\n      this.data[this.t-1] |= x<<sh;\n    sh += k;\n    if(sh >= this.DB) sh -= this.DB;\n  }\n  if(k == 8 && (s[0]&0x80) != 0) {\n    this.s = -1;\n    if(sh > 0) this.data[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;\n  }\n  this.clamp();\n  if(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n  var c = this.s&this.DM;\n  while(this.t > 0 && this.data[this.t-1] == c) --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n  if(this.s < 0) return "-"+this.negate().toString(b);\n  var k;\n  if(b == 16) k = 4;\n  else if(b == 8) k = 3;\n  else if(b == 2) k = 1;\n  else if(b == 32) k = 5;\n  else if(b == 4) k = 2;\n  else return this.toRadix(b);\n  var km = (1<<k)-1, d, m = false, r = "", i = this.t;\n  var p = this.DB-(i*this.DB)%k;\n  if(i-- > 0) {\n    if(p < this.DB && (d = this.data[i]>>p) > 0) { m = true; r = int2char(d); }\n    while(i >= 0) {\n      if(p < k) {\n        d = (this.data[i]&((1<<p)-1))<<(k-p);\n        d |= this.data[--i]>>(p+=this.DB-k);\n      } else {\n        d = (this.data[i]>>(p-=k))&km;\n        if(p <= 0) { p += this.DB; --i; }\n      }\n      if(d > 0) m = true;\n      if(m) r += int2char(d);\n    }\n  }\n  return m?r:"0";\n}\n\n// (public) -this\nfunction bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n// (public) |this|\nfunction bnAbs() { return (this.s<0)?this.negate():this; }\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n  var r = this.s-a.s;\n  if(r != 0) return r;\n  var i = this.t;\n  r = i-a.t;\n  if(r != 0) return (this.s<0)?-r:r;\n  while(--i >= 0) if((r=this.data[i]-a.data[i]) != 0) return r;\n  return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n  var r = 1, t;\n  if((t=x>>>16) != 0) { x = t; r += 16; }\n  if((t=x>>8) != 0) { x = t; r += 8; }\n  if((t=x>>4) != 0) { x = t; r += 4; }\n  if((t=x>>2) != 0) { x = t; r += 2; }\n  if((t=x>>1) != 0) { x = t; r += 1; }\n  return r;\n}\n\n// (public) return the number of bits in "this"\nfunction bnBitLength() {\n  if(this.t <= 0) return 0;\n  return this.DB*(this.t-1)+nbits(this.data[this.t-1]^(this.s&this.DM));\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n,r) {\n  var i;\n  for(i = this.t-1; i >= 0; --i) r.data[i+n] = this.data[i];\n  for(i = n-1; i >= 0; --i) r.data[i] = 0;\n  r.t = this.t+n;\n  r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n,r) {\n  for(var i = n; i < this.t; ++i) r.data[i-n] = this.data[i];\n  r.t = Math.max(this.t-n,0);\n  r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n,r) {\n  var bs = n%this.DB;\n  var cbs = this.DB-bs;\n  var bm = (1<<cbs)-1;\n  var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;\n  for(i = this.t-1; i >= 0; --i) {\n    r.data[i+ds+1] = (this.data[i]>>cbs)|c;\n    c = (this.data[i]&bm)<<bs;\n  }\n  for(i = ds-1; i >= 0; --i) r.data[i] = 0;\n  r.data[ds] = c;\n  r.t = this.t+ds+1;\n  r.s = this.s;\n  r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n,r) {\n  r.s = this.s;\n  var ds = Math.floor(n/this.DB);\n  if(ds >= this.t) { r.t = 0; return; }\n  var bs = n%this.DB;\n  var cbs = this.DB-bs;\n  var bm = (1<<bs)-1;\n  r.data[0] = this.data[ds]>>bs;\n  for(var i = ds+1; i < this.t; ++i) {\n    r.data[i-ds-1] |= (this.data[i]&bm)<<cbs;\n    r.data[i-ds] = this.data[i]>>bs;\n  }\n  if(bs > 0) r.data[this.t-ds-1] |= (this.s&bm)<<cbs;\n  r.t = this.t-ds;\n  r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a,r) {\n  var i = 0, c = 0, m = Math.min(a.t,this.t);\n  while(i < m) {\n    c += this.data[i]-a.data[i];\n    r.data[i++] = c&this.DM;\n    c >>= this.DB;\n  }\n  if(a.t < this.t) {\n    c -= a.s;\n    while(i < this.t) {\n      c += this.data[i];\n      r.data[i++] = c&this.DM;\n      c >>= this.DB;\n    }\n    c += this.s;\n  } else {\n    c += this.s;\n    while(i < a.t) {\n      c -= a.data[i];\n      r.data[i++] = c&this.DM;\n      c >>= this.DB;\n    }\n    c -= a.s;\n  }\n  r.s = (c<0)?-1:0;\n  if(c < -1) r.data[i++] = this.DV+c;\n  else if(c > 0) r.data[i++] = c;\n  r.t = i;\n  r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// "this" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a,r) {\n  var x = this.abs(), y = a.abs();\n  var i = x.t;\n  r.t = i+y.t;\n  while(--i >= 0) r.data[i] = 0;\n  for(i = 0; i < y.t; ++i) r.data[i+x.t] = x.am(0,y.data[i],r,i,0,x.t);\n  r.s = 0;\n  r.clamp();\n  if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n  var x = this.abs();\n  var i = r.t = 2*x.t;\n  while(--i >= 0) r.data[i] = 0;\n  for(i = 0; i < x.t-1; ++i) {\n    var c = x.am(i,x.data[i],r,2*i,0,1);\n    if((r.data[i+x.t]+=x.am(i+1,2*x.data[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n      r.data[i+x.t] -= x.DV;\n      r.data[i+x.t+1] = 1;\n    }\n  }\n  if(r.t > 0) r.data[r.t-1] += x.am(i,x.data[i],r,2*i,0,1);\n  r.s = 0;\n  r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m.  q or r may be null.\nfunction bnpDivRemTo(m,q,r) {\n  var pm = m.abs();\n  if(pm.t <= 0) return;\n  var pt = this.abs();\n  if(pt.t < pm.t) {\n    if(q != null) q.fromInt(0);\n    if(r != null) this.copyTo(r);\n    return;\n  }\n  if(r == null) r = nbi();\n  var y = nbi(), ts = this.s, ms = m.s;\n  var nsh = this.DB-nbits(pm.data[pm.t-1]);\t// normalize modulus\n  if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } else { pm.copyTo(y); pt.copyTo(r); }\n  var ys = y.t;\n  var y0 = y.data[ys-1];\n  if(y0 == 0) return;\n  var yt = y0*(1<<this.F1)+((ys>1)?y.data[ys-2]>>this.F2:0);\n  var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;\n  var i = r.t, j = i-ys, t = (q==null)?nbi():q;\n  y.dlShiftTo(j,t);\n  if(r.compareTo(t) >= 0) {\n    r.data[r.t++] = 1;\n    r.subTo(t,r);\n  }\n  BigInteger.ONE.dlShiftTo(ys,t);\n  t.subTo(y,y);\t// "negative" y so we can replace sub with am later\n  while(y.t < ys) y.data[y.t++] = 0;\n  while(--j >= 0) {\n    // Estimate quotient digit\n    var qd = (r.data[--i]==y0)?this.DM:Math.floor(r.data[i]*d1+(r.data[i-1]+e)*d2);\n    if((r.data[i]+=y.am(0,qd,r,j,0,ys)) < qd) {\t// Try it out\n      y.dlShiftTo(j,t);\n      r.subTo(t,r);\n      while(r.data[i] < --qd) r.subTo(t,r);\n    }\n  }\n  if(q != null) {\n    r.drShiftTo(ys,q);\n    if(ts != ms) BigInteger.ZERO.subTo(q,q);\n  }\n  r.t = ys;\n  r.clamp();\n  if(nsh > 0) r.rShiftTo(nsh,r);\t// Denormalize remainder\n  if(ts < 0) BigInteger.ZERO.subTo(r,r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n  var r = nbi();\n  this.abs().divRemTo(a,null,r);\n  if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n  return r;\n}\n\n// Modular reduction using "classic" algorithm\nfunction Classic(m) { this.m = m; }\nfunction cConvert(x) {\n  if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n  else return x;\n}\nfunction cRevert(x) { return x; }\nfunction cReduce(x) { x.divRemTo(this.m,null,x); }\nfunction cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\nfunction cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\nClassic.prototype.convert = cConvert;\nClassic.prototype.revert = cRevert;\nClassic.prototype.reduce = cReduce;\nClassic.prototype.mulTo = cMulTo;\nClassic.prototype.sqrTo = cSqrTo;\n\n// (protected) return "-1/this % 2^DB"; useful for Mont. reduction\n// justification:\n//         xy == 1 (mod m)\n//         xy =  1+km\n//   xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply "overflows" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n  if(this.t < 1) return 0;\n  var x = this.data[0];\n  if((x&1) == 0) return 0;\n  var y = x&3;\t\t// y == 1/x mod 2^2\n  y = (y*(2-(x&0xf)*y))&0xf;\t// y == 1/x mod 2^4\n  y = (y*(2-(x&0xff)*y))&0xff;\t// y == 1/x mod 2^8\n  y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff;\t// y == 1/x mod 2^16\n  // last step - calculate inverse mod DV directly;\n  // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n  y = (y*(2-x*y%this.DV))%this.DV;\t\t// y == 1/x mod 2^dbits\n  // we really want the negative inverse, and -DV < y < DV\n  return (y>0)?this.DV-y:-y;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n  this.m = m;\n  this.mp = m.invDigit();\n  this.mpl = this.mp&0x7fff;\n  this.mph = this.mp>>15;\n  this.um = (1<<(m.DB-15))-1;\n  this.mt2 = 2*m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n  var r = nbi();\n  x.abs().dlShiftTo(this.m.t,r);\n  r.divRemTo(this.m,null,r);\n  if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n  return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n  var r = nbi();\n  x.copyTo(r);\n  this.reduce(r);\n  return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n  while(x.t <= this.mt2)\t// pad x so am has enough room later\n    x.data[x.t++] = 0;\n  for(var i = 0; i < this.m.t; ++i) {\n    // faster way of calculating u0 = x.data[i]*mp mod DV\n    var j = x.data[i]&0x7fff;\n    var u0 = (j*this.mpl+(((j*this.mph+(x.data[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n    // use am to combine the multiply-shift-add into one call\n    j = i+this.m.t;\n    x.data[j] += this.m.am(0,u0,x,i,0,this.m.t);\n    // propagate carry\n    while(x.data[j] >= x.DV) { x.data[j] -= x.DV; x.data[++j]++; }\n  }\n  x.clamp();\n  x.drShiftTo(this.m.t,x);\n  if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n// r = "x^2/R mod m"; x != r\nfunction montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n// r = "xy/R mod m"; x,y != r\nfunction montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (protected) true iff this is even\nfunction bnpIsEven() { return ((this.t>0)?(this.data[0]&1):this.s) == 0; }\n\n// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)\nfunction bnpExp(e,z) {\n  if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n  var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n  g.copyTo(r);\n  while(--i >= 0) {\n    z.sqrTo(r,r2);\n    if((e&(1<<i)) > 0) z.mulTo(r2,g,r);\n    else { var t = r; r = r2; r2 = t; }\n  }\n  return z.revert(r);\n}\n\n// (public) this^e % m, 0 <= e < 2^32\nfunction bnModPowInt(e,m) {\n  var z;\n  if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n  return this.exp(e,z);\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.isEven = bnpIsEven;\nBigInteger.prototype.exp = bnpExp;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.modPowInt = bnModPowInt;\n\n// "constants"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\n// jsbn2 lib\n\n//Copyright (c) 2005-2009  Tom Wu\n//All Rights Reserved.\n//See "LICENSE" for details (See jsbn.js for LICENSE).\n\n//Extended JavaScript BN functions, required for RSA private ops.\n\n//Version 1.1: new BigInteger("0", 10) returns "proper" zero\n\n//(public)\nfunction bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n//(public) return value as integer\nfunction bnIntValue() {\nif(this.s < 0) {\n if(this.t == 1) return this.data[0]-this.DV;\n else if(this.t == 0) return -1;\n} else if(this.t == 1) return this.data[0];\nelse if(this.t == 0) return 0;\n// assumes 16 < DB < 32\nreturn ((this.data[1]&((1<<(32-this.DB))-1))<<this.DB)|this.data[0];\n}\n\n//(public) return value as byte\nfunction bnByteValue() { return (this.t==0)?this.s:(this.data[0]<<24)>>24; }\n\n//(public) return value as short (assumes DB>=16)\nfunction bnShortValue() { return (this.t==0)?this.s:(this.data[0]<<16)>>16; }\n\n//(protected) return x s.t. r^x < DV\nfunction bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n//(public) 0 if this == 0, 1 if this > 0\nfunction bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}\n\n//(protected) convert to radix string\nfunction bnpToRadix(b) {\nif(b == null) b = 10;\nif(this.signum() == 0 || b < 2 || b > 36) return "0";\nvar cs = this.chunkSize(b);\nvar a = Math.pow(b,cs);\nvar d = nbv(a), y = nbi(), z = nbi(), r = "";\nthis.divRemTo(d,y,z);\nwhile(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n}\nreturn z.intValue().toString(b) + r;\n}\n\n//(protected) convert from radix string\nfunction bnpFromRadix(s,b) {\nthis.fromInt(0);\nif(b == null) b = 10;\nvar cs = this.chunkSize(b);\nvar d = Math.pow(b,cs), mi = false, j = 0, w = 0;\nfor(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n   if(s.charAt(i) == "-" && this.signum() == 0) mi = true;\n   continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n   this.dMultiply(d);\n   this.dAddOffset(w,0);\n   j = 0;\n   w = 0;\n }\n}\nif(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n}\nif(mi) BigInteger.ZERO.subTo(this,this);\n}\n\n//(protected) alternate constructor\nfunction bnpFromNumber(a,b,c) {\nif("number" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n   this.fromNumber(a,c);\n   if(!this.testBit(a-1))  // force MSB set\n     this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n   if(this.isEven()) this.dAddOffset(1,0); // force odd\n   while(!this.isProbablePrime(b)) {\n     this.dAddOffset(2,0);\n     if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n   }\n }\n} else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;\n this.fromString(x,256);\n}\n}\n\n//(public) convert to bigendian byte array\nfunction bnToByteArray() {\nvar i = this.t, r = new Array();\nr[0] = this.s;\nvar p = this.DB-(i*this.DB)%8, d, k = 0;\nif(i-- > 0) {\n if(p < this.DB && (d = this.data[i]>>p) != (this.s&this.DM)>>p)\n   r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n   if(p < 8) {\n     d = (this.data[i]&((1<<p)-1))<<(8-p);\n     d |= this.data[--i]>>(p+=this.DB-8);\n   } else {\n     d = (this.data[i]>>(p-=8))&0xff;\n     if(p <= 0) { p += this.DB; --i; }\n   }\n   if((d&0x80) != 0) d |= -256;\n   if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n   if(k > 0 || d != this.s) r[k++] = d;\n }\n}\nreturn r;\n}\n\nfunction bnEquals(a) { return(this.compareTo(a)==0); }\nfunction bnMin(a) { return(this.compareTo(a)<0)?this:a; }\nfunction bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n//(protected) r = this op a (bitwise)\nfunction bnpBitwiseTo(a,op,r) {\nvar i, f, m = Math.min(a.t,this.t);\nfor(i = 0; i < m; ++i) r.data[i] = op(this.data[i],a.data[i]);\nif(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r.data[i] = op(this.data[i],f);\n r.t = this.t;\n} else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r.data[i] = op(f,a.data[i]);\n r.t = a.t;\n}\nr.s = op(this.s,a.s);\nr.clamp();\n}\n\n//(public) this & a\nfunction op_and(x,y) { return x&y; }\nfunction bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n//(public) this | a\nfunction op_or(x,y) { return x|y; }\nfunction bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n//(public) this ^ a\nfunction op_xor(x,y) { return x^y; }\nfunction bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n//(public) this & ~a\nfunction op_andnot(x,y) { return x&~y; }\nfunction bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n//(public) ~this\nfunction bnNot() {\nvar r = nbi();\nfor(var i = 0; i < this.t; ++i) r.data[i] = this.DM&~this.data[i];\nr.t = this.t;\nr.s = ~this.s;\nreturn r;\n}\n\n//(public) this << n\nfunction bnShiftLeft(n) {\nvar r = nbi();\nif(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\nreturn r;\n}\n\n//(public) this >> n\nfunction bnShiftRight(n) {\nvar r = nbi();\nif(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\nreturn r;\n}\n\n//return index of lowest 1-bit in x, x < 2^31\nfunction lbit(x) {\nif(x == 0) return -1;\nvar r = 0;\nif((x&0xffff) == 0) { x >>= 16; r += 16; }\nif((x&0xff) == 0) { x >>= 8; r += 8; }\nif((x&0xf) == 0) { x >>= 4; r += 4; }\nif((x&3) == 0) { x >>= 2; r += 2; }\nif((x&1) == 0) ++r;\nreturn r;\n}\n\n//(public) returns index of lowest 1-bit (or -1 if none)\nfunction bnGetLowestSetBit() {\nfor(var i = 0; i < this.t; ++i)\n if(this.data[i] != 0) return i*this.DB+lbit(this.data[i]);\nif(this.s < 0) return this.t*this.DB;\nreturn -1;\n}\n\n//return number of 1 bits in x\nfunction cbit(x) {\nvar r = 0;\nwhile(x != 0) { x &= x-1; ++r; }\nreturn r;\n}\n\n//(public) return number of set bits\nfunction bnBitCount() {\nvar r = 0, x = this.s&this.DM;\nfor(var i = 0; i < this.t; ++i) r += cbit(this.data[i]^x);\nreturn r;\n}\n\n//(public) true iff nth bit is set\nfunction bnTestBit(n) {\nvar j = Math.floor(n/this.DB);\nif(j >= this.t) return(this.s!=0);\nreturn((this.data[j]&(1<<(n%this.DB)))!=0);\n}\n\n//(protected) this op (1<<n)\nfunction bnpChangeBit(n,op) {\nvar r = BigInteger.ONE.shiftLeft(n);\nthis.bitwiseTo(r,op,r);\nreturn r;\n}\n\n//(public) this | (1<<n)\nfunction bnSetBit(n) { return this.changeBit(n,op_or); }\n\n//(public) this & ~(1<<n)\nfunction bnClearBit(n) { return this.changeBit(n,op_andnot); }\n\n//(public) this ^ (1<<n)\nfunction bnFlipBit(n) { return this.changeBit(n,op_xor); }\n\n//(protected) r = this + a\nfunction bnpAddTo(a,r) {\nvar i = 0, c = 0, m = Math.min(a.t,this.t);\nwhile(i < m) {\n c += this.data[i]+a.data[i];\n r.data[i++] = c&this.DM;\n c >>= this.DB;\n}\nif(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n   c += this.data[i];\n   r.data[i++] = c&this.DM;\n   c >>= this.DB;\n }\n c += this.s;\n} else {\n c += this.s;\n while(i < a.t) {\n   c += a.data[i];\n   r.data[i++] = c&this.DM;\n   c >>= this.DB;\n }\n c += a.s;\n}\nr.s = (c<0)?-1:0;\nif(c > 0) r.data[i++] = c;\nelse if(c < -1) r.data[i++] = this.DV+c;\nr.t = i;\nr.clamp();\n}\n\n//(public) this + a\nfunction bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n//(public) this - a\nfunction bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n//(public) this * a\nfunction bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n//(public) this / a\nfunction bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n//(public) this % a\nfunction bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n//(public) [this/a,this%a]\nfunction bnDivideAndRemainder(a) {\nvar q = nbi(), r = nbi();\nthis.divRemTo(a,q,r);\nreturn new Array(q,r);\n}\n\n//(protected) this *= n, this >= 0, 1 < n < DV\nfunction bnpDMultiply(n) {\nthis.data[this.t] = this.am(0,n-1,this,0,0,this.t);\n++this.t;\nthis.clamp();\n}\n\n//(protected) this += n << w words, this >= 0\nfunction bnpDAddOffset(n,w) {\nif(n == 0) return;\nwhile(this.t <= w) this.data[this.t++] = 0;\nthis.data[w] += n;\nwhile(this.data[w] >= this.DV) {\n this.data[w] -= this.DV;\n if(++w >= this.t) this.data[this.t++] = 0;\n ++this.data[w];\n}\n}\n\n//A "null" reducer\nfunction NullExp() {}\nfunction nNop(x) { return x; }\nfunction nMulTo(x,y,r) { x.multiplyTo(y,r); }\nfunction nSqrTo(x,r) { x.squareTo(r); }\n\nNullExp.prototype.convert = nNop;\nNullExp.prototype.revert = nNop;\nNullExp.prototype.mulTo = nMulTo;\nNullExp.prototype.sqrTo = nSqrTo;\n\n//(public) this^e\nfunction bnPow(e) { return this.exp(e,new NullExp()); }\n\n//(protected) r = lower n words of "this * a", a.t <= n\n//"this" should be the larger one if appropriate.\nfunction bnpMultiplyLowerTo(a,n,r) {\nvar i = Math.min(this.t+a.t,n);\nr.s = 0; // assumes a,this >= 0\nr.t = i;\nwhile(i > 0) r.data[--i] = 0;\nvar j;\nfor(j = r.t-this.t; i < j; ++i) r.data[i+this.t] = this.am(0,a.data[i],r,i,0,this.t);\nfor(j = Math.min(a.t,n); i < j; ++i) this.am(0,a.data[i],r,i,0,n-i);\nr.clamp();\n}\n\n//(protected) r = "this * a" without lower n words, n > 0\n//"this" should be the larger one if appropriate.\nfunction bnpMultiplyUpperTo(a,n,r) {\n--n;\nvar i = r.t = this.t+a.t-n;\nr.s = 0; // assumes a,this >= 0\nwhile(--i >= 0) r.data[i] = 0;\nfor(i = Math.max(n-this.t,0); i < a.t; ++i)\n r.data[this.t+i-n] = this.am(n-i,a.data[i],r,0,0,this.t+i-n);\nr.clamp();\nr.drShiftTo(1,r);\n}\n\n//Barrett modular reduction\nfunction Barrett(m) {\n// setup Barrett\nthis.r2 = nbi();\nthis.q3 = nbi();\nBigInteger.ONE.dlShiftTo(2*m.t,this.r2);\nthis.mu = this.r2.divide(m);\nthis.m = m;\n}\n\nfunction barrettConvert(x) {\nif(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\nelse if(x.compareTo(this.m) < 0) return x;\nelse { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n}\n\nfunction barrettRevert(x) { return x; }\n\n//x = x mod m (HAC 14.42)\nfunction barrettReduce(x) {\nx.drShiftTo(this.m.t-1,this.r2);\nif(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\nthis.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\nthis.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\nwhile(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\nx.subTo(this.r2,x);\nwhile(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n}\n\n//r = x^2 mod m; x != r\nfunction barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n//r = x*y mod m; x,y != r\nfunction barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\nBarrett.prototype.convert = barrettConvert;\nBarrett.prototype.revert = barrettRevert;\nBarrett.prototype.reduce = barrettReduce;\nBarrett.prototype.mulTo = barrettMulTo;\nBarrett.prototype.sqrTo = barrettSqrTo;\n\n//(public) this^e % m (HAC 14.85)\nfunction bnModPow(e,m) {\nvar i = e.bitLength(), k, r = nbv(1), z;\nif(i <= 0) return r;\nelse if(i < 18) k = 1;\nelse if(i < 48) k = 3;\nelse if(i < 144) k = 4;\nelse if(i < 768) k = 5;\nelse k = 6;\nif(i < 8)\n z = new Classic(m);\nelse if(m.isEven())\n z = new Barrett(m);\nelse\n z = new Montgomery(m);\n\n// precomputation\nvar g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;\ng[1] = z.convert(this);\nif(k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n   g[n] = nbi();\n   z.mulTo(g2,g[n-2],g[n]);\n   n += 2;\n }\n}\n\nvar j = e.t-1, w, is1 = true, r2 = nbi(), t;\ni = nbits(e.data[j])-1;\nwhile(j >= 0) {\n if(i >= k1) w = (e.data[j]>>(i-k1))&km;\n else {\n   w = (e.data[j]&((1<<(i+1))-1))<<(k1-i);\n   if(j > 0) w |= e.data[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {  // ret == 1, don\'t bother squaring or multiplying it\n   g[w].copyTo(r);\n   is1 = false;\n } else {\n   while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n   if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n   z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e.data[j]&(1<<i)) == 0) {\n   z.sqrTo(r,r2); t = r; r = r2; r2 = t;\n   if(--i < 0) { i = this.DB-1; --j; }\n }\n}\nreturn z.revert(r);\n}\n\n//(public) gcd(this,a) (HAC 14.54)\nfunction bnGCD(a) {\nvar x = (this.s<0)?this.negate():this.clone();\nvar y = (a.s<0)?a.negate():a.clone();\nif(x.compareTo(y) < 0) { var t = x; x = y; y = t; }\nvar i = x.getLowestSetBit(), g = y.getLowestSetBit();\nif(g < 0) return x;\nif(i < g) g = i;\nif(g > 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n}\nwhile(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n   x.subTo(y,x);\n   x.rShiftTo(1,x);\n } else {\n   y.subTo(x,y);\n   y.rShiftTo(1,y);\n }\n}\nif(g > 0) y.lShiftTo(g,y);\nreturn y;\n}\n\n//(protected) this % n, n < 2^26\nfunction bnpModInt(n) {\nif(n <= 0) return 0;\nvar d = this.DV%n, r = (this.s<0)?n-1:0;\nif(this.t > 0)\n if(d == 0) r = this.data[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this.data[i])%n;\nreturn r;\n}\n\n//(public) 1/this % m (HAC 14.61)\nfunction bnModInverse(m) {\nvar ac = m.isEven();\nif((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\nvar u = m.clone(), v = this.clone();\nvar a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\nwhile(u.signum() != 0) {\n while(u.isEven()) {\n   u.rShiftTo(1,u);\n   if(ac) {\n     if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n     a.rShiftTo(1,a);\n   } else if(!b.isEven()) b.subTo(m,b);\n   b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n   v.rShiftTo(1,v);\n   if(ac) {\n     if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n     c.rShiftTo(1,c);\n   } else if(!d.isEven()) d.subTo(m,d);\n   d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n   u.subTo(v,u);\n   if(ac) a.subTo(c,a);\n   b.subTo(d,b);\n } else {\n   v.subTo(u,v);\n   if(ac) c.subTo(a,c);\n   d.subTo(b,d);\n }\n}\nif(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\nif(d.compareTo(m) >= 0) return d.subtract(m);\nif(d.signum() < 0) d.addTo(m,d); else return d;\nif(d.signum() < 0) return d.add(m); else return d;\n}\n\nvar lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509];\nvar lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n//(public) test primality with certainty >= 1-.5^t\nfunction bnIsProbablePrime(t) {\nvar i, x = this.abs();\nif(x.t == 1 && x.data[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n   if(x.data[0] == lowprimes[i]) return true;\n return false;\n}\nif(x.isEven()) return false;\ni = 1;\nwhile(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n}\nreturn x.millerRabin(t);\n}\n\n//(protected) true if probably prime (HAC 4.24, Miller-Rabin)\nfunction bnpMillerRabin(t) {\nvar n1 = this.subtract(BigInteger.ONE);\nvar k = n1.getLowestSetBit();\nif(k <= 0) return false;\nvar r = n1.shiftRight(k);\nvar prng = bnGetPrng();\nvar a;\nfor(var i = 0; i < t; ++i) {\n // select witness \'a\' at random from between 1 and n1\n do {\n   a = new BigInteger(this.bitLength(), prng);\n }\n while(a.compareTo(BigInteger.ONE) <= 0 || a.compareTo(n1) >= 0);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n   var j = 1;\n   while(j++ < k && y.compareTo(n1) != 0) {\n     y = y.modPowInt(2,this);\n     if(y.compareTo(BigInteger.ONE) == 0) return false;\n   }\n   if(y.compareTo(n1) != 0) return false;\n }\n}\nreturn true;\n}\n\n// get pseudo random number generator\nfunction bnGetPrng() {\n  // create prng with api that matches BigInteger secure random\n  return {\n    // x is an array to fill with bytes\n    nextBytes: function(x) {\n      for(var i = 0; i < x.length; ++i) {\n        x[i] = Math.floor(Math.random() * 0x0100);\n      }\n    }\n  };\n}\n\n//protected\nBigInteger.prototype.chunkSize = bnpChunkSize;\nBigInteger.prototype.toRadix = bnpToRadix;\nBigInteger.prototype.fromRadix = bnpFromRadix;\nBigInteger.prototype.fromNumber = bnpFromNumber;\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\nBigInteger.prototype.changeBit = bnpChangeBit;\nBigInteger.prototype.addTo = bnpAddTo;\nBigInteger.prototype.dMultiply = bnpDMultiply;\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\nBigInteger.prototype.modInt = bnpModInt;\nBigInteger.prototype.millerRabin = bnpMillerRabin;\n\n//public\nBigInteger.prototype.clone = bnClone;\nBigInteger.prototype.intValue = bnIntValue;\nBigInteger.prototype.byteValue = bnByteValue;\nBigInteger.prototype.shortValue = bnShortValue;\nBigInteger.prototype.signum = bnSigNum;\nBigInteger.prototype.toByteArray = bnToByteArray;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.min = bnMin;\nBigInteger.prototype.max = bnMax;\nBigInteger.prototype.and = bnAnd;\nBigInteger.prototype.or = bnOr;\nBigInteger.prototype.xor = bnXor;\nBigInteger.prototype.andNot = bnAndNot;\nBigInteger.prototype.not = bnNot;\nBigInteger.prototype.shiftLeft = bnShiftLeft;\nBigInteger.prototype.shiftRight = bnShiftRight;\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\nBigInteger.prototype.bitCount = bnBitCount;\nBigInteger.prototype.testBit = bnTestBit;\nBigInteger.prototype.setBit = bnSetBit;\nBigInteger.prototype.clearBit = bnClearBit;\nBigInteger.prototype.flipBit = bnFlipBit;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.remainder = bnRemainder;\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\nBigInteger.prototype.modPow = bnModPow;\nBigInteger.prototype.modInverse = bnModInverse;\nBigInteger.prototype.pow = bnPow;\nBigInteger.prototype.gcd = bnGCD;\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n//BigInteger interfaces not implemented in jsbn:\n\n//BigInteger(int signum, byte[] magnitude)\n//double doubleValue()\n//float floatValue()\n//int hashCode()\n//long longValue()\n//static BigInteger valueOf(long val)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/jsbn.js\n// module id = 198\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/jsbn.js')},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of basic RSA algorithms.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n *\n * The only algorithm currently supported for PKI is RSA.\n *\n * An RSA key is often stored in ASN.1 DER format. The SubjectPublicKeyInfo\n * ASN.1 structure is composed of an algorithm of type AlgorithmIdentifier\n * and a subjectPublicKey of type bit string.\n *\n * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters\n * for the algorithm, if any. In the case of RSA, there aren't any.\n *\n * SubjectPublicKeyInfo ::= SEQUENCE {\n *   algorithm AlgorithmIdentifier,\n *   subjectPublicKey BIT STRING\n * }\n *\n * AlgorithmIdentifer ::= SEQUENCE {\n *   algorithm OBJECT IDENTIFIER,\n *   parameters ANY DEFINED BY algorithm OPTIONAL\n * }\n *\n * For an RSA public key, the subjectPublicKey is:\n *\n * RSAPublicKey ::= SEQUENCE {\n *   modulus            INTEGER,    -- n\n *   publicExponent     INTEGER     -- e\n * }\n *\n * PrivateKeyInfo ::= SEQUENCE {\n *   version                   Version,\n *   privateKeyAlgorithm       PrivateKeyAlgorithmIdentifier,\n *   privateKey                PrivateKey,\n *   attributes           [0]  IMPLICIT Attributes OPTIONAL\n * }\n *\n * Version ::= INTEGER\n * PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier\n * PrivateKey ::= OCTET STRING\n * Attributes ::= SET OF Attribute\n *\n * An RSA private key as the following structure:\n *\n * RSAPrivateKey ::= SEQUENCE {\n *   version Version,\n *   modulus INTEGER, -- n\n *   publicExponent INTEGER, -- e\n *   privateExponent INTEGER, -- d\n *   prime1 INTEGER, -- p\n *   prime2 INTEGER, -- q\n *   exponent1 INTEGER, -- d mod (p-1)\n *   exponent2 INTEGER, -- d mod (q-1)\n *   coefficient INTEGER -- (inverse of q) mod p\n * }\n *\n * Version ::= INTEGER\n *\n * The OID for the RSA key algorithm is: 1.2.840.113549.1.1.1\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(71);\n__webpack_require__(198);\n__webpack_require__(101);\n__webpack_require__(486);\n__webpack_require__(490);\n__webpack_require__(52);\n__webpack_require__(9);\n\nif(typeof BigInteger === 'undefined') {\n  var BigInteger = forge.jsbn.BigInteger;\n}\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/*\n * RSA encryption and decryption, see RFC 2313.\n */\nforge.pki = forge.pki || {};\nmodule.exports = forge.pki.rsa = forge.rsa = forge.rsa || {};\nvar pki = forge.pki;\n\n// for finding primes, which are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29\nvar GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2];\n\n// validator for a PrivateKeyInfo structure\nvar privateKeyValidator = {\n  // PrivateKeyInfo\n  name: 'PrivateKeyInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    // Version (INTEGER)\n    name: 'PrivateKeyInfo.version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyVersion'\n  }, {\n    // privateKeyAlgorithm\n    name: 'PrivateKeyInfo.privateKeyAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'AlgorithmIdentifier.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'privateKeyOid'\n    }]\n  }, {\n    // PrivateKey\n    name: 'PrivateKeyInfo',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OCTETSTRING,\n    constructed: false,\n    capture: 'privateKey'\n  }]\n};\n\n// validator for an RSA private key\nvar rsaPrivateKeyValidator = {\n  // RSAPrivateKey\n  name: 'RSAPrivateKey',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    // Version (INTEGER)\n    name: 'RSAPrivateKey.version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyVersion'\n  }, {\n    // modulus (n)\n    name: 'RSAPrivateKey.modulus',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyModulus'\n  }, {\n    // publicExponent (e)\n    name: 'RSAPrivateKey.publicExponent',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyPublicExponent'\n  }, {\n    // privateExponent (d)\n    name: 'RSAPrivateKey.privateExponent',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyPrivateExponent'\n  }, {\n    // prime1 (p)\n    name: 'RSAPrivateKey.prime1',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyPrime1'\n  }, {\n    // prime2 (q)\n    name: 'RSAPrivateKey.prime2',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyPrime2'\n  }, {\n    // exponent1 (d mod (p-1))\n    name: 'RSAPrivateKey.exponent1',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyExponent1'\n  }, {\n    // exponent2 (d mod (q-1))\n    name: 'RSAPrivateKey.exponent2',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyExponent2'\n  }, {\n    // coefficient ((inverse of q) mod p)\n    name: 'RSAPrivateKey.coefficient',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'privateKeyCoefficient'\n  }]\n};\n\n// validator for an RSA public key\nvar rsaPublicKeyValidator = {\n  // RSAPublicKey\n  name: 'RSAPublicKey',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    // modulus (n)\n    name: 'RSAPublicKey.modulus',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'publicKeyModulus'\n  }, {\n    // publicExponent (e)\n    name: 'RSAPublicKey.exponent',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'publicKeyExponent'\n  }]\n};\n\n// validator for an SubjectPublicKeyInfo structure\n// Note: Currently only works with an RSA public key\nvar publicKeyValidator = forge.pki.rsa.publicKeyValidator = {\n  name: 'SubjectPublicKeyInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  captureAsn1: 'subjectPublicKeyInfo',\n  value: [{\n    name: 'SubjectPublicKeyInfo.AlgorithmIdentifier',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'AlgorithmIdentifier.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'publicKeyOid'\n    }]\n  }, {\n    // subjectPublicKey\n    name: 'SubjectPublicKeyInfo.subjectPublicKey',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.BITSTRING,\n    constructed: false,\n    value: [{\n      // RSAPublicKey\n      name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      optional: true,\n      captureAsn1: 'rsaPublicKey'\n    }]\n  }]\n};\n\n/**\n * Wrap digest in DigestInfo object.\n *\n * This function implements EMSA-PKCS1-v1_5-ENCODE as per RFC 3447.\n *\n * DigestInfo ::= SEQUENCE {\n *   digestAlgorithm DigestAlgorithmIdentifier,\n *   digest Digest\n * }\n *\n * DigestAlgorithmIdentifier ::= AlgorithmIdentifier\n * Digest ::= OCTET STRING\n *\n * @param md the message digest object with the hash to sign.\n *\n * @return the encoded message (ready for RSA encrytion)\n */\nvar emsaPkcs1v15encode = function(md) {\n  // get the oid for the algorithm\n  var oid;\n  if(md.algorithm in pki.oids) {\n    oid = pki.oids[md.algorithm];\n  } else {\n    var error = new Error('Unknown message digest algorithm.');\n    error.algorithm = md.algorithm;\n    throw error;\n  }\n  var oidBytes = asn1.oidToDer(oid).getBytes();\n\n  // create the digest info\n  var digestInfo = asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n  var digestAlgorithm = asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n  digestAlgorithm.value.push(asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.OID, false, oidBytes));\n  digestAlgorithm.value.push(asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.NULL, false, ''));\n  var digest = asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING,\n    false, md.digest().getBytes());\n  digestInfo.value.push(digestAlgorithm);\n  digestInfo.value.push(digest);\n\n  // encode digest info\n  return asn1.toDer(digestInfo).getBytes();\n};\n\n/**\n * Performs x^c mod n (RSA encryption or decryption operation).\n *\n * @param x the number to raise and mod.\n * @param key the key to use.\n * @param pub true if the key is public, false if private.\n *\n * @return the result of x^c mod n.\n */\nvar _modPow = function(x, key, pub) {\n  if(pub) {\n    return x.modPow(key.e, key.n);\n  }\n\n  if(!key.p || !key.q) {\n    // allow calculation without CRT params (slow)\n    return x.modPow(key.d, key.n);\n  }\n\n  // pre-compute dP, dQ, and qInv if necessary\n  if(!key.dP) {\n    key.dP = key.d.mod(key.p.subtract(BigInteger.ONE));\n  }\n  if(!key.dQ) {\n    key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE));\n  }\n  if(!key.qInv) {\n    key.qInv = key.q.modInverse(key.p);\n  }\n\n  /* Chinese remainder theorem (CRT) states:\n\n    Suppose n1, n2, ..., nk are positive integers which are pairwise\n    coprime (n1 and n2 have no common factors other than 1). For any\n    integers x1, x2, ..., xk there exists an integer x solving the\n    system of simultaneous congruences (where ~= means modularly\n    congruent so a ~= b mod n means a mod n = b mod n):\n\n    x ~= x1 mod n1\n    x ~= x2 mod n2\n    ...\n    x ~= xk mod nk\n\n    This system of congruences has a single simultaneous solution x\n    between 0 and n - 1. Furthermore, each xk solution and x itself\n    is congruent modulo the product n = n1*n2*...*nk.\n    So x1 mod n = x2 mod n = xk mod n = x mod n.\n\n    The single simultaneous solution x can be solved with the following\n    equation:\n\n    x = sum(xi*ri*si) mod n where ri = n/ni and si = ri^-1 mod ni.\n\n    Where x is less than n, xi = x mod ni.\n\n    For RSA we are only concerned with k = 2. The modulus n = pq, where\n    p and q are coprime. The RSA decryption algorithm is:\n\n    y = x^d mod n\n\n    Given the above:\n\n    x1 = x^d mod p\n    r1 = n/p = q\n    s1 = q^-1 mod p\n    x2 = x^d mod q\n    r2 = n/q = p\n    s2 = p^-1 mod q\n\n    So y = (x1r1s1 + x2r2s2) mod n\n         = ((x^d mod p)q(q^-1 mod p) + (x^d mod q)p(p^-1 mod q)) mod n\n\n    According to Fermat's Little Theorem, if the modulus P is prime,\n    for any integer A not evenly divisible by P, A^(P-1) ~= 1 mod P.\n    Since A is not divisible by P it follows that if:\n    N ~= M mod (P - 1), then A^N mod P = A^M mod P. Therefore:\n\n    A^N mod P = A^(M mod (P - 1)) mod P. (The latter takes less effort\n    to calculate). In order to calculate x^d mod p more quickly the\n    exponent d mod (p - 1) is stored in the RSA private key (the same\n    is done for x^d mod q). These values are referred to as dP and dQ\n    respectively. Therefore we now have:\n\n    y = ((x^dP mod p)q(q^-1 mod p) + (x^dQ mod q)p(p^-1 mod q)) mod n\n\n    Since we'll be reducing x^dP by modulo p (same for q) we can also\n    reduce x by p (and q respectively) before hand. Therefore, let\n\n    xp = ((x mod p)^dP mod p), and\n    xq = ((x mod q)^dQ mod q), yielding:\n\n    y = (xp*q*(q^-1 mod p) + xq*p*(p^-1 mod q)) mod n\n\n    This can be further reduced to a simple algorithm that only\n    requires 1 inverse (the q inverse is used) to be used and stored.\n    The algorithm is called Garner's algorithm. If qInv is the\n    inverse of q, we simply calculate:\n\n    y = (qInv*(xp - xq) mod p) * q + xq\n\n    However, there are two further complications. First, we need to\n    ensure that xp > xq to prevent signed BigIntegers from being used\n    so we add p until this is true (since we will be mod'ing with\n    p anyway). Then, there is a known timing attack on algorithms\n    using the CRT. To mitigate this risk, \"cryptographic blinding\"\n    should be used. This requires simply generating a random number r\n    between 0 and n-1 and its inverse and multiplying x by r^e before\n    calculating y and then multiplying y by r^-1 afterwards. Note that\n    r must be coprime with n (gcd(r, n) === 1) in order to have an\n    inverse.\n  */\n\n  // cryptographic blinding\n  var r;\n  do {\n    r = new BigInteger(\n      forge.util.bytesToHex(forge.random.getBytes(key.n.bitLength() / 8)),\n      16);\n  } while(r.compareTo(key.n) >= 0 || !r.gcd(key.n).equals(BigInteger.ONE));\n  x = x.multiply(r.modPow(key.e, key.n)).mod(key.n);\n\n  // calculate xp and xq\n  var xp = x.mod(key.p).modPow(key.dP, key.p);\n  var xq = x.mod(key.q).modPow(key.dQ, key.q);\n\n  // xp must be larger than xq to avoid signed bit usage\n  while(xp.compareTo(xq) < 0) {\n    xp = xp.add(key.p);\n  }\n\n  // do last step\n  var y = xp.subtract(xq)\n    .multiply(key.qInv).mod(key.p)\n    .multiply(key.q).add(xq);\n\n  // remove effect of random for cryptographic blinding\n  y = y.multiply(r.modInverse(key.n)).mod(key.n);\n\n  return y;\n};\n\n/**\n * NOTE: THIS METHOD IS DEPRECATED, use 'sign' on a private key object or\n * 'encrypt' on a public key object instead.\n *\n * Performs RSA encryption.\n *\n * The parameter bt controls whether to put padding bytes before the\n * message passed in. Set bt to either true or false to disable padding\n * completely (in order to handle e.g. EMSA-PSS encoding seperately before),\n * signaling whether the encryption operation is a public key operation\n * (i.e. encrypting data) or not, i.e. private key operation (data signing).\n *\n * For PKCS#1 v1.5 padding pass in the block type to use, i.e. either 0x01\n * (for signing) or 0x02 (for encryption). The key operation mode (private\n * or public) is derived from this flag in that case).\n *\n * @param m the message to encrypt as a byte string.\n * @param key the RSA key to use.\n * @param bt for PKCS#1 v1.5 padding, the block type to use\n *   (0x01 for private key, 0x02 for public),\n *   to disable padding: true = public key, false = private key.\n *\n * @return the encrypted bytes as a string.\n */\npki.rsa.encrypt = function(m, key, bt) {\n  var pub = bt;\n  var eb;\n\n  // get the length of the modulus in bytes\n  var k = Math.ceil(key.n.bitLength() / 8);\n\n  if(bt !== false && bt !== true) {\n    // legacy, default to PKCS#1 v1.5 padding\n    pub = (bt === 0x02);\n    eb = _encodePkcs1_v1_5(m, key, bt);\n  } else {\n    eb = forge.util.createBuffer();\n    eb.putBytes(m);\n  }\n\n  // load encryption block as big integer 'x'\n  // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n  var x = new BigInteger(eb.toHex(), 16);\n\n  // do RSA encryption\n  var y = _modPow(x, key, pub);\n\n  // convert y into the encrypted data byte string, if y is shorter in\n  // bytes than k, then prepend zero bytes to fill up ed\n  // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n  var yhex = y.toString(16);\n  var ed = forge.util.createBuffer();\n  var zeros = k - Math.ceil(yhex.length / 2);\n  while(zeros > 0) {\n    ed.putByte(0x00);\n    --zeros;\n  }\n  ed.putBytes(forge.util.hexToBytes(yhex));\n  return ed.getBytes();\n};\n\n/**\n * NOTE: THIS METHOD IS DEPRECATED, use 'decrypt' on a private key object or\n * 'verify' on a public key object instead.\n *\n * Performs RSA decryption.\n *\n * The parameter ml controls whether to apply PKCS#1 v1.5 padding\n * or not.  Set ml = false to disable padding removal completely\n * (in order to handle e.g. EMSA-PSS later on) and simply pass back\n * the RSA encryption block.\n *\n * @param ed the encrypted data to decrypt in as a byte string.\n * @param key the RSA key to use.\n * @param pub true for a public key operation, false for private.\n * @param ml the message length, if known, false to disable padding.\n *\n * @return the decrypted message as a byte string.\n */\npki.rsa.decrypt = function(ed, key, pub, ml) {\n  // get the length of the modulus in bytes\n  var k = Math.ceil(key.n.bitLength() / 8);\n\n  // error if the length of the encrypted data ED is not k\n  if(ed.length !== k) {\n    var error = new Error('Encrypted message length is invalid.');\n    error.length = ed.length;\n    error.expected = k;\n    throw error;\n  }\n\n  // convert encrypted data into a big integer\n  // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n  var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16);\n\n  // y must be less than the modulus or it wasn't the result of\n  // a previous mod operation (encryption) using that modulus\n  if(y.compareTo(key.n) >= 0) {\n    throw new Error('Encrypted message is invalid.');\n  }\n\n  // do RSA decryption\n  var x = _modPow(y, key, pub);\n\n  // create the encryption block, if x is shorter in bytes than k, then\n  // prepend zero bytes to fill up eb\n  // FIXME: hex conversion inefficient, get BigInteger w/byte strings\n  var xhex = x.toString(16);\n  var eb = forge.util.createBuffer();\n  var zeros = k - Math.ceil(xhex.length / 2);\n  while(zeros > 0) {\n    eb.putByte(0x00);\n    --zeros;\n  }\n  eb.putBytes(forge.util.hexToBytes(xhex));\n\n  if(ml !== false) {\n    // legacy, default to PKCS#1 v1.5 padding\n    return _decodePkcs1_v1_5(eb.getBytes(), key, pub);\n  }\n\n  // return message\n  return eb.getBytes();\n};\n\n/**\n * Creates an RSA key-pair generation state object. It is used to allow\n * key-generation to be performed in steps. It also allows for a UI to\n * display progress updates.\n *\n * @param bits the size for the private key in bits, defaults to 2048.\n * @param e the public exponent to use, defaults to 65537 (0x10001).\n * @param [options] the options to use.\n *          prng a custom crypto-secure pseudo-random number generator to use,\n *            that must define \"getBytesSync\".\n *          algorithm the algorithm to use (default: 'PRIMEINC').\n *\n * @return the state object to use to generate the key-pair.\n */\npki.rsa.createKeyPairGenerationState = function(bits, e, options) {\n  // TODO: migrate step-based prime generation code to forge.prime\n\n  // set default bits\n  if(typeof(bits) === 'string') {\n    bits = parseInt(bits, 10);\n  }\n  bits = bits || 2048;\n\n  // create prng with api that matches BigInteger secure random\n  options = options || {};\n  var prng = options.prng || forge.random;\n  var rng = {\n    // x is an array to fill with bytes\n    nextBytes: function(x) {\n      var b = prng.getBytesSync(x.length);\n      for(var i = 0; i < x.length; ++i) {\n        x[i] = b.charCodeAt(i);\n      }\n    }\n  };\n\n  var algorithm = options.algorithm || 'PRIMEINC';\n\n  // create PRIMEINC algorithm state\n  var rval;\n  if(algorithm === 'PRIMEINC') {\n    rval = {\n      algorithm: algorithm,\n      state: 0,\n      bits: bits,\n      rng: rng,\n      eInt: e || 65537,\n      e: new BigInteger(null),\n      p: null,\n      q: null,\n      qBits: bits >> 1,\n      pBits: bits - (bits >> 1),\n      pqState: 0,\n      num: null,\n      keys: null\n    };\n    rval.e.fromInt(rval.eInt);\n  } else {\n    throw new Error('Invalid key generation algorithm: ' + algorithm);\n  }\n\n  return rval;\n};\n\n/**\n * Attempts to runs the key-generation algorithm for at most n seconds\n * (approximately) using the given state. When key-generation has completed,\n * the keys will be stored in state.keys.\n *\n * To use this function to update a UI while generating a key or to prevent\n * causing browser lockups/warnings, set \"n\" to a value other than 0. A\n * simple pattern for generating a key and showing a progress indicator is:\n *\n * var state = pki.rsa.createKeyPairGenerationState(2048);\n * var step = function() {\n *   // step key-generation, run algorithm for 100 ms, repeat\n *   if(!forge.pki.rsa.stepKeyPairGenerationState(state, 100)) {\n *     setTimeout(step, 1);\n *   } else {\n *     // key-generation complete\n *     // TODO: turn off progress indicator here\n *     // TODO: use the generated key-pair in \"state.keys\"\n *   }\n * };\n * // TODO: turn on progress indicator here\n * setTimeout(step, 0);\n *\n * @param state the state to use.\n * @param n the maximum number of milliseconds to run the algorithm for, 0\n *          to run the algorithm to completion.\n *\n * @return true if the key-generation completed, false if not.\n */\npki.rsa.stepKeyPairGenerationState = function(state, n) {\n  // set default algorithm if not set\n  if(!('algorithm' in state)) {\n    state.algorithm = 'PRIMEINC';\n  }\n\n  // TODO: migrate step-based prime generation code to forge.prime\n  // TODO: abstract as PRIMEINC algorithm\n\n  // do key generation (based on Tom Wu's rsa.js, see jsbn.js license)\n  // with some minor optimizations and designed to run in steps\n\n  // local state vars\n  var THIRTY = new BigInteger(null);\n  THIRTY.fromInt(30);\n  var deltaIdx = 0;\n  var op_or = function(x, y) { return x|y; };\n\n  // keep stepping until time limit is reached or done\n  var t1 = +new Date();\n  var t2;\n  var total = 0;\n  while(state.keys === null && (n <= 0 || total < n)) {\n    // generate p or q\n    if(state.state === 0) {\n      /* Note: All primes are of the form:\n\n        30k+i, for i < 30 and gcd(30, i)=1, where there are 8 values for i\n\n        When we generate a random number, we always align it at 30k + 1. Each\n        time the number is determined not to be prime we add to get to the\n        next 'i', eg: if the number was at 30k + 1 we add 6. */\n      var bits = (state.p === null) ? state.pBits : state.qBits;\n      var bits1 = bits - 1;\n\n      // get a random number\n      if(state.pqState === 0) {\n        state.num = new BigInteger(bits, state.rng);\n        // force MSB set\n        if(!state.num.testBit(bits1)) {\n          state.num.bitwiseTo(\n            BigInteger.ONE.shiftLeft(bits1), op_or, state.num);\n        }\n        // align number on 30k+1 boundary\n        state.num.dAddOffset(31 - state.num.mod(THIRTY).byteValue(), 0);\n        deltaIdx = 0;\n\n        ++state.pqState;\n      } else if(state.pqState === 1) {\n        // try to make the number a prime\n        if(state.num.bitLength() > bits) {\n          // overflow, try again\n          state.pqState = 0;\n          // do primality test\n        } else if(state.num.isProbablePrime(\n          _getMillerRabinTests(state.num.bitLength()))) {\n          ++state.pqState;\n        } else {\n          // get next potential prime\n          state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);\n        }\n      } else if(state.pqState === 2) {\n        // ensure number is coprime with e\n        state.pqState =\n          (state.num.subtract(BigInteger.ONE).gcd(state.e)\n          .compareTo(BigInteger.ONE) === 0) ? 3 : 0;\n      } else if(state.pqState === 3) {\n        // store p or q\n        state.pqState = 0;\n        if(state.p === null) {\n          state.p = state.num;\n        } else {\n          state.q = state.num;\n        }\n\n        // advance state if both p and q are ready\n        if(state.p !== null && state.q !== null) {\n          ++state.state;\n        }\n        state.num = null;\n      }\n    } else if(state.state === 1) {\n      // ensure p is larger than q (swap them if not)\n      if(state.p.compareTo(state.q) < 0) {\n        state.num = state.p;\n        state.p = state.q;\n        state.q = state.num;\n      }\n      ++state.state;\n    } else if(state.state === 2) {\n      // compute phi: (p - 1)(q - 1) (Euler's totient function)\n      state.p1 = state.p.subtract(BigInteger.ONE);\n      state.q1 = state.q.subtract(BigInteger.ONE);\n      state.phi = state.p1.multiply(state.q1);\n      ++state.state;\n    } else if(state.state === 3) {\n      // ensure e and phi are coprime\n      if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) === 0) {\n        // phi and e are coprime, advance\n        ++state.state;\n      } else {\n        // phi and e aren't coprime, so generate a new p and q\n        state.p = null;\n        state.q = null;\n        state.state = 0;\n      }\n    } else if(state.state === 4) {\n      // create n, ensure n is has the right number of bits\n      state.n = state.p.multiply(state.q);\n\n      // ensure n is right number of bits\n      if(state.n.bitLength() === state.bits) {\n        // success, advance\n        ++state.state;\n      } else {\n        // failed, get new q\n        state.q = null;\n        state.state = 0;\n      }\n    } else if(state.state === 5) {\n      // set keys\n      var d = state.e.modInverse(state.phi);\n      state.keys = {\n        privateKey: pki.rsa.setPrivateKey(\n          state.n, state.e, d, state.p, state.q,\n          d.mod(state.p1), d.mod(state.q1),\n          state.q.modInverse(state.p)),\n        publicKey: pki.rsa.setPublicKey(state.n, state.e)\n      };\n    }\n\n    // update timing\n    t2 = +new Date();\n    total += t2 - t1;\n    t1 = t2;\n  }\n\n  return state.keys !== null;\n};\n\n/**\n * Generates an RSA public-private key pair in a single call.\n *\n * To generate a key-pair in steps (to allow for progress updates and to\n * prevent blocking or warnings in slow browsers) then use the key-pair\n * generation state functions.\n *\n * To generate a key-pair asynchronously (either through web-workers, if\n * available, or by breaking up the work on the main thread), pass a\n * callback function.\n *\n * @param [bits] the size for the private key in bits, defaults to 2048.\n * @param [e] the public exponent to use, defaults to 65537.\n * @param [options] options for key-pair generation, if given then 'bits'\n *          and 'e' must *not* be given:\n *          bits the size for the private key in bits, (default: 2048).\n *          e the public exponent to use, (default: 65537 (0x10001)).\n *          workerScript the worker script URL.\n *          workers the number of web workers (if supported) to use,\n *            (default: 2).\n *          workLoad the size of the work load, ie: number of possible prime\n *            numbers for each web worker to check per work assignment,\n *            (default: 100).\n *          prng a custom crypto-secure pseudo-random number generator to use,\n *            that must define \"getBytesSync\".\n *          algorithm the algorithm to use (default: 'PRIMEINC').\n * @param [callback(err, keypair)] called once the operation completes.\n *\n * @return an object with privateKey and publicKey properties.\n */\npki.rsa.generateKeyPair = function(bits, e, options, callback) {\n  // (bits), (options), (callback)\n  if(arguments.length === 1) {\n    if(typeof bits === 'object') {\n      options = bits;\n      bits = undefined;\n    } else if(typeof bits === 'function') {\n      callback = bits;\n      bits = undefined;\n    }\n  } else if(arguments.length === 2) {\n    // (bits, e), (bits, options), (bits, callback), (options, callback)\n    if(typeof bits === 'number') {\n      if(typeof e === 'function') {\n        callback = e;\n        e = undefined;\n      } else if(typeof e !== 'number') {\n        options = e;\n        e = undefined;\n      }\n    } else {\n      options = bits;\n      callback = e;\n      bits = undefined;\n      e = undefined;\n    }\n  } else if(arguments.length === 3) {\n    // (bits, e, options), (bits, e, callback), (bits, options, callback)\n    if(typeof e === 'number') {\n      if(typeof options === 'function') {\n        callback = options;\n        options = undefined;\n      }\n    } else {\n      callback = options;\n      options = e;\n      e = undefined;\n    }\n  }\n  options = options || {};\n  if(bits === undefined) {\n    bits = options.bits || 2048;\n  }\n  if(e === undefined) {\n    e = options.e || 0x10001;\n  }\n\n  // if native code is permitted and a callback is given, use native\n  // key generation code if available and if parameters are acceptable\n  if(!forge.options.usePureJavaScript && callback &&\n    bits >= 256 && bits <= 16384 && (e === 0x10001 || e === 3)) {\n    if(_detectSubtleCrypto('generateKey') && _detectSubtleCrypto('exportKey')) {\n      // use standard native generateKey\n      return window.crypto.subtle.generateKey({\n        name: 'RSASSA-PKCS1-v1_5',\n        modulusLength: bits,\n        publicExponent: _intToUint8Array(e),\n        hash: {name: 'SHA-256'}\n      }, true /* key can be exported*/, ['sign', 'verify'])\n      .then(function(pair) {\n        return window.crypto.subtle.exportKey('pkcs8', pair.privateKey);\n      // avoiding catch(function(err) {...}) to support IE <= 8\n      }).then(undefined, function(err) {\n        callback(err);\n      }).then(function(pkcs8) {\n        if(pkcs8) {\n          var privateKey = pki.privateKeyFromAsn1(\n            asn1.fromDer(forge.util.createBuffer(pkcs8)));\n          callback(null, {\n            privateKey: privateKey,\n            publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e)\n          });\n        }\n      });\n    }\n    if(_detectSubtleMsCrypto('generateKey') &&\n      _detectSubtleMsCrypto('exportKey')) {\n      var genOp = window.msCrypto.subtle.generateKey({\n        name: 'RSASSA-PKCS1-v1_5',\n        modulusLength: bits,\n        publicExponent: _intToUint8Array(e),\n        hash: {name: 'SHA-256'}\n      }, true /* key can be exported*/, ['sign', 'verify']);\n      genOp.oncomplete = function(e) {\n        var pair = e.target.result;\n        var exportOp = window.msCrypto.subtle.exportKey(\n          'pkcs8', pair.privateKey);\n        exportOp.oncomplete = function(e) {\n          var pkcs8 = e.target.result;\n          var privateKey = pki.privateKeyFromAsn1(\n            asn1.fromDer(forge.util.createBuffer(pkcs8)));\n          callback(null, {\n            privateKey: privateKey,\n            publicKey: pki.setRsaPublicKey(privateKey.n, privateKey.e)\n          });\n        };\n        exportOp.onerror = function(err) {\n          callback(err);\n        };\n      };\n      genOp.onerror = function(err) {\n        callback(err);\n      };\n      return;\n    }\n  }\n\n  // use JavaScript implementation\n  var state = pki.rsa.createKeyPairGenerationState(bits, e, options);\n  if(!callback) {\n    pki.rsa.stepKeyPairGenerationState(state, 0);\n    return state.keys;\n  }\n  _generateKeyPair(state, options, callback);\n};\n\n/**\n * Sets an RSA public key from BigIntegers modulus and exponent.\n *\n * @param n the modulus.\n * @param e the exponent.\n *\n * @return the public key.\n */\npki.setRsaPublicKey = pki.rsa.setPublicKey = function(n, e) {\n  var key = {\n    n: n,\n    e: e\n  };\n\n  /**\n   * Encrypts the given data with this public key. Newer applications\n   * should use the 'RSA-OAEP' decryption scheme, 'RSAES-PKCS1-V1_5' is for\n   * legacy applications.\n   *\n   * @param data the byte string to encrypt.\n   * @param scheme the encryption scheme to use:\n   *          'RSAES-PKCS1-V1_5' (default),\n   *          'RSA-OAEP',\n   *          'RAW', 'NONE', or null to perform raw RSA encryption,\n   *          an object with an 'encode' property set to a function\n   *          with the signature 'function(data, key)' that returns\n   *          a binary-encoded string representing the encoded data.\n   * @param schemeOptions any scheme-specific options.\n   *\n   * @return the encrypted byte string.\n   */\n  key.encrypt = function(data, scheme, schemeOptions) {\n    if(typeof scheme === 'string') {\n      scheme = scheme.toUpperCase();\n    } else if(scheme === undefined) {\n      scheme = 'RSAES-PKCS1-V1_5';\n    }\n\n    if(scheme === 'RSAES-PKCS1-V1_5') {\n      scheme = {\n        encode: function(m, key, pub) {\n          return _encodePkcs1_v1_5(m, key, 0x02).getBytes();\n        }\n      };\n    } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') {\n      scheme = {\n        encode: function(m, key) {\n          return forge.pkcs1.encode_rsa_oaep(key, m, schemeOptions);\n        }\n      };\n    } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) {\n      scheme = { encode: function(e) { return e; } };\n    } else if(typeof scheme === 'string') {\n      throw new Error('Unsupported encryption scheme: \"' + scheme + '\".');\n    }\n\n    // do scheme-based encoding then rsa encryption\n    var e = scheme.encode(data, key, true);\n    return pki.rsa.encrypt(e, key, true);\n  };\n\n  /**\n   * Verifies the given signature against the given digest.\n   *\n   * PKCS#1 supports multiple (currently two) signature schemes:\n   * RSASSA-PKCS1-V1_5 and RSASSA-PSS.\n   *\n   * By default this implementation uses the \"old scheme\", i.e.\n   * RSASSA-PKCS1-V1_5, in which case once RSA-decrypted, the\n   * signature is an OCTET STRING that holds a DigestInfo.\n   *\n   * DigestInfo ::= SEQUENCE {\n   *   digestAlgorithm DigestAlgorithmIdentifier,\n   *   digest Digest\n   * }\n   * DigestAlgorithmIdentifier ::= AlgorithmIdentifier\n   * Digest ::= OCTET STRING\n   *\n   * To perform PSS signature verification, provide an instance\n   * of Forge PSS object as the scheme parameter.\n   *\n   * @param digest the message digest hash to compare against the signature,\n   *          as a binary-encoded string.\n   * @param signature the signature to verify, as a binary-encoded string.\n   * @param scheme signature verification scheme to use:\n   *          'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5,\n   *          a Forge PSS object for RSASSA-PSS,\n   *          'NONE' or null for none, DigestInfo will not be expected, but\n   *            PKCS#1 v1.5 padding will still be used.\n   *\n   * @return true if the signature was verified, false if not.\n   */\n   key.verify = function(digest, signature, scheme) {\n     if(typeof scheme === 'string') {\n       scheme = scheme.toUpperCase();\n     } else if(scheme === undefined) {\n       scheme = 'RSASSA-PKCS1-V1_5';\n     }\n\n     if(scheme === 'RSASSA-PKCS1-V1_5') {\n       scheme = {\n         verify: function(digest, d) {\n           // remove padding\n           d = _decodePkcs1_v1_5(d, key, true);\n           // d is ASN.1 BER-encoded DigestInfo\n           var obj = asn1.fromDer(d);\n           // compare the given digest to the decrypted one\n           return digest === obj.value[1].value;\n         }\n       };\n     } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) {\n       scheme = {\n         verify: function(digest, d) {\n           // remove padding\n           d = _decodePkcs1_v1_5(d, key, true);\n           return digest === d;\n         }\n       };\n     }\n\n     // do rsa decryption w/o any decoding, then verify -- which does decoding\n     var d = pki.rsa.decrypt(signature, key, true, false);\n     return scheme.verify(digest, d, key.n.bitLength());\n  };\n\n  return key;\n};\n\n/**\n * Sets an RSA private key from BigIntegers modulus, exponent, primes,\n * prime exponents, and modular multiplicative inverse.\n *\n * @param n the modulus.\n * @param e the public exponent.\n * @param d the private exponent ((inverse of e) mod n).\n * @param p the first prime.\n * @param q the second prime.\n * @param dP exponent1 (d mod (p-1)).\n * @param dQ exponent2 (d mod (q-1)).\n * @param qInv ((inverse of q) mod p)\n *\n * @return the private key.\n */\npki.setRsaPrivateKey = pki.rsa.setPrivateKey = function(\n  n, e, d, p, q, dP, dQ, qInv) {\n  var key = {\n    n: n,\n    e: e,\n    d: d,\n    p: p,\n    q: q,\n    dP: dP,\n    dQ: dQ,\n    qInv: qInv\n  };\n\n  /**\n   * Decrypts the given data with this private key. The decryption scheme\n   * must match the one used to encrypt the data.\n   *\n   * @param data the byte string to decrypt.\n   * @param scheme the decryption scheme to use:\n   *          'RSAES-PKCS1-V1_5' (default),\n   *          'RSA-OAEP',\n   *          'RAW', 'NONE', or null to perform raw RSA decryption.\n   * @param schemeOptions any scheme-specific options.\n   *\n   * @return the decrypted byte string.\n   */\n  key.decrypt = function(data, scheme, schemeOptions) {\n    if(typeof scheme === 'string') {\n      scheme = scheme.toUpperCase();\n    } else if(scheme === undefined) {\n      scheme = 'RSAES-PKCS1-V1_5';\n    }\n\n    // do rsa decryption w/o any decoding\n    var d = pki.rsa.decrypt(data, key, false, false);\n\n    if(scheme === 'RSAES-PKCS1-V1_5') {\n      scheme = { decode: _decodePkcs1_v1_5 };\n    } else if(scheme === 'RSA-OAEP' || scheme === 'RSAES-OAEP') {\n      scheme = {\n        decode: function(d, key) {\n          return forge.pkcs1.decode_rsa_oaep(key, d, schemeOptions);\n        }\n      };\n    } else if(['RAW', 'NONE', 'NULL', null].indexOf(scheme) !== -1) {\n      scheme = { decode: function(d) { return d; } };\n    } else {\n      throw new Error('Unsupported encryption scheme: \"' + scheme + '\".');\n    }\n\n    // decode according to scheme\n    return scheme.decode(d, key, false);\n  };\n\n  /**\n   * Signs the given digest, producing a signature.\n   *\n   * PKCS#1 supports multiple (currently two) signature schemes:\n   * RSASSA-PKCS1-V1_5 and RSASSA-PSS.\n   *\n   * By default this implementation uses the \"old scheme\", i.e.\n   * RSASSA-PKCS1-V1_5. In order to generate a PSS signature, provide\n   * an instance of Forge PSS object as the scheme parameter.\n   *\n   * @param md the message digest object with the hash to sign.\n   * @param scheme the signature scheme to use:\n   *          'RSASSA-PKCS1-V1_5' or undefined for RSASSA PKCS#1 v1.5,\n   *          a Forge PSS object for RSASSA-PSS,\n   *          'NONE' or null for none, DigestInfo will not be used but\n   *            PKCS#1 v1.5 padding will still be used.\n   *\n   * @return the signature as a byte string.\n   */\n  key.sign = function(md, scheme) {\n    /* Note: The internal implementation of RSA operations is being\n      transitioned away from a PKCS#1 v1.5 hard-coded scheme. Some legacy\n      code like the use of an encoding block identifier 'bt' will eventually\n      be removed. */\n\n    // private key operation\n    var bt = false;\n\n    if(typeof scheme === 'string') {\n      scheme = scheme.toUpperCase();\n    }\n\n    if(scheme === undefined || scheme === 'RSASSA-PKCS1-V1_5') {\n      scheme = { encode: emsaPkcs1v15encode };\n      bt = 0x01;\n    } else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) {\n      scheme = { encode: function() { return md; } };\n      bt = 0x01;\n    }\n\n    // encode and then encrypt\n    var d = scheme.encode(md, key.n.bitLength());\n    return pki.rsa.encrypt(d, key, bt);\n  };\n\n  return key;\n};\n\n/**\n * Wraps an RSAPrivateKey ASN.1 object in an ASN.1 PrivateKeyInfo object.\n *\n * @param rsaKey the ASN.1 RSAPrivateKey.\n *\n * @return the ASN.1 PrivateKeyInfo.\n */\npki.wrapRsaPrivateKey = function(rsaKey) {\n  // PrivateKeyInfo\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version (0)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(0).getBytes()),\n    // privateKeyAlgorithm\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(pki.oids.rsaEncryption).getBytes()),\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n    ]),\n    // PrivateKey\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n      asn1.toDer(rsaKey).getBytes())\n    ]);\n};\n\n/**\n * Converts a private key from an ASN.1 object.\n *\n * @param obj the ASN.1 representation of a PrivateKeyInfo containing an\n *          RSAPrivateKey or an RSAPrivateKey.\n *\n * @return the private key.\n */\npki.privateKeyFromAsn1 = function(obj) {\n  // get PrivateKeyInfo\n  var capture = {};\n  var errors = [];\n  if(asn1.validate(obj, privateKeyValidator, capture, errors)) {\n    obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey));\n  }\n\n  // get RSAPrivateKey\n  capture = {};\n  errors = [];\n  if(!asn1.validate(obj, rsaPrivateKeyValidator, capture, errors)) {\n    var error = new Error('Cannot read private key. ' +\n      'ASN.1 object does not contain an RSAPrivateKey.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // Note: Version is currently ignored.\n  // capture.privateKeyVersion\n  // FIXME: inefficient, get a BigInteger that uses byte strings\n  var n, e, d, p, q, dP, dQ, qInv;\n  n = forge.util.createBuffer(capture.privateKeyModulus).toHex();\n  e = forge.util.createBuffer(capture.privateKeyPublicExponent).toHex();\n  d = forge.util.createBuffer(capture.privateKeyPrivateExponent).toHex();\n  p = forge.util.createBuffer(capture.privateKeyPrime1).toHex();\n  q = forge.util.createBuffer(capture.privateKeyPrime2).toHex();\n  dP = forge.util.createBuffer(capture.privateKeyExponent1).toHex();\n  dQ = forge.util.createBuffer(capture.privateKeyExponent2).toHex();\n  qInv = forge.util.createBuffer(capture.privateKeyCoefficient).toHex();\n\n  // set private key\n  return pki.setRsaPrivateKey(\n    new BigInteger(n, 16),\n    new BigInteger(e, 16),\n    new BigInteger(d, 16),\n    new BigInteger(p, 16),\n    new BigInteger(q, 16),\n    new BigInteger(dP, 16),\n    new BigInteger(dQ, 16),\n    new BigInteger(qInv, 16));\n};\n\n/**\n * Converts a private key to an ASN.1 RSAPrivateKey.\n *\n * @param key the private key.\n *\n * @return the ASN.1 representation of an RSAPrivateKey.\n */\npki.privateKeyToAsn1 = pki.privateKeyToRSAPrivateKey = function(key) {\n  // RSAPrivateKey\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version (0 = only 2 primes, 1 multiple primes)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(0).getBytes()),\n    // modulus (n)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.n)),\n    // publicExponent (e)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.e)),\n    // privateExponent (d)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.d)),\n    // privateKeyPrime1 (p)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.p)),\n    // privateKeyPrime2 (q)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.q)),\n    // privateKeyExponent1 (dP)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.dP)),\n    // privateKeyExponent2 (dQ)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.dQ)),\n    // coefficient (qInv)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.qInv))\n  ]);\n};\n\n/**\n * Converts a public key from an ASN.1 SubjectPublicKeyInfo or RSAPublicKey.\n *\n * @param obj the asn1 representation of a SubjectPublicKeyInfo or RSAPublicKey.\n *\n * @return the public key.\n */\npki.publicKeyFromAsn1 = function(obj) {\n  // get SubjectPublicKeyInfo\n  var capture = {};\n  var errors = [];\n  if(asn1.validate(obj, publicKeyValidator, capture, errors)) {\n    // get oid\n    var oid = asn1.derToOid(capture.publicKeyOid);\n    if(oid !== pki.oids.rsaEncryption) {\n      var error = new Error('Cannot read public key. Unknown OID.');\n      error.oid = oid;\n      throw error;\n    }\n    obj = capture.rsaPublicKey;\n  }\n\n  // get RSA params\n  errors = [];\n  if(!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) {\n    var error = new Error('Cannot read public key. ' +\n      'ASN.1 object does not contain an RSAPublicKey.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // FIXME: inefficient, get a BigInteger that uses byte strings\n  var n = forge.util.createBuffer(capture.publicKeyModulus).toHex();\n  var e = forge.util.createBuffer(capture.publicKeyExponent).toHex();\n\n  // set public key\n  return pki.setRsaPublicKey(\n    new BigInteger(n, 16),\n    new BigInteger(e, 16));\n};\n\n/**\n * Converts a public key to an ASN.1 SubjectPublicKeyInfo.\n *\n * @param key the public key.\n *\n * @return the asn1 representation of a SubjectPublicKeyInfo.\n */\npki.publicKeyToAsn1 = pki.publicKeyToSubjectPublicKeyInfo = function(key) {\n  // SubjectPublicKeyInfo\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // AlgorithmIdentifier\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(pki.oids.rsaEncryption).getBytes()),\n      // parameters (null)\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n    ]),\n    // subjectPublicKey\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, [\n      pki.publicKeyToRSAPublicKey(key)\n    ])\n  ]);\n};\n\n/**\n * Converts a public key to an ASN.1 RSAPublicKey.\n *\n * @param key the public key.\n *\n * @return the asn1 representation of a RSAPublicKey.\n */\npki.publicKeyToRSAPublicKey = function(key) {\n  // RSAPublicKey\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // modulus (n)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.n)),\n    // publicExponent (e)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      _bnToBytes(key.e))\n  ]);\n};\n\n/**\n * Encodes a message using PKCS#1 v1.5 padding.\n *\n * @param m the message to encode.\n * @param key the RSA key to use.\n * @param bt the block type to use, i.e. either 0x01 (for signing) or 0x02\n *          (for encryption).\n *\n * @return the padded byte buffer.\n */\nfunction _encodePkcs1_v1_5(m, key, bt) {\n  var eb = forge.util.createBuffer();\n\n  // get the length of the modulus in bytes\n  var k = Math.ceil(key.n.bitLength() / 8);\n\n  /* use PKCS#1 v1.5 padding */\n  if(m.length > (k - 11)) {\n    var error = new Error('Message is too long for PKCS#1 v1.5 padding.');\n    error.length = m.length;\n    error.max = k - 11;\n    throw error;\n  }\n\n  /* A block type BT, a padding string PS, and the data D shall be\n    formatted into an octet string EB, the encryption block:\n\n    EB = 00 || BT || PS || 00 || D\n\n    The block type BT shall be a single octet indicating the structure of\n    the encryption block. For this version of the document it shall have\n    value 00, 01, or 02. For a private-key operation, the block type\n    shall be 00 or 01. For a public-key operation, it shall be 02.\n\n    The padding string PS shall consist of k-3-||D|| octets. For block\n    type 00, the octets shall have value 00; for block type 01, they\n    shall have value FF; and for block type 02, they shall be\n    pseudorandomly generated and nonzero. This makes the length of the\n    encryption block EB equal to k. */\n\n  // build the encryption block\n  eb.putByte(0x00);\n  eb.putByte(bt);\n\n  // create the padding\n  var padNum = k - 3 - m.length;\n  var padByte;\n  // private key op\n  if(bt === 0x00 || bt === 0x01) {\n    padByte = (bt === 0x00) ? 0x00 : 0xFF;\n    for(var i = 0; i < padNum; ++i) {\n      eb.putByte(padByte);\n    }\n  } else {\n    // public key op\n    // pad with random non-zero values\n    while(padNum > 0) {\n      var numZeros = 0;\n      var padBytes = forge.random.getBytes(padNum);\n      for(var i = 0; i < padNum; ++i) {\n        padByte = padBytes.charCodeAt(i);\n        if(padByte === 0) {\n          ++numZeros;\n        } else {\n          eb.putByte(padByte);\n        }\n      }\n      padNum = numZeros;\n    }\n  }\n\n  // zero followed by message\n  eb.putByte(0x00);\n  eb.putBytes(m);\n\n  return eb;\n}\n\n/**\n * Decodes a message using PKCS#1 v1.5 padding.\n *\n * @param em the message to decode.\n * @param key the RSA key to use.\n * @param pub true if the key is a public key, false if it is private.\n * @param ml the message length, if specified.\n *\n * @return the decoded bytes.\n */\nfunction _decodePkcs1_v1_5(em, key, pub, ml) {\n  // get the length of the modulus in bytes\n  var k = Math.ceil(key.n.bitLength() / 8);\n\n  /* It is an error if any of the following conditions occurs:\n\n    1. The encryption block EB cannot be parsed unambiguously.\n    2. The padding string PS consists of fewer than eight octets\n      or is inconsisent with the block type BT.\n    3. The decryption process is a public-key operation and the block\n      type BT is not 00 or 01, or the decryption process is a\n      private-key operation and the block type is not 02.\n   */\n\n  // parse the encryption block\n  var eb = forge.util.createBuffer(em);\n  var first = eb.getByte();\n  var bt = eb.getByte();\n  if(first !== 0x00 ||\n    (pub && bt !== 0x00 && bt !== 0x01) ||\n    (!pub && bt != 0x02) ||\n    (pub && bt === 0x00 && typeof(ml) === 'undefined')) {\n    throw new Error('Encryption block is invalid.');\n  }\n\n  var padNum = 0;\n  if(bt === 0x00) {\n    // check all padding bytes for 0x00\n    padNum = k - 3 - ml;\n    for(var i = 0; i < padNum; ++i) {\n      if(eb.getByte() !== 0x00) {\n        throw new Error('Encryption block is invalid.');\n      }\n    }\n  } else if(bt === 0x01) {\n    // find the first byte that isn't 0xFF, should be after all padding\n    padNum = 0;\n    while(eb.length() > 1) {\n      if(eb.getByte() !== 0xFF) {\n        --eb.read;\n        break;\n      }\n      ++padNum;\n    }\n  } else if(bt === 0x02) {\n    // look for 0x00 byte\n    padNum = 0;\n    while(eb.length() > 1) {\n      if(eb.getByte() === 0x00) {\n        --eb.read;\n        break;\n      }\n      ++padNum;\n    }\n  }\n\n  // zero must be 0x00 and padNum must be (k - 3 - message length)\n  var zero = eb.getByte();\n  if(zero !== 0x00 || padNum !== (k - 3 - eb.length())) {\n    throw new Error('Encryption block is invalid.');\n  }\n\n  return eb.getBytes();\n}\n\n/**\n * Runs the key-generation algorithm asynchronously, either in the background\n * via Web Workers, or using the main thread and setImmediate.\n *\n * @param state the key-pair generation state.\n * @param [options] options for key-pair generation:\n *          workerScript the worker script URL.\n *          workers the number of web workers (if supported) to use,\n *            (default: 2, -1 to use estimated cores minus one).\n *          workLoad the size of the work load, ie: number of possible prime\n *            numbers for each web worker to check per work assignment,\n *            (default: 100).\n * @param callback(err, keypair) called once the operation completes.\n */\nfunction _generateKeyPair(state, options, callback) {\n  if(typeof options === 'function') {\n    callback = options;\n    options = {};\n  }\n  options = options || {};\n\n  var opts = {\n    algorithm: {\n      name: options.algorithm || 'PRIMEINC',\n      options: {\n        workers: options.workers || 2,\n        workLoad: options.workLoad || 100,\n        workerScript: options.workerScript\n      }\n    }\n  };\n  if('prng' in options) {\n    opts.prng = options.prng;\n  }\n\n  generate();\n\n  function generate() {\n    // find p and then q (done in series to simplify)\n    getPrime(state.pBits, function(err, num) {\n      if(err) {\n        return callback(err);\n      }\n      state.p = num;\n      if(state.q !== null) {\n        return finish(err, state.q);\n      }\n      getPrime(state.qBits, finish);\n    });\n  }\n\n  function getPrime(bits, callback) {\n    forge.prime.generateProbablePrime(bits, opts, callback);\n  }\n\n  function finish(err, num) {\n    if(err) {\n      return callback(err);\n    }\n\n    // set q\n    state.q = num;\n\n    // ensure p is larger than q (swap them if not)\n    if(state.p.compareTo(state.q) < 0) {\n      var tmp = state.p;\n      state.p = state.q;\n      state.q = tmp;\n    }\n\n    // ensure p is coprime with e\n    if(state.p.subtract(BigInteger.ONE).gcd(state.e)\n      .compareTo(BigInteger.ONE) !== 0) {\n      state.p = null;\n      generate();\n      return;\n    }\n\n    // ensure q is coprime with e\n    if(state.q.subtract(BigInteger.ONE).gcd(state.e)\n      .compareTo(BigInteger.ONE) !== 0) {\n      state.q = null;\n      getPrime(state.qBits, finish);\n      return;\n    }\n\n    // compute phi: (p - 1)(q - 1) (Euler's totient function)\n    state.p1 = state.p.subtract(BigInteger.ONE);\n    state.q1 = state.q.subtract(BigInteger.ONE);\n    state.phi = state.p1.multiply(state.q1);\n\n    // ensure e and phi are coprime\n    if(state.phi.gcd(state.e).compareTo(BigInteger.ONE) !== 0) {\n      // phi and e aren't coprime, so generate a new p and q\n      state.p = state.q = null;\n      generate();\n      return;\n    }\n\n    // create n, ensure n is has the right number of bits\n    state.n = state.p.multiply(state.q);\n    if(state.n.bitLength() !== state.bits) {\n      // failed, get new q\n      state.q = null;\n      getPrime(state.qBits, finish);\n      return;\n    }\n\n    // set keys\n    var d = state.e.modInverse(state.phi);\n    state.keys = {\n      privateKey: pki.rsa.setPrivateKey(\n        state.n, state.e, d, state.p, state.q,\n        d.mod(state.p1), d.mod(state.q1),\n        state.q.modInverse(state.p)),\n      publicKey: pki.rsa.setPublicKey(state.n, state.e)\n    };\n\n    callback(null, state.keys);\n  }\n}\n\n/**\n * Converts a positive BigInteger into 2's-complement big-endian bytes.\n *\n * @param b the big integer to convert.\n *\n * @return the bytes.\n */\nfunction _bnToBytes(b) {\n  // prepend 0x00 if first byte >= 0x80\n  var hex = b.toString(16);\n  if(hex[0] >= '8') {\n    hex = '00' + hex;\n  }\n  var bytes = forge.util.hexToBytes(hex);\n\n  // ensure integer is minimally-encoded\n  if(bytes.length > 1 &&\n    // leading 0x00 for positive integer\n    ((bytes.charCodeAt(0) === 0 &&\n    (bytes.charCodeAt(1) & 0x80) === 0) ||\n    // leading 0xFF for negative integer\n    (bytes.charCodeAt(0) === 0xFF &&\n    (bytes.charCodeAt(1) & 0x80) === 0x80))) {\n    return bytes.substr(1);\n  }\n  return bytes;\n}\n\n/**\n * Returns the required number of Miller-Rabin tests to generate a\n * prime with an error probability of (1/2)^80.\n *\n * See Handbook of Applied Cryptography Chapter 4, Table 4.4.\n *\n * @param bits the bit size.\n *\n * @return the required number of iterations.\n */\nfunction _getMillerRabinTests(bits) {\n  if(bits <= 100) return 27;\n  if(bits <= 150) return 18;\n  if(bits <= 200) return 15;\n  if(bits <= 250) return 12;\n  if(bits <= 300) return 9;\n  if(bits <= 350) return 8;\n  if(bits <= 400) return 7;\n  if(bits <= 500) return 6;\n  if(bits <= 600) return 5;\n  if(bits <= 800) return 4;\n  if(bits <= 1250) return 3;\n  return 2;\n}\n\n/**\n * Performs feature detection on the SubtleCrypto interface.\n *\n * @param fn the feature (function) to detect.\n *\n * @return true if detected, false if not.\n */\nfunction _detectSubtleCrypto(fn) {\n  return (typeof window !== 'undefined' &&\n    typeof window.crypto === 'object' &&\n    typeof window.crypto.subtle === 'object' &&\n    typeof window.crypto.subtle[fn] === 'function');\n}\n\n/**\n * Performs feature detection on the deprecated Microsoft Internet Explorer\n * outdated SubtleCrypto interface. This function should only be used after\n * checking for the modern, standard SubtleCrypto interface.\n *\n * @param fn the feature (function) to detect.\n *\n * @return true if detected, false if not.\n */\nfunction _detectSubtleMsCrypto(fn) {\n  return (typeof window !== 'undefined' &&\n    typeof window.msCrypto === 'object' &&\n    typeof window.msCrypto.subtle === 'object' &&\n    typeof window.msCrypto.subtle[fn] === 'function');\n}\n\nfunction _intToUint8Array(x) {\n  var bytes = forge.util.hexToBytes(x.toString(16));\n  var buffer = new Uint8Array(bytes.length);\n  for(var i = 0; i < bytes.length; ++i) {\n    buffer[i] = bytes.charCodeAt(i);\n  }\n  return buffer;\n}\n\nfunction _privateKeyFromJwk(jwk) {\n  if(jwk.kty !== 'RSA') {\n    throw new Error(\n      'Unsupported key algorithm \"' + jwk.kty + '\"; algorithm must be \"RSA\".');\n  }\n  return pki.setRsaPrivateKey(\n    _base64ToBigInt(jwk.n),\n    _base64ToBigInt(jwk.e),\n    _base64ToBigInt(jwk.d),\n    _base64ToBigInt(jwk.p),\n    _base64ToBigInt(jwk.q),\n    _base64ToBigInt(jwk.dp),\n    _base64ToBigInt(jwk.dq),\n    _base64ToBigInt(jwk.qi));\n}\n\nfunction _publicKeyFromJwk(jwk) {\n  if(jwk.kty !== 'RSA') {\n    throw new Error('Key algorithm must be \"RSA\".');\n  }\n  return pki.setRsaPublicKey(\n    _base64ToBigInt(jwk.n),\n    _base64ToBigInt(jwk.e));\n}\n\nfunction _base64ToBigInt(b64) {\n  return new BigInteger(forge.util.bytesToHex(forge.util.decode64(b64)), 16);\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/rsa.js\n// module id = 199\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/rsa.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var asn1 = __webpack_require__(1138)\nvar aesid = __webpack_require__(1137)\nvar fixProc = __webpack_require__(1140)\nvar ciphers = __webpack_require__(168)\nvar compat = __webpack_require__(297)\nmodule.exports = parseKeys\n\nfunction parseKeys (buffer) {\n  var password\n  if (typeof buffer === 'object' && !Buffer.isBuffer(buffer)) {\n    password = buffer.passphrase\n    buffer = buffer.key\n  }\n  if (typeof buffer === 'string') {\n    buffer = new Buffer(buffer)\n  }\n\n  var stripped = fixProc(buffer, password)\n\n  var type = stripped.tag\n  var data = stripped.data\n  var subtype, ndata\n  switch (type) {\n    case 'CERTIFICATE':\n      ndata = asn1.certificate.decode(data, 'der').tbsCertificate.subjectPublicKeyInfo\n      // falls through\n    case 'PUBLIC KEY':\n      if (!ndata) {\n        ndata = asn1.PublicKey.decode(data, 'der')\n      }\n      subtype = ndata.algorithm.algorithm.join('.')\n      switch (subtype) {\n        case '1.2.840.113549.1.1.1':\n          return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')\n        case '1.2.840.10045.2.1':\n          ndata.subjectPrivateKey = ndata.subjectPublicKey\n          return {\n            type: 'ec',\n            data: ndata\n          }\n        case '1.2.840.10040.4.1':\n          ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, 'der')\n          return {\n            type: 'dsa',\n            data: ndata.algorithm.params\n          }\n        default: throw new Error('unknown key id ' + subtype)\n      }\n      throw new Error('unknown key type ' + type)\n    case 'ENCRYPTED PRIVATE KEY':\n      data = asn1.EncryptedPrivateKey.decode(data, 'der')\n      data = decrypt(data, password)\n      // falls through\n    case 'PRIVATE KEY':\n      ndata = asn1.PrivateKey.decode(data, 'der')\n      subtype = ndata.algorithm.algorithm.join('.')\n      switch (subtype) {\n        case '1.2.840.113549.1.1.1':\n          return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, 'der')\n        case '1.2.840.10045.2.1':\n          return {\n            curve: ndata.algorithm.curve,\n            privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, 'der').privateKey\n          }\n        case '1.2.840.10040.4.1':\n          ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, 'der')\n          return {\n            type: 'dsa',\n            params: ndata.algorithm.params\n          }\n        default: throw new Error('unknown key id ' + subtype)\n      }\n      throw new Error('unknown key type ' + type)\n    case 'RSA PUBLIC KEY':\n      return asn1.RSAPublicKey.decode(data, 'der')\n    case 'RSA PRIVATE KEY':\n      return asn1.RSAPrivateKey.decode(data, 'der')\n    case 'DSA PRIVATE KEY':\n      return {\n        type: 'dsa',\n        params: asn1.DSAPrivateKey.decode(data, 'der')\n      }\n    case 'EC PRIVATE KEY':\n      data = asn1.ECPrivateKey.decode(data, 'der')\n      return {\n        curve: data.parameters.value,\n        privateKey: data.privateKey\n      }\n    default: throw new Error('unknown key type ' + type)\n  }\n}\nparseKeys.signature = asn1.signature\nfunction decrypt (data, password) {\n  var salt = data.algorithm.decrypt.kde.kdeparams.salt\n  var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)\n  var algo = aesid[data.algorithm.decrypt.cipher.algo.join('.')]\n  var iv = data.algorithm.decrypt.cipher.iv\n  var cipherText = data.subjectPrivateKey\n  var keylen = parseInt(algo.split('-')[1], 10) / 8\n  var key = compat.pbkdf2Sync(password, salt, iters, keylen)\n  var cipher = ciphers.createDecipheriv(algo, key, iv)\n  var out = []\n  out.push(cipher.update(cipherText))\n  out.push(cipher.final())\n  return Buffer.concat(out)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/index.js\n// module id = 200\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/index.js")},function(module,exports){eval("/**\r\n * Compiles a querystring\r\n * Returns string representation of the object\r\n *\r\n * @param {Object}\r\n * @api private\r\n */\r\n\r\nexports.encode = function (obj) {\r\n  var str = '';\r\n\r\n  for (var i in obj) {\r\n    if (obj.hasOwnProperty(i)) {\r\n      if (str.length) str += '&';\r\n      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\r\n    }\r\n  }\r\n\r\n  return str;\r\n};\r\n\r\n/**\r\n * Parses a simple querystring into an object\r\n *\r\n * @param {String} qs\r\n * @api private\r\n */\r\n\r\nexports.decode = function(qs){\r\n  var qry = {};\r\n  var pairs = qs.split('&');\r\n  for (var i = 0, l = pairs.length; i < l; i++) {\r\n    var pair = pairs[i].split('=');\r\n    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\r\n  }\r\n  return qry;\r\n};\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseqs/index.js\n// module id = 201\n// module chunks = 0\n\n//# sourceURL=../node_modules/parseqs/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n  // if the path tries to go above the root, `up` ends up > 0\n  var up = 0;\n  for (var i = parts.length - 1; i >= 0; i--) {\n    var last = parts[i];\n    if (last === '.') {\n      parts.splice(i, 1);\n    } else if (last === '..') {\n      parts.splice(i, 1);\n      up++;\n    } else if (up) {\n      parts.splice(i, 1);\n      up--;\n    }\n  }\n\n  // if the path is allowed to go above the root, restore leading ..s\n  if (allowAboveRoot) {\n    for (; up--; up) {\n      parts.unshift('..');\n    }\n  }\n\n  return parts;\n}\n\n// Split a filename into [root, dir, basename, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n    /^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;\nvar splitPath = function(filename) {\n  return splitPathRe.exec(filename).slice(1);\n};\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\n  var resolvedPath = '',\n      resolvedAbsolute = false;\n\n  for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {\n    var path = (i >= 0) ? arguments[i] : process.cwd();\n\n    // Skip empty and invalid entries\n    if (typeof path !== 'string') {\n      throw new TypeError('Arguments to path.resolve must be strings');\n    } else if (!path) {\n      continue;\n    }\n\n    resolvedPath = path + '/' + resolvedPath;\n    resolvedAbsolute = path.charAt(0) === '/';\n  }\n\n  // At this point the path should be resolved to a full absolute path, but\n  // handle relative paths to be safe (might happen when process.cwd() fails)\n\n  // Normalize the path\n  resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n    return !!p;\n  }), !resolvedAbsolute).join('/');\n\n  return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\n  var isAbsolute = exports.isAbsolute(path),\n      trailingSlash = substr(path, -1) === '/';\n\n  // Normalize the path\n  path = normalizeArray(filter(path.split('/'), function(p) {\n    return !!p;\n  }), !isAbsolute).join('/');\n\n  if (!path && !isAbsolute) {\n    path = '.';\n  }\n  if (path && trailingSlash) {\n    path += '/';\n  }\n\n  return (isAbsolute ? '/' : '') + path;\n};\n\n// posix version\nexports.isAbsolute = function(path) {\n  return path.charAt(0) === '/';\n};\n\n// posix version\nexports.join = function() {\n  var paths = Array.prototype.slice.call(arguments, 0);\n  return exports.normalize(filter(paths, function(p, index) {\n    if (typeof p !== 'string') {\n      throw new TypeError('Arguments to path.join must be strings');\n    }\n    return p;\n  }).join('/'));\n};\n\n\n// path.relative(from, to)\n// posix version\nexports.relative = function(from, to) {\n  from = exports.resolve(from).substr(1);\n  to = exports.resolve(to).substr(1);\n\n  function trim(arr) {\n    var start = 0;\n    for (; start < arr.length; start++) {\n      if (arr[start] !== '') break;\n    }\n\n    var end = arr.length - 1;\n    for (; end >= 0; end--) {\n      if (arr[end] !== '') break;\n    }\n\n    if (start > end) return [];\n    return arr.slice(start, end - start + 1);\n  }\n\n  var fromParts = trim(from.split('/'));\n  var toParts = trim(to.split('/'));\n\n  var length = Math.min(fromParts.length, toParts.length);\n  var samePartsLength = length;\n  for (var i = 0; i < length; i++) {\n    if (fromParts[i] !== toParts[i]) {\n      samePartsLength = i;\n      break;\n    }\n  }\n\n  var outputParts = [];\n  for (var i = samePartsLength; i < fromParts.length; i++) {\n    outputParts.push('..');\n  }\n\n  outputParts = outputParts.concat(toParts.slice(samePartsLength));\n\n  return outputParts.join('/');\n};\n\nexports.sep = '/';\nexports.delimiter = ':';\n\nexports.dirname = function(path) {\n  var result = splitPath(path),\n      root = result[0],\n      dir = result[1];\n\n  if (!root && !dir) {\n    // No dirname whatsoever\n    return '.';\n  }\n\n  if (dir) {\n    // It has a dirname, strip trailing slash\n    dir = dir.substr(0, dir.length - 1);\n  }\n\n  return root + dir;\n};\n\n\nexports.basename = function(path, ext) {\n  var f = splitPath(path)[2];\n  // TODO: make this comparison case-insensitive on windows?\n  if (ext && f.substr(-1 * ext.length) === ext) {\n    f = f.substr(0, f.length - ext.length);\n  }\n  return f;\n};\n\n\nexports.extname = function(path) {\n  return splitPath(path)[3];\n};\n\nfunction filter (xs, f) {\n    if (xs.filter) return xs.filter(f);\n    var res = [];\n    for (var i = 0; i < xs.length; i++) {\n        if (f(xs[i], i, xs)) res.push(xs[i]);\n    }\n    return res;\n}\n\n// String.prototype.substr - negative index don't work in IE8\nvar substr = 'ab'.substr(-1) === 'b'\n    ? function (str, start, len) { return str.substr(start, len) }\n    : function (str, start, len) {\n        if (start < 0) start = str.length + start;\n        return str.substr(start, len);\n    }\n;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/path-browserify/index.js\n// module id = 202\n// module chunks = 0\n\n//# sourceURL=../node_modules/path-browserify/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nif (!process.version ||\n    process.version.indexOf('v0.') === 0 ||\n    process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {\n  module.exports = { nextTick: nextTick };\n} else {\n  module.exports = process\n}\n\nfunction nextTick(fn, arg1, arg2, arg3) {\n  if (typeof fn !== 'function') {\n    throw new TypeError('\"callback\" argument must be a function');\n  }\n  var len = arguments.length;\n  var args, i;\n  switch (len) {\n  case 0:\n  case 1:\n    return process.nextTick(fn);\n  case 2:\n    return process.nextTick(function afterTickOne() {\n      fn.call(null, arg1);\n    });\n  case 3:\n    return process.nextTick(function afterTickTwo() {\n      fn.call(null, arg1, arg2);\n    });\n  case 4:\n    return process.nextTick(function afterTickThree() {\n      fn.call(null, arg1, arg2, arg3);\n    });\n  default:\n    args = new Array(len - 1);\n    i = 0;\n    while (i < args.length) {\n      args[i++] = arguments[i];\n    }\n    return process.nextTick(function afterTick() {\n      fn.apply(null, args);\n    });\n  }\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/process-nextick-args/index.js\n// module id = 203\n// module chunks = 0\n\n//# sourceURL=../node_modules/process-nextick-args/index.js")},function(module,exports){eval("\nmodule.exports = function () {\n  var _read, _cb, abortCb, _end\n\n  var read = function (end, cb) {\n    if(!_read) {\n      if(end) {\n        _end = end\n        abortCb = cb\n      }\n      else\n        _cb = cb\n    }\n    else _read(end, cb)\n  }\n  read.resolve = function (read) {\n    if(_read) throw new Error('already resolved')\n    _read = read\n    if(!_read) throw new Error('no read cannot resolve!' + _read)\n    if(_cb) read(null, _cb)\n    if(abortCb) read(_end, abortCb)\n  }\n  read.abort = function(err) {\n    read.resolve(function (_, cb) {\n      cb(err || true)\n    })\n  }\n  return read\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-defer/source.js\n// module id = 204\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-defer/source.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//a pair of pull streams where one drains from the other\nmodule.exports = function () {\n  var _read, waiting\n  function sink (read) {\n    if('function' !== typeof read)\n      throw new Error('read must be function')\n\n    if(_read)\n      throw new Error('already piped')\n    _read = read\n    if(waiting) {\n      var _waiting = waiting\n      waiting = null\n      _read.apply(null, _waiting)\n    }\n  }\n  function source (abort, cb) {\n    if(_read)\n      _read(abort, cb)\n    else\n      waiting = [abort, cb]\n  }\n\n  return {\n    source: source, sink: sink\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-pair/index.js\n// module id = 205\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-pair/index.js")},function(module,exports,__webpack_require__){eval("var looper = __webpack_require__(468)\n\nmodule.exports = function (writer, ender) {\n  return function (read) {\n    var queue = [], ended, error\n\n    function enqueue (data) {\n      queue.push(data)\n    }\n\n    writer = writer || function (data) {\n      this.queue(data)\n    }\n\n    ender = ender || function () {\n      this.queue(null)\n    }\n\n    var emitter = {\n      emit: function (event, data) {\n        if(event == 'data') enqueue(data)\n        if(event == 'end')  ended = true, enqueue(null)\n        if(event == 'error') error = data\n      },\n      queue: enqueue\n    }\n    var _cb\n    return function (end, cb) {\n      ended = ended || end\n      if(end)\n        return read(end, function () {\n          if(_cb) {\n            var t = _cb; _cb = null; t(end)\n          }\n          cb(end)\n        })\n\n      _cb = cb\n      looper(function pull (next) {\n        //if it's an error\n        if(!_cb) return\n        cb = _cb\n        if(error) _cb = null, cb(error)\n        else if(queue.length) {\n          var data = queue.shift()\n          _cb = null,cb(data === null, data)\n        }\n        else {\n          read(ended, function (end, data) {\n             //null has no special meaning for pull-stream\n            if(end && end !== true) {\n              error = end; return next()\n            }\n            if(ended = ended || end)  ender.call(emitter)\n            else if(data !== null) {\n              writer.call(emitter, data)\n              if(error || ended)\n                return read(error || ended, function () {\n                  _cb = null; cb(error || ended)\n                })\n            }\n            next(pull)\n          })\n        }\n      })\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-through/index.js\n// module id = 206\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-through/index.js")},function(module,exports,__webpack_require__){eval("//another idea: buffer 2* the max, but only call write with half of that,\n//this could manage cases where the read ahead is latent. Hmm, we probably\n//shouldn't guess at that here, just handle write latency.\n\n//how would we measure this anyway?\n\nvar Looper = __webpack_require__(1196)\n\nfunction append (array, item) {\n  (array = array || []).push(item)\n  return array\n}\n\nmodule.exports = function (write, reduce, max, cb) {\n  reduce = reduce || append\n  var ended, _cb, _read\n  function reader (read) {\n    var queue = null, writing = false, length = 0\n    _read = read\n    if(ended)\n      return read(ended.abort ? true : ended, function (err) {\n        cb(err); _cb && _cb()\n      })\n\n    var reading = false\n    var more = Looper(function () {\n        if(reading || ended) return\n        reading = true\n        read(null, function (err, data) {\n          reading = false\n          ;(function (end, data) {\n            if(ended) return\n            ended = end\n            if(!ended) {\n              queue = reduce(queue, data)\n              length = (queue && queue.length) || 0\n              if(queue != null) flush()\n              if(length < max) more()\n            }\n            else if(!writing) cb(ended === true ? null : ended)\n          })(err, data)\n        })\n      })\n\n    function flush () {\n      if(writing) return\n      var _queue = queue\n      queue = null; writing = true; length = 0\n      write(_queue, function (err) {\n        writing = false\n\n        if(ended === true && !length) cb(err)\n        else if(ended && ended !== true) {\n          cb(ended)\n          _cb && _cb()\n        }\n        else if(err) read(ended = (err.abort ? true : err), cb) //abort upstream.\n        else if(length) flush()\n        else more()\n      })\n    }\n\n    reader.abort = function (__cb) {\n      _cb = function (end) {\n          __cb && __cb()\n        }\n        var err = new Error('aborted')\n        err.abort = true\n        read(ended = err, function (end) {\n        end = end === true ? null : end\n        if(!writing) {\n          cb && cb(end)\n          _cb && _cb(end)\n        }\n      })\n    }\n\n    more()\n  }\n\n  reader.abort = function (cb) {\n    ended = new Error('aborted before connecting')\n    _cb = function (err) {\n      cb && cb()\n    }\n  }\n\n  return reader\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-write/index.js\n// module id = 207\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-write/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar optimized = __webpack_require__(1227)\n\nfunction BN () {\n  this.negative = 0\n  this.words = null\n  this.length = 0\n}\n\nBN.fromNumber = function (n) {\n  var bn = new BN()\n  bn.words = [n & 0x03ffffff]\n  bn.length = 1\n  return bn\n}\n\nBN.fromBuffer = function (b32) {\n  var bn = new BN()\n\n  bn.words = new Array(10)\n  bn.words[0] = (b32[28] & 0x03) << 24 | b32[29] << 16 | b32[30] << 8 | b32[31]\n  bn.words[1] = (b32[25] & 0x0F) << 22 | b32[26] << 14 | b32[27] << 6 | b32[28] >>> 2\n  bn.words[2] = (b32[22] & 0x3F) << 20 | b32[23] << 12 | b32[24] << 4 | b32[25] >>> 4\n  bn.words[3] = (b32[19] & 0xFF) << 18 | b32[20] << 10 | b32[21] << 2 | b32[22] >>> 6\n\n  bn.words[4] = (b32[15] & 0x03) << 24 | b32[16] << 16 | b32[17] << 8 | b32[18]\n  bn.words[5] = (b32[12] & 0x0F) << 22 | b32[13] << 14 | b32[14] << 6 | b32[15] >>> 2\n  bn.words[6] = (b32[9] & 0x3F) << 20 | b32[10] << 12 | b32[11] << 4 | b32[12] >>> 4\n  bn.words[7] = (b32[6] & 0xFF) << 18 | b32[7] << 10 | b32[8] << 2 | b32[9] >>> 6\n\n  bn.words[8] = (b32[2] & 0x03) << 24 | b32[3] << 16 | b32[4] << 8 | b32[5]\n  bn.words[9] = b32[0] << 14 | b32[1] << 6 | b32[2] >>> 2\n\n  bn.length = 10\n  return bn.strip()\n}\n\nBN.prototype.toBuffer = function () {\n  var w = this.words\n  for (var i = this.length; i < 10; ++i) w[i] = 0\n\n  return Buffer.from([\n    (w[9] >>> 14) & 0xFF, (w[9] >>> 6) & 0xFF, (w[9] & 0x3F) << 2 | ((w[8] >>> 24) & 0x03), // 0, 1, 2\n    (w[8] >>> 16) & 0xFF, (w[8] >>> 8) & 0xFF, w[8] & 0xFF, // 3, 4, 5\n\n    (w[7] >>> 18) & 0xFF, (w[7] >>> 10) & 0xFF, (w[7] >>> 2) & 0xFF, // 6, 7, 8\n    ((w[7] & 0x03) << 6) | ((w[6] >>> 20) & 0x3F), (w[6] >>> 12) & 0xFF, (w[6] >>> 4) & 0xFF, // 9, 10, 11\n    ((w[6] & 0x0F) << 4) | ((w[5] >>> 22) & 0x0F), (w[5] >>> 14) & 0xFF, (w[5] >>> 6) & 0xFF, // 12, 13, 14\n    ((w[5] & 0x3F) << 2) | ((w[4] >>> 24) & 0x03), (w[4] >>> 16) & 0xFF, (w[4] >>> 8) & 0xFF, w[4] & 0xFF, // 15, 16, 17, 18\n\n    (w[3] >>> 18) & 0xFF, (w[3] >>> 10) & 0xFF, (w[3] >>> 2) & 0xFF, // 19, 20, 21\n    ((w[3] & 0x03) << 6) | ((w[2] >>> 20) & 0x3F), (w[2] >>> 12) & 0xFF, (w[2] >>> 4) & 0xFF, // 22, 23, 24\n    ((w[2] & 0x0F) << 4) | ((w[1] >>> 22) & 0x0F), (w[1] >>> 14) & 0xFF, (w[1] >>> 6) & 0xFF, // 25, 26, 27\n    ((w[1] & 0x3F) << 2) | ((w[0] >>> 24) & 0x03), (w[0] >>> 16) & 0xFF, (w[0] >>> 8) & 0xFF, w[0] & 0xFF // 28, 29, 30, 31\n  ])\n}\n\nBN.prototype.clone = function () {\n  var r = new BN()\n  r.words = new Array(this.length)\n  for (var i = 0; i < this.length; i++) r.words[i] = this.words[i]\n  r.length = this.length\n  r.negative = this.negative\n  return r\n}\n\nBN.prototype.strip = function () {\n  while (this.length > 1 && (this.words[this.length - 1] | 0) === 0) this.length--\n  return this\n}\n\nBN.prototype.normSign = function () {\n  // -0 = 0\n  if (this.length === 1 && this.words[0] === 0) this.negative = 0\n  return this\n}\n\nBN.prototype.isEven = function () {\n  return (this.words[0] & 1) === 0\n}\n\nBN.prototype.isOdd = function () {\n  return (this.words[0] & 1) === 1\n}\n\nBN.prototype.isZero = function () {\n  return this.length === 1 && this.words[0] === 0\n}\n\nBN.prototype.ucmp = function (num) {\n  if (this.length !== num.length) return this.length > num.length ? 1 : -1\n\n  for (var i = this.length - 1; i >= 0; --i) {\n    if (this.words[i] !== num.words[i]) return this.words[i] > num.words[i] ? 1 : -1\n  }\n\n  return 0\n}\n\nBN.prototype.gtOne = function () {\n  return this.length > 1 || this.words[0] > 1\n}\n\nBN.prototype.isOverflow = function () {\n  return this.ucmp(BN.n) >= 0\n}\n\nBN.prototype.isHigh = function () {\n  return this.ucmp(BN.nh) === 1\n}\n\nBN.prototype.bitLengthGT256 = function () {\n  return this.length > 10 || (this.length === 10 && this.words[9] > 0x003fffff)\n}\n\nBN.prototype.iuaddn = function (num) {\n  this.words[0] += num\n\n  for (var i = 0; this.words[i] > 0x03ffffff && i < this.length; ++i) {\n    this.words[i] -= 0x04000000\n    this.words[i + 1] += 1\n  }\n\n  if (i === this.length) {\n    this.words[i] = 1\n    this.length += 1\n  }\n\n  return this\n}\n\nBN.prototype.iadd = function (num) {\n  // (-this) + num -> -(this - num)\n  // this + (-num) -> this - num\n  if (this.negative !== num.negative) {\n    if (this.negative !== 0) {\n      this.negative = 0\n      this.isub(num)\n      this.negative ^= 1\n    } else {\n      num.negative = 0\n      this.isub(num)\n      num.negative = 1\n    }\n\n    return this.normSign()\n  }\n\n  // a.length > b.length\n  var a\n  var b\n  if (this.length > num.length) {\n    a = this\n    b = num\n  } else {\n    a = num\n    b = this\n  }\n\n  for (var i = 0, carry = 0; i < b.length; ++i) {\n    var word = a.words[i] + b.words[i] + carry\n    this.words[i] = word & 0x03ffffff\n    carry = word >>> 26\n  }\n\n  for (; carry !== 0 && i < a.length; ++i) {\n    word = a.words[i] + carry\n    this.words[i] = word & 0x03ffffff\n    carry = word >>> 26\n  }\n\n  this.length = a.length\n  if (carry !== 0) {\n    this.words[this.length++] = carry\n  } else if (a !== this) {\n    for (; i < a.length; ++i) {\n      this.words[i] = a.words[i]\n    }\n  }\n\n  return this\n}\n\nBN.prototype.add = function (num) {\n  return this.clone().iadd(num)\n}\n\nBN.prototype.isub = function (num) {\n  // (-this) - num -> -(this + num)\n  // this - (-num) -> this + num\n  if (this.negative !== num.negative) {\n    if (this.negative !== 0) {\n      this.negative = 0\n      this.iadd(num)\n      this.negative = 1\n    } else {\n      num.negative = 0\n      this.iadd(num)\n      num.negative = 1\n    }\n\n    return this.normSign()\n  }\n\n  var cmp = this.ucmp(num)\n  if (cmp === 0) {\n    this.negative = 0\n    this.words[0] = 0\n    this.length = 1\n    return this\n  }\n\n  // a > b\n  var a\n  var b\n  if (cmp > 0) {\n    a = this\n    b = num\n  } else {\n    a = num\n    b = this\n  }\n\n  for (var i = 0, carry = 0; i < b.length; ++i) {\n    var word = a.words[i] - b.words[i] + carry\n    carry = word >> 26\n    this.words[i] = word & 0x03ffffff\n  }\n\n  for (; carry !== 0 && i < a.length; ++i) {\n    word = a.words[i] + carry\n    carry = word >> 26\n    this.words[i] = word & 0x03ffffff\n  }\n\n  if (carry === 0 && i < a.length && a !== this) {\n    for (; i < a.length; ++i) this.words[i] = a.words[i]\n  }\n\n  this.length = Math.max(this.length, i)\n\n  if (a !== this) this.negative ^= 1\n\n  return this.strip().normSign()\n}\n\nBN.prototype.sub = function (num) {\n  return this.clone().isub(num)\n}\n\nBN.umulTo = function (num1, num2, out) {\n  out.length = num1.length + num2.length - 1\n\n  var a1 = num1.words[0]\n  var b1 = num2.words[0]\n  var r1 = a1 * b1\n\n  var carry = (r1 / 0x04000000) | 0\n  out.words[0] = r1 & 0x03ffffff\n\n  for (var k = 1, maxK = out.length; k < maxK; k++) {\n    var ncarry = carry >>> 26\n    var rword = carry & 0x03ffffff\n    for (var j = Math.max(0, k - num1.length + 1), maxJ = Math.min(k, num2.length - 1); j <= maxJ; j++) {\n      var i = k - j\n      var a = num1.words[i]\n      var b = num2.words[j]\n      var r = a * b + rword\n      ncarry += (r / 0x04000000) | 0\n      rword = r & 0x03ffffff\n    }\n    out.words[k] = rword\n    carry = ncarry\n  }\n\n  if (carry !== 0) out.words[out.length++] = carry\n\n  return out.strip()\n}\n\nBN.umulTo10x10 = Math.imul ? optimized.umulTo10x10 : BN.umulTo\n\nBN.umulnTo = function (num, k, out) {\n  if (k === 0) {\n    out.words = [0]\n    out.length = 1\n    return out\n  }\n\n  for (var i = 0, carry = 0; i < num.length; ++i) {\n    var r = num.words[i] * k + carry\n    out.words[i] = r & 0x03ffffff\n    carry = (r / 0x04000000) | 0\n  }\n\n  if (carry > 0) {\n    out.words[i] = carry\n    out.length = num.length + 1\n  } else {\n    out.length = num.length\n  }\n\n  return out\n}\n\nBN.prototype.umul = function (num) {\n  var out = new BN()\n  out.words = new Array(this.length + num.length)\n\n  if (this.length === 10 && num.length === 10) {\n    return BN.umulTo10x10(this, num, out)\n  } else if (this.length === 1) {\n    return BN.umulnTo(num, this.words[0], out)\n  } else if (num.length === 1) {\n    return BN.umulnTo(this, num.words[0], out)\n  } else {\n    return BN.umulTo(this, num, out)\n  }\n}\n\nBN.prototype.isplit = function (output) {\n  output.length = Math.min(this.length, 9)\n  for (var i = 0; i < output.length; ++i) output.words[i] = this.words[i]\n\n  if (this.length <= 9) {\n    this.words[0] = 0\n    this.length = 1\n    return this\n  }\n\n  // Shift by 9 limbs\n  var prev = this.words[9]\n  output.words[output.length++] = prev & 0x003fffff\n\n  for (i = 10; i < this.length; ++i) {\n    var word = this.words[i]\n    this.words[i - 10] = ((word & 0x003fffff) << 4) | (prev >>> 22)\n    prev = word\n  }\n  prev >>>= 22\n  this.words[i - 10] = prev\n\n  if (prev === 0 && this.length > 10) {\n    this.length -= 10\n  } else {\n    this.length -= 9\n  }\n\n  return this\n}\n\nBN.prototype.fireduce = function () {\n  if (this.isOverflow()) this.isub(BN.n)\n  return this\n}\n\nBN.prototype.ureduce = function () {\n  var num = this.clone().isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n  if (num.bitLengthGT256()) {\n    num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n    if (num.bitLengthGT256()) num = num.isplit(BN.tmp).umul(BN.nc).iadd(BN.tmp)\n  }\n\n  return num.fireduce()\n}\n\nBN.prototype.ishrn = function (n) {\n  var mask = (1 << n) - 1\n  var m = 26 - n\n\n  for (var i = this.length - 1, carry = 0; i >= 0; --i) {\n    var word = this.words[i]\n    this.words[i] = (carry << m) | (word >>> n)\n    carry = word & mask\n  }\n\n  if (this.length > 1 && this.words[this.length - 1] === 0) this.length -= 1\n\n  return this\n}\n\nBN.prototype.uinvm = function () {\n  var x = this.clone()\n  var y = BN.n.clone()\n\n  // A * x + B * y = x\n  var A = BN.fromNumber(1)\n  var B = BN.fromNumber(0)\n\n  // C * x + D * y = y\n  var C = BN.fromNumber(0)\n  var D = BN.fromNumber(1)\n\n  while (x.isEven() && y.isEven()) {\n    for (var k = 1, m = 1; (x.words[0] & m) === 0 && (y.words[0] & m) === 0 && k < 26; ++k, m <<= 1);\n    x.ishrn(k)\n    y.ishrn(k)\n  }\n\n  var yp = y.clone()\n  var xp = x.clone()\n\n  while (!x.isZero()) {\n    for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n    if (i > 0) {\n      x.ishrn(i)\n      while (i-- > 0) {\n        if (A.isOdd() || B.isOdd()) {\n          A.iadd(yp)\n          B.isub(xp)\n        }\n\n        A.ishrn(1)\n        B.ishrn(1)\n      }\n    }\n\n    for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n    if (j > 0) {\n      y.ishrn(j)\n      while (j-- > 0) {\n        if (C.isOdd() || D.isOdd()) {\n          C.iadd(yp)\n          D.isub(xp)\n        }\n\n        C.ishrn(1)\n        D.ishrn(1)\n      }\n    }\n\n    if (x.ucmp(y) >= 0) {\n      x.isub(y)\n      A.isub(C)\n      B.isub(D)\n    } else {\n      y.isub(x)\n      C.isub(A)\n      D.isub(B)\n    }\n  }\n\n  if (C.negative === 1) {\n    C.negative = 0\n    var result = C.ureduce()\n    result.negative ^= 1\n    return result.normSign().iadd(BN.n)\n  } else {\n    return C.ureduce()\n  }\n}\n\nBN.prototype.imulK = function () {\n  this.words[this.length] = 0\n  this.words[this.length + 1] = 0\n  this.length += 2\n\n  for (var i = 0, lo = 0; i < this.length; ++i) {\n    var w = this.words[i] | 0\n    lo += w * 0x3d1\n    this.words[i] = lo & 0x03ffffff\n    lo = w * 0x40 + ((lo / 0x04000000) | 0)\n  }\n\n  if (this.words[this.length - 1] === 0) {\n    this.length -= 1\n    if (this.words[this.length - 1] === 0) this.length -= 1\n  }\n\n  return this\n}\n\nBN.prototype.redIReduce = function () {\n  this.isplit(BN.tmp).imulK().iadd(BN.tmp)\n  if (this.bitLengthGT256()) this.isplit(BN.tmp).imulK().iadd(BN.tmp)\n\n  var cmp = this.ucmp(BN.p)\n  if (cmp === 0) {\n    this.words[0] = 0\n    this.length = 1\n  } else if (cmp > 0) {\n    this.isub(BN.p)\n  } else {\n    this.strip()\n  }\n\n  return this\n}\n\nBN.prototype.redNeg = function () {\n  if (this.isZero()) return BN.fromNumber(0)\n\n  return BN.p.sub(this)\n}\n\nBN.prototype.redAdd = function (num) {\n  return this.clone().redIAdd(num)\n}\n\nBN.prototype.redIAdd = function (num) {\n  this.iadd(num)\n  if (this.ucmp(BN.p) >= 0) this.isub(BN.p)\n\n  return this\n}\n\nBN.prototype.redIAdd7 = function () {\n  this.iuaddn(7)\n  if (this.ucmp(BN.p) >= 0) this.isub(BN.p)\n\n  return this\n}\n\nBN.prototype.redSub = function (num) {\n  return this.clone().redISub(num)\n}\n\nBN.prototype.redISub = function (num) {\n  this.isub(num)\n  if (this.negative !== 0) this.iadd(BN.p)\n\n  return this\n}\n\nBN.prototype.redMul = function (num) {\n  return this.umul(num).redIReduce()\n}\n\nBN.prototype.redSqr = function () {\n  return this.umul(this).redIReduce()\n}\n\nBN.prototype.redSqrt = function () {\n  if (this.isZero()) return this.clone()\n\n  var wv2 = this.redSqr()\n  var wv4 = wv2.redSqr()\n  var wv12 = wv4.redSqr().redMul(wv4)\n  var wv14 = wv12.redMul(wv2)\n  var wv15 = wv14.redMul(this)\n\n  var out = wv15\n  for (var i = 0; i < 54; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)\n  out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv14)\n  for (i = 0; i < 5; ++i) out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv15)\n  out = out.redSqr().redSqr().redSqr().redSqr().redMul(wv12)\n  out = out.redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(wv12)\n\n  if (out.redSqr().ucmp(this) === 0) {\n    return out\n  } else {\n    return null\n  }\n}\n\nBN.prototype.redInvm = function () {\n  var a = this.clone()\n  var b = BN.p.clone()\n\n  var x1 = BN.fromNumber(1)\n  var x2 = BN.fromNumber(0)\n\n  while (a.gtOne() && b.gtOne()) {\n    for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n    if (i > 0) {\n      a.ishrn(i)\n      while (i-- > 0) {\n        if (x1.isOdd()) x1.iadd(BN.p)\n        x1.ishrn(1)\n      }\n    }\n\n    for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n    if (j > 0) {\n      b.ishrn(j)\n      while (j-- > 0) {\n        if (x2.isOdd()) x2.iadd(BN.p)\n        x2.ishrn(1)\n      }\n    }\n\n    if (a.ucmp(b) >= 0) {\n      a.isub(b)\n      x1.isub(x2)\n    } else {\n      b.isub(a)\n      x2.isub(x1)\n    }\n  }\n\n  var res\n  if (a.length === 1 && a.words[0] === 1) {\n    res = x1\n  } else {\n    res = x2\n  }\n\n  if (res.negative !== 0) res.iadd(BN.p)\n\n  if (res.negative !== 0) {\n    res.negative = 0\n    return res.redIReduce().redNeg()\n  } else {\n    return res.redIReduce()\n  }\n}\n\nBN.prototype.getNAF = function (w) {\n  var naf = []\n  var ws = 1 << (w + 1)\n  var wsm1 = ws - 1\n  var ws2 = ws >> 1\n\n  var k = this.clone()\n  while (!k.isZero()) {\n    for (var i = 0, m = 1; (k.words[0] & m) === 0 && i < 26; ++i, m <<= 1) naf.push(0)\n\n    if (i !== 0) {\n      k.ishrn(i)\n    } else {\n      var mod = k.words[0] & wsm1\n      if (mod >= ws2) {\n        naf.push(ws2 - mod)\n        k.iuaddn(mod - ws2).ishrn(1)\n      } else {\n        naf.push(mod)\n        k.words[0] -= mod\n        if (!k.isZero()) {\n          for (i = w - 1; i > 0; --i) naf.push(0)\n          k.ishrn(w)\n        }\n      }\n    }\n  }\n\n  return naf\n}\n\nBN.prototype.inspect = function () {\n  if (this.isZero()) return '0'\n\n  var buffer = this.toBuffer().toString('hex')\n  for (var i = 0; buffer[i] === '0'; ++i);\n  return buffer.slice(i)\n}\n\nBN.n = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141', 'hex'))\nBN.nh = BN.n.clone().ishrn(1)\nBN.nc = BN.fromBuffer(Buffer.from('000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF', 'hex'))\nBN.p = BN.fromBuffer(Buffer.from('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', 'hex'))\nBN.psn = BN.p.sub(BN.n)\nBN.tmp = new BN()\nBN.tmp.words = new Array(10)\n\n// WTF?! it speed-up benchmark on ~20%\n;(function () {\n  var x = BN.fromNumber(1)\n  x.words[3] = 0\n})()\n\nmodule.exports = BN\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/bn/index.js\n// module id = 208\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/bn/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = __webpack_require__(1237);\n// The default Buffer size if one is not provided.\nconst DEFAULT_SMARTBUFFER_SIZE = 4096;\n// The default string encoding to use for reading/writing strings.\nconst DEFAULT_SMARTBUFFER_ENCODING = 'utf8';\nclass SmartBuffer {\n    /**\n       * Creates a new SmartBuffer instance.\n       *\n       * @param options { SmartBufferOptions } The SmartBufferOptions to apply to this instance.\n       */\n    constructor(options) {\n        this.length = 0;\n        this._encoding = DEFAULT_SMARTBUFFER_ENCODING;\n        this._writeOffset = 0;\n        this._readOffset = 0;\n        if (SmartBuffer.isSmartBufferOptions(options)) {\n            // Checks for encoding\n            if (options.encoding) {\n                utils_1.checkEncoding(options.encoding);\n                this._encoding = options.encoding;\n            }\n            // Checks for initial size length\n            if (options.size) {\n                if (utils_1.isFiniteInteger(options.size) && options.size > 0) {\n                    this._buff = Buffer.allocUnsafe(options.size);\n                }\n                else {\n                    throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_SIZE);\n                }\n                // Check for initial Buffer\n            }\n            else if (options.buff) {\n                if (options.buff instanceof Buffer) {\n                    this._buff = options.buff;\n                    this.length = options.buff.length;\n                }\n                else {\n                    throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_BUFFER);\n                }\n            }\n            else {\n                this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);\n            }\n        }\n        else {\n            // If something was passed but it's not a SmartBufferOptions object\n            if (typeof options !== 'undefined') {\n                throw new Error(utils_1.ERRORS.INVALID_SMARTBUFFER_OBJECT);\n            }\n            // Otherwise default to sane options\n            this._buff = Buffer.allocUnsafe(DEFAULT_SMARTBUFFER_SIZE);\n        }\n    }\n    /**\n       * Creates a new SmartBuffer instance with the provided internal Buffer size and optional encoding.\n       *\n       * @param size { Number } The size of the internal Buffer.\n       * @param encoding { String } The BufferEncoding to use for strings.\n       *\n       * @return { SmartBuffer }\n       */\n    static fromSize(size, encoding) {\n        return new this({\n            size: size,\n            encoding: encoding\n        });\n    }\n    /**\n       * Creates a new SmartBuffer instance with the provided Buffer and optional encoding.\n       *\n       * @param buffer { Buffer } The Buffer to use as the internal Buffer value.\n       * @param encoding { String } The BufferEncoding to use for strings.\n       *\n       * @return { SmartBuffer }\n       */\n    static fromBuffer(buff, encoding) {\n        return new this({\n            buff: buff,\n            encoding: encoding\n        });\n    }\n    /**\n       * Creates a new SmartBuffer instance with the provided SmartBufferOptions options.\n       *\n       * @param options { SmartBufferOptions } The options to use when creating the SmartBuffer instance.\n       */\n    static fromOptions(options) {\n        return new this(options);\n    }\n    /**\n       * Type checking function that determines if an object is a SmartBufferOptions object.\n       */\n    static isSmartBufferOptions(options) {\n        const castOptions = options;\n        return castOptions && (castOptions.encoding !== undefined || castOptions.size !== undefined || castOptions.buff !== undefined);\n    }\n    // Signed integers\n    /**\n       * Reads an Int8 value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readInt8(offset) {\n        return this._readNumberValue(Buffer.prototype.readInt8, 1, offset);\n    }\n    /**\n       * Reads an Int16BE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readInt16BE(offset) {\n        return this._readNumberValue(Buffer.prototype.readInt16BE, 2, offset);\n    }\n    /**\n       * Reads an Int16LE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readInt16LE(offset) {\n        return this._readNumberValue(Buffer.prototype.readInt16LE, 2, offset);\n    }\n    /**\n       * Reads an Int32BE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readInt32BE(offset) {\n        return this._readNumberValue(Buffer.prototype.readInt32BE, 4, offset);\n    }\n    /**\n       * Reads an Int32LE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readInt32LE(offset) {\n        return this._readNumberValue(Buffer.prototype.readInt32LE, 4, offset);\n    }\n    /**\n       * Writes an Int8 value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeInt8(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeInt8, 1, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an Int8 value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertInt8(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeInt8, 1, value, offset);\n        return this;\n    }\n    /**\n       * Writes an Int16BE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeInt16BE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an Int16BE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertInt16BE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeInt16BE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Writes an Int16LE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeInt16LE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an Int16LE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertInt16LE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeInt16LE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Writes an Int32BE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeInt32BE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an Int32BE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertInt32BE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeInt32BE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Writes an Int32LE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeInt32LE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an Int32LE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertInt32LE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeInt32LE, 4, value, offset);\n        return this;\n    }\n    // Unsigned Integers\n    /**\n       * Reads an UInt8 value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readUInt8(offset) {\n        return this._readNumberValue(Buffer.prototype.readUInt8, 1, offset);\n    }\n    /**\n       * Reads an UInt16BE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readUInt16BE(offset) {\n        return this._readNumberValue(Buffer.prototype.readUInt16BE, 2, offset);\n    }\n    /**\n       * Reads an UInt16LE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readUInt16LE(offset) {\n        return this._readNumberValue(Buffer.prototype.readUInt16LE, 2, offset);\n    }\n    /**\n       * Reads an UInt32BE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readUInt32BE(offset) {\n        return this._readNumberValue(Buffer.prototype.readUInt32BE, 4, offset);\n    }\n    /**\n       * Reads an UInt32LE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readUInt32LE(offset) {\n        return this._readNumberValue(Buffer.prototype.readUInt32LE, 4, offset);\n    }\n    /**\n       * Writes an UInt8 value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeUInt8(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an UInt8 value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertUInt8(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeUInt8, 1, value, offset);\n        return this;\n    }\n    /**\n       * Writes an UInt16BE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeUInt16BE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an UInt16BE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertUInt16BE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeUInt16BE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Writes an UInt16LE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeUInt16LE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an UInt16LE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertUInt16LE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeUInt16LE, 2, value, offset);\n        return this;\n    }\n    /**\n       * Writes an UInt32BE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeUInt32BE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an UInt32BE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertUInt32BE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeUInt32BE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Writes an UInt32LE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeUInt32LE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts an UInt32LE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertUInt32LE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeUInt32LE, 4, value, offset);\n        return this;\n    }\n    // Floating Point\n    /**\n       * Reads an FloatBE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readFloatBE(offset) {\n        return this._readNumberValue(Buffer.prototype.readFloatBE, 4, offset);\n    }\n    /**\n       * Reads an FloatLE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readFloatLE(offset) {\n        return this._readNumberValue(Buffer.prototype.readFloatLE, 4, offset);\n    }\n    /**\n       * Writes a FloatBE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeFloatBE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts a FloatBE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertFloatBE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeFloatBE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Writes a FloatLE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeFloatLE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);\n        return this;\n    }\n    /**\n       * Inserts a FloatLE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertFloatLE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeFloatLE, 4, value, offset);\n        return this;\n    }\n    // Double Floating Point\n    /**\n       * Reads an DoublEBE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readDoubleBE(offset) {\n        return this._readNumberValue(Buffer.prototype.readDoubleBE, 8, offset);\n    }\n    /**\n       * Reads an DoubleLE value from the current read position or an optionally provided offset.\n       *\n       * @param offset { Number } The offset to read data from (optional)\n       * @return { Number }\n       */\n    readDoubleLE(offset) {\n        return this._readNumberValue(Buffer.prototype.readDoubleLE, 8, offset);\n    }\n    /**\n       * Writes a DoubleBE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeDoubleBE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);\n        return this;\n    }\n    /**\n       * Inserts a DoubleBE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertDoubleBE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeDoubleBE, 8, value, offset);\n        return this;\n    }\n    /**\n       * Writes a DoubleLE value to the current write position (or at optional offset).\n       *\n       * @param value { Number } The value to write.\n       * @param offset { Number } The offset to write the value at.\n       *\n       * @return this\n       */\n    writeDoubleLE(value, offset) {\n        this._writeNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);\n        return this;\n    }\n    /**\n       * Inserts a DoubleLE value at the given offset value.\n       *\n       * @param value { Number } The value to insert.\n       * @param offset { Number } The offset to insert the value at.\n       *\n       * @return this\n       */\n    insertDoubleLE(value, offset) {\n        this._insertNumberValue(Buffer.prototype.writeDoubleLE, 8, value, offset);\n        return this;\n    }\n    // Strings\n    /**\n       * Reads a String from the current read position.\n       *\n       * @param arg1 { Number | String } The number of bytes to read as a String, or the BufferEncoding to use for\n       *             the string (Defaults to instance level encoding).\n       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).\n       *\n       * @return { String }\n       */\n    readString(arg1, encoding) {\n        let lengthVal;\n        // Length provided\n        if (typeof arg1 === 'number') {\n            utils_1.checkLengthValue(arg1);\n            lengthVal = Math.min(arg1, this.length - this._readOffset);\n        }\n        else {\n            encoding = arg1;\n            lengthVal = this.length - this._readOffset;\n        }\n        // Check encoding\n        if (typeof encoding !== 'undefined') {\n            utils_1.checkEncoding(encoding);\n        }\n        const value = this._buff.slice(this._readOffset, this._readOffset + lengthVal).toString(encoding || this._encoding);\n        this._readOffset += lengthVal;\n        return value;\n    }\n    /**\n       * Inserts a String\n       *\n       * @param value { String } The String value to insert.\n       * @param offset { Number } The offset to insert the string at.\n       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).\n       */\n    insertString(value, offset, encoding) {\n        utils_1.checkOffsetValue(offset);\n        return this._handleString(value, true, offset, encoding);\n    }\n    /**\n       * Writes a String\n       *\n       * @param value { String } The String value to write.\n       * @param arg2 { Number | String } The offset to write the string at, or the BufferEncoding to use.\n       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).\n       */\n    writeString(value, arg2, encoding) {\n        return this._handleString(value, false, arg2, encoding);\n    }\n    /**\n       * Reads a null-terminated String from the current read position.\n       *\n       * @param encoding { String } The BufferEncoding to use for the string (Defaults to instance level encoding).\n       *\n       * @return { String }\n       */\n    readStringNT(encoding) {\n        if (typeof encoding !== 'undefined') {\n            utils_1.checkEncoding(encoding);\n        }\n        // Set null character position to the end SmartBuffer instance.\n        let nullPos = this.length;\n        // Find next null character (if one is not found, default from above is used)\n        for (let i = this._readOffset; i < this.length; i++) {\n            if (this._buff[i] === 0x00) {\n                nullPos = i;\n                break;\n            }\n        }\n        // Read string value\n        const value = this._buff.slice(this._readOffset, nullPos);\n        // Increment internal Buffer read offset\n        this._readOffset = nullPos + 1;\n        return value.toString(encoding || this._encoding);\n    }\n    /**\n       * Inserts a null-terminated String.\n       *\n       * @param value { String } The String value to write.\n       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.\n       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).\n       */\n    insertStringNT(value, offset, encoding) {\n        utils_1.checkOffsetValue(offset);\n        // Write Values\n        this.insertString(value, offset, encoding);\n        this.insertUInt8(0x00, offset + value.length);\n    }\n    /**\n       * Writes a null-terminated String.\n       *\n       * @param value { String } The String value to write.\n       * @param arg2 { Number | String } The offset to write the string to, or the BufferEncoding to use.\n       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).\n       */\n    writeStringNT(value, arg2, encoding) {\n        // Write Values\n        this.writeString(value, arg2, encoding);\n        this.writeUInt8(0x00, typeof arg2 === 'number' ? arg2 + value.length : this.writeOffset);\n    }\n    // Buffers\n    /**\n       * Reads a Buffer from the internal read position.\n       *\n       * @param length { Number } The length of data to read as a Buffer.\n       *\n       * @return { Buffer }\n       */\n    readBuffer(length) {\n        if (typeof length !== 'undefined') {\n            utils_1.checkLengthValue(length);\n        }\n        const lengthVal = typeof length === 'number' ? length : this.length;\n        const endPoint = Math.min(this.length, this._readOffset + lengthVal);\n        // Read buffer value\n        const value = this._buff.slice(this._readOffset, endPoint);\n        // Increment internal Buffer read offset\n        this._readOffset = endPoint;\n        return value;\n    }\n    /**\n       * Writes a Buffer to the current write position.\n       *\n       * @param value { Buffer } The Buffer to write.\n       * @param offset { Number } The offset to write the Buffer to.\n       */\n    insertBuffer(value, offset) {\n        utils_1.checkOffsetValue(offset);\n        return this._handleBuffer(value, true, offset);\n    }\n    /**\n       * Writes a Buffer to the current write position.\n       *\n       * @param value { Buffer } The Buffer to write.\n       * @param offset { Number } The offset to write the Buffer to.\n       */\n    writeBuffer(value, offset) {\n        return this._handleBuffer(value, false, offset);\n    }\n    /**\n       * Reads a null-terminated Buffer from the current read poisiton.\n       *\n       * @return { Buffer }\n       */\n    readBufferNT() {\n        // Set null character position to the end SmartBuffer instance.\n        let nullPos = this.length;\n        // Find next null character (if one is not found, default from above is used)\n        for (let i = this._readOffset; i < this.length; i++) {\n            if (this._buff[i] === 0x00) {\n                nullPos = i;\n                break;\n            }\n        }\n        // Read value\n        const value = this._buff.slice(this._readOffset, nullPos);\n        // Increment internal Buffer read offset\n        this._readOffset = nullPos + 1;\n        return value;\n    }\n    /**\n       * Inserts a null-terminated Buffer.\n       *\n       * @param value { Buffer } The Buffer to write.\n       * @param offset { Number } The offset to write the Buffer to.\n       */\n    insertBufferNT(value, offset) {\n        utils_1.checkOffsetValue(offset);\n        // Write Values\n        this.insertBuffer(value, offset);\n        this.insertUInt8(0x00, offset + value.length);\n        return this;\n    }\n    /**\n       * Writes a null-terminated Buffer.\n       *\n       * @param value { Buffer } The Buffer to write.\n       * @param offset { Number } The offset to write the Buffer to.\n       */\n    writeBufferNT(value, offset) {\n        // Checks for valid numberic value;\n        if (typeof offset !== 'undefined') {\n            utils_1.checkOffsetValue(offset);\n        }\n        // Write Values\n        this.writeBuffer(value, offset);\n        this.writeUInt8(0x00, typeof offset === 'number' ? offset + value.length : this._writeOffset);\n        return this;\n    }\n    /**\n       * Clears the SmartBuffer instance to its original empty state.\n       */\n    clear() {\n        this._writeOffset = 0;\n        this._readOffset = 0;\n        this.length = 0;\n        return this;\n    }\n    /**\n       * Gets the remaining data left to be read from the SmartBuffer instance.\n       *\n       * @return { Number }\n       */\n    remaining() {\n        return this.length - this._readOffset;\n    }\n    /**\n       * Gets the current read offset value of the SmartBuffer instance.\n       *\n       * @return { Number }\n       */\n    get readOffset() {\n        return this._readOffset;\n    }\n    /**\n       * Sets the read offset value of the SmartBuffer instance.\n       *\n       * @param offset { Number } - The offset value to set.\n       */\n    set readOffset(offset) {\n        utils_1.checkOffsetValue(offset);\n        // Check for bounds.\n        utils_1.checkTargetOffset(offset, this);\n        this._readOffset = offset;\n    }\n    /**\n       * Gets the current write offset value of the SmartBuffer instance.\n       *\n       * @return { Number }\n       */\n    get writeOffset() {\n        return this._writeOffset;\n    }\n    /**\n       * Sets the write offset value of the SmartBuffer instance.\n       *\n       * @param offset { Number } - The offset value to set.\n       */\n    set writeOffset(offset) {\n        utils_1.checkOffsetValue(offset);\n        // Check for bounds.\n        utils_1.checkTargetOffset(offset, this);\n        this._writeOffset = offset;\n    }\n    /**\n       * Gets the currently set string encoding of the SmartBuffer instance.\n       *\n       * @return { BufferEncoding } The string Buffer encoding currently set.\n       */\n    get encoding() {\n        return this._encoding;\n    }\n    /**\n       * Sets the string encoding of the SmartBuffer instance.\n       *\n       * @param encoding { BufferEncoding } The string Buffer encoding to set.\n       */\n    set encoding(encoding) {\n        utils_1.checkEncoding(encoding);\n        this._encoding = encoding;\n    }\n    /**\n       * Gets the underlying internal Buffer. (This includes unmanaged data in the Buffer)\n       *\n       * @return { Buffer } The Buffer value.\n       */\n    get internalBuffer() {\n        return this._buff;\n    }\n    /**\n       * Gets the value of the internal managed Buffer (Includes managed data only)\n       *\n       * @param { Buffer }\n       */\n    toBuffer() {\n        return this._buff.slice(0, this.length);\n    }\n    /**\n       * Gets the String value of the internal managed Buffer\n       *\n       * @param encoding { String } The BufferEncoding to display the Buffer as (defaults to instance level encoding).\n       */\n    toString(encoding) {\n        const encodingVal = typeof encoding === 'string' ? encoding : this._encoding;\n        // Check for invalid encoding.\n        utils_1.checkEncoding(encodingVal);\n        return this._buff.toString(encodingVal, 0, this.length);\n    }\n    /**\n       * Destroys the SmartBuffer instance.\n       */\n    destroy() {\n        this.clear();\n        return this;\n    }\n    /**\n       * Handles inserting and writing strings.\n       *\n       * @param value { String } The String value to insert.\n       * @param isInsert { Boolean } True if inserting a string, false if writing.\n       * @param arg2 { Number | String } The offset to insert the string at, or the BufferEncoding to use.\n       * @param encoding { String } The BufferEncoding to use for writing strings (defaults to instance encoding).\n       */\n    _handleString(value, isInsert, arg3, encoding) {\n        let offsetVal = this._writeOffset;\n        let encodingVal = this._encoding;\n        // Check for offset\n        if (typeof arg3 === 'number') {\n            offsetVal = arg3;\n            // Check for encoding\n        }\n        else if (typeof arg3 === 'string') {\n            utils_1.checkEncoding(arg3);\n            encodingVal = arg3;\n        }\n        // Check for encoding (third param)\n        if (typeof encoding === 'string') {\n            utils_1.checkEncoding(encoding);\n            encodingVal = encoding;\n        }\n        // Calculate bytelength of string.\n        const byteLength = Buffer.byteLength(value, encodingVal);\n        // Ensure there is enough internal Buffer capacity.\n        if (isInsert) {\n            this.ensureInsertable(byteLength, offsetVal);\n        }\n        else {\n            this._ensureWriteable(byteLength, offsetVal);\n        }\n        // Write value\n        this._buff.write(value, offsetVal, byteLength, encodingVal);\n        // Increment internal Buffer write offset;\n        if (isInsert) {\n            this._writeOffset += byteLength;\n        }\n        else {\n            // If an offset was given, check to see if we wrote beyond the current writeOffset.\n            if (typeof arg3 === 'number') {\n                this._writeOffset = Math.max(this._writeOffset, offsetVal + byteLength);\n            }\n            else {\n                // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset.\n                this._writeOffset += byteLength;\n            }\n        }\n        return this;\n    }\n    /**\n       * Handles writing or insert of a Buffer.\n       *\n       * @param value { Buffer } The Buffer to write.\n       * @param offset { Number } The offset to write the Buffer to.\n       */\n    _handleBuffer(value, isInsert, offset) {\n        const offsetVal = typeof offset === 'number' ? offset : this._writeOffset;\n        // Ensure there is enough internal Buffer capacity.\n        if (isInsert) {\n            this.ensureInsertable(value.length, offsetVal);\n        }\n        else {\n            this._ensureWriteable(value.length, offsetVal);\n        }\n        // Write buffer value\n        value.copy(this._buff, offsetVal);\n        // Increment internal Buffer write offset;\n        if (isInsert) {\n            this._writeOffset += value.length;\n        }\n        else {\n            // If an offset was given, check to see if we wrote beyond the current writeOffset.\n            if (typeof offset === 'number') {\n                this._writeOffset = Math.max(this._writeOffset, offsetVal + value.length);\n            }\n            else {\n                // If no offset was given, we wrote to the end of the SmartBuffer so increment writeOffset.\n                this._writeOffset += value.length;\n            }\n        }\n        return this;\n    }\n    /**\n       * Ensures that the internal Buffer is large enough to read data.\n       *\n       * @param length { Number } The length of the data that needs to be read.\n       * @param offset { Number } The offset of the data that needs to be read.\n       */\n    ensureReadable(length, offset) {\n        // Offset value defaults to managed read offset.\n        let offsetVal = this._readOffset;\n        // If an offset was provided, use it.\n        if (typeof offset !== 'undefined') {\n            // Checks for valid numberic value;\n            utils_1.checkOffsetValue(offset);\n            // Overide with custom offset.\n            offsetVal = offset;\n        }\n        // Checks if offset is below zero, or the offset+length offset is beyond the total length of the managed data.\n        if (offsetVal < 0 || offsetVal + length > this.length) {\n            throw new Error(utils_1.ERRORS.INVALID_READ_BEYOND_BOUNDS);\n        }\n    }\n    /**\n       * Ensures that the internal Buffer is large enough to insert data.\n       *\n       * @param dataLength { Number } The length of the data that needs to be written.\n       * @param offset { Number } The offset of the data to be written.\n       */\n    ensureInsertable(dataLength, offset) {\n        // Checks for valid numberic value;\n        utils_1.checkOffsetValue(offset);\n        // Ensure there is enough internal Buffer capacity.\n        this._ensureCapacity(this.length + dataLength);\n        // If an offset was provided and its not the very end of the buffer, copy data into appropriate location in regards to the offset.\n        if (offset < this.length) {\n            this._buff.copy(this._buff, offset + dataLength, offset, this._buff.length);\n        }\n        // Adjust tracked smart buffer length\n        if (offset + dataLength > this.length) {\n            this.length = offset + dataLength;\n        }\n        else {\n            this.length += dataLength;\n        }\n    }\n    /**\n       * Ensures that the internal Buffer is large enough to write data.\n       *\n       * @param dataLength { Number } The length of the data that needs to be written.\n       * @param offset { Number } The offset of the data to be written (defaults to writeOffset).\n       */\n    _ensureWriteable(dataLength, offset) {\n        const offsetVal = typeof offset === 'number' ? offset : this._writeOffset;\n        // Ensure enough capacity to write data.\n        this._ensureCapacity(offsetVal + dataLength);\n        // Adjust SmartBuffer length (if offset + length is larger than managed length, adjust length)\n        if (offsetVal + dataLength > this.length) {\n            this.length = offsetVal + dataLength;\n        }\n    }\n    /**\n       * Ensures that the internal Buffer is large enough to write at least the given amount of data.\n       *\n       * @param minLength { Number } The minimum length of the data needs to be written.\n       */\n    _ensureCapacity(minLength) {\n        const oldLength = this._buff.length;\n        if (minLength > oldLength) {\n            let data = this._buff;\n            let newLength = oldLength * 3 / 2 + 1;\n            if (newLength < minLength) {\n                newLength = minLength;\n            }\n            this._buff = Buffer.allocUnsafe(newLength);\n            data.copy(this._buff, 0, 0, oldLength);\n        }\n    }\n    /**\n       * Reads a numeric number value using the provided function.\n       *\n       * @param func { Function(offset: number) => number } The function to read data on the internal Buffer with.\n       * @param byteSize { Number } The number of bytes read.\n       * @param offset { Number } The offset to read from (optional). When this is not provided, the managed readOffset is used instead.\n       *\n       * @param { Number }\n       */\n    _readNumberValue(func, byteSize, offset) {\n        this.ensureReadable(byteSize, offset);\n        // Call Buffer.readXXXX();\n        const value = func.call(this._buff, typeof offset === 'number' ? offset : this._readOffset);\n        // Adjust internal read offset if an optional read offset was not provided.\n        if (typeof offset === 'undefined') {\n            this._readOffset += byteSize;\n        }\n        return value;\n    }\n    /**\n       * Inserts a numeric number value based on the given offset and value.\n       *\n       * @param func { Function(offset: number, offset?) => number} The function to write data on the internal Buffer with.\n       * @param byteSize { Number } The number of bytes written.\n       * @param value { Number } The number value to write.\n       * @param offset { Number } the offset to write the number at (REQUIRED).\n       *\n       */\n    _insertNumberValue(func, byteSize, value, offset) {\n        // Check for invalid offset values.\n        utils_1.checkOffsetValue(offset);\n        // Ensure there is enough internal Buffer capacity. (raw offset is passed)\n        this.ensureInsertable(byteSize, offset);\n        // Call buffer.writeXXXX();\n        func.call(this._buff, value, offset);\n        // Adjusts internally managed write offset.\n        this._writeOffset += byteSize;\n    }\n    /**\n       * Writes a numeric number value based on the given offset and value.\n       *\n       * @param func { Function(offset: number, offset?) => number} The function to write data on the internal Buffer with.\n       * @param byteSize { Number } The number of bytes written.\n       * @param value { Number } The number value to write.\n       * @param offset { Number } the offset to write the number at (REQUIRED).\n       *\n       */\n    _writeNumberValue(func, byteSize, value, offset) {\n        // If an offset was provided, validate it.\n        if (typeof offset === 'number') {\n            // Check if we're writing beyond the bounds of the managed data.\n            if (offset < 0) {\n                throw new Error(utils_1.ERRORS.INVALID_WRITE_BEYOND_BOUNDS);\n            }\n            utils_1.checkOffsetValue(offset);\n        }\n        // Default to writeOffset if no offset value was given.\n        const offsetVal = typeof offset === 'number' ? offset : this._writeOffset;\n        // Ensure there is enough internal Buffer capacity. (raw offset is passed)\n        this._ensureWriteable(byteSize, offsetVal);\n        func.call(this._buff, value, offsetVal);\n        // If an offset was given, check to see if we wrote beyond the current writeOffset.\n        if (typeof offset === 'number') {\n            this._writeOffset = Math.max(this._writeOffset, offsetVal + byteSize);\n        }\n        else {\n            // If no numeric offset was given, we wrote to the end of the SmartBuffer so increment writeOffset.\n            this._writeOffset += byteSize;\n        }\n    }\n}\nexports.SmartBuffer = SmartBuffer;\n//# sourceMappingURL=smartbuffer.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/smart-buffer/build/smartbuffer.js\n// module id = 209\n// module chunks = 0\n\n//# sourceURL=../node_modules/smart-buffer/build/smartbuffer.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar Subscription = __webpack_require__(1273);\n\n\nvar Subscriptions = function Subscriptions(options) {\n    this.name = options.name;\n    this.type = options.type;\n    this.subscriptions = options.subscriptions || {};\n    this.requestManager = null;\n};\n\n\nSubscriptions.prototype.setRequestManager = function (rm) {\n    this.requestManager = rm;\n};\n\n\nSubscriptions.prototype.attachToObject = function (obj) {\n    var func = this.buildCall();\n    func.call = this.call;\n    var name = this.name.split('.');\n    if (name.length > 1) {\n        obj[name[0]] = obj[name[0]] || {};\n        obj[name[0]][name[1]] = func;\n    } else {\n        obj[name[0]] = func;\n    }\n};\n\n\nSubscriptions.prototype.buildCall = function() {\n    var _this = this;\n\n    return function(){\n        if(!_this.subscriptions[arguments[0]]) {\n            console.warn('Subscription '+ JSON.stringify(arguments[0]) +' doesn\\'t exist. Subscribing anyway.');\n        }\n\n        var subscription = new Subscription({\n            subscription: _this.subscriptions[arguments[0]],\n            requestManager: _this.requestManager,\n            type: _this.type\n        });\n\n        return subscription.subscribe.apply(subscription, arguments);\n    };\n};\n\n\nmodule.exports = {\n    subscriptions: Subscriptions,\n    subscription: Subscription\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-subscriptions/src/index.js\n// module id = 210\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-subscriptions/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(106);\nvar Method = __webpack_require__(105);\nvar utils = __webpack_require__(47);\n\n\nvar Net = function () {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n\n    [\n        new Method({\n            name: 'getId',\n            call: 'net_version',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'isListening',\n            call: 'net_listening',\n            params: 0\n        }),\n        new Method({\n            name: 'getPeerCount',\n            call: 'net_peerCount',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        })\n    ].forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n    });\n\n};\n\ncore.addProviders(Net);\n\n\nmodule.exports = Net;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-net/src/index.js\n// module id = 211\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-net/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar BN = __webpack_require__(30);\nvar BufferUtil = __webpack_require__(18);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar Hash = __webpack_require__(36);\nvar JSUtil = __webpack_require__(24);\nvar $ = __webpack_require__(13);\n\nvar GENESIS_BITS = 0x2003ffff;\n\n/**\n * Instantiate a BlockHeader from a Buffer, JSON object, or Object with\n * the properties of the BlockHeader\n *\n * @param {*} - A Buffer, JSON string, or Object\n * @returns {BlockHeader} - An instance of block header\n * @constructor\n */\nvar BlockHeader = function BlockHeader(arg) {\n  if (!(this instanceof BlockHeader)) {\n    return new BlockHeader(arg);\n  }\n  var info = BlockHeader._from(arg);\n  this.version = info.version;\n  this.prevHash = info.prevHash;\n  this.merkleRoot = info.merkleRoot;\n  this.reserved = info.reserved;\n  this.time = info.time;\n  this.timestamp = info.time;\n  this.bits = info.bits;\n  this.nonce = info.nonce;\n  this.solution = info.solution;\n\n  if (info.hash) {\n    $.checkState(\n      this.hash === info.hash,\n      'Argument object hash property does not match block hash.'\n    );\n  }\n\n  return this;\n};\n\n/**\n * @param {*} - A Buffer, JSON string or Object\n * @returns {Object} - An object representing block header data\n * @throws {TypeError} - If the argument was not recognized\n * @private\n */\nBlockHeader._from = function _from(arg) {\n  var info = {};\n  if (BufferUtil.isBuffer(arg)) {\n    info = BlockHeader._fromBufferReader(BufferReader(arg));\n  } else if (_.isObject(arg)) {\n    info = BlockHeader._fromObject(arg);\n  } else {\n    throw new TypeError('Unrecognized argument for BlockHeader');\n  }\n  return info;\n};\n\n/**\n * @param {Object} - A JSON string\n * @returns {Object} - An object representing block header data\n * @private\n */\nBlockHeader._fromObject = function _fromObject(data) {\n  $.checkArgument(data, 'data is required');\n  var prevHash = data.prevHash;\n  var merkleRoot = data.merkleRoot;\n  var reserved = data.reserved;\n  var nonce = data.nonce;\n  var solution = data.solution;\n  if (_.isString(data.prevHash)) {\n    prevHash = BufferUtil.reverse(new Buffer(data.prevHash, 'hex'));\n  }\n  if (_.isString(data.merkleRoot)) {\n    merkleRoot = BufferUtil.reverse(new Buffer(data.merkleRoot, 'hex'));\n  }\n  if (_.isString(data.reserved)) {\n    reserved = BufferUtil.reverse(new Buffer(data.reserved, 'hex'));\n  }\n  if (_.isString(data.nonce)) {\n    nonce = BufferUtil.reverse(new Buffer(data.nonce, 'hex'));\n  }\n  if (_.isString(data.solution)) {\n    solution = new Buffer(data.solution, 'hex');\n  }\n  var info = {\n    hash: data.hash,\n    version: data.version,\n    prevHash: prevHash,\n    merkleRoot: merkleRoot,\n    reserved: reserved,\n    time: data.time,\n    timestamp: data.time,\n    bits: data.bits,\n    nonce: nonce,\n    solution: solution\n  };\n  return info;\n};\n\n/**\n * @param {Object} - A plain JavaScript object\n * @returns {BlockHeader} - An instance of block header\n */\nBlockHeader.fromObject = function fromObject(obj) {\n  var info = BlockHeader._fromObject(obj);\n  return new BlockHeader(info);\n};\n\n/**\n * @param {Binary} - Raw block binary data or buffer\n * @returns {BlockHeader} - An instance of block header\n */\nBlockHeader.fromRawBlock = function fromRawBlock(data) {\n  if (!BufferUtil.isBuffer(data)) {\n    data = new Buffer(data, 'binary');\n  }\n  var br = BufferReader(data);\n  br.pos = BlockHeader.Constants.START_OF_HEADER;\n  var info = BlockHeader._fromBufferReader(br);\n  return new BlockHeader(info);\n};\n\n/**\n * @param {Buffer} - A buffer of the block header\n * @returns {BlockHeader} - An instance of block header\n */\nBlockHeader.fromBuffer = function fromBuffer(buf) {\n  var info = BlockHeader._fromBufferReader(BufferReader(buf));\n  return new BlockHeader(info);\n};\n\n/**\n * @param {string} - A hex encoded buffer of the block header\n * @returns {BlockHeader} - An instance of block header\n */\nBlockHeader.fromString = function fromString(str) {\n  var buf = new Buffer(str, 'hex');\n  return BlockHeader.fromBuffer(buf);\n};\n\n/**\n * @param {BufferReader} - A BufferReader of the block header\n * @returns {Object} - An object representing block header data\n * @private\n */\nBlockHeader._fromBufferReader = function _fromBufferReader(br) {\n  var info = {};\n  info.version = br.readUInt32LE();\n  info.prevHash = br.read(32);\n  info.merkleRoot = br.read(32);\n  info.reserved = br.read(32);\n  info.time = br.readUInt32LE();\n  info.bits = br.readUInt32LE();\n  info.nonce = br.read(32);\n  var lenSolution = br.readVarintNum();\n  info.solution = br.read(lenSolution);\n  return info;\n};\n\n/**\n * @param {BufferReader} - A BufferReader of the block header\n * @returns {BlockHeader} - An instance of block header\n */\nBlockHeader.fromBufferReader = function fromBufferReader(br) {\n  var info = BlockHeader._fromBufferReader(br);\n  return new BlockHeader(info);\n};\n\n/**\n * @returns {Object} - A plain object of the BlockHeader\n */\nBlockHeader.prototype.toObject = BlockHeader.prototype.toJSON = function toObject() {\n  return {\n    hash: this.hash,\n    version: this.version,\n    prevHash: BufferUtil.reverse(this.prevHash).toString('hex'),\n    merkleRoot: BufferUtil.reverse(this.merkleRoot).toString('hex'),\n    reserved: BufferUtil.reverse(this.reserved).toString('hex'),\n    time: this.time,\n    bits: this.bits,\n    nonce: BufferUtil.reverse(this.nonce).toString('hex'),\n    solution: this.solution.toString('hex')\n  };\n};\n\n/**\n * @returns {Buffer} - A Buffer of the BlockHeader\n */\nBlockHeader.prototype.toBuffer = function toBuffer() {\n  return this.toBufferWriter().concat();\n};\n\n/**\n * @returns {string} - A hex encoded string of the BlockHeader\n */\nBlockHeader.prototype.toString = function toString() {\n  return this.toBuffer().toString('hex');\n};\n\n/**\n * @param {BufferWriter} - An existing instance BufferWriter\n * @returns {BufferWriter} - An instance of BufferWriter representation of the BlockHeader\n */\nBlockHeader.prototype.toBufferWriter = function toBufferWriter(bw) {\n  if (!bw) {\n    bw = new BufferWriter();\n  }\n  bw.writeUInt32LE(this.version);\n  bw.write(this.prevHash);\n  bw.write(this.merkleRoot);\n  bw.write(this.reserved);\n  bw.writeUInt32LE(this.time);\n  bw.writeUInt32LE(this.bits);\n  bw.write(this.nonce);\n  bw.writeVarintNum(this.solution.length);\n  bw.write(this.solution);\n  return bw;\n};\n\n/**\n * Returns the target difficulty for this block\n * @param {Number} bits\n * @returns {BN} An instance of BN with the decoded difficulty bits\n */\nBlockHeader.prototype.getTargetDifficulty = function getTargetDifficulty(bits) {\n  bits = bits || this.bits;\n\n  var target = new BN(bits & 0xffffff);\n  var mov = 8 * ((bits >>> 24) - 3);\n  while (mov-- > 0) {\n    target = target.mul(new BN(2));\n  }\n  return target;\n};\n\n/**\n * @link https://en.bitcoin.it/wiki/Difficulty\n * @return {Number}\n */\nBlockHeader.prototype.getDifficulty = function getDifficulty() {\n  var difficulty1TargetBN = this.getTargetDifficulty(GENESIS_BITS).mul(new BN(Math.pow(10, 8)));\n  var currentTargetBN = this.getTargetDifficulty();\n\n  var difficultyString = difficulty1TargetBN.div(currentTargetBN).toString(10);\n  var decimalPos = difficultyString.length - 8;\n  difficultyString = difficultyString.slice(0, decimalPos) + '.' + difficultyString.slice(decimalPos);\n\n  return parseFloat(difficultyString);\n};\n\n/**\n * @returns {Buffer} - The little endian hash buffer of the header\n */\nBlockHeader.prototype._getHash = function hash() {\n  var buf = this.toBuffer();\n  return Hash.sha256sha256(buf);\n};\n\nvar idProperty = {\n  configurable: false,\n  enumerable: true,\n  /**\n   * @returns {string} - The big endian hash buffer of the header\n   */\n  get: function() {\n    if (!this._id) {\n      this._id = BufferReader(this._getHash()).readReverse().toString('hex');\n    }\n    return this._id;\n  },\n  set: _.noop\n};\nObject.defineProperty(BlockHeader.prototype, 'id', idProperty);\nObject.defineProperty(BlockHeader.prototype, 'hash', idProperty);\n\n/**\n * @returns {Boolean} - If timestamp is not too far in the future\n */\nBlockHeader.prototype.validTimestamp = function validTimestamp() {\n  var currentTime = Math.round(new Date().getTime() / 1000);\n  if (this.time > currentTime + BlockHeader.Constants.MAX_TIME_OFFSET) {\n    return false;\n  }\n  return true;\n};\n\n/**\n * @returns {Boolean} - If the proof-of-work hash satisfies the target difficulty\n */\nBlockHeader.prototype.validProofOfWork = function validProofOfWork() {\n  var pow = new BN(this.id, 'hex');\n  var target = this.getTargetDifficulty();\n\n  if (pow.cmp(target) > 0) {\n    return false;\n  }\n  return true;\n};\n\n/**\n * @returns {string} - A string formatted for the console\n */\nBlockHeader.prototype.inspect = function inspect() {\n  return '<BlockHeader ' + this.id + '>';\n};\n\nBlockHeader.Constants = {\n  START_OF_HEADER: 8, // Start buffer position in raw block data\n  MAX_TIME_OFFSET: 2 * 60 * 60, // The max a timestamp can be in the future\n  LARGEST_HASH: new BN('10000000000000000000000000000000000000000000000000000000000000000', 'hex')\n};\n\nmodule.exports = BlockHeader;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/block/blockheader.js\n// module id = 212\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/block/blockheader.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {\n\nfunction Random() {\n}\n\n/* secure random bytes that sometimes throws an error due to lack of entropy */\nRandom.getRandomBuffer = function(size) {\n  if (process.browser)\n    return Random.getRandomBufferBrowser(size);\n  else\n    return Random.getRandomBufferNode(size);\n};\n\nRandom.getRandomBufferNode = function(size) {\n  var crypto = __webpack_require__(60);\n  return crypto.randomBytes(size);\n};\n\nRandom.getRandomBufferBrowser = function(size) {\n  if (!window.crypto && !window.msCrypto)\n    throw new Error('window.crypto not available');\n\n  if (window.crypto && window.crypto.getRandomValues)\n    var crypto = window.crypto;\n  else if (window.msCrypto && window.msCrypto.getRandomValues) //internet explorer\n    var crypto = window.msCrypto;\n  else\n    throw new Error('window.crypto.getRandomValues not available');\n\n  var bbuf = new Uint8Array(size);\n  crypto.getRandomValues(bbuf);\n  var buf = new Buffer(bbuf);\n\n  return buf;\n};\n\n/* insecure random bytes, but it never fails */\nRandom.getPseudoRandomBuffer = function(size) {\n  var b32 = 0x100000000;\n  var b = new Buffer(size);\n  var r;\n\n  for (var i = 0; i <= size; i++) {\n    var j = Math.floor(i / 4);\n    var k = i - j * 4;\n    if (k === 0) {\n      r = Math.random() * b32;\n      b[i] = r & 0xff;\n    } else {\n      b[i] = (r = r >>> 8) & 0xff;\n    }\n  }\n\n  return b;\n};\n\nmodule.exports = Random;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/random.js\n// module id = 213\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/random.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar bs58 = __webpack_require__(571);\nvar buffer = __webpack_require__(0);\n\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'.split('');\n\nvar Base58 = function Base58(obj) {\n  /* jshint maxcomplexity: 8 */\n  if (!(this instanceof Base58)) {\n    return new Base58(obj);\n  }\n  if (Buffer.isBuffer(obj)) {\n    var buf = obj;\n    this.fromBuffer(buf);\n  } else if (typeof obj === 'string') {\n    var str = obj;\n    this.fromString(str);\n  } else if (obj) {\n    this.set(obj);\n  }\n};\n\nBase58.validCharacters = function validCharacters(chars) {\n  if (buffer.Buffer.isBuffer(chars)) {\n    chars = chars.toString();\n  }\n  return _.all(_.map(chars, function(char) { return _.contains(ALPHABET, char); }));\n};\n\nBase58.prototype.set = function(obj) {\n  this.buf = obj.buf || this.buf || undefined;\n  return this;\n};\n\nBase58.encode = function(buf) {\n  if (!buffer.Buffer.isBuffer(buf)) {\n    throw new Error('Input should be a buffer');\n  }\n  return bs58.encode(buf);\n};\n\nBase58.decode = function(str) {\n  if (typeof str !== 'string') {\n    throw new Error('Input should be a string');\n  }\n  return new Buffer(bs58.decode(str));\n};\n\nBase58.prototype.fromBuffer = function(buf) {\n  this.buf = buf;\n  return this;\n};\n\nBase58.prototype.fromString = function(str) {\n  var buf = Base58.decode(str);\n  this.buf = buf;\n  return this;\n};\n\nBase58.prototype.toBuffer = function() {\n  return this.buf;\n};\n\nBase58.prototype.toString = function() {\n  return Base58.encode(this.buf);\n};\n\nmodule.exports = Base58;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/encoding/base58.js\n// module id = 214\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/encoding/base58.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar Address = __webpack_require__(108);\nvar Base58Check = __webpack_require__(158);\nvar BN = __webpack_require__(30);\nvar JSUtil = __webpack_require__(24);\nvar Networks = __webpack_require__(109);\nvar Point = __webpack_require__(125);\nvar PublicKey = __webpack_require__(66);\nvar Random = __webpack_require__(213);\nvar $ = __webpack_require__(13);\n\n/**\n * Instantiate a PrivateKey from a BN, Buffer and WIF.\n *\n * @example\n * ```javascript\n * // generate a new random key\n * var key = PrivateKey();\n *\n * // get the associated address\n * var address = key.toAddress();\n *\n * // encode into wallet export format\n * var exported = key.toWIF();\n *\n * // instantiate from the exported (and saved) private key\n * var imported = PrivateKey.fromWIF(exported);\n * ```\n *\n * @param {string} data - The encoded data in various formats\n * @param {Network|string=} network - a {@link Network} object, or a string with the network name\n * @returns {PrivateKey} A new valid instance of an PrivateKey\n * @constructor\n */\nfunction PrivateKey(data, network) {\n  /* jshint maxstatements: 20 */\n  /* jshint maxcomplexity: 8 */\n\n  if (!(this instanceof PrivateKey)) {\n    return new PrivateKey(data, network);\n  }\n  if (data instanceof PrivateKey) {\n    return data;\n  }\n\n  var info = this._classifyArguments(data, network);\n\n  // validation\n  if (!info.bn || info.bn.cmp(new BN(0)) === 0){\n    throw new TypeError('Number can not be equal to zero, undefined, null or false');\n  }\n  if (!info.bn.lt(Point.getN())) {\n    throw new TypeError('Number must be less than N');\n  }\n  if (typeof(info.network) === 'undefined') {\n    throw new TypeError('Must specify the network (\"livenet\" or \"testnet\")');\n  }\n\n  JSUtil.defineImmutable(this, {\n    bn: info.bn,\n    compressed: info.compressed,\n    network: info.network\n  });\n\n  Object.defineProperty(this, 'publicKey', {\n    configurable: false,\n    enumerable: true,\n    get: this.toPublicKey.bind(this)\n  });\n\n  return this;\n\n};\n\n/**\n * Internal helper to instantiate PrivateKey internal `info` object from\n * different kinds of arguments passed to the constructor.\n *\n * @param {*} data\n * @param {Network|string=} network - a {@link Network} object, or a string with the network name\n * @return {Object}\n */\nPrivateKey.prototype._classifyArguments = function(data, network) {\n  /* jshint maxcomplexity: 10 */\n  var info = {\n    compressed: true,\n    network: network ? Networks.get(network) : Networks.defaultNetwork\n  };\n\n  // detect type of data\n  if (_.isUndefined(data) || _.isNull(data)){\n    info.bn = PrivateKey._getRandomBN();\n  } else if (data instanceof BN) {\n    info.bn = data;\n  } else if (data instanceof Buffer || data instanceof Uint8Array) {\n    info = PrivateKey._transformBuffer(data, network);\n  } else if (data.bn && data.network){\n    info = PrivateKey._transformObject(data);\n  } else if (!network && Networks.get(data)) {\n    info.bn = PrivateKey._getRandomBN();\n    info.network = Networks.get(data);\n  } else if (typeof(data) === 'string'){\n    if (JSUtil.isHexa(data)) {\n      info.bn = new BN(new Buffer(data, 'hex'));\n    } else {\n      info = PrivateKey._transformWIF(data, network);\n    }\n  } else {\n    throw new TypeError('First argument is an unrecognized data type.');\n  }\n  return info;\n};\n\n/**\n * Internal function to get a random Big Number (BN)\n *\n * @returns {BN} A new randomly generated BN\n * @private\n */\nPrivateKey._getRandomBN = function(){\n  var condition;\n  var bn;\n  do {\n    var privbuf = Random.getRandomBuffer(32);\n    bn = BN.fromBuffer(privbuf);\n    condition = bn.lt(Point.getN());\n  } while (!condition);\n  return bn;\n};\n\n/**\n * Internal function to transform a WIF Buffer into a private key\n *\n * @param {Buffer} buf - An WIF string\n * @param {Network|string=} network - a {@link Network} object, or a string with the network name\n * @returns {Object} An object with keys: bn, network and compressed\n * @private\n */\nPrivateKey._transformBuffer = function(buf, network) {\n\n  var info = {};\n\n  if (buf.length === 32) {\n    return PrivateKey._transformBNBuffer(buf, network);\n  }\n\n  info.network = Networks.get(buf[0], 'privatekey');\n\n  if (!info.network) {\n    throw new Error('Invalid network');\n  }\n\n  if (network && info.network !== Networks.get(network)) {\n    throw new TypeError('Private key network mismatch');\n  }\n\n  if (buf.length === 1 + 32 + 1 && buf[1 + 32 + 1 - 1] === 1) {\n    info.compressed = true;\n  } else if (buf.length === 1 + 32) {\n    info.compressed = false;\n  } else {\n    throw new Error('Length of buffer must be 33 (uncompressed) or 34 (compressed)');\n  }\n\n  info.bn = BN.fromBuffer(buf.slice(1, 32 + 1));\n\n  return info;\n};\n\n/**\n * Internal function to transform a BN buffer into a private key\n *\n * @param {Buffer} buf\n * @param {Network|string=} network - a {@link Network} object, or a string with the network name\n * @returns {object} an Object with keys: bn, network, and compressed\n * @private\n */\nPrivateKey._transformBNBuffer = function(buf, network) {\n  var info = {};\n  info.network = Networks.get(network) || Networks.defaultNetwork;\n  info.bn = BN.fromBuffer(buf);\n  info.compressed = false;\n  return info;\n};\n\n/**\n * Internal function to transform a WIF string into a private key\n *\n * @param {string} buf - An WIF string\n * @returns {Object} An object with keys: bn, network and compressed\n * @private\n */\nPrivateKey._transformWIF = function(str, network) {\n  return PrivateKey._transformBuffer(Base58Check.decode(str), network);\n};\n\n/**\n * Instantiate a PrivateKey from a Buffer with the DER or WIF representation\n *\n * @param {Buffer} arg\n * @param {Network} network\n * @return {PrivateKey}\n */\nPrivateKey.fromBuffer = function(arg, network) {\n  return new PrivateKey(arg, network);\n};\n\n/**\n * Internal function to transform a JSON string on plain object into a private key\n * return this.\n *\n * @param {string} json - A JSON string or plain object\n * @returns {Object} An object with keys: bn, network and compressed\n * @private\n */\nPrivateKey._transformObject = function(json) {\n  var bn = new BN(json.bn, 'hex');\n  var network = Networks.get(json.network);\n  return {\n    bn: bn,\n    network: network,\n    compressed: json.compressed\n  };\n};\n\n/**\n * Instantiate a PrivateKey from a WIF string\n *\n * @param {string} str - The WIF encoded private key string\n * @returns {PrivateKey} A new valid instance of PrivateKey\n */\nPrivateKey.fromString = PrivateKey.fromWIF = function(str) {\n  $.checkArgument(_.isString(str), 'First argument is expected to be a string.');\n  return new PrivateKey(str);\n};\n\n/**\n * Instantiate a PrivateKey from a plain JavaScript object\n *\n * @param {Object} obj - The output from privateKey.toObject()\n */\nPrivateKey.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj), 'First argument is expected to be an object.');\n  return new PrivateKey(obj);\n};\n\n/**\n * Instantiate a PrivateKey from random bytes\n *\n * @param {string=} network - Either \"livenet\" or \"testnet\"\n * @returns {PrivateKey} A new valid instance of PrivateKey\n */\nPrivateKey.fromRandom = function(network) {\n  var bn = PrivateKey._getRandomBN();\n  return new PrivateKey(bn, network);\n};\n\n/**\n * Check if there would be any errors when initializing a PrivateKey\n *\n * @param {string} data - The encoded data in various formats\n * @param {string=} network - Either \"livenet\" or \"testnet\"\n * @returns {null|Error} An error if exists\n */\n\nPrivateKey.getValidationError = function(data, network) {\n  var error;\n  try {\n    /* jshint nonew: false */\n    new PrivateKey(data, network);\n  } catch (e) {\n    error = e;\n  }\n  return error;\n};\n\n/**\n * Check if the parameters are valid\n *\n * @param {string} data - The encoded data in various formats\n * @param {string=} network - Either \"livenet\" or \"testnet\"\n * @returns {Boolean} If the private key is would be valid\n */\nPrivateKey.isValid = function(data, network){\n  if (!data) {\n    return false;\n  }\n  return !PrivateKey.getValidationError(data, network);\n};\n\n/**\n * Will output the PrivateKey encoded as hex string\n *\n * @returns {string}\n */\nPrivateKey.prototype.toString = function() {\n  return this.toBuffer().toString('hex');\n};\n\n/**\n * Will output the PrivateKey to a WIF string\n *\n * @returns {string} A WIP representation of the private key\n */\nPrivateKey.prototype.toWIF = function() {\n  var network = this.network;\n  var compressed = this.compressed;\n\n  var buf;\n  if (compressed) {\n    buf = Buffer.concat([new Buffer([network.privatekey]),\n                         this.bn.toBuffer({size: 32}),\n                         new Buffer([0x01])]);\n  } else {\n    buf = Buffer.concat([new Buffer([network.privatekey]),\n                         this.bn.toBuffer({size: 32})]);\n  }\n\n  return Base58Check.encode(buf);\n};\n\n/**\n * Will return the private key as a BN instance\n *\n * @returns {BN} A BN instance of the private key\n */\nPrivateKey.prototype.toBigNumber = function(){\n  return this.bn;\n};\n\n/**\n * Will return the private key as a BN buffer\n *\n * @returns {Buffer} A buffer of the private key\n */\nPrivateKey.prototype.toBuffer = function(){\n  return this.bn.toBuffer();\n};\n\n/**\n * Will return the corresponding public key\n *\n * @returns {PublicKey} A public key generated from the private key\n */\nPrivateKey.prototype.toPublicKey = function(){\n  if (!this._pubkey) {\n    this._pubkey = PublicKey.fromPrivateKey(this);\n  }\n  return this._pubkey;\n};\n\n/**\n * Will return an address for the private key\n * @param {Network=} network - optional parameter specifying\n * the desired network for the address\n *\n * @returns {Address} An address generated from the private key\n */\nPrivateKey.prototype.toAddress = function(network) {\n  var pubkey = this.toPublicKey();\n  return Address.fromPublicKey(pubkey, network || this.network);\n};\n\n/**\n * @returns {Object} A plain object representation\n */\nPrivateKey.prototype.toObject = PrivateKey.prototype.toJSON = function toObject() {\n  return {\n    bn: this.bn.toString('hex'),\n    compressed: this.compressed,\n    network: this.network.toString()\n  };\n};\n\n/**\n * Will return a string formatted for the console\n *\n * @returns {string} Private key\n */\nPrivateKey.prototype.inspect = function() {\n  var uncompressed = !this.compressed ? ', uncompressed' : '';\n  return '<PrivateKey: ' + this.toString() + ', network: ' + this.network + uncompressed + '>';\n};\n\nmodule.exports = PrivateKey;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/privatekey.js\n// module id = 215\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/privatekey.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(319);\n\nmodule.exports.Input = __webpack_require__(318);\nmodule.exports.Output = __webpack_require__(83);\nmodule.exports.UnspentOutput = __webpack_require__(570);\nmodule.exports.Signature = __webpack_require__(160);\nmodule.exports.Sighash = __webpack_require__(84);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/index.js\n// module id = 216\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = exports;\n\ncurve.base = __webpack_require__(1329);\ncurve.short = __webpack_require__(1332);\ncurve.mont = __webpack_require__(1331);\ncurve.edwards = __webpack_require__(1330);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curve/index.js\n// module id = 217\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curve/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\n\nexports.default = function (coll, iteratee, callback) {\n    var eachOfImplementation = (0, _isArrayLike2.default)(coll) ? eachOfArrayLike : eachOfGeneric;\n    eachOfImplementation(coll, (0, _wrapAsync2.default)(iteratee), callback);\n};\n\nvar _isArrayLike = __webpack_require__(98);\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _breakLoop = __webpack_require__(219);\n\nvar _breakLoop2 = _interopRequireDefault(_breakLoop);\n\nvar _eachOfLimit = __webpack_require__(326);\n\nvar _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);\n\nvar _doLimit = __webpack_require__(220);\n\nvar _doLimit2 = _interopRequireDefault(_doLimit);\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(221);\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n    callback = (0, _once2.default)(callback || _noop2.default);\n    var index = 0,\n        completed = 0,\n        length = coll.length;\n    if (length === 0) {\n        callback(null);\n    }\n\n    function iteratorCallback(err, value) {\n        if (err) {\n            callback(err);\n        } else if (++completed === length || value === _breakLoop2.default) {\n            callback(null);\n        }\n    }\n\n    for (; index < length; index++) {\n        iteratee(coll[index], index, (0, _onlyOnce2.default)(iteratorCallback));\n    }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = (0, _doLimit2.default)(_eachOfLimit2.default, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item\'s key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n *     fs.readFile(__dirname + value, "utf8", function (err, data) {\n *         if (err) return callback(err);\n *         try {\n *             configs[key] = JSON.parse(data);\n *         } catch (e) {\n *             return callback(e);\n *         }\n *         callback();\n *     });\n * }, function (err) {\n *     if (err) console.error(err.message);\n *     // configs is now a map of JSON data\n *     doSomethingWith(configs);\n * });\n */\nmodule.exports = exports[\'default\'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/eachOf.js\n// module id = 218\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/eachOf.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n  value: true\n});\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nexports.default = {};\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/breakLoop.js\n// module id = 219\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/breakLoop.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = doLimit;\nfunction doLimit(fn, limit) {\n    return function (iterable, iteratee, callback) {\n        return fn(iterable, limit, iteratee, callback);\n    };\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/doLimit.js\n// module id = 220\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/doLimit.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = once;\nfunction once(fn) {\n    return function () {\n        if (fn === null) return;\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, arguments);\n    };\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/once.js\n// module id = 221\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/once.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate, process) {\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.hasNextTick = exports.hasSetImmediate = undefined;\nexports.fallback = fallback;\nexports.wrap = wrap;\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasSetImmediate = exports.hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = exports.hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n    setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n    return function (fn /*, ...args*/) {\n        var args = (0, _slice2.default)(arguments, 1);\n        defer(function () {\n            fn.apply(null, args);\n        });\n    };\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n    _defer = setImmediate;\n} else if (hasNextTick) {\n    _defer = process.nextTick;\n} else {\n    _defer = fallback;\n}\n\nexports.default = wrap(_defer);\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/setImmediate.js\n// module id = 222\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/setImmediate.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nexports.default = function (worker, concurrency) {\n  var _worker = (0, _wrapAsync2.default)(worker);\n  return (0, _queue2.default)(function (items, cb) {\n    _worker(items[0], cb);\n  }, concurrency, 1);\n};\n\nvar _queue = __webpack_require__(599);\n\nvar _queue2 = _interopRequireDefault(_queue);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Object} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {Function} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {Function} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {Function} remove - remove items from the queue that match a test\n * function.  The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a callback that is called when the number of\n * running workers hits the `concurrency` limit, and further tasks will be\n * queued.\n * @property {Function} unsaturated - a callback that is called when the number\n * of running workers is less than the `concurrency` & `buffer` limits, and\n * further tasks will not be queued.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - a callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} error - a callback that is called when a task errors.\n * Has the signature `function(error, task)`.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel.  If omitted, the concurrency\n * defaults to `1`.  If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n *     console.log('hello ' + task.name);\n *     callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain = function() {\n *     console.log('all items have been processed');\n * };\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * q.push({name: 'bar'}, function (err) {\n *     console.log('finished processing bar');\n * });\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n *     console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n *     console.log('finished processing bar');\n * });\n */\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/queue.js\n// module id = 223\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/queue.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _typeof2 = __webpack_require__(225);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _promise = __webpack_require__(130);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _regenerator = __webpack_require__(132);\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _stringify = __webpack_require__(335);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _asyncToGenerator2 = __webpack_require__(131);\n\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\n\nvar _assign = __webpack_require__(336);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nvar _utils = __webpack_require__(129);\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _DB = __webpack_require__(604);\n\nvar _DB2 = _interopRequireDefault(_DB);\n\nvar _web = __webpack_require__(1297);\n\nvar _web2 = _interopRequireDefault(_web);\n\nvar _account = __webpack_require__(314);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar _config = {}; /* global fetch */\n\nvar _wallet = { openkey: false\n\n  /**\n   * Class for work with [Ethereum Account/Wallet](http://ethdocs.org/en/latest/account-management.html).\n   *\n   * ETH **account creates automatically** when DCLib init, and stored in Store.\n   * For creating account lib user [web3.eth.accounts](web3js.readthedocs.io/en/1.0/web3-eth-accounts.html)\n   *\n   * ## About accounts in ETH\n   * Accounts play a central role in Ethereum. There are two types of accounts: externally owned accounts (EOAs) and contract accounts. Here we focus on externally owned accounts, which will be referred to simply as accounts. Contract accounts will be referred to as contracts and are discussed in detail in Contracts. This generic notion of account subsuming both externally owned accounts and contracts is justified in that these entities are so called state objects. These entities have a state: accounts have balance and contracts have both balance and contract storage. The state of all accounts is the state of the Ethereum network which is updated with every block and which the network really needs to reach a consensus about. Accounts are essential for users to interact with the Ethereum blockchain via transactions.\n   * If we restrict Ethereum to only externally owned accounts and allow only transactions between them, we arrive at an “altcoin” system that is less powerful than bitcoin itself and can only be used to transfer ether.\n   *\n   * @export\n   * @class Account\n   * @extends {DCLib}\n   */\n};\nvar Account = function () {\n  /**\n  * @ignore\n  */\n  function Account(config) {\n    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n    (0, _classCallCheck3.default)(this, Account);\n\n    callback = callback || function () {};\n\n    _config = (0, _assign2.default)(_config3.default, config);\n    // this._wallet = _wallet\n    this._config = _config;\n\n    /**\n     * @ignore\n     */\n\n    this.web3 = new _web2.default(new _web2.default.providers.HttpProvider(_config.rpc_url));\n\n    // Init ERC20 contract\n    this._ERC20 = new this.web3.eth.Contract(_config.contracts.erc20.abi, _config.contracts.erc20.address);\n\n    callback();\n  }\n\n  (0, _createClass3.default)(Account, [{\n    key: 'initAccount',\n    value: function () {\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {\n        var _this = this;\n\n        var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n        var ethwallet, privateKey;\n        return _regenerator2.default.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                ethwallet = _DB2.default.getItem('ethwallet');\n\n\n                if (ethwallet) {\n                  try {\n                    _wallet.openkey = '0x' + JSON.parse(ethwallet).address;\n                  } catch (e) {\n                    Utils.debugLog(['Error!', e], 'error');\n                  }\n                }\n\n                if (_wallet.openkey) {\n                  _context.next = 16;\n                  break;\n                }\n\n                if (!(typeof window === 'undefined')) {\n                  _context.next = 6;\n                  break;\n                }\n\n                setTimeout(function () {\n                  _this.initAccount();\n                }, 333);\n                return _context.abrupt('return');\n\n              case 6:\n                _context.next = 8;\n                return this.getAccountFromServer();\n\n              case 8:\n                _context.t0 = _context.sent;\n\n                if (_context.t0) {\n                  _context.next = 11;\n                  break;\n                }\n\n                _context.t0 = this.web3.eth.accounts.create().privateKey;\n\n              case 11:\n                privateKey = _context.t0;\n                _context.next = 14;\n                return _DB2.default.setItem('ethwallet', (0, _stringify2.default)(this.web3.eth.accounts.encrypt(privateKey, this._config.wallet_pass)));\n\n              case 14:\n\n                this.web3.eth.accounts.wallet.add(privateKey);\n\n                Utils.debugLog([' 👤 New account created:', _wallet.openkey], _config.loglevel);\n\n              case 16:\n\n                this.unlockAccount();\n                if (callback) callback();\n\n              case 18:\n              case 'end':\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function initAccount() {\n        return _ref.apply(this, arguments);\n      }\n\n      return initAccount;\n    }()\n\n    /**\n     * @ignore\n     */\n\n  }, {\n    key: 'getAccountFromServer',\n    value: function getAccountFromServer() {\n      var localStorageStatusKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'statusGetAccfromFaucet';\n\n      var status = _DB2.default.getItem(localStorageStatusKey);\n\n      if (status) {\n        if (status === 'wait') {\n          return new _promise2.default(function (resolve, reject) {\n            var waitTimer = function waitTimer() {\n              setTimeout(function () {\n                var newStatus = _DB2.default.getItem(localStorageStatusKey);\n                if ((typeof newStatus === 'undefined' ? 'undefined' : (0, _typeof3.default)(newStatus)) === 'object' && newStatus.privateKey) {\n                  resolve(newStatus);\n                } else {\n                  waitTimer();\n                }\n              }, 1000);\n            };\n            waitTimer();\n          });\n        }\n        return;\n      }\n\n      _DB2.default.setItem(localStorageStatusKey, 'wait');\n\n      return fetch(_config.api_url + '?get=account').then(function (res) {\n        return res.json();\n      }).then(function (acc) {\n        Utils.debugLog(['Server account data:', acc], _config.loglevel);\n        _DB2.default.setItem(localStorageStatusKey, (0, _stringify2.default)(acc));\n\n        _wallet.openkey = acc.address;\n        return acc.privateKey;\n      }).catch(function (e) {\n        Utils.debugLog(e);\n        return false;\n      });\n    }\n\n    /**\n     * ## DCLib.Account.unlockAccount(password)\n     * method recover user account on password\n     *\n     * @example\n     * > DCLib.Account.unlockAccount('1234') // '1234' - User Password\n     *\n     *\n     * @example\n     * // method returns\n     *\n     * {\n     *   address: \"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\"\n     *   encrypt: encrypt(password, options)\n     *   openkey: \"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\"\n     *   privateKey: \"0xd8c226915b298530ee9ede352a1c9fe49f15a78167477e34731e26ccc7f577aa\"\n     * }\n     *\n     * @param {String} [password=false] - User password for decrypt privateKey and unlock user account\n     * @returns {Object} - _wallet object for the work of the Account\n     *\n     * @extends {Account}\n     */\n\n  }, {\n    key: 'unlockAccount',\n    value: function unlockAccount() {\n      var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n      password = password || this._config.wallet_pass;\n\n      if (!_DB2.default.getItem('ethwallet')) return false;\n\n      _wallet = this.web3.eth.accounts.decrypt(_DB2.default.getItem('ethwallet'), password);\n\n      this.web3.eth.accounts.wallet.add(_wallet.privateKey);\n\n      _wallet.openkey = _wallet.address;\n\n      /**\n       * @ignore\n       */\n      this.signTransaction = _wallet.signTransaction;\n\n      return _wallet;\n    }\n\n    /**\n     * ## DCLib.Account.exportPrivateKey(password)\n     * method get privateKey from account on user password\n     *\n     * @example\n     * > DCLib.Account.exportPrivateKey('1234') // '1234' user password for decrypt private key\n     *\n     * @example\n     * // method return\n     * > \"0xd8c226915b298530ee9ede352a1c9fe49f15a78167477e34731e26ccc7f577aa\" // PrivateKey\n     *\n     * @param {string} [password=false] - user passwod for decrypt privateKey\n     * @returns {string} - Private key for user account\n     *\n     * @extends {Account}\n     */\n\n  }, {\n    key: 'exportPrivateKey',\n    value: function exportPrivateKey() {\n      var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n      // if (_wallet.privateKey) return _wallet.privateKey\n\n      return this.unlockAccount(password).privateKey;\n    }\n\n    /**\n     * ## DCLib.Account.get()\n     * method getting account information\n     *\n     * @example\n     * > DCLib.Account.get()\n     *\n     * @example\n     * // method return\n     *\n     * {\n     *   address: \"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\"\n     *   encrypt: method\n     *   openkey: \"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\"\n     *   sign: method\n     *   signTransaction: method\n     * }\n     *\n     * @returns {Object} - account info and user method's\n     *\n     * @extends {Account}\n     */\n\n  }, {\n    key: 'get',\n    value: function get() {\n      var w = (0, _assign2.default)({}, _wallet);\n      delete w.privateKey;\n      return w;\n    }\n\n    /**\n     * ## DCLib.Account.sign(raw)\n     * Signs arbitrary data. This data is before\n     * UTF-8 HEX decoded and enveloped as follows:\n     * \"\\x19Ethereum Signed Message:\\n\" + message.length + message\n     *\n     * @example\n     * > DCLib.Account.sign('Hello world')\n     *\n     * @example\n     * // method return\n     *\n     * {\n     *   message: \"Hello world\"\n     *   messageHash: \"0x25674ba4b416425b2ac42fdb33d0b0c20c59824a76e1ee4ecc04b8d48f8f6af7\"\n     *   r: \"0x6a1bcec4ff132aadb511cfd83131e456fab8b94d92c219448113697b5d75308b\"\n     *   s: \"0x3b805ef93c60b561b72d7c985fac11a574be0c2b2e4f3a8701cd01afa8e6edd7\"\n     *   v: \"0x1b\"\n     *   signature: `\"0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320b\n     *   b8b0ba760038313b7e2a01674e773e5c2dec046b09fde1560dca38f35ca928765631c\"`\n     * }\n     *\n     * @param {string} raw - message for sign\n     * @returns {Object} - sign data\n     *\n     * @extends {Account}\n     */\n\n  }, {\n    key: 'sign',\n    value: function sign(raw) {\n      Utils.debugLog(['call %web3.eth.accounts.sign', ['font-weight:bold;']], _config.loglevel);\n      Utils.debugLog('More docs: http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#sign', _config.loglevel);\n\n      raw = Utils.remove0x(raw);\n      Utils.debugLog(raw, _config.loglevel);\n      return _wallet.sign(raw);\n    }\n\n    /**\n     * ## DCLib.Account.signHash(hash)\n     * method sign hashMessage\n     *\n     *\n     * @example\n     * > DCLib.Account.signHash(\"0xAb23..\")\n       *\n     * @example\n     * // method return\n     * > `0x6a1bcec4ff132aadb511cfd83131e456fab8b94d92c219448113697b5d75308b3b805\n     *  ef93c60b561b72d7c985fac11a574be0c2b2e4f3a8701cd01afa8e6edd71b`\n     *\n     * @param {String} hash - message which need turn in hash\n     * @returns {String} - hashed Message\n     *\n     * @memberOf {Account}\n     */\n\n  }, {\n    key: 'signHash',\n    value: function signHash(hash) {\n      hash = Utils.add0x(hash);\n      if (!this.web3.utils.isHexStrict(hash)) {\n        console.log(hash + ' is not correct hex');\n        console.log('Use DCLib.Utils.makeSeed or Utils.soliditySHA3(your_args) to create valid hash');\n      }\n\n      return (0, _account.sign)(hash, Utils.add0x(this.exportPrivateKey()));\n    }\n\n    /**\n     * ## method init DCLib.Account.reset()\n     * method delete account of localStorage\n     *\n     * @example\n     * DCLib.Account.reset()\n     *\n     * @returns - none\n     * @memberOf {Account}\n     */\n\n  }, {\n    key: 'reset',\n    value: function reset() {\n      _DB2.default.setItem('ethwallet', '');\n    }\n\n    /**\n     * This callback is\n     * @callback onTxMined\n     * @param {Object} receipt - information about mined trasaction\n     */\n    /**\n     * ## DCLib.Account.sendBets(to, amount)\n     * sendBets from current account to another account\n     * you can use it with \"await\"\n     *\n     * @async\n     *\n     * @example\n     * const r = await DCLib.Account.sendBets('0xAb5', 10)\n     *\n     * @example\n     * // or classic callback\n     * DCLib.Account.sendBets('0xAb5...', 10, function(receipt){ ... })\n     *\n     * @param  {string} to - bytes32 address\n     * @param  {number} amount - how many bets send, 1 - 1BET, 22 - 22BET\n     * @param  {onTxMined} callback - callback, when transacrion mined\n     * @return {Promise.receipt} - return web3.send promise,\n     *\n     * @memberOf {Account}\n     */\n\n  }, {\n    key: 'sendBets',\n    value: function () {\n      var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(toInput, amountInput) {\n        var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n        var to, amount;\n        return _regenerator2.default.wrap(function _callee2$(_context2) {\n          while (1) {\n            switch (_context2.prev = _context2.next) {\n              case 0:\n                to = Utils.add0x(toInput);\n                amount = Utils.bet2dec(amountInput);\n                _context2.t0 = this._ERC20.methods.transfer(to, amount);\n                _context2.t1 = this.get().openkey;\n                _context2.t2 = this._config.gasPrice;\n                _context2.next = 7;\n                return this._ERC20.methods.transfer(to, amount).estimateGas({ from: this.get().openkey });\n\n              case 7:\n                _context2.t3 = _context2.sent;\n                _context2.t4 = {\n                  from: _context2.t1,\n                  gasPrice: _context2.t2,\n                  gas: _context2.t3\n                };\n\n                _context2.t5 = function (transactionHash) {\n                  Utils.debugLog('transactionHash:', transactionHash);\n                };\n\n                _context2.t6 = function (receipt) {\n                  Utils.debugLog('receipt:', receipt);\n                };\n\n                _context2.t7 = function (receipt) {\n                  if (callback) callback(receipt);\n                  return receipt;\n                };\n\n                _context2.t8 = function (err) {\n                  return Utils.debugLog('Send bets .catch ', err);\n                };\n\n                return _context2.abrupt('return', _context2.t0.send.call(_context2.t0, _context2.t4).on('transactionHash', _context2.t5).on('receipt', _context2.t6).then(_context2.t7, _context2.t8));\n\n              case 14:\n              case 'end':\n                return _context2.stop();\n            }\n          }\n        }, _callee2, this);\n      }));\n\n      function sendBets(_x7, _x8) {\n        return _ref2.apply(this, arguments);\n      }\n\n      return sendBets;\n    }()\n  }]);\n  return Account;\n}();\n\nexports.default = Account;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/Eth/Account.js\n// module id = 224\n// module chunks = 0\n\n//# sourceURL=Eth/Account.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(617);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(616);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n  return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n  return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/typeof.js\n// module id = 225\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/typeof.js')},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*\r\n *  big.js v5.1.2\r\n *  A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.\r\n *  Copyright (c) 2017 Michael Mclaughlin <M8ch88l@gmail.com>\r\n *  https://github.com/MikeMcl/big.js/LICENCE\r\n */\r\n;(function (GLOBAL) {\r\n  'use strict';\r\n  var Big,\r\n\r\n\r\n/************************************** EDITABLE DEFAULTS *****************************************/\r\n\r\n\r\n    // The default values below must be integers within the stated ranges.\r\n\r\n    /*\r\n     * The maximum number of decimal places (DP) of the results of operations involving division:\r\n     * div and sqrt, and pow with negative exponents.\r\n     */\r\n    DP = 20,          // 0 to MAX_DP\r\n\r\n    /*\r\n     * The rounding mode (RM) used when rounding to the above decimal places.\r\n     *\r\n     *  0  Towards zero (i.e. truncate, no rounding).       (ROUND_DOWN)\r\n     *  1  To nearest neighbour. If equidistant, round up.  (ROUND_HALF_UP)\r\n     *  2  To nearest neighbour. If equidistant, to even.   (ROUND_HALF_EVEN)\r\n     *  3  Away from zero.                                  (ROUND_UP)\r\n     */\r\n    RM = 1,             // 0, 1, 2 or 3\r\n\r\n    // The maximum value of DP and Big.DP.\r\n    MAX_DP = 1E6,       // 0 to 1000000\r\n\r\n    // The maximum magnitude of the exponent argument to the pow method.\r\n    MAX_POWER = 1E6,    // 1 to 1000000\r\n\r\n    /*\r\n     * The negative exponent (NE) at and beneath which toString returns exponential notation.\r\n     * (JavaScript numbers: -7)\r\n     * -1000000 is the minimum recommended exponent value of a Big.\r\n     */\r\n    NE = -7,            // 0 to -1000000\r\n\r\n    /*\r\n     * The positive exponent (PE) at and above which toString returns exponential notation.\r\n     * (JavaScript numbers: 21)\r\n     * 1000000 is the maximum recommended exponent value of a Big.\r\n     * (This limit is not enforced or checked.)\r\n     */\r\n    PE = 21,            // 0 to 1000000\r\n\r\n\r\n/**************************************************************************************************/\r\n\r\n\r\n    // Error messages.\r\n    NAME = '[big.js] ',\r\n    INVALID = NAME + 'Invalid ',\r\n    INVALID_DP = INVALID + 'decimal places',\r\n    INVALID_RM = INVALID + 'rounding mode',\r\n    DIV_BY_ZERO = NAME + 'Division by zero',\r\n\r\n    // The shared prototype object.\r\n    P = {},\r\n    UNDEFINED = void 0,\r\n    NUMERIC = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i;\r\n\r\n\r\n  /*\r\n   * Create and return a Big constructor.\r\n   *\r\n   */\r\n  function _Big_() {\r\n\r\n    /*\r\n     * The Big constructor and exported function.\r\n     * Create and return a new instance of a Big number object.\r\n     *\r\n     * n {number|string|Big} A numeric value.\r\n     */\r\n    function Big(n) {\r\n      var x = this;\r\n\r\n      // Enable constructor usage without new.\r\n      if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n);\r\n\r\n      // Duplicate.\r\n      if (n instanceof Big) {\r\n        x.s = n.s;\r\n        x.e = n.e;\r\n        x.c = n.c.slice();\r\n      } else {\r\n        parse(x, n);\r\n      }\r\n\r\n      /*\r\n       * Retain a reference to this Big constructor, and shadow Big.prototype.constructor which\r\n       * points to Object.\r\n       */\r\n      x.constructor = Big;\r\n    }\r\n\r\n    Big.prototype = P;\r\n    Big.DP = DP;\r\n    Big.RM = RM;\r\n    Big.NE = NE;\r\n    Big.PE = PE;\r\n    Big.version = '5.0.2';\r\n\r\n    return Big;\r\n  }\r\n\r\n\r\n  /*\r\n   * Parse the number or string value passed to a Big constructor.\r\n   *\r\n   * x {Big} A Big number instance.\r\n   * n {number|string} A numeric value.\r\n   */\r\n  function parse(x, n) {\r\n    var e, i, nl;\r\n\r\n    // Minus zero?\r\n    if (n === 0 && 1 / n < 0) n = '-0';\r\n    else if (!NUMERIC.test(n += '')) throw Error(INVALID + 'number');\r\n\r\n    // Determine sign.\r\n    x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1;\r\n\r\n    // Decimal point?\r\n    if ((e = n.indexOf('.')) > -1) n = n.replace('.', '');\r\n\r\n    // Exponential form?\r\n    if ((i = n.search(/e/i)) > 0) {\r\n\r\n      // Determine exponent.\r\n      if (e < 0) e = i;\r\n      e += +n.slice(i + 1);\r\n      n = n.substring(0, i);\r\n    } else if (e < 0) {\r\n\r\n      // Integer.\r\n      e = n.length;\r\n    }\r\n\r\n    nl = n.length;\r\n\r\n    // Determine leading zeros.\r\n    for (i = 0; i < nl && n.charAt(i) == '0';) ++i;\r\n\r\n    if (i == nl) {\r\n\r\n      // Zero.\r\n      x.c = [x.e = 0];\r\n    } else {\r\n\r\n      // Determine trailing zeros.\r\n      for (; nl > 0 && n.charAt(--nl) == '0';);\r\n      x.e = e - i - 1;\r\n      x.c = [];\r\n\r\n      // Convert string to array of digits without leading/trailing zeros.\r\n      for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Round Big x to a maximum of dp decimal places using rounding mode rm.\r\n   * Called by stringify, P.div, P.round and P.sqrt.\r\n   *\r\n   * x {Big} The Big to round.\r\n   * dp {number} Integer, 0 to MAX_DP inclusive.\r\n   * rm {number} 0, 1, 2 or 3 (DOWN, HALF_UP, HALF_EVEN, UP)\r\n   * [more] {boolean} Whether the result of division was truncated.\r\n   */\r\n  function round(x, dp, rm, more) {\r\n    var xc = x.c,\r\n      i = x.e + dp + 1;\r\n\r\n    if (i < xc.length) {\r\n      if (rm === 1) {\r\n\r\n        // xc[i] is the digit after the digit that may be rounded up.\r\n        more = xc[i] >= 5;\r\n      } else if (rm === 2) {\r\n        more = xc[i] > 5 || xc[i] == 5 &&\r\n          (more || i < 0 || xc[i + 1] !== UNDEFINED || xc[i - 1] & 1);\r\n      } else if (rm === 3) {\r\n        more = more || xc[i] !== UNDEFINED || i < 0;\r\n      } else {\r\n        more = false;\r\n        if (rm !== 0) throw Error(INVALID_RM);\r\n      }\r\n\r\n      if (i < 1) {\r\n        xc.length = 1;\r\n\r\n        if (more) {\r\n\r\n          // 1, 0.1, 0.01, 0.001, 0.0001 etc.\r\n          x.e = -dp;\r\n          xc[0] = 1;\r\n        } else {\r\n\r\n          // Zero.\r\n          xc[0] = x.e = 0;\r\n        }\r\n      } else {\r\n\r\n        // Remove any digits after the required decimal places.\r\n        xc.length = i--;\r\n\r\n        // Round up?\r\n        if (more) {\r\n\r\n          // Rounding up may mean the previous digit has to be rounded up.\r\n          for (; ++xc[i] > 9;) {\r\n            xc[i] = 0;\r\n            if (!i--) {\r\n              ++x.e;\r\n              xc.unshift(1);\r\n            }\r\n          }\r\n        }\r\n\r\n        // Remove trailing zeros.\r\n        for (i = xc.length; !xc[--i];) xc.pop();\r\n      }\r\n    } else if (rm < 0 || rm > 3 || rm !== ~~rm) {\r\n      throw Error(INVALID_RM);\r\n    }\r\n\r\n    return x;\r\n  }\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of Big x in normal or exponential notation.\r\n   * Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.\r\n   *\r\n   * x {Big}\r\n   * id? {number} Caller id.\r\n   *         1 toExponential\r\n   *         2 toFixed\r\n   *         3 toPrecision\r\n   *         4 valueOf\r\n   * n? {number|undefined} Caller's argument.\r\n   * k? {number|undefined}\r\n   */\r\n  function stringify(x, id, n, k) {\r\n    var e, s,\r\n      Big = x.constructor,\r\n      z = !x.c[0];\r\n\r\n    if (n !== UNDEFINED) {\r\n      if (n !== ~~n || n < (id == 3) || n > MAX_DP) {\r\n        throw Error(id == 3 ? INVALID + 'precision' : INVALID_DP);\r\n      }\r\n\r\n      x = new Big(x);\r\n\r\n      // The index of the digit that may be rounded up.\r\n      n = k - x.e;\r\n\r\n      // Round?\r\n      if (x.c.length > ++k) round(x, n, Big.RM);\r\n\r\n      // toFixed: recalculate k as x.e may have changed if value rounded up.\r\n      if (id == 2) k = x.e + n + 1;\r\n\r\n      // Append zeros?\r\n      for (; x.c.length < k;) x.c.push(0);\r\n    }\r\n\r\n    e = x.e;\r\n    s = x.c.join('');\r\n    n = s.length;\r\n\r\n    // Exponential notation?\r\n    if (id != 2 && (id == 1 || id == 3 && k <= e || e <= Big.NE || e >= Big.PE)) {\r\n      s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e;\r\n\r\n    // Normal notation.\r\n    } else if (e < 0) {\r\n      for (; ++e;) s = '0' + s;\r\n      s = '0.' + s;\r\n    } else if (e > 0) {\r\n      if (++e > n) for (e -= n; e--;) s += '0';\r\n      else if (e < n) s = s.slice(0, e) + '.' + s.slice(e);\r\n    } else if (n > 1) {\r\n      s = s.charAt(0) + '.' + s.slice(1);\r\n    }\r\n\r\n    return x.s < 0 && (!z || id == 4) ? '-' + s : s;\r\n  }\r\n\r\n\r\n  // Prototype/instance methods\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the absolute value of this Big.\r\n   */\r\n  P.abs = function () {\r\n    var x = new this.constructor(this);\r\n    x.s = 1;\r\n    return x;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return 1 if the value of this Big is greater than the value of Big y,\r\n   *       -1 if the value of this Big is less than the value of Big y, or\r\n   *        0 if they have the same value.\r\n  */\r\n  P.cmp = function (y) {\r\n    var isneg,\r\n      x = this,\r\n      xc = x.c,\r\n      yc = (y = new x.constructor(y)).c,\r\n      i = x.s,\r\n      j = y.s,\r\n      k = x.e,\r\n      l = y.e;\r\n\r\n    // Either zero?\r\n    if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i;\r\n\r\n    // Signs differ?\r\n    if (i != j) return i;\r\n\r\n    isneg = i < 0;\r\n\r\n    // Compare exponents.\r\n    if (k != l) return k > l ^ isneg ? 1 : -1;\r\n\r\n    j = (k = xc.length) < (l = yc.length) ? k : l;\r\n\r\n    // Compare digit by digit.\r\n    for (i = -1; ++i < j;) {\r\n      if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;\r\n    }\r\n\r\n    // Compare lengths.\r\n    return k == l ? 0 : k > l ^ isneg ? 1 : -1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,\r\n   * if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n   */\r\n  P.div = function (y) {\r\n    var x = this,\r\n      Big = x.constructor,\r\n      a = x.c,                  // dividend\r\n      b = (y = new Big(y)).c,   // divisor\r\n      k = x.s == y.s ? 1 : -1,\r\n      dp = Big.DP;\r\n\r\n    if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);\r\n\r\n    // Divisor is zero?\r\n    if (!b[0]) throw Error(DIV_BY_ZERO);\r\n\r\n    // Dividend is 0? Return +-0.\r\n    if (!a[0]) return new Big(k * 0);\r\n\r\n    var bl, bt, n, cmp, ri,\r\n      bz = b.slice(),\r\n      ai = bl = b.length,\r\n      al = a.length,\r\n      r = a.slice(0, bl),   // remainder\r\n      rl = r.length,\r\n      q = y,                // quotient\r\n      qc = q.c = [],\r\n      qi = 0,\r\n      d = dp + (q.e = x.e - y.e) + 1;    // number of digits of the result\r\n\r\n    q.s = k;\r\n    k = d < 0 ? 0 : d;\r\n\r\n    // Create version of divisor with leading zero.\r\n    bz.unshift(0);\r\n\r\n    // Add zeros to make remainder as long as divisor.\r\n    for (; rl++ < bl;) r.push(0);\r\n\r\n    do {\r\n\r\n      // n is how many times the divisor goes into current remainder.\r\n      for (n = 0; n < 10; n++) {\r\n\r\n        // Compare divisor and remainder.\r\n        if (bl != (rl = r.length)) {\r\n          cmp = bl > rl ? 1 : -1;\r\n        } else {\r\n          for (ri = -1, cmp = 0; ++ri < bl;) {\r\n            if (b[ri] != r[ri]) {\r\n              cmp = b[ri] > r[ri] ? 1 : -1;\r\n              break;\r\n            }\r\n          }\r\n        }\r\n\r\n        // If divisor < remainder, subtract divisor from remainder.\r\n        if (cmp < 0) {\r\n\r\n          // Remainder can't be more than 1 digit longer than divisor.\r\n          // Equalise lengths using divisor with extra leading zero?\r\n          for (bt = rl == bl ? b : bz; rl;) {\r\n            if (r[--rl] < bt[rl]) {\r\n              ri = rl;\r\n              for (; ri && !r[--ri];) r[ri] = 9;\r\n              --r[ri];\r\n              r[rl] += 10;\r\n            }\r\n            r[rl] -= bt[rl];\r\n          }\r\n\r\n          for (; !r[0];) r.shift();\r\n        } else {\r\n          break;\r\n        }\r\n      }\r\n\r\n      // Add the digit n to the result array.\r\n      qc[qi++] = cmp ? n : ++n;\r\n\r\n      // Update the remainder.\r\n      if (r[0] && cmp) r[rl] = a[ai] || 0;\r\n      else r = [a[ai]];\r\n\r\n    } while ((ai++ < al || r[0] !== UNDEFINED) && k--);\r\n\r\n    // Leading zero? Do not remove if result is simply zero (qi == 1).\r\n    if (!qc[0] && qi != 1) {\r\n\r\n      // There can't be more than one zero.\r\n      qc.shift();\r\n      q.e--;\r\n    }\r\n\r\n    // Round?\r\n    if (qi > d) round(q, dp, Big.RM, r[0] !== UNDEFINED);\r\n\r\n    return q;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is equal to the value of Big y, otherwise return false.\r\n   */\r\n  P.eq = function (y) {\r\n    return !this.cmp(y);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is greater than the value of Big y, otherwise return\r\n   * false.\r\n   */\r\n  P.gt = function (y) {\r\n    return this.cmp(y) > 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is greater than or equal to the value of Big y, otherwise\r\n   * return false.\r\n   */\r\n  P.gte = function (y) {\r\n    return this.cmp(y) > -1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is less than the value of Big y, otherwise return false.\r\n   */\r\n  P.lt = function (y) {\r\n    return this.cmp(y) < 0;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return true if the value of this Big is less than or equal to the value of Big y, otherwise\r\n   * return false.\r\n   */\r\n  P.lte = function (y) {\r\n    return this.cmp(y) < 1;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big minus the value of Big y.\r\n   */\r\n  P.minus = P.sub = function (y) {\r\n    var i, j, t, xlty,\r\n      x = this,\r\n      Big = x.constructor,\r\n      a = x.s,\r\n      b = (y = new Big(y)).s;\r\n\r\n    // Signs differ?\r\n    if (a != b) {\r\n      y.s = -b;\r\n      return x.plus(y);\r\n    }\r\n\r\n    var xc = x.c.slice(),\r\n      xe = x.e,\r\n      yc = y.c,\r\n      ye = y.e;\r\n\r\n    // Either zero?\r\n    if (!xc[0] || !yc[0]) {\r\n\r\n      // y is non-zero? x is non-zero? Or both are zero.\r\n      return yc[0] ? (y.s = -b, y) : new Big(xc[0] ? x : 0);\r\n    }\r\n\r\n    // Determine which is the bigger number. Prepend zeros to equalise exponents.\r\n    if (a = xe - ye) {\r\n\r\n      if (xlty = a < 0) {\r\n        a = -a;\r\n        t = xc;\r\n      } else {\r\n        ye = xe;\r\n        t = yc;\r\n      }\r\n\r\n      t.reverse();\r\n      for (b = a; b--;) t.push(0);\r\n      t.reverse();\r\n    } else {\r\n\r\n      // Exponents equal. Check digit by digit.\r\n      j = ((xlty = xc.length < yc.length) ? xc : yc).length;\r\n\r\n      for (a = b = 0; b < j; b++) {\r\n        if (xc[b] != yc[b]) {\r\n          xlty = xc[b] < yc[b];\r\n          break;\r\n        }\r\n      }\r\n    }\r\n\r\n    // x < y? Point xc to the array of the bigger number.\r\n    if (xlty) {\r\n      t = xc;\r\n      xc = yc;\r\n      yc = t;\r\n      y.s = -y.s;\r\n    }\r\n\r\n    /*\r\n     * Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only\r\n     * needs to start at yc.length.\r\n     */\r\n    if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0;\r\n\r\n    // Subtract yc from xc.\r\n    for (b = i; j > a;) {\r\n      if (xc[--j] < yc[j]) {\r\n        for (i = j; i && !xc[--i];) xc[i] = 9;\r\n        --xc[i];\r\n        xc[j] += 10;\r\n      }\r\n\r\n      xc[j] -= yc[j];\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (; xc[--b] === 0;) xc.pop();\r\n\r\n    // Remove leading zeros and adjust exponent accordingly.\r\n    for (; xc[0] === 0;) {\r\n      xc.shift();\r\n      --ye;\r\n    }\r\n\r\n    if (!xc[0]) {\r\n\r\n      // n - n = +0\r\n      y.s = 1;\r\n\r\n      // Result must be zero.\r\n      xc = [ye = 0];\r\n    }\r\n\r\n    y.c = xc;\r\n    y.e = ye;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big modulo the value of Big y.\r\n   */\r\n  P.mod = function (y) {\r\n    var ygtx,\r\n      x = this,\r\n      Big = x.constructor,\r\n      a = x.s,\r\n      b = (y = new Big(y)).s;\r\n\r\n    if (!y.c[0]) throw Error(DIV_BY_ZERO);\r\n\r\n    x.s = y.s = 1;\r\n    ygtx = y.cmp(x) == 1;\r\n    x.s = a;\r\n    y.s = b;\r\n\r\n    if (ygtx) return new Big(x);\r\n\r\n    a = Big.DP;\r\n    b = Big.RM;\r\n    Big.DP = Big.RM = 0;\r\n    x = x.div(y);\r\n    Big.DP = a;\r\n    Big.RM = b;\r\n\r\n    return this.minus(x.times(y));\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big plus the value of Big y.\r\n   */\r\n  P.plus = P.add = function (y) {\r\n    var t,\r\n      x = this,\r\n      Big = x.constructor,\r\n      a = x.s,\r\n      b = (y = new Big(y)).s;\r\n\r\n    // Signs differ?\r\n    if (a != b) {\r\n      y.s = -b;\r\n      return x.minus(y);\r\n    }\r\n\r\n    var xe = x.e,\r\n      xc = x.c,\r\n      ye = y.e,\r\n      yc = y.c;\r\n\r\n    // Either zero? y is non-zero? x is non-zero? Or both are zero.\r\n    if (!xc[0] || !yc[0]) return yc[0] ? y : new Big(xc[0] ? x : a * 0);\r\n\r\n    xc = xc.slice();\r\n\r\n    // Prepend zeros to equalise exponents.\r\n    // Note: Faster to use reverse then do unshifts.\r\n    if (a = xe - ye) {\r\n      if (a > 0) {\r\n        ye = xe;\r\n        t = yc;\r\n      } else {\r\n        a = -a;\r\n        t = xc;\r\n      }\r\n\r\n      t.reverse();\r\n      for (; a--;) t.push(0);\r\n      t.reverse();\r\n    }\r\n\r\n    // Point xc to the longer array.\r\n    if (xc.length - yc.length < 0) {\r\n      t = yc;\r\n      yc = xc;\r\n      xc = t;\r\n    }\r\n\r\n    a = yc.length;\r\n\r\n    // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.\r\n    for (b = 0; a; xc[a] %= 10) b = (xc[--a] = xc[a] + yc[a] + b) / 10 | 0;\r\n\r\n    // No need to check for zero, as +x + +y != 0 && -x + -y != 0\r\n\r\n    if (b) {\r\n      xc.unshift(b);\r\n      ++ye;\r\n    }\r\n\r\n    // Remove trailing zeros.\r\n    for (a = xc.length; xc[--a] === 0;) xc.pop();\r\n\r\n    y.c = xc;\r\n    y.e = ye;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a Big whose value is the value of this Big raised to the power n.\r\n   * If n is negative, round to a maximum of Big.DP decimal places using rounding\r\n   * mode Big.RM.\r\n   *\r\n   * n {number} Integer, -MAX_POWER to MAX_POWER inclusive.\r\n   */\r\n  P.pow = function (n) {\r\n    var x = this,\r\n      one = new x.constructor(1),\r\n      y = one,\r\n      isneg = n < 0;\r\n\r\n    if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) throw Error(INVALID + 'exponent');\r\n    if (isneg) n = -n;\r\n\r\n    for (;;) {\r\n      if (n & 1) y = y.times(x);\r\n      n >>= 1;\r\n      if (!n) break;\r\n      x = x.times(x);\r\n    }\r\n\r\n    return isneg ? one.div(y) : y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal\r\n   * places using rounding mode rm.\r\n   * If dp is not specified, round to 0 decimal places.\r\n   * If rm is not specified, use Big.RM.\r\n   *\r\n   * dp? {number} Integer, 0 to MAX_DP inclusive.\r\n   * rm? 0, 1, 2 or 3 (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_UP)\r\n   */\r\n  P.round = function (dp, rm) {\r\n    var Big = this.constructor;\r\n    if (dp === UNDEFINED) dp = 0;\r\n    else if (dp !== ~~dp || dp < 0 || dp > MAX_DP) throw Error(INVALID_DP);\r\n    return round(new Big(this), dp, rm === UNDEFINED ? Big.RM : rm);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the square root of the value of this Big, rounded, if\r\n   * necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.\r\n   */\r\n  P.sqrt = function () {\r\n    var r, c, t,\r\n      x = this,\r\n      Big = x.constructor,\r\n      s = x.s,\r\n      e = x.e,\r\n      half = new Big(0.5);\r\n\r\n    // Zero?\r\n    if (!x.c[0]) return new Big(x);\r\n\r\n    // Negative?\r\n    if (s < 0) throw Error(NAME + 'No square root');\r\n\r\n    // Estimate.\r\n    s = Math.sqrt(x.toString());\r\n\r\n    // Math.sqrt underflow/overflow?\r\n    // Re-estimate: pass x to Math.sqrt as integer, then adjust the result exponent.\r\n    if (s === 0 || s === 1 / 0) {\r\n      c = x.c.join('');\r\n      if (!(c.length + e & 1)) c += '0';\r\n      r = new Big(Math.sqrt(c).toString());\r\n      r.e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);\r\n    } else {\r\n      r = new Big(s.toString());\r\n    }\r\n\r\n    e = r.e + (Big.DP += 4);\r\n\r\n    // Newton-Raphson iteration.\r\n    do {\r\n      t = r;\r\n      r = half.times(t.plus(x.div(t)));\r\n    } while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));\r\n\r\n    return round(r, Big.DP -= 4, Big.RM);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a new Big whose value is the value of this Big times the value of Big y.\r\n   */\r\n  P.times = P.mul = function (y) {\r\n    var c,\r\n      x = this,\r\n      Big = x.constructor,\r\n      xc = x.c,\r\n      yc = (y = new Big(y)).c,\r\n      a = xc.length,\r\n      b = yc.length,\r\n      i = x.e,\r\n      j = y.e;\r\n\r\n    // Determine sign of result.\r\n    y.s = x.s == y.s ? 1 : -1;\r\n\r\n    // Return signed 0 if either 0.\r\n    if (!xc[0] || !yc[0]) return new Big(y.s * 0);\r\n\r\n    // Initialise exponent of result as x.e + y.e.\r\n    y.e = i + j;\r\n\r\n    // If array xc has fewer digits than yc, swap xc and yc, and lengths.\r\n    if (a < b) {\r\n      c = xc;\r\n      xc = yc;\r\n      yc = c;\r\n      j = a;\r\n      a = b;\r\n      b = j;\r\n    }\r\n\r\n    // Initialise coefficient array of result with zeros.\r\n    for (c = new Array(j = a + b); j--;) c[j] = 0;\r\n\r\n    // Multiply.\r\n\r\n    // i is initially xc.length.\r\n    for (i = b; i--;) {\r\n      b = 0;\r\n\r\n      // a is yc.length.\r\n      for (j = a + i; j > i;) {\r\n\r\n        // Current sum of products at this digit position, plus carry.\r\n        b = c[j] + yc[i] * xc[j - i - 1] + b;\r\n        c[j--] = b % 10;\r\n\r\n        // carry\r\n        b = b / 10 | 0;\r\n      }\r\n\r\n      c[j] = (c[j] + b) % 10;\r\n    }\r\n\r\n    // Increment result exponent if there is a final carry, otherwise remove leading zero.\r\n    if (b) ++y.e;\r\n    else c.shift();\r\n\r\n    // Remove trailing zeros.\r\n    for (i = c.length; !c[--i];) c.pop();\r\n    y.c = c;\r\n\r\n    return y;\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big in exponential notation to dp fixed decimal\r\n   * places and rounded using Big.RM.\r\n   *\r\n   * dp? {number} Integer, 0 to MAX_DP inclusive.\r\n   */\r\n  P.toExponential = function (dp) {\r\n    return stringify(this, 1, dp, dp);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big in normal notation to dp fixed decimal\r\n   * places and rounded using Big.RM.\r\n   *\r\n   * dp? {number} Integer, 0 to MAX_DP inclusive.\r\n   *\r\n   * (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.\r\n   * (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.\r\n   */\r\n  P.toFixed = function (dp) {\r\n    return stringify(this, 2, dp, this.e + dp);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big rounded to sd significant digits using\r\n   * Big.RM. Use exponential notation if sd is less than the number of digits necessary to represent\r\n   * the integer part of the value in normal notation.\r\n   *\r\n   * sd {number} Integer, 1 to MAX_DP inclusive.\r\n   */\r\n  P.toPrecision = function (sd) {\r\n    return stringify(this, 3, sd, sd - 1);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big.\r\n   * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n   * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n   * Omit the sign for negative zero.\r\n   */\r\n  P.toString = function () {\r\n    return stringify(this);\r\n  };\r\n\r\n\r\n  /*\r\n   * Return a string representing the value of this Big.\r\n   * Return exponential notation if this Big has a positive exponent equal to or greater than\r\n   * Big.PE, or a negative exponent equal to or less than Big.NE.\r\n   * Include the sign for negative zero.\r\n   */\r\n  P.valueOf = P.toJSON = function () {\r\n    return stringify(this, 4);\r\n  };\r\n\r\n\r\n  // Export\r\n\r\n\r\n  Big = _Big_();\r\n\r\n  Big['default'] = Big.Big = Big;\r\n\r\n  //AMD.\r\n  if (true) {\r\n    !(__WEBPACK_AMD_DEFINE_RESULT__ = function () { return Big; }.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n\r\n  // Node and other CommonJS-like environments that support module.exports.\r\n  } else if (typeof module !== 'undefined' && module.exports) {\r\n    module.exports = Big;\r\n\r\n  //Browser.\r\n  } else {\r\n    GLOBAL.Big = Big;\r\n  }\r\n})(this);\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/big.js/big.js\n// module id = 226\n// module chunks = 0\n\n//# sourceURL=../node_modules/big.js/big.js")},function(module,exports,__webpack_require__){eval("// Reference https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki\n// Format: 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n// NOTE: SIGHASH byte ignored AND restricted, truncate before use\n\nvar Buffer = __webpack_require__(1).Buffer\n\nfunction check (buffer) {\n  if (buffer.length < 8) return false\n  if (buffer.length > 72) return false\n  if (buffer[0] !== 0x30) return false\n  if (buffer[1] !== buffer.length - 2) return false\n  if (buffer[2] !== 0x02) return false\n\n  var lenR = buffer[3]\n  if (lenR === 0) return false\n  if (5 + lenR >= buffer.length) return false\n  if (buffer[4 + lenR] !== 0x02) return false\n\n  var lenS = buffer[5 + lenR]\n  if (lenS === 0) return false\n  if ((6 + lenR + lenS) !== buffer.length) return false\n\n  if (buffer[4] & 0x80) return false\n  if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) return false\n\n  if (buffer[lenR + 6] & 0x80) return false\n  if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) return false\n  return true\n}\n\nfunction decode (buffer) {\n  if (buffer.length < 8) throw new Error('DER sequence length is too short')\n  if (buffer.length > 72) throw new Error('DER sequence length is too long')\n  if (buffer[0] !== 0x30) throw new Error('Expected DER sequence')\n  if (buffer[1] !== buffer.length - 2) throw new Error('DER sequence length is invalid')\n  if (buffer[2] !== 0x02) throw new Error('Expected DER integer')\n\n  var lenR = buffer[3]\n  if (lenR === 0) throw new Error('R length is zero')\n  if (5 + lenR >= buffer.length) throw new Error('R length is too long')\n  if (buffer[4 + lenR] !== 0x02) throw new Error('Expected DER integer (2)')\n\n  var lenS = buffer[5 + lenR]\n  if (lenS === 0) throw new Error('S length is zero')\n  if ((6 + lenR + lenS) !== buffer.length) throw new Error('S length is invalid')\n\n  if (buffer[4] & 0x80) throw new Error('R value is negative')\n  if (lenR > 1 && (buffer[4] === 0x00) && !(buffer[5] & 0x80)) throw new Error('R value excessively padded')\n\n  if (buffer[lenR + 6] & 0x80) throw new Error('S value is negative')\n  if (lenS > 1 && (buffer[lenR + 6] === 0x00) && !(buffer[lenR + 7] & 0x80)) throw new Error('S value excessively padded')\n\n  // non-BIP66 - extract R, S values\n  return {\n    r: buffer.slice(4, 4 + lenR),\n    s: buffer.slice(6 + lenR)\n  }\n}\n\n/*\n * Expects r and s to be positive DER integers.\n *\n * The DER format uses the most significant bit as a sign bit (& 0x80).\n * If the significant bit is set AND the integer is positive, a 0x00 is prepended.\n *\n * Examples:\n *\n *      0 =>     0x00\n *      1 =>     0x01\n *     -1 =>     0xff\n *    127 =>     0x7f\n *   -127 =>     0x81\n *    128 =>   0x0080\n *   -128 =>     0x80\n *    255 =>   0x00ff\n *   -255 =>   0xff01\n *  16300 =>   0x3fac\n * -16300 =>   0xc054\n *  62300 => 0x00f35c\n * -62300 => 0xff0ca4\n*/\nfunction encode (r, s) {\n  var lenR = r.length\n  var lenS = s.length\n  if (lenR === 0) throw new Error('R length is zero')\n  if (lenS === 0) throw new Error('S length is zero')\n  if (lenR > 33) throw new Error('R length is too long')\n  if (lenS > 33) throw new Error('S length is too long')\n  if (r[0] & 0x80) throw new Error('R value is negative')\n  if (s[0] & 0x80) throw new Error('S value is negative')\n  if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) throw new Error('R value excessively padded')\n  if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) throw new Error('S value excessively padded')\n\n  var signature = Buffer.allocUnsafe(6 + lenR + lenS)\n\n  // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n  signature[0] = 0x30\n  signature[1] = signature.length - 2\n  signature[2] = 0x02\n  signature[3] = r.length\n  r.copy(signature, 4)\n  signature[4 + lenR] = 0x02\n  signature[5 + lenR] = s.length\n  s.copy(signature, 6 + lenR)\n\n  return signature\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bip66/index.js\n// module id = 227\n// module chunks = 0\n\n//# sourceURL=../node_modules/bip66/index.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar bech32 = __webpack_require__(622)\nvar bs58check = __webpack_require__(239)\nvar bscript = __webpack_require__(23)\nvar btemplates = __webpack_require__(231)\nvar networks = __webpack_require__(133)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\n\nfunction fromBase58Check (address) {\n  var payload = bs58check.decode(address)\n\n  // TODO: 4.0.0, move to \"toOutputScript\"\n  if (payload.length < 21) throw new TypeError(address + ' is too short')\n  if (payload.length > 21) throw new TypeError(address + ' is too long')\n\n  var version = payload.readUInt8(0)\n  var hash = payload.slice(1)\n\n  return { version: version, hash: hash }\n}\n\nfunction fromBech32 (address) {\n  var result = bech32.decode(address)\n  var data = bech32.fromWords(result.words.slice(1))\n\n  return {\n    version: result.words[0],\n    prefix: result.prefix,\n    data: Buffer.from(data)\n  }\n}\n\nfunction toBase58Check (hash, version) {\n  typeforce(types.tuple(types.Hash160bit, types.UInt8), arguments)\n\n  var payload = Buffer.allocUnsafe(21)\n  payload.writeUInt8(version, 0)\n  hash.copy(payload, 1)\n\n  return bs58check.encode(payload)\n}\n\nfunction toBech32 (data, version, prefix) {\n  var words = bech32.toWords(data)\n  words.unshift(version)\n\n  return bech32.encode(prefix, words)\n}\n\nfunction fromOutputScript (outputScript, network) {\n  network = network || networks.bitcoin\n\n  if (btemplates.pubKeyHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(3, 23), network.pubKeyHash)\n  if (btemplates.scriptHash.output.check(outputScript)) return toBase58Check(bscript.compile(outputScript).slice(2, 22), network.scriptHash)\n  if (btemplates.witnessPubKeyHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 22), 0, network.bech32)\n  if (btemplates.witnessScriptHash.output.check(outputScript)) return toBech32(bscript.compile(outputScript).slice(2, 34), 0, network.bech32)\n\n  throw new Error(bscript.toASM(outputScript) + ' has no matching Address')\n}\n\nfunction toOutputScript (address, network) {\n  network = network || networks.bitcoin\n\n  var decode\n  try {\n    decode = fromBase58Check(address)\n  } catch (e) {}\n\n  if (decode) {\n    if (decode.version === network.pubKeyHash) return btemplates.pubKeyHash.output.encode(decode.hash)\n    if (decode.version === network.scriptHash) return btemplates.scriptHash.output.encode(decode.hash)\n  } else {\n    try {\n      decode = fromBech32(address)\n    } catch (e) {}\n\n    if (decode) {\n      if (decode.prefix !== network.bech32) throw new Error(address + ' has an invalid prefix')\n      if (decode.version === 0) {\n        if (decode.data.length === 20) return btemplates.witnessPubKeyHash.output.encode(decode.data)\n        if (decode.data.length === 32) return btemplates.witnessScriptHash.output.encode(decode.data)\n      }\n    }\n  }\n\n  throw new Error(address + ' has no matching Script')\n}\n\nmodule.exports = {\n  fromBase58Check: fromBase58Check,\n  fromBech32: fromBech32,\n  fromOutputScript: fromOutputScript,\n  toBase58Check: toBase58Check,\n  toBech32: toBech32,\n  toOutputScript: toOutputScript\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/address.js\n// module id = 228\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/address.js")},function(module,exports,__webpack_require__){eval("var baddress = __webpack_require__(228)\nvar bcrypto = __webpack_require__(114)\nvar ecdsa = __webpack_require__(627)\nvar randomBytes = __webpack_require__(80)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar wif = __webpack_require__(1305)\n\nvar NETWORKS = __webpack_require__(133)\nvar BigInteger = __webpack_require__(88)\n\nvar ecurve = __webpack_require__(257)\nvar secp256k1 = ecdsa.__curve\n\nfunction ECPair (d, Q, options) {\n  if (options) {\n    typeforce({\n      compressed: types.maybe(types.Boolean),\n      network: types.maybe(types.Network)\n    }, options)\n  }\n\n  options = options || {}\n\n  if (d) {\n    if (d.signum() <= 0) throw new Error('Private key must be greater than 0')\n    if (d.compareTo(secp256k1.n) >= 0) throw new Error('Private key must be less than the curve order')\n    if (Q) throw new TypeError('Unexpected publicKey parameter')\n\n    this.d = d\n  } else {\n    typeforce(types.ECPoint, Q)\n\n    this.__Q = Q\n  }\n\n  this.compressed = options.compressed === undefined ? true : options.compressed\n  this.network = options.network || NETWORKS.bitcoin\n}\n\nObject.defineProperty(ECPair.prototype, 'Q', {\n  get: function () {\n    if (!this.__Q && this.d) {\n      this.__Q = secp256k1.G.multiply(this.d)\n    }\n\n    return this.__Q\n  }\n})\n\nECPair.fromPublicKeyBuffer = function (buffer, network) {\n  var Q = ecurve.Point.decodeFrom(secp256k1, buffer)\n\n  return new ECPair(null, Q, {\n    compressed: Q.compressed,\n    network: network\n  })\n}\n\nECPair.fromWIF = function (string, network) {\n  var decoded = wif.decode(string)\n  var version = decoded.version\n\n  // list of networks?\n  if (types.Array(network)) {\n    network = network.filter(function (x) {\n      return version === x.wif\n    }).pop()\n\n    if (!network) throw new Error('Unknown network version')\n\n  // otherwise, assume a network object (or default to bitcoin)\n  } else {\n    network = network || NETWORKS.bitcoin\n\n    if (version !== network.wif) throw new Error('Invalid network version')\n  }\n\n  var d = BigInteger.fromBuffer(decoded.privateKey)\n\n  return new ECPair(d, null, {\n    compressed: decoded.compressed,\n    network: network\n  })\n}\n\nECPair.makeRandom = function (options) {\n  options = options || {}\n\n  var rng = options.rng || randomBytes\n\n  var d\n  do {\n    var buffer = rng(32)\n    typeforce(types.Buffer256bit, buffer)\n\n    d = BigInteger.fromBuffer(buffer)\n  } while (d.signum() <= 0 || d.compareTo(secp256k1.n) >= 0)\n\n  return new ECPair(d, null, options)\n}\n\nECPair.prototype.getAddress = function () {\n  return baddress.toBase58Check(bcrypto.hash160(this.getPublicKeyBuffer()), this.getNetwork().pubKeyHash)\n}\n\nECPair.prototype.getNetwork = function () {\n  return this.network\n}\n\nECPair.prototype.getPublicKeyBuffer = function () {\n  return this.Q.getEncoded(this.compressed)\n}\n\nECPair.prototype.sign = function (hash) {\n  if (!this.d) throw new Error('Missing private key')\n\n  return ecdsa.sign(hash, this.d)\n}\n\nECPair.prototype.toWIF = function () {\n  if (!this.d) throw new Error('Missing private key')\n\n  return wif.encode(this.network.wif, this.d.toBuffer(32), this.compressed)\n}\n\nECPair.prototype.verify = function (hash, signature) {\n  return ecdsa.verify(hash, signature, this.Q)\n}\n\nmodule.exports = ECPair\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/ecpair.js\n// module id = 229\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/ecpair.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bip66 = __webpack_require__(227)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\n\nvar BigInteger = __webpack_require__(88)\n\nfunction ECSignature (r, s) {\n  typeforce(types.tuple(types.BigInt, types.BigInt), arguments)\n\n  this.r = r\n  this.s = s\n}\n\nECSignature.parseCompact = function (buffer) {\n  typeforce(types.BufferN(65), buffer)\n\n  var flagByte = buffer.readUInt8(0) - 27\n  if (flagByte !== (flagByte & 7)) throw new Error('Invalid signature parameter')\n\n  var compressed = !!(flagByte & 4)\n  var recoveryParam = flagByte & 3\n  var signature = ECSignature.fromRSBuffer(buffer.slice(1))\n\n  return {\n    compressed: compressed,\n    i: recoveryParam,\n    signature: signature\n  }\n}\n\nECSignature.fromRSBuffer = function (buffer) {\n  typeforce(types.BufferN(64), buffer)\n\n  var r = BigInteger.fromBuffer(buffer.slice(0, 32))\n  var s = BigInteger.fromBuffer(buffer.slice(32, 64))\n  return new ECSignature(r, s)\n}\n\nECSignature.fromDER = function (buffer) {\n  var decode = bip66.decode(buffer)\n  var r = BigInteger.fromDERInteger(decode.r)\n  var s = BigInteger.fromDERInteger(decode.s)\n\n  return new ECSignature(r, s)\n}\n\n// BIP62: 1 byte hashType flag (only 0x01, 0x02, 0x03, 0x81, 0x82 and 0x83 are allowed)\nECSignature.parseScriptSignature = function (buffer) {\n  var hashType = buffer.readUInt8(buffer.length - 1)\n  var hashTypeMod = hashType & ~0x80\n\n  if (hashTypeMod <= 0x00 || hashTypeMod >= 0x04) throw new Error('Invalid hashType ' + hashType)\n\n  return {\n    signature: ECSignature.fromDER(buffer.slice(0, -1)),\n    hashType: hashType\n  }\n}\n\nECSignature.prototype.toCompact = function (i, compressed) {\n  if (compressed) {\n    i += 4\n  }\n\n  i += 27\n\n  var buffer = Buffer.alloc(65)\n  buffer.writeUInt8(i, 0)\n  this.toRSBuffer(buffer, 1)\n  return buffer\n}\n\nECSignature.prototype.toDER = function () {\n  var r = Buffer.from(this.r.toDERInteger())\n  var s = Buffer.from(this.s.toDERInteger())\n\n  return bip66.encode(r, s)\n}\n\nECSignature.prototype.toRSBuffer = function (buffer, offset) {\n  buffer = buffer || Buffer.alloc(64)\n  this.r.toBuffer(32).copy(buffer, offset)\n  this.s.toBuffer(32).copy(buffer, offset + 32)\n  return buffer\n}\n\nECSignature.prototype.toScriptSignature = function (hashType) {\n  var hashTypeMod = hashType & ~0x80\n  if (hashTypeMod <= 0 || hashTypeMod >= 4) throw new Error('Invalid hashType ' + hashType)\n\n  var hashTypeBuffer = Buffer.alloc(1)\n  hashTypeBuffer.writeUInt8(hashType, 0)\n\n  return Buffer.concat([this.toDER(), hashTypeBuffer])\n}\n\nmodule.exports = ECSignature\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/ecsignature.js\n// module id = 230\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/ecsignature.js")},function(module,exports,__webpack_require__){eval("var decompile = __webpack_require__(23).decompile\nvar multisig = __webpack_require__(232)\nvar nullData = __webpack_require__(631)\nvar pubKey = __webpack_require__(233)\nvar pubKeyHash = __webpack_require__(234)\nvar scriptHash = __webpack_require__(636)\nvar witnessPubKeyHash = __webpack_require__(641)\nvar witnessScriptHash = __webpack_require__(643)\nvar witnessCommitment = __webpack_require__(639)\n\nvar types = {\n  MULTISIG: 'multisig',\n  NONSTANDARD: 'nonstandard',\n  NULLDATA: 'nulldata',\n  P2PK: 'pubkey',\n  P2PKH: 'pubkeyhash',\n  P2SH: 'scripthash',\n  P2WPKH: 'witnesspubkeyhash',\n  P2WSH: 'witnessscripthash',\n  WITNESS_COMMITMENT: 'witnesscommitment'\n}\n\nfunction classifyOutput (script) {\n  if (witnessPubKeyHash.output.check(script)) return types.P2WPKH\n  if (witnessScriptHash.output.check(script)) return types.P2WSH\n  if (pubKeyHash.output.check(script)) return types.P2PKH\n  if (scriptHash.output.check(script)) return types.P2SH\n\n  // XXX: optimization, below functions .decompile before use\n  var chunks = decompile(script)\n  if (multisig.output.check(chunks)) return types.MULTISIG\n  if (pubKey.output.check(chunks)) return types.P2PK\n  if (witnessCommitment.output.check(chunks)) return types.WITNESS_COMMITMENT\n  if (nullData.output.check(chunks)) return types.NULLDATA\n\n  return types.NONSTANDARD\n}\n\nfunction classifyInput (script, allowIncomplete) {\n  // XXX: optimization, below functions .decompile before use\n  var chunks = decompile(script)\n\n  if (pubKeyHash.input.check(chunks)) return types.P2PKH\n  if (scriptHash.input.check(chunks, allowIncomplete)) return types.P2SH\n  if (multisig.input.check(chunks, allowIncomplete)) return types.MULTISIG\n  if (pubKey.input.check(chunks)) return types.P2PK\n\n  return types.NONSTANDARD\n}\n\nfunction classifyWitness (script, allowIncomplete) {\n  // XXX: optimization, below functions .decompile before use\n  var chunks = decompile(script)\n\n  if (witnessPubKeyHash.input.check(chunks)) return types.P2WPKH\n  if (witnessScriptHash.input.check(chunks, allowIncomplete)) return types.P2WSH\n\n  return types.NONSTANDARD\n}\n\nmodule.exports = {\n  classifyInput: classifyInput,\n  classifyOutput: classifyOutput,\n  classifyWitness: classifyWitness,\n  multisig: multisig,\n  nullData: nullData,\n  pubKey: pubKey,\n  pubKeyHash: pubKeyHash,\n  scriptHash: scriptHash,\n  witnessPubKeyHash: witnessPubKeyHash,\n  witnessScriptHash: witnessScriptHash,\n  witnessCommitment: witnessCommitment,\n  types: types\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/index.js\n// module id = 231\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/index.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(630),\n  output: __webpack_require__(343)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/multisig/index.js\n// module id = 232\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/multisig/index.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(632),\n  output: __webpack_require__(633)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkey/index.js\n// module id = 233\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkey/index.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(634),\n  output: __webpack_require__(635)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkeyhash/index.js\n// module id = 234\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkeyhash/index.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar bcrypto = __webpack_require__(114)\nvar bscript = __webpack_require__(23)\nvar bufferutils = __webpack_require__(341)\nvar opcodes = __webpack_require__(33)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar varuint = __webpack_require__(313)\n\nfunction varSliceSize (someScript) {\n  var length = someScript.length\n\n  return varuint.encodingLength(length) + length\n}\n\nfunction vectorSize (someVector) {\n  var length = someVector.length\n\n  return varuint.encodingLength(length) + someVector.reduce(function (sum, witness) {\n    return sum + varSliceSize(witness)\n  }, 0)\n}\n\nfunction Transaction () {\n  this.version = 1\n  this.locktime = 0\n  this.ins = []\n  this.outs = []\n}\n\nTransaction.DEFAULT_SEQUENCE = 0xffffffff\nTransaction.SIGHASH_ALL = 0x01\nTransaction.SIGHASH_NONE = 0x02\nTransaction.SIGHASH_SINGLE = 0x03\nTransaction.SIGHASH_ANYONECANPAY = 0x80\nTransaction.ADVANCED_TRANSACTION_MARKER = 0x00\nTransaction.ADVANCED_TRANSACTION_FLAG = 0x01\n\nvar EMPTY_SCRIPT = Buffer.allocUnsafe(0)\nvar EMPTY_WITNESS = []\nvar ZERO = Buffer.from('0000000000000000000000000000000000000000000000000000000000000000', 'hex')\nvar ONE = Buffer.from('0000000000000000000000000000000000000000000000000000000000000001', 'hex')\nvar VALUE_UINT64_MAX = Buffer.from('ffffffffffffffff', 'hex')\nvar BLANK_OUTPUT = {\n  script: EMPTY_SCRIPT,\n  valueBuffer: VALUE_UINT64_MAX\n}\n\nTransaction.fromBuffer = function (buffer, __noStrict) {\n  var offset = 0\n  function readSlice (n) {\n    offset += n\n    return buffer.slice(offset - n, offset)\n  }\n\n  function readUInt32 () {\n    var i = buffer.readUInt32LE(offset)\n    offset += 4\n    return i\n  }\n\n  function readInt32 () {\n    var i = buffer.readInt32LE(offset)\n    offset += 4\n    return i\n  }\n\n  function readUInt64 () {\n    var i = bufferutils.readUInt64LE(buffer, offset)\n    offset += 8\n    return i\n  }\n\n  function readVarInt () {\n    var vi = varuint.decode(buffer, offset)\n    offset += varuint.decode.bytes\n    return vi\n  }\n\n  function readVarSlice () {\n    return readSlice(readVarInt())\n  }\n\n  function readVector () {\n    var count = readVarInt()\n    var vector = []\n    for (var i = 0; i < count; i++) vector.push(readVarSlice())\n    return vector\n  }\n\n  var tx = new Transaction()\n  tx.version = readInt32()\n\n  var marker = buffer.readUInt8(offset)\n  var flag = buffer.readUInt8(offset + 1)\n\n  var hasWitnesses = false\n  if (marker === Transaction.ADVANCED_TRANSACTION_MARKER &&\n      flag === Transaction.ADVANCED_TRANSACTION_FLAG) {\n    offset += 2\n    hasWitnesses = true\n  }\n\n  var vinLen = readVarInt()\n  for (var i = 0; i < vinLen; ++i) {\n    tx.ins.push({\n      hash: readSlice(32),\n      index: readUInt32(),\n      script: readVarSlice(),\n      sequence: readUInt32(),\n      witness: EMPTY_WITNESS\n    })\n  }\n\n  var voutLen = readVarInt()\n  for (i = 0; i < voutLen; ++i) {\n    tx.outs.push({\n      value: readUInt64(),\n      script: readVarSlice()\n    })\n  }\n\n  if (hasWitnesses) {\n    for (i = 0; i < vinLen; ++i) {\n      tx.ins[i].witness = readVector()\n    }\n\n    // was this pointless?\n    if (!tx.hasWitnesses()) throw new Error('Transaction has superfluous witness data')\n  }\n\n  tx.locktime = readUInt32()\n\n  if (__noStrict) return tx\n  if (offset !== buffer.length) throw new Error('Transaction has unexpected data')\n\n  return tx\n}\n\nTransaction.fromHex = function (hex) {\n  return Transaction.fromBuffer(Buffer.from(hex, 'hex'))\n}\n\nTransaction.isCoinbaseHash = function (buffer) {\n  typeforce(types.Hash256bit, buffer)\n  for (var i = 0; i < 32; ++i) {\n    if (buffer[i] !== 0) return false\n  }\n  return true\n}\n\nTransaction.prototype.isCoinbase = function () {\n  return this.ins.length === 1 && Transaction.isCoinbaseHash(this.ins[0].hash)\n}\n\nTransaction.prototype.addInput = function (hash, index, sequence, scriptSig) {\n  typeforce(types.tuple(\n    types.Hash256bit,\n    types.UInt32,\n    types.maybe(types.UInt32),\n    types.maybe(types.Buffer)\n  ), arguments)\n\n  if (types.Null(sequence)) {\n    sequence = Transaction.DEFAULT_SEQUENCE\n  }\n\n  // Add the input and return the input's index\n  return (this.ins.push({\n    hash: hash,\n    index: index,\n    script: scriptSig || EMPTY_SCRIPT,\n    sequence: sequence,\n    witness: EMPTY_WITNESS\n  }) - 1)\n}\n\nTransaction.prototype.addOutput = function (scriptPubKey, value) {\n  typeforce(types.tuple(types.Buffer, types.Satoshi), arguments)\n\n  // Add the output and return the output's index\n  return (this.outs.push({\n    script: scriptPubKey,\n    value: value\n  }) - 1)\n}\n\nTransaction.prototype.hasWitnesses = function () {\n  return this.ins.some(function (x) {\n    return x.witness.length !== 0\n  })\n}\n\nTransaction.prototype.weight = function () {\n  var base = this.__byteLength(false)\n  var total = this.__byteLength(true)\n  return base * 3 + total\n}\n\nTransaction.prototype.virtualSize = function () {\n  return Math.ceil(this.weight() / 4)\n}\n\nTransaction.prototype.byteLength = function () {\n  return this.__byteLength(true)\n}\n\nTransaction.prototype.__byteLength = function (__allowWitness) {\n  var hasWitnesses = __allowWitness && this.hasWitnesses()\n\n  return (\n    (hasWitnesses ? 10 : 8) +\n    varuint.encodingLength(this.ins.length) +\n    varuint.encodingLength(this.outs.length) +\n    this.ins.reduce(function (sum, input) { return sum + 40 + varSliceSize(input.script) }, 0) +\n    this.outs.reduce(function (sum, output) { return sum + 8 + varSliceSize(output.script) }, 0) +\n    (hasWitnesses ? this.ins.reduce(function (sum, input) { return sum + vectorSize(input.witness) }, 0) : 0)\n  )\n}\n\nTransaction.prototype.clone = function () {\n  var newTx = new Transaction()\n  newTx.version = this.version\n  newTx.locktime = this.locktime\n\n  newTx.ins = this.ins.map(function (txIn) {\n    return {\n      hash: txIn.hash,\n      index: txIn.index,\n      script: txIn.script,\n      sequence: txIn.sequence,\n      witness: txIn.witness\n    }\n  })\n\n  newTx.outs = this.outs.map(function (txOut) {\n    return {\n      script: txOut.script,\n      value: txOut.value\n    }\n  })\n\n  return newTx\n}\n\n/**\n * Hash transaction for signing a specific input.\n *\n * Bitcoin uses a different hash for each signed transaction input.\n * This method copies the transaction, makes the necessary changes based on the\n * hashType, and then hashes the result.\n * This hash can then be used to sign the provided transaction input.\n */\nTransaction.prototype.hashForSignature = function (inIndex, prevOutScript, hashType) {\n  typeforce(types.tuple(types.UInt32, types.Buffer, /* types.UInt8 */ types.Number), arguments)\n\n  // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L29\n  if (inIndex >= this.ins.length) return ONE\n\n  // ignore OP_CODESEPARATOR\n  var ourScript = bscript.compile(bscript.decompile(prevOutScript).filter(function (x) {\n    return x !== opcodes.OP_CODESEPARATOR\n  }))\n\n  var txTmp = this.clone()\n\n  // SIGHASH_NONE: ignore all outputs? (wildcard payee)\n  if ((hashType & 0x1f) === Transaction.SIGHASH_NONE) {\n    txTmp.outs = []\n\n    // ignore sequence numbers (except at inIndex)\n    txTmp.ins.forEach(function (input, i) {\n      if (i === inIndex) return\n\n      input.sequence = 0\n    })\n\n  // SIGHASH_SINGLE: ignore all outputs, except at the same index?\n  } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE) {\n    // https://github.com/bitcoin/bitcoin/blob/master/src/test/sighash_tests.cpp#L60\n    if (inIndex >= this.outs.length) return ONE\n\n    // truncate outputs after\n    txTmp.outs.length = inIndex + 1\n\n    // \"blank\" outputs before\n    for (var i = 0; i < inIndex; i++) {\n      txTmp.outs[i] = BLANK_OUTPUT\n    }\n\n    // ignore sequence numbers (except at inIndex)\n    txTmp.ins.forEach(function (input, y) {\n      if (y === inIndex) return\n\n      input.sequence = 0\n    })\n  }\n\n  // SIGHASH_ANYONECANPAY: ignore inputs entirely?\n  if (hashType & Transaction.SIGHASH_ANYONECANPAY) {\n    txTmp.ins = [txTmp.ins[inIndex]]\n    txTmp.ins[0].script = ourScript\n\n  // SIGHASH_ALL: only ignore input scripts\n  } else {\n    // \"blank\" others input scripts\n    txTmp.ins.forEach(function (input) { input.script = EMPTY_SCRIPT })\n    txTmp.ins[inIndex].script = ourScript\n  }\n\n  // serialize and hash\n  var buffer = Buffer.allocUnsafe(txTmp.__byteLength(false) + 4)\n  buffer.writeInt32LE(hashType, buffer.length - 4)\n  txTmp.__toBuffer(buffer, 0, false)\n\n  return bcrypto.hash256(buffer)\n}\n\nTransaction.prototype.hashForWitnessV0 = function (inIndex, prevOutScript, value, hashType) {\n  typeforce(types.tuple(types.UInt32, types.Buffer, types.Satoshi, types.UInt32), arguments)\n\n  var tbuffer, toffset\n  function writeSlice (slice) { toffset += slice.copy(tbuffer, toffset) }\n  function writeUInt32 (i) { toffset = tbuffer.writeUInt32LE(i, toffset) }\n  function writeUInt64 (i) { toffset = bufferutils.writeUInt64LE(tbuffer, i, toffset) }\n  function writeVarInt (i) {\n    varuint.encode(i, tbuffer, toffset)\n    toffset += varuint.encode.bytes\n  }\n  function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }\n\n  var hashOutputs = ZERO\n  var hashPrevouts = ZERO\n  var hashSequence = ZERO\n\n  if (!(hashType & Transaction.SIGHASH_ANYONECANPAY)) {\n    tbuffer = Buffer.allocUnsafe(36 * this.ins.length)\n    toffset = 0\n\n    this.ins.forEach(function (txIn) {\n      writeSlice(txIn.hash)\n      writeUInt32(txIn.index)\n    })\n\n    hashPrevouts = bcrypto.hash256(tbuffer)\n  }\n\n  if (!(hashType & Transaction.SIGHASH_ANYONECANPAY) &&\n       (hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&\n       (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {\n    tbuffer = Buffer.allocUnsafe(4 * this.ins.length)\n    toffset = 0\n\n    this.ins.forEach(function (txIn) {\n      writeUInt32(txIn.sequence)\n    })\n\n    hashSequence = bcrypto.hash256(tbuffer)\n  }\n\n  if ((hashType & 0x1f) !== Transaction.SIGHASH_SINGLE &&\n      (hashType & 0x1f) !== Transaction.SIGHASH_NONE) {\n    var txOutsSize = this.outs.reduce(function (sum, output) {\n      return sum + 8 + varSliceSize(output.script)\n    }, 0)\n\n    tbuffer = Buffer.allocUnsafe(txOutsSize)\n    toffset = 0\n\n    this.outs.forEach(function (out) {\n      writeUInt64(out.value)\n      writeVarSlice(out.script)\n    })\n\n    hashOutputs = bcrypto.hash256(tbuffer)\n  } else if ((hashType & 0x1f) === Transaction.SIGHASH_SINGLE && inIndex < this.outs.length) {\n    var output = this.outs[inIndex]\n\n    tbuffer = Buffer.allocUnsafe(8 + varSliceSize(output.script))\n    toffset = 0\n    writeUInt64(output.value)\n    writeVarSlice(output.script)\n\n    hashOutputs = bcrypto.hash256(tbuffer)\n  }\n\n  tbuffer = Buffer.allocUnsafe(156 + varSliceSize(prevOutScript))\n  toffset = 0\n\n  var input = this.ins[inIndex]\n  writeUInt32(this.version)\n  writeSlice(hashPrevouts)\n  writeSlice(hashSequence)\n  writeSlice(input.hash)\n  writeUInt32(input.index)\n  writeVarSlice(prevOutScript)\n  writeUInt64(value)\n  writeUInt32(input.sequence)\n  writeSlice(hashOutputs)\n  writeUInt32(this.locktime)\n  writeUInt32(hashType)\n  return bcrypto.hash256(tbuffer)\n}\n\nTransaction.prototype.getHash = function () {\n  return bcrypto.hash256(this.__toBuffer(undefined, undefined, false))\n}\n\nTransaction.prototype.getId = function () {\n  // transaction hash's are displayed in reverse order\n  return this.getHash().reverse().toString('hex')\n}\n\nTransaction.prototype.toBuffer = function (buffer, initialOffset) {\n  return this.__toBuffer(buffer, initialOffset, true)\n}\n\nTransaction.prototype.__toBuffer = function (buffer, initialOffset, __allowWitness) {\n  if (!buffer) buffer = Buffer.allocUnsafe(this.__byteLength(__allowWitness))\n\n  var offset = initialOffset || 0\n  function writeSlice (slice) { offset += slice.copy(buffer, offset) }\n  function writeUInt8 (i) { offset = buffer.writeUInt8(i, offset) }\n  function writeUInt32 (i) { offset = buffer.writeUInt32LE(i, offset) }\n  function writeInt32 (i) { offset = buffer.writeInt32LE(i, offset) }\n  function writeUInt64 (i) { offset = bufferutils.writeUInt64LE(buffer, i, offset) }\n  function writeVarInt (i) {\n    varuint.encode(i, buffer, offset)\n    offset += varuint.encode.bytes\n  }\n  function writeVarSlice (slice) { writeVarInt(slice.length); writeSlice(slice) }\n  function writeVector (vector) { writeVarInt(vector.length); vector.forEach(writeVarSlice) }\n\n  writeInt32(this.version)\n\n  var hasWitnesses = __allowWitness && this.hasWitnesses()\n\n  if (hasWitnesses) {\n    writeUInt8(Transaction.ADVANCED_TRANSACTION_MARKER)\n    writeUInt8(Transaction.ADVANCED_TRANSACTION_FLAG)\n  }\n\n  writeVarInt(this.ins.length)\n\n  this.ins.forEach(function (txIn) {\n    writeSlice(txIn.hash)\n    writeUInt32(txIn.index)\n    writeVarSlice(txIn.script)\n    writeUInt32(txIn.sequence)\n  })\n\n  writeVarInt(this.outs.length)\n  this.outs.forEach(function (txOut) {\n    if (!txOut.valueBuffer) {\n      writeUInt64(txOut.value)\n    } else {\n      writeSlice(txOut.valueBuffer)\n    }\n\n    writeVarSlice(txOut.script)\n  })\n\n  if (hasWitnesses) {\n    this.ins.forEach(function (input) {\n      writeVector(input.witness)\n    })\n  }\n\n  writeUInt32(this.locktime)\n\n  // avoid slicing unless necessary\n  if (initialOffset !== undefined) return buffer.slice(initialOffset, offset)\n  return buffer\n}\n\nTransaction.prototype.toHex = function () {\n  return this.toBuffer().toString('hex')\n}\n\nTransaction.prototype.setInputScript = function (index, scriptSig) {\n  typeforce(types.tuple(types.Number, types.Buffer), arguments)\n\n  this.ins[index].script = scriptSig\n}\n\nTransaction.prototype.setWitness = function (index, witness) {\n  typeforce(types.tuple(types.Number, [types.Buffer]), arguments)\n\n  this.ins[index].witness = witness\n}\n\nmodule.exports = Transaction\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/transaction.js\n// module id = 235\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/transaction.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Bignumber = __webpack_require__(165)\n\nconst constants = __webpack_require__(166)\nconst SHIFT32 = constants.SHIFT32\nconst SHIFT16 = constants.SHIFT16\nconst MAX_SAFE_HIGH = 0x1fffff\n\nexports.parseHalf = function parseHalf (buf) {\n  var exp, mant, sign\n  sign = buf[0] & 0x80 ? -1 : 1\n  exp = (buf[0] & 0x7C) >> 2\n  mant = ((buf[0] & 0x03) << 8) | buf[1]\n  if (!exp) {\n    return sign * 5.9604644775390625e-8 * mant\n  } else if (exp === 0x1f) {\n    return sign * (mant ? 0 / 0 : 2e308)\n  } else {\n    return sign * Math.pow(2, exp - 25) * (1024 + mant)\n  }\n}\n\nfunction toHex (n) {\n  if (n < 16) {\n    return '0' + n.toString(16)\n  }\n\n  return n.toString(16)\n}\n\nexports.arrayBufferToBignumber = function (buf) {\n  const len = buf.byteLength\n  let res = ''\n  for (let i = 0; i < len; i++) {\n    res += toHex(buf[i])\n  }\n\n  return new Bignumber(res, 16)\n}\n\n// convert an Object into a Map\nexports.buildMap = (obj) => {\n  const res = new Map()\n  const keys = Object.keys(obj)\n  const length = keys.length\n  for (let i = 0; i < length; i++) {\n    res.set(keys[i], obj[keys[i]])\n  }\n  return res\n}\n\nexports.buildInt32 = (f, g) => {\n  return f * SHIFT16 + g\n}\n\nexports.buildInt64 = (f1, f2, g1, g2) => {\n  const f = exports.buildInt32(f1, f2)\n  const g = exports.buildInt32(g1, g2)\n\n  if (f > MAX_SAFE_HIGH) {\n    return new Bignumber(f).times(SHIFT32).plus(g)\n  } else {\n    return (f * SHIFT32) + g\n  }\n}\n\nexports.writeHalf = function writeHalf (buf, half) {\n  // assume 0, -0, NaN, Infinity, and -Infinity have already been caught\n\n  // HACK: everyone settle in.  This isn't going to be pretty.\n  // Translate cn-cbor's C code (from Carsten Borman):\n\n  // uint32_t be32;\n  // uint16_t be16, u16;\n  // union {\n  //   float f;\n  //   uint32_t u;\n  // } u32;\n  // u32.f = float_val;\n\n  const u32 = Buffer.allocUnsafe(4)\n  u32.writeFloatBE(half, 0)\n  const u = u32.readUInt32BE(0)\n\n  // if ((u32.u & 0x1FFF) == 0) { /* worth trying half */\n\n  // hildjj: If the lower 13 bits are 0, we won't lose anything in the conversion\n  if ((u & 0x1FFF) !== 0) {\n    return false\n  }\n\n  //   int s16 = (u32.u >> 16) & 0x8000;\n  //   int exp = (u32.u >> 23) & 0xff;\n  //   int mant = u32.u & 0x7fffff;\n\n  var s16 = (u >> 16) & 0x8000 // top bit is sign\n  const exp = (u >> 23) & 0xff // then 5 bits of exponent\n  const mant = u & 0x7fffff\n\n  //   if (exp == 0 && mant == 0)\n  //     ;              /* 0.0, -0.0 */\n\n  // hildjj: zeros already handled.  Assert if you don't believe me.\n\n  //   else if (exp >= 113 && exp <= 142) /* normalized */\n  //     s16 += ((exp - 112) << 10) + (mant >> 13);\n  if ((exp >= 113) && (exp <= 142)) {\n    s16 += ((exp - 112) << 10) + (mant >> 13)\n\n  //   else if (exp >= 103 && exp < 113) { /* denorm, exp16 = 0 */\n  //     if (mant & ((1 << (126 - exp)) - 1))\n  //       goto float32;         /* loss of precision */\n  //     s16 += ((mant + 0x800000) >> (126 - exp));\n  } else if ((exp >= 103) && (exp < 113)) {\n    if (mant & ((1 << (126 - exp)) - 1)) {\n      return false\n    }\n    s16 += ((mant + 0x800000) >> (126 - exp))\n\n  //   } else if (exp == 255 && mant == 0) { /* Inf */\n  //     s16 += 0x7c00;\n\n  // hildjj: Infinity already handled\n\n  //   } else\n  //     goto float32;           /* loss of range */\n  } else {\n    return false\n  }\n\n  //   ensure_writable(3);\n  //   u16 = s16;\n  //   be16 = hton16p((const uint8_t*)&u16);\n  buf.writeUInt16BE(s16, 0)\n  return true\n}\n\nexports.keySorter = function (a, b) {\n  var lenA = a[0].byteLength\n  var lenB = b[0].byteLength\n\n  if (lenA > lenB) {\n    return 1\n  }\n\n  if (lenB > lenA) {\n    return -1\n  }\n\n  return a[0].compare(b[0])\n}\n\n// Adapted from http://www.2ality.com/2012/03/signedzero.html\nexports.isNegativeZero = (x) => {\n  return x === 0 && (1 / x < 0)\n}\n\nexports.nextPowerOf2 = (n) => {\n  let count = 0\n  // First n in the below condition is for\n  // the case where n is 0\n  if (n && !(n & (n - 1))) {\n    return n\n  }\n\n  while (n !== 0) {\n    n >>= 1\n    count += 1\n  }\n\n  return 1 << count\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/utils.js\n// module id = 236\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/utils.js")},function(module,exports,__webpack_require__){eval("var modeModules = {\n  ECB: __webpack_require__(661),\n  CBC: __webpack_require__(657),\n  CFB: __webpack_require__(658),\n  CFB8: __webpack_require__(660),\n  CFB1: __webpack_require__(659),\n  OFB: __webpack_require__(662),\n  CTR: __webpack_require__(353),\n  GCM: __webpack_require__(353)\n}\n\nvar modes = __webpack_require__(354)\n\nfor (var key in modes) {\n  modes[key].module = modeModules[modes[key].mode]\n}\n\nmodule.exports = modes\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/index.js\n// module id = 237\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(17);\nvar randomBytes = __webpack_require__(80);\nmodule.exports = crt;\nfunction blind(priv) {\n  var r = getr(priv);\n  var blinder = r.toRed(bn.mont(priv.modulus))\n  .redPow(new bn(priv.publicExponent)).fromRed();\n  return {\n    blinder: blinder,\n    unblinder:r.invm(priv.modulus)\n  };\n}\nfunction crt(msg, priv) {\n  var blinds = blind(priv);\n  var len = priv.modulus.byteLength();\n  var mod = bn.mont(priv.modulus);\n  var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);\n  var c1 = blinded.toRed(bn.mont(priv.prime1));\n  var c2 = blinded.toRed(bn.mont(priv.prime2));\n  var qinv = priv.coefficient;\n  var p = priv.prime1;\n  var q = priv.prime2;\n  var m1 = c1.redPow(priv.exponent1);\n  var m2 = c2.redPow(priv.exponent2);\n  m1 = m1.fromRed();\n  m2 = m2.fromRed();\n  var h = m1.isub(m2).imul(qinv).umod(p);\n  h.imul(q);\n  m2.iadd(h);\n  return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));\n}\ncrt.getr = getr;\nfunction getr(priv) {\n  var len = priv.modulus.byteLength();\n  var r = new bn(randomBytes(len));\n  while (r.cmp(priv.modulus) >=  0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {\n    r = new bn(randomBytes(len));\n  }\n  return r;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-rsa/index.js\n// module id = 238\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-rsa/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar createHash = __webpack_require__(59)\nvar bs58checkBase = __webpack_require__(670)\n\n// SHA256(SHA256(buffer))\nfunction sha256x2 (buffer) {\n  var tmp = createHash('sha256').update(buffer).digest()\n  return createHash('sha256').update(tmp).digest()\n}\n\nmodule.exports = bs58checkBase(sha256x2)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bs58check/index.js\n// module id = 239\n// module chunks = 0\n\n//# sourceURL=../node_modules/bs58check/index.js")},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(135);\nvar TAG = __webpack_require__(38)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n  try {\n    return it[key];\n  } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n  var O, T, B;\n  return it === undefined ? 'Undefined' : it === null ? 'Null'\n    // @@toStringTag case\n    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n    // builtinTag case\n    : ARG ? cof(O)\n    // ES3 arguments fallback\n    : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_classof.js\n// module id = 240\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_classof.js")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n  if (it == undefined) throw TypeError("Can\'t call method on  " + it);\n  return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_defined.js\n// module id = 241\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_defined.js')},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(91);\nvar document = __webpack_require__(42).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n  return is ? document.createElement(it) : {};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_dom-create.js\n// module id = 242\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_dom-create.js")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_enum-bug-keys.js\n// module id = 243\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_enum-bug-keys.js")},function(module,exports,__webpack_require__){"use strict";eval("\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(170);\n\nfunction PromiseCapability(C) {\n  var resolve, reject;\n  this.promise = new C(function ($$resolve, $$reject) {\n    if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n    resolve = $$resolve;\n    reject = $$reject;\n  });\n  this.resolve = aFunction(resolve);\n  this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n  return new PromiseCapability(C);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_new-promise-capability.js\n// module id = 244\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_new-promise-capability.js")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gops.js\n// module id = 245\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-gops.js")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(247)('keys');\nvar uid = __webpack_require__(175);\nmodule.exports = function (key) {\n  return shared[key] || (shared[key] = uid(key));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared-key.js\n// module id = 246\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_shared-key.js")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(42);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function (key) {\n  return store[key] || (store[key] = {});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_shared.js\n// module id = 247\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_shared.js")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-integer.js\n// module id = 248\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-integer.js")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(248);\nvar min = Math.min;\nmodule.exports = function (it) {\n  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-length.js\n// module id = 249\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-length.js")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(91);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n  if (!isObject(it)) return it;\n  var fn, val;\n  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n  throw TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-primitive.js\n// module id = 250\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-primitive.js")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(42);\nvar core = __webpack_require__(31);\nvar LIBRARY = __webpack_require__(171);\nvar wksExt = __webpack_require__(252);\nvar defineProperty = __webpack_require__(70).f;\nmodule.exports = function (name) {\n  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks-define.js\n// module id = 251\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_wks-define.js")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(38);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_wks-ext.js\n// module id = 252\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_wks-ext.js")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(240);\nvar ITERATOR = __webpack_require__(38)('iterator');\nvar Iterators = __webpack_require__(117);\nmodule.exports = __webpack_require__(31).getIteratorMethod = function (it) {\n  if (it != undefined) return it[ITERATOR]\n    || it['@@iterator']\n    || Iterators[classof(it)];\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.get-iterator-method.js\n// module id = 253\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/core.get-iterator-method.js")},function(module,exports,__webpack_require__){"use strict";eval("\n/*\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\n * Digest Algorithm, as defined in RFC 1321.\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for more info.\n */\n\nvar makeHash = __webpack_require__(718)\n\n/*\n * Calculate the MD5 of an array of little-endian words, and a bit length\n */\nfunction core_md5 (x, len) {\n  /* append padding */\n  x[len >> 5] |= 0x80 << ((len) % 32)\n  x[(((len + 64) >>> 9) << 4) + 14] = len\n\n  var a = 1732584193\n  var b = -271733879\n  var c = -1732584194\n  var d = 271733878\n\n  for (var i = 0; i < x.length; i += 16) {\n    var olda = a\n    var oldb = b\n    var oldc = c\n    var oldd = d\n\n    a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)\n    d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)\n    c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)\n    b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)\n    a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)\n    d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)\n    c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)\n    b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)\n    a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)\n    d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)\n    c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)\n    b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)\n    a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)\n    d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)\n    c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)\n    b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)\n\n    a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)\n    d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)\n    c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)\n    b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)\n    a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)\n    d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)\n    c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)\n    b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)\n    a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)\n    d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)\n    c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)\n    b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)\n    a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)\n    d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)\n    c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)\n    b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)\n\n    a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)\n    d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)\n    c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)\n    b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)\n    a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)\n    d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)\n    c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)\n    b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)\n    a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)\n    d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)\n    c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)\n    b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)\n    a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)\n    d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)\n    c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)\n    b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)\n\n    a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)\n    d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)\n    c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)\n    b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)\n    a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)\n    d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)\n    c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)\n    b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)\n    a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)\n    d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)\n    c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)\n    b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)\n    a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)\n    d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)\n    c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)\n    b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)\n\n    a = safe_add(a, olda)\n    b = safe_add(b, oldb)\n    c = safe_add(c, oldc)\n    d = safe_add(d, oldd)\n  }\n\n  return [a, b, c, d]\n}\n\n/*\n * These functions implement the four basic operations the algorithm uses.\n */\nfunction md5_cmn (q, a, b, x, s, t) {\n  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)\n}\n\nfunction md5_ff (a, b, c, d, x, s, t) {\n  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)\n}\n\nfunction md5_gg (a, b, c, d, x, s, t) {\n  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)\n}\n\nfunction md5_hh (a, b, c, d, x, s, t) {\n  return md5_cmn(b ^ c ^ d, a, b, x, s, t)\n}\n\nfunction md5_ii (a, b, c, d, x, s, t) {\n  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)\n}\n\n/*\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\n * to work around bugs in some JS interpreters.\n */\nfunction safe_add (x, y) {\n  var lsw = (x & 0xFFFF) + (y & 0xFFFF)\n  var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\n  return (msw << 16) | (lsw & 0xFFFF)\n}\n\n/*\n * Bitwise rotate a 32-bit number to the left.\n */\nfunction bit_rol (num, cnt) {\n  return (num << cnt) | (num >>> (32 - cnt))\n}\n\nmodule.exports = function md5 (buf) {\n  return makeHash(buf, core_md5)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-hash/md5.js\n// module id = 254\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-hash/md5.js")},function(module,exports,__webpack_require__){eval('var A = __webpack_require__(785);\n\nvar at = function at(bytes, index) {\n  return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\n};\n\nvar random = function random(bytes) {\n  var rnd = void 0;\n  if (typeof window !== "undefined" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(60).randomBytes(bytes);else throw "Safe random numbers not available.";\n  var hex = "0x";\n  for (var i = 0; i < bytes; ++i) {\n    hex += ("00" + rnd[i].toString(16)).slice(-2);\n  }return hex;\n};\n\nvar length = function length(a) {\n  return (a.length - 2) / 2;\n};\n\nvar flatten = function flatten(a) {\n  return "0x" + a.reduce(function (r, s) {\n    return r + s.slice(2);\n  }, "");\n};\n\nvar slice = function slice(i, j, bs) {\n  return "0x" + bs.slice(i * 2 + 2, j * 2 + 2);\n};\n\nvar reverse = function reverse(hex) {\n  var rev = "0x";\n  for (var i = 0, l = length(hex); i < l; ++i) {\n    rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\n  }\n  return rev;\n};\n\nvar pad = function pad(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : pad(l, "0x" + "0" + hex.slice(2));\n};\n\nvar padRight = function padRight(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : padRight(l, hex + "0");\n};\n\nvar toArray = function toArray(hex) {\n  var arr = [];\n  for (var i = 2, l = hex.length; i < l; i += 2) {\n    arr.push(parseInt(hex.slice(i, i + 2), 16));\n  }return arr;\n};\n\nvar fromArray = function fromArray(arr) {\n  var hex = "0x";\n  for (var i = 0, l = arr.length; i < l; ++i) {\n    var b = arr[i];\n    hex += (b < 16 ? "0" : "") + b.toString(16);\n  }\n  return hex;\n};\n\nvar toUint8Array = function toUint8Array(hex) {\n  return new Uint8Array(toArray(hex));\n};\n\nvar fromUint8Array = function fromUint8Array(arr) {\n  return fromArray([].slice.call(arr, 0));\n};\n\nvar fromNumber = function fromNumber(num) {\n  var hex = num.toString(16);\n  return hex.length % 2 === 0 ? "0x" + hex : "0x0" + hex;\n};\n\nvar toNumber = function toNumber(hex) {\n  return parseInt(hex.slice(2), 16);\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b.slice(2));\n};\n\nvar fromNat = function fromNat(bn) {\n  return bn === "0x0" ? "0x" : bn.length % 2 === 0 ? bn : "0x0" + bn.slice(2);\n};\n\nvar toNat = function toNat(bn) {\n  return bn[2] === "0" ? "0x" + bn.slice(3) : bn;\n};\n\nvar fromAscii = function fromAscii(ascii) {\n  var hex = "0x";\n  for (var i = 0; i < ascii.length; ++i) {\n    hex += ("00" + ascii.charCodeAt(i).toString(16)).slice(-2);\n  }return hex;\n};\n\nvar toAscii = function toAscii(hex) {\n  var ascii = "";\n  for (var i = 2; i < hex.length; i += 2) {\n    ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\n  }return ascii;\n};\n\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\nvar fromString = function fromString(s) {\n  var makeByte = function makeByte(uint8) {\n    var b = uint8.toString(16);\n    return b.length < 2 ? "0" + b : b;\n  };\n  var bytes = "0x";\n  for (var ci = 0; ci != s.length; ci++) {\n    var c = s.charCodeAt(ci);\n    if (c < 128) {\n      bytes += makeByte(c);\n      continue;\n    }\n    if (c < 2048) {\n      bytes += makeByte(c >> 6 | 192);\n    } else {\n      if (c > 0xd7ff && c < 0xdc00) {\n        if (++ci == s.length) return null;\n        var c2 = s.charCodeAt(ci);\n        if (c2 < 0xdc00 || c2 > 0xdfff) return null;\n        c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n        bytes += makeByte(c >> 18 | 240);\n        bytes += makeByte(c >> 12 & 63 | 128);\n      } else {\n        // c <= 0xffff\n        bytes += makeByte(c >> 12 | 224);\n      }\n      bytes += makeByte(c >> 6 & 63 | 128);\n    }\n    bytes += makeByte(c & 63 | 128);\n  }\n  return bytes;\n};\n\nvar toString = function toString(bytes) {\n  var s = \'\';\n  var i = 0;\n  var l = length(bytes);\n  while (i < l) {\n    var c = at(bytes, i++);\n    if (c > 127) {\n      if (c > 191 && c < 224) {\n        if (i >= l) return null;\n        c = (c & 31) << 6 | at(bytes, i) & 63;\n      } else if (c > 223 && c < 240) {\n        if (i + 1 >= l) return null;\n        c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else if (c > 239 && c < 248) {\n        if (i + 2 >= l) return null;\n        c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else return null;\n      ++i;\n    }\n    if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n      c -= 0x10000;\n      s += String.fromCharCode(c >> 10 | 0xd800);\n      s += String.fromCharCode(c & 0x3FF | 0xdc00);\n    } else return null;\n  }\n  return s;\n};\n\nmodule.exports = {\n  random: random,\n  length: length,\n  concat: concat,\n  flatten: flatten,\n  slice: slice,\n  reverse: reverse,\n  pad: pad,\n  padRight: padRight,\n  fromAscii: fromAscii,\n  toAscii: toAscii,\n  fromString: fromString,\n  toString: toString,\n  fromNumber: fromNumber,\n  toNumber: toNumber,\n  fromNat: fromNat,\n  toNat: toNat,\n  fromArray: fromArray,\n  toArray: toArray,\n  fromUint8Array: fromUint8Array,\n  toUint8Array: toUint8Array\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/bytes.js\n// module id = 255\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.utils = __webpack_require__(810);\nexports.Cipher = __webpack_require__(807);\nexports.DES = __webpack_require__(808);\nexports.CBC = __webpack_require__(806);\nexports.EDE = __webpack_require__(809);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des.js\n// module id = 256\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des.js")},function(module,exports,__webpack_require__){eval("var Point = __webpack_require__(402)\nvar Curve = __webpack_require__(401)\n\nvar getCurveByName = __webpack_require__(819)\n\nmodule.exports = {\n  Curve: Curve,\n  Point: Point,\n  getCurveByName: getCurveByName\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ecurve/lib/index.js\n// module id = 257\n// module chunks = 0\n\n//# sourceURL=../node_modules/ecurve/lib/index.js")},function(module,exports,__webpack_require__){eval("/**\n * Module dependencies.\n */\n\nvar parser = __webpack_require__(119);\nvar Emitter = __webpack_require__(115);\n\n/**\n * Module exports.\n */\n\nmodule.exports = Transport;\n\n/**\n * Transport abstract constructor.\n *\n * @param {Object} options.\n * @api private\n */\n\nfunction Transport (opts) {\n  this.path = opts.path;\n  this.hostname = opts.hostname;\n  this.port = opts.port;\n  this.secure = opts.secure;\n  this.query = opts.query;\n  this.timestampParam = opts.timestampParam;\n  this.timestampRequests = opts.timestampRequests;\n  this.readyState = '';\n  this.agent = opts.agent || false;\n  this.socket = opts.socket;\n  this.enablesXDR = opts.enablesXDR;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n  this.forceNode = opts.forceNode;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n  this.localAddress = opts.localAddress;\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Transport.prototype);\n\n/**\n * Emits an error.\n *\n * @param {String} str\n * @return {Transport} for chaining\n * @api public\n */\n\nTransport.prototype.onError = function (msg, desc) {\n  var err = new Error(msg);\n  err.type = 'TransportError';\n  err.description = desc;\n  this.emit('error', err);\n  return this;\n};\n\n/**\n * Opens the transport.\n *\n * @api public\n */\n\nTransport.prototype.open = function () {\n  if ('closed' === this.readyState || '' === this.readyState) {\n    this.readyState = 'opening';\n    this.doOpen();\n  }\n\n  return this;\n};\n\n/**\n * Closes the transport.\n *\n * @api private\n */\n\nTransport.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.doClose();\n    this.onClose();\n  }\n\n  return this;\n};\n\n/**\n * Sends multiple packets.\n *\n * @param {Array} packets\n * @api private\n */\n\nTransport.prototype.send = function (packets) {\n  if ('open' === this.readyState) {\n    this.write(packets);\n  } else {\n    throw new Error('Transport not open');\n  }\n};\n\n/**\n * Called upon open\n *\n * @api private\n */\n\nTransport.prototype.onOpen = function () {\n  this.readyState = 'open';\n  this.writable = true;\n  this.emit('open');\n};\n\n/**\n * Called with data.\n *\n * @param {String} data\n * @api private\n */\n\nTransport.prototype.onData = function (data) {\n  var packet = parser.decodePacket(data, this.socket.binaryType);\n  this.onPacket(packet);\n};\n\n/**\n * Called with a decoded packet.\n */\n\nTransport.prototype.onPacket = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon close.\n *\n * @api private\n */\n\nTransport.prototype.onClose = function () {\n  this.readyState = 'closed';\n  this.emit('close');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transport.js\n// module id = 258\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transport.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {// browser shim for xmlhttprequest module\n\nvar hasCORS = __webpack_require__(870);\n\nmodule.exports = function (opts) {\n  var xdomain = opts.xdomain;\n\n  // scheme must be same when usign XDomainRequest\n  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n  var xscheme = opts.xscheme;\n\n  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n  // https://github.com/Automattic/engine.io-client/pull/217\n  var enablesXDR = opts.enablesXDR;\n\n  // XMLHttpRequest can be disabled on IE\n  try {\n    if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n      return new XMLHttpRequest();\n    }\n  } catch (e) { }\n\n  // Use XDomainRequest for IE8 if enablesXDR is true\n  // because loading bar keeps flashing when using jsonp-polling\n  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n  try {\n    if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {\n      return new XDomainRequest();\n    }\n  } catch (e) { }\n\n  if (!xdomain) {\n    try {\n      return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');\n    } catch (e) { }\n  }\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/xmlhttprequest.js\n// module id = 259\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/xmlhttprequest.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _undefined = __webpack_require__(843)(); // Support ES3 engines\n\nmodule.exports = function (val) {\n return (val !== _undefined) && (val !== null);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/is-value.js\n// module id = 260\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/is-value.js")},function(module,exports){eval('// This was ported from https://github.com/emn178/js-sha3, with some minor\n// modifications and pruning. It is licensed under MIT:\n//\n// Copyright 2015-2016 Chen, Yi-Cyuan\n//  \n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar HEX_CHARS = \'0123456789abcdef\'.split(\'\');\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\nvar SHIFT = [0, 8, 16, 24];\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n\nvar Keccak = function Keccak(bits) {\n  return {\n    blocks: [],\n    reset: true,\n    block: 0,\n    start: 0,\n    blockCount: 1600 - (bits << 1) >> 5,\n    outputBlocks: bits >> 5,\n    s: function (s) {\n      return [].concat(s, s, s, s, s);\n    }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n  };\n};\n\nvar update = function update(state, message) {\n  var length = message.length,\n      blocks = state.blocks,\n      byteCount = state.blockCount << 2,\n      blockCount = state.blockCount,\n      outputBlocks = state.outputBlocks,\n      s = state.s,\n      index = 0,\n      i,\n      code;\n\n  // update\n  while (index < length) {\n    if (state.reset) {\n      state.reset = false;\n      blocks[0] = state.block;\n      for (i = 1; i < blockCount + 1; ++i) {\n        blocks[i] = 0;\n      }\n    }\n    if (typeof message !== "string") {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n      }\n    } else {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        code = message.charCodeAt(index);\n        if (code < 0x80) {\n          blocks[i >> 2] |= code << SHIFT[i++ & 3];\n        } else if (code < 0x800) {\n          blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else if (code < 0xd800 || code >= 0xe000) {\n          blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else {\n          code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\n          blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        }\n      }\n    }\n    state.lastByteIndex = i;\n    if (i >= byteCount) {\n      state.start = i - byteCount;\n      state.block = blocks[blockCount];\n      for (i = 0; i < blockCount; ++i) {\n        s[i] ^= blocks[i];\n      }\n      f(s);\n      state.reset = true;\n    } else {\n      state.start = i;\n    }\n  }\n\n  // finalize\n  i = state.lastByteIndex;\n  blocks[i >> 2] |= KECCAK_PADDING[i & 3];\n  if (state.lastByteIndex === byteCount) {\n    blocks[0] = blocks[blockCount];\n    for (i = 1; i < blockCount + 1; ++i) {\n      blocks[i] = 0;\n    }\n  }\n  blocks[blockCount - 1] |= 0x80000000;\n  for (i = 0; i < blockCount; ++i) {\n    s[i] ^= blocks[i];\n  }\n  f(s);\n\n  // toString\n  var hex = \'\',\n      i = 0,\n      j = 0,\n      block;\n  while (j < outputBlocks) {\n    for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n      block = s[i];\n      hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\n    }\n    if (j % blockCount === 0) {\n      f(s);\n      i = 0;\n    }\n  }\n  return "0x" + hex;\n};\n\nvar f = function f(s) {\n  var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n\n  for (n = 0; n < 48; n += 2) {\n    c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n    c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n    c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n    c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n    c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n    c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n    c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n    c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n    c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n    c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n    h = c8 ^ (c2 << 1 | c3 >>> 31);\n    l = c9 ^ (c3 << 1 | c2 >>> 31);\n    s[0] ^= h;\n    s[1] ^= l;\n    s[10] ^= h;\n    s[11] ^= l;\n    s[20] ^= h;\n    s[21] ^= l;\n    s[30] ^= h;\n    s[31] ^= l;\n    s[40] ^= h;\n    s[41] ^= l;\n    h = c0 ^ (c4 << 1 | c5 >>> 31);\n    l = c1 ^ (c5 << 1 | c4 >>> 31);\n    s[2] ^= h;\n    s[3] ^= l;\n    s[12] ^= h;\n    s[13] ^= l;\n    s[22] ^= h;\n    s[23] ^= l;\n    s[32] ^= h;\n    s[33] ^= l;\n    s[42] ^= h;\n    s[43] ^= l;\n    h = c2 ^ (c6 << 1 | c7 >>> 31);\n    l = c3 ^ (c7 << 1 | c6 >>> 31);\n    s[4] ^= h;\n    s[5] ^= l;\n    s[14] ^= h;\n    s[15] ^= l;\n    s[24] ^= h;\n    s[25] ^= l;\n    s[34] ^= h;\n    s[35] ^= l;\n    s[44] ^= h;\n    s[45] ^= l;\n    h = c4 ^ (c8 << 1 | c9 >>> 31);\n    l = c5 ^ (c9 << 1 | c8 >>> 31);\n    s[6] ^= h;\n    s[7] ^= l;\n    s[16] ^= h;\n    s[17] ^= l;\n    s[26] ^= h;\n    s[27] ^= l;\n    s[36] ^= h;\n    s[37] ^= l;\n    s[46] ^= h;\n    s[47] ^= l;\n    h = c6 ^ (c0 << 1 | c1 >>> 31);\n    l = c7 ^ (c1 << 1 | c0 >>> 31);\n    s[8] ^= h;\n    s[9] ^= l;\n    s[18] ^= h;\n    s[19] ^= l;\n    s[28] ^= h;\n    s[29] ^= l;\n    s[38] ^= h;\n    s[39] ^= l;\n    s[48] ^= h;\n    s[49] ^= l;\n\n    b0 = s[0];\n    b1 = s[1];\n    b32 = s[11] << 4 | s[10] >>> 28;\n    b33 = s[10] << 4 | s[11] >>> 28;\n    b14 = s[20] << 3 | s[21] >>> 29;\n    b15 = s[21] << 3 | s[20] >>> 29;\n    b46 = s[31] << 9 | s[30] >>> 23;\n    b47 = s[30] << 9 | s[31] >>> 23;\n    b28 = s[40] << 18 | s[41] >>> 14;\n    b29 = s[41] << 18 | s[40] >>> 14;\n    b20 = s[2] << 1 | s[3] >>> 31;\n    b21 = s[3] << 1 | s[2] >>> 31;\n    b2 = s[13] << 12 | s[12] >>> 20;\n    b3 = s[12] << 12 | s[13] >>> 20;\n    b34 = s[22] << 10 | s[23] >>> 22;\n    b35 = s[23] << 10 | s[22] >>> 22;\n    b16 = s[33] << 13 | s[32] >>> 19;\n    b17 = s[32] << 13 | s[33] >>> 19;\n    b48 = s[42] << 2 | s[43] >>> 30;\n    b49 = s[43] << 2 | s[42] >>> 30;\n    b40 = s[5] << 30 | s[4] >>> 2;\n    b41 = s[4] << 30 | s[5] >>> 2;\n    b22 = s[14] << 6 | s[15] >>> 26;\n    b23 = s[15] << 6 | s[14] >>> 26;\n    b4 = s[25] << 11 | s[24] >>> 21;\n    b5 = s[24] << 11 | s[25] >>> 21;\n    b36 = s[34] << 15 | s[35] >>> 17;\n    b37 = s[35] << 15 | s[34] >>> 17;\n    b18 = s[45] << 29 | s[44] >>> 3;\n    b19 = s[44] << 29 | s[45] >>> 3;\n    b10 = s[6] << 28 | s[7] >>> 4;\n    b11 = s[7] << 28 | s[6] >>> 4;\n    b42 = s[17] << 23 | s[16] >>> 9;\n    b43 = s[16] << 23 | s[17] >>> 9;\n    b24 = s[26] << 25 | s[27] >>> 7;\n    b25 = s[27] << 25 | s[26] >>> 7;\n    b6 = s[36] << 21 | s[37] >>> 11;\n    b7 = s[37] << 21 | s[36] >>> 11;\n    b38 = s[47] << 24 | s[46] >>> 8;\n    b39 = s[46] << 24 | s[47] >>> 8;\n    b30 = s[8] << 27 | s[9] >>> 5;\n    b31 = s[9] << 27 | s[8] >>> 5;\n    b12 = s[18] << 20 | s[19] >>> 12;\n    b13 = s[19] << 20 | s[18] >>> 12;\n    b44 = s[29] << 7 | s[28] >>> 25;\n    b45 = s[28] << 7 | s[29] >>> 25;\n    b26 = s[38] << 8 | s[39] >>> 24;\n    b27 = s[39] << 8 | s[38] >>> 24;\n    b8 = s[48] << 14 | s[49] >>> 18;\n    b9 = s[49] << 14 | s[48] >>> 18;\n\n    s[0] = b0 ^ ~b2 & b4;\n    s[1] = b1 ^ ~b3 & b5;\n    s[10] = b10 ^ ~b12 & b14;\n    s[11] = b11 ^ ~b13 & b15;\n    s[20] = b20 ^ ~b22 & b24;\n    s[21] = b21 ^ ~b23 & b25;\n    s[30] = b30 ^ ~b32 & b34;\n    s[31] = b31 ^ ~b33 & b35;\n    s[40] = b40 ^ ~b42 & b44;\n    s[41] = b41 ^ ~b43 & b45;\n    s[2] = b2 ^ ~b4 & b6;\n    s[3] = b3 ^ ~b5 & b7;\n    s[12] = b12 ^ ~b14 & b16;\n    s[13] = b13 ^ ~b15 & b17;\n    s[22] = b22 ^ ~b24 & b26;\n    s[23] = b23 ^ ~b25 & b27;\n    s[32] = b32 ^ ~b34 & b36;\n    s[33] = b33 ^ ~b35 & b37;\n    s[42] = b42 ^ ~b44 & b46;\n    s[43] = b43 ^ ~b45 & b47;\n    s[4] = b4 ^ ~b6 & b8;\n    s[5] = b5 ^ ~b7 & b9;\n    s[14] = b14 ^ ~b16 & b18;\n    s[15] = b15 ^ ~b17 & b19;\n    s[24] = b24 ^ ~b26 & b28;\n    s[25] = b25 ^ ~b27 & b29;\n    s[34] = b34 ^ ~b36 & b38;\n    s[35] = b35 ^ ~b37 & b39;\n    s[44] = b44 ^ ~b46 & b48;\n    s[45] = b45 ^ ~b47 & b49;\n    s[6] = b6 ^ ~b8 & b0;\n    s[7] = b7 ^ ~b9 & b1;\n    s[16] = b16 ^ ~b18 & b10;\n    s[17] = b17 ^ ~b19 & b11;\n    s[26] = b26 ^ ~b28 & b20;\n    s[27] = b27 ^ ~b29 & b21;\n    s[36] = b36 ^ ~b38 & b30;\n    s[37] = b37 ^ ~b39 & b31;\n    s[46] = b46 ^ ~b48 & b40;\n    s[47] = b47 ^ ~b49 & b41;\n    s[8] = b8 ^ ~b0 & b2;\n    s[9] = b9 ^ ~b1 & b3;\n    s[18] = b18 ^ ~b10 & b12;\n    s[19] = b19 ^ ~b11 & b13;\n    s[28] = b28 ^ ~b20 & b22;\n    s[29] = b29 ^ ~b21 & b23;\n    s[38] = b38 ^ ~b30 & b32;\n    s[39] = b39 ^ ~b31 & b33;\n    s[48] = b48 ^ ~b40 & b42;\n    s[49] = b49 ^ ~b41 & b43;\n\n    s[0] ^= RC[n];\n    s[1] ^= RC[n + 1];\n  }\n};\n\nvar keccak = function keccak(bits) {\n  return function (str) {\n    var msg;\n    if (str.slice(0, 2) === "0x") {\n      msg = [];\n      for (var i = 2, l = str.length; i < l; i += 2) {\n        msg.push(parseInt(str.slice(i, i + 2), 16));\n      }\n    } else {\n      msg = str;\n    }\n    return update(Keccak(bits, bits), msg);\n  };\n};\n\nmodule.exports = {\n  keccak256: keccak(256),\n  keccak512: keccak(512),\n  keccak256s: keccak(256),\n  keccak512s: keccak(512)\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eth-lib/lib/hash.js\n// module id = 261\n// module chunks = 0\n\n//# sourceURL=../node_modules/eth-lib/lib/hash.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar d        = __webpack_require__(720)\n  , callable = __webpack_require__(852)\n\n  , apply = Function.prototype.apply, call = Function.prototype.call\n  , create = Object.create, defineProperty = Object.defineProperty\n  , defineProperties = Object.defineProperties\n  , hasOwnProperty = Object.prototype.hasOwnProperty\n  , descriptor = { configurable: true, enumerable: false, writable: true }\n\n  , on, once, off, emit, methods, descriptors, base;\n\non = function (type, listener) {\n\tvar data;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) {\n\t\tdata = descriptor.value = create(null);\n\t\tdefineProperty(this, '__ee__', descriptor);\n\t\tdescriptor.value = null;\n\t} else {\n\t\tdata = this.__ee__;\n\t}\n\tif (!data[type]) data[type] = listener;\n\telse if (typeof data[type] === 'object') data[type].push(listener);\n\telse data[type] = [data[type], listener];\n\n\treturn this;\n};\n\nonce = function (type, listener) {\n\tvar once, self;\n\n\tcallable(listener);\n\tself = this;\n\ton.call(this, type, once = function () {\n\t\toff.call(self, type, once);\n\t\tapply.call(listener, this, arguments);\n\t});\n\n\tonce.__eeOnceListener__ = listener;\n\treturn this;\n};\n\noff = function (type, listener) {\n\tvar data, listeners, candidate, i;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return this;\n\tdata = this.__ee__;\n\tif (!data[type]) return this;\n\tlisteners = data[type];\n\n\tif (typeof listeners === 'object') {\n\t\tfor (i = 0; (candidate = listeners[i]); ++i) {\n\t\t\tif ((candidate === listener) ||\n\t\t\t\t\t(candidate.__eeOnceListener__ === listener)) {\n\t\t\t\tif (listeners.length === 2) data[type] = listeners[i ? 0 : 1];\n\t\t\t\telse listeners.splice(i, 1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ((listeners === listener) ||\n\t\t\t\t(listeners.__eeOnceListener__ === listener)) {\n\t\t\tdelete data[type];\n\t\t}\n\t}\n\n\treturn this;\n};\n\nemit = function (type) {\n\tvar i, l, listener, listeners, args;\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return;\n\tlisteners = this.__ee__[type];\n\tif (!listeners) return;\n\n\tif (typeof listeners === 'object') {\n\t\tl = arguments.length;\n\t\targs = new Array(l - 1);\n\t\tfor (i = 1; i < l; ++i) args[i - 1] = arguments[i];\n\n\t\tlisteners = listeners.slice();\n\t\tfor (i = 0; (listener = listeners[i]); ++i) {\n\t\t\tapply.call(listener, this, args);\n\t\t}\n\t} else {\n\t\tswitch (arguments.length) {\n\t\tcase 1:\n\t\t\tcall.call(listeners, this);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcall.call(listeners, this, arguments[1]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcall.call(listeners, this, arguments[1], arguments[2]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tl = arguments.length;\n\t\t\targs = new Array(l - 1);\n\t\t\tfor (i = 1; i < l; ++i) {\n\t\t\t\targs[i - 1] = arguments[i];\n\t\t\t}\n\t\t\tapply.call(listeners, this, args);\n\t\t}\n\t}\n};\n\nmethods = {\n\ton: on,\n\tonce: once,\n\toff: off,\n\temit: emit\n};\n\ndescriptors = {\n\ton: d(on),\n\tonce: d(once),\n\toff: d(off),\n\temit: d(emit)\n};\n\nbase = defineProperties({}, descriptors);\n\nmodule.exports = exports = function (o) {\n\treturn (o == null) ? create(base) : defineProperties(Object(o), descriptors);\n};\nexports.methods = methods;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/event-emitter/index.js\n// module id = 262\n// module chunks = 0\n\n//# sourceURL=../node_modules/event-emitter/index.js")},function(module,exports,__webpack_require__){eval("var hash = exports;\n\nhash.utils = __webpack_require__(62);\nhash.common = __webpack_require__(143);\nhash.sha = __webpack_require__(874);\nhash.ripemd = __webpack_require__(873);\nhash.hmac = __webpack_require__(872);\n\n// Proxy hash functions to the main object\nhash.sha1 = hash.sha.sha1;\nhash.sha256 = hash.sha.sha256;\nhash.sha224 = hash.sha.sha224;\nhash.sha384 = hash.sha.sha384;\nhash.sha512 = hash.sha.sha512;\nhash.ripemd160 = hash.ripemd.ripemd160;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash.js\n// module id = 263\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash.js")},function(module,exports){eval("\nvar indexOf = [].indexOf;\n\nmodule.exports = function(arr, obj){\n  if (indexOf) return arr.indexOf(obj);\n  for (var i = 0; i < arr.length; ++i) {\n    if (arr[i] === obj) return i;\n  }\n  return -1;\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/indexof/index.js\n// module id = 264\n// module chunks = 0\n\n//# sourceURL=../node_modules/indexof/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst Source = __webpack_require__(204)\nconst path = __webpack_require__(202)\nconst os = __webpack_require__(296)\nconst uuid = __webpack_require__(312)\n\nexports.asyncFilter = function (test) {\n  let busy = false\n  let abortCb\n  let aborted\n\n  return function (read) {\n    return function next (abort, cb) {\n      if (aborted) return cb(aborted)\n      if (abort) {\n        aborted = abort\n        if (!busy) {\n          read(abort, cb)\n        } else {\n          read(abort, () => {\n            // if we are still busy, wait for the test to complete.\n            if (busy) abortCb = cb; else cb(abort)\n          })\n        }\n      } else {\n        read(null, (end, data) => {\n          if (end) cb(end); else if (aborted) cb(aborted); else {\n            busy = true\n            test(data, (err, valid) => {\n              busy = false\n              if (aborted) {\n                cb(aborted)\n                abortCb(aborted)\n              } else if (err) {\n                next(err, cb)\n              } else if (valid) {\n                cb(null, data)\n              } else {\n                next(null, cb)\n              }\n            })\n          }\n        })\n      }\n    }\n  }\n}\n\nexports.asyncSort = function (sorter) {\n  const source = Source()\n\n  const sink = pull.collect((err, ary) => {\n    if (err) {\n      return source.abort(err)\n    }\n    sorter(ary, (err, res) => {\n      if (err) {\n        return source.abort(err)\n      }\n      source.resolve(pull.values(ary))\n    })\n  })\n\n  return function (read) {\n    sink(read)\n    return source\n  }\n}\n\nexports.replaceStartWith = function (s, r) {\n  const matcher = new RegExp('^' + r)\n  return s.replace(matcher, '')\n}\n\nexports.tmpdir = () => {\n  return path.join(os.tmpdir(), uuid())\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-datastore/src/utils.js\n// module id = 265\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-datastore/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst SECOND = 1000\n\nmodule.exports = {\n  maxProvidersPerRequest: 3,\n  providerRequestTimeout: 10 * SECOND,\n  hasBlockTimeout: 15 * SECOND,\n  provideTimeout: 15 * SECOND,\n  kMaxPriority: Math.pow(2, 31) - 1,\n  rebroadcastDelay: 10 * SECOND,\n  maxListeners: 1000\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/constants.js\n// module id = 266\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst waterfall = __webpack_require__(12)\nconst series = __webpack_require__(51)\nconst parallel = __webpack_require__(85)\nconst each = __webpack_require__(41)\nconst assert = __webpack_require__(16)\nconst path = __webpack_require__(202)\nconst debug = __webpack_require__(5)\nconst Big = __webpack_require__(226)\nconst pull = __webpack_require__(6)\n\nconst backends = __webpack_require__(897)\nconst version = __webpack_require__(902)\nconst config = __webpack_require__(899)\nconst apiAddr = __webpack_require__(896)\nconst blockstore = __webpack_require__(898)\nconst defaultOptions = __webpack_require__(901)\n\nconst log = debug('repo')\n\nconst noLimit = Number.MAX_SAFE_INTEGER\n\nconst lockers = {\n  memory: __webpack_require__(415),\n  fs: __webpack_require__(415)\n}\n\nconst repoVersion = __webpack_require__(900).repoVersion\n\n/**\n * IpfsRepo implements all required functionality to read and write to an ipfs repo.\n *\n */\nclass IpfsRepo {\n  /**\n   * @param {string} repoPath - path where the repo is stored\n   * @param {object} options - Configuration\n   */\n  constructor (repoPath, options) {\n    assert.equal(typeof repoPath, 'string', 'missing repoPath')\n\n    this.options = buildOptions(options)\n    this.closed = true\n    this.path = repoPath\n\n    this._locker = lockers[this.options.lock]\n    assert(this._locker, 'Unknown lock type: ' + this.options.lock)\n\n    this.root = backends.create('root', this.path, this.options)\n    this.version = version(this.root)\n    this.config = config(this.root)\n    this.apiAddr = apiAddr(this.root)\n  }\n\n  /**\n   * Initialize a new repo.\n   *\n   * @param {Object} config - config to write into `config`.\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  init (config, callback) {\n    log('initializing at: %s', this.path)\n\n    series([\n      (cb) => this.root.open(ignoringAlreadyOpened(cb)),\n      (cb) => this.config.set(config, cb),\n      (cb) => this.version.set(repoVersion, cb)\n    ], callback)\n  }\n\n  /**\n   * Open the repo. If the repo is already open no action will be taken.\n   * If the repo is not initialized it will return an error.\n   *\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  open (callback) {\n    if (!this.closed) {\n      setImmediate(() => callback(new Error('repo is already open')))\n      return // early\n    }\n    log('opening at: %s', this.path)\n\n    // check if the repo is already initialized\n    waterfall([\n      (cb) => this.root.open(ignoringAlreadyOpened(cb)),\n      (cb) => this._isInitialized(cb),\n      (cb) => this._locker.lock(this.path, cb),\n      (lck, cb) => {\n        log('aquired repo.lock')\n        this.lockfile = lck\n        cb()\n      },\n      (cb) => {\n        log('creating datastore')\n        this.datastore = backends.create('datastore', path.join(this.path, 'datastore'), this.options)\n        log('creating blocks')\n        const blocksBaseStore = backends.create('blocks', path.join(this.path, 'blocks'), this.options)\n        blockstore(\n          blocksBaseStore,\n          this.options.storageBackendOptions.blocks,\n          cb)\n      },\n      (blocks, cb) => {\n        this.blocks = blocks\n        cb()\n      },\n      (cb) => {\n        log('creating keystore')\n        this.keys = backends.create('keys', path.join(this.path, 'keys'), this.options)\n        cb()\n      },\n\n      (cb) => {\n        this.closed = false\n        log('all opened')\n        cb()\n      }\n    ], (err) => {\n      if (err && this.lockfile) {\n        this.lockfile.close((err2) => {\n          if (!err2) {\n            this.lockfile = null\n          } else {\n            log('error removing lock', err2)\n          }\n          callback(err)\n        })\n      } else {\n        callback(err)\n      }\n    })\n  }\n\n  /**\n   * Check if the repo is already initialized.\n   *\n   * @private\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  _isInitialized (callback) {\n    log('init check')\n    parallel(\n      {\n        config: (cb) => this.config.exists(cb),\n        version: (cb) => this.version.check(repoVersion, cb)\n      },\n      (err, res) => {\n        log('init', err, res)\n        if (err) {\n          return callback(err)\n        }\n\n        if (!res.config) {\n          return callback(new Error('repo is not initialized yet'))\n        }\n        callback()\n      }\n    )\n  }\n\n  /**\n   * Close the repo and cleanup.\n   *\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  close (callback) {\n    if (this.closed) {\n      return callback(new Error('repo is already closed'))\n    }\n\n    log('closing at: %s', this.path)\n    series([\n      (cb) => this.apiAddr.delete(ignoringNotFound(cb)),\n      (cb) => {\n        each(\n          [this.blocks, this.keys, this.datastore],\n          (store, callback) => store.close(callback),\n          cb)\n      },\n      (cb) => {\n        log('unlocking')\n        this.closed = true\n        this.lockfile.close(cb)\n      },\n      (cb) => {\n        this.lockfile = null\n        cb()\n      }\n    ], (err) => callback(err))\n  }\n\n  /**\n   * Check if a repo exists.\n   *\n   * @param {function(Error, bool)} callback\n   * @returns {void}\n   */\n  exists (callback) {\n    this.version.exists(callback)\n  }\n\n  /**\n   * Get repo status.\n   *\n   * @param {Object}  options\n   * @param {Boolean} options.human\n   * @param {function(Error, Object)} callback\n   * @return {void}\n   */\n  stat (options, callback) {\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    options = Object.assign({}, {human: false}, options)\n\n    parallel({\n      storageMax: (cb) => this.config.get('Datastore.StorageMax', (err, max) => {\n        if (err) {\n          cb(null, new Big(noLimit))\n        } else {\n          cb(null, new Big(max))\n        }\n      }),\n      version: (cb) => this.version.get(cb),\n      blocks: (cb) => this.blocks.query({}, (err, list) => {\n        list = list || []\n\n        const count = new Big(list.length)\n        let size = new Big(0)\n\n        list.forEach(block => {\n          size = size\n            .plus(block.value.byteLength)\n            .plus(block.key._buf.byteLength)\n        })\n\n        cb(err, {\n          count: count,\n          size: size\n        })\n      }),\n      datastore: (cb) => getSize(this.datastore, cb),\n      keys: (cb) => getSize(this.keys, cb)\n    }, (err, results) => {\n      if (err) return callback(err)\n\n      let size = results.blocks.size\n        .plus(results.datastore)\n        .plus(results.keys)\n\n      if (options.human) {\n        size = size.div(1048576)\n      }\n\n      callback(null, {\n        repoPath: this.path,\n        storageMax: results.storageMax,\n        version: results.version,\n        numObjects: results.blocks.count,\n        repoSize: size\n      })\n    })\n  }\n}\n\nfunction getSize (queryFn, callback) {\n  pull(\n    queryFn.query({}),\n    pull.reduce((sum, block) => {\n      return sum\n        .plus(block.value.byteLength)\n        .plus(block.key._buf.byteLength)\n    }, new Big(0), callback))\n}\n\nmodule.exports = IpfsRepo\nmodule.exports.repoVersion = repoVersion\n\nfunction ignoringIf (cond, cb) {\n  return (err) => {\n    cb(err && !cond(err) ? err : null)\n  }\n}\nfunction ignoringAlreadyOpened (cb) {\n  return ignoringIf((err) => err.message === 'Already open', cb)\n}\n\nfunction ignoringNotFound (cb) {\n  return ignoringIf((err) => err.message.startsWith('ENOENT'), cb)\n}\n\nfunction buildOptions (_options) {\n  const options = Object.assign({}, defaultOptions, _options)\n\n  options.storageBackends = Object.assign(\n    {},\n    defaultOptions.storageBackends,\n    options.storageBackends)\n\n  options.storageBackendOptions = Object.assign(\n    {},\n    defaultOptions.storageBackendOptions,\n    options.storageBackendOptions)\n\n  return options\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/index.js\n// module id = 267\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = class Dir {\n  constructor (props, _options) {\n    this._options = _options || {}\n    Object.assign(this, props)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/dir.js\n// module id = 268\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/dir.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(32)\nconst assert = __webpack_require__(16)\n\nclass DAGNode {\n  constructor (data, links, serialized, multihash) {\n    assert(serialized, 'DAGNode needs its serialized format')\n    assert(multihash, 'DAGNode needs its multihash')\n\n    if (typeof multihash === 'string') {\n      multihash = mh.fromB58String(multihash)\n    }\n\n    this._data = data || Buffer.alloc(0)\n    this._links = links || []\n    this._serialized = serialized\n    this._multihash = multihash\n\n    this._size = this.links.reduce((sum, l) => sum + l.size, this.serialized.length)\n\n    this._json = {\n      data: this.data,\n      links: this.links.map((l) => l.toJSON()),\n      multihash: mh.toB58String(this.multihash),\n      size: this.size\n    }\n  }\n\n  toJSON () {\n    return this._json\n  }\n\n  toString () {\n    const mhStr = mh.toB58String(this.multihash)\n    return `DAGNode <${mhStr} - data: \"${this.data.toString()}\", links: ${this.links.length}, size: ${this.size}>`\n  }\n\n  get data () {\n    return this._data\n  }\n\n  set data (data) {\n    throw new Error(\"Can't set property: 'data' is immutable\")\n  }\n\n  get links () {\n    return this._links\n  }\n\n  set links (links) {\n    throw new Error(\"Can't set property: 'links' is immutable\")\n  }\n\n  get serialized () {\n    return this._serialized\n  }\n\n  set serialized (serialized) {\n    throw new Error(\"Can't set property: 'serialized' is immutable\")\n  }\n\n  get size () {\n    return this._size\n  }\n\n  set size (size) {\n    throw new Error(\"Can't set property: 'size' is immutable\")\n  }\n\n  get multihash () {\n    return this._multihash\n  }\n\n  set multihash (multihash) {\n    throw new Error(\"Can't set property: 'multihash' is immutable\")\n  }\n}\n\nexports = module.exports = DAGNode\nexports.create = __webpack_require__(189)\nexports.clone = __webpack_require__(938)\nexports.addLink = __webpack_require__(937)\nexports.rmLink = __webpack_require__(939)\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/index.js\n// module id = 269\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst CID = __webpack_require__(14)\nconst protons = __webpack_require__(64)\nconst proto = protons(__webpack_require__(940))\nconst DAGLink = __webpack_require__(96)\nconst DAGNode = __webpack_require__(269)\n\nexports = module.exports\n\nfunction cid (node, callback) {\n  if (node.multihash) {\n    return callback(null, new CID(node.multihash))\n  }\n  callback(new Error('not valid dagPB node'))\n}\n\nfunction serialize (node, callback) {\n  let serialized\n\n  // If the node is not an instance of a DAGNode, the link.hash might be a Base58 encoded string; decode it\n  if (node.constructor.name !== 'DAGNode' && node.links) {\n    node.links = node.links.map((link) => {\n      return DAGLink.util.isDagLink(link) ? link : DAGLink.util.createDagLinkFromB58EncodedHash(link)\n    })\n  }\n\n  try {\n    serialized = proto.PBNode.encode(toProtoBuf(node))\n  } catch (err) {\n    return callback(err)\n  }\n\n  callback(null, serialized)\n}\n\nfunction deserialize (data, callback) {\n  const pbn = proto.PBNode.decode(data)\n\n  const links = pbn.Links.map((link) => {\n    return new DAGLink(link.Name, link.Tsize, link.Hash)\n  })\n\n  const buf = pbn.Data == null ? Buffer.alloc(0) : Buffer.from(pbn.Data)\n\n  DAGNode.create(buf, links, callback)\n}\n\nfunction toProtoBuf (node) {\n  const pbn = {}\n\n  if (node.data && node.data.length > 0) {\n    pbn.Data = node.data\n  } else {\n    // NOTE: this has to be null in order to match go-ipfs serialization `null !== new Buffer(0)`\n    pbn.Data = null\n  }\n\n  if (node.links && node.links.length > 0) {\n    pbn.Links = node.links.map((link) => {\n      return {\n        Hash: link.multihash,\n        Name: link.name,\n        Tsize: link.size\n      }\n    })\n  } else {\n    pbn.Links = null\n  }\n\n  return pbn\n}\n\nexports.serialize = serialize\nexports.deserialize = deserialize\nexports.cid = cid\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/util.js\n// module id = 270\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nconst each = __webpack_require__(41)\nconst waterfall = __webpack_require__(12)\nconst asyncify = __webpack_require__(161)\nconst rlp = __webpack_require__(155)\nconst EthTrieNode = __webpack_require__(1096)\nconst cidFromHash = __webpack_require__(142)\n// const createBaseTrieResolver = require('./createBaseTrieResolver.js')\nconst createResolver = __webpack_require__(144)\nconst isExternalLink = __webpack_require__(947)\nconst createUtil = __webpack_require__(424)\nconst createIsLink = __webpack_require__(423)\nconst cidFromEthObj = __webpack_require__(422)\n\n\nmodule.exports = createTrieResolver\n\nfunction createTrieResolver(multicodec, leafResolver){\n  const baseTrie = createResolver(multicodec, EthTrieNode, mapFromEthObj)\n  baseTrie.util.deserialize = asyncify((serialized) => {\n    const rawNode = rlp.decode(serialized)\n    const trieNode = new EthTrieNode(rawNode)\n    return trieNode\n  })\n\n  return baseTrie\n\n  // create map using both baseTrie and leafResolver\n  function mapFromEthObj (trieNode, options, callback) {\n    // expand from merkle-patricia-tree using leafResolver\n    mapFromBaseTrie(trieNode, options, (err, basePaths) => {\n      if (err) return callback(err)\n      if (!leafResolver) return callback(null, basePaths)\n      // expand children\n      let paths = basePaths.slice()\n      const leafTerminatingPaths = basePaths.filter(child => Buffer.isBuffer(child.value))\n      each(leafTerminatingPaths, (child, cb) => {\n        return waterfall([\n          (cb) => leafResolver.util.deserialize(child.value, cb),\n          (ethObj, cb) => leafResolver.resolver._mapFromEthObject(ethObj, options, cb)\n        ], (err, grandChildren) => {\n          if (err) return cb(err)\n          // add prefix to grandchildren\n          grandChildren.forEach((grandChild) => {\n            paths.push({\n              path: child.path + '/' + grandChild.path,\n              value: grandChild.value,\n            })\n          })\n          cb()\n        })\n      }, (err) => {\n        if (err) return callback(err)\n        callback(null, paths)\n      })\n    })\n  }\n\n  // create map from merkle-patricia-tree nodes\n  function mapFromBaseTrie (trieNode, options, callback) {\n    let paths = []\n\n    if (trieNode.type === 'leaf') {\n      // leaf nodes resolve to their actual value\n      paths.push({\n        path: nibbleToPath(trieNode.getKey()),\n        value: trieNode.getValue()\n      })\n    }\n\n    each(trieNode.getChildren(), (childData, next) => {\n      const key = nibbleToPath(childData[0])\n      const value = childData[1]\n      if (EthTrieNode.isRawNode(value)) {\n        // inline child root\n        const childNode = new EthTrieNode(value)\n        paths.push({\n          path: key,\n          value: childNode\n        })\n        // inline child non-leaf subpaths\n        mapFromBaseTrie(childNode, options, (err, subtree) => {\n          if (err) return next(err)\n          subtree.forEach((path) => {\n            path.path = key + '/' + path.path\n          })\n          paths = paths.concat(subtree)\n          next()\n        })\n      } else {\n        // other nodes link by hash\n        let link = { '/': cidFromHash(multicodec, value).toBaseEncodedString() }\n        paths.push({\n          path: key,\n          value: link\n        })\n        next()\n      }\n    }, (err) => {\n      if (err) return callback(err)\n      callback(null, paths)\n    })\n  }\n}\n\nfunction nibbleToPath (data) {\n  return data.map((num) => num.toString(16)).join('/')\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/createTrieResolver.js\n// module id = 271\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/createTrieResolver.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst lp = __webpack_require__(45)\nconst handshake = __webpack_require__(102)\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:circuit:stream-handler')\nlog.err = debug('libp2p:circuit:error:stream-handler')\n\nclass StreamHandler {\n  /**\n   * Create a stream handler for connection\n   *\n   * @param {Connection} conn - connection to read/write\n   * @param {Function|undefined} cb - handshake callback called on error\n   * @param {Number} timeout - handshake timeout\n   * @param {Number} maxLength - max bytes length of message\n   */\n  constructor (conn, cb, timeout, maxLength) {\n    this.conn = conn\n    this.stream = null\n    this.shake = null\n    this.timeout = cb || 1000 * 60\n    this.maxLength = maxLength || 4096\n\n    if (typeof cb === 'function') {\n      this.timeout = timeout || 1000 * 60\n    }\n\n    this.stream = handshake({timeout: this.timeout}, cb)\n    this.shake = this.stream.handshake\n\n    pull(this.stream, conn, this.stream)\n  }\n\n  isValid () {\n    return this.conn && this.shake && this.stream\n  }\n\n  /**\n   * Read and decode message\n   *\n   * @param {Function} cb\n   * @returns {void|Function}\n   */\n  read (cb) {\n    if (!this.isValid()) {\n      cb(new Error(`handler is not in a valid state`))\n    }\n\n    lp.decodeFromReader(this.shake, {maxLength: this.maxLength}, (err, msg) => {\n      if (err) {\n        log.err(err)\n        // this.shake.abort(err)\n        return cb(err)\n      }\n\n      return cb(null, msg)\n    })\n  }\n\n  /**\n   * Encode and write array of buffers\n   *\n   * @param {Buffer[]} msg\n   * @param {Function} [cb]\n   * @returns {Function}\n   */\n  write (msg, cb) {\n    cb = cb || (() => {})\n\n    if (!this.isValid()) {\n      cb(new Error(`handler is not in a valid state`))\n    }\n\n    pull(\n      pull.values([msg]),\n      lp.encode(),\n      pull.collect((err, encoded) => {\n        if (err) {\n          log.err(err)\n          this.shake.abort(err)\n          return cb(err)\n        }\n\n        encoded.forEach((e) => this.shake.write(e))\n        cb()\n      })\n    )\n  }\n\n  /**\n   * Get the raw Connection\n   *\n   * @returns {null|Connection|*}\n   */\n  getRawConn () {\n    return this.conn\n  }\n\n  /**\n   * Return the handshake rest stream and invalidate handler\n   *\n   * @return {*|{source, sink}}\n   */\n  rest () {\n    const rest = this.shake.rest()\n\n    this.conn = null\n    this.stream = null\n    this.shake = null\n    return rest\n  }\n}\n\nmodule.exports = StreamHandler\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit/stream-handler.js\n// module id = 272\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit/stream-handler.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  relay: '/libp2p/circuit/relay/0.1.0'\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/multicodec.js\n// module id = 273\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/multicodec.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = `enum KeyType {\n  RSA = 0;\n  Ed25519 = 1;\n  Secp256k1 = 2;\n}\nmessage PublicKey {\n  required KeyType Type = 1;\n  required bytes Data = 2;\n}\nmessage PrivateKey {\n  required KeyType Type = 1;\n  required bytes Data = 2;\n}`\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/keys.proto.js\n// module id = 274\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/keys.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// Based on npmjs.com/nodeify but without additional `nextTick` calls\n// to keep the overhead low\nmodule.exports = function nodeify (promise, cb) {\n  return promise.then((res) => {\n    cb(null, res)\n  }, (err) => {\n    cb(err)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/nodeify.js\n// module id = 275\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/nodeify.js")},function(module,exports,__webpack_require__){"use strict";eval("/* global self */\n\n\n\nmodule.exports = () => {\n  // This is only a shim for interfaces, not for functionality\n  if (typeof self !== 'undefined') {\n    __webpack_require__(1298)(self)\n\n    if (self.crypto) {\n      return self.crypto\n    }\n  }\n\n  throw new Error('Please use an environment with crypto support')\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/webcrypto.js\n// module id = 276\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/webcrypto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  PROTOCOL: '/ipfs/ping/1.0.0',\n  PING_LENGTH: 32\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-ping/src/constants.js\n// module id = 277\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-ping/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst protons = __webpack_require__(64)\nconst PeerId = __webpack_require__(26)\nconst crypto = __webpack_require__(79)\nconst parallel = __webpack_require__(85)\nconst waterfall = __webpack_require__(12)\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:secio')\nlog.error = debug('libp2p:secio:error')\n\nconst pbm = protons(__webpack_require__(1020))\n\nconst support = __webpack_require__(279)\n\n// nonceSize is the size of our nonces (in bytes)\nconst nonceSize = 16\n\nexports.createProposal = (state) => {\n  state.proposal.out = {\n    rand: crypto.randomBytes(nonceSize),\n    pubkey: state.key.local.public.bytes,\n    exchanges: support.exchanges.join(','),\n    ciphers: support.ciphers.join(','),\n    hashes: support.hashes.join(',')\n  }\n\n  state.proposalEncoded.out = pbm.Propose.encode(state.proposal.out)\n  return state.proposalEncoded.out\n}\n\nexports.createExchange = (state, callback) => {\n  crypto.keys.generateEphemeralKeyPair(state.protocols.local.curveT, (err, res) => {\n    if (err) {\n      return callback(err)\n    }\n\n    state.ephemeralKey.local = res.key\n    state.shared.generate = res.genSharedKey\n\n    // Gather corpus to sign.\n    const selectionOut = Buffer.concat([\n      state.proposalEncoded.out,\n      state.proposalEncoded.in,\n      state.ephemeralKey.local\n    ])\n\n    state.key.local.sign(selectionOut, (err, sig) => {\n      if (err) {\n        return callback(err)\n      }\n\n      state.exchange.out = {\n        epubkey: state.ephemeralKey.local,\n        signature: sig\n      }\n\n      callback(null, pbm.Exchange.encode(state.exchange.out))\n    })\n  })\n}\n\nexports.identify = (state, msg, callback) => {\n  log('1.1 identify')\n\n  state.proposalEncoded.in = msg\n  state.proposal.in = pbm.Propose.decode(msg)\n  const pubkey = state.proposal.in.pubkey\n\n  state.key.remote = crypto.keys.unmarshalPublicKey(pubkey)\n\n  PeerId.createFromPubKey(pubkey.toString('base64'), (err, remoteId) => {\n    if (err) {\n      return callback(err)\n    }\n\n    // If we know who we are dialing to, double check\n    if (state.id.remote) {\n      if (state.id.remote.toB58String() !== remoteId.toB58String()) {\n        return callback(new Error('dialed to the wrong peer, Ids do not match'))\n      }\n    } else {\n      state.id.remote = remoteId\n    }\n\n    log('1.1 identify - %s - identified remote peer as %s', state.id.local.toB58String(), state.id.remote.toB58String())\n    callback()\n  })\n}\n\nexports.selectProtocols = (state, callback) => {\n  log('1.2 selection')\n\n  const local = {\n    pubKeyBytes: state.key.local.public.bytes,\n    exchanges: support.exchanges,\n    hashes: support.hashes,\n    ciphers: support.ciphers,\n    nonce: state.proposal.out.rand\n  }\n\n  const remote = {\n    pubKeyBytes: state.proposal.in.pubkey,\n    exchanges: state.proposal.in.exchanges.split(','),\n    hashes: state.proposal.in.hashes.split(','),\n    ciphers: state.proposal.in.ciphers.split(','),\n    nonce: state.proposal.in.rand\n  }\n\n  support.selectBest(local, remote, (err, selected) => {\n    if (err) {\n      return callback(err)\n    }\n    // we use the same params for both directions (must choose same curve)\n    // WARNING: if they dont SelectBest the same way, this won't work...\n    state.protocols.remote = {\n      order: selected.order,\n      curveT: selected.curveT,\n      cipherT: selected.cipherT,\n      hashT: selected.hashT\n    }\n\n    state.protocols.local = {\n      order: selected.order,\n      curveT: selected.curveT,\n      cipherT: selected.cipherT,\n      hashT: selected.hashT\n    }\n    callback()\n  })\n}\n\nexports.verify = (state, msg, callback) => {\n  log('2.1. verify')\n\n  state.exchange.in = pbm.Exchange.decode(msg)\n  state.ephemeralKey.remote = state.exchange.in.epubkey\n\n  const selectionIn = Buffer.concat([\n    state.proposalEncoded.in,\n    state.proposalEncoded.out,\n    state.ephemeralKey.remote\n  ])\n\n  state.key.remote.verify(selectionIn, state.exchange.in.signature, (err, sigOk) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (!sigOk) {\n      return callback(new Error('Bad signature'))\n    }\n\n    log('2.1. verify - signature verified')\n    callback()\n  })\n}\n\nexports.generateKeys = (state, callback) => {\n  log('2.2. keys')\n\n  waterfall([\n    (cb) => state.shared.generate(state.exchange.in.epubkey, cb),\n    (secret, cb) => {\n      state.shared.secret = secret\n\n      crypto.keys.keyStretcher(\n        state.protocols.local.cipherT,\n        state.protocols.local.hashT,\n        state.shared.secret,\n        cb\n      )\n    },\n    (keys, cb) => {\n      // use random nonces to decide order.\n      if (state.protocols.local.order > 0) {\n        state.protocols.local.keys = keys.k1\n        state.protocols.remote.keys = keys.k2\n      } else if (state.protocols.local.order < 0) {\n        // swap\n        state.protocols.local.keys = keys.k2\n        state.protocols.remote.keys = keys.k1\n      } else {\n        // we should've bailed before state. but if not, bail here.\n        return cb(new Error('you are trying to talk to yourself'))\n      }\n\n      log('2.3. mac + cipher')\n\n      parallel([\n        (_cb) => support.makeMacAndCipher(state.protocols.local, _cb),\n        (_cb) => support.makeMacAndCipher(state.protocols.remote, _cb)\n      ], cb)\n    }\n  ], callback)\n}\n\nexports.verifyNonce = (state, n2) => {\n  const n1 = state.proposal.out.rand\n\n  if (n1.equals(n2)) return\n\n  throw new Error(\n    `Failed to read our encrypted nonce: ${n1.toString('hex')} != ${n2.toString('hex')}`\n  )\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/crypto.js\n// module id = 278\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/crypto.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(49)\nconst lp = __webpack_require__(45)\nconst pull = __webpack_require__(6)\nconst crypto = __webpack_require__(79)\nconst parallel = __webpack_require__(85)\n\nexports.exchanges = [\n  'P-256',\n  'P-384',\n  'P-521'\n]\n\nexports.ciphers = [\n  'AES-256',\n  'AES-128'\n]\n\nexports.hashes = [\n  'SHA256',\n  'SHA512'\n]\n\n// Determines which algorithm to use.  Note:  f(a, b) = f(b, a)\nexports.theBest = (order, p1, p2) => {\n  let first\n  let second\n\n  if (order < 0) {\n    first = p2\n    second = p1\n  } else if (order > 0) {\n    first = p1\n    second = p2\n  } else {\n    return p1[0]\n  }\n\n  for (let firstCandidate of first) {\n    for (let secondCandidate of second) {\n      if (firstCandidate === secondCandidate) {\n        return firstCandidate\n      }\n    }\n  }\n\n  throw new Error('No algorithms in common!')\n}\n\nexports.makeMacAndCipher = (target, callback) => {\n  parallel([\n    (cb) => makeMac(target.hashT, target.keys.macKey, cb),\n    (cb) => makeCipher(target.cipherT, target.keys.iv, target.keys.cipherKey, cb)\n  ], (err, macAndCipher) => {\n    if (err) {\n      return callback(err)\n    }\n\n    target.mac = macAndCipher[0]\n    target.cipher = macAndCipher[1]\n    callback()\n  })\n}\n\nfunction makeMac (hash, key, callback) {\n  crypto.hmac.create(hash, key, callback)\n}\n\nfunction makeCipher (cipherType, iv, key, callback) {\n  if (cipherType === 'AES-128' || cipherType === 'AES-256') {\n    return crypto.aes.create(key, iv, callback)\n  }\n\n  // TODO: figure out if Blowfish is needed and if so find a library for it.\n  callback(new Error(`unrecognized cipher type: ${cipherType}`))\n}\n\nexports.selectBest = (local, remote, cb) => {\n  exports.digest(Buffer.concat([\n    remote.pubKeyBytes,\n    local.nonce\n  ]), (err, oh1) => {\n    if (err) {\n      return cb(err)\n    }\n\n    exports.digest(Buffer.concat([\n      local.pubKeyBytes,\n      remote.nonce\n    ]), (err, oh2) => {\n      if (err) {\n        return cb(err)\n      }\n\n      const order = Buffer.compare(oh1, oh2)\n\n      if (order === 0) {\n        return cb(new Error('you are trying to talk to yourself'))\n      }\n\n      cb(null, {\n        curveT: exports.theBest(order, local.exchanges, remote.exchanges),\n        cipherT: exports.theBest(order, local.ciphers, remote.ciphers),\n        hashT: exports.theBest(order, local.hashes, remote.hashes),\n        order\n      })\n    })\n  })\n}\n\nexports.digest = (buf, cb) => {\n  mh.digest(buf, 'sha2-256', buf.length, cb)\n}\n\nexports.write = function write (state, msg, cb) {\n  cb = cb || (() => {})\n  pull(\n    pull.values([msg]),\n    lp.encode({fixed: true, bytes: 4}),\n    pull.collect((err, res) => {\n      if (err) {\n        return cb(err)\n      }\n      state.shake.write(res[0])\n      cb()\n    })\n  )\n}\n\nexports.read = function read (reader, cb) {\n  lp.decodeFromReader(reader, {fixed: true, bytes: 4}, cb)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/support.js\n// module id = 279\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/support.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n  var index = -1,\n      result = isArrayLike(collection) ? Array(collection.length) : [];\n\n  baseEach(collection, function(value, key, collection) {\n    result[++index] = iteratee(value, key, collection);\n  });\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    if (collection == null) {\n      return collection;\n    }\n    if (!isArrayLike(collection)) {\n      return eachFunc(collection, iteratee);\n    }\n    var length = collection.length,\n        index = fromRight ? length : -1,\n        iterable = Object(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n *   return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n *   { 'user': 'barney' },\n *   { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\nfunction map(collection, iteratee) {\n  var func = isArray(collection) ? arrayMap : baseMap;\n  return func(collection, baseIteratee(iteratee, 3));\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = map;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.map/index.js\n// module id = 280\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.map/index.js")},function(module,exports){eval("/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  return arrayMap(props, function(key) {\n    return object[key];\n  });\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return object ? baseValues(object, keys(object)) : [];\n}\n\nmodule.exports = values;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.values/index.js\n// module id = 281\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.values/index.js")},function(module,exports,__webpack_require__){eval("var Symbol = __webpack_require__(458),\n    getRawTag = __webpack_require__(1070),\n    objectToString = __webpack_require__(1077);\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseGetTag.js\n// module id = 282\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseGetTag.js")},function(module,exports,__webpack_require__){eval("var freeGlobal = __webpack_require__(462);\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_root.js\n// module id = 283\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_root.js")},function(module,exports){eval("/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\nmodule.exports = identity;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/identity.js\n// module id = 284\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/identity.js")},function(module,exports){eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isArray.js\n// module id = 285\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isArray.js")},function(module,exports){eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isObjectLike.js\n// module id = 286\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isObjectLike.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst map = __webpack_require__(280)\n\nfunction Protocols (proto) {\n  if (typeof (proto) === 'number') {\n    if (Protocols.codes[proto]) {\n      return Protocols.codes[proto]\n    }\n\n    throw new Error('no protocol with code: ' + proto)\n  } else if (typeof (proto) === 'string' || proto instanceof String) {\n    if (Protocols.names[proto]) {\n      return Protocols.names[proto]\n    }\n\n    throw new Error('no protocol with name: ' + proto)\n  }\n\n  throw new Error('invalid protocol id type: ' + proto)\n}\n\nconst V = -1\nProtocols.lengthPrefixedVarSize = V\nProtocols.V = V\n\nProtocols.table = [\n  [4, 32, 'ip4'],\n  [6, 16, 'tcp'],\n  [17, 16, 'udp'],\n  [33, 16, 'dccp'],\n  [41, 128, 'ip6'],\n  [54, V, 'dns4', 'resolvable'],\n  [55, V, 'dns6', 'resolvable'],\n  [56, V, 'dnsaddr', 'resolvable'],\n  [132, 16, 'sctp'],\n  // all of the below use varint for size\n  [302, 0, 'utp'],\n  [421, Protocols.lengthPrefixedVarSize, 'ipfs'],\n  [480, 0, 'http'],\n  [443, 0, 'https'],\n  [477, 0, 'ws'],\n  [478, 0, 'wss'],\n  [479, 0, 'p2p-websocket-star'],\n  [275, 0, 'p2p-webrtc-star'],\n  [276, 0, 'p2p-webrtc-direct'],\n  [290, 0, 'p2p-circuit']\n]\n\nProtocols.names = {}\nProtocols.codes = {}\n\n// populate tables\nmap(Protocols.table, function (row) {\n  const proto = p.apply(null, row)\n  Protocols.codes[proto.code] = proto\n  Protocols.names[proto.name] = proto\n})\n\nProtocols.object = p\n\nfunction p (code, size, name, resolvable) {\n  return {\n    code: code,\n    size: size,\n    name: name,\n    resolvable: Boolean(resolvable)\n  }\n}\n\nmodule.exports = Protocols\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiaddr/src/protocols-table.js\n// module id = 287\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiaddr/src/protocols-table.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.Listener = exports.listener = __webpack_require__(1118)\nexports.Dialer = exports.dialer = __webpack_require__(1117)\nexports.matchSemver = __webpack_require__(1120)\nexports.matchExact = __webpack_require__(479)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/index.js\n// module id = 288\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/index.js")},function(module,exports,__webpack_require__){eval("/**\n * Cipher base API.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\nmodule.exports = forge.cipher = forge.cipher || {};\n\n// registered algorithms\nforge.cipher.algorithms = forge.cipher.algorithms || {};\n\n/**\n * Creates a cipher object that can be used to encrypt data using the given\n * algorithm and key. The algorithm may be provided as a string value for a\n * previously registered algorithm or it may be given as a cipher algorithm\n * API object.\n *\n * @param algorithm the algorithm to use, either a string or an algorithm API\n *          object.\n * @param key the key to use, as a binary-encoded string of bytes or a\n *          byte buffer.\n *\n * @return the cipher.\n */\nforge.cipher.createCipher = function(algorithm, key) {\n  var api = algorithm;\n  if(typeof api === 'string') {\n    api = forge.cipher.getAlgorithm(api);\n    if(api) {\n      api = api();\n    }\n  }\n  if(!api) {\n    throw new Error('Unsupported algorithm: ' + algorithm);\n  }\n\n  // assume block cipher\n  return new forge.cipher.BlockCipher({\n    algorithm: api,\n    key: key,\n    decrypt: false\n  });\n};\n\n/**\n * Creates a decipher object that can be used to decrypt data using the given\n * algorithm and key. The algorithm may be provided as a string value for a\n * previously registered algorithm or it may be given as a cipher algorithm\n * API object.\n *\n * @param algorithm the algorithm to use, either a string or an algorithm API\n *          object.\n * @param key the key to use, as a binary-encoded string of bytes or a\n *          byte buffer.\n *\n * @return the cipher.\n */\nforge.cipher.createDecipher = function(algorithm, key) {\n  var api = algorithm;\n  if(typeof api === 'string') {\n    api = forge.cipher.getAlgorithm(api);\n    if(api) {\n      api = api();\n    }\n  }\n  if(!api) {\n    throw new Error('Unsupported algorithm: ' + algorithm);\n  }\n\n  // assume block cipher\n  return new forge.cipher.BlockCipher({\n    algorithm: api,\n    key: key,\n    decrypt: true\n  });\n};\n\n/**\n * Registers an algorithm by name. If the name was already registered, the\n * algorithm API object will be overwritten.\n *\n * @param name the name of the algorithm.\n * @param algorithm the algorithm API object.\n */\nforge.cipher.registerAlgorithm = function(name, algorithm) {\n  name = name.toUpperCase();\n  forge.cipher.algorithms[name] = algorithm;\n};\n\n/**\n * Gets a registered algorithm by name.\n *\n * @param name the name of the algorithm.\n *\n * @return the algorithm, if found, null if not.\n */\nforge.cipher.getAlgorithm = function(name) {\n  name = name.toUpperCase();\n  if(name in forge.cipher.algorithms) {\n    return forge.cipher.algorithms[name];\n  }\n  return null;\n};\n\nvar BlockCipher = forge.cipher.BlockCipher = function(options) {\n  this.algorithm = options.algorithm;\n  this.mode = this.algorithm.mode;\n  this.blockSize = this.mode.blockSize;\n  this._finish = false;\n  this._input = null;\n  this.output = null;\n  this._op = options.decrypt ? this.mode.decrypt : this.mode.encrypt;\n  this._decrypt = options.decrypt;\n  this.algorithm.initialize(options);\n};\n\n/**\n * Starts or restarts the encryption or decryption process, whichever\n * was previously configured.\n *\n * For non-GCM mode, the IV may be a binary-encoded string of bytes, an array\n * of bytes, a byte buffer, or an array of 32-bit integers. If the IV is in\n * bytes, then it must be Nb (16) bytes in length. If the IV is given in as\n * 32-bit integers, then it must be 4 integers long.\n *\n * Note: an IV is not required or used in ECB mode.\n *\n * For GCM-mode, the IV must be given as a binary-encoded string of bytes or\n * a byte buffer. The number of bytes should be 12 (96 bits) as recommended\n * by NIST SP-800-38D but another length may be given.\n *\n * @param options the options to use:\n *          iv the initialization vector to use as a binary-encoded string of\n *            bytes, null to reuse the last ciphered block from a previous\n *            update() (this \"residue\" method is for legacy support only).\n *          additionalData additional authentication data as a binary-encoded\n *            string of bytes, for 'GCM' mode, (default: none).\n *          tagLength desired length of authentication tag, in bits, for\n *            'GCM' mode (0-128, default: 128).\n *          tag the authentication tag to check if decrypting, as a\n *             binary-encoded string of bytes.\n *          output the output the buffer to write to, null to create one.\n */\nBlockCipher.prototype.start = function(options) {\n  options = options || {};\n  var opts = {};\n  for(var key in options) {\n    opts[key] = options[key];\n  }\n  opts.decrypt = this._decrypt;\n  this._finish = false;\n  this._input = forge.util.createBuffer();\n  this.output = options.output || forge.util.createBuffer();\n  this.mode.start(opts);\n};\n\n/**\n * Updates the next block according to the cipher mode.\n *\n * @param input the buffer to read from.\n */\nBlockCipher.prototype.update = function(input) {\n  if(input) {\n    // input given, so empty it into the input buffer\n    this._input.putBuffer(input);\n  }\n\n  // do cipher operation until it needs more input and not finished\n  while(!this._op.call(this.mode, this._input, this.output, this._finish) &&\n    !this._finish) {}\n\n  // free consumed memory from input buffer\n  this._input.compact();\n};\n\n/**\n * Finishes encrypting or decrypting.\n *\n * @param pad a padding function to use in CBC mode, null for default,\n *          signature(blockSize, buffer, decrypt).\n *\n * @return true if successful, false on error.\n */\nBlockCipher.prototype.finish = function(pad) {\n  // backwards-compatibility w/deprecated padding API\n  // Note: will overwrite padding functions even after another start() call\n  if(pad && (this.mode.name === 'ECB' || this.mode.name === 'CBC')) {\n    this.mode.pad = function(input) {\n      return pad(this.blockSize, input, false);\n    };\n    this.mode.unpad = function(output) {\n      return pad(this.blockSize, output, true);\n    };\n  }\n\n  // build options for padding and afterFinish functions\n  var options = {};\n  options.decrypt = this._decrypt;\n\n  // get # of bytes that won't fill a block\n  options.overflow = this._input.length() % this.blockSize;\n\n  if(!this._decrypt && this.mode.pad) {\n    if(!this.mode.pad(this._input, options)) {\n      return false;\n    }\n  }\n\n  // do final update\n  this._finish = true;\n  this.update();\n\n  if(this._decrypt && this.mode.unpad) {\n    if(!this.mode.unpad(this.output, options)) {\n      return false;\n    }\n  }\n\n  if(this.mode.afterFinish) {\n    if(!this.mode.afterFinish(this.output, options)) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/cipher.js\n// module id = 289\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/cipher.js")},function(module,exports,__webpack_require__){eval("/**\n * Message Digest Algorithm 5 with 128-bit digest (MD5) implementation.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(72);\n__webpack_require__(9);\n\nvar md5 = module.exports = forge.md5 = forge.md5 || {};\nforge.md.md5 = forge.md.algorithms.md5 = md5;\n\n/**\n * Creates an MD5 message digest object.\n *\n * @return a message digest object.\n */\nmd5.create = function() {\n  // do initialization as necessary\n  if(!_initialized) {\n    _init();\n  }\n\n  // MD5 state contains four 32-bit integers\n  var _state = null;\n\n  // input buffer\n  var _input = forge.util.createBuffer();\n\n  // used for word storage\n  var _w = new Array(16);\n\n  // message digest object\n  var md = {\n    algorithm: 'md5',\n    blockLength: 64,\n    digestLength: 16,\n    // 56-bit length of message so far (does not including padding)\n    messageLength: 0,\n    // true message length\n    fullMessageLength: null,\n    // size of message length in bytes\n    messageLengthSize: 8\n  };\n\n  /**\n   * Starts the digest.\n   *\n   * @return this digest object.\n   */\n  md.start = function() {\n    // up to 56-bit message length for convenience\n    md.messageLength = 0;\n\n    // full message length (set md.messageLength64 for backwards-compatibility)\n    md.fullMessageLength = md.messageLength64 = [];\n    var int32s = md.messageLengthSize / 4;\n    for(var i = 0; i < int32s; ++i) {\n      md.fullMessageLength.push(0);\n    }\n    _input = forge.util.createBuffer();\n    _state = {\n      h0: 0x67452301,\n      h1: 0xEFCDAB89,\n      h2: 0x98BADCFE,\n      h3: 0x10325476\n    };\n    return md;\n  };\n  // start digest automatically for first time\n  md.start();\n\n  /**\n   * Updates the digest with the given message input. The given input can\n   * treated as raw input (no encoding will be applied) or an encoding of\n   * 'utf8' maybe given to encode the input using UTF-8.\n   *\n   * @param msg the message input to update with.\n   * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n   *\n   * @return this digest object.\n   */\n  md.update = function(msg, encoding) {\n    if(encoding === 'utf8') {\n      msg = forge.util.encodeUtf8(msg);\n    }\n\n    // update message length\n    var len = msg.length;\n    md.messageLength += len;\n    len = [(len / 0x100000000) >>> 0, len >>> 0];\n    for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n      md.fullMessageLength[i] += len[1];\n      len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n      md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n      len[0] = (len[1] / 0x100000000) >>> 0;\n    }\n\n    // add bytes to input buffer\n    _input.putBytes(msg);\n\n    // process bytes\n    _update(_state, _w, _input);\n\n    // compact input buffer every 2K or if empty\n    if(_input.read > 2048 || _input.length() === 0) {\n      _input.compact();\n    }\n\n    return md;\n  };\n\n  /**\n   * Produces the digest.\n   *\n   * @return a byte buffer containing the digest value.\n   */\n  md.digest = function() {\n    /* Note: Here we copy the remaining bytes in the input buffer and\n    add the appropriate MD5 padding. Then we do the final update\n    on a copy of the state so that if the user wants to get\n    intermediate digests they can do so. */\n\n    /* Determine the number of bytes that must be added to the message\n    to ensure its length is congruent to 448 mod 512. In other words,\n    the data to be digested must be a multiple of 512 bits (or 128 bytes).\n    This data includes the message, some padding, and the length of the\n    message. Since the length of the message will be encoded as 8 bytes (64\n    bits), that means that the last segment of the data must have 56 bytes\n    (448 bits) of message and padding. Therefore, the length of the message\n    plus the padding must be congruent to 448 mod 512 because\n    512 - 128 = 448.\n\n    In order to fill up the message length it must be filled with\n    padding that begins with 1 bit followed by all 0 bits. Padding\n    must *always* be present, so if the message length is already\n    congruent to 448 mod 512, then 512 padding bits must be added. */\n\n    var finalBlock = forge.util.createBuffer();\n    finalBlock.putBytes(_input.bytes());\n\n    // compute remaining size to be digested (include message length size)\n    var remaining = (\n      md.fullMessageLength[md.fullMessageLength.length - 1] +\n      md.messageLengthSize);\n\n    // add padding for overflow blockSize - overflow\n    // _padding starts with 1 byte with first bit is set (byte value 128), then\n    // there may be up to (blockSize - 1) other pad bytes\n    var overflow = remaining & (md.blockLength - 1);\n    finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n    // serialize message length in bits in little-endian order; since length\n    // is stored in bytes we multiply by 8 and add carry\n    var bits, carry = 0;\n    for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n      bits = md.fullMessageLength[i] * 8 + carry;\n      carry = (bits / 0x100000000) >>> 0;\n      finalBlock.putInt32Le(bits >>> 0);\n    }\n\n    var s2 = {\n      h0: _state.h0,\n      h1: _state.h1,\n      h2: _state.h2,\n      h3: _state.h3\n    };\n    _update(s2, _w, finalBlock);\n    var rval = forge.util.createBuffer();\n    rval.putInt32Le(s2.h0);\n    rval.putInt32Le(s2.h1);\n    rval.putInt32Le(s2.h2);\n    rval.putInt32Le(s2.h3);\n    return rval;\n  };\n\n  return md;\n};\n\n// padding, constant tables for calculating md5\nvar _padding = null;\nvar _g = null;\nvar _r = null;\nvar _k = null;\nvar _initialized = false;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n  // create padding\n  _padding = String.fromCharCode(128);\n  _padding += forge.util.fillString(String.fromCharCode(0x00), 64);\n\n  // g values\n  _g = [\n    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n    1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12,\n    5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2,\n    0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9];\n\n  // rounds table\n  _r = [\n    7, 12, 17, 22,  7, 12, 17, 22,  7, 12, 17, 22,  7, 12, 17, 22,\n    5,  9, 14, 20,  5,  9, 14, 20,  5,  9, 14, 20,  5,  9, 14, 20,\n    4, 11, 16, 23,  4, 11, 16, 23,  4, 11, 16, 23,  4, 11, 16, 23,\n    6, 10, 15, 21,  6, 10, 15, 21,  6, 10, 15, 21,  6, 10, 15, 21];\n\n  // get the result of abs(sin(i + 1)) as a 32-bit integer\n  _k = new Array(64);\n  for(var i = 0; i < 64; ++i) {\n    _k[i] = Math.floor(Math.abs(Math.sin(i + 1)) * 0x100000000);\n  }\n\n  // now initialized\n  _initialized = true;\n}\n\n/**\n * Updates an MD5 state with the given byte buffer.\n *\n * @param s the MD5 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n  // consume 512 bit (64 byte) chunks\n  var t, a, b, c, d, f, r, i;\n  var len = bytes.length();\n  while(len >= 64) {\n    // initialize hash value for this chunk\n    a = s.h0;\n    b = s.h1;\n    c = s.h2;\n    d = s.h3;\n\n    // round 1\n    for(i = 0; i < 16; ++i) {\n      w[i] = bytes.getInt32Le();\n      f = d ^ (b & (c ^ d));\n      t = (a + f + _k[i] + w[i]);\n      r = _r[i];\n      a = d;\n      d = c;\n      c = b;\n      b += (t << r) | (t >>> (32 - r));\n    }\n    // round 2\n    for(; i < 32; ++i) {\n      f = c ^ (d & (b ^ c));\n      t = (a + f + _k[i] + w[_g[i]]);\n      r = _r[i];\n      a = d;\n      d = c;\n      c = b;\n      b += (t << r) | (t >>> (32 - r));\n    }\n    // round 3\n    for(; i < 48; ++i) {\n      f = b ^ c ^ d;\n      t = (a + f + _k[i] + w[_g[i]]);\n      r = _r[i];\n      a = d;\n      d = c;\n      c = b;\n      b += (t << r) | (t >>> (32 - r));\n    }\n    // round 4\n    for(; i < 64; ++i) {\n      f = c ^ (b | ~d);\n      t = (a + f + _k[i] + w[_g[i]]);\n      r = _r[i];\n      a = d;\n      d = c;\n      c = b;\n      b += (t << r) | (t >>> (32 - r));\n    }\n\n    // update hash state\n    s.h0 = (s.h0 + a) | 0;\n    s.h1 = (s.h1 + b) | 0;\n    s.h2 = (s.h2 + c) | 0;\n    s.h3 = (s.h3 + d) | 0;\n\n    len -= 64;\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/md5.js\n// module id = 290\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/md5.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Password-Based Key-Derivation Function #2 implementation.\n *\n * See RFC 2898 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(148);\n__webpack_require__(72);\n__webpack_require__(9);\n\nvar pkcs5 = forge.pkcs5 = forge.pkcs5 || {};\n\nvar crypto;\nif(forge.util.isNodejs && !forge.options.usePureJavaScript) {\n  crypto = __webpack_require__(572);\n}\n\n/**\n * Derives a key from a password.\n *\n * @param p the password as a binary-encoded string of bytes.\n * @param s the salt as a binary-encoded string of bytes.\n * @param c the iteration count, a positive integer.\n * @param dkLen the intended length, in bytes, of the derived key,\n *          (max: 2^32 - 1) * hash length of the PRF.\n * @param [md] the message digest (or algorithm identifier as a string) to use\n *          in the PRF, defaults to SHA-1.\n * @param [callback(err, key)] presence triggers asynchronous version, called\n *          once the operation completes.\n *\n * @return the derived key, as a binary-encoded string of bytes, for the\n *           synchronous version (if no callback is specified).\n */\nmodule.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(\n  p, s, c, dkLen, md, callback) {\n  if(typeof md === 'function') {\n    callback = md;\n    md = null;\n  }\n\n  // use native implementation if possible and not disabled, note that\n  // some node versions only support SHA-1, others allow digest to be changed\n  if(forge.util.isNodejs && !forge.options.usePureJavaScript &&\n    crypto.pbkdf2 && (md === null || typeof md !== 'object') &&\n    (crypto.pbkdf2Sync.length > 4 || (!md || md === 'sha1'))) {\n    if(typeof md !== 'string') {\n      // default prf to SHA-1\n      md = 'sha1';\n    }\n    p = new Buffer(p, 'binary');\n    s = new Buffer(s, 'binary');\n    if(!callback) {\n      if(crypto.pbkdf2Sync.length === 4) {\n        return crypto.pbkdf2Sync(p, s, c, dkLen).toString('binary');\n      }\n      return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString('binary');\n    }\n    if(crypto.pbkdf2Sync.length === 4) {\n      return crypto.pbkdf2(p, s, c, dkLen, function(err, key) {\n        if(err) {\n          return callback(err);\n        }\n        callback(null, key.toString('binary'));\n      });\n    }\n    return crypto.pbkdf2(p, s, c, dkLen, md, function(err, key) {\n      if(err) {\n        return callback(err);\n      }\n      callback(null, key.toString('binary'));\n    });\n  }\n\n  if(typeof md === 'undefined' || md === null) {\n    // default prf to SHA-1\n    md = 'sha1';\n  }\n  if(typeof md === 'string') {\n    if(!(md in forge.md.algorithms)) {\n      throw new Error('Unknown hash algorithm: ' + md);\n    }\n    md = forge.md[md].create();\n  }\n\n  var hLen = md.digestLength;\n\n  /* 1. If dkLen > (2^32 - 1) * hLen, output \"derived key too long\" and\n    stop. */\n  if(dkLen > (0xFFFFFFFF * hLen)) {\n    var err = new Error('Derived key is too long.');\n    if(callback) {\n      return callback(err);\n    }\n    throw err;\n  }\n\n  /* 2. Let len be the number of hLen-octet blocks in the derived key,\n    rounding up, and let r be the number of octets in the last\n    block:\n\n    len = CEIL(dkLen / hLen),\n    r = dkLen - (len - 1) * hLen. */\n  var len = Math.ceil(dkLen / hLen);\n  var r = dkLen - (len - 1) * hLen;\n\n  /* 3. For each block of the derived key apply the function F defined\n    below to the password P, the salt S, the iteration count c, and\n    the block index to compute the block:\n\n    T_1 = F(P, S, c, 1),\n    T_2 = F(P, S, c, 2),\n    ...\n    T_len = F(P, S, c, len),\n\n    where the function F is defined as the exclusive-or sum of the\n    first c iterates of the underlying pseudorandom function PRF\n    applied to the password P and the concatenation of the salt S\n    and the block index i:\n\n    F(P, S, c, i) = u_1 XOR u_2 XOR ... XOR u_c\n\n    where\n\n    u_1 = PRF(P, S || INT(i)),\n    u_2 = PRF(P, u_1),\n    ...\n    u_c = PRF(P, u_{c-1}).\n\n    Here, INT(i) is a four-octet encoding of the integer i, most\n    significant octet first. */\n  var prf = forge.hmac.create();\n  prf.start(md, p);\n  var dk = '';\n  var xor, u_c, u_c1;\n\n  // sync version\n  if(!callback) {\n    for(var i = 1; i <= len; ++i) {\n      // PRF(P, S || INT(i)) (first iteration)\n      prf.start(null, null);\n      prf.update(s);\n      prf.update(forge.util.int32ToBytes(i));\n      xor = u_c1 = prf.digest().getBytes();\n\n      // PRF(P, u_{c-1}) (other iterations)\n      for(var j = 2; j <= c; ++j) {\n        prf.start(null, null);\n        prf.update(u_c1);\n        u_c = prf.digest().getBytes();\n        // F(p, s, c, i)\n        xor = forge.util.xorBytes(xor, u_c, hLen);\n        u_c1 = u_c;\n      }\n\n      /* 4. Concatenate the blocks and extract the first dkLen octets to\n        produce a derived key DK:\n\n        DK = T_1 || T_2 ||  ...  || T_len<0..r-1> */\n      dk += (i < len) ? xor : xor.substr(0, r);\n    }\n    /* 5. Output the derived key DK. */\n    return dk;\n  }\n\n  // async version\n  var i = 1, j;\n  function outer() {\n    if(i > len) {\n      // done\n      return callback(null, dk);\n    }\n\n    // PRF(P, S || INT(i)) (first iteration)\n    prf.start(null, null);\n    prf.update(s);\n    prf.update(forge.util.int32ToBytes(i));\n    xor = u_c1 = prf.digest().getBytes();\n\n    // PRF(P, u_{c-1}) (other iterations)\n    j = 2;\n    inner();\n  }\n\n  function inner() {\n    if(j <= c) {\n      prf.start(null, null);\n      prf.update(u_c1);\n      u_c = prf.digest().getBytes();\n      // F(p, s, c, i)\n      xor = forge.util.xorBytes(xor, u_c, hLen);\n      u_c1 = u_c;\n      ++j;\n      return forge.util.setImmediate(inner);\n    }\n\n    /* 4. Concatenate the blocks and extract the first dkLen octets to\n      produce a derived key DK:\n\n      DK = T_1 || T_2 ||  ...  || T_len<0..r-1> */\n    dk += (i < len) ? xor : xor.substr(0, r);\n\n    ++i;\n    outer();\n  }\n\n  outer();\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pbkdf2.js\n// module id = 291\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pbkdf2.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of PKCS#1 PSS signature padding.\n *\n * @author Stefan Siegl\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(52);\n__webpack_require__(9);\n\n// shortcut for PSS API\nvar pss = module.exports = forge.pss = forge.pss || {};\n\n/**\n * Creates a PSS signature scheme object.\n *\n * There are several ways to provide a salt for encoding:\n *\n * 1. Specify the saltLength only and the built-in PRNG will generate it.\n * 2. Specify the saltLength and a custom PRNG with 'getBytesSync' defined that\n *   will be used.\n * 3. Specify the salt itself as a forge.util.ByteBuffer.\n *\n * @param options the options to use:\n *          md the message digest object to use, a forge md instance.\n *          mgf the mask generation function to use, a forge mgf instance.\n *          [saltLength] the length of the salt in octets.\n *          [prng] the pseudo-random number generator to use to produce a salt.\n *          [salt] the salt to use when encoding.\n *\n * @return a signature scheme object.\n */\npss.create = function(options) {\n  // backwards compatibility w/legacy args: hash, mgf, sLen\n  if(arguments.length === 3) {\n    options = {\n      md: arguments[0],\n      mgf: arguments[1],\n      saltLength: arguments[2]\n    };\n  }\n\n  var hash = options.md;\n  var mgf = options.mgf;\n  var hLen = hash.digestLength;\n\n  var salt_ = options.salt || null;\n  if(typeof salt_ === 'string') {\n    // assume binary-encoded string\n    salt_ = forge.util.createBuffer(salt_);\n  }\n\n  var sLen;\n  if('saltLength' in options) {\n    sLen = options.saltLength;\n  } else if(salt_ !== null) {\n    sLen = salt_.length();\n  } else {\n    throw new Error('Salt length not specified or specific salt not given.');\n  }\n\n  if(salt_ !== null && salt_.length() !== sLen) {\n    throw new Error('Given salt length does not match length of given salt.');\n  }\n\n  var prng = options.prng || forge.random;\n\n  var pssobj = {};\n\n  /**\n   * Encodes a PSS signature.\n   *\n   * This function implements EMSA-PSS-ENCODE as per RFC 3447, section 9.1.1.\n   *\n   * @param md the message digest object with the hash to sign.\n   * @param modsBits the length of the RSA modulus in bits.\n   *\n   * @return the encoded message as a binary-encoded string of length\n   *           ceil((modBits - 1) / 8).\n   */\n  pssobj.encode = function(md, modBits) {\n    var i;\n    var emBits = modBits - 1;\n    var emLen = Math.ceil(emBits / 8);\n\n    /* 2. Let mHash = Hash(M), an octet string of length hLen. */\n    var mHash = md.digest().getBytes();\n\n    /* 3. If emLen < hLen + sLen + 2, output \"encoding error\" and stop. */\n    if(emLen < hLen + sLen + 2) {\n      throw new Error('Message is too long to encrypt.');\n    }\n\n    /* 4. Generate a random octet string salt of length sLen; if sLen = 0,\n     *    then salt is the empty string. */\n    var salt;\n    if(salt_ === null) {\n      salt = prng.getBytesSync(sLen);\n    } else {\n      salt = salt_.bytes();\n    }\n\n    /* 5. Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt; */\n    var m_ = new forge.util.ByteBuffer();\n    m_.fillWithByte(0, 8);\n    m_.putBytes(mHash);\n    m_.putBytes(salt);\n\n    /* 6. Let H = Hash(M'), an octet string of length hLen. */\n    hash.start();\n    hash.update(m_.getBytes());\n    var h = hash.digest().getBytes();\n\n    /* 7. Generate an octet string PS consisting of emLen - sLen - hLen - 2\n     *    zero octets.  The length of PS may be 0. */\n    var ps = new forge.util.ByteBuffer();\n    ps.fillWithByte(0, emLen - sLen - hLen - 2);\n\n    /* 8. Let DB = PS || 0x01 || salt; DB is an octet string of length\n     *    emLen - hLen - 1. */\n    ps.putByte(0x01);\n    ps.putBytes(salt);\n    var db = ps.getBytes();\n\n    /* 9. Let dbMask = MGF(H, emLen - hLen - 1). */\n    var maskLen = emLen - hLen - 1;\n    var dbMask = mgf.generate(h, maskLen);\n\n    /* 10. Let maskedDB = DB \\xor dbMask. */\n    var maskedDB = '';\n    for(i = 0; i < maskLen; i++) {\n      maskedDB += String.fromCharCode(db.charCodeAt(i) ^ dbMask.charCodeAt(i));\n    }\n\n    /* 11. Set the leftmost 8emLen - emBits bits of the leftmost octet in\n     *     maskedDB to zero. */\n    var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;\n    maskedDB = String.fromCharCode(maskedDB.charCodeAt(0) & ~mask) +\n      maskedDB.substr(1);\n\n    /* 12. Let EM = maskedDB || H || 0xbc.\n     * 13. Output EM. */\n    return maskedDB + h + String.fromCharCode(0xbc);\n  };\n\n  /**\n   * Verifies a PSS signature.\n   *\n   * This function implements EMSA-PSS-VERIFY as per RFC 3447, section 9.1.2.\n   *\n   * @param mHash the message digest hash, as a binary-encoded string, to\n   *         compare against the signature.\n   * @param em the encoded message, as a binary-encoded string\n   *          (RSA decryption result).\n   * @param modsBits the length of the RSA modulus in bits.\n   *\n   * @return true if the signature was verified, false if not.\n   */\n  pssobj.verify = function(mHash, em, modBits) {\n    var i;\n    var emBits = modBits - 1;\n    var emLen = Math.ceil(emBits / 8);\n\n    /* c. Convert the message representative m to an encoded message EM\n     *    of length emLen = ceil((modBits - 1) / 8) octets, where modBits\n     *    is the length in bits of the RSA modulus n */\n    em = em.substr(-emLen);\n\n    /* 3. If emLen < hLen + sLen + 2, output \"inconsistent\" and stop. */\n    if(emLen < hLen + sLen + 2) {\n      throw new Error('Inconsistent parameters to PSS signature verification.');\n    }\n\n    /* 4. If the rightmost octet of EM does not have hexadecimal value\n     *    0xbc, output \"inconsistent\" and stop. */\n    if(em.charCodeAt(emLen - 1) !== 0xbc) {\n      throw new Error('Encoded message does not end in 0xBC.');\n    }\n\n    /* 5. Let maskedDB be the leftmost emLen - hLen - 1 octets of EM, and\n     *    let H be the next hLen octets. */\n    var maskLen = emLen - hLen - 1;\n    var maskedDB = em.substr(0, maskLen);\n    var h = em.substr(maskLen, hLen);\n\n    /* 6. If the leftmost 8emLen - emBits bits of the leftmost octet in\n     *    maskedDB are not all equal to zero, output \"inconsistent\" and stop. */\n    var mask = (0xFF00 >> (8 * emLen - emBits)) & 0xFF;\n    if((maskedDB.charCodeAt(0) & mask) !== 0) {\n      throw new Error('Bits beyond keysize not zero as expected.');\n    }\n\n    /* 7. Let dbMask = MGF(H, emLen - hLen - 1). */\n    var dbMask = mgf.generate(h, maskLen);\n\n    /* 8. Let DB = maskedDB \\xor dbMask. */\n    var db = '';\n    for(i = 0; i < maskLen; i++) {\n      db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i));\n    }\n\n    /* 9. Set the leftmost 8emLen - emBits bits of the leftmost octet\n     * in DB to zero. */\n    db = String.fromCharCode(db.charCodeAt(0) & ~mask) + db.substr(1);\n\n    /* 10. If the emLen - hLen - sLen - 2 leftmost octets of DB are not zero\n     * or if the octet at position emLen - hLen - sLen - 1 (the leftmost\n     * position is \"position 1\") does not have hexadecimal value 0x01,\n     * output \"inconsistent\" and stop. */\n    var checkLen = emLen - hLen - sLen - 2;\n    for(i = 0; i < checkLen; i++) {\n      if(db.charCodeAt(i) !== 0x00) {\n        throw new Error('Leftmost octets not zero as expected');\n      }\n    }\n\n    if(db.charCodeAt(checkLen) !== 0x01) {\n      throw new Error('Inconsistent PSS signature, 0x01 marker not found');\n    }\n\n    /* 11. Let salt be the last sLen octets of DB. */\n    var salt = db.substr(-sLen);\n\n    /* 12.  Let M' = (0x)00 00 00 00 00 00 00 00 || mHash || salt */\n    var m_ = new forge.util.ByteBuffer();\n    m_.fillWithByte(0, 8);\n    m_.putBytes(mHash);\n    m_.putBytes(salt);\n\n    /* 13. Let H' = Hash(M'), an octet string of length hLen. */\n    hash.start();\n    hash.update(m_.getBytes());\n    var h_ = hash.digest().getBytes();\n\n    /* 14. If H = H', output \"consistent.\" Otherwise, output \"inconsistent.\" */\n    return h === h_;\n  };\n\n  return pssobj;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pss.js\n// module id = 292\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pss.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of X.509 and related components (such as\n * Certification Signing Requests) of a Public Key Infrastructure.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n *\n * The ASN.1 representation of an X.509v3 certificate is as follows\n * (see RFC 2459):\n *\n * Certificate ::= SEQUENCE {\n *   tbsCertificate       TBSCertificate,\n *   signatureAlgorithm   AlgorithmIdentifier,\n *   signatureValue       BIT STRING\n * }\n *\n * TBSCertificate ::= SEQUENCE {\n *   version         [0]  EXPLICIT Version DEFAULT v1,\n *   serialNumber         CertificateSerialNumber,\n *   signature            AlgorithmIdentifier,\n *   issuer               Name,\n *   validity             Validity,\n *   subject              Name,\n *   subjectPublicKeyInfo SubjectPublicKeyInfo,\n *   issuerUniqueID  [1]  IMPLICIT UniqueIdentifier OPTIONAL,\n *                        -- If present, version shall be v2 or v3\n *   subjectUniqueID [2]  IMPLICIT UniqueIdentifier OPTIONAL,\n *                        -- If present, version shall be v2 or v3\n *   extensions      [3]  EXPLICIT Extensions OPTIONAL\n *                        -- If present, version shall be v3\n * }\n *\n * Version ::= INTEGER  { v1(0), v2(1), v3(2) }\n *\n * CertificateSerialNumber ::= INTEGER\n *\n * Name ::= CHOICE {\n *   // only one possible choice for now\n *   RDNSequence\n * }\n *\n * RDNSequence ::= SEQUENCE OF RelativeDistinguishedName\n *\n * RelativeDistinguishedName ::= SET OF AttributeTypeAndValue\n *\n * AttributeTypeAndValue ::= SEQUENCE {\n *   type     AttributeType,\n *   value    AttributeValue\n * }\n * AttributeType ::= OBJECT IDENTIFIER\n * AttributeValue ::= ANY DEFINED BY AttributeType\n *\n * Validity ::= SEQUENCE {\n *   notBefore      Time,\n *   notAfter       Time\n * }\n *\n * Time ::= CHOICE {\n *   utcTime        UTCTime,\n *   generalTime    GeneralizedTime\n * }\n *\n * UniqueIdentifier ::= BIT STRING\n *\n * SubjectPublicKeyInfo ::= SEQUENCE {\n *   algorithm            AlgorithmIdentifier,\n *   subjectPublicKey     BIT STRING\n * }\n *\n * Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension\n *\n * Extension ::= SEQUENCE {\n *   extnID      OBJECT IDENTIFIER,\n *   critical    BOOLEAN DEFAULT FALSE,\n *   extnValue   OCTET STRING\n * }\n *\n * The only key algorithm currently supported for PKI is RSA.\n *\n * RSASSA-PSS signatures are described in RFC 3447 and RFC 4055.\n *\n * PKCS#10 v1.7 describes certificate signing requests:\n *\n * CertificationRequestInfo:\n *\n * CertificationRequestInfo ::= SEQUENCE {\n *   version       INTEGER { v1(0) } (v1,...),\n *   subject       Name,\n *   subjectPKInfo SubjectPublicKeyInfo{{ PKInfoAlgorithms }},\n *   attributes    [0] Attributes{{ CRIAttributes }}\n * }\n *\n * Attributes { ATTRIBUTE:IOSet } ::= SET OF Attribute{{ IOSet }}\n *\n * CRIAttributes  ATTRIBUTE  ::= {\n *   ... -- add any locally defined attributes here -- }\n *\n * Attribute { ATTRIBUTE:IOSet } ::= SEQUENCE {\n *   type   ATTRIBUTE.&id({IOSet}),\n *   values SET SIZE(1..MAX) OF ATTRIBUTE.&Type({IOSet}{@type})\n * }\n *\n * CertificationRequest ::= SEQUENCE {\n *   certificationRequestInfo CertificationRequestInfo,\n *   signatureAlgorithm AlgorithmIdentifier{{ SignatureAlgorithms }},\n *   signature          BIT STRING\n * }\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(71);\n__webpack_require__(197);\n__webpack_require__(72);\n__webpack_require__(1129);\n__webpack_require__(101);\n__webpack_require__(123);\n__webpack_require__(292);\n__webpack_require__(199);\n__webpack_require__(9);\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/* Public Key Infrastructure (PKI) implementation. */\nvar pki = module.exports = forge.pki = forge.pki || {};\nvar oids = pki.oids;\n\n// short name OID mappings\nvar _shortNames = {};\n_shortNames['CN'] = oids['commonName'];\n_shortNames['commonName'] = 'CN';\n_shortNames['C'] = oids['countryName'];\n_shortNames['countryName'] = 'C';\n_shortNames['L'] = oids['localityName'];\n_shortNames['localityName'] = 'L';\n_shortNames['ST'] = oids['stateOrProvinceName'];\n_shortNames['stateOrProvinceName'] = 'ST';\n_shortNames['O'] = oids['organizationName'];\n_shortNames['organizationName'] = 'O';\n_shortNames['OU'] = oids['organizationalUnitName'];\n_shortNames['organizationalUnitName'] = 'OU';\n_shortNames['E'] = oids['emailAddress'];\n_shortNames['emailAddress'] = 'E';\n\n// validator for an SubjectPublicKeyInfo structure\n// Note: Currently only works with an RSA public key\nvar publicKeyValidator = forge.pki.rsa.publicKeyValidator;\n\n// validator for an X.509v3 certificate\nvar x509CertificateValidator = {\n  name: 'Certificate',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'Certificate.TBSCertificate',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    captureAsn1: 'tbsCertificate',\n    value: [{\n      name: 'Certificate.TBSCertificate.version',\n      tagClass: asn1.Class.CONTEXT_SPECIFIC,\n      type: 0,\n      constructed: true,\n      optional: true,\n      value: [{\n        name: 'Certificate.TBSCertificate.version.integer',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.INTEGER,\n        constructed: false,\n        capture: 'certVersion'\n      }]\n    }, {\n      name: 'Certificate.TBSCertificate.serialNumber',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.INTEGER,\n      constructed: false,\n      capture: 'certSerialNumber'\n    }, {\n      name: 'Certificate.TBSCertificate.signature',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      value: [{\n        name: 'Certificate.TBSCertificate.signature.algorithm',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OID,\n        constructed: false,\n        capture: 'certinfoSignatureOid'\n      }, {\n        name: 'Certificate.TBSCertificate.signature.parameters',\n        tagClass: asn1.Class.UNIVERSAL,\n        optional: true,\n        captureAsn1: 'certinfoSignatureParams'\n      }]\n    }, {\n      name: 'Certificate.TBSCertificate.issuer',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      captureAsn1: 'certIssuer'\n    }, {\n      name: 'Certificate.TBSCertificate.validity',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      // Note: UTC and generalized times may both appear so the capture\n      // names are based on their detected order, the names used below\n      // are only for the common case, which validity time really means\n      // \"notBefore\" and which means \"notAfter\" will be determined by order\n      value: [{\n        // notBefore (Time) (UTC time case)\n        name: 'Certificate.TBSCertificate.validity.notBefore (utc)',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.UTCTIME,\n        constructed: false,\n        optional: true,\n        capture: 'certValidity1UTCTime'\n      }, {\n        // notBefore (Time) (generalized time case)\n        name: 'Certificate.TBSCertificate.validity.notBefore (generalized)',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.GENERALIZEDTIME,\n        constructed: false,\n        optional: true,\n        capture: 'certValidity2GeneralizedTime'\n      }, {\n        // notAfter (Time) (only UTC time is supported)\n        name: 'Certificate.TBSCertificate.validity.notAfter (utc)',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.UTCTIME,\n        constructed: false,\n        optional: true,\n        capture: 'certValidity3UTCTime'\n      }, {\n        // notAfter (Time) (only UTC time is supported)\n        name: 'Certificate.TBSCertificate.validity.notAfter (generalized)',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.GENERALIZEDTIME,\n        constructed: false,\n        optional: true,\n        capture: 'certValidity4GeneralizedTime'\n      }]\n    }, {\n      // Name (subject) (RDNSequence)\n      name: 'Certificate.TBSCertificate.subject',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      captureAsn1: 'certSubject'\n    },\n      // SubjectPublicKeyInfo\n      publicKeyValidator,\n    {\n      // issuerUniqueID (optional)\n      name: 'Certificate.TBSCertificate.issuerUniqueID',\n      tagClass: asn1.Class.CONTEXT_SPECIFIC,\n      type: 1,\n      constructed: true,\n      optional: true,\n      value: [{\n        name: 'Certificate.TBSCertificate.issuerUniqueID.id',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.BITSTRING,\n        constructed: false,\n        // TODO: support arbitrary bit length ids\n        captureBitStringValue: 'certIssuerUniqueId'\n      }]\n    }, {\n      // subjectUniqueID (optional)\n      name: 'Certificate.TBSCertificate.subjectUniqueID',\n      tagClass: asn1.Class.CONTEXT_SPECIFIC,\n      type: 2,\n      constructed: true,\n      optional: true,\n      value: [{\n        name: 'Certificate.TBSCertificate.subjectUniqueID.id',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.BITSTRING,\n        constructed: false,\n        // TODO: support arbitrary bit length ids\n        captureBitStringValue: 'certSubjectUniqueId'\n      }]\n    }, {\n      // Extensions (optional)\n      name: 'Certificate.TBSCertificate.extensions',\n      tagClass: asn1.Class.CONTEXT_SPECIFIC,\n      type: 3,\n      constructed: true,\n      captureAsn1: 'certExtensions',\n      optional: true\n    }]\n  }, {\n    // AlgorithmIdentifier (signature algorithm)\n    name: 'Certificate.signatureAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      // algorithm\n      name: 'Certificate.signatureAlgorithm.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'certSignatureOid'\n    }, {\n      name: 'Certificate.TBSCertificate.signature.parameters',\n      tagClass: asn1.Class.UNIVERSAL,\n      optional: true,\n      captureAsn1: 'certSignatureParams'\n    }]\n  }, {\n    // SignatureValue\n    name: 'Certificate.signatureValue',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.BITSTRING,\n    constructed: false,\n    captureBitStringValue: 'certSignature'\n  }]\n};\n\nvar rsassaPssParameterValidator = {\n  name: 'rsapss',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'rsapss.hashAlgorithm',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    constructed: true,\n    value: [{\n      name: 'rsapss.hashAlgorithm.AlgorithmIdentifier',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Class.SEQUENCE,\n      constructed: true,\n      optional: true,\n      value: [{\n        name: 'rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OID,\n        constructed: false,\n        capture: 'hashOid'\n        /* parameter block omitted, for SHA1 NULL anyhow. */\n      }]\n    }]\n  }, {\n    name: 'rsapss.maskGenAlgorithm',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 1,\n    constructed: true,\n    value: [{\n      name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Class.SEQUENCE,\n      constructed: true,\n      optional: true,\n      value: [{\n        name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OID,\n        constructed: false,\n        capture: 'maskGenOid'\n      }, {\n        name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.SEQUENCE,\n        constructed: true,\n        value: [{\n          name: 'rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm',\n          tagClass: asn1.Class.UNIVERSAL,\n          type: asn1.Type.OID,\n          constructed: false,\n          capture: 'maskGenHashOid'\n          /* parameter block omitted, for SHA1 NULL anyhow. */\n        }]\n      }]\n    }]\n  }, {\n    name: 'rsapss.saltLength',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 2,\n    optional: true,\n    value: [{\n      name: 'rsapss.saltLength.saltLength',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Class.INTEGER,\n      constructed: false,\n      capture: 'saltLength'\n    }]\n  }, {\n    name: 'rsapss.trailerField',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 3,\n    optional: true,\n    value: [{\n      name: 'rsapss.trailer.trailer',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Class.INTEGER,\n      constructed: false,\n      capture: 'trailer'\n    }]\n  }]\n};\n\n// validator for a CertificationRequestInfo structure\nvar certificationRequestInfoValidator = {\n  name: 'CertificationRequestInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  captureAsn1: 'certificationRequestInfo',\n  value: [{\n    name: 'CertificationRequestInfo.integer',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'certificationRequestInfoVersion'\n  }, {\n    // Name (subject) (RDNSequence)\n    name: 'CertificationRequestInfo.subject',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    captureAsn1: 'certificationRequestInfoSubject'\n  },\n  // SubjectPublicKeyInfo\n  publicKeyValidator,\n  {\n    name: 'CertificationRequestInfo.attributes',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    constructed: true,\n    optional: true,\n    capture: 'certificationRequestInfoAttributes',\n    value: [{\n      name: 'CertificationRequestInfo.attributes',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      value: [{\n        name: 'CertificationRequestInfo.attributes.type',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OID,\n        constructed: false\n      }, {\n        name: 'CertificationRequestInfo.attributes.value',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.SET,\n        constructed: true\n      }]\n    }]\n  }]\n};\n\n// validator for a CertificationRequest structure\nvar certificationRequestValidator = {\n  name: 'CertificationRequest',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  captureAsn1: 'csr',\n  value: [\n    certificationRequestInfoValidator, {\n    // AlgorithmIdentifier (signature algorithm)\n    name: 'CertificationRequest.signatureAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      // algorithm\n      name: 'CertificationRequest.signatureAlgorithm.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'csrSignatureOid'\n    }, {\n      name: 'CertificationRequest.signatureAlgorithm.parameters',\n      tagClass: asn1.Class.UNIVERSAL,\n      optional: true,\n      captureAsn1: 'csrSignatureParams'\n    }]\n  }, {\n    // signature\n    name: 'CertificationRequest.signature',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.BITSTRING,\n    constructed: false,\n    captureBitStringValue: 'csrSignature'\n  }]\n};\n\n/**\n * Converts an RDNSequence of ASN.1 DER-encoded RelativeDistinguishedName\n * sets into an array with objects that have type and value properties.\n *\n * @param rdn the RDNSequence to convert.\n * @param md a message digest to append type and value to if provided.\n */\npki.RDNAttributesAsArray = function(rdn, md) {\n  var rval = [];\n\n  // each value in 'rdn' in is a SET of RelativeDistinguishedName\n  var set, attr, obj;\n  for(var si = 0; si < rdn.value.length; ++si) {\n    // get the RelativeDistinguishedName set\n    set = rdn.value[si];\n\n    // each value in the SET is an AttributeTypeAndValue sequence\n    // containing first a type (an OID) and second a value (defined by\n    // the OID)\n    for(var i = 0; i < set.value.length; ++i) {\n      obj = {};\n      attr = set.value[i];\n      obj.type = asn1.derToOid(attr.value[0].value);\n      obj.value = attr.value[1].value;\n      obj.valueTagClass = attr.value[1].type;\n      // if the OID is known, get its name and short name\n      if(obj.type in oids) {\n        obj.name = oids[obj.type];\n        if(obj.name in _shortNames) {\n          obj.shortName = _shortNames[obj.name];\n        }\n      }\n      if(md) {\n        md.update(obj.type);\n        md.update(obj.value);\n      }\n      rval.push(obj);\n    }\n  }\n\n  return rval;\n};\n\n/**\n * Converts ASN.1 CRIAttributes into an array with objects that have type and\n * value properties.\n *\n * @param attributes the CRIAttributes to convert.\n */\npki.CRIAttributesAsArray = function(attributes) {\n  var rval = [];\n\n  // each value in 'attributes' in is a SEQUENCE with an OID and a SET\n  for(var si = 0; si < attributes.length; ++si) {\n    // get the attribute sequence\n    var seq = attributes[si];\n\n    // each value in the SEQUENCE containing first a type (an OID) and\n    // second a set of values (defined by the OID)\n    var type = asn1.derToOid(seq.value[0].value);\n    var values = seq.value[1].value;\n    for(var vi = 0; vi < values.length; ++vi) {\n      var obj = {};\n      obj.type = type;\n      obj.value = values[vi].value;\n      obj.valueTagClass = values[vi].type;\n      // if the OID is known, get its name and short name\n      if(obj.type in oids) {\n        obj.name = oids[obj.type];\n        if(obj.name in _shortNames) {\n          obj.shortName = _shortNames[obj.name];\n        }\n      }\n      // parse extensions\n      if(obj.type === oids.extensionRequest) {\n        obj.extensions = [];\n        for(var ei = 0; ei < obj.value.length; ++ei) {\n          obj.extensions.push(pki.certificateExtensionFromAsn1(obj.value[ei]));\n        }\n      }\n      rval.push(obj);\n    }\n  }\n\n  return rval;\n};\n\n/**\n * Gets an issuer or subject attribute from its name, type, or short name.\n *\n * @param obj the issuer or subject object.\n * @param options a short name string or an object with:\n *          shortName the short name for the attribute.\n *          name the name for the attribute.\n *          type the type for the attribute.\n *\n * @return the attribute.\n */\nfunction _getAttribute(obj, options) {\n  if(typeof options === 'string') {\n    options = {shortName: options};\n  }\n\n  var rval = null;\n  var attr;\n  for(var i = 0; rval === null && i < obj.attributes.length; ++i) {\n    attr = obj.attributes[i];\n    if(options.type && options.type === attr.type) {\n      rval = attr;\n    } else if(options.name && options.name === attr.name) {\n      rval = attr;\n    } else if(options.shortName && options.shortName === attr.shortName) {\n      rval = attr;\n    }\n  }\n  return rval;\n}\n\n/**\n * Converts signature parameters from ASN.1 structure.\n *\n * Currently only RSASSA-PSS supported.  The PKCS#1 v1.5 signature scheme had\n * no parameters.\n *\n * RSASSA-PSS-params  ::=  SEQUENCE  {\n *   hashAlgorithm      [0] HashAlgorithm DEFAULT\n *                             sha1Identifier,\n *   maskGenAlgorithm   [1] MaskGenAlgorithm DEFAULT\n *                             mgf1SHA1Identifier,\n *   saltLength         [2] INTEGER DEFAULT 20,\n *   trailerField       [3] INTEGER DEFAULT 1\n * }\n *\n * HashAlgorithm  ::=  AlgorithmIdentifier\n *\n * MaskGenAlgorithm  ::=  AlgorithmIdentifier\n *\n * AlgorithmIdentifer ::= SEQUENCE {\n *   algorithm OBJECT IDENTIFIER,\n *   parameters ANY DEFINED BY algorithm OPTIONAL\n * }\n *\n * @param oid The OID specifying the signature algorithm\n * @param obj The ASN.1 structure holding the parameters\n * @param fillDefaults Whether to use return default values where omitted\n * @return signature parameter object\n */\nvar _readSignatureParameters = function(oid, obj, fillDefaults) {\n  var params = {};\n\n  if(oid !== oids['RSASSA-PSS']) {\n    return params;\n  }\n\n  if(fillDefaults) {\n    params = {\n      hash: {\n        algorithmOid: oids['sha1']\n      },\n      mgf: {\n        algorithmOid: oids['mgf1'],\n        hash: {\n          algorithmOid: oids['sha1']\n        }\n      },\n      saltLength: 20\n    };\n  }\n\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) {\n    var error = new Error('Cannot read RSASSA-PSS parameter block.');\n    error.errors = errors;\n    throw error;\n  }\n\n  if(capture.hashOid !== undefined) {\n    params.hash = params.hash || {};\n    params.hash.algorithmOid = asn1.derToOid(capture.hashOid);\n  }\n\n  if(capture.maskGenOid !== undefined) {\n    params.mgf = params.mgf || {};\n    params.mgf.algorithmOid = asn1.derToOid(capture.maskGenOid);\n    params.mgf.hash = params.mgf.hash || {};\n    params.mgf.hash.algorithmOid = asn1.derToOid(capture.maskGenHashOid);\n  }\n\n  if(capture.saltLength !== undefined) {\n    params.saltLength = capture.saltLength.charCodeAt(0);\n  }\n\n  return params;\n};\n\n/**\n * Converts an X.509 certificate from PEM format.\n *\n * Note: If the certificate is to be verified then compute hash should\n * be set to true. This will scan the TBSCertificate part of the ASN.1\n * object while it is converted so it doesn't need to be converted back\n * to ASN.1-DER-encoding later.\n *\n * @param pem the PEM-formatted certificate.\n * @param computeHash true to compute the hash for verification.\n * @param strict true to be strict when checking ASN.1 value lengths, false to\n *          allow truncated values (default: true).\n *\n * @return the certificate.\n */\npki.certificateFromPem = function(pem, computeHash, strict) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'CERTIFICATE' &&\n    msg.type !== 'X509 CERTIFICATE' &&\n    msg.type !== 'TRUSTED CERTIFICATE') {\n    var error = new Error('Could not convert certificate from PEM; PEM header type ' +\n      'is not \"CERTIFICATE\", \"X509 CERTIFICATE\", or \"TRUSTED CERTIFICATE\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert certificate from PEM; PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  var obj = asn1.fromDer(msg.body, strict);\n\n  return pki.certificateFromAsn1(obj, computeHash);\n};\n\n/**\n * Converts an X.509 certificate to PEM format.\n *\n * @param cert the certificate.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted certificate.\n */\npki.certificateToPem = function(cert, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var msg = {\n    type: 'CERTIFICATE',\n    body: asn1.toDer(pki.certificateToAsn1(cert)).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Converts an RSA public key from PEM format.\n *\n * @param pem the PEM-formatted public key.\n *\n * @return the public key.\n */\npki.publicKeyFromPem = function(pem) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'PUBLIC KEY' && msg.type !== 'RSA PUBLIC KEY') {\n    var error = new Error('Could not convert public key from PEM; PEM header ' +\n      'type is not \"PUBLIC KEY\" or \"RSA PUBLIC KEY\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert public key from PEM; PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  var obj = asn1.fromDer(msg.body);\n\n  return pki.publicKeyFromAsn1(obj);\n};\n\n/**\n * Converts an RSA public key to PEM format (using a SubjectPublicKeyInfo).\n *\n * @param key the public key.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted public key.\n */\npki.publicKeyToPem = function(key, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var msg = {\n    type: 'PUBLIC KEY',\n    body: asn1.toDer(pki.publicKeyToAsn1(key)).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Converts an RSA public key to PEM format (using an RSAPublicKey).\n *\n * @param key the public key.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted public key.\n */\npki.publicKeyToRSAPublicKeyPem = function(key, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var msg = {\n    type: 'RSA PUBLIC KEY',\n    body: asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Gets a fingerprint for the given public key.\n *\n * @param options the options to use.\n *          [md] the message digest object to use (defaults to forge.md.sha1).\n *          [type] the type of fingerprint, such as 'RSAPublicKey',\n *            'SubjectPublicKeyInfo' (defaults to 'RSAPublicKey').\n *          [encoding] an alternative output encoding, such as 'hex'\n *            (defaults to none, outputs a byte buffer).\n *          [delimiter] the delimiter to use between bytes for 'hex' encoded\n *            output, eg: ':' (defaults to none).\n *\n * @return the fingerprint as a byte buffer or other encoding based on options.\n */\npki.getPublicKeyFingerprint = function(key, options) {\n  options = options || {};\n  var md = options.md || forge.md.sha1.create();\n  var type = options.type || 'RSAPublicKey';\n\n  var bytes;\n  switch(type) {\n  case 'RSAPublicKey':\n    bytes = asn1.toDer(pki.publicKeyToRSAPublicKey(key)).getBytes();\n    break;\n  case 'SubjectPublicKeyInfo':\n    bytes = asn1.toDer(pki.publicKeyToAsn1(key)).getBytes();\n    break;\n  default:\n    throw new Error('Unknown fingerprint type \"' + options.type + '\".');\n  }\n\n  // hash public key bytes\n  md.start();\n  md.update(bytes);\n  var digest = md.digest();\n  if(options.encoding === 'hex') {\n    var hex = digest.toHex();\n    if(options.delimiter) {\n      return hex.match(/.{2}/g).join(options.delimiter);\n    }\n    return hex;\n  } else if(options.encoding === 'binary') {\n    return digest.getBytes();\n  } else if(options.encoding) {\n    throw new Error('Unknown encoding \"' + options.encoding + '\".');\n  }\n  return digest;\n};\n\n/**\n * Converts a PKCS#10 certification request (CSR) from PEM format.\n *\n * Note: If the certification request is to be verified then compute hash\n * should be set to true. This will scan the CertificationRequestInfo part of\n * the ASN.1 object while it is converted so it doesn't need to be converted\n * back to ASN.1-DER-encoding later.\n *\n * @param pem the PEM-formatted certificate.\n * @param computeHash true to compute the hash for verification.\n * @param strict true to be strict when checking ASN.1 value lengths, false to\n *          allow truncated values (default: true).\n *\n * @return the certification request (CSR).\n */\npki.certificationRequestFromPem = function(pem, computeHash, strict) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'CERTIFICATE REQUEST') {\n    var error = new Error('Could not convert certification request from PEM; ' +\n      'PEM header type is not \"CERTIFICATE REQUEST\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert certification request from PEM; ' +\n      'PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  var obj = asn1.fromDer(msg.body, strict);\n\n  return pki.certificationRequestFromAsn1(obj, computeHash);\n};\n\n/**\n * Converts a PKCS#10 certification request (CSR) to PEM format.\n *\n * @param csr the certification request.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted certification request.\n */\npki.certificationRequestToPem = function(csr, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var msg = {\n    type: 'CERTIFICATE REQUEST',\n    body: asn1.toDer(pki.certificationRequestToAsn1(csr)).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Creates an empty X.509v3 RSA certificate.\n *\n * @return the certificate.\n */\npki.createCertificate = function() {\n  var cert = {};\n  cert.version = 0x02;\n  cert.serialNumber = '00';\n  cert.signatureOid = null;\n  cert.signature = null;\n  cert.siginfo = {};\n  cert.siginfo.algorithmOid = null;\n  cert.validity = {};\n  cert.validity.notBefore = new Date();\n  cert.validity.notAfter = new Date();\n\n  cert.issuer = {};\n  cert.issuer.getField = function(sn) {\n    return _getAttribute(cert.issuer, sn);\n  };\n  cert.issuer.addField = function(attr) {\n    _fillMissingFields([attr]);\n    cert.issuer.attributes.push(attr);\n  };\n  cert.issuer.attributes = [];\n  cert.issuer.hash = null;\n\n  cert.subject = {};\n  cert.subject.getField = function(sn) {\n    return _getAttribute(cert.subject, sn);\n  };\n  cert.subject.addField = function(attr) {\n    _fillMissingFields([attr]);\n    cert.subject.attributes.push(attr);\n  };\n  cert.subject.attributes = [];\n  cert.subject.hash = null;\n\n  cert.extensions = [];\n  cert.publicKey = null;\n  cert.md = null;\n\n  /**\n   * Sets the subject of this certificate.\n   *\n   * @param attrs the array of subject attributes to use.\n   * @param uniqueId an optional a unique ID to use.\n   */\n  cert.setSubject = function(attrs, uniqueId) {\n    // set new attributes, clear hash\n    _fillMissingFields(attrs);\n    cert.subject.attributes = attrs;\n    delete cert.subject.uniqueId;\n    if(uniqueId) {\n      // TODO: support arbitrary bit length ids\n      cert.subject.uniqueId = uniqueId;\n    }\n    cert.subject.hash = null;\n  };\n\n  /**\n   * Sets the issuer of this certificate.\n   *\n   * @param attrs the array of issuer attributes to use.\n   * @param uniqueId an optional a unique ID to use.\n   */\n  cert.setIssuer = function(attrs, uniqueId) {\n    // set new attributes, clear hash\n    _fillMissingFields(attrs);\n    cert.issuer.attributes = attrs;\n    delete cert.issuer.uniqueId;\n    if(uniqueId) {\n      // TODO: support arbitrary bit length ids\n      cert.issuer.uniqueId = uniqueId;\n    }\n    cert.issuer.hash = null;\n  };\n\n  /**\n   * Sets the extensions of this certificate.\n   *\n   * @param exts the array of extensions to use.\n   */\n  cert.setExtensions = function(exts) {\n    for(var i = 0; i < exts.length; ++i) {\n      _fillMissingExtensionFields(exts[i], {cert: cert});\n    }\n    // set new extensions\n    cert.extensions = exts;\n  };\n\n  /**\n   * Gets an extension by its name or id.\n   *\n   * @param options the name to use or an object with:\n   *          name the name to use.\n   *          id the id to use.\n   *\n   * @return the extension or null if not found.\n   */\n  cert.getExtension = function(options) {\n    if(typeof options === 'string') {\n      options = {name: options};\n    }\n\n    var rval = null;\n    var ext;\n    for(var i = 0; rval === null && i < cert.extensions.length; ++i) {\n      ext = cert.extensions[i];\n      if(options.id && ext.id === options.id) {\n        rval = ext;\n      } else if(options.name && ext.name === options.name) {\n        rval = ext;\n      }\n    }\n    return rval;\n  };\n\n  /**\n   * Signs this certificate using the given private key.\n   *\n   * @param key the private key to sign with.\n   * @param md the message digest object to use (defaults to forge.md.sha1).\n   */\n  cert.sign = function(key, md) {\n    // TODO: get signature OID from private key\n    cert.md = md || forge.md.sha1.create();\n    var algorithmOid = oids[cert.md.algorithm + 'WithRSAEncryption'];\n    if(!algorithmOid) {\n      var error = new Error('Could not compute certificate digest. ' +\n        'Unknown message digest algorithm OID.');\n      error.algorithm = cert.md.algorithm;\n      throw error;\n    }\n    cert.signatureOid = cert.siginfo.algorithmOid = algorithmOid;\n\n    // get TBSCertificate, convert to DER\n    cert.tbsCertificate = pki.getTBSCertificate(cert);\n    var bytes = asn1.toDer(cert.tbsCertificate);\n\n    // digest and sign\n    cert.md.update(bytes.getBytes());\n    cert.signature = key.sign(cert.md);\n  };\n\n  /**\n   * Attempts verify the signature on the passed certificate using this\n   * certificate's public key.\n   *\n   * @param child the certificate to verify.\n   *\n   * @return true if verified, false if not.\n   */\n  cert.verify = function(child) {\n    var rval = false;\n\n    if(!cert.issued(child)) {\n      var issuer = child.issuer;\n      var subject = cert.subject;\n      var error = new Error('The parent certificate did not issue the given child ' +\n        'certificate; the child certificate\\'s issuer does not match the ' +\n        'parent\\'s subject.');\n      error.expectedIssuer = issuer.attributes;\n      error.actualIssuer = subject.attributes;\n      throw error;\n    }\n\n    var md = child.md;\n    if(md === null) {\n      // check signature OID for supported signature types\n      if(child.signatureOid in oids) {\n        var oid = oids[child.signatureOid];\n        switch(oid) {\n        case 'sha1WithRSAEncryption':\n          md = forge.md.sha1.create();\n          break;\n        case 'md5WithRSAEncryption':\n          md = forge.md.md5.create();\n          break;\n        case 'sha256WithRSAEncryption':\n          md = forge.md.sha256.create();\n          break;\n        case 'sha384WithRSAEncryption':\n          md = forge.md.sha384.create();\n          break;\n        case 'sha512WithRSAEncryption':\n          md = forge.md.sha512.create();\n          break;\n        case 'RSASSA-PSS':\n          md = forge.md.sha256.create();\n          break;\n        }\n      }\n      if(md === null) {\n        var error = new Error('Could not compute certificate digest. ' +\n          'Unknown signature OID.');\n        error.signatureOid = child.signatureOid;\n        throw error;\n      }\n\n      // produce DER formatted TBSCertificate and digest it\n      var tbsCertificate = child.tbsCertificate || pki.getTBSCertificate(child);\n      var bytes = asn1.toDer(tbsCertificate);\n      md.update(bytes.getBytes());\n    }\n\n    if(md !== null) {\n      var scheme;\n\n      switch(child.signatureOid) {\n      case oids.sha1WithRSAEncryption:\n        scheme = undefined;  /* use PKCS#1 v1.5 padding scheme */\n        break;\n      case oids['RSASSA-PSS']:\n        var hash, mgf;\n\n        /* initialize mgf */\n        hash = oids[child.signatureParameters.mgf.hash.algorithmOid];\n        if(hash === undefined || forge.md[hash] === undefined) {\n          var error = new Error('Unsupported MGF hash function.');\n          error.oid = child.signatureParameters.mgf.hash.algorithmOid;\n          error.name = hash;\n          throw error;\n        }\n\n        mgf = oids[child.signatureParameters.mgf.algorithmOid];\n        if(mgf === undefined || forge.mgf[mgf] === undefined) {\n          var error = new Error('Unsupported MGF function.');\n          error.oid = child.signatureParameters.mgf.algorithmOid;\n          error.name = mgf;\n          throw error;\n        }\n\n        mgf = forge.mgf[mgf].create(forge.md[hash].create());\n\n        /* initialize hash function */\n        hash = oids[child.signatureParameters.hash.algorithmOid];\n        if(hash === undefined || forge.md[hash] === undefined) {\n          throw {\n            message: 'Unsupported RSASSA-PSS hash function.',\n            oid: child.signatureParameters.hash.algorithmOid,\n            name: hash\n          };\n        }\n\n        scheme = forge.pss.create(forge.md[hash].create(), mgf,\n          child.signatureParameters.saltLength);\n        break;\n      }\n\n      // verify signature on cert using public key\n      rval = cert.publicKey.verify(\n        md.digest().getBytes(), child.signature, scheme);\n    }\n\n    return rval;\n  };\n\n  /**\n   * Returns true if this certificate's issuer matches the passed\n   * certificate's subject. Note that no signature check is performed.\n   *\n   * @param parent the certificate to check.\n   *\n   * @return true if this certificate's issuer matches the passed certificate's\n   *         subject.\n   */\n  cert.isIssuer = function(parent) {\n    var rval = false;\n\n    var i = cert.issuer;\n    var s = parent.subject;\n\n    // compare hashes if present\n    if(i.hash && s.hash) {\n      rval = (i.hash === s.hash);\n    } else if(i.attributes.length === s.attributes.length) {\n      // all attributes are the same so issuer matches subject\n      rval = true;\n      var iattr, sattr;\n      for(var n = 0; rval && n < i.attributes.length; ++n) {\n        iattr = i.attributes[n];\n        sattr = s.attributes[n];\n        if(iattr.type !== sattr.type || iattr.value !== sattr.value) {\n          // attribute mismatch\n          rval = false;\n        }\n      }\n    }\n\n    return rval;\n  };\n\n  /**\n   * Returns true if this certificate's subject matches the issuer of the\n   * given certificate). Note that not signature check is performed.\n   *\n   * @param child the certificate to check.\n   *\n   * @return true if this certificate's subject matches the passed\n   *         certificate's issuer.\n   */\n  cert.issued = function(child) {\n    return child.isIssuer(cert);\n  };\n\n  /**\n   * Generates the subjectKeyIdentifier for this certificate as byte buffer.\n   *\n   * @return the subjectKeyIdentifier for this certificate as byte buffer.\n   */\n  cert.generateSubjectKeyIdentifier = function() {\n    /* See: 4.2.1.2 section of the the RFC3280, keyIdentifier is either:\n\n      (1) The keyIdentifier is composed of the 160-bit SHA-1 hash of the\n        value of the BIT STRING subjectPublicKey (excluding the tag,\n        length, and number of unused bits).\n\n      (2) The keyIdentifier is composed of a four bit type field with\n        the value 0100 followed by the least significant 60 bits of the\n        SHA-1 hash of the value of the BIT STRING subjectPublicKey\n        (excluding the tag, length, and number of unused bit string bits).\n    */\n\n    // skipping the tag, length, and number of unused bits is the same\n    // as just using the RSAPublicKey (for RSA keys, which are the\n    // only ones supported)\n    return pki.getPublicKeyFingerprint(cert.publicKey, {type: 'RSAPublicKey'});\n  };\n\n  /**\n   * Verifies the subjectKeyIdentifier extension value for this certificate\n   * against its public key. If no extension is found, false will be\n   * returned.\n   *\n   * @return true if verified, false if not.\n   */\n  cert.verifySubjectKeyIdentifier = function() {\n    var oid = oids['subjectKeyIdentifier'];\n    for(var i = 0; i < cert.extensions.length; ++i) {\n      var ext = cert.extensions[i];\n      if(ext.id === oid) {\n        var ski = cert.generateSubjectKeyIdentifier().getBytes();\n        return (forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski);\n      }\n    }\n    return false;\n  };\n\n  return cert;\n};\n\n/**\n * Converts an X.509v3 RSA certificate from an ASN.1 object.\n *\n * Note: If the certificate is to be verified then compute hash should\n * be set to true. There is currently no implementation for converting\n * a certificate back to ASN.1 so the TBSCertificate part of the ASN.1\n * object needs to be scanned before the cert object is created.\n *\n * @param obj the asn1 representation of an X.509v3 RSA certificate.\n * @param computeHash true to compute the hash for verification.\n *\n * @return the certificate.\n */\npki.certificateFromAsn1 = function(obj, computeHash) {\n  // validate certificate and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, x509CertificateValidator, capture, errors)) {\n    var error = new Error('Cannot read X.509 certificate. ' +\n      'ASN.1 object is not an X509v3 Certificate.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // get oid\n  var oid = asn1.derToOid(capture.publicKeyOid);\n  if(oid !== pki.oids.rsaEncryption) {\n    throw new Error('Cannot read public key. OID is not RSA.');\n  }\n\n  // create certificate\n  var cert = pki.createCertificate();\n  cert.version = capture.certVersion ?\n    capture.certVersion.charCodeAt(0) : 0;\n  var serial = forge.util.createBuffer(capture.certSerialNumber);\n  cert.serialNumber = serial.toHex();\n  cert.signatureOid = forge.asn1.derToOid(capture.certSignatureOid);\n  cert.signatureParameters = _readSignatureParameters(\n    cert.signatureOid, capture.certSignatureParams, true);\n  cert.siginfo.algorithmOid = forge.asn1.derToOid(capture.certinfoSignatureOid);\n  cert.siginfo.parameters = _readSignatureParameters(cert.siginfo.algorithmOid,\n    capture.certinfoSignatureParams, false);\n  cert.signature = capture.certSignature;\n\n  var validity = [];\n  if(capture.certValidity1UTCTime !== undefined) {\n    validity.push(asn1.utcTimeToDate(capture.certValidity1UTCTime));\n  }\n  if(capture.certValidity2GeneralizedTime !== undefined) {\n    validity.push(asn1.generalizedTimeToDate(\n      capture.certValidity2GeneralizedTime));\n  }\n  if(capture.certValidity3UTCTime !== undefined) {\n    validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime));\n  }\n  if(capture.certValidity4GeneralizedTime !== undefined) {\n    validity.push(asn1.generalizedTimeToDate(\n      capture.certValidity4GeneralizedTime));\n  }\n  if(validity.length > 2) {\n    throw new Error('Cannot read notBefore/notAfter validity times; more ' +\n      'than two times were provided in the certificate.');\n  }\n  if(validity.length < 2) {\n    throw new Error('Cannot read notBefore/notAfter validity times; they ' +\n      'were not provided as either UTCTime or GeneralizedTime.');\n  }\n  cert.validity.notBefore = validity[0];\n  cert.validity.notAfter = validity[1];\n\n  // keep TBSCertificate to preserve signature when exporting\n  cert.tbsCertificate = capture.tbsCertificate;\n\n  if(computeHash) {\n    // check signature OID for supported signature types\n    cert.md = null;\n    if(cert.signatureOid in oids) {\n      var oid = oids[cert.signatureOid];\n      switch(oid) {\n      case 'sha1WithRSAEncryption':\n        cert.md = forge.md.sha1.create();\n        break;\n      case 'md5WithRSAEncryption':\n        cert.md = forge.md.md5.create();\n        break;\n      case 'sha256WithRSAEncryption':\n        cert.md = forge.md.sha256.create();\n        break;\n      case 'sha384WithRSAEncryption':\n        cert.md = forge.md.sha384.create();\n        break;\n      case 'sha512WithRSAEncryption':\n        cert.md = forge.md.sha512.create();\n        break;\n      case 'RSASSA-PSS':\n        cert.md = forge.md.sha256.create();\n        break;\n      }\n    }\n    if(cert.md === null) {\n      var error = new Error('Could not compute certificate digest. ' +\n        'Unknown signature OID.');\n      error.signatureOid = cert.signatureOid;\n      throw error;\n    }\n\n    // produce DER formatted TBSCertificate and digest it\n    var bytes = asn1.toDer(cert.tbsCertificate);\n    cert.md.update(bytes.getBytes());\n  }\n\n  // handle issuer, build issuer message digest\n  var imd = forge.md.sha1.create();\n  cert.issuer.getField = function(sn) {\n    return _getAttribute(cert.issuer, sn);\n  };\n  cert.issuer.addField = function(attr) {\n    _fillMissingFields([attr]);\n    cert.issuer.attributes.push(attr);\n  };\n  cert.issuer.attributes = pki.RDNAttributesAsArray(capture.certIssuer, imd);\n  if(capture.certIssuerUniqueId) {\n    cert.issuer.uniqueId = capture.certIssuerUniqueId;\n  }\n  cert.issuer.hash = imd.digest().toHex();\n\n  // handle subject, build subject message digest\n  var smd = forge.md.sha1.create();\n  cert.subject.getField = function(sn) {\n    return _getAttribute(cert.subject, sn);\n  };\n  cert.subject.addField = function(attr) {\n    _fillMissingFields([attr]);\n    cert.subject.attributes.push(attr);\n  };\n  cert.subject.attributes = pki.RDNAttributesAsArray(capture.certSubject, smd);\n  if(capture.certSubjectUniqueId) {\n    cert.subject.uniqueId = capture.certSubjectUniqueId;\n  }\n  cert.subject.hash = smd.digest().toHex();\n\n  // handle extensions\n  if(capture.certExtensions) {\n    cert.extensions = pki.certificateExtensionsFromAsn1(capture.certExtensions);\n  } else {\n    cert.extensions = [];\n  }\n\n  // convert RSA public key from ASN.1\n  cert.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo);\n\n  return cert;\n};\n\n/**\n * Converts an ASN.1 extensions object (with extension sequences as its\n * values) into an array of extension objects with types and values.\n *\n * Supported extensions:\n *\n * id-ce-keyUsage OBJECT IDENTIFIER ::=  { id-ce 15 }\n * KeyUsage ::= BIT STRING {\n *   digitalSignature        (0),\n *   nonRepudiation          (1),\n *   keyEncipherment         (2),\n *   dataEncipherment        (3),\n *   keyAgreement            (4),\n *   keyCertSign             (5),\n *   cRLSign                 (6),\n *   encipherOnly            (7),\n *   decipherOnly            (8)\n * }\n *\n * id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 }\n * BasicConstraints ::= SEQUENCE {\n *   cA                      BOOLEAN DEFAULT FALSE,\n *   pathLenConstraint       INTEGER (0..MAX) OPTIONAL\n * }\n *\n * subjectAltName EXTENSION ::= {\n *   SYNTAX GeneralNames\n *   IDENTIFIED BY id-ce-subjectAltName\n * }\n *\n * GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName\n *\n * GeneralName ::= CHOICE {\n *   otherName      [0] INSTANCE OF OTHER-NAME,\n *   rfc822Name     [1] IA5String,\n *   dNSName        [2] IA5String,\n *   x400Address    [3] ORAddress,\n *   directoryName  [4] Name,\n *   ediPartyName   [5] EDIPartyName,\n *   uniformResourceIdentifier [6] IA5String,\n *   IPAddress      [7] OCTET STRING,\n *   registeredID   [8] OBJECT IDENTIFIER\n * }\n *\n * OTHER-NAME ::= TYPE-IDENTIFIER\n *\n * EDIPartyName ::= SEQUENCE {\n *   nameAssigner [0] DirectoryString {ub-name} OPTIONAL,\n *   partyName    [1] DirectoryString {ub-name}\n * }\n *\n * @param exts the extensions ASN.1 with extension sequences to parse.\n *\n * @return the array.\n */\npki.certificateExtensionsFromAsn1 = function(exts) {\n  var rval = [];\n  for(var i = 0; i < exts.value.length; ++i) {\n    // get extension sequence\n    var extseq = exts.value[i];\n    for(var ei = 0; ei < extseq.value.length; ++ei) {\n      rval.push(pki.certificateExtensionFromAsn1(extseq.value[ei]));\n    }\n  }\n\n  return rval;\n};\n\n/**\n * Parses a single certificate extension from ASN.1.\n *\n * @param ext the extension in ASN.1 format.\n *\n * @return the parsed extension as an object.\n */\npki.certificateExtensionFromAsn1 = function(ext) {\n  // an extension has:\n  // [0] extnID      OBJECT IDENTIFIER\n  // [1] critical    BOOLEAN DEFAULT FALSE\n  // [2] extnValue   OCTET STRING\n  var e = {};\n  e.id = asn1.derToOid(ext.value[0].value);\n  e.critical = false;\n  if(ext.value[1].type === asn1.Type.BOOLEAN) {\n    e.critical = (ext.value[1].value.charCodeAt(0) !== 0x00);\n    e.value = ext.value[2].value;\n  } else {\n    e.value = ext.value[1].value;\n  }\n  // if the oid is known, get its name\n  if(e.id in oids) {\n    e.name = oids[e.id];\n\n    // handle key usage\n    if(e.name === 'keyUsage') {\n      // get value as BIT STRING\n      var ev = asn1.fromDer(e.value);\n      var b2 = 0x00;\n      var b3 = 0x00;\n      if(ev.value.length > 1) {\n        // skip first byte, just indicates unused bits which\n        // will be padded with 0s anyway\n        // get bytes with flag bits\n        b2 = ev.value.charCodeAt(1);\n        b3 = ev.value.length > 2 ? ev.value.charCodeAt(2) : 0;\n      }\n      // set flags\n      e.digitalSignature = (b2 & 0x80) === 0x80;\n      e.nonRepudiation = (b2 & 0x40) === 0x40;\n      e.keyEncipherment = (b2 & 0x20) === 0x20;\n      e.dataEncipherment = (b2 & 0x10) === 0x10;\n      e.keyAgreement = (b2 & 0x08) === 0x08;\n      e.keyCertSign = (b2 & 0x04) === 0x04;\n      e.cRLSign = (b2 & 0x02) === 0x02;\n      e.encipherOnly = (b2 & 0x01) === 0x01;\n      e.decipherOnly = (b3 & 0x80) === 0x80;\n    } else if(e.name === 'basicConstraints') {\n      // handle basic constraints\n      // get value as SEQUENCE\n      var ev = asn1.fromDer(e.value);\n      // get cA BOOLEAN flag (defaults to false)\n      if(ev.value.length > 0 && ev.value[0].type === asn1.Type.BOOLEAN) {\n        e.cA = (ev.value[0].value.charCodeAt(0) !== 0x00);\n      } else {\n        e.cA = false;\n      }\n      // get path length constraint\n      var value = null;\n      if(ev.value.length > 0 && ev.value[0].type === asn1.Type.INTEGER) {\n        value = ev.value[0].value;\n      } else if(ev.value.length > 1) {\n        value = ev.value[1].value;\n      }\n      if(value !== null) {\n        e.pathLenConstraint = asn1.derToInteger(value);\n      }\n    } else if(e.name === 'extKeyUsage') {\n      // handle extKeyUsage\n      // value is a SEQUENCE of OIDs\n      var ev = asn1.fromDer(e.value);\n      for(var vi = 0; vi < ev.value.length; ++vi) {\n        var oid = asn1.derToOid(ev.value[vi].value);\n        if(oid in oids) {\n          e[oids[oid]] = true;\n        } else {\n          e[oid] = true;\n        }\n      }\n    } else if(e.name === 'nsCertType') {\n      // handle nsCertType\n      // get value as BIT STRING\n      var ev = asn1.fromDer(e.value);\n      var b2 = 0x00;\n      if(ev.value.length > 1) {\n        // skip first byte, just indicates unused bits which\n        // will be padded with 0s anyway\n        // get bytes with flag bits\n        b2 = ev.value.charCodeAt(1);\n      }\n      // set flags\n      e.client = (b2 & 0x80) === 0x80;\n      e.server = (b2 & 0x40) === 0x40;\n      e.email = (b2 & 0x20) === 0x20;\n      e.objsign = (b2 & 0x10) === 0x10;\n      e.reserved = (b2 & 0x08) === 0x08;\n      e.sslCA = (b2 & 0x04) === 0x04;\n      e.emailCA = (b2 & 0x02) === 0x02;\n      e.objCA = (b2 & 0x01) === 0x01;\n    } else if(\n      e.name === 'subjectAltName' ||\n      e.name === 'issuerAltName') {\n      // handle subjectAltName/issuerAltName\n      e.altNames = [];\n\n      // ev is a SYNTAX SEQUENCE\n      var gn;\n      var ev = asn1.fromDer(e.value);\n      for(var n = 0; n < ev.value.length; ++n) {\n        // get GeneralName\n        gn = ev.value[n];\n\n        var altName = {\n          type: gn.type,\n          value: gn.value\n        };\n        e.altNames.push(altName);\n\n        // Note: Support for types 1,2,6,7,8\n        switch(gn.type) {\n        // rfc822Name\n        case 1:\n        // dNSName\n        case 2:\n        // uniformResourceIdentifier (URI)\n        case 6:\n          break;\n        // IPAddress\n        case 7:\n          // convert to IPv4/IPv6 string representation\n          altName.ip = forge.util.bytesToIP(gn.value);\n          break;\n        // registeredID\n        case 8:\n          altName.oid = asn1.derToOid(gn.value);\n          break;\n        default:\n          // unsupported\n        }\n      }\n    } else if(e.name === 'subjectKeyIdentifier') {\n      // value is an OCTETSTRING w/the hash of the key-type specific\n      // public key structure (eg: RSAPublicKey)\n      var ev = asn1.fromDer(e.value);\n      e.subjectKeyIdentifier = forge.util.bytesToHex(ev.value);\n    }\n  }\n  return e;\n};\n\n/**\n * Converts a PKCS#10 certification request (CSR) from an ASN.1 object.\n *\n * Note: If the certification request is to be verified then compute hash\n * should be set to true. There is currently no implementation for converting\n * a certificate back to ASN.1 so the CertificationRequestInfo part of the\n * ASN.1 object needs to be scanned before the csr object is created.\n *\n * @param obj the asn1 representation of a PKCS#10 certification request (CSR).\n * @param computeHash true to compute the hash for verification.\n *\n * @return the certification request (CSR).\n */\npki.certificationRequestFromAsn1 = function(obj, computeHash) {\n  // validate certification request and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, certificationRequestValidator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#10 certificate request. ' +\n      'ASN.1 object is not a PKCS#10 CertificationRequest.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // get oid\n  var oid = asn1.derToOid(capture.publicKeyOid);\n  if(oid !== pki.oids.rsaEncryption) {\n    throw new Error('Cannot read public key. OID is not RSA.');\n  }\n\n  // create certification request\n  var csr = pki.createCertificationRequest();\n  csr.version = capture.csrVersion ? capture.csrVersion.charCodeAt(0) : 0;\n  csr.signatureOid = forge.asn1.derToOid(capture.csrSignatureOid);\n  csr.signatureParameters = _readSignatureParameters(\n    csr.signatureOid, capture.csrSignatureParams, true);\n  csr.siginfo.algorithmOid = forge.asn1.derToOid(capture.csrSignatureOid);\n  csr.siginfo.parameters = _readSignatureParameters(\n    csr.siginfo.algorithmOid, capture.csrSignatureParams, false);\n  csr.signature = capture.csrSignature;\n\n  // keep CertificationRequestInfo to preserve signature when exporting\n  csr.certificationRequestInfo = capture.certificationRequestInfo;\n\n  if(computeHash) {\n    // check signature OID for supported signature types\n    csr.md = null;\n    if(csr.signatureOid in oids) {\n      var oid = oids[csr.signatureOid];\n      switch(oid) {\n      case 'sha1WithRSAEncryption':\n        csr.md = forge.md.sha1.create();\n        break;\n      case 'md5WithRSAEncryption':\n        csr.md = forge.md.md5.create();\n        break;\n      case 'sha256WithRSAEncryption':\n        csr.md = forge.md.sha256.create();\n        break;\n      case 'sha384WithRSAEncryption':\n        csr.md = forge.md.sha384.create();\n        break;\n      case 'sha512WithRSAEncryption':\n        csr.md = forge.md.sha512.create();\n        break;\n      case 'RSASSA-PSS':\n        csr.md = forge.md.sha256.create();\n        break;\n      }\n    }\n    if(csr.md === null) {\n      var error = new Error('Could not compute certification request digest. ' +\n        'Unknown signature OID.');\n      error.signatureOid = csr.signatureOid;\n      throw error;\n    }\n\n    // produce DER formatted CertificationRequestInfo and digest it\n    var bytes = asn1.toDer(csr.certificationRequestInfo);\n    csr.md.update(bytes.getBytes());\n  }\n\n  // handle subject, build subject message digest\n  var smd = forge.md.sha1.create();\n  csr.subject.getField = function(sn) {\n    return _getAttribute(csr.subject, sn);\n  };\n  csr.subject.addField = function(attr) {\n    _fillMissingFields([attr]);\n    csr.subject.attributes.push(attr);\n  };\n  csr.subject.attributes = pki.RDNAttributesAsArray(\n    capture.certificationRequestInfoSubject, smd);\n  csr.subject.hash = smd.digest().toHex();\n\n  // convert RSA public key from ASN.1\n  csr.publicKey = pki.publicKeyFromAsn1(capture.subjectPublicKeyInfo);\n\n  // convert attributes from ASN.1\n  csr.getAttribute = function(sn) {\n    return _getAttribute(csr, sn);\n  };\n  csr.addAttribute = function(attr) {\n    _fillMissingFields([attr]);\n    csr.attributes.push(attr);\n  };\n  csr.attributes = pki.CRIAttributesAsArray(\n    capture.certificationRequestInfoAttributes || []);\n\n  return csr;\n};\n\n/**\n * Creates an empty certification request (a CSR or certificate signing\n * request). Once created, its public key and attributes can be set and then\n * it can be signed.\n *\n * @return the empty certification request.\n */\npki.createCertificationRequest = function() {\n  var csr = {};\n  csr.version = 0x00;\n  csr.signatureOid = null;\n  csr.signature = null;\n  csr.siginfo = {};\n  csr.siginfo.algorithmOid = null;\n\n  csr.subject = {};\n  csr.subject.getField = function(sn) {\n    return _getAttribute(csr.subject, sn);\n  };\n  csr.subject.addField = function(attr) {\n    _fillMissingFields([attr]);\n    csr.subject.attributes.push(attr);\n  };\n  csr.subject.attributes = [];\n  csr.subject.hash = null;\n\n  csr.publicKey = null;\n  csr.attributes = [];\n  csr.getAttribute = function(sn) {\n    return _getAttribute(csr, sn);\n  };\n  csr.addAttribute = function(attr) {\n    _fillMissingFields([attr]);\n    csr.attributes.push(attr);\n  };\n  csr.md = null;\n\n  /**\n   * Sets the subject of this certification request.\n   *\n   * @param attrs the array of subject attributes to use.\n   */\n  csr.setSubject = function(attrs) {\n    // set new attributes\n    _fillMissingFields(attrs);\n    csr.subject.attributes = attrs;\n    csr.subject.hash = null;\n  };\n\n  /**\n   * Sets the attributes of this certification request.\n   *\n   * @param attrs the array of attributes to use.\n   */\n  csr.setAttributes = function(attrs) {\n    // set new attributes\n    _fillMissingFields(attrs);\n    csr.attributes = attrs;\n  };\n\n  /**\n   * Signs this certification request using the given private key.\n   *\n   * @param key the private key to sign with.\n   * @param md the message digest object to use (defaults to forge.md.sha1).\n   */\n  csr.sign = function(key, md) {\n    // TODO: get signature OID from private key\n    csr.md = md || forge.md.sha1.create();\n    var algorithmOid = oids[csr.md.algorithm + 'WithRSAEncryption'];\n    if(!algorithmOid) {\n      var error = new Error('Could not compute certification request digest. ' +\n        'Unknown message digest algorithm OID.');\n      error.algorithm = csr.md.algorithm;\n      throw error;\n    }\n    csr.signatureOid = csr.siginfo.algorithmOid = algorithmOid;\n\n    // get CertificationRequestInfo, convert to DER\n    csr.certificationRequestInfo = pki.getCertificationRequestInfo(csr);\n    var bytes = asn1.toDer(csr.certificationRequestInfo);\n\n    // digest and sign\n    csr.md.update(bytes.getBytes());\n    csr.signature = key.sign(csr.md);\n  };\n\n  /**\n   * Attempts verify the signature on the passed certification request using\n   * its public key.\n   *\n   * A CSR that has been exported to a file in PEM format can be verified using\n   * OpenSSL using this command:\n   *\n   * openssl req -in <the-csr-pem-file> -verify -noout -text\n   *\n   * @return true if verified, false if not.\n   */\n  csr.verify = function() {\n    var rval = false;\n\n    var md = csr.md;\n    if(md === null) {\n      // check signature OID for supported signature types\n      if(csr.signatureOid in oids) {\n        // TODO: create DRY `OID to md` function\n        var oid = oids[csr.signatureOid];\n        switch(oid) {\n        case 'sha1WithRSAEncryption':\n          md = forge.md.sha1.create();\n          break;\n        case 'md5WithRSAEncryption':\n          md = forge.md.md5.create();\n          break;\n        case 'sha256WithRSAEncryption':\n          md = forge.md.sha256.create();\n          break;\n        case 'sha384WithRSAEncryption':\n          md = forge.md.sha384.create();\n          break;\n        case 'sha512WithRSAEncryption':\n          md = forge.md.sha512.create();\n          break;\n        case 'RSASSA-PSS':\n          md = forge.md.sha256.create();\n          break;\n        }\n      }\n      if(md === null) {\n        var error = new Error('Could not compute certification request digest. ' +\n          'Unknown signature OID.');\n        error.signatureOid = csr.signatureOid;\n        throw error;\n      }\n\n      // produce DER formatted CertificationRequestInfo and digest it\n      var cri = csr.certificationRequestInfo ||\n        pki.getCertificationRequestInfo(csr);\n      var bytes = asn1.toDer(cri);\n      md.update(bytes.getBytes());\n    }\n\n    if(md !== null) {\n      var scheme;\n\n      switch(csr.signatureOid) {\n      case oids.sha1WithRSAEncryption:\n        /* use PKCS#1 v1.5 padding scheme */\n        break;\n      case oids['RSASSA-PSS']:\n        var hash, mgf;\n\n        /* initialize mgf */\n        hash = oids[csr.signatureParameters.mgf.hash.algorithmOid];\n        if(hash === undefined || forge.md[hash] === undefined) {\n          var error = new Error('Unsupported MGF hash function.');\n          error.oid = csr.signatureParameters.mgf.hash.algorithmOid;\n          error.name = hash;\n          throw error;\n        }\n\n        mgf = oids[csr.signatureParameters.mgf.algorithmOid];\n        if(mgf === undefined || forge.mgf[mgf] === undefined) {\n          var error = new Error('Unsupported MGF function.');\n          error.oid = csr.signatureParameters.mgf.algorithmOid;\n          error.name = mgf;\n          throw error;\n        }\n\n        mgf = forge.mgf[mgf].create(forge.md[hash].create());\n\n        /* initialize hash function */\n        hash = oids[csr.signatureParameters.hash.algorithmOid];\n        if(hash === undefined || forge.md[hash] === undefined) {\n          var error = new Error('Unsupported RSASSA-PSS hash function.');\n          error.oid = csr.signatureParameters.hash.algorithmOid;\n          error.name = hash;\n          throw error;\n        }\n\n        scheme = forge.pss.create(forge.md[hash].create(), mgf,\n          csr.signatureParameters.saltLength);\n        break;\n      }\n\n      // verify signature on csr using its public key\n      rval = csr.publicKey.verify(\n        md.digest().getBytes(), csr.signature, scheme);\n    }\n\n    return rval;\n  };\n\n  return csr;\n};\n\n/**\n * Converts an X.509 subject or issuer to an ASN.1 RDNSequence.\n *\n * @param obj the subject or issuer (distinguished name).\n *\n * @return the ASN.1 RDNSequence.\n */\nfunction _dnToAsn1(obj) {\n  // create an empty RDNSequence\n  var rval = asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n  // iterate over attributes\n  var attr, set;\n  var attrs = obj.attributes;\n  for(var i = 0; i < attrs.length; ++i) {\n    attr = attrs[i];\n    var value = attr.value;\n\n    // reuse tag class for attribute value if available\n    var valueTagClass = asn1.Type.PRINTABLESTRING;\n    if('valueTagClass' in attr) {\n      valueTagClass = attr.valueTagClass;\n\n      if(valueTagClass === asn1.Type.UTF8) {\n        value = forge.util.encodeUtf8(value);\n      }\n      // FIXME: handle more encodings\n    }\n\n    // create a RelativeDistinguishedName set\n    // each value in the set is an AttributeTypeAndValue first\n    // containing the type (an OID) and second the value\n    set = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // AttributeType\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(attr.type).getBytes()),\n        // AttributeValue\n        asn1.create(asn1.Class.UNIVERSAL, valueTagClass, false, value)\n      ])\n    ]);\n    rval.value.push(set);\n  }\n\n  return rval;\n}\n\n/**\n * Gets all printable attributes (typically of an issuer or subject) in a\n * simplified JSON format for display.\n *\n * @param attrs the attributes.\n *\n * @return the JSON for display.\n */\nfunction _getAttributesAsJson(attrs) {\n  var rval = {};\n  for(var i = 0; i < attrs.length; ++i) {\n    var attr = attrs[i];\n    if(attr.shortName && (\n      attr.valueTagClass === asn1.Type.UTF8 ||\n      attr.valueTagClass === asn1.Type.PRINTABLESTRING ||\n      attr.valueTagClass === asn1.Type.IA5STRING)) {\n      var value = attr.value;\n      if(attr.valueTagClass === asn1.Type.UTF8) {\n        value = forge.util.encodeUtf8(attr.value);\n      }\n      if(!(attr.shortName in rval)) {\n        rval[attr.shortName] = value;\n      } else if(forge.util.isArray(rval[attr.shortName])) {\n        rval[attr.shortName].push(value);\n      } else {\n        rval[attr.shortName] = [rval[attr.shortName], value];\n      }\n    }\n  }\n  return rval;\n}\n\n/**\n * Fills in missing fields in attributes.\n *\n * @param attrs the attributes to fill missing fields in.\n */\nfunction _fillMissingFields(attrs) {\n  var attr;\n  for(var i = 0; i < attrs.length; ++i) {\n    attr = attrs[i];\n\n    // populate missing name\n    if(typeof attr.name === 'undefined') {\n      if(attr.type && attr.type in pki.oids) {\n        attr.name = pki.oids[attr.type];\n      } else if(attr.shortName && attr.shortName in _shortNames) {\n        attr.name = pki.oids[_shortNames[attr.shortName]];\n      }\n    }\n\n    // populate missing type (OID)\n    if(typeof attr.type === 'undefined') {\n      if(attr.name && attr.name in pki.oids) {\n        attr.type = pki.oids[attr.name];\n      } else {\n        var error = new Error('Attribute type not specified.');\n        error.attribute = attr;\n        throw error;\n      }\n    }\n\n    // populate missing shortname\n    if(typeof attr.shortName === 'undefined') {\n      if(attr.name && attr.name in _shortNames) {\n        attr.shortName = _shortNames[attr.name];\n      }\n    }\n\n    // convert extensions to value\n    if(attr.type === oids.extensionRequest) {\n      attr.valueConstructed = true;\n      attr.valueTagClass = asn1.Type.SEQUENCE;\n      if(!attr.value && attr.extensions) {\n        attr.value = [];\n        for(var ei = 0; ei < attr.extensions.length; ++ei) {\n          attr.value.push(pki.certificateExtensionToAsn1(\n            _fillMissingExtensionFields(attr.extensions[ei])));\n        }\n      }\n    }\n\n    if(typeof attr.value === 'undefined') {\n      var error = new Error('Attribute value not specified.');\n      error.attribute = attr;\n      throw error;\n    }\n  }\n}\n\n/**\n * Fills in missing fields in certificate extensions.\n *\n * @param e the extension.\n * @param [options] the options to use.\n *          [cert] the certificate the extensions are for.\n *\n * @return the extension.\n */\nfunction _fillMissingExtensionFields(e, options) {\n  options = options || {};\n\n  // populate missing name\n  if(typeof e.name === 'undefined') {\n    if(e.id && e.id in pki.oids) {\n      e.name = pki.oids[e.id];\n    }\n  }\n\n  // populate missing id\n  if(typeof e.id === 'undefined') {\n    if(e.name && e.name in pki.oids) {\n      e.id = pki.oids[e.name];\n    } else {\n      var error = new Error('Extension ID not specified.');\n      error.extension = e;\n      throw error;\n    }\n  }\n\n  if(typeof e.value !== 'undefined') {\n    return e;\n  }\n\n  // handle missing value:\n\n  // value is a BIT STRING\n  if(e.name === 'keyUsage') {\n    // build flags\n    var unused = 0;\n    var b2 = 0x00;\n    var b3 = 0x00;\n    if(e.digitalSignature) {\n      b2 |= 0x80;\n      unused = 7;\n    }\n    if(e.nonRepudiation) {\n      b2 |= 0x40;\n      unused = 6;\n    }\n    if(e.keyEncipherment) {\n      b2 |= 0x20;\n      unused = 5;\n    }\n    if(e.dataEncipherment) {\n      b2 |= 0x10;\n      unused = 4;\n    }\n    if(e.keyAgreement) {\n      b2 |= 0x08;\n      unused = 3;\n    }\n    if(e.keyCertSign) {\n      b2 |= 0x04;\n      unused = 2;\n    }\n    if(e.cRLSign) {\n      b2 |= 0x02;\n      unused = 1;\n    }\n    if(e.encipherOnly) {\n      b2 |= 0x01;\n      unused = 0;\n    }\n    if(e.decipherOnly) {\n      b3 |= 0x80;\n      unused = 7;\n    }\n\n    // create bit string\n    var value = String.fromCharCode(unused);\n    if(b3 !== 0) {\n      value += String.fromCharCode(b2) + String.fromCharCode(b3);\n    } else if(b2 !== 0) {\n      value += String.fromCharCode(b2);\n    }\n    e.value = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value);\n  } else if(e.name === 'basicConstraints') {\n    // basicConstraints is a SEQUENCE\n    e.value = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n    // cA BOOLEAN flag defaults to false\n    if(e.cA) {\n      e.value.value.push(asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false,\n        String.fromCharCode(0xFF)));\n    }\n    if('pathLenConstraint' in e) {\n      e.value.value.push(asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        asn1.integerToDer(e.pathLenConstraint).getBytes()));\n    }\n  } else if(e.name === 'extKeyUsage') {\n    // extKeyUsage is a SEQUENCE of OIDs\n    e.value = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n    var seq = e.value.value;\n    for(var key in e) {\n      if(e[key] !== true) {\n        continue;\n      }\n      // key is name in OID map\n      if(key in oids) {\n        seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID,\n          false, asn1.oidToDer(oids[key]).getBytes()));\n      } else if(key.indexOf('.') !== -1) {\n        // assume key is an OID\n        seq.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID,\n          false, asn1.oidToDer(key).getBytes()));\n      }\n    }\n  } else if(e.name === 'nsCertType') {\n    // nsCertType is a BIT STRING\n    // build flags\n    var unused = 0;\n    var b2 = 0x00;\n\n    if(e.client) {\n      b2 |= 0x80;\n      unused = 7;\n    }\n    if(e.server) {\n      b2 |= 0x40;\n      unused = 6;\n    }\n    if(e.email) {\n      b2 |= 0x20;\n      unused = 5;\n    }\n    if(e.objsign) {\n      b2 |= 0x10;\n      unused = 4;\n    }\n    if(e.reserved) {\n      b2 |= 0x08;\n      unused = 3;\n    }\n    if(e.sslCA) {\n      b2 |= 0x04;\n      unused = 2;\n    }\n    if(e.emailCA) {\n      b2 |= 0x02;\n      unused = 1;\n    }\n    if(e.objCA) {\n      b2 |= 0x01;\n      unused = 0;\n    }\n\n    // create bit string\n    var value = String.fromCharCode(unused);\n    if(b2 !== 0) {\n      value += String.fromCharCode(b2);\n    }\n    e.value = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false, value);\n  } else if(e.name === 'subjectAltName' || e.name === 'issuerAltName') {\n    // SYNTAX SEQUENCE\n    e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n    var altName;\n    for(var n = 0; n < e.altNames.length; ++n) {\n      altName = e.altNames[n];\n      var value = altName.value;\n      // handle IP\n      if(altName.type === 7 && altName.ip) {\n        value = forge.util.bytesFromIP(altName.ip);\n        if(value === null) {\n          var error = new Error(\n            'Extension \"ip\" value is not a valid IPv4 or IPv6 address.');\n          error.extension = e;\n          throw error;\n        }\n      } else if(altName.type === 8) {\n        // handle OID\n        if(altName.oid) {\n          value = asn1.oidToDer(asn1.oidToDer(altName.oid));\n        } else {\n          // deprecated ... convert value to OID\n          value = asn1.oidToDer(value);\n        }\n      }\n      e.value.value.push(asn1.create(\n        asn1.Class.CONTEXT_SPECIFIC, altName.type, false,\n        value));\n    }\n  } else if(e.name === 'subjectKeyIdentifier' && options.cert) {\n    var ski = options.cert.generateSubjectKeyIdentifier();\n    e.subjectKeyIdentifier = ski.toHex();\n    // OCTETSTRING w/digest\n    e.value = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, ski.getBytes());\n  } else if(e.name === 'authorityKeyIdentifier' && options.cert) {\n    // SYNTAX SEQUENCE\n    e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n    var seq = e.value.value;\n\n    if(e.keyIdentifier) {\n      var keyIdentifier = (e.keyIdentifier === true ?\n        options.cert.generateSubjectKeyIdentifier().getBytes() :\n        e.keyIdentifier);\n      seq.push(\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier));\n    }\n\n    if(e.authorityCertIssuer) {\n      var authorityCertIssuer = [\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [\n          _dnToAsn1(e.authorityCertIssuer === true ?\n            options.cert.issuer : e.authorityCertIssuer)\n        ])\n      ];\n      seq.push(\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer));\n    }\n\n    if(e.serialNumber) {\n      var serialNumber = forge.util.hexToBytes(e.serialNumber === true ?\n        options.cert.serialNumber : e.serialNumber);\n      seq.push(\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, false, serialNumber));\n    }\n  } else if (e.name === 'cRLDistributionPoints') {\n    e.value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n    var seq = e.value.value;\n\n    // Create sub SEQUENCE of DistributionPointName\n    var subSeq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n    // Create fullName CHOICE\n    var fullNameGeneralNames = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []);\n    var altName;\n    for(var n = 0; n < e.altNames.length; ++n) {\n      altName = e.altNames[n];\n      var value = altName.value;\n      // handle IP\n      if(altName.type === 7 && altName.ip) {\n        value = forge.util.bytesFromIP(altName.ip);\n        if(value === null) {\n          var error = new Error(\n            'Extension \"ip\" value is not a valid IPv4 or IPv6 address.');\n          error.extension = e;\n          throw error;\n        }\n      } else if(altName.type === 8) {\n        // handle OID\n        if(altName.oid) {\n          value = asn1.oidToDer(asn1.oidToDer(altName.oid));\n        } else {\n          // deprecated ... convert value to OID\n          value = asn1.oidToDer(value);\n        }\n      }\n      fullNameGeneralNames.value.push(asn1.create(\n        asn1.Class.CONTEXT_SPECIFIC, altName.type, false,\n        value));\n    }\n\n    // Add to the parent SEQUENCE\n    subSeq.value.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [fullNameGeneralNames]));\n    seq.push(subSeq);\n  }\n\n  // ensure value has been defined by now\n  if(typeof e.value === 'undefined') {\n    var error = new Error('Extension value not specified.');\n    error.extension = e;\n    throw error;\n  }\n\n  return e;\n}\n\n/**\n * Convert signature parameters object to ASN.1\n *\n * @param {String} oid Signature algorithm OID\n * @param params The signature parametrs object\n * @return ASN.1 object representing signature parameters\n */\nfunction _signatureParametersToAsn1(oid, params) {\n  switch(oid) {\n  case oids['RSASSA-PSS']:\n    var parts = [];\n\n    if(params.hash.algorithmOid !== undefined) {\n      parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(params.hash.algorithmOid).getBytes()),\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n        ])\n      ]));\n    }\n\n    if(params.mgf.algorithmOid !== undefined) {\n      parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(params.mgf.algorithmOid).getBytes()),\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n              asn1.oidToDer(params.mgf.hash.algorithmOid).getBytes()),\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n          ])\n        ])\n      ]));\n    }\n\n    if(params.saltLength !== undefined) {\n      parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n          asn1.integerToDer(params.saltLength).getBytes())\n      ]));\n    }\n\n    return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, parts);\n\n  default:\n    return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '');\n  }\n}\n\n/**\n * Converts a certification request's attributes to an ASN.1 set of\n * CRIAttributes.\n *\n * @param csr certification request.\n *\n * @return the ASN.1 set of CRIAttributes.\n */\nfunction _CRIAttributesToAsn1(csr) {\n  // create an empty context-specific container\n  var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, []);\n\n  // no attributes, return empty container\n  if(csr.attributes.length === 0) {\n    return rval;\n  }\n\n  // each attribute has a sequence with a type and a set of values\n  var attrs = csr.attributes;\n  for(var i = 0; i < attrs.length; ++i) {\n    var attr = attrs[i];\n    var value = attr.value;\n\n    // reuse tag class for attribute value if available\n    var valueTagClass = asn1.Type.UTF8;\n    if('valueTagClass' in attr) {\n      valueTagClass = attr.valueTagClass;\n    }\n    if(valueTagClass === asn1.Type.UTF8) {\n      value = forge.util.encodeUtf8(value);\n    }\n    var valueConstructed = false;\n    if('valueConstructed' in attr) {\n      valueConstructed = attr.valueConstructed;\n    }\n    // FIXME: handle more encodings\n\n    // create a RelativeDistinguishedName set\n    // each value in the set is an AttributeTypeAndValue first\n    // containing the type (an OID) and second the value\n    var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // AttributeType\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(attr.type).getBytes()),\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n        // AttributeValue\n        asn1.create(\n          asn1.Class.UNIVERSAL, valueTagClass, valueConstructed, value)\n      ])\n    ]);\n    rval.value.push(seq);\n  }\n\n  return rval;\n}\n\n/**\n * Gets the ASN.1 TBSCertificate part of an X.509v3 certificate.\n *\n * @param cert the certificate.\n *\n * @return the asn1 TBSCertificate.\n */\npki.getTBSCertificate = function(cert) {\n  // TBSCertificate\n  var tbs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version\n    asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n      // integer\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        asn1.integerToDer(cert.version).getBytes())\n    ]),\n    // serialNumber\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      forge.util.hexToBytes(cert.serialNumber)),\n    // signature\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(cert.siginfo.algorithmOid).getBytes()),\n      // parameters\n      _signatureParametersToAsn1(\n        cert.siginfo.algorithmOid, cert.siginfo.parameters)\n    ]),\n    // issuer\n    _dnToAsn1(cert.issuer),\n    // validity\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // notBefore\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,\n        asn1.dateToUtcTime(cert.validity.notBefore)),\n      // notAfter\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,\n        asn1.dateToUtcTime(cert.validity.notAfter))\n    ]),\n    // subject\n    _dnToAsn1(cert.subject),\n    // SubjectPublicKeyInfo\n    pki.publicKeyToAsn1(cert.publicKey)\n  ]);\n\n  if(cert.issuer.uniqueId) {\n    // issuerUniqueID (optional)\n    tbs.value.push(\n      asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,\n          // TODO: support arbitrary bit length ids\n          String.fromCharCode(0x00) +\n          cert.issuer.uniqueId\n        )\n      ])\n    );\n  }\n  if(cert.subject.uniqueId) {\n    // subjectUniqueID (optional)\n    tbs.value.push(\n      asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,\n          // TODO: support arbitrary bit length ids\n          String.fromCharCode(0x00) +\n          cert.subject.uniqueId\n        )\n      ])\n    );\n  }\n\n  if(cert.extensions.length > 0) {\n    // extensions (optional)\n    tbs.value.push(pki.certificateExtensionsToAsn1(cert.extensions));\n  }\n\n  return tbs;\n};\n\n/**\n * Gets the ASN.1 CertificationRequestInfo part of a\n * PKCS#10 CertificationRequest.\n *\n * @param csr the certification request.\n *\n * @return the asn1 CertificationRequestInfo.\n */\npki.getCertificationRequestInfo = function(csr) {\n  // CertificationRequestInfo\n  var cri = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(csr.version).getBytes()),\n    // subject\n    _dnToAsn1(csr.subject),\n    // SubjectPublicKeyInfo\n    pki.publicKeyToAsn1(csr.publicKey),\n    // attributes\n    _CRIAttributesToAsn1(csr)\n  ]);\n\n  return cri;\n};\n\n/**\n * Converts a DistinguishedName (subject or issuer) to an ASN.1 object.\n *\n * @param dn the DistinguishedName.\n *\n * @return the asn1 representation of a DistinguishedName.\n */\npki.distinguishedNameToAsn1 = function(dn) {\n  return _dnToAsn1(dn);\n};\n\n/**\n * Converts an X.509v3 RSA certificate to an ASN.1 object.\n *\n * @param cert the certificate.\n *\n * @return the asn1 representation of an X.509v3 RSA certificate.\n */\npki.certificateToAsn1 = function(cert) {\n  // prefer cached TBSCertificate over generating one\n  var tbsCertificate = cert.tbsCertificate || pki.getTBSCertificate(cert);\n\n  // Certificate\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // TBSCertificate\n    tbsCertificate,\n    // AlgorithmIdentifier (signature algorithm)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(cert.signatureOid).getBytes()),\n      // parameters\n      _signatureParametersToAsn1(cert.signatureOid, cert.signatureParameters)\n    ]),\n    // SignatureValue\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,\n      String.fromCharCode(0x00) + cert.signature)\n  ]);\n};\n\n/**\n * Converts X.509v3 certificate extensions to ASN.1.\n *\n * @param exts the extensions to convert.\n *\n * @return the extensions in ASN.1 format.\n */\npki.certificateExtensionsToAsn1 = function(exts) {\n  // create top-level extension container\n  var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []);\n\n  // create extension sequence (stores a sequence for each extension)\n  var seq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n  rval.value.push(seq);\n\n  for(var i = 0; i < exts.length; ++i) {\n    seq.value.push(pki.certificateExtensionToAsn1(exts[i]));\n  }\n\n  return rval;\n};\n\n/**\n * Converts a single certificate extension to ASN.1.\n *\n * @param ext the extension to convert.\n *\n * @return the extension in ASN.1 format.\n */\npki.certificateExtensionToAsn1 = function(ext) {\n  // create a sequence for each extension\n  var extseq = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []);\n\n  // extnID (OID)\n  extseq.value.push(asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n    asn1.oidToDer(ext.id).getBytes()));\n\n  // critical defaults to false\n  if(ext.critical) {\n    // critical BOOLEAN DEFAULT FALSE\n    extseq.value.push(asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.BOOLEAN, false,\n      String.fromCharCode(0xFF)));\n  }\n\n  var value = ext.value;\n  if(typeof ext.value !== 'string') {\n    // value is asn.1\n    value = asn1.toDer(value).getBytes();\n  }\n\n  // extnValue (OCTET STRING)\n  extseq.value.push(asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, value));\n\n  return extseq;\n};\n\n/**\n * Converts a PKCS#10 certification request to an ASN.1 object.\n *\n * @param csr the certification request.\n *\n * @return the asn1 representation of a certification request.\n */\npki.certificationRequestToAsn1 = function(csr) {\n  // prefer cached CertificationRequestInfo over generating one\n  var cri = csr.certificationRequestInfo ||\n    pki.getCertificationRequestInfo(csr);\n\n  // Certificate\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // CertificationRequestInfo\n    cri,\n    // AlgorithmIdentifier (signature algorithm)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(csr.signatureOid).getBytes()),\n      // parameters\n      _signatureParametersToAsn1(csr.signatureOid, csr.signatureParameters)\n    ]),\n    // signature\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BITSTRING, false,\n      String.fromCharCode(0x00) + csr.signature)\n  ]);\n};\n\n/**\n * Creates a CA store.\n *\n * @param certs an optional array of certificate objects or PEM-formatted\n *          certificate strings to add to the CA store.\n *\n * @return the CA store.\n */\npki.createCaStore = function(certs) {\n  // create CA store\n  var caStore = {\n    // stored certificates\n    certs: {}\n  };\n\n  /**\n   * Gets the certificate that issued the passed certificate or its\n   * 'parent'.\n   *\n   * @param cert the certificate to get the parent for.\n   *\n   * @return the parent certificate or null if none was found.\n   */\n  caStore.getIssuer = function(cert) {\n    var rval = getBySubject(cert.issuer);\n\n    // see if there are multiple matches\n    /*if(forge.util.isArray(rval)) {\n      // TODO: resolve multiple matches by checking\n      // authorityKey/subjectKey/issuerUniqueID/other identifiers, etc.\n      // FIXME: or alternatively do authority key mapping\n      // if possible (X.509v1 certs can't work?)\n      throw new Error('Resolving multiple issuer matches not implemented yet.');\n    }*/\n\n    return rval;\n  };\n\n  /**\n   * Adds a trusted certificate to the store.\n   *\n   * @param cert the certificate to add as a trusted certificate (either a\n   *          pki.certificate object or a PEM-formatted certificate).\n   */\n  caStore.addCertificate = function(cert) {\n    // convert from pem if necessary\n    if(typeof cert === 'string') {\n      cert = forge.pki.certificateFromPem(cert);\n    }\n\n    ensureSubjectHasHash(cert.subject);\n\n    if(!caStore.hasCertificate(cert)) {  // avoid duplicate certificates in store\n      if(cert.subject.hash in caStore.certs) {\n        // subject hash already exists, append to array\n        var tmp = caStore.certs[cert.subject.hash];\n        if(!forge.util.isArray(tmp)) {\n          tmp = [tmp];\n        }\n        tmp.push(cert);\n        caStore.certs[cert.subject.hash] = tmp;\n      } else {\n        caStore.certs[cert.subject.hash] = cert;\n      }\n    }\n  };\n\n  /**\n   * Checks to see if the given certificate is in the store.\n   *\n   * @param cert the certificate to check (either a pki.certificate or a\n   *          PEM-formatted certificate).\n   *\n   * @return true if the certificate is in the store, false if not.\n   */\n  caStore.hasCertificate = function(cert) {\n    // convert from pem if necessary\n    if(typeof cert === 'string') {\n      cert = forge.pki.certificateFromPem(cert);\n    }\n\n    var match = getBySubject(cert.subject);\n    if(!match) {\n      return false;\n    }\n    if(!forge.util.isArray(match)) {\n      match = [match];\n    }\n    // compare DER-encoding of certificates\n    var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes();\n    for(var i = 0; i < match.length; ++i) {\n      var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes();\n      if(der1 === der2) {\n        return true;\n      }\n    }\n    return false;\n  };\n\n  /**\n   * Lists all of the certificates kept in the store.\n   *\n   * @return an array of all of the pki.certificate objects in the store.\n   */\n  caStore.listAllCertificates = function() {\n    var certList = [];\n\n    for(var hash in caStore.certs) {\n      if(caStore.certs.hasOwnProperty(hash)) {\n        var value = caStore.certs[hash];\n        if(!forge.util.isArray(value)) {\n          certList.push(value);\n        } else {\n          for(var i = 0; i < value.length; ++i) {\n            certList.push(value[i]);\n          }\n        }\n      }\n    }\n\n    return certList;\n  };\n\n  /**\n   * Removes a certificate from the store.\n   *\n   * @param cert the certificate to remove (either a pki.certificate or a\n   *          PEM-formatted certificate).\n   *\n   * @return the certificate that was removed or null if the certificate\n   *           wasn't in store.\n   */\n  caStore.removeCertificate = function(cert) {\n    var result;\n\n    // convert from pem if necessary\n    if(typeof cert === 'string') {\n      cert = forge.pki.certificateFromPem(cert);\n    }\n    ensureSubjectHasHash(cert.subject);\n    if(!caStore.hasCertificate(cert)) {\n      return null;\n    }\n\n    var match = getBySubject(cert.subject);\n\n    if(!forge.util.isArray(match)) {\n      result = caStore.certs[cert.subject.hash];\n      delete caStore.certs[cert.subject.hash];\n      return result;\n    }\n\n    // compare DER-encoding of certificates\n    var der1 = asn1.toDer(pki.certificateToAsn1(cert)).getBytes();\n    for(var i = 0; i < match.length; ++i) {\n      var der2 = asn1.toDer(pki.certificateToAsn1(match[i])).getBytes();\n      if(der1 === der2) {\n        result = match[i];\n        match.splice(i, 1);\n      }\n    }\n    if(match.length === 0) {\n      delete caStore.certs[cert.subject.hash];\n    }\n\n    return result;\n  };\n\n  function getBySubject(subject) {\n    ensureSubjectHasHash(subject);\n    return caStore.certs[subject.hash] || null;\n  }\n\n  function ensureSubjectHasHash(subject) {\n    // produce subject hash if it doesn't exist\n    if(!subject.hash) {\n      var md = forge.md.sha1.create();\n      subject.attributes =  pki.RDNAttributesAsArray(_dnToAsn1(subject), md);\n      subject.hash = md.digest().toHex();\n    }\n  }\n\n  // auto-add passed in certs\n  if(certs) {\n    // parse PEM-formatted certificates as necessary\n    for(var i = 0; i < certs.length; ++i) {\n      var cert = certs[i];\n      caStore.addCertificate(cert);\n    }\n  }\n\n  return caStore;\n};\n\n/**\n * Certificate verification errors, based on TLS.\n */\npki.certificateError = {\n  bad_certificate: 'forge.pki.BadCertificate',\n  unsupported_certificate: 'forge.pki.UnsupportedCertificate',\n  certificate_revoked: 'forge.pki.CertificateRevoked',\n  certificate_expired: 'forge.pki.CertificateExpired',\n  certificate_unknown: 'forge.pki.CertificateUnknown',\n  unknown_ca: 'forge.pki.UnknownCertificateAuthority'\n};\n\n/**\n * Verifies a certificate chain against the given Certificate Authority store\n * with an optional custom verify callback.\n *\n * @param caStore a certificate store to verify against.\n * @param chain the certificate chain to verify, with the root or highest\n *          authority at the end (an array of certificates).\n * @param verify called for every certificate in the chain.\n *\n * The verify callback has the following signature:\n *\n * verified - Set to true if certificate was verified, otherwise the\n *   pki.certificateError for why the certificate failed.\n * depth - The current index in the chain, where 0 is the end point's cert.\n * certs - The certificate chain, *NOTE* an empty chain indicates an anonymous\n *   end point.\n *\n * The function returns true on success and on failure either the appropriate\n * pki.certificateError or an object with 'error' set to the appropriate\n * pki.certificateError and 'message' set to a custom error message.\n *\n * @return true if successful, error thrown if not.\n */\npki.verifyCertificateChain = function(caStore, chain, verify) {\n  /* From: RFC3280 - Internet X.509 Public Key Infrastructure Certificate\n    Section 6: Certification Path Validation\n    See inline parentheticals related to this particular implementation.\n\n    The primary goal of path validation is to verify the binding between\n    a subject distinguished name or a subject alternative name and subject\n    public key, as represented in the end entity certificate, based on the\n    public key of the trust anchor. This requires obtaining a sequence of\n    certificates that support that binding. That sequence should be provided\n    in the passed 'chain'. The trust anchor should be in the given CA\n    store. The 'end entity' certificate is the certificate provided by the\n    end point (typically a server) and is the first in the chain.\n\n    To meet this goal, the path validation process verifies, among other\n    things, that a prospective certification path (a sequence of n\n    certificates or a 'chain') satisfies the following conditions:\n\n    (a) for all x in {1, ..., n-1}, the subject of certificate x is\n          the issuer of certificate x+1;\n\n    (b) certificate 1 is issued by the trust anchor;\n\n    (c) certificate n is the certificate to be validated; and\n\n    (d) for all x in {1, ..., n}, the certificate was valid at the\n          time in question.\n\n    Note that here 'n' is index 0 in the chain and 1 is the last certificate\n    in the chain and it must be signed by a certificate in the connection's\n    CA store.\n\n    The path validation process also determines the set of certificate\n    policies that are valid for this path, based on the certificate policies\n    extension, policy mapping extension, policy constraints extension, and\n    inhibit any-policy extension.\n\n    Note: Policy mapping extension not supported (Not Required).\n\n    Note: If the certificate has an unsupported critical extension, then it\n    must be rejected.\n\n    Note: A certificate is self-issued if the DNs that appear in the subject\n    and issuer fields are identical and are not empty.\n\n    The path validation algorithm assumes the following seven inputs are\n    provided to the path processing logic. What this specific implementation\n    will use is provided parenthetically:\n\n    (a) a prospective certification path of length n (the 'chain')\n    (b) the current date/time: ('now').\n    (c) user-initial-policy-set: A set of certificate policy identifiers\n          naming the policies that are acceptable to the certificate user.\n          The user-initial-policy-set contains the special value any-policy\n          if the user is not concerned about certificate policy\n          (Not implemented. Any policy is accepted).\n    (d) trust anchor information, describing a CA that serves as a trust\n          anchor for the certification path. The trust anchor information\n          includes:\n\n      (1)  the trusted issuer name,\n      (2)  the trusted public key algorithm,\n      (3)  the trusted public key, and\n      (4)  optionally, the trusted public key parameters associated\n             with the public key.\n\n      (Trust anchors are provided via certificates in the CA store).\n\n      The trust anchor information may be provided to the path processing\n      procedure in the form of a self-signed certificate. The trusted anchor\n      information is trusted because it was delivered to the path processing\n      procedure by some trustworthy out-of-band procedure. If the trusted\n      public key algorithm requires parameters, then the parameters are\n      provided along with the trusted public key (No parameters used in this\n      implementation).\n\n    (e) initial-policy-mapping-inhibit, which indicates if policy mapping is\n          allowed in the certification path.\n          (Not implemented, no policy checking)\n\n    (f) initial-explicit-policy, which indicates if the path must be valid\n          for at least one of the certificate policies in the user-initial-\n          policy-set.\n          (Not implemented, no policy checking)\n\n    (g) initial-any-policy-inhibit, which indicates whether the\n          anyPolicy OID should be processed if it is included in a\n          certificate.\n          (Not implemented, so any policy is valid provided that it is\n          not marked as critical) */\n\n  /* Basic Path Processing:\n\n    For each certificate in the 'chain', the following is checked:\n\n    1. The certificate validity period includes the current time.\n    2. The certificate was signed by its parent (where the parent is either\n       the next in the chain or from the CA store). Allow processing to\n       continue to the next step if no parent is found but the certificate is\n       in the CA store.\n    3. TODO: The certificate has not been revoked.\n    4. The certificate issuer name matches the parent's subject name.\n    5. TODO: If the certificate is self-issued and not the final certificate\n       in the chain, skip this step, otherwise verify that the subject name\n       is within one of the permitted subtrees of X.500 distinguished names\n       and that each of the alternative names in the subjectAltName extension\n       (critical or non-critical) is within one of the permitted subtrees for\n       that name type.\n    6. TODO: If the certificate is self-issued and not the final certificate\n       in the chain, skip this step, otherwise verify that the subject name\n       is not within one of the excluded subtrees for X.500 distinguished\n       names and none of the subjectAltName extension names are excluded for\n       that name type.\n    7. The other steps in the algorithm for basic path processing involve\n       handling the policy extension which is not presently supported in this\n       implementation. Instead, if a critical policy extension is found, the\n       certificate is rejected as not supported.\n    8. If the certificate is not the first or if its the only certificate in\n       the chain (having no parent from the CA store or is self-signed) and it\n       has a critical key usage extension, verify that the keyCertSign bit is\n       set. If the key usage extension exists, verify that the basic\n       constraints extension exists. If the basic constraints extension exists,\n       verify that the cA flag is set. If pathLenConstraint is set, ensure that\n       the number of certificates that precede in the chain (come earlier\n       in the chain as implemented below), excluding the very first in the\n       chain (typically the end-entity one), isn't greater than the\n       pathLenConstraint. This constraint limits the number of intermediate\n       CAs that may appear below a CA before only end-entity certificates\n       may be issued. */\n\n  // copy cert chain references to another array to protect against changes\n  // in verify callback\n  chain = chain.slice(0);\n  var certs = chain.slice(0);\n\n  // get current date\n  var now = new Date();\n\n  // verify each cert in the chain using its parent, where the parent\n  // is either the next in the chain or from the CA store\n  var first = true;\n  var error = null;\n  var depth = 0;\n  do {\n    var cert = chain.shift();\n    var parent = null;\n    var selfSigned = false;\n\n    // 1. check valid time\n    if(now < cert.validity.notBefore || now > cert.validity.notAfter) {\n      error = {\n        message: 'Certificate is not valid yet or has expired.',\n        error: pki.certificateError.certificate_expired,\n        notBefore: cert.validity.notBefore,\n        notAfter: cert.validity.notAfter,\n        now: now\n      };\n    }\n\n    // 2. verify with parent from chain or CA store\n    if(error === null) {\n      parent = chain[0] || caStore.getIssuer(cert);\n      if(parent === null) {\n        // check for self-signed cert\n        if(cert.isIssuer(cert)) {\n          selfSigned = true;\n          parent = cert;\n        }\n      }\n\n      if(parent) {\n        // FIXME: current CA store implementation might have multiple\n        // certificates where the issuer can't be determined from the\n        // certificate (happens rarely with, eg: old certificates) so normalize\n        // by always putting parents into an array\n        // TODO: there's may be an extreme degenerate case currently uncovered\n        // where an old intermediate certificate seems to have a matching parent\n        // but none of the parents actually verify ... but the intermediate\n        // is in the CA and it should pass this check; needs investigation\n        var parents = parent;\n        if(!forge.util.isArray(parents)) {\n          parents = [parents];\n        }\n\n        // try to verify with each possible parent (typically only one)\n        var verified = false;\n        while(!verified && parents.length > 0) {\n          parent = parents.shift();\n          try {\n            verified = parent.verify(cert);\n          } catch(ex) {\n            // failure to verify, don't care why, try next one\n          }\n        }\n\n        if(!verified) {\n          error = {\n            message: 'Certificate signature is invalid.',\n            error: pki.certificateError.bad_certificate\n          };\n        }\n      }\n\n      if(error === null && (!parent || selfSigned) &&\n        !caStore.hasCertificate(cert)) {\n        // no parent issuer and certificate itself is not trusted\n        error = {\n          message: 'Certificate is not trusted.',\n          error: pki.certificateError.unknown_ca\n        };\n      }\n    }\n\n    // TODO: 3. check revoked\n\n    // 4. check for matching issuer/subject\n    if(error === null && parent && !cert.isIssuer(parent)) {\n      // parent is not issuer\n      error = {\n        message: 'Certificate issuer is invalid.',\n        error: pki.certificateError.bad_certificate\n      };\n    }\n\n    // 5. TODO: check names with permitted names tree\n\n    // 6. TODO: check names against excluded names tree\n\n    // 7. check for unsupported critical extensions\n    if(error === null) {\n      // supported extensions\n      var se = {\n        keyUsage: true,\n        basicConstraints: true\n      };\n      for(var i = 0; error === null && i < cert.extensions.length; ++i) {\n        var ext = cert.extensions[i];\n        if(ext.critical && !(ext.name in se)) {\n          error = {\n            message:\n              'Certificate has an unsupported critical extension.',\n            error: pki.certificateError.unsupported_certificate\n          };\n        }\n      }\n    }\n\n    // 8. check for CA if cert is not first or is the only certificate\n    // remaining in chain with no parent or is self-signed\n    if(error === null &&\n      (!first || (chain.length === 0 && (!parent || selfSigned)))) {\n      // first check keyUsage extension and then basic constraints\n      var bcExt = cert.getExtension('basicConstraints');\n      var keyUsageExt = cert.getExtension('keyUsage');\n      if(keyUsageExt !== null) {\n        // keyCertSign must be true and there must be a basic\n        // constraints extension\n        if(!keyUsageExt.keyCertSign || bcExt === null) {\n          // bad certificate\n          error = {\n            message:\n              'Certificate keyUsage or basicConstraints conflict ' +\n              'or indicate that the certificate is not a CA. ' +\n              'If the certificate is the only one in the chain or ' +\n              'isn\\'t the first then the certificate must be a ' +\n              'valid CA.',\n            error: pki.certificateError.bad_certificate\n          };\n        }\n      }\n      // basic constraints cA flag must be set\n      if(error === null && bcExt !== null && !bcExt.cA) {\n        // bad certificate\n        error = {\n          message:\n            'Certificate basicConstraints indicates the certificate ' +\n            'is not a CA.',\n          error: pki.certificateError.bad_certificate\n        };\n      }\n      // if error is not null and keyUsage is available, then we know it\n      // has keyCertSign and there is a basic constraints extension too,\n      // which means we can check pathLenConstraint (if it exists)\n      if(error === null && keyUsageExt !== null &&\n        'pathLenConstraint' in bcExt) {\n        // pathLen is the maximum # of intermediate CA certs that can be\n        // found between the current certificate and the end-entity (depth 0)\n        // certificate; this number does not include the end-entity (depth 0,\n        // last in the chain) even if it happens to be a CA certificate itself\n        var pathLen = depth - 1;\n        if(pathLen > bcExt.pathLenConstraint) {\n          // pathLenConstraint violated, bad certificate\n          error = {\n            message:\n              'Certificate basicConstraints pathLenConstraint violated.',\n            error: pki.certificateError.bad_certificate\n          };\n        }\n      }\n    }\n\n    // call application callback\n    var vfd = (error === null) ? true : error.error;\n    var ret = verify ? verify(vfd, depth, certs) : vfd;\n    if(ret === true) {\n      // clear any set error\n      error = null;\n    } else {\n      // if passed basic tests, set default message and alert\n      if(vfd === true) {\n        error = {\n          message: 'The application rejected the certificate.',\n          error: pki.certificateError.bad_certificate\n        };\n      }\n\n      // check for custom error info\n      if(ret || ret === 0) {\n        // set custom message and error\n        if(typeof ret === 'object' && !forge.util.isArray(ret)) {\n          if(ret.message) {\n             error.message = ret.message;\n          }\n          if(ret.error) {\n            error.error = ret.error;\n          }\n        } else if(typeof ret === 'string') {\n          // set custom error\n          error.error = ret;\n        }\n      }\n\n      // throw error\n      throw error;\n    }\n\n    // no longer first cert in chain\n    first = false;\n    ++depth;\n  } while(chain.length > 0);\n\n  return true;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/x509.js\n// module id = 293\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/x509.js")},function(module,exports,__webpack_require__){eval("var BN = __webpack_require__(1136);\nvar stripHexPrefix = __webpack_require__(543);\n\n/**\n * Returns a BN object, converts a number value to a BN\n * @param {String|Number|Object} `arg` input a string number, hex string number, number, BigNumber or BN object\n * @return {Object} `output` BN object of the number\n * @throws if the argument is not an array, object that isn't a bignumber, not a string number or number\n */\nmodule.exports = function numberToBN(arg) {\n  if (typeof arg === 'string' || typeof arg === 'number') {\n    var multiplier = new BN(1); // eslint-disable-line\n    var formattedString = String(arg).toLowerCase().trim();\n    var isHexPrefixed = formattedString.substr(0, 2) === '0x' || formattedString.substr(0, 3) === '-0x';\n    var stringArg = stripHexPrefix(formattedString); // eslint-disable-line\n    if (stringArg.substr(0, 1) === '-') {\n      stringArg = stripHexPrefix(stringArg.slice(1));\n      multiplier = new BN(-1, 10);\n    }\n    stringArg = stringArg === '' ? '0' : stringArg;\n\n    if ((!stringArg.match(/^-?[0-9]+$/) && stringArg.match(/^[0-9A-Fa-f]+$/))\n      || stringArg.match(/^[a-fA-F]+$/)\n      || (isHexPrefixed === true && stringArg.match(/^[0-9A-Fa-f]+$/))) {\n      return new BN(stringArg, 16).mul(multiplier);\n    }\n\n    if ((stringArg.match(/^-?[0-9]+$/) || stringArg === '') && isHexPrefixed === false) {\n      return new BN(stringArg, 10).mul(multiplier);\n    }\n  } else if (typeof arg === 'object' && arg.toString && (!arg.pop && !arg.push)) {\n    if (arg.toString(10).match(/^-?[0-9]+$/) && (arg.mul || arg.dividedToIntegerBy)) {\n      return new BN(arg.toString(10), 10);\n    }\n  }\n\n  throw new Error('[number-to-bn] while converting number ' + JSON.stringify(arg) + ' to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.');\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/number-to-bn/src/index.js\n// module id = 294\n// module chunks = 0\n\n//# sourceURL=../node_modules/number-to-bn/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc');  // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/object-assign/index.js\n// module id = 295\n// module chunks = 0\n\n//# sourceURL=../node_modules/object-assign/index.js")},function(module,exports){eval("exports.endianness = function () { return 'LE' };\n\nexports.hostname = function () {\n    if (typeof location !== 'undefined') {\n        return location.hostname\n    }\n    else return '';\n};\n\nexports.loadavg = function () { return [] };\n\nexports.uptime = function () { return 0 };\n\nexports.freemem = function () {\n    return Number.MAX_VALUE;\n};\n\nexports.totalmem = function () {\n    return Number.MAX_VALUE;\n};\n\nexports.cpus = function () { return [] };\n\nexports.type = function () { return 'Browser' };\n\nexports.release = function () {\n    if (typeof navigator !== 'undefined') {\n        return navigator.appVersion;\n    }\n    return '';\n};\n\nexports.networkInterfaces\n= exports.getNetworkInterfaces\n= function () { return {} };\n\nexports.arch = function () { return 'javascript' };\n\nexports.platform = function () { return 'browser' };\n\nexports.tmpdir = exports.tmpDir = function () {\n    return '/tmp';\n};\n\nexports.EOL = '\\n';\n\nexports.homedir = function () {\n\treturn '/'\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/os-browserify/browser.js\n// module id = 296\n// module chunks = 0\n\n//# sourceURL=../node_modules/os-browserify/browser.js")},function(module,exports,__webpack_require__){eval("\nexports.pbkdf2 = __webpack_require__(1150)\n\nexports.pbkdf2Sync = __webpack_require__(504)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pbkdf2/browser.js\n// module id = 297\n// module chunks = 0\n\n//# sourceURL=../node_modules/pbkdf2/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.defined = function (val) {\n  return val !== null && val !== undefined && (typeof val !== 'number' || !isNaN(val))\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/utils.js\n// module id = 298\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst through = __webpack_require__(206)\n\nconst DEFAULT_MAX_LENGTH = 100\n\nmodule.exports = function block (_maxLength) {\n  const maxLength = _maxLength || DEFAULT_MAX_LENGTH\n\n  var buffered = []\n\n  return through(\n    function transform (data) {\n      buffered = buffered.concat(data)\n\n      while (buffered.length >= maxLength) {\n        const end = maxLength\n        const slice = buffered.slice(0, end)\n        buffered = buffered.slice(end)\n        this.queue(slice)\n      }\n    },\n    function flush (end) {\n      if (buffered.length) {\n        this.queue(buffered)\n        buffered = []\n      }\n\n      this.queue(null)\n    }\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-batch/index.js\n// module id = 299\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-batch/index.js")},function(module,exports){eval("var noop = function () {}\n\nfunction abortAll(ary, abort, cb) {\n  var n = ary.length\n  if(!n) return cb(abort)\n  ary.forEach(function (f) {\n    if(f) f(abort, next)\n    else next()\n  })\n\n  function next() {\n    if(--n) return\n    cb(abort)\n  }\n  if(!n) next()\n}\n\nmodule.exports = function (streams) {\n  return function (abort, cb) {\n    ;(function next () {\n      if(abort)\n        abortAll(streams, abort, cb)\n      else if(!streams.length)\n        cb(true)\n      else if(!streams[0])\n        streams.shift(), next()\n      else\n        streams[0](null, function (err, data) {\n          if(err) {\n            streams.shift() //drop the first, has already ended.\n            if(err === true) next()\n            else             abortAll(streams, err, cb)\n          }\n          else\n            cb(null, data)\n        })\n    })()\n  }\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-cat/index.js\n// module id = 300\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-cat/index.js")},function(module,exports,__webpack_require__){eval("\nexports.source = __webpack_require__(204)\nexports.through = __webpack_require__(1169)\nexports.sink = __webpack_require__(513)\nexports.duplex = __webpack_require__(512)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-defer/index.js\n// module id = 301\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-defer/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar drain = __webpack_require__(153)\n\nmodule.exports = function reduce (reducer, acc, cb ) {\n  if(!cb) cb = acc, acc = null\n  var sink = drain(function (data) {\n    acc = reducer(acc, data)\n  }, function (err) {\n    cb(err, acc)\n  })\n  if (arguments.length === 2)\n    return function (source) {\n      source(null, function (end, data) {\n        //if ended immediately, and no initial...\n        if(end) return cb(end === true ? null : end)\n        acc = data; sink(source)\n      })\n    }\n  else\n    return sink\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/reduce.js\n// module id = 302\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/reduce.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar abortCb = __webpack_require__(521)\n\nmodule.exports = function values (array, onAbort) {\n  if(!array)\n    return function (abort, cb) {\n      if(abort) return abortCb(cb, abort, onAbort)\n      return cb(true)\n    }\n  if(!Array.isArray(array))\n    array = Object.keys(array).map(function (k) {\n      return array[k]\n    })\n  var i = 0\n  return function (abort, cb) {\n    if(abort)\n      return abortCb(cb, abort, onAbort)\n    if(i >= array.length)\n      cb(true)\n    else\n      cb(null, array[i++])\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/values.js\n// module id = 303\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/values.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar tester = __webpack_require__(522)\n\nmodule.exports = function filter (test) {\n  //regexp\n  test = tester(test)\n  return function (read) {\n    return function next (end, cb) {\n      var sync, loop = true\n      while(loop) {\n        loop = false\n        sync = true\n        read(end, function (end, data) {\n          if(!end && !test(data))\n            return sync ? loop = true : next(end, cb)\n          cb(end, data)\n        })\n        sync = false\n      }\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/filter.js\n// module id = 304\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/filter.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, encoding, cb), and it'll handle all\n// the drain event emission and buffering.\n\n\n\n/*<replacement>*/\n\nvar processNextTick = __webpack_require__(203).nextTick;\n/*</replacement>*/\n\nmodule.exports = Writable;\n\n/* <replacement> */\nfunction WriteReq(chunk, encoding, cb) {\n  this.chunk = chunk;\n  this.encoding = encoding;\n  this.callback = cb;\n  this.next = null;\n}\n\n// It seems a linked list but it is not\n// there will be only 2 of these for each stream\nfunction CorkedRequest(state) {\n  var _this = this;\n\n  this.next = null;\n  this.entry = null;\n  this.finish = function () {\n    onCorkedFinish(_this, state);\n  };\n}\n/* </replacement> */\n\n/*<replacement>*/\nvar asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\n/*<replacement>*/\nvar internalUtil = {\n  deprecate: __webpack_require__(1258)\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(529);\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(1).Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\nvar destroyImpl = __webpack_require__(528);\n\nutil.inherits(Writable, Stream);\n\nfunction nop() {}\n\nfunction WritableState(options, stream) {\n  Duplex = Duplex || __webpack_require__(103);\n\n  options = options || {};\n\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  var isDuplex = stream instanceof Duplex;\n\n  // object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!options.objectMode;\n\n  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n  // the point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write()\n  var hwm = options.highWaterMark;\n  var writableHwm = options.writableHighWaterMark;\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\n\n  // cast to ints.\n  this.highWaterMark = Math.floor(this.highWaterMark);\n\n  // if _final has been called\n  this.finalCalled = false;\n\n  // drain event flag.\n  this.needDrain = false;\n  // at the start of calling end()\n  this.ending = false;\n  // when end() has been called, and returned\n  this.ended = false;\n  // when 'finish' is emitted\n  this.finished = false;\n\n  // has it been destroyed\n  this.destroyed = false;\n\n  // should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  var noDecode = options.decodeStrings === false;\n  this.decodeStrings = !noDecode;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0;\n\n  // a flag to see when we're in the middle of a write.\n  this.writing = false;\n\n  // when true all writes will be buffered until .uncork() call\n  this.corked = 0;\n\n  // a flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true;\n\n  // a flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false;\n\n  // the callback that's passed to _write(chunk,cb)\n  this.onwrite = function (er) {\n    onwrite(stream, er);\n  };\n\n  // the callback that the user supplies to write(chunk,encoding,cb)\n  this.writecb = null;\n\n  // the amount that is being written when _write is called.\n  this.writelen = 0;\n\n  this.bufferedRequest = null;\n  this.lastBufferedRequest = null;\n\n  // number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted\n  this.pendingcb = 0;\n\n  // emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams\n  this.prefinished = false;\n\n  // True if the error was already emitted and should not be thrown again\n  this.errorEmitted = false;\n\n  // count buffered requests\n  this.bufferedRequestCount = 0;\n\n  // allocate the first CorkedRequest, there is always\n  // one allocated and free to use, and we maintain at most two\n  this.corkedRequestsFree = new CorkedRequest(this);\n}\n\nWritableState.prototype.getBuffer = function getBuffer() {\n  var current = this.bufferedRequest;\n  var out = [];\n  while (current) {\n    out.push(current);\n    current = current.next;\n  }\n  return out;\n};\n\n(function () {\n  try {\n    Object.defineProperty(WritableState.prototype, 'buffer', {\n      get: internalUtil.deprecate(function () {\n        return this.getBuffer();\n      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')\n    });\n  } catch (_) {}\n})();\n\n// Test _writableState for inheritance to account for Duplex streams,\n// whose prototype chain only points to Readable.\nvar realHasInstance;\nif (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {\n  realHasInstance = Function.prototype[Symbol.hasInstance];\n  Object.defineProperty(Writable, Symbol.hasInstance, {\n    value: function (object) {\n      if (realHasInstance.call(this, object)) return true;\n      if (this !== Writable) return false;\n\n      return object && object._writableState instanceof WritableState;\n    }\n  });\n} else {\n  realHasInstance = function (object) {\n    return object instanceof this;\n  };\n}\n\nfunction Writable(options) {\n  Duplex = Duplex || __webpack_require__(103);\n\n  // Writable ctor is applied to Duplexes, too.\n  // `realHasInstance` is necessary because using plain `instanceof`\n  // would return false, as no `_writableState` property is attached.\n\n  // Trying to use the custom `instanceof` for Writable here will also break the\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\n  // `_writableState` that would lead to infinite recursion.\n  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\n    return new Writable(options);\n  }\n\n  this._writableState = new WritableState(options, this);\n\n  // legacy.\n  this.writable = true;\n\n  if (options) {\n    if (typeof options.write === 'function') this._write = options.write;\n\n    if (typeof options.writev === 'function') this._writev = options.writev;\n\n    if (typeof options.destroy === 'function') this._destroy = options.destroy;\n\n    if (typeof options.final === 'function') this._final = options.final;\n  }\n\n  Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function () {\n  this.emit('error', new Error('Cannot pipe, not readable'));\n};\n\nfunction writeAfterEnd(stream, cb) {\n  var er = new Error('write after end');\n  // TODO: defer error events consistently everywhere, not just the cb\n  stream.emit('error', er);\n  processNextTick(cb, er);\n}\n\n// Checks that a user-supplied chunk is valid, especially for the particular\n// mode the stream is in. Currently this means that `null` is never accepted\n// and undefined/non-string values are only allowed in object mode.\nfunction validChunk(stream, state, chunk, cb) {\n  var valid = true;\n  var er = false;\n\n  if (chunk === null) {\n    er = new TypeError('May not write null values to stream');\n  } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n    er = new TypeError('Invalid non-string/buffer chunk');\n  }\n  if (er) {\n    stream.emit('error', er);\n    processNextTick(cb, er);\n    valid = false;\n  }\n  return valid;\n}\n\nWritable.prototype.write = function (chunk, encoding, cb) {\n  var state = this._writableState;\n  var ret = false;\n  var isBuf = !state.objectMode && _isUint8Array(chunk);\n\n  if (isBuf && !Buffer.isBuffer(chunk)) {\n    chunk = _uint8ArrayToBuffer(chunk);\n  }\n\n  if (typeof encoding === 'function') {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;\n\n  if (typeof cb !== 'function') cb = nop;\n\n  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\n    state.pendingcb++;\n    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\n  }\n\n  return ret;\n};\n\nWritable.prototype.cork = function () {\n  var state = this._writableState;\n\n  state.corked++;\n};\n\nWritable.prototype.uncork = function () {\n  var state = this._writableState;\n\n  if (state.corked) {\n    state.corked--;\n\n    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\n  }\n};\n\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\n  // node::ParseEncoding() requires lower case.\n  if (typeof encoding === 'string') encoding = encoding.toLowerCase();\n  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);\n  this._writableState.defaultEncoding = encoding;\n  return this;\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {\n    chunk = Buffer.from(chunk, encoding);\n  }\n  return chunk;\n}\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\n  if (!isBuf) {\n    var newChunk = decodeChunk(state, chunk, encoding);\n    if (chunk !== newChunk) {\n      isBuf = true;\n      encoding = 'buffer';\n      chunk = newChunk;\n    }\n  }\n  var len = state.objectMode ? 1 : chunk.length;\n\n  state.length += len;\n\n  var ret = state.length < state.highWaterMark;\n  // we must ensure that previous needDrain will not be reset to false.\n  if (!ret) state.needDrain = true;\n\n  if (state.writing || state.corked) {\n    var last = state.lastBufferedRequest;\n    state.lastBufferedRequest = {\n      chunk: chunk,\n      encoding: encoding,\n      isBuf: isBuf,\n      callback: cb,\n      next: null\n    };\n    if (last) {\n      last.next = state.lastBufferedRequest;\n    } else {\n      state.bufferedRequest = state.lastBufferedRequest;\n    }\n    state.bufferedRequestCount += 1;\n  } else {\n    doWrite(stream, state, false, len, chunk, encoding, cb);\n  }\n\n  return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len;\n  state.writecb = cb;\n  state.writing = true;\n  state.sync = true;\n  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\n  state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n  --state.pendingcb;\n\n  if (sync) {\n    // defer the callback if we are being called synchronously\n    // to avoid piling up things on the stack\n    processNextTick(cb, er);\n    // this can emit finish, and it will always happen\n    // after error\n    processNextTick(finishMaybe, stream, state);\n    stream._writableState.errorEmitted = true;\n    stream.emit('error', er);\n  } else {\n    // the caller expect this to happen before if\n    // it is async\n    cb(er);\n    stream._writableState.errorEmitted = true;\n    stream.emit('error', er);\n    // this can emit finish, but finish must\n    // always follow error\n    finishMaybe(stream, state);\n  }\n}\n\nfunction onwriteStateUpdate(state) {\n  state.writing = false;\n  state.writecb = null;\n  state.length -= state.writelen;\n  state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n  var state = stream._writableState;\n  var sync = state.sync;\n  var cb = state.writecb;\n\n  onwriteStateUpdate(state);\n\n  if (er) onwriteError(stream, state, sync, er, cb);else {\n    // Check if we're actually ready to finish, but don't emit yet\n    var finished = needFinish(state);\n\n    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\n      clearBuffer(stream, state);\n    }\n\n    if (sync) {\n      /*<replacement>*/\n      asyncWrite(afterWrite, stream, state, finished, cb);\n      /*</replacement>*/\n    } else {\n      afterWrite(stream, state, finished, cb);\n    }\n  }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n  if (!finished) onwriteDrain(stream, state);\n  state.pendingcb--;\n  cb();\n  finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n  if (state.length === 0 && state.needDrain) {\n    state.needDrain = false;\n    stream.emit('drain');\n  }\n}\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n  state.bufferProcessing = true;\n  var entry = state.bufferedRequest;\n\n  if (stream._writev && entry && entry.next) {\n    // Fast case, write everything using _writev()\n    var l = state.bufferedRequestCount;\n    var buffer = new Array(l);\n    var holder = state.corkedRequestsFree;\n    holder.entry = entry;\n\n    var count = 0;\n    var allBuffers = true;\n    while (entry) {\n      buffer[count] = entry;\n      if (!entry.isBuf) allBuffers = false;\n      entry = entry.next;\n      count += 1;\n    }\n    buffer.allBuffers = allBuffers;\n\n    doWrite(stream, state, true, state.length, buffer, '', holder.finish);\n\n    // doWrite is almost always async, defer these to save a bit of time\n    // as the hot path ends with doWrite\n    state.pendingcb++;\n    state.lastBufferedRequest = null;\n    if (holder.next) {\n      state.corkedRequestsFree = holder.next;\n      holder.next = null;\n    } else {\n      state.corkedRequestsFree = new CorkedRequest(state);\n    }\n    state.bufferedRequestCount = 0;\n  } else {\n    // Slow case, write chunks one-by-one\n    while (entry) {\n      var chunk = entry.chunk;\n      var encoding = entry.encoding;\n      var cb = entry.callback;\n      var len = state.objectMode ? 1 : chunk.length;\n\n      doWrite(stream, state, false, len, chunk, encoding, cb);\n      entry = entry.next;\n      state.bufferedRequestCount--;\n      // if we didn't call the onwrite immediately, then\n      // it means that we need to wait until it does.\n      // also, that means that the chunk and cb are currently\n      // being processed, so move the buffer counter past them.\n      if (state.writing) {\n        break;\n      }\n    }\n\n    if (entry === null) state.lastBufferedRequest = null;\n  }\n\n  state.bufferedRequest = entry;\n  state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function (chunk, encoding, cb) {\n  cb(new Error('_write() is not implemented'));\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function (chunk, encoding, cb) {\n  var state = this._writableState;\n\n  if (typeof chunk === 'function') {\n    cb = chunk;\n    chunk = null;\n    encoding = null;\n  } else if (typeof encoding === 'function') {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\n\n  // .end() fully uncorks\n  if (state.corked) {\n    state.corked = 1;\n    this.uncork();\n  }\n\n  // ignore unnecessary end() calls.\n  if (!state.ending && !state.finished) endWritable(this, state, cb);\n};\n\nfunction needFinish(state) {\n  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\n}\nfunction callFinal(stream, state) {\n  stream._final(function (err) {\n    state.pendingcb--;\n    if (err) {\n      stream.emit('error', err);\n    }\n    state.prefinished = true;\n    stream.emit('prefinish');\n    finishMaybe(stream, state);\n  });\n}\nfunction prefinish(stream, state) {\n  if (!state.prefinished && !state.finalCalled) {\n    if (typeof stream._final === 'function') {\n      state.pendingcb++;\n      state.finalCalled = true;\n      processNextTick(callFinal, stream, state);\n    } else {\n      state.prefinished = true;\n      stream.emit('prefinish');\n    }\n  }\n}\n\nfunction finishMaybe(stream, state) {\n  var need = needFinish(state);\n  if (need) {\n    prefinish(stream, state);\n    if (state.pendingcb === 0) {\n      state.finished = true;\n      stream.emit('finish');\n    }\n  }\n  return need;\n}\n\nfunction endWritable(stream, state, cb) {\n  state.ending = true;\n  finishMaybe(stream, state);\n  if (cb) {\n    if (state.finished) processNextTick(cb);else stream.once('finish', cb);\n  }\n  state.ended = true;\n  stream.writable = false;\n}\n\nfunction onCorkedFinish(corkReq, state, err) {\n  var entry = corkReq.entry;\n  corkReq.entry = null;\n  while (entry) {\n    var cb = entry.callback;\n    state.pendingcb--;\n    cb(err);\n    entry = entry.next;\n  }\n  if (state.corkedRequestsFree) {\n    state.corkedRequestsFree.next = corkReq;\n  } else {\n    state.corkedRequestsFree = corkReq;\n  }\n}\n\nObject.defineProperty(Writable.prototype, 'destroyed', {\n  get: function () {\n    if (this._writableState === undefined) {\n      return false;\n    }\n    return this._writableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (!this._writableState) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._writableState.destroyed = value;\n  }\n});\n\nWritable.prototype.destroy = destroyImpl.destroy;\nWritable.prototype._undestroy = destroyImpl.undestroy;\nWritable.prototype._destroy = function (err, cb) {\n  this.end();\n  cb(err);\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(25).setImmediate, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_writable.js\n// module id = 305\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/_stream_writable.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar inherits = __webpack_require__(3)\nvar HashBase = __webpack_require__(871)\n\nfunction RIPEMD160 () {\n  HashBase.call(this, 64)\n\n  // state\n  this._a = 0x67452301\n  this._b = 0xefcdab89\n  this._c = 0x98badcfe\n  this._d = 0x10325476\n  this._e = 0xc3d2e1f0\n}\n\ninherits(RIPEMD160, HashBase)\n\nRIPEMD160.prototype._update = function () {\n  var m = new Array(16)\n  for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4)\n\n  var al = this._a\n  var bl = this._b\n  var cl = this._c\n  var dl = this._d\n  var el = this._e\n\n  // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\n  // K = 0x00000000\n  // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8\n  al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10)\n  el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10)\n  dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10)\n  cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10)\n  bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10)\n  al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10)\n  el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10)\n  dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10)\n  cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10)\n  bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10)\n  al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10)\n  el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10)\n  dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10)\n  cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10)\n  bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10)\n  al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10)\n\n  // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8\n  // K = 0x5a827999\n  // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12\n  el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10)\n  dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10)\n  cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10)\n  bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10)\n  al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10)\n  el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10)\n  dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10)\n  cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10)\n  bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10)\n  al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10)\n  el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10)\n  dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10)\n  cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10)\n  bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10)\n  al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10)\n  el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10)\n\n  // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12\n  // K = 0x6ed9eba1\n  // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5\n  dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10)\n  cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10)\n  bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10)\n  al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10)\n  el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10)\n  dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10)\n  cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10)\n  bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10)\n  al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10)\n  el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10)\n  dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10)\n  cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10)\n  bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10)\n  al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10)\n  el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10)\n  dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10)\n\n  // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2\n  // K = 0x8f1bbcdc\n  // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12\n  cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10)\n  bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10)\n  al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10)\n  el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10)\n  dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10)\n  cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10)\n  bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10)\n  al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10)\n  el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10)\n  dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10)\n  cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10)\n  bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10)\n  al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10)\n  el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10)\n  dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10)\n  cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10)\n\n  // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n  // K = 0xa953fd4e\n  // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n  bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10)\n  al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10)\n  el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10)\n  dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10)\n  cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10)\n  bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10)\n  al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10)\n  el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10)\n  dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10)\n  cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10)\n  bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10)\n  al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10)\n  el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10)\n  dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10)\n  cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10)\n  bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10)\n\n  var ar = this._a\n  var br = this._b\n  var cr = this._c\n  var dr = this._d\n  var er = this._e\n\n  // M'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12\n  // K' = 0x50a28be6\n  // S'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6\n  ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10)\n  er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10)\n  dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10)\n  cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10)\n  br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10)\n  ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10)\n  er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10)\n  dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10)\n  cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10)\n  br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10)\n  ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10)\n  er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10)\n  dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10)\n  cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10)\n  br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10)\n  ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10)\n\n  // M'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2\n  // K' = 0x5c4dd124\n  // S'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11\n  er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10)\n  dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10)\n  cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10)\n  br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10)\n  ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10)\n  er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10)\n  dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10)\n  cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10)\n  br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10)\n  ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10)\n  er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10)\n  dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10)\n  cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10)\n  br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10)\n  ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10)\n  er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10)\n\n  // M'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13\n  // K' = 0x6d703ef3\n  // S'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5\n  dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10)\n  cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10)\n  br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10)\n  ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10)\n  er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10)\n  dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10)\n  cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10)\n  br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10)\n  ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10)\n  er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10)\n  dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10)\n  cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10)\n  br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10)\n  ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10)\n  er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10)\n  dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10)\n\n  // M'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14\n  // K' = 0x7a6d76e9\n  // S'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8\n  cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10)\n  br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10)\n  ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10)\n  er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10)\n  dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10)\n  cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10)\n  br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10)\n  ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10)\n  er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10)\n  dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10)\n  cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10)\n  br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10)\n  ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10)\n  er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10)\n  dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10)\n  cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10)\n\n  // M'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n  // K' = 0x00000000\n  // S'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n  br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10)\n  ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10)\n  er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10)\n  dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10)\n  cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10)\n  br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10)\n  ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10)\n  er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10)\n  dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10)\n  cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10)\n  br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10)\n  ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10)\n  er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10)\n  dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10)\n  cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10)\n  br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10)\n\n  // change state\n  var t = (this._b + cl + dr) | 0\n  this._b = (this._c + dl + er) | 0\n  this._c = (this._d + el + ar) | 0\n  this._d = (this._e + al + br) | 0\n  this._e = (this._a + bl + cr) | 0\n  this._a = t\n}\n\nRIPEMD160.prototype._digest = function () {\n  // create padding and handle blocks\n  this._block[this._blockOffset++] = 0x80\n  if (this._blockOffset > 56) {\n    this._block.fill(0, this._blockOffset, 64)\n    this._update()\n    this._blockOffset = 0\n  }\n\n  this._block.fill(0, this._blockOffset, 56)\n  this._block.writeUInt32LE(this._length[0], 56)\n  this._block.writeUInt32LE(this._length[1], 60)\n  this._update()\n\n  // produce result\n  var buffer = new Buffer(20)\n  buffer.writeInt32LE(this._a, 0)\n  buffer.writeInt32LE(this._b, 4)\n  buffer.writeInt32LE(this._c, 8)\n  buffer.writeInt32LE(this._d, 12)\n  buffer.writeInt32LE(this._e, 16)\n  return buffer\n}\n\nfunction rotl (x, n) {\n  return (x << n) | (x >>> (32 - n))\n}\n\nfunction fn1 (a, b, c, d, e, m, k, s) {\n  return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn2 (a, b, c, d, e, m, k, s) {\n  return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn3 (a, b, c, d, e, m, k, s) {\n  return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn4 (a, b, c, d, e, m, k, s) {\n  return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\n}\n\nfunction fn5 (a, b, c, d, e, m, k, s) {\n  return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\n}\n\nmodule.exports = RIPEMD160\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ripemd160/index.js\n// module id = 306\n// module chunks = 0\n\n//# sourceURL=../node_modules/ripemd160/index.js")},function(module,exports){eval('module.exports = {"COMPRESSED_TYPE_INVALID":"compressed should be a boolean","EC_PRIVATE_KEY_TYPE_INVALID":"private key should be a Buffer","EC_PRIVATE_KEY_LENGTH_INVALID":"private key length is invalid","EC_PRIVATE_KEY_RANGE_INVALID":"private key range is invalid","EC_PRIVATE_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting private key is invalid","EC_PRIVATE_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PRIVATE_KEY_EXPORT_DER_FAIL":"couldn\'t export to DER format","EC_PRIVATE_KEY_IMPORT_DER_FAIL":"couldn\'t import from DER format","EC_PUBLIC_KEYS_TYPE_INVALID":"public keys should be an Array","EC_PUBLIC_KEYS_LENGTH_INVALID":"public keys Array should have at least 1 element","EC_PUBLIC_KEY_TYPE_INVALID":"public key should be a Buffer","EC_PUBLIC_KEY_LENGTH_INVALID":"public key length is invalid","EC_PUBLIC_KEY_PARSE_FAIL":"the public key could not be parsed or is invalid","EC_PUBLIC_KEY_CREATE_FAIL":"private was invalid, try again","EC_PUBLIC_KEY_TWEAK_ADD_FAIL":"tweak out of range or resulting public key is invalid","EC_PUBLIC_KEY_TWEAK_MUL_FAIL":"tweak out of range","EC_PUBLIC_KEY_COMBINE_FAIL":"the sum of the public keys is not valid","ECDH_FAIL":"scalar was invalid (zero or overflow)","ECDSA_SIGNATURE_TYPE_INVALID":"signature should be a Buffer","ECDSA_SIGNATURE_LENGTH_INVALID":"signature length is invalid","ECDSA_SIGNATURE_PARSE_FAIL":"couldn\'t parse signature","ECDSA_SIGNATURE_PARSE_DER_FAIL":"couldn\'t parse DER signature","ECDSA_SIGNATURE_SERIALIZE_DER_FAIL":"couldn\'t serialize signature to DER format","ECDSA_SIGN_FAIL":"nonce generation function failed or private key is invalid","ECDSA_RECOVER_FAIL":"couldn\'t recover public key from signature","MSG32_TYPE_INVALID":"message should be a Buffer","MSG32_LENGTH_INVALID":"message length is invalid","OPTIONS_TYPE_INVALID":"options should be an Object","OPTIONS_DATA_TYPE_INVALID":"options.data should be a Buffer","OPTIONS_DATA_LENGTH_INVALID":"options.data length is invalid","OPTIONS_NONCEFN_TYPE_INVALID":"options.noncefn should be a Function","RECOVERY_ID_TYPE_INVALID":"recovery should be a Number","RECOVERY_ID_VALUE_INVALID":"recovery should have value between -1 and 4","TWEAK_TYPE_INVALID":"tweak should be a Buffer","TWEAK_LENGTH_INVALID":"tweak length is invalid"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/messages.json\n// module id = 307\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/messages.json')},function(module,exports,__webpack_require__){eval("var exports = module.exports = function SHA (algorithm) {\n  algorithm = algorithm.toLowerCase()\n\n  var Algorithm = exports[algorithm]\n  if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)')\n\n  return new Algorithm()\n}\n\nexports.sha = __webpack_require__(1231)\nexports.sha1 = __webpack_require__(1232)\nexports.sha224 = __webpack_require__(1233)\nexports.sha256 = __webpack_require__(535)\nexports.sha384 = __webpack_require__(1234)\nexports.sha512 = __webpack_require__(536)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/index.js\n// module id = 308\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/index.js")},function(module,exports,__webpack_require__){eval("\n/**\n * Module dependencies.\n */\n\nvar debug = __webpack_require__(5)('socket.io-parser');\nvar Emitter = __webpack_require__(115);\nvar binary = __webpack_require__(1239);\nvar isArray = __webpack_require__(542);\nvar isBuf = __webpack_require__(541);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = 4;\n\n/**\n * Packet types.\n *\n * @api public\n */\n\nexports.types = [\n  'CONNECT',\n  'DISCONNECT',\n  'EVENT',\n  'ACK',\n  'ERROR',\n  'BINARY_EVENT',\n  'BINARY_ACK'\n];\n\n/**\n * Packet type `connect`.\n *\n * @api public\n */\n\nexports.CONNECT = 0;\n\n/**\n * Packet type `disconnect`.\n *\n * @api public\n */\n\nexports.DISCONNECT = 1;\n\n/**\n * Packet type `event`.\n *\n * @api public\n */\n\nexports.EVENT = 2;\n\n/**\n * Packet type `ack`.\n *\n * @api public\n */\n\nexports.ACK = 3;\n\n/**\n * Packet type `error`.\n *\n * @api public\n */\n\nexports.ERROR = 4;\n\n/**\n * Packet type 'binary event'\n *\n * @api public\n */\n\nexports.BINARY_EVENT = 5;\n\n/**\n * Packet type `binary ack`. For acks with binary arguments.\n *\n * @api public\n */\n\nexports.BINARY_ACK = 6;\n\n/**\n * Encoder constructor.\n *\n * @api public\n */\n\nexports.Encoder = Encoder;\n\n/**\n * Decoder constructor.\n *\n * @api public\n */\n\nexports.Decoder = Decoder;\n\n/**\n * A socket.io Encoder instance\n *\n * @api public\n */\n\nfunction Encoder() {}\n\nvar ERROR_PACKET = exports.ERROR + '\"encode error\"';\n\n/**\n * Encode a packet as a single string if non-binary, or as a\n * buffer sequence, depending on packet type.\n *\n * @param {Object} obj - packet object\n * @param {Function} callback - function to handle encodings (likely engine.write)\n * @return Calls callback with Array of encodings\n * @api public\n */\n\nEncoder.prototype.encode = function(obj, callback){\n  debug('encoding packet %j', obj);\n\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    encodeAsBinary(obj, callback);\n  } else {\n    var encoding = encodeAsString(obj);\n    callback([encoding]);\n  }\n};\n\n/**\n * Encode packet as string.\n *\n * @param {Object} packet\n * @return {String} encoded\n * @api private\n */\n\nfunction encodeAsString(obj) {\n\n  // first is type\n  var str = '' + obj.type;\n\n  // attachments if we have them\n  if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {\n    str += obj.attachments + '-';\n  }\n\n  // if we have a namespace other than `/`\n  // we append it followed by a comma `,`\n  if (obj.nsp && '/' !== obj.nsp) {\n    str += obj.nsp + ',';\n  }\n\n  // immediately followed by the id\n  if (null != obj.id) {\n    str += obj.id;\n  }\n\n  // json data\n  if (null != obj.data) {\n    var payload = tryStringify(obj.data);\n    if (payload !== false) {\n      str += payload;\n    } else {\n      return ERROR_PACKET;\n    }\n  }\n\n  debug('encoded %j as %s', obj, str);\n  return str;\n}\n\nfunction tryStringify(str) {\n  try {\n    return JSON.stringify(str);\n  } catch(e){\n    return false;\n  }\n}\n\n/**\n * Encode packet as 'buffer sequence' by removing blobs, and\n * deconstructing packet into object with placeholders and\n * a list of buffers.\n *\n * @param {Object} packet\n * @return {Buffer} encoded\n * @api private\n */\n\nfunction encodeAsBinary(obj, callback) {\n\n  function writeEncoding(bloblessData) {\n    var deconstruction = binary.deconstructPacket(bloblessData);\n    var pack = encodeAsString(deconstruction.packet);\n    var buffers = deconstruction.buffers;\n\n    buffers.unshift(pack); // add packet info to beginning of data list\n    callback(buffers); // write all the buffers\n  }\n\n  binary.removeBlobs(obj, writeEncoding);\n}\n\n/**\n * A socket.io Decoder instance\n *\n * @return {Object} decoder\n * @api public\n */\n\nfunction Decoder() {\n  this.reconstructor = null;\n}\n\n/**\n * Mix in `Emitter` with Decoder.\n */\n\nEmitter(Decoder.prototype);\n\n/**\n * Decodes an ecoded packet string into packet JSON.\n *\n * @param {String} obj - encoded packet\n * @return {Object} packet\n * @api public\n */\n\nDecoder.prototype.add = function(obj) {\n  var packet;\n  if (typeof obj === 'string') {\n    packet = decodeString(obj);\n    if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json\n      this.reconstructor = new BinaryReconstructor(packet);\n\n      // no attachments, labeled binary but no binary data to follow\n      if (this.reconstructor.reconPack.attachments === 0) {\n        this.emit('decoded', packet);\n      }\n    } else { // non-binary full packet\n      this.emit('decoded', packet);\n    }\n  }\n  else if (isBuf(obj) || obj.base64) { // raw binary data\n    if (!this.reconstructor) {\n      throw new Error('got binary data when not reconstructing a packet');\n    } else {\n      packet = this.reconstructor.takeBinaryData(obj);\n      if (packet) { // received final buffer\n        this.reconstructor = null;\n        this.emit('decoded', packet);\n      }\n    }\n  }\n  else {\n    throw new Error('Unknown type: ' + obj);\n  }\n};\n\n/**\n * Decode a packet String (JSON data)\n *\n * @param {String} str\n * @return {Object} packet\n * @api private\n */\n\nfunction decodeString(str) {\n  var i = 0;\n  // look up type\n  var p = {\n    type: Number(str.charAt(0))\n  };\n\n  if (null == exports.types[p.type]) {\n    return error('unknown packet type ' + p.type);\n  }\n\n  // look up attachments if type binary\n  if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {\n    var buf = '';\n    while (str.charAt(++i) !== '-') {\n      buf += str.charAt(i);\n      if (i == str.length) break;\n    }\n    if (buf != Number(buf) || str.charAt(i) !== '-') {\n      throw new Error('Illegal attachments');\n    }\n    p.attachments = Number(buf);\n  }\n\n  // look up namespace (if any)\n  if ('/' === str.charAt(i + 1)) {\n    p.nsp = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (',' === c) break;\n      p.nsp += c;\n      if (i === str.length) break;\n    }\n  } else {\n    p.nsp = '/';\n  }\n\n  // look up id\n  var next = str.charAt(i + 1);\n  if ('' !== next && Number(next) == next) {\n    p.id = '';\n    while (++i) {\n      var c = str.charAt(i);\n      if (null == c || Number(c) != c) {\n        --i;\n        break;\n      }\n      p.id += str.charAt(i);\n      if (i === str.length) break;\n    }\n    p.id = Number(p.id);\n  }\n\n  // look up json data\n  if (str.charAt(++i)) {\n    var payload = tryParse(str.substr(i));\n    var isPayloadValid = payload !== false && (p.type === exports.ERROR || isArray(payload));\n    if (isPayloadValid) {\n      p.data = payload;\n    } else {\n      return error('invalid payload');\n    }\n  }\n\n  debug('decoded %s as %j', str, p);\n  return p;\n}\n\nfunction tryParse(str) {\n  try {\n    return JSON.parse(str);\n  } catch(e){\n    return false;\n  }\n}\n\n/**\n * Deallocates a parser's resources\n *\n * @api public\n */\n\nDecoder.prototype.destroy = function() {\n  if (this.reconstructor) {\n    this.reconstructor.finishedReconstruction();\n  }\n};\n\n/**\n * A manager of a binary event's 'buffer sequence'. Should\n * be constructed whenever a packet of type BINARY_EVENT is\n * decoded.\n *\n * @param {Object} packet\n * @return {BinaryReconstructor} initialized reconstructor\n * @api private\n */\n\nfunction BinaryReconstructor(packet) {\n  this.reconPack = packet;\n  this.buffers = [];\n}\n\n/**\n * Method to be called when binary data received from connection\n * after a BINARY_EVENT packet.\n *\n * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n * @return {null | Object} returns null if more binary data is expected or\n *   a reconstructed packet object if all buffers have been received.\n * @api private\n */\n\nBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n  this.buffers.push(binData);\n  if (this.buffers.length === this.reconPack.attachments) { // done with buffer list\n    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n    this.finishedReconstruction();\n    return packet;\n  }\n  return null;\n};\n\n/**\n * Cleans up binary packet reconstruction variables.\n *\n * @api private\n */\n\nBinaryReconstructor.prototype.finishedReconstruction = function() {\n  this.reconPack = null;\n  this.buffers = [];\n};\n\nfunction error(msg) {\n  return {\n    type: exports.ERROR,\n    data: 'parser error: ' + msg\n  };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/index.js\n// module id = 309\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-parser/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {var pull = __webpack_require__(518)\nvar looper = __webpack_require__(468)\n\nfunction destroy(stream, cb) {\n  function onClose () {\n    cleanup(); cb()\n  }\n  function onError (err) {\n    cleanup(); cb(err)\n  }\n  function cleanup() {\n    stream.removeListener('close', onClose)\n    stream.removeListener('error', onError)\n  }\n  stream.on('close', onClose)\n  stream.on('error', onError)\n}\n\nfunction destroy (stream) {\n  if(!stream.destroy)\n    console.error(\n      'warning, stream-to-pull-stream: \\n'\n    + 'the wrapped node-stream does not implement `destroy`, \\n'\n    + 'this may cause resource leaks.'\n    )\n  else stream.destroy()\n\n}\n\nfunction write(read, stream, cb) {\n  var ended, closed = false, did\n  function done () {\n    if(did) return\n    did = true\n    cb && cb(ended === true ? null : ended)\n  }\n\n  function onClose () {\n    if(closed) return\n    closed = true\n    cleanup()\n    if(!ended) read(ended = true, done)\n    else       done()\n  }\n  function onError (err) {\n    cleanup()\n    if(!ended) read(ended = err, done)\n  }\n  function cleanup() {\n    stream.on('finish', onClose)\n    stream.removeListener('close', onClose)\n    stream.removeListener('error', onError)\n  }\n  stream.on('close', onClose)\n  stream.on('finish', onClose)\n  stream.on('error', onError)\n  process.nextTick(function () {\n    looper(function (next) {\n      read(null, function (end, data) {\n        ended = ended || end\n        //you can't \"end\" a stdout stream, so this needs to be handled specially.\n        if(end === true)\n          return stream._isStdio ? done() : stream.end()\n\n        if(ended = ended || end) {\n          destroy(stream)\n          return done(ended)\n        }\n\n        //I noticed a problem streaming to the terminal:\n        //sometimes the end got cut off, creating invalid output.\n        //it seems that stdout always emits \"drain\" when it ends.\n        //so this seems to work, but i have been unable to reproduce this test\n        //automatically, so you need to run ./test/stdout.js a few times and the end is valid json.\n        if(stream._isStdio)\n          stream.write(data, function () { next() })\n        else {\n          var pause = stream.write(data)\n          if(pause === false)\n            stream.once('drain', next)\n          else next()\n        }\n      })\n    })\n  })\n}\n\nfunction first (emitter, events, handler) {\n  function listener (val) {\n    events.forEach(function (e) {\n      emitter.removeListener(e, listener)\n    })\n    handler(val)\n  }\n  events.forEach(function (e) {\n    emitter.on(e, listener)\n  })\n  return emitter\n}\n\nfunction read2(stream) {\n  var ended = false, waiting = false\n  var _cb\n\n  function read () {\n    var data = stream.read()\n    if(data !== null && _cb) {\n      var cb = _cb; _cb = null\n      cb(null, data)\n    }\n  }\n\n  stream.on('readable', function () {\n    waiting = true\n    _cb && read()\n  })\n  .on('end', function () {\n    ended = true\n    _cb && _cb(ended)\n  })\n  .on('error', function (err) {\n    ended = err\n    _cb && _cb(ended)\n  })\n\n  return function (end, cb) {\n    _cb = cb\n    if(ended)\n      cb(ended)\n    else if(waiting)\n      read()\n  }\n}\n\nfunction read1(stream) {\n  var buffer = [], cbs = [], ended, paused = false\n\n  var draining\n  function drain() {\n    while((buffer.length || ended) && cbs.length)\n      cbs.shift()(buffer.length ? null : ended, buffer.shift())\n    if(!buffer.length && (paused)) {\n      paused = false\n      stream.resume()\n    }\n  }\n\n  stream.on('data', function (data) {\n    buffer.push(data)\n    drain()\n    if(buffer.length && stream.pause) {\n      paused = true\n      stream.pause()\n    }\n  })\n  stream.on('end', function () {\n    ended = true\n    drain()\n  })\n  stream.on('close', function () {\n    ended = true\n    drain()\n  })\n  stream.on('error', function (err) {\n    ended = err\n    drain()\n  })\n  return function (abort, cb) {\n    if(!cb) throw new Error('*must* provide cb')\n    if(abort) {\n      function onAbort () {\n        while(cbs.length) cbs.shift()(abort)\n        cb(abort)\n      }\n      //if the stream happens to have already ended, then we don't need to abort.\n      if(ended) return onAbort()\n      stream.once('close', onAbort)\n      destroy(stream)\n    }\n    else {\n      cbs.push(cb)\n      drain()\n    }\n  }\n}\n\nvar read = read1\n\nvar sink = function (stream, cb) {\n  return function (read) {\n    return write(read, stream, cb)\n  }\n}\n\nvar source = function (stream) {\n  return read1(stream)\n}\n\nexports = module.exports = function (stream, cb) {\n  return (\n    (stream.writable && stream.write)\n    ? stream.readable\n      ? function(_read) {\n          write(_read, stream, cb);\n          return read1(stream)\n        }\n      : sink(stream, cb)\n    : source(stream)\n  )\n}\n\nexports.sink = sink\nexports.source = source\nexports.read = read\nexports.read1 = read1\nexports.read2 = read2\nexports.duplex = function (stream, cb) {\n  return {\n    source: source(stream),\n    sink: sink(stream, cb)\n  }\n}\nexports.transform = function (stream) {\n  return function (read) {\n    var _source = source(stream)\n    sink(stream)(read); return _source\n  }\n}\n\n\n\n\n\n\n\n\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stream-to-pull-stream/index.js\n// module id = 310\n// module chunks = 0\n\n//# sourceURL=../node_modules/stream-to-pull-stream/index.js")},function(module,exports){eval("var types = {\n  Array: function (value) { return value !== null && value !== undefined && value.constructor === Array },\n  Boolean: function (value) { return typeof value === 'boolean' },\n  Function: function (value) { return typeof value === 'function' },\n  Nil: function (value) { return value === undefined || value === null },\n  Number: function (value) { return typeof value === 'number' },\n  Object: function (value) { return typeof value === 'object' },\n  String: function (value) { return typeof value === 'string' },\n  '': function () { return true }\n}\n\n// TODO: deprecate\ntypes.Null = types.Nil\n\nfor (var typeName in types) {\n  types[typeName].toJSON = function (t) {\n    return t\n  }.bind(null, typeName)\n}\n\nmodule.exports = types\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/typeforce/native.js\n// module id = 311\n// module chunks = 0\n\n//# sourceURL=../node_modules/typeforce/native.js")},function(module,exports,__webpack_require__){eval("var rng = __webpack_require__(550);\nvar bytesToUuid = __webpack_require__(549);\n\nfunction v4(options, buf, offset) {\n  var i = buf && offset || 0;\n\n  if (typeof(options) == 'string') {\n    buf = options === 'binary' ? new Array(16) : null;\n    options = null;\n  }\n  options = options || {};\n\n  var rnds = options.random || (options.rng || rng)();\n\n  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n  rnds[6] = (rnds[6] & 0x0f) | 0x40;\n  rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n  // Copy bytes to buffer, if provided\n  if (buf) {\n    for (var ii = 0; ii < 16; ++ii) {\n      buf[i + ii] = rnds[ii];\n    }\n  }\n\n  return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/v4.js\n// module id = 312\n// module chunks = 0\n\n//# sourceURL=../node_modules/uuid/v4.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\n\n// Number.MAX_SAFE_INTEGER\nvar MAX_SAFE_INTEGER = 9007199254740991\n\nfunction checkUInt53 (n) {\n  if (n < 0 || n > MAX_SAFE_INTEGER || n % 1 !== 0) throw new RangeError('value out of range')\n}\n\nfunction encode (number, buffer, offset) {\n  checkUInt53(number)\n\n  if (!buffer) buffer = Buffer.allocUnsafe(encodingLength(number))\n  if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')\n  if (!offset) offset = 0\n\n  // 8 bit\n  if (number < 0xfd) {\n    buffer.writeUInt8(number, offset)\n    encode.bytes = 1\n\n  // 16 bit\n  } else if (number <= 0xffff) {\n    buffer.writeUInt8(0xfd, offset)\n    buffer.writeUInt16LE(number, offset + 1)\n    encode.bytes = 3\n\n  // 32 bit\n  } else if (number <= 0xffffffff) {\n    buffer.writeUInt8(0xfe, offset)\n    buffer.writeUInt32LE(number, offset + 1)\n    encode.bytes = 5\n\n  // 64 bit\n  } else {\n    buffer.writeUInt8(0xff, offset)\n    buffer.writeUInt32LE(number >>> 0, offset + 1)\n    buffer.writeUInt32LE((number / 0x100000000) | 0, offset + 5)\n    encode.bytes = 9\n  }\n\n  return buffer\n}\n\nfunction decode (buffer, offset) {\n  if (!Buffer.isBuffer(buffer)) throw new TypeError('buffer must be a Buffer instance')\n  if (!offset) offset = 0\n\n  var first = buffer.readUInt8(offset)\n\n  // 8 bit\n  if (first < 0xfd) {\n    decode.bytes = 1\n    return first\n\n  // 16 bit\n  } else if (first === 0xfd) {\n    decode.bytes = 3\n    return buffer.readUInt16LE(offset + 1)\n\n  // 32 bit\n  } else if (first === 0xfe) {\n    decode.bytes = 5\n    return buffer.readUInt32LE(offset + 1)\n\n  // 64 bit\n  } else {\n    decode.bytes = 9\n    var lo = buffer.readUInt32LE(offset + 1)\n    var hi = buffer.readUInt32LE(offset + 5)\n    var number = hi * 0x0100000000 + lo\n    checkUInt53(number)\n\n    return number\n  }\n}\n\nfunction encodingLength (number) {\n  checkUInt53(number)\n\n  return (\n    number < 0xfd ? 1\n  : number <= 0xffff ? 3\n  : number <= 0xffffffff ? 5\n  : 9\n  )\n}\n\nmodule.exports = { encode: encode, decode: decode, encodingLength: encodingLength }\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varuint-bitcoin/index.js\n// module id = 313\n// module chunks = 0\n\n//# sourceURL=../node_modules/varuint-bitcoin/index.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(Buffer) {var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();\n\nvar Bytes = __webpack_require__(315);\nvar Nat = __webpack_require__(557);\nvar elliptic = __webpack_require__(28);\nvar rlp = __webpack_require__(558);\nvar secp256k1 = new elliptic.ec("secp256k1"); // eslint-disable-line\n\nvar _require = __webpack_require__(556),\n    keccak256 = _require.keccak256,\n    keccak256s = _require.keccak256s;\n\nvar create = function create(entropy) {\n  var innerHex = keccak256(Bytes.concat(Bytes.random(32), entropy || Bytes.random(32)));\n  var middleHex = Bytes.concat(Bytes.concat(Bytes.random(32), innerHex), Bytes.random(32));\n  var outerHex = keccak256(middleHex);\n  return fromPrivate(outerHex);\n};\n\nvar toChecksum = function toChecksum(address) {\n  var addressHash = keccak256s(address.slice(2));\n  var checksumAddress = "0x";\n  for (var i = 0; i < 40; i++) {\n    checksumAddress += parseInt(addressHash[i + 2], 16) > 7 ? address[i + 2].toUpperCase() : address[i + 2];\n  }return checksumAddress;\n};\n\nvar fromPrivate = function fromPrivate(privateKey) {\n  var buffer = new Buffer(privateKey.slice(2), "hex");\n  var ecKey = secp256k1.keyFromPrivate(buffer);\n  var publicKey = "0x" + ecKey.getPublic(false, \'hex\').slice(2);\n  var publicHash = keccak256(publicKey);\n  var address = toChecksum("0x" + publicHash.slice(-40));\n  return {\n    address: address,\n    privateKey: privateKey\n  };\n};\n\nvar encodeSignature = function encodeSignature(_ref) {\n  var _ref2 = _slicedToArray(_ref, 3),\n      v = _ref2[0],\n      r = Bytes.pad(32, _ref2[1]),\n      s = Bytes.pad(32, _ref2[2]);\n\n  return Bytes.flatten([r, s, v]);\n};\n\nvar decodeSignature = function decodeSignature(hex) {\n  return [Bytes.slice(64, Bytes.length(hex), hex), Bytes.slice(0, 32, hex), Bytes.slice(32, 64, hex)];\n};\n\nvar makeSigner = function makeSigner(addToV) {\n  return function (hash, privateKey) {\n    var signature = secp256k1.keyFromPrivate(new Buffer(privateKey.slice(2), "hex")).sign(new Buffer(hash.slice(2), "hex"), { canonical: true });\n    return encodeSignature([Nat.fromString(Bytes.fromNumber(addToV + signature.recoveryParam)), Bytes.pad(32, Bytes.fromNat("0x" + signature.r.toString(16))), Bytes.pad(32, Bytes.fromNat("0x" + signature.s.toString(16)))]);\n  };\n};\n\nvar sign = makeSigner(27); // v=27|28 instead of 0|1...\n\nvar recover = function recover(hash, signature) {\n  var vals = decodeSignature(signature);\n  var vrs = { v: Bytes.toNumber(vals[0]), r: vals[1].slice(2), s: vals[2].slice(2) };\n  var ecPublicKey = secp256k1.recoverPubKey(new Buffer(hash.slice(2), "hex"), vrs, vrs.v < 2 ? vrs.v : 1 - vrs.v % 2); // because odd vals mean v=0... sadly that means v=0 means v=1... I hate that\n  var publicKey = "0x" + ecPublicKey.encode("hex", false).slice(2);\n  var publicHash = keccak256(publicKey);\n  var address = toChecksum("0x" + publicHash.slice(-40));\n  return address;\n};\n\nmodule.exports = {\n  create: create,\n  toChecksum: toChecksum,\n  fromPrivate: fromPrivate,\n  sign: sign,\n  makeSigner: makeSigner,\n  recover: recover,\n  encodeSignature: encodeSignature,\n  decodeSignature: decodeSignature\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/account.js\n// module id = 314\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js')},function(module,exports,__webpack_require__){eval('var A = __webpack_require__(1284);\n\nvar at = function at(bytes, index) {\n  return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\n};\n\nvar random = function random(bytes) {\n  var rnd = void 0;\n  if (typeof window !== "undefined" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(60).randomBytes(bytes);else throw "Safe random numbers not available.";\n  var hex = "0x";\n  for (var i = 0; i < bytes; ++i) {\n    hex += ("00" + rnd[i].toString(16)).slice(-2);\n  }return hex;\n};\n\nvar length = function length(a) {\n  return (a.length - 2) / 2;\n};\n\nvar flatten = function flatten(a) {\n  return "0x" + a.reduce(function (r, s) {\n    return r + s.slice(2);\n  }, "");\n};\n\nvar slice = function slice(i, j, bs) {\n  return "0x" + bs.slice(i * 2 + 2, j * 2 + 2);\n};\n\nvar reverse = function reverse(hex) {\n  var rev = "0x";\n  for (var i = 0, l = length(hex); i < l; ++i) {\n    rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\n  }\n  return rev;\n};\n\nvar pad = function pad(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : pad(l, "0x" + "0" + hex.slice(2));\n};\n\nvar padRight = function padRight(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : padRight(l, hex + "0");\n};\n\nvar toArray = function toArray(hex) {\n  var arr = [];\n  for (var i = 2, l = hex.length; i < l; i += 2) {\n    arr.push(parseInt(hex.slice(i, i + 2), 16));\n  }return arr;\n};\n\nvar fromArray = function fromArray(arr) {\n  var hex = "0x";\n  for (var i = 0, l = arr.length; i < l; ++i) {\n    var b = arr[i];\n    hex += (b < 16 ? "0" : "") + b.toString(16);\n  }\n  return hex;\n};\n\nvar toUint8Array = function toUint8Array(hex) {\n  return new Uint8Array(toArray(hex));\n};\n\nvar fromUint8Array = function fromUint8Array(arr) {\n  return fromArray([].slice.call(arr, 0));\n};\n\nvar fromNumber = function fromNumber(num) {\n  var hex = num.toString(16);\n  return hex.length % 2 === 0 ? "0x" + hex : "0x0" + hex;\n};\n\nvar toNumber = function toNumber(hex) {\n  return parseInt(hex.slice(2), 16);\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b.slice(2));\n};\n\nvar fromNat = function fromNat(bn) {\n  return bn === "0x0" ? "0x" : bn.length % 2 === 0 ? bn : "0x0" + bn.slice(2);\n};\n\nvar toNat = function toNat(bn) {\n  return bn[2] === "0" ? "0x" + bn.slice(3) : bn;\n};\n\nvar fromAscii = function fromAscii(ascii) {\n  var hex = "0x";\n  for (var i = 0; i < ascii.length; ++i) {\n    hex += ("00" + ascii.charCodeAt(i).toString(16)).slice(-2);\n  }return hex;\n};\n\nvar toAscii = function toAscii(hex) {\n  var ascii = "";\n  for (var i = 2; i < hex.length; i += 2) {\n    ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\n  }return ascii;\n};\n\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\nvar fromString = function fromString(s) {\n  var makeByte = function makeByte(uint8) {\n    var b = uint8.toString(16);\n    return b.length < 2 ? "0" + b : b;\n  };\n  var bytes = "0x";\n  for (var ci = 0; ci != s.length; ci++) {\n    var c = s.charCodeAt(ci);\n    if (c < 128) {\n      bytes += makeByte(c);\n      continue;\n    }\n    if (c < 2048) {\n      bytes += makeByte(c >> 6 | 192);\n    } else {\n      if (c > 0xd7ff && c < 0xdc00) {\n        if (++ci == s.length) return null;\n        var c2 = s.charCodeAt(ci);\n        if (c2 < 0xdc00 || c2 > 0xdfff) return null;\n        c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n        bytes += makeByte(c >> 18 | 240);\n        bytes += makeByte(c >> 12 & 63 | 128);\n      } else {\n        // c <= 0xffff\n        bytes += makeByte(c >> 12 | 224);\n      }\n      bytes += makeByte(c >> 6 & 63 | 128);\n    }\n    bytes += makeByte(c & 63 | 128);\n  }\n  return bytes;\n};\n\nvar toString = function toString(bytes) {\n  var s = \'\';\n  var i = 0;\n  var l = length(bytes);\n  while (i < l) {\n    var c = at(bytes, i++);\n    if (c > 127) {\n      if (c > 191 && c < 224) {\n        if (i >= l) return null;\n        c = (c & 31) << 6 | at(bytes, i) & 63;\n      } else if (c > 223 && c < 240) {\n        if (i + 1 >= l) return null;\n        c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else if (c > 239 && c < 248) {\n        if (i + 2 >= l) return null;\n        c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else return null;\n      ++i;\n    }\n    if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n      c -= 0x10000;\n      s += String.fromCharCode(c >> 10 | 0xd800);\n      s += String.fromCharCode(c & 0x3FF | 0xdc00);\n    } else return null;\n  }\n  return s;\n};\n\nmodule.exports = {\n  random: random,\n  length: length,\n  concat: concat,\n  flatten: flatten,\n  slice: slice,\n  reverse: reverse,\n  pad: pad,\n  padRight: padRight,\n  fromAscii: fromAscii,\n  toAscii: toAscii,\n  fromString: fromString,\n  toString: toString,\n  fromNumber: fromNumber,\n  toNumber: toNumber,\n  fromNat: fromNat,\n  toNat: toNat,\n  fromArray: fromArray,\n  toArray: toArray,\n  fromUint8Array: fromUint8Array,\n  toUint8Array: toUint8Array\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/bytes.js\n// module id = 315\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  _cache: {},\n  _count: 0,\n  _eraseIndex: 0,\n  _usedList: {},\n  _usedIndex: {},\n  _CACHE_SIZE: 5000,\n\n  get: function(xkey, number, hardened) {\n    hardened = !!hardened;\n    var key = xkey + '/' + number + '/' + hardened;\n    if (this._cache[key]) {\n      this._cacheHit(key);\n      return this._cache[key];\n    }\n  },\n  set: function(xkey, number, hardened, derived) {\n    hardened = !!hardened;\n    var key = xkey + '/' + number + '/' + hardened;\n    this._cache[key] = derived;\n    this._cacheHit(key);\n  },\n  _cacheHit: function(key) {\n    if (this._usedIndex[key]) {\n      delete this._usedList[this._usedIndex[key]];\n    }\n    this._usedList[this._count] = key;\n    this._usedIndex[key] = this._count;\n    this._count++;\n    this._cacheRemove();\n  },\n  _cacheRemove: function() {\n    while (this._eraseIndex < this._count - this._CACHE_SIZE) {\n      if (this._usedList[this._eraseIndex]) {\n        var removeKey = this._usedList[this._eraseIndex];\n        delete this._usedIndex[removeKey];\n        delete this._cache[removeKey];\n      }\n      delete this._usedList[this._eraseIndex];\n      this._eraseIndex++;\n    }\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/hdkeycache.js\n// module id = 316\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/hdkeycache.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\nfunction Opcode(num) {\n  if (!(this instanceof Opcode)) {\n    return new Opcode(num);\n  }\n\n  var value;\n\n  if (_.isNumber(num)) {\n    value = num;\n  } else if (_.isString(num)) {\n    value = Opcode.map[num];\n  } else {\n    throw new TypeError('Unrecognized num type: \"' + typeof(num) + '\" for Opcode');\n  }\n\n  JSUtil.defineImmutable(this, {\n    num: value\n  });\n\n  return this;\n}\n\nOpcode.fromBuffer = function(buf) {\n  $.checkArgument(BufferUtil.isBuffer(buf));\n  return new Opcode(Number('0x' + buf.toString('hex')));\n};\n\nOpcode.fromNumber = function(num) {\n  $.checkArgument(_.isNumber(num));\n  return new Opcode(num);\n};\n\nOpcode.fromString = function(str) {\n  $.checkArgument(_.isString(str));\n  var value = Opcode.map[str];\n  if (typeof value === 'undefined') {\n    throw new TypeError('Invalid opcodestr');\n  }\n  return new Opcode(value);\n};\n\nOpcode.prototype.toHex = function() {\n  return this.num.toString(16);\n};\n\nOpcode.prototype.toBuffer = function() {\n  return new Buffer(this.toHex(), 'hex');\n};\n\nOpcode.prototype.toNumber = function() {\n  return this.num;\n};\n\nOpcode.prototype.toString = function() {\n  var str = Opcode.reverseMap[this.num];\n  if (typeof str === 'undefined') {\n    throw new Error('Opcode does not have a string representation');\n  }\n  return str;\n};\n\nOpcode.smallInt = function(n) {\n  $.checkArgument(_.isNumber(n), 'Invalid Argument: n should be number');\n  $.checkArgument(n >= 0 && n <= 16, 'Invalid Argument: n must be between 0 and 16');\n  if (n === 0) {\n    return Opcode('OP_0');\n  }\n  return new Opcode(Opcode.map.OP_1 + n - 1);\n};\n\nOpcode.map = {\n  // push value\n  OP_FALSE: 0,\n  OP_0: 0,\n  OP_PUSHDATA1: 76,\n  OP_PUSHDATA2: 77,\n  OP_PUSHDATA4: 78,\n  OP_1NEGATE: 79,\n  OP_RESERVED: 80,\n  OP_TRUE: 81,\n  OP_1: 81,\n  OP_2: 82,\n  OP_3: 83,\n  OP_4: 84,\n  OP_5: 85,\n  OP_6: 86,\n  OP_7: 87,\n  OP_8: 88,\n  OP_9: 89,\n  OP_10: 90,\n  OP_11: 91,\n  OP_12: 92,\n  OP_13: 93,\n  OP_14: 94,\n  OP_15: 95,\n  OP_16: 96,\n\n  // control\n  OP_NOP: 97,\n  OP_VER: 98,\n  OP_IF: 99,\n  OP_NOTIF: 100,\n  OP_VERIF: 101,\n  OP_VERNOTIF: 102,\n  OP_ELSE: 103,\n  OP_ENDIF: 104,\n  OP_VERIFY: 105,\n  OP_RETURN: 106,\n\n  // stack ops\n  OP_TOALTSTACK: 107,\n  OP_FROMALTSTACK: 108,\n  OP_2DROP: 109,\n  OP_2DUP: 110,\n  OP_3DUP: 111,\n  OP_2OVER: 112,\n  OP_2ROT: 113,\n  OP_2SWAP: 114,\n  OP_IFDUP: 115,\n  OP_DEPTH: 116,\n  OP_DROP: 117,\n  OP_DUP: 118,\n  OP_NIP: 119,\n  OP_OVER: 120,\n  OP_PICK: 121,\n  OP_ROLL: 122,\n  OP_ROT: 123,\n  OP_SWAP: 124,\n  OP_TUCK: 125,\n\n  // splice ops\n  OP_CAT: 126,\n  OP_SUBSTR: 127,\n  OP_LEFT: 128,\n  OP_RIGHT: 129,\n  OP_SIZE: 130,\n\n  // bit logic\n  OP_INVERT: 131,\n  OP_AND: 132,\n  OP_OR: 133,\n  OP_XOR: 134,\n  OP_EQUAL: 135,\n  OP_EQUALVERIFY: 136,\n  OP_RESERVED1: 137,\n  OP_RESERVED2: 138,\n\n  // numeric\n  OP_1ADD: 139,\n  OP_1SUB: 140,\n  OP_2MUL: 141,\n  OP_2DIV: 142,\n  OP_NEGATE: 143,\n  OP_ABS: 144,\n  OP_NOT: 145,\n  OP_0NOTEQUAL: 146,\n\n  OP_ADD: 147,\n  OP_SUB: 148,\n  OP_MUL: 149,\n  OP_DIV: 150,\n  OP_MOD: 151,\n  OP_LSHIFT: 152,\n  OP_RSHIFT: 153,\n\n  OP_BOOLAND: 154,\n  OP_BOOLOR: 155,\n  OP_NUMEQUAL: 156,\n  OP_NUMEQUALVERIFY: 157,\n  OP_NUMNOTEQUAL: 158,\n  OP_LESSTHAN: 159,\n  OP_GREATERTHAN: 160,\n  OP_LESSTHANOREQUAL: 161,\n  OP_GREATERTHANOREQUAL: 162,\n  OP_MIN: 163,\n  OP_MAX: 164,\n\n  OP_WITHIN: 165,\n\n  // crypto\n  OP_RIPEMD160: 166,\n  OP_SHA1: 167,\n  OP_SHA256: 168,\n  OP_HASH160: 169,\n  OP_HASH256: 170,\n  OP_CODESEPARATOR: 171,\n  OP_CHECKSIG: 172,\n  OP_CHECKSIGVERIFY: 173,\n  OP_CHECKMULTISIG: 174,\n  OP_CHECKMULTISIGVERIFY: 175,\n\n  OP_CHECKLOCKTIMEVERIFY: 177,\n\n  // expansion\n  OP_NOP1: 176,\n  OP_NOP2: 177,\n  OP_NOP3: 178,\n  OP_NOP4: 179,\n  OP_NOP5: 180,\n  OP_NOP6: 181,\n  OP_NOP7: 182,\n  OP_NOP8: 183,\n  OP_NOP9: 184,\n  OP_NOP10: 185,\n\n  // template matching params\n  OP_PUBKEYHASH: 253,\n  OP_PUBKEY: 254,\n  OP_INVALIDOPCODE: 255\n};\n\nOpcode.reverseMap = [];\n\nfor (var k in Opcode.map) {\n  Opcode.reverseMap[Opcode.map[k]] = k;\n}\n\n// Easier access to opcodes\n_.extend(Opcode, Opcode.map);\n\n/**\n * @returns true if opcode is one of OP_0, OP_1, ..., OP_16\n */\nOpcode.isSmallIntOp = function(opcode) {\n  if (opcode instanceof Opcode) {\n    opcode = opcode.toNumber();\n  }\n  return ((opcode === Opcode.map.OP_0) ||\n    ((opcode >= Opcode.map.OP_1) && (opcode <= Opcode.map.OP_16)));\n};\n\n/**\n * Will return a string formatted for the console\n *\n * @returns {string} Script opcode\n */\nOpcode.prototype.inspect = function() {\n  return '<Opcode: ' + this.toString() + ', hex: '+this.toHex()+', decimal: '+this.num+'>';\n};\n\nmodule.exports = Opcode;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/opcode.js\n// module id = 317\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/opcode.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(159);\n\nmodule.exports.PublicKey = __webpack_require__(1323);\nmodule.exports.PublicKeyHash = __webpack_require__(1324);\nmodule.exports.MultiSig = __webpack_require__(1321);\nmodule.exports.MultiSigScriptHash = __webpack_require__(1322);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/index.js\n// module id = 318\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar buffer = __webpack_require__(0);\nvar compare = Buffer.compare || __webpack_require__(1328);\n\nvar errors = __webpack_require__(56);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar Hash = __webpack_require__(36);\nvar Signature = __webpack_require__(55);\nvar Sighash = __webpack_require__(84);\n\nvar Address = __webpack_require__(108);\nvar UnspentOutput = __webpack_require__(570);\nvar Input = __webpack_require__(318);\nvar PublicKeyHashInput = Input.PublicKeyHash;\nvar PublicKeyInput = Input.PublicKey;\nvar MultiSigScriptHashInput = Input.MultiSigScriptHash;\nvar MultiSigInput = Input.MultiSig;\nvar Output = __webpack_require__(83);\nvar Script = __webpack_require__(57);\nvar PrivateKey = __webpack_require__(215);\nvar BN = __webpack_require__(30);\n\nvar JSDescription = __webpack_require__(1325);\n\n/**\n * Represents a transaction, a set of inputs and outputs to change ownership of tokens\n *\n * @param {*} serialized\n * @constructor\n */\nfunction Transaction(serialized) {\n  if (!(this instanceof Transaction)) {\n    return new Transaction(serialized);\n  }\n  this.inputs = [];\n  this.outputs = [];\n  this.joinSplits = [];\n  this._inputAmount = undefined;\n  this._outputAmount = undefined;\n\n  if (serialized) {\n    if (serialized instanceof Transaction) {\n      return Transaction.shallowCopy(serialized);\n    } else if (JSUtil.isHexa(serialized)) {\n      this.fromString(serialized);\n    } else if (BufferUtil.isBuffer(serialized)) {\n      this.fromBuffer(serialized);\n    } else if (_.isObject(serialized)) {\n      this.fromObject(serialized);\n    } else {\n      throw new errors.InvalidArgument('Must provide an object or string to deserialize a transaction');\n    }\n  } else {\n    this._newTransaction();\n  }\n}\n\nvar CURRENT_VERSION = 1;\nvar DEFAULT_NLOCKTIME = 0;\nvar MAX_BLOCK_SIZE = 1000000;\n\n// Minimum amount for an output for it not to be considered a dust output\nTransaction.DUST_AMOUNT = 546;\n\n// Margin of error to allow fees in the vecinity of the expected value but doesn't allow a big difference\nTransaction.FEE_SECURITY_MARGIN = 15;\n\n// max amount of satoshis in circulation\nTransaction.MAX_MONEY = 21000000 * 1e8;\n\n// nlocktime limit to be considered block height rather than a timestamp\nTransaction.NLOCKTIME_BLOCKHEIGHT_LIMIT = 5e8;\n\n// Max value for an unsigned 32 bit value\nTransaction.NLOCKTIME_MAX_VALUE = 4294967295;\n\n// Value used for fee estimation (satoshis per kilobyte)\nTransaction.FEE_PER_KB = 10000;\n\n// Safe upper bound for change address script size in bytes\nTransaction.CHANGE_OUTPUT_MAX_SIZE = 20 + 4 + 34 + 4;\nTransaction.MAXIMUM_EXTRA_SIZE = 4 + 9 + 9 + 4;\n\n/* Constructors and Serialization */\n\n/**\n * Create a 'shallow' copy of the transaction, by serializing and deserializing\n * it dropping any additional information that inputs and outputs may have hold\n *\n * @param {Transaction} transaction\n * @return {Transaction}\n */\nTransaction.shallowCopy = function(transaction) {\n  var copy = new Transaction(transaction.toBuffer());\n  return copy;\n};\n\nvar hashProperty = {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    return new BufferReader(this._getHash()).readReverse().toString('hex');\n  }\n};\nObject.defineProperty(Transaction.prototype, 'hash', hashProperty);\nObject.defineProperty(Transaction.prototype, 'id', hashProperty);\n\nvar ioProperty = {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    return this._getInputAmount();\n  }\n};\nObject.defineProperty(Transaction.prototype, 'inputAmount', ioProperty);\nioProperty.get = function() {\n  return this._getOutputAmount();\n};\nObject.defineProperty(Transaction.prototype, 'outputAmount', ioProperty);\n\n/**\n * Retrieve the little endian hash of the transaction (used for serialization)\n * @return {Buffer}\n */\nTransaction.prototype._getHash = function() {\n  return Hash.sha256sha256(this.toBuffer());\n};\n\n/**\n * Retrieve a hexa string that can be used with bitcoind's CLI interface\n * (decoderawtransaction, sendrawtransaction)\n *\n * @param {Object|boolean=} unsafe if true, skip all tests. if it's an object,\n *   it's expected to contain a set of flags to skip certain tests:\n * * `disableAll`: disable all checks\n * * `disableSmallFees`: disable checking for fees that are too small\n * * `disableLargeFees`: disable checking for fees that are too large\n * * `disableIsFullySigned`: disable checking if all inputs are fully signed\n * * `disableDustOutputs`: disable checking if there are no outputs that are dust amounts\n * * `disableMoreOutputThanInput`: disable checking if the transaction spends more bitcoins than the sum of the input amounts\n * @return {string}\n */\nTransaction.prototype.serialize = function(unsafe) {\n  if (true === unsafe || unsafe && unsafe.disableAll) {\n    return this.uncheckedSerialize();\n  } else {\n    return this.checkedSerialize(unsafe);\n  }\n};\n\nTransaction.prototype.uncheckedSerialize = Transaction.prototype.toString = function() {\n  return this.toBuffer().toString('hex');\n};\n\n/**\n * Retrieve a hexa string that can be used with bitcoind's CLI interface\n * (decoderawtransaction, sendrawtransaction)\n *\n * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize}\n * @return {string}\n */\nTransaction.prototype.checkedSerialize = function(opts) {\n  var serializationError = this.getSerializationError(opts);\n  if (serializationError) {\n    serializationError.message += ' Use Transaction#uncheckedSerialize if you want to skip security checks. ' +\n      'See http://bitcore.io/guide/transaction.html#Serialization for more info.';\n    throw serializationError;\n  }\n  return this.uncheckedSerialize();\n};\n\nTransaction.prototype.invalidSatoshis = function() {\n  var invalid = false;\n  for (var i = 0; i < this.outputs.length; i++) {\n    if (this.outputs[i].invalidSatoshis()) {\n      invalid = true;\n    }\n  }\n  return invalid;\n};\n\n/**\n * Retrieve a possible error that could appear when trying to serialize and\n * broadcast this transaction.\n *\n * @param {Object} opts allows to skip certain tests. {@see Transaction#serialize}\n * @return {bitcore.Error}\n */\nTransaction.prototype.getSerializationError = function(opts) {\n  opts = opts || {};\n\n  if (this.invalidSatoshis()) {\n    return new errors.Transaction.InvalidSatoshis();\n  }\n\n  var unspent = this._getUnspentValue();\n  var unspentError;\n  if (unspent < 0) {\n    if (!opts.disableMoreOutputThanInput) {\n      unspentError = new errors.Transaction.InvalidOutputAmountSum();\n    }\n  } else {\n    unspentError = this._hasFeeError(opts, unspent);\n  }\n\n  return unspentError ||\n    this._hasDustOutputs(opts) ||\n    this._isMissingSignatures(opts);\n};\n\nTransaction.prototype._hasFeeError = function(opts, unspent) {\n\n  if (!_.isUndefined(this._fee) && this._fee !== unspent) {\n    return new errors.Transaction.FeeError.Different(\n      'Unspent value is ' + unspent + ' but specified fee is ' + this._fee\n    );\n  }\n\n  if (!opts.disableLargeFees) {\n    var maximumFee = Math.floor(Transaction.FEE_SECURITY_MARGIN * this._estimateFee());\n    if (unspent > maximumFee) {\n      if (this._missingChange()) {\n        return new errors.Transaction.ChangeAddressMissing(\n          'Fee is too large and no change address was provided'\n        );\n      }\n      return new errors.Transaction.FeeError.TooLarge(\n        'expected less than ' + maximumFee + ' but got ' + unspent\n      );\n    }\n  }\n\n  if (!opts.disableSmallFees) {\n    var minimumFee = Math.ceil(this._estimateFee() / Transaction.FEE_SECURITY_MARGIN);\n    if (unspent < minimumFee) {\n      return new errors.Transaction.FeeError.TooSmall(\n        'expected more than ' + minimumFee + ' but got ' + unspent\n      );\n    }\n  }\n};\n\nTransaction.prototype._missingChange = function() {\n  return !this._changeScript;\n};\n\nTransaction.prototype._hasDustOutputs = function(opts) {\n  if (opts.disableDustOutputs) {\n    return;\n  }\n  var index, output;\n  for (index in this.outputs) {\n    output = this.outputs[index];\n    if (output.satoshis < Transaction.DUST_AMOUNT && !output.script.isDataOut()) {\n      return new errors.Transaction.DustOutputs();\n    }\n  }\n};\n\nTransaction.prototype._isMissingSignatures = function(opts) {\n  if (opts.disableIsFullySigned) {\n    return;\n  }\n  if (!this.isFullySigned()) {\n    return new errors.Transaction.MissingSignatures();\n  }\n};\n\nTransaction.prototype.inspect = function() {\n  return '<Transaction: ' + this.uncheckedSerialize() + '>';\n};\n\nTransaction.prototype.toBuffer = function() {\n  var writer = new BufferWriter();\n  return this.toBufferWriter(writer).toBuffer();\n};\n\nTransaction.prototype.toBufferWriter = function(writer) {\n  writer.writeUInt32LE(this.version);\n  writer.writeVarintNum(this.inputs.length);\n  _.each(this.inputs, function(input) {\n    input.toBufferWriter(writer);\n  });\n  writer.writeVarintNum(this.outputs.length);\n  _.each(this.outputs, function(output) {\n    output.toBufferWriter(writer);\n  });\n  writer.writeUInt32LE(this.nLockTime);\n  if (this.version >= 2) {\n    writer.writeVarintNum(this.joinSplits.length);\n    _.each(this.joinSplits, function(jsdesc) {\n      jsdesc.toBufferWriter(writer);\n    });\n    if (this.joinSplits.length > 0) {\n      writer.write(this.joinSplitPubKey);\n      writer.write(this.joinSplitSig);\n    }\n  }\n  return writer;\n};\n\nTransaction.prototype.fromBuffer = function(buffer) {\n  var reader = new BufferReader(buffer);\n  return this.fromBufferReader(reader);\n};\n\nTransaction.prototype.fromBufferReader = function(reader) {\n  $.checkArgument(!reader.finished(), 'No transaction data received');\n  var i, sizeTxIns, sizeTxOuts, sizeJSDescs;\n\n  this.version = reader.readUInt32LE();\n  sizeTxIns = reader.readVarintNum();\n  for (i = 0; i < sizeTxIns; i++) {\n    var input = Input.fromBufferReader(reader);\n    this.inputs.push(input);\n  }\n  sizeTxOuts = reader.readVarintNum();\n  for (i = 0; i < sizeTxOuts; i++) {\n    this.outputs.push(Output.fromBufferReader(reader));\n  }\n  this.nLockTime = reader.readUInt32LE();\n  if (this.version >= 2) {\n    sizeJSDescs = reader.readVarintNum();\n    for (i = 0; i < sizeJSDescs; i++) {\n      this.joinSplits.push(JSDescription.fromBufferReader(reader));\n    }\n    if (sizeJSDescs > 0) {\n      this.joinSplitPubKey = reader.read(32);\n      this.joinSplitSig = reader.read(64);\n    }\n  }\n  return this;\n};\n\nTransaction.prototype.toObject = Transaction.prototype.toJSON = function toObject() {\n  var inputs = [];\n  this.inputs.forEach(function(input) {\n    inputs.push(input.toObject());\n  });\n  var outputs = [];\n  this.outputs.forEach(function(output) {\n    outputs.push(output.toObject());\n  });\n  var obj = {\n    hash: this.hash,\n    version: this.version,\n    inputs: inputs,\n    outputs: outputs,\n    nLockTime: this.nLockTime\n  };\n  if (this.version >= 2) {\n    var joinSplits = [];\n    this.joinSplits.forEach(function(joinSplit) {\n      joinSplits.push(joinSplit.toObject());\n    });\n    obj.joinSplits = joinSplits;\n    if (this.joinSplits.length > 0) {\n      obj.joinSplitPubKey = BufferUtil.reverse(this.joinSplitPubKey).toString('hex');\n      obj.joinSplitSig = this.joinSplitSig.toString('hex');\n    }\n  }\n  if (this._changeScript) {\n    obj.changeScript = this._changeScript.toString();\n  }\n  if (!_.isUndefined(this._changeIndex)) {\n    obj.changeIndex = this._changeIndex;\n  }\n  if (!_.isUndefined(this._fee)) {\n    obj.fee = this._fee;\n  }\n  return obj;\n};\n\nTransaction.prototype.fromObject = function fromObject(arg) {\n  /* jshint maxstatements: 20 */\n  $.checkArgument(_.isObject(arg) || arg instanceof Transaction);\n  var self = this;\n  var transaction;\n  if (arg instanceof Transaction) {\n    transaction = transaction.toObject();\n  } else {\n    transaction = arg;\n  }\n  _.each(transaction.inputs, function(input) {\n    if (!input.output || !input.output.script) {\n      self.uncheckedAddInput(new Input(input));\n      return;\n    }\n    var script = new Script(input.output.script);\n    var txin;\n    if (script.isPublicKeyHashOut()) {\n      txin = new Input.PublicKeyHash(input);\n    } else if (script.isScriptHashOut() && input.publicKeys && input.threshold) {\n      txin = new Input.MultiSigScriptHash(\n        input, input.publicKeys, input.threshold, input.signatures\n      );\n    } else if (script.isPublicKeyOut()) {\n      txin = new Input.PublicKey(input);\n    } else {\n      throw new errors.Transaction.Input.UnsupportedScript(input.output.script);\n    }\n    self.addInput(txin);\n  });\n  _.each(transaction.outputs, function(output) {\n    self.addOutput(new Output(output));\n  });\n  if (transaction.changeIndex) {\n    this._changeIndex = transaction.changeIndex;\n  }\n  if (transaction.changeScript) {\n    this._changeScript = new Script(transaction.changeScript);\n  }\n  if (transaction.fee) {\n    this._fee = transaction.fee;\n  }\n  this.nLockTime = transaction.nLockTime;\n  this.version = transaction.version;\n  if (this.version >= 2) {\n    _.each(transaction.joinSplits, function(joinSplit) {\n      self.joinSplits.push(new JSDescription(joinSplit));\n    });\n    if (self.joinSplits.length > 0) {\n      self.joinSplitPubKey = BufferUtil.reverse(new Buffer(transaction.joinSplitPubKey, 'hex'));\n      self.joinSplitSig = new Buffer(transaction.joinSplitSig, 'hex');\n    }\n  }\n  this._checkConsistency(arg);\n  return this;\n};\n\nTransaction.prototype._checkConsistency = function(arg) {\n  if (!_.isUndefined(this._changeIndex)) {\n    $.checkState(this._changeScript);\n    $.checkState(this.outputs[this._changeIndex]);\n    $.checkState(this.outputs[this._changeIndex].script.toString() ===\n      this._changeScript.toString());\n  }\n  if (arg && arg.hash) {\n    $.checkState(arg.hash === this.hash, 'Hash in object does not match transaction hash');\n  }\n};\n\n/**\n * Sets nLockTime so that transaction is not valid until the desired date(a\n * timestamp in seconds since UNIX epoch is also accepted)\n *\n * @param {Date | Number} time\n * @return {Transaction} this\n */\nTransaction.prototype.lockUntilDate = function(time) {\n  $.checkArgument(time);\n  if (_.isNumber(time) && time < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) {\n    throw new errors.Transaction.LockTimeTooEarly();\n  }\n  if (_.isDate(time)) {\n    time = time.getTime() / 1000;\n  }\n\n  for (var i = 0; i < this.inputs.length; i++) {\n    if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){\n      this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER;\n    }\n  }\n\n  this.nLockTime = time;\n  return this;\n};\n\n/**\n * Sets nLockTime so that transaction is not valid until the desired block\n * height.\n *\n * @param {Number} height\n * @return {Transaction} this\n */\nTransaction.prototype.lockUntilBlockHeight = function(height) {\n  $.checkArgument(_.isNumber(height));\n  if (height >= Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) {\n    throw new errors.Transaction.BlockHeightTooHigh();\n  }\n  if (height < 0) {\n    throw new errors.Transaction.NLockTimeOutOfRange();\n  }\n\n  for (var i = 0; i < this.inputs.length; i++) {\n    if (this.inputs[i].sequenceNumber === Input.DEFAULT_SEQNUMBER){\n      this.inputs[i].sequenceNumber = Input.DEFAULT_LOCKTIME_SEQNUMBER;\n    }\n  }\n\n\n  this.nLockTime = height;\n  return this;\n};\n\n/**\n *  Returns a semantic version of the transaction's nLockTime.\n *  @return {Number|Date}\n *  If nLockTime is 0, it returns null,\n *  if it is < 500000000, it returns a block height (number)\n *  else it returns a Date object.\n */\nTransaction.prototype.getLockTime = function() {\n  if (!this.nLockTime) {\n    return null;\n  }\n  if (this.nLockTime < Transaction.NLOCKTIME_BLOCKHEIGHT_LIMIT) {\n    return this.nLockTime;\n  }\n  return new Date(1000 * this.nLockTime);\n};\n\nTransaction.prototype.fromString = function(string) {\n  this.fromBuffer(new buffer.Buffer(string, 'hex'));\n};\n\nTransaction.prototype._newTransaction = function() {\n  this.version = CURRENT_VERSION;\n  this.nLockTime = DEFAULT_NLOCKTIME;\n};\n\n/* Transaction creation interface */\n\n/**\n * @typedef {Object} Transaction~fromObject\n * @property {string} prevTxId\n * @property {number} outputIndex\n * @property {(Buffer|string|Script)} script\n * @property {number} satoshis\n */\n\n/**\n * Add an input to this transaction. This is a high level interface\n * to add an input, for more control, use @{link Transaction#addInput}.\n *\n * Can receive, as output information, the output of bitcoind's `listunspent` command,\n * and a slightly fancier format recognized by bitcore:\n *\n * ```\n * {\n *  address: 'mszYqVnqKoQx4jcTdJXxwKAissE3Jbrrc1',\n *  txId: 'a477af6b2667c29670467e4e0728b685ee07b240235771862318e29ddbe58458',\n *  outputIndex: 0,\n *  script: Script.empty(),\n *  satoshis: 1020000\n * }\n * ```\n * Where `address` can be either a string or a bitcore Address object. The\n * same is true for `script`, which can be a string or a bitcore Script.\n *\n * Beware that this resets all the signatures for inputs (in further versions,\n * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset).\n *\n * @example\n * ```javascript\n * var transaction = new Transaction();\n *\n * // From a pay to public key hash output from bitcoind's listunspent\n * transaction.from({'txid': '0000...', vout: 0, amount: 0.1, scriptPubKey: 'OP_DUP ...'});\n *\n * // From a pay to public key hash output\n * transaction.from({'txId': '0000...', outputIndex: 0, satoshis: 1000, script: 'OP_DUP ...'});\n *\n * // From a multisig P2SH output\n * transaction.from({'txId': '0000...', inputIndex: 0, satoshis: 1000, script: '... OP_HASH'},\n *                  ['03000...', '02000...'], 2);\n * ```\n *\n * @param {(Array.<Transaction~fromObject>|Transaction~fromObject)} utxo\n * @param {Array=} pubkeys\n * @param {number=} threshold\n */\nTransaction.prototype.from = function(utxo, pubkeys, threshold) {\n  if (_.isArray(utxo)) {\n    var self = this;\n    _.each(utxo, function(utxo) {\n      self.from(utxo, pubkeys, threshold);\n    });\n    return this;\n  }\n  var exists = _.any(this.inputs, function(input) {\n    // TODO: Maybe prevTxId should be a string? Or defined as read only property?\n    return input.prevTxId.toString('hex') === utxo.txId && input.outputIndex === utxo.outputIndex;\n  });\n  if (exists) {\n    return this;\n  }\n  if (pubkeys && threshold) {\n    this._fromMultisigUtxo(utxo, pubkeys, threshold);\n  } else {\n    this._fromNonP2SH(utxo);\n  }\n  return this;\n};\n\nTransaction.prototype._fromNonP2SH = function(utxo) {\n  var clazz;\n  utxo = new UnspentOutput(utxo);\n  if (utxo.script.isPublicKeyHashOut()) {\n    clazz = PublicKeyHashInput;\n  } else if (utxo.script.isPublicKeyOut()) {\n    clazz = PublicKeyInput;\n  } else {\n    clazz = Input;\n  }\n  this.addInput(new clazz({\n    output: new Output({\n      script: utxo.script,\n      satoshis: utxo.satoshis\n    }),\n    prevTxId: utxo.txId,\n    outputIndex: utxo.outputIndex,\n    script: Script.empty()\n  }));\n};\n\nTransaction.prototype._fromMultisigUtxo = function(utxo, pubkeys, threshold) {\n  $.checkArgument(threshold <= pubkeys.length,\n    'Number of required signatures must be greater than the number of public keys');\n  var clazz;\n  utxo = new UnspentOutput(utxo);\n  if (utxo.script.isMultisigOut()) {\n    clazz = MultiSigInput;\n  } else if (utxo.script.isScriptHashOut()) {\n    clazz = MultiSigScriptHashInput;\n  } else {\n    throw new Error(\"@TODO\");\n  }\n  this.addInput(new clazz({\n    output: new Output({\n      script: utxo.script,\n      satoshis: utxo.satoshis\n    }),\n    prevTxId: utxo.txId,\n    outputIndex: utxo.outputIndex,\n    script: Script.empty()\n  }, pubkeys, threshold));\n};\n\n/**\n * Add an input to this transaction. The input must be an instance of the `Input` class.\n * It should have information about the Output that it's spending, but if it's not already\n * set, two additional parameters, `outputScript` and `satoshis` can be provided.\n *\n * @param {Input} input\n * @param {String|Script} outputScript\n * @param {number} satoshis\n * @return Transaction this, for chaining\n */\nTransaction.prototype.addInput = function(input, outputScript, satoshis) {\n  $.checkArgumentType(input, Input, 'input');\n  if (!input.output && (_.isUndefined(outputScript) || _.isUndefined(satoshis))) {\n    throw new errors.Transaction.NeedMoreInfo('Need information about the UTXO script and satoshis');\n  }\n  if (!input.output && outputScript && !_.isUndefined(satoshis)) {\n    outputScript = outputScript instanceof Script ? outputScript : new Script(outputScript);\n    $.checkArgumentType(satoshis, 'number', 'satoshis');\n    input.output = new Output({\n      script: outputScript,\n      satoshis: satoshis\n    });\n  }\n  return this.uncheckedAddInput(input);\n};\n\n/**\n * Add an input to this transaction, without checking that the input has information about\n * the output that it's spending.\n *\n * @param {Input} input\n * @return Transaction this, for chaining\n */\nTransaction.prototype.uncheckedAddInput = function(input) {\n  $.checkArgumentType(input, Input, 'input');\n  this.inputs.push(input);\n  this._inputAmount = undefined;\n  this._updateChangeOutput();\n  return this;\n};\n\n/**\n * Returns true if the transaction has enough info on all inputs to be correctly validated\n *\n * @return {boolean}\n */\nTransaction.prototype.hasAllUtxoInfo = function() {\n  return _.all(this.inputs.map(function(input) {\n    return !!input.output;\n  }));\n};\n\n/**\n * Manually set the fee for this transaction. Beware that this resets all the signatures\n * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not\n * be reset).\n *\n * @param {number} amount satoshis to be sent\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.fee = function(amount) {\n  $.checkArgument(_.isNumber(amount), 'amount must be a number');\n  this._fee = amount;\n  this._updateChangeOutput();\n  return this;\n};\n\n/**\n * Manually set the fee per KB for this transaction. Beware that this resets all the signatures\n * for inputs (in further versions, SIGHASH_SINGLE or SIGHASH_NONE signatures will not\n * be reset).\n *\n * @param {number} amount satoshis per KB to be sent\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.feePerKb = function(amount) {\n  $.checkArgument(_.isNumber(amount), 'amount must be a number');\n  this._feePerKb = amount;\n  this._updateChangeOutput();\n  return this;\n};\n\n/* Output management */\n\n/**\n * Set the change address for this transaction\n *\n * Beware that this resets all the signatures for inputs (in further versions,\n * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset).\n *\n * @param {Address} address An address for change to be sent to.\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.change = function(address) {\n  $.checkArgument(address, 'address is required');\n  this._changeScript = Script.fromAddress(address);\n  this._updateChangeOutput();\n  return this;\n};\n\n\n/**\n * @return {Output} change output, if it exists\n */\nTransaction.prototype.getChangeOutput = function() {\n  if (!_.isUndefined(this._changeIndex)) {\n    return this.outputs[this._changeIndex];\n  }\n  return null;\n};\n\n/**\n * @typedef {Object} Transaction~toObject\n * @property {(string|Address)} address\n * @property {number} satoshis\n */\n\n/**\n * Add an output to the transaction.\n *\n * Beware that this resets all the signatures for inputs (in further versions,\n * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset).\n *\n * @param {(string|Address|Array.<Transaction~toObject>)} address\n * @param {number} amount in satoshis\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.to = function(address, amount) {\n  if (_.isArray(address)) {\n    var self = this;\n    _.each(address, function(to) {\n      self.to(to.address, to.satoshis);\n    });\n    return this;\n  }\n\n  $.checkArgument(\n    JSUtil.isNaturalNumber(amount),\n    'Amount is expected to be a positive integer'\n  );\n  this.addOutput(new Output({\n    script: Script(new Address(address)),\n    satoshis: amount\n  }));\n  return this;\n};\n\n/**\n * Add an OP_RETURN output to the transaction.\n *\n * Beware that this resets all the signatures for inputs (in further versions,\n * SIGHASH_SINGLE or SIGHASH_NONE signatures will not be reset).\n *\n * @param {Buffer|string} value the data to be stored in the OP_RETURN output.\n *    In case of a string, the UTF-8 representation will be stored\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.addData = function(value) {\n  this.addOutput(new Output({\n    script: Script.buildDataOut(value),\n    satoshis: 0\n  }));\n  return this;\n};\n\n\n/**\n * Add an output to the transaction.\n *\n * @param {Output} output the output to add.\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.addOutput = function(output) {\n  $.checkArgumentType(output, Output, 'output');\n  this._addOutput(output);\n  this._updateChangeOutput();\n  return this;\n};\n\n\n/**\n * Remove all outputs from the transaction.\n *\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.clearOutputs = function() {\n  this.outputs = [];\n  this._clearSignatures();\n  this._outputAmount = undefined;\n  this._changeIndex = undefined;\n  this._updateChangeOutput();\n  return this;\n};\n\n\nTransaction.prototype._addOutput = function(output) {\n  this.outputs.push(output);\n  this._outputAmount = undefined;\n};\n\n\n/**\n * Calculates or gets the total output amount in satoshis\n *\n * @return {Number} the transaction total output amount\n */\nTransaction.prototype._getOutputAmount = function() {\n  if (_.isUndefined(this._outputAmount)) {\n    var self = this;\n    this._outputAmount = 0;\n    _.each(this.outputs, function(output) {\n      self._outputAmount += output.satoshis;\n    });\n  }\n  return this._outputAmount;\n};\n\n\n/**\n * Calculates or gets the total input amount in satoshis\n *\n * @return {Number} the transaction total input amount\n */\nTransaction.prototype._getInputAmount = function() {\n  if (_.isUndefined(this._inputAmount)) {\n    var self = this;\n    this._inputAmount = 0;\n    _.each(this.inputs, function(input) {\n      if (_.isUndefined(input.output)) {\n        throw new errors.Transaction.Input.MissingPreviousOutput();\n      }\n      self._inputAmount += input.output.satoshis;\n    });\n  }\n  return this._inputAmount;\n};\n\nTransaction.prototype._updateChangeOutput = function() {\n  if (!this._changeScript) {\n    return;\n  }\n  this._clearSignatures();\n  if (!_.isUndefined(this._changeIndex)) {\n    this._removeOutput(this._changeIndex);\n  }\n  var available = this._getUnspentValue();\n  var fee = this.getFee();\n  var changeAmount = available - fee;\n  if (changeAmount > 0) {\n    this._changeIndex = this.outputs.length;\n    this._addOutput(new Output({\n      script: this._changeScript,\n      satoshis: changeAmount\n    }));\n  } else {\n    this._changeIndex = undefined;\n  }\n};\n/**\n * Calculates the fee of the transaction.\n *\n * If there's a fixed fee set, return that.\n *\n * If there is no change output set, the fee is the\n * total value of the outputs minus inputs. Note that\n * a serialized transaction only specifies the value\n * of its outputs. (The value of inputs are recorded\n * in the previous transaction outputs being spent.)\n * This method therefore raises a \"MissingPreviousOutput\"\n * error when called on a serialized transaction.\n *\n * If there's no fee set and no change address,\n * estimate the fee based on size.\n *\n * @return {Number} fee of this transaction in satoshis\n */\nTransaction.prototype.getFee = function() {\n  if (this.isCoinbase()) {\n    return 0;\n  }\n  if (!_.isUndefined(this._fee)) {\n    return this._fee;\n  }\n  // if no change output is set, fees should equal all the unspent amount\n  if (!this._changeScript) {\n    return this._getUnspentValue();\n  }\n  return this._estimateFee();\n};\n\n/**\n * Estimates fee from serialized transaction size in bytes.\n */\nTransaction.prototype._estimateFee = function() {\n  var estimatedSize = this._estimateSize();\n  var available = this._getUnspentValue();\n  return Transaction._estimateFee(estimatedSize, available, this._feePerKb);\n};\n\nTransaction.prototype._getUnspentValue = function() {\n  return this._getInputAmount() - this._getOutputAmount();\n};\n\nTransaction.prototype._clearSignatures = function() {\n  _.each(this.inputs, function(input) {\n    input.clearSignatures();\n  });\n};\n\nTransaction._estimateFee = function(size, amountAvailable, feePerKb) {\n  var fee = Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB);\n  if (amountAvailable > fee) {\n    size += Transaction.CHANGE_OUTPUT_MAX_SIZE;\n  }\n  return Math.ceil(size / 1000) * (feePerKb || Transaction.FEE_PER_KB);\n};\n\nTransaction.prototype._estimateSize = function() {\n  var result = Transaction.MAXIMUM_EXTRA_SIZE;\n  _.each(this.inputs, function(input) {\n    result += input._estimateSize();\n  });\n  _.each(this.outputs, function(output) {\n    result += output.script.toBuffer().length + 9;\n  });\n  return result;\n};\n\nTransaction.prototype._removeOutput = function(index) {\n  var output = this.outputs[index];\n  this.outputs = _.without(this.outputs, output);\n  this._outputAmount = undefined;\n};\n\nTransaction.prototype.removeOutput = function(index) {\n  this._removeOutput(index);\n  this._updateChangeOutput();\n};\n\n/**\n * Sort a transaction's inputs and outputs according to BIP69\n *\n * @see {https://github.com/bitcoin/bips/blob/master/bip-0069.mediawiki}\n * @return {Transaction} this\n */\nTransaction.prototype.sort = function() {\n  this.sortInputs(function(inputs) {\n    var copy = Array.prototype.concat.apply([], inputs);\n    copy.sort(function(first, second) {\n      return compare(first.prevTxId, second.prevTxId)\n        || first.outputIndex - second.outputIndex;\n    });\n    return copy;\n  });\n  this.sortOutputs(function(outputs) {\n    var copy = Array.prototype.concat.apply([], outputs);\n    copy.sort(function(first, second) {\n      return first.satoshis - second.satoshis\n        || compare(first.script.toBuffer(), second.script.toBuffer());\n    });\n    return copy;\n  });\n  return this;\n};\n\n/**\n * Randomize this transaction's outputs ordering. The shuffling algorithm is a\n * version of the Fisher-Yates shuffle, provided by lodash's _.shuffle().\n *\n * @return {Transaction} this\n */\nTransaction.prototype.shuffleOutputs = function() {\n  return this.sortOutputs(_.shuffle);\n};\n\n/**\n * Sort this transaction's outputs, according to a given sorting function that\n * takes an array as argument and returns a new array, with the same elements\n * but with a different order. The argument function MUST NOT modify the order\n * of the original array\n *\n * @param {Function} sortingFunction\n * @return {Transaction} this\n */\nTransaction.prototype.sortOutputs = function(sortingFunction) {\n  var outs = sortingFunction(this.outputs);\n  return this._newOutputOrder(outs);\n};\n\n/**\n * Sort this transaction's inputs, according to a given sorting function that\n * takes an array as argument and returns a new array, with the same elements\n * but with a different order.\n *\n * @param {Function} sortingFunction\n * @return {Transaction} this\n */\nTransaction.prototype.sortInputs = function(sortingFunction) {\n  this.inputs = sortingFunction(this.inputs);\n  this._clearSignatures();\n  return this;\n};\n\nTransaction.prototype._newOutputOrder = function(newOutputs) {\n  var isInvalidSorting = (this.outputs.length !== newOutputs.length ||\n                          _.difference(this.outputs, newOutputs).length !== 0);\n  if (isInvalidSorting) {\n    throw new errors.Transaction.InvalidSorting();\n  }\n\n  if (!_.isUndefined(this._changeIndex)) {\n    var changeOutput = this.outputs[this._changeIndex];\n    this._changeIndex = _.findIndex(newOutputs, changeOutput);\n  }\n\n  this.outputs = newOutputs;\n  return this;\n};\n\nTransaction.prototype.removeInput = function(txId, outputIndex) {\n  var index;\n  if (!outputIndex && _.isNumber(txId)) {\n    index = txId;\n  } else {\n    index = _.findIndex(this.inputs, function(input) {\n      return input.prevTxId.toString('hex') === txId && input.outputIndex === outputIndex;\n    });\n  }\n  if (index < 0 || index >= this.inputs.length) {\n    throw new errors.Transaction.InvalidIndex(index, this.inputs.length);\n  }\n  var input = this.inputs[index];\n  this.inputs = _.without(this.inputs, input);\n  this._inputAmount = undefined;\n  this._updateChangeOutput();\n};\n\n/* Signature handling */\n\n/**\n * Sign the transaction using one or more private keys.\n *\n * It tries to sign each input, verifying that the signature will be valid\n * (matches a public key).\n *\n * @param {Array|String|PrivateKey} privateKey\n * @param {number} sigtype\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.sign = function(privateKey, sigtype) {\n  $.checkState(this.hasAllUtxoInfo());\n  var self = this;\n  if (_.isArray(privateKey)) {\n    _.each(privateKey, function(privateKey) {\n      self.sign(privateKey, sigtype);\n    });\n    return this;\n  }\n  _.each(this.getSignatures(privateKey, sigtype), function(signature) {\n    self.applySignature(signature);\n  });\n  return this;\n};\n\nTransaction.prototype.getSignatures = function(privKey, sigtype) {\n  privKey = new PrivateKey(privKey);\n  sigtype = sigtype || Signature.SIGHASH_ALL;\n  var transaction = this;\n  var results = [];\n  var hashData = Hash.sha256ripemd160(privKey.publicKey.toBuffer());\n  _.each(this.inputs, function forEachInput(input, index) {\n    _.each(input.getSignatures(transaction, privKey, index, sigtype, hashData), function(signature) {\n      results.push(signature);\n    });\n  });\n  return results;\n};\n\n/**\n * Add a signature to the transaction\n *\n * @param {Object} signature\n * @param {number} signature.inputIndex\n * @param {number} signature.sigtype\n * @param {PublicKey} signature.publicKey\n * @param {Signature} signature.signature\n * @return {Transaction} this, for chaining\n */\nTransaction.prototype.applySignature = function(signature) {\n  this.inputs[signature.inputIndex].addSignature(this, signature);\n  return this;\n};\n\nTransaction.prototype.isFullySigned = function() {\n  _.each(this.inputs, function(input) {\n    if (input.isFullySigned === Input.prototype.isFullySigned) {\n      throw new errors.Transaction.UnableToVerifySignature(\n        'Unrecognized script kind, or not enough information to execute script.' +\n        'This usually happens when creating a transaction from a serialized transaction'\n      );\n    }\n  });\n  return _.all(_.map(this.inputs, function(input) {\n    return input.isFullySigned();\n  }));\n};\n\nTransaction.prototype.isValidSignature = function(signature) {\n  var self = this;\n  if (this.inputs[signature.inputIndex].isValidSignature === Input.prototype.isValidSignature) {\n    throw new errors.Transaction.UnableToVerifySignature(\n      'Unrecognized script kind, or not enough information to execute script.' +\n      'This usually happens when creating a transaction from a serialized transaction'\n    );\n  }\n  return this.inputs[signature.inputIndex].isValidSignature(self, signature);\n};\n\n/**\n * @returns {bool} whether the signature is valid for this transaction input\n */\nTransaction.prototype.verifySignature = function(sig, pubkey, nin, subscript) {\n  return Sighash.verify(this, sig, pubkey, nin, subscript);\n};\n\n/**\n * Check that a transaction passes basic sanity tests. If not, return a string\n * describing the error. This function contains the same logic as\n * CheckTransaction in bitcoin core.\n */\nTransaction.prototype.verify = function() {\n  // Basic checks that don't depend on any context\n  if (this.inputs.length === 0) {\n    return 'transaction txins empty';\n  }\n\n  if (this.outputs.length === 0) {\n    return 'transaction txouts empty';\n  }\n\n  // Check for negative or overflow output values\n  var valueoutbn = new BN(0);\n  for (var i = 0; i < this.outputs.length; i++) {\n    var txout = this.outputs[i];\n\n    if (txout.invalidSatoshis()) {\n      return 'transaction txout ' + i + ' satoshis is invalid';\n    }\n    if (txout._satoshisBN.gt(new BN(Transaction.MAX_MONEY, 10))) {\n      return 'transaction txout ' + i + ' greater than MAX_MONEY';\n    }\n    valueoutbn = valueoutbn.add(txout._satoshisBN);\n    if (valueoutbn.gt(new BN(Transaction.MAX_MONEY))) {\n      return 'transaction txout ' + i + ' total output greater than MAX_MONEY';\n    }\n  }\n\n  // Size limits\n  if (this.toBuffer().length > MAX_BLOCK_SIZE) {\n    return 'transaction over the maximum block size';\n  }\n\n  // Check for duplicate inputs\n  var txinmap = {};\n  for (i = 0; i < this.inputs.length; i++) {\n    var txin = this.inputs[i];\n\n    var inputid = txin.prevTxId + ':' + txin.outputIndex;\n    if (!_.isUndefined(txinmap[inputid])) {\n      return 'transaction input ' + i + ' duplicate input';\n    }\n    txinmap[inputid] = true;\n  }\n\n  var isCoinbase = this.isCoinbase();\n  if (isCoinbase) {\n    var buf = this.inputs[0]._scriptBuffer;\n    if (buf.length < 2 || buf.length > 100) {\n      return 'coinbase transaction script size invalid';\n    }\n  } else {\n    for (i = 0; i < this.inputs.length; i++) {\n      if (this.inputs[i].isNull()) {\n        return 'transaction input ' + i + ' has null input';\n      }\n    }\n  }\n  return true;\n};\n\n/**\n * Analogous to bitcoind's IsCoinBase function in transaction.h\n */\nTransaction.prototype.isCoinbase = function() {\n  return (this.inputs.length === 1 && this.inputs[0].isNull());\n};\n\n/**\n * Determines if this transaction can be replaced in the mempool with another\n * transaction that provides a sufficiently higher fee (RBF).\n */\nTransaction.prototype.isRBF = function() {\n  for (var i = 0; i < this.inputs.length; i++) {\n    var input = this.inputs[i];\n    if (input.sequenceNumber < Input.MAXINT - 1) {\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * Enable this transaction to be replaced in the mempool (RBF) if a transaction\n * includes a sufficiently higher fee. It will set the sequenceNumber to\n * DEFAULT_RBF_SEQNUMBER for all inputs if the sequence number does not\n * already enable RBF.\n */\nTransaction.prototype.enableRBF = function() {\n  for (var i = 0; i < this.inputs.length; i++) {\n    var input = this.inputs[i];\n    if (input.sequenceNumber >= Input.MAXINT - 1) {\n      input.sequenceNumber = Input.DEFAULT_RBF_SEQNUMBER;\n    }\n  }\n  return this;\n};\n\nmodule.exports = Transaction;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/transaction.js\n// module id = 319\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/transaction.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\n\nvar errors = __webpack_require__(56);\nvar $ = __webpack_require__(13);\n\nvar UNITS = {\n  'BTC'      : [1e8, 8],\n  'mBTC'     : [1e5, 5],\n  'uBTC'     : [1e2, 2],\n  'bits'     : [1e2, 2],\n  'satoshis' : [1, 0]\n};\n\n/**\n * Utility for handling and converting bitcoins units. The supported units are\n * BTC, mBTC, bits (also named uBTC) and satoshis. A unit instance can be created with an\n * amount and a unit code, or alternatively using static methods like {fromBTC}.\n * It also allows to be created from a fiat amount and the exchange rate, or\n * alternatively using the {fromFiat} static method.\n * You can consult for different representation of a unit instance using it's\n * {to} method, the fixed unit methods like {toSatoshis} or alternatively using\n * the unit accessors. It also can be converted to a fiat amount by providing the\n * corresponding BTC/fiat exchange rate.\n *\n * @example\n * ```javascript\n * var sats = Unit.fromBTC(1.3).toSatoshis();\n * var mili = Unit.fromBits(1.3).to(Unit.mBTC);\n * var bits = Unit.fromFiat(1.3, 350).bits;\n * var btc = new Unit(1.3, Unit.bits).BTC;\n * ```\n *\n * @param {Number} amount - The amount to be represented\n * @param {String|Number} code - The unit of the amount or the exchange rate\n * @returns {Unit} A new instance of an Unit\n * @constructor\n */\nfunction Unit(amount, code) {\n  if (!(this instanceof Unit)) {\n    return new Unit(amount, code);\n  }\n\n  // convert fiat to BTC\n  if (_.isNumber(code)) {\n    if (code <= 0) {\n      throw new errors.Unit.InvalidRate(code);\n    }\n    amount = amount / code;\n    code = Unit.BTC;\n  }\n\n  this._value = this._from(amount, code);\n\n  var self = this;\n  var defineAccesor = function(key) {\n    Object.defineProperty(self, key, {\n      get: function() { return self.to(key); },\n      enumerable: true,\n    });\n  };\n\n  Object.keys(UNITS).forEach(defineAccesor);\n}\n\nObject.keys(UNITS).forEach(function(key) {\n  Unit[key] = key;\n});\n\n/**\n * Returns a Unit instance created from JSON string or object\n *\n * @param {String|Object} json - JSON with keys: amount and code\n * @returns {Unit} A Unit instance\n */\nUnit.fromObject = function fromObject(data){\n  $.checkArgument(_.isObject(data), 'Argument is expected to be an object');\n  return new Unit(data.amount, data.code);\n};\n\n/**\n * Returns a Unit instance created from an amount in BTC\n *\n * @param {Number} amount - The amount in BTC\n * @returns {Unit} A Unit instance\n */\nUnit.fromBTC = function(amount) {\n  return new Unit(amount, Unit.BTC);\n};\n\n/**\n * Returns a Unit instance created from an amount in mBTC\n *\n * @param {Number} amount - The amount in mBTC\n * @returns {Unit} A Unit instance\n */\nUnit.fromMillis = Unit.fromMilis = function(amount) {\n  return new Unit(amount, Unit.mBTC);\n};\n\n/**\n * Returns a Unit instance created from an amount in bits\n *\n * @param {Number} amount - The amount in bits\n * @returns {Unit} A Unit instance\n */\nUnit.fromMicros = Unit.fromBits = function(amount) {\n  return new Unit(amount, Unit.bits);\n};\n\n/**\n * Returns a Unit instance created from an amount in satoshis\n *\n * @param {Number} amount - The amount in satoshis\n * @returns {Unit} A Unit instance\n */\nUnit.fromSatoshis = function(amount) {\n  return new Unit(amount, Unit.satoshis);\n};\n\n/**\n * Returns a Unit instance created from a fiat amount and exchange rate.\n *\n * @param {Number} amount - The amount in fiat\n * @param {Number} rate - The exchange rate BTC/fiat\n * @returns {Unit} A Unit instance\n */\nUnit.fromFiat = function(amount, rate) {\n  return new Unit(amount, rate);\n};\n\nUnit.prototype._from = function(amount, code) {\n  if (!UNITS[code]) {\n    throw new errors.Unit.UnknownCode(code);\n  }\n  return parseInt((amount * UNITS[code][0]).toFixed());\n};\n\n/**\n * Returns the value represented in the specified unit\n *\n * @param {String|Number} code - The unit code or exchange rate\n * @returns {Number} The converted value\n */\nUnit.prototype.to = function(code) {\n  if (_.isNumber(code)) {\n    if (code <= 0) {\n      throw new errors.Unit.InvalidRate(code);\n    }\n    return parseFloat((this.BTC * code).toFixed(2));\n  }\n\n  if (!UNITS[code]) {\n    throw new errors.Unit.UnknownCode(code);\n  }\n\n  var value = this._value / UNITS[code][0];\n  return parseFloat(value.toFixed(UNITS[code][1]));\n};\n\n/**\n * Returns the value represented in BTC\n *\n * @returns {Number} The value converted to BTC\n */\nUnit.prototype.toBTC = function() {\n  return this.to(Unit.BTC);\n};\n\n/**\n * Returns the value represented in mBTC\n *\n * @returns {Number} The value converted to mBTC\n */\nUnit.prototype.toMillis = Unit.prototype.toMilis = function() {\n  return this.to(Unit.mBTC);\n};\n\n/**\n * Returns the value represented in bits\n *\n * @returns {Number} The value converted to bits\n */\nUnit.prototype.toMicros = Unit.prototype.toBits = function() {\n  return this.to(Unit.bits);\n};\n\n/**\n * Returns the value represented in satoshis\n *\n * @returns {Number} The value converted to satoshis\n */\nUnit.prototype.toSatoshis = function() {\n  return this.to(Unit.satoshis);\n};\n\n/**\n * Returns the value represented in fiat\n *\n * @param {string} rate - The exchange rate between BTC/currency\n * @returns {Number} The value converted to satoshis\n */\nUnit.prototype.atRate = function(rate) {\n  return this.to(rate);\n};\n\n/**\n * Returns a the string representation of the value in satoshis\n *\n * @returns {string} the value in satoshis\n */\nUnit.prototype.toString = function() {\n  return this.satoshis + ' satoshis';\n};\n\n/**\n * Returns a plain object representation of the Unit\n *\n * @returns {Object} An object with the keys: amount and code\n */\nUnit.prototype.toObject = Unit.prototype.toJSON = function toObject() {\n  return {\n    amount: this.BTC,\n    code: Unit.BTC\n  };\n};\n\n/**\n * Returns a string formatted for the console\n *\n * @returns {string} the value in satoshis\n */\nUnit.prototype.inspect = function() {\n  return '<Unit: ' + this.toString() + '>';\n};\n\nmodule.exports = Unit;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/unit.js\n// module id = 320\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/unit.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(577)().Promise\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/any-promise/index.js\n// module id = 321\n// module chunks = 0\n\n//# sourceURL=../node_modules/any-promise/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\nconst Reporter = __webpack_require__(127).Reporter;\nconst Buffer = __webpack_require__(0).Buffer;\n\nfunction DecoderBuffer(base, options) {\n  Reporter.call(this, options);\n  if (!Buffer.isBuffer(base)) {\n    this.error('Input not Buffer');\n    return;\n  }\n\n  this.base = base;\n  this.offset = 0;\n  this.length = base.length;\n}\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.prototype.save = function save() {\n  return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n  // Return skipped data\n  const res = new DecoderBuffer(this.base);\n  res.offset = save.offset;\n  res.length = this.offset;\n\n  this.offset = save.offset;\n  Reporter.prototype.restore.call(this, save.reporter);\n\n  return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n  return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n  if (this.offset + 1 <= this.length)\n    return this.base.readUInt8(this.offset++, true);\n  else\n    return this.error(fail || 'DecoderBuffer overrun');\n};\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n  if (!(this.offset + bytes <= this.length))\n    return this.error(fail || 'DecoderBuffer overrun');\n\n  const res = new DecoderBuffer(this.base);\n\n  // Share reporter state\n  res._reporterState = this._reporterState;\n\n  res.offset = this.offset;\n  res.length = this.offset + bytes;\n  this.offset += bytes;\n  return res;\n};\n\nDecoderBuffer.prototype.raw = function raw(save) {\n  return this.base.slice(save ? save.offset : this.offset, this.length);\n};\n\nfunction EncoderBuffer(value, reporter) {\n  if (Array.isArray(value)) {\n    this.length = 0;\n    this.value = value.map(function(item) {\n      if (!(item instanceof EncoderBuffer))\n        item = new EncoderBuffer(item, reporter);\n      this.length += item.length;\n      return item;\n    }, this);\n  } else if (typeof value === 'number') {\n    if (!(0 <= value && value <= 0xff))\n      return reporter.error('non-byte EncoderBuffer value');\n    this.value = value;\n    this.length = 1;\n  } else if (typeof value === 'string') {\n    this.value = value;\n    this.length = Buffer.byteLength(value);\n  } else if (Buffer.isBuffer(value)) {\n    this.value = value;\n    this.length = value.length;\n  } else {\n    return reporter.error('Unsupported type: ' + typeof value);\n  }\n}\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n  if (!out)\n    out = new Buffer(this.length);\n  if (!offset)\n    offset = 0;\n\n  if (this.length === 0)\n    return out;\n\n  if (Array.isArray(this.value)) {\n    this.value.forEach(function(item) {\n      item.join(out, offset);\n      offset += item.length;\n    });\n  } else {\n    if (typeof this.value === 'number')\n      out[offset] = this.value;\n    else if (typeof this.value === 'string')\n      out.write(this.value, offset);\n    else if (Buffer.isBuffer(this.value))\n      this.value.copy(out, offset);\n    offset += this.length;\n  }\n\n  return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/base/buffer.js\n// module id = 322\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/base/buffer.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst constants = exports;\n\n// Helper\nconstants._reverse = function reverse(map) {\n  const res = {};\n\n  Object.keys(map).forEach(function(key) {\n    // Convert key to integer if it is stringified\n    if ((key | 0) == key)\n      key = key | 0;\n\n    const value = map[key];\n    res[value] = key;\n  });\n\n  return res;\n};\n\nconstants.der = __webpack_require__(583);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/constants/index.js\n// module id = 323\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/constants/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\n\nconst asn1 = __webpack_require__(110);\nconst base = asn1.base;\nconst bignum = asn1.bignum;\n\n// Import DER constants\nconst der = asn1.constants.der;\n\nfunction DERDecoder(entity) {\n  this.enc = 'der';\n  this.name = entity.name;\n  this.entity = entity;\n\n  // Construct base tree\n  this.tree = new DERNode();\n  this.tree._init(entity.body);\n}\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n  if (!(data instanceof base.DecoderBuffer))\n    data = new base.DecoderBuffer(data, options);\n\n  return this.tree._decode(data, options);\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n  base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n  if (buffer.isEmpty())\n    return false;\n\n  const state = buffer.save();\n  const decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n  if (buffer.isError(decodedTag))\n    return decodedTag;\n\n  buffer.restore(state);\n\n  return decodedTag.tag === tag || decodedTag.tagStr === tag ||\n    (decodedTag.tagStr + 'of') === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n  const decodedTag = derDecodeTag(buffer,\n    'Failed to decode tag of \"' + tag + '\"');\n  if (buffer.isError(decodedTag))\n    return decodedTag;\n\n  let len = derDecodeLen(buffer,\n    decodedTag.primitive,\n    'Failed to get length of \"' + tag + '\"');\n\n  // Failure\n  if (buffer.isError(len))\n    return len;\n\n  if (!any &&\n      decodedTag.tag !== tag &&\n      decodedTag.tagStr !== tag &&\n      decodedTag.tagStr + 'of' !== tag) {\n    return buffer.error('Failed to match tag: \"' + tag + '\"');\n  }\n\n  if (decodedTag.primitive || len !== null)\n    return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n\n  // Indefinite length... find END tag\n  const state = buffer.save();\n  const res = this._skipUntilEnd(\n    buffer,\n    'Failed to skip indefinite length body: \"' + this.tag + '\"');\n  if (buffer.isError(res))\n    return res;\n\n  len = buffer.offset - state.offset;\n  buffer.restore(state);\n  return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n  for (;;) {\n    const tag = derDecodeTag(buffer, fail);\n    if (buffer.isError(tag))\n      return tag;\n    const len = derDecodeLen(buffer, tag.primitive, fail);\n    if (buffer.isError(len))\n      return len;\n\n    let res;\n    if (tag.primitive || len !== null)\n      res = buffer.skip(len);\n    else\n      res = this._skipUntilEnd(buffer, fail);\n\n    // Failure\n    if (buffer.isError(res))\n      return res;\n\n    if (tag.tagStr === 'end')\n      break;\n  }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\n  options) {\n  const result = [];\n  while (!buffer.isEmpty()) {\n    const possibleEnd = this._peekTag(buffer, 'end');\n    if (buffer.isError(possibleEnd))\n      return possibleEnd;\n\n    const res = decoder.decode(buffer, 'der', options);\n    if (buffer.isError(res) && possibleEnd)\n      break;\n    result.push(res);\n  }\n  return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n  if (tag === 'bitstr') {\n    const unused = buffer.readUInt8();\n    if (buffer.isError(unused))\n      return unused;\n    return { unused: unused, data: buffer.raw() };\n  } else if (tag === 'bmpstr') {\n    const raw = buffer.raw();\n    if (raw.length % 2 === 1)\n      return buffer.error('Decoding of string type: bmpstr length mismatch');\n\n    let str = '';\n    for (let i = 0; i < raw.length / 2; i++) {\n      str += String.fromCharCode(raw.readUInt16BE(i * 2));\n    }\n    return str;\n  } else if (tag === 'numstr') {\n    const numstr = buffer.raw().toString('ascii');\n    if (!this._isNumstr(numstr)) {\n      return buffer.error('Decoding of string type: ' +\n                          'numstr unsupported characters');\n    }\n    return numstr;\n  } else if (tag === 'octstr') {\n    return buffer.raw();\n  } else if (tag === 'objDesc') {\n    return buffer.raw();\n  } else if (tag === 'printstr') {\n    const printstr = buffer.raw().toString('ascii');\n    if (!this._isPrintstr(printstr)) {\n      return buffer.error('Decoding of string type: ' +\n                          'printstr unsupported characters');\n    }\n    return printstr;\n  } else if (/str$/.test(tag)) {\n    return buffer.raw().toString();\n  } else {\n    return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n  }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n  let result;\n  const identifiers = [];\n  let ident = 0;\n  let subident = 0;\n  while (!buffer.isEmpty()) {\n    subident = buffer.readUInt8();\n    ident <<= 7;\n    ident |= subident & 0x7f;\n    if ((subident & 0x80) === 0) {\n      identifiers.push(ident);\n      ident = 0;\n    }\n  }\n  if (subident & 0x80)\n    identifiers.push(ident);\n\n  const first = (identifiers[0] / 40) | 0;\n  const second = identifiers[0] % 40;\n\n  if (relative)\n    result = identifiers;\n  else\n    result = [first, second].concat(identifiers.slice(1));\n\n  if (values) {\n    let tmp = values[result.join(' ')];\n    if (tmp === undefined)\n      tmp = values[result.join('.')];\n    if (tmp !== undefined)\n      result = tmp;\n  }\n\n  return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n  const str = buffer.raw().toString();\n\n  let year;\n  let mon;\n  let day;\n  let hour;\n  let min;\n  let sec;\n  if (tag === 'gentime') {\n    year = str.slice(0, 4) | 0;\n    mon = str.slice(4, 6) | 0;\n    day = str.slice(6, 8) | 0;\n    hour = str.slice(8, 10) | 0;\n    min = str.slice(10, 12) | 0;\n    sec = str.slice(12, 14) | 0;\n  } else if (tag === 'utctime') {\n    year = str.slice(0, 2) | 0;\n    mon = str.slice(2, 4) | 0;\n    day = str.slice(4, 6) | 0;\n    hour = str.slice(6, 8) | 0;\n    min = str.slice(8, 10) | 0;\n    sec = str.slice(10, 12) | 0;\n    if (year < 70)\n      year = 2000 + year;\n    else\n      year = 1900 + year;\n  } else {\n    return buffer.error('Decoding ' + tag + ' time is not supported yet');\n  }\n\n  return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull() {\n  return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n  const res = buffer.readUInt8();\n  if (buffer.isError(res))\n    return res;\n  else\n    return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n  // Bigint, return as it is (assume big endian)\n  const raw = buffer.raw();\n  let res = new bignum(raw);\n\n  if (values)\n    res = values[res.toString(10)] || res;\n\n  return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n  if (typeof entity === 'function')\n    entity = entity(obj);\n  return entity._getDecoder('der').tree;\n};\n\n// Utility methods\n\nfunction derDecodeTag(buf, fail) {\n  let tag = buf.readUInt8(fail);\n  if (buf.isError(tag))\n    return tag;\n\n  const cls = der.tagClass[tag >> 6];\n  const primitive = (tag & 0x20) === 0;\n\n  // Multi-octet tag - load\n  if ((tag & 0x1f) === 0x1f) {\n    let oct = tag;\n    tag = 0;\n    while ((oct & 0x80) === 0x80) {\n      oct = buf.readUInt8(fail);\n      if (buf.isError(oct))\n        return oct;\n\n      tag <<= 7;\n      tag |= oct & 0x7f;\n    }\n  } else {\n    tag &= 0x1f;\n  }\n  const tagStr = der.tag[tag];\n\n  return {\n    cls: cls,\n    primitive: primitive,\n    tag: tag,\n    tagStr: tagStr\n  };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n  let len = buf.readUInt8(fail);\n  if (buf.isError(len))\n    return len;\n\n  // Indefinite form\n  if (!primitive && len === 0x80)\n    return null;\n\n  // Definite form\n  if ((len & 0x80) === 0) {\n    // Short form\n    return len;\n  }\n\n  // Long form\n  const num = len & 0x7f;\n  if (num > 4)\n    return buf.error('length octect is too long');\n\n  len = 0;\n  for (let i = 0; i < num; i++) {\n    len <<= 8;\n    const j = buf.readUInt8(fail);\n    if (buf.isError(j))\n      return j;\n    len |= j;\n  }\n\n  return len;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/decoders/der.js\n// module id = 324\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/decoders/der.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\nconst Buffer = __webpack_require__(0).Buffer;\n\nconst asn1 = __webpack_require__(110);\nconst base = asn1.base;\n\n// Import DER constants\nconst der = asn1.constants.der;\n\nfunction DEREncoder(entity) {\n  this.enc = 'der';\n  this.name = entity.name;\n  this.entity = entity;\n\n  // Construct base tree\n  this.tree = new DERNode();\n  this.tree._init(entity.body);\n}\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n  return this.tree._encode(data, reporter).join();\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n  base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\n  primitive,\n  cls,\n  content) {\n  const encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n\n  // Short form\n  if (content.length < 0x80) {\n    const header = new Buffer(2);\n    header[0] = encodedTag;\n    header[1] = content.length;\n    return this._createEncoderBuffer([ header, content ]);\n  }\n\n  // Long form\n  // Count octets required to store length\n  let lenOctets = 1;\n  for (let i = content.length; i >= 0x100; i >>= 8)\n    lenOctets++;\n\n  const header = new Buffer(1 + 1 + lenOctets);\n  header[0] = encodedTag;\n  header[1] = 0x80 | lenOctets;\n\n  for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\n    header[i] = j & 0xff;\n\n  return this._createEncoderBuffer([ header, content ]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n  if (tag === 'bitstr') {\n    return this._createEncoderBuffer([ str.unused | 0, str.data ]);\n  } else if (tag === 'bmpstr') {\n    const buf = new Buffer(str.length * 2);\n    for (let i = 0; i < str.length; i++) {\n      buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n    }\n    return this._createEncoderBuffer(buf);\n  } else if (tag === 'numstr') {\n    if (!this._isNumstr(str)) {\n      return this.reporter.error('Encoding of string type: numstr supports ' +\n                                 'only digits and space');\n    }\n    return this._createEncoderBuffer(str);\n  } else if (tag === 'printstr') {\n    if (!this._isPrintstr(str)) {\n      return this.reporter.error('Encoding of string type: printstr supports ' +\n                                 'only latin upper and lower case letters, ' +\n                                 'digits, space, apostrophe, left and rigth ' +\n                                 'parenthesis, plus sign, comma, hyphen, ' +\n                                 'dot, slash, colon, equal sign, ' +\n                                 'question mark');\n    }\n    return this._createEncoderBuffer(str);\n  } else if (/str$/.test(tag)) {\n    return this._createEncoderBuffer(str);\n  } else if (tag === 'objDesc') {\n    return this._createEncoderBuffer(str);\n  } else {\n    return this.reporter.error('Encoding of string type: ' + tag +\n                               ' unsupported');\n  }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n  if (typeof id === 'string') {\n    if (!values)\n      return this.reporter.error('string objid given, but no values map found');\n    if (!values.hasOwnProperty(id))\n      return this.reporter.error('objid not found in values map');\n    id = values[id].split(/[\\s.]+/g);\n    for (let i = 0; i < id.length; i++)\n      id[i] |= 0;\n  } else if (Array.isArray(id)) {\n    id = id.slice();\n    for (let i = 0; i < id.length; i++)\n      id[i] |= 0;\n  }\n\n  if (!Array.isArray(id)) {\n    return this.reporter.error('objid() should be either array or string, ' +\n                               'got: ' + JSON.stringify(id));\n  }\n\n  if (!relative) {\n    if (id[1] >= 40)\n      return this.reporter.error('Second objid identifier OOB');\n    id.splice(0, 2, id[0] * 40 + id[1]);\n  }\n\n  // Count number of octets\n  let size = 0;\n  for (let i = 0; i < id.length; i++) {\n    let ident = id[i];\n    for (size++; ident >= 0x80; ident >>= 7)\n      size++;\n  }\n\n  const objid = new Buffer(size);\n  let offset = objid.length - 1;\n  for (let i = id.length - 1; i >= 0; i--) {\n    let ident = id[i];\n    objid[offset--] = ident & 0x7f;\n    while ((ident >>= 7) > 0)\n      objid[offset--] = 0x80 | (ident & 0x7f);\n  }\n\n  return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n  if (num < 10)\n    return '0' + num;\n  else\n    return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n  let str;\n  const date = new Date(time);\n\n  if (tag === 'gentime') {\n    str = [\n      two(date.getUTCFullYear()),\n      two(date.getUTCMonth() + 1),\n      two(date.getUTCDate()),\n      two(date.getUTCHours()),\n      two(date.getUTCMinutes()),\n      two(date.getUTCSeconds()),\n      'Z'\n    ].join('');\n  } else if (tag === 'utctime') {\n    str = [\n      two(date.getUTCFullYear() % 100),\n      two(date.getUTCMonth() + 1),\n      two(date.getUTCDate()),\n      two(date.getUTCHours()),\n      two(date.getUTCMinutes()),\n      two(date.getUTCSeconds()),\n      'Z'\n    ].join('');\n  } else {\n    this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n  }\n\n  return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n  return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n  if (typeof num === 'string') {\n    if (!values)\n      return this.reporter.error('String int or enum given, but no values map');\n    if (!values.hasOwnProperty(num)) {\n      return this.reporter.error('Values map doesn\\'t contain: ' +\n                                 JSON.stringify(num));\n    }\n    num = values[num];\n  }\n\n  // Bignum, assume big endian\n  if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n    const numArray = num.toArray();\n    if (!num.sign && numArray[0] & 0x80) {\n      numArray.unshift(0);\n    }\n    num = new Buffer(numArray);\n  }\n\n  if (Buffer.isBuffer(num)) {\n    let size = num.length;\n    if (num.length === 0)\n      size++;\n\n    const out = new Buffer(size);\n    num.copy(out);\n    if (num.length === 0)\n      out[0] = 0;\n    return this._createEncoderBuffer(out);\n  }\n\n  if (num < 0x80)\n    return this._createEncoderBuffer(num);\n\n  if (num < 0x100)\n    return this._createEncoderBuffer([0, num]);\n\n  let size = 1;\n  for (let i = num; i >= 0x100; i >>= 8)\n    size++;\n\n  const out = new Array(size);\n  for (let i = out.length - 1; i >= 0; i--) {\n    out[i] = num & 0xff;\n    num >>= 8;\n  }\n  if(out[0] & 0x80) {\n    out.unshift(0);\n  }\n\n  return this._createEncoderBuffer(new Buffer(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n  return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n  if (typeof entity === 'function')\n    entity = entity(obj);\n  return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n  const state = this._baseState;\n  let i;\n  if (state['default'] === null)\n    return false;\n\n  const data = dataBuffer.join();\n  if (state.defaultBuffer === undefined)\n    state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n\n  if (data.length !== state.defaultBuffer.length)\n    return false;\n\n  for (i=0; i < data.length; i++)\n    if (data[i] !== state.defaultBuffer[i])\n      return false;\n\n  return true;\n};\n\n// Utility methods\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n  let res;\n\n  if (tag === 'seqof')\n    tag = 'seq';\n  else if (tag === 'setof')\n    tag = 'set';\n\n  if (der.tagByName.hasOwnProperty(tag))\n    res = der.tagByName[tag];\n  else if (typeof tag === 'number' && (tag | 0) === tag)\n    res = tag;\n  else\n    return reporter.error('Unknown tag: ' + tag);\n\n  if (res >= 0x1f)\n    return reporter.error('Multi-octet tag encoding unsupported');\n\n  if (!primitive)\n    res |= 0x20;\n\n  res |= (der.tagClassByName[cls || 'universal'] << 6);\n\n  return res;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/encoders/der.js\n// module id = 325\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/encoders/der.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = eachOfLimit;\n\nvar _eachOfLimit2 = __webpack_require__(329);\n\nvar _eachOfLimit3 = _interopRequireDefault(_eachOfLimit2);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n  (0, _eachOfLimit3.default)(limit)(coll, (0, _wrapAsync2.default)(iteratee), callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/eachOfLimit.js\n// module id = 326\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/eachOfLimit.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _eachOfLimit = __webpack_require__(326);\n\nvar _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);\n\nvar _doLimit = __webpack_require__(220);\n\nvar _doLimit2 = _interopRequireDefault(_doLimit);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n */\nexports.default = (0, _doLimit2.default)(_eachOfLimit2.default, 1);\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/eachOfSeries.js\n// module id = 327\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/eachOfSeries.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = _createTester;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _breakLoop = __webpack_require__(219);\n\nvar _breakLoop2 = _interopRequireDefault(_breakLoop);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _createTester(check, getResult) {\n    return function (eachfn, arr, iteratee, cb) {\n        cb = cb || _noop2.default;\n        var testPassed = false;\n        var testResult;\n        eachfn(arr, function (value, _, callback) {\n            iteratee(value, function (err, result) {\n                if (err) {\n                    callback(err);\n                } else if (check(result) && !testResult) {\n                    testPassed = true;\n                    testResult = getResult(true, value);\n                    callback(null, _breakLoop2.default);\n                } else {\n                    callback();\n                }\n            });\n        }, function (err) {\n            if (err) {\n                cb(err);\n            } else {\n                cb(null, testPassed ? testResult : getResult(false));\n            }\n        });\n    };\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/createTester.js\n// module id = 328\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/createTester.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = _eachOfLimit;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _once = __webpack_require__(221);\n\nvar _once2 = _interopRequireDefault(_once);\n\nvar _iterator = __webpack_require__(596);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _breakLoop = __webpack_require__(219);\n\nvar _breakLoop2 = _interopRequireDefault(_breakLoop);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _eachOfLimit(limit) {\n    return function (obj, iteratee, callback) {\n        callback = (0, _once2.default)(callback || _noop2.default);\n        if (limit <= 0 || !obj) {\n            return callback(null);\n        }\n        var nextElem = (0, _iterator2.default)(obj);\n        var done = false;\n        var running = 0;\n\n        function iterateeCallback(err, value) {\n            running -= 1;\n            if (err) {\n                done = true;\n                callback(err);\n            } else if (value === _breakLoop2.default || done && running <= 0) {\n                done = true;\n                return callback(null);\n            } else {\n                replenish();\n            }\n        }\n\n        function replenish() {\n            while (running < limit && !done) {\n                var elem = nextElem();\n                if (elem === null) {\n                    done = true;\n                    if (running <= 0) {\n                        callback(null);\n                    }\n                    return;\n                }\n                running += 1;\n                iteratee(elem.value, elem.key, (0, _onlyOnce2.default)(iterateeCallback));\n            }\n        }\n\n        replenish();\n    };\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/eachOfLimit.js\n// module id = 329\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/eachOfLimit.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\n\nexports.default = function (fn) {\n    return function () /*...args, callback*/{\n        var args = (0, _slice2.default)(arguments);\n        var callback = args.pop();\n        fn.call(this, args, callback);\n    };\n};\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/initialParams.js\n// module id = 330\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/initialParams.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = _parallel;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _isArrayLike = __webpack_require__(98);\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _parallel(eachfn, tasks, callback) {\n    callback = callback || _noop2.default;\n    var results = (0, _isArrayLike2.default)(tasks) ? [] : {};\n\n    eachfn(tasks, function (task, key, callback) {\n        (0, _wrapAsync2.default)(task)(function (err, result) {\n            if (arguments.length > 2) {\n                result = (0, _slice2.default)(arguments, 1);\n            }\n            results[key] = result;\n            callback(err);\n        });\n    }, function (err) {\n        callback(err, results);\n    });\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/parallel.js\n// module id = 331\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/parallel.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = _withoutIndex;\nfunction _withoutIndex(iteratee) {\n    return function (value, index, callback) {\n        return iteratee(value, callback);\n    };\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/withoutIndex.js\n// module id = 332\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/withoutIndex.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _reject = __webpack_require__(600);\n\nvar _reject2 = _interopRequireDefault(_reject);\n\nvar _doParallel = __webpack_require__(163);\n\nvar _doParallel2 = _interopRequireDefault(_doParallel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.reject(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, results) {\n *     // results now equals an array of missing files\n *     createFiles(results);\n * });\n */\nexports.default = (0, _doParallel2.default)(_reject2.default);\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/reject.js\n// module id = 333\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/reject.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _regenerator = __webpack_require__(132);\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _promise = __webpack_require__(130);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _slicedToArray2 = __webpack_require__(337);\n\nvar _slicedToArray3 = _interopRequireDefault(_slicedToArray2);\n\nvar _asyncToGenerator2 = __webpack_require__(131);\n\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nvar _Account = __webpack_require__(224);\n\nvar _Account2 = _interopRequireDefault(_Account);\n\nvar _utils = __webpack_require__(129);\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _account = __webpack_require__(314);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore\n */\nvar Account = new _Account2.default(_config3.default, function () {}, false);\n/**\n * @ignore\n */\nvar web3 = Account.web3;\n\n/**\n * Class with some helpers\n *\n * @export\n * @class EthHelpers\n * @extends {DCLib}\n */\n\nvar EthHelpers = function () {\n  /**\n   * @ignore\n   */\n  function EthHelpers() {\n    var _this = this;\n\n    (0, _classCallCheck3.default)(this, EthHelpers);\n\n    var waitAcc = function waitAcc(done) {\n      if (!Account.unlockAccount()) {\n        setTimeout(function () {\n          waitAcc(done);\n        }, 1000);\n        return;\n      }\n      done();\n    };\n\n    /**\n     * ERC20\n     * This is web3.eth.contract instanse of our [ERC20 contract](https://ropsten.etherscan.io/address/0x95a48dca999c89e4e284930d9b9af973a7481287#code)\n     *\n     * @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md\n     */\n    waitAcc(function () {\n      _this.ERC20 = new web3.eth.Contract(_config3.default.contracts.erc20.abi, _config3.default.contracts.erc20.address);\n    });\n  }\n\n  /**\n   * This callback is\n   * @callback accessBalance\n   * @param {Object} receipt - access balance information\n   */\n\n  /**\n   * ## Getting balances for Bets and Ethereum\n   *\n   * @param {String} address - Addres Ethereum account wallet\n   * @param {accessBalance} callback - callback function then access balance information\n   * @returns {Object} - return balance information\n   *\n   * @example\n   * > DCLib.Eth.getBalances('0x4d750610062f1b3ce35117ee3e19cfb657ef6e59') // '0x4d75..' address account\n   *\n   * @example\n   * // method return\n   *\n   * {\n   *   bets : 992.21\n   *   eth  : \"1.748053851\"\n   * }\n   *\n   * @memberOf DCLib\n   */\n\n\n  (0, _createClass3.default)(EthHelpers, [{\n    key: 'getBalances',\n    value: function () {\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(address) {\n        var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n        var _ref2, _ref3, bets, eth, res;\n\n        return _regenerator2.default.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                _context.next = 2;\n                return _promise2.default.all([this.getBetBalance(address), this.getEthBalance(address)]);\n\n              case 2:\n                _ref2 = _context.sent;\n                _ref3 = (0, _slicedToArray3.default)(_ref2, 2);\n                bets = _ref3[0];\n                eth = _ref3[1];\n                res = { bets: bets, eth: eth };\n\n\n                if (callback) callback(res);\n                return _context.abrupt('return', res);\n\n              case 9:\n              case 'end':\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function getBalances(_x2) {\n        return _ref.apply(this, arguments);\n      }\n\n      return getBalances;\n    }()\n\n    /**\n     * ## DCLib.Eth.getBetBalance\n     * method need for getting balance in ETH\n     *\n     * @example\n     * > DCLib.Eth.getEthBalance('0x4d750610062f1b3ce35117ee3e19cfb657ef6e59')\n     *\n     * @example\n     * // method return\n     *\n     * > 1.692211283\n     *\n     * @param {String} [address=false] - account addres for check balance\n     * @param {Function} [callback=false] - access Ethereum balance promise\n     * @returns {Promise} - ETH balance\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'getEthBalance',\n    value: function getEthBalance() {\n      var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n      var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n      if (!address) return;\n\n      return new _promise2.default(function (resolve, reject) {\n        web3.eth.getBalance(address).then(function (value) {\n          var balance = web3.utils.fromWei(value);\n          resolve(balance);\n          if (callback) callback(balance);\n        }).catch(function (err) {\n          Utils.debugLog(err, 'error');\n          reject(err);\n        });\n      });\n    }\n\n    /**\n     * ## DCLib.Eth.getBetBalance\n     * method need for getting balance in BET\n     *\n     * @example\n     * // example for method initialization\n     *\n     * > DCLib.Eth.getBetBalance('0x4d750610062f1b3ce35117ee3e19cfb657ef6e59')\n     *\n     * @example\n     * // example for method return Promise\n     *\n     * > 977.61\n     *\n     * @param {String} [address=false] - account addres for check balance\n     * @param {Function} [callback=false] - access Ethereum balance promise\n     * @returns {Promise} - BET balance\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'getBetBalance',\n    value: function getBetBalance() {\n      var _this2 = this;\n\n      var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n      var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n      if (!address) return;\n\n      return new _promise2.default(function (resolve, reject) {\n        if (!_this2.ERC20) {\n          reject(new Error('ERC20 not initializated'));\n        }\n        _this2.ERC20.methods.balanceOf(address).call().then(function (value) {\n          var balance = Utils.dec2bet(value);\n          resolve(balance);\n          if (callback) callback(balance);\n        }).catch(function (err) {\n          Utils.debugLog(err, 'error');\n          reject(err);\n        });\n      });\n    }\n\n    /**\n     * ## DCLib.Account.signHash(hash)\n     * method sign hashMessage\n     *\n     *\n     * @example\n     * > DCLib.Account.signHash(\"0xAb23..\")\n       *\n     * @example\n     * // method return\n     * > `0x6a1bcec4ff132aadb511cfd83131e456fab8b94d92c219448113697b5d75308b3b805\n     *  ef93c60b561b72d7c985fac11a574be0c2b2e4f3a8701cd01afa8e6edd71b`\n     *\n     * @param {String} hash - message which need turn in hash\n     * @returns {String} - hashed Message\n     *\n     * @memberOf {Account}\n     */\n\n  }, {\n    key: 'signHash',\n    value: function signHash(hash) {\n      hash = Utils.add0x(hash);\n      if (!web3.utils.isHexStrict(hash)) {\n        console.log('err');\n        Utils.debugLog(hash + ' is not correct hex', _config3.default.loglevel);\n        Utils.debugLog('Use DCLib.Utils.makeSeed or Utils.soliditySHA3(your_args) to create valid hash', _config3.default.loglevel);\n      }\n\n      return (0, _account.sign)(hash, Utils.add0x(Account.exportPrivateKey()));\n    }\n\n    /**\n     * Check ERC20 allowance and approve if need\n     *\n     * @param {string} spender - bytes32 addres\n     * @param {int} amount - amount of BETs\n     * @param {callback} [callback=false] - callback function\n     * @return {Promise} - Approve promise\n     */\n\n  }, {\n    key: 'ERC20approve',\n    value: function () {\n      var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(spender, amount) {\n        var _this3 = this;\n\n        var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n        return _regenerator2.default.wrap(function _callee3$(_context3) {\n          while (1) {\n            switch (_context3.prev = _context3.next) {\n              case 0:\n                return _context3.abrupt('return', new _promise2.default(function () {\n                  var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(resolve, reject) {\n                    var allowance, approveAmount, receipt;\n                    return _regenerator2.default.wrap(function _callee2$(_context2) {\n                      while (1) {\n                        switch (_context2.prev = _context2.next) {\n                          case 0:\n                            _context2.next = 2;\n                            return _this3.ERC20.methods.allowance(Account.get().openkey, spender).call();\n\n                          case 2:\n                            allowance = _context2.sent;\n\n                            if (!(allowance < amount || amount === 0 && allowance !== 0)) {\n                              _context2.next = 12;\n                              break;\n                            }\n\n                            approveAmount = amount;\n                            _context2.next = 7;\n                            return _this3.ERC20.methods.approve(spender, approveAmount).send({\n                              from: Account.get().openkey,\n                              gasPrice: 1.2 * _config3.default.gasPrice,\n                              gas: _config3.default.gasLimit\n                            }).on('transactionHash', function (transactionHash) {\n                              Utils.debugLog(['# approve TX pending', transactionHash], _config3.default.loglevel);\n                            }).on('error', function (err) {\n                              Utils.debugLog(err, 'error');\n                              reject(err, true);\n                            });\n\n                          case 7:\n                            receipt = _context2.sent;\n\n                            if (['0x01', '0x1', true].includes(receipt.status)) {\n                              _context2.next = 11;\n                              break;\n                            }\n\n                            reject(receipt, true);\n                            return _context2.abrupt('return');\n\n                          case 11:\n\n                            resolve(receipt, true);\n\n                          case 12:\n\n                            resolve(null, true);\n\n                            if (callback) callback();\n\n                          case 14:\n                          case 'end':\n                            return _context2.stop();\n                        }\n                      }\n                    }, _callee2, _this3);\n                  }));\n\n                  return function (_x10, _x11) {\n                    return _ref5.apply(this, arguments);\n                  };\n                }()));\n\n              case 1:\n              case 'end':\n                return _context3.stop();\n            }\n          }\n        }, _callee3, this);\n      }));\n\n      function ERC20approve(_x8, _x9) {\n        return _ref4.apply(this, arguments);\n      }\n\n      return ERC20approve;\n    }()\n  }]);\n  return EthHelpers;\n}();\n\nexports.default = EthHelpers;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/Eth/helpers.js\n// module id = 334\n// module chunks = 0\n\n//# sourceURL=Eth/helpers.js")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(675), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/json/stringify.js\n// module id = 335\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/json/stringify.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(676), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/assign.js\n// module id = 336\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/object/assign.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _isIterable2 = __webpack_require__(613);\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = __webpack_require__(612);\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n  function sliceIterator(arr, i) {\n    var _arr = [];\n    var _n = true;\n    var _d = false;\n    var _e = undefined;\n\n    try {\n      for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n        _arr.push(_s.value);\n\n        if (i && _arr.length === i) break;\n      }\n    } catch (err) {\n      _d = true;\n      _e = err;\n    } finally {\n      try {\n        if (!_n && _i["return"]) _i["return"]();\n      } finally {\n        if (_d) throw _e;\n      }\n    }\n\n    return _arr;\n  }\n\n  return function (arr, i) {\n    if (Array.isArray(arr)) {\n      return arr;\n    } else if ((0, _isIterable3.default)(Object(arr))) {\n      return sliceIterator(arr, i);\n    } else {\n      throw new TypeError("Invalid attempt to destructure non-iterable instance");\n    }\n  };\n}();\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/slicedToArray.js\n// module id = 337\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/slicedToArray.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _from = __webpack_require__(611);\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n  if (Array.isArray(arr)) {\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n      arr2[i] = arr[i];\n    }\n\n    return arr2;\n  } else {\n    return (0, _from2.default)(arr);\n  }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/helpers/toConsumableArray.js\n// module id = 338\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/helpers/toConsumableArray.js")},function(module,exports,__webpack_require__){eval("// base-x encoding\n// Forked from https://github.com/cryptocoinjs/bs58\n// Originally written by Mike Hearn for BitcoinJ\n// Copyright (c) 2011 Google Inc\n// Ported to JavaScript by Stefan Thomas\n// Merged Buffer refactorings from base58-native by Stephen Pair\n// Copyright (c) 2013 BitPay Inc\n\nvar Buffer = __webpack_require__(1).Buffer\n\nmodule.exports = function base (ALPHABET) {\n  var ALPHABET_MAP = {}\n  var BASE = ALPHABET.length\n  var LEADER = ALPHABET.charAt(0)\n\n  // pre-compute lookup table\n  for (var z = 0; z < ALPHABET.length; z++) {\n    var x = ALPHABET.charAt(z)\n\n    if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n    ALPHABET_MAP[x] = z\n  }\n\n  function encode (source) {\n    if (source.length === 0) return ''\n\n    var digits = [0]\n    for (var i = 0; i < source.length; ++i) {\n      for (var j = 0, carry = source[i]; j < digits.length; ++j) {\n        carry += digits[j] << 8\n        digits[j] = carry % BASE\n        carry = (carry / BASE) | 0\n      }\n\n      while (carry > 0) {\n        digits.push(carry % BASE)\n        carry = (carry / BASE) | 0\n      }\n    }\n\n    var string = ''\n\n    // deal with leading zeros\n    for (var k = 0; source[k] === 0 && k < source.length - 1; ++k) string += LEADER\n    // convert digits to a string\n    for (var q = digits.length - 1; q >= 0; --q) string += ALPHABET[digits[q]]\n\n    return string\n  }\n\n  function decodeUnsafe (string) {\n    if (typeof string !== 'string') throw new TypeError('Expected String')\n    if (string.length === 0) return Buffer.allocUnsafe(0)\n\n    var bytes = [0]\n    for (var i = 0; i < string.length; i++) {\n      var value = ALPHABET_MAP[string[i]]\n      if (value === undefined) return\n\n      for (var j = 0, carry = value; j < bytes.length; ++j) {\n        carry += bytes[j] * BASE\n        bytes[j] = carry & 0xff\n        carry >>= 8\n      }\n\n      while (carry > 0) {\n        bytes.push(carry & 0xff)\n        carry >>= 8\n      }\n    }\n\n    // deal with leading zeros\n    for (var k = 0; string[k] === LEADER && k < string.length - 1; ++k) {\n      bytes.push(0)\n    }\n\n    return Buffer.from(bytes.reverse())\n  }\n\n  function decode (string) {\n    var buffer = decodeUnsafe(string)\n    if (buffer) return buffer\n\n    throw new Error('Non-base' + BASE + ' character')\n  }\n\n  return {\n    encode: encode,\n    decodeUnsafe: decodeUnsafe,\n    decode: decode\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base-x/index.js\n// module id = 339\n// module chunks = 0\n\n//# sourceURL=../node_modules/base-x/index.js")},function(module,exports,__webpack_require__){eval('// (public) Constructor\nfunction BigInteger(a, b, c) {\n  if (!(this instanceof BigInteger))\n    return new BigInteger(a, b, c)\n\n  if (a != null) {\n    if ("number" == typeof a) this.fromNumber(a, b, c)\n    else if (b == null && "string" != typeof a) this.fromString(a, 256)\n    else this.fromString(a, b)\n  }\n}\n\nvar proto = BigInteger.prototype\n\n// duck-typed isBigInteger\nproto.__bigi = __webpack_require__(624).version\nBigInteger.isBigInteger = function (obj, check_ver) {\n  return obj && obj.__bigi && (!check_ver || obj.__bigi === proto.__bigi)\n}\n\n// Bits per digit\nvar dbits\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i, x, w, j, c, n) {\n  while (--n >= 0) {\n    var v = x * this[i++] + w[j] + c\n    c = Math.floor(v / 0x4000000)\n    w[j++] = v & 0x3ffffff\n  }\n  return c\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i, x, w, j, c, n) {\n  var xl = x & 0x7fff,\n    xh = x >> 15\n  while (--n >= 0) {\n    var l = this[i] & 0x7fff\n    var h = this[i++] >> 15\n    var m = xh * l + h * xl\n    l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff)\n    c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30)\n    w[j++] = l & 0x3fffffff\n  }\n  return c\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i, x, w, j, c, n) {\n  var xl = x & 0x3fff,\n    xh = x >> 14\n  while (--n >= 0) {\n    var l = this[i] & 0x3fff\n    var h = this[i++] >> 14\n    var m = xh * l + h * xl\n    l = xl * l + ((m & 0x3fff) << 14) + w[j] + c\n    c = (l >> 28) + (m >> 14) + xh * h\n    w[j++] = l & 0xfffffff\n  }\n  return c\n}\n\n// wtf?\nBigInteger.prototype.am = am1\ndbits = 26\n\nBigInteger.prototype.DB = dbits\nBigInteger.prototype.DM = ((1 << dbits) - 1)\nvar DV = BigInteger.prototype.DV = (1 << dbits)\n\nvar BI_FP = 52\nBigInteger.prototype.FV = Math.pow(2, BI_FP)\nBigInteger.prototype.F1 = BI_FP - dbits\nBigInteger.prototype.F2 = 2 * dbits - BI_FP\n\n// Digit conversions\nvar BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz"\nvar BI_RC = new Array()\nvar rr, vv\nrr = "0".charCodeAt(0)\nfor (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv\nrr = "a".charCodeAt(0)\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv\nrr = "A".charCodeAt(0)\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv\n\nfunction int2char(n) {\n  return BI_RM.charAt(n)\n}\n\nfunction intAt(s, i) {\n  var c = BI_RC[s.charCodeAt(i)]\n  return (c == null) ? -1 : c\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n  for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]\n  r.t = this.t\n  r.s = this.s\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n  this.t = 1\n  this.s = (x < 0) ? -1 : 0\n  if (x > 0) this[0] = x\n  else if (x < -1) this[0] = x + DV\n  else this.t = 0\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n  var r = new BigInteger()\n  r.fromInt(i)\n  return r\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n  var self = this\n\n  var k\n  if (b == 16) k = 4\n  else if (b == 8) k = 3\n  else if (b == 256) k = 8; // byte array\n  else if (b == 2) k = 1\n  else if (b == 32) k = 5\n  else if (b == 4) k = 2\n  else {\n    self.fromRadix(s, b)\n    return\n  }\n  self.t = 0\n  self.s = 0\n  var i = s.length,\n    mi = false,\n    sh = 0\n  while (--i >= 0) {\n    var x = (k == 8) ? s[i] & 0xff : intAt(s, i)\n    if (x < 0) {\n      if (s.charAt(i) == "-") mi = true\n      continue\n    }\n    mi = false\n    if (sh == 0)\n      self[self.t++] = x\n    else if (sh + k > self.DB) {\n      self[self.t - 1] |= (x & ((1 << (self.DB - sh)) - 1)) << sh\n      self[self.t++] = (x >> (self.DB - sh))\n    } else\n      self[self.t - 1] |= x << sh\n    sh += k\n    if (sh >= self.DB) sh -= self.DB\n  }\n  if (k == 8 && (s[0] & 0x80) != 0) {\n    self.s = -1\n    if (sh > 0) self[self.t - 1] |= ((1 << (self.DB - sh)) - 1) << sh\n  }\n  self.clamp()\n  if (mi) BigInteger.ZERO.subTo(self, self)\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n  var c = this.s & this.DM\n  while (this.t > 0 && this[this.t - 1] == c)--this.t\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n  var self = this\n  if (self.s < 0) return "-" + self.negate()\n    .toString(b)\n  var k\n  if (b == 16) k = 4\n  else if (b == 8) k = 3\n  else if (b == 2) k = 1\n  else if (b == 32) k = 5\n  else if (b == 4) k = 2\n  else return self.toRadix(b)\n  var km = (1 << k) - 1,\n    d, m = false,\n    r = "",\n    i = self.t\n  var p = self.DB - (i * self.DB) % k\n  if (i-- > 0) {\n    if (p < self.DB && (d = self[i] >> p) > 0) {\n      m = true\n      r = int2char(d)\n    }\n    while (i >= 0) {\n      if (p < k) {\n        d = (self[i] & ((1 << p) - 1)) << (k - p)\n        d |= self[--i] >> (p += self.DB - k)\n      } else {\n        d = (self[i] >> (p -= k)) & km\n        if (p <= 0) {\n          p += self.DB\n          --i\n        }\n      }\n      if (d > 0) m = true\n      if (m) r += int2char(d)\n    }\n  }\n  return m ? r : "0"\n}\n\n// (public) -this\nfunction bnNegate() {\n  var r = new BigInteger()\n  BigInteger.ZERO.subTo(this, r)\n  return r\n}\n\n// (public) |this|\nfunction bnAbs() {\n  return (this.s < 0) ? this.negate() : this\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n  var r = this.s - a.s\n  if (r != 0) return r\n  var i = this.t\n  r = i - a.t\n  if (r != 0) return (this.s < 0) ? -r : r\n  while (--i >= 0)\n    if ((r = this[i] - a[i]) != 0) return r\n  return 0\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n  var r = 1,\n    t\n  if ((t = x >>> 16) != 0) {\n    x = t\n    r += 16\n  }\n  if ((t = x >> 8) != 0) {\n    x = t\n    r += 8\n  }\n  if ((t = x >> 4) != 0) {\n    x = t\n    r += 4\n  }\n  if ((t = x >> 2) != 0) {\n    x = t\n    r += 2\n  }\n  if ((t = x >> 1) != 0) {\n    x = t\n    r += 1\n  }\n  return r\n}\n\n// (public) return the number of bits in "this"\nfunction bnBitLength() {\n  if (this.t <= 0) return 0\n  return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}\n\n// (public) return the number of bytes in "this"\nfunction bnByteLength() {\n  return this.bitLength() >> 3\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n  var i\n  for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]\n  for (i = n - 1; i >= 0; --i) r[i] = 0\n  r.t = this.t + n\n  r.s = this.s\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n  for (var i = n; i < this.t; ++i) r[i - n] = this[i]\n  r.t = Math.max(this.t - n, 0)\n  r.s = this.s\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n  var self = this\n  var bs = n % self.DB\n  var cbs = self.DB - bs\n  var bm = (1 << cbs) - 1\n  var ds = Math.floor(n / self.DB),\n    c = (self.s << bs) & self.DM,\n    i\n  for (i = self.t - 1; i >= 0; --i) {\n    r[i + ds + 1] = (self[i] >> cbs) | c\n    c = (self[i] & bm) << bs\n  }\n  for (i = ds - 1; i >= 0; --i) r[i] = 0\n  r[ds] = c\n  r.t = self.t + ds + 1\n  r.s = self.s\n  r.clamp()\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n  var self = this\n  r.s = self.s\n  var ds = Math.floor(n / self.DB)\n  if (ds >= self.t) {\n    r.t = 0\n    return\n  }\n  var bs = n % self.DB\n  var cbs = self.DB - bs\n  var bm = (1 << bs) - 1\n  r[0] = self[ds] >> bs\n  for (var i = ds + 1; i < self.t; ++i) {\n    r[i - ds - 1] |= (self[i] & bm) << cbs\n    r[i - ds] = self[i] >> bs\n  }\n  if (bs > 0) r[self.t - ds - 1] |= (self.s & bm) << cbs\n  r.t = self.t - ds\n  r.clamp()\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n  var self = this\n  var i = 0,\n    c = 0,\n    m = Math.min(a.t, self.t)\n  while (i < m) {\n    c += self[i] - a[i]\n    r[i++] = c & self.DM\n    c >>= self.DB\n  }\n  if (a.t < self.t) {\n    c -= a.s\n    while (i < self.t) {\n      c += self[i]\n      r[i++] = c & self.DM\n      c >>= self.DB\n    }\n    c += self.s\n  } else {\n    c += self.s\n    while (i < a.t) {\n      c -= a[i]\n      r[i++] = c & self.DM\n      c >>= self.DB\n    }\n    c -= a.s\n  }\n  r.s = (c < 0) ? -1 : 0\n  if (c < -1) r[i++] = self.DV + c\n  else if (c > 0) r[i++] = c\n  r.t = i\n  r.clamp()\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// "this" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n  var x = this.abs(),\n    y = a.abs()\n  var i = x.t\n  r.t = i + y.t\n  while (--i >= 0) r[i] = 0\n  for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t)\n  r.s = 0\n  r.clamp()\n  if (this.s != a.s) BigInteger.ZERO.subTo(r, r)\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n  var x = this.abs()\n  var i = r.t = 2 * x.t\n  while (--i >= 0) r[i] = 0\n  for (i = 0; i < x.t - 1; ++i) {\n    var c = x.am(i, x[i], r, 2 * i, 0, 1)\n    if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n      r[i + x.t] -= x.DV\n      r[i + x.t + 1] = 1\n    }\n  }\n  if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)\n  r.s = 0\n  r.clamp()\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m.  q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n  var self = this\n  var pm = m.abs()\n  if (pm.t <= 0) return\n  var pt = self.abs()\n  if (pt.t < pm.t) {\n    if (q != null) q.fromInt(0)\n    if (r != null) self.copyTo(r)\n    return\n  }\n  if (r == null) r = new BigInteger()\n  var y = new BigInteger(),\n    ts = self.s,\n    ms = m.s\n  var nsh = self.DB - nbits(pm[pm.t - 1]); // normalize modulus\n  if (nsh > 0) {\n    pm.lShiftTo(nsh, y)\n    pt.lShiftTo(nsh, r)\n  } else {\n    pm.copyTo(y)\n    pt.copyTo(r)\n  }\n  var ys = y.t\n  var y0 = y[ys - 1]\n  if (y0 == 0) return\n  var yt = y0 * (1 << self.F1) + ((ys > 1) ? y[ys - 2] >> self.F2 : 0)\n  var d1 = self.FV / yt,\n    d2 = (1 << self.F1) / yt,\n    e = 1 << self.F2\n  var i = r.t,\n    j = i - ys,\n    t = (q == null) ? new BigInteger() : q\n  y.dlShiftTo(j, t)\n  if (r.compareTo(t) >= 0) {\n    r[r.t++] = 1\n    r.subTo(t, r)\n  }\n  BigInteger.ONE.dlShiftTo(ys, t)\n  t.subTo(y, y); // "negative" y so we can replace sub with am later\n  while (y.t < ys) y[y.t++] = 0\n  while (--j >= 0) {\n    // Estimate quotient digit\n    var qd = (r[--i] == y0) ? self.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2)\n    if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\n      y.dlShiftTo(j, t)\n      r.subTo(t, r)\n      while (r[i] < --qd) r.subTo(t, r)\n    }\n  }\n  if (q != null) {\n    r.drShiftTo(ys, q)\n    if (ts != ms) BigInteger.ZERO.subTo(q, q)\n  }\n  r.t = ys\n  r.clamp()\n  if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\n  if (ts < 0) BigInteger.ZERO.subTo(r, r)\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n  var r = new BigInteger()\n  this.abs()\n    .divRemTo(a, null, r)\n  if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r)\n  return r\n}\n\n// Modular reduction using "classic" algorithm\nfunction Classic(m) {\n  this.m = m\n}\n\nfunction cConvert(x) {\n  if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m)\n  else return x\n}\n\nfunction cRevert(x) {\n  return x\n}\n\nfunction cReduce(x) {\n  x.divRemTo(this.m, null, x)\n}\n\nfunction cMulTo(x, y, r) {\n  x.multiplyTo(y, r)\n  this.reduce(r)\n}\n\nfunction cSqrTo(x, r) {\n  x.squareTo(r)\n  this.reduce(r)\n}\n\nClassic.prototype.convert = cConvert\nClassic.prototype.revert = cRevert\nClassic.prototype.reduce = cReduce\nClassic.prototype.mulTo = cMulTo\nClassic.prototype.sqrTo = cSqrTo\n\n// (protected) return "-1/this % 2^DB"; useful for Mont. reduction\n// justification:\n//         xy == 1 (mod m)\n//         xy =  1+km\n//   xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply "overflows" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n  if (this.t < 1) return 0\n  var x = this[0]\n  if ((x & 1) == 0) return 0\n  var y = x & 3; // y == 1/x mod 2^2\n  y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4\n  y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8\n  y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16\n  // last step - calculate inverse mod DV directly\n  // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n  y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits\n  // we really want the negative inverse, and -DV < y < DV\n  return (y > 0) ? this.DV - y : -y\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n  this.m = m\n  this.mp = m.invDigit()\n  this.mpl = this.mp & 0x7fff\n  this.mph = this.mp >> 15\n  this.um = (1 << (m.DB - 15)) - 1\n  this.mt2 = 2 * m.t\n}\n\n// xR mod m\nfunction montConvert(x) {\n  var r = new BigInteger()\n  x.abs()\n    .dlShiftTo(this.m.t, r)\n  r.divRemTo(this.m, null, r)\n  if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r)\n  return r\n}\n\n// x/R mod m\nfunction montRevert(x) {\n  var r = new BigInteger()\n  x.copyTo(r)\n  this.reduce(r)\n  return r\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n  while (x.t <= this.mt2) // pad x so am has enough room later\n    x[x.t++] = 0\n  for (var i = 0; i < this.m.t; ++i) {\n    // faster way of calculating u0 = x[i]*mp mod DV\n    var j = x[i] & 0x7fff\n    var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM\n    // use am to combine the multiply-shift-add into one call\n    j = i + this.m.t\n    x[j] += this.m.am(0, u0, x, i, 0, this.m.t)\n    // propagate carry\n    while (x[j] >= x.DV) {\n      x[j] -= x.DV\n      x[++j]++\n    }\n  }\n  x.clamp()\n  x.drShiftTo(this.m.t, x)\n  if (x.compareTo(this.m) >= 0) x.subTo(this.m, x)\n}\n\n// r = "x^2/R mod m"; x != r\nfunction montSqrTo(x, r) {\n  x.squareTo(r)\n  this.reduce(r)\n}\n\n// r = "xy/R mod m"; x,y != r\nfunction montMulTo(x, y, r) {\n  x.multiplyTo(y, r)\n  this.reduce(r)\n}\n\nMontgomery.prototype.convert = montConvert\nMontgomery.prototype.revert = montRevert\nMontgomery.prototype.reduce = montReduce\nMontgomery.prototype.mulTo = montMulTo\nMontgomery.prototype.sqrTo = montSqrTo\n\n// (protected) true iff this is even\nfunction bnpIsEven() {\n  return ((this.t > 0) ? (this[0] & 1) : this.s) == 0\n}\n\n// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)\nfunction bnpExp(e, z) {\n  if (e > 0xffffffff || e < 1) return BigInteger.ONE\n  var r = new BigInteger(),\n    r2 = new BigInteger(),\n    g = z.convert(this),\n    i = nbits(e) - 1\n  g.copyTo(r)\n  while (--i >= 0) {\n    z.sqrTo(r, r2)\n    if ((e & (1 << i)) > 0) z.mulTo(r2, g, r)\n    else {\n      var t = r\n      r = r2\n      r2 = t\n    }\n  }\n  return z.revert(r)\n}\n\n// (public) this^e % m, 0 <= e < 2^32\nfunction bnModPowInt(e, m) {\n  var z\n  if (e < 256 || m.isEven()) z = new Classic(m)\n  else z = new Montgomery(m)\n  return this.exp(e, z)\n}\n\n// protected\nproto.copyTo = bnpCopyTo\nproto.fromInt = bnpFromInt\nproto.fromString = bnpFromString\nproto.clamp = bnpClamp\nproto.dlShiftTo = bnpDLShiftTo\nproto.drShiftTo = bnpDRShiftTo\nproto.lShiftTo = bnpLShiftTo\nproto.rShiftTo = bnpRShiftTo\nproto.subTo = bnpSubTo\nproto.multiplyTo = bnpMultiplyTo\nproto.squareTo = bnpSquareTo\nproto.divRemTo = bnpDivRemTo\nproto.invDigit = bnpInvDigit\nproto.isEven = bnpIsEven\nproto.exp = bnpExp\n\n// public\nproto.toString = bnToString\nproto.negate = bnNegate\nproto.abs = bnAbs\nproto.compareTo = bnCompareTo\nproto.bitLength = bnBitLength\nproto.byteLength = bnByteLength\nproto.mod = bnMod\nproto.modPowInt = bnModPowInt\n\n// (public)\nfunction bnClone() {\n  var r = new BigInteger()\n  this.copyTo(r)\n  return r\n}\n\n// (public) return value as integer\nfunction bnIntValue() {\n  if (this.s < 0) {\n    if (this.t == 1) return this[0] - this.DV\n    else if (this.t == 0) return -1\n  } else if (this.t == 1) return this[0]\n  else if (this.t == 0) return 0\n  // assumes 16 < DB < 32\n  return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0]\n}\n\n// (public) return value as byte\nfunction bnByteValue() {\n  return (this.t == 0) ? this.s : (this[0] << 24) >> 24\n}\n\n// (public) return value as short (assumes DB>=16)\nfunction bnShortValue() {\n  return (this.t == 0) ? this.s : (this[0] << 16) >> 16\n}\n\n// (protected) return x s.t. r^x < DV\nfunction bnpChunkSize(r) {\n  return Math.floor(Math.LN2 * this.DB / Math.log(r))\n}\n\n// (public) 0 if this == 0, 1 if this > 0\nfunction bnSigNum() {\n  if (this.s < 0) return -1\n  else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0\n  else return 1\n}\n\n// (protected) convert to radix string\nfunction bnpToRadix(b) {\n  if (b == null) b = 10\n  if (this.signum() == 0 || b < 2 || b > 36) return "0"\n  var cs = this.chunkSize(b)\n  var a = Math.pow(b, cs)\n  var d = nbv(a),\n    y = new BigInteger(),\n    z = new BigInteger(),\n    r = ""\n  this.divRemTo(d, y, z)\n  while (y.signum() > 0) {\n    r = (a + z.intValue())\n      .toString(b)\n      .substr(1) + r\n    y.divRemTo(d, y, z)\n  }\n  return z.intValue()\n    .toString(b) + r\n}\n\n// (protected) convert from radix string\nfunction bnpFromRadix(s, b) {\n  var self = this\n  self.fromInt(0)\n  if (b == null) b = 10\n  var cs = self.chunkSize(b)\n  var d = Math.pow(b, cs),\n    mi = false,\n    j = 0,\n    w = 0\n  for (var i = 0; i < s.length; ++i) {\n    var x = intAt(s, i)\n    if (x < 0) {\n      if (s.charAt(i) == "-" && self.signum() == 0) mi = true\n      continue\n    }\n    w = b * w + x\n    if (++j >= cs) {\n      self.dMultiply(d)\n      self.dAddOffset(w, 0)\n      j = 0\n      w = 0\n    }\n  }\n  if (j > 0) {\n    self.dMultiply(Math.pow(b, j))\n    self.dAddOffset(w, 0)\n  }\n  if (mi) BigInteger.ZERO.subTo(self, self)\n}\n\n// (protected) alternate constructor\nfunction bnpFromNumber(a, b, c) {\n  var self = this\n  if ("number" == typeof b) {\n    // new BigInteger(int,int,RNG)\n    if (a < 2) self.fromInt(1)\n    else {\n      self.fromNumber(a, c)\n      if (!self.testBit(a - 1)) // force MSB set\n        self.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, self)\n      if (self.isEven()) self.dAddOffset(1, 0); // force odd\n      while (!self.isProbablePrime(b)) {\n        self.dAddOffset(2, 0)\n        if (self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a - 1), self)\n      }\n    }\n  } else {\n    // new BigInteger(int,RNG)\n    var x = new Array(),\n      t = a & 7\n    x.length = (a >> 3) + 1\n    b.nextBytes(x)\n    if (t > 0) x[0] &= ((1 << t) - 1)\n    else x[0] = 0\n    self.fromString(x, 256)\n  }\n}\n\n// (public) convert to bigendian byte array\nfunction bnToByteArray() {\n  var self = this\n  var i = self.t,\n    r = new Array()\n  r[0] = self.s\n  var p = self.DB - (i * self.DB) % 8,\n    d, k = 0\n  if (i-- > 0) {\n    if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)\n      r[k++] = d | (self.s << (self.DB - p))\n    while (i >= 0) {\n      if (p < 8) {\n        d = (self[i] & ((1 << p) - 1)) << (8 - p)\n        d |= self[--i] >> (p += self.DB - 8)\n      } else {\n        d = (self[i] >> (p -= 8)) & 0xff\n        if (p <= 0) {\n          p += self.DB\n          --i\n        }\n      }\n      if ((d & 0x80) != 0) d |= -256\n      if (k === 0 && (self.s & 0x80) != (d & 0x80))++k\n      if (k > 0 || d != self.s) r[k++] = d\n    }\n  }\n  return r\n}\n\nfunction bnEquals(a) {\n  return (this.compareTo(a) == 0)\n}\n\nfunction bnMin(a) {\n  return (this.compareTo(a) < 0) ? this : a\n}\n\nfunction bnMax(a) {\n  return (this.compareTo(a) > 0) ? this : a\n}\n\n// (protected) r = this op a (bitwise)\nfunction bnpBitwiseTo(a, op, r) {\n  var self = this\n  var i, f, m = Math.min(a.t, self.t)\n  for (i = 0; i < m; ++i) r[i] = op(self[i], a[i])\n  if (a.t < self.t) {\n    f = a.s & self.DM\n    for (i = m; i < self.t; ++i) r[i] = op(self[i], f)\n    r.t = self.t\n  } else {\n    f = self.s & self.DM\n    for (i = m; i < a.t; ++i) r[i] = op(f, a[i])\n    r.t = a.t\n  }\n  r.s = op(self.s, a.s)\n  r.clamp()\n}\n\n// (public) this & a\nfunction op_and(x, y) {\n  return x & y\n}\n\nfunction bnAnd(a) {\n  var r = new BigInteger()\n  this.bitwiseTo(a, op_and, r)\n  return r\n}\n\n// (public) this | a\nfunction op_or(x, y) {\n  return x | y\n}\n\nfunction bnOr(a) {\n  var r = new BigInteger()\n  this.bitwiseTo(a, op_or, r)\n  return r\n}\n\n// (public) this ^ a\nfunction op_xor(x, y) {\n  return x ^ y\n}\n\nfunction bnXor(a) {\n  var r = new BigInteger()\n  this.bitwiseTo(a, op_xor, r)\n  return r\n}\n\n// (public) this & ~a\nfunction op_andnot(x, y) {\n  return x & ~y\n}\n\nfunction bnAndNot(a) {\n  var r = new BigInteger()\n  this.bitwiseTo(a, op_andnot, r)\n  return r\n}\n\n// (public) ~this\nfunction bnNot() {\n  var r = new BigInteger()\n  for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]\n  r.t = this.t\n  r.s = ~this.s\n  return r\n}\n\n// (public) this << n\nfunction bnShiftLeft(n) {\n  var r = new BigInteger()\n  if (n < 0) this.rShiftTo(-n, r)\n  else this.lShiftTo(n, r)\n  return r\n}\n\n// (public) this >> n\nfunction bnShiftRight(n) {\n  var r = new BigInteger()\n  if (n < 0) this.lShiftTo(-n, r)\n  else this.rShiftTo(n, r)\n  return r\n}\n\n// return index of lowest 1-bit in x, x < 2^31\nfunction lbit(x) {\n  if (x == 0) return -1\n  var r = 0\n  if ((x & 0xffff) == 0) {\n    x >>= 16\n    r += 16\n  }\n  if ((x & 0xff) == 0) {\n    x >>= 8\n    r += 8\n  }\n  if ((x & 0xf) == 0) {\n    x >>= 4\n    r += 4\n  }\n  if ((x & 3) == 0) {\n    x >>= 2\n    r += 2\n  }\n  if ((x & 1) == 0)++r\n  return r\n}\n\n// (public) returns index of lowest 1-bit (or -1 if none)\nfunction bnGetLowestSetBit() {\n  for (var i = 0; i < this.t; ++i)\n    if (this[i] != 0) return i * this.DB + lbit(this[i])\n  if (this.s < 0) return this.t * this.DB\n  return -1\n}\n\n// return number of 1 bits in x\nfunction cbit(x) {\n  var r = 0\n  while (x != 0) {\n    x &= x - 1\n    ++r\n  }\n  return r\n}\n\n// (public) return number of set bits\nfunction bnBitCount() {\n  var r = 0,\n    x = this.s & this.DM\n  for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x)\n  return r\n}\n\n// (public) true iff nth bit is set\nfunction bnTestBit(n) {\n  var j = Math.floor(n / this.DB)\n  if (j >= this.t) return (this.s != 0)\n  return ((this[j] & (1 << (n % this.DB))) != 0)\n}\n\n// (protected) this op (1<<n)\nfunction bnpChangeBit(n, op) {\n  var r = BigInteger.ONE.shiftLeft(n)\n  this.bitwiseTo(r, op, r)\n  return r\n}\n\n// (public) this | (1<<n)\nfunction bnSetBit(n) {\n  return this.changeBit(n, op_or)\n}\n\n// (public) this & ~(1<<n)\nfunction bnClearBit(n) {\n  return this.changeBit(n, op_andnot)\n}\n\n// (public) this ^ (1<<n)\nfunction bnFlipBit(n) {\n  return this.changeBit(n, op_xor)\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n  var self = this\n\n  var i = 0,\n    c = 0,\n    m = Math.min(a.t, self.t)\n  while (i < m) {\n    c += self[i] + a[i]\n    r[i++] = c & self.DM\n    c >>= self.DB\n  }\n  if (a.t < self.t) {\n    c += a.s\n    while (i < self.t) {\n      c += self[i]\n      r[i++] = c & self.DM\n      c >>= self.DB\n    }\n    c += self.s\n  } else {\n    c += self.s\n    while (i < a.t) {\n      c += a[i]\n      r[i++] = c & self.DM\n      c >>= self.DB\n    }\n    c += a.s\n  }\n  r.s = (c < 0) ? -1 : 0\n  if (c > 0) r[i++] = c\n  else if (c < -1) r[i++] = self.DV + c\n  r.t = i\n  r.clamp()\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n  var r = new BigInteger()\n  this.addTo(a, r)\n  return r\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n  var r = new BigInteger()\n  this.subTo(a, r)\n  return r\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n  var r = new BigInteger()\n  this.multiplyTo(a, r)\n  return r\n}\n\n// (public) this^2\nfunction bnSquare() {\n  var r = new BigInteger()\n  this.squareTo(r)\n  return r\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n  var r = new BigInteger()\n  this.divRemTo(a, r, null)\n  return r\n}\n\n// (public) this % a\nfunction bnRemainder(a) {\n  var r = new BigInteger()\n  this.divRemTo(a, null, r)\n  return r\n}\n\n// (public) [this/a,this%a]\nfunction bnDivideAndRemainder(a) {\n  var q = new BigInteger(),\n    r = new BigInteger()\n  this.divRemTo(a, q, r)\n  return new Array(q, r)\n}\n\n// (protected) this *= n, this >= 0, 1 < n < DV\nfunction bnpDMultiply(n) {\n  this[this.t] = this.am(0, n - 1, this, 0, 0, this.t)\n  ++this.t\n  this.clamp()\n}\n\n// (protected) this += n << w words, this >= 0\nfunction bnpDAddOffset(n, w) {\n  if (n == 0) return\n  while (this.t <= w) this[this.t++] = 0\n  this[w] += n\n  while (this[w] >= this.DV) {\n    this[w] -= this.DV\n    if (++w >= this.t) this[this.t++] = 0\n    ++this[w]\n  }\n}\n\n// A "null" reducer\nfunction NullExp() {}\n\nfunction nNop(x) {\n  return x\n}\n\nfunction nMulTo(x, y, r) {\n  x.multiplyTo(y, r)\n}\n\nfunction nSqrTo(x, r) {\n  x.squareTo(r)\n}\n\nNullExp.prototype.convert = nNop\nNullExp.prototype.revert = nNop\nNullExp.prototype.mulTo = nMulTo\nNullExp.prototype.sqrTo = nSqrTo\n\n// (public) this^e\nfunction bnPow(e) {\n  return this.exp(e, new NullExp())\n}\n\n// (protected) r = lower n words of "this * a", a.t <= n\n// "this" should be the larger one if appropriate.\nfunction bnpMultiplyLowerTo(a, n, r) {\n  var i = Math.min(this.t + a.t, n)\n  r.s = 0; // assumes a,this >= 0\n  r.t = i\n  while (i > 0) r[--i] = 0\n  var j\n  for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t)\n  for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i)\n  r.clamp()\n}\n\n// (protected) r = "this * a" without lower n words, n > 0\n// "this" should be the larger one if appropriate.\nfunction bnpMultiplyUpperTo(a, n, r) {\n  --n\n  var i = r.t = this.t + a.t - n\n  r.s = 0; // assumes a,this >= 0\n  while (--i >= 0) r[i] = 0\n  for (i = Math.max(n - this.t, 0); i < a.t; ++i)\n    r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n)\n  r.clamp()\n  r.drShiftTo(1, r)\n}\n\n// Barrett modular reduction\nfunction Barrett(m) {\n  // setup Barrett\n  this.r2 = new BigInteger()\n  this.q3 = new BigInteger()\n  BigInteger.ONE.dlShiftTo(2 * m.t, this.r2)\n  this.mu = this.r2.divide(m)\n  this.m = m\n}\n\nfunction barrettConvert(x) {\n  if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m)\n  else if (x.compareTo(this.m) < 0) return x\n  else {\n    var r = new BigInteger()\n    x.copyTo(r)\n    this.reduce(r)\n    return r\n  }\n}\n\nfunction barrettRevert(x) {\n  return x\n}\n\n// x = x mod m (HAC 14.42)\nfunction barrettReduce(x) {\n  var self = this\n  x.drShiftTo(self.m.t - 1, self.r2)\n  if (x.t > self.m.t + 1) {\n    x.t = self.m.t + 1\n    x.clamp()\n  }\n  self.mu.multiplyUpperTo(self.r2, self.m.t + 1, self.q3)\n  self.m.multiplyLowerTo(self.q3, self.m.t + 1, self.r2)\n  while (x.compareTo(self.r2) < 0) x.dAddOffset(1, self.m.t + 1)\n  x.subTo(self.r2, x)\n  while (x.compareTo(self.m) >= 0) x.subTo(self.m, x)\n}\n\n// r = x^2 mod m; x != r\nfunction barrettSqrTo(x, r) {\n  x.squareTo(r)\n  this.reduce(r)\n}\n\n// r = x*y mod m; x,y != r\nfunction barrettMulTo(x, y, r) {\n  x.multiplyTo(y, r)\n  this.reduce(r)\n}\n\nBarrett.prototype.convert = barrettConvert\nBarrett.prototype.revert = barrettRevert\nBarrett.prototype.reduce = barrettReduce\nBarrett.prototype.mulTo = barrettMulTo\nBarrett.prototype.sqrTo = barrettSqrTo\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m) {\n  var i = e.bitLength(),\n    k, r = nbv(1),\n    z\n  if (i <= 0) return r\n  else if (i < 18) k = 1\n  else if (i < 48) k = 3\n  else if (i < 144) k = 4\n  else if (i < 768) k = 5\n  else k = 6\n  if (i < 8)\n    z = new Classic(m)\n  else if (m.isEven())\n    z = new Barrett(m)\n  else\n    z = new Montgomery(m)\n\n  // precomputation\n  var g = new Array(),\n    n = 3,\n    k1 = k - 1,\n    km = (1 << k) - 1\n  g[1] = z.convert(this)\n  if (k > 1) {\n    var g2 = new BigInteger()\n    z.sqrTo(g[1], g2)\n    while (n <= km) {\n      g[n] = new BigInteger()\n      z.mulTo(g2, g[n - 2], g[n])\n      n += 2\n    }\n  }\n\n  var j = e.t - 1,\n    w, is1 = true,\n    r2 = new BigInteger(),\n    t\n  i = nbits(e[j]) - 1\n  while (j >= 0) {\n    if (i >= k1) w = (e[j] >> (i - k1)) & km\n    else {\n      w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i)\n      if (j > 0) w |= e[j - 1] >> (this.DB + i - k1)\n    }\n\n    n = k\n    while ((w & 1) == 0) {\n      w >>= 1\n      --n\n    }\n    if ((i -= n) < 0) {\n      i += this.DB\n      --j\n    }\n    if (is1) { // ret == 1, don\'t bother squaring or multiplying it\n      g[w].copyTo(r)\n      is1 = false\n    } else {\n      while (n > 1) {\n        z.sqrTo(r, r2)\n        z.sqrTo(r2, r)\n        n -= 2\n      }\n      if (n > 0) z.sqrTo(r, r2)\n      else {\n        t = r\n        r = r2\n        r2 = t\n      }\n      z.mulTo(r2, g[w], r)\n    }\n\n    while (j >= 0 && (e[j] & (1 << i)) == 0) {\n      z.sqrTo(r, r2)\n      t = r\n      r = r2\n      r2 = t\n      if (--i < 0) {\n        i = this.DB - 1\n        --j\n      }\n    }\n  }\n  return z.revert(r)\n}\n\n// (public) gcd(this,a) (HAC 14.54)\nfunction bnGCD(a) {\n  var x = (this.s < 0) ? this.negate() : this.clone()\n  var y = (a.s < 0) ? a.negate() : a.clone()\n  if (x.compareTo(y) < 0) {\n    var t = x\n    x = y\n    y = t\n  }\n  var i = x.getLowestSetBit(),\n    g = y.getLowestSetBit()\n  if (g < 0) return x\n  if (i < g) g = i\n  if (g > 0) {\n    x.rShiftTo(g, x)\n    y.rShiftTo(g, y)\n  }\n  while (x.signum() > 0) {\n    if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x)\n    if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y)\n    if (x.compareTo(y) >= 0) {\n      x.subTo(y, x)\n      x.rShiftTo(1, x)\n    } else {\n      y.subTo(x, y)\n      y.rShiftTo(1, y)\n    }\n  }\n  if (g > 0) y.lShiftTo(g, y)\n  return y\n}\n\n// (protected) this % n, n < 2^26\nfunction bnpModInt(n) {\n  if (n <= 0) return 0\n  var d = this.DV % n,\n    r = (this.s < 0) ? n - 1 : 0\n  if (this.t > 0)\n    if (d == 0) r = this[0] % n\n    else\n      for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n\n  return r\n}\n\n// (public) 1/this % m (HAC 14.61)\nfunction bnModInverse(m) {\n  var ac = m.isEven()\n  if (this.signum() === 0) throw new Error(\'division by zero\')\n  if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO\n  var u = m.clone(),\n    v = this.clone()\n  var a = nbv(1),\n    b = nbv(0),\n    c = nbv(0),\n    d = nbv(1)\n  while (u.signum() != 0) {\n    while (u.isEven()) {\n      u.rShiftTo(1, u)\n      if (ac) {\n        if (!a.isEven() || !b.isEven()) {\n          a.addTo(this, a)\n          b.subTo(m, b)\n        }\n        a.rShiftTo(1, a)\n      } else if (!b.isEven()) b.subTo(m, b)\n      b.rShiftTo(1, b)\n    }\n    while (v.isEven()) {\n      v.rShiftTo(1, v)\n      if (ac) {\n        if (!c.isEven() || !d.isEven()) {\n          c.addTo(this, c)\n          d.subTo(m, d)\n        }\n        c.rShiftTo(1, c)\n      } else if (!d.isEven()) d.subTo(m, d)\n      d.rShiftTo(1, d)\n    }\n    if (u.compareTo(v) >= 0) {\n      u.subTo(v, u)\n      if (ac) a.subTo(c, a)\n      b.subTo(d, b)\n    } else {\n      v.subTo(u, v)\n      if (ac) c.subTo(a, c)\n      d.subTo(b, d)\n    }\n  }\n  if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO\n  while (d.compareTo(m) >= 0) d.subTo(m, d)\n  while (d.signum() < 0) d.addTo(m, d)\n  return d\n}\n\nvar lowprimes = [\n  2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71,\n  73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151,\n  157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233,\n  239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317,\n  331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419,\n  421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503,\n  509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607,\n  613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,\n  709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811,\n  821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911,\n  919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997\n]\n\nvar lplim = (1 << 26) / lowprimes[lowprimes.length - 1]\n\n// (public) test primality with certainty >= 1-.5^t\nfunction bnIsProbablePrime(t) {\n  var i, x = this.abs()\n  if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {\n    for (i = 0; i < lowprimes.length; ++i)\n      if (x[0] == lowprimes[i]) return true\n    return false\n  }\n  if (x.isEven()) return false\n  i = 1\n  while (i < lowprimes.length) {\n    var m = lowprimes[i],\n      j = i + 1\n    while (j < lowprimes.length && m < lplim) m *= lowprimes[j++]\n    m = x.modInt(m)\n    while (i < j) if (m % lowprimes[i++] == 0) return false\n  }\n  return x.millerRabin(t)\n}\n\n// (protected) true if probably prime (HAC 4.24, Miller-Rabin)\nfunction bnpMillerRabin(t) {\n  var n1 = this.subtract(BigInteger.ONE)\n  var k = n1.getLowestSetBit()\n  if (k <= 0) return false\n  var r = n1.shiftRight(k)\n  t = (t + 1) >> 1\n  if (t > lowprimes.length) t = lowprimes.length\n  var a = new BigInteger(null)\n  var j, bases = []\n  for (var i = 0; i < t; ++i) {\n    for (;;) {\n      j = lowprimes[Math.floor(Math.random() * lowprimes.length)]\n      if (bases.indexOf(j) == -1) break\n    }\n    bases.push(j)\n    a.fromInt(j)\n    var y = a.modPow(r, this)\n    if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n      var j = 1\n      while (j++ < k && y.compareTo(n1) != 0) {\n        y = y.modPowInt(2, this)\n        if (y.compareTo(BigInteger.ONE) == 0) return false\n      }\n      if (y.compareTo(n1) != 0) return false\n    }\n  }\n  return true\n}\n\n// protected\nproto.chunkSize = bnpChunkSize\nproto.toRadix = bnpToRadix\nproto.fromRadix = bnpFromRadix\nproto.fromNumber = bnpFromNumber\nproto.bitwiseTo = bnpBitwiseTo\nproto.changeBit = bnpChangeBit\nproto.addTo = bnpAddTo\nproto.dMultiply = bnpDMultiply\nproto.dAddOffset = bnpDAddOffset\nproto.multiplyLowerTo = bnpMultiplyLowerTo\nproto.multiplyUpperTo = bnpMultiplyUpperTo\nproto.modInt = bnpModInt\nproto.millerRabin = bnpMillerRabin\n\n// public\nproto.clone = bnClone\nproto.intValue = bnIntValue\nproto.byteValue = bnByteValue\nproto.shortValue = bnShortValue\nproto.signum = bnSigNum\nproto.toByteArray = bnToByteArray\nproto.equals = bnEquals\nproto.min = bnMin\nproto.max = bnMax\nproto.and = bnAnd\nproto.or = bnOr\nproto.xor = bnXor\nproto.andNot = bnAndNot\nproto.not = bnNot\nproto.shiftLeft = bnShiftLeft\nproto.shiftRight = bnShiftRight\nproto.getLowestSetBit = bnGetLowestSetBit\nproto.bitCount = bnBitCount\nproto.testBit = bnTestBit\nproto.setBit = bnSetBit\nproto.clearBit = bnClearBit\nproto.flipBit = bnFlipBit\nproto.add = bnAdd\nproto.subtract = bnSubtract\nproto.multiply = bnMultiply\nproto.divide = bnDivide\nproto.remainder = bnRemainder\nproto.divideAndRemainder = bnDivideAndRemainder\nproto.modPow = bnModPow\nproto.modInverse = bnModInverse\nproto.pow = bnPow\nproto.gcd = bnGCD\nproto.isProbablePrime = bnIsProbablePrime\n\n// JSBN-specific extension\nproto.square = bnSquare\n\n// constants\nBigInteger.ZERO = nbv(0)\nBigInteger.ONE = nbv(1)\nBigInteger.valueOf = nbv\n\nmodule.exports = BigInteger\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bigi/lib/bigi.js\n// module id = 340\n// module chunks = 0\n\n//# sourceURL=../node_modules/bigi/lib/bigi.js')},function(module,exports,__webpack_require__){eval("var pushdata = __webpack_require__(524)\nvar varuint = __webpack_require__(313)\n\n// https://github.com/feross/buffer/blob/master/index.js#L1127\nfunction verifuint (value, max) {\n  if (typeof value !== 'number') throw new Error('cannot write a non-number as a number')\n  if (value < 0) throw new Error('specified a negative value for writing an unsigned value')\n  if (value > max) throw new Error('RangeError: value out of range')\n  if (Math.floor(value) !== value) throw new Error('value has a fractional component')\n}\n\nfunction readUInt64LE (buffer, offset) {\n  var a = buffer.readUInt32LE(offset)\n  var b = buffer.readUInt32LE(offset + 4)\n  b *= 0x100000000\n\n  verifuint(b + a, 0x001fffffffffffff)\n\n  return b + a\n}\n\nfunction writeUInt64LE (buffer, value, offset) {\n  verifuint(value, 0x001fffffffffffff)\n\n  buffer.writeInt32LE(value & -1, offset)\n  buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)\n  return offset + 8\n}\n\n// TODO: remove in 4.0.0?\nfunction readVarInt (buffer, offset) {\n  var result = varuint.decode(buffer, offset)\n\n  return {\n    number: result,\n    size: varuint.decode.bytes\n  }\n}\n\n// TODO: remove in 4.0.0?\nfunction writeVarInt (buffer, number, offset) {\n  varuint.encode(number, buffer, offset)\n  return varuint.encode.bytes\n}\n\nmodule.exports = {\n  pushDataSize: pushdata.encodingLength,\n  readPushDataInt: pushdata.decode,\n  readUInt64LE: readUInt64LE,\n  readVarInt: readVarInt,\n  varIntBuffer: varuint.encode,\n  varIntSize: varuint.encodingLength,\n  writePushDataInt: pushdata.encode,\n  writeUInt64LE: writeUInt64LE,\n  writeVarInt: writeVarInt\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/bufferutils.js\n// module id = 341\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/bufferutils.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\n\nfunction decode (buffer, maxLength, minimal) {\n  maxLength = maxLength || 4\n  minimal = minimal === undefined ? true : minimal\n\n  var length = buffer.length\n  if (length === 0) return 0\n  if (length > maxLength) throw new TypeError('Script number overflow')\n  if (minimal) {\n    if ((buffer[length - 1] & 0x7f) === 0) {\n      if (length <= 1 || (buffer[length - 2] & 0x80) === 0) throw new Error('Non-minimally encoded script number')\n    }\n  }\n\n  // 40-bit\n  if (length === 5) {\n    var a = buffer.readUInt32LE(0)\n    var b = buffer.readUInt8(4)\n\n    if (b & 0x80) return -(((b & ~0x80) * 0x100000000) + a)\n    return (b * 0x100000000) + a\n  }\n\n  var result = 0\n\n  // 32-bit / 24-bit / 16-bit / 8-bit\n  for (var i = 0; i < length; ++i) {\n    result |= buffer[i] << (8 * i)\n  }\n\n  if (buffer[length - 1] & 0x80) return -(result & ~(0x80 << (8 * (length - 1))))\n  return result\n}\n\nfunction scriptNumSize (i) {\n  return i > 0x7fffffff ? 5\n  : i > 0x7fffff ? 4\n  : i > 0x7fff ? 3\n  : i > 0x7f ? 2\n  : i > 0x00 ? 1\n  : 0\n}\n\nfunction encode (number) {\n  var value = Math.abs(number)\n  var size = scriptNumSize(value)\n  var buffer = Buffer.allocUnsafe(size)\n  var negative = number < 0\n\n  for (var i = 0; i < size; ++i) {\n    buffer.writeUInt8(value & 0xff, i)\n    value >>= 8\n  }\n\n  if (buffer[size - 1] & 0x80) {\n    buffer.writeUInt8(negative ? 0x80 : 0x00, size - 1)\n  } else if (negative) {\n    buffer[size - 1] |= 0x80\n  }\n\n  return buffer\n}\n\nmodule.exports = {\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/script_number.js\n// module id = 342\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/script_number.js")},function(module,exports,__webpack_require__){eval("// m [pubKeys ...] n OP_CHECKMULTISIG\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\nvar OP_INT_BASE = OPS.OP_RESERVED // OP_1 - 1\n\nfunction check (script, allowIncomplete) {\n  var chunks = bscript.decompile(script)\n\n  if (chunks.length < 4) return false\n  if (chunks[chunks.length - 1] !== OPS.OP_CHECKMULTISIG) return false\n  if (!types.Number(chunks[0])) return false\n  if (!types.Number(chunks[chunks.length - 2])) return false\n  var m = chunks[0] - OP_INT_BASE\n  var n = chunks[chunks.length - 2] - OP_INT_BASE\n\n  if (m <= 0) return false\n  if (n > 16) return false\n  if (m > n) return false\n  if (n !== chunks.length - 3) return false\n  if (allowIncomplete) return true\n\n  var keys = chunks.slice(1, -2)\n  return keys.every(bscript.isCanonicalPubKey)\n}\ncheck.toJSON = function () { return 'multi-sig output' }\n\nfunction encode (m, pubKeys) {\n  typeforce({\n    m: types.Number,\n    pubKeys: [bscript.isCanonicalPubKey]\n  }, {\n    m: m,\n    pubKeys: pubKeys\n  })\n\n  var n = pubKeys.length\n  if (n < m) throw new TypeError('Not enough pubKeys provided')\n\n  return bscript.compile([].concat(\n    OP_INT_BASE + m,\n    pubKeys,\n    OP_INT_BASE + n,\n    OPS.OP_CHECKMULTISIG\n  ))\n}\n\nfunction decode (buffer, allowIncomplete) {\n  var chunks = bscript.decompile(buffer)\n  typeforce(check, chunks, allowIncomplete)\n\n  return {\n    m: chunks[0] - OP_INT_BASE,\n    pubKeys: chunks.slice(1, -2)\n  }\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/multisig/output.js\n// module id = 343\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/multisig/output.js")},function(module,exports,__webpack_require__){eval("// OP_0 {pubKeyHash}\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length === 22 &&\n    buffer[0] === OPS.OP_0 &&\n    buffer[1] === 0x14\n}\ncheck.toJSON = function () { return 'Witness pubKeyHash output' }\n\nfunction encode (pubKeyHash) {\n  typeforce(types.Hash160bit, pubKeyHash)\n\n  return bscript.compile([OPS.OP_0, pubKeyHash])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return buffer.slice(2)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnesspubkeyhash/output.js\n// module id = 344\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnesspubkeyhash/output.js")},function(module,exports,__webpack_require__){eval("// OP_0 {scriptHash}\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length === 34 &&\n    buffer[0] === OPS.OP_0 &&\n    buffer[1] === 0x20\n}\ncheck.toJSON = function () { return 'Witness scriptHash output' }\n\nfunction encode (scriptHash) {\n  typeforce(types.Hash256bit, scriptHash)\n\n  return bscript.compile([OPS.OP_0, scriptHash])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return buffer.slice(2)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnessscripthash/output.js\n// module id = 345\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnessscripthash/output.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var ERROR_MSG_INPUT = 'Input must be an string, Buffer or Uint8Array'\n\n// For convenience, let people hash a string, not just a Uint8Array\nfunction normalizeInput (input) {\n  var ret\n  if (input instanceof Uint8Array) {\n    ret = input\n  } else if (input instanceof Buffer) {\n    ret = new Uint8Array(input)\n  } else if (typeof (input) === 'string') {\n    ret = new Uint8Array(Buffer.from(input, 'utf8'))\n  } else {\n    throw new Error(ERROR_MSG_INPUT)\n  }\n  return ret\n}\n\n// Converts a Uint8Array to a hexadecimal string\n// For example, toHex([255, 0, 255]) returns \"ff00ff\"\nfunction toHex (bytes) {\n  return Array.prototype.map.call(bytes, function (n) {\n    return (n < 16 ? '0' : '') + n.toString(16)\n  }).join('')\n}\n\n// Converts any value in [0...2^32-1] to an 8-character hex string\nfunction uint32ToHex (val) {\n  return (0x100000000 + val).toString(16).substring(1)\n}\n\n// For debugging: prints out hash state in the same format as the RFC\n// sample computation exactly, so that you can diff\nfunction debugPrint (label, arr, size) {\n  var msg = '\\n' + label + ' = '\n  for (var i = 0; i < arr.length; i += 2) {\n    if (size === 32) {\n      msg += uint32ToHex(arr[i]).toUpperCase()\n      msg += ' '\n      msg += uint32ToHex(arr[i + 1]).toUpperCase()\n    } else if (size === 64) {\n      msg += uint32ToHex(arr[i + 1]).toUpperCase()\n      msg += uint32ToHex(arr[i]).toUpperCase()\n    } else throw new Error('Invalid size ' + size)\n    if (i % 6 === 4) {\n      msg += '\\n' + new Array(label.length + 4).join(' ')\n    } else if (i < arr.length - 2) {\n      msg += ' '\n    }\n  }\n  console.log(msg)\n}\n\n// For performance testing: generates N bytes of input, hashes M times\n// Measures and prints MB/second hash performance each time\nfunction testSpeed (hashFn, N, M) {\n  var startMs = new Date().getTime()\n\n  var input = new Uint8Array(N)\n  for (var i = 0; i < N; i++) {\n    input[i] = i % 256\n  }\n  var genMs = new Date().getTime()\n  console.log('Generated random input in ' + (genMs - startMs) + 'ms')\n  startMs = genMs\n\n  for (i = 0; i < M; i++) {\n    var hashHex = hashFn(input)\n    var hashMs = new Date().getTime()\n    var ms = hashMs - startMs\n    startMs = hashMs\n    console.log('Hashed in ' + ms + 'ms: ' + hashHex.substring(0, 20) + '...')\n    console.log(Math.round(N / (1 << 20) / (ms / 1000) * 100) / 100 + ' MB PER SECOND')\n  }\n}\n\nmodule.exports = {\n  normalizeInput: normalizeInput,\n  toHex: toHex,\n  debugPrint: debugPrint,\n  testSpeed: testSpeed\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blakejs/util.js\n// module id = 346\n// module chunks = 0\n\n//# sourceURL=../node_modules/blakejs/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {\n\nconst ieee754 = __webpack_require__(412)\nconst Bignumber = __webpack_require__(165)\n\nconst parser = __webpack_require__(650)\nconst utils = __webpack_require__(236)\nconst c = __webpack_require__(166)\nconst Simple = __webpack_require__(348)\nconst Tagged = __webpack_require__(349)\nconst url = __webpack_require__(157)\n\n/**\n * Transform binary cbor data into JavaScript objects.\n */\nclass Decoder {\n  /**\n   * @param {Object} [opts={}]\n   * @param {number} [opts.size=65536] - Size of the allocated heap.\n   */\n  constructor (opts) {\n    opts = opts || {}\n\n    if (!opts.size || opts.size < 0x10000) {\n      opts.size = 0x10000\n    } else {\n      // Ensure the size is a power of 2\n      opts.size = utils.nextPowerOf2(opts.size)\n    }\n\n    // Heap use to share the input with the parser\n    this._heap = new ArrayBuffer(opts.size)\n    this._heap8 = new Uint8Array(this._heap)\n\n    this._reset()\n\n    // Known tags\n    this._knownTags = Object.assign({\n      0: (val) => new Date(val),\n      1: (val) => new Date(val * 1000),\n      2: (val) => utils.arrayBufferToBignumber(val),\n      3: (val) => c.NEG_ONE.minus(utils.arrayBufferToBignumber(val)),\n      4: (v) => {\n        // const v = new Uint8Array(val)\n        return c.TEN.pow(v[0]).times(v[1])\n      },\n      5: (v) => {\n        // const v = new Uint8Array(val)\n        return c.TWO.pow(v[0]).times(v[1])\n      },\n      32: (val) => url.parse(val),\n      35: (val) => new RegExp(val)\n    }, opts.tags)\n\n    // Initialize asm based parser\n    this.parser = parser(global, {\n      log: console.log.bind(console),\n      pushInt: this.pushInt.bind(this),\n      pushInt32: this.pushInt32.bind(this),\n      pushInt32Neg: this.pushInt32Neg.bind(this),\n      pushInt64: this.pushInt64.bind(this),\n      pushInt64Neg: this.pushInt64Neg.bind(this),\n      pushFloat: this.pushFloat.bind(this),\n      pushFloatSingle: this.pushFloatSingle.bind(this),\n      pushFloatDouble: this.pushFloatDouble.bind(this),\n      pushTrue: this.pushTrue.bind(this),\n      pushFalse: this.pushFalse.bind(this),\n      pushUndefined: this.pushUndefined.bind(this),\n      pushNull: this.pushNull.bind(this),\n      pushInfinity: this.pushInfinity.bind(this),\n      pushInfinityNeg: this.pushInfinityNeg.bind(this),\n      pushNaN: this.pushNaN.bind(this),\n      pushNaNNeg: this.pushNaNNeg.bind(this),\n      pushArrayStart: this.pushArrayStart.bind(this),\n      pushArrayStartFixed: this.pushArrayStartFixed.bind(this),\n      pushArrayStartFixed32: this.pushArrayStartFixed32.bind(this),\n      pushArrayStartFixed64: this.pushArrayStartFixed64.bind(this),\n      pushObjectStart: this.pushObjectStart.bind(this),\n      pushObjectStartFixed: this.pushObjectStartFixed.bind(this),\n      pushObjectStartFixed32: this.pushObjectStartFixed32.bind(this),\n      pushObjectStartFixed64: this.pushObjectStartFixed64.bind(this),\n      pushByteString: this.pushByteString.bind(this),\n      pushByteStringStart: this.pushByteStringStart.bind(this),\n      pushUtf8String: this.pushUtf8String.bind(this),\n      pushUtf8StringStart: this.pushUtf8StringStart.bind(this),\n      pushSimpleUnassigned: this.pushSimpleUnassigned.bind(this),\n      pushTagUnassigned: this.pushTagUnassigned.bind(this),\n      pushTagStart: this.pushTagStart.bind(this),\n      pushTagStart4: this.pushTagStart4.bind(this),\n      pushTagStart8: this.pushTagStart8.bind(this),\n      pushBreak: this.pushBreak.bind(this)\n    }, this._heap)\n  }\n\n  get _depth () {\n    return this._parents.length\n  }\n\n  get _currentParent () {\n    return this._parents[this._depth - 1]\n  }\n\n  get _ref () {\n    return this._currentParent.ref\n  }\n\n  // Finish the current parent\n  _closeParent () {\n    var p = this._parents.pop()\n\n    if (p.length > 0) {\n      throw new Error(`Missing ${p.length} elements`)\n    }\n\n    switch (p.type) {\n      case c.PARENT.TAG:\n        this._push(\n          this.createTag(p.ref[0], p.ref[1])\n        )\n        break\n      case c.PARENT.BYTE_STRING:\n        this._push(this.createByteString(p.ref, p.length))\n        break\n      case c.PARENT.UTF8_STRING:\n        this._push(this.createUtf8String(p.ref, p.length))\n        break\n      case c.PARENT.MAP:\n        if (p.values % 2 > 0) {\n          throw new Error('Odd number of elements in the map')\n        }\n        this._push(this.createMap(p.ref, p.length))\n        break\n      case c.PARENT.OBJECT:\n        if (p.values % 2 > 0) {\n          throw new Error('Odd number of elements in the map')\n        }\n        this._push(this.createObject(p.ref, p.length))\n        break\n      case c.PARENT.ARRAY:\n        this._push(this.createArray(p.ref, p.length))\n        break\n      default:\n        break\n    }\n\n    if (this._currentParent && this._currentParent.type === c.PARENT.TAG) {\n      this._dec()\n    }\n  }\n\n  // Reduce the expected length of the current parent by one\n  _dec () {\n    const p = this._currentParent\n    // The current parent does not know the epxected child length\n\n    if (p.length < 0) {\n      return\n    }\n\n    p.length--\n\n    // All children were seen, we can close the current parent\n    if (p.length === 0) {\n      this._closeParent()\n    }\n  }\n\n  // Push any value to the current parent\n  _push (val, hasChildren) {\n    const p = this._currentParent\n    p.values++\n\n    switch (p.type) {\n      case c.PARENT.ARRAY:\n      case c.PARENT.BYTE_STRING:\n      case c.PARENT.UTF8_STRING:\n        if (p.length > -1) {\n          this._ref[this._ref.length - p.length] = val\n        } else {\n          this._ref.push(val)\n        }\n        this._dec()\n        break\n      case c.PARENT.OBJECT:\n        if (p.tmpKey != null) {\n          this._ref[p.tmpKey] = val\n          p.tmpKey = null\n          this._dec()\n        } else {\n          p.tmpKey = val\n\n          if (typeof p.tmpKey !== 'string') {\n            // too bad, convert to a Map\n            p.type = c.PARENT.MAP\n            p.ref = utils.buildMap(p.ref)\n          }\n        }\n        break\n      case c.PARENT.MAP:\n        if (p.tmpKey != null) {\n          this._ref.set(p.tmpKey, val)\n          p.tmpKey = null\n          this._dec()\n        } else {\n          p.tmpKey = val\n        }\n        break\n      case c.PARENT.TAG:\n        this._ref.push(val)\n        if (!hasChildren) {\n          this._dec()\n        }\n        break\n      default:\n        throw new Error('Unknown parent type')\n    }\n  }\n\n  // Create a new parent in the parents list\n  _createParent (obj, type, len) {\n    this._parents[this._depth] = {\n      type: type,\n      length: len,\n      ref: obj,\n      values: 0,\n      tmpKey: null\n    }\n  }\n\n  // Reset all state back to the beginning, also used for initiatlization\n  _reset () {\n    this._res = []\n    this._parents = [{\n      type: c.PARENT.ARRAY,\n      length: -1,\n      ref: this._res,\n      values: 0,\n      tmpKey: null\n    }]\n  }\n\n  // -- Interface to customize deoding behaviour\n  createTag (tagNumber, value) {\n    const typ = this._knownTags[tagNumber]\n\n    if (!typ) {\n      return new Tagged(tagNumber, value)\n    }\n\n    return typ(value)\n  }\n\n  createMap (obj, len) {\n    return obj\n  }\n\n  createObject (obj, len) {\n    return obj\n  }\n\n  createArray (arr, len) {\n    return arr\n  }\n\n  createByteString (raw, len) {\n    return Buffer.concat(raw)\n  }\n\n  createByteStringFromHeap (start, end) {\n    if (start === end) {\n      return Buffer.alloc(0)\n    }\n\n    return Buffer.from(this._heap.slice(start, end))\n  }\n\n  createInt (val) {\n    return val\n  }\n\n  createInt32 (f, g) {\n    return utils.buildInt32(f, g)\n  }\n\n  createInt64 (f1, f2, g1, g2) {\n    return utils.buildInt64(f1, f2, g1, g2)\n  }\n\n  createFloat (val) {\n    return val\n  }\n\n  createFloatSingle (a, b, c, d) {\n    return ieee754.read([a, b, c, d], 0, false, 23, 4)\n  }\n\n  createFloatDouble (a, b, c, d, e, f, g, h) {\n    return ieee754.read([a, b, c, d, e, f, g, h], 0, false, 52, 8)\n  }\n\n  createInt32Neg (f, g) {\n    return -1 - utils.buildInt32(f, g)\n  }\n\n  createInt64Neg (f1, f2, g1, g2) {\n    const f = utils.buildInt32(f1, f2)\n    const g = utils.buildInt32(g1, g2)\n\n    if (f > c.MAX_SAFE_HIGH) {\n      return c.NEG_ONE.minus(new Bignumber(f).times(c.SHIFT32).plus(g))\n    }\n\n    return -1 - ((f * c.SHIFT32) + g)\n  }\n\n  createTrue () {\n    return true\n  }\n\n  createFalse () {\n    return false\n  }\n\n  createNull () {\n    return null\n  }\n\n  createUndefined () {\n    return void 0\n  }\n\n  createInfinity () {\n    return Infinity\n  }\n\n  createInfinityNeg () {\n    return -Infinity\n  }\n\n  createNaN () {\n    return NaN\n  }\n\n  createNaNNeg () {\n    return -NaN\n  }\n\n  createUtf8String (raw, len) {\n    return raw.join('')\n  }\n\n  createUtf8StringFromHeap (start, end) {\n    if (start === end) {\n      return ''\n    }\n\n    return (\n      Buffer.from(this._heap.slice(start, end))\n    ).toString('utf8')\n  }\n\n  createSimpleUnassigned (val) {\n    return new Simple(val)\n  }\n\n  // -- Interface for decoder.asm.js\n\n  pushInt (val) {\n    this._push(this.createInt(val))\n  }\n\n  pushInt32 (f, g) {\n    this._push(this.createInt32(f, g))\n  }\n\n  pushInt64 (f1, f2, g1, g2) {\n    this._push(this.createInt64(f1, f2, g1, g2))\n  }\n\n  pushFloat (val) {\n    this._push(this.createFloat(val))\n  }\n\n  pushFloatSingle (a, b, c, d) {\n    this._push(this.createFloatSingle(a, b, c, d))\n  }\n\n  pushFloatDouble (a, b, c, d, e, f, g, h) {\n    this._push(this.createFloatDouble(a, b, c, d, e, f, g, h))\n  }\n\n  pushInt32Neg (f, g) {\n    this._push(this.createInt32Neg(f, g))\n  }\n\n  pushInt64Neg (f1, f2, g1, g2) {\n    this._push(this.createInt64Neg(f1, f2, g1, g2))\n  }\n\n  pushTrue () {\n    this._push(this.createTrue())\n  }\n\n  pushFalse () {\n    this._push(this.createFalse())\n  }\n\n  pushNull () {\n    this._push(this.createNull())\n  }\n\n  pushUndefined () {\n    this._push(this.createUndefined())\n  }\n\n  pushInfinity () {\n    this._push(this.createInfinity())\n  }\n\n  pushInfinityNeg () {\n    this._push(this.createInfinityNeg())\n  }\n\n  pushNaN () {\n    this._push(this.createNaN())\n  }\n\n  pushNaNNeg () {\n    this._push(this.createNaNNeg())\n  }\n\n  pushArrayStart () {\n    this._createParent([], c.PARENT.ARRAY, -1)\n  }\n\n  pushArrayStartFixed (len) {\n    this._createArrayStartFixed(len)\n  }\n\n  pushArrayStartFixed32 (len1, len2) {\n    const len = utils.buildInt32(len1, len2)\n    this._createArrayStartFixed(len)\n  }\n\n  pushArrayStartFixed64 (len1, len2, len3, len4) {\n    const len = utils.buildInt64(len1, len2, len3, len4)\n    this._createArrayStartFixed(len)\n  }\n\n  pushObjectStart () {\n    this._createObjectStartFixed(-1)\n  }\n\n  pushObjectStartFixed (len) {\n    this._createObjectStartFixed(len)\n  }\n\n  pushObjectStartFixed32 (len1, len2) {\n    const len = utils.buildInt32(len1, len2)\n    this._createObjectStartFixed(len)\n  }\n\n  pushObjectStartFixed64 (len1, len2, len3, len4) {\n    const len = utils.buildInt64(len1, len2, len3, len4)\n    this._createObjectStartFixed(len)\n  }\n\n  pushByteStringStart () {\n    this._parents[this._depth] = {\n      type: c.PARENT.BYTE_STRING,\n      length: -1,\n      ref: [],\n      values: 0,\n      tmpKey: null\n    }\n  }\n\n  pushByteString (start, end) {\n    this._push(this.createByteStringFromHeap(start, end))\n  }\n\n  pushUtf8StringStart () {\n    this._parents[this._depth] = {\n      type: c.PARENT.UTF8_STRING,\n      length: -1,\n      ref: [],\n      values: 0,\n      tmpKey: null\n    }\n  }\n\n  pushUtf8String (start, end) {\n    this._push(this.createUtf8StringFromHeap(start, end))\n  }\n\n  pushSimpleUnassigned (val) {\n    this._push(this.createSimpleUnassigned(val))\n  }\n\n  pushTagStart (tag) {\n    this._parents[this._depth] = {\n      type: c.PARENT.TAG,\n      length: 1,\n      ref: [tag]\n    }\n  }\n\n  pushTagStart4 (f, g) {\n    this.pushTagStart(utils.buildInt32(f, g))\n  }\n\n  pushTagStart8 (f1, f2, g1, g2) {\n    this.pushTagStart(utils.buildInt64(f1, f2, g1, g2))\n  }\n\n  pushTagUnassigned (tagNumber) {\n    this._push(this.createTag(tagNumber))\n  }\n\n  pushBreak () {\n    if (this._currentParent.length > -1) {\n      throw new Error('Unexpected break')\n    }\n\n    this._closeParent()\n  }\n\n  _createObjectStartFixed (len) {\n    if (len === 0) {\n      this._push(this.createObject({}))\n      return\n    }\n\n    this._createParent({}, c.PARENT.OBJECT, len)\n  }\n\n  _createArrayStartFixed (len) {\n    if (len === 0) {\n      this._push(this.createArray([]))\n      return\n    }\n\n    this._createParent(new Array(len), c.PARENT.ARRAY, len)\n  }\n\n  _decode (input) {\n    if (input.byteLength === 0) {\n      throw new Error('Input too short')\n    }\n\n    this._reset()\n    this._heap8.set(input)\n    const code = this.parser.parse(input.byteLength)\n\n    if (this._depth > 1) {\n      while (this._currentParent.length === 0) {\n        this._closeParent()\n      }\n      if (this._depth > 1) {\n        throw new Error('Undeterminated nesting')\n      }\n    }\n\n    if (code > 0) {\n      throw new Error('Failed to parse')\n    }\n\n    if (this._res.length === 0) {\n      throw new Error('No valid result')\n    }\n  }\n\n  // -- Public Interface\n\n  decodeFirst (input) {\n    this._decode(input)\n\n    return this._res[0]\n  }\n\n  decodeAll (input) {\n    this._decode(input)\n\n    return this._res\n  }\n\n  /**\n   * Decode the first cbor object.\n   *\n   * @param {Buffer|string} input\n   * @param {string} [enc='hex'] - Encoding used if a string is passed.\n   * @returns {*}\n   */\n  static decode (input, enc) {\n    if (typeof input === 'string') {\n      input = Buffer.from(input, enc || 'hex')\n    }\n\n    const dec = new Decoder({size: input.length})\n    return dec.decodeFirst(input)\n  }\n\n  /**\n   * Decode all cbor objects.\n   *\n   * @param {Buffer|string} input\n   * @param {string} [enc='hex'] - Encoding used if a string is passed.\n   * @returns {Array<*>}\n   */\n  static decodeAll (input, enc) {\n    if (typeof input === 'string') {\n      input = Buffer.from(input, enc || 'hex')\n    }\n\n    const dec = new Decoder({size: input.length})\n    return dec.decodeAll(input)\n  }\n}\n\nDecoder.decodeFirst = Decoder.decode\n\nmodule.exports = Decoder\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/decoder.js\n// module id = 347\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/decoder.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst constants = __webpack_require__(166)\nconst MT = constants.MT\nconst SIMPLE = constants.SIMPLE\nconst SYMS = constants.SYMS\n\n/**\n * A CBOR Simple Value that does not map onto a known constant.\n */\nclass Simple {\n  /**\n   * Creates an instance of Simple.\n   *\n   * @param {integer} value - the simple value's integer value\n   */\n  constructor (value) {\n    if (typeof value !== 'number') {\n      throw new Error('Invalid Simple type: ' + (typeof value))\n    }\n    if ((value < 0) || (value > 255) || ((value | 0) !== value)) {\n      throw new Error('value must be a small positive integer: ' + value)\n    }\n    this.value = value\n  }\n\n  /**\n   * Debug string for simple value\n   *\n   * @returns {string} simple(value)\n   */\n  toString () {\n    return 'simple(' + this.value + ')'\n  }\n\n  /**\n   * Debug string for simple value\n   *\n   * @returns {string} simple(value)\n   */\n  inspect () {\n    return 'simple(' + this.value + ')'\n  }\n\n  /**\n   * Push the simple value onto the CBOR stream\n   *\n   * @param {cbor.Encoder} gen The generator to push onto\n   * @returns {number}\n   */\n  encodeCBOR (gen) {\n    return gen._pushInt(this.value, MT.SIMPLE_FLOAT)\n  }\n\n  /**\n   * Is the given object a Simple?\n   *\n   * @param {any} obj - object to test\n   * @returns {bool} - is it Simple?\n   */\n  static isSimple (obj) {\n    return obj instanceof Simple\n  }\n\n  /**\n   * Decode from the CBOR additional information into a JavaScript value.\n   * If the CBOR item has no parent, return a \"safe\" symbol instead of\n   * `null` or `undefined`, so that the value can be passed through a\n   * stream in object mode.\n   *\n   * @param {Number} val - the CBOR additional info to convert\n   * @param {bool} hasParent - Does the CBOR item have a parent?\n   * @returns {(null|undefined|Boolean|Symbol)} - the decoded value\n   */\n  static decode (val, hasParent) {\n    if (hasParent == null) {\n      hasParent = true\n    }\n    switch (val) {\n      case SIMPLE.FALSE:\n        return false\n      case SIMPLE.TRUE:\n        return true\n      case SIMPLE.NULL:\n        if (hasParent) {\n          return null\n        } else {\n          return SYMS.NULL\n        }\n      case SIMPLE.UNDEFINED:\n        if (hasParent) {\n          return void 0\n        } else {\n          return SYMS.UNDEFINED\n        }\n      case -1:\n        if (!hasParent) {\n          throw new Error('Invalid BREAK')\n        }\n        return SYMS.BREAK\n      default:\n        return new Simple(val)\n    }\n  }\n}\n\nmodule.exports = Simple\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/simple.js\n// module id = 348\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/simple.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * A CBOR tagged item, where the tag does not have semantics specified at the\n * moment, or those semantics threw an error during parsing. Typically this will\n * be an extension point you're not yet expecting.\n */\nclass Tagged {\n  /**\n   * Creates an instance of Tagged.\n   *\n   * @param {Number} tag - the number of the tag\n   * @param {any} value - the value inside the tag\n   * @param {Error} err - the error that was thrown parsing the tag, or null\n   */\n  constructor (tag, value, err) {\n    this.tag = tag\n    this.value = value\n    this.err = err\n    if (typeof this.tag !== 'number') {\n      throw new Error('Invalid tag type (' + (typeof this.tag) + ')')\n    }\n    if ((this.tag < 0) || ((this.tag | 0) !== this.tag)) {\n      throw new Error('Tag must be a positive integer: ' + this.tag)\n    }\n  }\n\n  /**\n   * Convert to a String\n   *\n   * @returns {String} string of the form '1(2)'\n   */\n  toString () {\n    return `${this.tag}(${JSON.stringify(this.value)})`\n  }\n\n  /**\n   * Push the simple value onto the CBOR stream\n   *\n   * @param {cbor.Encoder} gen The generator to push onto\n   * @returns {number}\n   */\n  encodeCBOR (gen) {\n    gen._pushTag(this.tag)\n    return gen.pushAny(this.value)\n  }\n\n  /**\n   * If we have a converter for this type, do the conversion.  Some converters\n   * are built-in.  Additional ones can be passed in.  If you want to remove\n   * a built-in converter, pass a converter in whose value is 'null' instead\n   * of a function.\n   *\n   * @param {Object} converters - keys in the object are a tag number, the value\n   *   is a function that takes the decoded CBOR and returns a JavaScript value\n   *   of the appropriate type.  Throw an exception in the function on errors.\n   * @returns {any} - the converted item\n   */\n  convert (converters) {\n    var er, f\n    f = converters != null ? converters[this.tag] : void 0\n    if (typeof f !== 'function') {\n      f = Tagged['_tag' + this.tag]\n      if (typeof f !== 'function') {\n        return this\n      }\n    }\n    try {\n      return f.call(Tagged, this.value)\n    } catch (error) {\n      er = error\n      this.err = er\n      return this\n    }\n  }\n}\n\nmodule.exports = Tagged\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/tagged.js\n// module id = 349\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/tagged.js")},function(module,exports,__webpack_require__){eval("var r;\n\nmodule.exports = function rand(len) {\n  if (!r)\n    r = new Rand(null);\n\n  return r.generate(len);\n};\n\nfunction Rand(rand) {\n  this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n  return this._rand(len);\n};\n\n// Emulate crypto API using randy\nRand.prototype._rand = function _rand(n) {\n  if (this.rand.getBytes)\n    return this.rand.getBytes(n);\n\n  var res = new Uint8Array(n);\n  for (var i = 0; i < res.length; i++)\n    res[i] = this.rand.getByte();\n  return res;\n};\n\nif (typeof self === 'object') {\n  if (self.crypto && self.crypto.getRandomValues) {\n    // Modern browsers\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      self.crypto.getRandomValues(arr);\n      return arr;\n    };\n  } else if (self.msCrypto && self.msCrypto.getRandomValues) {\n    // IE\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      self.msCrypto.getRandomValues(arr);\n      return arr;\n    };\n\n  // Safari's WebWorkers do not have `crypto`\n  } else if (typeof window === 'object') {\n    // Old junk\n    Rand.prototype._rand = function() {\n      throw new Error('Not implemented yet');\n    };\n  }\n} else {\n  // Node.js or Web worker with no crypto support\n  try {\n    var crypto = __webpack_require__(1349);\n    if (typeof crypto.randomBytes !== 'function')\n      throw new Error('Not supported');\n\n    Rand.prototype._rand = function _rand(n) {\n      return crypto.randomBytes(n);\n    };\n  } catch (e) {\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/brorand/index.js\n// module id = 350\n// module chunks = 0\n\n//# sourceURL=../node_modules/brorand/index.js")},function(module,exports,__webpack_require__){eval("var aes = __webpack_require__(167)\nvar Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(77)\nvar inherits = __webpack_require__(3)\nvar GHASH = __webpack_require__(656)\nvar xor = __webpack_require__(134)\nvar incr32 = __webpack_require__(352)\n\nfunction xorTest (a, b) {\n  var out = 0\n  if (a.length !== b.length) out++\n\n  var len = Math.min(a.length, b.length)\n  for (var i = 0; i < len; ++i) {\n    out += (a[i] ^ b[i])\n  }\n\n  return out\n}\n\nfunction calcIv (self, iv, ck) {\n  if (iv.length === 12) {\n    self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])\n    return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])\n  }\n  var ghash = new GHASH(ck)\n  var len = iv.length\n  var toPad = len % 16\n  ghash.update(iv)\n  if (toPad) {\n    toPad = 16 - toPad\n    ghash.update(Buffer.alloc(toPad, 0))\n  }\n  ghash.update(Buffer.alloc(8, 0))\n  var ivBits = len * 8\n  var tail = Buffer.alloc(8)\n  tail.writeUIntBE(ivBits, 0, 8)\n  ghash.update(tail)\n  self._finID = ghash.state\n  var out = Buffer.from(self._finID)\n  incr32(out)\n  return out\n}\nfunction StreamCipher (mode, key, iv, decrypt) {\n  Transform.call(this)\n\n  var h = Buffer.alloc(4, 0)\n\n  this._cipher = new aes.AES(key)\n  var ck = this._cipher.encryptBlock(h)\n  this._ghash = new GHASH(ck)\n  iv = calcIv(this, iv, ck)\n\n  this._prev = Buffer.from(iv)\n  this._cache = Buffer.allocUnsafe(0)\n  this._secCache = Buffer.allocUnsafe(0)\n  this._decrypt = decrypt\n  this._alen = 0\n  this._len = 0\n  this._mode = mode\n\n  this._authTag = null\n  this._called = false\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n  if (!this._called && this._alen) {\n    var rump = 16 - (this._alen % 16)\n    if (rump < 16) {\n      rump = Buffer.alloc(rump, 0)\n      this._ghash.update(rump)\n    }\n  }\n\n  this._called = true\n  var out = this._mode.encrypt(this, chunk)\n  if (this._decrypt) {\n    this._ghash.update(chunk)\n  } else {\n    this._ghash.update(out)\n  }\n  this._len += chunk.length\n  return out\n}\n\nStreamCipher.prototype._final = function () {\n  if (this._decrypt && !this._authTag) throw new Error('Unsupported state or unable to authenticate data')\n\n  var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))\n  if (this._decrypt && xorTest(tag, this._authTag)) throw new Error('Unsupported state or unable to authenticate data')\n\n  this._authTag = tag\n  this._cipher.scrub()\n}\n\nStreamCipher.prototype.getAuthTag = function getAuthTag () {\n  if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error('Attempting to get auth tag in unsupported state')\n\n  return this._authTag\n}\n\nStreamCipher.prototype.setAuthTag = function setAuthTag (tag) {\n  if (!this._decrypt) throw new Error('Attempting to set auth tag in unsupported state')\n\n  this._authTag = tag\n}\n\nStreamCipher.prototype.setAAD = function setAAD (buf) {\n  if (this._called) throw new Error('Attempting to set AAD in unsupported state')\n\n  this._ghash.update(buf)\n  this._alen += buf.length\n}\n\nmodule.exports = StreamCipher\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/authCipher.js\n// module id = 351\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/authCipher.js")},function(module,exports){eval("function incr32 (iv) {\n  var len = iv.length\n  var item\n  while (len--) {\n    item = iv.readUInt8(len)\n    if (item === 255) {\n      iv.writeUInt8(0, len)\n    } else {\n      item++\n      iv.writeUInt8(item, len)\n      break\n    }\n  }\n}\nmodule.exports = incr32\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/incr32.js\n// module id = 352\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/incr32.js")},function(module,exports,__webpack_require__){eval("var xor = __webpack_require__(134)\nvar Buffer = __webpack_require__(1).Buffer\nvar incr32 = __webpack_require__(352)\n\nfunction getBlock (self) {\n  var out = self._cipher.encryptBlockRaw(self._prev)\n  incr32(self._prev)\n  return out\n}\n\nvar blockSize = 16\nexports.encrypt = function (self, chunk) {\n  var chunkNum = Math.ceil(chunk.length / blockSize)\n  var start = self._cache.length\n  self._cache = Buffer.concat([\n    self._cache,\n    Buffer.allocUnsafe(chunkNum * blockSize)\n  ])\n  for (var i = 0; i < chunkNum; i++) {\n    var out = getBlock(self)\n    var offset = start + i * blockSize\n    self._cache.writeUInt32BE(out[0], offset + 0)\n    self._cache.writeUInt32BE(out[1], offset + 4)\n    self._cache.writeUInt32BE(out[2], offset + 8)\n    self._cache.writeUInt32BE(out[3], offset + 12)\n  }\n  var pad = self._cache.slice(0, chunk.length)\n  self._cache = self._cache.slice(chunk.length)\n  return xor(chunk, pad)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/ctr.js\n// module id = 353\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/ctr.js")},function(module,exports){eval('module.exports = {"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/list.json\n// module id = 354\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/list.json')},function(module,exports,__webpack_require__){eval("var aes = __webpack_require__(167)\nvar Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(77)\nvar inherits = __webpack_require__(3)\n\nfunction StreamCipher (mode, key, iv, decrypt) {\n  Transform.call(this)\n\n  this._cipher = new aes.AES(key)\n  this._prev = Buffer.from(iv)\n  this._cache = Buffer.allocUnsafe(0)\n  this._secCache = Buffer.allocUnsafe(0)\n  this._decrypt = decrypt\n  this._mode = mode\n}\n\ninherits(StreamCipher, Transform)\n\nStreamCipher.prototype._update = function (chunk) {\n  return this._mode.encrypt(this, chunk, this._decrypt)\n}\n\nStreamCipher.prototype._final = function () {\n  this._cipher.scrub()\n}\n\nmodule.exports = StreamCipher\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/streamCipher.js\n// module id = 355\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/streamCipher.js")},function(module,exports){eval('module.exports = {"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/browser/algorithms.json\n// module id = 356\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/browser/algorithms.json')},function(module,exports){eval('module.exports = {"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/browser/curves.json\n// module id = 357\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/browser/curves.json')},function(module,exports){eval("/**\n * Slice reference.\n */\n\nvar slice = [].slice;\n\n/**\n * Bind `obj` to `fn`.\n *\n * @param {Object} obj\n * @param {Function|String} fn or string\n * @return {Function}\n * @api public\n */\n\nmodule.exports = function(obj, fn){\n  if ('string' == typeof fn) fn = obj[fn];\n  if ('function' != typeof fn) throw new Error('bind() requires a function');\n  var args = slice.call(arguments, 2);\n  return function(){\n    return fn.apply(obj, args.concat(slice.call(arguments)));\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/component-bind/index.js\n// module id = 358\n// module chunks = 0\n\n//# sourceURL=../node_modules/component-bind/index.js")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(42).document;\nmodule.exports = document && document.documentElement;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_html.js\n// module id = 359\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_html.js")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(78) && !__webpack_require__(116)(function () {\n  return Object.defineProperty(__webpack_require__(242)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_ie8-dom-define.js\n// module id = 360\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_ie8-dom-define.js")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(135);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n  return cof(it) == 'String' ? it.split('') : Object(it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iobject.js\n// module id = 361\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iobject.js")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(117);\nvar ITERATOR = __webpack_require__(38)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-array-iter.js\n// module id = 362\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_is-array-iter.js")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(68);\nmodule.exports = function (iterator, fn, value, entries) {\n  try {\n    return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n  // 7.4.6 IteratorClose(iterator, completion)\n  } catch (e) {\n    var ret = iterator['return'];\n    if (ret !== undefined) anObject(ret.call(iterator));\n    throw e;\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-call.js\n// module id = 363\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iter-call.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(171);\nvar $export = __webpack_require__(69);\nvar redefine = __webpack_require__(371);\nvar hide = __webpack_require__(90);\nvar Iterators = __webpack_require__(117);\nvar $iterCreate = __webpack_require__(690);\nvar setToStringTag = __webpack_require__(173);\nvar getPrototypeOf = __webpack_require__(698);\nvar ITERATOR = __webpack_require__(38)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n  $iterCreate(Constructor, NAME, next);\n  var getMethod = function (kind) {\n    if (!BUGGY && kind in proto) return proto[kind];\n    switch (kind) {\n      case KEYS: return function keys() { return new Constructor(this, kind); };\n      case VALUES: return function values() { return new Constructor(this, kind); };\n    } return function entries() { return new Constructor(this, kind); };\n  };\n  var TAG = NAME + ' Iterator';\n  var DEF_VALUES = DEFAULT == VALUES;\n  var VALUES_BUG = false;\n  var proto = Base.prototype;\n  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n  var $default = $native || getMethod(DEFAULT);\n  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n  var methods, key, IteratorPrototype;\n  // Fix native\n  if ($anyNative) {\n    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n      // Set @@toStringTag to native iterators\n      setToStringTag(IteratorPrototype, TAG, true);\n      // fix for some old engines\n      if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n    }\n  }\n  // fix Array#{values, @@iterator}.name in V8 / FF\n  if (DEF_VALUES && $native && $native.name !== VALUES) {\n    VALUES_BUG = true;\n    $default = function values() { return $native.call(this); };\n  }\n  // Define iterator\n  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n    hide(proto, ITERATOR, $default);\n  }\n  // Plug for library\n  Iterators[NAME] = $default;\n  Iterators[TAG] = returnThis;\n  if (DEFAULT) {\n    methods = {\n      values: DEF_VALUES ? $default : getMethod(VALUES),\n      keys: IS_SET ? $default : getMethod(KEYS),\n      entries: $entries\n    };\n    if (FORCED) for (key in methods) {\n      if (!(key in proto)) redefine(proto, key, methods[key]);\n    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n  }\n  return methods;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-define.js\n// module id = 364\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iter-define.js")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(38)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n  var riter = [7][ITERATOR]();\n  riter['return'] = function () { SAFE_CLOSING = true; };\n  // eslint-disable-next-line no-throw-literal\n  Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n  if (!skipClosing && !SAFE_CLOSING) return false;\n  var safe = false;\n  try {\n    var arr = [7];\n    var iter = arr[ITERATOR]();\n    iter.next = function () { return { done: safe = true }; };\n    arr[ITERATOR] = function () { return iter; };\n    exec(arr);\n  } catch (e) { /* empty */ }\n  return safe;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-detect.js\n// module id = 365\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iter-detect.js")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(68);\nvar dPs = __webpack_require__(695);\nvar enumBugKeys = __webpack_require__(243);\nvar IE_PROTO = __webpack_require__(246)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n  // Thrash, waste and sodomy: IE GC bug\n  var iframe = __webpack_require__(242)('iframe');\n  var i = enumBugKeys.length;\n  var lt = '<';\n  var gt = '>';\n  var iframeDocument;\n  iframe.style.display = 'none';\n  __webpack_require__(359).appendChild(iframe);\n  iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n  // createDict = iframe.contentWindow.Object;\n  // html.removeChild(iframe);\n  iframeDocument = iframe.contentWindow.document;\n  iframeDocument.open();\n  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n  iframeDocument.close();\n  createDict = iframeDocument.F;\n  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n  return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n  var result;\n  if (O !== null) {\n    Empty[PROTOTYPE] = anObject(O);\n    result = new Empty();\n    Empty[PROTOTYPE] = null;\n    // add \"__proto__\" for Object.getPrototypeOf polyfill\n    result[IE_PROTO] = O;\n  } else result = createDict();\n  return Properties === undefined ? result : dPs(result, Properties);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-create.js\n// module id = 366\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-create.js")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(368);\nvar hiddenKeys = __webpack_require__(243).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n  return $keys(O, hiddenKeys);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopn.js\n// module id = 367\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopn.js")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(89);\nvar toIObject = __webpack_require__(118);\nvar arrayIndexOf = __webpack_require__(684)(false);\nvar IE_PROTO = __webpack_require__(246)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n  var O = toIObject(object);\n  var i = 0;\n  var result = [];\n  var key;\n  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n  // Don't enum bug & hidden keys\n  while (names.length > i) if (has(O, key = names[i++])) {\n    ~arrayIndexOf(result, key) || result.push(key);\n  }\n  return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-keys-internal.js\n// module id = 368\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-keys-internal.js")},function(module,exports){eval("module.exports = function (exec) {\n  try {\n    return { e: false, v: exec() };\n  } catch (e) {\n    return { e: true, v: e };\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_perform.js\n// module id = 369\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_perform.js")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(68);\nvar isObject = __webpack_require__(91);\nvar newPromiseCapability = __webpack_require__(244);\n\nmodule.exports = function (C, x) {\n  anObject(C);\n  if (isObject(x) && x.constructor === C) return x;\n  var promiseCapability = newPromiseCapability.f(C);\n  var resolve = promiseCapability.resolve;\n  resolve(x);\n  return promiseCapability.promise;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_promise-resolve.js\n// module id = 370\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_promise-resolve.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(90);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_redefine.js\n// module id = 371\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_redefine.js")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(68);\nvar aFunction = __webpack_require__(170);\nvar SPECIES = __webpack_require__(38)('species');\nmodule.exports = function (O, D) {\n  var C = anObject(O).constructor;\n  var S;\n  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_species-constructor.js\n// module id = 372\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_species-constructor.js")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(136);\nvar invoke = __webpack_require__(688);\nvar html = __webpack_require__(359);\nvar cel = __webpack_require__(242);\nvar global = __webpack_require__(42);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n  var id = +this;\n  // eslint-disable-next-line no-prototype-builtins\n  if (queue.hasOwnProperty(id)) {\n    var fn = queue[id];\n    delete queue[id];\n    fn();\n  }\n};\nvar listener = function (event) {\n  run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n  setTask = function setImmediate(fn) {\n    var args = [];\n    var i = 1;\n    while (arguments.length > i) args.push(arguments[i++]);\n    queue[++counter] = function () {\n      // eslint-disable-next-line no-new-func\n      invoke(typeof fn == 'function' ? fn : Function(fn), args);\n    };\n    defer(counter);\n    return counter;\n  };\n  clearTask = function clearImmediate(id) {\n    delete queue[id];\n  };\n  // Node.js 0.8-\n  if (__webpack_require__(135)(process) == 'process') {\n    defer = function (id) {\n      process.nextTick(ctx(run, id, 1));\n    };\n  // Sphere (JS game engine) Dispatch API\n  } else if (Dispatch && Dispatch.now) {\n    defer = function (id) {\n      Dispatch.now(ctx(run, id, 1));\n    };\n  // Browsers with MessageChannel, includes WebWorkers\n  } else if (MessageChannel) {\n    channel = new MessageChannel();\n    port = channel.port2;\n    channel.port1.onmessage = listener;\n    defer = ctx(port.postMessage, port, 1);\n  // Browsers with postMessage, skip WebWorkers\n  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n  } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n    defer = function (id) {\n      global.postMessage(id + '', '*');\n    };\n    global.addEventListener('message', listener, false);\n  // IE8-\n  } else if (ONREADYSTATECHANGE in cel('script')) {\n    defer = function (id) {\n      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n        html.removeChild(this);\n        run.call(id);\n      };\n    };\n  // Rest old browsers\n  } else {\n    defer = function (id) {\n      setTimeout(ctx(run, id, 1), 0);\n    };\n  }\n}\nmodule.exports = {\n  set: setTask,\n  clear: clearTask\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_task.js\n// module id = 373\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_task.js")},function(module,exports){eval("\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.to-string.js\n// module id = 374\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.to-string.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst leftPad = __webpack_require__(432)\nconst Key = __webpack_require__(40).Key\n\nconst readme = __webpack_require__(725)\n\n// eslint-disable-next-line\n/*:: import type {Datastore, Callback} from 'interface-datastore'\n\nexport interface ShardV1 {\n  name: string;\n  param: number;\n  fun(string): string;\n  toString(): string;\n}\n*/\n\nconst PREFIX = exports.PREFIX = '/repo/flatfs/shard/'\nconst SHARDING_FN = exports.SHARDING_FN = 'SHARDING'\nexports.README_FN = '_README'\n\nclass Shard {\n  /* :: name: string */\n  /* :: param: number */\n  /* :: _padding: string */\n\n  constructor (param /* : number */) {\n    this.param = param\n  }\n\n  fun (str /* : string */) /* : string */ {\n    throw new Error('implement me')\n  }\n\n  toString () /* : string */ {\n    return `${PREFIX}v1/${this.name}/${this.param}`\n  }\n}\n\nclass Prefix extends Shard {\n  constructor (prefixLen /* : number */) {\n    super(prefixLen)\n    this._padding = leftPad('', prefixLen, '_')\n    this.name = 'prefix'\n  }\n\n  fun (noslash /* : string */) /* : string */ {\n    return (noslash + this._padding).slice(0, this.param)\n  }\n}\n\nclass Suffix extends Shard {\n  constructor (suffixLen /* : number */) {\n    super(suffixLen)\n    this._padding = leftPad('', suffixLen, '_')\n    this.name = 'suffix'\n  }\n\n  fun (noslash /* : string */) /* : string */ {\n    const s = this._padding + noslash\n    return s.slice(s.length - this.param)\n  }\n}\n\nclass NextToLast extends Shard {\n  constructor (suffixLen /* : number */) {\n    super(suffixLen)\n    this._padding = leftPad('', suffixLen + 1, '_')\n    this.name = 'next-to-last'\n  }\n\n  fun (noslash /* : string */) /* : string */ {\n    const s = this._padding + noslash\n    const offset = s.length - this.param - 1\n    return s.slice(offset, offset + this.param)\n  }\n}\n\n/**\n * Convert a given string to the matching sharding function.\n *\n * @param {string} str\n * @returns {ShardV1}\n */\nfunction parseShardFun (str /* : string */) /* : ShardV1 */ {\n  str = str.trim()\n\n  if (str.length === 0) {\n    throw new Error('empty shard string')\n  }\n\n  if (!str.startsWith(PREFIX)) {\n    throw new Error(`invalid or no path prefix: ${str}`)\n  }\n\n  const parts = str.slice(PREFIX.length).split('/')\n  const version = parts[0]\n\n  if (version !== 'v1') {\n    throw new Error(`expect 'v1' version, got '${version}'`)\n  }\n\n  const name = parts[1]\n\n  if (!parts[2]) {\n    throw new Error('missing param')\n  }\n\n  const param = parseInt(parts[2], 10)\n\n  switch (name) {\n    case 'prefix':\n      return new Prefix(param)\n    case 'suffix':\n      return new Suffix(param)\n    case 'next-to-last':\n      return new NextToLast(param)\n    default:\n      throw new Error(`unkown sharding function: ${name}`)\n  }\n}\n\nexports.readShardFun = (path /* : string */, store /* : Datastore<Buffer> */, callback /* : Callback<ShardV1> */) /* : void */ => {\n  const key = new Key(path).child(new Key(SHARDING_FN))\n  const get = typeof store.getRaw === 'function' ? store.getRaw.bind(store) : store.get.bind(store)\n\n  get(key, (err, res) => {\n    if (err) {\n      return callback(err)\n    }\n\n    let shard\n    try {\n      shard = parseShardFun((res || '').toString().trim())\n    } catch (err) {\n      return callback(err)\n    }\n\n    callback(null, shard)\n  })\n}\n\nexports.readme = readme\nexports.parseShardFun = parseShardFun\nexports.Prefix = Prefix\nexports.Suffix = Suffix\nexports.NextToLast = NextToLast\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/shard.js\n// module id = 375\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/shard.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Buffer = __webpack_require__(1).Buffer\n\nmodule.exports = (_message) => {\n  let message = _message\n  if (!Buffer.isBuffer(message)) {\n    message = Buffer.from(message)\n  }\n  return message\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs-pubsub-room/src/encoding.js\n// module id = 376\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs-pubsub-room/src/encoding.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = 'ipfs-pubsub-room/v2'\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs-pubsub-room/src/protocol.js\n// module id = 377\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs-pubsub-room/src/protocol.js")},function(module,exports){eval('module.exports = {"_from":"github:DaoCasino/js-ipfs","_id":"ipfs@0.28.0","_inBundle":false,"_location":"/dc-messaging/ipfs","_phantomChildren":{},"_requested":{"type":"git","raw":"ipfs@github:DaoCasino/js-ipfs","name":"ipfs","escapedName":"ipfs","rawSpec":"github:DaoCasino/js-ipfs","saveSpec":"github:DaoCasino/js-ipfs","fetchSpec":null,"gitCommittish":null},"_requiredBy":["/dc-messaging","/dc-messaging/ipfs-pubsub-room"],"_resolved":"github:DaoCasino/js-ipfs#4b1d471025f1de12e78fc4166066926ce9d530b2","_spec":"ipfs@github:DaoCasino/js-ipfs","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/dc-messaging","author":{"name":"David Dias","email":"daviddias@ipfs.io"},"bin":{"jsipfs":"src/cli/bin.js"},"browser":{"./src/core/components/init-assets.js":false,"./src/core/runtime/config-nodejs.json":"./src/core/runtime/config-browser.json","./src/core/runtime/libp2p-nodejs.js":"./src/core/runtime/libp2p-browser.js","./src/core/runtime/repo-nodejs.js":"./src/core/runtime/repo-browser.js","./src/core/runtime/dns-nodejs.js":"./src/core/runtime/dns-browser.js","./test/utils/create-repo-nodejs.js":"./test/utils/create-repo-browser.js","stream":"readable-stream"},"bugs":{"url":"https://github.com/ipfs/js-ipfs/issues"},"bundleDependencies":false,"contributors":[{"name":"Andrew de Andrade","email":"andrew@deandrade.com.br"},{"name":"Arpit Agarwal","email":"93arpit@gmail.com"},{"name":"Arpit Agarwal","email":"atvanguard@users.noreply.github.com"},{"name":"Bernard Mordan","email":"bernard@tableflip.io"},{"name":"Bruno Zell","email":"bruno.zzell@gmail.com"},{"name":"CHEVALAY JOSSELIN","email":"josselin54.chevalay@gmail.com"},{"name":"Caio Gondim","email":"me@caiogondim.com"},{"name":"Christian Couder","email":"chriscool@tuxfamily.org"},{"name":"Dafeng","email":"dfguo.joe@gmail.com"},{"name":"Daniel J. O\'Quinn","email":"danieljoquinn@gmail.com"},{"name":"Daniela Borges Matos de Carvalho","email":"alunassertiva@gmail.com"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"David da Silva","email":"dasilvacontin@gmail.com"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"},{"name":"Dzmitry Das","email":"dbachko@gmail.com"},{"name":"Enrico Marino","email":"enrico.marino@email.com"},{"name":"Faheel Ahmad","email":"faheel@live.in"},{"name":"Felix Yan","email":"felixonmars@archlinux.org"},{"name":"Francisco Baio Dias","email":"xicombd@gmail.com"},{"name":"Francisco Baio Dias","email":"francisco@typeform.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Georgios Rassias","email":"georassias@gmail.com"},{"name":"Gorka Ludlow","email":"gorka@aquigorka.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Haad","email":"haadcode@users.noreply.github.com"},{"name":"Haoliang Yu","email":"haoliangyu@users.noreply.github.com"},{"name":"Harsh Vakharia","email":"harshjv@users.noreply.github.com"},{"name":"Henrique Dias","email":"hacdias@gmail.com"},{"name":"Henry Rodrick","email":"moshisushi@gmail.com"},{"name":"Jade Meskill","email":"jade.meskill@gmail.com"},{"name":"Johannes Wikner","email":"johannes.wikner@gmail.com"},{"name":"Jon Schlinkert","email":"dev@sellside.com"},{"name":"Jonathan","email":"jkrone@vt.edu"},{"name":"João Antunes","email":"j.goncalo.antunes@gmail.com"},{"name":"João Santos","email":"joaosantos15@users.noreply.github.com"},{"name":"Kevin Wang","email":"kevin@fossa.io"},{"name":"Lars Gierth","email":"larsg@systemli.org"},{"name":"Lukas Drgon","email":"lukas.drgon@gmail.com"},{"name":"Maciej Krüger","email":"mkg20001@gmail.com"},{"name":"Marius Darila","email":"marius.darila@gmail.com"},{"name":"Michelle Lee","email":"michelle@protocol.ai"},{"name":"Mikeal Rogers","email":"mikeal.rogers@gmail.com"},{"name":"Mithgol","email":"getgit@mithgol.ru"},{"name":"Nuno Nogueira","email":"nunofmn@gmail.com"},{"name":"Oskar Nyberg","email":"oskar@oskarnyberg.com"},{"name":"Pau Ramon Revilla","email":"masylum@gmail.com"},{"name":"Paulo Rodrigues","email":"me@paulogr.com"},{"name":"Pedro Teixeira","email":"i@pgte.me"},{"name":"RasmusErik Voel Jensen","email":"github@solsort.com"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Rod Keys","email":"rod@zokos.com"},{"name":"Sangwon Hong","email":"qpakzk@gmail.com"},{"name":"Sid Harder","email":"sideharder@gmail.com"},{"name":"SidHarder","email":"softwarenavigator@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"Stephen Whitmore","email":"noffle@users.noreply.github.com"},{"name":"Terence Pae","email":"terencepae@gmail.com"},{"name":"Uroš Jurglič","email":"jurglic@gmail.com"},{"name":"Volker Mische","email":"volker.mische@gmail.com"},{"name":"Xiao Liang","email":"yxliang01@users.noreply.github.com"},{"name":"Yahya","email":"ya7yaz@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"bitspill","email":"bitspill+github@bitspill.net"},{"name":"haad","email":"haad@headbanggames.com"},{"name":"jbenet","email":"juan@benet.ai"},{"name":"jonahweissman","email":"19804455+jonahweissman@users.noreply.github.com"},{"name":"kevingzhang","email":"kevin.zhang.canada@gmail.com"},{"name":"kumavis","email":"kumavis@users.noreply.github.com"},{"name":"nginnever","email":"ginneversource@gmail.com"},{"name":"npmcdn-to-unpkg-bot","email":"npmcdn-to-unpkg-bot@users.noreply.github.com"},{"name":"tcme","email":"hi@this-connect.me"},{"name":"Łukasz Magiera","email":"magik6k@users.noreply.github.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"}],"dependencies":{"async":"^2.6.0","big.js":"^5.0.3","binary-querystring":"~0.1.2","bl":"^1.2.1","boom":"^7.1.1","bs58":"^4.0.1","byteman":"^1.3.5","cids":"~0.5.2","debug":"^3.1.0","file-type":"^7.6.0","filesize":"^3.6.0","fsm-event":"^2.1.0","get-folder-size":"^1.0.1","glob":"^7.1.2","hapi":"^16.6.2","hapi-set-header":"^1.0.2","hoek":"^5.0.3","human-to-milliseconds":"^1.0.0","ipfs-api":"^18.1.1","ipfs-bitswap":"~0.19.0","ipfs-block":"~0.6.1","ipfs-block-service":"~0.13.0","ipfs-multipart":"~0.1.0","ipfs-repo":"~0.18.7","ipfs-unixfs":"~0.1.14","ipfs-unixfs-engine":"~0.24.4","ipld":"^0.15.0","is-ipfs":"^0.3.2","is-stream":"^1.1.0","joi":"^13.1.2","libp2p":"~0.18.0","libp2p-circuit":"~0.1.4","libp2p-floodsub":"~0.14.1","libp2p-kad-dht":"~0.8.0","libp2p-keychain":"~0.3.1","libp2p-mdns":"~0.9.2","libp2p-multiplex":"~0.5.1","libp2p-railing":"~0.7.1","libp2p-secio":"~0.9.3","libp2p-tcp":"~0.11.6","libp2p-webrtc-star":"~0.13.4","libp2p-websocket-star":"~0.7.7","libp2p-websockets":"~0.10.5","lodash.flatmap":"^4.5.0","lodash.get":"^4.4.2","lodash.sortby":"^4.7.0","lodash.values":"^4.3.0","mafmt":"^4.0.0","mime-types":"^2.1.18","mkdirp":"~0.5.1","multiaddr":"^3.0.2","multihashes":"~0.4.13","once":"^1.4.0","path-exists":"^3.0.0","peer-book":"~0.5.4","peer-id":"~0.10.6","peer-info":"~0.11.6","progress":"^2.0.0","prom-client":"^10.2.2","prometheus-gc-stats":"^0.5.0","promisify-es6":"^1.0.3","pull-abortable":"^4.1.1","pull-defer":"^0.2.2","pull-file":"^1.1.0","pull-ndjson":"^0.1.1","pull-paramap":"^1.2.2","pull-pushable":"^2.2.0","pull-sort":"^1.0.1","pull-stream":"^3.6.2","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","read-pkg-up":"^3.0.0","readable-stream":"2.3.4","safe-buffer":"^5.1.1","stream-to-pull-stream":"^1.7.2","tar-stream":"^1.5.5","temp":"~0.8.3","through2":"^2.0.3","update-notifier":"^2.3.0","yargs":"^11.0.0","yargs-parser":"^9.0.2"},"deprecated":false,"description":"JavaScript implementation of the IPFS specification","devDependencies":{"aegir":"^13.0.5","buffer-loader":"0.0.1","chai":"^4.1.2","delay":"^2.0.0","detect-node":"^2.0.3","dir-compare":"^1.4.0","dirty-chai":"^2.0.1","eslint-plugin-react":"^7.7.0","execa":"^0.9.0","expose-loader":"^0.7.4","form-data":"^2.3.2","go-ipfs-dep":"^0.4.13","hat":"0.0.3","interface-ipfs-core":"~0.52.0","ipfsd-ctl":"~0.29.1","left-pad":"^1.2.0","lodash":"^4.17.5","mocha":"^5.0.1","ncp":"^2.0.0","nexpect":"^0.5.0","pre-commit":"^1.2.2","pretty-bytes":"^4.0.2","qs":"^6.5.1","random-fs":"^1.0.3","rimraf":"^2.6.2","stream-to-promise":"^2.2.0","transform-loader":"^0.2.4"},"engines":{"node":">=6.0.0","npm":">=3.0.0"},"homepage":"https://github.com/ipfs/js-ipfs#readme","keywords":["IPFS"],"license":"MIT","main":"src/core/index.js","name":"ipfs","optionalDependencies":{"prom-client":"^10.2.2","prometheus-gc-stats":"^0.5.0"},"pre-push":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs.git"},"scripts":{"benchmark":"echo \\"Error: no benchmarks yet\\" && exit 1","benchmark:browser":"echo \\"Error: no benchmarks yet\\" && exit 1","benchmark:node":"echo \\"Error: no benchmarks yet\\" && exit 1","benchmark:node:core":"echo \\"Error: no benchmarks yet\\" && exit 1","benchmark:node:http":"echo \\"Error: no benchmarks yet\\" && exit 1","build":"aegir build","coverage":"aegir coverage","coverage-publish":"aegir-coverage publish","lint":"aegir lint","release":"aegir release -t node -t browser","release-major":"aegir release --type major -t node -t browser","release-minor":"aegir release --type minor -t node -t browser","test":"aegir test -t node -t browser -t webworker --no-cors","test:bootstrapers":"IPFS_TEST=bootstrapers aegir test -t browser -f test/bootstrapers.js","test:browser":"aegir test -t browser --no-cors","test:node":"aegir test -t node","test:node:cli":"aegir test -t node -f test/cli/index.js","test:node:core":"aegir test -t node -f test/core/**.js","test:node:gateway":"aegir test -t node -f test/gateway/index.js","test:node:http":"aegir test -t node -f test/http-api/index.js","test:webworker":"aegir test -t webworker --no-cors"},"version":"0.28.0"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/package.json\n// module id = 378\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/package.json')},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst OFFLINE_ERROR = __webpack_require__(382).OFFLINE_ERROR\nconst promisify = __webpack_require__(22)\nconst setImmediate = __webpack_require__(8)\nconst Big = __webpack_require__(226)\n\nfunction formatWantlist (list) {\n  return Array.from(list).map((e) => e[1])\n}\n\nmodule.exports = function bitswap (self) {\n  return {\n    wantlist: () => {\n      if (!self.isOnline()) {\n        throw new Error(OFFLINE_ERROR)\n      }\n\n      const list = self._bitswap.getWantlist()\n      return formatWantlist(list)\n    },\n\n    stat: promisify((callback) => {\n      if (!self.isOnline()) {\n        return setImmediate(() => callback(new Error(OFFLINE_ERROR)))\n      }\n\n      const snapshot = self._bitswap.stat().snapshot\n\n      callback(null, {\n        provideBufLen: parseInt(snapshot.providesBufferLength.toString()),\n        blocksReceived: new Big(snapshot.blocksReceived),\n        wantlist: formatWantlist(self._bitswap.getWantlist()),\n        peers: self._bitswap.peers().map((id) => id.toB58String()),\n        dupBlksReceived: new Big(snapshot.dupBlksReceived),\n        dupDataReceived: new Big(snapshot.dupDataReceived),\n        dataReceived: new Big(snapshot.dataReceived),\n        blocksSent: new Big(snapshot.blocksSent),\n        dataSent: new Big(snapshot.dataSent)\n      })\n    }),\n\n    unwant: (key) => {\n      if (!self.isOnline()) {\n        throw new Error(OFFLINE_ERROR)\n      }\n\n      // TODO: implement when https://github.com/ipfs/js-ipfs-bitswap/pull/10 is merged\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/bitswap.js\n// module id = 379\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/bitswap.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\nconst repoVersion = __webpack_require__(267).repoVersion\n\nmodule.exports = function repo (self) {\n  return {\n    init: (bits, empty, callback) => {\n      // 1. check if repo already exists\n    },\n\n    /**\n     * If the repo has been initialized, report the current version.\n     * Otherwise report the version that would be initialized.\n     *\n     * @param {function(Error, Number)} [callback]\n     * @returns {undefined}\n     */\n    version: promisify((callback) => {\n      self._repo._isInitialized(err => {\n        if (err) {\n          if (/ENOENT|not yet initialized/.test(err.message)) {\n            // this repo has not been initialized\n            return callback(null, repoVersion)\n          }\n          return callback(err)\n        }\n\n        self._repo.version.get(callback)\n      })\n    }),\n\n    gc: () => {},\n\n    stat: promisify((options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      self._repo.stat(options, (err, stats) => {\n        if (err) return callback(err)\n\n        callback(null, {\n          numObjects: stats.numObjects,\n          repoSize: stats.repoSize,\n          repoPath: stats.repoPath,\n          version: stats.version.toString(),\n          storageMax: stats.storageMax\n        })\n      })\n    }),\n\n    path: () => self._repo.path\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/repo.js\n// module id = 380\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/repo.js")},function(module,exports){eval('module.exports = {"Addresses":{"Swarm":[],"API":"","Gateway":""},"Discovery":{"MDNS":{"Enabled":false,"Interval":10},"webRTCStar":{"Enabled":true}},"Bootstrap":["/dns4/ams-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd","/dns4/lon-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLMeWqB7YGVLJN3pNLQpmmEk35v6wYtsMGLzSr5QBU3","/dns4/sfo-3.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM","/dns4/sgp-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu","/dns4/nyc-1.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm","/dns4/nyc-2.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64","/dns4/wss0.bootstrap.libp2p.io/tcp/443/wss/ipfs/QmZMxNdpMkewiVZLMRxaNxUeZpDUb34pWjZ1kZvsd16Zic","/dns4/wss1.bootstrap.libp2p.io/tcp/443/wss/ipfs/Qmbut9Ywz9YEDrz8ySBSgWyJk41Uvm2QJPhwDJzJyGFsD6"]}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/runtime/config-browser.json\n// module id = 381\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/runtime/config-browser.json')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.OFFLINE_ERROR = 'This command must be run in online mode. Try running \\'ipfs daemon\\' first.'\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/utils.js\n// module id = 382\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2016\n */\n\n\n\nvar EventEmitter = __webpack_require__(183);\nvar Promise = __webpack_require__(321);\n\n/**\n * This function generates a defer promise and adds eventEmitter functionality to it\n *\n * @method eventifiedPromise\n */\nvar PromiEvent = function PromiEvent(justPromise) {\n    var resolve, reject,\n        eventEmitter = new Promise(function() {\n            resolve = arguments[0];\n            reject = arguments[1];\n        });\n\n    if(justPromise) {\n        return {\n            resolve: resolve,\n            reject: reject,\n            eventEmitter: eventEmitter\n        };\n    }\n\n    // get eventEmitter\n    var emitter = new EventEmitter();\n\n    // add eventEmitter to the promise\n    eventEmitter._events = emitter._events;\n    eventEmitter.emit = emitter.emit;\n    eventEmitter.on = emitter.on;\n    eventEmitter.once = emitter.once;\n    eventEmitter.off = emitter.off;\n    eventEmitter.listeners = emitter.listeners;\n    eventEmitter.addListener = emitter.addListener;\n    eventEmitter.removeListener = emitter.removeListener;\n    eventEmitter.removeAllListeners = emitter.removeAllListeners;\n\n    return {\n        resolve: resolve,\n        reject: reject,\n        eventEmitter: eventEmitter\n    };\n};\n\nPromiEvent.resolve = function(value) {\n    var promise = PromiEvent(true);\n    promise.resolve(value);\n    return promise.eventEmitter;\n};\n\nmodule.exports = PromiEvent;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-promievent/src/index.js\n// module id = 383\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-promievent/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file jsonrpc.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n *   Marek Kotewicz <marek@ethdev.com>\n *   Aaron Kumavis <aaron@kumavis.me>\n * @date 2015\n */\n\n\n\n// Initialize Jsonrpc as a simple object with utility functions.\nvar Jsonrpc = {\n    messageId: 0\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.toPayload = function (method, params) {\n    if (!method) {\n        throw new Error('JSONRPC method should be specified for params: \"'+ JSON.stringify(params) +'\"!');\n    }\n\n    // advance message ID\n    Jsonrpc.messageId++;\n\n    return {\n        jsonrpc: '2.0',\n        id: Jsonrpc.messageId,\n        method: method,\n        params: params || []\n    };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.isValidResponse = function (response) {\n    return Array.isArray(response) ? response.every(validateSingleMessage) : validateSingleMessage(response);\n\n    function validateSingleMessage(message){\n      return !!message &&\n        !message.error &&\n        message.jsonrpc === '2.0' &&\n        (typeof message.id === 'number' || typeof message.id === 'string') &&\n        message.result !== undefined; // only undefined is not valid json object\n    }\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.toBatchPayload = function (messages) {\n    return messages.map(function (message) {\n        return Jsonrpc.toPayload(message.method, message.params);\n    });\n};\n\nmodule.exports = Jsonrpc;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-requestmanager/src/jsonrpc.js\n// module id = 384\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-requestmanager/src/jsonrpc.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@frozeman.de>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(48);\n\nvar f = __webpack_require__(61);\n\nvar SolidityTypeAddress = __webpack_require__(777);\nvar SolidityTypeBool = __webpack_require__(778);\nvar SolidityTypeInt = __webpack_require__(781);\nvar SolidityTypeUInt = __webpack_require__(783);\nvar SolidityTypeDynamicBytes = __webpack_require__(780);\nvar SolidityTypeString = __webpack_require__(782);\nvar SolidityTypeBytes = __webpack_require__(779);\n\nvar isDynamic = function (solidityType, type) {\n    return solidityType.isDynamicType(type) ||\n        solidityType.isDynamicArray(type);\n};\n\n\n// result method\nfunction Result() {}\n\n\n/**\n * ABICoder prototype should be used to encode/decode solidity params of any type\n */\nvar ABICoder = function (types) {\n    this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType}\n * @throws {Error} throws if no matching type is found\n */\nABICoder.prototype._requireType = function (type) {\n    var solidityType = this._types.filter(function (t) {\n        return t.isType(type);\n    })[0];\n\n    if (!solidityType) {\n        throw Error('Invalid solidity type: ' + type);\n    }\n\n    return solidityType;\n};\n\n\n\nABICoder.prototype._getOffsets = function (types, solidityTypes) {\n    var lengths =  solidityTypes.map(function (solidityType, index) {\n        return solidityType.staticPartLength(types[index]);\n    });\n\n    for (var i = 1; i < lengths.length; i++) {\n        // sum with length of previous element\n        lengths[i] += lengths[i - 1];\n    }\n\n    return lengths.map(function (length, index) {\n        // remove the current length, so the length is sum of previous elements\n        var staticPartLength = solidityTypes[index].staticPartLength(types[index]);\n        return length - staticPartLength;\n    });\n};\n\nABICoder.prototype._getSolidityTypes = function (types) {\n    var self = this;\n    return types.map(function (type) {\n        return self._requireType(type);\n    });\n};\n\n\nABICoder.prototype._encodeMultiWithOffset = function (types, solidityTypes, encodeds, dynamicOffset) {\n    var result = \"\";\n    var self = this;\n\n    types.forEach(function (type, i) {\n        if (isDynamic(solidityTypes[i], types[i])) {\n            result += f.formatInputInt(dynamicOffset).encode();\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n            dynamicOffset += e.length / 2;\n        } else {\n            // don't add length to dynamicOffset. it's already counted\n            result += self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n        }\n\n        // TODO: figure out nested arrays\n    });\n\n    types.forEach(function (type, i) {\n        if (isDynamic(solidityTypes[i], types[i])) {\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n            dynamicOffset += e.length / 2;\n            result += e;\n        }\n    });\n    return result;\n};\n\n// TODO: refactor whole encoding!\nABICoder.prototype._encodeWithOffset = function (type, solidityType, encoded, offset) {\n    var self = this;\n    if (solidityType.isDynamicArray(type)) {\n        return (function () {\n            // offset was already set\n            var nestedName = solidityType.nestedName(type);\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\n            var result = encoded[0];\n\n            (function () {\n                var previousLength = 2; // in int\n                if (solidityType.isDynamicArray(nestedName)) {\n                    for (var i = 1; i < encoded.length; i++) {\n                        previousLength += +(encoded[i - 1])[0] || 0;\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\n                    }\n                }\n            })();\n\n            // first element is length, skip it\n            (function () {\n                for (var i = 0; i < encoded.length - 1; i++) {\n                    var additionalOffset = result / 2;\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i + 1], offset +  additionalOffset);\n                }\n            })();\n\n            return result;\n        })();\n\n    } else if (solidityType.isStaticArray(type)) {\n        return (function () {\n            var nestedName = solidityType.nestedName(type);\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\n            var result = \"\";\n\n\n            if (solidityType.isDynamicArray(nestedName)) {\n                (function () {\n                    var previousLength = 0; // in int\n                    for (var i = 0; i < encoded.length; i++) {\n                        // calculate length of previous item\n                        previousLength += +(encoded[i - 1] || [])[0] || 0;\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\n                    }\n                })();\n            }\n\n            (function () {\n                for (var i = 0; i < encoded.length; i++) {\n                    var additionalOffset = result / 2;\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i], offset + additionalOffset);\n                }\n            })();\n\n            return result;\n        })();\n    }\n\n    return encoded;\n};\n\n\n/**\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\n *\n * @method encodeFunctionSignature\n * @param {String|Object} functionName\n * @return {String} encoded function name\n */\nABICoder.prototype.encodeFunctionSignature = function (functionName) {\n    if(_.isObject(functionName)) {\n        functionName = utils._jsonInterfaceMethodToString(functionName);\n    }\n\n    return utils.sha3(functionName).slice(0, 10);\n};\n\n\n/**\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\n *\n * @method encodeEventSignature\n * @param {String|Object} functionName\n * @return {String} encoded function name\n */\nABICoder.prototype.encodeEventSignature = function (functionName) {\n    if(_.isObject(functionName)) {\n        functionName = utils._jsonInterfaceMethodToString(functionName);\n    }\n\n    return utils.sha3(functionName);\n};\n\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParameter\n * @param {String} type\n * @param {Object} param\n * @return {String} encoded plain param\n */\nABICoder.prototype.encodeParameter = function (type, param) {\n    return this.encodeParameters([type], [param]);\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParameters\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nABICoder.prototype.encodeParameters = function (types, params) {\n    // given a json interface\n    if(_.isObject(types) && types.inputs) {\n        types = _.map(types.inputs, function (input) {\n            return input.type;\n        });\n    }\n\n    var solidityTypes = this._getSolidityTypes(types);\n\n    var encodeds = solidityTypes.map(function (solidityType, index) {\n        return solidityType.encode(params[index], types[index]);\n    });\n\n    var dynamicOffset = solidityTypes.reduce(function (acc, solidityType, index) {\n        var staticPartLength = solidityType.staticPartLength(types[index]);\n        var roundedStaticPartLength = Math.floor((staticPartLength + 31) / 32) * 32;\n\n        return acc + (isDynamic(solidityTypes[index], types[index]) ?\n                32 :\n                roundedStaticPartLength);\n    }, 0);\n\n    return '0x'+ this._encodeMultiWithOffset(types, solidityTypes, encodeds, dynamicOffset);\n};\n\n\n/**\n * Encodes a function call from its json interface and parameters.\n *\n * @method encodeFunctionCall\n * @param {Array} jsonInterface\n * @param {Array} params\n * @return {String} The encoded ABI for this function call\n */\nABICoder.prototype.encodeFunctionCall = function (jsonInterface, params) {\n    return this.encodeFunctionSignature(jsonInterface) + this.encodeParameters(jsonInterface, params).replace('0x','');\n};\n\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParameter\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nABICoder.prototype.decodeParameter = function (type, bytes) {\n\n    if (!_.isString(type)) {\n        throw new Error('Given parameter type is not a string: '+ type);\n    }\n\n    return this.decodeParameters([{type: type}], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParameter\n * @param {Array} outputs\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nABICoder.prototype.decodeParameters = function (outputs, bytes) {\n    var isTypeArray = _.isArray(outputs) && _.isString(outputs[0]);\n    var types = (isTypeArray) ? outputs : [];\n\n    if(!isTypeArray) {\n        outputs.forEach(function (output) {\n            types.push(output.type);\n        });\n    }\n\n    var solidityTypes = this._getSolidityTypes(types);\n    var offsets = this._getOffsets(types, solidityTypes);\n\n    var returnValue = new Result();\n    returnValue.__length__ = 0;\n    var count = 0;\n\n    outputs.forEach(function (output, i) {\n        var decodedValue = solidityTypes[count].decode(bytes.replace(/^0x/i,''), offsets[count],  types[count], count);\n        decodedValue = (decodedValue === '0x') ? null : decodedValue;\n\n        returnValue[i] = decodedValue;\n\n        if (_.isObject(output) && output.name) {\n            returnValue[output.name] = decodedValue;\n        }\n\n        returnValue.__length__++;\n        count++;\n    });\n\n    return returnValue;\n};\n\n/**\n * Decodes events non- and indexed parameters.\n *\n * @method decodeLog\n * @param {Object} inputs\n * @param {String} data\n * * @param {Array} topics\n * @return {Array} array of plain params\n */\nABICoder.prototype.decodeLog = function (inputs, data, topics) {\n\n    data = data || '';\n\n    var notIndexedInputs = [];\n    var indexedInputs = [];\n\n    inputs.forEach(function (input, i) {\n        if (input.indexed) {\n            indexedInputs[i] = input;\n        } else {\n            notIndexedInputs[i] = input;\n        }\n    });\n\n    var nonIndexedData = data.slice(2);\n    var indexedData = _.isArray(topics) ? topics.map(function (topic) { return topic.slice(2); }).join('') : topics;\n\n    var notIndexedParams = this.decodeParameters(notIndexedInputs, nonIndexedData);\n    var indexedParams = this.decodeParameters(indexedInputs, indexedData);\n\n\n    var returnValue = new Result();\n    returnValue.__length__ = 0;\n\n    inputs.forEach(function (res, i) {\n        returnValue[i] = (res.type === 'string') ? '' : null;\n\n        if (notIndexedParams[i]) {\n            returnValue[i] = notIndexedParams[i];\n        }\n        if (indexedParams[i]) {\n            returnValue[i] = indexedParams[i];\n        }\n\n        if(res.name) {\n            returnValue[res.name] = returnValue[i];\n        }\n\n        returnValue.__length__++;\n    });\n\n    return returnValue;\n};\n\n\nvar coder = new ABICoder([\n    new SolidityTypeAddress(),\n    new SolidityTypeBool(),\n    new SolidityTypeInt(),\n    new SolidityTypeUInt(),\n    new SolidityTypeDynamicBytes(),\n    new SolidityTypeBytes(),\n    new SolidityTypeString()\n]);\n\nmodule.exports = coder;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/index.js\n// module id = 385\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file param.js\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2015\n */\n\nvar formatters = __webpack_require__(61);\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset, rawValue) {\n    this.value = value || '';\n    this.offset = offset; // offset in bytes\n    this.rawValue = rawValue; // used for debugging\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n *\n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n    return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n    return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n    return new SolidityParam(this.value + param.value);\n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n    return this.offset !== undefined;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n    return !this.isDynamic() ? '' : formatters.toTwosComplement(this.offset).replace('0x','');\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n    if (!this.isDynamic()) {\n        return this.value;\n    }\n    return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n    return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n    return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n\n    // updating offsets\n    var totalOffset = params.length * 32;\n    var offsetParams = params.map(function (param) {\n        if (!param.isDynamic()) {\n            return param;\n        }\n        var offset = totalOffset;\n        totalOffset += param.dynamicPartLength();\n        return param.withOffset(offset);\n    });\n\n    // encode everything!\n    return offsetParams.reduce(function (result, param) {\n        return result + param.dynamicPart();\n    }, offsetParams.reduce(function (result, param) {\n        return result + param.staticPart();\n    }, ''));\n};\n\n\n\nmodule.exports = SolidityParam;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/param.js\n// module id = 386\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/param.js")},function(module,exports){eval('// This was ported from https://github.com/emn178/js-sha3, with some minor\n// modifications and pruning. It is licensed under MIT:\n//\n// Copyright 2015-2016 Chen, Yi-Cyuan\n//  \n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar HEX_CHARS = \'0123456789abcdef\'.split(\'\');\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\nvar SHIFT = [0, 8, 16, 24];\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n\nvar Keccak = function Keccak(bits) {\n  return {\n    blocks: [],\n    reset: true,\n    block: 0,\n    start: 0,\n    blockCount: 1600 - (bits << 1) >> 5,\n    outputBlocks: bits >> 5,\n    s: function (s) {\n      return [].concat(s, s, s, s, s);\n    }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n  };\n};\n\nvar update = function update(state, message) {\n  var length = message.length,\n      blocks = state.blocks,\n      byteCount = state.blockCount << 2,\n      blockCount = state.blockCount,\n      outputBlocks = state.outputBlocks,\n      s = state.s,\n      index = 0,\n      i,\n      code;\n\n  // update\n  while (index < length) {\n    if (state.reset) {\n      state.reset = false;\n      blocks[0] = state.block;\n      for (i = 1; i < blockCount + 1; ++i) {\n        blocks[i] = 0;\n      }\n    }\n    if (typeof message !== "string") {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n      }\n    } else {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        code = message.charCodeAt(index);\n        if (code < 0x80) {\n          blocks[i >> 2] |= code << SHIFT[i++ & 3];\n        } else if (code < 0x800) {\n          blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else if (code < 0xd800 || code >= 0xe000) {\n          blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else {\n          code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\n          blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        }\n      }\n    }\n    state.lastByteIndex = i;\n    if (i >= byteCount) {\n      state.start = i - byteCount;\n      state.block = blocks[blockCount];\n      for (i = 0; i < blockCount; ++i) {\n        s[i] ^= blocks[i];\n      }\n      f(s);\n      state.reset = true;\n    } else {\n      state.start = i;\n    }\n  }\n\n  // finalize\n  i = state.lastByteIndex;\n  blocks[i >> 2] |= KECCAK_PADDING[i & 3];\n  if (state.lastByteIndex === byteCount) {\n    blocks[0] = blocks[blockCount];\n    for (i = 1; i < blockCount + 1; ++i) {\n      blocks[i] = 0;\n    }\n  }\n  blocks[blockCount - 1] |= 0x80000000;\n  for (i = 0; i < blockCount; ++i) {\n    s[i] ^= blocks[i];\n  }\n  f(s);\n\n  // toString\n  var hex = \'\',\n      i = 0,\n      j = 0,\n      block;\n  while (j < outputBlocks) {\n    for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n      block = s[i];\n      hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\n    }\n    if (j % blockCount === 0) {\n      f(s);\n      i = 0;\n    }\n  }\n  return "0x" + hex;\n};\n\nvar f = function f(s) {\n  var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n\n  for (n = 0; n < 48; n += 2) {\n    c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n    c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n    c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n    c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n    c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n    c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n    c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n    c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n    c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n    c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n    h = c8 ^ (c2 << 1 | c3 >>> 31);\n    l = c9 ^ (c3 << 1 | c2 >>> 31);\n    s[0] ^= h;\n    s[1] ^= l;\n    s[10] ^= h;\n    s[11] ^= l;\n    s[20] ^= h;\n    s[21] ^= l;\n    s[30] ^= h;\n    s[31] ^= l;\n    s[40] ^= h;\n    s[41] ^= l;\n    h = c0 ^ (c4 << 1 | c5 >>> 31);\n    l = c1 ^ (c5 << 1 | c4 >>> 31);\n    s[2] ^= h;\n    s[3] ^= l;\n    s[12] ^= h;\n    s[13] ^= l;\n    s[22] ^= h;\n    s[23] ^= l;\n    s[32] ^= h;\n    s[33] ^= l;\n    s[42] ^= h;\n    s[43] ^= l;\n    h = c2 ^ (c6 << 1 | c7 >>> 31);\n    l = c3 ^ (c7 << 1 | c6 >>> 31);\n    s[4] ^= h;\n    s[5] ^= l;\n    s[14] ^= h;\n    s[15] ^= l;\n    s[24] ^= h;\n    s[25] ^= l;\n    s[34] ^= h;\n    s[35] ^= l;\n    s[44] ^= h;\n    s[45] ^= l;\n    h = c4 ^ (c8 << 1 | c9 >>> 31);\n    l = c5 ^ (c9 << 1 | c8 >>> 31);\n    s[6] ^= h;\n    s[7] ^= l;\n    s[16] ^= h;\n    s[17] ^= l;\n    s[26] ^= h;\n    s[27] ^= l;\n    s[36] ^= h;\n    s[37] ^= l;\n    s[46] ^= h;\n    s[47] ^= l;\n    h = c6 ^ (c0 << 1 | c1 >>> 31);\n    l = c7 ^ (c1 << 1 | c0 >>> 31);\n    s[8] ^= h;\n    s[9] ^= l;\n    s[18] ^= h;\n    s[19] ^= l;\n    s[28] ^= h;\n    s[29] ^= l;\n    s[38] ^= h;\n    s[39] ^= l;\n    s[48] ^= h;\n    s[49] ^= l;\n\n    b0 = s[0];\n    b1 = s[1];\n    b32 = s[11] << 4 | s[10] >>> 28;\n    b33 = s[10] << 4 | s[11] >>> 28;\n    b14 = s[20] << 3 | s[21] >>> 29;\n    b15 = s[21] << 3 | s[20] >>> 29;\n    b46 = s[31] << 9 | s[30] >>> 23;\n    b47 = s[30] << 9 | s[31] >>> 23;\n    b28 = s[40] << 18 | s[41] >>> 14;\n    b29 = s[41] << 18 | s[40] >>> 14;\n    b20 = s[2] << 1 | s[3] >>> 31;\n    b21 = s[3] << 1 | s[2] >>> 31;\n    b2 = s[13] << 12 | s[12] >>> 20;\n    b3 = s[12] << 12 | s[13] >>> 20;\n    b34 = s[22] << 10 | s[23] >>> 22;\n    b35 = s[23] << 10 | s[22] >>> 22;\n    b16 = s[33] << 13 | s[32] >>> 19;\n    b17 = s[32] << 13 | s[33] >>> 19;\n    b48 = s[42] << 2 | s[43] >>> 30;\n    b49 = s[43] << 2 | s[42] >>> 30;\n    b40 = s[5] << 30 | s[4] >>> 2;\n    b41 = s[4] << 30 | s[5] >>> 2;\n    b22 = s[14] << 6 | s[15] >>> 26;\n    b23 = s[15] << 6 | s[14] >>> 26;\n    b4 = s[25] << 11 | s[24] >>> 21;\n    b5 = s[24] << 11 | s[25] >>> 21;\n    b36 = s[34] << 15 | s[35] >>> 17;\n    b37 = s[35] << 15 | s[34] >>> 17;\n    b18 = s[45] << 29 | s[44] >>> 3;\n    b19 = s[44] << 29 | s[45] >>> 3;\n    b10 = s[6] << 28 | s[7] >>> 4;\n    b11 = s[7] << 28 | s[6] >>> 4;\n    b42 = s[17] << 23 | s[16] >>> 9;\n    b43 = s[16] << 23 | s[17] >>> 9;\n    b24 = s[26] << 25 | s[27] >>> 7;\n    b25 = s[27] << 25 | s[26] >>> 7;\n    b6 = s[36] << 21 | s[37] >>> 11;\n    b7 = s[37] << 21 | s[36] >>> 11;\n    b38 = s[47] << 24 | s[46] >>> 8;\n    b39 = s[46] << 24 | s[47] >>> 8;\n    b30 = s[8] << 27 | s[9] >>> 5;\n    b31 = s[9] << 27 | s[8] >>> 5;\n    b12 = s[18] << 20 | s[19] >>> 12;\n    b13 = s[19] << 20 | s[18] >>> 12;\n    b44 = s[29] << 7 | s[28] >>> 25;\n    b45 = s[28] << 7 | s[29] >>> 25;\n    b26 = s[38] << 8 | s[39] >>> 24;\n    b27 = s[39] << 8 | s[38] >>> 24;\n    b8 = s[48] << 14 | s[49] >>> 18;\n    b9 = s[49] << 14 | s[48] >>> 18;\n\n    s[0] = b0 ^ ~b2 & b4;\n    s[1] = b1 ^ ~b3 & b5;\n    s[10] = b10 ^ ~b12 & b14;\n    s[11] = b11 ^ ~b13 & b15;\n    s[20] = b20 ^ ~b22 & b24;\n    s[21] = b21 ^ ~b23 & b25;\n    s[30] = b30 ^ ~b32 & b34;\n    s[31] = b31 ^ ~b33 & b35;\n    s[40] = b40 ^ ~b42 & b44;\n    s[41] = b41 ^ ~b43 & b45;\n    s[2] = b2 ^ ~b4 & b6;\n    s[3] = b3 ^ ~b5 & b7;\n    s[12] = b12 ^ ~b14 & b16;\n    s[13] = b13 ^ ~b15 & b17;\n    s[22] = b22 ^ ~b24 & b26;\n    s[23] = b23 ^ ~b25 & b27;\n    s[32] = b32 ^ ~b34 & b36;\n    s[33] = b33 ^ ~b35 & b37;\n    s[42] = b42 ^ ~b44 & b46;\n    s[43] = b43 ^ ~b45 & b47;\n    s[4] = b4 ^ ~b6 & b8;\n    s[5] = b5 ^ ~b7 & b9;\n    s[14] = b14 ^ ~b16 & b18;\n    s[15] = b15 ^ ~b17 & b19;\n    s[24] = b24 ^ ~b26 & b28;\n    s[25] = b25 ^ ~b27 & b29;\n    s[34] = b34 ^ ~b36 & b38;\n    s[35] = b35 ^ ~b37 & b39;\n    s[44] = b44 ^ ~b46 & b48;\n    s[45] = b45 ^ ~b47 & b49;\n    s[6] = b6 ^ ~b8 & b0;\n    s[7] = b7 ^ ~b9 & b1;\n    s[16] = b16 ^ ~b18 & b10;\n    s[17] = b17 ^ ~b19 & b11;\n    s[26] = b26 ^ ~b28 & b20;\n    s[27] = b27 ^ ~b29 & b21;\n    s[36] = b36 ^ ~b38 & b30;\n    s[37] = b37 ^ ~b39 & b31;\n    s[46] = b46 ^ ~b48 & b40;\n    s[47] = b47 ^ ~b49 & b41;\n    s[8] = b8 ^ ~b0 & b2;\n    s[9] = b9 ^ ~b1 & b3;\n    s[18] = b18 ^ ~b10 & b12;\n    s[19] = b19 ^ ~b11 & b13;\n    s[28] = b28 ^ ~b20 & b22;\n    s[29] = b29 ^ ~b21 & b23;\n    s[38] = b38 ^ ~b30 & b32;\n    s[39] = b39 ^ ~b31 & b33;\n    s[48] = b48 ^ ~b40 & b42;\n    s[49] = b49 ^ ~b41 & b43;\n\n    s[0] ^= RC[n];\n    s[1] ^= RC[n + 1];\n  }\n};\n\nvar keccak = function keccak(bits) {\n  return function (str) {\n    var msg;\n    if (str.slice(0, 2) === "0x") {\n      msg = [];\n      for (var i = 2, l = str.length; i < l; i += 2) {\n        msg.push(parseInt(str.slice(i, i + 2), 16));\n      }\n    } else {\n      msg = str;\n    }\n    return update(Keccak(bits, bits), msg);\n  };\n};\n\nmodule.exports = {\n  keccak256: keccak(256),\n  keccak512: keccak(512),\n  keccak256s: keccak(256),\n  keccak512s: keccak(512)\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/hash.js\n// module id = 387\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/hash.js')},function(module,exports,__webpack_require__){eval('var BN = __webpack_require__(141);\nvar Bytes = __webpack_require__(255);\n\nvar fromBN = function fromBN(bn) {\n  return "0x" + bn.toString("hex");\n};\n\nvar toBN = function toBN(str) {\n  return new BN(str.slice(2), 16);\n};\n\nvar fromString = function fromString(str) {\n  var bn = "0x" + (str.slice(0, 2) === "0x" ? new BN(str.slice(2), 16) : new BN(str, 10)).toString("hex");\n  return bn === "0x0" ? "0x" : bn;\n};\n\nvar toEther = function toEther(wei) {\n  return toNumber(div(wei, fromString("10000000000"))) / 100000000;\n};\n\nvar fromEther = function fromEther(eth) {\n  return mul(fromNumber(Math.floor(eth * 100000000)), fromString("10000000000"));\n};\n\nvar toString = function toString(a) {\n  return toBN(a).toString(10);\n};\n\nvar fromNumber = function fromNumber(a) {\n  return typeof a === "string" ? /^0x/.test(a) ? a : "0x" + a : "0x" + new BN(a).toString("hex");\n};\n\nvar toNumber = function toNumber(a) {\n  return toBN(a).toNumber();\n};\n\nvar toUint256 = function toUint256(a) {\n  return Bytes.pad(32, a);\n};\n\nvar bin = function bin(method) {\n  return function (a, b) {\n    return fromBN(toBN(a)[method](toBN(b)));\n  };\n};\n\nvar add = bin("add");\nvar mul = bin("mul");\nvar div = bin("div");\nvar sub = bin("sub");\n\nmodule.exports = {\n  toString: toString,\n  fromString: fromString,\n  toNumber: toNumber,\n  fromNumber: fromNumber,\n  toEther: toEther,\n  fromEther: fromEther,\n  toUint256: toUint256,\n  add: add,\n  mul: mul,\n  div: div,\n  sub: sub\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/nat.js\n// module id = 388\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/nat.js')},function(module,exports){eval('// The RLP format\n// Serialization and deserialization for the BytesTree type, under the following grammar:\n// | First byte | Meaning                                                                    |\n// | ---------- | -------------------------------------------------------------------------- |\n// | 0   to 127 | HEX(leaf)                                                                  |\n// | 128 to 183 | HEX(length_of_leaf + 128) + HEX(leaf)                                      |\n// | 184 to 191 | HEX(length_of_length_of_leaf + 128 + 55) + HEX(length_of_leaf) + HEX(leaf) |\n// | 192 to 247 | HEX(length_of_node + 192) + HEX(node)                                      |\n// | 248 to 255 | HEX(length_of_length_of_node + 128 + 55) + HEX(length_of_node) + HEX(node) |\n\nvar encode = function encode(tree) {\n  var padEven = function padEven(str) {\n    return str.length % 2 === 0 ? str : "0" + str;\n  };\n\n  var uint = function uint(num) {\n    return padEven(num.toString(16));\n  };\n\n  var length = function length(len, add) {\n    return len < 56 ? uint(add + len) : uint(add + uint(len).length / 2 + 55) + uint(len);\n  };\n\n  var dataTree = function dataTree(tree) {\n    if (typeof tree === "string") {\n      var hex = tree.slice(2);\n      var pre = hex.length != 2 || hex >= "80" ? length(hex.length / 2, 128) : "";\n      return pre + hex;\n    } else {\n      var _hex = tree.map(dataTree).join("");\n      var _pre = length(_hex.length / 2, 192);\n      return _pre + _hex;\n    }\n  };\n\n  return "0x" + dataTree(tree);\n};\n\nvar decode = function decode(hex) {\n  var i = 2;\n\n  var parseTree = function parseTree() {\n    if (i >= hex.length) throw "";\n    var head = hex.slice(i, i + 2);\n    return head < "80" ? (i += 2, "0x" + head) : head < "c0" ? parseHex() : parseList();\n  };\n\n  var parseLength = function parseLength() {\n    var len = parseInt(hex.slice(i, i += 2), 16) % 64;\n    return len < 56 ? len : parseInt(hex.slice(i, i += (len - 55) * 2), 16);\n  };\n\n  var parseHex = function parseHex() {\n    var len = parseLength();\n    return "0x" + hex.slice(i, i += len * 2);\n  };\n\n  var parseList = function parseList() {\n    var lim = parseLength() * 2 + i;\n    var list = [];\n    while (i < lim) {\n      list.push(parseTree());\n    }return list;\n  };\n\n  try {\n    return parseTree();\n  } catch (e) {\n    return [];\n  }\n};\n\nmodule.exports = { encode: encode, decode: decode };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/rlp.js\n// module id = 389\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/rlp.js')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file iban.js\n *\n * Details: https://github.com/ethereum/wiki/wiki/ICAP:-Inter-exchange-Client-Address-Protocol\n *\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2015\n */\n\n\n\nvar utils = __webpack_require__(48);\nvar BigNumber = __webpack_require__(141);\n\n\nvar leftPad = function (string, bytes) {\n    var result = string;\n    while (result.length < bytes * 2) {\n        result = '0' + result;\n    }\n    return result;\n};\n\n/**\n * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to\n * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616.\n *\n * @method iso13616Prepare\n * @param {String} iban the IBAN\n * @returns {String} the prepared IBAN\n */\nvar iso13616Prepare = function (iban) {\n    var A = 'A'.charCodeAt(0);\n    var Z = 'Z'.charCodeAt(0);\n\n    iban = iban.toUpperCase();\n    iban = iban.substr(4) + iban.substr(0,4);\n\n    return iban.split('').map(function(n){\n        var code = n.charCodeAt(0);\n        if (code >= A && code <= Z){\n            // A = 10, B = 11, ... Z = 35\n            return code - A + 10;\n        } else {\n            return n;\n        }\n    }).join('');\n};\n\n/**\n * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064.\n *\n * @method mod9710\n * @param {String} iban\n * @returns {Number}\n */\nvar mod9710 = function (iban) {\n    var remainder = iban,\n        block;\n\n    while (remainder.length > 2){\n        block = remainder.slice(0, 9);\n        remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);\n    }\n\n    return parseInt(remainder, 10) % 97;\n};\n\n/**\n * This prototype should be used to create iban object from iban correct string\n *\n * @param {String} iban\n */\nvar Iban = function Iban(iban) {\n    this._iban = iban;\n};\n\n/**\n * This method should be used to create an ethereum address from a direct iban address\n *\n * @method toAddress\n * @param {String} iban address\n * @return {String} the ethereum address\n */\nIban.toAddress = function (ib) {\n    ib = new Iban(ib);\n\n    if(!ib.isDirect()) {\n        throw new Error('IBAN is indirect and can\\'t be converted');\n    }\n\n    return ib.toAddress();\n};\n\n/**\n * This method should be used to create iban address from an ethereum address\n *\n * @method toIban\n * @param {String} address\n * @return {String} the IBAN address\n */\nIban.toIban = function (address) {\n    return Iban.fromAddress(address).toString();\n};\n\n/**\n * This method should be used to create iban object from an ethereum address\n *\n * @method fromAddress\n * @param {String} address\n * @return {Iban} the IBAN object\n */\nIban.fromAddress = function (address) {\n    if(!utils.isAddress(address)){\n        throw new Error('Provided address is not a valid address: '+ address);\n    }\n\n    address = address.replace('0x','').replace('0X','');\n\n    var asBn = new BigNumber(address, 16);\n    var base36 = asBn.toString(36);\n    var padded = leftPad(base36, 15);\n    return Iban.fromBban(padded.toUpperCase());\n};\n\n/**\n * Convert the passed BBAN to an IBAN for this country specification.\n * Please note that <i>\"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account\"</i>.\n * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits\n *\n * @method fromBban\n * @param {String} bban the BBAN to convert to IBAN\n * @returns {Iban} the IBAN object\n */\nIban.fromBban = function (bban) {\n    var countryCode = 'XE';\n\n    var remainder = mod9710(iso13616Prepare(countryCode + '00' + bban));\n    var checkDigit = ('0' + (98 - remainder)).slice(-2);\n\n    return new Iban(countryCode + checkDigit + bban);\n};\n\n/**\n * Should be used to create IBAN object for given institution and identifier\n *\n * @method createIndirect\n * @param {Object} options, required options are \"institution\" and \"identifier\"\n * @return {Iban} the IBAN object\n */\nIban.createIndirect = function (options) {\n    return Iban.fromBban('ETH' + options.institution + options.identifier);\n};\n\n/**\n * This method should be used to check if given string is valid iban object\n *\n * @method isValid\n * @param {String} iban string\n * @return {Boolean} true if it is valid IBAN\n */\nIban.isValid = function (iban) {\n    var i = new Iban(iban);\n    return i.isValid();\n};\n\n/**\n * Should be called to check if iban is correct\n *\n * @method isValid\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isValid = function () {\n    return /^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban) &&\n        mod9710(iso13616Prepare(this._iban)) === 1;\n};\n\n/**\n * Should be called to check if iban number is direct\n *\n * @method isDirect\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isDirect = function () {\n    return this._iban.length === 34 || this._iban.length === 35;\n};\n\n/**\n * Should be called to check if iban number if indirect\n *\n * @method isIndirect\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isIndirect = function () {\n    return this._iban.length === 20;\n};\n\n/**\n * Should be called to get iban checksum\n * Uses the mod-97-10 checksumming protocol (ISO/IEC 7064:2003)\n *\n * @method checksum\n * @returns {String} checksum\n */\nIban.prototype.checksum = function () {\n    return this._iban.substr(2, 2);\n};\n\n/**\n * Should be called to get institution identifier\n * eg. XREG\n *\n * @method institution\n * @returns {String} institution identifier\n */\nIban.prototype.institution = function () {\n    return this.isIndirect() ? this._iban.substr(7, 4) : '';\n};\n\n/**\n * Should be called to get client identifier within institution\n * eg. GAVOFYORK\n *\n * @method client\n * @returns {String} client identifier\n */\nIban.prototype.client = function () {\n    return this.isIndirect() ? this._iban.substr(11) : '';\n};\n\n/**\n * Should be called to get client direct address\n *\n * @method toAddress\n * @returns {String} ethereum address\n */\nIban.prototype.toAddress = function () {\n    if (this.isDirect()) {\n        var base36 = this._iban.substr(4);\n        var asBn = new BigNumber(base36, 36);\n        return utils.toChecksumAddress(asBn.toString(16, 20));\n    }\n\n    return '';\n};\n\nIban.prototype.toString = function () {\n    return this._iban;\n};\n\nmodule.exports = Iban;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-iban/src/index.js\n// module id = 390\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-iban/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(93);\nvar Method = __webpack_require__(92);\nvar utils = __webpack_require__(48);\nvar Net = __webpack_require__(180);\n\nvar formatters = __webpack_require__(34).formatters;\n\n\nvar Personal = function Personal() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    this.net = new Net(this.currentProvider);\n\n    var defaultAccount = null;\n    var defaultBlock = 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\n            }\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultAccount = defaultAccount;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultBlock = defaultBlock;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n\n\n    var methods = [\n        new Method({\n            name: 'getAccounts',\n            call: 'personal_listAccounts',\n            params: 0,\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'newAccount',\n            call: 'personal_newAccount',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'unlockAccount',\n            call: 'personal_unlockAccount',\n            params: 3,\n            inputFormatter: [formatters.inputAddressFormatter, null, null]\n        }),\n        new Method({\n            name: 'lockAccount',\n            call: 'personal_lockAccount',\n            params: 1,\n            inputFormatter: [formatters.inputAddressFormatter]\n        }),\n        new Method({\n            name: 'importRawKey',\n            call: 'personal_importRawKey',\n            params: 2\n        }),\n        new Method({\n            name: 'sendTransaction',\n            call: 'personal_sendTransaction',\n            params: 2,\n            inputFormatter: [formatters.inputTransactionFormatter, null]\n        }),\n        new Method({\n            name: 'signTransaction',\n            call: 'personal_signTransaction',\n            params: 2,\n            inputFormatter: [formatters.inputTransactionFormatter, null]\n        }),\n        new Method({\n            name: 'sign',\n            call: 'personal_sign',\n            params: 3,\n            inputFormatter: [formatters.inputSignFormatter, formatters.inputAddressFormatter, null]\n        }),\n        new Method({\n            name: 'ecRecover',\n            call: 'personal_ecRecover',\n            params: 2,\n            inputFormatter: [formatters.inputSignFormatter, null]\n        })\n    ];\n    methods.forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n        method.defaultBlock = _this.defaultBlock;\n        method.defaultAccount = _this.defaultAccount;\n    });\n};\n\ncore.addProviders(Personal);\n\n\n\nmodule.exports = Personal;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-personal/src/index.js\n// module id = 391\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-personal/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file utils.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar BN = __webpack_require__(141);\nvar numberToBN = __webpack_require__(294);\nvar utf8 = __webpack_require__(547);\nvar Hash = __webpack_require__(261);\n\n\n/**\n * Returns true if object is BN, otherwise false\n *\n * @method isBN\n * @param {Object} object\n * @return {Boolean}\n */\nvar isBN = function (object) {\n    return object instanceof BN ||\n        (object && object.constructor && object.constructor.name === 'BN');\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object} object\n * @return {Boolean}\n */\nvar isBigNumber = function (object) {\n    return object && object.constructor && object.constructor.name === 'BigNumber';\n};\n\n/**\n * Takes an input and transforms it into an BN\n *\n * @method toBN\n * @param {Number|String|BN} number, string, HEX string or BN\n * @return {BN} BN\n */\nvar toBN = function(number){\n    try {\n        return numberToBN.apply(null, arguments);\n    } catch(e) {\n        throw new Error(e + ' Given value: \"'+ number +'\"');\n    }\n};\n\n\n/**\n * Takes and input transforms it into BN and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BN} number\n * @return {String}\n */\nvar toTwosComplement = function (number) {\n    return '0x'+ toBN(number).toTwos(256).toString(16, 64);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX address\n * @return {Boolean}\n */\nvar isAddress = function (address) {\n    // check if it has the basic requirements of an address\n    if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {\n        return false;\n        // If it's ALL lowercase or ALL upppercase\n    } else if (/^(0x|0X)?[0-9a-f]{40}$/.test(address) || /^(0x|0X)?[0-9A-F]{40}$/.test(address)) {\n        return true;\n        // Otherwise check each case\n    } else {\n        return checkAddressChecksum(address);\n    }\n};\n\n\n\n/**\n * Checks if the given string is a checksummed address\n *\n * @method checkAddressChecksum\n * @param {String} address the given HEX address\n * @return {Boolean}\n */\nvar checkAddressChecksum = function (address) {\n    // Check each case\n    address = address.replace(/^0x/i,'');\n    var addressHash = sha3(address.toLowerCase()).replace(/^0x/i,'');\n\n    for (var i = 0; i < 40; i++ ) {\n        // the nth letter should be uppercase if the nth digit of casemap is 1\n        if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) {\n            return false;\n        }\n    }\n    return true;\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method leftPad\n * @param {String} string to be padded\n * @param {Number} chars that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar leftPad = function (string, chars, sign) {\n    var hasPrefix = /^0x/i.test(string) || typeof string === 'number';\n    string = string.toString(16).replace(/^0x/i,'');\n\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\n\n    return (hasPrefix ? '0x' : '') + new Array(padding).join(sign ? sign : \"0\") + string;\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method rightPad\n * @param {String} string to be padded\n * @param {Number} chars that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar rightPad = function (string, chars, sign) {\n    var hasPrefix = /^0x/i.test(string) || typeof string === 'number';\n    string = string.toString(16).replace(/^0x/i,'');\n\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\n\n    return (hasPrefix ? '0x' : '') + string + (new Array(padding).join(sign ? sign : \"0\"));\n};\n\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of utf8 string\n *\n * @method utf8ToHex\n * @param {String} str\n * @returns {String} hex representation of input string\n */\nvar utf8ToHex = function(str) {\n    str = utf8.encode(str);\n    var hex = \"\";\n\n    // remove \\u0000 padding from either side\n    str = str.replace(/^(?:\\u0000)*/,'');\n    str = str.split(\"\").reverse().join(\"\");\n    str = str.replace(/^(?:\\u0000)*/,'');\n    str = str.split(\"\").reverse().join(\"\");\n\n    for(var i = 0; i < str.length; i++) {\n        var code = str.charCodeAt(i);\n        // if (code !== 0) {\n        var n = code.toString(16);\n        hex += n.length < 2 ? '0' + n : n;\n        // }\n    }\n\n    return \"0x\" + hex;\n};\n\n/**\n * Should be called to get utf8 from it's hex representation\n *\n * @method hexToUtf8\n * @param {String} hex\n * @returns {String} ascii string representation of hex value\n */\nvar hexToUtf8 = function(hex) {\n    if (!isHexStrict(hex))\n        throw new Error('The parameter \"'+ hex +'\" must be a valid HEX string.');\n\n    var str = \"\";\n    var code = 0;\n    hex = hex.replace(/^0x/i,'');\n\n    // remove 00 padding from either side\n    hex = hex.replace(/^(?:00)*/,'');\n    hex = hex.split(\"\").reverse().join(\"\");\n    hex = hex.replace(/^(?:00)*/,'');\n    hex = hex.split(\"\").reverse().join(\"\");\n\n    var l = hex.length;\n\n    for (var i=0; i < l; i+=2) {\n        code = parseInt(hex.substr(i, 2), 16);\n        // if (code !== 0) {\n        str += String.fromCharCode(code);\n        // }\n    }\n\n    return utf8.decode(str);\n};\n\n\n/**\n * Converts value to it's number representation\n *\n * @method hexToNumber\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar hexToNumber = function (value) {\n    if (!value) {\n        return value;\n    }\n\n    return toBN(value).toNumber();\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method hexToNumberString\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar hexToNumberString = function (value) {\n    if (!value) return value;\n\n    return toBN(value).toString(10);\n};\n\n\n/**\n * Converts value to it's hex representation\n *\n * @method numberToHex\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar numberToHex = function (value) {\n    if (_.isNull(value) || _.isUndefined(value)) {\n        return value;\n    }\n\n    if (!isFinite(value) && !isHexStrict(value)) {\n        throw new Error('Given input \"'+value+'\" is not a number.');\n    }\n\n    var number = toBN(value);\n    var result = number.toString(16);\n\n    return number.lt(new BN(0)) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n\n/**\n * Convert a byte array to a hex string\n *\n * Note: Implementation from crypto-js\n *\n * @method bytesToHex\n * @param {Array} bytes\n * @return {String} the hex string\n */\nvar bytesToHex = function(bytes) {\n    for (var hex = [], i = 0; i < bytes.length; i++) {\n        /* jshint ignore:start */\n        hex.push((bytes[i] >>> 4).toString(16));\n        hex.push((bytes[i] & 0xF).toString(16));\n        /* jshint ignore:end */\n    }\n    return '0x'+ hex.join(\"\");\n};\n\n/**\n * Convert a hex string to a byte array\n *\n * Note: Implementation from crypto-js\n *\n * @method hexToBytes\n * @param {string} hex\n * @return {Array} the byte array\n */\nvar hexToBytes = function(hex) {\n    hex = hex.toString(16);\n\n    if (!isHexStrict(hex)) {\n        throw new Error('Given value \"'+ hex +'\" is not a valid hex string.');\n    }\n\n    hex = hex.replace(/^0x/i,'');\n\n    for (var bytes = [], c = 0; c < hex.length; c += 2)\n        bytes.push(parseInt(hex.substr(c, 2), 16));\n    return bytes;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BN|Object} value\n * @param {Boolean} returnType\n * @return {String}\n */\nvar toHex = function (value, returnType) {\n    /*jshint maxcomplexity: false */\n\n    if (isAddress(value)) {\n        return returnType ? 'address' : '0x'+ value.toLowerCase().replace(/^0x/i,'');\n    }\n\n    if (_.isBoolean(value)) {\n        return returnType ? 'bool' : value ? '0x01' : '0x00';\n    }\n\n\n    if (_.isObject(value) && !isBigNumber(value) && !isBN(value)) {\n        return returnType ? 'string' : utf8ToHex(JSON.stringify(value));\n    }\n\n    // if its a negative number, pass it through numberToHex\n    if (_.isString(value)) {\n        if (value.indexOf('-0x') === 0 || value.indexOf('-0X') === 0) {\n            return returnType ? 'int256' : numberToHex(value);\n        } else if(value.indexOf('0x') === 0 || value.indexOf('0X') === 0) {\n            return returnType ? 'bytes' : value;\n        } else if (!isFinite(value)) {\n            return returnType ? 'string' : utf8ToHex(value);\n        }\n    }\n\n    return returnType ? (value < 0 ? 'int256' : 'uint256') : numberToHex(value);\n};\n\n\n/**\n * Check if string is HEX, requires a 0x in front\n *\n * @method isHexStrict\n * @param {String} hex to be checked\n * @returns {Boolean}\n */\nvar isHexStrict = function (hex) {\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-)?0x[0-9a-f]*$/i.test(hex));\n};\n\n/**\n * Check if string is HEX\n *\n * @method isHex\n * @param {String} hex to be checked\n * @returns {Boolean}\n */\nvar isHex = function (hex) {\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-0x|0x)?[0-9a-f]*$/i.test(hex));\n};\n\n\n/**\n * Returns true if given string is a valid Ethereum block header bloom.\n *\n * TODO UNDOCUMENTED\n *\n * @method isBloom\n * @param {String} hex encoded bloom filter\n * @return {Boolean}\n */\nvar isBloom = function (bloom) {\n    if (!/^(0x)?[0-9a-f]{512}$/i.test(bloom)) {\n        return false;\n    } else if (/^(0x)?[0-9a-f]{512}$/.test(bloom) || /^(0x)?[0-9A-F]{512}$/.test(bloom)) {\n        return true;\n    }\n    return false;\n};\n\n/**\n * Returns true if given string is a valid log topic.\n *\n * TODO UNDOCUMENTED\n *\n * @method isTopic\n * @param {String} hex encoded topic\n * @return {Boolean}\n */\nvar isTopic = function (topic) {\n    if (!/^(0x)?[0-9a-f]{64}$/i.test(topic)) {\n        return false;\n    } else if (/^(0x)?[0-9a-f]{64}$/.test(topic) || /^(0x)?[0-9A-F]{64}$/.test(topic)) {\n        return true;\n    }\n    return false;\n};\n\n\n/**\n * Hashes values to a sha3 hash using keccak 256\n *\n * To hash a HEX string the hex must have 0x in front.\n *\n * @method sha3\n * @return {String} the sha3 string\n */\nvar SHA3_NULL_S = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';\n\nvar sha3 = function (value) {\n    if (isHexStrict(value) && /^0x/i.test((value).toString())) {\n        value = hexToBytes(value);\n    }\n\n    var returnValue = Hash.keccak256(value); // jshint ignore:line\n\n    if(returnValue === SHA3_NULL_S) {\n        return null;\n    } else {\n        return returnValue;\n    }\n};\n// expose the under the hood keccak256\nsha3._Hash = Hash;\n\n\nmodule.exports = {\n    BN: BN,\n    isBN: isBN,\n    isBigNumber: isBigNumber,\n    toBN: toBN,\n    isAddress: isAddress,\n    isBloom: isBloom, // TODO UNDOCUMENTED\n    isTopic: isTopic, // TODO UNDOCUMENTED\n    checkAddressChecksum: checkAddressChecksum,\n    utf8ToHex: utf8ToHex,\n    hexToUtf8: hexToUtf8,\n    hexToNumber: hexToNumber,\n    hexToNumberString: hexToNumberString,\n    numberToHex: numberToHex,\n    toHex: toHex,\n    hexToBytes: hexToBytes,\n    bytesToHex: bytesToHex,\n    isHex: isHex,\n    isHexStrict: isHexStrict,\n    leftPad: leftPad,\n    rightPad: rightPad,\n    toTwosComplement: toTwosComplement,\n    sha3: sha3\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-utils/src/utils.js\n// module id = 392\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-utils/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar debug = _interopDefault(__webpack_require__(5));\nvar EE = _interopDefault(__webpack_require__(262));\nvar IPFS = _interopDefault(__webpack_require__(755));\nvar Channel = _interopDefault(__webpack_require__(730));\nvar WEB3 = _interopDefault(__webpack_require__(796));\n\nconst debugLog = function (string, loglevel, enable = true) {\n  let log = debug('');\n\n  if (loglevel === 'hight') log.enabled = true;\n\n  loglevel === 'light' && !enable\n    ? log.enabled = false\n    : log.enabled = true;\n\n  if (loglevel === 'error') {\n    log = debug(loglevel);\n    log.enabled = true;\n  }\n\n  if (loglevel === 'none')  log.enabled = false;\n\n  return log(string)\n};\n\n/* global localStorage */\n\nconst _config = {\n  rtc_room: 'default_room_name',\n  loglevel: 'light'\n};\n\nconst uID = function () {\n  return '_' + Math.random().toString(36).substr(2, 9)\n};\n\nconst delivery_timeout = 15000;\nconst msg_ttl = 10 * 60 * 1000;\n\nconst seedsDB = (function () {\n  const store_name = 'rtc_msgs_seeds';\n\n  let _seeds = {};\n  let w_time = false;\n\n  const read = function () {\n    if (false) return\n    if (typeof localStorage !== 'undefined') { return }\n    try {\n      _seeds = JSON.parse(localStorage[store_name]);\n    } catch (e) {}\n  };\n  const write = function () {\n    if (false) return\n    if (typeof localStorage !== 'undefined') { return }\n\n    clearTimeout(w_time);\n    w_time = setTimeout(function () {\n      localStorage[store_name] = JSON.stringify(_seeds);\n    }, 500);\n  };\n\n  read();\n\n  return {\n    add (data, id) {\n      _seeds[id] = data;\n      write();\n    },\n\n    get (id) {\n      if (!_seeds[id]) read();\n\n      return _seeds[id] || null\n    },\n\n    getAll () {\n      return _seeds\n    },\n\n    remove (id) {\n      delete _seeds[id];\n      write();\n    }\n  }\n})();\n\nlet ipfs_connected = false;\n\nlet repo = './data/messaging/DataBase';\nif (false) {\n  repo += Math.ceil( Math.random() * 10000 );\n}\n\n\n// let swarmlist = [\n//   '/ip4/46.101.244.101/tcp/9090/ws/p2p-websocket-star/'\n//   // '/ip4/146.185.173.84/tcp/9090/ws/p2p-websocket-star/'\n// ]\n// if (process.env.DC_NETWORK === 'local') {\n//   swarmlist = [\n//     '/ip4/127.0.0.1/tcp/9090/ws/p2p-websocket-star/'\n//   ]\n// }\n\nfunction upIPFS (swarmlist = '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star') {\n  try {\n\n    let server = swarmlist;\n    if (!Array.isArray(swarmlist)) {\n      server = [];\n      server.push(swarmlist);\n    } \n    \n    global.ipfs = new IPFS({\n      repo: repo,\n      EXPERIMENTAL: {\n        pubsub: true\n      },\n      config: {\n        Addresses: {\n          Swarm: server\n        }\n      }\n    });\n    global.ipfs.on('ready', () => {\n      ipfs_connected = true;\n    });\n\n  } catch (err) {\n    debugLog('Restart IPFS ' + err, 'error');\n    upIPFS(swarmlist);\n  }\n}\n\nclass RTC {\n  constructor (user_id = false, room = false, secure = false) {\n    room = room || _config.rtc_room;\n\n    const EC = function () {};\n    EE(EC.prototype);\n    this.Event = new EC();\n\n    if (!room) {\n      debugLog('empty room name', 'error');\n      return\n    }\n    \n    this.web3 = new WEB3(new WEB3.providers.HttpProvider('https://ropsten.infura.io/JCnK5ifEPH9qcQkX0Ahl'));\n\n    if (secure) this._secure = secure;\n\n    this.user_id = user_id || uID();\n    this.room_id = '' + room;\n    this.channel = false;\n    this.connect(room);\n\n    this.clearOldSeeds();\n  }\n\n  connect (room) {\n    if (!ipfs_connected) {\n      setTimeout(() => {\n        this.connect(room);\n      }, 999);\n      return\n    }\n    debugLog('room:' + room, _config.loglevel);\n    this.channel = Channel(global.ipfs, room);\n\n    this.channel.on('message', rawmsg => {\n      let raw  = {};\n      let data = {};\n      try {\n        raw  = JSON.parse(rawmsg.data.toString());\n        data = raw.data;\n        const sign_mess = raw.sign_mess;\n        if (this._secure) {\n          if (!this.validSig(sign_mess, data)) return\n        }\n      } catch (e) {\n        return\n      }\n\n      // return\n      if (data.user_id && data.user_id === this.user_id) {\n        return\n      }\n      // if (data.room_id != this.room_id) {\n      //   return\n      // }\n\n      this.acknowledgeReceipt(data);\n\n      this.Event.emit('all', data);\n\n      if (data.uiid) {\n        this.Event.emit('uiid::' + data.uiid, data);\n      }\n\n      if (data.type && data.action) {\n        this.Event.emit(data.type + '::' + data.action, data);\n      }\n\n      if (data.action) {\n        this.Event.emit('action::' + data.action, data);\n      }\n\n      if (data.address) {\n        this.Event.emit('address::' + data.address, data);\n      }\n\n      if (data.user_id) {\n        this.Event.emit('user_id::' + data.user_id, data);\n      }\n    });\n\n    this.channel.on('peer joined', (peer) => {\n      debugLog('Peer(' + peer + ') joined the room ' + this.room_id, _config.loglevel);\n    });\n\n    this.channel.on('peer left', (peer) => {\n      debugLog('Peer left... ' + peer, _config.loglevel);\n    });\n\n    // now started to listen to room\n    this.channel.on('subscribed', () => {\n      debugLog('Now connected!', _config.loglevel, false);\n    });\n  }\n\n  validSig (sign_mess, data) {\n    if (this._secure) {\n      const hash       = this.web3.utils.soliditySha3(JSON.stringify(data));\n      const recover    = this.web3.eth.accounts.recover(hash, sign_mess.signature);\n      const check_sign = this._secure.allowed_users.some(element => {\n        return element.toLowerCase() === recover.toLowerCase()\n      });\n\n      return check_sign\n    }\n  }\n  \n  async isAlreadyReceived (data) {\n    // isAlreadyReceived(data){\n    if (!data.seed || typeof data.seed !== 'string' || data.action === 'delivery_confirmation') {\n      return false\n    }\n    const seed_exist = seedsDB.get(data.seed);\n    if (seed_exist && this.isFreshSeed(seed_exist.t)) {\n      return true\n    }\n\n    seedsDB.add({ t:new Date().getTime() }, data.seed);\n    return false\n  }\n\n  isFreshSeed (time) {\n    let ttl = msg_ttl || 7 * 1000;\n    let livetime = (new Date().getTime()) - time * 1;\n    return (livetime < ttl)\n  }\n\n  async clearOldSeeds () {\n    // clearOldSeeds(){\n    let seeds = seedsDB.getAll();\n    for (let id in seeds) {\n      if (!this.isFreshSeed(seeds[id].t)) {\n        seedsDB.remove(id);\n      }\n    }\n\n    setTimeout(() => { this.clearOldSeeds(); }, 10 * 1000);\n  }\n\n  on (event, callback) {\n    this.Event.on(event, callback);\n  }\n\n  once (event, callback) {\n    this.Event.once(event, callback);\n  }\n\n  off (event, callback) {\n    this.Event.off(event, callback);\n  }\n\n  subscribe (address, callback, name = false) {\n    this.on('address::' + address, callback);\n  }\n\n  unsubscribe (address, callback, name = false) {\n    this.off('address::' + address, callback);\n  }\n\n  // Подтверждение получения принятого сообщения\n  acknowledgeReceipt (acquired_data) {\n    if (!acquired_data.user_id  || !acquired_data.action ||\n      acquired_data.user_id === this.user_id ||\n      acquired_data.action  === 'delivery_confirmation' ||\n      acquired_data.action  === 'bankroller_active') {\n      return\n    }\n\n    \n    this.sendMsg({\n      address : acquired_data.address,\n      seed    : uID(),\n      action  : 'delivery_confirmation',\n      message : acquired_data\n    });\n  }\n\n  // Проверка получения отправленного сообщения\n  CheckReceipt (sended_data, callback) {\n    let subscribe_index = false;\n    let address = sended_data.address;\n\n    let waitReceipt = data => {\n      if (!data.action || data.action !== 'delivery_confirmation') {\n        return\n      }\n\n      if (this.equaMsgs(sended_data, data.message)) {\n        this.unsubscribe(address, waitReceipt, subscribe_index);\n\n        if (this.CheckReceiptsT[sended_data.seed]) {\n          clearTimeout(this.CheckReceiptsT[sended_data.seed]);\n        }\n\n        callback(true);\n      }\n    };\n\n    subscribe_index = this.subscribe(address, waitReceipt);\n\n    if (!this.CheckReceiptsT) {\n      this.CheckReceiptsT = {};\n    }\n\n    this.CheckReceiptsT[sended_data.seed] = setTimeout(() => {\n      this.unsubscribe(address, waitReceipt, subscribe_index);\n\n      callback(false);\n    }, delivery_timeout);\n  }\n\n  equaMsgs (msg1, msg2) {\n    return (JSON.stringify(msg1) === JSON.stringify(msg2))\n  }\n\n  // Отправка сообщения с ожидание подтверждения получения\n  send (data, callback = false, repeat = 5) {\n    if (!this.channel) {\n      setTimeout(() => { this.send(data, callback); }, 1000);\n      return\n    }\n\n    data = this.sendMsg(data);\n\n    if (!data.address) {\n      return\n    }\n\n    this.CheckReceipt(data, delivered => {\n      if (!delivered && repeat > 0) {\n        repeat--;\n        this.send(data, callback, repeat);\n        return\n      }\n\n      if (callback) callback(delivered);\n    });\n  }\n\n  sendMsg (data) {\n    if (!this.channel) {\n      if (data.action !== 'bankroller_active') {\n        setTimeout(() => {\n          this.sendMsg(data);\n        }, 999);\n      }\n      return\n    }\n\n    let {sign_mess, hash} = false;\n    data.seed       = uID();\n    data.user_id    = this.user_id;\n    // signed message\n    if (this._secure) {\n      hash      = this.web3.utils.soliditySha3(JSON.stringify(data));\n      sign_mess = this.web3.eth.accounts.sign(hash, this._secure.privateKey);\n    }\n    // data.room_id = this.room_id\n\n    this.channel.broadcast(JSON.stringify({\n      data: data,\n      hash: hash, \n      sign_mess: sign_mess\n    }));\n\n    return data\n  }\n}\n\nexports.upIPFS = upIPFS;\nexports.RTC = RTC;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/rtc.bundle.js\n// module id = 393\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/rtc.bundle.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*!\n * @description Recursive object extending\n * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>\n * @license MIT\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2015 Viacheslav Lotsmanov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\nfunction isSpecificValue(val) {\n\treturn (\n\t\tval instanceof Buffer\n\t\t|| val instanceof Date\n\t\t|| val instanceof RegExp\n\t) ? true : false;\n}\n\nfunction cloneSpecificValue(val) {\n\tif (val instanceof Buffer) {\n\t\tvar x = new Buffer(val.length);\n\t\tval.copy(x);\n\t\treturn x;\n\t} else if (val instanceof Date) {\n\t\treturn new Date(val.getTime());\n\t} else if (val instanceof RegExp) {\n\t\treturn new RegExp(val);\n\t} else {\n\t\tthrow new Error('Unexpected situation');\n\t}\n}\n\n/**\n * Recursive cloning array.\n */\nfunction deepCloneArray(arr) {\n\tvar clone = [];\n\tarr.forEach(function (item, index) {\n\t\tif (typeof item === 'object' && item !== null) {\n\t\t\tif (Array.isArray(item)) {\n\t\t\t\tclone[index] = deepCloneArray(item);\n\t\t\t} else if (isSpecificValue(item)) {\n\t\t\t\tclone[index] = cloneSpecificValue(item);\n\t\t\t} else {\n\t\t\t\tclone[index] = deepExtend({}, item);\n\t\t\t}\n\t\t} else {\n\t\t\tclone[index] = item;\n\t\t}\n\t});\n\treturn clone;\n}\n\n/**\n * Extening object that entered in first argument.\n *\n * Returns extended object or false if have no target object or incorrect type.\n *\n * If you wish to clone source object (without modify it), just use empty new\n * object as first argument, like this:\n *   deepExtend({}, yourObj_1, [yourObj_N]);\n */\nvar deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {\n\tif (arguments.length < 1 || typeof arguments[0] !== 'object') {\n\t\treturn false;\n\t}\n\n\tif (arguments.length < 2) {\n\t\treturn arguments[0];\n\t}\n\n\tvar target = arguments[0];\n\n\t// convert arguments to array and cut off target object\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\n\tvar val, src, clone;\n\n\targs.forEach(function (obj) {\n\t\t// skip argument if isn't an object, is null, or is an array\n\t\tif (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {\n\t\t\treturn;\n\t\t}\n\n\t\tObject.keys(obj).forEach(function (key) {\n\t\t\tsrc = target[key]; // source value\n\t\t\tval = obj[key]; // new value\n\n\t\t\t// recursion prevention\n\t\t\tif (val === target) {\n\t\t\t\treturn;\n\n\t\t\t/**\n\t\t\t * if new value isn't object then just overwrite by new value\n\t\t\t * instead of extending.\n\t\t\t */\n\t\t\t} else if (typeof val !== 'object' || val === null) {\n\t\t\t\ttarget[key] = val;\n\t\t\t\treturn;\n\n\t\t\t// just clone arrays (and recursive clone objects inside)\n\t\t\t} else if (Array.isArray(val)) {\n\t\t\t\ttarget[key] = deepCloneArray(val);\n\t\t\t\treturn;\n\n\t\t\t// custom cloning and overwrite for specific objects\n\t\t\t} else if (isSpecificValue(val)) {\n\t\t\t\ttarget[key] = cloneSpecificValue(val);\n\t\t\t\treturn;\n\n\t\t\t// overwrite by new value if source isn't object or array\n\t\t\t} else if (typeof src !== 'object' || src === null || Array.isArray(src)) {\n\t\t\t\ttarget[key] = deepExtend({}, val);\n\t\t\t\treturn;\n\n\t\t\t// source value and new value is objects both, extending...\n\t\t\t} else {\n\t\t\t\ttarget[key] = deepExtend(src, val);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t});\n\n\treturn target;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deep-extend/lib/deep-extend.js\n// module id = 394\n// module chunks = 0\n\n//# sourceURL=../node_modules/deep-extend/lib/deep-extend.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/* Copyright (c) 2017 Rod Vagg, MIT License */\n\nfunction AbstractChainedBatch (db) {\n  this._db         = db\n  this._operations = []\n  this._written    = false\n}\n\nAbstractChainedBatch.prototype._serializeKey = function (key) {\n  return this._db._serializeKey(key)\n}\n\nAbstractChainedBatch.prototype._serializeValue = function (value) {\n  return this._db._serializeValue(value)\n}\n\nAbstractChainedBatch.prototype._checkWritten = function () {\n  if (this._written)\n    throw new Error('write() already called on this batch')\n}\n\nAbstractChainedBatch.prototype.put = function (key, value) {\n  this._checkWritten()\n\n  var err = this._db._checkKey(key, 'key', this._db._isBuffer)\n  if (err)\n    throw err\n\n  key = this._serializeKey(key)\n  value = this._serializeValue(value)\n\n  if (typeof this._put == 'function' )\n    this._put(key, value)\n  else\n    this._operations.push({ type: 'put', key: key, value: value })\n\n  return this\n}\n\nAbstractChainedBatch.prototype.del = function (key) {\n  this._checkWritten()\n\n  var err = this._db._checkKey(key, 'key', this._db._isBuffer)\n  if (err) throw err\n\n  key = this._serializeKey(key)\n\n  if (typeof this._del == 'function' )\n    this._del(key)\n  else\n    this._operations.push({ type: 'del', key: key })\n\n  return this\n}\n\nAbstractChainedBatch.prototype.clear = function () {\n  this._checkWritten()\n\n  this._operations = []\n\n  if (typeof this._clear == 'function' )\n    this._clear()\n\n  return this\n}\n\nAbstractChainedBatch.prototype.write = function (options, callback) {\n  this._checkWritten()\n\n  if (typeof options == 'function')\n    callback = options\n  if (typeof callback != 'function')\n    throw new Error('write() requires a callback argument')\n  if (typeof options != 'object')\n    options = {}\n\n  this._written = true\n\n  if (typeof this._write == 'function' )\n    return this._write(callback)\n\n  if (typeof this._db._batch == 'function')\n    return this._db._batch(this._operations, options, callback)\n\n  process.nextTick(callback)\n}\n\nmodule.exports = AbstractChainedBatch\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/~/abstract-leveldown/abstract-chained-batch.js\n// module id = 395\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/node_modules/abstract-leveldown/abstract-chained-batch.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/* Copyright (c) 2017 Rod Vagg, MIT License */\n\nfunction AbstractIterator (db) {\n  this.db = db\n  this._ended = false\n  this._nexting = false\n}\n\nAbstractIterator.prototype.next = function (callback) {\n  var self = this\n\n  if (typeof callback != 'function')\n    throw new Error('next() requires a callback argument')\n\n  if (self._ended)\n    return callback(new Error('cannot call next() after end()'))\n  if (self._nexting)\n    return callback(new Error('cannot call next() before previous next() has completed'))\n\n  self._nexting = true\n  if (typeof self._next == 'function') {\n    return self._next(function () {\n      self._nexting = false\n      callback.apply(null, arguments)\n    })\n  }\n\n  process.nextTick(function () {\n    self._nexting = false\n    callback()\n  })\n}\n\nAbstractIterator.prototype.end = function (callback) {\n  if (typeof callback != 'function')\n    throw new Error('end() requires a callback argument')\n\n  if (this._ended)\n    return callback(new Error('end() already called on iterator'))\n\n  this._ended = true\n\n  if (typeof this._end == 'function')\n    return this._end(callback)\n\n  process.nextTick(callback)\n}\n\nmodule.exports = AbstractIterator\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/~/abstract-leveldown/abstract-iterator.js\n// module id = 396\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/node_modules/abstract-leveldown/abstract-iterator.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {/* Copyright (c) 2017 Rod Vagg, MIT License */\n\nvar xtend                = __webpack_require__(73)\n  , AbstractIterator     = __webpack_require__(396)\n  , AbstractChainedBatch = __webpack_require__(395)\n\nfunction AbstractLevelDOWN (location) {\n  if (!arguments.length || location === undefined)\n    throw new Error('constructor requires at least a location argument')\n\n  if (typeof location != 'string')\n    throw new Error('constructor requires a location string argument')\n\n  this.location = location\n  this.status = 'new'\n}\n\nAbstractLevelDOWN.prototype.open = function (options, callback) {\n  var self      = this\n    , oldStatus = this.status\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('open() requires a callback argument')\n\n  if (typeof options != 'object')\n    options = {}\n\n  options.createIfMissing = options.createIfMissing != false\n  options.errorIfExists = !!options.errorIfExists\n\n  if (typeof this._open == 'function') {\n    this.status = 'opening'\n    this._open(options, function (err) {\n      if (err) {\n        self.status = oldStatus\n        return callback(err)\n      }\n      self.status = 'open'\n      callback()\n    })\n  } else {\n    this.status = 'open'\n    process.nextTick(callback)\n  }\n}\n\nAbstractLevelDOWN.prototype.close = function (callback) {\n  var self      = this\n    , oldStatus = this.status\n\n  if (typeof callback != 'function')\n    throw new Error('close() requires a callback argument')\n\n  if (typeof this._close == 'function') {\n    this.status = 'closing'\n    this._close(function (err) {\n      if (err) {\n        self.status = oldStatus\n        return callback(err)\n      }\n      self.status = 'closed'\n      callback()\n    })\n  } else {\n    this.status = 'closed'\n    process.nextTick(callback)\n  }\n}\n\nAbstractLevelDOWN.prototype.get = function (key, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('get() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key'))\n    return callback(err)\n\n  key = this._serializeKey(key)\n\n  if (typeof options != 'object')\n    options = {}\n\n  options.asBuffer = options.asBuffer != false\n\n  if (typeof this._get == 'function')\n    return this._get(key, options, callback)\n\n  process.nextTick(function () { callback(new Error('NotFound')) })\n}\n\nAbstractLevelDOWN.prototype.put = function (key, value, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('put() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key'))\n    return callback(err)\n\n  key = this._serializeKey(key)\n  value = this._serializeValue(value)\n\n  if (typeof options != 'object')\n    options = {}\n\n  if (typeof this._put == 'function')\n    return this._put(key, value, options, callback)\n\n  process.nextTick(callback)\n}\n\nAbstractLevelDOWN.prototype.del = function (key, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('del() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key'))\n    return callback(err)\n\n  key = this._serializeKey(key)\n\n  if (typeof options != 'object')\n    options = {}\n\n  if (typeof this._del == 'function')\n    return this._del(key, options, callback)\n\n  process.nextTick(callback)\n}\n\nAbstractLevelDOWN.prototype.batch = function (array, options, callback) {\n  if (!arguments.length)\n    return this._chainedBatch()\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof array == 'function')\n    callback = array\n\n  if (typeof callback != 'function')\n    throw new Error('batch(array) requires a callback argument')\n\n  if (!Array.isArray(array))\n    return callback(new Error('batch(array) requires an array argument'))\n\n  if (!options || typeof options != 'object')\n    options = {}\n\n  var i = 0\n    , l = array.length\n    , e\n    , err\n\n  for (; i < l; i++) {\n    e = array[i]\n    if (typeof e != 'object')\n      continue\n\n    if (err = this._checkKey(e.type, 'type'))\n      return callback(err)\n\n    if (err = this._checkKey(e.key, 'key'))\n      return callback(err)\n  }\n\n  if (typeof this._batch == 'function')\n    return this._batch(array, options, callback)\n\n  process.nextTick(callback)\n}\n\n//TODO: remove from here, not a necessary primitive\nAbstractLevelDOWN.prototype.approximateSize = function (start, end, callback) {\n  if (   start == null\n      || end == null\n      || typeof start == 'function'\n      || typeof end == 'function') {\n    throw new Error('approximateSize() requires valid `start`, `end` and `callback` arguments')\n  }\n\n  if (typeof callback != 'function')\n    throw new Error('approximateSize() requires a callback argument')\n\n  start = this._serializeKey(start)\n  end = this._serializeKey(end)\n\n  if (typeof this._approximateSize == 'function')\n    return this._approximateSize(start, end, callback)\n\n  process.nextTick(function () {\n    callback(null, 0)\n  })\n}\n\nAbstractLevelDOWN.prototype._setupIteratorOptions = function (options) {\n  var self = this\n\n  options = xtend(options)\n\n  ;[ 'start', 'end', 'gt', 'gte', 'lt', 'lte' ].forEach(function (o) {\n    if (options[o] && self._isBuffer(options[o]) && options[o].length === 0)\n      delete options[o]\n  })\n\n  options.reverse = !!options.reverse\n  options.keys = options.keys != false\n  options.values = options.values != false\n  options.limit = 'limit' in options ? options.limit : -1\n  options.keyAsBuffer = options.keyAsBuffer != false\n  options.valueAsBuffer = options.valueAsBuffer != false\n\n  return options\n}\n\nAbstractLevelDOWN.prototype.iterator = function (options) {\n  if (typeof options != 'object')\n    options = {}\n\n  options = this._setupIteratorOptions(options)\n\n  if (typeof this._iterator == 'function')\n    return this._iterator(options)\n\n  return new AbstractIterator(this)\n}\n\nAbstractLevelDOWN.prototype._chainedBatch = function () {\n  return new AbstractChainedBatch(this)\n}\n\nAbstractLevelDOWN.prototype._isBuffer = function (obj) {\n  return Buffer.isBuffer(obj)\n}\n\nAbstractLevelDOWN.prototype._serializeKey = function (key) {\n  return this._isBuffer(key)\n    ? key\n    : String(key)\n}\n\nAbstractLevelDOWN.prototype._serializeValue = function (value) {\n  if (value == null) return ''\n  return this._isBuffer(value) || process.browser ? value : String(value)\n}\n\nAbstractLevelDOWN.prototype._checkKey = function (obj, type) {\n  if (obj === null || obj === undefined)\n    return new Error(type + ' cannot be `null` or `undefined`')\n\n  if (this._isBuffer(obj) && obj.length === 0)\n    return new Error(type + ' cannot be an empty Buffer')\n  else if (String(obj) === '')\n    return new Error(type + ' cannot be an empty String')\n}\n\nmodule.exports = AbstractLevelDOWN\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/~/abstract-leveldown/abstract-leveldown.js\n// module id = 397\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/node_modules/abstract-leveldown/abstract-leveldown.js")},function(module,exports,__webpack_require__){eval("exports.AbstractLevelDOWN    = __webpack_require__(397)\nexports.AbstractIterator     = __webpack_require__(396)\nexports.AbstractChainedBatch = __webpack_require__(395)\nexports.isLevelDOWN          = __webpack_require__(805)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/~/abstract-leveldown/index.js\n// module id = 398\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/node_modules/abstract-leveldown/index.js")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('Object.defineProperty(__webpack_exports__, "__esModule", { value: true });\n/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*\n * Dexie.js - a minimalistic wrapper for IndexedDB\n * ===============================================\n *\n * By David Fahlander, david.fahlander@gmail.com\n *\n * Version {version}, {date}\n *\n * http://dexie.org\n *\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\n */\n \nvar keys = Object.keys;\nvar isArray = Array.isArray;\nvar _global = typeof self !== \'undefined\' ? self :\n    typeof window !== \'undefined\' ? window :\n        global;\nfunction extend(obj, extension) {\n    if (typeof extension !== \'object\')\n        return obj;\n    keys(extension).forEach(function (key) {\n        obj[key] = extension[key];\n    });\n    return obj;\n}\nvar getProto = Object.getPrototypeOf;\nvar _hasOwn = {}.hasOwnProperty;\nfunction hasOwn(obj, prop) {\n    return _hasOwn.call(obj, prop);\n}\nfunction props(proto, extension) {\n    if (typeof extension === \'function\')\n        extension = extension(getProto(proto));\n    keys(extension).forEach(function (key) {\n        setProp(proto, key, extension[key]);\n    });\n}\nvar defineProperty = Object.defineProperty;\nfunction setProp(obj, prop, functionOrGetSet, options) {\n    defineProperty(obj, prop, extend(functionOrGetSet && hasOwn(functionOrGetSet, "get") && typeof functionOrGetSet.get === \'function\' ?\n        { get: functionOrGetSet.get, set: functionOrGetSet.set, configurable: true } :\n        { value: functionOrGetSet, configurable: true, writable: true }, options));\n}\nfunction derive(Child) {\n    return {\n        from: function (Parent) {\n            Child.prototype = Object.create(Parent.prototype);\n            setProp(Child.prototype, "constructor", Child);\n            return {\n                extend: props.bind(null, Child.prototype)\n            };\n        }\n    };\n}\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nfunction getPropertyDescriptor(obj, prop) {\n    var pd = getOwnPropertyDescriptor(obj, prop), proto;\n    return pd || (proto = getProto(obj)) && getPropertyDescriptor(proto, prop);\n}\nvar _slice = [].slice;\nfunction slice(args, start, end) {\n    return _slice.call(args, start, end);\n}\nfunction override(origFunc, overridedFactory) {\n    return overridedFactory(origFunc);\n}\nfunction assert(b) {\n    if (!b)\n        throw new Error("Assertion Failed");\n}\nfunction asap(fn) {\n    if (_global.setImmediate)\n        setImmediate(fn);\n    else\n        setTimeout(fn, 0);\n}\n\n/** Generate an object (hash map) based on given array.\n * @param extractor Function taking an array item and its index and returning an array of 2 items ([key, value]) to\n *        instert on the resulting object for each item in the array. If this function returns a falsy value, the\n *        current item wont affect the resulting object.\n */\nfunction arrayToObject(array, extractor) {\n    return array.reduce(function (result, item, i) {\n        var nameAndValue = extractor(item, i);\n        if (nameAndValue)\n            result[nameAndValue[0]] = nameAndValue[1];\n        return result;\n    }, {});\n}\nfunction trycatcher(fn, reject) {\n    return function () {\n        try {\n            fn.apply(this, arguments);\n        }\n        catch (e) {\n            reject(e);\n        }\n    };\n}\nfunction tryCatch(fn, onerror, args) {\n    try {\n        fn.apply(null, args);\n    }\n    catch (ex) {\n        onerror && onerror(ex);\n    }\n}\nfunction getByKeyPath(obj, keyPath) {\n    // http://www.w3.org/TR/IndexedDB/#steps-for-extracting-a-key-from-a-value-using-a-key-path\n    if (hasOwn(obj, keyPath))\n        return obj[keyPath]; // This line is moved from last to first for optimization purpose.\n    if (!keyPath)\n        return obj;\n    if (typeof keyPath !== \'string\') {\n        var rv = [];\n        for (var i = 0, l = keyPath.length; i < l; ++i) {\n            var val = getByKeyPath(obj, keyPath[i]);\n            rv.push(val);\n        }\n        return rv;\n    }\n    var period = keyPath.indexOf(\'.\');\n    if (period !== -1) {\n        var innerObj = obj[keyPath.substr(0, period)];\n        return innerObj === undefined ? undefined : getByKeyPath(innerObj, keyPath.substr(period + 1));\n    }\n    return undefined;\n}\nfunction setByKeyPath(obj, keyPath, value) {\n    if (!obj || keyPath === undefined)\n        return;\n    if (\'isFrozen\' in Object && Object.isFrozen(obj))\n        return;\n    if (typeof keyPath !== \'string\' && \'length\' in keyPath) {\n        assert(typeof value !== \'string\' && \'length\' in value);\n        for (var i = 0, l = keyPath.length; i < l; ++i) {\n            setByKeyPath(obj, keyPath[i], value[i]);\n        }\n    }\n    else {\n        var period = keyPath.indexOf(\'.\');\n        if (period !== -1) {\n            var currentKeyPath = keyPath.substr(0, period);\n            var remainingKeyPath = keyPath.substr(period + 1);\n            if (remainingKeyPath === "")\n                if (value === undefined)\n                    delete obj[currentKeyPath];\n                else\n                    obj[currentKeyPath] = value;\n            else {\n                var innerObj = obj[currentKeyPath];\n                if (!innerObj)\n                    innerObj = (obj[currentKeyPath] = {});\n                setByKeyPath(innerObj, remainingKeyPath, value);\n            }\n        }\n        else {\n            if (value === undefined)\n                delete obj[keyPath];\n            else\n                obj[keyPath] = value;\n        }\n    }\n}\nfunction delByKeyPath(obj, keyPath) {\n    if (typeof keyPath === \'string\')\n        setByKeyPath(obj, keyPath, undefined);\n    else if (\'length\' in keyPath)\n        [].map.call(keyPath, function (kp) {\n            setByKeyPath(obj, kp, undefined);\n        });\n}\nfunction shallowClone(obj) {\n    var rv = {};\n    for (var m in obj) {\n        if (hasOwn(obj, m))\n            rv[m] = obj[m];\n    }\n    return rv;\n}\nvar concat = [].concat;\nfunction flatten(a) {\n    return concat.apply([], a);\n}\n//https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\nvar intrinsicTypes = "Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set"\n    .split(\',\').concat(flatten([8, 16, 32, 64].map(function (num) { return ["Int", "Uint", "Float"].map(function (t) { return t + num + "Array"; }); }))).filter(function (t) { return _global[t]; }).map(function (t) { return _global[t]; });\nfunction deepClone(any) {\n    if (!any || typeof any !== \'object\')\n        return any;\n    var rv;\n    if (isArray(any)) {\n        rv = [];\n        for (var i = 0, l = any.length; i < l; ++i) {\n            rv.push(deepClone(any[i]));\n        }\n    }\n    else if (intrinsicTypes.indexOf(any.constructor) >= 0) {\n        rv = any;\n    }\n    else {\n        rv = any.constructor ? Object.create(any.constructor.prototype) : {};\n        for (var prop in any) {\n            if (hasOwn(any, prop)) {\n                rv[prop] = deepClone(any[prop]);\n            }\n        }\n    }\n    return rv;\n}\nfunction getObjectDiff(a, b, rv, prfx) {\n    // Compares objects a and b and produces a diff object.\n    rv = rv || {};\n    prfx = prfx || \'\';\n    keys(a).forEach(function (prop) {\n        if (!hasOwn(b, prop))\n            rv[prfx + prop] = undefined; // Property removed\n        else {\n            var ap = a[prop], bp = b[prop];\n            if (typeof ap === \'object\' && typeof bp === \'object\' &&\n                ap && bp &&\n                // Now compare constructors are same (not equal because wont work in Safari)\n                (\'\' + ap.constructor) === (\'\' + bp.constructor))\n                // Same type of object but its properties may have changed\n                getObjectDiff(ap, bp, rv, prfx + prop + ".");\n            else if (ap !== bp)\n                rv[prfx + prop] = b[prop]; // Primitive value changed\n        }\n    });\n    keys(b).forEach(function (prop) {\n        if (!hasOwn(a, prop)) {\n            rv[prfx + prop] = b[prop]; // Property added\n        }\n    });\n    return rv;\n}\n// If first argument is iterable or array-like, return it as an array\nvar iteratorSymbol = typeof Symbol !== \'undefined\' && Symbol.iterator;\nvar getIteratorOf = iteratorSymbol ? function (x) {\n    var i;\n    return x != null && (i = x[iteratorSymbol]) && i.apply(x);\n} : function () { return null; };\nvar NO_CHAR_ARRAY = {};\n// Takes one or several arguments and returns an array based on the following criteras:\n// * If several arguments provided, return arguments converted to an array in a way that\n//   still allows javascript engine to optimize the code.\n// * If single argument is an array, return a clone of it.\n// * If this-pointer equals NO_CHAR_ARRAY, don\'t accept strings as valid iterables as a special\n//   case to the two bullets below.\n// * If single argument is an iterable, convert it to an array and return the resulting array.\n// * If single argument is array-like (has length of type number), convert it to an array.\nfunction getArrayOf(arrayLike) {\n    var i, a, x, it;\n    if (arguments.length === 1) {\n        if (isArray(arrayLike))\n            return arrayLike.slice();\n        if (this === NO_CHAR_ARRAY && typeof arrayLike === \'string\')\n            return [arrayLike];\n        if ((it = getIteratorOf(arrayLike))) {\n            a = [];\n            while ((x = it.next()), !x.done)\n                a.push(x.value);\n            return a;\n        }\n        if (arrayLike == null)\n            return [arrayLike];\n        i = arrayLike.length;\n        if (typeof i === \'number\') {\n            a = new Array(i);\n            while (i--)\n                a[i] = arrayLike[i];\n            return a;\n        }\n        return [arrayLike];\n    }\n    i = arguments.length;\n    a = new Array(i);\n    while (i--)\n        a[i] = arguments[i];\n    return a;\n}\n\n// By default, debug will be true only if platform is a web platform and its page is served from localhost.\n// When debug = true, error\'s stacks will contain asyncronic long stacks.\nvar debug = typeof location !== \'undefined\' &&\n    // By default, use debug mode if served from localhost.\n    /^(http|https):\\/\\/(localhost|127\\.0\\.0\\.1)/.test(location.href);\nfunction setDebug(value, filter) {\n    debug = value;\n    libraryFilter = filter;\n}\nvar libraryFilter = function () { return true; };\nvar NEEDS_THROW_FOR_STACK = !new Error("").stack;\nfunction getErrorWithStack() {\n    "use strict";\n    if (NEEDS_THROW_FOR_STACK)\n        try {\n            // Doing something naughty in strict mode here to trigger a specific error\n            // that can be explicitely ignored in debugger\'s exception settings.\n            // If we\'d just throw new Error() here, IE\'s debugger\'s exception settings\n            // will just consider it as "exception thrown by javascript code" which is\n            // something you wouldn\'t want it to ignore.\n            getErrorWithStack.arguments;\n            throw new Error(); // Fallback if above line don\'t throw.\n        }\n        catch (e) {\n            return e;\n        }\n    return new Error();\n}\nfunction prettyStack(exception, numIgnoredFrames) {\n    var stack = exception.stack;\n    if (!stack)\n        return "";\n    numIgnoredFrames = (numIgnoredFrames || 0);\n    if (stack.indexOf(exception.name) === 0)\n        numIgnoredFrames += (exception.name + exception.message).split(\'\\n\').length;\n    return stack.split(\'\\n\')\n        .slice(numIgnoredFrames)\n        .filter(libraryFilter)\n        .map(function (frame) { return "\\n" + frame; })\n        .join(\'\');\n}\nfunction deprecated(what, fn) {\n    return function () {\n        console.warn(what + " is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. " + prettyStack(getErrorWithStack(), 1));\n        return fn.apply(this, arguments);\n    };\n}\n\nvar dexieErrorNames = [\n    \'Modify\',\n    \'Bulk\',\n    \'OpenFailed\',\n    \'VersionChange\',\n    \'Schema\',\n    \'Upgrade\',\n    \'InvalidTable\',\n    \'MissingAPI\',\n    \'NoSuchDatabase\',\n    \'InvalidArgument\',\n    \'SubTransaction\',\n    \'Unsupported\',\n    \'Internal\',\n    \'DatabaseClosed\',\n    \'PrematureCommit\',\n    \'ForeignAwait\'\n];\nvar idbDomErrorNames = [\n    \'Unknown\',\n    \'Constraint\',\n    \'Data\',\n    \'TransactionInactive\',\n    \'ReadOnly\',\n    \'Version\',\n    \'NotFound\',\n    \'InvalidState\',\n    \'InvalidAccess\',\n    \'Abort\',\n    \'Timeout\',\n    \'QuotaExceeded\',\n    \'Syntax\',\n    \'DataClone\'\n];\nvar errorList = dexieErrorNames.concat(idbDomErrorNames);\nvar defaultTexts = {\n    VersionChanged: "Database version changed by other database connection",\n    DatabaseClosed: "Database has been closed",\n    Abort: "Transaction aborted",\n    TransactionInactive: "Transaction has already completed or failed"\n};\n//\n// DexieError - base class of all out exceptions.\n//\nfunction DexieError(name, msg) {\n    // Reason we don\'t use ES6 classes is because:\n    // 1. It bloats transpiled code and increases size of minified code.\n    // 2. It doesn\'t give us much in this case.\n    // 3. It would require sub classes to call super(), which\n    //    is not needed when deriving from Error.\n    this._e = getErrorWithStack();\n    this.name = name;\n    this.message = msg;\n}\nderive(DexieError).from(Error).extend({\n    stack: {\n        get: function () {\n            return this._stack ||\n                (this._stack = this.name + ": " + this.message + prettyStack(this._e, 2));\n        }\n    },\n    toString: function () { return this.name + ": " + this.message; }\n});\nfunction getMultiErrorMessage(msg, failures) {\n    return msg + ". Errors: " + failures\n        .map(function (f) { return f.toString(); })\n        .filter(function (v, i, s) { return s.indexOf(v) === i; }) // Only unique error strings\n        .join(\'\\n\');\n}\n//\n// ModifyError - thrown in Collection.modify()\n// Specific constructor because it contains members failures and failedKeys.\n//\nfunction ModifyError(msg, failures, successCount, failedKeys) {\n    this._e = getErrorWithStack();\n    this.failures = failures;\n    this.failedKeys = failedKeys;\n    this.successCount = successCount;\n}\nderive(ModifyError).from(DexieError);\nfunction BulkError(msg, failures) {\n    this._e = getErrorWithStack();\n    this.name = "BulkError";\n    this.failures = failures;\n    this.message = getMultiErrorMessage(msg, failures);\n}\nderive(BulkError).from(DexieError);\n//\n//\n// Dynamically generate error names and exception classes based\n// on the names in errorList.\n//\n//\n// Map of {ErrorName -> ErrorName + "Error"}\nvar errnames = errorList.reduce(function (obj, name) { return (obj[name] = name + "Error", obj); }, {});\n// Need an alias for DexieError because we\'re gonna create subclasses with the same name.\nvar BaseException = DexieError;\n// Map of {ErrorName -> exception constructor}\nvar exceptions = errorList.reduce(function (obj, name) {\n    // Let the name be "DexieError" because this name may\n    // be shown in call stack and when debugging. DexieError is\n    // the most true name because it derives from DexieError,\n    // and we cannot change Function.name programatically without\n    // dynamically create a Function object, which would be considered\n    // \'eval-evil\'.\n    var fullName = name + "Error";\n    function DexieError(msgOrInner, inner) {\n        this._e = getErrorWithStack();\n        this.name = fullName;\n        if (!msgOrInner) {\n            this.message = defaultTexts[name] || fullName;\n            this.inner = null;\n        }\n        else if (typeof msgOrInner === \'string\') {\n            this.message = msgOrInner;\n            this.inner = inner || null;\n        }\n        else if (typeof msgOrInner === \'object\') {\n            this.message = msgOrInner.name + " " + msgOrInner.message;\n            this.inner = msgOrInner;\n        }\n    }\n    derive(DexieError).from(BaseException);\n    obj[name] = DexieError;\n    return obj;\n}, {});\n// Use ECMASCRIPT standard exceptions where applicable:\nexceptions.Syntax = SyntaxError;\nexceptions.Type = TypeError;\nexceptions.Range = RangeError;\nvar exceptionMap = idbDomErrorNames.reduce(function (obj, name) {\n    obj[name + "Error"] = exceptions[name];\n    return obj;\n}, {});\nfunction mapError(domError, message) {\n    if (!domError || domError instanceof DexieError || domError instanceof TypeError || domError instanceof SyntaxError || !domError.name || !exceptionMap[domError.name])\n        return domError;\n    var rv = new exceptionMap[domError.name](message || domError.message, domError);\n    if ("stack" in domError) {\n        // Derive stack from inner exception if it has a stack\n        setProp(rv, "stack", { get: function () {\n                return this.inner.stack;\n            } });\n    }\n    return rv;\n}\nvar fullNameExceptions = errorList.reduce(function (obj, name) {\n    if (["Syntax", "Type", "Range"].indexOf(name) === -1)\n        obj[name + "Error"] = exceptions[name];\n    return obj;\n}, {});\nfullNameExceptions.ModifyError = ModifyError;\nfullNameExceptions.DexieError = DexieError;\nfullNameExceptions.BulkError = BulkError;\n\nfunction nop() { }\nfunction mirror(val) { return val; }\nfunction pureFunctionChain(f1, f2) {\n    // Enables chained events that takes ONE argument and returns it to the next function in chain.\n    // This pattern is used in the hook("reading") event.\n    if (f1 == null || f1 === mirror)\n        return f2;\n    return function (val) {\n        return f2(f1(val));\n    };\n}\nfunction callBoth(on1, on2) {\n    return function () {\n        on1.apply(this, arguments);\n        on2.apply(this, arguments);\n    };\n}\nfunction hookCreatingChain(f1, f2) {\n    // Enables chained events that takes several arguments and may modify first argument by making a modification and then returning the same instance.\n    // This pattern is used in the hook("creating") event.\n    if (f1 === nop)\n        return f2;\n    return function () {\n        var res = f1.apply(this, arguments);\n        if (res !== undefined)\n            arguments[0] = res;\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\n        onerror = this.onerror; // In case event listener has set this.onerror\n        this.onsuccess = null;\n        this.onerror = null;\n        var res2 = f2.apply(this, arguments);\n        if (onsuccess)\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n        if (onerror)\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n        return res2 !== undefined ? res2 : res;\n    };\n}\nfunction hookDeletingChain(f1, f2) {\n    if (f1 === nop)\n        return f2;\n    return function () {\n        f1.apply(this, arguments);\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\n        onerror = this.onerror; // In case event listener has set this.onerror\n        this.onsuccess = this.onerror = null;\n        f2.apply(this, arguments);\n        if (onsuccess)\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n        if (onerror)\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n    };\n}\nfunction hookUpdatingChain(f1, f2) {\n    if (f1 === nop)\n        return f2;\n    return function (modifications) {\n        var res = f1.apply(this, arguments);\n        extend(modifications, res); // If f1 returns new modifications, extend caller\'s modifications with the result before calling next in chain.\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\n        onerror = this.onerror; // In case event listener has set this.onerror\n        this.onsuccess = null;\n        this.onerror = null;\n        var res2 = f2.apply(this, arguments);\n        if (onsuccess)\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\n        if (onerror)\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\n        return res === undefined ?\n            (res2 === undefined ? undefined : res2) :\n            (extend(res, res2));\n    };\n}\nfunction reverseStoppableEventChain(f1, f2) {\n    if (f1 === nop)\n        return f2;\n    return function () {\n        if (f2.apply(this, arguments) === false)\n            return false;\n        return f1.apply(this, arguments);\n    };\n}\n\nfunction promisableChain(f1, f2) {\n    if (f1 === nop)\n        return f2;\n    return function () {\n        var res = f1.apply(this, arguments);\n        if (res && typeof res.then === \'function\') {\n            var thiz = this, i = arguments.length, args = new Array(i);\n            while (i--)\n                args[i] = arguments[i];\n            return res.then(function () {\n                return f2.apply(thiz, args);\n            });\n        }\n        return f2.apply(this, arguments);\n    };\n}\n\n/*\n * Copyright (c) 2014-2017 David Fahlander\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/LICENSE-2.0\n */\n//\n// Promise and Zone (PSD) for Dexie library\n//\n// I started out writing this Promise class by copying promise-light (https://github.com/taylorhakes/promise-light) by\n// https://github.com/taylorhakes - an A+ and ECMASCRIPT 6 compliant Promise implementation.\n//\n// In previous versions this was fixed by not calling setTimeout when knowing that the resolve() or reject() came from another\n// tick. In Dexie v1.4.0, I\'ve rewritten the Promise class entirely. Just some fragments of promise-light is left. I use\n// another strategy now that simplifies everything a lot: to always execute callbacks in a new micro-task, but have an own micro-task\n// engine that is indexedDB compliant across all browsers.\n// Promise class has also been optimized a lot with inspiration from bluebird - to avoid closures as much as possible.\n// Also with inspiration from bluebird, asyncronic stacks in debug mode.\n//\n// Specific non-standard features of this Promise class:\n// * Custom zone support (a.k.a. PSD) with ability to keep zones also when using native promises as well as\n//   native async / await.\n// * Promise.follow() method built upon the custom zone engine, that allows user to track all promises created from current stack frame\n//   and below + all promises that those promises creates or awaits.\n// * Detect any unhandled promise in a PSD-scope (PSD.onunhandled). \n//\n// David Fahlander, https://github.com/dfahlander\n//\n// Just a pointer that only this module knows about.\n// Used in Promise constructor to emulate a private constructor.\nvar INTERNAL = {};\n// Async stacks (long stacks) must not grow infinitely.\nvar LONG_STACKS_CLIP_LIMIT = 100;\nvar MAX_LONG_STACKS = 20;\nvar ZONE_ECHO_LIMIT = 7;\nvar nativePromiseInstanceAndProto = (function () {\n    try {\n        // Be able to patch native async functions\n        return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")();\n    }\n    catch (e) {\n        var P = _global.Promise;\n        return P ?\n            [P.resolve(), P.prototype, P.resolve()] :\n            [];\n    }\n})();\nvar resolvedNativePromise = nativePromiseInstanceAndProto[0];\nvar nativePromiseProto = nativePromiseInstanceAndProto[1];\nvar resolvedGlobalPromise = nativePromiseInstanceAndProto[2];\nvar nativePromiseThen = nativePromiseProto && nativePromiseProto.then;\nvar NativePromise = resolvedNativePromise && resolvedNativePromise.constructor;\nvar AsyncFunction = nativePromiseInstanceAndProto[3];\nvar patchGlobalPromise = !!resolvedGlobalPromise;\nvar stack_being_generated = false;\n/* The default function used only for the very first promise in a promise chain.\n   As soon as then promise is resolved or rejected, all next tasks will be executed in micro ticks\n   emulated in this module. For indexedDB compatibility, this means that every method needs to\n   execute at least one promise before doing an indexedDB operation. Dexie will always call\n   db.ready().then() for every operation to make sure the indexedDB event is started in an\n   indexedDB-compatible emulated micro task loop.\n*/\nvar schedulePhysicalTick = resolvedGlobalPromise ?\n    function () { resolvedGlobalPromise.then(physicalTick); }\n    :\n        _global.setImmediate ?\n            // setImmediate supported. Those modern platforms also supports Function.bind().\n            setImmediate.bind(null, physicalTick) :\n            _global.MutationObserver ?\n                // MutationObserver supported\n                function () {\n                    var hiddenDiv = document.createElement("div");\n                    (new MutationObserver(function () {\n                        physicalTick();\n                        hiddenDiv = null;\n                    })).observe(hiddenDiv, { attributes: true });\n                    hiddenDiv.setAttribute(\'i\', \'1\');\n                } :\n                // No support for setImmediate or MutationObserver. No worry, setTimeout is only called\n                // once time. Every tick that follows will be our emulated micro tick.\n                // Could have uses setTimeout.bind(null, 0, physicalTick) if it wasnt for that FF13 and below has a bug \n                function () { setTimeout(physicalTick, 0); };\n// Configurable through Promise.scheduler.\n// Don\'t export because it would be unsafe to let unknown\n// code call it unless they do try..catch within their callback.\n// This function can be retrieved through getter of Promise.scheduler though,\n// but users must not do Promise.scheduler = myFuncThatThrowsException\nvar asap$1 = function (callback, args) {\n    microtickQueue.push([callback, args]);\n    if (needsNewPhysicalTick) {\n        schedulePhysicalTick();\n        needsNewPhysicalTick = false;\n    }\n};\nvar isOutsideMicroTick = true;\nvar needsNewPhysicalTick = true;\nvar unhandledErrors = [];\nvar rejectingErrors = [];\nvar currentFulfiller = null;\nvar rejectionMapper = mirror; // Remove in next major when removing error mapping of DOMErrors and DOMExceptions\nvar globalPSD = {\n    id: \'global\',\n    global: true,\n    ref: 0,\n    unhandleds: [],\n    onunhandled: globalError,\n    pgp: false,\n    env: {},\n    finalize: function () {\n        this.unhandleds.forEach(function (uh) {\n            try {\n                globalError(uh[0], uh[1]);\n            }\n            catch (e) { }\n        });\n    }\n};\nvar PSD = globalPSD;\nvar microtickQueue = []; // Callbacks to call in this or next physical tick.\nvar numScheduledCalls = 0; // Number of listener-calls left to do in this physical tick.\nvar tickFinalizers = []; // Finalizers to call when there are no more async calls scheduled within current physical tick.\nfunction Promise(fn) {\n    if (typeof this !== \'object\')\n        throw new TypeError(\'Promises must be constructed via new\');\n    this._listeners = [];\n    this.onuncatched = nop; // Deprecate in next major. Not needed. Better to use global error handler.\n    // A library may set `promise._lib = true;` after promise is created to make resolve() or reject()\n    // execute the microtask engine implicitely within the call to resolve() or reject().\n    // To remain A+ compliant, a library must only set `_lib=true` if it can guarantee that the stack\n    // only contains library code when calling resolve() or reject().\n    // RULE OF THUMB: ONLY set _lib = true for promises explicitely resolving/rejecting directly from\n    // global scope (event handler, timer etc)!\n    this._lib = false;\n    // Current async scope\n    var psd = (this._PSD = PSD);\n    if (debug) {\n        this._stackHolder = getErrorWithStack();\n        this._prev = null;\n        this._numPrev = 0; // Number of previous promises (for long stacks)\n    }\n    if (typeof fn !== \'function\') {\n        if (fn !== INTERNAL)\n            throw new TypeError(\'Not a function\');\n        // Private constructor (INTERNAL, state, value).\n        // Used internally by Promise.resolve() and Promise.reject().\n        this._state = arguments[1];\n        this._value = arguments[2];\n        if (this._state === false)\n            handleRejection(this, this._value); // Map error, set stack and addPossiblyUnhandledError().\n        return;\n    }\n    this._state = null; // null (=pending), false (=rejected) or true (=resolved)\n    this._value = null; // error or result\n    ++psd.ref; // Refcounting current scope\n    executePromiseTask(this, fn);\n}\n// Prepare a property descriptor to put onto Promise.prototype.then\nvar thenProp = {\n    get: function () {\n        var psd = PSD, microTaskId = totalEchoes;\n        function then(onFulfilled, onRejected) {\n            var _this = this;\n            var possibleAwait = !psd.global && (psd !== PSD || microTaskId !== totalEchoes);\n            if (possibleAwait)\n                decrementExpectedAwaits();\n            var rv = new Promise(function (resolve, reject) {\n                propagateToListener(_this, new Listener(nativeAwaitCompatibleWrap(onFulfilled, psd, possibleAwait), nativeAwaitCompatibleWrap(onRejected, psd, possibleAwait), resolve, reject, psd));\n            });\n            debug && linkToPreviousPromise(rv, this);\n            return rv;\n        }\n        then.prototype = INTERNAL; // For idempotense, see setter below.\n        return then;\n    },\n    // Be idempotent and allow another framework (such as zone.js or another instance of a Dexie.Promise module) to replace Promise.prototype.then\n    // and when that framework wants to restore the original property, we must identify that and restore the original property descriptor.\n    set: function (value) {\n        setProp(this, \'then\', value && value.prototype === INTERNAL ?\n            thenProp : // Restore to original property descriptor.\n            {\n                get: function () {\n                    return value; // Getter returning provided value (behaves like value is just changed)\n                },\n                set: thenProp.set // Keep a setter that is prepared to restore original.\n            });\n    }\n};\nprops(Promise.prototype, {\n    then: thenProp,\n    _then: function (onFulfilled, onRejected) {\n        // A little tinier version of then() that don\'t have to create a resulting promise.\n        propagateToListener(this, new Listener(null, null, onFulfilled, onRejected, PSD));\n    },\n    catch: function (onRejected) {\n        if (arguments.length === 1)\n            return this.then(null, onRejected);\n        // First argument is the Error type to catch\n        var type = arguments[0], handler = arguments[1];\n        return typeof type === \'function\' ? this.then(null, function (err) {\n            // Catching errors by its constructor type (similar to java / c++ / c#)\n            // Sample: promise.catch(TypeError, function (e) { ... });\n            return err instanceof type ? handler(err) : PromiseReject(err);\n        })\n            : this.then(null, function (err) {\n                // Catching errors by the error.name property. Makes sense for indexedDB where error type\n                // is always DOMError but where e.name tells the actual error type.\n                // Sample: promise.catch(\'ConstraintError\', function (e) { ... });\n                return err && err.name === type ? handler(err) : PromiseReject(err);\n            });\n    },\n    finally: function (onFinally) {\n        return this.then(function (value) {\n            onFinally();\n            return value;\n        }, function (err) {\n            onFinally();\n            return PromiseReject(err);\n        });\n    },\n    stack: {\n        get: function () {\n            if (this._stack)\n                return this._stack;\n            try {\n                stack_being_generated = true;\n                var stacks = getStack(this, [], MAX_LONG_STACKS);\n                var stack = stacks.join("\\nFrom previous: ");\n                if (this._state !== null)\n                    this._stack = stack; // Stack may be updated on reject.\n                return stack;\n            }\n            finally {\n                stack_being_generated = false;\n            }\n        }\n    },\n    timeout: function (ms, msg) {\n        var _this = this;\n        return ms < Infinity ?\n            new Promise(function (resolve, reject) {\n                var handle = setTimeout(function () { return reject(new exceptions.Timeout(msg)); }, ms);\n                _this.then(resolve, reject).finally(clearTimeout.bind(null, handle));\n            }) : this;\n    }\n});\nif (typeof Symbol !== \'undefined\' && Symbol.toStringTag)\n    setProp(Promise.prototype, Symbol.toStringTag, \'Promise\');\n// Now that Promise.prototype is defined, we have all it takes to set globalPSD.env.\n// Environment globals snapshotted on leaving global zone\nglobalPSD.env = snapShot();\nfunction Listener(onFulfilled, onRejected, resolve, reject, zone) {\n    this.onFulfilled = typeof onFulfilled === \'function\' ? onFulfilled : null;\n    this.onRejected = typeof onRejected === \'function\' ? onRejected : null;\n    this.resolve = resolve;\n    this.reject = reject;\n    this.psd = zone;\n}\n// Promise Static Properties\nprops(Promise, {\n    all: function () {\n        var values = getArrayOf.apply(null, arguments) // Supports iterables, implicit arguments and array-like.\n            .map(onPossibleParallellAsync); // Handle parallell async/awaits \n        return new Promise(function (resolve, reject) {\n            if (values.length === 0)\n                resolve([]);\n            var remaining = values.length;\n            values.forEach(function (a, i) { return Promise.resolve(a).then(function (x) {\n                values[i] = x;\n                if (!--remaining)\n                    resolve(values);\n            }, reject); });\n        });\n    },\n    resolve: function (value) {\n        if (value instanceof Promise)\n            return value;\n        if (value && typeof value.then === \'function\')\n            return new Promise(function (resolve, reject) {\n                value.then(resolve, reject);\n            });\n        var rv = new Promise(INTERNAL, true, value);\n        linkToPreviousPromise(rv, currentFulfiller);\n        return rv;\n    },\n    reject: PromiseReject,\n    race: function () {\n        var values = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);\n        return new Promise(function (resolve, reject) {\n            values.map(function (value) { return Promise.resolve(value).then(resolve, reject); });\n        });\n    },\n    PSD: {\n        get: function () { return PSD; },\n        set: function (value) { return PSD = value; }\n    },\n    //totalEchoes: {get: ()=>totalEchoes},\n    //task: {get: ()=>task},\n    newPSD: newScope,\n    usePSD: usePSD,\n    scheduler: {\n        get: function () { return asap$1; },\n        set: function (value) { asap$1 = value; }\n    },\n    rejectionMapper: {\n        get: function () { return rejectionMapper; },\n        set: function (value) { rejectionMapper = value; } // Map reject failures\n    },\n    follow: function (fn, zoneProps) {\n        return new Promise(function (resolve, reject) {\n            return newScope(function (resolve, reject) {\n                var psd = PSD;\n                psd.unhandleds = []; // For unhandled standard- or 3rd party Promises. Checked at psd.finalize()\n                psd.onunhandled = reject; // Triggered directly on unhandled promises of this library.\n                psd.finalize = callBoth(function () {\n                    var _this = this;\n                    // Unhandled standard or 3rd part promises are put in PSD.unhandleds and\n                    // examined upon scope completion while unhandled rejections in this Promise\n                    // will trigger directly through psd.onunhandled\n                    run_at_end_of_this_or_next_physical_tick(function () {\n                        _this.unhandleds.length === 0 ? resolve() : reject(_this.unhandleds[0]);\n                    });\n                }, psd.finalize);\n                fn();\n            }, zoneProps, resolve, reject);\n        });\n    }\n});\n/**\n* Take a potentially misbehaving resolver function and make sure\n* onFulfilled and onRejected are only called once.\n*\n* Makes no guarantees about asynchrony.\n*/\nfunction executePromiseTask(promise, fn) {\n    // Promise Resolution Procedure:\n    // https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n    try {\n        fn(function (value) {\n            if (promise._state !== null)\n                return; // Already settled\n            if (value === promise)\n                throw new TypeError(\'A promise cannot be resolved with itself.\');\n            var shouldExecuteTick = promise._lib && beginMicroTickScope();\n            if (value && typeof value.then === \'function\') {\n                executePromiseTask(promise, function (resolve, reject) {\n                    value instanceof Promise ?\n                        value._then(resolve, reject) :\n                        value.then(resolve, reject);\n                });\n            }\n            else {\n                promise._state = true;\n                promise._value = value;\n                propagateAllListeners(promise);\n            }\n            if (shouldExecuteTick)\n                endMicroTickScope();\n        }, handleRejection.bind(null, promise)); // If Function.bind is not supported. Exception is handled in catch below\n    }\n    catch (ex) {\n        handleRejection(promise, ex);\n    }\n}\nfunction handleRejection(promise, reason) {\n    rejectingErrors.push(reason);\n    if (promise._state !== null)\n        return;\n    var shouldExecuteTick = promise._lib && beginMicroTickScope();\n    reason = rejectionMapper(reason);\n    promise._state = false;\n    promise._value = reason;\n    debug && reason !== null && typeof reason === \'object\' && !reason._promise && tryCatch(function () {\n        var origProp = getPropertyDescriptor(reason, "stack");\n        reason._promise = promise;\n        setProp(reason, "stack", {\n            get: function () {\n                return stack_being_generated ?\n                    origProp && (origProp.get ?\n                        origProp.get.apply(reason) :\n                        origProp.value) :\n                    promise.stack;\n            }\n        });\n    });\n    // Add the failure to a list of possibly uncaught errors\n    addPossiblyUnhandledError(promise);\n    propagateAllListeners(promise);\n    if (shouldExecuteTick)\n        endMicroTickScope();\n}\nfunction propagateAllListeners(promise) {\n    //debug && linkToPreviousPromise(promise);\n    var listeners = promise._listeners;\n    promise._listeners = [];\n    for (var i = 0, len = listeners.length; i < len; ++i) {\n        propagateToListener(promise, listeners[i]);\n    }\n    var psd = promise._PSD;\n    --psd.ref || psd.finalize(); // if psd.ref reaches zero, call psd.finalize();\n    if (numScheduledCalls === 0) {\n        // If numScheduledCalls is 0, it means that our stack is not in a callback of a scheduled call,\n        // and that no deferreds where listening to this rejection or success.\n        // Since there is a risk that our stack can contain application code that may\n        // do stuff after this code is finished that may generate new calls, we cannot\n        // call finalizers here.\n        ++numScheduledCalls;\n        asap$1(function () {\n            if (--numScheduledCalls === 0)\n                finalizePhysicalTick(); // Will detect unhandled errors\n        }, []);\n    }\n}\nfunction propagateToListener(promise, listener) {\n    if (promise._state === null) {\n        promise._listeners.push(listener);\n        return;\n    }\n    var cb = promise._state ? listener.onFulfilled : listener.onRejected;\n    if (cb === null) {\n        // This Listener doesnt have a listener for the event being triggered (onFulfilled or onReject) so lets forward the event to any eventual listeners on the Promise instance returned by then() or catch()\n        return (promise._state ? listener.resolve : listener.reject)(promise._value);\n    }\n    ++listener.psd.ref;\n    ++numScheduledCalls;\n    asap$1(callListener, [cb, promise, listener]);\n}\nfunction callListener(cb, promise, listener) {\n    try {\n        // Set static variable currentFulfiller to the promise that is being fullfilled,\n        // so that we connect the chain of promises (for long stacks support)\n        currentFulfiller = promise;\n        // Call callback and resolve our listener with it\'s return value.\n        var ret, value = promise._value;\n        if (promise._state) {\n            // cb is onResolved\n            ret = cb(value);\n        }\n        else {\n            // cb is onRejected\n            if (rejectingErrors.length)\n                rejectingErrors = [];\n            ret = cb(value);\n            if (rejectingErrors.indexOf(value) === -1)\n                markErrorAsHandled(promise); // Callback didnt do Promise.reject(err) nor reject(err) onto another promise.\n        }\n        listener.resolve(ret);\n    }\n    catch (e) {\n        // Exception thrown in callback. Reject our listener.\n        listener.reject(e);\n    }\n    finally {\n        // Restore env and currentFulfiller.\n        currentFulfiller = null;\n        if (--numScheduledCalls === 0)\n            finalizePhysicalTick();\n        --listener.psd.ref || listener.psd.finalize();\n    }\n}\nfunction getStack(promise, stacks, limit) {\n    if (stacks.length === limit)\n        return stacks;\n    var stack = "";\n    if (promise._state === false) {\n        var failure = promise._value, errorName, message;\n        if (failure != null) {\n            errorName = failure.name || "Error";\n            message = failure.message || failure;\n            stack = prettyStack(failure, 0);\n        }\n        else {\n            errorName = failure; // If error is undefined or null, show that.\n            message = "";\n        }\n        stacks.push(errorName + (message ? ": " + message : "") + stack);\n    }\n    if (debug) {\n        stack = prettyStack(promise._stackHolder, 2);\n        if (stack && stacks.indexOf(stack) === -1)\n            stacks.push(stack);\n        if (promise._prev)\n            getStack(promise._prev, stacks, limit);\n    }\n    return stacks;\n}\nfunction linkToPreviousPromise(promise, prev) {\n    // Support long stacks by linking to previous completed promise.\n    var numPrev = prev ? prev._numPrev + 1 : 0;\n    if (numPrev < LONG_STACKS_CLIP_LIMIT) {\n        promise._prev = prev;\n        promise._numPrev = numPrev;\n    }\n}\n/* The callback to schedule with setImmediate() or setTimeout().\n   It runs a virtual microtick and executes any callback registered in microtickQueue.\n */\nfunction physicalTick() {\n    beginMicroTickScope() && endMicroTickScope();\n}\nfunction beginMicroTickScope() {\n    var wasRootExec = isOutsideMicroTick;\n    isOutsideMicroTick = false;\n    needsNewPhysicalTick = false;\n    return wasRootExec;\n}\n/* Executes micro-ticks without doing try..catch.\n   This can be possible because we only use this internally and\n   the registered functions are exception-safe (they do try..catch\n   internally before calling any external method). If registering\n   functions in the microtickQueue that are not exception-safe, this\n   would destroy the framework and make it instable. So we don\'t export\n   our asap method.\n*/\nfunction endMicroTickScope() {\n    var callbacks, i, l;\n    do {\n        while (microtickQueue.length > 0) {\n            callbacks = microtickQueue;\n            microtickQueue = [];\n            l = callbacks.length;\n            for (i = 0; i < l; ++i) {\n                var item = callbacks[i];\n                item[0].apply(null, item[1]);\n            }\n        }\n    } while (microtickQueue.length > 0);\n    isOutsideMicroTick = true;\n    needsNewPhysicalTick = true;\n}\nfunction finalizePhysicalTick() {\n    var unhandledErrs = unhandledErrors;\n    unhandledErrors = [];\n    unhandledErrs.forEach(function (p) {\n        p._PSD.onunhandled.call(null, p._value, p);\n    });\n    var finalizers = tickFinalizers.slice(0); // Clone first because finalizer may remove itself from list.\n    var i = finalizers.length;\n    while (i)\n        finalizers[--i]();\n}\nfunction run_at_end_of_this_or_next_physical_tick(fn) {\n    function finalizer() {\n        fn();\n        tickFinalizers.splice(tickFinalizers.indexOf(finalizer), 1);\n    }\n    tickFinalizers.push(finalizer);\n    ++numScheduledCalls;\n    asap$1(function () {\n        if (--numScheduledCalls === 0)\n            finalizePhysicalTick();\n    }, []);\n}\nfunction addPossiblyUnhandledError(promise) {\n    // Only add to unhandledErrors if not already there. The first one to add to this list\n    // will be upon the first rejection so that the root cause (first promise in the\n    // rejection chain) is the one listed.\n    if (!unhandledErrors.some(function (p) { return p._value === promise._value; }))\n        unhandledErrors.push(promise);\n}\nfunction markErrorAsHandled(promise) {\n    // Called when a reject handled is actually being called.\n    // Search in unhandledErrors for any promise whos _value is this promise_value (list\n    // contains only rejected promises, and only one item per error)\n    var i = unhandledErrors.length;\n    while (i)\n        if (unhandledErrors[--i]._value === promise._value) {\n            // Found a promise that failed with this same error object pointer,\n            // Remove that since there is a listener that actually takes care of it.\n            unhandledErrors.splice(i, 1);\n            return;\n        }\n}\nfunction PromiseReject(reason) {\n    return new Promise(INTERNAL, false, reason);\n}\nfunction wrap(fn, errorCatcher) {\n    var psd = PSD;\n    return function () {\n        var wasRootExec = beginMicroTickScope(), outerScope = PSD;\n        try {\n            switchToZone(psd, true);\n            return fn.apply(this, arguments);\n        }\n        catch (e) {\n            errorCatcher && errorCatcher(e);\n        }\n        finally {\n            switchToZone(outerScope, false);\n            if (wasRootExec)\n                endMicroTickScope();\n        }\n    };\n}\n//\n// variables used for native await support\n//\nvar task = { awaits: 0, echoes: 0, id: 0 }; // The ongoing macro-task when using zone-echoing.\nvar taskCounter = 0; // ID counter for macro tasks.\nvar zoneStack = []; // Stack of left zones to restore asynchronically.\nvar zoneEchoes = 0; // zoneEchoes is a must in order to persist zones between native await expressions.\nvar totalEchoes = 0; // ID counter for micro-tasks. Used to detect possible native await in our Promise.prototype.then.\nvar zone_id_counter = 0;\nfunction newScope(fn, props$$1, a1, a2) {\n    var parent = PSD, psd = Object.create(parent);\n    psd.parent = parent;\n    psd.ref = 0;\n    psd.global = false;\n    psd.id = ++zone_id_counter;\n    // Prepare for promise patching (done in usePSD):\n    var globalEnv = globalPSD.env;\n    psd.env = patchGlobalPromise ? {\n        Promise: Promise,\n        PromiseProp: { value: Promise, configurable: true, writable: true },\n        all: Promise.all,\n        race: Promise.race,\n        resolve: Promise.resolve,\n        reject: Promise.reject,\n        nthen: getPatchedPromiseThen(globalEnv.nthen, psd),\n        gthen: getPatchedPromiseThen(globalEnv.gthen, psd) // global then\n    } : {};\n    if (props$$1)\n        extend(psd, props$$1);\n    // unhandleds and onunhandled should not be specifically set here.\n    // Leave them on parent prototype.\n    // unhandleds.push(err) will push to parent\'s prototype\n    // onunhandled() will call parents onunhandled (with this scope\'s this-pointer though!)\n    ++parent.ref;\n    psd.finalize = function () {\n        --this.parent.ref || this.parent.finalize();\n    };\n    var rv = usePSD(psd, fn, a1, a2);\n    if (psd.ref === 0)\n        psd.finalize();\n    return rv;\n}\n// Function to call if scopeFunc returns NativePromise\n// Also for each NativePromise in the arguments to Promise.all()\nfunction incrementExpectedAwaits() {\n    if (!task.id)\n        task.id = ++taskCounter;\n    ++task.awaits;\n    task.echoes += ZONE_ECHO_LIMIT;\n    return task.id;\n}\n// Function to call when \'then\' calls back on a native promise where onAwaitExpected() had been called.\n// Also call this when a native await calls then method on a promise. In that case, don\'t supply\n// sourceTaskId because we already know it refers to current task.\nfunction decrementExpectedAwaits(sourceTaskId) {\n    if (!task.awaits || (sourceTaskId && sourceTaskId !== task.id))\n        return;\n    if (--task.awaits === 0)\n        task.id = 0;\n    task.echoes = task.awaits * ZONE_ECHO_LIMIT; // Will reset echoes to 0 if awaits is 0.\n}\n// Call from Promise.all() and Promise.race()\nfunction onPossibleParallellAsync(possiblePromise) {\n    if (task.echoes && possiblePromise && possiblePromise.constructor === NativePromise) {\n        incrementExpectedAwaits();\n        return possiblePromise.then(function (x) {\n            decrementExpectedAwaits();\n            return x;\n        }, function (e) {\n            decrementExpectedAwaits();\n            return rejection(e);\n        });\n    }\n    return possiblePromise;\n}\nfunction zoneEnterEcho(targetZone) {\n    ++totalEchoes;\n    if (!task.echoes || --task.echoes === 0) {\n        task.echoes = task.id = 0; // Cancel zone echoing.\n    }\n    zoneStack.push(PSD);\n    switchToZone(targetZone, true);\n}\nfunction zoneLeaveEcho() {\n    var zone = zoneStack[zoneStack.length - 1];\n    zoneStack.pop();\n    switchToZone(zone, false);\n}\nfunction switchToZone(targetZone, bEnteringZone) {\n    var currentZone = PSD;\n    if (bEnteringZone ? task.echoes && (!zoneEchoes++ || targetZone !== PSD) : zoneEchoes && (!--zoneEchoes || targetZone !== PSD)) {\n        // Enter or leave zone asynchronically as well, so that tasks initiated during current tick\n        // will be surrounded by the zone when they are invoked.\n        enqueueNativeMicroTask(bEnteringZone ? zoneEnterEcho.bind(null, targetZone) : zoneLeaveEcho);\n    }\n    if (targetZone === PSD)\n        return;\n    PSD = targetZone; // The actual zone switch occurs at this line.\n    // Snapshot on every leave from global zone.\n    if (currentZone === globalPSD)\n        globalPSD.env = snapShot();\n    if (patchGlobalPromise) {\n        // Let\'s patch the global and native Promises (may be same or may be different)\n        var GlobalPromise = globalPSD.env.Promise;\n        // Swich environments (may be PSD-zone or the global zone. Both apply.)\n        var targetEnv = targetZone.env;\n        // Change Promise.prototype.then for native and global Promise (they MAY differ on polyfilled environments, but both can be accessed)\n        // Must be done on each zone change because the patched method contains targetZone in its closure.\n        nativePromiseProto.then = targetEnv.nthen;\n        GlobalPromise.prototype.then = targetEnv.gthen;\n        if (currentZone.global || targetZone.global) {\n            // Leaving or entering global zone. It\'s time to patch / restore global Promise.\n            // Set this Promise to window.Promise so that transiled async functions will work on Firefox, Safari and IE, as well as with Zonejs and angular.\n            Object.defineProperty(_global, \'Promise\', targetEnv.PromiseProp);\n            // Support Promise.all() etc to work indexedDB-safe also when people are including es6-promise as a module (they might\n            // not be accessing global.Promise but a local reference to it)\n            GlobalPromise.all = targetEnv.all;\n            GlobalPromise.race = targetEnv.race;\n            GlobalPromise.resolve = targetEnv.resolve;\n            GlobalPromise.reject = targetEnv.reject;\n        }\n    }\n}\nfunction snapShot() {\n    var GlobalPromise = _global.Promise;\n    return patchGlobalPromise ? {\n        Promise: GlobalPromise,\n        PromiseProp: Object.getOwnPropertyDescriptor(_global, "Promise"),\n        all: GlobalPromise.all,\n        race: GlobalPromise.race,\n        resolve: GlobalPromise.resolve,\n        reject: GlobalPromise.reject,\n        nthen: nativePromiseProto.then,\n        gthen: GlobalPromise.prototype.then\n    } : {};\n}\nfunction usePSD(psd, fn, a1, a2, a3) {\n    var outerScope = PSD;\n    try {\n        switchToZone(psd, true);\n        return fn(a1, a2, a3);\n    }\n    finally {\n        switchToZone(outerScope, false);\n    }\n}\nfunction enqueueNativeMicroTask(job) {\n    //\n    // Precondition: nativePromiseThen !== undefined\n    //\n    nativePromiseThen.call(resolvedNativePromise, job);\n}\nfunction nativeAwaitCompatibleWrap(fn, zone, possibleAwait) {\n    return typeof fn !== \'function\' ? fn : function () {\n        var outerZone = PSD;\n        if (possibleAwait)\n            incrementExpectedAwaits();\n        switchToZone(zone, true);\n        try {\n            return fn.apply(this, arguments);\n        }\n        finally {\n            switchToZone(outerZone, false);\n        }\n    };\n}\nfunction getPatchedPromiseThen(origThen, zone) {\n    return function (onResolved, onRejected) {\n        return origThen.call(this, nativeAwaitCompatibleWrap(onResolved, zone, false), nativeAwaitCompatibleWrap(onRejected, zone, false));\n    };\n}\nvar UNHANDLEDREJECTION = "unhandledrejection";\nfunction globalError(err, promise) {\n    var rv;\n    try {\n        rv = promise.onuncatched(err);\n    }\n    catch (e) { }\n    if (rv !== false)\n        try {\n            var event, eventData = { promise: promise, reason: err };\n            if (_global.document && document.createEvent) {\n                event = document.createEvent(\'Event\');\n                event.initEvent(UNHANDLEDREJECTION, true, true);\n                extend(event, eventData);\n            }\n            else if (_global.CustomEvent) {\n                event = new CustomEvent(UNHANDLEDREJECTION, { detail: eventData });\n                extend(event, eventData);\n            }\n            if (event && _global.dispatchEvent) {\n                dispatchEvent(event);\n                if (!_global.PromiseRejectionEvent && _global.onunhandledrejection)\n                    // No native support for PromiseRejectionEvent but user has set window.onunhandledrejection. Manually call it.\n                    try {\n                        _global.onunhandledrejection(event);\n                    }\n                    catch (_) { }\n            }\n            if (!event.defaultPrevented) {\n                console.warn("Unhandled rejection: " + (err.stack || err));\n            }\n        }\n        catch (e) { }\n}\nvar rejection = Promise.reject;\n\nfunction Events(ctx) {\n    var evs = {};\n    var rv = function (eventName, subscriber) {\n        if (subscriber) {\n            // Subscribe. If additional arguments than just the subscriber was provided, forward them as well.\n            var i = arguments.length, args = new Array(i - 1);\n            while (--i)\n                args[i - 1] = arguments[i];\n            evs[eventName].subscribe.apply(null, args);\n            return ctx;\n        }\n        else if (typeof (eventName) === \'string\') {\n            // Return interface allowing to fire or unsubscribe from event\n            return evs[eventName];\n        }\n    };\n    rv.addEventType = add;\n    for (var i = 1, l = arguments.length; i < l; ++i) {\n        add(arguments[i]);\n    }\n    return rv;\n    function add(eventName, chainFunction, defaultFunction) {\n        if (typeof eventName === \'object\')\n            return addConfiguredEvents(eventName);\n        if (!chainFunction)\n            chainFunction = reverseStoppableEventChain;\n        if (!defaultFunction)\n            defaultFunction = nop;\n        var context = {\n            subscribers: [],\n            fire: defaultFunction,\n            subscribe: function (cb) {\n                if (context.subscribers.indexOf(cb) === -1) {\n                    context.subscribers.push(cb);\n                    context.fire = chainFunction(context.fire, cb);\n                }\n            },\n            unsubscribe: function (cb) {\n                context.subscribers = context.subscribers.filter(function (fn) { return fn !== cb; });\n                context.fire = context.subscribers.reduce(chainFunction, defaultFunction);\n            }\n        };\n        evs[eventName] = rv[eventName] = context;\n        return context;\n    }\n    function addConfiguredEvents(cfg) {\n        // events(this, {reading: [functionChain, nop]});\n        keys(cfg).forEach(function (eventName) {\n            var args = cfg[eventName];\n            if (isArray(args)) {\n                add(eventName, cfg[eventName][0], cfg[eventName][1]);\n            }\n            else if (args === \'asap\') {\n                // Rather than approaching event subscription using a functional approach, we here do it in a for-loop where subscriber is executed in its own stack\n                // enabling that any exception that occur wont disturb the initiator and also not nescessary be catched and forgotten.\n                var context = add(eventName, mirror, function fire() {\n                    // Optimazation-safe cloning of arguments into args.\n                    var i = arguments.length, args = new Array(i);\n                    while (i--)\n                        args[i] = arguments[i];\n                    // All each subscriber:\n                    context.subscribers.forEach(function (fn) {\n                        asap(function fireEvent() {\n                            fn.apply(null, args);\n                        });\n                    });\n                });\n            }\n            else\n                throw new exceptions.InvalidArgument("Invalid event config");\n        });\n    }\n}\n\n/*\n * Dexie.js - a minimalistic wrapper for IndexedDB\n * ===============================================\n *\n * Copyright (c) 2014-2017 David Fahlander\n *\n * Version {version}, {date}\n *\n * http://dexie.org\n *\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/LICENSE-2.0\n *\n */\nvar DEXIE_VERSION = \'{version}\';\nvar maxString = String.fromCharCode(65535);\nvar maxKey = (function () { try {\n    IDBKeyRange.only([[]]);\n    return [[]];\n}\ncatch (e) {\n    return maxString;\n} })();\nvar minKey = -Infinity;\nvar INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";\nvar STRING_EXPECTED = "String expected.";\nvar connections = [];\nvar isIEOrEdge = typeof navigator !== \'undefined\' && /(MSIE|Trident|Edge)/.test(navigator.userAgent);\nvar hasIEDeleteObjectStoreBug = isIEOrEdge;\nvar hangsOnDeleteLargeKeyRange = isIEOrEdge;\nvar dexieStackFrameFilter = function (frame) { return !/(dexie\\.js|dexie\\.min\\.js)/.test(frame); };\nvar dbNamesDB; // Global database for backing Dexie.getDatabaseNames() on browser without indexedDB.webkitGetDatabaseNames() \n// Init debug\nsetDebug(debug, dexieStackFrameFilter);\nfunction Dexie(dbName, options) {\n    /// <param name="options" type="Object" optional="true">Specify only if you wich to control which addons that should run on this instance</param>\n    var deps = Dexie.dependencies;\n    var opts = extend({\n        // Default Options\n        addons: Dexie.addons,\n        autoOpen: true,\n        indexedDB: deps.indexedDB,\n        IDBKeyRange: deps.IDBKeyRange // Backend IDBKeyRange api. Default to browser env.\n    }, options);\n    var addons = opts.addons, autoOpen = opts.autoOpen, indexedDB = opts.indexedDB, IDBKeyRange = opts.IDBKeyRange;\n    var globalSchema = this._dbSchema = {};\n    var versions = [];\n    var dbStoreNames = [];\n    var allTables = {};\n    ///<var type="IDBDatabase" />\n    var idbdb = null; // Instance of IDBDatabase\n    var dbOpenError = null;\n    var isBeingOpened = false;\n    var onReadyBeingFired = null;\n    var openComplete = false;\n    var READONLY = "readonly", READWRITE = "readwrite";\n    var db = this;\n    var dbReadyResolve, dbReadyPromise = new Promise(function (resolve) {\n        dbReadyResolve = resolve;\n    }), cancelOpen, openCanceller = new Promise(function (_, reject) {\n        cancelOpen = reject;\n    });\n    var autoSchema = true;\n    var hasNativeGetDatabaseNames = !!getNativeGetDatabaseNamesFn(indexedDB), hasGetAll;\n    function init() {\n        // Default subscribers to "versionchange" and "blocked".\n        // Can be overridden by custom handlers. If custom handlers return false, these default\n        // behaviours will be prevented.\n        db.on("versionchange", function (ev) {\n            // Default behavior for versionchange event is to close database connection.\n            // Caller can override this behavior by doing db.on("versionchange", function(){ return false; });\n            // Let\'s not block the other window from making it\'s delete() or open() call.\n            // NOTE! This event is never fired in IE,Edge or Safari.\n            if (ev.newVersion > 0)\n                console.warn("Another connection wants to upgrade database \'" + db.name + "\'. Closing db now to resume the upgrade.");\n            else\n                console.warn("Another connection wants to delete database \'" + db.name + "\'. Closing db now to resume the delete request.");\n            db.close();\n            // In many web applications, it would be recommended to force window.reload()\n            // when this event occurs. To do that, subscribe to the versionchange event\n            // and call window.location.reload(true) if ev.newVersion > 0 (not a deletion)\n            // The reason for this is that your current web app obviously has old schema code that needs\n            // to be updated. Another window got a newer version of the app and needs to upgrade DB but\n            // your window is blocking it unless we close it here.\n        });\n        db.on("blocked", function (ev) {\n            if (!ev.newVersion || ev.newVersion < ev.oldVersion)\n                console.warn("Dexie.delete(\'" + db.name + "\') was blocked");\n            else\n                console.warn("Upgrade \'" + db.name + "\' blocked by other connection holding version " + ev.oldVersion / 10);\n        });\n    }\n    //\n    //\n    //\n    // ------------------------- Versioning Framework---------------------------\n    //\n    //\n    //\n    this.version = function (versionNumber) {\n        /// <param name="versionNumber" type="Number"></param>\n        /// <returns type="Version"></returns>\n        if (idbdb || isBeingOpened)\n            throw new exceptions.Schema("Cannot add version when database is open");\n        this.verno = Math.max(this.verno, versionNumber);\n        var versionInstance = versions.filter(function (v) { return v._cfg.version === versionNumber; })[0];\n        if (versionInstance)\n            return versionInstance;\n        versionInstance = new Version(versionNumber);\n        versions.push(versionInstance);\n        versions.sort(lowerVersionFirst);\n        // Disable autoschema mode, as at least one version is specified.\n        autoSchema = false;\n        return versionInstance;\n    };\n    function Version(versionNumber) {\n        this._cfg = {\n            version: versionNumber,\n            storesSource: null,\n            dbschema: {},\n            tables: {},\n            contentUpgrade: null\n        };\n        this.stores({}); // Derive earlier schemas by default.\n    }\n    extend(Version.prototype, {\n        stores: function (stores) {\n            /// <summary>\n            ///   Defines the schema for a particular version\n            /// </summary>\n            /// <param name="stores" type="Object">\n            /// Example: <br/>\n            ///   {users: "id++,first,last,&amp;username,*email", <br/>\n            ///   passwords: "id++,&amp;username"}<br/>\n            /// <br/>\n            /// Syntax: {Table: "[primaryKey][++],[&amp;][*]index1,[&amp;][*]index2,..."}<br/><br/>\n            /// Special characters:<br/>\n            ///  "&amp;"  means unique key, <br/>\n            ///  "*"  means value is multiEntry, <br/>\n            ///  "++" means auto-increment and only applicable for primary key <br/>\n            /// </param>\n            this._cfg.storesSource = this._cfg.storesSource ? extend(this._cfg.storesSource, stores) : stores;\n            // Derive stores from earlier versions if they are not explicitely specified as null or a new syntax.\n            var storesSpec = {};\n            versions.forEach(function (version) {\n                extend(storesSpec, version._cfg.storesSource);\n            });\n            var dbschema = (this._cfg.dbschema = {});\n            this._parseStoresSpec(storesSpec, dbschema);\n            // Update the latest schema to this version\n            // Update API\n            globalSchema = db._dbSchema = dbschema;\n            removeTablesApi([allTables, db, Transaction.prototype]); // Keep Transaction.prototype even though it should be depr.\n            setApiOnPlace([allTables, db, Transaction.prototype, this._cfg.tables], keys(dbschema), dbschema);\n            dbStoreNames = keys(dbschema);\n            return this;\n        },\n        upgrade: function (upgradeFunction) {\n            this._cfg.contentUpgrade = upgradeFunction;\n            return this;\n        },\n        _parseStoresSpec: function (stores, outSchema) {\n            keys(stores).forEach(function (tableName) {\n                if (stores[tableName] !== null) {\n                    var instanceTemplate = {};\n                    var indexes = parseIndexSyntax(stores[tableName]);\n                    var primKey = indexes.shift();\n                    if (primKey.multi)\n                        throw new exceptions.Schema("Primary key cannot be multi-valued");\n                    if (primKey.keyPath)\n                        setByKeyPath(instanceTemplate, primKey.keyPath, primKey.auto ? 0 : primKey.keyPath);\n                    indexes.forEach(function (idx) {\n                        if (idx.auto)\n                            throw new exceptions.Schema("Only primary key can be marked as autoIncrement (++)");\n                        if (!idx.keyPath)\n                            throw new exceptions.Schema("Index must have a name and cannot be an empty string");\n                        setByKeyPath(instanceTemplate, idx.keyPath, idx.compound ? idx.keyPath.map(function () { return ""; }) : "");\n                    });\n                    outSchema[tableName] = new TableSchema(tableName, primKey, indexes, instanceTemplate);\n                }\n            });\n        }\n    });\n    function runUpgraders(oldVersion, idbtrans, reject) {\n        var trans = db._createTransaction(READWRITE, dbStoreNames, globalSchema);\n        trans.create(idbtrans);\n        trans._completion.catch(reject);\n        var rejectTransaction = trans._reject.bind(trans);\n        newScope(function () {\n            PSD.trans = trans;\n            if (oldVersion === 0) {\n                // Create tables:\n                keys(globalSchema).forEach(function (tableName) {\n                    createTable(idbtrans, tableName, globalSchema[tableName].primKey, globalSchema[tableName].indexes);\n                });\n                Promise.follow(function () { return db.on.populate.fire(trans); }).catch(rejectTransaction);\n            }\n            else\n                updateTablesAndIndexes(oldVersion, trans, idbtrans).catch(rejectTransaction);\n        });\n    }\n    function updateTablesAndIndexes(oldVersion, trans, idbtrans) {\n        // Upgrade version to version, step-by-step from oldest to newest version.\n        // Each transaction object will contain the table set that was current in that version (but also not-yet-deleted tables from its previous version)\n        var queue = [];\n        var oldVersionStruct = versions.filter(function (version) { return version._cfg.version === oldVersion; })[0];\n        if (!oldVersionStruct)\n            throw new exceptions.Upgrade("Dexie specification of currently installed DB version is missing");\n        globalSchema = db._dbSchema = oldVersionStruct._cfg.dbschema;\n        var anyContentUpgraderHasRun = false;\n        var versToRun = versions.filter(function (v) { return v._cfg.version > oldVersion; });\n        versToRun.forEach(function (version) {\n            /// <param name="version" type="Version"></param>\n            queue.push(function () {\n                var oldSchema = globalSchema;\n                var newSchema = version._cfg.dbschema;\n                adjustToExistingIndexNames(oldSchema, idbtrans);\n                adjustToExistingIndexNames(newSchema, idbtrans);\n                globalSchema = db._dbSchema = newSchema;\n                var diff = getSchemaDiff(oldSchema, newSchema);\n                // Add tables           \n                diff.add.forEach(function (tuple) {\n                    createTable(idbtrans, tuple[0], tuple[1].primKey, tuple[1].indexes);\n                });\n                // Change tables\n                diff.change.forEach(function (change) {\n                    if (change.recreate) {\n                        throw new exceptions.Upgrade("Not yet support for changing primary key");\n                    }\n                    else {\n                        var store = idbtrans.objectStore(change.name);\n                        // Add indexes\n                        change.add.forEach(function (idx) {\n                            addIndex(store, idx);\n                        });\n                        // Update indexes\n                        change.change.forEach(function (idx) {\n                            store.deleteIndex(idx.name);\n                            addIndex(store, idx);\n                        });\n                        // Delete indexes\n                        change.del.forEach(function (idxName) {\n                            store.deleteIndex(idxName);\n                        });\n                    }\n                });\n                if (version._cfg.contentUpgrade) {\n                    anyContentUpgraderHasRun = true;\n                    return Promise.follow(function () {\n                        version._cfg.contentUpgrade(trans);\n                    });\n                }\n            });\n            queue.push(function (idbtrans) {\n                if (!anyContentUpgraderHasRun || !hasIEDeleteObjectStoreBug) {\n                    var newSchema = version._cfg.dbschema;\n                    // Delete old tables\n                    deleteRemovedTables(newSchema, idbtrans);\n                }\n            });\n        });\n        // Now, create a queue execution engine\n        function runQueue() {\n            return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) :\n                Promise.resolve();\n        }\n        return runQueue().then(function () {\n            createMissingTables(globalSchema, idbtrans); // At last, make sure to create any missing tables. (Needed by addons that add stores to DB without specifying version)\n        });\n    }\n    function getSchemaDiff(oldSchema, newSchema) {\n        var diff = {\n            del: [],\n            add: [],\n            change: [] // Array of {name: tableName, recreate: newDefinition, del: delIndexNames, add: newIndexDefs, change: changedIndexDefs}\n        };\n        for (var table in oldSchema) {\n            if (!newSchema[table])\n                diff.del.push(table);\n        }\n        for (table in newSchema) {\n            var oldDef = oldSchema[table], newDef = newSchema[table];\n            if (!oldDef) {\n                diff.add.push([table, newDef]);\n            }\n            else {\n                var change = {\n                    name: table,\n                    def: newDef,\n                    recreate: false,\n                    del: [],\n                    add: [],\n                    change: []\n                };\n                if (oldDef.primKey.src !== newDef.primKey.src) {\n                    // Primary key has changed. Remove and re-add table.\n                    change.recreate = true;\n                    diff.change.push(change);\n                }\n                else {\n                    // Same primary key. Just find out what differs:\n                    var oldIndexes = oldDef.idxByName;\n                    var newIndexes = newDef.idxByName;\n                    for (var idxName in oldIndexes) {\n                        if (!newIndexes[idxName])\n                            change.del.push(idxName);\n                    }\n                    for (idxName in newIndexes) {\n                        var oldIdx = oldIndexes[idxName], newIdx = newIndexes[idxName];\n                        if (!oldIdx)\n                            change.add.push(newIdx);\n                        else if (oldIdx.src !== newIdx.src)\n                            change.change.push(newIdx);\n                    }\n                    if (change.del.length > 0 || change.add.length > 0 || change.change.length > 0) {\n                        diff.change.push(change);\n                    }\n                }\n            }\n        }\n        return diff;\n    }\n    function createTable(idbtrans, tableName, primKey, indexes) {\n        /// <param name="idbtrans" type="IDBTransaction"></param>\n        var store = idbtrans.db.createObjectStore(tableName, primKey.keyPath ? { keyPath: primKey.keyPath, autoIncrement: primKey.auto } : { autoIncrement: primKey.auto });\n        indexes.forEach(function (idx) { addIndex(store, idx); });\n        return store;\n    }\n    function createMissingTables(newSchema, idbtrans) {\n        keys(newSchema).forEach(function (tableName) {\n            if (!idbtrans.db.objectStoreNames.contains(tableName)) {\n                createTable(idbtrans, tableName, newSchema[tableName].primKey, newSchema[tableName].indexes);\n            }\n        });\n    }\n    function deleteRemovedTables(newSchema, idbtrans) {\n        for (var i = 0; i < idbtrans.db.objectStoreNames.length; ++i) {\n            var storeName = idbtrans.db.objectStoreNames[i];\n            if (newSchema[storeName] == null) {\n                idbtrans.db.deleteObjectStore(storeName);\n            }\n        }\n    }\n    function addIndex(store, idx) {\n        store.createIndex(idx.name, idx.keyPath, { unique: idx.unique, multiEntry: idx.multi });\n    }\n    //\n    //\n    //      Dexie Protected API\n    //\n    //\n    this._allTables = allTables;\n    this._createTransaction = function (mode, storeNames, dbschema, parentTransaction) {\n        return new Transaction(mode, storeNames, dbschema, parentTransaction);\n    };\n    /* Generate a temporary transaction when db operations are done outside a transaction scope.\n    */\n    function tempTransaction(mode, storeNames, fn) {\n        if (!openComplete && (!PSD.letThrough)) {\n            if (!isBeingOpened) {\n                if (!autoOpen)\n                    return rejection(new exceptions.DatabaseClosed());\n                db.open().catch(nop); // Open in background. If if fails, it will be catched by the final promise anyway.\n            }\n            return dbReadyPromise.then(function () { return tempTransaction(mode, storeNames, fn); });\n        }\n        else {\n            var trans = db._createTransaction(mode, storeNames, globalSchema);\n            try {\n                trans.create();\n            }\n            catch (ex) {\n                return rejection(ex);\n            }\n            return trans._promise(mode, function (resolve, reject) {\n                return newScope(function () {\n                    PSD.trans = trans;\n                    return fn(resolve, reject, trans);\n                });\n            }).then(function (result) {\n                // Instead of resolving value directly, wait with resolving it until transaction has completed.\n                // Otherwise the data would not be in the DB if requesting it in the then() operation.\n                // Specifically, to ensure that the following expression will work:\n                //\n                //   db.friends.put({name: "Arne"}).then(function () {\n                //       db.friends.where("name").equals("Arne").count(function(count) {\n                //           assert (count === 1);\n                //       });\n                //   });\n                //\n                return trans._completion.then(function () { return result; });\n            }); /*.catch(err => { // Don\'t do this as of now. If would affect bulk- and modify methods in a way that could be more intuitive. But wait! Maybe change in next major.\n                trans._reject(err);\n                return rejection(err);\n            });*/\n        }\n    }\n    this._whenReady = function (fn) {\n        return openComplete || PSD.letThrough ? fn() : new Promise(function (resolve, reject) {\n            if (!isBeingOpened) {\n                if (!autoOpen) {\n                    reject(new exceptions.DatabaseClosed());\n                    return;\n                }\n                db.open().catch(nop); // Open in background. If if fails, it will be catched by the final promise anyway.\n            }\n            dbReadyPromise.then(resolve, reject);\n        }).then(fn);\n    };\n    //\n    //\n    //\n    //\n    //      Dexie API\n    //\n    //\n    //\n    this.verno = 0;\n    this.open = function () {\n        if (isBeingOpened || idbdb)\n            return dbReadyPromise.then(function () { return dbOpenError ? rejection(dbOpenError) : db; });\n        debug && (openCanceller._stackHolder = getErrorWithStack()); // Let stacks point to when open() was called rather than where new Dexie() was called.\n        isBeingOpened = true;\n        dbOpenError = null;\n        openComplete = false;\n        // Function pointers to call when the core opening process completes.\n        var resolveDbReady = dbReadyResolve, \n        // upgradeTransaction to abort on failure.\n        upgradeTransaction = null;\n        return Promise.race([openCanceller, new Promise(function (resolve, reject) {\n                // Multiply db.verno with 10 will be needed to workaround upgrading bug in IE:\n                // IE fails when deleting objectStore after reading from it.\n                // A future version of Dexie.js will stopover an intermediate version to workaround this.\n                // At that point, we want to be backward compatible. Could have been multiplied with 2, but by using 10, it is easier to map the number to the real version number.\n                // If no API, throw!\n                if (!indexedDB)\n                    throw new exceptions.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL " +\n                        "(not locally). If using old Safari versions, make sure to include indexedDB polyfill.");\n                var req = autoSchema ? indexedDB.open(dbName) : indexedDB.open(dbName, Math.round(db.verno * 10));\n                if (!req)\n                    throw new exceptions.MissingAPI("IndexedDB API not available"); // May happen in Safari private mode, see https://github.com/dfahlander/Dexie.js/issues/134\n                req.onerror = eventRejectHandler(reject);\n                req.onblocked = wrap(fireOnBlocked);\n                req.onupgradeneeded = wrap(function (e) {\n                    upgradeTransaction = req.transaction;\n                    if (autoSchema && !db._allowEmptyDB) {\n                        // Caller did not specify a version or schema. Doing that is only acceptable for opening alread existing databases.\n                        // If onupgradeneeded is called it means database did not exist. Reject the open() promise and make sure that we\n                        // do not create a new database by accident here.\n                        req.onerror = preventDefault; // Prohibit onabort error from firing before we\'re done!\n                        upgradeTransaction.abort(); // Abort transaction (would hope that this would make DB disappear but it doesnt.)\n                        // Close database and delete it.\n                        req.result.close();\n                        var delreq = indexedDB.deleteDatabase(dbName); // The upgrade transaction is atomic, and javascript is single threaded - meaning that there is no risk that we delete someone elses database here!\n                        delreq.onsuccess = delreq.onerror = wrap(function () {\n                            reject(new exceptions.NoSuchDatabase("Database " + dbName + " doesnt exist"));\n                        });\n                    }\n                    else {\n                        upgradeTransaction.onerror = eventRejectHandler(reject);\n                        var oldVer = e.oldVersion > Math.pow(2, 62) ? 0 : e.oldVersion; // Safari 8 fix.\n                        runUpgraders(oldVer / 10, upgradeTransaction, reject, req);\n                    }\n                }, reject);\n                req.onsuccess = wrap(function () {\n                    // Core opening procedure complete. Now let\'s just record some stuff.\n                    upgradeTransaction = null;\n                    idbdb = req.result;\n                    connections.push(db); // Used for emulating versionchange event on IE/Edge/Safari.\n                    if (autoSchema)\n                        readGlobalSchema();\n                    else if (idbdb.objectStoreNames.length > 0) {\n                        try {\n                            adjustToExistingIndexNames(globalSchema, idbdb.transaction(safariMultiStoreFix(idbdb.objectStoreNames), READONLY));\n                        }\n                        catch (e) {\n                            // Safari may bail out if > 1 store names. However, this shouldnt be a showstopper. Issue #120.\n                        }\n                    }\n                    idbdb.onversionchange = wrap(function (ev) {\n                        db._vcFired = true; // detect implementations that not support versionchange (IE/Edge/Safari)\n                        db.on("versionchange").fire(ev);\n                    });\n                    if (!hasNativeGetDatabaseNames && dbName !== \'__dbnames\') {\n                        dbNamesDB.dbnames.put({ name: dbName }).catch(nop);\n                    }\n                    resolve();\n                }, reject);\n            })]).then(function () {\n            // Before finally resolving the dbReadyPromise and this promise,\n            // call and await all on(\'ready\') subscribers:\n            // Dexie.vip() makes subscribers able to use the database while being opened.\n            // This is a must since these subscribers take part of the opening procedure.\n            onReadyBeingFired = [];\n            return Promise.resolve(Dexie.vip(db.on.ready.fire)).then(function fireRemainders() {\n                if (onReadyBeingFired.length > 0) {\n                    // In case additional subscribers to db.on(\'ready\') were added during the time db.on.ready.fire was executed.\n                    var remainders = onReadyBeingFired.reduce(promisableChain, nop);\n                    onReadyBeingFired = [];\n                    return Promise.resolve(Dexie.vip(remainders)).then(fireRemainders);\n                }\n            });\n        }).finally(function () {\n            onReadyBeingFired = null;\n        }).then(function () {\n            // Resolve the db.open() with the db instance.\n            isBeingOpened = false;\n            return db;\n        }).catch(function (err) {\n            try {\n                // Did we fail within onupgradeneeded? Make sure to abort the upgrade transaction so it doesnt commit.\n                upgradeTransaction && upgradeTransaction.abort();\n            }\n            catch (e) { }\n            isBeingOpened = false; // Set before calling db.close() so that it doesnt reject openCanceller again (leads to unhandled rejection event).\n            db.close(); // Closes and resets idbdb, removes connections, resets dbReadyPromise and openCanceller so that a later db.open() is fresh.\n            // A call to db.close() may have made on-ready subscribers fail. Use dbOpenError if set, since err could be a follow-up error on that.\n            dbOpenError = err; // Record the error. It will be used to reject further promises of db operations.\n            return rejection(dbOpenError);\n        }).finally(function () {\n            openComplete = true;\n            resolveDbReady(); // dbReadyPromise is resolved no matter if open() rejects or resolved. It\'s just to wake up waiters.\n        });\n    };\n    this.close = function () {\n        var idx = connections.indexOf(db);\n        if (idx >= 0)\n            connections.splice(idx, 1);\n        if (idbdb) {\n            try {\n                idbdb.close();\n            }\n            catch (e) { }\n            idbdb = null;\n        }\n        autoOpen = false;\n        dbOpenError = new exceptions.DatabaseClosed();\n        if (isBeingOpened)\n            cancelOpen(dbOpenError);\n        // Reset dbReadyPromise promise:\n        dbReadyPromise = new Promise(function (resolve) {\n            dbReadyResolve = resolve;\n        });\n        openCanceller = new Promise(function (_, reject) {\n            cancelOpen = reject;\n        });\n    };\n    this.delete = function () {\n        var hasArguments = arguments.length > 0;\n        return new Promise(function (resolve, reject) {\n            if (hasArguments)\n                throw new exceptions.InvalidArgument("Arguments not allowed in db.delete()");\n            if (isBeingOpened) {\n                dbReadyPromise.then(doDelete);\n            }\n            else {\n                doDelete();\n            }\n            function doDelete() {\n                db.close();\n                var req = indexedDB.deleteDatabase(dbName);\n                req.onsuccess = wrap(function () {\n                    if (!hasNativeGetDatabaseNames) {\n                        dbNamesDB.dbnames.delete(dbName).catch(nop);\n                    }\n                    resolve();\n                });\n                req.onerror = eventRejectHandler(reject);\n                req.onblocked = fireOnBlocked;\n            }\n        });\n    };\n    this.backendDB = function () {\n        return idbdb;\n    };\n    this.isOpen = function () {\n        return idbdb !== null;\n    };\n    this.hasBeenClosed = function () {\n        return dbOpenError && (dbOpenError instanceof exceptions.DatabaseClosed);\n    };\n    this.hasFailed = function () {\n        return dbOpenError !== null;\n    };\n    this.dynamicallyOpened = function () {\n        return autoSchema;\n    };\n    //\n    // Properties\n    //\n    this.name = dbName;\n    // db.tables - an array of all Table instances.\n    props(this, {\n        tables: {\n            get: function () {\n                /// <returns type="Array" elementType="Table" />\n                return keys(allTables).map(function (name) { return allTables[name]; });\n            }\n        }\n    });\n    //\n    // Events\n    //\n    this.on = Events(this, "populate", "blocked", "versionchange", { ready: [promisableChain, nop] });\n    this.on.ready.subscribe = override(this.on.ready.subscribe, function (subscribe) {\n        return function (subscriber, bSticky) {\n            Dexie.vip(function () {\n                if (openComplete) {\n                    // Database already open. Call subscriber asap.\n                    if (!dbOpenError)\n                        Promise.resolve().then(subscriber);\n                    // bSticky: Also subscribe to future open sucesses (after close / reopen) \n                    if (bSticky)\n                        subscribe(subscriber);\n                }\n                else if (onReadyBeingFired) {\n                    // db.on(\'ready\') subscribers are currently being executed and have not yet resolved or rejected\n                    onReadyBeingFired.push(subscriber);\n                    if (bSticky)\n                        subscribe(subscriber);\n                }\n                else {\n                    // Database not yet open. Subscribe to it.\n                    subscribe(subscriber);\n                    // If bSticky is falsy, make sure to unsubscribe subscriber when fired once.\n                    if (!bSticky)\n                        subscribe(function unsubscribe() {\n                            db.on.ready.unsubscribe(subscriber);\n                            db.on.ready.unsubscribe(unsubscribe);\n                        });\n                }\n            });\n        };\n    });\n    this.transaction = function () {\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name="mode" type="String">"r" for readonly, or "rw" for readwrite</param>\n        /// <param name="tableInstances">Table instance, Array of Table instances, String or String Array of object stores to include in the transaction</param>\n        /// <param name="scopeFunc" type="Function">Function to execute with transaction</param>\n        var args = extractTransactionArgs.apply(this, arguments);\n        return this._transaction.apply(this, args);\n    };\n    function extractTransactionArgs(mode, _tableArgs_, scopeFunc) {\n        // Let table arguments be all arguments between mode and last argument.\n        var i = arguments.length;\n        if (i < 2)\n            throw new exceptions.InvalidArgument("Too few arguments");\n        // Prevent optimzation killer (https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments)\n        // and clone arguments except the first one into local var \'args\'.\n        var args = new Array(i - 1);\n        while (--i)\n            args[i - 1] = arguments[i];\n        // Let scopeFunc be the last argument and pop it so that args now only contain the table arguments.\n        scopeFunc = args.pop();\n        var tables = flatten(args); // Support using array as middle argument, or a mix of arrays and non-arrays.\n        return [mode, tables, scopeFunc];\n    }\n    this._transaction = function (mode, tables, scopeFunc) {\n        var parentTransaction = PSD.trans;\n        // Check if parent transactions is bound to this db instance, and if caller wants to reuse it\n        if (!parentTransaction || parentTransaction.db !== db || mode.indexOf(\'!\') !== -1)\n            parentTransaction = null;\n        var onlyIfCompatible = mode.indexOf(\'?\') !== -1;\n        mode = mode.replace(\'!\', \'\').replace(\'?\', \'\'); // Ok. Will change arguments[0] as well but we wont touch arguments henceforth.\n        try {\n            //\n            // Get storeNames from arguments. Either through given table instances, or through given table names.\n            //\n            var storeNames = tables.map(function (table) {\n                var storeName = table instanceof Table ? table.name : table;\n                if (typeof storeName !== \'string\')\n                    throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");\n                return storeName;\n            });\n            //\n            // Resolve mode. Allow shortcuts "r" and "rw".\n            //\n            if (mode == "r" || mode == READONLY)\n                mode = READONLY;\n            else if (mode == "rw" || mode == READWRITE)\n                mode = READWRITE;\n            else\n                throw new exceptions.InvalidArgument("Invalid transaction mode: " + mode);\n            if (parentTransaction) {\n                // Basic checks\n                if (parentTransaction.mode === READONLY && mode === READWRITE) {\n                    if (onlyIfCompatible) {\n                        // Spawn new transaction instead.\n                        parentTransaction = null;\n                    }\n                    else\n                        throw new exceptions.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");\n                }\n                if (parentTransaction) {\n                    storeNames.forEach(function (storeName) {\n                        if (parentTransaction && parentTransaction.storeNames.indexOf(storeName) === -1) {\n                            if (onlyIfCompatible) {\n                                // Spawn new transaction instead.\n                                parentTransaction = null;\n                            }\n                            else\n                                throw new exceptions.SubTransaction("Table " + storeName +\n                                    " not included in parent transaction.");\n                        }\n                    });\n                }\n                if (onlyIfCompatible && parentTransaction && !parentTransaction.active) {\n                    // \'?\' mode should not keep using an inactive transaction.\n                    parentTransaction = null;\n                }\n            }\n        }\n        catch (e) {\n            return parentTransaction ?\n                parentTransaction._promise(null, function (_, reject) { reject(e); }) :\n                rejection(e);\n        }\n        // If this is a sub-transaction, lock the parent and then launch the sub-transaction.\n        return (parentTransaction ?\n            parentTransaction._promise(mode, enterTransactionScope, "lock") :\n            PSD.trans ?\n                // no parent transaction despite PSD.trans exists. Make sure also\n                // that the zone we create is not a sub-zone of current, because\n                // Promise.follow() should not wait for it if so.\n                usePSD(PSD.transless, function () { return db._whenReady(enterTransactionScope); }) :\n                db._whenReady(enterTransactionScope));\n        function enterTransactionScope() {\n            return Promise.resolve().then(function () {\n                // Keep a pointer to last non-transactional PSD to use if someone calls Dexie.ignoreTransaction().\n                var transless = PSD.transless || PSD;\n                // Our transaction.\n                //return new Promise((resolve, reject) => {\n                var trans = db._createTransaction(mode, storeNames, globalSchema, parentTransaction);\n                // Let the transaction instance be part of a Promise-specific data (PSD) value.\n                var zoneProps = {\n                    trans: trans,\n                    transless: transless\n                };\n                if (parentTransaction) {\n                    // Emulate transaction commit awareness for inner transaction (must \'commit\' when the inner transaction has no more operations ongoing)\n                    trans.idbtrans = parentTransaction.idbtrans;\n                }\n                else {\n                    trans.create(); // Create the backend transaction so that complete() or error() will trigger even if no operation is made upon it.\n                }\n                // Support for native async await.\n                if (scopeFunc.constructor === AsyncFunction) {\n                    incrementExpectedAwaits();\n                }\n                var returnValue;\n                var promiseFollowed = Promise.follow(function () {\n                    // Finally, call the scope function with our table and transaction arguments.\n                    returnValue = scopeFunc.call(trans, trans);\n                    if (returnValue) {\n                        if (returnValue.constructor === NativePromise) {\n                            var decrementor = decrementExpectedAwaits.bind(null, null);\n                            returnValue.then(decrementor, decrementor);\n                        }\n                        else if (typeof returnValue.next === \'function\' && typeof returnValue.throw === \'function\') {\n                            // scopeFunc returned an iterator with throw-support. Handle yield as await.\n                            returnValue = awaitIterator(returnValue);\n                        }\n                    }\n                }, zoneProps);\n                return (returnValue && typeof returnValue.then === \'function\' ?\n                    // Promise returned. User uses promise-style transactions.\n                    Promise.resolve(returnValue).then(function (x) { return trans.active ?\n                        x // Transaction still active. Continue.\n                        : rejection(new exceptions.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")); })\n                    // No promise returned. Wait for all outstanding promises before continuing. \n                    : promiseFollowed.then(function () { return returnValue; })).then(function (x) {\n                    // sub transactions don\'t react to idbtrans.oncomplete. We must trigger a completion:\n                    if (parentTransaction)\n                        trans._resolve();\n                    // wait for trans._completion\n                    // (if root transaction, this means \'complete\' event. If sub-transaction, we\'ve just fired it ourselves)\n                    return trans._completion.then(function () { return x; });\n                }).catch(function (e) {\n                    trans._reject(e); // Yes, above then-handler were maybe not called because of an unhandled rejection in scopeFunc!\n                    return rejection(e);\n                });\n            });\n        }\n    };\n    this.table = function (tableName) {\n        /// <returns type="Table"></returns>\n        if (!hasOwn(allTables, tableName)) {\n            throw new exceptions.InvalidTable("Table " + tableName + " does not exist");\n        }\n        return allTables[tableName];\n    };\n    //\n    //\n    //\n    // Table Class\n    //\n    //\n    //\n    function Table(name, tableSchema, optionalTrans) {\n        /// <param name="name" type="String"></param>\n        this.name = name;\n        this.schema = tableSchema;\n        this._tx = optionalTrans;\n        this.hook = allTables[name] ? allTables[name].hook : Events(null, {\n            "creating": [hookCreatingChain, nop],\n            "reading": [pureFunctionChain, mirror],\n            "updating": [hookUpdatingChain, nop],\n            "deleting": [hookDeletingChain, nop]\n        });\n    }\n    function BulkErrorHandlerCatchAll(errorList, done, supportHooks) {\n        return (supportHooks ? hookedEventRejectHandler : eventRejectHandler)(function (e) {\n            errorList.push(e);\n            done && done();\n        });\n    }\n    function bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook) {\n        // If hasDeleteHook, keysOrTuples must be an array of tuples: [[key1, value2],[key2,value2],...],\n        // else keysOrTuples must be just an array of keys: [key1, key2, ...].\n        return new Promise(function (resolve, reject) {\n            var len = keysOrTuples.length, lastItem = len - 1;\n            if (len === 0)\n                return resolve();\n            if (!hasDeleteHook) {\n                for (var i = 0; i < len; ++i) {\n                    var req = idbstore.delete(keysOrTuples[i]);\n                    req.onerror = eventRejectHandler(reject);\n                    if (i === lastItem)\n                        req.onsuccess = wrap(function () { return resolve(); });\n                }\n            }\n            else {\n                var hookCtx, errorHandler = hookedEventRejectHandler(reject), successHandler = hookedEventSuccessHandler(null);\n                tryCatch(function () {\n                    for (var i = 0; i < len; ++i) {\n                        hookCtx = { onsuccess: null, onerror: null };\n                        var tuple = keysOrTuples[i];\n                        deletingHook.call(hookCtx, tuple[0], tuple[1], trans);\n                        var req = idbstore.delete(tuple[0]);\n                        req._hookCtx = hookCtx;\n                        req.onerror = errorHandler;\n                        if (i === lastItem)\n                            req.onsuccess = hookedEventSuccessHandler(resolve);\n                        else\n                            req.onsuccess = successHandler;\n                    }\n                }, function (err) {\n                    hookCtx.onerror && hookCtx.onerror(err);\n                    throw err;\n                });\n            }\n        });\n    }\n    props(Table.prototype, {\n        //\n        // Table Protected Methods\n        //\n        _trans: function getTransaction(mode, fn, writeLocked) {\n            var trans = this._tx || PSD.trans;\n            return trans && trans.db === db ?\n                trans === PSD.trans ?\n                    trans._promise(mode, fn, writeLocked) :\n                    newScope(function () { return trans._promise(mode, fn, writeLocked); }, { trans: trans, transless: PSD.transless || PSD }) :\n                tempTransaction(mode, [this.name], fn);\n        },\n        _idbstore: function getIDBObjectStore(mode, fn, writeLocked) {\n            var tableName = this.name;\n            function supplyIdbStore(resolve, reject, trans) {\n                if (trans.storeNames.indexOf(tableName) === -1)\n                    throw new exceptions.NotFound("Table" + tableName + " not part of transaction");\n                return fn(resolve, reject, trans.idbtrans.objectStore(tableName), trans);\n            }\n            return this._trans(mode, supplyIdbStore, writeLocked);\n        },\n        //\n        // Table Public Methods\n        //\n        get: function (keyOrCrit, cb) {\n            if (keyOrCrit && keyOrCrit.constructor === Object)\n                return this.where(keyOrCrit).first(cb);\n            var self = this;\n            return this._idbstore(READONLY, function (resolve, reject, idbstore) {\n                var req = idbstore.get(keyOrCrit);\n                req.onerror = eventRejectHandler(reject);\n                req.onsuccess = wrap(function () {\n                    resolve(self.hook.reading.fire(req.result));\n                }, reject);\n            }).then(cb);\n        },\n        where: function (indexOrCrit) {\n            if (typeof indexOrCrit === \'string\')\n                return new WhereClause(this, indexOrCrit);\n            if (isArray(indexOrCrit))\n                return new WhereClause(this, "[" + indexOrCrit.join(\'+\') + "]");\n            // indexOrCrit is an object map of {[keyPath]:value} \n            var keyPaths = keys(indexOrCrit);\n            if (keyPaths.length === 1)\n                // Only one critera. This was the easy case:\n                return this\n                    .where(keyPaths[0])\n                    .equals(indexOrCrit[keyPaths[0]]);\n            // Multiple criterias.\n            // Let\'s try finding a compound index that matches all keyPaths in\n            // arbritary order:\n            var compoundIndex = this.schema.indexes.concat(this.schema.primKey).filter(function (ix) {\n                return ix.compound &&\n                    keyPaths.every(function (keyPath) { return ix.keyPath.indexOf(keyPath) >= 0; }) &&\n                    ix.keyPath.every(function (keyPath) { return keyPaths.indexOf(keyPath) >= 0; });\n            })[0];\n            if (compoundIndex && maxKey !== maxString)\n                // Cool! We found such compound index\n                // and this browser supports compound indexes (maxKey !== maxString)!\n                return this\n                    .where(compoundIndex.name)\n                    .equals(compoundIndex.keyPath.map(function (kp) { return indexOrCrit[kp]; }));\n            if (!compoundIndex)\n                console.warn("The query " + JSON.stringify(indexOrCrit) + " on " + this.name + " would benefit of a " +\n                    ("compound index [" + keyPaths.join(\'+\') + "]"));\n            // Ok, now let\'s fallback to finding at least one matching index\n            // and filter the rest.\n            var idxByName = this.schema.idxByName;\n            var simpleIndex = keyPaths.reduce(function (r, keyPath) { return [\n                r[0] || idxByName[keyPath],\n                r[0] || !idxByName[keyPath] ?\n                    combine(r[1], function (x) { return \'\' + getByKeyPath(x, keyPath) ==\n                        \'\' + indexOrCrit[keyPath]; })\n                    : r[1]\n            ]; }, [null, null]);\n            var idx = simpleIndex[0];\n            return idx ?\n                this.where(idx.name).equals(indexOrCrit[idx.keyPath])\n                    .filter(simpleIndex[1]) :\n                compoundIndex ?\n                    this.filter(simpleIndex[1]) : // Has compound but browser bad. Allow filter.\n                    this.where(keyPaths).equals(\'\'); // No index at all. Fail lazily.\n        },\n        count: function (cb) {\n            return this.toCollection().count(cb);\n        },\n        offset: function (offset) {\n            return this.toCollection().offset(offset);\n        },\n        limit: function (numRows) {\n            return this.toCollection().limit(numRows);\n        },\n        reverse: function () {\n            return this.toCollection().reverse();\n        },\n        filter: function (filterFunction) {\n            return this.toCollection().and(filterFunction);\n        },\n        each: function (fn) {\n            return this.toCollection().each(fn);\n        },\n        toArray: function (cb) {\n            return this.toCollection().toArray(cb);\n        },\n        orderBy: function (index) {\n            return new Collection(new WhereClause(this, isArray(index) ?\n                "[" + index.join(\'+\') + "]" :\n                index));\n        },\n        toCollection: function () {\n            return new Collection(new WhereClause(this));\n        },\n        mapToClass: function (constructor, structure) {\n            /// <summary>\n            ///     Map table to a javascript constructor function. Objects returned from the database will be instances of this class, making\n            ///     it possible to the instanceOf operator as well as extending the class using constructor.prototype.method = function(){...}.\n            /// </summary>\n            /// <param name="constructor">Constructor function representing the class.</param>\n            /// <param name="structure" optional="true">Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\n            /// know what type each member has. Example: {name: String, emailAddresses: [String], password}</param>\n            this.schema.mappedClass = constructor;\n            var instanceTemplate = Object.create(constructor.prototype);\n            if (structure) {\n                // structure and instanceTemplate is for IDE code competion only while constructor.prototype is for actual inheritance.\n                applyStructure(instanceTemplate, structure);\n            }\n            this.schema.instanceTemplate = instanceTemplate;\n            // Now, subscribe to the when("reading") event to make all objects that come out from this table inherit from given class\n            // no matter which method to use for reading (Table.get() or Table.where(...)... )\n            var readHook = function (obj) {\n                if (!obj)\n                    return obj; // No valid object. (Value is null). Return as is.\n                // Create a new object that derives from constructor:\n                var res = Object.create(constructor.prototype);\n                // Clone members:\n                for (var m in obj)\n                    if (hasOwn(obj, m))\n                        try {\n                            res[m] = obj[m];\n                        }\n                        catch (_) { }\n                return res;\n            };\n            if (this.schema.readHook) {\n                this.hook.reading.unsubscribe(this.schema.readHook);\n            }\n            this.schema.readHook = readHook;\n            this.hook("reading", readHook);\n            return constructor;\n        },\n        defineClass: function (structure) {\n            /// <summary>\n            ///     Define all members of the class that represents the table. This will help code completion of when objects are read from the database\n            ///     as well as making it possible to extend the prototype of the returned constructor function.\n            /// </summary>\n            /// <param name="structure">Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\n            /// know what type each member has. Example: {name: String, emailAddresses: [String], properties: {shoeSize: Number}}</param>\n            return this.mapToClass(Dexie.defineClass(structure), structure);\n        },\n        bulkDelete: function (keys$$1) {\n            if (this.hook.deleting.fire === nop) {\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n                    resolve(bulkDelete(idbstore, trans, keys$$1, false, nop));\n                });\n            }\n            else {\n                return this\n                    .where(\':id\')\n                    .anyOf(keys$$1)\n                    .delete()\n                    .then(function () { }); // Resolve with undefined.\n            }\n        },\n        bulkPut: function (objects, keys$$1) {\n            var _this = this;\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n                if (!idbstore.keyPath && !_this.schema.primKey.auto && !keys$$1)\n                    throw new exceptions.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");\n                if (idbstore.keyPath && keys$$1)\n                    throw new exceptions.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");\n                if (keys$$1 && keys$$1.length !== objects.length)\n                    throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");\n                if (objects.length === 0)\n                    return resolve(); // Caller provided empty list.\n                var done = function (result) {\n                    if (errorList.length === 0)\n                        resolve(result);\n                    else\n                        reject(new BulkError(_this.name + ".bulkPut(): " + errorList.length + " of " + numObjs + " operations failed", errorList));\n                };\n                var req, errorList = [], errorHandler, numObjs = objects.length, table = _this;\n                if (_this.hook.creating.fire === nop && _this.hook.updating.fire === nop) {\n                    //\n                    // Standard Bulk (no \'creating\' or \'updating\' hooks to care about)\n                    //\n                    errorHandler = BulkErrorHandlerCatchAll(errorList);\n                    for (var i = 0, l = objects.length; i < l; ++i) {\n                        req = keys$$1 ? idbstore.put(objects[i], keys$$1[i]) : idbstore.put(objects[i]);\n                        req.onerror = errorHandler;\n                    }\n                    // Only need to catch success or error on the last operation\n                    // according to the IDB spec.\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done);\n                    req.onsuccess = eventSuccessHandler(done);\n                }\n                else {\n                    var effectiveKeys = keys$$1 || idbstore.keyPath && objects.map(function (o) { return getByKeyPath(o, idbstore.keyPath); });\n                    // Generate map of {[key]: object}\n                    var objectLookup = effectiveKeys && arrayToObject(effectiveKeys, function (key, i) { return key != null && [key, objects[i]]; });\n                    var promise = !effectiveKeys ?\n                        // Auto-incremented key-less objects only without any keys argument.\n                        table.bulkAdd(objects) :\n                        // Keys provided. Either as inbound in provided objects, or as a keys argument.\n                        // Begin with updating those that exists in DB:\n                        table.where(\':id\').anyOf(effectiveKeys.filter(function (key) { return key != null; })).modify(function () {\n                            this.value = objectLookup[this.primKey];\n                            objectLookup[this.primKey] = null; // Mark as "don\'t add this"\n                        }).catch(ModifyError, function (e) {\n                            errorList = e.failures; // No need to concat here. These are the first errors added.\n                        }).then(function () {\n                            // Now, let\'s examine which items didnt exist so we can add them:\n                            var objsToAdd = [], keysToAdd = keys$$1 && [];\n                            // Iterate backwards. Why? Because if same key was used twice, just add the last one.\n                            for (var i = effectiveKeys.length - 1; i >= 0; --i) {\n                                var key = effectiveKeys[i];\n                                if (key == null || objectLookup[key]) {\n                                    objsToAdd.push(objects[i]);\n                                    keys$$1 && keysToAdd.push(key);\n                                    if (key != null)\n                                        objectLookup[key] = null; // Mark as "dont add again"\n                                }\n                            }\n                            // The items are in reverse order so reverse them before adding.\n                            // Could be important in order to get auto-incremented keys the way the caller\n                            // would expect. Could have used unshift instead of push()/reverse(),\n                            // but: http://jsperf.com/unshift-vs-reverse\n                            objsToAdd.reverse();\n                            keys$$1 && keysToAdd.reverse();\n                            return table.bulkAdd(objsToAdd, keysToAdd);\n                        }).then(function (lastAddedKey) {\n                            // Resolve with key of the last object in given arguments to bulkPut():\n                            var lastEffectiveKey = effectiveKeys[effectiveKeys.length - 1]; // Key was provided.\n                            return lastEffectiveKey != null ? lastEffectiveKey : lastAddedKey;\n                        });\n                    promise.then(done).catch(BulkError, function (e) {\n                        // Concat failure from ModifyError and reject using our \'done\' method.\n                        errorList = errorList.concat(e.failures);\n                        done();\n                    }).catch(reject);\n                }\n            }, "locked"); // If called from transaction scope, lock transaction til all steps are done.\n        },\n        bulkAdd: function (objects, keys$$1) {\n            var self = this, creatingHook = this.hook.creating.fire;\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n                if (!idbstore.keyPath && !self.schema.primKey.auto && !keys$$1)\n                    throw new exceptions.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");\n                if (idbstore.keyPath && keys$$1)\n                    throw new exceptions.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");\n                if (keys$$1 && keys$$1.length !== objects.length)\n                    throw new exceptions.InvalidArgument("Arguments objects and keys must have the same length");\n                if (objects.length === 0)\n                    return resolve(); // Caller provided empty list.\n                function done(result) {\n                    if (errorList.length === 0)\n                        resolve(result);\n                    else\n                        reject(new BulkError(self.name + ".bulkAdd(): " + errorList.length + " of " + numObjs + " operations failed", errorList));\n                }\n                var req, errorList = [], errorHandler, successHandler, numObjs = objects.length;\n                if (creatingHook !== nop) {\n                    //\n                    // There are subscribers to hook(\'creating\')\n                    // Must behave as documented.\n                    //\n                    var keyPath = idbstore.keyPath, hookCtx;\n                    errorHandler = BulkErrorHandlerCatchAll(errorList, null, true);\n                    successHandler = hookedEventSuccessHandler(null);\n                    tryCatch(function () {\n                        for (var i = 0, l = objects.length; i < l; ++i) {\n                            hookCtx = { onerror: null, onsuccess: null };\n                            var key = keys$$1 && keys$$1[i];\n                            var obj = objects[i], effectiveKey = keys$$1 ? key : keyPath ? getByKeyPath(obj, keyPath) : undefined, keyToUse = creatingHook.call(hookCtx, effectiveKey, obj, trans);\n                            if (effectiveKey == null && keyToUse != null) {\n                                if (keyPath) {\n                                    obj = deepClone(obj);\n                                    setByKeyPath(obj, keyPath, keyToUse);\n                                }\n                                else {\n                                    key = keyToUse;\n                                }\n                            }\n                            req = key != null ? idbstore.add(obj, key) : idbstore.add(obj);\n                            req._hookCtx = hookCtx;\n                            if (i < l - 1) {\n                                req.onerror = errorHandler;\n                                if (hookCtx.onsuccess)\n                                    req.onsuccess = successHandler;\n                            }\n                        }\n                    }, function (err) {\n                        hookCtx.onerror && hookCtx.onerror(err);\n                        throw err;\n                    });\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done, true);\n                    req.onsuccess = hookedEventSuccessHandler(done);\n                }\n                else {\n                    //\n                    // Standard Bulk (no \'creating\' hook to care about)\n                    //\n                    errorHandler = BulkErrorHandlerCatchAll(errorList);\n                    for (var i = 0, l = objects.length; i < l; ++i) {\n                        req = keys$$1 ? idbstore.add(objects[i], keys$$1[i]) : idbstore.add(objects[i]);\n                        req.onerror = errorHandler;\n                    }\n                    // Only need to catch success or error on the last operation\n                    // according to the IDB spec.\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done);\n                    req.onsuccess = eventSuccessHandler(done);\n                }\n            });\n        },\n        add: function (obj, key) {\n            /// <summary>\n            ///   Add an object to the database. In case an object with same primary key already exists, the object will not be added.\n            /// </summary>\n            /// <param name="obj" type="Object">A javascript object to insert</param>\n            /// <param name="key" optional="true">Primary key</param>\n            var creatingHook = this.hook.creating.fire;\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\n                var hookCtx = { onsuccess: null, onerror: null };\n                if (creatingHook !== nop) {\n                    var effectiveKey = (key != null) ? key : (idbstore.keyPath ? getByKeyPath(obj, idbstore.keyPath) : undefined);\n                    var keyToUse = creatingHook.call(hookCtx, effectiveKey, obj, trans); // Allow subscribers to when("creating") to generate the key.\n                    if (effectiveKey == null && keyToUse != null) {\n                        if (idbstore.keyPath)\n                            setByKeyPath(obj, idbstore.keyPath, keyToUse);\n                        else\n                            key = keyToUse;\n                    }\n                }\n                try {\n                    var req = key != null ? idbstore.add(obj, key) : idbstore.add(obj);\n                    req._hookCtx = hookCtx;\n                    req.onerror = hookedEventRejectHandler(reject);\n                    req.onsuccess = hookedEventSuccessHandler(function (result) {\n                        // TODO: Remove these two lines in next major release (2.0?)\n                        // It\'s no good practice to have side effects on provided parameters\n                        var keyPath = idbstore.keyPath;\n                        if (keyPath)\n                            setByKeyPath(obj, keyPath, result);\n                        resolve(result);\n                    });\n                }\n                catch (e) {\n                    if (hookCtx.onerror)\n                        hookCtx.onerror(e);\n                    throw e;\n                }\n            });\n        },\n        put: function (obj, key) {\n            var _this = this;\n            /// <summary>\n            ///   Add an object to the database but in case an object with same primary key alread exists, the existing one will get updated.\n            /// </summary>\n            /// <param name="obj" type="Object">A javascript object to insert or update</param>\n            /// <param name="key" optional="true">Primary key</param>\n            var creatingHook = this.hook.creating.fire, updatingHook = this.hook.updating.fire;\n            if (creatingHook !== nop || updatingHook !== nop) {\n                //\n                // People listens to when("creating") or when("updating") events!\n                // We must know whether the put operation results in an CREATE or UPDATE.\n                //\n                var keyPath = this.schema.primKey.keyPath;\n                var effectiveKey = (key !== undefined) ? key : (keyPath && getByKeyPath(obj, keyPath));\n                if (effectiveKey == null)\n                    return this.add(obj);\n                // Since key is optional, make sure we get it from obj if not provided\n                // Primary key exist. Lock transaction and try modifying existing. If nothing modified, call add().\n                // clone obj before this async call. If caller modifies obj the line after put(), the IDB spec requires that it should not affect operation.\n                obj = deepClone(obj);\n                return this._trans(READWRITE, function () {\n                    return _this.where(":id").equals(effectiveKey).modify(function () {\n                        // Replace extisting value with our object\n                        // CRUD event firing handled in Collection.modify()\n                        this.value = obj;\n                    }).then(function (count) { return count === 0 ? _this.add(obj, key) : effectiveKey; });\n                }, "locked"); // Lock needed because operation is splitted into modify() and add().\n            }\n            else {\n                // Use the standard IDB put() method.\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n                    var req = key !== undefined ? idbstore.put(obj, key) : idbstore.put(obj);\n                    req.onerror = eventRejectHandler(reject);\n                    req.onsuccess = wrap(function (ev) {\n                        var keyPath = idbstore.keyPath;\n                        if (keyPath)\n                            setByKeyPath(obj, keyPath, ev.target.result);\n                        resolve(req.result);\n                    });\n                });\n            }\n        },\n        \'delete\': function (key) {\n            /// <param name="key">Primary key of the object to delete</param>\n            if (this.hook.deleting.subscribers.length) {\n                // People listens to when("deleting") event. Must implement delete using Collection.delete() that will\n                // call the CRUD event. Only Collection.delete() will know whether an object was actually deleted.\n                return this.where(":id").equals(key).delete();\n            }\n            else {\n                // No one listens. Use standard IDB delete() method.\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n                    var req = idbstore.delete(key);\n                    req.onerror = eventRejectHandler(reject);\n                    req.onsuccess = wrap(function () {\n                        resolve(req.result);\n                    });\n                });\n            }\n        },\n        clear: function () {\n            if (this.hook.deleting.subscribers.length) {\n                // People listens to when("deleting") event. Must implement delete using Collection.delete() that will\n                // call the CRUD event. Only Collection.delete() will knows which objects that are actually deleted.\n                return this.toCollection().delete();\n            }\n            else {\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\n                    var req = idbstore.clear();\n                    req.onerror = eventRejectHandler(reject);\n                    req.onsuccess = wrap(function () {\n                        resolve(req.result);\n                    });\n                });\n            }\n        },\n        update: function (keyOrObject, modifications) {\n            if (typeof modifications !== \'object\' || isArray(modifications))\n                throw new exceptions.InvalidArgument("Modifications must be an object.");\n            if (typeof keyOrObject === \'object\' && !isArray(keyOrObject)) {\n                // object to modify. Also modify given object with the modifications:\n                keys(modifications).forEach(function (keyPath) {\n                    setByKeyPath(keyOrObject, keyPath, modifications[keyPath]);\n                });\n                var key = getByKeyPath(keyOrObject, this.schema.primKey.keyPath);\n                if (key === undefined)\n                    return rejection(new exceptions.InvalidArgument("Given object does not contain its primary key"));\n                return this.where(":id").equals(key).modify(modifications);\n            }\n            else {\n                // key to modify\n                return this.where(":id").equals(keyOrObject).modify(modifications);\n            }\n        }\n    });\n    //\n    //\n    //\n    // Transaction Class\n    //\n    //\n    //\n    function Transaction(mode, storeNames, dbschema, parent) {\n        var _this = this;\n        /// <summary>\n        ///    Transaction class. Represents a database transaction. All operations on db goes through a Transaction.\n        /// </summary>\n        /// <param name="mode" type="String">Any of "readwrite" or "readonly"</param>\n        /// <param name="storeNames" type="Array">Array of table names to operate on</param>\n        this.db = db;\n        this.mode = mode;\n        this.storeNames = storeNames;\n        this.idbtrans = null;\n        this.on = Events(this, "complete", "error", "abort");\n        this.parent = parent || null;\n        this.active = true;\n        this._reculock = 0;\n        this._blockedFuncs = [];\n        this._resolve = null;\n        this._reject = null;\n        this._waitingFor = null;\n        this._waitingQueue = null;\n        this._spinCount = 0; // Just for debugging waitFor()\n        this._completion = new Promise(function (resolve, reject) {\n            _this._resolve = resolve;\n            _this._reject = reject;\n        });\n        this._completion.then(function () {\n            _this.active = false;\n            _this.on.complete.fire();\n        }, function (e) {\n            var wasActive = _this.active;\n            _this.active = false;\n            _this.on.error.fire(e);\n            _this.parent ?\n                _this.parent._reject(e) :\n                wasActive && _this.idbtrans && _this.idbtrans.abort();\n            return rejection(e); // Indicate we actually DO NOT catch this error.\n        });\n    }\n    props(Transaction.prototype, {\n        //\n        // Transaction Protected Methods (not required by API users, but needed internally and eventually by dexie extensions)\n        //\n        _lock: function () {\n            assert(!PSD.global); // Locking and unlocking reuires to be within a PSD scope.\n            // Temporary set all requests into a pending queue if they are called before database is ready.\n            ++this._reculock; // Recursive read/write lock pattern using PSD (Promise Specific Data) instead of TLS (Thread Local Storage)\n            if (this._reculock === 1 && !PSD.global)\n                PSD.lockOwnerFor = this;\n            return this;\n        },\n        _unlock: function () {\n            assert(!PSD.global); // Locking and unlocking reuires to be within a PSD scope.\n            if (--this._reculock === 0) {\n                if (!PSD.global)\n                    PSD.lockOwnerFor = null;\n                while (this._blockedFuncs.length > 0 && !this._locked()) {\n                    var fnAndPSD = this._blockedFuncs.shift();\n                    try {\n                        usePSD(fnAndPSD[1], fnAndPSD[0]);\n                    }\n                    catch (e) { }\n                }\n            }\n            return this;\n        },\n        _locked: function () {\n            // Checks if any write-lock is applied on this transaction.\n            // To simplify the Dexie API for extension implementations, we support recursive locks.\n            // This is accomplished by using "Promise Specific Data" (PSD).\n            // PSD data is bound to a Promise and any child Promise emitted through then() or resolve( new Promise() ).\n            // PSD is local to code executing on top of the call stacks of any of any code executed by Promise():\n            //         * callback given to the Promise() constructor  (function (resolve, reject){...})\n            //         * callbacks given to then()/catch()/finally() methods (function (value){...})\n            // If creating a new independant Promise instance from within a Promise call stack, the new Promise will derive the PSD from the call stack of the parent Promise.\n            // Derivation is done so that the inner PSD __proto__ points to the outer PSD.\n            // PSD.lockOwnerFor will point to current transaction object if the currently executing PSD scope owns the lock.\n            return this._reculock && PSD.lockOwnerFor !== this;\n        },\n        create: function (idbtrans) {\n            var _this = this;\n            if (!this.mode)\n                return this;\n            assert(!this.idbtrans);\n            if (!idbtrans && !idbdb) {\n                switch (dbOpenError && dbOpenError.name) {\n                    case "DatabaseClosedError":\n                        // Errors where it is no difference whether it was caused by the user operation or an earlier call to db.open()\n                        throw new exceptions.DatabaseClosed(dbOpenError);\n                    case "MissingAPIError":\n                        // Errors where it is no difference whether it was caused by the user operation or an earlier call to db.open()\n                        throw new exceptions.MissingAPI(dbOpenError.message, dbOpenError);\n                    default:\n                        // Make it clear that the user operation was not what caused the error - the error had occurred earlier on db.open()!\n                        throw new exceptions.OpenFailed(dbOpenError);\n                }\n            }\n            if (!this.active)\n                throw new exceptions.TransactionInactive();\n            assert(this._completion._state === null);\n            idbtrans = this.idbtrans = idbtrans || idbdb.transaction(safariMultiStoreFix(this.storeNames), this.mode);\n            idbtrans.onerror = wrap(function (ev) {\n                preventDefault(ev); // Prohibit default bubbling to window.error\n                _this._reject(idbtrans.error);\n            });\n            idbtrans.onabort = wrap(function (ev) {\n                preventDefault(ev);\n                _this.active && _this._reject(new exceptions.Abort(idbtrans.error));\n                _this.active = false;\n                _this.on("abort").fire(ev);\n            });\n            idbtrans.oncomplete = wrap(function () {\n                _this.active = false;\n                _this._resolve();\n            });\n            return this;\n        },\n        _promise: function (mode, fn, bWriteLock) {\n            var _this = this;\n            if (mode === READWRITE && this.mode !== READWRITE)\n                return rejection(new exceptions.ReadOnly("Transaction is readonly"));\n            if (!this.active)\n                return rejection(new exceptions.TransactionInactive());\n            if (this._locked()) {\n                return new Promise(function (resolve, reject) {\n                    _this._blockedFuncs.push([function () {\n                            _this._promise(mode, fn, bWriteLock).then(resolve, reject);\n                        }, PSD]);\n                });\n            }\n            else if (bWriteLock) {\n                return newScope(function () {\n                    var p = new Promise(function (resolve, reject) {\n                        _this._lock();\n                        var rv = fn(resolve, reject, _this);\n                        if (rv && rv.then)\n                            rv.then(resolve, reject);\n                    });\n                    p.finally(function () { return _this._unlock(); });\n                    p._lib = true;\n                    return p;\n                });\n            }\n            else {\n                var p = new Promise(function (resolve, reject) {\n                    var rv = fn(resolve, reject, _this);\n                    if (rv && rv.then)\n                        rv.then(resolve, reject);\n                });\n                p._lib = true;\n                return p;\n            }\n        },\n        _root: function () {\n            return this.parent ? this.parent._root() : this;\n        },\n        waitFor: function (promise) {\n            // Always operate on the root transaction (in case this is a sub stransaction)\n            var root = this._root();\n            // For stability reasons, convert parameter to promise no matter what type is passed to waitFor().\n            // (We must be able to call .then() on it.)\n            promise = Promise.resolve(promise);\n            if (root._waitingFor) {\n                // Already called waitFor(). Wait for both to complete.\n                root._waitingFor = root._waitingFor.then(function () { return promise; });\n            }\n            else {\n                // We\'re not in waiting state. Start waiting state.\n                root._waitingFor = promise;\n                root._waitingQueue = [];\n                // Start interacting with indexedDB until promise completes:\n                var store = root.idbtrans.objectStore(root.storeNames[0]);\n                (function spin() {\n                    ++root._spinCount; // For debugging only\n                    while (root._waitingQueue.length)\n                        (root._waitingQueue.shift())();\n                    if (root._waitingFor)\n                        store.get(-Infinity).onsuccess = spin;\n                }());\n            }\n            var currentWaitPromise = root._waitingFor;\n            return new Promise(function (resolve, reject) {\n                promise.then(function (res) { return root._waitingQueue.push(wrap(resolve.bind(null, res))); }, function (err) { return root._waitingQueue.push(wrap(reject.bind(null, err))); }).finally(function () {\n                    if (root._waitingFor === currentWaitPromise) {\n                        // No one added a wait after us. Safe to stop the spinning.\n                        root._waitingFor = null;\n                    }\n                });\n            });\n        },\n        //\n        // Transaction Public Properties and Methods\n        //\n        abort: function () {\n            this.active && this._reject(new exceptions.Abort());\n            this.active = false;\n        },\n        tables: {\n            get: deprecated("Transaction.tables", function () { return allTables; })\n        },\n        table: function (name) {\n            var table = db.table(name); // Don\'t check that table is part of transaction. It must fail lazily!\n            return new Table(name, table.schema, this);\n        }\n    });\n    //\n    //\n    //\n    // WhereClause\n    //\n    //\n    //\n    function WhereClause(table, index, orCollection) {\n        /// <param name="table" type="Table"></param>\n        /// <param name="index" type="String" optional="true"></param>\n        /// <param name="orCollection" type="Collection" optional="true"></param>\n        this._ctx = {\n            table: table,\n            index: index === ":id" ? null : index,\n            or: orCollection\n        };\n    }\n    props(WhereClause.prototype, function () {\n        // WhereClause private methods\n        function fail(collectionOrWhereClause, err, T) {\n            var collection = collectionOrWhereClause instanceof WhereClause ?\n                new Collection(collectionOrWhereClause) :\n                collectionOrWhereClause;\n            collection._ctx.error = T ? new T(err) : new TypeError(err);\n            return collection;\n        }\n        function emptyCollection(whereClause) {\n            return new Collection(whereClause, function () { return IDBKeyRange.only(""); }).limit(0);\n        }\n        function upperFactory(dir) {\n            return dir === "next" ? function (s) { return s.toUpperCase(); } : function (s) { return s.toLowerCase(); };\n        }\n        function lowerFactory(dir) {\n            return dir === "next" ? function (s) { return s.toLowerCase(); } : function (s) { return s.toUpperCase(); };\n        }\n        function nextCasing(key, lowerKey, upperNeedle, lowerNeedle, cmp, dir) {\n            var length = Math.min(key.length, lowerNeedle.length);\n            var llp = -1;\n            for (var i = 0; i < length; ++i) {\n                var lwrKeyChar = lowerKey[i];\n                if (lwrKeyChar !== lowerNeedle[i]) {\n                    if (cmp(key[i], upperNeedle[i]) < 0)\n                        return key.substr(0, i) + upperNeedle[i] + upperNeedle.substr(i + 1);\n                    if (cmp(key[i], lowerNeedle[i]) < 0)\n                        return key.substr(0, i) + lowerNeedle[i] + upperNeedle.substr(i + 1);\n                    if (llp >= 0)\n                        return key.substr(0, llp) + lowerKey[llp] + upperNeedle.substr(llp + 1);\n                    return null;\n                }\n                if (cmp(key[i], lwrKeyChar) < 0)\n                    llp = i;\n            }\n            if (length < lowerNeedle.length && dir === "next")\n                return key + upperNeedle.substr(key.length);\n            if (length < key.length && dir === "prev")\n                return key.substr(0, upperNeedle.length);\n            return (llp < 0 ? null : key.substr(0, llp) + lowerNeedle[llp] + upperNeedle.substr(llp + 1));\n        }\n        function addIgnoreCaseAlgorithm(whereClause, match, needles, suffix) {\n            /// <param name="needles" type="Array" elementType="String"></param>\n            var upper, lower, compare, upperNeedles, lowerNeedles, direction, nextKeySuffix, needlesLen = needles.length;\n            if (!needles.every(function (s) { return typeof s === \'string\'; })) {\n                return fail(whereClause, STRING_EXPECTED);\n            }\n            function initDirection(dir) {\n                upper = upperFactory(dir);\n                lower = lowerFactory(dir);\n                compare = (dir === "next" ? simpleCompare : simpleCompareReverse);\n                var needleBounds = needles.map(function (needle) {\n                    return { lower: lower(needle), upper: upper(needle) };\n                }).sort(function (a, b) {\n                    return compare(a.lower, b.lower);\n                });\n                upperNeedles = needleBounds.map(function (nb) { return nb.upper; });\n                lowerNeedles = needleBounds.map(function (nb) { return nb.lower; });\n                direction = dir;\n                nextKeySuffix = (dir === "next" ? "" : suffix);\n            }\n            initDirection("next");\n            var c = new Collection(whereClause, function () {\n                return IDBKeyRange.bound(upperNeedles[0], lowerNeedles[needlesLen - 1] + suffix);\n            });\n            c._ondirectionchange = function (direction) {\n                // This event onlys occur before filter is called the first time.\n                initDirection(direction);\n            };\n            var firstPossibleNeedle = 0;\n            c._addAlgorithm(function (cursor, advance, resolve) {\n                /// <param name="cursor" type="IDBCursor"></param>\n                /// <param name="advance" type="Function"></param>\n                /// <param name="resolve" type="Function"></param>\n                var key = cursor.key;\n                if (typeof key !== \'string\')\n                    return false;\n                var lowerKey = lower(key);\n                if (match(lowerKey, lowerNeedles, firstPossibleNeedle)) {\n                    return true;\n                }\n                else {\n                    var lowestPossibleCasing = null;\n                    for (var i = firstPossibleNeedle; i < needlesLen; ++i) {\n                        var casing = nextCasing(key, lowerKey, upperNeedles[i], lowerNeedles[i], compare, direction);\n                        if (casing === null && lowestPossibleCasing === null)\n                            firstPossibleNeedle = i + 1;\n                        else if (lowestPossibleCasing === null || compare(lowestPossibleCasing, casing) > 0) {\n                            lowestPossibleCasing = casing;\n                        }\n                    }\n                    if (lowestPossibleCasing !== null) {\n                        advance(function () { cursor.continue(lowestPossibleCasing + nextKeySuffix); });\n                    }\n                    else {\n                        advance(resolve);\n                    }\n                    return false;\n                }\n            });\n            return c;\n        }\n        //\n        // WhereClause public methods\n        //\n        return {\n            between: function (lower, upper, includeLower, includeUpper) {\n                /// <summary>\n                ///     Filter out records whose where-field lays between given lower and upper values. Applies to Strings, Numbers and Dates.\n                /// </summary>\n                /// <param name="lower"></param>\n                /// <param name="upper"></param>\n                /// <param name="includeLower" optional="true">Whether items that equals lower should be included. Default true.</param>\n                /// <param name="includeUpper" optional="true">Whether items that equals upper should be included. Default false.</param>\n                /// <returns type="Collection"></returns>\n                includeLower = includeLower !== false; // Default to true\n                includeUpper = includeUpper === true; // Default to false\n                try {\n                    if ((cmp(lower, upper) > 0) ||\n                        (cmp(lower, upper) === 0 && (includeLower || includeUpper) && !(includeLower && includeUpper)))\n                        return emptyCollection(this); // Workaround for idiotic W3C Specification that DataError must be thrown if lower > upper. The natural result would be to return an empty collection.\n                    return new Collection(this, function () { return IDBKeyRange.bound(lower, upper, !includeLower, !includeUpper); });\n                }\n                catch (e) {\n                    return fail(this, INVALID_KEY_ARGUMENT);\n                }\n            },\n            equals: function (value) {\n                return new Collection(this, function () { return IDBKeyRange.only(value); });\n            },\n            above: function (value) {\n                return new Collection(this, function () { return IDBKeyRange.lowerBound(value, true); });\n            },\n            aboveOrEqual: function (value) {\n                return new Collection(this, function () { return IDBKeyRange.lowerBound(value); });\n            },\n            below: function (value) {\n                return new Collection(this, function () { return IDBKeyRange.upperBound(value, true); });\n            },\n            belowOrEqual: function (value) {\n                return new Collection(this, function () { return IDBKeyRange.upperBound(value); });\n            },\n            startsWith: function (str) {\n                /// <param name="str" type="String"></param>\n                if (typeof str !== \'string\')\n                    return fail(this, STRING_EXPECTED);\n                return this.between(str, str + maxString, true, true);\n            },\n            startsWithIgnoreCase: function (str) {\n                /// <param name="str" type="String"></param>\n                if (str === "")\n                    return this.startsWith(str);\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return x.indexOf(a[0]) === 0; }, [str], maxString);\n            },\n            equalsIgnoreCase: function (str) {\n                /// <param name="str" type="String"></param>\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return x === a[0]; }, [str], "");\n            },\n            anyOfIgnoreCase: function () {\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\n                if (set.length === 0)\n                    return emptyCollection(this);\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return a.indexOf(x) !== -1; }, set, "");\n            },\n            startsWithAnyOfIgnoreCase: function () {\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\n                if (set.length === 0)\n                    return emptyCollection(this);\n                return addIgnoreCaseAlgorithm(this, function (x, a) {\n                    return a.some(function (n) {\n                        return x.indexOf(n) === 0;\n                    });\n                }, set, maxString);\n            },\n            anyOf: function () {\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\n                var compare = ascending;\n                try {\n                    set.sort(compare);\n                }\n                catch (e) {\n                    return fail(this, INVALID_KEY_ARGUMENT);\n                }\n                if (set.length === 0)\n                    return emptyCollection(this);\n                var c = new Collection(this, function () { return IDBKeyRange.bound(set[0], set[set.length - 1]); });\n                c._ondirectionchange = function (direction) {\n                    compare = (direction === "next" ? ascending : descending);\n                    set.sort(compare);\n                };\n                var i = 0;\n                c._addAlgorithm(function (cursor, advance, resolve) {\n                    var key = cursor.key;\n                    while (compare(key, set[i]) > 0) {\n                        // The cursor has passed beyond this key. Check next.\n                        ++i;\n                        if (i === set.length) {\n                            // There is no next. Stop searching.\n                            advance(resolve);\n                            return false;\n                        }\n                    }\n                    if (compare(key, set[i]) === 0) {\n                        // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\n                        return true;\n                    }\n                    else {\n                        // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\n                        advance(function () { cursor.continue(set[i]); });\n                        return false;\n                    }\n                });\n                return c;\n            },\n            notEqual: function (value) {\n                return this.inAnyRange([[minKey, value], [value, maxKey]], { includeLowers: false, includeUppers: false });\n            },\n            noneOf: function () {\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\n                if (set.length === 0)\n                    return new Collection(this); // Return entire collection.\n                try {\n                    set.sort(ascending);\n                }\n                catch (e) {\n                    return fail(this, INVALID_KEY_ARGUMENT);\n                }\n                // Transform ["a","b","c"] to a set of ranges for between/above/below: [[minKey,"a"], ["a","b"], ["b","c"], ["c",maxKey]]\n                var ranges = set.reduce(function (res, val) { return res ? res.concat([[res[res.length - 1][1], val]]) : [[minKey, val]]; }, null);\n                ranges.push([set[set.length - 1], maxKey]);\n                return this.inAnyRange(ranges, { includeLowers: false, includeUppers: false });\n            },\n            /** Filter out values withing given set of ranges.\n            * Example, give children and elders a rebate of 50%:\n            *\n            *   db.friends.where(\'age\').inAnyRange([[0,18],[65,Infinity]]).modify({Rebate: 1/2});\n            *\n            * @param {(string|number|Date|Array)[][]} ranges\n            * @param {{includeLowers: boolean, includeUppers: boolean}} options\n            */\n            inAnyRange: function (ranges, options) {\n                if (ranges.length === 0)\n                    return emptyCollection(this);\n                if (!ranges.every(function (range) { return range[0] !== undefined && range[1] !== undefined && ascending(range[0], range[1]) <= 0; })) {\n                    return fail(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", exceptions.InvalidArgument);\n                }\n                var includeLowers = !options || options.includeLowers !== false; // Default to true\n                var includeUppers = options && options.includeUppers === true; // Default to false\n                function addRange(ranges, newRange) {\n                    for (var i = 0, l = ranges.length; i < l; ++i) {\n                        var range = ranges[i];\n                        if (cmp(newRange[0], range[1]) < 0 && cmp(newRange[1], range[0]) > 0) {\n                            range[0] = min(range[0], newRange[0]);\n                            range[1] = max(range[1], newRange[1]);\n                            break;\n                        }\n                    }\n                    if (i === l)\n                        ranges.push(newRange);\n                    return ranges;\n                }\n                var sortDirection = ascending;\n                function rangeSorter(a, b) { return sortDirection(a[0], b[0]); }\n                // Join overlapping ranges\n                var set;\n                try {\n                    set = ranges.reduce(addRange, []);\n                    set.sort(rangeSorter);\n                }\n                catch (ex) {\n                    return fail(this, INVALID_KEY_ARGUMENT);\n                }\n                var i = 0;\n                var keyIsBeyondCurrentEntry = includeUppers ?\n                    function (key) { return ascending(key, set[i][1]) > 0; } :\n                    function (key) { return ascending(key, set[i][1]) >= 0; };\n                var keyIsBeforeCurrentEntry = includeLowers ?\n                    function (key) { return descending(key, set[i][0]) > 0; } :\n                    function (key) { return descending(key, set[i][0]) >= 0; };\n                function keyWithinCurrentRange(key) {\n                    return !keyIsBeyondCurrentEntry(key) && !keyIsBeforeCurrentEntry(key);\n                }\n                var checkKey = keyIsBeyondCurrentEntry;\n                var c = new Collection(this, function () {\n                    return IDBKeyRange.bound(set[0][0], set[set.length - 1][1], !includeLowers, !includeUppers);\n                });\n                c._ondirectionchange = function (direction) {\n                    if (direction === "next") {\n                        checkKey = keyIsBeyondCurrentEntry;\n                        sortDirection = ascending;\n                    }\n                    else {\n                        checkKey = keyIsBeforeCurrentEntry;\n                        sortDirection = descending;\n                    }\n                    set.sort(rangeSorter);\n                };\n                c._addAlgorithm(function (cursor, advance, resolve) {\n                    var key = cursor.key;\n                    while (checkKey(key)) {\n                        // The cursor has passed beyond this key. Check next.\n                        ++i;\n                        if (i === set.length) {\n                            // There is no next. Stop searching.\n                            advance(resolve);\n                            return false;\n                        }\n                    }\n                    if (keyWithinCurrentRange(key)) {\n                        // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\n                        return true;\n                    }\n                    else if (cmp(key, set[i][1]) === 0 || cmp(key, set[i][0]) === 0) {\n                        // includeUpper or includeLower is false so keyWithinCurrentRange() returns false even though we are at range border.\n                        // Continue to next key but don\'t include this one.\n                        return false;\n                    }\n                    else {\n                        // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\n                        advance(function () {\n                            if (sortDirection === ascending)\n                                cursor.continue(set[i][0]);\n                            else\n                                cursor.continue(set[i][1]);\n                        });\n                        return false;\n                    }\n                });\n                return c;\n            },\n            startsWithAnyOf: function () {\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\n                if (!set.every(function (s) { return typeof s === \'string\'; })) {\n                    return fail(this, "startsWithAnyOf() only works with strings");\n                }\n                if (set.length === 0)\n                    return emptyCollection(this);\n                return this.inAnyRange(set.map(function (str) {\n                    return [str, str + maxString];\n                }));\n            }\n        };\n    });\n    //\n    //\n    //\n    // Collection Class\n    //\n    //\n    //\n    function Collection(whereClause, keyRangeGenerator) {\n        /// <summary>\n        ///\n        /// </summary>\n        /// <param name="whereClause" type="WhereClause">Where clause instance</param>\n        /// <param name="keyRangeGenerator" value="function(){ return IDBKeyRange.bound(0,1);}" optional="true"></param>\n        var keyRange = null, error = null;\n        if (keyRangeGenerator)\n            try {\n                keyRange = keyRangeGenerator();\n            }\n            catch (ex) {\n                error = ex;\n            }\n        var whereCtx = whereClause._ctx, table = whereCtx.table;\n        this._ctx = {\n            table: table,\n            index: whereCtx.index,\n            isPrimKey: (!whereCtx.index || (table.schema.primKey.keyPath && whereCtx.index === table.schema.primKey.name)),\n            range: keyRange,\n            keysOnly: false,\n            dir: "next",\n            unique: "",\n            algorithm: null,\n            filter: null,\n            replayFilter: null,\n            justLimit: true,\n            isMatch: null,\n            offset: 0,\n            limit: Infinity,\n            error: error,\n            or: whereCtx.or,\n            valueMapper: table.hook.reading.fire\n        };\n    }\n    function isPlainKeyRange(ctx, ignoreLimitFilter) {\n        return !(ctx.filter || ctx.algorithm || ctx.or) &&\n            (ignoreLimitFilter ? ctx.justLimit : !ctx.replayFilter);\n    }\n    props(Collection.prototype, function () {\n        //\n        // Collection Private Functions\n        //\n        function addFilter(ctx, fn) {\n            ctx.filter = combine(ctx.filter, fn);\n        }\n        function addReplayFilter(ctx, factory, isLimitFilter) {\n            var curr = ctx.replayFilter;\n            ctx.replayFilter = curr ? function () { return combine(curr(), factory()); } : factory;\n            ctx.justLimit = isLimitFilter && !curr;\n        }\n        function addMatchFilter(ctx, fn) {\n            ctx.isMatch = combine(ctx.isMatch, fn);\n        }\n        /** @param ctx {\n         *      isPrimKey: boolean,\n         *      table: Table,\n         *      index: string\n         * }\n         * @param store IDBObjectStore\n         **/\n        function getIndexOrStore(ctx, store) {\n            if (ctx.isPrimKey)\n                return store;\n            var indexSpec = ctx.table.schema.idxByName[ctx.index];\n            if (!indexSpec)\n                throw new exceptions.Schema("KeyPath " + ctx.index + " on object store " + store.name + " is not indexed");\n            return store.index(indexSpec.name);\n        }\n        /** @param ctx {\n         *      isPrimKey: boolean,\n         *      table: Table,\n         *      index: string,\n         *      keysOnly: boolean,\n         *      range?: IDBKeyRange,\n         *      dir: "next" | "prev"\n         * }\n         */\n        function openCursor(ctx, store) {\n            var idxOrStore = getIndexOrStore(ctx, store);\n            return ctx.keysOnly && \'openKeyCursor\' in idxOrStore ?\n                idxOrStore.openKeyCursor(ctx.range || null, ctx.dir + ctx.unique) :\n                idxOrStore.openCursor(ctx.range || null, ctx.dir + ctx.unique);\n        }\n        function iter(ctx, fn, resolve, reject, idbstore) {\n            var filter = ctx.replayFilter ? combine(ctx.filter, ctx.replayFilter()) : ctx.filter;\n            if (!ctx.or) {\n                iterate(openCursor(ctx, idbstore), combine(ctx.algorithm, filter), fn, resolve, reject, !ctx.keysOnly && ctx.valueMapper);\n            }\n            else\n                (function () {\n                    var set = {};\n                    var resolved = 0;\n                    function resolveboth() {\n                        if (++resolved === 2)\n                            resolve(); // Seems like we just support or btwn max 2 expressions, but there are no limit because we do recursion.\n                    }\n                    function union(item, cursor, advance) {\n                        if (!filter || filter(cursor, advance, resolveboth, reject)) {\n                            var primaryKey = cursor.primaryKey;\n                            var key = \'\' + primaryKey;\n                            if (key === \'[object ArrayBuffer]\')\n                                key = \'\' + new Uint8Array(primaryKey);\n                            if (!hasOwn(set, key)) {\n                                set[key] = true;\n                                fn(item, cursor, advance);\n                            }\n                        }\n                    }\n                    ctx.or._iterate(union, resolveboth, reject, idbstore);\n                    iterate(openCursor(ctx, idbstore), ctx.algorithm, union, resolveboth, reject, !ctx.keysOnly && ctx.valueMapper);\n                })();\n        }\n        return {\n            //\n            // Collection Protected Functions\n            //\n            _read: function (fn, cb) {\n                var ctx = this._ctx;\n                return ctx.error ?\n                    ctx.table._trans(null, rejection.bind(null, ctx.error)) :\n                    ctx.table._idbstore(READONLY, fn).then(cb);\n            },\n            _write: function (fn) {\n                var ctx = this._ctx;\n                return ctx.error ?\n                    ctx.table._trans(null, rejection.bind(null, ctx.error)) :\n                    ctx.table._idbstore(READWRITE, fn, "locked"); // When doing write operations on collections, always lock the operation so that upcoming operations gets queued.\n            },\n            _addAlgorithm: function (fn) {\n                var ctx = this._ctx;\n                ctx.algorithm = combine(ctx.algorithm, fn);\n            },\n            _iterate: function (fn, resolve, reject, idbstore) {\n                return iter(this._ctx, fn, resolve, reject, idbstore);\n            },\n            clone: function (props$$1) {\n                var rv = Object.create(this.constructor.prototype), ctx = Object.create(this._ctx);\n                if (props$$1)\n                    extend(ctx, props$$1);\n                rv._ctx = ctx;\n                return rv;\n            },\n            raw: function () {\n                this._ctx.valueMapper = null;\n                return this;\n            },\n            //\n            // Collection Public methods\n            //\n            each: function (fn) {\n                var ctx = this._ctx;\n                return this._read(function (resolve, reject, idbstore) {\n                    iter(ctx, fn, resolve, reject, idbstore);\n                });\n            },\n            count: function (cb) {\n                var ctx = this._ctx;\n                if (isPlainKeyRange(ctx, true)) {\n                    // This is a plain key range. We can use the count() method if the index.\n                    return this._read(function (resolve, reject, idbstore) {\n                        var idx = getIndexOrStore(ctx, idbstore);\n                        var req = (ctx.range ? idx.count(ctx.range) : idx.count());\n                        req.onerror = eventRejectHandler(reject);\n                        req.onsuccess = function (e) {\n                            resolve(Math.min(e.target.result, ctx.limit));\n                        };\n                    }, cb);\n                }\n                else {\n                    // Algorithms, filters or expressions are applied. Need to count manually.\n                    var count = 0;\n                    return this._read(function (resolve, reject, idbstore) {\n                        iter(ctx, function () { ++count; return false; }, function () { resolve(count); }, reject, idbstore);\n                    }, cb);\n                }\n            },\n            sortBy: function (keyPath, cb) {\n                /// <param name="keyPath" type="String"></param>\n                var parts = keyPath.split(\'.\').reverse(), lastPart = parts[0], lastIndex = parts.length - 1;\n                function getval(obj, i) {\n                    if (i)\n                        return getval(obj[parts[i]], i - 1);\n                    return obj[lastPart];\n                }\n                var order = this._ctx.dir === "next" ? 1 : -1;\n                function sorter(a, b) {\n                    var aVal = getval(a, lastIndex), bVal = getval(b, lastIndex);\n                    return aVal < bVal ? -order : aVal > bVal ? order : 0;\n                }\n                return this.toArray(function (a) {\n                    return a.sort(sorter);\n                }).then(cb);\n            },\n            toArray: function (cb) {\n                var ctx = this._ctx;\n                return this._read(function (resolve, reject, idbstore) {\n                    if (hasGetAll && ctx.dir === \'next\' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {\n                        // Special optimation if we could use IDBObjectStore.getAll() or\n                        // IDBKeyRange.getAll():\n                        var readingHook = ctx.table.hook.reading.fire;\n                        var idxOrStore = getIndexOrStore(ctx, idbstore);\n                        var req = ctx.limit < Infinity ?\n                            idxOrStore.getAll(ctx.range, ctx.limit) :\n                            idxOrStore.getAll(ctx.range);\n                        req.onerror = eventRejectHandler(reject);\n                        req.onsuccess = readingHook === mirror ?\n                            eventSuccessHandler(resolve) :\n                            eventSuccessHandler(function (res) {\n                                try {\n                                    resolve(res.map(readingHook));\n                                }\n                                catch (e) {\n                                    reject(e);\n                                }\n                            });\n                    }\n                    else {\n                        // Getting array through a cursor.\n                        var a = [];\n                        iter(ctx, function (item) { a.push(item); }, function arrayComplete() {\n                            resolve(a);\n                        }, reject, idbstore);\n                    }\n                }, cb);\n            },\n            offset: function (offset) {\n                var ctx = this._ctx;\n                if (offset <= 0)\n                    return this;\n                ctx.offset += offset; // For count()\n                if (isPlainKeyRange(ctx)) {\n                    addReplayFilter(ctx, function () {\n                        var offsetLeft = offset;\n                        return function (cursor, advance) {\n                            if (offsetLeft === 0)\n                                return true;\n                            if (offsetLeft === 1) {\n                                --offsetLeft;\n                                return false;\n                            }\n                            advance(function () {\n                                cursor.advance(offsetLeft);\n                                offsetLeft = 0;\n                            });\n                            return false;\n                        };\n                    });\n                }\n                else {\n                    addReplayFilter(ctx, function () {\n                        var offsetLeft = offset;\n                        return function () { return (--offsetLeft < 0); };\n                    });\n                }\n                return this;\n            },\n            limit: function (numRows) {\n                this._ctx.limit = Math.min(this._ctx.limit, numRows); // For count()\n                addReplayFilter(this._ctx, function () {\n                    var rowsLeft = numRows;\n                    return function (cursor, advance, resolve) {\n                        if (--rowsLeft <= 0)\n                            advance(resolve); // Stop after this item has been included\n                        return rowsLeft >= 0; // If numRows is already below 0, return false because then 0 was passed to numRows initially. Otherwise we wouldnt come here.\n                    };\n                }, true);\n                return this;\n            },\n            until: function (filterFunction, bIncludeStopEntry) {\n                addFilter(this._ctx, function (cursor, advance, resolve) {\n                    if (filterFunction(cursor.value)) {\n                        advance(resolve);\n                        return bIncludeStopEntry;\n                    }\n                    else {\n                        return true;\n                    }\n                });\n                return this;\n            },\n            first: function (cb) {\n                return this.limit(1).toArray(function (a) { return a[0]; }).then(cb);\n            },\n            last: function (cb) {\n                return this.reverse().first(cb);\n            },\n            filter: function (filterFunction) {\n                /// <param name="jsFunctionFilter" type="Function">function(val){return true/false}</param>\n                addFilter(this._ctx, function (cursor) {\n                    return filterFunction(cursor.value);\n                });\n                // match filters not used in Dexie.js but can be used by 3rd part libraries to test a\n                // collection for a match without querying DB. Used by Dexie.Observable.\n                addMatchFilter(this._ctx, filterFunction);\n                return this;\n            },\n            and: function (filterFunction) {\n                return this.filter(filterFunction);\n            },\n            or: function (indexName) {\n                return new WhereClause(this._ctx.table, indexName, this);\n            },\n            reverse: function () {\n                this._ctx.dir = (this._ctx.dir === "prev" ? "next" : "prev");\n                if (this._ondirectionchange)\n                    this._ondirectionchange(this._ctx.dir);\n                return this;\n            },\n            desc: function () {\n                return this.reverse();\n            },\n            eachKey: function (cb) {\n                var ctx = this._ctx;\n                ctx.keysOnly = !ctx.isMatch;\n                return this.each(function (val, cursor) { cb(cursor.key, cursor); });\n            },\n            eachUniqueKey: function (cb) {\n                this._ctx.unique = "unique";\n                return this.eachKey(cb);\n            },\n            eachPrimaryKey: function (cb) {\n                var ctx = this._ctx;\n                ctx.keysOnly = !ctx.isMatch;\n                return this.each(function (val, cursor) { cb(cursor.primaryKey, cursor); });\n            },\n            keys: function (cb) {\n                var ctx = this._ctx;\n                ctx.keysOnly = !ctx.isMatch;\n                var a = [];\n                return this.each(function (item, cursor) {\n                    a.push(cursor.key);\n                }).then(function () {\n                    return a;\n                }).then(cb);\n            },\n            primaryKeys: function (cb) {\n                var ctx = this._ctx;\n                if (hasGetAll && ctx.dir === \'next\' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {\n                    // Special optimation if we could use IDBObjectStore.getAllKeys() or\n                    // IDBKeyRange.getAllKeys():\n                    return this._read(function (resolve, reject, idbstore) {\n                        var idxOrStore = getIndexOrStore(ctx, idbstore);\n                        var req = ctx.limit < Infinity ?\n                            idxOrStore.getAllKeys(ctx.range, ctx.limit) :\n                            idxOrStore.getAllKeys(ctx.range);\n                        req.onerror = eventRejectHandler(reject);\n                        req.onsuccess = eventSuccessHandler(resolve);\n                    }).then(cb);\n                }\n                ctx.keysOnly = !ctx.isMatch;\n                var a = [];\n                return this.each(function (item, cursor) {\n                    a.push(cursor.primaryKey);\n                }).then(function () {\n                    return a;\n                }).then(cb);\n            },\n            uniqueKeys: function (cb) {\n                this._ctx.unique = "unique";\n                return this.keys(cb);\n            },\n            firstKey: function (cb) {\n                return this.limit(1).keys(function (a) { return a[0]; }).then(cb);\n            },\n            lastKey: function (cb) {\n                return this.reverse().firstKey(cb);\n            },\n            distinct: function () {\n                var ctx = this._ctx, idx = ctx.index && ctx.table.schema.idxByName[ctx.index];\n                if (!idx || !idx.multi)\n                    return this; // distinct() only makes differencies on multiEntry indexes.\n                var set = {};\n                addFilter(this._ctx, function (cursor) {\n                    var strKey = cursor.primaryKey.toString(); // Converts any Date to String, String to String, Number to String and Array to comma-separated string\n                    var found = hasOwn(set, strKey);\n                    set[strKey] = true;\n                    return !found;\n                });\n                return this;\n            },\n            //\n            // Methods that mutate storage\n            //\n            modify: function (changes) {\n                var self = this, ctx = this._ctx, hook = ctx.table.hook, updatingHook = hook.updating.fire, deletingHook = hook.deleting.fire;\n                return this._write(function (resolve, reject, idbstore, trans) {\n                    var modifyer;\n                    if (typeof changes === \'function\') {\n                        // Changes is a function that may update, add or delete propterties or even require a deletion the object itself (delete this.item)\n                        if (updatingHook === nop && deletingHook === nop) {\n                            // Noone cares about what is being changed. Just let the modifier function be the given argument as is.\n                            modifyer = changes;\n                        }\n                        else {\n                            // People want to know exactly what is being modified or deleted.\n                            // Let modifyer be a proxy function that finds out what changes the caller is actually doing\n                            // and call the hooks accordingly!\n                            modifyer = function (item) {\n                                var origItem = deepClone(item); // Clone the item first so we can compare laters.\n                                if (changes.call(this, item, this) === false)\n                                    return false; // Call the real modifyer function (If it returns false explicitely, it means it dont want to modify anyting on this object)\n                                if (!hasOwn(this, "value")) {\n                                    // The real modifyer function requests a deletion of the object. Inform the deletingHook that a deletion is taking place.\n                                    deletingHook.call(this, this.primKey, item, trans);\n                                }\n                                else {\n                                    // No deletion. Check what was changed\n                                    var objectDiff = getObjectDiff(origItem, this.value);\n                                    var additionalChanges = updatingHook.call(this, objectDiff, this.primKey, origItem, trans);\n                                    if (additionalChanges) {\n                                        // Hook want to apply additional modifications. Make sure to fullfill the will of the hook.\n                                        item = this.value;\n                                        keys(additionalChanges).forEach(function (keyPath) {\n                                            setByKeyPath(item, keyPath, additionalChanges[keyPath]); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\n                                        });\n                                    }\n                                }\n                            };\n                        }\n                    }\n                    else if (updatingHook === nop) {\n                        // changes is a set of {keyPath: value} and no one is listening to the updating hook.\n                        var keyPaths = keys(changes);\n                        var numKeys = keyPaths.length;\n                        modifyer = function (item) {\n                            var anythingModified = false;\n                            for (var i = 0; i < numKeys; ++i) {\n                                var keyPath = keyPaths[i], val = changes[keyPath];\n                                if (getByKeyPath(item, keyPath) !== val) {\n                                    setByKeyPath(item, keyPath, val); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\n                                    anythingModified = true;\n                                }\n                            }\n                            return anythingModified;\n                        };\n                    }\n                    else {\n                        // changes is a set of {keyPath: value} and people are listening to the updating hook so we need to call it and\n                        // allow it to add additional modifications to make.\n                        var origChanges = changes;\n                        changes = shallowClone(origChanges); // Let\'s work with a clone of the changes keyPath/value set so that we can restore it in case a hook extends it.\n                        modifyer = function (item) {\n                            var anythingModified = false;\n                            var additionalChanges = updatingHook.call(this, changes, this.primKey, deepClone(item), trans);\n                            if (additionalChanges)\n                                extend(changes, additionalChanges);\n                            keys(changes).forEach(function (keyPath) {\n                                var val = changes[keyPath];\n                                if (getByKeyPath(item, keyPath) !== val) {\n                                    setByKeyPath(item, keyPath, val);\n                                    anythingModified = true;\n                                }\n                            });\n                            if (additionalChanges)\n                                changes = shallowClone(origChanges); // Restore original changes for next iteration\n                            return anythingModified;\n                        };\n                    }\n                    var count = 0;\n                    var successCount = 0;\n                    var iterationComplete = false;\n                    var failures = [];\n                    var failKeys = [];\n                    var currentKey = null;\n                    function modifyItem(item, cursor) {\n                        currentKey = cursor.primaryKey;\n                        var thisContext = {\n                            primKey: cursor.primaryKey,\n                            value: item,\n                            onsuccess: null,\n                            onerror: null\n                        };\n                        function onerror(e) {\n                            failures.push(e);\n                            failKeys.push(thisContext.primKey);\n                            checkFinished();\n                            return true; // Catch these errors and let a final rejection decide whether or not to abort entire transaction\n                        }\n                        if (modifyer.call(thisContext, item, thisContext) !== false) {\n                            var bDelete = !hasOwn(thisContext, "value");\n                            ++count;\n                            tryCatch(function () {\n                                var req = (bDelete ? cursor.delete() : cursor.update(thisContext.value));\n                                req._hookCtx = thisContext;\n                                req.onerror = hookedEventRejectHandler(onerror);\n                                req.onsuccess = hookedEventSuccessHandler(function () {\n                                    ++successCount;\n                                    checkFinished();\n                                });\n                            }, onerror);\n                        }\n                        else if (thisContext.onsuccess) {\n                            // Hook will expect either onerror or onsuccess to always be called!\n                            thisContext.onsuccess(thisContext.value);\n                        }\n                    }\n                    function doReject(e) {\n                        if (e) {\n                            failures.push(e);\n                            failKeys.push(currentKey);\n                        }\n                        return reject(new ModifyError("Error modifying one or more objects", failures, successCount, failKeys));\n                    }\n                    function checkFinished() {\n                        if (iterationComplete && successCount + failures.length === count) {\n                            if (failures.length > 0)\n                                doReject();\n                            else\n                                resolve(successCount);\n                        }\n                    }\n                    self.clone().raw()._iterate(modifyItem, function () {\n                        iterationComplete = true;\n                        checkFinished();\n                    }, doReject, idbstore);\n                });\n            },\n            \'delete\': function () {\n                var _this = this;\n                var ctx = this._ctx, range = ctx.range, deletingHook = ctx.table.hook.deleting.fire, hasDeleteHook = deletingHook !== nop;\n                if (!hasDeleteHook &&\n                    isPlainKeyRange(ctx) &&\n                    ((ctx.isPrimKey && !hangsOnDeleteLargeKeyRange) || !range)) {\n                    // May use IDBObjectStore.delete(IDBKeyRange) in this case (Issue #208)\n                    // For chromium, this is the way most optimized version.\n                    // For IE/Edge, this could hang the indexedDB engine and make operating system instable\n                    // (https://gist.github.com/dfahlander/5a39328f029de18222cf2125d56c38f7)\n                    return this._write(function (resolve, reject, idbstore) {\n                        // Our API contract is to return a count of deleted items, so we have to count() before delete().\n                        var onerror = eventRejectHandler(reject), countReq = (range ? idbstore.count(range) : idbstore.count());\n                        countReq.onerror = onerror;\n                        countReq.onsuccess = function () {\n                            var count = countReq.result;\n                            tryCatch(function () {\n                                var delReq = (range ? idbstore.delete(range) : idbstore.clear());\n                                delReq.onerror = onerror;\n                                delReq.onsuccess = function () { return resolve(count); };\n                            }, function (err) { return reject(err); });\n                        };\n                    });\n                }\n                // Default version to use when collection is not a vanilla IDBKeyRange on the primary key.\n                // Divide into chunks to not starve RAM.\n                // If has delete hook, we will have to collect not just keys but also objects, so it will use\n                // more memory and need lower chunk size.\n                var CHUNKSIZE = hasDeleteHook ? 2000 : 10000;\n                return this._write(function (resolve, reject, idbstore, trans) {\n                    var totalCount = 0;\n                    // Clone collection and change its table and set a limit of CHUNKSIZE on the cloned Collection instance.\n                    var collection = _this\n                        .clone({\n                        keysOnly: !ctx.isMatch && !hasDeleteHook\n                    }) // load just keys (unless filter() or and() or deleteHook has subscribers)\n                        .distinct() // In case multiEntry is used, never delete same key twice because resulting count\n                        .limit(CHUNKSIZE)\n                        .raw(); // Don\'t filter through reading-hooks (like mapped classes etc)\n                    var keysOrTuples = [];\n                    // We\'re gonna do things on as many chunks that are needed.\n                    // Use recursion of nextChunk function:\n                    var nextChunk = function () { return collection.each(hasDeleteHook ? function (val, cursor) {\n                        // Somebody subscribes to hook(\'deleting\'). Collect all primary keys and their values,\n                        // so that the hook can be called with its values in bulkDelete().\n                        keysOrTuples.push([cursor.primaryKey, cursor.value]);\n                    } : function (val, cursor) {\n                        // No one subscribes to hook(\'deleting\'). Collect only primary keys:\n                        keysOrTuples.push(cursor.primaryKey);\n                    }).then(function () {\n                        // Chromium deletes faster when doing it in sort order.\n                        hasDeleteHook ?\n                            keysOrTuples.sort(function (a, b) { return ascending(a[0], b[0]); }) :\n                            keysOrTuples.sort(ascending);\n                        return bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook);\n                    }).then(function () {\n                        var count = keysOrTuples.length;\n                        totalCount += count;\n                        keysOrTuples = [];\n                        return count < CHUNKSIZE ? totalCount : nextChunk();\n                    }); };\n                    resolve(nextChunk());\n                });\n            }\n        };\n    });\n    //\n    //\n    //\n    // ------------------------- Help functions ---------------------------\n    //\n    //\n    //\n    function lowerVersionFirst(a, b) {\n        return a._cfg.version - b._cfg.version;\n    }\n    function setApiOnPlace(objs, tableNames, dbschema) {\n        tableNames.forEach(function (tableName) {\n            var schema = dbschema[tableName];\n            objs.forEach(function (obj) {\n                if (!(tableName in obj)) {\n                    if (obj === Transaction.prototype || obj instanceof Transaction) {\n                        // obj is a Transaction prototype (or prototype of a subclass to Transaction)\n                        // Make the API a getter that returns this.table(tableName)\n                        setProp(obj, tableName, { get: function () { return this.table(tableName); } });\n                    }\n                    else {\n                        // Table will not be bound to a transaction (will use Dexie.currentTransaction)\n                        obj[tableName] = new Table(tableName, schema);\n                    }\n                }\n            });\n        });\n    }\n    function removeTablesApi(objs) {\n        objs.forEach(function (obj) {\n            for (var key in obj) {\n                if (obj[key] instanceof Table)\n                    delete obj[key];\n            }\n        });\n    }\n    function iterate(req, filter, fn, resolve, reject, valueMapper) {\n        // Apply valueMapper (hook(\'reading\') or mappped class)\n        var mappedFn = valueMapper ? function (x, c, a) { return fn(valueMapper(x), c, a); } : fn;\n        // Wrap fn with PSD and microtick stuff from Promise.\n        var wrappedFn = wrap(mappedFn, reject);\n        if (!req.onerror)\n            req.onerror = eventRejectHandler(reject);\n        if (filter) {\n            req.onsuccess = trycatcher(function filter_record() {\n                var cursor = req.result;\n                if (cursor) {\n                    var c = function () { cursor.continue(); };\n                    if (filter(cursor, function (advancer) { c = advancer; }, resolve, reject))\n                        wrappedFn(cursor.value, cursor, function (advancer) { c = advancer; });\n                    c();\n                }\n                else {\n                    resolve();\n                }\n            }, reject);\n        }\n        else {\n            req.onsuccess = trycatcher(function filter_record() {\n                var cursor = req.result;\n                if (cursor) {\n                    var c = function () { cursor.continue(); };\n                    wrappedFn(cursor.value, cursor, function (advancer) { c = advancer; });\n                    c();\n                }\n                else {\n                    resolve();\n                }\n            }, reject);\n        }\n    }\n    function parseIndexSyntax(indexes) {\n        /// <param name="indexes" type="String"></param>\n        /// <returns type="Array" elementType="IndexSpec"></returns>\n        var rv = [];\n        indexes.split(\',\').forEach(function (index) {\n            index = index.trim();\n            var name = index.replace(/([&*]|\\+\\+)/g, ""); // Remove "&", "++" and "*"\n            // Let keyPath of "[a+b]" be ["a","b"]:\n            var keyPath = /^\\[/.test(name) ? name.match(/^\\[(.*)\\]$/)[1].split(\'+\') : name;\n            rv.push(new IndexSpec(name, keyPath || null, /\\&/.test(index), /\\*/.test(index), /\\+\\+/.test(index), isArray(keyPath), /\\./.test(index)));\n        });\n        return rv;\n    }\n    function cmp(key1, key2) {\n        return indexedDB.cmp(key1, key2);\n    }\n    function min(a, b) {\n        return cmp(a, b) < 0 ? a : b;\n    }\n    function max(a, b) {\n        return cmp(a, b) > 0 ? a : b;\n    }\n    function ascending(a, b) {\n        return indexedDB.cmp(a, b);\n    }\n    function descending(a, b) {\n        return indexedDB.cmp(b, a);\n    }\n    function simpleCompare(a, b) {\n        return a < b ? -1 : a === b ? 0 : 1;\n    }\n    function simpleCompareReverse(a, b) {\n        return a > b ? -1 : a === b ? 0 : 1;\n    }\n    function combine(filter1, filter2) {\n        return filter1 ?\n            filter2 ?\n                function () { return filter1.apply(this, arguments) && filter2.apply(this, arguments); } :\n                filter1 :\n            filter2;\n    }\n    function readGlobalSchema() {\n        db.verno = idbdb.version / 10;\n        db._dbSchema = globalSchema = {};\n        dbStoreNames = slice(idbdb.objectStoreNames, 0);\n        if (dbStoreNames.length === 0)\n            return; // Database contains no stores.\n        var trans = idbdb.transaction(safariMultiStoreFix(dbStoreNames), \'readonly\');\n        dbStoreNames.forEach(function (storeName) {\n            var store = trans.objectStore(storeName), keyPath = store.keyPath, dotted = keyPath && typeof keyPath === \'string\' && keyPath.indexOf(\'.\') !== -1;\n            var primKey = new IndexSpec(keyPath, keyPath || "", false, false, !!store.autoIncrement, keyPath && typeof keyPath !== \'string\', dotted);\n            var indexes = [];\n            for (var j = 0; j < store.indexNames.length; ++j) {\n                var idbindex = store.index(store.indexNames[j]);\n                keyPath = idbindex.keyPath;\n                dotted = keyPath && typeof keyPath === \'string\' && keyPath.indexOf(\'.\') !== -1;\n                var index = new IndexSpec(idbindex.name, keyPath, !!idbindex.unique, !!idbindex.multiEntry, false, keyPath && typeof keyPath !== \'string\', dotted);\n                indexes.push(index);\n            }\n            globalSchema[storeName] = new TableSchema(storeName, primKey, indexes, {});\n        });\n        setApiOnPlace([allTables], keys(globalSchema), globalSchema);\n    }\n    function adjustToExistingIndexNames(schema, idbtrans) {\n        /// <summary>\n        /// Issue #30 Problem with existing db - adjust to existing index names when migrating from non-dexie db\n        /// </summary>\n        /// <param name="schema" type="Object">Map between name and TableSchema</param>\n        /// <param name="idbtrans" type="IDBTransaction"></param>\n        var storeNames = idbtrans.db.objectStoreNames;\n        for (var i = 0; i < storeNames.length; ++i) {\n            var storeName = storeNames[i];\n            var store = idbtrans.objectStore(storeName);\n            hasGetAll = \'getAll\' in store;\n            for (var j = 0; j < store.indexNames.length; ++j) {\n                var indexName = store.indexNames[j];\n                var keyPath = store.index(indexName).keyPath;\n                var dexieName = typeof keyPath === \'string\' ? keyPath : "[" + slice(keyPath).join(\'+\') + "]";\n                if (schema[storeName]) {\n                    var indexSpec = schema[storeName].idxByName[dexieName];\n                    if (indexSpec)\n                        indexSpec.name = indexName;\n                }\n            }\n        }\n        // Bug with getAll() on Safari ver<604 on Workers only, see discussion following PR #579\n        if (/Safari/.test(navigator.userAgent) &&\n            !/(Chrome\\/|Edge\\/)/.test(navigator.userAgent) &&\n            _global.WorkerGlobalScope && _global instanceof _global.WorkerGlobalScope &&\n            [].concat(navigator.userAgent.match(/Safari\\/(\\d*)/))[1] < 604) {\n            hasGetAll = false;\n        }\n    }\n    function fireOnBlocked(ev) {\n        db.on("blocked").fire(ev);\n        // Workaround (not fully*) for missing "versionchange" event in IE,Edge and Safari:\n        connections\n            .filter(function (c) { return c.name === db.name && c !== db && !c._vcFired; })\n            .map(function (c) { return c.on("versionchange").fire(ev); });\n    }\n    extend(this, {\n        Collection: Collection,\n        Table: Table,\n        Transaction: Transaction,\n        Version: Version,\n        WhereClause: WhereClause\n    });\n    init();\n    addons.forEach(function (fn) {\n        fn(db);\n    });\n}\nfunction parseType(type) {\n    if (typeof type === \'function\') {\n        return new type();\n    }\n    else if (isArray(type)) {\n        return [parseType(type[0])];\n    }\n    else if (type && typeof type === \'object\') {\n        var rv = {};\n        applyStructure(rv, type);\n        return rv;\n    }\n    else {\n        return type;\n    }\n}\nfunction applyStructure(obj, structure) {\n    keys(structure).forEach(function (member) {\n        var value = parseType(structure[member]);\n        obj[member] = value;\n    });\n    return obj;\n}\nfunction hookedEventSuccessHandler(resolve) {\n    // wrap() is needed when calling hooks because the rare scenario of:\n    //  * hook does a db operation that fails immediately (IDB throws exception)\n    //    For calling db operations on correct transaction, wrap makes sure to set PSD correctly.\n    //    wrap() will also execute in a virtual tick.\n    //  * If not wrapped in a virtual tick, direct exception will launch a new physical tick.\n    //  * If this was the last event in the bulk, the promise will resolve after a physical tick\n    //    and the transaction will have committed already.\n    // If no hook, the virtual tick will be executed in the reject()/resolve of the final promise,\n    // because it is always marked with _lib = true when created using Transaction._promise().\n    return wrap(function (event) {\n        var req = event.target, ctx = req._hookCtx, // Contains the hook error handler. Put here instead of closure to boost performance.\n        result = ctx.value || req.result, // Pass the object value on updates. The result from IDB is the primary key.\n        hookSuccessHandler = ctx && ctx.onsuccess;\n        hookSuccessHandler && hookSuccessHandler(result);\n        resolve && resolve(result);\n    }, resolve);\n}\nfunction eventRejectHandler(reject) {\n    return wrap(function (event) {\n        preventDefault(event);\n        reject(event.target.error);\n        return false;\n    });\n}\nfunction eventSuccessHandler(resolve) {\n    return wrap(function (event) {\n        resolve(event.target.result);\n    });\n}\nfunction hookedEventRejectHandler(reject) {\n    return wrap(function (event) {\n        // See comment on hookedEventSuccessHandler() why wrap() is needed only when supporting hooks.\n        var req = event.target, err = req.error, ctx = req._hookCtx, // Contains the hook error handler. Put here instead of closure to boost performance.\n        hookErrorHandler = ctx && ctx.onerror;\n        hookErrorHandler && hookErrorHandler(err);\n        preventDefault(event);\n        reject(err);\n        return false;\n    });\n}\nfunction preventDefault(event) {\n    if (event.stopPropagation)\n        event.stopPropagation();\n    if (event.preventDefault)\n        event.preventDefault();\n}\nfunction awaitIterator(iterator) {\n    var callNext = function (result) { return iterator.next(result); }, doThrow = function (error) { return iterator.throw(error); }, onSuccess = step(callNext), onError = step(doThrow);\n    function step(getNext) {\n        return function (val) {\n            var next = getNext(val), value = next.value;\n            return next.done ? value :\n                (!value || typeof value.then !== \'function\' ?\n                    isArray(value) ? Promise.all(value).then(onSuccess, onError) : onSuccess(value) :\n                    value.then(onSuccess, onError));\n        };\n    }\n    return step(callNext)();\n}\n//\n// IndexSpec struct\n//\nfunction IndexSpec(name, keyPath, unique, multi, auto, compound, dotted) {\n    /// <param name="name" type="String"></param>\n    /// <param name="keyPath" type="String"></param>\n    /// <param name="unique" type="Boolean"></param>\n    /// <param name="multi" type="Boolean"></param>\n    /// <param name="auto" type="Boolean"></param>\n    /// <param name="compound" type="Boolean"></param>\n    /// <param name="dotted" type="Boolean"></param>\n    this.name = name;\n    this.keyPath = keyPath;\n    this.unique = unique;\n    this.multi = multi;\n    this.auto = auto;\n    this.compound = compound;\n    this.dotted = dotted;\n    var keyPathSrc = typeof keyPath === \'string\' ? keyPath : keyPath && (\'[\' + [].join.call(keyPath, \'+\') + \']\');\n    this.src = (unique ? \'&\' : \'\') + (multi ? \'*\' : \'\') + (auto ? "++" : "") + keyPathSrc;\n}\n//\n// TableSchema struct\n//\nfunction TableSchema(name, primKey, indexes, instanceTemplate) {\n    /// <param name="name" type="String"></param>\n    /// <param name="primKey" type="IndexSpec"></param>\n    /// <param name="indexes" type="Array" elementType="IndexSpec"></param>\n    /// <param name="instanceTemplate" type="Object"></param>\n    this.name = name;\n    this.primKey = primKey || new IndexSpec();\n    this.indexes = indexes || [new IndexSpec()];\n    this.instanceTemplate = instanceTemplate;\n    this.mappedClass = null;\n    this.idxByName = arrayToObject(indexes, function (index) { return [index.name, index]; });\n}\nfunction safariMultiStoreFix(storeNames) {\n    return storeNames.length === 1 ? storeNames[0] : storeNames;\n}\nfunction getNativeGetDatabaseNamesFn(indexedDB) {\n    var fn = indexedDB && (indexedDB.getDatabaseNames || indexedDB.webkitGetDatabaseNames);\n    return fn && fn.bind(indexedDB);\n}\n// Export Error classes\nprops(Dexie, fullNameExceptions); // Dexie.XXXError = class XXXError {...};\n//\n// Static methods and properties\n// \nprops(Dexie, {\n    //\n    // Static delete() method.\n    //\n    delete: function (databaseName) {\n        var db = new Dexie(databaseName), promise = db.delete();\n        promise.onblocked = function (fn) {\n            db.on("blocked", fn);\n            return this;\n        };\n        return promise;\n    },\n    //\n    // Static exists() method.\n    //\n    exists: function (name) {\n        return new Dexie(name).open().then(function (db) {\n            db.close();\n            return true;\n        }).catch(Dexie.NoSuchDatabaseError, function () { return false; });\n    },\n    //\n    // Static method for retrieving a list of all existing databases at current host.\n    //\n    getDatabaseNames: function (cb) {\n        var getDatabaseNames = getNativeGetDatabaseNamesFn(Dexie.dependencies.indexedDB);\n        return getDatabaseNames ? new Promise(function (resolve, reject) {\n            var req = getDatabaseNames();\n            req.onsuccess = function (event) {\n                resolve(slice(event.target.result, 0)); // Converst DOMStringList to Array<String>\n            };\n            req.onerror = eventRejectHandler(reject);\n        }).then(cb) : dbNamesDB.dbnames.toCollection().primaryKeys(cb);\n    },\n    defineClass: function () {\n        // Default constructor able to copy given properties into this object.\n        function Class(properties) {\n            /// <param name="properties" type="Object" optional="true">Properties to initialize object with.\n            /// </param>\n            if (properties)\n                extend(this, properties);\n        }\n        return Class;\n    },\n    applyStructure: applyStructure,\n    ignoreTransaction: function (scopeFunc) {\n        // In case caller is within a transaction but needs to create a separate transaction.\n        // Example of usage:\n        //\n        // Let\'s say we have a logger function in our app. Other application-logic should be unaware of the\n        // logger function and not need to include the \'logentries\' table in all transaction it performs.\n        // The logging should always be done in a separate transaction and not be dependant on the current\n        // running transaction context. Then you could use Dexie.ignoreTransaction() to run code that starts a new transaction.\n        //\n        //     Dexie.ignoreTransaction(function() {\n        //         db.logentries.add(newLogEntry);\n        //     });\n        //\n        // Unless using Dexie.ignoreTransaction(), the above example would try to reuse the current transaction\n        // in current Promise-scope.\n        //\n        // An alternative to Dexie.ignoreTransaction() would be setImmediate() or setTimeout(). The reason we still provide an\n        // API for this because\n        //  1) The intention of writing the statement could be unclear if using setImmediate() or setTimeout().\n        //  2) setTimeout() would wait unnescessary until firing. This is however not the case with setImmediate().\n        //  3) setImmediate() is not supported in the ES standard.\n        //  4) You might want to keep other PSD state that was set in a parent PSD, such as PSD.letThrough.\n        return PSD.trans ?\n            usePSD(PSD.transless, scopeFunc) : // Use the closest parent that was non-transactional.\n            scopeFunc(); // No need to change scope because there is no ongoing transaction.\n    },\n    vip: function (fn) {\n        // To be used by subscribers to the on(\'ready\') event.\n        // This will let caller through to access DB even when it is blocked while the db.ready() subscribers are firing.\n        // This would have worked automatically if we were certain that the Provider was using Dexie.Promise for all asyncronic operations. The promise PSD\n        // from the provider.connect() call would then be derived all the way to when provider would call localDatabase.applyChanges(). But since\n        // the provider more likely is using non-promise async APIs or other thenable implementations, we cannot assume that.\n        // Note that this method is only useful for on(\'ready\') subscribers that is returning a Promise from the event. If not using vip()\n        // the database could deadlock since it wont open until the returned Promise is resolved, and any non-VIPed operation started by\n        // the caller will not resolve until database is opened.\n        return newScope(function () {\n            PSD.letThrough = true; // Make sure we are let through if still blocking db due to onready is firing.\n            return fn();\n        });\n    },\n    async: function (generatorFn) {\n        return function () {\n            try {\n                var rv = awaitIterator(generatorFn.apply(this, arguments));\n                if (!rv || typeof rv.then !== \'function\')\n                    return Promise.resolve(rv);\n                return rv;\n            }\n            catch (e) {\n                return rejection(e);\n            }\n        };\n    },\n    spawn: function (generatorFn, args, thiz) {\n        try {\n            var rv = awaitIterator(generatorFn.apply(thiz, args || []));\n            if (!rv || typeof rv.then !== \'function\')\n                return Promise.resolve(rv);\n            return rv;\n        }\n        catch (e) {\n            return rejection(e);\n        }\n    },\n    // Dexie.currentTransaction property\n    currentTransaction: {\n        get: function () { return PSD.trans || null; }\n    },\n    waitFor: function (promiseOrFunction, optionalTimeout) {\n        // If a function is provided, invoke it and pass the returning value to Transaction.waitFor()\n        var promise = Promise.resolve(typeof promiseOrFunction === \'function\' ? Dexie.ignoreTransaction(promiseOrFunction) : promiseOrFunction)\n            .timeout(optionalTimeout || 60000); // Default the timeout to one minute. Caller may specify Infinity if required.       \n        // Run given promise on current transaction. If no current transaction, just return a Dexie promise based\n        // on given value.\n        return PSD.trans ? PSD.trans.waitFor(promise) : promise;\n    },\n    // Export our Promise implementation since it can be handy as a standalone Promise implementation\n    Promise: Promise,\n    // Dexie.debug proptery:\n    // Dexie.debug = false\n    // Dexie.debug = true\n    // Dexie.debug = "dexie" - don\'t hide dexie\'s stack frames.\n    debug: {\n        get: function () { return debug; },\n        set: function (value) {\n            setDebug(value, value === \'dexie\' ? function () { return true; } : dexieStackFrameFilter);\n        }\n    },\n    // Export our derive/extend/override methodology\n    derive: derive,\n    extend: extend,\n    props: props,\n    override: override,\n    // Export our Events() function - can be handy as a toolkit\n    Events: Events,\n    // Utilities\n    getByKeyPath: getByKeyPath,\n    setByKeyPath: setByKeyPath,\n    delByKeyPath: delByKeyPath,\n    shallowClone: shallowClone,\n    deepClone: deepClone,\n    getObjectDiff: getObjectDiff,\n    asap: asap,\n    maxKey: maxKey,\n    minKey: minKey,\n    // Addon registry\n    addons: [],\n    // Global DB connection list\n    connections: connections,\n    MultiModifyError: exceptions.Modify,\n    errnames: errnames,\n    // Export other static classes\n    IndexSpec: IndexSpec,\n    TableSchema: TableSchema,\n    //\n    // Dependencies\n    //\n    // These will automatically work in browsers with indexedDB support, or where an indexedDB polyfill has been included.\n    //\n    // In node.js, however, these properties must be set "manually" before instansiating a new Dexie().\n    // For node.js, you need to require indexeddb-js or similar and then set these deps.\n    //\n    dependencies: {\n        // Required:\n        indexedDB: _global.indexedDB || _global.mozIndexedDB || _global.webkitIndexedDB || _global.msIndexedDB,\n        IDBKeyRange: _global.IDBKeyRange || _global.webkitIDBKeyRange\n    },\n    // API Version Number: Type Number, make sure to always set a version number that can be comparable correctly. Example: 0.9, 0.91, 0.92, 1.0, 1.01, 1.1, 1.2, 1.21, etc.\n    semVer: DEXIE_VERSION,\n    version: DEXIE_VERSION.split(\'.\')\n        .map(function (n) { return parseInt(n); })\n        .reduce(function (p, c, i) { return p + (c / Math.pow(10, i * 2)); }),\n    // https://github.com/dfahlander/Dexie.js/issues/186\n    // typescript compiler tsc in mode ts--\x3ees5 & commonJS, will expect require() to return\n    // x.default. Workaround: Set Dexie.default = Dexie.\n    default: Dexie,\n    // Make it possible to import {Dexie} (non-default import)\n    // Reason 1: May switch to that in future.\n    // Reason 2: We declare it both default and named exported in d.ts to make it possible\n    // to let addons extend the Dexie interface with Typescript 2.1 (works only when explicitely\n    // exporting the symbol, not just default exporting)\n    Dexie: Dexie\n});\n// Map DOMErrors and DOMExceptions to corresponding Dexie errors. May change in Dexie v2.0.\nPromise.rejectionMapper = mapError;\n// Initialize dbNamesDB (won\'t ever be opened on chromium browsers\')\ndbNamesDB = new Dexie(\'__dbnames\');\ndbNamesDB.version(1).stores({ dbnames: \'name\' });\n(function () {\n    // Migrate from Dexie 1.x database names stored in localStorage:\n    var DBNAMES = \'Dexie.DatabaseNames\';\n    try {\n        if (typeof localStorage !== undefined && _global.document !== undefined) {\n            // Have localStorage and is not executing in a worker. Lets migrate from Dexie 1.x.\n            JSON.parse(localStorage.getItem(DBNAMES) || "[]")\n                .forEach(function (name) { return dbNamesDB.dbnames.put({ name: name }).catch(nop); });\n            localStorage.removeItem(DBNAMES);\n        }\n    }\n    catch (_e) { }\n})();\n\n/* harmony default export */ __webpack_exports__["default"] = (Dexie);\n//# sourceMappingURL=dexie.es.js.map\n\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(2), __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dexie/dist/dexie.es.js\n// module id = 399\n// module chunks = 0\n\n//# sourceURL=../node_modules/dexie/dist/dexie.es.js')},function(module,exports,__webpack_require__){eval("var randomBytes = __webpack_require__(80);\nmodule.exports = findPrime;\nfindPrime.simpleSieve = simpleSieve;\nfindPrime.fermatTest = fermatTest;\nvar BN = __webpack_require__(17);\nvar TWENTYFOUR = new BN(24);\nvar MillerRabin = __webpack_require__(469);\nvar millerRabin = new MillerRabin();\nvar ONE = new BN(1);\nvar TWO = new BN(2);\nvar FIVE = new BN(5);\nvar SIXTEEN = new BN(16);\nvar EIGHT = new BN(8);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar ELEVEN = new BN(11);\nvar FOUR = new BN(4);\nvar TWELVE = new BN(12);\nvar primes = null;\n\nfunction _getPrimes() {\n  if (primes !== null)\n    return primes;\n\n  var limit = 0x100000;\n  var res = [];\n  res[0] = 2;\n  for (var i = 1, k = 3; k < limit; k += 2) {\n    var sqrt = Math.ceil(Math.sqrt(k));\n    for (var j = 0; j < i && res[j] <= sqrt; j++)\n      if (k % res[j] === 0)\n        break;\n\n    if (i !== j && res[j] <= sqrt)\n      continue;\n\n    res[i++] = k;\n  }\n  primes = res;\n  return res;\n}\n\nfunction simpleSieve(p) {\n  var primes = _getPrimes();\n\n  for (var i = 0; i < primes.length; i++)\n    if (p.modn(primes[i]) === 0) {\n      if (p.cmpn(primes[i]) === 0) {\n        return true;\n      } else {\n        return false;\n      }\n    }\n\n  return true;\n}\n\nfunction fermatTest(p) {\n  var red = BN.mont(p);\n  return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\n}\n\nfunction findPrime(bits, gen) {\n  if (bits < 16) {\n    // this is what openssl does\n    if (gen === 2 || gen === 5) {\n      return new BN([0x8c, 0x7b]);\n    } else {\n      return new BN([0x8c, 0x27]);\n    }\n  }\n  gen = new BN(gen);\n\n  var num, n2;\n\n  while (true) {\n    num = new BN(randomBytes(Math.ceil(bits / 8)));\n    while (num.bitLength() > bits) {\n      num.ishrn(1);\n    }\n    if (num.isEven()) {\n      num.iadd(ONE);\n    }\n    if (!num.testn(1)) {\n      num.iadd(TWO);\n    }\n    if (!gen.cmp(TWO)) {\n      while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {\n        num.iadd(FOUR);\n      }\n    } else if (!gen.cmp(FIVE)) {\n      while (num.mod(TEN).cmp(THREE)) {\n        num.iadd(FOUR);\n      }\n    }\n    n2 = num.shrn(1);\n    if (simpleSieve(n2) && simpleSieve(num) &&\n      fermatTest(n2) && fermatTest(num) &&\n      millerRabin.test(n2) && millerRabin.test(num)) {\n      return num;\n    }\n  }\n\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/diffie-hellman/lib/generatePrime.js\n// module id = 400\n// module chunks = 0\n\n//# sourceURL=../node_modules/diffie-hellman/lib/generatePrime.js")},function(module,exports,__webpack_require__){eval("var assert = __webpack_require__(16)\nvar BigInteger = __webpack_require__(88)\n\nvar Point = __webpack_require__(402)\n\nfunction Curve (p, a, b, Gx, Gy, n, h) {\n  this.p = p\n  this.a = a\n  this.b = b\n  this.G = Point.fromAffine(this, Gx, Gy)\n  this.n = n\n  this.h = h\n\n  this.infinity = new Point(this, null, null, BigInteger.ZERO)\n\n  // result caching\n  this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)\n\n  // determine size of p in bytes\n  this.pLength = Math.floor((this.p.bitLength() + 7) / 8)\n}\n\nCurve.prototype.pointFromX = function (isOdd, x) {\n  var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)\n  var beta = alpha.modPow(this.pOverFour, this.p) // XXX: not compatible with all curves\n\n  var y = beta\n  if (beta.isEven() ^ !isOdd) {\n    y = this.p.subtract(y) // -y % p\n  }\n\n  return Point.fromAffine(this, x, y)\n}\n\nCurve.prototype.isInfinity = function (Q) {\n  if (Q === this.infinity) return true\n\n  return Q.z.signum() === 0 && Q.y.signum() !== 0\n}\n\nCurve.prototype.isOnCurve = function (Q) {\n  if (this.isInfinity(Q)) return true\n\n  var x = Q.affineX\n  var y = Q.affineY\n  var a = this.a\n  var b = this.b\n  var p = this.p\n\n  // Check that xQ and yQ are integers in the interval [0, p - 1]\n  if (x.signum() < 0 || x.compareTo(p) >= 0) return false\n  if (y.signum() < 0 || y.compareTo(p) >= 0) return false\n\n  // and check that y^2 = x^3 + ax + b (mod p)\n  var lhs = y.square().mod(p)\n  var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)\n  return lhs.equals(rhs)\n}\n\n/**\n * Validate an elliptic curve point.\n *\n * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive\n */\nCurve.prototype.validate = function (Q) {\n  // Check Q != O\n  assert(!this.isInfinity(Q), 'Point is at infinity')\n  assert(this.isOnCurve(Q), 'Point is not on the curve')\n\n  // Check nQ = O (where Q is a scalar multiple of G)\n  var nQ = Q.multiply(this.n)\n  assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')\n\n  return true\n}\n\nmodule.exports = Curve\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ecurve/lib/curve.js\n// module id = 401\n// module chunks = 0\n\n//# sourceURL=../node_modules/ecurve/lib/curve.js")},function(module,exports,__webpack_require__){eval("var assert = __webpack_require__(16)\nvar Buffer = __webpack_require__(1).Buffer\nvar BigInteger = __webpack_require__(88)\n\nvar THREE = BigInteger.valueOf(3)\n\nfunction Point (curve, x, y, z) {\n  assert.notStrictEqual(z, undefined, 'Missing Z coordinate')\n\n  this.curve = curve\n  this.x = x\n  this.y = y\n  this.z = z\n  this._zInv = null\n\n  this.compressed = true\n}\n\nObject.defineProperty(Point.prototype, 'zInv', {\n  get: function () {\n    if (this._zInv === null) {\n      this._zInv = this.z.modInverse(this.curve.p)\n    }\n\n    return this._zInv\n  }\n})\n\nObject.defineProperty(Point.prototype, 'affineX', {\n  get: function () {\n    return this.x.multiply(this.zInv).mod(this.curve.p)\n  }\n})\n\nObject.defineProperty(Point.prototype, 'affineY', {\n  get: function () {\n    return this.y.multiply(this.zInv).mod(this.curve.p)\n  }\n})\n\nPoint.fromAffine = function (curve, x, y) {\n  return new Point(curve, x, y, BigInteger.ONE)\n}\n\nPoint.prototype.equals = function (other) {\n  if (other === this) return true\n  if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)\n  if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)\n\n  // u = Y2 * Z1 - Y1 * Z2\n  var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)\n\n  if (u.signum() !== 0) return false\n\n  // v = X2 * Z1 - X1 * Z2\n  var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)\n\n  return v.signum() === 0\n}\n\nPoint.prototype.negate = function () {\n  var y = this.curve.p.subtract(this.y)\n\n  return new Point(this.curve, this.x, y, this.z)\n}\n\nPoint.prototype.add = function (b) {\n  if (this.curve.isInfinity(this)) return b\n  if (this.curve.isInfinity(b)) return this\n\n  var x1 = this.x\n  var y1 = this.y\n  var x2 = b.x\n  var y2 = b.y\n\n  // u = Y2 * Z1 - Y1 * Z2\n  var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)\n  // v = X2 * Z1 - X1 * Z2\n  var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)\n\n  if (v.signum() === 0) {\n    if (u.signum() === 0) {\n      return this.twice() // this == b, so double\n    }\n\n    return this.curve.infinity // this = -b, so infinity\n  }\n\n  var v2 = v.square()\n  var v3 = v2.multiply(v)\n  var x1v2 = x1.multiply(v2)\n  var zu2 = u.square().multiply(this.z)\n\n  // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)\n  var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)\n  // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3\n  var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)\n  // z3 = v^3 * z1 * z2\n  var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)\n\n  return new Point(this.curve, x3, y3, z3)\n}\n\nPoint.prototype.twice = function () {\n  if (this.curve.isInfinity(this)) return this\n  if (this.y.signum() === 0) return this.curve.infinity\n\n  var x1 = this.x\n  var y1 = this.y\n\n  var y1z1 = y1.multiply(this.z).mod(this.curve.p)\n  var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)\n  var a = this.curve.a\n\n  // w = 3 * x1^2 + a * z1^2\n  var w = x1.square().multiply(THREE)\n\n  if (a.signum() !== 0) {\n    w = w.add(this.z.square().multiply(a))\n  }\n\n  w = w.mod(this.curve.p)\n  // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)\n  var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)\n  // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3\n  var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)\n  // z3 = 8 * (y1 * z1)^3\n  var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)\n\n  return new Point(this.curve, x3, y3, z3)\n}\n\n// Simple NAF (Non-Adjacent Form) multiplication algorithm\n// TODO: modularize the multiplication algorithm\nPoint.prototype.multiply = function (k) {\n  if (this.curve.isInfinity(this)) return this\n  if (k.signum() === 0) return this.curve.infinity\n\n  var e = k\n  var h = e.multiply(THREE)\n\n  var neg = this.negate()\n  var R = this\n\n  for (var i = h.bitLength() - 2; i > 0; --i) {\n    var hBit = h.testBit(i)\n    var eBit = e.testBit(i)\n\n    R = R.twice()\n\n    if (hBit !== eBit) {\n      R = R.add(hBit ? this : neg)\n    }\n  }\n\n  return R\n}\n\n// Compute this*j + x*k (simultaneous multiplication)\nPoint.prototype.multiplyTwo = function (j, x, k) {\n  var i = Math.max(j.bitLength(), k.bitLength()) - 1\n  var R = this.curve.infinity\n  var both = this.add(x)\n\n  while (i >= 0) {\n    var jBit = j.testBit(i)\n    var kBit = k.testBit(i)\n\n    R = R.twice()\n\n    if (jBit) {\n      if (kBit) {\n        R = R.add(both)\n      } else {\n        R = R.add(this)\n      }\n    } else if (kBit) {\n      R = R.add(x)\n    }\n    --i\n  }\n\n  return R\n}\n\nPoint.prototype.getEncoded = function (compressed) {\n  if (compressed == null) compressed = this.compressed\n  if (this.curve.isInfinity(this)) return Buffer.alloc(1, 0) // Infinity point encoded is simply '00'\n\n  var x = this.affineX\n  var y = this.affineY\n  var byteLength = this.curve.pLength\n  var buffer\n\n  // 0x02/0x03 | X\n  if (compressed) {\n    buffer = Buffer.allocUnsafe(1 + byteLength)\n    buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)\n\n  // 0x04 | X | Y\n  } else {\n    buffer = Buffer.allocUnsafe(1 + byteLength + byteLength)\n    buffer.writeUInt8(0x04, 0)\n\n    y.toBuffer(byteLength).copy(buffer, 1 + byteLength)\n  }\n\n  x.toBuffer(byteLength).copy(buffer, 1)\n\n  return buffer\n}\n\nPoint.decodeFrom = function (curve, buffer) {\n  var type = buffer.readUInt8(0)\n  var compressed = (type !== 4)\n\n  var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)\n  var x = BigInteger.fromBuffer(buffer.slice(1, 1 + byteLength))\n\n  var Q\n  if (compressed) {\n    assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')\n    assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')\n\n    var isOdd = (type === 0x03)\n    Q = curve.pointFromX(isOdd, x)\n  } else {\n    assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')\n\n    var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))\n    Q = Point.fromAffine(curve, x, y)\n  }\n\n  Q.compressed = compressed\n  return Q\n}\n\nPoint.prototype.toString = function () {\n  if (this.curve.isInfinity(this)) return '(INFINITY)'\n\n  return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'\n}\n\nmodule.exports = Point\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ecurve/lib/point.js\n// module id = 402\n// module chunks = 0\n\n//# sourceURL=../node_modules/ecurve/lib/point.js")},function(module,exports,__webpack_require__){eval("var once = __webpack_require__(53);\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tif (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/end-of-stream/index.js\n// module id = 403\n// module chunks = 0\n\n//# sourceURL=../node_modules/end-of-stream/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Module dependencies\n */\n\nvar XMLHttpRequest = __webpack_require__(259);\nvar XHR = __webpack_require__(837);\nvar JSONP = __webpack_require__(836);\nvar websocket = __webpack_require__(838);\n\n/**\n * Export transports.\n */\n\nexports.polling = polling;\nexports.websocket = websocket;\n\n/**\n * Polling transport polymorphic constructor.\n * Decides on xhr vs jsonp based on feature detection.\n *\n * @api private\n */\n\nfunction polling (opts) {\n  var xhr;\n  var xd = false;\n  var xs = false;\n  var jsonp = false !== opts.jsonp;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    xd = opts.hostname !== location.hostname || port !== opts.port;\n    xs = opts.secure !== isSSL;\n  }\n\n  opts.xdomain = xd;\n  opts.xscheme = xs;\n  xhr = new XMLHttpRequest(opts);\n\n  if ('open' in xhr && !opts.forceJSONP) {\n    return new XHR(opts);\n  } else {\n    if (!jsonp) throw new Error('JSONP disabled');\n    return new JSONP(opts);\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/index.js\n// module id = 404\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transports/index.js")},function(module,exports,__webpack_require__){eval("/**\n * Module dependencies.\n */\n\nvar Transport = __webpack_require__(258);\nvar parseqs = __webpack_require__(201);\nvar parser = __webpack_require__(119);\nvar inherit = __webpack_require__(169);\nvar yeast = __webpack_require__(564);\nvar debug = __webpack_require__(5)('engine.io-client:polling');\n\n/**\n * Module exports.\n */\n\nmodule.exports = Polling;\n\n/**\n * Is XHR2 supported?\n */\n\nvar hasXHR2 = (function () {\n  var XMLHttpRequest = __webpack_require__(259);\n  var xhr = new XMLHttpRequest({ xdomain: false });\n  return null != xhr.responseType;\n})();\n\n/**\n * Polling interface.\n *\n * @param {Object} opts\n * @api private\n */\n\nfunction Polling (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (!hasXHR2 || forceBase64) {\n    this.supportsBinary = false;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(Polling, Transport);\n\n/**\n * Transport name.\n */\n\nPolling.prototype.name = 'polling';\n\n/**\n * Opens the socket (triggers polling). We write a PING message to determine\n * when the transport is open.\n *\n * @api private\n */\n\nPolling.prototype.doOpen = function () {\n  this.poll();\n};\n\n/**\n * Pauses polling.\n *\n * @param {Function} callback upon buffers are flushed and transport is paused\n * @api private\n */\n\nPolling.prototype.pause = function (onPause) {\n  var self = this;\n\n  this.readyState = 'pausing';\n\n  function pause () {\n    debug('paused');\n    self.readyState = 'paused';\n    onPause();\n  }\n\n  if (this.polling || !this.writable) {\n    var total = 0;\n\n    if (this.polling) {\n      debug('we are currently polling - waiting to pause');\n      total++;\n      this.once('pollComplete', function () {\n        debug('pre-pause polling complete');\n        --total || pause();\n      });\n    }\n\n    if (!this.writable) {\n      debug('we are currently writing - waiting to pause');\n      total++;\n      this.once('drain', function () {\n        debug('pre-pause writing complete');\n        --total || pause();\n      });\n    }\n  } else {\n    pause();\n  }\n};\n\n/**\n * Starts polling cycle.\n *\n * @api public\n */\n\nPolling.prototype.poll = function () {\n  debug('polling');\n  this.polling = true;\n  this.doPoll();\n  this.emit('poll');\n};\n\n/**\n * Overloads onData to detect payloads.\n *\n * @api private\n */\n\nPolling.prototype.onData = function (data) {\n  var self = this;\n  debug('polling got data %s', data);\n  var callback = function (packet, index, total) {\n    // if its the first message we consider the transport open\n    if ('opening' === self.readyState) {\n      self.onOpen();\n    }\n\n    // if its a close packet, we close the ongoing requests\n    if ('close' === packet.type) {\n      self.onClose();\n      return false;\n    }\n\n    // otherwise bypass onData and handle the message\n    self.onPacket(packet);\n  };\n\n  // decode payload\n  parser.decodePayload(data, this.socket.binaryType, callback);\n\n  // if an event did not trigger closing\n  if ('closed' !== this.readyState) {\n    // if we got data we're not polling\n    this.polling = false;\n    this.emit('pollComplete');\n\n    if ('open' === this.readyState) {\n      this.poll();\n    } else {\n      debug('ignoring poll - transport state \"%s\"', this.readyState);\n    }\n  }\n};\n\n/**\n * For polling, send a close packet.\n *\n * @api private\n */\n\nPolling.prototype.doClose = function () {\n  var self = this;\n\n  function close () {\n    debug('writing close packet');\n    self.write([{ type: 'close' }]);\n  }\n\n  if ('open' === this.readyState) {\n    debug('transport open - closing');\n    close();\n  } else {\n    // in case we're trying to close while\n    // handshaking is in progress (GH-164)\n    debug('transport not open - deferring close');\n    this.once('open', close);\n  }\n};\n\n/**\n * Writes a packets payload.\n *\n * @param {Array} data packets\n * @param {Function} drain callback\n * @api private\n */\n\nPolling.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n  var callbackfn = function () {\n    self.writable = true;\n    self.emit('drain');\n  };\n\n  parser.encodePayload(packets, this.supportsBinary, function (data) {\n    self.doWrite(data, callbackfn);\n  });\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nPolling.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'https' : 'http';\n  var port = '';\n\n  // cache busting is forced\n  if (false !== this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  if (!this.supportsBinary && !query.sid) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // avoid port if default for schema\n  if (this.port && (('https' === schema && Number(this.port) !== 443) ||\n     ('http' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling.js\n// module id = 405\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transports/polling.js")},function(module,exports,__webpack_require__){eval('var A = __webpack_require__(857);\n\nvar at = function at(bytes, index) {\n  return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\n};\n\nvar random = function random(bytes) {\n  var rnd = void 0;\n  if (typeof window !== "undefined" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(60).randomBytes(bytes);else throw "Safe random numbers not available.";\n  var hex = "0x";\n  for (var i = 0; i < bytes; ++i) {\n    hex += ("00" + rnd[i].toString(16)).slice(-2);\n  }return hex;\n};\n\nvar length = function length(a) {\n  return (a.length - 2) / 2;\n};\n\nvar flatten = function flatten(a) {\n  return "0x" + a.reduce(function (r, s) {\n    return r + s.slice(2);\n  }, "");\n};\n\nvar slice = function slice(i, j, bs) {\n  return "0x" + bs.slice(i * 2 + 2, j * 2 + 2);\n};\n\nvar reverse = function reverse(hex) {\n  var rev = "0x";\n  for (var i = 0, l = length(hex); i < l; ++i) {\n    rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\n  }\n  return rev;\n};\n\nvar pad = function pad(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : pad(l, "0x" + "0" + hex.slice(2));\n};\n\nvar padRight = function padRight(l, hex) {\n  return hex.length === l * 2 + 2 ? hex : padRight(l, hex + "0");\n};\n\nvar toArray = function toArray(hex) {\n  var arr = [];\n  for (var i = 2, l = hex.length; i < l; i += 2) {\n    arr.push(parseInt(hex.slice(i, i + 2), 16));\n  }return arr;\n};\n\nvar fromArray = function fromArray(arr) {\n  var hex = "0x";\n  for (var i = 0, l = arr.length; i < l; ++i) {\n    var b = arr[i];\n    hex += (b < 16 ? "0" : "") + b.toString(16);\n  }\n  return hex;\n};\n\nvar toUint8Array = function toUint8Array(hex) {\n  return new Uint8Array(toArray(hex));\n};\n\nvar fromUint8Array = function fromUint8Array(arr) {\n  return fromArray([].slice.call(arr, 0));\n};\n\nvar fromNumber = function fromNumber(num) {\n  var hex = num.toString(16);\n  return hex.length % 2 === 0 ? "0x" + hex : "0x0" + hex;\n};\n\nvar toNumber = function toNumber(hex) {\n  return parseInt(hex.slice(2), 16);\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b.slice(2));\n};\n\nvar fromNat = function fromNat(bn) {\n  return bn === "0x0" ? "0x" : bn.length % 2 === 0 ? bn : "0x0" + bn.slice(2);\n};\n\nvar toNat = function toNat(bn) {\n  return bn[2] === "0" ? "0x" + bn.slice(3) : bn;\n};\n\nvar fromAscii = function fromAscii(ascii) {\n  var hex = "0x";\n  for (var i = 0; i < ascii.length; ++i) {\n    hex += ("00" + ascii.charCodeAt(i).toString(16)).slice(-2);\n  }return hex;\n};\n\nvar toAscii = function toAscii(hex) {\n  var ascii = "";\n  for (var i = 2; i < hex.length; i += 2) {\n    ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\n  }return ascii;\n};\n\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\nvar fromString = function fromString(s) {\n  var makeByte = function makeByte(uint8) {\n    var b = uint8.toString(16);\n    return b.length < 2 ? "0" + b : b;\n  };\n  var bytes = "0x";\n  for (var ci = 0; ci != s.length; ci++) {\n    var c = s.charCodeAt(ci);\n    if (c < 128) {\n      bytes += makeByte(c);\n      continue;\n    }\n    if (c < 2048) {\n      bytes += makeByte(c >> 6 | 192);\n    } else {\n      if (c > 0xd7ff && c < 0xdc00) {\n        if (++ci == s.length) return null;\n        var c2 = s.charCodeAt(ci);\n        if (c2 < 0xdc00 || c2 > 0xdfff) return null;\n        c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n        bytes += makeByte(c >> 18 | 240);\n        bytes += makeByte(c >> 12 & 63 | 128);\n      } else {\n        // c <= 0xffff\n        bytes += makeByte(c >> 12 | 224);\n      }\n      bytes += makeByte(c >> 6 & 63 | 128);\n    }\n    bytes += makeByte(c & 63 | 128);\n  }\n  return bytes;\n};\n\nvar toString = function toString(bytes) {\n  var s = \'\';\n  var i = 0;\n  var l = length(bytes);\n  while (i < l) {\n    var c = at(bytes, i++);\n    if (c > 127) {\n      if (c > 191 && c < 224) {\n        if (i >= l) return null;\n        c = (c & 31) << 6 | at(bytes, i) & 63;\n      } else if (c > 223 && c < 240) {\n        if (i + 1 >= l) return null;\n        c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else if (c > 239 && c < 248) {\n        if (i + 2 >= l) return null;\n        c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\n      } else return null;\n      ++i;\n    }\n    if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n      c -= 0x10000;\n      s += String.fromCharCode(c >> 10 | 0xd800);\n      s += String.fromCharCode(c & 0x3FF | 0xdc00);\n    } else return null;\n  }\n  return s;\n};\n\nmodule.exports = {\n  random: random,\n  length: length,\n  concat: concat,\n  flatten: flatten,\n  slice: slice,\n  reverse: reverse,\n  pad: pad,\n  padRight: padRight,\n  fromAscii: fromAscii,\n  toAscii: toAscii,\n  fromString: fromString,\n  toString: toString,\n  fromNumber: fromNumber,\n  toNumber: toNumber,\n  fromNat: fromNat,\n  toNat: toNat,\n  fromArray: fromArray,\n  toArray: toArray,\n  fromUint8Array: fromUint8Array,\n  toUint8Array: toUint8Array\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eth-lib/lib/bytes.js\n// module id = 406\n// module chunks = 0\n\n//# sourceURL=../node_modules/eth-lib/lib/bytes.js')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const utils = __webpack_require__(182)\nconst params = __webpack_require__(858)\nconst BN = utils.BN\n  /**\n   * An object that repersents the block header\n   * @constructor\n   * @param {Array} data raw data, deserialized\n   * @prop {Buffer} parentHash the blocks' parent's hash\n   * @prop {Buffer} uncleHash sha3(rlp_encode(uncle_list))\n   * @prop {Buffer} coinbase the miner address\n   * @prop {Buffer} stateRoot The root of a Merkle Patricia tree\n   * @prop {Buffer} transactionTrie the root of a Trie containing the transactions\n   * @prop {Buffer} receiptTrie the root of a Trie containing the transaction Reciept\n   * @prop {Buffer} bloom\n   * @prop {Buffer} difficulty\n   * @prop {Buffer} number the block's height\n   * @prop {Buffer} gasLimit\n   * @prop {Buffer} gasUsed\n   * @prop {Buffer} timestamp\n   * @prop {Buffer} extraData\n   * @prop {Array.<Buffer>} raw an array of buffers containing the raw blocks.\n   */\nvar BlockHeader = module.exports = function (data) {\n  var fields = [{\n    name: 'parentHash',\n    length: 32,\n    default: utils.zeros(32)\n  }, {\n    name: 'uncleHash',\n    default: utils.SHA3_RLP_ARRAY\n  }, {\n    name: 'coinbase',\n    length: 20,\n    default: utils.zeros(20)\n  }, {\n    name: 'stateRoot',\n    length: 32,\n    default: utils.zeros(32)\n  }, {\n    name: 'transactionsTrie',\n    length: 32,\n    default: utils.SHA3_RLP\n  }, {\n    name: 'receiptTrie',\n    length: 32,\n    default: utils.SHA3_RLP\n  }, {\n    name: 'bloom',\n    default: utils.zeros(256)\n  }, {\n    name: 'difficulty',\n    default: new Buffer([])\n  }, {\n    name: 'number',\n    default: utils.intToBuffer(params.homeSteadForkNumber.v)\n  }, {\n    name: 'gasLimit',\n    default: new Buffer('ffffffffffffff', 'hex')\n  }, {\n    name: 'gasUsed',\n    empty: true,\n    default: new Buffer([])\n  }, {\n    name: 'timestamp',\n    default: new Buffer([])\n  }, {\n    name: 'extraData',\n    allowZero: true,\n    empty: true,\n    default: new Buffer([])\n  }, {\n    name: 'mixHash',\n    default: utils.zeros(32)\n      // length: 32\n  }, {\n    name: 'nonce',\n    default: new Buffer([]) // sha3(42)\n  }]\n  utils.defineProperties(this, fields, data)\n}\n\n/**\n * Returns the canoncical difficulty of the block\n * @method canonicalDifficulty\n * @param {Block} parentBlock the parent `Block` of the this header\n * @return {BN}\n */\nBlockHeader.prototype.canonicalDifficulty = function (parentBlock) {\n  const blockTs = new BN(this.timestamp)\n  const parentTs = new BN(parentBlock.header.timestamp)\n  const parentDif = new BN(parentBlock.header.difficulty)\n  const minimumDifficulty = new BN(params.minimumDifficulty.v)\n  var offset = parentDif.div(new BN(params.difficultyBoundDivisor.v))\n  var dif\n\n  // Byzantium\n  // max((2 if len(parent.uncles) else 1) - ((timestamp - parent.timestamp) // 9), -99)\n  var uncleAddend = parentBlock.header.uncleHash.equals(utils.SHA3_RLP_ARRAY) ? 1 : 2\n  var a = blockTs.sub(parentTs).idivn(9).ineg().iaddn(uncleAddend)\n  var cutoff = new BN(-99)\n  // MAX(cutoff, a)\n  if (cutoff.cmp(a) === 1) {\n    a = cutoff\n  }\n  dif = parentDif.add(offset.mul(a))\n\n  // Byzantium difficulty bomb delay\n  var num = new BN(this.number).isubn(3000000)\n  if (num.ltn(0)) {\n    num = new BN(0)\n  }\n\n  var exp = num.idivn(100000).isubn(2)\n  if (!exp.isNeg()) {\n    dif.iadd(new BN(2).pow(exp))\n  }\n\n  if (dif.cmp(minimumDifficulty) === -1) {\n    dif = minimumDifficulty\n  }\n\n  return dif\n}\n\n/**\n * checks that the block's `difficuly` matches the canonical difficulty\n * @method validateDifficulty\n * @param {Block} parentBlock this block's parent\n * @return {Boolean}\n */\nBlockHeader.prototype.validateDifficulty = function (parentBlock) {\n  const dif = this.canonicalDifficulty(parentBlock)\n  return dif.cmp(new BN(this.difficulty)) === 0\n}\n\n/**\n * Validates the gasLimit\n * @method validateGasLimit\n * @param {Block} parentBlock this block's parent\n * @returns {Boolean}\n */\nBlockHeader.prototype.validateGasLimit = function (parentBlock) {\n  const pGasLimit = new BN(parentBlock.header.gasLimit)\n  const gasLimit = new BN(this.gasLimit)\n  const a = pGasLimit.div(new BN(params.gasLimitBoundDivisor.v))\n  const maxGasLimit = pGasLimit.add(a)\n  const minGasLimit = pGasLimit.sub(a)\n\n  return gasLimit.lt(maxGasLimit) && gasLimit.gt(minGasLimit) && gasLimit.gte(params.minGasLimit.v)\n}\n\n/**\n * Validates the entire block header\n * @method validate\n * @param {Blockchain} blockChain the blockchain that this block is validating against\n * @param {Bignum} [height] if this is an uncle header, this is the height of the block that is including it\n * @param {Function} cb the callback function. The callback is given an `error` if the block is invalid\n */\nBlockHeader.prototype.validate = function (blockchain, height, cb) {\n  var self = this\n  if (arguments.length === 2) {\n    cb = height\n    height = false\n  }\n\n  if (this.isGenesis()) {\n    return cb()\n  }\n\n  // find the blocks parent\n  blockchain.getBlock(self.parentHash, function (err, parentBlock) {\n    if (err) {\n      return cb('could not find parent block')\n    }\n\n    self.parentBlock = parentBlock\n\n    var number = new BN(self.number)\n    if (number.cmp(new BN(parentBlock.header.number).iaddn(1)) !== 0) {\n      return cb('invalid number')\n    }\n\n    if (height) {\n      var dif = height.sub(new BN(parentBlock.header.number))\n      if (!(dif.cmpn(8) === -1 && dif.cmpn(1) === 1)) {\n        return cb('uncle block has a parent that is too old or to young')\n      }\n    }\n\n    if (!self.validateDifficulty(parentBlock)) {\n      return cb('invalid Difficulty')\n    }\n\n    if (!self.validateGasLimit(parentBlock)) {\n      return cb('invalid gas limit')\n    }\n\n    if (utils.bufferToInt(parentBlock.header.number) + 1 !== utils.bufferToInt(self.number)) {\n      return cb('invalid heigth')\n    }\n\n    if (utils.bufferToInt(self.timestamp) <= utils.bufferToInt(parentBlock.header.timestamp)) {\n      return cb('invalid timestamp')\n    }\n\n    if (self.extraData.length > params.maximumExtraDataSize.v) {\n      return cb('invalid amount of extra data')\n    }\n\n    cb()\n  })\n}\n\n/**\n * Returns the sha3 hash of the blockheader\n * @method hash\n * @return {Buffer}\n */\nBlockHeader.prototype.hash = function () {\n  return utils.rlphash(this.raw)\n}\n\n/**\n * checks if the blockheader is a genesis header\n * @method isGenesis\n * @return {Boolean}\n */\nBlockHeader.prototype.isGenesis = function () {\n  return this.number.toString('hex') === ''\n}\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereumjs-block/header.js\n// module id = 407\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereumjs-block/header.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(862);\nvar numberToBN = __webpack_require__(294);\n\nvar zero = new BN(0);\nvar negative1 = new BN(-1);\n\n// complete ethereum unit map\nvar unitMap = {\n  'noether': '0', // eslint-disable-line\n  'wei': '1', // eslint-disable-line\n  'kwei': '1000', // eslint-disable-line\n  'Kwei': '1000', // eslint-disable-line\n  'babbage': '1000', // eslint-disable-line\n  'femtoether': '1000', // eslint-disable-line\n  'mwei': '1000000', // eslint-disable-line\n  'Mwei': '1000000', // eslint-disable-line\n  'lovelace': '1000000', // eslint-disable-line\n  'picoether': '1000000', // eslint-disable-line\n  'gwei': '1000000000', // eslint-disable-line\n  'Gwei': '1000000000', // eslint-disable-line\n  'shannon': '1000000000', // eslint-disable-line\n  'nanoether': '1000000000', // eslint-disable-line\n  'nano': '1000000000', // eslint-disable-line\n  'szabo': '1000000000000', // eslint-disable-line\n  'microether': '1000000000000', // eslint-disable-line\n  'micro': '1000000000000', // eslint-disable-line\n  'finney': '1000000000000000', // eslint-disable-line\n  'milliether': '1000000000000000', // eslint-disable-line\n  'milli': '1000000000000000', // eslint-disable-line\n  'ether': '1000000000000000000', // eslint-disable-line\n  'kether': '1000000000000000000000', // eslint-disable-line\n  'grand': '1000000000000000000000', // eslint-disable-line\n  'mether': '1000000000000000000000000', // eslint-disable-line\n  'gether': '1000000000000000000000000000', // eslint-disable-line\n  'tether': '1000000000000000000000000000000' };\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nfunction getValueOfUnit(unitInput) {\n  var unit = unitInput ? unitInput.toLowerCase() : 'ether';\n  var unitValue = unitMap[unit]; // eslint-disable-line\n\n  if (typeof unitValue !== 'string') {\n    throw new Error('[ethjs-unit] the unit provided ' + unitInput + ' doesn\\'t exists, please use the one of the following units ' + JSON.stringify(unitMap, null, 2));\n  }\n\n  return new BN(unitValue, 10);\n}\n\nfunction numberToString(arg) {\n  if (typeof arg === 'string') {\n    if (!arg.match(/^-?[0-9.]+$/)) {\n      throw new Error('while converting number to string, invalid number value \\'' + arg + '\\', should be a number matching (^-?[0-9.]+).');\n    }\n    return arg;\n  } else if (typeof arg === 'number') {\n    return String(arg);\n  } else if (typeof arg === 'object' && arg.toString && (arg.toTwos || arg.dividedToIntegerBy)) {\n    if (arg.toPrecision) {\n      return String(arg.toPrecision());\n    } else {\n      // eslint-disable-line\n      return arg.toString(10);\n    }\n  }\n  throw new Error('while converting number to string, invalid number value \\'' + arg + '\\' type ' + typeof arg + '.');\n}\n\nfunction fromWei(weiInput, unit, optionsInput) {\n  var wei = numberToBN(weiInput); // eslint-disable-line\n  var negative = wei.lt(zero); // eslint-disable-line\n  var base = getValueOfUnit(unit);\n  var baseLength = unitMap[unit].length - 1 || 1;\n  var options = optionsInput || {};\n\n  if (negative) {\n    wei = wei.mul(negative1);\n  }\n\n  var fraction = wei.mod(base).toString(10); // eslint-disable-line\n\n  while (fraction.length < baseLength) {\n    fraction = '0' + fraction;\n  }\n\n  if (!options.pad) {\n    fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];\n  }\n\n  var whole = wei.div(base).toString(10); // eslint-disable-line\n\n  if (options.commify) {\n    whole = whole.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n  }\n\n  var value = '' + whole + (fraction == '0' ? '' : '.' + fraction); // eslint-disable-line\n\n  if (negative) {\n    value = '-' + value;\n  }\n\n  return value;\n}\n\nfunction toWei(etherInput, unit) {\n  var ether = numberToString(etherInput); // eslint-disable-line\n  var base = getValueOfUnit(unit);\n  var baseLength = unitMap[unit].length - 1 || 1;\n\n  // Is it negative?\n  var negative = ether.substring(0, 1) === '-'; // eslint-disable-line\n  if (negative) {\n    ether = ether.substring(1);\n  }\n\n  if (ether === '.') {\n    throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, invalid value');\n  }\n\n  // Split it into a whole and fractional part\n  var comps = ether.split('.'); // eslint-disable-line\n  if (comps.length > 2) {\n    throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei,  too many decimal points');\n  }\n\n  var whole = comps[0],\n      fraction = comps[1]; // eslint-disable-line\n\n  if (!whole) {\n    whole = '0';\n  }\n  if (!fraction) {\n    fraction = '0';\n  }\n  if (fraction.length > baseLength) {\n    throw new Error('[ethjs-unit] while converting number ' + etherInput + ' to wei, too many decimal places');\n  }\n\n  while (fraction.length < baseLength) {\n    fraction += '0';\n  }\n\n  whole = new BN(whole);\n  fraction = new BN(fraction);\n  var wei = whole.mul(base).add(fraction); // eslint-disable-line\n\n  if (negative) {\n    wei = wei.mul(negative1);\n  }\n\n  return new BN(wei.toString(10), 10);\n}\n\nmodule.exports = {\n  unitMap: unitMap,\n  numberToString: numberToString,\n  getValueOfUnit: getValueOfUnit,\n  fromWei: fromWei,\n  toWei: toWei\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethjs-unit/lib/index.js\n// module id = 408\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethjs-unit/lib/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/* global Blob File */\n\n/*\n * Module requirements.\n */\n\nvar isArray = __webpack_require__(869);\n\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Module exports.\n */\n\nmodule.exports = hasBinary;\n\n/**\n * Checks for binary data.\n *\n * Supports Buffer, ArrayBuffer, Blob and File.\n *\n * @param {Object} anything\n * @api public\n */\n\nfunction hasBinary (obj) {\n  if (!obj || typeof obj !== 'object') {\n    return false;\n  }\n\n  if (isArray(obj)) {\n    for (var i = 0, l = obj.length; i < l; i++) {\n      if (hasBinary(obj[i])) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  if ((typeof global.Buffer === 'function' && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n     (typeof global.ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||\n     (withNativeBlob && obj instanceof Blob) ||\n     (withNativeFile && obj instanceof File)\n    ) {\n    return true;\n  }\n\n  // see: https://github.com/Automattic/has-binary/pull/4\n  if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {\n    return hasBinary(obj.toJSON(), true);\n  }\n\n  for (var key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-binary2/index.js\n// module id = 409\n// module chunks = 0\n\n//# sourceURL=../node_modules/has-binary2/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar common = __webpack_require__(143);\nvar assert = __webpack_require__(43);\n\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\n\nvar BlockHash = common.BlockHash;\n\nvar sha512_K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction SHA512() {\n  if (!(this instanceof SHA512))\n    return new SHA512();\n\n  BlockHash.call(this);\n  this.h = [\n    0x6a09e667, 0xf3bcc908,\n    0xbb67ae85, 0x84caa73b,\n    0x3c6ef372, 0xfe94f82b,\n    0xa54ff53a, 0x5f1d36f1,\n    0x510e527f, 0xade682d1,\n    0x9b05688c, 0x2b3e6c1f,\n    0x1f83d9ab, 0xfb41bd6b,\n    0x5be0cd19, 0x137e2179 ];\n  this.k = sha512_K;\n  this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nmodule.exports = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n  var W = this.W;\n\n  // 32 x 32bit words\n  for (var i = 0; i < 32; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i += 2) {\n    var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);  // i - 2\n    var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n    var c1_hi = W[i - 14];  // i - 7\n    var c1_lo = W[i - 13];\n    var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);  // i - 15\n    var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n    var c3_hi = W[i - 32];  // i - 16\n    var c3_lo = W[i - 31];\n\n    W[i] = sum64_4_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n    W[i + 1] = sum64_4_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo);\n  }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n  this._prepareBlock(msg, start);\n\n  var W = this.W;\n\n  var ah = this.h[0];\n  var al = this.h[1];\n  var bh = this.h[2];\n  var bl = this.h[3];\n  var ch = this.h[4];\n  var cl = this.h[5];\n  var dh = this.h[6];\n  var dl = this.h[7];\n  var eh = this.h[8];\n  var el = this.h[9];\n  var fh = this.h[10];\n  var fl = this.h[11];\n  var gh = this.h[12];\n  var gl = this.h[13];\n  var hh = this.h[14];\n  var hl = this.h[15];\n\n  assert(this.k.length === W.length);\n  for (var i = 0; i < W.length; i += 2) {\n    var c0_hi = hh;\n    var c0_lo = hl;\n    var c1_hi = s1_512_hi(eh, el);\n    var c1_lo = s1_512_lo(eh, el);\n    var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n    var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n    var c3_hi = this.k[i];\n    var c3_lo = this.k[i + 1];\n    var c4_hi = W[i];\n    var c4_lo = W[i + 1];\n\n    var T1_hi = sum64_5_hi(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n    var T1_lo = sum64_5_lo(\n      c0_hi, c0_lo,\n      c1_hi, c1_lo,\n      c2_hi, c2_lo,\n      c3_hi, c3_lo,\n      c4_hi, c4_lo);\n\n    c0_hi = s0_512_hi(ah, al);\n    c0_lo = s0_512_lo(ah, al);\n    c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n    c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n    var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n    var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n    hh = gh;\n    hl = gl;\n\n    gh = fh;\n    gl = fl;\n\n    fh = eh;\n    fl = el;\n\n    eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n    el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n    dh = ch;\n    dl = cl;\n\n    ch = bh;\n    cl = bl;\n\n    bh = ah;\n    bl = al;\n\n    ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n    al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n  }\n\n  sum64(this.h, 0, ah, al);\n  sum64(this.h, 2, bh, bl);\n  sum64(this.h, 4, ch, cl);\n  sum64(this.h, 6, dh, dl);\n  sum64(this.h, 8, eh, el);\n  sum64(this.h, 10, fh, fl);\n  sum64(this.h, 12, gh, gl);\n  sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction ch64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ ((~xh) & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ ((~xl) & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh) {\n  var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 28);\n  var c1_hi = rotr64_hi(xl, xh, 2);  // 34\n  var c2_hi = rotr64_hi(xl, xh, 7);  // 39\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 28);\n  var c1_lo = rotr64_lo(xl, xh, 2);  // 34\n  var c2_lo = rotr64_lo(xl, xh, 7);  // 39\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 14);\n  var c1_hi = rotr64_hi(xh, xl, 18);\n  var c2_hi = rotr64_hi(xl, xh, 9);  // 41\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 14);\n  var c1_lo = rotr64_lo(xh, xl, 18);\n  var c2_lo = rotr64_lo(xl, xh, 9);  // 41\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 1);\n  var c1_hi = rotr64_hi(xh, xl, 8);\n  var c2_hi = shr64_hi(xh, xl, 7);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 1);\n  var c1_lo = rotr64_lo(xh, xl, 8);\n  var c2_lo = shr64_lo(xh, xl, 7);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 19);\n  var c1_hi = rotr64_hi(xl, xh, 29);  // 61\n  var c2_hi = shr64_hi(xh, xl, 6);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 19);\n  var c1_lo = rotr64_lo(xl, xh, 29);  // 61\n  var c2_lo = shr64_lo(xh, xl, 6);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/512.js\n// module id = 410\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/512.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar rotr32 = utils.rotr32;\n\nfunction ft_1(s, x, y, z) {\n  if (s === 0)\n    return ch32(x, y, z);\n  if (s === 1 || s === 3)\n    return p32(x, y, z);\n  if (s === 2)\n    return maj32(x, y, z);\n}\nexports.ft_1 = ft_1;\n\nfunction ch32(x, y, z) {\n  return (x & y) ^ ((~x) & z);\n}\nexports.ch32 = ch32;\n\nfunction maj32(x, y, z) {\n  return (x & y) ^ (x & z) ^ (y & z);\n}\nexports.maj32 = maj32;\n\nfunction p32(x, y, z) {\n  return x ^ y ^ z;\n}\nexports.p32 = p32;\n\nfunction s0_256(x) {\n  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\nexports.s0_256 = s0_256;\n\nfunction s1_256(x) {\n  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\nexports.s1_256 = s1_256;\n\nfunction g0_256(x) {\n  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\nexports.g0_256 = g0_256;\n\nfunction g1_256(x) {\n  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\nexports.g1_256 = g1_256;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/common.js\n// module id = 411\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/common.js")},function(module,exports){eval("exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n  var e, m\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var nBits = -7\n  var i = isLE ? (nBytes - 1) : 0\n  var d = isLE ? -1 : 1\n  var s = buffer[offset + i]\n\n  i += d\n\n  e = s & ((1 << (-nBits)) - 1)\n  s >>= (-nBits)\n  nBits += eLen\n  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  m = e & ((1 << (-nBits)) - 1)\n  e >>= (-nBits)\n  nBits += mLen\n  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  if (e === 0) {\n    e = 1 - eBias\n  } else if (e === eMax) {\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\n  } else {\n    m = m + Math.pow(2, mLen)\n    e = e - eBias\n  }\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n  var e, m, c\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n  var i = isLE ? 0 : (nBytes - 1)\n  var d = isLE ? 1 : -1\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n  value = Math.abs(value)\n\n  if (isNaN(value) || value === Infinity) {\n    m = isNaN(value) ? 1 : 0\n    e = eMax\n  } else {\n    e = Math.floor(Math.log(value) / Math.LN2)\n    if (value * (c = Math.pow(2, -e)) < 1) {\n      e--\n      c *= 2\n    }\n    if (e + eBias >= 1) {\n      value += rt / c\n    } else {\n      value += rt * Math.pow(2, 1 - eBias)\n    }\n    if (value * c >= 2) {\n      e++\n      c /= 2\n    }\n\n    if (e + eBias >= eMax) {\n      m = 0\n      e = eMax\n    } else if (e + eBias >= 1) {\n      m = ((value * c) - 1) * Math.pow(2, mLen)\n      e = e + eBias\n    } else {\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n      e = 0\n    }\n  }\n\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n  e = (e << mLen) | m\n  eLen += mLen\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n  buffer[offset + i - d] |= s * 128\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ieee754/index.js\n// module id = 412\n// module chunks = 0\n\n//# sourceURL=../node_modules/ieee754/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* @flow */\n\n\nconst uuid = __webpack_require__(312)\n\nconst pathSepS = '/'\nconst pathSepB = Buffer.from(pathSepS)\nconst pathSep = pathSepB[0]\n\n/**\n * A Key represents the unique identifier of an object.\n * Our Key scheme is inspired by file systems and Google App Engine key model.\n * Keys are meant to be unique across a system. Keys are hierarchical,\n * incorporating more and more specific namespaces. Thus keys can be deemed\n * 'children' or 'ancestors' of other keys:\n * - `new Key('/Comedy')`\n * - `new Key('/Comedy/MontyPython')`\n * Also, every namespace can be parametrized to embed relevant object\n * information. For example, the Key `name` (most specific namespace) could\n * include the object type:\n * - `new Key('/Comedy/MontyPython/Actor:JohnCleese')`\n * - `new Key('/Comedy/MontyPython/Sketch:CheeseShop')`\n * - `new Key('/Comedy/MontyPython/Sketch:CheeseShop/Character:Mousebender')`\n *\n */\nclass Key {\n  /* :: _buf: Buffer */\n\n  constructor (s /* : string|Buffer */, clean /* : ?bool */) {\n    if (typeof s === 'string') {\n      this._buf = Buffer.from(s)\n    } else if (Buffer.isBuffer(s)) {\n      this._buf = s\n    }\n\n    if (clean == null) {\n      clean = true\n    }\n\n    if (clean) {\n      this.clean()\n    }\n\n    if (this._buf.length === 0 || this._buf[0] !== pathSep) {\n      throw new Error(`Invalid key: ${this.toString()}`)\n    }\n  }\n\n  /**\n   * Convert to the string representation\n   *\n   * @param {string} [encoding='utf8']\n   * @returns {string}\n   */\n  toString (encoding/* : ?buffer$Encoding */)/* : string */ {\n    return this._buf.toString(encoding || 'utf8')\n  }\n\n  /**\n   * Return the buffer representation of the key\n   *\n   * @returns {Buffer}\n   */\n  toBuffer () /* : Buffer */ {\n    return this._buf\n  }\n\n  // waiting on https://github.com/facebook/flow/issues/2286\n  // $FlowFixMe\n  get [Symbol.toStringTag] () /* : string */ {\n    return `[Key ${this.toString()}]`\n  }\n\n  /**\n   * Constructs a key out of a namespace array.\n   *\n   * @param {Array<string>} list\n   * @returns {Key}\n   *\n   * @example\n   * Key.withNamespaces(['one', 'two'])\n   * // => Key('/one/two')\n   *\n   */\n  static withNamespaces (list /* : Array<string> */) /* : Key */ {\n    return new Key(list.join(pathSepS))\n  }\n\n  /**\n   * Returns a randomly (uuid) generated key.\n   *\n   * @returns {Key}\n   *\n   * @example\n   * Key.random()\n   * // => Key('/f98719ea086343f7b71f32ea9d9d521d')\n   *\n   */\n  static random () /* : Key */ {\n    return new Key(uuid().replace(/-/g, ''))\n  }\n\n  /**\n   * Cleanup the current key\n   *\n   * @returns {void}\n   */\n  clean () {\n    if (!this._buf || this._buf.length === 0) {\n      this._buf = Buffer.from(pathSepS)\n    }\n\n    if (this._buf[0] !== pathSep) {\n      this._buf = Buffer.concat([pathSepB, this._buf])\n    }\n\n    // normalize does not remove trailing slashes\n    while (this._buf.length > 1 && this._buf[this._buf.length - 1] === pathSep) {\n      this._buf = this._buf.slice(0, -1)\n    }\n  }\n\n  /**\n   * Check if the given key is sorted lower than ourself.\n   *\n   * @param {Key} key\n   * @returns {bool}\n   */\n  less (key /* : Key */) /* : bool */ {\n    const list1 = this.list()\n    const list2 = key.list()\n\n    for (let i = 0; i < list1.length; i++) {\n      if (list2.length < i + 1) {\n        return false\n      }\n\n      const c1 = list1[i]\n      const c2 = list2[i]\n\n      if (c1 < c2) {\n        return true\n      } else if (c1 > c2) {\n        return false\n      }\n    }\n\n    return list1.length < list2.length\n  }\n\n  /**\n   * Returns the key with all parts in reversed order.\n   *\n   * @returns {Key}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').reverse()\n   * // => Key('/Actor:JohnCleese/MontyPython/Comedy')\n   */\n  reverse () /* : Key */ {\n    return Key.withNamespaces(this.list().slice().reverse())\n  }\n\n  /**\n   * Returns the `namespaces` making up this Key.\n   *\n   * @returns {Array<string>}\n   */\n  namespaces () /* : Array<string> */ {\n    return this.list()\n  }\n\n  /** Returns the \"base\" namespace of this key.\n   *\n   * @returns {string}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').baseNamespace()\n   * // => 'Actor:JohnCleese'\n   *\n   */\n  baseNamespace () /* : string */ {\n    const ns = this.namespaces()\n    return ns[ns.length - 1]\n  }\n\n  /**\n   * Returns the `list` representation of this key.\n   *\n   * @returns {Array<string>}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').list()\n   * // => ['Comedy', 'MontyPythong', 'Actor:JohnCleese']\n   *\n   */\n  list () /* : Array<string> */ {\n    return this.toString().split(pathSepS).slice(1)\n  }\n\n  /**\n   * Returns the \"type\" of this key (value of last namespace).\n   *\n   * @returns {string}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').type()\n   * // => 'Actor'\n   *\n   */\n  type () /* : string */ {\n    return namespaceType(this.baseNamespace())\n  }\n\n  /**\n   * Returns the \"name\" of this key (field of last namespace).\n   *\n   * @returns {string}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').name()\n   * // => 'JohnCleese'\n   */\n  name () /* : string */ {\n    return namespaceValue(this.baseNamespace())\n  }\n\n  /**\n   * Returns an \"instance\" of this type key (appends value to namespace).\n   *\n   * @param {string} s\n   * @returns {Key}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor').instance('JohnClesse')\n   * // => Key('/Comedy/MontyPython/Actor:JohnCleese')\n   */\n  instance (s /* : string */) /* : Key */ {\n    return new Key(this.toString() + ':' + s)\n  }\n\n  /**\n   * Returns the \"path\" of this key (parent + type).\n   *\n   * @returns {Key}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython/Actor:JohnCleese').path()\n   * // => Key('/Comedy/MontyPython/Actor')\n   *\n   */\n  path () /* : Key */ {\n    let p = this.parent().toString()\n    if (!p.endsWith(pathSepS)) {\n      p += pathSepS\n    }\n    p += this.type()\n    return new Key(p)\n  }\n\n  /**\n   * Returns the `parent` Key of this Key.\n   *\n   * @returns {Key}\n   *\n   * @example\n   * new Key(\"/Comedy/MontyPython/Actor:JohnCleese\").parent()\n   * // => Key(\"/Comedy/MontyPython\")\n   *\n   */\n  parent () /* : Key */ {\n    const list = this.list()\n    if (list.length === 1) {\n      return new Key(pathSepS)\n    }\n\n    return new Key(list.slice(0, -1).join(pathSepS))\n  }\n\n  /**\n   * Returns the `child` Key of this Key.\n   *\n   * @param {Key} key\n   * @returns {Key}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython').child(new Key('Actor:JohnCleese'))\n   * // => Key('/Comedy/MontyPython/Actor:JohnCleese')\n   *\n   */\n  child (key /* : Key */) /* : Key */ {\n    if (this.toString() === pathSepS) {\n      return key\n    } else if (key.toString() === pathSepS) {\n      return this\n    }\n\n    return new Key(this.toString() + key.toString(), false)\n  }\n\n  /**\n   * Returns whether this key is a prefix of `other`\n   *\n   * @param {Key} other\n   * @returns {bool}\n   *\n   * @example\n   * new Key('/Comedy').isAncestorOf('/Comedy/MontyPython')\n   * // => true\n   *\n   */\n  isAncestorOf (other /* : Key */) /* : bool */ {\n    if (other.toString() === this.toString()) {\n      return false\n    }\n\n    return other.toString().startsWith(this.toString())\n  }\n\n  /**\n   * Returns whether this key is a contains another as prefix.\n   *\n   * @param {Key} other\n   * @returns {bool}\n   *\n   * @example\n   * new Key('/Comedy/MontyPython').isDecendantOf('/Comedy')\n   * // => true\n   *\n   */\n  isDecendantOf (other /* : Key */) /* : bool */ {\n    if (other.toString() === this.toString()) {\n      return false\n    }\n\n    return this.toString().startsWith(other.toString())\n  }\n\n  /**\n   * Returns wether this key has only one namespace.\n   *\n   * @returns {bool}\n   *\n   */\n  isTopLevel () /* : bool */ {\n    return this.list().length === 1\n  }\n}\n\n/**\n * The first component of a namespace. `foo` in `foo:bar`\n *\n * @param {string} ns\n * @returns {string}\n */\nfunction namespaceType (ns /* : string */) /* : string */ {\n  const parts = ns.split(':')\n  if (parts.length < 2) {\n    return ''\n  }\n  return parts.slice(0, -1).join(':')\n}\n\n/**\n * The last component of a namespace, `baz` in `foo:bar:baz`.\n *\n * @param {string} ns\n * @returns {string}\n */\nfunction namespaceValue (ns /* : string */) /* : string */ {\n  const parts = ns.split(':')\n  return parts[parts.length - 1]\n}\n\nmodule.exports = Key\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-datastore/src/key.js\n// module id = 413\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-datastore/src/key.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * BlockService is a hybrid block datastore. It stores data in a local\n * datastore and may retrieve data from a remote Exchange.\n * It uses an internal `datastore.Datastore` instance to store values.\n */\nclass BlockService {\n  /**\n   * Create a new BlockService\n   *\n   * @param {IPFSRepo} ipfsRepo\n   * @returns {BlockService}\n   */\n  constructor (ipfsRepo) {\n    this._repo = ipfsRepo\n    this._bitswap = null\n  }\n\n  /**\n   * Add a bitswap instance that communicates with the\n   * network to retreive blocks that are not in the local store.\n   *\n   * If the node is online all requests for blocks first\n   * check locally and afterwards ask the network for the blocks.\n   *\n   * @param {Bitswap} bitswap\n   * @returns {void}\n   */\n  setExchange (bitswap) {\n    this._bitswap = bitswap\n  }\n\n  /**\n   * Go offline, i.e. drop the reference to bitswap.\n   *\n   * @returns {void}\n   */\n  unsetExchange () {\n    this._bitswap = null\n  }\n\n  /**\n   * Is the blockservice online, i.e. is bitswap present.\n   *\n   * @returns {bool}\n   */\n  hasExchange () {\n    return this._bitswap != null\n  }\n\n  /**\n   * Put a block to the underlying datastore.\n   *\n   * @param {Block} block\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  put (block, callback) {\n    if (this.hasExchange()) {\n      return this._bitswap.put(block, callback)\n    }\n\n    this._repo.blocks.put(block, callback)\n  }\n\n  /**\n   * Put a multiple blocks to the underlying datastore.\n   *\n   * @param {Array<Block>} blocks\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  putMany (blocks, callback) {\n    if (this.hasExchange()) {\n      return this._bitswap.putMany(blocks, callback)\n    }\n\n    this._repo.blocks.putMany(blocks, callback)\n  }\n\n  /**\n   * Get a block by cid.\n   *\n   * @param {CID} cid\n   * @param {function(Error, Block)} callback\n   * @returns {void}\n   */\n  get (cid, callback) {\n    if (this.hasExchange()) {\n      return this._bitswap.get(cid, callback)\n    }\n\n    return this._repo.blocks.get(cid, callback)\n  }\n\n  /**\n   * Delete a block from the blockstore.\n   *\n   * @param {CID} cid\n   * @param {function(Error)} callback\n   * @return {void}\n   */\n  delete (cid, callback) {\n    this._repo.blocks.delete(cid, callback)\n  }\n}\n\nmodule.exports = BlockService\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-block-service/src/index.js\n// module id = 414\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-block-service/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst setImmediate = __webpack_require__(8)\n\nconst log = debug('repo:lock')\n\nconst lockFile = 'repo.lock'\n\nconst LOCKS = {}\n\n/**\n * Lock the repo in the given dir.\n *\n * @param {string} dir\n * @param {function(Error, lock)} callback\n * @returns {void}\n */\nexports.lock = (dir, callback) => {\n  const file = dir + '/' + lockFile\n  log('locking %s', file)\n  LOCKS[file] = true\n  const closer = {\n    close (cb) {\n      if (LOCKS[file]) {\n        delete LOCKS[file]\n      }\n      setImmediate(cb)\n    }\n  }\n  setImmediate(() => {\n    callback(null, closer)\n  })\n}\n\n/**\n * Check if the repo in the given directory is locked.\n *\n * @param {string} dir\n * @param {function(Error, bool)} callback\n * @returns {void}\n */\nexports.locked = (dir, callback) => {\n  const file = dir + '/' + lockFile\n  log('checking lock: %s')\n\n  const locked = LOCKS[file]\n  setImmediate(() => {\n    callback(null, locked)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/lock-memory.js\n// module id = 415\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/lock-memory.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst BitcoinjsBlock = __webpack_require__(629).Block\nconst CID = __webpack_require__(14)\nconst multihashes = __webpack_require__(32)\nconst sha256 = __webpack_require__(185)\n\n/**\n * @callback SerializeCallback\n * @param {?Error} error - Error if serialization failed\n * @param {?Buffer} binaryBlob - Binary Bitcoin block if serialization was\n *   successful\n */\n/**\n * Serialize internal representation into a binary Bitcoin block.\n *\n * @param {BitcoinBlock} dagNode - Internal representation of a Bitcoin block\n * @param {SerializeCallback} callback - Callback that handles the\n *   return value\n * @returns {void}\n */\nconst serialize = (dagNode, callback) => {\n  let err = null\n  let binaryBlob\n  try {\n    binaryBlob = dagNode.toBuffer()\n  } catch (serializeError) {\n    err = serializeError\n  } finally {\n    callback(err, binaryBlob)\n  }\n}\n\n/**\n * @callback DeserializeCallback\n * @param {?Error} error - Error if deserialization failed\n * @param {?BitcoinBlock} dagNode - Internal representation of a Bitcoin block\n *   if deserialization was successful\n */\n/**\n * Deserialize Bitcoin block into the internal representation,\n *\n * @param {Buffer} binaryBlob - Binary representation of a Bitcoin block\n * @param {DeserializeCallback} callback - Callback that handles the\n *   return value\n * @returns {void}\n */\nconst deserialize = (binaryBlob, callback) => {\n  let err = null\n  let dagNode\n  try {\n    dagNode = BitcoinjsBlock.fromBuffer(binaryBlob)\n  } catch (deserializeError) {\n    err = deserializeError\n  } finally {\n    callback(err, dagNode)\n  }\n}\n\n/**\n * @callback CidCallback\n * @param {?Error} error - Error if getting the CID failed\n * @param {?CID} cid - CID if call was successful\n */\n/**\n * Get the CID of the DAG-Node.\n *\n * @param {BitcoinBlock} dagNode - Internal representation of a Bitcoin block\n * @param {CidCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst cid = (dagNode, callback) => {\n  let err = null\n  let cid\n  try {\n    // Bitcoin double hashes\n    const firstHash = sha256().update(dagNode.toBuffer(true)).digest()\n    const headerHash = sha256().update(Buffer.from(firstHash)).digest()\n\n    cid = hashToCid(Buffer.from(headerHash))\n  } catch (cidError) {\n    err = cidError\n  } finally {\n    callback(err, cid)\n  }\n}\n\n// Convert a Bitcoin hash (as Buffer) to a CID\nconst hashToCid = (hash) => {\n  const multihash = multihashes.encode(hash, 'dbl-sha2-256')\n  const cidVersion = 1\n  const cid = new CID(cidVersion, 'bitcoin-block', multihash)\n  return cid\n}\n\nmodule.exports = {\n  hashToCid: hashToCid,\n\n  // Public API\n  cid: cid,\n  deserialize: deserialize,\n  serialize: serialize\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-bitcoin/src/util.js\n// module id = 416\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-bitcoin/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst util = __webpack_require__(418)\nconst traverse = __webpack_require__(545)\n\nexports = module.exports\n\nexports.multicodec = 'dag-cbor'\n\n/*\n * resolve: receives a path and a binary blob and returns the value on path,\n * throw if not possible. `binaryBlob` is CBOR encoded data.\n */\nexports.resolve = (binaryBlob, path, callback) => {\n  if (typeof path === 'function') {\n    callback = path\n    path = undefined\n  }\n\n  util.deserialize(binaryBlob, (err, node) => {\n    if (err) {\n      return callback(err)\n    }\n\n    // root\n\n    if (!path || path === '/') {\n      return callback(null, {\n        value: node,\n        remainderPath: ''\n      })\n    }\n\n    // within scope\n\n    const parts = path.split('/')\n    const val = traverse(node).get(parts)\n\n    if (val) {\n      return callback(null, {\n        value: val,\n        remainderPath: ''\n      })\n    }\n\n    // out of scope\n    let value\n    let len = parts.length\n\n    for (let i = 0; i < len; i++) {\n      const partialPath = parts.shift()\n\n      if (Array.isArray(node) && !Buffer.isBuffer(node)) {\n        value = node[Number(partialPath)]\n      } if (node[partialPath]) {\n        value = node[partialPath]\n      } else {\n        // can't traverse more\n        if (!value) {\n          return callback(new Error('path not available at root'))\n        } else {\n          parts.unshift(partialPath)\n          return callback(null, {\n            value: value,\n            remainderPath: parts.join('/')\n          })\n        }\n      }\n      node = value\n    }\n  })\n}\n\nfunction flattenObject (obj, delimiter) {\n  delimiter = delimiter || '/'\n\n  if (Object.keys(obj).length === 0) {\n    return []\n  }\n\n  return traverse(obj).reduce(function (acc, x) {\n    if (typeof x === 'object' && x['/']) {\n      this.update(undefined)\n    }\n    const path = this.path.join(delimiter)\n\n    if (path !== '') {\n      acc.push({ path: path, value: x })\n    }\n    return acc\n  }, [])\n}\n\n/*\n * tree: returns a flattened array with paths: values of the project. options\n * are option (i.e. nestness)\n */\nexports.tree = (binaryBlob, options, callback) => {\n  if (typeof options === 'function') {\n    callback = options\n    options = undefined\n  }\n\n  options = options || {}\n\n  util.deserialize(binaryBlob, (err, node) => {\n    if (err) {\n      return callback(err)\n    }\n    const flat = flattenObject(node)\n    const paths = flat.map((el) => el.path)\n\n    callback(null, paths)\n  })\n}\n\nexports.isLink = (binaryBlob, path, callback) => {\n  exports.resolve(binaryBlob, path, (err, result) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (result.remainderPath.length > 0) {\n      return callback(new Error('path out of scope'))\n    }\n\n    if (typeof result.value === 'object' && result.value['/']) {\n      callback(null, result.value)\n    } else {\n      callback(null, false)\n    }\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-cbor/src/resolver.js\n// module id = 417\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-cbor/src/resolver.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst cbor = __webpack_require__(653)\nconst multihashing = __webpack_require__(49)\nconst CID = __webpack_require__(14)\nconst waterfall = __webpack_require__(12)\nconst setImmediate = __webpack_require__(8)\nconst isCircular = __webpack_require__(956)\n\nconst resolver = __webpack_require__(417)\n\n// https://github.com/ipfs/go-ipfs/issues/3570#issuecomment-273931692\nconst CID_CBOR_TAG = 42\n\nfunction tagCID (cid) {\n  if (typeof cid === 'string') {\n    cid = new CID(cid).buffer\n  }\n\n  return new cbor.Tagged(CID_CBOR_TAG, Buffer.concat([\n    Buffer.from('00', 'hex'), // thanks jdag\n    cid\n  ]))\n}\n\nconst decoder = new cbor.Decoder({\n  tags: {\n    [CID_CBOR_TAG]: (val) => {\n      // remove that 0\n      val = val.slice(1)\n      return {'/': val}\n    }\n  }\n})\n\nfunction replaceCIDbyTAG (dagNode) {\n  let circular\n  try {\n    circular = isCircular(dagNode)\n  } catch (e) {\n    circular = false\n  }\n  if (circular) {\n    throw new Error('The object passed has circular references')\n  }\n\n  function transform (obj) {\n    if (!obj || Buffer.isBuffer(obj) || typeof obj === 'string') {\n      return obj\n    }\n\n    if (Array.isArray(obj)) {\n      return obj.map(transform)\n    }\n\n    const keys = Object.keys(obj)\n\n    // only `{'/': 'link'}` are valid\n    if (keys.length === 1 && keys[0] === '/') {\n      // Multiaddr encoding\n      // if (typeof link === 'string' && isMultiaddr(link)) {\n      //  link = new Multiaddr(link).buffer\n      // }\n\n      return tagCID(obj['/'])\n    } else if (keys.length > 0) {\n      // Recursive transform\n      let out = {}\n      keys.forEach((key) => {\n        if (typeof obj[key] === 'object') {\n          out[key] = transform(obj[key])\n        } else {\n          out[key] = obj[key]\n        }\n      })\n      return out\n    } else {\n      return obj\n    }\n  }\n\n  return transform(dagNode)\n}\n\nexports = module.exports\n\nexports.serialize = (dagNode, callback) => {\n  let serialized\n\n  try {\n    const dagNodeTagged = replaceCIDbyTAG(dagNode)\n    serialized = cbor.encode(dagNodeTagged)\n  } catch (err) {\n    return setImmediate(() => callback(err))\n  }\n  setImmediate(() => callback(null, serialized))\n}\n\nexports.deserialize = (data, callback) => {\n  let deserialized\n\n  try {\n    deserialized = decoder.decodeFirst(data)\n  } catch (err) {\n    return setImmediate(() => callback(err))\n  }\n\n  setImmediate(() => callback(null, deserialized))\n}\n\nexports.cid = (dagNode, callback) => {\n  waterfall([\n    (cb) => exports.serialize(dagNode, cb),\n    (serialized, cb) => multihashing(serialized, 'sha2-256', cb),\n    (mh, cb) => cb(null, new CID(1, resolver.multicodec, mh))\n  ], callback)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-cbor/src/util.js\n// module id = 418\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-cbor/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nconst EthAccount = __webpack_require__(859)\nconst cidFromHash = __webpack_require__(142)\nconst createResolver = __webpack_require__(144)\nconst emptyCodeHash = __webpack_require__(946)\n\nmodule.exports = createResolver('eth-account-snapshot', EthAccount, mapFromEthObj)\n\n\nfunction mapFromEthObj (account, options, callback) {\n  const paths = []\n\n  // external links\n\n  paths.push({\n    path: 'storage',\n    value: { '/': cidFromHash('eth-storage-trie', account.stateRoot).toBaseEncodedString() }\n  })\n\n  // resolve immediately if empty, otherwise link to code\n  if (emptyCodeHash.equals(account.codeHash)) {\n    paths.push({\n      path: 'code',\n      value: Buffer.from(''),\n    })\n  } else {\n    paths.push({\n      path: 'code',\n      value: { '/': cidFromHash('raw', account.codeHash).toBaseEncodedString() }\n    })\n  }\n\n  // external links as data\n\n  paths.push({\n    path: 'stateRoot',\n    value: account.stateRoot\n  })\n\n  paths.push({\n    path: 'codeHash',\n    value: account.codeHash\n  })\n\n  // internal data\n\n  paths.push({\n    path: 'nonce',\n    value: account.nonce\n  })\n\n  paths.push({\n    path: 'balance',\n    value: account.balance\n  })\n\n  // helpers\n\n  paths.push({\n    path: 'isEmpty',\n    value: account.isEmpty()\n  })\n\n  paths.push({\n    path: 'isContract',\n    value: account.isContract()\n  })\n\n  callback(null, paths)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-account-snapshot/index.js\n// module id = 419\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-account-snapshot/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst EthBlockHeader = __webpack_require__(407)\nconst cidFromHash = __webpack_require__(142)\nconst createResolver = __webpack_require__(144)\n\nmodule.exports = createResolver('eth-block', EthBlockHeader, mapFromEthObj)\n\n\nfunction mapFromEthObj (ethObj, options, callback) {\n  const paths = []\n\n  // external links\n  paths.push({\n    path: 'parent',\n    value: { '/': cidFromHash('eth-block', ethObj.parentHash).toBaseEncodedString() }\n  })\n  paths.push({\n    path: 'ommers',\n    value: { '/': cidFromHash('eth-block-list', ethObj.uncleHash).toBaseEncodedString() }\n  })\n  paths.push({\n    path: 'transactions',\n    value: { '/': cidFromHash('eth-tx-trie', ethObj.transactionsTrie).toBaseEncodedString() }\n  })\n  paths.push({\n    path: 'transactionReceipts',\n    value: { '/': cidFromHash('eth-tx-receipt-trie', ethObj.receiptTrie).toBaseEncodedString() }\n  })\n  paths.push({\n    path: 'state',\n    value: { '/': cidFromHash('eth-state-trie', ethObj.stateRoot).toBaseEncodedString() }\n  })\n\n  // external links as data\n  paths.push({\n    path: 'parentHash',\n    value: ethObj.parentHash\n  })\n  paths.push({\n    path: 'ommerHash',\n    value: ethObj.uncleHash\n  })\n  paths.push({\n    path: 'transactionTrieRoot',\n    value: ethObj.transactionsTrie\n  })\n  paths.push({\n    path: 'transactionReceiptTrieRoot',\n    value: ethObj.receiptTrie\n  })\n  paths.push({\n    path: 'stateRoot',\n    value: ethObj.stateRoot\n  })\n\n  // internal data\n  paths.push({\n    path: 'authorAddress',\n    value: ethObj.coinbase\n  })\n  paths.push({\n    path: 'bloom',\n    value: ethObj.bloom\n  })\n  paths.push({\n    path: 'difficulty',\n    value: ethObj.difficulty\n  })\n  paths.push({\n    path: 'number',\n    value: ethObj.number\n  })\n  paths.push({\n    path: 'gasLimit',\n    value: ethObj.gasLimit\n  })\n  paths.push({\n    path: 'gasUsed',\n    value: ethObj.gasUsed\n  })\n  paths.push({\n    path: 'timestamp',\n    value: ethObj.timestamp\n  })\n  paths.push({\n    path: 'extraData',\n    value: ethObj.extraData\n  })\n  paths.push({\n    path: 'mixHash',\n    value: ethObj.mixHash\n  })\n  paths.push({\n    path: 'nonce',\n    value: ethObj.nonce\n  })\n\n  callback(null, paths)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-block/index.js\n// module id = 420\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-block/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst EthTx = __webpack_require__(860)\nconst createResolver = __webpack_require__(144)\n\nmodule.exports = createResolver('eth-tx', EthTx, mapFromEthObj)\n\n\nfunction mapFromEthObj (tx, options, callback) {\n  const paths = []\n\n  // external links (none)\n\n  // external links as data (none)\n\n  // internal data\n\n  paths.push({\n    path: 'nonce',\n    value: tx.nonce\n  })\n  paths.push({\n    path: 'gasPrice',\n    value: tx.gasPrice\n  })\n  paths.push({\n    path: 'gasLimit',\n    value: tx.gasLimit\n  })\n  paths.push({\n    path: 'toAddress',\n    value: tx.to\n  })\n  paths.push({\n    path: 'value',\n    value: tx.value\n  })\n  paths.push({\n    path: 'data',\n    value: tx.data\n  })\n  paths.push({\n    path: 'v',\n    value: tx.v\n  })\n  paths.push({\n    path: 'r',\n    value: tx.r\n  })\n  paths.push({\n    path: 's',\n    value: tx.s\n  })\n\n  // helpers\n\n  paths.push({\n    path: 'fromAddress',\n    value: tx.from\n  })\n\n  paths.push({\n    path: 'signature',\n    value: [tx.v, tx.r, tx.s]\n  })\n\n  paths.push({\n    path: 'isContractPublish',\n    value: tx.toCreationAddress()\n  })\n\n  callback(null, paths)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-tx/index.js\n// module id = 421\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-tx/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst cidFromHash = __webpack_require__(142)\n\nmodule.exports = cidFromEthObj\n\nfunction cidFromEthObj (multicodec, ethObj) {\n  const hashBuffer = ethObj.hash()\n  const cid = cidFromHash(multicodec, hashBuffer)\n  return cid\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/cidFromEthObj.js\n// module id = 422\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/cidFromEthObj.js")},function(module,exports){eval("module.exports = createIsLink\n\nfunction createIsLink (resolve) {\n  return function isLink (block, path, callback) {\n    resolve(block, path, (err, result) => {\n      if (err) {\n        return callback(err)\n      }\n\n      if (result.remainderPath.length > 0) {\n        return callback(new Error('path out of scope'))\n      }\n\n      if (typeof result.value === 'object' && result.value['/']) {\n        callback(null, result.value)\n      } else {\n        callback(null, false)\n      }\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/createIsLink.js\n// module id = 423\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/createIsLink.js")},function(module,exports,__webpack_require__){eval("const cidFromEthObj = __webpack_require__(422)\nconst asyncify = __webpack_require__(161)\n\nmodule.exports = createUtil\n\nfunction createUtil (multicodec, EthObjClass) {\n  return {\n    deserialize: asyncify((serialized) => new EthObjClass(serialized)),\n    serialize: asyncify((ethObj) => ethObj.serialize()),\n    cid: asyncify((ethObj) => cidFromEthObj(multicodec, ethObj))\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/createUtil.js\n// module id = 424\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/createUtil.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst util = __webpack_require__(426)\nconst traverse = __webpack_require__(545)\n\nexports = module.exports\n\nexports.multicodec = 'git-raw'\n\nconst personInfoPaths = [\n  'original',\n  'name',\n  'email',\n  'date'\n]\n\nexports.resolve = (binaryBlob, path, callback) => {\n  if (typeof path === 'function') {\n    callback = path\n    path = undefined\n  }\n\n  util.deserialize(binaryBlob, (err, node) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (!path || path === '/') {\n      return callback(null, {\n        value: node,\n        remainderPath: ''\n      })\n    }\n\n    if (Buffer.isBuffer(node)) { // git blob\n      return callback(null, {\n        value: node,\n        remainderPath: path\n      })\n    }\n\n    const parts = path.split('/')\n    const val = traverse(node).get(parts)\n\n    if (val) {\n      return callback(null, {\n        value: val,\n        remainderPath: ''\n      })\n    }\n\n    let value\n    let len = parts.length\n\n    for (let i = 0; i < len; i++) {\n      const partialPath = parts.shift()\n\n      if (Array.isArray(node)) {\n        value = node[Number(partialPath)]\n      } if (node[partialPath]) {\n        value = node[partialPath]\n      } else {\n        // can't traverse more\n        if (!value) {\n          return callback(new Error('path not available at root'))\n        } else {\n          parts.unshift(partialPath)\n          return callback(null, {\n            value: value,\n            remainderPath: parts.join('/')\n          })\n        }\n      }\n      node = value\n    }\n  })\n}\n\nexports.tree = (binaryBlob, options, callback) => {\n  if (typeof options === 'function') {\n    callback = options\n    options = undefined\n  }\n\n  options = options || {}\n\n  util.deserialize(binaryBlob, (err, node) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (Buffer.isBuffer(node)) { // git blob\n      return callback(null, [])\n    }\n\n    let paths = []\n    switch (node.gitType) {\n      case 'commit':\n        paths = [\n          'message',\n          'tree'\n        ]\n\n        paths = paths.concat(personInfoPaths.map((e) => 'author/' + e))\n        paths = paths.concat(personInfoPaths.map((e) => 'committer/' + e))\n        paths = paths.concat(node.parents.map((_, e) => 'parents/' + e))\n\n        if (node.encoding) {\n          paths.push('encoding')\n        }\n        break\n      case 'tag':\n        paths = [\n          'object',\n          'type',\n          'tag',\n          'message'\n        ]\n\n        if (node.tagger) {\n          paths = paths.concat(personInfoPaths.map((e) => 'tagger/' + e))\n        }\n\n        break\n      default: // tree\n        Object.keys(node).forEach(dir => {\n          paths.push(dir)\n          paths.push(dir + '/hash')\n          paths.push(dir + '/mode')\n        })\n    }\n    callback(null, paths)\n  })\n}\n\nexports.isLink = (binaryBlob, path, callback) => {\n  exports.resolve(binaryBlob, path, (err, result) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (result.remainderPath.length > 0) {\n      return callback(new Error('path out of scope'))\n    }\n\n    if (typeof result.value === 'object' && result.value['/']) {\n      callback(null, result.value)\n    } else {\n      callback(null, false)\n    }\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/resolver.js\n// module id = 425\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/resolver.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst setImmediate = __webpack_require__(8)\nconst waterfall = __webpack_require__(12)\nconst multihashing = __webpack_require__(49)\nconst CID = __webpack_require__(14)\n\nconst resolver = __webpack_require__(425)\nconst gitUtil = __webpack_require__(191)\n\nconst commit = __webpack_require__(949)\nconst tag = __webpack_require__(950)\nconst tree = __webpack_require__(951)\n\nexports = module.exports\n\nexports.serialize = (dagNode, callback) => {\n  if (dagNode === null) {\n    setImmediate(() => callback(new Error('dagNode passed to serialize was null'), null))\n    return\n  }\n\n  if (Buffer.isBuffer(dagNode)) {\n    if (dagNode.slice(0, 4).toString() === 'blob') {\n      setImmediate(() => callback(null, dagNode))\n    } else {\n      setImmediate(() => callback(new Error('unexpected dagNode passed to serialize'), null))\n    }\n    return\n  }\n\n  switch (dagNode.gitType) {\n    case 'commit':\n      commit.serialize(dagNode, callback)\n      break\n    case 'tag':\n      tag.serialize(dagNode, callback)\n      break\n    default:\n      // assume tree as a file named 'type' is legal\n      tree.serialize(dagNode, callback)\n  }\n}\n\nexports.deserialize = (data, callback) => {\n  let headLen = gitUtil.find(data, 0)\n  let head = data.slice(0, headLen).toString()\n  let typeLen = head.match(/([^ ]+) (\\d+)/)\n  if (!typeLen) {\n    setImmediate(() => callback(new Error('invalid object header'), null))\n    return\n  }\n\n  switch (typeLen[1]) {\n    case 'blob':\n      callback(null, data)\n      break\n    case 'commit':\n      commit.deserialize(data.slice(headLen + 1), callback)\n      break\n    case 'tag':\n      tag.deserialize(data.slice(headLen + 1), callback)\n      break\n    case 'tree':\n      tree.deserialize(data.slice(headLen + 1), callback)\n      break\n    default:\n      setImmediate(() => callback(new Error('unknown object type ' + typeLen[1]), null))\n  }\n}\n\nexports.cid = (dagNode, callback) => {\n  waterfall([\n    (cb) => exports.serialize(dagNode, cb),\n    (serialized, cb) => multihashing(serialized, 'sha1', cb),\n    (mh, cb) => cb(null, new CID(1, resolver.multicodec, mh))\n  ], callback)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/util.js\n// module id = 426\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst ZcashBitcoreBlock = __webpack_require__(1315).Block\nconst CID = __webpack_require__(14)\nconst multihashes = __webpack_require__(32)\nconst sha256 = __webpack_require__(185)\n\n/**\n * @callback SerializeCallback\n * @param {?Error} error - Error if serialization failed\n * @param {?Buffer} binaryBlob - Binary Zcash block if serialization was\n *   successful\n */\n/**\n * Serialize internal representation into a binary Zcash block.\n *\n * @param {ZcashBlock} dagNode - Internal representation of a Zcash block\n * @param {SerializeCallback} callback - Callback that handles the\n *   return value\n * @returns {void}\n */\nconst serialize = (dagNode, callback) => {\n  let err = null\n  let binaryBlob\n  try {\n    binaryBlob = dagNode.toBuffer()\n  } catch (serializeError) {\n    err = serializeError\n  } finally {\n    callback(err, binaryBlob)\n  }\n}\n\n/**\n * @callback DeserializeCallback\n * @param {?Error} error - Error if deserialization failed\n * @param {?ZcashBlock} dagNode - Internal representation of a Zcash block\n *   if deserialization was successful\n */\n/**\n * Deserialize Zcash block into the internal representation,\n *\n * @param {Buffer} binaryBlob - Binary representation of a Zcash block\n * @param {DeserializeCallback} callback - Callback that handles the\n *   return value\n * @returns {void}\n */\nconst deserialize = (binaryBlob, callback) => {\n  let err = null\n  let dagNode\n  try {\n    dagNode = ZcashBitcoreBlock.fromBuffer(binaryBlob)\n  } catch (deserializeError) {\n    err = deserializeError\n  } finally {\n    callback(err, dagNode)\n  }\n}\n\n/**\n * @callback CidCallback\n * @param {?Error} error - Error if getting the CID failed\n * @param {?CID} cid - CID if call was successful\n */\n/**\n * Get the CID of the DAG-Node.\n *\n * @param {ZcashBlock} dagNode - Internal representation of a Zcash block\n * @param {CidCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst cid = (dagNode, callback) => {\n  let err = null\n  let cid\n  try {\n    // Zcash double hashes\n    const firstHash = sha256().update(dagNode.header.toBuffer(true)).digest()\n    const headerHash = sha256().update(Buffer.from(firstHash)).digest()\n\n    cid = hashToCid(Buffer.from(headerHash))\n  } catch (cidError) {\n    err = cidError\n  } finally {\n    callback(err, cid)\n  }\n}\n\n// Convert a Zcash hash (as Buffer) to a CID\nconst hashToCid = (hash) => {\n  const multihash = multihashes.encode(hash, 'dbl-sha2-256')\n  const cidVersion = 1\n  const cid = new CID(cidVersion, 'zcash-block', multihash)\n  return cid\n}\n\nmodule.exports = {\n  hashToCid: hashToCid,\n\n  // Public API\n  cid: cid,\n  deserialize: deserialize,\n  serialize: serialize\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-zcash/src/util.js\n// module id = 427\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-zcash/src/util.js")},function(module,exports){eval("module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n  var string = toString.call(fn)\n  return string === '[object Function]' ||\n    (typeof fn === 'function' && string !== '[object RegExp]') ||\n    (typeof window !== 'undefined' &&\n     // IE8 and below\n     (fn === window.setTimeout ||\n      fn === window.alert ||\n      fn === window.confirm ||\n      fn === window.prompt))\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-function/index.js\n// module id = 428\n// module chunks = 0\n\n//# sourceURL=../node_modules/is-function/index.js")},function(module,exports){eval("/**\n * Returns a `Boolean` on whether or not the a `String` starts with '0x'\n * @param {String} str the string input value\n * @return {Boolean} a boolean if it is or is not hex prefixed\n * @throws if the str input is not a string\n */\nmodule.exports = function isHexPrefixed(str) {\n  if (typeof str !== 'string') {\n    throw new Error(\"[is-hex-prefixed] value must be type 'string', is currently type \" + (typeof str) + \", while checking isHexPrefixed.\");\n  }\n\n  return str.slice(0, 2) === '0x';\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-hex-prefixed/src/index.js\n// module id = 429\n// module chunks = 0\n\n//# sourceURL=../node_modules/is-hex-prefixed/src/index.js")},function(module,exports){eval("module.exports = isPromise;\r\n\r\nfunction isPromise(obj) {\r\n  return obj && typeof obj.then === 'function';\r\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-promise/index.js\n// module id = 430\n// module chunks = 0\n\n//# sourceURL=../node_modules/is-promise/index.js")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/isarray/index.js\n// module id = 431\n// module chunks = 0\n\n//# sourceURL=../node_modules/isarray/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* This program is free software. It comes without any warranty, to\n     * the extent permitted by applicable law. You can redistribute it\n     * and/or modify it under the terms of the Do What The Fuck You Want\n     * To Public License, Version 2, as published by Sam Hocevar. See\n     * http://www.wtfpl.net/ for more details. */\n\nmodule.exports = leftPad;\n\nvar cache = [\n  '',\n  ' ',\n  '  ',\n  '   ',\n  '    ',\n  '     ',\n  '      ',\n  '       ',\n  '        ',\n  '         '\n];\n\nfunction leftPad (str, len, ch) {\n  // convert `str` to a `string`\n  str = str + '';\n  // `len` is the `pad`'s length now\n  len = len - str.length;\n  // doesn't need to pad\n  if (len <= 0) return str;\n  // `ch` defaults to `' '`\n  if (!ch && ch !== 0) ch = ' ';\n  // convert `ch` to a `string` cuz it could be a number\n  ch = ch + '';\n  // cache common use cases\n  if (ch === ' ' && len < 10) return cache[len] + str;\n  // `pad` starts with an empty string\n  var pad = '';\n  // loop\n  while (true) {\n    // add `ch` to `pad` if `len` is odd\n    if (len & 1) pad += ch;\n    // divide `len` by 2, ditch the remainder\n    len >>= 1;\n    // \"double\" the `ch` so this operation count grows logarithmically on `len`\n    // each time `ch` is \"doubled\", the `len` would need to be \"doubled\" too\n    // similar to finding a value in binary search tree, hence O(log(n))\n    if (len) ch += ch;\n    // `len` is 0, exit the loop\n    else break;\n  }\n  // pad `str`!\n  return pad + str;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/left-pad/index.js\n// module id = 432\n// module chunks = 0\n\n//# sourceURL=../node_modules/left-pad/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(968);\n/*</replacement>*/\n\n\n/*<replacement>*/\nvar Buffer = __webpack_require__(0).Buffer;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\nvar EE = __webpack_require__(15).EventEmitter;\n\n/*<replacement>*/\nif (!EE.listenerCount) EE.listenerCount = function(emitter, type) {\n  return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\nvar Stream = __webpack_require__(46);\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nvar StringDecoder;\n\n\n/*<replacement>*/\nvar debug = __webpack_require__(1352);\nif (debug && debug.debuglog) {\n  debug = debug.debuglog('stream');\n} else {\n  debug = function () {};\n}\n/*</replacement>*/\n\n\nutil.inherits(Readable, Stream);\n\nfunction ReadableState(options, stream) {\n  var Duplex = __webpack_require__(122);\n\n  options = options || {};\n\n  // the point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  var hwm = options.highWaterMark;\n  var defaultHwm = options.objectMode ? 16 : 16 * 1024;\n  this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;\n\n  // cast to ints.\n  this.highWaterMark = ~~this.highWaterMark;\n\n  this.buffer = [];\n  this.length = 0;\n  this.pipes = null;\n  this.pipesCount = 0;\n  this.flowing = null;\n  this.ended = false;\n  this.endEmitted = false;\n  this.reading = false;\n\n  // a flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true;\n\n  // whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  this.needReadable = false;\n  this.emittedReadable = false;\n  this.readableListening = false;\n\n\n  // object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away\n  this.objectMode = !!options.objectMode;\n\n  if (stream instanceof Duplex)\n    this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // when piping, we only care about 'readable' events that happen\n  // after read()ing all the bytes and not getting any pushback.\n  this.ranOut = false;\n\n  // the number of writers that are awaiting a drain event in .pipe()s\n  this.awaitDrain = 0;\n\n  // if true, a maybeReadMore has been scheduled\n  this.readingMore = false;\n\n  this.decoder = null;\n  this.encoding = null;\n  if (options.encoding) {\n    if (!StringDecoder)\n      StringDecoder = __webpack_require__(156).StringDecoder;\n    this.decoder = new StringDecoder(options.encoding);\n    this.encoding = options.encoding;\n  }\n}\n\nfunction Readable(options) {\n  var Duplex = __webpack_require__(122);\n\n  if (!(this instanceof Readable))\n    return new Readable(options);\n\n  this._readableState = new ReadableState(options, this);\n\n  // legacy\n  this.readable = true;\n\n  Stream.call(this);\n}\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function(chunk, encoding) {\n  var state = this._readableState;\n\n  if (util.isString(chunk) && !state.objectMode) {\n    encoding = encoding || state.defaultEncoding;\n    if (encoding !== state.encoding) {\n      chunk = new Buffer(chunk, encoding);\n      encoding = '';\n    }\n  }\n\n  return readableAddChunk(this, state, chunk, encoding, false);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function(chunk) {\n  var state = this._readableState;\n  return readableAddChunk(this, state, chunk, '', true);\n};\n\nfunction readableAddChunk(stream, state, chunk, encoding, addToFront) {\n  var er = chunkInvalid(state, chunk);\n  if (er) {\n    stream.emit('error', er);\n  } else if (util.isNullOrUndefined(chunk)) {\n    state.reading = false;\n    if (!state.ended)\n      onEofChunk(stream, state);\n  } else if (state.objectMode || chunk && chunk.length > 0) {\n    if (state.ended && !addToFront) {\n      var e = new Error('stream.push() after EOF');\n      stream.emit('error', e);\n    } else if (state.endEmitted && addToFront) {\n      var e = new Error('stream.unshift() after end event');\n      stream.emit('error', e);\n    } else {\n      if (state.decoder && !addToFront && !encoding)\n        chunk = state.decoder.write(chunk);\n\n      if (!addToFront)\n        state.reading = false;\n\n      // if we want the data now, just emit it.\n      if (state.flowing && state.length === 0 && !state.sync) {\n        stream.emit('data', chunk);\n        stream.read(0);\n      } else {\n        // update the buffer info.\n        state.length += state.objectMode ? 1 : chunk.length;\n        if (addToFront)\n          state.buffer.unshift(chunk);\n        else\n          state.buffer.push(chunk);\n\n        if (state.needReadable)\n          emitReadable(stream);\n      }\n\n      maybeReadMore(stream, state);\n    }\n  } else if (!addToFront) {\n    state.reading = false;\n  }\n\n  return needMoreData(state);\n}\n\n\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes.  This is to work around cases where hwm=0,\n// such as the repl.  Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n  return !state.ended &&\n         (state.needReadable ||\n          state.length < state.highWaterMark ||\n          state.length === 0);\n}\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function(enc) {\n  if (!StringDecoder)\n    StringDecoder = __webpack_require__(156).StringDecoder;\n  this._readableState.decoder = new StringDecoder(enc);\n  this._readableState.encoding = enc;\n  return this;\n};\n\n// Don't raise the hwm > 128MB\nvar MAX_HWM = 0x800000;\nfunction roundUpToNextPowerOf2(n) {\n  if (n >= MAX_HWM) {\n    n = MAX_HWM;\n  } else {\n    // Get the next highest power of 2\n    n--;\n    for (var p = 1; p < 32; p <<= 1) n |= n >> p;\n    n++;\n  }\n  return n;\n}\n\nfunction howMuchToRead(n, state) {\n  if (state.length === 0 && state.ended)\n    return 0;\n\n  if (state.objectMode)\n    return n === 0 ? 0 : 1;\n\n  if (isNaN(n) || util.isNull(n)) {\n    // only flow one buffer at a time\n    if (state.flowing && state.buffer.length)\n      return state.buffer[0].length;\n    else\n      return state.length;\n  }\n\n  if (n <= 0)\n    return 0;\n\n  // If we're asking for more than the target buffer level,\n  // then raise the water mark.  Bump up to the next highest\n  // power of 2, to prevent increasing it excessively in tiny\n  // amounts.\n  if (n > state.highWaterMark)\n    state.highWaterMark = roundUpToNextPowerOf2(n);\n\n  // don't have that much.  return null, unless we've ended.\n  if (n > state.length) {\n    if (!state.ended) {\n      state.needReadable = true;\n      return 0;\n    } else\n      return state.length;\n  }\n\n  return n;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function(n) {\n  debug('read', n);\n  var state = this._readableState;\n  var nOrig = n;\n\n  if (!util.isNumber(n) || n > 0)\n    state.emittedReadable = false;\n\n  // if we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (n === 0 &&\n      state.needReadable &&\n      (state.length >= state.highWaterMark || state.ended)) {\n    debug('read: emitReadable', state.length, state.ended);\n    if (state.length === 0 && state.ended)\n      endReadable(this);\n    else\n      emitReadable(this);\n    return null;\n  }\n\n  n = howMuchToRead(n, state);\n\n  // if we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0)\n      endReadable(this);\n    return null;\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  var doRead = state.needReadable;\n  debug('need readable', doRead);\n\n  // if we currently have less than the highWaterMark, then also read some\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true;\n    debug('length less than watermark', doRead);\n  }\n\n  // however, if we've ended, then there's no point, and if we're already\n  // reading, then it's unnecessary.\n  if (state.ended || state.reading) {\n    doRead = false;\n    debug('reading or ended', doRead);\n  }\n\n  if (doRead) {\n    debug('do read');\n    state.reading = true;\n    state.sync = true;\n    // if the length is currently zero, then we *need* a readable event.\n    if (state.length === 0)\n      state.needReadable = true;\n    // call internal read method\n    this._read(state.highWaterMark);\n    state.sync = false;\n  }\n\n  // If _read pushed data synchronously, then `reading` will be false,\n  // and we need to re-evaluate how much data we can return to the user.\n  if (doRead && !state.reading)\n    n = howMuchToRead(nOrig, state);\n\n  var ret;\n  if (n > 0)\n    ret = fromList(n, state);\n  else\n    ret = null;\n\n  if (util.isNull(ret)) {\n    state.needReadable = true;\n    n = 0;\n  }\n\n  state.length -= n;\n\n  // If we have nothing in the buffer, then we want to know\n  // as soon as we *do* get something into the buffer.\n  if (state.length === 0 && !state.ended)\n    state.needReadable = true;\n\n  // If we tried to read() past the EOF, then emit end on the next tick.\n  if (nOrig !== n && state.ended && state.length === 0)\n    endReadable(this);\n\n  if (!util.isNull(ret))\n    this.emit('data', ret);\n\n  return ret;\n};\n\nfunction chunkInvalid(state, chunk) {\n  var er = null;\n  if (!util.isBuffer(chunk) &&\n      !util.isString(chunk) &&\n      !util.isNullOrUndefined(chunk) &&\n      !state.objectMode) {\n    er = new TypeError('Invalid non-string/buffer chunk');\n  }\n  return er;\n}\n\n\nfunction onEofChunk(stream, state) {\n  if (state.decoder && !state.ended) {\n    var chunk = state.decoder.end();\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk);\n      state.length += state.objectMode ? 1 : chunk.length;\n    }\n  }\n  state.ended = true;\n\n  // emit 'readable' now to make sure it gets picked up.\n  emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  var state = stream._readableState;\n  state.needReadable = false;\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing);\n    state.emittedReadable = true;\n    if (state.sync)\n      process.nextTick(function() {\n        emitReadable_(stream);\n      });\n    else\n      emitReadable_(stream);\n  }\n}\n\nfunction emitReadable_(stream) {\n  debug('emit readable');\n  stream.emit('readable');\n  flow(stream);\n}\n\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore) {\n    state.readingMore = true;\n    process.nextTick(function() {\n      maybeReadMore_(stream, state);\n    });\n  }\n}\n\nfunction maybeReadMore_(stream, state) {\n  var len = state.length;\n  while (!state.reading && !state.flowing && !state.ended &&\n         state.length < state.highWaterMark) {\n    debug('maybeReadMore read 0');\n    stream.read(0);\n    if (len === state.length)\n      // didn't get any data, stop spinning.\n      break;\n    else\n      len = state.length;\n  }\n  state.readingMore = false;\n}\n\n// abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function(n) {\n  this.emit('error', new Error('not implemented'));\n};\n\nReadable.prototype.pipe = function(dest, pipeOpts) {\n  var src = this;\n  var state = this._readableState;\n\n  switch (state.pipesCount) {\n    case 0:\n      state.pipes = dest;\n      break;\n    case 1:\n      state.pipes = [state.pipes, dest];\n      break;\n    default:\n      state.pipes.push(dest);\n      break;\n  }\n  state.pipesCount += 1;\n  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n  var doEnd = (!pipeOpts || pipeOpts.end !== false) &&\n              dest !== process.stdout &&\n              dest !== process.stderr;\n\n  var endFn = doEnd ? onend : cleanup;\n  if (state.endEmitted)\n    process.nextTick(endFn);\n  else\n    src.once('end', endFn);\n\n  dest.on('unpipe', onunpipe);\n  function onunpipe(readable) {\n    debug('onunpipe');\n    if (readable === src) {\n      cleanup();\n    }\n  }\n\n  function onend() {\n    debug('onend');\n    dest.end();\n  }\n\n  // when the dest drains, it reduces the awaitDrain counter\n  // on the source.  This would be more elegant with a .once()\n  // handler in flow(), but adding and removing repeatedly is\n  // too slow.\n  var ondrain = pipeOnDrain(src);\n  dest.on('drain', ondrain);\n\n  function cleanup() {\n    debug('cleanup');\n    // cleanup event handlers once the pipe is broken\n    dest.removeListener('close', onclose);\n    dest.removeListener('finish', onfinish);\n    dest.removeListener('drain', ondrain);\n    dest.removeListener('error', onerror);\n    dest.removeListener('unpipe', onunpipe);\n    src.removeListener('end', onend);\n    src.removeListener('end', cleanup);\n    src.removeListener('data', ondata);\n\n    // if the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (state.awaitDrain &&\n        (!dest._writableState || dest._writableState.needDrain))\n      ondrain();\n  }\n\n  src.on('data', ondata);\n  function ondata(chunk) {\n    debug('ondata');\n    var ret = dest.write(chunk);\n    if (false === ret) {\n      debug('false write response, pause',\n            src._readableState.awaitDrain);\n      src._readableState.awaitDrain++;\n      src.pause();\n    }\n  }\n\n  // if the dest has an error, then stop piping into it.\n  // however, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er);\n    unpipe();\n    dest.removeListener('error', onerror);\n    if (EE.listenerCount(dest, 'error') === 0)\n      dest.emit('error', er);\n  }\n  // This is a brutally ugly hack to make sure that our error handler\n  // is attached before any userland ones.  NEVER DO THIS.\n  if (!dest._events || !dest._events.error)\n    dest.on('error', onerror);\n  else if (isArray(dest._events.error))\n    dest._events.error.unshift(onerror);\n  else\n    dest._events.error = [onerror, dest._events.error];\n\n\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish);\n    unpipe();\n  }\n  dest.once('close', onclose);\n  function onfinish() {\n    debug('onfinish');\n    dest.removeListener('close', onclose);\n    unpipe();\n  }\n  dest.once('finish', onfinish);\n\n  function unpipe() {\n    debug('unpipe');\n    src.unpipe(dest);\n  }\n\n  // tell the dest that it's being piped to\n  dest.emit('pipe', src);\n\n  // start the flow if it hasn't been started already.\n  if (!state.flowing) {\n    debug('pipe resume');\n    src.resume();\n  }\n\n  return dest;\n};\n\nfunction pipeOnDrain(src) {\n  return function() {\n    var state = src._readableState;\n    debug('pipeOnDrain', state.awaitDrain);\n    if (state.awaitDrain)\n      state.awaitDrain--;\n    if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) {\n      state.flowing = true;\n      flow(src);\n    }\n  };\n}\n\n\nReadable.prototype.unpipe = function(dest) {\n  var state = this._readableState;\n\n  // if we're not piping anywhere, then do nothing.\n  if (state.pipesCount === 0)\n    return this;\n\n  // just one destination.  most common case.\n  if (state.pipesCount === 1) {\n    // passed in one, but it's not the right one.\n    if (dest && dest !== state.pipes)\n      return this;\n\n    if (!dest)\n      dest = state.pipes;\n\n    // got a match.\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n    if (dest)\n      dest.emit('unpipe', this);\n    return this;\n  }\n\n  // slow case. multiple pipe destinations.\n\n  if (!dest) {\n    // remove all.\n    var dests = state.pipes;\n    var len = state.pipesCount;\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n\n    for (var i = 0; i < len; i++)\n      dests[i].emit('unpipe', this);\n    return this;\n  }\n\n  // try to find the right one.\n  var i = indexOf(state.pipes, dest);\n  if (i === -1)\n    return this;\n\n  state.pipes.splice(i, 1);\n  state.pipesCount -= 1;\n  if (state.pipesCount === 1)\n    state.pipes = state.pipes[0];\n\n  dest.emit('unpipe', this);\n\n  return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function(ev, fn) {\n  var res = Stream.prototype.on.call(this, ev, fn);\n\n  // If listening to data, and it has not explicitly been paused,\n  // then call resume to start the flow of data on the next tick.\n  if (ev === 'data' && false !== this._readableState.flowing) {\n    this.resume();\n  }\n\n  if (ev === 'readable' && this.readable) {\n    var state = this._readableState;\n    if (!state.readableListening) {\n      state.readableListening = true;\n      state.emittedReadable = false;\n      state.needReadable = true;\n      if (!state.reading) {\n        var self = this;\n        process.nextTick(function() {\n          debug('readable nexttick read 0');\n          self.read(0);\n        });\n      } else if (state.length) {\n        emitReadable(this, state);\n      }\n    }\n  }\n\n  return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function() {\n  var state = this._readableState;\n  if (!state.flowing) {\n    debug('resume');\n    state.flowing = true;\n    if (!state.reading) {\n      debug('resume read 0');\n      this.read(0);\n    }\n    resume(this, state);\n  }\n  return this;\n};\n\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true;\n    process.nextTick(function() {\n      resume_(stream, state);\n    });\n  }\n}\n\nfunction resume_(stream, state) {\n  state.resumeScheduled = false;\n  stream.emit('resume');\n  flow(stream);\n  if (state.flowing && !state.reading)\n    stream.read(0);\n}\n\nReadable.prototype.pause = function() {\n  debug('call pause flowing=%j', this._readableState.flowing);\n  if (false !== this._readableState.flowing) {\n    debug('pause');\n    this._readableState.flowing = false;\n    this.emit('pause');\n  }\n  return this;\n};\n\nfunction flow(stream) {\n  var state = stream._readableState;\n  debug('flow', state.flowing);\n  if (state.flowing) {\n    do {\n      var chunk = stream.read();\n    } while (null !== chunk && state.flowing);\n  }\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function(stream) {\n  var state = this._readableState;\n  var paused = false;\n\n  var self = this;\n  stream.on('end', function() {\n    debug('wrapped end');\n    if (state.decoder && !state.ended) {\n      var chunk = state.decoder.end();\n      if (chunk && chunk.length)\n        self.push(chunk);\n    }\n\n    self.push(null);\n  });\n\n  stream.on('data', function(chunk) {\n    debug('wrapped data');\n    if (state.decoder)\n      chunk = state.decoder.write(chunk);\n    if (!chunk || !state.objectMode && !chunk.length)\n      return;\n\n    var ret = self.push(chunk);\n    if (!ret) {\n      paused = true;\n      stream.pause();\n    }\n  });\n\n  // proxy all the other methods.\n  // important when wrapping filters and duplexes.\n  for (var i in stream) {\n    if (util.isFunction(stream[i]) && util.isUndefined(this[i])) {\n      this[i] = function(method) { return function() {\n        return stream[method].apply(stream, arguments);\n      }}(i);\n    }\n  }\n\n  // proxy certain important events.\n  var events = ['error', 'close', 'destroy', 'pause', 'resume'];\n  forEach(events, function(ev) {\n    stream.on(ev, self.emit.bind(self, ev));\n  });\n\n  // when we try to consume some more bytes, simply unpause the\n  // underlying stream.\n  self._read = function(n) {\n    debug('wrapped _read', n);\n    if (paused) {\n      paused = false;\n      stream.resume();\n    }\n  };\n\n  return self;\n};\n\n\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\nfunction fromList(n, state) {\n  var list = state.buffer;\n  var length = state.length;\n  var stringMode = !!state.decoder;\n  var objectMode = !!state.objectMode;\n  var ret;\n\n  // nothing in the list, definitely empty.\n  if (list.length === 0)\n    return null;\n\n  if (length === 0)\n    ret = null;\n  else if (objectMode)\n    ret = list.shift();\n  else if (!n || n >= length) {\n    // read it all, truncate the array.\n    if (stringMode)\n      ret = list.join('');\n    else\n      ret = Buffer.concat(list, length);\n    list.length = 0;\n  } else {\n    // read just some of it.\n    if (n < list[0].length) {\n      // just take a part of the first list item.\n      // slice is the same for buffers and strings.\n      var buf = list[0];\n      ret = buf.slice(0, n);\n      list[0] = buf.slice(n);\n    } else if (n === list[0].length) {\n      // first list is a perfect match\n      ret = list.shift();\n    } else {\n      // complex case.\n      // we have enough to cover it, but it spans past the first buffer.\n      if (stringMode)\n        ret = '';\n      else\n        ret = new Buffer(n);\n\n      var c = 0;\n      for (var i = 0, l = list.length; i < l && c < n; i++) {\n        var buf = list[0];\n        var cpy = Math.min(n - c, buf.length);\n\n        if (stringMode)\n          ret += buf.slice(0, cpy);\n        else\n          buf.copy(ret, c, 0, cpy);\n\n        if (cpy < buf.length)\n          list[0] = buf.slice(cpy);\n        else\n          list.shift();\n\n        c += cpy;\n      }\n    }\n  }\n\n  return ret;\n}\n\nfunction endReadable(stream) {\n  var state = stream._readableState;\n\n  // If we get here before consuming all the bytes, then that is a\n  // bug in node.  Should never happen.\n  if (state.length > 0)\n    throw new Error('endReadable called on non-empty stream');\n\n  if (!state.endEmitted) {\n    state.ended = true;\n    process.nextTick(function() {\n      // Check that we didn't get one last unshift.\n      if (!state.endEmitted && state.length === 0) {\n        state.endEmitted = true;\n        stream.readable = false;\n        stream.emit('end');\n      }\n    });\n  }\n}\n\nfunction forEach (xs, f) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    f(xs[i], i);\n  }\n}\n\nfunction indexOf (xs, x) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    if (xs[i] === x) return i;\n  }\n  return -1;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/lib/_stream_readable.js\n// module id = 433\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/lib/_stream_readable.js")},function(module,exports,__webpack_require__){eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(122);\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\n\nfunction TransformState(options, stream) {\n  this.afterTransform = function(er, data) {\n    return afterTransform(stream, er, data);\n  };\n\n  this.needTransform = false;\n  this.transforming = false;\n  this.writecb = null;\n  this.writechunk = null;\n}\n\nfunction afterTransform(stream, er, data) {\n  var ts = stream._transformState;\n  ts.transforming = false;\n\n  var cb = ts.writecb;\n\n  if (!cb)\n    return stream.emit('error', new Error('no writecb in Transform class'));\n\n  ts.writechunk = null;\n  ts.writecb = null;\n\n  if (!util.isNullOrUndefined(data))\n    stream.push(data);\n\n  if (cb)\n    cb(er);\n\n  var rs = stream._readableState;\n  rs.reading = false;\n  if (rs.needReadable || rs.length < rs.highWaterMark) {\n    stream._read(rs.highWaterMark);\n  }\n}\n\n\nfunction Transform(options) {\n  if (!(this instanceof Transform))\n    return new Transform(options);\n\n  Duplex.call(this, options);\n\n  this._transformState = new TransformState(options, this);\n\n  // when the writable side finishes, then flush out anything remaining.\n  var stream = this;\n\n  // start out asking for a readable event once data is transformed.\n  this._readableState.needReadable = true;\n\n  // we have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false;\n\n  this.once('prefinish', function() {\n    if (util.isFunction(this._flush))\n      this._flush(function(er) {\n        done(stream, er);\n      });\n    else\n      done(stream);\n  });\n}\n\nTransform.prototype.push = function(chunk, encoding) {\n  this._transformState.needTransform = false;\n  return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side.  You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk.  If you pass\n// an error, then that'll put the hurt on the whole operation.  If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function(chunk, encoding, cb) {\n  throw new Error('not implemented');\n};\n\nTransform.prototype._write = function(chunk, encoding, cb) {\n  var ts = this._transformState;\n  ts.writecb = cb;\n  ts.writechunk = chunk;\n  ts.writeencoding = encoding;\n  if (!ts.transforming) {\n    var rs = this._readableState;\n    if (ts.needTransform ||\n        rs.needReadable ||\n        rs.length < rs.highWaterMark)\n      this._read(rs.highWaterMark);\n  }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function(n) {\n  var ts = this._transformState;\n\n  if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) {\n    ts.transforming = true;\n    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n  } else {\n    // mark that we need a transform, so that any data that comes in\n    // will get processed, now that we've asked for it.\n    ts.needTransform = true;\n  }\n};\n\n\nfunction done(stream, er) {\n  if (er)\n    return stream.emit('error', er);\n\n  // if there's nothing in the write buffer, then that means\n  // that nothing more will ever be provided\n  var ws = stream._writableState;\n  var ts = stream._transformState;\n\n  if (ws.length)\n    throw new Error('calling transform done when ws.length != 0');\n\n  if (ts.transforming)\n    throw new Error('calling transform done when still transforming');\n\n  return stream.push(null);\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/lib/_stream_transform.js\n// module id = 434\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/lib/_stream_transform.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// A bit simpler than readable streams.\n// Implement an async ._write(chunk, cb), and it'll handle all\n// the drain event emission and buffering.\n\nmodule.exports = Writable;\n\n/*<replacement>*/\nvar Buffer = __webpack_require__(0).Buffer;\n/*</replacement>*/\n\nWritable.WritableState = WritableState;\n\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nvar Stream = __webpack_require__(46);\n\nutil.inherits(Writable, Stream);\n\nfunction WriteReq(chunk, encoding, cb) {\n  this.chunk = chunk;\n  this.encoding = encoding;\n  this.callback = cb;\n}\n\nfunction WritableState(options, stream) {\n  var Duplex = __webpack_require__(122);\n\n  options = options || {};\n\n  // the point at which write() starts returning false\n  // Note: 0 is a valid value, means that we always return false if\n  // the entire buffer is not flushed immediately on write()\n  var hwm = options.highWaterMark;\n  var defaultHwm = options.objectMode ? 16 : 16 * 1024;\n  this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm;\n\n  // object stream flag to indicate whether or not this stream\n  // contains buffers or objects.\n  this.objectMode = !!options.objectMode;\n\n  if (stream instanceof Duplex)\n    this.objectMode = this.objectMode || !!options.writableObjectMode;\n\n  // cast to ints.\n  this.highWaterMark = ~~this.highWaterMark;\n\n  this.needDrain = false;\n  // at the start of calling end()\n  this.ending = false;\n  // when end() has been called, and returned\n  this.ended = false;\n  // when 'finish' is emitted\n  this.finished = false;\n\n  // should we decode strings into buffers before passing to _write?\n  // this is here so that some node-core streams can optimize string\n  // handling at a lower level.\n  var noDecode = options.decodeStrings === false;\n  this.decodeStrings = !noDecode;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // not an actual buffer we keep track of, but a measurement\n  // of how much we're waiting to get pushed to some underlying\n  // socket or file.\n  this.length = 0;\n\n  // a flag to see when we're in the middle of a write.\n  this.writing = false;\n\n  // when true all writes will be buffered until .uncork() call\n  this.corked = 0;\n\n  // a flag to be able to tell if the onwrite cb is called immediately,\n  // or on a later tick.  We set this to true at first, because any\n  // actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first write call.\n  this.sync = true;\n\n  // a flag to know if we're processing previously buffered items, which\n  // may call the _write() callback in the same tick, so that we don't\n  // end up in an overlapped onwrite situation.\n  this.bufferProcessing = false;\n\n  // the callback that's passed to _write(chunk,cb)\n  this.onwrite = function(er) {\n    onwrite(stream, er);\n  };\n\n  // the callback that the user supplies to write(chunk,encoding,cb)\n  this.writecb = null;\n\n  // the amount that is being written when _write is called.\n  this.writelen = 0;\n\n  this.buffer = [];\n\n  // number of pending user-supplied write callbacks\n  // this must be 0 before 'finish' can be emitted\n  this.pendingcb = 0;\n\n  // emit prefinish if the only thing we're waiting for is _write cbs\n  // This is relevant for synchronous Transform streams\n  this.prefinished = false;\n\n  // True if the error was already emitted and should not be thrown again\n  this.errorEmitted = false;\n}\n\nfunction Writable(options) {\n  var Duplex = __webpack_require__(122);\n\n  // Writable ctor is applied to Duplexes, though they're not\n  // instanceof Writable, they're instanceof Readable.\n  if (!(this instanceof Writable) && !(this instanceof Duplex))\n    return new Writable(options);\n\n  this._writableState = new WritableState(options, this);\n\n  // legacy.\n  this.writable = true;\n\n  Stream.call(this);\n}\n\n// Otherwise people can pipe Writable streams, which is just wrong.\nWritable.prototype.pipe = function() {\n  this.emit('error', new Error('Cannot pipe. Not readable.'));\n};\n\n\nfunction writeAfterEnd(stream, state, cb) {\n  var er = new Error('write after end');\n  // TODO: defer error events consistently everywhere, not just the cb\n  stream.emit('error', er);\n  process.nextTick(function() {\n    cb(er);\n  });\n}\n\n// If we get something that is not a buffer, string, null, or undefined,\n// and we're not in objectMode, then that's an error.\n// Otherwise stream chunks are all considered to be of length=1, and the\n// watermarks determine how many objects to keep in the buffer, rather than\n// how many bytes or characters.\nfunction validChunk(stream, state, chunk, cb) {\n  var valid = true;\n  if (!util.isBuffer(chunk) &&\n      !util.isString(chunk) &&\n      !util.isNullOrUndefined(chunk) &&\n      !state.objectMode) {\n    var er = new TypeError('Invalid non-string/buffer chunk');\n    stream.emit('error', er);\n    process.nextTick(function() {\n      cb(er);\n    });\n    valid = false;\n  }\n  return valid;\n}\n\nWritable.prototype.write = function(chunk, encoding, cb) {\n  var state = this._writableState;\n  var ret = false;\n\n  if (util.isFunction(encoding)) {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (util.isBuffer(chunk))\n    encoding = 'buffer';\n  else if (!encoding)\n    encoding = state.defaultEncoding;\n\n  if (!util.isFunction(cb))\n    cb = function() {};\n\n  if (state.ended)\n    writeAfterEnd(this, state, cb);\n  else if (validChunk(this, state, chunk, cb)) {\n    state.pendingcb++;\n    ret = writeOrBuffer(this, state, chunk, encoding, cb);\n  }\n\n  return ret;\n};\n\nWritable.prototype.cork = function() {\n  var state = this._writableState;\n\n  state.corked++;\n};\n\nWritable.prototype.uncork = function() {\n  var state = this._writableState;\n\n  if (state.corked) {\n    state.corked--;\n\n    if (!state.writing &&\n        !state.corked &&\n        !state.finished &&\n        !state.bufferProcessing &&\n        state.buffer.length)\n      clearBuffer(this, state);\n  }\n};\n\nfunction decodeChunk(state, chunk, encoding) {\n  if (!state.objectMode &&\n      state.decodeStrings !== false &&\n      util.isString(chunk)) {\n    chunk = new Buffer(chunk, encoding);\n  }\n  return chunk;\n}\n\n// if we're already writing something, then just put this\n// in the queue, and wait our turn.  Otherwise, call _write\n// If we return false, then we need a drain event, so set that flag.\nfunction writeOrBuffer(stream, state, chunk, encoding, cb) {\n  chunk = decodeChunk(state, chunk, encoding);\n  if (util.isBuffer(chunk))\n    encoding = 'buffer';\n  var len = state.objectMode ? 1 : chunk.length;\n\n  state.length += len;\n\n  var ret = state.length < state.highWaterMark;\n  // we must ensure that previous needDrain will not be reset to false.\n  if (!ret)\n    state.needDrain = true;\n\n  if (state.writing || state.corked)\n    state.buffer.push(new WriteReq(chunk, encoding, cb));\n  else\n    doWrite(stream, state, false, len, chunk, encoding, cb);\n\n  return ret;\n}\n\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\n  state.writelen = len;\n  state.writecb = cb;\n  state.writing = true;\n  state.sync = true;\n  if (writev)\n    stream._writev(chunk, state.onwrite);\n  else\n    stream._write(chunk, encoding, state.onwrite);\n  state.sync = false;\n}\n\nfunction onwriteError(stream, state, sync, er, cb) {\n  if (sync)\n    process.nextTick(function() {\n      state.pendingcb--;\n      cb(er);\n    });\n  else {\n    state.pendingcb--;\n    cb(er);\n  }\n\n  stream._writableState.errorEmitted = true;\n  stream.emit('error', er);\n}\n\nfunction onwriteStateUpdate(state) {\n  state.writing = false;\n  state.writecb = null;\n  state.length -= state.writelen;\n  state.writelen = 0;\n}\n\nfunction onwrite(stream, er) {\n  var state = stream._writableState;\n  var sync = state.sync;\n  var cb = state.writecb;\n\n  onwriteStateUpdate(state);\n\n  if (er)\n    onwriteError(stream, state, sync, er, cb);\n  else {\n    // Check if we're actually ready to finish, but don't emit yet\n    var finished = needFinish(stream, state);\n\n    if (!finished &&\n        !state.corked &&\n        !state.bufferProcessing &&\n        state.buffer.length) {\n      clearBuffer(stream, state);\n    }\n\n    if (sync) {\n      process.nextTick(function() {\n        afterWrite(stream, state, finished, cb);\n      });\n    } else {\n      afterWrite(stream, state, finished, cb);\n    }\n  }\n}\n\nfunction afterWrite(stream, state, finished, cb) {\n  if (!finished)\n    onwriteDrain(stream, state);\n  state.pendingcb--;\n  cb();\n  finishMaybe(stream, state);\n}\n\n// Must force callback to be called on nextTick, so that we don't\n// emit 'drain' before the write() consumer gets the 'false' return\n// value, and has a chance to attach a 'drain' listener.\nfunction onwriteDrain(stream, state) {\n  if (state.length === 0 && state.needDrain) {\n    state.needDrain = false;\n    stream.emit('drain');\n  }\n}\n\n\n// if there's something in the buffer waiting, then process it\nfunction clearBuffer(stream, state) {\n  state.bufferProcessing = true;\n\n  if (stream._writev && state.buffer.length > 1) {\n    // Fast case, write everything using _writev()\n    var cbs = [];\n    for (var c = 0; c < state.buffer.length; c++)\n      cbs.push(state.buffer[c].callback);\n\n    // count the one we are adding, as well.\n    // TODO(isaacs) clean this up\n    state.pendingcb++;\n    doWrite(stream, state, true, state.length, state.buffer, '', function(err) {\n      for (var i = 0; i < cbs.length; i++) {\n        state.pendingcb--;\n        cbs[i](err);\n      }\n    });\n\n    // Clear buffer\n    state.buffer = [];\n  } else {\n    // Slow case, write chunks one-by-one\n    for (var c = 0; c < state.buffer.length; c++) {\n      var entry = state.buffer[c];\n      var chunk = entry.chunk;\n      var encoding = entry.encoding;\n      var cb = entry.callback;\n      var len = state.objectMode ? 1 : chunk.length;\n\n      doWrite(stream, state, false, len, chunk, encoding, cb);\n\n      // if we didn't call the onwrite immediately, then\n      // it means that we need to wait until it does.\n      // also, that means that the chunk and cb are currently\n      // being processed, so move the buffer counter past them.\n      if (state.writing) {\n        c++;\n        break;\n      }\n    }\n\n    if (c < state.buffer.length)\n      state.buffer = state.buffer.slice(c);\n    else\n      state.buffer.length = 0;\n  }\n\n  state.bufferProcessing = false;\n}\n\nWritable.prototype._write = function(chunk, encoding, cb) {\n  cb(new Error('not implemented'));\n\n};\n\nWritable.prototype._writev = null;\n\nWritable.prototype.end = function(chunk, encoding, cb) {\n  var state = this._writableState;\n\n  if (util.isFunction(chunk)) {\n    cb = chunk;\n    chunk = null;\n    encoding = null;\n  } else if (util.isFunction(encoding)) {\n    cb = encoding;\n    encoding = null;\n  }\n\n  if (!util.isNullOrUndefined(chunk))\n    this.write(chunk, encoding);\n\n  // .end() fully uncorks\n  if (state.corked) {\n    state.corked = 1;\n    this.uncork();\n  }\n\n  // ignore unnecessary end() calls.\n  if (!state.ending && !state.finished)\n    endWritable(this, state, cb);\n};\n\n\nfunction needFinish(stream, state) {\n  return (state.ending &&\n          state.length === 0 &&\n          !state.finished &&\n          !state.writing);\n}\n\nfunction prefinish(stream, state) {\n  if (!state.prefinished) {\n    state.prefinished = true;\n    stream.emit('prefinish');\n  }\n}\n\nfunction finishMaybe(stream, state) {\n  var need = needFinish(stream, state);\n  if (need) {\n    if (state.pendingcb === 0) {\n      prefinish(stream, state);\n      state.finished = true;\n      stream.emit('finish');\n    } else\n      prefinish(stream, state);\n  }\n  return need;\n}\n\nfunction endWritable(stream, state, cb) {\n  state.ending = true;\n  finishMaybe(stream, state);\n  if (cb) {\n    if (state.finished)\n      process.nextTick(cb);\n    else\n      stream.once('finish', cb);\n  }\n  state.ended = true;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/lib/_stream_writable.js\n// module id = 435\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/lib/_stream_writable.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/* Copyright (c) 2013 Rod Vagg, MIT License */\n\nfunction AbstractChainedBatch (db) {\n  this._db         = db\n  this._operations = []\n  this._written    = false\n}\n\nAbstractChainedBatch.prototype._checkWritten = function () {\n  if (this._written)\n    throw new Error('write() already called on this batch')\n}\n\nAbstractChainedBatch.prototype.put = function (key, value) {\n  this._checkWritten()\n\n  var err = this._db._checkKey(key, 'key', this._db._isBuffer)\n  if (err)\n    throw err\n\n  if (!this._db._isBuffer(key)) key = String(key)\n  if (!this._db._isBuffer(value)) value = String(value)\n\n  if (typeof this._put == 'function' )\n    this._put(key, value)\n  else\n    this._operations.push({ type: 'put', key: key, value: value })\n\n  return this\n}\n\nAbstractChainedBatch.prototype.del = function (key) {\n  this._checkWritten()\n\n  var err = this._db._checkKey(key, 'key', this._db._isBuffer)\n  if (err) throw err\n\n  if (!this._db._isBuffer(key)) key = String(key)\n\n  if (typeof this._del == 'function' )\n    this._del(key)\n  else\n    this._operations.push({ type: 'del', key: key })\n\n  return this\n}\n\nAbstractChainedBatch.prototype.clear = function () {\n  this._checkWritten()\n\n  this._operations = []\n\n  if (typeof this._clear == 'function' )\n    this._clear()\n\n  return this\n}\n\nAbstractChainedBatch.prototype.write = function (options, callback) {\n  this._checkWritten()\n\n  if (typeof options == 'function')\n    callback = options\n  if (typeof callback != 'function')\n    throw new Error('write() requires a callback argument')\n  if (typeof options != 'object')\n    options = {}\n\n  this._written = true\n\n  if (typeof this._write == 'function' )\n    return this._write(callback)\n\n  if (typeof this._db._batch == 'function')\n    return this._db._batch(this._operations, options, callback)\n\n  process.nextTick(callback)\n}\n\nmodule.exports = AbstractChainedBatch\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/~/abstract-leveldown/abstract-chained-batch.js\n// module id = 436\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/node_modules/abstract-leveldown/abstract-chained-batch.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/* Copyright (c) 2013 Rod Vagg, MIT License */\n\nfunction AbstractIterator (db) {\n  this.db = db\n  this._ended = false\n  this._nexting = false\n}\n\nAbstractIterator.prototype.next = function (callback) {\n  var self = this\n\n  if (typeof callback != 'function')\n    throw new Error('next() requires a callback argument')\n\n  if (self._ended)\n    return callback(new Error('cannot call next() after end()'))\n  if (self._nexting)\n    return callback(new Error('cannot call next() before previous next() has completed'))\n\n  self._nexting = true\n  if (typeof self._next == 'function') {\n    return self._next(function () {\n      self._nexting = false\n      callback.apply(null, arguments)\n    })\n  }\n\n  process.nextTick(function () {\n    self._nexting = false\n    callback()\n  })\n}\n\nAbstractIterator.prototype.end = function (callback) {\n  if (typeof callback != 'function')\n    throw new Error('end() requires a callback argument')\n\n  if (this._ended)\n    return callback(new Error('end() already called on iterator'))\n\n  this._ended = true\n\n  if (typeof this._end == 'function')\n    return this._end(callback)\n\n  process.nextTick(callback)\n}\n\nmodule.exports = AbstractIterator\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/~/abstract-leveldown/abstract-iterator.js\n// module id = 437\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/node_modules/abstract-leveldown/abstract-iterator.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {/* Copyright (c) 2013 Rod Vagg, MIT License */\n\nvar xtend                = __webpack_require__(73)\n  , AbstractIterator     = __webpack_require__(437)\n  , AbstractChainedBatch = __webpack_require__(436)\n\nfunction AbstractLevelDOWN (location) {\n  if (!arguments.length || location === undefined)\n    throw new Error('constructor requires at least a location argument')\n\n  if (typeof location != 'string')\n    throw new Error('constructor requires a location string argument')\n\n  this.location = location\n  this.status = 'new'\n}\n\nAbstractLevelDOWN.prototype.open = function (options, callback) {\n  var self      = this\n    , oldStatus = this.status\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('open() requires a callback argument')\n\n  if (typeof options != 'object')\n    options = {}\n\n  options.createIfMissing = options.createIfMissing != false\n  options.errorIfExists = !!options.errorIfExists\n\n  if (typeof this._open == 'function') {\n    this.status = 'opening'\n    this._open(options, function (err) {\n      if (err) {\n        self.status = oldStatus\n        return callback(err)\n      }\n      self.status = 'open'\n      callback()\n    })\n  } else {\n    this.status = 'open'\n    process.nextTick(callback)\n  }\n}\n\nAbstractLevelDOWN.prototype.close = function (callback) {\n  var self      = this\n    , oldStatus = this.status\n\n  if (typeof callback != 'function')\n    throw new Error('close() requires a callback argument')\n\n  if (typeof this._close == 'function') {\n    this.status = 'closing'\n    this._close(function (err) {\n      if (err) {\n        self.status = oldStatus\n        return callback(err)\n      }\n      self.status = 'closed'\n      callback()\n    })\n  } else {\n    this.status = 'closed'\n    process.nextTick(callback)\n  }\n}\n\nAbstractLevelDOWN.prototype.get = function (key, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('get() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key', this._isBuffer))\n    return callback(err)\n\n  if (!this._isBuffer(key))\n    key = String(key)\n\n  if (typeof options != 'object')\n    options = {}\n\n  options.asBuffer = options.asBuffer != false\n\n  if (typeof this._get == 'function')\n    return this._get(key, options, callback)\n\n  process.nextTick(function () { callback(new Error('NotFound')) })\n}\n\nAbstractLevelDOWN.prototype.put = function (key, value, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('put() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key', this._isBuffer))\n    return callback(err)\n\n  if (!this._isBuffer(key))\n    key = String(key)\n\n  // coerce value to string in node, don't touch it in browser\n  // (indexeddb can store any JS type)\n  if (value != null && !this._isBuffer(value) && !process.browser)\n    value = String(value)\n\n  if (typeof options != 'object')\n    options = {}\n\n  if (typeof this._put == 'function')\n    return this._put(key, value, options, callback)\n\n  process.nextTick(callback)\n}\n\nAbstractLevelDOWN.prototype.del = function (key, options, callback) {\n  var err\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof callback != 'function')\n    throw new Error('del() requires a callback argument')\n\n  if (err = this._checkKey(key, 'key', this._isBuffer))\n    return callback(err)\n\n  if (!this._isBuffer(key))\n    key = String(key)\n\n  if (typeof options != 'object')\n    options = {}\n\n  if (typeof this._del == 'function')\n    return this._del(key, options, callback)\n\n  process.nextTick(callback)\n}\n\nAbstractLevelDOWN.prototype.batch = function (array, options, callback) {\n  if (!arguments.length)\n    return this._chainedBatch()\n\n  if (typeof options == 'function')\n    callback = options\n\n  if (typeof array == 'function')\n    callback = array\n\n  if (typeof callback != 'function')\n    throw new Error('batch(array) requires a callback argument')\n\n  if (!Array.isArray(array))\n    return callback(new Error('batch(array) requires an array argument'))\n\n  if (!options || typeof options != 'object')\n    options = {}\n\n  var i = 0\n    , l = array.length\n    , e\n    , err\n\n  for (; i < l; i++) {\n    e = array[i]\n    if (typeof e != 'object')\n      continue\n\n    if (err = this._checkKey(e.type, 'type', this._isBuffer))\n      return callback(err)\n\n    if (err = this._checkKey(e.key, 'key', this._isBuffer))\n      return callback(err)\n  }\n\n  if (typeof this._batch == 'function')\n    return this._batch(array, options, callback)\n\n  process.nextTick(callback)\n}\n\n//TODO: remove from here, not a necessary primitive\nAbstractLevelDOWN.prototype.approximateSize = function (start, end, callback) {\n  if (   start == null\n      || end == null\n      || typeof start == 'function'\n      || typeof end == 'function') {\n    throw new Error('approximateSize() requires valid `start`, `end` and `callback` arguments')\n  }\n\n  if (typeof callback != 'function')\n    throw new Error('approximateSize() requires a callback argument')\n\n  if (!this._isBuffer(start))\n    start = String(start)\n\n  if (!this._isBuffer(end))\n    end = String(end)\n\n  if (typeof this._approximateSize == 'function')\n    return this._approximateSize(start, end, callback)\n\n  process.nextTick(function () {\n    callback(null, 0)\n  })\n}\n\nAbstractLevelDOWN.prototype._setupIteratorOptions = function (options) {\n  var self = this\n\n  options = xtend(options)\n\n  ;[ 'start', 'end', 'gt', 'gte', 'lt', 'lte' ].forEach(function (o) {\n    if (options[o] && self._isBuffer(options[o]) && options[o].length === 0)\n      delete options[o]\n  })\n\n  options.reverse = !!options.reverse\n  options.keys = options.keys != false\n  options.values = options.values != false\n  options.limit = 'limit' in options ? options.limit : -1\n  options.keyAsBuffer = options.keyAsBuffer != false\n  options.valueAsBuffer = options.valueAsBuffer != false\n\n  return options\n}\n\nAbstractLevelDOWN.prototype.iterator = function (options) {\n  if (typeof options != 'object')\n    options = {}\n\n  options = this._setupIteratorOptions(options)\n\n  if (typeof this._iterator == 'function')\n    return this._iterator(options)\n\n  return new AbstractIterator(this)\n}\n\nAbstractLevelDOWN.prototype._chainedBatch = function () {\n  return new AbstractChainedBatch(this)\n}\n\nAbstractLevelDOWN.prototype._isBuffer = function (obj) {\n  return Buffer.isBuffer(obj)\n}\n\nAbstractLevelDOWN.prototype._checkKey = function (obj, type) {\n\n  if (obj === null || obj === undefined)\n    return new Error(type + ' cannot be `null` or `undefined`')\n\n  if (this._isBuffer(obj)) {\n    if (obj.length === 0)\n      return new Error(type + ' cannot be an empty Buffer')\n  } else if (String(obj) === '')\n    return new Error(type + ' cannot be an empty String')\n}\n\nmodule.exports = AbstractLevelDOWN\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/~/abstract-leveldown/abstract-leveldown.js\n// module id = 438\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/node_modules/abstract-leveldown/abstract-leveldown.js")},function(module,exports,__webpack_require__){eval("exports.AbstractLevelDOWN    = __webpack_require__(438)\nexports.AbstractIterator     = __webpack_require__(437)\nexports.AbstractChainedBatch = __webpack_require__(436)\nexports.isLevelDOWN          = __webpack_require__(972)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/~/abstract-leveldown/index.js\n// module id = 439\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/node_modules/abstract-leveldown/index.js")},function(module,exports){eval("/* Copyright (c) 2012-2016 LevelUP contributors\n * See list at <https://github.com/level/levelup#contributing>\n * MIT License\n * <https://github.com/level/levelup/blob/master/LICENSE.md>\n */\n\nvar defaultOptions = {\n  createIfMissing: true,\n  errorIfExists: false,\n  keyEncoding: 'utf8',\n  valueEncoding: 'utf8',\n  compression: true\n}\n\nfunction getOptions (options) {\n  if (typeof options === 'string') { options = { valueEncoding: options } }\n  if (typeof options !== 'object') { options = {} }\n  return options\n}\n\nfunction dispatchError (db, error, callback) {\n  typeof callback === 'function' ? callback(error) : db.emit('error', error)\n}\n\nfunction isDefined (v) {\n  return typeof v !== 'undefined'\n}\n\nmodule.exports = {\n  defaultOptions: defaultOptions,\n  getOptions: getOptions,\n  dispatchError: dispatchError,\n  isDefined: isDefined\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/levelup/lib/util.js\n// module id = 440\n// module chunks = 0\n\n//# sourceURL=../node_modules/levelup/lib/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = __webpack_require__(975)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/index.js\n// module id = 441\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nodeify = __webpack_require__(275)\n\nconst crypto = __webpack_require__(276)()\nconst lengths = __webpack_require__(985)\n\nconst hashTypes = {\n  SHA1: 'SHA-1',\n  SHA256: 'SHA-256',\n  SHA512: 'SHA-512'\n}\n\nconst sign = (key, data, cb) => {\n  nodeify(crypto.subtle.sign({name: 'HMAC'}, key, data)\n    .then((raw) => Buffer.from(raw)), cb)\n}\n\nexports.create = function (hashType, secret, callback) {\n  const hash = hashTypes[hashType]\n\n  nodeify(crypto.subtle.importKey(\n    'raw',\n    secret,\n    {\n      name: 'HMAC',\n      hash: {name: hash}\n    },\n    false,\n    ['sign']\n  ).then((key) => {\n    return {\n      digest (data, cb) {\n        sign(key, data, cb)\n      },\n      length: lengths[hashType]\n    }\n  }), callback)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/hmac/index-browser.js\n// module id = 442\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/hmac/index-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nodeify = __webpack_require__(275)\n\nconst webcrypto = __webpack_require__(276)()\n\nexports.utils = __webpack_require__(993)\n\nexports.generateKey = function (bits, callback) {\n  nodeify(webcrypto.subtle.generateKey(\n    {\n      name: 'RSASSA-PKCS1-v1_5',\n      modulusLength: bits,\n      publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n      hash: {name: 'SHA-256'}\n    },\n    true,\n    ['sign', 'verify']\n  )\n    .then(exportKey)\n    .then((keys) => ({\n      privateKey: keys[0],\n      publicKey: keys[1]\n    })), callback)\n}\n\n// Takes a jwk key\nexports.unmarshalPrivateKey = function (key, callback) {\n  const privateKey = webcrypto.subtle.importKey(\n    'jwk',\n    key,\n    {\n      name: 'RSASSA-PKCS1-v1_5',\n      hash: {name: 'SHA-256'}\n    },\n    true,\n    ['sign']\n  )\n\n  nodeify(Promise.all([\n    privateKey,\n    derivePublicFromPrivate(key)\n  ]).then((keys) => exportKey({\n    privateKey: keys[0],\n    publicKey: keys[1]\n  })).then((keys) => ({\n    privateKey: keys[0],\n    publicKey: keys[1]\n  })), callback)\n}\n\nexports.getRandomValues = function (arr) {\n  return Buffer.from(webcrypto.getRandomValues(arr))\n}\n\nexports.hashAndSign = function (key, msg, callback) {\n  nodeify(webcrypto.subtle.importKey(\n    'jwk',\n    key,\n    {\n      name: 'RSASSA-PKCS1-v1_5',\n      hash: {name: 'SHA-256'}\n    },\n    false,\n    ['sign']\n  ).then((privateKey) => {\n    return webcrypto.subtle.sign(\n      {name: 'RSASSA-PKCS1-v1_5'},\n      privateKey,\n      Uint8Array.from(msg)\n    )\n  }).then((sig) => Buffer.from(sig)), callback)\n}\n\nexports.hashAndVerify = function (key, sig, msg, callback) {\n  nodeify(webcrypto.subtle.importKey(\n    'jwk',\n    key,\n    {\n      name: 'RSASSA-PKCS1-v1_5',\n      hash: {name: 'SHA-256'}\n    },\n    false,\n    ['verify']\n  ).then((publicKey) => {\n    return webcrypto.subtle.verify(\n      {name: 'RSASSA-PKCS1-v1_5'},\n      publicKey,\n      sig,\n      msg\n    )\n  }), callback)\n}\n\nfunction exportKey (pair) {\n  return Promise.all([\n    webcrypto.subtle.exportKey('jwk', pair.privateKey),\n    webcrypto.subtle.exportKey('jwk', pair.publicKey)\n  ])\n}\n\nfunction derivePublicFromPrivate (jwKey) {\n  return webcrypto.subtle.importKey(\n    'jwk',\n    {\n      kty: jwKey.kty,\n      n: jwKey.n,\n      e: jwKey.e\n    },\n    {\n      name: 'RSASSA-PKCS1-v1_5',\n      hash: {name: 'SHA-256'}\n    },\n    true,\n    ['verify']\n  )\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/rsa-browser.js\n// module id = 443\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/rsa-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst rsa = __webpack_require__(443)\n\nfunction randomBytes (number) {\n  if (!number || typeof number !== 'number') {\n    throw new Error('first argument must be a Number bigger than 0')\n  }\n\n  return rsa.getRandomValues(new Uint8Array(number))\n}\n\nmodule.exports = randomBytes\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/random-bytes.js\n// module id = 444\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/random-bytes.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst BN = __webpack_require__(110).bignum\n\n// Convert a BN.js instance to a base64 encoded string without padding\n// Adapted from https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#appendix-C\nexports.toBase64 = function toBase64 (bn, len) {\n  // if len is defined then the bytes are leading-0 padded to the length\n  let s = bn.toArrayLike(Buffer, 'be', len).toString('base64')\n\n  return s\n    .replace(/(=*)$/, '') // Remove any trailing '='s\n    .replace(/\\+/g, '-') // 62nd char of encoding\n    .replace(/\\//g, '_') // 63rd char of encoding\n}\n\n// Convert a base64 encoded string to a BN.js instance\nexports.toBn = function toBn (str) {\n  return new BN(Buffer.from(str, 'base64'))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/util.js\n// module id = 445\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst protons = __webpack_require__(64)\n\nconst rpcProto = protons(__webpack_require__(997))\nconst topicDescriptorProto = protons(__webpack_require__(998))\n\nexports = module.exports\nexports.rpc = rpcProto\nexports.td = topicDescriptorProto\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/message/index.js\n// module id = 446\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/message/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst protons = __webpack_require__(64)\nconst schema = `\nmessage Identify {\n  // protocolVersion determines compatibility between peers\n  optional string protocolVersion = 5; // e.g. ipfs/1.0.0\n\n  // agentVersion is like a UserAgent string in browsers, or client version in bittorrent\n  // includes the client name and client.\n  optional string agentVersion = 6; // e.g. go-ipfs/0.1.0\n\n  // publicKey is this node's public key (which also gives its node.ID)\n  // - may not need to be sent, as secure channel implies it has been sent.\n  // - then again, if we change / disable secure channel, may still want it.\n  optional bytes publicKey = 1;\n\n  // listenAddrs are the multiaddrs the sender node listens for open connections on\n  repeated bytes listenAddrs = 2;\n\n  // oservedAddr is the multiaddr of the remote endpoint that the sender node perceives\n  // this is useful information to convey to the other side, as it helps the remote endpoint\n  // determine whether its connection to the local peer goes through NAT.\n  optional bytes observedAddr = 4;\n\n  repeated string protocols = 3;\n}\n`\n\nmodule.exports = protons(schema).Identify\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-identify/src/message.js\n// module id = 447\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-identify/src/message.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = __webpack_require__(1005)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-keychain/src/index.js\n// module id = 448\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-keychain/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = '/mplex/6.7.0'\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-multiplex/src/multiplex-codec.js\n// module id = 449\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-multiplex/src/multiplex-codec.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst multiaddr = __webpack_require__(21)\n\n/*\n * Helper method to check the data type of peer and convert it to PeerInfo\n */\nfunction getPeerInfo (peer, peerBook) {\n  let p\n\n  // PeerInfo\n  if (PeerInfo.isPeerInfo(peer)) {\n    p = peer\n  // Multiaddr instance (not string)\n  } else if (multiaddr.isMultiaddr(peer)) {\n    const peerIdB58Str = peer.getPeerId()\n    try {\n      p = peerBook.get(peerIdB58Str)\n    } catch (err) {\n      p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))\n    }\n    p.multiaddrs.add(peer)\n\n  // PeerId\n  } else if (PeerId.isPeerId(peer)) {\n    const peerIdB58Str = peer.toB58String()\n    try {\n      p = peerBook.get(peerIdB58Str)\n    } catch (err) {\n      throw new Error('Couldnt get PeerInfo')\n    }\n  } else {\n    throw new Error('peer type not recognized')\n  }\n\n  return p\n}\n\nmodule.exports = getPeerInfo\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/get-peer-info.js\n// module id = 450\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/get-peer-info.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst setImmediate = __webpack_require__(8)\n\nmodule.exports = {\n  tag: '/plaintext/1.0.0',\n  encrypt (myId, conn, remoteId, callback) {\n    if (typeof remoteId === 'function') {\n      callback = remoteId\n      remoteId = undefined\n    }\n\n    setImmediate(() => callback())\n    return conn\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/plaintext.js\n// module id = 451\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/plaintext.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multiaddr = __webpack_require__(21)\nconst Id = __webpack_require__(26)\nconst crypto = __webpack_require__(79)\nconst mafmt = __webpack_require__(99)\n\nfunction cleanUrlSIO (ma) {\n  const protos = ma.protos()\n  const ipProto = protos[0].name\n  const tcpProto = protos[1].name\n  const wsProto = protos[2].name\n  const stringTuples = ma.stringTuples()\n  const tcpPort = stringTuples[1][1]\n\n  if (tcpProto !== 'tcp' || (wsProto !== 'ws' && wsProto !== 'wss')) {\n    throw new Error('invalid multiaddr: ' + ma.toString())\n  }\n\n  let host = stringTuples[0][1]\n  if (ipProto === 'ip6') {\n    host = '[' + host + ']'\n  }\n\n  let proto = wsProto === 'wss' ? 'https' : 'http'\n  let port =\n    (wsProto === 'ws' && tcpPort === 80) || (wsProto === 'wss' && tcpPort === 443)\n      ? '' : tcpPort\n\n  return proto + '://' + host + (port ? ':' + port : '')\n}\n\nconst types = {\n  string: v => typeof v === 'string',\n  object: v => typeof v === 'object',\n  multiaddr: v => {\n    if (!types.string(v)) return\n    try {\n      multiaddr(v)\n      return true\n    } catch (e) {\n      return false\n    }\n  },\n  function: v => typeof v === 'function'\n}\n\nfunction validate (def, data) {\n  if (!Array.isArray(data)) throw new Error('Data is not an array')\n  def.forEach((type, index) => {\n    if (!types[type]) {\n      console.error('Type %s does not exist', type) // eslint-disable-line no-console\n      throw new Error('Type ' + type + ' does not exist')\n    }\n    if (!types[type](data[index])) throw new Error('Data at index ' + index + ' is invalid for type ' + type)\n  })\n}\n\nfunction Protocol (log) {\n  if (!log) log = () => {}\n  const self = this\n  self.requests = {}\n  self.addRequest = (name, def, handle) => {\n    self.requests[name] = {\n      def,\n      handle\n    }\n  }\n  self.handleSocket = (socket) => {\n    socket.r = {}\n    Object.keys(self.requests).forEach((request) => {\n      const r = self.requests[request]\n      socket.on(request, function () {\n        const data = [...arguments]\n        try {\n          validate(r.def, data)\n          data.unshift(socket)\n          r.handle.apply(null, data)\n        } catch (e) {\n          log(e)\n          log('peer %s has sent invalid data for request %s', socket.id || '<server>', request, data)\n        }\n      })\n    })\n  }\n}\n\nfunction getIdAndValidate (pub, id, cb) {\n  Id.createFromPubKey(Buffer.from(pub, 'hex'), (err, _id) => {\n    if (err) {\n      return cb(new Error('Crypto error'))\n    }\n    if (_id.toB58String() !== id) {\n      return cb(new Error('Id is not matching'))\n    }\n\n    return cb(null, crypto.keys.unmarshalPublicKey(Buffer.from(pub, 'hex')))\n  })\n}\n\nexports = module.exports\nexports.cleanUrlSIO = cleanUrlSIO\nexports.validate = validate\nexports.Protocol = Protocol\nexports.getIdAndValidate = getIdAndValidate\nexports.validateMa = (ma) => mafmt.WebSocketStar.matches(multiaddr(ma))\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websocket-star/src/utils.js\n// module id = 452\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websocket-star/src/utils.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/**\n * Adds the key-value `pair` to `map`.\n *\n * @private\n * @param {Object} map The map to modify.\n * @param {Array} pair The key-value pair to add.\n * @returns {Object} Returns `map`.\n */\nfunction addMapEntry(map, pair) {\n  // Don't return `map.set` because it's not chainable in IE 11.\n  map.set(pair[0], pair[1]);\n  return map;\n}\n\n/**\n * Adds `value` to `set`.\n *\n * @private\n * @param {Object} set The set to modify.\n * @param {*} value The value to add.\n * @returns {Object} Returns `set`.\n */\nfunction addSetEntry(set, value) {\n  // Don't return `set.add` because it's not chainable in IE 11.\n  set.add(value);\n  return set;\n}\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n *  the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  if (initAccum && length) {\n    accumulator = array[++index];\n  }\n  while (++index < length) {\n    accumulator = iteratee(accumulator, array[index], index, array);\n  }\n  return accumulator;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n    Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    getPrototype = overArg(Object.getPrototypeOf, Object),\n    objectCreate = Object.create,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols,\n    nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n    nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    object[key] = value;\n  }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n  return object && copyObject(source, keys(source), object);\n}\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @param {boolean} [isFull] Specify a clone including symbols.\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, isDeep, isFull, customizer, key, object, stack) {\n  var result;\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      if (isHostObject(value)) {\n        return object ? value : {};\n      }\n      result = initCloneObject(isFunc ? {} : value);\n      if (!isDeep) {\n        return copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, baseClone, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (!isArr) {\n    var props = isFull ? getAllKeys(value) : keys(value);\n  }\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));\n  });\n  return result;\n}\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} prototype The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nfunction baseCreate(proto) {\n  return isObject(proto) ? objectCreate(proto) : {};\n}\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n  var result = keysFunc(object);\n  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Creates a clone of  `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n  if (isDeep) {\n    return buffer.slice();\n  }\n  var result = new buffer.constructor(buffer.length);\n  buffer.copy(result);\n  return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n  new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n  return result;\n}\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\n/**\n * Creates a clone of `map`.\n *\n * @private\n * @param {Object} map The map to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned map.\n */\nfunction cloneMap(map, isDeep, cloneFunc) {\n  var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);\n  return arrayReduce(array, addMapEntry, new map.constructor);\n}\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\n/**\n * Creates a clone of `set`.\n *\n * @private\n * @param {Object} set The set to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned set.\n */\nfunction cloneSet(set, isDeep, cloneFunc) {\n  var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);\n  return arrayReduce(array, addSetEntry, new set.constructor);\n}\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    assignValue(object, key, newValue === undefined ? source[key] : newValue);\n  }\n  return object;\n}\n\n/**\n * Copies own symbol properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n  return copyObject(source, getSymbols(source), object);\n}\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n  return baseGetAllKeys(object, keys, getSymbols);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Creates an array of the own enumerable symbol properties of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n  return (typeof object.constructor == 'function' && !isPrototype(object))\n    ? baseCreate(getPrototype(object))\n    : {};\n}\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {Function} cloneFunc The function to clone values.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, cloneFunc, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return cloneMap(object, isDeep, cloneFunc);\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return cloneSet(object, isDeep, cloneFunc);\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n  return baseClone(value, true, true);\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n  return [];\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\nmodule.exports = cloneDeep;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.clonedeep/index.js\n// module id = 453\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.clonedeep/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n  return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n  var lastArgs,\n      lastThis,\n      maxWait,\n      result,\n      timerId,\n      lastCallTime,\n      lastInvokeTime = 0,\n      leading = false,\n      maxing = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = toNumber(wait) || 0;\n  if (isObject(options)) {\n    leading = !!options.leading;\n    maxing = 'maxWait' in options;\n    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n\n  function invokeFunc(time) {\n    var args = lastArgs,\n        thisArg = lastThis;\n\n    lastArgs = lastThis = undefined;\n    lastInvokeTime = time;\n    result = func.apply(thisArg, args);\n    return result;\n  }\n\n  function leadingEdge(time) {\n    // Reset any `maxWait` timer.\n    lastInvokeTime = time;\n    // Start the timer for the trailing edge.\n    timerId = setTimeout(timerExpired, wait);\n    // Invoke the leading edge.\n    return leading ? invokeFunc(time) : result;\n  }\n\n  function remainingWait(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime,\n        result = wait - timeSinceLastCall;\n\n    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n  }\n\n  function shouldInvoke(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime;\n\n    // Either this is the first call, activity has stopped and we're at the\n    // trailing edge, the system time has gone backwards and we're treating\n    // it as the trailing edge, or we've hit the `maxWait` limit.\n    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n  }\n\n  function timerExpired() {\n    var time = now();\n    if (shouldInvoke(time)) {\n      return trailingEdge(time);\n    }\n    // Restart the timer.\n    timerId = setTimeout(timerExpired, remainingWait(time));\n  }\n\n  function trailingEdge(time) {\n    timerId = undefined;\n\n    // Only invoke if we have `lastArgs` which means `func` has been\n    // debounced at least once.\n    if (trailing && lastArgs) {\n      return invokeFunc(time);\n    }\n    lastArgs = lastThis = undefined;\n    return result;\n  }\n\n  function cancel() {\n    if (timerId !== undefined) {\n      clearTimeout(timerId);\n    }\n    lastInvokeTime = 0;\n    lastArgs = lastCallTime = lastThis = timerId = undefined;\n  }\n\n  function flush() {\n    return timerId === undefined ? result : trailingEdge(now());\n  }\n\n  function debounced() {\n    var time = now(),\n        isInvoking = shouldInvoke(time);\n\n    lastArgs = arguments;\n    lastThis = this;\n    lastCallTime = time;\n\n    if (isInvoking) {\n      if (timerId === undefined) {\n        return leadingEdge(lastCallTime);\n      }\n      if (maxing) {\n        // Handle invocations in a tight loop.\n        timerId = setTimeout(timerExpired, wait);\n        return invokeFunc(lastCallTime);\n      }\n    }\n    if (timerId === undefined) {\n      timerId = setTimeout(timerExpired, wait);\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  debounced.flush = flush;\n  return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.debounce/index.js\n// module id = 454\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.debounce/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.get/index.js\n// module id = 455\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.get/index.js")},function(module,exports){eval("/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991,\n    MAX_INTEGER = 1.7976931348623157e+308,\n    NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  if (value !== value) {\n    return baseFindIndex(array, baseIsNaN, fromIndex);\n  }\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n  return arrayMap(props, function(key) {\n    return object[key];\n  });\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n    nativeMax = Math.max;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n  collection = isArrayLike(collection) ? collection : values(collection);\n  fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n  var length = collection.length;\n  if (fromIndex < 0) {\n    fromIndex = nativeMax(length + fromIndex, 0);\n  }\n  return isString(collection)\n    ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n    : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n  return typeof value == 'string' ||\n    (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n  var result = toFinite(value),\n      remainder = result % 1;\n\n  return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\nfunction values(object) {\n  return object ? baseValues(object, keys(object)) : [];\n}\n\nmodule.exports = includes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.includes/index.js\n// module id = 456\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.includes/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright JS Foundation and other contributors <https://js.foundation/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    nullTag = '[object Null]',\n    proxyTag = '[object Proxy]',\n    undefinedTag = '[object Undefined]';\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isFunction;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.isfunction/index.js\n// module id = 457\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.isfunction/index.js")},function(module,exports,__webpack_require__){eval("var root = __webpack_require__(283);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_Symbol.js\n// module id = 458\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_Symbol.js")},function(module,exports,__webpack_require__){eval("var baseTimes = __webpack_require__(1064),\n    isArguments = __webpack_require__(1086),\n    isArray = __webpack_require__(285),\n    isBuffer = __webpack_require__(1087),\n    isIndex = __webpack_require__(463),\n    isTypedArray = __webpack_require__(1088);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  var isArr = isArray(value),\n      isArg = !isArr && isArguments(value),\n      isBuff = !isArr && !isArg && isBuffer(value),\n      isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n      skipIndexes = isArr || isArg || isBuff || isType,\n      result = skipIndexes ? baseTimes(value.length, String) : [],\n      length = result.length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (\n           // Safari 9 has enumerable `arguments.length` in strict mode.\n           key == 'length' ||\n           // Node.js 0.10 has enumerable non-index properties on buffers.\n           (isBuff && (key == 'offset' || key == 'parent')) ||\n           // PhantomJS 2 has enumerable non-index properties on typed arrays.\n           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n           // Skip index properties.\n           isIndex(key, length)\n        ))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayLikeKeys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayLikeKeys.js\n// module id = 459\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_arrayLikeKeys.js")},function(module,exports,__webpack_require__){eval("var defineProperty = __webpack_require__(461);\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n  if (key == '__proto__' && defineProperty) {\n    defineProperty(object, key, {\n      'configurable': true,\n      'enumerable': true,\n      'value': value,\n      'writable': true\n    });\n  } else {\n    object[key] = value;\n  }\n}\n\nmodule.exports = baseAssignValue;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseAssignValue.js\n// module id = 460\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseAssignValue.js")},function(module,exports,__webpack_require__){eval("var getNative = __webpack_require__(1069);\n\nvar defineProperty = (function() {\n  try {\n    var func = getNative(Object, 'defineProperty');\n    func({}, '', {});\n    return func;\n  } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_defineProperty.js\n// module id = 461\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_defineProperty.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_freeGlobal.js\n// module id = 462\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_freeGlobal.js")},function(module,exports){eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  var type = typeof value;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n\n  return !!length &&\n    (type == 'number' ||\n      (type != 'symbol' && reIsUint.test(value))) &&\n        (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isIndex.js\n// module id = 463\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_isIndex.js")},function(module,exports){eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\nmodule.exports = isPrototype;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isPrototype.js\n// module id = 464\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_isPrototype.js")},function(module,exports){eval("/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/eq.js\n// module id = 465\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/eq.js")},function(module,exports,__webpack_require__){eval("var baseGetTag = __webpack_require__(282),\n    isObject = __webpack_require__(147);\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isFunction.js\n// module id = 466\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isFunction.js")},function(module,exports){eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isLength.js\n// module id = 467\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isLength.js")},function(module,exports){eval("\nvar looper = module.exports = function (fun) {\n  (function next () {\n    var loop = true, returned = false, sync = false\n    do {\n      sync = true; loop = false\n      fun.call(this, function () {\n        if(sync) loop = true\n        else     next()\n      })\n      sync = false\n    } while(loop)\n  })()\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/looper/index.js\n// module id = 468\n// module chunks = 0\n\n//# sourceURL=../node_modules/looper/index.js")},function(module,exports,__webpack_require__){eval("var bn = __webpack_require__(17);\nvar brorand = __webpack_require__(350);\n\nfunction MillerRabin(rand) {\n  this.rand = rand || new brorand.Rand();\n}\nmodule.exports = MillerRabin;\n\nMillerRabin.create = function create(rand) {\n  return new MillerRabin(rand);\n};\n\nMillerRabin.prototype._randbelow = function _randbelow(n) {\n  var len = n.bitLength();\n  var min_bytes = Math.ceil(len / 8);\n\n  // Generage random bytes until a number less than n is found.\n  // This ensures that 0..n-1 have an equal probability of being selected.\n  do\n    var a = new bn(this.rand.generate(min_bytes));\n  while (a.cmp(n) >= 0);\n\n  return a;\n};\n\nMillerRabin.prototype._randrange = function _randrange(start, stop) {\n  // Generate a random number greater than or equal to start and less than stop.\n  var size = stop.sub(start);\n  return start.add(this._randbelow(size));\n};\n\nMillerRabin.prototype.test = function test(n, k, cb) {\n  var len = n.bitLength();\n  var red = bn.mont(n);\n  var rone = new bn(1).toRed(red);\n\n  if (!k)\n    k = Math.max(1, (len / 48) | 0);\n\n  // Find d and s, (n - 1) = (2 ^ s) * d;\n  var n1 = n.subn(1);\n  for (var s = 0; !n1.testn(s); s++) {}\n  var d = n.shrn(s);\n\n  var rn1 = n1.toRed(red);\n\n  var prime = true;\n  for (; k > 0; k--) {\n    var a = this._randrange(new bn(2), n1);\n    if (cb)\n      cb(a);\n\n    var x = a.toRed(red).redPow(d);\n    if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n      continue;\n\n    for (var i = 1; i < s; i++) {\n      x = x.redSqr();\n\n      if (x.cmp(rone) === 0)\n        return false;\n      if (x.cmp(rn1) === 0)\n        break;\n    }\n\n    if (i === s)\n      return false;\n  }\n\n  return prime;\n};\n\nMillerRabin.prototype.getDivisor = function getDivisor(n, k) {\n  var len = n.bitLength();\n  var red = bn.mont(n);\n  var rone = new bn(1).toRed(red);\n\n  if (!k)\n    k = Math.max(1, (len / 48) | 0);\n\n  // Find d and s, (n - 1) = (2 ^ s) * d;\n  var n1 = n.subn(1);\n  for (var s = 0; !n1.testn(s); s++) {}\n  var d = n.shrn(s);\n\n  var rn1 = n1.toRed(red);\n\n  for (; k > 0; k--) {\n    var a = this._randrange(new bn(2), n1);\n\n    var g = n.gcd(a);\n    if (g.cmpn(1) !== 0)\n      return g;\n\n    var x = a.toRed(red).redPow(d);\n    if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\n      continue;\n\n    for (var i = 1; i < s; i++) {\n      x = x.redSqr();\n\n      if (x.cmp(rone) === 0)\n        return x.fromRed().subn(1).gcd(n);\n      if (x.cmp(rn1) === 0)\n        break;\n    }\n\n    if (i === s) {\n      x = x.redSqr();\n      return x.fromRed().subn(1).gcd(n);\n    }\n  }\n\n  return false;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/miller-rabin/lib/mr.js\n// module id = 469\n// module chunks = 0\n\n//# sourceURL=../node_modules/miller-rabin/lib/mr.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = exports;\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg !== 'string') {\n    for (var i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n    return res;\n  }\n  if (enc === 'hex') {\n    msg = msg.replace(/[^a-z0-9]+/ig, '');\n    if (msg.length % 2 !== 0)\n      msg = '0' + msg;\n    for (var i = 0; i < msg.length; i += 2)\n      res.push(parseInt(msg[i] + msg[i + 1], 16));\n  } else {\n    for (var i = 0; i < msg.length; i++) {\n      var c = msg.charCodeAt(i);\n      var hi = c >> 8;\n      var lo = c & 0xff;\n      if (hi)\n        res.push(hi, lo);\n      else\n        res.push(lo);\n    }\n  }\n  return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n  if (enc === 'hex')\n    return toHex(arr);\n  else\n    return arr;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/minimalistic-crypto-utils/lib/utils.js\n// module id = 470\n// module chunks = 0\n\n//# sourceURL=../node_modules/minimalistic-crypto-utils/lib/utils.js")},function(module,exports){eval("/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n *  - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n  options = options || {};\n  var type = typeof val;\n  if (type === 'string' && val.length > 0) {\n    return parse(val);\n  } else if (type === 'number' && isNaN(val) === false) {\n    return options.long ? fmtLong(val) : fmtShort(val);\n  }\n  throw new Error(\n    'val is not a non-empty string or a valid number. val=' +\n      JSON.stringify(val)\n  );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n  str = String(str);\n  if (str.length > 100) {\n    return;\n  }\n  var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\n    str\n  );\n  if (!match) {\n    return;\n  }\n  var n = parseFloat(match[1]);\n  var type = (match[2] || 'ms').toLowerCase();\n  switch (type) {\n    case 'years':\n    case 'year':\n    case 'yrs':\n    case 'yr':\n    case 'y':\n      return n * y;\n    case 'days':\n    case 'day':\n    case 'd':\n      return n * d;\n    case 'hours':\n    case 'hour':\n    case 'hrs':\n    case 'hr':\n    case 'h':\n      return n * h;\n    case 'minutes':\n    case 'minute':\n    case 'mins':\n    case 'min':\n    case 'm':\n      return n * m;\n    case 'seconds':\n    case 'second':\n    case 'secs':\n    case 'sec':\n    case 's':\n      return n * s;\n    case 'milliseconds':\n    case 'millisecond':\n    case 'msecs':\n    case 'msec':\n    case 'ms':\n      return n;\n    default:\n      return undefined;\n  }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n  if (ms >= d) {\n    return Math.round(ms / d) + 'd';\n  }\n  if (ms >= h) {\n    return Math.round(ms / h) + 'h';\n  }\n  if (ms >= m) {\n    return Math.round(ms / m) + 'm';\n  }\n  if (ms >= s) {\n    return Math.round(ms / s) + 's';\n  }\n  return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n  return plural(ms, d, 'day') ||\n    plural(ms, h, 'hour') ||\n    plural(ms, m, 'minute') ||\n    plural(ms, s, 'second') ||\n    ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, n, name) {\n  if (ms < n) {\n    return;\n  }\n  if (ms < n * 1.5) {\n    return Math.floor(ms / n) + ' ' + name;\n  }\n  return Math.ceil(ms / n) + ' ' + name + 's';\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ms/index.js\n// module id = 471\n// module chunks = 0\n\n//# sourceURL=../node_modules/ms/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst baseTable = __webpack_require__(195)\n\n// this creates a map for code as hexString -> codecName\n\nconst nameTable = {}\nmodule.exports = nameTable\n\nfor (let encodingName in baseTable) {\n  let code = baseTable[encodingName]\n  nameTable[code.toString('hex')] = encodingName\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multicodec/src/name-table.js\n// module id = 472\n// module chunks = 0\n\n//# sourceURL=../node_modules/multicodec/src/name-table.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nconst varint = __webpack_require__(29)\n\nmodule.exports = {\n  numberToBuffer,\n  bufferToNumber,\n  varintBufferEncode,\n  varintBufferDecode\n}\n\nfunction bufferToNumber (buf) {\n  return parseInt(buf.toString('hex'), 16)\n}\n\nfunction numberToBuffer (num) {\n  let hexString = num.toString(16)\n  if (hexString.length % 2 === 1) {\n    hexString = '0' + hexString\n  }\n  return Buffer.from(hexString, 'hex')\n}\n\nfunction varintBufferEncode (input) {\n  return Buffer.from(varint.encode(bufferToNumber(input)))\n}\n\nfunction varintBufferDecode (input) {\n  return numberToBuffer(varint.decode(input))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multicodec/src/util.js\n// module id = 473\n// module chunks = 0\n\n//# sourceURL=../node_modules/multicodec/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst baseTable = __webpack_require__(195)\nconst varintBufferEncode = __webpack_require__(473).varintBufferEncode\n\n// this creates a map for codecName -> codeVarintBuffer\n\nconst varintTable = {}\nmodule.exports = varintTable\n\nfor (let encodingName in baseTable) {\n  let code = baseTable[encodingName]\n  varintTable[encodingName] = varintBufferEncode(code)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multicodec/src/varint-table.js\n// module id = 474\n// module chunks = 0\n\n//# sourceURL=../node_modules/multicodec/src/varint-table.js")},function(module,exports,__webpack_require__){"use strict";eval("/* eslint quote-props: off */\n/* eslint key-spacing: off */\n\n\nexports.names = Object.freeze({\n  'sha1':       0x11,\n  'sha2-256':   0x12,\n  'sha2-512':   0x13,\n  'dbl-sha2-256': 0x56,\n  'sha3-224':   0x17,\n  'sha3-256':   0x16,\n  'sha3-384':   0x15,\n  'sha3-512':   0x14,\n  'shake-128':  0x18,\n  'shake-256':  0x19,\n  'keccak-224': 0x1A,\n  'keccak-256': 0x1B,\n  'keccak-384': 0x1C,\n  'keccak-512': 0x1D,\n  'murmur3-128': 0x22,\n  'murmur3-32':  0x23,\n  'blake2b-8':   0xb201,\n  'blake2b-16':  0xb202,\n  'blake2b-24':  0xb203,\n  'blake2b-32':  0xb204,\n  'blake2b-40':  0xb205,\n  'blake2b-48':  0xb206,\n  'blake2b-56':  0xb207,\n  'blake2b-64':  0xb208,\n  'blake2b-72':  0xb209,\n  'blake2b-80':  0xb20a,\n  'blake2b-88':  0xb20b,\n  'blake2b-96':  0xb20c,\n  'blake2b-104': 0xb20d,\n  'blake2b-112': 0xb20e,\n  'blake2b-120': 0xb20f,\n  'blake2b-128': 0xb210,\n  'blake2b-136': 0xb211,\n  'blake2b-144': 0xb212,\n  'blake2b-152': 0xb213,\n  'blake2b-160': 0xb214,\n  'blake2b-168': 0xb215,\n  'blake2b-176': 0xb216,\n  'blake2b-184': 0xb217,\n  'blake2b-192': 0xb218,\n  'blake2b-200': 0xb219,\n  'blake2b-208': 0xb21a,\n  'blake2b-216': 0xb21b,\n  'blake2b-224': 0xb21c,\n  'blake2b-232': 0xb21d,\n  'blake2b-240': 0xb21e,\n  'blake2b-248': 0xb21f,\n  'blake2b-256': 0xb220,\n  'blake2b-264': 0xb221,\n  'blake2b-272': 0xb222,\n  'blake2b-280': 0xb223,\n  'blake2b-288': 0xb224,\n  'blake2b-296': 0xb225,\n  'blake2b-304': 0xb226,\n  'blake2b-312': 0xb227,\n  'blake2b-320': 0xb228,\n  'blake2b-328': 0xb229,\n  'blake2b-336': 0xb22a,\n  'blake2b-344': 0xb22b,\n  'blake2b-352': 0xb22c,\n  'blake2b-360': 0xb22d,\n  'blake2b-368': 0xb22e,\n  'blake2b-376': 0xb22f,\n  'blake2b-384': 0xb230,\n  'blake2b-392': 0xb231,\n  'blake2b-400': 0xb232,\n  'blake2b-408': 0xb233,\n  'blake2b-416': 0xb234,\n  'blake2b-424': 0xb235,\n  'blake2b-432': 0xb236,\n  'blake2b-440': 0xb237,\n  'blake2b-448': 0xb238,\n  'blake2b-456': 0xb239,\n  'blake2b-464': 0xb23a,\n  'blake2b-472': 0xb23b,\n  'blake2b-480': 0xb23c,\n  'blake2b-488': 0xb23d,\n  'blake2b-496': 0xb23e,\n  'blake2b-504': 0xb23f,\n  'blake2b-512': 0xb240,\n  'blake2s-8':   0xb241,\n  'blake2s-16':  0xb242,\n  'blake2s-24':  0xb243,\n  'blake2s-32':  0xb244,\n  'blake2s-40':  0xb245,\n  'blake2s-48':  0xb246,\n  'blake2s-56':  0xb247,\n  'blake2s-64':  0xb248,\n  'blake2s-72':  0xb249,\n  'blake2s-80':  0xb24a,\n  'blake2s-88':  0xb24b,\n  'blake2s-96':  0xb24c,\n  'blake2s-104': 0xb24d,\n  'blake2s-112': 0xb24e,\n  'blake2s-120': 0xb24f,\n  'blake2s-128': 0xb250,\n  'blake2s-136': 0xb251,\n  'blake2s-144': 0xb252,\n  'blake2s-152': 0xb253,\n  'blake2s-160': 0xb254,\n  'blake2s-168': 0xb255,\n  'blake2s-176': 0xb256,\n  'blake2s-184': 0xb257,\n  'blake2s-192': 0xb258,\n  'blake2s-200': 0xb259,\n  'blake2s-208': 0xb25a,\n  'blake2s-216': 0xb25b,\n  'blake2s-224': 0xb25c,\n  'blake2s-232': 0xb25d,\n  'blake2s-240': 0xb25e,\n  'blake2s-248': 0xb25f,\n  'blake2s-256': 0xb260,\n  'Skein256-8': 0xb301,\n  'Skein256-16': 0xb302,\n  'Skein256-24': 0xb303,\n  'Skein256-32': 0xb304,\n  'Skein256-40': 0xb305,\n  'Skein256-48': 0xb306,\n  'Skein256-56': 0xb307,\n  'Skein256-64': 0xb308,\n  'Skein256-72': 0xb309,\n  'Skein256-80': 0xb30a,\n  'Skein256-88': 0xb30b,\n  'Skein256-96': 0xb30c,\n  'Skein256-104': 0xb30d,\n  'Skein256-112': 0xb30e,\n  'Skein256-120': 0xb30f,\n  'Skein256-128': 0xb310,\n  'Skein256-136': 0xb311,\n  'Skein256-144': 0xb312,\n  'Skein256-152': 0xb313,\n  'Skein256-160': 0xb314,\n  'Skein256-168': 0xb315,\n  'Skein256-176': 0xb316,\n  'Skein256-184': 0xb317,\n  'Skein256-192': 0xb318,\n  'Skein256-200': 0xb319,\n  'Skein256-208': 0xb31a,\n  'Skein256-216': 0xb31b,\n  'Skein256-224': 0xb31c,\n  'Skein256-232': 0xb31d,\n  'Skein256-240': 0xb31e,\n  'Skein256-248': 0xb31f,\n  'Skein256-256': 0xb320,\n  'Skein512-8': 0xb321,\n  'Skein512-16': 0xb322,\n  'Skein512-24': 0xb323,\n  'Skein512-32': 0xb324,\n  'Skein512-40': 0xb325,\n  'Skein512-48': 0xb326,\n  'Skein512-56': 0xb327,\n  'Skein512-64': 0xb328,\n  'Skein512-72': 0xb329,\n  'Skein512-80': 0xb32a,\n  'Skein512-88': 0xb32b,\n  'Skein512-96': 0xb32c,\n  'Skein512-104': 0xb32d,\n  'Skein512-112': 0xb32e,\n  'Skein512-120': 0xb32f,\n  'Skein512-128': 0xb330,\n  'Skein512-136': 0xb331,\n  'Skein512-144': 0xb332,\n  'Skein512-152': 0xb333,\n  'Skein512-160': 0xb334,\n  'Skein512-168': 0xb335,\n  'Skein512-176': 0xb336,\n  'Skein512-184': 0xb337,\n  'Skein512-192': 0xb338,\n  'Skein512-200': 0xb339,\n  'Skein512-208': 0xb33a,\n  'Skein512-216': 0xb33b,\n  'Skein512-224': 0xb33c,\n  'Skein512-232': 0xb33d,\n  'Skein512-240': 0xb33e,\n  'Skein512-248': 0xb33f,\n  'Skein512-256': 0xb340,\n  'Skein512-264': 0xb341,\n  'Skein512-272': 0xb342,\n  'Skein512-280': 0xb343,\n  'Skein512-288': 0xb344,\n  'Skein512-296': 0xb345,\n  'Skein512-304': 0xb346,\n  'Skein512-312': 0xb347,\n  'Skein512-320': 0xb348,\n  'Skein512-328': 0xb349,\n  'Skein512-336': 0xb34a,\n  'Skein512-344': 0xb34b,\n  'Skein512-352': 0xb34c,\n  'Skein512-360': 0xb34d,\n  'Skein512-368': 0xb34e,\n  'Skein512-376': 0xb34f,\n  'Skein512-384': 0xb350,\n  'Skein512-392': 0xb351,\n  'Skein512-400': 0xb352,\n  'Skein512-408': 0xb353,\n  'Skein512-416': 0xb354,\n  'Skein512-424': 0xb355,\n  'Skein512-432': 0xb356,\n  'Skein512-440': 0xb357,\n  'Skein512-448': 0xb358,\n  'Skein512-456': 0xb359,\n  'Skein512-464': 0xb35a,\n  'Skein512-472': 0xb35b,\n  'Skein512-480': 0xb35c,\n  'Skein512-488': 0xb35d,\n  'Skein512-496': 0xb35e,\n  'Skein512-504': 0xb35f,\n  'Skein512-512': 0xb360,\n  'Skein1024-8': 0xb361,\n  'Skein1024-16': 0xb362,\n  'Skein1024-24': 0xb363,\n  'Skein1024-32': 0xb364,\n  'Skein1024-40': 0xb365,\n  'Skein1024-48': 0xb366,\n  'Skein1024-56': 0xb367,\n  'Skein1024-64': 0xb368,\n  'Skein1024-72': 0xb369,\n  'Skein1024-80': 0xb36a,\n  'Skein1024-88': 0xb36b,\n  'Skein1024-96': 0xb36c,\n  'Skein1024-104': 0xb36d,\n  'Skein1024-112': 0xb36e,\n  'Skein1024-120': 0xb36f,\n  'Skein1024-128': 0xb370,\n  'Skein1024-136': 0xb371,\n  'Skein1024-144': 0xb372,\n  'Skein1024-152': 0xb373,\n  'Skein1024-160': 0xb374,\n  'Skein1024-168': 0xb375,\n  'Skein1024-176': 0xb376,\n  'Skein1024-184': 0xb377,\n  'Skein1024-192': 0xb378,\n  'Skein1024-200': 0xb379,\n  'Skein1024-208': 0xb37a,\n  'Skein1024-216': 0xb37b,\n  'Skein1024-224': 0xb37c,\n  'Skein1024-232': 0xb37d,\n  'Skein1024-240': 0xb37e,\n  'Skein1024-248': 0xb37f,\n  'Skein1024-256': 0xb380,\n  'Skein1024-264': 0xb381,\n  'Skein1024-272': 0xb382,\n  'Skein1024-280': 0xb383,\n  'Skein1024-288': 0xb384,\n  'Skein1024-296': 0xb385,\n  'Skein1024-304': 0xb386,\n  'Skein1024-312': 0xb387,\n  'Skein1024-320': 0xb388,\n  'Skein1024-328': 0xb389,\n  'Skein1024-336': 0xb38a,\n  'Skein1024-344': 0xb38b,\n  'Skein1024-352': 0xb38c,\n  'Skein1024-360': 0xb38d,\n  'Skein1024-368': 0xb38e,\n  'Skein1024-376': 0xb38f,\n  'Skein1024-384': 0xb390,\n  'Skein1024-392': 0xb391,\n  'Skein1024-400': 0xb392,\n  'Skein1024-408': 0xb393,\n  'Skein1024-416': 0xb394,\n  'Skein1024-424': 0xb395,\n  'Skein1024-432': 0xb396,\n  'Skein1024-440': 0xb397,\n  'Skein1024-448': 0xb398,\n  'Skein1024-456': 0xb399,\n  'Skein1024-464': 0xb39a,\n  'Skein1024-472': 0xb39b,\n  'Skein1024-480': 0xb39c,\n  'Skein1024-488': 0xb39d,\n  'Skein1024-496': 0xb39e,\n  'Skein1024-504': 0xb39f,\n  'Skein1024-512': 0xb3a0,\n  'Skein1024-520': 0xb3a1,\n  'Skein1024-528': 0xb3a2,\n  'Skein1024-536': 0xb3a3,\n  'Skein1024-544': 0xb3a4,\n  'Skein1024-552': 0xb3a5,\n  'Skein1024-560': 0xb3a6,\n  'Skein1024-568': 0xb3a7,\n  'Skein1024-576': 0xb3a8,\n  'Skein1024-584': 0xb3a9,\n  'Skein1024-592': 0xb3aa,\n  'Skein1024-600': 0xb3ab,\n  'Skein1024-608': 0xb3ac,\n  'Skein1024-616': 0xb3ad,\n  'Skein1024-624': 0xb3ae,\n  'Skein1024-632': 0xb3af,\n  'Skein1024-640': 0xb3b0,\n  'Skein1024-648': 0xb3b1,\n  'Skein1024-656': 0xb3b2,\n  'Skein1024-664': 0xb3b3,\n  'Skein1024-672': 0xb3b4,\n  'Skein1024-680': 0xb3b5,\n  'Skein1024-688': 0xb3b6,\n  'Skein1024-696': 0xb3b7,\n  'Skein1024-704': 0xb3b8,\n  'Skein1024-712': 0xb3b9,\n  'Skein1024-720': 0xb3ba,\n  'Skein1024-728': 0xb3bb,\n  'Skein1024-736': 0xb3bc,\n  'Skein1024-744': 0xb3bd,\n  'Skein1024-752': 0xb3be,\n  'Skein1024-760': 0xb3bf,\n  'Skein1024-768': 0xb3c0,\n  'Skein1024-776': 0xb3c1,\n  'Skein1024-784': 0xb3c2,\n  'Skein1024-792': 0xb3c3,\n  'Skein1024-800': 0xb3c4,\n  'Skein1024-808': 0xb3c5,\n  'Skein1024-816': 0xb3c6,\n  'Skein1024-824': 0xb3c7,\n  'Skein1024-832': 0xb3c8,\n  'Skein1024-840': 0xb3c9,\n  'Skein1024-848': 0xb3ca,\n  'Skein1024-856': 0xb3cb,\n  'Skein1024-864': 0xb3cc,\n  'Skein1024-872': 0xb3cd,\n  'Skein1024-880': 0xb3ce,\n  'Skein1024-888': 0xb3cf,\n  'Skein1024-896': 0xb3d0,\n  'Skein1024-904': 0xb3d1,\n  'Skein1024-912': 0xb3d2,\n  'Skein1024-920': 0xb3d3,\n  'Skein1024-928': 0xb3d4,\n  'Skein1024-936': 0xb3d5,\n  'Skein1024-944': 0xb3d6,\n  'Skein1024-952': 0xb3d7,\n  'Skein1024-960': 0xb3d8,\n  'Skein1024-968': 0xb3d9,\n  'Skein1024-976': 0xb3da,\n  'Skein1024-984': 0xb3db,\n  'Skein1024-992': 0xb3dc,\n  'Skein1024-1000': 0xb3dd,\n  'Skein1024-1008': 0xb3de,\n  'Skein1024-1016': 0xb3df,\n  'Skein1024-1024': 0xb3e0\n})\n\nexports.codes = Object.freeze({\n  0x11: 'sha1',\n  0x12: 'sha2-256',\n  0x13: 'sha2-512',\n  0x56: 'dbl-sha2-256',\n  0x17: 'sha3-224',\n  0x16: 'sha3-256',\n  0x15: 'sha3-384',\n  0x14: 'sha3-512',\n  0x18: 'shake-128',\n  0x19: 'shake-256',\n  0x1A: 'keccak-224',\n  0x1B: 'keccak-256',\n  0x1C: 'keccak-384',\n  0x1D: 'keccak-512',\n  0x22: 'murmur3-128',\n  0x23: 'murmur3-32',\n\n  // blake2\n  0xb201: 'blake2b-8',\n  0xb202: 'blake2b-16',\n  0xb203: 'blake2b-24',\n  0xb204: 'blake2b-32',\n  0xb205: 'blake2b-40',\n  0xb206: 'blake2b-48',\n  0xb207: 'blake2b-56',\n  0xb208: 'blake2b-64',\n  0xb209: 'blake2b-72',\n  0xb20a: 'blake2b-80',\n  0xb20b: 'blake2b-88',\n  0xb20c: 'blake2b-96',\n  0xb20d: 'blake2b-104',\n  0xb20e: 'blake2b-112',\n  0xb20f: 'blake2b-120',\n  0xb210: 'blake2b-128',\n  0xb211: 'blake2b-136',\n  0xb212: 'blake2b-144',\n  0xb213: 'blake2b-152',\n  0xb214: 'blake2b-160',\n  0xb215: 'blake2b-168',\n  0xb216: 'blake2b-176',\n  0xb217: 'blake2b-184',\n  0xb218: 'blake2b-192',\n  0xb219: 'blake2b-200',\n  0xb21a: 'blake2b-208',\n  0xb21b: 'blake2b-216',\n  0xb21c: 'blake2b-224',\n  0xb21d: 'blake2b-232',\n  0xb21e: 'blake2b-240',\n  0xb21f: 'blake2b-248',\n  0xb220: 'blake2b-256',\n  0xb221: 'blake2b-264',\n  0xb222: 'blake2b-272',\n  0xb223: 'blake2b-280',\n  0xb224: 'blake2b-288',\n  0xb225: 'blake2b-296',\n  0xb226: 'blake2b-304',\n  0xb227: 'blake2b-312',\n  0xb228: 'blake2b-320',\n  0xb229: 'blake2b-328',\n  0xb22a: 'blake2b-336',\n  0xb22b: 'blake2b-344',\n  0xb22c: 'blake2b-352',\n  0xb22d: 'blake2b-360',\n  0xb22e: 'blake2b-368',\n  0xb22f: 'blake2b-376',\n  0xb230: 'blake2b-384',\n  0xb231: 'blake2b-392',\n  0xb232: 'blake2b-400',\n  0xb233: 'blake2b-408',\n  0xb234: 'blake2b-416',\n  0xb235: 'blake2b-424',\n  0xb236: 'blake2b-432',\n  0xb237: 'blake2b-440',\n  0xb238: 'blake2b-448',\n  0xb239: 'blake2b-456',\n  0xb23a: 'blake2b-464',\n  0xb23b: 'blake2b-472',\n  0xb23c: 'blake2b-480',\n  0xb23d: 'blake2b-488',\n  0xb23e: 'blake2b-496',\n  0xb23f: 'blake2b-504',\n  0xb240: 'blake2b-512',\n  0xb241: 'blake2s-8',\n  0xb242: 'blake2s-16',\n  0xb243: 'blake2s-24',\n  0xb244: 'blake2s-32',\n  0xb245: 'blake2s-40',\n  0xb246: 'blake2s-48',\n  0xb247: 'blake2s-56',\n  0xb248: 'blake2s-64',\n  0xb249: 'blake2s-72',\n  0xb24a: 'blake2s-80',\n  0xb24b: 'blake2s-88',\n  0xb24c: 'blake2s-96',\n  0xb24d: 'blake2s-104',\n  0xb24e: 'blake2s-112',\n  0xb24f: 'blake2s-120',\n  0xb250: 'blake2s-128',\n  0xb251: 'blake2s-136',\n  0xb252: 'blake2s-144',\n  0xb253: 'blake2s-152',\n  0xb254: 'blake2s-160',\n  0xb255: 'blake2s-168',\n  0xb256: 'blake2s-176',\n  0xb257: 'blake2s-184',\n  0xb258: 'blake2s-192',\n  0xb259: 'blake2s-200',\n  0xb25a: 'blake2s-208',\n  0xb25b: 'blake2s-216',\n  0xb25c: 'blake2s-224',\n  0xb25d: 'blake2s-232',\n  0xb25e: 'blake2s-240',\n  0xb25f: 'blake2s-248',\n  0xb260: 'blake2s-256',\n\n  // skein\n  0xb301: 'Skein256-8',\n  0xb302: 'Skein256-16',\n  0xb303: 'Skein256-24',\n  0xb304: 'Skein256-32',\n  0xb305: 'Skein256-40',\n  0xb306: 'Skein256-48',\n  0xb307: 'Skein256-56',\n  0xb308: 'Skein256-64',\n  0xb309: 'Skein256-72',\n  0xb30a: 'Skein256-80',\n  0xb30b: 'Skein256-88',\n  0xb30c: 'Skein256-96',\n  0xb30d: 'Skein256-104',\n  0xb30e: 'Skein256-112',\n  0xb30f: 'Skein256-120',\n  0xb310: 'Skein256-128',\n  0xb311: 'Skein256-136',\n  0xb312: 'Skein256-144',\n  0xb313: 'Skein256-152',\n  0xb314: 'Skein256-160',\n  0xb315: 'Skein256-168',\n  0xb316: 'Skein256-176',\n  0xb317: 'Skein256-184',\n  0xb318: 'Skein256-192',\n  0xb319: 'Skein256-200',\n  0xb31a: 'Skein256-208',\n  0xb31b: 'Skein256-216',\n  0xb31c: 'Skein256-224',\n  0xb31d: 'Skein256-232',\n  0xb31e: 'Skein256-240',\n  0xb31f: 'Skein256-248',\n  0xb320: 'Skein256-256',\n  0xb321: 'Skein512-8',\n  0xb322: 'Skein512-16',\n  0xb323: 'Skein512-24',\n  0xb324: 'Skein512-32',\n  0xb325: 'Skein512-40',\n  0xb326: 'Skein512-48',\n  0xb327: 'Skein512-56',\n  0xb328: 'Skein512-64',\n  0xb329: 'Skein512-72',\n  0xb32a: 'Skein512-80',\n  0xb32b: 'Skein512-88',\n  0xb32c: 'Skein512-96',\n  0xb32d: 'Skein512-104',\n  0xb32e: 'Skein512-112',\n  0xb32f: 'Skein512-120',\n  0xb330: 'Skein512-128',\n  0xb331: 'Skein512-136',\n  0xb332: 'Skein512-144',\n  0xb333: 'Skein512-152',\n  0xb334: 'Skein512-160',\n  0xb335: 'Skein512-168',\n  0xb336: 'Skein512-176',\n  0xb337: 'Skein512-184',\n  0xb338: 'Skein512-192',\n  0xb339: 'Skein512-200',\n  0xb33a: 'Skein512-208',\n  0xb33b: 'Skein512-216',\n  0xb33c: 'Skein512-224',\n  0xb33d: 'Skein512-232',\n  0xb33e: 'Skein512-240',\n  0xb33f: 'Skein512-248',\n  0xb340: 'Skein512-256',\n  0xb341: 'Skein512-264',\n  0xb342: 'Skein512-272',\n  0xb343: 'Skein512-280',\n  0xb344: 'Skein512-288',\n  0xb345: 'Skein512-296',\n  0xb346: 'Skein512-304',\n  0xb347: 'Skein512-312',\n  0xb348: 'Skein512-320',\n  0xb349: 'Skein512-328',\n  0xb34a: 'Skein512-336',\n  0xb34b: 'Skein512-344',\n  0xb34c: 'Skein512-352',\n  0xb34d: 'Skein512-360',\n  0xb34e: 'Skein512-368',\n  0xb34f: 'Skein512-376',\n  0xb350: 'Skein512-384',\n  0xb351: 'Skein512-392',\n  0xb352: 'Skein512-400',\n  0xb353: 'Skein512-408',\n  0xb354: 'Skein512-416',\n  0xb355: 'Skein512-424',\n  0xb356: 'Skein512-432',\n  0xb357: 'Skein512-440',\n  0xb358: 'Skein512-448',\n  0xb359: 'Skein512-456',\n  0xb35a: 'Skein512-464',\n  0xb35b: 'Skein512-472',\n  0xb35c: 'Skein512-480',\n  0xb35d: 'Skein512-488',\n  0xb35e: 'Skein512-496',\n  0xb35f: 'Skein512-504',\n  0xb360: 'Skein512-512',\n  0xb361: 'Skein1024-8',\n  0xb362: 'Skein1024-16',\n  0xb363: 'Skein1024-24',\n  0xb364: 'Skein1024-32',\n  0xb365: 'Skein1024-40',\n  0xb366: 'Skein1024-48',\n  0xb367: 'Skein1024-56',\n  0xb368: 'Skein1024-64',\n  0xb369: 'Skein1024-72',\n  0xb36a: 'Skein1024-80',\n  0xb36b: 'Skein1024-88',\n  0xb36c: 'Skein1024-96',\n  0xb36d: 'Skein1024-104',\n  0xb36e: 'Skein1024-112',\n  0xb36f: 'Skein1024-120',\n  0xb370: 'Skein1024-128',\n  0xb371: 'Skein1024-136',\n  0xb372: 'Skein1024-144',\n  0xb373: 'Skein1024-152',\n  0xb374: 'Skein1024-160',\n  0xb375: 'Skein1024-168',\n  0xb376: 'Skein1024-176',\n  0xb377: 'Skein1024-184',\n  0xb378: 'Skein1024-192',\n  0xb379: 'Skein1024-200',\n  0xb37a: 'Skein1024-208',\n  0xb37b: 'Skein1024-216',\n  0xb37c: 'Skein1024-224',\n  0xb37d: 'Skein1024-232',\n  0xb37e: 'Skein1024-240',\n  0xb37f: 'Skein1024-248',\n  0xb380: 'Skein1024-256',\n  0xb381: 'Skein1024-264',\n  0xb382: 'Skein1024-272',\n  0xb383: 'Skein1024-280',\n  0xb384: 'Skein1024-288',\n  0xb385: 'Skein1024-296',\n  0xb386: 'Skein1024-304',\n  0xb387: 'Skein1024-312',\n  0xb388: 'Skein1024-320',\n  0xb389: 'Skein1024-328',\n  0xb38a: 'Skein1024-336',\n  0xb38b: 'Skein1024-344',\n  0xb38c: 'Skein1024-352',\n  0xb38d: 'Skein1024-360',\n  0xb38e: 'Skein1024-368',\n  0xb38f: 'Skein1024-376',\n  0xb390: 'Skein1024-384',\n  0xb391: 'Skein1024-392',\n  0xb392: 'Skein1024-400',\n  0xb393: 'Skein1024-408',\n  0xb394: 'Skein1024-416',\n  0xb395: 'Skein1024-424',\n  0xb396: 'Skein1024-432',\n  0xb397: 'Skein1024-440',\n  0xb398: 'Skein1024-448',\n  0xb399: 'Skein1024-456',\n  0xb39a: 'Skein1024-464',\n  0xb39b: 'Skein1024-472',\n  0xb39c: 'Skein1024-480',\n  0xb39d: 'Skein1024-488',\n  0xb39e: 'Skein1024-496',\n  0xb39f: 'Skein1024-504',\n  0xb3a0: 'Skein1024-512',\n  0xb3a1: 'Skein1024-520',\n  0xb3a2: 'Skein1024-528',\n  0xb3a3: 'Skein1024-536',\n  0xb3a4: 'Skein1024-544',\n  0xb3a5: 'Skein1024-552',\n  0xb3a6: 'Skein1024-560',\n  0xb3a7: 'Skein1024-568',\n  0xb3a8: 'Skein1024-576',\n  0xb3a9: 'Skein1024-584',\n  0xb3aa: 'Skein1024-592',\n  0xb3ab: 'Skein1024-600',\n  0xb3ac: 'Skein1024-608',\n  0xb3ad: 'Skein1024-616',\n  0xb3ae: 'Skein1024-624',\n  0xb3af: 'Skein1024-632',\n  0xb3b0: 'Skein1024-640',\n  0xb3b1: 'Skein1024-648',\n  0xb3b2: 'Skein1024-656',\n  0xb3b3: 'Skein1024-664',\n  0xb3b4: 'Skein1024-672',\n  0xb3b5: 'Skein1024-680',\n  0xb3b6: 'Skein1024-688',\n  0xb3b7: 'Skein1024-696',\n  0xb3b8: 'Skein1024-704',\n  0xb3b9: 'Skein1024-712',\n  0xb3ba: 'Skein1024-720',\n  0xb3bb: 'Skein1024-728',\n  0xb3bc: 'Skein1024-736',\n  0xb3bd: 'Skein1024-744',\n  0xb3be: 'Skein1024-752',\n  0xb3bf: 'Skein1024-760',\n  0xb3c0: 'Skein1024-768',\n  0xb3c1: 'Skein1024-776',\n  0xb3c2: 'Skein1024-784',\n  0xb3c3: 'Skein1024-792',\n  0xb3c4: 'Skein1024-800',\n  0xb3c5: 'Skein1024-808',\n  0xb3c6: 'Skein1024-816',\n  0xb3c7: 'Skein1024-824',\n  0xb3c8: 'Skein1024-832',\n  0xb3c9: 'Skein1024-840',\n  0xb3ca: 'Skein1024-848',\n  0xb3cb: 'Skein1024-856',\n  0xb3cc: 'Skein1024-864',\n  0xb3cd: 'Skein1024-872',\n  0xb3ce: 'Skein1024-880',\n  0xb3cf: 'Skein1024-888',\n  0xb3d0: 'Skein1024-896',\n  0xb3d1: 'Skein1024-904',\n  0xb3d2: 'Skein1024-912',\n  0xb3d3: 'Skein1024-920',\n  0xb3d4: 'Skein1024-928',\n  0xb3d5: 'Skein1024-936',\n  0xb3d6: 'Skein1024-944',\n  0xb3d7: 'Skein1024-952',\n  0xb3d8: 'Skein1024-960',\n  0xb3d9: 'Skein1024-968',\n  0xb3da: 'Skein1024-976',\n  0xb3db: 'Skein1024-984',\n  0xb3dc: 'Skein1024-992',\n  0xb3dd: 'Skein1024-1000',\n  0xb3de: 'Skein1024-1008',\n  0xb3df: 'Skein1024-1016',\n  0xb3e0: 'Skein1024-1024'\n})\n\nexports.defaultLengths = Object.freeze({\n  0x11: 20,\n  0x12: 32,\n  0x13: 64,\n  0x56: 32,\n  0x17: 28,\n  0x16: 32,\n  0x15: 48,\n  0x14: 64,\n  0x18: 32,\n  0x19: 64,\n  0x1A: 28,\n  0x1B: 32,\n  0x1C: 48,\n  0x1D: 64,\n  0x22: 32,\n\n  0xb201: 0x01,\n  0xb202: 0x02,\n  0xb203: 0x03,\n  0xb204: 0x04,\n  0xb205: 0x05,\n  0xb206: 0x06,\n  0xb207: 0x07,\n  0xb208: 0x08,\n  0xb209: 0x09,\n  0xb20a: 0x0a,\n  0xb20b: 0x0b,\n  0xb20c: 0x0c,\n  0xb20d: 0x0d,\n  0xb20e: 0x0e,\n  0xb20f: 0x0f,\n  0xb210: 0x10,\n  0xb211: 0x11,\n  0xb212: 0x12,\n  0xb213: 0x13,\n  0xb214: 0x14,\n  0xb215: 0x15,\n  0xb216: 0x16,\n  0xb217: 0x17,\n  0xb218: 0x18,\n  0xb219: 0x19,\n  0xb21a: 0x1a,\n  0xb21b: 0x1b,\n  0xb21c: 0x1c,\n  0xb21d: 0x1d,\n  0xb21e: 0x1e,\n  0xb21f: 0x1f,\n  0xb220: 0x20,\n  0xb221: 0x21,\n  0xb222: 0x22,\n  0xb223: 0x23,\n  0xb224: 0x24,\n  0xb225: 0x25,\n  0xb226: 0x26,\n  0xb227: 0x27,\n  0xb228: 0x28,\n  0xb229: 0x29,\n  0xb22a: 0x2a,\n  0xb22b: 0x2b,\n  0xb22c: 0x2c,\n  0xb22d: 0x2d,\n  0xb22e: 0x2e,\n  0xb22f: 0x2f,\n  0xb230: 0x30,\n  0xb231: 0x31,\n  0xb232: 0x32,\n  0xb233: 0x33,\n  0xb234: 0x34,\n  0xb235: 0x35,\n  0xb236: 0x36,\n  0xb237: 0x37,\n  0xb238: 0x38,\n  0xb239: 0x39,\n  0xb23a: 0x3a,\n  0xb23b: 0x3b,\n  0xb23c: 0x3c,\n  0xb23d: 0x3d,\n  0xb23e: 0x3e,\n  0xb23f: 0x3f,\n  0xb240: 0x40,\n  0xb241: 0x01,\n  0xb242: 0x02,\n  0xb243: 0x03,\n  0xb244: 0x04,\n  0xb245: 0x05,\n  0xb246: 0x06,\n  0xb247: 0x07,\n  0xb248: 0x08,\n  0xb249: 0x09,\n  0xb24a: 0x0a,\n  0xb24b: 0x0b,\n  0xb24c: 0x0c,\n  0xb24d: 0x0d,\n  0xb24e: 0x0e,\n  0xb24f: 0x0f,\n  0xb250: 0x10,\n  0xb251: 0x11,\n  0xb252: 0x12,\n  0xb253: 0x13,\n  0xb254: 0x14,\n  0xb255: 0x15,\n  0xb256: 0x16,\n  0xb257: 0x17,\n  0xb258: 0x18,\n  0xb259: 0x19,\n  0xb25a: 0x1a,\n  0xb25b: 0x1b,\n  0xb25c: 0x1c,\n  0xb25d: 0x1d,\n  0xb25e: 0x1e,\n  0xb25f: 0x1f,\n  0xb260: 0x20,\n  0xb301: 0x01,\n  0xb302: 0x02,\n  0xb303: 0x03,\n  0xb304: 0x04,\n  0xb305: 0x05,\n  0xb306: 0x06,\n  0xb307: 0x07,\n  0xb308: 0x08,\n  0xb309: 0x09,\n  0xb30a: 0x0a,\n  0xb30b: 0x0b,\n  0xb30c: 0x0c,\n  0xb30d: 0x0d,\n  0xb30e: 0x0e,\n  0xb30f: 0x0f,\n  0xb310: 0x10,\n  0xb311: 0x11,\n  0xb312: 0x12,\n  0xb313: 0x13,\n  0xb314: 0x14,\n  0xb315: 0x15,\n  0xb316: 0x16,\n  0xb317: 0x17,\n  0xb318: 0x18,\n  0xb319: 0x19,\n  0xb31a: 0x1a,\n  0xb31b: 0x1b,\n  0xb31c: 0x1c,\n  0xb31d: 0x1d,\n  0xb31e: 0x1e,\n  0xb31f: 0x1f,\n  0xb320: 0x20,\n  0xb321: 0x01,\n  0xb322: 0x02,\n  0xb323: 0x03,\n  0xb324: 0x04,\n  0xb325: 0x05,\n  0xb326: 0x06,\n  0xb327: 0x07,\n  0xb328: 0x08,\n  0xb329: 0x09,\n  0xb32a: 0x0a,\n  0xb32b: 0x0b,\n  0xb32c: 0x0c,\n  0xb32d: 0x0d,\n  0xb32e: 0x0e,\n  0xb32f: 0x0f,\n  0xb330: 0x10,\n  0xb331: 0x11,\n  0xb332: 0x12,\n  0xb333: 0x13,\n  0xb334: 0x14,\n  0xb335: 0x15,\n  0xb336: 0x16,\n  0xb337: 0x17,\n  0xb338: 0x18,\n  0xb339: 0x19,\n  0xb33a: 0x1a,\n  0xb33b: 0x1b,\n  0xb33c: 0x1c,\n  0xb33d: 0x1d,\n  0xb33e: 0x1e,\n  0xb33f: 0x1f,\n  0xb340: 0x20,\n  0xb341: 0x21,\n  0xb342: 0x22,\n  0xb343: 0x23,\n  0xb344: 0x24,\n  0xb345: 0x25,\n  0xb346: 0x26,\n  0xb347: 0x27,\n  0xb348: 0x28,\n  0xb349: 0x29,\n  0xb34a: 0x2a,\n  0xb34b: 0x2b,\n  0xb34c: 0x2c,\n  0xb34d: 0x2d,\n  0xb34e: 0x2e,\n  0xb34f: 0x2f,\n  0xb350: 0x30,\n  0xb351: 0x31,\n  0xb352: 0x32,\n  0xb353: 0x33,\n  0xb354: 0x34,\n  0xb355: 0x35,\n  0xb356: 0x36,\n  0xb357: 0x37,\n  0xb358: 0x38,\n  0xb359: 0x39,\n  0xb35a: 0x3a,\n  0xb35b: 0x3b,\n  0xb35c: 0x3c,\n  0xb35d: 0x3d,\n  0xb35e: 0x3e,\n  0xb35f: 0x3f,\n  0xb360: 0x40,\n  0xb361: 0x01,\n  0xb362: 0x02,\n  0xb363: 0x03,\n  0xb364: 0x04,\n  0xb365: 0x05,\n  0xb366: 0x06,\n  0xb367: 0x07,\n  0xb368: 0x08,\n  0xb369: 0x09,\n  0xb36a: 0x0a,\n  0xb36b: 0x0b,\n  0xb36c: 0x0c,\n  0xb36d: 0x0d,\n  0xb36e: 0x0e,\n  0xb36f: 0x0f,\n  0xb370: 0x10,\n  0xb371: 0x11,\n  0xb372: 0x12,\n  0xb373: 0x13,\n  0xb374: 0x14,\n  0xb375: 0x15,\n  0xb376: 0x16,\n  0xb377: 0x17,\n  0xb378: 0x18,\n  0xb379: 0x19,\n  0xb37a: 0x1a,\n  0xb37b: 0x1b,\n  0xb37c: 0x1c,\n  0xb37d: 0x1d,\n  0xb37e: 0x1e,\n  0xb37f: 0x1f,\n  0xb380: 0x20,\n  0xb381: 0x21,\n  0xb382: 0x22,\n  0xb383: 0x23,\n  0xb384: 0x24,\n  0xb385: 0x25,\n  0xb386: 0x26,\n  0xb387: 0x27,\n  0xb388: 0x28,\n  0xb389: 0x29,\n  0xb38a: 0x2a,\n  0xb38b: 0x2b,\n  0xb38c: 0x2c,\n  0xb38d: 0x2d,\n  0xb38e: 0x2e,\n  0xb38f: 0x2f,\n  0xb390: 0x30,\n  0xb391: 0x31,\n  0xb392: 0x32,\n  0xb393: 0x33,\n  0xb394: 0x34,\n  0xb395: 0x35,\n  0xb396: 0x36,\n  0xb397: 0x37,\n  0xb398: 0x38,\n  0xb399: 0x39,\n  0xb39a: 0x3a,\n  0xb39b: 0x3b,\n  0xb39c: 0x3c,\n  0xb39d: 0x3d,\n  0xb39e: 0x3e,\n  0xb39f: 0x3f,\n  0xb3a0: 0x40,\n  0xb3a1: 0x41,\n  0xb3a2: 0x42,\n  0xb3a3: 0x43,\n  0xb3a4: 0x44,\n  0xb3a5: 0x45,\n  0xb3a6: 0x46,\n  0xb3a7: 0x47,\n  0xb3a8: 0x48,\n  0xb3a9: 0x49,\n  0xb3aa: 0x4a,\n  0xb3ab: 0x4b,\n  0xb3ac: 0x4c,\n  0xb3ad: 0x4d,\n  0xb3ae: 0x4e,\n  0xb3af: 0x4f,\n  0xb3b0: 0x50,\n  0xb3b1: 0x51,\n  0xb3b2: 0x52,\n  0xb3b3: 0x53,\n  0xb3b4: 0x54,\n  0xb3b5: 0x55,\n  0xb3b6: 0x56,\n  0xb3b7: 0x57,\n  0xb3b8: 0x58,\n  0xb3b9: 0x59,\n  0xb3ba: 0x5a,\n  0xb3bb: 0x5b,\n  0xb3bc: 0x5c,\n  0xb3bd: 0x5d,\n  0xb3be: 0x5e,\n  0xb3bf: 0x5f,\n  0xb3c0: 0x60,\n  0xb3c1: 0x61,\n  0xb3c2: 0x62,\n  0xb3c3: 0x63,\n  0xb3c4: 0x64,\n  0xb3c5: 0x65,\n  0xb3c6: 0x66,\n  0xb3c7: 0x67,\n  0xb3c8: 0x68,\n  0xb3c9: 0x69,\n  0xb3ca: 0x6a,\n  0xb3cb: 0x6b,\n  0xb3cc: 0x6c,\n  0xb3cd: 0x6d,\n  0xb3ce: 0x6e,\n  0xb3cf: 0x6f,\n  0xb3d0: 0x70,\n  0xb3d1: 0x71,\n  0xb3d2: 0x72,\n  0xb3d3: 0x73,\n  0xb3d4: 0x74,\n  0xb3d5: 0x75,\n  0xb3d6: 0x76,\n  0xb3d7: 0x77,\n  0xb3d8: 0x78,\n  0xb3d9: 0x79,\n  0xb3da: 0x7a,\n  0xb3db: 0x7b,\n  0xb3dc: 0x7c,\n  0xb3dd: 0x7d,\n  0xb3de: 0x7e,\n  0xb3df: 0x7f,\n  0xb3e0: 0x80\n})\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashes/src/constants.js\n// module id = 475\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashes/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst setImmediate = __webpack_require__(8)\n\nexports.toCallback = (doWork) => {\n  return function (input, callback) {\n    const done = (err, res) => setImmediate(() => {\n      callback(err, res)\n    })\n\n    let res\n    try {\n      res = doWork(input)\n    } catch (err) {\n      done(err)\n      return\n    }\n\n    done(null, res)\n  }\n}\n\nexports.toBuf = (doWork, other) => (input) => {\n  let result = doWork(input, other)\n  return Buffer.from(result, 'hex')\n}\n\nexports.fromString = (doWork, other) => (_input) => {\n  const input = Buffer.isBuffer(_input) ? _input.toString() : _input\n  return doWork(input, other)\n}\n\nexports.fromNumberTo32BitBuf = (doWork, other) => (input) => {\n  let number = doWork(input, other)\n  const bytes = new Array(4)\n\n  for (let i = 0; i < 4; i++) {\n    bytes[i] = number & 0xff\n    number = number >> 8\n  }\n\n  return Buffer.from(bytes)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashing-async/src/utils.js\n// module id = 476\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashing-async/src/utils.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = __webpack_require__(1110);\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n               && 'undefined' != typeof chrome.storage\n                  ? chrome.storage.local\n                  : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n  'lightseagreen',\n  'forestgreen',\n  'goldenrod',\n  'dodgerblue',\n  'darkorchid',\n  'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n  // NB: In an Electron preload script, document will be defined but not fully\n  // initialized. Since we know we're in Chrome, we'll just detect this case\n  // explicitly\n  if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {\n    return true;\n  }\n\n  // is webkit? http://stackoverflow.com/a/16459606/376773\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n    // is firebug? http://stackoverflow.com/a/398120/376773\n    (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n    // is firefox >= v31?\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n    // double check webkit in userAgent just in case we are in a worker\n    (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n  try {\n    return JSON.stringify(v);\n  } catch (err) {\n    return '[UnexpectedJSONParseError]: ' + err.message;\n  }\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n  var useColors = this.useColors;\n\n  args[0] = (useColors ? '%c' : '')\n    + this.namespace\n    + (useColors ? ' %c' : ' ')\n    + args[0]\n    + (useColors ? '%c ' : ' ')\n    + '+' + exports.humanize(this.diff);\n\n  if (!useColors) return;\n\n  var c = 'color: ' + this.color;\n  args.splice(1, 0, c, 'color: inherit')\n\n  // the final \"%c\" is somewhat tricky, because there could be other\n  // arguments passed either before or after the %c, so we need to\n  // figure out the correct index to insert the CSS into\n  var index = 0;\n  var lastC = 0;\n  args[0].replace(/%[a-zA-Z%]/g, function(match) {\n    if ('%%' === match) return;\n    index++;\n    if ('%c' === match) {\n      // we only are interested in the *last* %c\n      // (the user may have provided their own)\n      lastC = index;\n    }\n  });\n\n  args.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n  // this hackery is required for IE8/9, where\n  // the `console.log` function doesn't have 'apply'\n  return 'object' === typeof console\n    && console.log\n    && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n  try {\n    if (null == namespaces) {\n      exports.storage.removeItem('debug');\n    } else {\n      exports.storage.debug = namespaces;\n    }\n  } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n  var r;\n  try {\n    r = exports.storage.debug;\n  } catch(e) {}\n\n  // If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n  if (!r && typeof process !== 'undefined' && 'env' in process) {\n    r = __webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}).DEBUG;\n  }\n\n  return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n  try {\n    return window.localStorage;\n  } catch (e) {}\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/debug/src/browser.js\n// module id = 477\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/debug/src/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports = module.exports\nexports.PROTOCOL_ID = '/multistream/1.0.0'\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/constants.js\n// module id = 478\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/**\n * Match protocols exactly.\n *\n * @param {string} myProtocol\n * @param {string} senderProtocol\n * @param {function(Error, boolean)} callback\n * @returns {undefined}\n * @type {matchHandler}\n */\nfunction matchExact (myProtocol, senderProtocol, callback) {\n  const result = myProtocol === senderProtocol\n  callback(null, result)\n}\n\nmodule.exports = matchExact\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/listener/match-exact.js\n// module id = 479\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/listener/match-exact.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst handshake = __webpack_require__(102)\nconst pullLP = __webpack_require__(45)\nconst util = __webpack_require__(196)\nconst writeEncoded = util.writeEncoded\n\nfunction select (multicodec, callback, log) {\n  const stream = handshake({\n    timeout: 60 * 1000\n  }, callback)\n\n  const shake = stream.handshake\n\n  log('writing multicodec: ' + multicodec)\n  writeEncoded(shake, Buffer.from(multicodec + '\\n'), callback)\n\n  pullLP.decodeFromReader(shake, (err, data) => {\n    if (err) {\n      return callback(err)\n    }\n    const protocol = data.toString().slice(0, -1)\n\n    if (protocol !== multicodec) {\n      return callback(new Error(`\"${multicodec}\" not supported`), shake.rest())\n    }\n\n    log('received ack: ' + protocol)\n    callback(null, shake.rest())\n  })\n\n  return stream\n}\n\nmodule.exports = select\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/select.js\n// module id = 480\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/select.js")},function(module,exports,__webpack_require__){eval("/**\n * Supported cipher modes.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\nforge.cipher = forge.cipher || {};\n\n// supported cipher modes\nvar modes = module.exports = forge.cipher.modes = forge.cipher.modes || {};\n\n/** Electronic codebook (ECB) (Don't use this; it's not secure) **/\n\nmodes.ecb = function(options) {\n  options = options || {};\n  this.name = 'ECB';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = new Array(this._ints);\n  this._outBlock = new Array(this._ints);\n};\n\nmodes.ecb.prototype.start = function(options) {};\n\nmodes.ecb.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n    return true;\n  }\n\n  // get next block\n  for(var i = 0; i < this._ints; ++i) {\n    this._inBlock[i] = input.getInt32();\n  }\n\n  // encrypt block\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // write output\n  for(var i = 0; i < this._ints; ++i) {\n    output.putInt32(this._outBlock[i]);\n  }\n};\n\nmodes.ecb.prototype.decrypt = function(input, output, finish) {\n  // not enough input to decrypt\n  if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n    return true;\n  }\n\n  // get next block\n  for(var i = 0; i < this._ints; ++i) {\n    this._inBlock[i] = input.getInt32();\n  }\n\n  // decrypt block\n  this.cipher.decrypt(this._inBlock, this._outBlock);\n\n  // write output\n  for(var i = 0; i < this._ints; ++i) {\n    output.putInt32(this._outBlock[i]);\n  }\n};\n\nmodes.ecb.prototype.pad = function(input, options) {\n  // add PKCS#7 padding to block (each pad byte is the\n  // value of the number of pad bytes)\n  var padding = (input.length() === this.blockSize ?\n    this.blockSize : (this.blockSize - input.length()));\n  input.fillWithByte(padding, padding);\n  return true;\n};\n\nmodes.ecb.prototype.unpad = function(output, options) {\n  // check for error: input data not a multiple of blockSize\n  if(options.overflow > 0) {\n    return false;\n  }\n\n  // ensure padding byte count is valid\n  var len = output.length();\n  var count = output.at(len - 1);\n  if(count > (this.blockSize << 2)) {\n    return false;\n  }\n\n  // trim off padding bytes\n  output.truncate(count);\n  return true;\n};\n\n/** Cipher-block Chaining (CBC) **/\n\nmodes.cbc = function(options) {\n  options = options || {};\n  this.name = 'CBC';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = new Array(this._ints);\n  this._outBlock = new Array(this._ints);\n};\n\nmodes.cbc.prototype.start = function(options) {\n  // Note: legacy support for using IV residue (has security flaws)\n  // if IV is null, reuse block from previous processing\n  if(options.iv === null) {\n    // must have a previous block\n    if(!this._prev) {\n      throw new Error('Invalid IV parameter.');\n    }\n    this._iv = this._prev.slice(0);\n  } else if(!('iv' in options)) {\n    throw new Error('Invalid IV parameter.');\n  } else {\n    // save IV as \"previous\" block\n    this._iv = transformIV(options.iv);\n    this._prev = this._iv.slice(0);\n  }\n};\n\nmodes.cbc.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n    return true;\n  }\n\n  // get next block\n  // CBC XOR's IV (or previous block) with plaintext\n  for(var i = 0; i < this._ints; ++i) {\n    this._inBlock[i] = this._prev[i] ^ input.getInt32();\n  }\n\n  // encrypt block\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // write output, save previous block\n  for(var i = 0; i < this._ints; ++i) {\n    output.putInt32(this._outBlock[i]);\n  }\n  this._prev = this._outBlock;\n};\n\nmodes.cbc.prototype.decrypt = function(input, output, finish) {\n  // not enough input to decrypt\n  if(input.length() < this.blockSize && !(finish && input.length() > 0)) {\n    return true;\n  }\n\n  // get next block\n  for(var i = 0; i < this._ints; ++i) {\n    this._inBlock[i] = input.getInt32();\n  }\n\n  // decrypt block\n  this.cipher.decrypt(this._inBlock, this._outBlock);\n\n  // write output, save previous ciphered block\n  // CBC XOR's IV (or previous block) with ciphertext\n  for(var i = 0; i < this._ints; ++i) {\n    output.putInt32(this._prev[i] ^ this._outBlock[i]);\n  }\n  this._prev = this._inBlock.slice(0);\n};\n\nmodes.cbc.prototype.pad = function(input, options) {\n  // add PKCS#7 padding to block (each pad byte is the\n  // value of the number of pad bytes)\n  var padding = (input.length() === this.blockSize ?\n    this.blockSize : (this.blockSize - input.length()));\n  input.fillWithByte(padding, padding);\n  return true;\n};\n\nmodes.cbc.prototype.unpad = function(output, options) {\n  // check for error: input data not a multiple of blockSize\n  if(options.overflow > 0) {\n    return false;\n  }\n\n  // ensure padding byte count is valid\n  var len = output.length();\n  var count = output.at(len - 1);\n  if(count > (this.blockSize << 2)) {\n    return false;\n  }\n\n  // trim off padding bytes\n  output.truncate(count);\n  return true;\n};\n\n/** Cipher feedback (CFB) **/\n\nmodes.cfb = function(options) {\n  options = options || {};\n  this.name = 'CFB';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = null;\n  this._outBlock = new Array(this._ints);\n  this._partialBlock = new Array(this._ints);\n  this._partialOutput = forge.util.createBuffer();\n  this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.start = function(options) {\n  if(!('iv' in options)) {\n    throw new Error('Invalid IV parameter.');\n  }\n  // use IV as first input\n  this._iv = transformIV(options.iv);\n  this._inBlock = this._iv.slice(0);\n  this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  var inputLength = input.length();\n  if(inputLength === 0) {\n    return true;\n  }\n\n  // encrypt block\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // handle full block\n  if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n    // XOR input with output, write input as output\n    for(var i = 0; i < this._ints; ++i) {\n      this._inBlock[i] = input.getInt32() ^ this._outBlock[i];\n      output.putInt32(this._inBlock[i]);\n    }\n    return;\n  }\n\n  // handle partial block\n  var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n  if(partialBytes > 0) {\n    partialBytes = this.blockSize - partialBytes;\n  }\n\n  // XOR input with output, write input as partial output\n  this._partialOutput.clear();\n  for(var i = 0; i < this._ints; ++i) {\n    this._partialBlock[i] = input.getInt32() ^ this._outBlock[i];\n    this._partialOutput.putInt32(this._partialBlock[i]);\n  }\n\n  if(partialBytes > 0) {\n    // block still incomplete, restore input buffer\n    input.read -= this.blockSize;\n  } else {\n    // block complete, update input block\n    for(var i = 0; i < this._ints; ++i) {\n      this._inBlock[i] = this._partialBlock[i];\n    }\n  }\n\n  // skip any previous partial bytes\n  if(this._partialBytes > 0) {\n    this._partialOutput.getBytes(this._partialBytes);\n  }\n\n  if(partialBytes > 0 && !finish) {\n    output.putBytes(this._partialOutput.getBytes(\n      partialBytes - this._partialBytes));\n    this._partialBytes = partialBytes;\n    return true;\n  }\n\n  output.putBytes(this._partialOutput.getBytes(\n    inputLength - this._partialBytes));\n  this._partialBytes = 0;\n};\n\nmodes.cfb.prototype.decrypt = function(input, output, finish) {\n  // not enough input to decrypt\n  var inputLength = input.length();\n  if(inputLength === 0) {\n    return true;\n  }\n\n  // encrypt block (CFB always uses encryption mode)\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // handle full block\n  if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n    // XOR input with output, write input as output\n    for(var i = 0; i < this._ints; ++i) {\n      this._inBlock[i] = input.getInt32();\n      output.putInt32(this._inBlock[i] ^ this._outBlock[i]);\n    }\n    return;\n  }\n\n  // handle partial block\n  var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n  if(partialBytes > 0) {\n    partialBytes = this.blockSize - partialBytes;\n  }\n\n  // XOR input with output, write input as partial output\n  this._partialOutput.clear();\n  for(var i = 0; i < this._ints; ++i) {\n    this._partialBlock[i] = input.getInt32();\n    this._partialOutput.putInt32(this._partialBlock[i] ^ this._outBlock[i]);\n  }\n\n  if(partialBytes > 0) {\n    // block still incomplete, restore input buffer\n    input.read -= this.blockSize;\n  } else {\n    // block complete, update input block\n    for(var i = 0; i < this._ints; ++i) {\n      this._inBlock[i] = this._partialBlock[i];\n    }\n  }\n\n  // skip any previous partial bytes\n  if(this._partialBytes > 0) {\n    this._partialOutput.getBytes(this._partialBytes);\n  }\n\n  if(partialBytes > 0 && !finish) {\n    output.putBytes(this._partialOutput.getBytes(\n      partialBytes - this._partialBytes));\n    this._partialBytes = partialBytes;\n    return true;\n  }\n\n  output.putBytes(this._partialOutput.getBytes(\n    inputLength - this._partialBytes));\n  this._partialBytes = 0;\n};\n\n/** Output feedback (OFB) **/\n\nmodes.ofb = function(options) {\n  options = options || {};\n  this.name = 'OFB';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = null;\n  this._outBlock = new Array(this._ints);\n  this._partialOutput = forge.util.createBuffer();\n  this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.start = function(options) {\n  if(!('iv' in options)) {\n    throw new Error('Invalid IV parameter.');\n  }\n  // use IV as first input\n  this._iv = transformIV(options.iv);\n  this._inBlock = this._iv.slice(0);\n  this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  var inputLength = input.length();\n  if(input.length() === 0) {\n    return true;\n  }\n\n  // encrypt block (OFB always uses encryption mode)\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // handle full block\n  if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n    // XOR input with output and update next input\n    for(var i = 0; i < this._ints; ++i) {\n      output.putInt32(input.getInt32() ^ this._outBlock[i]);\n      this._inBlock[i] = this._outBlock[i];\n    }\n    return;\n  }\n\n  // handle partial block\n  var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n  if(partialBytes > 0) {\n    partialBytes = this.blockSize - partialBytes;\n  }\n\n  // XOR input with output\n  this._partialOutput.clear();\n  for(var i = 0; i < this._ints; ++i) {\n    this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n  }\n\n  if(partialBytes > 0) {\n    // block still incomplete, restore input buffer\n    input.read -= this.blockSize;\n  } else {\n    // block complete, update input block\n    for(var i = 0; i < this._ints; ++i) {\n      this._inBlock[i] = this._outBlock[i];\n    }\n  }\n\n  // skip any previous partial bytes\n  if(this._partialBytes > 0) {\n    this._partialOutput.getBytes(this._partialBytes);\n  }\n\n  if(partialBytes > 0 && !finish) {\n    output.putBytes(this._partialOutput.getBytes(\n      partialBytes - this._partialBytes));\n    this._partialBytes = partialBytes;\n    return true;\n  }\n\n  output.putBytes(this._partialOutput.getBytes(\n    inputLength - this._partialBytes));\n  this._partialBytes = 0;\n};\n\nmodes.ofb.prototype.decrypt = modes.ofb.prototype.encrypt;\n\n/** Counter (CTR) **/\n\nmodes.ctr = function(options) {\n  options = options || {};\n  this.name = 'CTR';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = null;\n  this._outBlock = new Array(this._ints);\n  this._partialOutput = forge.util.createBuffer();\n  this._partialBytes = 0;\n};\n\nmodes.ctr.prototype.start = function(options) {\n  if(!('iv' in options)) {\n    throw new Error('Invalid IV parameter.');\n  }\n  // use IV as first input\n  this._iv = transformIV(options.iv);\n  this._inBlock = this._iv.slice(0);\n  this._partialBytes = 0;\n};\n\nmodes.ctr.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  var inputLength = input.length();\n  if(inputLength === 0) {\n    return true;\n  }\n\n  // encrypt block (CTR always uses encryption mode)\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // handle full block\n  if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n    // XOR input with output\n    for(var i = 0; i < this._ints; ++i) {\n      output.putInt32(input.getInt32() ^ this._outBlock[i]);\n    }\n  } else {\n    // handle partial block\n    var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n    if(partialBytes > 0) {\n      partialBytes = this.blockSize - partialBytes;\n    }\n\n    // XOR input with output\n    this._partialOutput.clear();\n    for(var i = 0; i < this._ints; ++i) {\n      this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n    }\n\n    if(partialBytes > 0) {\n      // block still incomplete, restore input buffer\n      input.read -= this.blockSize;\n    }\n\n    // skip any previous partial bytes\n    if(this._partialBytes > 0) {\n      this._partialOutput.getBytes(this._partialBytes);\n    }\n\n    if(partialBytes > 0 && !finish) {\n      output.putBytes(this._partialOutput.getBytes(\n        partialBytes - this._partialBytes));\n      this._partialBytes = partialBytes;\n      return true;\n    }\n\n    output.putBytes(this._partialOutput.getBytes(\n      inputLength - this._partialBytes));\n    this._partialBytes = 0;\n  }\n\n  // block complete, increment counter (input block)\n  inc32(this._inBlock);\n};\n\nmodes.ctr.prototype.decrypt = modes.ctr.prototype.encrypt;\n\n/** Galois/Counter Mode (GCM) **/\n\nmodes.gcm = function(options) {\n  options = options || {};\n  this.name = 'GCM';\n  this.cipher = options.cipher;\n  this.blockSize = options.blockSize || 16;\n  this._ints = this.blockSize / 4;\n  this._inBlock = new Array(this._ints);\n  this._outBlock = new Array(this._ints);\n  this._partialOutput = forge.util.createBuffer();\n  this._partialBytes = 0;\n\n  // R is actually this value concatenated with 120 more zero bits, but\n  // we only XOR against R so the other zeros have no effect -- we just\n  // apply this value to the first integer in a block\n  this._R = 0xE1000000;\n};\n\nmodes.gcm.prototype.start = function(options) {\n  if(!('iv' in options)) {\n    throw new Error('Invalid IV parameter.');\n  }\n  // ensure IV is a byte buffer\n  var iv = forge.util.createBuffer(options.iv);\n\n  // no ciphered data processed yet\n  this._cipherLength = 0;\n\n  // default additional data is none\n  var additionalData;\n  if('additionalData' in options) {\n    additionalData = forge.util.createBuffer(options.additionalData);\n  } else {\n    additionalData = forge.util.createBuffer();\n  }\n\n  // default tag length is 128 bits\n  if('tagLength' in options) {\n    this._tagLength = options.tagLength;\n  } else {\n    this._tagLength = 128;\n  }\n\n  // if tag is given, ensure tag matches tag length\n  this._tag = null;\n  if(options.decrypt) {\n    // save tag to check later\n    this._tag = forge.util.createBuffer(options.tag).getBytes();\n    if(this._tag.length !== (this._tagLength / 8)) {\n      throw new Error('Authentication tag does not match tag length.');\n    }\n  }\n\n  // create tmp storage for hash calculation\n  this._hashBlock = new Array(this._ints);\n\n  // no tag generated yet\n  this.tag = null;\n\n  // generate hash subkey\n  // (apply block cipher to \"zero\" block)\n  this._hashSubkey = new Array(this._ints);\n  this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey);\n\n  // generate table M\n  // use 4-bit tables (32 component decomposition of a 16 byte value)\n  // 8-bit tables take more space and are known to have security\n  // vulnerabilities (in native implementations)\n  this.componentBits = 4;\n  this._m = this.generateHashTable(this._hashSubkey, this.componentBits);\n\n  // Note: support IV length different from 96 bits? (only supporting\n  // 96 bits is recommended by NIST SP-800-38D)\n  // generate J_0\n  var ivLength = iv.length();\n  if(ivLength === 12) {\n    // 96-bit IV\n    this._j0 = [iv.getInt32(), iv.getInt32(), iv.getInt32(), 1];\n  } else {\n    // IV is NOT 96-bits\n    this._j0 = [0, 0, 0, 0];\n    while(iv.length() > 0) {\n      this._j0 = this.ghash(\n        this._hashSubkey, this._j0,\n        [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()]);\n    }\n    this._j0 = this.ghash(\n      this._hashSubkey, this._j0, [0, 0].concat(from64To32(ivLength * 8)));\n  }\n\n  // generate ICB (initial counter block)\n  this._inBlock = this._j0.slice(0);\n  inc32(this._inBlock);\n  this._partialBytes = 0;\n\n  // consume authentication data\n  additionalData = forge.util.createBuffer(additionalData);\n  // save additional data length as a BE 64-bit number\n  this._aDataLength = from64To32(additionalData.length() * 8);\n  // pad additional data to 128 bit (16 byte) block size\n  var overflow = additionalData.length() % this.blockSize;\n  if(overflow) {\n    additionalData.fillWithByte(0, this.blockSize - overflow);\n  }\n  this._s = [0, 0, 0, 0];\n  while(additionalData.length() > 0) {\n    this._s = this.ghash(this._hashSubkey, this._s, [\n      additionalData.getInt32(),\n      additionalData.getInt32(),\n      additionalData.getInt32(),\n      additionalData.getInt32()\n    ]);\n  }\n};\n\nmodes.gcm.prototype.encrypt = function(input, output, finish) {\n  // not enough input to encrypt\n  var inputLength = input.length();\n  if(inputLength === 0) {\n    return true;\n  }\n\n  // encrypt block\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // handle full block\n  if(this._partialBytes === 0 && inputLength >= this.blockSize) {\n    // XOR input with output\n    for(var i = 0; i < this._ints; ++i) {\n      output.putInt32(this._outBlock[i] ^= input.getInt32());\n    }\n    this._cipherLength += this.blockSize;\n  } else {\n    // handle partial block\n    var partialBytes = (this.blockSize - inputLength) % this.blockSize;\n    if(partialBytes > 0) {\n      partialBytes = this.blockSize - partialBytes;\n    }\n\n    // XOR input with output\n    this._partialOutput.clear();\n    for(var i = 0; i < this._ints; ++i) {\n      this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]);\n    }\n\n    if(partialBytes === 0 || finish) {\n      // handle overflow prior to hashing\n      if(finish) {\n        // get block overflow\n        var overflow = inputLength % this.blockSize;\n        this._cipherLength += overflow;\n        // truncate for hash function\n        this._partialOutput.truncate(this.blockSize - overflow);\n      } else {\n        this._cipherLength += this.blockSize;\n      }\n\n      // get output block for hashing\n      for(var i = 0; i < this._ints; ++i) {\n        this._outBlock[i] = this._partialOutput.getInt32();\n      }\n      this._partialOutput.read -= this.blockSize;\n    }\n\n    // skip any previous partial bytes\n    if(this._partialBytes > 0) {\n      this._partialOutput.getBytes(this._partialBytes);\n    }\n\n    if(partialBytes > 0 && !finish) {\n      // block still incomplete, restore input buffer, get partial output,\n      // and return early\n      input.read -= this.blockSize;\n      output.putBytes(this._partialOutput.getBytes(\n        partialBytes - this._partialBytes));\n      this._partialBytes = partialBytes;\n      return true;\n    }\n\n    output.putBytes(this._partialOutput.getBytes(\n      inputLength - this._partialBytes));\n    this._partialBytes = 0;\n  }\n\n  // update hash block S\n  this._s = this.ghash(this._hashSubkey, this._s, this._outBlock);\n\n  // increment counter (input block)\n  inc32(this._inBlock);\n};\n\nmodes.gcm.prototype.decrypt = function(input, output, finish) {\n  // not enough input to decrypt\n  var inputLength = input.length();\n  if(inputLength < this.blockSize && !(finish && inputLength > 0)) {\n    return true;\n  }\n\n  // encrypt block (GCM always uses encryption mode)\n  this.cipher.encrypt(this._inBlock, this._outBlock);\n\n  // increment counter (input block)\n  inc32(this._inBlock);\n\n  // update hash block S\n  this._hashBlock[0] = input.getInt32();\n  this._hashBlock[1] = input.getInt32();\n  this._hashBlock[2] = input.getInt32();\n  this._hashBlock[3] = input.getInt32();\n  this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock);\n\n  // XOR hash input with output\n  for(var i = 0; i < this._ints; ++i) {\n    output.putInt32(this._outBlock[i] ^ this._hashBlock[i]);\n  }\n\n  // increment cipher data length\n  if(inputLength < this.blockSize) {\n    this._cipherLength += inputLength % this.blockSize;\n  } else {\n    this._cipherLength += this.blockSize;\n  }\n};\n\nmodes.gcm.prototype.afterFinish = function(output, options) {\n  var rval = true;\n\n  // handle overflow\n  if(options.decrypt && options.overflow) {\n    output.truncate(this.blockSize - options.overflow);\n  }\n\n  // handle authentication tag\n  this.tag = forge.util.createBuffer();\n\n  // concatenate additional data length with cipher length\n  var lengths = this._aDataLength.concat(from64To32(this._cipherLength * 8));\n\n  // include lengths in hash\n  this._s = this.ghash(this._hashSubkey, this._s, lengths);\n\n  // do GCTR(J_0, S)\n  var tag = [];\n  this.cipher.encrypt(this._j0, tag);\n  for(var i = 0; i < this._ints; ++i) {\n    this.tag.putInt32(this._s[i] ^ tag[i]);\n  }\n\n  // trim tag to length\n  this.tag.truncate(this.tag.length() % (this._tagLength / 8));\n\n  // check authentication tag\n  if(options.decrypt && this.tag.bytes() !== this._tag) {\n    rval = false;\n  }\n\n  return rval;\n};\n\n/**\n * See NIST SP-800-38D 6.3 (Algorithm 1). This function performs Galois\n * field multiplication. The field, GF(2^128), is defined by the polynomial:\n *\n * x^128 + x^7 + x^2 + x + 1\n *\n * Which is represented in little-endian binary form as: 11100001 (0xe1). When\n * the value of a coefficient is 1, a bit is set. The value R, is the\n * concatenation of this value and 120 zero bits, yielding a 128-bit value\n * which matches the block size.\n *\n * This function will multiply two elements (vectors of bytes), X and Y, in\n * the field GF(2^128). The result is initialized to zero. For each bit of\n * X (out of 128), x_i, if x_i is set, then the result is multiplied (XOR'd)\n * by the current value of Y. For each bit, the value of Y will be raised by\n * a power of x (multiplied by the polynomial x). This can be achieved by\n * shifting Y once to the right. If the current value of Y, prior to being\n * multiplied by x, has 0 as its LSB, then it is a 127th degree polynomial.\n * Otherwise, we must divide by R after shifting to find the remainder.\n *\n * @param x the first block to multiply by the second.\n * @param y the second block to multiply by the first.\n *\n * @return the block result of the multiplication.\n */\nmodes.gcm.prototype.multiply = function(x, y) {\n  var z_i = [0, 0, 0, 0];\n  var v_i = y.slice(0);\n\n  // calculate Z_128 (block has 128 bits)\n  for(var i = 0; i < 128; ++i) {\n    // if x_i is 0, Z_{i+1} = Z_i (unchanged)\n    // else Z_{i+1} = Z_i ^ V_i\n    // get x_i by finding 32-bit int position, then left shift 1 by remainder\n    var x_i = x[(i / 32) | 0] & (1 << (31 - i % 32));\n    if(x_i) {\n      z_i[0] ^= v_i[0];\n      z_i[1] ^= v_i[1];\n      z_i[2] ^= v_i[2];\n      z_i[3] ^= v_i[3];\n    }\n\n    // if LSB(V_i) is 1, V_i = V_i >> 1\n    // else V_i = (V_i >> 1) ^ R\n    this.pow(v_i, v_i);\n  }\n\n  return z_i;\n};\n\nmodes.gcm.prototype.pow = function(x, out) {\n  // if LSB(x) is 1, x = x >>> 1\n  // else x = (x >>> 1) ^ R\n  var lsb = x[3] & 1;\n\n  // always do x >>> 1:\n  // starting with the rightmost integer, shift each integer to the right\n  // one bit, pulling in the bit from the integer to the left as its top\n  // most bit (do this for the last 3 integers)\n  for(var i = 3; i > 0; --i) {\n    out[i] = (x[i] >>> 1) | ((x[i - 1] & 1) << 31);\n  }\n  // shift the first integer normally\n  out[0] = x[0] >>> 1;\n\n  // if lsb was not set, then polynomial had a degree of 127 and doesn't\n  // need to divided; otherwise, XOR with R to find the remainder; we only\n  // need to XOR the first integer since R technically ends w/120 zero bits\n  if(lsb) {\n    out[0] ^= this._R;\n  }\n};\n\nmodes.gcm.prototype.tableMultiply = function(x) {\n  // assumes 4-bit tables are used\n  var z = [0, 0, 0, 0];\n  for(var i = 0; i < 32; ++i) {\n    var idx = (i / 8) | 0;\n    var x_i = (x[idx] >>> ((7 - (i % 8)) * 4)) & 0xF;\n    var ah = this._m[i][x_i];\n    z[0] ^= ah[0];\n    z[1] ^= ah[1];\n    z[2] ^= ah[2];\n    z[3] ^= ah[3];\n  }\n  return z;\n};\n\n/**\n * A continuing version of the GHASH algorithm that operates on a single\n * block. The hash block, last hash value (Ym) and the new block to hash\n * are given.\n *\n * @param h the hash block.\n * @param y the previous value for Ym, use [0, 0, 0, 0] for a new hash.\n * @param x the block to hash.\n *\n * @return the hashed value (Ym).\n */\nmodes.gcm.prototype.ghash = function(h, y, x) {\n  y[0] ^= x[0];\n  y[1] ^= x[1];\n  y[2] ^= x[2];\n  y[3] ^= x[3];\n  return this.tableMultiply(y);\n  //return this.multiply(y, h);\n};\n\n/**\n * Precomputes a table for multiplying against the hash subkey. This\n * mechanism provides a substantial speed increase over multiplication\n * performed without a table. The table-based multiplication this table is\n * for solves X * H by multiplying each component of X by H and then\n * composing the results together using XOR.\n *\n * This function can be used to generate tables with different bit sizes\n * for the components, however, this implementation assumes there are\n * 32 components of X (which is a 16 byte vector), therefore each component\n * takes 4-bits (so the table is constructed with bits=4).\n *\n * @param h the hash subkey.\n * @param bits the bit size for a component.\n */\nmodes.gcm.prototype.generateHashTable = function(h, bits) {\n  // TODO: There are further optimizations that would use only the\n  // first table M_0 (or some variant) along with a remainder table;\n  // this can be explored in the future\n  var multiplier = 8 / bits;\n  var perInt = 4 * multiplier;\n  var size = 16 * multiplier;\n  var m = new Array(size);\n  for(var i = 0; i < size; ++i) {\n    var tmp = [0, 0, 0, 0];\n    var idx = (i / perInt) | 0;\n    var shft = ((perInt - 1 - (i % perInt)) * bits);\n    tmp[idx] = (1 << (bits - 1)) << shft;\n    m[i] = this.generateSubHashTable(this.multiply(tmp, h), bits);\n  }\n  return m;\n};\n\n/**\n * Generates a table for multiplying against the hash subkey for one\n * particular component (out of all possible component values).\n *\n * @param mid the pre-multiplied value for the middle key of the table.\n * @param bits the bit size for a component.\n */\nmodes.gcm.prototype.generateSubHashTable = function(mid, bits) {\n  // compute the table quickly by minimizing the number of\n  // POW operations -- they only need to be performed for powers of 2,\n  // all other entries can be composed from those powers using XOR\n  var size = 1 << bits;\n  var half = size >>> 1;\n  var m = new Array(size);\n  m[half] = mid.slice(0);\n  var i = half >>> 1;\n  while(i > 0) {\n    // raise m0[2 * i] and store in m0[i]\n    this.pow(m[2 * i], m[i] = []);\n    i >>= 1;\n  }\n  i = 2;\n  while(i < half) {\n    for(var j = 1; j < i; ++j) {\n      var m_i = m[i];\n      var m_j = m[j];\n      m[i + j] = [\n        m_i[0] ^ m_j[0],\n        m_i[1] ^ m_j[1],\n        m_i[2] ^ m_j[2],\n        m_i[3] ^ m_j[3]\n      ];\n    }\n    i *= 2;\n  }\n  m[0] = [0, 0, 0, 0];\n  /* Note: We could avoid storing these by doing composition during multiply\n  calculate top half using composition by speed is preferred. */\n  for(i = half + 1; i < size; ++i) {\n    var c = m[i ^ half];\n    m[i] = [mid[0] ^ c[0], mid[1] ^ c[1], mid[2] ^ c[2], mid[3] ^ c[3]];\n  }\n  return m;\n};\n\n/** Utility functions */\n\nfunction transformIV(iv) {\n  if(typeof iv === 'string') {\n    // convert iv string into byte buffer\n    iv = forge.util.createBuffer(iv);\n  }\n\n  if(forge.util.isArray(iv) && iv.length > 4) {\n    // convert iv byte array into byte buffer\n    var tmp = iv;\n    iv = forge.util.createBuffer();\n    for(var i = 0; i < tmp.length; ++i) {\n      iv.putByte(tmp[i]);\n    }\n  }\n  if(!forge.util.isArray(iv)) {\n    // convert iv byte buffer into 32-bit integer array\n    iv = [iv.getInt32(), iv.getInt32(), iv.getInt32(), iv.getInt32()];\n  }\n\n  return iv;\n}\n\nfunction inc32(block) {\n  // increment last 32 bits of block only\n  block[block.length - 1] = (block[block.length - 1] + 1) & 0xFFFFFFFF;\n}\n\nfunction from64To32(num) {\n  // convert 64-bit number to two BE Int32s\n  return [(num / 0x100000000) | 0, num & 0xFFFFFFFF];\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/cipherModes.js\n// module id = 481\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/cipherModes.js")},function(module,exports,__webpack_require__){eval("/**\n * Debugging support for web applications.\n *\n * @author David I. Lehn <dlehn@digitalbazaar.com>\n *\n * Copyright 2008-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n\n/* DEBUG API */\nmodule.exports = forge.debug = forge.debug || {};\n\n// Private storage for debugging.\n// Useful to expose data that is otherwise unviewable behind closures.\n// NOTE: remember that this can hold references to data and cause leaks!\n// format is \"forge._debug.<modulename>.<dataname> = data\"\n// Example:\n// (function() {\n//   var cat = 'forge.test.Test'; // debugging category\n//   var sState = {...}; // local state\n//   forge.debug.set(cat, 'sState', sState);\n// })();\nforge.debug.storage = {};\n\n/**\n * Gets debug data. Omit name for all cat data  Omit name and cat for\n * all data.\n *\n * @param cat name of debugging category.\n * @param name name of data to get (optional).\n * @return object with requested debug data or undefined.\n */\nforge.debug.get = function(cat, name) {\n  var rval;\n  if(typeof(cat) === 'undefined') {\n    rval = forge.debug.storage;\n  } else if(cat in forge.debug.storage) {\n    if(typeof(name) === 'undefined') {\n      rval = forge.debug.storage[cat];\n    } else {\n      rval = forge.debug.storage[cat][name];\n    }\n  }\n  return rval;\n};\n\n/**\n * Sets debug data.\n *\n * @param cat name of debugging category.\n * @param name name of data to set.\n * @param data data to set.\n */\nforge.debug.set = function(cat, name, data) {\n  if(!(cat in forge.debug.storage)) {\n    forge.debug.storage[cat] = {};\n  }\n  forge.debug.storage[cat][name] = data;\n};\n\n/**\n * Clears debug data. Omit name for all cat data. Omit name and cat for\n * all data.\n *\n * @param cat name of debugging category.\n * @param name name of data to clear or omit to clear entire category.\n */\nforge.debug.clear = function(cat, name) {\n  if(typeof(cat) === 'undefined') {\n    forge.debug.storage = {};\n  } else if(cat in forge.debug.storage) {\n    if(typeof(name) === 'undefined') {\n      delete forge.debug.storage[cat];\n    } else {\n      delete forge.debug.storage[cat][name];\n    }\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/debug.js\n// module id = 482\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/debug.js")},function(module,exports,__webpack_require__){eval("/**\n * Cross-browser support for logging in a web application.\n *\n * @author David I. Lehn <dlehn@digitalbazaar.com>\n *\n * Copyright (c) 2008-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\n/* LOG API */\nmodule.exports = forge.log = forge.log || {};\n\n/**\n * Application logging system.\n *\n * Each logger level available as it's own function of the form:\n *   forge.log.level(category, args...)\n * The category is an arbitrary string, and the args are the same as\n * Firebug's console.log API. By default the call will be output as:\n *   'LEVEL [category] <args[0]>, args[1], ...'\n * This enables proper % formatting via the first argument.\n * Each category is enabled by default but can be enabled or disabled with\n * the setCategoryEnabled() function.\n */\n// list of known levels\nforge.log.levels = [\n  'none', 'error', 'warning', 'info', 'debug', 'verbose', 'max'];\n// info on the levels indexed by name:\n//   index: level index\n//   name: uppercased display name\nvar sLevelInfo = {};\n// list of loggers\nvar sLoggers = [];\n/**\n * Standard console logger. If no console support is enabled this will\n * remain null. Check before using.\n */\nvar sConsoleLogger = null;\n\n// logger flags\n/**\n * Lock the level at the current value. Used in cases where user config may\n * set the level such that only critical messages are seen but more verbose\n * messages are needed for debugging or other purposes.\n */\nforge.log.LEVEL_LOCKED = (1 << 1);\n/**\n * Always call log function. By default, the logging system will check the\n * message level against logger.level before calling the log function. This\n * flag allows the function to do its own check.\n */\nforge.log.NO_LEVEL_CHECK = (1 << 2);\n/**\n * Perform message interpolation with the passed arguments. \"%\" style\n * fields in log messages will be replaced by arguments as needed. Some\n * loggers, such as Firebug, may do this automatically. The original log\n * message will be available as 'message' and the interpolated version will\n * be available as 'fullMessage'.\n */\nforge.log.INTERPOLATE = (1 << 3);\n\n// setup each log level\nfor(var i = 0; i < forge.log.levels.length; ++i) {\n  var level = forge.log.levels[i];\n  sLevelInfo[level] = {\n    index: i,\n    name: level.toUpperCase()\n  };\n}\n\n/**\n * Message logger. Will dispatch a message to registered loggers as needed.\n *\n * @param message message object\n */\nforge.log.logMessage = function(message) {\n  var messageLevelIndex = sLevelInfo[message.level].index;\n  for(var i = 0; i < sLoggers.length; ++i) {\n    var logger = sLoggers[i];\n    if(logger.flags & forge.log.NO_LEVEL_CHECK) {\n      logger.f(message);\n    } else {\n      // get logger level\n      var loggerLevelIndex = sLevelInfo[logger.level].index;\n      // check level\n      if(messageLevelIndex <= loggerLevelIndex) {\n        // message critical enough, call logger\n        logger.f(logger, message);\n      }\n    }\n  }\n};\n\n/**\n * Sets the 'standard' key on a message object to:\n * \"LEVEL [category] \" + message\n *\n * @param message a message log object\n */\nforge.log.prepareStandard = function(message) {\n  if(!('standard' in message)) {\n    message.standard =\n      sLevelInfo[message.level].name +\n      //' ' + +message.timestamp +\n      ' [' + message.category + '] ' +\n      message.message;\n  }\n};\n\n/**\n * Sets the 'full' key on a message object to the original message\n * interpolated via % formatting with the message arguments.\n *\n * @param message a message log object.\n */\nforge.log.prepareFull = function(message) {\n  if(!('full' in message)) {\n    // copy args and insert message at the front\n    var args = [message.message];\n    args = args.concat([] || message['arguments']);\n    // format the message\n    message.full = forge.util.format.apply(this, args);\n  }\n};\n\n/**\n * Applies both preparseStandard() and prepareFull() to a message object and\n * store result in 'standardFull'.\n *\n * @param message a message log object.\n */\nforge.log.prepareStandardFull = function(message) {\n  if(!('standardFull' in message)) {\n    // FIXME implement 'standardFull' logging\n    forge.log.prepareStandard(message);\n    message.standardFull = message.standard;\n  }\n};\n\n// create log level functions\nif(true) {\n  // levels for which we want functions\n  var levels = ['error', 'warning', 'info', 'debug', 'verbose'];\n  for(var i = 0; i < levels.length; ++i) {\n    // wrap in a function to ensure proper level var is passed\n    (function(level) {\n      // create function for this level\n      forge.log[level] = function(category, message/*, args...*/) {\n        // convert arguments to real array, remove category and message\n        var args = Array.prototype.slice.call(arguments).slice(2);\n        // create message object\n        // Note: interpolation and standard formatting is done lazily\n        var msg = {\n          timestamp: new Date(),\n          level: level,\n          category: category,\n          message: message,\n          'arguments': args\n          /*standard*/\n          /*full*/\n          /*fullMessage*/\n        };\n        // process this message\n        forge.log.logMessage(msg);\n      };\n    })(levels[i]);\n  }\n}\n\n/**\n * Creates a new logger with specified custom logging function.\n *\n * The logging function has a signature of:\n *   function(logger, message)\n * logger: current logger\n * message: object:\n *   level: level id\n *   category: category\n *   message: string message\n *   arguments: Array of extra arguments\n *   fullMessage: interpolated message and arguments if INTERPOLATE flag set\n *\n * @param logFunction a logging function which takes a log message object\n *          as a parameter.\n *\n * @return a logger object.\n */\nforge.log.makeLogger = function(logFunction) {\n  var logger = {\n    flags: 0,\n    f: logFunction\n  };\n  forge.log.setLevel(logger, 'none');\n  return logger;\n};\n\n/**\n * Sets the current log level on a logger.\n *\n * @param logger the target logger.\n * @param level the new maximum log level as a string.\n *\n * @return true if set, false if not.\n */\nforge.log.setLevel = function(logger, level) {\n  var rval = false;\n  if(logger && !(logger.flags & forge.log.LEVEL_LOCKED)) {\n    for(var i = 0; i < forge.log.levels.length; ++i) {\n      var aValidLevel = forge.log.levels[i];\n      if(level == aValidLevel) {\n        // set level\n        logger.level = level;\n        rval = true;\n        break;\n      }\n    }\n  }\n\n  return rval;\n};\n\n/**\n * Locks the log level at its current value.\n *\n * @param logger the target logger.\n * @param lock boolean lock value, default to true.\n */\nforge.log.lock = function(logger, lock) {\n  if(typeof lock === 'undefined' || lock) {\n    logger.flags |= forge.log.LEVEL_LOCKED;\n  } else {\n    logger.flags &= ~forge.log.LEVEL_LOCKED;\n  }\n};\n\n/**\n * Adds a logger.\n *\n * @param logger the logger object.\n */\nforge.log.addLogger = function(logger) {\n  sLoggers.push(logger);\n};\n\n// setup the console logger if possible, else create fake console.log\nif(typeof(console) !== 'undefined' && 'log' in console) {\n  var logger;\n  if(console.error && console.warn && console.info && console.debug) {\n    // looks like Firebug-style logging is available\n    // level handlers map\n    var levelHandlers = {\n      error: console.error,\n      warning: console.warn,\n      info: console.info,\n      debug: console.debug,\n      verbose: console.debug\n    };\n    var f = function(logger, message) {\n      forge.log.prepareStandard(message);\n      var handler = levelHandlers[message.level];\n      // prepend standard message and concat args\n      var args = [message.standard];\n      args = args.concat(message['arguments'].slice());\n      // apply to low-level console function\n      handler.apply(console, args);\n    };\n    logger = forge.log.makeLogger(f);\n  } else {\n    // only appear to have basic console.log\n    var f = function(logger, message) {\n      forge.log.prepareStandardFull(message);\n      console.log(message.standardFull);\n    };\n    logger = forge.log.makeLogger(f);\n  }\n  forge.log.setLevel(logger, 'debug');\n  forge.log.addLogger(logger);\n  sConsoleLogger = logger;\n} else {\n  // define fake console.log to avoid potential script errors on\n  // browsers that do not have console logging\n  console = {\n    log: function() {}\n  };\n}\n\n/*\n * Check for logging control query vars.\n *\n * console.level=<level-name>\n * Set's the console log level by name.  Useful to override defaults and\n * allow more verbose logging before a user config is loaded.\n *\n * console.lock=<true|false>\n * Lock the console log level at whatever level it is set at.  This is run\n * after console.level is processed.  Useful to force a level of verbosity\n * that could otherwise be limited by a user config.\n */\nif(sConsoleLogger !== null) {\n  var query = forge.util.getQueryVariables();\n  if('console.level' in query) {\n    // set with last value\n    forge.log.setLevel(\n      sConsoleLogger, query['console.level'].slice(-1)[0]);\n  }\n  if('console.lock' in query) {\n    // set with last value\n    var lock = query['console.lock'].slice(-1)[0];\n    if(lock == 'true') {\n      forge.log.lock(sConsoleLogger);\n    }\n  }\n}\n\n// provide public access to console logger\nforge.log.consoleLogger = sConsoleLogger;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/log.js\n// module id = 483\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/log.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of mask generation function MGF1.\n *\n * @author Stefan Siegl\n * @author Dave Longley\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n * Copyright (c) 2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\nforge.mgf = forge.mgf || {};\nvar mgf1 = module.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {};\n\n/**\n * Creates a MGF1 mask generation function object.\n *\n * @param md the message digest API to use (eg: forge.md.sha1.create()).\n *\n * @return a mask generation function object.\n */\nmgf1.create = function(md) {\n  var mgf = {\n    /**\n     * Generate mask of specified length.\n     *\n     * @param {String} seed The seed for mask generation.\n     * @param maskLen Number of bytes to generate.\n     * @return {String} The generated mask.\n     */\n    generate: function(seed, maskLen) {\n      /* 2. Let T be the empty octet string. */\n      var t = new forge.util.ByteBuffer();\n\n      /* 3. For counter from 0 to ceil(maskLen / hLen), do the following: */\n      var len = Math.ceil(maskLen / md.digestLength);\n      for(var i = 0; i < len; i++) {\n        /* a. Convert counter to an octet string C of length 4 octets */\n        var c = new forge.util.ByteBuffer();\n        c.putInt32(i);\n\n        /* b. Concatenate the hash of the seed mgfSeed and C to the octet\n         * string T: */\n        md.start();\n        md.update(seed + c.getBytes());\n        t.putBuffer(md.digest());\n      }\n\n      /* Output the leading maskLen octets of T as the octet string mask. */\n      t.truncate(t.length() - maskLen);\n      return t.getBytes();\n    }\n  };\n\n  return mgf;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/mgf1.js\n// module id = 484\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/mgf1.js")},function(module,exports,__webpack_require__){eval("/**\n * Password-based encryption functions.\n *\n * @author Dave Longley\n * @author Stefan Siegl <stesie@brokenpipe.de>\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * An EncryptedPrivateKeyInfo:\n *\n * EncryptedPrivateKeyInfo ::= SEQUENCE {\n *   encryptionAlgorithm  EncryptionAlgorithmIdentifier,\n *   encryptedData        EncryptedData }\n *\n * EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier\n *\n * EncryptedData ::= OCTET STRING\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(71);\n__webpack_require__(197);\n__webpack_require__(72);\n__webpack_require__(101);\n__webpack_require__(291);\n__webpack_require__(123);\n__webpack_require__(52);\n__webpack_require__(492);\n__webpack_require__(199);\n__webpack_require__(9);\n\nif(typeof BigInteger === 'undefined') {\n  var BigInteger = forge.jsbn.BigInteger;\n}\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/* Password-based encryption implementation. */\nvar pki = forge.pki = forge.pki || {};\nmodule.exports = pki.pbe = forge.pbe = forge.pbe || {};\nvar oids = pki.oids;\n\n// validator for an EncryptedPrivateKeyInfo structure\n// Note: Currently only works w/algorithm params\nvar encryptedPrivateKeyValidator = {\n  name: 'EncryptedPrivateKeyInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'EncryptedPrivateKeyInfo.encryptionAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'AlgorithmIdentifier.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'encryptionOid'\n    }, {\n      name: 'AlgorithmIdentifier.parameters',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      captureAsn1: 'encryptionParams'\n    }]\n  }, {\n    // encryptedData\n    name: 'EncryptedPrivateKeyInfo.encryptedData',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OCTETSTRING,\n    constructed: false,\n    capture: 'encryptedData'\n  }]\n};\n\n// validator for a PBES2Algorithms structure\n// Note: Currently only works w/PBKDF2 + AES encryption schemes\nvar PBES2AlgorithmsValidator = {\n  name: 'PBES2Algorithms',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'PBES2Algorithms.keyDerivationFunc',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'PBES2Algorithms.keyDerivationFunc.oid',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'kdfOid'\n    }, {\n      name: 'PBES2Algorithms.params',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      value: [{\n        name: 'PBES2Algorithms.params.salt',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OCTETSTRING,\n        constructed: false,\n        capture: 'kdfSalt'\n      }, {\n        name: 'PBES2Algorithms.params.iterationCount',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.INTEGER,\n        constructed: false,\n        capture: 'kdfIterationCount'\n      }, {\n        name: 'PBES2Algorithms.params.keyLength',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.INTEGER,\n        constructed: false,\n        optional: true,\n        capture: 'keyLength'\n      }, {\n        // prf\n        name: 'PBES2Algorithms.params.prf',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.SEQUENCE,\n        constructed: true,\n        optional: true,\n        value: [{\n          name: 'PBES2Algorithms.params.prf.algorithm',\n          tagClass: asn1.Class.UNIVERSAL,\n          type: asn1.Type.OID,\n          constructed: false,\n          capture: 'prfOid'\n        }]\n      }]\n    }]\n  }, {\n    name: 'PBES2Algorithms.encryptionScheme',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'PBES2Algorithms.encryptionScheme.oid',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'encOid'\n    }, {\n      name: 'PBES2Algorithms.encryptionScheme.iv',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OCTETSTRING,\n      constructed: false,\n      capture: 'encIv'\n    }]\n  }]\n};\n\nvar pkcs12PbeParamsValidator = {\n  name: 'pkcs-12PbeParams',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'pkcs-12PbeParams.salt',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OCTETSTRING,\n    constructed: false,\n    capture: 'salt'\n  }, {\n    name: 'pkcs-12PbeParams.iterations',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'iterations'\n  }]\n};\n\n/**\n * Encrypts a ASN.1 PrivateKeyInfo object, producing an EncryptedPrivateKeyInfo.\n *\n * PBES2Algorithms ALGORITHM-IDENTIFIER ::=\n *   { {PBES2-params IDENTIFIED BY id-PBES2}, ...}\n *\n * id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13}\n *\n * PBES2-params ::= SEQUENCE {\n *   keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},\n *   encryptionScheme AlgorithmIdentifier {{PBES2-Encs}}\n * }\n *\n * PBES2-KDFs ALGORITHM-IDENTIFIER ::=\n *   { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... }\n *\n * PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }\n *\n * PBKDF2-params ::= SEQUENCE {\n *   salt CHOICE {\n *     specified OCTET STRING,\n *     otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}\n *   },\n *   iterationCount INTEGER (1..MAX),\n *   keyLength INTEGER (1..MAX) OPTIONAL,\n *   prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1\n * }\n *\n * @param obj the ASN.1 PrivateKeyInfo object.\n * @param password the password to encrypt with.\n * @param options:\n *          algorithm the encryption algorithm to use\n *            ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'.\n *          count the iteration count to use.\n *          saltSize the salt size to use.\n *          prfAlgorithm the PRF message digest algorithm to use\n *            ('sha1', 'sha224', 'sha256', 'sha384', 'sha512')\n *\n * @return the ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptPrivateKeyInfo = function(obj, password, options) {\n  // set default options\n  options = options || {};\n  options.saltSize = options.saltSize || 8;\n  options.count = options.count || 2048;\n  options.algorithm = options.algorithm || 'aes128';\n  options.prfAlgorithm = options.prfAlgorithm || 'sha1';\n\n  // generate PBE params\n  var salt = forge.random.getBytesSync(options.saltSize);\n  var count = options.count;\n  var countBytes = asn1.integerToDer(count);\n  var dkLen;\n  var encryptionAlgorithm;\n  var encryptedData;\n  if(options.algorithm.indexOf('aes') === 0 || options.algorithm === 'des') {\n    // do PBES2\n    var ivLen, encOid, cipherFn;\n    switch(options.algorithm) {\n    case 'aes128':\n      dkLen = 16;\n      ivLen = 16;\n      encOid = oids['aes128-CBC'];\n      cipherFn = forge.aes.createEncryptionCipher;\n      break;\n    case 'aes192':\n      dkLen = 24;\n      ivLen = 16;\n      encOid = oids['aes192-CBC'];\n      cipherFn = forge.aes.createEncryptionCipher;\n      break;\n    case 'aes256':\n      dkLen = 32;\n      ivLen = 16;\n      encOid = oids['aes256-CBC'];\n      cipherFn = forge.aes.createEncryptionCipher;\n      break;\n    case 'des':\n      dkLen = 8;\n      ivLen = 8;\n      encOid = oids['desCBC'];\n      cipherFn = forge.des.createEncryptionCipher;\n      break;\n    default:\n      var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.');\n      error.algorithm = options.algorithm;\n      throw error;\n    }\n\n    // get PRF message digest\n    var prfAlgorithm = 'hmacWith' + options.prfAlgorithm.toUpperCase();\n    var md = prfAlgorithmToMessageDigest(prfAlgorithm);\n\n    // encrypt private key using pbe SHA-1 and AES/DES\n    var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md);\n    var iv = forge.random.getBytesSync(ivLen);\n    var cipher = cipherFn(dk);\n    cipher.start(iv);\n    cipher.update(asn1.toDer(obj));\n    cipher.finish();\n    encryptedData = cipher.output.getBytes();\n\n    // get PBKDF2-params\n    var params = createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm);\n\n    encryptionAlgorithm = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(oids['pkcs5PBES2']).getBytes()),\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // keyDerivationFunc\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(oids['pkcs5PBKDF2']).getBytes()),\n          // PBKDF2-params\n          params\n        ]),\n        // encryptionScheme\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(encOid).getBytes()),\n          // iv\n          asn1.create(\n            asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, iv)\n        ])\n      ])\n    ]);\n  } else if(options.algorithm === '3des') {\n    // Do PKCS12 PBE\n    dkLen = 24;\n\n    var saltBytes = new forge.util.ByteBuffer(salt);\n    var dk = pki.pbe.generatePkcs12Key(password, saltBytes, 1, count, dkLen);\n    var iv = pki.pbe.generatePkcs12Key(password, saltBytes, 2, count, dkLen);\n    var cipher = forge.des.createEncryptionCipher(dk);\n    cipher.start(iv);\n    cipher.update(asn1.toDer(obj));\n    cipher.finish();\n    encryptedData = cipher.output.getBytes();\n\n    encryptionAlgorithm = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(oids['pbeWithSHAAnd3-KeyTripleDES-CBC']).getBytes()),\n      // pkcs-12PbeParams\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // salt\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt),\n        // iteration count\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n          countBytes.getBytes())\n      ])\n    ]);\n  } else {\n    var error = new Error('Cannot encrypt private key. Unknown encryption algorithm.');\n    error.algorithm = options.algorithm;\n    throw error;\n  }\n\n  // EncryptedPrivateKeyInfo\n  var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // encryptionAlgorithm\n    encryptionAlgorithm,\n    // encryptedData\n    asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, encryptedData)\n  ]);\n  return rval;\n};\n\n/**\n * Decrypts a ASN.1 PrivateKeyInfo object.\n *\n * @param obj the ASN.1 EncryptedPrivateKeyInfo object.\n * @param password the password to decrypt with.\n *\n * @return the ASN.1 PrivateKeyInfo on success, null on failure.\n */\npki.decryptPrivateKeyInfo = function(obj, password) {\n  var rval = null;\n\n  // get PBE params\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, encryptedPrivateKeyValidator, capture, errors)) {\n    var error = new Error('Cannot read encrypted private key. ' +\n      'ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // get cipher\n  var oid = asn1.derToOid(capture.encryptionOid);\n  var cipher = pki.pbe.getCipher(oid, capture.encryptionParams, password);\n\n  // get encrypted data\n  var encrypted = forge.util.createBuffer(capture.encryptedData);\n\n  cipher.update(encrypted);\n  if(cipher.finish()) {\n    rval = asn1.fromDer(cipher.output);\n  }\n\n  return rval;\n};\n\n/**\n * Converts a EncryptedPrivateKeyInfo to PEM format.\n *\n * @param epki the EncryptedPrivateKeyInfo.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted encrypted private key.\n */\npki.encryptedPrivateKeyToPem = function(epki, maxline) {\n  // convert to DER, then PEM-encode\n  var msg = {\n    type: 'ENCRYPTED PRIVATE KEY',\n    body: asn1.toDer(epki).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Converts a PEM-encoded EncryptedPrivateKeyInfo to ASN.1 format. Decryption\n * is not performed.\n *\n * @param pem the EncryptedPrivateKeyInfo in PEM-format.\n *\n * @return the ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptedPrivateKeyFromPem = function(pem) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'ENCRYPTED PRIVATE KEY') {\n    var error = new Error('Could not convert encrypted private key from PEM; ' +\n      'PEM header type is \"ENCRYPTED PRIVATE KEY\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert encrypted private key from PEM; ' +\n      'PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  return asn1.fromDer(msg.body);\n};\n\n/**\n * Encrypts an RSA private key. By default, the key will be wrapped in\n * a PrivateKeyInfo and encrypted to produce a PKCS#8 EncryptedPrivateKeyInfo.\n * This is the standard, preferred way to encrypt a private key.\n *\n * To produce a non-standard PEM-encrypted private key that uses encapsulated\n * headers to indicate the encryption algorithm (old-style non-PKCS#8 OpenSSL\n * private key encryption), set the 'legacy' option to true. Note: Using this\n * option will cause the iteration count to be forced to 1.\n *\n * Note: The 'des' algorithm is supported, but it is not considered to be\n * secure because it only uses a single 56-bit key. If possible, it is highly\n * recommended that a different algorithm be used.\n *\n * @param rsaKey the RSA key to encrypt.\n * @param password the password to use.\n * @param options:\n *          algorithm: the encryption algorithm to use\n *            ('aes128', 'aes192', 'aes256', '3des', 'des').\n *          count: the iteration count to use.\n *          saltSize: the salt size to use.\n *          legacy: output an old non-PKCS#8 PEM-encrypted+encapsulated\n *            headers (DEK-Info) private key.\n *\n * @return the PEM-encoded ASN.1 EncryptedPrivateKeyInfo.\n */\npki.encryptRsaPrivateKey = function(rsaKey, password, options) {\n  // standard PKCS#8\n  options = options || {};\n  if(!options.legacy) {\n    // encrypt PrivateKeyInfo\n    var rval = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(rsaKey));\n    rval = pki.encryptPrivateKeyInfo(rval, password, options);\n    return pki.encryptedPrivateKeyToPem(rval);\n  }\n\n  // legacy non-PKCS#8\n  var algorithm;\n  var iv;\n  var dkLen;\n  var cipherFn;\n  switch(options.algorithm) {\n  case 'aes128':\n    algorithm = 'AES-128-CBC';\n    dkLen = 16;\n    iv = forge.random.getBytesSync(16);\n    cipherFn = forge.aes.createEncryptionCipher;\n    break;\n  case 'aes192':\n    algorithm = 'AES-192-CBC';\n    dkLen = 24;\n    iv = forge.random.getBytesSync(16);\n    cipherFn = forge.aes.createEncryptionCipher;\n    break;\n  case 'aes256':\n    algorithm = 'AES-256-CBC';\n    dkLen = 32;\n    iv = forge.random.getBytesSync(16);\n    cipherFn = forge.aes.createEncryptionCipher;\n    break;\n  case '3des':\n    algorithm = 'DES-EDE3-CBC';\n    dkLen = 24;\n    iv = forge.random.getBytesSync(8);\n    cipherFn = forge.des.createEncryptionCipher;\n    break;\n  case 'des':\n    algorithm = 'DES-CBC';\n    dkLen = 8;\n    iv = forge.random.getBytesSync(8);\n    cipherFn = forge.des.createEncryptionCipher;\n    break;\n  default:\n    var error = new Error('Could not encrypt RSA private key; unsupported ' +\n      'encryption algorithm \"' + options.algorithm + '\".');\n    error.algorithm = options.algorithm;\n    throw error;\n  }\n\n  // encrypt private key using OpenSSL legacy key derivation\n  var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen);\n  var cipher = cipherFn(dk);\n  cipher.start(iv);\n  cipher.update(asn1.toDer(pki.privateKeyToAsn1(rsaKey)));\n  cipher.finish();\n\n  var msg = {\n    type: 'RSA PRIVATE KEY',\n    procType: {\n      version: '4',\n      type: 'ENCRYPTED'\n    },\n    dekInfo: {\n      algorithm: algorithm,\n      parameters: forge.util.bytesToHex(iv).toUpperCase()\n    },\n    body: cipher.output.getBytes()\n  };\n  return forge.pem.encode(msg);\n};\n\n/**\n * Decrypts an RSA private key.\n *\n * @param pem the PEM-formatted EncryptedPrivateKeyInfo to decrypt.\n * @param password the password to use.\n *\n * @return the RSA key on success, null on failure.\n */\npki.decryptRsaPrivateKey = function(pem, password) {\n  var rval = null;\n\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'ENCRYPTED PRIVATE KEY' &&\n    msg.type !== 'PRIVATE KEY' &&\n    msg.type !== 'RSA PRIVATE KEY') {\n    var error = new Error('Could not convert private key from PEM; PEM header type ' +\n      'is not \"ENCRYPTED PRIVATE KEY\", \"PRIVATE KEY\", or \"RSA PRIVATE KEY\".');\n    error.headerType = error;\n    throw error;\n  }\n\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    var dkLen;\n    var cipherFn;\n    switch(msg.dekInfo.algorithm) {\n    case 'DES-CBC':\n      dkLen = 8;\n      cipherFn = forge.des.createDecryptionCipher;\n      break;\n    case 'DES-EDE3-CBC':\n      dkLen = 24;\n      cipherFn = forge.des.createDecryptionCipher;\n      break;\n    case 'AES-128-CBC':\n      dkLen = 16;\n      cipherFn = forge.aes.createDecryptionCipher;\n      break;\n    case 'AES-192-CBC':\n      dkLen = 24;\n      cipherFn = forge.aes.createDecryptionCipher;\n      break;\n    case 'AES-256-CBC':\n      dkLen = 32;\n      cipherFn = forge.aes.createDecryptionCipher;\n      break;\n    case 'RC2-40-CBC':\n      dkLen = 5;\n      cipherFn = function(key) {\n        return forge.rc2.createDecryptionCipher(key, 40);\n      };\n      break;\n    case 'RC2-64-CBC':\n      dkLen = 8;\n      cipherFn = function(key) {\n        return forge.rc2.createDecryptionCipher(key, 64);\n      };\n      break;\n    case 'RC2-128-CBC':\n      dkLen = 16;\n      cipherFn = function(key) {\n        return forge.rc2.createDecryptionCipher(key, 128);\n      };\n      break;\n    default:\n      var error = new Error('Could not decrypt private key; unsupported ' +\n        'encryption algorithm \"' + msg.dekInfo.algorithm + '\".');\n      error.algorithm = msg.dekInfo.algorithm;\n      throw error;\n    }\n\n    // use OpenSSL legacy key derivation\n    var iv = forge.util.hexToBytes(msg.dekInfo.parameters);\n    var dk = forge.pbe.opensslDeriveBytes(password, iv.substr(0, 8), dkLen);\n    var cipher = cipherFn(dk);\n    cipher.start(iv);\n    cipher.update(forge.util.createBuffer(msg.body));\n    if(cipher.finish()) {\n      rval = cipher.output.getBytes();\n    } else {\n      return rval;\n    }\n  } else {\n    rval = msg.body;\n  }\n\n  if(msg.type === 'ENCRYPTED PRIVATE KEY') {\n    rval = pki.decryptPrivateKeyInfo(asn1.fromDer(rval), password);\n  } else {\n    // decryption already performed above\n    rval = asn1.fromDer(rval);\n  }\n\n  if(rval !== null) {\n    rval = pki.privateKeyFromAsn1(rval);\n  }\n\n  return rval;\n};\n\n/**\n * Derives a PKCS#12 key.\n *\n * @param password the password to derive the key material from, null or\n *          undefined for none.\n * @param salt the salt, as a ByteBuffer, to use.\n * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC).\n * @param iter the iteration count.\n * @param n the number of bytes to derive from the password.\n * @param md the message digest to use, defaults to SHA-1.\n *\n * @return a ByteBuffer with the bytes derived from the password.\n */\npki.pbe.generatePkcs12Key = function(password, salt, id, iter, n, md) {\n  var j, l;\n\n  if(typeof md === 'undefined' || md === null) {\n    if(!('sha1' in forge.md)) {\n      throw new Error('\"sha1\" hash algorithm unavailable.');\n    }\n    md = forge.md.sha1.create();\n  }\n\n  var u = md.digestLength;\n  var v = md.blockLength;\n  var result = new forge.util.ByteBuffer();\n\n  /* Convert password to Unicode byte buffer + trailing 0-byte. */\n  var passBuf = new forge.util.ByteBuffer();\n  if(password !== null && password !== undefined) {\n    for(l = 0; l < password.length; l++) {\n      passBuf.putInt16(password.charCodeAt(l));\n    }\n    passBuf.putInt16(0);\n  }\n\n  /* Length of salt and password in BYTES. */\n  var p = passBuf.length();\n  var s = salt.length();\n\n  /* 1. Construct a string, D (the \"diversifier\"), by concatenating\n        v copies of ID. */\n  var D = new forge.util.ByteBuffer();\n  D.fillWithByte(id, v);\n\n  /* 2. Concatenate copies of the salt together to create a string S of length\n        v * ceil(s / v) bytes (the final copy of the salt may be trunacted\n        to create S).\n        Note that if the salt is the empty string, then so is S. */\n  var Slen = v * Math.ceil(s / v);\n  var S = new forge.util.ByteBuffer();\n  for(l = 0; l < Slen; l++) {\n    S.putByte(salt.at(l % s));\n  }\n\n  /* 3. Concatenate copies of the password together to create a string P of\n        length v * ceil(p / v) bytes (the final copy of the password may be\n        truncated to create P).\n        Note that if the password is the empty string, then so is P. */\n  var Plen = v * Math.ceil(p / v);\n  var P = new forge.util.ByteBuffer();\n  for(l = 0; l < Plen; l++) {\n    P.putByte(passBuf.at(l % p));\n  }\n\n  /* 4. Set I=S||P to be the concatenation of S and P. */\n  var I = S;\n  I.putBuffer(P);\n\n  /* 5. Set c=ceil(n / u). */\n  var c = Math.ceil(n / u);\n\n  /* 6. For i=1, 2, ..., c, do the following: */\n  for(var i = 1; i <= c; i++) {\n    /* a) Set Ai=H^r(D||I). (l.e. the rth hash of D||I, H(H(H(...H(D||I)))) */\n    var buf = new forge.util.ByteBuffer();\n    buf.putBytes(D.bytes());\n    buf.putBytes(I.bytes());\n    for(var round = 0; round < iter; round++) {\n      md.start();\n      md.update(buf.getBytes());\n      buf = md.digest();\n    }\n\n    /* b) Concatenate copies of Ai to create a string B of length v bytes (the\n          final copy of Ai may be truncated to create B). */\n    var B = new forge.util.ByteBuffer();\n    for(l = 0; l < v; l++) {\n      B.putByte(buf.at(l % u));\n    }\n\n    /* c) Treating I as a concatenation I0, I1, ..., Ik-1 of v-byte blocks,\n          where k=ceil(s / v) + ceil(p / v), modify I by setting\n          Ij=(Ij+B+1) mod 2v for each j.  */\n    var k = Math.ceil(s / v) + Math.ceil(p / v);\n    var Inew = new forge.util.ByteBuffer();\n    for(j = 0; j < k; j++) {\n      var chunk = new forge.util.ByteBuffer(I.getBytes(v));\n      var x = 0x1ff;\n      for(l = B.length() - 1; l >= 0; l--) {\n        x = x >> 8;\n        x += B.at(l) + chunk.at(l);\n        chunk.setAt(l, x & 0xff);\n      }\n      Inew.putBuffer(chunk);\n    }\n    I = Inew;\n\n    /* Add Ai to A. */\n    result.putBuffer(buf);\n  }\n\n  result.truncate(result.length() - n);\n  return result;\n};\n\n/**\n * Get new Forge cipher object instance.\n *\n * @param oid the OID (in string notation).\n * @param params the ASN.1 params object.\n * @param password the password to decrypt with.\n *\n * @return new cipher object instance.\n */\npki.pbe.getCipher = function(oid, params, password) {\n  switch(oid) {\n  case pki.oids['pkcs5PBES2']:\n    return pki.pbe.getCipherForPBES2(oid, params, password);\n\n  case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']:\n  case pki.oids['pbewithSHAAnd40BitRC2-CBC']:\n    return pki.pbe.getCipherForPKCS12PBE(oid, params, password);\n\n  default:\n    var error = new Error('Cannot read encrypted PBE data block. Unsupported OID.');\n    error.oid = oid;\n    error.supportedOids = [\n      'pkcs5PBES2',\n      'pbeWithSHAAnd3-KeyTripleDES-CBC',\n      'pbewithSHAAnd40BitRC2-CBC'\n    ];\n    throw error;\n  }\n};\n\n/**\n * Get new Forge cipher object instance according to PBES2 params block.\n *\n * The returned cipher instance is already started using the IV\n * from PBES2 parameter block.\n *\n * @param oid the PKCS#5 PBKDF2 OID (in string notation).\n * @param params the ASN.1 PBES2-params object.\n * @param password the password to decrypt with.\n *\n * @return new cipher object instance.\n */\npki.pbe.getCipherForPBES2 = function(oid, params, password) {\n  // get PBE params\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) {\n    var error = new Error('Cannot read password-based-encryption algorithm ' +\n      'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  // check oids\n  oid = asn1.derToOid(capture.kdfOid);\n  if(oid !== pki.oids['pkcs5PBKDF2']) {\n    var error = new Error('Cannot read encrypted private key. ' +\n      'Unsupported key derivation function OID.');\n    error.oid = oid;\n    error.supportedOids = ['pkcs5PBKDF2'];\n    throw error;\n  }\n  oid = asn1.derToOid(capture.encOid);\n  if(oid !== pki.oids['aes128-CBC'] &&\n    oid !== pki.oids['aes192-CBC'] &&\n    oid !== pki.oids['aes256-CBC'] &&\n    oid !== pki.oids['des-EDE3-CBC'] &&\n    oid !== pki.oids['desCBC']) {\n    var error = new Error('Cannot read encrypted private key. ' +\n      'Unsupported encryption scheme OID.');\n    error.oid = oid;\n    error.supportedOids = [\n      'aes128-CBC', 'aes192-CBC', 'aes256-CBC', 'des-EDE3-CBC', 'desCBC'];\n    throw error;\n  }\n\n  // set PBE params\n  var salt = capture.kdfSalt;\n  var count = forge.util.createBuffer(capture.kdfIterationCount);\n  count = count.getInt(count.length() << 3);\n  var dkLen;\n  var cipherFn;\n  switch(pki.oids[oid]) {\n  case 'aes128-CBC':\n    dkLen = 16;\n    cipherFn = forge.aes.createDecryptionCipher;\n    break;\n  case 'aes192-CBC':\n    dkLen = 24;\n    cipherFn = forge.aes.createDecryptionCipher;\n    break;\n  case 'aes256-CBC':\n    dkLen = 32;\n    cipherFn = forge.aes.createDecryptionCipher;\n    break;\n  case 'des-EDE3-CBC':\n    dkLen = 24;\n    cipherFn = forge.des.createDecryptionCipher;\n    break;\n  case 'desCBC':\n    dkLen = 8;\n    cipherFn = forge.des.createDecryptionCipher;\n    break;\n  }\n\n  // get PRF message digest\n  var md = prfOidToMessageDigest(capture.prfOid);\n\n  // decrypt private key using pbe with chosen PRF and AES/DES\n  var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md);\n  var iv = capture.encIv;\n  var cipher = cipherFn(dk);\n  cipher.start(iv);\n\n  return cipher;\n};\n\n/**\n * Get new Forge cipher object instance for PKCS#12 PBE.\n *\n * The returned cipher instance is already started using the key & IV\n * derived from the provided password and PKCS#12 PBE salt.\n *\n * @param oid The PKCS#12 PBE OID (in string notation).\n * @param params The ASN.1 PKCS#12 PBE-params object.\n * @param password The password to decrypt with.\n *\n * @return the new cipher object instance.\n */\npki.pbe.getCipherForPKCS12PBE = function(oid, params, password) {\n  // get PBE params\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(params, pkcs12PbeParamsValidator, capture, errors)) {\n    var error = new Error('Cannot read password-based-encryption algorithm ' +\n      'parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  var salt = forge.util.createBuffer(capture.salt);\n  var count = forge.util.createBuffer(capture.iterations);\n  count = count.getInt(count.length() << 3);\n\n  var dkLen, dIvLen, cipherFn;\n  switch(oid) {\n    case pki.oids['pbeWithSHAAnd3-KeyTripleDES-CBC']:\n      dkLen = 24;\n      dIvLen = 8;\n      cipherFn = forge.des.startDecrypting;\n      break;\n\n    case pki.oids['pbewithSHAAnd40BitRC2-CBC']:\n      dkLen = 5;\n      dIvLen = 8;\n      cipherFn = function(key, iv) {\n        var cipher = forge.rc2.createDecryptionCipher(key, 40);\n        cipher.start(iv, null);\n        return cipher;\n      };\n      break;\n\n    default:\n      var error = new Error('Cannot read PKCS #12 PBE data block. Unsupported OID.');\n      error.oid = oid;\n      throw error;\n  }\n\n  // get PRF message digest\n  var md = prfOidToMessageDigest(capture.prfOid);\n  var key = pki.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md);\n  md.start();\n  var iv = pki.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md);\n\n  return cipherFn(key, iv);\n};\n\n/**\n * OpenSSL's legacy key derivation function.\n *\n * See: http://www.openssl.org/docs/crypto/EVP_BytesToKey.html\n *\n * @param password the password to derive the key from.\n * @param salt the salt to use, null for none.\n * @param dkLen the number of bytes needed for the derived key.\n * @param [options] the options to use:\n *          [md] an optional message digest object to use.\n */\npki.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) {\n  if(typeof md === 'undefined' || md === null) {\n    if(!('md5' in forge.md)) {\n      throw new Error('\"md5\" hash algorithm unavailable.');\n    }\n    md = forge.md.md5.create();\n  }\n  if(salt === null) {\n    salt = '';\n  }\n  var digests = [hash(md, password + salt)];\n  for(var length = 16, i = 1; length < dkLen; ++i, length += 16) {\n    digests.push(hash(md, digests[i - 1] + password + salt));\n  }\n  return digests.join('').substr(0, dkLen);\n};\n\nfunction hash(md, bytes) {\n  return md.start().update(bytes).digest().getBytes();\n}\n\nfunction prfOidToMessageDigest(prfOid) {\n  // get PRF algorithm, default to SHA-1\n  var prfAlgorithm;\n  if(!prfOid) {\n    prfAlgorithm = 'hmacWithSHA1';\n  } else {\n    prfAlgorithm = pki.oids[asn1.derToOid(prfOid)];\n    if(!prfAlgorithm) {\n      var error = new Error('Unsupported PRF OID.');\n      error.oid = prfOid;\n      error.supported = [\n        'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384',\n        'hmacWithSHA512'];\n      throw error;\n    }\n  }\n  return prfAlgorithmToMessageDigest(prfAlgorithm);\n}\n\nfunction prfAlgorithmToMessageDigest(prfAlgorithm) {\n  var factory = forge.md;\n  switch(prfAlgorithm) {\n  case 'hmacWithSHA224':\n    factory = forge.md.sha512;\n  case 'hmacWithSHA1':\n  case 'hmacWithSHA256':\n  case 'hmacWithSHA384':\n  case 'hmacWithSHA512':\n    prfAlgorithm = prfAlgorithm.substr(8).toLowerCase();\n    break;\n  default:\n    var error = new Error('Unsupported PRF algorithm.');\n    error.algorithm = prfAlgorithm;\n    error.supported = [\n      'hmacWithSHA1', 'hmacWithSHA224', 'hmacWithSHA256', 'hmacWithSHA384',\n      'hmacWithSHA512'];\n    throw error;\n  }\n  if(!factory || !(prfAlgorithm in factory)) {\n    throw new Error('Unknown hash algorithm: ' + prfAlgorithm);\n  }\n  return factory[prfAlgorithm].create();\n}\n\nfunction createPbkdf2Params(salt, countBytes, dkLen, prfAlgorithm) {\n  var params = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // salt\n    asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, salt),\n    // iteration count\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      countBytes.getBytes())\n  ]);\n  // when PRF algorithm is not SHA-1 default, add key length and PRF algorithm\n  if(prfAlgorithm !== 'hmacWithSHA1') {\n    params.value.push(\n      // key length\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        forge.util.hexToBytes(dkLen.toString(16))),\n      // AlgorithmIdentifier\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // algorithm\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids[prfAlgorithm]).getBytes()),\n        // parameters (null)\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n      ]));\n  }\n  return params;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pbe.js\n// module id = 485\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pbe.js")},function(module,exports,__webpack_require__){eval("/**\n * Partial implementation of PKCS#1 v2.2: RSA-OEAP\n *\n * Modified but based on the following MIT and BSD licensed code:\n *\n * https://github.com/kjur/jsjws/blob/master/rsa.js:\n *\n * The 'jsjws'(JSON Web Signature JavaScript Library) License\n *\n * Copyright (c) 2012 Kenji Urushima\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *\n * http://webrsa.cvs.sourceforge.net/viewvc/webrsa/Client/RSAES-OAEP.js?content-type=text%2Fplain:\n *\n * RSAES-OAEP.js\n * $Id: RSAES-OAEP.js,v 1.1.1.1 2003/03/19 15:37:20 ellispritchard Exp $\n * JavaScript Implementation of PKCS #1 v2.1 RSA CRYPTOGRAPHY STANDARD (RSA Laboratories, June 14, 2002)\n * Copyright (C) Ellis Pritchard, Guardian Unlimited 2003.\n * Contact: ellis@nukinetics.com\n * Distributed under the BSD License.\n *\n * Official documentation: http://www.rsa.com/rsalabs/node.asp?id=2125\n *\n * @author Evan Jones (http://evanjones.ca/)\n * @author Dave Longley\n *\n * Copyright (c) 2013-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n__webpack_require__(52);\n__webpack_require__(150);\n\n// shortcut for PKCS#1 API\nvar pkcs1 = module.exports = forge.pkcs1 = forge.pkcs1 || {};\n\n/**\n * Encode the given RSAES-OAEP message (M) using key, with optional label (L)\n * and seed.\n *\n * This method does not perform RSA encryption, it only encodes the message\n * using RSAES-OAEP.\n *\n * @param key the RSA key to use.\n * @param message the message to encode.\n * @param options the options to use:\n *          label an optional label to use.\n *          seed the seed to use.\n *          md the message digest object to use, undefined for SHA-1.\n *          mgf1 optional mgf1 parameters:\n *            md the message digest object to use for MGF1.\n *\n * @return the encoded message bytes.\n */\npkcs1.encode_rsa_oaep = function(key, message, options) {\n  // parse arguments\n  var label;\n  var seed;\n  var md;\n  var mgf1Md;\n  // legacy args (label, seed, md)\n  if(typeof options === 'string') {\n    label = options;\n    seed = arguments[3] || undefined;\n    md = arguments[4] || undefined;\n  } else if(options) {\n    label = options.label || undefined;\n    seed = options.seed || undefined;\n    md = options.md || undefined;\n    if(options.mgf1 && options.mgf1.md) {\n      mgf1Md = options.mgf1.md;\n    }\n  }\n\n  // default OAEP to SHA-1 message digest\n  if(!md) {\n    md = forge.md.sha1.create();\n  } else {\n    md.start();\n  }\n\n  // default MGF-1 to same as OAEP\n  if(!mgf1Md) {\n    mgf1Md = md;\n  }\n\n  // compute length in bytes and check output\n  var keyLength = Math.ceil(key.n.bitLength() / 8);\n  var maxLength = keyLength - 2 * md.digestLength - 2;\n  if(message.length > maxLength) {\n    var error = new Error('RSAES-OAEP input message length is too long.');\n    error.length = message.length;\n    error.maxLength = maxLength;\n    throw error;\n  }\n\n  if(!label) {\n    label = '';\n  }\n  md.update(label, 'raw');\n  var lHash = md.digest();\n\n  var PS = '';\n  var PS_length = maxLength - message.length;\n  for (var i = 0; i < PS_length; i++) {\n    PS += '\\x00';\n  }\n\n  var DB = lHash.getBytes() + PS + '\\x01' + message;\n\n  if(!seed) {\n    seed = forge.random.getBytes(md.digestLength);\n  } else if(seed.length !== md.digestLength) {\n    var error = new Error('Invalid RSAES-OAEP seed. The seed length must ' +\n      'match the digest length.');\n    error.seedLength = seed.length;\n    error.digestLength = md.digestLength;\n    throw error;\n  }\n\n  var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md);\n  var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length);\n\n  var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md);\n  var maskedSeed = forge.util.xorBytes(seed, seedMask, seed.length);\n\n  // return encoded message\n  return '\\x00' + maskedSeed + maskedDB;\n};\n\n/**\n * Decode the given RSAES-OAEP encoded message (EM) using key, with optional\n * label (L).\n *\n * This method does not perform RSA decryption, it only decodes the message\n * using RSAES-OAEP.\n *\n * @param key the RSA key to use.\n * @param em the encoded message to decode.\n * @param options the options to use:\n *          label an optional label to use.\n *          md the message digest object to use for OAEP, undefined for SHA-1.\n *          mgf1 optional mgf1 parameters:\n *            md the message digest object to use for MGF1.\n *\n * @return the decoded message bytes.\n */\npkcs1.decode_rsa_oaep = function(key, em, options) {\n  // parse args\n  var label;\n  var md;\n  var mgf1Md;\n  // legacy args\n  if(typeof options === 'string') {\n    label = options;\n    md = arguments[3] || undefined;\n  } else if(options) {\n    label = options.label || undefined;\n    md = options.md || undefined;\n    if(options.mgf1 && options.mgf1.md) {\n      mgf1Md = options.mgf1.md;\n    }\n  }\n\n  // compute length in bytes\n  var keyLength = Math.ceil(key.n.bitLength() / 8);\n\n  if(em.length !== keyLength) {\n    var error = new Error('RSAES-OAEP encoded message length is invalid.');\n    error.length = em.length;\n    error.expectedLength = keyLength;\n    throw error;\n  }\n\n  // default OAEP to SHA-1 message digest\n  if(md === undefined) {\n    md = forge.md.sha1.create();\n  } else {\n    md.start();\n  }\n\n  // default MGF-1 to same as OAEP\n  if(!mgf1Md) {\n    mgf1Md = md;\n  }\n\n  if(keyLength < 2 * md.digestLength + 2) {\n    throw new Error('RSAES-OAEP key is too short for the hash function.');\n  }\n\n  if(!label) {\n    label = '';\n  }\n  md.update(label, 'raw');\n  var lHash = md.digest().getBytes();\n\n  // split the message into its parts\n  var y = em.charAt(0);\n  var maskedSeed = em.substring(1, md.digestLength + 1);\n  var maskedDB = em.substring(1 + md.digestLength);\n\n  var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md);\n  var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length);\n\n  var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md);\n  var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length);\n\n  var lHashPrime = db.substring(0, md.digestLength);\n\n  // constant time check that all values match what is expected\n  var error = (y !== '\\x00');\n\n  // constant time check lHash vs lHashPrime\n  for(var i = 0; i < md.digestLength; ++i) {\n    error |= (lHash.charAt(i) !== lHashPrime.charAt(i));\n  }\n\n  // \"constant time\" find the 0x1 byte separating the padding (zeros) from the\n  // message\n  // TODO: It must be possible to do this in a better/smarter way?\n  var in_ps = 1;\n  var index = md.digestLength;\n  for(var j = md.digestLength; j < db.length; j++) {\n    var code = db.charCodeAt(j);\n\n    var is_0 = (code & 0x1) ^ 0x1;\n\n    // non-zero if not 0 or 1 in the ps section\n    var error_mask = in_ps ? 0xfffe : 0x0000;\n    error |= (code & error_mask);\n\n    // latch in_ps to zero after we find 0x1\n    in_ps = in_ps & is_0;\n    index += in_ps;\n  }\n\n  if(error || db.charCodeAt(index) !== 0x1) {\n    throw new Error('Invalid RSAES-OAEP padding.');\n  }\n\n  return db.substring(index + 1);\n};\n\nfunction rsa_mgf1(seed, maskLength, hash) {\n  // default to SHA-1 message digest\n  if(!hash) {\n    hash = forge.md.sha1.create();\n  }\n  var t = '';\n  var count = Math.ceil(maskLength / hash.digestLength);\n  for(var i = 0; i < count; ++i) {\n    var c = String.fromCharCode(\n      (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF);\n    hash.start();\n    hash.update(seed + c);\n    t += hash.digest().getBytes();\n  }\n  return t.substring(0, maskLength);\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pkcs1.js\n// module id = 486\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pkcs1.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of PKCS#12.\n *\n * @author Dave Longley\n * @author Stefan Siegl <stesie@brokenpipe.de>\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * The ASN.1 representation of PKCS#12 is as follows\n * (see ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12-tc1.pdf for details)\n *\n * PFX ::= SEQUENCE {\n *   version  INTEGER {v3(3)}(v3,...),\n *   authSafe ContentInfo,\n *   macData  MacData OPTIONAL\n * }\n *\n * MacData ::= SEQUENCE {\n *   mac DigestInfo,\n *   macSalt OCTET STRING,\n *   iterations INTEGER DEFAULT 1\n * }\n * Note: The iterations default is for historical reasons and its use is\n * deprecated. A higher value, like 1024, is recommended.\n *\n * DigestInfo is defined in PKCS#7 as follows:\n *\n * DigestInfo ::= SEQUENCE {\n *   digestAlgorithm DigestAlgorithmIdentifier,\n *   digest Digest\n * }\n *\n * DigestAlgorithmIdentifier ::= AlgorithmIdentifier\n *\n * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters\n * for the algorithm, if any. In the case of SHA1 there is none.\n *\n * AlgorithmIdentifer ::= SEQUENCE {\n *    algorithm OBJECT IDENTIFIER,\n *    parameters ANY DEFINED BY algorithm OPTIONAL\n * }\n *\n * Digest ::= OCTET STRING\n *\n *\n * ContentInfo ::= SEQUENCE {\n *   contentType ContentType,\n *   content     [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL\n * }\n *\n * ContentType ::= OBJECT IDENTIFIER\n *\n * AuthenticatedSafe ::= SEQUENCE OF ContentInfo\n * -- Data if unencrypted\n * -- EncryptedData if password-encrypted\n * -- EnvelopedData if public key-encrypted\n *\n *\n * SafeContents ::= SEQUENCE OF SafeBag\n *\n * SafeBag ::= SEQUENCE {\n *   bagId     BAG-TYPE.&id ({PKCS12BagSet})\n *   bagValue  [0] EXPLICIT BAG-TYPE.&Type({PKCS12BagSet}{@bagId}),\n *   bagAttributes SET OF PKCS12Attribute OPTIONAL\n * }\n *\n * PKCS12Attribute ::= SEQUENCE {\n *   attrId ATTRIBUTE.&id ({PKCS12AttrSet}),\n *   attrValues SET OF ATTRIBUTE.&Type ({PKCS12AttrSet}{@attrId})\n * } -- This type is compatible with the X.500 type ’Attribute’\n *\n * PKCS12AttrSet ATTRIBUTE ::= {\n *   friendlyName | -- from PKCS #9\n *   localKeyId, -- from PKCS #9\n *   ... -- Other attributes are allowed\n * }\n *\n * CertBag ::= SEQUENCE {\n *   certId    BAG-TYPE.&id   ({CertTypes}),\n *   certValue [0] EXPLICIT BAG-TYPE.&Type ({CertTypes}{@certId})\n * }\n *\n * x509Certificate BAG-TYPE ::= {OCTET STRING IDENTIFIED BY {certTypes 1}}\n *   -- DER-encoded X.509 certificate stored in OCTET STRING\n *\n * sdsiCertificate BAG-TYPE ::= {IA5String IDENTIFIED BY {certTypes 2}}\n * -- Base64-encoded SDSI certificate stored in IA5String\n *\n * CertTypes BAG-TYPE ::= {\n *   x509Certificate |\n *   sdsiCertificate,\n *   ... -- For future extensions\n * }\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(71);\n__webpack_require__(148);\n__webpack_require__(101);\n__webpack_require__(488);\n__webpack_require__(485);\n__webpack_require__(52);\n__webpack_require__(199);\n__webpack_require__(150);\n__webpack_require__(9);\n__webpack_require__(293);\n\n// shortcut for asn.1 & PKI API\nvar asn1 = forge.asn1;\nvar pki = forge.pki;\n\n// shortcut for PKCS#12 API\nvar p12 = module.exports = forge.pkcs12 = forge.pkcs12 || {};\n\nvar contentInfoValidator = {\n  name: 'ContentInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,  // a ContentInfo\n  constructed: true,\n  value: [{\n    name: 'ContentInfo.contentType',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'contentType'\n  }, {\n    name: 'ContentInfo.content',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    constructed: true,\n    captureAsn1: 'content'\n  }]\n};\n\nvar pfxValidator = {\n  name: 'PFX',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'PFX.version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'version'\n  },\n  contentInfoValidator, {\n    name: 'PFX.macData',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    optional: true,\n    captureAsn1: 'mac',\n    value: [{\n      name: 'PFX.macData.mac',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,  // DigestInfo\n      constructed: true,\n      value: [{\n        name: 'PFX.macData.mac.digestAlgorithm',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.SEQUENCE,  // DigestAlgorithmIdentifier\n        constructed: true,\n        value: [{\n          name: 'PFX.macData.mac.digestAlgorithm.algorithm',\n          tagClass: asn1.Class.UNIVERSAL,\n          type: asn1.Type.OID,\n          constructed: false,\n          capture: 'macAlgorithm'\n        }, {\n          name: 'PFX.macData.mac.digestAlgorithm.parameters',\n          tagClass: asn1.Class.UNIVERSAL,\n          captureAsn1: 'macAlgorithmParameters'\n        }]\n      }, {\n        name: 'PFX.macData.mac.digest',\n        tagClass: asn1.Class.UNIVERSAL,\n        type: asn1.Type.OCTETSTRING,\n        constructed: false,\n        capture: 'macDigest'\n      }]\n    }, {\n      name: 'PFX.macData.macSalt',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OCTETSTRING,\n      constructed: false,\n      capture: 'macSalt'\n    }, {\n      name: 'PFX.macData.iterations',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.INTEGER,\n      constructed: false,\n      optional: true,\n      capture: 'macIterations'\n    }]\n  }]\n};\n\nvar safeBagValidator = {\n  name: 'SafeBag',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'SafeBag.bagId',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'bagId'\n  }, {\n    name: 'SafeBag.bagValue',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    constructed: true,\n    captureAsn1: 'bagValue'\n  }, {\n    name: 'SafeBag.bagAttributes',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SET,\n    constructed: true,\n    optional: true,\n    capture: 'bagAttributes'\n  }]\n};\n\nvar attributeValidator = {\n  name: 'Attribute',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'Attribute.attrId',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'oid'\n  }, {\n    name: 'Attribute.attrValues',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SET,\n    constructed: true,\n    capture: 'values'\n  }]\n};\n\nvar certBagValidator = {\n  name: 'CertBag',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'CertBag.certId',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'certId'\n  }, {\n    name: 'CertBag.certValue',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    constructed: true,\n    /* So far we only support X.509 certificates (which are wrapped in\n       an OCTET STRING, hence hard code that here). */\n    value: [{\n      name: 'CertBag.certValue[0]',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Class.OCTETSTRING,\n      constructed: false,\n      capture: 'cert'\n    }]\n  }]\n};\n\n/**\n * Search SafeContents structure for bags with matching attributes.\n *\n * The search can optionally be narrowed by a certain bag type.\n *\n * @param safeContents the SafeContents structure to search in.\n * @param attrName the name of the attribute to compare against.\n * @param attrValue the attribute value to search for.\n * @param [bagType] bag type to narrow search by.\n *\n * @return an array of matching bags.\n */\nfunction _getBagsByAttribute(safeContents, attrName, attrValue, bagType) {\n  var result = [];\n\n  for(var i = 0; i < safeContents.length; i++) {\n    for(var j = 0; j < safeContents[i].safeBags.length; j++) {\n      var bag = safeContents[i].safeBags[j];\n      if(bagType !== undefined && bag.type !== bagType) {\n        continue;\n      }\n      // only filter by bag type, no attribute specified\n      if(attrName === null) {\n        result.push(bag);\n        continue;\n      }\n      if(bag.attributes[attrName] !== undefined &&\n        bag.attributes[attrName].indexOf(attrValue) >= 0) {\n        result.push(bag);\n      }\n    }\n  }\n\n  return result;\n}\n\n/**\n * Converts a PKCS#12 PFX in ASN.1 notation into a PFX object.\n *\n * @param obj The PKCS#12 PFX in ASN.1 notation.\n * @param strict true to use strict DER decoding, false not to (default: true).\n * @param {String} password Password to decrypt with (optional).\n *\n * @return PKCS#12 PFX object.\n */\np12.pkcs12FromAsn1 = function(obj, strict, password) {\n  // handle args\n  if(typeof strict === 'string') {\n    password = strict;\n    strict = true;\n  } else if(strict === undefined) {\n    strict = true;\n  }\n\n  // validate PFX and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, pfxValidator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#12 PFX. ' +\n      'ASN.1 object is not an PKCS#12 PFX.');\n    error.errors = error;\n    throw error;\n  }\n\n  var pfx = {\n    version: capture.version.charCodeAt(0),\n    safeContents: [],\n\n    /**\n     * Gets bags with matching attributes.\n     *\n     * @param filter the attributes to filter by:\n     *          [localKeyId] the localKeyId to search for.\n     *          [localKeyIdHex] the localKeyId in hex to search for.\n     *          [friendlyName] the friendly name to search for.\n     *          [bagType] bag type to narrow each attribute search by.\n     *\n     * @return a map of attribute type to an array of matching bags or, if no\n     *           attribute was given but a bag type, the map key will be the\n     *           bag type.\n     */\n    getBags: function(filter) {\n      var rval = {};\n\n      var localKeyId;\n      if('localKeyId' in filter) {\n        localKeyId = filter.localKeyId;\n      } else if('localKeyIdHex' in filter) {\n        localKeyId = forge.util.hexToBytes(filter.localKeyIdHex);\n      }\n\n      // filter on bagType only\n      if(localKeyId === undefined && !('friendlyName' in filter) &&\n        'bagType' in filter) {\n        rval[filter.bagType] = _getBagsByAttribute(\n          pfx.safeContents, null, null, filter.bagType);\n      }\n\n      if(localKeyId !== undefined) {\n        rval.localKeyId = _getBagsByAttribute(\n          pfx.safeContents, 'localKeyId',\n          localKeyId, filter.bagType);\n      }\n      if('friendlyName' in filter) {\n        rval.friendlyName = _getBagsByAttribute(\n          pfx.safeContents, 'friendlyName',\n          filter.friendlyName, filter.bagType);\n      }\n\n      return rval;\n    },\n\n    /**\n     * DEPRECATED: use getBags() instead.\n     *\n     * Get bags with matching friendlyName attribute.\n     *\n     * @param friendlyName the friendly name to search for.\n     * @param [bagType] bag type to narrow search by.\n     *\n     * @return an array of bags with matching friendlyName attribute.\n     */\n    getBagsByFriendlyName: function(friendlyName, bagType) {\n      return _getBagsByAttribute(\n        pfx.safeContents, 'friendlyName', friendlyName, bagType);\n    },\n\n    /**\n     * DEPRECATED: use getBags() instead.\n     *\n     * Get bags with matching localKeyId attribute.\n     *\n     * @param localKeyId the localKeyId to search for.\n     * @param [bagType] bag type to narrow search by.\n     *\n     * @return an array of bags with matching localKeyId attribute.\n     */\n    getBagsByLocalKeyId: function(localKeyId, bagType) {\n      return _getBagsByAttribute(\n        pfx.safeContents, 'localKeyId', localKeyId, bagType);\n    }\n  };\n\n  if(capture.version.charCodeAt(0) !== 3) {\n    var error = new Error('PKCS#12 PFX of version other than 3 not supported.');\n    error.version = capture.version.charCodeAt(0);\n    throw error;\n  }\n\n  if(asn1.derToOid(capture.contentType) !== pki.oids.data) {\n    var error = new Error('Only PKCS#12 PFX in password integrity mode supported.');\n    error.oid = asn1.derToOid(capture.contentType);\n    throw error;\n  }\n\n  var data = capture.content.value[0];\n  if(data.tagClass !== asn1.Class.UNIVERSAL ||\n     data.type !== asn1.Type.OCTETSTRING) {\n    throw new Error('PKCS#12 authSafe content data is not an OCTET STRING.');\n  }\n  data = _decodePkcs7Data(data);\n\n  // check for MAC\n  if(capture.mac) {\n    var md = null;\n    var macKeyBytes = 0;\n    var macAlgorithm = asn1.derToOid(capture.macAlgorithm);\n    switch(macAlgorithm) {\n    case pki.oids.sha1:\n      md = forge.md.sha1.create();\n      macKeyBytes = 20;\n      break;\n    case pki.oids.sha256:\n      md = forge.md.sha256.create();\n      macKeyBytes = 32;\n      break;\n    case pki.oids.sha384:\n      md = forge.md.sha384.create();\n      macKeyBytes = 48;\n      break;\n    case pki.oids.sha512:\n      md = forge.md.sha512.create();\n      macKeyBytes = 64;\n      break;\n    case pki.oids.md5:\n      md = forge.md.md5.create();\n      macKeyBytes = 16;\n      break;\n    }\n    if(md === null) {\n      throw new Error('PKCS#12 uses unsupported MAC algorithm: ' + macAlgorithm);\n    }\n\n    // verify MAC (iterations default to 1)\n    var macSalt = new forge.util.ByteBuffer(capture.macSalt);\n    var macIterations = (('macIterations' in capture) ?\n      parseInt(forge.util.bytesToHex(capture.macIterations), 16) : 1);\n    var macKey = p12.generateKey(\n      password, macSalt, 3, macIterations, macKeyBytes, md);\n    var mac = forge.hmac.create();\n    mac.start(md, macKey);\n    mac.update(data.value);\n    var macValue = mac.getMac();\n    if(macValue.getBytes() !== capture.macDigest) {\n      throw new Error('PKCS#12 MAC could not be verified. Invalid password?');\n    }\n  }\n\n  _decodeAuthenticatedSafe(pfx, data.value, strict, password);\n  return pfx;\n};\n\n/**\n * Decodes PKCS#7 Data. PKCS#7 (RFC 2315) defines \"Data\" as an OCTET STRING,\n * but it is sometimes an OCTET STRING that is composed/constructed of chunks,\n * each its own OCTET STRING. This is BER-encoding vs. DER-encoding. This\n * function transforms this corner-case into the usual simple,\n * non-composed/constructed OCTET STRING.\n *\n * This function may be moved to ASN.1 at some point to better deal with\n * more BER-encoding issues, should they arise.\n *\n * @param data the ASN.1 Data object to transform.\n */\nfunction _decodePkcs7Data(data) {\n  // handle special case of \"chunked\" data content: an octet string composed\n  // of other octet strings\n  if(data.composed || data.constructed) {\n    var value = forge.util.createBuffer();\n    for(var i = 0; i < data.value.length; ++i) {\n      value.putBytes(data.value[i].value);\n    }\n    data.composed = data.constructed = false;\n    data.value = value.getBytes();\n  }\n  return data;\n}\n\n/**\n * Decode PKCS#12 AuthenticatedSafe (BER encoded) into PFX object.\n *\n * The AuthenticatedSafe is a BER-encoded SEQUENCE OF ContentInfo.\n *\n * @param pfx The PKCS#12 PFX object to fill.\n * @param {String} authSafe BER-encoded AuthenticatedSafe.\n * @param strict true to use strict DER decoding, false not to.\n * @param {String} password Password to decrypt with (optional).\n */\nfunction _decodeAuthenticatedSafe(pfx, authSafe, strict, password) {\n  authSafe = asn1.fromDer(authSafe, strict);  /* actually it's BER encoded */\n\n  if(authSafe.tagClass !== asn1.Class.UNIVERSAL ||\n     authSafe.type !== asn1.Type.SEQUENCE ||\n     authSafe.constructed !== true) {\n    throw new Error('PKCS#12 AuthenticatedSafe expected to be a ' +\n      'SEQUENCE OF ContentInfo');\n  }\n\n  for(var i = 0; i < authSafe.value.length; i++) {\n    var contentInfo = authSafe.value[i];\n\n    // validate contentInfo and capture data\n    var capture = {};\n    var errors = [];\n    if(!asn1.validate(contentInfo, contentInfoValidator, capture, errors)) {\n      var error = new Error('Cannot read ContentInfo.');\n      error.errors = errors;\n      throw error;\n    }\n\n    var obj = {\n      encrypted: false\n    };\n    var safeContents = null;\n    var data = capture.content.value[0];\n    switch(asn1.derToOid(capture.contentType)) {\n    case pki.oids.data:\n      if(data.tagClass !== asn1.Class.UNIVERSAL ||\n         data.type !== asn1.Type.OCTETSTRING) {\n        throw new Error('PKCS#12 SafeContents Data is not an OCTET STRING.');\n      }\n      safeContents = _decodePkcs7Data(data).value;\n      break;\n    case pki.oids.encryptedData:\n      safeContents = _decryptSafeContents(data, password);\n      obj.encrypted = true;\n      break;\n    default:\n      var error = new Error('Unsupported PKCS#12 contentType.');\n      error.contentType = asn1.derToOid(capture.contentType);\n      throw error;\n    }\n\n    obj.safeBags = _decodeSafeContents(safeContents, strict, password);\n    pfx.safeContents.push(obj);\n  }\n}\n\n/**\n * Decrypt PKCS#7 EncryptedData structure.\n *\n * @param data ASN.1 encoded EncryptedContentInfo object.\n * @param password The user-provided password.\n *\n * @return The decrypted SafeContents (ASN.1 object).\n */\nfunction _decryptSafeContents(data, password) {\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(\n    data, forge.pkcs7.asn1.encryptedDataValidator, capture, errors)) {\n    var error = new Error('Cannot read EncryptedContentInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  var oid = asn1.derToOid(capture.contentType);\n  if(oid !== pki.oids.data) {\n    var error = new Error(\n      'PKCS#12 EncryptedContentInfo ContentType is not Data.');\n    error.oid = oid;\n    throw error;\n  }\n\n  // get cipher\n  oid = asn1.derToOid(capture.encAlgorithm);\n  var cipher = pki.pbe.getCipher(oid, capture.encParameter, password);\n\n  // get encrypted data\n  var encryptedContentAsn1 = _decodePkcs7Data(capture.encryptedContentAsn1);\n  var encrypted = forge.util.createBuffer(encryptedContentAsn1.value);\n\n  cipher.update(encrypted);\n  if(!cipher.finish()) {\n    throw new Error('Failed to decrypt PKCS#12 SafeContents.');\n  }\n\n  return cipher.output.getBytes();\n}\n\n/**\n * Decode PKCS#12 SafeContents (BER-encoded) into array of Bag objects.\n *\n * The safeContents is a BER-encoded SEQUENCE OF SafeBag.\n *\n * @param {String} safeContents BER-encoded safeContents.\n * @param strict true to use strict DER decoding, false not to.\n * @param {String} password Password to decrypt with (optional).\n *\n * @return {Array} Array of Bag objects.\n */\nfunction _decodeSafeContents(safeContents, strict, password) {\n  // if strict and no safe contents, return empty safes\n  if(!strict && safeContents.length === 0) {\n    return [];\n  }\n\n  // actually it's BER-encoded\n  safeContents = asn1.fromDer(safeContents, strict);\n\n  if(safeContents.tagClass !== asn1.Class.UNIVERSAL ||\n    safeContents.type !== asn1.Type.SEQUENCE ||\n    safeContents.constructed !== true) {\n    throw new Error(\n      'PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.');\n  }\n\n  var res = [];\n  for(var i = 0; i < safeContents.value.length; i++) {\n    var safeBag = safeContents.value[i];\n\n    // validate SafeBag and capture data\n    var capture = {};\n    var errors = [];\n    if(!asn1.validate(safeBag, safeBagValidator, capture, errors)) {\n      var error = new Error('Cannot read SafeBag.');\n      error.errors = errors;\n      throw error;\n    }\n\n    /* Create bag object and push to result array. */\n    var bag = {\n      type: asn1.derToOid(capture.bagId),\n      attributes: _decodeBagAttributes(capture.bagAttributes)\n    };\n    res.push(bag);\n\n    var validator, decoder;\n    var bagAsn1 = capture.bagValue.value[0];\n    switch(bag.type) {\n      case pki.oids.pkcs8ShroudedKeyBag:\n        /* bagAsn1 has a EncryptedPrivateKeyInfo, which we need to decrypt.\n           Afterwards we can handle it like a keyBag,\n           which is a PrivateKeyInfo. */\n        bagAsn1 = pki.decryptPrivateKeyInfo(bagAsn1, password);\n        if(bagAsn1 === null) {\n          throw new Error(\n            'Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?');\n        }\n\n        /* fall through */\n      case pki.oids.keyBag:\n        /* A PKCS#12 keyBag is a simple PrivateKeyInfo as understood by our\n           PKI module, hence we don't have to do validation/capturing here,\n           just pass what we already got. */\n        try {\n          bag.key = pki.privateKeyFromAsn1(bagAsn1);\n        } catch(e) {\n          // ignore unknown key type, pass asn1 value\n          bag.key = null;\n          bag.asn1 = bagAsn1;\n        }\n        continue;  /* Nothing more to do. */\n\n      case pki.oids.certBag:\n        /* A PKCS#12 certBag can wrap both X.509 and sdsi certificates.\n           Therefore put the SafeBag content through another validator to\n           capture the fields.  Afterwards check & store the results. */\n        validator = certBagValidator;\n        decoder = function() {\n          if(asn1.derToOid(capture.certId) !== pki.oids.x509Certificate) {\n            var error = new Error(\n              'Unsupported certificate type, only X.509 supported.');\n            error.oid = asn1.derToOid(capture.certId);\n            throw error;\n          }\n\n          // true=produce cert hash\n          var certAsn1 = asn1.fromDer(capture.cert, strict);\n          try {\n            bag.cert = pki.certificateFromAsn1(certAsn1, true);\n          } catch(e) {\n            // ignore unknown cert type, pass asn1 value\n            bag.cert = null;\n            bag.asn1 = certAsn1;\n          }\n        };\n        break;\n\n      default:\n        var error = new Error('Unsupported PKCS#12 SafeBag type.');\n        error.oid = bag.type;\n        throw error;\n    }\n\n    /* Validate SafeBag value (i.e. CertBag, etc.) and capture data if needed. */\n    if(validator !== undefined &&\n       !asn1.validate(bagAsn1, validator, capture, errors)) {\n      var error = new Error('Cannot read PKCS#12 ' + validator.name);\n      error.errors = errors;\n      throw error;\n    }\n\n    /* Call decoder function from above to store the results. */\n    decoder();\n  }\n\n  return res;\n}\n\n/**\n * Decode PKCS#12 SET OF PKCS12Attribute into JavaScript object.\n *\n * @param attributes SET OF PKCS12Attribute (ASN.1 object).\n *\n * @return the decoded attributes.\n */\nfunction _decodeBagAttributes(attributes) {\n  var decodedAttrs = {};\n\n  if(attributes !== undefined) {\n    for(var i = 0; i < attributes.length; ++i) {\n      var capture = {};\n      var errors = [];\n      if(!asn1.validate(attributes[i], attributeValidator, capture, errors)) {\n        var error = new Error('Cannot read PKCS#12 BagAttribute.');\n        error.errors = errors;\n        throw error;\n      }\n\n      var oid = asn1.derToOid(capture.oid);\n      if(pki.oids[oid] === undefined) {\n        // unsupported attribute type, ignore.\n        continue;\n      }\n\n      decodedAttrs[pki.oids[oid]] = [];\n      for(var j = 0; j < capture.values.length; ++j) {\n        decodedAttrs[pki.oids[oid]].push(capture.values[j].value);\n      }\n    }\n  }\n\n  return decodedAttrs;\n}\n\n/**\n * Wraps a private key and certificate in a PKCS#12 PFX wrapper. If a\n * password is provided then the private key will be encrypted.\n *\n * An entire certificate chain may also be included. To do this, pass\n * an array for the \"cert\" parameter where the first certificate is\n * the one that is paired with the private key and each subsequent one\n * verifies the previous one. The certificates may be in PEM format or\n * have been already parsed by Forge.\n *\n * @todo implement password-based-encryption for the whole package\n *\n * @param key the private key.\n * @param cert the certificate (may be an array of certificates in order\n *          to specify a certificate chain).\n * @param password the password to use, null for none.\n * @param options:\n *          algorithm the encryption algorithm to use\n *            ('aes128', 'aes192', 'aes256', '3des'), defaults to 'aes128'.\n *          count the iteration count to use.\n *          saltSize the salt size to use.\n *          useMac true to include a MAC, false not to, defaults to true.\n *          localKeyId the local key ID to use, in hex.\n *          friendlyName the friendly name to use.\n *          generateLocalKeyId true to generate a random local key ID,\n *            false not to, defaults to true.\n *\n * @return the PKCS#12 PFX ASN.1 object.\n */\np12.toPkcs12Asn1 = function(key, cert, password, options) {\n  // set default options\n  options = options || {};\n  options.saltSize = options.saltSize || 8;\n  options.count = options.count || 2048;\n  options.algorithm = options.algorithm || options.encAlgorithm || 'aes128';\n  if(!('useMac' in options)) {\n    options.useMac = true;\n  }\n  if(!('localKeyId' in options)) {\n    options.localKeyId = null;\n  }\n  if(!('generateLocalKeyId' in options)) {\n    options.generateLocalKeyId = true;\n  }\n\n  var localKeyId = options.localKeyId;\n  var bagAttrs;\n  if(localKeyId !== null) {\n    localKeyId = forge.util.hexToBytes(localKeyId);\n  } else if(options.generateLocalKeyId) {\n    // use SHA-1 of paired cert, if available\n    if(cert) {\n      var pairedCert = forge.util.isArray(cert) ? cert[0] : cert;\n      if(typeof pairedCert === 'string') {\n        pairedCert = pki.certificateFromPem(pairedCert);\n      }\n      var sha1 = forge.md.sha1.create();\n      sha1.update(asn1.toDer(pki.certificateToAsn1(pairedCert)).getBytes());\n      localKeyId = sha1.digest().getBytes();\n    } else {\n      // FIXME: consider using SHA-1 of public key (which can be generated\n      // from private key components), see: cert.generateSubjectKeyIdentifier\n      // generate random bytes\n      localKeyId = forge.random.getBytes(20);\n    }\n  }\n\n  var attrs = [];\n  if(localKeyId !== null) {\n    attrs.push(\n      // localKeyID\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // attrId\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids.localKeyId).getBytes()),\n        // attrValues\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n            localKeyId)\n        ])\n      ]));\n  }\n  if('friendlyName' in options) {\n    attrs.push(\n      // friendlyName\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // attrId\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids.friendlyName).getBytes()),\n        // attrValues\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.BMPSTRING, false,\n            options.friendlyName)\n        ])\n      ]));\n  }\n\n  if(attrs.length > 0) {\n    bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs);\n  }\n\n  // collect contents for AuthenticatedSafe\n  var contents = [];\n\n  // create safe bag(s) for certificate chain\n  var chain = [];\n  if(cert !== null) {\n    if(forge.util.isArray(cert)) {\n      chain = cert;\n    } else {\n      chain = [cert];\n    }\n  }\n\n  var certSafeBags = [];\n  for(var i = 0; i < chain.length; ++i) {\n    // convert cert from PEM as necessary\n    cert = chain[i];\n    if(typeof cert === 'string') {\n      cert = pki.certificateFromPem(cert);\n    }\n\n    // SafeBag\n    var certBagAttrs = (i === 0) ? bagAttrs : undefined;\n    var certAsn1 = pki.certificateToAsn1(cert);\n    var certSafeBag =\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // bagId\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids.certBag).getBytes()),\n        // bagValue\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          // CertBag\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n            // certId\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n              asn1.oidToDer(pki.oids.x509Certificate).getBytes()),\n            // certValue (x509Certificate)\n            asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n              asn1.create(\n                asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n                asn1.toDer(certAsn1).getBytes())\n            ])])]),\n        // bagAttributes (OPTIONAL)\n        certBagAttrs\n      ]);\n    certSafeBags.push(certSafeBag);\n  }\n\n  if(certSafeBags.length > 0) {\n    // SafeContents\n    var certSafeContents = asn1.create(\n      asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, certSafeBags);\n\n    // ContentInfo\n    var certCI =\n      // PKCS#7 ContentInfo\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // contentType\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          // OID for the content type is 'data'\n          asn1.oidToDer(pki.oids.data).getBytes()),\n        // content\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          asn1.create(\n            asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n            asn1.toDer(certSafeContents).getBytes())\n        ])\n      ]);\n    contents.push(certCI);\n  }\n\n  // create safe contents for private key\n  var keyBag = null;\n  if(key !== null) {\n    // SafeBag\n    var pkAsn1 = pki.wrapRsaPrivateKey(pki.privateKeyToAsn1(key));\n    if(password === null) {\n      // no encryption\n      keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // bagId\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids.keyBag).getBytes()),\n        // bagValue\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          // PrivateKeyInfo\n          pkAsn1\n        ]),\n        // bagAttributes (OPTIONAL)\n        bagAttrs\n      ]);\n    } else {\n      // encrypted PrivateKeyInfo\n      keyBag = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // bagId\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(pki.oids.pkcs8ShroudedKeyBag).getBytes()),\n        // bagValue\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          // EncryptedPrivateKeyInfo\n          pki.encryptPrivateKeyInfo(pkAsn1, password, options)\n        ]),\n        // bagAttributes (OPTIONAL)\n        bagAttrs\n      ]);\n    }\n\n    // SafeContents\n    var keySafeContents =\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [keyBag]);\n\n    // ContentInfo\n    var keyCI =\n      // PKCS#7 ContentInfo\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // contentType\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          // OID for the content type is 'data'\n          asn1.oidToDer(pki.oids.data).getBytes()),\n        // content\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          asn1.create(\n            asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n            asn1.toDer(keySafeContents).getBytes())\n        ])\n      ]);\n    contents.push(keyCI);\n  }\n\n  // create AuthenticatedSafe by stringing together the contents\n  var safe = asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, contents);\n\n  var macData;\n  if(options.useMac) {\n    // MacData\n    var sha1 = forge.md.sha1.create();\n    var macSalt = new forge.util.ByteBuffer(\n      forge.random.getBytes(options.saltSize));\n    var count = options.count;\n    // 160-bit key\n    var key = p12.generateKey(password, macSalt, 3, count, 20);\n    var mac = forge.hmac.create();\n    mac.start(sha1, key);\n    mac.update(asn1.toDer(safe).getBytes());\n    var macValue = mac.getMac();\n    macData = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // mac DigestInfo\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // digestAlgorithm\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          // algorithm = SHA-1\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(pki.oids.sha1).getBytes()),\n          // parameters = Null\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n        ]),\n        // digest\n        asn1.create(\n          asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING,\n          false, macValue.getBytes())\n      ]),\n      // macSalt OCTET STRING\n      asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, macSalt.getBytes()),\n      // iterations INTEGER (XXX: Only support count < 65536)\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        asn1.integerToDer(count).getBytes()\n      )\n    ]);\n  }\n\n  // PFX\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version (3)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(3).getBytes()),\n    // PKCS#7 ContentInfo\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // contentType\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        // OID for the content type is 'data'\n        asn1.oidToDer(pki.oids.data).getBytes()),\n      // content\n      asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n        asn1.create(\n          asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n          asn1.toDer(safe).getBytes())\n      ])\n    ]),\n    macData\n  ]);\n};\n\n/**\n * Derives a PKCS#12 key.\n *\n * @param password the password to derive the key material from, null or\n *          undefined for none.\n * @param salt the salt, as a ByteBuffer, to use.\n * @param id the PKCS#12 ID byte (1 = key material, 2 = IV, 3 = MAC).\n * @param iter the iteration count.\n * @param n the number of bytes to derive from the password.\n * @param md the message digest to use, defaults to SHA-1.\n *\n * @return a ByteBuffer with the bytes derived from the password.\n */\np12.generateKey = forge.pbe.generatePkcs12Key;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pkcs12.js\n// module id = 487\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pkcs12.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of ASN.1 validators for PKCS#7 v1.5.\n *\n * @author Dave Longley\n * @author Stefan Siegl\n *\n * Copyright (c) 2012-2015 Digital Bazaar, Inc.\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * The ASN.1 representation of PKCS#7 is as follows\n * (see RFC #2315 for details, http://www.ietf.org/rfc/rfc2315.txt):\n *\n * A PKCS#7 message consists of a ContentInfo on root level, which may\n * contain any number of further ContentInfo nested into it.\n *\n * ContentInfo ::= SEQUENCE {\n *   contentType                ContentType,\n *   content               [0]  EXPLICIT ANY DEFINED BY contentType OPTIONAL\n * }\n *\n * ContentType ::= OBJECT IDENTIFIER\n *\n * EnvelopedData ::= SEQUENCE {\n *   version                    Version,\n *   recipientInfos             RecipientInfos,\n *   encryptedContentInfo       EncryptedContentInfo\n * }\n *\n * EncryptedData ::= SEQUENCE {\n *   version                    Version,\n *   encryptedContentInfo       EncryptedContentInfo\n * }\n *\n * id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)\n *   us(840) rsadsi(113549) pkcs(1) pkcs7(7) 2 }\n *\n * SignedData ::= SEQUENCE {\n *   version           INTEGER,\n *   digestAlgorithms  DigestAlgorithmIdentifiers,\n *   contentInfo       ContentInfo,\n *   certificates      [0] IMPLICIT Certificates OPTIONAL,\n *   crls              [1] IMPLICIT CertificateRevocationLists OPTIONAL,\n *   signerInfos       SignerInfos\n * }\n *\n * SignerInfos ::= SET OF SignerInfo\n *\n * SignerInfo ::= SEQUENCE {\n *   version                    Version,\n *   issuerAndSerialNumber      IssuerAndSerialNumber,\n *   digestAlgorithm            DigestAlgorithmIdentifier,\n *   authenticatedAttributes    [0] IMPLICIT Attributes OPTIONAL,\n *   digestEncryptionAlgorithm  DigestEncryptionAlgorithmIdentifier,\n *   encryptedDigest            EncryptedDigest,\n *   unauthenticatedAttributes  [1] IMPLICIT Attributes OPTIONAL\n * }\n *\n * EncryptedDigest ::= OCTET STRING\n *\n * Attributes ::= SET OF Attribute\n *\n * Attribute ::= SEQUENCE {\n *   attrType    OBJECT IDENTIFIER,\n *   attrValues  SET OF AttributeValue\n * }\n *\n * AttributeValue ::= ANY\n *\n * Version ::= INTEGER\n *\n * RecipientInfos ::= SET OF RecipientInfo\n *\n * EncryptedContentInfo ::= SEQUENCE {\n *   contentType                 ContentType,\n *   contentEncryptionAlgorithm  ContentEncryptionAlgorithmIdentifier,\n *   encryptedContent       [0]  IMPLICIT EncryptedContent OPTIONAL\n * }\n *\n * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier\n *\n * The AlgorithmIdentifier contains an Object Identifier (OID) and parameters\n * for the algorithm, if any. In the case of AES and DES3, there is only one,\n * the IV.\n *\n * AlgorithmIdentifer ::= SEQUENCE {\n *    algorithm OBJECT IDENTIFIER,\n *    parameters ANY DEFINED BY algorithm OPTIONAL\n * }\n *\n * EncryptedContent ::= OCTET STRING\n *\n * RecipientInfo ::= SEQUENCE {\n *   version                     Version,\n *   issuerAndSerialNumber       IssuerAndSerialNumber,\n *   keyEncryptionAlgorithm      KeyEncryptionAlgorithmIdentifier,\n *   encryptedKey                EncryptedKey\n * }\n *\n * IssuerAndSerialNumber ::= SEQUENCE {\n *   issuer                      Name,\n *   serialNumber                CertificateSerialNumber\n * }\n *\n * CertificateSerialNumber ::= INTEGER\n *\n * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier\n *\n * EncryptedKey ::= OCTET STRING\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(71);\n__webpack_require__(9);\n\n// shortcut for ASN.1 API\nvar asn1 = forge.asn1;\n\n// shortcut for PKCS#7 API\nvar p7v = module.exports = forge.pkcs7asn1 = forge.pkcs7asn1 || {};\nforge.pkcs7 = forge.pkcs7 || {};\nforge.pkcs7.asn1 = p7v;\n\nvar contentInfoValidator = {\n  name: 'ContentInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'ContentInfo.ContentType',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'contentType'\n  }, {\n    name: 'ContentInfo.content',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    constructed: true,\n    optional: true,\n    captureAsn1: 'content'\n  }]\n};\np7v.contentInfoValidator = contentInfoValidator;\n\nvar encryptedContentInfoValidator = {\n  name: 'EncryptedContentInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'EncryptedContentInfo.contentType',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OID,\n    constructed: false,\n    capture: 'contentType'\n  }, {\n    name: 'EncryptedContentInfo.contentEncryptionAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'EncryptedContentInfo.contentEncryptionAlgorithm.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'encAlgorithm'\n    }, {\n      name: 'EncryptedContentInfo.contentEncryptionAlgorithm.parameter',\n      tagClass: asn1.Class.UNIVERSAL,\n      captureAsn1: 'encParameter'\n    }]\n  }, {\n    name: 'EncryptedContentInfo.encryptedContent',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    /* The PKCS#7 structure output by OpenSSL somewhat differs from what\n     * other implementations do generate.\n     *\n     * OpenSSL generates a structure like this:\n     * SEQUENCE {\n     *    ...\n     *    [0]\n     *       26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38\n     *       C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45\n     *       ...\n     * }\n     *\n     * Whereas other implementations (and this PKCS#7 module) generate:\n     * SEQUENCE {\n     *    ...\n     *    [0] {\n     *       OCTET STRING\n     *          26 DA 67 D2 17 9C 45 3C B1 2A A8 59 2F 29 33 38\n     *          C3 C3 DF 86 71 74 7A 19 9F 40 D0 29 BE 85 90 45\n     *          ...\n     *    }\n     * }\n     *\n     * In order to support both, we just capture the context specific\n     * field here.  The OCTET STRING bit is removed below.\n     */\n    capture: 'encryptedContent',\n    captureAsn1: 'encryptedContentAsn1'\n  }]\n};\n\np7v.envelopedDataValidator = {\n  name: 'EnvelopedData',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'EnvelopedData.Version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'version'\n  }, {\n    name: 'EnvelopedData.RecipientInfos',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SET,\n    constructed: true,\n    captureAsn1: 'recipientInfos'\n  }].concat(encryptedContentInfoValidator)\n};\n\np7v.encryptedDataValidator = {\n  name: 'EncryptedData',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'EncryptedData.Version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'version'\n  }].concat(encryptedContentInfoValidator)\n};\n\nvar signerValidator = {\n  name: 'SignerInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'SignerInfo.version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false\n  }, {\n    name: 'SignerInfo.issuerAndSerialNumber',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'SignerInfo.issuerAndSerialNumber.issuer',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      captureAsn1: 'issuer'\n    }, {\n      name: 'SignerInfo.issuerAndSerialNumber.serialNumber',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.INTEGER,\n      constructed: false,\n      capture: 'serial'\n    }]\n  }, {\n    name: 'SignerInfo.digestAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'SignerInfo.digestAlgorithm.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'digestAlgorithm'\n    }, {\n      name: 'SignerInfo.digestAlgorithm.parameter',\n      tagClass: asn1.Class.UNIVERSAL,\n      constructed: false,\n      captureAsn1: 'digestParameter',\n      optional: true\n    }]\n  }, {\n    name: 'SignerInfo.authenticatedAttributes',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    constructed: true,\n    optional: true,\n    capture: 'authenticatedAttributes'\n  }, {\n    name: 'SignerInfo.digestEncryptionAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    capture: 'signatureAlgorithm'\n  }, {\n    name: 'SignerInfo.encryptedDigest',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OCTETSTRING,\n    constructed: false,\n    capture: 'signature'\n  }, {\n    name: 'SignerInfo.unauthenticatedAttributes',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 1,\n    constructed: true,\n    optional: true,\n    capture: 'unauthenticatedAttributes'\n  }]\n};\n\np7v.signedDataValidator = {\n  name: 'SignedData',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'SignedData.Version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'version'\n  }, {\n    name: 'SignedData.DigestAlgorithms',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SET,\n    constructed: true,\n    captureAsn1: 'digestAlgorithms'\n  },\n  contentInfoValidator,\n  {\n    name: 'SignedData.Certificates',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 0,\n    optional: true,\n    captureAsn1: 'certificates'\n  }, {\n    name: 'SignedData.CertificateRevocationLists',\n    tagClass: asn1.Class.CONTEXT_SPECIFIC,\n    type: 1,\n    optional: true,\n    captureAsn1: 'crls'\n  }, {\n    name: 'SignedData.SignerInfos',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SET,\n    capture: 'signerInfos',\n    optional: true,\n    value: [signerValidator]\n  }]\n};\n\np7v.recipientInfoValidator = {\n  name: 'RecipientInfo',\n  tagClass: asn1.Class.UNIVERSAL,\n  type: asn1.Type.SEQUENCE,\n  constructed: true,\n  value: [{\n    name: 'RecipientInfo.version',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.INTEGER,\n    constructed: false,\n    capture: 'version'\n  }, {\n    name: 'RecipientInfo.issuerAndSerial',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'RecipientInfo.issuerAndSerial.issuer',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.SEQUENCE,\n      constructed: true,\n      captureAsn1: 'issuer'\n    }, {\n      name: 'RecipientInfo.issuerAndSerial.serialNumber',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.INTEGER,\n      constructed: false,\n      capture: 'serial'\n    }]\n  }, {\n    name: 'RecipientInfo.keyEncryptionAlgorithm',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.SEQUENCE,\n    constructed: true,\n    value: [{\n      name: 'RecipientInfo.keyEncryptionAlgorithm.algorithm',\n      tagClass: asn1.Class.UNIVERSAL,\n      type: asn1.Type.OID,\n      constructed: false,\n      capture: 'encAlgorithm'\n    }, {\n      name: 'RecipientInfo.keyEncryptionAlgorithm.parameter',\n      tagClass: asn1.Class.UNIVERSAL,\n      constructed: false,\n      captureAsn1: 'encParameter'\n    }]\n  }, {\n    name: 'RecipientInfo.encryptedKey',\n    tagClass: asn1.Class.UNIVERSAL,\n    type: asn1.Type.OCTETSTRING,\n    constructed: false,\n    capture: 'encKey'\n  }]\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pkcs7asn1.js\n// module id = 488\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pkcs7asn1.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of a basic Public Key Infrastructure, including\n * support for RSA public and private keys.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(71);\n__webpack_require__(101);\n__webpack_require__(485);\n__webpack_require__(123);\n__webpack_require__(291);\n__webpack_require__(487);\n__webpack_require__(292);\n__webpack_require__(199);\n__webpack_require__(9);\n__webpack_require__(293);\n\n// shortcut for asn.1 API\nvar asn1 = forge.asn1;\n\n/* Public Key Infrastructure (PKI) implementation. */\nvar pki = module.exports = forge.pki = forge.pki || {};\n\n/**\n * NOTE: THIS METHOD IS DEPRECATED. Use pem.decode() instead.\n *\n * Converts PEM-formatted data to DER.\n *\n * @param pem the PEM-formatted data.\n *\n * @return the DER-formatted data.\n */\npki.pemToDer = function(pem) {\n  var msg = forge.pem.decode(pem)[0];\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert PEM to DER; PEM is encrypted.');\n  }\n  return forge.util.createBuffer(msg.body);\n};\n\n/**\n * Converts an RSA private key from PEM format.\n *\n * @param pem the PEM-formatted private key.\n *\n * @return the private key.\n */\npki.privateKeyFromPem = function(pem) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'PRIVATE KEY' && msg.type !== 'RSA PRIVATE KEY') {\n    var error = new Error('Could not convert private key from PEM; PEM ' +\n      'header type is not \"PRIVATE KEY\" or \"RSA PRIVATE KEY\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert private key from PEM; PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  var obj = asn1.fromDer(msg.body);\n\n  return pki.privateKeyFromAsn1(obj);\n};\n\n/**\n * Converts an RSA private key to PEM format.\n *\n * @param key the private key.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted private key.\n */\npki.privateKeyToPem = function(key, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var msg = {\n    type: 'RSA PRIVATE KEY',\n    body: asn1.toDer(pki.privateKeyToAsn1(key)).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n/**\n * Converts a PrivateKeyInfo to PEM format.\n *\n * @param pki the PrivateKeyInfo.\n * @param maxline the maximum characters per line, defaults to 64.\n *\n * @return the PEM-formatted private key.\n */\npki.privateKeyInfoToPem = function(pki, maxline) {\n  // convert to DER, then PEM-encode\n  var msg = {\n    type: 'PRIVATE KEY',\n    body: asn1.toDer(pki).getBytes()\n  };\n  return forge.pem.encode(msg, {maxline: maxline});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pki.js\n// module id = 489\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pki.js")},function(module,exports,__webpack_require__){eval("/**\n * Prime number generation API.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n__webpack_require__(198);\n__webpack_require__(52);\n\n(function() {\n\n// forge.prime already defined\nif(forge.prime) {\n  module.exports = forge.prime;\n  return;\n}\n\n/* PRIME API */\nvar prime = module.exports = forge.prime = forge.prime || {};\n\nvar BigInteger = forge.jsbn.BigInteger;\n\n// primes are 30k+i for i = 1, 7, 11, 13, 17, 19, 23, 29\nvar GCD_30_DELTA = [6, 4, 2, 4, 2, 4, 6, 2];\nvar THIRTY = new BigInteger(null);\nTHIRTY.fromInt(30);\nvar op_or = function(x, y) {return x|y;};\n\n/**\n * Generates a random probable prime with the given number of bits.\n *\n * Alternative algorithms can be specified by name as a string or as an\n * object with custom options like so:\n *\n * {\n *   name: 'PRIMEINC',\n *   options: {\n *     maxBlockTime: <the maximum amount of time to block the main\n *       thread before allowing I/O other JS to run>,\n *     millerRabinTests: <the number of miller-rabin tests to run>,\n *     workerScript: <the worker script URL>,\n *     workers: <the number of web workers (if supported) to use,\n *       -1 to use estimated cores minus one>.\n *     workLoad: the size of the work load, ie: number of possible prime\n *       numbers for each web worker to check per work assignment,\n *       (default: 100).\n *   }\n * }\n *\n * @param bits the number of bits for the prime number.\n * @param options the options to use.\n *          [algorithm] the algorithm to use (default: 'PRIMEINC').\n *          [prng] a custom crypto-secure pseudo-random number generator to use,\n *            that must define \"getBytesSync\".\n *\n * @return callback(err, num) called once the operation completes.\n */\nprime.generateProbablePrime = function(bits, options, callback) {\n  if(typeof options === 'function') {\n    callback = options;\n    options = {};\n  }\n  options = options || {};\n\n  // default to PRIMEINC algorithm\n  var algorithm = options.algorithm || 'PRIMEINC';\n  if(typeof algorithm === 'string') {\n    algorithm = {name: algorithm};\n  }\n  algorithm.options = algorithm.options || {};\n\n  // create prng with api that matches BigInteger secure random\n  var prng = options.prng || forge.random;\n  var rng = {\n    // x is an array to fill with bytes\n    nextBytes: function(x) {\n      var b = prng.getBytesSync(x.length);\n      for(var i = 0; i < x.length; ++i) {\n        x[i] = b.charCodeAt(i);\n      }\n    }\n  };\n\n  if(algorithm.name === 'PRIMEINC') {\n    return primeincFindPrime(bits, rng, algorithm.options, callback);\n  }\n\n  throw new Error('Invalid prime generation algorithm: ' + algorithm.name);\n};\n\nfunction primeincFindPrime(bits, rng, options, callback) {\n  if('workers' in options) {\n    return primeincFindPrimeWithWorkers(bits, rng, options, callback);\n  }\n  return primeincFindPrimeWithoutWorkers(bits, rng, options, callback);\n}\n\nfunction primeincFindPrimeWithoutWorkers(bits, rng, options, callback) {\n  // initialize random number\n  var num = generateRandom(bits, rng);\n\n  /* Note: All primes are of the form 30k+i for i < 30 and gcd(30, i)=1. The\n  number we are given is always aligned at 30k + 1. Each time the number is\n  determined not to be prime we add to get to the next 'i', eg: if the number\n  was at 30k + 1 we add 6. */\n  var deltaIdx = 0;\n\n  // get required number of MR tests\n  var mrTests = getMillerRabinTests(num.bitLength());\n  if('millerRabinTests' in options) {\n    mrTests = options.millerRabinTests;\n  }\n\n  // find prime nearest to 'num' for maxBlockTime ms\n  // 10 ms gives 5ms of leeway for other calculations before dropping\n  // below 60fps (1000/60 == 16.67), but in reality, the number will\n  // likely be higher due to an 'atomic' big int modPow\n  var maxBlockTime = 10;\n  if('maxBlockTime' in options) {\n    maxBlockTime = options.maxBlockTime;\n  }\n\n  _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);\n}\n\nfunction _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) {\n  var start = +new Date();\n  do {\n    // overflow, regenerate random number\n    if(num.bitLength() > bits) {\n      num = generateRandom(bits, rng);\n    }\n    // do primality test\n    if(num.isProbablePrime(mrTests)) {\n      return callback(null, num);\n    }\n    // get next potential prime\n    num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0);\n  } while(maxBlockTime < 0 || (+new Date() - start < maxBlockTime));\n\n  // keep trying later\n  forge.util.setImmediate(function() {\n    _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback);\n  });\n}\n\n// NOTE: This algorithm is indeterminate in nature because workers\n// run in parallel looking at different segments of numbers. Even if this\n// algorithm is run twice with the same input from a predictable RNG, it\n// may produce different outputs.\nfunction primeincFindPrimeWithWorkers(bits, rng, options, callback) {\n  // web workers unavailable\n  if(typeof Worker === 'undefined') {\n    return primeincFindPrimeWithoutWorkers(bits, rng, options, callback);\n  }\n\n  // initialize random number\n  var num = generateRandom(bits, rng);\n\n  // use web workers to generate keys\n  var numWorkers = options.workers;\n  var workLoad = options.workLoad || 100;\n  var range = workLoad * 30 / 8;\n  var workerScript = options.workerScript || 'forge/prime.worker.js';\n  if(numWorkers === -1) {\n    return forge.util.estimateCores(function(err, cores) {\n      if(err) {\n        // default to 2\n        cores = 2;\n      }\n      numWorkers = cores - 1;\n      generate();\n    });\n  }\n  generate();\n\n  function generate() {\n    // require at least 1 worker\n    numWorkers = Math.max(1, numWorkers);\n\n    // TODO: consider optimizing by starting workers outside getPrime() ...\n    // note that in order to clean up they will have to be made internally\n    // asynchronous which may actually be slower\n\n    // start workers immediately\n    var workers = [];\n    for(var i = 0; i < numWorkers; ++i) {\n      // FIXME: fix path or use blob URLs\n      workers[i] = new Worker(workerScript);\n    }\n    var running = numWorkers;\n\n    // listen for requests from workers and assign ranges to find prime\n    for(var i = 0; i < numWorkers; ++i) {\n      workers[i].addEventListener('message', workerMessage);\n    }\n\n    /* Note: The distribution of random numbers is unknown. Therefore, each\n    web worker is continuously allocated a range of numbers to check for a\n    random number until one is found.\n\n    Every 30 numbers will be checked just 8 times, because prime numbers\n    have the form:\n\n    30k+i, for i < 30 and gcd(30, i)=1 (there are 8 values of i for this)\n\n    Therefore, if we want a web worker to run N checks before asking for\n    a new range of numbers, each range must contain N*30/8 numbers.\n\n    For 100 checks (workLoad), this is a range of 375. */\n\n    var found = false;\n    function workerMessage(e) {\n      // ignore message, prime already found\n      if(found) {\n        return;\n      }\n\n      --running;\n      var data = e.data;\n      if(data.found) {\n        // terminate all workers\n        for(var i = 0; i < workers.length; ++i) {\n          workers[i].terminate();\n        }\n        found = true;\n        return callback(null, new BigInteger(data.prime, 16));\n      }\n\n      // overflow, regenerate random number\n      if(num.bitLength() > bits) {\n        num = generateRandom(bits, rng);\n      }\n\n      // assign new range to check\n      var hex = num.toString(16);\n\n      // start prime search\n      e.target.postMessage({\n        hex: hex,\n        workLoad: workLoad\n      });\n\n      num.dAddOffset(range, 0);\n    }\n  }\n}\n\n/**\n * Generates a random number using the given number of bits and RNG.\n *\n * @param bits the number of bits for the number.\n * @param rng the random number generator to use.\n *\n * @return the random number.\n */\nfunction generateRandom(bits, rng) {\n  var num = new BigInteger(bits, rng);\n  // force MSB set\n  var bits1 = bits - 1;\n  if(!num.testBit(bits1)) {\n    num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num);\n  }\n  // align number on 30k+1 boundary\n  num.dAddOffset(31 - num.mod(THIRTY).byteValue(), 0);\n  return num;\n}\n\n/**\n * Returns the required number of Miller-Rabin tests to generate a\n * prime with an error probability of (1/2)^80.\n *\n * See Handbook of Applied Cryptography Chapter 4, Table 4.4.\n *\n * @param bits the bit size.\n *\n * @return the required number of iterations.\n */\nfunction getMillerRabinTests(bits) {\n  if(bits <= 100) return 27;\n  if(bits <= 150) return 18;\n  if(bits <= 200) return 15;\n  if(bits <= 250) return 12;\n  if(bits <= 300) return 9;\n  if(bits <= 350) return 8;\n  if(bits <= 400) return 7;\n  if(bits <= 500) return 6;\n  if(bits <= 600) return 5;\n  if(bits <= 800) return 4;\n  if(bits <= 1250) return 3;\n  return 2;\n}\n\n})();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/prime.js\n// module id = 490\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/prime.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/**\n * A javascript implementation of a cryptographically-secure\n * Pseudo Random Number Generator (PRNG). The Fortuna algorithm is followed\n * here though the use of SHA-256 is not enforced; when generating an\n * a PRNG context, the hashing algorithm and block cipher used for\n * the generator are specified via a plugin.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\nvar _crypto = null;\nif(forge.util.isNodejs && !forge.options.usePureJavaScript &&\n  !process.versions['node-webkit']) {\n  _crypto = __webpack_require__(572);\n}\n\n/* PRNG API */\nvar prng = module.exports = forge.prng = forge.prng || {};\n\n/**\n * Creates a new PRNG context.\n *\n * A PRNG plugin must be passed in that will provide:\n *\n * 1. A function that initializes the key and seed of a PRNG context. It\n *   will be given a 16 byte key and a 16 byte seed. Any key expansion\n *   or transformation of the seed from a byte string into an array of\n *   integers (or similar) should be performed.\n * 2. The cryptographic function used by the generator. It takes a key and\n *   a seed.\n * 3. A seed increment function. It takes the seed and returns seed + 1.\n * 4. An api to create a message digest.\n *\n * For an example, see random.js.\n *\n * @param plugin the PRNG plugin to use.\n */\nprng.create = function(plugin) {\n  var ctx = {\n    plugin: plugin,\n    key: null,\n    seed: null,\n    time: null,\n    // number of reseeds so far\n    reseeds: 0,\n    // amount of data generated so far\n    generated: 0,\n    // no initial key bytes\n    keyBytes: ''\n  };\n\n  // create 32 entropy pools (each is a message digest)\n  var md = plugin.md;\n  var pools = new Array(32);\n  for(var i = 0; i < 32; ++i) {\n    pools[i] = md.create();\n  }\n  ctx.pools = pools;\n\n  // entropy pools are written to cyclically, starting at index 0\n  ctx.pool = 0;\n\n  /**\n   * Generates random bytes. The bytes may be generated synchronously or\n   * asynchronously. Web workers must use the asynchronous interface or\n   * else the behavior is undefined.\n   *\n   * @param count the number of random bytes to generate.\n   * @param [callback(err, bytes)] called once the operation completes.\n   *\n   * @return count random bytes as a string.\n   */\n  ctx.generate = function(count, callback) {\n    // do synchronously\n    if(!callback) {\n      return ctx.generateSync(count);\n    }\n\n    // simple generator using counter-based CBC\n    var cipher = ctx.plugin.cipher;\n    var increment = ctx.plugin.increment;\n    var formatKey = ctx.plugin.formatKey;\n    var formatSeed = ctx.plugin.formatSeed;\n    var b = forge.util.createBuffer();\n\n    // paranoid deviation from Fortuna:\n    // reset key for every request to protect previously\n    // generated random bytes should the key be discovered;\n    // there is no 100ms based reseeding because of this\n    // forced reseed for every `generate` call\n    ctx.key = null;\n\n    generate();\n\n    function generate(err) {\n      if(err) {\n        return callback(err);\n      }\n\n      // sufficient bytes generated\n      if(b.length() >= count) {\n        return callback(null, b.getBytes(count));\n      }\n\n      // if amount of data generated is greater than 1 MiB, trigger reseed\n      if(ctx.generated > 0xfffff) {\n        ctx.key = null;\n      }\n\n      if(ctx.key === null) {\n        // prevent stack overflow\n        return forge.util.nextTick(function() {\n          _reseed(generate);\n        });\n      }\n\n      // generate the random bytes\n      var bytes = cipher(ctx.key, ctx.seed);\n      ctx.generated += bytes.length;\n      b.putBytes(bytes);\n\n      // generate bytes for a new key and seed\n      ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed)));\n      ctx.seed = formatSeed(cipher(ctx.key, ctx.seed));\n\n      forge.util.setImmediate(generate);\n    }\n  };\n\n  /**\n   * Generates random bytes synchronously.\n   *\n   * @param count the number of random bytes to generate.\n   *\n   * @return count random bytes as a string.\n   */\n  ctx.generateSync = function(count) {\n    // simple generator using counter-based CBC\n    var cipher = ctx.plugin.cipher;\n    var increment = ctx.plugin.increment;\n    var formatKey = ctx.plugin.formatKey;\n    var formatSeed = ctx.plugin.formatSeed;\n\n    // paranoid deviation from Fortuna:\n    // reset key for every request to protect previously\n    // generated random bytes should the key be discovered;\n    // there is no 100ms based reseeding because of this\n    // forced reseed for every `generateSync` call\n    ctx.key = null;\n\n    var b = forge.util.createBuffer();\n    while(b.length() < count) {\n      // if amount of data generated is greater than 1 MiB, trigger reseed\n      if(ctx.generated > 0xfffff) {\n        ctx.key = null;\n      }\n\n      if(ctx.key === null) {\n        _reseedSync();\n      }\n\n      // generate the random bytes\n      var bytes = cipher(ctx.key, ctx.seed);\n      ctx.generated += bytes.length;\n      b.putBytes(bytes);\n\n      // generate bytes for a new key and seed\n      ctx.key = formatKey(cipher(ctx.key, increment(ctx.seed)));\n      ctx.seed = formatSeed(cipher(ctx.key, ctx.seed));\n    }\n\n    return b.getBytes(count);\n  };\n\n  /**\n   * Private function that asynchronously reseeds a generator.\n   *\n   * @param callback(err) called once the operation completes.\n   */\n  function _reseed(callback) {\n    if(ctx.pools[0].messageLength >= 32) {\n      _seed();\n      return callback();\n    }\n    // not enough seed data...\n    var needed = (32 - ctx.pools[0].messageLength) << 5;\n    ctx.seedFile(needed, function(err, bytes) {\n      if(err) {\n        return callback(err);\n      }\n      ctx.collect(bytes);\n      _seed();\n      callback();\n    });\n  }\n\n  /**\n   * Private function that synchronously reseeds a generator.\n   */\n  function _reseedSync() {\n    if(ctx.pools[0].messageLength >= 32) {\n      return _seed();\n    }\n    // not enough seed data...\n    var needed = (32 - ctx.pools[0].messageLength) << 5;\n    ctx.collect(ctx.seedFileSync(needed));\n    _seed();\n  }\n\n  /**\n   * Private function that seeds a generator once enough bytes are available.\n   */\n  function _seed() {\n    // update reseed count\n    ctx.reseeds = (ctx.reseeds === 0xffffffff) ? 0 : ctx.reseeds + 1;\n\n    // goal is to update `key` via:\n    // key = hash(key + s)\n    //   where 's' is all collected entropy from selected pools, then...\n\n    // create a plugin-based message digest\n    var md = ctx.plugin.md.create();\n\n    // consume current key bytes\n    md.update(ctx.keyBytes);\n\n    // digest the entropy of pools whose index k meet the\n    // condition 'n mod 2^k == 0' where n is the number of reseeds\n    var _2powK = 1;\n    for(var k = 0; k < 32; ++k) {\n      if(ctx.reseeds % _2powK === 0) {\n        md.update(ctx.pools[k].digest().getBytes());\n        ctx.pools[k].start();\n      }\n      _2powK = _2powK << 1;\n    }\n\n    // get digest for key bytes\n    ctx.keyBytes = md.digest().getBytes();\n\n    // paranoid deviation from Fortuna:\n    // update `seed` via `seed = hash(key)`\n    // instead of initializing to zero once and only\n    // ever incrementing it\n    md.start();\n    md.update(ctx.keyBytes);\n    var seedBytes = md.digest().getBytes();\n\n    // update state\n    ctx.key = ctx.plugin.formatKey(ctx.keyBytes);\n    ctx.seed = ctx.plugin.formatSeed(seedBytes);\n    ctx.generated = 0;\n  }\n\n  /**\n   * The built-in default seedFile. This seedFile is used when entropy\n   * is needed immediately.\n   *\n   * @param needed the number of bytes that are needed.\n   *\n   * @return the random bytes.\n   */\n  function defaultSeedFile(needed) {\n    // use window.crypto.getRandomValues strong source of entropy if available\n    var getRandomValues = null;\n    if(typeof window !== 'undefined') {\n      var _crypto = window.crypto || window.msCrypto;\n      if(_crypto && _crypto.getRandomValues) {\n        getRandomValues = function(arr) {\n          return _crypto.getRandomValues(arr);\n        };\n      }\n    }\n\n    var b = forge.util.createBuffer();\n    if(getRandomValues) {\n      while(b.length() < needed) {\n        // max byte length is 65536 before QuotaExceededError is thrown\n        // http://www.w3.org/TR/WebCryptoAPI/#RandomSource-method-getRandomValues\n        var count = Math.max(1, Math.min(needed - b.length(), 65536) / 4);\n        var entropy = new Uint32Array(Math.floor(count));\n        try {\n          getRandomValues(entropy);\n          for(var i = 0; i < entropy.length; ++i) {\n            b.putInt32(entropy[i]);\n          }\n        } catch(e) {\n          /* only ignore QuotaExceededError */\n          if(!(typeof QuotaExceededError !== 'undefined' &&\n            e instanceof QuotaExceededError)) {\n            throw e;\n          }\n        }\n      }\n    }\n\n    // be sad and add some weak random data\n    if(b.length() < needed) {\n      /* Draws from Park-Miller \"minimal standard\" 31 bit PRNG,\n      implemented with David G. Carta's optimization: with 32 bit math\n      and without division (Public Domain). */\n      var hi, lo, next;\n      var seed = Math.floor(Math.random() * 0x010000);\n      while(b.length() < needed) {\n        lo = 16807 * (seed & 0xFFFF);\n        hi = 16807 * (seed >> 16);\n        lo += (hi & 0x7FFF) << 16;\n        lo += hi >> 15;\n        lo = (lo & 0x7FFFFFFF) + (lo >> 31);\n        seed = lo & 0xFFFFFFFF;\n\n        // consume lower 3 bytes of seed\n        for(var i = 0; i < 3; ++i) {\n          // throw in more pseudo random\n          next = seed >>> (i << 3);\n          next ^= Math.floor(Math.random() * 0x0100);\n          b.putByte(String.fromCharCode(next & 0xFF));\n        }\n      }\n    }\n\n    return b.getBytes(needed);\n  }\n  // initialize seed file APIs\n  if(_crypto) {\n    // use nodejs async API\n    ctx.seedFile = function(needed, callback) {\n      _crypto.randomBytes(needed, function(err, bytes) {\n        if(err) {\n          return callback(err);\n        }\n        callback(null, bytes.toString());\n      });\n    };\n    // use nodejs sync API\n    ctx.seedFileSync = function(needed) {\n      return _crypto.randomBytes(needed).toString();\n    };\n  } else {\n    ctx.seedFile = function(needed, callback) {\n      try {\n        callback(null, defaultSeedFile(needed));\n      } catch(e) {\n        callback(e);\n      }\n    };\n    ctx.seedFileSync = defaultSeedFile;\n  }\n\n  /**\n   * Adds entropy to a prng ctx's accumulator.\n   *\n   * @param bytes the bytes of entropy as a string.\n   */\n  ctx.collect = function(bytes) {\n    // iterate over pools distributing entropy cyclically\n    var count = bytes.length;\n    for(var i = 0; i < count; ++i) {\n      ctx.pools[ctx.pool].update(bytes.substr(i, 1));\n      ctx.pool = (ctx.pool === 31) ? 0 : ctx.pool + 1;\n    }\n  };\n\n  /**\n   * Collects an integer of n bits.\n   *\n   * @param i the integer entropy.\n   * @param n the number of bits in the integer.\n   */\n  ctx.collectInt = function(i, n) {\n    var bytes = '';\n    for(var x = 0; x < n; x += 8) {\n      bytes += String.fromCharCode((i >> x) & 0xFF);\n    }\n    ctx.collect(bytes);\n  };\n\n  /**\n   * Registers a Web Worker to receive immediate entropy from the main thread.\n   * This method is required until Web Workers can access the native crypto\n   * API. This method should be called twice for each created worker, once in\n   * the main thread, and once in the worker itself.\n   *\n   * @param worker the worker to register.\n   */\n  ctx.registerWorker = function(worker) {\n    // worker receives random bytes\n    if(worker === self) {\n      ctx.seedFile = function(needed, callback) {\n        function listener(e) {\n          var data = e.data;\n          if(data.forge && data.forge.prng) {\n            self.removeEventListener('message', listener);\n            callback(data.forge.prng.err, data.forge.prng.bytes);\n          }\n        }\n        self.addEventListener('message', listener);\n        self.postMessage({forge: {prng: {needed: needed}}});\n      };\n    } else {\n      // main thread sends random bytes upon request\n      var listener = function(e) {\n        var data = e.data;\n        if(data.forge && data.forge.prng) {\n          ctx.seedFile(data.forge.prng.needed, function(err, bytes) {\n            worker.postMessage({forge: {prng: {err: err, bytes: bytes}}});\n          });\n        }\n      };\n      // TODO: do we need to remove the event listener when the worker dies?\n      worker.addEventListener('message', listener);\n    }\n  };\n\n  return ctx;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/prng.js\n// module id = 491\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/prng.js")},function(module,exports,__webpack_require__){eval("/**\n * RC2 implementation.\n *\n * @author Stefan Siegl\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n *\n * Information on the RC2 cipher is available from RFC #2268,\n * http://www.ietf.org/rfc/rfc2268.txt\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n\nvar piTable = [\n  0xd9, 0x78, 0xf9, 0xc4, 0x19, 0xdd, 0xb5, 0xed, 0x28, 0xe9, 0xfd, 0x79, 0x4a, 0xa0, 0xd8, 0x9d,\n  0xc6, 0x7e, 0x37, 0x83, 0x2b, 0x76, 0x53, 0x8e, 0x62, 0x4c, 0x64, 0x88, 0x44, 0x8b, 0xfb, 0xa2,\n  0x17, 0x9a, 0x59, 0xf5, 0x87, 0xb3, 0x4f, 0x13, 0x61, 0x45, 0x6d, 0x8d, 0x09, 0x81, 0x7d, 0x32,\n  0xbd, 0x8f, 0x40, 0xeb, 0x86, 0xb7, 0x7b, 0x0b, 0xf0, 0x95, 0x21, 0x22, 0x5c, 0x6b, 0x4e, 0x82,\n  0x54, 0xd6, 0x65, 0x93, 0xce, 0x60, 0xb2, 0x1c, 0x73, 0x56, 0xc0, 0x14, 0xa7, 0x8c, 0xf1, 0xdc,\n  0x12, 0x75, 0xca, 0x1f, 0x3b, 0xbe, 0xe4, 0xd1, 0x42, 0x3d, 0xd4, 0x30, 0xa3, 0x3c, 0xb6, 0x26,\n  0x6f, 0xbf, 0x0e, 0xda, 0x46, 0x69, 0x07, 0x57, 0x27, 0xf2, 0x1d, 0x9b, 0xbc, 0x94, 0x43, 0x03,\n  0xf8, 0x11, 0xc7, 0xf6, 0x90, 0xef, 0x3e, 0xe7, 0x06, 0xc3, 0xd5, 0x2f, 0xc8, 0x66, 0x1e, 0xd7,\n  0x08, 0xe8, 0xea, 0xde, 0x80, 0x52, 0xee, 0xf7, 0x84, 0xaa, 0x72, 0xac, 0x35, 0x4d, 0x6a, 0x2a,\n  0x96, 0x1a, 0xd2, 0x71, 0x5a, 0x15, 0x49, 0x74, 0x4b, 0x9f, 0xd0, 0x5e, 0x04, 0x18, 0xa4, 0xec,\n  0xc2, 0xe0, 0x41, 0x6e, 0x0f, 0x51, 0xcb, 0xcc, 0x24, 0x91, 0xaf, 0x50, 0xa1, 0xf4, 0x70, 0x39,\n  0x99, 0x7c, 0x3a, 0x85, 0x23, 0xb8, 0xb4, 0x7a, 0xfc, 0x02, 0x36, 0x5b, 0x25, 0x55, 0x97, 0x31,\n  0x2d, 0x5d, 0xfa, 0x98, 0xe3, 0x8a, 0x92, 0xae, 0x05, 0xdf, 0x29, 0x10, 0x67, 0x6c, 0xba, 0xc9,\n  0xd3, 0x00, 0xe6, 0xcf, 0xe1, 0x9e, 0xa8, 0x2c, 0x63, 0x16, 0x01, 0x3f, 0x58, 0xe2, 0x89, 0xa9,\n  0x0d, 0x38, 0x34, 0x1b, 0xab, 0x33, 0xff, 0xb0, 0xbb, 0x48, 0x0c, 0x5f, 0xb9, 0xb1, 0xcd, 0x2e,\n  0xc5, 0xf3, 0xdb, 0x47, 0xe5, 0xa5, 0x9c, 0x77, 0x0a, 0xa6, 0x20, 0x68, 0xfe, 0x7f, 0xc1, 0xad\n];\n\nvar s = [1, 2, 3, 5];\n\n/**\n * Rotate a word left by given number of bits.\n *\n * Bits that are shifted out on the left are put back in on the right\n * hand side.\n *\n * @param word The word to shift left.\n * @param bits The number of bits to shift by.\n * @return The rotated word.\n */\nvar rol = function(word, bits) {\n  return ((word << bits) & 0xffff) | ((word & 0xffff) >> (16 - bits));\n};\n\n/**\n * Rotate a word right by given number of bits.\n *\n * Bits that are shifted out on the right are put back in on the left\n * hand side.\n *\n * @param word The word to shift right.\n * @param bits The number of bits to shift by.\n * @return The rotated word.\n */\nvar ror = function(word, bits) {\n  return ((word & 0xffff) >> bits) | ((word << (16 - bits)) & 0xffff);\n};\n\n/* RC2 API */\nmodule.exports = forge.rc2 = forge.rc2 || {};\n\n/**\n * Perform RC2 key expansion as per RFC #2268, section 2.\n *\n * @param key variable-length user key (between 1 and 128 bytes)\n * @param effKeyBits number of effective key bits (default: 128)\n * @return the expanded RC2 key (ByteBuffer of 128 bytes)\n */\nforge.rc2.expandKey = function(key, effKeyBits) {\n  if(typeof key === 'string') {\n    key = forge.util.createBuffer(key);\n  }\n  effKeyBits = effKeyBits || 128;\n\n  /* introduce variables that match the names used in RFC #2268 */\n  var L = key;\n  var T = key.length();\n  var T1 = effKeyBits;\n  var T8 = Math.ceil(T1 / 8);\n  var TM = 0xff >> (T1 & 0x07);\n  var i;\n\n  for(i = T; i < 128; i++) {\n    L.putByte(piTable[(L.at(i - 1) + L.at(i - T)) & 0xff]);\n  }\n\n  L.setAt(128 - T8, piTable[L.at(128 - T8) & TM]);\n\n  for(i = 127 - T8; i >= 0; i--) {\n    L.setAt(i, piTable[L.at(i + 1) ^ L.at(i + T8)]);\n  }\n\n  return L;\n};\n\n/**\n * Creates a RC2 cipher object.\n *\n * @param key the symmetric key to use (as base for key generation).\n * @param bits the number of effective key bits.\n * @param encrypt false for decryption, true for encryption.\n *\n * @return the cipher.\n */\nvar createCipher = function(key, bits, encrypt) {\n  var _finish = false, _input = null, _output = null, _iv = null;\n  var mixRound, mashRound;\n  var i, j, K = [];\n\n  /* Expand key and fill into K[] Array */\n  key = forge.rc2.expandKey(key, bits);\n  for(i = 0; i < 64; i++) {\n    K.push(key.getInt16Le());\n  }\n\n  if(encrypt) {\n    /**\n     * Perform one mixing round \"in place\".\n     *\n     * @param R Array of four words to perform mixing on.\n     */\n    mixRound = function(R) {\n      for(i = 0; i < 4; i++) {\n        R[i] += K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) +\n          ((~R[(i + 3) % 4]) & R[(i + 1) % 4]);\n        R[i] = rol(R[i], s[i]);\n        j++;\n      }\n    };\n\n    /**\n     * Perform one mashing round \"in place\".\n     *\n     * @param R Array of four words to perform mashing on.\n     */\n    mashRound = function(R) {\n      for(i = 0; i < 4; i++) {\n        R[i] += K[R[(i + 3) % 4] & 63];\n      }\n    };\n  } else {\n    /**\n     * Perform one r-mixing round \"in place\".\n     *\n     * @param R Array of four words to perform mixing on.\n     */\n    mixRound = function(R) {\n      for(i = 3; i >= 0; i--) {\n        R[i] = ror(R[i], s[i]);\n        R[i] -= K[j] + (R[(i + 3) % 4] & R[(i + 2) % 4]) +\n          ((~R[(i + 3) % 4]) & R[(i + 1) % 4]);\n        j--;\n      }\n    };\n\n    /**\n     * Perform one r-mashing round \"in place\".\n     *\n     * @param R Array of four words to perform mashing on.\n     */\n    mashRound = function(R) {\n      for(i = 3; i >= 0; i--) {\n        R[i] -= K[R[(i + 3) % 4] & 63];\n      }\n    };\n  }\n\n  /**\n   * Run the specified cipher execution plan.\n   *\n   * This function takes four words from the input buffer, applies the IV on\n   * it (if requested) and runs the provided execution plan.\n   *\n   * The plan must be put together in form of a array of arrays.  Where the\n   * outer one is simply a list of steps to perform and the inner one needs\n   * to have two elements: the first one telling how many rounds to perform,\n   * the second one telling what to do (i.e. the function to call).\n   *\n   * @param {Array} plan The plan to execute.\n   */\n  var runPlan = function(plan) {\n    var R = [];\n\n    /* Get data from input buffer and fill the four words into R */\n    for(i = 0; i < 4; i++) {\n      var val = _input.getInt16Le();\n\n      if(_iv !== null) {\n        if(encrypt) {\n          /* We're encrypting, apply the IV first. */\n          val ^= _iv.getInt16Le();\n        } else {\n          /* We're decryption, keep cipher text for next block. */\n          _iv.putInt16Le(val);\n        }\n      }\n\n      R.push(val & 0xffff);\n    }\n\n    /* Reset global \"j\" variable as per spec. */\n    j = encrypt ? 0 : 63;\n\n    /* Run execution plan. */\n    for(var ptr = 0; ptr < plan.length; ptr++) {\n      for(var ctr = 0; ctr < plan[ptr][0]; ctr++) {\n        plan[ptr][1](R);\n      }\n    }\n\n    /* Write back result to output buffer. */\n    for(i = 0; i < 4; i++) {\n      if(_iv !== null) {\n        if(encrypt) {\n          /* We're encrypting in CBC-mode, feed back encrypted bytes into\n             IV buffer to carry it forward to next block. */\n          _iv.putInt16Le(R[i]);\n        } else {\n          R[i] ^= _iv.getInt16Le();\n        }\n      }\n\n      _output.putInt16Le(R[i]);\n    }\n  };\n\n  /* Create cipher object */\n  var cipher = null;\n  cipher = {\n    /**\n     * Starts or restarts the encryption or decryption process, whichever\n     * was previously configured.\n     *\n     * To use the cipher in CBC mode, iv may be given either as a string\n     * of bytes, or as a byte buffer.  For ECB mode, give null as iv.\n     *\n     * @param iv the initialization vector to use, null for ECB mode.\n     * @param output the output the buffer to write to, null to create one.\n     */\n    start: function(iv, output) {\n      if(iv) {\n        /* CBC mode */\n        if(typeof iv === 'string') {\n          iv = forge.util.createBuffer(iv);\n        }\n      }\n\n      _finish = false;\n      _input = forge.util.createBuffer();\n      _output = output || new forge.util.createBuffer();\n      _iv = iv;\n\n      cipher.output = _output;\n    },\n\n    /**\n     * Updates the next block.\n     *\n     * @param input the buffer to read from.\n     */\n    update: function(input) {\n      if(!_finish) {\n        // not finishing, so fill the input buffer with more input\n        _input.putBuffer(input);\n      }\n\n      while(_input.length() >= 8) {\n        runPlan([\n            [ 5, mixRound ],\n            [ 1, mashRound ],\n            [ 6, mixRound ],\n            [ 1, mashRound ],\n            [ 5, mixRound ]\n          ]);\n      }\n    },\n\n    /**\n     * Finishes encrypting or decrypting.\n     *\n     * @param pad a padding function to use, null for PKCS#7 padding,\n     *           signature(blockSize, buffer, decrypt).\n     *\n     * @return true if successful, false on error.\n     */\n    finish: function(pad) {\n      var rval = true;\n\n      if(encrypt) {\n        if(pad) {\n          rval = pad(8, _input, !encrypt);\n        } else {\n          // add PKCS#7 padding to block (each pad byte is the\n          // value of the number of pad bytes)\n          var padding = (_input.length() === 8) ? 8 : (8 - _input.length());\n          _input.fillWithByte(padding, padding);\n        }\n      }\n\n      if(rval) {\n        // do final update\n        _finish = true;\n        cipher.update();\n      }\n\n      if(!encrypt) {\n        // check for error: input data not a multiple of block size\n        rval = (_input.length() === 0);\n        if(rval) {\n          if(pad) {\n            rval = pad(8, _output, !encrypt);\n          } else {\n            // ensure padding byte count is valid\n            var len = _output.length();\n            var count = _output.at(len - 1);\n\n            if(count > len) {\n              rval = false;\n            } else {\n              // trim off padding bytes\n              _output.truncate(count);\n            }\n          }\n        }\n      }\n\n      return rval;\n    }\n  };\n\n  return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the\n * given symmetric key. The output will be stored in the 'output' member\n * of the returned cipher.\n *\n * The key and iv may be given as a string of bytes or a byte buffer.\n * The cipher is initialized to use 128 effective key bits.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n *\n * @return the cipher.\n */\nforge.rc2.startEncrypting = function(key, iv, output) {\n  var cipher = forge.rc2.createEncryptionCipher(key, 128);\n  cipher.start(iv, output);\n  return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to encrypt data in ECB or CBC mode using the\n * given symmetric key.\n *\n * The key may be given as a string of bytes or a byte buffer.\n *\n * To start encrypting call start() on the cipher with an iv and optional\n * output buffer.\n *\n * @param key the symmetric key to use.\n *\n * @return the cipher.\n */\nforge.rc2.createEncryptionCipher = function(key, bits) {\n  return createCipher(key, bits, true);\n};\n\n/**\n * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the\n * given symmetric key. The output will be stored in the 'output' member\n * of the returned cipher.\n *\n * The key and iv may be given as a string of bytes or a byte buffer.\n * The cipher is initialized to use 128 effective key bits.\n *\n * @param key the symmetric key to use.\n * @param iv the initialization vector to use.\n * @param output the buffer to write to, null to create one.\n *\n * @return the cipher.\n */\nforge.rc2.startDecrypting = function(key, iv, output) {\n  var cipher = forge.rc2.createDecryptionCipher(key, 128);\n  cipher.start(iv, output);\n  return cipher;\n};\n\n/**\n * Creates an RC2 cipher object to decrypt data in ECB or CBC mode using the\n * given symmetric key.\n *\n * The key may be given as a string of bytes or a byte buffer.\n *\n * To start decrypting call start() on the cipher with an iv and optional\n * output buffer.\n *\n * @param key the symmetric key to use.\n *\n * @return the cipher.\n */\nforge.rc2.createDecryptionCipher = function(key, bits) {\n  return createCipher(key, bits, false);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/rc2.js\n// module id = 492\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/rc2.js")},function(module,exports,__webpack_require__){eval("/**\n * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation.\n *\n * See FIPS 180-2 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2010-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(72);\n__webpack_require__(9);\n\nvar sha256 = module.exports = forge.sha256 = forge.sha256 || {};\nforge.md.sha256 = forge.md.algorithms.sha256 = sha256;\n\n/**\n * Creates a SHA-256 message digest object.\n *\n * @return a message digest object.\n */\nsha256.create = function() {\n  // do initialization as necessary\n  if(!_initialized) {\n    _init();\n  }\n\n  // SHA-256 state contains eight 32-bit integers\n  var _state = null;\n\n  // input buffer\n  var _input = forge.util.createBuffer();\n\n  // used for word storage\n  var _w = new Array(64);\n\n  // message digest object\n  var md = {\n    algorithm: 'sha256',\n    blockLength: 64,\n    digestLength: 32,\n    // 56-bit length of message so far (does not including padding)\n    messageLength: 0,\n    // true message length\n    fullMessageLength: null,\n    // size of message length in bytes\n    messageLengthSize: 8\n  };\n\n  /**\n   * Starts the digest.\n   *\n   * @return this digest object.\n   */\n  md.start = function() {\n    // up to 56-bit message length for convenience\n    md.messageLength = 0;\n\n    // full message length (set md.messageLength64 for backwards-compatibility)\n    md.fullMessageLength = md.messageLength64 = [];\n    var int32s = md.messageLengthSize / 4;\n    for(var i = 0; i < int32s; ++i) {\n      md.fullMessageLength.push(0);\n    }\n    _input = forge.util.createBuffer();\n    _state = {\n      h0: 0x6A09E667,\n      h1: 0xBB67AE85,\n      h2: 0x3C6EF372,\n      h3: 0xA54FF53A,\n      h4: 0x510E527F,\n      h5: 0x9B05688C,\n      h6: 0x1F83D9AB,\n      h7: 0x5BE0CD19\n    };\n    return md;\n  };\n  // start digest automatically for first time\n  md.start();\n\n  /**\n   * Updates the digest with the given message input. The given input can\n   * treated as raw input (no encoding will be applied) or an encoding of\n   * 'utf8' maybe given to encode the input using UTF-8.\n   *\n   * @param msg the message input to update with.\n   * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n   *\n   * @return this digest object.\n   */\n  md.update = function(msg, encoding) {\n    if(encoding === 'utf8') {\n      msg = forge.util.encodeUtf8(msg);\n    }\n\n    // update message length\n    var len = msg.length;\n    md.messageLength += len;\n    len = [(len / 0x100000000) >>> 0, len >>> 0];\n    for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n      md.fullMessageLength[i] += len[1];\n      len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n      md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n      len[0] = ((len[1] / 0x100000000) >>> 0);\n    }\n\n    // add bytes to input buffer\n    _input.putBytes(msg);\n\n    // process bytes\n    _update(_state, _w, _input);\n\n    // compact input buffer every 2K or if empty\n    if(_input.read > 2048 || _input.length() === 0) {\n      _input.compact();\n    }\n\n    return md;\n  };\n\n  /**\n   * Produces the digest.\n   *\n   * @return a byte buffer containing the digest value.\n   */\n  md.digest = function() {\n    /* Note: Here we copy the remaining bytes in the input buffer and\n    add the appropriate SHA-256 padding. Then we do the final update\n    on a copy of the state so that if the user wants to get\n    intermediate digests they can do so. */\n\n    /* Determine the number of bytes that must be added to the message\n    to ensure its length is congruent to 448 mod 512. In other words,\n    the data to be digested must be a multiple of 512 bits (or 128 bytes).\n    This data includes the message, some padding, and the length of the\n    message. Since the length of the message will be encoded as 8 bytes (64\n    bits), that means that the last segment of the data must have 56 bytes\n    (448 bits) of message and padding. Therefore, the length of the message\n    plus the padding must be congruent to 448 mod 512 because\n    512 - 128 = 448.\n\n    In order to fill up the message length it must be filled with\n    padding that begins with 1 bit followed by all 0 bits. Padding\n    must *always* be present, so if the message length is already\n    congruent to 448 mod 512, then 512 padding bits must be added. */\n\n    var finalBlock = forge.util.createBuffer();\n    finalBlock.putBytes(_input.bytes());\n\n    // compute remaining size to be digested (include message length size)\n    var remaining = (\n      md.fullMessageLength[md.fullMessageLength.length - 1] +\n      md.messageLengthSize);\n\n    // add padding for overflow blockSize - overflow\n    // _padding starts with 1 byte with first bit is set (byte value 128), then\n    // there may be up to (blockSize - 1) other pad bytes\n    var overflow = remaining & (md.blockLength - 1);\n    finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n    // serialize message length in bits in big-endian order; since length\n    // is stored in bytes we multiply by 8 and add carry from next int\n    var next, carry;\n    var bits = md.fullMessageLength[0] * 8;\n    for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n      next = md.fullMessageLength[i + 1] * 8;\n      carry = (next / 0x100000000) >>> 0;\n      bits += carry;\n      finalBlock.putInt32(bits >>> 0);\n      bits = next >>> 0;\n    }\n    finalBlock.putInt32(bits);\n\n    var s2 = {\n      h0: _state.h0,\n      h1: _state.h1,\n      h2: _state.h2,\n      h3: _state.h3,\n      h4: _state.h4,\n      h5: _state.h5,\n      h6: _state.h6,\n      h7: _state.h7\n    };\n    _update(s2, _w, finalBlock);\n    var rval = forge.util.createBuffer();\n    rval.putInt32(s2.h0);\n    rval.putInt32(s2.h1);\n    rval.putInt32(s2.h2);\n    rval.putInt32(s2.h3);\n    rval.putInt32(s2.h4);\n    rval.putInt32(s2.h5);\n    rval.putInt32(s2.h6);\n    rval.putInt32(s2.h7);\n    return rval;\n  };\n\n  return md;\n};\n\n// sha-256 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n// table of constants\nvar _k = null;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n  // create padding\n  _padding = String.fromCharCode(128);\n  _padding += forge.util.fillString(String.fromCharCode(0x00), 64);\n\n  // create K table for SHA-256\n  _k = [\n    0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n    0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n    0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n    0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n    0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n    0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n    0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n    0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n    0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n    0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n    0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n    0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n    0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n    0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n    0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n    0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2];\n\n  // now initialized\n  _initialized = true;\n}\n\n/**\n * Updates a SHA-256 state with the given byte buffer.\n *\n * @param s the SHA-256 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n  // consume 512 bit (64 byte) chunks\n  var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h;\n  var len = bytes.length();\n  while(len >= 64) {\n    // the w array will be populated with sixteen 32-bit big-endian words\n    // and then extended into 64 32-bit words according to SHA-256\n    for(i = 0; i < 16; ++i) {\n      w[i] = bytes.getInt32();\n    }\n    for(; i < 64; ++i) {\n      // XOR word 2 words ago rot right 17, rot right 19, shft right 10\n      t1 = w[i - 2];\n      t1 =\n        ((t1 >>> 17) | (t1 << 15)) ^\n        ((t1 >>> 19) | (t1 << 13)) ^\n        (t1 >>> 10);\n      // XOR word 15 words ago rot right 7, rot right 18, shft right 3\n      t2 = w[i - 15];\n      t2 =\n        ((t2 >>> 7) | (t2 << 25)) ^\n        ((t2 >>> 18) | (t2 << 14)) ^\n        (t2 >>> 3);\n      // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^32\n      w[i] = (t1 + w[i - 7] + t2 + w[i - 16]) | 0;\n    }\n\n    // initialize hash value for this chunk\n    a = s.h0;\n    b = s.h1;\n    c = s.h2;\n    d = s.h3;\n    e = s.h4;\n    f = s.h5;\n    g = s.h6;\n    h = s.h7;\n\n    // round function\n    for(i = 0; i < 64; ++i) {\n      // Sum1(e)\n      s1 =\n        ((e >>> 6) | (e << 26)) ^\n        ((e >>> 11) | (e << 21)) ^\n        ((e >>> 25) | (e << 7));\n      // Ch(e, f, g) (optimized the same way as SHA-1)\n      ch = g ^ (e & (f ^ g));\n      // Sum0(a)\n      s0 =\n        ((a >>> 2) | (a << 30)) ^\n        ((a >>> 13) | (a << 19)) ^\n        ((a >>> 22) | (a << 10));\n      // Maj(a, b, c) (optimized the same way as SHA-1)\n      maj = (a & b) | (c & (a ^ b));\n\n      // main algorithm\n      t1 = h + s1 + ch + _k[i] + w[i];\n      t2 = s0 + maj;\n      h = g;\n      g = f;\n      f = e;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      // can't truncate with `| 0`\n      e = (d + t1) >>> 0;\n      d = c;\n      c = b;\n      b = a;\n      // `>>> 0` necessary to avoid iOS/Safari 10 optimization bug\n      // can't truncate with `| 0`\n      a = (t1 + t2) >>> 0;\n    }\n\n    // update hash state\n    s.h0 = (s.h0 + a) | 0;\n    s.h1 = (s.h1 + b) | 0;\n    s.h2 = (s.h2 + c) | 0;\n    s.h3 = (s.h3 + d) | 0;\n    s.h4 = (s.h4 + e) | 0;\n    s.h5 = (s.h5 + f) | 0;\n    s.h6 = (s.h6 + g) | 0;\n    s.h7 = (s.h7 + h) | 0;\n    len -= 64;\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/sha256.js\n// module id = 493\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/sha256.js")},function(module,exports,__webpack_require__){eval("/**\n * Secure Hash Algorithm with a 1024-bit block size implementation.\n *\n * This includes: SHA-512, SHA-384, SHA-512/224, and SHA-512/256. For\n * SHA-256 (block size 512 bits), see sha256.js.\n *\n * See FIPS 180-4 for details.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2014-2015 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(72);\n__webpack_require__(9);\n\nvar sha512 = module.exports = forge.sha512 = forge.sha512 || {};\n\n// SHA-512\nforge.md.sha512 = forge.md.algorithms.sha512 = sha512;\n\n// SHA-384\nvar sha384 = forge.sha384 = forge.sha512.sha384 = forge.sha512.sha384 || {};\nsha384.create = function() {\n  return sha512.create('SHA-384');\n};\nforge.md.sha384 = forge.md.algorithms.sha384 = sha384;\n\n// SHA-512/256\nforge.sha512.sha256 = forge.sha512.sha256 || {\n  create: function() {\n    return sha512.create('SHA-512/256');\n  }\n};\nforge.md['sha512/256'] = forge.md.algorithms['sha512/256'] =\n  forge.sha512.sha256;\n\n// SHA-512/224\nforge.sha512.sha224 = forge.sha512.sha224 || {\n  create: function() {\n    return sha512.create('SHA-512/224');\n  }\n};\nforge.md['sha512/224'] = forge.md.algorithms['sha512/224'] =\n  forge.sha512.sha224;\n\n/**\n * Creates a SHA-2 message digest object.\n *\n * @param algorithm the algorithm to use (SHA-512, SHA-384, SHA-512/224,\n *          SHA-512/256).\n *\n * @return a message digest object.\n */\nsha512.create = function(algorithm) {\n  // do initialization as necessary\n  if(!_initialized) {\n    _init();\n  }\n\n  if(typeof algorithm === 'undefined') {\n    algorithm = 'SHA-512';\n  }\n\n  if(!(algorithm in _states)) {\n    throw new Error('Invalid SHA-512 algorithm: ' + algorithm);\n  }\n\n  // SHA-512 state contains eight 64-bit integers (each as two 32-bit ints)\n  var _state = _states[algorithm];\n  var _h = null;\n\n  // input buffer\n  var _input = forge.util.createBuffer();\n\n  // used for 64-bit word storage\n  var _w = new Array(80);\n  for(var wi = 0; wi < 80; ++wi) {\n    _w[wi] = new Array(2);\n  }\n\n  // determine digest length by algorithm name (default)\n  var digestLength = 64;\n  switch (algorithm) {\n    case 'SHA-384':\n      digestLength = 48;\n      break;\n    case 'SHA-512/256':\n      digestLength = 32;\n      break;\n    case 'SHA-512/224':\n      digestLength = 28;\n      break;\n  }\n\n  // message digest object\n  var md = {\n    // SHA-512 => sha512\n    algorithm: algorithm.replace('-', '').toLowerCase(),\n    blockLength: 128,\n    digestLength: digestLength,\n    // 56-bit length of message so far (does not including padding)\n    messageLength: 0,\n    // true message length\n    fullMessageLength: null,\n    // size of message length in bytes\n    messageLengthSize: 16\n  };\n\n  /**\n   * Starts the digest.\n   *\n   * @return this digest object.\n   */\n  md.start = function() {\n    // up to 56-bit message length for convenience\n    md.messageLength = 0;\n\n    // full message length (set md.messageLength128 for backwards-compatibility)\n    md.fullMessageLength = md.messageLength128 = [];\n    var int32s = md.messageLengthSize / 4;\n    for(var i = 0; i < int32s; ++i) {\n      md.fullMessageLength.push(0);\n    }\n    _input = forge.util.createBuffer();\n    _h = new Array(_state.length);\n    for(var i = 0; i < _state.length; ++i) {\n      _h[i] = _state[i].slice(0);\n    }\n    return md;\n  };\n  // start digest automatically for first time\n  md.start();\n\n  /**\n   * Updates the digest with the given message input. The given input can\n   * treated as raw input (no encoding will be applied) or an encoding of\n   * 'utf8' maybe given to encode the input using UTF-8.\n   *\n   * @param msg the message input to update with.\n   * @param encoding the encoding to use (default: 'raw', other: 'utf8').\n   *\n   * @return this digest object.\n   */\n  md.update = function(msg, encoding) {\n    if(encoding === 'utf8') {\n      msg = forge.util.encodeUtf8(msg);\n    }\n\n    // update message length\n    var len = msg.length;\n    md.messageLength += len;\n    len = [(len / 0x100000000) >>> 0, len >>> 0];\n    for(var i = md.fullMessageLength.length - 1; i >= 0; --i) {\n      md.fullMessageLength[i] += len[1];\n      len[1] = len[0] + ((md.fullMessageLength[i] / 0x100000000) >>> 0);\n      md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;\n      len[0] = ((len[1] / 0x100000000) >>> 0);\n    }\n\n    // add bytes to input buffer\n    _input.putBytes(msg);\n\n    // process bytes\n    _update(_h, _w, _input);\n\n    // compact input buffer every 2K or if empty\n    if(_input.read > 2048 || _input.length() === 0) {\n      _input.compact();\n    }\n\n    return md;\n  };\n\n  /**\n   * Produces the digest.\n   *\n   * @return a byte buffer containing the digest value.\n   */\n  md.digest = function() {\n    /* Note: Here we copy the remaining bytes in the input buffer and\n    add the appropriate SHA-512 padding. Then we do the final update\n    on a copy of the state so that if the user wants to get\n    intermediate digests they can do so. */\n\n    /* Determine the number of bytes that must be added to the message\n    to ensure its length is congruent to 896 mod 1024. In other words,\n    the data to be digested must be a multiple of 1024 bits (or 128 bytes).\n    This data includes the message, some padding, and the length of the\n    message. Since the length of the message will be encoded as 16 bytes (128\n    bits), that means that the last segment of the data must have 112 bytes\n    (896 bits) of message and padding. Therefore, the length of the message\n    plus the padding must be congruent to 896 mod 1024 because\n    1024 - 128 = 896.\n\n    In order to fill up the message length it must be filled with\n    padding that begins with 1 bit followed by all 0 bits. Padding\n    must *always* be present, so if the message length is already\n    congruent to 896 mod 1024, then 1024 padding bits must be added. */\n\n    var finalBlock = forge.util.createBuffer();\n    finalBlock.putBytes(_input.bytes());\n\n    // compute remaining size to be digested (include message length size)\n    var remaining = (\n      md.fullMessageLength[md.fullMessageLength.length - 1] +\n      md.messageLengthSize);\n\n    // add padding for overflow blockSize - overflow\n    // _padding starts with 1 byte with first bit is set (byte value 128), then\n    // there may be up to (blockSize - 1) other pad bytes\n    var overflow = remaining & (md.blockLength - 1);\n    finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));\n\n    // serialize message length in bits in big-endian order; since length\n    // is stored in bytes we multiply by 8 and add carry from next int\n    var next, carry;\n    var bits = md.fullMessageLength[0] * 8;\n    for(var i = 0; i < md.fullMessageLength.length - 1; ++i) {\n      next = md.fullMessageLength[i + 1] * 8;\n      carry = (next / 0x100000000) >>> 0;\n      bits += carry;\n      finalBlock.putInt32(bits >>> 0);\n      bits = next >>> 0;\n    }\n    finalBlock.putInt32(bits);\n\n    var h = new Array(_h.length);\n    for(var i = 0; i < _h.length; ++i) {\n      h[i] = _h[i].slice(0);\n    }\n    _update(h, _w, finalBlock);\n    var rval = forge.util.createBuffer();\n    var hlen;\n    if(algorithm === 'SHA-512') {\n      hlen = h.length;\n    } else if(algorithm === 'SHA-384') {\n      hlen = h.length - 2;\n    } else {\n      hlen = h.length - 4;\n    }\n    for(var i = 0; i < hlen; ++i) {\n      rval.putInt32(h[i][0]);\n      if(i !== hlen - 1 || algorithm !== 'SHA-512/224') {\n        rval.putInt32(h[i][1]);\n      }\n    }\n    return rval;\n  };\n\n  return md;\n};\n\n// sha-512 padding bytes not initialized yet\nvar _padding = null;\nvar _initialized = false;\n\n// table of constants\nvar _k = null;\n\n// initial hash states\nvar _states = null;\n\n/**\n * Initializes the constant tables.\n */\nfunction _init() {\n  // create padding\n  _padding = String.fromCharCode(128);\n  _padding += forge.util.fillString(String.fromCharCode(0x00), 128);\n\n  // create K table for SHA-512\n  _k = [\n    [0x428a2f98, 0xd728ae22], [0x71374491, 0x23ef65cd],\n    [0xb5c0fbcf, 0xec4d3b2f], [0xe9b5dba5, 0x8189dbbc],\n    [0x3956c25b, 0xf348b538], [0x59f111f1, 0xb605d019],\n    [0x923f82a4, 0xaf194f9b], [0xab1c5ed5, 0xda6d8118],\n    [0xd807aa98, 0xa3030242], [0x12835b01, 0x45706fbe],\n    [0x243185be, 0x4ee4b28c], [0x550c7dc3, 0xd5ffb4e2],\n    [0x72be5d74, 0xf27b896f], [0x80deb1fe, 0x3b1696b1],\n    [0x9bdc06a7, 0x25c71235], [0xc19bf174, 0xcf692694],\n    [0xe49b69c1, 0x9ef14ad2], [0xefbe4786, 0x384f25e3],\n    [0x0fc19dc6, 0x8b8cd5b5], [0x240ca1cc, 0x77ac9c65],\n    [0x2de92c6f, 0x592b0275], [0x4a7484aa, 0x6ea6e483],\n    [0x5cb0a9dc, 0xbd41fbd4], [0x76f988da, 0x831153b5],\n    [0x983e5152, 0xee66dfab], [0xa831c66d, 0x2db43210],\n    [0xb00327c8, 0x98fb213f], [0xbf597fc7, 0xbeef0ee4],\n    [0xc6e00bf3, 0x3da88fc2], [0xd5a79147, 0x930aa725],\n    [0x06ca6351, 0xe003826f], [0x14292967, 0x0a0e6e70],\n    [0x27b70a85, 0x46d22ffc], [0x2e1b2138, 0x5c26c926],\n    [0x4d2c6dfc, 0x5ac42aed], [0x53380d13, 0x9d95b3df],\n    [0x650a7354, 0x8baf63de], [0x766a0abb, 0x3c77b2a8],\n    [0x81c2c92e, 0x47edaee6], [0x92722c85, 0x1482353b],\n    [0xa2bfe8a1, 0x4cf10364], [0xa81a664b, 0xbc423001],\n    [0xc24b8b70, 0xd0f89791], [0xc76c51a3, 0x0654be30],\n    [0xd192e819, 0xd6ef5218], [0xd6990624, 0x5565a910],\n    [0xf40e3585, 0x5771202a], [0x106aa070, 0x32bbd1b8],\n    [0x19a4c116, 0xb8d2d0c8], [0x1e376c08, 0x5141ab53],\n    [0x2748774c, 0xdf8eeb99], [0x34b0bcb5, 0xe19b48a8],\n    [0x391c0cb3, 0xc5c95a63], [0x4ed8aa4a, 0xe3418acb],\n    [0x5b9cca4f, 0x7763e373], [0x682e6ff3, 0xd6b2b8a3],\n    [0x748f82ee, 0x5defb2fc], [0x78a5636f, 0x43172f60],\n    [0x84c87814, 0xa1f0ab72], [0x8cc70208, 0x1a6439ec],\n    [0x90befffa, 0x23631e28], [0xa4506ceb, 0xde82bde9],\n    [0xbef9a3f7, 0xb2c67915], [0xc67178f2, 0xe372532b],\n    [0xca273ece, 0xea26619c], [0xd186b8c7, 0x21c0c207],\n    [0xeada7dd6, 0xcde0eb1e], [0xf57d4f7f, 0xee6ed178],\n    [0x06f067aa, 0x72176fba], [0x0a637dc5, 0xa2c898a6],\n    [0x113f9804, 0xbef90dae], [0x1b710b35, 0x131c471b],\n    [0x28db77f5, 0x23047d84], [0x32caab7b, 0x40c72493],\n    [0x3c9ebe0a, 0x15c9bebc], [0x431d67c4, 0x9c100d4c],\n    [0x4cc5d4be, 0xcb3e42b6], [0x597f299c, 0xfc657e2a],\n    [0x5fcb6fab, 0x3ad6faec], [0x6c44198c, 0x4a475817]\n  ];\n\n  // initial hash states\n  _states = {};\n  _states['SHA-512'] = [\n    [0x6a09e667, 0xf3bcc908],\n    [0xbb67ae85, 0x84caa73b],\n    [0x3c6ef372, 0xfe94f82b],\n    [0xa54ff53a, 0x5f1d36f1],\n    [0x510e527f, 0xade682d1],\n    [0x9b05688c, 0x2b3e6c1f],\n    [0x1f83d9ab, 0xfb41bd6b],\n    [0x5be0cd19, 0x137e2179]\n  ];\n  _states['SHA-384'] = [\n    [0xcbbb9d5d, 0xc1059ed8],\n    [0x629a292a, 0x367cd507],\n    [0x9159015a, 0x3070dd17],\n    [0x152fecd8, 0xf70e5939],\n    [0x67332667, 0xffc00b31],\n    [0x8eb44a87, 0x68581511],\n    [0xdb0c2e0d, 0x64f98fa7],\n    [0x47b5481d, 0xbefa4fa4]\n  ];\n  _states['SHA-512/256'] = [\n    [0x22312194, 0xFC2BF72C],\n    [0x9F555FA3, 0xC84C64C2],\n    [0x2393B86B, 0x6F53B151],\n    [0x96387719, 0x5940EABD],\n    [0x96283EE2, 0xA88EFFE3],\n    [0xBE5E1E25, 0x53863992],\n    [0x2B0199FC, 0x2C85B8AA],\n    [0x0EB72DDC, 0x81C52CA2]\n  ];\n  _states['SHA-512/224'] = [\n    [0x8C3D37C8, 0x19544DA2],\n    [0x73E19966, 0x89DCD4D6],\n    [0x1DFAB7AE, 0x32FF9C82],\n    [0x679DD514, 0x582F9FCF],\n    [0x0F6D2B69, 0x7BD44DA8],\n    [0x77E36F73, 0x04C48942],\n    [0x3F9D85A8, 0x6A1D36C8],\n    [0x1112E6AD, 0x91D692A1]\n  ];\n\n  // now initialized\n  _initialized = true;\n}\n\n/**\n * Updates a SHA-512 state with the given byte buffer.\n *\n * @param s the SHA-512 state to update.\n * @param w the array to use to store words.\n * @param bytes the byte buffer to update with.\n */\nfunction _update(s, w, bytes) {\n  // consume 512 bit (128 byte) chunks\n  var t1_hi, t1_lo;\n  var t2_hi, t2_lo;\n  var s0_hi, s0_lo;\n  var s1_hi, s1_lo;\n  var ch_hi, ch_lo;\n  var maj_hi, maj_lo;\n  var a_hi, a_lo;\n  var b_hi, b_lo;\n  var c_hi, c_lo;\n  var d_hi, d_lo;\n  var e_hi, e_lo;\n  var f_hi, f_lo;\n  var g_hi, g_lo;\n  var h_hi, h_lo;\n  var i, hi, lo, w2, w7, w15, w16;\n  var len = bytes.length();\n  while(len >= 128) {\n    // the w array will be populated with sixteen 64-bit big-endian words\n    // and then extended into 64 64-bit words according to SHA-512\n    for(i = 0; i < 16; ++i) {\n      w[i][0] = bytes.getInt32() >>> 0;\n      w[i][1] = bytes.getInt32() >>> 0;\n    }\n    for(; i < 80; ++i) {\n      // for word 2 words ago: ROTR 19(x) ^ ROTR 61(x) ^ SHR 6(x)\n      w2 = w[i - 2];\n      hi = w2[0];\n      lo = w2[1];\n\n      // high bits\n      t1_hi = (\n        ((hi >>> 19) | (lo << 13)) ^ // ROTR 19\n        ((lo >>> 29) | (hi << 3)) ^ // ROTR 61/(swap + ROTR 29)\n        (hi >>> 6)) >>> 0; // SHR 6\n      // low bits\n      t1_lo = (\n        ((hi << 13) | (lo >>> 19)) ^ // ROTR 19\n        ((lo << 3) | (hi >>> 29)) ^ // ROTR 61/(swap + ROTR 29)\n        ((hi << 26) | (lo >>> 6))) >>> 0; // SHR 6\n\n      // for word 15 words ago: ROTR 1(x) ^ ROTR 8(x) ^ SHR 7(x)\n      w15 = w[i - 15];\n      hi = w15[0];\n      lo = w15[1];\n\n      // high bits\n      t2_hi = (\n        ((hi >>> 1) | (lo << 31)) ^ // ROTR 1\n        ((hi >>> 8) | (lo << 24)) ^ // ROTR 8\n        (hi >>> 7)) >>> 0; // SHR 7\n      // low bits\n      t2_lo = (\n        ((hi << 31) | (lo >>> 1)) ^ // ROTR 1\n        ((hi << 24) | (lo >>> 8)) ^ // ROTR 8\n        ((hi << 25) | (lo >>> 7))) >>> 0; // SHR 7\n\n      // sum(t1, word 7 ago, t2, word 16 ago) modulo 2^64 (carry lo overflow)\n      w7 = w[i - 7];\n      w16 = w[i - 16];\n      lo = (t1_lo + w7[1] + t2_lo + w16[1]);\n      w[i][0] = (t1_hi + w7[0] + t2_hi + w16[0] +\n        ((lo / 0x100000000) >>> 0)) >>> 0;\n      w[i][1] = lo >>> 0;\n    }\n\n    // initialize hash value for this chunk\n    a_hi = s[0][0];\n    a_lo = s[0][1];\n    b_hi = s[1][0];\n    b_lo = s[1][1];\n    c_hi = s[2][0];\n    c_lo = s[2][1];\n    d_hi = s[3][0];\n    d_lo = s[3][1];\n    e_hi = s[4][0];\n    e_lo = s[4][1];\n    f_hi = s[5][0];\n    f_lo = s[5][1];\n    g_hi = s[6][0];\n    g_lo = s[6][1];\n    h_hi = s[7][0];\n    h_lo = s[7][1];\n\n    // round function\n    for(i = 0; i < 80; ++i) {\n      // Sum1(e) = ROTR 14(e) ^ ROTR 18(e) ^ ROTR 41(e)\n      s1_hi = (\n        ((e_hi >>> 14) | (e_lo << 18)) ^ // ROTR 14\n        ((e_hi >>> 18) | (e_lo << 14)) ^ // ROTR 18\n        ((e_lo >>> 9) | (e_hi << 23))) >>> 0; // ROTR 41/(swap + ROTR 9)\n      s1_lo = (\n        ((e_hi << 18) | (e_lo >>> 14)) ^ // ROTR 14\n        ((e_hi << 14) | (e_lo >>> 18)) ^ // ROTR 18\n        ((e_lo << 23) | (e_hi >>> 9))) >>> 0; // ROTR 41/(swap + ROTR 9)\n\n      // Ch(e, f, g) (optimized the same way as SHA-1)\n      ch_hi = (g_hi ^ (e_hi & (f_hi ^ g_hi))) >>> 0;\n      ch_lo = (g_lo ^ (e_lo & (f_lo ^ g_lo))) >>> 0;\n\n      // Sum0(a) = ROTR 28(a) ^ ROTR 34(a) ^ ROTR 39(a)\n      s0_hi = (\n        ((a_hi >>> 28) | (a_lo << 4)) ^ // ROTR 28\n        ((a_lo >>> 2) | (a_hi << 30)) ^ // ROTR 34/(swap + ROTR 2)\n        ((a_lo >>> 7) | (a_hi << 25))) >>> 0; // ROTR 39/(swap + ROTR 7)\n      s0_lo = (\n        ((a_hi << 4) | (a_lo >>> 28)) ^ // ROTR 28\n        ((a_lo << 30) | (a_hi >>> 2)) ^ // ROTR 34/(swap + ROTR 2)\n        ((a_lo << 25) | (a_hi >>> 7))) >>> 0; // ROTR 39/(swap + ROTR 7)\n\n      // Maj(a, b, c) (optimized the same way as SHA-1)\n      maj_hi = ((a_hi & b_hi) | (c_hi & (a_hi ^ b_hi))) >>> 0;\n      maj_lo = ((a_lo & b_lo) | (c_lo & (a_lo ^ b_lo))) >>> 0;\n\n      // main algorithm\n      // t1 = (h + s1 + ch + _k[i] + _w[i]) modulo 2^64 (carry lo overflow)\n      lo = (h_lo + s1_lo + ch_lo + _k[i][1] + w[i][1]);\n      t1_hi = (h_hi + s1_hi + ch_hi + _k[i][0] + w[i][0] +\n        ((lo / 0x100000000) >>> 0)) >>> 0;\n      t1_lo = lo >>> 0;\n\n      // t2 = s0 + maj modulo 2^64 (carry lo overflow)\n      lo = s0_lo + maj_lo;\n      t2_hi = (s0_hi + maj_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n      t2_lo = lo >>> 0;\n\n      h_hi = g_hi;\n      h_lo = g_lo;\n\n      g_hi = f_hi;\n      g_lo = f_lo;\n\n      f_hi = e_hi;\n      f_lo = e_lo;\n\n      // e = (d + t1) modulo 2^64 (carry lo overflow)\n      lo = d_lo + t1_lo;\n      e_hi = (d_hi + t1_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n      e_lo = lo >>> 0;\n\n      d_hi = c_hi;\n      d_lo = c_lo;\n\n      c_hi = b_hi;\n      c_lo = b_lo;\n\n      b_hi = a_hi;\n      b_lo = a_lo;\n\n      // a = (t1 + t2) modulo 2^64 (carry lo overflow)\n      lo = t1_lo + t2_lo;\n      a_hi = (t1_hi + t2_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n      a_lo = lo >>> 0;\n    }\n\n    // update hash state (additional modulo 2^64)\n    lo = s[0][1] + a_lo;\n    s[0][0] = (s[0][0] + a_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[0][1] = lo >>> 0;\n\n    lo = s[1][1] + b_lo;\n    s[1][0] = (s[1][0] + b_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[1][1] = lo >>> 0;\n\n    lo = s[2][1] + c_lo;\n    s[2][0] = (s[2][0] + c_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[2][1] = lo >>> 0;\n\n    lo = s[3][1] + d_lo;\n    s[3][0] = (s[3][0] + d_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[3][1] = lo >>> 0;\n\n    lo = s[4][1] + e_lo;\n    s[4][0] = (s[4][0] + e_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[4][1] = lo >>> 0;\n\n    lo = s[5][1] + f_lo;\n    s[5][0] = (s[5][0] + f_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[5][1] = lo >>> 0;\n\n    lo = s[6][1] + g_lo;\n    s[6][0] = (s[6][0] + g_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[6][1] = lo >>> 0;\n\n    lo = s[7][1] + h_lo;\n    s[7][0] = (s[7][0] + h_hi + ((lo / 0x100000000) >>> 0)) >>> 0;\n    s[7][1] = lo >>> 0;\n\n    len -= 128;\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/sha512.js\n// module id = 494\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/sha512.js")},function(module,exports,__webpack_require__){eval("/**\n * A Javascript implementation of Transport Layer Security (TLS).\n *\n * @author Dave Longley\n *\n * Copyright (c) 2009-2014 Digital Bazaar, Inc.\n *\n * The TLS Handshake Protocol involves the following steps:\n *\n * - Exchange hello messages to agree on algorithms, exchange random values,\n * and check for session resumption.\n *\n * - Exchange the necessary cryptographic parameters to allow the client and\n * server to agree on a premaster secret.\n *\n * - Exchange certificates and cryptographic information to allow the client\n * and server to authenticate themselves.\n *\n * - Generate a master secret from the premaster secret and exchanged random\n * values.\n *\n * - Provide security parameters to the record layer.\n *\n * - Allow the client and server to verify that their peer has calculated the\n * same security parameters and that the handshake occurred without tampering\n * by an attacker.\n *\n * Up to 4 different messages may be sent during a key exchange. The server\n * certificate, the server key exchange, the client certificate, and the\n * client key exchange.\n *\n * A typical handshake (from the client's perspective).\n *\n * 1. Client sends ClientHello.\n * 2. Client receives ServerHello.\n * 3. Client receives optional Certificate.\n * 4. Client receives optional ServerKeyExchange.\n * 5. Client receives ServerHelloDone.\n * 6. Client sends optional Certificate.\n * 7. Client sends ClientKeyExchange.\n * 8. Client sends optional CertificateVerify.\n * 9. Client sends ChangeCipherSpec.\n * 10. Client sends Finished.\n * 11. Client receives ChangeCipherSpec.\n * 12. Client receives Finished.\n * 13. Client sends/receives application data.\n *\n * To reuse an existing session:\n *\n * 1. Client sends ClientHello with session ID for reuse.\n * 2. Client receives ServerHello with same session ID if reusing.\n * 3. Client receives ChangeCipherSpec message if reusing.\n * 4. Client receives Finished.\n * 5. Client sends ChangeCipherSpec.\n * 6. Client sends Finished.\n *\n * Note: Client ignores HelloRequest if in the middle of a handshake.\n *\n * Record Layer:\n *\n * The record layer fragments information blocks into TLSPlaintext records\n * carrying data in chunks of 2^14 bytes or less. Client message boundaries are\n * not preserved in the record layer (i.e., multiple client messages of the\n * same ContentType MAY be coalesced into a single TLSPlaintext record, or a\n * single message MAY be fragmented across several records).\n *\n * struct {\n *   uint8 major;\n *   uint8 minor;\n * } ProtocolVersion;\n *\n * struct {\n *   ContentType type;\n *   ProtocolVersion version;\n *   uint16 length;\n *   opaque fragment[TLSPlaintext.length];\n * } TLSPlaintext;\n *\n * type:\n *   The higher-level protocol used to process the enclosed fragment.\n *\n * version:\n *   The version of the protocol being employed. TLS Version 1.2 uses version\n *   {3, 3}. TLS Version 1.0 uses version {3, 1}. Note that a client that\n *   supports multiple versions of TLS may not know what version will be\n *   employed before it receives the ServerHello.\n *\n * length:\n *   The length (in bytes) of the following TLSPlaintext.fragment. The length\n *   MUST NOT exceed 2^14 = 16384 bytes.\n *\n * fragment:\n *   The application data. This data is transparent and treated as an\n *   independent block to be dealt with by the higher-level protocol specified\n *   by the type field.\n *\n * Implementations MUST NOT send zero-length fragments of Handshake, Alert, or\n * ChangeCipherSpec content types. Zero-length fragments of Application data\n * MAY be sent as they are potentially useful as a traffic analysis\n * countermeasure.\n *\n * Note: Data of different TLS record layer content types MAY be interleaved.\n * Application data is generally of lower precedence for transmission than\n * other content types. However, records MUST be delivered to the network in\n * the same order as they are protected by the record layer. Recipients MUST\n * receive and process interleaved application layer traffic during handshakes\n * subsequent to the first one on a connection.\n *\n * struct {\n *   ContentType type;       // same as TLSPlaintext.type\n *   ProtocolVersion version;// same as TLSPlaintext.version\n *   uint16 length;\n *   opaque fragment[TLSCompressed.length];\n * } TLSCompressed;\n *\n * length:\n *   The length (in bytes) of the following TLSCompressed.fragment.\n *   The length MUST NOT exceed 2^14 + 1024.\n *\n * fragment:\n *   The compressed form of TLSPlaintext.fragment.\n *\n * Note: A CompressionMethod.null operation is an identity operation; no fields\n * are altered. In this implementation, since no compression is supported,\n * uncompressed records are always the same as compressed records.\n *\n * Encryption Information:\n *\n * The encryption and MAC functions translate a TLSCompressed structure into a\n * TLSCiphertext. The decryption functions reverse the process. The MAC of the\n * record also includes a sequence number so that missing, extra, or repeated\n * messages are detectable.\n *\n * struct {\n *   ContentType type;\n *   ProtocolVersion version;\n *   uint16 length;\n *   select (SecurityParameters.cipher_type) {\n *     case stream: GenericStreamCipher;\n *     case block:  GenericBlockCipher;\n *     case aead:   GenericAEADCipher;\n *   } fragment;\n * } TLSCiphertext;\n *\n * type:\n *   The type field is identical to TLSCompressed.type.\n *\n * version:\n *   The version field is identical to TLSCompressed.version.\n *\n * length:\n *   The length (in bytes) of the following TLSCiphertext.fragment.\n *   The length MUST NOT exceed 2^14 + 2048.\n *\n * fragment:\n *   The encrypted form of TLSCompressed.fragment, with the MAC.\n *\n * Note: Only CBC Block Ciphers are supported by this implementation.\n *\n * The TLSCompressed.fragment structures are converted to/from block\n * TLSCiphertext.fragment structures.\n *\n * struct {\n *   opaque IV[SecurityParameters.record_iv_length];\n *   block-ciphered struct {\n *     opaque content[TLSCompressed.length];\n *     opaque MAC[SecurityParameters.mac_length];\n *     uint8 padding[GenericBlockCipher.padding_length];\n *     uint8 padding_length;\n *   };\n * } GenericBlockCipher;\n *\n * The MAC is generated as described in Section 6.2.3.1.\n *\n * IV:\n *   The Initialization Vector (IV) SHOULD be chosen at random, and MUST be\n *   unpredictable. Note that in versions of TLS prior to 1.1, there was no\n *   IV field, and the last ciphertext block of the previous record (the \"CBC\n *   residue\") was used as the IV. This was changed to prevent the attacks\n *   described in [CBCATT]. For block ciphers, the IV length is of length\n *   SecurityParameters.record_iv_length, which is equal to the\n *   SecurityParameters.block_size.\n *\n * padding:\n *   Padding that is added to force the length of the plaintext to be an\n *   integral multiple of the block cipher's block length. The padding MAY be\n *   any length up to 255 bytes, as long as it results in the\n *   TLSCiphertext.length being an integral multiple of the block length.\n *   Lengths longer than necessary might be desirable to frustrate attacks on\n *   a protocol that are based on analysis of the lengths of exchanged\n *   messages. Each uint8 in the padding data vector MUST be filled with the\n *   padding length value. The receiver MUST check this padding and MUST use\n *   the bad_record_mac alert to indicate padding errors.\n *\n * padding_length:\n *   The padding length MUST be such that the total size of the\n *   GenericBlockCipher structure is a multiple of the cipher's block length.\n *   Legal values range from zero to 255, inclusive. This length specifies the\n *   length of the padding field exclusive of the padding_length field itself.\n *\n * The encrypted data length (TLSCiphertext.length) is one more than the sum of\n * SecurityParameters.block_length, TLSCompressed.length,\n * SecurityParameters.mac_length, and padding_length.\n *\n * Example: If the block length is 8 bytes, the content length\n * (TLSCompressed.length) is 61 bytes, and the MAC length is 20 bytes, then the\n * length before padding is 82 bytes (this does not include the IV. Thus, the\n * padding length modulo 8 must be equal to 6 in order to make the total length\n * an even multiple of 8 bytes (the block length). The padding length can be\n * 6, 14, 22, and so on, through 254. If the padding length were the minimum\n * necessary, 6, the padding would be 6 bytes, each containing the value 6.\n * Thus, the last 8 octets of the GenericBlockCipher before block encryption\n * would be xx 06 06 06 06 06 06 06, where xx is the last octet of the MAC.\n *\n * Note: With block ciphers in CBC mode (Cipher Block Chaining), it is critical\n * that the entire plaintext of the record be known before any ciphertext is\n * transmitted. Otherwise, it is possible for the attacker to mount the attack\n * described in [CBCATT].\n *\n * Implementation note: Canvel et al. [CBCTIME] have demonstrated a timing\n * attack on CBC padding based on the time required to compute the MAC. In\n * order to defend against this attack, implementations MUST ensure that\n * record processing time is essentially the same whether or not the padding\n * is correct. In general, the best way to do this is to compute the MAC even\n * if the padding is incorrect, and only then reject the packet. For instance,\n * if the pad appears to be incorrect, the implementation might assume a\n * zero-length pad and then compute the MAC. This leaves a small timing\n * channel, since MAC performance depends, to some extent, on the size of the\n * data fragment, but it is not believed to be large enough to be exploitable,\n * due to the large block size of existing MACs and the small size of the\n * timing signal.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(71);\n__webpack_require__(148);\n__webpack_require__(290);\n__webpack_require__(123);\n__webpack_require__(489);\n__webpack_require__(52);\n__webpack_require__(150);\n__webpack_require__(9);\n\n/**\n * Generates pseudo random bytes by mixing the result of two hash functions,\n * MD5 and SHA-1.\n *\n * prf_TLS1(secret, label, seed) =\n *   P_MD5(S1, label + seed) XOR P_SHA-1(S2, label + seed);\n *\n * Each P_hash function functions as follows:\n *\n * P_hash(secret, seed) = HMAC_hash(secret, A(1) + seed) +\n *                        HMAC_hash(secret, A(2) + seed) +\n *                        HMAC_hash(secret, A(3) + seed) + ...\n * A() is defined as:\n *   A(0) = seed\n *   A(i) = HMAC_hash(secret, A(i-1))\n *\n * The '+' operator denotes concatenation.\n *\n * As many iterations A(N) as are needed are performed to generate enough\n * pseudo random byte output. If an iteration creates more data than is\n * necessary, then it is truncated.\n *\n * Therefore:\n * A(1) = HMAC_hash(secret, A(0))\n *      = HMAC_hash(secret, seed)\n * A(2) = HMAC_hash(secret, A(1))\n *      = HMAC_hash(secret, HMAC_hash(secret, seed))\n *\n * Therefore:\n * P_hash(secret, seed) =\n *   HMAC_hash(secret, HMAC_hash(secret, A(0)) + seed) +\n *   HMAC_hash(secret, HMAC_hash(secret, A(1)) + seed) +\n *   ...\n *\n * Therefore:\n * P_hash(secret, seed) =\n *   HMAC_hash(secret, HMAC_hash(secret, seed) + seed) +\n *   HMAC_hash(secret, HMAC_hash(secret, HMAC_hash(secret, seed)) + seed) +\n *   ...\n *\n * @param secret the secret to use.\n * @param label the label to use.\n * @param seed the seed value to use.\n * @param length the number of bytes to generate.\n *\n * @return the pseudo random bytes in a byte buffer.\n */\nvar prf_TLS1 = function(secret, label, seed, length) {\n  var rval = forge.util.createBuffer();\n\n  /* For TLS 1.0, the secret is split in half, into two secrets of equal\n    length. If the secret has an odd length then the last byte of the first\n    half will be the same as the first byte of the second. The length of the\n    two secrets is half of the secret rounded up. */\n  var idx = (secret.length >> 1);\n  var slen = idx + (secret.length & 1);\n  var s1 = secret.substr(0, slen);\n  var s2 = secret.substr(idx, slen);\n  var ai = forge.util.createBuffer();\n  var hmac = forge.hmac.create();\n  seed = label + seed;\n\n  // determine the number of iterations that must be performed to generate\n  // enough output bytes, md5 creates 16 byte hashes, sha1 creates 20\n  var md5itr = Math.ceil(length / 16);\n  var sha1itr = Math.ceil(length / 20);\n\n  // do md5 iterations\n  hmac.start('MD5', s1);\n  var md5bytes = forge.util.createBuffer();\n  ai.putBytes(seed);\n  for(var i = 0; i < md5itr; ++i) {\n    // HMAC_hash(secret, A(i-1))\n    hmac.start(null, null);\n    hmac.update(ai.getBytes());\n    ai.putBuffer(hmac.digest());\n\n    // HMAC_hash(secret, A(i) + seed)\n    hmac.start(null, null);\n    hmac.update(ai.bytes() + seed);\n    md5bytes.putBuffer(hmac.digest());\n  }\n\n  // do sha1 iterations\n  hmac.start('SHA1', s2);\n  var sha1bytes = forge.util.createBuffer();\n  ai.clear();\n  ai.putBytes(seed);\n  for(var i = 0; i < sha1itr; ++i) {\n    // HMAC_hash(secret, A(i-1))\n    hmac.start(null, null);\n    hmac.update(ai.getBytes());\n    ai.putBuffer(hmac.digest());\n\n    // HMAC_hash(secret, A(i) + seed)\n    hmac.start(null, null);\n    hmac.update(ai.bytes() + seed);\n    sha1bytes.putBuffer(hmac.digest());\n  }\n\n  // XOR the md5 bytes with the sha1 bytes\n  rval.putBytes(forge.util.xorBytes(\n    md5bytes.getBytes(), sha1bytes.getBytes(), length));\n\n  return rval;\n};\n\n/**\n * Generates pseudo random bytes using a SHA256 algorithm. For TLS 1.2.\n *\n * @param secret the secret to use.\n * @param label the label to use.\n * @param seed the seed value to use.\n * @param length the number of bytes to generate.\n *\n * @return the pseudo random bytes in a byte buffer.\n */\nvar prf_sha256 = function(secret, label, seed, length) {\n   // FIXME: implement me for TLS 1.2\n};\n\n/**\n * Gets a MAC for a record using the SHA-1 hash algorithm.\n *\n * @param key the mac key.\n * @param state the sequence number (array of two 32-bit integers).\n * @param record the record.\n *\n * @return the sha-1 hash (20 bytes) for the given record.\n */\nvar hmac_sha1 = function(key, seqNum, record) {\n  /* MAC is computed like so:\n  HMAC_hash(\n    key, seqNum +\n      TLSCompressed.type +\n      TLSCompressed.version +\n      TLSCompressed.length +\n      TLSCompressed.fragment)\n  */\n  var hmac = forge.hmac.create();\n  hmac.start('SHA1', key);\n  var b = forge.util.createBuffer();\n  b.putInt32(seqNum[0]);\n  b.putInt32(seqNum[1]);\n  b.putByte(record.type);\n  b.putByte(record.version.major);\n  b.putByte(record.version.minor);\n  b.putInt16(record.length);\n  b.putBytes(record.fragment.bytes());\n  hmac.update(b.getBytes());\n  return hmac.digest().getBytes();\n};\n\n/**\n * Compresses the TLSPlaintext record into a TLSCompressed record using the\n * deflate algorithm.\n *\n * @param c the TLS connection.\n * @param record the TLSPlaintext record to compress.\n * @param s the ConnectionState to use.\n *\n * @return true on success, false on failure.\n */\nvar deflate = function(c, record, s) {\n  var rval = false;\n\n  try {\n    var bytes = c.deflate(record.fragment.getBytes());\n    record.fragment = forge.util.createBuffer(bytes);\n    record.length = bytes.length;\n    rval = true;\n  } catch(ex) {\n    // deflate error, fail out\n  }\n\n  return rval;\n};\n\n/**\n * Decompresses the TLSCompressed record into a TLSPlaintext record using the\n * deflate algorithm.\n *\n * @param c the TLS connection.\n * @param record the TLSCompressed record to decompress.\n * @param s the ConnectionState to use.\n *\n * @return true on success, false on failure.\n */\nvar inflate = function(c, record, s) {\n  var rval = false;\n\n  try {\n    var bytes = c.inflate(record.fragment.getBytes());\n    record.fragment = forge.util.createBuffer(bytes);\n    record.length = bytes.length;\n    rval = true;\n  } catch(ex) {\n    // inflate error, fail out\n  }\n\n  return rval;\n};\n\n/**\n * Reads a TLS variable-length vector from a byte buffer.\n *\n * Variable-length vectors are defined by specifying a subrange of legal\n * lengths, inclusively, using the notation <floor..ceiling>. When these are\n * encoded, the actual length precedes the vector's contents in the byte\n * stream. The length will be in the form of a number consuming as many bytes\n * as required to hold the vector's specified maximum (ceiling) length. A\n * variable-length vector with an actual length field of zero is referred to\n * as an empty vector.\n *\n * @param b the byte buffer.\n * @param lenBytes the number of bytes required to store the length.\n *\n * @return the resulting byte buffer.\n */\nvar readVector = function(b, lenBytes) {\n  var len = 0;\n  switch(lenBytes) {\n  case 1:\n    len = b.getByte();\n    break;\n  case 2:\n    len = b.getInt16();\n    break;\n  case 3:\n    len = b.getInt24();\n    break;\n  case 4:\n    len = b.getInt32();\n    break;\n  }\n\n  // read vector bytes into a new buffer\n  return forge.util.createBuffer(b.getBytes(len));\n};\n\n/**\n * Writes a TLS variable-length vector to a byte buffer.\n *\n * @param b the byte buffer.\n * @param lenBytes the number of bytes required to store the length.\n * @param v the byte buffer vector.\n */\nvar writeVector = function(b, lenBytes, v) {\n  // encode length at the start of the vector, where the number of bytes for\n  // the length is the maximum number of bytes it would take to encode the\n  // vector's ceiling\n  b.putInt(v.length(), lenBytes << 3);\n  b.putBuffer(v);\n};\n\n/**\n * The tls implementation.\n */\nvar tls = {};\n\n/**\n * Version: TLS 1.2 = 3.3, TLS 1.1 = 3.2, TLS 1.0 = 3.1. Both TLS 1.1 and\n * TLS 1.2 were still too new (ie: openSSL didn't implement them) at the time\n * of this implementation so TLS 1.0 was implemented instead.\n */\ntls.Versions = {\n  TLS_1_0: {major: 3, minor: 1},\n  TLS_1_1: {major: 3, minor: 2},\n  TLS_1_2: {major: 3, minor: 3}\n};\ntls.SupportedVersions = [\n  tls.Versions.TLS_1_1,\n  tls.Versions.TLS_1_0\n];\ntls.Version = tls.SupportedVersions[0];\n\n/**\n * Maximum fragment size. True maximum is 16384, but we fragment before that\n * to allow for unusual small increases during compression.\n */\ntls.MaxFragment = 16384 - 1024;\n\n/**\n * Whether this entity is considered the \"client\" or \"server\".\n * enum { server, client } ConnectionEnd;\n */\ntls.ConnectionEnd = {\n  server: 0,\n  client: 1\n};\n\n/**\n * Pseudo-random function algorithm used to generate keys from the master\n * secret.\n * enum { tls_prf_sha256 } PRFAlgorithm;\n */\ntls.PRFAlgorithm = {\n  tls_prf_sha256: 0\n};\n\n/**\n * Bulk encryption algorithms.\n * enum { null, rc4, des3, aes } BulkCipherAlgorithm;\n */\ntls.BulkCipherAlgorithm = {\n  none: null,\n  rc4: 0,\n  des3: 1,\n  aes: 2\n};\n\n/**\n * Cipher types.\n * enum { stream, block, aead } CipherType;\n */\ntls.CipherType = {\n  stream: 0,\n  block: 1,\n  aead: 2\n};\n\n/**\n * MAC (Message Authentication Code) algorithms.\n * enum { null, hmac_md5, hmac_sha1, hmac_sha256,\n *   hmac_sha384, hmac_sha512} MACAlgorithm;\n */\ntls.MACAlgorithm = {\n  none: null,\n  hmac_md5: 0,\n  hmac_sha1: 1,\n  hmac_sha256: 2,\n  hmac_sha384: 3,\n  hmac_sha512: 4\n};\n\n/**\n * Compression algorithms.\n * enum { null(0), deflate(1), (255) } CompressionMethod;\n */\ntls.CompressionMethod = {\n  none: 0,\n  deflate: 1\n};\n\n/**\n * TLS record content types.\n * enum {\n *   change_cipher_spec(20), alert(21), handshake(22),\n *   application_data(23), (255)\n * } ContentType;\n */\ntls.ContentType = {\n  change_cipher_spec: 20,\n  alert: 21,\n  handshake: 22,\n  application_data: 23,\n  heartbeat: 24\n};\n\n/**\n * TLS handshake types.\n * enum {\n *   hello_request(0), client_hello(1), server_hello(2),\n *   certificate(11), server_key_exchange (12),\n *   certificate_request(13), server_hello_done(14),\n *   certificate_verify(15), client_key_exchange(16),\n *   finished(20), (255)\n * } HandshakeType;\n */\ntls.HandshakeType = {\n  hello_request: 0,\n  client_hello: 1,\n  server_hello: 2,\n  certificate: 11,\n  server_key_exchange: 12,\n  certificate_request: 13,\n  server_hello_done: 14,\n  certificate_verify: 15,\n  client_key_exchange: 16,\n  finished: 20\n};\n\n/**\n * TLS Alert Protocol.\n *\n * enum { warning(1), fatal(2), (255) } AlertLevel;\n *\n * enum {\n *   close_notify(0),\n *   unexpected_message(10),\n *   bad_record_mac(20),\n *   decryption_failed(21),\n *   record_overflow(22),\n *   decompression_failure(30),\n *   handshake_failure(40),\n *   bad_certificate(42),\n *   unsupported_certificate(43),\n *   certificate_revoked(44),\n *   certificate_expired(45),\n *   certificate_unknown(46),\n *   illegal_parameter(47),\n *   unknown_ca(48),\n *   access_denied(49),\n *   decode_error(50),\n *   decrypt_error(51),\n *   export_restriction(60),\n *   protocol_version(70),\n *   insufficient_security(71),\n *   internal_error(80),\n *   user_canceled(90),\n *   no_renegotiation(100),\n *   (255)\n * } AlertDescription;\n *\n * struct {\n *   AlertLevel level;\n *   AlertDescription description;\n * } Alert;\n */\ntls.Alert = {};\ntls.Alert.Level = {\n  warning: 1,\n  fatal: 2\n};\ntls.Alert.Description = {\n  close_notify: 0,\n  unexpected_message: 10,\n  bad_record_mac: 20,\n  decryption_failed: 21,\n  record_overflow: 22,\n  decompression_failure: 30,\n  handshake_failure: 40,\n  bad_certificate: 42,\n  unsupported_certificate: 43,\n  certificate_revoked: 44,\n  certificate_expired: 45,\n  certificate_unknown: 46,\n  illegal_parameter: 47,\n  unknown_ca: 48,\n  access_denied: 49,\n  decode_error: 50,\n  decrypt_error: 51,\n  export_restriction: 60,\n  protocol_version: 70,\n  insufficient_security: 71,\n  internal_error: 80,\n  user_canceled: 90,\n  no_renegotiation: 100\n};\n\n/**\n * TLS Heartbeat Message types.\n * enum {\n *   heartbeat_request(1),\n *   heartbeat_response(2),\n *   (255)\n * } HeartbeatMessageType;\n */\ntls.HeartbeatMessageType = {\n  heartbeat_request: 1,\n  heartbeat_response: 2\n};\n\n/**\n * Supported cipher suites.\n */\ntls.CipherSuites = {};\n\n/**\n * Gets a supported cipher suite from its 2 byte ID.\n *\n * @param twoBytes two bytes in a string.\n *\n * @return the matching supported cipher suite or null.\n */\ntls.getCipherSuite = function(twoBytes) {\n  var rval = null;\n  for(var key in tls.CipherSuites) {\n    var cs = tls.CipherSuites[key];\n    if(cs.id[0] === twoBytes.charCodeAt(0) &&\n      cs.id[1] === twoBytes.charCodeAt(1)) {\n      rval = cs;\n      break;\n    }\n  }\n  return rval;\n};\n\n/**\n * Called when an unexpected record is encountered.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleUnexpected = function(c, record) {\n  // if connection is client and closed, ignore unexpected messages\n  var ignore = (!c.open && c.entity === tls.ConnectionEnd.client);\n  if(!ignore) {\n    c.error(c, {\n      message: 'Unexpected message. Received TLS record out of order.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.unexpected_message\n      }\n    });\n  }\n};\n\n/**\n * Called when a client receives a HelloRequest record.\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleHelloRequest = function(c, record, length) {\n  // ignore renegotiation requests from the server during a handshake, but\n  // if handshaking, send a warning alert that renegotation is denied\n  if(!c.handshaking && c.handshakes > 0) {\n    // send alert warning\n    tls.queue(c, tls.createAlert(c, {\n       level: tls.Alert.Level.warning,\n       description: tls.Alert.Description.no_renegotiation\n    }));\n    tls.flush(c);\n  }\n\n  // continue\n  c.process();\n};\n\n/**\n * Parses a hello message from a ClientHello or ServerHello record.\n *\n * @param record the record to parse.\n *\n * @return the parsed message.\n */\ntls.parseHelloMessage = function(c, record, length) {\n  var msg = null;\n\n  var client = (c.entity === tls.ConnectionEnd.client);\n\n  // minimum of 38 bytes in message\n  if(length < 38) {\n    c.error(c, {\n      message: client ?\n        'Invalid ServerHello message. Message too short.' :\n        'Invalid ClientHello message. Message too short.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  } else {\n    // use 'remaining' to calculate # of remaining bytes in the message\n    var b = record.fragment;\n    var remaining = b.length();\n    msg = {\n      version: {\n        major: b.getByte(),\n        minor: b.getByte()\n      },\n      random: forge.util.createBuffer(b.getBytes(32)),\n      session_id: readVector(b, 1),\n      extensions: []\n    };\n    if(client) {\n      msg.cipher_suite = b.getBytes(2);\n      msg.compression_method = b.getByte();\n    } else {\n      msg.cipher_suites = readVector(b, 2);\n      msg.compression_methods = readVector(b, 1);\n    }\n\n    // read extensions if there are any bytes left in the message\n    remaining = length - (remaining - b.length());\n    if(remaining > 0) {\n      // parse extensions\n      var exts = readVector(b, 2);\n      while(exts.length() > 0) {\n        msg.extensions.push({\n          type: [exts.getByte(), exts.getByte()],\n          data: readVector(exts, 2)\n        });\n      }\n\n      // TODO: make extension support modular\n      if(!client) {\n        for(var i = 0; i < msg.extensions.length; ++i) {\n          var ext = msg.extensions[i];\n\n          // support SNI extension\n          if(ext.type[0] === 0x00 && ext.type[1] === 0x00) {\n            // get server name list\n            var snl = readVector(ext.data, 2);\n            while(snl.length() > 0) {\n              // read server name type\n              var snType = snl.getByte();\n\n              // only HostName type (0x00) is known, break out if\n              // another type is detected\n              if(snType !== 0x00) {\n                break;\n              }\n\n              // add host name to server name list\n              c.session.extensions.server_name.serverNameList.push(\n                readVector(snl, 2).getBytes());\n            }\n          }\n        }\n      }\n    }\n\n    // version already set, do not allow version change\n    if(c.session.version) {\n      if(msg.version.major !== c.session.version.major ||\n        msg.version.minor !== c.session.version.minor) {\n        return c.error(c, {\n          message: 'TLS version change is disallowed during renegotiation.',\n          send: true,\n          alert: {\n            level: tls.Alert.Level.fatal,\n            description: tls.Alert.Description.protocol_version\n          }\n        });\n      }\n    }\n\n    // get the chosen (ServerHello) cipher suite\n    if(client) {\n      // FIXME: should be checking configured acceptable cipher suites\n      c.session.cipherSuite = tls.getCipherSuite(msg.cipher_suite);\n    } else {\n      // get a supported preferred (ClientHello) cipher suite\n      // choose the first supported cipher suite\n      var tmp = forge.util.createBuffer(msg.cipher_suites.bytes());\n      while(tmp.length() > 0) {\n        // FIXME: should be checking configured acceptable suites\n        // cipher suites take up 2 bytes\n        c.session.cipherSuite = tls.getCipherSuite(tmp.getBytes(2));\n        if(c.session.cipherSuite !== null) {\n          break;\n        }\n      }\n    }\n\n    // cipher suite not supported\n    if(c.session.cipherSuite === null) {\n      return c.error(c, {\n        message: 'No cipher suites in common.',\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.handshake_failure\n        },\n        cipherSuite: forge.util.bytesToHex(msg.cipher_suite)\n      });\n    }\n\n    // TODO: handle compression methods\n    if(client) {\n      c.session.compressionMethod = msg.compression_method;\n    } else {\n      // no compression\n      c.session.compressionMethod = tls.CompressionMethod.none;\n    }\n  }\n\n  return msg;\n};\n\n/**\n * Creates security parameters for the given connection based on the given\n * hello message.\n *\n * @param c the TLS connection.\n * @param msg the hello message.\n */\ntls.createSecurityParameters = function(c, msg) {\n  /* Note: security params are from TLS 1.2, some values like prf_algorithm\n  are ignored for TLS 1.0/1.1 and the builtin as specified in the spec is\n  used. */\n\n  // TODO: handle other options from server when more supported\n\n  // get client and server randoms\n  var client = (c.entity === tls.ConnectionEnd.client);\n  var msgRandom = msg.random.bytes();\n  var cRandom = client ? c.session.sp.client_random : msgRandom;\n  var sRandom = client ? msgRandom : tls.createRandom().getBytes();\n\n  // create new security parameters\n  c.session.sp = {\n    entity: c.entity,\n    prf_algorithm: tls.PRFAlgorithm.tls_prf_sha256,\n    bulk_cipher_algorithm: null,\n    cipher_type: null,\n    enc_key_length: null,\n    block_length: null,\n    fixed_iv_length: null,\n    record_iv_length: null,\n    mac_algorithm: null,\n    mac_length: null,\n    mac_key_length: null,\n    compression_algorithm: c.session.compressionMethod,\n    pre_master_secret: null,\n    master_secret: null,\n    client_random: cRandom,\n    server_random: sRandom\n  };\n};\n\n/**\n * Called when a client receives a ServerHello record.\n *\n * When a ServerHello message will be sent:\n *   The server will send this message in response to a client hello message\n *   when it was able to find an acceptable set of algorithms. If it cannot\n *   find such a match, it will respond with a handshake failure alert.\n *\n * uint24 length;\n * struct {\n *   ProtocolVersion server_version;\n *   Random random;\n *   SessionID session_id;\n *   CipherSuite cipher_suite;\n *   CompressionMethod compression_method;\n *   select(extensions_present) {\n *     case false:\n *       struct {};\n *     case true:\n *       Extension extensions<0..2^16-1>;\n *   };\n * } ServerHello;\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleServerHello = function(c, record, length) {\n  var msg = tls.parseHelloMessage(c, record, length);\n  if(c.fail) {\n    return;\n  }\n\n  // ensure server version is compatible\n  if(msg.version.minor <= c.version.minor) {\n    c.version.minor = msg.version.minor;\n  } else {\n    return c.error(c, {\n      message: 'Incompatible TLS version.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.protocol_version\n      }\n    });\n  }\n\n  // indicate session version has been set\n  c.session.version = c.version;\n\n  // get the session ID from the message\n  var sessionId = msg.session_id.bytes();\n\n  // if the session ID is not blank and matches the cached one, resume\n  // the session\n  if(sessionId.length > 0 && sessionId === c.session.id) {\n    // resuming session, expect a ChangeCipherSpec next\n    c.expect = SCC;\n    c.session.resuming = true;\n\n    // get new server random\n    c.session.sp.server_random = msg.random.bytes();\n  } else {\n    // not resuming, expect a server Certificate message next\n    c.expect = SCE;\n    c.session.resuming = false;\n\n    // create new security parameters\n    tls.createSecurityParameters(c, msg);\n  }\n\n  // set new session ID\n  c.session.id = sessionId;\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a server receives a ClientHello record.\n *\n * When a ClientHello message will be sent:\n *   When a client first connects to a server it is required to send the\n *   client hello as its first message. The client can also send a client\n *   hello in response to a hello request or on its own initiative in order\n *   to renegotiate the security parameters in an existing connection.\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleClientHello = function(c, record, length) {\n  var msg = tls.parseHelloMessage(c, record, length);\n  if(c.fail) {\n    return;\n  }\n\n  // get the session ID from the message\n  var sessionId = msg.session_id.bytes();\n\n  // see if the given session ID is in the cache\n  var session = null;\n  if(c.sessionCache) {\n    session = c.sessionCache.getSession(sessionId);\n    if(session === null) {\n      // session ID not found\n      sessionId = '';\n    } else if(session.version.major !== msg.version.major ||\n      session.version.minor > msg.version.minor) {\n      // if session version is incompatible with client version, do not resume\n      session = null;\n      sessionId = '';\n    }\n  }\n\n  // no session found to resume, generate a new session ID\n  if(sessionId.length === 0) {\n    sessionId = forge.random.getBytes(32);\n  }\n\n  // update session\n  c.session.id = sessionId;\n  c.session.clientHelloVersion = msg.version;\n  c.session.sp = {};\n  if(session) {\n    // use version and security parameters from resumed session\n    c.version = c.session.version = session.version;\n    c.session.sp = session.sp;\n  } else {\n    // use highest compatible minor version\n    var version;\n    for(var i = 1; i < tls.SupportedVersions.length; ++i) {\n      version = tls.SupportedVersions[i];\n      if(version.minor <= msg.version.minor) {\n        break;\n      }\n    }\n    c.version = {major: version.major, minor: version.minor};\n    c.session.version = c.version;\n  }\n\n  // if a session is set, resume it\n  if(session !== null) {\n    // resuming session, expect a ChangeCipherSpec next\n    c.expect = CCC;\n    c.session.resuming = true;\n\n    // get new client random\n    c.session.sp.client_random = msg.random.bytes();\n  } else {\n    // not resuming, expect a Certificate or ClientKeyExchange\n    c.expect = (c.verifyClient !== false) ? CCE : CKE;\n    c.session.resuming = false;\n\n    // create new security parameters\n    tls.createSecurityParameters(c, msg);\n  }\n\n  // connection now open\n  c.open = true;\n\n  // queue server hello\n  tls.queue(c, tls.createRecord(c, {\n    type: tls.ContentType.handshake,\n    data: tls.createServerHello(c)\n  }));\n\n  if(c.session.resuming) {\n    // queue change cipher spec message\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.change_cipher_spec,\n      data: tls.createChangeCipherSpec()\n    }));\n\n    // create pending state\n    c.state.pending = tls.createConnectionState(c);\n\n    // change current write state to pending write state\n    c.state.current.write = c.state.pending.write;\n\n    // queue finished\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.handshake,\n      data: tls.createFinished(c)\n    }));\n  } else {\n    // queue server certificate\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.handshake,\n      data: tls.createCertificate(c)\n    }));\n\n    if(!c.fail) {\n      // queue server key exchange\n      tls.queue(c, tls.createRecord(c, {\n        type: tls.ContentType.handshake,\n        data: tls.createServerKeyExchange(c)\n      }));\n\n      // request client certificate if set\n      if(c.verifyClient !== false) {\n        // queue certificate request\n        tls.queue(c, tls.createRecord(c, {\n          type: tls.ContentType.handshake,\n          data: tls.createCertificateRequest(c)\n        }));\n      }\n\n      // queue server hello done\n      tls.queue(c, tls.createRecord(c, {\n        type: tls.ContentType.handshake,\n        data: tls.createServerHelloDone(c)\n      }));\n    }\n  }\n\n  // send records\n  tls.flush(c);\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a client receives a Certificate record.\n *\n * When this message will be sent:\n *   The server must send a certificate whenever the agreed-upon key exchange\n *   method is not an anonymous one. This message will always immediately\n *   follow the server hello message.\n *\n * Meaning of this message:\n *   The certificate type must be appropriate for the selected cipher suite's\n *   key exchange algorithm, and is generally an X.509v3 certificate. It must\n *   contain a key which matches the key exchange method, as follows. Unless\n *   otherwise specified, the signing algorithm for the certificate must be\n *   the same as the algorithm for the certificate key. Unless otherwise\n *   specified, the public key may be of any length.\n *\n * opaque ASN.1Cert<1..2^24-1>;\n * struct {\n *   ASN.1Cert certificate_list<1..2^24-1>;\n * } Certificate;\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleCertificate = function(c, record, length) {\n  // minimum of 3 bytes in message\n  if(length < 3) {\n    return c.error(c, {\n      message: 'Invalid Certificate message. Message too short.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  }\n\n  var b = record.fragment;\n  var msg = {\n    certificate_list: readVector(b, 3)\n  };\n\n  /* The sender's certificate will be first in the list (chain), each\n    subsequent one that follows will certify the previous one, but root\n    certificates (self-signed) that specify the certificate authority may\n    be omitted under the assumption that clients must already possess it. */\n  var cert, asn1;\n  var certs = [];\n  try {\n    while(msg.certificate_list.length() > 0) {\n      // each entry in msg.certificate_list is a vector with 3 len bytes\n      cert = readVector(msg.certificate_list, 3);\n      asn1 = forge.asn1.fromDer(cert);\n      cert = forge.pki.certificateFromAsn1(asn1, true);\n      certs.push(cert);\n    }\n  } catch(ex) {\n    return c.error(c, {\n      message: 'Could not parse certificate list.',\n      cause: ex,\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.bad_certificate\n      }\n    });\n  }\n\n  // ensure at least 1 certificate was provided if in client-mode\n  // or if verifyClient was set to true to require a certificate\n  // (as opposed to 'optional')\n  var client = (c.entity === tls.ConnectionEnd.client);\n  if((client || c.verifyClient === true) && certs.length === 0) {\n    // error, no certificate\n    c.error(c, {\n      message: client ?\n        'No server certificate provided.' :\n        'No client certificate provided.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  } else if(certs.length === 0) {\n    // no certs to verify\n    // expect a ServerKeyExchange or ClientKeyExchange message next\n    c.expect = client ? SKE : CKE;\n  } else {\n    // save certificate in session\n    if(client) {\n      c.session.serverCertificate = certs[0];\n    } else {\n      c.session.clientCertificate = certs[0];\n    }\n\n    if(tls.verifyCertificateChain(c, certs)) {\n      // expect a ServerKeyExchange or ClientKeyExchange message next\n      c.expect = client ? SKE : CKE;\n    }\n  }\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a client receives a ServerKeyExchange record.\n *\n * When this message will be sent:\n *   This message will be sent immediately after the server certificate\n *   message (or the server hello message, if this is an anonymous\n *   negotiation).\n *\n *   The server key exchange message is sent by the server only when the\n *   server certificate message (if sent) does not contain enough data to\n *   allow the client to exchange a premaster secret.\n *\n * Meaning of this message:\n *   This message conveys cryptographic information to allow the client to\n *   communicate the premaster secret: either an RSA public key to encrypt\n *   the premaster secret with, or a Diffie-Hellman public key with which the\n *   client can complete a key exchange (with the result being the premaster\n *   secret.)\n *\n * enum {\n *   dhe_dss, dhe_rsa, dh_anon, rsa, dh_dss, dh_rsa\n * } KeyExchangeAlgorithm;\n *\n * struct {\n *   opaque dh_p<1..2^16-1>;\n *   opaque dh_g<1..2^16-1>;\n *   opaque dh_Ys<1..2^16-1>;\n * } ServerDHParams;\n *\n * struct {\n *   select(KeyExchangeAlgorithm) {\n *     case dh_anon:\n *       ServerDHParams params;\n *     case dhe_dss:\n *     case dhe_rsa:\n *       ServerDHParams params;\n *       digitally-signed struct {\n *         opaque client_random[32];\n *         opaque server_random[32];\n *         ServerDHParams params;\n *       } signed_params;\n *     case rsa:\n *     case dh_dss:\n *     case dh_rsa:\n *       struct {};\n *   };\n * } ServerKeyExchange;\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleServerKeyExchange = function(c, record, length) {\n  // this implementation only supports RSA, no Diffie-Hellman support\n  // so any length > 0 is invalid\n  if(length > 0) {\n    return c.error(c, {\n      message: 'Invalid key parameters. Only RSA is supported.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.unsupported_certificate\n      }\n    });\n  }\n\n  // expect an optional CertificateRequest message next\n  c.expect = SCR;\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a client receives a ClientKeyExchange record.\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleClientKeyExchange = function(c, record, length) {\n  // this implementation only supports RSA, no Diffie-Hellman support\n  // so any length < 48 is invalid\n  if(length < 48) {\n    return c.error(c, {\n      message: 'Invalid key parameters. Only RSA is supported.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.unsupported_certificate\n      }\n    });\n  }\n\n  var b = record.fragment;\n  var msg = {\n    enc_pre_master_secret: readVector(b, 2).getBytes()\n  };\n\n  // do rsa decryption\n  var privateKey = null;\n  if(c.getPrivateKey) {\n    try {\n      privateKey = c.getPrivateKey(c, c.session.serverCertificate);\n      privateKey = forge.pki.privateKeyFromPem(privateKey);\n    } catch(ex) {\n      c.error(c, {\n        message: 'Could not get private key.',\n        cause: ex,\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.internal_error\n        }\n      });\n    }\n  }\n\n  if(privateKey === null) {\n    return c.error(c, {\n      message: 'No private key set.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.internal_error\n      }\n    });\n  }\n\n  try {\n    // decrypt 48-byte pre-master secret\n    var sp = c.session.sp;\n    sp.pre_master_secret = privateKey.decrypt(msg.enc_pre_master_secret);\n\n    // ensure client hello version matches first 2 bytes\n    var version = c.session.clientHelloVersion;\n    if(version.major !== sp.pre_master_secret.charCodeAt(0) ||\n      version.minor !== sp.pre_master_secret.charCodeAt(1)) {\n      // error, do not send alert (see BLEI attack below)\n      throw new Error('TLS version rollback attack detected.');\n    }\n  } catch(ex) {\n    /* Note: Daniel Bleichenbacher [BLEI] can be used to attack a\n      TLS server which is using PKCS#1 encoded RSA, so instead of\n      failing here, we generate 48 random bytes and use that as\n      the pre-master secret. */\n    sp.pre_master_secret = forge.random.getBytes(48);\n  }\n\n  // expect a CertificateVerify message if a Certificate was received that\n  // does not have fixed Diffie-Hellman params, otherwise expect\n  // ChangeCipherSpec\n  c.expect = CCC;\n  if(c.session.clientCertificate !== null) {\n    // only RSA support, so expect CertificateVerify\n    // TODO: support Diffie-Hellman\n    c.expect = CCV;\n  }\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a client receives a CertificateRequest record.\n *\n * When this message will be sent:\n *   A non-anonymous server can optionally request a certificate from the\n *   client, if appropriate for the selected cipher suite. This message, if\n *   sent, will immediately follow the Server Key Exchange message (if it is\n *   sent; otherwise, the Server Certificate message).\n *\n * enum {\n *   rsa_sign(1), dss_sign(2), rsa_fixed_dh(3), dss_fixed_dh(4),\n *   rsa_ephemeral_dh_RESERVED(5), dss_ephemeral_dh_RESERVED(6),\n *   fortezza_dms_RESERVED(20), (255)\n * } ClientCertificateType;\n *\n * opaque DistinguishedName<1..2^16-1>;\n *\n * struct {\n *   ClientCertificateType certificate_types<1..2^8-1>;\n *   SignatureAndHashAlgorithm supported_signature_algorithms<2^16-1>;\n *   DistinguishedName certificate_authorities<0..2^16-1>;\n * } CertificateRequest;\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleCertificateRequest = function(c, record, length) {\n  // minimum of 3 bytes in message\n  if(length < 3) {\n    return c.error(c, {\n      message: 'Invalid CertificateRequest. Message too short.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  }\n\n  // TODO: TLS 1.2+ has different format including\n  // SignatureAndHashAlgorithm after cert types\n  var b = record.fragment;\n  var msg = {\n    certificate_types: readVector(b, 1),\n    certificate_authorities: readVector(b, 2)\n  };\n\n  // save certificate request in session\n  c.session.certificateRequest = msg;\n\n  // expect a ServerHelloDone message next\n  c.expect = SHD;\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a server receives a CertificateVerify record.\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleCertificateVerify = function(c, record, length) {\n  if(length < 2) {\n    return c.error(c, {\n      message: 'Invalid CertificateVerify. Message too short.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  }\n\n  // rewind to get full bytes for message so it can be manually\n  // digested below (special case for CertificateVerify messages because\n  // they must be digested *after* handling as opposed to all others)\n  var b = record.fragment;\n  b.read -= 4;\n  var msgBytes = b.bytes();\n  b.read += 4;\n\n  var msg = {\n    signature: readVector(b, 2).getBytes()\n  };\n\n  // TODO: add support for DSA\n\n  // generate data to verify\n  var verify = forge.util.createBuffer();\n  verify.putBuffer(c.session.md5.digest());\n  verify.putBuffer(c.session.sha1.digest());\n  verify = verify.getBytes();\n\n  try {\n    var cert = c.session.clientCertificate;\n    /*b = forge.pki.rsa.decrypt(\n      msg.signature, cert.publicKey, true, verify.length);\n    if(b !== verify) {*/\n    if(!cert.publicKey.verify(verify, msg.signature, 'NONE')) {\n      throw new Error('CertificateVerify signature does not match.');\n    }\n\n    // digest message now that it has been handled\n    c.session.md5.update(msgBytes);\n    c.session.sha1.update(msgBytes);\n  } catch(ex) {\n    return c.error(c, {\n      message: 'Bad signature in CertificateVerify.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.handshake_failure\n      }\n    });\n  }\n\n  // expect ChangeCipherSpec\n  c.expect = CCC;\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a client receives a ServerHelloDone record.\n *\n * When this message will be sent:\n *   The server hello done message is sent by the server to indicate the end\n *   of the server hello and associated messages. After sending this message\n *   the server will wait for a client response.\n *\n * Meaning of this message:\n *   This message means that the server is done sending messages to support\n *   the key exchange, and the client can proceed with its phase of the key\n *   exchange.\n *\n *   Upon receipt of the server hello done message the client should verify\n *   that the server provided a valid certificate if required and check that\n *   the server hello parameters are acceptable.\n *\n * struct {} ServerHelloDone;\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleServerHelloDone = function(c, record, length) {\n  // len must be 0 bytes\n  if(length > 0) {\n    return c.error(c, {\n      message: 'Invalid ServerHelloDone message. Invalid length.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.record_overflow\n      }\n    });\n  }\n\n  if(c.serverCertificate === null) {\n    // no server certificate was provided\n    var error = {\n      message: 'No server certificate provided. Not enough security.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.insufficient_security\n      }\n    };\n\n    // call application callback\n    var depth = 0;\n    var ret = c.verify(c, error.alert.description, depth, []);\n    if(ret !== true) {\n      // check for custom alert info\n      if(ret || ret === 0) {\n        // set custom message and alert description\n        if(typeof ret === 'object' && !forge.util.isArray(ret)) {\n          if(ret.message) {\n            error.message = ret.message;\n          }\n          if(ret.alert) {\n            error.alert.description = ret.alert;\n          }\n        } else if(typeof ret === 'number') {\n          // set custom alert description\n          error.alert.description = ret;\n        }\n      }\n\n      // send error\n      return c.error(c, error);\n    }\n  }\n\n  // create client certificate message if requested\n  if(c.session.certificateRequest !== null) {\n    record = tls.createRecord(c, {\n      type: tls.ContentType.handshake,\n      data: tls.createCertificate(c)\n    });\n    tls.queue(c, record);\n  }\n\n  // create client key exchange message\n  record = tls.createRecord(c, {\n     type: tls.ContentType.handshake,\n     data: tls.createClientKeyExchange(c)\n  });\n  tls.queue(c, record);\n\n  // expect no messages until the following callback has been called\n  c.expect = SER;\n\n  // create callback to handle client signature (for client-certs)\n  var callback = function(c, signature) {\n    if(c.session.certificateRequest !== null &&\n      c.session.clientCertificate !== null) {\n      // create certificate verify message\n      tls.queue(c, tls.createRecord(c, {\n        type: tls.ContentType.handshake,\n        data: tls.createCertificateVerify(c, signature)\n      }));\n    }\n\n    // create change cipher spec message\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.change_cipher_spec,\n      data: tls.createChangeCipherSpec()\n    }));\n\n    // create pending state\n    c.state.pending = tls.createConnectionState(c);\n\n    // change current write state to pending write state\n    c.state.current.write = c.state.pending.write;\n\n    // create finished message\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.handshake,\n      data: tls.createFinished(c)\n    }));\n\n    // expect a server ChangeCipherSpec message next\n    c.expect = SCC;\n\n    // send records\n    tls.flush(c);\n\n    // continue\n    c.process();\n  };\n\n  // if there is no certificate request or no client certificate, do\n  // callback immediately\n  if(c.session.certificateRequest === null ||\n    c.session.clientCertificate === null) {\n    return callback(c, null);\n  }\n\n  // otherwise get the client signature\n  tls.getClientSignature(c, callback);\n};\n\n/**\n * Called when a ChangeCipherSpec record is received.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleChangeCipherSpec = function(c, record) {\n  if(record.fragment.getByte() !== 0x01) {\n    return c.error(c, {\n      message: 'Invalid ChangeCipherSpec message received.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.illegal_parameter\n      }\n    });\n  }\n\n  // create pending state if:\n  // 1. Resuming session in client mode OR\n  // 2. NOT resuming session in server mode\n  var client = (c.entity === tls.ConnectionEnd.client);\n  if((c.session.resuming && client) || (!c.session.resuming && !client)) {\n    c.state.pending = tls.createConnectionState(c);\n  }\n\n  // change current read state to pending read state\n  c.state.current.read = c.state.pending.read;\n\n  // clear pending state if:\n  // 1. NOT resuming session in client mode OR\n  // 2. resuming a session in server mode\n  if((!c.session.resuming && client) || (c.session.resuming && !client)) {\n    c.state.pending = null;\n  }\n\n  // expect a Finished record next\n  c.expect = client ? SFI : CFI;\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a Finished record is received.\n *\n * When this message will be sent:\n *   A finished message is always sent immediately after a change\n *   cipher spec message to verify that the key exchange and\n *   authentication processes were successful. It is essential that a\n *   change cipher spec message be received between the other\n *   handshake messages and the Finished message.\n *\n * Meaning of this message:\n *   The finished message is the first protected with the just-\n *   negotiated algorithms, keys, and secrets. Recipients of finished\n *   messages must verify that the contents are correct.  Once a side\n *   has sent its Finished message and received and validated the\n *   Finished message from its peer, it may begin to send and receive\n *   application data over the connection.\n *\n * struct {\n *   opaque verify_data[verify_data_length];\n * } Finished;\n *\n * verify_data\n *   PRF(master_secret, finished_label, Hash(handshake_messages))\n *     [0..verify_data_length-1];\n *\n * finished_label\n *   For Finished messages sent by the client, the string\n *   \"client finished\". For Finished messages sent by the server, the\n *   string \"server finished\".\n *\n * verify_data_length depends on the cipher suite. If it is not specified\n * by the cipher suite, then it is 12. Versions of TLS < 1.2 always used\n * 12 bytes.\n *\n * @param c the connection.\n * @param record the record.\n * @param length the length of the handshake message.\n */\ntls.handleFinished = function(c, record, length) {\n  // rewind to get full bytes for message so it can be manually\n  // digested below (special case for Finished messages because they\n  // must be digested *after* handling as opposed to all others)\n  var b = record.fragment;\n  b.read -= 4;\n  var msgBytes = b.bytes();\n  b.read += 4;\n\n  // message contains only verify_data\n  var vd = record.fragment.getBytes();\n\n  // ensure verify data is correct\n  b = forge.util.createBuffer();\n  b.putBuffer(c.session.md5.digest());\n  b.putBuffer(c.session.sha1.digest());\n\n  // set label based on entity type\n  var client = (c.entity === tls.ConnectionEnd.client);\n  var label = client ? 'server finished' : 'client finished';\n\n  // TODO: determine prf function and verify length for TLS 1.2\n  var sp = c.session.sp;\n  var vdl = 12;\n  var prf = prf_TLS1;\n  b = prf(sp.master_secret, label, b.getBytes(), vdl);\n  if(b.getBytes() !== vd) {\n    return c.error(c, {\n      message: 'Invalid verify_data in Finished message.',\n      send: true,\n      alert: {\n        level: tls.Alert.Level.fatal,\n        description: tls.Alert.Description.decrypt_error\n      }\n    });\n  }\n\n  // digest finished message now that it has been handled\n  c.session.md5.update(msgBytes);\n  c.session.sha1.update(msgBytes);\n\n  // resuming session as client or NOT resuming session as server\n  if((c.session.resuming && client) || (!c.session.resuming && !client)) {\n    // create change cipher spec message\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.change_cipher_spec,\n      data: tls.createChangeCipherSpec()\n    }));\n\n    // change current write state to pending write state, clear pending\n    c.state.current.write = c.state.pending.write;\n    c.state.pending = null;\n\n    // create finished message\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.handshake,\n      data: tls.createFinished(c)\n    }));\n  }\n\n  // expect application data next\n  c.expect = client ? SAD : CAD;\n\n  // handshake complete\n  c.handshaking = false;\n  ++c.handshakes;\n\n  // save access to peer certificate\n  c.peerCertificate = client ?\n    c.session.serverCertificate : c.session.clientCertificate;\n\n  // send records\n  tls.flush(c);\n\n  // now connected\n  c.isConnected = true;\n  c.connected(c);\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when an Alert record is received.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleAlert = function(c, record) {\n  // read alert\n  var b = record.fragment;\n  var alert = {\n    level: b.getByte(),\n    description: b.getByte()\n  };\n\n  // TODO: consider using a table?\n  // get appropriate message\n  var msg;\n  switch(alert.description) {\n  case tls.Alert.Description.close_notify:\n    msg = 'Connection closed.';\n    break;\n  case tls.Alert.Description.unexpected_message:\n    msg = 'Unexpected message.';\n    break;\n  case tls.Alert.Description.bad_record_mac:\n    msg = 'Bad record MAC.';\n    break;\n  case tls.Alert.Description.decryption_failed:\n    msg = 'Decryption failed.';\n    break;\n  case tls.Alert.Description.record_overflow:\n    msg = 'Record overflow.';\n    break;\n  case tls.Alert.Description.decompression_failure:\n    msg = 'Decompression failed.';\n    break;\n  case tls.Alert.Description.handshake_failure:\n    msg = 'Handshake failure.';\n    break;\n  case tls.Alert.Description.bad_certificate:\n    msg = 'Bad certificate.';\n    break;\n  case tls.Alert.Description.unsupported_certificate:\n    msg = 'Unsupported certificate.';\n    break;\n  case tls.Alert.Description.certificate_revoked:\n    msg = 'Certificate revoked.';\n    break;\n  case tls.Alert.Description.certificate_expired:\n    msg = 'Certificate expired.';\n    break;\n  case tls.Alert.Description.certificate_unknown:\n    msg = 'Certificate unknown.';\n    break;\n  case tls.Alert.Description.illegal_parameter:\n    msg = 'Illegal parameter.';\n    break;\n  case tls.Alert.Description.unknown_ca:\n    msg = 'Unknown certificate authority.';\n    break;\n  case tls.Alert.Description.access_denied:\n    msg = 'Access denied.';\n    break;\n  case tls.Alert.Description.decode_error:\n    msg = 'Decode error.';\n    break;\n  case tls.Alert.Description.decrypt_error:\n    msg = 'Decrypt error.';\n    break;\n  case tls.Alert.Description.export_restriction:\n    msg = 'Export restriction.';\n    break;\n  case tls.Alert.Description.protocol_version:\n    msg = 'Unsupported protocol version.';\n    break;\n  case tls.Alert.Description.insufficient_security:\n    msg = 'Insufficient security.';\n    break;\n  case tls.Alert.Description.internal_error:\n    msg = 'Internal error.';\n    break;\n  case tls.Alert.Description.user_canceled:\n    msg = 'User canceled.';\n    break;\n  case tls.Alert.Description.no_renegotiation:\n    msg = 'Renegotiation not supported.';\n    break;\n  default:\n    msg = 'Unknown error.';\n    break;\n  }\n\n  // close connection on close_notify, not an error\n  if(alert.description === tls.Alert.Description.close_notify) {\n    return c.close();\n  }\n\n  // call error handler\n  c.error(c, {\n    message: msg,\n    send: false,\n    // origin is the opposite end\n    origin: (c.entity === tls.ConnectionEnd.client) ? 'server' : 'client',\n    alert: alert\n  });\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a Handshake record is received.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleHandshake = function(c, record) {\n  // get the handshake type and message length\n  var b = record.fragment;\n  var type = b.getByte();\n  var length = b.getInt24();\n\n  // see if the record fragment doesn't yet contain the full message\n  if(length > b.length()) {\n    // cache the record, clear its fragment, and reset the buffer read\n    // pointer before the type and length were read\n    c.fragmented = record;\n    record.fragment = forge.util.createBuffer();\n    b.read -= 4;\n\n    // continue\n    return c.process();\n  }\n\n  // full message now available, clear cache, reset read pointer to\n  // before type and length\n  c.fragmented = null;\n  b.read -= 4;\n\n  // save the handshake bytes for digestion after handler is found\n  // (include type and length of handshake msg)\n  var bytes = b.bytes(length + 4);\n\n  // restore read pointer\n  b.read += 4;\n\n  // handle expected message\n  if(type in hsTable[c.entity][c.expect]) {\n    // initialize server session\n    if(c.entity === tls.ConnectionEnd.server && !c.open && !c.fail) {\n      c.handshaking = true;\n      c.session = {\n        version: null,\n        extensions: {\n          server_name: {\n            serverNameList: []\n          }\n        },\n        cipherSuite: null,\n        compressionMethod: null,\n        serverCertificate: null,\n        clientCertificate: null,\n        md5: forge.md.md5.create(),\n        sha1: forge.md.sha1.create()\n      };\n    }\n\n    /* Update handshake messages digest. Finished and CertificateVerify\n      messages are not digested here. They can't be digested as part of\n      the verify_data that they contain. These messages are manually\n      digested in their handlers. HelloRequest messages are simply never\n      included in the handshake message digest according to spec. */\n    if(type !== tls.HandshakeType.hello_request &&\n      type !== tls.HandshakeType.certificate_verify &&\n      type !== tls.HandshakeType.finished) {\n      c.session.md5.update(bytes);\n      c.session.sha1.update(bytes);\n    }\n\n    // handle specific handshake type record\n    hsTable[c.entity][c.expect][type](c, record, length);\n  } else {\n    // unexpected record\n    tls.handleUnexpected(c, record);\n  }\n};\n\n/**\n * Called when an ApplicationData record is received.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleApplicationData = function(c, record) {\n  // buffer data, notify that its ready\n  c.data.putBuffer(record.fragment);\n  c.dataReady(c);\n\n  // continue\n  c.process();\n};\n\n/**\n * Called when a Heartbeat record is received.\n *\n * @param c the connection.\n * @param record the record.\n */\ntls.handleHeartbeat = function(c, record) {\n  // get the heartbeat type and payload\n  var b = record.fragment;\n  var type = b.getByte();\n  var length = b.getInt16();\n  var payload = b.getBytes(length);\n\n  if(type === tls.HeartbeatMessageType.heartbeat_request) {\n    // discard request during handshake or if length is too large\n    if(c.handshaking || length > payload.length) {\n      // continue\n      return c.process();\n    }\n    // retransmit payload\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.heartbeat,\n      data: tls.createHeartbeat(\n        tls.HeartbeatMessageType.heartbeat_response, payload)\n    }));\n    tls.flush(c);\n  } else if(type === tls.HeartbeatMessageType.heartbeat_response) {\n    // check payload against expected payload, discard heartbeat if no match\n    if(payload !== c.expectedHeartbeatPayload) {\n      // continue\n      return c.process();\n    }\n\n    // notify that a valid heartbeat was received\n    if(c.heartbeatReceived) {\n      c.heartbeatReceived(c, forge.util.createBuffer(payload));\n    }\n  }\n\n  // continue\n  c.process();\n};\n\n/**\n * The transistional state tables for receiving TLS records. It maps the\n * current TLS engine state and a received record to a function to handle the\n * record and update the state.\n *\n * For instance, if the current state is SHE, then the TLS engine is expecting\n * a ServerHello record. Once a record is received, the handler function is\n * looked up using the state SHE and the record's content type.\n *\n * The resulting function will either be an error handler or a record handler.\n * The function will take whatever action is appropriate and update the state\n * for the next record.\n *\n * The states are all based on possible server record types. Note that the\n * client will never specifically expect to receive a HelloRequest or an alert\n * from the server so there is no state that reflects this. These messages may\n * occur at any time.\n *\n * There are two tables for mapping states because there is a second tier of\n * types for handshake messages. Once a record with a content type of handshake\n * is received, the handshake record handler will look up the handshake type in\n * the secondary map to get its appropriate handler.\n *\n * Valid message orders are as follows:\n *\n * =======================FULL HANDSHAKE======================\n * Client                                               Server\n *\n * ClientHello                  --------\x3e\n *                                                 ServerHello\n *                                                Certificate*\n *                                          ServerKeyExchange*\n *                                         CertificateRequest*\n *                              <--------      ServerHelloDone\n * Certificate*\n * ClientKeyExchange\n * CertificateVerify*\n * [ChangeCipherSpec]\n * Finished                     --------\x3e\n *                                          [ChangeCipherSpec]\n *                              <--------             Finished\n * Application Data             <-------\x3e     Application Data\n *\n * =====================SESSION RESUMPTION=====================\n * Client                                                Server\n *\n * ClientHello                   --------\x3e\n *                                                  ServerHello\n *                                           [ChangeCipherSpec]\n *                               <--------             Finished\n * [ChangeCipherSpec]\n * Finished                      --------\x3e\n * Application Data              <-------\x3e     Application Data\n */\n// client expect states (indicate which records are expected to be received)\nvar SHE = 0; // rcv server hello\nvar SCE = 1; // rcv server certificate\nvar SKE = 2; // rcv server key exchange\nvar SCR = 3; // rcv certificate request\nvar SHD = 4; // rcv server hello done\nvar SCC = 5; // rcv change cipher spec\nvar SFI = 6; // rcv finished\nvar SAD = 7; // rcv application data\nvar SER = 8; // not expecting any messages at this point\n\n// server expect states\nvar CHE = 0; // rcv client hello\nvar CCE = 1; // rcv client certificate\nvar CKE = 2; // rcv client key exchange\nvar CCV = 3; // rcv certificate verify\nvar CCC = 4; // rcv change cipher spec\nvar CFI = 5; // rcv finished\nvar CAD = 6; // rcv application data\nvar CER = 7; // not expecting any messages at this point\n\n// map client current expect state and content type to function\nvar __ = tls.handleUnexpected;\nvar R0 = tls.handleChangeCipherSpec;\nvar R1 = tls.handleAlert;\nvar R2 = tls.handleHandshake;\nvar R3 = tls.handleApplicationData;\nvar R4 = tls.handleHeartbeat;\nvar ctTable = [];\nctTable[tls.ConnectionEnd.client] = [\n//      CC,AL,HS,AD,HB\n/*SHE*/[__,R1,R2,__,R4],\n/*SCE*/[__,R1,R2,__,R4],\n/*SKE*/[__,R1,R2,__,R4],\n/*SCR*/[__,R1,R2,__,R4],\n/*SHD*/[__,R1,R2,__,R4],\n/*SCC*/[R0,R1,__,__,R4],\n/*SFI*/[__,R1,R2,__,R4],\n/*SAD*/[__,R1,R2,R3,R4],\n/*SER*/[__,R1,R2,__,R4]\n];\n\n// map server current expect state and content type to function\nctTable[tls.ConnectionEnd.server] = [\n//      CC,AL,HS,AD\n/*CHE*/[__,R1,R2,__,R4],\n/*CCE*/[__,R1,R2,__,R4],\n/*CKE*/[__,R1,R2,__,R4],\n/*CCV*/[__,R1,R2,__,R4],\n/*CCC*/[R0,R1,__,__,R4],\n/*CFI*/[__,R1,R2,__,R4],\n/*CAD*/[__,R1,R2,R3,R4],\n/*CER*/[__,R1,R2,__,R4]\n];\n\n// map client current expect state and handshake type to function\nvar H0 = tls.handleHelloRequest;\nvar H1 = tls.handleServerHello;\nvar H2 = tls.handleCertificate;\nvar H3 = tls.handleServerKeyExchange;\nvar H4 = tls.handleCertificateRequest;\nvar H5 = tls.handleServerHelloDone;\nvar H6 = tls.handleFinished;\nvar hsTable = [];\nhsTable[tls.ConnectionEnd.client] = [\n//      HR,01,SH,03,04,05,06,07,08,09,10,SC,SK,CR,HD,15,CK,17,18,19,FI\n/*SHE*/[__,__,H1,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*SCE*/[H0,__,__,__,__,__,__,__,__,__,__,H2,H3,H4,H5,__,__,__,__,__,__],\n/*SKE*/[H0,__,__,__,__,__,__,__,__,__,__,__,H3,H4,H5,__,__,__,__,__,__],\n/*SCR*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,H4,H5,__,__,__,__,__,__],\n/*SHD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,H5,__,__,__,__,__,__],\n/*SCC*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*SFI*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6],\n/*SAD*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*SER*/[H0,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__]\n];\n\n// map server current expect state and handshake type to function\n// Note: CAD[CH] does not map to FB because renegotation is prohibited\nvar H7 = tls.handleClientHello;\nvar H8 = tls.handleClientKeyExchange;\nvar H9 = tls.handleCertificateVerify;\nhsTable[tls.ConnectionEnd.server] = [\n//      01,CH,02,03,04,05,06,07,08,09,10,CC,12,13,14,CV,CK,17,18,19,FI\n/*CHE*/[__,H7,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*CCE*/[__,__,__,__,__,__,__,__,__,__,__,H2,__,__,__,__,__,__,__,__,__],\n/*CKE*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H8,__,__,__,__],\n/*CCV*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H9,__,__,__,__,__],\n/*CCC*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*CFI*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,H6],\n/*CAD*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__],\n/*CER*/[__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__]\n];\n\n/**\n * Generates the master_secret and keys using the given security parameters.\n *\n * The security parameters for a TLS connection state are defined as such:\n *\n * struct {\n *   ConnectionEnd          entity;\n *   PRFAlgorithm           prf_algorithm;\n *   BulkCipherAlgorithm    bulk_cipher_algorithm;\n *   CipherType             cipher_type;\n *   uint8                  enc_key_length;\n *   uint8                  block_length;\n *   uint8                  fixed_iv_length;\n *   uint8                  record_iv_length;\n *   MACAlgorithm           mac_algorithm;\n *   uint8                  mac_length;\n *   uint8                  mac_key_length;\n *   CompressionMethod      compression_algorithm;\n *   opaque                 master_secret[48];\n *   opaque                 client_random[32];\n *   opaque                 server_random[32];\n * } SecurityParameters;\n *\n * Note that this definition is from TLS 1.2. In TLS 1.0 some of these\n * parameters are ignored because, for instance, the PRFAlgorithm is a\n * builtin-fixed algorithm combining iterations of MD5 and SHA-1 in TLS 1.0.\n *\n * The Record Protocol requires an algorithm to generate keys required by the\n * current connection state.\n *\n * The master secret is expanded into a sequence of secure bytes, which is then\n * split to a client write MAC key, a server write MAC key, a client write\n * encryption key, and a server write encryption key. In TLS 1.0 a client write\n * IV and server write IV are also generated. Each of these is generated from\n * the byte sequence in that order. Unused values are empty. In TLS 1.2, some\n * AEAD ciphers may additionally require a client write IV and a server write\n * IV (see Section 6.2.3.3).\n *\n * When keys, MAC keys, and IVs are generated, the master secret is used as an\n * entropy source.\n *\n * To generate the key material, compute:\n *\n * master_secret = PRF(pre_master_secret, \"master secret\",\n *                     ClientHello.random + ServerHello.random)\n *\n * key_block = PRF(SecurityParameters.master_secret,\n *                 \"key expansion\",\n *                 SecurityParameters.server_random +\n *                 SecurityParameters.client_random);\n *\n * until enough output has been generated. Then, the key_block is\n * partitioned as follows:\n *\n * client_write_MAC_key[SecurityParameters.mac_key_length]\n * server_write_MAC_key[SecurityParameters.mac_key_length]\n * client_write_key[SecurityParameters.enc_key_length]\n * server_write_key[SecurityParameters.enc_key_length]\n * client_write_IV[SecurityParameters.fixed_iv_length]\n * server_write_IV[SecurityParameters.fixed_iv_length]\n *\n * In TLS 1.2, the client_write_IV and server_write_IV are only generated for\n * implicit nonce techniques as described in Section 3.2.1 of [AEAD]. This\n * implementation uses TLS 1.0 so IVs are generated.\n *\n * Implementation note: The currently defined cipher suite which requires the\n * most material is AES_256_CBC_SHA256. It requires 2 x 32 byte keys and 2 x 32\n * byte MAC keys, for a total 128 bytes of key material. In TLS 1.0 it also\n * requires 2 x 16 byte IVs, so it actually takes 160 bytes of key material.\n *\n * @param c the connection.\n * @param sp the security parameters to use.\n *\n * @return the security keys.\n */\ntls.generateKeys = function(c, sp) {\n  // TLS_RSA_WITH_AES_128_CBC_SHA (required to be compliant with TLS 1.2) &\n  // TLS_RSA_WITH_AES_256_CBC_SHA are the only cipher suites implemented\n  // at present\n\n  // TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA is required to be compliant with\n  // TLS 1.0 but we don't care right now because AES is better and we have\n  // an implementation for it\n\n  // TODO: TLS 1.2 implementation\n  /*\n  // determine the PRF\n  var prf;\n  switch(sp.prf_algorithm) {\n  case tls.PRFAlgorithm.tls_prf_sha256:\n    prf = prf_sha256;\n    break;\n  default:\n    // should never happen\n    throw new Error('Invalid PRF');\n  }\n  */\n\n  // TLS 1.0/1.1 implementation\n  var prf = prf_TLS1;\n\n  // concatenate server and client random\n  var random = sp.client_random + sp.server_random;\n\n  // only create master secret if session is new\n  if(!c.session.resuming) {\n    // create master secret, clean up pre-master secret\n    sp.master_secret = prf(\n      sp.pre_master_secret, 'master secret', random, 48).bytes();\n    sp.pre_master_secret = null;\n  }\n\n  // generate the amount of key material needed\n  random = sp.server_random + sp.client_random;\n  var length = 2 * sp.mac_key_length + 2 * sp.enc_key_length;\n\n  // include IV for TLS/1.0\n  var tls10 = (c.version.major === tls.Versions.TLS_1_0.major &&\n    c.version.minor === tls.Versions.TLS_1_0.minor);\n  if(tls10) {\n    length += 2 * sp.fixed_iv_length;\n  }\n  var km = prf(sp.master_secret, 'key expansion', random, length);\n\n  // split the key material into the MAC and encryption keys\n  var rval = {\n    client_write_MAC_key: km.getBytes(sp.mac_key_length),\n    server_write_MAC_key: km.getBytes(sp.mac_key_length),\n    client_write_key: km.getBytes(sp.enc_key_length),\n    server_write_key: km.getBytes(sp.enc_key_length)\n  };\n\n  // include TLS 1.0 IVs\n  if(tls10) {\n    rval.client_write_IV = km.getBytes(sp.fixed_iv_length);\n    rval.server_write_IV = km.getBytes(sp.fixed_iv_length);\n  }\n\n  return rval;\n};\n\n/**\n * Creates a new initialized TLS connection state. A connection state has\n * a read mode and a write mode.\n *\n * compression state:\n *   The current state of the compression algorithm.\n *\n * cipher state:\n *   The current state of the encryption algorithm. This will consist of the\n *   scheduled key for that connection. For stream ciphers, this will also\n *   contain whatever state information is necessary to allow the stream to\n *   continue to encrypt or decrypt data.\n *\n * MAC key:\n *   The MAC key for the connection.\n *\n * sequence number:\n *   Each connection state contains a sequence number, which is maintained\n *   separately for read and write states. The sequence number MUST be set to\n *   zero whenever a connection state is made the active state. Sequence\n *   numbers are of type uint64 and may not exceed 2^64-1. Sequence numbers do\n *   not wrap. If a TLS implementation would need to wrap a sequence number,\n *   it must renegotiate instead. A sequence number is incremented after each\n *   record: specifically, the first record transmitted under a particular\n *   connection state MUST use sequence number 0.\n *\n * @param c the connection.\n *\n * @return the new initialized TLS connection state.\n */\ntls.createConnectionState = function(c) {\n  var client = (c.entity === tls.ConnectionEnd.client);\n\n  var createMode = function() {\n    var mode = {\n      // two 32-bit numbers, first is most significant\n      sequenceNumber: [0, 0],\n      macKey: null,\n      macLength: 0,\n      macFunction: null,\n      cipherState: null,\n      cipherFunction: function(record) {return true;},\n      compressionState: null,\n      compressFunction: function(record) {return true;},\n      updateSequenceNumber: function() {\n        if(mode.sequenceNumber[1] === 0xFFFFFFFF) {\n          mode.sequenceNumber[1] = 0;\n          ++mode.sequenceNumber[0];\n        } else {\n          ++mode.sequenceNumber[1];\n        }\n      }\n    };\n    return mode;\n  };\n  var state = {\n    read: createMode(),\n    write: createMode()\n  };\n\n  // update function in read mode will decrypt then decompress a record\n  state.read.update = function(c, record) {\n    if(!state.read.cipherFunction(record, state.read)) {\n      c.error(c, {\n        message: 'Could not decrypt record or bad MAC.',\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          // doesn't matter if decryption failed or MAC was\n          // invalid, return the same error so as not to reveal\n          // which one occurred\n          description: tls.Alert.Description.bad_record_mac\n        }\n      });\n    } else if(!state.read.compressFunction(c, record, state.read)) {\n      c.error(c, {\n        message: 'Could not decompress record.',\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.decompression_failure\n        }\n      });\n    }\n    return !c.fail;\n  };\n\n  // update function in write mode will compress then encrypt a record\n  state.write.update = function(c, record) {\n    if(!state.write.compressFunction(c, record, state.write)) {\n      // error, but do not send alert since it would require\n      // compression as well\n      c.error(c, {\n        message: 'Could not compress record.',\n        send: false,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.internal_error\n        }\n      });\n    } else if(!state.write.cipherFunction(record, state.write)) {\n      // error, but do not send alert since it would require\n      // encryption as well\n      c.error(c, {\n        message: 'Could not encrypt record.',\n        send: false,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.internal_error\n        }\n      });\n    }\n    return !c.fail;\n  };\n\n  // handle security parameters\n  if(c.session) {\n    var sp = c.session.sp;\n    c.session.cipherSuite.initSecurityParameters(sp);\n\n    // generate keys\n    sp.keys = tls.generateKeys(c, sp);\n    state.read.macKey = client ?\n      sp.keys.server_write_MAC_key : sp.keys.client_write_MAC_key;\n    state.write.macKey = client ?\n      sp.keys.client_write_MAC_key : sp.keys.server_write_MAC_key;\n\n    // cipher suite setup\n    c.session.cipherSuite.initConnectionState(state, c, sp);\n\n    // compression setup\n    switch(sp.compression_algorithm) {\n    case tls.CompressionMethod.none:\n      break;\n    case tls.CompressionMethod.deflate:\n      state.read.compressFunction = inflate;\n      state.write.compressFunction = deflate;\n      break;\n    default:\n      throw new Error('Unsupported compression algorithm.');\n    }\n  }\n\n  return state;\n};\n\n/**\n * Creates a Random structure.\n *\n * struct {\n *   uint32 gmt_unix_time;\n *   opaque random_bytes[28];\n * } Random;\n *\n * gmt_unix_time:\n *   The current time and date in standard UNIX 32-bit format (seconds since\n *   the midnight starting Jan 1, 1970, UTC, ignoring leap seconds) according\n *   to the sender's internal clock. Clocks are not required to be set\n *   correctly by the basic TLS protocol; higher-level or application\n *   protocols may define additional requirements. Note that, for historical\n *   reasons, the data element is named using GMT, the predecessor of the\n *   current worldwide time base, UTC.\n * random_bytes:\n *   28 bytes generated by a secure random number generator.\n *\n * @return the Random structure as a byte array.\n */\ntls.createRandom = function() {\n  // get UTC milliseconds\n  var d = new Date();\n  var utc = +d + d.getTimezoneOffset() * 60000;\n  var rval = forge.util.createBuffer();\n  rval.putInt32(utc);\n  rval.putBytes(forge.random.getBytes(28));\n  return rval;\n};\n\n/**\n * Creates a TLS record with the given type and data.\n *\n * @param c the connection.\n * @param options:\n *   type: the record type.\n *   data: the plain text data in a byte buffer.\n *\n * @return the created record.\n */\ntls.createRecord = function(c, options) {\n  if(!options.data) {\n    return null;\n  }\n  var record = {\n    type: options.type,\n    version: {\n      major: c.version.major,\n      minor: c.version.minor\n    },\n    length: options.data.length(),\n    fragment: options.data\n  };\n  return record;\n};\n\n/**\n * Creates a TLS alert record.\n *\n * @param c the connection.\n * @param alert:\n *   level: the TLS alert level.\n *   description: the TLS alert description.\n *\n * @return the created alert record.\n */\ntls.createAlert = function(c, alert) {\n  var b = forge.util.createBuffer();\n  b.putByte(alert.level);\n  b.putByte(alert.description);\n  return tls.createRecord(c, {\n    type: tls.ContentType.alert,\n    data: b\n  });\n};\n\n/* The structure of a TLS handshake message.\n *\n * struct {\n *    HandshakeType msg_type;    // handshake type\n *    uint24 length;             // bytes in message\n *    select(HandshakeType) {\n *       case hello_request:       HelloRequest;\n *       case client_hello:        ClientHello;\n *       case server_hello:        ServerHello;\n *       case certificate:         Certificate;\n *       case server_key_exchange: ServerKeyExchange;\n *       case certificate_request: CertificateRequest;\n *       case server_hello_done:   ServerHelloDone;\n *       case certificate_verify:  CertificateVerify;\n *       case client_key_exchange: ClientKeyExchange;\n *       case finished:            Finished;\n *    } body;\n * } Handshake;\n */\n\n/**\n * Creates a ClientHello message.\n *\n * opaque SessionID<0..32>;\n * enum { null(0), deflate(1), (255) } CompressionMethod;\n * uint8 CipherSuite[2];\n *\n * struct {\n *   ProtocolVersion client_version;\n *   Random random;\n *   SessionID session_id;\n *   CipherSuite cipher_suites<2..2^16-2>;\n *   CompressionMethod compression_methods<1..2^8-1>;\n *   select(extensions_present) {\n *     case false:\n *       struct {};\n *     case true:\n *       Extension extensions<0..2^16-1>;\n *   };\n * } ClientHello;\n *\n * The extension format for extended client hellos and server hellos is:\n *\n * struct {\n *   ExtensionType extension_type;\n *   opaque extension_data<0..2^16-1>;\n * } Extension;\n *\n * Here:\n *\n * - \"extension_type\" identifies the particular extension type.\n * - \"extension_data\" contains information specific to the particular\n * extension type.\n *\n * The extension types defined in this document are:\n *\n * enum {\n *   server_name(0), max_fragment_length(1),\n *   client_certificate_url(2), trusted_ca_keys(3),\n *   truncated_hmac(4), status_request(5), (65535)\n * } ExtensionType;\n *\n * @param c the connection.\n *\n * @return the ClientHello byte buffer.\n */\ntls.createClientHello = function(c) {\n  // save hello version\n  c.session.clientHelloVersion = {\n    major: c.version.major,\n    minor: c.version.minor\n  };\n\n  // create supported cipher suites\n  var cipherSuites = forge.util.createBuffer();\n  for(var i = 0; i < c.cipherSuites.length; ++i) {\n    var cs = c.cipherSuites[i];\n    cipherSuites.putByte(cs.id[0]);\n    cipherSuites.putByte(cs.id[1]);\n  }\n  var cSuites = cipherSuites.length();\n\n  // create supported compression methods, null always supported, but\n  // also support deflate if connection has inflate and deflate methods\n  var compressionMethods = forge.util.createBuffer();\n  compressionMethods.putByte(tls.CompressionMethod.none);\n  // FIXME: deflate support disabled until issues with raw deflate data\n  // without zlib headers are resolved\n  /*\n  if(c.inflate !== null && c.deflate !== null) {\n    compressionMethods.putByte(tls.CompressionMethod.deflate);\n  }\n  */\n  var cMethods = compressionMethods.length();\n\n  // create TLS SNI (server name indication) extension if virtual host\n  // has been specified, see RFC 3546\n  var extensions = forge.util.createBuffer();\n  if(c.virtualHost) {\n    // create extension struct\n    var ext = forge.util.createBuffer();\n    ext.putByte(0x00); // type server_name (ExtensionType is 2 bytes)\n    ext.putByte(0x00);\n\n    /* In order to provide the server name, clients MAY include an\n     * extension of type \"server_name\" in the (extended) client hello.\n     * The \"extension_data\" field of this extension SHALL contain\n     * \"ServerNameList\" where:\n     *\n     * struct {\n     *   NameType name_type;\n     *   select(name_type) {\n     *     case host_name: HostName;\n     *   } name;\n     * } ServerName;\n     *\n     * enum {\n     *   host_name(0), (255)\n     * } NameType;\n     *\n     * opaque HostName<1..2^16-1>;\n     *\n     * struct {\n     *   ServerName server_name_list<1..2^16-1>\n     * } ServerNameList;\n     */\n    var serverName = forge.util.createBuffer();\n    serverName.putByte(0x00); // type host_name\n    writeVector(serverName, 2, forge.util.createBuffer(c.virtualHost));\n\n    // ServerNameList is in extension_data\n    var snList = forge.util.createBuffer();\n    writeVector(snList, 2, serverName);\n    writeVector(ext, 2, snList);\n    extensions.putBuffer(ext);\n  }\n  var extLength = extensions.length();\n  if(extLength > 0) {\n    // add extension vector length\n    extLength += 2;\n  }\n\n  // determine length of the handshake message\n  // cipher suites and compression methods size will need to be\n  // updated if more get added to the list\n  var sessionId = c.session.id;\n  var length =\n    sessionId.length + 1 + // session ID vector\n    2 +                    // version (major + minor)\n    4 + 28 +               // random time and random bytes\n    2 + cSuites +          // cipher suites vector\n    1 + cMethods +         // compression methods vector\n    extLength;             // extensions vector\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.client_hello);\n  rval.putInt24(length);                     // handshake length\n  rval.putByte(c.version.major);             // major version\n  rval.putByte(c.version.minor);             // minor version\n  rval.putBytes(c.session.sp.client_random); // random time + bytes\n  writeVector(rval, 1, forge.util.createBuffer(sessionId));\n  writeVector(rval, 2, cipherSuites);\n  writeVector(rval, 1, compressionMethods);\n  if(extLength > 0) {\n    writeVector(rval, 2, extensions);\n  }\n  return rval;\n};\n\n/**\n * Creates a ServerHello message.\n *\n * @param c the connection.\n *\n * @return the ServerHello byte buffer.\n */\ntls.createServerHello = function(c) {\n  // determine length of the handshake message\n  var sessionId = c.session.id;\n  var length =\n    sessionId.length + 1 + // session ID vector\n    2 +                    // version (major + minor)\n    4 + 28 +               // random time and random bytes\n    2 +                    // chosen cipher suite\n    1;                     // chosen compression method\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.server_hello);\n  rval.putInt24(length);                     // handshake length\n  rval.putByte(c.version.major);             // major version\n  rval.putByte(c.version.minor);             // minor version\n  rval.putBytes(c.session.sp.server_random); // random time + bytes\n  writeVector(rval, 1, forge.util.createBuffer(sessionId));\n  rval.putByte(c.session.cipherSuite.id[0]);\n  rval.putByte(c.session.cipherSuite.id[1]);\n  rval.putByte(c.session.compressionMethod);\n  return rval;\n};\n\n/**\n * Creates a Certificate message.\n *\n * When this message will be sent:\n *   This is the first message the client can send after receiving a server\n *   hello done message and the first message the server can send after\n *   sending a ServerHello. This client message is only sent if the server\n *   requests a certificate. If no suitable certificate is available, the\n *   client should send a certificate message containing no certificates. If\n *   client authentication is required by the server for the handshake to\n *   continue, it may respond with a fatal handshake failure alert.\n *\n * opaque ASN.1Cert<1..2^24-1>;\n *\n * struct {\n *   ASN.1Cert certificate_list<0..2^24-1>;\n * } Certificate;\n *\n * @param c the connection.\n *\n * @return the Certificate byte buffer.\n */\ntls.createCertificate = function(c) {\n  // TODO: check certificate request to ensure types are supported\n\n  // get a certificate (a certificate as a PEM string)\n  var client = (c.entity === tls.ConnectionEnd.client);\n  var cert = null;\n  if(c.getCertificate) {\n    var hint;\n    if(client) {\n      hint = c.session.certificateRequest;\n    } else {\n      hint = c.session.extensions.server_name.serverNameList;\n    }\n    cert = c.getCertificate(c, hint);\n  }\n\n  // buffer to hold certificate list\n  var certList = forge.util.createBuffer();\n  if(cert !== null) {\n    try {\n      // normalize cert to a chain of certificates\n      if(!forge.util.isArray(cert)) {\n        cert = [cert];\n      }\n      var asn1 = null;\n      for(var i = 0; i < cert.length; ++i) {\n        var msg = forge.pem.decode(cert[i])[0];\n        if(msg.type !== 'CERTIFICATE' &&\n          msg.type !== 'X509 CERTIFICATE' &&\n          msg.type !== 'TRUSTED CERTIFICATE') {\n          var error = new Error('Could not convert certificate from PEM; PEM ' +\n            'header type is not \"CERTIFICATE\", \"X509 CERTIFICATE\", or ' +\n            '\"TRUSTED CERTIFICATE\".');\n          error.headerType = msg.type;\n          throw error;\n        }\n        if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n          throw new Error('Could not convert certificate from PEM; PEM is encrypted.');\n        }\n\n        var der = forge.util.createBuffer(msg.body);\n        if(asn1 === null) {\n          asn1 = forge.asn1.fromDer(der.bytes(), false);\n        }\n\n        // certificate entry is itself a vector with 3 length bytes\n        var certBuffer = forge.util.createBuffer();\n        writeVector(certBuffer, 3, der);\n\n        // add cert vector to cert list vector\n        certList.putBuffer(certBuffer);\n      }\n\n      // save certificate\n      cert = forge.pki.certificateFromAsn1(asn1);\n      if(client) {\n        c.session.clientCertificate = cert;\n      } else {\n        c.session.serverCertificate = cert;\n      }\n    } catch(ex) {\n      return c.error(c, {\n        message: 'Could not send certificate list.',\n        cause: ex,\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.bad_certificate\n        }\n      });\n    }\n  }\n\n  // determine length of the handshake message\n  var length = 3 + certList.length(); // cert list vector\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.certificate);\n  rval.putInt24(length);\n  writeVector(rval, 3, certList);\n  return rval;\n};\n\n/**\n * Creates a ClientKeyExchange message.\n *\n * When this message will be sent:\n *   This message is always sent by the client. It will immediately follow the\n *   client certificate message, if it is sent. Otherwise it will be the first\n *   message sent by the client after it receives the server hello done\n *   message.\n *\n * Meaning of this message:\n *   With this message, the premaster secret is set, either though direct\n *   transmission of the RSA-encrypted secret, or by the transmission of\n *   Diffie-Hellman parameters which will allow each side to agree upon the\n *   same premaster secret. When the key exchange method is DH_RSA or DH_DSS,\n *   client certification has been requested, and the client was able to\n *   respond with a certificate which contained a Diffie-Hellman public key\n *   whose parameters (group and generator) matched those specified by the\n *   server in its certificate, this message will not contain any data.\n *\n * Meaning of this message:\n *   If RSA is being used for key agreement and authentication, the client\n *   generates a 48-byte premaster secret, encrypts it using the public key\n *   from the server's certificate or the temporary RSA key provided in a\n *   server key exchange message, and sends the result in an encrypted\n *   premaster secret message. This structure is a variant of the client\n *   key exchange message, not a message in itself.\n *\n * struct {\n *   select(KeyExchangeAlgorithm) {\n *     case rsa: EncryptedPreMasterSecret;\n *     case diffie_hellman: ClientDiffieHellmanPublic;\n *   } exchange_keys;\n * } ClientKeyExchange;\n *\n * struct {\n *   ProtocolVersion client_version;\n *   opaque random[46];\n * } PreMasterSecret;\n *\n * struct {\n *   public-key-encrypted PreMasterSecret pre_master_secret;\n * } EncryptedPreMasterSecret;\n *\n * A public-key-encrypted element is encoded as a vector <0..2^16-1>.\n *\n * @param c the connection.\n *\n * @return the ClientKeyExchange byte buffer.\n */\ntls.createClientKeyExchange = function(c) {\n  // create buffer to encrypt\n  var b = forge.util.createBuffer();\n\n  // add highest client-supported protocol to help server avoid version\n  // rollback attacks\n  b.putByte(c.session.clientHelloVersion.major);\n  b.putByte(c.session.clientHelloVersion.minor);\n\n  // generate and add 46 random bytes\n  b.putBytes(forge.random.getBytes(46));\n\n  // save pre-master secret\n  var sp = c.session.sp;\n  sp.pre_master_secret = b.getBytes();\n\n  // RSA-encrypt the pre-master secret\n  var key = c.session.serverCertificate.publicKey;\n  b = key.encrypt(sp.pre_master_secret);\n\n  /* Note: The encrypted pre-master secret will be stored in a\n    public-key-encrypted opaque vector that has the length prefixed using\n    2 bytes, so include those 2 bytes in the handshake message length. This\n    is done as a minor optimization instead of calling writeVector(). */\n\n  // determine length of the handshake message\n  var length = b.length + 2;\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.client_key_exchange);\n  rval.putInt24(length);\n  // add vector length bytes\n  rval.putInt16(b.length);\n  rval.putBytes(b);\n  return rval;\n};\n\n/**\n * Creates a ServerKeyExchange message.\n *\n * @param c the connection.\n *\n * @return the ServerKeyExchange byte buffer.\n */\ntls.createServerKeyExchange = function(c) {\n  // this implementation only supports RSA, no Diffie-Hellman support,\n  // so this record is empty\n\n  // determine length of the handshake message\n  var length = 0;\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  if(length > 0) {\n    rval.putByte(tls.HandshakeType.server_key_exchange);\n    rval.putInt24(length);\n  }\n  return rval;\n};\n\n/**\n * Gets the signed data used to verify a client-side certificate. See\n * tls.createCertificateVerify() for details.\n *\n * @param c the connection.\n * @param callback the callback to call once the signed data is ready.\n */\ntls.getClientSignature = function(c, callback) {\n  // generate data to RSA encrypt\n  var b = forge.util.createBuffer();\n  b.putBuffer(c.session.md5.digest());\n  b.putBuffer(c.session.sha1.digest());\n  b = b.getBytes();\n\n  // create default signing function as necessary\n  c.getSignature = c.getSignature || function(c, b, callback) {\n    // do rsa encryption, call callback\n    var privateKey = null;\n    if(c.getPrivateKey) {\n      try {\n        privateKey = c.getPrivateKey(c, c.session.clientCertificate);\n        privateKey = forge.pki.privateKeyFromPem(privateKey);\n      } catch(ex) {\n        c.error(c, {\n          message: 'Could not get private key.',\n          cause: ex,\n          send: true,\n          alert: {\n            level: tls.Alert.Level.fatal,\n            description: tls.Alert.Description.internal_error\n          }\n        });\n      }\n    }\n    if(privateKey === null) {\n      c.error(c, {\n        message: 'No private key set.',\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: tls.Alert.Description.internal_error\n        }\n      });\n    } else {\n      b = privateKey.sign(b, null);\n    }\n    callback(c, b);\n  };\n\n  // get client signature\n  c.getSignature(c, b, callback);\n};\n\n/**\n * Creates a CertificateVerify message.\n *\n * Meaning of this message:\n *   This structure conveys the client's Diffie-Hellman public value\n *   (Yc) if it was not already included in the client's certificate.\n *   The encoding used for Yc is determined by the enumerated\n *   PublicValueEncoding. This structure is a variant of the client\n *   key exchange message, not a message in itself.\n *\n * When this message will be sent:\n *   This message is used to provide explicit verification of a client\n *   certificate. This message is only sent following a client\n *   certificate that has signing capability (i.e. all certificates\n *   except those containing fixed Diffie-Hellman parameters). When\n *   sent, it will immediately follow the client key exchange message.\n *\n * struct {\n *   Signature signature;\n * } CertificateVerify;\n *\n * CertificateVerify.signature.md5_hash\n *   MD5(handshake_messages);\n *\n * Certificate.signature.sha_hash\n *   SHA(handshake_messages);\n *\n * Here handshake_messages refers to all handshake messages sent or\n * received starting at client hello up to but not including this\n * message, including the type and length fields of the handshake\n * messages.\n *\n * select(SignatureAlgorithm) {\n *   case anonymous: struct { };\n *   case rsa:\n *     digitally-signed struct {\n *       opaque md5_hash[16];\n *       opaque sha_hash[20];\n *     };\n *   case dsa:\n *     digitally-signed struct {\n *       opaque sha_hash[20];\n *     };\n * } Signature;\n *\n * In digital signing, one-way hash functions are used as input for a\n * signing algorithm. A digitally-signed element is encoded as an opaque\n * vector <0..2^16-1>, where the length is specified by the signing\n * algorithm and key.\n *\n * In RSA signing, a 36-byte structure of two hashes (one SHA and one\n * MD5) is signed (encrypted with the private key). It is encoded with\n * PKCS #1 block type 0 or type 1 as described in [PKCS1].\n *\n * In DSS, the 20 bytes of the SHA hash are run directly through the\n * Digital Signing Algorithm with no additional hashing.\n *\n * @param c the connection.\n * @param signature the signature to include in the message.\n *\n * @return the CertificateVerify byte buffer.\n */\ntls.createCertificateVerify = function(c, signature) {\n  /* Note: The signature will be stored in a \"digitally-signed\" opaque\n    vector that has the length prefixed using 2 bytes, so include those\n    2 bytes in the handshake message length. This is done as a minor\n    optimization instead of calling writeVector(). */\n\n  // determine length of the handshake message\n  var length = signature.length + 2;\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.certificate_verify);\n  rval.putInt24(length);\n  // add vector length bytes\n  rval.putInt16(signature.length);\n  rval.putBytes(signature);\n  return rval;\n};\n\n/**\n * Creates a CertificateRequest message.\n *\n * @param c the connection.\n *\n * @return the CertificateRequest byte buffer.\n */\ntls.createCertificateRequest = function(c) {\n  // TODO: support other certificate types\n  var certTypes = forge.util.createBuffer();\n\n  // common RSA certificate type\n  certTypes.putByte(0x01);\n\n  // add distinguished names from CA store\n  var cAs = forge.util.createBuffer();\n  for(var key in c.caStore.certs) {\n    var cert = c.caStore.certs[key];\n    var dn = forge.pki.distinguishedNameToAsn1(cert.subject);\n    var byteBuffer = forge.asn1.toDer(dn);\n    cAs.putInt16(byteBuffer.length());\n    cAs.putBuffer(byteBuffer);\n  }\n\n  // TODO: TLS 1.2+ has a different format\n\n  // determine length of the handshake message\n  var length =\n    1 + certTypes.length() +\n    2 + cAs.length();\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.certificate_request);\n  rval.putInt24(length);\n  writeVector(rval, 1, certTypes);\n  writeVector(rval, 2, cAs);\n  return rval;\n};\n\n/**\n * Creates a ServerHelloDone message.\n *\n * @param c the connection.\n *\n * @return the ServerHelloDone byte buffer.\n */\ntls.createServerHelloDone = function(c) {\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.server_hello_done);\n  rval.putInt24(0);\n  return rval;\n};\n\n/**\n * Creates a ChangeCipherSpec message.\n *\n * The change cipher spec protocol exists to signal transitions in\n * ciphering strategies. The protocol consists of a single message,\n * which is encrypted and compressed under the current (not the pending)\n * connection state. The message consists of a single byte of value 1.\n *\n * struct {\n *   enum { change_cipher_spec(1), (255) } type;\n * } ChangeCipherSpec;\n *\n * @return the ChangeCipherSpec byte buffer.\n */\ntls.createChangeCipherSpec = function() {\n  var rval = forge.util.createBuffer();\n  rval.putByte(0x01);\n  return rval;\n};\n\n/**\n * Creates a Finished message.\n *\n * struct {\n *   opaque verify_data[12];\n * } Finished;\n *\n * verify_data\n *   PRF(master_secret, finished_label, MD5(handshake_messages) +\n *   SHA-1(handshake_messages)) [0..11];\n *\n * finished_label\n *   For Finished messages sent by the client, the string \"client\n *   finished\". For Finished messages sent by the server, the\n *   string \"server finished\".\n *\n * handshake_messages\n *   All of the data from all handshake messages up to but not\n *   including this message. This is only data visible at the\n *   handshake layer and does not include record layer headers.\n *   This is the concatenation of all the Handshake structures as\n *   defined in 7.4 exchanged thus far.\n *\n * @param c the connection.\n *\n * @return the Finished byte buffer.\n */\ntls.createFinished = function(c) {\n  // generate verify_data\n  var b = forge.util.createBuffer();\n  b.putBuffer(c.session.md5.digest());\n  b.putBuffer(c.session.sha1.digest());\n\n  // TODO: determine prf function and verify length for TLS 1.2\n  var client = (c.entity === tls.ConnectionEnd.client);\n  var sp = c.session.sp;\n  var vdl = 12;\n  var prf = prf_TLS1;\n  var label = client ? 'client finished' : 'server finished';\n  b = prf(sp.master_secret, label, b.getBytes(), vdl);\n\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(tls.HandshakeType.finished);\n  rval.putInt24(b.length());\n  rval.putBuffer(b);\n  return rval;\n};\n\n/**\n * Creates a HeartbeatMessage (See RFC 6520).\n *\n * struct {\n *   HeartbeatMessageType type;\n *   uint16 payload_length;\n *   opaque payload[HeartbeatMessage.payload_length];\n *   opaque padding[padding_length];\n * } HeartbeatMessage;\n *\n * The total length of a HeartbeatMessage MUST NOT exceed 2^14 or\n * max_fragment_length when negotiated as defined in [RFC6066].\n *\n * type: The message type, either heartbeat_request or heartbeat_response.\n *\n * payload_length: The length of the payload.\n *\n * payload: The payload consists of arbitrary content.\n *\n * padding: The padding is random content that MUST be ignored by the\n *   receiver. The length of a HeartbeatMessage is TLSPlaintext.length\n *   for TLS and DTLSPlaintext.length for DTLS. Furthermore, the\n *   length of the type field is 1 byte, and the length of the\n *   payload_length is 2. Therefore, the padding_length is\n *   TLSPlaintext.length - payload_length - 3 for TLS and\n *   DTLSPlaintext.length - payload_length - 3 for DTLS. The\n *   padding_length MUST be at least 16.\n *\n * The sender of a HeartbeatMessage MUST use a random padding of at\n * least 16 bytes. The padding of a received HeartbeatMessage message\n * MUST be ignored.\n *\n * If the payload_length of a received HeartbeatMessage is too large,\n * the received HeartbeatMessage MUST be discarded silently.\n *\n * @param c the connection.\n * @param type the tls.HeartbeatMessageType.\n * @param payload the heartbeat data to send as the payload.\n * @param [payloadLength] the payload length to use, defaults to the\n *          actual payload length.\n *\n * @return the HeartbeatRequest byte buffer.\n */\ntls.createHeartbeat = function(type, payload, payloadLength) {\n  if(typeof payloadLength === 'undefined') {\n    payloadLength = payload.length;\n  }\n  // build record fragment\n  var rval = forge.util.createBuffer();\n  rval.putByte(type);               // heartbeat message type\n  rval.putInt16(payloadLength);     // payload length\n  rval.putBytes(payload);           // payload\n  // padding\n  var plaintextLength = rval.length();\n  var paddingLength = Math.max(16, plaintextLength - payloadLength - 3);\n  rval.putBytes(forge.random.getBytes(paddingLength));\n  return rval;\n};\n\n/**\n * Fragments, compresses, encrypts, and queues a record for delivery.\n *\n * @param c the connection.\n * @param record the record to queue.\n */\ntls.queue = function(c, record) {\n  // error during record creation\n  if(!record) {\n    return;\n  }\n\n  if(record.fragment.length() === 0) {\n    if(record.type === tls.ContentType.handshake ||\n      record.type === tls.ContentType.alert ||\n      record.type === tls.ContentType.change_cipher_spec) {\n      // Empty handshake, alert of change cipher spec messages are not allowed per the TLS specification and should not be sent.\n      return;\n    }\n  }\n\n  // if the record is a handshake record, update handshake hashes\n  if(record.type === tls.ContentType.handshake) {\n    var bytes = record.fragment.bytes();\n    c.session.md5.update(bytes);\n    c.session.sha1.update(bytes);\n    bytes = null;\n  }\n\n  // handle record fragmentation\n  var records;\n  if(record.fragment.length() <= tls.MaxFragment) {\n    records = [record];\n  } else {\n    // fragment data as long as it is too long\n    records = [];\n    var data = record.fragment.bytes();\n    while(data.length > tls.MaxFragment) {\n      records.push(tls.createRecord(c, {\n        type: record.type,\n        data: forge.util.createBuffer(data.slice(0, tls.MaxFragment))\n      }));\n      data = data.slice(tls.MaxFragment);\n    }\n    // add last record\n    if(data.length > 0) {\n      records.push(tls.createRecord(c, {\n        type: record.type,\n        data: forge.util.createBuffer(data)\n      }));\n    }\n  }\n\n  // compress and encrypt all fragmented records\n  for(var i = 0; i < records.length && !c.fail; ++i) {\n    // update the record using current write state\n    var rec = records[i];\n    var s = c.state.current.write;\n    if(s.update(c, rec)) {\n      // store record\n      c.records.push(rec);\n    }\n  }\n};\n\n/**\n * Flushes all queued records to the output buffer and calls the\n * tlsDataReady() handler on the given connection.\n *\n * @param c the connection.\n *\n * @return true on success, false on failure.\n */\ntls.flush = function(c) {\n  for(var i = 0; i < c.records.length; ++i) {\n    var record = c.records[i];\n\n    // add record header and fragment\n    c.tlsData.putByte(record.type);\n    c.tlsData.putByte(record.version.major);\n    c.tlsData.putByte(record.version.minor);\n    c.tlsData.putInt16(record.fragment.length());\n    c.tlsData.putBuffer(c.records[i].fragment);\n  }\n  c.records = [];\n  return c.tlsDataReady(c);\n};\n\n/**\n * Maps a pki.certificateError to a tls.Alert.Description.\n *\n * @param error the error to map.\n *\n * @return the alert description.\n */\nvar _certErrorToAlertDesc = function(error) {\n  switch(error) {\n  case true:\n    return true;\n  case forge.pki.certificateError.bad_certificate:\n    return tls.Alert.Description.bad_certificate;\n  case forge.pki.certificateError.unsupported_certificate:\n    return tls.Alert.Description.unsupported_certificate;\n  case forge.pki.certificateError.certificate_revoked:\n    return tls.Alert.Description.certificate_revoked;\n  case forge.pki.certificateError.certificate_expired:\n    return tls.Alert.Description.certificate_expired;\n  case forge.pki.certificateError.certificate_unknown:\n    return tls.Alert.Description.certificate_unknown;\n  case forge.pki.certificateError.unknown_ca:\n    return tls.Alert.Description.unknown_ca;\n  default:\n    return tls.Alert.Description.bad_certificate;\n  }\n};\n\n/**\n * Maps a tls.Alert.Description to a pki.certificateError.\n *\n * @param desc the alert description.\n *\n * @return the certificate error.\n */\nvar _alertDescToCertError = function(desc) {\n  switch(desc) {\n  case true:\n    return true;\n  case tls.Alert.Description.bad_certificate:\n    return forge.pki.certificateError.bad_certificate;\n  case tls.Alert.Description.unsupported_certificate:\n    return forge.pki.certificateError.unsupported_certificate;\n  case tls.Alert.Description.certificate_revoked:\n    return forge.pki.certificateError.certificate_revoked;\n  case tls.Alert.Description.certificate_expired:\n    return forge.pki.certificateError.certificate_expired;\n  case tls.Alert.Description.certificate_unknown:\n    return forge.pki.certificateError.certificate_unknown;\n  case tls.Alert.Description.unknown_ca:\n    return forge.pki.certificateError.unknown_ca;\n  default:\n    return forge.pki.certificateError.bad_certificate;\n  }\n};\n\n/**\n * Verifies a certificate chain against the given connection's\n * Certificate Authority store.\n *\n * @param c the TLS connection.\n * @param chain the certificate chain to verify, with the root or highest\n *          authority at the end.\n *\n * @return true if successful, false if not.\n */\ntls.verifyCertificateChain = function(c, chain) {\n  try {\n    // verify chain\n    forge.pki.verifyCertificateChain(c.caStore, chain,\n      function verify(vfd, depth, chain) {\n        // convert pki.certificateError to tls alert description\n        var desc = _certErrorToAlertDesc(vfd);\n\n        // call application callback\n        var ret = c.verify(c, vfd, depth, chain);\n        if(ret !== true) {\n          if(typeof ret === 'object' && !forge.util.isArray(ret)) {\n            // throw custom error\n            var error = new Error('The application rejected the certificate.');\n            error.send = true;\n            error.alert = {\n              level: tls.Alert.Level.fatal,\n              description: tls.Alert.Description.bad_certificate\n            };\n            if(ret.message) {\n              error.message = ret.message;\n            }\n            if(ret.alert) {\n              error.alert.description = ret.alert;\n            }\n            throw error;\n          }\n\n          // convert tls alert description to pki.certificateError\n          if(ret !== vfd) {\n            ret = _alertDescToCertError(ret);\n          }\n        }\n\n        return ret;\n      });\n  } catch(ex) {\n    // build tls error if not already customized\n    var err = ex;\n    if(typeof err !== 'object' || forge.util.isArray(err)) {\n      err = {\n        send: true,\n        alert: {\n          level: tls.Alert.Level.fatal,\n          description: _certErrorToAlertDesc(ex)\n        }\n      };\n    }\n    if(!('send' in err)) {\n      err.send = true;\n    }\n    if(!('alert' in err)) {\n      err.alert = {\n        level: tls.Alert.Level.fatal,\n        description: _certErrorToAlertDesc(err.error)\n      };\n    }\n\n    // send error\n    c.error(c, err);\n  }\n\n  return !c.fail;\n};\n\n/**\n * Creates a new TLS session cache.\n *\n * @param cache optional map of session ID to cached session.\n * @param capacity the maximum size for the cache (default: 100).\n *\n * @return the new TLS session cache.\n */\ntls.createSessionCache = function(cache, capacity) {\n  var rval = null;\n\n  // assume input is already a session cache object\n  if(cache && cache.getSession && cache.setSession && cache.order) {\n    rval = cache;\n  } else {\n    // create cache\n    rval = {};\n    rval.cache = cache || {};\n    rval.capacity = Math.max(capacity || 100, 1);\n    rval.order = [];\n\n    // store order for sessions, delete session overflow\n    for(var key in cache) {\n      if(rval.order.length <= capacity) {\n        rval.order.push(key);\n      } else {\n        delete cache[key];\n      }\n    }\n\n    // get a session from a session ID (or get any session)\n    rval.getSession = function(sessionId) {\n      var session = null;\n      var key = null;\n\n      // if session ID provided, use it\n      if(sessionId) {\n        key = forge.util.bytesToHex(sessionId);\n      } else if(rval.order.length > 0) {\n        // get first session from cache\n        key = rval.order[0];\n      }\n\n      if(key !== null && key in rval.cache) {\n        // get cached session and remove from cache\n        session = rval.cache[key];\n        delete rval.cache[key];\n        for(var i in rval.order) {\n          if(rval.order[i] === key) {\n            rval.order.splice(i, 1);\n            break;\n          }\n        }\n      }\n\n      return session;\n    };\n\n    // set a session in the cache\n    rval.setSession = function(sessionId, session) {\n      // remove session from cache if at capacity\n      if(rval.order.length === rval.capacity) {\n        var key = rval.order.shift();\n        delete rval.cache[key];\n      }\n      // add session to cache\n      var key = forge.util.bytesToHex(sessionId);\n      rval.order.push(key);\n      rval.cache[key] = session;\n    };\n  }\n\n  return rval;\n};\n\n/**\n * Creates a new TLS connection.\n *\n * See public createConnection() docs for more details.\n *\n * @param options the options for this connection.\n *\n * @return the new TLS connection.\n */\ntls.createConnection = function(options) {\n  var caStore = null;\n  if(options.caStore) {\n    // if CA store is an array, convert it to a CA store object\n    if(forge.util.isArray(options.caStore)) {\n      caStore = forge.pki.createCaStore(options.caStore);\n    } else {\n      caStore = options.caStore;\n    }\n  } else {\n    // create empty CA store\n    caStore = forge.pki.createCaStore();\n  }\n\n  // setup default cipher suites\n  var cipherSuites = options.cipherSuites || null;\n  if(cipherSuites === null) {\n    cipherSuites = [];\n    for(var key in tls.CipherSuites) {\n      cipherSuites.push(tls.CipherSuites[key]);\n    }\n  }\n\n  // set default entity\n  var entity = (options.server || false) ?\n    tls.ConnectionEnd.server : tls.ConnectionEnd.client;\n\n  // create session cache if requested\n  var sessionCache = options.sessionCache ?\n    tls.createSessionCache(options.sessionCache) : null;\n\n  // create TLS connection\n  var c = {\n    version: {major: tls.Version.major, minor: tls.Version.minor},\n    entity: entity,\n    sessionId: options.sessionId,\n    caStore: caStore,\n    sessionCache: sessionCache,\n    cipherSuites: cipherSuites,\n    connected: options.connected,\n    virtualHost: options.virtualHost || null,\n    verifyClient: options.verifyClient || false,\n    verify: options.verify || function(cn, vfd, dpth, cts) {return vfd;},\n    getCertificate: options.getCertificate || null,\n    getPrivateKey: options.getPrivateKey || null,\n    getSignature: options.getSignature || null,\n    input: forge.util.createBuffer(),\n    tlsData: forge.util.createBuffer(),\n    data: forge.util.createBuffer(),\n    tlsDataReady: options.tlsDataReady,\n    dataReady: options.dataReady,\n    heartbeatReceived: options.heartbeatReceived,\n    closed: options.closed,\n    error: function(c, ex) {\n      // set origin if not set\n      ex.origin = ex.origin ||\n        ((c.entity === tls.ConnectionEnd.client) ? 'client' : 'server');\n\n      // send TLS alert\n      if(ex.send) {\n        tls.queue(c, tls.createAlert(c, ex.alert));\n        tls.flush(c);\n      }\n\n      // error is fatal by default\n      var fatal = (ex.fatal !== false);\n      if(fatal) {\n        // set fail flag\n        c.fail = true;\n      }\n\n      // call error handler first\n      options.error(c, ex);\n\n      if(fatal) {\n        // fatal error, close connection, do not clear fail\n        c.close(false);\n      }\n    },\n    deflate: options.deflate || null,\n    inflate: options.inflate || null\n  };\n\n  /**\n   * Resets a closed TLS connection for reuse. Called in c.close().\n   *\n   * @param clearFail true to clear the fail flag (default: true).\n   */\n  c.reset = function(clearFail) {\n    c.version = {major: tls.Version.major, minor: tls.Version.minor};\n    c.record = null;\n    c.session = null;\n    c.peerCertificate = null;\n    c.state = {\n      pending: null,\n      current: null\n    };\n    c.expect = (c.entity === tls.ConnectionEnd.client) ? SHE : CHE;\n    c.fragmented = null;\n    c.records = [];\n    c.open = false;\n    c.handshakes = 0;\n    c.handshaking = false;\n    c.isConnected = false;\n    c.fail = !(clearFail || typeof(clearFail) === 'undefined');\n    c.input.clear();\n    c.tlsData.clear();\n    c.data.clear();\n    c.state.current = tls.createConnectionState(c);\n  };\n\n  // do initial reset of connection\n  c.reset();\n\n  /**\n   * Updates the current TLS engine state based on the given record.\n   *\n   * @param c the TLS connection.\n   * @param record the TLS record to act on.\n   */\n  var _update = function(c, record) {\n    // get record handler (align type in table by subtracting lowest)\n    var aligned = record.type - tls.ContentType.change_cipher_spec;\n    var handlers = ctTable[c.entity][c.expect];\n    if(aligned in handlers) {\n      handlers[aligned](c, record);\n    } else {\n      // unexpected record\n      tls.handleUnexpected(c, record);\n    }\n  };\n\n  /**\n   * Reads the record header and initializes the next record on the given\n   * connection.\n   *\n   * @param c the TLS connection with the next record.\n   *\n   * @return 0 if the input data could be processed, otherwise the\n   *         number of bytes required for data to be processed.\n   */\n  var _readRecordHeader = function(c) {\n    var rval = 0;\n\n    // get input buffer and its length\n    var b = c.input;\n    var len = b.length();\n\n    // need at least 5 bytes to initialize a record\n    if(len < 5) {\n      rval = 5 - len;\n    } else {\n      // enough bytes for header\n      // initialize record\n      c.record = {\n        type: b.getByte(),\n        version: {\n          major: b.getByte(),\n          minor: b.getByte()\n        },\n        length: b.getInt16(),\n        fragment: forge.util.createBuffer(),\n        ready: false\n      };\n\n      // check record version\n      var compatibleVersion = (c.record.version.major === c.version.major);\n      if(compatibleVersion && c.session && c.session.version) {\n        // session version already set, require same minor version\n        compatibleVersion = (c.record.version.minor === c.version.minor);\n      }\n      if(!compatibleVersion) {\n        c.error(c, {\n          message: 'Incompatible TLS version.',\n          send: true,\n          alert: {\n            level: tls.Alert.Level.fatal,\n            description: tls.Alert.Description.protocol_version\n          }\n        });\n      }\n    }\n\n    return rval;\n  };\n\n  /**\n   * Reads the next record's contents and appends its message to any\n   * previously fragmented message.\n   *\n   * @param c the TLS connection with the next record.\n   *\n   * @return 0 if the input data could be processed, otherwise the\n   *         number of bytes required for data to be processed.\n   */\n  var _readRecord = function(c) {\n    var rval = 0;\n\n    // ensure there is enough input data to get the entire record\n    var b = c.input;\n    var len = b.length();\n    if(len < c.record.length) {\n      // not enough data yet, return how much is required\n      rval = c.record.length - len;\n    } else {\n      // there is enough data to parse the pending record\n      // fill record fragment and compact input buffer\n      c.record.fragment.putBytes(b.getBytes(c.record.length));\n      b.compact();\n\n      // update record using current read state\n      var s = c.state.current.read;\n      if(s.update(c, c.record)) {\n        // see if there is a previously fragmented message that the\n        // new record's message fragment should be appended to\n        if(c.fragmented !== null) {\n          // if the record type matches a previously fragmented\n          // record, append the record fragment to it\n          if(c.fragmented.type === c.record.type) {\n            // concatenate record fragments\n            c.fragmented.fragment.putBuffer(c.record.fragment);\n            c.record = c.fragmented;\n          } else {\n            // error, invalid fragmented record\n            c.error(c, {\n              message: 'Invalid fragmented record.',\n              send: true,\n              alert: {\n                level: tls.Alert.Level.fatal,\n                description:\n                  tls.Alert.Description.unexpected_message\n              }\n            });\n          }\n        }\n\n        // record is now ready\n        c.record.ready = true;\n      }\n    }\n\n    return rval;\n  };\n\n  /**\n   * Performs a handshake using the TLS Handshake Protocol, as a client.\n   *\n   * This method should only be called if the connection is in client mode.\n   *\n   * @param sessionId the session ID to use, null to start a new one.\n   */\n  c.handshake = function(sessionId) {\n    // error to call this in non-client mode\n    if(c.entity !== tls.ConnectionEnd.client) {\n      // not fatal error\n      c.error(c, {\n        message: 'Cannot initiate handshake as a server.',\n        fatal: false\n      });\n    } else if(c.handshaking) {\n      // handshake is already in progress, fail but not fatal error\n      c.error(c, {\n        message: 'Handshake already in progress.',\n        fatal: false\n      });\n    } else {\n      // clear fail flag on reuse\n      if(c.fail && !c.open && c.handshakes === 0) {\n        c.fail = false;\n      }\n\n      // now handshaking\n      c.handshaking = true;\n\n      // default to blank (new session)\n      sessionId = sessionId || '';\n\n      // if a session ID was specified, try to find it in the cache\n      var session = null;\n      if(sessionId.length > 0) {\n        if(c.sessionCache) {\n          session = c.sessionCache.getSession(sessionId);\n        }\n\n        // matching session not found in cache, clear session ID\n        if(session === null) {\n          sessionId = '';\n        }\n      }\n\n      // no session given, grab a session from the cache, if available\n      if(sessionId.length === 0 && c.sessionCache) {\n        session = c.sessionCache.getSession();\n        if(session !== null) {\n          sessionId = session.id;\n        }\n      }\n\n      // set up session\n      c.session = {\n        id: sessionId,\n        version: null,\n        cipherSuite: null,\n        compressionMethod: null,\n        serverCertificate: null,\n        certificateRequest: null,\n        clientCertificate: null,\n        sp: {},\n        md5: forge.md.md5.create(),\n        sha1: forge.md.sha1.create()\n      };\n\n      // use existing session information\n      if(session) {\n        // only update version on connection, session version not yet set\n        c.version = session.version;\n        c.session.sp = session.sp;\n      }\n\n      // generate new client random\n      c.session.sp.client_random = tls.createRandom().getBytes();\n\n      // connection now open\n      c.open = true;\n\n      // send hello\n      tls.queue(c, tls.createRecord(c, {\n        type: tls.ContentType.handshake,\n        data: tls.createClientHello(c)\n      }));\n      tls.flush(c);\n    }\n  };\n\n  /**\n   * Called when TLS protocol data has been received from somewhere and should\n   * be processed by the TLS engine.\n   *\n   * @param data the TLS protocol data, as a string, to process.\n   *\n   * @return 0 if the data could be processed, otherwise the number of bytes\n   *         required for data to be processed.\n   */\n  c.process = function(data) {\n    var rval = 0;\n\n    // buffer input data\n    if(data) {\n      c.input.putBytes(data);\n    }\n\n    // process next record if no failure, process will be called after\n    // each record is handled (since handling can be asynchronous)\n    if(!c.fail) {\n      // reset record if ready and now empty\n      if(c.record !== null &&\n        c.record.ready && c.record.fragment.isEmpty()) {\n        c.record = null;\n      }\n\n      // if there is no pending record, try to read record header\n      if(c.record === null) {\n        rval = _readRecordHeader(c);\n      }\n\n      // read the next record (if record not yet ready)\n      if(!c.fail && c.record !== null && !c.record.ready) {\n        rval = _readRecord(c);\n      }\n\n      // record ready to be handled, update engine state\n      if(!c.fail && c.record !== null && c.record.ready) {\n        _update(c, c.record);\n      }\n    }\n\n    return rval;\n  };\n\n  /**\n   * Requests that application data be packaged into a TLS record. The\n   * tlsDataReady handler will be called when the TLS record(s) have been\n   * prepared.\n   *\n   * @param data the application data, as a raw 'binary' encoded string, to\n   *          be sent; to send utf-16/utf-8 string data, use the return value\n   *          of util.encodeUtf8(str).\n   *\n   * @return true on success, false on failure.\n   */\n  c.prepare = function(data) {\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.application_data,\n      data: forge.util.createBuffer(data)\n    }));\n    return tls.flush(c);\n  };\n\n  /**\n   * Requests that a heartbeat request be packaged into a TLS record for\n   * transmission. The tlsDataReady handler will be called when TLS record(s)\n   * have been prepared.\n   *\n   * When a heartbeat response has been received, the heartbeatReceived\n   * handler will be called with the matching payload. This handler can\n   * be used to clear a retransmission timer, etc.\n   *\n   * @param payload the heartbeat data to send as the payload in the message.\n   * @param [payloadLength] the payload length to use, defaults to the\n   *          actual payload length.\n   *\n   * @return true on success, false on failure.\n   */\n  c.prepareHeartbeatRequest = function(payload, payloadLength) {\n    if(payload instanceof forge.util.ByteBuffer) {\n      payload = payload.bytes();\n    }\n    if(typeof payloadLength === 'undefined') {\n      payloadLength = payload.length;\n    }\n    c.expectedHeartbeatPayload = payload;\n    tls.queue(c, tls.createRecord(c, {\n      type: tls.ContentType.heartbeat,\n      data: tls.createHeartbeat(\n        tls.HeartbeatMessageType.heartbeat_request, payload, payloadLength)\n    }));\n    return tls.flush(c);\n  };\n\n  /**\n   * Closes the connection (sends a close_notify alert).\n   *\n   * @param clearFail true to clear the fail flag (default: true).\n   */\n  c.close = function(clearFail) {\n    // save session if connection didn't fail\n    if(!c.fail && c.sessionCache && c.session) {\n      // only need to preserve session ID, version, and security params\n      var session = {\n        id: c.session.id,\n        version: c.session.version,\n        sp: c.session.sp\n      };\n      session.sp.keys = null;\n      c.sessionCache.setSession(session.id, session);\n    }\n\n    if(c.open) {\n      // connection no longer open, clear input\n      c.open = false;\n      c.input.clear();\n\n      // if connected or handshaking, send an alert\n      if(c.isConnected || c.handshaking) {\n        c.isConnected = c.handshaking = false;\n\n        // send close_notify alert\n        tls.queue(c, tls.createAlert(c, {\n          level: tls.Alert.Level.warning,\n          description: tls.Alert.Description.close_notify\n        }));\n        tls.flush(c);\n      }\n\n      // call handler\n      c.closed(c);\n    }\n\n    // reset TLS connection, do not clear fail flag\n    c.reset(clearFail);\n  };\n\n  return c;\n};\n\n/* TLS API */\nmodule.exports = forge.tls = forge.tls || {};\n\n// expose non-functions\nfor(var key in tls) {\n  if(typeof tls[key] !== 'function') {\n    forge.tls[key] = tls[key];\n  }\n}\n\n// expose prf_tls1 for testing\nforge.tls.prf_tls1 = prf_TLS1;\n\n// expose sha1 hmac method\nforge.tls.hmac_sha1 = hmac_sha1;\n\n// expose session cache creation\nforge.tls.createSessionCache = tls.createSessionCache;\n\n/**\n * Creates a new TLS connection. This does not make any assumptions about the\n * transport layer that TLS is working on top of, ie: it does not assume there\n * is a TCP/IP connection or establish one. A TLS connection is totally\n * abstracted away from the layer is runs on top of, it merely establishes a\n * secure channel between a client\" and a \"server\".\n *\n * A TLS connection contains 4 connection states: pending read and write, and\n * current read and write.\n *\n * At initialization, the current read and write states will be null. Only once\n * the security parameters have been set and the keys have been generated can\n * the pending states be converted into current states. Current states will be\n * updated for each record processed.\n *\n * A custom certificate verify callback may be provided to check information\n * like the common name on the server's certificate. It will be called for\n * every certificate in the chain. It has the following signature:\n *\n * variable func(c, certs, index, preVerify)\n * Where:\n * c         The TLS connection\n * verified  Set to true if certificate was verified, otherwise the alert\n *           tls.Alert.Description for why the certificate failed.\n * depth     The current index in the chain, where 0 is the server's cert.\n * certs     The certificate chain, *NOTE* if the server was anonymous then\n *           the chain will be empty.\n *\n * The function returns true on success and on failure either the appropriate\n * tls.Alert.Description or an object with 'alert' set to the appropriate\n * tls.Alert.Description and 'message' set to a custom error message. If true\n * is not returned then the connection will abort using, in order of\n * availability, first the returned alert description, second the preVerify\n * alert description, and lastly the default 'bad_certificate'.\n *\n * There are three callbacks that can be used to make use of client-side\n * certificates where each takes the TLS connection as the first parameter:\n *\n * getCertificate(conn, hint)\n *   The second parameter is a hint as to which certificate should be\n *   returned. If the connection entity is a client, then the hint will be\n *   the CertificateRequest message from the server that is part of the\n *   TLS protocol. If the connection entity is a server, then it will be\n *   the servername list provided via an SNI extension the ClientHello, if\n *   one was provided (empty array if not). The hint can be examined to\n *   determine which certificate to use (advanced). Most implementations\n *   will just return a certificate. The return value must be a\n *   PEM-formatted certificate or an array of PEM-formatted certificates\n *   that constitute a certificate chain, with the first in the array/chain\n *   being the client's certificate.\n * getPrivateKey(conn, certificate)\n *   The second parameter is an forge.pki X.509 certificate object that\n *   is associated with the requested private key. The return value must\n *   be a PEM-formatted private key.\n * getSignature(conn, bytes, callback)\n *   This callback can be used instead of getPrivateKey if the private key\n *   is not directly accessible in javascript or should not be. For\n *   instance, a secure external web service could provide the signature\n *   in exchange for appropriate credentials. The second parameter is a\n *   string of bytes to be signed that are part of the TLS protocol. These\n *   bytes are used to verify that the private key for the previously\n *   provided client-side certificate is accessible to the client. The\n *   callback is a function that takes 2 parameters, the TLS connection\n *   and the RSA encrypted (signed) bytes as a string. This callback must\n *   be called once the signature is ready.\n *\n * @param options the options for this connection:\n *   server: true if the connection is server-side, false for client.\n *   sessionId: a session ID to reuse, null for a new connection.\n *   caStore: an array of certificates to trust.\n *   sessionCache: a session cache to use.\n *   cipherSuites: an optional array of cipher suites to use,\n *     see tls.CipherSuites.\n *   connected: function(conn) called when the first handshake completes.\n *   virtualHost: the virtual server name to use in a TLS SNI extension.\n *   verifyClient: true to require a client certificate in server mode,\n *     'optional' to request one, false not to (default: false).\n *   verify: a handler used to custom verify certificates in the chain.\n *   getCertificate: an optional callback used to get a certificate or\n *     a chain of certificates (as an array).\n *   getPrivateKey: an optional callback used to get a private key.\n *   getSignature: an optional callback used to get a signature.\n *   tlsDataReady: function(conn) called when TLS protocol data has been\n *     prepared and is ready to be used (typically sent over a socket\n *     connection to its destination), read from conn.tlsData buffer.\n *   dataReady: function(conn) called when application data has\n *     been parsed from a TLS record and should be consumed by the\n *     application, read from conn.data buffer.\n *   closed: function(conn) called when the connection has been closed.\n *   error: function(conn, error) called when there was an error.\n *   deflate: function(inBytes) if provided, will deflate TLS records using\n *     the deflate algorithm if the server supports it.\n *   inflate: function(inBytes) if provided, will inflate TLS records using\n *     the deflate algorithm if the server supports it.\n *\n * @return the new TLS connection.\n */\nforge.tls.createConnection = tls.createConnection;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/tls.js\n// module id = 495\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/tls.js")},function(module,exports,__webpack_require__){eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// This file is the concatenation of many js files.\n// See http://github.com/jimhigson/oboe.js for the raw source\n\n// having a local undefined, window, Object etc allows slightly better minification:\n(function  (window, Object, Array, Error, JSON, undefined ) {\n\n   // v2.1.3\n\n/*\n\nCopyright (c) 2013, Jim Higson\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1.  Redistributions of source code must retain the above copyright\n    notice, this list of conditions and the following disclaimer.\n\n2.  Redistributions in binary form must reproduce the above copyright\n    notice, this list of conditions and the following disclaimer in the\n    documentation and/or other materials provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n*/\n\n/** \n * Partially complete a function.\n * \n *  var add3 = partialComplete( function add(a,b){return a+b}, 3 );\n *  \n *  add3(4) // gives 7\n *  \n *  function wrap(left, right, cen){return left + \" \" + cen + \" \" + right;}\n *  \n *  var pirateGreeting = partialComplete( wrap , \"I'm\", \", a mighty pirate!\" );\n *  \n *  pirateGreeting(\"Guybrush Threepwood\"); \n *  // gives \"I'm Guybrush Threepwood, a mighty pirate!\"\n */\nvar partialComplete = varArgs(function( fn, args ) {\n\n      // this isn't the shortest way to write this but it does\n      // avoid creating a new array each time to pass to fn.apply,\n      // otherwise could just call boundArgs.concat(callArgs)       \n\n      var numBoundArgs = args.length;\n\n      return varArgs(function( callArgs ) {\n         \n         for (var i = 0; i < callArgs.length; i++) {\n            args[numBoundArgs + i] = callArgs[i];\n         }\n         \n         args.length = numBoundArgs + callArgs.length;         \n                     \n         return fn.apply(this, args);\n      }); \n   }),\n\n/**\n * Compose zero or more functions:\n * \n *    compose(f1, f2, f3)(x) = f1(f2(f3(x))))\n * \n * The last (inner-most) function may take more than one parameter:\n * \n *    compose(f1, f2, f3)(x,y) = f1(f2(f3(x,y))))\n */\n   compose = varArgs(function(fns) {\n\n      var fnsList = arrayAsList(fns);\n   \n      function next(params, curFn) {  \n         return [apply(params, curFn)];   \n      }\n            \n      return varArgs(function(startParams){\n        \n         return foldR(next, startParams, fnsList)[0];\n      });\n   });\n\n/**\n * A more optimised version of compose that takes exactly two functions\n * @param f1\n * @param f2\n */\nfunction compose2(f1, f2){\n   return function(){\n      return f1.call(this,f2.apply(this,arguments));\n   }\n}\n\n/**\n * Generic form for a function to get a property from an object\n * \n *    var o = {\n *       foo:'bar'\n *    }\n *    \n *    var getFoo = attr('foo')\n *    \n *    fetFoo(o) // returns 'bar'\n * \n * @param {String} key the property name\n */\nfunction attr(key) {\n   return function(o) { return o[key]; };\n}\n        \n/**\n * Call a list of functions with the same args until one returns a \n * truthy result. Similar to the || operator.\n * \n * So:\n *      lazyUnion([f1,f2,f3 ... fn])( p1, p2 ... pn )\n *      \n * Is equivalent to: \n *      apply([p1, p2 ... pn], f1) || \n *      apply([p1, p2 ... pn], f2) || \n *      apply([p1, p2 ... pn], f3) ... apply(fn, [p1, p2 ... pn])  \n *  \n * @returns the first return value that is given that is truthy.\n */\n   var lazyUnion = varArgs(function(fns) {\n\n      return varArgs(function(params){\n   \n         var maybeValue;\n   \n         for (var i = 0; i < len(fns); i++) {\n   \n            maybeValue = apply(params, fns[i]);\n   \n            if( maybeValue ) {\n               return maybeValue;\n            }\n         }\n      });\n   });   \n\n/**\n * This file declares various pieces of functional programming.\n * \n * This isn't a general purpose functional library, to keep things small it\n * has just the parts useful for Oboe.js.\n */\n\n\n/**\n * Call a single function with the given arguments array.\n * Basically, a functional-style version of the OO-style Function#apply for \n * when we don't care about the context ('this') of the call.\n * \n * The order of arguments allows partial completion of the arguments array\n */\nfunction apply(args, fn) {\n   return fn.apply(undefined, args);\n}\n\n/**\n * Define variable argument functions but cut out all that tedious messing about \n * with the arguments object. Delivers the variable-length part of the arguments\n * list as an array.\n * \n * Eg:\n * \n * var myFunction = varArgs(\n *    function( fixedArgument, otherFixedArgument, variableNumberOfArguments ){\n *       console.log( variableNumberOfArguments );\n *    }\n * )\n * \n * myFunction('a', 'b', 1, 2, 3); // logs [1,2,3]\n * \n * var myOtherFunction = varArgs(function( variableNumberOfArguments ){\n *    console.log( variableNumberOfArguments );\n * })\n * \n * myFunction(1, 2, 3); // logs [1,2,3]\n * \n */\nfunction varArgs(fn){\n\n   var numberOfFixedArguments = fn.length -1,\n       slice = Array.prototype.slice;          \n         \n                   \n   if( numberOfFixedArguments == 0 ) {\n      // an optimised case for when there are no fixed args:   \n   \n      return function(){\n         return fn.call(this, slice.call(arguments));\n      }\n      \n   } else if( numberOfFixedArguments == 1 ) {\n      // an optimised case for when there are is one fixed args:\n   \n      return function(){\n         return fn.call(this, arguments[0], slice.call(arguments, 1));\n      }\n   }\n   \n   // general case   \n\n   // we know how many arguments fn will always take. Create a\n   // fixed-size array to hold that many, to be re-used on\n   // every call to the returned function\n   var argsHolder = Array(fn.length);   \n                             \n   return function(){\n                            \n      for (var i = 0; i < numberOfFixedArguments; i++) {\n         argsHolder[i] = arguments[i];         \n      }\n\n      argsHolder[numberOfFixedArguments] = \n         slice.call(arguments, numberOfFixedArguments);\n                                \n      return fn.apply( this, argsHolder);      \n   }       \n}\n\n\n/**\n * Swap the order of parameters to a binary function\n * \n * A bit like this flip: http://zvon.org/other/haskell/Outputprelude/flip_f.html\n */\nfunction flip(fn){\n   return function(a, b){\n      return fn(b,a);\n   }\n}\n\n\n/**\n * Create a function which is the intersection of two other functions.\n * \n * Like the && operator, if the first is truthy, the second is never called,\n * otherwise the return value from the second is returned.\n */\nfunction lazyIntersection(fn1, fn2) {\n\n   return function (param) {\n                                                              \n      return fn1(param) && fn2(param);\n   };   \n}\n\n/**\n * A function which does nothing\n */\nfunction noop(){}\n\n/**\n * A function which is always happy\n */\nfunction always(){return true}\n\n/**\n * Create a function which always returns the same\n * value\n * \n * var return3 = functor(3);\n * \n * return3() // gives 3\n * return3() // still gives 3\n * return3() // will always give 3\n */\nfunction functor(val){\n   return function(){\n      return val;\n   }\n}\n\n/**\n * This file defines some loosely associated syntactic sugar for \n * Javascript programming \n */\n\n\n/**\n * Returns true if the given candidate is of type T\n */\nfunction isOfType(T, maybeSomething){\n   return maybeSomething && maybeSomething.constructor === T;\n}\n\nvar len = attr('length'),    \n    isString = partialComplete(isOfType, String);\n\n/** \n * I don't like saying this:\n * \n *    foo !=== undefined\n *    \n * because of the double-negative. I find this:\n * \n *    defined(foo)\n *    \n * easier to read.\n */ \nfunction defined( value ) {\n   return value !== undefined;\n}\n\n/**\n * Returns true if object o has a key named like every property in \n * the properties array. Will give false if any are missing, or if o \n * is not an object.\n */\nfunction hasAllProperties(fieldList, o) {\n\n   return      (o instanceof Object) \n            &&\n               all(function (field) {         \n                  return (field in o);         \n               }, fieldList);\n}\n/**\n * Like cons in Lisp\n */\nfunction cons(x, xs) {\n   \n   /* Internally lists are linked 2-element Javascript arrays.\n          \n      Ideally the return here would be Object.freeze([x,xs])\n      so that bugs related to mutation are found fast.\n      However, cons is right on the critical path for\n      performance and this slows oboe-mark down by\n      ~25%. Under theoretical future JS engines that freeze more\n      efficiently (possibly even use immutability to\n      run faster) this should be considered for\n      restoration.\n   */\n   \n   return [x,xs];\n}\n\n/**\n * The empty list\n */\nvar emptyList = null,\n\n/**\n * Get the head of a list.\n * \n * Ie, head(cons(a,b)) = a\n */\n    head = attr(0),\n\n/**\n * Get the tail of a list.\n * \n * Ie, tail(cons(a,b)) = b\n */\n    tail = attr(1);\n\n\n/** \n * Converts an array to a list \n * \n *    asList([a,b,c])\n * \n * is equivalent to:\n *    \n *    cons(a, cons(b, cons(c, emptyList))) \n **/\nfunction arrayAsList(inputArray){\n\n   return reverseList( \n      inputArray.reduce(\n         flip(cons),\n         emptyList \n      )\n   );\n}\n\n/**\n * A varargs version of arrayAsList. Works a bit like list\n * in LISP.\n * \n *    list(a,b,c) \n *    \n * is equivalent to:\n * \n *    cons(a, cons(b, cons(c, emptyList)))\n */\nvar list = varArgs(arrayAsList);\n\n/**\n * Convert a list back to a js native array\n */\nfunction listAsArray(list){\n\n   return foldR( function(arraySoFar, listItem){\n      \n      arraySoFar.unshift(listItem);\n      return arraySoFar;\n           \n   }, [], list );\n   \n}\n\n/**\n * Map a function over a list \n */\nfunction map(fn, list) {\n\n   return list\n            ? cons(fn(head(list)), map(fn,tail(list)))\n            : emptyList\n            ;\n}\n\n/**\n * foldR implementation. Reduce a list down to a single value.\n * \n * @pram {Function} fn     (rightEval, curVal) -> result \n */\nfunction foldR(fn, startValue, list) {\n      \n   return list \n            ? fn(foldR(fn, startValue, tail(list)), head(list))\n            : startValue\n            ;\n}\n\n/**\n * foldR implementation. Reduce a list down to a single value.\n * \n * @pram {Function} fn     (rightEval, curVal) -> result \n */\nfunction foldR1(fn, list) {\n      \n   return tail(list) \n            ? fn(foldR1(fn, tail(list)), head(list))\n            : head(list)\n            ;\n}\n\n\n/**\n * Return a list like the one given but with the first instance equal \n * to item removed \n */\nfunction without(list, test, removedFn) {\n \n   return withoutInner(list, removedFn || noop);\n \n   function withoutInner(subList, removedFn) {\n      return subList  \n         ?  ( test(head(subList)) \n                  ? (removedFn(head(subList)), tail(subList)) \n                  : cons(head(subList), withoutInner(tail(subList), removedFn))\n            )\n         : emptyList\n         ;\n   }               \n}\n\n/** \n * Returns true if the given function holds for every item in \n * the list, false otherwise \n */\nfunction all(fn, list) {\n   \n   return !list || \n          ( fn(head(list)) && all(fn, tail(list)) );\n}\n\n/**\n * Call every function in a list of functions with the same arguments\n * \n * This doesn't make any sense if we're doing pure functional because \n * it doesn't return anything. Hence, this is only really useful if the\n * functions being called have side-effects. \n */\nfunction applyEach(fnList, args) {\n\n   if( fnList ) {  \n      head(fnList).apply(null, args);\n      \n      applyEach(tail(fnList), args);\n   }\n}\n\n/**\n * Reverse the order of a list\n */\nfunction reverseList(list){ \n\n   // js re-implementation of 3rd solution from:\n   //    http://www.haskell.org/haskellwiki/99_questions/Solutions/5\n   function reverseInner( list, reversedAlready ) {\n      if( !list ) {\n         return reversedAlready;\n      }\n      \n      return reverseInner(tail(list), cons(head(list), reversedAlready))\n   }\n\n   return reverseInner(list, emptyList);\n}\n\nfunction first(test, list) {\n   return   list &&\n               (test(head(list)) \n                  ? head(list) \n                  : first(test,tail(list))); \n}\n\n/* \n   This is a slightly hacked-up browser only version of clarinet \n   \n      *  some features removed to help keep browser Oboe under \n         the 5k micro-library limit\n      *  plug directly into event bus\n   \n   For the original go here:\n      https://github.com/dscape/clarinet\n\n   We receive the events:\n      STREAM_DATA\n      STREAM_END\n      \n   We emit the events:\n      SAX_KEY\n      SAX_VALUE_OPEN\n      SAX_VALUE_CLOSE      \n      FAIL_EVENT      \n */\n\nfunction clarinet(eventBus) {\n  \"use strict\";\n   \n  var \n      // shortcut some events on the bus\n      emitSaxKey           = eventBus(SAX_KEY).emit,\n      emitValueOpen        = eventBus(SAX_VALUE_OPEN).emit,\n      emitValueClose       = eventBus(SAX_VALUE_CLOSE).emit,\n      emitFail             = eventBus(FAIL_EVENT).emit,\n              \n      MAX_BUFFER_LENGTH = 64 * 1024\n  ,   stringTokenPattern = /[\\\\\"\\n]/g\n  ,   _n = 0\n  \n      // states\n  ,   BEGIN                = _n++\n  ,   VALUE                = _n++ // general stuff\n  ,   OPEN_OBJECT          = _n++ // {\n  ,   CLOSE_OBJECT         = _n++ // }\n  ,   OPEN_ARRAY           = _n++ // [\n  ,   CLOSE_ARRAY          = _n++ // ]\n  ,   STRING               = _n++ // \"\"\n  ,   OPEN_KEY             = _n++ // , \"a\"\n  ,   CLOSE_KEY            = _n++ // :\n  ,   TRUE                 = _n++ // r\n  ,   TRUE2                = _n++ // u\n  ,   TRUE3                = _n++ // e\n  ,   FALSE                = _n++ // a\n  ,   FALSE2               = _n++ // l\n  ,   FALSE3               = _n++ // s\n  ,   FALSE4               = _n++ // e\n  ,   NULL                 = _n++ // u\n  ,   NULL2                = _n++ // l\n  ,   NULL3                = _n++ // l\n  ,   NUMBER_DECIMAL_POINT = _n++ // .\n  ,   NUMBER_DIGIT         = _n   // [0-9]\n\n      // setup initial parser values\n  ,   bufferCheckPosition  = MAX_BUFFER_LENGTH\n  ,   latestError                \n  ,   c                    \n  ,   p                    \n  ,   textNode             = undefined\n  ,   numberNode           = \"\"     \n  ,   slashed              = false\n  ,   closed               = false\n  ,   state                = BEGIN\n  ,   stack                = []\n  ,   unicodeS             = null\n  ,   unicodeI             = 0\n  ,   depth                = 0\n  ,   position             = 0\n  ,   column               = 0  //mostly for error reporting\n  ,   line                 = 1\n  ;\n\n  function checkBufferLength () {\n     \n    var maxActual = 0;\n     \n    if (textNode !== undefined && textNode.length > MAX_BUFFER_LENGTH) {\n      emitError(\"Max buffer length exceeded: textNode\");\n      maxActual = Math.max(maxActual, textNode.length);\n    }\n    if (numberNode.length > MAX_BUFFER_LENGTH) {\n      emitError(\"Max buffer length exceeded: numberNode\");\n      maxActual = Math.max(maxActual, numberNode.length);\n    }\n     \n    bufferCheckPosition = (MAX_BUFFER_LENGTH - maxActual)\n                               + position;\n  }\n\n  eventBus(STREAM_DATA).on(handleData);\n\n   /* At the end of the http content close the clarinet \n    This will provide an error if the total content provided was not \n    valid json, ie if not all arrays, objects and Strings closed properly */\n  eventBus(STREAM_END).on(handleStreamEnd);   \n\n  function emitError (errorString) {\n     if (textNode !== undefined) {\n        emitValueOpen(textNode);\n        emitValueClose();\n        textNode = undefined;\n     }\n\n     latestError = Error(errorString + \"\\nLn: \"+line+\n                                       \"\\nCol: \"+column+\n                                       \"\\nChr: \"+c);\n     \n     emitFail(errorReport(undefined, undefined, latestError));\n  }\n\n  function handleStreamEnd() {\n    if( state == BEGIN ) {\n      // Handle the case where the stream closes without ever receiving\n      // any input. This isn't an error - response bodies can be blank,\n      // particularly for 204 http responses\n      \n      // Because of how Oboe is currently implemented, we parse a\n      // completely empty stream as containing an empty object.\n      // This is because Oboe's done event is only fired when the\n      // root object of the JSON stream closes.\n      \n      // This should be decoupled and attached instead to the input stream\n      // from the http (or whatever) resource ending.\n      // If this decoupling could happen the SAX parser could simply emit\n      // zero events on a completely empty input.\n      emitValueOpen({});\n      emitValueClose();\n\n      closed = true;\n      return;\n    }\n  \n    if (state !== VALUE || depth !== 0)\n      emitError(\"Unexpected end\");\n \n    if (textNode !== undefined) {\n      emitValueOpen(textNode);\n      emitValueClose();\n      textNode = undefined;\n    }\n     \n    closed = true;\n  }\n\n  function whitespace(c){\n     return c == '\\r' || c == '\\n' || c == ' ' || c == '\\t';\n  }\n   \n  function handleData (chunk) {\n         \n    // this used to throw the error but inside Oboe we will have already\n    // gotten the error when it was emitted. The important thing is to\n    // not continue with the parse.\n    if (latestError)\n      return;\n      \n    if (closed) {\n       return emitError(\"Cannot write after close\");\n    }\n\n    var i = 0;\n    c = chunk[0]; \n\n    while (c) {\n      p = c;\n      c = chunk[i++];\n      if(!c) break;\n\n      position ++;\n      if (c == \"\\n\") {\n        line ++;\n        column = 0;\n      } else column ++;\n      switch (state) {\n\n        case BEGIN:\n          if (c === \"{\") state = OPEN_OBJECT;\n          else if (c === \"[\") state = OPEN_ARRAY;\n          else if (!whitespace(c))\n            return emitError(\"Non-whitespace before {[.\");\n        continue;\n\n        case OPEN_KEY:\n        case OPEN_OBJECT:\n          if (whitespace(c)) continue;\n          if(state === OPEN_KEY) stack.push(CLOSE_KEY);\n          else {\n            if(c === '}') {\n              emitValueOpen({});\n              emitValueClose();\n              state = stack.pop() || VALUE;\n              continue;\n            } else  stack.push(CLOSE_OBJECT);\n          }\n          if(c === '\"')\n             state = STRING;\n          else\n             return emitError(\"Malformed object key should start with \\\" \");\n        continue;\n\n        case CLOSE_KEY:\n        case CLOSE_OBJECT:\n          if (whitespace(c)) continue;\n\n          if(c===':') {\n            if(state === CLOSE_OBJECT) {\n              stack.push(CLOSE_OBJECT);\n\n               if (textNode !== undefined) {\n                  // was previously (in upstream Clarinet) one event\n                  //  - object open came with the text of the first\n                  emitValueOpen({});\n                  emitSaxKey(textNode);\n                  textNode = undefined;\n               }\n               depth++;\n            } else {\n               if (textNode !== undefined) {\n                  emitSaxKey(textNode);\n                  textNode = undefined;\n               }\n            }\n             state  = VALUE;\n          } else if (c==='}') {\n             if (textNode !== undefined) {\n                emitValueOpen(textNode);\n                emitValueClose();\n                textNode = undefined;\n             }\n             emitValueClose();\n            depth--;\n            state = stack.pop() || VALUE;\n          } else if(c===',') {\n            if(state === CLOSE_OBJECT)\n              stack.push(CLOSE_OBJECT);\n             if (textNode !== undefined) {\n                emitValueOpen(textNode);\n                emitValueClose();\n                textNode = undefined;\n             }\n             state  = OPEN_KEY;\n          } else \n             return emitError('Bad object');\n        continue;\n\n        case OPEN_ARRAY: // after an array there always a value\n        case VALUE:\n          if (whitespace(c)) continue;\n          if(state===OPEN_ARRAY) {\n            emitValueOpen([]);\n            depth++;             \n            state = VALUE;\n            if(c === ']') {\n              emitValueClose();\n              depth--;\n              state = stack.pop() || VALUE;\n              continue;\n            } else {\n              stack.push(CLOSE_ARRAY);\n            }\n          }\n               if(c === '\"') state = STRING;\n          else if(c === '{') state = OPEN_OBJECT;\n          else if(c === '[') state = OPEN_ARRAY;\n          else if(c === 't') state = TRUE;\n          else if(c === 'f') state = FALSE;\n          else if(c === 'n') state = NULL;\n          else if(c === '-') { // keep and continue\n            numberNode += c;\n          } else if(c==='0') {\n            numberNode += c;\n            state = NUMBER_DIGIT;\n          } else if('123456789'.indexOf(c) !== -1) {\n            numberNode += c;\n            state = NUMBER_DIGIT;\n          } else               \n            return emitError(\"Bad value\");\n        continue;\n\n        case CLOSE_ARRAY:\n          if(c===',') {\n            stack.push(CLOSE_ARRAY);\n             if (textNode !== undefined) {\n                emitValueOpen(textNode);\n                emitValueClose();\n                textNode = undefined;\n             }\n             state  = VALUE;\n          } else if (c===']') {\n             if (textNode !== undefined) {\n                emitValueOpen(textNode);\n                emitValueClose();\n                textNode = undefined;\n             }\n             emitValueClose();\n            depth--;\n            state = stack.pop() || VALUE;\n          } else if (whitespace(c))\n              continue;\n          else \n             return emitError('Bad array');\n        continue;\n\n        case STRING:\n          if (textNode === undefined) {\n              textNode = \"\";\n          }\n\n          // thanks thejh, this is an about 50% performance improvement.\n          var starti              = i-1;\n           \n          STRING_BIGLOOP: while (true) {\n\n            // zero means \"no unicode active\". 1-4 mean \"parse some more\". end after 4.\n            while (unicodeI > 0) {\n              unicodeS += c;\n              c = chunk.charAt(i++);\n              if (unicodeI === 4) {\n                // TODO this might be slow? well, probably not used too often anyway\n                textNode += String.fromCharCode(parseInt(unicodeS, 16));\n                unicodeI = 0;\n                starti = i-1;\n              } else {\n                unicodeI++;\n              }\n              // we can just break here: no stuff we skipped that still has to be sliced out or so\n              if (!c) break STRING_BIGLOOP;\n            }\n            if (c === '\"' && !slashed) {\n              state = stack.pop() || VALUE;\n              textNode += chunk.substring(starti, i-1);\n              break;\n            }\n            if (c === '\\\\' && !slashed) {\n              slashed = true;\n              textNode += chunk.substring(starti, i-1);\n               c = chunk.charAt(i++);\n              if (!c) break;\n            }\n            if (slashed) {\n              slashed = false;\n                   if (c === 'n') { textNode += '\\n'; }\n              else if (c === 'r') { textNode += '\\r'; }\n              else if (c === 't') { textNode += '\\t'; }\n              else if (c === 'f') { textNode += '\\f'; }\n              else if (c === 'b') { textNode += '\\b'; }\n              else if (c === 'u') {\n                // \\uxxxx. meh!\n                unicodeI = 1;\n                unicodeS = '';\n              } else {\n                textNode += c;\n              }\n              c = chunk.charAt(i++);\n              starti = i-1;\n              if (!c) break;\n              else continue;\n            }\n\n            stringTokenPattern.lastIndex = i;\n            var reResult = stringTokenPattern.exec(chunk);\n            if (!reResult) {\n              i = chunk.length+1;\n              textNode += chunk.substring(starti, i-1);\n              break;\n            }\n            i = reResult.index+1;\n            c = chunk.charAt(reResult.index);\n            if (!c) {\n              textNode += chunk.substring(starti, i-1);\n              break;\n            }\n          }\n        continue;\n\n        case TRUE:\n          if (!c)  continue; // strange buffers\n          if (c==='r') state = TRUE2;\n          else\n             return emitError( 'Invalid true started with t'+ c);\n        continue;\n\n        case TRUE2:\n          if (!c)  continue;\n          if (c==='u') state = TRUE3;\n          else\n             return emitError('Invalid true started with tr'+ c);\n        continue;\n\n        case TRUE3:\n          if (!c) continue;\n          if(c==='e') {\n            emitValueOpen(true);\n            emitValueClose();\n            state = stack.pop() || VALUE;\n          } else\n             return emitError('Invalid true started with tru'+ c);\n        continue;\n\n        case FALSE:\n          if (!c)  continue;\n          if (c==='a') state = FALSE2;\n          else\n             return emitError('Invalid false started with f'+ c);\n        continue;\n\n        case FALSE2:\n          if (!c)  continue;\n          if (c==='l') state = FALSE3;\n          else\n             return emitError('Invalid false started with fa'+ c);\n        continue;\n\n        case FALSE3:\n          if (!c)  continue;\n          if (c==='s') state = FALSE4;\n          else\n             return emitError('Invalid false started with fal'+ c);\n        continue;\n\n        case FALSE4:\n          if (!c)  continue;\n          if (c==='e') {\n            emitValueOpen(false);\n            emitValueClose();\n            state = stack.pop() || VALUE;\n          } else\n             return emitError('Invalid false started with fals'+ c);\n        continue;\n\n        case NULL:\n          if (!c)  continue;\n          if (c==='u') state = NULL2;\n          else\n             return emitError('Invalid null started with n'+ c);\n        continue;\n\n        case NULL2:\n          if (!c)  continue;\n          if (c==='l') state = NULL3;\n          else\n             return emitError('Invalid null started with nu'+ c);\n        continue;\n\n        case NULL3:\n          if (!c) continue;\n          if(c==='l') {\n            emitValueOpen(null);\n            emitValueClose();\n            state = stack.pop() || VALUE;\n          } else \n             return emitError('Invalid null started with nul'+ c);\n        continue;\n\n        case NUMBER_DECIMAL_POINT:\n          if(c==='.') {\n            numberNode += c;\n            state       = NUMBER_DIGIT;\n          } else \n             return emitError('Leading zero not followed by .');\n        continue;\n\n        case NUMBER_DIGIT:\n          if('0123456789'.indexOf(c) !== -1) numberNode += c;\n          else if (c==='.') {\n            if(numberNode.indexOf('.')!==-1)\n               return emitError('Invalid number has two dots');\n            numberNode += c;\n          } else if (c==='e' || c==='E') {\n            if(numberNode.indexOf('e')!==-1 ||\n               numberNode.indexOf('E')!==-1 )\n               return emitError('Invalid number has two exponential');\n            numberNode += c;\n          } else if (c===\"+\" || c===\"-\") {\n            if(!(p==='e' || p==='E'))\n               return emitError('Invalid symbol in number');\n            numberNode += c;\n          } else {\n            if (numberNode) {\n              emitValueOpen(parseFloat(numberNode));\n              emitValueClose();\n              numberNode = \"\";\n            }\n            i--; // go back one\n            state = stack.pop() || VALUE;\n          }\n        continue;\n\n        default:\n          return emitError(\"Unknown state: \" + state);\n      }\n    }\n    if (position >= bufferCheckPosition)\n      checkBufferLength();\n  }\n}\n\n\n/** \n * A bridge used to assign stateless functions to listen to clarinet.\n * \n * As well as the parameter from clarinet, each callback will also be passed\n * the result of the last callback.\n * \n * This may also be used to clear all listeners by assigning zero handlers:\n * \n *    ascentManager( clarinet, {} )\n */\nfunction ascentManager(oboeBus, handlers){\n   \"use strict\";\n   \n   var listenerId = {},\n       ascent;\n\n   function stateAfter(handler) {\n      return function(param){\n         ascent = handler( ascent, param);\n      }\n   }\n   \n   for( var eventName in handlers ) {\n\n      oboeBus(eventName).on(stateAfter(handlers[eventName]), listenerId);\n   }\n   \n   oboeBus(NODE_SWAP).on(function(newNode) {\n      \n      var oldHead = head(ascent),\n          key = keyOf(oldHead),\n          ancestors = tail(ascent),\n          parentNode;\n\n      if( ancestors ) {\n         parentNode = nodeOf(head(ancestors));\n         parentNode[key] = newNode;\n      }\n   });\n\n   oboeBus(NODE_DROP).on(function() {\n\n      var oldHead = head(ascent),\n          key = keyOf(oldHead),\n          ancestors = tail(ascent),\n          parentNode;\n\n      if( ancestors ) {\n         parentNode = nodeOf(head(ancestors));\n \n         delete parentNode[key];\n      }\n   });\n\n   oboeBus(ABORTING).on(function(){\n      \n      for( var eventName in handlers ) {\n         oboeBus(eventName).un(listenerId);\n      }\n   });   \n}\n\n// based on gist https://gist.github.com/monsur/706839\n\n/**\n * XmlHttpRequest's getAllResponseHeaders() method returns a string of response\n * headers according to the format described here:\n * http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method\n * This method parses that string into a user-friendly key/value pair object.\n */\nfunction parseResponseHeaders(headerStr) {\n   var headers = {};\n   \n   headerStr && headerStr.split('\\u000d\\u000a')\n      .forEach(function(headerPair){\n   \n         // Can't use split() here because it does the wrong thing\n         // if the header value has the string \": \" in it.\n         var index = headerPair.indexOf('\\u003a\\u0020');\n         \n         headers[headerPair.substring(0, index)] \n                     = headerPair.substring(index + 2);\n      });\n   \n   return headers;\n}\n\n/**\n * Detect if a given URL is cross-origin in the scope of the\n * current page.\n * \n * Browser only (since cross-origin has no meaning in Node.js)\n *\n * @param {Object} pageLocation - as in window.location\n * @param {Object} ajaxHost - an object like window.location describing the \n *    origin of the url that we want to ajax in\n */\nfunction isCrossOrigin(pageLocation, ajaxHost) {\n\n   /*\n    * NB: defaultPort only knows http and https.\n    * Returns undefined otherwise.\n    */\n   function defaultPort(protocol) {\n      return {'http:':80, 'https:':443}[protocol];\n   }\n   \n   function portOf(location) {\n      // pageLocation should always have a protocol. ajaxHost if no port or\n      // protocol is specified, should use the port of the containing page\n      \n      return location.port || defaultPort(location.protocol||pageLocation.protocol);\n   }\n\n   // if ajaxHost doesn't give a domain, port is the same as pageLocation\n   // it can't give a protocol but not a domain\n   // it can't give a port but not a domain\n   \n   return !!(  (ajaxHost.protocol  && (ajaxHost.protocol  != pageLocation.protocol)) ||\n               (ajaxHost.host      && (ajaxHost.host      != pageLocation.host))     ||\n               (ajaxHost.host      && (portOf(ajaxHost) != portOf(pageLocation)))\n          );\n}\n\n/* turn any url into an object like window.location */\nfunction parseUrlOrigin(url) {\n   // url could be domain-relative\n   // url could give a domain\n\n   // cross origin means:\n   //    same domain\n   //    same port\n   //    some protocol\n   // so, same everything up to the first (single) slash \n   // if such is given\n   //\n   // can ignore everything after that   \n   \n   var URL_HOST_PATTERN = /(\\w+:)?(?:\\/\\/)([\\w.-]+)?(?::(\\d+))?\\/?/,\n\n         // if no match, use an empty array so that\n         // subexpressions 1,2,3 are all undefined\n         // and will ultimately return all empty\n         // strings as the parse result:\n       urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\n   \n   return {\n      protocol:   urlHostMatch[1] || '',\n      host:       urlHostMatch[2] || '',\n      port:       urlHostMatch[3] || ''\n   };\n}\n\nfunction httpTransport(){\n   return new XMLHttpRequest();\n}\n\n/**\n * A wrapper around the browser XmlHttpRequest object that raises an \n * event whenever a new part of the response is available.\n * \n * In older browsers progressive reading is impossible so all the \n * content is given in a single call. For newer ones several events\n * should be raised, allowing progressive interpretation of the response.\n *      \n * @param {Function} oboeBus an event bus local to this Oboe instance\n * @param {XMLHttpRequest} xhr the xhr to use as the transport. Under normal\n *          operation, will have been created using httpTransport() above\n *          but for tests a stub can be provided instead.\n * @param {String} method one of 'GET' 'POST' 'PUT' 'PATCH' 'DELETE'\n * @param {String} url the url to make a request to\n * @param {String|Null} data some content to be sent with the request.\n *                      Only valid if method is POST or PUT.\n * @param {Object} [headers] the http request headers to send\n * @param {boolean} withCredentials the XHR withCredentials property will be\n *    set to this value\n */  \nfunction streamingHttp(oboeBus, xhr, method, url, data, headers, withCredentials) {\n           \n   \"use strict\";\n   \n   var emitStreamData = oboeBus(STREAM_DATA).emit,\n       emitFail       = oboeBus(FAIL_EVENT).emit,\n       numberOfCharsAlreadyGivenToCallback = 0,\n       stillToSendStartEvent = true;\n\n   // When an ABORTING message is put on the event bus abort \n   // the ajax request         \n   oboeBus( ABORTING ).on( function(){\n  \n      // if we keep the onreadystatechange while aborting the XHR gives \n      // a callback like a successful call so first remove this listener\n      // by assigning null:\n      xhr.onreadystatechange = null;\n            \n      xhr.abort();\n   });\n\n   /** \n    * Handle input from the underlying xhr: either a state change,\n    * the progress event or the request being complete.\n    */\n   function handleProgress() {\n                        \n      var textSoFar = xhr.responseText,\n          newText = textSoFar.substr(numberOfCharsAlreadyGivenToCallback);\n      \n      \n      /* Raise the event for new text.\n      \n         On older browsers, the new text is the whole response. \n         On newer/better ones, the fragment part that we got since \n         last progress. */\n         \n      if( newText ) {\n         emitStreamData( newText );\n      } \n\n      numberOfCharsAlreadyGivenToCallback = len(textSoFar);\n   }\n   \n   \n   if('onprogress' in xhr){  // detect browser support for progressive delivery\n      xhr.onprogress = handleProgress;\n   }\n      \n   xhr.onreadystatechange = function() {\n\n      function sendStartIfNotAlready() {\n         // Internet Explorer is very unreliable as to when xhr.status etc can\n         // be read so has to be protected with try/catch and tried again on \n         // the next readyState if it fails\n         try{\n            stillToSendStartEvent && oboeBus( HTTP_START ).emit(\n               xhr.status,\n               parseResponseHeaders(xhr.getAllResponseHeaders()) );\n            stillToSendStartEvent = false;\n         } catch(e){/* do nothing, will try again on next readyState*/}\n      }\n      \n      switch( xhr.readyState ) {\n               \n         case 2: // HEADERS_RECEIVED\n         case 3: // LOADING\n            return sendStartIfNotAlready();\n            \n         case 4: // DONE\n            sendStartIfNotAlready(); // if xhr.status hasn't been available yet, it must be NOW, huh IE?\n            \n            // is this a 2xx http code?\n            var successful = String(xhr.status)[0] == 2;\n            \n            if( successful ) {\n               // In Chrome 29 (not 28) no onprogress is emitted when a response\n               // is complete before the onload. We need to always do handleInput\n               // in case we get the load but have not had a final progress event.\n               // This looks like a bug and may change in future but let's take\n               // the safest approach and assume we might not have received a \n               // progress event for each part of the response\n               handleProgress();\n               \n               oboeBus(STREAM_END).emit();\n            } else {\n\n               emitFail( errorReport(\n                  xhr.status, \n                  xhr.responseText\n               ));\n            }\n      }\n   };\n   \n   try{\n   \n      xhr.open(method, url, true);\n   \n      for( var headerName in headers ){\n         xhr.setRequestHeader(headerName, headers[headerName]);\n      }\n      \n      if( !isCrossOrigin(window.location, parseUrlOrigin(url)) ) {\n         xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n      }\n\n      xhr.withCredentials = withCredentials;\n      \n      xhr.send(data);\n      \n   } catch( e ) {\n      \n      // To keep a consistent interface with Node, we can't emit an event here.\n      // Node's streaming http adaptor receives the error as an asynchronous\n      // event rather than as an exception. If we emitted now, the Oboe user\n      // has had no chance to add a .fail listener so there is no way\n      // the event could be useful. For both these reasons defer the\n      // firing to the next JS frame.  \n      window.setTimeout(\n         partialComplete(emitFail, errorReport(undefined, undefined, e))\n      ,  0\n      );\n   }            \n}\n\nvar jsonPathSyntax = (function() {\n \n   var\n   \n   /** \n    * Export a regular expression as a simple function by exposing just \n    * the Regex#exec. This allows regex tests to be used under the same \n    * interface as differently implemented tests, or for a user of the\n    * tests to not concern themselves with their implementation as regular\n    * expressions.\n    * \n    * This could also be expressed point-free as:\n    *   Function.prototype.bind.bind(RegExp.prototype.exec),\n    *   \n    * But that's far too confusing! (and not even smaller once minified \n    * and gzipped)\n    */\n       regexDescriptor = function regexDescriptor(regex) {\n            return regex.exec.bind(regex);\n       }\n       \n   /**\n    * Join several regular expressions and express as a function.\n    * This allows the token patterns to reuse component regular expressions\n    * instead of being expressed in full using huge and confusing regular\n    * expressions.\n    */       \n   ,   jsonPathClause = varArgs(function( componentRegexes ) {\n\n            // The regular expressions all start with ^ because we \n            // only want to find matches at the start of the \n            // JSONPath fragment we are inspecting           \n            componentRegexes.unshift(/^/);\n            \n            return   regexDescriptor(\n                        RegExp(\n                           componentRegexes.map(attr('source')).join('')\n                        )\n                     );\n       })\n       \n   ,   possiblyCapturing =           /(\\$?)/\n   ,   namedNode =                   /([\\w-_]+|\\*)/\n   ,   namePlaceholder =             /()/\n   ,   nodeInArrayNotation =         /\\[\"([^\"]+)\"\\]/\n   ,   numberedNodeInArrayNotation = /\\[(\\d+|\\*)\\]/\n   ,   fieldList =                      /{([\\w ]*?)}/\n   ,   optionalFieldList =           /(?:{([\\w ]*?)})?/\n    \n\n       //   foo or *                  \n   ,   jsonPathNamedNodeInObjectNotation   = jsonPathClause( \n                                                possiblyCapturing, \n                                                namedNode, \n                                                optionalFieldList\n                                             )\n                                             \n       //   [\"foo\"]   \n   ,   jsonPathNamedNodeInArrayNotation    = jsonPathClause( \n                                                possiblyCapturing, \n                                                nodeInArrayNotation, \n                                                optionalFieldList\n                                             )  \n\n       //   [2] or [*]       \n   ,   jsonPathNumberedNodeInArrayNotation = jsonPathClause( \n                                                possiblyCapturing, \n                                                numberedNodeInArrayNotation, \n                                                optionalFieldList\n                                             )\n\n       //   {a b c}      \n   ,   jsonPathPureDuckTyping              = jsonPathClause( \n                                                possiblyCapturing, \n                                                namePlaceholder, \n                                                fieldList\n                                             )\n   \n       //   ..\n   ,   jsonPathDoubleDot                   = jsonPathClause(/\\.\\./)                  \n   \n       //   .\n   ,   jsonPathDot                         = jsonPathClause(/\\./)                    \n   \n       //   !\n   ,   jsonPathBang                        = jsonPathClause(\n                                                possiblyCapturing, \n                                                /!/\n                                             )  \n   \n       //   nada!\n   ,   emptyString                         = jsonPathClause(/$/)                     \n   \n   ;\n   \n  \n   /* We export only a single function. When called, this function injects \n      into another function the descriptors from above.             \n    */\n   return function (fn){      \n      return fn(      \n         lazyUnion(\n            jsonPathNamedNodeInObjectNotation\n         ,  jsonPathNamedNodeInArrayNotation\n         ,  jsonPathNumberedNodeInArrayNotation\n         ,  jsonPathPureDuckTyping \n         )\n      ,  jsonPathDoubleDot\n      ,  jsonPathDot\n      ,  jsonPathBang\n      ,  emptyString \n      );\n   }; \n\n}());\n/**\n * Get a new key->node mapping\n * \n * @param {String|Number} key\n * @param {Object|Array|String|Number|null} node a value found in the json\n */\nfunction namedNode(key, node) {\n   return {key:key, node:node};\n}\n\n/** get the key of a namedNode */\nvar keyOf = attr('key');\n\n/** get the node from a namedNode */\nvar nodeOf = attr('node');\n/** \n * This file provides various listeners which can be used to build up\n * a changing ascent based on the callbacks provided by Clarinet. It listens\n * to the low-level events from Clarinet and emits higher-level ones.\n *  \n * The building up is stateless so to track a JSON file\n * ascentManager.js is required to store the ascent state\n * between calls.\n */\n\n\n\n/** \n * A special value to use in the path list to represent the path 'to' a root \n * object (which doesn't really have any path). This prevents the need for \n * special-casing detection of the root object and allows it to be treated \n * like any other object. We might think of this as being similar to the \n * 'unnamed root' domain \".\", eg if I go to \n * http://en.wikipedia.org./wiki/En/Main_page the dot after 'org' deliminates \n * the unnamed root of the DNS.\n * \n * This is kept as an object to take advantage that in Javascript's OO objects \n * are guaranteed to be distinct, therefore no other object can possibly clash \n * with this one. Strings, numbers etc provide no such guarantee. \n **/\nvar ROOT_PATH = {};\n\n\n/**\n * Create a new set of handlers for clarinet's events, bound to the emit \n * function given.  \n */ \nfunction incrementalContentBuilder( oboeBus ) {\n\n   var emitNodeOpened = oboeBus(NODE_OPENED).emit,\n       emitNodeClosed = oboeBus(NODE_CLOSED).emit,\n       emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit,\n       emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit;\n\n   function arrayIndicesAreKeys( possiblyInconsistentAscent, newDeepestNode) {\n   \n      /* for values in arrays we aren't pre-warned of the coming paths \n         (Clarinet gives no call to onkey like it does for values in objects) \n         so if we are in an array we need to create this path ourselves. The \n         key will be len(parentNode) because array keys are always sequential \n         numbers. */\n\n      var parentNode = nodeOf( head( possiblyInconsistentAscent));\n      \n      return      isOfType( Array, parentNode)\n               ?\n                  keyFound(  possiblyInconsistentAscent, \n                              len(parentNode), \n                              newDeepestNode\n                  )\n               :  \n                  // nothing needed, return unchanged\n                  possiblyInconsistentAscent \n               ;\n   }\n                 \n   function nodeOpened( ascent, newDeepestNode ) {\n      \n      if( !ascent ) {\n         // we discovered the root node,         \n         emitRootOpened( newDeepestNode);\n                    \n         return keyFound( ascent, ROOT_PATH, newDeepestNode);         \n      }\n\n      // we discovered a non-root node\n                 \n      var arrayConsistentAscent  = arrayIndicesAreKeys( ascent, newDeepestNode),      \n          ancestorBranches       = tail( arrayConsistentAscent),\n          previouslyUnmappedName = keyOf( head( arrayConsistentAscent));\n          \n      appendBuiltContent( \n         ancestorBranches, \n         previouslyUnmappedName, \n         newDeepestNode \n      );\n                                                                                                         \n      return cons( \n               namedNode( previouslyUnmappedName, newDeepestNode ), \n               ancestorBranches\n      );                                                                          \n   }\n\n\n   /**\n    * Add a new value to the object we are building up to represent the\n    * parsed JSON\n    */\n   function appendBuiltContent( ancestorBranches, key, node ){\n     \n      nodeOf( head( ancestorBranches))[key] = node;\n   }\n\n     \n   /**\n    * For when we find a new key in the json.\n    * \n    * @param {String|Number|Object} newDeepestName the key. If we are in an \n    *    array will be a number, otherwise a string. May take the special \n    *    value ROOT_PATH if the root node has just been found\n    *    \n    * @param {String|Number|Object|Array|Null|undefined} [maybeNewDeepestNode] \n    *    usually this won't be known so can be undefined. Can't use null \n    *    to represent unknown because null is a valid value in JSON\n    **/  \n   function keyFound(ascent, newDeepestName, maybeNewDeepestNode) {\n\n      if( ascent ) { // if not root\n      \n         // If we have the key but (unless adding to an array) no known value\n         // yet. Put that key in the output but against no defined value:      \n         appendBuiltContent( ascent, newDeepestName, maybeNewDeepestNode );\n      }\n   \n      var ascentWithNewPath = cons( \n                                 namedNode( newDeepestName, \n                                            maybeNewDeepestNode), \n                                 ascent\n                              );\n\n      emitNodeOpened( ascentWithNewPath);\n \n      return ascentWithNewPath;\n   }\n\n\n   /**\n    * For when the current node ends.\n    */\n   function nodeClosed( ascent ) {\n\n      emitNodeClosed( ascent);\n       \n      return tail( ascent) ||\n             // If there are no nodes left in the ascent the root node\n             // just closed. Emit a special event for this: \n             emitRootClosed(nodeOf(head(ascent)));\n   }      \n\n   var contentBuilderHandlers = {};\n   contentBuilderHandlers[SAX_VALUE_OPEN] = nodeOpened;\n   contentBuilderHandlers[SAX_VALUE_CLOSE] = nodeClosed;\n   contentBuilderHandlers[SAX_KEY] = keyFound;\n   return contentBuilderHandlers;\n}\n\n/**\n * The jsonPath evaluator compiler used for Oboe.js. \n * \n * One function is exposed. This function takes a String JSONPath spec and \n * returns a function to test candidate ascents for matches.\n * \n *  String jsonPath -> (List ascent) -> Boolean|Object\n *\n * This file is coded in a pure functional style. That is, no function has \n * side effects, every function evaluates to the same value for the same \n * arguments and no variables are reassigned.\n */  \n// the call to jsonPathSyntax injects the token syntaxes that are needed \n// inside the compiler\nvar jsonPathCompiler = jsonPathSyntax(function (pathNodeSyntax, \n                                                doubleDotSyntax, \n                                                dotSyntax,\n                                                bangSyntax,\n                                                emptySyntax ) {\n\n   var CAPTURING_INDEX = 1;\n   var NAME_INDEX = 2;\n   var FIELD_LIST_INDEX = 3;\n\n   var headKey  = compose2(keyOf, head),\n       headNode = compose2(nodeOf, head);\n                   \n   /**\n    * Create an evaluator function for a named path node, expressed in the\n    * JSONPath like:\n    *    foo\n    *    [\"bar\"]\n    *    [2]   \n    */\n   function nameClause(previousExpr, detection ) {\n     \n      var name = detection[NAME_INDEX],\n            \n          matchesName = ( !name || name == '*' ) \n                           ?  always\n                           :  function(ascent){return headKey(ascent) == name};\n     \n\n      return lazyIntersection(matchesName, previousExpr);\n   }\n\n   /**\n    * Create an evaluator function for a a duck-typed node, expressed like:\n    * \n    *    {spin, taste, colour}\n    *    .particle{spin, taste, colour}\n    *    *{spin, taste, colour}\n    */\n   function duckTypeClause(previousExpr, detection) {\n\n      var fieldListStr = detection[FIELD_LIST_INDEX];\n\n      if (!fieldListStr) \n         return previousExpr; // don't wrap at all, return given expr as-is      \n\n      var hasAllrequiredFields = partialComplete(\n                                    hasAllProperties, \n                                    arrayAsList(fieldListStr.split(/\\W+/))\n                                 ),\n                                 \n          isMatch =  compose2( \n                        hasAllrequiredFields, \n                        headNode\n                     );\n\n      return lazyIntersection(isMatch, previousExpr);\n   }\n\n   /**\n    * Expression for $, returns the evaluator function\n    */\n   function capture( previousExpr, detection ) {\n\n      // extract meaning from the detection      \n      var capturing = !!detection[CAPTURING_INDEX];\n\n      if (!capturing)          \n         return previousExpr; // don't wrap at all, return given expr as-is      \n      \n      return lazyIntersection(previousExpr, head);\n            \n   }            \n      \n   /**\n    * Create an evaluator function that moves onto the next item on the \n    * lists. This function is the place where the logic to move up a \n    * level in the ascent exists. \n    * \n    * Eg, for JSONPath \".foo\" we need skip1(nameClause(always, [,'foo']))\n    */\n   function skip1(previousExpr) {\n   \n   \n      if( previousExpr == always ) {\n         /* If there is no previous expression this consume command \n            is at the start of the jsonPath.\n            Since JSONPath specifies what we'd like to find but not \n            necessarily everything leading down to it, when running\n            out of JSONPath to check against we default to true */\n         return always;\n      }\n\n      /** return true if the ascent we have contains only the JSON root,\n       *  false otherwise\n       */\n      function notAtRoot(ascent){\n         return headKey(ascent) != ROOT_PATH;\n      }\n      \n      return lazyIntersection(\n               /* If we're already at the root but there are more \n                  expressions to satisfy, can't consume any more. No match.\n\n                  This check is why none of the other exprs have to be able \n                  to handle empty lists; skip1 is the only evaluator that \n                  moves onto the next token and it refuses to do so once it \n                  reaches the last item in the list. */\n               notAtRoot,\n               \n               /* We are not at the root of the ascent yet.\n                  Move to the next level of the ascent by handing only \n                  the tail to the previous expression */ \n               compose2(previousExpr, tail) \n      );\n                                                                                                               \n   }   \n   \n   /**\n    * Create an evaluator function for the .. (double dot) token. Consumes\n    * zero or more levels of the ascent, the fewest that are required to find\n    * a match when given to previousExpr.\n    */   \n   function skipMany(previousExpr) {\n\n      if( previousExpr == always ) {\n         /* If there is no previous expression this consume command \n            is at the start of the jsonPath.\n            Since JSONPath specifies what we'd like to find but not \n            necessarily everything leading down to it, when running\n            out of JSONPath to check against we default to true */            \n         return always;\n      }\n          \n      var \n          // In JSONPath .. is equivalent to !.. so if .. reaches the root\n          // the match has succeeded. Ie, we might write ..foo or !..foo\n          // and both should match identically.\n          terminalCaseWhenArrivingAtRoot = rootExpr(),\n          terminalCaseWhenPreviousExpressionIsSatisfied = previousExpr,\n          recursiveCase = skip1(function(ascent) {\n             return cases(ascent);\n          }),\n\n          cases = lazyUnion(\n                     terminalCaseWhenArrivingAtRoot\n                  ,  terminalCaseWhenPreviousExpressionIsSatisfied\n                  ,  recursiveCase  \n                  );\n      \n      return cases;\n   }      \n   \n   /**\n    * Generate an evaluator for ! - matches only the root element of the json\n    * and ignores any previous expressions since nothing may precede !. \n    */   \n   function rootExpr() {\n      \n      return function(ascent){\n         return headKey(ascent) == ROOT_PATH;\n      };\n   }   \n         \n   /**\n    * Generate a statement wrapper to sit around the outermost \n    * clause evaluator.\n    * \n    * Handles the case where the capturing is implicit because the JSONPath\n    * did not contain a '$' by returning the last node.\n    */   \n   function statementExpr(lastClause) {\n      \n      return function(ascent) {\n   \n         // kick off the evaluation by passing through to the last clause\n         var exprMatch = lastClause(ascent);\n                                                     \n         return exprMatch === true ? head(ascent) : exprMatch;\n      };\n   }      \n                          \n   /**\n    * For when a token has been found in the JSONPath input.\n    * Compiles the parser for that token and returns in combination with the\n    * parser already generated.\n    * \n    * @param {Function} exprs  a list of the clause evaluator generators for\n    *                          the token that was found\n    * @param {Function} parserGeneratedSoFar the parser already found\n    * @param {Array} detection the match given by the regex engine when \n    *                          the feature was found\n    */\n   function expressionsReader( exprs, parserGeneratedSoFar, detection ) {\n                     \n      // if exprs is zero-length foldR will pass back the \n      // parserGeneratedSoFar as-is so we don't need to treat \n      // this as a special case\n      \n      return   foldR( \n                  function( parserGeneratedSoFar, expr ){\n         \n                     return expr(parserGeneratedSoFar, detection);\n                  }, \n                  parserGeneratedSoFar, \n                  exprs\n               );                     \n\n   }\n\n   /** \n    *  If jsonPath matches the given detector function, creates a function which\n    *  evaluates against every clause in the clauseEvaluatorGenerators. The\n    *  created function is propagated to the onSuccess function, along with\n    *  the remaining unparsed JSONPath substring.\n    *  \n    *  The intended use is to create a clauseMatcher by filling in\n    *  the first two arguments, thus providing a function that knows\n    *  some syntax to match and what kind of generator to create if it\n    *  finds it. The parameter list once completed is:\n    *  \n    *    (jsonPath, parserGeneratedSoFar, onSuccess)\n    *  \n    *  onSuccess may be compileJsonPathToFunction, to recursively continue \n    *  parsing after finding a match or returnFoundParser to stop here.\n    */\n   function generateClauseReaderIfTokenFound (\n     \n                        tokenDetector, clauseEvaluatorGenerators,\n                         \n                        jsonPath, parserGeneratedSoFar, onSuccess) {\n                        \n      var detected = tokenDetector(jsonPath);\n\n      if(detected) {\n         var compiledParser = expressionsReader(\n                                 clauseEvaluatorGenerators, \n                                 parserGeneratedSoFar, \n                                 detected\n                              ),\n         \n             remainingUnparsedJsonPath = jsonPath.substr(len(detected[0]));                \n                               \n         return onSuccess(remainingUnparsedJsonPath, compiledParser);\n      }         \n   }\n                 \n   /**\n    * Partially completes generateClauseReaderIfTokenFound above. \n    */\n   function clauseMatcher(tokenDetector, exprs) {\n        \n      return   partialComplete( \n                  generateClauseReaderIfTokenFound, \n                  tokenDetector, \n                  exprs \n               );\n   }\n\n   /**\n    * clauseForJsonPath is a function which attempts to match against \n    * several clause matchers in order until one matches. If non match the\n    * jsonPath expression is invalid and an error is thrown.\n    * \n    * The parameter list is the same as a single clauseMatcher:\n    * \n    *    (jsonPath, parserGeneratedSoFar, onSuccess)\n    */     \n   var clauseForJsonPath = lazyUnion(\n\n      clauseMatcher(pathNodeSyntax   , list( capture, \n                                             duckTypeClause, \n                                             nameClause, \n                                             skip1 ))\n                                                     \n   ,  clauseMatcher(doubleDotSyntax  , list( skipMany))\n       \n       // dot is a separator only (like whitespace in other languages) but \n       // rather than make it a special case, use an empty list of \n       // expressions when this token is found\n   ,  clauseMatcher(dotSyntax        , list() )  \n                                                                                      \n   ,  clauseMatcher(bangSyntax       , list( capture,\n                                             rootExpr))\n                                                          \n   ,  clauseMatcher(emptySyntax      , list( statementExpr))\n   \n   ,  function (jsonPath) {\n         throw Error('\"' + jsonPath + '\" could not be tokenised')      \n      }\n   );\n\n\n   /**\n    * One of two possible values for the onSuccess argument of \n    * generateClauseReaderIfTokenFound.\n    * \n    * When this function is used, generateClauseReaderIfTokenFound simply \n    * returns the compiledParser that it made, regardless of if there is \n    * any remaining jsonPath to be compiled.\n    */\n   function returnFoundParser(_remainingJsonPath, compiledParser){ \n      return compiledParser \n   }     \n              \n   /**\n    * Recursively compile a JSONPath expression.\n    * \n    * This function serves as one of two possible values for the onSuccess \n    * argument of generateClauseReaderIfTokenFound, meaning continue to\n    * recursively compile. Otherwise, returnFoundParser is given and\n    * compilation terminates.\n    */\n   function compileJsonPathToFunction( uncompiledJsonPath, \n                                       parserGeneratedSoFar ) {\n\n      /**\n       * On finding a match, if there is remaining text to be compiled\n       * we want to either continue parsing using a recursive call to \n       * compileJsonPathToFunction. Otherwise, we want to stop and return \n       * the parser that we have found so far.\n       */\n      var onFind =      uncompiledJsonPath\n                     ?  compileJsonPathToFunction \n                     :  returnFoundParser;\n                   \n      return   clauseForJsonPath( \n                  uncompiledJsonPath, \n                  parserGeneratedSoFar, \n                  onFind\n               );                              \n   }\n\n   /**\n    * This is the function that we expose to the rest of the library.\n    */\n   return function(jsonPath){\n        \n      try {\n         // Kick off the recursive parsing of the jsonPath \n         return compileJsonPathToFunction(jsonPath, always);\n         \n      } catch( e ) {\n         throw Error( 'Could not compile \"' + jsonPath + \n                      '\" because ' + e.message\n         );\n      }\n   }\n\n});\n\n/** \n * A pub/sub which is responsible for a single event type. A \n * multi-event type event bus is created by pubSub by collecting\n * several of these.\n * \n * @param {String} eventType                   \n *    the name of the events managed by this singleEventPubSub\n * @param {singleEventPubSub} [newListener]    \n *    place to notify of new listeners\n * @param {singleEventPubSub} [removeListener] \n *    place to notify of when listeners are removed\n */\nfunction singleEventPubSub(eventType, newListener, removeListener){\n\n   /** we are optimised for emitting events over firing them.\n    *  As well as the tuple list which stores event ids and\n    *  listeners there is a list with just the listeners which \n    *  can be iterated more quickly when we are emitting\n    */\n   var listenerTupleList,\n       listenerList;\n\n   function hasId(id){\n      return function(tuple) {\n         return tuple.id == id;      \n      };  \n   }\n              \n   return {\n\n      /**\n       * @param {Function} listener\n       * @param {*} listenerId \n       *    an id that this listener can later by removed by. \n       *    Can be of any type, to be compared to other ids using ==\n       */\n      on:function( listener, listenerId ) {\n         \n         var tuple = {\n            listener: listener\n         ,  id:       listenerId || listener // when no id is given use the\n                                             // listener function as the id\n         };\n\n         if( newListener ) {\n            newListener.emit(eventType, listener, tuple.id);\n         }\n         \n         listenerTupleList = cons( tuple,    listenerTupleList );\n         listenerList      = cons( listener, listenerList      );\n\n         return this; // chaining\n      },\n     \n      emit:function () {                                                                                           \n         applyEach( listenerList, arguments );\n      },\n      \n      un: function( listenerId ) {\n             \n         var removed;             \n              \n         listenerTupleList = without(\n            listenerTupleList,\n            hasId(listenerId),\n            function(tuple){\n               removed = tuple;\n            }\n         );    \n         \n         if( removed ) {\n            listenerList = without( listenerList, function(listener){\n               return listener == removed.listener;\n            });\n         \n            if( removeListener ) {\n               removeListener.emit(eventType, removed.listener, removed.id);\n            }\n         }\n      },\n      \n      listeners: function(){\n         // differs from Node EventEmitter: returns list, not array\n         return listenerList;\n      },\n      \n      hasListener: function(listenerId){\n         var test = listenerId? hasId(listenerId) : always;\n      \n         return defined(first( test, listenerTupleList));\n      }\n   };\n}\n/**\n * pubSub is a curried interface for listening to and emitting\n * events.\n * \n * If we get a bus:\n *    \n *    var bus = pubSub();\n * \n * We can listen to event 'foo' like:\n * \n *    bus('foo').on(myCallback)\n *    \n * And emit event foo like:\n * \n *    bus('foo').emit()\n *    \n * or, with a parameter:\n * \n *    bus('foo').emit('bar')\n *     \n * All functions can be cached and don't need to be \n * bound. Ie:\n * \n *    var fooEmitter = bus('foo').emit\n *    fooEmitter('bar');  // emit an event\n *    fooEmitter('baz');  // emit another\n *    \n * There's also an uncurried[1] shortcut for .emit and .on:\n * \n *    bus.on('foo', callback)\n *    bus.emit('foo', 'bar')\n * \n * [1]: http://zvon.org/other/haskell/Outputprelude/uncurry_f.html\n */\nfunction pubSub(){\n\n   var singles = {},\n       newListener = newSingle('newListener'),\n       removeListener = newSingle('removeListener'); \n      \n   function newSingle(eventName) {\n      return singles[eventName] = singleEventPubSub(\n         eventName, \n         newListener, \n         removeListener\n      );   \n   }      \n\n   /** pubSub instances are functions */\n   function pubSubInstance( eventName ){   \n      \n      return singles[eventName] || newSingle( eventName );   \n   }\n\n   // add convenience EventEmitter-style uncurried form of 'emit' and 'on'\n   ['emit', 'on', 'un'].forEach(function(methodName){\n   \n      pubSubInstance[methodName] = varArgs(function(eventName, parameters){\n         apply( parameters, pubSubInstance( eventName )[methodName]);\n      });   \n   });\n         \n   return pubSubInstance;\n}\n\n/**\n * This file declares some constants to use as names for event types.\n */\n\nvar // the events which are never exported are kept as \n    // the smallest possible representation, in numbers:\n    _S = 1,\n\n    // fired whenever a new node starts in the JSON stream:\n    NODE_OPENED     = _S++,\n\n    // fired whenever a node closes in the JSON stream:\n    NODE_CLOSED     = _S++,\n\n    // called if a .node callback returns a value - \n    NODE_SWAP       = _S++,\n    NODE_DROP       = _S++,\n\n    FAIL_EVENT      = 'fail',\n   \n    ROOT_NODE_FOUND = _S++,\n    ROOT_PATH_FOUND = _S++,\n   \n    HTTP_START      = 'start',\n    STREAM_DATA     = 'data',\n    STREAM_END      = 'end',\n    ABORTING        = _S++,\n\n    // SAX events butchered from Clarinet\n    SAX_KEY          = _S++,\n    SAX_VALUE_OPEN   = _S++,\n    SAX_VALUE_CLOSE  = _S++;\n    \nfunction errorReport(statusCode, body, error) {\n   try{\n      var jsonBody = JSON.parse(body);\n   }catch(e){}\n\n   return {\n      statusCode:statusCode,\n      body:body,\n      jsonBody:jsonBody,\n      thrown:error\n   };\n}    \n\n/** \n *  The pattern adaptor listens for newListener and removeListener\n *  events. When patterns are added or removed it compiles the JSONPath\n *  and wires them up.\n *  \n *  When nodes and paths are found it emits the fully-qualified match \n *  events with parameters ready to ship to the outside world\n */\n\nfunction patternAdapter(oboeBus, jsonPathCompiler) {\n\n   var predicateEventMap = {\n      node:oboeBus(NODE_CLOSED)\n   ,  path:oboeBus(NODE_OPENED)\n   };\n     \n   function emitMatchingNode(emitMatch, node, ascent) {\n         \n      /* \n         We're now calling to the outside world where Lisp-style \n         lists will not be familiar. Convert to standard arrays. \n   \n         Also, reverse the order because it is more common to \n         list paths \"root to leaf\" than \"leaf to root\"  */\n      var descent     = reverseList(ascent);\n                \n      emitMatch(\n         node,\n         \n         // To make a path, strip off the last item which is the special\n         // ROOT_PATH token for the 'path' to the root node          \n         listAsArray(tail(map(keyOf,descent))),  // path\n         listAsArray(map(nodeOf, descent))       // ancestors    \n      );         \n   }\n\n   /* \n    * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \n    * matching the specified pattern, propagate to pattern-match events such as \n    * oboeBus('node:!')\n    * \n    * \n    * \n    * @param {Function} predicateEvent \n    *          either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\n    * @param {Function} compiledJsonPath          \n    */\n   function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\n   \n      var emitMatch = oboeBus(fullEventName).emit;\n   \n      predicateEvent.on( function (ascent) {\n\n         var maybeMatchingMapping = compiledJsonPath(ascent);\n\n         /* Possible values for maybeMatchingMapping are now:\n\n          false: \n          we did not match \n\n          an object/array/string/number/null: \n          we matched and have the node that matched.\n          Because nulls are valid json values this can be null.\n\n          undefined:\n          we matched but don't have the matching node yet.\n          ie, we know there is an upcoming node that matches but we \n          can't say anything else about it. \n          */\n         if (maybeMatchingMapping !== false) {\n\n            emitMatchingNode(\n               emitMatch, \n               nodeOf(maybeMatchingMapping), \n               ascent\n            );\n         }\n      }, fullEventName);\n     \n      oboeBus('removeListener').on( function(removedEventName){\n\n         // if the fully qualified match event listener is later removed, clean up \n         // by removing the underlying listener if it was the last using that pattern:\n      \n         if( removedEventName == fullEventName ) {\n         \n            if( !oboeBus(removedEventName).listeners(  )) {\n               predicateEvent.un( fullEventName );\n            }\n         }\n      });   \n   }\n\n   oboeBus('newListener').on( function(fullEventName){\n\n      var match = /(node|path):(.*)/.exec(fullEventName);\n      \n      if( match ) {\n         var predicateEvent = predicateEventMap[match[1]];\n                    \n         if( !predicateEvent.hasListener( fullEventName) ) {  \n                  \n            addUnderlyingListener(\n               fullEventName,\n               predicateEvent, \n               jsonPathCompiler( match[2] )\n            );\n         }\n      }    \n   })\n\n}\n\n/**\n * The instance API is the thing that is returned when oboe() is called.\n * it allows:\n *\n *    - listeners for various events to be added and removed\n *    - the http response header/headers to be read\n */\nfunction instanceApi(oboeBus, contentSource){\n\n   var oboeApi,\n       fullyQualifiedNamePattern = /^(node|path):./,\n       rootNodeFinishedEvent = oboeBus(ROOT_NODE_FOUND),\n       emitNodeDrop = oboeBus(NODE_DROP).emit,\n       emitNodeSwap = oboeBus(NODE_SWAP).emit,\n\n       /**\n        * Add any kind of listener that the instance api exposes\n        */\n       addListener = varArgs(function( eventId, parameters ){\n\n            if( oboeApi[eventId] ) {\n\n               // for events added as .on(event, callback), if there is a\n               // .event() equivalent with special behaviour , pass through\n               // to that:\n               apply(parameters, oboeApi[eventId]);\n            } else {\n\n               // we have a standard Node.js EventEmitter 2-argument call.\n               // The first parameter is the listener.\n               var event = oboeBus(eventId),\n                   listener = parameters[0];\n\n               if( fullyQualifiedNamePattern.test(eventId) ) {\n\n                  // allow fully-qualified node/path listeners\n                  // to be added\n                  addForgettableCallback(event, listener);\n               } else  {\n\n                  // the event has no special handling, pass through\n                  // directly onto the event bus:\n                  event.on( listener);\n               }\n            }\n\n            return oboeApi; // chaining\n       }),\n\n       /**\n        * Remove any kind of listener that the instance api exposes\n        */\n       removeListener = function( eventId, p2, p3 ){\n\n            if( eventId == 'done' ) {\n\n               rootNodeFinishedEvent.un(p2);\n\n            } else if( eventId == 'node' || eventId == 'path' ) {\n\n               // allow removal of node and path\n               oboeBus.un(eventId + ':' + p2, p3);\n            } else {\n\n               // we have a standard Node.js EventEmitter 2-argument call.\n               // The second parameter is the listener. This may be a call\n               // to remove a fully-qualified node/path listener but requires\n               // no special handling\n               var listener = p2;\n\n               oboeBus(eventId).un(listener);\n            }\n\n            return oboeApi; // chaining\n       };\n\n   /**\n    * Add a callback, wrapped in a try/catch so as to not break the\n    * execution of Oboe if an exception is thrown (fail events are\n    * fired instead)\n    *\n    * The callback is used as the listener id so that it can later be\n    * removed using .un(callback)\n    */\n   function addProtectedCallback(eventName, callback) {\n      oboeBus(eventName).on(protectedCallback(callback), callback);\n      return oboeApi; // chaining\n   }\n\n   /**\n    * Add a callback where, if .forget() is called during the callback's\n    * execution, the callback will be de-registered\n    */\n   function addForgettableCallback(event, callback, listenerId) {\n\n      // listenerId is optional and if not given, the original\n      // callback will be used\n      listenerId = listenerId || callback;\n\n      var safeCallback = protectedCallback(callback);\n\n      event.on( function() {\n\n         var discard = false;\n\n         oboeApi.forget = function(){\n            discard = true;\n         };\n\n         apply( arguments, safeCallback );\n\n         delete oboeApi.forget;\n\n         if( discard ) {\n            event.un(listenerId);\n         }\n      }, listenerId);\n\n      return oboeApi; // chaining\n   }\n\n   /**\n    *  wrap a callback so that if it throws, Oboe.js doesn't crash but instead\n    *  throw the error in another event loop\n    */\n   function protectedCallback( callback ) {\n      return function() {\n         try{\n            return callback.apply(oboeApi, arguments);\n         }catch(e)  {\n            setTimeout(function() {\n              throw e;\n            });\n         }\n      }\n   }\n\n   /**\n    * Return the fully qualified event for when a pattern matches\n    * either a node or a path\n    *\n    * @param type {String} either 'node' or 'path'\n    */\n   function fullyQualifiedPatternMatchEvent(type, pattern) {\n      return oboeBus(type + ':' + pattern);\n   }\n\n   function wrapCallbackToSwapNodeIfSomethingReturned( callback ) {\n      return function() {\n         var returnValueFromCallback = callback.apply(this, arguments);\n\n         if( defined(returnValueFromCallback) ) {\n\n            if( returnValueFromCallback == oboe.drop ) {\n               emitNodeDrop();\n            } else {\n               emitNodeSwap(returnValueFromCallback);\n            }\n         }\n      }\n   }\n\n   function addSingleNodeOrPathListener(eventId, pattern, callback) {\n\n      var effectiveCallback;\n\n      if( eventId == 'node' ) {\n         effectiveCallback = wrapCallbackToSwapNodeIfSomethingReturned(callback);\n      } else {\n         effectiveCallback = callback;\n      }\n\n      addForgettableCallback(\n         fullyQualifiedPatternMatchEvent(eventId, pattern),\n         effectiveCallback,\n         callback\n      );\n   }\n\n   /**\n    * Add several listeners at a time, from a map\n    */\n   function addMultipleNodeOrPathListeners(eventId, listenerMap) {\n\n      for( var pattern in listenerMap ) {\n         addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]);\n      }\n   }\n\n   /**\n    * implementation behind .onPath() and .onNode()\n    */\n   function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){\n\n      if( isString(jsonPathOrListenerMap) ) {\n         addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback);\n\n      } else {\n         addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap);\n      }\n\n      return oboeApi; // chaining\n   }\n\n\n   // some interface methods are only filled in after we receive\n   // values and are noops before that:\n   oboeBus(ROOT_PATH_FOUND).on( function(rootNode) {\n      oboeApi.root = functor(rootNode);\n   });\n\n   /**\n    * When content starts make the headers readable through the\n    * instance API\n    */\n   oboeBus(HTTP_START).on( function(_statusCode, headers) {\n\n      oboeApi.header =  function(name) {\n                           return name ? headers[name]\n                                       : headers\n                                       ;\n                        }\n   });\n\n   /**\n    * Construct and return the public API of the Oboe instance to be\n    * returned to the calling application\n    */\n   return oboeApi = {\n      on             : addListener,\n      addListener    : addListener,\n      removeListener : removeListener,\n      emit           : oboeBus.emit,\n\n      node           : partialComplete(addNodeOrPathListenerApi, 'node'),\n      path           : partialComplete(addNodeOrPathListenerApi, 'path'),\n\n      done           : partialComplete(addForgettableCallback, rootNodeFinishedEvent),\n      start          : partialComplete(addProtectedCallback, HTTP_START ),\n\n      // fail doesn't use protectedCallback because\n      // could lead to non-terminating loops\n      fail           : oboeBus(FAIL_EVENT).on,\n\n      // public api calling abort fires the ABORTING event\n      abort          : oboeBus(ABORTING).emit,\n\n      // initially return nothing for header and root\n      header         : noop,\n      root           : noop,\n\n      source         : contentSource\n   };\n}\n\n/**\n * This file sits just behind the API which is used to attain a new\n * Oboe instance. It creates the new components that are required\n * and introduces them to each other.\n */\n\nfunction wire (httpMethodName, contentSource, body, headers, withCredentials){\n\n   var oboeBus = pubSub();\n   \n   // Wire the input stream in if we are given a content source.\n   // This will usually be the case. If not, the instance created\n   // will have to be passed content from an external source.\n  \n   if( contentSource ) {\n\n      streamingHttp( oboeBus,\n                     httpTransport(), \n                     httpMethodName,\n                     contentSource,\n                     body,\n                     headers,\n                     withCredentials\n      );\n   }\n\n   clarinet(oboeBus);\n\n   ascentManager(oboeBus, incrementalContentBuilder(oboeBus));\n      \n   patternAdapter(oboeBus, jsonPathCompiler);      \n      \n   return instanceApi(oboeBus, contentSource);\n}\n\nfunction applyDefaults( passthrough, url, httpMethodName, body, headers, withCredentials, cached ){\n\n   headers = headers ?\n      // Shallow-clone the headers array. This allows it to be\n      // modified without side effects to the caller. We don't\n      // want to change objects that the user passes in.\n      JSON.parse(JSON.stringify(headers))\n      : {};\n\n   if( body ) {\n      if( !isString(body) ) {\n\n         // If the body is not a string, stringify it. This allows objects to\n         // be given which will be sent as JSON.\n         body = JSON.stringify(body);\n\n         // Default Content-Type to JSON unless given otherwise.\n         headers['Content-Type'] = headers['Content-Type'] || 'application/json';\n      }\n   } else {\n      body = null;\n   }\n\n   // support cache busting like jQuery.ajax({cache:false})\n   function modifiedUrl(baseUrl, cached) {\n\n      if( cached === false ) {\n\n         if( baseUrl.indexOf('?') == -1 ) {\n            baseUrl += '?';\n         } else {\n            baseUrl += '&';\n         }\n\n         baseUrl += '_=' + new Date().getTime();\n      }\n      return baseUrl;\n   }\n\n   return passthrough( httpMethodName || 'GET', modifiedUrl(url, cached), body, headers, withCredentials || false );\n}\n\n// export public API\nfunction oboe(arg1) {\n\n   // We use duck-typing to detect if the parameter given is a stream, with the\n   // below list of parameters.\n   // Unpipe and unshift would normally be present on a stream but this breaks\n   // compatibility with Request streams.\n   // See https://github.com/jimhigson/oboe.js/issues/65\n   \n   var nodeStreamMethodNames = list('resume', 'pause', 'pipe'),\n       isStream = partialComplete(\n                     hasAllProperties\n                  ,  nodeStreamMethodNames\n                  );\n   \n   if( arg1 ) {\n      if (isStream(arg1) || isString(arg1)) {\n\n         //  simple version for GETs. Signature is:\n         //    oboe( url )\n         //  or, under node:\n         //    oboe( readableStream )\n         return applyDefaults(\n            wire,\n            arg1 // url\n         );\n\n      } else {\n\n         // method signature is:\n         //    oboe({method:m, url:u, body:b, headers:{...}})\n\n         return applyDefaults(\n            wire,\n            arg1.url,\n            arg1.method,\n            arg1.body,\n            arg1.headers,\n            arg1.withCredentials,\n            arg1.cached\n         );\n         \n      }\n   } else {\n      // wire up a no-AJAX, no-stream Oboe. Will have to have content \n      // fed in externally and using .emit.\n      return wire();\n   }\n}\n\n/* oboe.drop is a special value. If a node callback returns this value the\n   parsed node is deleted from the JSON\n */\noboe.drop = function() {\n   return oboe.drop;\n};\n\n\n   if ( true ) {\n      !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { return oboe; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n   } else if (typeof exports === 'object') {\n      module.exports = oboe;\n   } else {\n      window.oboe = oboe;\n   }\n})((function(){\n   // Access to the window object throws an exception in HTML5 web workers so\n   // point it to \"self\" if it runs in a web worker\n      try {\n         return window;\n      } catch (e) {\n         return self;\n      }\n   }()), Object, Array, Error, JSON);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/oboe/dist/oboe-browser.js\n// module id = 496\n// module chunks = 0\n\n//# sourceURL=../node_modules/oboe/dist/oboe-browser.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\nvar Reporter = __webpack_require__(152).Reporter;\nvar Buffer = __webpack_require__(0).Buffer;\n\nfunction DecoderBuffer(base, options) {\n  Reporter.call(this, options);\n  if (!Buffer.isBuffer(base)) {\n    this.error('Input not Buffer');\n    return;\n  }\n\n  this.base = base;\n  this.offset = 0;\n  this.length = base.length;\n}\ninherits(DecoderBuffer, Reporter);\nexports.DecoderBuffer = DecoderBuffer;\n\nDecoderBuffer.prototype.save = function save() {\n  return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\n};\n\nDecoderBuffer.prototype.restore = function restore(save) {\n  // Return skipped data\n  var res = new DecoderBuffer(this.base);\n  res.offset = save.offset;\n  res.length = this.offset;\n\n  this.offset = save.offset;\n  Reporter.prototype.restore.call(this, save.reporter);\n\n  return res;\n};\n\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\n  return this.offset === this.length;\n};\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\n  if (this.offset + 1 <= this.length)\n    return this.base.readUInt8(this.offset++, true);\n  else\n    return this.error(fail || 'DecoderBuffer overrun');\n}\n\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\n  if (!(this.offset + bytes <= this.length))\n    return this.error(fail || 'DecoderBuffer overrun');\n\n  var res = new DecoderBuffer(this.base);\n\n  // Share reporter state\n  res._reporterState = this._reporterState;\n\n  res.offset = this.offset;\n  res.length = this.offset + bytes;\n  this.offset += bytes;\n  return res;\n}\n\nDecoderBuffer.prototype.raw = function raw(save) {\n  return this.base.slice(save ? save.offset : this.offset, this.length);\n}\n\nfunction EncoderBuffer(value, reporter) {\n  if (Array.isArray(value)) {\n    this.length = 0;\n    this.value = value.map(function(item) {\n      if (!(item instanceof EncoderBuffer))\n        item = new EncoderBuffer(item, reporter);\n      this.length += item.length;\n      return item;\n    }, this);\n  } else if (typeof value === 'number') {\n    if (!(0 <= value && value <= 0xff))\n      return reporter.error('non-byte EncoderBuffer value');\n    this.value = value;\n    this.length = 1;\n  } else if (typeof value === 'string') {\n    this.value = value;\n    this.length = Buffer.byteLength(value);\n  } else if (Buffer.isBuffer(value)) {\n    this.value = value;\n    this.length = value.length;\n  } else {\n    return reporter.error('Unsupported type: ' + typeof value);\n  }\n}\nexports.EncoderBuffer = EncoderBuffer;\n\nEncoderBuffer.prototype.join = function join(out, offset) {\n  if (!out)\n    out = new Buffer(this.length);\n  if (!offset)\n    offset = 0;\n\n  if (this.length === 0)\n    return out;\n\n  if (Array.isArray(this.value)) {\n    this.value.forEach(function(item) {\n      item.join(out, offset);\n      offset += item.length;\n    });\n  } else {\n    if (typeof this.value === 'number')\n      out[offset] = this.value;\n    else if (typeof this.value === 'string')\n      out.write(this.value, offset);\n    else if (Buffer.isBuffer(this.value))\n      this.value.copy(out, offset);\n    offset += this.length;\n  }\n\n  return out;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/buffer.js\n// module id = 497\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/buffer.js")},function(module,exports,__webpack_require__){eval("var constants = exports;\n\n// Helper\nconstants._reverse = function reverse(map) {\n  var res = {};\n\n  Object.keys(map).forEach(function(key) {\n    // Convert key to integer if it is stringified\n    if ((key | 0) == key)\n      key = key | 0;\n\n    var value = map[key];\n    res[value] = key;\n  });\n\n  return res;\n};\n\nconstants.der = __webpack_require__(1144);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/constants/index.js\n// module id = 498\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/constants/index.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\n\nvar asn1 = __webpack_require__(151);\nvar base = asn1.base;\nvar bignum = asn1.bignum;\n\n// Import DER constants\nvar der = asn1.constants.der;\n\nfunction DERDecoder(entity) {\n  this.enc = 'der';\n  this.name = entity.name;\n  this.entity = entity;\n\n  // Construct base tree\n  this.tree = new DERNode();\n  this.tree._init(entity.body);\n};\nmodule.exports = DERDecoder;\n\nDERDecoder.prototype.decode = function decode(data, options) {\n  if (!(data instanceof base.DecoderBuffer))\n    data = new base.DecoderBuffer(data, options);\n\n  return this.tree._decode(data, options);\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n  base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\n  if (buffer.isEmpty())\n    return false;\n\n  var state = buffer.save();\n  var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: \"' + tag + '\"');\n  if (buffer.isError(decodedTag))\n    return decodedTag;\n\n  buffer.restore(state);\n\n  return decodedTag.tag === tag || decodedTag.tagStr === tag ||\n    (decodedTag.tagStr + 'of') === tag || any;\n};\n\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\n  var decodedTag = derDecodeTag(buffer,\n                                'Failed to decode tag of \"' + tag + '\"');\n  if (buffer.isError(decodedTag))\n    return decodedTag;\n\n  var len = derDecodeLen(buffer,\n                         decodedTag.primitive,\n                         'Failed to get length of \"' + tag + '\"');\n\n  // Failure\n  if (buffer.isError(len))\n    return len;\n\n  if (!any &&\n      decodedTag.tag !== tag &&\n      decodedTag.tagStr !== tag &&\n      decodedTag.tagStr + 'of' !== tag) {\n    return buffer.error('Failed to match tag: \"' + tag + '\"');\n  }\n\n  if (decodedTag.primitive || len !== null)\n    return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n\n  // Indefinite length... find END tag\n  var state = buffer.save();\n  var res = this._skipUntilEnd(\n      buffer,\n      'Failed to skip indefinite length body: \"' + this.tag + '\"');\n  if (buffer.isError(res))\n    return res;\n\n  len = buffer.offset - state.offset;\n  buffer.restore(state);\n  return buffer.skip(len, 'Failed to match body of: \"' + tag + '\"');\n};\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\n  while (true) {\n    var tag = derDecodeTag(buffer, fail);\n    if (buffer.isError(tag))\n      return tag;\n    var len = derDecodeLen(buffer, tag.primitive, fail);\n    if (buffer.isError(len))\n      return len;\n\n    var res;\n    if (tag.primitive || len !== null)\n      res = buffer.skip(len)\n    else\n      res = this._skipUntilEnd(buffer, fail);\n\n    // Failure\n    if (buffer.isError(res))\n      return res;\n\n    if (tag.tagStr === 'end')\n      break;\n  }\n};\n\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\n                                                    options) {\n  var result = [];\n  while (!buffer.isEmpty()) {\n    var possibleEnd = this._peekTag(buffer, 'end');\n    if (buffer.isError(possibleEnd))\n      return possibleEnd;\n\n    var res = decoder.decode(buffer, 'der', options);\n    if (buffer.isError(res) && possibleEnd)\n      break;\n    result.push(res);\n  }\n  return result;\n};\n\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\n  if (tag === 'bitstr') {\n    var unused = buffer.readUInt8();\n    if (buffer.isError(unused))\n      return unused;\n    return { unused: unused, data: buffer.raw() };\n  } else if (tag === 'bmpstr') {\n    var raw = buffer.raw();\n    if (raw.length % 2 === 1)\n      return buffer.error('Decoding of string type: bmpstr length mismatch');\n\n    var str = '';\n    for (var i = 0; i < raw.length / 2; i++) {\n      str += String.fromCharCode(raw.readUInt16BE(i * 2));\n    }\n    return str;\n  } else if (tag === 'numstr') {\n    var numstr = buffer.raw().toString('ascii');\n    if (!this._isNumstr(numstr)) {\n      return buffer.error('Decoding of string type: ' +\n                          'numstr unsupported characters');\n    }\n    return numstr;\n  } else if (tag === 'octstr') {\n    return buffer.raw();\n  } else if (tag === 'objDesc') {\n    return buffer.raw();\n  } else if (tag === 'printstr') {\n    var printstr = buffer.raw().toString('ascii');\n    if (!this._isPrintstr(printstr)) {\n      return buffer.error('Decoding of string type: ' +\n                          'printstr unsupported characters');\n    }\n    return printstr;\n  } else if (/str$/.test(tag)) {\n    return buffer.raw().toString();\n  } else {\n    return buffer.error('Decoding of string type: ' + tag + ' unsupported');\n  }\n};\n\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\n  var result;\n  var identifiers = [];\n  var ident = 0;\n  while (!buffer.isEmpty()) {\n    var subident = buffer.readUInt8();\n    ident <<= 7;\n    ident |= subident & 0x7f;\n    if ((subident & 0x80) === 0) {\n      identifiers.push(ident);\n      ident = 0;\n    }\n  }\n  if (subident & 0x80)\n    identifiers.push(ident);\n\n  var first = (identifiers[0] / 40) | 0;\n  var second = identifiers[0] % 40;\n\n  if (relative)\n    result = identifiers;\n  else\n    result = [first, second].concat(identifiers.slice(1));\n\n  if (values) {\n    var tmp = values[result.join(' ')];\n    if (tmp === undefined)\n      tmp = values[result.join('.')];\n    if (tmp !== undefined)\n      result = tmp;\n  }\n\n  return result;\n};\n\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\n  var str = buffer.raw().toString();\n  if (tag === 'gentime') {\n    var year = str.slice(0, 4) | 0;\n    var mon = str.slice(4, 6) | 0;\n    var day = str.slice(6, 8) | 0;\n    var hour = str.slice(8, 10) | 0;\n    var min = str.slice(10, 12) | 0;\n    var sec = str.slice(12, 14) | 0;\n  } else if (tag === 'utctime') {\n    var year = str.slice(0, 2) | 0;\n    var mon = str.slice(2, 4) | 0;\n    var day = str.slice(4, 6) | 0;\n    var hour = str.slice(6, 8) | 0;\n    var min = str.slice(8, 10) | 0;\n    var sec = str.slice(10, 12) | 0;\n    if (year < 70)\n      year = 2000 + year;\n    else\n      year = 1900 + year;\n  } else {\n    return buffer.error('Decoding ' + tag + ' time is not supported yet');\n  }\n\n  return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\n};\n\nDERNode.prototype._decodeNull = function decodeNull(buffer) {\n  return null;\n};\n\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\n  var res = buffer.readUInt8();\n  if (buffer.isError(res))\n    return res;\n  else\n    return res !== 0;\n};\n\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\n  // Bigint, return as it is (assume big endian)\n  var raw = buffer.raw();\n  var res = new bignum(raw);\n\n  if (values)\n    res = values[res.toString(10)] || res;\n\n  return res;\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n  if (typeof entity === 'function')\n    entity = entity(obj);\n  return entity._getDecoder('der').tree;\n};\n\n// Utility methods\n\nfunction derDecodeTag(buf, fail) {\n  var tag = buf.readUInt8(fail);\n  if (buf.isError(tag))\n    return tag;\n\n  var cls = der.tagClass[tag >> 6];\n  var primitive = (tag & 0x20) === 0;\n\n  // Multi-octet tag - load\n  if ((tag & 0x1f) === 0x1f) {\n    var oct = tag;\n    tag = 0;\n    while ((oct & 0x80) === 0x80) {\n      oct = buf.readUInt8(fail);\n      if (buf.isError(oct))\n        return oct;\n\n      tag <<= 7;\n      tag |= oct & 0x7f;\n    }\n  } else {\n    tag &= 0x1f;\n  }\n  var tagStr = der.tag[tag];\n\n  return {\n    cls: cls,\n    primitive: primitive,\n    tag: tag,\n    tagStr: tagStr\n  };\n}\n\nfunction derDecodeLen(buf, primitive, fail) {\n  var len = buf.readUInt8(fail);\n  if (buf.isError(len))\n    return len;\n\n  // Indefinite form\n  if (!primitive && len === 0x80)\n    return null;\n\n  // Definite form\n  if ((len & 0x80) === 0) {\n    // Short form\n    return len;\n  }\n\n  // Long form\n  var num = len & 0x7f;\n  if (num > 4)\n    return buf.error('length octect is too long');\n\n  len = 0;\n  for (var i = 0; i < num; i++) {\n    len <<= 8;\n    var j = buf.readUInt8(fail);\n    if (buf.isError(j))\n      return j;\n    len |= j;\n  }\n\n  return len;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/der.js\n// module id = 499\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/der.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\nvar Buffer = __webpack_require__(0).Buffer;\n\nvar asn1 = __webpack_require__(151);\nvar base = asn1.base;\n\n// Import DER constants\nvar der = asn1.constants.der;\n\nfunction DEREncoder(entity) {\n  this.enc = 'der';\n  this.name = entity.name;\n  this.entity = entity;\n\n  // Construct base tree\n  this.tree = new DERNode();\n  this.tree._init(entity.body);\n};\nmodule.exports = DEREncoder;\n\nDEREncoder.prototype.encode = function encode(data, reporter) {\n  return this.tree._encode(data, reporter).join();\n};\n\n// Tree methods\n\nfunction DERNode(parent) {\n  base.Node.call(this, 'der', parent);\n}\ninherits(DERNode, base.Node);\n\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\n                                                              primitive,\n                                                              cls,\n                                                              content) {\n  var encodedTag = encodeTag(tag, primitive, cls, this.reporter);\n\n  // Short form\n  if (content.length < 0x80) {\n    var header = new Buffer(2);\n    header[0] = encodedTag;\n    header[1] = content.length;\n    return this._createEncoderBuffer([ header, content ]);\n  }\n\n  // Long form\n  // Count octets required to store length\n  var lenOctets = 1;\n  for (var i = content.length; i >= 0x100; i >>= 8)\n    lenOctets++;\n\n  var header = new Buffer(1 + 1 + lenOctets);\n  header[0] = encodedTag;\n  header[1] = 0x80 | lenOctets;\n\n  for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\n    header[i] = j & 0xff;\n\n  return this._createEncoderBuffer([ header, content ]);\n};\n\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\n  if (tag === 'bitstr') {\n    return this._createEncoderBuffer([ str.unused | 0, str.data ]);\n  } else if (tag === 'bmpstr') {\n    var buf = new Buffer(str.length * 2);\n    for (var i = 0; i < str.length; i++) {\n      buf.writeUInt16BE(str.charCodeAt(i), i * 2);\n    }\n    return this._createEncoderBuffer(buf);\n  } else if (tag === 'numstr') {\n    if (!this._isNumstr(str)) {\n      return this.reporter.error('Encoding of string type: numstr supports ' +\n                                 'only digits and space');\n    }\n    return this._createEncoderBuffer(str);\n  } else if (tag === 'printstr') {\n    if (!this._isPrintstr(str)) {\n      return this.reporter.error('Encoding of string type: printstr supports ' +\n                                 'only latin upper and lower case letters, ' +\n                                 'digits, space, apostrophe, left and rigth ' +\n                                 'parenthesis, plus sign, comma, hyphen, ' +\n                                 'dot, slash, colon, equal sign, ' +\n                                 'question mark');\n    }\n    return this._createEncoderBuffer(str);\n  } else if (/str$/.test(tag)) {\n    return this._createEncoderBuffer(str);\n  } else if (tag === 'objDesc') {\n    return this._createEncoderBuffer(str);\n  } else {\n    return this.reporter.error('Encoding of string type: ' + tag +\n                               ' unsupported');\n  }\n};\n\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\n  if (typeof id === 'string') {\n    if (!values)\n      return this.reporter.error('string objid given, but no values map found');\n    if (!values.hasOwnProperty(id))\n      return this.reporter.error('objid not found in values map');\n    id = values[id].split(/[\\s\\.]+/g);\n    for (var i = 0; i < id.length; i++)\n      id[i] |= 0;\n  } else if (Array.isArray(id)) {\n    id = id.slice();\n    for (var i = 0; i < id.length; i++)\n      id[i] |= 0;\n  }\n\n  if (!Array.isArray(id)) {\n    return this.reporter.error('objid() should be either array or string, ' +\n                               'got: ' + JSON.stringify(id));\n  }\n\n  if (!relative) {\n    if (id[1] >= 40)\n      return this.reporter.error('Second objid identifier OOB');\n    id.splice(0, 2, id[0] * 40 + id[1]);\n  }\n\n  // Count number of octets\n  var size = 0;\n  for (var i = 0; i < id.length; i++) {\n    var ident = id[i];\n    for (size++; ident >= 0x80; ident >>= 7)\n      size++;\n  }\n\n  var objid = new Buffer(size);\n  var offset = objid.length - 1;\n  for (var i = id.length - 1; i >= 0; i--) {\n    var ident = id[i];\n    objid[offset--] = ident & 0x7f;\n    while ((ident >>= 7) > 0)\n      objid[offset--] = 0x80 | (ident & 0x7f);\n  }\n\n  return this._createEncoderBuffer(objid);\n};\n\nfunction two(num) {\n  if (num < 10)\n    return '0' + num;\n  else\n    return num;\n}\n\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\n  var str;\n  var date = new Date(time);\n\n  if (tag === 'gentime') {\n    str = [\n      two(date.getFullYear()),\n      two(date.getUTCMonth() + 1),\n      two(date.getUTCDate()),\n      two(date.getUTCHours()),\n      two(date.getUTCMinutes()),\n      two(date.getUTCSeconds()),\n      'Z'\n    ].join('');\n  } else if (tag === 'utctime') {\n    str = [\n      two(date.getFullYear() % 100),\n      two(date.getUTCMonth() + 1),\n      two(date.getUTCDate()),\n      two(date.getUTCHours()),\n      two(date.getUTCMinutes()),\n      two(date.getUTCSeconds()),\n      'Z'\n    ].join('');\n  } else {\n    this.reporter.error('Encoding ' + tag + ' time is not supported yet');\n  }\n\n  return this._encodeStr(str, 'octstr');\n};\n\nDERNode.prototype._encodeNull = function encodeNull() {\n  return this._createEncoderBuffer('');\n};\n\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\n  if (typeof num === 'string') {\n    if (!values)\n      return this.reporter.error('String int or enum given, but no values map');\n    if (!values.hasOwnProperty(num)) {\n      return this.reporter.error('Values map doesn\\'t contain: ' +\n                                 JSON.stringify(num));\n    }\n    num = values[num];\n  }\n\n  // Bignum, assume big endian\n  if (typeof num !== 'number' && !Buffer.isBuffer(num)) {\n    var numArray = num.toArray();\n    if (!num.sign && numArray[0] & 0x80) {\n      numArray.unshift(0);\n    }\n    num = new Buffer(numArray);\n  }\n\n  if (Buffer.isBuffer(num)) {\n    var size = num.length;\n    if (num.length === 0)\n      size++;\n\n    var out = new Buffer(size);\n    num.copy(out);\n    if (num.length === 0)\n      out[0] = 0\n    return this._createEncoderBuffer(out);\n  }\n\n  if (num < 0x80)\n    return this._createEncoderBuffer(num);\n\n  if (num < 0x100)\n    return this._createEncoderBuffer([0, num]);\n\n  var size = 1;\n  for (var i = num; i >= 0x100; i >>= 8)\n    size++;\n\n  var out = new Array(size);\n  for (var i = out.length - 1; i >= 0; i--) {\n    out[i] = num & 0xff;\n    num >>= 8;\n  }\n  if(out[0] & 0x80) {\n    out.unshift(0);\n  }\n\n  return this._createEncoderBuffer(new Buffer(out));\n};\n\nDERNode.prototype._encodeBool = function encodeBool(value) {\n  return this._createEncoderBuffer(value ? 0xff : 0);\n};\n\nDERNode.prototype._use = function use(entity, obj) {\n  if (typeof entity === 'function')\n    entity = entity(obj);\n  return entity._getEncoder('der').tree;\n};\n\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\n  var state = this._baseState;\n  var i;\n  if (state['default'] === null)\n    return false;\n\n  var data = dataBuffer.join();\n  if (state.defaultBuffer === undefined)\n    state.defaultBuffer = this._encodeValue(state['default'], reporter, parent).join();\n\n  if (data.length !== state.defaultBuffer.length)\n    return false;\n\n  for (i=0; i < data.length; i++)\n    if (data[i] !== state.defaultBuffer[i])\n      return false;\n\n  return true;\n};\n\n// Utility methods\n\nfunction encodeTag(tag, primitive, cls, reporter) {\n  var res;\n\n  if (tag === 'seqof')\n    tag = 'seq';\n  else if (tag === 'setof')\n    tag = 'set';\n\n  if (der.tagByName.hasOwnProperty(tag))\n    res = der.tagByName[tag];\n  else if (typeof tag === 'number' && (tag | 0) === tag)\n    res = tag;\n  else\n    return reporter.error('Unknown tag: ' + tag);\n\n  if (res >= 0x1f)\n    return reporter.error('Multi-octet tag encoding unsupported');\n\n  if (!primitive)\n    res |= 0x20;\n\n  res |= (der.tagClassByName[cls || 'universal'] << 6);\n\n  return res;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/der.js\n// module id = 500\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/der.js")},function(module,exports){eval("/**\r\n * Parses an URI\r\n *\r\n * @author Steven Levithan <stevenlevithan.com> (MIT license)\r\n * @api private\r\n */\r\n\r\nvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\r\n\r\nvar parts = [\r\n    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\r\n];\r\n\r\nmodule.exports = function parseuri(str) {\r\n    var src = str,\r\n        b = str.indexOf('['),\r\n        e = str.indexOf(']');\r\n\r\n    if (b != -1 && e != -1) {\r\n        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\r\n    }\r\n\r\n    var m = re.exec(str || ''),\r\n        uri = {},\r\n        i = 14;\r\n\r\n    while (i--) {\r\n        uri[parts[i]] = m[i] || '';\r\n    }\r\n\r\n    if (b != -1 && e != -1) {\r\n        uri.source = src;\r\n        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\r\n        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\r\n        uri.ipv6uri = true;\r\n    }\r\n\r\n    return uri;\r\n};\r\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parseuri/index.js\n// module id = 501\n// module chunks = 0\n\n//# sourceURL=../node_modules/parseuri/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding\n/* istanbul ignore next */\nif (process.browser) {\n  defaultEncoding = 'utf-8'\n} else {\n  var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)\n\n  defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'\n}\nmodule.exports = defaultEncoding\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pbkdf2/lib/default-encoding.js\n// module id = 502\n// module chunks = 0\n\n//# sourceURL=../node_modules/pbkdf2/lib/default-encoding.js")},function(module,exports){eval("var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\nmodule.exports = function (iterations, keylen) {\n  if (typeof iterations !== 'number') {\n    throw new TypeError('Iterations not a number')\n  }\n\n  if (iterations < 0) {\n    throw new TypeError('Bad iterations')\n  }\n\n  if (typeof keylen !== 'number') {\n    throw new TypeError('Key length not a number')\n  }\n\n  if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\n    throw new TypeError('Bad key length')\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pbkdf2/lib/precondition.js\n// module id = 503\n// module chunks = 0\n\n//# sourceURL=../node_modules/pbkdf2/lib/precondition.js")},function(module,exports,__webpack_require__){eval("var md5 = __webpack_require__(254)\nvar rmd160 = __webpack_require__(306)\nvar sha = __webpack_require__(308)\n\nvar checkParameters = __webpack_require__(503)\nvar defaultEncoding = __webpack_require__(502)\nvar Buffer = __webpack_require__(1).Buffer\nvar ZEROS = Buffer.alloc(128)\nvar sizes = {\n  md5: 16,\n  sha1: 20,\n  sha224: 28,\n  sha256: 32,\n  sha384: 48,\n  sha512: 64,\n  rmd160: 20,\n  ripemd160: 20\n}\n\nfunction Hmac (alg, key, saltLen) {\n  var hash = getDigest(alg)\n  var blocksize = (alg === 'sha512' || alg === 'sha384') ? 128 : 64\n\n  if (key.length > blocksize) {\n    key = hash(key)\n  } else if (key.length < blocksize) {\n    key = Buffer.concat([key, ZEROS], blocksize)\n  }\n\n  var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])\n  var opad = Buffer.allocUnsafe(blocksize + sizes[alg])\n  for (var i = 0; i < blocksize; i++) {\n    ipad[i] = key[i] ^ 0x36\n    opad[i] = key[i] ^ 0x5C\n  }\n\n  var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)\n  ipad.copy(ipad1, 0, 0, blocksize)\n  this.ipad1 = ipad1\n  this.ipad2 = ipad\n  this.opad = opad\n  this.alg = alg\n  this.blocksize = blocksize\n  this.hash = hash\n  this.size = sizes[alg]\n}\n\nHmac.prototype.run = function (data, ipad) {\n  data.copy(ipad, this.blocksize)\n  var h = this.hash(ipad)\n  h.copy(this.opad, this.blocksize)\n  return this.hash(this.opad)\n}\n\nfunction getDigest (alg) {\n  function shaFunc (data) {\n    return sha(alg).update(data).digest()\n  }\n\n  if (alg === 'rmd160' || alg === 'ripemd160') return rmd160\n  if (alg === 'md5') return md5\n  return shaFunc\n}\n\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\n  if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\n\n  checkParameters(iterations, keylen)\n\n  digest = digest || 'sha1'\n\n  var hmac = new Hmac(digest, password, salt.length)\n\n  var DK = Buffer.allocUnsafe(keylen)\n  var block1 = Buffer.allocUnsafe(salt.length + 4)\n  salt.copy(block1, 0, 0, salt.length)\n\n  var destPos = 0\n  var hLen = sizes[digest]\n  var l = Math.ceil(keylen / hLen)\n\n  for (var i = 1; i <= l; i++) {\n    block1.writeUInt32BE(i, salt.length)\n\n    var T = hmac.run(block1, hmac.ipad1)\n    var U = T\n\n    for (var j = 1; j < iterations; j++) {\n      U = hmac.run(U, hmac.ipad2)\n      for (var k = 0; k < hLen; k++) T[k] ^= U[k]\n    }\n\n    T.copy(DK, destPos)\n    destPos += hLen\n  }\n\n  return DK\n}\n\nmodule.exports = pbkdf2\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pbkdf2/lib/sync-browser.js\n// module id = 504\n// module chunks = 0\n\n//# sourceURL=../node_modules/pbkdf2/lib/sync-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst bs58 = __webpack_require__(76)\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\n\nfunction getB58Str (peer) {\n  let b58Str\n\n  if (typeof peer === 'string') {\n    b58Str = peer\n  } else if (Buffer.isBuffer(peer)) {\n    b58Str = bs58.encode(peer).toString()\n  } else if (PeerId.isPeerId(peer)) {\n    b58Str = peer.toB58String()\n  } else if (PeerInfo.isPeerInfo(peer)) {\n    b58Str = peer.id.toB58String()\n  } else {\n    throw new Error('not valid PeerId or PeerInfo, or B58Str')\n  }\n\n  return b58Str\n}\n\nclass PeerBook {\n  constructor () {\n    this._peers = {}\n  }\n\n  // checks if peer exists\n  // peer can be PeerId, b58String or PeerInfo\n  has (peer) {\n    const b58Str = getB58Str(peer)\n    return Boolean(this._peers[b58Str])\n  }\n\n  /**\n   * Stores a peerInfo, if already exist, merges the new into the old.\n   *\n   * @param {PeerInfo} peerInfo\n   * @param {Boolean} replace\n   * @returns {PeerInfo}\n   */\n  put (peerInfo, replace) {\n    const localPeerInfo = this._peers[peerInfo.id.toB58String()]\n\n    // insert if doesn't exist or replace if replace flag is true\n    if (!localPeerInfo || replace) {\n      this._peers[peerInfo.id.toB58String()] = peerInfo\n      return peerInfo\n    }\n\n    // peerInfo.replace merges by default if none to replace are passed\n    peerInfo.multiaddrs.forEach((ma) => localPeerInfo.multiaddrs.add(ma))\n\n    // pass active connection state\n    const ma = peerInfo.isConnected()\n    if (ma) {\n      localPeerInfo.connect(ma)\n    }\n\n    // pass known protocols\n    peerInfo.protocols.forEach((p) => localPeerInfo.protocols.add(p))\n\n    if (!localPeerInfo.id.privKey && peerInfo.id.privKey) {\n      localPeerInfo.id.privKey = peerInfo.id.privKey\n    }\n\n    if (!localPeerInfo.id.pubKey && peerInfo.id.pubKey) {\n      localPeerInfo.id.pubKey = peerInfo.id.pubKey\n    }\n\n    return localPeerInfo\n  }\n\n  /**\n   * Get the info to the given PeerId, PeerInfo or b58Str id\n   *\n   * @param {PeerId} peer\n   * @returns {PeerInfo}\n   */\n  get (peer) {\n    const b58Str = getB58Str(peer)\n\n    const peerInfo = this._peers[b58Str]\n\n    if (peerInfo) {\n      return peerInfo\n    }\n    throw new Error('PeerInfo not found')\n  }\n\n  getAll () {\n    return this._peers\n  }\n\n  getAllArray () {\n    return Object.keys(this._peers).map((b58Str) => this._peers[b58Str])\n  }\n\n  getMultiaddrs (peer) {\n    const info = this.get(peer)\n    return info.multiaddrs.toArray()\n  }\n\n  remove (peer) {\n    const b58Str = getB58Str(peer)\n\n    if (this._peers[b58Str]) {\n      delete this._peers[b58Str]\n    }\n  }\n}\n\nmodule.exports = PeerBook\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/peer-book/src/index.js\n// module id = 505\n// module chunks = 0\n\n//# sourceURL=../node_modules/peer-book/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multiaddr = __webpack_require__(21)\n\nfunction ensureMultiaddr (ma) {\n  if (multiaddr.isMultiaddr(ma)) {\n    return ma\n  }\n\n  return multiaddr(ma)\n}\n\nmodule.exports = {\n  ensureMultiaddr: ensureMultiaddr\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/peer-info/src/utils.js\n// module id = 506\n// module chunks = 0\n\n//# sourceURL=../node_modules/peer-info/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar asap = __webpack_require__(579);\n\nfunction noop() {}\n\n// States:\n//\n// 0 - pending\n// 1 - fulfilled with _value\n// 2 - rejected with _value\n// 3 - adopted the state of another promise, _value\n//\n// once the state is no longer pending (0) it is immutable\n\n// All `_` prefixed properties will be reduced to `_{random number}`\n// at build time to obfuscate them and discourage their use.\n// We don't use symbols or Object.defineProperty to fully hide them\n// because the performance isn't good enough.\n\n\n// to avoid using try/catch inside critical functions, we\n// extract them to here.\nvar LAST_ERROR = null;\nvar IS_ERROR = {};\nfunction getThen(obj) {\n  try {\n    return obj.then;\n  } catch (ex) {\n    LAST_ERROR = ex;\n    return IS_ERROR;\n  }\n}\n\nfunction tryCallOne(fn, a) {\n  try {\n    return fn(a);\n  } catch (ex) {\n    LAST_ERROR = ex;\n    return IS_ERROR;\n  }\n}\nfunction tryCallTwo(fn, a, b) {\n  try {\n    fn(a, b);\n  } catch (ex) {\n    LAST_ERROR = ex;\n    return IS_ERROR;\n  }\n}\n\nmodule.exports = Promise;\n\nfunction Promise(fn) {\n  if (typeof this !== 'object') {\n    throw new TypeError('Promises must be constructed via new');\n  }\n  if (typeof fn !== 'function') {\n    throw new TypeError('not a function');\n  }\n  this._45 = 0;\n  this._81 = 0;\n  this._65 = null;\n  this._54 = null;\n  if (fn === noop) return;\n  doResolve(fn, this);\n}\nPromise._10 = null;\nPromise._97 = null;\nPromise._61 = noop;\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n  if (this.constructor !== Promise) {\n    return safeThen(this, onFulfilled, onRejected);\n  }\n  var res = new Promise(noop);\n  handle(this, new Handler(onFulfilled, onRejected, res));\n  return res;\n};\n\nfunction safeThen(self, onFulfilled, onRejected) {\n  return new self.constructor(function (resolve, reject) {\n    var res = new Promise(noop);\n    res.then(resolve, reject);\n    handle(self, new Handler(onFulfilled, onRejected, res));\n  });\n};\nfunction handle(self, deferred) {\n  while (self._81 === 3) {\n    self = self._65;\n  }\n  if (Promise._10) {\n    Promise._10(self);\n  }\n  if (self._81 === 0) {\n    if (self._45 === 0) {\n      self._45 = 1;\n      self._54 = deferred;\n      return;\n    }\n    if (self._45 === 1) {\n      self._45 = 2;\n      self._54 = [self._54, deferred];\n      return;\n    }\n    self._54.push(deferred);\n    return;\n  }\n  handleResolved(self, deferred);\n}\n\nfunction handleResolved(self, deferred) {\n  asap(function() {\n    var cb = self._81 === 1 ? deferred.onFulfilled : deferred.onRejected;\n    if (cb === null) {\n      if (self._81 === 1) {\n        resolve(deferred.promise, self._65);\n      } else {\n        reject(deferred.promise, self._65);\n      }\n      return;\n    }\n    var ret = tryCallOne(cb, self._65);\n    if (ret === IS_ERROR) {\n      reject(deferred.promise, LAST_ERROR);\n    } else {\n      resolve(deferred.promise, ret);\n    }\n  });\n}\nfunction resolve(self, newValue) {\n  // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n  if (newValue === self) {\n    return reject(\n      self,\n      new TypeError('A promise cannot be resolved with itself.')\n    );\n  }\n  if (\n    newValue &&\n    (typeof newValue === 'object' || typeof newValue === 'function')\n  ) {\n    var then = getThen(newValue);\n    if (then === IS_ERROR) {\n      return reject(self, LAST_ERROR);\n    }\n    if (\n      then === self.then &&\n      newValue instanceof Promise\n    ) {\n      self._81 = 3;\n      self._65 = newValue;\n      finale(self);\n      return;\n    } else if (typeof then === 'function') {\n      doResolve(then.bind(newValue), self);\n      return;\n    }\n  }\n  self._81 = 1;\n  self._65 = newValue;\n  finale(self);\n}\n\nfunction reject(self, newValue) {\n  self._81 = 2;\n  self._65 = newValue;\n  if (Promise._97) {\n    Promise._97(self, newValue);\n  }\n  finale(self);\n}\nfunction finale(self) {\n  if (self._45 === 1) {\n    handle(self, self._54);\n    self._54 = null;\n  }\n  if (self._45 === 2) {\n    for (var i = 0; i < self._54.length; i++) {\n      handle(self, self._54[i]);\n    }\n    self._54 = null;\n  }\n}\n\nfunction Handler(onFulfilled, onRejected, promise){\n  this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n  this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n  this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, promise) {\n  var done = false;\n  var res = tryCallTwo(fn, function (value) {\n    if (done) return;\n    done = true;\n    resolve(promise, value);\n  }, function (reason) {\n    if (done) return;\n    done = true;\n    reject(promise, reason);\n  })\n  if (!done && res === IS_ERROR) {\n    done = true;\n    reject(promise, LAST_ERROR);\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/promise/lib/core.js\n// module id = 507\n// module chunks = 0\n\n//# sourceURL=../node_modules/promise/lib/core.js")},function(module,exports){eval("/*!\n  * prr\n  * (c) 2013 Rod Vagg <rod@vagg.org>\n  * https://github.com/rvagg/prr\n  * License: MIT\n  */\n\n(function (name, context, definition) {\n  if (typeof module != 'undefined' && module.exports)\n    module.exports = definition()\n  else\n    context[name] = definition()\n})('prr', this, function() {\n\n  var setProperty = typeof Object.defineProperty == 'function'\n      ? function (obj, key, options) {\n          Object.defineProperty(obj, key, options)\n          return obj\n        }\n      : function (obj, key, options) { // < es5\n          obj[key] = options.value\n          return obj\n        }\n\n    , makeOptions = function (value, options) {\n        var oo = typeof options == 'object'\n          , os = !oo && typeof options == 'string'\n          , op = function (p) {\n              return oo\n                ? !!options[p]\n                : os\n                  ? options.indexOf(p[0]) > -1\n                  : false\n            }\n\n        return {\n            enumerable   : op('enumerable')\n          , configurable : op('configurable')\n          , writable     : op('writable')\n          , value        : value\n        }\n      }\n\n    , prr = function (obj, key, value, options) {\n        var k\n\n        options = makeOptions(value, options)\n\n        if (typeof key == 'object') {\n          for (k in key) {\n            if (Object.hasOwnProperty.call(key, k)) {\n              options.value = key[k]\n              setProperty(obj, k, options)\n            }\n          }\n          return obj\n        }\n\n        return setProperty(obj, key, options)\n      }\n\n  return prr\n})\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prr/prr.js\n// module id = 508\n// module chunks = 0\n\n//# sourceURL=../node_modules/prr/prr.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(59);\nmodule.exports = function (seed, len) {\n  var t = new Buffer('');\n  var  i = 0, c;\n  while (t.length < len) {\n    c = i2ops(i++);\n    t = Buffer.concat([t, createHash('sha1').update(seed).update(c).digest()]);\n  }\n  return t.slice(0, len);\n};\n\nfunction i2ops(c) {\n  var out = new Buffer(4);\n  out.writeUInt32BE(c,0);\n  return out;\n}\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/mgf.js\n// module id = 509\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/mgf.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(17);\nfunction withPublic(paddedMsg, key) {\n  return new Buffer(paddedMsg\n    .toRed(bn.mont(key.modulus))\n    .redPow(new bn(key.publicExponent))\n    .fromRed()\n    .toArray());\n}\n\nmodule.exports = withPublic;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/withPublic.js\n// module id = 510\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/withPublic.js")},function(module,exports){eval("module.exports = function xor(a, b) {\n  var len = a.length;\n  var i = -1;\n  while (++i < len) {\n    a[i] ^= b[i];\n  }\n  return a\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/xor.js\n// module id = 511\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/xor.js")},function(module,exports,__webpack_require__){eval("\nvar Source = __webpack_require__(204)\nvar Sink = __webpack_require__(513)\n\nmodule.exports = function () {\n\n  var source = Source()\n  var sink = Sink()\n\n  return {\n    source: source,\n    sink: sink,\n    resolve: function (duplex) {\n      source.resolve(duplex.source)\n      sink.resolve(duplex.sink)\n\n    }\n  }\n\n\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-defer/duplex.js\n// module id = 512\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-defer/duplex.js")},function(module,exports){eval("module.exports = function (stream) {\n  var read, started = false, id = Math.random()\n\n  function consume (_read) {\n    if(!_read) throw new Error('must be passed a readable')\n    read = _read\n    if(started) stream(read)\n  }\n\n  consume.resolve =\n  consume.ready =\n  consume.start = function (_stream) {\n    started = true; stream = _stream || stream\n    if(read) stream(read)\n    return consume\n  }\n\n  return consume\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-defer/sink.js\n// module id = 513\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-defer/sink.js")},function(module,exports,__webpack_require__){eval("var looper = __webpack_require__(1173)\nmodule.exports = function (map, width, inOrder) {\n  inOrder = inOrder === undefined ? true : inOrder\n  var reading = false, abort\n  return function (read) {\n    var i = 0, j = 0, last = 0\n    var seen = [], started = false, ended = false, _cb, error\n\n    function drain () {\n      if(_cb) {\n        var cb = _cb\n        if(error) {\n          _cb = null\n          return cb(error)\n        }\n        if(Object.hasOwnProperty.call(seen, j)) {\n          _cb = null\n          var data = seen[j]; delete seen[j]; j++\n          cb(null, data)\n          if(width) start()\n        } else if(j >= last && ended) {\n          _cb = null\n          cb(ended)\n        }\n      }\n    }\n\n    var start = looper(function () {\n      started = true\n      if(ended) return drain()\n      if(reading || width && (i - width >= j)) return\n      reading = true\n      read(abort, function (end, data) {\n        reading = false\n        if(end) {\n          last = i; ended = end\n          drain()\n        } else {\n          var k = i++\n\n          map(data, function (err, data) {\n            if (inOrder) seen[k] = data\n            else seen.push(data)\n            if(err) error = err\n            drain()\n          })\n\n          if(!ended)\n            start()\n\n        }\n      })\n    })\n\n    return function (_abort, cb) {\n      if(_abort)\n        read(ended = abort = _abort, function (err) {\n          if(cb) return cb(err)\n        })\n      else {\n        _cb = cb\n        if(!started) start()\n        drain()\n      }\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-paramap/index.js\n// module id = 514\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-paramap/index.js")},function(module,exports){eval("\n\nmodule.exports = function (onPause) {\n\n  var wait, read, paused\n\n  function reader (_read) {\n    read = _read\n    return function (abort, cb) {\n      if(!paused) read(abort, cb)\n      else        wait = [abort, cb]\n    }\n  }\n\n  reader.pause = function () {\n    if(paused) return\n    paused = true\n    onPause && onPause(paused)\n  }\n\n  reader.resume = function () {\n    if(!paused) return\n    paused = false\n    onPause && onPause(paused)\n    if(wait) {\n      var _wait = wait\n      wait = null\n      read(_wait[0], _wait[1])\n    }\n  }\n\n  return reader\n\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-pause/index.js\n// module id = 515\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-pause/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar State = __webpack_require__(1174)\n\nfunction isInteger (i) {\n  return Number.isFinite(i)\n}\n\nfunction isFunction (f) {\n  return 'function' === typeof f\n}\n\nfunction maxDelay(fn, delay) {\n  if(!delay) return fn\n  return function (a, cb) {\n    var timer = setTimeout(function () {\n      fn(new Error('pull-reader: read exceeded timeout'), cb)\n    }, delay)\n    fn(a, function (err, value) {\n      clearTimeout(timer)\n      cb(err, value)\n    })\n\n  }\n\n}\n\nmodule.exports = function (timeout) {\n\n  var queue = [], read, readTimed, reading = false\n  var state = State(), ended, streaming, abort\n\n  function drain () {\n    while (queue.length) {\n      if(null == queue[0].length && state.has(1)) {\n        queue.shift().cb(null, state.get())\n      }\n      else if(state.has(queue[0].length)) {\n        var next = queue.shift()\n        next.cb(null, state.get(next.length))\n      }\n      else if(ended)\n        queue.shift().cb(ended)\n      else\n        return !!queue.length\n    }\n    //always read a little data\n    return queue.length || !state.has(1) || abort\n  }\n\n  function more () {\n    var d = drain()\n    if(d && !reading)\n    if(read && !reading && !streaming) {\n      reading = true\n      readTimed (null, function (err, data) {\n        reading = false\n        if(err) {\n          ended = err\n          return drain()\n        }\n        state.add(data)\n        more()\n      })\n    }\n  }\n\n  function reader (_read) {\n    if(abort) {\n      while(queue.length) queue.shift().cb(abort)\n      return cb && cb(abort)\n    }\n    readTimed = maxDelay(_read, timeout)\n    read = _read\n    more()\n  }\n\n  reader.abort = function (err, cb) {\n    abort = err || true\n    if(read) {\n      reading = true\n      read(abort, function () {\n        while(queue.length) queue.shift().cb(abort)\n        cb && cb(abort)\n      })\n    }\n    else\n      cb()\n  }\n\n  reader.read = function (len, _timeout, cb) {\n    if(isFunction(_timeout))\n      cb = _timeout, _timeout = timeout\n    if(isFunction(cb)) {\n      queue.push({length: isInteger(len) ? len : null, cb: cb})\n      more()\n    }\n    else {\n      //switch into streaming mode for the rest of the stream.\n      streaming = true\n      //wait for the current read to complete\n      return function (abort, cb) {\n        //if there is anything still in the queue,\n        if(reading || state.has(1)) {\n          if(abort) return read(abort, cb)\n          queue.push({length: null, cb: cb})\n          more()\n        }\n        else\n          maxDelay(read, _timeout)(abort, function (err, data) {\n            cb(err, data)\n          })\n      }\n    }\n  }\n\n  return reader\n}\n\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-reader/index.js\n// module id = 516\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-reader/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(setImmediate, process) {\nvar Stream = __webpack_require__(46)\n\nmodule.exports = duplex\n\n\nmodule.exports.source = function (source) {\n  return duplex(null, source)\n}\n\nmodule.exports.sink = function (sink) {\n  return duplex(sink, null)\n}\n\nvar next = (\n  'undefined' === typeof setImmediate\n  ? process.nextTick\n  : setImmediate\n)\n\nfunction duplex (reader, read) {\n  if(reader && 'object' === typeof reader) {\n    read = reader.source\n    reader = reader.sink\n  }\n\n  var cbs = [], input = [], ended, needDrain\n  var s = new Stream()\n  s.writable = s.readable = true\n  s.write = function (data) {\n    if(cbs.length)\n      cbs.shift()(null, data)\n    else\n      input.push(data)\n\n    if (!cbs.length) {\n      needDrain = true\n    }\n    return !!cbs.length\n  }\n\n  s.end = function () {\n    if(read) {\n      if (input.length)\n        drain()\n      else\n        read(ended = true, cbs.length ? cbs.shift() : function () {})\n    } else if(cbs.length) {\n      cbs.shift()(true)\n    }\n  }\n\n  s.source = function (end, cb) {\n    if(input.length) {\n      cb(null, input.shift())\n      if(!input.length)\n        s.emit('drain')\n    }\n    else {\n      if(ended = ended || end)\n        cb(ended)\n      else\n        cbs.push(cb)\n\n      if (needDrain) {\n        needDrain = false\n        s.emit('drain')\n      }\n    }\n  }\n\n  var n\n  if(reader) n = reader(s.source)\n  if(n && !read) read = n\n\n  var output = [], _cbs = []\n  var _ended = false, waiting = false, busy = false\n\n  s.sink = function (_read) {\n    read = _read\n    next(drain)\n  }\n\n  if(read) {\n    s.sink(read)\n\n    var pipe = s.pipe.bind(s)\n    s.pipe = function (dest, opts) {\n      var res = pipe(dest, opts)\n\n      if(s.paused) s.resume()\n\n      return res\n    }\n  }\n\n  function drain () {\n    waiting = false\n    if(!read || busy) return\n    while(output.length && !s.paused) {\n      s.emit('data', output.shift())\n    }\n    if(s.paused) return\n    if(_ended)\n      return s.emit('end')\n\n    busy = true\n    read(null, function next (end, data) {\n      busy = false\n      if(s.paused) {\n        if(end === true) _ended = end\n        else if(end) s.emit('error', end)\n        else output.push(data)\n        waiting = true\n      } else {\n        if(end && (ended = end) !== true)\n          s.emit('error', end)\n        else if(ended = ended || end) s.emit('end')\n        else {\n          s.emit('data', data)\n          busy = true\n          read(null, next)\n        }\n      }\n    })\n  }\n\n  s.pause = function () {\n    s.paused = true\n    return s\n  }\n\n  s.resume = function () {\n    s.paused = false\n    drain()\n    return s\n  }\n\n  s.destroy = function () {\n    if(!ended && read)\n      read(ended = true, function () {})\n    ended = true\n    if(cbs.length)\n      cbs.shift()(true)\n\n    s.emit('close')\n  }\n\n  return s\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream-to-stream/index.js\n// module id = 517\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream-to-stream/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function pull (a) {\n  var length = arguments.length\n  if (typeof a === 'function' && a.length === 1) {\n    var args = new Array(length)\n    for(var i = 0; i < length; i++)\n      args[i] = arguments[i]\n    return function (read) {\n      if (args == null) {\n        throw new TypeError(\"partial sink should only be called once!\")\n      }\n\n      // Grab the reference after the check, because it's always an array now\n      // (engines like that kind of consistency).\n      var ref = args\n      args = null\n\n      // Prioritize common case of small number of pulls.\n      switch (length) {\n      case 1: return pull(read, ref[0])\n      case 2: return pull(read, ref[0], ref[1])\n      case 3: return pull(read, ref[0], ref[1], ref[2])\n      case 4: return pull(read, ref[0], ref[1], ref[2], ref[3])\n      default:\n        ref.unshift(read)\n        return pull.apply(null, ref)\n      }\n    }\n  }\n\n  var read = a\n\n  if (read && typeof read.source === 'function') {\n    read = read.source\n  }\n\n  for (var i = 1; i < length; i++) {\n    var s = arguments[i]\n    if (typeof s === 'function') {\n      read = s(read)\n    } else if (s && typeof s === 'object') {\n      s.sink(read)\n      read = s.source\n    }\n  }\n\n  return read\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/pull.js\n// module id = 518\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/pull.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar abortCb = __webpack_require__(521)\n\nmodule.exports = function once (value, onAbort) {\n  return function (abort, cb) {\n    if(abort)\n      return abortCb(cb, abort, onAbort)\n    if(value != null) {\n      var _value = value; value = null\n      cb(null, _value)\n    } else\n      cb(true)\n  }\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/once.js\n// module id = 519\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/once.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(154)\nvar filter = __webpack_require__(304)\n\n//drop items you have already seen.\nmodule.exports = function unique (field, invert) {\n  field = prop(field) || id\n  var seen = {}\n  return filter(function (data) {\n    var key = field(data)\n    if(seen[key]) return !!invert //false, by default\n    else seen[key] = true\n    return !invert //true by default\n  })\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/unique.js\n// module id = 520\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/unique.js")},function(module,exports){eval("module.exports = function abortCb(cb, abort, onAbort) {\n  cb(abort)\n  onAbort && onAbort(abort === true ? null: abort)\n  return\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/util/abort-cb.js\n// module id = 521\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/util/abort-cb.js")},function(module,exports,__webpack_require__){eval("var prop = __webpack_require__(154)\n\nfunction id (e) { return e }\n\nmodule.exports = function tester (test) {\n  return (\n    'object' === typeof test && 'function' === typeof test.test //regexp\n    ? function (data) { return test.test(data) }\n    : prop (test) || id\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/util/tester.js\n// module id = 522\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/util/tester.js")},function(module,exports){eval("\nvar once = exports.once =\nfunction (value) {\n  return function (abort, cb) {\n    if(abort) return cb(abort)\n    if(value != null) {\n      var _value = value; value = null\n      cb(null, _value)\n    } else\n      cb(true)\n  }\n}\n\nvar depthFirst = exports.depthFirst =\nfunction (start, createStream) {\n  var reads = [], ended\n\n  reads.unshift(once(start))\n\n  return function next (end, cb) {\n    if(!reads.length)\n      return cb(true)\n    if(ended)\n      return cb(ended)\n\n    reads[0](end, function (end, data) {\n      if(end) {\n        if(end !== true) {\n          ended = end\n          reads.shift()\n\n          while(reads.length)\n            reads.shift()(end, function () {})\n          \n          return cb(end)\n        }\n        //if this stream has ended, go to the next queue\n        reads.shift()\n        return next(null, cb)\n      }\n      reads.unshift(createStream(data))\n      cb(end, data)\n    })\n  }\n}\n//width first is just like depth first,\n//but push each new stream onto the end of the queue\nvar widthFirst = exports.widthFirst = \nfunction (start, createStream) {\n  var reads = []\n\n  reads.push(once(start))\n\n  return function next (end, cb) {\n    if(!reads.length)\n      return cb(true)\n    reads[0](end, function (end, data) {\n      if(end) {\n        reads.shift()\n        return next(null, cb)\n      }\n      reads.push(createStream(data))\n      cb(end, data)\n    })\n  }\n}\n\n//this came out different to the first (strm)\n//attempt at leafFirst, but it's still a valid\n//topological sort.\nvar leafFirst = exports.leafFirst = \nfunction (start, createStream) {\n  var reads = []\n  var output = []\n  reads.push(once(start))\n  \n  return function next (end, cb) {\n    reads[0](end, function (end, data) {\n      if(end) {\n        reads.shift()\n        if(!output.length)\n          return cb(true)\n        return cb(null, output.shift())\n      }\n      reads.unshift(createStream(data))\n      output.unshift(data)\n      next(null, cb)\n    })\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-traverse/index.js\n// module id = 523\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-traverse/index.js")},function(module,exports,__webpack_require__){eval("var OPS = __webpack_require__(33)\n\nfunction encodingLength (i) {\n  return i < OPS.OP_PUSHDATA1 ? 1\n  : i <= 0xff ? 2\n  : i <= 0xffff ? 3\n  : 5\n}\n\nfunction encode (buffer, number, offset) {\n  var size = encodingLength(number)\n\n  // ~6 bit\n  if (size === 1) {\n    buffer.writeUInt8(number, offset)\n\n  // 8 bit\n  } else if (size === 2) {\n    buffer.writeUInt8(OPS.OP_PUSHDATA1, offset)\n    buffer.writeUInt8(number, offset + 1)\n\n  // 16 bit\n  } else if (size === 3) {\n    buffer.writeUInt8(OPS.OP_PUSHDATA2, offset)\n    buffer.writeUInt16LE(number, offset + 1)\n\n  // 32 bit\n  } else {\n    buffer.writeUInt8(OPS.OP_PUSHDATA4, offset)\n    buffer.writeUInt32LE(number, offset + 1)\n  }\n\n  return size\n}\n\nfunction decode (buffer, offset) {\n  var opcode = buffer.readUInt8(offset)\n  var number, size\n\n  // ~6 bit\n  if (opcode < OPS.OP_PUSHDATA1) {\n    number = opcode\n    size = 1\n\n  // 8 bit\n  } else if (opcode === OPS.OP_PUSHDATA1) {\n    if (offset + 2 > buffer.length) return null\n    number = buffer.readUInt8(offset + 1)\n    size = 2\n\n  // 16 bit\n  } else if (opcode === OPS.OP_PUSHDATA2) {\n    if (offset + 3 > buffer.length) return null\n    number = buffer.readUInt16LE(offset + 1)\n    size = 3\n\n  // 32 bit\n  } else {\n    if (offset + 5 > buffer.length) return null\n    if (opcode !== OPS.OP_PUSHDATA4) throw new Error('Unexpected opcode')\n\n    number = buffer.readUInt32LE(offset + 1)\n    size = 5\n  }\n\n  return {\n    opcode: opcode,\n    number: number,\n    size: size\n  }\n}\n\nmodule.exports = {\n  encodingLength: encodingLength,\n  encode: encode,\n  decode: decode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pushdata-bitcoin/index.js\n// module id = 524\n// module chunks = 0\n\n//# sourceURL=../node_modules/pushdata-bitcoin/index.js")},function(module,exports,__webpack_require__){eval("var randomHex = function(size, callback) {\n    var crypto = __webpack_require__(1210);\n    var isCallback = (typeof callback === 'function');\n\n    \n    if (size > 65536) {\n        if(isCallback) {\n            callback(new Error('Requested too many random bytes.'));\n        } else {\n            throw new Error('Requested too many random bytes.');\n        }\n    };\n\n\n    // is node\n    if (typeof crypto !== 'undefined' && crypto.randomBytes) {\n\n        if(isCallback) {\n            crypto.randomBytes(size, function(err, result){\n                if(!err) {\n                    callback(null, '0x'+ result.toString('hex'));\n                } else {\n                    callback(error);\n                }\n            })\n        } else {\n            return '0x'+ crypto.randomBytes(size).toString('hex');\n        }\n\n    // is browser\n    } else {\n        var cryptoLib;\n\n        if (typeof crypto !== 'undefined') {\n            cryptoLib = crypto;\n        } else if(typeof msCrypto !== 'undefined') {\n            cryptoLib = msCrypto;\n        }\n\n        if (cryptoLib && cryptoLib.getRandomValues) {\n            var randomBytes = cryptoLib.getRandomValues(new Uint8Array(size));\n            var returnValue = '0x'+ Array.from(randomBytes).map(function(arr){ return arr.toString(16); }).join('');\n\n            if(isCallback) {\n                callback(null, returnValue);\n            } else {\n                return returnValue;\n            }\n\n        // not crypto object\n        } else {\n            var error = new Error('No \"crypto\" object available. This Browser doesn\\'t support generating secure random bytes.');\n\n            if(isCallback) {\n                callback(error);\n            } else {\n               throw error;\n            }\n        }\n    }\n};\n\n\nmodule.exports = randomHex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/randomhex/src/index.js\n// module id = 525\n// module chunks = 0\n\n//# sourceURL=../node_modules/randomhex/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n/*<replacement>*/\n\nvar processNextTick = __webpack_require__(203).nextTick;\n/*</replacement>*/\n\nmodule.exports = Readable;\n\n/*<replacement>*/\nvar isArray = __webpack_require__(431);\n/*</replacement>*/\n\n/*<replacement>*/\nvar Duplex;\n/*</replacement>*/\n\nReadable.ReadableState = ReadableState;\n\n/*<replacement>*/\nvar EE = __webpack_require__(15).EventEmitter;\n\nvar EElistenerCount = function (emitter, type) {\n  return emitter.listeners(type).length;\n};\n/*</replacement>*/\n\n/*<replacement>*/\nvar Stream = __webpack_require__(529);\n/*</replacement>*/\n\n/*<replacement>*/\n\nvar Buffer = __webpack_require__(1).Buffer;\nvar OurUint8Array = global.Uint8Array || function () {};\nfunction _uint8ArrayToBuffer(chunk) {\n  return Buffer.from(chunk);\n}\nfunction _isUint8Array(obj) {\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\n}\n\n/*</replacement>*/\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\n/*<replacement>*/\nvar debugUtil = __webpack_require__(1357);\nvar debug = void 0;\nif (debugUtil && debugUtil.debuglog) {\n  debug = debugUtil.debuglog('stream');\n} else {\n  debug = function () {};\n}\n/*</replacement>*/\n\nvar BufferList = __webpack_require__(1213);\nvar destroyImpl = __webpack_require__(528);\nvar StringDecoder;\n\nutil.inherits(Readable, Stream);\n\nvar kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];\n\nfunction prependListener(emitter, event, fn) {\n  // Sadly this is not cacheable as some libraries bundle their own\n  // event emitter implementation with them.\n  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);\n\n  // This is a hack to make sure that our error handler is attached before any\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\n  // to continue to work with older versions of Node.js that do not include\n  // the prependListener() method. The goal is to eventually remove this hack.\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\n}\n\nfunction ReadableState(options, stream) {\n  Duplex = Duplex || __webpack_require__(103);\n\n  options = options || {};\n\n  // Duplex streams are both readable and writable, but share\n  // the same options object.\n  // However, some cases require setting options to different\n  // values for the readable and the writable sides of the duplex stream.\n  // These options can be provided separately as readableXXX and writableXXX.\n  var isDuplex = stream instanceof Duplex;\n\n  // object stream flag. Used to make read(n) ignore n and to\n  // make all the buffer merging and length checks go away\n  this.objectMode = !!options.objectMode;\n\n  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\n\n  // the point at which it stops calling _read() to fill the buffer\n  // Note: 0 is a valid value, means \"don't call _read preemptively ever\"\n  var hwm = options.highWaterMark;\n  var readableHwm = options.readableHighWaterMark;\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\n\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\n\n  // cast to ints.\n  this.highWaterMark = Math.floor(this.highWaterMark);\n\n  // A linked list is used to store data chunks instead of an array because the\n  // linked list can remove elements from the beginning faster than\n  // array.shift()\n  this.buffer = new BufferList();\n  this.length = 0;\n  this.pipes = null;\n  this.pipesCount = 0;\n  this.flowing = null;\n  this.ended = false;\n  this.endEmitted = false;\n  this.reading = false;\n\n  // a flag to be able to tell if the event 'readable'/'data' is emitted\n  // immediately, or on a later tick.  We set this to true at first, because\n  // any actions that shouldn't happen until \"later\" should generally also\n  // not happen before the first read call.\n  this.sync = true;\n\n  // whenever we return null, then we set a flag to say\n  // that we're awaiting a 'readable' event emission.\n  this.needReadable = false;\n  this.emittedReadable = false;\n  this.readableListening = false;\n  this.resumeScheduled = false;\n\n  // has it been destroyed\n  this.destroyed = false;\n\n  // Crypto is kind of old and crusty.  Historically, its default string\n  // encoding is 'binary' so we have to make this configurable.\n  // Everything else in the universe uses 'utf8', though.\n  this.defaultEncoding = options.defaultEncoding || 'utf8';\n\n  // the number of writers that are awaiting a drain event in .pipe()s\n  this.awaitDrain = 0;\n\n  // if true, a maybeReadMore has been scheduled\n  this.readingMore = false;\n\n  this.decoder = null;\n  this.encoding = null;\n  if (options.encoding) {\n    if (!StringDecoder) StringDecoder = __webpack_require__(156).StringDecoder;\n    this.decoder = new StringDecoder(options.encoding);\n    this.encoding = options.encoding;\n  }\n}\n\nfunction Readable(options) {\n  Duplex = Duplex || __webpack_require__(103);\n\n  if (!(this instanceof Readable)) return new Readable(options);\n\n  this._readableState = new ReadableState(options, this);\n\n  // legacy\n  this.readable = true;\n\n  if (options) {\n    if (typeof options.read === 'function') this._read = options.read;\n\n    if (typeof options.destroy === 'function') this._destroy = options.destroy;\n  }\n\n  Stream.call(this);\n}\n\nObject.defineProperty(Readable.prototype, 'destroyed', {\n  get: function () {\n    if (this._readableState === undefined) {\n      return false;\n    }\n    return this._readableState.destroyed;\n  },\n  set: function (value) {\n    // we ignore the value if the stream\n    // has not been initialized yet\n    if (!this._readableState) {\n      return;\n    }\n\n    // backward compatibility, the user is explicitly\n    // managing destroyed\n    this._readableState.destroyed = value;\n  }\n});\n\nReadable.prototype.destroy = destroyImpl.destroy;\nReadable.prototype._undestroy = destroyImpl.undestroy;\nReadable.prototype._destroy = function (err, cb) {\n  this.push(null);\n  cb(err);\n};\n\n// Manually shove something into the read() buffer.\n// This returns true if the highWaterMark has not been hit yet,\n// similar to how Writable.write() returns true if you should\n// write() some more.\nReadable.prototype.push = function (chunk, encoding) {\n  var state = this._readableState;\n  var skipChunkCheck;\n\n  if (!state.objectMode) {\n    if (typeof chunk === 'string') {\n      encoding = encoding || state.defaultEncoding;\n      if (encoding !== state.encoding) {\n        chunk = Buffer.from(chunk, encoding);\n        encoding = '';\n      }\n      skipChunkCheck = true;\n    }\n  } else {\n    skipChunkCheck = true;\n  }\n\n  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\n};\n\n// Unshift should *always* be something directly out of read()\nReadable.prototype.unshift = function (chunk) {\n  return readableAddChunk(this, chunk, null, true, false);\n};\n\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\n  var state = stream._readableState;\n  if (chunk === null) {\n    state.reading = false;\n    onEofChunk(stream, state);\n  } else {\n    var er;\n    if (!skipChunkCheck) er = chunkInvalid(state, chunk);\n    if (er) {\n      stream.emit('error', er);\n    } else if (state.objectMode || chunk && chunk.length > 0) {\n      if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\n        chunk = _uint8ArrayToBuffer(chunk);\n      }\n\n      if (addToFront) {\n        if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);\n      } else if (state.ended) {\n        stream.emit('error', new Error('stream.push() after EOF'));\n      } else {\n        state.reading = false;\n        if (state.decoder && !encoding) {\n          chunk = state.decoder.write(chunk);\n          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\n        } else {\n          addChunk(stream, state, chunk, false);\n        }\n      }\n    } else if (!addToFront) {\n      state.reading = false;\n    }\n  }\n\n  return needMoreData(state);\n}\n\nfunction addChunk(stream, state, chunk, addToFront) {\n  if (state.flowing && state.length === 0 && !state.sync) {\n    stream.emit('data', chunk);\n    stream.read(0);\n  } else {\n    // update the buffer info.\n    state.length += state.objectMode ? 1 : chunk.length;\n    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\n\n    if (state.needReadable) emitReadable(stream);\n  }\n  maybeReadMore(stream, state);\n}\n\nfunction chunkInvalid(state, chunk) {\n  var er;\n  if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {\n    er = new TypeError('Invalid non-string/buffer chunk');\n  }\n  return er;\n}\n\n// if it's past the high water mark, we can push in some more.\n// Also, if we have no data yet, we can stand some\n// more bytes.  This is to work around cases where hwm=0,\n// such as the repl.  Also, if the push() triggered a\n// readable event, and the user called read(largeNumber) such that\n// needReadable was set, then we ought to push more, so that another\n// 'readable' event will be triggered.\nfunction needMoreData(state) {\n  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\n}\n\nReadable.prototype.isPaused = function () {\n  return this._readableState.flowing === false;\n};\n\n// backwards compatibility.\nReadable.prototype.setEncoding = function (enc) {\n  if (!StringDecoder) StringDecoder = __webpack_require__(156).StringDecoder;\n  this._readableState.decoder = new StringDecoder(enc);\n  this._readableState.encoding = enc;\n  return this;\n};\n\n// Don't raise the hwm > 8MB\nvar MAX_HWM = 0x800000;\nfunction computeNewHighWaterMark(n) {\n  if (n >= MAX_HWM) {\n    n = MAX_HWM;\n  } else {\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\n    // tiny amounts\n    n--;\n    n |= n >>> 1;\n    n |= n >>> 2;\n    n |= n >>> 4;\n    n |= n >>> 8;\n    n |= n >>> 16;\n    n++;\n  }\n  return n;\n}\n\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction howMuchToRead(n, state) {\n  if (n <= 0 || state.length === 0 && state.ended) return 0;\n  if (state.objectMode) return 1;\n  if (n !== n) {\n    // Only flow one buffer at a time\n    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\n  }\n  // If we're asking for more than the current hwm, then raise the hwm.\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\n  if (n <= state.length) return n;\n  // Don't have enough\n  if (!state.ended) {\n    state.needReadable = true;\n    return 0;\n  }\n  return state.length;\n}\n\n// you can override either this method, or the async _read(n) below.\nReadable.prototype.read = function (n) {\n  debug('read', n);\n  n = parseInt(n, 10);\n  var state = this._readableState;\n  var nOrig = n;\n\n  if (n !== 0) state.emittedReadable = false;\n\n  // if we're doing read(0) to trigger a readable event, but we\n  // already have a bunch of data in the buffer, then just trigger\n  // the 'readable' event and move on.\n  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\n    debug('read: emitReadable', state.length, state.ended);\n    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\n    return null;\n  }\n\n  n = howMuchToRead(n, state);\n\n  // if we've ended, and we're now clear, then finish it up.\n  if (n === 0 && state.ended) {\n    if (state.length === 0) endReadable(this);\n    return null;\n  }\n\n  // All the actual chunk generation logic needs to be\n  // *below* the call to _read.  The reason is that in certain\n  // synthetic stream cases, such as passthrough streams, _read\n  // may be a completely synchronous operation which may change\n  // the state of the read buffer, providing enough data when\n  // before there was *not* enough.\n  //\n  // So, the steps are:\n  // 1. Figure out what the state of things will be after we do\n  // a read from the buffer.\n  //\n  // 2. If that resulting state will trigger a _read, then call _read.\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\n  // deeply ugly to write APIs this way, but that still doesn't mean\n  // that the Readable class should behave improperly, as streams are\n  // designed to be sync/async agnostic.\n  // Take note if the _read call is sync or async (ie, if the read call\n  // has returned yet), so that we know whether or not it's safe to emit\n  // 'readable' etc.\n  //\n  // 3. Actually pull the requested chunks out of the buffer and return.\n\n  // if we need a readable event, then we need to do some reading.\n  var doRead = state.needReadable;\n  debug('need readable', doRead);\n\n  // if we currently have less than the highWaterMark, then also read some\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\n    doRead = true;\n    debug('length less than watermark', doRead);\n  }\n\n  // however, if we've ended, then there's no point, and if we're already\n  // reading, then it's unnecessary.\n  if (state.ended || state.reading) {\n    doRead = false;\n    debug('reading or ended', doRead);\n  } else if (doRead) {\n    debug('do read');\n    state.reading = true;\n    state.sync = true;\n    // if the length is currently zero, then we *need* a readable event.\n    if (state.length === 0) state.needReadable = true;\n    // call internal read method\n    this._read(state.highWaterMark);\n    state.sync = false;\n    // If _read pushed data synchronously, then `reading` will be false,\n    // and we need to re-evaluate how much data we can return to the user.\n    if (!state.reading) n = howMuchToRead(nOrig, state);\n  }\n\n  var ret;\n  if (n > 0) ret = fromList(n, state);else ret = null;\n\n  if (ret === null) {\n    state.needReadable = true;\n    n = 0;\n  } else {\n    state.length -= n;\n  }\n\n  if (state.length === 0) {\n    // If we have nothing in the buffer, then we want to know\n    // as soon as we *do* get something into the buffer.\n    if (!state.ended) state.needReadable = true;\n\n    // If we tried to read() past the EOF, then emit end on the next tick.\n    if (nOrig !== n && state.ended) endReadable(this);\n  }\n\n  if (ret !== null) this.emit('data', ret);\n\n  return ret;\n};\n\nfunction onEofChunk(stream, state) {\n  if (state.ended) return;\n  if (state.decoder) {\n    var chunk = state.decoder.end();\n    if (chunk && chunk.length) {\n      state.buffer.push(chunk);\n      state.length += state.objectMode ? 1 : chunk.length;\n    }\n  }\n  state.ended = true;\n\n  // emit 'readable' now to make sure it gets picked up.\n  emitReadable(stream);\n}\n\n// Don't emit readable right away in sync mode, because this can trigger\n// another read() call => stack overflow.  This way, it might trigger\n// a nextTick recursion warning, but that's not so bad.\nfunction emitReadable(stream) {\n  var state = stream._readableState;\n  state.needReadable = false;\n  if (!state.emittedReadable) {\n    debug('emitReadable', state.flowing);\n    state.emittedReadable = true;\n    if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\n  }\n}\n\nfunction emitReadable_(stream) {\n  debug('emit readable');\n  stream.emit('readable');\n  flow(stream);\n}\n\n// at this point, the user has presumably seen the 'readable' event,\n// and called read() to consume some data.  that may have triggered\n// in turn another _read(n) call, in which case reading = true if\n// it's in progress.\n// However, if we're not ended, or reading, and the length < hwm,\n// then go ahead and try to read some more preemptively.\nfunction maybeReadMore(stream, state) {\n  if (!state.readingMore) {\n    state.readingMore = true;\n    processNextTick(maybeReadMore_, stream, state);\n  }\n}\n\nfunction maybeReadMore_(stream, state) {\n  var len = state.length;\n  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\n    debug('maybeReadMore read 0');\n    stream.read(0);\n    if (len === state.length)\n      // didn't get any data, stop spinning.\n      break;else len = state.length;\n  }\n  state.readingMore = false;\n}\n\n// abstract method.  to be overridden in specific implementation classes.\n// call cb(er, data) where data is <= n in length.\n// for virtual (non-string, non-buffer) streams, \"length\" is somewhat\n// arbitrary, and perhaps not very meaningful.\nReadable.prototype._read = function (n) {\n  this.emit('error', new Error('_read() is not implemented'));\n};\n\nReadable.prototype.pipe = function (dest, pipeOpts) {\n  var src = this;\n  var state = this._readableState;\n\n  switch (state.pipesCount) {\n    case 0:\n      state.pipes = dest;\n      break;\n    case 1:\n      state.pipes = [state.pipes, dest];\n      break;\n    default:\n      state.pipes.push(dest);\n      break;\n  }\n  state.pipesCount += 1;\n  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);\n\n  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\n\n  var endFn = doEnd ? onend : unpipe;\n  if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);\n\n  dest.on('unpipe', onunpipe);\n  function onunpipe(readable, unpipeInfo) {\n    debug('onunpipe');\n    if (readable === src) {\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\n        unpipeInfo.hasUnpiped = true;\n        cleanup();\n      }\n    }\n  }\n\n  function onend() {\n    debug('onend');\n    dest.end();\n  }\n\n  // when the dest drains, it reduces the awaitDrain counter\n  // on the source.  This would be more elegant with a .once()\n  // handler in flow(), but adding and removing repeatedly is\n  // too slow.\n  var ondrain = pipeOnDrain(src);\n  dest.on('drain', ondrain);\n\n  var cleanedUp = false;\n  function cleanup() {\n    debug('cleanup');\n    // cleanup event handlers once the pipe is broken\n    dest.removeListener('close', onclose);\n    dest.removeListener('finish', onfinish);\n    dest.removeListener('drain', ondrain);\n    dest.removeListener('error', onerror);\n    dest.removeListener('unpipe', onunpipe);\n    src.removeListener('end', onend);\n    src.removeListener('end', unpipe);\n    src.removeListener('data', ondata);\n\n    cleanedUp = true;\n\n    // if the reader is waiting for a drain event from this\n    // specific writer, then it would cause it to never start\n    // flowing again.\n    // So, if this is awaiting a drain, then we just call it now.\n    // If we don't know, then assume that we are waiting for one.\n    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\n  }\n\n  // If the user pushes more data while we're writing to dest then we'll end up\n  // in ondata again. However, we only want to increase awaitDrain once because\n  // dest will only emit one 'drain' event for the multiple writes.\n  // => Introduce a guard on increasing awaitDrain.\n  var increasedAwaitDrain = false;\n  src.on('data', ondata);\n  function ondata(chunk) {\n    debug('ondata');\n    increasedAwaitDrain = false;\n    var ret = dest.write(chunk);\n    if (false === ret && !increasedAwaitDrain) {\n      // If the user unpiped during `dest.write()`, it is possible\n      // to get stuck in a permanently paused state if that write\n      // also returned false.\n      // => Check whether `dest` is still a piping destination.\n      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\n        debug('false write response, pause', src._readableState.awaitDrain);\n        src._readableState.awaitDrain++;\n        increasedAwaitDrain = true;\n      }\n      src.pause();\n    }\n  }\n\n  // if the dest has an error, then stop piping into it.\n  // however, don't suppress the throwing behavior for this.\n  function onerror(er) {\n    debug('onerror', er);\n    unpipe();\n    dest.removeListener('error', onerror);\n    if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);\n  }\n\n  // Make sure our error handler is attached before userland ones.\n  prependListener(dest, 'error', onerror);\n\n  // Both close and finish should trigger unpipe, but only once.\n  function onclose() {\n    dest.removeListener('finish', onfinish);\n    unpipe();\n  }\n  dest.once('close', onclose);\n  function onfinish() {\n    debug('onfinish');\n    dest.removeListener('close', onclose);\n    unpipe();\n  }\n  dest.once('finish', onfinish);\n\n  function unpipe() {\n    debug('unpipe');\n    src.unpipe(dest);\n  }\n\n  // tell the dest that it's being piped to\n  dest.emit('pipe', src);\n\n  // start the flow if it hasn't been started already.\n  if (!state.flowing) {\n    debug('pipe resume');\n    src.resume();\n  }\n\n  return dest;\n};\n\nfunction pipeOnDrain(src) {\n  return function () {\n    var state = src._readableState;\n    debug('pipeOnDrain', state.awaitDrain);\n    if (state.awaitDrain) state.awaitDrain--;\n    if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {\n      state.flowing = true;\n      flow(src);\n    }\n  };\n}\n\nReadable.prototype.unpipe = function (dest) {\n  var state = this._readableState;\n  var unpipeInfo = { hasUnpiped: false };\n\n  // if we're not piping anywhere, then do nothing.\n  if (state.pipesCount === 0) return this;\n\n  // just one destination.  most common case.\n  if (state.pipesCount === 1) {\n    // passed in one, but it's not the right one.\n    if (dest && dest !== state.pipes) return this;\n\n    if (!dest) dest = state.pipes;\n\n    // got a match.\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n    if (dest) dest.emit('unpipe', this, unpipeInfo);\n    return this;\n  }\n\n  // slow case. multiple pipe destinations.\n\n  if (!dest) {\n    // remove all.\n    var dests = state.pipes;\n    var len = state.pipesCount;\n    state.pipes = null;\n    state.pipesCount = 0;\n    state.flowing = false;\n\n    for (var i = 0; i < len; i++) {\n      dests[i].emit('unpipe', this, unpipeInfo);\n    }return this;\n  }\n\n  // try to find the right one.\n  var index = indexOf(state.pipes, dest);\n  if (index === -1) return this;\n\n  state.pipes.splice(index, 1);\n  state.pipesCount -= 1;\n  if (state.pipesCount === 1) state.pipes = state.pipes[0];\n\n  dest.emit('unpipe', this, unpipeInfo);\n\n  return this;\n};\n\n// set up data events if they are asked for\n// Ensure readable listeners eventually get something\nReadable.prototype.on = function (ev, fn) {\n  var res = Stream.prototype.on.call(this, ev, fn);\n\n  if (ev === 'data') {\n    // Start flowing on next tick if stream isn't explicitly paused\n    if (this._readableState.flowing !== false) this.resume();\n  } else if (ev === 'readable') {\n    var state = this._readableState;\n    if (!state.endEmitted && !state.readableListening) {\n      state.readableListening = state.needReadable = true;\n      state.emittedReadable = false;\n      if (!state.reading) {\n        processNextTick(nReadingNextTick, this);\n      } else if (state.length) {\n        emitReadable(this);\n      }\n    }\n  }\n\n  return res;\n};\nReadable.prototype.addListener = Readable.prototype.on;\n\nfunction nReadingNextTick(self) {\n  debug('readable nexttick read 0');\n  self.read(0);\n}\n\n// pause() and resume() are remnants of the legacy readable stream API\n// If the user uses them, then switch into old mode.\nReadable.prototype.resume = function () {\n  var state = this._readableState;\n  if (!state.flowing) {\n    debug('resume');\n    state.flowing = true;\n    resume(this, state);\n  }\n  return this;\n};\n\nfunction resume(stream, state) {\n  if (!state.resumeScheduled) {\n    state.resumeScheduled = true;\n    processNextTick(resume_, stream, state);\n  }\n}\n\nfunction resume_(stream, state) {\n  if (!state.reading) {\n    debug('resume read 0');\n    stream.read(0);\n  }\n\n  state.resumeScheduled = false;\n  state.awaitDrain = 0;\n  stream.emit('resume');\n  flow(stream);\n  if (state.flowing && !state.reading) stream.read(0);\n}\n\nReadable.prototype.pause = function () {\n  debug('call pause flowing=%j', this._readableState.flowing);\n  if (false !== this._readableState.flowing) {\n    debug('pause');\n    this._readableState.flowing = false;\n    this.emit('pause');\n  }\n  return this;\n};\n\nfunction flow(stream) {\n  var state = stream._readableState;\n  debug('flow', state.flowing);\n  while (state.flowing && stream.read() !== null) {}\n}\n\n// wrap an old-style stream as the async data source.\n// This is *not* part of the readable stream interface.\n// It is an ugly unfortunate mess of history.\nReadable.prototype.wrap = function (stream) {\n  var _this = this;\n\n  var state = this._readableState;\n  var paused = false;\n\n  stream.on('end', function () {\n    debug('wrapped end');\n    if (state.decoder && !state.ended) {\n      var chunk = state.decoder.end();\n      if (chunk && chunk.length) _this.push(chunk);\n    }\n\n    _this.push(null);\n  });\n\n  stream.on('data', function (chunk) {\n    debug('wrapped data');\n    if (state.decoder) chunk = state.decoder.write(chunk);\n\n    // don't skip over falsy values in objectMode\n    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\n\n    var ret = _this.push(chunk);\n    if (!ret) {\n      paused = true;\n      stream.pause();\n    }\n  });\n\n  // proxy all the other methods.\n  // important when wrapping filters and duplexes.\n  for (var i in stream) {\n    if (this[i] === undefined && typeof stream[i] === 'function') {\n      this[i] = function (method) {\n        return function () {\n          return stream[method].apply(stream, arguments);\n        };\n      }(i);\n    }\n  }\n\n  // proxy certain important events.\n  for (var n = 0; n < kProxyEvents.length; n++) {\n    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\n  }\n\n  // when we try to consume some more bytes, simply unpause the\n  // underlying stream.\n  this._read = function (n) {\n    debug('wrapped _read', n);\n    if (paused) {\n      paused = false;\n      stream.resume();\n    }\n  };\n\n  return this;\n};\n\n// exposed for testing purposes only.\nReadable._fromList = fromList;\n\n// Pluck off n bytes from an array of buffers.\n// Length is the combined lengths of all the buffers in the list.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromList(n, state) {\n  // nothing buffered\n  if (state.length === 0) return null;\n\n  var ret;\n  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\n    // read it all, truncate the list\n    if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\n    state.buffer.clear();\n  } else {\n    // read part of list\n    ret = fromListPartial(n, state.buffer, state.decoder);\n  }\n\n  return ret;\n}\n\n// Extracts only enough buffered data to satisfy the amount requested.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction fromListPartial(n, list, hasStrings) {\n  var ret;\n  if (n < list.head.data.length) {\n    // slice is the same for buffers and strings\n    ret = list.head.data.slice(0, n);\n    list.head.data = list.head.data.slice(n);\n  } else if (n === list.head.data.length) {\n    // first chunk is a perfect match\n    ret = list.shift();\n  } else {\n    // result spans more than one buffer\n    ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\n  }\n  return ret;\n}\n\n// Copies a specified amount of characters from the list of buffered data\n// chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBufferString(n, list) {\n  var p = list.head;\n  var c = 1;\n  var ret = p.data;\n  n -= ret.length;\n  while (p = p.next) {\n    var str = p.data;\n    var nb = n > str.length ? str.length : n;\n    if (nb === str.length) ret += str;else ret += str.slice(0, n);\n    n -= nb;\n    if (n === 0) {\n      if (nb === str.length) {\n        ++c;\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\n      } else {\n        list.head = p;\n        p.data = str.slice(nb);\n      }\n      break;\n    }\n    ++c;\n  }\n  list.length -= c;\n  return ret;\n}\n\n// Copies a specified amount of bytes from the list of buffered data chunks.\n// This function is designed to be inlinable, so please take care when making\n// changes to the function body.\nfunction copyFromBuffer(n, list) {\n  var ret = Buffer.allocUnsafe(n);\n  var p = list.head;\n  var c = 1;\n  p.data.copy(ret);\n  n -= p.data.length;\n  while (p = p.next) {\n    var buf = p.data;\n    var nb = n > buf.length ? buf.length : n;\n    buf.copy(ret, ret.length - n, 0, nb);\n    n -= nb;\n    if (n === 0) {\n      if (nb === buf.length) {\n        ++c;\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\n      } else {\n        list.head = p;\n        p.data = buf.slice(nb);\n      }\n      break;\n    }\n    ++c;\n  }\n  list.length -= c;\n  return ret;\n}\n\nfunction endReadable(stream) {\n  var state = stream._readableState;\n\n  // If we get here before consuming all the bytes, then that is a\n  // bug in node.  Should never happen.\n  if (state.length > 0) throw new Error('\"endReadable()\" called on non-empty stream');\n\n  if (!state.endEmitted) {\n    state.ended = true;\n    processNextTick(endReadableNT, state, stream);\n  }\n}\n\nfunction endReadableNT(state, stream) {\n  // Check that we didn't get one last unshift.\n  if (!state.endEmitted && state.length === 0) {\n    state.endEmitted = true;\n    stream.readable = false;\n    stream.emit('end');\n  }\n}\n\nfunction forEach(xs, f) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    f(xs[i], i);\n  }\n}\n\nfunction indexOf(xs, x) {\n  for (var i = 0, l = xs.length; i < l; i++) {\n    if (xs[i] === x) return i;\n  }\n  return -1;\n}\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_readable.js\n// module id = 526\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/_stream_readable.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a transform stream is a readable/writable stream where you do\n// something with the data.  Sometimes it's called a \"filter\",\n// but that's not a great name for it, since that implies a thing where\n// some bits pass through, and others are simply ignored.  (That would\n// be a valid example of a transform, of course.)\n//\n// While the output is causally related to the input, it's not a\n// necessarily symmetric or synchronous transformation.  For example,\n// a zlib stream might take multiple plain-text writes(), and then\n// emit a single compressed chunk some time in the future.\n//\n// Here's how this works:\n//\n// The Transform stream has all the aspects of the readable and writable\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\n// internally, and returns false if there's a lot of pending writes\n// buffered up.  When you call read(), that calls _read(n) until\n// there's enough pending readable data buffered up.\n//\n// In a transform stream, the written data is placed in a buffer.  When\n// _read(n) is called, it transforms the queued up data, calling the\n// buffered _write cb's as it consumes chunks.  If consuming a single\n// written chunk would result in multiple output chunks, then the first\n// outputted bit calls the readcb, and subsequent chunks just go into\n// the read buffer, and will cause it to emit 'readable' if necessary.\n//\n// This way, back-pressure is actually determined by the reading side,\n// since _read has to be called to start processing a new chunk.  However,\n// a pathological inflate type of transform can cause excessive buffering\n// here.  For example, imagine a stream where every byte of input is\n// interpreted as an integer from 0-255, and then results in that many\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\n// 1kb of data being output.  In this case, you could write a very small\n// amount of input, and end up with a very large amount of output.  In\n// such a pathological inflating mechanism, there'd be no way to tell\n// the system to stop doing the transform.  A single 4MB write could\n// cause the system to run out of memory.\n//\n// However, even in such a pathological case, only a single written chunk\n// would be consumed, and then the rest would wait (un-transformed) until\n// the results of the previous transformed chunk were consumed.\n\n\n\nmodule.exports = Transform;\n\nvar Duplex = __webpack_require__(103);\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nutil.inherits(Transform, Duplex);\n\nfunction afterTransform(er, data) {\n  var ts = this._transformState;\n  ts.transforming = false;\n\n  var cb = ts.writecb;\n\n  if (!cb) {\n    return this.emit('error', new Error('write callback called multiple times'));\n  }\n\n  ts.writechunk = null;\n  ts.writecb = null;\n\n  if (data != null) // single equals check for both `null` and `undefined`\n    this.push(data);\n\n  cb(er);\n\n  var rs = this._readableState;\n  rs.reading = false;\n  if (rs.needReadable || rs.length < rs.highWaterMark) {\n    this._read(rs.highWaterMark);\n  }\n}\n\nfunction Transform(options) {\n  if (!(this instanceof Transform)) return new Transform(options);\n\n  Duplex.call(this, options);\n\n  this._transformState = {\n    afterTransform: afterTransform.bind(this),\n    needTransform: false,\n    transforming: false,\n    writecb: null,\n    writechunk: null,\n    writeencoding: null\n  };\n\n  // start out asking for a readable event once data is transformed.\n  this._readableState.needReadable = true;\n\n  // we have implemented the _read method, and done the other things\n  // that Readable wants before the first _read call, so unset the\n  // sync guard flag.\n  this._readableState.sync = false;\n\n  if (options) {\n    if (typeof options.transform === 'function') this._transform = options.transform;\n\n    if (typeof options.flush === 'function') this._flush = options.flush;\n  }\n\n  // When the writable side finishes, then flush out anything remaining.\n  this.on('prefinish', prefinish);\n}\n\nfunction prefinish() {\n  var _this = this;\n\n  if (typeof this._flush === 'function') {\n    this._flush(function (er, data) {\n      done(_this, er, data);\n    });\n  } else {\n    done(this, null, null);\n  }\n}\n\nTransform.prototype.push = function (chunk, encoding) {\n  this._transformState.needTransform = false;\n  return Duplex.prototype.push.call(this, chunk, encoding);\n};\n\n// This is the part where you do stuff!\n// override this function in implementation classes.\n// 'chunk' is an input chunk.\n//\n// Call `push(newChunk)` to pass along transformed output\n// to the readable side.  You may call 'push' zero or more times.\n//\n// Call `cb(err)` when you are done with this chunk.  If you pass\n// an error, then that'll put the hurt on the whole operation.  If you\n// never call cb(), then you'll never get another chunk.\nTransform.prototype._transform = function (chunk, encoding, cb) {\n  throw new Error('_transform() is not implemented');\n};\n\nTransform.prototype._write = function (chunk, encoding, cb) {\n  var ts = this._transformState;\n  ts.writecb = cb;\n  ts.writechunk = chunk;\n  ts.writeencoding = encoding;\n  if (!ts.transforming) {\n    var rs = this._readableState;\n    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\n  }\n};\n\n// Doesn't matter what the args are here.\n// _transform does all the work.\n// That we got here means that the readable side wants more data.\nTransform.prototype._read = function (n) {\n  var ts = this._transformState;\n\n  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\n    ts.transforming = true;\n    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\n  } else {\n    // mark that we need a transform, so that any data that comes in\n    // will get processed, now that we've asked for it.\n    ts.needTransform = true;\n  }\n};\n\nTransform.prototype._destroy = function (err, cb) {\n  var _this2 = this;\n\n  Duplex.prototype._destroy.call(this, err, function (err2) {\n    cb(err2);\n    _this2.emit('close');\n  });\n};\n\nfunction done(stream, er, data) {\n  if (er) return stream.emit('error', er);\n\n  if (data != null) // single equals check for both `null` and `undefined`\n    stream.push(data);\n\n  // if there's nothing in the write buffer, then that means\n  // that nothing more will ever be provided\n  if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');\n\n  if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');\n\n  return stream.push(null);\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_transform.js\n// module id = 527\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/_stream_transform.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/*<replacement>*/\n\nvar processNextTick = __webpack_require__(203).nextTick;\n/*</replacement>*/\n\n// undocumented cb() API, needed for core, not for public API\nfunction destroy(err, cb) {\n  var _this = this;\n\n  var readableDestroyed = this._readableState && this._readableState.destroyed;\n  var writableDestroyed = this._writableState && this._writableState.destroyed;\n\n  if (readableDestroyed || writableDestroyed) {\n    if (cb) {\n      cb(err);\n    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\n      processNextTick(emitErrorNT, this, err);\n    }\n    return this;\n  }\n\n  // we set destroyed to true before firing error callbacks in order\n  // to make it re-entrance safe in case destroy() is called within callbacks\n\n  if (this._readableState) {\n    this._readableState.destroyed = true;\n  }\n\n  // if this is a duplex stream mark the writable part as destroyed as well\n  if (this._writableState) {\n    this._writableState.destroyed = true;\n  }\n\n  this._destroy(err || null, function (err) {\n    if (!cb && err) {\n      processNextTick(emitErrorNT, _this, err);\n      if (_this._writableState) {\n        _this._writableState.errorEmitted = true;\n      }\n    } else if (cb) {\n      cb(err);\n    }\n  });\n\n  return this;\n}\n\nfunction undestroy() {\n  if (this._readableState) {\n    this._readableState.destroyed = false;\n    this._readableState.reading = false;\n    this._readableState.ended = false;\n    this._readableState.endEmitted = false;\n  }\n\n  if (this._writableState) {\n    this._writableState.destroyed = false;\n    this._writableState.ended = false;\n    this._writableState.ending = false;\n    this._writableState.finished = false;\n    this._writableState.errorEmitted = false;\n  }\n}\n\nfunction emitErrorNT(self, err) {\n  self.emit('error', err);\n}\n\nmodule.exports = {\n  destroy: destroy,\n  undestroy: undestroy\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/internal/streams/destroy.js\n// module id = 528\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/destroy.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(15).EventEmitter;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/internal/streams/stream-browser.js\n// module id = 529\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/stream-browser.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1221)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/scrypt.js/js.js\n// module id = 530\n// module chunks = 0\n\n//# sourceURL=../node_modules/scrypt.js/js.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar assert = __webpack_require__(1224)\nvar der = __webpack_require__(1225)\nvar messages = __webpack_require__(307)\n\nfunction initCompressedValue (value, defaultValue) {\n  if (value === undefined) return defaultValue\n\n  assert.isBoolean(value, messages.COMPRESSED_TYPE_INVALID)\n  return value\n}\n\nmodule.exports = function (secp256k1) {\n  return {\n    privateKeyVerify: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      return privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)\n    },\n\n    privateKeyExport: function (privateKey, compressed) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n      var publicKey = secp256k1.privateKeyExport(privateKey, compressed)\n\n      return der.privateKeyExport(privateKey, publicKey, compressed)\n    },\n\n    privateKeyImport: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n\n      privateKey = der.privateKeyImport(privateKey)\n      if (privateKey && privateKey.length === 32 && secp256k1.privateKeyVerify(privateKey)) return privateKey\n\n      throw new Error(messages.EC_PRIVATE_KEY_IMPORT_DER_FAIL)\n    },\n\n    privateKeyNegate: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.privateKeyNegate(privateKey)\n    },\n\n    privateKeyModInverse: function (privateKey) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.privateKeyModInverse(privateKey)\n    },\n\n    privateKeyTweakAdd: function (privateKey, tweak) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      return secp256k1.privateKeyTweakAdd(privateKey, tweak)\n    },\n\n    privateKeyTweakMul: function (privateKey, tweak) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      return secp256k1.privateKeyTweakMul(privateKey, tweak)\n    },\n\n    publicKeyCreate: function (privateKey, compressed) {\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyCreate(privateKey, compressed)\n    },\n\n    publicKeyConvert: function (publicKey, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyConvert(publicKey, compressed)\n    },\n\n    publicKeyVerify: function (publicKey) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      return secp256k1.publicKeyVerify(publicKey)\n    },\n\n    publicKeyTweakAdd: function (publicKey, tweak, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyTweakAdd(publicKey, tweak, compressed)\n    },\n\n    publicKeyTweakMul: function (publicKey, tweak, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(tweak, messages.TWEAK_TYPE_INVALID)\n      assert.isBufferLength(tweak, 32, messages.TWEAK_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyTweakMul(publicKey, tweak, compressed)\n    },\n\n    publicKeyCombine: function (publicKeys, compressed) {\n      assert.isArray(publicKeys, messages.EC_PUBLIC_KEYS_TYPE_INVALID)\n      assert.isLengthGTZero(publicKeys, messages.EC_PUBLIC_KEYS_LENGTH_INVALID)\n      for (var i = 0; i < publicKeys.length; ++i) {\n        assert.isBuffer(publicKeys[i], messages.EC_PUBLIC_KEY_TYPE_INVALID)\n        assert.isBufferLength2(publicKeys[i], 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n      }\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.publicKeyCombine(publicKeys, compressed)\n    },\n\n    signatureNormalize: function (signature) {\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      return secp256k1.signatureNormalize(signature)\n    },\n\n    signatureExport: function (signature) {\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = secp256k1.signatureExport(signature)\n      return der.signatureExport(sigObj)\n    },\n\n    signatureImport: function (sig) {\n      assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = der.signatureImport(sig)\n      if (sigObj) return secp256k1.signatureImport(sigObj)\n\n      throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n    },\n\n    signatureImportLax: function (sig) {\n      assert.isBuffer(sig, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isLengthGTZero(sig, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      var sigObj = der.signatureImportLax(sig)\n      if (sigObj) return secp256k1.signatureImport(sigObj)\n\n      throw new Error(messages.ECDSA_SIGNATURE_PARSE_DER_FAIL)\n    },\n\n    sign: function (message, privateKey, options) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      var data = null\n      var noncefn = null\n      if (options !== undefined) {\n        assert.isObject(options, messages.OPTIONS_TYPE_INVALID)\n\n        if (options.data !== undefined) {\n          assert.isBuffer(options.data, messages.OPTIONS_DATA_TYPE_INVALID)\n          assert.isBufferLength(options.data, 32, messages.OPTIONS_DATA_LENGTH_INVALID)\n          data = options.data\n        }\n\n        if (options.noncefn !== undefined) {\n          assert.isFunction(options.noncefn, messages.OPTIONS_NONCEFN_TYPE_INVALID)\n          noncefn = options.noncefn\n        }\n      }\n\n      return secp256k1.sign(message, privateKey, noncefn, data)\n    },\n\n    verify: function (message, signature, publicKey) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      return secp256k1.verify(message, signature, publicKey)\n    },\n\n    recover: function (message, signature, recovery, compressed) {\n      assert.isBuffer(message, messages.MSG32_TYPE_INVALID)\n      assert.isBufferLength(message, 32, messages.MSG32_LENGTH_INVALID)\n\n      assert.isBuffer(signature, messages.ECDSA_SIGNATURE_TYPE_INVALID)\n      assert.isBufferLength(signature, 64, messages.ECDSA_SIGNATURE_LENGTH_INVALID)\n\n      assert.isNumber(recovery, messages.RECOVERY_ID_TYPE_INVALID)\n      assert.isNumberInInterval(recovery, -1, 4, messages.RECOVERY_ID_VALUE_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.recover(message, signature, recovery, compressed)\n    },\n\n    ecdh: function (publicKey, privateKey) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      return secp256k1.ecdh(publicKey, privateKey)\n    },\n\n    ecdhUnsafe: function (publicKey, privateKey, compressed) {\n      assert.isBuffer(publicKey, messages.EC_PUBLIC_KEY_TYPE_INVALID)\n      assert.isBufferLength2(publicKey, 33, 65, messages.EC_PUBLIC_KEY_LENGTH_INVALID)\n\n      assert.isBuffer(privateKey, messages.EC_PRIVATE_KEY_TYPE_INVALID)\n      assert.isBufferLength(privateKey, 32, messages.EC_PRIVATE_KEY_LENGTH_INVALID)\n\n      compressed = initCompressedValue(compressed, true)\n\n      return secp256k1.ecdhUnsafe(publicKey, privateKey, compressed)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/index.js\n// module id = 531\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar BN = __webpack_require__(208)\n\nfunction ECJPoint (x, y, z) {\n  if (x === null && y === null && z === null) {\n    this.x = ECJPoint.one\n    this.y = ECJPoint.one\n    this.z = ECJPoint.zero\n  } else {\n    this.x = x\n    this.y = y\n    this.z = z\n  }\n\n  this.zOne = this.z === ECJPoint.one\n}\n\nECJPoint.zero = BN.fromNumber(0)\nECJPoint.one = BN.fromNumber(1)\n\nECJPoint.prototype.neg = function () {\n  if (this.inf) return this\n\n  return new ECJPoint(this.x, this.y.redNeg(), this.z)\n}\n\nECJPoint.prototype.add = function (p) {\n  // O + P = P\n  if (this.inf) return p\n\n  // P + O = P\n  if (p.inf) return this\n\n  // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-1998-cmo-2\n  // 12M + 4S + 7A\n  var pz2 = p.z.redSqr()\n  var z2 = this.z.redSqr()\n  var u1 = this.x.redMul(pz2)\n  var u2 = p.x.redMul(z2)\n  var s1 = this.y.redMul(pz2).redMul(p.z)\n  var s2 = p.y.redMul(z2).redMul(this.z)\n\n  var h = u1.redSub(u2)\n  var r = s1.redSub(s2)\n  if (h.isZero()) {\n    if (r.isZero()) return this.dbl()\n    return new ECJPoint(null, null, null)\n  }\n\n  var h2 = h.redSqr()\n  var v = u1.redMul(h2)\n  var h3 = h2.redMul(h)\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v)\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3))\n  var nz = this.z.redMul(p.z).redMul(h)\n\n  return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.mixedAdd = function (p) {\n  // O + P = P\n  if (this.inf) return p.toECJPoint()\n\n  // P + O = P\n  if (p.inf) return this\n\n  // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#addition-add-1998-cmo-2\n  //   with p.z = 1\n  // 8M + 3S + 7A\n  var z2 = this.z.redSqr()\n  var u1 = this.x\n  var u2 = p.x.redMul(z2)\n  var s1 = this.y\n  var s2 = p.y.redMul(z2).redMul(this.z)\n\n  var h = u1.redSub(u2)\n  var r = s1.redSub(s2)\n  if (h.isZero()) {\n    if (r.isZero()) return this.dbl()\n    return new ECJPoint(null, null, null)\n  }\n\n  var h2 = h.redSqr()\n  var v = u1.redMul(h2)\n  var h3 = h2.redMul(h)\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v)\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3))\n  var nz = this.z.redMul(h)\n\n  return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.dbl = function () {\n  if (this.inf) return this\n\n  var nx\n  var ny\n  var nz\n\n  // Z = 1\n  if (this.zOne) {\n    // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-mdbl-2007-bl\n    // 1M + 5S + 6A + 3*2 + 1*3 + 1*8\n\n    // XX = X1^2\n    var xx = this.x.redSqr()\n    // YY = Y1^2\n    var yy = this.y.redSqr()\n    // YYYY = YY^2\n    var yyyy = yy.redSqr()\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy)\n    s = s.redIAdd(s)\n    // M = 3 * XX\n    var m = xx.redAdd(xx).redIAdd(xx)\n    // T = M ^ 2 - 2*S\n    var t = m.redSqr().redISub(s).redISub(s)\n\n    // 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy).redIAdd(yyyy).redIAdd(yyyy)\n\n    // X3 = T\n    nx = t\n    // Y3 = M * (S - T) - 8 * YYYY\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8)\n    // Z3 = 2*Y1\n    nz = this.y.redAdd(this.y)\n  } else {\n    // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#doubling-dbl-2009-l\n    // 2M + 5S + 6A + 3*2 + 1*3 + 1*8\n\n    // A = X1^2\n    var a = this.x.redSqr()\n    // B = Y1^2\n    var b = this.y.redSqr()\n    // C = B^2\n    var c = b.redSqr()\n    // D = 2 * ((X1 + B)^2 - A - C)\n    var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c)\n    d = d.redIAdd(d)\n    // E = 3 * A\n    var e = a.redAdd(a).redIAdd(a)\n    // F = E^2\n    var f = e.redSqr()\n\n    // 8 * C\n    var c8 = c.redIAdd(c).redIAdd(c).redIAdd(c)\n\n    // X3 = F - 2 * D\n    nx = f.redISub(d).redISub(d)\n    // Y3 = E * (D - X3) - 8 * C\n    ny = e.redMul(d.redISub(nx)).redISub(c8)\n    // Z3 = 2 * Y1 * Z1\n    nz = this.y.redMul(this.z)\n    nz = nz.redIAdd(nz)\n  }\n\n  return new ECJPoint(nx, ny, nz)\n}\n\nECJPoint.prototype.dblp = function (pow) {\n  if (pow === 0 || this.inf) return this\n\n  var point = this\n  for (var i = 0; i < pow; i++) point = point.dbl()\n\n  return point\n}\n\nObject.defineProperty(ECJPoint.prototype, 'inf', {\n  enumerable: true,\n  get: function () {\n    return this.z.isZero()\n  }\n})\n\nmodule.exports = ECJPoint\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/ecjpoint.js\n// module id = 532\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/ecjpoint.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar BN = __webpack_require__(208)\nvar ECJPoint = __webpack_require__(532)\n\nfunction ECPoint (x, y) {\n  if (x === null && y === null) {\n    this.x = this.y = null\n    this.inf = true\n  } else {\n    this.x = x\n    this.y = y\n    this.inf = false\n  }\n}\n\nECPoint.fromPublicKey = function (publicKey) {\n  var first = publicKey[0]\n  var x\n  var y\n\n  if (publicKey.length === 33 && (first === 0x02 || first === 0x03)) {\n    x = BN.fromBuffer(publicKey.slice(1, 33))\n\n    // overflow\n    if (x.ucmp(BN.p) >= 0) return null\n\n    // create from X\n    y = x.redSqr().redMul(x).redIAdd7().redSqrt()\n    if (y === null) return null\n    if ((first === 0x03) !== y.isOdd()) y = y.redNeg()\n\n    return new ECPoint(x, y)\n  }\n\n  if (publicKey.length === 65 && (first === 0x04 || first === 0x06 || first === 0x07)) {\n    x = BN.fromBuffer(publicKey.slice(1, 33))\n    y = BN.fromBuffer(publicKey.slice(33, 65))\n\n    // overflow\n    if (x.ucmp(BN.p) >= 0 || y.ucmp(BN.p) >= 0) return null\n\n    // is odd flag\n    if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null\n\n    // x*x*x + 7 = y*y\n    if (x.redSqr().redMul(x).redIAdd7().ucmp(y.redSqr()) !== 0) return null\n\n    return new ECPoint(x, y)\n  }\n\n  return null\n}\n\nECPoint.prototype.toPublicKey = function (compressed) {\n  var x = this.x\n  var y = this.y\n  var publicKey\n\n  if (compressed) {\n    publicKey = Buffer.alloc(33)\n    publicKey[0] = y.isOdd() ? 0x03 : 0x02\n    x.toBuffer().copy(publicKey, 1)\n  } else {\n    publicKey = Buffer.alloc(65)\n    publicKey[0] = 0x04\n    x.toBuffer().copy(publicKey, 1)\n    y.toBuffer().copy(publicKey, 33)\n  }\n\n  return publicKey\n}\n\nECPoint.fromECJPoint = function (p) {\n  if (p.inf) return new ECPoint(null, null)\n\n  var zinv = p.z.redInvm()\n  var zinv2 = zinv.redSqr()\n  var ax = p.x.redMul(zinv2)\n  var ay = p.y.redMul(zinv2).redMul(zinv)\n\n  return new ECPoint(ax, ay)\n}\n\nECPoint.prototype.toECJPoint = function () {\n  if (this.inf) return new ECJPoint(null, null, null)\n\n  return new ECJPoint(this.x, this.y, ECJPoint.one)\n}\n\nECPoint.prototype.neg = function () {\n  if (this.inf) return this\n\n  return new ECPoint(this.x, this.y.redNeg())\n}\n\nECPoint.prototype.add = function (p) {\n  // O + P = P\n  if (this.inf) return p\n\n  // P + O = P\n  if (p.inf) return this\n\n  if (this.x.ucmp(p.x) === 0) {\n    // P + P = 2P\n    if (this.y.ucmp(p.y) === 0) return this.dbl()\n    // P + (-P) = O\n    return new ECPoint(null, null)\n  }\n\n  // s = (y - yp) / (x - xp)\n  // nx = s^2 - x - xp\n  // ny = s * (x - nx) - y\n  var s = this.y.redSub(p.y)\n  if (!s.isZero()) s = s.redMul(this.x.redSub(p.x).redInvm())\n\n  var nx = s.redSqr().redISub(this.x).redISub(p.x)\n  var ny = s.redMul(this.x.redSub(nx)).redISub(this.y)\n  return new ECPoint(nx, ny)\n}\n\nECPoint.prototype.dbl = function () {\n  if (this.inf) return this\n\n  // 2P = O\n  var yy = this.y.redAdd(this.y)\n  if (yy.isZero()) return new ECPoint(null, null)\n\n  // s = (3 * x^2) / (2 * y)\n  // nx = s^2 - 2*x\n  // ny = s * (x - nx) - y\n  var x2 = this.x.redSqr()\n  var s = x2.redAdd(x2).redIAdd(x2).redMul(yy.redInvm())\n\n  var nx = s.redSqr().redISub(this.x.redAdd(this.x))\n  var ny = s.redMul(this.x.redSub(nx)).redISub(this.y)\n  return new ECPoint(nx, ny)\n}\n\nECPoint.prototype.mul = function (num) {\n  // Algorithm 3.36 Window NAF method for point multiplication\n  var nafPoints = this._getNAFPoints(4)\n  var points = nafPoints.points\n\n  // Get NAF form\n  var naf = num.getNAF(nafPoints.wnd)\n\n  // Add `this`*(N+1) for every w-NAF index\n  var acc = new ECJPoint(null, null, null)\n  for (var i = naf.length - 1; i >= 0; i--) {\n    // Count zeroes\n    for (var k = 0; i >= 0 && naf[i] === 0; i--, ++k);\n    if (i >= 0) k += 1\n    acc = acc.dblp(k)\n\n    if (i < 0) break\n\n    // J +- P\n    var z = naf[i]\n    if (z > 0) {\n      acc = acc.mixedAdd(points[(z - 1) >> 1])\n    } else {\n      acc = acc.mixedAdd(points[(-z - 1) >> 1].neg())\n    }\n  }\n\n  return ECPoint.fromECJPoint(acc)\n}\n\nECPoint.prototype._getNAFPoints1 = function () {\n  return { wnd: 1, points: [this] }\n}\n\nECPoint.prototype._getNAFPoints = function (wnd) {\n  var points = new Array((1 << wnd) - 1)\n  points[0] = this\n  var dbl = this.dbl()\n  for (var i = 1; i < points.length; ++i) points[i] = points[i - 1].add(dbl)\n  return { wnd: wnd, points: points }\n}\n\nmodule.exports = ECPoint\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/ecpoint.js\n// module id = 533\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/ecpoint.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\n    "use strict";\n\n    if (global.setImmediate) {\n        return;\n    }\n\n    var nextHandle = 1; // Spec says greater than zero\n    var tasksByHandle = {};\n    var currentlyRunningATask = false;\n    var doc = global.document;\n    var registerImmediate;\n\n    function setImmediate(callback) {\n      // Callback can either be a function or a string\n      if (typeof callback !== "function") {\n        callback = new Function("" + callback);\n      }\n      // Copy function arguments\n      var args = new Array(arguments.length - 1);\n      for (var i = 0; i < args.length; i++) {\n          args[i] = arguments[i + 1];\n      }\n      // Store and register the task\n      var task = { callback: callback, args: args };\n      tasksByHandle[nextHandle] = task;\n      registerImmediate(nextHandle);\n      return nextHandle++;\n    }\n\n    function clearImmediate(handle) {\n        delete tasksByHandle[handle];\n    }\n\n    function run(task) {\n        var callback = task.callback;\n        var args = task.args;\n        switch (args.length) {\n        case 0:\n            callback();\n            break;\n        case 1:\n            callback(args[0]);\n            break;\n        case 2:\n            callback(args[0], args[1]);\n            break;\n        case 3:\n            callback(args[0], args[1], args[2]);\n            break;\n        default:\n            callback.apply(undefined, args);\n            break;\n        }\n    }\n\n    function runIfPresent(handle) {\n        // From the spec: "Wait until any invocations of this algorithm started before this one have completed."\n        // So if we\'re currently running a task, we\'ll need to delay this invocation.\n        if (currentlyRunningATask) {\n            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\n            // "too much recursion" error.\n            setTimeout(runIfPresent, 0, handle);\n        } else {\n            var task = tasksByHandle[handle];\n            if (task) {\n                currentlyRunningATask = true;\n                try {\n                    run(task);\n                } finally {\n                    clearImmediate(handle);\n                    currentlyRunningATask = false;\n                }\n            }\n        }\n    }\n\n    function installNextTickImplementation() {\n        registerImmediate = function(handle) {\n            process.nextTick(function () { runIfPresent(handle); });\n        };\n    }\n\n    function canUsePostMessage() {\n        // The test against `importScripts` prevents this implementation from being installed inside a web worker,\n        // where `global.postMessage` means something completely different and can\'t be used for this purpose.\n        if (global.postMessage && !global.importScripts) {\n            var postMessageIsAsynchronous = true;\n            var oldOnMessage = global.onmessage;\n            global.onmessage = function() {\n                postMessageIsAsynchronous = false;\n            };\n            global.postMessage("", "*");\n            global.onmessage = oldOnMessage;\n            return postMessageIsAsynchronous;\n        }\n    }\n\n    function installPostMessageImplementation() {\n        // Installs an event handler on `global` for the `message` event: see\n        // * https://developer.mozilla.org/en/DOM/window.postMessage\n        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\n\n        var messagePrefix = "setImmediate$" + Math.random() + "$";\n        var onGlobalMessage = function(event) {\n            if (event.source === global &&\n                typeof event.data === "string" &&\n                event.data.indexOf(messagePrefix) === 0) {\n                runIfPresent(+event.data.slice(messagePrefix.length));\n            }\n        };\n\n        if (global.addEventListener) {\n            global.addEventListener("message", onGlobalMessage, false);\n        } else {\n            global.attachEvent("onmessage", onGlobalMessage);\n        }\n\n        registerImmediate = function(handle) {\n            global.postMessage(messagePrefix + handle, "*");\n        };\n    }\n\n    function installMessageChannelImplementation() {\n        var channel = new MessageChannel();\n        channel.port1.onmessage = function(event) {\n            var handle = event.data;\n            runIfPresent(handle);\n        };\n\n        registerImmediate = function(handle) {\n            channel.port2.postMessage(handle);\n        };\n    }\n\n    function installReadyStateChangeImplementation() {\n        var html = doc.documentElement;\n        registerImmediate = function(handle) {\n            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n            // into the document. Do so, thus queuing up the task. Remember to clean up once it\'s been called.\n            var script = doc.createElement("script");\n            script.onreadystatechange = function () {\n                runIfPresent(handle);\n                script.onreadystatechange = null;\n                html.removeChild(script);\n                script = null;\n            };\n            html.appendChild(script);\n        };\n    }\n\n    function installSetTimeoutImplementation() {\n        registerImmediate = function(handle) {\n            setTimeout(runIfPresent, 0, handle);\n        };\n    }\n\n    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\n    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\n    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\n\n    // Don\'t get fooled by e.g. browserify environments.\n    if ({}.toString.call(global.process) === "[object process]") {\n        // For Node.js before 0.9\n        installNextTickImplementation();\n\n    } else if (canUsePostMessage()) {\n        // For non-IE10 modern browsers\n        installPostMessageImplementation();\n\n    } else if (global.MessageChannel) {\n        // For web workers, where supported\n        installMessageChannelImplementation();\n\n    } else if (doc && "onreadystatechange" in doc.createElement("script")) {\n        // For IE 6–8\n        installReadyStateChangeImplementation();\n\n    } else {\n        // For older browsers\n        installSetTimeoutImplementation();\n    }\n\n    attachTo.setImmediate = setImmediate;\n    attachTo.clearImmediate = clearImmediate;\n}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/setimmediate/setImmediate.js\n// module id = 534\n// module chunks = 0\n\n//# sourceURL=../node_modules/setimmediate/setImmediate.js')},function(module,exports,__webpack_require__){eval("/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = __webpack_require__(3)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar K = [\n  0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\n  0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\n  0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\n  0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\n  0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\n  0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\n  0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\n  0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\n  0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\n  0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\n  0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\n  0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\n  0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\n  0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\n  0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\n  0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\n]\n\nvar W = new Array(64)\n\nfunction Sha256 () {\n  this.init()\n\n  this._w = W // new Array(64)\n\n  Hash.call(this, 64, 56)\n}\n\ninherits(Sha256, Hash)\n\nSha256.prototype.init = function () {\n  this._a = 0x6a09e667\n  this._b = 0xbb67ae85\n  this._c = 0x3c6ef372\n  this._d = 0xa54ff53a\n  this._e = 0x510e527f\n  this._f = 0x9b05688c\n  this._g = 0x1f83d9ab\n  this._h = 0x5be0cd19\n\n  return this\n}\n\nfunction ch (x, y, z) {\n  return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n  return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x) {\n  return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\n}\n\nfunction sigma1 (x) {\n  return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\n}\n\nfunction gamma0 (x) {\n  return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\n}\n\nfunction gamma1 (x) {\n  return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\n}\n\nSha256.prototype._update = function (M) {\n  var W = this._w\n\n  var a = this._a | 0\n  var b = this._b | 0\n  var c = this._c | 0\n  var d = this._d | 0\n  var e = this._e | 0\n  var f = this._f | 0\n  var g = this._g | 0\n  var h = this._h | 0\n\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n  for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\n\n  for (var j = 0; j < 64; ++j) {\n    var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\n    var T2 = (sigma0(a) + maj(a, b, c)) | 0\n\n    h = g\n    g = f\n    f = e\n    e = (d + T1) | 0\n    d = c\n    c = b\n    b = a\n    a = (T1 + T2) | 0\n  }\n\n  this._a = (a + this._a) | 0\n  this._b = (b + this._b) | 0\n  this._c = (c + this._c) | 0\n  this._d = (d + this._d) | 0\n  this._e = (e + this._e) | 0\n  this._f = (f + this._f) | 0\n  this._g = (g + this._g) | 0\n  this._h = (h + this._h) | 0\n}\n\nSha256.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(32)\n\n  H.writeInt32BE(this._a, 0)\n  H.writeInt32BE(this._b, 4)\n  H.writeInt32BE(this._c, 8)\n  H.writeInt32BE(this._d, 12)\n  H.writeInt32BE(this._e, 16)\n  H.writeInt32BE(this._f, 20)\n  H.writeInt32BE(this._g, 24)\n  H.writeInt32BE(this._h, 28)\n\n  return H\n}\n\nmodule.exports = Sha256\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha256.js\n// module id = 535\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha256.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n]\n\nvar W = new Array(160)\n\nfunction Sha512 () {\n  this.init()\n  this._w = W\n\n  Hash.call(this, 128, 112)\n}\n\ninherits(Sha512, Hash)\n\nSha512.prototype.init = function () {\n  this._ah = 0x6a09e667\n  this._bh = 0xbb67ae85\n  this._ch = 0x3c6ef372\n  this._dh = 0xa54ff53a\n  this._eh = 0x510e527f\n  this._fh = 0x9b05688c\n  this._gh = 0x1f83d9ab\n  this._hh = 0x5be0cd19\n\n  this._al = 0xf3bcc908\n  this._bl = 0x84caa73b\n  this._cl = 0xfe94f82b\n  this._dl = 0x5f1d36f1\n  this._el = 0xade682d1\n  this._fl = 0x2b3e6c1f\n  this._gl = 0xfb41bd6b\n  this._hl = 0x137e2179\n\n  return this\n}\n\nfunction Ch (x, y, z) {\n  return z ^ (x & (y ^ z))\n}\n\nfunction maj (x, y, z) {\n  return (x & y) | (z & (x | y))\n}\n\nfunction sigma0 (x, xl) {\n  return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\n}\n\nfunction sigma1 (x, xl) {\n  return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\n}\n\nfunction Gamma0 (x, xl) {\n  return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\n}\n\nfunction Gamma0l (x, xl) {\n  return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\n}\n\nfunction Gamma1 (x, xl) {\n  return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\n}\n\nfunction Gamma1l (x, xl) {\n  return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\n}\n\nfunction getCarry (a, b) {\n  return (a >>> 0) < (b >>> 0) ? 1 : 0\n}\n\nSha512.prototype._update = function (M) {\n  var W = this._w\n\n  var ah = this._ah | 0\n  var bh = this._bh | 0\n  var ch = this._ch | 0\n  var dh = this._dh | 0\n  var eh = this._eh | 0\n  var fh = this._fh | 0\n  var gh = this._gh | 0\n  var hh = this._hh | 0\n\n  var al = this._al | 0\n  var bl = this._bl | 0\n  var cl = this._cl | 0\n  var dl = this._dl | 0\n  var el = this._el | 0\n  var fl = this._fl | 0\n  var gl = this._gl | 0\n  var hl = this._hl | 0\n\n  for (var i = 0; i < 32; i += 2) {\n    W[i] = M.readInt32BE(i * 4)\n    W[i + 1] = M.readInt32BE(i * 4 + 4)\n  }\n  for (; i < 160; i += 2) {\n    var xh = W[i - 15 * 2]\n    var xl = W[i - 15 * 2 + 1]\n    var gamma0 = Gamma0(xh, xl)\n    var gamma0l = Gamma0l(xl, xh)\n\n    xh = W[i - 2 * 2]\n    xl = W[i - 2 * 2 + 1]\n    var gamma1 = Gamma1(xh, xl)\n    var gamma1l = Gamma1l(xl, xh)\n\n    // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n    var Wi7h = W[i - 7 * 2]\n    var Wi7l = W[i - 7 * 2 + 1]\n\n    var Wi16h = W[i - 16 * 2]\n    var Wi16l = W[i - 16 * 2 + 1]\n\n    var Wil = (gamma0l + Wi7l) | 0\n    var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\n    Wil = (Wil + gamma1l) | 0\n    Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\n    Wil = (Wil + Wi16l) | 0\n    Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\n\n    W[i] = Wih\n    W[i + 1] = Wil\n  }\n\n  for (var j = 0; j < 160; j += 2) {\n    Wih = W[j]\n    Wil = W[j + 1]\n\n    var majh = maj(ah, bh, ch)\n    var majl = maj(al, bl, cl)\n\n    var sigma0h = sigma0(ah, al)\n    var sigma0l = sigma0(al, ah)\n    var sigma1h = sigma1(eh, el)\n    var sigma1l = sigma1(el, eh)\n\n    // t1 = h + sigma1 + ch + K[j] + W[j]\n    var Kih = K[j]\n    var Kil = K[j + 1]\n\n    var chh = Ch(eh, fh, gh)\n    var chl = Ch(el, fl, gl)\n\n    var t1l = (hl + sigma1l) | 0\n    var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\n    t1l = (t1l + chl) | 0\n    t1h = (t1h + chh + getCarry(t1l, chl)) | 0\n    t1l = (t1l + Kil) | 0\n    t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\n    t1l = (t1l + Wil) | 0\n    t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\n\n    // t2 = sigma0 + maj\n    var t2l = (sigma0l + majl) | 0\n    var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\n\n    hh = gh\n    hl = gl\n    gh = fh\n    gl = fl\n    fh = eh\n    fl = el\n    el = (dl + t1l) | 0\n    eh = (dh + t1h + getCarry(el, dl)) | 0\n    dh = ch\n    dl = cl\n    ch = bh\n    cl = bl\n    bh = ah\n    bl = al\n    al = (t1l + t2l) | 0\n    ah = (t1h + t2h + getCarry(al, t1l)) | 0\n  }\n\n  this._al = (this._al + al) | 0\n  this._bl = (this._bl + bl) | 0\n  this._cl = (this._cl + cl) | 0\n  this._dl = (this._dl + dl) | 0\n  this._el = (this._el + el) | 0\n  this._fl = (this._fl + fl) | 0\n  this._gl = (this._gl + gl) | 0\n  this._hl = (this._hl + hl) | 0\n\n  this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\n  this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\n  this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\n  this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\n  this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\n  this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\n  this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\n  this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\n}\n\nSha512.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(64)\n\n  function writeInt64BE (h, l, offset) {\n    H.writeInt32BE(h, offset)\n    H.writeInt32BE(l, offset + 4)\n  }\n\n  writeInt64BE(this._ah, this._al, 0)\n  writeInt64BE(this._bh, this._bl, 8)\n  writeInt64BE(this._ch, this._cl, 16)\n  writeInt64BE(this._dh, this._dl, 24)\n  writeInt64BE(this._eh, this._el, 32)\n  writeInt64BE(this._fh, this._fl, 40)\n  writeInt64BE(this._gh, this._gl, 48)\n  writeInt64BE(this._hh, this._hl, 56)\n\n  return H\n}\n\nmodule.exports = Sha512\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha512.js\n// module id = 536\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha512.js")},function(module,exports,__webpack_require__){eval("\n/**\n * Module dependencies.\n */\n\nvar url = __webpack_require__(1238);\nvar parser = __webpack_require__(309);\nvar Manager = __webpack_require__(538);\nvar debug = __webpack_require__(5)('socket.io-client');\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = lookup;\n\n/**\n * Managers cache.\n */\n\nvar cache = exports.managers = {};\n\n/**\n * Looks up an existing `Manager` for multiplexing.\n * If the user summons:\n *\n *   `io('http://localhost/a');`\n *   `io('http://localhost/b');`\n *\n * We reuse the existing instance based on same scheme/port/host,\n * and we initialize sockets for each namespace.\n *\n * @api public\n */\n\nfunction lookup (uri, opts) {\n  if (typeof uri === 'object') {\n    opts = uri;\n    uri = undefined;\n  }\n\n  opts = opts || {};\n\n  var parsed = url(uri);\n  var source = parsed.source;\n  var id = parsed.id;\n  var path = parsed.path;\n  var sameNamespace = cache[id] && path in cache[id].nsps;\n  var newConnection = opts.forceNew || opts['force new connection'] ||\n                      false === opts.multiplex || sameNamespace;\n\n  var io;\n\n  if (newConnection) {\n    debug('ignoring socket cache for %s', source);\n    io = Manager(source, opts);\n  } else {\n    if (!cache[id]) {\n      debug('new io instance for %s', source);\n      cache[id] = Manager(source, opts);\n    }\n    io = cache[id];\n  }\n  if (parsed.query && !opts.query) {\n    opts.query = parsed.query;\n  }\n  return io.socket(parsed.path, opts);\n}\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nexports.protocol = parser.protocol;\n\n/**\n * `connect`.\n *\n * @param {String} uri\n * @api public\n */\n\nexports.connect = lookup;\n\n/**\n * Expose constructors for standalone build.\n *\n * @api public\n */\n\nexports.Manager = __webpack_require__(538);\nexports.Socket = __webpack_require__(540);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-client/lib/index.js\n// module id = 537\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-client/lib/index.js")},function(module,exports,__webpack_require__){eval("\n/**\n * Module dependencies.\n */\n\nvar eio = __webpack_require__(834);\nvar Socket = __webpack_require__(540);\nvar Emitter = __webpack_require__(115);\nvar parser = __webpack_require__(309);\nvar on = __webpack_require__(539);\nvar bind = __webpack_require__(358);\nvar debug = __webpack_require__(5)('socket.io-client:manager');\nvar indexOf = __webpack_require__(264);\nvar Backoff = __webpack_require__(618);\n\n/**\n * IE6+ hasOwnProperty\n */\n\nvar has = Object.prototype.hasOwnProperty;\n\n/**\n * Module exports\n */\n\nmodule.exports = Manager;\n\n/**\n * `Manager` constructor.\n *\n * @param {String} engine instance or engine uri/opts\n * @param {Object} options\n * @api public\n */\n\nfunction Manager (uri, opts) {\n  if (!(this instanceof Manager)) return new Manager(uri, opts);\n  if (uri && ('object' === typeof uri)) {\n    opts = uri;\n    uri = undefined;\n  }\n  opts = opts || {};\n\n  opts.path = opts.path || '/socket.io';\n  this.nsps = {};\n  this.subs = [];\n  this.opts = opts;\n  this.reconnection(opts.reconnection !== false);\n  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n  this.randomizationFactor(opts.randomizationFactor || 0.5);\n  this.backoff = new Backoff({\n    min: this.reconnectionDelay(),\n    max: this.reconnectionDelayMax(),\n    jitter: this.randomizationFactor()\n  });\n  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n  this.readyState = 'closed';\n  this.uri = uri;\n  this.connecting = [];\n  this.lastPing = null;\n  this.encoding = false;\n  this.packetBuffer = [];\n  var _parser = opts.parser || parser;\n  this.encoder = new _parser.Encoder();\n  this.decoder = new _parser.Decoder();\n  this.autoConnect = opts.autoConnect !== false;\n  if (this.autoConnect) this.open();\n}\n\n/**\n * Propagate given event to sockets and emit on `this`\n *\n * @api private\n */\n\nManager.prototype.emitAll = function () {\n  this.emit.apply(this, arguments);\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n    }\n  }\n};\n\n/**\n * Update `socket.id` of all sockets\n *\n * @api private\n */\n\nManager.prototype.updateSocketIds = function () {\n  for (var nsp in this.nsps) {\n    if (has.call(this.nsps, nsp)) {\n      this.nsps[nsp].id = this.generateId(nsp);\n    }\n  }\n};\n\n/**\n * generate `socket.id` for the given `nsp`\n *\n * @param {String} nsp\n * @return {String}\n * @api private\n */\n\nManager.prototype.generateId = function (nsp) {\n  return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;\n};\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Manager.prototype);\n\n/**\n * Sets the `reconnection` config.\n *\n * @param {Boolean} true/false if it should automatically reconnect\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnection = function (v) {\n  if (!arguments.length) return this._reconnection;\n  this._reconnection = !!v;\n  return this;\n};\n\n/**\n * Sets the reconnection attempts config.\n *\n * @param {Number} max reconnection attempts before giving up\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionAttempts = function (v) {\n  if (!arguments.length) return this._reconnectionAttempts;\n  this._reconnectionAttempts = v;\n  return this;\n};\n\n/**\n * Sets the delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelay = function (v) {\n  if (!arguments.length) return this._reconnectionDelay;\n  this._reconnectionDelay = v;\n  this.backoff && this.backoff.setMin(v);\n  return this;\n};\n\nManager.prototype.randomizationFactor = function (v) {\n  if (!arguments.length) return this._randomizationFactor;\n  this._randomizationFactor = v;\n  this.backoff && this.backoff.setJitter(v);\n  return this;\n};\n\n/**\n * Sets the maximum delay between reconnections.\n *\n * @param {Number} delay\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.reconnectionDelayMax = function (v) {\n  if (!arguments.length) return this._reconnectionDelayMax;\n  this._reconnectionDelayMax = v;\n  this.backoff && this.backoff.setMax(v);\n  return this;\n};\n\n/**\n * Sets the connection timeout. `false` to disable\n *\n * @return {Manager} self or value\n * @api public\n */\n\nManager.prototype.timeout = function (v) {\n  if (!arguments.length) return this._timeout;\n  this._timeout = v;\n  return this;\n};\n\n/**\n * Starts trying to reconnect if reconnection is enabled and we have not\n * started reconnecting yet\n *\n * @api private\n */\n\nManager.prototype.maybeReconnectOnOpen = function () {\n  // Only try to reconnect if it's the first time we're connecting\n  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n    // keeps reconnection from firing twice for the same reconnection loop\n    this.reconnect();\n  }\n};\n\n/**\n * Sets the current transport `socket`.\n *\n * @param {Function} optional, callback\n * @return {Manager} self\n * @api public\n */\n\nManager.prototype.open =\nManager.prototype.connect = function (fn, opts) {\n  debug('readyState %s', this.readyState);\n  if (~this.readyState.indexOf('open')) return this;\n\n  debug('opening %s', this.uri);\n  this.engine = eio(this.uri, this.opts);\n  var socket = this.engine;\n  var self = this;\n  this.readyState = 'opening';\n  this.skipReconnect = false;\n\n  // emit `open`\n  var openSub = on(socket, 'open', function () {\n    self.onopen();\n    fn && fn();\n  });\n\n  // emit `connect_error`\n  var errorSub = on(socket, 'error', function (data) {\n    debug('connect_error');\n    self.cleanup();\n    self.readyState = 'closed';\n    self.emitAll('connect_error', data);\n    if (fn) {\n      var err = new Error('Connection error');\n      err.data = data;\n      fn(err);\n    } else {\n      // Only do this if there is no fn to handle the error\n      self.maybeReconnectOnOpen();\n    }\n  });\n\n  // emit `connect_timeout`\n  if (false !== this._timeout) {\n    var timeout = this._timeout;\n    debug('connect attempt will timeout after %d', timeout);\n\n    // set timer\n    var timer = setTimeout(function () {\n      debug('connect attempt timed out after %d', timeout);\n      openSub.destroy();\n      socket.close();\n      socket.emit('error', 'timeout');\n      self.emitAll('connect_timeout', timeout);\n    }, timeout);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n\n  this.subs.push(openSub);\n  this.subs.push(errorSub);\n\n  return this;\n};\n\n/**\n * Called upon transport open.\n *\n * @api private\n */\n\nManager.prototype.onopen = function () {\n  debug('open');\n\n  // clear old subs\n  this.cleanup();\n\n  // mark as open\n  this.readyState = 'open';\n  this.emit('open');\n\n  // add new subs\n  var socket = this.engine;\n  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n};\n\n/**\n * Called upon a ping.\n *\n * @api private\n */\n\nManager.prototype.onping = function () {\n  this.lastPing = new Date();\n  this.emitAll('ping');\n};\n\n/**\n * Called upon a packet.\n *\n * @api private\n */\n\nManager.prototype.onpong = function () {\n  this.emitAll('pong', new Date() - this.lastPing);\n};\n\n/**\n * Called with data.\n *\n * @api private\n */\n\nManager.prototype.ondata = function (data) {\n  this.decoder.add(data);\n};\n\n/**\n * Called when parser fully decodes a packet.\n *\n * @api private\n */\n\nManager.prototype.ondecoded = function (packet) {\n  this.emit('packet', packet);\n};\n\n/**\n * Called upon socket error.\n *\n * @api private\n */\n\nManager.prototype.onerror = function (err) {\n  debug('error', err);\n  this.emitAll('error', err);\n};\n\n/**\n * Creates a new socket for the given `nsp`.\n *\n * @return {Socket}\n * @api public\n */\n\nManager.prototype.socket = function (nsp, opts) {\n  var socket = this.nsps[nsp];\n  if (!socket) {\n    socket = new Socket(this, nsp, opts);\n    this.nsps[nsp] = socket;\n    var self = this;\n    socket.on('connecting', onConnecting);\n    socket.on('connect', function () {\n      socket.id = self.generateId(nsp);\n    });\n\n    if (this.autoConnect) {\n      // manually call here since connecting event is fired before listening\n      onConnecting();\n    }\n  }\n\n  function onConnecting () {\n    if (!~indexOf(self.connecting, socket)) {\n      self.connecting.push(socket);\n    }\n  }\n\n  return socket;\n};\n\n/**\n * Called upon a socket close.\n *\n * @param {Socket} socket\n */\n\nManager.prototype.destroy = function (socket) {\n  var index = indexOf(this.connecting, socket);\n  if (~index) this.connecting.splice(index, 1);\n  if (this.connecting.length) return;\n\n  this.close();\n};\n\n/**\n * Writes a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nManager.prototype.packet = function (packet) {\n  debug('writing packet %j', packet);\n  var self = this;\n  if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;\n\n  if (!self.encoding) {\n    // encode, then write to engine with result\n    self.encoding = true;\n    this.encoder.encode(packet, function (encodedPackets) {\n      for (var i = 0; i < encodedPackets.length; i++) {\n        self.engine.write(encodedPackets[i], packet.options);\n      }\n      self.encoding = false;\n      self.processPacketQueue();\n    });\n  } else { // add packet to the queue\n    self.packetBuffer.push(packet);\n  }\n};\n\n/**\n * If packet buffer is non-empty, begins encoding the\n * next packet in line.\n *\n * @api private\n */\n\nManager.prototype.processPacketQueue = function () {\n  if (this.packetBuffer.length > 0 && !this.encoding) {\n    var pack = this.packetBuffer.shift();\n    this.packet(pack);\n  }\n};\n\n/**\n * Clean up transport subscriptions and packet buffer.\n *\n * @api private\n */\n\nManager.prototype.cleanup = function () {\n  debug('cleanup');\n\n  var subsLength = this.subs.length;\n  for (var i = 0; i < subsLength; i++) {\n    var sub = this.subs.shift();\n    sub.destroy();\n  }\n\n  this.packetBuffer = [];\n  this.encoding = false;\n  this.lastPing = null;\n\n  this.decoder.destroy();\n};\n\n/**\n * Close the current socket.\n *\n * @api private\n */\n\nManager.prototype.close =\nManager.prototype.disconnect = function () {\n  debug('disconnect');\n  this.skipReconnect = true;\n  this.reconnecting = false;\n  if ('opening' === this.readyState) {\n    // `onclose` will not fire because\n    // an open event never happened\n    this.cleanup();\n  }\n  this.backoff.reset();\n  this.readyState = 'closed';\n  if (this.engine) this.engine.close();\n};\n\n/**\n * Called upon engine close.\n *\n * @api private\n */\n\nManager.prototype.onclose = function (reason) {\n  debug('onclose');\n\n  this.cleanup();\n  this.backoff.reset();\n  this.readyState = 'closed';\n  this.emit('close', reason);\n\n  if (this._reconnection && !this.skipReconnect) {\n    this.reconnect();\n  }\n};\n\n/**\n * Attempt a reconnection.\n *\n * @api private\n */\n\nManager.prototype.reconnect = function () {\n  if (this.reconnecting || this.skipReconnect) return this;\n\n  var self = this;\n\n  if (this.backoff.attempts >= this._reconnectionAttempts) {\n    debug('reconnect failed');\n    this.backoff.reset();\n    this.emitAll('reconnect_failed');\n    this.reconnecting = false;\n  } else {\n    var delay = this.backoff.duration();\n    debug('will wait %dms before reconnect attempt', delay);\n\n    this.reconnecting = true;\n    var timer = setTimeout(function () {\n      if (self.skipReconnect) return;\n\n      debug('attempting reconnect');\n      self.emitAll('reconnect_attempt', self.backoff.attempts);\n      self.emitAll('reconnecting', self.backoff.attempts);\n\n      // check again for the case socket closed in above events\n      if (self.skipReconnect) return;\n\n      self.open(function (err) {\n        if (err) {\n          debug('reconnect attempt error');\n          self.reconnecting = false;\n          self.reconnect();\n          self.emitAll('reconnect_error', err.data);\n        } else {\n          debug('reconnect success');\n          self.onreconnect();\n        }\n      });\n    }, delay);\n\n    this.subs.push({\n      destroy: function () {\n        clearTimeout(timer);\n      }\n    });\n  }\n};\n\n/**\n * Called upon successful reconnect.\n *\n * @api private\n */\n\nManager.prototype.onreconnect = function () {\n  var attempt = this.backoff.attempts;\n  this.reconnecting = false;\n  this.backoff.reset();\n  this.updateSocketIds();\n  this.emitAll('reconnect', attempt);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-client/lib/manager.js\n// module id = 538\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-client/lib/manager.js")},function(module,exports){eval("\n/**\n * Module exports.\n */\n\nmodule.exports = on;\n\n/**\n * Helper for subscriptions.\n *\n * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n * @param {String} event name\n * @param {Function} callback\n * @api public\n */\n\nfunction on (obj, ev, fn) {\n  obj.on(ev, fn);\n  return {\n    destroy: function () {\n      obj.removeListener(ev, fn);\n    }\n  };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-client/lib/on.js\n// module id = 539\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-client/lib/on.js")},function(module,exports,__webpack_require__){eval("\n/**\n * Module dependencies.\n */\n\nvar parser = __webpack_require__(309);\nvar Emitter = __webpack_require__(115);\nvar toArray = __webpack_require__(1249);\nvar on = __webpack_require__(539);\nvar bind = __webpack_require__(358);\nvar debug = __webpack_require__(5)('socket.io-client:socket');\nvar parseqs = __webpack_require__(201);\nvar hasBin = __webpack_require__(409);\n\n/**\n * Module exports.\n */\n\nmodule.exports = exports = Socket;\n\n/**\n * Internal events (blacklisted).\n * These events can't be emitted by the user.\n *\n * @api private\n */\n\nvar events = {\n  connect: 1,\n  connect_error: 1,\n  connect_timeout: 1,\n  connecting: 1,\n  disconnect: 1,\n  error: 1,\n  reconnect: 1,\n  reconnect_attempt: 1,\n  reconnect_failed: 1,\n  reconnect_error: 1,\n  reconnecting: 1,\n  ping: 1,\n  pong: 1\n};\n\n/**\n * Shortcut to `Emitter#emit`.\n */\n\nvar emit = Emitter.prototype.emit;\n\n/**\n * `Socket` constructor.\n *\n * @api public\n */\n\nfunction Socket (io, nsp, opts) {\n  this.io = io;\n  this.nsp = nsp;\n  this.json = this; // compat\n  this.ids = 0;\n  this.acks = {};\n  this.receiveBuffer = [];\n  this.sendBuffer = [];\n  this.connected = false;\n  this.disconnected = true;\n  this.flags = {};\n  if (opts && opts.query) {\n    this.query = opts.query;\n  }\n  if (this.io.autoConnect) this.open();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Subscribe to open, close and packet events\n *\n * @api private\n */\n\nSocket.prototype.subEvents = function () {\n  if (this.subs) return;\n\n  var io = this.io;\n  this.subs = [\n    on(io, 'open', bind(this, 'onopen')),\n    on(io, 'packet', bind(this, 'onpacket')),\n    on(io, 'close', bind(this, 'onclose'))\n  ];\n};\n\n/**\n * \"Opens\" the socket.\n *\n * @api public\n */\n\nSocket.prototype.open =\nSocket.prototype.connect = function () {\n  if (this.connected) return this;\n\n  this.subEvents();\n  this.io.open(); // ensure open\n  if ('open' === this.io.readyState) this.onopen();\n  this.emit('connecting');\n  return this;\n};\n\n/**\n * Sends a `message` event.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.send = function () {\n  var args = toArray(arguments);\n  args.unshift('message');\n  this.emit.apply(this, args);\n  return this;\n};\n\n/**\n * Override `emit`.\n * If the event is in `events`, it's emitted normally.\n *\n * @param {String} event name\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.emit = function (ev) {\n  if (events.hasOwnProperty(ev)) {\n    emit.apply(this, arguments);\n    return this;\n  }\n\n  var args = toArray(arguments);\n  var packet = {\n    type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,\n    data: args\n  };\n\n  packet.options = {};\n  packet.options.compress = !this.flags || false !== this.flags.compress;\n\n  // event ack callback\n  if ('function' === typeof args[args.length - 1]) {\n    debug('emitting packet with ack id %d', this.ids);\n    this.acks[this.ids] = args.pop();\n    packet.id = this.ids++;\n  }\n\n  if (this.connected) {\n    this.packet(packet);\n  } else {\n    this.sendBuffer.push(packet);\n  }\n\n  this.flags = {};\n\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.packet = function (packet) {\n  packet.nsp = this.nsp;\n  this.io.packet(packet);\n};\n\n/**\n * Called upon engine `open`.\n *\n * @api private\n */\n\nSocket.prototype.onopen = function () {\n  debug('transport is open - connecting');\n\n  // write connect packet if necessary\n  if ('/' !== this.nsp) {\n    if (this.query) {\n      var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;\n      debug('sending connect packet with query %s', query);\n      this.packet({type: parser.CONNECT, query: query});\n    } else {\n      this.packet({type: parser.CONNECT});\n    }\n  }\n};\n\n/**\n * Called upon engine `close`.\n *\n * @param {String} reason\n * @api private\n */\n\nSocket.prototype.onclose = function (reason) {\n  debug('close (%s)', reason);\n  this.connected = false;\n  this.disconnected = true;\n  delete this.id;\n  this.emit('disconnect', reason);\n};\n\n/**\n * Called with socket packet.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onpacket = function (packet) {\n  var sameNamespace = packet.nsp === this.nsp;\n  var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';\n\n  if (!sameNamespace && !rootNamespaceError) return;\n\n  switch (packet.type) {\n    case parser.CONNECT:\n      this.onconnect();\n      break;\n\n    case parser.EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.BINARY_EVENT:\n      this.onevent(packet);\n      break;\n\n    case parser.ACK:\n      this.onack(packet);\n      break;\n\n    case parser.BINARY_ACK:\n      this.onack(packet);\n      break;\n\n    case parser.DISCONNECT:\n      this.ondisconnect();\n      break;\n\n    case parser.ERROR:\n      this.emit('error', packet.data);\n      break;\n  }\n};\n\n/**\n * Called upon a server event.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onevent = function (packet) {\n  var args = packet.data || [];\n  debug('emitting event %j', args);\n\n  if (null != packet.id) {\n    debug('attaching ack callback to event');\n    args.push(this.ack(packet.id));\n  }\n\n  if (this.connected) {\n    emit.apply(this, args);\n  } else {\n    this.receiveBuffer.push(args);\n  }\n};\n\n/**\n * Produces an ack callback to emit with an event.\n *\n * @api private\n */\n\nSocket.prototype.ack = function (id) {\n  var self = this;\n  var sent = false;\n  return function () {\n    // prevent double callbacks\n    if (sent) return;\n    sent = true;\n    var args = toArray(arguments);\n    debug('sending ack %j', args);\n\n    self.packet({\n      type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,\n      id: id,\n      data: args\n    });\n  };\n};\n\n/**\n * Called upon a server acknowlegement.\n *\n * @param {Object} packet\n * @api private\n */\n\nSocket.prototype.onack = function (packet) {\n  var ack = this.acks[packet.id];\n  if ('function' === typeof ack) {\n    debug('calling ack %s with %j', packet.id, packet.data);\n    ack.apply(this, packet.data);\n    delete this.acks[packet.id];\n  } else {\n    debug('bad ack %s', packet.id);\n  }\n};\n\n/**\n * Called upon server connect.\n *\n * @api private\n */\n\nSocket.prototype.onconnect = function () {\n  this.connected = true;\n  this.disconnected = false;\n  this.emit('connect');\n  this.emitBuffered();\n};\n\n/**\n * Emit buffered events (received and emitted).\n *\n * @api private\n */\n\nSocket.prototype.emitBuffered = function () {\n  var i;\n  for (i = 0; i < this.receiveBuffer.length; i++) {\n    emit.apply(this, this.receiveBuffer[i]);\n  }\n  this.receiveBuffer = [];\n\n  for (i = 0; i < this.sendBuffer.length; i++) {\n    this.packet(this.sendBuffer[i]);\n  }\n  this.sendBuffer = [];\n};\n\n/**\n * Called upon server disconnect.\n *\n * @api private\n */\n\nSocket.prototype.ondisconnect = function () {\n  debug('server disconnect (%s)', this.nsp);\n  this.destroy();\n  this.onclose('io server disconnect');\n};\n\n/**\n * Called upon forced client/server side disconnections,\n * this method ensures the manager stops tracking us and\n * that reconnections don't get triggered for this.\n *\n * @api private.\n */\n\nSocket.prototype.destroy = function () {\n  if (this.subs) {\n    // clean subscriptions to avoid reconnections\n    for (var i = 0; i < this.subs.length; i++) {\n      this.subs[i].destroy();\n    }\n    this.subs = null;\n  }\n\n  this.io.destroy(this);\n};\n\n/**\n * Disconnects the socket manually.\n *\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.close =\nSocket.prototype.disconnect = function () {\n  if (this.connected) {\n    debug('performing disconnect (%s)', this.nsp);\n    this.packet({ type: parser.DISCONNECT });\n  }\n\n  // remove socket from pool\n  this.destroy();\n\n  if (this.connected) {\n    // fire events\n    this.onclose('io client disconnect');\n  }\n  return this;\n};\n\n/**\n * Sets the compress flag.\n *\n * @param {Boolean} if `true`, compresses the sending data\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.compress = function (compress) {\n  this.flags.compress = compress;\n  return this;\n};\n\n/**\n * Sets the binary flag\n *\n * @param {Boolean} whether the emitted data contains binary\n * @return {Socket} self\n * @api public\n */\n\nSocket.prototype.binary = function (binary) {\n  this.flags.binary = binary;\n  return this;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-client/lib/socket.js\n// module id = 540\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-client/lib/socket.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\nmodule.exports = isBuf;\n\nvar withNativeBuffer = typeof global.Buffer === 'function' && typeof global.Buffer.isBuffer === 'function';\nvar withNativeArrayBuffer = typeof global.ArrayBuffer === 'function';\n\nvar isView = (function () {\n  if (withNativeArrayBuffer && typeof global.ArrayBuffer.isView === 'function') {\n    return global.ArrayBuffer.isView;\n  } else {\n    return function (obj) { return obj.buffer instanceof global.ArrayBuffer; };\n  }\n})();\n\n/**\n * Returns true if obj is a buffer or an arraybuffer.\n *\n * @api private\n */\n\nfunction isBuf(obj) {\n  return (withNativeBuffer && global.Buffer.isBuffer(obj)) ||\n          (withNativeArrayBuffer && (obj instanceof global.ArrayBuffer || isView(obj)));\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/is-buffer.js\n// module id = 541\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-parser/is-buffer.js")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/~/isarray/index.js\n// module id = 542\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-parser/node_modules/isarray/index.js")},function(module,exports,__webpack_require__){eval("var isHexPrefixed = __webpack_require__(429);\n\n/**\n * Removes '0x' from a given `String` is present\n * @param {String} str the string value\n * @return {String|Optional} a string by pass if necessary\n */\nmodule.exports = function stripHexPrefix(str) {\n  if (typeof str !== 'string') {\n    return str;\n  }\n\n  return isHexPrefixed(str) ? str.slice(2) : str;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/strip-hex-prefix/src/index.js\n// module id = 543\n// module chunks = 0\n\n//# sourceURL=../node_modules/strip-hex-prefix/src/index.js")},function(module,exports,__webpack_require__){eval('var unavailable = function unavailable() {\n  throw "This swarm.js function isn\'t available on the browser.";\n};\n\nvar fsp = { readFile: unavailable };\nvar files = { download: unavailable, safeDownloadArchived: unavailable, directoryTree: unavailable };\nvar os = { platform: unavailable, arch: unavailable };\nvar path = { join: unavailable, slice: unavailable };\nvar child_process = { spawn: unavailable };\nvar mimetype = { lookup: unavailable };\nvar defaultArchives = {};\nvar downloadUrl = null;\nvar request = __webpack_require__(1309);\nvar bytes = __webpack_require__(406);\nvar hash = __webpack_require__(1246);\nvar pick = __webpack_require__(1245);\nvar swarm = __webpack_require__(1247);\n\nmodule.exports = swarm({\n  fsp: fsp,\n  files: files,\n  os: os,\n  path: path,\n  child_process: child_process,\n  defaultArchives: defaultArchives,\n  mimetype: mimetype,\n  request: request,\n  downloadUrl: downloadUrl,\n  bytes: bytes,\n  hash: hash,\n  pick: pick\n});\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/swarm-js/lib/api-browser.js\n// module id = 544\n// module chunks = 0\n\n//# sourceURL=../node_modules/swarm-js/lib/api-browser.js')},function(module,exports){eval("var traverse = module.exports = function (obj) {\n    return new Traverse(obj);\n};\n\nfunction Traverse (obj) {\n    this.value = obj;\n}\n\nTraverse.prototype.get = function (ps) {\n    var node = this.value;\n    for (var i = 0; i < ps.length; i ++) {\n        var key = ps[i];\n        if (!node || !hasOwnProperty.call(node, key)) {\n            node = undefined;\n            break;\n        }\n        node = node[key];\n    }\n    return node;\n};\n\nTraverse.prototype.has = function (ps) {\n    var node = this.value;\n    for (var i = 0; i < ps.length; i ++) {\n        var key = ps[i];\n        if (!node || !hasOwnProperty.call(node, key)) {\n            return false;\n        }\n        node = node[key];\n    }\n    return true;\n};\n\nTraverse.prototype.set = function (ps, value) {\n    var node = this.value;\n    for (var i = 0; i < ps.length - 1; i ++) {\n        var key = ps[i];\n        if (!hasOwnProperty.call(node, key)) node[key] = {};\n        node = node[key];\n    }\n    node[ps[i]] = value;\n    return value;\n};\n\nTraverse.prototype.map = function (cb) {\n    return walk(this.value, cb, true);\n};\n\nTraverse.prototype.forEach = function (cb) {\n    this.value = walk(this.value, cb, false);\n    return this.value;\n};\n\nTraverse.prototype.reduce = function (cb, init) {\n    var skip = arguments.length === 1;\n    var acc = skip ? this.value : init;\n    this.forEach(function (x) {\n        if (!this.isRoot || !skip) {\n            acc = cb.call(this, acc, x);\n        }\n    });\n    return acc;\n};\n\nTraverse.prototype.paths = function () {\n    var acc = [];\n    this.forEach(function (x) {\n        acc.push(this.path); \n    });\n    return acc;\n};\n\nTraverse.prototype.nodes = function () {\n    var acc = [];\n    this.forEach(function (x) {\n        acc.push(this.node);\n    });\n    return acc;\n};\n\nTraverse.prototype.clone = function () {\n    var parents = [], nodes = [];\n    \n    return (function clone (src) {\n        for (var i = 0; i < parents.length; i++) {\n            if (parents[i] === src) {\n                return nodes[i];\n            }\n        }\n        \n        if (typeof src === 'object' && src !== null) {\n            var dst = copy(src);\n            \n            parents.push(src);\n            nodes.push(dst);\n            \n            forEach(objectKeys(src), function (key) {\n                dst[key] = clone(src[key]);\n            });\n            \n            parents.pop();\n            nodes.pop();\n            return dst;\n        }\n        else {\n            return src;\n        }\n    })(this.value);\n};\n\nfunction walk (root, cb, immutable) {\n    var path = [];\n    var parents = [];\n    var alive = true;\n    \n    return (function walker (node_) {\n        var node = immutable ? copy(node_) : node_;\n        var modifiers = {};\n        \n        var keepGoing = true;\n        \n        var state = {\n            node : node,\n            node_ : node_,\n            path : [].concat(path),\n            parent : parents[parents.length - 1],\n            parents : parents,\n            key : path.slice(-1)[0],\n            isRoot : path.length === 0,\n            level : path.length,\n            circular : null,\n            update : function (x, stopHere) {\n                if (!state.isRoot) {\n                    state.parent.node[state.key] = x;\n                }\n                state.node = x;\n                if (stopHere) keepGoing = false;\n            },\n            'delete' : function (stopHere) {\n                delete state.parent.node[state.key];\n                if (stopHere) keepGoing = false;\n            },\n            remove : function (stopHere) {\n                if (isArray(state.parent.node)) {\n                    state.parent.node.splice(state.key, 1);\n                }\n                else {\n                    delete state.parent.node[state.key];\n                }\n                if (stopHere) keepGoing = false;\n            },\n            keys : null,\n            before : function (f) { modifiers.before = f },\n            after : function (f) { modifiers.after = f },\n            pre : function (f) { modifiers.pre = f },\n            post : function (f) { modifiers.post = f },\n            stop : function () { alive = false },\n            block : function () { keepGoing = false }\n        };\n        \n        if (!alive) return state;\n        \n        function updateState() {\n            if (typeof state.node === 'object' && state.node !== null) {\n                if (!state.keys || state.node_ !== state.node) {\n                    state.keys = objectKeys(state.node)\n                }\n                \n                state.isLeaf = state.keys.length == 0;\n                \n                for (var i = 0; i < parents.length; i++) {\n                    if (parents[i].node_ === node_) {\n                        state.circular = parents[i];\n                        break;\n                    }\n                }\n            }\n            else {\n                state.isLeaf = true;\n                state.keys = null;\n            }\n            \n            state.notLeaf = !state.isLeaf;\n            state.notRoot = !state.isRoot;\n        }\n        \n        updateState();\n        \n        // use return values to update if defined\n        var ret = cb.call(state, state.node);\n        if (ret !== undefined && state.update) state.update(ret);\n        \n        if (modifiers.before) modifiers.before.call(state, state.node);\n        \n        if (!keepGoing) return state;\n        \n        if (typeof state.node == 'object'\n        && state.node !== null && !state.circular) {\n            parents.push(state);\n            \n            updateState();\n            \n            forEach(state.keys, function (key, i) {\n                path.push(key);\n                \n                if (modifiers.pre) modifiers.pre.call(state, state.node[key], key);\n                \n                var child = walker(state.node[key]);\n                if (immutable && hasOwnProperty.call(state.node, key)) {\n                    state.node[key] = child.node;\n                }\n                \n                child.isLast = i == state.keys.length - 1;\n                child.isFirst = i == 0;\n                \n                if (modifiers.post) modifiers.post.call(state, child);\n                \n                path.pop();\n            });\n            parents.pop();\n        }\n        \n        if (modifiers.after) modifiers.after.call(state, state.node);\n        \n        return state;\n    })(root).node;\n}\n\nfunction copy (src) {\n    if (typeof src === 'object' && src !== null) {\n        var dst;\n        \n        if (isArray(src)) {\n            dst = [];\n        }\n        else if (isDate(src)) {\n            dst = new Date(src.getTime ? src.getTime() : src);\n        }\n        else if (isRegExp(src)) {\n            dst = new RegExp(src);\n        }\n        else if (isError(src)) {\n            dst = { message: src.message };\n        }\n        else if (isBoolean(src)) {\n            dst = new Boolean(src);\n        }\n        else if (isNumber(src)) {\n            dst = new Number(src);\n        }\n        else if (isString(src)) {\n            dst = new String(src);\n        }\n        else if (Object.create && Object.getPrototypeOf) {\n            dst = Object.create(Object.getPrototypeOf(src));\n        }\n        else if (src.constructor === Object) {\n            dst = {};\n        }\n        else {\n            var proto =\n                (src.constructor && src.constructor.prototype)\n                || src.__proto__\n                || {}\n            ;\n            var T = function () {};\n            T.prototype = proto;\n            dst = new T;\n        }\n        \n        forEach(objectKeys(src), function (key) {\n            dst[key] = src[key];\n        });\n        return dst;\n    }\n    else return src;\n}\n\nvar objectKeys = Object.keys || function keys (obj) {\n    var res = [];\n    for (var key in obj) res.push(key)\n    return res;\n};\n\nfunction toS (obj) { return Object.prototype.toString.call(obj) }\nfunction isDate (obj) { return toS(obj) === '[object Date]' }\nfunction isRegExp (obj) { return toS(obj) === '[object RegExp]' }\nfunction isError (obj) { return toS(obj) === '[object Error]' }\nfunction isBoolean (obj) { return toS(obj) === '[object Boolean]' }\nfunction isNumber (obj) { return toS(obj) === '[object Number]' }\nfunction isString (obj) { return toS(obj) === '[object String]' }\n\nvar isArray = Array.isArray || function isArray (xs) {\n    return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nvar forEach = function (xs, fn) {\n    if (xs.forEach) return xs.forEach(fn)\n    else for (var i = 0; i < xs.length; i++) {\n        fn(xs[i], i, xs);\n    }\n};\n\nforEach(objectKeys(Traverse.prototype), function (key) {\n    traverse[key] = function (obj) {\n        var args = [].slice.call(arguments, 1);\n        var t = new Traverse(obj);\n        return t[key].apply(t, args);\n    };\n});\n\nvar hasOwnProperty = Object.hasOwnProperty || function (obj, key) {\n    return key in obj;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/traverse/index.js\n// module id = 545\n// module chunks = 0\n\n//# sourceURL=../node_modules/traverse/index.js")},function(module,exports,__webpack_require__){eval("var native = __webpack_require__(311)\n\nfunction getTypeName (fn) {\n  return fn.name || fn.toString().match(/function (.*?)\\s*\\(/)[1]\n}\n\nfunction getValueTypeName (value) {\n  return native.Nil(value) ? '' : getTypeName(value.constructor)\n}\n\nfunction getValue (value) {\n  if (native.Function(value)) return ''\n  if (native.String(value)) return JSON.stringify(value)\n  if (value && native.Object(value)) return ''\n  return value\n}\n\nfunction tfJSON (type) {\n  if (native.Function(type)) return type.toJSON ? type.toJSON() : getTypeName(type)\n  if (native.Array(type)) return 'Array'\n  if (type && native.Object(type)) return 'Object'\n\n  return type !== undefined ? type : ''\n}\n\nfunction tfErrorString (type, value, valueTypeName) {\n  var valueJson = getValue(value)\n\n  return 'Expected ' + tfJSON(type) + ', got' +\n    (valueTypeName !== '' ? ' ' + valueTypeName : '') +\n    (valueJson !== '' ? ' ' + valueJson : '')\n}\n\nfunction TfTypeError (type, value, valueTypeName) {\n  valueTypeName = valueTypeName || getValueTypeName(value)\n  this.message = tfErrorString(type, value, valueTypeName)\n\n  Error.captureStackTrace(this, TfTypeError)\n  this.__type = type\n  this.__value = value\n  this.__valueTypeName = valueTypeName\n}\n\nTfTypeError.prototype = Object.create(Error.prototype)\nTfTypeError.prototype.constructor = TfTypeError\n\nfunction tfPropertyErrorString (type, label, name, value, valueTypeName) {\n  var description = '\" of type '\n  if (label === 'key') description = '\" with key type '\n\n  return tfErrorString('property \"' + tfJSON(name) + description + tfJSON(type), value, valueTypeName)\n}\n\nfunction TfPropertyTypeError (type, property, label, value, valueTypeName) {\n  if (type) {\n    valueTypeName = valueTypeName || getValueTypeName(value)\n    this.message = tfPropertyErrorString(type, label, property, value, valueTypeName)\n  } else {\n    this.message = 'Unexpected property \"' + property + '\"'\n  }\n\n  Error.captureStackTrace(this, TfTypeError)\n  this.__label = label\n  this.__property = property\n  this.__type = type\n  this.__value = value\n  this.__valueTypeName = valueTypeName\n}\n\nTfPropertyTypeError.prototype = Object.create(Error.prototype)\nTfPropertyTypeError.prototype.constructor = TfTypeError\n\nfunction tfCustomError (expected, actual) {\n  return new TfTypeError(expected, {}, actual)\n}\n\nfunction tfSubError (e, property, label) {\n  // sub child?\n  if (e instanceof TfPropertyTypeError) {\n    property = property + '.' + e.__property\n\n    e = new TfPropertyTypeError(\n      e.__type, property, e.__label, e.__value, e.__valueTypeName\n    )\n\n  // child?\n  } else if (e instanceof TfTypeError) {\n    e = new TfPropertyTypeError(\n      e.__type, property, label, e.__value, e.__valueTypeName\n    )\n  }\n\n  Error.captureStackTrace(e)\n  return e\n}\n\nmodule.exports = {\n  TfTypeError: TfTypeError,\n  TfPropertyTypeError: TfPropertyTypeError,\n  tfCustomError: tfCustomError,\n  tfSubError: tfSubError,\n  tfJSON: tfJSON,\n  getValueTypeName: getValueTypeName\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/typeforce/errors.js\n// module id = 546\n// module chunks = 0\n\n//# sourceURL=../node_modules/typeforce/errors.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/utf8js v2.0.0 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tthrow Error(\n\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t' is not a scalar value'\n\t\t\t);\n\t\t}\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tcheckScalarValue(codePoint);\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string) {\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol() {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tvar byte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString) {\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.0.0',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\treturn utf8;\n\t\t}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module), __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/utf8/utf8.js\n// module id = 547\n// module chunks = 0\n\n//# sourceURL=../node_modules/utf8/utf8.js")},function(module,exports,__webpack_require__){eval("var v1 = __webpack_require__(1261);\nvar v4 = __webpack_require__(312);\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/index.js\n// module id = 548\n// module chunks = 0\n\n//# sourceURL=../node_modules/uuid/index.js")},function(module,exports){eval("/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n  byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n  var i = offset || 0;\n  var bth = byteToHex;\n  return bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]];\n}\n\nmodule.exports = bytesToUuid;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/lib/bytesToUuid.js\n// module id = 549\n// module chunks = 0\n\n//# sourceURL=../node_modules/uuid/lib/bytesToUuid.js")},function(module,exports){eval("// Unique ID creation requires a high quality random # generator.  In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API.  We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues.bind(crypto)) ||\n                      (typeof(msCrypto) != 'undefined' && msCrypto.getRandomValues.bind(msCrypto));\nif (getRandomValues) {\n  // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n  var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n  module.exports = function whatwgRNG() {\n    getRandomValues(rnds8);\n    return rnds8;\n  };\n} else {\n  // Math.random()-based (RNG)\n  //\n  // If all else fails, use Math.random().  It's fast, but is of unspecified\n  // quality.\n  var rnds = new Array(16);\n\n  module.exports = function mathRNG() {\n    for (var i = 0, r; i < 16; i++) {\n      if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n      rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n    }\n\n    return rnds;\n  };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/lib/rng-browser.js\n// module id = 550\n// module chunks = 0\n\n//# sourceURL=../node_modules/uuid/lib/rng-browser.js")},function(module,exports,__webpack_require__){eval("var indexOf = __webpack_require__(264);\n\nvar Object_keys = function (obj) {\n    if (Object.keys) return Object.keys(obj)\n    else {\n        var res = [];\n        for (var key in obj) res.push(key)\n        return res;\n    }\n};\n\nvar forEach = function (xs, fn) {\n    if (xs.forEach) return xs.forEach(fn)\n    else for (var i = 0; i < xs.length; i++) {\n        fn(xs[i], i, xs);\n    }\n};\n\nvar defineProp = (function() {\n    try {\n        Object.defineProperty({}, '_', {});\n        return function(obj, name, value) {\n            Object.defineProperty(obj, name, {\n                writable: true,\n                enumerable: false,\n                configurable: true,\n                value: value\n            })\n        };\n    } catch(e) {\n        return function(obj, name, value) {\n            obj[name] = value;\n        };\n    }\n}());\n\nvar globals = ['Array', 'Boolean', 'Date', 'Error', 'EvalError', 'Function',\n'Infinity', 'JSON', 'Math', 'NaN', 'Number', 'Object', 'RangeError',\n'ReferenceError', 'RegExp', 'String', 'SyntaxError', 'TypeError', 'URIError',\n'decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent', 'escape',\n'eval', 'isFinite', 'isNaN', 'parseFloat', 'parseInt', 'undefined', 'unescape'];\n\nfunction Context() {}\nContext.prototype = {};\n\nvar Script = exports.Script = function NodeScript (code) {\n    if (!(this instanceof Script)) return new Script(code);\n    this.code = code;\n};\n\nScript.prototype.runInContext = function (context) {\n    if (!(context instanceof Context)) {\n        throw new TypeError(\"needs a 'context' argument.\");\n    }\n    \n    var iframe = document.createElement('iframe');\n    if (!iframe.style) iframe.style = {};\n    iframe.style.display = 'none';\n    \n    document.body.appendChild(iframe);\n    \n    var win = iframe.contentWindow;\n    var wEval = win.eval, wExecScript = win.execScript;\n\n    if (!wEval && wExecScript) {\n        // win.eval() magically appears when this is called in IE:\n        wExecScript.call(win, 'null');\n        wEval = win.eval;\n    }\n    \n    forEach(Object_keys(context), function (key) {\n        win[key] = context[key];\n    });\n    forEach(globals, function (key) {\n        if (context[key]) {\n            win[key] = context[key];\n        }\n    });\n    \n    var winKeys = Object_keys(win);\n\n    var res = wEval.call(win, this.code);\n    \n    forEach(Object_keys(win), function (key) {\n        // Avoid copying circular objects like `top` and `window` by only\n        // updating existing context properties or new properties in the `win`\n        // that was only introduced after the eval.\n        if (key in context || indexOf(winKeys, key) === -1) {\n            context[key] = win[key];\n        }\n    });\n\n    forEach(globals, function (key) {\n        if (!(key in context)) {\n            defineProp(context, key, win[key]);\n        }\n    });\n    \n    document.body.removeChild(iframe);\n    \n    return res;\n};\n\nScript.prototype.runInThisContext = function () {\n    return eval(this.code); // maybe...\n};\n\nScript.prototype.runInNewContext = function (context) {\n    var ctx = Script.createContext(context);\n    var res = this.runInContext(ctx);\n\n    forEach(Object_keys(ctx), function (key) {\n        context[key] = ctx[key];\n    });\n\n    return res;\n};\n\nforEach(Object_keys(Script.prototype), function (name) {\n    exports[name] = Script[name] = function (code) {\n        var s = Script(code);\n        return s[name].apply(s, [].slice.call(arguments, 1));\n    };\n});\n\nexports.createScript = function (code) {\n    return exports.Script(code);\n};\n\nexports.createContext = Script.createContext = function (context) {\n    var copy = new Context();\n    if(typeof context === 'object') {\n        forEach(Object_keys(context), function (key) {\n            copy[key] = context[key];\n        });\n    }\n    return copy;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/vm-browserify/index.js\n// module id = 551\n// module chunks = 0\n\n//# sourceURL=../node_modules/vm-browserify/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2016\n */\n\n\n\nvar EventEmitter = __webpack_require__(183);\nvar Promise = __webpack_require__(1269);\n\n/**\n * This function generates a defer promise and adds eventEmitter functionality to it\n *\n * @method eventifiedPromise\n */\nvar PromiEvent = function PromiEvent(justPromise) {\n    var resolve, reject,\n        eventEmitter = new Promise(function() {\n            resolve = arguments[0];\n            reject = arguments[1];\n        });\n\n    if(justPromise) {\n        return {\n            resolve: resolve,\n            reject: reject,\n            eventEmitter: eventEmitter\n        };\n    }\n\n    // get eventEmitter\n    var emitter = new EventEmitter();\n\n    // add eventEmitter to the promise\n    eventEmitter._events = emitter._events;\n    eventEmitter.emit = emitter.emit;\n    eventEmitter.on = emitter.on;\n    eventEmitter.once = emitter.once;\n    eventEmitter.off = emitter.off;\n    eventEmitter.listeners = emitter.listeners;\n    eventEmitter.addListener = emitter.addListener;\n    eventEmitter.removeListener = emitter.removeListener;\n    eventEmitter.removeAllListeners = emitter.removeAllListeners;\n\n    return {\n        resolve: resolve,\n        reject: reject,\n        eventEmitter: eventEmitter\n    };\n};\n\nPromiEvent.resolve = function(value) {\n    var promise = PromiEvent(true);\n    promise.resolve(value);\n    return promise.eventEmitter;\n};\n\nmodule.exports = PromiEvent;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-promievent/src/index.js\n// module id = 552\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-promievent/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file jsonrpc.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n *   Marek Kotewicz <marek@ethdev.com>\n *   Aaron Kumavis <aaron@kumavis.me>\n * @date 2015\n */\n\n\n\n// Initialize Jsonrpc as a simple object with utility functions.\nvar Jsonrpc = {\n    messageId: 0\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.toPayload = function (method, params) {\n    if (!method) {\n        throw new Error('JSONRPC method should be specified for params: \"'+ JSON.stringify(params) +'\"!');\n    }\n\n    // advance message ID\n    Jsonrpc.messageId++;\n\n    return {\n        jsonrpc: '2.0',\n        id: Jsonrpc.messageId,\n        method: method,\n        params: params || []\n    };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.isValidResponse = function (response) {\n    return Array.isArray(response) ? response.every(validateSingleMessage) : validateSingleMessage(response);\n\n    function validateSingleMessage(message){\n      return !!message &&\n        !message.error &&\n        message.jsonrpc === '2.0' &&\n        (typeof message.id === 'number' || typeof message.id === 'string') &&\n        message.result !== undefined; // only undefined is not valid json object\n    }\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.toBatchPayload = function (messages) {\n    return messages.map(function (message) {\n        return Jsonrpc.toPayload(message.method, message.params);\n    });\n};\n\nmodule.exports = Jsonrpc;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-requestmanager/src/jsonrpc.js\n// module id = 553\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-requestmanager/src/jsonrpc.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Marek Kotewicz <marek@parity.io>\n * @author Fabian Vogelsteller <fabian@frozeman.de>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(47);\n\nvar f = __webpack_require__(65);\n\nvar SolidityTypeAddress = __webpack_require__(1276);\nvar SolidityTypeBool = __webpack_require__(1277);\nvar SolidityTypeInt = __webpack_require__(1280);\nvar SolidityTypeUInt = __webpack_require__(1282);\nvar SolidityTypeDynamicBytes = __webpack_require__(1279);\nvar SolidityTypeString = __webpack_require__(1281);\nvar SolidityTypeBytes = __webpack_require__(1278);\n\nvar isDynamic = function (solidityType, type) {\n    return solidityType.isDynamicType(type) ||\n        solidityType.isDynamicArray(type);\n};\n\n\n// result method\nfunction Result() {}\n\n\n/**\n * ABICoder prototype should be used to encode/decode solidity params of any type\n */\nvar ABICoder = function (types) {\n    this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType}\n * @throws {Error} throws if no matching type is found\n */\nABICoder.prototype._requireType = function (type) {\n    var solidityType = this._types.filter(function (t) {\n        return t.isType(type);\n    })[0];\n\n    if (!solidityType) {\n        throw Error('Invalid solidity type: ' + type);\n    }\n\n    return solidityType;\n};\n\n\n\nABICoder.prototype._getOffsets = function (types, solidityTypes) {\n    var lengths =  solidityTypes.map(function (solidityType, index) {\n        return solidityType.staticPartLength(types[index]);\n    });\n\n    for (var i = 1; i < lengths.length; i++) {\n        // sum with length of previous element\n        lengths[i] += lengths[i - 1];\n    }\n\n    return lengths.map(function (length, index) {\n        // remove the current length, so the length is sum of previous elements\n        var staticPartLength = solidityTypes[index].staticPartLength(types[index]);\n        return length - staticPartLength;\n    });\n};\n\nABICoder.prototype._getSolidityTypes = function (types) {\n    var self = this;\n    return types.map(function (type) {\n        return self._requireType(type);\n    });\n};\n\n\nABICoder.prototype._encodeMultiWithOffset = function (types, solidityTypes, encodeds, dynamicOffset) {\n    var result = \"\";\n    var self = this;\n\n    types.forEach(function (type, i) {\n        if (isDynamic(solidityTypes[i], types[i])) {\n            result += f.formatInputInt(dynamicOffset).encode();\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n            dynamicOffset += e.length / 2;\n        } else {\n            // don't add length to dynamicOffset. it's already counted\n            result += self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n        }\n\n        // TODO: figure out nested arrays\n    });\n\n    types.forEach(function (type, i) {\n        if (isDynamic(solidityTypes[i], types[i])) {\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\n            dynamicOffset += e.length / 2;\n            result += e;\n        }\n    });\n    return result;\n};\n\n// TODO: refactor whole encoding!\nABICoder.prototype._encodeWithOffset = function (type, solidityType, encoded, offset) {\n    var self = this;\n    if (solidityType.isDynamicArray(type)) {\n        return (function () {\n            // offset was already set\n            var nestedName = solidityType.nestedName(type);\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\n            var result = encoded[0];\n\n            (function () {\n                var previousLength = 2; // in int\n                if (solidityType.isDynamicArray(nestedName)) {\n                    for (var i = 1; i < encoded.length; i++) {\n                        previousLength += +(encoded[i - 1])[0] || 0;\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\n                    }\n                }\n            })();\n\n            // first element is length, skip it\n            (function () {\n                for (var i = 0; i < encoded.length - 1; i++) {\n                    var additionalOffset = result / 2;\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i + 1], offset +  additionalOffset);\n                }\n            })();\n\n            return result;\n        })();\n\n    } else if (solidityType.isStaticArray(type)) {\n        return (function () {\n            var nestedName = solidityType.nestedName(type);\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\n            var result = \"\";\n\n\n            if (solidityType.isDynamicArray(nestedName)) {\n                (function () {\n                    var previousLength = 0; // in int\n                    for (var i = 0; i < encoded.length; i++) {\n                        // calculate length of previous item\n                        previousLength += +(encoded[i - 1] || [])[0] || 0;\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\n                    }\n                })();\n            }\n\n            (function () {\n                for (var i = 0; i < encoded.length; i++) {\n                    var additionalOffset = result / 2;\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i], offset + additionalOffset);\n                }\n            })();\n\n            return result;\n        })();\n    }\n\n    return encoded;\n};\n\n\n/**\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\n *\n * @method encodeFunctionSignature\n * @param {String|Object} functionName\n * @return {String} encoded function name\n */\nABICoder.prototype.encodeFunctionSignature = function (functionName) {\n    if(_.isObject(functionName)) {\n        functionName = utils._jsonInterfaceMethodToString(functionName);\n    }\n\n    return utils.sha3(functionName).slice(0, 10);\n};\n\n\n/**\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\n *\n * @method encodeEventSignature\n * @param {String|Object} functionName\n * @return {String} encoded function name\n */\nABICoder.prototype.encodeEventSignature = function (functionName) {\n    if(_.isObject(functionName)) {\n        functionName = utils._jsonInterfaceMethodToString(functionName);\n    }\n\n    return utils.sha3(functionName);\n};\n\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParameter\n * @param {String} type\n * @param {Object} param\n * @return {String} encoded plain param\n */\nABICoder.prototype.encodeParameter = function (type, param) {\n    return this.encodeParameters([type], [param]);\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParameters\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nABICoder.prototype.encodeParameters = function (types, params) {\n    // given a json interface\n    if(_.isObject(types) && types.inputs) {\n        types = _.map(types.inputs, function (input) {\n            return input.type;\n        });\n    }\n\n    var solidityTypes = this._getSolidityTypes(types);\n\n    var encodeds = solidityTypes.map(function (solidityType, index) {\n        return solidityType.encode(params[index], types[index]);\n    });\n\n    var dynamicOffset = solidityTypes.reduce(function (acc, solidityType, index) {\n        var staticPartLength = solidityType.staticPartLength(types[index]);\n        var roundedStaticPartLength = Math.floor((staticPartLength + 31) / 32) * 32;\n\n        return acc + (isDynamic(solidityTypes[index], types[index]) ?\n                32 :\n                roundedStaticPartLength);\n    }, 0);\n\n    return '0x'+ this._encodeMultiWithOffset(types, solidityTypes, encodeds, dynamicOffset);\n};\n\n\n/**\n * Encodes a function call from its json interface and parameters.\n *\n * @method encodeFunctionCall\n * @param {Array} jsonInterface\n * @param {Array} params\n * @return {String} The encoded ABI for this function call\n */\nABICoder.prototype.encodeFunctionCall = function (jsonInterface, params) {\n    return this.encodeFunctionSignature(jsonInterface) + this.encodeParameters(jsonInterface, params).replace('0x','');\n};\n\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParameter\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nABICoder.prototype.decodeParameter = function (type, bytes) {\n\n    if (!_.isString(type)) {\n        throw new Error('Given parameter type is not a string: '+ type);\n    }\n\n    return this.decodeParameters([{type: type}], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParameter\n * @param {Array} outputs\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nABICoder.prototype.decodeParameters = function (outputs, bytes) {\n    var isTypeArray = _.isArray(outputs) && _.isString(outputs[0]);\n    var types = (isTypeArray) ? outputs : [];\n\n    if(!isTypeArray) {\n        outputs.forEach(function (output) {\n            types.push(output.type);\n        });\n    }\n\n    var solidityTypes = this._getSolidityTypes(types);\n    var offsets = this._getOffsets(types, solidityTypes);\n\n    var returnValue = new Result();\n    returnValue.__length__ = 0;\n    var count = 0;\n\n    outputs.forEach(function (output, i) {\n        var decodedValue = solidityTypes[count].decode(bytes.replace(/^0x/i,''), offsets[count],  types[count], count);\n        decodedValue = (decodedValue === '0x') ? null : decodedValue;\n\n        returnValue[i] = decodedValue;\n\n        if (_.isObject(output) && output.name) {\n            returnValue[output.name] = decodedValue;\n        }\n\n        returnValue.__length__++;\n        count++;\n    });\n\n    return returnValue;\n};\n\n/**\n * Decodes events non- and indexed parameters.\n *\n * @method decodeLog\n * @param {Object} inputs\n * @param {String} data\n * * @param {Array} topics\n * @return {Array} array of plain params\n */\nABICoder.prototype.decodeLog = function (inputs, data, topics) {\n\n    data = data || '';\n\n    var notIndexedInputs = [];\n    var indexedInputs = [];\n\n    inputs.forEach(function (input, i) {\n        if (input.indexed) {\n            indexedInputs[i] = input;\n        } else {\n            notIndexedInputs[i] = input;\n        }\n    });\n\n    var nonIndexedData = data.slice(2);\n    var indexedData = _.isArray(topics) ? topics.map(function (topic) { return topic.slice(2); }).join('') : topics;\n\n    var notIndexedParams = this.decodeParameters(notIndexedInputs, nonIndexedData);\n    var indexedParams = this.decodeParameters(indexedInputs, indexedData);\n\n\n    var returnValue = new Result();\n    returnValue.__length__ = 0;\n\n    inputs.forEach(function (res, i) {\n        returnValue[i] = (res.type === 'string') ? '' : null;\n\n        if (notIndexedParams[i]) {\n            returnValue[i] = notIndexedParams[i];\n        }\n        if (indexedParams[i]) {\n            returnValue[i] = indexedParams[i];\n        }\n\n        if(res.name) {\n            returnValue[res.name] = returnValue[i];\n        }\n\n        returnValue.__length__++;\n    });\n\n    return returnValue;\n};\n\n\nvar coder = new ABICoder([\n    new SolidityTypeAddress(),\n    new SolidityTypeBool(),\n    new SolidityTypeInt(),\n    new SolidityTypeUInt(),\n    new SolidityTypeDynamicBytes(),\n    new SolidityTypeBytes(),\n    new SolidityTypeString()\n]);\n\nmodule.exports = coder;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/index.js\n// module id = 554\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file param.js\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2015\n */\n\nvar formatters = __webpack_require__(65);\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset, rawValue) {\n    this.value = value || '';\n    this.offset = offset; // offset in bytes\n    this.rawValue = rawValue; // used for debugging\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n *\n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n    return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n    return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n    return new SolidityParam(this.value + param.value);\n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n    return this.offset !== undefined;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n    return !this.isDynamic() ? '' : formatters.toTwosComplement(this.offset).replace('0x','');\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n    if (!this.isDynamic()) {\n        return this.value;\n    }\n    return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n    return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n    return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n\n    // updating offsets\n    var totalOffset = params.length * 32;\n    var offsetParams = params.map(function (param) {\n        if (!param.isDynamic()) {\n            return param;\n        }\n        var offset = totalOffset;\n        totalOffset += param.dynamicPartLength();\n        return param.withOffset(offset);\n    });\n\n    // encode everything!\n    return offsetParams.reduce(function (result, param) {\n        return result + param.dynamicPart();\n    }, offsetParams.reduce(function (result, param) {\n        return result + param.staticPart();\n    }, ''));\n};\n\n\n\nmodule.exports = SolidityParam;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/param.js\n// module id = 555\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/param.js")},function(module,exports){eval('// This was ported from https://github.com/emn178/js-sha3, with some minor\n// modifications and pruning. It is licensed under MIT:\n//\n// Copyright 2015-2016 Chen, Yi-Cyuan\n//  \n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar HEX_CHARS = \'0123456789abcdef\'.split(\'\');\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\nvar SHIFT = [0, 8, 16, 24];\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n\nvar Keccak = function Keccak(bits) {\n  return {\n    blocks: [],\n    reset: true,\n    block: 0,\n    start: 0,\n    blockCount: 1600 - (bits << 1) >> 5,\n    outputBlocks: bits >> 5,\n    s: function (s) {\n      return [].concat(s, s, s, s, s);\n    }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n  };\n};\n\nvar update = function update(state, message) {\n  var length = message.length,\n      blocks = state.blocks,\n      byteCount = state.blockCount << 2,\n      blockCount = state.blockCount,\n      outputBlocks = state.outputBlocks,\n      s = state.s,\n      index = 0,\n      i,\n      code;\n\n  // update\n  while (index < length) {\n    if (state.reset) {\n      state.reset = false;\n      blocks[0] = state.block;\n      for (i = 1; i < blockCount + 1; ++i) {\n        blocks[i] = 0;\n      }\n    }\n    if (typeof message !== "string") {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n      }\n    } else {\n      for (i = state.start; index < length && i < byteCount; ++index) {\n        code = message.charCodeAt(index);\n        if (code < 0x80) {\n          blocks[i >> 2] |= code << SHIFT[i++ & 3];\n        } else if (code < 0x800) {\n          blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else if (code < 0xd800 || code >= 0xe000) {\n          blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        } else {\n          code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\n          blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\n        }\n      }\n    }\n    state.lastByteIndex = i;\n    if (i >= byteCount) {\n      state.start = i - byteCount;\n      state.block = blocks[blockCount];\n      for (i = 0; i < blockCount; ++i) {\n        s[i] ^= blocks[i];\n      }\n      f(s);\n      state.reset = true;\n    } else {\n      state.start = i;\n    }\n  }\n\n  // finalize\n  i = state.lastByteIndex;\n  blocks[i >> 2] |= KECCAK_PADDING[i & 3];\n  if (state.lastByteIndex === byteCount) {\n    blocks[0] = blocks[blockCount];\n    for (i = 1; i < blockCount + 1; ++i) {\n      blocks[i] = 0;\n    }\n  }\n  blocks[blockCount - 1] |= 0x80000000;\n  for (i = 0; i < blockCount; ++i) {\n    s[i] ^= blocks[i];\n  }\n  f(s);\n\n  // toString\n  var hex = \'\',\n      i = 0,\n      j = 0,\n      block;\n  while (j < outputBlocks) {\n    for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n      block = s[i];\n      hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\n    }\n    if (j % blockCount === 0) {\n      f(s);\n      i = 0;\n    }\n  }\n  return "0x" + hex;\n};\n\nvar f = function f(s) {\n  var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n\n  for (n = 0; n < 48; n += 2) {\n    c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n    c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n    c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n    c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n    c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n    c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n    c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n    c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n    c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n    c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n    h = c8 ^ (c2 << 1 | c3 >>> 31);\n    l = c9 ^ (c3 << 1 | c2 >>> 31);\n    s[0] ^= h;\n    s[1] ^= l;\n    s[10] ^= h;\n    s[11] ^= l;\n    s[20] ^= h;\n    s[21] ^= l;\n    s[30] ^= h;\n    s[31] ^= l;\n    s[40] ^= h;\n    s[41] ^= l;\n    h = c0 ^ (c4 << 1 | c5 >>> 31);\n    l = c1 ^ (c5 << 1 | c4 >>> 31);\n    s[2] ^= h;\n    s[3] ^= l;\n    s[12] ^= h;\n    s[13] ^= l;\n    s[22] ^= h;\n    s[23] ^= l;\n    s[32] ^= h;\n    s[33] ^= l;\n    s[42] ^= h;\n    s[43] ^= l;\n    h = c2 ^ (c6 << 1 | c7 >>> 31);\n    l = c3 ^ (c7 << 1 | c6 >>> 31);\n    s[4] ^= h;\n    s[5] ^= l;\n    s[14] ^= h;\n    s[15] ^= l;\n    s[24] ^= h;\n    s[25] ^= l;\n    s[34] ^= h;\n    s[35] ^= l;\n    s[44] ^= h;\n    s[45] ^= l;\n    h = c4 ^ (c8 << 1 | c9 >>> 31);\n    l = c5 ^ (c9 << 1 | c8 >>> 31);\n    s[6] ^= h;\n    s[7] ^= l;\n    s[16] ^= h;\n    s[17] ^= l;\n    s[26] ^= h;\n    s[27] ^= l;\n    s[36] ^= h;\n    s[37] ^= l;\n    s[46] ^= h;\n    s[47] ^= l;\n    h = c6 ^ (c0 << 1 | c1 >>> 31);\n    l = c7 ^ (c1 << 1 | c0 >>> 31);\n    s[8] ^= h;\n    s[9] ^= l;\n    s[18] ^= h;\n    s[19] ^= l;\n    s[28] ^= h;\n    s[29] ^= l;\n    s[38] ^= h;\n    s[39] ^= l;\n    s[48] ^= h;\n    s[49] ^= l;\n\n    b0 = s[0];\n    b1 = s[1];\n    b32 = s[11] << 4 | s[10] >>> 28;\n    b33 = s[10] << 4 | s[11] >>> 28;\n    b14 = s[20] << 3 | s[21] >>> 29;\n    b15 = s[21] << 3 | s[20] >>> 29;\n    b46 = s[31] << 9 | s[30] >>> 23;\n    b47 = s[30] << 9 | s[31] >>> 23;\n    b28 = s[40] << 18 | s[41] >>> 14;\n    b29 = s[41] << 18 | s[40] >>> 14;\n    b20 = s[2] << 1 | s[3] >>> 31;\n    b21 = s[3] << 1 | s[2] >>> 31;\n    b2 = s[13] << 12 | s[12] >>> 20;\n    b3 = s[12] << 12 | s[13] >>> 20;\n    b34 = s[22] << 10 | s[23] >>> 22;\n    b35 = s[23] << 10 | s[22] >>> 22;\n    b16 = s[33] << 13 | s[32] >>> 19;\n    b17 = s[32] << 13 | s[33] >>> 19;\n    b48 = s[42] << 2 | s[43] >>> 30;\n    b49 = s[43] << 2 | s[42] >>> 30;\n    b40 = s[5] << 30 | s[4] >>> 2;\n    b41 = s[4] << 30 | s[5] >>> 2;\n    b22 = s[14] << 6 | s[15] >>> 26;\n    b23 = s[15] << 6 | s[14] >>> 26;\n    b4 = s[25] << 11 | s[24] >>> 21;\n    b5 = s[24] << 11 | s[25] >>> 21;\n    b36 = s[34] << 15 | s[35] >>> 17;\n    b37 = s[35] << 15 | s[34] >>> 17;\n    b18 = s[45] << 29 | s[44] >>> 3;\n    b19 = s[44] << 29 | s[45] >>> 3;\n    b10 = s[6] << 28 | s[7] >>> 4;\n    b11 = s[7] << 28 | s[6] >>> 4;\n    b42 = s[17] << 23 | s[16] >>> 9;\n    b43 = s[16] << 23 | s[17] >>> 9;\n    b24 = s[26] << 25 | s[27] >>> 7;\n    b25 = s[27] << 25 | s[26] >>> 7;\n    b6 = s[36] << 21 | s[37] >>> 11;\n    b7 = s[37] << 21 | s[36] >>> 11;\n    b38 = s[47] << 24 | s[46] >>> 8;\n    b39 = s[46] << 24 | s[47] >>> 8;\n    b30 = s[8] << 27 | s[9] >>> 5;\n    b31 = s[9] << 27 | s[8] >>> 5;\n    b12 = s[18] << 20 | s[19] >>> 12;\n    b13 = s[19] << 20 | s[18] >>> 12;\n    b44 = s[29] << 7 | s[28] >>> 25;\n    b45 = s[28] << 7 | s[29] >>> 25;\n    b26 = s[38] << 8 | s[39] >>> 24;\n    b27 = s[39] << 8 | s[38] >>> 24;\n    b8 = s[48] << 14 | s[49] >>> 18;\n    b9 = s[49] << 14 | s[48] >>> 18;\n\n    s[0] = b0 ^ ~b2 & b4;\n    s[1] = b1 ^ ~b3 & b5;\n    s[10] = b10 ^ ~b12 & b14;\n    s[11] = b11 ^ ~b13 & b15;\n    s[20] = b20 ^ ~b22 & b24;\n    s[21] = b21 ^ ~b23 & b25;\n    s[30] = b30 ^ ~b32 & b34;\n    s[31] = b31 ^ ~b33 & b35;\n    s[40] = b40 ^ ~b42 & b44;\n    s[41] = b41 ^ ~b43 & b45;\n    s[2] = b2 ^ ~b4 & b6;\n    s[3] = b3 ^ ~b5 & b7;\n    s[12] = b12 ^ ~b14 & b16;\n    s[13] = b13 ^ ~b15 & b17;\n    s[22] = b22 ^ ~b24 & b26;\n    s[23] = b23 ^ ~b25 & b27;\n    s[32] = b32 ^ ~b34 & b36;\n    s[33] = b33 ^ ~b35 & b37;\n    s[42] = b42 ^ ~b44 & b46;\n    s[43] = b43 ^ ~b45 & b47;\n    s[4] = b4 ^ ~b6 & b8;\n    s[5] = b5 ^ ~b7 & b9;\n    s[14] = b14 ^ ~b16 & b18;\n    s[15] = b15 ^ ~b17 & b19;\n    s[24] = b24 ^ ~b26 & b28;\n    s[25] = b25 ^ ~b27 & b29;\n    s[34] = b34 ^ ~b36 & b38;\n    s[35] = b35 ^ ~b37 & b39;\n    s[44] = b44 ^ ~b46 & b48;\n    s[45] = b45 ^ ~b47 & b49;\n    s[6] = b6 ^ ~b8 & b0;\n    s[7] = b7 ^ ~b9 & b1;\n    s[16] = b16 ^ ~b18 & b10;\n    s[17] = b17 ^ ~b19 & b11;\n    s[26] = b26 ^ ~b28 & b20;\n    s[27] = b27 ^ ~b29 & b21;\n    s[36] = b36 ^ ~b38 & b30;\n    s[37] = b37 ^ ~b39 & b31;\n    s[46] = b46 ^ ~b48 & b40;\n    s[47] = b47 ^ ~b49 & b41;\n    s[8] = b8 ^ ~b0 & b2;\n    s[9] = b9 ^ ~b1 & b3;\n    s[18] = b18 ^ ~b10 & b12;\n    s[19] = b19 ^ ~b11 & b13;\n    s[28] = b28 ^ ~b20 & b22;\n    s[29] = b29 ^ ~b21 & b23;\n    s[38] = b38 ^ ~b30 & b32;\n    s[39] = b39 ^ ~b31 & b33;\n    s[48] = b48 ^ ~b40 & b42;\n    s[49] = b49 ^ ~b41 & b43;\n\n    s[0] ^= RC[n];\n    s[1] ^= RC[n + 1];\n  }\n};\n\nvar keccak = function keccak(bits) {\n  return function (str) {\n    var msg;\n    if (str.slice(0, 2) === "0x") {\n      msg = [];\n      for (var i = 2, l = str.length; i < l; i += 2) {\n        msg.push(parseInt(str.slice(i, i + 2), 16));\n      }\n    } else {\n      msg = str;\n    }\n    return update(Keccak(bits, bits), msg);\n  };\n};\n\nmodule.exports = {\n  keccak256: keccak(256),\n  keccak512: keccak(512),\n  keccak256s: keccak(256),\n  keccak512s: keccak(512)\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/hash.js\n// module id = 556\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/hash.js')},function(module,exports,__webpack_require__){eval('var BN = __webpack_require__(17);\nvar Bytes = __webpack_require__(315);\n\nvar fromBN = function fromBN(bn) {\n  return "0x" + bn.toString("hex");\n};\n\nvar toBN = function toBN(str) {\n  return new BN(str.slice(2), 16);\n};\n\nvar fromString = function fromString(str) {\n  var bn = "0x" + (str.slice(0, 2) === "0x" ? new BN(str.slice(2), 16) : new BN(str, 10)).toString("hex");\n  return bn === "0x0" ? "0x" : bn;\n};\n\nvar toEther = function toEther(wei) {\n  return toNumber(div(wei, fromString("10000000000"))) / 100000000;\n};\n\nvar fromEther = function fromEther(eth) {\n  return mul(fromNumber(Math.floor(eth * 100000000)), fromString("10000000000"));\n};\n\nvar toString = function toString(a) {\n  return toBN(a).toString(10);\n};\n\nvar fromNumber = function fromNumber(a) {\n  return typeof a === "string" ? /^0x/.test(a) ? a : "0x" + a : "0x" + new BN(a).toString("hex");\n};\n\nvar toNumber = function toNumber(a) {\n  return toBN(a).toNumber();\n};\n\nvar toUint256 = function toUint256(a) {\n  return Bytes.pad(32, a);\n};\n\nvar bin = function bin(method) {\n  return function (a, b) {\n    return fromBN(toBN(a)[method](toBN(b)));\n  };\n};\n\nvar add = bin("add");\nvar mul = bin("mul");\nvar div = bin("div");\nvar sub = bin("sub");\n\nmodule.exports = {\n  toString: toString,\n  fromString: fromString,\n  toNumber: toNumber,\n  fromNumber: fromNumber,\n  toEther: toEther,\n  fromEther: fromEther,\n  toUint256: toUint256,\n  add: add,\n  mul: mul,\n  div: div,\n  sub: sub\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/nat.js\n// module id = 557\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/nat.js')},function(module,exports){eval('// The RLP format\n// Serialization and deserialization for the BytesTree type, under the following grammar:\n// | First byte | Meaning                                                                    |\n// | ---------- | -------------------------------------------------------------------------- |\n// | 0   to 127 | HEX(leaf)                                                                  |\n// | 128 to 183 | HEX(length_of_leaf + 128) + HEX(leaf)                                      |\n// | 184 to 191 | HEX(length_of_length_of_leaf + 128 + 55) + HEX(length_of_leaf) + HEX(leaf) |\n// | 192 to 247 | HEX(length_of_node + 192) + HEX(node)                                      |\n// | 248 to 255 | HEX(length_of_length_of_node + 128 + 55) + HEX(length_of_node) + HEX(node) |\n\nvar encode = function encode(tree) {\n  var padEven = function padEven(str) {\n    return str.length % 2 === 0 ? str : "0" + str;\n  };\n\n  var uint = function uint(num) {\n    return padEven(num.toString(16));\n  };\n\n  var length = function length(len, add) {\n    return len < 56 ? uint(add + len) : uint(add + uint(len).length / 2 + 55) + uint(len);\n  };\n\n  var dataTree = function dataTree(tree) {\n    if (typeof tree === "string") {\n      var hex = tree.slice(2);\n      var pre = hex.length != 2 || hex >= "80" ? length(hex.length / 2, 128) : "";\n      return pre + hex;\n    } else {\n      var _hex = tree.map(dataTree).join("");\n      var _pre = length(_hex.length / 2, 192);\n      return _pre + _hex;\n    }\n  };\n\n  return "0x" + dataTree(tree);\n};\n\nvar decode = function decode(hex) {\n  var i = 2;\n\n  var parseTree = function parseTree() {\n    if (i >= hex.length) throw "";\n    var head = hex.slice(i, i + 2);\n    return head < "80" ? (i += 2, "0x" + head) : head < "c0" ? parseHex() : parseList();\n  };\n\n  var parseLength = function parseLength() {\n    var len = parseInt(hex.slice(i, i += 2), 16) % 64;\n    return len < 56 ? len : parseInt(hex.slice(i, i += (len - 55) * 2), 16);\n  };\n\n  var parseHex = function parseHex() {\n    var len = parseLength();\n    return "0x" + hex.slice(i, i += len * 2);\n  };\n\n  var parseList = function parseList() {\n    var lim = parseLength() * 2 + i;\n    var list = [];\n    while (i < lim) {\n      list.push(parseTree());\n    }return list;\n  };\n\n  try {\n    return parseTree();\n  } catch (e) {\n    return [];\n  }\n};\n\nmodule.exports = { encode: encode, decode: decode };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/rlp.js\n// module id = 558\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/rlp.js')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file iban.js\n *\n * Details: https://github.com/ethereum/wiki/wiki/ICAP:-Inter-exchange-Client-Address-Protocol\n *\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2015\n */\n\n\n\nvar utils = __webpack_require__(47);\nvar BigNumber = __webpack_require__(17);\n\n\nvar leftPad = function (string, bytes) {\n    var result = string;\n    while (result.length < bytes * 2) {\n        result = '0' + result;\n    }\n    return result;\n};\n\n/**\n * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to\n * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616.\n *\n * @method iso13616Prepare\n * @param {String} iban the IBAN\n * @returns {String} the prepared IBAN\n */\nvar iso13616Prepare = function (iban) {\n    var A = 'A'.charCodeAt(0);\n    var Z = 'Z'.charCodeAt(0);\n\n    iban = iban.toUpperCase();\n    iban = iban.substr(4) + iban.substr(0,4);\n\n    return iban.split('').map(function(n){\n        var code = n.charCodeAt(0);\n        if (code >= A && code <= Z){\n            // A = 10, B = 11, ... Z = 35\n            return code - A + 10;\n        } else {\n            return n;\n        }\n    }).join('');\n};\n\n/**\n * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064.\n *\n * @method mod9710\n * @param {String} iban\n * @returns {Number}\n */\nvar mod9710 = function (iban) {\n    var remainder = iban,\n        block;\n\n    while (remainder.length > 2){\n        block = remainder.slice(0, 9);\n        remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);\n    }\n\n    return parseInt(remainder, 10) % 97;\n};\n\n/**\n * This prototype should be used to create iban object from iban correct string\n *\n * @param {String} iban\n */\nvar Iban = function Iban(iban) {\n    this._iban = iban;\n};\n\n/**\n * This method should be used to create an ethereum address from a direct iban address\n *\n * @method toAddress\n * @param {String} iban address\n * @return {String} the ethereum address\n */\nIban.toAddress = function (ib) {\n    ib = new Iban(ib);\n\n    if(!ib.isDirect()) {\n        throw new Error('IBAN is indirect and can\\'t be converted');\n    }\n\n    return ib.toAddress();\n};\n\n/**\n * This method should be used to create iban address from an ethereum address\n *\n * @method toIban\n * @param {String} address\n * @return {String} the IBAN address\n */\nIban.toIban = function (address) {\n    return Iban.fromAddress(address).toString();\n};\n\n/**\n * This method should be used to create iban object from an ethereum address\n *\n * @method fromAddress\n * @param {String} address\n * @return {Iban} the IBAN object\n */\nIban.fromAddress = function (address) {\n    if(!utils.isAddress(address)){\n        throw new Error('Provided address is not a valid address: '+ address);\n    }\n\n    address = address.replace('0x','').replace('0X','');\n\n    var asBn = new BigNumber(address, 16);\n    var base36 = asBn.toString(36);\n    var padded = leftPad(base36, 15);\n    return Iban.fromBban(padded.toUpperCase());\n};\n\n/**\n * Convert the passed BBAN to an IBAN for this country specification.\n * Please note that <i>\"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account\"</i>.\n * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits\n *\n * @method fromBban\n * @param {String} bban the BBAN to convert to IBAN\n * @returns {Iban} the IBAN object\n */\nIban.fromBban = function (bban) {\n    var countryCode = 'XE';\n\n    var remainder = mod9710(iso13616Prepare(countryCode + '00' + bban));\n    var checkDigit = ('0' + (98 - remainder)).slice(-2);\n\n    return new Iban(countryCode + checkDigit + bban);\n};\n\n/**\n * Should be used to create IBAN object for given institution and identifier\n *\n * @method createIndirect\n * @param {Object} options, required options are \"institution\" and \"identifier\"\n * @return {Iban} the IBAN object\n */\nIban.createIndirect = function (options) {\n    return Iban.fromBban('ETH' + options.institution + options.identifier);\n};\n\n/**\n * This method should be used to check if given string is valid iban object\n *\n * @method isValid\n * @param {String} iban string\n * @return {Boolean} true if it is valid IBAN\n */\nIban.isValid = function (iban) {\n    var i = new Iban(iban);\n    return i.isValid();\n};\n\n/**\n * Should be called to check if iban is correct\n *\n * @method isValid\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isValid = function () {\n    return /^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban) &&\n        mod9710(iso13616Prepare(this._iban)) === 1;\n};\n\n/**\n * Should be called to check if iban number is direct\n *\n * @method isDirect\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isDirect = function () {\n    return this._iban.length === 34 || this._iban.length === 35;\n};\n\n/**\n * Should be called to check if iban number if indirect\n *\n * @method isIndirect\n * @returns {Boolean} true if it is, otherwise false\n */\nIban.prototype.isIndirect = function () {\n    return this._iban.length === 20;\n};\n\n/**\n * Should be called to get iban checksum\n * Uses the mod-97-10 checksumming protocol (ISO/IEC 7064:2003)\n *\n * @method checksum\n * @returns {String} checksum\n */\nIban.prototype.checksum = function () {\n    return this._iban.substr(2, 2);\n};\n\n/**\n * Should be called to get institution identifier\n * eg. XREG\n *\n * @method institution\n * @returns {String} institution identifier\n */\nIban.prototype.institution = function () {\n    return this.isIndirect() ? this._iban.substr(7, 4) : '';\n};\n\n/**\n * Should be called to get client identifier within institution\n * eg. GAVOFYORK\n *\n * @method client\n * @returns {String} client identifier\n */\nIban.prototype.client = function () {\n    return this.isIndirect() ? this._iban.substr(11) : '';\n};\n\n/**\n * Should be called to get client direct address\n *\n * @method toAddress\n * @returns {String} ethereum address\n */\nIban.prototype.toAddress = function () {\n    if (this.isDirect()) {\n        var base36 = this._iban.substr(4);\n        var asBn = new BigNumber(base36, 36);\n        return utils.toChecksumAddress(asBn.toString(16, 20));\n    }\n\n    return '';\n};\n\nIban.prototype.toString = function () {\n    return this._iban;\n};\n\nmodule.exports = Iban;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-iban/src/index.js\n// module id = 559\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-iban/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(106);\nvar Method = __webpack_require__(105);\nvar utils = __webpack_require__(47);\nvar Net = __webpack_require__(211);\n\nvar formatters = __webpack_require__(35).formatters;\n\n\nvar Personal = function Personal() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    this.net = new Net(this.currentProvider);\n\n    var defaultAccount = null;\n    var defaultBlock = 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\n            }\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultAccount = defaultAccount;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultBlock = defaultBlock;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n\n\n    var methods = [\n        new Method({\n            name: 'getAccounts',\n            call: 'personal_listAccounts',\n            params: 0,\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'newAccount',\n            call: 'personal_newAccount',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'unlockAccount',\n            call: 'personal_unlockAccount',\n            params: 3,\n            inputFormatter: [formatters.inputAddressFormatter, null, null]\n        }),\n        new Method({\n            name: 'lockAccount',\n            call: 'personal_lockAccount',\n            params: 1,\n            inputFormatter: [formatters.inputAddressFormatter]\n        }),\n        new Method({\n            name: 'importRawKey',\n            call: 'personal_importRawKey',\n            params: 2\n        }),\n        new Method({\n            name: 'sendTransaction',\n            call: 'personal_sendTransaction',\n            params: 2,\n            inputFormatter: [formatters.inputTransactionFormatter, null]\n        }),\n        new Method({\n            name: 'sign',\n            call: 'personal_sign',\n            params: 3,\n            inputFormatter: [formatters.inputSignFormatter, formatters.inputAddressFormatter, null]\n        }),\n        new Method({\n            name: 'ecRecover',\n            call: 'personal_ecRecover',\n            params: 2,\n            inputFormatter: [formatters.inputSignFormatter, null]\n        })\n    ];\n    methods.forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n        method.defaultBlock = _this.defaultBlock;\n        method.defaultAccount = _this.defaultAccount;\n    });\n};\n\ncore.addProviders(Personal);\n\n\n\nmodule.exports = Personal;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-personal/src/index.js\n// module id = 560\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-personal/src/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(0).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-utils/~/bn.js/lib/bn.js\n// module id = 561\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-utils/node_modules/bn.js/lib/bn.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file utils.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar BN = __webpack_require__(561);\nvar numberToBN = __webpack_require__(294);\nvar utf8 = __webpack_require__(547);\nvar Hash = __webpack_require__(261);\n\n\n/**\n * Returns true if object is BN, otherwise false\n *\n * @method isBN\n * @param {Object} object\n * @return {Boolean}\n */\nvar isBN = function (object) {\n    return object instanceof BN ||\n        (object && object.constructor && object.constructor.name === 'BN');\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object} object\n * @return {Boolean}\n */\nvar isBigNumber = function (object) {\n    return object && object.constructor && object.constructor.name === 'BigNumber';\n};\n\n/**\n * Takes an input and transforms it into an BN\n *\n * @method toBN\n * @param {Number|String|BN} number, string, HEX string or BN\n * @return {BN} BN\n */\nvar toBN = function(number){\n    try {\n        return numberToBN.apply(null, arguments);\n    } catch(e) {\n        throw new Error(e + ' Given value: \"'+ number +'\"');\n    }\n};\n\n\n/**\n * Takes and input transforms it into BN and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BN} number\n * @return {String}\n */\nvar toTwosComplement = function (number) {\n    return '0x'+ toBN(number).toTwos(256).toString(16, 64);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX address\n * @return {Boolean}\n */\nvar isAddress = function (address) {\n    // check if it has the basic requirements of an address\n    if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {\n        return false;\n        // If it's ALL lowercase or ALL upppercase\n    } else if (/^(0x|0X)?[0-9a-f]{40}$/.test(address) || /^(0x|0X)?[0-9A-F]{40}$/.test(address)) {\n        return true;\n        // Otherwise check each case\n    } else {\n        return checkAddressChecksum(address);\n    }\n};\n\n\n\n/**\n * Checks if the given string is a checksummed address\n *\n * @method checkAddressChecksum\n * @param {String} address the given HEX address\n * @return {Boolean}\n */\nvar checkAddressChecksum = function (address) {\n    // Check each case\n    address = address.replace(/^0x/i,'');\n    var addressHash = sha3(address.toLowerCase()).replace(/^0x/i,'');\n\n    for (var i = 0; i < 40; i++ ) {\n        // the nth letter should be uppercase if the nth digit of casemap is 1\n        if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) {\n            return false;\n        }\n    }\n    return true;\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method leftPad\n * @param {String} string to be padded\n * @param {Number} chars that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar leftPad = function (string, chars, sign) {\n    var hasPrefix = /^0x/i.test(string) || typeof string === 'number';\n    string = string.toString(16).replace(/^0x/i,'');\n\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\n\n    return (hasPrefix ? '0x' : '') + new Array(padding).join(sign ? sign : \"0\") + string;\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method rightPad\n * @param {String} string to be padded\n * @param {Number} chars that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar rightPad = function (string, chars, sign) {\n    var hasPrefix = /^0x/i.test(string) || typeof string === 'number';\n    string = string.toString(16).replace(/^0x/i,'');\n\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\n\n    return (hasPrefix ? '0x' : '') + string + (new Array(padding).join(sign ? sign : \"0\"));\n};\n\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of utf8 string\n *\n * @method utf8ToHex\n * @param {String} str\n * @returns {String} hex representation of input string\n */\nvar utf8ToHex = function(str) {\n    str = utf8.encode(str);\n    var hex = \"\";\n\n    // remove \\u0000 padding from either side\n    str = str.replace(/^(?:\\u0000)*/,'');\n    str = str.split(\"\").reverse().join(\"\");\n    str = str.replace(/^(?:\\u0000)*/,'');\n    str = str.split(\"\").reverse().join(\"\");\n\n    for(var i = 0; i < str.length; i++) {\n        var code = str.charCodeAt(i);\n        // if (code !== 0) {\n        var n = code.toString(16);\n        hex += n.length < 2 ? '0' + n : n;\n        // }\n    }\n\n    return \"0x\" + hex;\n};\n\n/**\n * Should be called to get utf8 from it's hex representation\n *\n * @method hexToUtf8\n * @param {String} hex\n * @returns {String} ascii string representation of hex value\n */\nvar hexToUtf8 = function(hex) {\n    if (!isHexStrict(hex))\n        throw new Error('The parameter \"'+ hex +'\" must be a valid HEX string.');\n\n    var str = \"\";\n    var code = 0;\n    hex = hex.replace(/^0x/i,'');\n\n    // remove 00 padding from either side\n    hex = hex.replace(/^(?:00)*/,'');\n    hex = hex.split(\"\").reverse().join(\"\");\n    hex = hex.replace(/^(?:00)*/,'');\n    hex = hex.split(\"\").reverse().join(\"\");\n\n    var l = hex.length;\n\n    for (var i=0; i < l; i+=2) {\n        code = parseInt(hex.substr(i, 2), 16);\n        // if (code !== 0) {\n        str += String.fromCharCode(code);\n        // }\n    }\n\n    return utf8.decode(str);\n};\n\n\n/**\n * Converts value to it's number representation\n *\n * @method hexToNumber\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar hexToNumber = function (value) {\n    if (!value) {\n        return value;\n    }\n\n    return toBN(value).toNumber();\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method hexToNumberString\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar hexToNumberString = function (value) {\n    if (!value) return value;\n\n    return toBN(value).toString(10);\n};\n\n\n/**\n * Converts value to it's hex representation\n *\n * @method numberToHex\n * @param {String|Number|BN} value\n * @return {String}\n */\nvar numberToHex = function (value) {\n    if (_.isNull(value) || _.isUndefined(value)) {\n        return value;\n    }\n\n    if (!isFinite(value) && !isHexStrict(value)) {\n        throw new Error('Given input \"'+value+'\" is not a number.');\n    }\n\n    var number = toBN(value);\n    var result = number.toString(16);\n\n    return number.lt(new BN(0)) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n\n/**\n * Convert a byte array to a hex string\n *\n * Note: Implementation from crypto-js\n *\n * @method bytesToHex\n * @param {Array} bytes\n * @return {String} the hex string\n */\nvar bytesToHex = function(bytes) {\n    for (var hex = [], i = 0; i < bytes.length; i++) {\n        /* jshint ignore:start */\n        hex.push((bytes[i] >>> 4).toString(16));\n        hex.push((bytes[i] & 0xF).toString(16));\n        /* jshint ignore:end */\n    }\n    return '0x'+ hex.join(\"\");\n};\n\n/**\n * Convert a hex string to a byte array\n *\n * Note: Implementation from crypto-js\n *\n * @method hexToBytes\n * @param {string} hex\n * @return {Array} the byte array\n */\nvar hexToBytes = function(hex) {\n    hex = hex.toString(16);\n\n    if (!isHexStrict(hex)) {\n        throw new Error('Given value \"'+ hex +'\" is not a valid hex string.');\n    }\n\n    hex = hex.replace(/^0x/i,'');\n\n    for (var bytes = [], c = 0; c < hex.length; c += 2)\n        bytes.push(parseInt(hex.substr(c, 2), 16));\n    return bytes;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BN|Object} value\n * @param {Boolean} returnType\n * @return {String}\n */\nvar toHex = function (value, returnType) {\n    /*jshint maxcomplexity: false */\n\n    if (isAddress(value)) {\n        return returnType ? 'address' : '0x'+ value.toLowerCase().replace(/^0x/i,'');\n    }\n\n    if (_.isBoolean(value)) {\n        return returnType ? 'bool' : value ? '0x01' : '0x00';\n    }\n\n\n    if (_.isObject(value) && !isBigNumber(value) && !isBN(value)) {\n        return returnType ? 'string' : utf8ToHex(JSON.stringify(value));\n    }\n\n    // if its a negative number, pass it through numberToHex\n    if (_.isString(value)) {\n        if (value.indexOf('-0x') === 0 || value.indexOf('-0X') === 0) {\n            return returnType ? 'int256' : numberToHex(value);\n        } else if(value.indexOf('0x') === 0 || value.indexOf('0X') === 0) {\n            return returnType ? 'bytes' : value;\n        } else if (!isFinite(value)) {\n            return returnType ? 'string' : utf8ToHex(value);\n        }\n    }\n\n    return returnType ? (value < 0 ? 'int256' : 'uint256') : numberToHex(value);\n};\n\n\n/**\n * Check if string is HEX, requires a 0x in front\n *\n * @method isHexStrict\n * @param {String} hex to be checked\n * @returns {Boolean}\n */\nvar isHexStrict = function (hex) {\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-)?0x[0-9a-f]*$/i.test(hex));\n};\n\n/**\n * Check if string is HEX\n *\n * @method isHex\n * @param {String} hex to be checked\n * @returns {Boolean}\n */\nvar isHex = function (hex) {\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-0x|0x)?[0-9a-f]*$/i.test(hex));\n};\n\n\n/**\n * Returns true if given string is a valid Ethereum block header bloom.\n *\n * TODO UNDOCUMENTED\n *\n * @method isBloom\n * @param {String} hex encoded bloom filter\n * @return {Boolean}\n */\nvar isBloom = function (bloom) {\n    if (!/^(0x)?[0-9a-f]{512}$/i.test(bloom)) {\n        return false;\n    } else if (/^(0x)?[0-9a-f]{512}$/.test(bloom) || /^(0x)?[0-9A-F]{512}$/.test(bloom)) {\n        return true;\n    }\n    return false;\n};\n\n/**\n * Returns true if given string is a valid log topic.\n *\n * TODO UNDOCUMENTED\n *\n * @method isTopic\n * @param {String} hex encoded topic\n * @return {Boolean}\n */\nvar isTopic = function (topic) {\n    if (!/^(0x)?[0-9a-f]{64}$/i.test(topic)) {\n        return false;\n    } else if (/^(0x)?[0-9a-f]{64}$/.test(topic) || /^(0x)?[0-9A-F]{64}$/.test(topic)) {\n        return true;\n    }\n    return false;\n};\n\n\n/**\n * Hashes values to a sha3 hash using keccak 256\n *\n * To hash a HEX string the hex must have 0x in front.\n *\n * @method sha3\n * @return {String} the sha3 string\n */\nvar SHA3_NULL_S = '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470';\n\nvar sha3 = function (value) {\n    if (isHexStrict(value) && /^0x/i.test((value).toString())) {\n        value = hexToBytes(value);\n    }\n\n    var returnValue = Hash.keccak256(value); // jshint ignore:line\n\n    if(returnValue === SHA3_NULL_S) {\n        return null;\n    } else {\n        return returnValue;\n    }\n};\n// expose the under the hood keccak256\nsha3._Hash = Hash;\n\n\nmodule.exports = {\n    BN: BN,\n    isBN: isBN,\n    isBigNumber: isBigNumber,\n    toBN: toBN,\n    isAddress: isAddress,\n    isBloom: isBloom, // TODO UNDOCUMENTED\n    isTopic: isTopic, // TODO UNDOCUMENTED\n    checkAddressChecksum: checkAddressChecksum,\n    utf8ToHex: utf8ToHex,\n    hexToUtf8: hexToUtf8,\n    hexToNumber: hexToNumber,\n    hexToNumberString: hexToNumberString,\n    numberToHex: numberToHex,\n    toHex: toHex,\n    hexToBytes: hexToBytes,\n    bytesToHex: bytesToHex,\n    isHex: isHex,\n    isHexStrict: isHexStrict,\n    leftPad: leftPad,\n    rightPad: rightPad,\n    toTwosComplement: toTwosComplement,\n    sha3: sha3\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-utils/src/utils.js\n// module id = 562\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-utils/src/utils.js")},function(module,exports){eval("module.exports = XMLHttpRequest;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr2/lib/browser.js\n// module id = 563\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr2/lib/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n  , length = 64\n  , map = {}\n  , seed = 0\n  , i = 0\n  , prev;\n\n/**\n * Return a string representing the specified number.\n *\n * @param {Number} num The number to convert.\n * @returns {String} The string representation of the number.\n * @api public\n */\nfunction encode(num) {\n  var encoded = '';\n\n  do {\n    encoded = alphabet[num % length] + encoded;\n    num = Math.floor(num / length);\n  } while (num > 0);\n\n  return encoded;\n}\n\n/**\n * Return the integer value specified by the given string.\n *\n * @param {String} str The string to convert.\n * @returns {Number} The integer value represented by the string.\n * @api public\n */\nfunction decode(str) {\n  var decoded = 0;\n\n  for (i = 0; i < str.length; i++) {\n    decoded = decoded * length + map[str.charAt(i)];\n  }\n\n  return decoded;\n}\n\n/**\n * Yeast: A tiny growing id generator.\n *\n * @returns {String} A unique id.\n * @api public\n */\nfunction yeast() {\n  var now = encode(+new Date());\n\n  if (now !== prev) return seed = 0, prev = now;\n  return now +'.'+ encode(seed++);\n}\n\n//\n// Map each character to its index.\n//\nfor (; i < length; i++) map[alphabet[i]] = i;\n\n//\n// Expose the `yeast`, `encode` and `decode` functions.\n//\nyeast.encode = encode;\nyeast.decode = decode;\nmodule.exports = yeast;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/yeast/index.js\n// module id = 564\n// module chunks = 0\n\n//# sourceURL=../node_modules/yeast/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar BlockHeader = __webpack_require__(212);\nvar BufferUtil = __webpack_require__(18);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar Hash = __webpack_require__(36);\nvar JSUtil = __webpack_require__(24);\nvar Transaction = __webpack_require__(216);\nvar $ = __webpack_require__(13);\n\n/**\n * Instantiate a MerkleBlock from a Buffer, JSON object, or Object with\n * the properties of the Block\n *\n * @param {*} - A Buffer, JSON string, or Object representing a MerkleBlock\n * @returns {MerkleBlock}\n * @constructor\n */\nfunction MerkleBlock(arg) {\n  /* jshint maxstatements: 18 */\n\n  if (!(this instanceof MerkleBlock)) {\n    return new MerkleBlock(arg);\n  }\n\n  var info = {};\n  if (BufferUtil.isBuffer(arg)) {\n    info = MerkleBlock._fromBufferReader(BufferReader(arg));\n  } else if (_.isObject(arg)) {\n    var header;\n    if(arg.header instanceof BlockHeader) {\n      header = arg.header;\n    } else {\n      header = BlockHeader.fromObject(arg.header);\n    }\n    info = {\n      /**\n       * @name MerkleBlock#header\n       * @type {BlockHeader}\n       */\n      header: header,\n      /**\n       * @name MerkleBlock#numTransactions\n       * @type {Number}\n       */\n      numTransactions: arg.numTransactions,\n      /**\n       * @name MerkleBlock#hashes\n       * @type {String[]}\n       */\n      hashes: arg.hashes,\n      /**\n       * @name MerkleBlock#flags\n       * @type {Number[]}\n       */\n      flags: arg.flags\n    };\n  } else {\n    throw new TypeError('Unrecognized argument for MerkleBlock');\n  }\n  _.extend(this,info);\n  this._flagBitsUsed = 0;\n  this._hashesUsed = 0;\n  return this;\n}\n\n/**\n * @param {Buffer} - MerkleBlock data in a Buffer object\n * @returns {MerkleBlock} - A MerkleBlock object\n */\nMerkleBlock.fromBuffer = function fromBuffer(buf) {\n  return MerkleBlock.fromBufferReader(BufferReader(buf));\n};\n\n/**\n * @param {BufferReader} - MerkleBlock data in a BufferReader object\n * @returns {MerkleBlock} - A MerkleBlock object\n */\nMerkleBlock.fromBufferReader = function fromBufferReader(br) {\n  return new MerkleBlock(MerkleBlock._fromBufferReader(br));\n};\n\n/**\n * @returns {Buffer} - A buffer of the block\n */\nMerkleBlock.prototype.toBuffer = function toBuffer() {\n  return this.toBufferWriter().concat();\n};\n\n/**\n * @param {BufferWriter} - An existing instance of BufferWriter\n * @returns {BufferWriter} - An instance of BufferWriter representation of the MerkleBlock\n */\nMerkleBlock.prototype.toBufferWriter = function toBufferWriter(bw) {\n  if (!bw) {\n    bw = new BufferWriter();\n  }\n  bw.write(this.header.toBuffer());\n  bw.writeUInt32LE(this.numTransactions);\n  bw.writeVarintNum(this.hashes.length);\n  for (var i = 0; i < this.hashes.length; i++) {\n    bw.write(new Buffer(this.hashes[i], 'hex'));\n  }\n  bw.writeVarintNum(this.flags.length);\n  for (i = 0; i < this.flags.length; i++) {\n    bw.writeUInt8(this.flags[i]);\n  }\n  return bw;\n};\n\n/**\n * @returns {Object} - A plain object with the MerkleBlock properties\n */\nMerkleBlock.prototype.toObject = MerkleBlock.prototype.toJSON = function toObject() {\n  return {\n    header: this.header.toObject(),\n    numTransactions: this.numTransactions,\n    hashes: this.hashes,\n    flags: this.flags\n  };\n};\n\n/**\n * Verify that the MerkleBlock is valid\n * @returns {Boolean} - True/False whether this MerkleBlock is Valid\n */\nMerkleBlock.prototype.validMerkleTree = function validMerkleTree() {\n  $.checkState(_.isArray(this.flags), 'MerkleBlock flags is not an array');\n  $.checkState(_.isArray(this.hashes), 'MerkleBlock hashes is not an array');\n\n  // Can't have more hashes than numTransactions\n  if(this.hashes.length > this.numTransactions) {\n    return false;\n  }\n\n  // Can't have more flag bits than num hashes\n  if(this.flags.length * 8 < this.hashes.length) {\n    return false;\n  }\n\n  var height = this._calcTreeHeight();\n  var opts = { hashesUsed: 0, flagBitsUsed: 0 };\n  var root = this._traverseMerkleTree(height, 0, opts);\n  if(opts.hashesUsed !== this.hashes.length) {\n    return false;\n  }\n  return BufferUtil.equals(root, this.header.merkleRoot);\n};\n\n/**\n * Traverse a the tree in this MerkleBlock, validating it along the way\n * Modeled after Bitcoin Core merkleblock.cpp TraverseAndExtract()\n * @param {Number} - depth - Current height\n * @param {Number} - pos - Current position in the tree\n * @param {Object} - opts - Object with values that need to be mutated throughout the traversal\n * @param {Number} - opts.flagBitsUsed - Number of flag bits used, should start at 0\n * @param {Number} - opts.hashesUsed - Number of hashes used, should start at 0\n * @param {Array} - opts.txs - Will finish populated by transactions found during traversal\n * @returns {Buffer|null} - Buffer containing the Merkle Hash for that height\n * @private\n */\nMerkleBlock.prototype._traverseMerkleTree = function traverseMerkleTree(depth, pos, opts) {\n  /* jshint maxcomplexity:  12*/\n  /* jshint maxstatements: 20 */\n\n  opts = opts || {};\n  opts.txs = opts.txs || [];\n  opts.flagBitsUsed = opts.flagBitsUsed || 0;\n  opts.hashesUsed = opts.hashesUsed || 0;\n\n  if(opts.flagBitsUsed > this.flags.length * 8) {\n    return null;\n  }\n  var isParentOfMatch = (this.flags[opts.flagBitsUsed >> 3] >>> (opts.flagBitsUsed++ & 7)) & 1;\n  if(depth === 0 || !isParentOfMatch) {\n    if(opts.hashesUsed >= this.hashes.length) {\n      return null;\n    }\n    var hash = this.hashes[opts.hashesUsed++];\n    if(depth === 0 && isParentOfMatch) {\n      opts.txs.push(hash);\n    }\n    return new Buffer(hash, 'hex');\n  } else {\n    var left = this._traverseMerkleTree(depth-1, pos*2, opts);\n    var right = left;\n    if(pos*2+1 < this._calcTreeWidth(depth-1)) {\n      right = this._traverseMerkleTree(depth-1, pos*2+1, opts);\n    }\n    return Hash.sha256sha256(new Buffer.concat([left, right]));\n  }\n};\n\n/** Calculates the width of a merkle tree at a given height.\n *  Modeled after Bitcoin Core merkleblock.h CalcTreeWidth()\n * @param {Number} - Height at which we want the tree width\n * @returns {Number} - Width of the tree at a given height\n * @private\n */\nMerkleBlock.prototype._calcTreeWidth = function calcTreeWidth(height) {\n  return (this.numTransactions + (1 << height) - 1) >> height;\n};\n\n/** Calculates the height of the merkle tree in this MerkleBlock\n * @param {Number} - Height at which we want the tree width\n * @returns {Number} - Height of the merkle tree in this MerkleBlock\n * @private\n */\nMerkleBlock.prototype._calcTreeHeight = function calcTreeHeight() {\n  var height = 0;\n  while (this._calcTreeWidth(height) > 1) {\n    height++;\n  }\n  return height;\n};\n\n/**\n * @param {Transaction|String} - Transaction or Transaction ID Hash\n * @returns {Boolean} - return true/false if this MerkleBlock has the TX or not\n * @private\n */\nMerkleBlock.prototype.hasTransaction = function hasTransaction(tx) {\n  $.checkArgument(!_.isUndefined(tx), 'tx cannot be undefined');\n  $.checkArgument(tx instanceof Transaction || typeof tx === 'string',\n      'Invalid tx given, tx must be a \"string\" or \"Transaction\"');\n\n  var hash = tx;\n  if(tx instanceof Transaction) {\n    // We need to reverse the id hash for the lookup\n    hash = BufferUtil.reverse(new Buffer(tx.id, 'hex')).toString('hex');\n  }\n\n  var txs = [];\n  var height = this._calcTreeHeight();\n  this._traverseMerkleTree(height, 0, { txs: txs });\n  return txs.indexOf(hash) !== -1;\n};\n\n/**\n * @param {Buffer} - MerkleBlock data\n * @returns {Object} - An Object representing merkleblock data\n * @private\n */\nMerkleBlock._fromBufferReader = function _fromBufferReader(br) {\n  $.checkState(!br.finished(), 'No merkleblock data received');\n  var info = {};\n  info.header = BlockHeader.fromBufferReader(br);\n  info.numTransactions = br.readUInt32LE();\n  var numHashes = br.readVarintNum();\n  info.hashes = [];\n  for (var i = 0; i < numHashes; i++) {\n    info.hashes.push(br.read(32).toString('hex'));\n  }\n  var numFlags = br.readVarintNum();\n  info.flags = [];\n  for (i = 0; i < numFlags; i++) {\n    info.flags.push(br.readUInt8());\n  }\n  return info;\n};\n\n/**\n * @param {Object} - A plain JavaScript object\n * @returns {Block} - An instance of block\n */\nMerkleBlock.fromObject = function fromObject(obj) {\n  return new MerkleBlock(obj);\n};\n\nmodule.exports = MerkleBlock;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/block/merkleblock.js\n// module id = 565\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/block/merkleblock.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BN = __webpack_require__(30);\nvar Point = __webpack_require__(125);\nvar Signature = __webpack_require__(55);\nvar PublicKey = __webpack_require__(66);\nvar Random = __webpack_require__(213);\nvar Hash = __webpack_require__(36);\nvar BufferUtil = __webpack_require__(18);\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\n\nvar ECDSA = function ECDSA(obj) {\n  if (!(this instanceof ECDSA)) {\n    return new ECDSA(obj);\n  }\n  if (obj) {\n    this.set(obj);\n  }\n};\n\n/* jshint maxcomplexity: 9 */\nECDSA.prototype.set = function(obj) {\n  this.hashbuf = obj.hashbuf || this.hashbuf;\n  this.endian = obj.endian || this.endian; //the endianness of hashbuf\n  this.privkey = obj.privkey || this.privkey;\n  this.pubkey = obj.pubkey || (this.privkey ? this.privkey.publicKey : this.pubkey);\n  this.sig = obj.sig || this.sig;\n  this.k = obj.k || this.k;\n  this.verified = obj.verified || this.verified;\n  return this;\n};\n\nECDSA.prototype.privkey2pubkey = function() {\n  this.pubkey = this.privkey.toPublicKey();\n};\n\nECDSA.prototype.calci = function() {\n  for (var i = 0; i < 4; i++) {\n    this.sig.i = i;\n    var Qprime;\n    try {\n      Qprime = this.toPublicKey();\n    } catch (e) {\n      console.error(e);\n      continue;\n    }\n\n    if (Qprime.point.eq(this.pubkey.point)) {\n      this.sig.compressed = this.pubkey.compressed;\n      return this;\n    }\n  }\n\n  this.sig.i = undefined;\n  throw new Error('Unable to find valid recovery factor');\n};\n\nECDSA.fromString = function(str) {\n  var obj = JSON.parse(str);\n  return new ECDSA(obj);\n};\n\nECDSA.prototype.randomK = function() {\n  var N = Point.getN();\n  var k;\n  do {\n    k = BN.fromBuffer(Random.getRandomBuffer(32));\n  } while (!(k.lt(N) && k.gt(BN.Zero)));\n  this.k = k;\n  return this;\n};\n\n\n// https://tools.ietf.org/html/rfc6979#section-3.2\nECDSA.prototype.deterministicK = function(badrs) {\n  /* jshint maxstatements: 25 */\n  // if r or s were invalid when this function was used in signing,\n  // we do not want to actually compute r, s here for efficiency, so,\n  // we can increment badrs. explained at end of RFC 6979 section 3.2\n  if (_.isUndefined(badrs)) {\n    badrs = 0;\n  }\n  var v = new Buffer(32);\n  v.fill(0x01);\n  var k = new Buffer(32);\n  k.fill(0x00);\n  var x = this.privkey.bn.toBuffer({\n    size: 32\n  });\n  var hashbuf = this.endian === 'little' ? BufferUtil.reverse(this.hashbuf) : this.hashbuf\n  k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x00]), x, hashbuf]), k);\n  v = Hash.sha256hmac(v, k);\n  k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x01]), x, hashbuf]), k);\n  v = Hash.sha256hmac(v, k);\n  v = Hash.sha256hmac(v, k);\n  var T = BN.fromBuffer(v);\n  var N = Point.getN();\n\n  // also explained in 3.2, we must ensure T is in the proper range (0, N)\n  for (var i = 0; i < badrs || !(T.lt(N) && T.gt(BN.Zero)); i++) {\n    k = Hash.sha256hmac(Buffer.concat([v, new Buffer([0x00])]), k);\n    v = Hash.sha256hmac(v, k);\n    v = Hash.sha256hmac(v, k);\n    T = BN.fromBuffer(v);\n  }\n\n  this.k = T;\n  return this;\n};\n\n// Information about public key recovery:\n// https://bitcointalk.org/index.php?topic=6430.0\n// http://stackoverflow.com/questions/19665491/how-do-i-get-an-ecdsa-public-key-from-just-a-bitcoin-signature-sec1-4-1-6-k\nECDSA.prototype.toPublicKey = function() {\n  /* jshint maxstatements: 25 */\n  var i = this.sig.i;\n  $.checkArgument(i === 0 || i === 1 || i === 2 || i === 3, new Error('i must be equal to 0, 1, 2, or 3'));\n\n  var e = BN.fromBuffer(this.hashbuf);\n  var r = this.sig.r;\n  var s = this.sig.s;\n\n  // A set LSB signifies that the y-coordinate is odd\n  var isYOdd = i & 1;\n\n  // The more significant bit specifies whether we should use the\n  // first or second candidate key.\n  var isSecondKey = i >> 1;\n\n  var n = Point.getN();\n  var G = Point.getG();\n\n  // 1.1 Let x = r + jn\n  var x = isSecondKey ? r.add(n) : r;\n  var R = Point.fromX(isYOdd, x);\n\n  // 1.4 Check that nR is at infinity\n  var nR = R.mul(n);\n\n  if (!nR.isInfinity()) {\n    throw new Error('nR is not a valid curve point');\n  }\n\n  // Compute -e from e\n  var eNeg = e.neg().mod(n);\n\n  // 1.6.1 Compute Q = r^-1 (sR - eG)\n  // Q = r^-1 (sR + -eG)\n  var rInv = r.invm(n);\n\n  //var Q = R.multiplyTwo(s, G, eNeg).mul(rInv);\n  var Q = R.mul(s).add(G.mul(eNeg)).mul(rInv);\n\n  var pubkey = PublicKey.fromPoint(Q, this.sig.compressed);\n\n  return pubkey;\n};\n\nECDSA.prototype.sigError = function() {\n  /* jshint maxstatements: 25 */\n  if (!BufferUtil.isBuffer(this.hashbuf) || this.hashbuf.length !== 32) {\n    return 'hashbuf must be a 32 byte buffer';\n  }\n\n  var r = this.sig.r;\n  var s = this.sig.s;\n  if (!(r.gt(BN.Zero) && r.lt(Point.getN())) || !(s.gt(BN.Zero) && s.lt(Point.getN()))) {\n    return 'r and s not in range';\n  }\n\n  var e = BN.fromBuffer(this.hashbuf, this.endian ? {\n    endian: this.endian\n  } : undefined);\n  var n = Point.getN();\n  var sinv = s.invm(n);\n  var u1 = sinv.mul(e).mod(n);\n  var u2 = sinv.mul(r).mod(n);\n\n  var p = Point.getG().mulAdd(u1, this.pubkey.point, u2);\n  if (p.isInfinity()) {\n    return 'p is infinity';\n  }\n\n  if (p.getX().mod(n).cmp(r) !== 0) {\n    return 'Invalid signature';\n  } else {\n    return false;\n  }\n};\n\nECDSA.toLowS = function(s) {\n  //enforce low s\n  //see BIP 62, \"low S values in signatures\"\n  if (s.gt(BN.fromBuffer(new Buffer('7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0', 'hex')))) {\n    s = Point.getN().sub(s);\n  }\n  return s;\n};\n\nECDSA.prototype._findSignature = function(d, e) {\n  var N = Point.getN();\n  var G = Point.getG();\n  // try different values of k until r, s are valid\n  var badrs = 0;\n  var k, Q, r, s;\n  do {\n    if (!this.k || badrs > 0) {\n      this.deterministicK(badrs);\n    }\n    badrs++;\n    k = this.k;\n    Q = G.mul(k);\n    r = Q.x.mod(N);\n    s = k.invm(N).mul(e.add(d.mul(r))).mod(N);\n  } while (r.cmp(BN.Zero) <= 0 || s.cmp(BN.Zero) <= 0);\n\n  s = ECDSA.toLowS(s);\n  return {\n    s: s,\n    r: r\n  };\n\n};\n\nECDSA.prototype.sign = function() {\n  var hashbuf = this.hashbuf;\n  var privkey = this.privkey;\n  var d = privkey.bn;\n\n  $.checkState(hashbuf && privkey && d, new Error('invalid parameters'));\n  $.checkState(BufferUtil.isBuffer(hashbuf) && hashbuf.length === 32, new Error('hashbuf must be a 32 byte buffer'));\n\n  var e = BN.fromBuffer(hashbuf, this.endian ? {\n    endian: this.endian\n  } : undefined);\n\n  var obj = this._findSignature(d, e);\n  obj.compressed = this.pubkey.compressed;\n\n  this.sig = new Signature(obj);\n  return this;\n};\n\nECDSA.prototype.signRandomK = function() {\n  this.randomK();\n  return this.sign();\n};\n\nECDSA.prototype.toString = function() {\n  var obj = {};\n  if (this.hashbuf) {\n    obj.hashbuf = this.hashbuf.toString('hex');\n  }\n  if (this.privkey) {\n    obj.privkey = this.privkey.toString();\n  }\n  if (this.pubkey) {\n    obj.pubkey = this.pubkey.toString();\n  }\n  if (this.sig) {\n    obj.sig = this.sig.toString();\n  }\n  if (this.k) {\n    obj.k = this.k.toString();\n  }\n  return JSON.stringify(obj);\n};\n\nECDSA.prototype.verify = function() {\n  if (!this.sigError()) {\n    this.verified = true;\n  } else {\n    this.verified = false;\n  }\n  return this;\n};\n\nECDSA.sign = function(hashbuf, privkey, endian) {\n  return ECDSA().set({\n    hashbuf: hashbuf,\n    endian: endian,\n    privkey: privkey\n  }).sign().sig;\n};\n\nECDSA.verify = function(hashbuf, sig, pubkey, endian) {\n  return ECDSA().set({\n    hashbuf: hashbuf,\n    endian: endian,\n    sig: sig,\n    pubkey: pubkey\n  }).verify().verified;\n};\n\nmodule.exports = ECDSA;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/crypto/ecdsa.js\n// module id = 566\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/crypto/ecdsa.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\n\nvar assert = __webpack_require__(16);\nvar buffer = __webpack_require__(0);\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\n\nvar BN = __webpack_require__(30);\nvar Base58 = __webpack_require__(214);\nvar Base58Check = __webpack_require__(158);\nvar Hash = __webpack_require__(36);\nvar Network = __webpack_require__(109);\nvar HDKeyCache = __webpack_require__(316);\nvar Point = __webpack_require__(125);\nvar PrivateKey = __webpack_require__(215);\nvar Random = __webpack_require__(213);\n\nvar errors = __webpack_require__(56);\nvar hdErrors = errors.HDPrivateKey;\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\nvar MINIMUM_ENTROPY_BITS = 128;\nvar BITS_TO_BYTES = 1 / 8;\nvar MAXIMUM_ENTROPY_BITS = 512;\n\n\n/**\n * Represents an instance of an hierarchically derived private key.\n *\n * More info on https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\n *\n * @constructor\n * @param {string|Buffer|Object} arg\n */\nfunction HDPrivateKey(arg) {\n  /* jshint maxcomplexity: 10 */\n  if (arg instanceof HDPrivateKey) {\n    return arg;\n  }\n  if (!(this instanceof HDPrivateKey)) {\n    return new HDPrivateKey(arg);\n  }\n  if (!arg) {\n    return this._generateRandomly();\n  }\n\n  if (Network.get(arg)) {\n    return this._generateRandomly(arg);\n  } else if (_.isString(arg) || BufferUtil.isBuffer(arg)) {\n    if (HDPrivateKey.isValidSerialized(arg)) {\n      this._buildFromSerialized(arg);\n    } else if (JSUtil.isValidJSON(arg)) {\n      this._buildFromJSON(arg);\n    } else if (BufferUtil.isBuffer(arg) && HDPrivateKey.isValidSerialized(arg.toString())) {\n      this._buildFromSerialized(arg.toString());\n    } else {\n      throw HDPrivateKey.getSerializedError(arg);\n    }\n  } else if (_.isObject(arg)) {\n    this._buildFromObject(arg);\n  } else {\n    throw new hdErrors.UnrecognizedArgument(arg);\n  }\n}\n\n/**\n * Verifies that a given path is valid.\n *\n * @param {string|number} arg\n * @param {boolean?} hardened\n * @return {boolean}\n */\nHDPrivateKey.isValidPath = function(arg, hardened) {\n  if (_.isString(arg)) {\n    var indexes = HDPrivateKey._getDerivationIndexes(arg);\n    return indexes !== null && _.all(indexes, HDPrivateKey.isValidPath);\n  }\n\n  if (_.isNumber(arg)) {\n    if (arg < HDPrivateKey.Hardened && hardened === true) {\n      arg += HDPrivateKey.Hardened;\n    }\n    return arg >= 0 && arg < HDPrivateKey.MaxIndex;\n  }\n\n  return false;\n};\n\n/**\n * Internal function that splits a string path into a derivation index array.\n * It will return null if the string path is malformed.\n * It does not validate if indexes are in bounds.\n *\n * @param {string} path\n * @return {Array}\n */\nHDPrivateKey._getDerivationIndexes = function(path) {\n  var steps = path.split('/');\n\n  // Special cases:\n  if (_.contains(HDPrivateKey.RootElementAlias, path)) {\n    return [];\n  }\n\n  if (!_.contains(HDPrivateKey.RootElementAlias, steps[0])) {\n    return null;\n  }\n\n  var indexes = steps.slice(1).map(function(step) {\n    var isHardened = step.slice(-1) === '\\'';\n    if (isHardened) {\n      step = step.slice(0, -1);\n    }\n    if (!step || step[0] === '-') {\n      return NaN;\n    }\n    var index = +step; // cast to number\n    if (isHardened) {\n      index += HDPrivateKey.Hardened;\n    }\n\n    return index;\n  });\n\n  return _.any(indexes, isNaN) ? null : indexes;\n};\n\n/**\n * Get a derived child based on a string or number.\n *\n * If the first argument is a string, it's parsed as the full path of\n * derivation. Valid values for this argument include \"m\" (which returns the\n * same private key), \"m/0/1/40/2'/1000\", where the ' quote means a hardened\n * derivation.\n *\n * If the first argument is a number, the child with that index will be\n * derived. If the second argument is truthy, the hardened version will be\n * derived. See the example usage for clarification.\n *\n * @example\n * ```javascript\n * var parent = new HDPrivateKey('xprv...');\n * var child_0_1_2h = parent.derive(0).derive(1).derive(2, true);\n * var copy_of_child_0_1_2h = parent.derive(\"m/0/1/2'\");\n * assert(child_0_1_2h.xprivkey === copy_of_child_0_1_2h);\n * ```\n *\n * @param {string|number} arg\n * @param {boolean?} hardened\n */\nHDPrivateKey.prototype.derive = function(arg, hardened) {\n  if (_.isNumber(arg)) {\n    return this._deriveWithNumber(arg, hardened);\n  } else if (_.isString(arg)) {\n    return this._deriveFromString(arg);\n  } else {\n    throw new hdErrors.InvalidDerivationArgument(arg);\n  }\n};\n\nHDPrivateKey.prototype._deriveWithNumber = function(index, hardened) {\n  /* jshint maxstatements: 20 */\n  /* jshint maxcomplexity: 10 */\n  if (!HDPrivateKey.isValidPath(index, hardened)) {\n    throw new hdErrors.InvalidPath(index);\n  }\n\n  hardened = index >= HDPrivateKey.Hardened ? true : hardened;\n  if (index < HDPrivateKey.Hardened && hardened === true) {\n    index += HDPrivateKey.Hardened;\n  }\n\n  var cached = HDKeyCache.get(this.xprivkey, index, hardened);\n  if (cached) {\n    return cached;\n  }\n\n  var indexBuffer = BufferUtil.integerAsBuffer(index);\n  var data;\n  if (hardened) {\n    data = BufferUtil.concat([new buffer.Buffer([0]), this.privateKey.toBuffer(), indexBuffer]);\n  } else {\n    data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]);\n  }\n  var hash = Hash.sha512hmac(data, this._buffers.chainCode);\n  var leftPart = BN.fromBuffer(hash.slice(0, 32), {\n    size: 32\n  });\n  var chainCode = hash.slice(32, 64);\n\n  var privateKey = leftPart.add(this.privateKey.toBigNumber()).mod(Point.getN()).toBuffer({\n    size: 32\n  });\n\n  var derived = new HDPrivateKey({\n    network: this.network,\n    depth: this.depth + 1,\n    parentFingerPrint: this.fingerPrint,\n    childIndex: index,\n    chainCode: chainCode,\n    privateKey: privateKey\n  });\n  HDKeyCache.set(this.xprivkey, index, hardened, derived);\n  return derived;\n};\n\nHDPrivateKey.prototype._deriveFromString = function(path) {\n  if (!HDPrivateKey.isValidPath(path)) {\n    throw new hdErrors.InvalidPath(path);\n  }\n\n  var indexes = HDPrivateKey._getDerivationIndexes(path);\n  var derived = indexes.reduce(function(prev, index) {\n    return prev._deriveWithNumber(index);\n  }, this);\n\n  return derived;\n};\n\n/**\n * Verifies that a given serialized private key in base58 with checksum format\n * is valid.\n *\n * @param {string|Buffer} data - the serialized private key\n * @param {string|Network=} network - optional, if present, checks that the\n *     network provided matches the network serialized.\n * @return {boolean}\n */\nHDPrivateKey.isValidSerialized = function(data, network) {\n  return !HDPrivateKey.getSerializedError(data, network);\n};\n\n/**\n * Checks what's the error that causes the validation of a serialized private key\n * in base58 with checksum to fail.\n *\n * @param {string|Buffer} data - the serialized private key\n * @param {string|Network=} network - optional, if present, checks that the\n *     network provided matches the network serialized.\n * @return {errors.InvalidArgument|null}\n */\nHDPrivateKey.getSerializedError = function(data, network) {\n  /* jshint maxcomplexity: 10 */\n  if (!(_.isString(data) || BufferUtil.isBuffer(data))) {\n    return new hdErrors.UnrecognizedArgument('Expected string or buffer');\n  }\n  if (!Base58.validCharacters(data)) {\n    return new errors.InvalidB58Char('(unknown)', data);\n  }\n  try {\n    data = Base58Check.decode(data);\n  } catch (e) {\n    return new errors.InvalidB58Checksum(data);\n  }\n  if (data.length !== HDPrivateKey.DataLength) {\n    return new hdErrors.InvalidLength(data);\n  }\n  if (!_.isUndefined(network)) {\n    var error = HDPrivateKey._validateNetwork(data, network);\n    if (error) {\n      return error;\n    }\n  }\n  return null;\n};\n\nHDPrivateKey._validateNetwork = function(data, networkArg) {\n  var network = Network.get(networkArg);\n  if (!network) {\n    return new errors.InvalidNetworkArgument(networkArg);\n  }\n  var version = data.slice(0, 4);\n  if (BufferUtil.integerFromBuffer(version) !== network.xprivkey) {\n    return new errors.InvalidNetwork(version);\n  }\n  return null;\n};\n\nHDPrivateKey.fromString = function(arg) {\n  $.checkArgument(_.isString(arg), 'No valid string was provided');\n  return new HDPrivateKey(arg);\n};\n\nHDPrivateKey.fromObject = function(arg) {\n  $.checkArgument(_.isObject(arg), 'No valid argument was provided');\n  return new HDPrivateKey(arg);\n};\n\nHDPrivateKey.prototype._buildFromJSON = function(arg) {\n  return this._buildFromObject(JSON.parse(arg));\n};\n\nHDPrivateKey.prototype._buildFromObject = function(arg) {\n  /* jshint maxcomplexity: 12 */\n  // TODO: Type validation\n  var buffers = {\n    version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xprivkey) : arg.version,\n    depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth,\n    parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint,\n    childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex,\n    chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode,\n    privateKey: (_.isString(arg.privateKey) && JSUtil.isHexa(arg.privateKey)) ? BufferUtil.hexToBuffer(arg.privateKey) : arg.privateKey,\n    checksum: arg.checksum ? (arg.checksum.length ? arg.checksum : BufferUtil.integerAsBuffer(arg.checksum)) : undefined\n  };\n  return this._buildFromBuffers(buffers);\n};\n\nHDPrivateKey.prototype._buildFromSerialized = function(arg) {\n  var decoded = Base58Check.decode(arg);\n  var buffers = {\n    version: decoded.slice(HDPrivateKey.VersionStart, HDPrivateKey.VersionEnd),\n    depth: decoded.slice(HDPrivateKey.DepthStart, HDPrivateKey.DepthEnd),\n    parentFingerPrint: decoded.slice(HDPrivateKey.ParentFingerPrintStart,\n      HDPrivateKey.ParentFingerPrintEnd),\n    childIndex: decoded.slice(HDPrivateKey.ChildIndexStart, HDPrivateKey.ChildIndexEnd),\n    chainCode: decoded.slice(HDPrivateKey.ChainCodeStart, HDPrivateKey.ChainCodeEnd),\n    privateKey: decoded.slice(HDPrivateKey.PrivateKeyStart, HDPrivateKey.PrivateKeyEnd),\n    checksum: decoded.slice(HDPrivateKey.ChecksumStart, HDPrivateKey.ChecksumEnd),\n    xprivkey: arg\n  };\n  return this._buildFromBuffers(buffers);\n};\n\nHDPrivateKey.prototype._generateRandomly = function(network) {\n  return HDPrivateKey.fromSeed(Random.getRandomBuffer(64), network);\n};\n\n/**\n * Generate a private key from a seed, as described in BIP32\n *\n * @param {string|Buffer} hexa\n * @param {*} network\n * @return HDPrivateKey\n */\nHDPrivateKey.fromSeed = function(hexa, network) {\n  /* jshint maxcomplexity: 8 */\n  if (JSUtil.isHexaString(hexa)) {\n    hexa = BufferUtil.hexToBuffer(hexa);\n  }\n  if (!Buffer.isBuffer(hexa)) {\n    throw new hdErrors.InvalidEntropyArgument(hexa);\n  }\n  if (hexa.length < MINIMUM_ENTROPY_BITS * BITS_TO_BYTES) {\n    throw new hdErrors.InvalidEntropyArgument.NotEnoughEntropy(hexa);\n  }\n  if (hexa.length > MAXIMUM_ENTROPY_BITS * BITS_TO_BYTES) {\n    throw new hdErrors.InvalidEntropyArgument.TooMuchEntropy(hexa);\n  }\n  var hash = Hash.sha512hmac(hexa, new buffer.Buffer('Bitcoin seed'));\n\n  return new HDPrivateKey({\n    network: Network.get(network) || Network.defaultNetwork,\n    depth: 0,\n    parentFingerPrint: 0,\n    childIndex: 0,\n    privateKey: hash.slice(0, 32),\n    chainCode: hash.slice(32, 64)\n  });\n};\n\n\n\nHDPrivateKey.prototype._calcHDPublicKey = function() {\n  if (!this._hdPublicKey) {\n    var HDPublicKey = __webpack_require__(568);\n    this._hdPublicKey = new HDPublicKey(this);\n  }\n};\n\n/**\n * Receives a object with buffers in all the properties and populates the\n * internal structure\n *\n * @param {Object} arg\n * @param {buffer.Buffer} arg.version\n * @param {buffer.Buffer} arg.depth\n * @param {buffer.Buffer} arg.parentFingerPrint\n * @param {buffer.Buffer} arg.childIndex\n * @param {buffer.Buffer} arg.chainCode\n * @param {buffer.Buffer} arg.privateKey\n * @param {buffer.Buffer} arg.checksum\n * @param {string=} arg.xprivkey - if set, don't recalculate the base58\n *      representation\n * @return {HDPrivateKey} this\n */\nHDPrivateKey.prototype._buildFromBuffers = function(arg) {\n  /* jshint maxcomplexity: 8 */\n  /* jshint maxstatements: 20 */\n\n  HDPrivateKey._validateBufferArguments(arg);\n\n  JSUtil.defineImmutable(this, {\n    _buffers: arg\n  });\n\n  var sequence = [\n    arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode,\n    BufferUtil.emptyBuffer(1), arg.privateKey\n  ];\n  var concat = buffer.Buffer.concat(sequence);\n  if (!arg.checksum || !arg.checksum.length) {\n    arg.checksum = Base58Check.checksum(concat);\n  } else {\n    if (arg.checksum.toString() !== Base58Check.checksum(concat).toString()) {\n      throw new errors.InvalidB58Checksum(concat);\n    }\n  }\n\n  var network = Network.get(BufferUtil.integerFromBuffer(arg.version));\n  var xprivkey;\n  xprivkey = Base58Check.encode(buffer.Buffer.concat(sequence));\n  arg.xprivkey = new Buffer(xprivkey);\n\n  var privateKey = new PrivateKey(BN.fromBuffer(arg.privateKey), network);\n  var publicKey = privateKey.toPublicKey();\n  var size = HDPrivateKey.ParentFingerPrintSize;\n  var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size);\n\n  JSUtil.defineImmutable(this, {\n    xprivkey: xprivkey,\n    network: network,\n    depth: BufferUtil.integerFromSingleByteBuffer(arg.depth),\n    privateKey: privateKey,\n    publicKey: publicKey,\n    fingerPrint: fingerPrint\n  });\n\n  this._hdPublicKey = null;\n\n  Object.defineProperty(this, 'hdPublicKey', {\n    configurable: false,\n    enumerable: true,\n    get: function() {\n      this._calcHDPublicKey();\n      return this._hdPublicKey;\n    }\n  });\n  Object.defineProperty(this, 'xpubkey', {\n    configurable: false,\n    enumerable: true,\n    get: function() {\n      this._calcHDPublicKey();\n      return this._hdPublicKey.xpubkey;\n    }\n  });\n  return this;\n};\n\nHDPrivateKey._validateBufferArguments = function(arg) {\n  var checkBuffer = function(name, size) {\n    var buff = arg[name];\n    assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer');\n    assert(\n      buff.length === size,\n      name + ' has not the expected size: found ' + buff.length + ', expected ' + size\n    );\n  };\n  checkBuffer('version', HDPrivateKey.VersionSize);\n  checkBuffer('depth', HDPrivateKey.DepthSize);\n  checkBuffer('parentFingerPrint', HDPrivateKey.ParentFingerPrintSize);\n  checkBuffer('childIndex', HDPrivateKey.ChildIndexSize);\n  checkBuffer('chainCode', HDPrivateKey.ChainCodeSize);\n  checkBuffer('privateKey', HDPrivateKey.PrivateKeySize);\n  if (arg.checksum && arg.checksum.length) {\n    checkBuffer('checksum', HDPrivateKey.CheckSumSize);\n  }\n};\n\n/**\n * Returns the string representation of this private key (a string starting\n * with \"xprv...\"\n *\n * @return string\n */\nHDPrivateKey.prototype.toString = function() {\n  return this.xprivkey;\n};\n\n/**\n * Returns the console representation of this extended private key.\n * @return string\n */\nHDPrivateKey.prototype.inspect = function() {\n  return '<HDPrivateKey: ' + this.xprivkey + '>';\n};\n\n/**\n * Returns a plain object with a representation of this private key.\n *\n * Fields include:<ul>\n * <li> network: either 'livenet' or 'testnet'\n * <li> depth: a number ranging from 0 to 255\n * <li> fingerPrint: a number ranging from 0 to 2^32-1, taken from the hash of the\n * <li>     associated public key\n * <li> parentFingerPrint: a number ranging from 0 to 2^32-1, taken from the hash\n * <li>     of this parent's associated public key or zero.\n * <li> childIndex: the index from which this child was derived (or zero)\n * <li> chainCode: an hexa string representing a number used in the derivation\n * <li> privateKey: the private key associated, in hexa representation\n * <li> xprivkey: the representation of this extended private key in checksum\n * <li>     base58 format\n * <li> checksum: the base58 checksum of xprivkey\n * </ul>\n *  @return {Object}\n */\nHDPrivateKey.prototype.toObject = HDPrivateKey.prototype.toJSON = function toObject() {\n  return {\n    network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version), 'xprivkey').name,\n    depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth),\n    fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint),\n    parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint),\n    childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex),\n    chainCode: BufferUtil.bufferToHex(this._buffers.chainCode),\n    privateKey: this.privateKey.toBuffer().toString('hex'),\n    checksum: BufferUtil.integerFromBuffer(this._buffers.checksum),\n    xprivkey: this.xprivkey\n  };\n};\n\n/**\n * Build a HDPrivateKey from a buffer\n *\n * @param {Buffer} arg\n * @return {HDPrivateKey}\n */\nHDPrivateKey.fromBuffer = function(arg) {\n  return new HDPrivateKey(arg.toString());\n};\n\n/**\n * Returns a buffer representation of the HDPrivateKey\n *\n * @return {string}\n */\nHDPrivateKey.prototype.toBuffer = function() {\n  return BufferUtil.copy(this._buffers.xprivkey);\n};\n\nHDPrivateKey.DefaultDepth = 0;\nHDPrivateKey.DefaultFingerprint = 0;\nHDPrivateKey.DefaultChildIndex = 0;\nHDPrivateKey.Hardened = 0x80000000;\nHDPrivateKey.MaxIndex = 2 * HDPrivateKey.Hardened;\n\nHDPrivateKey.RootElementAlias = ['m', 'M', 'm\\'', 'M\\''];\n\nHDPrivateKey.VersionSize = 4;\nHDPrivateKey.DepthSize = 1;\nHDPrivateKey.ParentFingerPrintSize = 4;\nHDPrivateKey.ChildIndexSize = 4;\nHDPrivateKey.ChainCodeSize = 32;\nHDPrivateKey.PrivateKeySize = 32;\nHDPrivateKey.CheckSumSize = 4;\n\nHDPrivateKey.DataLength = 78;\nHDPrivateKey.SerializedByteSize = 82;\n\nHDPrivateKey.VersionStart = 0;\nHDPrivateKey.VersionEnd = HDPrivateKey.VersionStart + HDPrivateKey.VersionSize;\nHDPrivateKey.DepthStart = HDPrivateKey.VersionEnd;\nHDPrivateKey.DepthEnd = HDPrivateKey.DepthStart + HDPrivateKey.DepthSize;\nHDPrivateKey.ParentFingerPrintStart = HDPrivateKey.DepthEnd;\nHDPrivateKey.ParentFingerPrintEnd = HDPrivateKey.ParentFingerPrintStart + HDPrivateKey.ParentFingerPrintSize;\nHDPrivateKey.ChildIndexStart = HDPrivateKey.ParentFingerPrintEnd;\nHDPrivateKey.ChildIndexEnd = HDPrivateKey.ChildIndexStart + HDPrivateKey.ChildIndexSize;\nHDPrivateKey.ChainCodeStart = HDPrivateKey.ChildIndexEnd;\nHDPrivateKey.ChainCodeEnd = HDPrivateKey.ChainCodeStart + HDPrivateKey.ChainCodeSize;\nHDPrivateKey.PrivateKeyStart = HDPrivateKey.ChainCodeEnd + 1;\nHDPrivateKey.PrivateKeyEnd = HDPrivateKey.PrivateKeyStart + HDPrivateKey.PrivateKeySize;\nHDPrivateKey.ChecksumStart = HDPrivateKey.PrivateKeyEnd;\nHDPrivateKey.ChecksumEnd = HDPrivateKey.ChecksumStart + HDPrivateKey.CheckSumSize;\n\nassert(HDPrivateKey.ChecksumEnd === HDPrivateKey.SerializedByteSize);\n\nmodule.exports = HDPrivateKey;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/hdprivatekey.js\n// module id = 567\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/hdprivatekey.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\n\nvar BN = __webpack_require__(30);\nvar Base58 = __webpack_require__(214);\nvar Base58Check = __webpack_require__(158);\nvar Hash = __webpack_require__(36);\nvar HDPrivateKey = __webpack_require__(567);\nvar HDKeyCache = __webpack_require__(316);\nvar Network = __webpack_require__(109);\nvar Point = __webpack_require__(125);\nvar PublicKey = __webpack_require__(66);\n\nvar bitcoreErrors = __webpack_require__(56);\nvar errors = bitcoreErrors;\nvar hdErrors = bitcoreErrors.HDPublicKey;\nvar assert = __webpack_require__(16);\n\nvar JSUtil = __webpack_require__(24);\nvar BufferUtil = __webpack_require__(18);\n\n/**\n * The representation of an hierarchically derived public key.\n *\n * See https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki\n *\n * @constructor\n * @param {Object|string|Buffer} arg\n */\nfunction HDPublicKey(arg) {\n  /* jshint maxcomplexity: 12 */\n  /* jshint maxstatements: 20 */\n  if (arg instanceof HDPublicKey) {\n    return arg;\n  }\n  if (!(this instanceof HDPublicKey)) {\n    return new HDPublicKey(arg);\n  }\n  if (arg) {\n    if (_.isString(arg) || BufferUtil.isBuffer(arg)) {\n      var error = HDPublicKey.getSerializedError(arg);\n      if (!error) {\n        return this._buildFromSerialized(arg);\n      } else if (BufferUtil.isBuffer(arg) && !HDPublicKey.getSerializedError(arg.toString())) {\n        return this._buildFromSerialized(arg.toString());\n      } else {\n        if (error instanceof hdErrors.ArgumentIsPrivateExtended) {\n          return new HDPrivateKey(arg).hdPublicKey;\n        }\n        throw error;\n      }\n    } else {\n      if (_.isObject(arg)) {\n        if (arg instanceof HDPrivateKey) {\n          return this._buildFromPrivate(arg);\n        } else {\n          return this._buildFromObject(arg);\n        }\n      } else {\n        throw new hdErrors.UnrecognizedArgument(arg);\n      }\n    }\n  } else {\n    throw new hdErrors.MustSupplyArgument();\n  }\n}\n\n/**\n * Verifies that a given path is valid.\n *\n * @param {string|number} arg\n * @return {boolean}\n */\nHDPublicKey.isValidPath = function(arg) {\n  if (_.isString(arg)) {\n    var indexes = HDPrivateKey._getDerivationIndexes(arg);\n    return indexes !== null && _.all(indexes, HDPublicKey.isValidPath);\n  }\n\n  if (_.isNumber(arg)) {\n    return arg >= 0 && arg < HDPublicKey.Hardened;\n  }\n\n  return false;\n};\n\n/**\n * Get a derivated child based on a string or number.\n *\n * If the first argument is a string, it's parsed as the full path of\n * derivation. Valid values for this argument include \"m\" (which returns the\n * same public key), \"m/0/1/40/2/1000\".\n *\n * Note that hardened keys can't be derived from a public extended key.\n *\n * If the first argument is a number, the child with that index will be\n * derived. See the example usage for clarification.\n *\n * @example\n * ```javascript\n * var parent = new HDPublicKey('xpub...');\n * var child_0_1_2 = parent.derive(0).derive(1).derive(2);\n * var copy_of_child_0_1_2 = parent.derive(\"m/0/1/2\");\n * assert(child_0_1_2.xprivkey === copy_of_child_0_1_2);\n * ```\n *\n * @param {string|number} arg\n */\nHDPublicKey.prototype.derive = function(arg, hardened) {\n  if (_.isNumber(arg)) {\n    return this._deriveWithNumber(arg, hardened);\n  } else if (_.isString(arg)) {\n    return this._deriveFromString(arg);\n  } else {\n    throw new hdErrors.InvalidDerivationArgument(arg);\n  }\n};\n\nHDPublicKey.prototype._deriveWithNumber = function(index, hardened) {\n  if (index >= HDPublicKey.Hardened || hardened) {\n    throw new hdErrors.InvalidIndexCantDeriveHardened();\n  }\n  if (index < 0) {\n    throw new hdErrors.InvalidPath(index);\n  }\n  var cached = HDKeyCache.get(this.xpubkey, index, false);\n  if (cached) {\n    return cached;\n  }\n\n  var indexBuffer = BufferUtil.integerAsBuffer(index);\n  var data = BufferUtil.concat([this.publicKey.toBuffer(), indexBuffer]);\n  var hash = Hash.sha512hmac(data, this._buffers.chainCode);\n  var leftPart = BN.fromBuffer(hash.slice(0, 32), {size: 32});\n  var chainCode = hash.slice(32, 64);\n\n  var publicKey = PublicKey.fromPoint(Point.getG().mul(leftPart).add(this.publicKey.point));\n\n  var derived = new HDPublicKey({\n    network: this.network,\n    depth: this.depth + 1,\n    parentFingerPrint: this.fingerPrint,\n    childIndex: index,\n    chainCode: chainCode,\n    publicKey: publicKey\n  });\n  HDKeyCache.set(this.xpubkey, index, false, derived);\n  return derived;\n};\n\nHDPublicKey.prototype._deriveFromString = function(path) {\n  /* jshint maxcomplexity: 8 */\n  if (_.contains(path, \"'\")) {\n    throw new hdErrors.InvalidIndexCantDeriveHardened();\n  } else if (!HDPublicKey.isValidPath(path)) {\n    throw new hdErrors.InvalidPath(path);\n  }\n\n  var indexes = HDPrivateKey._getDerivationIndexes(path);\n  var derived = indexes.reduce(function(prev, index) {\n    return prev._deriveWithNumber(index);\n  }, this);\n\n  return derived;\n};\n\n/**\n * Verifies that a given serialized public key in base58 with checksum format\n * is valid.\n *\n * @param {string|Buffer} data - the serialized public key\n * @param {string|Network=} network - optional, if present, checks that the\n *     network provided matches the network serialized.\n * @return {boolean}\n */\nHDPublicKey.isValidSerialized = function(data, network) {\n  return _.isNull(HDPublicKey.getSerializedError(data, network));\n};\n\n/**\n * Checks what's the error that causes the validation of a serialized public key\n * in base58 with checksum to fail.\n *\n * @param {string|Buffer} data - the serialized public key\n * @param {string|Network=} network - optional, if present, checks that the\n *     network provided matches the network serialized.\n * @return {errors|null}\n */\nHDPublicKey.getSerializedError = function(data, network) {\n  /* jshint maxcomplexity: 10 */\n  /* jshint maxstatements: 20 */\n  if (!(_.isString(data) || BufferUtil.isBuffer(data))) {\n    return new hdErrors.UnrecognizedArgument('expected buffer or string');\n  }\n  if (!Base58.validCharacters(data)) {\n    return new errors.InvalidB58Char('(unknown)', data);\n  }\n  try {\n    data = Base58Check.decode(data);\n  } catch (e) {\n    return new errors.InvalidB58Checksum(data);\n  }\n  if (data.length !== HDPublicKey.DataSize) {\n    return new hdErrors.InvalidLength(data);\n  }\n  if (!_.isUndefined(network)) {\n    var error = HDPublicKey._validateNetwork(data, network);\n    if (error) {\n      return error;\n    }\n  }\n  var version = BufferUtil.integerFromBuffer(data.slice(0, 4));\n  if (version === Network.livenet.xprivkey || version === Network.testnet.xprivkey ) {\n    return new hdErrors.ArgumentIsPrivateExtended();\n  }\n  return null;\n};\n\nHDPublicKey._validateNetwork = function(data, networkArg) {\n  var network = Network.get(networkArg);\n  if (!network) {\n    return new errors.InvalidNetworkArgument(networkArg);\n  }\n  var version = data.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd);\n  if (BufferUtil.integerFromBuffer(version) !== network.xpubkey) {\n    return new errors.InvalidNetwork(version);\n  }\n  return null;\n};\n\nHDPublicKey.prototype._buildFromPrivate = function (arg) {\n  var args = _.clone(arg._buffers);\n  var point = Point.getG().mul(BN.fromBuffer(args.privateKey));\n  args.publicKey = Point.pointToCompressed(point);\n  args.version = BufferUtil.integerAsBuffer(Network.get(BufferUtil.integerFromBuffer(args.version)).xpubkey);\n  args.privateKey = undefined;\n  args.checksum = undefined;\n  args.xprivkey = undefined;\n  return this._buildFromBuffers(args);\n};\n\nHDPublicKey.prototype._buildFromObject = function(arg) {\n  /* jshint maxcomplexity: 10 */\n  // TODO: Type validation\n  var buffers = {\n    version: arg.network ? BufferUtil.integerAsBuffer(Network.get(arg.network).xpubkey) : arg.version,\n    depth: _.isNumber(arg.depth) ? BufferUtil.integerAsSingleByteBuffer(arg.depth) : arg.depth,\n    parentFingerPrint: _.isNumber(arg.parentFingerPrint) ? BufferUtil.integerAsBuffer(arg.parentFingerPrint) : arg.parentFingerPrint,\n    childIndex: _.isNumber(arg.childIndex) ? BufferUtil.integerAsBuffer(arg.childIndex) : arg.childIndex,\n    chainCode: _.isString(arg.chainCode) ? BufferUtil.hexToBuffer(arg.chainCode) : arg.chainCode,\n    publicKey: _.isString(arg.publicKey) ? BufferUtil.hexToBuffer(arg.publicKey) :\n      BufferUtil.isBuffer(arg.publicKey) ? arg.publicKey : arg.publicKey.toBuffer(),\n    checksum: _.isNumber(arg.checksum) ? BufferUtil.integerAsBuffer(arg.checksum) : arg.checksum\n  };\n  return this._buildFromBuffers(buffers);\n};\n\nHDPublicKey.prototype._buildFromSerialized = function(arg) {\n  var decoded = Base58Check.decode(arg);\n  var buffers = {\n    version: decoded.slice(HDPublicKey.VersionStart, HDPublicKey.VersionEnd),\n    depth: decoded.slice(HDPublicKey.DepthStart, HDPublicKey.DepthEnd),\n    parentFingerPrint: decoded.slice(HDPublicKey.ParentFingerPrintStart,\n                                     HDPublicKey.ParentFingerPrintEnd),\n    childIndex: decoded.slice(HDPublicKey.ChildIndexStart, HDPublicKey.ChildIndexEnd),\n    chainCode: decoded.slice(HDPublicKey.ChainCodeStart, HDPublicKey.ChainCodeEnd),\n    publicKey: decoded.slice(HDPublicKey.PublicKeyStart, HDPublicKey.PublicKeyEnd),\n    checksum: decoded.slice(HDPublicKey.ChecksumStart, HDPublicKey.ChecksumEnd),\n    xpubkey: arg\n  };\n  return this._buildFromBuffers(buffers);\n};\n\n/**\n * Receives a object with buffers in all the properties and populates the\n * internal structure\n *\n * @param {Object} arg\n * @param {buffer.Buffer} arg.version\n * @param {buffer.Buffer} arg.depth\n * @param {buffer.Buffer} arg.parentFingerPrint\n * @param {buffer.Buffer} arg.childIndex\n * @param {buffer.Buffer} arg.chainCode\n * @param {buffer.Buffer} arg.publicKey\n * @param {buffer.Buffer} arg.checksum\n * @param {string=} arg.xpubkey - if set, don't recalculate the base58\n *      representation\n * @return {HDPublicKey} this\n */\nHDPublicKey.prototype._buildFromBuffers = function(arg) {\n  /* jshint maxcomplexity: 8 */\n  /* jshint maxstatements: 20 */\n\n  HDPublicKey._validateBufferArguments(arg);\n\n  JSUtil.defineImmutable(this, {\n    _buffers: arg\n  });\n\n  var sequence = [\n    arg.version, arg.depth, arg.parentFingerPrint, arg.childIndex, arg.chainCode,\n    arg.publicKey\n  ];\n  var concat = BufferUtil.concat(sequence);\n  var checksum = Base58Check.checksum(concat);\n  if (!arg.checksum || !arg.checksum.length) {\n    arg.checksum = checksum;\n  } else {\n    if (arg.checksum.toString('hex') !== checksum.toString('hex')) {\n      throw new errors.InvalidB58Checksum(concat, checksum);\n    }\n  }\n  var network = Network.get(BufferUtil.integerFromBuffer(arg.version));\n\n  var xpubkey;\n  xpubkey = Base58Check.encode(BufferUtil.concat(sequence));\n  arg.xpubkey = new Buffer(xpubkey);\n\n  var publicKey = new PublicKey(arg.publicKey, {network: network});\n  var size = HDPublicKey.ParentFingerPrintSize;\n  var fingerPrint = Hash.sha256ripemd160(publicKey.toBuffer()).slice(0, size);\n\n  JSUtil.defineImmutable(this, {\n    xpubkey: xpubkey,\n    network: network,\n    depth: BufferUtil.integerFromSingleByteBuffer(arg.depth),\n    publicKey: publicKey,\n    fingerPrint: fingerPrint\n  });\n\n  return this;\n};\n\nHDPublicKey._validateBufferArguments = function(arg) {\n  var checkBuffer = function(name, size) {\n    var buff = arg[name];\n    assert(BufferUtil.isBuffer(buff), name + ' argument is not a buffer, it\\'s ' + typeof buff);\n    assert(\n      buff.length === size,\n      name + ' has not the expected size: found ' + buff.length + ', expected ' + size\n    );\n  };\n  checkBuffer('version', HDPublicKey.VersionSize);\n  checkBuffer('depth', HDPublicKey.DepthSize);\n  checkBuffer('parentFingerPrint', HDPublicKey.ParentFingerPrintSize);\n  checkBuffer('childIndex', HDPublicKey.ChildIndexSize);\n  checkBuffer('chainCode', HDPublicKey.ChainCodeSize);\n  checkBuffer('publicKey', HDPublicKey.PublicKeySize);\n  if (arg.checksum && arg.checksum.length) {\n    checkBuffer('checksum', HDPublicKey.CheckSumSize);\n  }\n};\n\nHDPublicKey.fromString = function(arg) {\n  $.checkArgument(_.isString(arg), 'No valid string was provided');\n  return new HDPublicKey(arg);\n};\n\nHDPublicKey.fromObject = function(arg) {\n  $.checkArgument(_.isObject(arg), 'No valid argument was provided');\n  return new HDPublicKey(arg);\n};\n\n/**\n * Returns the base58 checked representation of the public key\n * @return {string} a string starting with \"xpub...\" in livenet\n */\nHDPublicKey.prototype.toString = function() {\n  return this.xpubkey;\n};\n\n/**\n * Returns the console representation of this extended public key.\n * @return string\n */\nHDPublicKey.prototype.inspect = function() {\n  return '<HDPublicKey: ' + this.xpubkey + '>';\n};\n\n/**\n * Returns a plain JavaScript object with information to reconstruct a key.\n *\n * Fields are: <ul>\n *  <li> network: 'livenet' or 'testnet'\n *  <li> depth: a number from 0 to 255, the depth to the master extended key\n *  <li> fingerPrint: a number of 32 bits taken from the hash of the public key\n *  <li> fingerPrint: a number of 32 bits taken from the hash of this key's\n *  <li>     parent's public key\n *  <li> childIndex: index with which this key was derived\n *  <li> chainCode: string in hexa encoding used for derivation\n *  <li> publicKey: string, hexa encoded, in compressed key format\n *  <li> checksum: BufferUtil.integerFromBuffer(this._buffers.checksum),\n *  <li> xpubkey: the string with the base58 representation of this extended key\n *  <li> checksum: the base58 checksum of xpubkey\n * </ul>\n */\nHDPublicKey.prototype.toObject = HDPublicKey.prototype.toJSON = function toObject() {\n  return {\n    network: Network.get(BufferUtil.integerFromBuffer(this._buffers.version)).name,\n    depth: BufferUtil.integerFromSingleByteBuffer(this._buffers.depth),\n    fingerPrint: BufferUtil.integerFromBuffer(this.fingerPrint),\n    parentFingerPrint: BufferUtil.integerFromBuffer(this._buffers.parentFingerPrint),\n    childIndex: BufferUtil.integerFromBuffer(this._buffers.childIndex),\n    chainCode: BufferUtil.bufferToHex(this._buffers.chainCode),\n    publicKey: this.publicKey.toString(),\n    checksum: BufferUtil.integerFromBuffer(this._buffers.checksum),\n    xpubkey: this.xpubkey\n  };\n};\n\n/**\n * Create a HDPublicKey from a buffer argument\n *\n * @param {Buffer} arg\n * @return {HDPublicKey}\n */\nHDPublicKey.fromBuffer = function(arg) {\n  return new HDPublicKey(arg);\n};\n\n/**\n * Return a buffer representation of the xpubkey\n *\n * @return {Buffer}\n */\nHDPublicKey.prototype.toBuffer = function() {\n  return BufferUtil.copy(this._buffers.xpubkey);\n};\n\nHDPublicKey.Hardened = 0x80000000;\nHDPublicKey.RootElementAlias = ['m', 'M'];\n\nHDPublicKey.VersionSize = 4;\nHDPublicKey.DepthSize = 1;\nHDPublicKey.ParentFingerPrintSize = 4;\nHDPublicKey.ChildIndexSize = 4;\nHDPublicKey.ChainCodeSize = 32;\nHDPublicKey.PublicKeySize = 33;\nHDPublicKey.CheckSumSize = 4;\n\nHDPublicKey.DataSize = 78;\nHDPublicKey.SerializedByteSize = 82;\n\nHDPublicKey.VersionStart           = 0;\nHDPublicKey.VersionEnd             = HDPublicKey.VersionStart + HDPublicKey.VersionSize;\nHDPublicKey.DepthStart             = HDPublicKey.VersionEnd;\nHDPublicKey.DepthEnd               = HDPublicKey.DepthStart + HDPublicKey.DepthSize;\nHDPublicKey.ParentFingerPrintStart = HDPublicKey.DepthEnd;\nHDPublicKey.ParentFingerPrintEnd   = HDPublicKey.ParentFingerPrintStart + HDPublicKey.ParentFingerPrintSize;\nHDPublicKey.ChildIndexStart        = HDPublicKey.ParentFingerPrintEnd;\nHDPublicKey.ChildIndexEnd          = HDPublicKey.ChildIndexStart + HDPublicKey.ChildIndexSize;\nHDPublicKey.ChainCodeStart         = HDPublicKey.ChildIndexEnd;\nHDPublicKey.ChainCodeEnd           = HDPublicKey.ChainCodeStart + HDPublicKey.ChainCodeSize;\nHDPublicKey.PublicKeyStart         = HDPublicKey.ChainCodeEnd;\nHDPublicKey.PublicKeyEnd           = HDPublicKey.PublicKeyStart + HDPublicKey.PublicKeySize;\nHDPublicKey.ChecksumStart          = HDPublicKey.PublicKeyEnd;\nHDPublicKey.ChecksumEnd            = HDPublicKey.ChecksumStart + HDPublicKey.CheckSumSize;\n\nassert(HDPublicKey.PublicKeyEnd === HDPublicKey.DataSize);\nassert(HDPublicKey.ChecksumEnd === HDPublicKey.SerializedByteSize);\n\nmodule.exports = HDPublicKey;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/hdpublickey.js\n// module id = 568\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/hdpublickey.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar Address = __webpack_require__(108);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar Hash = __webpack_require__(36);\nvar Opcode = __webpack_require__(317);\nvar PublicKey = __webpack_require__(66);\nvar Signature = __webpack_require__(55);\nvar Networks = __webpack_require__(109);\nvar $ = __webpack_require__(13);\nvar _ = __webpack_require__(10);\nvar errors = __webpack_require__(56);\nvar buffer = __webpack_require__(0);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\n/**\n * A bitcoin transaction script. Each transaction's inputs and outputs\n * has a script that is evaluated to validate it's spending.\n *\n * See https://en.bitcoin.it/wiki/Script\n *\n * @constructor\n * @param {Object|string|Buffer=} from optional data to populate script\n */\nvar Script = function Script(from) {\n  if (!(this instanceof Script)) {\n    return new Script(from);\n  }\n  this.chunks = [];\n\n  if (BufferUtil.isBuffer(from)) {\n    return Script.fromBuffer(from);\n  } else if (from instanceof Address) {\n    return Script.fromAddress(from);\n  } else if (from instanceof Script) {\n    return Script.fromBuffer(from.toBuffer());\n  } else if (typeof from === 'string') {\n    return Script.fromString(from);\n  } else if (typeof from !== 'undefined') {\n    this.set(from);\n  }\n};\n\nScript.prototype.set = function(obj) {\n  this.chunks = obj.chunks || this.chunks;\n  return this;\n};\n\nScript.fromBuffer = function(buffer) {\n  var script = new Script();\n  script.chunks = [];\n\n  var br = new BufferReader(buffer);\n  while (!br.finished()) {\n    try {\n      var opcodenum = br.readUInt8();\n\n      var len, buf;\n      if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) {\n        len = opcodenum;\n        script.chunks.push({\n          buf: br.read(len),\n          len: len,\n          opcodenum: opcodenum\n        });\n      } else if (opcodenum === Opcode.OP_PUSHDATA1) {\n        len = br.readUInt8();\n        buf = br.read(len);\n        script.chunks.push({\n          buf: buf,\n          len: len,\n          opcodenum: opcodenum\n        });\n      } else if (opcodenum === Opcode.OP_PUSHDATA2) {\n        len = br.readUInt16LE();\n        buf = br.read(len);\n        script.chunks.push({\n          buf: buf,\n          len: len,\n          opcodenum: opcodenum\n        });\n      } else if (opcodenum === Opcode.OP_PUSHDATA4) {\n        len = br.readUInt32LE();\n        buf = br.read(len);\n        script.chunks.push({\n          buf: buf,\n          len: len,\n          opcodenum: opcodenum\n        });\n      } else {\n        script.chunks.push({\n          opcodenum: opcodenum\n        });\n      }\n    } catch (e) {\n      if (e instanceof RangeError) {\n        throw new errors.Script.InvalidBuffer(buffer.toString('hex'));\n      }\n      throw e;\n    }\n  }\n\n  return script;\n};\n\nScript.prototype.toBuffer = function() {\n  var bw = new BufferWriter();\n\n  for (var i = 0; i < this.chunks.length; i++) {\n    var chunk = this.chunks[i];\n    var opcodenum = chunk.opcodenum;\n    bw.writeUInt8(chunk.opcodenum);\n    if (chunk.buf) {\n      if (opcodenum < Opcode.OP_PUSHDATA1) {\n        bw.write(chunk.buf);\n      } else if (opcodenum === Opcode.OP_PUSHDATA1) {\n        bw.writeUInt8(chunk.len);\n        bw.write(chunk.buf);\n      } else if (opcodenum === Opcode.OP_PUSHDATA2) {\n        bw.writeUInt16LE(chunk.len);\n        bw.write(chunk.buf);\n      } else if (opcodenum === Opcode.OP_PUSHDATA4) {\n        bw.writeUInt32LE(chunk.len);\n        bw.write(chunk.buf);\n      }\n    }\n  }\n\n  return bw.concat();\n};\n\nScript.fromASM = function(str) {\n  var script = new Script();\n  script.chunks = [];\n\n  var tokens = str.split(' ');\n  var i = 0;\n  while (i < tokens.length) {\n    var token = tokens[i];\n    var opcode = Opcode(token);\n    var opcodenum = opcode.toNumber();\n\n    if (_.isUndefined(opcodenum)) {\n      var buf = new Buffer(tokens[i], 'hex');\n      script.chunks.push({\n        buf: buf,\n        len: buf.length,\n        opcodenum: buf.length\n      });\n      i = i + 1;\n    } else if (opcodenum === Opcode.OP_PUSHDATA1 ||\n      opcodenum === Opcode.OP_PUSHDATA2 ||\n      opcodenum === Opcode.OP_PUSHDATA4) {\n      script.chunks.push({\n        buf: new Buffer(tokens[i + 2], 'hex'),\n        len: parseInt(tokens[i + 1]),\n        opcodenum: opcodenum\n      });\n      i = i + 3;\n    } else {\n      script.chunks.push({\n        opcodenum: opcodenum\n      });\n      i = i + 1;\n    }\n  }\n  return script;\n};\n\nScript.fromHex = function(str) {\n  return new Script(new buffer.Buffer(str, 'hex'));\n};\n\nScript.fromString = function(str) {\n  if (JSUtil.isHexa(str) || str.length === 0) {\n    return new Script(new buffer.Buffer(str, 'hex'));\n  }\n  var script = new Script();\n  script.chunks = [];\n\n  var tokens = str.split(' ');\n  var i = 0;\n  while (i < tokens.length) {\n    var token = tokens[i];\n    var opcode = Opcode(token);\n    var opcodenum = opcode.toNumber();\n\n    if (_.isUndefined(opcodenum)) {\n      opcodenum = parseInt(token);\n      if (opcodenum > 0 && opcodenum < Opcode.OP_PUSHDATA1) {\n        script.chunks.push({\n          buf: new Buffer(tokens[i + 1].slice(2), 'hex'),\n          len: opcodenum,\n          opcodenum: opcodenum\n        });\n        i = i + 2;\n      } else {\n        throw new Error('Invalid script: ' + JSON.stringify(str));\n      }\n    } else if (opcodenum === Opcode.OP_PUSHDATA1 ||\n      opcodenum === Opcode.OP_PUSHDATA2 ||\n      opcodenum === Opcode.OP_PUSHDATA4) {\n      if (tokens[i + 2].slice(0, 2) !== '0x') {\n        throw new Error('Pushdata data must start with 0x');\n      }\n      script.chunks.push({\n        buf: new Buffer(tokens[i + 2].slice(2), 'hex'),\n        len: parseInt(tokens[i + 1]),\n        opcodenum: opcodenum\n      });\n      i = i + 3;\n    } else {\n      script.chunks.push({\n        opcodenum: opcodenum\n      });\n      i = i + 1;\n    }\n  }\n  return script;\n};\n\nScript.prototype._chunkToString = function(chunk, type) {\n  var opcodenum = chunk.opcodenum;\n  var asm = (type === 'asm');\n  var str = '';\n  if (!chunk.buf) {\n    // no data chunk\n    if (typeof Opcode.reverseMap[opcodenum] !== 'undefined') {\n      str = str + ' ' + Opcode(opcodenum).toString();\n    } else {\n      var numstr = opcodenum.toString(16);\n      if (numstr.length % 2 !== 0) {\n        numstr = '0' + numstr;\n      }\n      if (asm) {\n        str = str + ' ' + numstr;\n      } else {\n        str = str + ' ' + '0x' + numstr;\n      }\n    }\n  } else {\n    // data chunk\n    if (opcodenum === Opcode.OP_PUSHDATA1 ||\n      opcodenum === Opcode.OP_PUSHDATA2 ||\n      opcodenum === Opcode.OP_PUSHDATA4) {\n      str = str + ' ' + Opcode(opcodenum).toString();\n    }\n    if (chunk.len > 0) {\n      if (asm) {\n        str = str + ' ' + chunk.buf.toString('hex');\n      } else {\n        str = str + ' ' + chunk.len + ' ' + '0x' + chunk.buf.toString('hex');\n      }\n    }\n  }\n  return str;\n};\n\nScript.prototype.toASM = function() {\n  var str = '';\n  for (var i = 0; i < this.chunks.length; i++) {\n    var chunk = this.chunks[i];\n    str += this._chunkToString(chunk, 'asm');\n  }\n\n  return str.substr(1);\n};\n\nScript.prototype.toString = function() {\n  var str = '';\n  for (var i = 0; i < this.chunks.length; i++) {\n    var chunk = this.chunks[i];\n    str += this._chunkToString(chunk);\n  }\n\n  return str.substr(1);\n};\n\nScript.prototype.toHex = function() {\n  return this.toBuffer().toString('hex');\n};\n\nScript.prototype.inspect = function() {\n  return '<Script: ' + this.toString() + '>';\n};\n\n// script classification methods\n\n/**\n * @returns {boolean} if this is a pay to pubkey hash output script\n */\nScript.prototype.isPublicKeyHashOut = function() {\n  return !!(this.chunks.length === 5 &&\n    this.chunks[0].opcodenum === Opcode.OP_DUP &&\n    this.chunks[1].opcodenum === Opcode.OP_HASH160 &&\n    this.chunks[2].buf &&\n    this.chunks[2].buf.length === 20 &&\n    this.chunks[3].opcodenum === Opcode.OP_EQUALVERIFY &&\n    this.chunks[4].opcodenum === Opcode.OP_CHECKSIG);\n};\n\n/**\n * @returns {boolean} if this is a pay to public key hash input script\n */\nScript.prototype.isPublicKeyHashIn = function() {\n  if (this.chunks.length === 2) {\n    var signatureBuf = this.chunks[0].buf;\n    var pubkeyBuf = this.chunks[1].buf;\n    if (signatureBuf &&\n        signatureBuf.length &&\n        signatureBuf[0] === 0x30 &&\n        pubkeyBuf &&\n        pubkeyBuf.length\n       ) {\n      var version = pubkeyBuf[0];\n      if ((version === 0x04 ||\n           version === 0x06 ||\n           version === 0x07) && pubkeyBuf.length === 65) {\n        return true;\n      } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) {\n        return true;\n      }\n    }\n  }\n  return false;\n};\n\nScript.prototype.getPublicKey = function() {\n  $.checkState(this.isPublicKeyOut(), 'Can\\'t retreive PublicKey from a non-PK output');\n  return this.chunks[0].buf;\n};\n\nScript.prototype.getPublicKeyHash = function() {\n  $.checkState(this.isPublicKeyHashOut(), 'Can\\'t retrieve PublicKeyHash from a non-PKH output');\n  return this.chunks[2].buf;\n};\n\n/**\n * @returns {boolean} if this is a public key output script\n */\nScript.prototype.isPublicKeyOut = function() {\n  if (this.chunks.length === 2 &&\n      this.chunks[0].buf &&\n      this.chunks[0].buf.length &&\n      this.chunks[1].opcodenum === Opcode.OP_CHECKSIG) {\n    var pubkeyBuf = this.chunks[0].buf;\n    var version = pubkeyBuf[0];\n    var isVersion = false;\n    if ((version === 0x04 ||\n         version === 0x06 ||\n         version === 0x07) && pubkeyBuf.length === 65) {\n      isVersion = true;\n    } else if ((version === 0x03 || version === 0x02) && pubkeyBuf.length === 33) {\n      isVersion = true;\n    }\n    if (isVersion) {\n      return PublicKey.isValid(pubkeyBuf);\n    }\n  }\n  return false;\n};\n\n/**\n * @returns {boolean} if this is a pay to public key input script\n */\nScript.prototype.isPublicKeyIn = function() {\n  if (this.chunks.length === 1) {\n    var signatureBuf = this.chunks[0].buf;\n    if (signatureBuf &&\n        signatureBuf.length &&\n        signatureBuf[0] === 0x30) {\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * @returns {boolean} if this is a p2sh output script\n */\nScript.prototype.isScriptHashOut = function() {\n  var buf = this.toBuffer();\n  return (buf.length === 23 &&\n    buf[0] === Opcode.OP_HASH160 &&\n    buf[1] === 0x14 &&\n    buf[buf.length - 1] === Opcode.OP_EQUAL);\n};\n\n/**\n * @returns {boolean} if this is a p2sh input script\n * Note that these are frequently indistinguishable from pubkeyhashin\n */\nScript.prototype.isScriptHashIn = function() {\n  if (this.chunks.length <= 1) {\n    return false;\n  }\n  var redeemChunk = this.chunks[this.chunks.length - 1];\n  var redeemBuf = redeemChunk.buf;\n  if (!redeemBuf) {\n    return false;\n  }\n\n  var redeemScript;\n  try {\n    redeemScript = Script.fromBuffer(redeemBuf);\n  } catch (e) {\n    if (e instanceof errors.Script.InvalidBuffer) {\n      return false;\n    }\n    throw e;\n  }\n  var type = redeemScript.classify();\n  return type !== Script.types.UNKNOWN;\n};\n\n/**\n * @returns {boolean} if this is a mutlsig output script\n */\nScript.prototype.isMultisigOut = function() {\n  return (this.chunks.length > 3 &&\n    Opcode.isSmallIntOp(this.chunks[0].opcodenum) &&\n    this.chunks.slice(1, this.chunks.length - 2).every(function(obj) {\n      return obj.buf && BufferUtil.isBuffer(obj.buf);\n    }) &&\n    Opcode.isSmallIntOp(this.chunks[this.chunks.length - 2].opcodenum) &&\n    this.chunks[this.chunks.length - 1].opcodenum === Opcode.OP_CHECKMULTISIG);\n};\n\n\n/**\n * @returns {boolean} if this is a multisig input script\n */\nScript.prototype.isMultisigIn = function() {\n  return this.chunks.length >= 2 &&\n    this.chunks[0].opcodenum === 0 &&\n    this.chunks.slice(1, this.chunks.length).every(function(obj) {\n      return obj.buf &&\n        BufferUtil.isBuffer(obj.buf) &&\n        Signature.isTxDER(obj.buf);\n    });\n};\n\n/**\n * @returns {boolean} true if this is a valid standard OP_RETURN output\n */\nScript.prototype.isDataOut = function() {\n  return this.chunks.length >= 1 &&\n    this.chunks[0].opcodenum === Opcode.OP_RETURN &&\n    (this.chunks.length === 1 ||\n      (this.chunks.length === 2 &&\n        this.chunks[1].buf &&\n        this.chunks[1].buf.length <= Script.OP_RETURN_STANDARD_SIZE &&\n        this.chunks[1].length === this.chunks.len));\n};\n\n/**\n * Retrieve the associated data for this script.\n * In the case of a pay to public key hash or P2SH, return the hash.\n * In the case of a standard OP_RETURN, return the data\n * @returns {Buffer}\n */\nScript.prototype.getData = function() {\n  if (this.isDataOut() || this.isScriptHashOut()) {\n    if (_.isUndefined(this.chunks[1])) {\n      return new Buffer(0);\n    } else {\n      return new Buffer(this.chunks[1].buf);\n    }\n  }\n  if (this.isPublicKeyHashOut()) {\n    return new Buffer(this.chunks[2].buf);\n  }\n  throw new Error('Unrecognized script type to get data from');\n};\n\n/**\n * @returns {boolean} if the script is only composed of data pushing\n * opcodes or small int opcodes (OP_0, OP_1, ..., OP_16)\n */\nScript.prototype.isPushOnly = function() {\n  return _.every(this.chunks, function(chunk) {\n    return chunk.opcodenum <= Opcode.OP_16;\n  });\n};\n\n\nScript.types = {};\nScript.types.UNKNOWN = 'Unknown';\nScript.types.PUBKEY_OUT = 'Pay to public key';\nScript.types.PUBKEY_IN = 'Spend from public key';\nScript.types.PUBKEYHASH_OUT = 'Pay to public key hash';\nScript.types.PUBKEYHASH_IN = 'Spend from public key hash';\nScript.types.SCRIPTHASH_OUT = 'Pay to script hash';\nScript.types.SCRIPTHASH_IN = 'Spend from script hash';\nScript.types.MULTISIG_OUT = 'Pay to multisig';\nScript.types.MULTISIG_IN = 'Spend from multisig';\nScript.types.DATA_OUT = 'Data push';\n\nScript.OP_RETURN_STANDARD_SIZE = 80;\n\n/**\n * @returns {object} The Script type if it is a known form,\n * or Script.UNKNOWN if it isn't\n */\nScript.prototype.classify = function() {\n  if (this._isInput) {\n    return this.classifyInput();\n  } else if (this._isOutput) {\n    return this.classifyOutput();\n  } else {\n    var outputType = this.classifyOutput();\n    return outputType != Script.types.UNKNOWN ? outputType : this.classifyInput();\n  }\n};\n\nScript.outputIdentifiers = {};\nScript.outputIdentifiers.PUBKEY_OUT = Script.prototype.isPublicKeyOut;\nScript.outputIdentifiers.PUBKEYHASH_OUT = Script.prototype.isPublicKeyHashOut;\nScript.outputIdentifiers.MULTISIG_OUT = Script.prototype.isMultisigOut;\nScript.outputIdentifiers.SCRIPTHASH_OUT = Script.prototype.isScriptHashOut;\nScript.outputIdentifiers.DATA_OUT = Script.prototype.isDataOut;\n\n/**\n * @returns {object} The Script type if it is a known form,\n * or Script.UNKNOWN if it isn't\n */\nScript.prototype.classifyOutput = function() {\n  for (var type in Script.outputIdentifiers) {\n    if (Script.outputIdentifiers[type].bind(this)()) {\n      return Script.types[type];\n    }\n  }\n  return Script.types.UNKNOWN;\n};\n\nScript.inputIdentifiers = {};\nScript.inputIdentifiers.PUBKEY_IN = Script.prototype.isPublicKeyIn;\nScript.inputIdentifiers.PUBKEYHASH_IN = Script.prototype.isPublicKeyHashIn;\nScript.inputIdentifiers.MULTISIG_IN = Script.prototype.isMultisigIn;\nScript.inputIdentifiers.SCRIPTHASH_IN = Script.prototype.isScriptHashIn;\n\n/**\n * @returns {object} The Script type if it is a known form,\n * or Script.UNKNOWN if it isn't\n */\nScript.prototype.classifyInput = function() {\n  for (var type in Script.inputIdentifiers) {\n    if (Script.inputIdentifiers[type].bind(this)()) {\n      return Script.types[type];\n    }\n  }\n  return Script.types.UNKNOWN;\n};\n\n\n/**\n * @returns {boolean} if script is one of the known types\n */\nScript.prototype.isStandard = function() {\n  // TODO: Add BIP62 compliance\n  return this.classify() !== Script.types.UNKNOWN;\n};\n\n\n// Script construction methods\n\n/**\n * Adds a script element at the start of the script.\n * @param {*} obj a string, number, Opcode, Buffer, or object to add\n * @returns {Script} this script instance\n */\nScript.prototype.prepend = function(obj) {\n  this._addByType(obj, true);\n  return this;\n};\n\n/**\n * Compares a script with another script\n */\nScript.prototype.equals = function(script) {\n  $.checkState(script instanceof Script, 'Must provide another script');\n  if (this.chunks.length !== script.chunks.length) {\n    return false;\n  }\n  var i;\n  for (i = 0; i < this.chunks.length; i++) {\n    if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.isBuffer(script.chunks[i].buf)) {\n      return false;\n    }\n    if (BufferUtil.isBuffer(this.chunks[i].buf) && !BufferUtil.equals(this.chunks[i].buf, script.chunks[i].buf)) {\n      return false;\n    } else if (this.chunks[i].opcodenum !== script.chunks[i].opcodenum) {\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * Adds a script element to the end of the script.\n *\n * @param {*} obj a string, number, Opcode, Buffer, or object to add\n * @returns {Script} this script instance\n *\n */\nScript.prototype.add = function(obj) {\n  this._addByType(obj, false);\n  return this;\n};\n\nScript.prototype._addByType = function(obj, prepend) {\n  if (typeof obj === 'string') {\n    this._addOpcode(obj, prepend);\n  } else if (typeof obj === 'number') {\n    this._addOpcode(obj, prepend);\n  } else if (obj instanceof Opcode) {\n    this._addOpcode(obj, prepend);\n  } else if (BufferUtil.isBuffer(obj)) {\n    this._addBuffer(obj, prepend);\n  } else if (obj instanceof Script) {\n    this.chunks = this.chunks.concat(obj.chunks);\n  } else if (typeof obj === 'object') {\n    this._insertAtPosition(obj, prepend);\n  } else {\n    throw new Error('Invalid script chunk');\n  }\n};\n\nScript.prototype._insertAtPosition = function(op, prepend) {\n  if (prepend) {\n    this.chunks.unshift(op);\n  } else {\n    this.chunks.push(op);\n  }\n};\n\nScript.prototype._addOpcode = function(opcode, prepend) {\n  var op;\n  if (typeof opcode === 'number') {\n    op = opcode;\n  } else if (opcode instanceof Opcode) {\n    op = opcode.toNumber();\n  } else {\n    op = Opcode(opcode).toNumber();\n  }\n  this._insertAtPosition({\n    opcodenum: op\n  }, prepend);\n  return this;\n};\n\nScript.prototype._addBuffer = function(buf, prepend) {\n  var opcodenum;\n  var len = buf.length;\n  if (len >= 0 && len < Opcode.OP_PUSHDATA1) {\n    opcodenum = len;\n  } else if (len < Math.pow(2, 8)) {\n    opcodenum = Opcode.OP_PUSHDATA1;\n  } else if (len < Math.pow(2, 16)) {\n    opcodenum = Opcode.OP_PUSHDATA2;\n  } else if (len < Math.pow(2, 32)) {\n    opcodenum = Opcode.OP_PUSHDATA4;\n  } else {\n    throw new Error('You can\\'t push that much data');\n  }\n  this._insertAtPosition({\n    buf: buf,\n    len: len,\n    opcodenum: opcodenum\n  }, prepend);\n  return this;\n};\n\nScript.prototype.removeCodeseparators = function() {\n  var chunks = [];\n  for (var i = 0; i < this.chunks.length; i++) {\n    if (this.chunks[i].opcodenum !== Opcode.OP_CODESEPARATOR) {\n      chunks.push(this.chunks[i]);\n    }\n  }\n  this.chunks = chunks;\n  return this;\n};\n\n// high level script builder methods\n\n/**\n * @returns {Script} a new Multisig output script for given public keys,\n * requiring m of those public keys to spend\n * @param {PublicKey[]} publicKeys - list of all public keys controlling the output\n * @param {number} threshold - amount of required signatures to spend the output\n * @param {Object=} opts - Several options:\n *        - noSorting: defaults to false, if true, don't sort the given\n *                      public keys before creating the script\n */\nScript.buildMultisigOut = function(publicKeys, threshold, opts) {\n  $.checkArgument(threshold <= publicKeys.length,\n    'Number of required signatures must be less than or equal to the number of public keys');\n  opts = opts || {};\n  var script = new Script();\n  script.add(Opcode.smallInt(threshold));\n  publicKeys = _.map(publicKeys, PublicKey);\n  var sorted = publicKeys;\n  if (!opts.noSorting) {\n    sorted = _.sortBy(publicKeys, function(publicKey) {\n      return publicKey.toString('hex');\n    });\n  }\n  for (var i = 0; i < sorted.length; i++) {\n    var publicKey = sorted[i];\n    script.add(publicKey.toBuffer());\n  }\n  script.add(Opcode.smallInt(publicKeys.length));\n  script.add(Opcode.OP_CHECKMULTISIG);\n  return script;\n};\n\n/**\n * A new Multisig input script for the given public keys, requiring m of those public keys to spend\n *\n * @param {PublicKey[]} pubkeys list of all public keys controlling the output\n * @param {number} threshold amount of required signatures to spend the output\n * @param {Array} signatures and array of signature buffers to append to the script\n * @param {Object=} opts\n * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default)\n * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript\n *\n * @returns {Script}\n */\nScript.buildMultisigIn = function(pubkeys, threshold, signatures, opts) {\n  $.checkArgument(_.isArray(pubkeys));\n  $.checkArgument(_.isNumber(threshold));\n  $.checkArgument(_.isArray(signatures));\n  opts = opts || {};\n  var s = new Script();\n  s.add(Opcode.OP_0);\n  _.each(signatures, function(signature) {\n    $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers');\n    // TODO: allow signatures to be an array of Signature objects\n    s.add(signature);\n  });\n  return s;\n};\n\n/**\n * A new P2SH Multisig input script for the given public keys, requiring m of those public keys to spend\n *\n * @param {PublicKey[]} pubkeys list of all public keys controlling the output\n * @param {number} threshold amount of required signatures to spend the output\n * @param {Array} signatures and array of signature buffers to append to the script\n * @param {Object=} opts\n * @param {boolean=} opts.noSorting don't sort the given public keys before creating the script (false by default)\n * @param {Script=} opts.cachedMultisig don't recalculate the redeemScript\n *\n * @returns {Script}\n */\nScript.buildP2SHMultisigIn = function(pubkeys, threshold, signatures, opts) {\n  $.checkArgument(_.isArray(pubkeys));\n  $.checkArgument(_.isNumber(threshold));\n  $.checkArgument(_.isArray(signatures));\n  opts = opts || {};\n  var s = new Script();\n  s.add(Opcode.OP_0);\n  _.each(signatures, function(signature) {\n    $.checkArgument(BufferUtil.isBuffer(signature), 'Signatures must be an array of Buffers');\n    // TODO: allow signatures to be an array of Signature objects\n    s.add(signature);\n  });\n  s.add((opts.cachedMultisig || Script.buildMultisigOut(pubkeys, threshold, opts)).toBuffer());\n  return s;\n};\n\n/**\n * @returns {Script} a new pay to public key hash output for the given\n * address or public key\n * @param {(Address|PublicKey)} to - destination address or public key\n */\nScript.buildPublicKeyHashOut = function(to) {\n  $.checkArgument(!_.isUndefined(to));\n  $.checkArgument(to instanceof PublicKey || to instanceof Address || _.isString(to));\n  if (to instanceof PublicKey) {\n    to = to.toAddress();\n  } else if (_.isString(to)) {\n    to = new Address(to);\n  }\n  var s = new Script();\n  s.add(Opcode.OP_DUP)\n    .add(Opcode.OP_HASH160)\n    .add(to.hashBuffer)\n    .add(Opcode.OP_EQUALVERIFY)\n    .add(Opcode.OP_CHECKSIG);\n  s._network = to.network;\n  return s;\n};\n\n/**\n * @returns {Script} a new pay to public key output for the given\n *  public key\n */\nScript.buildPublicKeyOut = function(pubkey) {\n  $.checkArgument(pubkey instanceof PublicKey);\n  var s = new Script();\n  s.add(pubkey.toBuffer())\n    .add(Opcode.OP_CHECKSIG);\n  return s;\n};\n\n/**\n * @returns {Script} a new OP_RETURN script with data\n * @param {(string|Buffer)} data - the data to embed in the output\n * @param {(string)} encoding - the type of encoding of the string\n */\nScript.buildDataOut = function(data, encoding) {\n  $.checkArgument(_.isUndefined(data) || _.isString(data) || BufferUtil.isBuffer(data));\n  if (_.isString(data)) {\n    data = new Buffer(data, encoding);\n  }\n  var s = new Script();\n  s.add(Opcode.OP_RETURN);\n  if (!_.isUndefined(data)) {\n    s.add(data);\n  }\n  return s;\n};\n\n/**\n * @param {Script|Address} script - the redeemScript for the new p2sh output.\n *    It can also be a p2sh address\n * @returns {Script} new pay to script hash script for given script\n */\nScript.buildScriptHashOut = function(script) {\n  $.checkArgument(script instanceof Script ||\n    (script instanceof Address && script.isPayToScriptHash()));\n  var s = new Script();\n  s.add(Opcode.OP_HASH160)\n    .add(script instanceof Address ? script.hashBuffer : Hash.sha256ripemd160(script.toBuffer()))\n    .add(Opcode.OP_EQUAL);\n\n  s._network = script._network || script.network;\n  return s;\n};\n\n/**\n * Builds a scriptSig (a script for an input) that signs a public key output script.\n *\n * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding\n * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL)\n */\nScript.buildPublicKeyIn = function(signature, sigtype) {\n  $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature));\n  $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype));\n  if (signature instanceof Signature) {\n    signature = signature.toBuffer();\n  }\n  var script = new Script();\n  script.add(BufferUtil.concat([\n    signature,\n    BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL)\n  ]));\n  return script;\n};\n\n/**\n * Builds a scriptSig (a script for an input) that signs a public key hash\n * output script.\n *\n * @param {Buffer|string|PublicKey} publicKey\n * @param {Signature|Buffer} signature - a Signature object, or the signature in DER canonical encoding\n * @param {number=} sigtype - the type of the signature (defaults to SIGHASH_ALL)\n */\nScript.buildPublicKeyHashIn = function(publicKey, signature, sigtype) {\n  $.checkArgument(signature instanceof Signature || BufferUtil.isBuffer(signature));\n  $.checkArgument(_.isUndefined(sigtype) || _.isNumber(sigtype));\n  if (signature instanceof Signature) {\n    signature = signature.toBuffer();\n  }\n  var script = new Script()\n    .add(BufferUtil.concat([\n      signature,\n      BufferUtil.integerAsSingleByteBuffer(sigtype || Signature.SIGHASH_ALL)\n    ]))\n    .add(new PublicKey(publicKey).toBuffer());\n  return script;\n};\n\n/**\n * @returns {Script} an empty script\n */\nScript.empty = function() {\n  return new Script();\n};\n\n/**\n * @returns {Script} a new pay to script hash script that pays to this script\n */\nScript.prototype.toScriptHashOut = function() {\n  return Script.buildScriptHashOut(this);\n};\n\n/**\n * @return {Script} an output script built from the address\n */\nScript.fromAddress = function(address) {\n  address = Address(address);\n  if (address.isPayToScriptHash()) {\n    return Script.buildScriptHashOut(address);\n  } else if (address.isPayToPublicKeyHash()) {\n    return Script.buildPublicKeyHashOut(address);\n  }\n  throw new errors.Script.UnrecognizedAddress(address);\n};\n\n/**\n * Will return the associated address information object\n * @return {Address|boolean}\n */\nScript.prototype.getAddressInfo = function(opts) {\n  if (this._isInput) {\n    return this._getInputAddressInfo();\n  } else if (this._isOutput) {\n    return this._getOutputAddressInfo();\n  } else {\n    var info = this._getOutputAddressInfo();\n    if (!info) {\n      return this._getInputAddressInfo();\n    }\n    return info;\n  }\n};\n\n/**\n * Will return the associated output scriptPubKey address information object\n * @return {Address|boolean}\n * @private\n */\nScript.prototype._getOutputAddressInfo = function() {\n  var info = {};\n  if (this.isScriptHashOut()) {\n    info.hashBuffer = this.getData();\n    info.type = Address.PayToScriptHash;\n  } else if (this.isPublicKeyHashOut()) {\n    info.hashBuffer = this.getData();\n    info.type = Address.PayToPublicKeyHash;\n  } else {\n    return false;\n  }\n  return info;\n};\n\n/**\n * Will return the associated input scriptSig address information object\n * @return {Address|boolean}\n * @private\n */\nScript.prototype._getInputAddressInfo = function() {\n  var info = {};\n  if (this.isPublicKeyHashIn()) {\n    // hash the publickey found in the scriptSig\n    info.hashBuffer = Hash.sha256ripemd160(this.chunks[1].buf);\n    info.type = Address.PayToPublicKeyHash;\n  } else if (this.isScriptHashIn()) {\n    // hash the redeemscript found at the end of the scriptSig\n    info.hashBuffer = Hash.sha256ripemd160(this.chunks[this.chunks.length - 1].buf);\n    info.type = Address.PayToScriptHash;\n  } else {\n    return false;\n  }\n  return info;\n};\n\n/**\n * @param {Network=} network\n * @return {Address|boolean} the associated address for this script if possible, or false\n */\nScript.prototype.toAddress = function(network) {\n  var info = this.getAddressInfo();\n  if (!info) {\n    return false;\n  }\n  info.network = Networks.get(network) || this._network || Networks.defaultNetwork;\n  return new Address(info);\n};\n\n/**\n * Analogous to bitcoind's FindAndDelete. Find and delete equivalent chunks,\n * typically used with push data chunks.  Note that this will find and delete\n * not just the same data, but the same data with the same push data op as\n * produced by default. i.e., if a pushdata in a tx does not use the minimal\n * pushdata op, then when you try to remove the data it is pushing, it will not\n * be removed, because they do not use the same pushdata op.\n */\nScript.prototype.findAndDelete = function(script) {\n  var buf = script.toBuffer();\n  var hex = buf.toString('hex');\n  for (var i = 0; i < this.chunks.length; i++) {\n    var script2 = Script({\n      chunks: [this.chunks[i]]\n    });\n    var buf2 = script2.toBuffer();\n    var hex2 = buf2.toString('hex');\n    if (hex === hex2) {\n      this.chunks.splice(i, 1);\n    }\n  }\n  return this;\n};\n\n/**\n * Comes from bitcoind's script interpreter CheckMinimalPush function\n * @returns {boolean} if the chunk {i} is the smallest way to push that particular data.\n */\nScript.prototype.checkMinimalPush = function(i) {\n  var chunk = this.chunks[i];\n  var buf = chunk.buf;\n  var opcodenum = chunk.opcodenum;\n  if (!buf) {\n    return true;\n  }\n  if (buf.length === 0) {\n    // Could have used OP_0.\n    return opcodenum === Opcode.OP_0;\n  } else if (buf.length === 1 && buf[0] >= 1 && buf[0] <= 16) {\n    // Could have used OP_1 .. OP_16.\n    return opcodenum === Opcode.OP_1 + (buf[0] - 1);\n  } else if (buf.length === 1 && buf[0] === 0x81) {\n    // Could have used OP_1NEGATE\n    return opcodenum === Opcode.OP_1NEGATE;\n  } else if (buf.length <= 75) {\n    // Could have used a direct push (opcode indicating number of bytes pushed + those bytes).\n    return opcodenum === buf.length;\n  } else if (buf.length <= 255) {\n    // Could have used OP_PUSHDATA.\n    return opcodenum === Opcode.OP_PUSHDATA1;\n  } else if (buf.length <= 65535) {\n    // Could have used OP_PUSHDATA2.\n    return opcodenum === Opcode.OP_PUSHDATA2;\n  }\n  return true;\n};\n\n/**\n * Comes from bitcoind's script DecodeOP_N function\n * @param {number} opcode\n * @returns {number} numeric value in range of 0 to 16\n */\nScript.prototype._decodeOP_N = function(opcode) {\n  if (opcode === Opcode.OP_0) {\n    return 0;\n  } else if (opcode >= Opcode.OP_1 && opcode <= Opcode.OP_16) {\n    return opcode - (Opcode.OP_1 - 1);\n  } else {\n    throw new Error('Invalid opcode: ' + JSON.stringify(opcode));\n  }\n};\n\n/**\n * Comes from bitcoind's script GetSigOpCount(boolean) function\n * @param {boolean} use current (true) or pre-version-0.6 (false) logic\n * @returns {number} number of signature operations required by this script\n */\nScript.prototype.getSignatureOperationsCount = function(accurate) {\n  accurate = (_.isUndefined(accurate) ? true : accurate);\n  var self = this;\n  var n = 0;\n  var lastOpcode = Opcode.OP_INVALIDOPCODE;\n  _.each(self.chunks, function getChunk(chunk) {\n    var opcode = chunk.opcodenum;\n    if (opcode == Opcode.OP_CHECKSIG || opcode == Opcode.OP_CHECKSIGVERIFY) {\n      n++;\n    } else if (opcode == Opcode.OP_CHECKMULTISIG || opcode == Opcode.OP_CHECKMULTISIGVERIFY) {\n      if (accurate && lastOpcode >= Opcode.OP_1 && lastOpcode <= Opcode.OP_16) {\n        n += self._decodeOP_N(lastOpcode);\n      } else {\n        n += 20;\n      }\n    }\n    lastOpcode = opcode;\n  });\n  return n;\n};\n\nmodule.exports = Script;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/script/script.js\n// module id = 569\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/script/script.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar JSUtil = __webpack_require__(24);\n\nvar Script = __webpack_require__(57);\nvar Address = __webpack_require__(108);\nvar Unit = __webpack_require__(320);\n\n/**\n * Represents an unspent output information: its script, associated amount and address,\n * transaction id and output index.\n *\n * @constructor\n * @param {object} data\n * @param {string} data.txid the previous transaction id\n * @param {string=} data.txId alias for `txid`\n * @param {number} data.vout the index in the transaction\n * @param {number=} data.outputIndex alias for `vout`\n * @param {string|Script} data.scriptPubKey the script that must be resolved to release the funds\n * @param {string|Script=} data.script alias for `scriptPubKey`\n * @param {number} data.amount amount of bitcoins associated\n * @param {number=} data.satoshis alias for `amount`, but expressed in satoshis (1 BTC = 1e8 satoshis)\n * @param {string|Address=} data.address the associated address to the script, if provided\n */\nfunction UnspentOutput(data) {\n  /* jshint maxcomplexity: 20 */\n  /* jshint maxstatements: 20 */\n  if (!(this instanceof UnspentOutput)) {\n    return new UnspentOutput(data);\n  }\n  $.checkArgument(_.isObject(data), 'Must provide an object from where to extract data');\n  var address = data.address ? new Address(data.address) : undefined;\n  var txId = data.txid ? data.txid : data.txId;\n  if (!txId || !JSUtil.isHexaString(txId) || txId.length > 64) {\n    // TODO: Use the errors library\n    throw new Error('Invalid TXID in object', data);\n  }\n  var outputIndex = _.isUndefined(data.vout) ? data.outputIndex : data.vout;\n  if (!_.isNumber(outputIndex)) {\n    throw new Error('Invalid outputIndex, received ' + outputIndex);\n  }\n  $.checkArgument(!_.isUndefined(data.scriptPubKey) || !_.isUndefined(data.script),\n                  'Must provide the scriptPubKey for that output!');\n  var script = new Script(data.scriptPubKey || data.script);\n  $.checkArgument(!_.isUndefined(data.amount) || !_.isUndefined(data.satoshis),\n                  'Must provide an amount for the output');\n  var amount = !_.isUndefined(data.amount) ? new Unit.fromBTC(data.amount).toSatoshis() : data.satoshis;\n  $.checkArgument(_.isNumber(amount), 'Amount must be a number');\n  JSUtil.defineImmutable(this, {\n    address: address,\n    txId: txId,\n    outputIndex: outputIndex,\n    script: script,\n    satoshis: amount\n  });\n}\n\n/**\n * Provide an informative output when displaying this object in the console\n * @returns string\n */\nUnspentOutput.prototype.inspect = function() {\n  return '<UnspentOutput: ' + this.txId + ':' + this.outputIndex +\n         ', satoshis: ' + this.satoshis + ', address: ' + this.address + '>';\n};\n\n/**\n * String representation: just \"txid:index\"\n * @returns string\n */\nUnspentOutput.prototype.toString = function() {\n  return this.txId + ':' + this.outputIndex;\n};\n\n/**\n * Deserialize an UnspentOutput from an object\n * @param {object|string} data\n * @return UnspentOutput\n */\nUnspentOutput.fromObject = function(data) {\n  return new UnspentOutput(data);\n};\n\n/**\n * Returns a plain object (no prototype or methods) with the associated info for this output\n * @return {object}\n */\nUnspentOutput.prototype.toObject = UnspentOutput.prototype.toJSON = function toObject() {\n  return {\n    address: this.address ? this.address.toString() : undefined,\n    txid: this.txId,\n    vout: this.outputIndex,\n    scriptPubKey: this.script.toBuffer().toString('hex'),\n    amount: Unit.fromSatoshis(this.satoshis).toBTC()\n  };\n};\n\nmodule.exports = UnspentOutput;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/unspentoutput.js\n// module id = 570\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/unspentoutput.js")},function(module,exports){eval("// Base58 encoding/decoding\n// Originally written by Mike Hearn for BitcoinJ\n// Copyright (c) 2011 Google Inc\n// Ported to JavaScript by Stefan Thomas\n// Merged Buffer refactorings from base58-native by Stephen Pair\n// Copyright (c) 2013 BitPay Inc\n\nvar ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'\nvar ALPHABET_MAP = {}\nfor(var i = 0; i < ALPHABET.length; i++) {\n  ALPHABET_MAP[ALPHABET.charAt(i)] = i\n}\nvar BASE = 58\n\nfunction encode(buffer) {\n  if (buffer.length === 0) return ''\n\n  var i, j, digits = [0]\n  for (i = 0; i < buffer.length; i++) {\n    for (j = 0; j < digits.length; j++) digits[j] <<= 8\n\n    digits[0] += buffer[i]\n\n    var carry = 0\n    for (j = 0; j < digits.length; ++j) {\n      digits[j] += carry\n\n      carry = (digits[j] / BASE) | 0\n      digits[j] %= BASE\n    }\n\n    while (carry) {\n      digits.push(carry % BASE)\n\n      carry = (carry / BASE) | 0\n    }\n  }\n\n  // deal with leading zeros\n  for (i = 0; buffer[i] === 0 && i < buffer.length - 1; i++) digits.push(0)\n\n  return digits.reverse().map(function(digit) { return ALPHABET[digit] }).join('')\n}\n\nfunction decode(string) {\n  if (string.length === 0) return []\n\n  var i, j, bytes = [0]\n  for (i = 0; i < string.length; i++) {\n    var c = string[i]\n    if (!(c in ALPHABET_MAP)) throw new Error('Non-base58 character')\n\n    for (j = 0; j < bytes.length; j++) bytes[j] *= BASE\n    bytes[0] += ALPHABET_MAP[c]\n\n    var carry = 0\n    for (j = 0; j < bytes.length; ++j) {\n      bytes[j] += carry\n\n      carry = bytes[j] >> 8\n      bytes[j] &= 0xff\n    }\n\n    while (carry) {\n      bytes.push(carry & 0xff)\n\n      carry >>= 8\n    }\n  }\n\n  // deal with leading zeros\n  for (i = 0; string[i] === '1' && i < string.length - 1; i++) bytes.push(0)\n\n  return bytes.reverse()\n}\n\nmodule.exports = {\n  encode: encode,\n  decode: decode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/bs58/lib/bs58.js\n// module id = 571\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/bs58/lib/bs58.js")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// crypto (ignored)\n// module id = 572\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/node-forge/lib_crypto")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n  value: true\n});\n\nvar _DCLib = __webpack_require__(607);\n\nvar _DCLib2 = _interopRequireDefault(_DCLib);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nwindow.DCLib = new _DCLib2.default();\n/*\n  TODO: DCLib\n   - итеграция с metamask\n   - написать restore игры\n   - написать UI кошелька\n*/\n\nexports.default = window.DCLib;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/index.js\n// module id = 573\n// module chunks = 0\n\n//# sourceURL=index.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nif (typeof Promise === 'undefined') {\n\t// Rejection tracking prevents a common issue where React gets into an\n\t// inconsistent state due to an error, but it gets swallowed by a Promise,\n\t// and the user has no idea what causes React's erratic future behavior.\n\t__webpack_require__(1154).enable()\n\twindow.Promise = __webpack_require__(1153)\n}\n\n// fetch() polyfill for making API calls.\n__webpack_require__(1304)\n\n// Object.assign() is commonly used with React.\n// It will use the native implementation if it's present and isn't buggy.\nObject.assign = __webpack_require__(295)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./scripts/config/polyfills.js\n// module id = 574\n// module chunks = 0\n\n//# sourceURL=../scripts/config/polyfills.js")},function(module,exports){eval("module.exports = after\n\nfunction after(count, callback, err_cb) {\n    var bail = false\n    err_cb = err_cb || noop\n    proxy.count = count\n\n    return (count === 0) ? callback() : proxy\n\n    function proxy(err, result) {\n        if (proxy.count <= 0) {\n            throw new Error('after called too many times')\n        }\n        --proxy.count\n\n        // after first error, rest are passed to err_cb\n        if (err) {\n            bail = true\n            callback(err)\n            // future error callbacks will go to error handler\n            callback = err_cb\n        } else if (proxy.count === 0 && !bail) {\n            callback(null, result)\n        }\n    }\n}\n\nfunction noop() {}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/after/index.js\n// module id = 575\n// module chunks = 0\n\n//# sourceURL=../node_modules/after/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n    // global key for user preferred registration\nvar REGISTRATION_KEY = '@@any-promise/REGISTRATION',\n    // Prior registration (preferred or detected)\n    registered = null\n\n/**\n * Registers the given implementation.  An implementation must\n * be registered prior to any call to `require(\"any-promise\")`,\n * typically on application load.\n *\n * If called with no arguments, will return registration in\n * following priority:\n *\n * For Node.js:\n *\n * 1. Previous registration\n * 2. global.Promise if node.js version >= 0.12\n * 3. Auto detected promise based on first sucessful require of\n *    known promise libraries. Note this is a last resort, as the\n *    loaded library is non-deterministic. node.js >= 0.12 will\n *    always use global.Promise over this priority list.\n * 4. Throws error.\n *\n * For Browser:\n *\n * 1. Previous registration\n * 2. window.Promise\n * 3. Throws error.\n *\n * Options:\n *\n * Promise: Desired Promise constructor\n * global: Boolean - Should the registration be cached in a global variable to\n * allow cross dependency/bundle registration?  (default true)\n */\nmodule.exports = function(root, loadImplementation){\n  return function register(implementation, opts){\n    implementation = implementation || null\n    opts = opts || {}\n    // global registration unless explicitly  {global: false} in options (default true)\n    var registerGlobal = opts.global !== false;\n\n    // load any previous global registration\n    if(registered === null && registerGlobal){\n      registered = root[REGISTRATION_KEY] || null\n    }\n\n    if(registered !== null\n        && implementation !== null\n        && registered.implementation !== implementation){\n      // Throw error if attempting to redefine implementation\n      throw new Error('any-promise already defined as \"'+registered.implementation+\n        '\".  You can only register an implementation before the first '+\n        ' call to require(\"any-promise\") and an implementation cannot be changed')\n    }\n\n    if(registered === null){\n      // use provided implementation\n      if(implementation !== null && typeof opts.Promise !== 'undefined'){\n        registered = {\n          Promise: opts.Promise,\n          implementation: implementation\n        }\n      } else {\n        // require implementation if implementation is specified but not provided\n        registered = loadImplementation(implementation)\n      }\n\n      if(registerGlobal){\n        // register preference globally in case multiple installations\n        root[REGISTRATION_KEY] = registered\n      }\n    }\n\n    return registered\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/any-promise/loader.js\n// module id = 576\n// module chunks = 0\n\n//# sourceURL=../node_modules/any-promise/loader.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = __webpack_require__(576)(window, loadImplementation)\n\n/**\n * Browser specific loadImplementation.  Always uses `window.Promise`\n *\n * To register a custom implementation, must register with `Promise` option.\n */\nfunction loadImplementation(){\n  if(typeof window.Promise === 'undefined'){\n    throw new Error(\"any-promise browser requires a polyfill or explicit registration\"+\n      \" e.g: require('any-promise/register/bluebird')\")\n  }\n  return {\n    Promise: window.Promise,\n    implementation: 'window.Promise'\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/any-promise/register-shim.js\n// module id = 577\n// module chunks = 0\n\n//# sourceURL=../node_modules/any-promise/register-shim.js")},function(module,exports){eval("/**\n * An abstraction for slicing an arraybuffer even when\n * ArrayBuffer.prototype.slice is not supported\n *\n * @api public\n */\n\nmodule.exports = function(arraybuffer, start, end) {\n  var bytes = arraybuffer.byteLength;\n  start = start || 0;\n  end = end || bytes;\n\n  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\n  if (start < 0) { start += bytes; }\n  if (end < 0) { end += bytes; }\n  if (end > bytes) { end = bytes; }\n\n  if (start >= bytes || start >= end || bytes === 0) {\n    return new ArrayBuffer(0);\n  }\n\n  var abv = new Uint8Array(arraybuffer);\n  var result = new Uint8Array(end - start);\n  for (var i = start, ii = 0; i < end; i++, ii++) {\n    result[ii] = abv[i];\n  }\n  return result.buffer;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/arraybuffer.slice/index.js\n// module id = 578\n// module chunks = 0\n\n//# sourceURL=../node_modules/arraybuffer.slice/index.js")},function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(global) {\n\n// Use the fastest means possible to execute a task in its own turn, with\n// priority over other events including IO, animation, reflow, and redraw\n// events in browsers.\n//\n// An exception thrown by a task will permanently interrupt the processing of\n// subsequent tasks. The higher level `asap` function ensures that if an\n// exception is thrown by a task, that the task queue will continue flushing as\n// soon as possible, but if you use `rawAsap` directly, you are responsible to\n// either ensure that no exceptions are thrown from your task, or to manually\n// call `rawAsap.requestFlush` if an exception is thrown.\nmodule.exports = rawAsap;\nfunction rawAsap(task) {\n    if (!queue.length) {\n        requestFlush();\n        flushing = true;\n    }\n    // Equivalent to push, but avoids a function call.\n    queue[queue.length] = task;\n}\n\nvar queue = [];\n// Once a flush has been requested, no further calls to `requestFlush` are\n// necessary until the next `flush` completes.\nvar flushing = false;\n// `requestFlush` is an implementation-specific method that attempts to kick\n// off a `flush` event as quickly as possible. `flush` will attempt to exhaust\n// the event queue before yielding to the browser\'s own event loop.\nvar requestFlush;\n// The position of the next task to execute in the task queue. This is\n// preserved between calls to `flush` so that it can be resumed if\n// a task throws an exception.\nvar index = 0;\n// If a task schedules additional tasks recursively, the task queue can grow\n// unbounded. To prevent memory exhaustion, the task queue will periodically\n// truncate already-completed tasks.\nvar capacity = 1024;\n\n// The flush function processes all tasks that have been scheduled with\n// `rawAsap` unless and until one of those tasks throws an exception.\n// If a task throws an exception, `flush` ensures that its state will remain\n// consistent and will resume where it left off when called again.\n// However, `flush` does not make any arrangements to be called again if an\n// exception is thrown.\nfunction flush() {\n    while (index < queue.length) {\n        var currentIndex = index;\n        // Advance the index before calling the task. This ensures that we will\n        // begin flushing on the next task the task throws an error.\n        index = index + 1;\n        queue[currentIndex].call();\n        // Prevent leaking memory for long chains of recursive calls to `asap`.\n        // If we call `asap` within tasks scheduled by `asap`, the queue will\n        // grow, but to avoid an O(n) walk for every task we execute, we don\'t\n        // shift tasks off the queue after they have been executed.\n        // Instead, we periodically shift 1024 tasks off the queue.\n        if (index > capacity) {\n            // Manually shift all values starting at the index back to the\n            // beginning of the queue.\n            for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {\n                queue[scan] = queue[scan + index];\n            }\n            queue.length -= index;\n            index = 0;\n        }\n    }\n    queue.length = 0;\n    index = 0;\n    flushing = false;\n}\n\n// `requestFlush` is implemented using a strategy based on data collected from\n// every available SauceLabs Selenium web driver worker at time of writing.\n// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593\n\n// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that\n// have WebKitMutationObserver but not un-prefixed MutationObserver.\n// Must use `global` or `self` instead of `window` to work in both frames and web\n// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.\n\n/* globals self */\nvar scope = typeof global !== "undefined" ? global : self;\nvar BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;\n\n// MutationObservers are desirable because they have high priority and work\n// reliably everywhere they are implemented.\n// They are implemented in all modern browsers.\n//\n// - Android 4-4.3\n// - Chrome 26-34\n// - Firefox 14-29\n// - Internet Explorer 11\n// - iPad Safari 6-7.1\n// - iPhone Safari 7-7.1\n// - Safari 6-7\nif (typeof BrowserMutationObserver === "function") {\n    requestFlush = makeRequestCallFromMutationObserver(flush);\n\n// MessageChannels are desirable because they give direct access to the HTML\n// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera\n// 11-12, and in web workers in many engines.\n// Although message channels yield to any queued rendering and IO tasks, they\n// would be better than imposing the 4ms delay of timers.\n// However, they do not work reliably in Internet Explorer or Safari.\n\n// Internet Explorer 10 is the only browser that has setImmediate but does\n// not have MutationObservers.\n// Although setImmediate yields to the browser\'s renderer, it would be\n// preferrable to falling back to setTimeout since it does not have\n// the minimum 4ms penalty.\n// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and\n// Desktop to a lesser extent) that renders both setImmediate and\n// MessageChannel useless for the purposes of ASAP.\n// https://github.com/kriskowal/q/issues/396\n\n// Timers are implemented universally.\n// We fall back to timers in workers in most engines, and in foreground\n// contexts in the following browsers.\n// However, note that even this simple case requires nuances to operate in a\n// broad spectrum of browsers.\n//\n// - Firefox 3-13\n// - Internet Explorer 6-9\n// - iPad Safari 4.3\n// - Lynx 2.8.7\n} else {\n    requestFlush = makeRequestCallFromTimer(flush);\n}\n\n// `requestFlush` requests that the high priority event queue be flushed as\n// soon as possible.\n// This is useful to prevent an error thrown in a task from stalling the event\n// queue if the exception handled by Node.js’s\n// `process.on("uncaughtException")` or by a domain.\nrawAsap.requestFlush = requestFlush;\n\n// To request a high priority event, we induce a mutation observer by toggling\n// the text of a text node between "1" and "-1".\nfunction makeRequestCallFromMutationObserver(callback) {\n    var toggle = 1;\n    var observer = new BrowserMutationObserver(callback);\n    var node = document.createTextNode("");\n    observer.observe(node, {characterData: true});\n    return function requestCall() {\n        toggle = -toggle;\n        node.data = toggle;\n    };\n}\n\n// The message channel technique was discovered by Malte Ubl and was the\n// original foundation for this library.\n// http://www.nonblocking.io/2011/06/windownexttick.html\n\n// Safari 6.0.5 (at least) intermittently fails to create message ports on a\n// page\'s first load. Thankfully, this version of Safari supports\n// MutationObservers, so we don\'t need to fall back in that case.\n\n// function makeRequestCallFromMessageChannel(callback) {\n//     var channel = new MessageChannel();\n//     channel.port1.onmessage = callback;\n//     return function requestCall() {\n//         channel.port2.postMessage(0);\n//     };\n// }\n\n// For reasons explained above, we are also unable to use `setImmediate`\n// under any circumstances.\n// Even if we were, there is another bug in Internet Explorer 10.\n// It is not sufficient to assign `setImmediate` to `requestFlush` because\n// `setImmediate` must be called *by name* and therefore must be wrapped in a\n// closure.\n// Never forget.\n\n// function makeRequestCallFromSetImmediate(callback) {\n//     return function requestCall() {\n//         setImmediate(callback);\n//     };\n// }\n\n// Safari 6.0 has a problem where timers will get lost while the user is\n// scrolling. This problem does not impact ASAP because Safari 6.0 supports\n// mutation observers, so that implementation is used instead.\n// However, if we ever elect to use timers in Safari, the prevalent work-around\n// is to add a scroll event listener that calls for a flush.\n\n// `setTimeout` does not call the passed callback if the delay is less than\n// approximately 7 in web workers in Firefox 8 through 18, and sometimes not\n// even then.\n\nfunction makeRequestCallFromTimer(callback) {\n    return function requestCall() {\n        // We dispatch a timeout with a specified delay of 0 for engines that\n        // can reliably accommodate that request. This will usually be snapped\n        // to a 4 milisecond delay, but once we\'re flushing, there\'s no delay\n        // between events.\n        var timeoutHandle = setTimeout(handleTimer, 0);\n        // However, since this timer gets frequently dropped in Firefox\n        // workers, we enlist an interval handle that will try to fire\n        // an event 20 times per second until it succeeds.\n        var intervalHandle = setInterval(handleTimer, 50);\n\n        function handleTimer() {\n            // Whichever timer succeeds will cancel both timers and\n            // execute the callback.\n            clearTimeout(timeoutHandle);\n            clearInterval(intervalHandle);\n            callback();\n        }\n    };\n}\n\n// This is for `asap.js` only.\n// Its name will be periodically randomized to break any code that depends on\n// its existence.\nrawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;\n\n// ASAP was originally a nextTick shim included in Q. This was factored out\n// into this ASAP package. It was later adapted to RSVP which made further\n// amendments. These decisions, particularly to marginalize MessageChannel and\n// to capture the MutationObserver implementation in a closure, were integrated\n// back into ASAP proper.\n// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asap/browser-raw.js\n// module id = 579\n// module chunks = 0\n\n//# sourceURL=../node_modules/asap/browser-raw.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst asn1 = __webpack_require__(110);\nconst inherits = __webpack_require__(3);\n\nconst api = exports;\n\napi.define = function define(name, body) {\n  return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n  this.name = name;\n  this.body = body;\n\n  this.decoders = {};\n  this.encoders = {};\n}\n\nEntity.prototype._createNamed = function createNamed(base) {\n  let named;\n  try {\n    named = __webpack_require__(551).runInThisContext(\n      '(function ' + this.name + '(entity) {\\n' +\n      '  this._initNamed(entity);\\n' +\n      '})'\n    );\n  } catch (e) {\n    named = function (entity) {\n      this._initNamed(entity);\n    };\n  }\n  inherits(named, base);\n  named.prototype._initNamed = function initnamed(entity) {\n    base.call(this, entity);\n  };\n\n  return new named(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n  enc = enc || 'der';\n  // Lazily create decoder\n  if (!this.decoders.hasOwnProperty(enc))\n    this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\n  return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n  return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n  enc = enc || 'der';\n  // Lazily create encoder\n  if (!this.encoders.hasOwnProperty(enc))\n    this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\n  return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\n  return this._getEncoder(enc).encode(data, reporter);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/api.js\n// module id = 580\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/api.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Reporter = __webpack_require__(127).Reporter;\nconst EncoderBuffer = __webpack_require__(127).EncoderBuffer;\nconst DecoderBuffer = __webpack_require__(127).DecoderBuffer;\nconst assert = __webpack_require__(43);\n\n// Supported tags\nconst tags = [\n  'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n  'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n  'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n  'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n];\n\n// Public methods list\nconst methods = [\n  'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n  'any', 'contains'\n].concat(tags);\n\n// Overrided methods list\nconst overrided = [\n  '_peekTag', '_decodeTag', '_use',\n  '_decodeStr', '_decodeObjid', '_decodeTime',\n  '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n  '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n  '_encodeNull', '_encodeInt', '_encodeBool'\n];\n\nfunction Node(enc, parent) {\n  const state = {};\n  this._baseState = state;\n\n  state.enc = enc;\n\n  state.parent = parent || null;\n  state.children = null;\n\n  // State\n  state.tag = null;\n  state.args = null;\n  state.reverseArgs = null;\n  state.choice = null;\n  state.optional = false;\n  state.any = false;\n  state.obj = false;\n  state.use = null;\n  state.useDecoder = null;\n  state.key = null;\n  state['default'] = null;\n  state.explicit = null;\n  state.implicit = null;\n  state.contains = null;\n\n  // Should create new instance on each method\n  if (!state.parent) {\n    state.children = [];\n    this._wrap();\n  }\n}\nmodule.exports = Node;\n\nconst stateProps = [\n  'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n  'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n  'implicit', 'contains'\n];\n\nNode.prototype.clone = function clone() {\n  const state = this._baseState;\n  const cstate = {};\n  stateProps.forEach(function(prop) {\n    cstate[prop] = state[prop];\n  });\n  const res = new this.constructor(cstate.parent);\n  res._baseState = cstate;\n  return res;\n};\n\nNode.prototype._wrap = function wrap() {\n  const state = this._baseState;\n  methods.forEach(function(method) {\n    this[method] = function _wrappedMethod() {\n      const clone = new this.constructor(this);\n      state.children.push(clone);\n      return clone[method].apply(clone, arguments);\n    };\n  }, this);\n};\n\nNode.prototype._init = function init(body) {\n  const state = this._baseState;\n\n  assert(state.parent === null);\n  body.call(this);\n\n  // Filter children\n  state.children = state.children.filter(function(child) {\n    return child._baseState.parent === this;\n  }, this);\n  assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n  const state = this._baseState;\n\n  // Filter children and args\n  const children = args.filter(function(arg) {\n    return arg instanceof this.constructor;\n  }, this);\n  args = args.filter(function(arg) {\n    return !(arg instanceof this.constructor);\n  }, this);\n\n  if (children.length !== 0) {\n    assert(state.children === null);\n    state.children = children;\n\n    // Replace parent to maintain backward link\n    children.forEach(function(child) {\n      child._baseState.parent = this;\n    }, this);\n  }\n  if (args.length !== 0) {\n    assert(state.args === null);\n    state.args = args;\n    state.reverseArgs = args.map(function(arg) {\n      if (typeof arg !== 'object' || arg.constructor !== Object)\n        return arg;\n\n      const res = {};\n      Object.keys(arg).forEach(function(key) {\n        if (key == (key | 0))\n          key |= 0;\n        const value = arg[key];\n        res[value] = key;\n      });\n      return res;\n    });\n  }\n};\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function(method) {\n  Node.prototype[method] = function _overrided() {\n    const state = this._baseState;\n    throw new Error(method + ' not implemented for encoding: ' + state.enc);\n  };\n});\n\n//\n// Public methods\n//\n\ntags.forEach(function(tag) {\n  Node.prototype[tag] = function _tagMethod() {\n    const state = this._baseState;\n    const args = Array.prototype.slice.call(arguments);\n\n    assert(state.tag === null);\n    state.tag = tag;\n\n    this._useArgs(args);\n\n    return this;\n  };\n});\n\nNode.prototype.use = function use(item) {\n  assert(item);\n  const state = this._baseState;\n\n  assert(state.use === null);\n  state.use = item;\n\n  return this;\n};\n\nNode.prototype.optional = function optional() {\n  const state = this._baseState;\n\n  state.optional = true;\n\n  return this;\n};\n\nNode.prototype.def = function def(val) {\n  const state = this._baseState;\n\n  assert(state['default'] === null);\n  state['default'] = val;\n  state.optional = true;\n\n  return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n  const state = this._baseState;\n\n  assert(state.explicit === null && state.implicit === null);\n  state.explicit = num;\n\n  return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n  const state = this._baseState;\n\n  assert(state.explicit === null && state.implicit === null);\n  state.implicit = num;\n\n  return this;\n};\n\nNode.prototype.obj = function obj() {\n  const state = this._baseState;\n  const args = Array.prototype.slice.call(arguments);\n\n  state.obj = true;\n\n  if (args.length !== 0)\n    this._useArgs(args);\n\n  return this;\n};\n\nNode.prototype.key = function key(newKey) {\n  const state = this._baseState;\n\n  assert(state.key === null);\n  state.key = newKey;\n\n  return this;\n};\n\nNode.prototype.any = function any() {\n  const state = this._baseState;\n\n  state.any = true;\n\n  return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n  const state = this._baseState;\n\n  assert(state.choice === null);\n  state.choice = obj;\n  this._useArgs(Object.keys(obj).map(function(key) {\n    return obj[key];\n  }));\n\n  return this;\n};\n\nNode.prototype.contains = function contains(item) {\n  const state = this._baseState;\n\n  assert(state.use === null);\n  state.contains = item;\n\n  return this;\n};\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode(input, options) {\n  const state = this._baseState;\n\n  // Decode root node\n  if (state.parent === null)\n    return input.wrapResult(state.children[0]._decode(input, options));\n\n  let result = state['default'];\n  let present = true;\n\n  let prevKey = null;\n  if (state.key !== null)\n    prevKey = input.enterKey(state.key);\n\n  // Check if tag is there\n  if (state.optional) {\n    let tag = null;\n    if (state.explicit !== null)\n      tag = state.explicit;\n    else if (state.implicit !== null)\n      tag = state.implicit;\n    else if (state.tag !== null)\n      tag = state.tag;\n\n    if (tag === null && !state.any) {\n      // Trial and Error\n      const save = input.save();\n      try {\n        if (state.choice === null)\n          this._decodeGeneric(state.tag, input, options);\n        else\n          this._decodeChoice(input, options);\n        present = true;\n      } catch (e) {\n        present = false;\n      }\n      input.restore(save);\n    } else {\n      present = this._peekTag(input, tag, state.any);\n\n      if (input.isError(present))\n        return present;\n    }\n  }\n\n  // Push object on stack\n  let prevObj;\n  if (state.obj && present)\n    prevObj = input.enterObject();\n\n  if (present) {\n    // Unwrap explicit values\n    if (state.explicit !== null) {\n      const explicit = this._decodeTag(input, state.explicit);\n      if (input.isError(explicit))\n        return explicit;\n      input = explicit;\n    }\n\n    const start = input.offset;\n\n    // Unwrap implicit and normal values\n    if (state.use === null && state.choice === null) {\n      let save;\n      if (state.any)\n        save = input.save();\n      const body = this._decodeTag(\n        input,\n        state.implicit !== null ? state.implicit : state.tag,\n        state.any\n      );\n      if (input.isError(body))\n        return body;\n\n      if (state.any)\n        result = input.raw(save);\n      else\n        input = body;\n    }\n\n    if (options && options.track && state.tag !== null)\n      options.track(input.path(), start, input.length, 'tagged');\n\n    if (options && options.track && state.tag !== null)\n      options.track(input.path(), input.offset, input.length, 'content');\n\n    // Select proper method for tag\n    if (state.any) {\n      // no-op\n    } else if (state.choice === null) {\n      result = this._decodeGeneric(state.tag, input, options);\n    } else {\n      result = this._decodeChoice(input, options);\n    }\n\n    if (input.isError(result))\n      return result;\n\n    // Decode children\n    if (!state.any && state.choice === null && state.children !== null) {\n      state.children.forEach(function decodeChildren(child) {\n        // NOTE: We are ignoring errors here, to let parser continue with other\n        // parts of encoded data\n        child._decode(input, options);\n      });\n    }\n\n    // Decode contained/encoded by schema, only in bit or octet strings\n    if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n      const data = new DecoderBuffer(result);\n      result = this._getUse(state.contains, input._reporterState.obj)\n        ._decode(data, options);\n    }\n  }\n\n  // Pop object\n  if (state.obj && present)\n    result = input.leaveObject(prevObj);\n\n  // Set key\n  if (state.key !== null && (result !== null || present === true))\n    input.leaveKey(prevKey, state.key, result);\n  else if (prevKey !== null)\n    input.exitKey(prevKey);\n\n  return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n  const state = this._baseState;\n\n  if (tag === 'seq' || tag === 'set')\n    return null;\n  if (tag === 'seqof' || tag === 'setof')\n    return this._decodeList(input, tag, state.args[0], options);\n  else if (/str$/.test(tag))\n    return this._decodeStr(input, tag, options);\n  else if (tag === 'objid' && state.args)\n    return this._decodeObjid(input, state.args[0], state.args[1], options);\n  else if (tag === 'objid')\n    return this._decodeObjid(input, null, null, options);\n  else if (tag === 'gentime' || tag === 'utctime')\n    return this._decodeTime(input, tag, options);\n  else if (tag === 'null_')\n    return this._decodeNull(input, options);\n  else if (tag === 'bool')\n    return this._decodeBool(input, options);\n  else if (tag === 'objDesc')\n    return this._decodeStr(input, tag, options);\n  else if (tag === 'int' || tag === 'enum')\n    return this._decodeInt(input, state.args && state.args[0], options);\n\n  if (state.use !== null) {\n    return this._getUse(state.use, input._reporterState.obj)\n      ._decode(input, options);\n  } else {\n    return input.error('unknown tag: ' + tag);\n  }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n\n  const state = this._baseState;\n  // Create altered use decoder if implicit is set\n  state.useDecoder = this._use(entity, obj);\n  assert(state.useDecoder._baseState.parent === null);\n  state.useDecoder = state.useDecoder._baseState.children[0];\n  if (state.implicit !== state.useDecoder._baseState.implicit) {\n    state.useDecoder = state.useDecoder.clone();\n    state.useDecoder._baseState.implicit = state.implicit;\n  }\n  return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n  const state = this._baseState;\n  let result = null;\n  let match = false;\n\n  Object.keys(state.choice).some(function(key) {\n    const save = input.save();\n    const node = state.choice[key];\n    try {\n      const value = node._decode(input, options);\n      if (input.isError(value))\n        return false;\n\n      result = { type: key, value: value };\n      match = true;\n    } catch (e) {\n      input.restore(save);\n      return false;\n    }\n    return true;\n  }, this);\n\n  if (!match)\n    return input.error('Choice not matched');\n\n  return result;\n};\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n  return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n  const state = this._baseState;\n  if (state['default'] !== null && state['default'] === data)\n    return;\n\n  const result = this._encodeValue(data, reporter, parent);\n  if (result === undefined)\n    return;\n\n  if (this._skipDefault(result, reporter, parent))\n    return;\n\n  return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n  const state = this._baseState;\n\n  // Decode root node\n  if (state.parent === null)\n    return state.children[0]._encode(data, reporter || new Reporter());\n\n  let result = null;\n\n  // Set reporter to share it with a child class\n  this.reporter = reporter;\n\n  // Check if data is there\n  if (state.optional && data === undefined) {\n    if (state['default'] !== null)\n      data = state['default'];\n    else\n      return;\n  }\n\n  // Encode children first\n  let content = null;\n  let primitive = false;\n  if (state.any) {\n    // Anything that was given is translated to buffer\n    result = this._createEncoderBuffer(data);\n  } else if (state.choice) {\n    result = this._encodeChoice(data, reporter);\n  } else if (state.contains) {\n    content = this._getUse(state.contains, parent)._encode(data, reporter);\n    primitive = true;\n  } else if (state.children) {\n    content = state.children.map(function(child) {\n      if (child._baseState.tag === 'null_')\n        return child._encode(null, reporter, data);\n\n      if (child._baseState.key === null)\n        return reporter.error('Child should have a key');\n      const prevKey = reporter.enterKey(child._baseState.key);\n\n      if (typeof data !== 'object')\n        return reporter.error('Child expected, but input is not object');\n\n      const res = child._encode(data[child._baseState.key], reporter, data);\n      reporter.leaveKey(prevKey);\n\n      return res;\n    }, this).filter(function(child) {\n      return child;\n    });\n    content = this._createEncoderBuffer(content);\n  } else {\n    if (state.tag === 'seqof' || state.tag === 'setof') {\n      // TODO(indutny): this should be thrown on DSL level\n      if (!(state.args && state.args.length === 1))\n        return reporter.error('Too many args for : ' + state.tag);\n\n      if (!Array.isArray(data))\n        return reporter.error('seqof/setof, but data is not Array');\n\n      const child = this.clone();\n      child._baseState.implicit = null;\n      content = this._createEncoderBuffer(data.map(function(item) {\n        const state = this._baseState;\n\n        return this._getUse(state.args[0], data)._encode(item, reporter);\n      }, child));\n    } else if (state.use !== null) {\n      result = this._getUse(state.use, parent)._encode(data, reporter);\n    } else {\n      content = this._encodePrimitive(state.tag, data);\n      primitive = true;\n    }\n  }\n\n  // Encode data itself\n  if (!state.any && state.choice === null) {\n    const tag = state.implicit !== null ? state.implicit : state.tag;\n    const cls = state.implicit === null ? 'universal' : 'context';\n\n    if (tag === null) {\n      if (state.use === null)\n        reporter.error('Tag could be omitted only for .use()');\n    } else {\n      if (state.use === null)\n        result = this._encodeComposite(tag, primitive, cls, content);\n    }\n  }\n\n  // Wrap in explicit\n  if (state.explicit !== null)\n    result = this._encodeComposite(state.explicit, false, 'context', result);\n\n  return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n  const state = this._baseState;\n\n  const node = state.choice[data.type];\n  if (!node) {\n    assert(\n      false,\n      data.type + ' not found in ' +\n            JSON.stringify(Object.keys(state.choice)));\n  }\n  return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n  const state = this._baseState;\n\n  if (/str$/.test(tag))\n    return this._encodeStr(data, tag);\n  else if (tag === 'objid' && state.args)\n    return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n  else if (tag === 'objid')\n    return this._encodeObjid(data, null, null);\n  else if (tag === 'gentime' || tag === 'utctime')\n    return this._encodeTime(data, tag);\n  else if (tag === 'null_')\n    return this._encodeNull();\n  else if (tag === 'int' || tag === 'enum')\n    return this._encodeInt(data, state.args && state.reverseArgs[0]);\n  else if (tag === 'bool')\n    return this._encodeBool(data);\n  else if (tag === 'objDesc')\n    return this._encodeStr(data, tag);\n  else\n    throw new Error('Unsupported tag: ' + tag);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n  return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n  return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/base/node.js\n// module id = 581\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/base/node.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\n\nfunction Reporter(options) {\n  this._reporterState = {\n    obj: null,\n    path: [],\n    options: options || {},\n    errors: []\n  };\n}\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n  return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n  const state = this._reporterState;\n\n  return { obj: state.obj, pathLen: state.path.length };\n};\n\nReporter.prototype.restore = function restore(data) {\n  const state = this._reporterState;\n\n  state.obj = data.obj;\n  state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n  return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n  const state = this._reporterState;\n\n  state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n  const state = this._reporterState;\n\n  this.exitKey(index);\n  if (state.obj !== null)\n    state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n  return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n  const state = this._reporterState;\n\n  const prev = state.obj;\n  state.obj = {};\n  return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n  const state = this._reporterState;\n\n  const now = state.obj;\n  state.obj = prev;\n  return now;\n};\n\nReporter.prototype.error = function error(msg) {\n  let err;\n  const state = this._reporterState;\n\n  const inherited = msg instanceof ReporterError;\n  if (inherited) {\n    err = msg;\n  } else {\n    err = new ReporterError(state.path.map(function(elem) {\n      return '[' + JSON.stringify(elem) + ']';\n    }).join(''), msg.message || msg, msg.stack);\n  }\n\n  if (!state.options.partial)\n    throw err;\n\n  if (!inherited)\n    state.errors.push(err);\n\n  return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n  const state = this._reporterState;\n  if (!state.options.partial)\n    return result;\n\n  return {\n    result: this.isError(result) ? null : result,\n    errors: state.errors\n  };\n};\n\nfunction ReporterError(path, msg) {\n  this.path = path;\n  this.rethrow(msg);\n}\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n  this.message = msg + ' at: ' + (this.path || '(shallow)');\n  if (Error.captureStackTrace)\n    Error.captureStackTrace(this, ReporterError);\n\n  if (!this.stack) {\n    try {\n      // IE only adds stack when thrown\n      throw new Error(this.message);\n    } catch (e) {\n      this.stack = e.stack;\n    }\n  }\n  return this;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/base/reporter.js\n// module id = 582\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/base/reporter.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst constants = __webpack_require__(323);\n\nexports.tagClass = {\n  0: 'universal',\n  1: 'application',\n  2: 'context',\n  3: 'private'\n};\nexports.tagClassByName = constants._reverse(exports.tagClass);\n\nexports.tag = {\n  0x00: 'end',\n  0x01: 'bool',\n  0x02: 'int',\n  0x03: 'bitstr',\n  0x04: 'octstr',\n  0x05: 'null_',\n  0x06: 'objid',\n  0x07: 'objDesc',\n  0x08: 'external',\n  0x09: 'real',\n  0x0a: 'enum',\n  0x0b: 'embed',\n  0x0c: 'utf8str',\n  0x0d: 'relativeOid',\n  0x10: 'seq',\n  0x11: 'set',\n  0x12: 'numstr',\n  0x13: 'printstr',\n  0x14: 't61str',\n  0x15: 'videostr',\n  0x16: 'ia5str',\n  0x17: 'utctime',\n  0x18: 'gentime',\n  0x19: 'graphstr',\n  0x1a: 'iso646str',\n  0x1b: 'genstr',\n  0x1c: 'unistr',\n  0x1d: 'charstr',\n  0x1e: 'bmpstr'\n};\nexports.tagByName = constants._reverse(exports.tag);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/constants/der.js\n// module id = 583\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/constants/der.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst decoders = exports;\n\ndecoders.der = __webpack_require__(324);\ndecoders.pem = __webpack_require__(585);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/decoders/index.js\n// module id = 584\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/decoders/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\nconst Buffer = __webpack_require__(0).Buffer;\n\nconst DERDecoder = __webpack_require__(324);\n\nfunction PEMDecoder(entity) {\n  DERDecoder.call(this, entity);\n  this.enc = 'pem';\n}\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n  const lines = data.toString().split(/[\\r\\n]+/g);\n\n  const label = options.label.toUpperCase();\n\n  const re = /^-----(BEGIN|END) ([^-]+)-----$/;\n  let start = -1;\n  let end = -1;\n  for (let i = 0; i < lines.length; i++) {\n    const match = lines[i].match(re);\n    if (match === null)\n      continue;\n\n    if (match[2] !== label)\n      continue;\n\n    if (start === -1) {\n      if (match[1] !== 'BEGIN')\n        break;\n      start = i;\n    } else {\n      if (match[1] !== 'END')\n        break;\n      end = i;\n      break;\n    }\n  }\n  if (start === -1 || end === -1)\n    throw new Error('PEM section not found for: ' + label);\n\n  const base64 = lines.slice(start + 1, end).join('');\n  // Remove excessive symbols\n  base64.replace(/[^a-z0-9+/=]+/gi, '');\n\n  const input = new Buffer(base64, 'base64');\n  return DERDecoder.prototype.decode.call(this, input, options);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/decoders/pem.js\n// module id = 585\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/decoders/pem.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst encoders = exports;\n\nencoders.der = __webpack_require__(325);\nencoders.pem = __webpack_require__(587);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/encoders/index.js\n// module id = 586\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/encoders/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst inherits = __webpack_require__(3);\n\nconst DEREncoder = __webpack_require__(325);\n\nfunction PEMEncoder(entity) {\n  DEREncoder.call(this, entity);\n  this.enc = 'pem';\n}\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n  const buf = DEREncoder.prototype.encode.call(this, data);\n\n  const p = buf.toString('base64');\n  const out = [ '-----BEGIN ' + options.label + '-----' ];\n  for (let i = 0; i < p.length; i += 64)\n    out.push(p.slice(i, i + 64));\n  out.push('-----END ' + options.label + '-----');\n  return out.join('\\n');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/asn1.js/lib/asn1/encoders/pem.js\n// module id = 587\n// module chunks = 0\n\n//# sourceURL=../node_modules/asn1.js/lib/asn1/encoders/pem.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(setImmediate, process, global, module) {(function (global, factory) {\n   true ? factory(exports) :\n  typeof define === 'function' && define.amd ? define(['exports'], factory) :\n  (factory((global.async = global.async || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction slice(arrayLike, start) {\n    start = start|0;\n    var newLen = Math.max(arrayLike.length - start, 0);\n    var newArr = Array(newLen);\n    for(var idx = 0; idx < newLen; idx++)  {\n        newArr[idx] = arrayLike[start + idx];\n    }\n    return newArr;\n}\n\n/**\n * Creates a continuation function with some arguments already applied.\n *\n * Useful as a shorthand when combined with other control flow functions. Any\n * arguments passed to the returned function are added to the arguments\n * originally passed to apply.\n *\n * @name apply\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {Function} fn - The function you want to eventually apply all\n * arguments to. Invokes with (arguments...).\n * @param {...*} arguments... - Any number of arguments to automatically apply\n * when the continuation is called.\n * @returns {Function} the partially-applied function\n * @example\n *\n * // using apply\n * async.parallel([\n *     async.apply(fs.writeFile, 'testfile1', 'test1'),\n *     async.apply(fs.writeFile, 'testfile2', 'test2')\n * ]);\n *\n *\n * // the same process without using apply\n * async.parallel([\n *     function(callback) {\n *         fs.writeFile('testfile1', 'test1', callback);\n *     },\n *     function(callback) {\n *         fs.writeFile('testfile2', 'test2', callback);\n *     }\n * ]);\n *\n * // It's possible to pass any number of additional arguments when calling the\n * // continuation:\n *\n * node> var fn = async.apply(sys.puts, 'one');\n * node> fn('two', 'three');\n * one\n * two\n * three\n */\nvar apply = function(fn/*, ...args*/) {\n    var args = slice(arguments, 1);\n    return function(/*callArgs*/) {\n        var callArgs = slice(arguments);\n        return fn.apply(null, args.concat(callArgs));\n    };\n};\n\nvar initialParams = function (fn) {\n    return function (/*...args, callback*/) {\n        var args = slice(arguments);\n        var callback = args.pop();\n        fn.call(this, args, callback);\n    };\n};\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nvar hasSetImmediate = typeof setImmediate === 'function' && setImmediate;\nvar hasNextTick = typeof process === 'object' && typeof process.nextTick === 'function';\n\nfunction fallback(fn) {\n    setTimeout(fn, 0);\n}\n\nfunction wrap(defer) {\n    return function (fn/*, ...args*/) {\n        var args = slice(arguments, 1);\n        defer(function () {\n            fn.apply(null, args);\n        });\n    };\n}\n\nvar _defer;\n\nif (hasSetImmediate) {\n    _defer = setImmediate;\n} else if (hasNextTick) {\n    _defer = process.nextTick;\n} else {\n    _defer = fallback;\n}\n\nvar setImmediate$1 = wrap(_defer);\n\n/**\n * Take a sync function and make it async, passing its return value to a\n * callback. This is useful for plugging sync functions into a waterfall,\n * series, or other async functions. Any arguments passed to the generated\n * function will be passed to the wrapped function (except for the final\n * callback argument). Errors thrown will be passed to the callback.\n *\n * If the function passed to `asyncify` returns a Promise, that promises's\n * resolved/rejected state will be used to call the callback, rather than simply\n * the synchronous return value.\n *\n * This also means you can asyncify ES2017 `async` functions.\n *\n * @name asyncify\n * @static\n * @memberOf module:Utils\n * @method\n * @alias wrapSync\n * @category Util\n * @param {Function} func - The synchronous function, or Promise-returning\n * function to convert to an {@link AsyncFunction}.\n * @returns {AsyncFunction} An asynchronous wrapper of the `func`. To be\n * invoked with `(args..., callback)`.\n * @example\n *\n * // passing a regular synchronous function\n * async.waterfall([\n *     async.apply(fs.readFile, filename, \"utf8\"),\n *     async.asyncify(JSON.parse),\n *     function (data, next) {\n *         // data is the result of parsing the text.\n *         // If there was a parsing error, it would have been caught.\n *     }\n * ], callback);\n *\n * // passing a function returning a promise\n * async.waterfall([\n *     async.apply(fs.readFile, filename, \"utf8\"),\n *     async.asyncify(function (contents) {\n *         return db.model.create(contents);\n *     }),\n *     function (model, next) {\n *         // `model` is the instantiated model object.\n *         // If there was an error, this function would be skipped.\n *     }\n * ], callback);\n *\n * // es2017 example, though `asyncify` is not needed if your JS environment\n * // supports async functions out of the box\n * var q = async.queue(async.asyncify(async function(file) {\n *     var intermediateStep = await processFile(file);\n *     return await somePromise(intermediateStep)\n * }));\n *\n * q.push(files);\n */\nfunction asyncify(func) {\n    return initialParams(function (args, callback) {\n        var result;\n        try {\n            result = func.apply(this, args);\n        } catch (e) {\n            return callback(e);\n        }\n        // if result is Promise object\n        if (isObject(result) && typeof result.then === 'function') {\n            result.then(function(value) {\n                invokeCallback(callback, null, value);\n            }, function(err) {\n                invokeCallback(callback, err.message ? err : new Error(err));\n            });\n        } else {\n            callback(null, result);\n        }\n    });\n}\n\nfunction invokeCallback(callback, error, value) {\n    try {\n        callback(error, value);\n    } catch (e) {\n        setImmediate$1(rethrow, e);\n    }\n}\n\nfunction rethrow(error) {\n    throw error;\n}\n\nvar supportsSymbol = typeof Symbol === 'function';\n\nfunction isAsync(fn) {\n    return supportsSymbol && fn[Symbol.toStringTag] === 'AsyncFunction';\n}\n\nfunction wrapAsync(asyncFn) {\n    return isAsync(asyncFn) ? asyncify(asyncFn) : asyncFn;\n}\n\nfunction applyEach$1(eachfn) {\n    return function(fns/*, ...args*/) {\n        var args = slice(arguments, 1);\n        var go = initialParams(function(args, callback) {\n            var that = this;\n            return eachfn(fns, function (fn, cb) {\n                wrapAsync(fn).apply(that, args.concat(cb));\n            }, callback);\n        });\n        if (args.length) {\n            return go.apply(this, args);\n        }\n        else {\n            return go;\n        }\n    };\n}\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Built-in value references. */\nvar Symbol$1 = root.Symbol;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n      tag = value[symToStringTag$1];\n\n  try {\n    value[symToStringTag$1] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag$1] = tag;\n    } else {\n      delete value[symToStringTag$1];\n    }\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$1.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString$1.call(value);\n}\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]';\nvar undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]';\nvar funcTag = '[object Function]';\nvar genTag = '[object GeneratorFunction]';\nvar proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n// A temporary value used to identify if the loop should be broken.\n// See #1064, #1293\nvar breakLoop = {};\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n  // No operation performed.\n}\n\nfunction once(fn) {\n    return function () {\n        if (fn === null) return;\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, arguments);\n    };\n}\n\nvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nvar getIterator = function (coll) {\n    return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n};\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n  return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/** Used for built-in method references. */\nvar objectProto$3 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$2 = objectProto$3.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto$3.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n  return isObjectLike(value) && hasOwnProperty$2.call(value, 'callee') &&\n    !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER$1 = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER$1 : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/** `Object#toString` result references. */\nvar argsTag$1 = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag$1 = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag$1] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag$1] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/** Detect free variable `exports`. */\nvar freeExports$1 = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule$1 = freeExports$1 && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports$1 && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/** Used for built-in method references. */\nvar objectProto$2 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$1 = objectProto$2.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  var isArr = isArray(value),\n      isArg = !isArr && isArguments(value),\n      isBuff = !isArr && !isArg && isBuffer(value),\n      isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n      skipIndexes = isArr || isArg || isBuff || isType,\n      result = skipIndexes ? baseTimes(value.length, String) : [],\n      length = result.length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty$1.call(value, key)) &&\n        !(skipIndexes && (\n           // Safari 9 has enumerable `arguments.length` in strict mode.\n           key == 'length' ||\n           // Node.js 0.10 has enumerable non-index properties on buffers.\n           (isBuff && (key == 'offset' || key == 'parent')) ||\n           // PhantomJS 2 has enumerable non-index properties on typed arrays.\n           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n           // Skip index properties.\n           isIndex(key, length)\n        ))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto$5 = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$5;\n\n  return value === proto;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/** Used for built-in method references. */\nvar objectProto$4 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty$3 = objectProto$4.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty$3.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nfunction createArrayIterator(coll) {\n    var i = -1;\n    var len = coll.length;\n    return function next() {\n        return ++i < len ? {value: coll[i], key: i} : null;\n    }\n}\n\nfunction createES2015Iterator(iterator) {\n    var i = -1;\n    return function next() {\n        var item = iterator.next();\n        if (item.done)\n            return null;\n        i++;\n        return {value: item.value, key: i};\n    }\n}\n\nfunction createObjectIterator(obj) {\n    var okeys = keys(obj);\n    var i = -1;\n    var len = okeys.length;\n    return function next() {\n        var key = okeys[++i];\n        return i < len ? {value: obj[key], key: key} : null;\n    };\n}\n\nfunction iterator(coll) {\n    if (isArrayLike(coll)) {\n        return createArrayIterator(coll);\n    }\n\n    var iterator = getIterator(coll);\n    return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\n\nfunction onlyOnce(fn) {\n    return function() {\n        if (fn === null) throw new Error(\"Callback was already called.\");\n        var callFn = fn;\n        fn = null;\n        callFn.apply(this, arguments);\n    };\n}\n\nfunction _eachOfLimit(limit) {\n    return function (obj, iteratee, callback) {\n        callback = once(callback || noop);\n        if (limit <= 0 || !obj) {\n            return callback(null);\n        }\n        var nextElem = iterator(obj);\n        var done = false;\n        var running = 0;\n\n        function iterateeCallback(err, value) {\n            running -= 1;\n            if (err) {\n                done = true;\n                callback(err);\n            }\n            else if (value === breakLoop || (done && running <= 0)) {\n                done = true;\n                return callback(null);\n            }\n            else {\n                replenish();\n            }\n        }\n\n        function replenish () {\n            while (running < limit && !done) {\n                var elem = nextElem();\n                if (elem === null) {\n                    done = true;\n                    if (running <= 0) {\n                        callback(null);\n                    }\n                    return;\n                }\n                running += 1;\n                iteratee(elem.value, elem.key, onlyOnce(iterateeCallback));\n            }\n        }\n\n        replenish();\n    };\n}\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name eachOfLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`. The `key` is the item's key, or index in the case of an\n * array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachOfLimit(coll, limit, iteratee, callback) {\n    _eachOfLimit(limit)(coll, wrapAsync(iteratee), callback);\n}\n\nfunction doLimit(fn, limit) {\n    return function (iterable, iteratee, callback) {\n        return fn(iterable, limit, iteratee, callback);\n    };\n}\n\n// eachOf implementation optimized for array-likes\nfunction eachOfArrayLike(coll, iteratee, callback) {\n    callback = once(callback || noop);\n    var index = 0,\n        completed = 0,\n        length = coll.length;\n    if (length === 0) {\n        callback(null);\n    }\n\n    function iteratorCallback(err, value) {\n        if (err) {\n            callback(err);\n        } else if ((++completed === length) || value === breakLoop) {\n            callback(null);\n        }\n    }\n\n    for (; index < length; index++) {\n        iteratee(coll[index], index, onlyOnce(iteratorCallback));\n    }\n}\n\n// a generic version of eachOf which can handle array, object, and iterator cases.\nvar eachOfGeneric = doLimit(eachOfLimit, Infinity);\n\n/**\n * Like [`each`]{@link module:Collections.each}, except that it passes the key (or index) as the second argument\n * to the iteratee.\n *\n * @name eachOf\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEachOf\n * @category Collection\n * @see [async.each]{@link module:Collections.each}\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each\n * item in `coll`.\n * The `key` is the item's key, or index in the case of an array.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * var obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\n * var configs = {};\n *\n * async.forEachOf(obj, function (value, key, callback) {\n *     fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n *         if (err) return callback(err);\n *         try {\n *             configs[key] = JSON.parse(data);\n *         } catch (e) {\n *             return callback(e);\n *         }\n *         callback();\n *     });\n * }, function (err) {\n *     if (err) console.error(err.message);\n *     // configs is now a map of JSON data\n *     doSomethingWith(configs);\n * });\n */\nvar eachOf = function(coll, iteratee, callback) {\n    var eachOfImplementation = isArrayLike(coll) ? eachOfArrayLike : eachOfGeneric;\n    eachOfImplementation(coll, wrapAsync(iteratee), callback);\n};\n\nfunction doParallel(fn) {\n    return function (obj, iteratee, callback) {\n        return fn(eachOf, obj, wrapAsync(iteratee), callback);\n    };\n}\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n    callback = callback || noop;\n    arr = arr || [];\n    var results = [];\n    var counter = 0;\n    var _iteratee = wrapAsync(iteratee);\n\n    eachfn(arr, function (value, _, callback) {\n        var index = counter++;\n        _iteratee(value, function (err, v) {\n            results[index] = v;\n            callback(err);\n        });\n    }, function (err) {\n        callback(err, results);\n    });\n}\n\n/**\n * Produces a new collection of values by mapping each value in `coll` through\n * the `iteratee` function. The `iteratee` is called with an item from `coll`\n * and a callback for when it has finished processing. Each of these callback\n * takes 2 arguments: an `error`, and the transformed item from `coll`. If\n * `iteratee` passes an error to its callback, the main `callback` (for the\n * `map` function) is immediately called with the error.\n *\n * Note, that since this function applies the `iteratee` to each item in\n * parallel, there is no guarantee that the `iteratee` functions will complete\n * in order. However, the results array will be in the same order as the\n * original `coll`.\n *\n * If `map` is passed an Object, the results will be an Array.  The results\n * will roughly be in the order of the original Objects' keys (but this can\n * vary across JavaScript engines).\n *\n * @name map\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an Array of the\n * transformed items from the `coll`. Invoked with (err, results).\n * @example\n *\n * async.map(['file1','file2','file3'], fs.stat, function(err, results) {\n *     // results is now an array of stats for each file\n * });\n */\nvar map = doParallel(_asyncMap);\n\n/**\n * Applies the provided arguments to each function in the array, calling\n * `callback` after all functions have completed. If you only provide the first\n * argument, `fns`, then it will return a function which lets you pass in the\n * arguments as if it were a single function call. If more arguments are\n * provided, `callback` is required while `args` is still optional.\n *\n * @name applyEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s\n * to all call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument, `fns`, is provided, it will\n * return a function which lets you pass in the arguments as if it were a single\n * function call. The signature is `(..args, callback)`. If invoked with any\n * arguments, `callback` is required.\n * @example\n *\n * async.applyEach([enableSearch, updateSchema], 'bucket', callback);\n *\n * // partial application example:\n * async.each(\n *     buckets,\n *     async.applyEach([enableSearch, updateSchema]),\n *     callback\n * );\n */\nvar applyEach = applyEach$1(map);\n\nfunction doParallelLimit(fn) {\n    return function (obj, limit, iteratee, callback) {\n        return fn(_eachOfLimit(limit), obj, wrapAsync(iteratee), callback);\n    };\n}\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs a maximum of `limit` async operations at a time.\n *\n * @name mapLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapLimit = doParallelLimit(_asyncMap);\n\n/**\n * The same as [`map`]{@link module:Collections.map} but runs only a single async operation at a time.\n *\n * @name mapSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with the transformed item.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Results is an array of the\n * transformed items from the `coll`. Invoked with (err, results).\n */\nvar mapSeries = doLimit(mapLimit, 1);\n\n/**\n * The same as [`applyEach`]{@link module:ControlFlow.applyEach} but runs only a single async operation at a time.\n *\n * @name applyEachSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.applyEach]{@link module:ControlFlow.applyEach}\n * @category Control Flow\n * @param {Array|Iterable|Object} fns - A collection of {@link AsyncFunction}s to all\n * call with the same arguments\n * @param {...*} [args] - any number of separate arguments to pass to the\n * function.\n * @param {Function} [callback] - the final argument should be the callback,\n * called when all functions have completed processing.\n * @returns {Function} - If only the first argument is provided, it will return\n * a function which lets you pass in the arguments as if it were a single\n * function call.\n */\nvar applyEachSeries = applyEach$1(mapSeries);\n\n/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\n/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  return value === value\n    ? strictIndexOf(array, value, fromIndex)\n    : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\n/**\n * Determines the best order for running the {@link AsyncFunction}s in `tasks`, based on\n * their requirements. Each function can optionally depend on other functions\n * being completed first, and each function is run as soon as its requirements\n * are satisfied.\n *\n * If any of the {@link AsyncFunction}s pass an error to their callback, the `auto` sequence\n * will stop. Further tasks will not execute (so any other functions depending\n * on it will not run), and the main `callback` is immediately called with the\n * error.\n *\n * {@link AsyncFunction}s also receive an object containing the results of functions which\n * have completed so far as the first argument, if they have dependencies. If a\n * task function has no dependencies, it will only be passed a callback.\n *\n * @name auto\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Object} tasks - An object. Each of its properties is either a\n * function or an array of requirements, with the {@link AsyncFunction} itself the last item\n * in the array. The object's key of a property serves as the name of the task\n * defined by that property, i.e. can be used when specifying requirements for\n * other tasks. The function receives one or two arguments:\n * * a `results` object, containing the results of the previously executed\n *   functions, only passed if the task has any dependencies,\n * * a `callback(err, result)` function, which must be called when finished,\n *   passing an `error` (which can be `null`) and the result of the function's\n *   execution.\n * @param {number} [concurrency=Infinity] - An optional `integer` for\n * determining the maximum number of tasks that can be run in parallel. By\n * default, as many as possible.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback. Results are always returned; however, if an\n * error occurs, no further `tasks` will be performed, and the results object\n * will only contain partial results. Invoked with (err, results).\n * @returns undefined\n * @example\n *\n * async.auto({\n *     // this function will just be passed a callback\n *     readData: async.apply(fs.readFile, 'data.txt', 'utf-8'),\n *     showData: ['readData', function(results, cb) {\n *         // results.readData is the file's contents\n *         // ...\n *     }]\n * }, callback);\n *\n * async.auto({\n *     get_data: function(callback) {\n *         console.log('in get_data');\n *         // async code to get some data\n *         callback(null, 'data', 'converted to array');\n *     },\n *     make_folder: function(callback) {\n *         console.log('in make_folder');\n *         // async code to create a directory to store a file in\n *         // this is run at the same time as getting the data\n *         callback(null, 'folder');\n *     },\n *     write_file: ['get_data', 'make_folder', function(results, callback) {\n *         console.log('in write_file', JSON.stringify(results));\n *         // once there is some data and the directory exists,\n *         // write the data to a file in the directory\n *         callback(null, 'filename');\n *     }],\n *     email_link: ['write_file', function(results, callback) {\n *         console.log('in email_link', JSON.stringify(results));\n *         // once the file is written let's email a link to it...\n *         // results.write_file contains the filename returned by write_file.\n *         callback(null, {'file':results.write_file, 'email':'user@example.com'});\n *     }]\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('results = ', results);\n * });\n */\nvar auto = function (tasks, concurrency, callback) {\n    if (typeof concurrency === 'function') {\n        // concurrency is optional, shift the args.\n        callback = concurrency;\n        concurrency = null;\n    }\n    callback = once(callback || noop);\n    var keys$$1 = keys(tasks);\n    var numTasks = keys$$1.length;\n    if (!numTasks) {\n        return callback(null);\n    }\n    if (!concurrency) {\n        concurrency = numTasks;\n    }\n\n    var results = {};\n    var runningTasks = 0;\n    var hasError = false;\n\n    var listeners = Object.create(null);\n\n    var readyTasks = [];\n\n    // for cycle detection:\n    var readyToCheck = []; // tasks that have been identified as reachable\n    // without the possibility of returning to an ancestor task\n    var uncheckedDependencies = {};\n\n    baseForOwn(tasks, function (task, key) {\n        if (!isArray(task)) {\n            // no dependencies\n            enqueueTask(key, [task]);\n            readyToCheck.push(key);\n            return;\n        }\n\n        var dependencies = task.slice(0, task.length - 1);\n        var remainingDependencies = dependencies.length;\n        if (remainingDependencies === 0) {\n            enqueueTask(key, task);\n            readyToCheck.push(key);\n            return;\n        }\n        uncheckedDependencies[key] = remainingDependencies;\n\n        arrayEach(dependencies, function (dependencyName) {\n            if (!tasks[dependencyName]) {\n                throw new Error('async.auto task `' + key +\n                    '` has a non-existent dependency `' +\n                    dependencyName + '` in ' +\n                    dependencies.join(', '));\n            }\n            addListener(dependencyName, function () {\n                remainingDependencies--;\n                if (remainingDependencies === 0) {\n                    enqueueTask(key, task);\n                }\n            });\n        });\n    });\n\n    checkForDeadlocks();\n    processQueue();\n\n    function enqueueTask(key, task) {\n        readyTasks.push(function () {\n            runTask(key, task);\n        });\n    }\n\n    function processQueue() {\n        if (readyTasks.length === 0 && runningTasks === 0) {\n            return callback(null, results);\n        }\n        while(readyTasks.length && runningTasks < concurrency) {\n            var run = readyTasks.shift();\n            run();\n        }\n\n    }\n\n    function addListener(taskName, fn) {\n        var taskListeners = listeners[taskName];\n        if (!taskListeners) {\n            taskListeners = listeners[taskName] = [];\n        }\n\n        taskListeners.push(fn);\n    }\n\n    function taskComplete(taskName) {\n        var taskListeners = listeners[taskName] || [];\n        arrayEach(taskListeners, function (fn) {\n            fn();\n        });\n        processQueue();\n    }\n\n\n    function runTask(key, task) {\n        if (hasError) return;\n\n        var taskCallback = onlyOnce(function(err, result) {\n            runningTasks--;\n            if (arguments.length > 2) {\n                result = slice(arguments, 1);\n            }\n            if (err) {\n                var safeResults = {};\n                baseForOwn(results, function(val, rkey) {\n                    safeResults[rkey] = val;\n                });\n                safeResults[key] = result;\n                hasError = true;\n                listeners = Object.create(null);\n\n                callback(err, safeResults);\n            } else {\n                results[key] = result;\n                taskComplete(key);\n            }\n        });\n\n        runningTasks++;\n        var taskFn = wrapAsync(task[task.length - 1]);\n        if (task.length > 1) {\n            taskFn(results, taskCallback);\n        } else {\n            taskFn(taskCallback);\n        }\n    }\n\n    function checkForDeadlocks() {\n        // Kahn's algorithm\n        // https://en.wikipedia.org/wiki/Topological_sorting#Kahn.27s_algorithm\n        // http://connalle.blogspot.com/2013/10/topological-sortingkahn-algorithm.html\n        var currentTask;\n        var counter = 0;\n        while (readyToCheck.length) {\n            currentTask = readyToCheck.pop();\n            counter++;\n            arrayEach(getDependents(currentTask), function (dependent) {\n                if (--uncheckedDependencies[dependent] === 0) {\n                    readyToCheck.push(dependent);\n                }\n            });\n        }\n\n        if (counter !== numTasks) {\n            throw new Error(\n                'async.auto cannot execute tasks due to a recursive dependency'\n            );\n        }\n    }\n\n    function getDependents(taskName) {\n        var result = [];\n        baseForOwn(tasks, function (task, key) {\n            if (isArray(task) && baseIndexOf(task, taskName, 0) >= 0) {\n                result.push(key);\n            }\n        });\n        return result;\n    }\n};\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol$1 ? Symbol$1.prototype : undefined;\nvar symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isArray(value)) {\n    // Recursively convert values (susceptible to call stack limits).\n    return arrayMap(value, baseToString) + '';\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n  var index = -1,\n      length = array.length;\n\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = end > length ? length : end;\n  if (end < 0) {\n    end += length;\n  }\n  length = start > end ? 0 : ((end - start) >>> 0);\n  start >>>= 0;\n\n  var result = Array(length);\n  while (++index < length) {\n    result[index] = array[index + start];\n  }\n  return result;\n}\n\n/**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\nfunction castSlice(array, start, end) {\n  var length = array.length;\n  end = end === undefined ? length : end;\n  return (!start && end >= length) ? array : baseSlice(array, start, end);\n}\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\nfunction charsEndIndex(strSymbols, chrSymbols) {\n  var index = strSymbols.length;\n\n  while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n  return index;\n}\n\n/**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\nfunction charsStartIndex(strSymbols, chrSymbols) {\n  var index = -1,\n      length = strSymbols.length;\n\n  while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n  return index;\n}\n\n/**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction asciiToArray(string) {\n  return string.split('');\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\nvar rsVarRange = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsZWJ = '\\\\u200d';\n\n/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\nvar reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange  + rsComboRange + rsVarRange + ']');\n\n/**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\nfunction hasUnicode(string) {\n  return reHasUnicode.test(string);\n}\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange$1 = '\\\\ud800-\\\\udfff';\nvar rsComboMarksRange$1 = '\\\\u0300-\\\\u036f';\nvar reComboHalfMarksRange$1 = '\\\\ufe20-\\\\ufe2f';\nvar rsComboSymbolsRange$1 = '\\\\u20d0-\\\\u20ff';\nvar rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;\nvar rsVarRange$1 = '\\\\ufe0e\\\\ufe0f';\n\n/** Used to compose unicode capture groups. */\nvar rsAstral = '[' + rsAstralRange$1 + ']';\nvar rsCombo = '[' + rsComboRange$1 + ']';\nvar rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]';\nvar rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';\nvar rsNonAstral = '[^' + rsAstralRange$1 + ']';\nvar rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}';\nvar rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]';\nvar rsZWJ$1 = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar reOptMod = rsModifier + '?';\nvar rsOptVar = '[' + rsVarRange$1 + ']?';\nvar rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*';\nvar rsSeq = rsOptVar + reOptMod + rsOptJoin;\nvar rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\nvar reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n/**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction unicodeToArray(string) {\n  return string.match(reUnicode) || [];\n}\n\n/**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\nfunction stringToArray(string) {\n  return hasUnicode(string)\n    ? unicodeToArray(string)\n    : asciiToArray(string);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/**\n * Removes leading and trailing whitespace or specified characters from `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to trim.\n * @param {string} [chars=whitespace] The characters to trim.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the trimmed string.\n * @example\n *\n * _.trim('  abc  ');\n * // => 'abc'\n *\n * _.trim('-_-abc-_-', '_-');\n * // => 'abc'\n *\n * _.map(['  foo  ', '  bar  '], _.trim);\n * // => ['foo', 'bar']\n */\nfunction trim(string, chars, guard) {\n  string = toString(string);\n  if (string && (guard || chars === undefined)) {\n    return string.replace(reTrim, '');\n  }\n  if (!string || !(chars = baseToString(chars))) {\n    return string;\n  }\n  var strSymbols = stringToArray(string),\n      chrSymbols = stringToArray(chars),\n      start = charsStartIndex(strSymbols, chrSymbols),\n      end = charsEndIndex(strSymbols, chrSymbols) + 1;\n\n  return castSlice(strSymbols, start, end).join('');\n}\n\nvar FN_ARGS = /^(?:async\\s+)?(function)?\\s*[^\\(]*\\(\\s*([^\\)]*)\\)/m;\nvar FN_ARG_SPLIT = /,/;\nvar FN_ARG = /(=.+)?(\\s*)$/;\nvar STRIP_COMMENTS = /((\\/\\/.*$)|(\\/\\*[\\s\\S]*?\\*\\/))/mg;\n\nfunction parseParams(func) {\n    func = func.toString().replace(STRIP_COMMENTS, '');\n    func = func.match(FN_ARGS)[2].replace(' ', '');\n    func = func ? func.split(FN_ARG_SPLIT) : [];\n    func = func.map(function (arg){\n        return trim(arg.replace(FN_ARG, ''));\n    });\n    return func;\n}\n\n/**\n * A dependency-injected version of the [async.auto]{@link module:ControlFlow.auto} function. Dependent\n * tasks are specified as parameters to the function, after the usual callback\n * parameter, with the parameter names matching the names of the tasks it\n * depends on. This can provide even more readable task graphs which can be\n * easier to maintain.\n *\n * If a final callback is specified, the task results are similarly injected,\n * specified as named parameters after the initial error parameter.\n *\n * The autoInject function is purely syntactic sugar and its semantics are\n * otherwise equivalent to [async.auto]{@link module:ControlFlow.auto}.\n *\n * @name autoInject\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.auto]{@link module:ControlFlow.auto}\n * @category Control Flow\n * @param {Object} tasks - An object, each of whose properties is an {@link AsyncFunction} of\n * the form 'func([dependencies...], callback). The object's key of a property\n * serves as the name of the task defined by that property, i.e. can be used\n * when specifying requirements for other tasks.\n * * The `callback` parameter is a `callback(err, result)` which must be called\n *   when finished, passing an `error` (which can be `null`) and the result of\n *   the function's execution. The remaining parameters name other tasks on\n *   which the task is dependent, and the results from those tasks are the\n *   arguments of those parameters.\n * @param {Function} [callback] - An optional callback which is called when all\n * the tasks have been completed. It receives the `err` argument if any `tasks`\n * pass an error to their callback, and a `results` object with any completed\n * task results, similar to `auto`.\n * @example\n *\n * //  The example from `auto` can be rewritten as follows:\n * async.autoInject({\n *     get_data: function(callback) {\n *         // async code to get some data\n *         callback(null, 'data', 'converted to array');\n *     },\n *     make_folder: function(callback) {\n *         // async code to create a directory to store a file in\n *         // this is run at the same time as getting the data\n *         callback(null, 'folder');\n *     },\n *     write_file: function(get_data, make_folder, callback) {\n *         // once there is some data and the directory exists,\n *         // write the data to a file in the directory\n *         callback(null, 'filename');\n *     },\n *     email_link: function(write_file, callback) {\n *         // once the file is written let's email a link to it...\n *         // write_file contains the filename returned by write_file.\n *         callback(null, {'file':write_file, 'email':'user@example.com'});\n *     }\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('email_link = ', results.email_link);\n * });\n *\n * // If you are using a JS minifier that mangles parameter names, `autoInject`\n * // will not work with plain functions, since the parameter names will be\n * // collapsed to a single letter identifier.  To work around this, you can\n * // explicitly specify the names of the parameters your task function needs\n * // in an array, similar to Angular.js dependency injection.\n *\n * // This still has an advantage over plain `auto`, since the results a task\n * // depends on are still spread into arguments.\n * async.autoInject({\n *     //...\n *     write_file: ['get_data', 'make_folder', function(get_data, make_folder, callback) {\n *         callback(null, 'filename');\n *     }],\n *     email_link: ['write_file', function(write_file, callback) {\n *         callback(null, {'file':write_file, 'email':'user@example.com'});\n *     }]\n *     //...\n * }, function(err, results) {\n *     console.log('err = ', err);\n *     console.log('email_link = ', results.email_link);\n * });\n */\nfunction autoInject(tasks, callback) {\n    var newTasks = {};\n\n    baseForOwn(tasks, function (taskFn, key) {\n        var params;\n        var fnIsAsync = isAsync(taskFn);\n        var hasNoDeps =\n            (!fnIsAsync && taskFn.length === 1) ||\n            (fnIsAsync && taskFn.length === 0);\n\n        if (isArray(taskFn)) {\n            params = taskFn.slice(0, -1);\n            taskFn = taskFn[taskFn.length - 1];\n\n            newTasks[key] = params.concat(params.length > 0 ? newTask : taskFn);\n        } else if (hasNoDeps) {\n            // no dependencies, use the function as-is\n            newTasks[key] = taskFn;\n        } else {\n            params = parseParams(taskFn);\n            if (taskFn.length === 0 && !fnIsAsync && params.length === 0) {\n                throw new Error(\"autoInject task functions require explicit parameters.\");\n            }\n\n            // remove callback param\n            if (!fnIsAsync) params.pop();\n\n            newTasks[key] = params.concat(newTask);\n        }\n\n        function newTask(results, taskCb) {\n            var newArgs = arrayMap(params, function (name) {\n                return results[name];\n            });\n            newArgs.push(taskCb);\n            wrapAsync(taskFn).apply(null, newArgs);\n        }\n    });\n\n    auto(newTasks, callback);\n}\n\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nfunction DLL() {\n    this.head = this.tail = null;\n    this.length = 0;\n}\n\nfunction setInitial(dll, node) {\n    dll.length = 1;\n    dll.head = dll.tail = node;\n}\n\nDLL.prototype.removeLink = function(node) {\n    if (node.prev) node.prev.next = node.next;\n    else this.head = node.next;\n    if (node.next) node.next.prev = node.prev;\n    else this.tail = node.prev;\n\n    node.prev = node.next = null;\n    this.length -= 1;\n    return node;\n};\n\nDLL.prototype.empty = function () {\n    while(this.head) this.shift();\n    return this;\n};\n\nDLL.prototype.insertAfter = function(node, newNode) {\n    newNode.prev = node;\n    newNode.next = node.next;\n    if (node.next) node.next.prev = newNode;\n    else this.tail = newNode;\n    node.next = newNode;\n    this.length += 1;\n};\n\nDLL.prototype.insertBefore = function(node, newNode) {\n    newNode.prev = node.prev;\n    newNode.next = node;\n    if (node.prev) node.prev.next = newNode;\n    else this.head = newNode;\n    node.prev = newNode;\n    this.length += 1;\n};\n\nDLL.prototype.unshift = function(node) {\n    if (this.head) this.insertBefore(this.head, node);\n    else setInitial(this, node);\n};\n\nDLL.prototype.push = function(node) {\n    if (this.tail) this.insertAfter(this.tail, node);\n    else setInitial(this, node);\n};\n\nDLL.prototype.shift = function() {\n    return this.head && this.removeLink(this.head);\n};\n\nDLL.prototype.pop = function() {\n    return this.tail && this.removeLink(this.tail);\n};\n\nDLL.prototype.toArray = function () {\n    var arr = Array(this.length);\n    var curr = this.head;\n    for(var idx = 0; idx < this.length; idx++) {\n        arr[idx] = curr.data;\n        curr = curr.next;\n    }\n    return arr;\n};\n\nDLL.prototype.remove = function (testFn) {\n    var curr = this.head;\n    while(!!curr) {\n        var next = curr.next;\n        if (testFn(curr)) {\n            this.removeLink(curr);\n        }\n        curr = next;\n    }\n    return this;\n};\n\nfunction queue(worker, concurrency, payload) {\n    if (concurrency == null) {\n        concurrency = 1;\n    }\n    else if(concurrency === 0) {\n        throw new Error('Concurrency must not be zero');\n    }\n\n    var _worker = wrapAsync(worker);\n    var numRunning = 0;\n    var workersList = [];\n\n    var processingScheduled = false;\n    function _insert(data, insertAtFront, callback) {\n        if (callback != null && typeof callback !== 'function') {\n            throw new Error('task callback must be a function');\n        }\n        q.started = true;\n        if (!isArray(data)) {\n            data = [data];\n        }\n        if (data.length === 0 && q.idle()) {\n            // call drain immediately if there are no tasks\n            return setImmediate$1(function() {\n                q.drain();\n            });\n        }\n\n        for (var i = 0, l = data.length; i < l; i++) {\n            var item = {\n                data: data[i],\n                callback: callback || noop\n            };\n\n            if (insertAtFront) {\n                q._tasks.unshift(item);\n            } else {\n                q._tasks.push(item);\n            }\n        }\n\n        if (!processingScheduled) {\n            processingScheduled = true;\n            setImmediate$1(function() {\n                processingScheduled = false;\n                q.process();\n            });\n        }\n    }\n\n    function _next(tasks) {\n        return function(err){\n            numRunning -= 1;\n\n            for (var i = 0, l = tasks.length; i < l; i++) {\n                var task = tasks[i];\n\n                var index = baseIndexOf(workersList, task, 0);\n                if (index === 0) {\n                    workersList.shift();\n                } else if (index > 0) {\n                    workersList.splice(index, 1);\n                }\n\n                task.callback.apply(task, arguments);\n\n                if (err != null) {\n                    q.error(err, task.data);\n                }\n            }\n\n            if (numRunning <= (q.concurrency - q.buffer) ) {\n                q.unsaturated();\n            }\n\n            if (q.idle()) {\n                q.drain();\n            }\n            q.process();\n        };\n    }\n\n    var isProcessing = false;\n    var q = {\n        _tasks: new DLL(),\n        concurrency: concurrency,\n        payload: payload,\n        saturated: noop,\n        unsaturated:noop,\n        buffer: concurrency / 4,\n        empty: noop,\n        drain: noop,\n        error: noop,\n        started: false,\n        paused: false,\n        push: function (data, callback) {\n            _insert(data, false, callback);\n        },\n        kill: function () {\n            q.drain = noop;\n            q._tasks.empty();\n        },\n        unshift: function (data, callback) {\n            _insert(data, true, callback);\n        },\n        remove: function (testFn) {\n            q._tasks.remove(testFn);\n        },\n        process: function () {\n            // Avoid trying to start too many processing operations. This can occur\n            // when callbacks resolve synchronously (#1267).\n            if (isProcessing) {\n                return;\n            }\n            isProcessing = true;\n            while(!q.paused && numRunning < q.concurrency && q._tasks.length){\n                var tasks = [], data = [];\n                var l = q._tasks.length;\n                if (q.payload) l = Math.min(l, q.payload);\n                for (var i = 0; i < l; i++) {\n                    var node = q._tasks.shift();\n                    tasks.push(node);\n                    workersList.push(node);\n                    data.push(node.data);\n                }\n\n                numRunning += 1;\n\n                if (q._tasks.length === 0) {\n                    q.empty();\n                }\n\n                if (numRunning === q.concurrency) {\n                    q.saturated();\n                }\n\n                var cb = onlyOnce(_next(tasks));\n                _worker(data, cb);\n            }\n            isProcessing = false;\n        },\n        length: function () {\n            return q._tasks.length;\n        },\n        running: function () {\n            return numRunning;\n        },\n        workersList: function () {\n            return workersList;\n        },\n        idle: function() {\n            return q._tasks.length + numRunning === 0;\n        },\n        pause: function () {\n            q.paused = true;\n        },\n        resume: function () {\n            if (q.paused === false) { return; }\n            q.paused = false;\n            setImmediate$1(q.process);\n        }\n    };\n    return q;\n}\n\n/**\n * A cargo of tasks for the worker function to complete. Cargo inherits all of\n * the same methods and event callbacks as [`queue`]{@link module:ControlFlow.queue}.\n * @typedef {Object} CargoObject\n * @memberOf module:ControlFlow\n * @property {Function} length - A function returning the number of items\n * waiting to be processed. Invoke like `cargo.length()`.\n * @property {number} payload - An `integer` for determining how many tasks\n * should be process per round. This property can be changed after a `cargo` is\n * created to alter the payload on-the-fly.\n * @property {Function} push - Adds `task` to the `queue`. The callback is\n * called once the `worker` has finished processing the task. Instead of a\n * single task, an array of `tasks` can be submitted. The respective callback is\n * used for every task in the list. Invoke like `cargo.push(task, [callback])`.\n * @property {Function} saturated - A callback that is called when the\n * `queue.length()` hits the concurrency and further tasks will be queued.\n * @property {Function} empty - A callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - A callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke like `cargo.idle()`.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke like `cargo.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke like `cargo.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. Invoke like `cargo.kill()`.\n */\n\n/**\n * Creates a `cargo` object with the specified payload. Tasks added to the\n * cargo will be processed altogether (up to the `payload` limit). If the\n * `worker` is in progress, the task is queued until it becomes available. Once\n * the `worker` has completed some tasks, each callback of those tasks is\n * called. Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966)\n * for how `cargo` and `queue` work.\n *\n * While [`queue`]{@link module:ControlFlow.queue} passes only one task to one of a group of workers\n * at a time, cargo passes an array of tasks to a single worker, repeating\n * when the worker is finished.\n *\n * @name cargo\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An asynchronous function for processing an array\n * of queued tasks. Invoked with `(tasks, callback)`.\n * @param {number} [payload=Infinity] - An optional `integer` for determining\n * how many tasks should be processed per round; if omitted, the default is\n * unlimited.\n * @returns {module:ControlFlow.CargoObject} A cargo object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the cargo and inner queue.\n * @example\n *\n * // create a cargo object with payload 2\n * var cargo = async.cargo(function(tasks, callback) {\n *     for (var i=0; i<tasks.length; i++) {\n *         console.log('hello ' + tasks[i].name);\n *     }\n *     callback();\n * }, 2);\n *\n * // add some items\n * cargo.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * cargo.push({name: 'bar'}, function(err) {\n *     console.log('finished processing bar');\n * });\n * cargo.push({name: 'baz'}, function(err) {\n *     console.log('finished processing baz');\n * });\n */\nfunction cargo(worker, payload) {\n    return queue(worker, 1, payload);\n}\n\n/**\n * The same as [`eachOf`]{@link module:Collections.eachOf} but runs only a single async operation at a time.\n *\n * @name eachOfSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.eachOf]{@link module:Collections.eachOf}\n * @alias forEachOfSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * Invoked with (item, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Invoked with (err).\n */\nvar eachOfSeries = doLimit(eachOfLimit, 1);\n\n/**\n * Reduces `coll` into a single value using an async `iteratee` to return each\n * successive step. `memo` is the initial state of the reduction. This function\n * only operates in series.\n *\n * For performance reasons, it may make sense to split a call to this function\n * into a parallel map, and then use the normal `Array.prototype.reduce` on the\n * results. This function is for situations where each step in the reduction\n * needs to be async; if you can get the data before reducing it, then it's\n * probably a good idea to do so.\n *\n * @name reduce\n * @static\n * @memberOf module:Collections\n * @method\n * @alias inject\n * @alias foldl\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n * @example\n *\n * async.reduce([1,2,3], 0, function(memo, item, callback) {\n *     // pointless async:\n *     process.nextTick(function() {\n *         callback(null, memo + item)\n *     });\n * }, function(err, result) {\n *     // result is now equal to the last value of memo, which is 6\n * });\n */\nfunction reduce(coll, memo, iteratee, callback) {\n    callback = once(callback || noop);\n    var _iteratee = wrapAsync(iteratee);\n    eachOfSeries(coll, function(x, i, callback) {\n        _iteratee(memo, x, function(err, v) {\n            memo = v;\n            callback(err);\n        });\n    }, function(err) {\n        callback(err, memo);\n    });\n}\n\n/**\n * Version of the compose function that is more natural to read. Each function\n * consumes the return value of the previous function. It is the equivalent of\n * [compose]{@link module:ControlFlow.compose} with the arguments reversed.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name seq\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.compose]{@link module:ControlFlow.compose}\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} a function that composes the `functions` in order\n * @example\n *\n * // Requires lodash (or underscore), express3 and dresende's orm2.\n * // Part of an app, that fetches cats of the logged user.\n * // This example uses `seq` function to avoid overnesting and error\n * // handling clutter.\n * app.get('/cats', function(request, response) {\n *     var User = request.models.User;\n *     async.seq(\n *         _.bind(User.get, User),  // 'User.get' has signature (id, callback(err, data))\n *         function(user, fn) {\n *             user.getCats(fn);      // 'getCats' has signature (callback(err, data))\n *         }\n *     )(req.session.user_id, function (err, cats) {\n *         if (err) {\n *             console.error(err);\n *             response.json({ status: 'error', message: err.message });\n *         } else {\n *             response.json({ status: 'ok', message: 'Cats found', data: cats });\n *         }\n *     });\n * });\n */\nfunction seq(/*...functions*/) {\n    var _functions = arrayMap(arguments, wrapAsync);\n    return function(/*...args*/) {\n        var args = slice(arguments);\n        var that = this;\n\n        var cb = args[args.length - 1];\n        if (typeof cb == 'function') {\n            args.pop();\n        } else {\n            cb = noop;\n        }\n\n        reduce(_functions, args, function(newargs, fn, cb) {\n            fn.apply(that, newargs.concat(function(err/*, ...nextargs*/) {\n                var nextargs = slice(arguments, 1);\n                cb(err, nextargs);\n            }));\n        },\n        function(err, results) {\n            cb.apply(that, [err].concat(results));\n        });\n    };\n}\n\n/**\n * Creates a function which is a composition of the passed asynchronous\n * functions. Each function consumes the return value of the function that\n * follows. Composing functions `f()`, `g()`, and `h()` would produce the result\n * of `f(g(h()))`, only this version uses callbacks to obtain the return values.\n *\n * Each function is executed with the `this` binding of the composed function.\n *\n * @name compose\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {...AsyncFunction} functions - the asynchronous functions to compose\n * @returns {Function} an asynchronous function that is the composed\n * asynchronous `functions`\n * @example\n *\n * function add1(n, callback) {\n *     setTimeout(function () {\n *         callback(null, n + 1);\n *     }, 10);\n * }\n *\n * function mul3(n, callback) {\n *     setTimeout(function () {\n *         callback(null, n * 3);\n *     }, 10);\n * }\n *\n * var add1mul3 = async.compose(mul3, add1);\n * add1mul3(4, function (err, result) {\n *     // result now equals 15\n * });\n */\nvar compose = function(/*...args*/) {\n    return seq.apply(null, slice(arguments).reverse());\n};\n\nvar _concat = Array.prototype.concat;\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs a maximum of `limit` async operations at a time.\n *\n * @name concatLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n */\nvar concatLimit = function(coll, limit, iteratee, callback) {\n    callback = callback || noop;\n    var _iteratee = wrapAsync(iteratee);\n    mapLimit(coll, limit, function(val, callback) {\n        _iteratee(val, function(err /*, ...args*/) {\n            if (err) return callback(err);\n            return callback(null, slice(arguments, 1));\n        });\n    }, function(err, mapResults) {\n        var result = [];\n        for (var i = 0; i < mapResults.length; i++) {\n            if (mapResults[i]) {\n                result = _concat.apply(result, mapResults[i]);\n            }\n        }\n\n        return callback(err, result);\n    });\n};\n\n/**\n * Applies `iteratee` to each item in `coll`, concatenating the results. Returns\n * the concatenated list. The `iteratee`s are called in parallel, and the\n * results are concatenated as they return. There is no guarantee that the\n * results array will be returned in the original order of `coll` passed to the\n * `iteratee` function.\n *\n * @name concat\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`,\n * which should use an array as its result. Invoked with (item, callback).\n * @param {Function} [callback(err)] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n * @example\n *\n * async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files) {\n *     // files is now a list of filenames that exist in the 3 directories\n * });\n */\nvar concat = doLimit(concatLimit, Infinity);\n\n/**\n * The same as [`concat`]{@link module:Collections.concat} but runs only a single async operation at a time.\n *\n * @name concatSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.concat]{@link module:Collections.concat}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each item in `coll`.\n * The iteratee should complete with an array an array of results.\n * Invoked with (item, callback).\n * @param {Function} [callback(err)] - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is an array\n * containing the concatenated results of the `iteratee` function. Invoked with\n * (err, results).\n */\nvar concatSeries = doLimit(concatLimit, 1);\n\n/**\n * Returns a function that when called, calls-back with the values provided.\n * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to\n * [`auto`]{@link module:ControlFlow.auto}.\n *\n * @name constant\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {...*} arguments... - Any number of arguments to automatically invoke\n * callback with.\n * @returns {AsyncFunction} Returns a function that when invoked, automatically\n * invokes the callback with the previous given arguments.\n * @example\n *\n * async.waterfall([\n *     async.constant(42),\n *     function (value, next) {\n *         // value === 42\n *     },\n *     //...\n * ], callback);\n *\n * async.waterfall([\n *     async.constant(filename, \"utf8\"),\n *     fs.readFile,\n *     function (fileData, next) {\n *         //...\n *     }\n *     //...\n * ], callback);\n *\n * async.auto({\n *     hostname: async.constant(\"https://server.net/\"),\n *     port: findFreePort,\n *     launchServer: [\"hostname\", \"port\", function (options, cb) {\n *         startServer(options, cb);\n *     }],\n *     //...\n * }, callback);\n */\nvar constant = function(/*...values*/) {\n    var values = slice(arguments);\n    var args = [null].concat(values);\n    return function (/*...ignoredArgs, callback*/) {\n        var callback = arguments[arguments.length - 1];\n        return callback.apply(this, args);\n    };\n};\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\nfunction _createTester(check, getResult) {\n    return function(eachfn, arr, iteratee, cb) {\n        cb = cb || noop;\n        var testPassed = false;\n        var testResult;\n        eachfn(arr, function(value, _, callback) {\n            iteratee(value, function(err, result) {\n                if (err) {\n                    callback(err);\n                } else if (check(result) && !testResult) {\n                    testPassed = true;\n                    testResult = getResult(true, value);\n                    callback(null, breakLoop);\n                } else {\n                    callback();\n                }\n            });\n        }, function(err) {\n            if (err) {\n                cb(err);\n            } else {\n                cb(null, testPassed ? testResult : getResult(false));\n            }\n        });\n    };\n}\n\nfunction _findGetResult(v, x) {\n    return x;\n}\n\n/**\n * Returns the first value in `coll` that passes an async truth test. The\n * `iteratee` is applied in parallel, meaning the first iteratee to return\n * `true` will fire the detect `callback` with that result. That means the\n * result might not be the first item in the original `coll` (in terms of order)\n * that passes the test.\n\n * If order within the original `coll` is important, then look at\n * [`detectSeries`]{@link module:Collections.detectSeries}.\n *\n * @name detect\n * @static\n * @memberOf module:Collections\n * @method\n * @alias find\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n * @example\n *\n * async.detect(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // result now equals the first file in the list that exists\n * });\n */\nvar detect = doParallel(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name detectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findLimit\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectLimit = doParallelLimit(_createTester(identity, _findGetResult));\n\n/**\n * The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.\n *\n * @name detectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.detect]{@link module:Collections.detect}\n * @alias findSeries\n * @category Collections\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A truth test to apply to each item in `coll`.\n * The iteratee must complete with a boolean value as its result.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the `iteratee` functions have finished.\n * Result will be the first item in the array that passes the truth test\n * (iteratee) or the value `undefined` if none passed. Invoked with\n * (err, result).\n */\nvar detectSeries = doLimit(detectLimit, 1);\n\nfunction consoleFunc(name) {\n    return function (fn/*, ...args*/) {\n        var args = slice(arguments, 1);\n        args.push(function (err/*, ...args*/) {\n            var args = slice(arguments, 1);\n            if (typeof console === 'object') {\n                if (err) {\n                    if (console.error) {\n                        console.error(err);\n                    }\n                } else if (console[name]) {\n                    arrayEach(args, function (x) {\n                        console[name](x);\n                    });\n                }\n            }\n        });\n        wrapAsync(fn).apply(null, args);\n    };\n}\n\n/**\n * Logs the result of an [`async` function]{@link AsyncFunction} to the\n * `console` using `console.dir` to display the properties of the resulting object.\n * Only works in Node.js or in browsers that support `console.dir` and\n * `console.error` (such as FF and Chrome).\n * If multiple arguments are returned from the async function,\n * `console.dir` is called on each argument in order.\n *\n * @name dir\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n *     setTimeout(function() {\n *         callback(null, {hello: name});\n *     }, 1000);\n * };\n *\n * // in the node repl\n * node> async.dir(hello, 'world');\n * {hello: 'world'}\n */\nvar dir = consoleFunc('dir');\n\n/**\n * The post-check version of [`during`]{@link module:ControlFlow.during}. To reflect the difference in\n * the order of operations, the arguments `test` and `fn` are switched.\n *\n * Also a version of [`doWhilst`]{@link module:ControlFlow.doWhilst} with asynchronous `test` function.\n * @name doDuring\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.during]{@link module:ControlFlow.during}\n * @category Control Flow\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (...args, callback), where `...args` are the\n * non-error args from the previous callback of `fn`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error if one occurred, otherwise `null`.\n */\nfunction doDuring(fn, test, callback) {\n    callback = onlyOnce(callback || noop);\n    var _fn = wrapAsync(fn);\n    var _test = wrapAsync(test);\n\n    function next(err/*, ...args*/) {\n        if (err) return callback(err);\n        var args = slice(arguments, 1);\n        args.push(check);\n        _test.apply(this, args);\n    }\n\n    function check(err, truth) {\n        if (err) return callback(err);\n        if (!truth) return callback(null);\n        _fn(next);\n    }\n\n    check(null, true);\n\n}\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n */\nfunction doWhilst(iteratee, test, callback) {\n    callback = onlyOnce(callback || noop);\n    var _iteratee = wrapAsync(iteratee);\n    var next = function(err/*, ...args*/) {\n        if (err) return callback(err);\n        var args = slice(arguments, 1);\n        if (test.apply(this, args)) return _iteratee(next);\n        callback.apply(null, [null].concat(args));\n    };\n    _iteratee(next);\n}\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction doUntil(iteratee, test, callback) {\n    doWhilst(iteratee, function() {\n        return !test.apply(this, arguments);\n    }, callback);\n}\n\n/**\n * Like [`whilst`]{@link module:ControlFlow.whilst}, except the `test` is an asynchronous function that\n * is passed a callback in the form of `function (err, truth)`. If error is\n * passed to `test` or `fn`, the main callback is immediately called with the\n * value of the error.\n *\n * @name during\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} test - asynchronous truth test to perform before each\n * execution of `fn`. Invoked with (callback).\n * @param {AsyncFunction} fn - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `fn` has stopped. `callback`\n * will be passed an error, if one occurred, otherwise `null`.\n * @example\n *\n * var count = 0;\n *\n * async.during(\n *     function (callback) {\n *         return callback(null, count < 5);\n *     },\n *     function (callback) {\n *         count++;\n *         setTimeout(callback, 1000);\n *     },\n *     function (err) {\n *         // 5 seconds have passed\n *     }\n * );\n */\nfunction during(test, fn, callback) {\n    callback = onlyOnce(callback || noop);\n    var _fn = wrapAsync(fn);\n    var _test = wrapAsync(test);\n\n    function next(err) {\n        if (err) return callback(err);\n        _test(check);\n    }\n\n    function check(err, truth) {\n        if (err) return callback(err);\n        if (!truth) return callback(null);\n        _fn(next);\n    }\n\n    _test(check);\n}\n\nfunction _withoutIndex(iteratee) {\n    return function (value, index, callback) {\n        return iteratee(value, callback);\n    };\n}\n\n/**\n * Applies the function `iteratee` to each item in `coll`, in parallel.\n * The `iteratee` is called with an item from the list, and a callback for when\n * it has finished. If the `iteratee` passes an error to its `callback`, the\n * main `callback` (for the `each` function) is immediately called with the\n * error.\n *\n * Note, that since this function applies `iteratee` to each item in parallel,\n * there is no guarantee that the iteratee functions will complete in order.\n *\n * @name each\n * @static\n * @memberOf module:Collections\n * @method\n * @alias forEach\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to\n * each item in `coll`. Invoked with (item, callback).\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOf`.\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n * @example\n *\n * // assuming openFiles is an array of file names and saveFile is a function\n * // to save the modified contents of that file:\n *\n * async.each(openFiles, saveFile, function(err){\n *   // if any of the saves produced an error, err would equal that error\n * });\n *\n * // assuming openFiles is an array of file names\n * async.each(openFiles, function(file, callback) {\n *\n *     // Perform operation on file here.\n *     console.log('Processing file ' + file);\n *\n *     if( file.length > 32 ) {\n *       console.log('This file name is too long');\n *       callback('File name too long');\n *     } else {\n *       // Do work to process file here\n *       console.log('File processed');\n *       callback();\n *     }\n * }, function(err) {\n *     // if any of the file processing produced an error, err would equal that error\n *     if( err ) {\n *       // One of the iterations produced an error.\n *       // All processing will now stop.\n *       console.log('A file failed to process');\n *     } else {\n *       console.log('All files have been processed successfully');\n *     }\n * });\n */\nfunction eachLimit(coll, iteratee, callback) {\n    eachOf(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachLimit$1(coll, limit, iteratee, callback) {\n    _eachOfLimit(limit)(coll, _withoutIndex(wrapAsync(iteratee)), callback);\n}\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.\n *\n * @name eachSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each\n * item in `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfSeries`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nvar eachSeries = doLimit(eachLimit$1, 1);\n\n/**\n * Wrap an async function and ensure it calls its callback on a later tick of\n * the event loop.  If the function already calls its callback on a next tick,\n * no extra deferral is added. This is useful for preventing stack overflows\n * (`RangeError: Maximum call stack size exceeded`) and generally keeping\n * [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)\n * contained. ES2017 `async` functions are returned as-is -- they are immune\n * to Zalgo's corrupting influences, as they always resolve on a later tick.\n *\n * @name ensureAsync\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - an async function, one that expects a node-style\n * callback as its last argument.\n * @returns {AsyncFunction} Returns a wrapped function with the exact same call\n * signature as the function passed in.\n * @example\n *\n * function sometimesAsync(arg, callback) {\n *     if (cache[arg]) {\n *         return callback(null, cache[arg]); // this would be synchronous!!\n *     } else {\n *         doSomeIO(arg, callback); // this IO would be asynchronous\n *     }\n * }\n *\n * // this has a risk of stack overflows if many results are cached in a row\n * async.mapSeries(args, sometimesAsync, done);\n *\n * // this will defer sometimesAsync's callback if necessary,\n * // preventing stack overflows\n * async.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n */\nfunction ensureAsync(fn) {\n    if (isAsync(fn)) return fn;\n    return initialParams(function (args, callback) {\n        var sync = true;\n        args.push(function () {\n            var innerArgs = arguments;\n            if (sync) {\n                setImmediate$1(function () {\n                    callback.apply(null, innerArgs);\n                });\n            } else {\n                callback.apply(null, innerArgs);\n            }\n        });\n        fn.apply(this, args);\n        sync = false;\n    });\n}\n\nfunction notId(v) {\n    return !v;\n}\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @example\n *\n * async.every(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then every file exists\n * });\n */\nvar every = doParallel(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.\n *\n * @name everyLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everyLimit = doParallelLimit(_createTester(notId, notId));\n\n/**\n * The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.\n *\n * @name everySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.every]{@link module:Collections.every}\n * @alias allSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in series.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n */\nvar everySeries = doLimit(everyLimit, 1);\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n    var truthValues = new Array(arr.length);\n    eachfn(arr, function (x, index, callback) {\n        iteratee(x, function (err, v) {\n            truthValues[index] = !!v;\n            callback(err);\n        });\n    }, function (err) {\n        if (err) return callback(err);\n        var results = [];\n        for (var i = 0; i < arr.length; i++) {\n            if (truthValues[i]) results.push(arr[i]);\n        }\n        callback(null, results);\n    });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n    var results = [];\n    eachfn(coll, function (x, index, callback) {\n        iteratee(x, function (err, v) {\n            if (err) {\n                callback(err);\n            } else {\n                if (v) {\n                    results.push({index: index, value: x});\n                }\n                callback();\n            }\n        });\n    }, function (err) {\n        if (err) {\n            callback(err);\n        } else {\n            callback(null, arrayMap(results.sort(function (a, b) {\n                return a.index - b.index;\n            }), baseProperty('value')));\n        }\n    });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n    var filter = isArrayLike(coll) ? filterArray : filterGeneric;\n    filter(eachfn, coll, wrapAsync(iteratee), callback || noop);\n}\n\n/**\n * Returns a new array of all the values in `coll` which pass an async truth\n * test. This operation is performed in parallel, but the results array will be\n * in the same order as the original.\n *\n * @name filter\n * @static\n * @memberOf module:Collections\n * @method\n * @alias select\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.filter(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, results) {\n *     // results now equals an array of the existing files\n * });\n */\nvar filter = doParallel(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name filterLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar filterLimit = doParallelLimit(_filter);\n\n/**\n * The same as [`filter`]{@link module:Collections.filter} but runs only a single async operation at a time.\n *\n * @name filterSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @alias selectSeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - A truth test to apply to each item in `coll`.\n * The `iteratee` is passed a `callback(err, truthValue)`, which must be called\n * with a boolean argument once it has completed. Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results)\n */\nvar filterSeries = doLimit(filterLimit, 1);\n\n/**\n * Calls the asynchronous function `fn` with a callback parameter that allows it\n * to call itself again, in series, indefinitely.\n\n * If an error is passed to the callback then `errback` is called with the\n * error, and execution stops, otherwise it will never be called.\n *\n * @name forever\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} fn - an async function to call repeatedly.\n * Invoked with (next).\n * @param {Function} [errback] - when `fn` passes an error to it's callback,\n * this function will be called, and execution stops. Invoked with (err).\n * @example\n *\n * async.forever(\n *     function(next) {\n *         // next is suitable for passing to things that need a callback(err [, whatever]);\n *         // it will result in this function being called again.\n *     },\n *     function(err) {\n *         // if next is called with a value in its first parameter, it will appear\n *         // in here as 'err', and execution will stop.\n *     }\n * );\n */\nfunction forever(fn, errback) {\n    var done = onlyOnce(errback || noop);\n    var task = wrapAsync(ensureAsync(fn));\n\n    function next(err) {\n        if (err) return done(err);\n        task(next);\n    }\n    next();\n}\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs a maximum of `limit` async operations at a time.\n *\n * @name groupByLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupByLimit = function(coll, limit, iteratee, callback) {\n    callback = callback || noop;\n    var _iteratee = wrapAsync(iteratee);\n    mapLimit(coll, limit, function(val, callback) {\n        _iteratee(val, function(err, key) {\n            if (err) return callback(err);\n            return callback(null, {key: key, val: val});\n        });\n    }, function(err, mapResults) {\n        var result = {};\n        // from MDN, handle object having an `hasOwnProperty` prop\n        var hasOwnProperty = Object.prototype.hasOwnProperty;\n\n        for (var i = 0; i < mapResults.length; i++) {\n            if (mapResults[i]) {\n                var key = mapResults[i].key;\n                var val = mapResults[i].val;\n\n                if (hasOwnProperty.call(result, key)) {\n                    result[key].push(val);\n                } else {\n                    result[key] = [val];\n                }\n            }\n        }\n\n        return callback(err, result);\n    });\n};\n\n/**\n * Returns a new object, where each value corresponds to an array of items, from\n * `coll`, that returned the corresponding key. That is, the keys of the object\n * correspond to the values passed to the `iteratee` callback.\n *\n * Note: Since this function applies the `iteratee` to each item in parallel,\n * there is no guarantee that the `iteratee` functions will complete in order.\n * However, the values for each key in the `result` will be in the same order as\n * the original `coll`. For Objects, the values will roughly be in the order of\n * the original Objects' keys (but this can vary across JavaScript engines).\n *\n * @name groupBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n * @example\n *\n * async.groupBy(['userId1', 'userId2', 'userId3'], function(userId, callback) {\n *     db.findById(userId, function(err, user) {\n *         if (err) return callback(err);\n *         return callback(null, user.age);\n *     });\n * }, function(err, result) {\n *     // result is object containing the userIds grouped by age\n *     // e.g. { 30: ['userId1', 'userId3'], 42: ['userId2']};\n * });\n */\nvar groupBy = doLimit(groupByLimit, Infinity);\n\n/**\n * The same as [`groupBy`]{@link module:Collections.groupBy} but runs only a single async operation at a time.\n *\n * @name groupBySeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.groupBy]{@link module:Collections.groupBy}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a `key` to group the value under.\n * Invoked with (value, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. Result is an `Object` whoses\n * properties are arrays of values which returned the corresponding key.\n */\nvar groupBySeries = doLimit(groupByLimit, 1);\n\n/**\n * Logs the result of an `async` function to the `console`. Only works in\n * Node.js or in browsers that support `console.log` and `console.error` (such\n * as FF and Chrome). If multiple arguments are returned from the async\n * function, `console.log` is called on each argument in order.\n *\n * @name log\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} function - The function you want to eventually apply\n * all arguments to.\n * @param {...*} arguments... - Any number of arguments to apply to the function.\n * @example\n *\n * // in a module\n * var hello = function(name, callback) {\n *     setTimeout(function() {\n *         callback(null, 'hello ' + name);\n *     }, 1000);\n * };\n *\n * // in the node repl\n * node> async.log(hello, 'world');\n * 'hello world'\n */\nvar log = consoleFunc('log');\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name mapValuesLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nfunction mapValuesLimit(obj, limit, iteratee, callback) {\n    callback = once(callback || noop);\n    var newObj = {};\n    var _iteratee = wrapAsync(iteratee);\n    eachOfLimit(obj, limit, function(val, key, next) {\n        _iteratee(val, key, function (err, result) {\n            if (err) return next(err);\n            newObj[key] = result;\n            next();\n        });\n    }, function (err) {\n        callback(err, newObj);\n    });\n}\n\n/**\n * A relative of [`map`]{@link module:Collections.map}, designed for use with objects.\n *\n * Produces a new Object by mapping each value of `obj` through the `iteratee`\n * function. The `iteratee` is called each `value` and `key` from `obj` and a\n * callback for when it has finished processing. Each of these callbacks takes\n * two arguments: an `error`, and the transformed item from `obj`. If `iteratee`\n * passes an error to its callback, the main `callback` (for the `mapValues`\n * function) is immediately called with the error.\n *\n * Note, the order of the keys in the result is not guaranteed.  The keys will\n * be roughly in the order they complete, (but this is very engine-specific)\n *\n * @name mapValues\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n * @example\n *\n * async.mapValues({\n *     f1: 'file1',\n *     f2: 'file2',\n *     f3: 'file3'\n * }, function (file, key, callback) {\n *   fs.stat(file, callback);\n * }, function(err, result) {\n *     // result is now a map of stats for each file, e.g.\n *     // {\n *     //     f1: [stats for file1],\n *     //     f2: [stats for file2],\n *     //     f3: [stats for file3]\n *     // }\n * });\n */\n\nvar mapValues = doLimit(mapValuesLimit, Infinity);\n\n/**\n * The same as [`mapValues`]{@link module:Collections.mapValues} but runs only a single async operation at a time.\n *\n * @name mapValuesSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.mapValues]{@link module:Collections.mapValues}\n * @category Collection\n * @param {Object} obj - A collection to iterate over.\n * @param {AsyncFunction} iteratee - A function to apply to each value and key\n * in `coll`.\n * The iteratee should complete with the transformed value as its result.\n * Invoked with (value, key, callback).\n * @param {Function} [callback] - A callback which is called when all `iteratee`\n * functions have finished, or an error occurs. `result` is a new object consisting\n * of each key from `obj`, with each transformed value on the right-hand side.\n * Invoked with (err, result).\n */\nvar mapValuesSeries = doLimit(mapValuesLimit, 1);\n\nfunction has(obj, key) {\n    return key in obj;\n}\n\n/**\n * Caches the results of an async function. When creating a hash to store\n * function results against, the callback is omitted from the hash and an\n * optional hash function can be used.\n *\n * If no hash function is specified, the first argument is used as a hash key,\n * which may work reasonably if it is a string or a data type that converts to a\n * distinct string. Note that objects and arrays will not behave reasonably.\n * Neither will cases where the other arguments are significant. In such cases,\n * specify your own hash function.\n *\n * The cache of results is exposed as the `memo` property of the function\n * returned by `memoize`.\n *\n * @name memoize\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function to proxy and cache results from.\n * @param {Function} hasher - An optional function for generating a custom hash\n * for storing results. It has all the arguments applied to it apart from the\n * callback, and must be synchronous.\n * @returns {AsyncFunction} a memoized version of `fn`\n * @example\n *\n * var slow_fn = function(name, callback) {\n *     // do something\n *     callback(null, result);\n * };\n * var fn = async.memoize(slow_fn);\n *\n * // fn can now be used as if it were slow_fn\n * fn('some name', function() {\n *     // callback\n * });\n */\nfunction memoize(fn, hasher) {\n    var memo = Object.create(null);\n    var queues = Object.create(null);\n    hasher = hasher || identity;\n    var _fn = wrapAsync(fn);\n    var memoized = initialParams(function memoized(args, callback) {\n        var key = hasher.apply(null, args);\n        if (has(memo, key)) {\n            setImmediate$1(function() {\n                callback.apply(null, memo[key]);\n            });\n        } else if (has(queues, key)) {\n            queues[key].push(callback);\n        } else {\n            queues[key] = [callback];\n            _fn.apply(null, args.concat(function(/*args*/) {\n                var args = slice(arguments);\n                memo[key] = args;\n                var q = queues[key];\n                delete queues[key];\n                for (var i = 0, l = q.length; i < l; i++) {\n                    q[i].apply(null, args);\n                }\n            }));\n        }\n    });\n    memoized.memo = memo;\n    memoized.unmemoized = fn;\n    return memoized;\n}\n\n/**\n * Calls `callback` on a later loop around the event loop. In Node.js this just\n * calls `process.nextTicl`.  In the browser it will use `setImmediate` if\n * available, otherwise `setTimeout(callback, 0)`, which means other higher\n * priority events may precede the execution of `callback`.\n *\n * This is used internally for browser-compatibility purposes.\n *\n * @name nextTick\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.setImmediate]{@link module:Utils.setImmediate}\n * @category Util\n * @param {Function} callback - The function to call on a later loop around\n * the event loop. Invoked with (args...).\n * @param {...*} args... - any number of additional arguments to pass to the\n * callback on the next tick.\n * @example\n *\n * var call_order = [];\n * async.nextTick(function() {\n *     call_order.push('two');\n *     // call_order now equals ['one','two']\n * });\n * call_order.push('one');\n *\n * async.setImmediate(function (a, b, c) {\n *     // a, b, and c equal 1, 2, and 3\n * }, 1, 2, 3);\n */\nvar _defer$1;\n\nif (hasNextTick) {\n    _defer$1 = process.nextTick;\n} else if (hasSetImmediate) {\n    _defer$1 = setImmediate;\n} else {\n    _defer$1 = fallback;\n}\n\nvar nextTick = wrap(_defer$1);\n\nfunction _parallel(eachfn, tasks, callback) {\n    callback = callback || noop;\n    var results = isArrayLike(tasks) ? [] : {};\n\n    eachfn(tasks, function (task, key, callback) {\n        wrapAsync(task)(function (err, result) {\n            if (arguments.length > 2) {\n                result = slice(arguments, 1);\n            }\n            results[key] = result;\n            callback(err);\n        });\n    }, function (err) {\n        callback(err, results);\n    });\n}\n\n/**\n * Run the `tasks` collection of functions in parallel, without waiting until\n * the previous function has completed. If any of the functions pass an error to\n * its callback, the main `callback` is immediately called with the value of the\n * error. Once the `tasks` have completed, the results are passed to the final\n * `callback` as an array.\n *\n * **Note:** `parallel` is about kicking-off I/O tasks in parallel, not about\n * parallel execution of code.  If your tasks do not use any timers or perform\n * any I/O, they will actually be executed in series.  Any synchronous setup\n * sections for each task will happen one after the other.  JavaScript remains\n * single-threaded.\n *\n * **Hint:** Use [`reflect`]{@link module:Utils.reflect} to continue the\n * execution of other tasks when a task fails.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n * results from {@link async.parallel}.\n *\n * @name parallel\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n *\n * @example\n * async.parallel([\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // the results array will equal ['one','two'] even though\n *     // the second function had a shorter timeout.\n * });\n *\n * // an example using an object instead of an array\n * async.parallel({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equals to: {one: 1, two: 2}\n * });\n */\nfunction parallelLimit(tasks, callback) {\n    _parallel(eachOf, tasks, callback);\n}\n\n/**\n * The same as [`parallel`]{@link module:ControlFlow.parallel} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name parallelLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.parallel]{@link module:ControlFlow.parallel}\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection of\n * [async functions]{@link AsyncFunction} to run.\n * Each async function can complete with any number of optional `result` values.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed successfully. This function gets a results array\n * (or object) containing all the result arguments passed to the task callbacks.\n * Invoked with (err, results).\n */\nfunction parallelLimit$1(tasks, limit, callback) {\n    _parallel(_eachOfLimit(limit), tasks, callback);\n}\n\n/**\n * A queue of tasks for the worker function to complete.\n * @typedef {Object} QueueObject\n * @memberOf module:ControlFlow\n * @property {Function} length - a function returning the number of items\n * waiting to be processed. Invoke with `queue.length()`.\n * @property {boolean} started - a boolean indicating whether or not any\n * items have been pushed and processed by the queue.\n * @property {Function} running - a function returning the number of items\n * currently being processed. Invoke with `queue.running()`.\n * @property {Function} workersList - a function returning the array of items\n * currently being processed. Invoke with `queue.workersList()`.\n * @property {Function} idle - a function returning false if there are items\n * waiting or being processed, or true if not. Invoke with `queue.idle()`.\n * @property {number} concurrency - an integer for determining how many `worker`\n * functions should be run in parallel. This property can be changed after a\n * `queue` is created to alter the concurrency on-the-fly.\n * @property {Function} push - add a new task to the `queue`. Calls `callback`\n * once the `worker` has finished processing the task. Instead of a single task,\n * a `tasks` array can be submitted. The respective callback is used for every\n * task in the list. Invoke with `queue.push(task, [callback])`,\n * @property {Function} unshift - add a new task to the front of the `queue`.\n * Invoke with `queue.unshift(task, [callback])`.\n * @property {Function} remove - remove items from the queue that match a test\n * function.  The test function will be passed an object with a `data` property,\n * and a `priority` property, if this is a\n * [priorityQueue]{@link module:ControlFlow.priorityQueue} object.\n * Invoked with `queue.remove(testFn)`, where `testFn` is of the form\n * `function ({data, priority}) {}` and returns a Boolean.\n * @property {Function} saturated - a callback that is called when the number of\n * running workers hits the `concurrency` limit, and further tasks will be\n * queued.\n * @property {Function} unsaturated - a callback that is called when the number\n * of running workers is less than the `concurrency` & `buffer` limits, and\n * further tasks will not be queued.\n * @property {number} buffer - A minimum threshold buffer in order to say that\n * the `queue` is `unsaturated`.\n * @property {Function} empty - a callback that is called when the last item\n * from the `queue` is given to a `worker`.\n * @property {Function} drain - a callback that is called when the last item\n * from the `queue` has returned from the `worker`.\n * @property {Function} error - a callback that is called when a task errors.\n * Has the signature `function(error, task)`.\n * @property {boolean} paused - a boolean for determining whether the queue is\n * in a paused state.\n * @property {Function} pause - a function that pauses the processing of tasks\n * until `resume()` is called. Invoke with `queue.pause()`.\n * @property {Function} resume - a function that resumes the processing of\n * queued tasks when the queue is paused. Invoke with `queue.resume()`.\n * @property {Function} kill - a function that removes the `drain` callback and\n * empties remaining tasks from the queue forcing it to go idle. No more tasks\n * should be pushed to the queue after calling this function. Invoke with `queue.kill()`.\n */\n\n/**\n * Creates a `queue` object with the specified `concurrency`. Tasks added to the\n * `queue` are processed in parallel (up to the `concurrency` limit). If all\n * `worker`s are in progress, the task is queued until one becomes available.\n * Once a `worker` completes a `task`, that `task`'s callback is called.\n *\n * @name queue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`. Invoked with (task, callback).\n * @param {number} [concurrency=1] - An `integer` for determining how many\n * `worker` functions should be run in parallel.  If omitted, the concurrency\n * defaults to `1`.  If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A queue object to manage the tasks. Callbacks can\n * attached as certain properties to listen for specific events during the\n * lifecycle of the queue.\n * @example\n *\n * // create a queue object with concurrency 2\n * var q = async.queue(function(task, callback) {\n *     console.log('hello ' + task.name);\n *     callback();\n * }, 2);\n *\n * // assign a callback\n * q.drain = function() {\n *     console.log('all items have been processed');\n * };\n *\n * // add some items to the queue\n * q.push({name: 'foo'}, function(err) {\n *     console.log('finished processing foo');\n * });\n * q.push({name: 'bar'}, function (err) {\n *     console.log('finished processing bar');\n * });\n *\n * // add some items to the queue (batch-wise)\n * q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function(err) {\n *     console.log('finished processing item');\n * });\n *\n * // add some items to the front of the queue\n * q.unshift({name: 'bar'}, function (err) {\n *     console.log('finished processing bar');\n * });\n */\nvar queue$1 = function (worker, concurrency) {\n    var _worker = wrapAsync(worker);\n    return queue(function (items, cb) {\n        _worker(items[0], cb);\n    }, concurrency, 1);\n};\n\n/**\n * The same as [async.queue]{@link module:ControlFlow.queue} only tasks are assigned a priority and\n * completed in ascending priority order.\n *\n * @name priorityQueue\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.queue]{@link module:ControlFlow.queue}\n * @category Control Flow\n * @param {AsyncFunction} worker - An async function for processing a queued task.\n * If you want to handle errors from an individual task, pass a callback to\n * `q.push()`.\n * Invoked with (task, callback).\n * @param {number} concurrency - An `integer` for determining how many `worker`\n * functions should be run in parallel.  If omitted, the concurrency defaults to\n * `1`.  If the concurrency is `0`, an error is thrown.\n * @returns {module:ControlFlow.QueueObject} A priorityQueue object to manage the tasks. There are two\n * differences between `queue` and `priorityQueue` objects:\n * * `push(task, priority, [callback])` - `priority` should be a number. If an\n *   array of `tasks` is given, all tasks will be assigned the same priority.\n * * The `unshift` method was removed.\n */\nvar priorityQueue = function(worker, concurrency) {\n    // Start with a normal queue\n    var q = queue$1(worker, concurrency);\n\n    // Override push to accept second parameter representing priority\n    q.push = function(data, priority, callback) {\n        if (callback == null) callback = noop;\n        if (typeof callback !== 'function') {\n            throw new Error('task callback must be a function');\n        }\n        q.started = true;\n        if (!isArray(data)) {\n            data = [data];\n        }\n        if (data.length === 0) {\n            // call drain immediately if there are no tasks\n            return setImmediate$1(function() {\n                q.drain();\n            });\n        }\n\n        priority = priority || 0;\n        var nextNode = q._tasks.head;\n        while (nextNode && priority >= nextNode.priority) {\n            nextNode = nextNode.next;\n        }\n\n        for (var i = 0, l = data.length; i < l; i++) {\n            var item = {\n                data: data[i],\n                priority: priority,\n                callback: callback\n            };\n\n            if (nextNode) {\n                q._tasks.insertBefore(nextNode, item);\n            } else {\n                q._tasks.push(item);\n            }\n        }\n        setImmediate$1(q.process);\n    };\n\n    // Remove unshift function\n    delete q.unshift;\n\n    return q;\n};\n\n/**\n * Runs the `tasks` array of functions in parallel, without waiting until the\n * previous function has completed. Once any of the `tasks` complete or pass an\n * error to its callback, the main `callback` is immediately called. It's\n * equivalent to `Promise.race()`.\n *\n * @name race\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array containing [async functions]{@link AsyncFunction}\n * to run. Each function can complete with an optional `result` value.\n * @param {Function} callback - A callback to run once any of the functions have\n * completed. This function gets an error or result from the first function that\n * completed. Invoked with (err, result).\n * @returns undefined\n * @example\n *\n * async.race([\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ],\n * // main callback\n * function(err, result) {\n *     // the result will be equal to 'two' as it finishes earlier\n * });\n */\nfunction race(tasks, callback) {\n    callback = once(callback || noop);\n    if (!isArray(tasks)) return callback(new TypeError('First argument to race must be an array of functions'));\n    if (!tasks.length) return callback();\n    for (var i = 0, l = tasks.length; i < l; i++) {\n        wrapAsync(tasks[i])(callback);\n    }\n}\n\n/**\n * Same as [`reduce`]{@link module:Collections.reduce}, only operates on `array` in reverse order.\n *\n * @name reduceRight\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reduce]{@link module:Collections.reduce}\n * @alias foldr\n * @category Collection\n * @param {Array} array - A collection to iterate over.\n * @param {*} memo - The initial state of the reduction.\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * array to produce the next step in the reduction.\n * The `iteratee` should complete with the next state of the reduction.\n * If the iteratee complete with an error, the reduction is stopped and the\n * main `callback` is immediately called with the error.\n * Invoked with (memo, item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the reduced value. Invoked with\n * (err, result).\n */\nfunction reduceRight (array, memo, iteratee, callback) {\n    var reversed = slice(array).reverse();\n    reduce(reversed, memo, iteratee, callback);\n}\n\n/**\n * Wraps the async function in another function that always completes with a\n * result object, even when it errors.\n *\n * The result object has either the property `error` or `value`.\n *\n * @name reflect\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} fn - The async function you want to wrap\n * @returns {Function} - A function that always passes null to it's callback as\n * the error. The second argument to the callback will be an `object` with\n * either an `error` or a `value` property.\n * @example\n *\n * async.parallel([\n *     async.reflect(function(callback) {\n *         // do some stuff ...\n *         callback(null, 'one');\n *     }),\n *     async.reflect(function(callback) {\n *         // do some more stuff but error ...\n *         callback('bad stuff happened');\n *     }),\n *     async.reflect(function(callback) {\n *         // do some more stuff ...\n *         callback(null, 'two');\n *     })\n * ],\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results[0].value = 'one'\n *     // results[1].error = 'bad stuff happened'\n *     // results[2].value = 'two'\n * });\n */\nfunction reflect(fn) {\n    var _fn = wrapAsync(fn);\n    return initialParams(function reflectOn(args, reflectCallback) {\n        args.push(function callback(error, cbArg) {\n            if (error) {\n                reflectCallback(null, { error: error });\n            } else {\n                var value;\n                if (arguments.length <= 2) {\n                    value = cbArg;\n                } else {\n                    value = slice(arguments, 1);\n                }\n                reflectCallback(null, { value: value });\n            }\n        });\n\n        return _fn.apply(this, args);\n    });\n}\n\n/**\n * A helper function that wraps an array or an object of functions with `reflect`.\n *\n * @name reflectAll\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.reflect]{@link module:Utils.reflect}\n * @category Util\n * @param {Array|Object|Iterable} tasks - The collection of\n * [async functions]{@link AsyncFunction} to wrap in `async.reflect`.\n * @returns {Array} Returns an array of async functions, each wrapped in\n * `async.reflect`\n * @example\n *\n * let tasks = [\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     function(callback) {\n *         // do some more stuff but error ...\n *         callback(new Error('bad stuff happened'));\n *     },\n *     function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'two');\n *         }, 100);\n *     }\n * ];\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results[0].value = 'one'\n *     // results[1].error = Error('bad stuff happened')\n *     // results[2].value = 'two'\n * });\n *\n * // an example using an object instead of an array\n * let tasks = {\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'one');\n *         }, 200);\n *     },\n *     two: function(callback) {\n *         callback('two');\n *     },\n *     three: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 'three');\n *         }, 100);\n *     }\n * };\n *\n * async.parallel(async.reflectAll(tasks),\n * // optional callback\n * function(err, results) {\n *     // values\n *     // results.one.value = 'one'\n *     // results.two.error = 'two'\n *     // results.three.value = 'three'\n * });\n */\nfunction reflectAll(tasks) {\n    var results;\n    if (isArray(tasks)) {\n        results = arrayMap(tasks, reflect);\n    } else {\n        results = {};\n        baseForOwn(tasks, function(task, key) {\n            results[key] = reflect.call(this, task);\n        });\n    }\n    return results;\n}\n\nfunction reject$1(eachfn, arr, iteratee, callback) {\n    _filter(eachfn, arr, function(value, cb) {\n        iteratee(value, function(err, v) {\n            cb(err, !v);\n        });\n    }, callback);\n}\n\n/**\n * The opposite of [`filter`]{@link module:Collections.filter}. Removes values that pass an `async` truth test.\n *\n * @name reject\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.filter]{@link module:Collections.filter}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n * @example\n *\n * async.reject(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, results) {\n *     // results now equals an array of missing files\n *     createFiles(results);\n * });\n */\nvar reject = doParallel(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name rejectLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectLimit = doParallelLimit(reject$1);\n\n/**\n * The same as [`reject`]{@link module:Collections.reject} but runs only a single async operation at a time.\n *\n * @name rejectSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.reject]{@link module:Collections.reject}\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {Function} iteratee - An async truth test to apply to each item in\n * `coll`.\n * The should complete with a boolean value as its `result`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Invoked with (err, results).\n */\nvar rejectSeries = doLimit(rejectLimit, 1);\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant$1(value) {\n  return function() {\n    return value;\n  };\n}\n\n/**\n * Attempts to get a successful response from `task` no more than `times` times\n * before returning an error. If the task is successful, the `callback` will be\n * passed the result of the successful task. If all attempts fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name retry\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @see [async.retryable]{@link module:ControlFlow.retryable}\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - Can be either an\n * object with `times` and `interval` or a number.\n * * `times` - The number of attempts to make before giving up.  The default\n *   is `5`.\n * * `interval` - The time to wait between retries, in milliseconds.  The\n *   default is `0`. The interval may also be specified as a function of the\n *   retry count (see example).\n * * `errorFilter` - An optional synchronous function that is invoked on\n *   erroneous result. If it returns `true` the retry attempts will continue;\n *   if the function returns `false` the retry flow is aborted with the current\n *   attempt's error and result being returned to the final callback.\n *   Invoked with (err).\n * * If `opts` is a number, the number specifies the number of times to retry,\n *   with the default interval of `0`.\n * @param {AsyncFunction} task - An async function to retry.\n * Invoked with (callback).\n * @param {Function} [callback] - An optional callback which is called when the\n * task has succeeded, or after the final failed attempt. It receives the `err`\n * and `result` arguments of the last attempt at completing the `task`. Invoked\n * with (err, results).\n *\n * @example\n *\n * // The `retry` function can be used as a stand-alone control flow by passing\n * // a callback, as shown below:\n *\n * // try calling apiMethod 3 times\n * async.retry(3, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod 3 times, waiting 200 ms between each retry\n * async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod 10 times with exponential backoff\n * // (i.e. intervals of 100, 200, 400, 800, 1600, ... milliseconds)\n * async.retry({\n *   times: 10,\n *   interval: function(retryCount) {\n *     return 50 * Math.pow(2, retryCount);\n *   }\n * }, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod the default 5 times no delay between each retry\n * async.retry(apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // try calling apiMethod only when error condition satisfies, all other\n * // errors will abort the retry control flow and return to final callback\n * async.retry({\n *   errorFilter: function(err) {\n *     return err.message === 'Temporary error'; // only retry on a specific error\n *   }\n * }, apiMethod, function(err, result) {\n *     // do something with the result\n * });\n *\n * // to retry individual methods that are not as reliable within other\n * // control flow functions, use the `retryable` wrapper:\n * async.auto({\n *     users: api.getUsers.bind(api),\n *     payments: async.retryable(3, api.getPayments.bind(api))\n * }, function(err, results) {\n *     // do something with the results\n * });\n *\n */\nfunction retry(opts, task, callback) {\n    var DEFAULT_TIMES = 5;\n    var DEFAULT_INTERVAL = 0;\n\n    var options = {\n        times: DEFAULT_TIMES,\n        intervalFunc: constant$1(DEFAULT_INTERVAL)\n    };\n\n    function parseTimes(acc, t) {\n        if (typeof t === 'object') {\n            acc.times = +t.times || DEFAULT_TIMES;\n\n            acc.intervalFunc = typeof t.interval === 'function' ?\n                t.interval :\n                constant$1(+t.interval || DEFAULT_INTERVAL);\n\n            acc.errorFilter = t.errorFilter;\n        } else if (typeof t === 'number' || typeof t === 'string') {\n            acc.times = +t || DEFAULT_TIMES;\n        } else {\n            throw new Error(\"Invalid arguments for async.retry\");\n        }\n    }\n\n    if (arguments.length < 3 && typeof opts === 'function') {\n        callback = task || noop;\n        task = opts;\n    } else {\n        parseTimes(options, opts);\n        callback = callback || noop;\n    }\n\n    if (typeof task !== 'function') {\n        throw new Error(\"Invalid arguments for async.retry\");\n    }\n\n    var _task = wrapAsync(task);\n\n    var attempt = 1;\n    function retryAttempt() {\n        _task(function(err) {\n            if (err && attempt++ < options.times &&\n                (typeof options.errorFilter != 'function' ||\n                    options.errorFilter(err))) {\n                setTimeout(retryAttempt, options.intervalFunc(attempt));\n            } else {\n                callback.apply(null, arguments);\n            }\n        });\n    }\n\n    retryAttempt();\n}\n\n/**\n * A close relative of [`retry`]{@link module:ControlFlow.retry}.  This method\n * wraps a task and makes it retryable, rather than immediately calling it\n * with retries.\n *\n * @name retryable\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.retry]{@link module:ControlFlow.retry}\n * @category Control Flow\n * @param {Object|number} [opts = {times: 5, interval: 0}| 5] - optional\n * options, exactly the same as from `retry`\n * @param {AsyncFunction} task - the asynchronous function to wrap.\n * This function will be passed any arguments passed to the returned wrapper.\n * Invoked with (...args, callback).\n * @returns {AsyncFunction} The wrapped function, which when invoked, will\n * retry on an error, based on the parameters specified in `opts`.\n * This function will accept the same parameters as `task`.\n * @example\n *\n * async.auto({\n *     dep1: async.retryable(3, getFromFlakyService),\n *     process: [\"dep1\", async.retryable(3, function (results, cb) {\n *         maybeProcessData(results.dep1, cb);\n *     })]\n * }, callback);\n */\nvar retryable = function (opts, task) {\n    if (!task) {\n        task = opts;\n        opts = null;\n    }\n    var _task = wrapAsync(task);\n    return initialParams(function (args, callback) {\n        function taskFn(cb) {\n            _task.apply(null, args.concat(cb));\n        }\n\n        if (opts) retry(opts, taskFn, callback);\n        else retry(taskFn, callback);\n\n    });\n};\n\n/**\n * Run the functions in the `tasks` collection in series, each one running once\n * the previous function has completed. If any functions in the series pass an\n * error to its callback, no more functions are run, and `callback` is\n * immediately called with the value of the error. Otherwise, `callback`\n * receives an array of results when `tasks` have completed.\n *\n * It is also possible to use an object instead of an array. Each property will\n * be run as a function, and the results will be passed to the final `callback`\n * as an object instead of an array. This can be a more readable way of handling\n *  results from {@link async.series}.\n *\n * **Note** that while many implementations preserve the order of object\n * properties, the [ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\n * explicitly states that\n *\n * > The mechanics and order of enumerating the properties is not specified.\n *\n * So if you rely on the order in which your series of functions are executed,\n * and want this to work on all platforms, consider using an array.\n *\n * @name series\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing\n * [async functions]{@link AsyncFunction} to run in series.\n * Each function can complete with any number of optional `result` values.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This function gets a results array (or object)\n * containing all the result arguments passed to the `task` callbacks. Invoked\n * with (err, result).\n * @example\n * async.series([\n *     function(callback) {\n *         // do some stuff ...\n *         callback(null, 'one');\n *     },\n *     function(callback) {\n *         // do some more stuff ...\n *         callback(null, 'two');\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     // results is now equal to ['one', 'two']\n * });\n *\n * async.series({\n *     one: function(callback) {\n *         setTimeout(function() {\n *             callback(null, 1);\n *         }, 200);\n *     },\n *     two: function(callback){\n *         setTimeout(function() {\n *             callback(null, 2);\n *         }, 100);\n *     }\n * }, function(err, results) {\n *     // results is now equal to: {one: 1, two: 2}\n * });\n */\nfunction series(tasks, callback) {\n    _parallel(eachOfSeries, tasks, callback);\n}\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @example\n *\n * async.some(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then at least one of the files exists\n * });\n */\nvar some = doParallel(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.\n *\n * @name someLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anyLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someLimit = doParallelLimit(_createTester(Boolean, identity));\n\n/**\n * The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.\n *\n * @name someSeries\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.some]{@link module:Collections.some}\n * @alias anySeries\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in series.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n */\nvar someSeries = doLimit(someLimit, 1);\n\n/**\n * Sorts a list by the results of running each `coll` value through an async\n * `iteratee`.\n *\n * @name sortBy\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The iteratee should complete with a value to use as the sort criteria as\n * its `result`.\n * Invoked with (item, callback).\n * @param {Function} callback - A callback which is called after all the\n * `iteratee` functions have finished, or an error occurs. Results is the items\n * from the original `coll` sorted by the values returned by the `iteratee`\n * calls. Invoked with (err, results).\n * @example\n *\n * async.sortBy(['file1','file2','file3'], function(file, callback) {\n *     fs.stat(file, function(err, stats) {\n *         callback(err, stats.mtime);\n *     });\n * }, function(err, results) {\n *     // results is now the original array of files sorted by\n *     // modified date\n * });\n *\n * // By modifying the callback parameter the\n * // sorting order can be influenced:\n *\n * // ascending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n *     callback(null, x);\n * }, function(err,result) {\n *     // result callback\n * });\n *\n * // descending order\n * async.sortBy([1,9,3,5], function(x, callback) {\n *     callback(null, x*-1);    //<- x*-1 instead of x, turns the order around\n * }, function(err,result) {\n *     // result callback\n * });\n */\nfunction sortBy (coll, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    map(coll, function (x, callback) {\n        _iteratee(x, function (err, criteria) {\n            if (err) return callback(err);\n            callback(null, {value: x, criteria: criteria});\n        });\n    }, function (err, results) {\n        if (err) return callback(err);\n        callback(null, arrayMap(results.sort(comparator), baseProperty('value')));\n    });\n\n    function comparator(left, right) {\n        var a = left.criteria, b = right.criteria;\n        return a < b ? -1 : a > b ? 1 : 0;\n    }\n}\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n *     doAsyncTask(foo, function(err, data) {\n *         // handle errors\n *         if (err) return callback(err);\n *\n *         // do some stuff ...\n *\n *         // return processed data\n *         return callback(null, data);\n *     });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n *     // if `myFunction` takes < 1000 ms to execute, `err`\n *     // and `data` will have their expected values\n *\n *     // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n    var fn = wrapAsync(asyncFn);\n\n    return initialParams(function (args, callback) {\n        var timedOut = false;\n        var timer;\n\n        function timeoutCallback() {\n            var name = asyncFn.name || 'anonymous';\n            var error  = new Error('Callback function \"' + name + '\" timed out.');\n            error.code = 'ETIMEDOUT';\n            if (info) {\n                error.info = info;\n            }\n            timedOut = true;\n            callback(error);\n        }\n\n        args.push(function () {\n            if (!timedOut) {\n                callback.apply(null, arguments);\n                clearTimeout(timer);\n            }\n        });\n\n        // setup timer and call original function\n        timer = setTimeout(timeoutCallback, milliseconds);\n        fn.apply(null, args);\n    });\n}\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil;\nvar nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n  var index = -1,\n      length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n      result = Array(length);\n\n  while (length--) {\n    result[fromRight ? length : ++index] = start;\n    start += step;\n  }\n  return result;\n}\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs a maximum of `limit` async operations at a\n * time.\n *\n * @name timesLimit\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} count - The number of times to run the function.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see [async.map]{@link module:Collections.map}.\n */\nfunction timeLimit(count, limit, iteratee, callback) {\n    var _iteratee = wrapAsync(iteratee);\n    mapLimit(baseRange(0, count, 1), limit, _iteratee, callback);\n}\n\n/**\n * Calls the `iteratee` function `n` times, and accumulates results in the same\n * manner you would use with [map]{@link module:Collections.map}.\n *\n * @name times\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.map]{@link module:Collections.map}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n * @example\n *\n * // Pretend this is some complicated async factory\n * var createUser = function(id, callback) {\n *     callback(null, {\n *         id: 'user' + id\n *     });\n * };\n *\n * // generate 5 users\n * async.times(5, function(n, next) {\n *     createUser(n, function(err, user) {\n *         next(err, user);\n *     });\n * }, function(err, users) {\n *     // we should now have 5 users\n * });\n */\nvar times = doLimit(timeLimit, Infinity);\n\n/**\n * The same as [times]{@link module:ControlFlow.times} but runs only a single async operation at a time.\n *\n * @name timesSeries\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.times]{@link module:ControlFlow.times}\n * @category Control Flow\n * @param {number} n - The number of times to run the function.\n * @param {AsyncFunction} iteratee - The async function to call `n` times.\n * Invoked with the iteration index and a callback: (n, next).\n * @param {Function} callback - see {@link module:Collections.map}.\n */\nvar timesSeries = doLimit(timeLimit, 1);\n\n/**\n * A relative of `reduce`.  Takes an Object or Array, and iterates over each\n * element in series, each step potentially mutating an `accumulator` value.\n * The type of the accumulator defaults to the type of collection passed in.\n *\n * @name transform\n * @static\n * @memberOf module:Collections\n * @method\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {*} [accumulator] - The initial state of the transform.  If omitted,\n * it will default to an empty Object or Array, depending on the type of `coll`\n * @param {AsyncFunction} iteratee - A function applied to each item in the\n * collection that potentially modifies the accumulator.\n * Invoked with (accumulator, item, key, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result is the transformed accumulator.\n * Invoked with (err, result).\n * @example\n *\n * async.transform([1,2,3], function(acc, item, index, callback) {\n *     // pointless async:\n *     process.nextTick(function() {\n *         acc.push(item * 2)\n *         callback(null)\n *     });\n * }, function(err, result) {\n *     // result is now equal to [2, 4, 6]\n * });\n *\n * @example\n *\n * async.transform({a: 1, b: 2, c: 3}, function (obj, val, key, callback) {\n *     setImmediate(function () {\n *         obj[key] = val * 2;\n *         callback();\n *     })\n * }, function (err, result) {\n *     // result is equal to {a: 2, b: 4, c: 6}\n * })\n */\nfunction transform (coll, accumulator, iteratee, callback) {\n    if (arguments.length <= 3) {\n        callback = iteratee;\n        iteratee = accumulator;\n        accumulator = isArray(coll) ? [] : {};\n    }\n    callback = once(callback || noop);\n    var _iteratee = wrapAsync(iteratee);\n\n    eachOf(coll, function(v, k, cb) {\n        _iteratee(accumulator, v, k, cb);\n    }, function(err) {\n        callback(err, accumulator);\n    });\n}\n\n/**\n * It runs each task in series but stops whenever any of the functions were\n * successful. If one of the tasks were successful, the `callback` will be\n * passed the result of the successful task. If all tasks fail, the callback\n * will be passed the error and result (if any) of the final attempt.\n *\n * @name tryEach\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array|Iterable|Object} tasks - A collection containing functions to\n * run, each function is passed a `callback(err, result)` it must call on\n * completion with an error `err` (which can be `null`) and an optional `result`\n * value.\n * @param {Function} [callback] - An optional callback which is called when one\n * of the tasks has succeeded, or all have failed. It receives the `err` and\n * `result` arguments of the last attempt at completing the `task`. Invoked with\n * (err, results).\n * @example\n * async.tryEach([\n *     function getDataFromFirstWebsite(callback) {\n *         // Try getting the data from the first website\n *         callback(err, data);\n *     },\n *     function getDataFromSecondWebsite(callback) {\n *         // First website failed,\n *         // Try getting the data from the backup website\n *         callback(err, data);\n *     }\n * ],\n * // optional callback\n * function(err, results) {\n *     Now do something with the data.\n * });\n *\n */\nfunction tryEach(tasks, callback) {\n    var error = null;\n    var result;\n    callback = callback || noop;\n    eachSeries(tasks, function(task, callback) {\n        wrapAsync(task)(function (err, res/*, ...args*/) {\n            if (arguments.length > 2) {\n                result = slice(arguments, 1);\n            } else {\n                result = res;\n            }\n            error = err;\n            callback(!err);\n        });\n    }, function () {\n        callback(error, result);\n    });\n}\n\n/**\n * Undoes a [memoize]{@link module:Utils.memoize}d function, reverting it to the original,\n * unmemoized form. Handy for testing.\n *\n * @name unmemoize\n * @static\n * @memberOf module:Utils\n * @method\n * @see [async.memoize]{@link module:Utils.memoize}\n * @category Util\n * @param {AsyncFunction} fn - the memoized function\n * @returns {AsyncFunction} a function that calls the original unmemoized function\n */\nfunction unmemoize(fn) {\n    return function () {\n        return (fn.unmemoized || fn).apply(null, arguments);\n    };\n}\n\n/**\n * Repeatedly call `iteratee`, while `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs.\n *\n * @name whilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` passes. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n * @returns undefined\n * @example\n *\n * var count = 0;\n * async.whilst(\n *     function() { return count < 5; },\n *     function(callback) {\n *         count++;\n *         setTimeout(function() {\n *             callback(null, count);\n *         }, 1000);\n *     },\n *     function (err, n) {\n *         // 5 seconds have passed, n = 5\n *     }\n * );\n */\nfunction whilst(test, iteratee, callback) {\n    callback = onlyOnce(callback || noop);\n    var _iteratee = wrapAsync(iteratee);\n    if (!test()) return callback(null);\n    var next = function(err/*, ...args*/) {\n        if (err) return callback(err);\n        if (test()) return _iteratee(next);\n        var args = slice(arguments, 1);\n        callback.apply(null, [null].concat(args));\n    };\n    _iteratee(next);\n}\n\n/**\n * Repeatedly call `iteratee` until `test` returns `true`. Calls `callback` when\n * stopped, or an error occurs. `callback` will be passed an error and any\n * arguments passed to the final `iteratee`'s callback.\n *\n * The inverse of [whilst]{@link module:ControlFlow.whilst}.\n *\n * @name until\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {Function} test - synchronous truth test to perform before each\n * execution of `iteratee`. Invoked with ().\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction until(test, iteratee, callback) {\n    whilst(function() {\n        return !test.apply(this, arguments);\n    }, iteratee, callback);\n}\n\n/**\n * Runs the `tasks` array of functions in series, each passing their results to\n * the next in the array. However, if any of the `tasks` pass an error to their\n * own callback, the next function is not executed, and the main `callback` is\n * immediately called with the error.\n *\n * @name waterfall\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @category Control Flow\n * @param {Array} tasks - An array of [async functions]{@link AsyncFunction}\n * to run.\n * Each function should complete with any number of `result` values.\n * The `result` values will be passed as arguments, in order, to the next task.\n * @param {Function} [callback] - An optional callback to run once all the\n * functions have completed. This will be passed the results of the last task's\n * callback. Invoked with (err, [results]).\n * @returns undefined\n * @example\n *\n * async.waterfall([\n *     function(callback) {\n *         callback(null, 'one', 'two');\n *     },\n *     function(arg1, arg2, callback) {\n *         // arg1 now equals 'one' and arg2 now equals 'two'\n *         callback(null, 'three');\n *     },\n *     function(arg1, callback) {\n *         // arg1 now equals 'three'\n *         callback(null, 'done');\n *     }\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n *\n * // Or, with named functions:\n * async.waterfall([\n *     myFirstFunction,\n *     mySecondFunction,\n *     myLastFunction,\n * ], function (err, result) {\n *     // result now equals 'done'\n * });\n * function myFirstFunction(callback) {\n *     callback(null, 'one', 'two');\n * }\n * function mySecondFunction(arg1, arg2, callback) {\n *     // arg1 now equals 'one' and arg2 now equals 'two'\n *     callback(null, 'three');\n * }\n * function myLastFunction(arg1, callback) {\n *     // arg1 now equals 'three'\n *     callback(null, 'done');\n * }\n */\nvar waterfall = function(tasks, callback) {\n    callback = once(callback || noop);\n    if (!isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));\n    if (!tasks.length) return callback();\n    var taskIndex = 0;\n\n    function nextTask(args) {\n        var task = wrapAsync(tasks[taskIndex++]);\n        args.push(onlyOnce(next));\n        task.apply(null, args);\n    }\n\n    function next(err/*, ...args*/) {\n        if (err || taskIndex === tasks.length) {\n            return callback.apply(null, arguments);\n        }\n        nextTask(slice(arguments, 1));\n    }\n\n    nextTask([]);\n};\n\n/**\n * An \"async function\" in the context of Async is an asynchronous function with\n * a variable number of parameters, with the final parameter being a callback.\n * (`function (arg1, arg2, ..., callback) {}`)\n * The final callback is of the form `callback(err, results...)`, which must be\n * called once the function is completed.  The callback should be called with a\n * Error as its first argument to signal that an error occurred.\n * Otherwise, if no error occurred, it should be called with `null` as the first\n * argument, and any additional `result` arguments that may apply, to signal\n * successful completion.\n * The callback must be called exactly once, ideally on a later tick of the\n * JavaScript event loop.\n *\n * This type of function is also referred to as a \"Node-style async function\",\n * or a \"continuation passing-style function\" (CPS). Most of the methods of this\n * library are themselves CPS/Node-style async functions, or functions that\n * return CPS/Node-style async functions.\n *\n * Wherever we accept a Node-style async function, we also directly accept an\n * [ES2017 `async` function]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function}.\n * In this case, the `async` function will not be passed a final callback\n * argument, and any thrown error will be used as the `err` argument of the\n * implicit callback, and the return value will be used as the `result` value.\n * (i.e. a `rejected` of the returned Promise becomes the `err` callback\n * argument, and a `resolved` value becomes the `result`.)\n *\n * Note, due to JavaScript limitations, we can only detect native `async`\n * functions and not transpilied implementations.\n * Your environment must have `async`/`await` support for this to work.\n * (e.g. Node > v7.6, or a recent version of a modern browser).\n * If you are using `async` functions through a transpiler (e.g. Babel), you\n * must still wrap the function with [asyncify]{@link module:Utils.asyncify},\n * because the `async function` will be compiled to an ordinary function that\n * returns a promise.\n *\n * @typedef {Function} AsyncFunction\n * @static\n */\n\n/**\n * Async is a utility module which provides straight-forward, powerful functions\n * for working with asynchronous JavaScript. Although originally designed for\n * use with [Node.js](http://nodejs.org) and installable via\n * `npm install --save async`, it can also be used directly in the browser.\n * @module async\n * @see AsyncFunction\n */\n\n\n/**\n * A collection of `async` functions for manipulating collections, such as\n * arrays and objects.\n * @module Collections\n */\n\n/**\n * A collection of `async` functions for controlling the flow through a script.\n * @module ControlFlow\n */\n\n/**\n * A collection of `async` utility functions.\n * @module Utils\n */\n\nvar index = {\n    apply: apply,\n    applyEach: applyEach,\n    applyEachSeries: applyEachSeries,\n    asyncify: asyncify,\n    auto: auto,\n    autoInject: autoInject,\n    cargo: cargo,\n    compose: compose,\n    concat: concat,\n    concatLimit: concatLimit,\n    concatSeries: concatSeries,\n    constant: constant,\n    detect: detect,\n    detectLimit: detectLimit,\n    detectSeries: detectSeries,\n    dir: dir,\n    doDuring: doDuring,\n    doUntil: doUntil,\n    doWhilst: doWhilst,\n    during: during,\n    each: eachLimit,\n    eachLimit: eachLimit$1,\n    eachOf: eachOf,\n    eachOfLimit: eachOfLimit,\n    eachOfSeries: eachOfSeries,\n    eachSeries: eachSeries,\n    ensureAsync: ensureAsync,\n    every: every,\n    everyLimit: everyLimit,\n    everySeries: everySeries,\n    filter: filter,\n    filterLimit: filterLimit,\n    filterSeries: filterSeries,\n    forever: forever,\n    groupBy: groupBy,\n    groupByLimit: groupByLimit,\n    groupBySeries: groupBySeries,\n    log: log,\n    map: map,\n    mapLimit: mapLimit,\n    mapSeries: mapSeries,\n    mapValues: mapValues,\n    mapValuesLimit: mapValuesLimit,\n    mapValuesSeries: mapValuesSeries,\n    memoize: memoize,\n    nextTick: nextTick,\n    parallel: parallelLimit,\n    parallelLimit: parallelLimit$1,\n    priorityQueue: priorityQueue,\n    queue: queue$1,\n    race: race,\n    reduce: reduce,\n    reduceRight: reduceRight,\n    reflect: reflect,\n    reflectAll: reflectAll,\n    reject: reject,\n    rejectLimit: rejectLimit,\n    rejectSeries: rejectSeries,\n    retry: retry,\n    retryable: retryable,\n    seq: seq,\n    series: series,\n    setImmediate: setImmediate$1,\n    some: some,\n    someLimit: someLimit,\n    someSeries: someSeries,\n    sortBy: sortBy,\n    timeout: timeout,\n    times: times,\n    timesLimit: timeLimit,\n    timesSeries: timesSeries,\n    transform: transform,\n    tryEach: tryEach,\n    unmemoize: unmemoize,\n    until: until,\n    waterfall: waterfall,\n    whilst: whilst,\n\n    // aliases\n    all: every,\n    allLimit: everyLimit,\n    allSeries: everySeries,\n    any: some,\n    anyLimit: someLimit,\n    anySeries: someSeries,\n    find: detect,\n    findLimit: detectLimit,\n    findSeries: detectSeries,\n    forEach: eachLimit,\n    forEachSeries: eachSeries,\n    forEachLimit: eachLimit$1,\n    forEachOf: eachOf,\n    forEachOfSeries: eachOfSeries,\n    forEachOfLimit: eachOfLimit,\n    inject: reduce,\n    foldl: reduce,\n    foldr: reduceRight,\n    select: filter,\n    selectLimit: filterLimit,\n    selectSeries: filterSeries,\n    wrapSync: asyncify\n};\n\nexports['default'] = index;\nexports.apply = apply;\nexports.applyEach = applyEach;\nexports.applyEachSeries = applyEachSeries;\nexports.asyncify = asyncify;\nexports.auto = auto;\nexports.autoInject = autoInject;\nexports.cargo = cargo;\nexports.compose = compose;\nexports.concat = concat;\nexports.concatLimit = concatLimit;\nexports.concatSeries = concatSeries;\nexports.constant = constant;\nexports.detect = detect;\nexports.detectLimit = detectLimit;\nexports.detectSeries = detectSeries;\nexports.dir = dir;\nexports.doDuring = doDuring;\nexports.doUntil = doUntil;\nexports.doWhilst = doWhilst;\nexports.during = during;\nexports.each = eachLimit;\nexports.eachLimit = eachLimit$1;\nexports.eachOf = eachOf;\nexports.eachOfLimit = eachOfLimit;\nexports.eachOfSeries = eachOfSeries;\nexports.eachSeries = eachSeries;\nexports.ensureAsync = ensureAsync;\nexports.every = every;\nexports.everyLimit = everyLimit;\nexports.everySeries = everySeries;\nexports.filter = filter;\nexports.filterLimit = filterLimit;\nexports.filterSeries = filterSeries;\nexports.forever = forever;\nexports.groupBy = groupBy;\nexports.groupByLimit = groupByLimit;\nexports.groupBySeries = groupBySeries;\nexports.log = log;\nexports.map = map;\nexports.mapLimit = mapLimit;\nexports.mapSeries = mapSeries;\nexports.mapValues = mapValues;\nexports.mapValuesLimit = mapValuesLimit;\nexports.mapValuesSeries = mapValuesSeries;\nexports.memoize = memoize;\nexports.nextTick = nextTick;\nexports.parallel = parallelLimit;\nexports.parallelLimit = parallelLimit$1;\nexports.priorityQueue = priorityQueue;\nexports.queue = queue$1;\nexports.race = race;\nexports.reduce = reduce;\nexports.reduceRight = reduceRight;\nexports.reflect = reflect;\nexports.reflectAll = reflectAll;\nexports.reject = reject;\nexports.rejectLimit = rejectLimit;\nexports.rejectSeries = rejectSeries;\nexports.retry = retry;\nexports.retryable = retryable;\nexports.seq = seq;\nexports.series = series;\nexports.setImmediate = setImmediate$1;\nexports.some = some;\nexports.someLimit = someLimit;\nexports.someSeries = someSeries;\nexports.sortBy = sortBy;\nexports.timeout = timeout;\nexports.times = times;\nexports.timesLimit = timeLimit;\nexports.timesSeries = timesSeries;\nexports.transform = transform;\nexports.tryEach = tryEach;\nexports.unmemoize = unmemoize;\nexports.until = until;\nexports.waterfall = waterfall;\nexports.whilst = whilst;\nexports.all = every;\nexports.allLimit = everyLimit;\nexports.allSeries = everySeries;\nexports.any = some;\nexports.anyLimit = someLimit;\nexports.anySeries = someSeries;\nexports.find = detect;\nexports.findLimit = detectLimit;\nexports.findSeries = detectSeries;\nexports.forEach = eachLimit;\nexports.forEachSeries = eachSeries;\nexports.forEachLimit = eachLimit$1;\nexports.forEachOf = eachOf;\nexports.forEachOfSeries = eachOfSeries;\nexports.forEachOfLimit = eachOfLimit;\nexports.inject = reduce;\nexports.foldl = reduce;\nexports.foldr = reduceRight;\nexports.select = filter;\nexports.selectLimit = filterLimit;\nexports.selectSeries = filterSeries;\nexports.wrapSync = asyncify;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate, __webpack_require__(4), __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/dist/async.js\n// module id = 588\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/dist/async.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = doUntil;\n\nvar _doWhilst = __webpack_require__(590);\n\nvar _doWhilst2 = _interopRequireDefault(_doWhilst);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Like ['doWhilst']{@link module:ControlFlow.doWhilst}, except the `test` is inverted. Note the\n * argument ordering differs from `until`.\n *\n * @name doUntil\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.doWhilst]{@link module:ControlFlow.doWhilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - An async function which is called each time\n * `test` fails. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has passed and repeated execution of `iteratee` has stopped. `callback`\n * will be passed an error and any arguments passed to the final `iteratee`'s\n * callback. Invoked with (err, [results]);\n */\nfunction doUntil(iteratee, test, callback) {\n    (0, _doWhilst2.default)(iteratee, function () {\n        return !test.apply(this, arguments);\n    }, callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/doUntil.js\n// module id = 589\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/doUntil.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = doWhilst;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _slice = __webpack_require__(112);\n\nvar _slice2 = _interopRequireDefault(_slice);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The post-check version of [`whilst`]{@link module:ControlFlow.whilst}. To reflect the difference in\n * the order of operations, the arguments `test` and `iteratee` are switched.\n *\n * `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n *\n * @name doWhilst\n * @static\n * @memberOf module:ControlFlow\n * @method\n * @see [async.whilst]{@link module:ControlFlow.whilst}\n * @category Control Flow\n * @param {AsyncFunction} iteratee - A function which is called each time `test`\n * passes. Invoked with (callback).\n * @param {Function} test - synchronous truth test to perform after each\n * execution of `iteratee`. Invoked with any non-error callback results of\n * `iteratee`.\n * @param {Function} [callback] - A callback which is called after the test\n * function has failed and repeated execution of `iteratee` has stopped.\n * `callback` will be passed an error and any arguments passed to the final\n * `iteratee`'s callback. Invoked with (err, [results]);\n */\nfunction doWhilst(iteratee, test, callback) {\n    callback = (0, _onlyOnce2.default)(callback || _noop2.default);\n    var _iteratee = (0, _wrapAsync2.default)(iteratee);\n    var next = function (err /*, ...args*/) {\n        if (err) return callback(err);\n        var args = (0, _slice2.default)(arguments, 1);\n        if (test.apply(this, args)) return _iteratee(next);\n        callback.apply(null, [null].concat(args));\n    };\n    _iteratee(next);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/doWhilst.js\n// module id = 590\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/doWhilst.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.default = eachLimit;\n\nvar _eachOfLimit = __webpack_require__(329);\n\nvar _eachOfLimit2 = _interopRequireDefault(_eachOfLimit);\n\nvar _withoutIndex = __webpack_require__(332);\n\nvar _withoutIndex2 = _interopRequireDefault(_withoutIndex);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * The same as [`each`]{@link module:Collections.each} but runs a maximum of `limit` async operations at a time.\n *\n * @name eachLimit\n * @static\n * @memberOf module:Collections\n * @method\n * @see [async.each]{@link module:Collections.each}\n * @alias forEachLimit\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {number} limit - The maximum number of async operations at a time.\n * @param {AsyncFunction} iteratee - An async function to apply to each item in\n * `coll`.\n * The array index is not passed to the iteratee.\n * If you need the index, use `eachOfLimit`.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called when all\n * `iteratee` functions have finished, or an error occurs. Invoked with (err).\n */\nfunction eachLimit(coll, limit, iteratee, callback) {\n  (0, _eachOfLimit2.default)(limit)(coll, (0, _withoutIndex2.default)((0, _wrapAsync2.default)(iteratee)), callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/eachLimit.js\n// module id = 591\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/eachLimit.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _createTester = __webpack_require__(328);\n\nvar _createTester2 = _interopRequireDefault(_createTester);\n\nvar _doParallel = __webpack_require__(163);\n\nvar _doParallel2 = _interopRequireDefault(_doParallel);\n\nvar _notId = __webpack_require__(598);\n\nvar _notId2 = _interopRequireDefault(_notId);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Returns `true` if every element in `coll` satisfies an async test. If any\n * iteratee call returns `false`, the main `callback` is immediately called.\n *\n * @name every\n * @static\n * @memberOf module:Collections\n * @method\n * @alias all\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collection in parallel.\n * The iteratee must complete with a boolean result value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called after all the\n * `iteratee` functions have finished. Result will be either `true` or `false`\n * depending on the values of the async tests. Invoked with (err, result).\n * @example\n *\n * async.every(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then every file exists\n * });\n */\nexports.default = (0, _doParallel2.default)((0, _createTester2.default)(_notId2.default, _notId2.default));\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/every.js\n// module id = 592\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/every.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = DLL;\n// Simple doubly linked list (https://en.wikipedia.org/wiki/Doubly_linked_list) implementation\n// used for queues. This implementation assumes that the node provided by the user can be modified\n// to adjust the next and last properties. We implement only the minimal functionality\n// for queue support.\nfunction DLL() {\n    this.head = this.tail = null;\n    this.length = 0;\n}\n\nfunction setInitial(dll, node) {\n    dll.length = 1;\n    dll.head = dll.tail = node;\n}\n\nDLL.prototype.removeLink = function (node) {\n    if (node.prev) node.prev.next = node.next;else this.head = node.next;\n    if (node.next) node.next.prev = node.prev;else this.tail = node.prev;\n\n    node.prev = node.next = null;\n    this.length -= 1;\n    return node;\n};\n\nDLL.prototype.empty = function () {\n    while (this.head) this.shift();\n    return this;\n};\n\nDLL.prototype.insertAfter = function (node, newNode) {\n    newNode.prev = node;\n    newNode.next = node.next;\n    if (node.next) node.next.prev = newNode;else this.tail = newNode;\n    node.next = newNode;\n    this.length += 1;\n};\n\nDLL.prototype.insertBefore = function (node, newNode) {\n    newNode.prev = node.prev;\n    newNode.next = node;\n    if (node.prev) node.prev.next = newNode;else this.head = newNode;\n    node.prev = newNode;\n    this.length += 1;\n};\n\nDLL.prototype.unshift = function (node) {\n    if (this.head) this.insertBefore(this.head, node);else setInitial(this, node);\n};\n\nDLL.prototype.push = function (node) {\n    if (this.tail) this.insertAfter(this.tail, node);else setInitial(this, node);\n};\n\nDLL.prototype.shift = function () {\n    return this.head && this.removeLink(this.head);\n};\n\nDLL.prototype.pop = function () {\n    return this.tail && this.removeLink(this.tail);\n};\n\nDLL.prototype.toArray = function () {\n    var arr = Array(this.length);\n    var curr = this.head;\n    for (var idx = 0; idx < this.length; idx++) {\n        arr[idx] = curr.data;\n        curr = curr.next;\n    }\n    return arr;\n};\n\nDLL.prototype.remove = function (testFn) {\n    var curr = this.head;\n    while (!!curr) {\n        var next = curr.next;\n        if (testFn(curr)) {\n            this.removeLink(curr);\n        }\n        curr = next;\n    }\n    return this;\n};\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/DoublyLinkedList.js\n// module id = 593\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/DoublyLinkedList.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = _filter;\n\nvar _arrayMap = __webpack_require__(1051);\n\nvar _arrayMap2 = _interopRequireDefault(_arrayMap);\n\nvar _isArrayLike = __webpack_require__(98);\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _baseProperty = __webpack_require__(1061);\n\nvar _baseProperty2 = _interopRequireDefault(_baseProperty);\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction filterArray(eachfn, arr, iteratee, callback) {\n    var truthValues = new Array(arr.length);\n    eachfn(arr, function (x, index, callback) {\n        iteratee(x, function (err, v) {\n            truthValues[index] = !!v;\n            callback(err);\n        });\n    }, function (err) {\n        if (err) return callback(err);\n        var results = [];\n        for (var i = 0; i < arr.length; i++) {\n            if (truthValues[i]) results.push(arr[i]);\n        }\n        callback(null, results);\n    });\n}\n\nfunction filterGeneric(eachfn, coll, iteratee, callback) {\n    var results = [];\n    eachfn(coll, function (x, index, callback) {\n        iteratee(x, function (err, v) {\n            if (err) {\n                callback(err);\n            } else {\n                if (v) {\n                    results.push({ index: index, value: x });\n                }\n                callback();\n            }\n        });\n    }, function (err) {\n        if (err) {\n            callback(err);\n        } else {\n            callback(null, (0, _arrayMap2.default)(results.sort(function (a, b) {\n                return a.index - b.index;\n            }), (0, _baseProperty2.default)('value')));\n        }\n    });\n}\n\nfunction _filter(eachfn, coll, iteratee, callback) {\n    var filter = (0, _isArrayLike2.default)(coll) ? filterArray : filterGeneric;\n    filter(eachfn, coll, (0, _wrapAsync2.default)(iteratee), callback || _noop2.default);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/filter.js\n// module id = 594\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/filter.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\n\nexports.default = function (coll) {\n    return iteratorSymbol && coll[iteratorSymbol] && coll[iteratorSymbol]();\n};\n\nvar iteratorSymbol = typeof Symbol === 'function' && Symbol.iterator;\n\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/getIterator.js\n// module id = 595\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/getIterator.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = iterator;\n\nvar _isArrayLike = __webpack_require__(98);\n\nvar _isArrayLike2 = _interopRequireDefault(_isArrayLike);\n\nvar _getIterator = __webpack_require__(595);\n\nvar _getIterator2 = _interopRequireDefault(_getIterator);\n\nvar _keys = __webpack_require__(1089);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction createArrayIterator(coll) {\n    var i = -1;\n    var len = coll.length;\n    return function next() {\n        return ++i < len ? { value: coll[i], key: i } : null;\n    };\n}\n\nfunction createES2015Iterator(iterator) {\n    var i = -1;\n    return function next() {\n        var item = iterator.next();\n        if (item.done) return null;\n        i++;\n        return { value: item.value, key: i };\n    };\n}\n\nfunction createObjectIterator(obj) {\n    var okeys = (0, _keys2.default)(obj);\n    var i = -1;\n    var len = okeys.length;\n    return function next() {\n        var key = okeys[++i];\n        return i < len ? { value: obj[key], key: key } : null;\n    };\n}\n\nfunction iterator(coll) {\n    if ((0, _isArrayLike2.default)(coll)) {\n        return createArrayIterator(coll);\n    }\n\n    var iterator = (0, _getIterator2.default)(coll);\n    return iterator ? createES2015Iterator(iterator) : createObjectIterator(coll);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/iterator.js\n// module id = 596\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/iterator.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = _asyncMap;\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _asyncMap(eachfn, arr, iteratee, callback) {\n    callback = callback || _noop2.default;\n    arr = arr || [];\n    var results = [];\n    var counter = 0;\n    var _iteratee = (0, _wrapAsync2.default)(iteratee);\n\n    eachfn(arr, function (value, _, callback) {\n        var index = counter++;\n        _iteratee(value, function (err, v) {\n            results[index] = v;\n            callback(err);\n        });\n    }, function (err) {\n        callback(err, results);\n    });\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/map.js\n// module id = 597\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/map.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n    value: true\n});\nexports.default = notId;\nfunction notId(v) {\n    return !v;\n}\nmodule.exports = exports["default"];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/notId.js\n// module id = 598\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/notId.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = queue;\n\nvar _baseIndexOf = __webpack_require__(1054);\n\nvar _baseIndexOf2 = _interopRequireDefault(_baseIndexOf);\n\nvar _isArray = __webpack_require__(285);\n\nvar _isArray2 = _interopRequireDefault(_isArray);\n\nvar _noop = __webpack_require__(63);\n\nvar _noop2 = _interopRequireDefault(_noop);\n\nvar _onlyOnce = __webpack_require__(111);\n\nvar _onlyOnce2 = _interopRequireDefault(_onlyOnce);\n\nvar _setImmediate = __webpack_require__(222);\n\nvar _setImmediate2 = _interopRequireDefault(_setImmediate);\n\nvar _DoublyLinkedList = __webpack_require__(593);\n\nvar _DoublyLinkedList2 = _interopRequireDefault(_DoublyLinkedList);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction queue(worker, concurrency, payload) {\n    if (concurrency == null) {\n        concurrency = 1;\n    } else if (concurrency === 0) {\n        throw new Error('Concurrency must not be zero');\n    }\n\n    var _worker = (0, _wrapAsync2.default)(worker);\n    var numRunning = 0;\n    var workersList = [];\n\n    var processingScheduled = false;\n    function _insert(data, insertAtFront, callback) {\n        if (callback != null && typeof callback !== 'function') {\n            throw new Error('task callback must be a function');\n        }\n        q.started = true;\n        if (!(0, _isArray2.default)(data)) {\n            data = [data];\n        }\n        if (data.length === 0 && q.idle()) {\n            // call drain immediately if there are no tasks\n            return (0, _setImmediate2.default)(function () {\n                q.drain();\n            });\n        }\n\n        for (var i = 0, l = data.length; i < l; i++) {\n            var item = {\n                data: data[i],\n                callback: callback || _noop2.default\n            };\n\n            if (insertAtFront) {\n                q._tasks.unshift(item);\n            } else {\n                q._tasks.push(item);\n            }\n        }\n\n        if (!processingScheduled) {\n            processingScheduled = true;\n            (0, _setImmediate2.default)(function () {\n                processingScheduled = false;\n                q.process();\n            });\n        }\n    }\n\n    function _next(tasks) {\n        return function (err) {\n            numRunning -= 1;\n\n            for (var i = 0, l = tasks.length; i < l; i++) {\n                var task = tasks[i];\n\n                var index = (0, _baseIndexOf2.default)(workersList, task, 0);\n                if (index === 0) {\n                    workersList.shift();\n                } else if (index > 0) {\n                    workersList.splice(index, 1);\n                }\n\n                task.callback.apply(task, arguments);\n\n                if (err != null) {\n                    q.error(err, task.data);\n                }\n            }\n\n            if (numRunning <= q.concurrency - q.buffer) {\n                q.unsaturated();\n            }\n\n            if (q.idle()) {\n                q.drain();\n            }\n            q.process();\n        };\n    }\n\n    var isProcessing = false;\n    var q = {\n        _tasks: new _DoublyLinkedList2.default(),\n        concurrency: concurrency,\n        payload: payload,\n        saturated: _noop2.default,\n        unsaturated: _noop2.default,\n        buffer: concurrency / 4,\n        empty: _noop2.default,\n        drain: _noop2.default,\n        error: _noop2.default,\n        started: false,\n        paused: false,\n        push: function (data, callback) {\n            _insert(data, false, callback);\n        },\n        kill: function () {\n            q.drain = _noop2.default;\n            q._tasks.empty();\n        },\n        unshift: function (data, callback) {\n            _insert(data, true, callback);\n        },\n        remove: function (testFn) {\n            q._tasks.remove(testFn);\n        },\n        process: function () {\n            // Avoid trying to start too many processing operations. This can occur\n            // when callbacks resolve synchronously (#1267).\n            if (isProcessing) {\n                return;\n            }\n            isProcessing = true;\n            while (!q.paused && numRunning < q.concurrency && q._tasks.length) {\n                var tasks = [],\n                    data = [];\n                var l = q._tasks.length;\n                if (q.payload) l = Math.min(l, q.payload);\n                for (var i = 0; i < l; i++) {\n                    var node = q._tasks.shift();\n                    tasks.push(node);\n                    workersList.push(node);\n                    data.push(node.data);\n                }\n\n                numRunning += 1;\n\n                if (q._tasks.length === 0) {\n                    q.empty();\n                }\n\n                if (numRunning === q.concurrency) {\n                    q.saturated();\n                }\n\n                var cb = (0, _onlyOnce2.default)(_next(tasks));\n                _worker(data, cb);\n            }\n            isProcessing = false;\n        },\n        length: function () {\n            return q._tasks.length;\n        },\n        running: function () {\n            return numRunning;\n        },\n        workersList: function () {\n            return workersList;\n        },\n        idle: function () {\n            return q._tasks.length + numRunning === 0;\n        },\n        pause: function () {\n            q.paused = true;\n        },\n        resume: function () {\n            if (q.paused === false) {\n                return;\n            }\n            q.paused = false;\n            (0, _setImmediate2.default)(q.process);\n        }\n    };\n    return q;\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/queue.js\n// module id = 599\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/queue.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = reject;\n\nvar _filter = __webpack_require__(594);\n\nvar _filter2 = _interopRequireDefault(_filter);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction reject(eachfn, arr, iteratee, callback) {\n    (0, _filter2.default)(eachfn, arr, function (value, cb) {\n        iteratee(value, function (err, v) {\n            cb(err, !v);\n        });\n    }, callback);\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/internal/reject.js\n// module id = 600\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/internal/reject.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _createTester = __webpack_require__(328);\n\nvar _createTester2 = _interopRequireDefault(_createTester);\n\nvar _doParallel = __webpack_require__(163);\n\nvar _doParallel2 = _interopRequireDefault(_doParallel);\n\nvar _identity = __webpack_require__(284);\n\nvar _identity2 = _interopRequireDefault(_identity);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Returns `true` if at least one element in the `coll` satisfies an async test.\n * If any iteratee call returns `true`, the main `callback` is immediately\n * called.\n *\n * @name some\n * @static\n * @memberOf module:Collections\n * @method\n * @alias any\n * @category Collection\n * @param {Array|Iterable|Object} coll - A collection to iterate over.\n * @param {AsyncFunction} iteratee - An async truth test to apply to each item\n * in the collections in parallel.\n * The iteratee should complete with a boolean `result` value.\n * Invoked with (item, callback).\n * @param {Function} [callback] - A callback which is called as soon as any\n * iteratee returns `true`, or after all the iteratee functions have finished.\n * Result will be either `true` or `false` depending on the values of the async\n * tests. Invoked with (err, result).\n * @example\n *\n * async.some(['file1','file2','file3'], function(filePath, callback) {\n *     fs.access(filePath, function(err) {\n *         callback(null, !err)\n *     });\n * }, function(err, result) {\n *     // if result is true then at least one of the files exists\n * });\n */\nexports.default = (0, _doParallel2.default)((0, _createTester2.default)(Boolean, _identity2.default));\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/some.js\n// module id = 601\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/some.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n    value: true\n});\nexports.default = timeout;\n\nvar _initialParams = __webpack_require__(330);\n\nvar _initialParams2 = _interopRequireDefault(_initialParams);\n\nvar _wrapAsync = __webpack_require__(37);\n\nvar _wrapAsync2 = _interopRequireDefault(_wrapAsync);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Sets a time limit on an asynchronous function. If the function does not call\n * its callback within the specified milliseconds, it will be called with a\n * timeout error. The code property for the error object will be `'ETIMEDOUT'`.\n *\n * @name timeout\n * @static\n * @memberOf module:Utils\n * @method\n * @category Util\n * @param {AsyncFunction} asyncFn - The async function to limit in time.\n * @param {number} milliseconds - The specified time limit.\n * @param {*} [info] - Any variable you want attached (`string`, `object`, etc)\n * to timeout Error for more information..\n * @returns {AsyncFunction} Returns a wrapped function that can be used with any\n * of the control flow functions.\n * Invoke this function with the same parameters as you would `asyncFunc`.\n * @example\n *\n * function myFunction(foo, callback) {\n *     doAsyncTask(foo, function(err, data) {\n *         // handle errors\n *         if (err) return callback(err);\n *\n *         // do some stuff ...\n *\n *         // return processed data\n *         return callback(null, data);\n *     });\n * }\n *\n * var wrapped = async.timeout(myFunction, 1000);\n *\n * // call `wrapped` as you would `myFunction`\n * wrapped({ bar: 'bar' }, function(err, data) {\n *     // if `myFunction` takes < 1000 ms to execute, `err`\n *     // and `data` will have their expected values\n *\n *     // else `err` will be an Error with the code 'ETIMEDOUT'\n * });\n */\nfunction timeout(asyncFn, milliseconds, info) {\n    var fn = (0, _wrapAsync2.default)(asyncFn);\n\n    return (0, _initialParams2.default)(function (args, callback) {\n        var timedOut = false;\n        var timer;\n\n        function timeoutCallback() {\n            var name = asyncFn.name || 'anonymous';\n            var error = new Error('Callback function \"' + name + '\" timed out.');\n            error.code = 'ETIMEDOUT';\n            if (info) {\n                error.info = info;\n            }\n            timedOut = true;\n            callback(error);\n        }\n\n        args.push(function () {\n            if (!timedOut) {\n                callback.apply(null, arguments);\n                clearTimeout(timer);\n            }\n        });\n\n        // setup timer and call original function\n        timer = setTimeout(timeoutCallback, milliseconds);\n        fn.apply(null, args);\n    });\n}\nmodule.exports = exports['default'];\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/async/timeout.js\n// module id = 602\n// module chunks = 0\n\n//# sourceURL=../node_modules/async/timeout.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _keys = __webpack_require__(615);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/* global fetch */\n\nvar _config = {};\n\nvar Api = function () {\n  function Api(config) {\n    (0, _classCallCheck3.default)(this, Api);\n\n    _config = config;\n  }\n\n  (0, _createClass3.default)(Api, [{\n    key: 'request',\n    value: function request(params) {\n      var advPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n      var query = (0, _keys2.default)(params).map(function (k) {\n        return encodeURIComponent(k) + '=' + encodeURIComponent(params[k]);\n      }).join('&');\n\n      return fetch(_config.api_url + advPath + '?' + query);\n    }\n\n    // call faucet\n    /**\n     *\n     * @example\n     * const d = 1;\n     *\n     * @param {any} address\n     * @returns Promise\n     *\n     * @memberOf Api\n     */\n\n  }, {\n    key: 'addBets',\n    value: function addBets(address) {\n      var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n      if (!address) return;\n      return fetch(_config.api_url + '?to=' + address).then(function (r) {\n        return r.json();\n      }).then(function (json) {\n        if (callback) callback(json);\n        return json;\n      });\n    }\n  }]);\n  return Api;\n}();\n\nexports.default = Api;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/API/Api.js\n// module id = 603\n// module chunks = 0\n\n//# sourceURL=API/Api.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _regenerator = __webpack_require__(132);\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _stringify = __webpack_require__(335);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _asyncToGenerator2 = __webpack_require__(131);\n\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _dexie = __webpack_require__(399);\n\nvar _dexie2 = _interopRequireDefault(_dexie);\n\n__webpack_require__(811);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar DB = new _dexie2.default('DC');\nDB.version(1).stores({\n  keyval: 'key, val'\n});\n\nexports.default = new (function () {\n  function Store() {\n    var _this = this;\n\n    (0, _classCallCheck3.default)(this, Store);\n\n    this.prefix = 'window: ';\n    if (typeof window === 'undefined') this.prefix = 'WORKER: ';\n\n    this.items = {};\n    this.DB = DB;\n\n    DB.on('changes', function () {\n      _this.syncData();\n    });\n    DB.open();\n\n    if (typeof window !== 'undefined' && window.localStorage) {\n      this.items = window.localStorage;\n    } else {\n      this.syncData();\n    }\n  }\n\n  (0, _createClass3.default)(Store, [{\n    key: 'syncData',\n    value: function syncData() {\n      var _this2 = this;\n\n      DB.keyval.toArray(function (arr) {\n        for (var k in arr) {\n          var i = arr[k];\n          _this2.items[i.key] = i.val;\n          if (typeof window !== 'undefined' && window.localStorage) window.localStorage.setItem(i.key, i.val);\n        }\n      });\n    }\n  }, {\n    key: 'set',\n    value: function () {\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(key, val) {\n        var encode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n        return _regenerator2.default.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                if (encode) val = (0, _stringify2.default)(val);\n\n                _context.next = 3;\n                return DB.keyval.put({\n                  key: key,\n                  val: val\n                });\n\n              case 3:\n              case 'end':\n                return _context.stop();\n            }\n          }\n        }, _callee, this);\n      }));\n\n      function set(_x2, _x3) {\n        return _ref.apply(this, arguments);\n      }\n\n      return set;\n    }()\n  }, {\n    key: 'get',\n    value: function () {\n      var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(key) {\n        var decode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n        var res;\n        return _regenerator2.default.wrap(function _callee2$(_context2) {\n          while (1) {\n            switch (_context2.prev = _context2.next) {\n              case 0:\n                _context2.next = 2;\n                return DB.keyval.get(key);\n\n              case 2:\n                res = _context2.sent;\n\n                if (res) {\n                  _context2.next = 5;\n                  break;\n                }\n\n                return _context2.abrupt('return', null);\n\n              case 5:\n\n                if (decode) res.val = JSON.parse(res.val);\n                return _context2.abrupt('return', res.val);\n\n              case 7:\n              case 'end':\n                return _context2.stop();\n            }\n          }\n        }, _callee2, this);\n      }));\n\n      function get(_x5) {\n        return _ref2.apply(this, arguments);\n      }\n\n      return get;\n    }()\n\n    // localStorage compatability\n\n  }, {\n    key: 'setItem',\n    value: function () {\n      var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(key, val) {\n        return _regenerator2.default.wrap(function _callee3$(_context3) {\n          while (1) {\n            switch (_context3.prev = _context3.next) {\n              case 0:\n                this.items[key] = val;\n                _context3.next = 3;\n                return this.set(key, val, false);\n\n              case 3:\n                if (typeof window !== 'undefined' && window.localStorage) window.localStorage.setItem(key, val);\n\n              case 4:\n              case 'end':\n                return _context3.stop();\n            }\n          }\n        }, _callee3, this);\n      }));\n\n      function setItem(_x6, _x7) {\n        return _ref3.apply(this, arguments);\n      }\n\n      return setItem;\n    }()\n  }, {\n    key: 'getItem',\n    value: function getItem(key) {\n      return this.items[key] || null;\n    }\n  }]);\n  return Store;\n}())();\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/API/DB.js\n// module id = 604\n// module chunks = 0\n\n//# sourceURL=API/DB.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _toConsumableArray2 = __webpack_require__(338);\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _promise = __webpack_require__(130);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _regenerator = __webpack_require__(132);\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _typeof2 = __webpack_require__(225);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _asyncToGenerator2 = __webpack_require__(131);\n\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _assign = __webpack_require__(336);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nvar _dcMessaging = __webpack_require__(393);\n\nvar messaging = _interopRequireWildcard(_dcMessaging);\n\nvar _helpers = __webpack_require__(334);\n\nvar _helpers2 = _interopRequireDefault(_helpers);\n\nvar _Account = __webpack_require__(224);\n\nvar _Account2 = _interopRequireDefault(_Account);\n\nvar _eventEmitter = __webpack_require__(262);\n\nvar _eventEmitter2 = _interopRequireDefault(_eventEmitter);\n\nvar _utils = __webpack_require__(129);\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _paychannel = __webpack_require__(606);\n\nvar _paychannel2 = _interopRequireDefault(_paychannel);\n\nvar _cryptoWorker = __webpack_require__(1306);\n\nvar _cryptoWorker2 = _interopRequireDefault(_cryptoWorker);\n\nvar _promiseWorker = __webpack_require__(1152);\n\nvar _promiseWorker2 = _interopRequireDefault(_promiseWorker);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar payChannelWrap = function payChannelWrap(Logic) {\n  var payChannel = new _paychannel2.default();\n  Logic.prototype.payChannel = payChannel;\n  var modifiedLogic = new Logic(payChannel);\n  modifiedLogic.payChannel = payChannel;\n\n  return modifiedLogic;\n};\n\n/** @ignore */\nvar Account = new _Account2.default(_config3.default, function () {}, false);\n/** @ignore */\nvar web3 = Account.web3;\n/** @ignore */\nvar Eth = new _helpers2.default();\n\n/**\n * @ignore\n */\nvar EC = function EC() {};(0, _eventEmitter2.default)(EC.prototype);\n\nvar channelState = function () {\n  var state = {\n    '_id': '',\n    '_playerBalance': '',\n    '_bankrollerBalance': '',\n    '_totalBet': '',\n    '_session': '',\n    '_sign': ''\n  };\n\n  return {\n    set: function set(data) {\n      var new_state = {};\n      for (var k in state) {\n        if (!data[k]) {\n          console.error('Invalid channel state format in channelState.set');\n          console.error('Missing ' + k);\n        }\n        new_state[k] = data[k];\n      }\n      state = (0, _assign2.default)({}, new_state);\n    },\n    get: function get() {\n      return (0, _assign2.default)({}, state);\n    }\n  };\n}();\n\n/*\n * DApp constructor\n */\n\n/**\n * DApp interface to bankroller side\n *\n * [See readme](https://daocasino.readme.io/)\n *\n * @example\n * DCLib.defineDAppLogic('dicegame_v2', function(){\n *    const play = function(a){\n *      ...\n *    }\n *    return { play:play }\n * })\n *\n * const MyDApp = new DCLib.DApp({\n *   slug  : 'dicegame_v2' , // unique DApp slug\n * })\n *\n *\n * @export\n * @class DApp\n * @extends {DCLib}\n */\n\nvar DApp = function () {\n  /**\n   * @ignore\n   */\n  function DApp(params) {\n    (0, _classCallCheck3.default)(this, DApp);\n\n    if (!params.slug) {\n      throw new Error('slug option is required');\n    }\n\n    if (!window.DAppsLogic[params.slug] || !window.DAppsLogic[params.slug]) {\n      throw new Error('Cant find DApp logic');\n    }\n\n    var logic = window.DAppsLogic[params.slug];\n    /** DApp name */\n    this.slug = params.slug;\n    this.code = params.slug;\n    this.rules = params.rules;\n    /** @ignore */\n    this.hash = Utils.checksum(this.slug);\n    /** DApp logic */\n    this.logic = payChannelWrap(logic);\n    this.Crypto = new _promiseWorker2.default(new _cryptoWorker2.default());\n    this.debug = true;\n\n    if (typeof params.debug !== 'undefined') {\n      this.debug = params.debug;\n    }\n\n    /** Add contract's */\n    if (params.contract) {\n      this.contract_address = params.contract.address;\n      this.contract_abi = params.contract.abi;\n    } else {\n      this.contract_address = _config3.default.contracts.paychannel.address;\n      this.contract_abi = _config3.default.contracts.paychannel.abi;\n    }\n    this.web3 = web3;\n    this.PayChannel = new this.web3.eth.Contract(this.contract_abi, this.contract_address);\n\n    this.web3.eth.defaultAccount = Account.get().openkey;\n\n    /** @ignore */\n    this.Room = false;\n    /** @ignore */\n    this.sharedRoom = new messaging.RTC(Account.get().openkey, 'dapp_room_' + this.hash);\n\n    /** @ignore */\n    this.Status = new EC();\n    this.info_channel = (0, _eventEmitter2.default)();\n  }\n\n  /**\n   * Connection of a player with a bankroll\n   * @example\n   * DApp.connect({bankroller : \"auto\", paychannel:{deposit:1}}, function(connected, info){})\n   *\n   * @param  {Object} params\n   * @param  {Object.string} bankroller - address or 'auto' for autofind bankroller\n   * @param  {Object.Object} optional - paychannel config\n   * @param  {Object.Object.string} deposit - paychannel deposit\n   * @return {[type]}\n   */\n\n\n  (0, _createClass3.default)(DApp, [{\n    key: 'connect',\n    value: function () {\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {\n        var _this = this;\n\n        var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n        var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n        var def_params, deposit, bankroller_address, connectionResult, conT, connection;\n        return _regenerator2.default.wrap(function _callee$(_context) {\n          while (1) {\n            switch (_context.prev = _context.next) {\n              case 0:\n                if (this.debug) Utils.debugLog('DApp %c' + this.slug + ' %cconnecting...', 'color:orange', 'color:default', _config3.default.loglevel);\n\n                def_params = { bankroller: 'auto' };\n\n\n                params = (0, _assign2.default)(def_params, params);\n\n                if (!(params.paychannel && (!params.paychannel.deposit || isNaN(params.paychannel.deposit * 1)))) {\n                  _context.next = 5;\n                  break;\n                }\n\n                throw new Error(' 💴 Deposit is required to open paychannel');\n\n              case 5:\n\n                if (params.paychannel && (0, _typeof3.default)(params.paychannel.contract) !== 'object') {\n                  params.paychannel.contract = _config3.default.contracts.paychannel;\n                }\n\n                deposit = params.paychannel && params.paychannel.deposit ? params.paychannel.deposit : 0;\n\n                if (!(Number(deposit) === 0)) {\n                  _context.next = 10;\n                  break;\n                }\n\n                this.Status.emit('error', { code: 'deposit null', 'text': 'your deposit can not be 0' });\n                throw new Error('😓 Your deposit can not be 0');\n\n              case 10:\n\n                deposit = Utils.bet2dec(deposit);\n                if (params.paychannel && params.paychannel.deposit) {\n                  params.paychannel.deposit = deposit;\n                }\n\n                bankroller_address = params.bankroller || 'auto';\n\n                if (!(bankroller_address === 'auto')) {\n                  _context.next = 19;\n                  break;\n                }\n\n                this.Status.emit('connect::info', { status: 'findBankroller', data: { deposit: deposit } });\n                _context.next = 17;\n                return this.findBankroller(deposit);\n\n              case 17:\n                bankroller_address = _context.sent;\n\n                this.Status.emit('connect::info', { status: 'find_compleate', data: bankroller_address });\n\n              case 19:\n                if (this.debug) Utils.debugLog(['📫 Bankroller address:', bankroller_address], _config3.default.loglevel);\n\n                connectionResult = false;\n                conT = setTimeout(function () {\n                  _this.Status.emit('error', { code: 'timeout', 'text': 'Connection timeout' });\n                  throw new Error('⌛ Connection timeout.... 🤐🤐🤐 ', 'error');\n                  // callback(connectionResult, null)\n                }, 7777);\n\n                /**    Ifomation fromconnection(id, room_name, bankroller_address) */\n\n                this.connection_info = { bankroller_address: bankroller_address };\n\n                _context.prev = 23;\n\n                this.Status.emit('connect::info', { status: 'connect', data: { bankroller_address: bankroller_address } });\n\n                _context.next = 27;\n                return this.request({\n                  action: 'connect',\n                  slug: this.slug,\n                  address: bankroller_address\n                }, false, this.sharedRoom, false);\n\n              case 27:\n                connection = _context.sent;\n\n                if (connection.id) {\n                  _context.next = 32;\n                  break;\n                }\n\n                this.Status.emit('error', { code: 'unknow', 'text': 'Cant establish connection' });\n                Utils.debugLog('😓 Cant establish connection....', 'error');\n                return _context.abrupt('return', callback(connectionResult, null));\n\n              case 32:\n\n                clearTimeout(conT);\n\n                if (this.debug) Utils.debugLog(['🔗 Connection established ', connection], _config3.default.loglevel);\n                this.Status.emit('connect::info', { status: 'connected', data: { connection: connection } });\n\n                _context.t0 = messaging.RTC;\n                _context.t1 = Account.get().openkey;\n                _context.t2 = this.hash + '_' + connection.id;\n                _context.next = 40;\n                return Account.exportPrivateKey();\n\n              case 40:\n                _context.t3 = _context.sent;\n                _context.t4 = [bankroller_address];\n                _context.t5 = {\n                  privateKey: _context.t3,\n                  allowed_users: _context.t4\n                };\n                this.Room = new _context.t0(_context.t1, _context.t2, _context.t5);\n\n\n                this.connection_info.id = connection.id;\n                this.connection_info.room_name = this.hash + '_' + connection.id;\n                _context.next = 53;\n                break;\n\n              case 48:\n                _context.prev = 48;\n                _context.t6 = _context['catch'](23);\n\n                this.Status.emit('error', { code: 'unknow', 'text': 'Connection error', err: _context.t6 });\n                Utils.debugLog([' 🚬 Connection error...', _context.t6], 'error');\n                return _context.abrupt('return', callback(connectionResult, null));\n\n              case 53:\n                if (!params.paychannel) {\n                  _context.next = 61;\n                  break;\n                }\n\n                if (!((0, _typeof3.default)(this.logic.payChannel) !== 'object' && _config3.default.loglevel !== 'none')) {\n                  _context.next = 56;\n                  break;\n                }\n\n                throw new Error('logic.payChannel - required');\n\n              case 56:\n\n                this.Status.emit('connect::info', { status: 'openChannel', data: { paychannel: params.paychannel } });\n                params.paychannel.bankroller_address = this.connection_info.bankroller_address;\n\n                _context.next = 60;\n                return this.openChannel(params.paychannel, params.gamedata);\n\n              case 60:\n                this.connection_info.channel = _context.sent;\n\n              case 61:\n\n                connectionResult = true;\n                if (callback) callback(connectionResult, this.connection_info);\n\n              case 63:\n              case 'end':\n                return _context.stop();\n            }\n          }\n        }, _callee, this, [[23, 48]]);\n      }));\n\n      function connect() {\n        return _ref.apply(this, arguments);\n      }\n\n      return connect;\n    }()\n\n    /**\n     * Open channel for game for player and bankroller\n     *\n     * @example\n     * window.MyDApp.openChannel(0.15)\n     *\n     * @param {Object} params - object for params open channel\n     * @param {Object.number} deposit - quantity bets for game\n     * @returns - none\n     *\n     * @memberOf DApp\n     */\n\n  }, {\n    key: 'openChannel',\n    value: function openChannel(params) {\n      var _this2 = this;\n\n      var game_data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n      if (this.debug) Utils.debugLog([' 🔐 Open channel with deposit', params.deposit], _config3.default.loglevel);\n\n      return new _promise2.default(function () {\n        var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(resolve, reject) {\n          var contract_address, user_balance, mineth, minbet, our_allow, args, b_args, bankroll_allow, bankroll_balance, check_open_channel_send, gasLimit;\n          return _regenerator2.default.wrap(function _callee3$(_context3) {\n            while (1) {\n              switch (_context3.prev = _context3.next) {\n                case 0:\n                  contract_address = void 0;\n\n                  _this2.contract_address ? contract_address = _this2.contract_address : contract_address = params.contract.address;\n\n                  // Check user balance\n                  _context3.next = 4;\n                  return Eth.getBalances(Account.get().openkey);\n\n                case 4:\n                  user_balance = _context3.sent;\n                  mineth = 0.01;\n                  minbet = Utils.dec2bet(params.deposit);\n\n                  if (!(mineth !== false && user_balance.eth * 1 < mineth * 1)) {\n                    _context3.next = 11;\n                    break;\n                  }\n\n                  Utils.debugLog(user_balance.eth + ' is very low, you need minimum ' + mineth, 'error');\n                  reject(new Error({ error: 'low balance' }));\n                  return _context3.abrupt('return', false);\n\n                case 11:\n                  if (!(minbet !== false && user_balance.bets * 1 < minbet * 1)) {\n                    _context3.next = 15;\n                    break;\n                  }\n\n                  Utils.debugLog('Your BET balance ' + user_balance.bets + ' <  ' + minbet, 'error');\n                  reject(new Error({ error: 'low balance' }));\n                  return _context3.abrupt('return', false);\n\n                case 15:\n\n                  // Approve ERC20\n                  _this2.Status.emit('connect::info', { status: 'ERC20approve', data: {} });\n                  _context3.next = 18;\n                  return Eth.ERC20.methods.allowance(Account.get().openkey, contract_address).call();\n\n                case 18:\n                  our_allow = _context3.sent;\n\n                  if (!(our_allow < params.deposit)) {\n                    _context3.next = 24;\n                    break;\n                  }\n\n                  _context3.next = 22;\n                  return Eth.ERC20approve(contract_address, 0);\n\n                case 22:\n                  _context3.next = 24;\n                  return Eth.ERC20approve(contract_address, params.deposit);\n\n                case 24:\n\n                  // Ask data from bankroller for open channel\n                  args = {\n                    channel_id: Utils.makeSeed(),\n                    player_address: Account.get().openkey,\n                    player_deposit: params.deposit,\n                    game_data: [0]\n                    // args and sign from bankroller\n                  };\n                  _context3.next = 27;\n                  return _this2.request({\n                    action: 'open_channel',\n                    args: args\n                  });\n\n                case 27:\n                  b_args = _context3.sent;\n\n                  if (!(_this2.rules.depositX * args.player_deposit > b_args.args.bankroller_deposit)) {\n                    _context3.next = 32;\n                    break;\n                  }\n\n                  console.error('invalid bankroller deposit');\n                  _this2.Status.emit('connect::error', {\n                    status: 'error',\n                    msg: 'Bankroller open channel bad deposit',\n                    data: {\n                      'b_deposit': b_args.args.bankroller_deposit,\n                      'p_deposit': args.player_deposit,\n                      'depositX': _this2.rules.depositX\n                    }\n                  });\n                  return _context3.abrupt('return');\n\n                case 32:\n\n                  // Проверяем возвращаемые банкроллером аргументы путем валидации хеша\n                  _this2.Crypto.postMessage({\n                    action: 'check_sign',\n                    data: {\n                      bankroller_address: params.bankroller_address.toLowerCase(),\n                      bankroller_sign: b_args.signed_args,\n                      verify_hash_args: [{ t: 'bytes32', v: args.channel_id }, { t: 'address', v: args.player_address }, { t: 'address', v: b_args.args.bankroller_address }, { t: 'uint', v: '' + args.player_deposit }, { t: 'uint', v: '' + b_args.args.bankroller_deposit }, { t: 'uint', v: b_args.args.opening_block }, { t: 'uint', v: args.game_data }, { t: 'bytes', v: b_args.args._N }, { t: 'bytes', v: b_args.args._E }]\n                    }\n                  }).catch(function (e) {\n                    console.error('invalid bankroller sign');\n                    _this2.Status.emit('connect::error', {\n                      status: 'error',\n                      msg: 'Bankroller open channel args invalid',\n                      data: {}\n                    });\n                    reject(e.message);\n                  });\n\n                  // Создаем RSA с ключем банкроллера\n                  // для дальнейшей верификации сообщения от него\n                  _this2.Crypto.postMessage({ action: 'create_rsa', data: { _N: b_args.args._N, _E: b_args.args._E } });\n\n                  // проверяем апрув банкроллера перед открытием\n                  _context3.next = 36;\n                  return Eth.ERC20.methods.allowance(b_args.args.bankroller_address, _this2.PayChannel._address).call();\n\n                case 36:\n                  bankroll_allow = _context3.sent;\n\n                  if (!(bankroll_allow <= b_args.args.bankroller_deposit)) {\n                    _context3.next = 41;\n                    break;\n                  }\n\n                  console.error('invalid bankroller ERC20 approve');\n                  _this2.Status.emit('connect::error', {\n                    status: 'error',\n                    msg: 'Bankroller has no money',\n                    data: {}\n                  });\n                  return _context3.abrupt('return');\n\n                case 41:\n\n                  // проверяем что вообще есть БЭТы у банкроллера и их достаточно\n                  bankroll_balance = Eth.ERC20.methods.balanceOf(b_args.args.bankroller_address).call();\n\n                  if (!(bankroll_balance <= bankroll_allow)) {\n                    _context3.next = 46;\n                    break;\n                  }\n\n                  console.error('bankroller has no money');\n                  _this2.Status.emit('connect::error', {\n                    status: 'error',\n                    msg: 'Bankroller has no money',\n                    data: {}\n                  });\n                  return _context3.abrupt('return');\n\n                case 46:\n\n                  // Send open channel TX\n                  check_open_channel_send = false;\n                  gasLimit = 4600000;\n\n                  _this2.PayChannel.methods.openChannel(args.channel_id, args.player_address, b_args.args.bankroller_address, +args.player_deposit, +b_args.args.bankroller_deposit, +b_args.args.opening_block, args.game_data, b_args.args._N, b_args.args._E, b_args.signed_args).send({\n                    gas: gasLimit,\n                    gasPrice: 1.2 * _config3.default.gasPrice,\n                    from: args.player_address\n                  }).on('transactionHash', function (transactionHash) {\n                    console.log('open channel', transactionHash);\n                    _this2.Status.emit('connect::info', {\n                      status: 'transactionHash',\n                      msg: 'Open channel',\n                      data: { transactionHash: transactionHash }\n                    });\n                  }).on('confirmation', function () {\n                    var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(confirmationNumber) {\n                      var check;\n                      return _regenerator2.default.wrap(function _callee2$(_context2) {\n                        while (1) {\n                          switch (_context2.prev = _context2.next) {\n                            case 0:\n                              if (confirmationNumber <= _config3.default.tx_confirmations) {\n                                console.log('open channel confirmationNumber', confirmationNumber);\n                              }\n\n                              if (!(confirmationNumber >= _config3.default.tx_confirmations && !check_open_channel_send)) {\n                                _context2.next = 7;\n                                break;\n                              }\n\n                              check_open_channel_send = true;\n                              _context2.next = 5;\n                              return _this2.request({ action: 'check_open_channel' });\n\n                            case 5:\n                              check = _context2.sent;\n\n                              if (!check.error && check.status === 'ok') {\n                                // Set deposit to paychannel in game logic\n                                _this2.logic.payChannel._setDeposits(args.player_deposit, b_args.args.bankroller_deposit);\n\n                                _this2.Status.emit('connect::info', {\n                                  status: 'success_open',\n                                  msg: 'Channel is succefull opening',\n                                  data: {}\n                                });\n\n                                resolve((0, _assign2.default)(check.info, args));\n                              } else {\n                                reject(check);\n                              }\n\n                            case 7:\n                            case 'end':\n                              return _context2.stop();\n                          }\n                        }\n                      }, _callee2, _this2);\n                    }));\n\n                    return function (_x6) {\n                      return _ref3.apply(this, arguments);\n                    };\n                  }()).on('error', function (err) {\n                    console.error(err);\n                    reject(err);\n                  });\n\n                case 49:\n                case 'end':\n                  return _context3.stop();\n              }\n            }\n          }, _callee3, _this2);\n        }));\n\n        return function (_x4, _x5) {\n          return _ref2.apply(this, arguments);\n        };\n      }());\n    }\n  }, {\n    key: 'Game',\n    value: function Game() {\n      var _this3 = this;\n\n      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n        args[_key] = arguments[_key];\n      }\n\n      // DEMO-MODE\n      if (window.DC_DEMO_MODE) {\n        return new _promise2.default(function () {\n          var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(resolve, reject) {\n            var _logic;\n\n            var rnd_i, user_bet, local_returns;\n            return _regenerator2.default.wrap(function _callee4$(_context4) {\n              while (1) {\n                switch (_context4.prev = _context4.next) {\n                  case 0:\n                    _this3.session = _this3.session || 0;\n                    _this3.session++;\n\n                    rnd_i = null;\n                    user_bet = null;\n                    // let gamedata = []\n\n                    args.forEach(function (arg, i) {\n                      if ((typeof arg === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg)) === 'object' && arg.rnd && arg.rnd.gamedata && arg.rnd.bet) {\n                        rnd_i = i;\n                        // gamedata = arg.rnd.gamedata\n                        user_bet = arg.rnd.bet;\n                      }\n                    });\n\n                    if (!_this3.connection_info.channel._totalBet) {\n                      _this3.connection_info.channel._totalBet = 0;\n                    }\n                    _this3.connection_info.channel._totalBet += user_bet;\n\n                    args[rnd_i] = Utils.makeSeed();\n\n                    // Вызываем функцию в локальном gamelogic\n                    local_returns = (_logic = _this3.logic).Game.apply(_logic, args);\n\n\n                    resolve(local_returns, {});\n\n                  case 10:\n                  case 'end':\n                    return _context4.stop();\n                }\n              }\n            }, _callee4, _this3);\n          }));\n\n          return function (_x7, _x8) {\n            return _ref4.apply(this, arguments);\n          };\n        }());\n      }\n\n      return this.call('Game', args);\n    }\n  }, {\n    key: 'call',\n    value: function call(function_name) {\n      var _this4 = this;\n\n      var function_args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n      var callback = arguments[2];\n\n      if (typeof this.logic[function_name] !== 'function') {\n        throw new Error(function_name + ' not exist');\n      }\n\n      if (!this.Room) {\n        console.error('no room');\n        Utils.debugLog('You need .connect() before call!', _config3.default.loglevel);\n        return;\n      }\n\n      Utils.debugLog('Call function ' + function_name + '...', _config3.default.loglevel);\n      return new _promise2.default(function () {\n        var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(resolve, reject) {\n          var _logic2;\n\n          var gamedata, user_bet, data, to_sign, sign, res, rnd_hash_args, local_returns, state_data, state_hash, _sign, upd_state_res, result;\n\n          return _regenerator2.default.wrap(function _callee5$(_context5) {\n            while (1) {\n              switch (_context5.prev = _context5.next) {\n                case 0:\n                  // Up session\n                  _this4.session = _this4.session || 0;\n                  _this4.session++;\n\n                  // Find rnd object\n                  // let rnd_i    = null\n                  gamedata = [];\n                  user_bet = 0;\n\n                  function_args.forEach(function (arg, i) {\n                    if ((typeof arg === 'undefined' ? 'undefined' : (0, _typeof3.default)(arg)) === 'object' && arg.rnd && arg.rnd.gamedata && arg.rnd.bet) {\n                      // rnd_i    = i\n                      gamedata = arg.rnd.gamedata;\n                      user_bet = arg.rnd.bet;\n                    }\n                  });\n\n                  if (!_this4.connection_info.channel._totalBet) {\n                    _this4.connection_info.channel._totalBet = 0;\n                  }\n                  _this4.connection_info.channel._totalBet += user_bet;\n\n                  // Sign call data\n                  data = {\n                    channel_id: _this4.connection_info.channel.channel_id,\n                    session: +_this4.session,\n                    user_bet: '' + user_bet,\n                    gamedata: gamedata,\n                    seed: Utils.makeSeed()\n                  };\n                  to_sign = [{ t: 'bytes32', v: data.channel_id }, { t: 'uint', v: data.session }, { t: 'uint', v: data.user_bet }, { t: 'uint', v: data.gamedata }, { t: 'bytes32', v: data.seed }];\n                  _context5.next = 11;\n                  return Eth.signHash(Utils.sha3.apply(Utils, to_sign));\n\n                case 11:\n                  sign = _context5.sent;\n                  _context5.next = 14;\n                  return _this4.request({\n                    action: 'call',\n                    data: data,\n                    sign: sign,\n                    func: {\n                      name: function_name,\n                      args: function_args\n                    }\n                  });\n\n                case 14:\n                  res = _context5.sent;\n\n                  if (!res.error) {\n                    _context5.next = 18;\n                    break;\n                  }\n\n                  _this4.Status.emit('game::error', {\n                    status: 'error',\n                    msg: res.error,\n                    data: {}\n                  });\n                  return _context5.abrupt('return');\n\n                case 18:\n\n                  // Проверяем корректность подписи рандома\n                  rnd_hash_args = [{ t: 'bytes32', v: data.channel_id }, { t: 'uint', v: data.session }, { t: 'uint', v: data.user_bet }, { t: 'uint', v: data.gamedata }, { t: 'bytes32', v: data.seed }];\n                  _context5.next = 21;\n                  return _this4.Crypto.postMessage({\n                    action: 'rsa_verify',\n                    data: {\n                      rnd_hash: rnd_hash_args,\n                      rnd_sign: res.rnd_sign\n                    }\n                  }).catch(function () {\n                    console.error('Invalid sign for random!');\n                    _this4.openDispute(data);\n                  });\n\n                case 21:\n\n                  // Проверяем что рандом сделан из этой подписи\n                  // if (res.args[rnd_i] !== Utils.sha3(res.rnd_sign)) {\n                  //   console.error('Invalid random!')\n                  //   return\n                  // }\n\n                  // Вызываем функцию в локальном gamelogic\n                  local_returns = (_logic2 = _this4.logic).Game.apply(_logic2, (0, _toConsumableArray3.default)(res.args));\n\n\n                  console.log('DCLIB local_returns', local_returns);\n\n                  // проверяем подпись состояния канала\n                  state_data = {\n                    '_id': _this4.connection_info.channel.channel_id,\n                    '_playerBalance': '' + _this4.logic.payChannel._getBalance().player,\n                    '_bankrollerBalance': '' + _this4.logic.payChannel._getBalance().bankroller,\n                    '_totalBet': '' + _this4.connection_info.channel._totalBet,\n                    '_session': _this4.session\n                  };\n\n                  console.log('DCLIB state_data', state_data);\n                  state_hash = Utils.sha3({ t: 'bytes32', v: state_data._id }, { t: 'uint', v: state_data._playerBalance }, { t: 'uint', v: state_data._bankrollerBalance }, { t: 'uint', v: state_data._totalBet }, { t: 'uint', v: state_data._session });\n                  _context5.next = 28;\n                  return _this4.Crypto.postMessage({\n                    action: 'check_sign',\n                    data: {\n                      verify_hash: state_hash,\n                      bankroller_address: _this4.connection_info.bankroller_address.toLowerCase(),\n                      bankroller_sign: res.state._sign\n                    }\n                  }).catch(function (e) {\n                    console.error('Invalid state ');\n                    _this4.openDispute(data);\n                    reject(e);\n                  });\n\n                case 28:\n                  if (!window.TEST_DISPUT) {\n                    _context5.next = 32;\n                    break;\n                  }\n\n                  console.warn('Test openDispute');\n                  _this4.openDispute(data);\n                  return _context5.abrupt('return');\n\n                case 32:\n\n                  // Сохраняем состояние с подписью банкроллера\n                  channelState.set((0, _assign2.default)((0, _assign2.default)({}, state_data), { '_sign': res.state._sign }));\n\n                  _context5.next = 35;\n                  return _this4.Crypto.postMessage({\n                    action: 'sign_hash',\n                    data: { hash: state_hash }\n                  });\n\n                case 35:\n                  _sign = _context5.sent;\n                  _context5.next = 38;\n                  return _this4.request({\n                    action: 'update_state',\n                    state: (0, _assign2.default)(channelState.get(), { '_sign': _sign })\n                  });\n\n                case 38:\n                  upd_state_res = _context5.sent;\n\n                  if (upd_state_res.status !== 'ok') {}\n\n                  // Возвращаем результат вызова функции\n                  result = {\n                    bankroller: {\n                      args: res.args,\n                      result: res.returns\n                    },\n                    local: {\n                      args: function_args,\n                      result: local_returns\n                    }\n                  };\n\n                  resolve(result);\n                  if (callback) callback(result);\n\n                case 43:\n                case 'end':\n                  return _context5.stop();\n              }\n            }\n          }, _callee5, _this4);\n        }));\n\n        return function (_x10, _x11) {\n          return _ref5.apply(this, arguments);\n        };\n      }());\n    }\n\n    /**\n     * which produces a trip from the game and bankroller\n     *\n     * @example\n     * window.MyDApp.disconnect({...})\n     *\n     * @param {Object} params\n     * @param {boolean} [callback=false]\n     *\n     * @memberOf DApp\n     */\n\n  }, {\n    key: 'disconnect',\n    value: function () {\n      var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {\n        var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n        var result;\n        return _regenerator2.default.wrap(function _callee6$(_context6) {\n          while (1) {\n            switch (_context6.prev = _context6.next) {\n              case 0:\n                result = {};\n\n                if (!this.connection_info.channel) {\n                  _context6.next = 5;\n                  break;\n                }\n\n                _context6.next = 4;\n                return this.closeByConsent();\n\n              case 4:\n                result.channel = _context6.sent;\n\n              case 5:\n                _context6.next = 7;\n                return this.request({ action: 'disconnect' });\n\n              case 7:\n                result.connection = _context6.sent;\n\n\n                this.connection_info = {};\n\n                if (typeof callback === 'function') callback(result);\n\n              case 10:\n              case 'end':\n                return _context6.stop();\n            }\n          }\n        }, _callee6, this);\n      }));\n\n      function disconnect() {\n        return _ref6.apply(this, arguments);\n      }\n\n      return disconnect;\n    }()\n\n    /**\n     * Closin game channel and distribution balance\n     *\n     * @todo write description and example\n     *\n     * @param {Object} params\n     * @returns\n     *\n     * @memberOf DApp\n     */\n\n  }, {\n    key: 'closeByConsent',\n    value: function closeByConsent() {\n      var _this5 = this;\n\n      return new _promise2.default(function () {\n        var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8(resolve, reject) {\n          var last_state, close_data_hash, sign, close_data, recover_openkey, gasLimit, channel_closed_send;\n          return _regenerator2.default.wrap(function _callee8$(_context8) {\n            while (1) {\n              switch (_context8.prev = _context8.next) {\n                case 0:\n                  last_state = channelState.get();\n\n                  // console.log('closeByConsent last_state', last_state)\n\n                  close_data_hash = Utils.sha3({ t: 'bytes32', v: last_state._id }, { t: 'uint', v: last_state._playerBalance }, { t: 'uint', v: last_state._bankrollerBalance }, { t: 'uint', v: last_state._totalBet }, { t: 'uint', v: last_state._session }, { t: 'bool', v: true });\n                  _context8.next = 4;\n                  return Eth.signHash(close_data_hash);\n\n                case 4:\n                  sign = _context8.sent;\n                  _context8.next = 7;\n                  return _this5.request({\n                    action: 'close_by_consent',\n                    data: last_state,\n                    sign: sign\n                  });\n\n                case 7:\n                  close_data = _context8.sent;\n                  recover_openkey = web3.eth.accounts.recover(close_data_hash, close_data.sign);\n\n                  if (!(recover_openkey.toLowerCase() !== _this5.connection_info.bankroller_address.toLowerCase())) {\n                    _context8.next = 12;\n                    break;\n                  }\n\n                  console.error('State ' + recover_openkey + '!=' + _this5.connection_info.bankroller_address);\n                  return _context8.abrupt('return');\n\n                case 12:\n\n                  // Send open channel TX\n                  gasLimit = 4600000;\n                  channel_closed_send = false;\n\n                  _this5.PayChannel.methods.closeByConsent(last_state._id, last_state._playerBalance, last_state._bankrollerBalance, last_state._totalBet, last_state._session, true, close_data.sign).send({\n                    gas: gasLimit,\n                    gasPrice: 1.2 * _config3.default.gasPrice,\n                    from: Account.get().openkey\n                  }).on('transactionHash', function (transactionHash) {\n                    console.log('closeByConsent channel', transactionHash);\n                    _this5.Status.emit('disconnect::info', {\n                      status: 'transactionHash',\n                      msg: 'Close channel',\n                      data: { transactionHash: transactionHash }\n                    });\n                  }).on('confirmation', function () {\n                    var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(confirmationNumber) {\n                      var understand;\n                      return _regenerator2.default.wrap(function _callee7$(_context7) {\n                        while (1) {\n                          switch (_context7.prev = _context7.next) {\n                            case 0:\n                              if (!(confirmationNumber >= _config3.default.tx_confirmations && !channel_closed_send)) {\n                                _context7.next = 9;\n                                break;\n                              }\n\n                              channel_closed_send = true;\n                              _context7.next = 4;\n                              return _this5.request({ action: 'channel_closed' });\n\n                            case 4:\n                              understand = _context7.sent;\n\n                              console.log('understand:', understand);\n                              _this5.logic.payChannel.reset();\n                              _this5.connection_info.channel = false;\n                              resolve({ status: 'ok' });\n\n                            case 9:\n                            case 'end':\n                              return _context7.stop();\n                          }\n                        }\n                      }, _callee7, _this5);\n                    }));\n\n                    return function (_x15) {\n                      return _ref8.apply(this, arguments);\n                    };\n                  }()).on('error', function (err) {\n                    console.error(err);\n                    reject(err);\n                  });\n\n                case 15:\n                case 'end':\n                  return _context8.stop();\n              }\n            }\n          }, _callee8, _this5);\n        }));\n\n        return function (_x13, _x14) {\n          return _ref7.apply(this, arguments);\n        };\n      }());\n    }\n  }, {\n    key: 'updateChannel',\n    value: function () {\n      var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11() {\n        var _this6 = this;\n\n        var last_state;\n        return _regenerator2.default.wrap(function _callee11$(_context11) {\n          while (1) {\n            switch (_context11.prev = _context11.next) {\n              case 0:\n                last_state = channelState.get();\n\n                if (!(!last_state || !last_state._sign || last_state._sign === '')) {\n                  _context11.next = 3;\n                  break;\n                }\n\n                return _context11.abrupt('return');\n\n              case 3:\n                return _context11.abrupt('return', new _promise2.default(function () {\n                  var _ref10 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(resolve, reject) {\n                    var channel, state_hash, gasLimit;\n                    return _regenerator2.default.wrap(function _callee10$(_context10) {\n                      while (1) {\n                        switch (_context10.prev = _context10.next) {\n                          case 0:\n                            _context10.next = 2;\n                            return _this6.PayChannel.methods.channels(last_state._id).call();\n\n                          case 2:\n                            channel = _context10.sent;\n\n                            if (!(channel.open === false)) {\n                              _context10.next = 5;\n                              break;\n                            }\n\n                            return _context10.abrupt('return');\n\n                          case 5:\n                            if (!(channel.session === last_state.session && channel._totalBet === last_state._totalBet && channel.playerBalance === last_state._playerBalance && channel.bankrollerBalance === last_state._bankrollerBalance)) {\n                              _context10.next = 7;\n                              break;\n                            }\n\n                            return _context10.abrupt('return');\n\n                          case 7:\n\n                            console.groupCollapsed('update channel');\n                            console.log('channel state:', channel);\n                            console.log('last local state:', last_state);\n                            state_hash = Utils.sha3({ t: 'bytes32', v: last_state._id }, { t: 'uint', v: last_state._playerBalance }, { t: 'uint', v: last_state._bankrollerBalance }, { t: 'uint', v: last_state._totalBet }, { t: 'uint', v: last_state._session });\n\n                            console.log('Bankroller:', _this6.connection_info.bankroller_address);\n                            console.log('Signer:', web3.eth.accounts.recover(state_hash, last_state._sign));\n                            console.log('Sender:', Account.get().openkey);\n                            console.groupEnd();\n\n                            // Send open channel TX\n                            gasLimit = 4600000;\n\n                            _this6.PayChannel.methods.updateChannel(last_state._id, last_state._playerBalance, last_state._bankrollerBalance, last_state._totalBet, last_state._session, last_state._sign).send({\n                              gas: gasLimit,\n                              gasPrice: 1.2 * _config3.default.gasPrice,\n                              from: Account.get().openkey\n                            }).on('transactionHash', function (transactionHash) {\n                              console.log('openDispute channel', transactionHash);\n                            }).on('confirmation', function () {\n                              var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(confirmationNumber) {\n                                return _regenerator2.default.wrap(function _callee9$(_context9) {\n                                  while (1) {\n                                    switch (_context9.prev = _context9.next) {\n                                      case 0:\n                                        if (confirmationNumber >= _config3.default.tx_confirmations) {\n                                          resolve();\n                                        }\n\n                                      case 1:\n                                      case 'end':\n                                        return _context9.stop();\n                                    }\n                                  }\n                                }, _callee9, _this6);\n                              }));\n\n                              return function (_x18) {\n                                return _ref11.apply(this, arguments);\n                              };\n                            }()).on('error', function (err) {\n                              console.error(err);\n                              reject(err);\n                            });\n\n                          case 17:\n                          case 'end':\n                            return _context10.stop();\n                        }\n                      }\n                    }, _callee10, _this6);\n                  }));\n\n                  return function (_x16, _x17) {\n                    return _ref10.apply(this, arguments);\n                  };\n                }()));\n\n              case 4:\n              case 'end':\n                return _context11.stop();\n            }\n          }\n        }, _callee11, this);\n      }));\n\n      function updateChannel() {\n        return _ref9.apply(this, arguments);\n      }\n\n      return updateChannel;\n    }()\n  }, {\n    key: 'openDispute',\n    value: function () {\n      var _ref12 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(data) {\n        var _this7 = this;\n\n        var to_sign, sign;\n        return _regenerator2.default.wrap(function _callee13$(_context13) {\n          while (1) {\n            switch (_context13.prev = _context13.next) {\n              case 0:\n                _context13.next = 2;\n                return this.updateChannel();\n\n              case 2:\n                to_sign = [{ t: 'bytes32', v: data.channel_id }, { t: 'uint', v: data.session }, { t: 'uint', v: data.user_bet }, { t: 'uint', v: data.gamedata }, { t: 'bytes32', v: data.seed }];\n                _context13.next = 5;\n                return Eth.signHash(Utils.sha3.apply(Utils, to_sign));\n\n              case 5:\n                sign = _context13.sent;\n                return _context13.abrupt('return', new _promise2.default(function (resolve, reject) {\n                  // Send open channel TX\n                  var gasLimit = 4600000;\n                  _this7.PayChannel.methods.openDispute(data.channel_id, data.session, data.user_bet, data.gamedata, data.seed, sign).send({\n                    gas: gasLimit,\n                    gasPrice: 1.2 * _config3.default.gasPrice,\n                    from: Account.get().openkey\n                  }).on('transactionHash', function (transactionHash) {\n                    console.log('openDispute TX', transactionHash);\n                  }).on('confirmation', function () {\n                    var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(confirmationNumber) {\n                      return _regenerator2.default.wrap(function _callee12$(_context12) {\n                        while (1) {\n                          switch (_context12.prev = _context12.next) {\n                            case 0:\n                              if (confirmationNumber >= _config3.default.tx_confirmations) {\n                                resolve(true);\n                              }\n\n                            case 1:\n                            case 'end':\n                              return _context12.stop();\n                          }\n                        }\n                      }, _callee12, _this7);\n                    }));\n\n                    return function (_x20) {\n                      return _ref13.apply(this, arguments);\n                    };\n                  }()).on('error', function (err) {\n                    console.error(err);\n                    reject(err);\n                  });\n                }));\n\n              case 7:\n              case 'end':\n                return _context13.stop();\n            }\n          }\n        }, _callee13, this);\n      }));\n\n      function openDispute(_x19) {\n        return _ref12.apply(this, arguments);\n      }\n\n      return openDispute;\n    }()\n\n    /**\n       * Find to bankroller for game\n       *\n       * @example\n       * window.MyDApp.findBankroller(1)\n       * > 0x6e9bf3f9612d7099aee7c3895ba09b9c4b9474e2\n       *\n       * @param {Number} [deposit=false] - bets for game\n       * @returns {String} - bankroller openkey\n       *\n       * @memberOf DApp\n       */\n\n  }, {\n    key: 'findBankroller',\n    value: function findBankroller() {\n      var _this8 = this;\n\n      var deposit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n      // if (window.DC_DEMO_MODE) {\n      //   return new Promise(resolve=>{resolve('0xDEMOMODE000000000000000000')})\n      // }\n\n      if (this.debug) Utils.debugLog(' 🔎 Find bankrollers in shared Dapp room...', _config3.default.loglevel);\n      var Status = this.Status;\n      var noBankroller = setTimeout(function noInf(params) {\n        Status.emit('connect::info', { status: 'noBankroller', data: { deposit: deposit } });\n        Utils.debugLog(' 🔎 Not bankroller with the same deposit, find continue', _config3.default.loglevel);\n        noBankroller = setTimeout(noInf, 8000);\n      }, 8000);\n\n      return new _promise2.default(function (resolve, reject) {\n        var checkBankroller = function checkBankroller(data) {\n          _this8.Status.emit('connect::info', {\n            status: 'bankrollerInfo',\n            data: data\n          });\n\n          if (deposit && data.deposit < deposit) {\n            return;\n          }\n\n          // return bankroller openkey\n          resolve(data.user_id);\n          clearTimeout(noBankroller);\n          _this8.sharedRoom.off('action::bankroller_active', checkBankroller);\n        };\n        _this8.sharedRoom.on('action::bankroller_active', checkBankroller);\n      });\n    }\n\n    /**\n       * Send message to bankroller with query and\n       * waiting response type callback\n       *\n       * @example\n       * window.MyDApp.request({address: '0x1e05eb5aaa235403177552c07ff4588ea9cbdf87'})\n       *\n       * @param {Object} params\n       * @param {Object.string} params.address - bankroller address\n       * @param {Function} [callback=false] - callback function\n       * @param {boolean} [Room=false] - info on room\n       * @returns {Promise}\n       *\n       * @memberOf DApp\n       */\n\n  }, {\n    key: 'request',\n    value: function request(params) {\n      var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n      var Room = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n      var confirm_delivery = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n\n      Room = Room || this.Room || this.sharedRoom;\n\n      params.address = params.address || this.connection_info.bankroller_address;\n\n      if (!params.address) {\n        Utils.debugLog(['params.address is empty ... ', params], 'error');\n        Utils.debugLog('set bankroller address in params', _config3.default.loglevel);\n        return;\n      }\n\n      return new _promise2.default(function (resolve, reject) {\n        var uiid = Utils.makeSeed();\n\n        params.type = 'request';\n        params.uiid = uiid;\n\n        // Wait response\n        Room.once('uiid::' + uiid, function (result) {\n          if (callback) callback(result);\n          resolve(result.response);\n        });\n\n        // Send request\n        if (confirm_delivery) {\n          Room.send(params, function (delivered) {\n            if (!delivered) {\n              Utils.debugLog('🙉 Cant send msg to bankroller, connection error', _config3.default.loglevel);\n              reject(new Error('undelivered'));\n            }\n          });\n          return;\n        }\n        Room.sendMsg(params);\n      });\n    }\n\n    /**\n       * Receiving a response from bankroller\n       *\n       * @todo write to example\n       *\n       * @param {Object} request_data - the object in which data from response\n       * @param {Object} response - answer from bankroller\n       * @param {boolean} [Room=false] - info on room\n       *\n       * @memberOf DApp\n       */\n\n  }, {\n    key: 'response',\n    value: function response(request_data, _response) {\n      var Room = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n      Room = Room || this.Room || this.sharedRoom;\n\n      request_data.response = _response;\n      request_data.type = 'response';\n\n      Room.send(request_data);\n    }\n  }]);\n  return DApp;\n}();\n\nexports.default = DApp;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DApps/DApp.js\n// module id = 605\n// module chunks = 0\n\n//# sourceURL=DApps/DApp.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(129);\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/** max items in history */\nvar h_max = 100;\n\n/** @ignore */\nvar deposit = {\n  player: null,\n  bankroller: null\n  /** @ignore */\n};var balance = {\n  player: 0,\n  bankroller: 0\n  /** @ignore */\n};var _profit = 0;\n/** Game history  */\nvar _history = [];\n\nvar PayChannel = function () {\n  function PayChannel() {\n    (0, _classCallCheck3.default)(this, PayChannel);\n  }\n\n  (0, _createClass3.default)(PayChannel, [{\n    key: '_setDeposits',\n    value: function _setDeposits(player, bankroller) {\n      if (deposit.player !== null) {\n        console.warn('Deposit allready set');\n      }\n\n      deposit.player = +player;\n      deposit.bankroller = +bankroller;\n      balance.player = 1 * deposit.player;\n      balance.bankroller = 1 * deposit.bankroller;\n\n      return balance;\n    }\n  }, {\n    key: '_getBalance',\n    value: function _getBalance() {\n      return balance;\n    }\n  }, {\n    key: '_getProfit',\n    value: function _getProfit() {\n      return _profit;\n    }\n  }, {\n    key: 'getDeposit',\n    value: function getDeposit() {\n      return Utils.dec2bet(deposit.player);\n    }\n  }, {\n    key: 'getBalance',\n    value: function getBalance() {\n      return Utils.dec2bet(balance.player);\n    }\n  }, {\n    key: 'getBankrollBalance',\n    value: function getBankrollBalance() {\n      return Utils.dec2bet(balance.bankroller);\n    }\n  }, {\n    key: 'getProfit',\n    value: function getProfit() {\n      return Utils.dec2bet(_profit);\n    }\n  }, {\n    key: 'updateBalance',\n    value: function updateBalance(p) {\n      return this.addTX;\n    }\n  }, {\n    key: 'addTX',\n    value: function addTX(p) {\n      _profit += p * 1;\n      balance.player = deposit.player + _profit;\n      balance.bankroller = deposit.bankroller - _profit;\n\n      _history.push({\n        profit: p,\n        balance: balance.player,\n        timestamp: new Date().getTime()\n      });\n\n      _history = _history.splice(-h_max);\n\n      return _profit;\n    }\n  }, {\n    key: 'printLog',\n    value: function printLog() {\n      if (_config3.default.loglevel !== 'none') {\n        console.groupCollapsed('Paychannel state:');\n        console.table({\n          Deposit: this.getDeposit(),\n          Player_balance: this.getBalance(),\n          Bankroll_balance: this.getBankrollBalance(),\n          Profit: this.getProfit()\n        });\n        console.groupCollapsed('TX History, last ' + h_max + ' items ' + _history.length);\n        Utils.debugLog(_history, _config3.default.loglevel);\n        console.groupEnd();\n        console.groupEnd();\n      }\n      return _history;\n    }\n  }, {\n    key: 'reset',\n    value: function reset() {\n      Utils.debugLog('PayChannel::reset, set deposit balance profit to 0', _config3.default.loglevel);\n      deposit.player = false;\n      deposit.bankroller = false;\n      balance.player = 0;\n      balance.bankroller = 0;\n      _profit = 0;\n      _history.push({ reset: true, timestamp: new Date().getTime() });\n    }\n  }]);\n  return PayChannel;\n}();\n\nexports.default = PayChannel;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DApps/paychannel.js\n// module id = 606\n// module chunks = 0\n\n//# sourceURL=DApps/paychannel.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _typeof2 = __webpack_require__(225);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _regenerator = __webpack_require__(132);\n\nvar _regenerator2 = _interopRequireDefault(_regenerator);\n\nvar _promise = __webpack_require__(130);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _slicedToArray2 = __webpack_require__(337);\n\nvar _slicedToArray3 = _interopRequireDefault(_slicedToArray2);\n\nvar _asyncToGenerator2 = __webpack_require__(131);\n\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\n\nvar _classCallCheck2 = __webpack_require__(86);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(87);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _config2 = __webpack_require__(113);\n\nvar _config3 = _interopRequireDefault(_config2);\n\nvar _utils = __webpack_require__(129);\n\nvar Utils = _interopRequireWildcard(_utils);\n\nvar _eventEmitter = __webpack_require__(262);\n\nvar _eventEmitter2 = _interopRequireDefault(_eventEmitter);\n\nvar _Api = __webpack_require__(603);\n\nvar _Api2 = _interopRequireDefault(_Api);\n\nvar _helpers = __webpack_require__(334);\n\nvar _helpers2 = _interopRequireDefault(_helpers);\n\nvar _Account = __webpack_require__(224);\n\nvar _Account2 = _interopRequireDefault(_Account);\n\nvar _DApp = __webpack_require__(605);\n\nvar _DApp2 = _interopRequireDefault(_DApp);\n\nvar _dcMessaging = __webpack_require__(393);\n\nvar messaging = _interopRequireWildcard(_dcMessaging);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @ignore\n */\nvar ourApi = new _Api2.default(_config3.default);\n/**\n * @ignore\n */\nvar Eth = new _helpers2.default();\n\n/**\n * @ignore\n */\nvar EC = function EC() {};(0, _eventEmitter2.default)(EC.prototype);\n/**\n * @ignore\n */\nvar Event = new EC();\n\n/**\n * @ignore\n */\nvar _ready = false;\n\n/**\n * Base class in global namespace.\n *\n * Check it in your browser `console.log(DCLib)`\n *\n * DCLib is javascript library for integrate [dao.casino blockchain protocol](https://github.com/DaoCasino/Whitepaper).\n * Interact with [bankroller](https://github.com/DaoCasino/BankRollerApp), use [Signidice random algorithm](https://github.com/DaoCasino/Whitepaper/blob/master/DAO.Casino%20WP.md#35-algorithm-implemented-in-mvp-of-daocasino-protocol), and paymentchannels.\n *\n *\n * @export\n * @class DCLib\n * @version 0.2.2\n */\n\nvar DCLib = function () {\n  /**\n  * @ignore\n  */\n  function DCLib() {\n    var _this = this;\n\n    var signal = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n    (0, _classCallCheck3.default)(this, DCLib);\n\n    this.version = '0.2.2';\n    this.config = _config3.default;\n\n    // Add signal\n    messaging.upIPFS(signal || _config3.default.signal);\n\n    /**\n    * little utilities\n    */\n    this.Utils = Utils;\n\n    /**\n     * DApp constructor\n     */\n    this.DApp = _DApp2.default;\n\n    /**\n     * Some helpers, such as getBetsBalance()\n     */\n    this.Eth = Eth;\n\n    Event.on('_ready', function () {\n      /* globals localStorage */\n      if (typeof localStorage.requestBets === 'undefined') {\n        localStorage.requestBets = true;\n        ourApi.addBets(_this.Account.get().openkey);\n      }\n\n      if (false) {\n        _this.Account.info(function (info) {\n          if (info.balance.bet * 1 === 0 && localStorage && localStorage.web3wallet) {\n            localStorage.clear();\n            window.location.reload();\n          }\n        });\n      }\n\n      Event.emit('ready');\n      _ready = true;\n    });\n\n    /**\n     * Account instance\n     */\n    this.Account = new _Account2.default(_config3.default, function () {\n      return setTimeout(function () {\n        return Event.emit('_ready');\n      }, 1);\n    });\n\n    /**\n     * WEB3 version 1.0  instance\n     * We include web3 version 1.0 in our lib.\n     * You can use all methods described in official documentation\n     *\n     * @see https://web3js.readthedocs.io/en/1.0/\n     */\n    this.web3 = this.Account.web3;\n\n    /**\n     * ## Get ETH account information\n     * @param {string} address - Addres Ethereum account wallet\n     * @param {accessBalance} callback - callback function then access balance information\n     * @returns {Object} - return balance information\n     *\n     * @example\n     * > DCLib.Account.info('0x4d750610062f1b3ce35117ee3e19cfb657ef6e59').then( r => {})\n     *\n     * @example\n     * // method return\n     * Object {\n     *    openkey: address,\n     *    Object {\n     *       bets : 992.21\n     *       eth  : \"1.748053851\"\n     *    }\n     * }\n     */\n    this.Account.info = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {\n      var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n      var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n      var _ref2, _ref3, bet, eth, res;\n\n      return _regenerator2.default.wrap(function _callee$(_context) {\n        while (1) {\n          switch (_context.prev = _context.next) {\n            case 0:\n              if (_ready) {\n                _context.next = 3;\n                break;\n              }\n\n              console.warn('DClib initialization in progress... try later :) ');\n              return _context.abrupt('return');\n\n            case 3:\n\n              if (!callback && typeof address === 'function') {\n                callback = address;\n                address = _this.Account.get().address;\n              }\n\n              address = address || _this.Account.get().address;\n\n              _context.next = 7;\n              return _promise2.default.all([_this.Eth.getBetBalance(address), _this.Eth.getEthBalance(address)]);\n\n            case 7:\n              _ref2 = _context.sent;\n              _ref3 = (0, _slicedToArray3.default)(_ref2, 2);\n              bet = _ref3[0];\n              eth = _ref3[1];\n              res = {\n                openkey: address,\n                balance: {\n                  eth: eth,\n                  bet: bet\n                }\n              };\n\n\n              if (callback) callback(res);\n              return _context.abrupt('return', res);\n\n            case 14:\n            case 'end':\n              return _context.stop();\n          }\n        }\n      }, _callee, _this);\n    }));\n  }\n\n  /**\n     * Define DApp logic constructor function\n     *\n     * @example\n     * DCLib.defineDAppLogic('game_name', function() {\n     *      ...game_logic\n     * })\n     *\n     * @param {string} dappSlug         unique slug of your dapp\n     * @param {function} logicConstructor constructor Dapp logic\n     */\n\n\n  (0, _createClass3.default)(DCLib, [{\n    key: 'defineDAppLogic',\n    value: function defineDAppLogic(dappSlug, LogicConstructor) {\n      if (!window.DAppsLogic) {\n        window.DAppsLogic = {};\n      }\n\n      if (typeof new LogicConstructor().Game !== 'function') {\n        throw new Error('DAppsLogic require function \"Game\"');\n      }\n      window.DAppsLogic[dappSlug] = LogicConstructor;\n    }\n\n    /**\n    * Callback for triger DClib event.\n    *\n    * @callback eventCallback\n    */\n    /**\n     * ## DCLib.on(event, callback)\n     * adds the functional to event\n     *\n     * @todo add examples and information about method\n     *\n     * @param {Event} event - event name\n     * @param {eventCallback} callback - function then functional for event\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'on',\n    value: function on(event, callback) {\n      if (_ready) callback(_ready);\n      Event.on(event, callback);\n    }\n\n    /**\n     * ## DCLib.randomHash()\n     * Generate random hash\n     *\n     * @example\n     * // example for method initialization\n     *\n     * > DCLib.randomHash()\n     *\n     * @example\n     * // example for method return\n     *\n     * > \"confirm(0x26157e636aea611dd8bb7bee2258fcf84e6714a75112392886ceafe6b19bf03f)\"\n     *\n     * @returns - random Hash\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'randomHash',\n    value: function randomHash(data) {\n      if (!data || !data.bet || !data.gamedata || (0, _typeof3.default)(data.gamedata) !== 'object') {\n        throw new Error('Invalid data for randomHash, need: {bet:100, gamedata:array} ');\n      }\n\n      data.bet = Utils.bet2dec(data.bet);\n\n      return { rnd: data };\n    }\n\n    /**\n     * ## DCLib.numFromHash(randomHash, min=0, max=10)\n     * Generate random number of hash\n     *\n     * @example\n     * // example for method initialization\n     *\n     * > DCLib.numFromHash(\"dsadafkojodjaskfjoasjdoasfjaspfdjoqijeeqwjeq\")\n     *\n     * @example\n     * // example for method return\n     *\n     * > 44\n     *\n     * @param {string} randomHash - hash for generate random num\n     * @param {number} [min=0] - min value for generate default = 0\n     * @param {number} [max=100] - max value for generate default = 100\n     * @returns {number} - Random number\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'numFromHash',\n    value: function numFromHash(randomHash) {\n      var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n      var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;\n\n      if (min > max) {\n        var c = min;min = max;max = c;\n      }\n      if (min === max) return max;\n      max += 1;\n\n      var hashBN = new this.web3.utils.toBN(Utils.remove0x(randomHash), 16);\n      var divBN = new this.web3.utils.toBN(max - min, 10);\n      var divRes = hashBN.divmod(divBN);\n\n      return +divRes.mod + min;\n    }\n\n    /**\n     * ## DCLib.fauset(address=false)\n     * method need for add free bets on account\n     * @async\n     *\n     * @example\n     * // example for method initialization without param\n     *\n     * DCLib.faucet()\n     *\n     * @example\n     * // example for method initialization with param\n     *\n     * DCLib.faucet('0xd4e9f60fc84b97080a1803cf2d4e1003313a2ea2')\n     *\n     * @param {string} [address=false] - account address\n     * @returns {Promise<Object>}\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'faucet',\n    value: function () {\n      var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {\n        var address = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n        var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n        var recipe;\n        return _regenerator2.default.wrap(function _callee2$(_context2) {\n          while (1) {\n            switch (_context2.prev = _context2.next) {\n              case 0:\n                address = address || this.Account.get().openkey;\n                _context2.next = 3;\n                return ourApi.addBets(address);\n\n              case 3:\n                recipe = _context2.sent;\n                return _context2.abrupt('return', recipe);\n\n              case 5:\n              case 'end':\n                return _context2.stop();\n            }\n          }\n        }, _callee2, this);\n      }));\n\n      function faucet() {\n        return _ref4.apply(this, arguments);\n      }\n\n      return faucet;\n    }()\n\n    /**\n     * ## DCLib.sigRecover(rawMsg, signedMsg)\n     * Like sigHashRecover but remove ’0x’(if exist) from rawMsg.\n     * Recovers the Ethereum address which was used to sign the given data.\n     *\n     * @see http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#recover\n     *\n     * @example\n     * // example for method initialization\n     *\n     * DCLib.sigRecover(\n     *  `0x8144a6fa26be252b86456491fbcd43c1de7e022241845ffea1c3df066f7cfede`,\n     *  `0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320bb8b0ba\n     *   760038313b7e2a01674e773e5c2dec046b09fde1560dca38f35ca928765631c`\n     * )\n     *\n     * @example\n     * // example for method return Eth address\n     *\n     * > 0x621e24a7f55843a69766946d6b4b5938423c4a33\n     *\n     * @param {string} rawMsg - hash message for recover.\n     * @param {string} signedMsg - signature message for recover.\n     * @returns {string} - the Ethereum address used to sign this data.\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'sigRecover',\n    value: function sigRecover(rawMsg, signedMsg) {\n      rawMsg = Utils.remove0x(rawMsg);\n      return this.web3.eth.accounts.recover(rawMsg, signedMsg).toLowerCase();\n    }\n\n    /**\n     * ## DCLib.sigHashRecover(rawMsg, signedMsg)\n     * Recovers the Ethereum address which was used to sign the given data.\n     * to sign the given data.\n     *\n     * @see http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#recover\n     *\n     * @example\n     * // example for method initialization\n     *\n     * DCLib.sigRecover(\n     *  `0x8144a6fa26be252b86456491fbcd43c1de7e022241845ffea1c3df066f7cfede`,\n     *  `0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320bb8b0ba\n     *   760038313b7e2a01674e773e5c2dec046b09fde1560dca38f35ca928765631c`\n     * )\n     *\n     * @example\n     * // example for method return Eth address\n     *\n     * > 0x621e24a7f55843a69766946d6b4b5938423c4a33\n     *\n     * @param {string} rawMsg - hash message for recover.\n     * @param {string} signedMsg - signature message for recover.\n     * @returns {string} - the Ethereum address used to sign this data.\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'sigHashRecover',\n    value: function sigHashRecover(rawMsg, signedMsg) {\n      return this.web3.eth.accounts.recover(rawMsg, signedMsg).toLowerCase();\n    }\n\n    /**\n     * ## DCLib.checkSig(rawMsg, signedMsg, needAddress)\n     * Checks. whether this address refers to a signed message\n     *\n     * @example\n     * // example for method initialization\n     * // when the address passes the test\n     *\n     * DCLib.checkSig(\n     * '0x8144a6fa26be252b86456491fbcd43c1de7e022241845ffea1c3df066f7cfede',\n     * `0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320bb8b0ba\n     * 760038313b7e2a01674e773e5c2dec046b09fde1560dca38f35ca928765631c`,\n     * '0x621e24a7f55843a69766946d6b4b5938423c4a33')\n     *\n     * > true // because the address is being checked\n     *\n     * @example\n     * // example for method initialization\n     * // when the address fails validation\n     *\n     * DCLib.checkSig('0x8144a6fa26be252b86456491fbcd43c1de7e022241845ffea1c3df066f7cfede',\n     * '0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320bb8b0ba760038313b7e2a\n     * 01674e773e5c2dec046b09fde1560dca38f35ca928765631c',\n     * '0x621e24a7f55843a69766946d6b4b5938423c2a33')\n     *\n     * > false // because the address does not pass the test\n     *\n     * @param {string} rawMsg - hash message\n     * @param {string} signedMsg - signature message\n     * @param {string} needAddress - check address\n     * @returns {boolean} - true/false\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'checkSig',\n    value: function checkSig(rawMsg, signedMsg, needAddress) {\n      rawMsg = Utils.remove0x(rawMsg);\n      return needAddress.toLowerCase() === this.web3.eth.accounts.recover(rawMsg, signedMsg).toLowerCase();\n    }\n\n    /**\n     * ## DCLib.checkHashSig(rawMsg, signedMsg, needAddress)\n     *\n     * the method checks the address for the signature property\n     * by means of the function web3.account.recover into which\n     * the hash message and signature are transferred,\n     * and if the returned result is equal to the transmitted address,\n     * it returns true otherwise false\n     *\n     * @example\n     * // if address valid\n     *\n     * DCLib.checkHashSig(\"0x43ecd41650080ac1f83a0251c99851e81cb62896188a01fbbf6113b845145f8c\",\n     * `0xf27efaf10b963b69fee76879424c70ace9c4d1b0d8f40ecf7680aa09a420bec473d5fa0b1ccdd17\n     * 62f82f0eb4187637ffdda48b3d68ec71c1ce4f8aa4a28f2d41c`,\n     * '0xdd47ea2258e80d5596df09bec42d33c7553bb9ed')\n     *\n     * > true\n     *\n     *\n     * @example\n     * // if address don't valid\n     *\n     * DCLib.checkHashSig(\"0x43ecd41650080ac1f83a0251c99851e81cb62896188a01fbbf6113b845145f8c\",\n     * `0xf27efaf10b963b69fee76879424c70ace9c4d1b0d8f40ecf7680aa09a420bec473d5fa0b1\n     * ccdd1762f82f0eb4187637ffdda48b3d68ec71c1ce4f8aa4a28f2d41c`,\n     * '0xdd47ea2258e80d5596df09bec42d33c7553b2223')\n     *\n     * > false\n     *\n     * @param {string} rawMsg - message for check\n     * @param {string} signedMsg - message signature for chek\n     * @param {string} needAddress - address which the need check\n     * @returns {bollean} - true/false\n     *\n     * @memberOf DCLib\n     */\n\n  }, {\n    key: 'checkHashSig',\n    value: function checkHashSig(rawMsg, signedMsg, needAddress) {\n      return needAddress.toLowerCase() === this.web3.eth.accounts.recover(rawMsg, signedMsg).toLowerCase();\n    }\n  }]);\n  return DCLib;\n}();\n\nexports.default = DCLib;\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/DC.lib.js\n// module id = 607\n// module chunks = 0\n\n//# sourceURL=DC.lib.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar erc20 = void 0,\n    paychannel = void 0;\n\nif (true) {\n  erc20 = __webpack_require__(609);\n  paychannel = __webpack_require__(610);\n}\n\nmodule.exports = {\n  upd: '17.10.2017',\n\n  wallet_pass: '1234',\n\n  db_name: 'DCLib',\n  rtc_room: 'dc-room1',\n  rtc_store: 'rtc_msgs',\n  logname: 'dclib',\n  loglevel: 'hight',\n\n  network: 'ropsten',\n  rpc_url: 'https://ropsten.infura.io/JCnK5ifEPH9qcQkX0Ahl',\n  api_url: 'https://platform.dao.casino/faucet2',\n  // signal : '/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',\n  // signal  : '/ip4/46.101.244.101/tcp/9090/ws/p2p-websocket-star/',\n  // signal  : '/ip4/146.185.173.84/tcp/9090/ws/p2p-websocket-star/',\n  signal: '/dns4/ws.dao.casino/tcp/443/wss/p2p-websocket-star/',\n\n  tx_confirmations: 2,\n\n  contracts: {\n    erc20: erc20,\n    paychannel: paychannel\n  },\n\n  gasPrice: 100 * 1000000000,\n  gasLimit: 40 * 100000\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/ropsten/config.js\n// module id = 608\n// module chunks = 0\n\n//# sourceURL=config/ropsten/config.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\n/*\n *  Dao.Casino ERC20 test Contract\n *. 0x95a48dca999c89e4e284930d9b9af973a7481287\n *  https://ropsten.etherscan.io/address/0x95a48dca999c89e4e284930d9b9af973a7481287#readContract\n *\n */\n\n// module.exports = {\n//   address : \'0x95a48dca999c89e4e284930d9b9af973a7481287\',\n//   abi     : JSON.parse(\'[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"standard","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"inputs":[],"payable":false,"type":"constructor"},{"payable":false,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]\')\n// }\n\nmodule.exports = {\n  address: \'0x5D1E47F703729fc87FdB9bA5C20fE4c1b7c7bf57\',\n  abi: JSON.parse(\'[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_amount","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"totalSupply","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"faucetTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"acceptOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"newOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"amount","type":"uint256"}],"name":"transferAnyERC20Token","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"faucet","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"}]\')\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/ropsten/contracts/erc20.js\n// module id = 609\n// module chunks = 0\n\n//# sourceURL=config/ropsten/contracts/erc20.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\n/*\n        ___                           __    _______                      __\n      / _ \\___ ___ ____ _  ___ ___  / /_  / ___/ /  ___ ____  ___  ___ / /\n     / ___/ _ `/ // /  \' \\/ -_) _ \\/ __/ / /__/ _ \\/ _ `/ _ \\/ _ \\/ -_) /\n    /_/   \\_,_/\\_, /_/_/_/\\__/_//_/\\__/  \\___/_//_/\\_,_/_//_/_//_/\\__/_/\n              /___/\n\n  Dao.Casino PaymentChannleContract\n  0x029c61e3e9958b06bb63cc5c213c47cd114ab971\n  https://ropsten.etherscan.io/address/0x029c61e3e9958b06bb63cc5c213c47cd114ab971#code\n\n  version 1.0\n  more about payment channels:\n  https://en.bitcoin.it/wiki/Payment_channels\n*/\n\n// module.exports = {\n//   address: \'0x6826f7155843651939c81cb367a72ca4a4912289\',\n//   abi: JSON.parse(\'[{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"disputes","outputs":[{"name":"disputeSeed","type":"bytes32"},{"name":"disputeBet","type":"uint256"},{"name":"initiator","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_session","type":"uint256"},{"name":"_disputeBet","type":"uint256"},{"name":"_gameData","type":"uint256[]"},{"name":"_disputeSeed","type":"bytes32"},{"name":"_sign","type":"bytes"}],"name":"openDispute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"}],"name":"getProfit","outputs":[{"name":"_profit","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"playerWL","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_N","type":"bytes"},{"name":"_E","type":"bytes"},{"name":"_rsaSign","type":"bytes"}],"name":"resolveDispute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_totalBet","type":"uint256"},{"name":"_session","type":"uint256"},{"name":"_sign","type":"bytes"}],"name":"updateChannel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"config","outputs":[{"name":"maxBet","type":"uint256"},{"name":"minBet","type":"uint256"},{"name":"gameDevReward","type":"uint8"},{"name":"bankrollReward","type":"uint8"},{"name":"platformReward","type":"uint8"},{"name":"refererReward","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"channels","outputs":[{"name":"state","type":"uint8"},{"name":"player","type":"address"},{"name":"bankroller","type":"address"},{"name":"playerBalance","type":"uint256"},{"name":"bankrollerBalance","type":"uint256"},{"name":"totalBet","type":"uint256"},{"name":"session","type":"uint256"},{"name":"endBlock","type":"uint256"},{"name":"RSAHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rsa","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"signature","type":"bytes"}],"name":"recoverSigner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"_sigseed","type":"bytes"},{"name":"_min","type":"uint256"},{"name":"_max","type":"uint256"}],"name":"generateRnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_totalBet","type":"uint256"},{"name":"_session","type":"uint256"},{"name":"_close","type":"bool"},{"name":"_sign","type":"bytes"}],"name":"closeByConsent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"},{"name":"_sigseed","type":"bytes"}],"name":"game","outputs":[{"name":"_win","type":"bool"},{"name":"_amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"developer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"safeTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"refContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_player","type":"address"},{"name":"_bankroller","type":"address"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_openingBlock","type":"uint256"},{"name":"_gameData","type":"uint256[]"},{"name":"_N","type":"bytes"},{"name":"_E","type":"bytes"},{"name":"_sign","type":"bytes"}],"name":"openChannel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gameWL","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"}],"name":"closeByTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"}],"name":"checkGameData","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_ref","type":"address"},{"name":"_gameWL","type":"address"},{"name":"_playerWL","type":"address"},{"name":"_rsa","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"action","type":"string"},{"indexed":false,"name":"id","type":"bytes32"},{"indexed":false,"name":"playerBalance","type":"uint256"},{"indexed":false,"name":"bankrollerBalance","type":"uint256"},{"indexed":false,"name":"session","type":"uint256"}],"name":"logChannel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"action","type":"string"},{"indexed":false,"name":"initiator","type":"address"},{"indexed":false,"name":"id","type":"bytes32"},{"indexed":false,"name":"session","type":"uint256"},{"indexed":false,"name":"seed","type":"bytes32"}],"name":"logDispute","type":"event"}]\')\n// }\n\nmodule.exports = {\n  address: \'0x7f7e7dd90602ecab0791ac3370872b533bbdb9cc\',\n  abi: JSON.parse(\'[{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"disputes","outputs":[{"name":"disputeSeed","type":"bytes32"},{"name":"disputeBet","type":"uint256"},{"name":"initiator","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_session","type":"uint256"},{"name":"_disputeBet","type":"uint256"},{"name":"_gameData","type":"uint256[]"},{"name":"_disputeSeed","type":"bytes32"},{"name":"_sign","type":"bytes"}],"name":"openDispute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"}],"name":"getProfit","outputs":[{"name":"_profit","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"playerWL","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_N","type":"bytes"},{"name":"_E","type":"bytes"},{"name":"_rsaSign","type":"bytes"}],"name":"resolveDispute","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_totalBet","type":"uint256"},{"name":"_session","type":"uint256"},{"name":"_sign","type":"bytes"}],"name":"updateChannel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"config","outputs":[{"name":"maxBet","type":"uint256"},{"name":"minBet","type":"uint256"},{"name":"gameDevReward","type":"uint8"},{"name":"bankrollReward","type":"uint8"},{"name":"platformReward","type":"uint8"},{"name":"refererReward","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"channels","outputs":[{"name":"state","type":"uint8"},{"name":"player","type":"address"},{"name":"bankroller","type":"address"},{"name":"playerBalance","type":"uint256"},{"name":"bankrollerBalance","type":"uint256"},{"name":"totalBet","type":"uint256"},{"name":"session","type":"uint256"},{"name":"endBlock","type":"uint256"},{"name":"RSAHash","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rsa","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_hash","type":"bytes32"},{"name":"signature","type":"bytes"}],"name":"recoverSigner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[{"name":"_sigseed","type":"bytes"},{"name":"_min","type":"uint256"},{"name":"_max","type":"uint256"}],"name":"generateRnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_totalBet","type":"uint256"},{"name":"_session","type":"uint256"},{"name":"_close","type":"bool"},{"name":"_sign","type":"bytes"}],"name":"closeByConsent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"},{"name":"_sigseed","type":"bytes"}],"name":"game","outputs":[{"name":"_win","type":"bool"},{"name":"_amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"developer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"safeTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"refContract","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"},{"name":"_player","type":"address"},{"name":"_bankroller","type":"address"},{"name":"_playerBalance","type":"uint256"},{"name":"_bankrollerBalance","type":"uint256"},{"name":"_openingBlock","type":"uint256"},{"name":"_gameData","type":"uint256[]"},{"name":"_N","type":"bytes"},{"name":"_E","type":"bytes"},{"name":"_sign","type":"bytes"}],"name":"openChannel","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"gameWL","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_id","type":"bytes32"}],"name":"closeByTime","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_gameData","type":"uint256[]"},{"name":"_bet","type":"uint256"}],"name":"checkGameData","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_ref","type":"address"},{"name":"_gameWL","type":"address"},{"name":"_playerWL","type":"address"},{"name":"_rsa","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"action","type":"string"},{"indexed":false,"name":"id","type":"bytes32"},{"indexed":false,"name":"playerBalance","type":"uint256"},{"indexed":false,"name":"bankrollerBalance","type":"uint256"},{"indexed":false,"name":"session","type":"uint256"}],"name":"logChannel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"action","type":"string"},{"indexed":false,"name":"initiator","type":"address"},{"indexed":false,"name":"id","type":"bytes32"},{"indexed":false,"name":"session","type":"uint256"},{"indexed":false,"name":"seed","type":"bytes32"}],"name":"logDispute","type":"event"}]\')\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/config/ropsten/contracts/paychannel.js\n// module id = 610\n// module chunks = 0\n\n//# sourceURL=config/ropsten/contracts/paychannel.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(672), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/array/from.js\n// module id = 611\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/array/from.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(673), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/get-iterator.js\n// module id = 612\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/get-iterator.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(674), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/is-iterable.js\n// module id = 613\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/is-iterable.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(677), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/define-property.js\n// module id = 614\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/object/define-property.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(678), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/object/keys.js\n// module id = 615\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/object/keys.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(680), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/symbol.js\n// module id = 616\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/symbol.js')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(681), __esModule: true };\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/babel-runtime/core-js/symbol/iterator.js\n// module id = 617\n// module chunks = 0\n\n//# sourceURL=../node_modules/babel-runtime/core-js/symbol/iterator.js')},function(module,exports){eval("\n/**\n * Expose `Backoff`.\n */\n\nmodule.exports = Backoff;\n\n/**\n * Initialize backoff timer with `opts`.\n *\n * - `min` initial timeout in milliseconds [100]\n * - `max` max timeout [10000]\n * - `jitter` [0]\n * - `factor` [2]\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction Backoff(opts) {\n  opts = opts || {};\n  this.ms = opts.min || 100;\n  this.max = opts.max || 10000;\n  this.factor = opts.factor || 2;\n  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n  this.attempts = 0;\n}\n\n/**\n * Return the backoff duration.\n *\n * @return {Number}\n * @api public\n */\n\nBackoff.prototype.duration = function(){\n  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n  if (this.jitter) {\n    var rand =  Math.random();\n    var deviation = Math.floor(rand * this.jitter * ms);\n    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n  }\n  return Math.min(ms, this.max) | 0;\n};\n\n/**\n * Reset the number of attempts.\n *\n * @api public\n */\n\nBackoff.prototype.reset = function(){\n  this.attempts = 0;\n};\n\n/**\n * Set the minimum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMin = function(min){\n  this.ms = min;\n};\n\n/**\n * Set the maximum duration\n *\n * @api public\n */\n\nBackoff.prototype.setMax = function(max){\n  this.max = max;\n};\n\n/**\n * Set the jitter\n *\n * @api public\n */\n\nBackoff.prototype.setJitter = function(jitter){\n  this.jitter = jitter;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/backo2/index.js\n// module id = 618\n// module chunks = 0\n\n//# sourceURL=../node_modules/backo2/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\n/**\n * Generate a character map.\n * @param {string} alphabet e.g. "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"\n * @param {object} mappings map overrides from key to value\n * @method\n */\n\nvar charmap = function (alphabet, mappings) {\n  mappings || (mappings = {});\n  alphabet.split("").forEach(function (c, i) {\n    if (!(c in mappings)) mappings[c] = i;\n  });\n  return mappings;\n}\n\n/**\n * The RFC 4648 base 32 alphabet and character map.\n * @see {@link https://tools.ietf.org/html/rfc4648}\n */\n\nvar rfc4648 = {\n  alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",\n  charmap: {\n    0: 14,\n    1: 8\n  }\n};\n\nrfc4648.charmap = charmap(rfc4648.alphabet, rfc4648.charmap);\n\n/**\n * The Crockford base 32 alphabet and character map.\n * @see {@link http://www.crockford.com/wrmg/base32.html}\n */\n\nvar crockford = {\n  alphabet: "0123456789ABCDEFGHJKMNPQRSTVWXYZ",\n  charmap: {\n    O: 0,\n    I: 1,\n    L: 1\n  }\n};\n\ncrockford.charmap = charmap(crockford.alphabet, crockford.charmap);\n\n/**\n * base32hex\n * @see {@link https://en.wikipedia.org/wiki/Base32#base32hex}\n */\n\nvar base32hex = {\n  alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV",\n  charmap: {}\n};\n\nbase32hex.charmap = charmap(base32hex.alphabet, base32hex.charmap);\n\n/**\n * Create a new `Decoder` with the given options.\n *\n * @param {object} [options]\n *   @param {string} [type] Supported Base-32 variants are "rfc4648" and\n *     "crockford".\n *   @param {object} [charmap] Override the character map used in decoding.\n * @constructor\n */\n\nfunction Decoder (options) {\n  this.buf = [];\n  this.shift = 8;\n  this.carry = 0;\n\n  if (options) {\n\n    switch (options.type) {\n      case "rfc4648":\n        this.charmap = exports.rfc4648.charmap;\n        break;\n      case "crockford":\n        this.charmap = exports.crockford.charmap;\n        break;\n      case "base32hex":\n        this.charmap = exports.base32hex.charmap;\n        break;\n      default:\n        throw new Error("invalid type");\n    }\n\n    if (options.charmap) this.charmap = options.charmap;\n  }\n}\n\n/**\n * The default character map coresponds to RFC4648.\n */\n\nDecoder.prototype.charmap = rfc4648.charmap;\n\n/**\n * Decode a string, continuing from the previous state.\n *\n * @param {string} str\n * @return {Decoder} this\n */\n\nDecoder.prototype.write = function (str) {\n  var charmap = this.charmap;\n  var buf = this.buf;\n  var shift = this.shift;\n  var carry = this.carry;\n\n  // decode string\n  str.toUpperCase().split("").forEach(function (char) {\n\n    // ignore padding\n    if (char == "=") return;\n\n    // lookup symbol\n    var symbol = charmap[char] & 0xff;\n\n    // 1: 00000 000\n    // 2:          00 00000 0\n    // 3:                    0000 0000\n    // 4:                             0 00000 00\n    // 5:                                       000 00000\n    // 6:                                                00000 000\n    // 7:                                                         00 00000 0\n\n    shift -= 5;\n    if (shift > 0) {\n      carry |= symbol << shift;\n    } else if (shift < 0) {\n      buf.push(carry | (symbol >> -shift));\n      shift += 8;\n      carry = (symbol << shift) & 0xff;\n    } else {\n      buf.push(carry | symbol);\n      shift = 8;\n      carry = 0;\n    }\n  });\n\n  // save state\n  this.shift = shift;\n  this.carry = carry;\n\n  // for chaining\n  return this;\n};\n\n/**\n * Finish decoding.\n *\n * @param {string} [str] The final string to decode.\n * @return {Array} Decoded byte array.\n */\n\nDecoder.prototype.finalize = function (str) {\n  if (str) {\n    this.write(str);\n  }\n  if (this.shift !== 8 && this.carry !== 0) {\n    this.buf.push(this.carry);\n    this.shift = 8;\n    this.carry = 0;\n  }\n  return this.buf;\n};\n\n/**\n * Create a new `Encoder` with the given options.\n *\n * @param {object} [options]\n *   @param {string} [type] Supported Base-32 variants are "rfc4648" and\n *     "crockford".\n *   @param {object} [alphabet] Override the alphabet used in encoding.\n * @constructor\n */\n\nfunction Encoder (options) {\n  this.buf = "";\n  this.shift = 3;\n  this.carry = 0;\n\n  if (options) {\n\n    switch (options.type) {\n      case "rfc4648":\n        this.alphabet = exports.rfc4648.alphabet;\n        break;\n      case "crockford":\n        this.alphabet = exports.crockford.alphabet;\n        break;\n      case "base32hex":\n        this.alphabet = exports.base32hex.alphabet;\n        break;\n      default:\n        throw new Error("invalid type");\n    }\n\n    if (options.alphabet) this.alphabet = options.alphabet;\n    else if (options.lc) this.alphabet = this.alphabet.toLowerCase();\n  }\n}\n\n/**\n * The default alphabet coresponds to RFC4648.\n */\n\nEncoder.prototype.alphabet = rfc4648.alphabet;\n\n/**\n * Encode a byte array, continuing from the previous state.\n *\n * @param {byte[]} buf The byte array to encode.\n * @return {Encoder} this\n */\n\nEncoder.prototype.write = function (buf) {\n  var shift = this.shift;\n  var carry = this.carry;\n  var symbol;\n  var byte;\n  var i;\n\n  // encode each byte in buf\n  for (i = 0; i < buf.length; i++) {\n    byte = buf[i];\n\n    // 1: 00000 000\n    // 2:          00 00000 0\n    // 3:                    0000 0000\n    // 4:                             0 00000 00\n    // 5:                                       000 00000\n    // 6:                                                00000 000\n    // 7:                                                         00 00000 0\n\n    symbol = carry | (byte >> shift);\n    this.buf += this.alphabet[symbol & 0x1f];\n\n    if (shift > 5) {\n      shift -= 5;\n      symbol = byte >> shift;\n      this.buf += this.alphabet[symbol & 0x1f];\n    }\n\n    shift = 5 - shift;\n    carry = byte << shift;\n    shift = 8 - shift;\n  }\n\n  // save state\n  this.shift = shift;\n  this.carry = carry;\n\n  // for chaining\n  return this;\n};\n\n/**\n * Finish encoding.\n *\n * @param {byte[]} [buf] The final byte array to encode.\n * @return {string} The encoded byte array.\n */\n\nEncoder.prototype.finalize = function (buf) {\n  if (buf) {\n    this.write(buf);\n  }\n  if (this.shift !== 3) {\n    this.buf += this.alphabet[this.carry & 0x1f];\n    this.shift = 3;\n    this.carry = 0;\n  }\n  return this.buf;\n};\n\n/**\n * Convenience encoder.\n *\n * @param {byte[]} buf The byte array to encode.\n * @param {object} [options] Options to pass to the encoder.\n * @return {string} The encoded string.\n */\n\nexports.encode = function (buf, options) {\n  return new Encoder(options).finalize(buf);\n};\n\n/**\n * Convenience decoder.\n *\n * @param {string} str The string to decode.\n * @param {object} [options] Options to pass to the decoder.\n * @return {byte[]} The decoded byte array.\n */\n\nexports.decode = function (str, options) {\n  return new Decoder(options).finalize(str);\n};\n\n// Exports.\nexports.Decoder = Decoder;\nexports.Encoder = Encoder;\nexports.charmap = charmap;\nexports.crockford = crockford;\nexports.rfc4648 = rfc4648;\nexports.base32hex = base32hex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base32.js/base32.js\n// module id = 619\n// module chunks = 0\n\n//# sourceURL=../node_modules/base32.js/base32.js')},function(module,exports){eval('/*\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n(function(){\n  "use strict";\n\n  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n\n  // Use a lookup table to find the index.\n  var lookup = new Uint8Array(256);\n  for (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n  }\n\n  exports.encode = function(arraybuffer) {\n    var bytes = new Uint8Array(arraybuffer),\n    i, len = bytes.length, base64 = "";\n\n    for (i = 0; i < len; i+=3) {\n      base64 += chars[bytes[i] >> 2];\n      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n      base64 += chars[bytes[i + 2] & 63];\n    }\n\n    if ((len % 3) === 2) {\n      base64 = base64.substring(0, base64.length - 1) + "=";\n    } else if (len % 3 === 1) {\n      base64 = base64.substring(0, base64.length - 2) + "==";\n    }\n\n    return base64;\n  };\n\n  exports.decode =  function(base64) {\n    var bufferLength = base64.length * 0.75,\n    len = base64.length, i, p = 0,\n    encoded1, encoded2, encoded3, encoded4;\n\n    if (base64[base64.length - 1] === "=") {\n      bufferLength--;\n      if (base64[base64.length - 2] === "=") {\n        bufferLength--;\n      }\n    }\n\n    var arraybuffer = new ArrayBuffer(bufferLength),\n    bytes = new Uint8Array(arraybuffer);\n\n    for (i = 0; i < len; i+=4) {\n      encoded1 = lookup[base64.charCodeAt(i)];\n      encoded2 = lookup[base64.charCodeAt(i+1)];\n      encoded3 = lookup[base64.charCodeAt(i+2)];\n      encoded4 = lookup[base64.charCodeAt(i+3)];\n\n      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n    }\n\n    return arraybuffer;\n  };\n})();\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-arraybuffer/lib/base64-arraybuffer.js\n// module id = 620\n// module chunks = 0\n\n//# sourceURL=../node_modules/base64-arraybuffer/lib/base64-arraybuffer.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n  lookup[i] = code[i]\n  revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction placeHoldersCount (b64) {\n  var len = b64.length\n  if (len % 4 > 0) {\n    throw new Error('Invalid string. Length must be a multiple of 4')\n  }\n\n  // the number of equal signs (place holders)\n  // if there are two placeholders, than the two characters before it\n  // represent one byte\n  // if there is only one, then the three characters before it represent 2 bytes\n  // this is just a cheap hack to not do indexOf twice\n  return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0\n}\n\nfunction byteLength (b64) {\n  // base64 is 4/3 + up to two characters of the original data\n  return (b64.length * 3 / 4) - placeHoldersCount(b64)\n}\n\nfunction toByteArray (b64) {\n  var i, l, tmp, placeHolders, arr\n  var len = b64.length\n  placeHolders = placeHoldersCount(b64)\n\n  arr = new Arr((len * 3 / 4) - placeHolders)\n\n  // if there are placeholders, only get up to the last complete 4 chars\n  l = placeHolders > 0 ? len - 4 : len\n\n  var L = 0\n\n  for (i = 0; i < l; i += 4) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\n    arr[L++] = (tmp >> 16) & 0xFF\n    arr[L++] = (tmp >> 8) & 0xFF\n    arr[L++] = tmp & 0xFF\n  }\n\n  if (placeHolders === 2) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\n    arr[L++] = tmp & 0xFF\n  } else if (placeHolders === 1) {\n    tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\n    arr[L++] = (tmp >> 8) & 0xFF\n    arr[L++] = tmp & 0xFF\n  }\n\n  return arr\n}\n\nfunction tripletToBase64 (num) {\n  return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n  var tmp\n  var output = []\n  for (var i = start; i < end; i += 3) {\n    tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)\n    output.push(tripletToBase64(tmp))\n  }\n  return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n  var tmp\n  var len = uint8.length\n  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n  var output = ''\n  var parts = []\n  var maxChunkLength = 16383 // must be multiple of 3\n\n  // go through the array every three bytes, we'll deal with trailing stuff later\n  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n  }\n\n  // pad the end with zeros, but make sure to not forget the extra bytes\n  if (extraBytes === 1) {\n    tmp = uint8[len - 1]\n    output += lookup[tmp >> 2]\n    output += lookup[(tmp << 4) & 0x3F]\n    output += '=='\n  } else if (extraBytes === 2) {\n    tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\n    output += lookup[tmp >> 10]\n    output += lookup[(tmp >> 4) & 0x3F]\n    output += lookup[(tmp << 2) & 0x3F]\n    output += '='\n  }\n\n  parts.push(output)\n\n  return parts.join('')\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/base64-js/index.js\n// module id = 621\n// module chunks = 0\n\n//# sourceURL=../node_modules/base64-js/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ALPHABET = 'qpzry9x8gf2tvdw0s3jn54khce6mua7l'\n\n// pre-compute lookup table\nvar ALPHABET_MAP = {}\nfor (var z = 0; z < ALPHABET.length; z++) {\n  var x = ALPHABET.charAt(z)\n\n  if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + ' is ambiguous')\n  ALPHABET_MAP[x] = z\n}\n\nfunction polymodStep (pre) {\n  var b = pre >> 25\n  return ((pre & 0x1FFFFFF) << 5) ^\n    (-((b >> 0) & 1) & 0x3b6a57b2) ^\n    (-((b >> 1) & 1) & 0x26508e6d) ^\n    (-((b >> 2) & 1) & 0x1ea119fa) ^\n    (-((b >> 3) & 1) & 0x3d4233dd) ^\n    (-((b >> 4) & 1) & 0x2a1462b3)\n}\n\nfunction prefixChk (prefix) {\n  var chk = 1\n  for (var i = 0; i < prefix.length; ++i) {\n    var c = prefix.charCodeAt(i)\n    if (c < 33 || c > 126) throw new Error('Invalid prefix (' + prefix + ')')\n\n    chk = polymodStep(chk) ^ (c >> 5)\n  }\n  chk = polymodStep(chk)\n\n  for (i = 0; i < prefix.length; ++i) {\n    var v = prefix.charCodeAt(i)\n    chk = polymodStep(chk) ^ (v & 0x1f)\n  }\n  return chk\n}\n\nfunction encode (prefix, words, LIMIT) {\n  LIMIT = LIMIT || 90\n  if ((prefix.length + 7 + words.length) > LIMIT) throw new TypeError('Exceeds length limit')\n\n  prefix = prefix.toLowerCase()\n\n  // determine chk mod\n  var chk = prefixChk(prefix)\n  var result = prefix + '1'\n  for (var i = 0; i < words.length; ++i) {\n    var x = words[i]\n    if ((x >> 5) !== 0) throw new Error('Non 5-bit word')\n\n    chk = polymodStep(chk) ^ x\n    result += ALPHABET.charAt(x)\n  }\n\n  for (i = 0; i < 6; ++i) {\n    chk = polymodStep(chk)\n  }\n  chk ^= 1\n\n  for (i = 0; i < 6; ++i) {\n    var v = (chk >> ((5 - i) * 5)) & 0x1f\n    result += ALPHABET.charAt(v)\n  }\n\n  return result\n}\n\nfunction decode (str, LIMIT) {\n  LIMIT = LIMIT || 90\n  if (str.length < 8) throw new TypeError(str + ' too short')\n  if (str.length > LIMIT) throw new TypeError('Exceeds length limit')\n\n  // don't allow mixed case\n  var lowered = str.toLowerCase()\n  var uppered = str.toUpperCase()\n  if (str !== lowered && str !== uppered) throw new Error('Mixed-case string ' + str)\n  str = lowered\n\n  var split = str.lastIndexOf('1')\n  if (split === -1) throw new Error('No separator character for ' + str)\n  if (split === 0) throw new Error('Missing prefix for ' + str)\n\n  var prefix = str.slice(0, split)\n  var wordChars = str.slice(split + 1)\n  if (wordChars.length < 6) throw new Error('Data too short')\n\n  var chk = prefixChk(prefix)\n  var words = []\n  for (var i = 0; i < wordChars.length; ++i) {\n    var c = wordChars.charAt(i)\n    var v = ALPHABET_MAP[c]\n    if (v === undefined) throw new Error('Unknown character ' + c)\n    chk = polymodStep(chk) ^ v\n\n    // not in the checksum?\n    if (i + 6 >= wordChars.length) continue\n    words.push(v)\n  }\n\n  if (chk !== 1) throw new Error('Invalid checksum for ' + str)\n  return { prefix: prefix, words: words }\n}\n\nfunction convert (data, inBits, outBits, pad) {\n  var value = 0\n  var bits = 0\n  var maxV = (1 << outBits) - 1\n\n  var result = []\n  for (var i = 0; i < data.length; ++i) {\n    value = (value << inBits) | data[i]\n    bits += inBits\n\n    while (bits >= outBits) {\n      bits -= outBits\n      result.push((value >> bits) & maxV)\n    }\n  }\n\n  if (pad) {\n    if (bits > 0) {\n      result.push((value << (outBits - bits)) & maxV)\n    }\n  } else {\n    if (bits >= inBits) throw new Error('Excess padding')\n    if ((value << (outBits - bits)) & maxV) throw new Error('Non-zero padding')\n  }\n\n  return result\n}\n\nfunction toWords (bytes) {\n  return convert(bytes, 8, 5, true)\n}\n\nfunction fromWords (words) {\n  return convert(words, 5, 8, false)\n}\n\nmodule.exports = {\n  decode: decode,\n  encode: encode,\n  toWords: toWords,\n  fromWords: fromWords\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bech32/index.js\n// module id = 622\n// module chunks = 0\n\n//# sourceURL=../node_modules/bech32/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// FIXME: Kind of a weird way to throw exceptions, consider removing\nvar assert = __webpack_require__(16)\nvar BigInteger = __webpack_require__(340)\n\n/**\n * Turns a byte array into a big integer.\n *\n * This function will interpret a byte array as a big integer in big\n * endian notation.\n */\nBigInteger.fromByteArrayUnsigned = function(byteArray) {\n  // BigInteger expects a DER integer conformant byte array\n  if (byteArray[0] & 0x80) {\n    return new BigInteger([0].concat(byteArray))\n  }\n\n  return new BigInteger(byteArray)\n}\n\n/**\n * Returns a byte array representation of the big integer.\n *\n * This returns the absolute of the contained value in big endian\n * form. A value of zero results in an empty array.\n */\nBigInteger.prototype.toByteArrayUnsigned = function() {\n  var byteArray = this.toByteArray()\n  return byteArray[0] === 0 ? byteArray.slice(1) : byteArray\n}\n\nBigInteger.fromDERInteger = function(byteArray) {\n  return new BigInteger(byteArray)\n}\n\n/*\n * Converts BigInteger to a DER integer representation.\n *\n * The format for this value uses the most significant bit as a sign\n * bit.  If the most significant bit is already set and the integer is\n * positive, a 0x00 is prepended.\n *\n * Examples:\n *\n *      0 =>     0x00\n *      1 =>     0x01\n *     -1 =>     0xff\n *    127 =>     0x7f\n *   -127 =>     0x81\n *    128 =>   0x0080\n *   -128 =>     0x80\n *    255 =>   0x00ff\n *   -255 =>   0xff01\n *  16300 =>   0x3fac\n * -16300 =>   0xc054\n *  62300 => 0x00f35c\n * -62300 => 0xff0ca4\n*/\nBigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray\n\nBigInteger.fromBuffer = function(buffer) {\n  // BigInteger expects a DER integer conformant byte array\n  if (buffer[0] & 0x80) {\n    var byteArray = Array.prototype.slice.call(buffer)\n\n    return new BigInteger([0].concat(byteArray))\n  }\n\n  return new BigInteger(buffer)\n}\n\nBigInteger.fromHex = function(hex) {\n  if (hex === '') return BigInteger.ZERO\n\n  assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')\n  assert.equal(hex.length % 2, 0, 'Incomplete hex')\n  return new BigInteger(hex, 16)\n}\n\nBigInteger.prototype.toBuffer = function(size) {\n  var byteArray = this.toByteArrayUnsigned()\n  var zeros = []\n\n  var padding = size - byteArray.length\n  while (zeros.length < padding) zeros.push(0)\n\n  return new Buffer(zeros.concat(byteArray))\n}\n\nBigInteger.prototype.toHex = function(size) {\n  return this.toBuffer(size).toString('hex')\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bigi/lib/convert.js\n// module id = 623\n// module chunks = 0\n\n//# sourceURL=../node_modules/bigi/lib/convert.js")},function(module,exports){eval('module.exports = {"_from":"bigi@^1.4.0","_id":"bigi@1.4.2","_inBundle":false,"_integrity":"sha1-nGZalfiLiwj8Bc/XMfVhhZ1yWCU=","_location":"/bigi","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"bigi@^1.4.0","name":"bigi","escapedName":"bigi","rawSpec":"^1.4.0","saveSpec":null,"fetchSpec":"^1.4.0"},"_requiredBy":["/bitcoinjs-lib","/ecurve"],"_resolved":"https://registry.npmjs.org/bigi/-/bigi-1.4.2.tgz","_shasum":"9c665a95f88b8b08fc05cfd731f561859d725825","_spec":"bigi@^1.4.0","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/bitcoinjs-lib","bugs":{"url":"https://github.com/cryptocoinjs/bigi/issues"},"bundleDependencies":false,"dependencies":{},"deprecated":false,"description":"Big integers.","devDependencies":{"coveralls":"^2.11.2","istanbul":"^0.3.5","jshint":"^2.5.1","mocha":"^2.1.0","mochify":"^2.1.0"},"homepage":"https://github.com/cryptocoinjs/bigi#readme","keywords":["cryptography","math","bitcoin","arbitrary","precision","arithmetic","big","integer","int","number","biginteger","bigint","bignumber","decimal","float"],"main":"./lib/index.js","name":"bigi","repository":{"url":"git+https://github.com/cryptocoinjs/bigi.git","type":"git"},"scripts":{"browser-test":"mochify --wd -R spec","coverage":"istanbul cover ./node_modules/.bin/_mocha -- --reporter list test/*.js","coveralls":"npm run-script coverage && node ./node_modules/.bin/coveralls < coverage/lcov.info","jshint":"jshint --config jshint.json lib/*.js ; true","test":"_mocha -- test/*.js","unit":"mocha"},"testling":{"files":"test/*.js","harness":"mocha","browsers":["ie/9..latest","firefox/latest","chrome/latest","safari/6.0..latest","iphone/6.0..latest","android-browser/4.2..latest"]},"version":"1.4.2"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bigi/package.json\n// module id = 624\n// module chunks = 0\n\n//# sourceURL=../node_modules/bigi/package.json')},function(module,exports,__webpack_require__){eval("var OPS = __webpack_require__(33)\n\nvar map = {}\nfor (var op in OPS) {\n  var code = OPS[op]\n  map[code] = op\n}\n\nmodule.exports = map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoin-ops/map.js\n// module id = 625\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoin-ops/map.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar bcrypto = __webpack_require__(114)\nvar fastMerkleRoot = __webpack_require__(1095)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar varuint = __webpack_require__(313)\n\nvar Transaction = __webpack_require__(235)\n\nfunction Block () {\n  this.version = 1\n  this.prevHash = null\n  this.merkleRoot = null\n  this.timestamp = 0\n  this.bits = 0\n  this.nonce = 0\n}\n\nBlock.fromBuffer = function (buffer) {\n  if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)')\n\n  var offset = 0\n  function readSlice (n) {\n    offset += n\n    return buffer.slice(offset - n, offset)\n  }\n\n  function readUInt32 () {\n    var i = buffer.readUInt32LE(offset)\n    offset += 4\n    return i\n  }\n\n  function readInt32 () {\n    var i = buffer.readInt32LE(offset)\n    offset += 4\n    return i\n  }\n\n  var block = new Block()\n  block.version = readInt32()\n  block.prevHash = readSlice(32)\n  block.merkleRoot = readSlice(32)\n  block.timestamp = readUInt32()\n  block.bits = readUInt32()\n  block.nonce = readUInt32()\n\n  if (buffer.length === 80) return block\n\n  function readVarInt () {\n    var vi = varuint.decode(buffer, offset)\n    offset += varuint.decode.bytes\n    return vi\n  }\n\n  function readTransaction () {\n    var tx = Transaction.fromBuffer(buffer.slice(offset), true)\n    offset += tx.byteLength()\n    return tx\n  }\n\n  var nTransactions = readVarInt()\n  block.transactions = []\n\n  for (var i = 0; i < nTransactions; ++i) {\n    var tx = readTransaction()\n    block.transactions.push(tx)\n  }\n\n  return block\n}\n\nBlock.prototype.byteLength = function (headersOnly) {\n  if (headersOnly || !this.transactions) return 80\n\n  return 80 + varuint.encodingLength(this.transactions.length) + this.transactions.reduce(function (a, x) {\n    return a + x.byteLength()\n  }, 0)\n}\n\nBlock.fromHex = function (hex) {\n  return Block.fromBuffer(Buffer.from(hex, 'hex'))\n}\n\nBlock.prototype.getHash = function () {\n  return bcrypto.hash256(this.toBuffer(true))\n}\n\nBlock.prototype.getId = function () {\n  return this.getHash().reverse().toString('hex')\n}\n\nBlock.prototype.getUTCDate = function () {\n  var date = new Date(0) // epoch\n  date.setUTCSeconds(this.timestamp)\n\n  return date\n}\n\n// TODO: buffer, offset compatibility\nBlock.prototype.toBuffer = function (headersOnly) {\n  var buffer = Buffer.allocUnsafe(this.byteLength(headersOnly))\n\n  var offset = 0\n  function writeSlice (slice) {\n    slice.copy(buffer, offset)\n    offset += slice.length\n  }\n\n  function writeInt32 (i) {\n    buffer.writeInt32LE(i, offset)\n    offset += 4\n  }\n  function writeUInt32 (i) {\n    buffer.writeUInt32LE(i, offset)\n    offset += 4\n  }\n\n  writeInt32(this.version)\n  writeSlice(this.prevHash)\n  writeSlice(this.merkleRoot)\n  writeUInt32(this.timestamp)\n  writeUInt32(this.bits)\n  writeUInt32(this.nonce)\n\n  if (headersOnly || !this.transactions) return buffer\n\n  varuint.encode(this.transactions.length, buffer, offset)\n  offset += varuint.encode.bytes\n\n  this.transactions.forEach(function (tx) {\n    var txSize = tx.byteLength() // TODO: extract from toBuffer?\n    tx.toBuffer(buffer, offset)\n    offset += txSize\n  })\n\n  return buffer\n}\n\nBlock.prototype.toHex = function (headersOnly) {\n  return this.toBuffer(headersOnly).toString('hex')\n}\n\nBlock.calculateTarget = function (bits) {\n  var exponent = ((bits & 0xff000000) >> 24) - 3\n  var mantissa = bits & 0x007fffff\n  var target = Buffer.alloc(32, 0)\n  target.writeUInt32BE(mantissa, 28 - exponent)\n  return target\n}\n\nBlock.calculateMerkleRoot = function (transactions) {\n  typeforce([{ getHash: types.Function }], transactions)\n  if (transactions.length === 0) throw TypeError('Cannot compute merkle root for zero transactions')\n\n  var hashes = transactions.map(function (transaction) {\n    return transaction.getHash()\n  })\n\n  return fastMerkleRoot(hashes, bcrypto.hash256)\n}\n\nBlock.prototype.checkMerkleRoot = function () {\n  if (!this.transactions) return false\n\n  var actualMerkleRoot = Block.calculateMerkleRoot(this.transactions)\n  return this.merkleRoot.compare(actualMerkleRoot) === 0\n}\n\nBlock.prototype.checkProofOfWork = function () {\n  var hash = this.getHash().reverse()\n  var target = Block.calculateTarget(this.bits)\n\n  return hash.compare(target) <= 0\n}\n\nmodule.exports = Block\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/block.js\n// module id = 626\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/block.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar createHmac = __webpack_require__(140)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\n\nvar BigInteger = __webpack_require__(88)\nvar ECSignature = __webpack_require__(230)\n\nvar ZERO = Buffer.alloc(1, 0)\nvar ONE = Buffer.alloc(1, 1)\n\nvar ecurve = __webpack_require__(257)\nvar secp256k1 = ecurve.getCurveByName('secp256k1')\n\n// https://tools.ietf.org/html/rfc6979#section-3.2\nfunction deterministicGenerateK (hash, x, checkSig) {\n  typeforce(types.tuple(\n    types.Hash256bit,\n    types.Buffer256bit,\n    types.Function\n  ), arguments)\n\n  // Step A, ignored as hash already provided\n  // Step B\n  // Step C\n  var k = Buffer.alloc(32, 0)\n  var v = Buffer.alloc(32, 1)\n\n  // Step D\n  k = createHmac('sha256', k)\n    .update(v)\n    .update(ZERO)\n    .update(x)\n    .update(hash)\n    .digest()\n\n  // Step E\n  v = createHmac('sha256', k).update(v).digest()\n\n  // Step F\n  k = createHmac('sha256', k)\n    .update(v)\n    .update(ONE)\n    .update(x)\n    .update(hash)\n    .digest()\n\n  // Step G\n  v = createHmac('sha256', k).update(v).digest()\n\n  // Step H1/H2a, ignored as tlen === qlen (256 bit)\n  // Step H2b\n  v = createHmac('sha256', k).update(v).digest()\n\n  var T = BigInteger.fromBuffer(v)\n\n  // Step H3, repeat until T is within the interval [1, n - 1] and is suitable for ECDSA\n  while (T.signum() <= 0 || T.compareTo(secp256k1.n) >= 0 || !checkSig(T)) {\n    k = createHmac('sha256', k)\n      .update(v)\n      .update(ZERO)\n      .digest()\n\n    v = createHmac('sha256', k).update(v).digest()\n\n    // Step H1/H2a, again, ignored as tlen === qlen (256 bit)\n    // Step H2b again\n    v = createHmac('sha256', k).update(v).digest()\n    T = BigInteger.fromBuffer(v)\n  }\n\n  return T\n}\n\nvar N_OVER_TWO = secp256k1.n.shiftRight(1)\n\nfunction sign (hash, d) {\n  typeforce(types.tuple(types.Hash256bit, types.BigInt), arguments)\n\n  var x = d.toBuffer(32)\n  var e = BigInteger.fromBuffer(hash)\n  var n = secp256k1.n\n  var G = secp256k1.G\n\n  var r, s\n  deterministicGenerateK(hash, x, function (k) {\n    var Q = G.multiply(k)\n\n    if (secp256k1.isInfinity(Q)) return false\n\n    r = Q.affineX.mod(n)\n    if (r.signum() === 0) return false\n\n    s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)\n    if (s.signum() === 0) return false\n\n    return true\n  })\n\n  // enforce low S values, see bip62: 'low s values in signatures'\n  if (s.compareTo(N_OVER_TWO) > 0) {\n    s = n.subtract(s)\n  }\n\n  return new ECSignature(r, s)\n}\n\nfunction verify (hash, signature, Q) {\n  typeforce(types.tuple(\n    types.Hash256bit,\n    types.ECSignature,\n    types.ECPoint\n  ), arguments)\n\n  var n = secp256k1.n\n  var G = secp256k1.G\n\n  var r = signature.r\n  var s = signature.s\n\n  // 1.4.1 Enforce r and s are both integers in the interval [1, n − 1]\n  if (r.signum() <= 0 || r.compareTo(n) >= 0) return false\n  if (s.signum() <= 0 || s.compareTo(n) >= 0) return false\n\n  // 1.4.2 H = Hash(M), already done by the user\n  // 1.4.3 e = H\n  var e = BigInteger.fromBuffer(hash)\n\n  // Compute s^-1\n  var sInv = s.modInverse(n)\n\n  // 1.4.4 Compute u1 = es^−1 mod n\n  //               u2 = rs^−1 mod n\n  var u1 = e.multiply(sInv).mod(n)\n  var u2 = r.multiply(sInv).mod(n)\n\n  // 1.4.5 Compute R = (xR, yR)\n  //               R = u1G + u2Q\n  var R = G.multiplyTwo(u1, Q, u2)\n\n  // 1.4.5 (cont.) Enforce R is not at infinity\n  if (secp256k1.isInfinity(R)) return false\n\n  // 1.4.6 Convert the field element R.x to an integer\n  var xR = R.affineX\n\n  // 1.4.7 Set v = xR mod n\n  var v = xR.mod(n)\n\n  // 1.4.8 If v = r, output \"valid\", and if v != r, output \"invalid\"\n  return v.equals(r)\n}\n\nmodule.exports = {\n  deterministicGenerateK: deterministicGenerateK,\n  sign: sign,\n  verify: verify,\n\n  // TODO: remove\n  __curve: secp256k1\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/ecdsa.js\n// module id = 627\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/ecdsa.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar base58check = __webpack_require__(239)\nvar bcrypto = __webpack_require__(114)\nvar createHmac = __webpack_require__(140)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar NETWORKS = __webpack_require__(133)\n\nvar BigInteger = __webpack_require__(88)\nvar ECPair = __webpack_require__(229)\n\nvar ecurve = __webpack_require__(257)\nvar curve = ecurve.getCurveByName('secp256k1')\n\nfunction HDNode (keyPair, chainCode) {\n  typeforce(types.tuple('ECPair', types.Buffer256bit), arguments)\n\n  if (!keyPair.compressed) throw new TypeError('BIP32 only allows compressed keyPairs')\n\n  this.keyPair = keyPair\n  this.chainCode = chainCode\n  this.depth = 0\n  this.index = 0\n  this.parentFingerprint = 0x00000000\n}\n\nHDNode.HIGHEST_BIT = 0x80000000\nHDNode.LENGTH = 78\nHDNode.MASTER_SECRET = Buffer.from('Bitcoin seed', 'utf8')\n\nHDNode.fromSeedBuffer = function (seed, network) {\n  typeforce(types.tuple(types.Buffer, types.maybe(types.Network)), arguments)\n\n  if (seed.length < 16) throw new TypeError('Seed should be at least 128 bits')\n  if (seed.length > 64) throw new TypeError('Seed should be at most 512 bits')\n\n  var I = createHmac('sha512', HDNode.MASTER_SECRET).update(seed).digest()\n  var IL = I.slice(0, 32)\n  var IR = I.slice(32)\n\n  // In case IL is 0 or >= n, the master key is invalid\n  // This is handled by the ECPair constructor\n  var pIL = BigInteger.fromBuffer(IL)\n  var keyPair = new ECPair(pIL, null, {\n    network: network\n  })\n\n  return new HDNode(keyPair, IR)\n}\n\nHDNode.fromSeedHex = function (hex, network) {\n  return HDNode.fromSeedBuffer(Buffer.from(hex, 'hex'), network)\n}\n\nHDNode.fromBase58 = function (string, networks) {\n  var buffer = base58check.decode(string)\n  if (buffer.length !== 78) throw new Error('Invalid buffer length')\n\n  // 4 bytes: version bytes\n  var version = buffer.readUInt32BE(0)\n  var network\n\n  // list of networks?\n  if (Array.isArray(networks)) {\n    network = networks.filter(function (x) {\n      return version === x.bip32.private ||\n             version === x.bip32.public\n    }).pop()\n\n    if (!network) throw new Error('Unknown network version')\n\n  // otherwise, assume a network object (or default to bitcoin)\n  } else {\n    network = networks || NETWORKS.bitcoin\n  }\n\n  if (version !== network.bip32.private &&\n    version !== network.bip32.public) throw new Error('Invalid network version')\n\n  // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...\n  var depth = buffer[4]\n\n  // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n  var parentFingerprint = buffer.readUInt32BE(5)\n  if (depth === 0) {\n    if (parentFingerprint !== 0x00000000) throw new Error('Invalid parent fingerprint')\n  }\n\n  // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n  // This is encoded in MSB order. (0x00000000 if master key)\n  var index = buffer.readUInt32BE(9)\n  if (depth === 0 && index !== 0) throw new Error('Invalid index')\n\n  // 32 bytes: the chain code\n  var chainCode = buffer.slice(13, 45)\n  var keyPair\n\n  // 33 bytes: private key data (0x00 + k)\n  if (version === network.bip32.private) {\n    if (buffer.readUInt8(45) !== 0x00) throw new Error('Invalid private key')\n\n    var d = BigInteger.fromBuffer(buffer.slice(46, 78))\n    keyPair = new ECPair(d, null, { network: network })\n\n  // 33 bytes: public key data (0x02 + X or 0x03 + X)\n  } else {\n    var Q = ecurve.Point.decodeFrom(curve, buffer.slice(45, 78))\n    // Q.compressed is assumed, if somehow this assumption is broken, `new HDNode` will throw\n\n    // Verify that the X coordinate in the public point corresponds to a point on the curve.\n    // If not, the extended public key is invalid.\n    curve.validate(Q)\n\n    keyPair = new ECPair(null, Q, { network: network })\n  }\n\n  var hd = new HDNode(keyPair, chainCode)\n  hd.depth = depth\n  hd.index = index\n  hd.parentFingerprint = parentFingerprint\n\n  return hd\n}\n\nHDNode.prototype.getAddress = function () {\n  return this.keyPair.getAddress()\n}\n\nHDNode.prototype.getIdentifier = function () {\n  return bcrypto.hash160(this.keyPair.getPublicKeyBuffer())\n}\n\nHDNode.prototype.getFingerprint = function () {\n  return this.getIdentifier().slice(0, 4)\n}\n\nHDNode.prototype.getNetwork = function () {\n  return this.keyPair.getNetwork()\n}\n\nHDNode.prototype.getPublicKeyBuffer = function () {\n  return this.keyPair.getPublicKeyBuffer()\n}\n\nHDNode.prototype.neutered = function () {\n  var neuteredKeyPair = new ECPair(null, this.keyPair.Q, {\n    network: this.keyPair.network\n  })\n\n  var neutered = new HDNode(neuteredKeyPair, this.chainCode)\n  neutered.depth = this.depth\n  neutered.index = this.index\n  neutered.parentFingerprint = this.parentFingerprint\n\n  return neutered\n}\n\nHDNode.prototype.sign = function (hash) {\n  return this.keyPair.sign(hash)\n}\n\nHDNode.prototype.verify = function (hash, signature) {\n  return this.keyPair.verify(hash, signature)\n}\n\nHDNode.prototype.toBase58 = function (__isPrivate) {\n  if (__isPrivate !== undefined) throw new TypeError('Unsupported argument in 2.0.0')\n\n  // Version\n  var network = this.keyPair.network\n  var version = (!this.isNeutered()) ? network.bip32.private : network.bip32.public\n  var buffer = Buffer.allocUnsafe(78)\n\n  // 4 bytes: version bytes\n  buffer.writeUInt32BE(version, 0)\n\n  // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....\n  buffer.writeUInt8(this.depth, 4)\n\n  // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)\n  buffer.writeUInt32BE(this.parentFingerprint, 5)\n\n  // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.\n  // This is encoded in big endian. (0x00000000 if master key)\n  buffer.writeUInt32BE(this.index, 9)\n\n  // 32 bytes: the chain code\n  this.chainCode.copy(buffer, 13)\n\n  // 33 bytes: the public key or private key data\n  if (!this.isNeutered()) {\n    // 0x00 + k for private keys\n    buffer.writeUInt8(0, 45)\n    this.keyPair.d.toBuffer(32).copy(buffer, 46)\n\n  // 33 bytes: the public key\n  } else {\n    // X9.62 encoding for public keys\n    this.keyPair.getPublicKeyBuffer().copy(buffer, 45)\n  }\n\n  return base58check.encode(buffer)\n}\n\n// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions\nHDNode.prototype.derive = function (index) {\n  typeforce(types.UInt32, index)\n\n  var isHardened = index >= HDNode.HIGHEST_BIT\n  var data = Buffer.allocUnsafe(37)\n\n  // Hardened child\n  if (isHardened) {\n    if (this.isNeutered()) throw new TypeError('Could not derive hardened child key')\n\n    // data = 0x00 || ser256(kpar) || ser32(index)\n    data[0] = 0x00\n    this.keyPair.d.toBuffer(32).copy(data, 1)\n    data.writeUInt32BE(index, 33)\n\n  // Normal child\n  } else {\n    // data = serP(point(kpar)) || ser32(index)\n    //      = serP(Kpar) || ser32(index)\n    this.keyPair.getPublicKeyBuffer().copy(data, 0)\n    data.writeUInt32BE(index, 33)\n  }\n\n  var I = createHmac('sha512', this.chainCode).update(data).digest()\n  var IL = I.slice(0, 32)\n  var IR = I.slice(32)\n\n  var pIL = BigInteger.fromBuffer(IL)\n\n  // In case parse256(IL) >= n, proceed with the next value for i\n  if (pIL.compareTo(curve.n) >= 0) {\n    return this.derive(index + 1)\n  }\n\n  // Private parent key -> private child key\n  var derivedKeyPair\n  if (!this.isNeutered()) {\n    // ki = parse256(IL) + kpar (mod n)\n    var ki = pIL.add(this.keyPair.d).mod(curve.n)\n\n    // In case ki == 0, proceed with the next value for i\n    if (ki.signum() === 0) {\n      return this.derive(index + 1)\n    }\n\n    derivedKeyPair = new ECPair(ki, null, {\n      network: this.keyPair.network\n    })\n\n  // Public parent key -> public child key\n  } else {\n    // Ki = point(parse256(IL)) + Kpar\n    //    = G*IL + Kpar\n    var Ki = curve.G.multiply(pIL).add(this.keyPair.Q)\n\n    // In case Ki is the point at infinity, proceed with the next value for i\n    if (curve.isInfinity(Ki)) {\n      return this.derive(index + 1)\n    }\n\n    derivedKeyPair = new ECPair(null, Ki, {\n      network: this.keyPair.network\n    })\n  }\n\n  var hd = new HDNode(derivedKeyPair, IR)\n  hd.depth = this.depth + 1\n  hd.index = index\n  hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)\n\n  return hd\n}\n\nHDNode.prototype.deriveHardened = function (index) {\n  typeforce(types.UInt31, index)\n\n  // Only derives hardened private keys by default\n  return this.derive(index + HDNode.HIGHEST_BIT)\n}\n\n// Private === not neutered\n// Public === neutered\nHDNode.prototype.isNeutered = function () {\n  return !(this.keyPair.d)\n}\n\nHDNode.prototype.derivePath = function (path) {\n  typeforce(types.BIP32Path, path)\n\n  var splitPath = path.split('/')\n  if (splitPath[0] === 'm') {\n    if (this.parentFingerprint) {\n      throw new Error('Not a master node')\n    }\n\n    splitPath = splitPath.slice(1)\n  }\n\n  return splitPath.reduce(function (prevHd, indexStr) {\n    var index\n    if (indexStr.slice(-1) === \"'\") {\n      index = parseInt(indexStr.slice(0, -1), 10)\n      return prevHd.deriveHardened(index)\n    } else {\n      index = parseInt(indexStr, 10)\n      return prevHd.derive(index)\n    }\n  }, this)\n}\n\nmodule.exports = HDNode\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/hdnode.js\n// module id = 628\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/hdnode.js")},function(module,exports,__webpack_require__){eval("var script = __webpack_require__(23)\n\nvar templates = __webpack_require__(231)\nfor (var key in templates) {\n  script[key] = templates[key]\n}\n\nmodule.exports = {\n  bufferutils: __webpack_require__(341), // TODO: remove in 4.0.0\n\n  Block: __webpack_require__(626),\n  ECPair: __webpack_require__(229),\n  ECSignature: __webpack_require__(230),\n  HDNode: __webpack_require__(628),\n  Transaction: __webpack_require__(235),\n  TransactionBuilder: __webpack_require__(645),\n\n  address: __webpack_require__(228),\n  crypto: __webpack_require__(114),\n  networks: __webpack_require__(133),\n  opcodes: __webpack_require__(33),\n  script: script\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/index.js\n// module id = 629\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/index.js")},function(module,exports,__webpack_require__){eval("// OP_0 [signatures ...]\n\nvar Buffer = __webpack_require__(1).Buffer\nvar bscript = __webpack_require__(23)\nvar p2mso = __webpack_require__(343)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction partialSignature (value) {\n  return value === OPS.OP_0 || bscript.isCanonicalSignature(value)\n}\n\nfunction check (script, allowIncomplete) {\n  var chunks = bscript.decompile(script)\n  if (chunks.length < 2) return false\n  if (chunks[0] !== OPS.OP_0) return false\n\n  if (allowIncomplete) {\n    return chunks.slice(1).every(partialSignature)\n  }\n\n  return chunks.slice(1).every(bscript.isCanonicalSignature)\n}\ncheck.toJSON = function () { return 'multisig input' }\n\nvar EMPTY_BUFFER = Buffer.allocUnsafe(0)\n\nfunction encodeStack (signatures, scriptPubKey) {\n  typeforce([partialSignature], signatures)\n\n  if (scriptPubKey) {\n    var scriptData = p2mso.decode(scriptPubKey)\n\n    if (signatures.length < scriptData.m) {\n      throw new TypeError('Not enough signatures provided')\n    }\n\n    if (signatures.length > scriptData.pubKeys.length) {\n      throw new TypeError('Too many signatures provided')\n    }\n  }\n\n  return [].concat(EMPTY_BUFFER, signatures.map(function (sig) {\n    if (sig === OPS.OP_0) {\n      return EMPTY_BUFFER\n    }\n    return sig\n  }))\n}\n\nfunction encode (signatures, scriptPubKey) {\n  return bscript.compile(encodeStack(signatures, scriptPubKey))\n}\n\nfunction decodeStack (stack, allowIncomplete) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack, allowIncomplete)\n  return stack.slice(1)\n}\n\nfunction decode (buffer, allowIncomplete) {\n  var stack = bscript.decompile(buffer)\n  return decodeStack(stack, allowIncomplete)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  decodeStack: decodeStack,\n  encode: encode,\n  encodeStack: encodeStack\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/multisig/input.js\n// module id = 630\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/multisig/input.js")},function(module,exports,__webpack_require__){eval("// OP_RETURN {data}\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length > 1 &&\n    buffer[0] === OPS.OP_RETURN\n}\ncheck.toJSON = function () { return 'null data output' }\n\nfunction encode (data) {\n  typeforce(types.Buffer, data)\n\n  return bscript.compile([OPS.OP_RETURN, data])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return buffer.slice(2)\n}\n\nmodule.exports = {\n  output: {\n    check: check,\n    decode: decode,\n    encode: encode\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/nulldata.js\n// module id = 631\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/nulldata.js")},function(module,exports,__webpack_require__){eval("// {signature}\n\nvar bscript = __webpack_require__(23)\nvar typeforce = __webpack_require__(19)\n\nfunction check (script) {\n  var chunks = bscript.decompile(script)\n\n  return chunks.length === 1 &&\n    bscript.isCanonicalSignature(chunks[0])\n}\ncheck.toJSON = function () { return 'pubKey input' }\n\nfunction encodeStack (signature) {\n  typeforce(bscript.isCanonicalSignature, signature)\n  return [signature]\n}\n\nfunction encode (signature) {\n  return bscript.compile(encodeStack(signature))\n}\n\nfunction decodeStack (stack) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack)\n  return stack[0]\n}\n\nfunction decode (buffer) {\n  var stack = bscript.decompile(buffer)\n  return decodeStack(stack)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  decodeStack: decodeStack,\n  encode: encode,\n  encodeStack: encodeStack\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkey/input.js\n// module id = 632\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkey/input.js")},function(module,exports,__webpack_require__){eval("// {pubKey} OP_CHECKSIG\n\nvar bscript = __webpack_require__(23)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var chunks = bscript.decompile(script)\n\n  return chunks.length === 2 &&\n    bscript.isCanonicalPubKey(chunks[0]) &&\n    chunks[1] === OPS.OP_CHECKSIG\n}\ncheck.toJSON = function () { return 'pubKey output' }\n\nfunction encode (pubKey) {\n  typeforce(bscript.isCanonicalPubKey, pubKey)\n\n  return bscript.compile([pubKey, OPS.OP_CHECKSIG])\n}\n\nfunction decode (buffer) {\n  var chunks = bscript.decompile(buffer)\n  typeforce(check, chunks)\n\n  return chunks[0]\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkey/output.js\n// module id = 633\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkey/output.js")},function(module,exports,__webpack_require__){eval("// {signature} {pubKey}\n\nvar bscript = __webpack_require__(23)\nvar typeforce = __webpack_require__(19)\n\nfunction check (script) {\n  var chunks = bscript.decompile(script)\n\n  return chunks.length === 2 &&\n    bscript.isCanonicalSignature(chunks[0]) &&\n    bscript.isCanonicalPubKey(chunks[1])\n}\ncheck.toJSON = function () { return 'pubKeyHash input' }\n\nfunction encodeStack (signature, pubKey) {\n  typeforce({\n    signature: bscript.isCanonicalSignature,\n    pubKey: bscript.isCanonicalPubKey\n  }, {\n    signature: signature,\n    pubKey: pubKey\n  })\n\n  return [signature, pubKey]\n}\n\nfunction encode (signature, pubKey) {\n  return bscript.compile(encodeStack(signature, pubKey))\n}\n\nfunction decodeStack (stack) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack)\n\n  return {\n    signature: stack[0],\n    pubKey: stack[1]\n  }\n}\n\nfunction decode (buffer) {\n  var stack = bscript.decompile(buffer)\n  return decodeStack(stack)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  decodeStack: decodeStack,\n  encode: encode,\n  encodeStack: encodeStack\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkeyhash/input.js\n// module id = 634\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkeyhash/input.js")},function(module,exports,__webpack_require__){eval("// OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length === 25 &&\n    buffer[0] === OPS.OP_DUP &&\n    buffer[1] === OPS.OP_HASH160 &&\n    buffer[2] === 0x14 &&\n    buffer[23] === OPS.OP_EQUALVERIFY &&\n    buffer[24] === OPS.OP_CHECKSIG\n}\ncheck.toJSON = function () { return 'pubKeyHash output' }\n\nfunction encode (pubKeyHash) {\n  typeforce(types.Hash160bit, pubKeyHash)\n\n  return bscript.compile([\n    OPS.OP_DUP,\n    OPS.OP_HASH160,\n    pubKeyHash,\n    OPS.OP_EQUALVERIFY,\n    OPS.OP_CHECKSIG\n  ])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return buffer.slice(3, 23)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/pubkeyhash/output.js\n// module id = 635\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/pubkeyhash/output.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(637),\n  output: __webpack_require__(638)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/scripthash/index.js\n// module id = 636\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/scripthash/index.js")},function(module,exports,__webpack_require__){eval("// <scriptSig> {serialized scriptPubKey script}\n\nvar Buffer = __webpack_require__(1).Buffer\nvar bscript = __webpack_require__(23)\nvar typeforce = __webpack_require__(19)\n\nvar p2ms = __webpack_require__(232)\nvar p2pk = __webpack_require__(233)\nvar p2pkh = __webpack_require__(234)\nvar p2wpkho = __webpack_require__(344)\nvar p2wsho = __webpack_require__(345)\n\nfunction check (script, allowIncomplete) {\n  var chunks = bscript.decompile(script)\n  if (chunks.length < 1) return false\n\n  var lastChunk = chunks[chunks.length - 1]\n  if (!Buffer.isBuffer(lastChunk)) return false\n\n  var scriptSigChunks = bscript.decompile(bscript.compile(chunks.slice(0, -1)))\n  var redeemScriptChunks = bscript.decompile(lastChunk)\n\n  // is redeemScript a valid script?\n  if (redeemScriptChunks.length === 0) return false\n\n  // is redeemScriptSig push only?\n  if (!bscript.isPushOnly(scriptSigChunks)) return false\n\n  // is witness?\n  if (chunks.length === 1) {\n    return p2wsho.check(redeemScriptChunks) ||\n      p2wpkho.check(redeemScriptChunks)\n  }\n\n  // match types\n  if (p2pkh.input.check(scriptSigChunks) &&\n    p2pkh.output.check(redeemScriptChunks)) return true\n\n  if (p2ms.input.check(scriptSigChunks, allowIncomplete) &&\n    p2ms.output.check(redeemScriptChunks)) return true\n\n  if (p2pk.input.check(scriptSigChunks) &&\n    p2pk.output.check(redeemScriptChunks)) return true\n\n  return false\n}\ncheck.toJSON = function () { return 'scriptHash input' }\n\nfunction encodeStack (redeemScriptStack, redeemScript) {\n  var serializedScriptPubKey = bscript.compile(redeemScript)\n\n  return [].concat(redeemScriptStack, serializedScriptPubKey)\n}\n\nfunction encode (redeemScriptSig, redeemScript) {\n  var redeemScriptStack = bscript.decompile(redeemScriptSig)\n\n  return bscript.compile(encodeStack(redeemScriptStack, redeemScript))\n}\n\nfunction decodeStack (stack) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack)\n\n  return {\n    redeemScriptStack: stack.slice(0, -1),\n    redeemScript: stack[stack.length - 1]\n  }\n}\n\nfunction decode (buffer) {\n  var stack = bscript.decompile(buffer)\n  var result = decodeStack(stack)\n  result.redeemScriptSig = bscript.compile(result.redeemScriptStack)\n  delete result.redeemScriptStack\n  return result\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  decodeStack: decodeStack,\n  encode: encode,\n  encodeStack: encodeStack\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/scripthash/input.js\n// module id = 637\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/scripthash/input.js")},function(module,exports,__webpack_require__){eval("// OP_HASH160 {scriptHash} OP_EQUAL\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length === 23 &&\n    buffer[0] === OPS.OP_HASH160 &&\n    buffer[1] === 0x14 &&\n    buffer[22] === OPS.OP_EQUAL\n}\ncheck.toJSON = function () { return 'scriptHash output' }\n\nfunction encode (scriptHash) {\n  typeforce(types.Hash160bit, scriptHash)\n\n  return bscript.compile([OPS.OP_HASH160, scriptHash, OPS.OP_EQUAL])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return buffer.slice(2, 22)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/scripthash/output.js\n// module id = 638\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/scripthash/output.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  output: __webpack_require__(640)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnesscommitment/index.js\n// module id = 639\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnesscommitment/index.js")},function(module,exports,__webpack_require__){eval("// OP_RETURN {aa21a9ed} {commitment}\n\nvar Buffer = __webpack_require__(1).Buffer\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\nvar OPS = __webpack_require__(33)\n\nvar HEADER = Buffer.from('aa21a9ed', 'hex')\n\nfunction check (script) {\n  var buffer = bscript.compile(script)\n\n  return buffer.length > 37 &&\n    buffer[0] === OPS.OP_RETURN &&\n    buffer[1] === 0x24 &&\n    buffer.slice(2, 6).equals(HEADER)\n}\n\ncheck.toJSON = function () { return 'Witness commitment output' }\n\nfunction encode (commitment) {\n  typeforce(types.Hash256bit, commitment)\n\n  var buffer = Buffer.allocUnsafe(36)\n  HEADER.copy(buffer, 0)\n  commitment.copy(buffer, 4)\n\n  return bscript.compile([OPS.OP_RETURN, buffer])\n}\n\nfunction decode (buffer) {\n  typeforce(check, buffer)\n\n  return bscript.decompile(buffer)[1].slice(4, 36)\n}\n\nmodule.exports = {\n  check: check,\n  decode: decode,\n  encode: encode\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnesscommitment/output.js\n// module id = 640\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnesscommitment/output.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(642),\n  output: __webpack_require__(344)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnesspubkeyhash/index.js\n// module id = 641\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnesspubkeyhash/index.js")},function(module,exports,__webpack_require__){eval("// {signature} {pubKey}\n\nvar bscript = __webpack_require__(23)\nvar typeforce = __webpack_require__(19)\n\nfunction isCompressedCanonicalPubKey (pubKey) {\n  return bscript.isCanonicalPubKey(pubKey) && pubKey.length === 33\n}\n\nfunction check (script) {\n  var chunks = bscript.decompile(script)\n\n  return chunks.length === 2 &&\n    bscript.isCanonicalSignature(chunks[0]) &&\n    isCompressedCanonicalPubKey(chunks[1])\n}\ncheck.toJSON = function () { return 'witnessPubKeyHash input' }\n\nfunction encodeStack (signature, pubKey) {\n  typeforce({\n    signature: bscript.isCanonicalSignature,\n    pubKey: isCompressedCanonicalPubKey\n  }, {\n    signature: signature,\n    pubKey: pubKey\n  })\n\n  return [signature, pubKey]\n}\n\nfunction decodeStack (stack) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack)\n\n  return {\n    signature: stack[0],\n    pubKey: stack[1]\n  }\n}\n\nmodule.exports = {\n  check: check,\n  decodeStack: decodeStack,\n  encodeStack: encodeStack\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnesspubkeyhash/input.js\n// module id = 642\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnesspubkeyhash/input.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n  input: __webpack_require__(644),\n  output: __webpack_require__(345)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnessscripthash/index.js\n// module id = 643\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnessscripthash/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// <scriptSig> {serialized scriptPubKey script}\n\nvar bscript = __webpack_require__(23)\nvar types = __webpack_require__(27)\nvar typeforce = __webpack_require__(19)\n\nvar p2ms = __webpack_require__(232)\nvar p2pk = __webpack_require__(233)\nvar p2pkh = __webpack_require__(234)\n\nfunction check (chunks, allowIncomplete) {\n  typeforce(types.Array, chunks)\n  if (chunks.length < 1) return false\n\n  var witnessScript = chunks[chunks.length - 1]\n  if (!Buffer.isBuffer(witnessScript)) return false\n\n  var witnessScriptChunks = bscript.decompile(witnessScript)\n\n  // is witnessScript a valid script?\n  if (witnessScriptChunks.length === 0) return false\n\n  var witnessRawScriptSig = bscript.compile(chunks.slice(0, -1))\n\n  // match types\n  if (p2pkh.input.check(witnessRawScriptSig) &&\n    p2pkh.output.check(witnessScriptChunks)) return true\n\n  if (p2ms.input.check(witnessRawScriptSig, allowIncomplete) &&\n    p2ms.output.check(witnessScriptChunks)) return true\n\n  if (p2pk.input.check(witnessRawScriptSig) &&\n    p2pk.output.check(witnessScriptChunks)) return true\n\n  return false\n}\ncheck.toJSON = function () { return 'witnessScriptHash input' }\n\nfunction encodeStack (witnessData, witnessScript) {\n  typeforce({\n    witnessData: [types.Buffer],\n    witnessScript: types.Buffer\n  }, {\n    witnessData: witnessData,\n    witnessScript: witnessScript\n  })\n\n  return [].concat(witnessData, witnessScript)\n}\n\nfunction decodeStack (stack) {\n  typeforce(typeforce.Array, stack)\n  typeforce(check, stack)\n  return {\n    witnessData: stack.slice(0, -1),\n    witnessScript: stack[stack.length - 1]\n  }\n}\n\nmodule.exports = {\n  check: check,\n  decodeStack: decodeStack,\n  encodeStack: encodeStack\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/templates/witnessscripthash/input.js\n// module id = 644\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/templates/witnessscripthash/input.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar baddress = __webpack_require__(228)\nvar bcrypto = __webpack_require__(114)\nvar bscript = __webpack_require__(23)\nvar btemplates = __webpack_require__(231)\nvar networks = __webpack_require__(133)\nvar ops = __webpack_require__(33)\nvar typeforce = __webpack_require__(19)\nvar types = __webpack_require__(27)\nvar scriptTypes = btemplates.types\nvar SIGNABLE = [btemplates.types.P2PKH, btemplates.types.P2PK, btemplates.types.MULTISIG]\nvar P2SH = SIGNABLE.concat([btemplates.types.P2WPKH, btemplates.types.P2WSH])\n\nvar ECPair = __webpack_require__(229)\nvar ECSignature = __webpack_require__(230)\nvar Transaction = __webpack_require__(235)\n\nfunction supportedType (type) {\n  return SIGNABLE.indexOf(type) !== -1\n}\n\nfunction supportedP2SHType (type) {\n  return P2SH.indexOf(type) !== -1\n}\n\nfunction extractChunks (type, chunks, script) {\n  var pubKeys = []\n  var signatures = []\n  switch (type) {\n    case scriptTypes.P2PKH:\n      // if (redeemScript) throw new Error('Nonstandard... P2SH(P2PKH)')\n      pubKeys = chunks.slice(1)\n      signatures = chunks.slice(0, 1)\n      break\n\n    case scriptTypes.P2PK:\n      pubKeys[0] = script ? btemplates.pubKey.output.decode(script) : undefined\n      signatures = chunks.slice(0, 1)\n      break\n\n    case scriptTypes.MULTISIG:\n      if (script) {\n        var multisig = btemplates.multisig.output.decode(script)\n        pubKeys = multisig.pubKeys\n      }\n\n      signatures = chunks.slice(1).map(function (chunk) {\n        return chunk.length === 0 ? undefined : chunk\n      })\n      break\n  }\n\n  return {\n    pubKeys: pubKeys,\n    signatures: signatures\n  }\n}\nfunction expandInput (scriptSig, witnessStack) {\n  if (scriptSig.length === 0 && witnessStack.length === 0) return {}\n\n  var prevOutScript\n  var prevOutType\n  var scriptType\n  var script\n  var redeemScript\n  var witnessScript\n  var witnessScriptType\n  var redeemScriptType\n  var witness = false\n  var p2wsh = false\n  var p2sh = false\n  var witnessProgram\n  var chunks\n\n  var scriptSigChunks = bscript.decompile(scriptSig)\n  var sigType = btemplates.classifyInput(scriptSigChunks, true)\n  if (sigType === scriptTypes.P2SH) {\n    p2sh = true\n    redeemScript = scriptSigChunks[scriptSigChunks.length - 1]\n    redeemScriptType = btemplates.classifyOutput(redeemScript)\n    prevOutScript = btemplates.scriptHash.output.encode(bcrypto.hash160(redeemScript))\n    prevOutType = scriptTypes.P2SH\n    script = redeemScript\n  }\n\n  var classifyWitness = btemplates.classifyWitness(witnessStack, true)\n  if (classifyWitness === scriptTypes.P2WSH) {\n    witnessScript = witnessStack[witnessStack.length - 1]\n    witnessScriptType = btemplates.classifyOutput(witnessScript)\n    p2wsh = true\n    witness = true\n    if (scriptSig.length === 0) {\n      prevOutScript = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))\n      prevOutType = scriptTypes.P2WSH\n      if (redeemScript !== undefined) {\n        throw new Error('Redeem script given when unnecessary')\n      }\n      // bare witness\n    } else {\n      if (!redeemScript) {\n        throw new Error('No redeemScript provided for P2WSH, but scriptSig non-empty')\n      }\n      witnessProgram = btemplates.witnessScriptHash.output.encode(bcrypto.sha256(witnessScript))\n      if (!redeemScript.equals(witnessProgram)) {\n        throw new Error('Redeem script didn\\'t match witnessScript')\n      }\n    }\n\n    if (!supportedType(btemplates.classifyOutput(witnessScript))) {\n      throw new Error('unsupported witness script')\n    }\n\n    script = witnessScript\n    scriptType = witnessScriptType\n    chunks = witnessStack.slice(0, -1)\n  } else if (classifyWitness === scriptTypes.P2WPKH) {\n    witness = true\n    var key = witnessStack[witnessStack.length - 1]\n    var keyHash = bcrypto.hash160(key)\n    if (scriptSig.length === 0) {\n      prevOutScript = btemplates.witnessPubKeyHash.output.encode(keyHash)\n      prevOutType = scriptTypes.P2WPKH\n      if (typeof redeemScript !== 'undefined') {\n        throw new Error('Redeem script given when unnecessary')\n      }\n    } else {\n      if (!redeemScript) {\n        throw new Error('No redeemScript provided for P2WPKH, but scriptSig wasn\\'t empty')\n      }\n      witnessProgram = btemplates.witnessPubKeyHash.output.encode(keyHash)\n      if (!redeemScript.equals(witnessProgram)) {\n        throw new Error('Redeem script did not have the right witness program')\n      }\n    }\n\n    scriptType = scriptTypes.P2PKH\n    chunks = witnessStack\n  } else if (redeemScript) {\n    if (!supportedP2SHType(redeemScriptType)) {\n      throw new Error('Bad redeemscript!')\n    }\n\n    script = redeemScript\n    scriptType = redeemScriptType\n    chunks = scriptSigChunks.slice(0, -1)\n  } else {\n    prevOutType = scriptType = btemplates.classifyInput(scriptSig)\n    chunks = scriptSigChunks\n  }\n\n  var expanded = extractChunks(scriptType, chunks, script)\n\n  var result = {\n    pubKeys: expanded.pubKeys,\n    signatures: expanded.signatures,\n    prevOutScript: prevOutScript,\n    prevOutType: prevOutType,\n    signType: scriptType,\n    signScript: script,\n    witness: Boolean(witness)\n  }\n\n  if (p2sh) {\n    result.redeemScript = redeemScript\n    result.redeemScriptType = redeemScriptType\n  }\n\n  if (p2wsh) {\n    result.witnessScript = witnessScript\n    result.witnessScriptType = witnessScriptType\n  }\n\n  return result\n}\n\n// could be done in expandInput, but requires the original Transaction for hashForSignature\nfunction fixMultisigOrder (input, transaction, vin) {\n  if (input.redeemScriptType !== scriptTypes.MULTISIG || !input.redeemScript) return\n  if (input.pubKeys.length === input.signatures.length) return\n\n  var unmatched = input.signatures.concat()\n\n  input.signatures = input.pubKeys.map(function (pubKey) {\n    var keyPair = ECPair.fromPublicKeyBuffer(pubKey)\n    var match\n\n    // check for a signature\n    unmatched.some(function (signature, i) {\n      // skip if undefined || OP_0\n      if (!signature) return false\n\n      // TODO: avoid O(n) hashForSignature\n      var parsed = ECSignature.parseScriptSignature(signature)\n      var hash = transaction.hashForSignature(vin, input.redeemScript, parsed.hashType)\n\n      // skip if signature does not match pubKey\n      if (!keyPair.verify(hash, parsed.signature)) return false\n\n      // remove matched signature from unmatched\n      unmatched[i] = undefined\n      match = signature\n\n      return true\n    })\n\n    return match\n  })\n}\n\nfunction expandOutput (script, scriptType, ourPubKey) {\n  typeforce(types.Buffer, script)\n\n  var scriptChunks = bscript.decompile(script)\n  if (!scriptType) {\n    scriptType = btemplates.classifyOutput(script)\n  }\n\n  var pubKeys = []\n\n  switch (scriptType) {\n    // does our hash160(pubKey) match the output scripts?\n    case scriptTypes.P2PKH:\n      if (!ourPubKey) break\n\n      var pkh1 = scriptChunks[2]\n      var pkh2 = bcrypto.hash160(ourPubKey)\n      if (pkh1.equals(pkh2)) pubKeys = [ourPubKey]\n      break\n\n    // does our hash160(pubKey) match the output scripts?\n    case scriptTypes.P2WPKH:\n      if (!ourPubKey) break\n\n      var wpkh1 = scriptChunks[1]\n      var wpkh2 = bcrypto.hash160(ourPubKey)\n      if (wpkh1.equals(wpkh2)) pubKeys = [ourPubKey]\n      break\n\n    case scriptTypes.P2PK:\n      pubKeys = scriptChunks.slice(0, 1)\n      break\n\n    case scriptTypes.MULTISIG:\n      pubKeys = scriptChunks.slice(1, -2)\n      break\n\n    default: return { scriptType: scriptType }\n  }\n\n  return {\n    pubKeys: pubKeys,\n    scriptType: scriptType,\n    signatures: pubKeys.map(function () { return undefined })\n  }\n}\n\nfunction checkP2SHInput (input, redeemScriptHash) {\n  if (input.prevOutType) {\n    if (input.prevOutType !== scriptTypes.P2SH) throw new Error('PrevOutScript must be P2SH')\n\n    var prevOutScriptScriptHash = bscript.decompile(input.prevOutScript)[1]\n    if (!prevOutScriptScriptHash.equals(redeemScriptHash)) throw new Error('Inconsistent hash160(RedeemScript)')\n  }\n}\n\nfunction checkP2WSHInput (input, witnessScriptHash) {\n  if (input.prevOutType) {\n    if (input.prevOutType !== scriptTypes.P2WSH) throw new Error('PrevOutScript must be P2WSH')\n\n    var scriptHash = bscript.decompile(input.prevOutScript)[1]\n    if (!scriptHash.equals(witnessScriptHash)) throw new Error('Inconsistent sha25(WitnessScript)')\n  }\n}\n\nfunction prepareInput (input, kpPubKey, redeemScript, witnessValue, witnessScript) {\n  var expanded\n  var prevOutType\n  var prevOutScript\n\n  var p2sh = false\n  var p2shType\n  var redeemScriptHash\n\n  var witness = false\n  var p2wsh = false\n  var witnessType\n  var witnessScriptHash\n\n  var signType\n  var signScript\n\n  if (redeemScript && witnessScript) {\n    redeemScriptHash = bcrypto.hash160(redeemScript)\n    witnessScriptHash = bcrypto.sha256(witnessScript)\n    checkP2SHInput(input, redeemScriptHash)\n\n    if (!redeemScript.equals(btemplates.witnessScriptHash.output.encode(witnessScriptHash))) throw new Error('Witness script inconsistent with redeem script')\n\n    expanded = expandOutput(witnessScript, undefined, kpPubKey)\n    if (!expanded.pubKeys) throw new Error('WitnessScript not supported \"' + bscript.toASM(redeemScript) + '\"')\n\n    prevOutType = btemplates.types.P2SH\n    prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)\n    p2sh = witness = p2wsh = true\n    p2shType = btemplates.types.P2WSH\n    signType = witnessType = expanded.scriptType\n    signScript = witnessScript\n  } else if (redeemScript) {\n    redeemScriptHash = bcrypto.hash160(redeemScript)\n    checkP2SHInput(input, redeemScriptHash)\n\n    expanded = expandOutput(redeemScript, undefined, kpPubKey)\n    if (!expanded.pubKeys) throw new Error('RedeemScript not supported \"' + bscript.toASM(redeemScript) + '\"')\n\n    prevOutType = btemplates.types.P2SH\n    prevOutScript = btemplates.scriptHash.output.encode(redeemScriptHash)\n    p2sh = true\n    signType = p2shType = expanded.scriptType\n    signScript = redeemScript\n    witness = signType === btemplates.types.P2WPKH\n  } else if (witnessScript) {\n    witnessScriptHash = bcrypto.sha256(witnessScript)\n    checkP2WSHInput(input, witnessScriptHash)\n\n    expanded = expandOutput(witnessScript, undefined, kpPubKey)\n    if (!expanded.pubKeys) throw new Error('WitnessScript not supported \"' + bscript.toASM(redeemScript) + '\"')\n\n    prevOutType = btemplates.types.P2WSH\n    prevOutScript = btemplates.witnessScriptHash.output.encode(witnessScriptHash)\n    witness = p2wsh = true\n    signType = witnessType = expanded.scriptType\n    signScript = witnessScript\n  } else if (input.prevOutType) {\n    // embedded scripts are not possible without a redeemScript\n    if (input.prevOutType === scriptTypes.P2SH ||\n      input.prevOutType === scriptTypes.P2WSH) {\n      throw new Error('PrevOutScript is ' + input.prevOutType + ', requires redeemScript')\n    }\n\n    prevOutType = input.prevOutType\n    prevOutScript = input.prevOutScript\n    expanded = expandOutput(input.prevOutScript, input.prevOutType, kpPubKey)\n    if (!expanded.pubKeys) return\n\n    witness = (input.prevOutType === scriptTypes.P2WPKH)\n    signType = prevOutType\n    signScript = prevOutScript\n  } else {\n    prevOutScript = btemplates.pubKeyHash.output.encode(bcrypto.hash160(kpPubKey))\n    expanded = expandOutput(prevOutScript, scriptTypes.P2PKH, kpPubKey)\n\n    prevOutType = scriptTypes.P2PKH\n    witness = false\n    signType = prevOutType\n    signScript = prevOutScript\n  }\n\n  if (signType === scriptTypes.P2WPKH) {\n    signScript = btemplates.pubKeyHash.output.encode(btemplates.witnessPubKeyHash.output.decode(signScript))\n  }\n\n  if (p2sh) {\n    input.redeemScript = redeemScript\n    input.redeemScriptType = p2shType\n  }\n\n  if (p2wsh) {\n    input.witnessScript = witnessScript\n    input.witnessScriptType = witnessType\n  }\n\n  input.pubKeys = expanded.pubKeys\n  input.signatures = expanded.signatures\n  input.signScript = signScript\n  input.signType = signType\n  input.prevOutScript = prevOutScript\n  input.prevOutType = prevOutType\n  input.witness = witness\n}\n\nfunction buildStack (type, signatures, pubKeys, allowIncomplete) {\n  if (type === scriptTypes.P2PKH) {\n    if (signatures.length === 1 && Buffer.isBuffer(signatures[0]) && pubKeys.length === 1) return btemplates.pubKeyHash.input.encodeStack(signatures[0], pubKeys[0])\n  } else if (type === scriptTypes.P2PK) {\n    if (signatures.length === 1 && Buffer.isBuffer(signatures[0])) return btemplates.pubKey.input.encodeStack(signatures[0])\n  } else if (type === scriptTypes.MULTISIG) {\n    if (signatures.length > 0) {\n      signatures = signatures.map(function (signature) {\n        return signature || ops.OP_0\n      })\n      if (!allowIncomplete) {\n        // remove blank signatures\n        signatures = signatures.filter(function (x) { return x !== ops.OP_0 })\n      }\n\n      return btemplates.multisig.input.encodeStack(signatures)\n    }\n  } else {\n    throw new Error('Not yet supported')\n  }\n\n  if (!allowIncomplete) throw new Error('Not enough signatures provided')\n  return []\n}\n\nfunction buildInput (input, allowIncomplete) {\n  var scriptType = input.prevOutType\n  var sig = []\n  var witness = []\n\n  if (supportedType(scriptType)) {\n    sig = buildStack(scriptType, input.signatures, input.pubKeys, allowIncomplete)\n  }\n\n  var p2sh = false\n  if (scriptType === btemplates.types.P2SH) {\n    // We can remove this error later when we have a guarantee prepareInput\n    // rejects unsignable scripts - it MUST be signable at this point.\n    if (!allowIncomplete && !supportedP2SHType(input.redeemScriptType)) {\n      throw new Error('Impossible to sign this type')\n    }\n\n    if (supportedType(input.redeemScriptType)) {\n      sig = buildStack(input.redeemScriptType, input.signatures, input.pubKeys, allowIncomplete)\n    }\n\n    // If it wasn't SIGNABLE, it's witness, defer to that\n    if (input.redeemScriptType) {\n      p2sh = true\n      scriptType = input.redeemScriptType\n    }\n  }\n\n  switch (scriptType) {\n    // P2WPKH is a special case of P2PKH\n    case btemplates.types.P2WPKH:\n      witness = buildStack(btemplates.types.P2PKH, input.signatures, input.pubKeys, allowIncomplete)\n      break\n\n    case btemplates.types.P2WSH:\n      // We can remove this check later\n      if (!allowIncomplete && !supportedType(input.witnessScriptType)) {\n        throw new Error('Impossible to sign this type')\n      }\n\n      if (supportedType(input.witnessScriptType)) {\n        witness = buildStack(input.witnessScriptType, input.signatures, input.pubKeys, allowIncomplete)\n        witness.push(input.witnessScript)\n        scriptType = input.witnessScriptType\n      }\n\n      break\n  }\n\n  // append redeemScript if necessary\n  if (p2sh) {\n    sig.push(input.redeemScript)\n  }\n\n  return {\n    type: scriptType,\n    script: bscript.compile(sig),\n    witness: witness\n  }\n}\n\nfunction TransactionBuilder (network, maximumFeeRate) {\n  this.prevTxMap = {}\n  this.network = network || networks.bitcoin\n\n  // WARNING: This is __NOT__ to be relied on, its just another potential safety mechanism (safety in-depth)\n  this.maximumFeeRate = maximumFeeRate || 2500\n\n  this.inputs = []\n  this.tx = new Transaction()\n}\n\nTransactionBuilder.prototype.setLockTime = function (locktime) {\n  typeforce(types.UInt32, locktime)\n\n  // if any signatures exist, throw\n  if (this.inputs.some(function (input) {\n    if (!input.signatures) return false\n\n    return input.signatures.some(function (s) { return s })\n  })) {\n    throw new Error('No, this would invalidate signatures')\n  }\n\n  this.tx.locktime = locktime\n}\n\nTransactionBuilder.prototype.setVersion = function (version) {\n  typeforce(types.UInt32, version)\n\n  // XXX: this might eventually become more complex depending on what the versions represent\n  this.tx.version = version\n}\n\nTransactionBuilder.fromTransaction = function (transaction, network) {\n  var txb = new TransactionBuilder(network)\n\n  // Copy transaction fields\n  txb.setVersion(transaction.version)\n  txb.setLockTime(transaction.locktime)\n\n  // Copy outputs (done first to avoid signature invalidation)\n  transaction.outs.forEach(function (txOut) {\n    txb.addOutput(txOut.script, txOut.value)\n  })\n\n  // Copy inputs\n  transaction.ins.forEach(function (txIn) {\n    txb.__addInputUnsafe(txIn.hash, txIn.index, {\n      sequence: txIn.sequence,\n      script: txIn.script,\n      witness: txIn.witness\n    })\n  })\n\n  // fix some things not possible through the public API\n  txb.inputs.forEach(function (input, i) {\n    fixMultisigOrder(input, transaction, i)\n  })\n\n  return txb\n}\n\nTransactionBuilder.prototype.addInput = function (txHash, vout, sequence, prevOutScript) {\n  if (!this.__canModifyInputs()) {\n    throw new Error('No, this would invalidate signatures')\n  }\n\n  var value\n\n  // is it a hex string?\n  if (typeof txHash === 'string') {\n    // transaction hashs's are displayed in reverse order, un-reverse it\n    txHash = Buffer.from(txHash, 'hex').reverse()\n\n  // is it a Transaction object?\n  } else if (txHash instanceof Transaction) {\n    var txOut = txHash.outs[vout]\n    prevOutScript = txOut.script\n    value = txOut.value\n\n    txHash = txHash.getHash()\n  }\n\n  return this.__addInputUnsafe(txHash, vout, {\n    sequence: sequence,\n    prevOutScript: prevOutScript,\n    value: value\n  })\n}\n\nTransactionBuilder.prototype.__addInputUnsafe = function (txHash, vout, options) {\n  if (Transaction.isCoinbaseHash(txHash)) {\n    throw new Error('coinbase inputs not supported')\n  }\n\n  var prevTxOut = txHash.toString('hex') + ':' + vout\n  if (this.prevTxMap[prevTxOut] !== undefined) throw new Error('Duplicate TxOut: ' + prevTxOut)\n\n  var input = {}\n\n  // derive what we can from the scriptSig\n  if (options.script !== undefined) {\n    input = expandInput(options.script, options.witness || [])\n  }\n\n  // if an input value was given, retain it\n  if (options.value !== undefined) {\n    input.value = options.value\n  }\n\n  // derive what we can from the previous transactions output script\n  if (!input.prevOutScript && options.prevOutScript) {\n    var prevOutType\n\n    if (!input.pubKeys && !input.signatures) {\n      var expanded = expandOutput(options.prevOutScript)\n\n      if (expanded.pubKeys) {\n        input.pubKeys = expanded.pubKeys\n        input.signatures = expanded.signatures\n      }\n\n      prevOutType = expanded.scriptType\n    }\n\n    input.prevOutScript = options.prevOutScript\n    input.prevOutType = prevOutType || btemplates.classifyOutput(options.prevOutScript)\n  }\n\n  var vin = this.tx.addInput(txHash, vout, options.sequence, options.scriptSig)\n  this.inputs[vin] = input\n  this.prevTxMap[prevTxOut] = vin\n  return vin\n}\n\nTransactionBuilder.prototype.addOutput = function (scriptPubKey, value) {\n  if (!this.__canModifyOutputs()) {\n    throw new Error('No, this would invalidate signatures')\n  }\n\n  // Attempt to get a script if it's a base58 address string\n  if (typeof scriptPubKey === 'string') {\n    scriptPubKey = baddress.toOutputScript(scriptPubKey, this.network)\n  }\n\n  return this.tx.addOutput(scriptPubKey, value)\n}\n\nTransactionBuilder.prototype.build = function () {\n  return this.__build(false)\n}\nTransactionBuilder.prototype.buildIncomplete = function () {\n  return this.__build(true)\n}\n\nTransactionBuilder.prototype.__build = function (allowIncomplete) {\n  if (!allowIncomplete) {\n    if (!this.tx.ins.length) throw new Error('Transaction has no inputs')\n    if (!this.tx.outs.length) throw new Error('Transaction has no outputs')\n  }\n\n  var tx = this.tx.clone()\n  // Create script signatures from inputs\n  this.inputs.forEach(function (input, i) {\n    var scriptType = input.witnessScriptType || input.redeemScriptType || input.prevOutType\n    if (!scriptType && !allowIncomplete) throw new Error('Transaction is not complete')\n    var result = buildInput(input, allowIncomplete)\n\n    // skip if no result\n    if (!allowIncomplete) {\n      if (!supportedType(result.type) && result.type !== btemplates.types.P2WPKH) {\n        throw new Error(result.type + ' not supported')\n      }\n    }\n\n    tx.setInputScript(i, result.script)\n    tx.setWitness(i, result.witness)\n  })\n\n  if (!allowIncomplete) {\n    // do not rely on this, its merely a last resort\n    if (this.__overMaximumFees(tx.virtualSize())) {\n      throw new Error('Transaction has absurd fees')\n    }\n  }\n\n  return tx\n}\n\nfunction canSign (input) {\n  return input.prevOutScript !== undefined &&\n    input.signScript !== undefined &&\n    input.pubKeys !== undefined &&\n    input.signatures !== undefined &&\n    input.signatures.length === input.pubKeys.length &&\n    input.pubKeys.length > 0 &&\n    (\n      input.witness === false ||\n      (input.witness === true && input.value !== undefined)\n    )\n}\n\nTransactionBuilder.prototype.sign = function (vin, keyPair, redeemScript, hashType, witnessValue, witnessScript) {\n  // TODO: remove keyPair.network matching in 4.0.0\n  if (keyPair.network && keyPair.network !== this.network) throw new TypeError('Inconsistent network')\n  if (!this.inputs[vin]) throw new Error('No input at index: ' + vin)\n  hashType = hashType || Transaction.SIGHASH_ALL\n\n  var input = this.inputs[vin]\n\n  // if redeemScript was previously provided, enforce consistency\n  if (input.redeemScript !== undefined &&\n      redeemScript &&\n      !input.redeemScript.equals(redeemScript)) {\n    throw new Error('Inconsistent redeemScript')\n  }\n\n  var kpPubKey = keyPair.publicKey || keyPair.getPublicKeyBuffer()\n  if (!canSign(input)) {\n    if (witnessValue !== undefined) {\n      if (input.value !== undefined && input.value !== witnessValue) throw new Error('Input didn\\'t match witnessValue')\n      typeforce(types.Satoshi, witnessValue)\n      input.value = witnessValue\n    }\n\n    if (!canSign(input)) prepareInput(input, kpPubKey, redeemScript, witnessValue, witnessScript)\n    if (!canSign(input)) throw Error(input.prevOutType + ' not supported')\n  }\n\n  // ready to sign\n  var signatureHash\n  if (input.witness) {\n    signatureHash = this.tx.hashForWitnessV0(vin, input.signScript, input.value, hashType)\n  } else {\n    signatureHash = this.tx.hashForSignature(vin, input.signScript, hashType)\n  }\n\n  // enforce in order signing of public keys\n  var signed = input.pubKeys.some(function (pubKey, i) {\n    if (!kpPubKey.equals(pubKey)) return false\n    if (input.signatures[i]) throw new Error('Signature already exists')\n    if (kpPubKey.length !== 33 &&\n      input.signType === scriptTypes.P2WPKH) throw new Error('BIP143 rejects uncompressed public keys in P2WPKH or P2WSH')\n\n    var signature = keyPair.sign(signatureHash)\n    if (Buffer.isBuffer(signature)) signature = ECSignature.fromRSBuffer(signature)\n\n    input.signatures[i] = signature.toScriptSignature(hashType)\n    return true\n  })\n\n  if (!signed) throw new Error('Key pair cannot sign for this input')\n}\n\nfunction signatureHashType (buffer) {\n  return buffer.readUInt8(buffer.length - 1)\n}\n\nTransactionBuilder.prototype.__canModifyInputs = function () {\n  return this.inputs.every(function (input) {\n    // any signatures?\n    if (input.signatures === undefined) return true\n\n    return input.signatures.every(function (signature) {\n      if (!signature) return true\n      var hashType = signatureHashType(signature)\n\n      // if SIGHASH_ANYONECANPAY is set, signatures would not\n      // be invalidated by more inputs\n      return hashType & Transaction.SIGHASH_ANYONECANPAY\n    })\n  })\n}\n\nTransactionBuilder.prototype.__canModifyOutputs = function () {\n  var nInputs = this.tx.ins.length\n  var nOutputs = this.tx.outs.length\n\n  return this.inputs.every(function (input) {\n    if (input.signatures === undefined) return true\n\n    return input.signatures.every(function (signature) {\n      if (!signature) return true\n      var hashType = signatureHashType(signature)\n\n      var hashTypeMod = hashType & 0x1f\n      if (hashTypeMod === Transaction.SIGHASH_NONE) return true\n      if (hashTypeMod === Transaction.SIGHASH_SINGLE) {\n        // if SIGHASH_SINGLE is set, and nInputs > nOutputs\n        // some signatures would be invalidated by the addition\n        // of more outputs\n        return nInputs <= nOutputs\n      }\n    })\n  })\n}\n\nTransactionBuilder.prototype.__overMaximumFees = function (bytes) {\n  // not all inputs will have .value defined\n  var incoming = this.inputs.reduce(function (a, x) { return a + (x.value >>> 0) }, 0)\n\n  // but all outputs do, and if we have any input value\n  // we can immediately determine if the outputs are too small\n  var outgoing = this.tx.outs.reduce(function (a, x) { return a + x.value }, 0)\n  var fee = incoming - outgoing\n  var feeRate = fee / bytes\n\n  return feeRate > this.maximumFeeRate\n}\n\nmodule.exports = TransactionBuilder\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bitcoinjs-lib/src/transaction_builder.js\n// module id = 645\n// module chunks = 0\n\n//# sourceURL=../node_modules/bitcoinjs-lib/src/transaction_builder.js")},function(module,exports,__webpack_require__){eval("// Blake2B in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nvar util = __webpack_require__(346)\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += v[b,b+1]\n// v should be a Uint32Array\nfunction ADD64AA (v, a, b) {\n  var o0 = v[a] + v[b]\n  var o1 = v[a + 1] + v[b + 1]\n  if (o0 >= 0x100000000) {\n    o1++\n  }\n  v[a] = o0\n  v[a + 1] = o1\n}\n\n// 64-bit unsigned addition\n// Sets v[a,a+1] += b\n// b0 is the low 32 bits of b, b1 represents the high 32 bits\nfunction ADD64AC (v, a, b0, b1) {\n  var o0 = v[a] + b0\n  if (b0 < 0) {\n    o0 += 0x100000000\n  }\n  var o1 = v[a + 1] + b1\n  if (o0 >= 0x100000000) {\n    o1++\n  }\n  v[a] = o0\n  v[a + 1] = o1\n}\n\n// Little-endian byte access\nfunction B2B_GET32 (arr, i) {\n  return (arr[i] ^\n  (arr[i + 1] << 8) ^\n  (arr[i + 2] << 16) ^\n  (arr[i + 3] << 24))\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction B2B_G (a, b, c, d, ix, iy) {\n  var x0 = m[ix]\n  var x1 = m[ix + 1]\n  var y0 = m[iy]\n  var y1 = m[iy + 1]\n\n  ADD64AA(v, a, b) // v[a,a+1] += v[b,b+1] ... in JS we must store a uint64 as two uint32s\n  ADD64AC(v, a, x0, x1) // v[a, a+1] += x ... x0 is the low 32 bits of x, x1 is the high 32 bits\n\n  // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n  var xor0 = v[d] ^ v[a]\n  var xor1 = v[d + 1] ^ v[a + 1]\n  v[d] = xor1\n  v[d + 1] = xor0\n\n  ADD64AA(v, c, d)\n\n  // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n  xor0 = v[b] ^ v[c]\n  xor1 = v[b + 1] ^ v[c + 1]\n  v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n  v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n  ADD64AA(v, a, b)\n  ADD64AC(v, a, y0, y1)\n\n  // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n  xor0 = v[d] ^ v[a]\n  xor1 = v[d + 1] ^ v[a + 1]\n  v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n  v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n  ADD64AA(v, c, d)\n\n  // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n  xor0 = v[b] ^ v[c]\n  xor1 = v[b + 1] ^ v[c + 1]\n  v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n  v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nvar BLAKE2B_IV32 = new Uint32Array([\n  0xF3BCC908, 0x6A09E667, 0x84CAA73B, 0xBB67AE85,\n  0xFE94F82B, 0x3C6EF372, 0x5F1D36F1, 0xA54FF53A,\n  0xADE682D1, 0x510E527F, 0x2B3E6C1F, 0x9B05688C,\n  0xFB41BD6B, 0x1F83D9AB, 0x137E2179, 0x5BE0CD19\n])\n\nvar SIGMA8 = [\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n  11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n  7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n  9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n  2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n  12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n  13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n  6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n  10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3\n]\n\n// These are offsets into a uint64 buffer.\n// Multiply them all by 2 to make them offsets into a uint32 buffer,\n// because this is Javascript and we don't have uint64s\nvar SIGMA82 = new Uint8Array(SIGMA8.map(function (x) { return x * 2 }))\n\n// Compression function. 'last' flag indicates last block.\n// Note we're representing 16 uint64s as 32 uint32s\nvar v = new Uint32Array(32)\nvar m = new Uint32Array(32)\nfunction blake2bCompress (ctx, last) {\n  var i = 0\n\n  // init work variables\n  for (i = 0; i < 16; i++) {\n    v[i] = ctx.h[i]\n    v[i + 16] = BLAKE2B_IV32[i]\n  }\n\n  // low 64 bits of offset\n  v[24] = v[24] ^ ctx.t\n  v[25] = v[25] ^ (ctx.t / 0x100000000)\n  // high 64 bits not supported, offset may not be higher than 2**53-1\n\n  // last block flag set ?\n  if (last) {\n    v[28] = ~v[28]\n    v[29] = ~v[29]\n  }\n\n  // get little-endian words\n  for (i = 0; i < 32; i++) {\n    m[i] = B2B_GET32(ctx.b, 4 * i)\n  }\n\n  // twelve rounds of mixing\n  // uncomment the DebugPrint calls to log the computation\n  // and match the RFC sample documentation\n  // util.debugPrint('          m[16]', m, 64)\n  for (i = 0; i < 12; i++) {\n    // util.debugPrint('   (i=' + (i < 10 ? ' ' : '') + i + ') v[16]', v, 64)\n    B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1])\n    B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3])\n    B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5])\n    B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7])\n    B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9])\n    B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11])\n    B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13])\n    B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15])\n  }\n  // util.debugPrint('   (i=12) v[16]', v, 64)\n\n  for (i = 0; i < 16; i++) {\n    ctx.h[i] = ctx.h[i] ^ v[i] ^ v[i + 16]\n  }\n  // util.debugPrint('h[8]', ctx.h, 64)\n}\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\nfunction blake2bInit (outlen, key) {\n  if (outlen === 0 || outlen > 64) {\n    throw new Error('Illegal output length, expected 0 < length <= 64')\n  }\n  if (key && key.length > 64) {\n    throw new Error('Illegal key, expected Uint8Array with 0 < length <= 64')\n  }\n\n  // state, 'param block'\n  var ctx = {\n    b: new Uint8Array(128),\n    h: new Uint32Array(16),\n    t: 0, // input count\n    c: 0, // pointer within buffer\n    outlen: outlen // output length in bytes\n  }\n\n  // initialize hash state\n  for (var i = 0; i < 16; i++) {\n    ctx.h[i] = BLAKE2B_IV32[i]\n  }\n  var keylen = key ? key.length : 0\n  ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n  // key the hash, if applicable\n  if (key) {\n    blake2bUpdate(ctx, key)\n    // at the end\n    ctx.c = 128\n  }\n\n  return ctx\n}\n\n// Updates a BLAKE2b streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2bUpdate (ctx, input) {\n  for (var i = 0; i < input.length; i++) {\n    if (ctx.c === 128) { // buffer full ?\n      ctx.t += ctx.c // add counters\n      blake2bCompress(ctx, false) // compress (not last)\n      ctx.c = 0 // counter to zero\n    }\n    ctx.b[ctx.c++] = input[i]\n  }\n}\n\n// Completes a BLAKE2b streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2bFinal (ctx) {\n  ctx.t += ctx.c // mark last block offset\n\n  while (ctx.c < 128) { // fill up with zeros\n    ctx.b[ctx.c++] = 0\n  }\n  blake2bCompress(ctx, true) // final block flag = 1\n\n  // little endian convert and store\n  var out = new Uint8Array(ctx.outlen)\n  for (var i = 0; i < ctx.outlen; i++) {\n    out[i] = ctx.h[i >> 2] >> (8 * (i & 3))\n  }\n  return out\n}\n\n// Computes the BLAKE2B hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2b (input, key, outlen) {\n  // preprocess inputs\n  outlen = outlen || 64\n  input = util.normalizeInput(input)\n\n  // do the math\n  var ctx = blake2bInit(outlen, key)\n  blake2bUpdate(ctx, input)\n  return blake2bFinal(ctx)\n}\n\n// Computes the BLAKE2B hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 64 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2bHex (input, key, outlen) {\n  var output = blake2b(input, key, outlen)\n  return util.toHex(output)\n}\n\nmodule.exports = {\n  blake2b: blake2b,\n  blake2bHex: blake2bHex,\n  blake2bInit: blake2bInit,\n  blake2bUpdate: blake2bUpdate,\n  blake2bFinal: blake2bFinal\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blakejs/blake2b.js\n// module id = 646\n// module chunks = 0\n\n//# sourceURL=../node_modules/blakejs/blake2b.js")},function(module,exports,__webpack_require__){eval("// BLAKE2s hash function in pure Javascript\n// Adapted from the reference implementation in RFC7693\n// Ported to Javascript by DC - https://github.com/dcposch\n\nvar util = __webpack_require__(346)\n\n// Little-endian byte access.\n// Expects a Uint8Array and an index\n// Returns the little-endian uint32 at v[i..i+3]\nfunction B2S_GET32 (v, i) {\n  return v[i] ^ (v[i + 1] << 8) ^ (v[i + 2] << 16) ^ (v[i + 3] << 24)\n}\n\n// Mixing function G.\nfunction B2S_G (a, b, c, d, x, y) {\n  v[a] = v[a] + v[b] + x\n  v[d] = ROTR32(v[d] ^ v[a], 16)\n  v[c] = v[c] + v[d]\n  v[b] = ROTR32(v[b] ^ v[c], 12)\n  v[a] = v[a] + v[b] + y\n  v[d] = ROTR32(v[d] ^ v[a], 8)\n  v[c] = v[c] + v[d]\n  v[b] = ROTR32(v[b] ^ v[c], 7)\n}\n\n// 32-bit right rotation\n// x should be a uint32\n// y must be between 1 and 31, inclusive\nfunction ROTR32 (x, y) {\n  return (x >>> y) ^ (x << (32 - y))\n}\n\n// Initialization Vector.\nvar BLAKE2S_IV = new Uint32Array([\n  0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,\n  0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19])\n\nvar SIGMA = new Uint8Array([\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n  11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n  7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n  9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n  2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n  12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n  13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n  6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n  10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0])\n\n// Compression function. \"last\" flag indicates last block\nvar v = new Uint32Array(16)\nvar m = new Uint32Array(16)\nfunction blake2sCompress (ctx, last) {\n  var i = 0\n  for (i = 0; i < 8; i++) { // init work variables\n    v[i] = ctx.h[i]\n    v[i + 8] = BLAKE2S_IV[i]\n  }\n\n  v[12] ^= ctx.t // low 32 bits of offset\n  v[13] ^= (ctx.t / 0x100000000) // high 32 bits\n  if (last) { // last block flag set ?\n    v[14] = ~v[14]\n  }\n\n  for (i = 0; i < 16; i++) { // get little-endian words\n    m[i] = B2S_GET32(ctx.b, 4 * i)\n  }\n\n  // ten rounds of mixing\n  // uncomment the DebugPrint calls to log the computation\n  // and match the RFC sample documentation\n  // util.debugPrint('          m[16]', m, 32)\n  for (i = 0; i < 10; i++) {\n    // util.debugPrint('   (i=' + i + ')  v[16]', v, 32)\n    B2S_G(0, 4, 8, 12, m[SIGMA[i * 16 + 0]], m[SIGMA[i * 16 + 1]])\n    B2S_G(1, 5, 9, 13, m[SIGMA[i * 16 + 2]], m[SIGMA[i * 16 + 3]])\n    B2S_G(2, 6, 10, 14, m[SIGMA[i * 16 + 4]], m[SIGMA[i * 16 + 5]])\n    B2S_G(3, 7, 11, 15, m[SIGMA[i * 16 + 6]], m[SIGMA[i * 16 + 7]])\n    B2S_G(0, 5, 10, 15, m[SIGMA[i * 16 + 8]], m[SIGMA[i * 16 + 9]])\n    B2S_G(1, 6, 11, 12, m[SIGMA[i * 16 + 10]], m[SIGMA[i * 16 + 11]])\n    B2S_G(2, 7, 8, 13, m[SIGMA[i * 16 + 12]], m[SIGMA[i * 16 + 13]])\n    B2S_G(3, 4, 9, 14, m[SIGMA[i * 16 + 14]], m[SIGMA[i * 16 + 15]])\n  }\n  // util.debugPrint('   (i=10) v[16]', v, 32)\n\n  for (i = 0; i < 8; i++) {\n    ctx.h[i] ^= v[i] ^ v[i + 8]\n  }\n  // util.debugPrint('h[8]', ctx.h, 32)\n}\n\n// Creates a BLAKE2s hashing context\n// Requires an output length between 1 and 32 bytes\n// Takes an optional Uint8Array key\nfunction blake2sInit (outlen, key) {\n  if (!(outlen > 0 && outlen <= 32)) {\n    throw new Error('Incorrect output length, should be in [1, 32]')\n  }\n  var keylen = key ? key.length : 0\n  if (key && !(keylen > 0 && keylen <= 32)) {\n    throw new Error('Incorrect key length, should be in [1, 32]')\n  }\n\n  var ctx = {\n    h: new Uint32Array(BLAKE2S_IV), // hash state\n    b: new Uint32Array(64), // input block\n    c: 0, // pointer within block\n    t: 0, // input count\n    outlen: outlen // output length in bytes\n  }\n  ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen\n\n  if (keylen > 0) {\n    blake2sUpdate(ctx, key)\n    ctx.c = 64 // at the end\n  }\n\n  return ctx\n}\n\n// Updates a BLAKE2s streaming hash\n// Requires hash context and Uint8Array (byte array)\nfunction blake2sUpdate (ctx, input) {\n  for (var i = 0; i < input.length; i++) {\n    if (ctx.c === 64) { // buffer full ?\n      ctx.t += ctx.c // add counters\n      blake2sCompress(ctx, false) // compress (not last)\n      ctx.c = 0 // counter to zero\n    }\n    ctx.b[ctx.c++] = input[i]\n  }\n}\n\n// Completes a BLAKE2s streaming hash\n// Returns a Uint8Array containing the message digest\nfunction blake2sFinal (ctx) {\n  ctx.t += ctx.c // mark last block offset\n  while (ctx.c < 64) { // fill up with zeros\n    ctx.b[ctx.c++] = 0\n  }\n  blake2sCompress(ctx, true) // final block flag = 1\n\n  // little endian convert and store\n  var out = new Uint8Array(ctx.outlen)\n  for (var i = 0; i < ctx.outlen; i++) {\n    out[i] = (ctx.h[i >> 2] >> (8 * (i & 3))) & 0xFF\n  }\n  return out\n}\n\n// Computes the BLAKE2S hash of a string or byte array, and returns a Uint8Array\n//\n// Returns a n-byte Uint8Array\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 32 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2s (input, key, outlen) {\n  // preprocess inputs\n  outlen = outlen || 32\n  input = util.normalizeInput(input)\n\n  // do the math\n  var ctx = blake2sInit(outlen, key)\n  blake2sUpdate(ctx, input)\n  return blake2sFinal(ctx)\n}\n\n// Computes the BLAKE2S hash of a string or byte array\n//\n// Returns an n-byte hash in hex, all lowercase\n//\n// Parameters:\n// - input - the input bytes, as a string, Buffer, or Uint8Array\n// - key - optional key Uint8Array, up to 32 bytes\n// - outlen - optional output length in bytes, default 64\nfunction blake2sHex (input, key, outlen) {\n  var output = blake2s(input, key, outlen)\n  return util.toHex(output)\n}\n\nmodule.exports = {\n  blake2s: blake2s,\n  blake2sHex: blake2sHex,\n  blake2sInit: blake2sInit,\n  blake2sUpdate: blake2sUpdate,\n  blake2sFinal: blake2sFinal\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blakejs/blake2s.js\n// module id = 647\n// module chunks = 0\n\n//# sourceURL=../node_modules/blakejs/blake2s.js")},function(module,exports,__webpack_require__){eval("var b2b = __webpack_require__(646)\nvar b2s = __webpack_require__(647)\n\nmodule.exports = {\n  blake2b: b2b.blake2b,\n  blake2bHex: b2b.blake2bHex,\n  blake2bInit: b2b.blake2bInit,\n  blake2bUpdate: b2b.blake2bUpdate,\n  blake2bFinal: b2b.blake2bFinal,\n  blake2s: b2s.blake2s,\n  blake2sHex: b2s.blake2sHex,\n  blake2sInit: b2s.blake2sInit,\n  blake2sUpdate: b2s.blake2sUpdate,\n  blake2sFinal: b2s.blake2sFinal\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blakejs/index.js\n// module id = 648\n// module chunks = 0\n\n//# sourceURL=../node_modules/blakejs/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Create a blob builder even when vendor prefixes exist\n */\n\nvar BlobBuilder = global.BlobBuilder\n  || global.WebKitBlobBuilder\n  || global.MSBlobBuilder\n  || global.MozBlobBuilder;\n\n/**\n * Check if Blob constructor is supported\n */\n\nvar blobSupported = (function() {\n  try {\n    var a = new Blob(['hi']);\n    return a.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if Blob constructor supports ArrayBufferViews\n * Fails in Safari 6, so we need to map to ArrayBuffers there.\n */\n\nvar blobSupportsArrayBufferView = blobSupported && (function() {\n  try {\n    var b = new Blob([new Uint8Array([1,2])]);\n    return b.size === 2;\n  } catch(e) {\n    return false;\n  }\n})();\n\n/**\n * Check if BlobBuilder is supported\n */\n\nvar blobBuilderSupported = BlobBuilder\n  && BlobBuilder.prototype.append\n  && BlobBuilder.prototype.getBlob;\n\n/**\n * Helper function that maps ArrayBufferViews to ArrayBuffers\n * Used by BlobBuilder constructor and old browsers that didn't\n * support it in the Blob constructor.\n */\n\nfunction mapArrayBufferViews(ary) {\n  for (var i = 0; i < ary.length; i++) {\n    var chunk = ary[i];\n    if (chunk.buffer instanceof ArrayBuffer) {\n      var buf = chunk.buffer;\n\n      // if this is a subarray, make a copy so we only\n      // include the subarray region from the underlying buffer\n      if (chunk.byteLength !== buf.byteLength) {\n        var copy = new Uint8Array(chunk.byteLength);\n        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n        buf = copy.buffer;\n      }\n\n      ary[i] = buf;\n    }\n  }\n}\n\nfunction BlobBuilderConstructor(ary, options) {\n  options = options || {};\n\n  var bb = new BlobBuilder();\n  mapArrayBufferViews(ary);\n\n  for (var i = 0; i < ary.length; i++) {\n    bb.append(ary[i]);\n  }\n\n  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n};\n\nfunction BlobConstructor(ary, options) {\n  mapArrayBufferViews(ary);\n  return new Blob(ary, options || {});\n};\n\nmodule.exports = (function() {\n  if (blobSupported) {\n    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n  } else if (blobBuilderSupported) {\n    return BlobBuilderConstructor;\n  } else {\n    return undefined;\n  }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/blob/index.js\n// module id = 649\n// module chunks = 0\n\n//# sourceURL=../node_modules/blob/index.js")},function(module,exports){eval('module.exports = function decodeAsm (stdlib, foreign, buffer) {\n  \'use asm\'\n\n  // -- Imports\n\n  var heap = new stdlib.Uint8Array(buffer)\n  // var log = foreign.log\n  var pushInt = foreign.pushInt\n  var pushInt32 = foreign.pushInt32\n  var pushInt32Neg = foreign.pushInt32Neg\n  var pushInt64 = foreign.pushInt64\n  var pushInt64Neg = foreign.pushInt64Neg\n  var pushFloat = foreign.pushFloat\n  var pushFloatSingle = foreign.pushFloatSingle\n  var pushFloatDouble = foreign.pushFloatDouble\n  var pushTrue = foreign.pushTrue\n  var pushFalse = foreign.pushFalse\n  var pushUndefined = foreign.pushUndefined\n  var pushNull = foreign.pushNull\n  var pushInfinity = foreign.pushInfinity\n  var pushInfinityNeg = foreign.pushInfinityNeg\n  var pushNaN = foreign.pushNaN\n  var pushNaNNeg = foreign.pushNaNNeg\n\n  var pushArrayStart = foreign.pushArrayStart\n  var pushArrayStartFixed = foreign.pushArrayStartFixed\n  var pushArrayStartFixed32 = foreign.pushArrayStartFixed32\n  var pushArrayStartFixed64 = foreign.pushArrayStartFixed64\n  var pushObjectStart = foreign.pushObjectStart\n  var pushObjectStartFixed = foreign.pushObjectStartFixed\n  var pushObjectStartFixed32 = foreign.pushObjectStartFixed32\n  var pushObjectStartFixed64 = foreign.pushObjectStartFixed64\n\n  var pushByteString = foreign.pushByteString\n  var pushByteStringStart = foreign.pushByteStringStart\n  var pushUtf8String = foreign.pushUtf8String\n  var pushUtf8StringStart = foreign.pushUtf8StringStart\n\n  var pushSimpleUnassigned = foreign.pushSimpleUnassigned\n\n  var pushTagStart = foreign.pushTagStart\n  var pushTagStart4 = foreign.pushTagStart4\n  var pushTagStart8 = foreign.pushTagStart8\n  var pushTagUnassigned = foreign.pushTagUnassigned\n\n  var pushBreak = foreign.pushBreak\n\n  var pow = stdlib.Math.pow\n\n  // -- Constants\n\n\n  // -- Mutable Variables\n\n  var offset = 0\n  var inputLength = 0\n  var code = 0\n\n  // Decode a cbor string represented as Uint8Array\n  // which is allocated on the heap from 0 to inputLength\n  //\n  // input - Int\n  //\n  // Returns Code - Int,\n  // Success = 0\n  // Error > 0\n  function parse (input) {\n    input = input | 0\n\n    offset = 0\n    inputLength = input\n\n    while ((offset | 0) < (inputLength | 0)) {\n      code = jumpTable[heap[offset] & 255](heap[offset] | 0) | 0\n\n      if ((code | 0) > 0) {\n        break\n      }\n    }\n\n    return code | 0\n  }\n\n  // -- Helper Function\n\n  function checkOffset (n) {\n    n = n | 0\n\n    if ((((offset | 0) + (n | 0)) | 0) < (inputLength | 0)) {\n      return 0\n    }\n\n    return 1\n  }\n\n  function readUInt16 (n) {\n    n = n | 0\n\n    return (\n      (heap[n | 0] << 8) | heap[(n + 1) | 0]\n    ) | 0\n  }\n\n  function readUInt32 (n) {\n    n = n | 0\n\n    return (\n      (heap[n | 0] << 24) | (heap[(n + 1) | 0] << 16) | (heap[(n + 2) | 0] << 8) | heap[(n + 3) | 0]\n    ) | 0\n  }\n\n  // -- Initial Byte Handlers\n\n  function INT_P (octet) {\n    octet = octet | 0\n\n    pushInt(octet | 0)\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function UINT_P_8 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushInt(heap[(offset + 1) | 0] | 0)\n\n    offset = (offset + 2) | 0\n\n    return 0\n  }\n\n  function UINT_P_16 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    pushInt(\n      readUInt16((offset + 1) | 0) | 0\n    )\n\n    offset = (offset + 3) | 0\n\n    return 0\n  }\n\n  function UINT_P_32 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushInt32(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0\n    )\n\n    offset = (offset + 5) | 0\n\n    return 0\n  }\n\n  function UINT_P_64 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushInt64(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0,\n      readUInt16((offset + 5) | 0) | 0,\n      readUInt16((offset + 7) | 0) | 0\n    )\n\n    offset = (offset + 9) | 0\n\n    return 0\n  }\n\n  function INT_N (octet) {\n    octet = octet | 0\n\n    pushInt((-1 - ((octet - 32) | 0)) | 0)\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function UINT_N_8 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushInt(\n      (-1 - (heap[(offset + 1) | 0] | 0)) | 0\n    )\n\n    offset = (offset + 2) | 0\n\n    return 0\n  }\n\n  function UINT_N_16 (octet) {\n    octet = octet | 0\n\n    var val = 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    val = readUInt16((offset + 1) | 0) | 0\n    pushInt((-1 - (val | 0)) | 0)\n\n    offset = (offset + 3) | 0\n\n    return 0\n  }\n\n  function UINT_N_32 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushInt32Neg(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0\n    )\n\n    offset = (offset + 5) | 0\n\n    return 0\n  }\n\n  function UINT_N_64 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushInt64Neg(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0,\n      readUInt16((offset + 5) | 0) | 0,\n      readUInt16((offset + 7) | 0) | 0\n    )\n\n    offset = (offset + 9) | 0\n\n    return 0\n  }\n\n  function BYTE_STRING (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var step = 0\n\n    step = (octet - 64) | 0\n    if (checkOffset(step | 0) | 0) {\n      return 1\n    }\n\n    start = (offset + 1) | 0\n    end = (((offset + 1) | 0) + (step | 0)) | 0\n\n    pushByteString(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function BYTE_STRING_8 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    length = heap[(offset + 1) | 0] | 0\n    start = (offset + 2) | 0\n    end = (((offset + 2) | 0) + (length | 0)) | 0\n\n    if (checkOffset((length + 1) | 0) | 0) {\n      return 1\n    }\n\n    pushByteString(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function BYTE_STRING_16 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    length = readUInt16((offset + 1) | 0) | 0\n    start = (offset + 3) | 0\n    end = (((offset + 3) | 0) + (length | 0)) | 0\n\n\n    if (checkOffset((length + 2) | 0) | 0) {\n      return 1\n    }\n\n    pushByteString(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function BYTE_STRING_32 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    length = readUInt32((offset + 1) | 0) | 0\n    start = (offset + 5) | 0\n    end = (((offset + 5) | 0) + (length | 0)) | 0\n\n\n    if (checkOffset((length + 4) | 0) | 0) {\n      return 1\n    }\n\n    pushByteString(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function BYTE_STRING_64 (octet) {\n    // NOT IMPLEMENTED\n    octet = octet | 0\n\n    return 1\n  }\n\n  function BYTE_STRING_BREAK (octet) {\n    octet = octet | 0\n\n    pushByteStringStart()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function UTF8_STRING (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var step = 0\n\n    step = (octet - 96) | 0\n\n    if (checkOffset(step | 0) | 0) {\n      return 1\n    }\n\n    start = (offset + 1) | 0\n    end = (((offset + 1) | 0) + (step | 0)) | 0\n\n    pushUtf8String(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function UTF8_STRING_8 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    length = heap[(offset + 1) | 0] | 0\n    start = (offset + 2) | 0\n    end = (((offset + 2) | 0) + (length | 0)) | 0\n\n    if (checkOffset((length + 1) | 0) | 0) {\n      return 1\n    }\n\n    pushUtf8String(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function UTF8_STRING_16 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    length = readUInt16((offset + 1) | 0) | 0\n    start = (offset + 3) | 0\n    end = (((offset + 3) | 0) + (length | 0)) | 0\n\n    if (checkOffset((length + 2) | 0) | 0) {\n      return 1\n    }\n\n    pushUtf8String(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function UTF8_STRING_32 (octet) {\n    octet = octet | 0\n\n    var start = 0\n    var end = 0\n    var length = 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    length = readUInt32((offset + 1) | 0) | 0\n    start = (offset + 5) | 0\n    end = (((offset + 5) | 0) + (length | 0)) | 0\n\n    if (checkOffset((length + 4) | 0) | 0) {\n      return 1\n    }\n\n    pushUtf8String(start | 0, end | 0)\n\n    offset = end | 0\n\n    return 0\n  }\n\n  function UTF8_STRING_64 (octet) {\n    // NOT IMPLEMENTED\n    octet = octet | 0\n\n    return 1\n  }\n\n  function UTF8_STRING_BREAK (octet) {\n    octet = octet | 0\n\n    pushUtf8StringStart()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function ARRAY (octet) {\n    octet = octet | 0\n\n    pushArrayStartFixed((octet - 128) | 0)\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function ARRAY_8 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushArrayStartFixed(heap[(offset + 1) | 0] | 0)\n\n    offset = (offset + 2) | 0\n\n    return 0\n  }\n\n  function ARRAY_16 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    pushArrayStartFixed(\n      readUInt16((offset + 1) | 0) | 0\n    )\n\n    offset = (offset + 3) | 0\n\n    return 0\n  }\n\n  function ARRAY_32 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushArrayStartFixed32(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0\n    )\n\n    offset = (offset + 5) | 0\n\n    return 0\n  }\n\n  function ARRAY_64 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushArrayStartFixed64(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0,\n      readUInt16((offset + 5) | 0) | 0,\n      readUInt16((offset + 7) | 0) | 0\n    )\n\n    offset = (offset + 9) | 0\n\n    return 0\n  }\n\n  function ARRAY_BREAK (octet) {\n    octet = octet | 0\n\n    pushArrayStart()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function MAP (octet) {\n    octet = octet | 0\n\n    var step = 0\n\n    step = (octet - 160) | 0\n\n    if (checkOffset(step | 0) | 0) {\n      return 1\n    }\n\n    pushObjectStartFixed(step | 0)\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function MAP_8 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushObjectStartFixed(heap[(offset + 1) | 0] | 0)\n\n    offset = (offset + 2) | 0\n\n    return 0\n  }\n\n  function MAP_16 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    pushObjectStartFixed(\n      readUInt16((offset + 1) | 0) | 0\n    )\n\n    offset = (offset + 3) | 0\n\n    return 0\n  }\n\n  function MAP_32 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushObjectStartFixed32(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0\n    )\n\n    offset = (offset + 5) | 0\n\n    return 0\n  }\n\n  function MAP_64 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushObjectStartFixed64(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0,\n      readUInt16((offset + 5) | 0) | 0,\n      readUInt16((offset + 7) | 0) | 0\n    )\n\n    offset = (offset + 9) | 0\n\n    return 0\n  }\n\n  function MAP_BREAK (octet) {\n    octet = octet | 0\n\n    pushObjectStart()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function TAG_KNOWN (octet) {\n    octet = octet | 0\n\n    pushTagStart((octet - 192| 0) | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BIGNUM_POS (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BIGNUM_NEG (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_FRAC (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BIGNUM_FLOAT (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_UNASSIGNED (octet) {\n    octet = octet | 0\n\n    pushTagStart((octet - 192| 0) | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BASE64_URL (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BASE64 (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_BASE16 (octet) {\n    octet = octet | 0\n\n    pushTagStart(octet | 0)\n\n    offset = (offset + 1 | 0)\n\n    return 0\n  }\n\n  function TAG_MORE_1 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushTagStart(heap[(offset + 1) | 0] | 0)\n\n    offset = (offset + 2 | 0)\n\n    return 0\n  }\n\n  function TAG_MORE_2 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    pushTagStart(\n      readUInt16((offset + 1) | 0) | 0\n    )\n\n    offset = (offset + 3 | 0)\n\n    return 0\n  }\n\n  function TAG_MORE_4 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushTagStart4(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0\n    )\n\n    offset = (offset + 5 | 0)\n\n    return 0\n  }\n\n  function TAG_MORE_8 (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushTagStart8(\n      readUInt16((offset + 1) | 0) | 0,\n      readUInt16((offset + 3) | 0) | 0,\n      readUInt16((offset + 5) | 0) | 0,\n      readUInt16((offset + 7) | 0) | 0\n    )\n\n    offset = (offset + 9 | 0)\n\n    return 0\n  }\n\n  function SIMPLE_UNASSIGNED (octet) {\n    octet = octet | 0\n\n    pushSimpleUnassigned(((octet | 0) - 224) | 0)\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function SIMPLE_FALSE (octet) {\n    octet = octet | 0\n\n    pushFalse()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function SIMPLE_TRUE (octet) {\n    octet = octet | 0\n\n    pushTrue()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function SIMPLE_NULL (octet) {\n    octet = octet | 0\n\n    pushNull()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function SIMPLE_UNDEFINED (octet) {\n    octet = octet | 0\n\n    pushUndefined()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  function SIMPLE_BYTE (octet) {\n    octet = octet | 0\n\n    if (checkOffset(1) | 0) {\n      return 1\n    }\n\n    pushSimpleUnassigned(heap[(offset + 1) | 0] | 0)\n\n    offset = (offset + 2)  | 0\n\n    return 0\n  }\n\n  function SIMPLE_FLOAT_HALF (octet) {\n    octet = octet | 0\n\n    var f = 0\n    var g = 0\n    var sign = 1.0\n    var exp = 0.0\n    var mant = 0.0\n    var r = 0.0\n    if (checkOffset(2) | 0) {\n      return 1\n    }\n\n    f = heap[(offset + 1) | 0] | 0\n    g = heap[(offset + 2) | 0] | 0\n\n    if ((f | 0) & 0x80) {\n      sign = -1.0\n    }\n\n    exp = +(((f | 0) & 0x7C) >> 2)\n    mant = +((((f | 0) & 0x03) << 8) | g)\n\n    if (+exp == 0.0) {\n      pushFloat(+(\n        (+sign) * +5.9604644775390625e-8 * (+mant)\n      ))\n    } else if (+exp == 31.0) {\n      if (+sign == 1.0) {\n        if (+mant > 0.0) {\n          pushNaN()\n        } else {\n          pushInfinity()\n        }\n      } else {\n        if (+mant > 0.0) {\n          pushNaNNeg()\n        } else {\n          pushInfinityNeg()\n        }\n      }\n    } else {\n      pushFloat(+(\n        +sign * pow(+2, +(+exp - 25.0)) * +(1024.0 + mant)\n      ))\n    }\n\n    offset = (offset + 3) | 0\n\n    return 0\n  }\n\n  function SIMPLE_FLOAT_SINGLE (octet) {\n    octet = octet | 0\n\n    if (checkOffset(4) | 0) {\n      return 1\n    }\n\n    pushFloatSingle(\n      heap[(offset + 1) | 0] | 0,\n      heap[(offset + 2) | 0] | 0,\n      heap[(offset + 3) | 0] | 0,\n      heap[(offset + 4) | 0] | 0\n    )\n\n    offset = (offset + 5) | 0\n\n    return 0\n  }\n\n  function SIMPLE_FLOAT_DOUBLE (octet) {\n    octet = octet | 0\n\n    if (checkOffset(8) | 0) {\n      return 1\n    }\n\n    pushFloatDouble(\n      heap[(offset + 1) | 0] | 0,\n      heap[(offset + 2) | 0] | 0,\n      heap[(offset + 3) | 0] | 0,\n      heap[(offset + 4) | 0] | 0,\n      heap[(offset + 5) | 0] | 0,\n      heap[(offset + 6) | 0] | 0,\n      heap[(offset + 7) | 0] | 0,\n      heap[(offset + 8) | 0] | 0\n    )\n\n    offset = (offset + 9) | 0\n\n    return 0\n  }\n\n  function ERROR (octet) {\n    octet = octet | 0\n\n    return 1\n  }\n\n  function BREAK (octet) {\n    octet = octet | 0\n\n    pushBreak()\n\n    offset = (offset + 1) | 0\n\n    return 0\n  }\n\n  // -- Jump Table\n\n  var jumpTable = [\n    // Integer 0x00..0x17 (0..23)\n    INT_P, // 0x00\n    INT_P, // 0x01\n    INT_P, // 0x02\n    INT_P, // 0x03\n    INT_P, // 0x04\n    INT_P, // 0x05\n    INT_P, // 0x06\n    INT_P, // 0x07\n    INT_P, // 0x08\n    INT_P, // 0x09\n    INT_P, // 0x0A\n    INT_P, // 0x0B\n    INT_P, // 0x0C\n    INT_P, // 0x0D\n    INT_P, // 0x0E\n    INT_P, // 0x0F\n    INT_P, // 0x10\n    INT_P, // 0x11\n    INT_P, // 0x12\n    INT_P, // 0x13\n    INT_P, // 0x14\n    INT_P, // 0x15\n    INT_P, // 0x16\n    INT_P, // 0x17\n    // Unsigned integer (one-byte uint8_t follows)\n    UINT_P_8, // 0x18\n    // Unsigned integer (two-byte uint16_t follows)\n    UINT_P_16, // 0x19\n    // Unsigned integer (four-byte uint32_t follows)\n    UINT_P_32, // 0x1a\n    // Unsigned integer (eight-byte uint64_t follows)\n    UINT_P_64, // 0x1b\n    ERROR, // 0x1c\n    ERROR, // 0x1d\n    ERROR, // 0x1e\n    ERROR, // 0x1f\n    // Negative integer -1-0x00..-1-0x17 (-1..-24)\n    INT_N, // 0x20\n    INT_N, // 0x21\n    INT_N, // 0x22\n    INT_N, // 0x23\n    INT_N, // 0x24\n    INT_N, // 0x25\n    INT_N, // 0x26\n    INT_N, // 0x27\n    INT_N, // 0x28\n    INT_N, // 0x29\n    INT_N, // 0x2A\n    INT_N, // 0x2B\n    INT_N, // 0x2C\n    INT_N, // 0x2D\n    INT_N, // 0x2E\n    INT_N, // 0x2F\n    INT_N, // 0x30\n    INT_N, // 0x31\n    INT_N, // 0x32\n    INT_N, // 0x33\n    INT_N, // 0x34\n    INT_N, // 0x35\n    INT_N, // 0x36\n    INT_N, // 0x37\n    // Negative integer -1-n (one-byte uint8_t for n follows)\n    UINT_N_8, // 0x38\n    // Negative integer -1-n (two-byte uint16_t for n follows)\n    UINT_N_16, // 0x39\n    // Negative integer -1-n (four-byte uint32_t for nfollows)\n    UINT_N_32, // 0x3a\n    // Negative integer -1-n (eight-byte uint64_t for n follows)\n    UINT_N_64, // 0x3b\n    ERROR, // 0x3c\n    ERROR, // 0x3d\n    ERROR, // 0x3e\n    ERROR, // 0x3f\n    // byte string (0x00..0x17 bytes follow)\n    BYTE_STRING, // 0x40\n    BYTE_STRING, // 0x41\n    BYTE_STRING, // 0x42\n    BYTE_STRING, // 0x43\n    BYTE_STRING, // 0x44\n    BYTE_STRING, // 0x45\n    BYTE_STRING, // 0x46\n    BYTE_STRING, // 0x47\n    BYTE_STRING, // 0x48\n    BYTE_STRING, // 0x49\n    BYTE_STRING, // 0x4A\n    BYTE_STRING, // 0x4B\n    BYTE_STRING, // 0x4C\n    BYTE_STRING, // 0x4D\n    BYTE_STRING, // 0x4E\n    BYTE_STRING, // 0x4F\n    BYTE_STRING, // 0x50\n    BYTE_STRING, // 0x51\n    BYTE_STRING, // 0x52\n    BYTE_STRING, // 0x53\n    BYTE_STRING, // 0x54\n    BYTE_STRING, // 0x55\n    BYTE_STRING, // 0x56\n    BYTE_STRING, // 0x57\n    // byte string (one-byte uint8_t for n, and then n bytes follow)\n    BYTE_STRING_8, // 0x58\n    // byte string (two-byte uint16_t for n, and then n bytes follow)\n    BYTE_STRING_16, // 0x59\n    // byte string (four-byte uint32_t for n, and then n bytes follow)\n    BYTE_STRING_32, // 0x5a\n    // byte string (eight-byte uint64_t for n, and then n bytes follow)\n    BYTE_STRING_64, // 0x5b\n    ERROR, // 0x5c\n    ERROR, // 0x5d\n    ERROR, // 0x5e\n    // byte string, byte strings follow, terminated by "break"\n    BYTE_STRING_BREAK, // 0x5f\n    // UTF-8 string (0x00..0x17 bytes follow)\n    UTF8_STRING, // 0x60\n    UTF8_STRING, // 0x61\n    UTF8_STRING, // 0x62\n    UTF8_STRING, // 0x63\n    UTF8_STRING, // 0x64\n    UTF8_STRING, // 0x65\n    UTF8_STRING, // 0x66\n    UTF8_STRING, // 0x67\n    UTF8_STRING, // 0x68\n    UTF8_STRING, // 0x69\n    UTF8_STRING, // 0x6A\n    UTF8_STRING, // 0x6B\n    UTF8_STRING, // 0x6C\n    UTF8_STRING, // 0x6D\n    UTF8_STRING, // 0x6E\n    UTF8_STRING, // 0x6F\n    UTF8_STRING, // 0x70\n    UTF8_STRING, // 0x71\n    UTF8_STRING, // 0x72\n    UTF8_STRING, // 0x73\n    UTF8_STRING, // 0x74\n    UTF8_STRING, // 0x75\n    UTF8_STRING, // 0x76\n    UTF8_STRING, // 0x77\n    // UTF-8 string (one-byte uint8_t for n, and then n bytes follow)\n    UTF8_STRING_8, // 0x78\n    // UTF-8 string (two-byte uint16_t for n, and then n bytes follow)\n    UTF8_STRING_16, // 0x79\n    // UTF-8 string (four-byte uint32_t for n, and then n bytes follow)\n    UTF8_STRING_32, // 0x7a\n    // UTF-8 string (eight-byte uint64_t for n, and then n bytes follow)\n    UTF8_STRING_64, // 0x7b\n    // UTF-8 string, UTF-8 strings follow, terminated by "break"\n    ERROR, // 0x7c\n    ERROR, // 0x7d\n    ERROR, // 0x7e\n    UTF8_STRING_BREAK, // 0x7f\n    // array (0x00..0x17 data items follow)\n    ARRAY, // 0x80\n    ARRAY, // 0x81\n    ARRAY, // 0x82\n    ARRAY, // 0x83\n    ARRAY, // 0x84\n    ARRAY, // 0x85\n    ARRAY, // 0x86\n    ARRAY, // 0x87\n    ARRAY, // 0x88\n    ARRAY, // 0x89\n    ARRAY, // 0x8A\n    ARRAY, // 0x8B\n    ARRAY, // 0x8C\n    ARRAY, // 0x8D\n    ARRAY, // 0x8E\n    ARRAY, // 0x8F\n    ARRAY, // 0x90\n    ARRAY, // 0x91\n    ARRAY, // 0x92\n    ARRAY, // 0x93\n    ARRAY, // 0x94\n    ARRAY, // 0x95\n    ARRAY, // 0x96\n    ARRAY, // 0x97\n    // array (one-byte uint8_t fo, and then n data items follow)\n    ARRAY_8, // 0x98\n    // array (two-byte uint16_t for n, and then n data items follow)\n    ARRAY_16, // 0x99\n    // array (four-byte uint32_t for n, and then n data items follow)\n    ARRAY_32, // 0x9a\n    // array (eight-byte uint64_t for n, and then n data items follow)\n    ARRAY_64, // 0x9b\n    // array, data items follow, terminated by "break"\n    ERROR, // 0x9c\n    ERROR, // 0x9d\n    ERROR, // 0x9e\n    ARRAY_BREAK, // 0x9f\n    // map (0x00..0x17 pairs of data items follow)\n    MAP, // 0xa0\n    MAP, // 0xa1\n    MAP, // 0xa2\n    MAP, // 0xa3\n    MAP, // 0xa4\n    MAP, // 0xa5\n    MAP, // 0xa6\n    MAP, // 0xa7\n    MAP, // 0xa8\n    MAP, // 0xa9\n    MAP, // 0xaA\n    MAP, // 0xaB\n    MAP, // 0xaC\n    MAP, // 0xaD\n    MAP, // 0xaE\n    MAP, // 0xaF\n    MAP, // 0xb0\n    MAP, // 0xb1\n    MAP, // 0xb2\n    MAP, // 0xb3\n    MAP, // 0xb4\n    MAP, // 0xb5\n    MAP, // 0xb6\n    MAP, // 0xb7\n    // map (one-byte uint8_t for n, and then n pairs of data items follow)\n    MAP_8, // 0xb8\n    // map (two-byte uint16_t for n, and then n pairs of data items follow)\n    MAP_16, // 0xb9\n    // map (four-byte uint32_t for n, and then n pairs of data items follow)\n    MAP_32, // 0xba\n    // map (eight-byte uint64_t for n, and then n pairs of data items follow)\n    MAP_64, // 0xbb\n    ERROR, // 0xbc\n    ERROR, // 0xbd\n    ERROR, // 0xbe\n    // map, pairs of data items follow, terminated by "break"\n    MAP_BREAK, // 0xbf\n    // Text-based date/time (data item follows; see Section 2.4.1)\n    TAG_KNOWN, // 0xc0\n    // Epoch-based date/time (data item follows; see Section 2.4.1)\n    TAG_KNOWN, // 0xc1\n    // Positive bignum (data item "byte string" follows)\n    TAG_KNOWN, // 0xc2\n    // Negative bignum (data item "byte string" follows)\n    TAG_KNOWN, // 0xc3\n    // Decimal Fraction (data item "array" follows; see Section 2.4.3)\n    TAG_KNOWN, // 0xc4\n    // Bigfloat (data item "array" follows; see Section 2.4.3)\n    TAG_KNOWN, // 0xc5\n    // (tagged item)\n    TAG_UNASSIGNED, // 0xc6\n    TAG_UNASSIGNED, // 0xc7\n    TAG_UNASSIGNED, // 0xc8\n    TAG_UNASSIGNED, // 0xc9\n    TAG_UNASSIGNED, // 0xca\n    TAG_UNASSIGNED, // 0xcb\n    TAG_UNASSIGNED, // 0xcc\n    TAG_UNASSIGNED, // 0xcd\n    TAG_UNASSIGNED, // 0xce\n    TAG_UNASSIGNED, // 0xcf\n    TAG_UNASSIGNED, // 0xd0\n    TAG_UNASSIGNED, // 0xd1\n    TAG_UNASSIGNED, // 0xd2\n    TAG_UNASSIGNED, // 0xd3\n    TAG_UNASSIGNED, // 0xd4\n    // Expected Conversion (data item follows; see Section 2.4.4.2)\n    TAG_UNASSIGNED, // 0xd5\n    TAG_UNASSIGNED, // 0xd6\n    TAG_UNASSIGNED, // 0xd7\n    // (more tagged items, 1/2/4/8 bytes and then a data item follow)\n    TAG_MORE_1, // 0xd8\n    TAG_MORE_2, // 0xd9\n    TAG_MORE_4, // 0xda\n    TAG_MORE_8, // 0xdb\n    ERROR, // 0xdc\n    ERROR, // 0xdd\n    ERROR, // 0xde\n    ERROR, // 0xdf\n    // (simple value)\n    SIMPLE_UNASSIGNED, // 0xe0\n    SIMPLE_UNASSIGNED, // 0xe1\n    SIMPLE_UNASSIGNED, // 0xe2\n    SIMPLE_UNASSIGNED, // 0xe3\n    SIMPLE_UNASSIGNED, // 0xe4\n    SIMPLE_UNASSIGNED, // 0xe5\n    SIMPLE_UNASSIGNED, // 0xe6\n    SIMPLE_UNASSIGNED, // 0xe7\n    SIMPLE_UNASSIGNED, // 0xe8\n    SIMPLE_UNASSIGNED, // 0xe9\n    SIMPLE_UNASSIGNED, // 0xea\n    SIMPLE_UNASSIGNED, // 0xeb\n    SIMPLE_UNASSIGNED, // 0xec\n    SIMPLE_UNASSIGNED, // 0xed\n    SIMPLE_UNASSIGNED, // 0xee\n    SIMPLE_UNASSIGNED, // 0xef\n    SIMPLE_UNASSIGNED, // 0xf0\n    SIMPLE_UNASSIGNED, // 0xf1\n    SIMPLE_UNASSIGNED, // 0xf2\n    SIMPLE_UNASSIGNED, // 0xf3\n    // False\n    SIMPLE_FALSE, // 0xf4\n    // True\n    SIMPLE_TRUE, // 0xf5\n    // Null\n    SIMPLE_NULL, // 0xf6\n    // Undefined\n    SIMPLE_UNDEFINED, // 0xf7\n    // (simple value, one byte follows)\n    SIMPLE_BYTE, // 0xf8\n    // Half-Precision Float (two-byte IEEE 754)\n    SIMPLE_FLOAT_HALF, // 0xf9\n    // Single-Precision Float (four-byte IEEE 754)\n    SIMPLE_FLOAT_SINGLE, // 0xfa\n    // Double-Precision Float (eight-byte IEEE 754)\n    SIMPLE_FLOAT_DOUBLE, // 0xfb\n    ERROR, // 0xfc\n    ERROR, // 0xfd\n    ERROR, // 0xfe\n    // "break" stop code\n    BREAK // 0xff\n  ]\n\n  // --\n\n  return {\n    parse: parse\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/decoder.asm.js\n// module id = 650\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/decoder.asm.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Decoder = __webpack_require__(347)\nconst utils = __webpack_require__(236)\n\n/**\n * Output the diagnostic format from a stream of CBOR bytes.\n *\n */\nclass Diagnose extends Decoder {\n  createTag (tagNumber, value) {\n    return `${tagNumber}(${value})`\n  }\n\n  createInt (val) {\n    return super.createInt(val).toString()\n  }\n\n  createInt32 (f, g) {\n    return super.createInt32(f, g).toString()\n  }\n\n  createInt64 (f1, f2, g1, g2) {\n    return super.createInt64(f1, f2, g1, g2).toString()\n  }\n\n  createInt32Neg (f, g) {\n    return super.createInt32Neg(f, g).toString()\n  }\n\n  createInt64Neg (f1, f2, g1, g2) {\n    return super.createInt64Neg(f1, f2, g1, g2).toString()\n  }\n\n  createTrue () {\n    return 'true'\n  }\n\n  createFalse () {\n    return 'false'\n  }\n\n  createFloat (val) {\n    const fl = super.createFloat(val)\n    if (utils.isNegativeZero(val)) {\n      return '-0_1'\n    }\n\n    return `${fl}_1`\n  }\n\n  createFloatSingle (a, b, c, d) {\n    const fl = super.createFloatSingle(a, b, c, d)\n    return `${fl}_2`\n  }\n\n  createFloatDouble (a, b, c, d, e, f, g, h) {\n    const fl = super.createFloatDouble(a, b, c, d, e, f, g, h)\n    return `${fl}_3`\n  }\n\n  createByteString (raw, len) {\n    const val = raw.join(', ')\n\n    if (len === -1) {\n      return `(_ ${val})`\n    }\n    return `h'${val}`\n  }\n\n  createByteStringFromHeap (start, end) {\n    const val = (Buffer.from(\n      super.createByteStringFromHeap(start, end)\n    )).toString('hex')\n\n    return `h'${val}'`\n  }\n\n  createInfinity () {\n    return 'Infinity_1'\n  }\n\n  createInfinityNeg () {\n    return '-Infinity_1'\n  }\n\n  createNaN () {\n    return 'NaN_1'\n  }\n\n  createNaNNeg () {\n    return '-NaN_1'\n  }\n\n  createNull () {\n    return 'null'\n  }\n\n  createUndefined () {\n    return 'undefined'\n  }\n\n  createSimpleUnassigned (val) {\n    return `simple(${val})`\n  }\n\n  createArray (arr, len) {\n    const val = super.createArray(arr, len)\n\n    if (len === -1) {\n      // indefinite\n      return `[_ ${val.join(', ')}]`\n    }\n\n    return `[${val.join(', ')}]`\n  }\n\n  createMap (map, len) {\n    const val = super.createMap(map)\n    const list = Array.from(val.keys())\n      .reduce(collectObject(val), '')\n\n    if (len === -1) {\n      return `{_ ${list}}`\n    }\n\n    return `{${list}}`\n  }\n\n  createObject (obj, len) {\n    const val = super.createObject(obj)\n    const map = Object.keys(val)\n      .reduce(collectObject(val), '')\n\n    if (len === -1) {\n      return `{_ ${map}}`\n    }\n\n    return `{${map}}`\n  }\n\n  createUtf8String (raw, len) {\n    const val = raw.join(', ')\n\n    if (len === -1) {\n      return `(_ ${val})`\n    }\n\n    return `\"${val}\"`\n  }\n\n  createUtf8StringFromHeap (start, end) {\n    const val = (Buffer.from(\n      super.createUtf8StringFromHeap(start, end)\n    )).toString('utf8')\n\n    return `\"${val}\"`\n  }\n\n  static diagnose (input, enc) {\n    if (typeof input === 'string') {\n      input = Buffer.from(input, enc || 'hex')\n    }\n\n    const dec = new Diagnose()\n    return dec.decodeFirst(input)\n  }\n}\n\nmodule.exports = Diagnose\n\nfunction collectObject (val) {\n  return (acc, key) => {\n    if (acc) {\n      return `${acc}, ${key}: ${val[key]}`\n    }\n    return `${key}: ${val[key]}`\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/diagnose.js\n// module id = 651\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/diagnose.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst url = __webpack_require__(157)\nconst Bignumber = __webpack_require__(165)\n\nconst utils = __webpack_require__(236)\nconst constants = __webpack_require__(166)\nconst MT = constants.MT\nconst NUMBYTES = constants.NUMBYTES\nconst SHIFT32 = constants.SHIFT32\nconst SYMS = constants.SYMS\nconst TAG = constants.TAG\nconst HALF = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.TWO\nconst FLOAT = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.FOUR\nconst DOUBLE = (constants.MT.SIMPLE_FLOAT << 5) | constants.NUMBYTES.EIGHT\nconst TRUE = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.TRUE\nconst FALSE = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.FALSE\nconst UNDEFINED = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.UNDEFINED\nconst NULL = (constants.MT.SIMPLE_FLOAT << 5) | constants.SIMPLE.NULL\n\nconst MAXINT_BN = new Bignumber('0x20000000000000')\nconst BUF_NAN = Buffer.from('f97e00', 'hex')\nconst BUF_INF_NEG = Buffer.from('f9fc00', 'hex')\nconst BUF_INF_POS = Buffer.from('f97c00', 'hex')\n\nfunction toType (obj) {\n  // [object Type]\n  // --------8---1\n  return ({}).toString.call(obj).slice(8, -1)\n}\n\n/**\n * Transform JavaScript values into CBOR bytes\n *\n */\nclass Encoder {\n  /**\n   * @param {Object} [options={}]\n   * @param {function(Buffer)} options.stream\n   */\n  constructor (options) {\n    options = options || {}\n\n    this.streaming = typeof options.stream === 'function'\n    this.onData = options.stream\n\n    this.semanticTypes = [\n      [url.Url, this._pushUrl],\n      [Bignumber, this._pushBigNumber]\n    ]\n\n    const addTypes = options.genTypes || []\n    const len = addTypes.length\n    for (let i = 0; i < len; i++) {\n      this.addSemanticType(\n        addTypes[i][0],\n        addTypes[i][1]\n      )\n    }\n\n    this._reset()\n  }\n\n  addSemanticType (type, fun) {\n    const len = this.semanticTypes.length\n    for (let i = 0; i < len; i++) {\n      const typ = this.semanticTypes[i][0]\n      if (typ === type) {\n        const old = this.semanticTypes[i][1]\n        this.semanticTypes[i][1] = fun\n        return old\n      }\n    }\n    this.semanticTypes.push([type, fun])\n    return null\n  }\n\n  push (val) {\n    if (!val) {\n      return true\n    }\n\n    this.result[this.offset] = val\n    this.resultMethod[this.offset] = 0\n    this.resultLength[this.offset] = val.length\n    this.offset++\n\n    if (this.streaming) {\n      this.onData(this.finalize())\n    }\n\n    return true\n  }\n\n  pushWrite (val, method, len) {\n    this.result[this.offset] = val\n    this.resultMethod[this.offset] = method\n    this.resultLength[this.offset] = len\n    this.offset++\n\n    if (this.streaming) {\n      this.onData(this.finalize())\n    }\n\n    return true\n  }\n\n  _pushUInt8 (val) {\n    return this.pushWrite(val, 1, 1)\n  }\n\n  _pushUInt16BE (val) {\n    return this.pushWrite(val, 2, 2)\n  }\n\n  _pushUInt32BE (val) {\n    return this.pushWrite(val, 3, 4)\n  }\n\n  _pushDoubleBE (val) {\n    return this.pushWrite(val, 4, 8)\n  }\n\n  _pushNaN () {\n    return this.push(BUF_NAN)\n  }\n\n  _pushInfinity (obj) {\n    const half = (obj < 0) ? BUF_INF_NEG : BUF_INF_POS\n    return this.push(half)\n  }\n\n  _pushFloat (obj) {\n    const b2 = Buffer.allocUnsafe(2)\n\n    if (utils.writeHalf(b2, obj)) {\n      if (utils.parseHalf(b2) === obj) {\n        return this._pushUInt8(HALF) && this.push(b2)\n      }\n    }\n\n    const b4 = Buffer.allocUnsafe(4)\n    b4.writeFloatBE(obj, 0)\n    if (b4.readFloatBE(0) === obj) {\n      return this._pushUInt8(FLOAT) && this.push(b4)\n    }\n\n    return this._pushUInt8(DOUBLE) && this._pushDoubleBE(obj)\n  }\n\n  _pushInt (obj, mt, orig) {\n    const m = mt << 5\n    if (obj < 24) {\n      return this._pushUInt8(m | obj)\n    }\n\n    if (obj <= 0xff) {\n      return this._pushUInt8(m | NUMBYTES.ONE) && this._pushUInt8(obj)\n    }\n\n    if (obj <= 0xffff) {\n      return this._pushUInt8(m | NUMBYTES.TWO) && this._pushUInt16BE(obj)\n    }\n\n    if (obj <= 0xffffffff) {\n      return this._pushUInt8(m | NUMBYTES.FOUR) && this._pushUInt32BE(obj)\n    }\n\n    if (obj <= Number.MAX_SAFE_INTEGER) {\n      return this._pushUInt8(m | NUMBYTES.EIGHT) &&\n        this._pushUInt32BE(Math.floor(obj / SHIFT32)) &&\n        this._pushUInt32BE(obj % SHIFT32)\n    }\n\n    if (mt === MT.NEG_INT) {\n      return this._pushFloat(orig)\n    }\n\n    return this._pushFloat(obj)\n  }\n\n  _pushIntNum (obj) {\n    if (obj < 0) {\n      return this._pushInt(-obj - 1, MT.NEG_INT, obj)\n    } else {\n      return this._pushInt(obj, MT.POS_INT)\n    }\n  }\n\n  _pushNumber (obj) {\n    switch (false) {\n      case (obj === obj): // eslint-disable-line\n        return this._pushNaN(obj)\n      case isFinite(obj):\n        return this._pushInfinity(obj)\n      case ((obj % 1) !== 0):\n        return this._pushIntNum(obj)\n      default:\n        return this._pushFloat(obj)\n    }\n  }\n\n  _pushString (obj) {\n    const len = Buffer.byteLength(obj, 'utf8')\n    return this._pushInt(len, MT.UTF8_STRING) && this.pushWrite(obj, 5, len)\n  }\n\n  _pushBoolean (obj) {\n    return this._pushUInt8(obj ? TRUE : FALSE)\n  }\n\n  _pushUndefined (obj) {\n    return this._pushUInt8(UNDEFINED)\n  }\n\n  _pushArray (gen, obj) {\n    const len = obj.length\n    if (!gen._pushInt(len, MT.ARRAY)) {\n      return false\n    }\n    for (let j = 0; j < len; j++) {\n      if (!gen.pushAny(obj[j])) {\n        return false\n      }\n    }\n    return true\n  }\n\n  _pushTag (tag) {\n    return this._pushInt(tag, MT.TAG)\n  }\n\n  _pushDate (gen, obj) {\n    // Round date, to get seconds since 1970-01-01 00:00:00 as defined in\n    // Sec. 2.4.1 and get a possibly more compact encoding. Note that it is\n    // still allowed to encode fractions of seconds which can be achieved by\n    // changing overwriting the encode function for Date objects.\n    return gen._pushTag(TAG.DATE_EPOCH) && gen.pushAny(Math.round(obj / 1000))\n  }\n\n  _pushBuffer (gen, obj) {\n    return gen._pushInt(obj.length, MT.BYTE_STRING) && gen.push(obj)\n  }\n\n  _pushNoFilter (gen, obj) {\n    return gen._pushBuffer(gen, obj.slice())\n  }\n\n  _pushRegexp (gen, obj) {\n    return gen._pushTag(TAG.REGEXP) && gen.pushAny(obj.source)\n  }\n\n  _pushSet (gen, obj) {\n    if (!gen._pushInt(obj.size, MT.ARRAY)) {\n      return false\n    }\n    for (let x of obj) {\n      if (!gen.pushAny(x)) {\n        return false\n      }\n    }\n    return true\n  }\n\n  _pushUrl (gen, obj) {\n    return gen._pushTag(TAG.URI) && gen.pushAny(obj.format())\n  }\n\n  _pushBigint (obj) {\n    let tag = TAG.POS_BIGINT\n    if (obj.isNegative()) {\n      obj = obj.negated().minus(1)\n      tag = TAG.NEG_BIGINT\n    }\n    let str = obj.toString(16)\n    if (str.length % 2) {\n      str = '0' + str\n    }\n    const buf = Buffer.from(str, 'hex')\n    return this._pushTag(tag) && this._pushBuffer(this, buf)\n  }\n\n  _pushBigNumber (gen, obj) {\n    if (obj.isNaN()) {\n      return gen._pushNaN()\n    }\n    if (!obj.isFinite()) {\n      return gen._pushInfinity(obj.isNegative() ? -Infinity : Infinity)\n    }\n    if (obj.isInteger()) {\n      return gen._pushBigint(obj)\n    }\n    if (!(gen._pushTag(TAG.DECIMAL_FRAC) &&\n      gen._pushInt(2, MT.ARRAY))) {\n      return false\n    }\n\n    const dec = obj.decimalPlaces()\n    const slide = obj.multipliedBy(new Bignumber(10).pow(dec))\n    if (!gen._pushIntNum(-dec)) {\n      return false\n    }\n    if (slide.abs().isLessThan(MAXINT_BN)) {\n      return gen._pushIntNum(slide.toNumber())\n    } else {\n      return gen._pushBigint(slide)\n    }\n  }\n\n  _pushMap (gen, obj) {\n    if (!gen._pushInt(obj.size, MT.MAP)) {\n      return false\n    }\n\n    return this._pushRawMap(\n      obj.size,\n      Array.from(obj)\n    )\n  }\n\n  _pushObject (obj) {\n    if (!obj) {\n      return this._pushUInt8(NULL)\n    }\n\n    var len = this.semanticTypes.length\n    for (var i = 0; i < len; i++) {\n      if (obj instanceof this.semanticTypes[i][0]) {\n        return this.semanticTypes[i][1].call(obj, this, obj)\n      }\n    }\n\n    var f = obj.encodeCBOR\n    if (typeof f === 'function') {\n      return f.call(obj, this)\n    }\n\n    var keys = Object.keys(obj)\n    var keyLength = keys.length\n    if (!this._pushInt(keyLength, MT.MAP)) {\n      return false\n    }\n\n    return this._pushRawMap(\n      keyLength,\n      keys.map((k) => [k, obj[k]])\n    )\n  }\n\n  _pushRawMap (len, map) {\n    // Sort keys for canoncialization\n    // 1. encode key\n    // 2. shorter key comes before longer key\n    // 3. same length keys are sorted with lower\n    //    byte value before higher\n\n    map = map.map(function (a) {\n      a[0] = Encoder.encode(a[0])\n      return a\n    }).sort(utils.keySorter)\n\n    for (var j = 0; j < len; j++) {\n      if (!this.push(map[j][0])) {\n        return false\n      }\n\n      if (!this.pushAny(map[j][1])) {\n        return false\n      }\n    }\n\n    return true\n  }\n\n  /**\n   * Alias for `.pushAny`\n   *\n   * @param {*} obj\n   * @returns {boolean} true on success\n   */\n  write (obj) {\n    return this.pushAny(obj)\n  }\n\n  /**\n   * Push any supported type onto the encoded stream\n   *\n   * @param {any} obj\n   * @returns {boolean} true on success\n   */\n  pushAny (obj) {\n    var typ = toType(obj)\n\n    switch (typ) {\n      case 'Number':\n        return this._pushNumber(obj)\n      case 'String':\n        return this._pushString(obj)\n      case 'Boolean':\n        return this._pushBoolean(obj)\n      case 'Object':\n        return this._pushObject(obj)\n      case 'Array':\n        return this._pushArray(this, obj)\n      case 'Uint8Array':\n        return this._pushBuffer(this, Buffer.isBuffer(obj) ? obj : Buffer.from(obj))\n      case 'Null':\n        return this._pushUInt8(NULL)\n      case 'Undefined':\n        return this._pushUndefined(obj)\n      case 'Map':\n        return this._pushMap(this, obj)\n      case 'Set':\n        return this._pushSet(this, obj)\n      case 'Date':\n        return this._pushDate(this, obj)\n      case 'RegExp':\n        return this._pushRegexp(this, obj)\n      case 'Symbol':\n        switch (obj) {\n          case SYMS.NULL:\n            return this._pushObject(null)\n          case SYMS.UNDEFINED:\n            return this._pushUndefined(void 0)\n          // TODO: Add pluggable support for other symbols\n          default:\n            throw new Error('Unknown symbol: ' + obj.toString())\n        }\n      default:\n        throw new Error('Unknown type: ' + typeof obj + ', ' + (obj ? obj.toString() : ''))\n    }\n  }\n\n  finalize () {\n    if (this.offset === 0) {\n      return null\n    }\n\n    var result = this.result\n    var resultLength = this.resultLength\n    var resultMethod = this.resultMethod\n    var offset = this.offset\n\n    // Determine the size of the buffer\n    var size = 0\n    var i = 0\n\n    for (; i < offset; i++) {\n      size += resultLength[i]\n    }\n\n    var res = Buffer.allocUnsafe(size)\n    var index = 0\n    var length = 0\n\n    // Write the content into the result buffer\n    for (i = 0; i < offset; i++) {\n      length = resultLength[i]\n\n      switch (resultMethod[i]) {\n        case 0:\n          result[i].copy(res, index)\n          break\n        case 1:\n          res.writeUInt8(result[i], index, true)\n          break\n        case 2:\n          res.writeUInt16BE(result[i], index, true)\n          break\n        case 3:\n          res.writeUInt32BE(result[i], index, true)\n          break\n        case 4:\n          res.writeDoubleBE(result[i], index, true)\n          break\n        case 5:\n          res.write(result[i], index, length, 'utf8')\n          break\n        default:\n          throw new Error('unkown method')\n      }\n\n      index += length\n    }\n\n    var tmp = res\n\n    this._reset()\n\n    return tmp\n  }\n\n  _reset () {\n    this.result = []\n    this.resultMethod = []\n    this.resultLength = []\n    this.offset = 0\n  }\n\n  /**\n   * Encode the given value\n   * @param {*} o\n   * @returns {Buffer}\n   */\n  static encode (o) {\n    const enc = new Encoder()\n    const ret = enc.pushAny(o)\n    if (!ret) {\n      throw new Error('Failed to encode input')\n    }\n\n    return enc.finalize()\n  }\n}\n\nmodule.exports = Encoder\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/encoder.js\n// module id = 652\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/encoder.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// exports.Commented = require('./commented')\nexports.Diagnose = __webpack_require__(651)\nexports.Decoder = __webpack_require__(347)\nexports.Encoder = __webpack_require__(652)\nexports.Simple = __webpack_require__(348)\nexports.Tagged = __webpack_require__(349)\n\n// exports.comment = exports.Commented.comment\nexports.decodeAll = exports.Decoder.decodeAll\nexports.decodeFirst = exports.Decoder.decodeFirst\nexports.diagnose = exports.Diagnose.diagnose\nexports.encode = exports.Encoder.encode\nexports.decode = exports.Decoder.decode\n\nexports.leveldb = {\n  decode: exports.Decoder.decodeAll,\n  encode: exports.Encoder.encode,\n  buffer: true,\n  name: 'cbor'\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/borc/src/index.js\n// module id = 653\n// module chunks = 0\n\n//# sourceURL=../node_modules/borc/src/index.js")},function(module,exports,__webpack_require__){eval("var AuthCipher = __webpack_require__(351)\nvar Buffer = __webpack_require__(1).Buffer\nvar MODES = __webpack_require__(237)\nvar StreamCipher = __webpack_require__(355)\nvar Transform = __webpack_require__(77)\nvar aes = __webpack_require__(167)\nvar ebtk = __webpack_require__(184)\nvar inherits = __webpack_require__(3)\n\nfunction Decipher (mode, key, iv) {\n  Transform.call(this)\n\n  this._cache = new Splitter()\n  this._last = void 0\n  this._cipher = new aes.AES(key)\n  this._prev = Buffer.from(iv)\n  this._mode = mode\n  this._autopadding = true\n}\n\ninherits(Decipher, Transform)\n\nDecipher.prototype._update = function (data) {\n  this._cache.add(data)\n  var chunk\n  var thing\n  var out = []\n  while ((chunk = this._cache.get(this._autopadding))) {\n    thing = this._mode.decrypt(this, chunk)\n    out.push(thing)\n  }\n  return Buffer.concat(out)\n}\n\nDecipher.prototype._final = function () {\n  var chunk = this._cache.flush()\n  if (this._autopadding) {\n    return unpad(this._mode.decrypt(this, chunk))\n  } else if (chunk) {\n    throw new Error('data not multiple of block length')\n  }\n}\n\nDecipher.prototype.setAutoPadding = function (setTo) {\n  this._autopadding = !!setTo\n  return this\n}\n\nfunction Splitter () {\n  this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n  this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function (autoPadding) {\n  var out\n  if (autoPadding) {\n    if (this.cache.length > 16) {\n      out = this.cache.slice(0, 16)\n      this.cache = this.cache.slice(16)\n      return out\n    }\n  } else {\n    if (this.cache.length >= 16) {\n      out = this.cache.slice(0, 16)\n      this.cache = this.cache.slice(16)\n      return out\n    }\n  }\n\n  return null\n}\n\nSplitter.prototype.flush = function () {\n  if (this.cache.length) return this.cache\n}\n\nfunction unpad (last) {\n  var padded = last[15]\n  if (padded < 1 || padded > 16) {\n    throw new Error('unable to decrypt data')\n  }\n  var i = -1\n  while (++i < padded) {\n    if (last[(i + (16 - padded))] !== padded) {\n      throw new Error('unable to decrypt data')\n    }\n  }\n  if (padded === 16) return\n\n  return last.slice(0, 16 - padded)\n}\n\nfunction createDecipheriv (suite, password, iv) {\n  var config = MODES[suite.toLowerCase()]\n  if (!config) throw new TypeError('invalid suite type')\n\n  if (typeof iv === 'string') iv = Buffer.from(iv)\n  if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n  if (typeof password === 'string') password = Buffer.from(password)\n  if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n  if (config.type === 'stream') {\n    return new StreamCipher(config.module, password, iv, true)\n  } else if (config.type === 'auth') {\n    return new AuthCipher(config.module, password, iv, true)\n  }\n\n  return new Decipher(config.module, password, iv)\n}\n\nfunction createDecipher (suite, password) {\n  var config = MODES[suite.toLowerCase()]\n  if (!config) throw new TypeError('invalid suite type')\n\n  var keys = ebtk(password, false, config.key, config.iv)\n  return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createDecipher = createDecipher\nexports.createDecipheriv = createDecipheriv\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/decrypter.js\n// module id = 654\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/decrypter.js")},function(module,exports,__webpack_require__){eval("var MODES = __webpack_require__(237)\nvar AuthCipher = __webpack_require__(351)\nvar Buffer = __webpack_require__(1).Buffer\nvar StreamCipher = __webpack_require__(355)\nvar Transform = __webpack_require__(77)\nvar aes = __webpack_require__(167)\nvar ebtk = __webpack_require__(184)\nvar inherits = __webpack_require__(3)\n\nfunction Cipher (mode, key, iv) {\n  Transform.call(this)\n\n  this._cache = new Splitter()\n  this._cipher = new aes.AES(key)\n  this._prev = Buffer.from(iv)\n  this._mode = mode\n  this._autopadding = true\n}\n\ninherits(Cipher, Transform)\n\nCipher.prototype._update = function (data) {\n  this._cache.add(data)\n  var chunk\n  var thing\n  var out = []\n\n  while ((chunk = this._cache.get())) {\n    thing = this._mode.encrypt(this, chunk)\n    out.push(thing)\n  }\n\n  return Buffer.concat(out)\n}\n\nvar PADDING = Buffer.alloc(16, 0x10)\n\nCipher.prototype._final = function () {\n  var chunk = this._cache.flush()\n  if (this._autopadding) {\n    chunk = this._mode.encrypt(this, chunk)\n    this._cipher.scrub()\n    return chunk\n  }\n\n  if (!chunk.equals(PADDING)) {\n    this._cipher.scrub()\n    throw new Error('data not multiple of block length')\n  }\n}\n\nCipher.prototype.setAutoPadding = function (setTo) {\n  this._autopadding = !!setTo\n  return this\n}\n\nfunction Splitter () {\n  this.cache = Buffer.allocUnsafe(0)\n}\n\nSplitter.prototype.add = function (data) {\n  this.cache = Buffer.concat([this.cache, data])\n}\n\nSplitter.prototype.get = function () {\n  if (this.cache.length > 15) {\n    var out = this.cache.slice(0, 16)\n    this.cache = this.cache.slice(16)\n    return out\n  }\n  return null\n}\n\nSplitter.prototype.flush = function () {\n  var len = 16 - this.cache.length\n  var padBuff = Buffer.allocUnsafe(len)\n\n  var i = -1\n  while (++i < len) {\n    padBuff.writeUInt8(len, i)\n  }\n\n  return Buffer.concat([this.cache, padBuff])\n}\n\nfunction createCipheriv (suite, password, iv) {\n  var config = MODES[suite.toLowerCase()]\n  if (!config) throw new TypeError('invalid suite type')\n\n  if (typeof password === 'string') password = Buffer.from(password)\n  if (password.length !== config.key / 8) throw new TypeError('invalid key length ' + password.length)\n\n  if (typeof iv === 'string') iv = Buffer.from(iv)\n  if (config.mode !== 'GCM' && iv.length !== config.iv) throw new TypeError('invalid iv length ' + iv.length)\n\n  if (config.type === 'stream') {\n    return new StreamCipher(config.module, password, iv)\n  } else if (config.type === 'auth') {\n    return new AuthCipher(config.module, password, iv)\n  }\n\n  return new Cipher(config.module, password, iv)\n}\n\nfunction createCipher (suite, password) {\n  var config = MODES[suite.toLowerCase()]\n  if (!config) throw new TypeError('invalid suite type')\n\n  var keys = ebtk(password, false, config.key, config.iv)\n  return createCipheriv(suite, keys.key, keys.iv)\n}\n\nexports.createCipheriv = createCipheriv\nexports.createCipher = createCipher\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/encrypter.js\n// module id = 655\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/encrypter.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar ZEROES = Buffer.alloc(16, 0)\n\nfunction toArray (buf) {\n  return [\n    buf.readUInt32BE(0),\n    buf.readUInt32BE(4),\n    buf.readUInt32BE(8),\n    buf.readUInt32BE(12)\n  ]\n}\n\nfunction fromArray (out) {\n  var buf = Buffer.allocUnsafe(16)\n  buf.writeUInt32BE(out[0] >>> 0, 0)\n  buf.writeUInt32BE(out[1] >>> 0, 4)\n  buf.writeUInt32BE(out[2] >>> 0, 8)\n  buf.writeUInt32BE(out[3] >>> 0, 12)\n  return buf\n}\n\nfunction GHASH (key) {\n  this.h = key\n  this.state = Buffer.alloc(16, 0)\n  this.cache = Buffer.allocUnsafe(0)\n}\n\n// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\n// by Juho Vähä-Herttua\nGHASH.prototype.ghash = function (block) {\n  var i = -1\n  while (++i < block.length) {\n    this.state[i] ^= block[i]\n  }\n  this._multiply()\n}\n\nGHASH.prototype._multiply = function () {\n  var Vi = toArray(this.h)\n  var Zi = [0, 0, 0, 0]\n  var j, xi, lsbVi\n  var i = -1\n  while (++i < 128) {\n    xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0\n    if (xi) {\n      // Z_i+1 = Z_i ^ V_i\n      Zi[0] ^= Vi[0]\n      Zi[1] ^= Vi[1]\n      Zi[2] ^= Vi[2]\n      Zi[3] ^= Vi[3]\n    }\n\n    // Store the value of LSB(V_i)\n    lsbVi = (Vi[3] & 1) !== 0\n\n    // V_i+1 = V_i >> 1\n    for (j = 3; j > 0; j--) {\n      Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)\n    }\n    Vi[0] = Vi[0] >>> 1\n\n    // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\n    if (lsbVi) {\n      Vi[0] = Vi[0] ^ (0xe1 << 24)\n    }\n  }\n  this.state = fromArray(Zi)\n}\n\nGHASH.prototype.update = function (buf) {\n  this.cache = Buffer.concat([this.cache, buf])\n  var chunk\n  while (this.cache.length >= 16) {\n    chunk = this.cache.slice(0, 16)\n    this.cache = this.cache.slice(16)\n    this.ghash(chunk)\n  }\n}\n\nGHASH.prototype.final = function (abl, bl) {\n  if (this.cache.length) {\n    this.ghash(Buffer.concat([this.cache, ZEROES], 16))\n  }\n\n  this.ghash(fromArray([0, abl, 0, bl]))\n  return this.state\n}\n\nmodule.exports = GHASH\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/ghash.js\n// module id = 656\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/ghash.js")},function(module,exports,__webpack_require__){eval("var xor = __webpack_require__(134)\n\nexports.encrypt = function (self, block) {\n  var data = xor(block, self._prev)\n\n  self._prev = self._cipher.encryptBlock(data)\n  return self._prev\n}\n\nexports.decrypt = function (self, block) {\n  var pad = self._prev\n\n  self._prev = block\n  var out = self._cipher.decryptBlock(block)\n\n  return xor(out, pad)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/cbc.js\n// module id = 657\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/cbc.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\nvar xor = __webpack_require__(134)\n\nfunction encryptStart (self, data, decrypt) {\n  var len = data.length\n  var out = xor(data, self._cache)\n  self._cache = self._cache.slice(len)\n  self._prev = Buffer.concat([self._prev, decrypt ? data : out])\n  return out\n}\n\nexports.encrypt = function (self, data, decrypt) {\n  var out = Buffer.allocUnsafe(0)\n  var len\n\n  while (data.length) {\n    if (self._cache.length === 0) {\n      self._cache = self._cipher.encryptBlock(self._prev)\n      self._prev = Buffer.allocUnsafe(0)\n    }\n\n    if (self._cache.length <= data.length) {\n      len = self._cache.length\n      out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])\n      data = data.slice(len)\n    } else {\n      out = Buffer.concat([out, encryptStart(self, data, decrypt)])\n      break\n    }\n  }\n\n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/cfb.js\n// module id = 658\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/cfb.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n  var pad\n  var i = -1\n  var len = 8\n  var out = 0\n  var bit, value\n  while (++i < len) {\n    pad = self._cipher.encryptBlock(self._prev)\n    bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0\n    value = pad[0] ^ bit\n    out += ((value & 0x80) >> (i % 8))\n    self._prev = shiftIn(self._prev, decrypt ? bit : value)\n  }\n  return out\n}\n\nfunction shiftIn (buffer, value) {\n  var len = buffer.length\n  var i = -1\n  var out = Buffer.allocUnsafe(buffer.length)\n  buffer = Buffer.concat([buffer, Buffer.from([value])])\n\n  while (++i < len) {\n    out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)\n  }\n\n  return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n  var len = chunk.length\n  var out = Buffer.allocUnsafe(len)\n  var i = -1\n\n  while (++i < len) {\n    out[i] = encryptByte(self, chunk[i], decrypt)\n  }\n\n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/cfb1.js\n// module id = 659\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/cfb1.js")},function(module,exports,__webpack_require__){eval("var Buffer = __webpack_require__(1).Buffer\n\nfunction encryptByte (self, byteParam, decrypt) {\n  var pad = self._cipher.encryptBlock(self._prev)\n  var out = pad[0] ^ byteParam\n\n  self._prev = Buffer.concat([\n    self._prev.slice(1),\n    Buffer.from([decrypt ? byteParam : out])\n  ])\n\n  return out\n}\n\nexports.encrypt = function (self, chunk, decrypt) {\n  var len = chunk.length\n  var out = Buffer.allocUnsafe(len)\n  var i = -1\n\n  while (++i < len) {\n    out[i] = encryptByte(self, chunk[i], decrypt)\n  }\n\n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/cfb8.js\n// module id = 660\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/cfb8.js")},function(module,exports){eval("exports.encrypt = function (self, block) {\n  return self._cipher.encryptBlock(block)\n}\n\nexports.decrypt = function (self, block) {\n  return self._cipher.decryptBlock(block)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/ecb.js\n// module id = 661\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/ecb.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(134)\n\nfunction getBlock (self) {\n  self._prev = self._cipher.encryptBlock(self._prev)\n  return self._prev\n}\n\nexports.encrypt = function (self, chunk) {\n  while (self._cache.length < chunk.length) {\n    self._cache = Buffer.concat([self._cache, getBlock(self)])\n  }\n\n  var pad = self._cache.slice(0, chunk.length)\n  self._cache = self._cache.slice(chunk.length)\n  return xor(chunk, pad)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-aes/modes/ofb.js\n// module id = 662\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-aes/modes/ofb.js")},function(module,exports,__webpack_require__){eval("var ebtk = __webpack_require__(184)\nvar aes = __webpack_require__(168)\nvar DES = __webpack_require__(664)\nvar desModes = __webpack_require__(665)\nvar aesModes = __webpack_require__(237)\nfunction createCipher (suite, password) {\n  var keyLen, ivLen\n  suite = suite.toLowerCase()\n  if (aesModes[suite]) {\n    keyLen = aesModes[suite].key\n    ivLen = aesModes[suite].iv\n  } else if (desModes[suite]) {\n    keyLen = desModes[suite].key * 8\n    ivLen = desModes[suite].iv\n  } else {\n    throw new TypeError('invalid suite type')\n  }\n  var keys = ebtk(password, false, keyLen, ivLen)\n  return createCipheriv(suite, keys.key, keys.iv)\n}\nfunction createDecipher (suite, password) {\n  var keyLen, ivLen\n  suite = suite.toLowerCase()\n  if (aesModes[suite]) {\n    keyLen = aesModes[suite].key\n    ivLen = aesModes[suite].iv\n  } else if (desModes[suite]) {\n    keyLen = desModes[suite].key * 8\n    ivLen = desModes[suite].iv\n  } else {\n    throw new TypeError('invalid suite type')\n  }\n  var keys = ebtk(password, false, keyLen, ivLen)\n  return createDecipheriv(suite, keys.key, keys.iv)\n}\n\nfunction createCipheriv (suite, key, iv) {\n  suite = suite.toLowerCase()\n  if (aesModes[suite]) {\n    return aes.createCipheriv(suite, key, iv)\n  } else if (desModes[suite]) {\n    return new DES({\n      key: key,\n      iv: iv,\n      mode: suite\n    })\n  } else {\n    throw new TypeError('invalid suite type')\n  }\n}\nfunction createDecipheriv (suite, key, iv) {\n  suite = suite.toLowerCase()\n  if (aesModes[suite]) {\n    return aes.createDecipheriv(suite, key, iv)\n  } else if (desModes[suite]) {\n    return new DES({\n      key: key,\n      iv: iv,\n      mode: suite,\n      decrypt: true\n    })\n  } else {\n    throw new TypeError('invalid suite type')\n  }\n}\nexports.createCipher = exports.Cipher = createCipher\nexports.createCipheriv = exports.Cipheriv = createCipheriv\nexports.createDecipher = exports.Decipher = createDecipher\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv\nfunction getCiphers () {\n  return Object.keys(desModes).concat(aes.getCiphers())\n}\nexports.listCiphers = exports.getCiphers = getCiphers\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-cipher/browser.js\n// module id = 663\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-cipher/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var CipherBase = __webpack_require__(77)\nvar des = __webpack_require__(256)\nvar inherits = __webpack_require__(3)\n\nvar modes = {\n  'des-ede3-cbc': des.CBC.instantiate(des.EDE),\n  'des-ede3': des.EDE,\n  'des-ede-cbc': des.CBC.instantiate(des.EDE),\n  'des-ede': des.EDE,\n  'des-cbc': des.CBC.instantiate(des.DES),\n  'des-ecb': des.DES\n}\nmodes.des = modes['des-cbc']\nmodes.des3 = modes['des-ede3-cbc']\nmodule.exports = DES\ninherits(DES, CipherBase)\nfunction DES (opts) {\n  CipherBase.call(this)\n  var modeName = opts.mode.toLowerCase()\n  var mode = modes[modeName]\n  var type\n  if (opts.decrypt) {\n    type = 'decrypt'\n  } else {\n    type = 'encrypt'\n  }\n  var key = opts.key\n  if (modeName === 'des-ede' || modeName === 'des-ede-cbc') {\n    key = Buffer.concat([key, key.slice(0, 8)])\n  }\n  var iv = opts.iv\n  this._des = mode.create({\n    key: key,\n    iv: iv,\n    type: type\n  })\n}\nDES.prototype._update = function (data) {\n  return new Buffer(this._des.update(data))\n}\nDES.prototype._final = function () {\n  return new Buffer(this._des.final())\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-des/index.js\n// module id = 664\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-des/index.js")},function(module,exports){eval("exports['des-ecb'] = {\n  key: 8,\n  iv: 0\n}\nexports['des-cbc'] = exports.des = {\n  key: 8,\n  iv: 8\n}\nexports['des-ede3-cbc'] = exports.des3 = {\n  key: 24,\n  iv: 8\n}\nexports['des-ede3'] = {\n  key: 24,\n  iv: 0\n}\nexports['des-ede-cbc'] = {\n  key: 16,\n  iv: 8\n}\nexports['des-ede'] = {\n  key: 16,\n  iv: 0\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-des/modes.js\n// module id = 665\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-des/modes.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(356)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/algos.js\n// module id = 666\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/algos.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(59)\nvar stream = __webpack_require__(46)\nvar inherits = __webpack_require__(3)\nvar sign = __webpack_require__(668)\nvar verify = __webpack_require__(669)\n\nvar algorithms = __webpack_require__(356)\nObject.keys(algorithms).forEach(function (key) {\n  algorithms[key].id = new Buffer(algorithms[key].id, 'hex')\n  algorithms[key.toLowerCase()] = algorithms[key]\n})\n\nfunction Sign (algorithm) {\n  stream.Writable.call(this)\n\n  var data = algorithms[algorithm]\n  if (!data) throw new Error('Unknown message digest')\n\n  this._hashType = data.hash\n  this._hash = createHash(data.hash)\n  this._tag = data.id\n  this._signType = data.sign\n}\ninherits(Sign, stream.Writable)\n\nSign.prototype._write = function _write (data, _, done) {\n  this._hash.update(data)\n  done()\n}\n\nSign.prototype.update = function update (data, enc) {\n  if (typeof data === 'string') data = new Buffer(data, enc)\n\n  this._hash.update(data)\n  return this\n}\n\nSign.prototype.sign = function signMethod (key, enc) {\n  this.end()\n  var hash = this._hash.digest()\n  var sig = sign(hash, key, this._hashType, this._signType, this._tag)\n\n  return enc ? sig.toString(enc) : sig\n}\n\nfunction Verify (algorithm) {\n  stream.Writable.call(this)\n\n  var data = algorithms[algorithm]\n  if (!data) throw new Error('Unknown message digest')\n\n  this._hash = createHash(data.hash)\n  this._tag = data.id\n  this._signType = data.sign\n}\ninherits(Verify, stream.Writable)\n\nVerify.prototype._write = function _write (data, _, done) {\n  this._hash.update(data)\n  done()\n}\n\nVerify.prototype.update = function update (data, enc) {\n  if (typeof data === 'string') data = new Buffer(data, enc)\n\n  this._hash.update(data)\n  return this\n}\n\nVerify.prototype.verify = function verifyMethod (key, sig, enc) {\n  if (typeof sig === 'string') sig = new Buffer(sig, enc)\n\n  this.end()\n  var hash = this._hash.digest()\n  return verify(sig, hash, key, this._signType, this._tag)\n}\n\nfunction createSign (algorithm) {\n  return new Sign(algorithm)\n}\n\nfunction createVerify (algorithm) {\n  return new Verify(algorithm)\n}\n\nmodule.exports = {\n  Sign: createSign,\n  Verify: createVerify,\n  createSign: createSign,\n  createVerify: createVerify\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/browser/index.js\n// module id = 667\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/browser/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar createHmac = __webpack_require__(140)\nvar crt = __webpack_require__(238)\nvar EC = __webpack_require__(28).ec\nvar BN = __webpack_require__(17)\nvar parseKeys = __webpack_require__(200)\nvar curves = __webpack_require__(357)\n\nfunction sign (hash, key, hashType, signType, tag) {\n  var priv = parseKeys(key)\n  if (priv.curve) {\n    // rsa keys can be interpreted as ecdsa ones in openssl\n    if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')\n    return ecSign(hash, priv)\n  } else if (priv.type === 'dsa') {\n    if (signType !== 'dsa') throw new Error('wrong private key type')\n    return dsaSign(hash, priv, hashType)\n  } else {\n    if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong private key type')\n  }\n  hash = Buffer.concat([tag, hash])\n  var len = priv.modulus.byteLength()\n  var pad = [ 0, 1 ]\n  while (hash.length + pad.length + 1 < len) pad.push(0xff)\n  pad.push(0x00)\n  var i = -1\n  while (++i < hash.length) pad.push(hash[i])\n\n  var out = crt(pad, priv)\n  return out\n}\n\nfunction ecSign (hash, priv) {\n  var curveId = curves[priv.curve.join('.')]\n  if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))\n\n  var curve = new EC(curveId)\n  var key = curve.keyFromPrivate(priv.privateKey)\n  var out = key.sign(hash)\n\n  return new Buffer(out.toDER())\n}\n\nfunction dsaSign (hash, priv, algo) {\n  var x = priv.params.priv_key\n  var p = priv.params.p\n  var q = priv.params.q\n  var g = priv.params.g\n  var r = new BN(0)\n  var k\n  var H = bits2int(hash, q).mod(q)\n  var s = false\n  var kv = getKey(x, q, hash, algo)\n  while (s === false) {\n    k = makeKey(q, kv, algo)\n    r = makeR(g, k, p, q)\n    s = k.invm(q).imul(H.add(x.mul(r))).mod(q)\n    if (s.cmpn(0) === 0) {\n      s = false\n      r = new BN(0)\n    }\n  }\n  return toDER(r, s)\n}\n\nfunction toDER (r, s) {\n  r = r.toArray()\n  s = s.toArray()\n\n  // Pad values\n  if (r[0] & 0x80) r = [ 0 ].concat(r)\n  if (s[0] & 0x80) s = [ 0 ].concat(s)\n\n  var total = r.length + s.length + 4\n  var res = [ 0x30, total, 0x02, r.length ]\n  res = res.concat(r, [ 0x02, s.length ], s)\n  return new Buffer(res)\n}\n\nfunction getKey (x, q, hash, algo) {\n  x = new Buffer(x.toArray())\n  if (x.length < q.byteLength()) {\n    var zeros = new Buffer(q.byteLength() - x.length)\n    zeros.fill(0)\n    x = Buffer.concat([ zeros, x ])\n  }\n  var hlen = hash.length\n  var hbits = bits2octets(hash, q)\n  var v = new Buffer(hlen)\n  v.fill(1)\n  var k = new Buffer(hlen)\n  k.fill(0)\n  k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest()\n  v = createHmac(algo, k).update(v).digest()\n  k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest()\n  v = createHmac(algo, k).update(v).digest()\n  return { k: k, v: v }\n}\n\nfunction bits2int (obits, q) {\n  var bits = new BN(obits)\n  var shift = (obits.length << 3) - q.bitLength()\n  if (shift > 0) bits.ishrn(shift)\n  return bits\n}\n\nfunction bits2octets (bits, q) {\n  bits = bits2int(bits, q)\n  bits = bits.mod(q)\n  var out = new Buffer(bits.toArray())\n  if (out.length < q.byteLength()) {\n    var zeros = new Buffer(q.byteLength() - out.length)\n    zeros.fill(0)\n    out = Buffer.concat([ zeros, out ])\n  }\n  return out\n}\n\nfunction makeKey (q, kv, algo) {\n  var t\n  var k\n\n  do {\n    t = new Buffer(0)\n\n    while (t.length * 8 < q.bitLength()) {\n      kv.v = createHmac(algo, kv.k).update(kv.v).digest()\n      t = Buffer.concat([ t, kv.v ])\n    }\n\n    k = bits2int(t, q)\n    kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest()\n    kv.v = createHmac(algo, kv.k).update(kv.v).digest()\n  } while (k.cmp(q) !== -1)\n\n  return k\n}\n\nfunction makeR (g, k, p, q) {\n  return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)\n}\n\nmodule.exports = sign\nmodule.exports.getKey = getKey\nmodule.exports.makeKey = makeKey\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/browser/sign.js\n// module id = 668\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/browser/sign.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\nvar BN = __webpack_require__(17)\nvar EC = __webpack_require__(28).ec\nvar parseKeys = __webpack_require__(200)\nvar curves = __webpack_require__(357)\n\nfunction verify (sig, hash, key, signType, tag) {\n  var pub = parseKeys(key)\n  if (pub.type === 'ec') {\n    // rsa keys can be interpreted as ecdsa ones in openssl\n    if (signType !== 'ecdsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')\n    return ecVerify(sig, hash, pub)\n  } else if (pub.type === 'dsa') {\n    if (signType !== 'dsa') throw new Error('wrong public key type')\n    return dsaVerify(sig, hash, pub)\n  } else {\n    if (signType !== 'rsa' && signType !== 'ecdsa/rsa') throw new Error('wrong public key type')\n  }\n  hash = Buffer.concat([tag, hash])\n  var len = pub.modulus.byteLength()\n  var pad = [ 1 ]\n  var padNum = 0\n  while (hash.length + pad.length + 2 < len) {\n    pad.push(0xff)\n    padNum++\n  }\n  pad.push(0x00)\n  var i = -1\n  while (++i < hash.length) {\n    pad.push(hash[i])\n  }\n  pad = new Buffer(pad)\n  var red = BN.mont(pub.modulus)\n  sig = new BN(sig).toRed(red)\n\n  sig = sig.redPow(new BN(pub.publicExponent))\n  sig = new Buffer(sig.fromRed().toArray())\n  var out = padNum < 8 ? 1 : 0\n  len = Math.min(sig.length, pad.length)\n  if (sig.length !== pad.length) out = 1\n\n  i = -1\n  while (++i < len) out |= sig[i] ^ pad[i]\n  return out === 0\n}\n\nfunction ecVerify (sig, hash, pub) {\n  var curveId = curves[pub.data.algorithm.curve.join('.')]\n  if (!curveId) throw new Error('unknown curve ' + pub.data.algorithm.curve.join('.'))\n\n  var curve = new EC(curveId)\n  var pubkey = pub.data.subjectPrivateKey.data\n\n  return curve.verify(hash, sig, pubkey)\n}\n\nfunction dsaVerify (sig, hash, pub) {\n  var p = pub.data.p\n  var q = pub.data.q\n  var g = pub.data.g\n  var y = pub.data.pub_key\n  var unpacked = parseKeys.signature.decode(sig, 'der')\n  var s = unpacked.s\n  var r = unpacked.r\n  checkValue(s, q)\n  checkValue(r, q)\n  var montp = BN.mont(p)\n  var w = s.invm(q)\n  var v = g.toRed(montp)\n    .redPow(new BN(hash).mul(w).mod(q))\n    .fromRed()\n    .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())\n    .mod(p)\n    .mod(q)\n  return v.cmp(r) === 0\n}\n\nfunction checkValue (b, q) {\n  if (b.cmpn(0) <= 0) throw new Error('invalid sig')\n  if (b.cmp(q) >= q) throw new Error('invalid sig')\n}\n\nmodule.exports = verify\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browserify-sign/browser/verify.js\n// module id = 669\n// module chunks = 0\n\n//# sourceURL=../node_modules/browserify-sign/browser/verify.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar base58 = __webpack_require__(76)\nvar Buffer = __webpack_require__(1).Buffer\n\nmodule.exports = function (checksumFn) {\n  // Encode a buffer as a base58-check encoded string\n  function encode (payload) {\n    var checksum = checksumFn(payload)\n\n    return base58.encode(Buffer.concat([\n      payload,\n      checksum\n    ], payload.length + 4))\n  }\n\n  function decodeRaw (buffer) {\n    var payload = buffer.slice(0, -4)\n    var checksum = buffer.slice(-4)\n    var newChecksum = checksumFn(payload)\n\n    if (checksum[0] ^ newChecksum[0] |\n        checksum[1] ^ newChecksum[1] |\n        checksum[2] ^ newChecksum[2] |\n        checksum[3] ^ newChecksum[3]) return\n\n    return payload\n  }\n\n  // Decode a base58-check encoded string to a buffer, no result if checksum is wrong\n  function decodeUnsafe (string) {\n    var buffer = base58.decodeUnsafe(string)\n    if (!buffer) return\n\n    return decodeRaw(buffer)\n  }\n\n  function decode (string) {\n    var buffer = base58.decode(string)\n    var payload = decodeRaw(buffer, checksumFn)\n    if (!payload) throw new Error('Invalid checksum')\n    return payload\n  }\n\n  return {\n    encode: encode,\n    decode: decode,\n    decodeUnsafe: decodeUnsafe\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/bs58check/base.js\n// module id = 670\n// module chunks = 0\n\n//# sourceURL=../node_modules/bs58check/base.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(32)\n\nvar CIDUtil = {\n  /**\n   * Test if the given input is a valid CID object.\n   * Returns an error message if it is not.\n   * Returns undefined if it is a valid CID.\n   *\n   * @param {any} other\n   * @returns {string}\n   */\n  checkCIDComponents: function (other) {\n    if (other == null) {\n      return 'null values are not valid CIDs'\n    }\n\n    if (!(other.version === 0 || other.version === 1)) {\n      return 'Invalid version, must be a number equal to 1 or 0'\n    }\n\n    if (typeof other.codec !== 'string') {\n      return 'codec must be string'\n    }\n\n    if (!Buffer.isBuffer(other.multihash)) {\n      return 'multihash must be a Buffer'\n    }\n\n    try {\n      mh.validate(other.multihash)\n    } catch (err) {\n      let errorMsg = err.message\n      if (!errorMsg) { // Just in case mh.validate() throws an error with empty error message\n        errorMsg = 'Multihash validation failed'\n      }\n      return errorMsg\n    }\n  }\n}\n\nmodule.exports = CIDUtil\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/cids/src/cid-util.js\n// module id = 671\n// module chunks = 0\n\n//# sourceURL=../node_modules/cids/src/cid-util.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(139);\n__webpack_require__(706);\nmodule.exports = __webpack_require__(31).Array.from;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/array/from.js\n// module id = 672\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/array/from.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(176);\n__webpack_require__(139);\nmodule.exports = __webpack_require__(704);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/get-iterator.js\n// module id = 673\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/get-iterator.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(176);\n__webpack_require__(139);\nmodule.exports = __webpack_require__(705);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/is-iterable.js\n// module id = 674\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/is-iterable.js")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(31);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n  return $JSON.stringify.apply($JSON, arguments);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/json/stringify.js\n// module id = 675\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/json/stringify.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(708);\nmodule.exports = __webpack_require__(31).Object.assign;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/assign.js\n// module id = 676\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/object/assign.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(709);\nvar $Object = __webpack_require__(31).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n  return $Object.defineProperty(it, key, desc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/define-property.js\n// module id = 677\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/object/define-property.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(710);\nmodule.exports = __webpack_require__(31).Object.keys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/object/keys.js\n// module id = 678\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/object/keys.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(374);\n__webpack_require__(139);\n__webpack_require__(176);\n__webpack_require__(711);\n__webpack_require__(713);\n__webpack_require__(714);\nmodule.exports = __webpack_require__(31).Promise;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/promise.js\n// module id = 679\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/promise.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(712);\n__webpack_require__(374);\n__webpack_require__(715);\n__webpack_require__(716);\nmodule.exports = __webpack_require__(31).Symbol;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/symbol/index.js\n// module id = 680\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/symbol/index.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(139);\n__webpack_require__(176);\nmodule.exports = __webpack_require__(252).f('iterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/fn/symbol/iterator.js\n// module id = 681\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/fn/symbol/iterator.js")},function(module,exports){eval("module.exports = function () { /* empty */ };\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_add-to-unscopables.js\n// module id = 682\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_add-to-unscopables.js")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n    throw TypeError(name + ': incorrect invocation!');\n  } return it;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_an-instance.js\n// module id = 683\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_an-instance.js")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true  -> Array#includes\nvar toIObject = __webpack_require__(118);\nvar toLength = __webpack_require__(249);\nvar toAbsoluteIndex = __webpack_require__(703);\nmodule.exports = function (IS_INCLUDES) {\n  return function ($this, el, fromIndex) {\n    var O = toIObject($this);\n    var length = toLength(O.length);\n    var index = toAbsoluteIndex(fromIndex, length);\n    var value;\n    // Array#includes uses SameValueZero equality algorithm\n    // eslint-disable-next-line no-self-compare\n    if (IS_INCLUDES && el != el) while (length > index) {\n      value = O[index++];\n      // eslint-disable-next-line no-self-compare\n      if (value != value) return true;\n    // Array#indexOf ignores holes, Array#includes - not\n    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n      if (O[index] === el) return IS_INCLUDES || index || 0;\n    } return !IS_INCLUDES && -1;\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_array-includes.js\n// module id = 684\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_array-includes.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $defineProperty = __webpack_require__(70);\nvar createDesc = __webpack_require__(138);\n\nmodule.exports = function (object, index, value) {\n  if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n  else object[index] = value;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_create-property.js\n// module id = 685\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_create-property.js")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(137);\nvar gOPS = __webpack_require__(245);\nvar pIE = __webpack_require__(172);\nmodule.exports = function (it) {\n  var result = getKeys(it);\n  var getSymbols = gOPS.f;\n  if (getSymbols) {\n    var symbols = getSymbols(it);\n    var isEnum = pIE.f;\n    var i = 0;\n    var key;\n    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n  } return result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_enum-keys.js\n// module id = 686\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_enum-keys.js")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(136);\nvar call = __webpack_require__(363);\nvar isArrayIter = __webpack_require__(362);\nvar anObject = __webpack_require__(68);\nvar toLength = __webpack_require__(249);\nvar getIterFn = __webpack_require__(253);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n  var f = ctx(fn, that, entries ? 2 : 1);\n  var index = 0;\n  var length, step, iterator, result;\n  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n  // fast case for arrays with default iterator\n  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n    if (result === BREAK || result === RETURN) return result;\n  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n    result = call(iterator, f, step.value, entries);\n    if (result === BREAK || result === RETURN) return result;\n  }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_for-of.js\n// module id = 687\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_for-of.js")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n  var un = that === undefined;\n  switch (args.length) {\n    case 0: return un ? fn()\n                      : fn.call(that);\n    case 1: return un ? fn(args[0])\n                      : fn.call(that, args[0]);\n    case 2: return un ? fn(args[0], args[1])\n                      : fn.call(that, args[0], args[1]);\n    case 3: return un ? fn(args[0], args[1], args[2])\n                      : fn.call(that, args[0], args[1], args[2]);\n    case 4: return un ? fn(args[0], args[1], args[2], args[3])\n                      : fn.call(that, args[0], args[1], args[2], args[3]);\n  } return fn.apply(that, args);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_invoke.js\n// module id = 688\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_invoke.js")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(135);\nmodule.exports = Array.isArray || function isArray(arg) {\n  return cof(arg) == 'Array';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_is-array.js\n// module id = 689\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_is-array.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(366);\nvar descriptor = __webpack_require__(138);\nvar setToStringTag = __webpack_require__(173);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(90)(IteratorPrototype, __webpack_require__(38)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n  setToStringTag(Constructor, NAME + ' Iterator');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-create.js\n// module id = 690\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iter-create.js")},function(module,exports){eval("module.exports = function (done, value) {\n  return { value: value, done: !!done };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_iter-step.js\n// module id = 691\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_iter-step.js")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(175)('meta');\nvar isObject = __webpack_require__(91);\nvar has = __webpack_require__(89);\nvar setDesc = __webpack_require__(70).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n  return true;\n};\nvar FREEZE = !__webpack_require__(116)(function () {\n  return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n  setDesc(it, META, { value: {\n    i: 'O' + ++id, // object ID\n    w: {}          // weak collections IDs\n  } });\n};\nvar fastKey = function (it, create) {\n  // return primitive with prefix\n  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n  if (!has(it, META)) {\n    // can't set metadata to uncaught frozen object\n    if (!isExtensible(it)) return 'F';\n    // not necessary to add metadata\n    if (!create) return 'E';\n    // add missing metadata\n    setMeta(it);\n  // return object ID\n  } return it[META].i;\n};\nvar getWeak = function (it, create) {\n  if (!has(it, META)) {\n    // can't set metadata to uncaught frozen object\n    if (!isExtensible(it)) return true;\n    // not necessary to add metadata\n    if (!create) return false;\n    // add missing metadata\n    setMeta(it);\n  // return hash weak collections IDs\n  } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n  return it;\n};\nvar meta = module.exports = {\n  KEY: META,\n  NEED: false,\n  fastKey: fastKey,\n  getWeak: getWeak,\n  onFreeze: onFreeze\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_meta.js\n// module id = 692\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_meta.js")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(42);\nvar macrotask = __webpack_require__(373).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(135)(process) == 'process';\n\nmodule.exports = function () {\n  var head, last, notify;\n\n  var flush = function () {\n    var parent, fn;\n    if (isNode && (parent = process.domain)) parent.exit();\n    while (head) {\n      fn = head.fn;\n      head = head.next;\n      try {\n        fn();\n      } catch (e) {\n        if (head) notify();\n        else last = undefined;\n        throw e;\n      }\n    } last = undefined;\n    if (parent) parent.enter();\n  };\n\n  // Node.js\n  if (isNode) {\n    notify = function () {\n      process.nextTick(flush);\n    };\n  // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n  } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n    var toggle = true;\n    var node = document.createTextNode('');\n    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n    notify = function () {\n      node.data = toggle = !toggle;\n    };\n  // environments with maybe non-completely correct, but existent Promise\n  } else if (Promise && Promise.resolve) {\n    var promise = Promise.resolve();\n    notify = function () {\n      promise.then(flush);\n    };\n  // for other environments - macrotask based on:\n  // - setImmediate\n  // - MessageChannel\n  // - window.postMessag\n  // - onreadystatechange\n  // - setTimeout\n  } else {\n    notify = function () {\n      // strange IE + webpack dev server bug - use .call(global)\n      macrotask.call(global, flush);\n    };\n  }\n\n  return function (fn) {\n    var task = { fn: fn, next: undefined };\n    if (last) last.next = task;\n    if (!head) {\n      head = task;\n      notify();\n    } last = task;\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_microtask.js\n// module id = 693\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_microtask.js")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(137);\nvar gOPS = __webpack_require__(245);\nvar pIE = __webpack_require__(172);\nvar toObject = __webpack_require__(174);\nvar IObject = __webpack_require__(361);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(116)(function () {\n  var A = {};\n  var B = {};\n  // eslint-disable-next-line no-undef\n  var S = Symbol();\n  var K = 'abcdefghijklmnopqrst';\n  A[S] = 7;\n  K.split('').forEach(function (k) { B[k] = k; });\n  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n  var T = toObject(target);\n  var aLen = arguments.length;\n  var index = 1;\n  var getSymbols = gOPS.f;\n  var isEnum = pIE.f;\n  while (aLen > index) {\n    var S = IObject(arguments[index++]);\n    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n    var length = keys.length;\n    var j = 0;\n    var key;\n    while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n  } return T;\n} : $assign;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-assign.js\n// module id = 694\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-assign.js")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(70);\nvar anObject = __webpack_require__(68);\nvar getKeys = __webpack_require__(137);\n\nmodule.exports = __webpack_require__(78) ? Object.defineProperties : function defineProperties(O, Properties) {\n  anObject(O);\n  var keys = getKeys(Properties);\n  var length = keys.length;\n  var i = 0;\n  var P;\n  while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n  return O;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-dps.js\n// module id = 695\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-dps.js")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(172);\nvar createDesc = __webpack_require__(138);\nvar toIObject = __webpack_require__(118);\nvar toPrimitive = __webpack_require__(250);\nvar has = __webpack_require__(89);\nvar IE8_DOM_DEFINE = __webpack_require__(360);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(78) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n  O = toIObject(O);\n  P = toPrimitive(P, true);\n  if (IE8_DOM_DEFINE) try {\n    return gOPD(O, P);\n  } catch (e) { /* empty */ }\n  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopd.js\n// module id = 696\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopd.js")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(118);\nvar gOPN = __webpack_require__(367).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n  ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n  try {\n    return gOPN(it);\n  } catch (e) {\n    return windowNames.slice();\n  }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gopn-ext.js\n// module id = 697\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopn-ext.js")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(89);\nvar toObject = __webpack_require__(174);\nvar IE_PROTO = __webpack_require__(246)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n  O = toObject(O);\n  if (has(O, IE_PROTO)) return O[IE_PROTO];\n  if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n    return O.constructor.prototype;\n  } return O instanceof Object ? ObjectProto : null;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-gpo.js\n// module id = 698\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-gpo.js")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(69);\nvar core = __webpack_require__(31);\nvar fails = __webpack_require__(116);\nmodule.exports = function (KEY, exec) {\n  var fn = (core.Object || {})[KEY] || Object[KEY];\n  var exp = {};\n  exp[KEY] = exec(fn);\n  $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_object-sap.js\n// module id = 699\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_object-sap.js")},function(module,exports,__webpack_require__){eval("var hide = __webpack_require__(90);\nmodule.exports = function (target, src, safe) {\n  for (var key in src) {\n    if (safe && target[key]) target[key] = src[key];\n    else hide(target, key, src[key]);\n  } return target;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_redefine-all.js\n// module id = 700\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_redefine-all.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(42);\nvar core = __webpack_require__(31);\nvar dP = __webpack_require__(70);\nvar DESCRIPTORS = __webpack_require__(78);\nvar SPECIES = __webpack_require__(38)('species');\n\nmodule.exports = function (KEY) {\n  var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n    configurable: true,\n    get: function () { return this; }\n  });\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_set-species.js\n// module id = 701\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_set-species.js")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(248);\nvar defined = __webpack_require__(241);\n// true  -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n  return function (that, pos) {\n    var s = String(defined(that));\n    var i = toInteger(pos);\n    var l = s.length;\n    var a, b;\n    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n    a = s.charCodeAt(i);\n    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n      ? TO_STRING ? s.charAt(i) : a\n      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_string-at.js\n// module id = 702\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_string-at.js")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(248);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n  index = toInteger(index);\n  return index < 0 ? max(index + length, 0) : min(index, length);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/_to-absolute-index.js\n// module id = 703\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/_to-absolute-index.js")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(68);\nvar get = __webpack_require__(253);\nmodule.exports = __webpack_require__(31).getIterator = function (it) {\n  var iterFn = get(it);\n  if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');\n  return anObject(iterFn.call(it));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.get-iterator.js\n// module id = 704\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/core.get-iterator.js")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(240);\nvar ITERATOR = __webpack_require__(38)('iterator');\nvar Iterators = __webpack_require__(117);\nmodule.exports = __webpack_require__(31).isIterable = function (it) {\n  var O = Object(it);\n  return O[ITERATOR] !== undefined\n    || '@@iterator' in O\n    // eslint-disable-next-line no-prototype-builtins\n    || Iterators.hasOwnProperty(classof(O));\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/core.is-iterable.js\n// module id = 705\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/core.is-iterable.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ctx = __webpack_require__(136);\nvar $export = __webpack_require__(69);\nvar toObject = __webpack_require__(174);\nvar call = __webpack_require__(363);\nvar isArrayIter = __webpack_require__(362);\nvar toLength = __webpack_require__(249);\nvar createProperty = __webpack_require__(685);\nvar getIterFn = __webpack_require__(253);\n\n$export($export.S + $export.F * !__webpack_require__(365)(function (iter) { Array.from(iter); }), 'Array', {\n  // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n  from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n    var O = toObject(arrayLike);\n    var C = typeof this == 'function' ? this : Array;\n    var aLen = arguments.length;\n    var mapfn = aLen > 1 ? arguments[1] : undefined;\n    var mapping = mapfn !== undefined;\n    var index = 0;\n    var iterFn = getIterFn(O);\n    var length, result, step, iterator;\n    if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n    // if object isn't iterable or it's array with default iterator - use simple case\n    if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n      for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n        createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n      }\n    } else {\n      length = toLength(O.length);\n      for (result = new C(length); length > index; index++) {\n        createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n      }\n    }\n    result.length = index;\n    return result;\n  }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.array.from.js\n// module id = 706\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.array.from.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(682);\nvar step = __webpack_require__(691);\nvar Iterators = __webpack_require__(117);\nvar toIObject = __webpack_require__(118);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(364)(Array, 'Array', function (iterated, kind) {\n  this._t = toIObject(iterated); // target\n  this._i = 0;                   // next index\n  this._k = kind;                // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n  var O = this._t;\n  var kind = this._k;\n  var index = this._i++;\n  if (!O || index >= O.length) {\n    this._t = undefined;\n    return step(1);\n  }\n  if (kind == 'keys') return step(0, index);\n  if (kind == 'values') return step(0, O[index]);\n  return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.array.iterator.js\n// module id = 707\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.array.iterator.js")},function(module,exports,__webpack_require__){eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(69);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(694) });\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.assign.js\n// module id = 708\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.assign.js")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(69);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(78), 'Object', { defineProperty: __webpack_require__(70).f });\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.define-property.js\n// module id = 709\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.define-property.js")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(174);\nvar $keys = __webpack_require__(137);\n\n__webpack_require__(699)('keys', function () {\n  return function keys(it) {\n    return $keys(toObject(it));\n  };\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.object.keys.js\n// module id = 710\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.keys.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(171);\nvar global = __webpack_require__(42);\nvar ctx = __webpack_require__(136);\nvar classof = __webpack_require__(240);\nvar $export = __webpack_require__(69);\nvar isObject = __webpack_require__(91);\nvar aFunction = __webpack_require__(170);\nvar anInstance = __webpack_require__(683);\nvar forOf = __webpack_require__(687);\nvar speciesConstructor = __webpack_require__(372);\nvar task = __webpack_require__(373).set;\nvar microtask = __webpack_require__(693)();\nvar newPromiseCapabilityModule = __webpack_require__(244);\nvar perform = __webpack_require__(369);\nvar promiseResolve = __webpack_require__(370);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n  try {\n    // correct subclassing with @@species support\n    var promise = $Promise.resolve(1);\n    var FakePromise = (promise.constructor = {})[__webpack_require__(38)('species')] = function (exec) {\n      exec(empty, empty);\n    };\n    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n    return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;\n  } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n  var then;\n  return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n  if (promise._n) return;\n  promise._n = true;\n  var chain = promise._c;\n  microtask(function () {\n    var value = promise._v;\n    var ok = promise._s == 1;\n    var i = 0;\n    var run = function (reaction) {\n      var handler = ok ? reaction.ok : reaction.fail;\n      var resolve = reaction.resolve;\n      var reject = reaction.reject;\n      var domain = reaction.domain;\n      var result, then, exited;\n      try {\n        if (handler) {\n          if (!ok) {\n            if (promise._h == 2) onHandleUnhandled(promise);\n            promise._h = 1;\n          }\n          if (handler === true) result = value;\n          else {\n            if (domain) domain.enter();\n            result = handler(value); // may throw\n            if (domain) {\n              domain.exit();\n              exited = true;\n            }\n          }\n          if (result === reaction.promise) {\n            reject(TypeError('Promise-chain cycle'));\n          } else if (then = isThenable(result)) {\n            then.call(result, resolve, reject);\n          } else resolve(result);\n        } else reject(value);\n      } catch (e) {\n        if (domain && !exited) domain.exit();\n        reject(e);\n      }\n    };\n    while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n    promise._c = [];\n    promise._n = false;\n    if (isReject && !promise._h) onUnhandled(promise);\n  });\n};\nvar onUnhandled = function (promise) {\n  task.call(global, function () {\n    var value = promise._v;\n    var unhandled = isUnhandled(promise);\n    var result, handler, console;\n    if (unhandled) {\n      result = perform(function () {\n        if (isNode) {\n          process.emit('unhandledRejection', value, promise);\n        } else if (handler = global.onunhandledrejection) {\n          handler({ promise: promise, reason: value });\n        } else if ((console = global.console) && console.error) {\n          console.error('Unhandled promise rejection', value);\n        }\n      });\n      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n      promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n    } promise._a = undefined;\n    if (unhandled && result.e) throw result.v;\n  });\n};\nvar isUnhandled = function (promise) {\n  return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n  task.call(global, function () {\n    var handler;\n    if (isNode) {\n      process.emit('rejectionHandled', promise);\n    } else if (handler = global.onrejectionhandled) {\n      handler({ promise: promise, reason: promise._v });\n    }\n  });\n};\nvar $reject = function (value) {\n  var promise = this;\n  if (promise._d) return;\n  promise._d = true;\n  promise = promise._w || promise; // unwrap\n  promise._v = value;\n  promise._s = 2;\n  if (!promise._a) promise._a = promise._c.slice();\n  notify(promise, true);\n};\nvar $resolve = function (value) {\n  var promise = this;\n  var then;\n  if (promise._d) return;\n  promise._d = true;\n  promise = promise._w || promise; // unwrap\n  try {\n    if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n    if (then = isThenable(value)) {\n      microtask(function () {\n        var wrapper = { _w: promise, _d: false }; // wrap\n        try {\n          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n        } catch (e) {\n          $reject.call(wrapper, e);\n        }\n      });\n    } else {\n      promise._v = value;\n      promise._s = 1;\n      notify(promise, false);\n    }\n  } catch (e) {\n    $reject.call({ _w: promise, _d: false }, e); // wrap\n  }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n  // 25.4.3.1 Promise(executor)\n  $Promise = function Promise(executor) {\n    anInstance(this, $Promise, PROMISE, '_h');\n    aFunction(executor);\n    Internal.call(this);\n    try {\n      executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n    } catch (err) {\n      $reject.call(this, err);\n    }\n  };\n  // eslint-disable-next-line no-unused-vars\n  Internal = function Promise(executor) {\n    this._c = [];             // <- awaiting reactions\n    this._a = undefined;      // <- checked in isUnhandled reactions\n    this._s = 0;              // <- state\n    this._d = false;          // <- done\n    this._v = undefined;      // <- value\n    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n    this._n = false;          // <- notify\n  };\n  Internal.prototype = __webpack_require__(700)($Promise.prototype, {\n    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n    then: function then(onFulfilled, onRejected) {\n      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n      reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n      reaction.fail = typeof onRejected == 'function' && onRejected;\n      reaction.domain = isNode ? process.domain : undefined;\n      this._c.push(reaction);\n      if (this._a) this._a.push(reaction);\n      if (this._s) notify(this, false);\n      return reaction.promise;\n    },\n    // 25.4.5.1 Promise.prototype.catch(onRejected)\n    'catch': function (onRejected) {\n      return this.then(undefined, onRejected);\n    }\n  });\n  OwnPromiseCapability = function () {\n    var promise = new Internal();\n    this.promise = promise;\n    this.resolve = ctx($resolve, promise, 1);\n    this.reject = ctx($reject, promise, 1);\n  };\n  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n    return C === $Promise || C === Wrapper\n      ? new OwnPromiseCapability(C)\n      : newGenericPromiseCapability(C);\n  };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(173)($Promise, PROMISE);\n__webpack_require__(701)(PROMISE);\nWrapper = __webpack_require__(31)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n  // 25.4.4.5 Promise.reject(r)\n  reject: function reject(r) {\n    var capability = newPromiseCapability(this);\n    var $$reject = capability.reject;\n    $$reject(r);\n    return capability.promise;\n  }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n  // 25.4.4.6 Promise.resolve(x)\n  resolve: function resolve(x) {\n    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n  }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(365)(function (iter) {\n  $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n  // 25.4.4.1 Promise.all(iterable)\n  all: function all(iterable) {\n    var C = this;\n    var capability = newPromiseCapability(C);\n    var resolve = capability.resolve;\n    var reject = capability.reject;\n    var result = perform(function () {\n      var values = [];\n      var index = 0;\n      var remaining = 1;\n      forOf(iterable, false, function (promise) {\n        var $index = index++;\n        var alreadyCalled = false;\n        values.push(undefined);\n        remaining++;\n        C.resolve(promise).then(function (value) {\n          if (alreadyCalled) return;\n          alreadyCalled = true;\n          values[$index] = value;\n          --remaining || resolve(values);\n        }, reject);\n      });\n      --remaining || resolve(values);\n    });\n    if (result.e) reject(result.v);\n    return capability.promise;\n  },\n  // 25.4.4.4 Promise.race(iterable)\n  race: function race(iterable) {\n    var C = this;\n    var capability = newPromiseCapability(C);\n    var reject = capability.reject;\n    var result = perform(function () {\n      forOf(iterable, false, function (promise) {\n        C.resolve(promise).then(capability.resolve, reject);\n      });\n    });\n    if (result.e) reject(result.v);\n    return capability.promise;\n  }\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.promise.js\n// module id = 711\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.promise.js")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(42);\nvar has = __webpack_require__(89);\nvar DESCRIPTORS = __webpack_require__(78);\nvar $export = __webpack_require__(69);\nvar redefine = __webpack_require__(371);\nvar META = __webpack_require__(692).KEY;\nvar $fails = __webpack_require__(116);\nvar shared = __webpack_require__(247);\nvar setToStringTag = __webpack_require__(173);\nvar uid = __webpack_require__(175);\nvar wks = __webpack_require__(38);\nvar wksExt = __webpack_require__(252);\nvar wksDefine = __webpack_require__(251);\nvar enumKeys = __webpack_require__(686);\nvar isArray = __webpack_require__(689);\nvar anObject = __webpack_require__(68);\nvar isObject = __webpack_require__(91);\nvar toIObject = __webpack_require__(118);\nvar toPrimitive = __webpack_require__(250);\nvar createDesc = __webpack_require__(138);\nvar _create = __webpack_require__(366);\nvar gOPNExt = __webpack_require__(697);\nvar $GOPD = __webpack_require__(696);\nvar $DP = __webpack_require__(70);\nvar $keys = __webpack_require__(137);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n  return _create(dP({}, 'a', {\n    get: function () { return dP(this, 'a', { value: 7 }).a; }\n  })).a != 7;\n}) ? function (it, key, D) {\n  var protoDesc = gOPD(ObjectProto, key);\n  if (protoDesc) delete ObjectProto[key];\n  dP(it, key, D);\n  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n  sym._k = tag;\n  return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n  return typeof it == 'symbol';\n} : function (it) {\n  return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n  anObject(it);\n  key = toPrimitive(key, true);\n  anObject(D);\n  if (has(AllSymbols, key)) {\n    if (!D.enumerable) {\n      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n      it[HIDDEN][key] = true;\n    } else {\n      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n      D = _create(D, { enumerable: createDesc(0, false) });\n    } return setSymbolDesc(it, key, D);\n  } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n  anObject(it);\n  var keys = enumKeys(P = toIObject(P));\n  var i = 0;\n  var l = keys.length;\n  var key;\n  while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n  return it;\n};\nvar $create = function create(it, P) {\n  return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n  var E = isEnum.call(this, key = toPrimitive(key, true));\n  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n  it = toIObject(it);\n  key = toPrimitive(key, true);\n  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n  var D = gOPD(it, key);\n  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n  return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n  var names = gOPN(toIObject(it));\n  var result = [];\n  var i = 0;\n  var key;\n  while (names.length > i) {\n    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n  } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n  var IS_OP = it === ObjectProto;\n  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n  var result = [];\n  var i = 0;\n  var key;\n  while (names.length > i) {\n    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n  } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n  $Symbol = function Symbol() {\n    if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n    var $set = function (value) {\n      if (this === ObjectProto) $set.call(OPSymbols, value);\n      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n      setSymbolDesc(this, tag, createDesc(1, value));\n    };\n    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n    return wrap(tag);\n  };\n  redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n    return this._k;\n  });\n\n  $GOPD.f = $getOwnPropertyDescriptor;\n  $DP.f = $defineProperty;\n  __webpack_require__(367).f = gOPNExt.f = $getOwnPropertyNames;\n  __webpack_require__(172).f = $propertyIsEnumerable;\n  __webpack_require__(245).f = $getOwnPropertySymbols;\n\n  if (DESCRIPTORS && !__webpack_require__(171)) {\n    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n  }\n\n  wksExt.f = function (name) {\n    return wrap(wks(name));\n  };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n  // 19.4.2.1 Symbol.for(key)\n  'for': function (key) {\n    return has(SymbolRegistry, key += '')\n      ? SymbolRegistry[key]\n      : SymbolRegistry[key] = $Symbol(key);\n  },\n  // 19.4.2.5 Symbol.keyFor(sym)\n  keyFor: function keyFor(sym) {\n    if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n  },\n  useSetter: function () { setter = true; },\n  useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n  // 19.1.2.2 Object.create(O [, Properties])\n  create: $create,\n  // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n  defineProperty: $defineProperty,\n  // 19.1.2.3 Object.defineProperties(O, Properties)\n  defineProperties: $defineProperties,\n  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n  // 19.1.2.7 Object.getOwnPropertyNames(O)\n  getOwnPropertyNames: $getOwnPropertyNames,\n  // 19.1.2.8 Object.getOwnPropertySymbols(O)\n  getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n  var S = $Symbol();\n  // MS Edge converts symbol values to JSON as {}\n  // WebKit converts symbol values to JSON as null\n  // V8 throws on boxed symbols\n  return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n  stringify: function stringify(it) {\n    var args = [it];\n    var i = 1;\n    var replacer, $replacer;\n    while (arguments.length > i) args.push(arguments[i++]);\n    $replacer = replacer = args[1];\n    if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n    if (!isArray(replacer)) replacer = function (key, value) {\n      if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n      if (!isSymbol(value)) return value;\n    };\n    args[1] = replacer;\n    return _stringify.apply($JSON, args);\n  }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(90)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es6.symbol.js\n// module id = 712\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es6.symbol.js")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(69);\nvar core = __webpack_require__(31);\nvar global = __webpack_require__(42);\nvar speciesConstructor = __webpack_require__(372);\nvar promiseResolve = __webpack_require__(370);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n  var C = speciesConstructor(this, core.Promise || global.Promise);\n  var isFunction = typeof onFinally == 'function';\n  return this.then(\n    isFunction ? function (x) {\n      return promiseResolve(C, onFinally()).then(function () { return x; });\n    } : onFinally,\n    isFunction ? function (e) {\n      return promiseResolve(C, onFinally()).then(function () { throw e; });\n    } : onFinally\n  );\n} });\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.promise.finally.js\n// module id = 713\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es7.promise.finally.js")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(69);\nvar newPromiseCapability = __webpack_require__(244);\nvar perform = __webpack_require__(369);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n  var promiseCapability = newPromiseCapability.f(this);\n  var result = perform(callbackfn);\n  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n  return promiseCapability.promise;\n} });\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.promise.try.js\n// module id = 714\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es7.promise.try.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(251)('asyncIterator');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.symbol.async-iterator.js\n// module id = 715\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es7.symbol.async-iterator.js")},function(module,exports,__webpack_require__){eval("__webpack_require__(251)('observable');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/core-js/library/modules/es7.symbol.observable.js\n// module id = 716\n// module chunks = 0\n\n//# sourceURL=../node_modules/core-js/library/modules/es7.symbol.observable.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(28);\nvar BN = __webpack_require__(17);\n\nmodule.exports = function createECDH(curve) {\n\treturn new ECDH(curve);\n};\n\nvar aliases = {\n\tsecp256k1: {\n\t\tname: 'secp256k1',\n\t\tbyteLength: 32\n\t},\n\tsecp224r1: {\n\t\tname: 'p224',\n\t\tbyteLength: 28\n\t},\n\tprime256v1: {\n\t\tname: 'p256',\n\t\tbyteLength: 32\n\t},\n\tprime192v1: {\n\t\tname: 'p192',\n\t\tbyteLength: 24\n\t},\n\ted25519: {\n\t\tname: 'ed25519',\n\t\tbyteLength: 32\n\t},\n\tsecp384r1: {\n\t\tname: 'p384',\n\t\tbyteLength: 48\n\t},\n\tsecp521r1: {\n\t\tname: 'p521',\n\t\tbyteLength: 66\n\t}\n};\n\naliases.p224 = aliases.secp224r1;\naliases.p256 = aliases.secp256r1 = aliases.prime256v1;\naliases.p192 = aliases.secp192r1 = aliases.prime192v1;\naliases.p384 = aliases.secp384r1;\naliases.p521 = aliases.secp521r1;\n\nfunction ECDH(curve) {\n\tthis.curveType = aliases[curve];\n\tif (!this.curveType ) {\n\t\tthis.curveType = {\n\t\t\tname: curve\n\t\t};\n\t}\n\tthis.curve = new elliptic.ec(this.curveType.name);\n\tthis.keys = void 0;\n}\n\nECDH.prototype.generateKeys = function (enc, format) {\n\tthis.keys = this.curve.genKeyPair();\n\treturn this.getPublicKey(enc, format);\n};\n\nECDH.prototype.computeSecret = function (other, inenc, enc) {\n\tinenc = inenc || 'utf8';\n\tif (!Buffer.isBuffer(other)) {\n\t\tother = new Buffer(other, inenc);\n\t}\n\tvar otherPub = this.curve.keyFromPublic(other).getPublic();\n\tvar out = otherPub.mul(this.keys.getPrivate()).getX();\n\treturn formatReturnValue(out, enc, this.curveType.byteLength);\n};\n\nECDH.prototype.getPublicKey = function (enc, format) {\n\tvar key = this.keys.getPublic(format === 'compressed', true);\n\tif (format === 'hybrid') {\n\t\tif (key[key.length - 1] % 2) {\n\t\t\tkey[0] = 7;\n\t\t} else {\n\t\t\tkey [0] = 6;\n\t\t}\n\t}\n\treturn formatReturnValue(key, enc);\n};\n\nECDH.prototype.getPrivateKey = function (enc) {\n\treturn formatReturnValue(this.keys.getPrivate(), enc);\n};\n\nECDH.prototype.setPublicKey = function (pub, enc) {\n\tenc = enc || 'utf8';\n\tif (!Buffer.isBuffer(pub)) {\n\t\tpub = new Buffer(pub, enc);\n\t}\n\tthis.keys._importPublic(pub);\n\treturn this;\n};\n\nECDH.prototype.setPrivateKey = function (priv, enc) {\n\tenc = enc || 'utf8';\n\tif (!Buffer.isBuffer(priv)) {\n\t\tpriv = new Buffer(priv, enc);\n\t}\n\tvar _priv = new BN(priv);\n\t_priv = _priv.toString(16);\n\tthis.keys._importPrivate(_priv);\n\treturn this;\n};\n\nfunction formatReturnValue(bn, enc, len) {\n\tif (!Array.isArray(bn)) {\n\t\tbn = bn.toArray();\n\t}\n\tvar buf = new Buffer(bn);\n\tif (len && buf.length < len) {\n\t\tvar zeros = new Buffer(len - buf.length);\n\t\tzeros.fill(0);\n\t\tbuf = Buffer.concat([zeros, buf]);\n\t}\n\tif (!enc) {\n\t\treturn buf;\n\t} else {\n\t\treturn buf.toString(enc);\n\t}\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-ecdh/browser.js\n// module id = 717\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-ecdh/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar intSize = 4\nvar zeroBuffer = new Buffer(intSize)\nzeroBuffer.fill(0)\n\nvar charSize = 8\nvar hashSize = 16\n\nfunction toArray (buf) {\n  if ((buf.length % intSize) !== 0) {\n    var len = buf.length + (intSize - (buf.length % intSize))\n    buf = Buffer.concat([buf, zeroBuffer], len)\n  }\n\n  var arr = new Array(buf.length >>> 2)\n  for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {\n    arr[j] = buf.readInt32LE(i)\n  }\n\n  return arr\n}\n\nmodule.exports = function hash (buf, fn) {\n  var arr = fn(toArray(buf), buf.length * charSize)\n  buf = new Buffer(hashSize)\n  for (var i = 0; i < arr.length; i++) {\n    buf.writeInt32LE(arr[i], i << 2, true)\n  }\n  return buf\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-hash/make-hash.js\n// module id = 718\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-hash/make-hash.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar inherits = __webpack_require__(3)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar Base = __webpack_require__(77)\n\nvar ZEROS = Buffer.alloc(128)\nvar blocksize = 64\n\nfunction Hmac (alg, key) {\n  Base.call(this, 'digest')\n  if (typeof key === 'string') {\n    key = Buffer.from(key)\n  }\n\n  this._alg = alg\n  this._key = key\n\n  if (key.length > blocksize) {\n    key = alg(key)\n  } else if (key.length < blocksize) {\n    key = Buffer.concat([key, ZEROS], blocksize)\n  }\n\n  var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\n  var opad = this._opad = Buffer.allocUnsafe(blocksize)\n\n  for (var i = 0; i < blocksize; i++) {\n    ipad[i] = key[i] ^ 0x36\n    opad[i] = key[i] ^ 0x5C\n  }\n\n  this._hash = [ipad]\n}\n\ninherits(Hmac, Base)\n\nHmac.prototype._update = function (data) {\n  this._hash.push(data)\n}\n\nHmac.prototype._final = function () {\n  var h = this._alg(Buffer.concat(this._hash))\n  return this._alg(Buffer.concat([this._opad, h]))\n}\nmodule.exports = Hmac\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/create-hmac/legacy.js\n// module id = 719\n// module chunks = 0\n\n//# sourceURL=../node_modules/create-hmac/legacy.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assign        = __webpack_require__(844)\n  , normalizeOpts = __webpack_require__(851)\n  , isCallable    = __webpack_require__(847)\n  , contains      = __webpack_require__(854)\n\n  , d;\n\nd = module.exports = function (dscr, value/*, options*/) {\n\tvar c, e, w, options, desc;\n\tif ((arguments.length < 2) || (typeof dscr !== 'string')) {\n\t\toptions = value;\n\t\tvalue = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[2];\n\t}\n\tif (dscr == null) {\n\t\tc = w = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t\tw = contains.call(dscr, 'w');\n\t}\n\n\tdesc = { value: value, configurable: c, enumerable: e, writable: w };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\nd.gs = function (dscr, get, set/*, options*/) {\n\tvar c, e, options, desc;\n\tif (typeof dscr !== 'string') {\n\t\toptions = set;\n\t\tset = get;\n\t\tget = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[3];\n\t}\n\tif (get == null) {\n\t\tget = undefined;\n\t} else if (!isCallable(get)) {\n\t\toptions = get;\n\t\tget = set = undefined;\n\t} else if (set == null) {\n\t\tset = undefined;\n\t} else if (!isCallable(set)) {\n\t\toptions = set;\n\t\tset = undefined;\n\t}\n\tif (dscr == null) {\n\t\tc = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t}\n\n\tdesc = { get: get, set: set, configurable: c, enumerable: e };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d/index.js\n// module id = 720\n// module chunks = 0\n\n//# sourceURL=../node_modules/d/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nconst EE = __webpack_require__(15).EventEmitter\n\nfunction DataQueue() {\n  const ee = new EE()\n  let q = []\n  let ed\n\n  function unleak() {\n    ee.removeAllListeners("err")\n    ee.removeAllListeners("data")\n  }\n\n  return {\n    append: data => {\n      if (ed) return ed\n      q.push(data)\n      ee.emit("data")\n    },\n    prepend: data => { //better only call this before the get queue starts\n      if (ed) return ed\n      q.unshift(data)\n    },\n    error: e => {\n      ed = e\n      ee.emit("err", e)\n    },\n    get: cb => {\n      unleak()\n      if (ed) return cb(ed)\n      if (q.length) return cb(null, q.shift())\n      ee.once("err", e => {\n        unleak()\n        cb(e)\n      })\n      ee.once("data", () => {\n        unleak()\n        return cb(null, q.shift())\n      })\n    },\n    height: () => q.length\n  }\n}\nmodule.exports = DataQueue\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/data-queue/index.js\n// module id = 721\n// module chunks = 0\n\n//# sourceURL=../node_modules/data-queue/index.js')},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst KeytransformDatastore = __webpack_require__(177)\nconst ShardingDatastore = __webpack_require__(726)\nconst MountDatastore = __webpack_require__(723)\nconst TieredDatastore = __webpack_require__(727)\nconst NamespaceDatastore = __webpack_require__(724)\nconst shard = __webpack_require__(375)\n\nexports.KeytransformDatastore = KeytransformDatastore\nexports.ShardingDatastore = ShardingDatastore\nexports.MountDatastore = MountDatastore\nexports.TieredDatastore = TieredDatastore\nexports.NamespaceDatastore = NamespaceDatastore\nexports.shard = shard\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/index.js\n// module id = 722\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst each = __webpack_require__(41)\nconst many = __webpack_require__(1172)\nconst pull = __webpack_require__(6)\n\nconst Key = __webpack_require__(40).Key\nconst utils = __webpack_require__(40).utils\nconst asyncFilter = utils.asyncFilter\nconst asyncSort = utils.asyncSort\nconst replaceStartWith = utils.replaceStartWith\n\nconst Keytransform = __webpack_require__(177)\n\n/* ::\nimport type {Datastore, Callback, Batch, Query, QueryResult} from 'interface-datastore'\n\ntype Mount<Value> = {\n  prefix: Key,\n  datastore: Datastore<Value>\n}\n*/\n\n/**\n * A datastore that can combine multiple stores inside various\n * key prefixs.\n */\nclass MountDatastore /* :: <Value> */ {\n  /* :: mounts: Array<Mount<Value>> */\n\n  constructor (mounts /* : Array<Mount<Value>> */) {\n    this.mounts = mounts.slice()\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    each(this.mounts, (m, cb) => {\n      m.datastore.open(cb)\n    }, callback)\n  }\n\n  /**\n   * Lookup the matching datastore for the given key.\n   *\n   * @private\n   * @param {Key} key\n   * @returns {{Datastore, Key, Key}}\n   */\n  _lookup (key /* : Key */) /* : ?{datastore: Datastore<Value>, mountpoint: Key, rest: Key} */ {\n    for (let mount of this.mounts) {\n      if (mount.prefix.toString() === key.toString() || mount.prefix.isAncestorOf(key)) {\n        const s = replaceStartWith(key.toString(), mount.prefix.toString())\n        return {\n          datastore: mount.datastore,\n          mountpoint: mount.prefix,\n          rest: new Key(s)\n        }\n      }\n    }\n  }\n\n  put (key /* : Key */, value /* : Value */, callback /* : Callback<void> */) /* : void */ {\n    const match = this._lookup(key)\n    if (match == null) {\n      callback(new Error('No datastore mounted for this key'))\n      return\n    }\n\n    match.datastore.put(match.rest, value, callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Value> */) /* : void */ {\n    const match = this._lookup(key)\n    if (match == null) {\n      callback(new Error('No datastore mounted for this key'))\n      return\n    }\n\n    match.datastore.get(match.rest, callback)\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    const match = this._lookup(key)\n    if (match == null) {\n      callback(null, false)\n      return\n    }\n\n    match.datastore.has(match.rest, callback)\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    const match = this._lookup(key)\n    if (match == null) {\n      callback(new Error('No datastore mounted for this key'))\n      return\n    }\n\n    match.datastore.delete(match.rest, callback)\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    each(this.mounts, (m, cb) => {\n      m.datastore.close(cb)\n    }, callback)\n  }\n\n  batch () /* : Batch<Value> */ {\n    const batchMounts = {}\n    const lookup = (key /* : Key */) /* : {batch: Batch<Value>, rest: Key} */ => {\n      const match = this._lookup(key)\n      if (match == null) {\n        throw new Error('No datastore mounted for this key')\n      }\n\n      const m = match.mountpoint.toString()\n      if (batchMounts[m] == null) {\n        batchMounts[m] = match.datastore.batch()\n      }\n\n      return {\n        batch: batchMounts[m],\n        rest: match.rest\n      }\n    }\n\n    return {\n      put: (key /* : Key */, value /* : Value */) /* : void */ => {\n        const match = lookup(key)\n        match.batch.put(match.rest, value)\n      },\n      delete: (key /* : Key */) /* : void */ => {\n        const match = lookup(key)\n        match.batch.delete(match.rest)\n      },\n      commit: (callback /* : Callback<void> */) /* : void */ => {\n        each(Object.keys(batchMounts), (p, cb) => {\n          batchMounts[p].commit(cb)\n        }, callback)\n      }\n    }\n  }\n\n  query (q /* : Query<Value> */) /* : QueryResult<Value> */ {\n    const qs = this.mounts.map(m => {\n      const ks = new Keytransform(m.datastore, {\n        convert: (key /* : Key */) /* : Key */ => {\n          throw new Error('should never be called')\n        },\n        invert: (key /* : Key */) /* : Key */ => {\n          return m.prefix.child(key)\n        }\n      })\n\n      let prefix\n      if (q.prefix != null) {\n        prefix = replaceStartWith(q.prefix, m.prefix.toString())\n      }\n\n      return ks.query({\n        prefix: prefix,\n        filters: q.filters,\n        keysOnly: q.keysOnly\n      })\n    })\n\n    let tasks = [many(qs)]\n\n    if (q.filters != null) {\n      tasks = tasks.concat(q.filters.map(f => asyncFilter(f)))\n    }\n\n    if (q.orders != null) {\n      tasks = tasks.concat(q.orders.map(o => asyncSort(o)))\n    }\n\n    if (q.offset != null) {\n      let i = 0\n      // $FlowFixMe\n      tasks.push(pull.filter(() => i++ >= q.offset))\n    }\n\n    if (q.limit != null) {\n      tasks.push(pull.take(q.limit))\n    }\n\n    return pull.apply(null, tasks)\n  }\n}\n\nmodule.exports = MountDatastore\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/mount.js\n// module id = 723\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/mount.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst Key = __webpack_require__(40).Key\nconst KeytransformDatastore = __webpack_require__(177)\n\n/* ::\nimport type {Callback, Datastore, Query, QueryResult} from 'interface-datastore'\n*/\n\n/**\n * Wraps a given datastore into a keytransform which\n * makes a given prefix transparent.\n *\n * For example, if the prefix is `new Key(/hello)` a call\n * to `store.put(new Key('/world'), mydata)` would store the data under\n * `/hello/world`.\n *\n */\nclass NamespaceDatastore/* :: <Value> */ extends KeytransformDatastore /* :: <Value> */ {\n  /* :: prefix: Key */\n\n  constructor (child/* : Datastore<Value> */, prefix/* : Key */) {\n    super(child, {\n      convert (key/* : Key */)/* : Key */ {\n        return prefix.child(key)\n      },\n      invert (key/* : Key */)/* : Key */ {\n        if (prefix.toString() === '/') {\n          return key\n        }\n\n        if (!prefix.isAncestorOf(key)) {\n          throw new Error(`Expected prefix: (${prefix.toString()}) in key: ${key.toString()}`)\n        }\n\n        return new Key(key.toString().slice(prefix.toString().length), false)\n      }\n    })\n\n    this.prefix = prefix\n  }\n\n  query (q /* : Query<Value> */)/* : QueryResult<Value> */ {\n    if (q.prefix && this.prefix.toString() !== '/') {\n      return super.query(Object.assign({}, q, {\n        prefix: this.prefix.child(new Key(q.prefix)).toString()\n      }))\n    }\n    return super.query(q)\n  }\n}\n\nmodule.exports = NamespaceDatastore\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/namespace.js\n// module id = 724\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/namespace.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nmodule.exports = `This is a repository of IPLD objects. Each IPLD object is in a single file,\nnamed <base32 encoding of cid>.data. Where <base32 encoding of cid> is the\n\"base32\" encoding of the CID (as specified in\nhttps://github.com/multiformats/multibase) without the 'B' prefix.\nAll the object files are placed in a tree of directories, based on a\nfunction of the CID. This is a form of sharding similar to\nthe objects directory in git repositories. Previously, we used\nprefixes, we now use the next-to-last two charters.\n    func NextToLast(base32cid string) {\n      nextToLastLen := 2\n      offset := len(base32cid) - nextToLastLen - 1\n      return str[offset : offset+nextToLastLen]\n    }\nFor example, an object with a base58 CIDv1 of\n    zb2rhYSxw4ZjuzgCnWSt19Q94ERaeFhu9uSqRgjSdx9bsgM6f\nhas a base32 CIDv1 of\n    BAFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA\nand will be placed at\n    SC/AFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA.data\nwith 'SC' being the last-to-next two characters and the 'B' at the\nbeginning of the CIDv1 string is the multibase prefix that is not\nstored in the filename.\n`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/shard-readme.js\n// module id = 725\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/shard-readme.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* @flow */\n\n\nconst waterfall = __webpack_require__(12)\nconst parallel = __webpack_require__(85)\nconst Key = __webpack_require__(40).Key\n\nconst sh = __webpack_require__(375)\nconst KeytransformStore = __webpack_require__(177)\n\nconst shardKey = new Key(sh.SHARDING_FN)\nconst shardReadmeKey = new Key(sh.README_FN)\n\n/* ::\nimport type {Datastore, Batch, Query, QueryResult, Callback} from 'interface-datastore'\n\nimport type {ShardV1} from './shard'\n*/\n\n/**\n * Backend independent abstraction of go-ds-flatfs.\n *\n * Wraps another datastore such that all values are stored\n * sharded according to the given sharding function.\n */\nclass ShardingDatastore {\n  /* :: shard: ShardV1 */\n  /* :: child: Datastore<Buffer> */\n\n  constructor (store /* : Datastore<Buffer> */, shard /* : ShardV1 */) {\n    this.child = new KeytransformStore(store, {\n      convert: this._convertKey.bind(this),\n      invert: this._invertKey.bind(this)\n    })\n    this.shard = shard\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    this.child.open(callback)\n  }\n\n  _convertKey (key/* : Key */)/* : Key */ {\n    const s = key.toString()\n    if (s === shardKey.toString() || s === shardReadmeKey.toString()) {\n      return key\n    }\n\n    const parent = new Key(this.shard.fun(s))\n    return parent.child(key)\n  }\n\n  _invertKey (key/* : Key */)/* : Key */ {\n    const s = key.toString()\n    if (s === shardKey.toString() || s === shardReadmeKey.toString()) {\n      return key\n    }\n    return Key.withNamespaces(key.list().slice(1))\n  }\n\n  static createOrOpen (store /* : Datastore<Buffer> */, shard /* : ShardV1 */, callback /* : Callback<ShardingDatastore> */) /* : void */ {\n    ShardingDatastore.create(store, shard, err => {\n      if (err && err.message !== 'datastore exists') {\n        return callback(err)\n      }\n\n      ShardingDatastore.open(store, callback)\n    })\n  }\n\n  static open (store /* : Datastore<Buffer> */, callback /* : Callback<ShardingDatastore> */) /* : void */ {\n    waterfall([\n      (cb) => sh.readShardFun('/', store, cb),\n      (shard, cb) => {\n        cb(null, new ShardingDatastore(store, shard))\n      }\n    ], callback)\n  }\n\n  static create (store /* : Datastore<Buffer> */, shard /* : ShardV1 */, callback /* : Callback<void> */) /* : void */ {\n    store.has(shardKey, (err, exists) => {\n      if (err) {\n        return callback(err)\n      }\n\n      if (!exists) {\n        const put = typeof store.putRaw === 'function' ? store.putRaw.bind(store) : store.put.bind(store)\n        return parallel([\n          (cb) => put(shardKey, Buffer.from(shard.toString() + '\\n'), cb),\n          (cb) => put(shardReadmeKey, Buffer.from(sh.readme), cb)\n        ], err => callback(err))\n      }\n\n      sh.readShardFun('/', store, (err, diskShard) => {\n        if (err) {\n          return callback(err)\n        }\n\n        const a = (diskShard || '').toString()\n        const b = shard.toString()\n        if (a !== b) {\n          return callback(new Error(`specified fun ${b} does not match repo shard fun ${a}`))\n        }\n\n        callback(new Error('datastore exists'))\n      })\n    })\n  }\n\n  put (key /* : Key */, val /* : Buffer */, callback /* : Callback<void> */) /* : void */ {\n    this.child.put(key, val, callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Buffer> */) /* : void */ {\n    this.child.get(key, callback)\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    this.child.has(key, callback)\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    this.child.delete(key, callback)\n  }\n\n  batch () /* : Batch<Buffer> */ {\n    return this.child.batch()\n  }\n\n  query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ {\n    const tq/* : Query<Buffer> */ = {\n      keysOnly: q.keysOnly,\n      offset: q.offset,\n      limit: q.limit,\n      filters: [\n        (e, cb) => cb(null, e.key.toString() !== shardKey.toString()),\n        (e, cb) => cb(null, e.key.toString() !== shardReadmeKey.toString())\n      ]\n    }\n\n    if (q.prefix != null) {\n      tq.filters.push((e, cb) => {\n        cb(null, this._invertKey(e.key).toString().startsWith(q.prefix))\n      })\n    }\n\n    if (q.filters != null) {\n      const filters = q.filters.map((f) => (e, cb) => {\n        f(Object.assign({}, e, {\n          key: this._invertKey(e.key)\n        }), cb)\n      })\n      tq.filters = tq.filters.concat(filters)\n    }\n\n    if (q.orders != null) {\n      tq.orders = q.orders.map((o) => (res, cb) => {\n        res.forEach((e) => { e.key = this._invertKey(e.key) })\n        o(res, (err, ordered) => {\n          if (err) {\n            return cb(err)\n          }\n          ordered.forEach((e) => { e.key = this._convertKey(e.key) })\n          cb(null, ordered)\n        })\n      })\n    }\n\n    return this.child.query(tq)\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    this.child.close(callback)\n  }\n}\n\nmodule.exports = ShardingDatastore\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/sharding.js\n// module id = 726\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/sharding.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\nconst each = __webpack_require__(41)\nconst whilst = __webpack_require__(164)\n\n/* ::\nimport type {Key, Datastore, Callback, Batch, Query, QueryResult} from 'interface-datastore'\n*/\n\n/**\n * A datastore that can combine multiple stores. Puts and deletes\n * will write through to all datastores. Has and get will\n * try each store sequentially. Query will always try the\n * last one first.\n *\n */\nclass TieredDatastore /* :: <Value> */ {\n  /* :: stores: Array<Datastore<Value>> */\n\n  constructor (stores /* : Array<Datastore<Value>> */) {\n    this.stores = stores.slice()\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    each(this.stores, (store, cb) => {\n      store.open(cb)\n    }, callback)\n  }\n\n  put (key /* : Key */, value /* : Value */, callback /* : Callback<void> */) /* : void */ {\n    each(this.stores, (store, cb) => {\n      store.put(key, value, cb)\n    }, callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Value> */) /* : void */ {\n    const storeLength = this.stores.length\n    let done = false\n    let i = 0\n    whilst(() => !done && i < storeLength, cb => {\n      const store = this.stores[i++]\n      store.get(key, (err, res) => {\n        if (err == null) {\n          done = true\n          return cb(null, res)\n        }\n        cb()\n      })\n    }, callback)\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    const storeLength = this.stores.length\n    let done = false\n    let i = 0\n    whilst(() => !done && i < storeLength, cb => {\n      const store = this.stores[i++]\n      store.has(key, (err, exists) => {\n        if (err == null) {\n          done = true\n          return cb(null, exists)\n        }\n        cb()\n      })\n    }, callback)\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    each(this.stores, (store, cb) => {\n      store.delete(key, cb)\n    }, callback)\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    each(this.stores, (store, cb) => {\n      store.close(cb)\n    }, callback)\n  }\n\n  batch () /* : Batch<Value> */ {\n    const batches = this.stores.map(store => store.batch())\n\n    return {\n      put: (key /* : Key */, value /* : Value */) /* : void */ => {\n        batches.forEach(b => b.put(key, value))\n      },\n      delete: (key /* : Key */) /* : void */ => {\n        batches.forEach(b => b.delete(key))\n      },\n      commit: (callback /* : Callback<void> */) /* : void */ => {\n        each(batches, (b, cb) => {\n          b.commit(cb)\n        }, callback)\n      }\n    }\n  }\n\n  query (q /* : Query<Value> */) /* : QueryResult<Value> */ {\n    return this.stores[this.stores.length - 1].query(q)\n  }\n}\n\nmodule.exports = TieredDatastore\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/datastore-core/src/tiered.js\n// module id = 727\n// module chunks = 0\n\n//# sourceURL=../node_modules/datastore-core/src/tiered.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15)\nconst pull = __webpack_require__(6)\nconst Pushable = __webpack_require__(54)\n\nconst PROTOCOL = __webpack_require__(377)\nconst encoding = __webpack_require__(376)\n\nmodule.exports = class Connection extends EventEmitter {\n  constructor (id, ipfs, room) {\n    super()\n    this._id = id\n    this._ipfs = ipfs\n    this._room = room\n    this._connection = null\n    this._connecting = false\n  }\n\n  push (message) {\n    if (this._connection) {\n      this._connection.push(encoding(message))\n    } else {\n      this.once('connect', () => this.push(message))\n      if (!this._connecting) {\n        this._getConnection()\n      }\n    }\n  }\n\n  stop () {\n    if (this._connection) {\n      this._connection.end()\n    }\n  }\n\n  _getConnection () {\n    this._connecting = true\n    this._getPeerAddresses(this._id, (err, peerAddresses) => {\n      if (err) {\n        this.emit('error', err)\n        return // early\n      }\n\n      if (!peerAddresses.length) {\n        this.emit('disconnect')\n        return // early\n      }\n\n      this._ipfs._libp2pNode.dial(peerAddresses[0], PROTOCOL, (err, conn) => {\n        if (err) {\n          this.emit('disconnect')\n          return // early\n        }\n        this._connecting = false\n        const pushable = Pushable()\n        this._connection = pushable\n        pull(\n          pushable,\n          conn,\n          pull.onEnd(() => {\n            delete this._connection\n            this.emit('disconnect')\n          })\n        )\n        this.emit('connect', pushable)\n      })\n    })\n  }\n\n  _getPeerAddresses (peerId, callback) {\n    this._ipfs.swarm.peers((err, peersAddresses) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      callback(\n        null,\n        peersAddresses\n          .filter((peerAddress) => peerAddress.peer.id.toB58String() === peerId)\n          .map(peerAddress => peerAddress.peer))\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs-pubsub-room/src/connection.js\n// module id = 728\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs-pubsub-room/src/connection.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst Buffer = __webpack_require__(1).Buffer\nconst EventEmitter = __webpack_require__(15)\n\nconst emitter = new EventEmitter()\n\nfunction handler (protocol, conn) {\n  conn.getPeerInfo((err, peerInfo) => {\n    if (err) {\n      console.log(err)\n      return\n    }\n\n    const peerId = peerInfo.id.toB58String()\n\n    pull(\n      conn,\n      pull.map((message) => {\n        let msg\n        try {\n          msg = JSON.parse(message.toString())\n        } catch (err) {\n          emitter.emit('warning', err.message)\n          return // early\n        }\n\n        if (peerId !== msg.from) {\n          emitter.emit('warning', 'no peerid match ' + msg.from)\n          return // early\n        }\n\n        const topicIDs = msg.topicIDs\n        if (!Array.isArray(topicIDs)) {\n          emitter.emit('warning', 'no topic IDs')\n          return // early\n        }\n\n        msg.data = Buffer.from(msg.data, 'hex')\n        msg.seqno = Buffer.from(msg.seqno, 'hex')\n\n        topicIDs.forEach((topic) => {\n          emitter.emit(topic, msg)\n        })\n\n        return msg\n      }),\n      pull.onEnd(() => {\n        // do nothing\n      })\n    )\n  })\n}\n\nexports = module.exports = {\n  handler: handler,\n  emitter: emitter\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs-pubsub-room/src/direct-connection-handler.js\n// module id = 729\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs-pubsub-room/src/direct-connection-handler.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst diff = __webpack_require__(879)\nconst EventEmitter = __webpack_require__(15)\nconst timers = __webpack_require__(25)\nconst clone = __webpack_require__(453)\nconst Buffer = __webpack_require__(1).Buffer\n\nconst PROTOCOL = __webpack_require__(377)\nconst Connection = __webpack_require__(728)\nconst encoding = __webpack_require__(376)\nconst directConnection = __webpack_require__(729)\n\nconst DEFAULT_OPTIONS = {\n  pollInterval: 1000\n}\n\nmodule.exports = (ipfs, topic, options) => {\n  return new PubSubRoom(ipfs, topic, options)\n}\n\nclass PubSubRoom extends EventEmitter {\n  constructor (ipfs, topic, options) {\n    super()\n    this._ipfs = ipfs\n    this._topic = topic\n    this._options = Object.assign({}, clone(DEFAULT_OPTIONS), clone(options))\n    this._peers = []\n    this._connections = {}\n\n    this._handleDirectMessage = this._handleDirectMessage.bind(this)\n\n    if (!this._ipfs.pubsub) {\n      throw new Error('This IPFS node does not have pubsub.')\n    }\n\n    if (this._ipfs.isOnline()) {\n      this._start()\n    } else {\n      this._ipfs.on('ready', this._start.bind(this))\n    }\n\n    this._ipfs.on('stop', this.leave.bind(this))\n  }\n\n  getPeers () {\n    return this._peers.slice(0)\n  }\n\n  hasPeer (peer) {\n    return this._peers.indexOf(peer) >= 0\n  }\n\n  leave () {\n    timers.clearInterval(this._interval)\n    Object.keys(this._connections).forEach((peer) => {\n      this._connections[peer].stop()\n    })\n    directConnection.emitter.removeListener(this._topic, this._handleDirectMessage)\n    this.emit('stop')\n  }\n\n  broadcast (_message) {\n    let message = encoding(_message)\n    this._ipfs.pubsub.publish(this._topic, message, (err) => {\n      if (err) {\n        this.emit('error', err)\n      }\n    })\n  }\n\n  sendTo (peer, message) {\n    let conn = this._connections[peer]\n    if (!conn) {\n      conn = new Connection(peer, this._ipfs, this)\n      conn.on('error', (err) => this.emit('error', err))\n      this._connections[peer] = conn\n\n      conn.once('disconnect', () => {\n        delete this._connections[peer]\n        this._peers = this._peers.filter((p) => p !== peer)\n        this.emit('peer left', peer)\n      })\n    }\n\n    // We should use the same sequence number generation as js-libp2p-floosub does:\n    // const seqno = Buffer.from(utils.randomSeqno())\n\n    // Until we figure out a good way to bring in the js-libp2p-floosub's randomSeqno\n    // generator, let's use 0 as the sequence number for all private messages\n    // const seqno = Buffer.from([0])\n    const seqno = Buffer.from([0])\n\n    const msg = {\n      to: peer,\n      from: this._ipfs._peerInfo.id.toB58String(),\n      data: Buffer.from(message).toString('hex'),\n      seqno: seqno.toString('hex'),\n      topicIDs: [ this._topic ],\n      topicCIDs: [ this._topic ]\n    }\n\n    conn.push(Buffer.from(JSON.stringify(msg)))\n  }\n\n  _start () {\n    this._interval = timers.setInterval(\n      this._pollPeers.bind(this),\n      this._options.pollInterval)\n\n    const listener = this._onMessage.bind(this)\n    this._ipfs.pubsub.subscribe(this._topic, listener, (err) => {\n      if (err) {\n        this.emit('error', err)\n      } else {\n        this.emit('subscribed', this._topic)\n      }\n    })\n\n    this.once('stop', () => {\n      this._ipfs.pubsub.unsubscribe(this._topic, listener)\n    })\n\n    this._ipfs._libp2pNode.handle(PROTOCOL, directConnection.handler)\n\n    directConnection.emitter.on(this._topic, this._handleDirectMessage)\n  }\n\n  _pollPeers () {\n    this._ipfs.pubsub.peers(this._topic, (err, _newPeers) => {\n      if (err) {\n        this.emit('error', err)\n        return // early\n      }\n\n      const newPeers = _newPeers.sort()\n\n      if (this._emitChanges(newPeers)) {\n        this._peers = newPeers\n      }\n    })\n  }\n\n  _emitChanges (newPeers) {\n    const differences = diff(this._peers, newPeers)\n\n    differences.added.forEach((addedPeer) => this.emit('peer joined', addedPeer))\n    differences.removed.forEach((removedPeer) => this.emit('peer left', removedPeer))\n\n    return differences.added.length > 0 || differences.removed.length > 0\n  }\n\n  _onMessage (message) {\n    this.emit('message', message)\n  }\n\n  _handleDirectMessage (message) {\n    if (message.to === this._ipfs._peerInfo.id.toB58String()) {\n      const m = Object.assign({}, message)\n      delete m.to\n      this.emit('message', m)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs-pubsub-room/src/index.js\n// module id = 730\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs-pubsub-room/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst waterfall = __webpack_require__(12)\nconst series = __webpack_require__(51)\nconst extend = __webpack_require__(394)\n\n// Boot an IPFS node depending on the options set\nmodule.exports = (self) => {\n  self.log('booting')\n  const options = self._options\n  const doInit = options.init\n  const doStart = options.start\n  const config = options.config\n  const setConfig = config && typeof config === 'object'\n  const repoOpen = !self._repo.closed\n\n  const customInitOptions = typeof options.init === 'object' ? options.init : {}\n  const initOptions = Object.assign({ bits: 2048, pass: self._options.pass }, customInitOptions)\n\n  // Checks if a repo exists, and if so opens it\n  // Will return callback with a bool indicating the existence\n  // of the repo\n  const maybeOpenRepo = (cb) => {\n    // nothing to do\n    if (repoOpen) {\n      return cb(null, true)\n    }\n\n    series([\n      (cb) => self._repo.open(cb),\n      (cb) => self.preStart(cb),\n      (cb) => {\n        self.log('initialized')\n        self.state.initialized()\n        cb(null, true)\n      }\n    ], (err, res) => {\n      if (err) {\n        // If the error is that no repo exists,\n        // which happens when the version file is not found\n        // we just want to signal that no repo exist, not\n        // fail the whole process.\n        // TODO: improve datastore and ipfs-repo implemenations so this error is a bit more unified\n        if (err.message.match(/not found/) || // indexeddb\n          err.message.match(/ENOENT/) || // fs\n          err.message.match(/No value/) // memory\n        ) {\n          return cb(null, false)\n        }\n        return cb(err)\n      }\n      cb(null, res)\n    })\n  }\n\n  const done = (err) => {\n    if (err) {\n      return self.emit('error', err)\n    }\n    self.log('boot:done')\n    self.emit('ready')\n  }\n\n  const tasks = []\n\n  // check if there as a repo and if so open it\n  maybeOpenRepo((err, hasRepo) => {\n    if (err) {\n      return done(err)\n    }\n\n    // No repo, but need should init one\n    if (doInit && !hasRepo) {\n      tasks.push((cb) => self.init(initOptions, cb))\n      // we know we will have a repo for all follwing tasks\n      // if the above succeeds\n      hasRepo = true\n    }\n\n    // Need to set config\n    if (setConfig) {\n      if (!hasRepo) {\n        console.log('WARNING, trying to set config on uninitialized repo, maybe forgot to set \"init: true\"')\n      } else {\n        tasks.push((cb) => {\n          waterfall([\n            (cb) => self.config.get(cb),\n            (config, cb) => {\n              extend(config, options.config)\n\n              self.config.replace(config, cb)\n            }\n          ], cb)\n        })\n      }\n    }\n\n    // Need to start up the node\n    if (doStart) {\n      if (!hasRepo) {\n        console.log('WARNING, trying to start ipfs node on uninitialized repo, maybe forgot to set \"init: true\"')\n        return done(new Error('Uninitalized repo'))\n      } else {\n        tasks.push((cb) => self.start(cb))\n      }\n    }\n\n    // Do the actual boot sequence\n    series(tasks, done)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/boot.js\n// module id = 731\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/boot.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Block = __webpack_require__(188)\nconst multihash = __webpack_require__(32)\nconst multihashing = __webpack_require__(49)\nconst CID = __webpack_require__(14)\nconst waterfall = __webpack_require__(12)\nconst promisify = __webpack_require__(22)\n\nmodule.exports = function block (self) {\n  return {\n    get: promisify((cid, callback) => {\n      cid = cleanCid(cid)\n      self._blockService.get(cid, callback)\n    }),\n    put: promisify((block, options, callback) => {\n      callback = callback || function noop () {}\n\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      if (Array.isArray(block)) {\n        return callback(new Error('Array is not supported'))\n      }\n\n      waterfall([\n        (cb) => {\n          if (Block.isBlock(block)) {\n            return cb(null, block)\n          }\n\n          if (options.cid && CID.isCID(options.cid)) {\n            return cb(null, new Block(block, options.cid))\n          }\n\n          const mhtype = options.mhtype || 'sha2-256'\n          const format = options.format || 'dag-pb'\n          const cidVersion = options.version || 0\n          // const mhlen = options.mhlen || 0\n\n          multihashing(block, mhtype, (err, multihash) => {\n            if (err) {\n              return cb(err)\n            }\n\n            cb(null, new Block(block, new CID(cidVersion, format, multihash)))\n          })\n        },\n        (block, cb) => self._blockService.put(block, (err) => {\n          if (err) {\n            return cb(err)\n          }\n          cb(null, block)\n        })\n      ], callback)\n    }),\n    rm: promisify((cid, callback) => {\n      cid = cleanCid(cid)\n      self._blockService.delete(cid, callback)\n    }),\n    stat: promisify((cid, callback) => {\n      cid = cleanCid(cid)\n\n      self._blockService.get(cid, (err, block) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, {\n          key: multihash.toB58String(cid.multihash),\n          size: block.data.length\n        })\n      })\n    })\n  }\n}\n\nfunction cleanCid (cid) {\n  if (CID.isCID(cid)) {\n    return cid\n  }\n\n  // CID constructor knows how to do the cleaning :)\n  return new CID(cid)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/block.js\n// module id = 732\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/block.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst defaultNodes = __webpack_require__(381).Bootstrap\nconst isMultiaddr = __webpack_require__(99).IPFS.matches\nconst promisify = __webpack_require__(22)\n\nfunction isValidMultiaddr (ma) {\n  try {\n    return isMultiaddr(ma)\n  } catch (err) {\n    return false\n  }\n}\n\nfunction invalidMultiaddrError (ma) {\n  return new Error(`${ma} is not a valid Multiaddr`)\n}\n\nmodule.exports = function bootstrap (self) {\n  return {\n    list: promisify((callback) => {\n      self._repo.config.get((err, config) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, {Peers: config.Bootstrap})\n      })\n    }),\n    add: promisify((multiaddr, args, callback) => {\n      if (typeof args === 'function') {\n        callback = args\n        args = { default: false }\n      }\n\n      if (multiaddr && !isValidMultiaddr(multiaddr)) {\n        return setImmediate(() => callback(invalidMultiaddrError(multiaddr)))\n      }\n\n      self._repo.config.get((err, config) => {\n        if (err) {\n          return callback(err)\n        }\n        if (args.default) {\n          config.Bootstrap = defaultNodes\n        } else if (multiaddr && config.Bootstrap.indexOf(multiaddr) === -1) {\n          config.Bootstrap.push(multiaddr)\n        }\n        self._repo.config.set(config, (err) => {\n          if (err) {\n            return callback(err)\n          }\n\n          callback(null, {\n            Peers: args.default ? defaultNodes : [multiaddr]\n          })\n        })\n      })\n    }),\n    rm: promisify((multiaddr, args, callback) => {\n      if (typeof args === 'function') {\n        callback = args\n        args = {all: false}\n      }\n      if (multiaddr && !isValidMultiaddr(multiaddr)) {\n        return setImmediate(() => callback(invalidMultiaddrError(multiaddr)))\n      }\n\n      self._repo.config.get((err, config) => {\n        if (err) {\n          return callback(err)\n        }\n        if (args.all) {\n          config.Bootstrap = []\n        } else {\n          config.Bootstrap = config.Bootstrap.filter((mh) => mh !== multiaddr)\n        }\n\n        self._repo.config.set(config, (err) => {\n          if (err) {\n            return callback(err)\n          }\n\n          const res = []\n          if (!args.all && multiaddr) {\n            res.push(multiaddr)\n          }\n\n          callback(null, {Peers: res})\n        })\n      })\n    })\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/bootstrap.js\n// module id = 733\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/bootstrap.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\n\nmodule.exports = function config (self) {\n  return {\n    get: promisify((key, callback) => {\n      if (typeof key === 'function') {\n        callback = key\n        key = undefined\n      }\n\n      return self._repo.config.get(key, callback)\n    }),\n    set: promisify((key, value, callback) => {\n      self._repo.config.set(key, value, callback)\n    }),\n    replace: promisify((config, callback) => {\n      self._repo.config.set(config, callback)\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/config.js\n// module id = 734\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/config.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\nconst CID = __webpack_require__(14)\nconst pull = __webpack_require__(6)\n\nmodule.exports = function dag (self) {\n  return {\n    put: promisify((dagNode, options, callback) => {\n      self._ipld.put(dagNode, options, callback)\n    }),\n\n    get: promisify((cid, path, options, callback) => {\n      if (typeof path === 'function') {\n        callback = path\n        path = undefined\n      }\n\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      options = options || {}\n\n      if (typeof cid === 'string') {\n        const split = cid.split('/')\n        cid = new CID(split[0])\n        split.shift()\n\n        if (split.length > 0) {\n          path = split.join('/')\n        } else {\n          path = '/'\n        }\n      }\n\n      self._ipld.get(cid, path, options, callback)\n    }),\n\n    tree: promisify((cid, path, options, callback) => {\n      if (typeof path === 'object') {\n        callback = options\n        options = path\n        path = undefined\n      }\n\n      if (typeof path === 'function') {\n        callback = path\n        path = undefined\n      }\n\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      options = options || {}\n\n      if (typeof cid === 'string') {\n        const split = cid.split('/')\n        cid = new CID(split[0])\n        split.shift()\n\n        if (split.length > 0) {\n          path = split.join('/')\n        } else {\n          path = undefined\n        }\n      }\n\n      pull(\n        self._ipld.treeStream(cid, path, options),\n        pull.collect(callback)\n      )\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/dag.js\n// module id = 735\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/dag.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst promisify = __webpack_require__(22)\nconst every = __webpack_require__(592)\nconst PeerId = __webpack_require__(26)\nconst CID = __webpack_require__(14)\nconst each = __webpack_require__(41)\n// const bsplit = require('buffer-split')\n\nmodule.exports = (self) => {\n  return {\n    /**\n     * Given a key, query the DHT for its best value.\n     *\n     * @param {Buffer} key\n     * @param {function(Error)} [callback]\n     * @returns {Promise|void}\n     */\n    get: promisify((key, options, callback) => {\n      if (!Buffer.isBuffer(key)) {\n        return callback(new Error('Not valid key'))\n      }\n\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      self._libp2pNode.dht.get(key, options.timeout, callback)\n    }),\n\n    /**\n     * Write a key/value pair to the DHT.\n     *\n     * Given a key of the form /foo/bar and a value of any\n     * form, this will write that value to the DHT with\n     * that key.\n     *\n     * @param {Buffer} key\n     * @param {Buffer} value\n     * @param {function(Error)} [callback]\n     * @returns {Promise|void}\n     */\n    put: promisify((key, value, callback) => {\n      if (!Buffer.isBuffer(key)) {\n        return callback(new Error('Not valid key'))\n      }\n\n      self._libp2pNode.dht.put(key, value, callback)\n    }),\n\n    /**\n     * Find peers in the DHT that can provide a specific value, given a key.\n     *\n     * @param {CID} key - They key to find providers for.\n     * @param {function(Error, Array<PeerInfo>)} [callback]\n     * @returns {Promise<PeerInfo>|void}\n     */\n    findprovs: promisify((key, callback) => {\n      if (typeof key === 'string') {\n        key = new CID(key)\n      }\n\n      self._libp2pNode.contentRouting.findProviders(key, callback)\n    }),\n\n    /**\n     * Query the DHT for all multiaddresses associated with a `PeerId`.\n     *\n     * @param {PeerId} peer - The id of the peer to search for.\n     * @param {function(Error, Array<Multiaddr>)} [callback]\n     * @returns {Promise<Array<Multiaddr>>|void}\n     */\n    findpeer: promisify((peer, callback) => {\n      if (typeof peer === 'string') {\n        peer = PeerId.createFromB58String(peer)\n      }\n\n      self._libp2pNode.peerRouting.findPeer(peer, (err, info) => {\n        if (err) {\n          return callback(err)\n        }\n\n        // convert to go-ipfs return value, we need to revisit\n        // this. For now will just conform.\n        const goResult = [\n          {\n            Responses: [{\n              ID: info.id.toB58String(),\n              Addresses: info.multiaddrs.toArray().map((a) => a.toString())\n            }]\n          }\n        ]\n\n        callback(null, goResult)\n      })\n    }),\n\n    /**\n     * Announce to the network that we are providing given values.\n     *\n     * @param {CID|Array<CID>} keys - The keys that should be announced.\n     * @param {Object} [options={}]\n     * @param {bool} [options.recursive=false] - Provide not only the given object but also all objects linked from it.\n     * @param {function(Error)} [callback]\n     * @returns {Promise|void}\n     */\n    provide: promisify((keys, options, callback) => {\n      if (!Array.isArray(keys)) {\n        keys = [keys]\n      }\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      // ensure blocks are actually local\n      every(keys, (key, cb) => {\n        self._repo.blocks.has(key, cb)\n      }, (err, has) => {\n        if (err) {\n          return callback(err)\n        }\n        /* TODO reconsider this. go-ipfs provides anyway\n        if (!has) {\n          return callback(new Error('Not all blocks exist locally, can not provide'))\n        }\n        */\n\n        if (options.recursive) {\n          // TODO: Implement recursive providing\n        } else {\n          each(keys, (cid, cb) => {\n            self._libp2pNode.contentRouting.provide(cid, cb)\n          }, callback)\n        }\n      })\n    }),\n\n    /**\n     * Find the closest peers to a given `PeerId`, by querying the DHT.\n     *\n     * @param {PeerId} peer - The `PeerId` to run the query agains.\n     * @param {function(Error, Array<PeerId>)} [callback]\n     * @returns {Promise<Array<PeerId>>|void}\n     */\n    query: promisify((peerId, callback) => {\n      if (typeof peerId === 'string') {\n        peerId = PeerId.createFromB58String(peerId)\n      }\n\n      // TODO expose this method in peerRouting\n      self._libp2pNode._dht.getClosestPeers(peerId.toBytes(), (err, peerIds) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, peerIds.map((id) => {\n          return { ID: id.toB58String() }\n        }))\n      })\n    })\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/dht.js\n// module id = 736\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/dht.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// dns-nodejs gets replaced by dns-browser when webpacked/browserified\nconst dns = __webpack_require__(756)\nconst promisify = __webpack_require__(22)\n\nmodule.exports = () => {\n  return promisify((domain, opts, callback) => {\n    if (typeof domain !== 'string') {\n      return callback(new Error('Invalid arguments, domain must be a string'))\n    }\n\n    if (typeof opts === 'function') {\n      callback = opts\n      opts = {}\n    }\n\n    dns(domain, opts, callback)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/dns.js\n// module id = 737\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/dns.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer, global) {\n\nconst unixfsEngine = __webpack_require__(930)\nconst importer = unixfsEngine.importer\nconst exporter = unixfsEngine.exporter\nconst promisify = __webpack_require__(22)\nconst pull = __webpack_require__(6)\nconst sort = __webpack_require__(1175)\nconst pushable = __webpack_require__(54)\nconst toStream = __webpack_require__(517)\nconst toPull = __webpack_require__(310)\nconst deferred = __webpack_require__(301)\nconst waterfall = __webpack_require__(12)\nconst isStream = __webpack_require__(957)\nconst Duplex = __webpack_require__(81).Duplex\nconst OtherBuffer = __webpack_require__(0).Buffer\nconst CID = __webpack_require__(14)\nconst toB58String = __webpack_require__(32).toB58String\n\nfunction noop () {}\n\nfunction prepareFile (self, opts, file, callback) {\n  opts = opts || {}\n\n  waterfall([\n    (cb) => self.object.get(file.multihash, cb),\n    (node, cb) => {\n      let cid = new CID(node.multihash)\n\n      if (opts['cid-version'] === 1) {\n        cid = cid.toV1()\n      }\n\n      const b58Hash = cid.toBaseEncodedString()\n\n      cb(null, {\n        path: file.path || b58Hash,\n        hash: b58Hash,\n        size: node.size\n      })\n    }\n  ], callback)\n}\n\nfunction normalizeContent (content) {\n  if (!Array.isArray(content)) {\n    content = [content]\n  }\n\n  return content.map((data) => {\n    // Buffer input\n    if (Buffer.isBuffer(data)) {\n      data = { path: '', content: pull.values([data]) }\n    }\n\n    // Readable stream input\n    if (isStream.readable(data)) {\n      data = { path: '', content: toPull.source(data) }\n    }\n\n    if (data && data.content && typeof data.content !== 'function') {\n      if (Buffer.isBuffer(data.content)) {\n        data.content = pull.values([data.content])\n      }\n\n      if (isStream.readable(data.content)) {\n        data.content = toPull.source(data.content)\n      }\n    }\n\n    return data\n  })\n}\n\nclass AddHelper extends Duplex {\n  constructor (pullStream, push, options) {\n    super(Object.assign({ objectMode: true }, options))\n    this._pullStream = pullStream\n    this._pushable = push\n    this._waitingPullFlush = []\n  }\n\n  _read () {\n    this._pullStream(null, (end, data) => {\n      while (this._waitingPullFlush.length) {\n        const cb = this._waitingPullFlush.shift()\n        cb()\n      }\n      if (end) {\n        if (end instanceof Error) {\n          this.emit('error', end)\n        }\n      } else {\n        this.push(data)\n      }\n    })\n  }\n\n  _write (chunk, encoding, callback) {\n    this._waitingPullFlush.push(callback)\n    this._pushable.push(chunk)\n  }\n}\n\nmodule.exports = function files (self) {\n  function _addPullStream (options) {\n    const opts = Object.assign({}, {\n      shardSplitThreshold: self._options.EXPERIMENTAL.sharding\n        ? 1000\n        : Infinity\n    }, options)\n\n    let total = 0\n    let prog = opts.progress || (() => {})\n    const progress = (bytes) => {\n      total += bytes\n      prog(total)\n    }\n\n    opts.progress = progress\n    return pull(\n      pull.map(normalizeContent),\n      pull.flatten(),\n      importer(self._ipld, opts),\n      pull.asyncMap(prepareFile.bind(null, self, opts))\n    )\n  }\n\n  function _catPullStream (ipfsPath) {\n    if (typeof ipfsPath === 'function') {\n      throw new Error('You must supply an ipfsPath')\n    }\n\n    ipfsPath = normalizePath(ipfsPath)\n    const pathComponents = ipfsPath.split('/')\n    const restPath = normalizePath(pathComponents.slice(1).join('/'))\n    const filterFile = (file) => (restPath && file.path === restPath) || (file.path === ipfsPath)\n\n    const d = deferred.source()\n\n    pull(\n      exporter(ipfsPath, self._ipld),\n      pull.collect((err, files) => {\n        if (err) { return d.abort(err) }\n        if (files && files.length > 1) {\n          files = files.filter(filterFile)\n        }\n        if (!files || !files.length) {\n          return d.abort(new Error('No such file'))\n        }\n\n        const file = files[0]\n        const content = file.content\n        if (!content && file.type === 'dir') {\n          return d.abort(new Error('this dag node is a directory'))\n        }\n        d.resolve(content)\n      })\n    )\n\n    return d\n  }\n\n  function _lsPullStreamImmutable (ipfsPath, options) {\n    const path = normalizePath(ipfsPath)\n    const recursive = options && options.recursive\n    const pathDepth = path.split('/').length\n    const maxDepth = recursive ? global.Infinity : pathDepth\n\n    return pull(\n      exporter(ipfsPath, self._ipld, { maxDepth: maxDepth }),\n      pull.filter(node =>\n        recursive ? node.depth >= pathDepth : node.depth === pathDepth\n      ),\n      pull.map(node => {\n        const cid = new CID(node.hash)\n        node = Object.assign({}, node, { hash: cid.toBaseEncodedString() })\n        delete node.content\n        return node\n      })\n    )\n  }\n\n  return {\n    add: promisify((data, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      } else if (!callback || typeof callback !== 'function') {\n        callback = noop\n      }\n\n      const ok = Buffer.isBuffer(data) ||\n                 isStream.readable(data) ||\n                 Array.isArray(data) ||\n                 OtherBuffer.isBuffer(data)\n\n      if (!ok) {\n        return callback(new Error('Invalid arguments, data must be an object, Buffer or readable stream'))\n      }\n\n      pull(\n        pull.values([data]),\n        _addPullStream(options),\n        sort((a, b) => {\n          if (a.path < b.path) return 1\n          if (a.path > b.path) return -1\n          return 0\n        }),\n        pull.collect(callback)\n      )\n    }),\n\n    addReadableStream: (options) => {\n      options = options || {}\n\n      const p = pushable()\n      const s = pull(\n        p,\n        _addPullStream(options)\n      )\n\n      const retStream = new AddHelper(s, p)\n\n      retStream.once('finish', () => p.end())\n\n      return retStream\n    },\n\n    addPullStream: _addPullStream,\n\n    cat: promisify((ipfsPath, callback) => {\n      pull(\n        _catPullStream(ipfsPath),\n        pull.collect((err, buffers) => {\n          if (err) { return callback(err) }\n          callback(null, Buffer.concat(buffers))\n        })\n      )\n    }),\n\n    catReadableStream: (ipfsPath) => toStream.source(_catPullStream(ipfsPath)),\n\n    catPullStream: _catPullStream,\n\n    get: promisify((ipfsPath, callback) => {\n      pull(\n        exporter(ipfsPath, self._ipld),\n        pull.asyncMap((file, cb) => {\n          if (file.content) {\n            pull(\n              file.content,\n              pull.collect((err, buffers) => {\n                if (err) { return cb(err) }\n                file.content = Buffer.concat(buffers)\n                cb(null, file)\n              })\n            )\n          } else {\n            cb(null, file)\n          }\n        }),\n        pull.collect(callback)\n      )\n    }),\n\n    getReadableStream: (ipfsPath) => {\n      return toStream.source(\n        pull(\n          exporter(ipfsPath, self._ipld),\n          pull.map((file) => {\n            if (file.content) {\n              file.content = toStream.source(file.content)\n              file.content.pause()\n            }\n\n            return file\n          })\n        )\n      )\n    },\n\n    getPullStream: (ipfsPath) => {\n      return exporter(ipfsPath, self._ipld)\n    },\n\n    lsImmutable: promisify((ipfsPath, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      pull(\n        _lsPullStreamImmutable(ipfsPath, options),\n        pull.collect((err, values) => {\n          if (err) {\n            callback(err)\n            return\n          }\n          callback(null, values)\n        })\n      )\n    }),\n\n    lsReadableStreamImmutable: (ipfsPath, options) => {\n      return toStream.source(_lsPullStreamImmutable(ipfsPath, options))\n    },\n\n    lsPullStreamImmutable: _lsPullStreamImmutable\n  }\n}\n\nfunction normalizePath (path) {\n  if (Buffer.isBuffer(path)) {\n    path = toB58String(path)\n  }\n  if (path.indexOf('/ipfs/') === 0) {\n    path = path.substring('/ipfs/'.length)\n  }\n  if (path.charAt(path.length - 1) === '/') {\n    path = path.substring(0, path.length - 1)\n  }\n\n  return path\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/files.js\n// module id = 738\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/files.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\nconst setImmediate = __webpack_require__(8)\nconst pkgversion = __webpack_require__(378).version\n\nmodule.exports = function id (self) {\n  return promisify((opts, callback) => {\n    if (typeof opts === 'function') {\n      callback = opts\n      opts = {}\n    }\n\n    setImmediate(() => callback(null, {\n      id: self._peerInfo.id.toB58String(),\n      publicKey: self._peerInfo.id.pubKey.bytes.toString('base64'),\n      addresses: self._peerInfo.multiaddrs\n        .toArray()\n        .map((ma) => ma.toString())\n        .filter((ma) => ma.indexOf('ipfs') >= 0)\n        .sort(),\n      agentVersion: `js-ipfs/${pkgversion}`,\n      protocolVersion: '9000'\n    }))\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/id.js\n// module id = 739\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/id.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.preStart = __webpack_require__(748)\nexports.start = __webpack_require__(750)\nexports.stop = __webpack_require__(752)\nexports.isOnline = __webpack_require__(742)\nexports.version = __webpack_require__(754)\nexports.id = __webpack_require__(739)\nexports.repo = __webpack_require__(380)\nexports.init = __webpack_require__(741)\nexports.bootstrap = __webpack_require__(733)\nexports.config = __webpack_require__(734)\nexports.block = __webpack_require__(732)\nexports.object = __webpack_require__(746)\nexports.dag = __webpack_require__(735)\nexports.libp2p = __webpack_require__(744)\nexports.swarm = __webpack_require__(753)\nexports.ping = __webpack_require__(747)\nexports.files = __webpack_require__(738)\nexports.bitswap = __webpack_require__(379)\nexports.pubsub = __webpack_require__(749)\nexports.dht = __webpack_require__(736)\nexports.dns = __webpack_require__(737)\nexports.key = __webpack_require__(743)\nexports.stats = __webpack_require__(751)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/index.js\n// module id = 740\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst peerId = __webpack_require__(26)\nconst waterfall = __webpack_require__(12)\nconst parallel = __webpack_require__(85)\nconst promisify = __webpack_require__(22)\nconst config = __webpack_require__(381)\nconst Keychain = __webpack_require__(448)\n\nconst addDefaultAssets = __webpack_require__(1350)\n\nmodule.exports = function init (self) {\n  return promisify((opts, callback) => {\n    if (typeof opts === 'function') {\n      callback = opts\n      opts = {}\n    }\n\n    const done = (err, res) => {\n      if (err) {\n        self.emit('error', err)\n        return callback(err)\n      }\n\n      self.state.initialized()\n      self.emit('init')\n      callback(null, res)\n    }\n\n    if (self.state.state() !== 'uninitalized') {\n      return done(new Error('Not able to init from state: ' + self.state.state()))\n    }\n\n    self.state.init()\n    self.log('init')\n\n    opts.emptyRepo = opts.emptyRepo || false\n    opts.bits = Number(opts.bits) || 2048\n    opts.log = opts.log || function () {}\n    let privateKey\n    waterfall([\n      // Verify repo does not yet exist.\n      (cb) => self._repo.exists(cb),\n      (exists, cb) => {\n        self.log('repo exists?', exists)\n        if (exists === true) {\n          return cb(new Error('repo already exists'))\n        }\n\n        // Generate peer identity keypair + transform to desired format + add to config.\n        opts.log(`generating ${opts.bits}-bit RSA keypair...`, false)\n        self.log('generating peer id: %s bits', opts.bits)\n        peerId.create({ bits: opts.bits }, cb)\n      },\n      (keys, cb) => {\n        self.log('identity generated')\n        config.Identity = {\n          PeerID: keys.toB58String(),\n          PrivKey: keys.privKey.bytes.toString('base64')\n        }\n        if (opts.pass) {\n          privateKey = keys.privKey\n          config.Keychain = Keychain.generateOptions()\n        }\n        opts.log('done')\n        opts.log('peer identity: ' + config.Identity.PeerID)\n\n        self._repo.init(config, cb)\n      },\n      (_, cb) => self._repo.open(cb),\n      (cb) => {\n        self.log('repo opened')\n        if (opts.pass) {\n          self.log('creating keychain')\n          const keychainOptions = Object.assign({passPhrase: opts.pass}, config.Keychain)\n          self._keychain = new Keychain(self._repo.keys, keychainOptions)\n          self._keychain.importPeer('self', { privKey: privateKey }, cb)\n        } else {\n          cb(null, true)\n        }\n      },\n      (_, cb) => {\n        if (opts.emptyRepo) {\n          return cb(null, true)\n        }\n\n        self.log('adding assets')\n        const tasks = [\n          // add empty unixfs dir object (go-ipfs assumes this exists)\n          (cb) => self.object.new('unixfs-dir', cb)\n        ]\n\n        if (typeof addDefaultAssets === 'function') {\n          tasks.push((cb) => addDefaultAssets(self, opts.log, cb))\n        }\n\n        parallel(tasks, (err) => {\n          if (err) {\n            cb(err)\n          } else {\n            cb(null, true)\n          }\n        })\n      }\n    ], done)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/init.js\n// module id = 741\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/init.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function isOnline (self) {\n  return () => {\n    return Boolean(self._bitswap && self._libp2pNode && self._libp2pNode.isStarted())\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/is-online.js\n// module id = 742\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/is-online.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// See https://github.com/ipfs/specs/tree/master/keystore\n\nconst promisify = __webpack_require__(22)\n\nmodule.exports = function key (self) {\n  return {\n    gen: promisify((name, opts, callback) => {\n      self._keychain.createKey(name, opts.type, opts.size, callback)\n    }),\n\n    info: promisify((name, callback) => {\n      self._keychain.findKeyByName(name, callback)\n    }),\n\n    list: promisify((callback) => {\n      self._keychain.listKeys(callback)\n    }),\n\n    rm: promisify((name, callback) => {\n      self._keychain.removeKey(name, callback)\n    }),\n\n    rename: promisify((oldName, newName, callback) => {\n      self._keychain.renameKey(oldName, newName, (err, key) => {\n        if (err) return callback(err)\n        const result = {\n          was: oldName,\n          now: key.name,\n          id: key.id,\n          overwrite: false\n        }\n        callback(null, result)\n      })\n    }),\n\n    import: promisify((name, pem, password, callback) => {\n      self._keychain.importKey(name, pem, password, callback)\n    }),\n\n    export: promisify((name, password, callback) => {\n      self._keychain.exportKey(name, password, callback)\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/key.js\n// module id = 743\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/key.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// libp2p-nodejs gets replaced by libp2p-browser when webpacked/browserified\nconst Node = __webpack_require__(757)\nconst promisify = __webpack_require__(22)\nconst get = __webpack_require__(455)\n\nmodule.exports = function libp2p (self) {\n  return {\n    start: promisify((callback) => {\n      self.config.get(gotConfig)\n\n      function gotConfig (err, config) {\n        if (err) {\n          return callback(err)\n        }\n\n        const options = {\n          mdns: get(config, 'Discovery.MDNS.Enabled'),\n          webRTCStar: get(config, 'Discovery.webRTCStar.Enabled'),\n          bootstrap: get(config, 'Bootstrap'),\n          modules: self._libp2pModules,\n          // EXPERIMENTAL\n          pubsub: get(self._options, 'EXPERIMENTAL.pubsub', false),\n          dht: get(self._options, 'EXPERIMENTAL.dht', false),\n          relay: {\n            enabled: get(config, 'EXPERIMENTAL.relay.enabled', false),\n            hop: {\n              enabled: get(config, 'EXPERIMENTAL.relay.hop.enabled', false),\n              active: get(config, 'EXPERIMENTAL.relay.hop.active', false)\n            }\n          }\n        }\n\n        self._libp2pNode = new Node(self._peerInfo, self._peerInfoBook, options)\n\n        self._libp2pNode.on('peer:discovery', (peerInfo) => {\n          const dial = () => {\n            self._peerInfoBook.put(peerInfo)\n            self._libp2pNode.dial(peerInfo, () => {})\n          }\n          if (self.isOnline()) {\n            dial()\n          } else {\n            self._libp2pNode.once('start', dial)\n          }\n        })\n\n        self._libp2pNode.on('peer:connect', (peerInfo) => {\n          self._peerInfoBook.put(peerInfo)\n        })\n\n        self._libp2pNode.start((err) => {\n          if (err) { return callback(err) }\n\n          self._libp2pNode.peerInfo.multiaddrs.forEach((ma) => {\n            console.log('Swarm listening on', ma.toString())\n          })\n\n          callback()\n        })\n      }\n    }),\n    stop: promisify((callback) => {\n      self._libp2pNode.stop(callback)\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/libp2p.js\n// module id = 744\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/libp2p.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction fail () {\n  throw new Error('Key management requires \\'--pass ...\\' option')\n}\n\nclass NoKeychain {\n  static get options () { fail() }\n  static generateOptions () { fail() }\n\n  createKey () { fail() }\n  listKeys () { fail() }\n  findKeyById () { fail() }\n  findKeyByName () { fail() }\n  renameKey () { fail() }\n  removeKey () { fail() }\n  exportKey () { fail() }\n  importKey () { fail() }\n  importPeer () { fail() }\n\n  get cms () { fail() }\n}\n\nmodule.exports = NoKeychain\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/no-keychain.js\n// module id = 745\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/no-keychain.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst waterfall = __webpack_require__(12)\nconst promisify = __webpack_require__(22)\nconst dagPB = __webpack_require__(121)\nconst DAGNode = dagPB.DAGNode\nconst DAGLink = dagPB.DAGLink\nconst CID = __webpack_require__(14)\nconst mh = __webpack_require__(32)\nconst Unixfs = __webpack_require__(95)\nconst assert = __webpack_require__(16)\n\nfunction normalizeMultihash (multihash, enc) {\n  if (typeof multihash === 'string') {\n    if (enc === 'base58' || !enc) {\n      return multihash\n    }\n\n    return Buffer.from(multihash, enc)\n  } else if (Buffer.isBuffer(multihash)) {\n    return multihash\n  } else {\n    throw new Error('unsupported multihash')\n  }\n}\n\nfunction parseBuffer (buf, encoding, callback) {\n  switch (encoding) {\n    case 'json':\n      return parseJSONBuffer(buf, callback)\n    case 'protobuf':\n      return parseProtoBuffer(buf, callback)\n    default:\n      callback(new Error(`unkown encoding: ${encoding}`))\n  }\n}\n\nfunction parseJSONBuffer (buf, callback) {\n  let data\n  let links\n\n  try {\n    const parsed = JSON.parse(buf.toString())\n\n    links = (parsed.Links || []).map((link) => {\n      return new DAGLink(\n        link.Name || link.name,\n        link.Size || link.size,\n        mh.fromB58String(link.Hash || link.hash || link.multihash)\n      )\n    })\n    data = Buffer.from(parsed.Data)\n  } catch (err) {\n    return callback(new Error('failed to parse JSON: ' + err))\n  }\n\n  DAGNode.create(data, links, callback)\n}\n\nfunction parseProtoBuffer (buf, callback) {\n  dagPB.util.deserialize(buf, callback)\n}\n\nmodule.exports = function object (self) {\n  function editAndSave (edit) {\n    return (multihash, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      waterfall([\n        (cb) => {\n          self.object.get(multihash, options, cb)\n        },\n        (node, cb) => {\n          // edit applies the edit func passed to\n          // editAndSave\n          edit(node, (err, node) => {\n            if (err) {\n              return cb(err)\n            }\n            self._ipld.put(node, {\n              cid: new CID(node.multihash)\n            }, (err) => {\n              cb(err, node)\n            })\n          })\n        }\n      ], callback)\n    }\n  }\n\n  return {\n    new: promisify((template, callback) => {\n      if (typeof template === 'function') {\n        callback = template\n        template = undefined\n      }\n\n      let data\n\n      if (template) {\n        assert(template === 'unixfs-dir', 'unkown template')\n        data = (new Unixfs('directory')).marshal()\n      } else {\n        data = Buffer.alloc(0)\n      }\n\n      DAGNode.create(data, (err, node) => {\n        if (err) {\n          return callback(err)\n        }\n        self._ipld.put(node, {\n          cid: new CID(node.multihash)\n        }, (err) => {\n          if (err) {\n            return callback(err)\n          }\n\n          callback(null, node)\n        })\n      })\n    }),\n    put: promisify((obj, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      const encoding = options.enc\n      let node\n\n      if (Buffer.isBuffer(obj)) {\n        if (encoding) {\n          parseBuffer(obj, encoding, (err, _node) => {\n            if (err) {\n              return callback(err)\n            }\n            node = _node\n            next()\n          })\n        } else {\n          DAGNode.create(obj, (err, _node) => {\n            if (err) {\n              return callback(err)\n            }\n            node = _node\n            next()\n          })\n        }\n      } else if (obj.multihash) {\n        // already a dag node\n        node = obj\n        next()\n      } else if (typeof obj === 'object') {\n        DAGNode.create(obj.Data, obj.Links, (err, _node) => {\n          if (err) {\n            return callback(err)\n          }\n          node = _node\n          next()\n        })\n      } else {\n        return callback(new Error('obj not recognized'))\n      }\n\n      function next () {\n        self._ipld.put(node, {\n          cid: new CID(node.multihash)\n        }, (err) => {\n          if (err) {\n            return callback(err)\n          }\n\n          self.object.get(node.multihash, callback)\n        })\n      }\n    }),\n\n    get: promisify((multihash, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      let mh\n\n      try {\n        mh = normalizeMultihash(multihash, options.enc)\n      } catch (err) {\n        return callback(err)\n      }\n      const cid = new CID(mh)\n\n      self._ipld.get(cid, (err, result) => {\n        if (err) {\n          return callback(err)\n        }\n\n        const node = result.value\n\n        callback(null, node)\n      })\n    }),\n\n    data: promisify((multihash, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      self.object.get(multihash, options, (err, node) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, node.data)\n      })\n    }),\n\n    links: promisify((multihash, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      self.object.get(multihash, options, (err, node) => {\n        if (err) {\n          return callback(err)\n        }\n\n        callback(null, node.links)\n      })\n    }),\n\n    stat: promisify((multihash, options, callback) => {\n      if (typeof options === 'function') {\n        callback = options\n        options = {}\n      }\n\n      self.object.get(multihash, options, (err, node) => {\n        if (err) {\n          return callback(err)\n        }\n\n        dagPB.util.serialize(node, (err, serialized) => {\n          if (err) {\n            return callback(err)\n          }\n\n          const blockSize = serialized.length\n          const linkLength = node.links.reduce((a, l) => a + l.size, 0)\n\n          const nodeJSON = node.toJSON()\n\n          callback(null, {\n            Hash: nodeJSON.multihash,\n            NumLinks: node.links.length,\n            BlockSize: blockSize,\n            LinksSize: blockSize - node.data.length,\n            DataSize: node.data.length,\n            CumulativeSize: blockSize + linkLength\n          })\n        })\n      })\n    }),\n\n    patch: promisify({\n      addLink (multihash, link, options, callback) {\n        editAndSave((node, cb) => {\n          DAGNode.addLink(node, link, cb)\n        })(multihash, options, callback)\n      },\n\n      rmLink (multihash, linkRef, options, callback) {\n        editAndSave((node, cb) => {\n          if (linkRef.constructor &&\n              linkRef.constructor.name === 'DAGLink') {\n            linkRef = linkRef._name\n          }\n          DAGNode.rmLink(node, linkRef, cb)\n        })(multihash, options, callback)\n      },\n\n      appendData (multihash, data, options, callback) {\n        editAndSave((node, cb) => {\n          const newData = Buffer.concat([node.data, data])\n          DAGNode.create(newData, node.links, cb)\n        })(multihash, options, callback)\n      },\n\n      setData (multihash, data, options, callback) {\n        editAndSave((node, cb) => {\n          DAGNode.create(data, node.links, cb)\n        })(multihash, options, callback)\n      }\n    })\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/object.js\n// module id = 746\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/object.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\n\nmodule.exports = function ping (self) {\n  return promisify((callback) => {\n    callback(new Error('Not implemented'))\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/ping.js\n// module id = 747\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/ping.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst peerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst multiaddr = __webpack_require__(21)\nconst waterfall = __webpack_require__(12)\nconst Keychain = __webpack_require__(448)\nconst NoKeychain = __webpack_require__(745)\n/*\n * Load stuff from Repo into memory\n */\nmodule.exports = function preStart (self) {\n  return (callback) => {\n    self.log('pre-start')\n\n    const pass = self._options.pass\n    waterfall([\n      (cb) => self._repo.config.get(cb),\n      (config, cb) => {\n        // Create keychain configuration, if needed.\n        if (config.Keychain) {\n          return cb(null, config)\n        }\n        config.Keychain = Keychain.generateOptions()\n        self.config.set('Keychain', config.Keychain, (err) => {\n          self.log('using default keychain options')\n          cb(err, config)\n        })\n      },\n      (config, cb) => {\n        // Construct the keychain\n        if (self._keychain) {\n          // most likely an init or upgrade has happened\n        } else if (pass) {\n          const keychainOptions = Object.assign({passPhrase: pass}, config.Keychain)\n          self._keychain = new Keychain(self._repo.keys, keychainOptions)\n          self.log('keychain constructed')\n        } else {\n          self._keychain = new NoKeychain()\n          self.log('no keychain, use --pass')\n        }\n        cb(null, config)\n      },\n      (config, cb) => {\n        const privKey = config.Identity.PrivKey\n\n        peerId.createFromPrivKey(privKey, (err, id) => {\n          cb(err, config, id)\n        })\n      },\n      (config, id, cb) => {\n        // Import the private key as 'self', if needed.\n        if (!pass) {\n          return cb(null, config, id)\n        }\n        self._keychain.findKeyByName('self', (err) => {\n          if (err) {\n            self.log('Creating \"self\" key')\n            return self._keychain.importPeer('self', id, (err) => cb(err, config, id))\n          }\n          cb(null, config, id)\n        })\n      },\n      (config, id, cb) => {\n        self.log('peer created')\n        self._peerInfo = new PeerInfo(id)\n\n        if (config.Addresses && config.Addresses.Swarm) {\n          config.Addresses.Swarm.forEach((addr) => {\n            let ma = multiaddr(addr)\n\n            if (ma.getPeerId()) {\n              ma = ma.encapsulate('/ipfs/' + self._peerInfo.id.toB58String())\n            }\n\n            self._peerInfo.multiaddrs.add(ma)\n          })\n        }\n\n        cb()\n      }\n    ], callback)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/pre-start.js\n// module id = 748\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/pre-start.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst promisify = __webpack_require__(22)\n\nmodule.exports = function pubsub (self) {\n  return {\n    subscribe: (topic, options, handler, callback) => {\n      if (typeof options === 'function') {\n        callback = handler\n        handler = options\n        options = {}\n      }\n\n      if (!callback) {\n        return new Promise((resolve, reject) => {\n          self._libp2pNode.pubsub.subscribe(topic, options, handler, (err) => {\n            if (err) {\n              return reject(err)\n            }\n            resolve()\n          })\n        })\n      } else {\n        self._libp2pNode.pubsub.subscribe(topic, options, handler, callback)\n      }\n    },\n\n    unsubscribe: (topic, handler) => {\n      self._libp2pNode.pubsub.unsubscribe(topic, handler)\n    },\n\n    publish: promisify((topic, data, callback) => {\n      self._libp2pNode.pubsub.publish(topic, data, callback)\n    }),\n\n    ls: promisify((callback) => {\n      self._libp2pNode.pubsub.ls(callback)\n    }),\n\n    peers: promisify((topic, callback) => {\n      self._libp2pNode.pubsub.peers(topic, callback)\n    }),\n\n    setMaxListeners (n) {\n      self._libp2pNode.pubsub.setMaxListeners(n)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/pubsub.js\n// module id = 749\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/pubsub.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst series = __webpack_require__(51)\nconst Bitswap = __webpack_require__(886)\nconst setImmediate = __webpack_require__(8)\nconst promisify = __webpack_require__(22)\n\nmodule.exports = (self) => {\n  return promisify((callback) => {\n    callback = callback || function noop () {}\n\n    const done = (err) => {\n      if (err) {\n        setImmediate(() => self.emit('error', err))\n        return callback(err)\n      }\n\n      self.state.started()\n      setImmediate(() => self.emit('start'))\n      callback()\n    }\n\n    if (self.state.state() !== 'stopped') {\n      return done(new Error('Not able to start from state: ' + self.state.state()))\n    }\n\n    self.log('starting')\n    self.state.start()\n\n    series([\n      (cb) => {\n        self._repo.closed\n          ? self._repo.open(cb)\n          : cb()\n      },\n      (cb) => self.preStart(cb),\n      (cb) => self.libp2p.start(cb)\n    ], (err) => {\n      if (err) { return done(err) }\n\n      self._bitswap = new Bitswap(\n        self._libp2pNode,\n        self._repo.blocks,\n        { statsEnabled: true }\n      )\n\n      self._bitswap.start()\n      self._blockService.setExchange(self._bitswap)\n      done()\n    })\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/start.js\n// module id = 750\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/start.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function stats (self) {\n  return {\n    bitswap: __webpack_require__(379)(self).stat,\n    repo: __webpack_require__(380)(self).stat\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/stats.js\n// module id = 751\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/stats.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst series = __webpack_require__(51)\nconst promisify = __webpack_require__(22)\n\nmodule.exports = (self) => {\n  return promisify((callback) => {\n    callback = callback || function noop () {}\n\n    self.log('stop')\n\n    if (self.state.state() === 'stopped') {\n      return callback(new Error('Already stopped'))\n    }\n\n    if (self.state.state() !== 'running') {\n      return callback(new Error('Not able to stop from state: ' + self.state.state()))\n    }\n\n    const done = (err) => {\n      if (err) {\n        self.emit('error', err)\n        return callback(err)\n      }\n      self.state.stopped()\n      self.emit('stop')\n      callback()\n    }\n\n    self.state.stop()\n    self._blockService.unsetExchange()\n    self._bitswap.stop()\n\n    series([\n      (cb) => self.libp2p.stop(cb),\n      (cb) => self._repo.close(cb)\n    ], done)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/stop.js\n// module id = 752\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/stop.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multiaddr = __webpack_require__(21)\nconst promisify = __webpack_require__(22)\nconst values = __webpack_require__(281)\n\nconst OFFLINE_ERROR = __webpack_require__(382).OFFLINE_ERROR\n\nmodule.exports = function swarm (self) {\n  return {\n    peers: promisify((opts, callback) => {\n      if (typeof opts === 'function') {\n        callback = opts\n        opts = {}\n      }\n\n      if (!self.isOnline()) {\n        return callback(new Error(OFFLINE_ERROR))\n      }\n\n      const verbose = opts.v || opts.verbose\n      // TODO: return latency and streams when verbose is set\n      // we currently don't have this information\n\n      const peers = []\n\n      values(self._peerInfoBook.getAll()).forEach((peer) => {\n        const connectedAddr = peer.isConnected()\n\n        if (!connectedAddr) { return }\n\n        const tupple = {\n          addr: connectedAddr,\n          peer: peer\n        }\n        if (verbose) {\n          tupple.latency = 'unknown'\n        }\n\n        peers.push(tupple)\n      })\n\n      callback(null, peers)\n    }),\n\n    // all the addrs we know\n    addrs: promisify((callback) => {\n      if (!self.isOnline()) {\n        return callback(new Error(OFFLINE_ERROR))\n      }\n\n      const peers = values(self._peerInfoBook.getAll())\n\n      callback(null, peers)\n    }),\n\n    localAddrs: promisify((callback) => {\n      if (!self.isOnline()) {\n        return callback(new Error(OFFLINE_ERROR))\n      }\n\n      callback(null, self._libp2pNode.peerInfo.multiaddrs.toArray())\n    }),\n\n    connect: promisify((maddr, callback) => {\n      if (!self.isOnline()) {\n        return callback(new Error(OFFLINE_ERROR))\n      }\n\n      if (typeof maddr === 'string') {\n        maddr = multiaddr(maddr)\n      }\n\n      self._libp2pNode.dial(maddr, callback)\n    }),\n\n    disconnect: promisify((maddr, callback) => {\n      if (!self.isOnline()) {\n        return callback(new Error(OFFLINE_ERROR))\n      }\n\n      if (typeof maddr === 'string') {\n        maddr = multiaddr(maddr)\n      }\n\n      self._libp2pNode.hangUp(maddr, callback)\n    }),\n\n    filters: promisify((callback) => callback(new Error('Not implemented')))\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/swarm.js\n// module id = 753\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/swarm.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pkg = __webpack_require__(378)\nconst promisify = __webpack_require__(22)\n\n// TODO add the commit hash of the current ipfs version to the response.\nmodule.exports = function version (self) {\n  return promisify((opts, callback) => {\n    if (typeof opts === 'function') {\n      callback = opts\n      opts = {}\n    }\n\n    self.repo.version((err, repoVersion) => {\n      if (err) {\n        callback(err)\n      }\n\n      callback(null, {\n        version: pkg.version,\n        repo: repoVersion,\n        commit: ''\n      })\n    })\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/components/version.js\n// module id = 754\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/components/version.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst BlockService = __webpack_require__(414)\nconst Ipld = __webpack_require__(955)\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst multiaddr = __webpack_require__(21)\nconst multihash = __webpack_require__(32)\nconst PeerBook = __webpack_require__(505)\nconst CID = __webpack_require__(14)\nconst debug = __webpack_require__(5)\nconst extend = __webpack_require__(394)\nconst EventEmitter = __webpack_require__(15)\n\nconst boot = __webpack_require__(731)\nconst components = __webpack_require__(740)\n// replaced by repo-browser when running in the browser\nconst defaultRepo = __webpack_require__(758)\n\nclass IPFS extends EventEmitter {\n  constructor (options) {\n    super()\n\n    this._options = {\n      init: true,\n      start: true,\n      EXPERIMENTAL: {}\n    }\n\n    options = options || {}\n    this._libp2pModules = options.libp2p && options.libp2p.modules\n\n    extend(this._options, options)\n\n    if (options.init === false) {\n      this._options.init = false\n    }\n\n    if (!(options.start === false)) {\n      this._options.start = true\n    }\n\n    if (typeof options.repo === 'string' ||\n        options.repo === undefined) {\n      this._repo = defaultRepo(options.repo)\n    } else {\n      this._repo = options.repo\n    }\n\n    // IPFS utils\n    this.log = debug('jsipfs')\n    this.log.err = debug('jsipfs:err')\n\n    // IPFS types\n    this.types = {\n      Buffer: Buffer,\n      PeerId: PeerId,\n      PeerInfo: PeerInfo,\n      multiaddr: multiaddr,\n      multihash: multihash,\n      CID: CID\n    }\n\n    // IPFS Core Internals\n    // this._repo - assigned above\n    this._peerInfoBook = new PeerBook()\n    this._peerInfo = undefined\n    this._libp2pNode = undefined\n    this._bitswap = undefined\n    this._blockService = new BlockService(this._repo)\n    this._ipld = new Ipld(this._blockService)\n    this._pubsub = undefined\n\n    // IPFS Core exposed components\n    //   - for booting up a node\n    this.init = components.init(this)\n    this.preStart = components.preStart(this)\n    this.start = components.start(this)\n    this.stop = components.stop(this)\n    this.shutdown = this.stop\n    this.isOnline = components.isOnline(this)\n    //   - interface-ipfs-core defined API\n    this.version = components.version(this)\n    this.id = components.id(this)\n    this.repo = components.repo(this)\n    this.bootstrap = components.bootstrap(this)\n    this.config = components.config(this)\n    this.block = components.block(this)\n    this.object = components.object(this)\n    this.dag = components.dag(this)\n    this.libp2p = components.libp2p(this)\n    this.swarm = components.swarm(this)\n    this.files = components.files(this)\n    this.bitswap = components.bitswap(this)\n    this.ping = components.ping(this)\n    this.pubsub = components.pubsub(this)\n    this.dht = components.dht(this)\n    this.dns = components.dns(this)\n    this.key = components.key(this)\n    this.stats = components.stats(this)\n\n    if (this._options.EXPERIMENTAL.pubsub) {\n      this.log('EXPERIMENTAL pubsub is enabled')\n    }\n    if (this._options.EXPERIMENTAL.sharding) {\n      this.log('EXPERIMENTAL sharding is enabled')\n    }\n    if (this._options.EXPERIMENTAL.dht) {\n      this.log('EXPERIMENTAL Kademlia DHT is enabled')\n    }\n    if (this._options.EXPERIMENTAL.relay) {\n      this.log('EXPERIMENTAL Relay is enabled')\n    }\n\n    this.state = __webpack_require__(759)(this)\n\n    // ipfs.ls\n    this.ls = this.files.lsImmutable\n    this.lsReadableStream = this.files.lsReadableStreamImmutable\n    this.lsPullStream = this.files.lsPullStreamImmutable\n\n    boot(this)\n  }\n}\n\nexports = module.exports = IPFS\n\nexports.createNode = (options) => {\n  return new IPFS(options)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/index.js\n// module id = 755\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (domain, opts, callback) => {\n  domain = encodeURIComponent(domain)\n  let url = `https://ipfs.io/api/v0/dns?arg=${domain}`\n\n  for (const prop in opts) {\n    url += `&${prop}=${opts[prop]}`\n  }\n\n  self.fetch(url, {mode: 'cors'})\n    .then((response) => {\n      return response.json()\n    })\n    .then((response) => {\n      if (response.Path) {\n        return callback(null, response.Path)\n      } else {\n        return callback(new Error(response.Message))\n      }\n    })\n    .catch((error) => {\n      callback(error)\n    })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/runtime/dns-browser.js\n// module id = 756\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/runtime/dns-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst WS = __webpack_require__(1033)\nconst WebRTCStar = __webpack_require__(1029)\nconst WebSocketStar = __webpack_require__(1031)\nconst Multiplex = __webpack_require__(1008)\nconst SECIO = __webpack_require__(1021)\nconst Railing = __webpack_require__(1014)\nconst libp2p = __webpack_require__(764)\n\nclass Node extends libp2p {\n  constructor (peerInfo, peerBook, options) {\n    options = options || {}\n    const wrtcstar = new WebRTCStar({id: peerInfo.id})\n    const wsstar = new WebSocketStar({id: peerInfo.id})\n\n    const modules = {\n      transport: [new WS(), wrtcstar, wsstar],\n      connection: {\n        muxer: [Multiplex],\n        crypto: [SECIO]\n      },\n      discovery: [wrtcstar.discovery, wsstar.discovery]\n    }\n\n    if (options.bootstrap) {\n      const r = new Railing(options.bootstrap)\n      modules.discovery.push(r)\n    }\n\n    if (options.modules && options.modules.transport) {\n      options.modules.transport.forEach((t) => modules.transport.push(t))\n    }\n\n    if (options.modules && options.modules.discovery) {\n      options.modules.discovery.forEach((d) => modules.discovery.push(d))\n    }\n\n    super(modules, peerInfo, peerBook, options)\n  }\n}\n\nmodule.exports = Node\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/runtime/libp2p-browser.js\n// module id = 757\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/runtime/libp2p-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst IPFSRepo = __webpack_require__(267)\n\nmodule.exports = (dir) => {\n  const repoPath = dir || 'ipfs'\n  return new IPFSRepo(repoPath)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/runtime/repo-browser.js\n// module id = 758\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/runtime/repo-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst log = debug('jsipfs:state')\nlog.error = debug('jsipfs:state:error')\n\nconst fsm = __webpack_require__(865)\n\nmodule.exports = (self) => {\n  const s = fsm('uninitalized', {\n    uninitalized: {\n      init: 'initializing',\n      initialized: 'stopped'\n    },\n    initializing: {\n      initialized: 'stopped'\n    },\n    stopped: {\n      start: 'starting'\n    },\n    starting: {\n      started: 'running'\n    },\n    running: {\n      stop: 'stopping'\n    },\n    stopping: {\n      stopped: 'stopped'\n    }\n  })\n\n  // log events\n  s.on('error', (err) => log.error(err))\n  s.on('done', () => log('-> ' + s._state))\n\n  // -- Actions\n\n  s.init = () => {\n    s('init')\n  }\n\n  s.initialized = () => {\n    s('initialized')\n  }\n\n  s.stop = () => {\n    s('stop')\n  }\n\n  s.stopped = () => {\n    s('stopped')\n  }\n\n  s.start = () => {\n    s('start')\n  }\n\n  s.started = () => {\n    s('started')\n  }\n\n  s.state = () => s._state\n\n  return s\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/ipfs/src/core/state.js\n// module id = 759\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/ipfs/src/core/state.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (node) => {\n  return {\n    findProviders: (key, timeout, callback) => {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.findProviders(key, timeout, callback)\n    },\n    provide: (key, callback) => {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.provide(key, callback)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/content-routing.js\n// module id = 760\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/content-routing.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (node) => {\n  return {\n    put: (key, value, callback) => {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.put(key, value, callback)\n    },\n    get: (key, callback) => {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.get(key, callback)\n    },\n    getMany (key, nVals, callback) {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.getMany(key, nVals, callback)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/dht.js\n// module id = 761\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/dht.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.NOT_STARTED_YET = 'The libp2p node is not started yet'\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/error-messages.js\n// module id = 762\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/error-messages.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst multiaddr = __webpack_require__(21)\n\nmodule.exports = (node) => {\n  /*\n   * Helper method to check the data type of peer and convert it to PeerInfo\n   */\n  return function (peer, callback) {\n    let p\n    // PeerInfo\n    if (PeerInfo.isPeerInfo(peer)) {\n      p = peer\n    // Multiaddr instance or Multiaddr String\n    } else if (multiaddr.isMultiaddr(peer) || typeof peer === 'string') {\n      if (typeof peer === 'string') {\n        peer = multiaddr(peer)\n      }\n\n      const peerIdB58Str = peer.getPeerId()\n      if (!peerIdB58Str) {\n        throw new Error(`peer multiaddr instance or string must include peerId`)\n      }\n\n      try {\n        p = node.peerBook.get(peerIdB58Str)\n      } catch (err) {\n        p = new PeerInfo(PeerId.createFromB58String(peerIdB58Str))\n      }\n      p.multiaddrs.add(peer)\n\n      // PeerId\n    } else if (PeerId.isPeerId(peer)) {\n      const peerIdB58Str = peer.toB58String()\n      try {\n        p = node.peerBook.get(peerIdB58Str)\n      } catch (err) {\n        return node.peerRouting.findPeer(peer, callback)\n      }\n    } else {\n      return setImmediate(() => callback(new Error('peer type not recognized')))\n    }\n\n    callback(null, p)\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/get-peer-info.js\n// module id = 763\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/get-peer-info.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15).EventEmitter\nconst assert = __webpack_require__(16)\n\nconst setImmediate = __webpack_require__(8)\nconst each = __webpack_require__(41)\nconst series = __webpack_require__(51)\n\nconst PeerBook = __webpack_require__(505)\nconst Switch = __webpack_require__(1025)\nconst Ping = __webpack_require__(1011)\n\nconst peerRouting = __webpack_require__(765)\nconst contentRouting = __webpack_require__(760)\nconst dht = __webpack_require__(761)\nconst pubsub = __webpack_require__(766)\nconst getPeerInfo = __webpack_require__(763)\n\nexports = module.exports\n\nconst NOT_STARTED_ERROR_MESSAGE = 'The libp2p node is not started yet'\n\nclass Node extends EventEmitter {\n  constructor (_modules, _peerInfo, _peerBook, _options) {\n    super()\n    assert(_modules, 'requires modules to equip libp2p with features')\n    assert(_peerInfo, 'requires a PeerInfo instance')\n\n    this.modules = _modules\n    this.peerInfo = _peerInfo\n    this.peerBook = _peerBook || new PeerBook()\n    _options = _options || {}\n\n    this._isStarted = false\n\n    this.switch = new Switch(this.peerInfo, this.peerBook)\n\n    // Attach stream multiplexers\n    if (this.modules.connection && this.modules.connection.muxer) {\n      let muxers = this.modules.connection.muxer\n      muxers = Array.isArray(muxers) ? muxers : [muxers]\n      muxers.forEach((muxer) => this.switch.connection.addStreamMuxer(muxer))\n\n      // If muxer exists, we can use Identify\n      this.switch.connection.reuse()\n\n      // If muxer exists, we can use Relay for listening/dialing\n      this.switch.connection.enableCircuitRelay(_options.relay)\n\n      // Received incommind dial and muxer upgrade happened,\n      // reuse this muxed connection\n      this.switch.on('peer-mux-established', (peerInfo) => {\n        this.emit('peer:connect', peerInfo)\n        this.peerBook.put(peerInfo)\n      })\n\n      this.switch.on('peer-mux-closed', (peerInfo) => {\n        this.emit('peer:disconnect', peerInfo)\n      })\n    }\n\n    // Attach crypto channels\n    if (this.modules.connection && this.modules.connection.crypto) {\n      let cryptos = this.modules.connection.crypto\n      cryptos = Array.isArray(cryptos) ? cryptos : [cryptos]\n      cryptos.forEach((crypto) => {\n        this.switch.connection.crypto(crypto.tag, crypto.encrypt)\n      })\n    }\n\n    // Attach discovery mechanisms\n    if (this.modules.discovery) {\n      let discoveries = this.modules.discovery\n      discoveries = Array.isArray(discoveries) ? discoveries : [discoveries]\n\n      discoveries.forEach((discovery) => {\n        discovery.on('peer', (peerInfo) => this.emit('peer:discovery', peerInfo))\n      })\n    }\n\n    // dht provided components (peerRouting, contentRouting, dht)\n    if (_modules.DHT) {\n      this._dht = new this.modules.DHT(this.switch, {\n        kBucketSize: 20,\n        datastore: _options.DHT && _options.DHT.datastore\n      })\n    }\n\n    this.peerRouting = peerRouting(this)\n    this.contentRouting = contentRouting(this)\n    this.dht = dht(this)\n    this.pubsub = pubsub(this)\n\n    this._getPeerInfo = getPeerInfo(this)\n\n    // Mount default protocols\n    Ping.mount(this.switch)\n  }\n\n  /*\n   * Start the libp2p node\n   *   - create listeners on the multiaddrs the Peer wants to listen\n   */\n  start (callback) {\n    if (!this.modules.transport) {\n      return callback(new Error('no transports were present'))\n    }\n\n    let ws\n    let transports = this.modules.transport\n\n    transports = Array.isArray(transports) ? transports : [transports]\n\n    // so that we can have webrtc-star addrs without adding manually the id\n    const maOld = []\n    const maNew = []\n    this.peerInfo.multiaddrs.toArray().forEach((ma) => {\n      if (!ma.getPeerId()) {\n        maOld.push(ma)\n        maNew.push(ma.encapsulate('/ipfs/' + this.peerInfo.id.toB58String()))\n      }\n    })\n    this.peerInfo.multiaddrs.replace(maOld, maNew)\n\n    const multiaddrs = this.peerInfo.multiaddrs.toArray()\n    transports.forEach((transport) => {\n      if (transport.filter(multiaddrs).length > 0) {\n        this.switch.transport.add(\n          transport.tag || transport.constructor.name, transport)\n      } else if (transport.constructor &&\n                 transport.constructor.name === 'WebSockets') {\n        // TODO find a cleaner way to signal that a transport is always\n        // used for dialing, even if no listener\n        ws = transport\n      }\n    })\n\n    series([\n      (cb) => this.switch.start(cb),\n      (cb) => {\n        if (ws) {\n          // always add dialing on websockets\n          this.switch.transport.add(ws.tag || ws.constructor.name, ws)\n        }\n\n        // all transports need to be setup before discover starts\n        if (this.modules.discovery) {\n          return each(this.modules.discovery, (d, cb) => d.start(cb), cb)\n        }\n        cb()\n      },\n      (cb) => {\n        // TODO: chicken-and-egg problem #1:\n        // have to set started here because DHT requires libp2p is already started\n        this._isStarted = true\n        if (this._dht) {\n          this._dht.start(cb)\n        } else {\n          cb()\n        }\n      },\n      (cb) => {\n        // TODO: chicken-and-egg problem #2:\n        // have to set started here because FloodSub requires libp2p is already started\n        if (this._options !== false) {\n          this._floodSub.start(cb)\n        } else {\n          cb()\n        }\n      },\n\n      (cb) => {\n        // detect which multiaddrs we don't have a transport for and remove them\n        const multiaddrs = this.peerInfo.multiaddrs.toArray()\n\n        transports.forEach((transport) => {\n          multiaddrs.forEach((multiaddr) => {\n            if (!multiaddr.toString().match(/\\/p2p-circuit($|\\/)/) &&\n                !transports.find((transport) => transport.filter(multiaddr).length > 0)) {\n              this.peerInfo.multiaddrs.delete(multiaddr)\n            }\n          })\n        })\n        cb()\n      },\n      (cb) => {\n        this.emit('start')\n        cb()\n      }\n    ], callback)\n  }\n\n  /*\n   * Stop the libp2p node by closing its listeners and open connections\n   */\n  stop (callback) {\n    if (this.modules.discovery) {\n      this.modules.discovery.forEach((discovery) => {\n        setImmediate(() => discovery.stop(() => {}))\n      })\n    }\n\n    series([\n      (cb) => {\n        if (this._floodSub.started) {\n          this._floodSub.stop(cb)\n        }\n      },\n      (cb) => {\n        if (this._dht) {\n          return this._dht.stop(cb)\n        }\n        cb()\n      },\n      (cb) => this.switch.stop(cb),\n      (cb) => {\n        this.emit('stop')\n        cb()\n      }\n    ], (err) => {\n      this._isStarted = false\n      callback(err)\n    })\n  }\n\n  isStarted () {\n    return this._isStarted\n  }\n\n  dial (peer, callback) {\n    assert(this.isStarted(), NOT_STARTED_ERROR_MESSAGE)\n\n    this._getPeerInfo(peer, (err, peerInfo) => {\n      if (err) { return callback(err) }\n\n      this.switch.dial(peerInfo, (err) => {\n        if (err) { return callback(err) }\n\n        this.peerBook.put(peerInfo)\n        callback()\n      })\n    })\n  }\n\n  dialProtocol (peer, protocol, callback) {\n    assert(this.isStarted(), NOT_STARTED_ERROR_MESSAGE)\n\n    if (typeof protocol === 'function') {\n      callback = protocol\n      protocol = undefined\n    }\n\n    this._getPeerInfo(peer, (err, peerInfo) => {\n      if (err) { return callback(err) }\n\n      this.switch.dial(peerInfo, protocol, (err, conn) => {\n        if (err) { return callback(err) }\n        this.peerBook.put(peerInfo)\n        callback(null, conn)\n      })\n    })\n  }\n\n  hangUp (peer, callback) {\n    assert(this.isStarted(), NOT_STARTED_ERROR_MESSAGE)\n\n    this._getPeerInfo(peer, (err, peerInfo) => {\n      if (err) { return callback(err) }\n\n      this.switch.hangUp(peerInfo, callback)\n    })\n  }\n\n  ping (peer, callback) {\n    assert(this.isStarted(), NOT_STARTED_ERROR_MESSAGE)\n    this._getPeerInfo(peer, (err, peerInfo) => {\n      if (err) { return callback(err) }\n\n      callback(null, new Ping(this.switch, peerInfo))\n    })\n  }\n\n  handle (protocol, handlerFunc, matchFunc) {\n    this.switch.handle(protocol, handlerFunc, matchFunc)\n  }\n\n  unhandle (protocol) {\n    this.switch.unhandle(protocol)\n  }\n}\n\nmodule.exports = Node\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/index.js\n// module id = 764\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = (node) => {\n  return {\n    findPeer: (id, callback) => {\n      if (!node._dht) {\n        return callback(new Error('DHT is not available'))\n      }\n\n      node._dht.findPeer(id, callback)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/peer-routing.js\n// module id = 765\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/peer-routing.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst setImmediate = __webpack_require__(8)\nconst NOT_STARTED_YET = __webpack_require__(762).NOT_STARTED_YET\nconst FloodSub = __webpack_require__(996)\n\nmodule.exports = (node) => {\n  const floodSub = new FloodSub(node)\n\n  node._floodSub = floodSub\n\n  return {\n    subscribe: (topic, options, handler, callback) => {\n      if (typeof options === 'function') {\n        callback = handler\n        handler = options\n        options = {}\n      }\n\n      if (!node.isStarted() && !floodSub.started) {\n        return setImmediate(() => callback(new Error(NOT_STARTED_YET)))\n      }\n\n      function subscribe (cb) {\n        if (floodSub.listenerCount(topic) === 0) {\n          floodSub.subscribe(topic)\n        }\n\n        floodSub.on(topic, handler)\n        setImmediate(cb)\n      }\n\n      subscribe(callback)\n    },\n\n    unsubscribe: (topic, handler) => {\n      if (!node.isStarted() && !floodSub.started) {\n        throw new Error(NOT_STARTED_YET)\n      }\n\n      floodSub.removeListener(topic, handler)\n\n      if (floodSub.listenerCount(topic) === 0) {\n        floodSub.unsubscribe(topic)\n      }\n    },\n\n    publish: (topic, data, callback) => {\n      if (!node.isStarted() && !floodSub.started) {\n        return setImmediate(() => callback(new Error(NOT_STARTED_YET)))\n      }\n\n      if (!Buffer.isBuffer(data)) {\n        return setImmediate(() => callback(new Error('data must be a Buffer')))\n      }\n\n      floodSub.publish(topic, data)\n\n      setImmediate(() => callback())\n    },\n\n    ls: (callback) => {\n      if (!node.isStarted() && !floodSub.started) {\n        return setImmediate(() => callback(new Error(NOT_STARTED_YET)))\n      }\n\n      const subscriptions = Array.from(floodSub.subscriptions)\n\n      setImmediate(() => callback(null, subscriptions))\n    },\n\n    peers: (topic, callback) => {\n      if (!node.isStarted() && !floodSub.started) {\n        return setImmediate(() => callback(new Error(NOT_STARTED_YET)))\n      }\n\n      if (typeof topic === 'function') {\n        callback = topic\n        topic = null\n      }\n\n      const peers = Array.from(floodSub.peers.values())\n        .filter((peer) => topic ? peer.topics.has(topic) : true)\n        .map((peer) => peer.info.id.toB58String())\n\n      setImmediate(() => callback(null, peers))\n    },\n\n    setMaxListeners (n) {\n      return floodSub.setMaxListeners(n)\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/libp2p/src/pubsub.js\n// module id = 766\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/libp2p/src/pubsub.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\nvar rng;\n\nif (global.crypto && crypto.getRandomValues) {\n  // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n  // Moderately fast, high quality\n  var _rnds8 = new Uint8Array(16);\n  rng = function whatwgRNG() {\n    crypto.getRandomValues(_rnds8);\n    return _rnds8;\n  };\n}\n\nif (!rng) {\n  // Math.random()-based (RNG)\n  //\n  // If all else fails, use Math.random().  It's fast, but is of unspecified\n  // quality.\n  var  _rnds = new Array(16);\n  rng = function() {\n    for (var i = 0, r; i < 16; i++) {\n      if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n      _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n    }\n\n    return _rnds;\n  };\n}\n\nmodule.exports = rng;\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/uuid/rng-browser.js\n// module id = 767\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/uuid/rng-browser.js")},function(module,exports,__webpack_require__){eval("//     uuid.js\n//\n//     Copyright (c) 2010-2012 Robert Kieffer\n//     MIT License - http://opensource.org/licenses/mit-license.php\n\n// Unique ID creation requires a high quality random # generator.  We feature\n// detect to determine the best RNG source, normalizing to a function that\n// returns 128-bits of randomness, since that's what's usually required\nvar _rng = __webpack_require__(767);\n\n// Maps for number <-> hex string conversion\nvar _byteToHex = [];\nvar _hexToByte = {};\nfor (var i = 0; i < 256; i++) {\n  _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n  _hexToByte[_byteToHex[i]] = i;\n}\n\n// **`parse()` - Parse a UUID into it's component bytes**\nfunction parse(s, buf, offset) {\n  var i = (buf && offset) || 0, ii = 0;\n\n  buf = buf || [];\n  s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {\n    if (ii < 16) { // Don't overflow!\n      buf[i + ii++] = _hexToByte[oct];\n    }\n  });\n\n  // Zero out remaining bytes if string was short\n  while (ii < 16) {\n    buf[i + ii++] = 0;\n  }\n\n  return buf;\n}\n\n// **`unparse()` - Convert UUID byte array (ala parse()) into a string**\nfunction unparse(buf, offset) {\n  var i = offset || 0, bth = _byteToHex;\n  return  bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]];\n}\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\n// random #'s we need to init node and clockseq\nvar _seedBytes = _rng();\n\n// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\nvar _nodeId = [\n  _seedBytes[0] | 0x01,\n  _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\n];\n\n// Per 4.2.2, randomize (14 bit) clockseq\nvar _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\n\n// Previous uuid creation time\nvar _lastMSecs = 0, _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n  var i = buf && offset || 0;\n  var b = buf || [];\n\n  options = options || {};\n\n  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n  // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n  // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so\n  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n  // Per 4.2.1.2, use count of uuid's generated during the current clock\n  // cycle to simulate higher resolution clock\n  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n  // Time since last uuid creation (in msecs)\n  var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n  // Per 4.2.1.2, Bump clockseq on clock regression\n  if (dt < 0 && options.clockseq === undefined) {\n    clockseq = clockseq + 1 & 0x3fff;\n  }\n\n  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n  // time interval\n  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n    nsecs = 0;\n  }\n\n  // Per 4.2.1.2 Throw error if too many uuids are requested\n  if (nsecs >= 10000) {\n    throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n  }\n\n  _lastMSecs = msecs;\n  _lastNSecs = nsecs;\n  _clockseq = clockseq;\n\n  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n  msecs += 12219292800000;\n\n  // `time_low`\n  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n  b[i++] = tl >>> 24 & 0xff;\n  b[i++] = tl >>> 16 & 0xff;\n  b[i++] = tl >>> 8 & 0xff;\n  b[i++] = tl & 0xff;\n\n  // `time_mid`\n  var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n  b[i++] = tmh >>> 8 & 0xff;\n  b[i++] = tmh & 0xff;\n\n  // `time_high_and_version`\n  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n  b[i++] = tmh >>> 16 & 0xff;\n\n  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n  b[i++] = clockseq >>> 8 | 0x80;\n\n  // `clock_seq_low`\n  b[i++] = clockseq & 0xff;\n\n  // `node`\n  var node = options.node || _nodeId;\n  for (var n = 0; n < 6; n++) {\n    b[i + n] = node[n];\n  }\n\n  return buf ? buf : unparse(b);\n}\n\n// **`v4()` - Generate random UUID**\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v4(options, buf, offset) {\n  // Deprecated - 'format' argument, as supported in v1.2\n  var i = buf && offset || 0;\n\n  if (typeof(options) == 'string') {\n    buf = options == 'binary' ? new Array(16) : null;\n    options = null;\n  }\n  options = options || {};\n\n  var rnds = options.random || (options.rng || _rng)();\n\n  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n  rnds[6] = (rnds[6] & 0x0f) | 0x40;\n  rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n  // Copy bytes to buffer, if provided\n  if (buf) {\n    for (var ii = 0; ii < 16; ii++) {\n      buf[i + ii] = rnds[ii];\n    }\n  }\n\n  return buf || unparse(rnds);\n}\n\n// Export public API\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\nuuid.parse = parse;\nuuid.unparse = unparse;\n\nmodule.exports = uuid;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/uuid/uuid.js\n// module id = 768\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/uuid/uuid.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar swarm = __webpack_require__(544);\n\n\nvar Bzz = function Bzz(provider) {\n\n    this.givenProvider = Bzz.givenProvider;\n\n    if (provider && provider._requestManager) {\n        provider = provider.currentProvider;\n    }\n\n    // only allow file picker when in browser\n    if(typeof document !== 'undefined') {\n        this.pick = swarm.pick;\n    }\n\n    this.setProvider(provider);\n};\n\n// set default ethereum provider\n/* jshint ignore:start */\nBzz.givenProvider = null;\nif(typeof ethereumProvider !== 'undefined' && ethereumProvider.bzz) {\n    Bzz.givenProvider = ethereumProvider.bzz;\n}\n/* jshint ignore:end */\n\nBzz.prototype.setProvider = function(provider) {\n    // is ethereum provider\n    if(_.isObject(provider) && _.isString(provider.bzz)) {\n        provider = provider.bzz;\n    // is no string, set default\n    }\n    // else if(!_.isString(provider)) {\n    //      provider = 'http://swarm-gateways.net'; // default to gateway\n    // }\n\n\n    if(_.isString(provider)) {\n        this.currentProvider = provider;\n    } else {\n        this.currentProvider = null;\n\n        var noProviderError = new Error('No provider set, please set one using bzz.setProvider().');\n\n        this.download = this.upload = this.isAvailable = function(){\n            throw noProviderError;\n        };\n\n        return false;\n    }\n\n    // add functions\n    this.download = swarm.at(provider).download;\n    this.upload = swarm.at(provider).upload;\n    this.isAvailable = swarm.at(provider).isAvailable;\n\n    return true;\n};\n\n\nmodule.exports = Bzz;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-bzz/src/index.js\n// module id = 769\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-bzz/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file errors.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\nmodule.exports = {\n    ErrorResponse: function (result) {\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : JSON.stringify(result);\n        return new Error('Returned error: ' + message);\n    },\n    InvalidNumberOfParams: function (got, expected, method) {\n        return new Error('Invalid number of parameters for \"'+ method +'\". Got '+ got +' expected '+ expected +'!');\n    },\n    InvalidConnection: function (host){\n        return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +'.');\n    },\n    InvalidProvider: function () {\n        return new Error('Provider not set or invalid');\n    },\n    InvalidResponse: function (result){\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response: ' + JSON.stringify(result);\n        return new Error(message);\n    },\n    ConnectionTimeout: function (ms){\n        return new Error('CONNECTION TIMEOUT: timeout of ' + ms + ' ms achived');\n    }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-helpers/src/errors.js\n// module id = 770\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-helpers/src/errors.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file formatters.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(48);\nvar Iban = __webpack_require__(390);\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber} number\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n    return utils.toBN(number).toString(10);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n    return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n    if (this && (blockNumber === undefined || blockNumber === null)) {\n        return this.defaultBlock;\n    }\n    if (blockNumber === 'genesis' || blockNumber === 'earliest') {\n        return '0x0';\n    }\n    return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n    if (blockNumber === undefined) {\n        return undefined;\n    } else if (isPredefinedBlockNumber(blockNumber)) {\n        return blockNumber;\n    }\n    return (utils.isHexStrict(blockNumber)) ? ((_.isString(blockNumber)) ? blockNumber.toLowerCase() : blockNumber) : utils.numberToHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method _txInputFormatter\n * @param {Object} transaction options\n * @returns object\n */\nvar _txInputFormatter = function (options){\n\n    if (options.to) { // it might be contract creation\n        options.to = inputAddressFormatter(options.to);\n    }\n\n    if (options.data && options.input) {\n        throw new Error('You can\\'t have \"data\" and \"input\" as properties of transactions at the same time, please use either \"data\" or \"input\" instead.');\n    }\n\n    if (!options.data && options.input) {\n        options.data = options.input;\n        delete options.input;\n    }\n\n    if(options.data && !utils.isHex(options.data)) {\n        throw new Error('The data field must be HEX encoded data.');\n    }\n\n    // allow both\n    if (options.gas || options.gasLimit) {\n        options.gas = options.gas || options.gasLimit;\n    }\n\n    ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n        return options[key] !== undefined;\n    }).forEach(function(key){\n        options[key] = utils.numberToHex(options[key]);\n    });\n\n    return options;\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputCallFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputCallFormatter = function (options){\n\n    options = _txInputFormatter(options);\n\n    var from = options.from || (this ? this.defaultAccount : null);\n\n    if (from) {\n        options.from = inputAddressFormatter(from);\n    }\n\n\n    return options;\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options) {\n\n    options = _txInputFormatter(options);\n\n    // check from, only if not number, or object\n    if (!_.isNumber(options.from) && !_.isObject(options.from)) {\n        options.from = options.from || (this ? this.defaultAccount : null);\n\n        if (!options.from && !_.isNumber(options.from)) {\n            throw new Error('The send transactions \"from\" field must be defined!');\n        }\n\n        options.from = inputAddressFormatter(options.from);\n    }\n\n    return options;\n};\n\n/**\n * Hex encodes the data passed to eth_sign and personal_sign\n *\n * @method inputSignFormatter\n * @param {String} data\n * @returns {String}\n */\nvar inputSignFormatter = function (data) {\n    return (utils.isHexStrict(data)) ? data : utils.utf8ToHex(data);\n};\n\n/**\n * Formats the output of a transaction to its proper values\n *\n * @method outputTransactionFormatter\n * @param {Object} tx\n * @returns {Object}\n*/\nvar outputTransactionFormatter = function (tx){\n    if(tx.blockNumber !== null)\n        tx.blockNumber = utils.hexToNumber(tx.blockNumber);\n    if(tx.transactionIndex !== null)\n        tx.transactionIndex = utils.hexToNumber(tx.transactionIndex);\n    tx.nonce = utils.hexToNumber(tx.nonce);\n    tx.gas = utils.hexToNumber(tx.gas);\n    tx.gasPrice = outputBigNumberFormatter(tx.gasPrice);\n    tx.value = outputBigNumberFormatter(tx.value);\n\n    if(tx.to && utils.isAddress(tx.to)) { // tx.to could be `0x0` or `null` while contract creation\n        tx.to = utils.toChecksumAddress(tx.to);\n    } else {\n        tx.to = null; // set to `null` if invalid address\n    }\n\n    if(tx.from) {\n        tx.from = utils.toChecksumAddress(tx.from);\n    }\n\n    return tx;\n};\n\n/**\n * Formats the output of a transaction receipt to its proper values\n *\n * @method outputTransactionReceiptFormatter\n * @param {Object} receipt\n * @returns {Object}\n*/\nvar outputTransactionReceiptFormatter = function (receipt){\n    if(typeof receipt !== 'object') {\n        throw new Error('Received receipt is invalid: '+ receipt);\n    }\n\n    if(receipt.blockNumber !== null)\n        receipt.blockNumber = utils.hexToNumber(receipt.blockNumber);\n    if(receipt.transactionIndex !== null)\n        receipt.transactionIndex = utils.hexToNumber(receipt.transactionIndex);\n    receipt.cumulativeGasUsed = utils.hexToNumber(receipt.cumulativeGasUsed);\n    receipt.gasUsed = utils.hexToNumber(receipt.gasUsed);\n\n    if(_.isArray(receipt.logs)) {\n        receipt.logs = receipt.logs.map(outputLogFormatter);\n    }\n\n    if(receipt.contractAddress) {\n        receipt.contractAddress = utils.toChecksumAddress(receipt.contractAddress);\n    }\n\n    if(typeof receipt.status !== 'undefined') {\n        receipt.status = Boolean(parseInt(receipt.status));\n    }\n\n    return receipt;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block\n * @returns {Object}\n*/\nvar outputBlockFormatter = function(block) {\n\n    // transform to number\n    block.gasLimit = utils.hexToNumber(block.gasLimit);\n    block.gasUsed = utils.hexToNumber(block.gasUsed);\n    block.size = utils.hexToNumber(block.size);\n    block.timestamp = utils.hexToNumber(block.timestamp);\n    if (block.number !== null)\n        block.number = utils.hexToNumber(block.number);\n\n    if(block.difficulty)\n        block.difficulty = outputBigNumberFormatter(block.difficulty);\n    if(block.totalDifficulty)\n        block.totalDifficulty = outputBigNumberFormatter(block.totalDifficulty);\n\n    if (_.isArray(block.transactions)) {\n        block.transactions.forEach(function(item){\n            if(!_.isString(item))\n                return outputTransactionFormatter(item);\n        });\n    }\n\n    if (block.miner)\n        block.miner = utils.toChecksumAddress(block.miner);\n\n    return block;\n};\n\n/**\n * Formats the input of a log\n *\n * @method inputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar inputLogFormatter = function(options) {\n    var toTopic = function(value){\n\n        if(value === null || typeof value === 'undefined')\n            return null;\n\n        value = String(value);\n\n        if(value.indexOf('0x') === 0)\n            return value;\n        else\n            return utils.fromUtf8(value);\n    };\n\n    // make sure topics, get converted to hex\n    options.topics = options.topics || [];\n    options.topics = options.topics.map(function(topic){\n        return (_.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n    });\n\n    toTopic = null;\n\n    if (options.address) {\n        options.address = (_.isArray(options.address)) ? options.address.map(function (addr) {\n            return inputAddressFormatter(addr);\n        }) : inputAddressFormatter(options.address);\n    }\n\n    return options;\n};\n\n/**\n * Formats the output of a log\n *\n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n\n    // generate a custom log id\n    if(typeof log.blockHash === 'string' &&\n       typeof log.transactionHash === 'string' &&\n       typeof log.logIndex === 'string') {\n        var shaId = utils.sha3(log.blockHash.replace('0x','') + log.transactionHash.replace('0x','') + log.logIndex.replace('0x',''));\n        log.id = 'log_'+ shaId.replace('0x','').substr(0,8);\n    } else if(!log.id) {\n        log.id = null;\n    }\n\n    if (log.blockNumber !== null)\n        log.blockNumber = utils.hexToNumber(log.blockNumber);\n    if (log.transactionIndex !== null)\n        log.transactionIndex = utils.hexToNumber(log.transactionIndex);\n    if (log.logIndex !== null)\n        log.logIndex = utils.hexToNumber(log.logIndex);\n\n    if (log.address) {\n        log.address = utils.toChecksumAddress(log.address);\n    }\n\n    return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n    // post.payload = utils.toHex(post.payload);\n\n    if (post.ttl)\n        post.ttl = utils.numberToHex(post.ttl);\n    if (post.workToProve)\n        post.workToProve = utils.numberToHex(post.workToProve);\n    if (post.priority)\n        post.priority = utils.numberToHex(post.priority);\n\n    // fallback\n    if (!_.isArray(post.topics)) {\n        post.topics = post.topics ? [post.topics] : [];\n    }\n\n    // format the following options\n    post.topics = post.topics.map(function(topic){\n        // convert only if not hex\n        return (topic.indexOf('0x') === 0) ? topic : utils.fromUtf8(topic);\n    });\n\n    return post;\n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n    post.expiry = utils.hexToNumber(post.expiry);\n    post.sent = utils.hexToNumber(post.sent);\n    post.ttl = utils.hexToNumber(post.ttl);\n    post.workProved = utils.hexToNumber(post.workProved);\n    // post.payloadRaw = post.payload;\n    // post.payload = utils.hexToAscii(post.payload);\n\n    // if (utils.isJson(post.payload)) {\n    //     post.payload = JSON.parse(post.payload);\n    // }\n\n    // format the following options\n    if (!post.topics) {\n        post.topics = [];\n    }\n    post.topics = post.topics.map(function(topic){\n        return utils.toUtf8(topic);\n    });\n\n    return post;\n};\n\nvar inputAddressFormatter = function (address) {\n    var iban = new Iban(address);\n    if (iban.isValid() && iban.isDirect()) {\n        return iban.toAddress().toLowerCase();\n    } else if (utils.isAddress(address)) {\n        return '0x' + address.toLowerCase().replace('0x','');\n    }\n    throw new Error('Provided address \"'+ address +'\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can\\'t be converted.');\n};\n\n\nvar outputSyncingFormatter = function(result) {\n\n    result.startingBlock = utils.hexToNumber(result.startingBlock);\n    result.currentBlock = utils.hexToNumber(result.currentBlock);\n    result.highestBlock = utils.hexToNumber(result.highestBlock);\n    if (result.knownStates) {\n        result.knownStates = utils.hexToNumber(result.knownStates);\n        result.pulledStates = utils.hexToNumber(result.pulledStates);\n    }\n\n    return result;\n};\n\nmodule.exports = {\n    inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n    inputBlockNumberFormatter: inputBlockNumberFormatter,\n    inputCallFormatter: inputCallFormatter,\n    inputTransactionFormatter: inputTransactionFormatter,\n    inputAddressFormatter: inputAddressFormatter,\n    inputPostFormatter: inputPostFormatter,\n    inputLogFormatter: inputLogFormatter,\n    inputSignFormatter: inputSignFormatter,\n    outputBigNumberFormatter: outputBigNumberFormatter,\n    outputTransactionFormatter: outputTransactionFormatter,\n    outputTransactionReceiptFormatter: outputTransactionReceiptFormatter,\n    outputBlockFormatter: outputBlockFormatter,\n    outputLogFormatter: outputLogFormatter,\n    outputPostFormatter: outputPostFormatter,\n    outputSyncingFormatter: outputSyncingFormatter\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-helpers/src/formatters.js\n// module id = 771\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-helpers/src/formatters.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file batch.js\n * @author Marek Kotewicz <marek@ethdev.com>\n * @date 2015\n */\n\n\n\nvar Jsonrpc = __webpack_require__(384);\nvar errors = __webpack_require__(34).errors;\n\nvar Batch = function (requestManager) {\n    this.requestManager = requestManager;\n    this.requests = [];\n};\n\n/**\n * Should be called to add create new request to batch request\n *\n * @method add\n * @param {Object} jsonrpc requet object\n */\nBatch.prototype.add = function (request) {\n    this.requests.push(request);\n};\n\n/**\n * Should be called to execute batch request\n *\n * @method execute\n */\nBatch.prototype.execute = function () {\n    var requests = this.requests;\n    this.requestManager.sendBatch(requests, function (err, results) {\n        results = results || [];\n        requests.map(function (request, index) {\n            return results[index] || {};\n        }).forEach(function (result, index) {\n            if (requests[index].callback) {\n\n                if (result && result.error) {\n                    return requests[index].callback(errors.ErrorResponse(result));\n                }\n\n                if (!Jsonrpc.isValidResponse(result)) {\n                    return requests[index].callback(errors.InvalidResponse(result));\n                }\n\n                requests[index].callback(null, (requests[index].format ? requests[index].format(result.result) : result.result));\n            }\n        });\n    });\n};\n\nmodule.exports = Batch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-requestmanager/src/batch.js\n// module id = 772\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-requestmanager/src/batch.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file givenProvider.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar givenProvider = null;\n\n// ADD GIVEN PROVIDER\n/* jshint ignore:start */\nvar global = Function('return this')();\n\n// EthereumProvider\nif(typeof global.ethereumProvider !== 'undefined') {\n    givenProvider = global.ethereumProvider;\n\n// Legacy web3.currentProvider\n} else if(typeof global.web3 !== 'undefined' && global.web3.currentProvider) {\n\n    if(global.web3.currentProvider.sendAsync) {\n        global.web3.currentProvider.send = global.web3.currentProvider.sendAsync;\n        delete global.web3.currentProvider.sendAsync;\n    }\n\n    // if connection is 'ipcProviderWrapper', add subscription support\n    if(!global.web3.currentProvider.on &&\n        global.web3.currentProvider.connection &&\n        global.web3.currentProvider.connection.constructor.name === 'ipcProviderWrapper') {\n\n        global.web3.currentProvider.on = function (type, callback) {\n\n            if(typeof callback !== 'function')\n                throw new Error('The second parameter callback must be a function.');\n\n            switch(type){\n                case 'data':\n                    this.connection.on('data', function(data) {\n                        var result = '';\n\n                        data = data.toString();\n\n                        try {\n                            result = JSON.parse(data);\n                        } catch(e) {\n                            return callback(new Error('Couldn\\'t parse response data'+ data));\n                        }\n\n                        // notification\n                        if(!result.id && result.method.indexOf('_subscription') !== -1) {\n                            callback(null, result);\n                        }\n\n                    });\n                    break;\n\n                default:\n                    this.connection.on(type, callback);\n                    break;\n            }\n        };\n    }\n\n    givenProvider = global.web3.currentProvider;\n}\n/* jshint ignore:end */\n\n\nmodule.exports = givenProvider;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-requestmanager/src/givenProvider.js\n// module id = 773\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-requestmanager/src/givenProvider.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(34).errors;\nvar Jsonrpc = __webpack_require__(384);\nvar BatchManager = __webpack_require__(772);\nvar givenProvider = __webpack_require__(773);\n\n\n\n    /**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function RequestManager(provider) {\n    this.provider = null;\n    this.providers = RequestManager.providers;\n\n    this.setProvider(provider);\n    this.subscriptions = {};\n};\n\n\n\nRequestManager.givenProvider = givenProvider;\n\nRequestManager.providers = {\n    WebsocketProvider: __webpack_require__(792),\n    HttpProvider: __webpack_require__(790),\n    IpcProvider: __webpack_require__(791)\n};\n\n\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object} p\n */\nRequestManager.prototype.setProvider = function (p, net) {\n    var _this = this;\n\n    // autodetect provider\n    if(p && typeof p === 'string' && this.providers) {\n\n        // HTTP\n        if(/^http(s)?:\\/\\//i.test(p)) {\n            p = new this.providers.HttpProvider(p);\n\n            // WS\n        } else if(/^ws(s)?:\\/\\//i.test(p)) {\n            p = new this.providers.WebsocketProvider(p);\n\n            // IPC\n        } else if(p && typeof net === 'object'  && typeof net.connect === 'function') {\n            p = new this.providers.IpcProvider(p, net);\n\n        } else if(p) {\n            throw new Error('Can\\'t autodetect provider for \"'+ p +'\"');\n        }\n    }\n\n    // reset the old one before changing\n    if(this.provider)\n        this.clearSubscriptions();\n\n\n    this.provider = p || null;\n\n    // listen to incoming notifications\n    if(this.provider && this.provider.on) {\n        this.provider.on('data', function requestManagerNotification(result, deprecatedResult){\n            result = result || deprecatedResult; // this is for possible old providers, which may had the error first handler\n\n            // check for result.method, to prevent old providers errors to pass as result\n            if(result.method && _this.subscriptions[result.params.subscription] && _this.subscriptions[result.params.subscription].callback) {\n                _this.subscriptions[result.params.subscription].callback(null, result.params.result);\n            }\n        });\n        // TODO add error, end, timeout, connect??\n        // this.provider.on('error', function requestManagerNotification(result){\n        //     Object.keys(_this.subscriptions).forEach(function(id){\n        //         if(_this.subscriptions[id].callback)\n        //             _this.subscriptions[id].callback(err);\n        //     });\n        // }\n    }\n};\n\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.send = function (data, callback) {\n    callback = callback || function(){};\n\n    if (!this.provider) {\n        return callback(errors.InvalidProvider());\n    }\n\n    var payload = Jsonrpc.toPayload(data.method, data.params);\n    this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](payload, function (err, result) {\n        if(result && result.id && payload.id !== result.id) return callback(new Error('Wrong response id \"'+ result.id +'\" (expected: \"'+ payload.id +'\") in '+ JSON.stringify(payload)));\n\n        if (err) {\n            return callback(err);\n        }\n\n        if (result && result.error) {\n            return callback(errors.ErrorResponse(result));\n        }\n\n        if (!Jsonrpc.isValidResponse(result)) {\n            return callback(errors.InvalidResponse(result));\n        }\n\n        callback(null, result.result);\n    });\n};\n\n/**\n * Should be called to asynchronously send batch request\n *\n * @method sendBatch\n * @param {Array} batch data\n * @param {Function} callback\n */\nRequestManager.prototype.sendBatch = function (data, callback) {\n    if (!this.provider) {\n        return callback(errors.InvalidProvider());\n    }\n\n    var payload = Jsonrpc.toBatchPayload(data);\n    this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](payload, function (err, results) {\n        if (err) {\n            return callback(err);\n        }\n\n        if (!_.isArray(results)) {\n            return callback(errors.InvalidResponse(results));\n        }\n\n        callback(null, results);\n    });\n};\n\n\n/**\n * Waits for notifications\n *\n * @method addSubscription\n * @param {String} id           the subscription id\n * @param {String} name         the subscription name\n * @param {String} type         the subscription namespace (eth, personal, etc)\n * @param {Function} callback   the callback to call for incoming notifications\n */\nRequestManager.prototype.addSubscription = function (id, name, type, callback) {\n    if(this.provider.on) {\n        this.subscriptions[id] = {\n            callback: callback,\n            type: type,\n            name: name\n        };\n\n    } else {\n        throw new Error('The provider doesn\\'t support subscriptions: '+ this.provider.constructor.name);\n    }\n};\n\n/**\n * Waits for notifications\n *\n * @method removeSubscription\n * @param {String} id           the subscription id\n * @param {Function} callback   fired once the subscription is removed\n */\nRequestManager.prototype.removeSubscription = function (id, callback) {\n    var _this = this;\n\n    if(this.subscriptions[id]) {\n\n        this.send({\n            method: this.subscriptions[id].type + '_unsubscribe',\n            params: [id]\n        }, callback);\n\n        // remove subscription\n        delete _this.subscriptions[id];\n    }\n};\n\n/**\n * Should be called to reset the subscriptions\n *\n * @method reset\n */\nRequestManager.prototype.clearSubscriptions = function (keepIsSyncing) {\n    var _this = this;\n\n\n    // uninstall all subscriptions\n    Object.keys(this.subscriptions).forEach(function(id){\n        if(!keepIsSyncing || _this.subscriptions[id].name !== 'syncing')\n            _this.removeSubscription(id);\n    });\n\n\n    //  reset notification callbacks etc.\n    if(this.provider.reset)\n        this.provider.reset();\n};\n\nmodule.exports = {\n    Manager: RequestManager,\n    BatchManager: BatchManager\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-requestmanager/src/index.js\n// module id = 774\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-requestmanager/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file subscription.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(34).errors;\nvar EventEmitter = __webpack_require__(183);\n\n\nfunction Subscription(options) {\n    EventEmitter.call(this);\n\n    this.id = null;\n    this.callback = null;\n    this.arguments = null;\n    this._reconnectIntervalId = null;\n\n    this.options = {\n        subscription: options.subscription,\n        type: options.type,\n        requestManager: options.requestManager\n    };\n}\n\n// INHERIT\nSubscription.prototype = Object.create(EventEmitter.prototype);\nSubscription.prototype.constructor = Subscription;\n\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\n\nSubscription.prototype._extractCallback = function (args) {\n    if (_.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n *\n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\n\nSubscription.prototype._validateArgs = function (args) {\n    var subscription = this.options.subscription;\n\n    if(!subscription)\n        subscription = {};\n\n    if(!subscription.params)\n        subscription.params = 0;\n\n    if (args.length !== subscription.params) {\n        throw errors.InvalidNumberOfParams(args.length, subscription.params + 1, args[0]);\n    }\n};\n\n/**\n * Should be called to format input args of method\n *\n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\n\nSubscription.prototype._formatInput = function (args) {\n    var subscription = this.options.subscription;\n\n    if (!subscription) {\n        return args;\n    }\n\n    if (!subscription.inputFormatter) {\n        return args;\n    }\n\n    var formattedArgs = subscription.inputFormatter.map(function (formatter, index) {\n        return formatter ? formatter(args[index]) : args[index];\n    });\n\n    return formattedArgs;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\n\nSubscription.prototype._formatOutput = function (result) {\n    var subscription = this.options.subscription;\n\n    return (subscription && subscription.outputFormatter && result) ? subscription.outputFormatter(result) : result;\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nSubscription.prototype._toPayload = function (args) {\n    var params = [];\n    this.callback = this._extractCallback(args);\n\n    if (!this.subscriptionMethod) {\n        this.subscriptionMethod = args.shift();\n\n        // replace subscription with given name\n        if (this.options.subscription.subscriptionName) {\n            this.subscriptionMethod = this.options.subscription.subscriptionName;\n        }\n    }\n\n    if (!this.arguments) {\n        this.arguments = this._formatInput(args);\n        this._validateArgs(this.arguments);\n        args = []; // make empty after validation\n\n    }\n\n    // re-add subscriptionName\n    params.push(this.subscriptionMethod);\n    params = params.concat(this.arguments);\n\n\n    if (args.length) {\n        throw new Error('Only a callback is allowed as parameter on an already instantiated subscription.');\n    }\n\n    return {\n        method: this.options.type + '_subscribe',\n        params: params\n    };\n};\n\n/**\n * Unsubscribes and clears callbacks\n *\n * @method unsubscribe\n * @return {Object}\n */\nSubscription.prototype.unsubscribe = function(callback) {\n    this.options.requestManager.removeSubscription(this.id, callback);\n    this.id = null;\n    this.removeAllListeners();\n    clearInterval(this._reconnectIntervalId);\n};\n\n/**\n * Subscribes and watches for changes\n *\n * @method subscribe\n * @param {String} subscription the subscription\n * @param {Object} options the options object with address topics and fromBlock\n * @return {Object}\n */\nSubscription.prototype.subscribe = function() {\n    var _this = this;\n    var args = Array.prototype.slice.call(arguments);\n    var payload = this._toPayload(args);\n\n    if(!payload) {\n        return this;\n    }\n\n    if(!this.options.requestManager.provider) {\n        var err1 = new Error('No provider set.');\n        this.callback(err1, null, this);\n        this.emit('error', err1);\n        return this;\n    }\n\n    // throw error, if provider doesnt support subscriptions\n    if(!this.options.requestManager.provider.on) {\n        var err2 = new Error('The current provider doesn\\'t support subscriptions: '+ this.options.requestManager.provider.constructor.name);\n        this.callback(err2, null, this);\n        this.emit('error', err2);\n        return this;\n    }\n\n    // if id is there unsubscribe first\n    if (this.id) {\n        this.unsubscribe();\n    }\n\n    // store the params in the options object\n    this.options.params = payload.params[1];\n\n    // get past logs, if fromBlock is available\n    if(payload.params[0] === 'logs' && _.isObject(payload.params[1]) && payload.params[1].hasOwnProperty('fromBlock') && isFinite(payload.params[1].fromBlock)) {\n        // send the subscription request\n        this.options.requestManager.send({\n            method: 'eth_getLogs',\n            params: [payload.params[1]]\n        }, function (err, logs) {\n            if(!err) {\n                logs.forEach(function(log){\n                    var output = _this._formatOutput(log);\n                    _this.callback(null, output, _this);\n                    _this.emit('data', output);\n                });\n\n                // TODO subscribe here? after the past logs?\n\n            } else {\n                _this.callback(err, null, _this);\n                _this.emit('error', err);\n            }\n        });\n    }\n\n    // create subscription\n    // TODO move to separate function? so that past logs can go first?\n\n    if(typeof payload.params[1] === 'object')\n        delete payload.params[1].fromBlock;\n\n    this.options.requestManager.send(payload, function (err, result) {\n        if(!err && result) {\n            _this.id = result;\n\n            // call callback on notifications\n            _this.options.requestManager.addSubscription(_this.id, payload.params[0] , _this.options.type, function(err, result) {\n\n                if (!err) {\n                    if (!_.isArray(result)) {\n                        result = [result];\n                    }\n\n                    result.forEach(function(resultItem) {\n                        var output = _this._formatOutput(resultItem);\n\n                        if (_.isFunction(_this.options.subscription.subscriptionHandler)) {\n                            return _this.options.subscription.subscriptionHandler.call(_this, output);\n                        } else {\n                            _this.emit('data', output);\n                        }\n\n                        // call the callback, last so that unsubscribe there won't affect the emit above\n                        if (_.isFunction(_this.callback)) {\n                            _this.callback(null, output, _this);\n                        }\n                    });\n                } else {\n                    // unsubscribe, but keep listeners\n                    _this.options.requestManager.removeSubscription(_this.id);\n\n                    // re-subscribe, if connection fails\n                    if(_this.options.requestManager.provider.once) {\n                        _this._reconnectIntervalId = setInterval(function () {\n                            // TODO check if that makes sense!\n                            if (_this.options.requestManager.provider.reconnect) {\n                                _this.options.requestManager.provider.reconnect();\n                            }\n                        }, 500);\n\n                        _this.options.requestManager.provider.once('connect', function () {\n                            clearInterval(_this._reconnectIntervalId);\n                            _this.subscribe(_this.callback);\n                        });\n                    }\n                    _this.emit('error', err);\n\n                     // call the callback, last so that unsubscribe there won't affect the emit above\n                     if (_.isFunction(_this.callback)) {\n                        _this.callback(err, null, _this);\n                    }\n                }\n            });\n        } else if (_.isFunction(_this.callback)) {\n            _this.callback(err, null, _this);\n            _this.emit('error', err);\n        } else {\n            // emit the event even if no callback was provided\n            _this.emit('error', err);\n        }\n    });\n\n    // return an object to cancel the subscription\n    return this;\n};\n\nmodule.exports = Subscription;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core-subscriptions/src/subscription.js\n// module id = 775\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core-subscriptions/src/subscription.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file extend.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar formatters = __webpack_require__(34).formatters;\nvar Method = __webpack_require__(92);\nvar utils = __webpack_require__(48);\n\n\nvar extend = function (pckg) {\n    /* jshint maxcomplexity:5 */\n    var ex = function (extension) {\n\n        var extendedObject;\n        if (extension.property) {\n            if (!pckg[extension.property]) {\n                pckg[extension.property] = {};\n            }\n            extendedObject = pckg[extension.property];\n        } else {\n            extendedObject = pckg;\n        }\n\n        if (extension.methods) {\n            extension.methods.forEach(function (method) {\n                if(!(method instanceof Method)) {\n                    method = new Method(method);\n                }\n\n                method.attachToObject(extendedObject);\n                method.setRequestManager(pckg._requestManager);\n            });\n        }\n\n        return pckg;\n    };\n\n    ex.formatters = formatters;\n    ex.utils = utils;\n    ex.Method = Method;\n\n    return ex;\n};\n\n\n\nmodule.exports = extend;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-core/src/extend.js\n// module id = 776\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-core/src/extend.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar formatters = __webpack_require__(34).formatters;\nvar SolidityType = __webpack_require__(94);\n\n/**\n * SolidityTypeAddress is a protoype that represents address type\n * It matches:\n * address\n * address[]\n * address[4]\n * address[][]\n * address[3][]\n * address[][6][], ...\n */\nvar SolidityTypeAddress = function () {\n    this._inputFormatter = function(){\n        var args = Array.prototype.slice.call(arguments);\n        args[0] = (!args[0] || args[0] === '0x0') ? '' : formatters.inputAddressFormatter(args[0]);\n        return f.formatInputInt.apply(this, args);\n    };\n    this._outputFormatter = f.formatOutputAddress;\n};\n\nSolidityTypeAddress.prototype = new SolidityType({});\nSolidityTypeAddress.prototype.constructor = SolidityTypeAddress;\n\nSolidityTypeAddress.prototype.isType = function (name) {\n    return !!name.match(/address(\\[([0-9]*)\\])?/);\n};\n\nmodule.exports = SolidityTypeAddress;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/address.js\n// module id = 777\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/address.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\n/**\n * SolidityTypeBool is a protoype that represents bool type\n * It matches:\n * bool\n * bool[]\n * bool[4]\n * bool[][]\n * bool[3][]\n * bool[][6][], ...\n */\nvar SolidityTypeBool = function () {\n    this._inputFormatter = f.formatInputBool;\n    this._outputFormatter = f.formatOutputBool;\n};\n\nSolidityTypeBool.prototype = new SolidityType({});\nSolidityTypeBool.prototype.constructor = SolidityTypeBool;\n\nSolidityTypeBool.prototype.isType = function (name) {\n    return !!name.match(/^bool(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeBool;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/bool.js\n// module id = 778\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/bool.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\n/**\n * SolidityTypeBytes is a prototype that represents the bytes type.\n * It matches:\n * bytes\n * bytes[]\n * bytes[4]\n * bytes[][]\n * bytes[3][]\n * bytes[][6][], ...\n * bytes32\n * bytes8[4]\n * bytes[3][]\n */\nvar SolidityTypeBytes = function () {\n    this._inputFormatter = f.formatInputBytes;\n    this._outputFormatter = f.formatOutputBytes;\n};\n\nSolidityTypeBytes.prototype = new SolidityType({});\nSolidityTypeBytes.prototype.constructor = SolidityTypeBytes;\n\nSolidityTypeBytes.prototype.isType = function (name) {\n    return !!name.match(/^bytes([0-9]{1,})(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeBytes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/bytes.js\n// module id = 779\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/bytes.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\nvar SolidityTypeDynamicBytes = function () {\n    this._inputFormatter = f.formatInputDynamicBytes;\n    this._outputFormatter = f.formatOutputDynamicBytes;\n};\n\nSolidityTypeDynamicBytes.prototype = new SolidityType({});\nSolidityTypeDynamicBytes.prototype.constructor = SolidityTypeDynamicBytes;\n\nSolidityTypeDynamicBytes.prototype.isType = function (name) {\n    return !!name.match(/^bytes(\\[([0-9]*)\\])*$/);\n};\n\nSolidityTypeDynamicBytes.prototype.isDynamicType = function () {\n    return true;\n};\n\nmodule.exports = SolidityTypeDynamicBytes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/dynamicbytes.js\n// module id = 780\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/dynamicbytes.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\n/**\n * SolidityTypeInt is a protoype that represents int type\n * It matches:\n * int\n * int[]\n * int[4]\n * int[][]\n * int[3][]\n * int[][6][], ...\n * int32\n * int64[]\n * int8[4]\n * int256[][]\n * int[3][]\n * int64[][6][], ...\n */\nvar SolidityTypeInt = function () {\n    this._inputFormatter = f.formatInputInt;\n    this._outputFormatter = f.formatOutputInt;\n};\n\nSolidityTypeInt.prototype = new SolidityType({});\nSolidityTypeInt.prototype.constructor = SolidityTypeInt;\n\nSolidityTypeInt.prototype.isType = function (name) {\n    return !!name.match(/^int([0-9]*)?(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeInt;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/int.js\n// module id = 781\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/int.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\nvar SolidityTypeString = function () {\n    this._inputFormatter = f.formatInputString;\n    this._outputFormatter = f.formatOutputString;\n};\n\nSolidityTypeString.prototype = new SolidityType({});\nSolidityTypeString.prototype.constructor = SolidityTypeString;\n\nSolidityTypeString.prototype.isType = function (name) {\n    return !!name.match(/^string(\\[([0-9]*)\\])*$/);\n};\n\nSolidityTypeString.prototype.isDynamicType = function () {\n    return true;\n};\n\nmodule.exports = SolidityTypeString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/string.js\n// module id = 782\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/string.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(61);\nvar SolidityType = __webpack_require__(94);\n\n/**\n * SolidityTypeUInt is a protoype that represents uint type\n * It matches:\n * uint\n * uint[]\n * uint[4]\n * uint[][]\n * uint[3][]\n * uint[][6][], ...\n * uint32\n * uint64[]\n * uint8[4]\n * uint256[][]\n * uint[3][]\n * uint64[][6][], ...\n */\nvar SolidityTypeUInt = function () {\n    this._inputFormatter = f.formatInputInt;\n    this._outputFormatter = f.formatOutputUInt;\n};\n\nSolidityTypeUInt.prototype = new SolidityType({});\nSolidityTypeUInt.prototype.constructor = SolidityTypeUInt;\n\nSolidityTypeUInt.prototype.isType = function (name) {\n    return !!name.match(/^uint([0-9]*)?(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeUInt;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-abi/src/types/uint.js\n// module id = 783\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-abi/src/types/uint.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(Buffer) {var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();\n\nvar Bytes = __webpack_require__(255);\nvar Nat = __webpack_require__(388);\nvar elliptic = __webpack_require__(28);\nvar rlp = __webpack_require__(389);\nvar secp256k1 = new elliptic.ec("secp256k1"); // eslint-disable-line\n\nvar _require = __webpack_require__(387),\n    keccak256 = _require.keccak256,\n    keccak256s = _require.keccak256s;\n\nvar create = function create(entropy) {\n  var innerHex = keccak256(Bytes.concat(Bytes.random(32), entropy || Bytes.random(32)));\n  var middleHex = Bytes.concat(Bytes.concat(Bytes.random(32), innerHex), Bytes.random(32));\n  var outerHex = keccak256(middleHex);\n  return fromPrivate(outerHex);\n};\n\nvar toChecksum = function toChecksum(address) {\n  var addressHash = keccak256s(address.slice(2));\n  var checksumAddress = "0x";\n  for (var i = 0; i < 40; i++) {\n    checksumAddress += parseInt(addressHash[i + 2], 16) > 7 ? address[i + 2].toUpperCase() : address[i + 2];\n  }return checksumAddress;\n};\n\nvar fromPrivate = function fromPrivate(privateKey) {\n  var buffer = new Buffer(privateKey.slice(2), "hex");\n  var ecKey = secp256k1.keyFromPrivate(buffer);\n  var publicKey = "0x" + ecKey.getPublic(false, \'hex\').slice(2);\n  var publicHash = keccak256(publicKey);\n  var address = toChecksum("0x" + publicHash.slice(-40));\n  return {\n    address: address,\n    privateKey: privateKey\n  };\n};\n\nvar encodeSignature = function encodeSignature(_ref) {\n  var _ref2 = _slicedToArray(_ref, 3),\n      v = _ref2[0],\n      r = Bytes.pad(32, _ref2[1]),\n      s = Bytes.pad(32, _ref2[2]);\n\n  return Bytes.flatten([r, s, v]);\n};\n\nvar decodeSignature = function decodeSignature(hex) {\n  return [Bytes.slice(64, Bytes.length(hex), hex), Bytes.slice(0, 32, hex), Bytes.slice(32, 64, hex)];\n};\n\nvar makeSigner = function makeSigner(addToV) {\n  return function (hash, privateKey) {\n    var signature = secp256k1.keyFromPrivate(new Buffer(privateKey.slice(2), "hex")).sign(new Buffer(hash.slice(2), "hex"), { canonical: true });\n    return encodeSignature([Nat.fromString(Bytes.fromNumber(addToV + signature.recoveryParam)), Bytes.pad(32, Bytes.fromNat("0x" + signature.r.toString(16))), Bytes.pad(32, Bytes.fromNat("0x" + signature.s.toString(16)))]);\n  };\n};\n\nvar sign = makeSigner(27); // v=27|28 instead of 0|1...\n\nvar recover = function recover(hash, signature) {\n  var vals = decodeSignature(signature);\n  var vrs = { v: Bytes.toNumber(vals[0]), r: vals[1].slice(2), s: vals[2].slice(2) };\n  var ecPublicKey = secp256k1.recoverPubKey(new Buffer(hash.slice(2), "hex"), vrs, vrs.v < 2 ? vrs.v : 1 - vrs.v % 2); // because odd vals mean v=0... sadly that means v=0 means v=1... I hate that\n  var publicKey = "0x" + ecPublicKey.encode("hex", false).slice(2);\n  var publicHash = keccak256(publicKey);\n  var address = toChecksum("0x" + publicHash.slice(-40));\n  return address;\n};\n\nmodule.exports = {\n  create: create,\n  toChecksum: toChecksum,\n  fromPrivate: fromPrivate,\n  sign: sign,\n  makeSigner: makeSigner,\n  recover: recover,\n  encodeSignature: encodeSignature,\n  decodeSignature: decodeSignature\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/account.js\n// module id = 784\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js')},function(module,exports){eval("var generate = function generate(num, fn) {\n  var a = [];\n  for (var i = 0; i < num; ++i) {\n    a.push(fn(i));\n  }return a;\n};\n\nvar replicate = function replicate(num, val) {\n  return generate(num, function () {\n    return val;\n  });\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b);\n};\n\nvar flatten = function flatten(a) {\n  var r = [];\n  for (var j = 0, J = a.length; j < J; ++j) {\n    for (var i = 0, I = a[j].length; i < I; ++i) {\n      r.push(a[j][i]);\n    }\n  }return r;\n};\n\nvar chunksOf = function chunksOf(n, a) {\n  var b = [];\n  for (var i = 0, l = a.length; i < l; i += n) {\n    b.push(a.slice(i, i + n));\n  }return b;\n};\n\nmodule.exports = {\n  generate: generate,\n  replicate: replicate,\n  concat: concat,\n  flatten: flatten,\n  chunksOf: chunksOf\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/~/eth-lib/lib/array.js\n// module id = 785\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/node_modules/eth-lib/lib/array.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file accounts.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(93);\nvar Method = __webpack_require__(92);\nvar Promise = __webpack_require__(321);\nvar Account = __webpack_require__(784);\nvar Hash = __webpack_require__(387);\nvar RLP = __webpack_require__(389);\nvar Nat = __webpack_require__(388);\nvar Bytes = __webpack_require__(255);\nvar cryp = (typeof global === 'undefined') ? __webpack_require__(60) : __webpack_require__(60);\nvar scryptsy = __webpack_require__(530);\nvar uuid = __webpack_require__(768);\nvar utils = __webpack_require__(48);\nvar helpers = __webpack_require__(34);\n\nvar isNot = function(value) {\n    return (_.isUndefined(value) || _.isNull(value));\n};\n\nvar trimLeadingZero = function (hex) {\n    while (hex && hex.startsWith('0x0')) {\n        hex = '0x' + hex.slice(3);\n    }\n    return hex;\n};\n\nvar makeEven = function (hex) {\n    if(hex.length % 2 === 1) {\n        hex = hex.replace('0x', '0x0');\n    }\n    return hex;\n};\n\n\nvar Accounts = function Accounts() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // remove unecessary core functions\n    delete this.BatchRequest;\n    delete this.extend;\n\n    var _ethereumCall = [\n        new Method({\n            name: 'getId',\n            call: 'net_version',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getGasPrice',\n            call: 'eth_gasPrice',\n            params: 0\n        }),\n        new Method({\n            name: 'getTransactionCount',\n            call: 'eth_getTransactionCount',\n            params: 2,\n            inputFormatter: [function (address) {\n                if (utils.isAddress(address)) {\n                    return address;\n                } else {\n                    throw new Error('Address '+ address +' is not a valid address to get the \"transactionCount\".');\n                }\n            }, function () { return 'latest'; }]\n        })\n    ];\n    // attach methods to this._ethereumCall\n    this._ethereumCall = {};\n    _.each(_ethereumCall, function (method) {\n        method.attachToObject(_this._ethereumCall);\n        method.setRequestManager(_this._requestManager);\n    });\n\n\n    this.wallet = new Wallet(this);\n};\n\nAccounts.prototype._addAccountFunctions = function (account) {\n    var _this = this;\n\n    // add sign functions\n    account.signTransaction = function signTransaction(tx, callback) {\n        return _this.signTransaction(tx, account.privateKey, callback);\n    };\n    account.sign = function sign(data) {\n        return _this.sign(data, account.privateKey);\n    };\n\n    account.encrypt = function encrypt(password, options) {\n        return _this.encrypt(account.privateKey, password, options);\n    };\n\n\n    return account;\n};\n\nAccounts.prototype.create = function create(entropy) {\n    return this._addAccountFunctions(Account.create(entropy || utils.randomHex(32)));\n};\n\nAccounts.prototype.privateKeyToAccount = function privateKeyToAccount(privateKey) {\n    return this._addAccountFunctions(Account.fromPrivate(privateKey));\n};\n\nAccounts.prototype.signTransaction = function signTransaction(tx, privateKey, callback) {\n    var _this = this,\n        error = false,\n        result;\n\n    callback = callback || function () {};\n\n    if (!tx) {\n        error = new Error('No transaction object given!');\n\n        callback(error);\n        return Promise.reject(error);\n    }\n\n    function signed (tx) {\n\n        if (!tx.gas && !tx.gasLimit) {\n            error = new Error('\"gas\" is missing');\n        }\n\n        if (tx.nonce  < 0 ||\n            tx.gas  < 0 ||\n            tx.gasPrice  < 0 ||\n            tx.chainId  < 0) {\n            error = new Error('Gas, gasPrice, nonce or chainId is lower than 0');\n        }\n\n        if (error) {\n            callback(error);\n            return Promise.reject(new Error('\"gas\" is missing'));\n        }\n\n        try {\n            tx = helpers.formatters.inputCallFormatter(tx);\n\n            var transaction = tx;\n            transaction.to = tx.to || '0x';\n            transaction.data = tx.data || '0x';\n            transaction.value = tx.value || '0x';\n            transaction.chainId = utils.numberToHex(tx.chainId);\n\n            var rlpEncoded = RLP.encode([\n                Bytes.fromNat(transaction.nonce),\n                Bytes.fromNat(transaction.gasPrice),\n                Bytes.fromNat(transaction.gas),\n                transaction.to.toLowerCase(),\n                Bytes.fromNat(transaction.value),\n                transaction.data,\n                Bytes.fromNat(transaction.chainId || \"0x1\"),\n                \"0x\",\n                \"0x\"]);\n\n\n            var hash = Hash.keccak256(rlpEncoded);\n\n            var signature = Account.makeSigner(Nat.toNumber(transaction.chainId || \"0x1\") * 2 + 35)(Hash.keccak256(rlpEncoded), privateKey);\n\n            var rawTx = RLP.decode(rlpEncoded).slice(0, 6).concat(Account.decodeSignature(signature));\n\n            rawTx[6] = makeEven(trimLeadingZero(rawTx[6]));\n            rawTx[7] = makeEven(trimLeadingZero(rawTx[7]));\n            rawTx[8] = makeEven(trimLeadingZero(rawTx[8]));\n\n            var rawTransaction = RLP.encode(rawTx);\n\n            var values = RLP.decode(rawTransaction);\n            result = {\n                messageHash: hash,\n                v: trimLeadingZero(values[6]),\n                r: trimLeadingZero(values[7]),\n                s: trimLeadingZero(values[8]),\n                rawTransaction: rawTransaction\n            };\n\n        } catch(e) {\n            callback(e);\n            return Promise.reject(e);\n        }\n\n        callback(null, result);\n        return result;\n    }\n\n    // Resolve immediately if nonce, chainId and price are provided\n    if (tx.nonce !== undefined && tx.chainId !== undefined && tx.gasPrice !== undefined) {\n        return Promise.resolve(signed(tx));\n    }\n\n\n    // Otherwise, get the missing info from the Ethereum Node\n    return Promise.all([\n        isNot(tx.chainId) ? _this._ethereumCall.getId() : tx.chainId,\n        isNot(tx.gasPrice) ? _this._ethereumCall.getGasPrice() : tx.gasPrice,\n        isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(_this.privateKeyToAccount(privateKey).address) : tx.nonce\n    ]).then(function (args) {\n        if (isNot(args[0]) || isNot(args[1]) || isNot(args[2])) {\n            throw new Error('One of the values \"chainId\", \"gasPrice\", or \"nonce\" couldn\\'t be fetched: '+ JSON.stringify(args));\n        }\n        return signed(_.extend(tx, {chainId: args[0], gasPrice: args[1], nonce: args[2]}));\n    });\n};\n\n/* jshint ignore:start */\nAccounts.prototype.recoverTransaction = function recoverTransaction(rawTx) {\n    var values = RLP.decode(rawTx);\n    var signature = Account.encodeSignature(values.slice(6,9));\n    var recovery = Bytes.toNumber(values[6]);\n    var extraData = recovery < 35 ? [] : [Bytes.fromNumber((recovery - 35) >> 1), \"0x\", \"0x\"];\n    var signingData = values.slice(0,6).concat(extraData);\n    var signingDataHex = RLP.encode(signingData);\n    return Account.recover(Hash.keccak256(signingDataHex), signature);\n};\n/* jshint ignore:end */\n\nAccounts.prototype.hashMessage = function hashMessage(data) {\n    var message = utils.isHexStrict(data) ? utils.hexToBytes(data) : data;\n    var messageBuffer = Buffer.from(message);\n    var preamble = \"\\x19Ethereum Signed Message:\\n\" + message.length;\n    var preambleBuffer = Buffer.from(preamble);\n    var ethMessage = Buffer.concat([preambleBuffer, messageBuffer]);\n    return Hash.keccak256s(ethMessage);\n};\n\nAccounts.prototype.sign = function sign(data, privateKey) {\n    var hash = this.hashMessage(data);\n    var signature = Account.sign(hash, privateKey);\n    var vrs = Account.decodeSignature(signature);\n    return {\n        message: data,\n        messageHash: hash,\n        v: vrs[0],\n        r: vrs[1],\n        s: vrs[2],\n        signature: signature\n    };\n};\n\nAccounts.prototype.recover = function recover(message, signature, preFixed) {\n    var args = [].slice.apply(arguments);\n\n\n    if (_.isObject(message)) {\n        return this.recover(message.messageHash, Account.encodeSignature([message.v, message.r, message.s]), true);\n    }\n\n    if (!preFixed) {\n        message = this.hashMessage(message);\n    }\n\n    if (args.length >= 4) {\n        preFixed = args.slice(-1)[0];\n        preFixed = _.isBoolean(preFixed) ? !!preFixed : false;\n\n        return this.recover(message, Account.encodeSignature(args.slice(1, 4)), preFixed); // v, r, s\n    }\n    return Account.recover(message, signature);\n};\n\n// Taken from https://github.com/ethereumjs/ethereumjs-wallet\nAccounts.prototype.decrypt = function (v3Keystore, password, nonStrict) {\n    /* jshint maxcomplexity: 10 */\n\n    if(!_.isString(password)) {\n        throw new Error('No password given.');\n    }\n\n    var json = (_.isObject(v3Keystore)) ? v3Keystore : JSON.parse(nonStrict ? v3Keystore.toLowerCase() : v3Keystore);\n\n    if (json.version !== 3) {\n        throw new Error('Not a valid V3 wallet');\n    }\n\n    var derivedKey;\n    var kdfparams;\n    if (json.crypto.kdf === 'scrypt') {\n        kdfparams = json.crypto.kdfparams;\n\n        // FIXME: support progress reporting callback\n        derivedKey = scryptsy(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\n    } else if (json.crypto.kdf === 'pbkdf2') {\n        kdfparams = json.crypto.kdfparams;\n\n        if (kdfparams.prf !== 'hmac-sha256') {\n            throw new Error('Unsupported parameters to PBKDF2');\n        }\n\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256');\n    } else {\n        throw new Error('Unsupported key derivation scheme');\n    }\n\n    var ciphertext = new Buffer(json.crypto.ciphertext, 'hex');\n\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), ciphertext ])).replace('0x','');\n    if (mac !== json.crypto.mac) {\n        throw new Error('Key derivation failed - possibly wrong password');\n    }\n\n    var decipher = cryp.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex'));\n    var seed = '0x'+ Buffer.concat([ decipher.update(ciphertext), decipher.final() ]).toString('hex');\n\n    return this.privateKeyToAccount(seed);\n};\n\nAccounts.prototype.encrypt = function (privateKey, password, options) {\n    /* jshint maxcomplexity: 20 */\n    var account = this.privateKeyToAccount(privateKey);\n\n    options = options || {};\n    var salt = options.salt || cryp.randomBytes(32);\n    var iv = options.iv || cryp.randomBytes(16);\n\n    var derivedKey;\n    var kdf = options.kdf || 'scrypt';\n    var kdfparams = {\n        dklen: options.dklen || 32,\n        salt: salt.toString('hex')\n    };\n\n    if (kdf === 'pbkdf2') {\n        kdfparams.c = options.c || 262144;\n        kdfparams.prf = 'hmac-sha256';\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256');\n    } else if (kdf === 'scrypt') {\n        // FIXME: support progress reporting callback\n        kdfparams.n = options.n || 8192; // 2048 4096 8192 16384\n        kdfparams.r = options.r || 8;\n        kdfparams.p = options.p || 1;\n        derivedKey = scryptsy(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\n    } else {\n        throw new Error('Unsupported kdf');\n    }\n\n    var cipher = cryp.createCipheriv(options.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv);\n    if (!cipher) {\n        throw new Error('Unsupported cipher');\n    }\n\n    var ciphertext = Buffer.concat([ cipher.update(new Buffer(account.privateKey.replace('0x',''), 'hex')), cipher.final() ]);\n\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex') ])).replace('0x','');\n\n    return {\n        version: 3,\n        id: uuid.v4({ random: options.uuid || cryp.randomBytes(16) }),\n        address: account.address.toLowerCase().replace('0x',''),\n        crypto: {\n            ciphertext: ciphertext.toString('hex'),\n            cipherparams: {\n                iv: iv.toString('hex')\n            },\n            cipher: options.cipher || 'aes-128-ctr',\n            kdf: kdf,\n            kdfparams: kdfparams,\n            mac: mac.toString('hex')\n        }\n    };\n};\n\n\n// Note: this is trying to follow closely the specs on\n// http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html\n\nfunction Wallet(accounts) {\n    this._accounts = accounts;\n    this.length = 0;\n    this.defaultKeyName = \"web3js_wallet\";\n}\n\nWallet.prototype._findSafeIndex = function (pointer) {\n    pointer = pointer || 0;\n    if (_.has(this, pointer)) {\n        return this._findSafeIndex(pointer + 1);\n    } else {\n        return pointer;\n    }\n};\n\nWallet.prototype._currentIndexes = function () {\n    var keys = Object.keys(this);\n    var indexes = keys\n        .map(function(key) { return parseInt(key); })\n        .filter(function(n) { return (n < 9e20); });\n\n    return indexes;\n};\n\nWallet.prototype.create = function (numberOfAccounts, entropy) {\n    for (var i = 0; i < numberOfAccounts; ++i) {\n        this.add(this._accounts.create(entropy).privateKey);\n    }\n    return this;\n};\n\nWallet.prototype.add = function (account) {\n\n    if (_.isString(account)) {\n        account = this._accounts.privateKeyToAccount(account);\n    }\n    if (!this[account.address]) {\n        account = this._accounts.privateKeyToAccount(account.privateKey);\n        account.index = this._findSafeIndex();\n\n        this[account.index] = account;\n        this[account.address] = account;\n        this[account.address.toLowerCase()] = account;\n\n        this.length++;\n\n        return account;\n    } else {\n        return this[account.address];\n    }\n};\n\nWallet.prototype.remove = function (addressOrIndex) {\n    var account = this[addressOrIndex];\n\n    if (account && account.address) {\n        // address\n        this[account.address].privateKey = null;\n        delete this[account.address];\n        // address lowercase\n        this[account.address.toLowerCase()].privateKey = null;\n        delete this[account.address.toLowerCase()];\n        // index\n        this[account.index].privateKey = null;\n        delete this[account.index];\n\n        this.length--;\n\n        return true;\n    } else {\n        return false;\n    }\n};\n\nWallet.prototype.clear = function () {\n    var _this = this;\n    var indexes = this._currentIndexes();\n\n    indexes.forEach(function(index) {\n        _this.remove(index);\n    });\n\n    return this;\n};\n\nWallet.prototype.encrypt = function (password, options) {\n    var _this = this;\n    var indexes = this._currentIndexes();\n\n    var accounts = indexes.map(function(index) {\n        return _this[index].encrypt(password, options);\n    });\n\n    return accounts;\n};\n\n\nWallet.prototype.decrypt = function (encryptedWallet, password) {\n    var _this = this;\n\n    encryptedWallet.forEach(function (keystore) {\n        var account = _this._accounts.decrypt(keystore, password);\n\n        if (account) {\n            _this.add(account);\n        } else {\n            throw new Error('Couldn\\'t decrypt accounts. Password wrong?');\n        }\n    });\n\n    return this;\n};\n\nWallet.prototype.save = function (password, keyName) {\n    localStorage.setItem(keyName || this.defaultKeyName, JSON.stringify(this.encrypt(password)));\n\n    return true;\n};\n\nWallet.prototype.load = function (password, keyName) {\n    var keystore = localStorage.getItem(keyName || this.defaultKeyName);\n\n    if (keystore) {\n        try {\n            keystore = JSON.parse(keystore);\n        } catch(e) {\n\n        }\n    }\n\n    return this.decrypt(keystore || [], password);\n};\n\nif (typeof localStorage === 'undefined') {\n    delete Wallet.prototype.save;\n    delete Wallet.prototype.load;\n}\n\n\nmodule.exports = Accounts;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-accounts/src/index.js\n// module id = 786\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-accounts/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file contract.js\n *\n * To initialize a contract use:\n *\n *  var Contract = require('web3-eth-contract');\n *  Contract.setProvider('ws://localhost:8546');\n *  var contract = new Contract(abi, address, ...);\n *\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(93);\nvar Method = __webpack_require__(92);\nvar utils = __webpack_require__(48);\nvar Subscription = __webpack_require__(179).subscription;\nvar formatters = __webpack_require__(34).formatters;\nvar errors = __webpack_require__(34).errors;\nvar promiEvent = __webpack_require__(383);\nvar abi = __webpack_require__(385);\n\n\n/**\n * Should be called to create new contract instance\n *\n * @method Contract\n * @constructor\n * @param {Array} jsonInterface\n * @param {String} address\n * @param {Object} options\n */\nvar Contract = function Contract(jsonInterface, address, options) {\n    var _this = this,\n        args = Array.prototype.slice.call(arguments);\n\n    if(!(this instanceof Contract)) {\n        throw new Error('Please use the \"new\" keyword to instantiate a web3.eth.contract() object!');\n    }\n\n    // sets _requestmanager\n    core.packageInit(this, [this.constructor.currentProvider]);\n\n    this.clearSubscriptions = this._requestManager.clearSubscriptions;\n\n\n\n    if(!jsonInterface || !(Array.isArray(jsonInterface))) {\n        throw new Error('You must provide the json interface of the contract when instantiating a contract object.');\n    }\n\n\n\n    // create the options object\n    this.options = {};\n\n    var lastArg = args[args.length - 1];\n    if(_.isObject(lastArg) && !_.isArray(lastArg)) {\n        options = lastArg;\n\n        this.options = _.extend(this.options, this._getOrSetDefaultOptions(options));\n        if(_.isObject(address)) {\n            address = null;\n        }\n    }\n\n    // set address\n    Object.defineProperty(this.options, 'address', {\n        set: function(value){\n            if(value) {\n                _this._address = utils.toChecksumAddress(formatters.inputAddressFormatter(value));\n            }\n        },\n        get: function(){\n            return _this._address;\n        },\n        enumerable: true\n    });\n\n    // add method and event signatures, when the jsonInterface gets set\n    Object.defineProperty(this.options, 'jsonInterface', {\n        set: function(value){\n            _this.methods = {};\n            _this.events = {};\n\n            _this._jsonInterface = value.map(function(method) {\n                var func,\n                    funcName;\n\n                if (method.name) {\n                    funcName = utils._jsonInterfaceMethodToString(method);\n                }\n\n\n                // function\n                if (method.type === 'function') {\n                    method.signature = abi.encodeFunctionSignature(funcName);\n                    func = _this._createTxObject.bind({\n                        method: method,\n                        parent: _this\n                    });\n\n\n                    // add method only if not one already exists\n                    if(!_this.methods[method.name]) {\n                        _this.methods[method.name] = func;\n                    } else {\n                        var cascadeFunc = _this._createTxObject.bind({\n                            method: method,\n                            parent: _this,\n                            nextMethod: _this.methods[method.name]\n                        });\n                        _this.methods[method.name] = cascadeFunc;\n                    }\n\n                    // definitely add the method based on its signature\n                    _this.methods[method.signature] = func;\n\n                    // add method by name\n                    _this.methods[funcName] = func;\n\n\n                // event\n                } else if (method.type === 'event') {\n                    method.signature = abi.encodeEventSignature(funcName);\n                    var event = _this._on.bind(_this, method.signature);\n\n                    // add method only if not already exists\n                    if(!_this.events[method.name] || _this.events[method.name].name === 'bound ')\n                        _this.events[method.name] = event;\n\n                    // definitely add the method based on its signature\n                    _this.events[method.signature] = event;\n\n                    // add event by name\n                    _this.events[funcName] = event;\n                }\n\n\n                return method;\n            });\n\n            // add allEvents\n            _this.events.allEvents = _this._on.bind(_this, 'allevents');\n\n            return _this._jsonInterface;\n        },\n        get: function(){\n            return _this._jsonInterface;\n        },\n        enumerable: true\n    });\n\n    // get default account from the Class\n    var defaultAccount = this.constructor.defaultAccount;\n    var defaultBlock = this.constructor.defaultBlock || 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\n            }\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n\n            return val;\n        },\n        enumerable: true\n    });\n\n    // properties\n    this.methods = {};\n    this.events = {};\n\n    this._address = null;\n    this._jsonInterface = [];\n\n    // set getter/setter properties\n    this.options.address = address;\n    this.options.jsonInterface = jsonInterface;\n\n};\n\nContract.setProvider = function(provider, accounts) {\n    // Contract.currentProvider = provider;\n    core.packageInit(this, [provider]);\n\n    this._ethAccounts = accounts;\n};\n\n\n/**\n * Get the callback and modiufy the array if necessary\n *\n * @method _getCallback\n * @param {Array} args\n * @return {Function} the callback\n */\nContract.prototype._getCallback = function getCallback(args) {\n    if (args && _.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Checks that no listener with name \"newListener\" or \"removeListener\" is added.\n *\n * @method _checkListener\n * @param {String} type\n * @param {String} event\n * @return {Object} the contract instance\n */\nContract.prototype._checkListener = function(type, event){\n    if(event === type) {\n        throw new Error('The event \"'+ type +'\" is a reserved event name, you can\\'t use it.');\n    }\n};\n\n\n/**\n * Use default values, if options are not available\n *\n * @method _getOrSetDefaultOptions\n * @param {Object} options the options gived by the user\n * @return {Object} the options with gaps filled by defaults\n */\nContract.prototype._getOrSetDefaultOptions = function getOrSetDefaultOptions(options) {\n    var gasPrice = options.gasPrice ? String(options.gasPrice): null;\n    var from = options.from ? utils.toChecksumAddress(formatters.inputAddressFormatter(options.from)) : null;\n\n    options.data = options.data || this.options.data;\n\n    options.from = from || this.options.from;\n    options.gasPrice = gasPrice || this.options.gasPrice;\n    options.gas = options.gas || options.gasLimit || this.options.gas;\n\n    // TODO replace with only gasLimit?\n    delete options.gasLimit;\n\n    return options;\n};\n\n\n/**\n * Should be used to encode indexed params and options to one final object\n *\n * @method _encodeEventABI\n * @param {Object} event\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nContract.prototype._encodeEventABI = function (event, options) {\n    options = options || {};\n    var filter = options.filter || {},\n        result = {};\n\n    ['fromBlock', 'toBlock'].filter(function (f) {\n        return options[f] !== undefined;\n    }).forEach(function (f) {\n        result[f] = formatters.inputBlockNumberFormatter(options[f]);\n    });\n\n    // use given topics\n    if(_.isArray(options.topics)) {\n        result.topics = options.topics;\n\n    // create topics based on filter\n    } else {\n\n        result.topics = [];\n\n        // add event signature\n        if (event && !event.anonymous && event.name !== 'ALLEVENTS') {\n            result.topics.push(event.signature);\n        }\n\n        // add event topics (indexed arguments)\n        if (event.name !== 'ALLEVENTS') {\n            var indexedTopics = event.inputs.filter(function (i) {\n                return i.indexed === true;\n            }).map(function (i) {\n                var value = filter[i.name];\n                if (!value) {\n                    return null;\n                }\n\n                // TODO: https://github.com/ethereum/web3.js/issues/344\n\n                if (_.isArray(value)) {\n                    return value.map(function (v) {\n                        return abi.encodeParameter(i.type, v);\n                    });\n                }\n                return abi.encodeParameter(i.type, value);\n            });\n\n            result.topics = result.topics.concat(indexedTopics);\n        }\n\n        if(!result.topics.length)\n            delete result.topics;\n    }\n\n    if(this.options.address) {\n        result.address = this.options.address.toLowerCase();\n    }\n\n    return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method _decodeEventABI\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nContract.prototype._decodeEventABI = function (data) {\n    var event = this;\n\n    data.data = data.data || '';\n    data.topics = data.topics || [];\n    var result = formatters.outputLogFormatter(data);\n\n    // if allEvents get the right event\n    if(event.name === 'ALLEVENTS') {\n        event = event.jsonInterface.find(function (intf) {\n            return (intf.signature === data.topics[0]);\n        }) || {anonymous: true};\n    }\n\n    // create empty inputs if none are present (e.g. anonymous events on allEvents)\n    event.inputs = event.inputs || [];\n\n\n    var argTopics = event.anonymous ? data.topics : data.topics.slice(1);\n\n    result.returnValues = abi.decodeLog(event.inputs, data.data, argTopics);\n    delete result.returnValues.__length__;\n\n    // add name\n    result.event = event.name;\n\n    // add signature\n    result.signature = (event.anonymous || !data.topics[0]) ? null : data.topics[0];\n\n    // move the data and topics to \"raw\"\n    result.raw = {\n        data: result.data,\n        topics: result.topics\n    };\n    delete result.data;\n    delete result.topics;\n\n\n    return result;\n};\n\n/**\n * Encodes an ABI for a method, including signature or the method.\n * Or when constructor encodes only the constructor parameters.\n *\n * @method _encodeMethodABI\n * @param {Mixed} args the arguments to encode\n * @param {String} the encoded ABI\n */\nContract.prototype._encodeMethodABI = function _encodeMethodABI() {\n    var methodSignature = this._method.signature,\n        args = this.arguments || [];\n\n    var signature = false,\n        paramsABI = this._parent.options.jsonInterface.filter(function (json) {\n            return ((methodSignature === 'constructor' && json.type === methodSignature) ||\n                ((json.signature === methodSignature || json.signature === methodSignature.replace('0x','') || json.name === methodSignature) && json.type === 'function'));\n        }).map(function (json) {\n            var inputLength = (_.isArray(json.inputs)) ? json.inputs.length : 0;\n\n            if (inputLength !== args.length) {\n                throw new Error('The number of arguments is not matching the methods required number. You need to pass '+ inputLength +' arguments.');\n            }\n\n            if (json.type === 'function') {\n                signature = json.signature;\n            }\n            return _.isArray(json.inputs) ? json.inputs.map(function (input) { return input.type; }) : [];\n        }).map(function (types) {\n            return abi.encodeParameters(types, args).replace('0x','');\n        })[0] || '';\n\n    // return constructor\n    if(methodSignature === 'constructor') {\n        if(!this._deployData)\n            throw new Error('The contract has no contract data option set. This is necessary to append the constructor parameters.');\n\n        return this._deployData + paramsABI;\n\n    // return method\n    } else {\n\n        var returnValue = (signature) ? signature + paramsABI : paramsABI;\n\n        if(!returnValue) {\n            throw new Error('Couldn\\'t find a matching contract method named \"'+ this._method.name +'\".');\n        } else {\n            return returnValue;\n        }\n    }\n\n};\n\n\n/**\n * Decode method return values\n *\n * @method _decodeMethodReturn\n * @param {Array} outputs\n * @param {String} returnValues\n * @return {Object} decoded output return values\n */\nContract.prototype._decodeMethodReturn = function (outputs, returnValues) {\n    if (!returnValues) {\n        return null;\n    }\n\n    returnValues = returnValues.length >= 2 ? returnValues.slice(2) : returnValues;\n    var result = abi.decodeParameters(outputs, returnValues);\n\n    if (result.__length__ === 1) {\n        return result[0];\n    } else {\n        delete result.__length__;\n        return result;\n    }\n};\n\n\n/**\n * Deploys a contract and fire events based on its state: transactionHash, receipt\n *\n * All event listeners will be removed, once the last possible event is fired (\"error\", or \"receipt\")\n *\n * @method deploy\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} EventEmitter possible events are \"error\", \"transactionHash\" and \"receipt\"\n */\nContract.prototype.deploy = function(options, callback){\n\n    options = options || {};\n\n    options.arguments = options.arguments || [];\n    options = this._getOrSetDefaultOptions(options);\n\n\n    // return error, if no \"data\" is specified\n    if(!options.data) {\n        return utils._fireError(new Error('No \"data\" specified in neither the given options, nor the default options.'), null, null, callback);\n    }\n\n    var constructor = _.find(this.options.jsonInterface, function (method) {\n        return (method.type === 'constructor');\n    }) || {};\n    constructor.signature = 'constructor';\n\n    return this._createTxObject.apply({\n        method: constructor,\n        parent: this,\n        deployData: options.data,\n        _ethAccounts: this.constructor._ethAccounts\n    }, options.arguments);\n\n};\n\n/**\n * Gets the event signature and outputformatters\n *\n * @method _generateEventOptions\n * @param {Object} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event options object\n */\nContract.prototype._generateEventOptions = function() {\n    var args = Array.prototype.slice.call(arguments);\n\n    // get the callback\n    var callback = this._getCallback(args);\n\n    // get the options\n    var options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\n\n    var event = (_.isString(args[0])) ? args[0] : 'allevents';\n    event = (event.toLowerCase() === 'allevents') ? {\n            name: 'ALLEVENTS',\n            jsonInterface: this.options.jsonInterface\n        } : this.options.jsonInterface.find(function (json) {\n            return (json.type === 'event' && (json.name === event || json.signature === '0x'+ event.replace('0x','')));\n        });\n\n    if (!event) {\n        throw new Error('Event \"' + event.name + '\" doesn\\'t exist in this contract.');\n    }\n\n    if (!utils.isAddress(this.options.address)) {\n        throw new Error('This contract object doesn\\'t have address set yet, please set an address first.');\n    }\n\n    return {\n        params: this._encodeEventABI(event, options),\n        event: event,\n        callback: callback\n    };\n};\n\n/**\n * Adds event listeners and creates a subscription, and remove it once its fired.\n *\n * @method clone\n * @return {Object} the event subscription\n */\nContract.prototype.clone = function() {\n    return new this.constructor(this.options.jsonInterface, this.options.address, this.options);\n};\n\n\n/**\n * Adds event listeners and creates a subscription, and remove it once its fired.\n *\n * @method once\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event subscription\n */\nContract.prototype.once = function(event, options, callback) {\n    var args = Array.prototype.slice.call(arguments);\n\n    // get the callback\n    callback = this._getCallback(args);\n\n    if (!callback) {\n        throw new Error('Once requires a callback as the second parameter.');\n    }\n\n    // don't allow fromBlock\n    if (options)\n        delete options.fromBlock;\n\n    // don't return as once shouldn't provide \"on\"\n    this._on(event, options, function (err, res, sub) {\n        sub.unsubscribe();\n        if(_.isFunction(callback)){\n            callback(err, res, sub);\n        }\n    });\n\n    return undefined;\n};\n\n/**\n * Adds event listeners and creates a subscription.\n *\n * @method _on\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event subscription\n */\nContract.prototype._on = function(){\n    var subOptions = this._generateEventOptions.apply(this, arguments);\n\n\n    // prevent the event \"newListener\" and \"removeListener\" from being overwritten\n    this._checkListener('newListener', subOptions.event.name, subOptions.callback);\n    this._checkListener('removeListener', subOptions.event.name, subOptions.callback);\n\n    // TODO check if listener already exists? and reuse subscription if options are the same.\n\n    // create new subscription\n    var subscription = new Subscription({\n        subscription: {\n            params: 1,\n            inputFormatter: [formatters.inputLogFormatter],\n            outputFormatter: this._decodeEventABI.bind(subOptions.event),\n            // DUBLICATE, also in web3-eth\n            subscriptionHandler: function (output) {\n                if(output.removed) {\n                    this.emit('changed', output);\n                } else {\n                    this.emit('data', output);\n                }\n\n                if (_.isFunction(this.callback)) {\n                    this.callback(null, output, this);\n                }\n            }\n        },\n        type: 'eth',\n        requestManager: this._requestManager\n    });\n    subscription.subscribe('logs', subOptions.params, subOptions.callback || function () {});\n\n    return subscription;\n};\n\n/**\n * Get past events from contracts\n *\n * @method getPastEvents\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the promievent\n */\nContract.prototype.getPastEvents = function(){\n    var subOptions = this._generateEventOptions.apply(this, arguments);\n\n    var getPastLogs = new Method({\n        name: 'getPastLogs',\n        call: 'eth_getLogs',\n        params: 1,\n        inputFormatter: [formatters.inputLogFormatter],\n        outputFormatter: this._decodeEventABI.bind(subOptions.event)\n    });\n    getPastLogs.setRequestManager(this._requestManager);\n    var call = getPastLogs.buildCall();\n\n    getPastLogs = null;\n\n    return call(subOptions.params, subOptions.callback);\n};\n\n\n/**\n * returns the an object with call, send, estimate functions\n *\n * @method _createTxObject\n * @returns {Object} an object with functions to call the methods\n */\nContract.prototype._createTxObject =  function _createTxObject(){\n    var args = Array.prototype.slice.call(arguments);\n    var txObject = {};\n\n    if(this.method.type === 'function') {\n\n        txObject.call = this.parent._executeMethod.bind(txObject, 'call');\n        txObject.call.request = this.parent._executeMethod.bind(txObject, 'call', true); // to make batch requests\n\n    }\n\n    txObject.send = this.parent._executeMethod.bind(txObject, 'send');\n    txObject.send.request = this.parent._executeMethod.bind(txObject, 'send', true); // to make batch requests\n    txObject.encodeABI = this.parent._encodeMethodABI.bind(txObject);\n    txObject.estimateGas = this.parent._executeMethod.bind(txObject, 'estimate');\n\n    if (args && this.method.inputs && args.length !== this.method.inputs.length) {\n        if (this.nextMethod) {\n            return this.nextMethod.apply(null, args);\n        }\n        throw errors.InvalidNumberOfParams(args.length, this.method.inputs.length, this.method.name);\n    }\n\n    txObject.arguments = args || [];\n    txObject._method = this.method;\n    txObject._parent = this.parent;\n    txObject._ethAccounts = this.parent.constructor._ethAccounts || this._ethAccounts;\n\n    if(this.deployData) {\n        txObject._deployData = this.deployData;\n    }\n\n    return txObject;\n};\n\n\n/**\n * Generates the options for the execute call\n *\n * @method _processExecuteArguments\n * @param {Array} args\n * @param {Promise} defer\n */\nContract.prototype._processExecuteArguments = function _processExecuteArguments(args, defer) {\n    var processedArgs = {};\n\n    processedArgs.type = args.shift();\n\n    // get the callback\n    processedArgs.callback = this._parent._getCallback(args);\n\n    // get block number to use for call\n    if(processedArgs.type === 'call' && args[args.length - 1] !== true && (_.isString(args[args.length - 1]) || isFinite(args[args.length - 1])))\n        processedArgs.defaultBlock = args.pop();\n\n    // get the options\n    processedArgs.options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\n\n    // get the generateRequest argument for batch requests\n    processedArgs.generateRequest = (args[args.length - 1] === true)? args.pop() : false;\n\n    processedArgs.options = this._parent._getOrSetDefaultOptions(processedArgs.options);\n    processedArgs.options.data = this.encodeABI();\n\n    // add contract address\n    if(!this._deployData && !utils.isAddress(this._parent.options.address))\n        throw new Error('This contract object doesn\\'t have address set yet, please set an address first.');\n\n    if(!this._deployData)\n        processedArgs.options.to = this._parent.options.address;\n\n    // return error, if no \"data\" is specified\n    if(!processedArgs.options.data)\n        return utils._fireError(new Error('Couldn\\'t find a matching contract method, or the number of parameters is wrong.'), defer.eventEmitter, defer.reject, processedArgs.callback);\n\n    return processedArgs;\n};\n\n/**\n * Executes a call, transact or estimateGas on a contract function\n *\n * @method _executeMethod\n * @param {String} type the type this execute function should execute\n * @param {Boolean} makeRequest if true, it simply returns the request parameters, rather than executing it\n */\nContract.prototype._executeMethod = function _executeMethod(){\n    var _this = this,\n        args = this._parent._processExecuteArguments.call(this, Array.prototype.slice.call(arguments), defer),\n        defer = promiEvent((args.type !== 'send')),\n        ethAccounts = _this.constructor._ethAccounts || _this._ethAccounts;\n\n    // simple return request for batch requests\n    if(args.generateRequest) {\n\n        var payload = {\n            params: [formatters.inputCallFormatter.call(this._parent, args.options)],\n            callback: args.callback\n        };\n\n        if(args.type === 'call') {\n            payload.params.push(formatters.inputDefaultBlockNumberFormatter.call(this._parent, args.defaultBlock));\n            payload.method = 'eth_call';\n            payload.format = this._parent._decodeMethodReturn.bind(null, this._method.outputs);\n        } else {\n            payload.method = 'eth_sendTransaction';\n        }\n\n        return payload;\n\n    } else {\n\n        switch (args.type) {\n            case 'estimate':\n\n                var estimateGas = (new Method({\n                    name: 'estimateGas',\n                    call: 'eth_estimateGas',\n                    params: 1,\n                    inputFormatter: [formatters.inputCallFormatter],\n                    outputFormatter: utils.hexToNumber,\n                    requestManager: _this._parent._requestManager,\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock\n                })).createFunction();\n\n                return estimateGas(args.options, args.callback);\n\n            case 'call':\n\n                // TODO check errors: missing \"from\" should give error on deploy and send, call ?\n\n                var call = (new Method({\n                    name: 'call',\n                    call: 'eth_call',\n                    params: 2,\n                    inputFormatter: [formatters.inputCallFormatter, formatters.inputDefaultBlockNumberFormatter],\n                    // add output formatter for decoding\n                    outputFormatter: function (result) {\n                        return _this._parent._decodeMethodReturn(_this._method.outputs, result);\n                    },\n                    requestManager: _this._parent._requestManager,\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock\n                })).createFunction();\n\n                return call(args.options, args.defaultBlock, args.callback);\n\n            case 'send':\n\n                // return error, if no \"from\" is specified\n                if(!utils.isAddress(args.options.from)) {\n                    return utils._fireError(new Error('No \"from\" address specified in neither the given options, nor the default options.'), defer.eventEmitter, defer.reject, args.callback);\n                }\n\n                if (_.isBoolean(this._method.payable) && !this._method.payable && args.options.value && args.options.value > 0) {\n                    return utils._fireError(new Error('Can not send value to non-payable contract method or constructor'), defer.eventEmitter, defer.reject, args.callback);\n                }\n\n\n                // make sure receipt logs are decoded\n                var extraFormatters = {\n                    receiptFormatter: function (receipt) {\n                        if (_.isArray(receipt.logs)) {\n\n                            // decode logs\n                            var events = _.map(receipt.logs, function(log) {\n                                return _this._parent._decodeEventABI.call({\n                                    name: 'ALLEVENTS',\n                                    jsonInterface: _this._parent.options.jsonInterface\n                                }, log);\n                            });\n\n                            // make log names keys\n                            receipt.events = {};\n                            var count = 0;\n                            events.forEach(function (ev) {\n                                if (ev.event) {\n                                    // if > 1 of the same event, don't overwrite any existing events\n                                    if (receipt.events[ev.event]) {\n                                        if (Array.isArray(receipt.events[ ev.event ])) {\n                                            receipt.events[ ev.event ].push(ev);\n                                        } else {\n                                            receipt.events[ev.event] = [receipt.events[ev.event], ev];\n                                        }\n                                    } else {\n                                        receipt.events[ ev.event ] = ev;\n                                    }\n                                } else {\n                                    receipt.events[count] = ev;\n                                    count++;\n                                }\n                            });\n\n                            delete receipt.logs;\n                        }\n                        return receipt;\n                    },\n                    contractDeployFormatter: function (receipt) {\n                        var newContract = _this._parent.clone();\n                        newContract.options.address = receipt.contractAddress;\n                        return newContract;\n                    }\n                };\n\n                var sendTransaction = (new Method({\n                    name: 'sendTransaction',\n                    call: 'eth_sendTransaction',\n                    params: 1,\n                    inputFormatter: [formatters.inputTransactionFormatter],\n                    requestManager: _this._parent._requestManager,\n                    accounts: _this.constructor._ethAccounts || _this._ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock,\n                    extraFormatters: extraFormatters\n                })).createFunction();\n\n                return sendTransaction(args.options, args.callback);\n\n        }\n\n    }\n\n};\n\nmodule.exports = Contract;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth-contract/src/index.js\n// module id = 787\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth-contract/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file getNetworkType.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\n\nvar getNetworkType = function (callback) {\n    var _this = this,\n        id;\n\n\n    return this.net.getId()\n        .then(function (givenId) {\n\n            id = givenId;\n\n            return _this.getBlock(0);\n        })\n        .then(function (genesis) {\n            var returnValue = 'private';\n\n            if (genesis.hash === '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' &&\n                id === 1) {\n                returnValue = 'main';\n            }\n            if (genesis.hash === '0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303' &&\n                id === 2) {\n                returnValue = 'morden';\n            }\n            if (genesis.hash === '0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d' &&\n                id === 3) {\n                returnValue = 'ropsten';\n            }\n            if (genesis.hash === '0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177' &&\n                id === 4) {\n                returnValue = 'rinkeby';\n            }\n            if (genesis.hash === '0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9' &&\n                id === 42) {\n                returnValue = 'kovan';\n            }\n\n            if (_.isFunction(callback)) {\n                callback(null, returnValue);\n            }\n\n            return returnValue;\n        })\n        .catch(function (err) {\n            if (_.isFunction(callback)) {\n                callback(err);\n            } else {\n                throw err;\n            }\n        });\n};\n\nmodule.exports = getNetworkType;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth/src/getNetworkType.js\n// module id = 788\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth/src/getNetworkType.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(93);\nvar helpers = __webpack_require__(34);\nvar Subscriptions = __webpack_require__(179).subscriptions;\nvar Method = __webpack_require__(92);\nvar utils = __webpack_require__(48);\nvar Net = __webpack_require__(180);\n\nvar Personal = __webpack_require__(391);\nvar BaseContract = __webpack_require__(787);\nvar Iban = __webpack_require__(390);\nvar Accounts = __webpack_require__(786);\nvar abi = __webpack_require__(385);\n\nvar getNetworkType = __webpack_require__(788);\nvar formatter = helpers.formatters;\n\n\nvar blockCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n\nvar Eth = function Eth() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // overwrite setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function () {\n        setProvider.apply(_this, arguments);\n        _this.net.setProvider.apply(_this, arguments);\n        _this.personal.setProvider.apply(_this, arguments);\n        _this.accounts.setProvider.apply(_this, arguments);\n        _this.Contract.setProvider(_this.currentProvider, _this.accounts);\n    };\n\n\n    var defaultAccount = null;\n    var defaultBlock = 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatter.inputAddressFormatter(val));\n            }\n\n            // also set on the Contract object\n            _this.Contract.defaultAccount = defaultAccount;\n            _this.personal.defaultAccount = defaultAccount;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultAccount = defaultAccount;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n            // also set on the Contract object\n            _this.Contract.defaultBlock = defaultBlock;\n            _this.personal.defaultBlock = defaultBlock;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultBlock = defaultBlock;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n\n\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\n\n    // add net\n    this.net = new Net(this.currentProvider);\n    // add chain detection\n    this.net.getNetworkType = getNetworkType.bind(this);\n\n    // add accounts\n    this.accounts = new Accounts(this.currentProvider);\n\n    // add personal\n    this.personal = new Personal(this.currentProvider);\n    this.personal.defaultAccount = this.defaultAccount;\n\n    // create a proxy Contract type for this instance, as a Contract's provider\n    // is stored as a class member rather than an instance variable. If we do\n    // not create this proxy type, changing the provider in one instance of\n    // web3-eth would subsequently change the provider for _all_ contract\n    // instances!\n    var Contract = function Contract() {\n        BaseContract.apply(this, arguments);\n    };\n\n    Contract.setProvider = function() {\n        BaseContract.setProvider.apply(this, arguments);\n    };\n\n    // make our proxy Contract inherit from web3-eth-contract so that it has all\n    // the right functionality and so that instanceof and friends work properly\n    Contract.prototype = Object.create(BaseContract.prototype);\n    Contract.prototype.constructor = Contract;\n\n    // add contract\n    this.Contract = Contract;\n    this.Contract.defaultAccount = this.defaultAccount;\n    this.Contract.defaultBlock = this.defaultBlock;\n    this.Contract.setProvider(this.currentProvider, this.accounts);\n\n    // add IBAN\n    this.Iban = Iban;\n\n    // add ABI\n    this.abi = abi;\n\n\n    var methods = [\n        new Method({\n            name: 'getNodeInfo',\n            call: 'web3_clientVersion'\n        }),\n        new Method({\n            name: 'getProtocolVersion',\n            call: 'eth_protocolVersion',\n            params: 0\n        }),\n        new Method({\n            name: 'getCoinbase',\n            call: 'eth_coinbase',\n            params: 0\n        }),\n        new Method({\n            name: 'isMining',\n            call: 'eth_mining',\n            params: 0\n        }),\n        new Method({\n            name: 'getHashrate',\n            call: 'eth_hashrate',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'isSyncing',\n            call: 'eth_syncing',\n            params: 0,\n            outputFormatter: formatter.outputSyncingFormatter\n        }),\n        new Method({\n            name: 'getGasPrice',\n            call: 'eth_gasPrice',\n            params: 0,\n            outputFormatter: formatter.outputBigNumberFormatter\n        }),\n        new Method({\n            name: 'getAccounts',\n            call: 'eth_accounts',\n            params: 0,\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'getBlockNumber',\n            call: 'eth_blockNumber',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getBalance',\n            call: 'eth_getBalance',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\n            outputFormatter: formatter.outputBigNumberFormatter\n        }),\n        new Method({\n            name: 'getStorageAt',\n            call: 'eth_getStorageAt',\n            params: 3,\n            inputFormatter: [formatter.inputAddressFormatter, utils.numberToHex, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'getCode',\n            call: 'eth_getCode',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'getBlock',\n            call: blockCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, function (val) { return !!val; }],\n            outputFormatter: formatter.outputBlockFormatter\n        }),\n        new Method({\n            name: 'getUncle',\n            call: uncleCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\n            outputFormatter: formatter.outputBlockFormatter,\n\n        }),\n        new Method({\n            name: 'getBlockTransactionCount',\n            call: getBlockTransactionCountCall,\n            params: 1,\n            inputFormatter: [formatter.inputBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getBlockUncleCount',\n            call: uncleCountCall,\n            params: 1,\n            inputFormatter: [formatter.inputBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getTransaction',\n            call: 'eth_getTransactionByHash',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatter.outputTransactionFormatter\n        }),\n        new Method({\n            name: 'getTransactionFromBlock',\n            call: transactionFromBlockCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\n            outputFormatter: formatter.outputTransactionFormatter\n        }),\n        new Method({\n            name: 'getTransactionReceipt',\n            call: 'eth_getTransactionReceipt',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatter.outputTransactionReceiptFormatter\n        }),\n        new Method({\n            name: 'getTransactionCount',\n            call: 'eth_getTransactionCount',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'sendSignedTransaction',\n            call: 'eth_sendRawTransaction',\n            params: 1,\n            inputFormatter: [null]\n        }),\n        new Method({\n            name: 'signTransaction',\n            call: 'eth_signTransaction',\n            params: 1,\n            inputFormatter: [formatter.inputTransactionFormatter]\n        }),\n        new Method({\n            name: 'sendTransaction',\n            call: 'eth_sendTransaction',\n            params: 1,\n            inputFormatter: [formatter.inputTransactionFormatter]\n        }),\n        new Method({\n            name: 'sign',\n            call: 'eth_sign',\n            params: 2,\n            inputFormatter: [formatter.inputSignFormatter, formatter.inputAddressFormatter],\n            transformPayload: function (payload) {\n                payload.params.reverse();\n                return payload;\n            }\n        }),\n        new Method({\n            name: 'call',\n            call: 'eth_call',\n            params: 2,\n            inputFormatter: [formatter.inputCallFormatter, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'estimateGas',\n            call: 'eth_estimateGas',\n            params: 1,\n            inputFormatter: [formatter.inputCallFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getCompilers',\n            call: 'eth_getCompilers',\n            params: 0\n        }),\n        new Method({\n            name: 'compile.solidity',\n            call: 'eth_compileSolidity',\n            params: 1\n        }),\n        new Method({\n            name: 'compile.lll',\n            call: 'eth_compileLLL',\n            params: 1\n        }),\n        new Method({\n            name: 'compile.serpent',\n            call: 'eth_compileSerpent',\n            params: 1\n        }),\n        new Method({\n            name: 'submitWork',\n            call: 'eth_submitWork',\n            params: 3\n        }),\n        new Method({\n            name: 'getWork',\n            call: 'eth_getWork',\n            params: 0\n        }),\n        new Method({\n            name: 'getPastLogs',\n            call: 'eth_getLogs',\n            params: 1,\n            inputFormatter: [formatter.inputLogFormatter],\n            outputFormatter: formatter.outputLogFormatter\n        }),\n\n        // subscriptions\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'eth',\n            subscriptions: {\n                'newBlockHeaders': {\n                    // TODO rename on RPC side?\n                    subscriptionName: 'newHeads', // replace subscription with this name\n                    params: 0,\n                    outputFormatter: formatter.outputBlockFormatter\n                },\n                'pendingTransactions': {\n                    subscriptionName: 'newPendingTransactions', // replace subscription with this name\n                    params: 0\n                },\n                'logs': {\n                    params: 1,\n                    inputFormatter: [formatter.inputLogFormatter],\n                    outputFormatter: formatter.outputLogFormatter,\n                    // DUBLICATE, also in web3-eth-contract\n                    subscriptionHandler: function (output) {\n                        if(output.removed) {\n                            this.emit('changed', output);\n                        } else {\n                            this.emit('data', output);\n                        }\n\n                        if (_.isFunction(this.callback)) {\n                            this.callback(null, output, this);\n                        }\n                    }\n                },\n                'syncing': {\n                    params: 0,\n                    outputFormatter: formatter.outputSyncingFormatter,\n                    subscriptionHandler: function (output) {\n                        var _this = this;\n\n                        // fire TRUE at start\n                        if(this._isSyncing !== true) {\n                            this._isSyncing = true;\n                            this.emit('changed', _this._isSyncing);\n\n                            if (_.isFunction(this.callback)) {\n                                this.callback(null, _this._isSyncing, this);\n                            }\n\n                            setTimeout(function () {\n                                _this.emit('data', output);\n\n                                if (_.isFunction(_this.callback)) {\n                                    _this.callback(null, output, _this);\n                                }\n                            }, 0);\n\n                            // fire sync status\n                        } else {\n                            this.emit('data', output);\n                            if (_.isFunction(_this.callback)) {\n                                this.callback(null, output, this);\n                            }\n\n                            // wait for some time before fireing the FALSE\n                            clearTimeout(this._isSyncingTimeout);\n                            this._isSyncingTimeout = setTimeout(function () {\n                                if(output.currentBlock > output.highestBlock - 200) {\n                                    _this._isSyncing = false;\n                                    _this.emit('changed', _this._isSyncing);\n\n                                    if (_.isFunction(_this.callback)) {\n                                        _this.callback(null, _this._isSyncing, _this);\n                                    }\n                                }\n                            }, 500);\n                        }\n                    }\n                }\n            }\n        })\n    ];\n\n    methods.forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager, _this.accounts); // second param means is eth.accounts (necessary for wallet signing)\n        method.defaultBlock = _this.defaultBlock;\n        method.defaultAccount = _this.defaultAccount;\n    });\n\n};\n\ncore.addProviders(Eth);\n\n\nmodule.exports = Eth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-eth/src/index.js\n// module id = 789\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-eth/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file httpprovider.js\n * @authors:\n *   Marek Kotewicz <marek@parity.io>\n *   Marian Oancea\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2015\n */\n\nvar errors = __webpack_require__(34).errors;\nvar XHR2 = __webpack_require__(563); // jshint ignore: line\n\n/**\n * HttpProvider should be used to send rpc calls over http\n */\nvar HttpProvider = function HttpProvider(host, timeout, headers) {\n    this.host = host || 'http://localhost:8545';\n    this.timeout = timeout || 0;\n    this.connected = false;\n    this.headers = headers;\n};\n\nHttpProvider.prototype._prepareRequest = function(){\n    var request = new XHR2();\n\n    request.open('POST', this.host, true);\n    request.setRequestHeader('Content-Type','application/json');\n\n    if(this.headers) {\n        this.headers.forEach(function(header) {\n            request.setRequestHeader(header.name, header.value);\n        });\n    }\n\n    return request;\n};\n\n/**\n * Should be used to make async request\n *\n * @method send\n * @param {Object} payload\n * @param {Function} callback triggered on end with (err, result)\n */\nHttpProvider.prototype.send = function (payload, callback) {\n    var _this = this;\n    var request = this._prepareRequest();\n\n\n    request.onreadystatechange = function() {\n        if (request.readyState === 4 && request.timeout !== 1) {\n            var result = request.responseText;\n            var error = null;\n\n            try {\n                result = JSON.parse(result);\n            } catch(e) {\n                error = errors.InvalidResponse(request.responseText);\n            }\n\n            _this.connected = true;\n            callback(error, result);\n        }\n    };\n\n    request.ontimeout = function() {\n        _this.connected = false;\n        callback(errors.ConnectionTimeout(this.timeout));\n    };\n\n    try {\n        request.send(JSON.stringify(payload));\n    } catch(error) {\n        this.connected = false;\n        callback(errors.InvalidConnection(this.host));\n    }\n};\n\n\nmodule.exports = HttpProvider;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-providers-http/src/index.js\n// module id = 790\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-providers-http/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file index.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(34).errors;\nvar oboe = __webpack_require__(496);\n\n\nvar IpcProvider = function IpcProvider(path, net) {\n    var _this = this;\n    this.responseCallbacks = {};\n    this.notificationCallbacks = [];\n    this.path = path;\n\n    this.connection = net.connect({path: this.path});\n\n    this.addDefaultEvents();\n\n    // LISTEN FOR CONNECTION RESPONSES\n    var callback = function(result) {\n        /*jshint maxcomplexity: 6 */\n\n        var id = null;\n\n        // get the id which matches the returned id\n        if(_.isArray(result)) {\n            result.forEach(function(load){\n                if(_this.responseCallbacks[load.id])\n                    id = load.id;\n            });\n        } else {\n            id = result.id;\n        }\n\n        // notification\n        if(!id && result.method.indexOf('_subscription') !== -1) {\n            _this.notificationCallbacks.forEach(function(callback){\n                if(_.isFunction(callback))\n                    callback(result);\n            });\n\n            // fire the callback\n        } else if(_this.responseCallbacks[id]) {\n            _this.responseCallbacks[id](null, result);\n            delete _this.responseCallbacks[id];\n        }\n    };\n\n    // use oboe.js for Sockets\n    if (net.constructor.name === 'Socket') {\n        oboe(this.connection)\n        .done(callback);\n    } else {\n        this.connection.on('data', function(data){\n            _this._parseResponse(data.toString()).forEach(callback);\n        });\n    }\n};\n\n/**\nWill add the error and end event to timeout existing calls\n\n@method addDefaultEvents\n*/\nIpcProvider.prototype.addDefaultEvents = function(){\n    var _this = this;\n\n    this.connection.on('connect', function(){\n    });\n\n    this.connection.on('error', function(){\n        _this._timeout();\n    });\n\n    this.connection.on('end', function(){\n        _this._timeout();\n    });\n\n    this.connection.on('timeout', function(){\n        _this._timeout();\n    });\n};\n\n\n/**\n Will parse the response and make an array out of it.\n\n NOTE, this exists for backwards compatibility reasons.\n\n @method _parseResponse\n @param {String} data\n */\nIpcProvider.prototype._parseResponse = function(data) {\n    var _this = this,\n        returnValues = [];\n\n    // DE-CHUNKER\n    var dechunkedData = data\n        .replace(/\\}[\\n\\r]?\\{/g,'}|--|{') // }{\n        .replace(/\\}\\][\\n\\r]?\\[\\{/g,'}]|--|[{') // }][{\n        .replace(/\\}[\\n\\r]?\\[\\{/g,'}|--|[{') // }[{\n        .replace(/\\}\\][\\n\\r]?\\{/g,'}]|--|{') // }]{\n        .split('|--|');\n\n    dechunkedData.forEach(function(data){\n\n        // prepend the last chunk\n        if(_this.lastChunk)\n            data = _this.lastChunk + data;\n\n        var result = null;\n\n        try {\n            result = JSON.parse(data);\n\n        } catch(e) {\n\n            _this.lastChunk = data;\n\n            // start timeout to cancel all requests\n            clearTimeout(_this.lastChunkTimeout);\n            _this.lastChunkTimeout = setTimeout(function(){\n                _this._timeout();\n                throw errors.InvalidResponse(data);\n            }, 1000 * 15);\n\n            return;\n        }\n\n        // cancel timeout and set chunk to null\n        clearTimeout(_this.lastChunkTimeout);\n        _this.lastChunk = null;\n\n        if(result)\n            returnValues.push(result);\n    });\n\n    return returnValues;\n};\n\n\n/**\nGet the adds a callback to the responseCallbacks object,\nwhich will be called if a response matching the response Id will arrive.\n\n@method _addResponseCallback\n*/\nIpcProvider.prototype._addResponseCallback = function(payload, callback) {\n    var id = payload.id || payload[0].id;\n    var method = payload.method || payload[0].method;\n\n    this.responseCallbacks[id] = callback;\n    this.responseCallbacks[id].method = method;\n};\n\n/**\nTimeout all requests when the end/error event is fired\n\n@method _timeout\n*/\nIpcProvider.prototype._timeout = function() {\n    for(var key in this.responseCallbacks) {\n        if(this.responseCallbacks.hasOwnProperty(key)){\n            this.responseCallbacks[key](errors.InvalidConnection('on IPC'));\n            delete this.responseCallbacks[key];\n        }\n    }\n};\n\n/**\n Try to reconnect\n\n @method reconnect\n */\nIpcProvider.prototype.reconnect = function() {\n    this.connection.connect({path: this.path});\n};\n\n\nIpcProvider.prototype.send = function (payload, callback) {\n    // try reconnect, when connection is gone\n    if(!this.connection.writable)\n        this.connection.connect({path: this.path});\n\n\n    this.connection.write(JSON.stringify(payload));\n    this._addResponseCallback(payload, callback);\n};\n\n/**\nSubscribes to provider events.provider\n\n@method on\n@param {String} type    'notification', 'connect', 'error', 'end' or 'data'\n@param {Function} callback   the callback to call\n*/\nIpcProvider.prototype.on = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.push(callback);\n            break;\n\n        // adds error, end, timeout, connect\n        default:\n            this.connection.on(type, callback);\n            break;\n    }\n};\n\n/**\n Subscribes to provider events.provider\n\n @method on\n @param {String} type    'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nIpcProvider.prototype.once = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    this.connection.once(type, callback);\n};\n\n/**\nRemoves event listener\n\n@method removeListener\n@param {String} type    'data', 'connect', 'error', 'end' or 'data'\n@param {Function} callback   the callback to call\n*/\nIpcProvider.prototype.removeListener = function (type, callback) {\n    var _this = this;\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.forEach(function(cb, index){\n                if(cb === callback)\n                    _this.notificationCallbacks.splice(index, 1);\n            });\n            break;\n\n        default:\n            this.connection.removeListener(type, callback);\n            break;\n    }\n};\n\n/**\nRemoves all event listeners\n\n@method removeAllListeners\n@param {String} type    'data', 'connect', 'error', 'end' or 'data'\n*/\nIpcProvider.prototype.removeAllListeners = function (type) {\n    switch(type){\n        case 'data':\n            this.notificationCallbacks = [];\n            break;\n\n        default:\n            this.connection.removeAllListeners(type);\n            break;\n    }\n};\n\n/**\nResets the providers, clears all callbacks\n\n@method reset\n*/\nIpcProvider.prototype.reset = function () {\n    this._timeout();\n    this.notificationCallbacks = [];\n\n    this.connection.removeAllListeners('error');\n    this.connection.removeAllListeners('end');\n    this.connection.removeAllListeners('timeout');\n\n    this.addDefaultEvents();\n};\n\nmodule.exports = IpcProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-providers-ipc/src/index.js\n// module id = 791\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-providers-ipc/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/** @file WebsocketProvider.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(34).errors;\n\nvar Ws = null;\nvar _btoa = null;\nvar parseURL = null;\nif (typeof window !== 'undefined') {\n    Ws = window.WebSocket;\n    _btoa = btoa;\n    parseURL = function(url) {\n        return new URL(url);\n    };\n} else {\n    Ws = __webpack_require__(797).w3cwebsocket;\n    _btoa = function(str) {\n      return Buffer(str).toString('base64');\n    };\n    // Web3 supports Node.js 5, so we need to use the legacy URL API\n    parseURL = __webpack_require__(157).parse;\n}\n// Default connection ws://localhost:8546\n\n\n\n\nvar WebsocketProvider = function WebsocketProvider(url, options)  {\n    var _this = this;\n    this.responseCallbacks = {};\n    this.notificationCallbacks = [];\n\n    options = options || {};\n    this._customTimeout = options.timeout;\n\n    // The w3cwebsocket implementation does not support Basic Auth\n    // username/password in the URL. So generate the basic auth header, and\n    // pass through with any additional headers supplied in constructor\n    var parsedURL = parseURL(url);\n    var headers = options.headers || {};\n    if (parsedURL.username && parsedURL.password) {\n        headers.authorization = 'Basic ' + _btoa(parsedURL.username + ':' + parsedURL.password);\n    }\n\n    this.connection = new Ws(url, undefined, undefined, headers);\n\n    this.addDefaultEvents();\n\n\n    // LISTEN FOR CONNECTION RESPONSES\n    this.connection.onmessage = function(e) {\n        /*jshint maxcomplexity: 6 */\n        var data = (typeof e.data === 'string') ? e.data : '';\n\n        _this._parseResponse(data).forEach(function(result){\n\n            var id = null;\n\n            // get the id which matches the returned id\n            if(_.isArray(result)) {\n                result.forEach(function(load){\n                    if(_this.responseCallbacks[load.id])\n                        id = load.id;\n                });\n            } else {\n                id = result.id;\n            }\n\n            // notification\n            if(!id && result.method.indexOf('_subscription') !== -1) {\n                _this.notificationCallbacks.forEach(function(callback){\n                    if(_.isFunction(callback))\n                        callback(result);\n                });\n\n                // fire the callback\n            } else if(_this.responseCallbacks[id]) {\n                _this.responseCallbacks[id](null, result);\n                delete _this.responseCallbacks[id];\n            }\n        });\n    };\n};\n\n/**\n Will add the error and end event to timeout existing calls\n\n @method addDefaultEvents\n */\nWebsocketProvider.prototype.addDefaultEvents = function(){\n    var _this = this;\n\n    this.connection.onerror = function(){\n        _this._timeout();\n    };\n\n    this.connection.onclose = function(){\n        _this._timeout();\n\n        // reset all requests and callbacks\n        _this.reset();\n    };\n\n    // this.connection.on('timeout', function(){\n    //     _this._timeout();\n    // });\n};\n\n/**\n Will parse the response and make an array out of it.\n\n @method _parseResponse\n @param {String} data\n */\nWebsocketProvider.prototype._parseResponse = function(data) {\n    var _this = this,\n        returnValues = [];\n\n    // DE-CHUNKER\n    var dechunkedData = data\n        .replace(/\\}[\\n\\r]?\\{/g,'}|--|{') // }{\n        .replace(/\\}\\][\\n\\r]?\\[\\{/g,'}]|--|[{') // }][{\n        .replace(/\\}[\\n\\r]?\\[\\{/g,'}|--|[{') // }[{\n        .replace(/\\}\\][\\n\\r]?\\{/g,'}]|--|{') // }]{\n        .split('|--|');\n\n    dechunkedData.forEach(function(data){\n\n        // prepend the last chunk\n        if(_this.lastChunk)\n            data = _this.lastChunk + data;\n\n        var result = null;\n\n        try {\n            result = JSON.parse(data);\n\n        } catch(e) {\n\n            _this.lastChunk = data;\n\n            // start timeout to cancel all requests\n            clearTimeout(_this.lastChunkTimeout);\n            _this.lastChunkTimeout = setTimeout(function(){\n                _this._timeout();\n                throw errors.InvalidResponse(data);\n            }, 1000 * 15);\n\n            return;\n        }\n\n        // cancel timeout and set chunk to null\n        clearTimeout(_this.lastChunkTimeout);\n        _this.lastChunk = null;\n\n        if(result)\n            returnValues.push(result);\n    });\n\n    return returnValues;\n};\n\n\n/**\n Adds a callback to the responseCallbacks object,\n which will be called if a response matching the response Id will arrive.\n\n @method _addResponseCallback\n */\nWebsocketProvider.prototype._addResponseCallback = function(payload, callback) {\n    var id = payload.id || payload[0].id;\n    var method = payload.method || payload[0].method;\n\n    this.responseCallbacks[id] = callback;\n    this.responseCallbacks[id].method = method;\n\n    var _this = this;\n\n    // schedule triggering the error response if a custom timeout is set\n    if (this._customTimeout) {\n        setTimeout(function () {\n            if (_this.responseCallbacks[id]) {\n                _this.responseCallbacks[id](errors.ConnectionTimeout(_this._customTimeout));\n                delete _this.responseCallbacks[id];\n            }\n        }, this._customTimeout);\n    }\n};\n\n/**\n Timeout all requests when the end/error event is fired\n\n @method _timeout\n */\nWebsocketProvider.prototype._timeout = function() {\n    for(var key in this.responseCallbacks) {\n        if(this.responseCallbacks.hasOwnProperty(key)){\n            this.responseCallbacks[key](errors.InvalidConnection('on WS'));\n            delete this.responseCallbacks[key];\n        }\n    }\n};\n\n\nWebsocketProvider.prototype.send = function (payload, callback) {\n    var _this = this;\n\n    if (this.connection.readyState === this.connection.CONNECTING) {\n        setTimeout(function () {\n            _this.send(payload, callback);\n        }, 10);\n        return;\n    }\n\n    // try reconnect, when connection is gone\n    // if(!this.connection.writable)\n    //     this.connection.connect({url: this.url});\n    if (this.connection.readyState !== this.connection.OPEN) {\n        console.error('connection not open on send()');\n        if (typeof this.connection.onerror === 'function') {\n            this.connection.onerror(new Error('connection not open'));\n        } else {\n            console.error('no error callback');\n        }\n        callback(new Error('connection not open'));\n        return;\n    }\n\n    this.connection.send(JSON.stringify(payload));\n    this._addResponseCallback(payload, callback);\n};\n\n/**\n Subscribes to provider events.provider\n\n @method on\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nWebsocketProvider.prototype.on = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.push(callback);\n            break;\n\n        case 'connect':\n            this.connection.onopen = callback;\n            break;\n\n        case 'end':\n            this.connection.onclose = callback;\n            break;\n\n        case 'error':\n            this.connection.onerror = callback;\n            break;\n\n        // default:\n        //     this.connection.on(type, callback);\n        //     break;\n    }\n};\n\n// TODO add once\n\n/**\n Removes event listener\n\n @method removeListener\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nWebsocketProvider.prototype.removeListener = function (type, callback) {\n    var _this = this;\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.forEach(function(cb, index){\n                if(cb === callback)\n                    _this.notificationCallbacks.splice(index, 1);\n            });\n            break;\n\n        // TODO remvoving connect missing\n\n        // default:\n        //     this.connection.removeListener(type, callback);\n        //     break;\n    }\n};\n\n/**\n Removes all event listeners\n\n @method removeAllListeners\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n */\nWebsocketProvider.prototype.removeAllListeners = function (type) {\n    switch(type){\n        case 'data':\n            this.notificationCallbacks = [];\n            break;\n\n        // TODO remvoving connect properly missing\n\n        case 'connect':\n            this.connection.onopen = null;\n            break;\n\n        case 'end':\n            this.connection.onclose = null;\n            break;\n\n        case 'error':\n            this.connection.onerror = null;\n            break;\n\n        default:\n            // this.connection.removeAllListeners(type);\n            break;\n    }\n};\n\n/**\n Resets the providers, clears all callbacks\n\n @method reset\n */\nWebsocketProvider.prototype.reset = function () {\n    this._timeout();\n    this.notificationCallbacks = [];\n\n    // this.connection.removeAllListeners('error');\n    // this.connection.removeAllListeners('end');\n    // this.connection.removeAllListeners('timeout');\n\n    this.addDefaultEvents();\n};\n\nmodule.exports = WebsocketProvider;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-providers-ws/src/index.js\n// module id = 792\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-providers-ws/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(93);\nvar Subscriptions = __webpack_require__(179).subscriptions;\nvar Method = __webpack_require__(92);\n// var formatters = require('web3-core-helpers').formatters;\nvar Net = __webpack_require__(180);\n\n\nvar Shh = function Shh() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // overwrite setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function () {\n        setProvider.apply(_this, arguments);\n        _this.net.setProvider.apply(_this, arguments);\n    };\n\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\n\n    this.net = new Net(this.currentProvider);\n\n\n    [\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'shh',\n            subscriptions: {\n                'messages': {\n                    params: 1\n                    // inputFormatter: [formatters.inputPostFormatter],\n                    // outputFormatter: formatters.outputPostFormatter\n                }\n            }\n        }),\n\n        new Method({\n            name: 'getVersion',\n            call: 'shh_version',\n            params: 0\n        }),\n        new Method({\n            name: 'getInfo',\n            call: 'shh_info',\n            params: 0\n        }),\n        new Method({\n            name: 'setMaxMessageSize',\n            call: 'shh_setMaxMessageSize',\n            params: 1\n        }),\n        new Method({\n            name: 'setMinPoW',\n            call: 'shh_setMinPoW',\n            params: 1\n        }),\n        new Method({\n            name: 'markTrustedPeer',\n            call: 'shh_markTrustedPeer',\n            params: 1\n        }),\n        new Method({\n            name: 'newKeyPair',\n            call: 'shh_newKeyPair',\n            params: 0\n        }),\n        new Method({\n            name: 'addPrivateKey',\n            call: 'shh_addPrivateKey',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteKeyPair',\n            call: 'shh_deleteKeyPair',\n            params: 1\n        }),\n        new Method({\n            name: 'hasKeyPair',\n            call: 'shh_hasKeyPair',\n            params: 1\n        }),\n        new Method({\n            name: 'getPublicKey',\n            call: 'shh_getPublicKey',\n            params: 1\n        }),\n        new Method({\n            name: 'getPrivateKey',\n            call: 'shh_getPrivateKey',\n            params: 1\n        }),\n        new Method({\n            name: 'newSymKey',\n            call: 'shh_newSymKey',\n            params: 0\n        }),\n        new Method({\n            name: 'addSymKey',\n            call: 'shh_addSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'generateSymKeyFromPassword',\n            call: 'shh_generateSymKeyFromPassword',\n            params: 1\n        }),\n        new Method({\n            name: 'hasSymKey',\n            call: 'shh_hasSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'getSymKey',\n            call: 'shh_getSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteSymKey',\n            call: 'shh_deleteSymKey',\n            params: 1\n        }),\n\n        new Method({\n            name: 'newMessageFilter',\n            call: 'shh_newMessageFilter',\n            params: 1\n        }),\n        new Method({\n            name: 'getFilterMessages',\n            call: 'shh_getFilterMessages',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteMessageFilter',\n            call: 'shh_deleteMessageFilter',\n            params: 1\n        }),\n\n        new Method({\n            name: 'post',\n            call: 'shh_post',\n            params: 1,\n            inputFormatter: [null]\n        })\n    ].forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n    });\n};\n\ncore.addProviders(Shh);\n\n\n\nmodule.exports = Shh;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-shh/src/index.js\n// module id = 793\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-shh/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file soliditySha3.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar BN = __webpack_require__(141);\nvar utils = __webpack_require__(392);\n\n\nvar _elementaryName = function (name) {\n    /*jshint maxcomplexity:false */\n\n    if (name.startsWith('int[')) {\n        return 'int256' + name.slice(3);\n    } else if (name === 'int') {\n        return 'int256';\n    } else if (name.startsWith('uint[')) {\n        return 'uint256' + name.slice(4);\n    } else if (name === 'uint') {\n        return 'uint256';\n    } else if (name.startsWith('fixed[')) {\n        return 'fixed128x128' + name.slice(5);\n    } else if (name === 'fixed') {\n        return 'fixed128x128';\n    } else if (name.startsWith('ufixed[')) {\n        return 'ufixed128x128' + name.slice(6);\n    } else if (name === 'ufixed') {\n        return 'ufixed128x128';\n    }\n    return name;\n};\n\n// Parse N from type<N>\nvar _parseTypeN = function (type) {\n    var typesize = /^\\D+(\\d+).*$/.exec(type);\n    return typesize ? parseInt(typesize[1], 10) : null;\n};\n\n// Parse N from type[<N>]\nvar _parseTypeNArray = function (type) {\n    var arraySize = /^\\D+\\d*\\[(\\d+)\\]$/.exec(type);\n    return arraySize ? parseInt(arraySize[1], 10) : null;\n};\n\nvar _parseNumber = function (arg) {\n    var type = typeof arg;\n    if (type === 'string') {\n        if (utils.isHexStrict(arg)) {\n            return new BN(arg.replace(/0x/i,''), 16);\n        } else {\n            return new BN(arg, 10);\n        }\n    } else if (type === 'number') {\n        return new BN(arg);\n    } else if (utils.isBigNumber(arg)) {\n        return new BN(arg.toString(10));\n    } else if (utils.isBN(arg)) {\n        return arg;\n    } else {\n        throw new Error(arg +' is not a number');\n    }\n};\n\nvar _solidityPack = function (type, value, arraySize) {\n    /*jshint maxcomplexity:false */\n\n    var size, num;\n    type = _elementaryName(type);\n\n\n    if (type === 'bytes') {\n\n        if (value.replace(/^0x/i,'').length % 2 !== 0) {\n            throw new Error('Invalid bytes characters '+ value.length);\n        }\n\n        return value;\n    } else if (type === 'string') {\n        return utils.utf8ToHex(value);\n    } else if (type === 'bool') {\n        return value ? '01' : '00';\n    } else if (type.startsWith('address')) {\n        if(arraySize) {\n            size = 64;\n        } else {\n            size = 40;\n        }\n\n        if(!utils.isAddress(value)) {\n            throw new Error(value +' is not a valid address, or the checksum is invalid.');\n        }\n\n        return utils.leftPad(value.toLowerCase(), size);\n    }\n\n    size = _parseTypeN(type);\n\n    if (type.startsWith('bytes')) {\n\n        if(!size) {\n            throw new Error('bytes[] not yet supported in solidity');\n        }\n\n        // must be 32 byte slices when in an array\n        if(arraySize) {\n            size = 32;\n        }\n\n        if (size < 1 || size > 32 || size < value.replace(/^0x/i,'').length / 2 ) {\n            throw new Error('Invalid bytes' + size +' for '+ value);\n        }\n\n        return utils.rightPad(value, size * 2);\n    } else if (type.startsWith('uint')) {\n\n        if ((size % 8) || (size < 8) || (size > 256)) {\n            throw new Error('Invalid uint'+size+' size');\n        }\n\n        num = _parseNumber(value);\n        if (num.bitLength() > size) {\n            throw new Error('Supplied uint exceeds width: ' + size + ' vs ' + num.bitLength());\n        }\n\n        if(num.lt(new BN(0))) {\n            throw new Error('Supplied uint '+ num.toString() +' is negative');\n        }\n\n        return size ? utils.leftPad(num.toString('hex'), size/8 * 2) : num;\n    } else if (type.startsWith('int')) {\n\n        if ((size % 8) || (size < 8) || (size > 256)) {\n            throw new Error('Invalid int'+size+' size');\n        }\n\n        num = _parseNumber(value);\n        if (num.bitLength() > size) {\n            throw new Error('Supplied int exceeds width: ' + size + ' vs ' + num.bitLength());\n        }\n\n        if(num.lt(new BN(0))) {\n            return num.toTwos(size).toString('hex');\n        } else {\n            return size ? utils.leftPad(num.toString('hex'), size/8 * 2) : num;\n        }\n\n    } else {\n        // FIXME: support all other types\n        throw new Error('Unsupported or invalid type: ' + type);\n    }\n};\n\n\nvar _processSoliditySha3Args = function (arg) {\n    /*jshint maxcomplexity:false */\n\n    if(_.isArray(arg)) {\n        throw new Error('Autodetection of array types is not supported.');\n    }\n\n    var type, value = '';\n    var hexArg, arraySize;\n\n    // if type is given\n    if (_.isObject(arg) && (arg.hasOwnProperty('v') || arg.hasOwnProperty('t') || arg.hasOwnProperty('value') || arg.hasOwnProperty('type'))) {\n        type = arg.hasOwnProperty('t') ? arg.t : arg.type;\n        value = arg.hasOwnProperty('v') ? arg.v : arg.value;\n\n    // otherwise try to guess the type\n    } else {\n\n        type = utils.toHex(arg, true);\n        value = utils.toHex(arg);\n\n        if (!type.startsWith('int') && !type.startsWith('uint')) {\n            type = 'bytes';\n        }\n    }\n\n    if ((type.startsWith('int') || type.startsWith('uint')) &&  typeof value === 'string' && !/^(-)?0x/i.test(value)) {\n        value = new BN(value);\n    }\n\n    // get the array size\n    if(_.isArray(value)) {\n        arraySize = _parseTypeNArray(type);\n        if(arraySize && value.length !== arraySize) {\n            throw new Error(type +' is not matching the given array '+ JSON.stringify(value));\n        } else {\n            arraySize = value.length;\n        }\n    }\n\n\n    if (_.isArray(value)) {\n        hexArg = value.map(function (val) {\n            return _solidityPack(type, val, arraySize).toString('hex').replace('0x','');\n        });\n        return hexArg.join('');\n    } else {\n        hexArg = _solidityPack(type, value, arraySize);\n        return hexArg.toString('hex').replace('0x','');\n    }\n\n};\n\n/**\n * Hashes solidity values to a sha3 hash using keccak 256\n *\n * @method soliditySha3\n * @return {Object} the sha3\n */\nvar soliditySha3 = function () {\n    /*jshint maxcomplexity:false */\n\n    var args = Array.prototype.slice.call(arguments);\n\n    var hexArgs = _.map(args, _processSoliditySha3Args);\n\n    // console.log(args, hexArgs);\n    // console.log('0x'+ hexArgs.join(''));\n\n    return utils.sha3('0x'+ hexArgs.join(''));\n};\n\n\nmodule.exports = soliditySha3;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3-utils/src/soliditySha3.js\n// module id = 794\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3-utils/src/soliditySha3.js")},function(module,exports){eval('module.exports = {"_from":"web3@^1.0.0-beta.33","_id":"web3@1.0.0-beta.34","_inBundle":false,"_integrity":"sha1-NH5WG3hAmMtVYzFfSQR5odkfKrE=","_location":"/dc-messaging/web3","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"web3@^1.0.0-beta.33","name":"web3","escapedName":"web3","rawSpec":"^1.0.0-beta.33","saveSpec":null,"fetchSpec":"^1.0.0-beta.33"},"_requiredBy":["/dc-messaging"],"_resolved":"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.34.tgz","_shasum":"347e561b784098cb5563315f490479a1d91f2ab1","_spec":"web3@^1.0.0-beta.33","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/dc-messaging","author":{"name":"ethereum.org"},"authors":[{"name":"Fabian Vogelsteller","email":"fabian@ethereum.org","homepage":"http://frozeman.de"},{"name":"Marek Kotewicz","email":"marek@parity.io","url":"https://github.com/debris"},{"name":"Marian Oancea","url":"https://github.com/cubedro"},{"name":"Gav Wood","email":"g@parity.io","homepage":"http://gavwood.com"},{"name":"Jeffery Wilcke","email":"jeffrey.wilcke@ethereum.org","url":"https://github.com/obscuren"}],"bugs":{"url":"https://github.com/ethereum/web3.js/issues"},"bundleDependencies":false,"dependencies":{"web3-bzz":"1.0.0-beta.34","web3-core":"1.0.0-beta.34","web3-eth":"1.0.0-beta.34","web3-eth-personal":"1.0.0-beta.34","web3-net":"1.0.0-beta.34","web3-shh":"1.0.0-beta.34","web3-utils":"1.0.0-beta.34"},"deprecated":false,"description":"Ethereum JavaScript API","keywords":["Ethereum","JavaScript","API"],"license":"LGPL-3.0","main":"src/index.js","name":"web3","namespace":"ethereum","repository":{"type":"git","url":"https://github.com/ethereum/web3.js/tree/master/packages/web3"},"types":"index.d.ts","version":"1.0.0-beta.34"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3/package.json\n// module id = 795\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3/package.json')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n *   Gav Wood <gav@parity.io>\n *   Jeffrey Wilcke <jeffrey.wilcke@ethereum.org>\n *   Marek Kotewicz <marek@parity.io>\n *   Marian Oancea <marian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar version = __webpack_require__(795).version;\nvar core = __webpack_require__(93);\nvar Eth = __webpack_require__(789);\nvar Net = __webpack_require__(180);\nvar Personal = __webpack_require__(391);\nvar Shh = __webpack_require__(793);\nvar Bzz = __webpack_require__(769);\nvar utils = __webpack_require__(48);\n\nvar Web3 = function Web3() {\n    var _this = this;\n\n    // sets _requestmanager etc\n    core.packageInit(this, arguments);\n\n    this.version = version;\n    this.utils = utils;\n\n    this.eth = new Eth(this);\n    this.shh = new Shh(this);\n    this.bzz = new Bzz(this);\n\n    // overwrite package setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function (provider, net) {\n        setProvider.apply(_this, arguments);\n\n        this.eth.setProvider(provider, net);\n        this.shh.setProvider(provider, net);\n        this.bzz.setProvider(provider);\n\n        return true;\n    };\n};\n\nWeb3.version = version;\nWeb3.utils = utils;\nWeb3.modules = {\n    Eth: Eth,\n    Net: Net,\n    Personal: Personal,\n    Shh: Shh,\n    Bzz: Bzz\n};\n\ncore.addProviders(Web3);\n\nmodule.exports = Web3;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/web3/src/index.js\n// module id = 796\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/web3/src/index.js")},function(module,exports,__webpack_require__){eval("var _global = (function() { return this || {}; })();\nvar NativeWebSocket = _global.WebSocket || _global.MozWebSocket;\nvar websocket_version = __webpack_require__(798);\n\n\n/**\n * Expose a W3C WebSocket class with just one or two arguments.\n */\nfunction W3CWebSocket(uri, protocols) {\n\tvar native_instance;\n\n\tif (protocols) {\n\t\tnative_instance = new NativeWebSocket(uri, protocols);\n\t}\n\telse {\n\t\tnative_instance = new NativeWebSocket(uri);\n\t}\n\n\t/**\n\t * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket\n\t * class). Since it is an Object it will be returned as it is when creating an\n\t * instance of W3CWebSocket via 'new W3CWebSocket()'.\n\t *\n\t * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2\n\t */\n\treturn native_instance;\n}\nif (NativeWebSocket) {\n\t['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'].forEach(function(prop) {\n\t\tObject.defineProperty(W3CWebSocket, prop, {\n\t\t\tget: function() { return NativeWebSocket[prop]; }\n\t\t});\n\t});\n}\n\n/**\n * Module exports.\n */\nmodule.exports = {\n    'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,\n    'version'      : websocket_version\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/websocket/lib/browser.js\n// module id = 797\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/websocket/lib/browser.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(799).version;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/websocket/lib/version.js\n// module id = 798\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/websocket/lib/version.js")},function(module,exports){eval('module.exports = {"_from":"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible","_id":"websocket@1.0.26","_inBundle":false,"_location":"/dc-messaging/websocket","_phantomChildren":{"ms":"2.0.0"},"_requested":{"type":"git","raw":"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible","name":"websocket","escapedName":"websocket","rawSpec":"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible","saveSpec":"git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible","fetchSpec":"git://github.com/frozeman/WebSocket-Node.git","gitCommittish":"browserifyCompatible"},"_requiredBy":["/dc-messaging/web3-providers-ws"],"_resolved":"git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2","_spec":"websocket@git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/dc-messaging/node_modules/web3-providers-ws","author":{"name":"Brian McKelvey","email":"brian@worlize.com","url":"https://www.worlize.com/"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/theturtle32/WebSocket-Node/issues"},"bundleDependencies":false,"config":{"verbose":false},"contributors":[{"name":"Iñaki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"debug":"^2.2.0","nan":"^2.3.3","typedarray-to-buffer":"^3.1.2","yaeti":"^0.0.6"},"deprecated":false,"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.0.1"},"directories":{"lib":"./lib"},"engines":{"node":">=0.10.0"},"homepage":"https://github.com/theturtle32/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","name":"websocket","repository":{"type":"git","url":"git+https://github.com/theturtle32/WebSocket-Node.git"},"scripts":{"gulp":"gulp","install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit"},"version":"1.0.26"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dc-messaging/~/websocket/package.json\n// module id = 799\n// module chunks = 0\n\n//# sourceURL=../node_modules/dc-messaging/node_modules/websocket/package.json')},function(module,exports,__webpack_require__){eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(471);\n\n/**\n * Active `debug` instances.\n */\nexports.instances = [];\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n  var hash = 0, i;\n\n  for (i in namespace) {\n    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\n    hash |= 0; // Convert to 32bit integer\n  }\n\n  return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n  var prevTime;\n\n  function debug() {\n    // disabled?\n    if (!debug.enabled) return;\n\n    var self = debug;\n\n    // set `diff` timestamp\n    var curr = +new Date();\n    var ms = curr - (prevTime || curr);\n    self.diff = ms;\n    self.prev = prevTime;\n    self.curr = curr;\n    prevTime = curr;\n\n    // turn the `arguments` into a proper Array\n    var args = new Array(arguments.length);\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i];\n    }\n\n    args[0] = exports.coerce(args[0]);\n\n    if ('string' !== typeof args[0]) {\n      // anything else let's inspect with %O\n      args.unshift('%O');\n    }\n\n    // apply any `formatters` transformations\n    var index = 0;\n    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n      // if we encounter an escaped % then don't increase the array index\n      if (match === '%%') return match;\n      index++;\n      var formatter = exports.formatters[format];\n      if ('function' === typeof formatter) {\n        var val = args[index];\n        match = formatter.call(self, val);\n\n        // now we need to remove `args[index]` since it's inlined in the `format`\n        args.splice(index, 1);\n        index--;\n      }\n      return match;\n    });\n\n    // apply env-specific formatting (colors, etc.)\n    exports.formatArgs.call(self, args);\n\n    var logFn = debug.log || exports.log || console.log.bind(console);\n    logFn.apply(self, args);\n  }\n\n  debug.namespace = namespace;\n  debug.enabled = exports.enabled(namespace);\n  debug.useColors = exports.useColors();\n  debug.color = selectColor(namespace);\n  debug.destroy = destroy;\n\n  // env-specific initialization logic for debug instances\n  if ('function' === typeof exports.init) {\n    exports.init(debug);\n  }\n\n  exports.instances.push(debug);\n\n  return debug;\n}\n\nfunction destroy () {\n  var index = exports.instances.indexOf(this);\n  if (index !== -1) {\n    exports.instances.splice(index, 1);\n    return true;\n  } else {\n    return false;\n  }\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n  exports.save(namespaces);\n\n  exports.names = [];\n  exports.skips = [];\n\n  var i;\n  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n  var len = split.length;\n\n  for (i = 0; i < len; i++) {\n    if (!split[i]) continue; // ignore empty strings\n    namespaces = split[i].replace(/\\*/g, '.*?');\n    if (namespaces[0] === '-') {\n      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n    } else {\n      exports.names.push(new RegExp('^' + namespaces + '$'));\n    }\n  }\n\n  for (i = 0; i < exports.instances.length; i++) {\n    var instance = exports.instances[i];\n    instance.enabled = exports.enabled(instance.namespace);\n  }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n  exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n  if (name[name.length - 1] === '*') {\n    return true;\n  }\n  var i, len;\n  for (i = 0, len = exports.skips.length; i < len; i++) {\n    if (exports.skips[i].test(name)) {\n      return false;\n    }\n  }\n  for (i = 0, len = exports.names.length; i < len; i++) {\n    if (exports.names[i].test(name)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n  if (val instanceof Error) return val.stack || val.message;\n  return val;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/debug/src/debug.js\n// module id = 800\n// module chunks = 0\n\n//# sourceURL=../node_modules/debug/src/debug.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar token = '%[a-f0-9]{2}';\nvar singleMatcher = new RegExp(token, 'gi');\nvar multiMatcher = new RegExp('(' + token + ')+', 'gi');\n\nfunction decodeComponents(components, split) {\n\ttry {\n\t\t// Try to decode the entire string first\n\t\treturn decodeURIComponent(components.join(''));\n\t} catch (err) {\n\t\t// Do nothing\n\t}\n\n\tif (components.length === 1) {\n\t\treturn components;\n\t}\n\n\tsplit = split || 1;\n\n\t// Split the array in 2 parts\n\tvar left = components.slice(0, split);\n\tvar right = components.slice(split);\n\n\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\n}\n\nfunction decode(input) {\n\ttry {\n\t\treturn decodeURIComponent(input);\n\t} catch (err) {\n\t\tvar tokens = input.match(singleMatcher);\n\n\t\tfor (var i = 1; i < tokens.length; i++) {\n\t\t\tinput = decodeComponents(tokens, i).join('');\n\n\t\t\ttokens = input.match(singleMatcher);\n\t\t}\n\n\t\treturn input;\n\t}\n}\n\nfunction customDecodeURIComponent(input) {\n\t// Keep track of all the replacements and prefill the map with the `BOM`\n\tvar replaceMap = {\n\t\t'%FE%FF': '\\uFFFD\\uFFFD',\n\t\t'%FF%FE': '\\uFFFD\\uFFFD'\n\t};\n\n\tvar match = multiMatcher.exec(input);\n\twhile (match) {\n\t\ttry {\n\t\t\t// Decode as big chunks as possible\n\t\t\treplaceMap[match[0]] = decodeURIComponent(match[0]);\n\t\t} catch (err) {\n\t\t\tvar result = decode(match[0]);\n\n\t\t\tif (result !== match[0]) {\n\t\t\t\treplaceMap[match[0]] = result;\n\t\t\t}\n\t\t}\n\n\t\tmatch = multiMatcher.exec(input);\n\t}\n\n\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\n\treplaceMap['%C2'] = '\\uFFFD';\n\n\tvar entries = Object.keys(replaceMap);\n\n\tfor (var i = 0; i < entries.length; i++) {\n\t\t// Replace all decoded components\n\t\tvar key = entries[i];\n\t\tinput = input.replace(new RegExp(key, 'g'), replaceMap[key]);\n\t}\n\n\treturn input;\n}\n\nmodule.exports = function (encodedURI) {\n\tif (typeof encodedURI !== 'string') {\n\t\tthrow new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');\n\t}\n\n\ttry {\n\t\tencodedURI = encodedURI.replace(/\\+/g, ' ');\n\n\t\t// Try the built in decoder first\n\t\treturn decodeURIComponent(encodedURI);\n\t} catch (err) {\n\t\t// Fallback to a more advanced decoder\n\t\treturn customDecodeURIComponent(encodedURI);\n\t}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/decode-uri-component/index.js\n// module id = 801\n// module chunks = 0\n\n//# sourceURL=../node_modules/decode-uri-component/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n    return Array.isArray(val) ? [] : {}\n}\n\nfunction cloneIfNecessary(value, optionsArgument) {\n    var clone = optionsArgument && optionsArgument.clone === true;\n    return (clone && isMergeableObject(value)) ? deepmerge(emptyTarget(value), value, optionsArgument) : value\n}\n\nfunction defaultArrayMerge(target, source, optionsArgument) {\n    var destination = target.slice();\n    source.forEach(function(e, i) {\n        if (typeof destination[i] === 'undefined') {\n            destination[i] = cloneIfNecessary(e, optionsArgument);\n        } else if (isMergeableObject(e)) {\n            destination[i] = deepmerge(target[i], e, optionsArgument);\n        } else if (target.indexOf(e) === -1) {\n            destination.push(cloneIfNecessary(e, optionsArgument));\n        }\n    });\n    return destination\n}\n\nfunction mergeObject(target, source, optionsArgument) {\n    var destination = {};\n    if (isMergeableObject(target)) {\n        Object.keys(target).forEach(function(key) {\n            destination[key] = cloneIfNecessary(target[key], optionsArgument);\n        });\n    }\n    Object.keys(source).forEach(function(key) {\n        if (!isMergeableObject(source[key]) || !target[key]) {\n            destination[key] = cloneIfNecessary(source[key], optionsArgument);\n        } else {\n            destination[key] = deepmerge(target[key], source[key], optionsArgument);\n        }\n    });\n    return destination\n}\n\nfunction deepmerge(target, source, optionsArgument) {\n    var sourceIsArray = Array.isArray(source);\n    var targetIsArray = Array.isArray(target);\n    var options = optionsArgument || { arrayMerge: defaultArrayMerge };\n    var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n    if (!sourceAndTargetTypesMatch) {\n        return cloneIfNecessary(source, optionsArgument)\n    } else if (sourceIsArray) {\n        var arrayMerge = options.arrayMerge || defaultArrayMerge;\n        return arrayMerge(target, source, optionsArgument)\n    } else {\n        return mergeObject(target, source, optionsArgument)\n    }\n}\n\ndeepmerge.all = function deepmergeAll(array, optionsArgument) {\n    if (!Array.isArray(array) || array.length < 2) {\n        throw new Error('first argument should be an array with at least two elements')\n    }\n\n    // we are sure there are at least 2 values, so it is safe to have no initial value\n    return array.reduce(function(prev, next) {\n        return deepmerge(prev, next, optionsArgument)\n    })\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deepmerge/dist/cjs.js\n// module id = 802\n// module chunks = 0\n\n//# sourceURL=../node_modules/deepmerge/dist/cjs.js")},function(module,exports,__webpack_require__){eval("var util = __webpack_require__(104)\n  , AbstractIterator = __webpack_require__(398).AbstractIterator\n\n\nfunction DeferredIterator (options) {\n  AbstractIterator.call(this, options)\n\n  this._options = options\n  this._iterator = null\n  this._operations = []\n}\n\nutil.inherits(DeferredIterator, AbstractIterator)\n\nDeferredIterator.prototype.setDb = function (db) {\n  var it = this._iterator = db.iterator(this._options)\n  this._operations.forEach(function (op) {\n    it[op.method].apply(it, op.args)\n  })\n}\n\nDeferredIterator.prototype._operation = function (method, args) {\n  if (this._iterator)\n    return this._iterator[method].apply(this._iterator, args)\n  this._operations.push({ method: method, args: args })\n}\n\n'next end'.split(' ').forEach(function (m) {\n  DeferredIterator.prototype['_' + m] = function () {\n    this._operation(m, arguments)\n  }\n})\n\nmodule.exports = DeferredIterator;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/deferred-iterator.js\n// module id = 803\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/deferred-iterator.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process, Buffer) {var util              = __webpack_require__(104)\n  , AbstractLevelDOWN = __webpack_require__(398).AbstractLevelDOWN\n  , DeferredIterator  = __webpack_require__(803)\n\nfunction DeferredLevelDOWN (location) {\n  AbstractLevelDOWN.call(this, typeof location == 'string' ? location : '') // optional location, who cares?\n  this._db         = undefined\n  this._operations = []\n  this._iterators  = []\n}\n\nutil.inherits(DeferredLevelDOWN, AbstractLevelDOWN)\n\n// called by LevelUP when we have a real DB to take its place\nDeferredLevelDOWN.prototype.setDb = function (db) {\n  this._db = db\n  this._operations.forEach(function (op) {\n    db[op.method].apply(db, op.args)\n  })\n  this._iterators.forEach(function (it) {\n    it.setDb(db)\n  })\n}\n\nDeferredLevelDOWN.prototype._open = function (options, callback) {\n  return process.nextTick(callback)\n}\n\n// queue a new deferred operation\nDeferredLevelDOWN.prototype._operation = function (method, args) {\n  if (this._db)\n    return this._db[method].apply(this._db, args)\n  this._operations.push({ method: method, args: args })\n}\n\n// deferrables\n'put get del batch approximateSize'.split(' ').forEach(function (m) {\n  DeferredLevelDOWN.prototype['_' + m] = function () {\n    this._operation(m, arguments)\n  }\n})\n\nDeferredLevelDOWN.prototype._isBuffer = function (obj) {\n  return Buffer.isBuffer(obj)\n}\n\nDeferredLevelDOWN.prototype._iterator = function (options) {\n  if (this._db)\n    return this._db.iterator.apply(this._db, arguments)\n  var it = new DeferredIterator(options)\n  this._iterators.push(it)\n  return it\n}\n\nmodule.exports                  = DeferredLevelDOWN\nmodule.exports.DeferredIterator = DeferredIterator\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/deferred-leveldown.js\n// module id = 804\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/deferred-leveldown.js")},function(module,exports,__webpack_require__){eval("var AbstractLevelDOWN = __webpack_require__(397)\n\nfunction isLevelDOWN (db) {\n  if (!db || typeof db !== 'object')\n    return false\n  return Object.keys(AbstractLevelDOWN.prototype).filter(function (name) {\n    // TODO remove approximateSize check when method is gone\n    return name[0] != '_' && name != 'approximateSize'\n  }).every(function (name) {\n    return typeof db[name] == 'function'\n  })\n}\n\nmodule.exports = isLevelDOWN\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/deferred-leveldown/~/abstract-leveldown/is-leveldown.js\n// module id = 805\n// module chunks = 0\n\n//# sourceURL=../node_modules/deferred-leveldown/node_modules/abstract-leveldown/is-leveldown.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assert = __webpack_require__(43);\nvar inherits = __webpack_require__(3);\n\nvar proto = {};\n\nfunction CBCState(iv) {\n  assert.equal(iv.length, 8, 'Invalid IV length');\n\n  this.iv = new Array(8);\n  for (var i = 0; i < this.iv.length; i++)\n    this.iv[i] = iv[i];\n}\n\nfunction instantiate(Base) {\n  function CBC(options) {\n    Base.call(this, options);\n    this._cbcInit();\n  }\n  inherits(CBC, Base);\n\n  var keys = Object.keys(proto);\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    CBC.prototype[key] = proto[key];\n  }\n\n  CBC.create = function create(options) {\n    return new CBC(options);\n  };\n\n  return CBC;\n}\n\nexports.instantiate = instantiate;\n\nproto._cbcInit = function _cbcInit() {\n  var state = new CBCState(this.options.iv);\n  this._cbcState = state;\n};\n\nproto._update = function _update(inp, inOff, out, outOff) {\n  var state = this._cbcState;\n  var superProto = this.constructor.super_.prototype;\n\n  var iv = state.iv;\n  if (this.type === 'encrypt') {\n    for (var i = 0; i < this.blockSize; i++)\n      iv[i] ^= inp[inOff + i];\n\n    superProto._update.call(this, iv, 0, out, outOff);\n\n    for (var i = 0; i < this.blockSize; i++)\n      iv[i] = out[outOff + i];\n  } else {\n    superProto._update.call(this, inp, inOff, out, outOff);\n\n    for (var i = 0; i < this.blockSize; i++)\n      out[outOff + i] ^= iv[i];\n\n    for (var i = 0; i < this.blockSize; i++)\n      iv[i] = inp[inOff + i];\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des/cbc.js\n// module id = 806\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des/cbc.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assert = __webpack_require__(43);\n\nfunction Cipher(options) {\n  this.options = options;\n\n  this.type = this.options.type;\n  this.blockSize = 8;\n  this._init();\n\n  this.buffer = new Array(this.blockSize);\n  this.bufferOff = 0;\n}\nmodule.exports = Cipher;\n\nCipher.prototype._init = function _init() {\n  // Might be overrided\n};\n\nCipher.prototype.update = function update(data) {\n  if (data.length === 0)\n    return [];\n\n  if (this.type === 'decrypt')\n    return this._updateDecrypt(data);\n  else\n    return this._updateEncrypt(data);\n};\n\nCipher.prototype._buffer = function _buffer(data, off) {\n  // Append data to buffer\n  var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);\n  for (var i = 0; i < min; i++)\n    this.buffer[this.bufferOff + i] = data[off + i];\n  this.bufferOff += min;\n\n  // Shift next\n  return min;\n};\n\nCipher.prototype._flushBuffer = function _flushBuffer(out, off) {\n  this._update(this.buffer, 0, out, off);\n  this.bufferOff = 0;\n  return this.blockSize;\n};\n\nCipher.prototype._updateEncrypt = function _updateEncrypt(data) {\n  var inputOff = 0;\n  var outputOff = 0;\n\n  var count = ((this.bufferOff + data.length) / this.blockSize) | 0;\n  var out = new Array(count * this.blockSize);\n\n  if (this.bufferOff !== 0) {\n    inputOff += this._buffer(data, inputOff);\n\n    if (this.bufferOff === this.buffer.length)\n      outputOff += this._flushBuffer(out, outputOff);\n  }\n\n  // Write blocks\n  var max = data.length - ((data.length - inputOff) % this.blockSize);\n  for (; inputOff < max; inputOff += this.blockSize) {\n    this._update(data, inputOff, out, outputOff);\n    outputOff += this.blockSize;\n  }\n\n  // Queue rest\n  for (; inputOff < data.length; inputOff++, this.bufferOff++)\n    this.buffer[this.bufferOff] = data[inputOff];\n\n  return out;\n};\n\nCipher.prototype._updateDecrypt = function _updateDecrypt(data) {\n  var inputOff = 0;\n  var outputOff = 0;\n\n  var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;\n  var out = new Array(count * this.blockSize);\n\n  // TODO(indutny): optimize it, this is far from optimal\n  for (; count > 0; count--) {\n    inputOff += this._buffer(data, inputOff);\n    outputOff += this._flushBuffer(out, outputOff);\n  }\n\n  // Buffer rest of the input\n  inputOff += this._buffer(data, inputOff);\n\n  return out;\n};\n\nCipher.prototype.final = function final(buffer) {\n  var first;\n  if (buffer)\n    first = this.update(buffer);\n\n  var last;\n  if (this.type === 'encrypt')\n    last = this._finalEncrypt();\n  else\n    last = this._finalDecrypt();\n\n  if (first)\n    return first.concat(last);\n  else\n    return last;\n};\n\nCipher.prototype._pad = function _pad(buffer, off) {\n  if (off === 0)\n    return false;\n\n  while (off < buffer.length)\n    buffer[off++] = 0;\n\n  return true;\n};\n\nCipher.prototype._finalEncrypt = function _finalEncrypt() {\n  if (!this._pad(this.buffer, this.bufferOff))\n    return [];\n\n  var out = new Array(this.blockSize);\n  this._update(this.buffer, 0, out, 0);\n  return out;\n};\n\nCipher.prototype._unpad = function _unpad(buffer) {\n  return buffer;\n};\n\nCipher.prototype._finalDecrypt = function _finalDecrypt() {\n  assert.equal(this.bufferOff, this.blockSize, 'Not enough data to decrypt');\n  var out = new Array(this.blockSize);\n  this._flushBuffer(out, 0);\n\n  return this._unpad(out);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des/cipher.js\n// module id = 807\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des/cipher.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assert = __webpack_require__(43);\nvar inherits = __webpack_require__(3);\n\nvar des = __webpack_require__(256);\nvar utils = des.utils;\nvar Cipher = des.Cipher;\n\nfunction DESState() {\n  this.tmp = new Array(2);\n  this.keys = null;\n}\n\nfunction DES(options) {\n  Cipher.call(this, options);\n\n  var state = new DESState();\n  this._desState = state;\n\n  this.deriveKeys(state, options.key);\n}\ninherits(DES, Cipher);\nmodule.exports = DES;\n\nDES.create = function create(options) {\n  return new DES(options);\n};\n\nvar shiftTable = [\n  1, 1, 2, 2, 2, 2, 2, 2,\n  1, 2, 2, 2, 2, 2, 2, 1\n];\n\nDES.prototype.deriveKeys = function deriveKeys(state, key) {\n  state.keys = new Array(16 * 2);\n\n  assert.equal(key.length, this.blockSize, 'Invalid key length');\n\n  var kL = utils.readUInt32BE(key, 0);\n  var kR = utils.readUInt32BE(key, 4);\n\n  utils.pc1(kL, kR, state.tmp, 0);\n  kL = state.tmp[0];\n  kR = state.tmp[1];\n  for (var i = 0; i < state.keys.length; i += 2) {\n    var shift = shiftTable[i >>> 1];\n    kL = utils.r28shl(kL, shift);\n    kR = utils.r28shl(kR, shift);\n    utils.pc2(kL, kR, state.keys, i);\n  }\n};\n\nDES.prototype._update = function _update(inp, inOff, out, outOff) {\n  var state = this._desState;\n\n  var l = utils.readUInt32BE(inp, inOff);\n  var r = utils.readUInt32BE(inp, inOff + 4);\n\n  // Initial Permutation\n  utils.ip(l, r, state.tmp, 0);\n  l = state.tmp[0];\n  r = state.tmp[1];\n\n  if (this.type === 'encrypt')\n    this._encrypt(state, l, r, state.tmp, 0);\n  else\n    this._decrypt(state, l, r, state.tmp, 0);\n\n  l = state.tmp[0];\n  r = state.tmp[1];\n\n  utils.writeUInt32BE(out, l, outOff);\n  utils.writeUInt32BE(out, r, outOff + 4);\n};\n\nDES.prototype._pad = function _pad(buffer, off) {\n  var value = buffer.length - off;\n  for (var i = off; i < buffer.length; i++)\n    buffer[i] = value;\n\n  return true;\n};\n\nDES.prototype._unpad = function _unpad(buffer) {\n  var pad = buffer[buffer.length - 1];\n  for (var i = buffer.length - pad; i < buffer.length; i++)\n    assert.equal(buffer[i], pad);\n\n  return buffer.slice(0, buffer.length - pad);\n};\n\nDES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {\n  var l = lStart;\n  var r = rStart;\n\n  // Apply f() x16 times\n  for (var i = 0; i < state.keys.length; i += 2) {\n    var keyL = state.keys[i];\n    var keyR = state.keys[i + 1];\n\n    // f(r, k)\n    utils.expand(r, state.tmp, 0);\n\n    keyL ^= state.tmp[0];\n    keyR ^= state.tmp[1];\n    var s = utils.substitute(keyL, keyR);\n    var f = utils.permute(s);\n\n    var t = r;\n    r = (l ^ f) >>> 0;\n    l = t;\n  }\n\n  // Reverse Initial Permutation\n  utils.rip(r, l, out, off);\n};\n\nDES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {\n  var l = rStart;\n  var r = lStart;\n\n  // Apply f() x16 times\n  for (var i = state.keys.length - 2; i >= 0; i -= 2) {\n    var keyL = state.keys[i];\n    var keyR = state.keys[i + 1];\n\n    // f(r, k)\n    utils.expand(l, state.tmp, 0);\n\n    keyL ^= state.tmp[0];\n    keyR ^= state.tmp[1];\n    var s = utils.substitute(keyL, keyR);\n    var f = utils.permute(s);\n\n    var t = l;\n    l = (r ^ f) >>> 0;\n    r = t;\n  }\n\n  // Reverse Initial Permutation\n  utils.rip(l, r, out, off);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des/des.js\n// module id = 808\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des/des.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar assert = __webpack_require__(43);\nvar inherits = __webpack_require__(3);\n\nvar des = __webpack_require__(256);\nvar Cipher = des.Cipher;\nvar DES = des.DES;\n\nfunction EDEState(type, key) {\n  assert.equal(key.length, 24, 'Invalid key length');\n\n  var k1 = key.slice(0, 8);\n  var k2 = key.slice(8, 16);\n  var k3 = key.slice(16, 24);\n\n  if (type === 'encrypt') {\n    this.ciphers = [\n      DES.create({ type: 'encrypt', key: k1 }),\n      DES.create({ type: 'decrypt', key: k2 }),\n      DES.create({ type: 'encrypt', key: k3 })\n    ];\n  } else {\n    this.ciphers = [\n      DES.create({ type: 'decrypt', key: k3 }),\n      DES.create({ type: 'encrypt', key: k2 }),\n      DES.create({ type: 'decrypt', key: k1 })\n    ];\n  }\n}\n\nfunction EDE(options) {\n  Cipher.call(this, options);\n\n  var state = new EDEState(this.type, this.options.key);\n  this._edeState = state;\n}\ninherits(EDE, Cipher);\n\nmodule.exports = EDE;\n\nEDE.create = function create(options) {\n  return new EDE(options);\n};\n\nEDE.prototype._update = function _update(inp, inOff, out, outOff) {\n  var state = this._edeState;\n\n  state.ciphers[0]._update(inp, inOff, out, outOff);\n  state.ciphers[1]._update(out, outOff, out, outOff);\n  state.ciphers[2]._update(out, outOff, out, outOff);\n};\n\nEDE.prototype._pad = DES.prototype._pad;\nEDE.prototype._unpad = DES.prototype._unpad;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des/ede.js\n// module id = 809\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des/ede.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.readUInt32BE = function readUInt32BE(bytes, off) {\n  var res =  (bytes[0 + off] << 24) |\n             (bytes[1 + off] << 16) |\n             (bytes[2 + off] << 8) |\n             bytes[3 + off];\n  return res >>> 0;\n};\n\nexports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {\n  bytes[0 + off] = value >>> 24;\n  bytes[1 + off] = (value >>> 16) & 0xff;\n  bytes[2 + off] = (value >>> 8) & 0xff;\n  bytes[3 + off] = value & 0xff;\n};\n\nexports.ip = function ip(inL, inR, out, off) {\n  var outL = 0;\n  var outR = 0;\n\n  for (var i = 6; i >= 0; i -= 2) {\n    for (var j = 0; j <= 24; j += 8) {\n      outL <<= 1;\n      outL |= (inR >>> (j + i)) & 1;\n    }\n    for (var j = 0; j <= 24; j += 8) {\n      outL <<= 1;\n      outL |= (inL >>> (j + i)) & 1;\n    }\n  }\n\n  for (var i = 6; i >= 0; i -= 2) {\n    for (var j = 1; j <= 25; j += 8) {\n      outR <<= 1;\n      outR |= (inR >>> (j + i)) & 1;\n    }\n    for (var j = 1; j <= 25; j += 8) {\n      outR <<= 1;\n      outR |= (inL >>> (j + i)) & 1;\n    }\n  }\n\n  out[off + 0] = outL >>> 0;\n  out[off + 1] = outR >>> 0;\n};\n\nexports.rip = function rip(inL, inR, out, off) {\n  var outL = 0;\n  var outR = 0;\n\n  for (var i = 0; i < 4; i++) {\n    for (var j = 24; j >= 0; j -= 8) {\n      outL <<= 1;\n      outL |= (inR >>> (j + i)) & 1;\n      outL <<= 1;\n      outL |= (inL >>> (j + i)) & 1;\n    }\n  }\n  for (var i = 4; i < 8; i++) {\n    for (var j = 24; j >= 0; j -= 8) {\n      outR <<= 1;\n      outR |= (inR >>> (j + i)) & 1;\n      outR <<= 1;\n      outR |= (inL >>> (j + i)) & 1;\n    }\n  }\n\n  out[off + 0] = outL >>> 0;\n  out[off + 1] = outR >>> 0;\n};\n\nexports.pc1 = function pc1(inL, inR, out, off) {\n  var outL = 0;\n  var outR = 0;\n\n  // 7, 15, 23, 31, 39, 47, 55, 63\n  // 6, 14, 22, 30, 39, 47, 55, 63\n  // 5, 13, 21, 29, 39, 47, 55, 63\n  // 4, 12, 20, 28\n  for (var i = 7; i >= 5; i--) {\n    for (var j = 0; j <= 24; j += 8) {\n      outL <<= 1;\n      outL |= (inR >> (j + i)) & 1;\n    }\n    for (var j = 0; j <= 24; j += 8) {\n      outL <<= 1;\n      outL |= (inL >> (j + i)) & 1;\n    }\n  }\n  for (var j = 0; j <= 24; j += 8) {\n    outL <<= 1;\n    outL |= (inR >> (j + i)) & 1;\n  }\n\n  // 1, 9, 17, 25, 33, 41, 49, 57\n  // 2, 10, 18, 26, 34, 42, 50, 58\n  // 3, 11, 19, 27, 35, 43, 51, 59\n  // 36, 44, 52, 60\n  for (var i = 1; i <= 3; i++) {\n    for (var j = 0; j <= 24; j += 8) {\n      outR <<= 1;\n      outR |= (inR >> (j + i)) & 1;\n    }\n    for (var j = 0; j <= 24; j += 8) {\n      outR <<= 1;\n      outR |= (inL >> (j + i)) & 1;\n    }\n  }\n  for (var j = 0; j <= 24; j += 8) {\n    outR <<= 1;\n    outR |= (inL >> (j + i)) & 1;\n  }\n\n  out[off + 0] = outL >>> 0;\n  out[off + 1] = outR >>> 0;\n};\n\nexports.r28shl = function r28shl(num, shift) {\n  return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));\n};\n\nvar pc2table = [\n  // inL => outL\n  14, 11, 17, 4, 27, 23, 25, 0,\n  13, 22, 7, 18, 5, 9, 16, 24,\n  2, 20, 12, 21, 1, 8, 15, 26,\n\n  // inR => outR\n  15, 4, 25, 19, 9, 1, 26, 16,\n  5, 11, 23, 8, 12, 7, 17, 0,\n  22, 3, 10, 14, 6, 20, 27, 24\n];\n\nexports.pc2 = function pc2(inL, inR, out, off) {\n  var outL = 0;\n  var outR = 0;\n\n  var len = pc2table.length >>> 1;\n  for (var i = 0; i < len; i++) {\n    outL <<= 1;\n    outL |= (inL >>> pc2table[i]) & 0x1;\n  }\n  for (var i = len; i < pc2table.length; i++) {\n    outR <<= 1;\n    outR |= (inR >>> pc2table[i]) & 0x1;\n  }\n\n  out[off + 0] = outL >>> 0;\n  out[off + 1] = outR >>> 0;\n};\n\nexports.expand = function expand(r, out, off) {\n  var outL = 0;\n  var outR = 0;\n\n  outL = ((r & 1) << 5) | (r >>> 27);\n  for (var i = 23; i >= 15; i -= 4) {\n    outL <<= 6;\n    outL |= (r >>> i) & 0x3f;\n  }\n  for (var i = 11; i >= 3; i -= 4) {\n    outR |= (r >>> i) & 0x3f;\n    outR <<= 6;\n  }\n  outR |= ((r & 0x1f) << 1) | (r >>> 31);\n\n  out[off + 0] = outL >>> 0;\n  out[off + 1] = outR >>> 0;\n};\n\nvar sTable = [\n  14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,\n  3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,\n  4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,\n  15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,\n\n  15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,\n  9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,\n  0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,\n  5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,\n\n  10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,\n  1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,\n  13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,\n  11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,\n\n  7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,\n  1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,\n  10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,\n  15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,\n\n  2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,\n  8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,\n  4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,\n  15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,\n\n  12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,\n  0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,\n  9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,\n  7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,\n\n  4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,\n  3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,\n  1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,\n  10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,\n\n  13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,\n  10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,\n  7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,\n  0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11\n];\n\nexports.substitute = function substitute(inL, inR) {\n  var out = 0;\n  for (var i = 0; i < 4; i++) {\n    var b = (inL >>> (18 - i * 6)) & 0x3f;\n    var sb = sTable[i * 0x40 + b];\n\n    out <<= 4;\n    out |= sb;\n  }\n  for (var i = 0; i < 4; i++) {\n    var b = (inR >>> (18 - i * 6)) & 0x3f;\n    var sb = sTable[4 * 0x40 + i * 0x40 + b];\n\n    out <<= 4;\n    out |= sb;\n  }\n  return out >>> 0;\n};\n\nvar permuteTable = [\n  16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,\n  30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7\n];\n\nexports.permute = function permute(num) {\n  var out = 0;\n  for (var i = 0; i < permuteTable.length; i++) {\n    out <<= 1;\n    out |= (num >>> permuteTable[i]) & 0x1;\n  }\n  return out >>> 0;\n};\n\nexports.padSplit = function padSplit(num, size, group) {\n  var str = num.toString(2);\n  while (str.length < size)\n    str = '0' + str;\n\n  var out = [];\n  for (var i = 0; i < size; i += group)\n    out.push(str.slice(i, i + group));\n  return out.join(' ');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/des.js/lib/des/utils.js\n// module id = 810\n// module chunks = 0\n\n//# sourceURL=../node_modules/des.js/lib/des/utils.js")},function(module,__webpack_exports__,__webpack_require__){"use strict";eval('Object.defineProperty(__webpack_exports__, "__esModule", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_dexie__ = __webpack_require__(399);\n/* ========================================================================== \r\n *                           dexie-observable.js\r\n * ==========================================================================\r\n *\r\n * Dexie addon for observing database changes not just on local db instance\r\n * but also on other instances, tabs and windows.\r\n *\r\n * Comprises a base framework for dexie-syncable.js\r\n *\r\n * By David Fahlander, david.fahlander@gmail.com,\r\n *    Nikolas Poniros, https://github.com/nponiros\r\n *\r\n * ==========================================================================\r\n *\r\n * Version {version}, {date}\r\n *\r\n * http://dexie.org\r\n *\r\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\r\n * \r\n */\r\n\n\n\nfunction nop() { }\r\nfunction promisableChain(f1, f2) {\r\n    if (f1 === nop)\r\n        return f2;\r\n    return function () {\r\n        var res = f1.apply(this, arguments);\r\n        if (res && typeof res.then === \'function\') {\r\n            var thiz = this, args = arguments;\r\n            return res.then(function () {\r\n                return f2.apply(thiz, args);\r\n            });\r\n        }\r\n        return f2.apply(this, arguments);\r\n    };\r\n}\r\nfunction createUUID() {\r\n    // Decent solution from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\r\n    var d = Date.now();\r\n    var uuid = \'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\'.replace(/[xy]/g, function (c) {\r\n        var r = (d + Math.random() * 16) % 16 | 0;\r\n        d = Math.floor(d / 16);\r\n        return (c === \'x\' ? r : (r & 0x7 | 0x8)).toString(16);\r\n    });\r\n    return uuid;\r\n}\n\nfunction initOverrideCreateTransaction(db, wakeupObservers) {\r\n    return function overrideCreateTransaction(origFunc) {\r\n        return function (mode, storenames, dbschema, parent) {\r\n            if (db.dynamicallyOpened())\r\n                return origFunc.apply(this, arguments); // Don\'t observe dynamically opened databases.\r\n            var addChanges = false;\r\n            if (mode === \'readwrite\' && storenames.some(function (storeName) {\r\n                return dbschema[storeName] && dbschema[storeName].observable;\r\n            })) {\r\n                // At least one included store is a observable store. Make sure to also include the _changes store.\r\n                addChanges = true;\r\n                storenames = storenames.slice(0); // Clone\r\n                if (storenames.indexOf("_changes") === -1)\r\n                    storenames.push("_changes"); // Otherwise, firefox will hang... (I\'ve reported the bug to Mozilla@Bugzilla)\r\n            }\r\n            // Call original db._createTransaction()\r\n            var trans = origFunc.call(this, mode, storenames, dbschema, parent);\r\n            // If this transaction is bound to any observable table, make sure to add changes when transaction completes.\r\n            if (addChanges) {\r\n                trans._lastWrittenRevision = 0;\r\n                trans.on(\'complete\', function () {\r\n                    if (trans._lastWrittenRevision) {\r\n                        // Changes were written in this transaction.\r\n                        if (!parent) {\r\n                            // This is root-level transaction, i.e. a physical commit has happened.\r\n                            // Delay-trigger a wakeup call:\r\n                            if (wakeupObservers.timeoutHandle)\r\n                                clearTimeout(wakeupObservers.timeoutHandle);\r\n                            wakeupObservers.timeoutHandle = setTimeout(function () {\r\n                                delete wakeupObservers.timeoutHandle;\r\n                                wakeupObservers(trans._lastWrittenRevision);\r\n                            }, 25);\r\n                        }\r\n                        else {\r\n                            // This is just a virtual commit of a sub transaction.\r\n                            // Wait with waking up observers until root transaction has committed.\r\n                            // Make sure to mark root transaction so that it will wakeup observers upon commit.\r\n                            var rootTransaction = (function findRootTransaction(trans) {\r\n                                return trans.parent ? findRootTransaction(trans.parent) : trans;\r\n                            })(parent);\r\n                            rootTransaction._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rootTransaction.lastWrittenRevision || 0);\r\n                        }\r\n                    }\r\n                });\r\n                // Derive "source" property from parent transaction by default\r\n                if (trans.parent && trans.parent.source)\r\n                    trans.source = trans.parent.source;\r\n            }\r\n            return trans;\r\n        };\r\n    };\r\n}\n\nfunction initWakeupObservers(db, Observable, localStorage) {\r\n    return function wakeupObservers(lastWrittenRevision) {\r\n        // Make sure Observable.latestRevision[db.name] is still below our value, now when some time has elapsed and other db instances in same window possibly could have made changes too.\r\n        if (Observable.latestRevision[db.name] < lastWrittenRevision) {\r\n            // Set the static property lastRevision[db.name] to the revision of the last written change.\r\n            Observable.latestRevision[db.name] = lastWrittenRevision;\r\n            // Wakeup ourselves, and any other db instances on this window:\r\n            __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n                Observable.on(\'latestRevisionIncremented\').fire(db.name, lastWrittenRevision);\r\n            });\r\n            // Observable.on.latestRevisionIncremented will only wakeup db\'s in current window.\r\n            // We need a storage event to wakeup other windwos.\r\n            // Since indexedDB lacks storage events, let\'s use the storage event from WebStorage just for\r\n            // the purpose to wakeup db instances in other windows.\r\n            if (localStorage)\r\n                localStorage.setItem(\'Dexie.Observable/latestRevision/\' + db.name, lastWrittenRevision); // In IE, this will also wakeup our own window. However, onLatestRevisionIncremented will work around this by only running once per revision id.\r\n        }\r\n    };\r\n}\n\n// Change Types\r\n// Change Types\r\nvar CREATE = 1;\r\nvar UPDATE = 2;\r\nvar DELETE = 3;\n\nfunction initCreatingHook(db, table) {\r\n    return function creatingHook(primKey, obj, trans) {\r\n        /// <param name="trans" type="db.Transaction"></param>\r\n        var rv = undefined;\r\n        if (primKey === undefined && table.schema.primKey.uuid) {\r\n            primKey = rv = createUUID();\r\n            if (table.schema.primKey.keyPath) {\r\n                __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].setByKeyPath(obj, table.schema.primKey.keyPath, primKey);\r\n            }\r\n        }\r\n        var change = {\r\n            source: trans.source || null,\r\n            table: table.name,\r\n            key: primKey === undefined ? null : primKey,\r\n            type: CREATE,\r\n            obj: obj\r\n        };\r\n        var promise = db._changes.add(change).then(function (rev) {\r\n            trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\r\n            return rev;\r\n        });\r\n        // Wait for onsuccess so that we have the primKey if it is auto-incremented and update the change item if so.\r\n        this.onsuccess = function (resultKey) {\r\n            if (primKey != resultKey)\r\n                promise._then(function () {\r\n                    change.key = resultKey;\r\n                    db._changes.put(change);\r\n                });\r\n        };\r\n        this.onerror = function () {\r\n            // If the main operation fails, make sure to regret the change\r\n            promise._then(function (rev) {\r\n                // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\r\n                db._changes.delete(rev);\r\n            });\r\n        };\r\n        return rv;\r\n    };\r\n}\n\nfunction initUpdatingHook(db, tableName) {\r\n    return function updatingHook(mods, primKey, oldObj, trans) {\r\n        /// <param name="trans" type="db.Transaction"></param>\r\n        // mods may contain property paths with undefined as value if the property\r\n        // is being deleted. Since we cannot persist undefined we need to act\r\n        // like those changes is setting the value to null instead.\r\n        var modsWithoutUndefined = {};\r\n        // As of current Dexie version (1.0.3) hook may be called even if it wouldn\'t really change.\r\n        // Therefore we may do that kind of optimization here - to not add change entries if\r\n        // there\'s nothing to change.\r\n        var anythingChanged = false;\r\n        var newObj = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].deepClone(oldObj);\r\n        for (var propPath in mods) {\r\n            var mod = mods[propPath];\r\n            if (typeof mod === \'undefined\') {\r\n                __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].delByKeyPath(newObj, propPath);\r\n                modsWithoutUndefined[propPath] = null; // Null is as close we could come to deleting a property when not allowing undefined.\r\n                anythingChanged = true;\r\n            }\r\n            else {\r\n                var currentValue = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].getByKeyPath(oldObj, propPath);\r\n                if (mod !== currentValue && JSON.stringify(mod) !== JSON.stringify(currentValue)) {\r\n                    __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].setByKeyPath(newObj, propPath, mod);\r\n                    modsWithoutUndefined[propPath] = mod;\r\n                    anythingChanged = true;\r\n                }\r\n            }\r\n        }\r\n        if (anythingChanged) {\r\n            var change = {\r\n                source: trans.source || null,\r\n                table: tableName,\r\n                key: primKey,\r\n                type: UPDATE,\r\n                mods: modsWithoutUndefined,\r\n                oldObj: oldObj,\r\n                obj: newObj\r\n            };\r\n            var promise = db._changes.add(change); // Just so we get the correct revision order of the update...\r\n            this.onsuccess = function () {\r\n                promise._then(function (rev) {\r\n                    trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\r\n                });\r\n            };\r\n            this.onerror = function () {\r\n                // If the main operation fails, make sure to regret the change.\r\n                promise._then(function (rev) {\r\n                    // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\r\n                    db._changes.delete(rev);\r\n                });\r\n            };\r\n        }\r\n    };\r\n}\n\nfunction initDeletingHook(db, tableName) {\r\n    return function deletingHook(primKey, obj, trans) {\r\n        /// <param name="trans" type="db.Transaction"></param>\r\n        var promise = db._changes.add({\r\n            source: trans.source || null,\r\n            table: tableName,\r\n            key: primKey,\r\n            type: DELETE,\r\n            oldObj: obj\r\n        }).then(function (rev) {\r\n            trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\r\n            return rev;\r\n        })\r\n            .catch(function (e) {\r\n            console.log(obj);\r\n            console.log(e.stack);\r\n        });\r\n        this.onerror = function () {\r\n            // If the main operation fails, make sure to regret the change.\r\n            // Using _then because if promise is already fullfilled, the standard then() would\r\n            // do setTimeout() and we would loose the transaction.\r\n            promise._then(function (rev) {\r\n                // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\r\n                db._changes.delete(rev);\r\n            });\r\n        };\r\n    };\r\n}\n\nfunction initCrudMonitor(db) {\r\n    //\r\n    // The Creating/Updating/Deleting hook will make sure any change is stored to the changes table\r\n    //\r\n    return function crudMonitor(table) {\r\n        /// <param name="table" type="db.Table"></param>\r\n        if (table.hook._observing)\r\n            return;\r\n        table.hook._observing = true;\r\n        var tableName = table.name;\r\n        table.hook(\'creating\').subscribe(initCreatingHook(db, table));\r\n        table.hook(\'updating\').subscribe(initUpdatingHook(db, tableName));\r\n        table.hook(\'deleting\').subscribe(initDeletingHook(db, tableName));\r\n    };\r\n}\n\nfunction initOnStorage(Observable) {\r\n    return function onStorage(event) {\r\n        // We use the onstorage event to trigger onLatestRevisionIncremented since we will wake up when other windows modify the DB as well!\r\n        if (event.key.indexOf("Dexie.Observable/") === 0) {\r\n            var parts = event.key.split(\'/\');\r\n            var prop = parts[1];\r\n            var dbname = parts[2];\r\n            if (prop === \'latestRevision\') {\r\n                var rev = parseInt(event.newValue, 10);\r\n                if (!isNaN(rev) && rev > Observable.latestRevision[dbname]) {\r\n                    Observable.latestRevision[dbname] = rev;\r\n                    __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n                        Observable.on(\'latestRevisionIncremented\').fire(dbname, rev);\r\n                    });\r\n                }\r\n            }\r\n            else if (prop.indexOf("deadnode:") === 0) {\r\n                var nodeID = parseInt(prop.split(\':\')[1], 10);\r\n                if (event.newValue) {\r\n                    Observable.on.suicideNurseCall.fire(dbname, nodeID);\r\n                }\r\n            }\r\n            else if (prop === \'intercomm\') {\r\n                if (event.newValue) {\r\n                    Observable.on.intercomm.fire(dbname);\r\n                }\r\n            }\r\n        }\r\n    };\r\n}\n\nfunction initOverrideOpen(db, SyncNode, crudMonitor) {\r\n    return function overrideOpen(origOpen) {\r\n        return function () {\r\n            //\r\n            // Make sure to subscribe to "creating", "updating" and "deleting" hooks for all observable tables that were created in the stores() method.\r\n            //\r\n            Object.keys(db._allTables).forEach(function (tableName) {\r\n                var table = db._allTables[tableName];\r\n                if (table.schema.observable) {\r\n                    crudMonitor(table);\r\n                }\r\n                if (table.name === "_syncNodes") {\r\n                    table.mapToClass(SyncNode);\r\n                }\r\n            });\r\n            return origOpen.apply(this, arguments);\r\n        };\r\n    };\r\n}\n\nvar Promise$1 = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].Promise;\r\nfunction initIntercomm(db, Observable, SyncNode, mySyncNode, localStorage) {\r\n    //\r\n    // Intercommunication between nodes\r\n    //\r\n    // Enable inter-process communication between browser windows using localStorage storage event (is registered in Dexie.Observable)\r\n    var requestsWaitingForReply = {};\r\n    /**\r\n     * @param {string} type Type of message\r\n     * @param message Message to send\r\n     * @param {number} destinationNode ID of destination node\r\n     * @param {{wantReply: boolean, isFailure: boolean, requestId: number}} options If {wantReply: true}, the returned promise will complete with the reply from remote. Otherwise it will complete when message has been successfully sent.</param>\r\n     */\r\n    db.observable.sendMessage = function (type, message, destinationNode, options) {\r\n        /// <param name="type" type="String">Type of message</param>\r\n        /// <param name="message">Message to send</param>\r\n        /// <param name="destinationNode" type="Number">ID of destination node</param>\r\n        /// <param name="options" type="Object" optional="true">{wantReply: Boolean, isFailure: Boolean, requestId: Number}. If wantReply, the returned promise will complete with the reply from remote. Otherwise it will complete when message has been successfully sent.</param>\r\n        options = options || {};\r\n        if (!mySyncNode.node)\r\n            return options.wantReply ?\r\n                Promise$1.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].DatabaseClosedError()) :\r\n                Promise$1.resolve(); // If caller doesn\'t want a reply, it won\'t catch errors either.\r\n        var msg = { message: message, destinationNode: destinationNode, sender: mySyncNode.node.id, type: type };\r\n        __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].extend(msg, options); // wantReply: wantReply, success: !isFailure, requestId: ...\r\n        return __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n            var tables = ["_intercomm"];\r\n            if (options.wantReply)\r\n                tables.push("_syncNodes"); // If caller wants a reply, include "_syncNodes" in transaction to check that there\'s a receiver there. Otherwise, new master will get it.\r\n            var promise = db.transaction(\'rw\', tables, function () {\r\n                if (options.wantReply) {\r\n                    // Check that there is a receiver there to take the request.\r\n                    return db._syncNodes.where(\'id\').equals(destinationNode).count(function (receiverAlive) {\r\n                        if (receiverAlive)\r\n                            return db._intercomm.add(msg);\r\n                        else\r\n                            return db._syncNodes.where(\'isMaster\').above(0).first(function (masterNode) {\r\n                                msg.destinationNode = masterNode.id;\r\n                                return db._intercomm.add(msg);\r\n                            });\r\n                    });\r\n                }\r\n                else {\r\n                    // If caller doesn\'t need a response, we don\'t have to make sure that it gets one.\r\n                    return db._intercomm.add(msg);\r\n                }\r\n            }).then(function (messageId) {\r\n                var rv = null;\r\n                if (options.wantReply) {\r\n                    rv = new Promise$1(function (resolve, reject) {\r\n                        requestsWaitingForReply[messageId.toString()] = { resolve: resolve, reject: reject };\r\n                    });\r\n                }\r\n                if (localStorage) {\r\n                    localStorage.setItem("Dexie.Observable/intercomm/" + db.name, messageId.toString());\r\n                }\r\n                Observable.on.intercomm.fire(db.name);\r\n                return rv;\r\n            });\r\n            if (!options.wantReply) {\r\n                promise.catch(function () {\r\n                });\r\n                return;\r\n            }\r\n            else {\r\n                // Forward rejection to caller if it waits for reply.\r\n                return promise;\r\n            }\r\n        });\r\n    };\r\n    // Send a message to all local _syncNodes\r\n    db.observable.broadcastMessage = function (type, message, bIncludeSelf) {\r\n        if (!mySyncNode.node)\r\n            return;\r\n        var mySyncNodeId = mySyncNode.node.id;\r\n        __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n            db._syncNodes.toArray(function (nodes) {\r\n                return Promise$1.all(nodes\r\n                    .filter(function (node) { return node.type === \'local\' && (bIncludeSelf || node.id !== mySyncNodeId); })\r\n                    .map(function (node) { return db.observable.sendMessage(type, message, node.id); }));\r\n            }).catch(function () {\r\n            });\r\n        });\r\n    };\r\n    function consumeIntercommMessages() {\r\n        // Check if we got messages:\r\n        if (!mySyncNode.node)\r\n            return Promise$1.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].DatabaseClosedError());\r\n        return __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n            return db.transaction(\'rw\', \'_intercomm\', function () {\r\n                return db._intercomm.where({ destinationNode: mySyncNode.node.id }).toArray(function (messages) {\r\n                    messages.forEach(function (msg) { return consumeMessage(msg); });\r\n                    return db._intercomm.where(\'id\').anyOf(messages.map(function (msg) { return msg.id; })).delete();\r\n                });\r\n            });\r\n        });\r\n    }\r\n    function consumeMessage(msg) {\r\n        if (msg.type === \'response\') {\r\n            // This is a response. Lookup pending request and fulfill its promise.\r\n            var request = requestsWaitingForReply[msg.requestId.toString()];\r\n            if (request) {\r\n                if (msg.isFailure) {\r\n                    request.reject(msg.message.error);\r\n                }\r\n                else {\r\n                    request.resolve(msg.message.result);\r\n                }\r\n                delete requestsWaitingForReply[msg.requestId.toString()];\r\n            }\r\n        }\r\n        else {\r\n            // This is a message or request. Fire the event and add an API for the subscriber to use if reply is requested\r\n            msg.resolve = function (result) {\r\n                db.observable.sendMessage(\'response\', { result: result }, msg.sender, { requestId: msg.id });\r\n            };\r\n            msg.reject = function (error) {\r\n                db.observable.sendMessage(\'response\', { error: error.toString() }, msg.sender, { isFailure: true, requestId: msg.id });\r\n            };\r\n            db.on.message.fire(msg);\r\n        }\r\n    }\r\n    // Listener for \'intercomm\' events\r\n    // Gets fired when we get a \'storage\' event from local storage or when sendMessage is called\r\n    // \'storage\' is used to communicate between tabs (sendMessage changes the localStorage to trigger the event)\r\n    // sendMessage is used to communicate in the same tab and to trigger a storage event\r\n    function onIntercomm(dbname) {\r\n        // When storage event trigger us to check\r\n        if (dbname === db.name) {\r\n            consumeIntercommMessages().catch(\'DatabaseClosedError\', function () { });\r\n        }\r\n    }\r\n    return {\r\n        onIntercomm: onIntercomm,\r\n        consumeIntercommMessages: consumeIntercommMessages\r\n    };\r\n}\n\nfunction overrideParseStoresSpec(origFunc) {\r\n    return function (stores, dbSchema) {\r\n        // Create the _changes and _syncNodes tables\r\n        stores["_changes"] = "++rev";\r\n        stores["_syncNodes"] = "++id,myRevision,lastHeartBeat,&url,isMaster,type,status";\r\n        stores["_intercomm"] = "++id,destinationNode";\r\n        stores["_uncommittedChanges"] = "++id,node"; // For remote syncing when server returns a partial result.\r\n        // Call default implementation. Will populate the dbSchema structures.\r\n        origFunc.call(this, stores, dbSchema);\r\n        // Allow UUID primary keys using $$ prefix on primary key or indexes\r\n        Object.keys(dbSchema).forEach(function (tableName) {\r\n            var schema = dbSchema[tableName];\r\n            if (schema.primKey.name.indexOf(\'$$\') === 0) {\r\n                schema.primKey.uuid = true;\r\n                schema.primKey.name = schema.primKey.name.substr(2);\r\n                schema.primKey.keyPath = schema.primKey.keyPath.substr(2);\r\n            }\r\n        });\r\n        // Now mark all observable tables\r\n        Object.keys(dbSchema).forEach(function (tableName) {\r\n            // Marked observable tables with "observable" in their TableSchema.\r\n            if (tableName.indexOf(\'_\') !== 0 && tableName.indexOf(\'$\') !== 0) {\r\n                dbSchema[tableName].observable = true;\r\n            }\r\n        });\r\n    };\r\n}\n\nfunction deleteOldChanges(db) {\r\n    // This is a background job and should never be done within\r\n    // a caller\'s transaction. Use Dexie.ignoreTransaction() to ensure that.\r\n    // We should not return the Promise but catch it ourselves instead.\r\n    // To prohibit starving the database we want to lock transactions as short as possible\r\n    // and since we\'re not in a hurry, we could do this job in chunks and reschedule a\r\n    // continuation every 500 ms.\r\n    var CHUNK_SIZE = 100;\r\n    __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n        return db._syncNodes.orderBy("myRevision").first(function (oldestNode) {\r\n            return db._changes\r\n                .where("rev").below(oldestNode.myRevision)\r\n                .limit(CHUNK_SIZE)\r\n                .primaryKeys();\r\n        }).then(function (keysToDelete) {\r\n            if (keysToDelete.length === 0)\r\n                return; // Done.\r\n            return db._changes.bulkDelete(keysToDelete).then(function () {\r\n                // If not done garbage collecting, reschedule a continuation of it until done.\r\n                if (keysToDelete.length === CHUNK_SIZE) {\r\n                    // Limit reached. Changes are there are more job to do. Schedule again:\r\n                    setTimeout(function () { return db.isOpen() && deleteOldChanges(db); }, 500);\r\n                }\r\n            });\r\n        });\r\n    }).catch(function () {\r\n        // The operation is not crucial. A failure could almost only be due to that database has been closed.\r\n        // No need to log this.\r\n    });\r\n}\n\n/* ==========================================================================\r\n *                           dexie-observable.js\r\n * ==========================================================================\r\n *\r\n * Dexie addon for observing database changes not just on local db instance\r\n * but also on other instances, tabs and windows.\r\n *\r\n * Comprises a base framework for dexie-syncable.js\r\n *\r\n * By David Fahlander, david.fahlander@gmail.com,\r\n *    Nikolas Poniros, https://github.com/nponiros\r\n *\r\n * ==========================================================================\r\n *\r\n * Version {version}, {date}\r\n *\r\n * http://dexie.org\r\n *\r\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\r\n *\r\n */\r\nvar global = self;\r\n/** class DatabaseChange\r\n    *\r\n    *  Object contained by the _changes table.\r\n    */\r\nvar DatabaseChange = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].defineClass({\r\n    rev: Number,\r\n    source: String,\r\n    table: String,\r\n    key: Object,\r\n    type: Number,\r\n    obj: Object,\r\n    mods: Object,\r\n    oldObj: Object // DELETE: oldObj contains the object deleted. UPDATE: oldObj contains the old object before updates applied.\r\n});\r\n// Import some usable helper functions\r\nvar override = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].override;\r\nvar Promise = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].Promise;\r\nvar browserIsShuttingDown = false;\r\nfunction Observable(db) {\r\n    /// <summary>\r\n    ///   Extension to Dexie providing Syncronization capabilities to Dexie.\r\n    /// </summary>\r\n    /// <param name="db" type="Dexie"></param>\r\n    var NODE_TIMEOUT = 20000, // 20 seconds before local db instances are timed out. This is so that old changes can be deleted when not needed and to garbage collect old _syncNodes objects.\r\n    HIBERNATE_GRACE_PERIOD = 20000, // 20 seconds\r\n    // LOCAL_POLL: The time to wait before polling local db for changes and cleaning up old nodes. \r\n    // Polling for changes is a fallback only needed in certain circomstances (when the onstorage event doesnt reach all listeners - when different browser windows doesnt share the same process)\r\n    LOCAL_POLL = 500, // 500 ms. In real-world there will be this value + the time it takes to poll(). A small value is needed in Workers where we cannot rely on storage event.\r\n    HEARTBEAT_INTERVAL = NODE_TIMEOUT - 5000;\r\n    var localStorage = Observable.localStorageImpl;\r\n    /** class SyncNode\r\n        *\r\n        * Object contained in the _syncNodes table.\r\n        */\r\n    var SyncNode = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].defineClass({\r\n        //id: Number,\r\n        myRevision: Number,\r\n        type: String,\r\n        lastHeartBeat: Number,\r\n        deleteTimeStamp: Number,\r\n        url: String,\r\n        isMaster: Number,\r\n        // Below properties should be extended in Dexie.Syncable. Not here. They apply to remote nodes only (type == "remote"):\r\n        syncProtocol: String,\r\n        syncContext: null,\r\n        syncOptions: Object,\r\n        connected: false,\r\n        status: Number,\r\n        appliedRemoteRevision: null,\r\n        remoteBaseRevisions: [{ local: Number, remote: null }],\r\n        dbUploadState: {\r\n            tablesToUpload: [String],\r\n            currentTable: String,\r\n            currentKey: null,\r\n            localBaseRevision: Number\r\n        }\r\n    });\r\n    db.observable = {};\r\n    db.observable.SyncNode = SyncNode;\r\n    var wakeupObservers = initWakeupObservers(db, Observable, localStorage);\r\n    var overrideCreateTransaction = initOverrideCreateTransaction(db, wakeupObservers);\r\n    var crudMonitor = initCrudMonitor(db);\r\n    var overrideOpen = initOverrideOpen(db, SyncNode, crudMonitor);\r\n    var mySyncNode = { node: null };\r\n    var intercomm = initIntercomm(db, Observable, SyncNode, mySyncNode, localStorage);\r\n    var onIntercomm = intercomm.onIntercomm;\r\n    var consumeIntercommMessages = intercomm.consumeIntercommMessages;\r\n    // Allow other addons to access the local sync node. May be needed by Dexie.Syncable.\r\n    Object.defineProperty(db, "_localSyncNode", {\r\n        get: function () { return mySyncNode.node; }\r\n    });\r\n    var pollHandle = null, heartbeatHandle = null;\r\n    if (__WEBPACK_IMPORTED_MODULE_0_dexie__["default"].fake) {\r\n        // This code will never run.\r\n        // It\'s here just to enable auto-complete in visual studio - helps a lot when writing code.\r\n        db.version(1).stores({\r\n            _syncNodes: "++id,myRevision,lastHeartBeat",\r\n            _changes: "++rev",\r\n            _intercomm: "++id,destinationNode",\r\n            _uncommittedChanges: "++id,node"\r\n        });\r\n        db._syncNodes.mapToClass(SyncNode);\r\n        db._changes.mapToClass(DatabaseChange);\r\n        mySyncNode.node = new SyncNode({\r\n            myRevision: 0,\r\n            type: "local",\r\n            lastHeartBeat: Date.now(),\r\n            deleteTimeStamp: null\r\n        });\r\n    }\r\n    //\r\n    // Override parsing the stores to add "_changes" and "_syncNodes" tables.\r\n    // It also adds UUID support for the primary key and sets tables as observable tables.\r\n    //\r\n    db.Version.prototype._parseStoresSpec = override(db.Version.prototype._parseStoresSpec, overrideParseStoresSpec);\r\n    // changes event on db:\r\n    db.on.addEventType({\r\n        changes: \'asap\',\r\n        cleanup: [promisableChain, nop],\r\n        message: \'asap\'\r\n    });\r\n    //\r\n    // Override transaction creation to always include the "_changes" store when any observable store is involved.\r\n    //\r\n    db._createTransaction = override(db._createTransaction, overrideCreateTransaction);\r\n    // If Observable.latestRevsion[db.name] is undefined, set it to 0 so that comparing against it always works.\r\n    // You might think that it will always be undefined before this call, but in case another Dexie instance in the same\r\n    // window with the same database name has been created already, this static property will already be set correctly.\r\n    Observable.latestRevision[db.name] = Observable.latestRevision[db.name] || 0;\r\n    //\r\n    // Override open to setup hooks for db changes and map the _syncNodes table to class\r\n    //\r\n    db.open = override(db.open, overrideOpen);\r\n    db.close = override(db.close, function (origClose) {\r\n        return function () {\r\n            if (db.dynamicallyOpened())\r\n                return origClose.apply(this, arguments); // Don\'t observe dynamically opened databases.\r\n            // Teardown our framework.\r\n            if (wakeupObservers.timeoutHandle) {\r\n                clearTimeout(wakeupObservers.timeoutHandle);\r\n                delete wakeupObservers.timeoutHandle;\r\n            }\r\n            Observable.on(\'latestRevisionIncremented\').unsubscribe(onLatestRevisionIncremented);\r\n            Observable.on(\'suicideNurseCall\').unsubscribe(onSuicide);\r\n            Observable.on(\'intercomm\').unsubscribe(onIntercomm);\r\n            Observable.on(\'beforeunload\').unsubscribe(onBeforeUnload);\r\n            // Inform other db instances in same window that we are dying:\r\n            if (mySyncNode.node && mySyncNode.node.id) {\r\n                Observable.on.suicideNurseCall.fire(db.name, mySyncNode.node.id);\r\n                // Inform other windows as well:\r\n                if (localStorage) {\r\n                    localStorage.setItem(\'Dexie.Observable/deadnode:\' + mySyncNode.node.id.toString() + \'/\' + db.name, "dead"); // In IE, this will also wakeup our own window. cleanup() may trigger twice per other db instance. But that doesnt to anything.\r\n                }\r\n                mySyncNode.node.deleteTimeStamp = 1; // One millisecond after 1970. Makes it occur in the past but still keeps it truthy.\r\n                mySyncNode.node.lastHeartBeat = 0;\r\n                db._syncNodes.put(mySyncNode.node); // This async operation may be cancelled since the browser is closing down now.\r\n                mySyncNode.node = null;\r\n            }\r\n            if (pollHandle)\r\n                clearTimeout(pollHandle);\r\n            pollHandle = null;\r\n            if (heartbeatHandle)\r\n                clearTimeout(heartbeatHandle);\r\n            heartbeatHandle = null;\r\n            return origClose.apply(this, arguments);\r\n        };\r\n    });\r\n    // Override Dexie.delete() in order to delete Observable.latestRevision[db.name].\r\n    db.delete = override(db.delete, function (origDelete) {\r\n        return function () {\r\n            return origDelete.apply(this, arguments).then(function (result) {\r\n                // Reset Observable.latestRevision[db.name]\r\n                Observable.latestRevision[db.name] = 0;\r\n                return result;\r\n            });\r\n        };\r\n    });\r\n    // When db opens, make sure to start monitor any changes before other db operations will start.\r\n    db.on("ready", function startObserving() {\r\n        if (db.dynamicallyOpened())\r\n            return db; // Don\'t observe dynamically opened databases.\r\n        return db.table("_changes").orderBy("rev").last(function (lastChange) {\r\n            // Since startObserving() is called before database open() method, this will be the first database operation enqueued to db.\r\n            // Therefore we know that the retrieved value will be This query will\r\n            var latestRevision = (lastChange ? lastChange.rev : 0);\r\n            mySyncNode.node = new SyncNode({\r\n                myRevision: latestRevision,\r\n                type: "local",\r\n                lastHeartBeat: Date.now(),\r\n                deleteTimeStamp: null,\r\n                isMaster: 0\r\n            });\r\n            if (Observable.latestRevision[db.name] < latestRevision) {\r\n                // Side track . For correctness whenever setting Observable.latestRevision[db.name] we must make sure the event is fired if increased:\r\n                // There are other db instances in same window that hasnt yet been informed about a new revision\r\n                Observable.latestRevision[db.name] = latestRevision;\r\n                __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].ignoreTransaction(function () {\r\n                    Observable.on.latestRevisionIncremented.fire(latestRevision);\r\n                });\r\n            }\r\n            // Add new sync node or if this is a reopening of the database after a close() call, update it.\r\n            return db.transaction(\'rw\', \'_syncNodes\', function () {\r\n                return db._syncNodes\r\n                    .where(\'isMaster\').equals(1)\r\n                    .first(function (currentMaster) {\r\n                    if (!currentMaster) {\r\n                        // There\'s no master. We must be the master\r\n                        mySyncNode.node.isMaster = 1;\r\n                    }\r\n                    else if (currentMaster.lastHeartBeat < Date.now() - NODE_TIMEOUT) {\r\n                        // Master have been inactive for too long\r\n                        // Take over mastership\r\n                        mySyncNode.node.isMaster = 1;\r\n                        currentMaster.isMaster = 0;\r\n                        return db._syncNodes.put(currentMaster);\r\n                    }\r\n                }).then(function () {\r\n                    // Add our node to DB and start subscribing to events\r\n                    return db._syncNodes.add(mySyncNode.node).then(function () {\r\n                        Observable.on(\'latestRevisionIncremented\', onLatestRevisionIncremented); // Wakeup when a new revision is available.\r\n                        Observable.on(\'beforeunload\', onBeforeUnload);\r\n                        Observable.on(\'suicideNurseCall\', onSuicide);\r\n                        Observable.on(\'intercomm\', onIntercomm);\r\n                        // Start polling for changes and do cleanups:\r\n                        pollHandle = setTimeout(poll, LOCAL_POLL);\r\n                        // Start heartbeat\r\n                        heartbeatHandle = setTimeout(heartbeat, HEARTBEAT_INTERVAL);\r\n                    });\r\n                });\r\n            }).then(function () {\r\n                cleanup();\r\n            });\r\n        });\r\n    }, true); // True means the on(ready) event will survive a db reopening (db.close() / db.open()).\r\n    var handledRevision = 0;\r\n    function onLatestRevisionIncremented(dbname, latestRevision) {\r\n        if (dbname === db.name) {\r\n            if (handledRevision >= latestRevision)\r\n                return; // Make sure to only run once per revision. (Workaround for IE triggering storage event on same window)\r\n            handledRevision = latestRevision;\r\n            __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].vip(function () {\r\n                readChanges(latestRevision).catch(\'DatabaseClosedError\', function () {\r\n                    // Handle database closed error gracefully while reading changes.\r\n                    // Don\'t trigger \'unhandledrejection\'.\r\n                    // Even though we intercept the close() method, it might be called when in the middle of\r\n                    // reading changes and then that flow will cancel with DatabaseClosedError.\r\n                });\r\n            });\r\n        }\r\n    }\r\n    function readChanges(latestRevision, recursion, wasPartial) {\r\n        // Whenever changes are read, fire db.on("changes") with the array of changes. Eventually, limit the array to 1000 entries or so (an entire database is\r\n        // downloaded from server AFTER we are initiated. For example, if first sync call fails, then after a while we get reconnected. However, that scenario\r\n        // should be handled in case database is totally empty we should fail if sync is not available)\r\n        if (!recursion && readChanges.ongoingOperation) {\r\n            // We are already reading changes. Prohibit a parallell execution of this which would lead to duplicate trigging of \'changes\' event.\r\n            // Instead, the callback in toArray() will always check Observable.latestRevision[db.name] to see if it has changed and if so, re-launch readChanges().\r\n            // The caller should get the Promise instance from the ongoing operation so that the then() method will resolve when operation is finished.\r\n            return readChanges.ongoingOperation;\r\n        }\r\n        var partial = false;\r\n        var ourSyncNode = mySyncNode.node; // Because mySyncNode can suddenly be set to null on database close, and worse, can be set to a new value if database is reopened.\r\n        if (!ourSyncNode) {\r\n            return Promise.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].DatabaseClosedError());\r\n        }\r\n        var LIMIT = 1000;\r\n        var promise = db._changes.where("rev").above(ourSyncNode.myRevision).limit(LIMIT).toArray(function (changes) {\r\n            if (changes.length > 0) {\r\n                var lastChange = changes[changes.length - 1];\r\n                partial = (changes.length === LIMIT);\r\n                db.on(\'changes\').fire(changes, partial);\r\n                ourSyncNode.myRevision = lastChange.rev;\r\n            }\r\n            else if (wasPartial) {\r\n                // No more changes, BUT since we have triggered on(\'changes\') with partial = true,\r\n                // we HAVE TO trigger changes again with empty list and partial = false\r\n                db.on(\'changes\').fire([], false);\r\n            }\r\n            var ourNodeStillExists = false;\r\n            return db._syncNodes.where(\':id\').equals(ourSyncNode.id).modify(function (syncNode) {\r\n                ourNodeStillExists = true;\r\n                syncNode.lastHeartBeat = Date.now(); // Update heart beat (not nescessary, but why not!)\r\n                syncNode.deleteTimeStamp = null; // Reset "deleteTimeStamp" flag if it was there.\r\n                syncNode.myRevision = Math.max(syncNode.myRevision, ourSyncNode.myRevision);\r\n            }).then(function () { return ourNodeStillExists; });\r\n        }).then(function (ourNodeStillExists) {\r\n            if (!ourNodeStillExists) {\r\n                // My node has been deleted. We must have been lazy and got removed by another node.\r\n                if (browserIsShuttingDown) {\r\n                    throw new Error("Browser is shutting down");\r\n                }\r\n                else {\r\n                    db.close();\r\n                    console.error("Out of sync"); // TODO: What to do? Reload the page?\r\n                    if (global.location)\r\n                        global.location.reload(true);\r\n                    throw new Error("Out of sync"); // Will make current promise reject\r\n                }\r\n            }\r\n            // Check if more changes have come since we started reading changes in the first place. If so, relaunch readChanges and let the ongoing promise not\r\n            // resolve until all changes have been read.\r\n            if (partial || Observable.latestRevision[db.name] > ourSyncNode.myRevision) {\r\n                // Either there were more than 1000 changes or additional changes where added while we were reading these changes,\r\n                // In either case, call readChanges() again until we\'re done.\r\n                return readChanges(Observable.latestRevision[db.name], (recursion || 0) + 1, partial);\r\n            }\r\n        }).finally(function () {\r\n            delete readChanges.ongoingOperation;\r\n        });\r\n        if (!recursion) {\r\n            readChanges.ongoingOperation = promise;\r\n        }\r\n        return promise;\r\n    }\r\n    /**\r\n     * The reason we need heartbeat in parallell with poll() is due to the risk of long-running\r\n     * transactions while syncing changes from server to client in Dexie.Syncable. That transaction will\r\n     * include _changes (which will block readChanges()) but not _syncNodes. So this heartbeat will go on\r\n     * during that changes are being applied and update our lastHeartBeat property while poll() is waiting.\r\n     * When cleanup() (who also is blocked by the sync) wakes up, it won\'t kill the master node because this\r\n     * heartbeat job will have updated the master node\'s heartbeat during the long-running sync transaction.\r\n     *\r\n     * If we did not have this heartbeat, and a server send lots of changes that took more than NODE_TIMEOUT\r\n     * (20 seconds), another node waking up after the sync would kill the master node and take over because\r\n     * it would believe it was dead.\r\n     */\r\n    function heartbeat() {\r\n        heartbeatHandle = null;\r\n        var currentInstance = mySyncNode.node && mySyncNode.node.id;\r\n        if (!currentInstance)\r\n            return;\r\n        db.transaction(\'rw!\', db._syncNodes, function () {\r\n            db._syncNodes.where({ id: currentInstance }).first(function (ourSyncNode) {\r\n                if (!ourSyncNode) {\r\n                    // We do not exist anymore. Call db.close() to teardown polls etc.\r\n                    if (db.isOpen())\r\n                        db.close();\r\n                    return;\r\n                }\r\n                ourSyncNode.lastHeartBeat = Date.now();\r\n                ourSyncNode.deleteTimeStamp = null; // Reset "deleteTimeStamp" flag if it was there.\r\n                return db._syncNodes.put(ourSyncNode);\r\n            });\r\n        }).catch(\'DatabaseClosedError\', function () {\r\n            // Ignore silently\r\n        }).finally(function () {\r\n            if (mySyncNode.node && mySyncNode.node.id === currentInstance && db.isOpen()) {\r\n                heartbeatHandle = setTimeout(heartbeat, HEARTBEAT_INTERVAL);\r\n            }\r\n        });\r\n    }\r\n    function poll() {\r\n        pollHandle = null;\r\n        var currentInstance = mySyncNode.node && mySyncNode.node.id;\r\n        if (!currentInstance)\r\n            return;\r\n        __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].vip(function () {\r\n            readChanges(Observable.latestRevision[db.name]).then(cleanup).then(consumeIntercommMessages)\r\n                .catch(\'DatabaseClosedError\', function () {\r\n                // Handle database closed error gracefully while reading changes.\r\n                // Don\'t trigger \'unhandledrejection\'.\r\n                // Even though we intercept the close() method, it might be called when in the middle of\r\n                // reading changes and then that flow will cancel with DatabaseClosedError.\r\n            })\r\n                .finally(function () {\r\n                // Poll again in given interval:\r\n                if (mySyncNode.node && mySyncNode.node.id === currentInstance && db.isOpen()) {\r\n                    pollHandle = setTimeout(poll, LOCAL_POLL);\r\n                }\r\n            });\r\n        });\r\n    }\r\n    function cleanup() {\r\n        var ourSyncNode = mySyncNode.node;\r\n        if (!ourSyncNode)\r\n            return Promise.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].DatabaseClosedError());\r\n        return db.transaction(\'rw\', \'_syncNodes\', \'_changes\', \'_intercomm\', function () {\r\n            // Cleanup dead local nodes that has no heartbeat for over a minute\r\n            // Dont do the following:\r\n            //nodes.where("lastHeartBeat").below(Date.now() - NODE_TIMEOUT).and(function (node) { return node.type == "local"; }).delete();\r\n            // Because client may have been in hybernate mode and recently woken up. That would lead to deletion of all nodes.\r\n            // Instead, we should mark any old nodes for deletion in a minute or so. If they still dont wakeup after that minute we could consider them dead.\r\n            var weBecameMaster = false;\r\n            db._syncNodes.where("lastHeartBeat").below(Date.now() - NODE_TIMEOUT).filter(function (node) { return node.type === \'local\'; }).modify(function (node) {\r\n                if (node.deleteTimeStamp && node.deleteTimeStamp < Date.now()) {\r\n                    // Delete the node.\r\n                    delete this.value;\r\n                    // Cleanup localStorage "deadnode:" entry for this node (localStorage API was used to wakeup other windows (onstorage event) - an event type missing in indexedDB.)\r\n                    if (localStorage) {\r\n                        localStorage.removeItem(\'Dexie.Observable/deadnode:\' + node.id + \'/\' + db.name);\r\n                    }\r\n                    // Check if we are deleting a master node\r\n                    if (node.isMaster) {\r\n                        // The node we are deleting is master. We must take over that role.\r\n                        // OK to call nodes.update(). No need to call Dexie.vip() because nodes is opened in existing transaction!\r\n                        db._syncNodes.update(ourSyncNode, { isMaster: 1 });\r\n                        weBecameMaster = true;\r\n                    }\r\n                    // Cleanup intercomm messages destinated to the node being deleted.\r\n                    // Those that waits for reply should be redirected to us.\r\n                    db._intercomm.where({ destinationNode: node.id }).modify(function (msg) {\r\n                        if (msg.wantReply)\r\n                            msg.destinationNode = ourSyncNode.id;\r\n                        else\r\n                            // Delete the message from DB and if someone is waiting for reply, let ourselved answer the request.\r\n                            delete this.value;\r\n                    });\r\n                }\r\n                else if (!node.deleteTimeStamp) {\r\n                    // Mark the node for deletion\r\n                    node.deleteTimeStamp = Date.now() + HIBERNATE_GRACE_PERIOD;\r\n                }\r\n            }).then(function () {\r\n                // Cleanup old revisions that no node is interested of.\r\n                Observable.deleteOldChanges(db);\r\n                return db.on("cleanup").fire(weBecameMaster);\r\n            });\r\n        });\r\n    }\r\n    function onBeforeUnload() {\r\n        // Mark our own sync node for deletion.\r\n        if (!mySyncNode.node)\r\n            return;\r\n        browserIsShuttingDown = true;\r\n        mySyncNode.node.deleteTimeStamp = 1; // One millisecond after 1970. Makes it occur in the past but still keeps it truthy.\r\n        mySyncNode.node.lastHeartBeat = 0;\r\n        db._syncNodes.put(mySyncNode.node); // This async operation may be cancelled since the browser is closing down now.\r\n        Observable.wereTheOneDying = true; // If other nodes in same window wakes up by this call, make sure they dont start taking over mastership and stuff...\r\n        // Inform other windows that we\'re gone, so that they may take over our role if needed. Setting localStorage item below will trigger Observable.onStorage, which will trigger onSuicie() below:\r\n        if (localStorage) {\r\n            localStorage.setItem(\'Dexie.Observable/deadnode:\' + mySyncNode.node.id.toString() + \'/\' + db.name, "dead"); // In IE, this will also wakeup our own window. However, that is doublechecked in nursecall subscriber below.\r\n        }\r\n    }\r\n    function onSuicide(dbname, nodeID) {\r\n        if (dbname === db.name && !Observable.wereTheOneDying) {\r\n            // Make sure it\'s dead indeed. Second bullet. Why? Because it has marked itself for deletion in the onbeforeunload event, which is fired just before window dies.\r\n            // It\'s own call to put() may have been cancelled.\r\n            // Note also that in IE, this event may be called twice, but that doesnt harm!\r\n            __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].vip(function () {\r\n                db._syncNodes.update(nodeID, { deleteTimeStamp: 1, lastHeartBeat: 0 }).then(cleanup);\r\n            });\r\n        }\r\n    }\r\n}\r\n//\r\n// Static properties and methods\r\n// \r\nObservable.latestRevision = {}; // Latest revision PER DATABASE. Example: Observable.latestRevision.FriendsDB = 37;\r\nObservable.on = __WEBPACK_IMPORTED_MODULE_0_dexie__["default"].Events(null, "latestRevisionIncremented", "suicideNurseCall", "intercomm", "beforeunload"); // fire(dbname, value);\r\nObservable.createUUID = createUUID;\r\nObservable.deleteOldChanges = deleteOldChanges;\r\nObservable._onStorage = initOnStorage(Observable);\r\nObservable._onBeforeUnload = function () {\r\n    Observable.on.beforeunload.fire();\r\n};\r\ntry {\r\n    Observable.localStorageImpl = global.localStorage;\r\n}\r\ncatch (ex) { }\r\n//\r\n// Map window events to static events in Dexie.Observable:\r\n//\r\nif (global.addEventListener) {\r\n    global.addEventListener("storage", Observable._onStorage);\r\n    global.addEventListener("beforeunload", Observable._onBeforeUnload);\r\n}\r\n// Register addon:\r\n__WEBPACK_IMPORTED_MODULE_0_dexie__["default"].Observable = Observable;\r\n__WEBPACK_IMPORTED_MODULE_0_dexie__["default"].addons.push(Observable);\n\n/* harmony default export */ __webpack_exports__["default"] = (Observable);\n//# sourceMappingURL=dexie-observable.es.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/dexie-observable/dist/dexie-observable.es.js\n// module id = 811\n// module chunks = 0\n\n//# sourceURL=../node_modules/dexie-observable/dist/dexie-observable.es.js')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(400)\nvar primes = __webpack_require__(814)\n\nvar DH = __webpack_require__(813)\n\nfunction getDiffieHellman (mod) {\n  var prime = new Buffer(primes[mod].prime, 'hex')\n  var gen = new Buffer(primes[mod].gen, 'hex')\n\n  return new DH(prime, gen)\n}\n\nvar ENCODINGS = {\n  'binary': true, 'hex': true, 'base64': true\n}\n\nfunction createDiffieHellman (prime, enc, generator, genc) {\n  if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {\n    return createDiffieHellman(prime, 'binary', enc, generator)\n  }\n\n  enc = enc || 'binary'\n  genc = genc || 'binary'\n  generator = generator || new Buffer([2])\n\n  if (!Buffer.isBuffer(generator)) {\n    generator = new Buffer(generator, genc)\n  }\n\n  if (typeof prime === 'number') {\n    return new DH(generatePrime(prime, generator), generator, true)\n  }\n\n  if (!Buffer.isBuffer(prime)) {\n    prime = new Buffer(prime, enc)\n  }\n\n  return new DH(prime, generator, true)\n}\n\nexports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman\nexports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/diffie-hellman/browser.js\n// module id = 812\n// module chunks = 0\n\n//# sourceURL=../node_modules/diffie-hellman/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(17);\nvar MillerRabin = __webpack_require__(469);\nvar millerRabin = new MillerRabin();\nvar TWENTYFOUR = new BN(24);\nvar ELEVEN = new BN(11);\nvar TEN = new BN(10);\nvar THREE = new BN(3);\nvar SEVEN = new BN(7);\nvar primes = __webpack_require__(400);\nvar randomBytes = __webpack_require__(80);\nmodule.exports = DH;\n\nfunction setPublicKey(pub, enc) {\n  enc = enc || 'utf8';\n  if (!Buffer.isBuffer(pub)) {\n    pub = new Buffer(pub, enc);\n  }\n  this._pub = new BN(pub);\n  return this;\n}\n\nfunction setPrivateKey(priv, enc) {\n  enc = enc || 'utf8';\n  if (!Buffer.isBuffer(priv)) {\n    priv = new Buffer(priv, enc);\n  }\n  this._priv = new BN(priv);\n  return this;\n}\n\nvar primeCache = {};\nfunction checkPrime(prime, generator) {\n  var gen = generator.toString('hex');\n  var hex = [gen, prime.toString(16)].join('_');\n  if (hex in primeCache) {\n    return primeCache[hex];\n  }\n  var error = 0;\n\n  if (prime.isEven() ||\n    !primes.simpleSieve ||\n    !primes.fermatTest(prime) ||\n    !millerRabin.test(prime)) {\n    //not a prime so +1\n    error += 1;\n\n    if (gen === '02' || gen === '05') {\n      // we'd be able to check the generator\n      // it would fail so +8\n      error += 8;\n    } else {\n      //we wouldn't be able to test the generator\n      // so +4\n      error += 4;\n    }\n    primeCache[hex] = error;\n    return error;\n  }\n  if (!millerRabin.test(prime.shrn(1))) {\n    //not a safe prime\n    error += 2;\n  }\n  var rem;\n  switch (gen) {\n    case '02':\n      if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {\n        // unsuidable generator\n        error += 8;\n      }\n      break;\n    case '05':\n      rem = prime.mod(TEN);\n      if (rem.cmp(THREE) && rem.cmp(SEVEN)) {\n        // prime mod 10 needs to equal 3 or 7\n        error += 8;\n      }\n      break;\n    default:\n      error += 4;\n  }\n  primeCache[hex] = error;\n  return error;\n}\n\nfunction DH(prime, generator, malleable) {\n  this.setGenerator(generator);\n  this.__prime = new BN(prime);\n  this._prime = BN.mont(this.__prime);\n  this._primeLen = prime.length;\n  this._pub = undefined;\n  this._priv = undefined;\n  this._primeCode = undefined;\n  if (malleable) {\n    this.setPublicKey = setPublicKey;\n    this.setPrivateKey = setPrivateKey;\n  } else {\n    this._primeCode = 8;\n  }\n}\nObject.defineProperty(DH.prototype, 'verifyError', {\n  enumerable: true,\n  get: function () {\n    if (typeof this._primeCode !== 'number') {\n      this._primeCode = checkPrime(this.__prime, this.__gen);\n    }\n    return this._primeCode;\n  }\n});\nDH.prototype.generateKeys = function () {\n  if (!this._priv) {\n    this._priv = new BN(randomBytes(this._primeLen));\n  }\n  this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();\n  return this.getPublicKey();\n};\n\nDH.prototype.computeSecret = function (other) {\n  other = new BN(other);\n  other = other.toRed(this._prime);\n  var secret = other.redPow(this._priv).fromRed();\n  var out = new Buffer(secret.toArray());\n  var prime = this.getPrime();\n  if (out.length < prime.length) {\n    var front = new Buffer(prime.length - out.length);\n    front.fill(0);\n    out = Buffer.concat([front, out]);\n  }\n  return out;\n};\n\nDH.prototype.getPublicKey = function getPublicKey(enc) {\n  return formatReturnValue(this._pub, enc);\n};\n\nDH.prototype.getPrivateKey = function getPrivateKey(enc) {\n  return formatReturnValue(this._priv, enc);\n};\n\nDH.prototype.getPrime = function (enc) {\n  return formatReturnValue(this.__prime, enc);\n};\n\nDH.prototype.getGenerator = function (enc) {\n  return formatReturnValue(this._gen, enc);\n};\n\nDH.prototype.setGenerator = function (gen, enc) {\n  enc = enc || 'utf8';\n  if (!Buffer.isBuffer(gen)) {\n    gen = new Buffer(gen, enc);\n  }\n  this.__gen = gen;\n  this._gen = new BN(gen);\n  return this;\n};\n\nfunction formatReturnValue(bn, enc) {\n  var buf = new Buffer(bn.toArray());\n  if (!enc) {\n    return buf;\n  } else {\n    return buf.toString(enc);\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/diffie-hellman/lib/dh.js\n// module id = 813\n// module chunks = 0\n\n//# sourceURL=../node_modules/diffie-hellman/lib/dh.js")},function(module,exports){eval('module.exports = {"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/diffie-hellman/lib/primes.json\n// module id = 814\n// module chunks = 0\n\n//# sourceURL=../node_modules/diffie-hellman/lib/primes.json')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar createHmac = __webpack_require__(140)\nvar hashInfo = __webpack_require__(816)\n\nvar ebuf = new Buffer(0)\nvar b0x00 = new Buffer([ 0x00 ])\nvar b0x01 = new Buffer([ 0x01 ])\n\nfunction HmacDRBG (algo, entropy, nonce, pers) {\n  var info = hashInfo[algo]\n  if (info === undefined) throw new Error('hash ' + algo + ' is not supported')\n\n  this._algo = algo\n  this._securityStrength = info.securityStrength / 8\n  this._outlen = info.outlen / 8\n  this._reseedInterval = 0x1000000000000 // 2**48\n\n  this._init(entropy, nonce, pers)\n}\n\nHmacDRBG.prototype._update = function (seed) {\n  var kmac = createHmac(this._algo, this._K).update(this._V).update(b0x00)\n  if (seed) kmac.update(seed)\n\n  this._K = kmac.digest()\n  this._V = createHmac(this._algo, this._K).update(this._V).digest()\n  if (!seed) return\n\n  this._K = createHmac(this._algo, this._K).update(this._V).update(b0x01).update(seed).digest()\n  this._V = createHmac(this._algo, this._K).update(this._V).digest()\n}\n\nHmacDRBG.prototype._init = function (entropy, nonce, pers) {\n  if (entropy.length < this._securityStrength) throw new Error('Not enough entropy')\n\n  this._K = new Buffer(this._outlen)\n  this._V = new Buffer(this._outlen)\n  for (var i = 0; i < this._K.length; ++i) {\n    this._K[i] = 0x00\n    this._V[i] = 0x01\n  }\n\n  this._update(Buffer.concat([ entropy, nonce, pers || ebuf ]))\n  this._reseed = 1\n}\n\nHmacDRBG.prototype.reseed = function (entropy, add) {\n  if (entropy.length < this._securityStrength) throw new Error('Not enough entropy')\n\n  this._update(Buffer.concat([ entropy, add || ebuf ]))\n  this._reseed = 1\n}\n\nHmacDRBG.prototype.generate = function (len, add) {\n  if (this._reseed > this._reseedInterval) throw new Error('Reseed is required')\n\n  if (add && add.length === 0) add = undefined\n  if (add) this._update(add)\n\n  var temp = new Buffer(0)\n  while (temp.length < len) {\n    this._V = createHmac(this._algo, this._K).update(this._V).digest()\n    temp = Buffer.concat([ temp, this._V ])\n  }\n\n  this._update(add)\n  this._reseed += 1\n  return temp.slice(0, len)\n}\n\nmodule.exports = HmacDRBG\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/drbg.js/hmac.js\n// module id = 815\n// module chunks = 0\n\n//# sourceURL=../node_modules/drbg.js/hmac.js")},function(module,exports){eval('module.exports = {"sha1":{"securityStrength":128,"outlen":160,"seedlen":440},"sha224":{"securityStrength":192,"outlen":224,"seedlen":440},"sha256":{"securityStrength":256,"outlen":256,"seedlen":440},"sha384":{"securityStrength":256,"outlen":384,"seedlen":888},"sha512":{"securityStrength":256,"outlen":512,"seedlen":888}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/drbg.js/lib/hash-info.json\n// module id = 816\n// module chunks = 0\n\n//# sourceURL=../node_modules/drbg.js/lib/hash-info.json')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {var stream = __webpack_require__(81)\nvar eos = __webpack_require__(403)\nvar inherits = __webpack_require__(3)\nvar shift = __webpack_require__(1243)\n\nvar SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)\n  ? Buffer.from([0])\n  : new Buffer([0])\n\nvar onuncork = function(self, fn) {\n  if (self._corked) self.once('uncork', fn)\n  else fn()\n}\n\nvar destroyer = function(self, end) {\n  return function(err) {\n    if (err) self._destroyInterval(err)\n    else if (end && !self._ended) self.end()\n  }\n}\n\nvar end = function(ws, fn) {\n  if (!ws) return fn()\n  if (ws._writableState && ws._writableState.finished) return fn()\n  if (ws._writableState) return ws.end(fn)\n  ws.end()\n  fn()\n}\n\nvar toStreams2 = function(rs) {\n  return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)\n}\n\nvar Duplexify = function(writable, readable, opts) {\n  if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)\n  stream.Duplex.call(this, opts)\n\n  this._writable = null\n  this._readable = null\n  this._readable2 = null\n\n  this._forwardDestroy = !opts || opts.destroy !== false\n  this._forwardEnd = !opts || opts.end !== false\n  this._corked = 1 // start corked\n  this._ondrain = null\n  this._drained = false\n  this._forwarding = false\n  this._unwrite = null\n  this._unread = null\n  this._ended = false\n  this._error = null\n  this._preferError = false\n\n  this.destroyed = false\n\n  if (writable) this.setWritable(writable)\n  if (readable) this.setReadable(readable)\n}\n\ninherits(Duplexify, stream.Duplex)\n\nDuplexify.obj = function(writable, readable, opts) {\n  if (!opts) opts = {}\n  opts.objectMode = true\n  opts.highWaterMark = 16\n  return new Duplexify(writable, readable, opts)\n}\n\nDuplexify.prototype.cork = function() {\n  if (++this._corked === 1) this.emit('cork')\n}\n\nDuplexify.prototype.uncork = function() {\n  if (this._corked && --this._corked === 0) this.emit('uncork')\n}\n\nDuplexify.prototype.setWritable = function(writable) {\n  if (this._unwrite) this._unwrite()\n\n  if (this.destroyed) {\n    if (writable && writable.destroy) writable.destroy()\n    return\n  }\n\n  if (writable === null || writable === false) {\n    this.end()\n    return\n  }\n\n  var self = this\n  var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))\n\n  var ondrain = function() {\n    var ondrain = self._ondrain\n    self._ondrain = null\n    if (ondrain) ondrain()\n  }\n\n  var clear = function() {\n    self._writable.removeListener('drain', ondrain)\n    unend()\n  }\n\n  if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks\n\n  this._writable = writable\n  this._writable.on('drain', ondrain)\n  this._unwrite = clear\n\n  this.uncork() // always uncork setWritable\n}\n\nDuplexify.prototype.setReadable = function(readable) {\n  if (this._unread) this._unread()\n\n  if (this.destroyed) {\n    if (readable && readable.destroy) readable.destroy()\n    return\n  }\n\n  if (readable === null || readable === false) {\n    this.push(null)\n    this.resume()\n    return\n  }\n\n  var self = this\n  var unend = eos(readable, {writable:false, readable:true}, destroyer(this))\n\n  var onreadable = function() {\n    self._forward()\n  }\n\n  var onend = function() {\n    self.push(null)\n  }\n\n  var clear = function() {\n    self._readable2.removeListener('readable', onreadable)\n    self._readable2.removeListener('end', onend)\n    unend()\n  }\n\n  this._drained = true\n  this._readable = readable\n  this._readable2 = readable._readableState ? readable : toStreams2(readable)\n  this._readable2.on('readable', onreadable)\n  this._readable2.on('end', onend)\n  this._unread = clear\n\n  this._forward()\n}\n\nDuplexify.prototype._read = function() {\n  this._drained = true\n  this._forward()\n}\n\nDuplexify.prototype._forward = function() {\n  if (this._forwarding || !this._readable2 || !this._drained) return\n  this._forwarding = true\n\n  var data\n\n  while (this._drained && (data = shift(this._readable2)) !== null) {\n    if (this.destroyed) continue\n    this._drained = this.push(data)\n  }\n\n  this._forwarding = false\n}\n\nDuplexify.prototype.destroy = function(err) {\n  if (this._preferError && !this._error && err) this._error = err\n\n  if (this.destroyed) return\n  this.destroyed = true\n\n  var self = this\n  process.nextTick(function() {\n    self._destroy(self._preferError ? self._error : err)\n  })\n}\n\nDuplexify.prototype._destroyInterval = function(err) {\n  if (this.destroyed) return\n  if (err.message !== 'premature close') return this.destroy(err)\n  this._preferError = true\n  this.destroy(null)\n}\n\nDuplexify.prototype._destroy = function(err) {\n  if (err) {\n    var ondrain = this._ondrain\n    this._ondrain = null\n    if (ondrain) ondrain(err)\n    else this.emit('error', err)\n  }\n\n  if (this._forwardDestroy) {\n    if (this._readable && this._readable.destroy) this._readable.destroy()\n    if (this._writable && this._writable.destroy) this._writable.destroy()\n  }\n\n  this.emit('close')\n}\n\nDuplexify.prototype._write = function(data, enc, cb) {\n  if (this.destroyed) return cb()\n  if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))\n  if (data === SIGNAL_FLUSH) return this._finish(cb)\n  if (!this._writable) return cb()\n\n  if (this._writable.write(data) === false) this._ondrain = cb\n  else cb()\n}\n\n\nDuplexify.prototype._finish = function(cb) {\n  var self = this\n  this.emit('preend')\n  onuncork(this, function() {\n    end(self._forwardEnd && self._writable, function() {\n      // haxx to not emit prefinish twice\n      if (self._writableState.prefinished === false) self._writableState.prefinished = true\n      self.emit('prefinish')\n      onuncork(self, cb)\n    })\n  })\n}\n\nDuplexify.prototype.end = function(data, enc, cb) {\n  if (typeof data === 'function') return this.end(null, null, data)\n  if (typeof enc === 'function') return this.end(data, null, enc)\n  this._ended = true\n  if (data) this.write(data)\n  if (!this._writableState.ending) this.write(SIGNAL_FLUSH)\n  return stream.Writable.prototype.end.call(this, cb)\n}\n\nmodule.exports = Duplexify\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/duplexify/index.js\n// module id = 817\n// module chunks = 0\n\n//# sourceURL=../node_modules/duplexify/index.js")},function(module,exports){eval('module.exports = {"secp128r1":{"p":"fffffffdffffffffffffffffffffffff","a":"fffffffdfffffffffffffffffffffffc","b":"e87579c11079f43dd824993c2cee5ed3","n":"fffffffe0000000075a30d1b9038a115","h":"01","Gx":"161ff7528b899b2d0c28607ca52c5b86","Gy":"cf5ac8395bafeb13c02da292dded7a83"},"secp160k1":{"p":"fffffffffffffffffffffffffffffffeffffac73","a":"00","b":"07","n":"0100000000000000000001b8fa16dfab9aca16b6b3","h":"01","Gx":"3b4c382ce37aa192a4019e763036f4f5dd4d7ebb","Gy":"938cf935318fdced6bc28286531733c3f03c4fee"},"secp160r1":{"p":"ffffffffffffffffffffffffffffffff7fffffff","a":"ffffffffffffffffffffffffffffffff7ffffffc","b":"1c97befc54bd7a8b65acf89f81d4d4adc565fa45","n":"0100000000000000000001f4c8f927aed3ca752257","h":"01","Gx":"4a96b5688ef573284664698968c38bb913cbfc82","Gy":"23a628553168947d59dcc912042351377ac5fb32"},"secp192k1":{"p":"fffffffffffffffffffffffffffffffffffffffeffffee37","a":"00","b":"03","n":"fffffffffffffffffffffffe26f2fc170f69466a74defd8d","h":"01","Gx":"db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d","Gy":"9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"},"secp192r1":{"p":"fffffffffffffffffffffffffffffffeffffffffffffffff","a":"fffffffffffffffffffffffffffffffefffffffffffffffc","b":"64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1","n":"ffffffffffffffffffffffff99def836146bc9b1b4d22831","h":"01","Gx":"188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012","Gy":"07192b95ffc8da78631011ed6b24cdd573f977a11e794811"},"secp256k1":{"p":"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","a":"00","b":"07","n":"fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","h":"01","Gx":"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","Gy":"483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"},"secp256r1":{"p":"ffffffff00000001000000000000000000000000ffffffffffffffffffffffff","a":"ffffffff00000001000000000000000000000000fffffffffffffffffffffffc","b":"5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b","n":"ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551","h":"01","Gx":"6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296","Gy":"4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ecurve/lib/curves.json\n// module id = 818\n// module chunks = 0\n\n//# sourceURL=../node_modules/ecurve/lib/curves.json')},function(module,exports,__webpack_require__){eval("var BigInteger = __webpack_require__(88)\n\nvar curves = __webpack_require__(818)\nvar Curve = __webpack_require__(401)\n\nfunction getCurveByName (name) {\n  var curve = curves[name]\n  if (!curve) return null\n\n  var p = new BigInteger(curve.p, 16)\n  var a = new BigInteger(curve.a, 16)\n  var b = new BigInteger(curve.b, 16)\n  var n = new BigInteger(curve.n, 16)\n  var h = new BigInteger(curve.h, 16)\n  var Gx = new BigInteger(curve.Gx, 16)\n  var Gy = new BigInteger(curve.Gy, 16)\n\n  return new Curve(p, a, b, Gx, Gy, n, h)\n}\n\nmodule.exports = getCurveByName\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ecurve/lib/names.js\n// module id = 819\n// module chunks = 0\n\n//# sourceURL=../node_modules/ecurve/lib/names.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(17);\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar getNAF = utils.getNAF;\nvar getJSF = utils.getJSF;\nvar assert = utils.assert;\n\nfunction BaseCurve(type, conf) {\n  this.type = type;\n  this.p = new BN(conf.p, 16);\n\n  // Use Montgomery, when there is no fast reduction for the prime\n  this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\n\n  // Useful for many curves\n  this.zero = new BN(0).toRed(this.red);\n  this.one = new BN(1).toRed(this.red);\n  this.two = new BN(2).toRed(this.red);\n\n  // Curve configuration, optional\n  this.n = conf.n && new BN(conf.n, 16);\n  this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n  // Temporary arrays\n  this._wnafT1 = new Array(4);\n  this._wnafT2 = new Array(4);\n  this._wnafT3 = new Array(4);\n  this._wnafT4 = new Array(4);\n\n  // Generalized Greg Maxwell's trick\n  var adjustCount = this.n && this.p.div(this.n);\n  if (!adjustCount || adjustCount.cmpn(100) > 0) {\n    this.redN = null;\n  } else {\n    this._maxwellTrick = true;\n    this.redN = this.n.toRed(this.red);\n  }\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n  assert(p.precomputed);\n  var doubles = p._getDoubles();\n\n  var naf = getNAF(k, 1);\n  var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n  I /= 3;\n\n  // Translate into more windowed form\n  var repr = [];\n  for (var j = 0; j < naf.length; j += doubles.step) {\n    var nafW = 0;\n    for (var k = j + doubles.step - 1; k >= j; k--)\n      nafW = (nafW << 1) + naf[k];\n    repr.push(nafW);\n  }\n\n  var a = this.jpoint(null, null, null);\n  var b = this.jpoint(null, null, null);\n  for (var i = I; i > 0; i--) {\n    for (var j = 0; j < repr.length; j++) {\n      var nafW = repr[j];\n      if (nafW === i)\n        b = b.mixedAdd(doubles.points[j]);\n      else if (nafW === -i)\n        b = b.mixedAdd(doubles.points[j].neg());\n    }\n    a = a.add(b);\n  }\n  return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n  var w = 4;\n\n  // Precompute window\n  var nafPoints = p._getNAFPoints(w);\n  w = nafPoints.wnd;\n  var wnd = nafPoints.points;\n\n  // Get NAF form\n  var naf = getNAF(k, w);\n\n  // Add `this`*(N+1) for every w-NAF index\n  var acc = this.jpoint(null, null, null);\n  for (var i = naf.length - 1; i >= 0; i--) {\n    // Count zeroes\n    for (var k = 0; i >= 0 && naf[i] === 0; i--)\n      k++;\n    if (i >= 0)\n      k++;\n    acc = acc.dblp(k);\n\n    if (i < 0)\n      break;\n    var z = naf[i];\n    assert(z !== 0);\n    if (p.type === 'affine') {\n      // J +- P\n      if (z > 0)\n        acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n    } else {\n      // J +- J\n      if (z > 0)\n        acc = acc.add(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.add(wnd[(-z - 1) >> 1].neg());\n    }\n  }\n  return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n                                                       points,\n                                                       coeffs,\n                                                       len,\n                                                       jacobianResult) {\n  var wndWidth = this._wnafT1;\n  var wnd = this._wnafT2;\n  var naf = this._wnafT3;\n\n  // Fill all arrays\n  var max = 0;\n  for (var i = 0; i < len; i++) {\n    var p = points[i];\n    var nafPoints = p._getNAFPoints(defW);\n    wndWidth[i] = nafPoints.wnd;\n    wnd[i] = nafPoints.points;\n  }\n\n  // Comb small window NAFs\n  for (var i = len - 1; i >= 1; i -= 2) {\n    var a = i - 1;\n    var b = i;\n    if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n      naf[a] = getNAF(coeffs[a], wndWidth[a]);\n      naf[b] = getNAF(coeffs[b], wndWidth[b]);\n      max = Math.max(naf[a].length, max);\n      max = Math.max(naf[b].length, max);\n      continue;\n    }\n\n    var comb = [\n      points[a], /* 1 */\n      null, /* 3 */\n      null, /* 5 */\n      points[b] /* 7 */\n    ];\n\n    // Try to avoid Projective points, if possible\n    if (points[a].y.cmp(points[b].y) === 0) {\n      comb[1] = points[a].add(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].add(points[b].neg());\n    } else {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    }\n\n    var index = [\n      -3, /* -1 -1 */\n      -1, /* -1 0 */\n      -5, /* -1 1 */\n      -7, /* 0 -1 */\n      0, /* 0 0 */\n      7, /* 0 1 */\n      5, /* 1 -1 */\n      1, /* 1 0 */\n      3  /* 1 1 */\n    ];\n\n    var jsf = getJSF(coeffs[a], coeffs[b]);\n    max = Math.max(jsf[0].length, max);\n    naf[a] = new Array(max);\n    naf[b] = new Array(max);\n    for (var j = 0; j < max; j++) {\n      var ja = jsf[0][j] | 0;\n      var jb = jsf[1][j] | 0;\n\n      naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n      naf[b][j] = 0;\n      wnd[a] = comb;\n    }\n  }\n\n  var acc = this.jpoint(null, null, null);\n  var tmp = this._wnafT4;\n  for (var i = max; i >= 0; i--) {\n    var k = 0;\n\n    while (i >= 0) {\n      var zero = true;\n      for (var j = 0; j < len; j++) {\n        tmp[j] = naf[j][i] | 0;\n        if (tmp[j] !== 0)\n          zero = false;\n      }\n      if (!zero)\n        break;\n      k++;\n      i--;\n    }\n    if (i >= 0)\n      k++;\n    acc = acc.dblp(k);\n    if (i < 0)\n      break;\n\n    for (var j = 0; j < len; j++) {\n      var z = tmp[j];\n      var p;\n      if (z === 0)\n        continue;\n      else if (z > 0)\n        p = wnd[j][(z - 1) >> 1];\n      else if (z < 0)\n        p = wnd[j][(-z - 1) >> 1].neg();\n\n      if (p.type === 'affine')\n        acc = acc.mixedAdd(p);\n      else\n        acc = acc.add(p);\n    }\n  }\n  // Zeroify references\n  for (var i = 0; i < len; i++)\n    wnd[i] = null;\n\n  if (jacobianResult)\n    return acc;\n  else\n    return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n  this.curve = curve;\n  this.type = type;\n  this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.eq = function eq(/*other*/) {\n  throw new Error('Not implemented');\n};\n\nBasePoint.prototype.validate = function validate() {\n  return this.curve.validate(this);\n};\n\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n  bytes = utils.toArray(bytes, enc);\n\n  var len = this.p.byteLength();\n\n  // uncompressed, hybrid-odd, hybrid-even\n  if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\n      bytes.length - 1 === 2 * len) {\n    if (bytes[0] === 0x06)\n      assert(bytes[bytes.length - 1] % 2 === 0);\n    else if (bytes[0] === 0x07)\n      assert(bytes[bytes.length - 1] % 2 === 1);\n\n    var res =  this.point(bytes.slice(1, 1 + len),\n                          bytes.slice(1 + len, 1 + 2 * len));\n\n    return res;\n  } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\n              bytes.length - 1 === len) {\n    return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\n  }\n  throw new Error('Unknown point format');\n};\n\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\n  return this.encode(enc, true);\n};\n\nBasePoint.prototype._encode = function _encode(compact) {\n  var len = this.curve.p.byteLength();\n  var x = this.getX().toArray('be', len);\n\n  if (compact)\n    return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n\n  return [ 0x04 ].concat(x, this.getY().toArray('be', len)) ;\n};\n\nBasePoint.prototype.encode = function encode(enc, compact) {\n  return utils.encode(this._encode(compact), enc);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n  if (this.precomputed)\n    return this;\n\n  var precomputed = {\n    doubles: null,\n    naf: null,\n    beta: null\n  };\n  precomputed.naf = this._getNAFPoints(8);\n  precomputed.doubles = this._getDoubles(4, power);\n  precomputed.beta = this._getBeta();\n  this.precomputed = precomputed;\n\n  return this;\n};\n\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\n  if (!this.precomputed)\n    return false;\n\n  var doubles = this.precomputed.doubles;\n  if (!doubles)\n    return false;\n\n  return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n  if (this.precomputed && this.precomputed.doubles)\n    return this.precomputed.doubles;\n\n  var doubles = [ this ];\n  var acc = this;\n  for (var i = 0; i < power; i += step) {\n    for (var j = 0; j < step; j++)\n      acc = acc.dbl();\n    doubles.push(acc);\n  }\n  return {\n    step: step,\n    points: doubles\n  };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n  if (this.precomputed && this.precomputed.naf)\n    return this.precomputed.naf;\n\n  var res = [ this ];\n  var max = (1 << wnd) - 1;\n  var dbl = max === 1 ? null : this.dbl();\n  for (var i = 1; i < max; i++)\n    res[i] = res[i - 1].add(dbl);\n  return {\n    wnd: wnd,\n    points: res\n  };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n  return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n  var r = this;\n  for (var i = 0; i < k; i++)\n    r = r.dbl();\n  return r;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curve/base.js\n// module id = 820\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/base.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(181);\nvar elliptic = __webpack_require__(28);\nvar BN = __webpack_require__(17);\nvar inherits = __webpack_require__(3);\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction EdwardsCurve(conf) {\n  // NOTE: Important as we are creating point in Base.call()\n  this.twisted = (conf.a | 0) !== 1;\n  this.mOneA = this.twisted && (conf.a | 0) === -1;\n  this.extended = this.mOneA;\n\n  Base.call(this, 'edwards', conf);\n\n  this.a = new BN(conf.a, 16).umod(this.red.m);\n  this.a = this.a.toRed(this.red);\n  this.c = new BN(conf.c, 16).toRed(this.red);\n  this.c2 = this.c.redSqr();\n  this.d = new BN(conf.d, 16).toRed(this.red);\n  this.dd = this.d.redAdd(this.d);\n\n  assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n  this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n  if (this.mOneA)\n    return num.redNeg();\n  else\n    return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n  if (this.oneC)\n    return num;\n  else\n    return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n  return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\n  x = new BN(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var x2 = x.redSqr();\n  var rhs = this.c2.redSub(this.a.redMul(x2));\n  var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n  var y2 = rhs.redMul(lhs.redInvm());\n  var y = y2.redSqrt();\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y);\n};\n\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\n  y = new BN(y, 16);\n  if (!y.red)\n    y = y.toRed(this.red);\n\n  // x^2 = (y^2 - 1) / (d y^2 + 1)\n  var y2 = y.redSqr();\n  var lhs = y2.redSub(this.one);\n  var rhs = y2.redMul(this.d).redAdd(this.one);\n  var x2 = lhs.redMul(rhs.redInvm());\n\n  if (x2.cmp(this.zero) === 0) {\n    if (odd)\n      throw new Error('invalid point');\n    else\n      return this.point(this.zero, y);\n  }\n\n  var x = x2.redSqrt();\n  if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  if (x.isOdd() !== odd)\n    x = x.redNeg();\n\n  return this.point(x, y);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n  if (point.isInfinity())\n    return true;\n\n  // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n  point.normalize();\n\n  var x2 = point.x.redSqr();\n  var y2 = point.y.redSqr();\n  var lhs = x2.redMul(this.a).redAdd(y2);\n  var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n  return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.zero;\n    this.y = this.curve.one;\n    this.z = this.curve.one;\n    this.t = this.curve.zero;\n    this.zOne = true;\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    this.z = z ? new BN(z, 16) : this.curve.one;\n    this.t = t && new BN(t, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n    if (this.t && !this.t.red)\n      this.t = this.t.toRed(this.curve.red);\n    this.zOne = this.z === this.curve.one;\n\n    // Use extended coordinates\n    if (this.curve.extended && !this.t) {\n      this.t = this.x.redMul(this.y);\n      if (!this.zOne)\n        this.t = this.t.redMul(this.z.redInvm());\n    }\n  }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n  return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.x.cmpn(0) === 0 &&\n         this.y.cmp(this.z) === 0;\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #doubling-dbl-2008-hwcd\n  // 4M + 4S\n\n  // A = X1^2\n  var a = this.x.redSqr();\n  // B = Y1^2\n  var b = this.y.redSqr();\n  // C = 2 * Z1^2\n  var c = this.z.redSqr();\n  c = c.redIAdd(c);\n  // D = a * A\n  var d = this.curve._mulA(a);\n  // E = (X1 + Y1)^2 - A - B\n  var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n  // G = D + B\n  var g = d.redAdd(b);\n  // F = G - C\n  var f = g.redSub(c);\n  // H = D - B\n  var h = d.redSub(b);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #doubling-dbl-2008-bbjlp\n  //     #doubling-dbl-2007-bl\n  // and others\n  // Generally 3M + 4S or 2M + 4S\n\n  // B = (X1 + Y1)^2\n  var b = this.x.redAdd(this.y).redSqr();\n  // C = X1^2\n  var c = this.x.redSqr();\n  // D = Y1^2\n  var d = this.y.redSqr();\n\n  var nx;\n  var ny;\n  var nz;\n  if (this.curve.twisted) {\n    // E = a * C\n    var e = this.curve._mulA(c);\n    // F = E + D\n    var f = e.redAdd(d);\n    if (this.zOne) {\n      // X3 = (B - C - D) * (F - 2)\n      nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F^2 - 2 * F\n      nz = f.redSqr().redSub(f).redSub(f);\n    } else {\n      // H = Z1^2\n      var h = this.z.redSqr();\n      // J = F - 2 * H\n      var j = f.redSub(h).redISub(h);\n      // X3 = (B-C-D)*J\n      nx = b.redSub(c).redISub(d).redMul(j);\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F * J\n      nz = f.redMul(j);\n    }\n  } else {\n    // E = C + D\n    var e = c.redAdd(d);\n    // H = (c * Z1)^2\n    var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();\n    // J = E - 2 * H\n    var j = e.redSub(h).redSub(h);\n    // X3 = c * (B - E) * J\n    nx = this.curve._mulC(b.redISub(e)).redMul(j);\n    // Y3 = c * E * (C - D)\n    ny = this.curve._mulC(e).redMul(c.redISub(d));\n    // Z3 = E * J\n    nz = e.redMul(j);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  // Double in extended coordinates\n  if (this.curve.extended)\n    return this._extDbl();\n  else\n    return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #addition-add-2008-hwcd-3\n  // 8M\n\n  // A = (Y1 - X1) * (Y2 - X2)\n  var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n  // B = (Y1 + X1) * (Y2 + X2)\n  var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n  // C = T1 * k * T2\n  var c = this.t.redMul(this.curve.dd).redMul(p.t);\n  // D = Z1 * 2 * Z2\n  var d = this.z.redMul(p.z.redAdd(p.z));\n  // E = B - A\n  var e = b.redSub(a);\n  // F = D - C\n  var f = d.redSub(c);\n  // G = D + C\n  var g = d.redAdd(c);\n  // H = B + A\n  var h = b.redAdd(a);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #addition-add-2008-bbjlp\n  //     #addition-add-2007-bl\n  // 10M + 1S\n\n  // A = Z1 * Z2\n  var a = this.z.redMul(p.z);\n  // B = A^2\n  var b = a.redSqr();\n  // C = X1 * X2\n  var c = this.x.redMul(p.x);\n  // D = Y1 * Y2\n  var d = this.y.redMul(p.y);\n  // E = d * C * D\n  var e = this.curve.d.redMul(c).redMul(d);\n  // F = B - E\n  var f = b.redSub(e);\n  // G = B + E\n  var g = b.redAdd(e);\n  // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n  var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n  var nx = a.redMul(f).redMul(tmp);\n  var ny;\n  var nz;\n  if (this.curve.twisted) {\n    // Y3 = A * G * (D - a * C)\n    ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n    // Z3 = F * G\n    nz = f.redMul(g);\n  } else {\n    // Y3 = A * G * (D - C)\n    ny = a.redMul(g).redMul(d.redSub(c));\n    // Z3 = c * F * G\n    nz = this.curve._mulC(f).redMul(g);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n  if (this.isInfinity())\n    return p;\n  if (p.isInfinity())\n    return this;\n\n  if (this.curve.extended)\n    return this._extAdd(p);\n  else\n    return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n  if (this._hasDoubles(k))\n    return this.curve._fixedNafMul(this, k);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\n};\n\nPoint.prototype.normalize = function normalize() {\n  if (this.zOne)\n    return this;\n\n  // Normalize coordinates\n  var zi = this.z.redInvm();\n  this.x = this.x.redMul(zi);\n  this.y = this.y.redMul(zi);\n  if (this.t)\n    this.t = this.t.redMul(zi);\n  this.z = this.curve.one;\n  this.zOne = true;\n  return this;\n};\n\nPoint.prototype.neg = function neg() {\n  return this.curve.point(this.x.redNeg(),\n                          this.y,\n                          this.z,\n                          this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n  this.normalize();\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  this.normalize();\n  return this.y.fromRed();\n};\n\nPoint.prototype.eq = function eq(other) {\n  return this === other ||\n         this.getX().cmp(other.getX()) === 0 &&\n         this.getY().cmp(other.getY()) === 0;\n};\n\nPoint.prototype.eqXToP = function eqXToP(x) {\n  var rx = x.toRed(this.curve.red).redMul(this.z);\n  if (this.x.cmp(rx) === 0)\n    return true;\n\n  var xc = x.clone();\n  var t = this.curve.redN.redMul(this.z);\n  for (;;) {\n    xc.iadd(this.curve.n);\n    if (xc.cmp(this.curve.p) >= 0)\n      return false;\n\n    rx.redIAdd(t);\n    if (this.x.cmp(rx) === 0)\n      return true;\n  }\n  return false;\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curve/edwards.js\n// module id = 821\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/edwards.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(181);\nvar BN = __webpack_require__(17);\nvar inherits = __webpack_require__(3);\nvar Base = curve.base;\n\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\n\nfunction MontCurve(conf) {\n  Base.call(this, 'mont', conf);\n\n  this.a = new BN(conf.a, 16).toRed(this.red);\n  this.b = new BN(conf.b, 16).toRed(this.red);\n  this.i4 = new BN(4).toRed(this.red).redInvm();\n  this.two = new BN(2).toRed(this.red);\n  this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n  var x = point.normalize().x;\n  var x2 = x.redSqr();\n  var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n  var y = rhs.redSqrt();\n\n  return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && z === null) {\n    this.x = this.curve.one;\n    this.z = this.curve.zero;\n  } else {\n    this.x = new BN(x, 16);\n    this.z = new BN(z, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n  }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\n  return this.point(utils.toArray(bytes, enc), 1);\n};\n\nMontCurve.prototype.point = function point(x, z) {\n  return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n  // No-op\n};\n\nPoint.prototype._encode = function _encode() {\n  return this.getX().toArray('be', this.curve.p.byteLength());\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n  // 2M + 2S + 4A\n\n  // A = X1 + Z1\n  var a = this.x.redAdd(this.z);\n  // AA = A^2\n  var aa = a.redSqr();\n  // B = X1 - Z1\n  var b = this.x.redSub(this.z);\n  // BB = B^2\n  var bb = b.redSqr();\n  // C = AA - BB\n  var c = aa.redSub(bb);\n  // X3 = AA * BB\n  var nx = aa.redMul(bb);\n  // Z3 = C * (BB + A24 * C)\n  var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n  // 4M + 2S + 6A\n\n  // A = X2 + Z2\n  var a = this.x.redAdd(this.z);\n  // B = X2 - Z2\n  var b = this.x.redSub(this.z);\n  // C = X3 + Z3\n  var c = p.x.redAdd(p.z);\n  // D = X3 - Z3\n  var d = p.x.redSub(p.z);\n  // DA = D * A\n  var da = d.redMul(a);\n  // CB = C * B\n  var cb = c.redMul(b);\n  // X5 = Z1 * (DA + CB)^2\n  var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n  // Z5 = X1 * (DA - CB)^2\n  var nz = diff.x.redMul(da.redISub(cb).redSqr());\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n  var t = k.clone();\n  var a = this; // (N / 2) * Q + Q\n  var b = this.curve.point(null, null); // (N / 2) * Q\n  var c = this; // Q\n\n  for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\n    bits.push(t.andln(1));\n\n  for (var i = bits.length - 1; i >= 0; i--) {\n    if (bits[i] === 0) {\n      // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n      a = a.diffAdd(b, c);\n      // N * Q = 2 * ((N / 2) * Q + Q))\n      b = b.dbl();\n    } else {\n      // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n      b = a.diffAdd(b, c);\n      // N * Q + Q = 2 * ((N / 2) * Q + Q)\n      a = a.dbl();\n    }\n  }\n  return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.jumlAdd = function jumlAdd() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.eq = function eq(other) {\n  return this.getX().cmp(other.getX()) === 0;\n};\n\nPoint.prototype.normalize = function normalize() {\n  this.x = this.x.redMul(this.z.redInvm());\n  this.z = this.curve.one;\n  return this;\n};\n\nPoint.prototype.getX = function getX() {\n  // Normalize coordinates\n  this.normalize();\n\n  return this.x.fromRed();\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curve/mont.js\n// module id = 822\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/mont.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(181);\nvar elliptic = __webpack_require__(28);\nvar BN = __webpack_require__(17);\nvar inherits = __webpack_require__(3);\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction ShortCurve(conf) {\n  Base.call(this, 'short', conf);\n\n  this.a = new BN(conf.a, 16).toRed(this.red);\n  this.b = new BN(conf.b, 16).toRed(this.red);\n  this.tinv = this.two.redInvm();\n\n  this.zeroA = this.a.fromRed().cmpn(0) === 0;\n  this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n  // If the curve is endomorphic, precalculate beta and lambda\n  this.endo = this._getEndomorphism(conf);\n  this._endoWnafT1 = new Array(4);\n  this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n  // No efficient endomorphism\n  if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n    return;\n\n  // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n  var beta;\n  var lambda;\n  if (conf.beta) {\n    beta = new BN(conf.beta, 16).toRed(this.red);\n  } else {\n    var betas = this._getEndoRoots(this.p);\n    // Choose the smallest beta\n    beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n    beta = beta.toRed(this.red);\n  }\n  if (conf.lambda) {\n    lambda = new BN(conf.lambda, 16);\n  } else {\n    // Choose the lambda that is matching selected beta\n    var lambdas = this._getEndoRoots(this.n);\n    if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n      lambda = lambdas[0];\n    } else {\n      lambda = lambdas[1];\n      assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n    }\n  }\n\n  // Get basis vectors, used for balanced length-two representation\n  var basis;\n  if (conf.basis) {\n    basis = conf.basis.map(function(vec) {\n      return {\n        a: new BN(vec.a, 16),\n        b: new BN(vec.b, 16)\n      };\n    });\n  } else {\n    basis = this._getEndoBasis(lambda);\n  }\n\n  return {\n    beta: beta,\n    lambda: lambda,\n    basis: basis\n  };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n  // Find roots of for x^2 + x + 1 in F\n  // Root = (-1 +- Sqrt(-3)) / 2\n  //\n  var red = num === this.p ? this.red : BN.mont(num);\n  var tinv = new BN(2).toRed(red).redInvm();\n  var ntinv = tinv.redNeg();\n\n  var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n  var l1 = ntinv.redAdd(s).fromRed();\n  var l2 = ntinv.redSub(s).fromRed();\n  return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n  // aprxSqrt >= sqrt(this.n)\n  var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\n\n  // 3.74\n  // Run EGCD, until r(L + 1) < aprxSqrt\n  var u = lambda;\n  var v = this.n.clone();\n  var x1 = new BN(1);\n  var y1 = new BN(0);\n  var x2 = new BN(0);\n  var y2 = new BN(1);\n\n  // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n  var a0;\n  var b0;\n  // First vector\n  var a1;\n  var b1;\n  // Second vector\n  var a2;\n  var b2;\n\n  var prevR;\n  var i = 0;\n  var r;\n  var x;\n  while (u.cmpn(0) !== 0) {\n    var q = v.div(u);\n    r = v.sub(q.mul(u));\n    x = x2.sub(q.mul(x1));\n    var y = y2.sub(q.mul(y1));\n\n    if (!a1 && r.cmp(aprxSqrt) < 0) {\n      a0 = prevR.neg();\n      b0 = x1;\n      a1 = r.neg();\n      b1 = x;\n    } else if (a1 && ++i === 2) {\n      break;\n    }\n    prevR = r;\n\n    v = u;\n    u = r;\n    x2 = x1;\n    x1 = x;\n    y2 = y1;\n    y1 = y;\n  }\n  a2 = r.neg();\n  b2 = x;\n\n  var len1 = a1.sqr().add(b1.sqr());\n  var len2 = a2.sqr().add(b2.sqr());\n  if (len2.cmp(len1) >= 0) {\n    a2 = a0;\n    b2 = b0;\n  }\n\n  // Normalize signs\n  if (a1.negative) {\n    a1 = a1.neg();\n    b1 = b1.neg();\n  }\n  if (a2.negative) {\n    a2 = a2.neg();\n    b2 = b2.neg();\n  }\n\n  return [\n    { a: a1, b: b1 },\n    { a: a2, b: b2 }\n  ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n  var basis = this.endo.basis;\n  var v1 = basis[0];\n  var v2 = basis[1];\n\n  var c1 = v2.b.mul(k).divRound(this.n);\n  var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n  var p1 = c1.mul(v1.a);\n  var p2 = c2.mul(v2.a);\n  var q1 = c1.mul(v1.b);\n  var q2 = c2.mul(v2.b);\n\n  // Calculate answer\n  var k1 = k.sub(p1).sub(p2);\n  var k2 = q1.add(q2).neg();\n  return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\n  x = new BN(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n  var y = y2.redSqrt();\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\n    throw new Error('invalid point');\n\n  // XXX Is there any way to tell if the number is odd without converting it\n  // to non-red form?\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n  if (point.inf)\n    return true;\n\n  var x = point.x;\n  var y = point.y;\n\n  var ax = this.a.redMul(x);\n  var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n  return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n    function _endoWnafMulAdd(points, coeffs, jacobianResult) {\n  var npoints = this._endoWnafT1;\n  var ncoeffs = this._endoWnafT2;\n  for (var i = 0; i < points.length; i++) {\n    var split = this._endoSplit(coeffs[i]);\n    var p = points[i];\n    var beta = p._getBeta();\n\n    if (split.k1.negative) {\n      split.k1.ineg();\n      p = p.neg(true);\n    }\n    if (split.k2.negative) {\n      split.k2.ineg();\n      beta = beta.neg(true);\n    }\n\n    npoints[i * 2] = p;\n    npoints[i * 2 + 1] = beta;\n    ncoeffs[i * 2] = split.k1;\n    ncoeffs[i * 2 + 1] = split.k2;\n  }\n  var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\n\n  // Clean-up references to points and coefficients\n  for (var j = 0; j < i * 2; j++) {\n    npoints[j] = null;\n    ncoeffs[j] = null;\n  }\n  return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n  Base.BasePoint.call(this, curve, 'affine');\n  if (x === null && y === null) {\n    this.x = null;\n    this.y = null;\n    this.inf = true;\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    // Force redgomery representation when loading from JSON\n    if (isRed) {\n      this.x.forceRed(this.curve.red);\n      this.y.forceRed(this.curve.red);\n    }\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    this.inf = false;\n  }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n  return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n  return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n  if (!this.curve.endo)\n    return;\n\n  var pre = this.precomputed;\n  if (pre && pre.beta)\n    return pre.beta;\n\n  var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n  if (pre) {\n    var curve = this.curve;\n    var endoMul = function(p) {\n      return curve.point(p.x.redMul(curve.endo.beta), p.y);\n    };\n    pre.beta = beta;\n    beta.precomputed = {\n      beta: null,\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(endoMul)\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(endoMul)\n      }\n    };\n  }\n  return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n  if (!this.precomputed)\n    return [ this.x, this.y ];\n\n  return [ this.x, this.y, this.precomputed && {\n    doubles: this.precomputed.doubles && {\n      step: this.precomputed.doubles.step,\n      points: this.precomputed.doubles.points.slice(1)\n    },\n    naf: this.precomputed.naf && {\n      wnd: this.precomputed.naf.wnd,\n      points: this.precomputed.naf.points.slice(1)\n    }\n  } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n  if (typeof obj === 'string')\n    obj = JSON.parse(obj);\n  var res = curve.point(obj[0], obj[1], red);\n  if (!obj[2])\n    return res;\n\n  function obj2point(obj) {\n    return curve.point(obj[0], obj[1], red);\n  }\n\n  var pre = obj[2];\n  res.precomputed = {\n    beta: null,\n    doubles: pre.doubles && {\n      step: pre.doubles.step,\n      points: [ res ].concat(pre.doubles.points.map(obj2point))\n    },\n    naf: pre.naf && {\n      wnd: pre.naf.wnd,\n      points: [ res ].concat(pre.naf.points.map(obj2point))\n    }\n  };\n  return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.inf)\n    return p;\n\n  // P + O = P\n  if (p.inf)\n    return this;\n\n  // P + P = 2P\n  if (this.eq(p))\n    return this.dbl();\n\n  // P + (-P) = O\n  if (this.neg().eq(p))\n    return this.curve.point(null, null);\n\n  // P + Q = O\n  if (this.x.cmp(p.x) === 0)\n    return this.curve.point(null, null);\n\n  var c = this.y.redSub(p.y);\n  if (c.cmpn(0) !== 0)\n    c = c.redMul(this.x.redSub(p.x).redInvm());\n  var nx = c.redSqr().redISub(this.x).redISub(p.x);\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.inf)\n    return this;\n\n  // 2P = O\n  var ys1 = this.y.redAdd(this.y);\n  if (ys1.cmpn(0) === 0)\n    return this.curve.point(null, null);\n\n  var a = this.curve.a;\n\n  var x2 = this.x.redSqr();\n  var dyinv = ys1.redInvm();\n  var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n  var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n  k = new BN(k, 16);\n\n  if (this._hasDoubles(k))\n    return this.curve._fixedNafMul(this, k);\n  else if (this.curve.endo)\n    return this.curve._endoWnafMulAdd([ this ], [ k ]);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n  var points = [ this, p2 ];\n  var coeffs = [ k1, k2 ];\n  if (this.curve.endo)\n    return this.curve._endoWnafMulAdd(points, coeffs);\n  else\n    return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\n  var points = [ this, p2 ];\n  var coeffs = [ k1, k2 ];\n  if (this.curve.endo)\n    return this.curve._endoWnafMulAdd(points, coeffs, true);\n  else\n    return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\n};\n\nPoint.prototype.eq = function eq(p) {\n  return this === p ||\n         this.inf === p.inf &&\n             (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n  if (this.inf)\n    return this;\n\n  var res = this.curve.point(this.x, this.y.redNeg());\n  if (_precompute && this.precomputed) {\n    var pre = this.precomputed;\n    var negate = function(p) {\n      return p.neg();\n    };\n    res.precomputed = {\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(negate)\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(negate)\n      }\n    };\n  }\n  return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n  if (this.inf)\n    return this.curve.jpoint(null, null, null);\n\n  var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n  return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n  Base.BasePoint.call(this, curve, 'jacobian');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.one;\n    this.y = this.curve.one;\n    this.z = new BN(0);\n  } else {\n    this.x = new BN(x, 16);\n    this.y = new BN(y, 16);\n    this.z = new BN(z, 16);\n  }\n  if (!this.x.red)\n    this.x = this.x.toRed(this.curve.red);\n  if (!this.y.red)\n    this.y = this.y.toRed(this.curve.red);\n  if (!this.z.red)\n    this.z = this.z.toRed(this.curve.red);\n\n  this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n  return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n  if (this.isInfinity())\n    return this.curve.point(null, null);\n\n  var zinv = this.z.redInvm();\n  var zinv2 = zinv.redSqr();\n  var ax = this.x.redMul(zinv2);\n  var ay = this.y.redMul(zinv2).redMul(zinv);\n\n  return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n  return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p;\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 12M + 4S + 7A\n  var pz2 = p.z.redSqr();\n  var z2 = this.z.redSqr();\n  var u1 = this.x.redMul(pz2);\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y.redMul(pz2.redMul(p.z));\n  var s2 = p.y.redMul(z2.redMul(this.z));\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(p.z).redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p.toJ();\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 8M + 3S + 7A\n  var z2 = this.z.redSqr();\n  var u1 = this.x;\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y;\n  var s2 = p.y.redMul(z2).redMul(this.z);\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n  if (pow === 0)\n    return this;\n  if (this.isInfinity())\n    return this;\n  if (!pow)\n    return this.dbl();\n\n  if (this.curve.zeroA || this.curve.threeA) {\n    var r = this;\n    for (var i = 0; i < pow; i++)\n      r = r.dbl();\n    return r;\n  }\n\n  // 1M + 2S + 1A + N * (4S + 5M + 8A)\n  // N = 1 => 6M + 6S + 9A\n  var a = this.curve.a;\n  var tinv = this.curve.tinv;\n\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  // Reuse results\n  var jyd = jy.redAdd(jy);\n  for (var i = 0; i < pow; i++) {\n    var jx2 = jx.redSqr();\n    var jyd2 = jyd.redSqr();\n    var jyd4 = jyd2.redSqr();\n    var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n    var t1 = jx.redMul(jyd2);\n    var nx = c.redSqr().redISub(t1.redAdd(t1));\n    var t2 = t1.redISub(nx);\n    var dny = c.redMul(t2);\n    dny = dny.redIAdd(dny).redISub(jyd4);\n    var nz = jyd.redMul(jz);\n    if (i + 1 < pow)\n      jz4 = jz4.redMul(jyd4);\n\n    jx = nx;\n    jz = nz;\n    jyd = dny;\n  }\n\n  return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  if (this.curve.zeroA)\n    return this._zeroDbl();\n  else if (this.curve.threeA)\n    return this._threeDbl();\n  else\n    return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 14A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a; a = 0\n    var m = xx.redAdd(xx).redIAdd(xx);\n    // T = M ^ 2 - 2*S\n    var t = m.redSqr().redISub(s).redISub(s);\n\n    // 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2*Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-dbl-2009-l\n    // 2M + 5S + 13A\n\n    // A = X1^2\n    var a = this.x.redSqr();\n    // B = Y1^2\n    var b = this.y.redSqr();\n    // C = B^2\n    var c = b.redSqr();\n    // D = 2 * ((X1 + B)^2 - A - C)\n    var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n    d = d.redIAdd(d);\n    // E = 3 * A\n    var e = a.redAdd(a).redIAdd(a);\n    // F = E^2\n    var f = e.redSqr();\n\n    // 8 * C\n    var c8 = c.redIAdd(c);\n    c8 = c8.redIAdd(c8);\n    c8 = c8.redIAdd(c8);\n\n    // X3 = F - 2 * D\n    nx = f.redISub(d).redISub(d);\n    // Y3 = E * (D - X3) - 8 * C\n    ny = e.redMul(d.redISub(nx)).redISub(c8);\n    // Z3 = 2 * Y1 * Z1\n    nz = this.y.redMul(this.z);\n    nz = nz.redIAdd(nz);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 15A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a\n    var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n    // T = M^2 - 2 * S\n    var t = m.redSqr().redISub(s).redISub(s);\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2 * Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n    // 3M + 5S\n\n    // delta = Z1^2\n    var delta = this.z.redSqr();\n    // gamma = Y1^2\n    var gamma = this.y.redSqr();\n    // beta = X1 * gamma\n    var beta = this.x.redMul(gamma);\n    // alpha = 3 * (X1 - delta) * (X1 + delta)\n    var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n    alpha = alpha.redAdd(alpha).redIAdd(alpha);\n    // X3 = alpha^2 - 8 * beta\n    var beta4 = beta.redIAdd(beta);\n    beta4 = beta4.redIAdd(beta4);\n    var beta8 = beta4.redAdd(beta4);\n    nx = alpha.redSqr().redISub(beta8);\n    // Z3 = (Y1 + Z1)^2 - gamma - delta\n    nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n    // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n    var ggamma8 = gamma.redSqr();\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n  var a = this.curve.a;\n\n  // 4M + 6S + 10A\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  var jx2 = jx.redSqr();\n  var jy2 = jy.redSqr();\n\n  var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n  var jxd4 = jx.redAdd(jx);\n  jxd4 = jxd4.redIAdd(jxd4);\n  var t1 = jxd4.redMul(jy2);\n  var nx = c.redSqr().redISub(t1.redAdd(t1));\n  var t2 = t1.redISub(nx);\n\n  var jyd8 = jy2.redSqr();\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  var ny = c.redMul(t2).redISub(jyd8);\n  var nz = jy.redAdd(jy).redMul(jz);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n  if (!this.curve.zeroA)\n    return this.dbl().add(this);\n\n  // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n  // 5M + 10S + ...\n\n  // XX = X1^2\n  var xx = this.x.redSqr();\n  // YY = Y1^2\n  var yy = this.y.redSqr();\n  // ZZ = Z1^2\n  var zz = this.z.redSqr();\n  // YYYY = YY^2\n  var yyyy = yy.redSqr();\n  // M = 3 * XX + a * ZZ2; a = 0\n  var m = xx.redAdd(xx).redIAdd(xx);\n  // MM = M^2\n  var mm = m.redSqr();\n  // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n  var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n  e = e.redIAdd(e);\n  e = e.redAdd(e).redIAdd(e);\n  e = e.redISub(mm);\n  // EE = E^2\n  var ee = e.redSqr();\n  // T = 16*YYYY\n  var t = yyyy.redIAdd(yyyy);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  // U = (M + E)^2 - MM - EE - T\n  var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n  // X3 = 4 * (X1 * EE - 4 * YY * U)\n  var yyu4 = yy.redMul(u);\n  yyu4 = yyu4.redIAdd(yyu4);\n  yyu4 = yyu4.redIAdd(yyu4);\n  var nx = this.x.redMul(ee).redISub(yyu4);\n  nx = nx.redIAdd(nx);\n  nx = nx.redIAdd(nx);\n  // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n  var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  // Z3 = (Z1 + E)^2 - ZZ - EE\n  var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n  k = new BN(k, kbase);\n\n  return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n  if (p.type === 'affine')\n    return this.eq(p.toJ());\n\n  if (this === p)\n    return true;\n\n  // x1 * z2^2 == x2 * z1^2\n  var z2 = this.z.redSqr();\n  var pz2 = p.z.redSqr();\n  if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n    return false;\n\n  // y1 * z2^3 == y2 * z1^3\n  var z3 = z2.redMul(this.z);\n  var pz3 = pz2.redMul(p.z);\n  return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.eqXToP = function eqXToP(x) {\n  var zs = this.z.redSqr();\n  var rx = x.toRed(this.curve.red).redMul(zs);\n  if (this.x.cmp(rx) === 0)\n    return true;\n\n  var xc = x.clone();\n  var t = this.curve.redN.redMul(zs);\n  for (;;) {\n    xc.iadd(this.curve.n);\n    if (xc.cmp(this.curve.p) >= 0)\n      return false;\n\n    rx.redIAdd(t);\n    if (this.x.cmp(rx) === 0)\n      return true;\n  }\n  return false;\n};\n\nJPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC JPoint Infinity>';\n  return '<EC JPoint x: ' + this.x.toString(16, 2) +\n      ' y: ' + this.y.toString(16, 2) +\n      ' z: ' + this.z.toString(16, 2) + '>';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curve/short.js\n// module id = 823\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/short.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curves = exports;\n\nvar hash = __webpack_require__(263);\nvar elliptic = __webpack_require__(28);\n\nvar assert = elliptic.utils.assert;\n\nfunction PresetCurve(options) {\n  if (options.type === 'short')\n    this.curve = new elliptic.curve.short(options);\n  else if (options.type === 'edwards')\n    this.curve = new elliptic.curve.edwards(options);\n  else\n    this.curve = new elliptic.curve.mont(options);\n  this.g = this.curve.g;\n  this.n = this.curve.n;\n  this.hash = options.hash;\n\n  assert(this.g.validate(), 'Invalid curve');\n  assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n  Object.defineProperty(curves, name, {\n    configurable: true,\n    enumerable: true,\n    get: function() {\n      var curve = new PresetCurve(options);\n      Object.defineProperty(curves, name, {\n        configurable: true,\n        enumerable: true,\n        value: curve\n      });\n      return curve;\n    }\n  });\n}\n\ndefineCurve('p192', {\n  type: 'short',\n  prime: 'p192',\n  p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n  b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n  n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n    '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'\n  ]\n});\n\ndefineCurve('p224', {\n  type: 'short',\n  prime: 'p224',\n  p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n  b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n  n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n    'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'\n  ]\n});\n\ndefineCurve('p256', {\n  type: 'short',\n  prime: null,\n  p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n  a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n  b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n  n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n    '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'\n  ]\n});\n\ndefineCurve('p384', {\n  type: 'short',\n  prime: null,\n  p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'fffffffe ffffffff 00000000 00000000 ffffffff',\n  a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'fffffffe ffffffff 00000000 00000000 fffffffc',\n  b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' +\n     '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef',\n  n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' +\n     'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973',\n  hash: hash.sha384,\n  gRed: false,\n  g: [\n    'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' +\n    '5502f25d bf55296c 3a545e38 72760ab7',\n    '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' +\n    '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f'\n  ]\n});\n\ndefineCurve('p521', {\n  type: 'short',\n  prime: null,\n  p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff',\n  a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff ffffffff ffffffff fffffffc',\n  b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' +\n     '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' +\n     '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00',\n  n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' +\n     'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' +\n     'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409',\n  hash: hash.sha512,\n  gRed: false,\n  g: [\n    '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' +\n    '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' +\n    'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66',\n    '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' +\n    '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' +\n    '3fad0761 353c7086 a272c240 88be9476 9fd16650'\n  ]\n});\n\ndefineCurve('curve25519', {\n  type: 'mont',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '76d06',\n  b: '1',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '9'\n  ]\n});\n\ndefineCurve('ed25519', {\n  type: 'edwards',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '-1',\n  c: '1',\n  // -121665 * (121666^(-1)) (mod P)\n  d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n    // 4/5\n    '6666666666666666666666666666666666666666666666666666666666666658'\n  ]\n});\n\nvar pre;\ntry {\n  pre = __webpack_require__(831);\n} catch (e) {\n  pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n  type: 'short',\n  prime: 'k256',\n  p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n  a: '0',\n  b: '7',\n  n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n  h: '1',\n  hash: hash.sha256,\n\n  // Precomputed endomorphism\n  beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n  lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n  basis: [\n    {\n      a: '3086d221a7d46bcde86c90e49284eb15',\n      b: '-e4437ed6010e88286f547fa90abfe4c3'\n    },\n    {\n      a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n      b: '3086d221a7d46bcde86c90e49284eb15'\n    }\n  ],\n\n  gRed: false,\n  g: [\n    '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n    '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n    pre\n  ]\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/curves.js\n// module id = 824\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curves.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(17);\nvar HmacDRBG = __webpack_require__(878);\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nvar KeyPair = __webpack_require__(826);\nvar Signature = __webpack_require__(827);\n\nfunction EC(options) {\n  if (!(this instanceof EC))\n    return new EC(options);\n\n  // Shortcut `elliptic.ec(curve-name)`\n  if (typeof options === 'string') {\n    assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n    options = elliptic.curves[options];\n  }\n\n  // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n  if (options instanceof elliptic.curves.PresetCurve)\n    options = { curve: options };\n\n  this.curve = options.curve.curve;\n  this.n = this.curve.n;\n  this.nh = this.n.ushrn(1);\n  this.g = this.curve.g;\n\n  // Point on curve\n  this.g = options.curve.g;\n  this.g.precompute(options.curve.n.bitLength() + 1);\n\n  // Hash for function for DRBG\n  this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n  return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n  return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n  return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n  if (!options)\n    options = {};\n\n  // Instantiate Hmac_DRBG\n  var drbg = new HmacDRBG({\n    hash: this.hash,\n    pers: options.pers,\n    persEnc: options.persEnc || 'utf8',\n    entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),\n    entropyEnc: options.entropy && options.entropyEnc || 'utf8',\n    nonce: this.n.toArray()\n  });\n\n  var bytes = this.n.byteLength();\n  var ns2 = this.n.sub(new BN(2));\n  do {\n    var priv = new BN(drbg.generate(bytes));\n    if (priv.cmp(ns2) > 0)\n      continue;\n\n    priv.iaddn(1);\n    return this.keyFromPrivate(priv);\n  } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\n  var delta = msg.byteLength() * 8 - this.n.bitLength();\n  if (delta > 0)\n    msg = msg.ushrn(delta);\n  if (!truncOnly && msg.cmp(this.n) >= 0)\n    return msg.sub(this.n);\n  else\n    return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n  if (typeof enc === 'object') {\n    options = enc;\n    enc = null;\n  }\n  if (!options)\n    options = {};\n\n  key = this.keyFromPrivate(key, enc);\n  msg = this._truncateToN(new BN(msg, 16));\n\n  // Zero-extend key to provide enough entropy\n  var bytes = this.n.byteLength();\n  var bkey = key.getPrivate().toArray('be', bytes);\n\n  // Zero-extend nonce to have the same byte size as N\n  var nonce = msg.toArray('be', bytes);\n\n  // Instantiate Hmac_DRBG\n  var drbg = new HmacDRBG({\n    hash: this.hash,\n    entropy: bkey,\n    nonce: nonce,\n    pers: options.pers,\n    persEnc: options.persEnc || 'utf8'\n  });\n\n  // Number of bytes to generate\n  var ns1 = this.n.sub(new BN(1));\n\n  for (var iter = 0; true; iter++) {\n    var k = options.k ?\n        options.k(iter) :\n        new BN(drbg.generate(this.n.byteLength()));\n    k = this._truncateToN(k, true);\n    if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n      continue;\n\n    var kp = this.g.mul(k);\n    if (kp.isInfinity())\n      continue;\n\n    var kpX = kp.getX();\n    var r = kpX.umod(this.n);\n    if (r.cmpn(0) === 0)\n      continue;\n\n    var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\n    s = s.umod(this.n);\n    if (s.cmpn(0) === 0)\n      continue;\n\n    var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\n                        (kpX.cmp(r) !== 0 ? 2 : 0);\n\n    // Use complement of `s`, if it is > `n / 2`\n    if (options.canonical && s.cmp(this.nh) > 0) {\n      s = this.n.sub(s);\n      recoveryParam ^= 1;\n    }\n\n    return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\n  }\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n  msg = this._truncateToN(new BN(msg, 16));\n  key = this.keyFromPublic(key, enc);\n  signature = new Signature(signature, 'hex');\n\n  // Perform primitive values validation\n  var r = signature.r;\n  var s = signature.s;\n  if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n    return false;\n  if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n    return false;\n\n  // Validate signature\n  var sinv = s.invm(this.n);\n  var u1 = sinv.mul(msg).umod(this.n);\n  var u2 = sinv.mul(r).umod(this.n);\n\n  if (!this.curve._maxwellTrick) {\n    var p = this.g.mulAdd(u1, key.getPublic(), u2);\n    if (p.isInfinity())\n      return false;\n\n    return p.getX().umod(this.n).cmp(r) === 0;\n  }\n\n  // NOTE: Greg Maxwell's trick, inspired by:\n  // https://git.io/vad3K\n\n  var p = this.g.jmulAdd(u1, key.getPublic(), u2);\n  if (p.isInfinity())\n    return false;\n\n  // Compare `p.x` of Jacobian point with `r`,\n  // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\n  // inverse of `p.z^2`\n  return p.eqXToP(r);\n};\n\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\n  assert((3 & j) === j, 'The recovery param is more than two bits');\n  signature = new Signature(signature, enc);\n\n  var n = this.n;\n  var e = new BN(msg);\n  var r = signature.r;\n  var s = signature.s;\n\n  // A set LSB signifies that the y-coordinate is odd\n  var isYOdd = j & 1;\n  var isSecondKey = j >> 1;\n  if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\n    throw new Error('Unable to find sencond key candinate');\n\n  // 1.1. Let x = r + jn.\n  if (isSecondKey)\n    r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\n  else\n    r = this.curve.pointFromX(r, isYOdd);\n\n  var rInv = signature.r.invm(n);\n  var s1 = n.sub(e).mul(rInv).umod(n);\n  var s2 = s.mul(rInv).umod(n);\n\n  // 1.6.1 Compute Q = r^-1 (sR -  eG)\n  //               Q = r^-1 (sR + -eG)\n  return this.g.mulAdd(s1, r, s2);\n};\n\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\n  signature = new Signature(signature, enc);\n  if (signature.recoveryParam !== null)\n    return signature.recoveryParam;\n\n  for (var i = 0; i < 4; i++) {\n    var Qprime;\n    try {\n      Qprime = this.recoverPubKey(e, signature, i);\n    } catch (e) {\n      continue;\n    }\n\n    if (Qprime.eq(Q))\n      return i;\n  }\n  throw new Error('Unable to find valid recovery factor');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/ec/index.js\n// module id = 825\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(17);\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction KeyPair(ec, options) {\n  this.ec = ec;\n  this.priv = null;\n  this.pub = null;\n\n  // KeyPair(ec, { priv: ..., pub: ... })\n  if (options.priv)\n    this._importPrivate(options.priv, options.privEnc);\n  if (options.pub)\n    this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n  if (pub instanceof KeyPair)\n    return pub;\n\n  return new KeyPair(ec, {\n    pub: pub,\n    pubEnc: enc\n  });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n  if (priv instanceof KeyPair)\n    return priv;\n\n  return new KeyPair(ec, {\n    priv: priv,\n    privEnc: enc\n  });\n};\n\nKeyPair.prototype.validate = function validate() {\n  var pub = this.getPublic();\n\n  if (pub.isInfinity())\n    return { result: false, reason: 'Invalid public key' };\n  if (!pub.validate())\n    return { result: false, reason: 'Public key is not a point' };\n  if (!pub.mul(this.ec.curve.n).isInfinity())\n    return { result: false, reason: 'Public key * N != O' };\n\n  return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n  // compact is optional argument\n  if (typeof compact === 'string') {\n    enc = compact;\n    compact = null;\n  }\n\n  if (!this.pub)\n    this.pub = this.ec.g.mul(this.priv);\n\n  if (!enc)\n    return this.pub;\n\n  return this.pub.encode(enc, compact);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n  if (enc === 'hex')\n    return this.priv.toString(16, 2);\n  else\n    return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n  this.priv = new BN(key, enc || 16);\n\n  // Ensure that the priv won't be bigger than n, otherwise we may fail\n  // in fixed multiplication method\n  this.priv = this.priv.umod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n  if (key.x || key.y) {\n    // Montgomery points only have an `x` coordinate.\n    // Weierstrass/Edwards points on the other hand have both `x` and\n    // `y` coordinates.\n    if (this.ec.curve.type === 'mont') {\n      assert(key.x, 'Need x coordinate');\n    } else if (this.ec.curve.type === 'short' ||\n               this.ec.curve.type === 'edwards') {\n      assert(key.x && key.y, 'Need both x and y coordinate');\n    }\n    this.pub = this.ec.curve.point(key.x, key.y);\n    return;\n  }\n  this.pub = this.ec.curve.decodePoint(key, enc);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n  return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg, enc, options) {\n  return this.ec.sign(msg, this, enc, options);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n  return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n  return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +\n         ' pub: ' + (this.pub && this.pub.inspect()) + ' >';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/ec/key.js\n// module id = 826\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/key.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(17);\n\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n  if (options instanceof Signature)\n    return options;\n\n  if (this._importDER(options, enc))\n    return;\n\n  assert(options.r && options.s, 'Signature without r or s');\n  this.r = new BN(options.r, 16);\n  this.s = new BN(options.s, 16);\n  if (options.recoveryParam === undefined)\n    this.recoveryParam = null;\n  else\n    this.recoveryParam = options.recoveryParam;\n}\nmodule.exports = Signature;\n\nfunction Position() {\n  this.place = 0;\n}\n\nfunction getLength(buf, p) {\n  var initial = buf[p.place++];\n  if (!(initial & 0x80)) {\n    return initial;\n  }\n  var octetLen = initial & 0xf;\n  var val = 0;\n  for (var i = 0, off = p.place; i < octetLen; i++, off++) {\n    val <<= 8;\n    val |= buf[off];\n  }\n  p.place = off;\n  return val;\n}\n\nfunction rmPadding(buf) {\n  var i = 0;\n  var len = buf.length - 1;\n  while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\n    i++;\n  }\n  if (i === 0) {\n    return buf;\n  }\n  return buf.slice(i);\n}\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n  data = utils.toArray(data, enc);\n  var p = new Position();\n  if (data[p.place++] !== 0x30) {\n    return false;\n  }\n  var len = getLength(data, p);\n  if ((len + p.place) !== data.length) {\n    return false;\n  }\n  if (data[p.place++] !== 0x02) {\n    return false;\n  }\n  var rlen = getLength(data, p);\n  var r = data.slice(p.place, rlen + p.place);\n  p.place += rlen;\n  if (data[p.place++] !== 0x02) {\n    return false;\n  }\n  var slen = getLength(data, p);\n  if (data.length !== slen + p.place) {\n    return false;\n  }\n  var s = data.slice(p.place, slen + p.place);\n  if (r[0] === 0 && (r[1] & 0x80)) {\n    r = r.slice(1);\n  }\n  if (s[0] === 0 && (s[1] & 0x80)) {\n    s = s.slice(1);\n  }\n\n  this.r = new BN(r);\n  this.s = new BN(s);\n  this.recoveryParam = null;\n\n  return true;\n};\n\nfunction constructLength(arr, len) {\n  if (len < 0x80) {\n    arr.push(len);\n    return;\n  }\n  var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\n  arr.push(octets | 0x80);\n  while (--octets) {\n    arr.push((len >>> (octets << 3)) & 0xff);\n  }\n  arr.push(len);\n}\n\nSignature.prototype.toDER = function toDER(enc) {\n  var r = this.r.toArray();\n  var s = this.s.toArray();\n\n  // Pad values\n  if (r[0] & 0x80)\n    r = [ 0 ].concat(r);\n  // Pad values\n  if (s[0] & 0x80)\n    s = [ 0 ].concat(s);\n\n  r = rmPadding(r);\n  s = rmPadding(s);\n\n  while (!s[0] && !(s[1] & 0x80)) {\n    s = s.slice(1);\n  }\n  var arr = [ 0x02 ];\n  constructLength(arr, r.length);\n  arr = arr.concat(r);\n  arr.push(0x02);\n  constructLength(arr, s.length);\n  var backHalf = arr.concat(s);\n  var res = [ 0x30 ];\n  constructLength(res, backHalf.length);\n  res = res.concat(backHalf);\n  return utils.encode(res, enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/ec/signature.js\n// module id = 827\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/signature.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar hash = __webpack_require__(263);\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar KeyPair = __webpack_require__(829);\nvar Signature = __webpack_require__(830);\n\nfunction EDDSA(curve) {\n  assert(curve === 'ed25519', 'only tested with ed25519 so far');\n\n  if (!(this instanceof EDDSA))\n    return new EDDSA(curve);\n\n  var curve = elliptic.curves[curve].curve;\n  this.curve = curve;\n  this.g = curve.g;\n  this.g.precompute(curve.n.bitLength() + 1);\n\n  this.pointClass = curve.point().constructor;\n  this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\n  this.hash = hash.sha512;\n}\n\nmodule.exports = EDDSA;\n\n/**\n* @param {Array|String} message - message bytes\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\n* @returns {Signature} - signature\n*/\nEDDSA.prototype.sign = function sign(message, secret) {\n  message = parseBytes(message);\n  var key = this.keyFromSecret(secret);\n  var r = this.hashInt(key.messagePrefix(), message);\n  var R = this.g.mul(r);\n  var Rencoded = this.encodePoint(R);\n  var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\n               .mul(key.priv());\n  var S = r.add(s_).umod(this.curve.n);\n  return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\n};\n\n/**\n* @param {Array} message - message bytes\n* @param {Array|String|Signature} sig - sig bytes\n* @param {Array|String|Point|KeyPair} pub - public key\n* @returns {Boolean} - true if public key matches sig of message\n*/\nEDDSA.prototype.verify = function verify(message, sig, pub) {\n  message = parseBytes(message);\n  sig = this.makeSignature(sig);\n  var key = this.keyFromPublic(pub);\n  var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\n  var SG = this.g.mul(sig.S());\n  var RplusAh = sig.R().add(key.pub().mul(h));\n  return RplusAh.eq(SG);\n};\n\nEDDSA.prototype.hashInt = function hashInt() {\n  var hash = this.hash();\n  for (var i = 0; i < arguments.length; i++)\n    hash.update(arguments[i]);\n  return utils.intFromLE(hash.digest()).umod(this.curve.n);\n};\n\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\n  return KeyPair.fromPublic(this, pub);\n};\n\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\n  return KeyPair.fromSecret(this, secret);\n};\n\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\n  if (sig instanceof Signature)\n    return sig;\n  return new Signature(this, sig);\n};\n\n/**\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\n*\n* EDDSA defines methods for encoding and decoding points and integers. These are\n* helper convenience methods, that pass along to utility functions implied\n* parameters.\n*\n*/\nEDDSA.prototype.encodePoint = function encodePoint(point) {\n  var enc = point.getY().toArray('le', this.encodingLength);\n  enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\n  return enc;\n};\n\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\n  bytes = utils.parseBytes(bytes);\n\n  var lastIx = bytes.length - 1;\n  var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\n  var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\n\n  var y = utils.intFromLE(normed);\n  return this.curve.pointFromY(y, xIsOdd);\n};\n\nEDDSA.prototype.encodeInt = function encodeInt(num) {\n  return num.toArray('le', this.encodingLength);\n};\n\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\n  return utils.intFromLE(bytes);\n};\n\nEDDSA.prototype.isPoint = function isPoint(val) {\n  return val instanceof this.pointClass;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/eddsa/index.js\n// module id = 828\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar parseBytes = utils.parseBytes;\nvar cachedProperty = utils.cachedProperty;\n\n/**\n* @param {EDDSA} eddsa - instance\n* @param {Object} params - public/private key parameters\n*\n* @param {Array<Byte>} [params.secret] - secret seed bytes\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\n* @param {Array<Byte>} [params.pub] - public key point encoded as bytes\n*\n*/\nfunction KeyPair(eddsa, params) {\n  this.eddsa = eddsa;\n  this._secret = parseBytes(params.secret);\n  if (eddsa.isPoint(params.pub))\n    this._pub = params.pub;\n  else\n    this._pubBytes = parseBytes(params.pub);\n}\n\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\n  if (pub instanceof KeyPair)\n    return pub;\n  return new KeyPair(eddsa, { pub: pub });\n};\n\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\n  if (secret instanceof KeyPair)\n    return secret;\n  return new KeyPair(eddsa, { secret: secret });\n};\n\nKeyPair.prototype.secret = function secret() {\n  return this._secret;\n};\n\ncachedProperty(KeyPair, 'pubBytes', function pubBytes() {\n  return this.eddsa.encodePoint(this.pub());\n});\n\ncachedProperty(KeyPair, 'pub', function pub() {\n  if (this._pubBytes)\n    return this.eddsa.decodePoint(this._pubBytes);\n  return this.eddsa.g.mul(this.priv());\n});\n\ncachedProperty(KeyPair, 'privBytes', function privBytes() {\n  var eddsa = this.eddsa;\n  var hash = this.hash();\n  var lastIx = eddsa.encodingLength - 1;\n\n  var a = hash.slice(0, eddsa.encodingLength);\n  a[0] &= 248;\n  a[lastIx] &= 127;\n  a[lastIx] |= 64;\n\n  return a;\n});\n\ncachedProperty(KeyPair, 'priv', function priv() {\n  return this.eddsa.decodeInt(this.privBytes());\n});\n\ncachedProperty(KeyPair, 'hash', function hash() {\n  return this.eddsa.hash().update(this.secret()).digest();\n});\n\ncachedProperty(KeyPair, 'messagePrefix', function messagePrefix() {\n  return this.hash().slice(this.eddsa.encodingLength);\n});\n\nKeyPair.prototype.sign = function sign(message) {\n  assert(this._secret, 'KeyPair can only verify');\n  return this.eddsa.sign(message, this);\n};\n\nKeyPair.prototype.verify = function verify(message, sig) {\n  return this.eddsa.verify(message, sig, this);\n};\n\nKeyPair.prototype.getSecret = function getSecret(enc) {\n  assert(this._secret, 'KeyPair is public only');\n  return utils.encode(this.secret(), enc);\n};\n\nKeyPair.prototype.getPublic = function getPublic(enc) {\n  return utils.encode(this.pubBytes(), enc);\n};\n\nmodule.exports = KeyPair;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/eddsa/key.js\n// module id = 829\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/key.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar BN = __webpack_require__(17);\nvar elliptic = __webpack_require__(28);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\nvar cachedProperty = utils.cachedProperty;\nvar parseBytes = utils.parseBytes;\n\n/**\n* @param {EDDSA} eddsa - eddsa instance\n* @param {Array<Bytes>|Object} sig -\n* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes\n* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes\n* @param {Array<Bytes>} [sig.Rencoded] - R point encoded\n* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded\n*/\nfunction Signature(eddsa, sig) {\n  this.eddsa = eddsa;\n\n  if (typeof sig !== 'object')\n    sig = parseBytes(sig);\n\n  if (Array.isArray(sig)) {\n    sig = {\n      R: sig.slice(0, eddsa.encodingLength),\n      S: sig.slice(eddsa.encodingLength)\n    };\n  }\n\n  assert(sig.R && sig.S, 'Signature without R or S');\n\n  if (eddsa.isPoint(sig.R))\n    this._R = sig.R;\n  if (sig.S instanceof BN)\n    this._S = sig.S;\n\n  this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\n  this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\n}\n\ncachedProperty(Signature, 'S', function S() {\n  return this.eddsa.decodeInt(this.Sencoded());\n});\n\ncachedProperty(Signature, 'R', function R() {\n  return this.eddsa.decodePoint(this.Rencoded());\n});\n\ncachedProperty(Signature, 'Rencoded', function Rencoded() {\n  return this.eddsa.encodePoint(this.R());\n});\n\ncachedProperty(Signature, 'Sencoded', function Sencoded() {\n  return this.eddsa.encodeInt(this.S());\n});\n\nSignature.prototype.toBytes = function toBytes() {\n  return this.Rencoded().concat(this.Sencoded());\n};\n\nSignature.prototype.toHex = function toHex() {\n  return utils.encode(this.toBytes(), 'hex').toUpperCase();\n};\n\nmodule.exports = Signature;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/eddsa/signature.js\n// module id = 830\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/signature.js")},function(module,exports){eval("module.exports = {\n  doubles: {\n    step: 4,\n    points: [\n      [\n        'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n        'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'\n      ],\n      [\n        '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n        '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'\n      ],\n      [\n        '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n        'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'\n      ],\n      [\n        '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n        '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'\n      ],\n      [\n        '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n        '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'\n      ],\n      [\n        '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n        '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'\n      ],\n      [\n        'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n        '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'\n      ],\n      [\n        '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n        'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'\n      ],\n      [\n        'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n        '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'\n      ],\n      [\n        'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n        'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'\n      ],\n      [\n        'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n        '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'\n      ],\n      [\n        '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n        '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'\n      ],\n      [\n        '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n        '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'\n      ],\n      [\n        '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n        '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'\n      ],\n      [\n        '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n        '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'\n      ],\n      [\n        '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n        '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'\n      ],\n      [\n        '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n        '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'\n      ],\n      [\n        '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n        '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'\n      ],\n      [\n        '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n        'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'\n      ],\n      [\n        'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n        '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'\n      ],\n      [\n        'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n        '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'\n      ],\n      [\n        '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n        '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'\n      ],\n      [\n        '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n        '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'\n      ],\n      [\n        'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n        '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'\n      ],\n      [\n        '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n        'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'\n      ],\n      [\n        'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n        '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'\n      ],\n      [\n        'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n        'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'\n      ],\n      [\n        'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n        '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'\n      ],\n      [\n        'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n        'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'\n      ],\n      [\n        'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n        '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'\n      ],\n      [\n        '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n        'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'\n      ],\n      [\n        '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n        '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'\n      ],\n      [\n        'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n        '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'\n      ],\n      [\n        '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n        'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'\n      ],\n      [\n        'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n        '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'\n      ],\n      [\n        'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n        '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'\n      ],\n      [\n        'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n        'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'\n      ],\n      [\n        '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n        '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'\n      ],\n      [\n        '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n        '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'\n      ],\n      [\n        '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n        'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'\n      ],\n      [\n        '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n        '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'\n      ],\n      [\n        'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n        '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'\n      ],\n      [\n        '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n        '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'\n      ],\n      [\n        '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n        'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'\n      ],\n      [\n        '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n        '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'\n      ],\n      [\n        'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n        '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'\n      ],\n      [\n        '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n        'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'\n      ],\n      [\n        'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n        'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'\n      ],\n      [\n        'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n        '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'\n      ],\n      [\n        '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n        'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'\n      ],\n      [\n        '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n        'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'\n      ],\n      [\n        'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n        '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'\n      ],\n      [\n        'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n        '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'\n      ],\n      [\n        'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n        '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'\n      ],\n      [\n        '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n        'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'\n      ],\n      [\n        '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n        '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'\n      ],\n      [\n        'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n        'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'\n      ],\n      [\n        '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n        'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'\n      ],\n      [\n        '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n        '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'\n      ],\n      [\n        '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n        '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'\n      ],\n      [\n        'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n        'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'\n      ],\n      [\n        '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n        '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'\n      ],\n      [\n        '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n        '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'\n      ],\n      [\n        'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n        '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'\n      ],\n      [\n        'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n        'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'\n      ]\n    ]\n  },\n  naf: {\n    wnd: 7,\n    points: [\n      [\n        'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n        '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'\n      ],\n      [\n        '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n        'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'\n      ],\n      [\n        '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n        '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'\n      ],\n      [\n        'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n        'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'\n      ],\n      [\n        '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n        'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'\n      ],\n      [\n        'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n        'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'\n      ],\n      [\n        'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n        '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'\n      ],\n      [\n        'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n        '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'\n      ],\n      [\n        '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n        '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'\n      ],\n      [\n        '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n        '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'\n      ],\n      [\n        '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n        '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'\n      ],\n      [\n        '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n        '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'\n      ],\n      [\n        'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n        'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'\n      ],\n      [\n        'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n        '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'\n      ],\n      [\n        '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n        'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'\n      ],\n      [\n        '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n        'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'\n      ],\n      [\n        '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n        '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'\n      ],\n      [\n        '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n        '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'\n      ],\n      [\n        '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n        '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'\n      ],\n      [\n        '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n        'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'\n      ],\n      [\n        'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n        'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'\n      ],\n      [\n        '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n        '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'\n      ],\n      [\n        '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n        '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'\n      ],\n      [\n        'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n        'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'\n      ],\n      [\n        '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n        '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'\n      ],\n      [\n        'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n        'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'\n      ],\n      [\n        'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n        'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'\n      ],\n      [\n        '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n        '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'\n      ],\n      [\n        '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n        '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'\n      ],\n      [\n        '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n        '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'\n      ],\n      [\n        'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n        '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'\n      ],\n      [\n        '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n        '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'\n      ],\n      [\n        'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n        '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'\n      ],\n      [\n        '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n        'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'\n      ],\n      [\n        '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n        'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'\n      ],\n      [\n        'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n        'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'\n      ],\n      [\n        '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n        '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'\n      ],\n      [\n        '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n        'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'\n      ],\n      [\n        'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n        'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'\n      ],\n      [\n        '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n        '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'\n      ],\n      [\n        '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n        'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'\n      ],\n      [\n        '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n        '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'\n      ],\n      [\n        '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n        'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'\n      ],\n      [\n        'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n        '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'\n      ],\n      [\n        '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n        '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'\n      ],\n      [\n        '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n        'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'\n      ],\n      [\n        '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n        'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'\n      ],\n      [\n        'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n        'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'\n      ],\n      [\n        'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n        'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'\n      ],\n      [\n        '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n        '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'\n      ],\n      [\n        '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n        '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'\n      ],\n      [\n        'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n        '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'\n      ],\n      [\n        'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n        'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'\n      ],\n      [\n        '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n        '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'\n      ],\n      [\n        '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n        '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'\n      ],\n      [\n        'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n        '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'\n      ],\n      [\n        '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n        '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'\n      ],\n      [\n        'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n        'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'\n      ],\n      [\n        '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n        'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'\n      ],\n      [\n        '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n        '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'\n      ],\n      [\n        'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n        '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'\n      ],\n      [\n        'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n        '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'\n      ],\n      [\n        '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n        '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'\n      ],\n      [\n        '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n        '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'\n      ],\n      [\n        '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n        'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'\n      ],\n      [\n        '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n        'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'\n      ],\n      [\n        '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n        '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'\n      ],\n      [\n        '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n        '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'\n      ],\n      [\n        '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n        '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'\n      ],\n      [\n        '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n        'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'\n      ],\n      [\n        'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n        'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'\n      ],\n      [\n        '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n        'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'\n      ],\n      [\n        'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n        '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'\n      ],\n      [\n        'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n        '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'\n      ],\n      [\n        'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n        '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'\n      ],\n      [\n        'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n        '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'\n      ],\n      [\n        '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n        'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'\n      ],\n      [\n        '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n        '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'\n      ],\n      [\n        '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n        'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'\n      ],\n      [\n        'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n        'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'\n      ],\n      [\n        'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n        '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'\n      ],\n      [\n        'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n        'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'\n      ],\n      [\n        'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n        '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'\n      ],\n      [\n        '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n        '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'\n      ],\n      [\n        'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n        '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'\n      ],\n      [\n        'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n        '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'\n      ],\n      [\n        '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n        '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'\n      ],\n      [\n        '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n        'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'\n      ],\n      [\n        'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n        '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'\n      ],\n      [\n        'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n        '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'\n      ],\n      [\n        'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n        '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'\n      ],\n      [\n        '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n        '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'\n      ],\n      [\n        'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n        'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'\n      ],\n      [\n        '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n        'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'\n      ],\n      [\n        'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n        'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'\n      ],\n      [\n        'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n        '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'\n      ],\n      [\n        '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n        'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'\n      ],\n      [\n        'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n        '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'\n      ],\n      [\n        'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n        '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'\n      ],\n      [\n        'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n        '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'\n      ],\n      [\n        '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n        'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'\n      ],\n      [\n        '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n        'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'\n      ],\n      [\n        'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n        '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'\n      ],\n      [\n        '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n        'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'\n      ],\n      [\n        '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n        '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'\n      ],\n      [\n        '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n        'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'\n      ],\n      [\n        'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n        'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'\n      ],\n      [\n        '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n        'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'\n      ],\n      [\n        '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n        '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'\n      ],\n      [\n        '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n        'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'\n      ],\n      [\n        '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n        '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'\n      ],\n      [\n        'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n        'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'\n      ],\n      [\n        '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n        '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'\n      ],\n      [\n        'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n        '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'\n      ],\n      [\n        '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n        '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'\n      ],\n      [\n        'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n        'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'\n      ],\n      [\n        'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n        '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'\n      ],\n      [\n        'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n        'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'\n      ],\n      [\n        '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n        'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'\n      ],\n      [\n        '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n        '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'\n      ],\n      [\n        '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n        'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'\n      ],\n      [\n        '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n        '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'\n      ],\n      [\n        '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n        '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'\n      ],\n      [\n        '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n        'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'\n      ],\n      [\n        '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n        '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'\n      ],\n      [\n        '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n        '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'\n      ],\n      [\n        '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n        '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'\n      ]\n    ]\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/precomputed/secp256k1.js\n// module id = 831\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = exports;\nvar BN = __webpack_require__(17);\nvar minAssert = __webpack_require__(43);\nvar minUtils = __webpack_require__(470);\n\nutils.assert = minAssert;\nutils.toArray = minUtils.toArray;\nutils.zero2 = minUtils.zero2;\nutils.toHex = minUtils.toHex;\nutils.encode = minUtils.encode;\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w) {\n  var naf = [];\n  var ws = 1 << (w + 1);\n  var k = num.clone();\n  while (k.cmpn(1) >= 0) {\n    var z;\n    if (k.isOdd()) {\n      var mod = k.andln(ws - 1);\n      if (mod > (ws >> 1) - 1)\n        z = (ws >> 1) - mod;\n      else\n        z = mod;\n      k.isubn(z);\n    } else {\n      z = 0;\n    }\n    naf.push(z);\n\n    // Optimization, shift by word if possible\n    var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;\n    for (var i = 1; i < shift; i++)\n      naf.push(0);\n    k.iushrn(shift);\n  }\n\n  return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n  var jsf = [\n    [],\n    []\n  ];\n\n  k1 = k1.clone();\n  k2 = k2.clone();\n  var d1 = 0;\n  var d2 = 0;\n  while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\n    // First phase\n    var m14 = (k1.andln(3) + d1) & 3;\n    var m24 = (k2.andln(3) + d2) & 3;\n    if (m14 === 3)\n      m14 = -1;\n    if (m24 === 3)\n      m24 = -1;\n    var u1;\n    if ((m14 & 1) === 0) {\n      u1 = 0;\n    } else {\n      var m8 = (k1.andln(7) + d1) & 7;\n      if ((m8 === 3 || m8 === 5) && m24 === 2)\n        u1 = -m14;\n      else\n        u1 = m14;\n    }\n    jsf[0].push(u1);\n\n    var u2;\n    if ((m24 & 1) === 0) {\n      u2 = 0;\n    } else {\n      var m8 = (k2.andln(7) + d2) & 7;\n      if ((m8 === 3 || m8 === 5) && m14 === 2)\n        u2 = -m24;\n      else\n        u2 = m24;\n    }\n    jsf[1].push(u2);\n\n    // Second phase\n    if (2 * d1 === u1 + 1)\n      d1 = 1 - d1;\n    if (2 * d2 === u2 + 1)\n      d2 = 1 - d2;\n    k1.iushrn(1);\n    k2.iushrn(1);\n  }\n\n  return jsf;\n}\nutils.getJSF = getJSF;\n\nfunction cachedProperty(obj, name, computer) {\n  var key = '_' + name;\n  obj.prototype[name] = function cachedProperty() {\n    return this[key] !== undefined ? this[key] :\n           this[key] = computer.call(this);\n  };\n}\nutils.cachedProperty = cachedProperty;\n\nfunction parseBytes(bytes) {\n  return typeof bytes === 'string' ? utils.toArray(bytes, 'hex') :\n                                     bytes;\n}\nutils.parseBytes = parseBytes;\n\nfunction intFromLE(bytes) {\n  return new BN(bytes, 'hex', 'le');\n}\nutils.intFromLE = intFromLE;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/lib/elliptic/utils.js\n// module id = 832\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/lib/elliptic/utils.js")},function(module,exports){eval('module.exports = {"_args":[["elliptic@6.4.0","/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib"]],"_from":"elliptic@6.4.0","_id":"elliptic@6.4.0","_inBundle":false,"_integrity":"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.4.0","name":"elliptic","escapedName":"elliptic","rawSpec":"6.4.0","saveSpec":null,"fetchSpec":"6.4.0"},"_requiredBy":["/browserify-sign","/create-ecdh","/dc-messaging/web3-eth-accounts/eth-lib","/eth-lib","/secp256k1","/web3-eth-accounts/eth-lib"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz","_spec":"6.4.0","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.4.0","brorand":"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0","inherits":"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},"description":"EC cryptography","devDependencies":{"brfs":"^1.4.3","coveralls":"^2.11.3","grunt":"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2","istanbul":"^0.4.2","jscs":"^2.9.0","jshint":"^2.6.0","mocha":"^2.1.0"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"jscs":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","jshint":"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js","lint":"npm run jscs && npm run jshint","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.4.0"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/elliptic/package.json\n// module id = 833\n// module chunks = 0\n\n//# sourceURL=../node_modules/elliptic/package.json')},function(module,exports,__webpack_require__){eval("\nmodule.exports = __webpack_require__(835);\n\n/**\n * Exports parser\n *\n * @api public\n *\n */\nmodule.exports.parser = __webpack_require__(119);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/index.js\n// module id = 834\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Module dependencies.\n */\n\nvar transports = __webpack_require__(404);\nvar Emitter = __webpack_require__(115);\nvar debug = __webpack_require__(5)('engine.io-client:socket');\nvar index = __webpack_require__(264);\nvar parser = __webpack_require__(119);\nvar parseuri = __webpack_require__(501);\nvar parseqs = __webpack_require__(201);\n\n/**\n * Module exports.\n */\n\nmodule.exports = Socket;\n\n/**\n * Socket constructor.\n *\n * @param {String|Object} uri or options\n * @param {Object} options\n * @api public\n */\n\nfunction Socket (uri, opts) {\n  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\n  opts = opts || {};\n\n  if (uri && 'object' === typeof uri) {\n    opts = uri;\n    uri = null;\n  }\n\n  if (uri) {\n    uri = parseuri(uri);\n    opts.hostname = uri.host;\n    opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';\n    opts.port = uri.port;\n    if (uri.query) opts.query = uri.query;\n  } else if (opts.host) {\n    opts.hostname = parseuri(opts.host).host;\n  }\n\n  this.secure = null != opts.secure ? opts.secure\n    : (global.location && 'https:' === location.protocol);\n\n  if (opts.hostname && !opts.port) {\n    // if no port is specified manually, use the protocol default\n    opts.port = this.secure ? '443' : '80';\n  }\n\n  this.agent = opts.agent || false;\n  this.hostname = opts.hostname ||\n    (global.location ? location.hostname : 'localhost');\n  this.port = opts.port || (global.location && location.port\n      ? location.port\n      : (this.secure ? 443 : 80));\n  this.query = opts.query || {};\n  if ('string' === typeof this.query) this.query = parseqs.decode(this.query);\n  this.upgrade = false !== opts.upgrade;\n  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n  this.forceJSONP = !!opts.forceJSONP;\n  this.jsonp = false !== opts.jsonp;\n  this.forceBase64 = !!opts.forceBase64;\n  this.enablesXDR = !!opts.enablesXDR;\n  this.timestampParam = opts.timestampParam || 't';\n  this.timestampRequests = opts.timestampRequests;\n  this.transports = opts.transports || ['polling', 'websocket'];\n  this.transportOptions = opts.transportOptions || {};\n  this.readyState = '';\n  this.writeBuffer = [];\n  this.prevBufferLen = 0;\n  this.policyPort = opts.policyPort || 843;\n  this.rememberUpgrade = opts.rememberUpgrade || false;\n  this.binaryType = null;\n  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\n  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n    this.perMessageDeflate.threshold = 1024;\n  }\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx || null;\n  this.key = opts.key || null;\n  this.passphrase = opts.passphrase || null;\n  this.cert = opts.cert || null;\n  this.ca = opts.ca || null;\n  this.ciphers = opts.ciphers || null;\n  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n  this.forceNode = !!opts.forceNode;\n\n  // other options for Node.js client\n  var freeGlobal = typeof global === 'object' && global;\n  if (freeGlobal.global === freeGlobal) {\n    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n      this.extraHeaders = opts.extraHeaders;\n    }\n\n    if (opts.localAddress) {\n      this.localAddress = opts.localAddress;\n    }\n  }\n\n  // set on handshake\n  this.id = null;\n  this.upgrades = null;\n  this.pingInterval = null;\n  this.pingTimeout = null;\n\n  // set on heartbeat\n  this.pingIntervalTimer = null;\n  this.pingTimeoutTimer = null;\n\n  this.open();\n}\n\nSocket.priorWebsocketSuccess = false;\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Socket.prototype);\n\n/**\n * Protocol version.\n *\n * @api public\n */\n\nSocket.protocol = parser.protocol; // this is an int\n\n/**\n * Expose deps for legacy compatibility\n * and standalone browser access.\n */\n\nSocket.Socket = Socket;\nSocket.Transport = __webpack_require__(258);\nSocket.transports = __webpack_require__(404);\nSocket.parser = __webpack_require__(119);\n\n/**\n * Creates transport of the given type.\n *\n * @param {String} transport name\n * @return {Transport}\n * @api private\n */\n\nSocket.prototype.createTransport = function (name) {\n  debug('creating transport \"%s\"', name);\n  var query = clone(this.query);\n\n  // append engine.io protocol identifier\n  query.EIO = parser.protocol;\n\n  // transport name\n  query.transport = name;\n\n  // per-transport options\n  var options = this.transportOptions[name] || {};\n\n  // session id if we already have one\n  if (this.id) query.sid = this.id;\n\n  var transport = new transports[name]({\n    query: query,\n    socket: this,\n    agent: options.agent || this.agent,\n    hostname: options.hostname || this.hostname,\n    port: options.port || this.port,\n    secure: options.secure || this.secure,\n    path: options.path || this.path,\n    forceJSONP: options.forceJSONP || this.forceJSONP,\n    jsonp: options.jsonp || this.jsonp,\n    forceBase64: options.forceBase64 || this.forceBase64,\n    enablesXDR: options.enablesXDR || this.enablesXDR,\n    timestampRequests: options.timestampRequests || this.timestampRequests,\n    timestampParam: options.timestampParam || this.timestampParam,\n    policyPort: options.policyPort || this.policyPort,\n    pfx: options.pfx || this.pfx,\n    key: options.key || this.key,\n    passphrase: options.passphrase || this.passphrase,\n    cert: options.cert || this.cert,\n    ca: options.ca || this.ca,\n    ciphers: options.ciphers || this.ciphers,\n    rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,\n    perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,\n    extraHeaders: options.extraHeaders || this.extraHeaders,\n    forceNode: options.forceNode || this.forceNode,\n    localAddress: options.localAddress || this.localAddress,\n    requestTimeout: options.requestTimeout || this.requestTimeout,\n    protocols: options.protocols || void (0)\n  });\n\n  return transport;\n};\n\nfunction clone (obj) {\n  var o = {};\n  for (var i in obj) {\n    if (obj.hasOwnProperty(i)) {\n      o[i] = obj[i];\n    }\n  }\n  return o;\n}\n\n/**\n * Initializes transport to use and starts probe.\n *\n * @api private\n */\nSocket.prototype.open = function () {\n  var transport;\n  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {\n    transport = 'websocket';\n  } else if (0 === this.transports.length) {\n    // Emit error on next tick so it can be listened to\n    var self = this;\n    setTimeout(function () {\n      self.emit('error', 'No transports available');\n    }, 0);\n    return;\n  } else {\n    transport = this.transports[0];\n  }\n  this.readyState = 'opening';\n\n  // Retry with the next transport if the transport is disabled (jsonp: false)\n  try {\n    transport = this.createTransport(transport);\n  } catch (e) {\n    this.transports.shift();\n    this.open();\n    return;\n  }\n\n  transport.open();\n  this.setTransport(transport);\n};\n\n/**\n * Sets the current transport. Disables the existing one (if any).\n *\n * @api private\n */\n\nSocket.prototype.setTransport = function (transport) {\n  debug('setting transport %s', transport.name);\n  var self = this;\n\n  if (this.transport) {\n    debug('clearing existing transport %s', this.transport.name);\n    this.transport.removeAllListeners();\n  }\n\n  // set up transport\n  this.transport = transport;\n\n  // set up transport listeners\n  transport\n  .on('drain', function () {\n    self.onDrain();\n  })\n  .on('packet', function (packet) {\n    self.onPacket(packet);\n  })\n  .on('error', function (e) {\n    self.onError(e);\n  })\n  .on('close', function () {\n    self.onClose('transport close');\n  });\n};\n\n/**\n * Probes a transport.\n *\n * @param {String} transport name\n * @api private\n */\n\nSocket.prototype.probe = function (name) {\n  debug('probing transport \"%s\"', name);\n  var transport = this.createTransport(name, { probe: 1 });\n  var failed = false;\n  var self = this;\n\n  Socket.priorWebsocketSuccess = false;\n\n  function onTransportOpen () {\n    if (self.onlyBinaryUpgrades) {\n      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n      failed = failed || upgradeLosesBinary;\n    }\n    if (failed) return;\n\n    debug('probe transport \"%s\" opened', name);\n    transport.send([{ type: 'ping', data: 'probe' }]);\n    transport.once('packet', function (msg) {\n      if (failed) return;\n      if ('pong' === msg.type && 'probe' === msg.data) {\n        debug('probe transport \"%s\" pong', name);\n        self.upgrading = true;\n        self.emit('upgrading', transport);\n        if (!transport) return;\n        Socket.priorWebsocketSuccess = 'websocket' === transport.name;\n\n        debug('pausing current transport \"%s\"', self.transport.name);\n        self.transport.pause(function () {\n          if (failed) return;\n          if ('closed' === self.readyState) return;\n          debug('changing transport and sending upgrade packet');\n\n          cleanup();\n\n          self.setTransport(transport);\n          transport.send([{ type: 'upgrade' }]);\n          self.emit('upgrade', transport);\n          transport = null;\n          self.upgrading = false;\n          self.flush();\n        });\n      } else {\n        debug('probe transport \"%s\" failed', name);\n        var err = new Error('probe error');\n        err.transport = transport.name;\n        self.emit('upgradeError', err);\n      }\n    });\n  }\n\n  function freezeTransport () {\n    if (failed) return;\n\n    // Any callback called by transport should be ignored since now\n    failed = true;\n\n    cleanup();\n\n    transport.close();\n    transport = null;\n  }\n\n  // Handle any error that happens while probing\n  function onerror (err) {\n    var error = new Error('probe error: ' + err);\n    error.transport = transport.name;\n\n    freezeTransport();\n\n    debug('probe transport \"%s\" failed because of error: %s', name, err);\n\n    self.emit('upgradeError', error);\n  }\n\n  function onTransportClose () {\n    onerror('transport closed');\n  }\n\n  // When the socket is closed while we're probing\n  function onclose () {\n    onerror('socket closed');\n  }\n\n  // When the socket is upgraded while we're probing\n  function onupgrade (to) {\n    if (transport && to.name !== transport.name) {\n      debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n      freezeTransport();\n    }\n  }\n\n  // Remove all listeners on the transport and on self\n  function cleanup () {\n    transport.removeListener('open', onTransportOpen);\n    transport.removeListener('error', onerror);\n    transport.removeListener('close', onTransportClose);\n    self.removeListener('close', onclose);\n    self.removeListener('upgrading', onupgrade);\n  }\n\n  transport.once('open', onTransportOpen);\n  transport.once('error', onerror);\n  transport.once('close', onTransportClose);\n\n  this.once('close', onclose);\n  this.once('upgrading', onupgrade);\n\n  transport.open();\n};\n\n/**\n * Called when connection is deemed open.\n *\n * @api public\n */\n\nSocket.prototype.onOpen = function () {\n  debug('socket open');\n  this.readyState = 'open';\n  Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;\n  this.emit('open');\n  this.flush();\n\n  // we check for `readyState` in case an `open`\n  // listener already closed the socket\n  if ('open' === this.readyState && this.upgrade && this.transport.pause) {\n    debug('starting upgrade probes');\n    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n      this.probe(this.upgrades[i]);\n    }\n  }\n};\n\n/**\n * Handles a packet.\n *\n * @api private\n */\n\nSocket.prototype.onPacket = function (packet) {\n  if ('opening' === this.readyState || 'open' === this.readyState ||\n      'closing' === this.readyState) {\n    debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\n    this.emit('packet', packet);\n\n    // Socket is live - any packet counts\n    this.emit('heartbeat');\n\n    switch (packet.type) {\n      case 'open':\n        this.onHandshake(JSON.parse(packet.data));\n        break;\n\n      case 'pong':\n        this.setPing();\n        this.emit('pong');\n        break;\n\n      case 'error':\n        var err = new Error('server error');\n        err.code = packet.data;\n        this.onError(err);\n        break;\n\n      case 'message':\n        this.emit('data', packet.data);\n        this.emit('message', packet.data);\n        break;\n    }\n  } else {\n    debug('packet received with socket readyState \"%s\"', this.readyState);\n  }\n};\n\n/**\n * Called upon handshake completion.\n *\n * @param {Object} handshake obj\n * @api private\n */\n\nSocket.prototype.onHandshake = function (data) {\n  this.emit('handshake', data);\n  this.id = data.sid;\n  this.transport.query.sid = data.sid;\n  this.upgrades = this.filterUpgrades(data.upgrades);\n  this.pingInterval = data.pingInterval;\n  this.pingTimeout = data.pingTimeout;\n  this.onOpen();\n  // In case open handler closes socket\n  if ('closed' === this.readyState) return;\n  this.setPing();\n\n  // Prolong liveness of socket on heartbeat\n  this.removeListener('heartbeat', this.onHeartbeat);\n  this.on('heartbeat', this.onHeartbeat);\n};\n\n/**\n * Resets ping timeout.\n *\n * @api private\n */\n\nSocket.prototype.onHeartbeat = function (timeout) {\n  clearTimeout(this.pingTimeoutTimer);\n  var self = this;\n  self.pingTimeoutTimer = setTimeout(function () {\n    if ('closed' === self.readyState) return;\n    self.onClose('ping timeout');\n  }, timeout || (self.pingInterval + self.pingTimeout));\n};\n\n/**\n * Pings server every `this.pingInterval` and expects response\n * within `this.pingTimeout` or closes connection.\n *\n * @api private\n */\n\nSocket.prototype.setPing = function () {\n  var self = this;\n  clearTimeout(self.pingIntervalTimer);\n  self.pingIntervalTimer = setTimeout(function () {\n    debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n    self.ping();\n    self.onHeartbeat(self.pingTimeout);\n  }, self.pingInterval);\n};\n\n/**\n* Sends a ping packet.\n*\n* @api private\n*/\n\nSocket.prototype.ping = function () {\n  var self = this;\n  this.sendPacket('ping', function () {\n    self.emit('ping');\n  });\n};\n\n/**\n * Called on `drain` event\n *\n * @api private\n */\n\nSocket.prototype.onDrain = function () {\n  this.writeBuffer.splice(0, this.prevBufferLen);\n\n  // setting prevBufferLen = 0 is very important\n  // for example, when upgrading, upgrade packet is sent over,\n  // and a nonzero prevBufferLen could cause problems on `drain`\n  this.prevBufferLen = 0;\n\n  if (0 === this.writeBuffer.length) {\n    this.emit('drain');\n  } else {\n    this.flush();\n  }\n};\n\n/**\n * Flush write buffers.\n *\n * @api private\n */\n\nSocket.prototype.flush = function () {\n  if ('closed' !== this.readyState && this.transport.writable &&\n    !this.upgrading && this.writeBuffer.length) {\n    debug('flushing %d packets in socket', this.writeBuffer.length);\n    this.transport.send(this.writeBuffer);\n    // keep track of current length of writeBuffer\n    // splice writeBuffer and callbackBuffer on `drain`\n    this.prevBufferLen = this.writeBuffer.length;\n    this.emit('flush');\n  }\n};\n\n/**\n * Sends a message.\n *\n * @param {String} message.\n * @param {Function} callback function.\n * @param {Object} options.\n * @return {Socket} for chaining.\n * @api public\n */\n\nSocket.prototype.write =\nSocket.prototype.send = function (msg, options, fn) {\n  this.sendPacket('message', msg, options, fn);\n  return this;\n};\n\n/**\n * Sends a packet.\n *\n * @param {String} packet type.\n * @param {String} data.\n * @param {Object} options.\n * @param {Function} callback function.\n * @api private\n */\n\nSocket.prototype.sendPacket = function (type, data, options, fn) {\n  if ('function' === typeof data) {\n    fn = data;\n    data = undefined;\n  }\n\n  if ('function' === typeof options) {\n    fn = options;\n    options = null;\n  }\n\n  if ('closing' === this.readyState || 'closed' === this.readyState) {\n    return;\n  }\n\n  options = options || {};\n  options.compress = false !== options.compress;\n\n  var packet = {\n    type: type,\n    data: data,\n    options: options\n  };\n  this.emit('packetCreate', packet);\n  this.writeBuffer.push(packet);\n  if (fn) this.once('flush', fn);\n  this.flush();\n};\n\n/**\n * Closes the connection.\n *\n * @api private\n */\n\nSocket.prototype.close = function () {\n  if ('opening' === this.readyState || 'open' === this.readyState) {\n    this.readyState = 'closing';\n\n    var self = this;\n\n    if (this.writeBuffer.length) {\n      this.once('drain', function () {\n        if (this.upgrading) {\n          waitForUpgrade();\n        } else {\n          close();\n        }\n      });\n    } else if (this.upgrading) {\n      waitForUpgrade();\n    } else {\n      close();\n    }\n  }\n\n  function close () {\n    self.onClose('forced close');\n    debug('socket closing - telling transport to close');\n    self.transport.close();\n  }\n\n  function cleanupAndClose () {\n    self.removeListener('upgrade', cleanupAndClose);\n    self.removeListener('upgradeError', cleanupAndClose);\n    close();\n  }\n\n  function waitForUpgrade () {\n    // wait for upgrade to finish since we can't send packets while pausing a transport\n    self.once('upgrade', cleanupAndClose);\n    self.once('upgradeError', cleanupAndClose);\n  }\n\n  return this;\n};\n\n/**\n * Called upon transport error\n *\n * @api private\n */\n\nSocket.prototype.onError = function (err) {\n  debug('socket error %j', err);\n  Socket.priorWebsocketSuccess = false;\n  this.emit('error', err);\n  this.onClose('transport error', err);\n};\n\n/**\n * Called upon transport close.\n *\n * @api private\n */\n\nSocket.prototype.onClose = function (reason, desc) {\n  if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {\n    debug('socket close with reason: \"%s\"', reason);\n    var self = this;\n\n    // clear timers\n    clearTimeout(this.pingIntervalTimer);\n    clearTimeout(this.pingTimeoutTimer);\n\n    // stop event from firing again for transport\n    this.transport.removeAllListeners('close');\n\n    // ensure transport won't stay open\n    this.transport.close();\n\n    // ignore further transport communication\n    this.transport.removeAllListeners();\n\n    // set ready state\n    this.readyState = 'closed';\n\n    // clear session id\n    this.id = null;\n\n    // emit close event\n    this.emit('close', reason, desc);\n\n    // clean buffers after, so users can still\n    // grab the buffers on `close` event\n    self.writeBuffer = [];\n    self.prevBufferLen = 0;\n  }\n};\n\n/**\n * Filters upgrades, returning only those matching client transports.\n *\n * @param {Array} server upgrades\n * @api private\n *\n */\n\nSocket.prototype.filterUpgrades = function (upgrades) {\n  var filteredUpgrades = [];\n  for (var i = 0, j = upgrades.length; i < j; i++) {\n    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n  }\n  return filteredUpgrades;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/socket.js\n// module id = 835\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/socket.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\n/**\n * Module requirements.\n */\n\nvar Polling = __webpack_require__(405);\nvar inherit = __webpack_require__(169);\n\n/**\n * Module exports.\n */\n\nmodule.exports = JSONPPolling;\n\n/**\n * Cached regular expressions.\n */\n\nvar rNewline = /\\n/g;\nvar rEscapedNewline = /\\\\n/g;\n\n/**\n * Global JSONP callbacks.\n */\n\nvar callbacks;\n\n/**\n * Noop.\n */\n\nfunction empty () { }\n\n/**\n * JSONP Polling constructor.\n *\n * @param {Object} opts.\n * @api public\n */\n\nfunction JSONPPolling (opts) {\n  Polling.call(this, opts);\n\n  this.query = this.query || {};\n\n  // define global callbacks array if not present\n  // we do this here (lazily) to avoid unneeded global pollution\n  if (!callbacks) {\n    // we need to consider multiple engines in the same page\n    if (!global.___eio) global.___eio = [];\n    callbacks = global.___eio;\n  }\n\n  // callback identifier\n  this.index = callbacks.length;\n\n  // add callback to jsonp global\n  var self = this;\n  callbacks.push(function (msg) {\n    self.onData(msg);\n  });\n\n  // append to query string\n  this.query.j = this.index;\n\n  // prevent spurious errors from being emitted when the window is unloaded\n  if (global.document && global.addEventListener) {\n    global.addEventListener('beforeunload', function () {\n      if (self.script) self.script.onerror = empty;\n    }, false);\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(JSONPPolling, Polling);\n\n/*\n * JSONP only supports binary as base64 encoded strings\n */\n\nJSONPPolling.prototype.supportsBinary = false;\n\n/**\n * Closes the socket.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doClose = function () {\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  if (this.form) {\n    this.form.parentNode.removeChild(this.form);\n    this.form = null;\n    this.iframe = null;\n  }\n\n  Polling.prototype.doClose.call(this);\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nJSONPPolling.prototype.doPoll = function () {\n  var self = this;\n  var script = document.createElement('script');\n\n  if (this.script) {\n    this.script.parentNode.removeChild(this.script);\n    this.script = null;\n  }\n\n  script.async = true;\n  script.src = this.uri();\n  script.onerror = function (e) {\n    self.onError('jsonp poll error', e);\n  };\n\n  var insertAt = document.getElementsByTagName('script')[0];\n  if (insertAt) {\n    insertAt.parentNode.insertBefore(script, insertAt);\n  } else {\n    (document.head || document.body).appendChild(script);\n  }\n  this.script = script;\n\n  var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);\n\n  if (isUAgecko) {\n    setTimeout(function () {\n      var iframe = document.createElement('iframe');\n      document.body.appendChild(iframe);\n      document.body.removeChild(iframe);\n    }, 100);\n  }\n};\n\n/**\n * Writes with a hidden iframe.\n *\n * @param {String} data to send\n * @param {Function} called upon flush.\n * @api private\n */\n\nJSONPPolling.prototype.doWrite = function (data, fn) {\n  var self = this;\n\n  if (!this.form) {\n    var form = document.createElement('form');\n    var area = document.createElement('textarea');\n    var id = this.iframeId = 'eio_iframe_' + this.index;\n    var iframe;\n\n    form.className = 'socketio';\n    form.style.position = 'absolute';\n    form.style.top = '-1000px';\n    form.style.left = '-1000px';\n    form.target = id;\n    form.method = 'POST';\n    form.setAttribute('accept-charset', 'utf-8');\n    area.name = 'd';\n    form.appendChild(area);\n    document.body.appendChild(form);\n\n    this.form = form;\n    this.area = area;\n  }\n\n  this.form.action = this.uri();\n\n  function complete () {\n    initIframe();\n    fn();\n  }\n\n  function initIframe () {\n    if (self.iframe) {\n      try {\n        self.form.removeChild(self.iframe);\n      } catch (e) {\n        self.onError('jsonp polling iframe removal error', e);\n      }\n    }\n\n    try {\n      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n      var html = '<iframe src=\"javascript:0\" name=\"' + self.iframeId + '\">';\n      iframe = document.createElement(html);\n    } catch (e) {\n      iframe = document.createElement('iframe');\n      iframe.name = self.iframeId;\n      iframe.src = 'javascript:0';\n    }\n\n    iframe.id = self.iframeId;\n\n    self.form.appendChild(iframe);\n    self.iframe = iframe;\n  }\n\n  initIframe();\n\n  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n  data = data.replace(rEscapedNewline, '\\\\\\n');\n  this.area.value = data.replace(rNewline, '\\\\n');\n\n  try {\n    this.form.submit();\n  } catch (e) {}\n\n  if (this.iframe.attachEvent) {\n    this.iframe.onreadystatechange = function () {\n      if (self.iframe.readyState === 'complete') {\n        complete();\n      }\n    };\n  } else {\n    this.iframe.onload = complete;\n  }\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-jsonp.js\n// module id = 836\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transports/polling-jsonp.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Module requirements.\n */\n\nvar XMLHttpRequest = __webpack_require__(259);\nvar Polling = __webpack_require__(405);\nvar Emitter = __webpack_require__(115);\nvar inherit = __webpack_require__(169);\nvar debug = __webpack_require__(5)('engine.io-client:polling-xhr');\n\n/**\n * Module exports.\n */\n\nmodule.exports = XHR;\nmodule.exports.Request = Request;\n\n/**\n * Empty function\n */\n\nfunction empty () {}\n\n/**\n * XHR Polling constructor.\n *\n * @param {Object} opts\n * @api public\n */\n\nfunction XHR (opts) {\n  Polling.call(this, opts);\n  this.requestTimeout = opts.requestTimeout;\n  this.extraHeaders = opts.extraHeaders;\n\n  if (global.location) {\n    var isSSL = 'https:' === location.protocol;\n    var port = location.port;\n\n    // some user agents have empty `location.port`\n    if (!port) {\n      port = isSSL ? 443 : 80;\n    }\n\n    this.xd = opts.hostname !== global.location.hostname ||\n      port !== opts.port;\n    this.xs = opts.secure !== isSSL;\n  }\n}\n\n/**\n * Inherits from Polling.\n */\n\ninherit(XHR, Polling);\n\n/**\n * XHR supports binary\n */\n\nXHR.prototype.supportsBinary = true;\n\n/**\n * Creates a request.\n *\n * @param {String} method\n * @api private\n */\n\nXHR.prototype.request = function (opts) {\n  opts = opts || {};\n  opts.uri = this.uri();\n  opts.xd = this.xd;\n  opts.xs = this.xs;\n  opts.agent = this.agent || false;\n  opts.supportsBinary = this.supportsBinary;\n  opts.enablesXDR = this.enablesXDR;\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  opts.requestTimeout = this.requestTimeout;\n\n  // other options for Node.js client\n  opts.extraHeaders = this.extraHeaders;\n\n  return new Request(opts);\n};\n\n/**\n * Sends data.\n *\n * @param {String} data to send.\n * @param {Function} called upon flush.\n * @api private\n */\n\nXHR.prototype.doWrite = function (data, fn) {\n  var isBinary = typeof data !== 'string' && data !== undefined;\n  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n  var self = this;\n  req.on('success', fn);\n  req.on('error', function (err) {\n    self.onError('xhr post error', err);\n  });\n  this.sendXhr = req;\n};\n\n/**\n * Starts a poll cycle.\n *\n * @api private\n */\n\nXHR.prototype.doPoll = function () {\n  debug('xhr poll');\n  var req = this.request();\n  var self = this;\n  req.on('data', function (data) {\n    self.onData(data);\n  });\n  req.on('error', function (err) {\n    self.onError('xhr poll error', err);\n  });\n  this.pollXhr = req;\n};\n\n/**\n * Request constructor\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Request (opts) {\n  this.method = opts.method || 'GET';\n  this.uri = opts.uri;\n  this.xd = !!opts.xd;\n  this.xs = !!opts.xs;\n  this.async = false !== opts.async;\n  this.data = undefined !== opts.data ? opts.data : null;\n  this.agent = opts.agent;\n  this.isBinary = opts.isBinary;\n  this.supportsBinary = opts.supportsBinary;\n  this.enablesXDR = opts.enablesXDR;\n  this.requestTimeout = opts.requestTimeout;\n\n  // SSL options for Node.js client\n  this.pfx = opts.pfx;\n  this.key = opts.key;\n  this.passphrase = opts.passphrase;\n  this.cert = opts.cert;\n  this.ca = opts.ca;\n  this.ciphers = opts.ciphers;\n  this.rejectUnauthorized = opts.rejectUnauthorized;\n\n  // other options for Node.js client\n  this.extraHeaders = opts.extraHeaders;\n\n  this.create();\n}\n\n/**\n * Mix in `Emitter`.\n */\n\nEmitter(Request.prototype);\n\n/**\n * Creates the XHR object and sends the request.\n *\n * @api private\n */\n\nRequest.prototype.create = function () {\n  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n\n  var xhr = this.xhr = new XMLHttpRequest(opts);\n  var self = this;\n\n  try {\n    debug('xhr open %s: %s', this.method, this.uri);\n    xhr.open(this.method, this.uri, this.async);\n    try {\n      if (this.extraHeaders) {\n        xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);\n        for (var i in this.extraHeaders) {\n          if (this.extraHeaders.hasOwnProperty(i)) {\n            xhr.setRequestHeader(i, this.extraHeaders[i]);\n          }\n        }\n      }\n    } catch (e) {}\n\n    if ('POST' === this.method) {\n      try {\n        if (this.isBinary) {\n          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n        } else {\n          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n        }\n      } catch (e) {}\n    }\n\n    try {\n      xhr.setRequestHeader('Accept', '*/*');\n    } catch (e) {}\n\n    // ie6 check\n    if ('withCredentials' in xhr) {\n      xhr.withCredentials = true;\n    }\n\n    if (this.requestTimeout) {\n      xhr.timeout = this.requestTimeout;\n    }\n\n    if (this.hasXDR()) {\n      xhr.onload = function () {\n        self.onLoad();\n      };\n      xhr.onerror = function () {\n        self.onError(xhr.responseText);\n      };\n    } else {\n      xhr.onreadystatechange = function () {\n        if (xhr.readyState === 2) {\n          try {\n            var contentType = xhr.getResponseHeader('Content-Type');\n            if (self.supportsBinary && contentType === 'application/octet-stream') {\n              xhr.responseType = 'arraybuffer';\n            }\n          } catch (e) {}\n        }\n        if (4 !== xhr.readyState) return;\n        if (200 === xhr.status || 1223 === xhr.status) {\n          self.onLoad();\n        } else {\n          // make sure the `error` event handler that's user-set\n          // does not throw in the same tick and gets caught here\n          setTimeout(function () {\n            self.onError(xhr.status);\n          }, 0);\n        }\n      };\n    }\n\n    debug('xhr data %s', this.data);\n    xhr.send(this.data);\n  } catch (e) {\n    // Need to defer since .create() is called directly fhrom the constructor\n    // and thus the 'error' event can only be only bound *after* this exception\n    // occurs.  Therefore, also, we cannot throw here at all.\n    setTimeout(function () {\n      self.onError(e);\n    }, 0);\n    return;\n  }\n\n  if (global.document) {\n    this.index = Request.requestsCount++;\n    Request.requests[this.index] = this;\n  }\n};\n\n/**\n * Called upon successful response.\n *\n * @api private\n */\n\nRequest.prototype.onSuccess = function () {\n  this.emit('success');\n  this.cleanup();\n};\n\n/**\n * Called if we have data.\n *\n * @api private\n */\n\nRequest.prototype.onData = function (data) {\n  this.emit('data', data);\n  this.onSuccess();\n};\n\n/**\n * Called upon error.\n *\n * @api private\n */\n\nRequest.prototype.onError = function (err) {\n  this.emit('error', err);\n  this.cleanup(true);\n};\n\n/**\n * Cleans up house.\n *\n * @api private\n */\n\nRequest.prototype.cleanup = function (fromError) {\n  if ('undefined' === typeof this.xhr || null === this.xhr) {\n    return;\n  }\n  // xmlhttprequest\n  if (this.hasXDR()) {\n    this.xhr.onload = this.xhr.onerror = empty;\n  } else {\n    this.xhr.onreadystatechange = empty;\n  }\n\n  if (fromError) {\n    try {\n      this.xhr.abort();\n    } catch (e) {}\n  }\n\n  if (global.document) {\n    delete Request.requests[this.index];\n  }\n\n  this.xhr = null;\n};\n\n/**\n * Called upon load.\n *\n * @api private\n */\n\nRequest.prototype.onLoad = function () {\n  var data;\n  try {\n    var contentType;\n    try {\n      contentType = this.xhr.getResponseHeader('Content-Type');\n    } catch (e) {}\n    if (contentType === 'application/octet-stream') {\n      data = this.xhr.response || this.xhr.responseText;\n    } else {\n      data = this.xhr.responseText;\n    }\n  } catch (e) {\n    this.onError(e);\n  }\n  if (null != data) {\n    this.onData(data);\n  }\n};\n\n/**\n * Check if it has XDomainRequest.\n *\n * @api private\n */\n\nRequest.prototype.hasXDR = function () {\n  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n};\n\n/**\n * Aborts the request.\n *\n * @api public\n */\n\nRequest.prototype.abort = function () {\n  this.cleanup();\n};\n\n/**\n * Aborts pending requests when unloading the window. This is needed to prevent\n * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n * emitted.\n */\n\nRequest.requestsCount = 0;\nRequest.requests = {};\n\nif (global.document) {\n  if (global.attachEvent) {\n    global.attachEvent('onunload', unloadHandler);\n  } else if (global.addEventListener) {\n    global.addEventListener('beforeunload', unloadHandler, false);\n  }\n}\n\nfunction unloadHandler () {\n  for (var i in Request.requests) {\n    if (Request.requests.hasOwnProperty(i)) {\n      Request.requests[i].abort();\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/polling-xhr.js\n// module id = 837\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transports/polling-xhr.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * Module dependencies.\n */\n\nvar Transport = __webpack_require__(258);\nvar parser = __webpack_require__(119);\nvar parseqs = __webpack_require__(201);\nvar inherit = __webpack_require__(169);\nvar yeast = __webpack_require__(564);\nvar debug = __webpack_require__(5)('engine.io-client:websocket');\nvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\nvar NodeWebSocket;\nif (typeof window === 'undefined') {\n  try {\n    NodeWebSocket = __webpack_require__(1351);\n  } catch (e) { }\n}\n\n/**\n * Get either the `WebSocket` or `MozWebSocket` globals\n * in the browser or try to resolve WebSocket-compatible\n * interface exposed by `ws` for Node-like environment.\n */\n\nvar WebSocket = BrowserWebSocket;\nif (!WebSocket && typeof window === 'undefined') {\n  WebSocket = NodeWebSocket;\n}\n\n/**\n * Module exports.\n */\n\nmodule.exports = WS;\n\n/**\n * WebSocket transport constructor.\n *\n * @api {Object} connection options\n * @api public\n */\n\nfunction WS (opts) {\n  var forceBase64 = (opts && opts.forceBase64);\n  if (forceBase64) {\n    this.supportsBinary = false;\n  }\n  this.perMessageDeflate = opts.perMessageDeflate;\n  this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;\n  this.protocols = opts.protocols;\n  if (!this.usingBrowserWebSocket) {\n    WebSocket = NodeWebSocket;\n  }\n  Transport.call(this, opts);\n}\n\n/**\n * Inherits from Transport.\n */\n\ninherit(WS, Transport);\n\n/**\n * Transport name.\n *\n * @api public\n */\n\nWS.prototype.name = 'websocket';\n\n/*\n * WebSockets support binary\n */\n\nWS.prototype.supportsBinary = true;\n\n/**\n * Opens socket.\n *\n * @api private\n */\n\nWS.prototype.doOpen = function () {\n  if (!this.check()) {\n    // let probe timeout\n    return;\n  }\n\n  var uri = this.uri();\n  var protocols = this.protocols;\n  var opts = {\n    agent: this.agent,\n    perMessageDeflate: this.perMessageDeflate\n  };\n\n  // SSL options for Node.js client\n  opts.pfx = this.pfx;\n  opts.key = this.key;\n  opts.passphrase = this.passphrase;\n  opts.cert = this.cert;\n  opts.ca = this.ca;\n  opts.ciphers = this.ciphers;\n  opts.rejectUnauthorized = this.rejectUnauthorized;\n  if (this.extraHeaders) {\n    opts.headers = this.extraHeaders;\n  }\n  if (this.localAddress) {\n    opts.localAddress = this.localAddress;\n  }\n\n  try {\n    this.ws = this.usingBrowserWebSocket ? (protocols ? new WebSocket(uri, protocols) : new WebSocket(uri)) : new WebSocket(uri, protocols, opts);\n  } catch (err) {\n    return this.emit('error', err);\n  }\n\n  if (this.ws.binaryType === undefined) {\n    this.supportsBinary = false;\n  }\n\n  if (this.ws.supports && this.ws.supports.binary) {\n    this.supportsBinary = true;\n    this.ws.binaryType = 'nodebuffer';\n  } else {\n    this.ws.binaryType = 'arraybuffer';\n  }\n\n  this.addEventListeners();\n};\n\n/**\n * Adds event listeners to the socket\n *\n * @api private\n */\n\nWS.prototype.addEventListeners = function () {\n  var self = this;\n\n  this.ws.onopen = function () {\n    self.onOpen();\n  };\n  this.ws.onclose = function () {\n    self.onClose();\n  };\n  this.ws.onmessage = function (ev) {\n    self.onData(ev.data);\n  };\n  this.ws.onerror = function (e) {\n    self.onError('websocket error', e);\n  };\n};\n\n/**\n * Writes data to socket.\n *\n * @param {Array} array of packets.\n * @api private\n */\n\nWS.prototype.write = function (packets) {\n  var self = this;\n  this.writable = false;\n\n  // encodePacket efficient as it uses WS framing\n  // no need for encodePayload\n  var total = packets.length;\n  for (var i = 0, l = total; i < l; i++) {\n    (function (packet) {\n      parser.encodePacket(packet, self.supportsBinary, function (data) {\n        if (!self.usingBrowserWebSocket) {\n          // always create a new object (GH-437)\n          var opts = {};\n          if (packet.options) {\n            opts.compress = packet.options.compress;\n          }\n\n          if (self.perMessageDeflate) {\n            var len = 'string' === typeof data ? global.Buffer.byteLength(data) : data.length;\n            if (len < self.perMessageDeflate.threshold) {\n              opts.compress = false;\n            }\n          }\n        }\n\n        // Sometimes the websocket has already been closed but the browser didn't\n        // have a chance of informing us about it yet, in that case send will\n        // throw an error\n        try {\n          if (self.usingBrowserWebSocket) {\n            // TypeError is thrown when passing the second argument on Safari\n            self.ws.send(data);\n          } else {\n            self.ws.send(data, opts);\n          }\n        } catch (e) {\n          debug('websocket closed before onclose event');\n        }\n\n        --total || done();\n      });\n    })(packets[i]);\n  }\n\n  function done () {\n    self.emit('flush');\n\n    // fake drain\n    // defer to next tick to allow Socket to clear writeBuffer\n    setTimeout(function () {\n      self.writable = true;\n      self.emit('drain');\n    }, 0);\n  }\n};\n\n/**\n * Called upon close\n *\n * @api private\n */\n\nWS.prototype.onClose = function () {\n  Transport.prototype.onClose.call(this);\n};\n\n/**\n * Closes socket.\n *\n * @api private\n */\n\nWS.prototype.doClose = function () {\n  if (typeof this.ws !== 'undefined') {\n    this.ws.close();\n  }\n};\n\n/**\n * Generates uri for connection.\n *\n * @api private\n */\n\nWS.prototype.uri = function () {\n  var query = this.query || {};\n  var schema = this.secure ? 'wss' : 'ws';\n  var port = '';\n\n  // avoid port if default for schema\n  if (this.port && (('wss' === schema && Number(this.port) !== 443) ||\n    ('ws' === schema && Number(this.port) !== 80))) {\n    port = ':' + this.port;\n  }\n\n  // append timestamp to URI\n  if (this.timestampRequests) {\n    query[this.timestampParam] = yeast();\n  }\n\n  // communicate binary support capabilities\n  if (!this.supportsBinary) {\n    query.b64 = 1;\n  }\n\n  query = parseqs.encode(query);\n\n  // prepend ? to query\n  if (query.length) {\n    query = '?' + query;\n  }\n\n  var ipv6 = this.hostname.indexOf(':') !== -1;\n  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n};\n\n/**\n * Feature detection for WebSocket.\n *\n * @return {Boolean} whether this transport is available.\n * @api public\n */\n\nWS.prototype.check = function () {\n  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-client/lib/transports/websocket.js\n// module id = 838\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-client/lib/transports/websocket.js")},function(module,exports){eval("\n/**\n * Gets the keys for an object.\n *\n * @return {Array} keys\n * @api private\n */\n\nmodule.exports = Object.keys || function keys (obj){\n  var arr = [];\n  var has = Object.prototype.hasOwnProperty;\n\n  for (var i in obj) {\n    if (has.call(obj, i)) {\n      arr.push(i);\n    }\n  }\n  return arr;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/keys.js\n// module id = 839\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-parser/lib/keys.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/utf8js v2.1.2 by @mathias */\n;(function(root) {\n\n\t// Detect free variables `exports`\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code,\n\t// and use it as `root`\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar stringFromCharCode = String.fromCharCode;\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2decode(string) {\n\t\tvar output = [];\n\t\tvar counter = 0;\n\t\tvar length = string.length;\n\t\tvar value;\n\t\tvar extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t// Taken from https://mths.be/punycode\n\tfunction ucs2encode(array) {\n\t\tvar length = array.length;\n\t\tvar index = -1;\n\t\tvar value;\n\t\tvar output = '';\n\t\twhile (++index < length) {\n\t\t\tvalue = array[index];\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t}\n\t\treturn output;\n\t}\n\n\tfunction checkScalarValue(codePoint, strict) {\n\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\tif (strict) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t' is not a scalar value'\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction createByte(codePoint, shift) {\n\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t}\n\n\tfunction encodeCodePoint(codePoint, strict) {\n\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\treturn stringFromCharCode(codePoint);\n\t\t}\n\t\tvar symbol = '';\n\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t}\n\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\tif (!checkScalarValue(codePoint, strict)) {\n\t\t\t\tcodePoint = 0xFFFD;\n\t\t\t}\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\tsymbol += createByte(codePoint, 6);\n\t\t}\n\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\treturn symbol;\n\t}\n\n\tfunction utf8encode(string, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tvar codePoints = ucs2decode(string);\n\t\tvar length = codePoints.length;\n\t\tvar index = -1;\n\t\tvar codePoint;\n\t\tvar byteString = '';\n\t\twhile (++index < length) {\n\t\t\tcodePoint = codePoints[index];\n\t\t\tbyteString += encodeCodePoint(codePoint, strict);\n\t\t}\n\t\treturn byteString;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tfunction readContinuationByte() {\n\t\tif (byteIndex >= byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\treturn continuationByte & 0x3F;\n\t\t}\n\n\t\t// If we end up here, it’s not a continuation byte\n\t\tthrow Error('Invalid continuation byte');\n\t}\n\n\tfunction decodeSymbol(strict) {\n\t\tvar byte1;\n\t\tvar byte2;\n\t\tvar byte3;\n\t\tvar byte4;\n\t\tvar codePoint;\n\n\t\tif (byteIndex > byteCount) {\n\t\t\tthrow Error('Invalid byte index');\n\t\t}\n\n\t\tif (byteIndex == byteCount) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Read first byte\n\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\tbyteIndex++;\n\n\t\t// 1-byte sequence (no continuation bytes)\n\t\tif ((byte1 & 0x80) == 0) {\n\t\t\treturn byte1;\n\t\t}\n\n\t\t// 2-byte sequence\n\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\tif (codePoint >= 0x80) {\n\t\t\t\treturn codePoint;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\treturn checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;\n\t\t\t} else {\n\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t}\n\t\t}\n\n\t\t// 4-byte sequence\n\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\tbyte2 = readContinuationByte();\n\t\t\tbyte3 = readContinuationByte();\n\t\t\tbyte4 = readContinuationByte();\n\t\t\tcodePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\treturn codePoint;\n\t\t\t}\n\t\t}\n\n\t\tthrow Error('Invalid UTF-8 detected');\n\t}\n\n\tvar byteArray;\n\tvar byteCount;\n\tvar byteIndex;\n\tfunction utf8decode(byteString, opts) {\n\t\topts = opts || {};\n\t\tvar strict = false !== opts.strict;\n\n\t\tbyteArray = ucs2decode(byteString);\n\t\tbyteCount = byteArray.length;\n\t\tbyteIndex = 0;\n\t\tvar codePoints = [];\n\t\tvar tmp;\n\t\twhile ((tmp = decodeSymbol(strict)) !== false) {\n\t\t\tcodePoints.push(tmp);\n\t\t}\n\t\treturn ucs2encode(codePoints);\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar utf8 = {\n\t\t'version': '2.1.2',\n\t\t'encode': utf8encode,\n\t\t'decode': utf8decode\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\treturn utf8;\n\t\t}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = utf8;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tvar object = {};\n\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\tfor (var key in utf8) {\n\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.utf8 = utf8;\n\t}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module), __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/engine.io-parser/lib/utf8.js\n// module id = 840\n// module chunks = 0\n\n//# sourceURL=../node_modules/engine.io-parser/lib/utf8.js")},function(module,exports,__webpack_require__){eval("var prr = __webpack_require__(508)\n\nfunction init (type, message, cause) {\n  if (!!message && typeof message != 'string') {\n    message = message.message || message.name\n  }\n  prr(this, {\n      type    : type\n    , name    : type\n      // can be passed just a 'cause'\n    , cause   : typeof message != 'string' ? message : cause\n    , message : message\n  }, 'ewr')\n}\n\n// generic prototype, not intended to be actually used - helpful for `instanceof`\nfunction CustomError (message, cause) {\n  Error.call(this)\n  if (Error.captureStackTrace)\n    Error.captureStackTrace(this, this.constructor)\n  init.call(this, 'CustomError', message, cause)\n}\n\nCustomError.prototype = new Error()\n\nfunction createError (errno, type, proto) {\n  var err = function (message, cause) {\n    init.call(this, type, message, cause)\n    //TODO: the specificity here is stupid, errno should be available everywhere\n    if (type == 'FilesystemError') {\n      this.code    = this.cause.code\n      this.path    = this.cause.path\n      this.errno   = this.cause.errno\n      this.message =\n        (errno.errno[this.cause.errno]\n          ? errno.errno[this.cause.errno].description\n          : this.cause.message)\n        + (this.cause.path ? ' [' + this.cause.path + ']' : '')\n    }\n    Error.call(this)\n    if (Error.captureStackTrace)\n      Error.captureStackTrace(this, err)\n  }\n  err.prototype = !!proto ? new proto() : new CustomError()\n  return err\n}\n\nmodule.exports = function (errno) {\n  var ce = function (type, proto) {\n    return createError(errno, type, proto)\n  }\n  return {\n      CustomError     : CustomError\n    , FilesystemError : ce('FilesystemError')\n    , createError     : ce\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/errno/custom.js\n// module id = 841\n// module chunks = 0\n\n//# sourceURL=../node_modules/errno/custom.js")},function(module,exports,__webpack_require__){eval("var all = module.exports.all = [\n  {\n    errno: -2,\n    code: 'ENOENT',\n    description: 'no such file or directory'\n  },\n  {\n    errno: -1,\n    code: 'UNKNOWN',\n    description: 'unknown error'\n  },\n  {\n    errno: 0,\n    code: 'OK',\n    description: 'success'\n  },\n  {\n    errno: 1,\n    code: 'EOF',\n    description: 'end of file'\n  },\n  {\n    errno: 2,\n    code: 'EADDRINFO',\n    description: 'getaddrinfo error'\n  },\n  {\n    errno: 3,\n    code: 'EACCES',\n    description: 'permission denied'\n  },\n  {\n    errno: 4,\n    code: 'EAGAIN',\n    description: 'resource temporarily unavailable'\n  },\n  {\n    errno: 5,\n    code: 'EADDRINUSE',\n    description: 'address already in use'\n  },\n  {\n    errno: 6,\n    code: 'EADDRNOTAVAIL',\n    description: 'address not available'\n  },\n  {\n    errno: 7,\n    code: 'EAFNOSUPPORT',\n    description: 'address family not supported'\n  },\n  {\n    errno: 8,\n    code: 'EALREADY',\n    description: 'connection already in progress'\n  },\n  {\n    errno: 9,\n    code: 'EBADF',\n    description: 'bad file descriptor'\n  },\n  {\n    errno: 10,\n    code: 'EBUSY',\n    description: 'resource busy or locked'\n  },\n  {\n    errno: 11,\n    code: 'ECONNABORTED',\n    description: 'software caused connection abort'\n  },\n  {\n    errno: 12,\n    code: 'ECONNREFUSED',\n    description: 'connection refused'\n  },\n  {\n    errno: 13,\n    code: 'ECONNRESET',\n    description: 'connection reset by peer'\n  },\n  {\n    errno: 14,\n    code: 'EDESTADDRREQ',\n    description: 'destination address required'\n  },\n  {\n    errno: 15,\n    code: 'EFAULT',\n    description: 'bad address in system call argument'\n  },\n  {\n    errno: 16,\n    code: 'EHOSTUNREACH',\n    description: 'host is unreachable'\n  },\n  {\n    errno: 17,\n    code: 'EINTR',\n    description: 'interrupted system call'\n  },\n  {\n    errno: 18,\n    code: 'EINVAL',\n    description: 'invalid argument'\n  },\n  {\n    errno: 19,\n    code: 'EISCONN',\n    description: 'socket is already connected'\n  },\n  {\n    errno: 20,\n    code: 'EMFILE',\n    description: 'too many open files'\n  },\n  {\n    errno: 21,\n    code: 'EMSGSIZE',\n    description: 'message too long'\n  },\n  {\n    errno: 22,\n    code: 'ENETDOWN',\n    description: 'network is down'\n  },\n  {\n    errno: 23,\n    code: 'ENETUNREACH',\n    description: 'network is unreachable'\n  },\n  {\n    errno: 24,\n    code: 'ENFILE',\n    description: 'file table overflow'\n  },\n  {\n    errno: 25,\n    code: 'ENOBUFS',\n    description: 'no buffer space available'\n  },\n  {\n    errno: 26,\n    code: 'ENOMEM',\n    description: 'not enough memory'\n  },\n  {\n    errno: 27,\n    code: 'ENOTDIR',\n    description: 'not a directory'\n  },\n  {\n    errno: 28,\n    code: 'EISDIR',\n    description: 'illegal operation on a directory'\n  },\n  {\n    errno: 29,\n    code: 'ENONET',\n    description: 'machine is not on the network'\n  },\n  {\n    errno: 31,\n    code: 'ENOTCONN',\n    description: 'socket is not connected'\n  },\n  {\n    errno: 32,\n    code: 'ENOTSOCK',\n    description: 'socket operation on non-socket'\n  },\n  {\n    errno: 33,\n    code: 'ENOTSUP',\n    description: 'operation not supported on socket'\n  },\n  {\n    errno: 34,\n    code: 'ENOENT',\n    description: 'no such file or directory'\n  },\n  {\n    errno: 35,\n    code: 'ENOSYS',\n    description: 'function not implemented'\n  },\n  {\n    errno: 36,\n    code: 'EPIPE',\n    description: 'broken pipe'\n  },\n  {\n    errno: 37,\n    code: 'EPROTO',\n    description: 'protocol error'\n  },\n  {\n    errno: 38,\n    code: 'EPROTONOSUPPORT',\n    description: 'protocol not supported'\n  },\n  {\n    errno: 39,\n    code: 'EPROTOTYPE',\n    description: 'protocol wrong type for socket'\n  },\n  {\n    errno: 40,\n    code: 'ETIMEDOUT',\n    description: 'connection timed out'\n  },\n  {\n    errno: 41,\n    code: 'ECHARSET',\n    description: 'invalid Unicode character'\n  },\n  {\n    errno: 42,\n    code: 'EAIFAMNOSUPPORT',\n    description: 'address family for hostname not supported'\n  },\n  {\n    errno: 44,\n    code: 'EAISERVICE',\n    description: 'servname not supported for ai_socktype'\n  },\n  {\n    errno: 45,\n    code: 'EAISOCKTYPE',\n    description: 'ai_socktype not supported'\n  },\n  {\n    errno: 46,\n    code: 'ESHUTDOWN',\n    description: 'cannot send after transport endpoint shutdown'\n  },\n  {\n    errno: 47,\n    code: 'EEXIST',\n    description: 'file already exists'\n  },\n  {\n    errno: 48,\n    code: 'ESRCH',\n    description: 'no such process'\n  },\n  {\n    errno: 49,\n    code: 'ENAMETOOLONG',\n    description: 'name too long'\n  },\n  {\n    errno: 50,\n    code: 'EPERM',\n    description: 'operation not permitted'\n  },\n  {\n    errno: 51,\n    code: 'ELOOP',\n    description: 'too many symbolic links encountered'\n  },\n  {\n    errno: 52,\n    code: 'EXDEV',\n    description: 'cross-device link not permitted'\n  },\n  {\n    errno: 53,\n    code: 'ENOTEMPTY',\n    description: 'directory not empty'\n  },\n  {\n    errno: 54,\n    code: 'ENOSPC',\n    description: 'no space left on device'\n  },\n  {\n    errno: 55,\n    code: 'EIO',\n    description: 'i/o error'\n  },\n  {\n    errno: 56,\n    code: 'EROFS',\n    description: 'read-only file system'\n  },\n  {\n    errno: 57,\n    code: 'ENODEV',\n    description: 'no such device'\n  },\n  {\n    errno: 58,\n    code: 'ESPIPE',\n    description: 'invalid seek'\n  },\n  {\n    errno: 59,\n    code: 'ECANCELED',\n    description: 'operation canceled'\n  }\n]\n\nmodule.exports.errno = {}\nmodule.exports.code = {}\n\nall.forEach(function (error) {\n  module.exports.errno[error.errno] = error\n  module.exports.code[error.code] = error\n})\n\nmodule.exports.custom = __webpack_require__(841)(module.exports)\nmodule.exports.create = module.exports.custom.createError\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/errno/errno.js\n// module id = 842\n// module chunks = 0\n\n//# sourceURL=../node_modules/errno/errno.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// eslint-disable-next-line no-empty-function\nmodule.exports = function () {};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/function/noop.js\n// module id = 843\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/function/noop.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = __webpack_require__(845)()\n\t? Object.assign\n\t: __webpack_require__(846);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/index.js\n// module id = 844\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/assign/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nmodule.exports = function () {\n\tvar assign = Object.assign, obj;\n\tif (typeof assign !== "function") return false;\n\tobj = { foo: "raz" };\n\tassign(obj, { bar: "dwa" }, { trzy: "trzy" });\n\treturn (obj.foo + obj.bar + obj.trzy) === "razdwatrzy";\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/is-implemented.js\n// module id = 845\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/assign/is-implemented.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar keys  = __webpack_require__(848)\n  , value = __webpack_require__(853)\n  , max   = Math.max;\n\nmodule.exports = function (dest, src /*, …srcn*/) {\n\tvar error, i, length = max(arguments.length, 2), assign;\n\tdest = Object(value(dest));\n\tassign = function (key) {\n\t\ttry {\n\t\t\tdest[key] = src[key];\n\t\t} catch (e) {\n\t\t\tif (!error) error = e;\n\t\t}\n\t};\n\tfor (i = 1; i < length; ++i) {\n\t\tsrc = arguments[i];\n\t\tkeys(src).forEach(assign);\n\t}\n\tif (error !== undefined) throw error;\n\treturn dest;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/shim.js\n// module id = 846\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/assign/shim.js")},function(module,exports,__webpack_require__){"use strict";eval('// Deprecated\n\n\n\nmodule.exports = function (obj) {\n return typeof obj === "function";\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/is-callable.js\n// module id = 847\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/is-callable.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = __webpack_require__(849)()\n\t? Object.keys\n\t: __webpack_require__(850);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/index.js\n// module id = 848\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/keys/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nmodule.exports = function () {\n\ttry {\n\t\tObject.keys("primitive");\n\t\treturn true;\n\t} catch (e) {\n return false;\n}\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/is-implemented.js\n// module id = 849\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/keys/is-implemented.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar isValue = __webpack_require__(260);\n\nvar keys = Object.keys;\n\nmodule.exports = function (object) {\n\treturn keys(isValue(object) ? Object(object) : object);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/shim.js\n// module id = 850\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/keys/shim.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar isValue = __webpack_require__(260);\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nvar process = function (src, obj) {\n\tvar key;\n\tfor (key in src) obj[key] = src[key];\n};\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function (opts1 /*, …options*/) {\n\tvar result = create(null);\n\tforEach.call(arguments, function (options) {\n\t\tif (!isValue(options)) return;\n\t\tprocess(Object(options), result);\n\t});\n\treturn result;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/normalize-options.js\n// module id = 851\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/normalize-options.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nmodule.exports = function (fn) {\n\tif (typeof fn !== "function") throw new TypeError(fn + " is not a function");\n\treturn fn;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/valid-callable.js\n// module id = 852\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/valid-callable.js')},function(module,exports,__webpack_require__){"use strict";eval('\n\nvar isValue = __webpack_require__(260);\n\nmodule.exports = function (value) {\n\tif (!isValue(value)) throw new TypeError("Cannot use null or undefined");\n\treturn value;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/valid-value.js\n// module id = 853\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/object/valid-value.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = __webpack_require__(855)()\n\t? String.prototype.contains\n\t: __webpack_require__(856);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/index.js\n// module id = 854\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/string/#/contains/index.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nvar str = "razdwatrzy";\n\nmodule.exports = function () {\n\tif (typeof str.contains !== "function") return false;\n\treturn (str.contains("dwa") === true) && (str.contains("foo") === false);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/is-implemented.js\n// module id = 855\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/string/#/contains/is-implemented.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar indexOf = String.prototype.indexOf;\n\nmodule.exports = function (searchString/*, position*/) {\n\treturn indexOf.call(this, searchString, arguments[1]) > -1;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/shim.js\n// module id = 856\n// module chunks = 0\n\n//# sourceURL=../node_modules/es5-ext/string/#/contains/shim.js")},function(module,exports){eval("var generate = function generate(num, fn) {\n  var a = [];\n  for (var i = 0; i < num; ++i) {\n    a.push(fn(i));\n  }return a;\n};\n\nvar replicate = function replicate(num, val) {\n  return generate(num, function () {\n    return val;\n  });\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b);\n};\n\nvar flatten = function flatten(a) {\n  var r = [];\n  for (var j = 0, J = a.length; j < J; ++j) {\n    for (var i = 0, I = a[j].length; i < I; ++i) {\n      r.push(a[j][i]);\n    }\n  }return r;\n};\n\nvar chunksOf = function chunksOf(n, a) {\n  var b = [];\n  for (var i = 0, l = a.length; i < l; i += n) {\n    b.push(a.slice(i, i + n));\n  }return b;\n};\n\nmodule.exports = {\n  generate: generate,\n  replicate: replicate,\n  concat: concat,\n  flatten: flatten,\n  chunksOf: chunksOf\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/eth-lib/lib/array.js\n// module id = 857\n// module chunks = 0\n\n//# sourceURL=../node_modules/eth-lib/lib/array.js")},function(module,exports){eval('module.exports = {"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":50,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"modexpGquaddivisor":{"v":20,"d":"Gquaddivisor from modexp precompile for gas calculation."},"ecAddGas":{"v":500,"d":"Gas costs for curve addition precompile."},"ecMulGas":{"v":40000,"d":"Gas costs for curve multiplication precompile."},"ecPairingGas":{"v":100000,"d":"Base gas costs for curve pairing precompile."},"ecPairingWordGas":{"v":80000,"d":"Gas costs regarding curve pairing precompile input length."},"minerReward":{"v":"3000000000000000000","d":"the amount a miner get rewarded for mining a block"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereum-common/params.json\n// module id = 858\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereum-common/params.json')},function(module,exports,__webpack_require__){eval("const ethUtil = __webpack_require__(182)\nconst rlp = __webpack_require__(155)\nconst Buffer = __webpack_require__(1).Buffer\n\nvar Account = module.exports = function (data) {\n  // Define Properties\n  var fields = [{\n    name: 'nonce',\n    default: Buffer.alloc(0)\n  }, {\n    name: 'balance',\n    default: Buffer.alloc(0)\n  }, {\n    name: 'stateRoot',\n    length: 32,\n    default: ethUtil.SHA3_RLP\n  }, {\n    name: 'codeHash',\n    length: 32,\n    default: ethUtil.SHA3_NULL\n  }]\n\n  ethUtil.defineProperties(this, fields, data)\n}\n\nAccount.prototype.serialize = function () {\n  return rlp.encode(this.raw)\n}\n\nAccount.prototype.isContract = function () {\n  return this.codeHash.toString('hex') !== ethUtil.SHA3_NULL_S\n}\n\nAccount.prototype.getCode = function (state, cb) {\n  if (!this.isContract()) {\n    cb(null, Buffer.alloc(0))\n    return\n  }\n\n  state.getRaw(this.codeHash, cb)\n}\n\nAccount.prototype.setCode = function (trie, code, cb) {\n  var self = this\n\n  this.codeHash = ethUtil.sha3(code)\n\n  if (this.codeHash.toString('hex') === ethUtil.SHA3_NULL_S) {\n    cb(null, Buffer.alloc(0))\n    return\n  }\n\n  trie.putRaw(this.codeHash, code, function (err) {\n    cb(err, self.codeHash)\n  })\n}\n\nAccount.prototype.getStorage = function (trie, key, cb) {\n  var t = trie.copy()\n  t.root = this.stateRoot\n  t.get(key, cb)\n}\n\nAccount.prototype.setStorage = function (trie, key, val, cb) {\n  var self = this\n  var t = trie.copy()\n  t.root = self.stateRoot\n  t.put(key, val, function (err) {\n    if (err) return cb()\n    self.stateRoot = t.root\n    cb()\n  })\n}\n\nAccount.prototype.isEmpty = function () {\n  return this.balance.toString('hex') === '' &&\n  this.nonce.toString('hex') === '' &&\n  this.stateRoot.toString('hex') === ethUtil.SHA3_RLP_S &&\n  this.codeHash.toString('hex') === ethUtil.SHA3_NULL_S\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereumjs-account/index.js\n// module id = 859\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereumjs-account/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ethUtil = __webpack_require__(182);\nvar fees = __webpack_require__(861);\nvar BN = ethUtil.BN;\n\n// secp256k1n/2\nvar N_DIV_2 = new BN('7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0', 16);\n\n/**\n * Creates a new transaction object.\n *\n * @example\n * var rawTx = {\n *   nonce: '00',\n *   gasPrice: '09184e72a000',\n *   gasLimit: '2710',\n *   to: '0000000000000000000000000000000000000000',\n *   value: '00',\n *   data: '7f7465737432000000000000000000000000000000000000000000000000000000600057',\n *   v: '1c',\n *   r: '5e1d3a76fbf824220eafc8c79ad578ad2b67d01b0c2425eb1f1347e8f50882ab',\n *   s: '5bd428537f05f9830e93792f90ea6a3e2d1ee84952dd96edbae9f658f831ab13'\n * };\n * var tx = new Transaction(rawTx);\n *\n * @class\n * @param {Buffer | Array | Object} data a transaction can be initiailized with either a buffer containing the RLP serialized transaction or an array of buffers relating to each of the tx Properties, listed in order below in the exmple.\n *\n * Or lastly an Object containing the Properties of the transaction like in the Usage example.\n *\n * For Object and Arrays each of the elements can either be a Buffer, a hex-prefixed (0x) String , Number, or an object with a toBuffer method such as Bignum\n *\n * @property {Buffer} raw The raw rlp encoded transaction\n * @param {Buffer} data.nonce nonce number\n * @param {Buffer} data.gasLimit transaction gas limit\n * @param {Buffer} data.gasPrice transaction gas price\n * @param {Buffer} data.to to the to address\n * @param {Buffer} data.value the amount of ether sent\n * @param {Buffer} data.data this will contain the data of the message or the init of a contract\n * @param {Buffer} data.v EC signature parameter\n * @param {Buffer} data.r EC signature parameter\n * @param {Buffer} data.s EC recovery ID\n * @param {Number} data.chainId EIP 155 chainId - mainnet: 1, ropsten: 3\n * */\n\nvar Transaction = function () {\n  function Transaction(data) {\n    _classCallCheck(this, Transaction);\n\n    data = data || {};\n    // Define Properties\n    var fields = [{\n      name: 'nonce',\n      length: 32,\n      allowLess: true,\n      default: new Buffer([])\n    }, {\n      name: 'gasPrice',\n      length: 32,\n      allowLess: true,\n      default: new Buffer([])\n    }, {\n      name: 'gasLimit',\n      alias: 'gas',\n      length: 32,\n      allowLess: true,\n      default: new Buffer([])\n    }, {\n      name: 'to',\n      allowZero: true,\n      length: 20,\n      default: new Buffer([])\n    }, {\n      name: 'value',\n      length: 32,\n      allowLess: true,\n      default: new Buffer([])\n    }, {\n      name: 'data',\n      alias: 'input',\n      allowZero: true,\n      default: new Buffer([])\n    }, {\n      name: 'v',\n      allowZero: true,\n      default: new Buffer([0x1c])\n    }, {\n      name: 'r',\n      length: 32,\n      allowZero: true,\n      allowLess: true,\n      default: new Buffer([])\n    }, {\n      name: 's',\n      length: 32,\n      allowZero: true,\n      allowLess: true,\n      default: new Buffer([])\n    }];\n\n    /**\n     * Returns the rlp encoding of the transaction\n     * @method serialize\n     * @return {Buffer}\n     * @memberof Transaction\n     * @name serialize\n     */\n    // attached serialize\n    ethUtil.defineProperties(this, fields, data);\n\n    /**\n     * @property {Buffer} from (read only) sender address of this transaction, mathematically derived from other parameters.\n     * @name from\n     * @memberof Transaction\n     */\n    Object.defineProperty(this, 'from', {\n      enumerable: true,\n      configurable: true,\n      get: this.getSenderAddress.bind(this)\n    });\n\n    // calculate chainId from signature\n    var sigV = ethUtil.bufferToInt(this.v);\n    var chainId = Math.floor((sigV - 35) / 2);\n    if (chainId < 0) chainId = 0;\n\n    // set chainId\n    this._chainId = chainId || data.chainId || 0;\n    this._homestead = true;\n  }\n\n  /**\n   * If the tx's `to` is to the creation address\n   * @return {Boolean}\n   */\n\n\n  Transaction.prototype.toCreationAddress = function toCreationAddress() {\n    return this.to.toString('hex') === '';\n  };\n\n  /**\n   * Computes a sha3-256 hash of the serialized tx\n   * @param {Boolean} [includeSignature=true] whether or not to inculde the signature\n   * @return {Buffer}\n   */\n\n\n  Transaction.prototype.hash = function hash(includeSignature) {\n    if (includeSignature === undefined) includeSignature = true;\n\n    // EIP155 spec:\n    // when computing the hash of a transaction for purposes of signing or recovering,\n    // instead of hashing only the first six elements (ie. nonce, gasprice, startgas, to, value, data),\n    // hash nine elements, with v replaced by CHAIN_ID, r = 0 and s = 0\n\n    var items = void 0;\n    if (includeSignature) {\n      items = this.raw;\n    } else {\n      if (this._chainId > 0) {\n        var raw = this.raw.slice();\n        this.v = this._chainId;\n        this.r = 0;\n        this.s = 0;\n        items = this.raw;\n        this.raw = raw;\n      } else {\n        items = this.raw.slice(0, 6);\n      }\n    }\n\n    // create hash\n    return ethUtil.rlphash(items);\n  };\n\n  /**\n   * returns the public key of the sender\n   * @return {Buffer}\n   */\n\n\n  Transaction.prototype.getChainId = function getChainId() {\n    return this._chainId;\n  };\n\n  /**\n   * returns the sender's address\n   * @return {Buffer}\n   */\n\n\n  Transaction.prototype.getSenderAddress = function getSenderAddress() {\n    if (this._from) {\n      return this._from;\n    }\n    var pubkey = this.getSenderPublicKey();\n    this._from = ethUtil.publicToAddress(pubkey);\n    return this._from;\n  };\n\n  /**\n   * returns the public key of the sender\n   * @return {Buffer}\n   */\n\n\n  Transaction.prototype.getSenderPublicKey = function getSenderPublicKey() {\n    if (!this._senderPubKey || !this._senderPubKey.length) {\n      if (!this.verifySignature()) throw new Error('Invalid Signature');\n    }\n    return this._senderPubKey;\n  };\n\n  /**\n   * Determines if the signature is valid\n   * @return {Boolean}\n   */\n\n\n  Transaction.prototype.verifySignature = function verifySignature() {\n    var msgHash = this.hash(false);\n    // All transaction signatures whose s-value is greater than secp256k1n/2 are considered invalid.\n    if (this._homestead && new BN(this.s).cmp(N_DIV_2) === 1) {\n      return false;\n    }\n\n    try {\n      var v = ethUtil.bufferToInt(this.v);\n      if (this._chainId > 0) {\n        v -= this._chainId * 2 + 8;\n      }\n      this._senderPubKey = ethUtil.ecrecover(msgHash, v, this.r, this.s);\n    } catch (e) {\n      return false;\n    }\n\n    return !!this._senderPubKey;\n  };\n\n  /**\n   * sign a transaction with a given a private key\n   * @param {Buffer} privateKey\n   */\n\n\n  Transaction.prototype.sign = function sign(privateKey) {\n    var msgHash = this.hash(false);\n    var sig = ethUtil.ecsign(msgHash, privateKey);\n    if (this._chainId > 0) {\n      sig.v += this._chainId * 2 + 8;\n    }\n    Object.assign(this, sig);\n  };\n\n  /**\n   * The amount of gas paid for the data in this tx\n   * @return {BN}\n   */\n\n\n  Transaction.prototype.getDataFee = function getDataFee() {\n    var data = this.raw[5];\n    var cost = new BN(0);\n    for (var i = 0; i < data.length; i++) {\n      data[i] === 0 ? cost.iaddn(fees.txDataZeroGas.v) : cost.iaddn(fees.txDataNonZeroGas.v);\n    }\n    return cost;\n  };\n\n  /**\n   * the minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee)\n   * @return {BN}\n   */\n\n\n  Transaction.prototype.getBaseFee = function getBaseFee() {\n    var fee = this.getDataFee().iaddn(fees.txGas.v);\n    if (this._homestead && this.toCreationAddress()) {\n      fee.iaddn(fees.txCreation.v);\n    }\n    return fee;\n  };\n\n  /**\n   * the up front amount that an account must have for this transaction to be valid\n   * @return {BN}\n   */\n\n\n  Transaction.prototype.getUpfrontCost = function getUpfrontCost() {\n    return new BN(this.gasLimit).imul(new BN(this.gasPrice)).iadd(new BN(this.value));\n  };\n\n  /**\n   * validates the signature and checks to see if it has enough gas\n   * @param {Boolean} [stringError=false] whether to return a string with a dscription of why the validation failed or return a Bloolean\n   * @return {Boolean|String}\n   */\n\n\n  Transaction.prototype.validate = function validate(stringError) {\n    var errors = [];\n    if (!this.verifySignature()) {\n      errors.push('Invalid Signature');\n    }\n\n    if (this.getBaseFee().cmp(new BN(this.gasLimit)) > 0) {\n      errors.push(['gas limit is too low. Need at least ' + this.getBaseFee()]);\n    }\n\n    if (stringError === undefined || stringError === false) {\n      return errors.length === 0;\n    } else {\n      return errors.join(' ');\n    }\n  };\n\n  return Transaction;\n}();\n\nmodule.exports = Transaction;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereumjs-tx/es5/index.js\n// module id = 860\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereumjs-tx/es5/index.js")},function(module,exports){eval('module.exports = {"genesisGasLimit":{"v":5000,"d":"Gas limit of the Genesis block."},"genesisDifficulty":{"v":17179869184,"d":"Difficulty of the Genesis block."},"genesisNonce":{"v":"0x0000000000000042","d":"the geneis nonce"},"genesisExtraData":{"v":"0x11bbe8db4e347b4e8c937c1c8370e4b5ed33adb3db69cbdb7a38e1e50b1b82fa","d":"extra data "},"genesisHash":{"v":"0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3","d":"genesis hash"},"genesisStateRoot":{"v":"0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544","d":"the genesis state root"},"minGasLimit":{"v":5000,"d":"Minimum the gas limit may ever be."},"gasLimitBoundDivisor":{"v":1024,"d":"The bound divisor of the gas limit, used in update calculations."},"minimumDifficulty":{"v":131072,"d":"The minimum that the difficulty may ever be."},"difficultyBoundDivisor":{"v":2048,"d":"The bound divisor of the difficulty, used in the update calculations."},"durationLimit":{"v":13,"d":"The decision boundary on the blocktime duration used to determine whether difficulty should go up or not."},"maximumExtraDataSize":{"v":32,"d":"Maximum size extra data may be after Genesis."},"epochDuration":{"v":30000,"d":"Duration between proof-of-work epochs."},"stackLimit":{"v":1024,"d":"Maximum size of VM stack allowed."},"callCreateDepth":{"v":1024,"d":"Maximum depth of call/create stack."},"tierStepGas":{"v":[0,2,3,5,8,10,20],"d":"Once per operation, for a selection of them."},"expGas":{"v":10,"d":"Once per EXP instuction."},"expByteGas":{"v":10,"d":"Times ceil(log256(exponent)) for the EXP instruction."},"sha3Gas":{"v":30,"d":"Once per SHA3 operation."},"sha3WordGas":{"v":6,"d":"Once per word of the SHA3 operation\'s data."},"sloadGas":{"v":50,"d":"Once per SLOAD operation."},"sstoreSetGas":{"v":20000,"d":"Once per SSTORE operation if the zeroness changes from zero."},"sstoreResetGas":{"v":5000,"d":"Once per SSTORE operation if the zeroness does not change from zero."},"sstoreRefundGas":{"v":15000,"d":"Once per SSTORE operation if the zeroness changes to zero."},"jumpdestGas":{"v":1,"d":"Refunded gas, once per SSTORE operation if the zeroness changes to zero."},"logGas":{"v":375,"d":"Per LOG* operation."},"logDataGas":{"v":8,"d":"Per byte in a LOG* operation\'s data."},"logTopicGas":{"v":375,"d":"Multiplied by the * of the LOG*, per LOG transaction. e.g. LOG0 incurs 0 * c_txLogTopicGas, LOG4 incurs 4 * c_txLogTopicGas."},"createGas":{"v":32000,"d":"Once per CREATE operation & contract-creation transaction."},"callGas":{"v":40,"d":"Once per CALL operation & message call transaction."},"callStipend":{"v":2300,"d":"Free gas given at beginning of call."},"callValueTransferGas":{"v":9000,"d":"Paid for CALL when the value transfor is non-zero."},"callNewAccountGas":{"v":25000,"d":"Paid for CALL when the destination address didn\'t exist prior."},"suicideRefundGas":{"v":24000,"d":"Refunded following a suicide operation."},"memoryGas":{"v":3,"d":"Times the address of the (highest referenced byte in memory + 1). NOTE: referencing happens on read, write and in instructions such as RETURN and CALL."},"quadCoeffDiv":{"v":512,"d":"Divisor for the quadratic particle of the memory cost equation."},"createDataGas":{"v":200,"d":""},"txGas":{"v":21000,"d":"Per transaction. NOTE: Not payable on data of calls between transactions."},"txCreation":{"v":32000,"d":"the cost of creating a contract via tx"},"txDataZeroGas":{"v":4,"d":"Per byte of data attached to a transaction that equals zero. NOTE: Not payable on data of calls between transactions."},"txDataNonZeroGas":{"v":68,"d":"Per byte of data attached to a transaction that is not equal to zero. NOTE: Not payable on data of calls between transactions."},"copyGas":{"v":3,"d":"Multiplied by the number of 32-byte words that are copied (round up) for any *COPY operation and added."},"ecrecoverGas":{"v":3000,"d":""},"sha256Gas":{"v":60,"d":""},"sha256WordGas":{"v":12,"d":""},"ripemd160Gas":{"v":600,"d":""},"ripemd160WordGas":{"v":120,"d":""},"identityGas":{"v":15,"d":""},"identityWordGas":{"v":3,"d":""},"minerReward":{"v":"5000000000000000000","d":"the amount a miner get rewarded for mining a block"},"ommerReward":{"v":"625000000000000000","d":"The amount of wei a miner of an uncle block gets for being inculded in the blockchain"},"niblingReward":{"v":"156250000000000000","d":"the amount a miner gets for inculding a uncle"},"homeSteadForkNumber":{"v":1150000,"d":"the block that the Homestead fork started at"},"homesteadRepriceForkNumber":{"v":2463000,"d":"the block that the Homestead Reprice (EIP150) fork started at"},"timebombPeriod":{"v":100000,"d":"Exponential difficulty timebomb period"},"freeBlockPeriod":{"v":2}}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethereumjs-tx/~/ethereum-common/params.json\n// module id = 861\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethereumjs-tx/node_modules/ethereum-common/params.json')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(0).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethjs-unit/~/bn.js/lib/bn.js\n// module id = 862\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar isHexPrefixed = __webpack_require__(429);\nvar stripHexPrefix = __webpack_require__(543);\n\n/**\n * Pads a `String` to have an even length\n * @param {String} value\n * @return {String} output\n */\nfunction padToEven(value) {\n  var a = value; // eslint-disable-line\n\n  if (typeof a !== 'string') {\n    throw new Error('[ethjs-util] while padding to even, value must be string, is currently ' + typeof a + ', while padToEven.');\n  }\n\n  if (a.length % 2) {\n    a = '0' + a;\n  }\n\n  return a;\n}\n\n/**\n * Converts a `Number` into a hex `String`\n * @param {Number} i\n * @return {String}\n */\nfunction intToHex(i) {\n  var hex = i.toString(16); // eslint-disable-line\n\n  return '0x' + hex;\n}\n\n/**\n * Converts an `Number` to a `Buffer`\n * @param {Number} i\n * @return {Buffer}\n */\nfunction intToBuffer(i) {\n  var hex = intToHex(i);\n\n  return new Buffer(padToEven(hex.slice(2)), 'hex');\n}\n\n/**\n * Get the binary size of a string\n * @param {String} str\n * @return {Number}\n */\nfunction getBinarySize(str) {\n  if (typeof str !== 'string') {\n    throw new Error('[ethjs-util] while getting binary size, method getBinarySize requires input \\'str\\' to be type String, got \\'' + typeof str + '\\'.');\n  }\n\n  return Buffer.byteLength(str, 'utf8');\n}\n\n/**\n * Returns TRUE if the first specified array contains all elements\n * from the second one. FALSE otherwise.\n *\n * @param {array} superset\n * @param {array} subset\n *\n * @returns {boolean}\n */\nfunction arrayContainsArray(superset, subset, some) {\n  if (Array.isArray(superset) !== true) {\n    throw new Error('[ethjs-util] method arrayContainsArray requires input \\'superset\\' to be an array got type \\'' + typeof superset + '\\'');\n  }\n  if (Array.isArray(subset) !== true) {\n    throw new Error('[ethjs-util] method arrayContainsArray requires input \\'subset\\' to be an array got type \\'' + typeof subset + '\\'');\n  }\n\n  return subset[Boolean(some) && 'some' || 'every'](function (value) {\n    return superset.indexOf(value) >= 0;\n  });\n}\n\n/**\n * Should be called to get utf8 from it's hex representation\n *\n * @method toUtf8\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nfunction toUtf8(hex) {\n  var bufferValue = new Buffer(padToEven(stripHexPrefix(hex).replace(/^0+|0+$/g, '')), 'hex');\n\n  return bufferValue.toString('utf8');\n}\n\n/**\n * Should be called to get ascii from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nfunction toAscii(hex) {\n  var str = ''; // eslint-disable-line\n  var i = 0,\n      l = hex.length; // eslint-disable-line\n\n  if (hex.substring(0, 2) === '0x') {\n    i = 2;\n  }\n\n  for (; i < l; i += 2) {\n    var code = parseInt(hex.substr(i, 2), 16);\n    str += String.fromCharCode(code);\n  }\n\n  return str;\n}\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of utf8 string\n *\n * @method fromUtf8\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nfunction fromUtf8(stringValue) {\n  var str = new Buffer(stringValue, 'utf8');\n\n  return '0x' + padToEven(str.toString('hex')).replace(/^0+|0+$/g, '');\n}\n\n/**\n * Should be called to get hex representation (prefixed by 0x) of ascii string\n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nfunction fromAscii(stringValue) {\n  var hex = ''; // eslint-disable-line\n  for (var i = 0; i < stringValue.length; i++) {\n    // eslint-disable-line\n    var code = stringValue.charCodeAt(i);\n    var n = code.toString(16);\n    hex += n.length < 2 ? '0' + n : n;\n  }\n\n  return '0x' + hex;\n}\n\n/**\n * getKeys([{a: 1, b: 2}, {a: 3, b: 4}], 'a') => [1, 3]\n *\n * @method getKeys get specific key from inner object array of objects\n * @param {String} params\n * @param {String} key\n * @param {Boolean} allowEmpty\n * @returns {Array} output just a simple array of output keys\n */\nfunction getKeys(params, key, allowEmpty) {\n  if (!Array.isArray(params)) {\n    throw new Error('[ethjs-util] method getKeys expecting type Array as \\'params\\' input, got \\'' + typeof params + '\\'');\n  }\n  if (typeof key !== 'string') {\n    throw new Error('[ethjs-util] method getKeys expecting type String for input \\'key\\' got \\'' + typeof key + '\\'.');\n  }\n\n  var result = []; // eslint-disable-line\n\n  for (var i = 0; i < params.length; i++) {\n    // eslint-disable-line\n    var value = params[i][key]; // eslint-disable-line\n    if (allowEmpty && !value) {\n      value = '';\n    } else if (typeof value !== 'string') {\n      throw new Error('invalid abi');\n    }\n    result.push(value);\n  }\n\n  return result;\n}\n\n/**\n * Is the string a hex string.\n *\n * @method check if string is hex string of specific length\n * @param {String} value\n * @param {Number} length\n * @returns {Boolean} output the string is a hex string\n */\nfunction isHexString(value, length) {\n  if (typeof value !== 'string' || !value.match(/^0x[0-9A-Fa-f]*$/)) {\n    return false;\n  }\n\n  if (length && value.length !== 2 + 2 * length) {\n    return false;\n  }\n\n  return true;\n}\n\nmodule.exports = {\n  arrayContainsArray: arrayContainsArray,\n  intToBuffer: intToBuffer,\n  getBinarySize: getBinarySize,\n  isHexPrefixed: isHexPrefixed,\n  stripHexPrefix: stripHexPrefix,\n  padToEven: padToEven,\n  intToHex: intToHex,\n  fromAscii: fromAscii,\n  fromUtf8: fromUtf8,\n  toAscii: toAscii,\n  toUtf8: toUtf8,\n  getKeys: getKeys,\n  isHexString: isHexString\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ethjs-util/lib/index.js\n// module id = 863\n// module chunks = 0\n\n//# sourceURL=../node_modules/ethjs-util/lib/index.js")},function(module,exports,__webpack_require__){eval("var isFunction = __webpack_require__(428)\n\nmodule.exports = forEach\n\nvar toString = Object.prototype.toString\nvar hasOwnProperty = Object.prototype.hasOwnProperty\n\nfunction forEach(list, iterator, context) {\n    if (!isFunction(iterator)) {\n        throw new TypeError('iterator must be a function')\n    }\n\n    if (arguments.length < 3) {\n        context = this\n    }\n    \n    if (toString.call(list) === '[object Array]')\n        forEachArray(list, iterator, context)\n    else if (typeof list === 'string')\n        forEachString(list, iterator, context)\n    else\n        forEachObject(list, iterator, context)\n}\n\nfunction forEachArray(array, iterator, context) {\n    for (var i = 0, len = array.length; i < len; i++) {\n        if (hasOwnProperty.call(array, i)) {\n            iterator.call(context, array[i], i, array)\n        }\n    }\n}\n\nfunction forEachString(string, iterator, context) {\n    for (var i = 0, len = string.length; i < len; i++) {\n        // no such thing as a sparse string.\n        iterator.call(context, string.charAt(i), i, string)\n    }\n}\n\nfunction forEachObject(object, iterator, context) {\n    for (var k in object) {\n        if (hasOwnProperty.call(object, k)) {\n            iterator.call(context, object[k], k, object)\n        }\n    }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/for-each/index.js\n// module id = 864\n// module chunks = 0\n\n//# sourceURL=../node_modules/for-each/index.js")},function(module,exports,__webpack_require__){eval("const EventEmitter = __webpack_require__(15).EventEmitter\nconst assert = __webpack_require__(16)\nconst fsm = __webpack_require__(866)\n\nmodule.exports = fsmEvent\n\n// create an fsmEvent instance\n// obj -> fn\nfunction fsmEvent (start, events) {\n  if (typeof start === 'object') {\n    events = start\n    start = 'START'\n  }\n  assert.equal(typeof start, 'string')\n  assert.equal(typeof events, 'object')\n  assert.ok(events[start], 'invalid starting state ' + start)\n  assert.ok(fsm.validate(events))\n\n  const emitter = new EventEmitter()\n  emit._graph = fsm.reachable(events)\n  emit._emitter = emitter\n  emit._events = events\n  emit._state = start\n  emit.emit = emit\n  emit.on = on\n\n  return emit\n\n  // set a state listener\n  // str, fn -> null\n  function on (event, cb) {\n    emitter.on(event, cb)\n  }\n\n  // change the state\n  // str -> null\n  function emit (str) {\n    const nwState = emit._events[emit._state][str]\n    if (!reach(emit._state, nwState, emit._graph)) {\n      const err = 'invalid transition: ' + emit._state + ' -> ' + str\n      return emitter.emit('error', err)\n    }\n\n    const leaveEv = emit._state + ':leave'\n    const enterEv = nwState + ':enter'\n\n    if (!emit._state) return enter()\n    return leave()\n\n    function leave () {\n      if (!emitter._events[leaveEv]) enter()\n      else emitter.emit(leaveEv, enter)\n    }\n\n    function enter () {\n      if (!emitter._events[enterEv]) done()\n      else emitter.emit(enterEv, done)\n    }\n\n    function done () {\n      emit._state = nwState\n      emitter.emit(nwState)\n      emitter.emit('done')\n    }\n  }\n}\n\n// check if state can reach in reach\n// str, str, obj -> bool\nfunction reach (curr, next, reachable) {\n  if (!next) return false\n  if (!curr) return true\n\n  const here = reachable[curr]\n  if (!here || !here[next]) return false\n  return here[next].length === 1\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fsm-event/index.js\n// module id = 865\n// module chunks = 0\n\n//# sourceURL=../node_modules/fsm-event/index.js")},function(module,exports){eval("function each(obj, iter) {\n  for(var key in obj) {\n    var value = obj[key]\n    iter(value, key, obj)\n  }\n}\n\nfunction keys (obj) {\n  return Object.keys(obj).sort()\n}\n\nfunction contains (a, v) {\n  return ~a.indexOf(v)\n}\nfunction union (a, b) {\n  return a.filter(function (v) {\n    return contains(b, v)\n  })\n}\n\nfunction disunion1(a, b) {\n  return a.filter(function (v) {\n    return !contains(b, v)\n  })\n}\n\nfunction disunion(a, b) {\n  return a.filter(function (v) {\n    return !contains(b, v)\n  }).concat(b.filter(function (v) {\n    return !contains(a, v)\n  })).sort()\n}\n\nfunction equal (a, b) {\n  if(a.length != b.length) return false\n  for(var i in a)\n    if(b[i] !== a[i]) return false\n}\n\nfunction empty (v) {\n  for(var k in v)\n    return false\n  return true\n}\n\n//check that all transitions are to valid states.\nvar validate = exports.validate = function (fsm) {\n  var states = Object.keys(fsm)\n  each(fsm, function (state, name) {\n    each(state, function (_state, event) {\n      if(!fsm[_state])\n        throw new Error(\n            'invalid transition from state:' + name\n          + ' to state:' + _state\n          + ' on event:' + event\n        )\n    })\n  })\n  return true\n}\n\n//get a list of all states that are reachable from any given state.\n//(with the shortest paths?)\n// returns object: {STATES: {REACHABLE_STATE: path}}\n\nvar reachable = exports.reachable = function (fsm) {\n  var reachable = {}\n  var added = false\n  do {\n    added = false\n    each(fsm, function (state, name) {\n      var reach = reachable[name] = reachable[name] || {}\n      //add any state that can be reached directly.\n      each(state, function (_name, event) {\n        if(!reach[_name]) reach[_name] = [event], added = true\n      })\n      //add any state that can be reached from a state you can reach directly.\n      each(state, function (_name, event) {\n        var _state = reachable[_name]\n        each(_state, function (path, _name) {\n          if(!reach[_name])\n            reach[_name] = [event].concat(path), added = true\n        })\n      })\n    })\n  } while(added);\n  return reachable\n}\n\n// deadlock: are there any dead ends that cannot reach another state?\n\nexports.terminal =\nexports.deadlock = function (fsm) {\n  var dead = []\n  each(fsm, function (state, name) {\n    if(empty(state)) dead.push(name)\n  })\n  return dead\n}\n\n// livelock; are there any cycles that cannot reach a terminal state?\n// return any states that cannot reach the given terminal states,\n// unless they are themselves terminal states.\n\nvar livelock = exports.livelock = function (fsm, terminals) {\n  var reach = reachable(fsm), locked = []\n  each(reach, function (reaches, name) {\n    if(contains(terminals, name)) return\n    each(terminals, function (_name) {\n      if(!reaches[_name] && !contains(locked, name))\n        locked.push(name)\n    })\n  })\n  return locked.sort()\n}\n\n\nfunction events (fsm) {\n  var events = []\n  each(fsm, function (state, name) {\n    each(state, function (_state, event) {\n      if(!contains(events, event)) events.push(event)\n    })\n  })\n  return events.sort()\n}\n\nvar combine = exports.combine = function (fsm1, fsm2, start1, start2) {\n  var combined = {}\n  var events1 = events(fsm1)\n  var events2 = events(fsm2)\n  var independent = disunion(events1, events2)\n\n  function expand(name1, name2) {\n    var cName = name1 + '-' + name2, state\n    if(!combined[cName]) combined[cName] = {}\n    state = combined[cName]\n\n    //Q: what are the events which are allowed to occur from this state?\n    //A: independent events (used in only one fsm) or events that occur in both fsms in current state.\n\n    var trans1 = keys(fsm1[name1]), trans2 = keys(fsm2[name2])\n    var allowed = union(trans1, trans2)\n\n    //expand to a new state\n    allowed.forEach(function (event) {\n      state[event] = fsm1[name1][event] + '-' + fsm2[name2][event]\n      if(!combined[state[event]])\n        expand(fsm1[name1][event], fsm2[name2][event])\n    })\n\n    //only transition fsm1\n    union(independent, trans1).forEach(function (event) {\n      state[event] = fsm1[name1][event] + '-' + name2\n      if(!combined[state[event]])\n        expand(fsm1[name1][event], name2)\n    })\n\n    union(independent, trans2).forEach(function (event) {\n      state[event] =  name1 + '-' + fsm2[name2][event]\n      if(!combined[state[event]])\n        expand(name1, fsm2[name2][event])\n    })\n\n    return combined[cName]\n  }\n\n  expand(start1, start2)\n  return combined\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fsm/index.js\n// module id = 866\n// module chunks = 0\n\n//# sourceURL=../node_modules/fsm/index.js")},function(module,exports){eval("// originally pulled out of simple-peer\n\nmodule.exports = function getBrowserRTC () {\n  if (typeof window === 'undefined') return null\n  var wrtc = {\n    RTCPeerConnection: window.RTCPeerConnection || window.mozRTCPeerConnection ||\n      window.webkitRTCPeerConnection,\n    RTCSessionDescription: window.RTCSessionDescription ||\n      window.mozRTCSessionDescription || window.webkitRTCSessionDescription,\n    RTCIceCandidate: window.RTCIceCandidate || window.mozRTCIceCandidate ||\n      window.webkitRTCIceCandidate\n  }\n  if (!wrtc.RTCPeerConnection) return null\n  return wrtc\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/get-browser-rtc/index.js\n// module id = 867\n// module chunks = 0\n\n//# sourceURL=../node_modules/get-browser-rtc/index.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {var win;\n\nif (typeof window !== "undefined") {\n    win = window;\n} else if (typeof global !== "undefined") {\n    win = global;\n} else if (typeof self !== "undefined"){\n    win = self;\n} else {\n    win = {};\n}\n\nmodule.exports = win;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/global/window.js\n// module id = 868\n// module chunks = 0\n\n//# sourceURL=../node_modules/global/window.js')},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n  return toString.call(arr) == '[object Array]';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-binary2/~/isarray/index.js\n// module id = 869\n// module chunks = 0\n\n//# sourceURL=../node_modules/has-binary2/node_modules/isarray/index.js")},function(module,exports){eval("\n/**\n * Module exports.\n *\n * Logic borrowed from Modernizr:\n *\n *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n */\n\ntry {\n  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n    'withCredentials' in new XMLHttpRequest();\n} catch (err) {\n  // if XMLHttp support is disabled in IE then it will throw\n  // when trying to create\n  module.exports = false;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/has-cors/index.js\n// module id = 870\n// module chunks = 0\n\n//# sourceURL=../node_modules/has-cors/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar Transform = __webpack_require__(46).Transform\nvar inherits = __webpack_require__(3)\n\nfunction HashBase (blockSize) {\n  Transform.call(this)\n\n  this._block = new Buffer(blockSize)\n  this._blockSize = blockSize\n  this._blockOffset = 0\n  this._length = [0, 0, 0, 0]\n\n  this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n  var error = null\n  try {\n    if (encoding !== 'buffer') chunk = new Buffer(chunk, encoding)\n    this.update(chunk)\n  } catch (err) {\n    error = err\n  }\n\n  callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n  var error = null\n  try {\n    this.push(this._digest())\n  } catch (err) {\n    error = err\n  }\n\n  callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n  if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')\n  if (this._finalized) throw new Error('Digest already called')\n  if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || 'binary')\n\n  // consume data\n  var block = this._block\n  var offset = 0\n  while (this._blockOffset + data.length - offset >= this._blockSize) {\n    for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n    this._update()\n    this._blockOffset = 0\n  }\n  while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n  // update length\n  for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n    this._length[j] += carry\n    carry = (this._length[j] / 0x0100000000) | 0\n    if (carry > 0) this._length[j] -= 0x0100000000 * carry\n  }\n\n  return this\n}\n\nHashBase.prototype._update = function (data) {\n  throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n  if (this._finalized) throw new Error('Digest already called')\n  this._finalized = true\n\n  var digest = this._digest()\n  if (encoding !== undefined) digest = digest.toString(encoding)\n  return digest\n}\n\nHashBase.prototype._digest = function () {\n  throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash-base/index.js\n// module id = 871\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash-base/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar assert = __webpack_require__(43);\n\nfunction Hmac(hash, key, enc) {\n  if (!(this instanceof Hmac))\n    return new Hmac(hash, key, enc);\n  this.Hash = hash;\n  this.blockSize = hash.blockSize / 8;\n  this.outSize = hash.outSize / 8;\n  this.inner = null;\n  this.outer = null;\n\n  this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n  // Shorten key, if needed\n  if (key.length > this.blockSize)\n    key = new this.Hash().update(key).digest();\n  assert(key.length <= this.blockSize);\n\n  // Add padding to key\n  for (var i = key.length; i < this.blockSize; i++)\n    key.push(0);\n\n  for (i = 0; i < key.length; i++)\n    key[i] ^= 0x36;\n  this.inner = new this.Hash().update(key);\n\n  // 0x36 ^ 0x5c = 0x6a\n  for (i = 0; i < key.length; i++)\n    key[i] ^= 0x6a;\n  this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n  this.inner.update(msg, enc);\n  return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n  this.outer.update(this.inner.digest());\n  return this.outer.digest(enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/hmac.js\n// module id = 872\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/hmac.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar common = __webpack_require__(143);\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = common.BlockHash;\n\nfunction RIPEMD160() {\n  if (!(this instanceof RIPEMD160))\n    return new RIPEMD160();\n\n  BlockHash.call(this);\n\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n  this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n  var A = this.h[0];\n  var B = this.h[1];\n  var C = this.h[2];\n  var D = this.h[3];\n  var E = this.h[4];\n  var Ah = A;\n  var Bh = B;\n  var Ch = C;\n  var Dh = D;\n  var Eh = E;\n  for (var j = 0; j < 80; j++) {\n    var T = sum32(\n      rotl32(\n        sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n        s[j]),\n      E);\n    A = E;\n    E = D;\n    D = rotl32(C, 10);\n    C = B;\n    B = T;\n    T = sum32(\n      rotl32(\n        sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n        sh[j]),\n      Eh);\n    Ah = Eh;\n    Eh = Dh;\n    Dh = rotl32(Ch, 10);\n    Ch = Bh;\n    Bh = T;\n  }\n  T = sum32_3(this.h[1], C, Dh);\n  this.h[1] = sum32_3(this.h[2], D, Eh);\n  this.h[2] = sum32_3(this.h[3], E, Ah);\n  this.h[3] = sum32_3(this.h[4], A, Bh);\n  this.h[4] = sum32_3(this.h[0], B, Ch);\n  this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'little');\n  else\n    return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n  if (j <= 15)\n    return x ^ y ^ z;\n  else if (j <= 31)\n    return (x & y) | ((~x) & z);\n  else if (j <= 47)\n    return (x | (~y)) ^ z;\n  else if (j <= 63)\n    return (x & z) | (y & (~z));\n  else\n    return x ^ (y | (~z));\n}\n\nfunction K(j) {\n  if (j <= 15)\n    return 0x00000000;\n  else if (j <= 31)\n    return 0x5a827999;\n  else if (j <= 47)\n    return 0x6ed9eba1;\n  else if (j <= 63)\n    return 0x8f1bbcdc;\n  else\n    return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n  if (j <= 15)\n    return 0x50a28be6;\n  else if (j <= 31)\n    return 0x5c4dd124;\n  else if (j <= 47)\n    return 0x6d703ef3;\n  else if (j <= 63)\n    return 0x7a6d76e9;\n  else\n    return 0x00000000;\n}\n\nvar r = [\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n  3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n  1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n  4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n  5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n  6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n  15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n  8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n  12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n  11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n  7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n  11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n  11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n  9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n  8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n  9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n  9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n  15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n  8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/ripemd.js\n// module id = 873\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/ripemd.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.sha1 = __webpack_require__(875);\nexports.sha224 = __webpack_require__(876);\nexports.sha256 = __webpack_require__(185);\nexports.sha384 = __webpack_require__(877);\nexports.sha512 = __webpack_require__(410);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha.js\n// module id = 874\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar common = __webpack_require__(143);\nvar shaCommon = __webpack_require__(411);\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_5 = utils.sum32_5;\nvar ft_1 = shaCommon.ft_1;\nvar BlockHash = common.BlockHash;\n\nvar sha1_K = [\n  0x5A827999, 0x6ED9EBA1,\n  0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA1() {\n  if (!(this instanceof SHA1))\n    return new SHA1();\n\n  BlockHash.call(this);\n  this.h = [\n    0x67452301, 0xefcdab89, 0x98badcfe,\n    0x10325476, 0xc3d2e1f0 ];\n  this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nmodule.exports = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n\n  for(; i < W.length; i++)\n    W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n\n  for (i = 0; i < W.length; i++) {\n    var s = ~~(i / 20);\n    var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n    e = d;\n    d = c;\n    c = rotl32(b, 30);\n    b = a;\n    a = t;\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/1.js\n// module id = 875\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/1.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\nvar SHA256 = __webpack_require__(185);\n\nfunction SHA224() {\n  if (!(this instanceof SHA224))\n    return new SHA224();\n\n  SHA256.call(this);\n  this.h = [\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n    0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nmodule.exports = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n  // Just truncate output\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 7), 'big');\n  else\n    return utils.split32(this.h.slice(0, 7), 'big');\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/224.js\n// module id = 876\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/224.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = __webpack_require__(62);\n\nvar SHA512 = __webpack_require__(410);\n\nfunction SHA384() {\n  if (!(this instanceof SHA384))\n    return new SHA384();\n\n  SHA512.call(this);\n  this.h = [\n    0xcbbb9d5d, 0xc1059ed8,\n    0x629a292a, 0x367cd507,\n    0x9159015a, 0x3070dd17,\n    0x152fecd8, 0xf70e5939,\n    0x67332667, 0xffc00b31,\n    0x8eb44a87, 0x68581511,\n    0xdb0c2e0d, 0x64f98fa7,\n    0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nmodule.exports = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 12), 'big');\n  else\n    return utils.split32(this.h.slice(0, 12), 'big');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hash.js/lib/hash/sha/384.js\n// module id = 877\n// module chunks = 0\n\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/384.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar hash = __webpack_require__(263);\nvar utils = __webpack_require__(470);\nvar assert = __webpack_require__(43);\n\nfunction HmacDRBG(options) {\n  if (!(this instanceof HmacDRBG))\n    return new HmacDRBG(options);\n  this.hash = options.hash;\n  this.predResist = !!options.predResist;\n\n  this.outLen = this.hash.outSize;\n  this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n  this._reseed = null;\n  this.reseedInterval = null;\n  this.K = null;\n  this.V = null;\n\n  var entropy = utils.toArray(options.entropy, options.entropyEnc || 'hex');\n  var nonce = utils.toArray(options.nonce, options.nonceEnc || 'hex');\n  var pers = utils.toArray(options.pers, options.persEnc || 'hex');\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n  this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n  var seed = entropy.concat(nonce).concat(pers);\n\n  this.K = new Array(this.outLen / 8);\n  this.V = new Array(this.outLen / 8);\n  for (var i = 0; i < this.V.length; i++) {\n    this.K[i] = 0x00;\n    this.V[i] = 0x01;\n  }\n\n  this._update(seed);\n  this._reseed = 1;\n  this.reseedInterval = 0x1000000000000;  // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n  return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n  var kmac = this._hmac()\n                 .update(this.V)\n                 .update([ 0x00 ]);\n  if (seed)\n    kmac = kmac.update(seed);\n  this.K = kmac.digest();\n  this.V = this._hmac().update(this.V).digest();\n  if (!seed)\n    return;\n\n  this.K = this._hmac()\n               .update(this.V)\n               .update([ 0x01 ])\n               .update(seed)\n               .digest();\n  this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n  // Optional entropy enc\n  if (typeof entropyEnc !== 'string') {\n    addEnc = add;\n    add = entropyEnc;\n    entropyEnc = null;\n  }\n\n  entropy = utils.toArray(entropy, entropyEnc);\n  add = utils.toArray(add, addEnc);\n\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n  this._update(entropy.concat(add || []));\n  this._reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n  if (this._reseed > this.reseedInterval)\n    throw new Error('Reseed is required');\n\n  // Optional encoding\n  if (typeof enc !== 'string') {\n    addEnc = add;\n    add = enc;\n    enc = null;\n  }\n\n  // Optional additional data\n  if (add) {\n    add = utils.toArray(add, addEnc || 'hex');\n    this._update(add);\n  }\n\n  var temp = [];\n  while (temp.length < len) {\n    this.V = this._hmac().update(this.V).digest();\n    temp = temp.concat(this.V);\n  }\n\n  var res = temp.slice(0, len);\n  this._update(add);\n  this._reseed++;\n  return utils.encode(res, enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hmac-drbg/lib/hmac-drbg.js\n// module id = 878\n// module chunks = 0\n\n//# sourceURL=../node_modules/hmac-drbg/lib/hmac-drbg.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst cloneDeep = __webpack_require__(453)\nconst debug = __webpack_require__(5)('hyperdiff')\nconst pullAt = __webpack_require__(1044)\n\nconst isPresent = (itemIndex) => itemIndex !== -1\n\nfunction GET_INITIAL_STATE () {\n  return { common: [], removed: [] }\n}\n\nfunction hasItemWithProps (collection, item, props) {\n  return props.every(prop => item[prop] === collection[prop])\n}\n\nfunction indexOf (collection, item) {\n  return collection.indexOf(item)\n}\n\nfunction findIndexWithProps (collection, item, props) {\n  return collection.findIndex(function (origItem) {\n    return hasItemWithProps(origItem, item, props)\n  })\n}\n\nfunction determinateCollections (orig, dist) {\n  return {first: orig, second: cloneDeep(dist)}\n}\n\nfunction determinateFindIndex (ids, props) {\n  return props ? findIndexWithProps : indexOf\n}\n\nfunction hyperdiff (orig, dist, props) {\n  const ids = props ? [].concat(props) : []\n  const {first, second} = determinateCollections(orig, dist)\n  const findIndex = determinateFindIndex(ids, props)\n\n  debug('preconditions first=%j second=%j findIndex=%s', first, second, findIndex.name)\n\n  const results = first.reduce(function (acc, item, index) {\n    const itemIndex = findIndex(second, item, ids)\n    const destination = isPresent(itemIndex) ? 'common' : 'removed'\n    acc[destination].push(item)\n    pullAt(second, itemIndex)\n    debug('index=%s value=%s collection=%s', index, item, destination)\n    return acc\n  }, GET_INITIAL_STATE())\n\n  results.added = second\n  debug('added=%j removed=%j common%j', results.added, results.removed, results.common)\n  return results\n}\n\nmodule.exports = hyperdiff\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/hyperdiff/lib/index.js\n// module id = 879\n// module chunks = 0\n\n//# sourceURL=../node_modules/hyperdiff/lib/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/**\n * Copyright (c) 2016 Tim Kuijsten\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n\n\nvar stream = __webpack_require__(46)\n\nvar xtend = __webpack_require__(73)\n\n/**\n * Iterate over an IndexedDB object store with a readable stream.\n *\n * @param {IDBDatabase} db - IndexedDB instance\n * @param {String} storeName - name of the object store to iterate over\n * @param {Object} [opts]\n *\n * Options:\n * @param {IDBKeyRange} opts.range - a valid IndexedDB key range\n * @param {IDBCursorDirection} opts.direction - one of \"next\", \"nextunique\",\n *   \"prev\", \"prevunique\"\n * @param {Boolean} opts.snapshot=false - Iterate over a snapshot of the database\n *   by opening only one cursor. This disables any form of back pressure to prevent\n *   cursor timeout issues.\n */\nfunction idbReadableStream(db, storeName, opts) {\n  if (typeof db !== 'object') throw new TypeError('db must be an object')\n  if (typeof storeName !== 'string') throw new TypeError('storeName must be a string')\n  if (opts == null) opts = {}\n  if (typeof opts !== 'object') throw new TypeError('opts must be an object')\n\n  // use transform stream for buffering and back pressure\n  var transformer = new stream.Transform(xtend(opts, {\n    objectMode: true,\n    transform: function(obj, enc, cb) {\n      cb(null, obj)\n    }\n  }))\n\n  opts = xtend({\n    snapshot: false\n  }, opts)\n\n  var lastIteratedKey = null\n  transformer._cursorsOpened = 0\n\n  function startCursor() {\n    var lower, upper, lowerOpen, upperOpen\n\n    var direction = opts.direction || 'next'\n    var range = opts.range || {}\n\n    lower = range.lower\n    upper = range.upper\n    lowerOpen = !!range.lowerOpen\n    upperOpen = !!range.upperOpen\n\n    // if this is not the first iteration, use lastIteratedKey\n    if (lastIteratedKey) {\n      if (direction === 'next') {\n        lowerOpen = true // exclude the last iterated key itself\n        lower = lastIteratedKey\n      } else {\n        upperOpen = true // exclude the last iterated key itself\n        upper = lastIteratedKey\n      }\n    }\n\n    var keyRange\n    if (lower && upper)\n      keyRange = IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n    else if (lower)\n      keyRange = IDBKeyRange.lowerBound(lower, lowerOpen)\n    else if (upper)\n      keyRange = IDBKeyRange.upperBound(upper, upperOpen)\n\n    var tx = db.transaction(storeName, 'readonly')\n    var store = tx.objectStore(storeName)\n\n    transformer._cursorsOpened++\n    var req = store.openCursor(keyRange, opts.direction)\n\n    function proceed(cursor) {\n      try {\n        cursor.continue() // throws a TransactionInactiveError if the cursor timed out\n      } catch(err) {\n        // either reopen a cursor or propagate the error\n        if (err.name === 'TransactionInactiveError' && !opts.snapshot)\n          startCursor() // IndexedDB timed out the cursor\n        else\n          transformer.emit('error', err)\n      }\n    }\n\n    req.onsuccess = function() {\n      var cursor = req.result\n      if (cursor) {\n        lastIteratedKey = cursor.key\n\n        var go = transformer.write({ key: cursor.key, value: cursor.value })\n        if (opts.snapshot || go)\n          proceed(cursor)\n        else\n          transformer.once('drain', function() {\n            proceed(cursor)\n          })\n      } else\n        transformer.end()\n    }\n\n    tx.onabort = function() {\n      transformer.emit('error', tx.error)\n    }\n    tx.onerror = function() {\n      transformer.emit('error', tx.error)\n    }\n  }\n\n  startCursor()\n\n  return transformer\n}\n\nmodule.exports = idbReadableStream\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/idb-readable-stream/index.js\n// module id = 880\n// module chunks = 0\n\n//# sourceURL=../node_modules/idb-readable-stream/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst defer = __webpack_require__(512)\n\nmodule.exports = class Connection {\n  constructor (conn, info) {\n    this.peerInfo = null\n    this.conn = defer()\n\n    if (conn) {\n      this.setInnerConn(conn, info)\n    } else if (info) {\n      this.info = info\n    }\n  }\n\n  get source () {\n    return this.conn.source\n  }\n\n  get sink () {\n    return this.conn.sink\n  }\n\n  getPeerInfo (callback) {\n    if (this.info && this.info.getPeerInfo) {\n      return this.info.getPeerInfo(callback)\n    }\n\n    if (!this.peerInfo) {\n      return callback(new Error('Peer Info not set yet'))\n    }\n\n    callback(null, this.peerInfo)\n  }\n\n  setPeerInfo (peerInfo) {\n    if (this.info && this.info.setPeerInfo) {\n      return this.info.setPeerInfo(peerInfo)\n    }\n\n    this.peerInfo = peerInfo\n  }\n\n  getObservedAddrs (callback) {\n    if (this.info && this.info.getObservedAddrs) {\n      return this.info.getObservedAddrs(callback)\n    }\n    callback(null, [])\n  }\n\n  setInnerConn (conn, info) {\n    this.conn.resolve(conn)\n    if (info) {\n      this.info = info\n    } else {\n      this.info = conn\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-connection/src/connection.js\n// module id = 881\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-connection/src/connection.js")},function(module,exports,__webpack_require__){"use strict";eval("/* @flow */\n\n\n/* :: import type {Batch, Query, QueryResult, Callback} from './' */\n\nconst pull = __webpack_require__(6)\nconst setImmediate = __webpack_require__(8)\n\nconst asyncFilter = __webpack_require__(265).asyncFilter\nconst asyncSort = __webpack_require__(265).asyncSort\nconst Key = __webpack_require__(413)\n\nclass MemoryDatastore {\n  /* :: data: {[key: string]: Buffer} */\n\n  constructor () {\n    this.data = {}\n  }\n\n  open (callback /* : Callback<void> */) /* : void */ {\n    setImmediate(callback)\n  }\n\n  put (key /* : Key */, val /* : Buffer */, callback /* : Callback<void> */) /* : void */ {\n    this.data[key.toString()] = val\n\n    setImmediate(callback)\n  }\n\n  get (key /* : Key */, callback /* : Callback<Buffer> */) /* : void */ {\n    this.has(key, (err, exists) => {\n      if (err) {\n        return callback(err)\n      }\n\n      if (!exists) {\n        return callback(new Error('No value'))\n      }\n\n      callback(null, this.data[key.toString()])\n    })\n  }\n\n  has (key /* : Key */, callback /* : Callback<bool> */) /* : void */ {\n    setImmediate(() => {\n      callback(null, this.data[key.toString()] !== undefined)\n    })\n  }\n\n  delete (key /* : Key */, callback /* : Callback<void> */) /* : void */ {\n    delete this.data[key.toString()]\n\n    setImmediate(() => {\n      callback()\n    })\n  }\n\n  batch () /* : Batch<Buffer> */ {\n    let puts = []\n    let dels = []\n\n    return {\n      put (key /* : Key */, value /* : Buffer */) /* : void */ {\n        puts.push([key, value])\n      },\n      delete (key /* : Key */) /* : void */ {\n        dels.push(key)\n      },\n      commit: (callback /* : Callback<void> */) /* : void */ => {\n        puts.forEach(v => {\n          this.data[v[0].toString()] = v[1]\n        })\n\n        puts = []\n        dels.forEach(key => {\n          delete this.data[key.toString()]\n        })\n        dels = []\n\n        setImmediate(callback)\n      }\n    }\n  }\n\n  query (q /* : Query<Buffer> */) /* : QueryResult<Buffer> */ {\n    let tasks = [pull.keys(this.data), pull.map(k => ({\n      key: new Key(k),\n      value: this.data[k]\n    }))]\n\n    let filters = []\n\n    if (q.prefix != null) {\n      const prefix = q.prefix\n      filters.push((e, cb) => cb(null, e.key.toString().startsWith(prefix)))\n    }\n\n    if (q.filters != null) {\n      filters = filters.concat(q.filters)\n    }\n\n    tasks = tasks.concat(filters.map(f => asyncFilter(f)))\n\n    if (q.orders != null) {\n      tasks = tasks.concat(q.orders.map(o => asyncSort(o)))\n    }\n\n    if (q.offset != null) {\n      let i = 0\n      // $FlowFixMe\n      tasks.push(pull.filter(() => i++ >= q.offset))\n    }\n\n    if (q.limit != null) {\n      tasks.push(pull.take(q.limit))\n    }\n\n    if (q.keysOnly === true) {\n      tasks.push(pull.map(e => ({ key: e.key })))\n    }\n\n    return pull.apply(null, tasks)\n  }\n\n  close (callback /* : Callback<void> */) /* : void */ {\n    setImmediate(callback)\n  }\n}\n\nmodule.exports = MemoryDatastore\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/interface-datastore/src/memory.js\n// module id = 882\n// module chunks = 0\n\n//# sourceURL=../node_modules/interface-datastore/src/memory.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar ip = exports;\nvar Buffer = __webpack_require__(0).Buffer;\nvar os = __webpack_require__(296);\n\nip.toBuffer = function(ip, buff, offset) {\n  offset = ~~offset;\n\n  var result;\n\n  if (this.isV4Format(ip)) {\n    result = buff || new Buffer(offset + 4);\n    ip.split(/\\./g).map(function(byte) {\n      result[offset++] = parseInt(byte, 10) & 0xff;\n    });\n  } else if (this.isV6Format(ip)) {\n    var sections = ip.split(':', 8);\n\n    var i;\n    for (i = 0; i < sections.length; i++) {\n      var isv4 = this.isV4Format(sections[i]);\n      var v4Buffer;\n\n      if (isv4) {\n        v4Buffer = this.toBuffer(sections[i]);\n        sections[i] = v4Buffer.slice(0, 2).toString('hex');\n      }\n\n      if (v4Buffer && ++i < 8) {\n        sections.splice(i, 0, v4Buffer.slice(2, 4).toString('hex'));\n      }\n    }\n\n    if (sections[0] === '') {\n      while (sections.length < 8) sections.unshift('0');\n    } else if (sections[sections.length - 1] === '') {\n      while (sections.length < 8) sections.push('0');\n    } else if (sections.length < 8) {\n      for (i = 0; i < sections.length && sections[i] !== ''; i++);\n      var argv = [ i, 1 ];\n      for (i = 9 - sections.length; i > 0; i--) {\n        argv.push('0');\n      }\n      sections.splice.apply(sections, argv);\n    }\n\n    result = buff || new Buffer(offset + 16);\n    for (i = 0; i < sections.length; i++) {\n      var word = parseInt(sections[i], 16);\n      result[offset++] = (word >> 8) & 0xff;\n      result[offset++] = word & 0xff;\n    }\n  }\n\n  if (!result) {\n    throw Error('Invalid ip address: ' + ip);\n  }\n\n  return result;\n};\n\nip.toString = function(buff, offset, length) {\n  offset = ~~offset;\n  length = length || (buff.length - offset);\n\n  var result = [];\n  if (length === 4) {\n    // IPv4\n    for (var i = 0; i < length; i++) {\n      result.push(buff[offset + i]);\n    }\n    result = result.join('.');\n  } else if (length === 16) {\n    // IPv6\n    for (var i = 0; i < length; i += 2) {\n      result.push(buff.readUInt16BE(offset + i).toString(16));\n    }\n    result = result.join(':');\n    result = result.replace(/(^|:)0(:0)*:0(:|$)/, '$1::$3');\n    result = result.replace(/:{3,4}/, '::');\n  }\n\n  return result;\n};\n\nvar ipv4Regex = /^(\\d{1,3}\\.){3,3}\\d{1,3}$/;\nvar ipv6Regex =\n    /^(::)?(((\\d{1,3}\\.){3}(\\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i;\n\nip.isV4Format = function(ip) {\n  return ipv4Regex.test(ip);\n};\n\nip.isV6Format = function(ip) {\n  return ipv6Regex.test(ip);\n};\nfunction _normalizeFamily(family) {\n  return family ? family.toLowerCase() : 'ipv4';\n}\n\nip.fromPrefixLen = function(prefixlen, family) {\n  if (prefixlen > 32) {\n    family = 'ipv6';\n  } else {\n    family = _normalizeFamily(family);\n  }\n\n  var len = 4;\n  if (family === 'ipv6') {\n    len = 16;\n  }\n  var buff = new Buffer(len);\n\n  for (var i = 0, n = buff.length; i < n; ++i) {\n    var bits = 8;\n    if (prefixlen < 8) {\n      bits = prefixlen;\n    }\n    prefixlen -= bits;\n\n    buff[i] = ~(0xff >> bits) & 0xff;\n  }\n\n  return ip.toString(buff);\n};\n\nip.mask = function(addr, mask) {\n  addr = ip.toBuffer(addr);\n  mask = ip.toBuffer(mask);\n\n  var result = new Buffer(Math.max(addr.length, mask.length));\n\n  var i = 0;\n  // Same protocol - do bitwise and\n  if (addr.length === mask.length) {\n    for (i = 0; i < addr.length; i++) {\n      result[i] = addr[i] & mask[i];\n    }\n  } else if (mask.length === 4) {\n    // IPv6 address and IPv4 mask\n    // (Mask low bits)\n    for (i = 0; i < mask.length; i++) {\n      result[i] = addr[addr.length - 4  + i] & mask[i];\n    }\n  } else {\n    // IPv6 mask and IPv4 addr\n    for (var i = 0; i < result.length - 6; i++) {\n      result[i] = 0;\n    }\n\n    // ::ffff:ipv4\n    result[10] = 0xff;\n    result[11] = 0xff;\n    for (i = 0; i < addr.length; i++) {\n      result[i + 12] = addr[i] & mask[i + 12];\n    }\n    i = i + 12;\n  }\n  for (; i < result.length; i++)\n    result[i] = 0;\n\n  return ip.toString(result);\n};\n\nip.cidr = function(cidrString) {\n  var cidrParts = cidrString.split('/');\n\n  var addr = cidrParts[0];\n  if (cidrParts.length !== 2)\n    throw new Error('invalid CIDR subnet: ' + addr);\n\n  var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));\n\n  return ip.mask(addr, mask);\n};\n\nip.subnet = function(addr, mask) {\n  var networkAddress = ip.toLong(ip.mask(addr, mask));\n\n  // Calculate the mask's length.\n  var maskBuffer = ip.toBuffer(mask);\n  var maskLength = 0;\n\n  for (var i = 0; i < maskBuffer.length; i++) {\n    if (maskBuffer[i] === 0xff) {\n      maskLength += 8;\n    } else {\n      var octet = maskBuffer[i] & 0xff;\n      while (octet) {\n        octet = (octet << 1) & 0xff;\n        maskLength++;\n      }\n    }\n  }\n\n  var numberOfAddresses = Math.pow(2, 32 - maskLength);\n\n  return {\n    networkAddress: ip.fromLong(networkAddress),\n    firstAddress: numberOfAddresses <= 2 ?\n                    ip.fromLong(networkAddress) :\n                    ip.fromLong(networkAddress + 1),\n    lastAddress: numberOfAddresses <= 2 ?\n                    ip.fromLong(networkAddress + numberOfAddresses - 1) :\n                    ip.fromLong(networkAddress + numberOfAddresses - 2),\n    broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1),\n    subnetMask: mask,\n    subnetMaskLength: maskLength,\n    numHosts: numberOfAddresses <= 2 ?\n                numberOfAddresses : numberOfAddresses - 2,\n    length: numberOfAddresses,\n    contains: function(other) {\n      return networkAddress === ip.toLong(ip.mask(other, mask));\n    }\n  };\n};\n\nip.cidrSubnet = function(cidrString) {\n  var cidrParts = cidrString.split('/');\n\n  var addr = cidrParts[0];\n  if (cidrParts.length !== 2)\n    throw new Error('invalid CIDR subnet: ' + addr);\n\n  var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10));\n\n  return ip.subnet(addr, mask);\n};\n\nip.not = function(addr) {\n  var buff = ip.toBuffer(addr);\n  for (var i = 0; i < buff.length; i++) {\n    buff[i] = 0xff ^ buff[i];\n  }\n  return ip.toString(buff);\n};\n\nip.or = function(a, b) {\n  a = ip.toBuffer(a);\n  b = ip.toBuffer(b);\n\n  // same protocol\n  if (a.length === b.length) {\n    for (var i = 0; i < a.length; ++i) {\n      a[i] |= b[i];\n    }\n    return ip.toString(a);\n\n  // mixed protocols\n  } else {\n    var buff = a;\n    var other = b;\n    if (b.length > a.length) {\n      buff = b;\n      other = a;\n    }\n\n    var offset = buff.length - other.length;\n    for (var i = offset; i < buff.length; ++i) {\n      buff[i] |= other[i - offset];\n    }\n\n    return ip.toString(buff);\n  }\n};\n\nip.isEqual = function(a, b) {\n  a = ip.toBuffer(a);\n  b = ip.toBuffer(b);\n\n  // Same protocol\n  if (a.length === b.length) {\n    for (var i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) return false;\n    }\n    return true;\n  }\n\n  // Swap\n  if (b.length === 4) {\n    var t = b;\n    b = a;\n    a = t;\n  }\n\n  // a - IPv4, b - IPv6\n  for (var i = 0; i < 10; i++) {\n    if (b[i] !== 0) return false;\n  }\n\n  var word = b.readUInt16BE(10);\n  if (word !== 0 && word !== 0xffff) return false;\n\n  for (var i = 0; i < 4; i++) {\n    if (a[i] !== b[i + 12]) return false;\n  }\n\n  return true;\n};\n\nip.isPrivate = function(addr) {\n  return /^(::f{4}:)?10\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/i\n      .test(addr) ||\n    /^(::f{4}:)?192\\.168\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n    /^(::f{4}:)?172\\.(1[6-9]|2\\d|30|31)\\.([0-9]{1,3})\\.([0-9]{1,3})$/i\n      .test(addr) ||\n    /^(::f{4}:)?127\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n    /^(::f{4}:)?169\\.254\\.([0-9]{1,3})\\.([0-9]{1,3})$/i.test(addr) ||\n    /^f[cd][0-9a-f]{2}:/i.test(addr) ||\n    /^fe80:/i.test(addr) ||\n    /^::1$/.test(addr) ||\n    /^::$/.test(addr);\n};\n\nip.isPublic = function(addr) {\n  return !ip.isPrivate(addr);\n};\n\nip.isLoopback = function(addr) {\n  return /^(::f{4}:)?127\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})/\n      .test(addr) ||\n    /^fe80::1$/.test(addr) ||\n    /^::1$/.test(addr) ||\n    /^::$/.test(addr);\n};\n\nip.loopback = function(family) {\n  //\n  // Default to `ipv4`\n  //\n  family = _normalizeFamily(family);\n\n  if (family !== 'ipv4' && family !== 'ipv6') {\n    throw new Error('family must be ipv4 or ipv6');\n  }\n\n  return family === 'ipv4' ? '127.0.0.1' : 'fe80::1';\n};\n\n//\n// ### function address (name, family)\n// #### @name {string|'public'|'private'} **Optional** Name or security\n//      of the network interface.\n// #### @family {ipv4|ipv6} **Optional** IP family of the address (defaults\n//      to ipv4).\n//\n// Returns the address for the network interface on the current system with\n// the specified `name`:\n//   * String: First `family` address of the interface.\n//             If not found see `undefined`.\n//   * 'public': the first public ip address of family.\n//   * 'private': the first private ip address of family.\n//   * undefined: First address with `ipv4` or loopback address `127.0.0.1`.\n//\nip.address = function(name, family) {\n  var interfaces = os.networkInterfaces();\n  var all;\n\n  //\n  // Default to `ipv4`\n  //\n  family = _normalizeFamily(family);\n\n  //\n  // If a specific network interface has been named,\n  // return the address.\n  //\n  if (name && name !== 'private' && name !== 'public') {\n    var res = interfaces[name].filter(function(details) {\n      var itemFamily = details.family.toLowerCase();\n      return itemFamily === family;\n    });\n    if (res.length === 0)\n      return undefined;\n    return res[0].address;\n  }\n\n  var all = Object.keys(interfaces).map(function (nic) {\n    //\n    // Note: name will only be `public` or `private`\n    // when this is called.\n    //\n    var addresses = interfaces[nic].filter(function (details) {\n      details.family = details.family.toLowerCase();\n      if (details.family !== family || ip.isLoopback(details.address)) {\n        return false;\n      } else if (!name) {\n        return true;\n      }\n\n      return name === 'public' ? ip.isPrivate(details.address) :\n          ip.isPublic(details.address);\n    });\n\n    return addresses.length ? addresses[0].address : undefined;\n  }).filter(Boolean);\n\n  return !all.length ? ip.loopback(family) : all[0];\n};\n\nip.toLong = function(ip) {\n  var ipl = 0;\n  ip.split('.').forEach(function(octet) {\n    ipl <<= 8;\n    ipl += parseInt(octet);\n  });\n  return(ipl >>> 0);\n};\n\nip.fromLong = function(ipl) {\n  return ((ipl >>> 24) + '.' +\n      (ipl >> 16 & 255) + '.' +\n      (ipl >> 8 & 255) + '.' +\n      (ipl & 255) );\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ip/lib/ip.js\n// module id = 883\n// module chunks = 0\n\n//# sourceURL=../node_modules/ip/lib/ip.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst each = __webpack_require__(41)\nconst eachSeries = __webpack_require__(162)\nconst waterfall = __webpack_require__(12)\nconst setImmediate = __webpack_require__(8)\n\nconst map = __webpack_require__(128)\nconst debounce = __webpack_require__(454)\nconst uniqWith = __webpack_require__(1049)\nconst find = __webpack_require__(1039)\nconst values = __webpack_require__(281)\nconst groupBy = __webpack_require__(1040)\nconst pullAllWith = __webpack_require__(1043)\n\nconst Message = __webpack_require__(186)\nconst Wantlist = __webpack_require__(187)\nconst Ledger = __webpack_require__(885)\nconst logger = __webpack_require__(120).logger\n\nconst MAX_MESSAGE_SIZE = 512 * 1024\n\nclass DecisionEngine {\n  constructor (peerId, blockstore, network, stats) {\n    this._log = logger(peerId, 'engine')\n    this.blockstore = blockstore\n    this.network = network\n    this._stats = stats\n\n    // A list of of ledgers by their partner id\n    this.ledgerMap = new Map()\n    this._running = false\n\n    // List of tasks to be processed\n    this._tasks = []\n\n    this._outbox = debounce(this._processTasks.bind(this), 100)\n  }\n\n  _sendBlocks (peer, blocks, cb) {\n    // split into messges of max 512 * 1024 bytes\n    const total = blocks.reduce((acc, b) => {\n      return acc + b.data.byteLength\n    }, 0)\n\n    if (total < MAX_MESSAGE_SIZE) {\n      return this._sendSafeBlocks(peer, blocks, cb)\n    }\n\n    let size = 0\n    let batch = []\n    let outstanding = blocks.length\n\n    eachSeries(blocks, (b, cb) => {\n      outstanding--\n      batch.push(b)\n      size += b.data.byteLength\n\n      if (size >= MAX_MESSAGE_SIZE ||\n          // need to ensure the last remaining items get sent\n          outstanding === 0) {\n        const nextBatch = batch.slice()\n        batch = []\n        this._sendSafeBlocks(peer, nextBatch, (err) => {\n          if (err) {\n            this._log('sendblock error: %s', err.message)\n          }\n          // not returning the error, so we send as much as we can\n          // as otherwise `eachSeries` would cancel\n          cb()\n        })\n      } else {\n        cb()\n      }\n    }, cb)\n  }\n\n  _sendSafeBlocks (peer, blocks, cb) {\n    const msg = new Message(false)\n    blocks.forEach((b) => msg.addBlock(b))\n\n    this.network.sendMessage(peer, msg, cb)\n  }\n\n  _processTasks () {\n    if (!this._running || !this._tasks.length) {\n      return\n    }\n\n    const tasks = this._tasks\n    this._tasks = []\n    const entries = tasks.map((t) => t.entry)\n    const cids = entries.map((e) => e.cid)\n    const uniqCids = uniqWith(cids, (a, b) => a.equals(b))\n    const groupedTasks = groupBy(tasks, (task) => task.target.toB58String())\n\n    waterfall([\n      (cb) => map(uniqCids, (cid, cb) => {\n        this.blockstore.get(cid, cb)\n      }, cb),\n      (blocks, cb) => each(values(groupedTasks), (tasks, cb) => {\n        // all tasks have the same target\n        const peer = tasks[0].target\n        const blockList = cids.map((cid) => {\n          return find(blocks, (b) => b.cid.equals(cid))\n        })\n\n        this._sendBlocks(peer, blockList, (err) => {\n          if (err) {\n            // `_sendBlocks` actually doesn't return any errors\n            this._log.error('should never happen: ', err)\n          } else {\n            blockList.forEach((block) => this.messageSent(peer, block))\n          }\n\n          cb()\n        })\n      })\n    ], (err) => {\n      this._tasks = []\n\n      if (err) {\n        this._log.error(err)\n      }\n    })\n  }\n\n  wantlistForPeer (peerId) {\n    const peerIdStr = peerId.toB58String()\n    if (!this.ledgerMap.has(peerIdStr)) {\n      return new Map()\n    }\n\n    return this.ledgerMap.get(peerIdStr).wantlist.sortedEntries()\n  }\n\n  peers () {\n    return Array.from(this.ledgerMap.values()).map((l) => l.partner)\n  }\n\n  receivedBlocks (cids) {\n    if (!cids.length) {\n      return\n    }\n    // Check all connected peers if they want the block we received\n    this.ledgerMap.forEach((ledger) => {\n      cids\n        .map((cid) => ledger.wantlistContains(cid))\n        .filter(Boolean)\n        .forEach((entry) => {\n          this._tasks.push({\n            entry: entry,\n            target: ledger.partner\n          })\n        })\n    })\n    this._outbox()\n  }\n\n  // Handle incoming messages\n  messageReceived (peerId, msg, cb) {\n    const ledger = this._findOrCreate(peerId)\n\n    if (msg.empty) {\n      return cb()\n    }\n\n    // If the message was a full wantlist clear the current one\n    if (msg.full) {\n      ledger.wantlist = new Wantlist()\n    }\n\n    this._processBlocks(msg.blocks, ledger)\n\n    if (msg.wantlist.size === 0) {\n      return cb()\n    }\n\n    let cancels = []\n    let wants = []\n    msg.wantlist.forEach((entry) => {\n      if (entry.cancel) {\n        ledger.cancelWant(entry.cid)\n        cancels.push(entry)\n      } else {\n        ledger.wants(entry.cid, entry.priority)\n        wants.push(entry)\n      }\n    })\n\n    this._cancelWants(ledger, peerId, cancels)\n    this._addWants(ledger, peerId, wants, cb)\n  }\n\n  _cancelWants (ledger, peerId, entries) {\n    const id = peerId.toB58String()\n\n    pullAllWith(this._tasks, entries, (t, e) => {\n      const sameTarget = t.target.toB58String() === id\n      const sameCid = t.entry.cid.equals(e.cid)\n      return sameTarget && sameCid\n    })\n  }\n\n  _addWants (ledger, peerId, entries, cb) {\n    each(entries, (entry, cb) => {\n      // If we already have the block, serve it\n      this.blockstore.has(entry.cid, (err, exists) => {\n        if (err) {\n          this._log.error('failed existence check')\n        } else if (exists) {\n          this._tasks.push({\n            entry: entry.entry,\n            target: peerId\n          })\n        }\n        cb()\n      })\n    }, () => {\n      this._outbox()\n      cb()\n    })\n  }\n\n  _processBlocks (blocks, ledger, callback) {\n    const cids = []\n    blocks.forEach((b, cidStr) => {\n      this._log('got block (%s bytes)', b.data.length)\n      ledger.receivedBytes(b.data.length)\n      cids.push(b.cid)\n    })\n\n    this.receivedBlocks(cids)\n  }\n\n  // Clear up all accounting things after message was sent\n  messageSent (peerId, block) {\n    const ledger = this._findOrCreate(peerId)\n    ledger.sentBytes(block ? block.data.length : 0)\n    if (block && block.cid) {\n      ledger.wantlist.remove(block.cid)\n    }\n  }\n\n  numBytesSentTo (peerId) {\n    return this._findOrCreate(peerId).accounting.bytesSent\n  }\n\n  numBytesReceivedFrom (peerId) {\n    return this._findOrCreate(peerId).accounting.bytesRecv\n  }\n\n  peerDisconnected (peerId) {\n    // if (this.ledgerMap.has(peerId.toB58String())) {\n    //   this.ledgerMap.delete(peerId.toB58String())\n    // }\n    //\n    // TODO: figure out how to remove all other references\n    // in the peer request queue\n  }\n\n  _findOrCreate (peerId) {\n    const peerIdStr = peerId.toB58String()\n    if (this.ledgerMap.has(peerIdStr)) {\n      return this.ledgerMap.get(peerIdStr)\n    }\n\n    const l = new Ledger(peerId)\n\n    this.ledgerMap.set(peerIdStr, l)\n    if (this._stats) {\n      this._stats.push(peerIdStr, 'peerCount', 1)\n    }\n\n    return l\n  }\n\n  start (callback) {\n    this._running = true\n    setImmediate(() => callback())\n  }\n\n  stop (callback) {\n    this._running = false\n    setImmediate(() => callback())\n  }\n}\n\nmodule.exports = DecisionEngine\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/decision-engine/index.js\n// module id = 884\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/decision-engine/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Wantlist = __webpack_require__(187)\n\nclass Ledger {\n  constructor (peerId) {\n    this.partner = peerId\n    this.wantlist = new Wantlist()\n\n    this.exchangeCount = 0\n    this.sentToPeer = new Map()\n\n    this.accounting = {\n      bytesSent: 0,\n      bytesRecv: 0\n    }\n  }\n\n  sentBytes (n) {\n    this.exchangeCount++\n    this.lastExchange = (new Date()).getTime()\n    this.accounting.bytesSent += n\n  }\n\n  receivedBytes (n) {\n    this.exchangeCount++\n    this.lastExchange = (new Date()).getTime()\n    this.accounting.bytesRecv += n\n  }\n\n  wants (cid, priority) {\n    this.wantlist.add(cid, priority)\n  }\n\n  cancelWant (cid) {\n    this.wantlist.remove(cid)\n  }\n\n  wantlistContains (cid) {\n    return this.wantlist.contains(cid)\n  }\n}\n\nmodule.exports = Ledger\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/decision-engine/ledger.js\n// module id = 885\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/decision-engine/ledger.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst waterfall = __webpack_require__(12)\nconst reject = __webpack_require__(333)\nconst each = __webpack_require__(41)\nconst series = __webpack_require__(51)\nconst map = __webpack_require__(128)\n\nconst WantManager = __webpack_require__(894)\nconst Network = __webpack_require__(887)\nconst DecisionEngine = __webpack_require__(884)\nconst Notifications = __webpack_require__(888)\nconst logger = __webpack_require__(120).logger\nconst Stats = __webpack_require__(889)\n\nconst defaultOptions = {\n  statsEnabled: false,\n  statsComputeThrottleTimeout: 1000,\n  statsComputeThrottleMaxQueueSize: 1000\n}\nconst statsKeys = [\n  'blocksReceived',\n  'dataReceived',\n  'dupBlksReceived',\n  'dupDataReceived',\n  'blocksSent',\n  'dataSent',\n  'providesBufferLength',\n  'wantListLength',\n  'peerCount'\n]\n\n/**\n * JavaScript implementation of the Bitswap 'data exchange' protocol\n * used by IPFS.\n *\n * @param {Libp2p} libp2p\n * @param {Blockstore} blockstore\n */\nclass Bitswap {\n  constructor (libp2p, blockstore, options) {\n    this._libp2p = libp2p\n    this._log = logger(this.peerInfo.id)\n\n    this._options = Object.assign({}, defaultOptions, options)\n\n    // stats\n    this._stats = new Stats(statsKeys, {\n      enabled: this._options.statsEnabled,\n      computeThrottleTimeout: this._options.statsComputeThrottleTimeout,\n      computeThrottleMaxQueueSize: this._options.statsComputeThrottleMaxQueueSize\n    })\n\n    // the network delivers messages\n    this.network = new Network(libp2p, this, {}, this._stats)\n\n    // local database\n    this.blockstore = blockstore\n\n    this.engine = new DecisionEngine(this.peerInfo.id, blockstore, this.network, this._stats)\n\n    // handle message sending\n    this.wm = new WantManager(this.peerInfo.id, this.network, this._stats)\n\n    this.notifications = new Notifications(this.peerInfo.id)\n  }\n\n  get peerInfo () {\n    return this._libp2p.peerInfo\n  }\n\n  // handle messages received through the network\n  _receiveMessage (peerId, incoming, callback) {\n    this.engine.messageReceived(peerId, incoming, (err) => {\n      if (err) {\n        // Only logging the issue to process as much as possible\n        // of the message. Currently `messageReceived` does not\n        // return any errors, but this could change in the future.\n        this._log('failed to receive message', incoming)\n      }\n\n      if (incoming.blocks.size === 0) {\n        return callback()\n      }\n\n      const blocks = Array.from(incoming.blocks.values())\n\n      // quickly send out cancels, reduces chances of duplicate block receives\n      const toCancel = blocks\n        .filter((b) => this.wm.wantlist.contains(b.cid))\n        .map((b) => b.cid)\n\n      this.wm.cancelWants(toCancel)\n\n      each(\n        blocks,\n        (b, cb) => this._handleReceivedBlock(peerId, b, cb),\n        callback\n      )\n    })\n  }\n\n  _handleReceivedBlock (peerId, block, callback) {\n    this._log('received block')\n\n    waterfall([\n      (cb) => this.blockstore.has(block.cid, cb),\n      (has, cb) => {\n        this._updateReceiveCounters(peerId.toB58String(), block, has)\n        if (has) {\n          return cb()\n        }\n\n        this._putBlock(block, cb)\n      }\n    ], callback)\n  }\n\n  _updateReceiveCounters (peerId, block, exists) {\n    this._stats.push(peerId, 'blocksReceived', 1)\n    this._stats.push(peerId, 'dataReceived', block.data.length)\n\n    if (exists) {\n      this._stats.push(peerId, 'dupBlksReceived', 1)\n      this._stats.push(peerId, 'dupDataReceived', block.data.length)\n    }\n  }\n\n  // handle errors on the receiving channel\n  _receiveError (err) {\n    this._log.error('ReceiveError: %s', err.message)\n  }\n\n  // handle new peers\n  _onPeerConnected (peerId) {\n    this.wm.connected(peerId)\n  }\n\n  // handle peers being disconnected\n  _onPeerDisconnected (peerId) {\n    this.wm.disconnected(peerId)\n    this.engine.peerDisconnected(peerId)\n    this._stats.disconnected(peerId)\n  }\n\n  _putBlock (block, callback) {\n    this.blockstore.put(block, (err) => {\n      if (err) {\n        return callback(err)\n      }\n\n      this.notifications.hasBlock(block)\n      this.network.provide(block.cid, (err) => {\n        if (err) {\n          this._log.error('Failed to provide: %s', err.message)\n        }\n      })\n\n      this.engine.receivedBlocks([block.cid])\n      callback()\n    })\n  }\n\n  enableStats () {\n    this._stats.enable()\n  }\n\n  disableStats () {\n    this._stats.disable()\n  }\n\n  /**\n   * Return the current wantlist for a given `peerId`\n   *\n   * @param {PeerId} peerId\n   * @returns {Wantlist}\n   */\n  wantlistForPeer (peerId) {\n    return this.engine.wantlistForPeer(peerId)\n  }\n\n  /**\n   * Fetch a given block by cid. If the block is in the local\n   * blockstore it is returned, otherwise the block is added to the wantlist and returned once another node sends it to us.\n   *\n   * @param {CID} cid\n   * @param {function(Error, Block)} callback\n   * @returns {void}\n   */\n  get (cid, callback) {\n    this.getMany([cid], (err, blocks) => {\n      if (err) {\n        return callback(err)\n      }\n\n      if (blocks && blocks.length > 0) {\n        callback(null, blocks[0])\n      } else {\n        // when a unwant happens\n        callback()\n      }\n    })\n  }\n\n  /**\n   * Fetch a a list of blocks by cid. If the blocks are in the local\n   * blockstore they are returned, otherwise the blocks are added to the wantlist and returned once another node sends them to us.\n   *\n   * @param {Array<CID>} cids\n   * @param {function(Error, Blocks)} callback\n   * @returns {void}\n   */\n  getMany (cids, callback) {\n    let pendingStart = cids.length\n    const wantList = []\n    let promptedNetwork = false\n\n    const getFromOutside = (cid, cb) => {\n      wantList.push(cid)\n\n      this.notifications.wantBlock(\n        cid,\n        // called on block receive\n        (block) => {\n          this.wm.cancelWants([cid])\n          cb(null, block)\n        },\n        // called on unwant\n        () => {\n          this.wm.cancelWants([cid])\n          cb(null, undefined)\n        }\n      )\n\n      if (!pendingStart) {\n        this.wm.wantBlocks(wantList)\n      }\n    }\n\n    map(cids, (cid, cb) => {\n      waterfall(\n        [\n          (cb) => this.blockstore.has(cid, cb),\n          (has, cb) => {\n            pendingStart--\n            if (has) {\n              if (!pendingStart) {\n                this.wm.wantBlocks(wantList)\n              }\n              return this.blockstore.get(cid, cb)\n            }\n\n            if (!promptedNetwork) {\n              promptedNetwork = true\n              this.network.findAndConnect(cids[0], (err) => {\n                if (err) {\n                  this._log.error(err)\n                }\n              })\n            }\n\n            // we don't have the block here\n            getFromOutside(cid, cb)\n          }\n        ],\n        cb)\n    }, callback)\n  }\n\n  // removes the given cids from the wantlist independent of any ref counts\n  unwant (cids) {\n    if (!Array.isArray(cids)) {\n      cids = [cids]\n    }\n\n    this.wm.unwantBlocks(cids)\n    cids.forEach((cid) => this.notifications.unwantBlock(cid))\n  }\n\n  // removes the given keys from the want list\n  cancelWants (cids) {\n    if (!Array.isArray(cids)) {\n      cids = [cids]\n    }\n    this.wm.cancelWants(cids)\n  }\n\n  /**\n   * Put the given block to the underlying blockstore and\n   * send it to nodes that have it in their wantlist.\n   *\n   * @param {Block} block\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  put (block, callback) {\n    this._log('putting block')\n\n    waterfall([\n      (cb) => this.blockstore.has(block.cid, cb),\n      (has, cb) => {\n        if (has) {\n          return cb()\n        }\n\n        this._putBlock(block, cb)\n      }\n    ], callback)\n  }\n\n  /**\n   * Put the given blocks to the underlying blockstore and\n   * send it to nodes that have it them their wantlist.\n   *\n   * @param {Array<Block>} blocks\n   * @param {function(Error)} callback\n   * @returns {void}\n   */\n  putMany (blocks, callback) {\n    waterfall([\n      (cb) => reject(blocks, (b, cb) => {\n        this.blockstore.has(b.cid, cb)\n      }, cb),\n      (newBlocks, cb) => this.blockstore.putMany(newBlocks, (err) => {\n        if (err) {\n          return cb(err)\n        }\n\n        newBlocks.forEach((block) => {\n          this.notifications.hasBlock(block)\n          this.engine.receivedBlocks([block.cid])\n          this.network.provide(block.cid, (err) => {\n            if (err) {\n              this._log.error('Failed to provide: %s', err.message)\n            }\n          })\n        })\n        cb()\n      })\n    ], callback)\n  }\n\n  /**\n   * Get the current list of wants.\n   *\n   * @returns {Iterator<WantlistEntry>}\n   */\n  getWantlist () {\n    return this.wm.wantlist.entries()\n  }\n\n  /**\n   * Get the current list of partners.\n   *\n   * @returns {Array<PeerId>}\n   */\n  peers () {\n    return this.engine.peers()\n  }\n\n  /**\n   * Get stats about the bitswap node.\n   *\n   * @returns {Object}\n   */\n  stat () {\n    return this._stats\n  }\n\n  /**\n   * Start the bitswap node.\n   *\n   * @param {function(Error)} callback\n   *\n   * @returns {void}\n   */\n  start (callback) {\n    series([\n      (cb) => this.wm.start(cb),\n      (cb) => this.network.start(cb),\n      (cb) => this.engine.start(cb)\n    ], callback)\n  }\n\n  /**\n   * Stop the bitswap node.\n   *\n   * @param {function(Error)} callback\n   *\n   * @returns {void}\n   */\n  stop (callback) {\n    this._stats.stop()\n    series([\n      (cb) => this.wm.stop(cb),\n      (cb) => this.network.stop(cb),\n      (cb) => this.engine.stop(cb)\n    ], callback)\n  }\n}\n\nmodule.exports = Bitswap\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/index.js\n// module id = 886\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst lp = __webpack_require__(45)\nconst pull = __webpack_require__(6)\nconst waterfall = __webpack_require__(12)\nconst each = __webpack_require__(41)\nconst setImmediate = __webpack_require__(8)\n\nconst Message = __webpack_require__(186)\nconst CONSTANTS = __webpack_require__(266)\nconst logger = __webpack_require__(120).logger\n\nconst BITSWAP100 = '/ipfs/bitswap/1.0.0'\nconst BITSWAP110 = '/ipfs/bitswap/1.1.0'\n\nclass Network {\n  constructor (libp2p, bitswap, options, stats) {\n    this._log = logger(libp2p.peerInfo.id, 'network')\n    options = options || {}\n    this.libp2p = libp2p\n    this.bitswap = bitswap\n    this.b100Only = options.b100Only || false\n\n    this._stats = stats\n    this._running = false\n  }\n\n  start (callback) {\n    this._running = true\n    // bind event listeners\n    this._onPeerConnect = this._onPeerConnect.bind(this)\n    this._onPeerDisconnect = this._onPeerDisconnect.bind(this)\n\n    this._onConnection = this._onConnection.bind(this)\n    this.libp2p.handle(BITSWAP100, this._onConnection)\n    if (!this.b100Only) { this.libp2p.handle(BITSWAP110, this._onConnection) }\n\n    this.libp2p.on('peer:connect', this._onPeerConnect)\n    this.libp2p.on('peer:disconnect', this._onPeerDisconnect)\n\n    // All existing connections are like new ones for us\n    this.libp2p.peerBook\n      .getAllArray()\n      .filter((peer) => peer.isConnected())\n      .forEach((peer) => this._onPeerConnect((peer)))\n\n    setImmediate(() => callback())\n  }\n\n  stop (callback) {\n    this._running = false\n\n    this.libp2p.unhandle(BITSWAP100)\n    if (!this.b100Only) { this.libp2p.unhandle(BITSWAP110) }\n\n    this.libp2p.removeListener('peer:connect', this._onPeerConnect)\n    this.libp2p.removeListener('peer:disconnect', this._onPeerDisconnect)\n\n    setImmediate(() => callback())\n  }\n\n  // Handles both types of bitswap messgages\n  _onConnection (protocol, conn) {\n    if (!this._running) { return }\n    this._log('incomming new bitswap connection: %s', protocol)\n\n    pull(\n      conn,\n      lp.decode(),\n      pull.asyncMap((data, cb) => Message.deserialize(data, cb)),\n      pull.asyncMap((msg, cb) => {\n        conn.getPeerInfo((err, peerInfo) => {\n          if (err) { return cb(err) }\n\n          // this._log('data from', peerInfo.id.toB58String())\n          this.bitswap._receiveMessage(peerInfo.id, msg, cb)\n        })\n      }),\n      pull.onEnd((err) => {\n        this._log('ending connection')\n        if (err) {\n          this.bitswap._receiveError(err)\n        }\n      })\n    )\n  }\n\n  _onPeerConnect (peerInfo) {\n    if (!this._running) { return }\n\n    this.bitswap._onPeerConnected(peerInfo.id)\n  }\n\n  _onPeerDisconnect (peerInfo) {\n    if (!this._running) { return }\n\n    this.bitswap._onPeerDisconnected(peerInfo.id)\n  }\n\n  findProviders (cid, maxProviders, callback) {\n    // TODO\n    // consider if we want to trickleDown maxProviders, currently this is\n    // not an exposed option:\n    // https://github.com/libp2p/js-libp2p-kad-dht/blob/master/src/index.js#L416\n    this.libp2p.contentRouting.findProviders(cid, CONSTANTS.providerRequestTimeout, callback)\n  }\n\n  findAndConnect (cid, callback) {\n    waterfall([\n      (cb) => this.findProviders(cid, CONSTANTS.maxProvidersPerRequest, cb),\n      (provs, cb) => {\n        this._log('connecting to providers', provs.map((p) => p.id.toB58String()))\n        each(provs, (p, cb) => this.connectTo(p, cb))\n      }\n    ], callback)\n  }\n\n  provide (cid, callback) {\n    this.libp2p.contentRouting.provide(cid, callback)\n  }\n\n  // Connect to the given peer\n  // Send the given msg (instance of Message) to the given peer\n  sendMessage (peer, msg, callback) {\n    if (!this._running) { return callback(new Error(`network isn't running`)) }\n\n    const stringId = peer.toB58String() ? peer.toB58String() : peer.id.toB58String()\n    this._log('sendMessage to %s', stringId, msg)\n\n    this._dialPeer(peer, (err, conn, protocol) => {\n      if (err) {\n        return callback(err)\n      }\n\n      let serialized\n      switch (protocol) {\n        case BITSWAP100:\n          serialized = msg.serializeToBitswap100()\n          break\n        case BITSWAP110:\n          serialized = msg.serializeToBitswap110()\n          break\n        default:\n          return callback(new Error('Unkown protocol: ' + protocol))\n      }\n      // TODO: why doesn't the error get propageted back??\n      writeMessage(conn, serialized, (err) => {\n        if (err) {\n          this._log.error(err)\n        }\n      })\n      callback()\n      this._updateSentStats(peer, msg.blocks)\n    })\n  }\n\n  connectTo (peer, callback) {\n    if (!this._running) { return callback(new Error(`network isn't running`)) }\n\n    this.libp2p.dial(peer, callback)\n  }\n\n  // Dial to the peer and try to use the most recent Bitswap\n  _dialPeer (peer, callback) {\n    // Attempt Bitswap 1.1.0\n    this.libp2p.dialProtocol(peer, BITSWAP110, (err, conn) => {\n      if (err) {\n        // Attempt Bitswap 1.0.0\n        this.libp2p.dialProtocol(peer, BITSWAP100, (err, conn) => {\n          if (err) { return callback(err) }\n\n          callback(null, conn, BITSWAP100)\n        })\n\n        return\n      }\n\n      callback(null, conn, BITSWAP110)\n    })\n  }\n\n  _updateSentStats (peer, blocks) {\n    const peerId = peer.toB58String()\n    if (this._stats) {\n      blocks.forEach((block) => this._stats.push(peerId, 'dataSent', block.data.length))\n      this._stats.push(peerId, 'blocksSent', blocks.size)\n    }\n  }\n}\n\nfunction writeMessage (conn, msg, callback) {\n  pull(\n    pull.values([msg]),\n    lp.encode(),\n    conn,\n    pull.onEnd(callback)\n  )\n}\n\nmodule.exports = Network\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/network.js\n// module id = 887\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/network.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15).EventEmitter\n\nconst CONSTANTS = __webpack_require__(266)\nconst logger = __webpack_require__(120).logger\n\nconst unwantEvent = (c) => `unwant:${c}`\nconst blockEvent = (c) => `block:${c}`\n\n/**\n * Internal module used to track events about incoming blocks,\n * wants and unwants.\n *\n * @param {PeerId} peerId\n * @private\n */\nclass Notifications extends EventEmitter {\n  constructor (peerId) {\n    super()\n\n    this.setMaxListeners(CONSTANTS.maxListeners)\n\n    this._log = logger(peerId, 'notif')\n\n    this._unwantListeners = {}\n    this._blockListeners = {}\n  }\n\n  /**\n   * Signal the system that we received `block`.\n   *\n   * @param {Block} block\n   * @return {void}\n   */\n  hasBlock (block) {\n    const str = `block:${block.cid.buffer.toString()}`\n    this._log(str)\n    this.emit(str, block)\n  }\n\n  /**\n   * Signal the system that we are waiting to receive the\n   * block associated with the given `cid`.\n   *\n   * @param {CID} cid\n   * @param {function(Block)} onBlock - called when the block is received\n   * @param {function()} onUnwant - called when the block is unwanted\n   * @returns {void}\n   */\n  wantBlock (cid, onBlock, onUnwant) {\n    const cidStr = cid.buffer.toString()\n    this._log(`wantBlock:${cidStr}`)\n\n    this._unwantListeners[cidStr] = () => {\n      this._log(`manual unwant: ${cidStr}`)\n      this._cleanup(cidStr)\n      onUnwant()\n    }\n\n    this._blockListeners[cidStr] = (block) => {\n      this._cleanup(cidStr)\n      onBlock(block)\n    }\n\n    this.once(\n      unwantEvent(cidStr),\n      this._unwantListeners[cidStr]\n    )\n    this.once(\n      blockEvent(cidStr),\n      this._blockListeners[cidStr]\n    )\n  }\n\n  /**\n   * Signal that the block is not wanted anymore.\n   *\n   * @param {CID} cid - the CID of the block that is not wanted anymore.\n   * @returns {void}\n   */\n  unwantBlock (cid) {\n    const str = `unwant:${cid.buffer.toString()}`\n    this._log(str)\n    this.emit(str)\n  }\n\n  /**\n   * Internal method to clean up once a block was received or unwanted.\n   *\n   * @private\n   * @param  {string} cidStr\n   * @returns {void}\n   */\n  _cleanup (cidStr) {\n    if (this._unwantListeners[cidStr]) {\n      this.removeListener(\n        unwantEvent(cidStr),\n        this._unwantListeners[cidStr]\n      )\n      delete this._unwantListeners[cidStr]\n    }\n\n    if (this._blockListeners[cidStr]) {\n      this.removeListener(\n        blockEvent(cidStr),\n        this._blockListeners[cidStr]\n      )\n      delete this._blockListeners[cidStr]\n    }\n  }\n}\n\nmodule.exports = Notifications\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/notifications.js\n// module id = 888\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/notifications.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15)\nconst Stat = __webpack_require__(890)\n\nconst defaultOptions = {\n  movingAverageIntervals: [\n    60 * 1000, // 1 minute\n    5 * 60 * 1000, // 5 minutes\n    15 * 60 * 1000 // 15 minutes\n  ]\n}\n\nclass Stats extends EventEmitter {\n  constructor (initialCounters, _options) {\n    super()\n\n    const options = Object.assign({}, defaultOptions, _options)\n\n    if (typeof options.computeThrottleTimeout !== 'number') {\n      throw new Error('need computeThrottleTimeout')\n    }\n\n    if (typeof options.computeThrottleMaxQueueSize !== 'number') {\n      throw new Error('need computeThrottleMaxQueueSize')\n    }\n\n    this._initialCounters = initialCounters\n    this._options = options\n    this._enabled = this._options.enabled\n\n    this._global = new Stat(initialCounters, options)\n    this._global.on('update', (stats) => this.emit('update', stats))\n\n    this._peers = new Map()\n  }\n\n  enable () {\n    this._enabled = true\n    this._options.enabled = true\n    this._global.enable()\n  }\n\n  disable () {\n    this._enabled = false\n    this._options.enabled = false\n    this._global.disable()\n  }\n\n  stop () {\n    this._enabled = false\n    this._global.stop()\n    for (let peerStat of this._peers) {\n      peerStat[1].stop()\n    }\n  }\n\n  get snapshot () {\n    return this._global.snapshot\n  }\n\n  get movingAverages () {\n    return this._global.movingAverages\n  }\n\n  forPeer (peerId) {\n    if (peerId.toB58String) {\n      peerId = peerId.toB58String()\n    }\n    return this._peers.get(peerId)\n  }\n\n  push (peer, counter, inc) {\n    if (this._enabled) {\n      this._global.push(counter, inc)\n\n      if (peer) {\n        let peerStats = this._peers.get(peer)\n        if (!peerStats) {\n          peerStats = new Stat(this._initialCounters, this._options)\n          this._peers.set(peer, peerStats)\n        }\n\n        peerStats.push(counter, inc)\n      }\n    }\n  }\n\n  disconnected (peer) {\n    const peerId = peer.toB58String()\n    const peerStats = this._peers.get(peerId)\n    if (peerStats) {\n      peerStats.stop()\n      this._peers.delete(peerId)\n    }\n  }\n}\n\nmodule.exports = Stats\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/stats/index.js\n// module id = 889\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/stats/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15)\nconst Big = __webpack_require__(226)\nconst MovingAverage = __webpack_require__(1097)\n\nclass Stats extends EventEmitter {\n  constructor (initialCounters, options) {\n    super()\n\n    this._options = options\n    this._queue = []\n    this._stats = {}\n\n    this._frequencyLastTime = Date.now()\n    this._frequencyAccumulators = {}\n    this._movingAverages = {}\n\n    this._update = this._update.bind(this)\n\n    initialCounters.forEach((key) => {\n      this._stats[key] = Big(0)\n      this._movingAverages[key] = {}\n      this._options.movingAverageIntervals.forEach((interval) => {\n        const ma = this._movingAverages[key][interval] = MovingAverage(interval)\n        ma.push(this._frequencyLastTime, 0)\n      })\n    })\n\n    this._enabled = this._options.enabled\n  }\n\n  enable () {\n    this._enabled = true\n  }\n\n  disable () {\n    this._disabled = true\n  }\n\n  stop () {\n    if (this._timeout) {\n      clearTimeout(this._timeout)\n    }\n  }\n\n  get snapshot () {\n    return Object.assign({}, this._stats)\n  }\n\n  get movingAverages () {\n    return Object.assign({}, this._movingAverages)\n  }\n\n  push (counter, inc) {\n    if (this._enabled) {\n      this._queue.push([counter, inc, Date.now()])\n      this._resetComputeTimeout()\n    }\n  }\n\n  _resetComputeTimeout () {\n    if (this._timeout) {\n      clearTimeout(this._timeout)\n    }\n    this._timeout = setTimeout(this._update, this._nextTimeout())\n  }\n\n  _nextTimeout () {\n    // calculate the need for an update, depending on the queue length\n    const urgency = this._queue.length / this._options.computeThrottleMaxQueueSize\n    return Math.max(this._options.computeThrottleTimeout * (1 - urgency), 0)\n  }\n\n  _update () {\n    this._timeout = null\n    if (this._queue.length) {\n      let last\n      while (this._queue.length) {\n        const op = last = this._queue.shift()\n        this._applyOp(op)\n      }\n\n      this._updateFrequency(last[2]) // contains timestamp of last op\n\n      this.emit('update', this._stats)\n    }\n  }\n\n  _updateFrequency (latestTime) {\n    const timeDiff = latestTime - this._frequencyLastTime\n\n    Object.keys(this._stats).forEach((key) => {\n      this._updateFrequencyFor(key, timeDiff, latestTime)\n    })\n\n    this._frequencyLastTime = latestTime\n  }\n\n  _updateFrequencyFor (key, timeDiffMS, latestTime) {\n    const count = this._frequencyAccumulators[key] || 0\n    this._frequencyAccumulators[key] = 0\n    const hz = (count / timeDiffMS) * 1000\n\n    let movingAverages = this._movingAverages[key]\n    if (!movingAverages) {\n      movingAverages = this._movingAverages[key] = {}\n    }\n    this._options.movingAverageIntervals.forEach((movingAverageInterval) => {\n      let movingAverage = movingAverages[movingAverageInterval]\n      if (!movingAverage) {\n        movingAverage = movingAverages[movingAverageInterval] = MovingAverage(movingAverageInterval)\n      }\n      movingAverage.push(latestTime, hz)\n    })\n  }\n\n  _applyOp (op) {\n    const key = op[0]\n    const inc = op[1]\n\n    if (typeof inc !== 'number') {\n      throw new Error('invalid increment number:', inc)\n    }\n\n    let n\n\n    if (!this._stats.hasOwnProperty(key)) {\n      n = this._stats[key] = Big(0)\n    } else {\n      n = this._stats[key]\n    }\n    this._stats[key] = n.plus(inc)\n\n    if (!this._frequencyAccumulators[key]) {\n      this._frequencyAccumulators[key] = 0\n    }\n    this._frequencyAccumulators[key] += inc\n  }\n}\n\nmodule.exports = Stats\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/stats/stat.js\n// module id = 890\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/stats/stat.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst WantlistEntry = __webpack_require__(187).Entry\nconst CID = __webpack_require__(14)\nconst assert = __webpack_require__(16)\n\nmodule.exports = class BitswapMessageEntry {\n  constructor (cid, priority, cancel) {\n    assert(CID.isCID(cid), 'needs valid cid')\n    this.entry = new WantlistEntry(cid, priority)\n    this.cancel = Boolean(cancel)\n  }\n\n  get cid () {\n    return this.entry.cid\n  }\n\n  set cid (cid) {\n    this.entry.cid = cid\n  }\n\n  get priority () {\n    return this.entry.priority\n  }\n\n  set priority (val) {\n    this.entry.priority = val\n  }\n\n  get [Symbol.toStringTag] () {\n    const cidStr = this.cid.toBaseEncodedString()\n\n    return `BitswapMessageEntry ${cidStr} <cancel: ${this.cancel}, priority: ${this.priority}>`\n  }\n\n  equals (other) {\n    return (this.cancel === other.cancel) &&\n           this.entry.equals(other.entry)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/types/message/entry.js\n// module id = 891\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/types/message/entry.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// from: https://github.com/ipfs/go-ipfs/blob/master/exchange/bitswap/message/pb/message.proto\n\nmodule.exports = `\n  message Message {\n    message Wantlist {\n      message Entry {\n        // changed from string to bytes, it makes a difference in JavaScript\n        optional bytes block = 1;      // the block cid (cidV0 in bitswap 1.0.0, cidV1 in bitswap 1.1.0)\n        optional int32 priority = 2;    // the priority (normalized). default to 1\n        optional bool cancel = 3;       // whether this revokes an entry\n      }\n\n      repeated Entry entries = 1;       // a list of wantlist entries\n      optional bool full = 2;           // whether this is the full wantlist. default to false\n    }\n\n    message Block {\n      optional bytes prefix = 1;        // CID prefix (cid version, multicodec and multihash prefix (type + length)\n      optional bytes data = 2;\n    }\n\n    optional Wantlist wantlist = 1;\n    repeated bytes blocks = 2;          // used to send Blocks in bitswap 1.0.0\n    repeated Block payload = 3;         // used to send Blocks in bitswap 1.1.0\n  }\n`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/types/message/message.proto.js\n// module id = 892\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/types/message/message.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst assert = __webpack_require__(16)\nconst CID = __webpack_require__(14)\n\nclass WantListEntry {\n  constructor (cid, priority) {\n    assert(CID.isCID(cid), 'must be valid CID')\n\n    // Keep track of how many requests we have for this key\n    this._refCounter = 1\n\n    this.cid = cid\n    this.priority = priority || 1\n  }\n\n  inc () {\n    this._refCounter += 1\n  }\n\n  dec () {\n    this._refCounter = Math.max(0, this._refCounter - 1)\n  }\n\n  hasRefs () {\n    return this._refCounter > 0\n  }\n\n  // So that console.log prints a nice description of this object\n  get [Symbol.toStringTag] () {\n    const cidStr = this.cid.toBaseEncodedString()\n    return `WantlistEntry <key: ${cidStr}, priority: ${this.priority}, refs: ${this._refCounter}>`\n  }\n\n  equals (other) {\n    return (this._refCounter === other._refCounter) &&\n      this.cid.equals(other.cid) &&\n      this.priority === other.priority\n  }\n}\n\nmodule.exports = WantListEntry\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/types/wantlist/entry.js\n// module id = 893\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/types/wantlist/entry.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst setImmediate = __webpack_require__(8)\n\nconst Message = __webpack_require__(186)\nconst Wantlist = __webpack_require__(187)\nconst CONSTANTS = __webpack_require__(266)\nconst MsgQueue = __webpack_require__(895)\nconst logger = __webpack_require__(120).logger\n\nmodule.exports = class WantManager {\n  constructor (peerId, network, stats) {\n    this.peers = new Map()\n    this.wantlist = new Wantlist(stats)\n\n    this.network = network\n    this._stats = stats\n\n    this._peerId = peerId\n    this._log = logger(peerId, 'want')\n  }\n\n  _addEntries (cids, cancel, force) {\n    const entries = cids.map((cid, i) => {\n      return new Message.Entry(cid, CONSTANTS.kMaxPriority - i, cancel)\n    })\n\n    entries.forEach((e) => {\n      // add changes to our wantlist\n      if (e.cancel) {\n        if (force) {\n          this.wantlist.removeForce(e.cid)\n        } else {\n          this.wantlist.remove(e.cid)\n        }\n      } else {\n        this._log('adding to wl')\n        this.wantlist.add(e.cid, e.priority)\n      }\n    })\n\n    // broadcast changes\n    for (let p of this.peers.values()) {\n      p.addEntries(entries)\n    }\n  }\n\n  _startPeerHandler (peerId) {\n    let mq = this.peers.get(peerId.toB58String())\n\n    if (mq) {\n      mq.refcnt++\n      return\n    }\n\n    mq = new MsgQueue(this._peerId, peerId, this.network)\n\n    // new peer, give them the full wantlist\n    const fullwantlist = new Message(true)\n\n    for (let entry of this.wantlist.entries()) {\n      fullwantlist.addEntry(entry[1].cid, entry[1].priority)\n    }\n\n    mq.addMessage(fullwantlist)\n\n    this.peers.set(peerId.toB58String(), mq)\n    return mq\n  }\n\n  _stopPeerHandler (peerId) {\n    const mq = this.peers.get(peerId.toB58String())\n\n    if (!mq) {\n      return\n    }\n\n    mq.refcnt--\n    if (mq.refcnt > 0) {\n      return\n    }\n\n    this.peers.delete(peerId.toB58String())\n  }\n\n  // add all the cids to the wantlist\n  wantBlocks (cids) {\n    this._addEntries(cids, false)\n  }\n\n  // remove blocks of all the given keys without respecting refcounts\n  unwantBlocks (cids) {\n    this._log('unwant blocks: %s', cids.length)\n    this._addEntries(cids, true, true)\n  }\n\n  // cancel wanting all of the given keys\n  cancelWants (cids) {\n    this._log('cancel wants: %s', cids.length)\n    this._addEntries(cids, true)\n  }\n\n  // Returns a list of all currently connected peers\n  connectedPeers () {\n    return Array.from(this.peers.keys())\n  }\n\n  connected (peerId) {\n    this._startPeerHandler(peerId)\n  }\n\n  disconnected (peerId) {\n    this._stopPeerHandler(peerId)\n  }\n\n  start (callback) {\n    // resend entire wantlist every so often\n    this.timer = setInterval(() => {\n      this._log('resend full-wantlist')\n      const fullwantlist = new Message(true)\n      this.wantlist.forEach((entry) => {\n        fullwantlist.addEntry(entry.cid, entry.priority)\n      })\n\n      this.peers.forEach((p) => p.addMessage(fullwantlist))\n    }, 60 * 1000)\n\n    setImmediate(() => callback())\n  }\n\n  stop (callback) {\n    this.peers.forEach((mq) => this.disconnected(mq.peerId))\n\n    clearInterval(this.timer)\n    setImmediate(() => callback())\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/want-manager/index.js\n// module id = 894\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/want-manager/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debounce = __webpack_require__(454)\n\nconst Message = __webpack_require__(186)\nconst logger = __webpack_require__(120).logger\n\nmodule.exports = class MsgQueue {\n  constructor (selfPeerId, otherPeerId, network) {\n    this.peerId = otherPeerId\n    this.network = network\n    this.refcnt = 1\n\n    this._entries = []\n    this._log = logger(selfPeerId, 'msgqueue', otherPeerId.toB58String().slice(0, 8))\n    this.sendEntries = debounce(this._sendEntries.bind(this), 200)\n  }\n\n  addMessage (msg) {\n    if (msg.empty) {\n      return\n    }\n\n    this.send(msg)\n  }\n\n  addEntries (entries) {\n    this._entries = this._entries.concat(entries)\n    this.sendEntries()\n  }\n\n  _sendEntries () {\n    if (!this._entries.length) {\n      return\n    }\n\n    const msg = new Message(false)\n    this._entries.forEach((entry) => {\n      if (entry.cancel) {\n        msg.cancel(entry.cid)\n      } else {\n        msg.addEntry(entry.cid, entry.priority)\n      }\n    })\n    this._entries = []\n    this.addMessage(msg)\n  }\n\n  send (msg) {\n    this.network.connectTo(this.peerId, (err) => {\n      if (err) {\n        this._log.error('cant connect to peer %s: %s', this.peerId.toB58String(), err.message)\n        return\n      }\n\n      this._log('sending message')\n      this.network.sendMessage(this.peerId, msg, (err) => {\n        if (err) {\n          this._log.error('send error: %s', err.message)\n        }\n      })\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-bitswap/src/want-manager/msg-queue.js\n// module id = 895\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-bitswap/src/want-manager/msg-queue.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Key = __webpack_require__(40).Key\nconst Buffer = __webpack_require__(1).Buffer\n\nconst apiFile = new Key('api')\n\nmodule.exports = (store) => {\n  return {\n    /**\n     * Get the current configuration from the repo.\n     *\n     * @param {function(Error, Object)} callback\n     * @returns {void}\n     */\n    get (callback) {\n      store.get(apiFile, (err, value) => callback(err, value && value.toString()))\n    },\n    /**\n     * Set the current configuration for this repo.\n     *\n     * @param {Object} value - the api address to be written\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    set (value, callback) {\n      store.put(apiFile, Buffer.from(value.toString()), callback)\n    },\n    /**\n     * Deletes api file\n     *\n     * @param {function(Error, bool)} callback\n     * @returns {void}\n     */\n    delete (callback) {\n      store.delete(apiFile, callback)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/api-addr.js\n// module id = 896\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/api-addr.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.create = function createBackend (name, path, options) {\n  const Ctor = options.storageBackends[name]\n  const backendOptions = Object.assign({}, options.storageBackendOptions[name] || {})\n  return new Ctor(path, backendOptions)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/backends.js\n// module id = 897\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/backends.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst core = __webpack_require__(722)\nconst ShardingStore = core.ShardingDatastore\nconst Key = __webpack_require__(40).Key\nconst base32 = __webpack_require__(619)\nconst Block = __webpack_require__(188)\nconst setImmediate = __webpack_require__(8)\nconst reject = __webpack_require__(333)\nconst CID = __webpack_require__(14)\nconst pull = __webpack_require__(6)\n\n/**\n * Transform a raw buffer to a base32 encoded key.\n *\n * @param {Buffer} rawKey\n * @returns {Key}\n */\nconst keyFromBuffer = (rawKey) => {\n  const enc = new base32.Encoder()\n  return new Key('/' + enc.write(rawKey).finalize(), false)\n}\n\n/**\n * Transform a cid to the appropriate datastore key.\n *\n * @param {CID} cid\n * @returns {Key}\n */\nconst cidToDsKey = (cid) => {\n  return keyFromBuffer(cid.buffer)\n}\n\nmodule.exports = (filestore, options, callback) => {\n  maybeWithSharding(filestore, options, (err, store) => {\n    if (err) { return callback(err) }\n\n    callback(null, createBaseStore(store))\n  })\n}\n\nfunction maybeWithSharding (filestore, options, callback) {\n  if (options.sharding) {\n    const shard = new core.shard.NextToLast(2)\n    ShardingStore.createOrOpen(filestore, shard, callback)\n  } else {\n    setImmediate(() => callback(null, filestore))\n  }\n}\n\nfunction createBaseStore (store) {\n  return {\n    /**\n     * Query the store.\n     *\n     * @param {object} query\n     * @param {function(Error, Array)} callback\n     * @return {void}\n     */\n    query (query, callback) {\n      pull(\n        store.query(query),\n        pull.collect(callback)\n      )\n    },\n    /**\n     * Get a single block by CID.\n     *\n     * @param {CID} cid\n     * @param {function(Error, Block)} callback\n     * @returns {void}\n     */\n    get (cid, callback) {\n      if (!CID.isCID(cid)) {\n        return setImmediate(() => {\n          callback(new Error('Not a valid cid'))\n        })\n      }\n\n      const k = cidToDsKey(cid)\n      store.get(k, (err, blockData) => {\n        if (err) { return callback(err) }\n\n        callback(null, new Block(blockData, cid))\n      })\n    },\n    put (block, callback) {\n      if (!Block.isBlock(block)) {\n        return setImmediate(() => {\n          callback(new Error('invalid block'))\n        })\n      }\n\n      const k = cidToDsKey(block.cid)\n\n      store.has(k, (err, exists) => {\n        if (err) { return callback(err) }\n        if (exists) { return callback() }\n\n        store.put(k, block.data, callback)\n      })\n    },\n    /**\n     * Like put, but for more.\n     *\n     * @param {Array<Block>} blocks\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    putMany (blocks, callback) {\n      const keys = blocks.map((b) => ({\n        key: cidToDsKey(b.cid),\n        block: b\n      }))\n\n      const batch = store.batch()\n      reject(keys, (k, cb) => store.has(k.key, cb), (err, newKeys) => {\n        if (err) {\n          return callback(err)\n        }\n\n        newKeys.forEach((k) => {\n          batch.put(k.key, k.block.data)\n        })\n\n        batch.commit(callback)\n      })\n    },\n    /**\n     * Does the store contain block with this cid?\n     *\n     * @param {CID} cid\n     * @param {function(Error, bool)} callback\n     * @returns {void}\n     */\n    has (cid, callback) {\n      if (!CID.isCID(cid)) {\n        return setImmediate(() => {\n          callback(new Error('Not a valid cid'))\n        })\n      }\n\n      store.has(cidToDsKey(cid), callback)\n    },\n    /**\n     * Delete a block from the store\n     *\n     * @param {CID} cid\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    delete (cid, callback) {\n      if (!CID.isCID(cid)) {\n        return setImmediate(() => {\n          callback(new Error('Not a valid cid'))\n        })\n      }\n\n      store.delete(cidToDsKey(cid), callback)\n    },\n\n    close (callback) {\n      store.close(callback)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/blockstore.js\n// module id = 898\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/blockstore.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Key = __webpack_require__(40).Key\nconst queue = __webpack_require__(223)\nconst waterfall = __webpack_require__(12)\nconst _get = __webpack_require__(455)\nconst _set = __webpack_require__(1045)\nconst _has = __webpack_require__(1041)\nconst Buffer = __webpack_require__(1).Buffer\n\nconst configKey = new Key('config')\n\nmodule.exports = (store) => {\n  const setQueue = queue(_doSet, 1)\n\n  const configStore = {\n    /**\n     * Get the current configuration from the repo.\n     *\n     * @param {String} key - the config key to get\n     * @param {function(Error, Object)} callback\n     * @returns {void}\n     */\n    get (key, callback) {\n      if (typeof key === 'function') {\n        callback = key\n        key = undefined\n      }\n      if (!key) {\n        key = undefined\n      }\n      store.get(configKey, (err, encodedValue) => {\n        if (err) { return callback(err) }\n\n        let config\n        try {\n          config = JSON.parse(encodedValue.toString())\n        } catch (err) {\n          return callback(err)\n        }\n        if (key !== undefined && !_has(config, key)) {\n          return callback(new Error('Key ' + key + ' does not exist in config'))\n        }\n        let value = key !== undefined ? _get(config, key) : config\n        callback(null, value)\n      })\n    },\n    /**\n     * Set the current configuration for this repo.\n     *\n     * @param {String} key - the config key to be written\n     * @param {Object} value - the config value to be written\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    set (key, value, callback) {\n      if (typeof value === 'function') {\n        callback = value\n        value = key\n        key = undefined\n      } else if (!key || typeof key !== 'string') {\n        return callback(new Error('Invalid key type'))\n      }\n\n      if (value === undefined || Buffer.isBuffer(value)) {\n        return callback(new Error('Invalid value type'))\n      }\n\n      setQueue.push({\n        key: key,\n        value: value\n      }, callback)\n    },\n\n    /**\n     * Check if a config file exists.\n     *\n     * @param {function(Error, bool)} callback\n     * @returns {void}\n     */\n    exists (callback) {\n      store.has(configKey, callback)\n    }\n  }\n\n  return configStore\n\n  function _doSet (m, callback) {\n    const key = m.key\n    const value = m.value\n    if (key) {\n      waterfall(\n        [\n          (cb) => configStore.get(cb),\n          (config, cb) => cb(null, _set(config, key, value)),\n          _saveAll\n        ],\n        callback)\n    } else {\n      _saveAll(value, callback)\n    }\n  }\n\n  function _saveAll (config, callback) {\n    const buf = Buffer.from(JSON.stringify(config, null, 2))\n    store.put(configKey, buf, callback)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/config.js\n// module id = 899\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/config.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  repoVersion: 6\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/constants.js\n// module id = 900\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// Default configuration for a repo in the browser\nmodule.exports = {\n  lock: 'memory',\n  storageBackends: {\n    root: __webpack_require__(178),\n    blocks: __webpack_require__(178),\n    keys: __webpack_require__(178),\n    datastore: __webpack_require__(178)\n  },\n  storageBackendOptions: {\n    root: {\n      db: __webpack_require__(193),\n      extension: ''\n    },\n    blocks: {\n      sharding: false,\n      db: __webpack_require__(193)\n    },\n    keys: {\n      sharding: false,\n      db: __webpack_require__(193)\n    },\n    datastore: {\n      db: __webpack_require__(193)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/default-options-browser.js\n// module id = 901\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/default-options-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst Key = __webpack_require__(40).Key\nconst debug = __webpack_require__(5)\nconst log = debug('repo:version')\n\nconst versionKey = new Key('version')\n\nmodule.exports = (store) => {\n  return {\n    /**\n     * Check if a version file exists.\n     *\n     * @param {function(Error, bool)} callback\n     * @returns {void}\n     */\n    exists (callback) {\n      store.has(versionKey, callback)\n    },\n    /**\n     * Get the current version.\n     *\n     * @param {function(Error, number)} callback\n     * @returns {void}\n     */\n    get (callback) {\n      store.get(versionKey, (err, buf) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, parseInt(buf.toString().trim(), 10))\n      })\n    },\n    /**\n     * Set the version of the repo, writing it to the underlying store.\n     *\n     * @param {number} version\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    set (version, callback) {\n      store.put(versionKey, Buffer.from(String(version)), callback)\n    },\n    /**\n     * Check the current version, and return an error on missmatch\n     * @param {number} expected\n     * @param {function(Error)} callback\n     * @returns {void}\n     */\n    check (expected, callback) {\n      this.get((err, version) => {\n        if (err) {\n          return callback(err)\n        }\n        log('comparing version: %s and %s', version, expected)\n        if (version !== expected) {\n          return callback(new Error(`version mismatch: expected v${expected}, found v${version}`))\n        }\n        callback()\n      })\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-repo/src/version.js\n// module id = 902\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-repo/src/version.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/*!\n * @description Recursive object extending\n * @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>\n * @license MIT\n *\n * The MIT License (MIT)\n *\n * Copyright (c) 2013-2018 Viacheslav Lotsmanov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n\n\nfunction isSpecificValue(val) {\n\treturn (\n\t\tval instanceof Buffer\n\t\t|| val instanceof Date\n\t\t|| val instanceof RegExp\n\t) ? true : false;\n}\n\nfunction cloneSpecificValue(val) {\n\tif (val instanceof Buffer) {\n\t\tvar x = Buffer.alloc\n\t\t\t? Buffer.alloc(val.length)\n\t\t\t: new Buffer(val.length);\n\t\tval.copy(x);\n\t\treturn x;\n\t} else if (val instanceof Date) {\n\t\treturn new Date(val.getTime());\n\t} else if (val instanceof RegExp) {\n\t\treturn new RegExp(val);\n\t} else {\n\t\tthrow new Error('Unexpected situation');\n\t}\n}\n\n/**\n * Recursive cloning array.\n */\nfunction deepCloneArray(arr) {\n\tvar clone = [];\n\tarr.forEach(function (item, index) {\n\t\tif (typeof item === 'object' && item !== null) {\n\t\t\tif (Array.isArray(item)) {\n\t\t\t\tclone[index] = deepCloneArray(item);\n\t\t\t} else if (isSpecificValue(item)) {\n\t\t\t\tclone[index] = cloneSpecificValue(item);\n\t\t\t} else {\n\t\t\t\tclone[index] = deepExtend({}, item);\n\t\t\t}\n\t\t} else {\n\t\t\tclone[index] = item;\n\t\t}\n\t});\n\treturn clone;\n}\n\nfunction safeGetProperty(object, property) {\n\treturn property === '__proto__' ? undefined : object[property];\n}\n\n/**\n * Extening object that entered in first argument.\n *\n * Returns extended object or false if have no target object or incorrect type.\n *\n * If you wish to clone source object (without modify it), just use empty new\n * object as first argument, like this:\n *   deepExtend({}, yourObj_1, [yourObj_N]);\n */\nvar deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) {\n\tif (arguments.length < 1 || typeof arguments[0] !== 'object') {\n\t\treturn false;\n\t}\n\n\tif (arguments.length < 2) {\n\t\treturn arguments[0];\n\t}\n\n\tvar target = arguments[0];\n\n\t// convert arguments to array and cut off target object\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\n\tvar val, src, clone;\n\n\targs.forEach(function (obj) {\n\t\t// skip argument if isn't an object, is null, or is an array\n\t\tif (typeof obj !== 'object' || obj === null || Array.isArray(obj)) {\n\t\t\treturn;\n\t\t}\n\n\t\tObject.keys(obj).forEach(function (key) {\n\t\t\tsrc = safeGetProperty(target, key); // source value\n\t\t\tval = safeGetProperty(obj, key); // new value\n\n\t\t\t// recursion prevention\n\t\t\tif (val === target) {\n\t\t\t\treturn;\n\n\t\t\t/**\n\t\t\t * if new value isn't object then just overwrite by new value\n\t\t\t * instead of extending.\n\t\t\t */\n\t\t\t} else if (typeof val !== 'object' || val === null) {\n\t\t\t\ttarget[key] = val;\n\t\t\t\treturn;\n\n\t\t\t// just clone arrays (and recursive clone objects inside)\n\t\t\t} else if (Array.isArray(val)) {\n\t\t\t\ttarget[key] = deepCloneArray(val);\n\t\t\t\treturn;\n\n\t\t\t// custom cloning and overwrite for specific objects\n\t\t\t} else if (isSpecificValue(val)) {\n\t\t\t\ttarget[key] = cloneSpecificValue(val);\n\t\t\t\treturn;\n\n\t\t\t// overwrite by new value if source isn't object or array\n\t\t\t} else if (typeof src !== 'object' || src === null || Array.isArray(src)) {\n\t\t\t\ttarget[key] = deepExtend({}, val);\n\t\t\t\treturn;\n\n\t\t\t// source value and new value is objects both, extending...\n\t\t\t} else {\n\t\t\t\ttarget[key] = deepExtend(src, val);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t});\n\n\treturn target;\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/~/deep-extend/lib/deep-extend.js\n// module id = 903\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/node_modules/deep-extend/lib/deep-extend.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst pushable = __webpack_require__(54)\nconst pullPair = __webpack_require__(205)\nconst batch = __webpack_require__(299)\n\nmodule.exports = function balancedReduceToRoot (reduce, options) {\n  const pair = pullPair()\n  const source = pair.source\n\n  const result = pushable()\n\n  reduceToParents(source, (err, roots) => {\n    if (err) {\n      result.end(err)\n      return // early\n    }\n    if (roots.length === 1) {\n      result.push(roots[0])\n      result.end()\n    } else if (roots.length > 1) {\n      result.end(new Error('expected a maximum of 1 roots and got ' + roots.length))\n    } else {\n      result.end()\n    }\n  })\n\n  function reduceToParents (_chunks, callback) {\n    let chunks = _chunks\n    if (Array.isArray(chunks)) {\n      chunks = pull.values(chunks)\n    }\n\n    pull(\n      chunks,\n      batch(options.maxChildrenPerNode),\n      pull.asyncMap(reduce),\n      pull.collect(reduced)\n    )\n\n    function reduced (err, roots) {\n      if (err) {\n        callback(err)\n      } else if (roots.length > 1) {\n        reduceToParents(roots, callback)\n      } else {\n        callback(null, roots)\n      }\n    }\n  }\n\n  return {\n    sink: pair.sink,\n    source: result\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/balanced/balanced-reducer.js\n// module id = 904\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/balanced/balanced-reducer.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst balancedReducer = __webpack_require__(904)\n\nconst defaultOptions = {\n  maxChildrenPerNode: 174\n}\n\nmodule.exports = function (reduce, _options) {\n  const options = Object.assign({}, defaultOptions, _options)\n  return balancedReducer(reduce, options)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/balanced/index.js\n// module id = 905\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/balanced/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst extend = __webpack_require__(903)\nconst UnixFS = __webpack_require__(95)\nconst pull = __webpack_require__(6)\nconst through = __webpack_require__(206)\nconst parallel = __webpack_require__(85)\nconst waterfall = __webpack_require__(12)\nconst dagPB = __webpack_require__(121)\nconst CID = __webpack_require__(14)\n\nconst reduce = __webpack_require__(910)\n\nconst DAGNode = dagPB.DAGNode\n\nconst defaultOptions = {\n  chunkerOptions: {\n    maxChunkSize: 262144\n  }\n}\n\nmodule.exports = function (createChunker, ipld, createReducer, _options) {\n  const options = extend({}, defaultOptions, _options)\n\n  return function (source) {\n    return function (items, cb) {\n      parallel(items.map((item) => (cb) => {\n        if (!item.content) {\n          // item is a directory\n          return createAndStoreDir(item, (err, node) => {\n            if (err) {\n              return cb(err)\n            }\n            if (node) {\n              source.push(node)\n            }\n            cb()\n          })\n        }\n\n        // item is a file\n        createAndStoreFile(item, (err, node) => {\n          if (err) {\n            return cb(err)\n          }\n          if (node) {\n            source.push(node)\n          }\n          cb()\n        })\n      }), cb)\n    }\n  }\n\n  function createAndStoreDir (item, callback) {\n    // 1. create the empty dir dag node\n    // 2. write it to the dag store\n\n    const d = new UnixFS('directory')\n\n    waterfall([\n      (cb) => DAGNode.create(d.marshal(), [], options.hashAlg, cb),\n      (node, cb) => {\n        if (options.onlyHash) return cb(null, node)\n\n        let cid = new CID(node.multihash)\n\n        if (options.cidVersion === 1) {\n          cid = cid.toV1()\n        }\n\n        ipld.put(node, { cid }, (err) => cb(err, node))\n      }\n    ], (err, node) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, {\n        path: item.path,\n        multihash: node.multihash,\n        size: node.size\n      })\n    })\n  }\n\n  function createAndStoreFile (file, callback) {\n    if (Buffer.isBuffer(file.content)) {\n      file.content = pull.values([file.content])\n    }\n\n    if (typeof file.content !== 'function') {\n      return callback(new Error('invalid content'))\n    }\n\n    const reducer = createReducer(reduce(file, ipld, options), options)\n\n    let previous\n    let count = 0\n\n    pull(\n      file.content,\n      createChunker(options.chunkerOptions),\n      pull.map(chunk => {\n        if (options.progress && typeof options.progress === 'function') {\n          options.progress(chunk.byteLength)\n        }\n        return Buffer.from(chunk)\n      }),\n      pull.map(buffer => new UnixFS('file', buffer)),\n      pull.asyncMap((fileNode, callback) => {\n        DAGNode.create(fileNode.marshal(), [], options.hashAlg, (err, node) => {\n          callback(err, { DAGNode: node, fileNode: fileNode })\n        })\n      }),\n      pull.asyncMap((leaf, callback) => {\n        if (options.onlyHash) return callback(null, leaf)\n\n        let cid = new CID(leaf.DAGNode.multihash)\n\n        if (options.cidVersion === 1) {\n          cid = cid.toV1()\n        }\n\n        ipld.put(leaf.DAGNode, { cid }, (err) => callback(err, leaf))\n      }),\n      pull.map((leaf) => {\n        return {\n          path: file.path,\n          multihash: leaf.DAGNode.multihash,\n          size: leaf.DAGNode.size,\n          leafSize: leaf.fileNode.fileSize(),\n          name: ''\n        }\n      }),\n      through( // mark as single node if only one single node\n        function onData (data) {\n          count++\n          if (previous) {\n            this.queue(previous)\n          }\n          previous = data\n        },\n        function ended () {\n          if (previous) {\n            if (count === 1) {\n              previous.single = true\n            }\n            this.queue(previous)\n          }\n          this.queue(null)\n        }\n      ),\n      reducer,\n      pull.collect((err, roots) => {\n        if (err) {\n          callback(err)\n        } else {\n          callback(null, roots[0])\n        }\n      })\n    )\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/builder.js\n// module id = 906\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/builder.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pullPushable = __webpack_require__(54)\nconst pullWrite = __webpack_require__(207)\n\nmodule.exports = function createBuildStream (createStrategy, _ipld, options) {\n  const source = pullPushable()\n\n  const sink = pullWrite(\n    createStrategy(source),\n    null,\n    options.highWaterMark,\n    (err) => source.end(err)\n  )\n\n  return {\n    source: source,\n    sink: sink\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/create-build-stream.js\n// module id = 907\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/create-build-stream.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst pushable = __webpack_require__(54)\nconst pullPair = __webpack_require__(205)\nconst batch = __webpack_require__(299)\n\nmodule.exports = function (reduce, options) {\n  const pair = pullPair()\n  const source = pair.source\n  const result = pushable()\n\n  pull(\n    source,\n    batch(Infinity),\n    pull.asyncMap(reduce),\n    pull.collect((err, roots) => {\n      if (err) {\n        result.end(err)\n        return // early\n      }\n      if (roots.length === 1) {\n        result.push(roots[0])\n        result.end()\n      } else if (roots.length > 1) {\n        result.end(new Error('expected a maximum of 1 roots and got ' + roots.length))\n      } else {\n        result.end()\n      }\n    })\n  )\n\n  return {\n    sink: pair.sink,\n    source: result\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/flat/index.js\n// module id = 908\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/flat/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst assert = __webpack_require__(16)\nconst createBuildStream = __webpack_require__(907)\nconst Builder = __webpack_require__(906)\n\nconst reducers = {\n  flat: __webpack_require__(908),\n  balanced: __webpack_require__(905),\n  trickle: __webpack_require__(911)\n}\n\nconst defaultOptions = {\n  strategy: 'balanced',\n  highWaterMark: 100,\n  reduceSingleLeafToSelf: false\n}\n\nmodule.exports = function (Chunker, ipld, _options) {\n  assert(Chunker, 'Missing chunker creator function')\n  assert(ipld, 'Missing IPLD')\n\n  const options = Object.assign({}, defaultOptions, _options)\n\n  const strategyName = options.strategy\n  const reducer = reducers[strategyName]\n  assert(reducer, 'Unknown importer build strategy name: ' + strategyName)\n\n  const createStrategy = Builder(Chunker, ipld, reducer, options)\n\n  return createBuildStream(createStrategy, ipld, options)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/index.js\n// module id = 909\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst waterfall = __webpack_require__(12)\nconst dagPB = __webpack_require__(121)\nconst UnixFS = __webpack_require__(95)\nconst CID = __webpack_require__(14)\n\nconst DAGLink = dagPB.DAGLink\nconst DAGNode = dagPB.DAGNode\n\nmodule.exports = function (file, ipld, options) {\n  return function (leaves, callback) {\n    if (leaves.length === 1 && (leaves[0].single || options.reduceSingleLeafToSelf)) {\n      const leave = leaves[0]\n      callback(null, {\n        path: file.path,\n        multihash: leave.multihash,\n        size: leave.size,\n        leafSize: leave.leafSize,\n        name: leave.name\n      })\n      return // early\n    }\n\n    // create a parent node and add all the leafs\n    const f = new UnixFS('file')\n\n    const links = leaves.map((leaf) => {\n      f.addBlockSize(leaf.leafSize)\n\n      return new DAGLink(leaf.name, leaf.size, leaf.multihash)\n    })\n\n    waterfall([\n      (cb) => DAGNode.create(f.marshal(), links, options.hashAlg, cb),\n      (node, cb) => {\n        if (options.onlyHash) return cb(null, node)\n\n        let cid = new CID(node.multihash)\n\n        if (options.cidVersion === 1) {\n          cid = cid.toV1()\n        }\n\n        ipld.put(node, { cid }, (err) => cb(err, node))\n      }\n    ], (err, node) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      const root = {\n        name: '',\n        path: file.path,\n        multihash: node.multihash,\n        size: node.size,\n        leafSize: f.fileSize()\n      }\n\n      callback(null, root)\n    })\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/reduce.js\n// module id = 910\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/reduce.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst trickleReducer = __webpack_require__(912)\n\nconst defaultOptions = {\n  maxChildrenPerNode: 174,\n  layerRepeat: 4\n}\n\nmodule.exports = function (reduce, _options) {\n  const options = Object.assign({}, defaultOptions, _options)\n  return trickleReducer(reduce, options)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/trickle/index.js\n// module id = 911\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/trickle/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst pushable = __webpack_require__(54)\nconst batch = __webpack_require__(299)\nconst pullPair = __webpack_require__(205)\nconst through = __webpack_require__(206)\nconst pullWrite = __webpack_require__(207)\nconst pause = __webpack_require__(515)\n\nmodule.exports = function trickleReduceToRoot (reduce, options) {\n  const pair = pullPair()\n  const result = pushable()\n  const pausable = pause(() => {})\n  let pendingResumes = 0\n\n  pull(\n    pair.source,\n    pausable,\n    trickle(0, -1),\n    batch(Infinity),\n    pull.asyncMap(reduce),\n    pull.collect((err, roots) => {\n      if (err) {\n        result.end(err)\n      } else {\n        if (roots.length === 1) {\n          result.push(roots[0])\n          result.end()\n        } else if (roots.length > 1) {\n          result.end(new Error('expected a maximum of 1 roots and got ' + roots.length))\n        } else {\n          result.end()\n        }\n      }\n    })\n  )\n\n  return {\n    sink: pair.sink,\n    source: result\n  }\n\n  function trickle (indent, maxDepth) {\n    let iteration = 0\n    let depth = 0\n    let deeper\n    let aborting = false\n\n    const result = pushable()\n\n    return {\n      source: result,\n      sink: pullWrite(write, null, 1, end)\n    }\n\n    function write (nodes, callback) {\n      let ended = false\n      const node = nodes[0]\n\n      if (depth && !deeper) {\n        deeper = pushable()\n\n        pull(\n          deeper,\n          trickle(indent + 1, depth - 1),\n          through(\n            function (d) {\n              this.queue(d)\n            },\n            function (err) {\n              if (err) {\n                this.emit('error', err)\n                return // early\n              }\n              if (!ended) {\n                ended = true\n                pendingResumes++\n                pausable.pause()\n              }\n              this.queue(null)\n            }\n          ),\n          batch(Infinity),\n          pull.asyncMap(reduce),\n          pull.collect((err, nodes) => {\n            pendingResumes--\n            if (err) {\n              result.end(err)\n              return\n            }\n            nodes.forEach(node => {\n              result.push(node)\n            })\n            iterate()\n          })\n        )\n      }\n\n      if (deeper) {\n        deeper.push(node)\n      } else {\n        result.push(node)\n        iterate()\n      }\n\n      callback()\n    }\n\n    function iterate () {\n      deeper = null\n      iteration++\n      if ((depth === 0 && iteration === options.maxChildrenPerNode) ||\n          (depth > 0 && iteration === options.layerRepeat)) {\n        iteration = 0\n        depth++\n      }\n\n      if ((!aborting && maxDepth >= 0 && depth > maxDepth) ||\n          (aborting && !pendingResumes)) {\n        aborting = true\n        result.end()\n      }\n\n      if (!pendingResumes) {\n        pausable.resume()\n      }\n    }\n\n    function end (err) {\n      if (err) {\n        result.end(err)\n        return\n      }\n      if (deeper) {\n        if (!aborting) {\n          aborting = true\n          deeper.end()\n        }\n      } else {\n        result.end()\n      }\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/builder/trickle/trickle-reducer.js\n// module id = 912\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/builder/trickle/trickle-reducer.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pullBlock = __webpack_require__(1167)\n\nmodule.exports = (options) => {\n  let maxSize = (typeof options === 'number') ? options : options.maxChunkSize\n  return pullBlock(maxSize, { zeroPadding: false, emitEmpty: true })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/chunker/fixed-size.js\n// module id = 913\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/chunker/fixed-size.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst mh = __webpack_require__(32)\n\nmodule.exports = (multihash) => {\n  if (Buffer.isBuffer(multihash)) {\n    return mh.toB58String(multihash)\n  }\n\n  return multihash\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/clean-multihash.js\n// module id = 914\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/clean-multihash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst cat = __webpack_require__(300)\n\n// Logic to export a unixfs directory.\nmodule.exports = dirExporter\n\nfunction dirExporter (node, name, path, pathRest, resolve, size, dag, parent, depth) {\n  const accepts = pathRest[0]\n\n  const dir = {\n    name: name,\n    depth: depth,\n    path: path,\n    hash: node.multihash,\n    size: node.size,\n    type: 'dir'\n  }\n\n  const streams = [\n    pull(\n      pull.values(node.links),\n      pull.map((link) => ({\n        depth: depth + 1,\n        size: link.size,\n        name: link.name,\n        path: path + '/' + link.name,\n        multihash: link.multihash,\n        linkName: link.name,\n        pathRest: pathRest.slice(1),\n        type: 'dir'\n      })),\n      pull.filter((item) => accepts === undefined || item.linkName === accepts),\n      resolve\n    )\n  ]\n\n  // place dir before if not specifying subtree\n  if (!pathRest.length) {\n    streams.unshift(pull.values([dir]))\n  }\n\n  return cat(streams)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/dir-flat.js\n// module id = 915\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/dir-flat.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst cat = __webpack_require__(300)\nconst cleanHash = __webpack_require__(914)\n\n// Logic to export a unixfs directory.\nmodule.exports = shardedDirExporter\n\nfunction shardedDirExporter (node, name, path, pathRest, resolve, size, dag, parent, depth) {\n  let dir\n  if (!parent || (parent.path !== path)) {\n    dir = {\n      name: name,\n      depth: depth,\n      path: path,\n      hash: cleanHash(node.multihash),\n      size: node.size,\n      type: 'dir'\n    }\n  }\n\n  const streams = [\n    pull(\n      pull.values(node.links),\n      pull.map((link) => {\n        // remove the link prefix (2 chars for the bucket index)\n        const p = link.name.substring(2)\n        const pp = p ? path + '/' + p : path\n        let accept = true\n\n        if (p && pathRest.length) {\n          accept = (p === pathRest[0])\n        }\n        if (accept) {\n          return {\n            depth: depth + 1,\n            name: p,\n            path: pp,\n            multihash: link.multihash,\n            pathRest: p ? pathRest.slice(1) : pathRest,\n            parent: dir || parent\n          }\n        } else {\n          return ''\n        }\n      }),\n      pull.filter(Boolean),\n      resolve\n    )\n  ]\n\n  if (!pathRest.length) {\n    streams.unshift(pull.values([dir]))\n  }\n\n  return cat(streams)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/dir-hamt-sharded.js\n// module id = 916\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/dir-hamt-sharded.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst traverse = __webpack_require__(523)\nconst UnixFS = __webpack_require__(95)\nconst CID = __webpack_require__(14)\nconst pull = __webpack_require__(6)\nconst paramap = __webpack_require__(514)\n\n// Logic to export a single (possibly chunked) unixfs file.\nmodule.exports = (node, name, path, pathRest, resolve, size, dag, parent, depth) => {\n  function getData (node) {\n    try {\n      const file = UnixFS.unmarshal(node.data)\n      return file.data || Buffer.alloc(0)\n    } catch (err) {\n      throw new Error('Failed to unmarshal node')\n    }\n  }\n\n  function visitor (node) {\n    return pull(\n      pull.values(node.links),\n      paramap((link, cb) => dag.get(new CID(link.multihash), cb)),\n      pull.map((result) => result.value)\n    )\n  }\n\n  const accepts = pathRest[0]\n\n  if (accepts !== undefined && accepts !== path) {\n    return pull.empty()\n  }\n\n  let content = pull(\n    traverse.depthFirst(node, visitor),\n    pull.map(getData)\n  )\n\n  const file = UnixFS.unmarshal(node.data)\n  return pull.values([{\n    depth: depth,\n    content: content,\n    name: name,\n    path: path,\n    hash: node.multihash,\n    size: size || file.fileSize(),\n    type: 'file'\n  }])\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/file.js\n// module id = 917\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/file.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(6)\nconst CID = __webpack_require__(14)\n\nconst createResolver = __webpack_require__(920).createResolver\n\nfunction pathBaseAndRest (path) {\n  // Buffer -> raw multihash or CID in buffer\n  let pathBase = path\n  let pathRest = '/'\n\n  if (Buffer.isBuffer(path)) {\n    pathBase = (new CID(path)).toBaseEncodedString()\n  }\n\n  if (typeof path === 'string') {\n    if (path.indexOf('/ipfs/') === 0) {\n      path = pathBase = path.substring(6)\n    }\n    const subtreeStart = path.indexOf('/')\n    if (subtreeStart > 0) {\n      pathBase = path.substring(0, subtreeStart)\n      pathRest = path.substring(subtreeStart)\n    }\n  } else if (CID.isCID(pathBase)) {\n    pathBase = pathBase.toBaseEncodedString()\n  }\n\n  pathBase = (new CID(pathBase)).toBaseEncodedString()\n\n  return {\n    base: pathBase,\n    rest: pathRest.split('/').filter(Boolean)\n  }\n}\n\nconst defaultOptions = {\n  maxDepth: Infinity\n}\n\nmodule.exports = (path, dag, _options) => {\n  const options = Object.assign({}, defaultOptions, _options)\n\n  let dPath\n  try {\n    dPath = pathBaseAndRest(path)\n  } catch (err) {\n    return pull.error(err)\n  }\n\n  const pathLengthToCut = join(\n    [dPath.base].concat(dPath.rest.slice(0, dPath.rest.length - 1))).length\n\n  return pull(\n    pull.values([{\n      multihash: new CID(dPath.base),\n      name: dPath.base,\n      path: dPath.base,\n      pathRest: dPath.rest,\n      depth: 0\n    }]),\n    createResolver(dag, options),\n    pull.filter(Boolean),\n    pull.map((node) => {\n      return {\n        depth: node.depth,\n        name: node.name,\n        path: finalPathFor(node),\n        size: node.size,\n        hash: node.hash || node.multihash,\n        content: node.content,\n        type: node.type\n      }\n    })\n  )\n\n  function finalPathFor (node) {\n    if (!dPath.rest.length) {\n      return node.path\n    }\n\n    let retPath = node.path.substring(pathLengthToCut)\n    if (retPath.charAt(0) === '/') {\n      retPath = retPath.substring(1)\n    }\n    if (!retPath) {\n      retPath = dPath.rest[dPath.rest.length - 1] || dPath.base\n    }\n    return retPath\n  }\n}\n\nfunction join (paths) {\n  return paths.reduce((acc, path) => {\n    if (acc.length) {\n      acc += '/'\n    }\n    return acc + path\n  }, '')\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/index.js\n// module id = 918\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst CID = __webpack_require__(14)\nconst pull = __webpack_require__(6)\n\nmodule.exports = (node, name, path, pathRest, resolve, size, dag, parent, depth) => {\n  let newNode\n  if (pathRest.length) {\n    const pathElem = pathRest[0]\n    newNode = node[pathElem]\n    const newName = path + '/' + pathElem\n    if (!newNode) {\n      return pull.error('not found')\n    }\n    const isCID = CID.isCID(newNode)\n    return pull(\n      pull.values([{\n        depth: depth,\n        name: pathElem,\n        path: newName,\n        pathRest: pathRest.slice(1),\n        multihash: isCID && newNode,\n        object: !isCID && newNode,\n        parent: parent\n      }]),\n      resolve)\n  } else {\n    return pull.error(new Error('invalid node type'))\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/object.js\n// module id = 919\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/object.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst UnixFS = __webpack_require__(95)\nconst pull = __webpack_require__(6)\nconst paramap = __webpack_require__(514)\nconst CID = __webpack_require__(14)\n\nconst resolvers = {\n  directory: __webpack_require__(915),\n  'hamt-sharded-directory': __webpack_require__(916),\n  file: __webpack_require__(917),\n  object: __webpack_require__(919)\n}\n\nmodule.exports = Object.assign({\n  createResolver: createResolver,\n  typeOf: typeOf\n}, resolvers)\n\nfunction createResolver (dag, options, depth, parent) {\n  if (!depth) {\n    depth = 0\n  }\n\n  if (depth > options.maxDepth) {\n    return pull.map(identity)\n  }\n\n  return pull(\n    paramap((item, cb) => {\n      if ((typeof item.depth) !== 'number') {\n        return pull.error(new Error('no depth'))\n      }\n      if (item.object) {\n        return cb(null, resolveItem(item.object, item))\n      }\n      dag.get(new CID(item.multihash), (err, node) => {\n        if (err) {\n          return cb(err)\n        }\n        // const name = item.fromPathRest ? item.name : item.path\n        cb(null, resolveItem(node.value, item))\n      })\n    }),\n    pull.flatten(),\n    pull.filter(Boolean),\n    pull.filter((node) => node.depth <= options.maxDepth)\n  )\n\n  function resolveItem (node, item) {\n    return resolve(node, item.name, item.path, item.pathRest, item.size, dag, item.parent || parent, item.depth)\n  }\n\n  function resolve (node, name, path, pathRest, size, dag, parentNode, depth) {\n    const type = typeOf(node)\n    const nodeResolver = resolvers[type]\n    if (!nodeResolver) {\n      return pull.error(new Error('Unkown node type ' + type))\n    }\n    const resolveDeep = createResolver(dag, options, depth, node)\n    return nodeResolver(node, name, path, pathRest, resolveDeep, size, dag, parentNode, depth)\n  }\n}\n\nfunction typeOf (node) {\n  if (Buffer.isBuffer(node.data)) {\n    return UnixFS.unmarshal(node.data).type\n  } else {\n    return 'object'\n  }\n}\n\nfunction identity (o) {\n  return o\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/exporter/resolve.js\n// module id = 920\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/exporter/resolve.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst SparseArray = __webpack_require__(1241)\nconst map = __webpack_require__(128)\nconst eachSeries = __webpack_require__(162)\nconst wrapHash = __webpack_require__(923)\n\nconst defaultOptions = {\n  bits: 8\n}\n\n// TODO: make HAMT a generic NPM package\n\nclass Bucket {\n  constructor (options, parent, posAtParent) {\n    this._options = Object.assign({}, defaultOptions, options)\n    this._popCount = 0\n    this._parent = parent\n    this._posAtParent = posAtParent\n\n    if (!this._options.hashFn) {\n      throw new Error('please define an options.hashFn')\n    }\n\n    // make sure we only wrap options.hashFn once in the whole tree\n    if (!this._options.hash) {\n      this._options.hash = wrapHash(this._options.hashFn)\n    }\n    this._children = new SparseArray()\n  }\n\n  static isBucket (o) {\n    return o instanceof Bucket\n  }\n\n  put (key, value, callback) {\n    this._findNewBucketAndPos(key, (err, place) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      place.bucket._putAt(place, key, value)\n      callback()\n    })\n  }\n\n  get (key, callback) {\n    this._findChild(key, (err, child) => {\n      if (err) {\n        callback(err)\n      } else {\n        callback(null, child && child.value)\n      }\n    })\n  }\n\n  del (key, callback) {\n    this._findPlace(key, (err, place) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n      const child = place.bucket._at(place.pos)\n      if (child && child.key === key) {\n        place.bucket._delAt(place.pos)\n      }\n      callback(null)\n    })\n  }\n\n  leafCount () {\n    this._children.reduce((acc, child) => {\n      if (child instanceof Bucket) {\n        return acc + child.leafCount()\n      }\n      return acc + 1\n    }, 0)\n  }\n\n  childrenCount () {\n    return this._children.length\n  }\n\n  onlyChild (callback) {\n    process.nextTick(() => callback(null, this._children.get(0)))\n  }\n\n  eachLeafSeries (iterator, callback) {\n    eachSeries(\n      this._children.compactArray(),\n      (child, cb) => {\n        if (child instanceof Bucket) {\n          child.eachLeafSeries(iterator, cb)\n        } else {\n          iterator(child.key, child.value, cb)\n        }\n      },\n      callback)\n  }\n\n  serialize (map, reduce) {\n    // serialize to a custom non-sparse representation\n    return reduce(this._children.reduce((acc, child, index) => {\n      if (child) {\n        if (child instanceof Bucket) {\n          acc.push(child.serialize(map, reduce))\n        } else {\n          acc.push(map(child, index))\n        }\n      }\n      return acc\n    }, []))\n  }\n\n  asyncTransform (asyncMap, asyncReduce, callback) {\n    asyncTransformBucket(this, asyncMap, asyncReduce, callback)\n  }\n\n  toJSON () {\n    return this.serialize(mapNode, reduceNodes)\n  }\n\n  prettyPrint () {\n    return JSON.stringify(this.toJSON(), null, '  ')\n  }\n\n  tableSize () {\n    return Math.pow(2, this._options.bits)\n  }\n\n  _findChild (key, callback) {\n    this._findPlace(key, (err, result) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      const child = result.bucket._at(result.pos)\n      if (child && child.key === key) {\n        callback(null, child)\n      } else {\n        callback(null, undefined)\n      }\n    })\n  }\n\n  _findPlace (key, callback) {\n    const hashValue = this._options.hash(key)\n    hashValue.take(this._options.bits, (err, index) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      const child = this._children.get(index)\n      if (child instanceof Bucket) {\n        child._findPlace(hashValue, callback)\n      } else {\n        const place = {\n          bucket: this,\n          pos: index,\n          hash: hashValue\n        }\n        callback(null, place)\n      }\n    })\n  }\n\n  _findNewBucketAndPos (key, callback) {\n    this._findPlace(key, (err, place) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n      const child = place.bucket._at(place.pos)\n      if (child && child.key !== key) {\n        // conflict\n\n        const bucket = new Bucket(this._options, place.bucket, place.pos)\n        place.bucket._putObjectAt(place.pos, bucket)\n\n        // put the previous value\n        bucket._findPlace(child.hash, (err, newPlace) => {\n          if (err) {\n            callback(err)\n            return // early\n          }\n\n          newPlace.bucket._putAt(newPlace, child.key, child.value)\n          bucket._findNewBucketAndPos(place.hash, callback)\n        })\n      } else {\n        // no conflict, we found the place\n        callback(null, place)\n      }\n    })\n  }\n\n  _putAt (place, key, value) {\n    this._putObjectAt(place.pos, {\n      key: key,\n      value: value,\n      hash: place.hash\n    })\n  }\n\n  _putObjectAt (pos, object) {\n    if (!this._children.get(pos)) {\n      this._popCount++\n    }\n    this._children.set(pos, object)\n  }\n\n  _delAt (pos) {\n    if (this._children.get(pos)) {\n      this._popCount--\n    }\n    this._children.unset(pos)\n    this._level()\n  }\n\n  _level () {\n    if (this._parent && this._popCount <= 1) {\n      if (this._popCount === 1) {\n        // remove myself from parent, replacing me with my only child\n        const onlyChild = this._children.find(exists)\n        if (!(onlyChild instanceof Bucket)) {\n          const hash = onlyChild.hash\n          hash.untake(this._options.bits)\n          const place = {\n            pos: this._posAtParent,\n            hash: hash\n          }\n          this._parent._putAt(place, onlyChild.key, onlyChild.value)\n        }\n      } else {\n        this._parent._delAt(this._posAtParent)\n      }\n    }\n  }\n\n  _at (index) {\n    return this._children.get(index)\n  }\n}\n\nfunction exists (o) {\n  return Boolean(o)\n}\n\nfunction mapNode (node, index) {\n  return node.key\n}\n\nfunction reduceNodes (nodes) {\n  return nodes\n}\n\nfunction asyncTransformBucket (bucket, asyncMap, asyncReduce, callback) {\n  map(\n    bucket._children.compactArray(),\n    (child, callback) => {\n      if (child instanceof Bucket) {\n        asyncTransformBucket(child, asyncMap, asyncReduce, callback)\n      } else {\n        asyncMap(child, (err, mappedChildren) => {\n          if (err) {\n            callback(err)\n          } else {\n            callback(null, {\n              bitField: bucket._children.bitField(),\n              children: mappedChildren\n            })\n          }\n        })\n      }\n    },\n    (err, mappedChildren) => {\n      if (err) {\n        callback(err)\n      } else {\n        asyncReduce(mappedChildren, callback)\n      }\n    }\n  )\n}\n\nmodule.exports = Bucket\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/hamt/bucket.js\n// module id = 921\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/hamt/bucket.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst START_MASKS = [\n  0b11111111,\n  0b11111110,\n  0b11111100,\n  0b11111000,\n  0b11110000,\n  0b11100000,\n  0b11000000,\n  0b10000000\n]\n\nconst STOP_MASKS = [\n  0b00000001,\n  0b00000011,\n  0b00000111,\n  0b00001111,\n  0b00011111,\n  0b00111111,\n  0b01111111,\n  0b11111111\n]\n\nmodule.exports = class ConsumableBuffer {\n  constructor (value) {\n    this._value = value\n    this._currentBytePos = value.length - 1\n    this._currentBitPos = 7\n  }\n\n  availableBits () {\n    return this._currentBitPos + 1 + this._currentBytePos * 8\n  }\n\n  totalBits () {\n    return this._value.length * 8\n  }\n\n  take (bits) {\n    let pendingBits = bits\n    let result = 0\n    while (pendingBits && this._haveBits()) {\n      const byte = this._value[this._currentBytePos]\n      const availableBits = this._currentBitPos + 1\n      const taking = Math.min(availableBits, pendingBits)\n      const value = byteBitsToInt(byte, availableBits - taking, taking)\n      result = (result << taking) + value\n\n      pendingBits -= taking\n\n      this._currentBitPos -= taking\n      if (this._currentBitPos < 0) {\n        this._currentBitPos = 7\n        this._currentBytePos--\n      }\n    }\n\n    return result\n  }\n\n  untake (bits) {\n    this._currentBitPos += bits\n    while (this._currentBitPos > 7) {\n      this._currentBitPos -= 8\n      this._currentBytePos += 1\n    }\n  }\n\n  _haveBits () {\n    return this._currentBytePos >= 0\n  }\n}\n\nfunction byteBitsToInt (byte, start, length) {\n  const mask = maskFor(start, length)\n  return (byte & mask) >>> start\n}\n\nfunction maskFor (start, length) {\n  return START_MASKS[start] & STOP_MASKS[Math.min(length + start - 1, 7)]\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/hamt/consumable-buffer.js\n// module id = 922\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/hamt/consumable-buffer.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {\n\nconst whilst = __webpack_require__(164)\nconst ConsumableBuffer = __webpack_require__(922)\n\nmodule.exports = function wrapHash (hashFn) {\n  return function hashing (value) {\n    if (value instanceof InfiniteHash) {\n      // already a hash. return it\n      return value\n    } else {\n      return new InfiniteHash(value, hashFn)\n    }\n  }\n}\n\nclass InfiniteHash {\n  constructor (value, hashFn) {\n    if ((typeof value) !== 'string' && !Buffer.isBuffer(value)) {\n      throw new Error('can only hash strings or buffers')\n    }\n    this._value = value\n    this._hashFn = hashFn\n    this._depth = -1\n    this._availableBits = 0\n    this._currentBufferIndex = 0\n    this._buffers = []\n  }\n\n  take (bits, callback) {\n    let pendingBits = bits\n    whilst(\n      () => this._availableBits < pendingBits,\n      (callback) => {\n        this._produceMoreBits(callback)\n      },\n      (err) => {\n        if (err) {\n          callback(err)\n          return // early\n        }\n\n        let result = 0\n\n        // TODO: this is sync, no need to use whilst\n        whilst(\n          () => pendingBits > 0,\n          (callback) => {\n            const hash = this._buffers[this._currentBufferIndex]\n            const available = Math.min(hash.availableBits(), pendingBits)\n            const took = hash.take(available)\n            result = (result << available) + took\n            pendingBits -= available\n            this._availableBits -= available\n            if (hash.availableBits() === 0) {\n              this._currentBufferIndex++\n            }\n            callback()\n          },\n          (err) => {\n            if (err) {\n              callback(err)\n              return // early\n            }\n\n            process.nextTick(() => callback(null, result))\n          }\n        )\n      }\n    )\n  }\n\n  untake (bits) {\n    let pendingBits = bits\n    while (pendingBits > 0) {\n      const hash = this._buffers[this._currentBufferIndex]\n      const availableForUntake = Math.min(hash.totalBits() - hash.availableBits(), pendingBits)\n      hash.untake(availableForUntake)\n      pendingBits -= availableForUntake\n      this._availableBits += availableForUntake\n      if (this._currentBufferIndex > 0 && hash.totalBits() === hash.availableBits()) {\n        this._depth--\n        this._currentBufferIndex--\n      }\n    }\n  }\n\n  _produceMoreBits (callback) {\n    this._depth++\n    const value = this._depth ? this._value + this._depth : this._value\n    this._hashFn(value, (err, hashValue) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n\n      const buffer = new ConsumableBuffer(hashValue)\n      this._buffers.push(buffer)\n      this._availableBits += buffer.availableBits()\n      callback()\n    })\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/hamt/consumable-hash.js\n// module id = 923\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/hamt/consumable-hash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Bucket = __webpack_require__(921)\n\nmodule.exports = function createHAMT (options) {\n  return new Bucket(options)\n}\n\nmodule.exports.isBucket = Bucket.isBucket\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/hamt/index.js\n// module id = 924\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/hamt/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst asyncEachSeries = __webpack_require__(162)\nconst waterfall = __webpack_require__(12)\nconst CID = __webpack_require__(14)\nconst dagPB = __webpack_require__(121)\nconst UnixFS = __webpack_require__(95)\nconst DAGLink = dagPB.DAGLink\nconst DAGNode = dagPB.DAGNode\nconst Dir = __webpack_require__(268)\n\nclass DirFlat extends Dir {\n  constructor (props, _options) {\n    super(props, _options)\n    this._children = {}\n  }\n\n  put (name, value, callback) {\n    this.multihash = undefined\n    this.size = undefined\n    this._children[name] = value\n    process.nextTick(callback)\n  }\n\n  get (name, callback) {\n    process.nextTick(() => callback(null, this._children[name]))\n  }\n\n  childCount () {\n    return Object.keys(this._children).length\n  }\n\n  directChildrenCount () {\n    return this.childCount()\n  }\n\n  onlyChild (callback) {\n    process.nextTick(() => callback(null, this._children[Object.keys(this._children)[0]]))\n  }\n\n  eachChildSeries (iterator, callback) {\n    asyncEachSeries(\n      Object.keys(this._children),\n      (key, callback) => {\n        iterator(key, this._children[key], callback)\n      },\n      callback\n    )\n  }\n\n  flush (path, ipld, source, callback) {\n    const links = Object.keys(this._children)\n      .map((key) => {\n        const child = this._children[key]\n        return new DAGLink(key, child.size, child.multihash)\n      })\n\n    const dir = new UnixFS('directory')\n    const options = this._options\n\n    waterfall(\n      [\n        (callback) => DAGNode.create(dir.marshal(), links, options.hashAlg, callback),\n        (node, callback) => {\n          if (options.onlyHash) return callback(null, node)\n\n          let cid = new CID(node.multihash)\n\n          if (options.cidVersion === 1) {\n            cid = cid.toV1()\n          }\n\n          ipld.put(node, { cid }, (err) => callback(err, node))\n        },\n        (node, callback) => {\n          this.multihash = node.multihash\n          this.size = node.size\n          const pushable = {\n            path: path,\n            multihash: node.multihash,\n            size: node.size\n          }\n          source.push(pushable)\n          callback(null, node)\n        }\n      ],\n      callback)\n  }\n}\n\nmodule.exports = createDirFlat\n\nfunction createDirFlat (props, _options) {\n  return new DirFlat(props, _options)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/dir-flat.js\n// module id = 925\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/dir-flat.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst leftPad = __webpack_require__(432)\nconst whilst = __webpack_require__(164)\nconst waterfall = __webpack_require__(12)\nconst CID = __webpack_require__(14)\nconst dagPB = __webpack_require__(121)\nconst UnixFS = __webpack_require__(95)\nconst DAGLink = dagPB.DAGLink\nconst DAGNode = dagPB.DAGNode\nconst multihashing = __webpack_require__(49)\nconst Dir = __webpack_require__(268)\n\nconst Bucket = __webpack_require__(924)\n\nconst hashFn = function (value, callback) {\n  multihashing(value, 'murmur3-128', (err, hash) => {\n    if (err) {\n      callback(err)\n    } else {\n      // Multihashing inserts preamble of 2 bytes. Remove it.\n      // Also, murmur3 outputs 128 bit but, accidently, IPFS Go's\n      // implementation only uses the first 64, so we must do the same\n      // for parity..\n      const justHash = hash.slice(2, 10)\n      const length = justHash.length\n      const result = Buffer.alloc(length)\n      // TODO: invert buffer because that's how Go impl does it\n      for (let i = 0; i < length; i++) {\n        result[length - i - 1] = justHash[i]\n      }\n      callback(null, result)\n    }\n  })\n}\nhashFn.code = 0x22 // TODO: get this from multihashing-async?\n\nconst defaultOptions = {\n  hashFn: hashFn\n}\n\nclass DirSharded extends Dir {\n  constructor (props, _options) {\n    const options = Object.assign({}, defaultOptions, _options)\n    super(props, options)\n    this._bucket = Bucket(options)\n  }\n\n  put (name, value, callback) {\n    this._bucket.put(name, value, callback)\n  }\n\n  get (name, callback) {\n    this._bucket.get(name, callback)\n  }\n\n  childCount () {\n    return this._bucket.leafCount()\n  }\n\n  directChildrenCount () {\n    return this._bucket.childrenCount()\n  }\n\n  onlyChild (callback) {\n    this._bucket.onlyChild(callback)\n  }\n\n  eachChildSeries (iterator, callback) {\n    this._bucket.eachLeafSeries(iterator, callback)\n  }\n\n  flush (path, ipld, source, callback) {\n    flush(this._options, this._bucket, path, ipld, source, (err, node) => {\n      if (err) {\n        callback(err)\n      } else {\n        this.multihash = node.multihash\n        this.size = node.size\n      }\n      callback(null, node)\n    })\n  }\n}\n\nmodule.exports = createDirSharded\n\nfunction createDirSharded (props, _options) {\n  return new DirSharded(props, _options)\n}\n\nfunction flush (options, bucket, path, ipld, source, callback) {\n  const children = bucket._children // TODO: intromission\n  let index = 0\n  const links = []\n  whilst(\n    () => index < children.length,\n    (callback) => {\n      const child = children.get(index)\n      if (child) {\n        collectChild(child, index, (err) => {\n          index++\n          callback(err)\n        })\n      } else {\n        index++\n        callback()\n      }\n    },\n    (err) => {\n      if (err) {\n        callback(err)\n        return // early\n      }\n      haveLinks(links)\n    }\n  )\n\n  function collectChild (child, index, callback) {\n    const labelPrefix = leftPad(index.toString(16).toUpperCase(), 2, '0')\n    if (Bucket.isBucket(child)) {\n      flush(options, child, path, ipld, null, (err, node) => {\n        if (err) {\n          callback(err)\n          return // early\n        }\n        links.push(new DAGLink(labelPrefix, node.size, node.multihash))\n        callback()\n      })\n    } else {\n      const value = child.value\n      const label = labelPrefix + child.key\n      links.push(new DAGLink(label, value.size, value.multihash))\n      callback()\n    }\n  }\n\n  function haveLinks (links) {\n    // go-ipfs uses little endian, that's why we have to\n    // reverse the bit field before storing it\n    const data = Buffer.from(children.bitField().reverse())\n    const dir = new UnixFS('hamt-sharded-directory', data)\n    dir.fanout = bucket.tableSize()\n    dir.hashType = options.hashFn.code\n    waterfall(\n      [\n        (callback) => DAGNode.create(dir.marshal(), links, options.hashAlg, callback),\n        (node, callback) => {\n          if (options.onlyHash) return callback(null, node)\n\n          let cid = new CID(node.multihash)\n\n          if (options.cidVersion === 1) {\n            cid = cid.toV1()\n          }\n\n          ipld.put(node, { cid }, (err) => callback(err, node))\n        },\n        (node, callback) => {\n          const pushable = {\n            path: path,\n            multihash: node.multihash,\n            size: node.size\n          }\n          if (source) {\n            source.push(pushable)\n          }\n          callback(null, node)\n        }\n      ],\n      callback)\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/dir-sharded.js\n// module id = 926\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/dir-sharded.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst waterfall = __webpack_require__(12)\nconst DirSharded = __webpack_require__(926)\n\nmodule.exports = flatToShard\n\nfunction flatToShard (child, dir, threshold, options, callback) {\n  maybeFlatToShardOne(dir, threshold, options, (err, newDir) => {\n    if (err) {\n      callback(err)\n      return // early\n    }\n\n    const parent = newDir.parent\n    if (parent) {\n      waterfall([\n        (callback) => {\n          if (newDir !== dir) {\n            if (child) {\n              child.parent = newDir\n            }\n            parent.put(newDir.parentKey, newDir, callback)\n          } else {\n            callback()\n          }\n        },\n        (callback) => {\n          if (parent) {\n            flatToShard(newDir, parent, threshold, options, callback)\n          } else {\n            callback(null, newDir)\n          }\n        }\n      ], callback)\n    } else {\n      // no parent, we're done climbing tree\n      callback(null, newDir)\n    }\n  })\n}\n\nfunction maybeFlatToShardOne (dir, threshold, options, callback) {\n  if (dir.flat && dir.directChildrenCount() >= threshold) {\n    definitelyShardOne(dir, options, callback)\n  } else {\n    callback(null, dir)\n  }\n}\n\nfunction definitelyShardOne (oldDir, options, callback) {\n  const newDir = DirSharded({\n    root: oldDir.root,\n    dir: true,\n    parent: oldDir.parent,\n    parentKey: oldDir.parentKey,\n    path: oldDir.path,\n    dirty: oldDir.dirty,\n    flat: false\n  }, options)\n\n  oldDir.eachChildSeries(\n    (key, value, callback) => {\n      newDir.put(key, value, callback)\n    },\n    (err) => {\n      if (err) {\n        callback(err)\n      } else {\n        callback(err, newDir)\n      }\n    }\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/flat-to-shard.js\n// module id = 927\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/flat-to-shard.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst pause = __webpack_require__(515)\nconst pull = __webpack_require__(6)\nconst writable = __webpack_require__(207)\nconst pushable = __webpack_require__(54)\nconst assert = __webpack_require__(16)\nconst setImmediate = __webpack_require__(8)\nconst DAGBuilder = __webpack_require__(909)\nconst createTreeBuilder = __webpack_require__(929)\n\nconst chunkers = {\n  fixed: __webpack_require__(913)\n}\n\nconst defaultOptions = {\n  chunker: 'fixed'\n}\n\nmodule.exports = function (ipld, _options) {\n  const options = Object.assign({}, defaultOptions, _options)\n  const Chunker = chunkers[options.chunker]\n  assert(Chunker, 'Unknkown chunker named ' + options.chunker)\n\n  let pending = 0\n  const waitingPending = []\n\n  const entry = {\n    sink: writable(\n      (nodes, callback) => {\n        pending += nodes.length\n        nodes.forEach((node) => entry.source.push(node))\n        setImmediate(callback)\n      },\n      null,\n      1,\n      (err) => entry.source.end(err)\n    ),\n    source: pushable()\n  }\n\n  const dagStream = DAGBuilder(Chunker, ipld, options)\n\n  const treeBuilder = createTreeBuilder(ipld, options)\n  const treeBuilderStream = treeBuilder.stream()\n  const pausable = pause(() => {})\n\n  // TODO: transform this entry -> pausable -> <custom async transform> -> exit\n  // into a generic NPM package named something like pull-pause-and-drain\n\n  pull(\n    entry,\n    pausable,\n    dagStream,\n    pull.map((node) => {\n      pending--\n      if (!pending) {\n        process.nextTick(() => {\n          while (waitingPending.length) {\n            waitingPending.shift()()\n          }\n        })\n      }\n      return node\n    }),\n    treeBuilderStream\n  )\n\n  return {\n    sink: entry.sink,\n    source: treeBuilderStream.source,\n    flush: flush\n  }\n\n  function flush (callback) {\n    pausable.pause()\n\n    // wait until all the files entered were\n    // transformed into DAG nodes\n    if (!pending) {\n      proceed()\n    } else {\n      waitingPending.push(proceed)\n    }\n\n    function proceed () {\n      treeBuilder.flush((err, hash) => {\n        if (err) {\n          treeBuilderStream.source.end(err)\n          callback(err)\n          return\n        }\n        pausable.resume()\n        callback(null, hash)\n      })\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/index.js\n// module id = 928\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nconst eachSeries = __webpack_require__(162)\nconst eachOfSeries = __webpack_require__(327)\nconst waterfall = __webpack_require__(12)\nconst createQueue = __webpack_require__(223)\nconst writable = __webpack_require__(207)\nconst pushable = __webpack_require__(54)\nconst DirFlat = __webpack_require__(925)\nconst flatToShard = __webpack_require__(927)\nconst Dir = __webpack_require__(268)\n\nmodule.exports = createTreeBuilder\n\nconst defaultOptions = {\n  wrap: false,\n  shardSplitThreshold: 1000,\n  onlyHash: false\n}\n\nfunction createTreeBuilder (ipld, _options) {\n  const options = Object.assign({}, defaultOptions, _options)\n\n  const queue = createQueue(consumeQueue, 1)\n  // returned stream\n  let stream = createStream()\n\n  // root node\n  let tree = DirFlat({\n    path: '',\n    root: true,\n    dir: true,\n    dirty: false,\n    flat: true\n  }, options)\n\n  return {\n    flush: flushRoot,\n    stream: getStream\n  }\n\n  function consumeQueue (action, callback) {\n    const args = action.args.concat(function () {\n      action.cb.apply(null, arguments)\n      callback()\n    })\n    action.fn.apply(null, args)\n  }\n\n  function getStream () {\n    return stream\n  }\n\n  function createStream () {\n    const sink = writable(write, null, 1, ended)\n    const source = pushable()\n\n    return {\n      sink: sink,\n      source: source\n    }\n\n    function write (elems, callback) {\n      eachSeries(\n        elems,\n        (elem, callback) => {\n          queue.push({\n            fn: addToTree,\n            args: [elem],\n            cb: (err) => {\n              if (err) {\n                callback(err)\n              } else {\n                source.push(elem)\n                callback()\n              }\n            }\n          })\n        },\n        callback\n      )\n    }\n\n    function ended (err) {\n      flushRoot((flushErr) => {\n        source.end(flushErr || err)\n      })\n    }\n  }\n\n  // ---- Add to tree\n\n  function addToTree (elem, callback) {\n    const pathElems = (elem.path || '').split('/').filter(notEmpty)\n    let parent = tree\n    const lastIndex = pathElems.length - 1\n\n    let currentPath = ''\n    eachOfSeries(pathElems, (pathElem, index, callback) => {\n      if (currentPath) {\n        currentPath += '/'\n      }\n      currentPath += pathElem\n      const last = (index === lastIndex)\n      parent.dirty = true\n      parent.multihash = null\n      parent.size = null\n\n      if (last) {\n        waterfall([\n          (callback) => parent.put(pathElem, elem, callback),\n          (callback) => flatToShard(null, parent, options.shardSplitThreshold, options, callback),\n          (newRoot, callback) => {\n            tree = newRoot\n            callback()\n          }\n        ], callback)\n      } else {\n        parent.get(pathElem, (err, treeNode) => {\n          if (err) {\n            callback(err)\n            return // early\n          }\n          let dir = treeNode\n          if (!dir || !(dir instanceof Dir)) {\n            dir = DirFlat({\n              dir: true,\n              parent: parent,\n              parentKey: pathElem,\n              path: currentPath,\n              dirty: true,\n              flat: true\n            }, options)\n          }\n          const parentDir = parent\n          parent = dir\n          parentDir.put(pathElem, dir, callback)\n        })\n      }\n    }, callback)\n  }\n\n  // ---- Flush\n\n  function flushRoot (callback) {\n    queue.push({\n      fn: flush,\n      args: ['', tree],\n      cb: (err, node) => {\n        if (err) {\n          callback(err)\n        } else {\n          callback(null, node && node.multihash)\n        }\n      }\n    })\n  }\n\n  function flush (path, tree, callback) {\n    if (tree.dir) {\n      if (tree.root && tree.childCount() > 1 && !options.wrap) {\n        callback(new Error('detected more than one root'))\n        return // early\n      }\n      tree.eachChildSeries(\n        (key, child, callback) => {\n          flush(path ? (path + '/' + key) : key, child, callback)\n        },\n        (err) => {\n          if (err) {\n            callback(err)\n            return // early\n          }\n          flushDir(path, tree, callback)\n        })\n    } else {\n      // leaf node, nothing to do here\n      process.nextTick(callback)\n    }\n  }\n\n  function flushDir (path, tree, callback) {\n    // don't create a wrapping node unless the user explicitely said so\n    if (tree.root && !options.wrap) {\n      tree.onlyChild((err, onlyChild) => {\n        if (err) {\n          callback(err)\n          return // early\n        }\n\n        callback(null, onlyChild)\n      })\n\n      return // early\n    }\n\n    if (!tree.dirty) {\n      callback(null, tree.multihash)\n      return // early\n    }\n\n    // don't flush directory unless it's been modified\n\n    tree.dirty = false\n    tree.flush(path, ipld, stream.source, (err, node) => {\n      if (err) {\n        callback(err)\n      } else {\n        callback(null, node)\n      }\n    })\n  }\n}\n\nfunction notEmpty (str) {\n  return Boolean(str)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/importer/tree-builder.js\n// module id = 929\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/importer/tree-builder.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.importer = exports.Importer = __webpack_require__(928)\nexports.exporter = exports.Exporter = __webpack_require__(918)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs-engine/src/index.js\n// module id = 930\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs-engine/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = `message Data {\n  enum DataType {\n    Raw = 0;\n    Directory = 1;\n    File = 2;\n    Metadata = 3;\n    Symlink = 4;\n    HAMTShard = 5;\n  }\n\n  required DataType Type = 1;\n  optional bytes Data = 2;\n  optional uint64 filesize = 3;\n  repeated uint64 blocksizes = 4;\n\n  optional uint64 hashType = 5;\n  optional uint64 fanout = 6;\n}\n\nmessage Metadata {\n  optional string MimeType = 1;\n}`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipfs-unixfs/src/unixfs.proto.js\n// module id = 931\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipfs-unixfs/src/unixfs.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.resolver = __webpack_require__(933)\nexports.util = __webpack_require__(416)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-bitcoin/src/index.js\n// module id = 932\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-bitcoin/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst util = __webpack_require__(416)\n\n/**\n * @callback ResolveCallback\n * @param {?Error} error - Error if path can't be resolved\n * @param {Object} result - Result of the path it it was resolved successfully\n * @param {*} result.value - Value the path resolves to\n * @param {string} result.remainderPath - If the path resolves half-way to a\n *   link, then the `remainderPath` is the part after the link that can be used\n *   for further resolving.\n */\n/**\n * Resolves a path in a Bitcoin block.\n *\n * Returns the value or a link and the partial mising path. This way the\n * IPLD Resolver can fetch the link and continue to resolve.\n *\n * @param {Buffer} binaryBlob - Binary representation of a Bitcoin block\n * @param {string} [path='/'] - Path that should be resolved\n * @param {ResolveCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst resolve = (binaryBlob, path, callback) => {\n  if (typeof path === 'function') {\n    callback = path\n    path = undefined\n  }\n\n  util.deserialize(binaryBlob, (err, dagNode) => {\n    if (err) {\n      return callback(err)\n    }\n\n    // Return the deserialized block if no path is given\n    if (!path) {\n      return callback(null, {\n        value: dagNode,\n        remainderPath: ''\n      })\n    }\n\n    const pathArray = path.split('/')\n    const value = resolveField(dagNode, pathArray[0])\n    if (value === null) {\n      return callback(new Error('No such path'), null)\n    }\n\n    let remainderPath = pathArray.slice(1).join('/')\n    // It is a link, hence it may have a remainder\n    if (value['/'] !== undefined) {\n      return callback(null, {\n        value: value,\n        remainderPath: remainderPath\n      })\n    } else {\n      if (remainderPath.length > 0) {\n        return callback(new Error('No such path'), null)\n      } else {\n        return callback(null, {\n          value: value,\n          remainderPath: ''\n        })\n      }\n    }\n  })\n}\n\n/**\n * @callback TreeCallback\n * @param {?Error} error - Error if paths can't be retreived\n * @param {string[] | Object.<string, *>[]} result - The result depends on\n *   `options.values`, whether it returns only the paths, or the paths with\n *   the corresponding values\n */\n/**\n * Return all available paths of a block.\n *\n * @param {Buffer} binaryBlob - Binary representation of a Bitcoin block\n * @param {Object} [options] - Possible options\n * @param {boolean} [options.values=false] - Retun only the paths by default.\n *   If it is `true` also return the values\n * @param {TreeCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst tree = (binaryBlob, options, callback) => {\n  if (typeof options === 'function') {\n    callback = options\n    options = undefined\n  }\n  options = options || {}\n\n  util.deserialize(binaryBlob, (err, dagNode) => {\n    if (err) {\n      return callback(err)\n    }\n\n    const paths = ['version', 'timestamp', 'difficulty', 'nonce',\n      'parent', 'tx']\n\n    if (options.values === true) {\n      const pathValues = {}\n      for (let path of paths) {\n        pathValues[path] = resolveField(dagNode, path)\n      }\n      return callback(null, pathValues)\n    } else {\n      return callback(null, paths)\n    }\n  })\n}\n\n// Return top-level fields. Returns `null` if field doesn't exist\nconst resolveField = (dagNode, field) => {\n  switch (field) {\n    case 'version':\n      return dagNode.version\n    case 'timestamp':\n      return dagNode.timestamp\n    case 'difficulty':\n      return dagNode.bits\n    case 'nonce':\n      return dagNode.nonce\n    case 'parent':\n      return {'/': util.hashToCid(dagNode.prevHash)}\n    case 'tx':\n      return {'/': util.hashToCid(dagNode.merkleRoot)}\n    default:\n      return null\n  }\n}\n\nmodule.exports = {\n  multicodec: 'bitcoin-block',\n  resolve: resolve,\n  tree: tree\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-bitcoin/src/resolver.js\n// module id = 933\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-bitcoin/src/resolver.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.util = __webpack_require__(418)\nexports.resolver = __webpack_require__(417)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-cbor/src/index.js\n// module id = 934\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-cbor/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst DAGLink = __webpack_require__(96)\n\nfunction create (name, size, multihash, callback) {\n  const link = new DAGLink(name, size, multihash)\n  callback(null, link)\n}\n\nmodule.exports = create\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-link/create.js\n// module id = 935\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-link/create.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst DAGLink = __webpack_require__(96)\n\nfunction isDagLink (link) {\n  return link && link.constructor && link.constructor.name === 'DAGLink'\n}\n\nfunction createDagLinkFromB58EncodedHash (link) {\n  return new DAGLink(\n    link.name ? link.name : link.Name,\n    link.size ? link.size : link.Size,\n    link.hash || link.Hash || link.multihash\n  )\n}\n\nexports = module.exports\nexports.isDagLink = isDagLink\nexports.createDagLinkFromB58EncodedHash = createDagLinkFromB58EncodedHash\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-link/util.js\n// module id = 936\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-link/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst dagNodeUtil = __webpack_require__(190)\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst toDAGLink = dagNodeUtil.toDAGLink\nconst DAGLink = __webpack_require__(96)\nconst create = __webpack_require__(189)\n\nfunction addLink (node, link, callback) {\n  const links = cloneLinks(node)\n  const data = cloneData(node)\n\n  if ((link.constructor && link.constructor.name === 'DAGLink')) {\n    // It's a DAGLink instance\n    // no need to do anything\n  } else if (link.constructor && link.constructor.name === 'DAGNode') {\n    // It's a DAGNode instance\n    // convert to link\n    link = toDAGLink(link)\n  } else {\n    // It's a Object with name, multihash/link and size\n    link.multihash = link.multihash || link.hash\n    try {\n      link = new DAGLink(link.name, link.size, link.multihash)\n    } catch (err) {\n      return callback(err)\n    }\n  }\n\n  links.push(link)\n  create(data, links, callback)\n}\n\nmodule.exports = addLink\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/addLink.js\n// module id = 937\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/addLink.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst dagNodeUtil = __webpack_require__(190)\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst create = __webpack_require__(189)\n\nfunction clone (dagNode, callback) {\n  const data = cloneData(dagNode)\n  const links = cloneLinks(dagNode)\n  create(data, links, callback)\n}\n\nmodule.exports = clone\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/clone.js\n// module id = 938\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/clone.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst dagNodeUtil = __webpack_require__(190)\nconst cloneLinks = dagNodeUtil.cloneLinks\nconst cloneData = dagNodeUtil.cloneData\nconst create = __webpack_require__(189)\n\nfunction rmLink (dagNode, nameOrMultihash, callback) {\n  const data = cloneData(dagNode)\n  let links = cloneLinks(dagNode)\n\n  if (typeof nameOrMultihash === 'string') {\n    links = links.filter((link) => link.name !== nameOrMultihash)\n  } else if (Buffer.isBuffer(nameOrMultihash)) {\n    links = links.filter((link) => !link.multihash.equals(nameOrMultihash))\n  } else {\n    return callback(new Error('second arg needs to be a name or multihash'), null)\n  }\n\n  create(data, links, callback)\n}\n\nmodule.exports = rmLink\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag-node/rmLink.js\n// module id = 939\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag-node/rmLink.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = `// An IPFS MerkleDAG Link\nmessage PBLink {\n\n  // multihash of the target object\n  optional bytes Hash = 1;\n\n  // utf string name. should be unique per object\n  optional string Name = 2;\n\n  // cumulative size of target object\n  optional uint64 Tsize = 3;\n}\n\n// An IPFS MerkleDAG Node\nmessage PBNode {\n\n  // refs to other objects\n  repeated PBLink Links = 2;\n\n  // opaque user data\n  optional bytes Data = 1;\n}`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/dag.proto.js\n// module id = 940\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/dag.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst waterfall = __webpack_require__(12)\nconst CID = __webpack_require__(14)\n\nconst util = __webpack_require__(270)\n\nexports = module.exports\nexports.multicodec = 'dag-pb'\n\n/*\n * resolve: receives a path and a binary blob and returns the value on path,\n * throw if not possible. `binaryBlob` is the ProtocolBuffer encoded data.\n */\nexports.resolve = (binaryBlob, path, callback) => {\n  waterfall([\n    (cb) => util.deserialize(binaryBlob, cb),\n    (node, cb) => {\n      // Return the deserialized block if no path is given\n      if (!path) {\n        return callback(null, {\n          value: node,\n          remainderPath: ''\n        })\n      }\n\n      const split = path.split('/')\n\n      if (split[0] === 'Links') {\n        let remainderPath = ''\n\n        // all links\n        if (!split[1]) {\n          return cb(null, {\n            value: node.links.map((l) => l.toJSON()),\n            remainderPath: ''\n          })\n        }\n\n        // select one link\n\n        const values = {}\n\n        // populate both index number and name to enable both cases\n        // for the resolver\n        node.links.forEach((l, i) => {\n          const link = l.toJSON()\n          values[i] = {\n            hash: link.multihash,\n            name: link.name,\n            size: link.size\n          }\n          // TODO by enabling something to resolve through link name, we are\n          // applying a transformation (a view) to the data, confirm if this\n          // is exactly what we want\n          values[link.name] = link.multihash\n        })\n\n        let value = values[split[1]]\n\n        // if remainderPath exists, value needs to be CID\n        if (split[2] === 'Hash') {\n          value = { '/': value.hash }\n        } else if (split[2] === 'Tsize') {\n          value = { '/': value.size }\n        } else if (split[2] === 'Name') {\n          value = { '/': value.name }\n        }\n\n        remainderPath = split.slice(3).join('/')\n\n        cb(null, { value: value, remainderPath: remainderPath })\n      } else if (split[0] === 'Data') {\n        cb(null, { value: node.data, remainderPath: '' })\n      } else {\n        cb(new Error('path not available'))\n      }\n    }\n  ], callback)\n}\n\n/*\n * tree: returns a flattened array with paths: values of the project. options\n * is an object that can carry several options (i.e. nestness)\n */\nexports.tree = (binaryBlob, options, callback) => {\n  if (typeof options === 'function') {\n    callback = options\n    options = {}\n  }\n\n  options = options || {}\n\n  util.deserialize(binaryBlob, (err, node) => {\n    if (err) {\n      return callback(err)\n    }\n\n    const paths = []\n\n    paths.push('Links')\n\n    node.links.forEach((link, i) => {\n      paths.push(`Links/${i}/Name`)\n      paths.push(`Links/${i}/Tsize`)\n      paths.push(`Links/${i}/Hash`)\n    })\n\n    paths.push('Data')\n\n    callback(null, paths)\n  })\n}\n\n/*\n * isLink: returns the Link if a given path in a binary blob is a Link,\n * false otherwise\n */\nexports.isLink = (binaryBlob, path, callback) => {\n  exports.resolve(binaryBlob, path, (err, result) => {\n    if (err) {\n      return callback(err)\n    }\n\n    if (result.remainderPath.length > 0) {\n      return callback(new Error('path out of scope'))\n    }\n\n    if (typeof result.value === 'object' && result.value['/']) {\n      let valid\n      try {\n        valid = CID.isCID(new CID(result.value['/']))\n      } catch (err) {\n        valid = false\n      }\n      if (valid) {\n        return callback(null, result.value)\n      }\n    }\n\n    callback(null, false)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-dag-pb/src/resolver.js\n// module id = 941\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-dag-pb/src/resolver.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst waterfall = __webpack_require__(12)\nconst each = __webpack_require__(41)\nconst asyncify = __webpack_require__(161)\nconst RLP = __webpack_require__(155)\nconst EthBlockHead = __webpack_require__(407)\nconst multihash = __webpack_require__(49)\nconst cidFromHash = __webpack_require__(142)\nconst ethBlockResolver = __webpack_require__(420).resolver\nconst createResolver = __webpack_require__(144)\n\nconst ethBlockListResolver = createResolver('eth-block-list', undefined, mapFromEthObj)\nconst util = ethBlockListResolver.util\nutil.serialize = asyncify((ethBlockList) => {\n  const rawOmmers = ethBlockList.map((ethBlock) => ethBlock.raw)\n  return RLP.encode(rawOmmers)\n})\nutil.deserialize = asyncify((serialized) => {\n  const rawOmmers = RLP.decode(serialized)\n  return rawOmmers.map((rawBlock) => new EthBlockHead(rawBlock))\n})\nutil.cid = (blockList, callback) => {\n  waterfall([\n    (cb) => util.serialize(blockList, cb),\n    (data, cb) => multihash.digest(data, 'keccak-256', cb),\n    asyncify((mhash) => cidFromHash('eth-block-list', mhash))\n  ], callback)\n}\n\nmodule.exports = ethBlockListResolver\n\n\nfunction mapFromEthObj (ethBlockList, options, callback) {\n  let paths = []\n\n  // external links (none)\n\n  // external links as data (none)\n\n  // helpers\n\n  paths.push({\n    path: 'count',\n    value: ethBlockList.length\n  })\n\n  // internal data\n\n  // add paths for each block\n  each(ethBlockList, (ethBlock, next) => {\n    const index = ethBlockList.indexOf(ethBlock)\n    const blockPath = index.toString()\n    // block root\n    paths.push({\n      path: blockPath,\n      value: ethBlock\n    })\n    // block children\n    ethBlockResolver._mapFromEthObject(ethBlock, {}, (err, subpaths) => {\n      if (err) return next(err)\n      // append blockPath to each subpath\n      subpaths.forEach((path) => path.path = blockPath + '/' + path.path)\n      paths = paths.concat(subpaths)\n      next()\n    })\n  }, (err) => {\n    if (err) return callback(err)\n    callback(null, paths)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-block-list/index.js\n// module id = 942\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-block-list/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n/* eslint max-nested-callbacks: [\"error\", 5] */\n\nconst ethAccountSnapshotResolver = __webpack_require__(419)\nconst createTrieResolver = __webpack_require__(271)\n\nconst ethStateTrieResolver = createTrieResolver('eth-state-trie', ethAccountSnapshotResolver)\n\nmodule.exports = ethStateTrieResolver\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-state-trie/index.js\n// module id = 943\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-state-trie/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n/* eslint max-nested-callbacks: [\"error\", 5] */\n\nconst createTrieResolver = __webpack_require__(271)\n\nconst ethStorageTrieResolver = createTrieResolver('eth-storage-trie')\n\nmodule.exports = ethStorageTrieResolver\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-storage-trie/index.js\n// module id = 944\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-storage-trie/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n/* eslint max-nested-callbacks: [\"error\", 5] */\n\nconst ethTxResolver = __webpack_require__(421)\nconst createTrieResolver = __webpack_require__(271)\n\nconst ethTxTrieResolver = createTrieResolver('eth-tx-trie', ethTxResolver)\n\nmodule.exports = ethTxTrieResolver\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/eth-tx-trie/index.js\n// module id = 945\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/eth-tx-trie/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// this is the hash of the empty code (SHA3_NULL)\nmodule.exports = new Buffer('c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470', 'hex')\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/emptyCodeHash.js\n// module id = 946\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/emptyCodeHash.js")},function(module,exports){eval("module.exports = isExternalLink\n\nfunction isExternalLink (obj) {\n  return Boolean(obj['/'])\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-ethereum/util/isExternalLink.js\n// module id = 947\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-ethereum/util/isExternalLink.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.util = __webpack_require__(426)\nexports.resolver = __webpack_require__(425)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/index.js\n// module id = 948\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst setImmediate = __webpack_require__(8)\nconst SmartBuffer = __webpack_require__(209).SmartBuffer\nconst gitUtil = __webpack_require__(191)\n\nexports = module.exports\n\nexports.serialize = (dagNode, callback) => {\n  let lines = []\n  lines.push('tree ' + gitUtil.cidToSha(dagNode.tree['/']).toString('hex'))\n  dagNode.parents.forEach((parent) => {\n    lines.push('parent ' + gitUtil.cidToSha(parent['/']).toString('hex'))\n  })\n  lines.push('author ' + gitUtil.serializePersonLine(dagNode.author))\n  lines.push('committer ' + gitUtil.serializePersonLine(dagNode.committer))\n  if (dagNode.encoding) {\n    lines.push('encoding ' + dagNode.encoding)\n  }\n  if (dagNode.signature) {\n    lines.push('gpgsig -----BEGIN PGP SIGNATURE-----')\n    lines.push(dagNode.signature.text)\n  }\n  lines.push('')\n  lines.push(dagNode.message)\n\n  let data = lines.join('\\n')\n\n  let outBuf = new SmartBuffer()\n  outBuf.writeString('commit ')\n  outBuf.writeString(data.length.toString())\n  outBuf.writeUInt8(0)\n  outBuf.writeString(data)\n  setImmediate(() => callback(null, outBuf.toBuffer()))\n}\n\nexports.deserialize = (data, callback) => {\n  let lines = data.toString().split('\\n')\n  let res = {gitType: 'commit', parents: []}\n\n  for (let line = 0; line < lines.length; line++) {\n    let m = lines[line].match(/^([^ ]+) (.+)$/)\n    if (!m) {\n      if (lines[line] !== '') {\n        setImmediate(() => callback(new Error('Invalid commit line ' + line)))\n      }\n      res.message = lines.slice(line + 1).join('\\n')\n      break\n    }\n\n    let key = m[1]\n    let value = m[2]\n    switch (key) {\n      case 'tree':\n        res.tree = {'/': gitUtil.shaToCid(Buffer.from(value, 'hex'))}\n        break\n      case 'committer':\n        res.committer = gitUtil.parsePersonLine(value)\n        break\n      case 'author':\n        res.author = gitUtil.parsePersonLine(value)\n        break\n      case 'parent':\n        res.parents.push({'/': gitUtil.shaToCid(Buffer.from(value, 'hex'))})\n        break\n      case 'gpgsig': {\n        if (value !== '-----BEGIN PGP SIGNATURE-----') {\n          setImmediate(() => callback(new Error('Invalid commit line ' + line)))\n        }\n        res.signature = {}\n\n        let startLine = line\n        for (; line < lines.length - 1; line++) {\n          if (lines[line + 1][0] !== ' ') {\n            res.signature.text = lines.slice(startLine + 1, line + 1).join('\\n')\n            break\n          }\n        }\n        break\n      }\n      default:\n        res[key] = value\n    }\n  }\n\n  setImmediate(() => callback(null, res))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/util/commit.js\n// module id = 949\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/util/commit.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst setImmediate = __webpack_require__(8)\nconst SmartBuffer = __webpack_require__(209).SmartBuffer\nconst gitUtil = __webpack_require__(191)\n\nexports = module.exports\n\nexports.serialize = (dagNode, callback) => {\n  let lines = []\n  lines.push('object ' + gitUtil.cidToSha(dagNode.object['/']).toString('hex'))\n  lines.push('type ' + dagNode.type)\n  lines.push('tag ' + dagNode.tag)\n  if (dagNode.tagger !== null) {\n    lines.push('tagger ' + gitUtil.serializePersonLine(dagNode.tagger))\n  }\n  lines.push('')\n  lines.push(dagNode.message)\n\n  let data = lines.join('\\n')\n\n  let outBuf = new SmartBuffer()\n  outBuf.writeString('tag ')\n  outBuf.writeString(data.length.toString())\n  outBuf.writeUInt8(0)\n  outBuf.writeString(data)\n  setImmediate(() => callback(null, outBuf.toBuffer()))\n}\n\nexports.deserialize = (data, callback) => {\n  let lines = data.toString().split('\\n')\n  let res = {gitType: 'tag'}\n\n  for (let line = 0; line < lines.length; line++) {\n    let m = lines[line].match(/^([^ ]+) (.+)$/)\n    if (m === null) {\n      if (lines[line] !== '') {\n        setImmediate(() => callback(new Error('Invalid tag line ' + line)))\n      }\n      res.message = lines.slice(line + 1).join('\\n')\n      break\n    }\n\n    let key = m[1]\n    let value = m[2]\n    switch (key) {\n      case 'object':\n        res.object = {'/': gitUtil.shaToCid(Buffer.from(value, 'hex'))}\n        break\n      case 'tagger':\n        res.tagger = gitUtil.parsePersonLine(value)\n        break\n      case 'tag':\n        res.tag = value\n        break\n      case 'type':\n        res.type = value\n        break\n      default:\n        res[key] = value\n    }\n  }\n\n  setImmediate(() => callback(null, res))\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/util/tag.js\n// module id = 950\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/util/tag.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst setImmediate = __webpack_require__(8)\nconst SmartBuffer = __webpack_require__(209).SmartBuffer\nconst gitUtil = __webpack_require__(191)\n\nexports = module.exports\n\nexports.serialize = (dagNode, callback) => {\n  let entries = []\n  Object.keys(dagNode).forEach((name) => {\n    entries.push([name, dagNode[name]])\n  })\n  entries.sort((a, b) => a[0] > b[0] ? 1 : -1)\n  let buf = new SmartBuffer()\n  entries.forEach((entry) => {\n    buf.writeStringNT(entry[1].mode + ' ' + entry[0])\n    buf.writeBuffer(gitUtil.cidToSha(entry[1].hash['/']))\n  })\n\n  let outBuf = new SmartBuffer()\n  outBuf.writeString('tree ')\n  outBuf.writeString(buf.length.toString())\n  outBuf.writeUInt8(0)\n  outBuf.writeBuffer(buf.toBuffer())\n  setImmediate(() => callback(null, outBuf.toBuffer()))\n}\n\nexports.deserialize = (data, callback) => {\n  let res = {}\n  let buf = SmartBuffer.fromBuffer(data, 'utf8')\n\n  for (;;) {\n    let modeName = buf.readStringNT()\n    if (modeName === '') {\n      break\n    }\n\n    let hash = buf.readBuffer(gitUtil.SHA1_LENGTH)\n    let modNameMatched = modeName.match(/^(\\d+) (.+)$/)\n    if (!modNameMatched) {\n      setImmediate(() => callback(new Error('invalid file mode/name')))\n    }\n\n    if (res[modNameMatched[2]]) {\n      setImmediate(() => callback(new Error('duplicate file in tree')))\n    }\n\n    res[modNameMatched[2]] = {\n      mode: modNameMatched[1],\n      hash: {'/': gitUtil.shaToCid(hash)}\n    }\n  }\n\n  setImmediate(() => callback(null, res))\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-git/src/util/tree.js\n// module id = 951\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-git/src/util/tree.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst CID = __webpack_require__(14)\n\n// binary resolver\nmodule.exports = {\n  resolver: {\n    multicodec: 'raw',\n    resolve: (binaryBlob, path, callback) => {\n      callback(null, {\n        value: binaryBlob,\n        remainderPath: ''\n      })\n    },\n    tree: (binaryBlob, options, callback) => {\n      callback(null, [])\n    }\n  },\n  util: {\n    deserialize: (data, cb) => {\n      cb(null, data)\n    },\n    serialize: (data, cb) => {\n      cb(null, data)\n    },\n    cid: (data, cb) => {\n      cb(null, new CID(1, 'raw', data))\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-raw/src/index.js\n// module id = 952\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-raw/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.resolver = __webpack_require__(954)\nexports.util = __webpack_require__(427)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-zcash/src/index.js\n// module id = 953\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-zcash/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst util = __webpack_require__(427)\n\n/**\n * @callback ResolveCallback\n * @param {?Error} error - Error if path can't be resolved\n * @param {Object} result - Result of the path it it was resolved successfully\n * @param {*} result.value - Value the path resolves to\n * @param {string} result.remainderPath - If the path resolves half-way to a\n *   link, then the `remainderPath` is the part after the link that can be used\n *   for further resolving.\n */\n/**\n * Resolves a path in a Zcash block.\n *\n * Returns the value or a link and the partial mising path. This way the\n * IPLD Resolver can fetch the link and continue to resolve.\n *\n * @param {Buffer} binaryBlob - Binary representation of a Zcash block\n * @param {string} [path='/'] - Path that should be resolved\n * @param {ResolveCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst resolve = (binaryBlob, path, callback) => {\n  if (typeof path === 'function') {\n    callback = path\n    path = undefined\n  }\n\n  util.deserialize(binaryBlob, (err, dagNode) => {\n    if (err) {\n      return callback(err)\n    }\n\n    // Return the deserialized block if no path is given\n    if (!path) {\n      return callback(null, {\n        value: dagNode,\n        remainderPath: ''\n      })\n    }\n\n    const pathArray = path.split('/')\n    const value = resolveField(dagNode.header, pathArray[0])\n    if (value === null) {\n      return callback(new Error('No such path'), null)\n    }\n\n    let remainderPath = pathArray.slice(1).join('/')\n    // It is a link, hence it may have a remainder\n    if (value['/'] !== undefined) {\n      return callback(null, {\n        value: value,\n        remainderPath: remainderPath\n      })\n    } else {\n      if (remainderPath.length > 0) {\n        return callback(new Error('No such path'), null)\n      } else {\n        return callback(null, {\n          value: value,\n          remainderPath: ''\n        })\n      }\n    }\n  })\n}\n\n/**\n * @callback TreeCallback\n * @param {?Error} error - Error if paths can't be retreived\n * @param {string[] | Object.<string, *>[]} result - The result depends on\n *   `options.values`, whether it returns only the paths, or the paths with\n *   the corresponding values\n */\n/**\n * Return all available paths of a block.\n *\n * @param {Buffer} binaryBlob - Binary representation of a Zcash block\n * @param {Object} [options] - Possible options\n * @param {boolean} [options.values=false] - Retun only the paths by default.\n *   If it is `true` also return the values\n * @param {TreeCallback} callback - Callback that handles the return value\n * @returns {void}\n */\nconst tree = (binaryBlob, options, callback) => {\n  if (typeof options === 'function') {\n    callback = options\n    options = undefined\n  }\n  options = options || {}\n\n  util.deserialize(binaryBlob, (err, dagNode) => {\n    if (err) {\n      return callback(err)\n    }\n\n    const paths = ['version', 'timestamp', 'difficulty', 'nonce',\n      'solution', 'reserved', 'parent', 'tx']\n\n    if (options.values === true) {\n      const pathValues = {}\n      for (let path of paths) {\n        pathValues[path] = resolveField(dagNode.header, path)\n      }\n      return callback(null, pathValues)\n    } else {\n      return callback(null, paths)\n    }\n  })\n}\n\n// Return top-level fields. Returns `null` if field doesn't exist\nconst resolveField = (header, field) => {\n  switch (field) {\n    case 'version':\n      return header.version\n    case 'timestamp':\n      return header.time\n    case 'difficulty':\n      return header.bits\n    case 'nonce':\n      return header.nonce\n    case 'solution':\n      return header.solution\n    case 'reserved':\n      return header.reserved\n    case 'parent':\n      return {'/': util.hashToCid(header.prevHash)}\n    case 'tx':\n      return {'/': util.hashToCid(header.merkleRoot)}\n    default:\n      return null\n  }\n}\n\nmodule.exports = {\n  multicodec: 'zcash-block',\n  resolve: resolve,\n  tree: tree\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld-zcash/src/resolver.js\n// module id = 954\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld-zcash/src/resolver.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst Block = __webpack_require__(188)\nconst pull = __webpack_require__(6)\nconst CID = __webpack_require__(14)\nconst doUntil = __webpack_require__(589)\nconst IPFSRepo = __webpack_require__(267)\nconst BlockService = __webpack_require__(414)\nconst joinPath = __webpack_require__(202).join\nconst osPathSep = __webpack_require__(202).sep\nconst pullDeferSource = __webpack_require__(301).source\nconst pullTraverse = __webpack_require__(523)\nconst map = __webpack_require__(128)\nconst series = __webpack_require__(51)\nconst waterfall = __webpack_require__(12)\nconst MemoryStore = __webpack_require__(40).MemoryDatastore\n\nconst dagPB = __webpack_require__(121)\nconst dagCBOR = __webpack_require__(934)\nconst ipldGit = __webpack_require__(948)\nconst ipldBitcoin = __webpack_require__(932)\nconst ipldEthAccountSnapshot = __webpack_require__(97).ethAccountSnapshot\nconst ipldEthBlock = __webpack_require__(97).ethBlock\nconst ipldEthBlockList = __webpack_require__(97).ethBlockList\nconst ipldEthStateTrie = __webpack_require__(97).ethStateTrie\nconst ipldEthStorageTrie = __webpack_require__(97).ethStorageTrie\nconst ipldEthTx = __webpack_require__(97).ethTx\nconst ipldEthTxTrie = __webpack_require__(97).ethTxTrie\nconst ipldRaw = __webpack_require__(952)\nconst ipldZcash = __webpack_require__(953)\n\nfunction noop () {}\n\nclass IPLDResolver {\n  constructor (blockService) {\n    if (!blockService) {\n      throw new Error('Missing blockservice')\n    }\n\n    this.bs = blockService\n    this.resolvers = {}\n\n    this.support = {}\n\n    // Adds support for an IPLD format\n    this.support.add = (multicodec, resolver, util) => {\n      if (this.resolvers[multicodec]) {\n        throw new Error(multicodec + 'already supported')\n      }\n\n      this.resolvers[multicodec] = {\n        resolver: resolver,\n        util: util\n      }\n    }\n\n    this.support.rm = (multicodec) => {\n      if (this.resolvers[multicodec]) {\n        delete this.resolvers[multicodec]\n      }\n    }\n\n    // Support by default dag-pb, dag-cbor, git, and eth-*\n    this.support.add(dagPB.resolver.multicodec,\n      dagPB.resolver,\n      dagPB.util)\n\n    this.support.add(dagCBOR.resolver.multicodec,\n      dagCBOR.resolver,\n      dagCBOR.util)\n\n    this.support.add(ipldGit.resolver.multicodec,\n      ipldGit.resolver,\n      ipldGit.util)\n\n    this.support.add(ipldBitcoin.resolver.multicodec,\n      ipldBitcoin.resolver,\n      ipldBitcoin.util)\n\n    this.support.add(ipldEthAccountSnapshot.resolver.multicodec,\n      ipldEthAccountSnapshot.resolver,\n      ipldEthAccountSnapshot.util)\n\n    this.support.add(ipldEthBlock.resolver.multicodec,\n      ipldEthBlock.resolver,\n      ipldEthBlock.util)\n\n    this.support.add(ipldEthBlockList.resolver.multicodec,\n      ipldEthBlockList.resolver,\n      ipldEthBlockList.util)\n\n    this.support.add(ipldEthStateTrie.resolver.multicodec,\n      ipldEthStateTrie.resolver,\n      ipldEthStateTrie.util)\n\n    this.support.add(ipldEthStorageTrie.resolver.multicodec,\n      ipldEthStorageTrie.resolver,\n      ipldEthStorageTrie.util)\n\n    this.support.add(ipldEthTx.resolver.multicodec,\n      ipldEthTx.resolver,\n      ipldEthTx.util)\n\n    this.support.add(ipldEthTxTrie.resolver.multicodec,\n      ipldEthTxTrie.resolver,\n      ipldEthTxTrie.util)\n\n    this.support.add(ipldRaw.resolver.multicodec,\n      ipldRaw.resolver,\n      ipldRaw.util)\n\n    this.support.add(ipldZcash.resolver.multicodec,\n      ipldZcash.resolver,\n      ipldZcash.util)\n  }\n\n  get (cid, path, options, callback) {\n    if (typeof path === 'function') {\n      callback = path\n      path = undefined\n    }\n\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    // this removes occurrences of ./, //, ../\n    // makes sure that path never starts with ./ or /\n    // path.join is OS specific. Need to convert back to POSIX format.\n    if (typeof path === 'string') {\n      path = joinPath('/', path)\n        .substr(1)\n        .split(osPathSep)\n        .join('/')\n    }\n\n    if (path === '' || !path) {\n      return this._get(cid, (err, node) => {\n        if (err) {\n          return callback(err)\n        }\n        callback(null, {\n          value: node,\n          remainderPath: ''\n        })\n      })\n    }\n\n    let value\n\n    doUntil(\n      (cb) => {\n        // get block\n        // use local resolver\n        // update path value\n        this.bs.get(cid, (err, block) => {\n          if (err) {\n            return cb(err)\n          }\n          const r = this.resolvers[cid.codec]\n          if (!r) {\n            return cb(new Error('No resolver found for codec \"' + cid.codec + '\"'))\n          }\n          r.resolver.resolve(block.data, path, (err, result) => {\n            if (err) {\n              return cb(err)\n            }\n            value = result.value\n            path = result.remainderPath\n            cb()\n          })\n        })\n      },\n      () => {\n        const endReached = !path || path === '' || path === '/'\n        const isTerminal = value && !value['/']\n\n        if ((endReached && isTerminal) || options.localResolve) {\n          return true\n        } else {\n          // continue traversing\n          if (value) {\n            cid = new CID(value['/'])\n          }\n          return false\n        }\n      },\n      (err, results) => {\n        if (err) {\n          return callback(err)\n        }\n        return callback(null, {\n          value: value,\n          remainderPath: path\n        })\n      }\n    )\n  }\n\n  getStream (cid, path, options) {\n    const deferred = pullDeferSource()\n\n    this.get(cid, path, options, (err, result) => {\n      if (err) {\n        return deferred.resolve(\n          pull.error(err)\n        )\n      }\n      deferred.resolve(\n        pull.values([result])\n      )\n    })\n\n    return deferred\n  }\n\n  put (node, options, callback) {\n    if (typeof options === 'function') {\n      return setImmediate(() => callback(new Error('no options were passed')))\n    }\n    callback = callback || noop\n\n    if (options.cid && CID.isCID(options.cid)) {\n      return this._put(options.cid, node, callback)\n    }\n\n    options.hashAlg = options.hashAlg || 'sha2-256'\n    const r = this.resolvers[options.format]\n    if (!r) {\n      return callback(new Error('No resolver found for codec \"' + options.format + '\"'))\n    }\n    // TODO add support for different hash funcs in the utils of\n    // each format (just really needed for CBOR for now, really\n    // r.util.cid(node1, hashAlg, (err, cid) => {\n    r.util.cid(node, (err, cid) => {\n      if (err) {\n        return callback(err)\n      }\n\n      this._put(cid, node, callback)\n    })\n  }\n\n  treeStream (cid, path, options) {\n    if (typeof path === 'object') {\n      options = path\n      path = undefined\n    }\n\n    options = options || {}\n\n    let p\n\n    if (!options.recursive) {\n      p = pullDeferSource()\n      const r = this.resolvers[cid.codec]\n      if (!r) {\n        p.abort(new Error('No resolver found for codec \"' + cid.codec + '\"'))\n        return p\n      }\n\n      waterfall([\n        (cb) => this.bs.get(cid, cb),\n        (block, cb) => r.resolver.tree(block.data, cb)\n      ], (err, paths) => {\n        if (err) {\n          p.abort(err)\n          return p\n        }\n        p.resolve(pull.values(paths))\n      })\n    }\n\n    // recursive\n    if (options.recursive) {\n      p = pull(\n        pullTraverse.widthFirst({\n          basePath: null,\n          cid: cid\n        }, (el) => {\n          // pass the paths through the pushable pull stream\n          // continue traversing the graph by returning\n          // the next cids with deferred\n\n          if (typeof el === 'string') {\n            return pull.empty()\n          }\n\n          const deferred = pullDeferSource()\n          const cid = el.cid\n          const r = this.resolvers[cid.codec]\n          if (!r) {\n            deferred.abort(new Error('No resolver found for codec \"' + cid.codec + '\"'))\n            return deferred\n          }\n\n          waterfall([\n            (cb) => this.bs.get(el.cid, cb),\n            (block, cb) => r.resolver.tree(block.data, (err, paths) => {\n              if (err) {\n                return cb(err)\n              }\n              map(paths, (p, cb) => {\n                r.resolver.isLink(block.data, p, (err, link) => {\n                  if (err) {\n                    return cb(err)\n                  }\n                  cb(null, {path: p, link: link})\n                })\n              }, cb)\n            })\n          ], (err, paths) => {\n            if (err) {\n              deferred.abort(err)\n              return deferred\n            }\n\n            deferred.resolve(pull.values(paths.map((p) => {\n              const base = el.basePath ? el.basePath + '/' + p.path : p.path\n              if (p.link) {\n                return {\n                  basePath: base,\n                  cid: new CID(p.link['/'])\n                }\n              }\n              return base\n            })))\n          })\n          return deferred\n        }),\n        pull.map((e) => {\n          if (typeof e === 'string') {\n            return e\n          }\n          return e.basePath\n        }),\n        pull.filter(Boolean)\n      )\n    }\n\n    // filter out by path\n    if (path) {\n      return pull(\n        p,\n        pull.map((el) => {\n          if (el.indexOf(path) === 0) {\n            el = el.slice(path.length + 1)\n            return el\n          }\n        }),\n        pull.filter(Boolean)\n      )\n    }\n\n    return p\n  }\n\n  remove (cids, callback) {\n    this.bs.delete(cids, callback)\n  }\n\n  /*           */\n  /* internals */\n  /*           */\n\n  _get (cid, callback) {\n    const r = this.resolvers[cid.codec]\n    if (!r) {\n      return callback(new Error('No resolver found for codec \"' + cid.codec + '\"'))\n    }\n\n    waterfall([\n      (cb) => this.bs.get(cid, cb),\n      (block, cb) => {\n        if (r) {\n          r.util.deserialize(block.data, (err, deserialized) => {\n            if (err) {\n              return cb(err)\n            }\n            cb(null, deserialized)\n          })\n        } else { // multicodec unknown, send back raw data\n          cb(null, block.data)\n        }\n      }\n    ], callback)\n  }\n\n  _put (cid, node, callback) {\n    callback = callback || noop\n\n    const r = this.resolvers[cid.codec]\n    if (!r) {\n      return callback(new Error('No resolver found for codec \"' + cid.codec + '\"'))\n    }\n\n    waterfall([\n      (cb) => r.util.serialize(node, cb),\n      (buf, cb) => this.bs.put(new Block(buf, cid), cb)\n    ], (err) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, cid)\n    })\n  }\n}\n\n/**\n * Create an IPLD resolver with an inmemory blockservice and\n * repo.\n *\n * @param {function(Error, IPLDResolver)} callback\n * @returns {void}\n */\nIPLDResolver.inMemory = function (callback) {\n  const repo = new IPFSRepo('in-memory', {\n    storageBackends: {\n      root: MemoryStore,\n      blocks: MemoryStore,\n      datastore: MemoryStore\n    },\n    lock: 'memory'\n  })\n  const blockService = new BlockService(repo)\n\n  series([\n    (cb) => repo.init({}, cb),\n    (cb) => repo.open(cb)\n  ], (err) => {\n    if (err) {\n      return callback(err)\n    }\n    callback(null, new IPLDResolver(blockService))\n  })\n}\n\nmodule.exports = IPLDResolver\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ipld/src/index.js\n// module id = 955\n// module chunks = 0\n\n//# sourceURL=../node_modules/ipld/src/index.js")},function(module,exports){eval("module.exports = isCircular\n\n/**\n * is circular utility\n * @param  {object}  obj object or array to be checked for circular references\n * @return {Boolean} true if obj is circular, false if it is not\n */\nfunction isCircular (obj) {\n  return new CircularChecker(obj).isCircular()\n}\n\n/**\n * Circular checker helper class\n * @param  {object}  obj object or array to be checked for circular references\n */\nfunction CircularChecker (obj) {\n  this.obj = obj\n}\n/**\n * checks whether this.obj is circular\n * @param  {object}  obj do not pass. this param is used for recursive calls. defaults to this.obj\n * @param  {array}   seen a list of descendants from the root object to obj\n * @return {Boolean} true if obj is circular, false if it is not\n */\nCircularChecker.prototype.isCircular = function (obj, seen) {\n  obj = obj || this.obj\n  seen = seen || []\n  if (!(obj instanceof Object)) {\n    throw new TypeError('\"obj\" must be an object (or inherit from it)')\n  }\n  var self = this\n  seen.push(obj)\n\n  for (var key in obj) {\n    var val = obj[key]\n    if (val instanceof Object) {\n      if (~seen.indexOf(val) || self.isCircular(val, seen.slice())) {\n        return true\n      }\n    }\n  }\n\n  return false\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-circular/index.js\n// module id = 956\n// module chunks = 0\n\n//# sourceURL=../node_modules/is-circular/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar isStream = module.exports = function (stream) {\n\treturn stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';\n};\n\nisStream.writable = function (stream) {\n\treturn isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';\n};\n\nisStream.readable = function (stream) {\n\treturn isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';\n};\n\nisStream.duplex = function (stream) {\n\treturn isStream.writable(stream) && isStream.readable(stream);\n};\n\nisStream.transform = function (stream) {\n\treturn isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-stream/index.js\n// module id = 957\n// module chunks = 0\n\n//# sourceURL=../node_modules/is-stream/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/**\n * [js-sha3]{@link https://github.com/emn178/js-sha3}\n *\n * @version 0.7.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2015-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function () {\n  'use strict';\n\n  var ERROR = 'input is invalid type';\n  var WINDOW = typeof window === 'object';\n  var root = WINDOW ? window : {};\n  if (root.JS_SHA3_NO_WINDOW) {\n    WINDOW = false;\n  }\n  var WEB_WORKER = !WINDOW && typeof self === 'object';\n  var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n  if (NODE_JS) {\n    root = global;\n  } else if (WEB_WORKER) {\n    root = self;\n  }\n  var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && typeof module === 'object' && module.exports;\n  var AMD = \"function\" === 'function' && __webpack_require__(1299);\n  var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined';\n  var HEX_CHARS = '0123456789abcdef'.split('');\n  var SHAKE_PADDING = [31, 7936, 2031616, 520093696];\n  var CSHAKE_PADDING = [4, 1024, 262144, 67108864];\n  var KECCAK_PADDING = [1, 256, 65536, 16777216];\n  var PADDING = [6, 1536, 393216, 100663296];\n  var SHIFT = [0, 8, 16, 24];\n  var RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649,\n    0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0,\n    2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771,\n    2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648,\n    2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\n  var BITS = [224, 256, 384, 512];\n  var SHAKE_BITS = [128, 256];\n  var OUTPUT_TYPES = ['hex', 'buffer', 'arrayBuffer', 'array', 'digest'];\n  var CSHAKE_BYTEPAD = {\n    '128': 168,\n    '256': 136\n  };\n\n  if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {\n    Array.isArray = function (obj) {\n      return Object.prototype.toString.call(obj) === '[object Array]';\n    };\n  }\n\n  if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {\n    ArrayBuffer.isView = function (obj) {\n      return typeof obj === 'object' && obj.buffer && obj.buffer.constructor === ArrayBuffer;\n    };\n  }\n\n  var createOutputMethod = function (bits, padding, outputType) {\n    return function (message) {\n      return new Keccak(bits, padding, bits).update(message)[outputType]();\n    };\n  };\n\n  var createShakeOutputMethod = function (bits, padding, outputType) {\n    return function (message, outputBits) {\n      return new Keccak(bits, padding, outputBits).update(message)[outputType]();\n    };\n  };\n\n  var createCshakeOutputMethod = function (bits, padding, outputType) {\n    return function (message, outputBits, n, s) {\n      return methods['cshake' + bits].update(message, outputBits, n, s)[outputType]();\n    };\n  };\n\n  var createKmacOutputMethod = function (bits, padding, outputType) {\n    return function (key, message, outputBits, s) {\n      return methods['kmac' + bits].update(key, message, outputBits, s)[outputType]();\n    };\n  };\n\n  var createOutputMethods = function (method, createMethod, bits, padding) {\n    for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n      var type = OUTPUT_TYPES[i];\n      method[type] = createMethod(bits, padding, type);\n    }\n    return method;\n  };\n\n  var createMethod = function (bits, padding) {\n    var method = createOutputMethod(bits, padding, 'hex');\n    method.create = function () {\n      return new Keccak(bits, padding, bits);\n    };\n    method.update = function (message) {\n      return method.create().update(message);\n    };\n    return createOutputMethods(method, createOutputMethod, bits, padding);\n  };\n\n  var createShakeMethod = function (bits, padding) {\n    var method = createShakeOutputMethod(bits, padding, 'hex');\n    method.create = function (outputBits) {\n      return new Keccak(bits, padding, outputBits);\n    };\n    method.update = function (message, outputBits) {\n      return method.create(outputBits).update(message);\n    };\n    return createOutputMethods(method, createShakeOutputMethod, bits, padding);\n  };\n\n  var createCshakeMethod = function (bits, padding) {\n    var w = CSHAKE_BYTEPAD[bits];\n    var method = createCshakeOutputMethod(bits, padding, 'hex');\n    method.create = function (outputBits, n, s) {\n      if (!n && !s) {\n        return methods['shake' + bits].create(outputBits);\n      } else {\n        return new Keccak(bits, padding, outputBits).bytepad([n, s], w);\n      }\n    };\n    method.update = function (message, outputBits, n, s) {\n      return method.create(outputBits, n, s).update(message);\n    };\n    return createOutputMethods(method, createCshakeOutputMethod, bits, padding);\n  };\n\n  var createKmacMethod = function (bits, padding) {\n    var w = CSHAKE_BYTEPAD[bits];\n    var method = createKmacOutputMethod(bits, padding, 'hex');\n    method.create = function (key, outputBits, s) {\n      return new Kmac(bits, padding, outputBits).bytepad(['KMAC', s], w).bytepad([key], w);\n    };\n    method.update = function (key, message, outputBits, s) {\n      return method.create(key, outputBits, s).update(message);\n    };\n    return createOutputMethods(method, createKmacOutputMethod, bits, padding);\n  };\n\n  var algorithms = [\n    { name: 'keccak', padding: KECCAK_PADDING, bits: BITS, createMethod: createMethod },\n    { name: 'sha3', padding: PADDING, bits: BITS, createMethod: createMethod },\n    { name: 'shake', padding: SHAKE_PADDING, bits: SHAKE_BITS, createMethod: createShakeMethod },\n    { name: 'cshake', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createCshakeMethod },\n    { name: 'kmac', padding: CSHAKE_PADDING, bits: SHAKE_BITS, createMethod: createKmacMethod }\n  ];\n\n  var methods = {}, methodNames = [];\n\n  for (var i = 0; i < algorithms.length; ++i) {\n    var algorithm = algorithms[i];\n    var bits = algorithm.bits;\n    for (var j = 0; j < bits.length; ++j) {\n      var methodName = algorithm.name + '_' + bits[j];\n      methodNames.push(methodName);\n      methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);\n      if (algorithm.name !== 'sha3') {\n        var newMethodName = algorithm.name + bits[j];\n        methodNames.push(newMethodName);\n        methods[newMethodName] = methods[methodName];\n      }\n    }\n  }\n\n  function Keccak(bits, padding, outputBits) {\n    this.blocks = [];\n    this.s = [];\n    this.padding = padding;\n    this.outputBits = outputBits;\n    this.reset = true;\n    this.finalized = false;\n    this.block = 0;\n    this.start = 0;\n    this.blockCount = (1600 - (bits << 1)) >> 5;\n    this.byteCount = this.blockCount << 2;\n    this.outputBlocks = outputBits >> 5;\n    this.extraBytes = (outputBits & 31) >> 3;\n\n    for (var i = 0; i < 50; ++i) {\n      this.s[i] = 0;\n    }\n  }\n\n  Keccak.prototype.update = function (message) {\n    if (this.finalized) {\n      return;\n    }\n    var notString, type = typeof message;\n    if (type !== 'string') {\n      if (type === 'object') {\n        if (message === null) {\n          throw ERROR;\n        } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {\n          message = new Uint8Array(message);\n        } else if (!Array.isArray(message)) {\n          if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {\n            throw ERROR;\n          }\n        }\n      } else {\n        throw ERROR;\n      }\n      notString = true;\n    }\n    var blocks = this.blocks, byteCount = this.byteCount, length = message.length,\n      blockCount = this.blockCount, index = 0, s = this.s, i, code;\n\n    while (index < length) {\n      if (this.reset) {\n        this.reset = false;\n        blocks[0] = this.block;\n        for (i = 1; i < blockCount + 1; ++i) {\n          blocks[i] = 0;\n        }\n      }\n      if (notString) {\n        for (i = this.start; index < length && i < byteCount; ++index) {\n          blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n        }\n      } else {\n        for (i = this.start; index < length && i < byteCount; ++index) {\n          code = message.charCodeAt(index);\n          if (code < 0x80) {\n            blocks[i >> 2] |= code << SHIFT[i++ & 3];\n          } else if (code < 0x800) {\n            blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n          } else if (code < 0xd800 || code >= 0xe000) {\n            blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n          } else {\n            code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n            blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n            blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n          }\n        }\n      }\n      this.lastByteIndex = i;\n      if (i >= byteCount) {\n        this.start = i - byteCount;\n        this.block = blocks[blockCount];\n        for (i = 0; i < blockCount; ++i) {\n          s[i] ^= blocks[i];\n        }\n        f(s);\n        this.reset = true;\n      } else {\n        this.start = i;\n      }\n    }\n    return this;\n  };\n\n  Keccak.prototype.encode = function (x, right) {\n    var o = x & 255, n = 1;\n    var bytes = [o];\n    x = x >> 8;\n    o = x & 255;\n    while (o > 0) {\n      bytes.unshift(o);\n      x = x >> 8;\n      o = x & 255;\n      ++n;\n    }\n    if (right) {\n      bytes.push(n);\n    } else {\n      bytes.unshift(n);\n    }\n    this.update(bytes);\n    return bytes.length;\n  };\n\n  Keccak.prototype.encodeString = function (str) {\n    var notString, type = typeof str;\n    if (type !== 'string') {\n      if (type === 'object') {\n        if (str === null) {\n          throw ERROR;\n        } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {\n          str = new Uint8Array(str);\n        } else if (!Array.isArray(str)) {\n          if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {\n            throw ERROR;\n          }\n        }\n      } else {\n        throw ERROR;\n      }\n      notString = true;\n    }\n    var bytes = 0, length = str.length;\n    if (notString) {\n      bytes = length;\n    } else {\n      for (var i = 0; i < str.length; ++i) {\n        var code = str.charCodeAt(i);\n        if (code < 0x80) {\n          bytes += 1;\n        } else if (code < 0x800) {\n          bytes += 2;\n        } else if (code < 0xd800 || code >= 0xe000) {\n          bytes += 3;\n        } else {\n          code = 0x10000 + (((code & 0x3ff) << 10) | (str.charCodeAt(++i) & 0x3ff));\n          bytes += 4;\n        }\n      }\n    }\n    bytes += this.encode(bytes * 8);\n    this.update(str);\n    return bytes;\n  };\n\n  Keccak.prototype.bytepad = function (strs, w) {\n    var bytes = this.encode(w);\n    for (var i = 0; i < strs.length; ++i) {\n      bytes += this.encodeString(strs[i]);\n    }\n    var paddingBytes = w - bytes % w;\n    var zeros = [];\n    zeros.length = paddingBytes;\n    this.update(zeros);\n    return this;\n  };\n\n  Keccak.prototype.finalize = function () {\n    if (this.finalized) {\n      return;\n    }\n    this.finalized = true;\n    var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;\n    blocks[i >> 2] |= this.padding[i & 3];\n    if (this.lastByteIndex === this.byteCount) {\n      blocks[0] = blocks[blockCount];\n      for (i = 1; i < blockCount + 1; ++i) {\n        blocks[i] = 0;\n      }\n    }\n    blocks[blockCount - 1] |= 0x80000000;\n    for (i = 0; i < blockCount; ++i) {\n      s[i] ^= blocks[i];\n    }\n    f(s);\n  };\n\n  Keccak.prototype.toString = Keccak.prototype.hex = function () {\n    this.finalize();\n\n    var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n      extraBytes = this.extraBytes, i = 0, j = 0;\n    var hex = '', block;\n    while (j < outputBlocks) {\n      for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n        block = s[i];\n        hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F] +\n          HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F] +\n          HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F] +\n          HEX_CHARS[(block >> 28) & 0x0F] + HEX_CHARS[(block >> 24) & 0x0F];\n      }\n      if (j % blockCount === 0) {\n        f(s);\n        i = 0;\n      }\n    }\n    if (extraBytes) {\n      block = s[i];\n      hex += HEX_CHARS[(block >> 4) & 0x0F] + HEX_CHARS[block & 0x0F];\n      if (extraBytes > 1) {\n        hex += HEX_CHARS[(block >> 12) & 0x0F] + HEX_CHARS[(block >> 8) & 0x0F];\n      }\n      if (extraBytes > 2) {\n        hex += HEX_CHARS[(block >> 20) & 0x0F] + HEX_CHARS[(block >> 16) & 0x0F];\n      }\n    }\n    return hex;\n  };\n\n  Keccak.prototype.arrayBuffer = function () {\n    this.finalize();\n\n    var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n      extraBytes = this.extraBytes, i = 0, j = 0;\n    var bytes = this.outputBits >> 3;\n    var buffer;\n    if (extraBytes) {\n      buffer = new ArrayBuffer((outputBlocks + 1) << 2);\n    } else {\n      buffer = new ArrayBuffer(bytes);\n    }\n    var array = new Uint32Array(buffer);\n    while (j < outputBlocks) {\n      for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n        array[j] = s[i];\n      }\n      if (j % blockCount === 0) {\n        f(s);\n      }\n    }\n    if (extraBytes) {\n      array[i] = s[i];\n      buffer = buffer.slice(0, bytes);\n    }\n    return buffer;\n  };\n\n  Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;\n\n  Keccak.prototype.digest = Keccak.prototype.array = function () {\n    this.finalize();\n\n    var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks,\n      extraBytes = this.extraBytes, i = 0, j = 0;\n    var array = [], offset, block;\n    while (j < outputBlocks) {\n      for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\n        offset = j << 2;\n        block = s[i];\n        array[offset] = block & 0xFF;\n        array[offset + 1] = (block >> 8) & 0xFF;\n        array[offset + 2] = (block >> 16) & 0xFF;\n        array[offset + 3] = (block >> 24) & 0xFF;\n      }\n      if (j % blockCount === 0) {\n        f(s);\n      }\n    }\n    if (extraBytes) {\n      offset = j << 2;\n      block = s[i];\n      array[offset] = block & 0xFF;\n      if (extraBytes > 1) {\n        array[offset + 1] = (block >> 8) & 0xFF;\n      }\n      if (extraBytes > 2) {\n        array[offset + 2] = (block >> 16) & 0xFF;\n      }\n    }\n    return array;\n  };\n\n  function Kmac(bits, padding, outputBits) {\n    Keccak.call(this, bits, padding, outputBits);\n  }\n\n  Kmac.prototype = new Keccak();\n\n  Kmac.prototype.finalize = function () {\n    this.encode(this.outputBits, true);\n    return Keccak.prototype.finalize.call(this);\n  };\n\n  var f = function (s) {\n    var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9,\n      b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17,\n      b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33,\n      b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\n    for (n = 0; n < 48; n += 2) {\n      c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\n      c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\n      c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\n      c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\n      c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\n      c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\n      c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\n      c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\n      c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\n      c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\n\n      h = c8 ^ ((c2 << 1) | (c3 >>> 31));\n      l = c9 ^ ((c3 << 1) | (c2 >>> 31));\n      s[0] ^= h;\n      s[1] ^= l;\n      s[10] ^= h;\n      s[11] ^= l;\n      s[20] ^= h;\n      s[21] ^= l;\n      s[30] ^= h;\n      s[31] ^= l;\n      s[40] ^= h;\n      s[41] ^= l;\n      h = c0 ^ ((c4 << 1) | (c5 >>> 31));\n      l = c1 ^ ((c5 << 1) | (c4 >>> 31));\n      s[2] ^= h;\n      s[3] ^= l;\n      s[12] ^= h;\n      s[13] ^= l;\n      s[22] ^= h;\n      s[23] ^= l;\n      s[32] ^= h;\n      s[33] ^= l;\n      s[42] ^= h;\n      s[43] ^= l;\n      h = c2 ^ ((c6 << 1) | (c7 >>> 31));\n      l = c3 ^ ((c7 << 1) | (c6 >>> 31));\n      s[4] ^= h;\n      s[5] ^= l;\n      s[14] ^= h;\n      s[15] ^= l;\n      s[24] ^= h;\n      s[25] ^= l;\n      s[34] ^= h;\n      s[35] ^= l;\n      s[44] ^= h;\n      s[45] ^= l;\n      h = c4 ^ ((c8 << 1) | (c9 >>> 31));\n      l = c5 ^ ((c9 << 1) | (c8 >>> 31));\n      s[6] ^= h;\n      s[7] ^= l;\n      s[16] ^= h;\n      s[17] ^= l;\n      s[26] ^= h;\n      s[27] ^= l;\n      s[36] ^= h;\n      s[37] ^= l;\n      s[46] ^= h;\n      s[47] ^= l;\n      h = c6 ^ ((c0 << 1) | (c1 >>> 31));\n      l = c7 ^ ((c1 << 1) | (c0 >>> 31));\n      s[8] ^= h;\n      s[9] ^= l;\n      s[18] ^= h;\n      s[19] ^= l;\n      s[28] ^= h;\n      s[29] ^= l;\n      s[38] ^= h;\n      s[39] ^= l;\n      s[48] ^= h;\n      s[49] ^= l;\n\n      b0 = s[0];\n      b1 = s[1];\n      b32 = (s[11] << 4) | (s[10] >>> 28);\n      b33 = (s[10] << 4) | (s[11] >>> 28);\n      b14 = (s[20] << 3) | (s[21] >>> 29);\n      b15 = (s[21] << 3) | (s[20] >>> 29);\n      b46 = (s[31] << 9) | (s[30] >>> 23);\n      b47 = (s[30] << 9) | (s[31] >>> 23);\n      b28 = (s[40] << 18) | (s[41] >>> 14);\n      b29 = (s[41] << 18) | (s[40] >>> 14);\n      b20 = (s[2] << 1) | (s[3] >>> 31);\n      b21 = (s[3] << 1) | (s[2] >>> 31);\n      b2 = (s[13] << 12) | (s[12] >>> 20);\n      b3 = (s[12] << 12) | (s[13] >>> 20);\n      b34 = (s[22] << 10) | (s[23] >>> 22);\n      b35 = (s[23] << 10) | (s[22] >>> 22);\n      b16 = (s[33] << 13) | (s[32] >>> 19);\n      b17 = (s[32] << 13) | (s[33] >>> 19);\n      b48 = (s[42] << 2) | (s[43] >>> 30);\n      b49 = (s[43] << 2) | (s[42] >>> 30);\n      b40 = (s[5] << 30) | (s[4] >>> 2);\n      b41 = (s[4] << 30) | (s[5] >>> 2);\n      b22 = (s[14] << 6) | (s[15] >>> 26);\n      b23 = (s[15] << 6) | (s[14] >>> 26);\n      b4 = (s[25] << 11) | (s[24] >>> 21);\n      b5 = (s[24] << 11) | (s[25] >>> 21);\n      b36 = (s[34] << 15) | (s[35] >>> 17);\n      b37 = (s[35] << 15) | (s[34] >>> 17);\n      b18 = (s[45] << 29) | (s[44] >>> 3);\n      b19 = (s[44] << 29) | (s[45] >>> 3);\n      b10 = (s[6] << 28) | (s[7] >>> 4);\n      b11 = (s[7] << 28) | (s[6] >>> 4);\n      b42 = (s[17] << 23) | (s[16] >>> 9);\n      b43 = (s[16] << 23) | (s[17] >>> 9);\n      b24 = (s[26] << 25) | (s[27] >>> 7);\n      b25 = (s[27] << 25) | (s[26] >>> 7);\n      b6 = (s[36] << 21) | (s[37] >>> 11);\n      b7 = (s[37] << 21) | (s[36] >>> 11);\n      b38 = (s[47] << 24) | (s[46] >>> 8);\n      b39 = (s[46] << 24) | (s[47] >>> 8);\n      b30 = (s[8] << 27) | (s[9] >>> 5);\n      b31 = (s[9] << 27) | (s[8] >>> 5);\n      b12 = (s[18] << 20) | (s[19] >>> 12);\n      b13 = (s[19] << 20) | (s[18] >>> 12);\n      b44 = (s[29] << 7) | (s[28] >>> 25);\n      b45 = (s[28] << 7) | (s[29] >>> 25);\n      b26 = (s[38] << 8) | (s[39] >>> 24);\n      b27 = (s[39] << 8) | (s[38] >>> 24);\n      b8 = (s[48] << 14) | (s[49] >>> 18);\n      b9 = (s[49] << 14) | (s[48] >>> 18);\n\n      s[0] = b0 ^ (~b2 & b4);\n      s[1] = b1 ^ (~b3 & b5);\n      s[10] = b10 ^ (~b12 & b14);\n      s[11] = b11 ^ (~b13 & b15);\n      s[20] = b20 ^ (~b22 & b24);\n      s[21] = b21 ^ (~b23 & b25);\n      s[30] = b30 ^ (~b32 & b34);\n      s[31] = b31 ^ (~b33 & b35);\n      s[40] = b40 ^ (~b42 & b44);\n      s[41] = b41 ^ (~b43 & b45);\n      s[2] = b2 ^ (~b4 & b6);\n      s[3] = b3 ^ (~b5 & b7);\n      s[12] = b12 ^ (~b14 & b16);\n      s[13] = b13 ^ (~b15 & b17);\n      s[22] = b22 ^ (~b24 & b26);\n      s[23] = b23 ^ (~b25 & b27);\n      s[32] = b32 ^ (~b34 & b36);\n      s[33] = b33 ^ (~b35 & b37);\n      s[42] = b42 ^ (~b44 & b46);\n      s[43] = b43 ^ (~b45 & b47);\n      s[4] = b4 ^ (~b6 & b8);\n      s[5] = b5 ^ (~b7 & b9);\n      s[14] = b14 ^ (~b16 & b18);\n      s[15] = b15 ^ (~b17 & b19);\n      s[24] = b24 ^ (~b26 & b28);\n      s[25] = b25 ^ (~b27 & b29);\n      s[34] = b34 ^ (~b36 & b38);\n      s[35] = b35 ^ (~b37 & b39);\n      s[44] = b44 ^ (~b46 & b48);\n      s[45] = b45 ^ (~b47 & b49);\n      s[6] = b6 ^ (~b8 & b0);\n      s[7] = b7 ^ (~b9 & b1);\n      s[16] = b16 ^ (~b18 & b10);\n      s[17] = b17 ^ (~b19 & b11);\n      s[26] = b26 ^ (~b28 & b20);\n      s[27] = b27 ^ (~b29 & b21);\n      s[36] = b36 ^ (~b38 & b30);\n      s[37] = b37 ^ (~b39 & b31);\n      s[46] = b46 ^ (~b48 & b40);\n      s[47] = b47 ^ (~b49 & b41);\n      s[8] = b8 ^ (~b0 & b2);\n      s[9] = b9 ^ (~b1 & b3);\n      s[18] = b18 ^ (~b10 & b12);\n      s[19] = b19 ^ (~b11 & b13);\n      s[28] = b28 ^ (~b20 & b22);\n      s[29] = b29 ^ (~b21 & b23);\n      s[38] = b38 ^ (~b30 & b32);\n      s[39] = b39 ^ (~b31 & b33);\n      s[48] = b48 ^ (~b40 & b42);\n      s[49] = b49 ^ (~b41 & b43);\n\n      s[0] ^= RC[n];\n      s[1] ^= RC[n + 1];\n    }\n  };\n\n  if (COMMON_JS) {\n    module.exports = methods;\n  } else {\n    for (i = 0; i < methodNames.length; ++i) {\n      root[methodNames[i]] = methods[methodNames[i]];\n    }\n    if (AMD) {\n      !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n        return methods;\n      }.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n    }\n  }\n})();\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/js-sha3/src/sha3.js\n// module id = 958\n// module chunks = 0\n\n//# sourceURL=../node_modules/js-sha3/src/sha3.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = __webpack_require__(960)(__webpack_require__(964))\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/js.js\n// module id = 959\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/js.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar createKeccak = __webpack_require__(961)\nvar createShake = __webpack_require__(962)\n\nmodule.exports = function (KeccakState) {\n  var Keccak = createKeccak(KeccakState)\n  var Shake = createShake(KeccakState)\n\n  return function (algorithm, options) {\n    var hash = typeof algorithm === 'string' ? algorithm.toLowerCase() : algorithm\n    switch (hash) {\n      case 'keccak224': return new Keccak(1152, 448, null, 224, options)\n      case 'keccak256': return new Keccak(1088, 512, null, 256, options)\n      case 'keccak384': return new Keccak(832, 768, null, 384, options)\n      case 'keccak512': return new Keccak(576, 1024, null, 512, options)\n\n      case 'sha3-224': return new Keccak(1152, 448, 0x06, 224, options)\n      case 'sha3-256': return new Keccak(1088, 512, 0x06, 256, options)\n      case 'sha3-384': return new Keccak(832, 768, 0x06, 384, options)\n      case 'sha3-512': return new Keccak(576, 1024, 0x06, 512, options)\n\n      case 'shake128': return new Shake(1344, 256, 0x1f, options)\n      case 'shake256': return new Shake(1088, 512, 0x1f, options)\n\n      default: throw new Error('Invald algorithm: ' + algorithm)\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/lib/api/index.js\n// module id = 960\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/lib/api/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(46).Transform\nvar inherits = __webpack_require__(3)\n\nmodule.exports = function (KeccakState) {\n  function Keccak (rate, capacity, delimitedSuffix, hashBitLength, options) {\n    Transform.call(this, options)\n\n    this._rate = rate\n    this._capacity = capacity\n    this._delimitedSuffix = delimitedSuffix\n    this._hashBitLength = hashBitLength\n    this._options = options\n\n    this._state = new KeccakState()\n    this._state.initialize(rate, capacity)\n    this._finalized = false\n  }\n\n  inherits(Keccak, Transform)\n\n  Keccak.prototype._transform = function (chunk, encoding, callback) {\n    var error = null\n    try {\n      this.update(chunk, encoding)\n    } catch (err) {\n      error = err\n    }\n\n    callback(error)\n  }\n\n  Keccak.prototype._flush = function (callback) {\n    var error = null\n    try {\n      this.push(this.digest())\n    } catch (err) {\n      error = err\n    }\n\n    callback(error)\n  }\n\n  Keccak.prototype.update = function (data, encoding) {\n    if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')\n    if (this._finalized) throw new Error('Digest already called')\n    if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n    this._state.absorb(data)\n\n    return this\n  }\n\n  Keccak.prototype.digest = function (encoding) {\n    if (this._finalized) throw new Error('Digest already called')\n    this._finalized = true\n\n    if (this._delimitedSuffix) this._state.absorbLastFewBits(this._delimitedSuffix)\n    var digest = this._state.squeeze(this._hashBitLength / 8)\n    if (encoding !== undefined) digest = digest.toString(encoding)\n\n    this._resetState()\n\n    return digest\n  }\n\n  // remove result from memory\n  Keccak.prototype._resetState = function () {\n    this._state.initialize(this._rate, this._capacity)\n    return this\n  }\n\n  // because sometimes we need hash right now and little later\n  Keccak.prototype._clone = function () {\n    var clone = new Keccak(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options)\n    this._state.copy(clone._state)\n    clone._finalized = this._finalized\n\n    return clone\n  }\n\n  return Keccak\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/lib/api/keccak.js\n// module id = 961\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/lib/api/keccak.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(46).Transform\nvar inherits = __webpack_require__(3)\n\nmodule.exports = function (KeccakState) {\n  function Shake (rate, capacity, delimitedSuffix, options) {\n    Transform.call(this, options)\n\n    this._rate = rate\n    this._capacity = capacity\n    this._delimitedSuffix = delimitedSuffix\n    this._options = options\n\n    this._state = new KeccakState()\n    this._state.initialize(rate, capacity)\n    this._finalized = false\n  }\n\n  inherits(Shake, Transform)\n\n  Shake.prototype._transform = function (chunk, encoding, callback) {\n    var error = null\n    try {\n      this.update(chunk, encoding)\n    } catch (err) {\n      error = err\n    }\n\n    callback(error)\n  }\n\n  Shake.prototype._flush = function () {}\n\n  Shake.prototype._read = function (size) {\n    this.push(this.squeeze(size))\n  }\n\n  Shake.prototype.update = function (data, encoding) {\n    if (!Buffer.isBuffer(data) && typeof data !== 'string') throw new TypeError('Data must be a string or a buffer')\n    if (this._finalized) throw new Error('Squeeze already called')\n    if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n    this._state.absorb(data)\n\n    return this\n  }\n\n  Shake.prototype.squeeze = function (dataByteLength, encoding) {\n    if (!this._finalized) {\n      this._finalized = true\n      this._state.absorbLastFewBits(this._delimitedSuffix)\n    }\n\n    var data = this._state.squeeze(dataByteLength)\n    if (encoding !== undefined) data = data.toString(encoding)\n\n    return data\n  }\n\n  Shake.prototype._resetState = function () {\n    this._state.initialize(this._rate, this._capacity)\n    return this\n  }\n\n  Shake.prototype._clone = function () {\n    var clone = new Shake(this._rate, this._capacity, this._delimitedSuffix, this._options)\n    this._state.copy(clone._state)\n    clone._finalized = this._finalized\n\n    return clone\n  }\n\n  return Shake\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/lib/api/shake.js\n// module id = 962\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/lib/api/shake.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar P1600_ROUND_CONSTANTS = [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]\n\nexports.p1600 = function (s) {\n  for (var round = 0; round < 24; ++round) {\n    // theta\n    var lo0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40]\n    var hi0 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41]\n    var lo1 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42]\n    var hi1 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43]\n    var lo2 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44]\n    var hi2 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45]\n    var lo3 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46]\n    var hi3 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47]\n    var lo4 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48]\n    var hi4 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49]\n\n    var lo = lo4 ^ (lo1 << 1 | hi1 >>> 31)\n    var hi = hi4 ^ (hi1 << 1 | lo1 >>> 31)\n    var t1slo0 = s[0] ^ lo\n    var t1shi0 = s[1] ^ hi\n    var t1slo5 = s[10] ^ lo\n    var t1shi5 = s[11] ^ hi\n    var t1slo10 = s[20] ^ lo\n    var t1shi10 = s[21] ^ hi\n    var t1slo15 = s[30] ^ lo\n    var t1shi15 = s[31] ^ hi\n    var t1slo20 = s[40] ^ lo\n    var t1shi20 = s[41] ^ hi\n    lo = lo0 ^ (lo2 << 1 | hi2 >>> 31)\n    hi = hi0 ^ (hi2 << 1 | lo2 >>> 31)\n    var t1slo1 = s[2] ^ lo\n    var t1shi1 = s[3] ^ hi\n    var t1slo6 = s[12] ^ lo\n    var t1shi6 = s[13] ^ hi\n    var t1slo11 = s[22] ^ lo\n    var t1shi11 = s[23] ^ hi\n    var t1slo16 = s[32] ^ lo\n    var t1shi16 = s[33] ^ hi\n    var t1slo21 = s[42] ^ lo\n    var t1shi21 = s[43] ^ hi\n    lo = lo1 ^ (lo3 << 1 | hi3 >>> 31)\n    hi = hi1 ^ (hi3 << 1 | lo3 >>> 31)\n    var t1slo2 = s[4] ^ lo\n    var t1shi2 = s[5] ^ hi\n    var t1slo7 = s[14] ^ lo\n    var t1shi7 = s[15] ^ hi\n    var t1slo12 = s[24] ^ lo\n    var t1shi12 = s[25] ^ hi\n    var t1slo17 = s[34] ^ lo\n    var t1shi17 = s[35] ^ hi\n    var t1slo22 = s[44] ^ lo\n    var t1shi22 = s[45] ^ hi\n    lo = lo2 ^ (lo4 << 1 | hi4 >>> 31)\n    hi = hi2 ^ (hi4 << 1 | lo4 >>> 31)\n    var t1slo3 = s[6] ^ lo\n    var t1shi3 = s[7] ^ hi\n    var t1slo8 = s[16] ^ lo\n    var t1shi8 = s[17] ^ hi\n    var t1slo13 = s[26] ^ lo\n    var t1shi13 = s[27] ^ hi\n    var t1slo18 = s[36] ^ lo\n    var t1shi18 = s[37] ^ hi\n    var t1slo23 = s[46] ^ lo\n    var t1shi23 = s[47] ^ hi\n    lo = lo3 ^ (lo0 << 1 | hi0 >>> 31)\n    hi = hi3 ^ (hi0 << 1 | lo0 >>> 31)\n    var t1slo4 = s[8] ^ lo\n    var t1shi4 = s[9] ^ hi\n    var t1slo9 = s[18] ^ lo\n    var t1shi9 = s[19] ^ hi\n    var t1slo14 = s[28] ^ lo\n    var t1shi14 = s[29] ^ hi\n    var t1slo19 = s[38] ^ lo\n    var t1shi19 = s[39] ^ hi\n    var t1slo24 = s[48] ^ lo\n    var t1shi24 = s[49] ^ hi\n\n    // rho & pi\n    var t2slo0 = t1slo0\n    var t2shi0 = t1shi0\n    var t2slo16 = (t1shi5 << 4 | t1slo5 >>> 28)\n    var t2shi16 = (t1slo5 << 4 | t1shi5 >>> 28)\n    var t2slo7 = (t1slo10 << 3 | t1shi10 >>> 29)\n    var t2shi7 = (t1shi10 << 3 | t1slo10 >>> 29)\n    var t2slo23 = (t1shi15 << 9 | t1slo15 >>> 23)\n    var t2shi23 = (t1slo15 << 9 | t1shi15 >>> 23)\n    var t2slo14 = (t1slo20 << 18 | t1shi20 >>> 14)\n    var t2shi14 = (t1shi20 << 18 | t1slo20 >>> 14)\n    var t2slo10 = (t1slo1 << 1 | t1shi1 >>> 31)\n    var t2shi10 = (t1shi1 << 1 | t1slo1 >>> 31)\n    var t2slo1 = (t1shi6 << 12 | t1slo6 >>> 20)\n    var t2shi1 = (t1slo6 << 12 | t1shi6 >>> 20)\n    var t2slo17 = (t1slo11 << 10 | t1shi11 >>> 22)\n    var t2shi17 = (t1shi11 << 10 | t1slo11 >>> 22)\n    var t2slo8 = (t1shi16 << 13 | t1slo16 >>> 19)\n    var t2shi8 = (t1slo16 << 13 | t1shi16 >>> 19)\n    var t2slo24 = (t1slo21 << 2 | t1shi21 >>> 30)\n    var t2shi24 = (t1shi21 << 2 | t1slo21 >>> 30)\n    var t2slo20 = (t1shi2 << 30 | t1slo2 >>> 2)\n    var t2shi20 = (t1slo2 << 30 | t1shi2 >>> 2)\n    var t2slo11 = (t1slo7 << 6 | t1shi7 >>> 26)\n    var t2shi11 = (t1shi7 << 6 | t1slo7 >>> 26)\n    var t2slo2 = (t1shi12 << 11 | t1slo12 >>> 21)\n    var t2shi2 = (t1slo12 << 11 | t1shi12 >>> 21)\n    var t2slo18 = (t1slo17 << 15 | t1shi17 >>> 17)\n    var t2shi18 = (t1shi17 << 15 | t1slo17 >>> 17)\n    var t2slo9 = (t1shi22 << 29 | t1slo22 >>> 3)\n    var t2shi9 = (t1slo22 << 29 | t1shi22 >>> 3)\n    var t2slo5 = (t1slo3 << 28 | t1shi3 >>> 4)\n    var t2shi5 = (t1shi3 << 28 | t1slo3 >>> 4)\n    var t2slo21 = (t1shi8 << 23 | t1slo8 >>> 9)\n    var t2shi21 = (t1slo8 << 23 | t1shi8 >>> 9)\n    var t2slo12 = (t1slo13 << 25 | t1shi13 >>> 7)\n    var t2shi12 = (t1shi13 << 25 | t1slo13 >>> 7)\n    var t2slo3 = (t1slo18 << 21 | t1shi18 >>> 11)\n    var t2shi3 = (t1shi18 << 21 | t1slo18 >>> 11)\n    var t2slo19 = (t1shi23 << 24 | t1slo23 >>> 8)\n    var t2shi19 = (t1slo23 << 24 | t1shi23 >>> 8)\n    var t2slo15 = (t1slo4 << 27 | t1shi4 >>> 5)\n    var t2shi15 = (t1shi4 << 27 | t1slo4 >>> 5)\n    var t2slo6 = (t1slo9 << 20 | t1shi9 >>> 12)\n    var t2shi6 = (t1shi9 << 20 | t1slo9 >>> 12)\n    var t2slo22 = (t1shi14 << 7 | t1slo14 >>> 25)\n    var t2shi22 = (t1slo14 << 7 | t1shi14 >>> 25)\n    var t2slo13 = (t1slo19 << 8 | t1shi19 >>> 24)\n    var t2shi13 = (t1shi19 << 8 | t1slo19 >>> 24)\n    var t2slo4 = (t1slo24 << 14 | t1shi24 >>> 18)\n    var t2shi4 = (t1shi24 << 14 | t1slo24 >>> 18)\n\n    // chi\n    s[0] = t2slo0 ^ (~t2slo1 & t2slo2)\n    s[1] = t2shi0 ^ (~t2shi1 & t2shi2)\n    s[10] = t2slo5 ^ (~t2slo6 & t2slo7)\n    s[11] = t2shi5 ^ (~t2shi6 & t2shi7)\n    s[20] = t2slo10 ^ (~t2slo11 & t2slo12)\n    s[21] = t2shi10 ^ (~t2shi11 & t2shi12)\n    s[30] = t2slo15 ^ (~t2slo16 & t2slo17)\n    s[31] = t2shi15 ^ (~t2shi16 & t2shi17)\n    s[40] = t2slo20 ^ (~t2slo21 & t2slo22)\n    s[41] = t2shi20 ^ (~t2shi21 & t2shi22)\n    s[2] = t2slo1 ^ (~t2slo2 & t2slo3)\n    s[3] = t2shi1 ^ (~t2shi2 & t2shi3)\n    s[12] = t2slo6 ^ (~t2slo7 & t2slo8)\n    s[13] = t2shi6 ^ (~t2shi7 & t2shi8)\n    s[22] = t2slo11 ^ (~t2slo12 & t2slo13)\n    s[23] = t2shi11 ^ (~t2shi12 & t2shi13)\n    s[32] = t2slo16 ^ (~t2slo17 & t2slo18)\n    s[33] = t2shi16 ^ (~t2shi17 & t2shi18)\n    s[42] = t2slo21 ^ (~t2slo22 & t2slo23)\n    s[43] = t2shi21 ^ (~t2shi22 & t2shi23)\n    s[4] = t2slo2 ^ (~t2slo3 & t2slo4)\n    s[5] = t2shi2 ^ (~t2shi3 & t2shi4)\n    s[14] = t2slo7 ^ (~t2slo8 & t2slo9)\n    s[15] = t2shi7 ^ (~t2shi8 & t2shi9)\n    s[24] = t2slo12 ^ (~t2slo13 & t2slo14)\n    s[25] = t2shi12 ^ (~t2shi13 & t2shi14)\n    s[34] = t2slo17 ^ (~t2slo18 & t2slo19)\n    s[35] = t2shi17 ^ (~t2shi18 & t2shi19)\n    s[44] = t2slo22 ^ (~t2slo23 & t2slo24)\n    s[45] = t2shi22 ^ (~t2shi23 & t2shi24)\n    s[6] = t2slo3 ^ (~t2slo4 & t2slo0)\n    s[7] = t2shi3 ^ (~t2shi4 & t2shi0)\n    s[16] = t2slo8 ^ (~t2slo9 & t2slo5)\n    s[17] = t2shi8 ^ (~t2shi9 & t2shi5)\n    s[26] = t2slo13 ^ (~t2slo14 & t2slo10)\n    s[27] = t2shi13 ^ (~t2shi14 & t2shi10)\n    s[36] = t2slo18 ^ (~t2slo19 & t2slo15)\n    s[37] = t2shi18 ^ (~t2shi19 & t2shi15)\n    s[46] = t2slo23 ^ (~t2slo24 & t2slo20)\n    s[47] = t2shi23 ^ (~t2shi24 & t2shi20)\n    s[8] = t2slo4 ^ (~t2slo0 & t2slo1)\n    s[9] = t2shi4 ^ (~t2shi0 & t2shi1)\n    s[18] = t2slo9 ^ (~t2slo5 & t2slo6)\n    s[19] = t2shi9 ^ (~t2shi5 & t2shi6)\n    s[28] = t2slo14 ^ (~t2slo10 & t2slo11)\n    s[29] = t2shi14 ^ (~t2shi10 & t2shi11)\n    s[38] = t2slo19 ^ (~t2slo15 & t2slo16)\n    s[39] = t2shi19 ^ (~t2shi15 & t2shi16)\n    s[48] = t2slo24 ^ (~t2slo20 & t2slo21)\n    s[49] = t2shi24 ^ (~t2shi20 & t2shi21)\n\n    // iota\n    s[0] ^= P1600_ROUND_CONSTANTS[round * 2]\n    s[1] ^= P1600_ROUND_CONSTANTS[round * 2 + 1]\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/lib/keccak-state-unroll.js\n// module id = 963\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/lib/keccak-state-unroll.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar keccakState = __webpack_require__(963)\n\nfunction Keccak () {\n  // much faster than `new Array(50)`\n  this.state = [\n    0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0,\n    0, 0, 0, 0, 0\n  ]\n\n  this.blockSize = null\n  this.count = 0\n  this.squeezing = false\n}\n\nKeccak.prototype.initialize = function (rate, capacity) {\n  for (var i = 0; i < 50; ++i) this.state[i] = 0\n  this.blockSize = rate / 8\n  this.count = 0\n  this.squeezing = false\n}\n\nKeccak.prototype.absorb = function (data) {\n  for (var i = 0; i < data.length; ++i) {\n    this.state[~~(this.count / 4)] ^= data[i] << (8 * (this.count % 4))\n    this.count += 1\n    if (this.count === this.blockSize) {\n      keccakState.p1600(this.state)\n      this.count = 0\n    }\n  }\n}\n\nKeccak.prototype.absorbLastFewBits = function (bits) {\n  this.state[~~(this.count / 4)] ^= bits << (8 * (this.count % 4))\n  if ((bits & 0x80) !== 0 && this.count === (this.blockSize - 1)) keccakState.p1600(this.state)\n  this.state[~~((this.blockSize - 1) / 4)] ^= 0x80 << (8 * ((this.blockSize - 1) % 4))\n  keccakState.p1600(this.state)\n  this.count = 0\n  this.squeezing = true\n}\n\nKeccak.prototype.squeeze = function (length) {\n  if (!this.squeezing) this.absorbLastFewBits(0x01)\n\n  var output = Buffer.alloc(length)\n  for (var i = 0; i < length; ++i) {\n    output[i] = (this.state[~~(this.count / 4)] >>> (8 * (this.count % 4))) & 0xff\n    this.count += 1\n    if (this.count === this.blockSize) {\n      keccakState.p1600(this.state)\n      this.count = 0\n    }\n  }\n\n  return output\n}\n\nKeccak.prototype.copy = function (dest) {\n  for (var i = 0; i < 50; ++i) dest.state[i] = this.state[i]\n  dest.blockSize = this.blockSize\n  dest.count = this.count\n  dest.squeezing = this.squeezing\n}\n\nmodule.exports = Keccak\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/keccak/lib/keccak.js\n// module id = 964\n// module chunks = 0\n\n//# sourceURL=../node_modules/keccak/lib/keccak.js")},function(module,exports,__webpack_require__){eval("var encodings = __webpack_require__(966);\n\nmodule.exports = Codec;\n\nfunction Codec(opts){\n  this.opts = opts || {};\n  this.encodings = encodings;\n}\n\nCodec.prototype._encoding = function(encoding){\n  if (typeof encoding == 'string') encoding = encodings[encoding];\n  if (!encoding) encoding = encodings.id;\n  return encoding;\n};\n\nCodec.prototype._keyEncoding = function(opts, batchOpts){\n  return this._encoding(batchOpts && batchOpts.keyEncoding\n    || opts && opts.keyEncoding\n    || this.opts.keyEncoding);\n};\n\nCodec.prototype._valueEncoding = function(opts, batchOpts){\n  return this._encoding(\n    batchOpts && (batchOpts.valueEncoding || batchOpts.encoding)\n    || opts && (opts.valueEncoding || opts.encoding)\n    || (this.opts.valueEncoding || this.opts.encoding));\n};\n\nCodec.prototype.encodeKey = function(key, opts, batchOpts){\n  return this._keyEncoding(opts, batchOpts).encode(key);\n};\n\nCodec.prototype.encodeValue = function(value, opts, batchOpts){\n  return this._valueEncoding(opts, batchOpts).encode(value);\n};\n\nCodec.prototype.decodeKey = function(key, opts){\n  return this._keyEncoding(opts).decode(key);\n};\n\nCodec.prototype.decodeValue = function(value, opts){\n  return this._valueEncoding(opts).decode(value);\n};\n\nCodec.prototype.encodeBatch = function(ops, opts){\n  var self = this;\n\n  return ops.map(function(_op){\n    var op = {\n      type: _op.type,\n      key: self.encodeKey(_op.key, opts, _op)\n    };\n    if (self.keyAsBuffer(opts, _op)) op.keyEncoding = 'binary';\n    if (_op.prefix) op.prefix = _op.prefix;\n    if ('value' in _op) {\n      op.value = self.encodeValue(_op.value, opts, _op);\n      if (self.valueAsBuffer(opts, _op)) op.valueEncoding = 'binary';\n    }\n    return op;\n  });\n};\n\nvar ltgtKeys = ['lt', 'gt', 'lte', 'gte', 'start', 'end'];\n\nCodec.prototype.encodeLtgt = function(ltgt){\n  var self = this;\n  var ret = {};\n  Object.keys(ltgt).forEach(function(key){\n    ret[key] = ltgtKeys.indexOf(key) > -1\n      ? self.encodeKey(ltgt[key], ltgt)\n      : ltgt[key]\n  });\n  return ret;\n};\n\nCodec.prototype.createStreamDecoder = function(opts){\n  var self = this;\n\n  if (opts.keys && opts.values) {\n    return function(key, value){\n      return {\n        key: self.decodeKey(key, opts),\n        value: self.decodeValue(value, opts)\n      };\n    };\n  } else if (opts.keys) {\n    return function(key) {\n      return self.decodeKey(key, opts);\n    }; \n  } else if (opts.values) {\n    return function(_, value){\n      return self.decodeValue(value, opts);\n    }\n  } else {\n    return function(){};\n  }\n};\n\nCodec.prototype.keyAsBuffer = function(opts){\n  return this._keyEncoding(opts).buffer;\n};\n\nCodec.prototype.valueAsBuffer = function(opts){\n  return this._valueEncoding(opts).buffer;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-codec/index.js\n// module id = 965\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-codec/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {exports.utf8 = exports['utf-8'] = {\n  encode: function(data){\n    return isBinary(data)\n      ? data\n      : String(data);\n  },\n  decode: function(data){\n    return typeof data === 'string'\n      ? data\n      : String(data)\n  },\n  buffer: false,\n  type: 'utf8'\n};\n\nexports.json = {\n  encode: JSON.stringify,\n  decode: JSON.parse,\n  buffer: false,\n  type: 'json'\n};\n\nexports.binary = {\n  encode: function(data){\n    return isBinary(data)\n      ? data\n      : new Buffer(data);      \n  },\n  decode: identity,\n  buffer: true,\n  type: 'binary'\n};\n\nexports.none = {\n  encode: identity,\n  decode: identity,\n  buffer: false,\n  type: 'id'\n};\n\nexports.id = exports.none;\n\nvar bufferEncodings = [\n  'hex',\n  'ascii',\n  'base64',\n  'ucs2',\n  'ucs-2',\n  'utf16le',\n  'utf-16le'\n];\n\nbufferEncodings.forEach(function(type){\n  exports[type] = {\n    encode: function(data){\n      return isBinary(data)\n        ? data\n        : new Buffer(data, type);\n    },\n    decode: function(buffer){\n      return buffer.toString(type);\n    },\n    buffer: true,\n    type: type\n  };\n});\n\nfunction identity(value){\n  return value;\n}\n\nfunction isBinary(data){\n  return data === undefined\n    || data === null\n    || Buffer.isBuffer(data);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-codec/lib/encodings.js\n// module id = 966\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-codec/lib/encodings.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\nvar Readable = __webpack_require__(970).Readable;\nvar extend = __webpack_require__(73);\nvar EncodingError = __webpack_require__(192).EncodingError;\n\nmodule.exports = ReadStream;\ninherits(ReadStream, Readable);\n\nfunction ReadStream(iterator, options){\n  if (!(this instanceof ReadStream)) return new ReadStream(iterator, options);\n  Readable.call(this, extend(options, {\n    objectMode: true\n  }));\n  this._iterator = iterator;\n  this._destroyed = false;\n  this._decoder = null;\n  if (options && options.decoder) this._decoder = options.decoder;\n  this.on('end', this._cleanup.bind(this));\n}\n\nReadStream.prototype._read = function(){\n  var self = this;\n  if (this._destroyed) return;\n\n  this._iterator.next(function(err, key, value){\n    if (self._destroyed) return;\n    if (err) return self.emit('error', err);\n    if (key === undefined && value === undefined) {\n      self.push(null);\n    } else {\n      if (!self._decoder) return self.push({ key: key, value: value });\n\n      try {\n        var value = self._decoder(key, value);\n      } catch (err) {\n        self.emit('error', new EncodingError(err));\n        self.push(null);\n        return;\n      }\n      self.push(value);\n    }\n  });\n};\n\nReadStream.prototype.destroy =\nReadStream.prototype._cleanup = function(){\n  var self = this;\n  if (this._destroyed) return;\n  this._destroyed = true;\n\n  this._iterator.end(function(err){\n    if (err) return self.emit('error', err);\n    self.emit('close');\n  });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/index.js\n// module id = 967\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/index.js")},function(module,exports){eval("module.exports = Array.isArray || function (arr) {\n  return Object.prototype.toString.call(arr) == '[object Array]';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/isarray/index.js\n// module id = 968\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/isarray/index.js")},function(module,exports,__webpack_require__){eval('// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(434);\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough))\n    return new PassThrough(options);\n\n  Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function(chunk, encoding, cb) {\n  cb(null, chunk);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/lib/_stream_passthrough.js\n// module id = 969\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/lib/_stream_passthrough.js')},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = __webpack_require__(433);\nexports.Stream = __webpack_require__(46);\nexports.Readable = exports;\nexports.Writable = __webpack_require__(435);\nexports.Duplex = __webpack_require__(122);\nexports.Transform = __webpack_require__(434);\nexports.PassThrough = __webpack_require__(969);\nif (!process.browser && __webpack_require__.i({"NODE_ENV":"production","DC_NETWORK":"ropsten","PUBLIC_URL":""}).READABLE_STREAM === \'disable\') {\n  module.exports = __webpack_require__(46);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-iterator-stream/~/readable-stream/readable.js\n// module id = 970\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-iterator-stream/node_modules/readable-stream/readable.js')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer, process) {var util = __webpack_require__(104)\nvar AbstractIterator  = __webpack_require__(439).AbstractIterator\nvar ltgt = __webpack_require__(1092)\nvar idbReadableStream = __webpack_require__(880)\nvar stream = __webpack_require__(46)\nvar xtend = __webpack_require__(73)\n\nvar Writable = stream.Writable\n\nmodule.exports = Iterator\n\n/**\n * Open IndexedDB cursor.\n *\n * @param {Object} db  db instance\n * @param {Object} [options]  options\n *\n * options:\n *   snapshot {Boolean}  Whether to use snapshot mode, that may lead to memory\n *     spikes, or use back pressure, that can't guarantee the same snapshot. This\n *     option is true by default.\n */\nfunction Iterator(db, options) {\n  this._db = db._db\n  this._idbOpts = db._idbOpts\n\n  AbstractIterator.call(this, db)\n\n  this._options = xtend({\n    snapshot: true\n  }, this._idbOpts, options)\n\n  this._limit = this._options.limit\n  if (this._limit == null || this._limit === -1) {\n    this._limit = Infinity\n  }\n  if (typeof this._limit !== 'number') throw new TypeError('options.limit must be a number')\n  if (this._limit === 0) return // skip further processing and wait for first call to _next\n\n  this._count = 0\n\n  this._startCursor(this._options)\n}\n\nutil.inherits(Iterator, AbstractIterator)\n\nIterator.prototype._startCursor = function(options) {\n  options = xtend(this._options, options)\n\n  var self = this\n\n  var keyRange = null\n  var lower = ltgt.lowerBound(options)\n  var upper = ltgt.upperBound(options)\n  var lowerOpen = ltgt.lowerBoundExclusive(options)\n  var upperOpen = ltgt.upperBoundExclusive(options)\n\n  var direction = options.reverse ? 'prev': 'next'\n\n  // support binary keys for any iterable type via array (ArrayBuffers as keys are only supported in IndexedDB Second Edition)\n  if (lower)\n    if (options.keyEncoding === 'binary' && !Array.isArray(lower)) lower = Array.prototype.slice.call(lower)\n  if (upper)\n    if (options.keyEncoding === 'binary' && !Array.isArray(upper)) upper = Array.prototype.slice.call(upper)\n\n  if (lower && upper)\n    try {\n      keyRange = IDBKeyRange.bound(lower, upper, lowerOpen, upperOpen)\n    } catch (err) {\n      // skip the iterator and return 0 results if IDBKeyRange throws a DataError (if keys overlap)\n      this._keyRangeError = true\n      return\n    }\n  else if (lower)\n    keyRange = IDBKeyRange.lowerBound(lower, lowerOpen)\n  else if (upper)\n    keyRange = IDBKeyRange.upperBound(upper, upperOpen)\n\n  this._reader = idbReadableStream(this._db, this._idbOpts.storeName, xtend(options, { range: keyRange, direction: direction }))\n\n  this._reader.on('error', function(err) {\n    var cb = self._callback\n    self._callback = false\n\n    if (cb)\n      cb(err)\n    else // else wait for _next\n      self._readNext = function(cb) {\n        cb(err)\n      }\n  })\n\n  this._reader.pipe(new Writable({\n    objectMode: true,\n    write: function(item, enc, cb) {\n      if (self._count++ >= self._limit) { // limit reached, finish\n        self._reader.pause()\n        self._reader.unpipe(this)\n        cb()\n        this.end()\n        return\n      }\n\n      var cb2 = self._callback\n      self._callback = false\n\n      if (cb2)\n        self._processItem(item, function(err, key, value) {\n          cb(err) // proceed with next item\n          cb2(err, key, value)\n        })\n      else // else wait for _next\n        self._readNext = function(cb2) {\n          self._processItem(item, function(err, key, value) {\n            cb(err) // proceed with next item\n            cb2(err, key, value)\n          })\n        }\n\n    }\n  })).on('finish', function() {\n    var cb = self._callback\n    self._callback = false\n\n    if (cb)\n      cb()\n    else // else wait for _next\n      self._readNext = function(cb) {\n        cb()\n      }\n  })\n}\n\nIterator.prototype._processItem = function(item, cb) {\n  if (typeof cb !== 'function') throw new TypeError('cb must be a function')\n\n  var key = item.key\n  var value = item.value\n\n  // automatically convert Uint8Array values to Buffer\n  if (value instanceof Uint8Array) value = new Buffer(value)\n  if (this._options.keyEncoding === 'binary' && Array.isArray(key)) key = new Buffer(key)\n  if (this._options.valueEncoding === 'binary' && !Buffer.isBuffer(value)) value = new Buffer(value)\n\n  if (this._options.keyAsBuffer && !Buffer.isBuffer(key)) {\n    if (key == null)                     key = new Buffer(0)\n    else if (typeof key === 'string')    key = new Buffer(key) // defaults to utf8, should the encoding be utf16? (DOMString)\n    else if (typeof key === 'boolean')   key = new Buffer(String(key)) // compatible with leveldb\n    else if (typeof key === 'number')    key = new Buffer(String(key)) // compatible with leveldb\n    else if (Array.isArray(key))         key = new Buffer(String(key)) // compatible with leveldb\n    else if (key instanceof Uint8Array)  key = new Buffer(key)\n    else throw new TypeError('can\\'t coerce `' + key.constructor.name + '` into a Buffer')\n  }\n\n  if (this._options.valueAsBuffer && !Buffer.isBuffer(value)) {\n    if (value == null)                     value = new Buffer(0)\n    else if (typeof value === 'string')    value = new Buffer(value) // defaults to utf8, should the encoding be utf16? (DOMString)\n    else if (typeof value === 'boolean')   value = new Buffer(String(value)) // compatible with leveldb\n    else if (typeof value === 'number')    value = new Buffer(String(value)) // compatible with leveldb\n    else if (Array.isArray(value))         value = new Buffer(String(value)) // compatible with leveldb\n    else if (value instanceof Uint8Array)  value = new Buffer(value)\n    else throw new TypeError('can\\'t coerce `' + value.constructor.name + '` into a Buffer')\n  }\n\n  cb(null, key, value)\n}\n\n// register a callback, only call it directly if a nextHandler is registered\nIterator.prototype._next = function(callback) {\n  if (this._callback) throw new Error('callback already exists') // each callback should be invoked exactly once\n  if (this._keyRangeError || this._limit === 0) return void callback()\n\n  var readNext = this._readNext\n  this._readNext = false\n\n  if (readNext) {\n    process.nextTick(function() {\n      readNext(callback)\n    })\n  } else {\n    this._callback = callback\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/iterator.js\n// module id = 971\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/iterator.js")},function(module,exports,__webpack_require__){eval("var AbstractLevelDOWN = __webpack_require__(438)\n\nfunction isLevelDOWN (db) {\n  if (!db || typeof db !== 'object')\n    return false\n  return Object.keys(AbstractLevelDOWN.prototype).filter(function (name) {\n    // TODO remove approximateSize check when method is gone\n    return name[0] != '_' && name != 'approximateSize'\n  }).every(function (name) {\n    return typeof db[name] == 'function'\n  })\n}\n\nmodule.exports = isLevelDOWN\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/level-js/~/abstract-leveldown/is-leveldown.js\n// module id = 972\n// module chunks = 0\n\n//# sourceURL=../node_modules/level-js/node_modules/abstract-leveldown/is-leveldown.js")},function(module,exports,__webpack_require__){eval("/* Copyright (c) 2012-2016 LevelUP contributors\n * See list at <https://github.com/level/levelup#contributing>\n * MIT License\n * <https://github.com/level/levelup/blob/master/LICENSE.md>\n */\n\nvar util = __webpack_require__(440)\nvar WriteError = __webpack_require__(192).WriteError\nvar getOptions = util.getOptions\nvar dispatchError = util.dispatchError\n\nfunction Batch (levelup, codec) {\n  this._levelup = levelup\n  this._codec = codec\n  this.batch = levelup.db.batch()\n  this.ops = []\n  this.length = 0\n}\n\nBatch.prototype.put = function (key_, value_, options) {\n  options = getOptions(options)\n\n  var key = this._codec.encodeKey(key_, options)\n  var value = this._codec.encodeValue(value_, options)\n\n  try {\n    this.batch.put(key, value)\n  } catch (e) {\n    throw new WriteError(e)\n  }\n\n  this.ops.push({ type: 'put', key: key, value: value })\n  this.length++\n\n  return this\n}\n\nBatch.prototype.del = function (key_, options) {\n  options = getOptions(options)\n\n  var key = this._codec.encodeKey(key_, options)\n\n  try {\n    this.batch.del(key)\n  } catch (err) {\n    throw new WriteError(err)\n  }\n\n  this.ops.push({ type: 'del', key: key })\n  this.length++\n\n  return this\n}\n\nBatch.prototype.clear = function () {\n  try {\n    this.batch.clear()\n  } catch (err) {\n    throw new WriteError(err)\n  }\n\n  this.ops = []\n  this.length = 0\n\n  return this\n}\n\nBatch.prototype.write = function (callback) {\n  var levelup = this._levelup\n  var ops = this.ops\n\n  try {\n    this.batch.write(function (err) {\n      if (err) { return dispatchError(levelup, new WriteError(err), callback) }\n      levelup.emit('batch', ops)\n      if (callback) { callback() }\n    })\n  } catch (err) {\n    throw new WriteError(err)\n  }\n}\n\nmodule.exports = Batch\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/levelup/lib/batch.js\n// module id = 973\n// module chunks = 0\n\n//# sourceURL=../node_modules/levelup/lib/batch.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {/* Copyright (c) 2012-2016 LevelUP contributors\n * See list at <https://github.com/level/levelup#contributing>\n * MIT License\n * <https://github.com/level/levelup/blob/master/LICENSE.md>\n */\n\nvar EventEmitter = __webpack_require__(15).EventEmitter\nvar inherits = __webpack_require__(104).inherits\nvar deprecate = __webpack_require__(104).deprecate\nvar extend = __webpack_require__(73)\nvar prr = __webpack_require__(508)\nvar DeferredLevelDOWN = __webpack_require__(804)\nvar IteratorStream = __webpack_require__(967)\nvar Batch = __webpack_require__(973)\nvar Codec = __webpack_require__(965)\nvar getLevelDOWN = __webpack_require__(1353)\nvar errors = __webpack_require__(192)\nvar util = __webpack_require__(440)\n\nvar WriteError = errors.WriteError\nvar ReadError = errors.ReadError\nvar NotFoundError = errors.NotFoundError\nvar OpenError = errors.OpenError\nvar EncodingError = errors.EncodingError\nvar InitializationError = errors.InitializationError\nvar LevelUPError = errors.LevelUPError\n\nvar getOptions = util.getOptions\nvar defaultOptions = util.defaultOptions\nvar dispatchError = util.dispatchError\n\nfunction getCallback (options, callback) {\n  return typeof options === 'function' ? options : callback\n}\n\n// Possible LevelUP#_status values:\n//  - 'new'     - newly created, not opened or closed\n//  - 'opening' - waiting for the database to be opened, post open()\n//  - 'open'    - successfully opened the database, available for use\n//  - 'closing' - waiting for the database to be closed, post close()\n//  - 'closed'  - database has been successfully closed, should not be\n//                 used except for another open() operation\n\nfunction LevelUP (location, options, callback) {\n  if (!(this instanceof LevelUP)) { return new LevelUP(location, options, callback) }\n\n  var error\n\n  EventEmitter.call(this)\n  this.setMaxListeners(Infinity)\n\n  if (typeof location === 'function') {\n    options = typeof options === 'object' ? options : {}\n    options.db = location\n    location = null\n  } else if (typeof location === 'object' && typeof location.db === 'function') {\n    options = location\n    location = null\n  }\n\n  if (typeof options === 'function') {\n    callback = options\n    options = {}\n  }\n\n  if ((!options || typeof options.db !== 'function') && typeof location !== 'string') {\n    error = new InitializationError(\n        'Must provide a location for the database')\n    if (callback) {\n      return process.nextTick(function () {\n        callback(error)\n      })\n    }\n    throw error\n  }\n\n  options = getOptions(options)\n  this.options = extend(defaultOptions, options)\n  this._codec = new Codec(this.options)\n  this._status = 'new'\n  // set this.location as enumerable but not configurable or writable\n  prr(this, 'location', location, 'e')\n\n  this.open(callback)\n}\n\ninherits(LevelUP, EventEmitter)\n\nLevelUP.prototype.open = function (callback) {\n  var self = this\n  var dbFactory\n  var db\n\n  if (this.isOpen()) {\n    if (callback) { process.nextTick(function () { callback(null, self) }) }\n    return this\n  }\n\n  if (this._isOpening()) {\n    return callback && this.once('open', function () { callback(null, self) })\n  }\n\n  this.emit('opening')\n  this._status = 'opening'\n  this.db = new DeferredLevelDOWN(this.location)\n\n  if (typeof this.options.db !== 'function' &&\n      typeof getLevelDOWN !== 'function') {\n    throw new LevelUPError('missing db factory, you need to set options.db')\n  }\n\n  dbFactory = this.options.db || getLevelDOWN()\n  db = dbFactory(this.location)\n\n  db.open(this.options, function (err) {\n    if (err) {\n      return dispatchError(self, new OpenError(err), callback)\n    }\n    self.db.setDb(db)\n    self.db = db\n    self._status = 'open'\n    if (callback) { callback(null, self) }\n    self.emit('open')\n    self.emit('ready')\n  })\n}\n\nLevelUP.prototype.close = function (callback) {\n  var self = this\n\n  if (this.isOpen()) {\n    this._status = 'closing'\n    this.db.close(function () {\n      self._status = 'closed'\n      self.emit('closed')\n      if (callback) { callback.apply(null, arguments) }\n    })\n    this.emit('closing')\n    this.db = new DeferredLevelDOWN(this.location)\n  } else if (this._status === 'closed' && callback) {\n    return process.nextTick(callback)\n  } else if (this._status === 'closing' && callback) {\n    this.once('closed', callback)\n  } else if (this._isOpening()) {\n    this.once('open', function () {\n      self.close(callback)\n    })\n  }\n}\n\nLevelUP.prototype.isOpen = function () {\n  return this._status === 'open'\n}\n\nLevelUP.prototype._isOpening = function () {\n  return this._status === 'opening'\n}\n\nLevelUP.prototype.isClosed = function () {\n  return (/^clos/).test(this._status)\n}\n\nfunction maybeError (db, options, callback) {\n  if (!db._isOpening() && !db.isOpen()) {\n    dispatchError(db, new ReadError('Database is not open'), callback)\n    return true\n  }\n}\n\nfunction writeError (db, message, callback) {\n  dispatchError(db, new WriteError(message), callback)\n}\n\nfunction readError (db, message, callback) {\n  dispatchError(db, new ReadError(message), callback)\n}\n\nLevelUP.prototype.get = function (key_, options, callback) {\n  var self = this\n  var key\n\n  callback = getCallback(options, callback)\n\n  if (maybeError(this, options, callback)) { return }\n\n  if (key_ === null || key_ === undefined || typeof callback !== 'function') {\n    return readError(this, 'get() requires key and callback arguments', callback)\n  }\n\n  options = util.getOptions(options)\n  key = this._codec.encodeKey(key_, options)\n\n  options.asBuffer = this._codec.valueAsBuffer(options)\n\n  this.db.get(key, options, function (err, value) {\n    if (err) {\n      if ((/notfound/i).test(err) || err.notFound) {\n        err = new NotFoundError(\n            'Key not found in database [' + key_ + ']', err)\n      } else {\n        err = new ReadError(err)\n      }\n      return dispatchError(self, err, callback)\n    }\n    if (callback) {\n      try {\n        value = self._codec.decodeValue(value, options)\n      } catch (e) {\n        return callback(new EncodingError(e))\n      }\n      callback(null, value)\n    }\n  })\n}\n\nLevelUP.prototype.put = function (key_, value_, options, callback) {\n  var self = this\n  var key\n  var value\n\n  callback = getCallback(options, callback)\n\n  if (key_ === null || key_ === undefined) { return writeError(this, 'put() requires a key argument', callback) }\n\n  if (maybeError(this, options, callback)) { return }\n\n  options = getOptions(options)\n  key = this._codec.encodeKey(key_, options)\n  value = this._codec.encodeValue(value_, options)\n\n  this.db.put(key, value, options, function (err) {\n    if (err) {\n      return dispatchError(self, new WriteError(err), callback)\n    }\n    self.emit('put', key_, value_)\n    if (callback) { callback() }\n  })\n}\n\nLevelUP.prototype.del = function (key_, options, callback) {\n  var self = this\n  var key\n\n  callback = getCallback(options, callback)\n\n  if (key_ === null || key_ === undefined) { return writeError(this, 'del() requires a key argument', callback) }\n\n  if (maybeError(this, options, callback)) { return }\n\n  options = getOptions(options)\n  key = this._codec.encodeKey(key_, options)\n\n  this.db.del(key, options, function (err) {\n    if (err) {\n      return dispatchError(self, new WriteError(err), callback)\n    }\n    self.emit('del', key_)\n    if (callback) { callback() }\n  })\n}\n\nLevelUP.prototype.batch = function (arr_, options, callback) {\n  var self = this\n  var arr\n\n  if (!arguments.length) { return new Batch(this, this._codec) }\n\n  callback = getCallback(options, callback)\n\n  if (!Array.isArray(arr_)) { return writeError(this, 'batch() requires an array argument', callback) }\n\n  if (maybeError(this, options, callback)) { return }\n\n  options = getOptions(options)\n  arr = self._codec.encodeBatch(arr_, options)\n  arr = arr.map(function (op) {\n    if (!op.type && op.key !== undefined && op.value !== undefined) { op.type = 'put' }\n    return op\n  })\n\n  this.db.batch(arr, options, function (err) {\n    if (err) {\n      return dispatchError(self, new WriteError(err), callback)\n    }\n    self.emit('batch', arr_)\n    if (callback) { callback() }\n  })\n}\n\nLevelUP.prototype.approximateSize = deprecate(function (start_, end_, options, callback) {\n  var self = this\n  var start\n  var end\n\n  callback = getCallback(options, callback)\n\n  options = getOptions(options)\n\n  if (start_ === null || start_ === undefined || end_ === null ||\n      end_ === undefined || typeof callback !== 'function') {\n    return readError(this, 'approximateSize() requires start, end and callback arguments', callback)\n  }\n\n  start = this._codec.encodeKey(start_, options)\n  end = this._codec.encodeKey(end_, options)\n\n  this.db.approximateSize(start, end, function (err, size) {\n    if (err) {\n      return dispatchError(self, new OpenError(err), callback)\n    } else if (callback) {\n      callback(null, size)\n    }\n  })\n}, 'db.approximateSize() is deprecated. Use db.db.approximateSize() instead')\n\nLevelUP.prototype.readStream =\nLevelUP.prototype.createReadStream = function (options) {\n  options = extend({keys: true, values: true}, this.options, options)\n\n  options.keyEncoding = options.keyEncoding\n  options.valueEncoding = options.valueEncoding\n\n  options = this._codec.encodeLtgt(options)\n  options.keyAsBuffer = this._codec.keyAsBuffer(options)\n  options.valueAsBuffer = this._codec.valueAsBuffer(options)\n\n  if (typeof options.limit !== 'number') { options.limit = -1 }\n\n  return new IteratorStream(this.db.iterator(options), extend(options, {\n    decoder: this._codec.createStreamDecoder(options)\n  }))\n}\n\nLevelUP.prototype.keyStream =\nLevelUP.prototype.createKeyStream = function (options) {\n  return this.createReadStream(extend(options, { keys: true, values: false }))\n}\n\nLevelUP.prototype.valueStream =\nLevelUP.prototype.createValueStream = function (options) {\n  return this.createReadStream(extend(options, { keys: false, values: true }))\n}\n\nLevelUP.prototype.toString = function () {\n  return 'LevelUP'\n}\n\nfunction utilStatic (name) {\n  return function (location, callback) {\n    getLevelDOWN()[name](location, callback || function () {})\n  }\n}\n\nmodule.exports = LevelUP\nmodule.exports.errors = __webpack_require__(192)\nmodule.exports.destroy = deprecate(\n  utilStatic('destroy'),\n  'levelup.destroy() is deprecated. Use leveldown.destroy() instead'\n)\nmodule.exports.repair = deprecate(\n  utilStatic('repair'),\n  'levelup.repair() is deprecated. Use leveldown.repair() instead'\n)\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/levelup/lib/levelup.js\n// module id = 974\n// module chunks = 0\n\n//# sourceURL=../node_modules/levelup/lib/levelup.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst mafmt = __webpack_require__(99)\nconst multiaddr = __webpack_require__(21)\n\nconst CircuitDialer = __webpack_require__(976)\nconst utilsFactory = __webpack_require__(145)\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:circuit:transportdialer')\nlog.err = debug('libp2p:circuit:error:transportdialer')\n\nconst createListener = __webpack_require__(979)\n\nclass Circuit {\n  static get tag () {\n    return 'Circuit'\n  }\n\n  /**\n   * Creates an instance of Dialer.\n   *\n   * @param {Swarm} swarm - the swarm\n   * @param {any} options - config options\n   *\n   * @memberOf Dialer\n   */\n  constructor (swarm, options) {\n    this.options = options || {}\n\n    this.swarm = swarm\n    this.dialer = null\n    this.utils = utilsFactory(swarm)\n    this.peerInfo = this.swarm._peerInfo\n    this.relays = this.filter(this.peerInfo.multiaddrs.toArray())\n\n    // if no explicit relays, add a default relay addr\n    if (this.relays.length === 0) {\n      this.peerInfo\n        .multiaddrs\n        .add(`/p2p-circuit/ipfs/${this.peerInfo.id.toB58String()}`)\n    }\n\n    this.dialer = new CircuitDialer(swarm, options)\n\n    this.swarm.on('peer-mux-established', this.dialer.canHop.bind(this.dialer))\n    this.swarm.on('peer-mux-closed', (peerInfo) => {\n      this.dialer.relayPeers.delete(peerInfo.id.toB58String())\n    })\n  }\n\n  /**\n   * Dial the relays in the Addresses.Swarm config\n   *\n   * @param {Array} relays\n   * @return {void}\n   */\n  _dialSwarmRelays () {\n    // if we have relay addresses in swarm config, then dial those relays\n    this.relays.forEach((relay) => {\n      let relaySegments = relay\n        .toString()\n        .split('/p2p-circuit')\n        .filter(segment => segment.length)\n\n      relaySegments.forEach((relaySegment) => {\n        this.dialer._dialRelay(this.utils.peerInfoFromMa(multiaddr(relaySegment)))\n      })\n    })\n  }\n\n  /**\n   * Dial a peer over a relay\n   *\n   * @param {multiaddr} ma - the multiaddr of the peer to dial\n   * @param {Object} options - dial options\n   * @param {Function} cb - a callback called once dialed\n   * @returns {Connection} - the connection\n   *\n   * @memberOf Dialer\n   */\n  dial (ma, options, cb) {\n    return this.dialer.dial(ma, options, cb)\n  }\n\n  /**\n   * Create a listener\n   *\n   * @param {any} options\n   * @param {Function} handler\n   * @return {listener}\n   */\n  createListener (options, handler) {\n    if (typeof options === 'function') {\n      handler = options\n      options = this.options || {}\n    }\n\n    const listener = createListener(this.swarm, options, handler)\n    listener.on('listen', this._dialSwarmRelays.bind(this))\n    return listener\n  }\n\n  /**\n   * Filter check for all multiaddresses\n   * that this transport can dial on\n   *\n   * @param {any} multiaddrs\n   * @returns {Array<multiaddr>}\n   *\n   * @memberOf Dialer\n   */\n  filter (multiaddrs) {\n    if (!Array.isArray(multiaddrs)) {\n      multiaddrs = [multiaddrs]\n    }\n    return multiaddrs.filter((ma) => {\n      return mafmt.Circuit.matches(ma)\n    })\n  }\n}\n\nmodule.exports = Circuit\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit.js\n// module id = 975\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\nconst Connection = __webpack_require__(39).Connection\nconst isFunction = __webpack_require__(457)\nconst multiaddr = __webpack_require__(21)\nconst once = __webpack_require__(53)\nconst waterfall = __webpack_require__(12)\nconst utilsFactory = __webpack_require__(145)\nconst StreamHandler = __webpack_require__(272)\nconst PeerId = __webpack_require__(26)\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:circuit:dialer')\nlog.err = debug('libp2p:circuit:error:dialer')\n\nconst multicodec = __webpack_require__(273)\nconst proto = __webpack_require__(146)\n\nclass Dialer {\n  /**\n   * Creates an instance of Dialer.\n   * @param {Swarm} swarm - the swarm\n   * @param {any} options - config options\n   *\n   * @memberOf Dialer\n   */\n  constructor (swarm, options) {\n    this.swarm = swarm\n    this.relayPeers = new Map()\n    this.options = options\n    this.utils = utilsFactory(swarm)\n  }\n\n  /**\n   * Dial a peer over a relay\n   *\n   * @param {multiaddr} ma - the multiaddr of the peer to dial\n   * @param {Function} cb - a callback called once dialed\n   * @returns {Connection} - the connection\n   *\n   * @memberOf Dialer\n   */\n  dial (ma, cb) {\n    cb = cb || (() => {})\n    const strMa = ma.toString()\n    if (!strMa.includes('/p2p-circuit')) {\n      log.err('invalid circuit address')\n      return cb(new Error('invalid circuit address'))\n    }\n\n    const addr = strMa.split('p2p-circuit') // extract relay address if any\n    const relay = addr[0] === '/' ? null : multiaddr(addr[0])\n    const peer = multiaddr(addr[1] || addr[0])\n\n    const dstConn = new Connection()\n    setImmediate(this._dialPeer.bind(this), peer, relay, (err, conn) => {\n      if (err) {\n        log.err(err)\n        return cb(err)\n      }\n\n      dstConn.setInnerConn(conn)\n      cb(null, dstConn)\n    })\n\n    return dstConn\n  }\n\n  /**\n   * Does the peer support the HOP protocol\n   *\n   * @param {PeerInfo} peer\n   * @param {Function} cb\n   * @returns {*}\n   */\n  canHop (peer, cb) {\n    cb = once(cb || (() => {}))\n\n    if (!this.relayPeers.get(this.utils.getB58String(peer))) {\n      let streamHandler\n      waterfall([\n        (wCb) => this._dialRelay(peer, wCb),\n        (sh, wCb) => {\n          streamHandler = sh\n          wCb()\n        },\n        (wCb) => streamHandler.write(proto.CircuitRelay.encode({\n          type: proto.CircuitRelay.Type.CAN_HOP\n        }), wCb),\n        (wCb) => streamHandler.read(wCb),\n        (msg, wCb) => {\n          const response = proto.CircuitRelay.decode(msg)\n\n          if (response.code !== proto.CircuitRelay.Status.SUCCESS) {\n            return log(`HOP not supported, skipping - ${this.utils.getB58String(peer)}`)\n          }\n\n          log(`HOP supported adding as relay - ${this.utils.getB58String(peer)}`)\n          this.relayPeers.set(this.utils.getB58String(peer), peer)\n          wCb(null)\n        }\n      ], cb)\n    }\n\n    return cb(null)\n  }\n\n  /**\n   * Dial the destination peer over a relay\n   *\n   * @param {multiaddr} dstMa\n   * @param {Connection|PeerInfo} relay\n   * @param {Function} cb\n   * @return {Function|void}\n   * @private\n   */\n  _dialPeer (dstMa, relay, cb) {\n    if (isFunction(relay)) {\n      cb = relay\n      relay = null\n    }\n\n    if (!cb) {\n      cb = () => {}\n    }\n\n    dstMa = multiaddr(dstMa)\n    // if no relay provided, dial on all available relays until one succeeds\n    if (!relay) {\n      const relays = Array.from(this.relayPeers.values())\n      let next = (nextRelay) => {\n        if (!nextRelay) {\n          let err = `no relay peers were found or all relays failed to dial`\n          log.err(err)\n          return cb(err)\n        }\n\n        return this._negotiateRelay(nextRelay, dstMa, (err, conn) => {\n          if (err) {\n            log.err(err)\n            return next(relays.shift())\n          }\n          cb(null, conn)\n        })\n      }\n      next(relays.shift())\n    } else {\n      return this._negotiateRelay(relay, dstMa, (err, conn) => {\n        if (err) {\n          log.err(`An error has occurred negotiating the relay connection`, err)\n          return cb(err)\n        }\n\n        return cb(null, conn)\n      })\n    }\n  }\n\n  /**\n   * Negotiate the relay connection\n   *\n   * @param {Multiaddr|PeerInfo|Connection} relay - the Connection or PeerInfo of the relay\n   * @param {multiaddr} dstMa - the multiaddr of the peer to relay the connection for\n   * @param {Function} callback - a callback which gets the negotiated relay connection\n   * @returns {void}\n   * @private\n   *\n   * @memberOf Dialer\n   */\n  _negotiateRelay (relay, dstMa, callback) {\n    dstMa = multiaddr(dstMa)\n\n    const srcMas = this.swarm._peerInfo.multiaddrs.toArray()\n    let streamHandler\n    waterfall([\n      (cb) => {\n        if (relay instanceof Connection) {\n          return cb(null, new StreamHandler(relay))\n        }\n        return this._dialRelay(this.utils.peerInfoFromMa(relay), cb)\n      },\n      (sh, cb) => {\n        streamHandler = sh\n        cb(null)\n      },\n      (cb) => {\n        log(`negotiating relay for peer ${dstMa.getPeerId()}`)\n        streamHandler.write(\n          proto.CircuitRelay.encode({\n            type: proto.CircuitRelay.Type.HOP,\n            srcPeer: {\n              id: this.swarm._peerInfo.id.id,\n              addrs: srcMas.map((addr) => addr.buffer)\n            },\n            dstPeer: {\n              id: PeerId.createFromB58String(dstMa.getPeerId()).id,\n              addrs: [dstMa.buffer]\n            }\n          }), cb)\n      },\n      (cb) => streamHandler.read(cb),\n      (msg, cb) => {\n        const message = proto.CircuitRelay.decode(msg)\n        if (message.type !== proto.CircuitRelay.Type.STATUS) {\n          return cb(new Error(`Got invalid message type - ` +\n            `expected ${proto.CircuitRelay.Type.STATUS} got ${message.type}`))\n        }\n\n        if (message.code !== proto.CircuitRelay.Status.SUCCESS) {\n          return cb(new Error(`Got ${message.code} error code trying to dial over relay`))\n        }\n\n        cb(null, new Connection(streamHandler.rest()))\n      }\n    ], callback)\n  }\n\n  /**\n   * Dial a relay peer by its PeerInfo\n   *\n   * @param {PeerInfo} peer - the PeerInfo of the relay peer\n   * @param {Function} cb - a callback with the connection to the relay peer\n   * @returns {Function|void}\n   * @private\n   */\n  _dialRelay (peer, cb) {\n    cb = once(cb || (() => {}))\n\n    this.swarm.dial(peer, multicodec.relay, once((err, conn) => {\n      if (err) {\n        log.err(err)\n        return cb(err)\n      }\n      cb(null, new StreamHandler(conn))\n    }))\n  }\n}\n\nmodule.exports = Dialer\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit/dialer.js\n// module id = 976\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit/dialer.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(setImmediate) {\n\n__webpack_require__(534)\n__webpack_require__(1)\n\nconst pull = __webpack_require__(6)\nconst debug = __webpack_require__(5)\nconst PeerInfo = __webpack_require__(44)\nconst PeerId = __webpack_require__(26)\nconst EE = __webpack_require__(15).EventEmitter\nconst once = __webpack_require__(53)\nconst utilsFactory = __webpack_require__(145)\nconst StreamHandler = __webpack_require__(272)\nconst assignInWith = __webpack_require__(1084)\nconst proto = __webpack_require__(146)\nconst multiaddr = __webpack_require__(21)\n\nconst multicodec = __webpack_require__(273)\n\nconst log = debug('libp2p:swarm:circuit:relay')\nlog.err = debug('libp2p:swarm:circuit:error:relay')\n\nclass Hop extends EE {\n  /**\n   * Construct a Circuit object\n   *\n   * This class will handle incoming circuit connections and\n   * either start a relay or hand the relayed connection to\n   * the swarm\n   *\n   * @param {Swarm} swarm\n   * @param {Object} options\n   */\n  constructor (swarm, options) {\n    super()\n    this.swarm = swarm\n    this.peerInfo = this.swarm._peerInfo\n    this.utils = utilsFactory(swarm)\n    this.config = assignInWith(\n      {\n        active: false,\n        enabled: false\n      },\n      options,\n      (orig, src) => typeof src === 'undefined' ? false : src)\n\n    this.active = this.config.active\n  }\n\n  /**\n   * Handle the relay message\n   *\n   * @param {CircuitRelay} message\n   * @param {StreamHandler} streamHandler\n   * @returns {*}\n   */\n  handle (message, streamHandler) {\n    if (!this.config.enabled) {\n      return this.utils.writeResponse(streamHandler, proto.CircuitRelay.Status.HOP_CANT_SPEAK_RELAY)\n    }\n\n    // check if message is `CAN_HOP`\n    if (message.type === proto.CircuitRelay.Type.CAN_HOP) {\n      return this.utils.writeResponse(streamHandler, proto.CircuitRelay.Status.SUCCESS)\n    }\n\n    // This is a relay request - validate and create a circuit\n    const srcPeerId = PeerId.createFromBytes(message.dstPeer.id)\n    if (srcPeerId.toB58String() === this.peerInfo.id.toB58String()) {\n      return this.utils.writeResponse(streamHandler, proto.CircuitRelay.Status.HOP_CANT_RELAY_TO_SELF)\n    }\n\n    const dstPeerId = PeerId.createFromBytes(message.dstPeer.id).toB58String()\n    if (!message.dstPeer.addrs.length) {\n      // TODO: use encapsulate here\n      const addr = multiaddr(`/p2p-circuit/ipfs/${dstPeerId}`).buffer\n      message.dstPeer.addrs.push(addr)\n    }\n\n    this.utils.validateAddrs(message, streamHandler, proto.CircuitRelay.Type.HOP, (err) => {\n      if (err) {\n        return log(err)\n      }\n\n      let dstPeer\n      try {\n        dstPeer = this.swarm._peerBook.get(dstPeerId)\n        if (!dstPeer.isConnected() && !this.active) {\n          throw new Error('No Connection to peer')\n        }\n      } catch (err) {\n        if (!this.active) {\n          log.err(err)\n          setImmediate(() => this.emit('circuit:error', err))\n          return this.utils.writeResponse(streamHandler, proto.CircuitRelay.Status.HOP_NO_CONN_TO_DST)\n        }\n      }\n\n      return this._circuit(streamHandler.rest(), message, (err) => {\n        if (err) {\n          log.err(err)\n          setImmediate(() => this.emit('circuit:error', err))\n        }\n        setImmediate(() => this.emit('circuit:success'))\n      })\n    })\n  }\n\n  /**\n   * Attempt to make a circuit from A <-> R <-> B where R is this relay\n   *\n   * @param {Connection} conn - the source connection\n   * @param {CircuitRelay} message - the message with the src and dst entries\n   * @param {Function} cb - callback to signal success or failure\n   * @returns {void}\n   * @private\n   */\n  _circuit (conn, message, cb) {\n    this._dialPeer(message.dstPeer, (err, dstConn) => {\n      const srcStreamHandler = new StreamHandler(conn)\n      if (err) {\n        this.utils.writeResponse(srcStreamHandler, proto.CircuitRelay.Status.HOP_CANT_DIAL_DST)\n        pull(pull.empty(), srcStreamHandler.rest())\n        log.err(err)\n        return cb(err)\n      }\n\n      return this.utils.writeResponse(srcStreamHandler, proto.CircuitRelay.Status.SUCCESS, (err) => {\n        if (err) {\n          log.err(err)\n          return cb(err)\n        }\n\n        const streamHandler = new StreamHandler(dstConn)\n        const stopMsg = Object.assign({}, message, {\n          type: proto.CircuitRelay.Type.STOP // change the message type\n        })\n        streamHandler.write(proto.CircuitRelay.encode(stopMsg), (err) => {\n          if (err) {\n            const errStreamHandler = new StreamHandler(conn)\n            this.utils.writeResponse(errStreamHandler, proto.CircuitRelay.Status.HOP_CANT_OPEN_DST_STREAM)\n            pull(pull.empty(), errStreamHandler.rest())\n\n            log.err(err)\n            return cb(err)\n          }\n\n          streamHandler.read((err, msg) => {\n            if (err) {\n              log.err(err)\n              return cb(err)\n            }\n\n            const message = proto.CircuitRelay.decode(msg)\n            const srcConn = srcStreamHandler.rest()\n            if (message.code === proto.CircuitRelay.Status.SUCCESS) {\n              // circuit the src and dst streams\n              pull(\n                srcConn,\n                streamHandler.rest(),\n                srcConn\n              )\n\n              cb()\n            } else {\n              // close/end the source stream if there was an error\n              pull(\n                pull.empty(),\n                srcConn\n              )\n            }\n          })\n        })\n      })\n    })\n  }\n\n  /**\n   * Dial the dest peer and create a circuit\n   *\n   * @param {Multiaddr} dstPeer\n   * @param {Function} callback\n   * @returns {Function|void}\n   * @private\n   */\n  _dialPeer (dstPeer, callback) {\n    const peerInfo = new PeerInfo(PeerId.createFromBytes(dstPeer.id))\n    dstPeer.addrs.forEach((a) => peerInfo.multiaddrs.add(a))\n    this.swarm.dial(peerInfo, multicodec.relay, once((err, conn) => {\n      if (err) {\n        log.err(err)\n        return callback(err)\n      }\n\n      callback(null, conn)\n    }))\n  }\n}\n\nmodule.exports = Hop\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit/hop.js\n// module id = 977\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit/hop.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst setImmediate = __webpack_require__(8)\n\nconst EE = __webpack_require__(15).EventEmitter\nconst Connection = __webpack_require__(39).Connection\nconst utilsFactory = __webpack_require__(145)\nconst PeerInfo = __webpack_require__(44)\nconst PeerId = __webpack_require__(26)\nconst proto = __webpack_require__(146)\nconst series = __webpack_require__(51)\n\nconst debug = __webpack_require__(5)\n\nconst log = debug('libp2p:circuit:stop')\nlog.err = debug('libp2p:circuit:error:stop')\n\nclass Stop extends EE {\n  constructor (swarm) {\n    super()\n    this.swarm = swarm\n    this.utils = utilsFactory(swarm)\n  }\n\n  handle (message, streamHandler, callback) {\n    callback = callback || (() => {})\n\n    series([\n      (cb) => this.utils.validateAddrs(message, streamHandler, proto.CircuitRelay.Type.STOP, cb),\n      (cb) => this.utils.writeResponse(streamHandler, proto.CircuitRelay.Status.Success, cb)\n    ], (err) => {\n      if (err) {\n        callback() // we don't return the error here, since multistream select don't expect one\n        return log(err)\n      }\n\n      const peerInfo = new PeerInfo(peerIdFromId(message.srcPeer.id))\n      message.srcPeer.addrs.forEach((addr) => peerInfo.multiaddrs.add(addr))\n      const newConn = new Connection(streamHandler.rest())\n      newConn.setPeerInfo(peerInfo)\n      setImmediate(() => this.emit('connection', newConn))\n      callback(newConn)\n    })\n  }\n}\n\nmodule.exports = Stop\n\nfunction peerIdFromId (id) {\n  if (typeof id === 'string') {\n    return PeerId.createFromB58String(id)\n  }\n\n  return PeerId.createFromBytes(id)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/circuit/stop.js\n// module id = 978\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/circuit/stop.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst setImmediate = __webpack_require__(8)\n\nconst multicodec = __webpack_require__(273)\nconst EE = __webpack_require__(15).EventEmitter\nconst multiaddr = __webpack_require__(21)\nconst mafmt = __webpack_require__(99)\nconst Stop = __webpack_require__(978)\nconst Hop = __webpack_require__(977)\nconst proto = __webpack_require__(146)\nconst utilsFactory = __webpack_require__(145)\n\nconst StreamHandler = __webpack_require__(272)\n\nconst debug = __webpack_require__(5)\n\nconst log = debug('libp2p:circuit:listener')\nlog.err = debug('libp2p:circuit:error:listener')\n\nmodule.exports = (swarm, options, connHandler) => {\n  const listener = new EE()\n  const utils = utilsFactory(swarm)\n\n  listener.stopHandler = new Stop(swarm)\n  listener.hopHandler = new Hop(swarm, options.hop)\n\n  /**\n   * Add swarm handler and listen for incoming connections\n   *\n   * @param {Multiaddr} ma\n   * @param {Function} callback\n   * @return {void}\n   */\n  listener.listen = (ma, callback) => {\n    callback = callback || (() => {})\n\n    swarm.handle(multicodec.relay, (relayProto, conn) => {\n      const streamHandler = new StreamHandler(conn)\n\n      streamHandler.read((err, msg) => {\n        if (err) {\n          log.err(err)\n          return\n        }\n\n        let request = null\n        try {\n          request = proto.CircuitRelay.decode(msg)\n        } catch (err) {\n          return utils.writeResponse(streamHandler, proto.CircuitRelay.Status.MALFORMED_MESSAGE)\n        }\n\n        switch (request.type) {\n          case proto.CircuitRelay.Type.CAN_HOP:\n          case proto.CircuitRelay.Type.HOP: {\n            return listener.hopHandler.handle(request, streamHandler)\n          }\n\n          case proto.CircuitRelay.Type.STOP: {\n            return listener.stopHandler.handle(request, streamHandler, connHandler)\n          }\n\n          default: {\n            return utils.writeResponse(streamHandler, proto.CircuitRelay.Status.INVALID_MSG_TYPE)\n          }\n        }\n      })\n    })\n\n    setImmediate(() => listener.emit('listen'))\n    callback()\n  }\n\n  /**\n   * Remove swarm listener\n   *\n   * @param {Function} cb\n   * @return {void}\n   */\n  listener.close = (cb) => {\n    swarm.unhandle(multicodec.stop)\n    setImmediate(() => listener.emit('close'))\n    cb()\n  }\n\n  /**\n   * Get fixed up multiaddrs\n   *\n   * NOTE: This method will grab the peers multiaddrs and expand them such that:\n   *\n   * a) If it's an existing /p2p-circuit address for a specific relay i.e.\n   *    `/ip4/0.0.0.0/tcp/0/ipfs/QmRelay/p2p-circuit` this method will expand the\n   *    address to `/ip4/0.0.0.0/tcp/0/ipfs/QmRelay/p2p-circuit/ipfs/QmPeer` where\n   *    `QmPeer` is this peers id\n   * b) If it's not a /p2p-circuit address, it will encapsulate the address as a /p2p-circuit\n   *    addr, such when dialing over a relay with this address, it will create the circuit using\n   *    the encapsulated transport address. This is useful when for example, a peer should only\n   *    be dialed over TCP rather than any other transport\n   *\n   * @param {Function} callback\n   * @return {void}\n   */\n  listener.getAddrs = (callback) => {\n    let addrs = swarm._peerInfo.multiaddrs.toArray()\n\n    // get all the explicit relay addrs excluding self\n    let p2pAddrs = addrs.filter((addr) => {\n      return mafmt.Circuit.matches(addr) &&\n        !addr.toString().includes(swarm._peerInfo.id.toB58String())\n    })\n\n    // use the explicit relays instead of any relay\n    if (p2pAddrs.length) {\n      addrs = p2pAddrs\n    }\n\n    let listenAddrs = []\n    addrs.forEach((addr) => {\n      const peerMa = `/p2p-circuit/ipfs/${swarm._peerInfo.id.toB58String()}`\n      if (addr.toString() === peerMa) {\n        listenAddrs.push(multiaddr(peerMa))\n        return\n      }\n\n      if (!mafmt.Circuit.matches(addr)) {\n        if (addr.getPeerId()) {\n          // by default we're reachable over any relay\n          listenAddrs.push(multiaddr(`/p2p-circuit`).encapsulate(addr))\n        } else {\n          listenAddrs.push(multiaddr(`/p2p-circuit`).encapsulate(`${addr}/ipfs/${swarm._peerInfo.id.toB58String()}`))\n        }\n      } else {\n        listenAddrs.push(addr.encapsulate(`/ipfs/${swarm._peerInfo.id.toB58String()}`))\n      }\n    })\n\n    callback(null, listenAddrs)\n  }\n\n  return listener\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/listener.js\n// module id = 979\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/listener.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = `\nmessage CircuitRelay {\n\n  enum Status {\n    SUCCESS                    = 100;\n    HOP_SRC_ADDR_TOO_LONG      = 220;\n    HOP_DST_ADDR_TOO_LONG      = 221;\n    HOP_SRC_MULTIADDR_INVALID  = 250;\n    HOP_DST_MULTIADDR_INVALID  = 251;\n    HOP_NO_CONN_TO_DST         = 260;\n    HOP_CANT_DIAL_DST          = 261;\n    HOP_CANT_OPEN_DST_STREAM   = 262;\n    HOP_CANT_SPEAK_RELAY       = 270;\n    HOP_CANT_RELAY_TO_SELF     = 280;\n    STOP_SRC_ADDR_TOO_LONG     = 320;\n    STOP_DST_ADDR_TOO_LONG     = 321;\n    STOP_SRC_MULTIADDR_INVALID = 350;\n    STOP_DST_MULTIADDR_INVALID = 351;\n    STOP_RELAY_REFUSED         = 390;\n    MALFORMED_MESSAGE          = 400;\n  }\n\n  enum Type { // RPC identifier, either HOP, STOP or STATUS\n    HOP = 1;\n    STOP = 2;\n    STATUS = 3;\n    CAN_HOP = 4;\n  }\n\n  message Peer {\n    required bytes id = 1;    // peer id\n    repeated bytes addrs = 2; // peer's known addresses\n  }\n\n  optional Type type = 1;     // Type of the message\n\n  optional Peer srcPeer = 2;  // srcPeer and dstPeer are used when Type is HOP or STATUS\n  optional Peer dstPeer = 3;\n\n  optional Status code = 4;   // Status code, used when Type is STATUS\n}\n`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-circuit/src/protocol/proto.js\n// module id = 980\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-circuit/src/protocol/proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst secp256k1 = __webpack_require__(1223)\nconst multihashing = __webpack_require__(49)\nconst setImmediate = __webpack_require__(8)\n\nconst HASH_ALGORITHM = 'sha2-256'\n\nmodule.exports = (randomBytes) => {\n  const privateKeyLength = 32\n\n  function generateKey (callback) {\n    const done = (err, res) => setImmediate(() => callback(err, res))\n\n    let privateKey\n    do {\n      privateKey = randomBytes(32)\n    } while (!secp256k1.privateKeyVerify(privateKey))\n\n    done(null, privateKey)\n  }\n\n  function hashAndSign (key, msg, callback) {\n    const done = (err, res) => setImmediate(() => callback(err, res))\n\n    multihashing.digest(msg, HASH_ALGORITHM, (err, digest) => {\n      if (err) { return done(err) }\n\n      try {\n        const sig = secp256k1.sign(digest, key)\n        const sigDER = secp256k1.signatureExport(sig.signature)\n        return done(null, sigDER)\n      } catch (err) { done(err) }\n    })\n  }\n\n  function hashAndVerify (key, sig, msg, callback) {\n    const done = (err, res) => setImmediate(() => callback(err, res))\n\n    multihashing.digest(msg, HASH_ALGORITHM, (err, digest) => {\n      if (err) { return done(err) }\n      try {\n        sig = secp256k1.signatureImport(sig)\n        const valid = secp256k1.verify(digest, sig, key)\n        return done(null, valid)\n      } catch (err) { done(err) }\n    })\n  }\n\n  function compressPublicKey (key) {\n    if (!secp256k1.publicKeyVerify(key)) {\n      throw new Error('Invalid public key')\n    }\n    return secp256k1.publicKeyConvert(key, true)\n  }\n\n  function decompressPublicKey (key) {\n    return secp256k1.publicKeyConvert(key, false)\n  }\n\n  function validatePrivateKey (key) {\n    if (!secp256k1.privateKeyVerify(key)) {\n      throw new Error('Invalid private key')\n    }\n  }\n\n  function validatePublicKey (key) {\n    if (!secp256k1.publicKeyVerify(key)) {\n      throw new Error('Invalid public key')\n    }\n  }\n\n  function computePublicKey (privateKey) {\n    validatePrivateKey(privateKey)\n    return secp256k1.publicKeyCreate(privateKey)\n  }\n\n  return {\n    generateKey: generateKey,\n    privateKeyLength: privateKeyLength,\n    hashAndSign: hashAndSign,\n    hashAndVerify: hashAndVerify,\n    compressPublicKey: compressPublicKey,\n    decompressPublicKey: decompressPublicKey,\n    validatePrivateKey: validatePrivateKey,\n    validatePublicKey: validatePublicKey,\n    computePublicKey: computePublicKey\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto-secp256k1/src/crypto.js\n// module id = 981\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto-secp256k1/src/crypto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multihashing = __webpack_require__(49)\n\nmodule.exports = (keysProtobuf, randomBytes, crypto) => {\n  crypto = crypto || __webpack_require__(981)(randomBytes)\n\n  class Secp256k1PublicKey {\n    constructor (key) {\n      crypto.validatePublicKey(key)\n      this._key = key\n    }\n\n    verify (data, sig, callback) {\n      ensure(callback)\n      crypto.hashAndVerify(this._key, sig, data, callback)\n    }\n\n    marshal () {\n      return crypto.compressPublicKey(this._key)\n    }\n\n    get bytes () {\n      return keysProtobuf.PublicKey.encode({\n        Type: keysProtobuf.KeyType.Secp256k1,\n        Data: this.marshal()\n      })\n    }\n\n    equals (key) {\n      return this.bytes.equals(key.bytes)\n    }\n\n    hash (callback) {\n      ensure(callback)\n      multihashing(this.bytes, 'sha2-256', callback)\n    }\n  }\n\n  class Secp256k1PrivateKey {\n    constructor (key, publicKey) {\n      this._key = key\n      this._publicKey = publicKey || crypto.computePublicKey(key)\n      crypto.validatePrivateKey(this._key)\n      crypto.validatePublicKey(this._publicKey)\n    }\n\n    sign (message, callback) {\n      ensure(callback)\n      crypto.hashAndSign(this._key, message, callback)\n    }\n\n    get public () {\n      return new Secp256k1PublicKey(this._publicKey)\n    }\n\n    marshal () {\n      return this._key\n    }\n\n    get bytes () {\n      return keysProtobuf.PrivateKey.encode({\n        Type: keysProtobuf.KeyType.Secp256k1,\n        Data: this.marshal()\n      })\n    }\n\n    equals (key) {\n      return this.bytes.equals(key.bytes)\n    }\n\n    hash (callback) {\n      ensure(callback)\n      multihashing(this.bytes, 'sha2-256', callback)\n    }\n  }\n\n  function unmarshalSecp256k1PrivateKey (bytes, callback) {\n    callback(null, new Secp256k1PrivateKey(bytes), null)\n  }\n\n  function unmarshalSecp256k1PublicKey (bytes) {\n    return new Secp256k1PublicKey(bytes)\n  }\n\n  function generateKeyPair (_bits, callback) {\n    if (callback === undefined && typeof _bits === 'function') {\n      callback = _bits\n    }\n\n    ensure(callback)\n\n    crypto.generateKey((err, privateKeyBytes) => {\n      if (err) { return callback(err) }\n\n      let privkey\n      try {\n        privkey = new Secp256k1PrivateKey(privateKeyBytes)\n      } catch (err) { return callback(err) }\n\n      callback(null, privkey)\n    })\n  }\n\n  function ensure (callback) {\n    if (typeof callback !== 'function') {\n      throw new Error('callback is required')\n    }\n  }\n\n  return {\n    Secp256k1PublicKey,\n    Secp256k1PrivateKey,\n    unmarshalSecp256k1PrivateKey,\n    unmarshalSecp256k1PublicKey,\n    generateKeyPair\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto-secp256k1/src/index.js\n// module id = 982\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto-secp256k1/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst crypto = __webpack_require__(168)\n\nmodule.exports = {\n  createCipheriv: crypto.createCipheriv,\n  createDecipheriv: crypto.createDecipheriv\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/aes/ciphers-browser.js\n// module id = 983\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/aes/ciphers-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst ciphers = __webpack_require__(983)\n\nconst CIPHER_MODES = {\n  16: 'aes-128-ctr',\n  32: 'aes-256-ctr'\n}\n\nexports.create = function (key, iv, callback) {\n  const mode = CIPHER_MODES[key.length]\n  if (!mode) {\n    return callback(new Error('Invalid key length'))\n  }\n\n  const cipher = ciphers.createCipheriv(mode, key, iv)\n  const decipher = ciphers.createDecipheriv(mode, key, iv)\n\n  const res = {\n    encrypt (data, cb) {\n      cb(null, cipher.update(data))\n    },\n\n    decrypt (data, cb) {\n      cb(null, decipher.update(data))\n    }\n  }\n\n  callback(null, res)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/aes/index.js\n// module id = 984\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/aes/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  SHA1: 20,\n  SHA256: 32,\n  SHA512: 64\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/hmac/lengths.js\n// module id = 985\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/hmac/lengths.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst webcrypto = __webpack_require__(276)()\nconst nodeify = __webpack_require__(275)\nconst BN = __webpack_require__(110).bignum\n\nconst util = __webpack_require__(445)\nconst toBase64 = util.toBase64\nconst toBn = util.toBn\n\nconst bits = {\n  'P-256': 256,\n  'P-384': 384,\n  'P-521': 521\n}\n\nexports.generateEphmeralKeyPair = function (curve, callback) {\n  nodeify(webcrypto.subtle.generateKey(\n    {\n      name: 'ECDH',\n      namedCurve: curve\n    },\n    true,\n    ['deriveBits']\n  ).then((pair) => {\n    // forcePrivate is used for testing only\n    const genSharedKey = (theirPub, forcePrivate, cb) => {\n      if (typeof forcePrivate === 'function') {\n        cb = forcePrivate\n        forcePrivate = undefined\n      }\n\n      let privateKey\n\n      if (forcePrivate) {\n        privateKey = webcrypto.subtle.importKey(\n          'jwk',\n          unmarshalPrivateKey(curve, forcePrivate),\n          {\n            name: 'ECDH',\n            namedCurve: curve\n          },\n          false,\n          ['deriveBits']\n        )\n      } else {\n        privateKey = Promise.resolve(pair.privateKey)\n      }\n\n      const keys = Promise.all([\n        webcrypto.subtle.importKey(\n          'jwk',\n          unmarshalPublicKey(curve, theirPub),\n          {\n            name: 'ECDH',\n            namedCurve: curve\n          },\n          false,\n          []\n        ),\n        privateKey\n      ])\n\n      nodeify(keys.then((keys) => webcrypto.subtle.deriveBits(\n        {\n          name: 'ECDH',\n          namedCurve: curve,\n          public: keys[0]\n        },\n        keys[1],\n        bits[curve]\n      )).then((bits) => Buffer.from(bits)), cb)\n    }\n\n    return webcrypto.subtle.exportKey('jwk', pair.publicKey)\n      .then((publicKey) => {\n        return {\n          key: marshalPublicKey(publicKey),\n          genSharedKey\n        }\n      })\n  }), callback)\n}\n\nconst curveLengths = {\n  'P-256': 32,\n  'P-384': 48,\n  'P-521': 66\n}\n\n// Marshal converts a jwk encodec ECDH public key into the\n// form specified in section 4.3.6 of ANSI X9.62. (This is the format\n// go-ipfs uses)\nfunction marshalPublicKey (jwk) {\n  const byteLen = curveLengths[jwk.crv]\n\n  return Buffer.concat([\n    Buffer.from([4]), // uncompressed point\n    toBn(jwk.x).toArrayLike(Buffer, 'be', byteLen),\n    toBn(jwk.y).toArrayLike(Buffer, 'be', byteLen)\n  ], 1 + byteLen * 2)\n}\n\n// Unmarshal converts a point, serialized by Marshal, into an jwk encoded key\nfunction unmarshalPublicKey (curve, key) {\n  const byteLen = curveLengths[curve]\n\n  if (!key.slice(0, 1).equals(Buffer.from([4]))) {\n    throw new Error('Invalid key format')\n  }\n  const x = new BN(key.slice(1, byteLen + 1))\n  const y = new BN(key.slice(1 + byteLen))\n\n  return {\n    kty: 'EC',\n    crv: curve,\n    x: toBase64(x, byteLen),\n    y: toBase64(y, byteLen),\n    ext: true\n  }\n}\n\nfunction unmarshalPrivateKey (curve, key) {\n  const result = unmarshalPublicKey(curve, key.public)\n  result.d = toBase64(new BN(key.private))\n  return result\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/ecdh-browser.js\n// module id = 986\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/ecdh-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst multihashing = __webpack_require__(49)\nconst protobuf = __webpack_require__(64)\nconst bs58 = __webpack_require__(76)\n\nconst crypto = __webpack_require__(988)\nconst pbm = protobuf(__webpack_require__(274))\n\nclass Ed25519PublicKey {\n  constructor (key) {\n    this._key = ensureKey(key, crypto.publicKeyLength)\n  }\n\n  verify (data, sig, callback) {\n    ensure(callback)\n    crypto.hashAndVerify(this._key, sig, data, callback)\n  }\n\n  marshal () {\n    return Buffer.from(this._key)\n  }\n\n  get bytes () {\n    return pbm.PublicKey.encode({\n      Type: pbm.KeyType.Ed25519,\n      Data: this.marshal()\n    })\n  }\n\n  equals (key) {\n    return this.bytes.equals(key.bytes)\n  }\n\n  hash (callback) {\n    ensure(callback)\n    multihashing(this.bytes, 'sha2-256', callback)\n  }\n}\n\nclass Ed25519PrivateKey {\n  // key       - 64 byte Uint8Array or Buffer containing private key\n  // publicKey - 32 byte Uint8Array or Buffer containing public key\n  constructor (key, publicKey) {\n    this._key = ensureKey(key, crypto.privateKeyLength)\n    this._publicKey = ensureKey(publicKey, crypto.publicKeyLength)\n  }\n\n  sign (message, callback) {\n    ensure(callback)\n    crypto.hashAndSign(this._key, message, callback)\n  }\n\n  get public () {\n    if (!this._publicKey) {\n      throw new Error('public key not provided')\n    }\n\n    return new Ed25519PublicKey(this._publicKey)\n  }\n\n  marshal () {\n    return Buffer.concat([Buffer.from(this._key), Buffer.from(this._publicKey)])\n  }\n\n  get bytes () {\n    return pbm.PrivateKey.encode({\n      Type: pbm.KeyType.Ed25519,\n      Data: this.marshal()\n    })\n  }\n\n  equals (key) {\n    return this.bytes.equals(key.bytes)\n  }\n\n  hash (callback) {\n    ensure(callback)\n    multihashing(this.bytes, 'sha2-256', callback)\n  }\n\n  /**\n   * Gets the ID of the key.\n   *\n   * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n   * The public key is a protobuf encoding containing a type and the DER encoding\n   * of the PKCS SubjectPublicKeyInfo.\n   *\n   * @param {function(Error, id)} callback\n   * @returns {undefined}\n   */\n  id (callback) {\n    this.public.hash((err, hash) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, bs58.encode(hash))\n    })\n  }\n}\n\nfunction unmarshalEd25519PrivateKey (bytes, callback) {\n  try {\n    bytes = ensureKey(bytes, crypto.privateKeyLength + crypto.publicKeyLength)\n  } catch (err) {\n    return callback(err)\n  }\n  const privateKeyBytes = bytes.slice(0, crypto.privateKeyLength)\n  const publicKeyBytes = bytes.slice(crypto.privateKeyLength, bytes.length)\n  callback(null, new Ed25519PrivateKey(privateKeyBytes, publicKeyBytes))\n}\n\nfunction unmarshalEd25519PublicKey (bytes) {\n  bytes = ensureKey(bytes, crypto.publicKeyLength)\n  return new Ed25519PublicKey(bytes)\n}\n\nfunction generateKeyPair (_bits, cb) {\n  if (cb === undefined && typeof _bits === 'function') {\n    cb = _bits\n  }\n\n  crypto.generateKey((err, keys) => {\n    if (err) {\n      return cb(err)\n    }\n    let privkey\n    try {\n      privkey = new Ed25519PrivateKey(keys.secretKey, keys.publicKey)\n    } catch (err) {\n      cb(err)\n      return\n    }\n\n    cb(null, privkey)\n  })\n}\n\nfunction generateKeyPairFromSeed (seed, _bits, cb) {\n  if (cb === undefined && typeof _bits === 'function') {\n    cb = _bits\n  }\n\n  crypto.generateKeyFromSeed(seed, (err, keys) => {\n    if (err) {\n      return cb(err)\n    }\n    let privkey\n    try {\n      privkey = new Ed25519PrivateKey(keys.secretKey, keys.publicKey)\n    } catch (err) {\n      cb(err)\n      return\n    }\n\n    cb(null, privkey)\n  })\n}\n\nfunction ensure (cb) {\n  if (typeof cb !== 'function') {\n    throw new Error('callback is required')\n  }\n}\n\nfunction ensureKey (key, length) {\n  if (Buffer.isBuffer(key)) {\n    key = new Uint8Array(key)\n  }\n  if (!(key instanceof Uint8Array) || key.length !== length) {\n    throw new Error('Key must be a Uint8Array or Buffer of length ' + length)\n  }\n  return key\n}\n\nmodule.exports = {\n  Ed25519PublicKey,\n  Ed25519PrivateKey,\n  unmarshalEd25519PrivateKey,\n  unmarshalEd25519PublicKey,\n  generateKeyPair,\n  generateKeyPairFromSeed\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/ed25519-class.js\n// module id = 987\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/ed25519-class.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst nacl = __webpack_require__(1253)\nconst setImmediate = __webpack_require__(8)\n\nexports.publicKeyLength = nacl.sign.publicKeyLength\nexports.privateKeyLength = nacl.sign.secretKeyLength\n\nexports.generateKey = function (callback) {\n  setImmediate(() => {\n    let result\n    try {\n      result = nacl.sign.keyPair()\n    } catch (err) {\n      return callback(err)\n    }\n    callback(null, result)\n  })\n}\n\n// seed should be a 32 byte uint8array\nexports.generateKeyFromSeed = function (seed, callback) {\n  setImmediate(() => {\n    let result\n    try {\n      result = nacl.sign.keyPair.fromSeed(seed)\n    } catch (err) {\n      return callback(err)\n    }\n    callback(null, result)\n  })\n}\n\nexports.hashAndSign = function (key, msg, callback) {\n  setImmediate(() => {\n    callback(null, Buffer.from(nacl.sign.detached(msg, key)))\n  })\n}\n\nexports.hashAndVerify = function (key, sig, msg, callback) {\n  setImmediate(() => {\n    let result\n    try {\n      result = nacl.sign.detached.verify(msg, sig, key)\n    } catch (err) {\n      return callback(err)\n    }\n\n    callback(null, result)\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/ed25519.js\n// module id = 988\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/ed25519.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst ecdh = __webpack_require__(986)\n\n// Generates an ephemeral public key and returns a function that will compute\n// the shared secret key.\n//\n// Focuses only on ECDH now, but can be made more general in the future.\nmodule.exports = (curve, callback) => {\n  ecdh.generateEphmeralKeyPair(curve, callback)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/ephemeral-keys.js\n// module id = 989\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/ephemeral-keys.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst protobuf = __webpack_require__(64)\nconst keysPBM = protobuf(__webpack_require__(274))\nconst forge = __webpack_require__(149)\n\nexports = module.exports\n\nconst supportedKeys = {\n  rsa: __webpack_require__(992),\n  ed25519: __webpack_require__(987),\n  secp256k1: __webpack_require__(982)(keysPBM, __webpack_require__(444))\n}\n\nexports.supportedKeys = supportedKeys\nexports.keysPBM = keysPBM\n\nfunction isValidKeyType (keyType) {\n  const key = supportedKeys[keyType.toLowerCase()]\n  return key !== undefined\n}\n\nexports.keyStretcher = __webpack_require__(991)\nexports.generateEphemeralKeyPair = __webpack_require__(989)\n\n// Generates a keypair of the given type and bitsize\nexports.generateKeyPair = (type, bits, cb) => {\n  let key = supportedKeys[type.toLowerCase()]\n\n  if (!key) {\n    return cb(new Error('invalid or unsupported key type'))\n  }\n\n  key.generateKeyPair(bits, cb)\n}\n\n// Generates a keypair of the given type and bitsize\n// seed is a 32 byte uint8array\nexports.generateKeyPairFromSeed = (type, seed, bits, cb) => {\n  let key = supportedKeys[type.toLowerCase()]\n  if (!key) {\n    return cb(new Error('invalid or unsupported key type'))\n  }\n  if (type.toLowerCase() !== 'ed25519') {\n    return cb(new Error('Seed key derivation is unimplemented for RSA or secp256k1'))\n  }\n  key.generateKeyPairFromSeed(seed, bits, cb)\n}\n\n// Converts a protobuf serialized public key into its\n// representative object\nexports.unmarshalPublicKey = (buf) => {\n  const decoded = keysPBM.PublicKey.decode(buf)\n  const data = decoded.Data\n\n  switch (decoded.Type) {\n    case keysPBM.KeyType.RSA:\n      return supportedKeys.rsa.unmarshalRsaPublicKey(data)\n    case keysPBM.KeyType.Ed25519:\n      return supportedKeys.ed25519.unmarshalEd25519PublicKey(data)\n    case keysPBM.KeyType.Secp256k1:\n      if (supportedKeys.secp256k1) {\n        return supportedKeys.secp256k1.unmarshalSecp256k1PublicKey(data)\n      } else {\n        throw new Error('secp256k1 support requires libp2p-crypto-secp256k1 package')\n      }\n    default:\n      throw new Error('invalid or unsupported key type')\n  }\n}\n\n// Converts a public key object into a protobuf serialized public key\nexports.marshalPublicKey = (key, type) => {\n  type = (type || 'rsa').toLowerCase()\n  if (!isValidKeyType(type)) {\n    throw new Error('invalid or unsupported key type')\n  }\n\n  return key.bytes\n}\n\n// Converts a protobuf serialized private key into its\n// representative object\nexports.unmarshalPrivateKey = (buf, callback) => {\n  let decoded\n  try {\n    decoded = keysPBM.PrivateKey.decode(buf)\n  } catch (err) {\n    return callback(err)\n  }\n\n  const data = decoded.Data\n\n  switch (decoded.Type) {\n    case keysPBM.KeyType.RSA:\n      return supportedKeys.rsa.unmarshalRsaPrivateKey(data, callback)\n    case keysPBM.KeyType.Ed25519:\n      return supportedKeys.ed25519.unmarshalEd25519PrivateKey(data, callback)\n    case keysPBM.KeyType.Secp256k1:\n      if (supportedKeys.secp256k1) {\n        return supportedKeys.secp256k1.unmarshalSecp256k1PrivateKey(data, callback)\n      } else {\n        return callback(new Error('secp256k1 support requires libp2p-crypto-secp256k1 package'))\n      }\n    default:\n      callback(new Error('invalid or unsupported key type'))\n  }\n}\n\n// Converts a private key object into a protobuf serialized private key\nexports.marshalPrivateKey = (key, type) => {\n  type = (type || 'rsa').toLowerCase()\n  if (!isValidKeyType(type)) {\n    throw new Error('invalid or unsupported key type')\n  }\n\n  return key.bytes\n}\n\nexports.import = (pem, password, callback) => {\n  try {\n    const key = forge.pki.decryptRsaPrivateKey(pem, password)\n    if (key === null) {\n      throw new Error('Cannot read the key, most likely the password is wrong or not a RSA key')\n    }\n    let der = forge.asn1.toDer(forge.pki.privateKeyToAsn1(key))\n    der = Buffer.from(der.getBytes(), 'binary')\n    return supportedKeys.rsa.unmarshalRsaPrivateKey(der, callback)\n  } catch (err) {\n    callback(err)\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/index.js\n// module id = 990\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst whilst = __webpack_require__(164)\nconst hmac = __webpack_require__(442)\n\nconst cipherMap = {\n  'AES-128': {\n    ivSize: 16,\n    keySize: 16\n  },\n  'AES-256': {\n    ivSize: 16,\n    keySize: 32\n  },\n  Blowfish: {\n    ivSize: 8,\n    cipherKeySize: 32\n  }\n}\n\n// Generates a set of keys for each party by stretching the shared key.\n// (myIV, theirIV, myCipherKey, theirCipherKey, myMACKey, theirMACKey)\nmodule.exports = (cipherType, hash, secret, callback) => {\n  const cipher = cipherMap[cipherType]\n\n  if (!cipher) {\n    return callback(new Error('unkown cipherType passed'))\n  }\n\n  if (!hash) {\n    return callback(new Error('unkown hashType passed'))\n  }\n\n  const cipherKeySize = cipher.keySize\n  const ivSize = cipher.ivSize\n  const hmacKeySize = 20\n  const seed = Buffer.from('key expansion')\n  const resultLength = 2 * (ivSize + cipherKeySize + hmacKeySize)\n\n  hmac.create(hash, secret, (err, m) => {\n    if (err) {\n      return callback(err)\n    }\n\n    m.digest(seed, (err, a) => {\n      if (err) {\n        return callback(err)\n      }\n\n      let result = []\n      let j = 0\n\n      whilst(\n        () => j < resultLength,\n        stretch,\n        finish\n      )\n\n      function stretch (cb) {\n        m.digest(Buffer.concat([a, seed]), (err, b) => {\n          if (err) {\n            return cb(err)\n          }\n\n          let todo = b.length\n\n          if (j + todo > resultLength) {\n            todo = resultLength - j\n          }\n\n          result.push(b)\n\n          j += todo\n\n          m.digest(a, (err, _a) => {\n            if (err) {\n              return cb(err)\n            }\n            a = _a\n            cb()\n          })\n        })\n      }\n\n      function finish (err) {\n        if (err) {\n          return callback(err)\n        }\n\n        const half = resultLength / 2\n        const resultBuffer = Buffer.concat(result)\n        const r1 = resultBuffer.slice(0, half)\n        const r2 = resultBuffer.slice(half, resultLength)\n\n        const createKey = (res) => ({\n          iv: res.slice(0, ivSize),\n          cipherKey: res.slice(ivSize, ivSize + cipherKeySize),\n          macKey: res.slice(ivSize + cipherKeySize)\n        })\n\n        callback(null, {\n          k1: createKey(r1),\n          k2: createKey(r2)\n        })\n      }\n    })\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/key-stretcher.js\n// module id = 991\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/key-stretcher.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multihashing = __webpack_require__(49)\nconst protobuf = __webpack_require__(64)\nconst bs58 = __webpack_require__(76)\n\nconst crypto = __webpack_require__(443)\nconst pbm = protobuf(__webpack_require__(274))\nconst forge = __webpack_require__(149)\nconst setImmediate = __webpack_require__(8)\n\nclass RsaPublicKey {\n  constructor (key) {\n    this._key = key\n  }\n\n  verify (data, sig, callback) {\n    ensure(callback)\n    crypto.hashAndVerify(this._key, sig, data, callback)\n  }\n\n  marshal () {\n    return crypto.utils.jwkToPkix(this._key)\n  }\n\n  get bytes () {\n    return pbm.PublicKey.encode({\n      Type: pbm.KeyType.RSA,\n      Data: this.marshal()\n    })\n  }\n\n  encrypt (bytes) {\n    return this._key.encrypt(bytes, 'RSAES-PKCS1-V1_5')\n  }\n\n  equals (key) {\n    return this.bytes.equals(key.bytes)\n  }\n\n  hash (callback) {\n    ensure(callback)\n    multihashing(this.bytes, 'sha2-256', callback)\n  }\n}\n\nclass RsaPrivateKey {\n  // key       - Object of the jwk format\n  // publicKey - Buffer of the spki format\n  constructor (key, publicKey) {\n    this._key = key\n    this._publicKey = publicKey\n  }\n\n  genSecret () {\n    return crypto.getRandomValues(new Uint8Array(16))\n  }\n\n  sign (message, callback) {\n    ensure(callback)\n    crypto.hashAndSign(this._key, message, callback)\n  }\n\n  get public () {\n    if (!this._publicKey) {\n      throw new Error('public key not provided')\n    }\n\n    return new RsaPublicKey(this._publicKey)\n  }\n\n  decrypt (msg, callback) {\n    crypto.decrypt(this._key, msg, callback)\n  }\n\n  marshal () {\n    return crypto.utils.jwkToPkcs1(this._key)\n  }\n\n  get bytes () {\n    return pbm.PrivateKey.encode({\n      Type: pbm.KeyType.RSA,\n      Data: this.marshal()\n    })\n  }\n\n  equals (key) {\n    return this.bytes.equals(key.bytes)\n  }\n\n  hash (callback) {\n    ensure(callback)\n    multihashing(this.bytes, 'sha2-256', callback)\n  }\n\n  /**\n   * Gets the ID of the key.\n   *\n   * The key id is the base58 encoding of the SHA-256 multihash of its public key.\n   * The public key is a protobuf encoding containing a type and the DER encoding\n   * of the PKCS SubjectPublicKeyInfo.\n   *\n   * @param {function(Error, id)} callback\n   * @returns {undefined}\n   */\n  id (callback) {\n    this.public.hash((err, hash) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, bs58.encode(hash))\n    })\n  }\n\n  /**\n   * Exports the key into a password protected PEM format\n   *\n   * @param {string} [format] - Defaults to 'pkcs-8'.\n   * @param {string} password - The password to read the encrypted PEM\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  export (format, password, callback) {\n    if (typeof password === 'function') {\n      callback = password\n      password = format\n      format = 'pkcs-8'\n    }\n\n    ensure(callback)\n\n    setImmediate(() => {\n      let err = null\n      let pem = null\n      try {\n        const buffer = new forge.util.ByteBuffer(this.marshal())\n        const asn1 = forge.asn1.fromDer(buffer)\n        const privateKey = forge.pki.privateKeyFromAsn1(asn1)\n\n        if (format === 'pkcs-8') {\n          const options = {\n            algorithm: 'aes256',\n            count: 10000,\n            saltSize: 128 / 8,\n            prfAlgorithm: 'sha512'\n          }\n          pem = forge.pki.encryptRsaPrivateKey(privateKey, password, options)\n        } else {\n          err = new Error(`Unknown export format '${format}'`)\n        }\n      } catch (_err) {\n        err = _err\n      }\n\n      callback(err, pem)\n    })\n  }\n}\n\nfunction unmarshalRsaPrivateKey (bytes, callback) {\n  const jwk = crypto.utils.pkcs1ToJwk(bytes)\n\n  crypto.unmarshalPrivateKey(jwk, (err, keys) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n  })\n}\n\nfunction unmarshalRsaPublicKey (bytes) {\n  const jwk = crypto.utils.pkixToJwk(bytes)\n\n  return new RsaPublicKey(jwk)\n}\n\nfunction fromJwk (jwk, callback) {\n  crypto.unmarshalPrivateKey(jwk, (err, keys) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n  })\n}\n\nfunction generateKeyPair (bits, callback) {\n  crypto.generateKey(bits, (err, keys) => {\n    if (err) {\n      return callback(err)\n    }\n\n    callback(null, new RsaPrivateKey(keys.privateKey, keys.publicKey))\n  })\n}\n\nfunction ensure (callback) {\n  if (typeof callback !== 'function') {\n    throw new Error('callback is required')\n  }\n}\n\nmodule.exports = {\n  RsaPublicKey,\n  RsaPrivateKey,\n  unmarshalRsaPublicKey,\n  unmarshalRsaPrivateKey,\n  generateKeyPair,\n  fromJwk\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/rsa-class.js\n// module id = 992\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/rsa-class.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst asn1 = __webpack_require__(110)\n\nconst util = __webpack_require__(445)\nconst toBase64 = util.toBase64\nconst toBn = util.toBn\n\nconst RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n  this.seq().obj(\n    this.key('version').int(),\n    this.key('modulus').int(),\n    this.key('publicExponent').int(),\n    this.key('privateExponent').int(),\n    this.key('prime1').int(),\n    this.key('prime2').int(),\n    this.key('exponent1').int(),\n    this.key('exponent2').int(),\n    this.key('coefficient').int()\n  )\n})\n\nconst AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n  this.seq().obj(\n    this.key('algorithm').objid({\n      '1.2.840.113549.1.1.1': 'rsa'\n    }),\n    this.key('none').optional().null_(),\n    this.key('curve').optional().objid(),\n    this.key('params').optional().seq().obj(\n      this.key('p').int(),\n      this.key('q').int(),\n      this.key('g').int()\n    )\n  )\n})\n\nconst PublicKey = asn1.define('RSAPublicKey', function () {\n  this.seq().obj(\n    this.key('algorithm').use(AlgorithmIdentifier),\n    this.key('subjectPublicKey').bitstr()\n  )\n})\n\nconst RSAPublicKey = asn1.define('RSAPublicKey', function () {\n  this.seq().obj(\n    this.key('modulus').int(),\n    this.key('publicExponent').int()\n  )\n})\n\n// Convert a PKCS#1 in ASN1 DER format to a JWK key\nexports.pkcs1ToJwk = function (bytes) {\n  const asn1 = RSAPrivateKey.decode(bytes, 'der')\n\n  return {\n    kty: 'RSA',\n    n: toBase64(asn1.modulus),\n    e: toBase64(asn1.publicExponent),\n    d: toBase64(asn1.privateExponent),\n    p: toBase64(asn1.prime1),\n    q: toBase64(asn1.prime2),\n    dp: toBase64(asn1.exponent1),\n    dq: toBase64(asn1.exponent2),\n    qi: toBase64(asn1.coefficient),\n    alg: 'RS256',\n    kid: '2011-04-29'\n  }\n}\n\n// Convert a JWK key into PKCS#1 in ASN1 DER format\nexports.jwkToPkcs1 = function (jwk) {\n  return RSAPrivateKey.encode({\n    version: 0,\n    modulus: toBn(jwk.n),\n    publicExponent: toBn(jwk.e),\n    privateExponent: toBn(jwk.d),\n    prime1: toBn(jwk.p),\n    prime2: toBn(jwk.q),\n    exponent1: toBn(jwk.dp),\n    exponent2: toBn(jwk.dq),\n    coefficient: toBn(jwk.qi)\n  }, 'der')\n}\n\n// Convert a PKCIX in ASN1 DER format to a JWK key\nexports.pkixToJwk = function (bytes) {\n  const ndata = PublicKey.decode(bytes, 'der')\n  const asn1 = RSAPublicKey.decode(ndata.subjectPublicKey.data, 'der')\n\n  return {\n    kty: 'RSA',\n    n: toBase64(asn1.modulus),\n    e: toBase64(asn1.publicExponent),\n    alg: 'RS256',\n    kid: '2011-04-29'\n  }\n}\n\n// Convert a JWK key to PKCIX in ASN1 DER format\nexports.jwkToPkix = function (jwk) {\n  return PublicKey.encode({\n    algorithm: {\n      algorithm: 'rsa',\n      none: null\n    },\n    subjectPublicKey: {\n      data: RSAPublicKey.encode({\n        modulus: toBn(jwk.n),\n        publicExponent: toBn(jwk.e)\n      }, 'der')\n    }\n  }, 'der')\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/keys/rsa-utils.js\n// module id = 993\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/keys/rsa-utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst forge = __webpack_require__(149)\n\n/**\n * Maps an IPFS hash name to its node-forge equivalent.\n *\n * See https://github.com/multiformats/multihash/blob/master/hashtable.csv\n *\n * @private\n */\nconst hashName = {\n  sha1: 'sha1',\n  'sha2-256': 'sha256',\n  'sha2-512': 'sha512'\n}\n\n/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {string} password\n * @param {string} salt\n * @param {number} iterations\n * @param {number} keySize (in bytes)\n * @param {string} hash - The hash name ('sha1', 'sha2-512, ...)\n * @returns {string} - A new password\n */\nfunction pbkdf2 (password, salt, iterations, keySize, hash) {\n  const hasher = hashName[hash]\n  if (!hasher) {\n    throw new Error(`Hash '${hash}' is unknown or not supported`)\n  }\n  const dek = forge.pkcs5.pbkdf2(\n    password,\n    salt,\n    iterations,\n    keySize,\n    hasher)\n  return forge.util.encode64(dek)\n}\n\nmodule.exports = pbkdf2\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-crypto/src/pbkdf2.js\n// module id = 994\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-crypto/src/pbkdf2.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\n\nconst log = debug('libp2p:floodsub')\nlog.err = debug('libp2p:floodsub:error')\n\nmodule.exports = {\n  log: log,\n  multicodec: '/floodsub/1.0.0'\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/config.js\n// module id = 995\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/config.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15)\nconst TimeCache = __webpack_require__(1248)\nconst values = __webpack_require__(281)\nconst pull = __webpack_require__(6)\nconst lp = __webpack_require__(45)\nconst assert = __webpack_require__(16)\nconst asyncEach = __webpack_require__(41)\n\nconst Peer = __webpack_require__(999)\nconst utils = __webpack_require__(1000)\nconst pb = __webpack_require__(446)\nconst config = __webpack_require__(995)\nconst Buffer = __webpack_require__(1).Buffer\n\nconst log = config.log\nconst multicodec = config.multicodec\nconst ensureArray = utils.ensureArray\nconst setImmediate = __webpack_require__(8)\n\n/**\n * FloodSub (aka dumbsub is an implementation of pubsub focused on\n * delivering an API for Publish/Subscribe, but with no CastTree Forming\n * (it just floods the network).\n */\nclass FloodSub extends EventEmitter {\n  /**\n   * @param {Object} libp2p\n   * @returns {FloodSub}\n   */\n  constructor (libp2p) {\n    super()\n\n    this.libp2p = libp2p\n    this.started = false\n\n    /**\n     * Time based cache for sequence numbers.\n     *\n     * @type {TimeCache}\n     */\n    this.cache = new TimeCache()\n\n    /**\n     * Map of peers.\n     *\n     * @type {Map<string, Peer>}\n     */\n    this.peers = new Map()\n\n    /**\n     * List of our subscriptions\n     * @type {Set<string>}\n     */\n    this.subscriptions = new Set()\n\n    this._onConnection = this._onConnection.bind(this)\n    this._dialPeer = this._dialPeer.bind(this)\n  }\n\n  _addPeer (peer) {\n    const id = peer.info.id.toB58String()\n\n    /*\n      Always use an existing peer.\n\n      What is happening here is: \"If the other peer has already dialed to me, we already have\n      an establish link between the two, what might be missing is a\n      Connection specifically between me and that Peer\"\n     */\n    let existing = this.peers.get(id)\n    if (!existing) {\n      log('new peer', id)\n      this.peers.set(id, peer)\n      existing = peer\n\n      peer.once('close', () => this._removePeer(peer))\n    }\n    ++existing._references\n\n    return existing\n  }\n\n  _removePeer (peer) {\n    const id = peer.info.id.toB58String()\n\n    log('remove', id, peer._references)\n    // Only delete when no one else is referencing this peer.\n    if (--peer._references === 0) {\n      log('delete peer', id)\n      this.peers.delete(id)\n    }\n\n    return peer\n  }\n\n  _dialPeer (peerInfo, callback) {\n    callback = callback || function noop () {}\n    const idB58Str = peerInfo.id.toB58String()\n\n    // If already have a PubSub conn, ignore\n    const peer = this.peers.get(idB58Str)\n    if (peer && peer.isConnected) {\n      return setImmediate(() => callback())\n    }\n\n    log('dialing %s', idB58Str)\n    this.libp2p.dialProtocol(peerInfo, multicodec, (err, conn) => {\n      if (err) {\n        log.err(err)\n        return callback()\n      }\n\n      this._onDial(peerInfo, conn, callback)\n    })\n  }\n\n  _onDial (peerInfo, conn, callback) {\n    const idB58Str = peerInfo.id.toB58String()\n    log('connected', idB58Str)\n\n    const peer = this._addPeer(new Peer(peerInfo))\n    peer.attachConnection(conn)\n\n    // Immediately send my own subscriptions to the newly established conn\n    peer.sendSubscriptions(this.subscriptions)\n    setImmediate(() => callback())\n  }\n\n  _onConnection (protocol, conn) {\n    conn.getPeerInfo((err, peerInfo) => {\n      if (err) {\n        log.err('Failed to identify incomming conn', err)\n        return pull(pull.empty(), conn)\n      }\n\n      const idB58Str = peerInfo.id.toB58String()\n      const peer = this._addPeer(new Peer(peerInfo))\n\n      this._processConnection(idB58Str, conn, peer)\n    })\n  }\n\n  _processConnection (idB58Str, conn, peer) {\n    pull(\n      conn,\n      lp.decode(),\n      pull.map((data) => pb.rpc.RPC.decode(data)),\n      pull.drain(\n        (rpc) => this._onRpc(idB58Str, rpc),\n        (err) => this._onConnectionEnd(idB58Str, peer, err)\n      )\n    )\n  }\n\n  _onRpc (idB58Str, rpc) {\n    if (!rpc) {\n      return\n    }\n\n    log('rpc from', idB58Str)\n    const subs = rpc.subscriptions\n    const msgs = rpc.msgs\n\n    if (msgs && msgs.length) {\n      this._processRpcMessages(utils.normalizeInRpcMessages(rpc.msgs))\n    }\n\n    if (subs && subs.length) {\n      const peer = this.peers.get(idB58Str)\n      if (peer) {\n        peer.updateSubscriptions(subs)\n      }\n    }\n  }\n\n  _processRpcMessages (msgs) {\n    msgs.forEach((msg) => {\n      const seqno = utils.msgId(msg.from, msg.seqno.toString())\n      // 1. check if I've seen the message, if yes, ignore\n      if (this.cache.has(seqno)) {\n        return\n      }\n\n      this.cache.put(seqno)\n\n      // 2. emit to self\n      this._emitMessages(msg.topicIDs, [msg])\n\n      // 3. propagate msg to others\n      this._forwardMessages(msg.topicIDs, [msg])\n    })\n  }\n\n  _onConnectionEnd (idB58Str, peer, err) {\n    // socket hang up, means the one side canceled\n    if (err && err.message !== 'socket hang up') {\n      log.err(err)\n    }\n\n    log('connection ended', idB58Str, err ? err.message : '')\n    this._removePeer(peer)\n  }\n\n  _emitMessages (topics, messages) {\n    topics.forEach((topic) => {\n      if (!this.subscriptions.has(topic)) {\n        return\n      }\n\n      messages.forEach((message) => {\n        this.emit(topic, message)\n      })\n    })\n  }\n\n  _forwardMessages (topics, messages) {\n    this.peers.forEach((peer) => {\n      if (!peer.isWritable || !utils.anyMatch(peer.topics, topics)) {\n        return\n      }\n\n      peer.sendMessages(utils.normalizeOutRpcMessages(messages))\n\n      log('publish msgs on topics', topics, peer.info.id.toB58String())\n    })\n  }\n\n  /**\n   * Mounts the floodsub protocol onto the libp2p node and sends our\n   * subscriptions to every peer conneceted\n   *\n   * @param {Function} callback\n   * @returns {undefined}\n   *\n   */\n  start (callback) {\n    if (this.started) {\n      return setImmediate(() => callback(new Error('already started')))\n    }\n\n    this.libp2p.handle(multicodec, this._onConnection)\n\n    // Speed up any new peer that comes in my way\n    this.libp2p.on('peer:connect', this._dialPeer)\n\n    // Dial already connected peers\n    const peerInfos = values(this.libp2p.peerBook.getAll())\n\n    asyncEach(peerInfos, (peer, cb) => this._dialPeer(peer, cb), (err) => {\n      setImmediate(() => {\n        this.started = true\n        callback(err)\n      })\n    })\n  }\n\n  /**\n   * Unmounts the floodsub protocol and shuts down every connection\n   *\n   * @param {Function} callback\n   * @returns {undefined}\n   *\n   */\n  stop (callback) {\n    if (!this.started) {\n      return setImmediate(() => callback(new Error('not started yet')))\n    }\n\n    this.libp2p.unhandle(multicodec)\n    this.libp2p.removeListener('peer:connect', this._dialPeer)\n\n    log('stopping')\n    asyncEach(this.peers.values(), (peer, cb) => peer.close(cb), (err) => {\n      if (err) {\n        return callback(err)\n      }\n\n      log('stopped')\n      this.peers = new Map()\n      this.subscriptions = new Set()\n      this.started = false\n      callback()\n    })\n  }\n\n  /**\n   * Publish messages to the given topics.\n   *\n   * @param {Array<string>|string} topics\n   * @param {Array<any>|any} messages\n   * @returns {undefined}\n   *\n   */\n  publish (topics, messages) {\n    assert(this.started, 'FloodSub is not started')\n\n    log('publish', topics, messages)\n\n    topics = ensureArray(topics)\n    messages = ensureArray(messages)\n\n    const from = this.libp2p.peerInfo.id.toB58String()\n\n    const buildMessage = (msg) => {\n      const seqno = utils.randomSeqno()\n      this.cache.put(utils.msgId(from, seqno))\n\n      return {\n        from: from,\n        data: msg,\n        seqno: new Buffer(seqno),\n        topicIDs: topics\n      }\n    }\n\n    const msgObjects = messages.map(buildMessage)\n\n    // Emit to self if I'm interested\n    this._emitMessages(topics, msgObjects)\n\n    // send to all the other peers\n    this._forwardMessages(topics, msgObjects)\n  }\n\n  /**\n   * Subscribe to the given topic(s).\n   *\n   * @param {Array<string>|string} topics\n   * @returns {undefined}\n   */\n  subscribe (topics) {\n    assert(this.started, 'FloodSub is not started')\n\n    topics = ensureArray(topics)\n\n    topics.forEach((topic) => this.subscriptions.add(topic))\n\n    this.peers.forEach((peer) => sendSubscriptionsOnceReady(peer))\n    // make sure that FloodSub is already mounted\n    function sendSubscriptionsOnceReady (peer) {\n      if (peer && peer.isWritable) {\n        return peer.sendSubscriptions(topics)\n      }\n      const onConnection = () => {\n        peer.removeListener('connection', onConnection)\n        sendSubscriptionsOnceReady(peer)\n      }\n      peer.on('connection', onConnection)\n      peer.once('close', () => peer.removeListener('connection', onConnection))\n    }\n  }\n\n  /**\n   * Unsubscribe from the given topic(s).\n   *\n   * @param {Array<string>|string} topics\n   * @returns {undefined}\n   */\n  unsubscribe (topics) {\n    // Avoid race conditions, by quietly ignoring unsub when shutdown.\n    if (!this.started) {\n      return\n    }\n\n    topics = ensureArray(topics)\n\n    topics.forEach((topic) => this.subscriptions.delete(topic))\n\n    this.peers.forEach((peer) => checkIfReady(peer))\n    // make sure that FloodSub is already mounted\n    function checkIfReady (peer) {\n      if (peer && peer.isWritable) {\n        peer.sendUnsubscriptions(topics)\n      } else {\n        setImmediate(checkIfReady.bind(peer))\n      }\n    }\n  }\n}\n\nmodule.exports = FloodSub\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/index.js\n// module id = 996\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = `\nmessage RPC {\n  repeated SubOpts subscriptions = 1;\n  repeated Message msgs = 2;\n\n  message SubOpts {\n    optional bool subscribe = 1; // subscribe or unsubcribe\n    optional string topicCID = 2;\n  }\n\n  message Message {\n    optional bytes from = 1;\n    optional bytes data = 2;\n    optional bytes seqno = 3;\n    repeated string topicIDs = 4; \n  }\n}`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/message/rpc.proto.js\n// module id = 997\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/message/rpc.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = `\n// topicCID = cid(merkledag_protobuf(topicDescriptor)); (not the topic.name)\nmessage TopicDescriptor {\n  optional string name = 1;\n  optional AuthOpts auth = 2;\n  optional EncOpts enc = 2;\n\n  message AuthOpts {\n    optional AuthMode mode = 1;\n    repeated bytes keys = 2; // root keys to trust\n\n    enum AuthMode {\n      NONE = 0; // no authentication, anyone can publish\n      KEY = 1; // only messages signed by keys in the topic descriptor are accepted\n      WOT = 2; // web of trust, certificates can allow publisher set to grow\n    }\n  }\n\n  message EncOpts {\n    optional EncMode mode = 1;\n    repeated bytes keyHashes = 2; // the hashes of the shared keys used (salted)\n\n    enum EncMode {\n      NONE = 0; // no encryption, anyone can read\n      SHAREDKEY = 1; // messages are encrypted with shared key\n      WOT = 2; // web of trust, certificates can allow publisher set to grow\n    }\n  }\n}`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/message/topic-descriptor.proto.js\n// module id = 998\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/message/topic-descriptor.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst lp = __webpack_require__(45)\nconst Pushable = __webpack_require__(54)\nconst pull = __webpack_require__(6)\nconst setImmediate = __webpack_require__(8)\nconst EventEmitter = __webpack_require__(15)\n\nconst rpc = __webpack_require__(446).rpc.RPC\n\n/**\n * The known state of a connected peer.\n */\nclass Peer extends EventEmitter {\n  /**\n   * @param {PeerInfo} info\n   */\n  constructor (info) {\n    super()\n\n    /**\n     * @type {PeerInfo}\n     */\n    this.info = info\n    /**\n     * @type {Connection}\n     */\n    this.conn = null\n    /**\n     * @type {Set}\n     */\n    this.topics = new Set()\n    /**\n     * @type {Pushable}\n     */\n    this.stream = null\n\n    this._references = 0\n  }\n\n  /**\n   * Is the peer connected currently?\n   *\n   * @type {boolean}\n   */\n  get isConnected () {\n    return Boolean(this.conn)\n  }\n\n  /**\n   * Do we have a connection to write on?\n   *\n   * @type {boolean}\n   */\n  get isWritable () {\n    return Boolean(this.stream)\n  }\n\n  /**\n   * Send a message to this peer.\n   * Throws if there is no `stream` to write to available.\n   *\n   * @param {Buffer} msg\n   * @returns {undefined}\n   */\n  write (msg) {\n    if (!this.isWritable) {\n      const id = this.info.id.toB58String()\n      throw new Error('No writable connection to ' + id)\n    }\n\n    this.stream.push(msg)\n  }\n\n  /**\n   * Attach the peer to a connection and setup a write stream\n   *\n   * @param {Connection} conn\n   * @returns {undefined}\n   */\n  attachConnection (conn) {\n    this.conn = conn\n    this.stream = new Pushable()\n\n    pull(\n      this.stream,\n      lp.encode(),\n      conn,\n      pull.onEnd(() => {\n        this.conn = null\n        this.stream = null\n        this.emit('close')\n      })\n    )\n\n    this.emit('connection')\n  }\n\n  _sendRawSubscriptions (topics, subscribe) {\n    if (topics.size === 0) {\n      return\n    }\n\n    const subs = []\n    topics.forEach((topic) => {\n      subs.push({\n        subscribe: subscribe,\n        topicCID: topic\n      })\n    })\n\n    this.write(rpc.encode({\n      subscriptions: subs\n    }))\n  }\n\n  /**\n   * Send the given subscriptions to this peer.\n   * @param {Set|Array} topics\n   * @returns {undefined}\n   */\n  sendSubscriptions (topics) {\n    this._sendRawSubscriptions(topics, true)\n  }\n\n  /**\n   * Send the given unsubscriptions to this peer.\n   * @param {Set|Array} topics\n   * @returns {undefined}\n   */\n  sendUnsubscriptions (topics) {\n    this._sendRawSubscriptions(topics, false)\n  }\n\n  /**\n   * Send messages to this peer.\n   *\n   * @param {Array<any>} msgs\n   * @returns {undefined}\n   */\n  sendMessages (msgs) {\n    this.write(rpc.encode({\n      msgs: msgs\n    }))\n  }\n\n  /**\n   * Bulk process subscription updates.\n   *\n   * @param {Array} changes\n   * @returns {undefined}\n   */\n  updateSubscriptions (changes) {\n    changes.forEach((subopt) => {\n      if (subopt.subscribe) {\n        this.topics.add(subopt.topicCID)\n      } else {\n        this.topics.delete(subopt.topicCID)\n      }\n    })\n  }\n\n  /**\n   * Closes the open connection to peer\n   *\n   * @param {Function} callback\n   * @returns {undefined}\n   */\n  close (callback) {\n    // Force removal of peer\n    this._references = 1\n\n    // End the pushable\n    if (this.stream) {\n      this.stream.end()\n    }\n\n    setImmediate(() => {\n      this.conn = null\n      this.stream = null\n      this.emit('close')\n      callback()\n    })\n  }\n}\n\nmodule.exports = Peer\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/peer.js\n// module id = 999\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/peer.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst crypto = __webpack_require__(79)\nconst bs58 = __webpack_require__(76)\n\nexports = module.exports\n\n/**\n * Generatea random sequence number.\n *\n * @returns {string}\n * @private\n */\nexports.randomSeqno = () => {\n  return crypto.randomBytes(20).toString('hex')\n}\n\n/**\n * Generate a message id, based on the `from` and `seqno`.\n *\n * @param {string} from\n * @param {string} seqno\n * @returns {string}\n * @private\n */\nexports.msgId = (from, seqno) => {\n  return from + seqno\n}\n\n/**\n * Check if any member of the first set is also a member\n * of the second set.\n *\n * @param {Set|Array} a\n * @param {Set|Array} b\n * @returns {boolean}\n * @private\n */\nexports.anyMatch = (a, b) => {\n  let bHas\n  if (Array.isArray(b)) {\n    bHas = (val) => b.indexOf(val) > -1\n  } else {\n    bHas = (val) => b.has(val)\n  }\n\n  for (let val of a) {\n    if (bHas(val)) {\n      return true\n    }\n  }\n\n  return false\n}\n\n/**\n * Make everything an array.\n *\n * @param {any} maybeArray\n * @returns {Array}\n * @private\n */\nexports.ensureArray = (maybeArray) => {\n  if (!Array.isArray(maybeArray)) {\n    return [maybeArray]\n  }\n\n  return maybeArray\n}\n\nexports.normalizeInRpcMessages = (messages) => {\n  if (!messages) {\n    return messages\n  }\n  return messages.map((msg) => {\n    const m = Object.assign({}, msg)\n    if (Buffer.isBuffer(msg.from)) {\n      m.from = bs58.encode(msg.from)\n    }\n    return m\n  })\n}\n\nexports.normalizeOutRpcMessages = (messages) => {\n  if (!messages) {\n    return messages\n  }\n  return messages.map((msg) => {\n    const m = Object.assign({}, msg)\n    if (typeof msg.from === 'string' || msg.from instanceof String) {\n      m.from = bs58.decode(msg.from)\n    }\n    return m\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-floodsub/src/utils.js\n// module id = 1000\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-floodsub/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\nconst PeerInfo = __webpack_require__(44)\nconst PeerId = __webpack_require__(26)\nconst multiaddr = __webpack_require__(21)\nconst pull = __webpack_require__(6)\nconst lp = __webpack_require__(45)\n\nconst msg = __webpack_require__(447)\n\nmodule.exports = (conn, callback) => {\n  pull(\n    conn,\n    lp.decode(),\n    pull.take(1),\n    pull.collect((err, data) => {\n      if (err) {\n        return callback(err)\n      }\n\n      // connection got closed graciously\n      if (data.length === 0) {\n        return callback(new Error('conn was closed, did not receive data'))\n      }\n\n      const input = msg.decode(data[0])\n\n      PeerId.createFromPubKey(input.publicKey, (err, id) => {\n        if (err) {\n          return callback(err)\n        }\n\n        const peerInfo = new PeerInfo(id)\n        input.listenAddrs\n          .map(multiaddr)\n          .forEach((ma) => peerInfo.multiaddrs.add(ma))\n\n        callback(null, peerInfo, getObservedAddrs(input))\n      })\n    })\n  )\n}\n\nfunction getObservedAddrs (input) {\n  if (!hasObservedAddr(input)) {\n    return []\n  }\n\n  let addrs = input.observedAddr\n\n  if (!Array.isArray(input.observedAddr)) {\n    addrs = [addrs]\n  }\n\n  return addrs.map((oa) => multiaddr(oa))\n}\n\nfunction hasObservedAddr (input) {\n  return input.observedAddr && input.observedAddr.length > 0\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-identify/src/dialer.js\n// module id = 1001\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-identify/src/dialer.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports = module.exports\nexports.multicodec = '/ipfs/id/1.0.0'\nexports.listener = __webpack_require__(1003)\nexports.dialer = __webpack_require__(1001)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-identify/src/index.js\n// module id = 1002\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-identify/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(6)\nconst lp = __webpack_require__(45)\n\nconst msg = __webpack_require__(447)\n\nmodule.exports = (conn, pInfoSelf) => {\n  // send what I see from the other + my Info\n  conn.getObservedAddrs((err, observedAddrs) => {\n    if (err) { return }\n    observedAddrs = observedAddrs[0]\n\n    let publicKey = Buffer.alloc(0)\n    if (pInfoSelf.id.pubKey) {\n      publicKey = pInfoSelf.id.pubKey.bytes\n    }\n\n    const msgSend = msg.encode({\n      protocolVersion: 'ipfs/0.1.0',\n      agentVersion: 'na',\n      publicKey: publicKey,\n      listenAddrs: pInfoSelf.multiaddrs.toArray().map((ma) => ma.buffer),\n      observedAddr: observedAddrs ? observedAddrs.buffer : Buffer.from('')\n    })\n\n    pull(\n      pull.values([msgSend]),\n      lp.encode(),\n      conn\n    )\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-identify/src/listener.js\n// module id = 1003\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-identify/src/listener.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst async = __webpack_require__(588)\nconst forge = __webpack_require__(149)\nconst util = __webpack_require__(1006)\n\n/**\n * Cryptographic Message Syntax (aka PKCS #7)\n *\n * CMS describes an encapsulation syntax for data protection. It\n * is used to digitally sign, digest, authenticate, or encrypt\n * arbitrary message content.\n *\n * See RFC 5652 for all the details.\n */\nclass CMS {\n  /**\n   * Creates a new instance with a keychain\n   *\n   * @param {Keychain} keychain - the available keys\n   */\n  constructor (keychain) {\n    if (!keychain) {\n      throw new Error('keychain is required')\n    }\n\n    this.keychain = keychain\n  }\n\n  /**\n   * Creates some protected data.\n   *\n   * The output Buffer contains the PKCS #7 message in DER.\n   *\n   * @param {string} name - The local key name.\n   * @param {Buffer} plain - The data to encrypt.\n   * @param {function(Error, Buffer)} callback\n   * @returns {undefined}\n   */\n  encrypt (name, plain, callback) {\n    const self = this\n    const done = (err, result) => async.setImmediate(() => callback(err, result))\n\n    if (!Buffer.isBuffer(plain)) {\n      return done(new Error('Plain data must be a Buffer'))\n    }\n\n    async.series([\n      (cb) => self.keychain.findKeyByName(name, cb),\n      (cb) => self.keychain._getPrivateKey(name, cb)\n    ], (err, results) => {\n      if (err) return done(err)\n\n      let key = results[0]\n      let pem = results[1]\n      try {\n        const privateKey = forge.pki.decryptRsaPrivateKey(pem, self.keychain._())\n        util.certificateForKey(key, privateKey, (err, certificate) => {\n          if (err) return callback(err)\n\n          // create a p7 enveloped message\n          const p7 = forge.pkcs7.createEnvelopedData()\n          p7.addRecipient(certificate)\n          p7.content = forge.util.createBuffer(plain)\n          p7.encrypt()\n\n          // convert message to DER\n          const der = forge.asn1.toDer(p7.toAsn1()).getBytes()\n          done(null, Buffer.from(der, 'binary'))\n        })\n      } catch (err) {\n        done(err)\n      }\n    })\n  }\n\n  /**\n   * Reads some protected data.\n   *\n   * The keychain must contain one of the keys used to encrypt the data.  If none of the keys\n   * exists, an Error is returned with the property 'missingKeys'.  It is array of key ids.\n   *\n   * @param {Buffer} cmsData - The CMS encrypted data to decrypt.\n   * @param {function(Error, Buffer)} callback\n   * @returns {undefined}\n   */\n  decrypt (cmsData, callback) {\n    const done = (err, result) => async.setImmediate(() => callback(err, result))\n\n    if (!Buffer.isBuffer(cmsData)) {\n      return done(new Error('CMS data is required'))\n    }\n\n    const self = this\n    let cms\n    try {\n      const buf = forge.util.createBuffer(cmsData.toString('binary'))\n      const obj = forge.asn1.fromDer(buf)\n      cms = forge.pkcs7.messageFromAsn1(obj)\n    } catch (err) {\n      return done(new Error('Invalid CMS: ' + err.message))\n    }\n\n    // Find a recipient whose key we hold. We only deal with recipient certs\n    // issued by ipfs (O=ipfs).\n    const recipients = cms.recipients\n      .filter(r => r.issuer.find(a => a.shortName === 'O' && a.value === 'ipfs'))\n      .filter(r => r.issuer.find(a => a.shortName === 'CN'))\n      .map(r => {\n        return {\n          recipient: r,\n          keyId: r.issuer.find(a => a.shortName === 'CN').value\n        }\n      })\n    async.detect(\n      recipients,\n      (r, cb) => self.keychain.findKeyById(r.keyId, (err, info) => cb(null, !err && info)),\n      (err, r) => {\n        if (err) return done(err)\n        if (!r) {\n          const missingKeys = recipients.map(r => r.keyId)\n          err = new Error('Decryption needs one of the key(s): ' + missingKeys.join(', '))\n          err.missingKeys = missingKeys\n          return done(err)\n        }\n\n        async.waterfall([\n          (cb) => self.keychain.findKeyById(r.keyId, cb),\n          (key, cb) => self.keychain._getPrivateKey(key.name, cb)\n        ], (err, pem) => {\n          if (err) return done(err)\n\n          const privateKey = forge.pki.decryptRsaPrivateKey(pem, self.keychain._())\n          cms.decrypt(r.recipient, privateKey)\n          done(null, Buffer.from(cms.content.getBytes(), 'binary'))\n        })\n      }\n    )\n  }\n}\n\nmodule.exports = CMS\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-keychain/src/cms.js\n// module id = 1004\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-keychain/src/cms.js")},function(module,exports,__webpack_require__){"use strict";eval("/* eslint max-nested-callbacks: [\"error\", 5] */\n\n\nconst sanitize = __webpack_require__(1220)\nconst deepmerge = __webpack_require__(802)\nconst crypto = __webpack_require__(79)\nconst DS = __webpack_require__(40)\nconst pull = __webpack_require__(6)\nconst CMS = __webpack_require__(1004)\n\nconst keyPrefix = '/pkcs8/'\nconst infoPrefix = '/info/'\n\n// NIST SP 800-132\nconst NIST = {\n  minKeyLength: 112 / 8,\n  minSaltLength: 128 / 8,\n  minIterationCount: 1000\n}\n\nconst defaultOptions = {\n  // See https://cryptosense.com/parametesr-choice-for-pbkdf2/\n  dek: {\n    keyLength: 512 / 8,\n    iterationCount: 10000,\n    salt: 'you should override this value with a crypto secure random number',\n    hash: 'sha2-512'\n  }\n}\n\nfunction validateKeyName (name) {\n  if (!name) return false\n  return name === sanitize(name.trim())\n}\n\n/**\n * Returns an error to the caller, after a delay\n *\n * This assumes than an error indicates that the keychain is under attack. Delay returning an\n * error to make brute force attacks harder.\n *\n * @param {function(Error)} callback - The caller\n * @param {string | Error} err - The error\n * @returns {undefined}\n * @private\n */\nfunction _error (callback, err) {\n  const min = 200\n  const max = 1000\n  const delay = Math.random() * (max - min) + min\n  if (typeof err === 'string') err = new Error(err)\n  setTimeout(callback, delay, err, null)\n}\n\n/**\n * Converts a key name into a datastore name.\n *\n * @param {string} name\n * @returns {DS.Key}\n * @private\n */\nfunction DsName (name) {\n  return new DS.Key(keyPrefix + name)\n}\n\n/**\n * Converts a key name into a datastore info name.\n *\n * @param {string} name\n * @returns {DS.Key}\n * @private\n */\nfunction DsInfoName (name) {\n  return new DS.Key(infoPrefix + name)\n}\n\n/**\n * Information about a key.\n *\n * @typedef {Object} KeyInfo\n *\n * @property {string} id - The universally unique key id.\n * @property {string} name - The local key name.\n */\n\n/**\n * Manages the lifecycle of a key. Keys are encrypted at rest using PKCS #8.\n *\n * A key in the store has two entries\n * - '/info/*key-name*', contains the KeyInfo for the key\n * - '/pkcs8/*key-name*', contains the PKCS #8 for the key\n *\n */\nclass Keychain {\n  /**\n   * Creates a new instance of a key chain.\n   *\n   * @param {DS} store - where the key are.\n   * @param {object} options - ???\n   */\n  constructor (store, options) {\n    if (!store) {\n      throw new Error('store is required')\n    }\n    this.store = store\n\n    const opts = deepmerge(defaultOptions, options)\n\n    // Enforce NIST SP 800-132\n    if (!opts.passPhrase || opts.passPhrase.length < 20) {\n      throw new Error('passPhrase must be least 20 characters')\n    }\n    if (opts.dek.keyLength < NIST.minKeyLength) {\n      throw new Error(`dek.keyLength must be least ${NIST.minKeyLength} bytes`)\n    }\n    if (opts.dek.salt.length < NIST.minSaltLength) {\n      throw new Error(`dek.saltLength must be least ${NIST.minSaltLength} bytes`)\n    }\n    if (opts.dek.iterationCount < NIST.minIterationCount) {\n      throw new Error(`dek.iterationCount must be least ${NIST.minIterationCount}`)\n    }\n\n    // Create the derived encrypting key\n    const dek = crypto.pbkdf2(\n      opts.passPhrase,\n      opts.dek.salt,\n      opts.dek.iterationCount,\n      opts.dek.keyLength,\n      opts.dek.hash)\n    Object.defineProperty(this, '_', { value: () => dek })\n  }\n\n  /**\n   * Gets an object that can encrypt/decrypt protected data\n   * using the Cryptographic Message Syntax (CMS).\n   *\n   * CMS describes an encapsulation syntax for data protection. It\n   * is used to digitally sign, digest, authenticate, or encrypt\n   * arbitrary message content.\n   *\n   * @returns {CMS}\n   */\n  get cms () {\n    return new CMS(this)\n  }\n\n  /**\n   * Generates the options for a keychain.  A random salt is produced.\n   *\n   * @returns {object}\n   */\n  static generateOptions () {\n    const options = Object.assign({}, defaultOptions)\n    const saltLength = Math.ceil(NIST.minSaltLength / 3) * 3 // no base64 padding\n    options.dek.salt = crypto.randomBytes(saltLength).toString('base64')\n    return options\n  }\n\n  /**\n   * Gets an object that can encrypt/decrypt protected data.\n   * The default options for a keychain.\n   *\n   * @returns {object}\n   */\n  static get options () {\n    return defaultOptions\n  }\n\n  /**\n   * Create a new key.\n   *\n   * @param {string} name - The local key name; cannot already exist.\n   * @param {string} type - One of the key types; 'rsa'.\n   * @param {int} size - The key size in bits.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  createKey (name, type, size, callback) {\n    const self = this\n\n    if (!validateKeyName(name) || name === 'self') {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    const dsname = DsName(name)\n    self.store.has(dsname, (err, exists) => {\n      if (err) return _error(callback, err)\n      if (exists) return _error(callback, `Key '${name}' already exists`)\n\n      switch (type.toLowerCase()) {\n        case 'rsa':\n          if (size < 2048) {\n            return _error(callback, `Invalid RSA key size ${size}`)\n          }\n          break\n        default:\n          break\n      }\n\n      crypto.keys.generateKeyPair(type, size, (err, keypair) => {\n        if (err) return _error(callback, err)\n        keypair.id((err, kid) => {\n          if (err) return _error(callback, err)\n          keypair.export(this._(), (err, pem) => {\n            if (err) return _error(callback, err)\n            const keyInfo = {\n              name: name,\n              id: kid\n            }\n            const batch = self.store.batch()\n            batch.put(dsname, pem)\n            batch.put(DsInfoName(name), JSON.stringify(keyInfo))\n            batch.commit((err) => {\n              if (err) return _error(callback, err)\n\n              callback(null, keyInfo)\n            })\n          })\n        })\n      })\n    })\n  }\n\n  /**\n   * List all the keys.\n   *\n   * @param {function(Error, KeyInfo[])} callback\n   * @returns {undefined}\n   */\n  listKeys (callback) {\n    const self = this\n    const query = {\n      prefix: infoPrefix\n    }\n    pull(\n      self.store.query(query),\n      pull.collect((err, res) => {\n        if (err) return _error(callback, err)\n\n        const info = res.map(r => JSON.parse(r.value))\n        callback(null, info)\n      })\n    )\n  }\n\n  /**\n   * Find a key by it's id.\n   *\n   * @param {string} id - The universally unique key identifier.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  findKeyById (id, callback) {\n    this.listKeys((err, keys) => {\n      if (err) return _error(callback, err)\n\n      const key = keys.find((k) => k.id === id)\n      callback(null, key)\n    })\n  }\n\n  /**\n   * Find a key by it's name.\n   *\n   * @param {string} name - The local key name.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  findKeyByName (name, callback) {\n    if (!validateKeyName(name)) {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n\n    const dsname = DsInfoName(name)\n    this.store.get(dsname, (err, res) => {\n      if (err) {\n        return _error(callback, `Key '${name}' does not exist. ${err.message}`)\n      }\n\n      callback(null, JSON.parse(res.toString()))\n    })\n  }\n\n  /**\n   * Remove an existing key.\n   *\n   * @param {string} name - The local key name; must already exist.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  removeKey (name, callback) {\n    const self = this\n    if (!validateKeyName(name) || name === 'self') {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    const dsname = DsName(name)\n    self.findKeyByName(name, (err, keyinfo) => {\n      if (err) return _error(callback, err)\n      const batch = self.store.batch()\n      batch.delete(dsname)\n      batch.delete(DsInfoName(name))\n      batch.commit((err) => {\n        if (err) return _error(callback, err)\n        callback(null, keyinfo)\n      })\n    })\n  }\n\n  /**\n   * Rename a key\n   *\n   * @param {string} oldName - The old local key name; must already exist.\n   * @param {string} newName - The new local key name; must not already exist.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  renameKey (oldName, newName, callback) {\n    const self = this\n    if (!validateKeyName(oldName) || oldName === 'self') {\n      return _error(callback, `Invalid old key name '${oldName}'`)\n    }\n    if (!validateKeyName(newName) || newName === 'self') {\n      return _error(callback, `Invalid new key name '${newName}'`)\n    }\n    const oldDsname = DsName(oldName)\n    const newDsname = DsName(newName)\n    const oldInfoName = DsInfoName(oldName)\n    const newInfoName = DsInfoName(newName)\n    this.store.get(oldDsname, (err, res) => {\n      if (err) {\n        return _error(callback, `Key '${oldName}' does not exist. ${err.message}`)\n      }\n      const pem = res.toString()\n      self.store.has(newDsname, (err, exists) => {\n        if (err) return _error(callback, err)\n        if (exists) return _error(callback, `Key '${newName}' already exists`)\n\n        self.store.get(oldInfoName, (err, res) => {\n          if (err) return _error(callback, err)\n\n          const keyInfo = JSON.parse(res.toString())\n          keyInfo.name = newName\n          const batch = self.store.batch()\n          batch.put(newDsname, pem)\n          batch.put(newInfoName, JSON.stringify(keyInfo))\n          batch.delete(oldDsname)\n          batch.delete(oldInfoName)\n          batch.commit((err) => {\n            if (err) return _error(callback, err)\n            callback(null, keyInfo)\n          })\n        })\n      })\n    })\n  }\n\n  /**\n   * Export an existing key as a PEM encrypted PKCS #8 string\n   *\n   * @param {string} name - The local key name; must already exist.\n   * @param {string} password - The password\n   * @param {function(Error, string)} callback\n   * @returns {undefined}\n   */\n  exportKey (name, password, callback) {\n    if (!validateKeyName(name)) {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    if (!password) {\n      return _error(callback, 'Password is required')\n    }\n\n    const dsname = DsName(name)\n    this.store.get(dsname, (err, res) => {\n      if (err) {\n        return _error(callback, `Key '${name}' does not exist. ${err.message}`)\n      }\n      const pem = res.toString()\n      crypto.keys.import(pem, this._(), (err, privateKey) => {\n        if (err) return _error(callback, err)\n        privateKey.export(password, callback)\n      })\n    })\n  }\n\n  /**\n   * Import a new key from a PEM encoded PKCS #8 string\n   *\n   * @param {string} name - The local key name; must not already exist.\n   * @param {string} pem - The PEM encoded PKCS #8 string\n   * @param {string} password - The password.\n   * @param {function(Error, KeyInfo)} callback\n   * @returns {undefined}\n   */\n  importKey (name, pem, password, callback) {\n    const self = this\n    if (!validateKeyName(name) || name === 'self') {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    if (!pem) {\n      return _error(callback, 'PEM encoded key is required')\n    }\n    const dsname = DsName(name)\n    self.store.has(dsname, (err, exists) => {\n      if (err) return _error(callback, err)\n      if (exists) return _error(callback, `Key '${name}' already exists`)\n      crypto.keys.import(pem, password, (err, privateKey) => {\n        if (err) return _error(callback, 'Cannot read the key, most likely the password is wrong')\n        privateKey.id((err, kid) => {\n          if (err) return _error(callback, err)\n          privateKey.export(this._(), (err, pem) => {\n            if (err) return _error(callback, err)\n            const keyInfo = {\n              name: name,\n              id: kid\n            }\n            const batch = self.store.batch()\n            batch.put(dsname, pem)\n            batch.put(DsInfoName(name), JSON.stringify(keyInfo))\n            batch.commit((err) => {\n              if (err) return _error(callback, err)\n\n              callback(null, keyInfo)\n            })\n          })\n        })\n      })\n    })\n  }\n\n  importPeer (name, peer, callback) {\n    const self = this\n    if (!validateKeyName(name)) {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    if (!peer || !peer.privKey) {\n      return _error(callback, 'Peer.privKey is required')\n    }\n\n    const privateKey = peer.privKey\n    const dsname = DsName(name)\n    self.store.has(dsname, (err, exists) => {\n      if (err) return _error(callback, err)\n      if (exists) return _error(callback, `Key '${name}' already exists`)\n\n      privateKey.id((err, kid) => {\n        if (err) return _error(callback, err)\n        privateKey.export(this._(), (err, pem) => {\n          if (err) return _error(callback, err)\n          const keyInfo = {\n            name: name,\n            id: kid\n          }\n          const batch = self.store.batch()\n          batch.put(dsname, pem)\n          batch.put(DsInfoName(name), JSON.stringify(keyInfo))\n          batch.commit((err) => {\n            if (err) return _error(callback, err)\n\n            callback(null, keyInfo)\n          })\n        })\n      })\n    })\n  }\n\n  /**\n   * Gets the private key as PEM encoded PKCS #8 string.\n   *\n   * @param {string} name\n   * @param {function(Error, string)} callback\n   * @returns {undefined}\n   * @private\n   */\n  _getPrivateKey (name, callback) {\n    if (!validateKeyName(name)) {\n      return _error(callback, `Invalid key name '${name}'`)\n    }\n    this.store.get(DsName(name), (err, res) => {\n      if (err) {\n        return _error(callback, `Key '${name}' does not exist. ${err.message}`)\n      }\n      callback(null, res.toString())\n    })\n  }\n}\n\nmodule.exports = Keychain\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-keychain/src/keychain.js\n// module id = 1005\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-keychain/src/keychain.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst forge = __webpack_require__(149)\nconst pki = forge.pki\nexports = module.exports\n\n/**\n * Gets a self-signed X.509 certificate for the key.\n *\n * The output Buffer contains the PKCS #7 message in DER.\n *\n * TODO: move to libp2p-crypto package\n *\n * @param {KeyInfo} key - The id and name of the key\n * @param {RsaPrivateKey} privateKey - The naked key\n * @param {function(Error, Certificate)} callback\n * @returns {undefined}\n */\nexports.certificateForKey = (key, privateKey, callback) => {\n  const publicKey = pki.setRsaPublicKey(privateKey.n, privateKey.e)\n  const cert = pki.createCertificate()\n  cert.publicKey = publicKey\n  cert.serialNumber = '01'\n  cert.validity.notBefore = new Date()\n  cert.validity.notAfter = new Date()\n  cert.validity.notAfter.setFullYear(cert.validity.notBefore.getFullYear() + 10)\n  const attrs = [{\n    name: 'organizationName',\n    value: 'ipfs'\n  }, {\n    shortName: 'OU',\n    value: 'keystore'\n  }, {\n    name: 'commonName',\n    value: key.id\n  }]\n  cert.setSubject(attrs)\n  cert.setIssuer(attrs)\n  cert.setExtensions([{\n    name: 'basicConstraints',\n    cA: true\n  }, {\n    name: 'keyUsage',\n    keyCertSign: true,\n    digitalSignature: true,\n    nonRepudiation: true,\n    keyEncipherment: true,\n    dataEncipherment: true\n  }, {\n    name: 'extKeyUsage',\n    serverAuth: true,\n    clientAuth: true,\n    codeSigning: true,\n    emailProtection: true,\n    timeStamping: true\n  }, {\n    name: 'nsCertType',\n    client: true,\n    server: true,\n    email: true,\n    objsign: true,\n    sslCA: true,\n    emailCA: true,\n    objCA: true\n  }])\n  // self-sign certificate\n  cert.sign(privateKey)\n\n  return callback(null, cert)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-keychain/src/util.js\n// module id = 1006\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-keychain/src/util.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {var once = __webpack_require__(53)\nvar eos = __webpack_require__(403)\nvar fs = __webpack_require__(1354) // we only need fs to get the ReadStream and WriteStream prototypes\n\nvar noop = function () {}\nvar ancient = /^v?\\.0/.test(process.version)\n\nvar isFn = function (fn) {\n  return typeof fn === 'function'\n}\n\nvar isFS = function (stream) {\n  if (!ancient) return false // newer node version do not need to care about fs is a special way\n  if (!fs) return false // browser\n  return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)\n}\n\nvar isRequest = function (stream) {\n  return stream.setHeader && isFn(stream.abort)\n}\n\nvar destroyer = function (stream, reading, writing, callback) {\n  callback = once(callback)\n\n  var closed = false\n  stream.on('close', function () {\n    closed = true\n  })\n\n  eos(stream, {readable: reading, writable: writing}, function (err) {\n    if (err) return callback(err)\n    closed = true\n    callback()\n  })\n\n  var destroyed = false\n  return function (err) {\n    if (closed) return\n    if (destroyed) return\n    destroyed = true\n\n    if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks\n    if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want\n\n    if (isFn(stream.destroy)) return stream.destroy()\n\n    callback(err || new Error('stream was destroyed'))\n  }\n}\n\nvar call = function (fn) {\n  fn()\n}\n\nvar pipe = function (from, to) {\n  return from.pipe(to)\n}\n\nvar pump = function () {\n  var streams = Array.prototype.slice.call(arguments)\n  var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop\n\n  if (Array.isArray(streams[0])) streams = streams[0]\n  if (streams.length < 2) throw new Error('pump requires two streams per minimum')\n\n  var error\n  var destroys = streams.map(function (stream, i) {\n    var reading = i < streams.length - 1\n    var writing = i > 0\n    return destroyer(stream, reading, writing, function (err) {\n      if (!error) error = err\n      if (err) destroys.forEach(call)\n      if (reading) return\n      destroys.forEach(call)\n      callback(error)\n    })\n  })\n\n  streams.reduce(pipe)\n}\n\nmodule.exports = pump\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-multiplex/~/pump/index.js\n// module id = 1007\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-multiplex/node_modules/pump/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Multiplex = __webpack_require__(1116)\nconst toStream = __webpack_require__(517)\n\nconst MULTIPLEX_CODEC = __webpack_require__(449)\nconst Muxer = __webpack_require__(1009)\n\nconst pump = __webpack_require__(1007)\n\nfunction create (rawConn, isListener) {\n  const stream = toStream(rawConn)\n\n  // Cleanup and destroy the connection when it ends\n  // as the converted stream doesn't emit 'close'\n  // but .destroy will trigger a 'close' event.\n  stream.on('end', () => stream.destroy())\n\n  const mpx = new Multiplex({\n    halfOpen: true,\n    initiator: !isListener\n  })\n  pump(stream, mpx, stream)\n\n  return new Muxer(rawConn, mpx)\n}\n\nexports = module.exports = create\nexports.multicodec = MULTIPLEX_CODEC\nexports.dialer = (conn) => create(conn, false)\nexports.listener = (conn) => create(conn, true)\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-multiplex/src/index.js\n// module id = 1008\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-multiplex/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15).EventEmitter\nconst Connection = __webpack_require__(39).Connection\nconst toPull = __webpack_require__(310)\nconst pull = __webpack_require__(6)\nconst pullCatch = __webpack_require__(1168)\nconst setImmediate = __webpack_require__(8)\n\nconst MULTIPLEX_CODEC = __webpack_require__(449)\n\nmodule.exports = class MultiplexMuxer extends EventEmitter {\n  constructor (conn, multiplex) {\n    super()\n    this.multiplex = multiplex\n    this.conn = conn\n    this.multicodec = MULTIPLEX_CODEC\n\n    multiplex.on('close', () => this.emit('close'))\n    multiplex.on('error', (err) => this.emit('error', err))\n\n    multiplex.on('stream', (stream, id) => {\n      const muxedConn = new Connection(\n        catchError(toPull.duplex(stream)),\n        this.conn\n      )\n      this.emit('stream', muxedConn)\n    })\n  }\n\n  // method added to enable pure stream muxer feeling\n  newStream (callback) {\n    callback = callback || noop\n    let stream = this.multiplex.createStream()\n\n    const conn = new Connection(\n      catchError(toPull.duplex(stream)),\n      this.conn\n    )\n\n    setImmediate(() => callback(null, conn))\n\n    return conn\n  }\n\n  end (callback) {\n    callback = callback || noop\n    this.multiplex.once('close', callback)\n    this.multiplex.destroy()\n  }\n}\n\nfunction noop () {}\n\n// Catch error makes sure that even though we get the \"Channel destroyed\" error from when closing streams, that it's not leaking through since it's not really an error for us, channels shoul close cleanly.\nfunction catchError (stream) {\n  return {\n    source: pull(\n      stream.source,\n      pullCatch((err) => {\n        if (err.message === 'Channel destroyed') {\n          return\n        }\n        return false\n      })\n    ),\n    sink: stream.sink\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-multiplex/src/muxer.js\n// module id = 1009\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-multiplex/src/muxer.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst handshake = __webpack_require__(102)\nconst constants = __webpack_require__(277)\nconst PROTOCOL = constants.PROTOCOL\nconst PING_LENGTH = constants.PING_LENGTH\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p-ping')\nlog.error = debug('libp2p-ping:error')\n\nfunction mount (swarm) {\n  swarm.handle(PROTOCOL, (protocol, conn) => {\n    const stream = handshake({ timeout: 0 })\n    const shake = stream.handshake\n\n    // receive and echo back\n    function next () {\n      shake.read(PING_LENGTH, (err, buf) => {\n        if (err === true) {\n          // stream closed\n          return\n        }\n        if (err) {\n          return log.error(err)\n        }\n\n        shake.write(buf)\n        return next()\n      })\n    }\n\n    pull(\n      conn,\n      stream,\n      conn\n    )\n\n    next()\n  })\n}\n\nfunction unmount (swarm) {\n  swarm.unhandle(PROTOCOL)\n}\n\nexports = module.exports\nexports.mount = mount\nexports.unmount = unmount\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-ping/src/handler.js\n// module id = 1010\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-ping/src/handler.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst handler = __webpack_require__(1010)\n\nexports = module.exports = __webpack_require__(1012)\nexports.mount = handler.mount\nexports.unmount = handler.unmount\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-ping/src/index.js\n// module id = 1011\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-ping/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EventEmitter = __webpack_require__(15).EventEmitter\nconst pull = __webpack_require__(6)\nconst handshake = __webpack_require__(102)\nconst constants = __webpack_require__(277)\nconst util = __webpack_require__(1013)\nconst rnd = util.rnd\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p-ping')\nlog.error = debug('libp2p-ping:error')\n\nconst PROTOCOL = constants.PROTOCOL\nconst PING_LENGTH = constants.PING_LENGTH\n\nclass Ping extends EventEmitter {\n  constructor (swarm, peer) {\n    super()\n\n    let stop = false\n    let shake\n    let self = this\n\n    log('dialing %s to %s', PROTOCOL, peer.id.toB58String())\n\n    swarm.dial(peer, PROTOCOL, (err, conn) => {\n      if (err) {\n        return this.emit('error', err)\n      }\n\n      const stream = handshake({ timeout: 0 })\n      shake = stream.handshake\n\n      pull(\n        stream,\n        conn,\n        stream\n      )\n\n      // write and wait to see ping back\n      function next () {\n        let start = new Date()\n        let buf = rnd(PING_LENGTH)\n        shake.write(buf)\n        shake.read(PING_LENGTH, (err, bufBack) => {\n          let end = new Date()\n          if (err || !buf.equals(bufBack)) {\n            const err = new Error('Received wrong ping ack')\n            return self.emit('error', err)\n          }\n\n          self.emit('ping', end - start)\n\n          if (stop) {\n            return\n          }\n          next()\n        })\n      }\n\n      next()\n    })\n\n    this.stop = () => {\n      if (stop || !shake) {\n        return\n      }\n\n      stop = true\n\n      pull(\n        pull.empty(),\n        shake.rest()\n      )\n    }\n  }\n}\n\nmodule.exports = Ping\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-ping/src/ping.js\n// module id = 1012\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-ping/src/ping.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst crypto = __webpack_require__(79)\nconst constants = __webpack_require__(277)\n\nexports = module.exports\n\nexports.rnd = (length) => {\n  if (!length) {\n    length = constants.PING_LENGTH\n  }\n  return crypto.randomBytes(length)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-ping/src/util.js\n// module id = 1013\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-ping/src/util.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst multiaddr = __webpack_require__(21)\nconst EventEmitter = __webpack_require__(15).EventEmitter\nconst debug = __webpack_require__(5)\nconst setImmediate = __webpack_require__(8)\n\nconst log = debug('libp2p:railing')\nlog.error = debug('libp2p:railing:error')\n\nclass Railing extends EventEmitter {\n  constructor (bootstrapers) {\n    super()\n    this.bootstrapers = bootstrapers\n    this.interval = null\n  }\n\n  start (callback) {\n    setImmediate(() => callback())\n    if (this.interval) { return }\n\n    this.interval = setInterval(() => {\n      this.bootstrapers.forEach((candidate) => {\n        const ma = multiaddr(candidate)\n\n        const peerId = PeerId.createFromB58String(ma.getPeerId())\n\n        PeerInfo.create(peerId, (err, peerInfo) => {\n          if (err) { return log.error('Invalid bootstrap peer id', err) }\n\n          peerInfo.multiaddrs.add(ma)\n\n          this.emit('peer', peerInfo)\n        })\n      })\n    }, 10000)\n  }\n\n  stop (callback) {\n    setImmediate(callback)\n    if (this.interval) {\n      clearInterval(this.interval)\n      this.interval = null\n    }\n  }\n}\n\nmodule.exports = Railing\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-railing/src/index.js\n// module id = 1014\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-railing/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(6)\nconst lp = __webpack_require__(45)\n\nconst lpOpts = {\n  fixed: true,\n  bytes: 4\n}\n\nexports.createBoxStream = (cipher, mac) => {\n  return pull(\n    ensureBuffer(),\n    pull.asyncMap((chunk, cb) => {\n      cipher.encrypt(chunk, (err, data) => {\n        if (err) {\n          return cb(err)\n        }\n\n        mac.digest(data, (err, digest) => {\n          if (err) {\n            return cb(err)\n          }\n\n          cb(null, Buffer.concat([data, digest]))\n        })\n      })\n    }),\n    lp.encode(lpOpts)\n  )\n}\n\nexports.createUnboxStream = (decipher, mac) => {\n  return pull(\n    ensureBuffer(),\n    lp.decode(lpOpts),\n    pull.asyncMap((chunk, cb) => {\n      const l = chunk.length\n      const macSize = mac.length\n\n      if (l < macSize) {\n        return cb(new Error(`buffer (${l}) shorter than MAC size (${macSize})`))\n      }\n\n      const mark = l - macSize\n      const data = chunk.slice(0, mark)\n      const macd = chunk.slice(mark)\n\n      mac.digest(data, (err, expected) => {\n        if (err) {\n          return cb(err)\n        }\n\n        if (!macd.equals(expected)) {\n          return cb(new Error(`MAC Invalid: ${macd.toString('hex')} != ${expected.toString('hex')}`))\n        }\n\n        // all good, decrypt\n        decipher.decrypt(data, (err, decrypted) => {\n          if (err) {\n            return cb(err)\n          }\n\n          cb(null, decrypted)\n        })\n      })\n    })\n  )\n}\n\nfunction ensureBuffer () {\n  return pull.map((c) => {\n    if (typeof c === 'string') {\n      return Buffer.from(c, 'utf-8')\n    }\n\n    return c\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/etm.js\n// module id = 1015\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/etm.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst waterfall = __webpack_require__(12)\n\nconst support = __webpack_require__(279)\nconst crypto = __webpack_require__(278)\n\nconst log = debug('libp2p:secio')\nlog.error = debug('libp2p:secio:error')\n\n// step 2. Exchange\n// -- exchange (signed) ephemeral keys. verify signatures.\nmodule.exports = function exchange (state, callback) {\n  log('2. exchange - start')\n\n  log('2. exchange - writing exchange')\n  waterfall([\n    (cb) => crypto.createExchange(state, cb),\n    (ex, cb) => {\n      support.write(state, ex)\n      support.read(state.shake, cb)\n    },\n    (msg, cb) => {\n      log('2. exchange - reading exchange')\n      crypto.verify(state, msg, cb)\n    },\n    (cb) => crypto.generateKeys(state, cb)\n  ], (err) => {\n    if (err) { return callback(err) }\n\n    log('2. exchange - finish')\n    callback()\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/exchange.js\n// module id = 1016\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/exchange.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst handshake = __webpack_require__(102)\nconst debug = __webpack_require__(5)\n\nconst log = debug('libp2p:secio')\nlog.error = debug('libp2p:secio:error')\n\nconst etm = __webpack_require__(1015)\nconst crypto = __webpack_require__(278)\n\n// step 3. Finish\n// -- send expected message to verify encryption works (send local nonce)\nmodule.exports = function finish (state, callback) {\n  log('3. finish - start')\n\n  const proto = state.protocols\n  const stream = state.shake.rest()\n  const shake = handshake({timeout: state.timeout}, (err) => {\n    if (err) {\n      throw err\n    }\n  })\n\n  pull(\n    stream,\n    etm.createUnboxStream(proto.remote.cipher, proto.remote.mac),\n    shake,\n    etm.createBoxStream(proto.local.cipher, proto.local.mac),\n    stream\n  )\n\n  shake.handshake.write(state.proposal.in.rand)\n  shake.handshake.read(state.proposal.in.rand.length, (err, nonceBack) => {\n    const fail = (err) => {\n      log.error(err)\n      state.secure.resolve({\n        source: pull.error(err),\n        sink (read) {\n        }\n      })\n      callback(err)\n    }\n\n    if (err) return fail(err)\n\n    try {\n      crypto.verifyNonce(state, nonceBack)\n    } catch (err) {\n      return fail(err)\n    }\n\n    log('3. finish - finish')\n\n    // Awesome that's all folks.\n    state.secure.resolve(shake.handshake.rest())\n    callback()\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/finish.js\n// module id = 1017\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/finish.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst series = __webpack_require__(51)\n\nconst propose = __webpack_require__(1019)\nconst exchange = __webpack_require__(1016)\nconst finish = __webpack_require__(1017)\n\n// Performs initial communication over insecure channel to share keys, IDs,\n// and initiate communication, assigning all necessary params.\nmodule.exports = function handshake (state, callback) {\n  series([\n    (cb) => propose(state, cb),\n    (cb) => exchange(state, cb),\n    (cb) => finish(state, cb)\n  ], (err) => {\n    state.cleanSecrets()\n\n    if (err) {\n      if (err === true) {\n        err = new Error('Stream ended prematurely')\n      }\n      state.shake.abort(err)\n    }\n\n    // signal when the handshake is finished so that plumbing can happen\n    callback(err)\n  })\n\n  return state.stream\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/index.js\n// module id = 1018\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst waterfall = __webpack_require__(12)\n\nconst support = __webpack_require__(279)\nconst crypto = __webpack_require__(278)\n\nconst log = debug('libp2p:secio')\nlog.error = debug('libp2p:secio:error')\n\n// step 1. Propose\n// -- propose cipher suite + send pubkeys + nonce\nmodule.exports = function propose (state, callback) {\n  log('1. propose - start')\n\n  log('1. propose - writing proposal')\n  support.write(state, crypto.createProposal(state))\n\n  waterfall([\n    (cb) => support.read(state.shake, cb),\n    (msg, cb) => {\n      log('1. propose - reading proposal', msg)\n      crypto.identify(state, msg, cb)\n    },\n    (cb) => crypto.selectProtocols(state, cb)\n  ], (err) => {\n    if (err) {\n      return callback(err)\n    }\n\n    log('1. propose - finish')\n    callback()\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/propose.js\n// module id = 1019\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/propose.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = `message Propose {\n  optional bytes rand = 1;\n  optional bytes pubkey = 2;\n  optional string exchanges = 3;\n  optional string ciphers = 4;\n  optional string hashes = 5;\n}\n\nmessage Exchange {\n  optional bytes epubkey = 1;\n  optional bytes signature = 2;\n}`\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/handshake/secio.proto.js\n// module id = 1020\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/handshake/secio.proto.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst Connection = __webpack_require__(39).Connection\nconst assert = __webpack_require__(16)\nconst PeerInfo = __webpack_require__(44)\nconst debug = __webpack_require__(5)\nconst once = __webpack_require__(53)\nconst log = debug('libp2p:secio')\nlog.error = debug('libp2p:secio:error')\n\nconst handshake = __webpack_require__(1018)\nconst State = __webpack_require__(1022)\n\nmodule.exports = {\n  tag: '/secio/1.0.0',\n  encrypt (localId, conn, remoteId, callback) {\n    assert(localId, 'no local private key provided')\n    assert(conn, 'no connection for the handshake  provided')\n\n    if (typeof remoteId === 'function') {\n      callback = remoteId\n      remoteId = undefined\n    }\n\n    callback = once(callback || function (err) {\n      if (err) { log.error(err) }\n    })\n\n    const timeout = 60 * 1000 * 5\n\n    const state = new State(localId, remoteId, timeout, callback)\n\n    function finish (err) {\n      if (err) { return callback(err) }\n\n      conn.getPeerInfo((err, peerInfo) => {\n        encryptedConnection.setInnerConn(new Connection(state.secure, conn))\n\n        if (err) { // no peerInfo yet, means I'm the receiver\n          encryptedConnection.setPeerInfo(new PeerInfo(state.id.remote))\n        }\n\n        callback()\n      })\n    }\n\n    const encryptedConnection = new Connection(undefined, conn)\n\n    pull(\n      conn,\n      handshake(state, finish),\n      conn\n    )\n\n    return encryptedConnection\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/index.js\n// module id = 1021\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst handshake = __webpack_require__(102)\nconst deferred = __webpack_require__(301)\n\nclass State {\n  constructor (localId, remoteId, timeout, callback) {\n    if (typeof timeout === 'function') {\n      callback = timeout\n      timeout = undefined\n    }\n\n    this.setup()\n\n    this.id.local = localId\n    // TODO use remoteId to verify PeersIdentity\n    this.id.remote = remoteId\n    this.key.local = localId.privKey\n    this.timeout = timeout || 60 * 1000\n    callback = callback || (() => {})\n\n    this.secure = deferred.duplex()\n    this.stream = handshake({ timeout: this.timeout }, callback)\n    this.shake = this.stream.handshake\n    delete this.stream.handshake\n  }\n\n  setup () {\n    this.id = { local: null, remote: null }\n    this.key = { local: null, remote: null }\n    this.shake = null\n    this.cleanSecrets()\n  }\n\n  // remove all data from the handshake that is not needed anymore\n  cleanSecrets () {\n    this.shared = {}\n\n    this.ephemeralKey = { local: null, remote: null }\n    this.proposal = { in: null, out: null }\n    this.proposalEncoded = { in: null, out: null }\n    this.protocols = { local: null, remote: null }\n    this.exchange = { in: null, out: null }\n  }\n}\n\nmodule.exports = State\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-secio/src/state.js\n// module id = 1022\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-secio/src/state.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst identify = __webpack_require__(1002)\nconst multistream = __webpack_require__(288)\nconst waterfall = __webpack_require__(12)\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:swarm:connection')\nconst once = __webpack_require__(53)\nconst setImmediate = __webpack_require__(8)\n\nconst Circuit = __webpack_require__(441)\n\nconst protocolMuxer = __webpack_require__(194)\nconst plaintext = __webpack_require__(451)\n\nmodule.exports = function connection (swarm) {\n  return {\n    addUpgrade () {},\n\n    addStreamMuxer (muxer) {\n      // for dialing\n      swarm.muxers[muxer.multicodec] = muxer\n\n      // for listening\n      swarm.handle(muxer.multicodec, (protocol, conn) => {\n        const muxedConn = muxer.listener(conn)\n\n        muxedConn.on('stream', (conn) => {\n          protocolMuxer(swarm.protocols, conn)\n        })\n\n        // If identify is enabled\n        //   1. overload getPeerInfo\n        //   2. call getPeerInfo\n        //   3. add this conn to the pool\n        if (swarm.identify) {\n          // overload peerInfo to use Identify instead\n          conn.getPeerInfo = (cb) => {\n            const conn = muxedConn.newStream()\n            const ms = new multistream.Dialer()\n            cb = once(cb)\n\n            waterfall([\n              (cb) => ms.handle(conn, cb),\n              (cb) => ms.select(identify.multicodec, cb),\n              (conn, cb) => identify.dialer(conn, cb),\n              (peerInfo, observedAddrs, cb) => {\n                observedAddrs.forEach((oa) => {\n                  swarm._peerInfo.multiaddrs.addSafe(oa)\n                })\n                cb(null, peerInfo)\n              }\n            ], cb)\n          }\n\n          conn.getPeerInfo((err, peerInfo) => {\n            if (err) {\n              return log('Identify not successful')\n            }\n            const b58Str = peerInfo.id.toB58String()\n\n            swarm.muxedConns[b58Str] = { muxer: muxedConn }\n\n            if (peerInfo.multiaddrs.size > 0) {\n              // with incomming conn and through identify, going to pick one\n              // of the available multiaddrs from the other peer as the one\n              // I'm connected to as we really can't be sure at the moment\n              // TODO add this consideration to the connection abstraction!\n              peerInfo.connect(peerInfo.multiaddrs.toArray()[0])\n            } else {\n              // for the case of websockets in the browser, where peers have\n              // no addr, use just their IPFS id\n              peerInfo.connect(`/ipfs/${b58Str}`)\n            }\n            peerInfo = swarm._peerBook.put(peerInfo)\n\n            muxedConn.on('close', () => {\n              delete swarm.muxedConns[b58Str]\n              peerInfo.disconnect()\n              peerInfo = swarm._peerBook.put(peerInfo)\n              setImmediate(() => swarm.emit('peer-mux-closed', peerInfo))\n            })\n\n            setImmediate(() => swarm.emit('peer-mux-established', peerInfo))\n          })\n        }\n\n        return conn\n      })\n    },\n\n    reuse () {\n      swarm.identify = true\n      swarm.handle(identify.multicodec, (protocol, conn) => {\n        identify.listener(conn, swarm._peerInfo)\n      })\n    },\n\n    enableCircuitRelay (config) {\n      config = config || {}\n\n      if (config.enabled) {\n        if (!config.hop) {\n          Object.assign(config, { hop: { enabled: false, active: false } })\n        }\n\n        // TODO: (dryajov) should we enable circuit listener and\n        // dialer by default?\n        swarm.transport.add(Circuit.tag, new Circuit(swarm, config))\n      }\n    },\n\n    crypto (tag, encrypt) {\n      if (!tag && !encrypt) {\n        tag = plaintext.tag\n        encrypt = plaintext.encrypt\n      }\n\n      swarm.unhandle(swarm.crypto.tag)\n      swarm.handle(tag, (protocol, conn) => {\n        const myId = swarm._peerInfo.id\n        const secure = encrypt(myId, conn, undefined, () => {\n          protocolMuxer(swarm.protocols, secure)\n        })\n      })\n\n      swarm.crypto = {tag, encrypt}\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/connection.js\n// module id = 1023\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/connection.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multistream = __webpack_require__(288)\nconst Connection = __webpack_require__(39).Connection\nconst setImmediate = __webpack_require__(8)\nconst getPeerInfo = __webpack_require__(450)\nconst Circuit = __webpack_require__(441)\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:swarm:dial')\n\nconst protocolMuxer = __webpack_require__(194)\n\nfunction dial (swarm) {\n  return (peer, protocol, callback) => {\n    if (typeof protocol === 'function') {\n      callback = protocol\n      protocol = null\n    }\n\n    callback = callback || function noop () {}\n    const pi = getPeerInfo(peer, swarm._peerBook)\n\n    const proxyConn = new Connection()\n\n    const b58Id = pi.id.toB58String()\n    log('dialing %s', b58Id)\n\n    if (!swarm.muxedConns[b58Id]) {\n      if (!swarm.conns[b58Id]) {\n        attemptDial(pi, (err, conn) => {\n          if (err) {\n            return callback(err)\n          }\n          gotWarmedUpConn(conn)\n        })\n      } else {\n        const conn = swarm.conns[b58Id]\n        swarm.conns[b58Id] = undefined\n        gotWarmedUpConn(conn)\n      }\n    } else {\n      if (!protocol) {\n        return callback()\n      }\n      gotMuxer(swarm.muxedConns[b58Id].muxer)\n    }\n\n    return proxyConn\n\n    function gotWarmedUpConn (conn) {\n      conn.setPeerInfo(pi)\n\n      attemptMuxerUpgrade(conn, (err, muxer) => {\n        if (!protocol) {\n          if (err) {\n            swarm.conns[b58Id] = conn\n          }\n          return callback()\n        }\n\n        if (err) {\n          // couldn't upgrade to Muxer, it is ok\n          protocolHandshake(conn, protocol, callback)\n        } else {\n          gotMuxer(muxer)\n        }\n      })\n    }\n\n    function gotMuxer (muxer) {\n      if (swarm.identify) {\n        // TODO: Consider:\n        // 1. overload getPeerInfo\n        // 2. exec identify (through getPeerInfo)\n        // 3. update the peerInfo that is already stored in the conn\n      }\n\n      openConnInMuxedConn(muxer, (conn) => {\n        protocolHandshake(conn, protocol, callback)\n      })\n    }\n\n    function attemptDial (pi, cb) {\n      if (!swarm.hasTransports()) {\n        return cb(new Error('No transports registered, dial not possible'))\n      }\n\n      const tKeys = swarm.availableTransports(pi)\n\n      let circuitTried = false\n      nextTransport(tKeys.shift())\n\n      function nextTransport (key) {\n        let transport = key\n        if (!transport) {\n          if (circuitTried) {\n            return cb(new Error(`Circuit already tried!`))\n          }\n\n          if (!swarm.transports[Circuit.tag]) {\n            return cb(new Error(`Circuit not enabled!`))\n          }\n\n          log(`Falling back to dialing over circuit`)\n          pi.multiaddrs.add(`/p2p-circuit/ipfs/${pi.id.toB58String()}`)\n          circuitTried = true\n          transport = Circuit.tag\n        }\n\n        log(`dialing transport ${transport}`)\n        swarm.transport.dial(transport, pi, (err, conn) => {\n          if (err) {\n            log(err)\n            return nextTransport(tKeys.shift())\n          }\n\n          cryptoDial()\n\n          function cryptoDial () {\n            const ms = new multistream.Dialer()\n            ms.handle(conn, (err) => {\n              if (err) {\n                return cb(err)\n              }\n\n              const myId = swarm._peerInfo.id\n              log('selecting crypto: %s', swarm.crypto.tag)\n              ms.select(swarm.crypto.tag, (err, conn) => {\n                if (err) { return cb(err) }\n\n                const wrapped = swarm.crypto.encrypt(myId, conn, pi.id, (err) => {\n                  if (err) {\n                    return cb(err)\n                  }\n                  cb(null, wrapped)\n                })\n              })\n            })\n          }\n        })\n      }\n    }\n\n    function attemptMuxerUpgrade (conn, cb) {\n      const muxers = Object.keys(swarm.muxers)\n      if (muxers.length === 0) {\n        return cb(new Error('no muxers available'))\n      }\n\n      // 1. try to handshake in one of the muxers available\n      // 2. if succeeds\n      //  - add the muxedConn to the list of muxedConns\n      //  - add incomming new streams to connHandler\n\n      const ms = new multistream.Dialer()\n      ms.handle(conn, (err) => {\n        if (err) {\n          return cb(new Error('multistream not supported'))\n        }\n\n        nextMuxer(muxers.shift())\n      })\n\n      function nextMuxer (key) {\n        log('selecting %s', key)\n        ms.select(key, (err, conn) => {\n          if (err) {\n            if (muxers.length === 0) {\n              cb(new Error('could not upgrade to stream muxing'))\n            } else {\n              nextMuxer(muxers.shift())\n            }\n            return\n          }\n\n          const muxedConn = swarm.muxers[key].dialer(conn)\n          swarm.muxedConns[b58Id] = {}\n          swarm.muxedConns[b58Id].muxer = muxedConn\n          // should not be needed anymore - swarm.muxedConns[b58Id].conn = conn\n\n          muxedConn.once('close', () => {\n            const b58Str = pi.id.toB58String()\n            delete swarm.muxedConns[b58Str]\n            pi.disconnect()\n            swarm._peerBook.get(b58Str).disconnect()\n            setImmediate(() => swarm.emit('peer-mux-closed', pi))\n          })\n\n          // For incoming streams, in case identify is on\n          muxedConn.on('stream', (conn) => {\n            protocolMuxer(swarm.protocols, conn)\n          })\n\n          setImmediate(() => swarm.emit('peer-mux-established', pi))\n\n          cb(null, muxedConn)\n        })\n      }\n    }\n\n    function openConnInMuxedConn (muxer, cb) {\n      cb(muxer.newStream())\n    }\n\n    function protocolHandshake (conn, protocol, cb) {\n      const ms = new multistream.Dialer()\n      ms.handle(conn, (err) => {\n        if (err) {\n          return cb(err)\n        }\n        ms.select(protocol, (err, conn) => {\n          if (err) {\n            return cb(err)\n          }\n          proxyConn.setInnerConn(conn)\n          cb(null, proxyConn)\n        })\n      })\n    }\n  }\n}\n\nmodule.exports = dial\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/dial.js\n// module id = 1024\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/dial.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst EE = __webpack_require__(15).EventEmitter\nconst each = __webpack_require__(41)\nconst series = __webpack_require__(51)\nconst transport = __webpack_require__(1028)\nconst connection = __webpack_require__(1023)\nconst getPeerInfo = __webpack_require__(450)\nconst dial = __webpack_require__(1024)\nconst protocolMuxer = __webpack_require__(194)\nconst plaintext = __webpack_require__(451)\nconst assert = __webpack_require__(16)\n\nclass Switch extends EE {\n  constructor (peerInfo, peerBook) {\n    super()\n    assert(peerInfo, 'You must provide a `peerInfo`')\n    assert(peerBook, 'You must provide a `peerBook`')\n\n    this._peerInfo = peerInfo\n    this._peerBook = peerBook\n\n    this.setMaxListeners(Infinity)\n    // transports --\n    // { key: transport }; e.g { tcp: <tcp> }\n    this.transports = {}\n\n    // connections --\n    // { peerIdB58: { conn: <conn> }}\n    this.conns = {}\n\n    // {\n    //   peerIdB58: {\n    //     muxer: <muxer>\n    //     conn: <transport socket> // to extract info required for the Identify Protocol\n    //   }\n    // }\n    this.muxedConns = {}\n\n    // { protocol: handler }\n    this.protocols = {}\n\n    // { muxerCodec: <muxer> } e.g { '/spdy/0.3.1': spdy }\n    this.muxers = {}\n\n    // is the Identify protocol enabled?\n    this.identify = false\n\n    // Crypto details\n    this.crypto = plaintext\n\n    this.transport = transport(this)\n    this.connection = connection(this)\n\n    this.hasTransports = () => {\n      const transports = Object.keys(this.transports).filter((t) => t !== 'Circuit')\n      return transports && transports.length > 0\n    }\n\n    this.availableTransports = (pi) => {\n      const myAddrs = pi.multiaddrs.toArray()\n      const myTransports = Object.keys(this.transports)\n\n      // Only listen on transports we actually have addresses for\n      return myTransports.filter((ts) => this.transports[ts].filter(myAddrs).length > 0)\n        // push Circuit to be the last proto to be dialed\n        .sort((a) => {\n          return a === 'Circuit' ? 1 : 0\n        })\n    }\n\n    this.handle(this.crypto.tag, (protocol, conn) => {\n      const peerId = this._peerInfo.id\n      const wrapped = this.crypto.encrypt(peerId, conn, undefined, () => {})\n      return protocolMuxer(this.protocols, wrapped)\n    })\n\n    // higher level (public) API\n    this.dial = dial(this)\n  }\n\n  // Start listening on all available transports\n  start (callback) {\n    each(this.availableTransports(this._peerInfo), (ts, cb) => {\n      // Listen on the given transport\n      this.transport.listen(ts, {}, null, cb)\n    }, callback)\n  }\n\n  stop (callback) {\n    series([\n      (cb) => each(this.muxedConns, (conn, cb) => {\n        conn.muxer.end((err) => {\n          // If OK things are fine, and someone just shut down\n          if (err && err.message !== 'Fatal error: OK') {\n            return cb(err)\n          }\n          cb()\n        })\n      }, cb),\n      (cb) => {\n        each(this.transports, (transport, cb) => {\n          each(transport.listeners, (listener, cb) => {\n            listener.close(cb)\n          }, cb)\n        }, cb)\n      }\n    ], callback)\n  }\n\n  handle (protocol, handlerFunc, matchFunc) {\n    this.protocols[protocol] = {\n      handlerFunc: handlerFunc,\n      matchFunc: matchFunc\n    }\n  }\n\n  unhandle (protocol) {\n    if (this.protocols[protocol]) {\n      delete this.protocols[protocol]\n    }\n  }\n\n  hangUp (peer, callback) {\n    const peerInfo = getPeerInfo(peer, this.peerBook)\n    const key = peerInfo.id.toB58String()\n    if (this.muxedConns[key]) {\n      const muxer = this.muxedConns[key].muxer\n      muxer.once('close', () => {\n        delete this.muxedConns[key]\n        callback()\n      })\n      muxer.end()\n    } else {\n      callback()\n    }\n  }\n}\n\nmodule.exports = Switch\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/index.js\n// module id = 1025\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst map = __webpack_require__(128)\nconst debug = __webpack_require__(5)\nconst once = __webpack_require__(53)\n\nconst log = debug('libp2p:swarm:dialer')\n\nconst DialQueue = __webpack_require__(1027)\n\n/**\n * Track dials per peer and limited them.\n */\nclass LimitDialer {\n  /**\n   * Create a new dialer.\n   *\n   * @param {number} perPeerLimit\n   * @param {number} dialTimeout\n   */\n  constructor (perPeerLimit, dialTimeout) {\n    log('create: %s peer limit, %s dial timeout', perPeerLimit, dialTimeout)\n    this.perPeerLimit = perPeerLimit\n    this.dialTimeout = dialTimeout\n    this.queues = new Map()\n  }\n\n  /**\n   * Dial a list of multiaddrs on the given transport.\n   *\n   * @param {PeerId} peer\n   * @param {SwarmTransport} transport\n   * @param {Array<Multiaddr>} addrs\n   * @param {function(Error, Connection)} callback\n   * @returns {void}\n   */\n  dialMany (peer, transport, addrs, callback) {\n    log('dialMany:start')\n    // we use a token to track if we want to cancel following dials\n    const token = { cancel: false }\n    callback = once(callback) // only call callback once\n\n    map(addrs, (m, cb) => {\n      this.dialSingle(peer, transport, m, token, cb)\n    }, (err, results) => {\n      if (err) {\n        return callback(err)\n      }\n\n      const success = results.filter((res) => res.conn)\n      if (success.length > 0) {\n        log('dialMany:success')\n        return callback(null, success[0])\n      }\n\n      log('dialMany:error')\n      const error = new Error('Failed to dial any provided address')\n      error.errors = results\n        .filter((res) => res.error)\n        .map((res) => res.error)\n      return callback(error)\n    })\n  }\n\n  /**\n   * Dial a single multiaddr on the given transport.\n   *\n   * @param {PeerId} peer\n   * @param {SwarmTransport} transport\n   * @param {Multiaddr} addr\n   * @param {CancelToken} token\n   * @param {function(Error, Connection)} callback\n   * @returns {void}\n   */\n  dialSingle (peer, transport, addr, token, callback) {\n    const ps = peer.toB58String()\n    log('dialSingle: %s:%s', ps, addr.toString())\n    let q\n    if (this.queues.has(ps)) {\n      q = this.queues.get(ps)\n    } else {\n      q = new DialQueue(this.perPeerLimit, this.dialTimeout)\n      this.queues.set(ps, q)\n    }\n\n    q.push(transport, addr, token, callback)\n  }\n}\n\nmodule.exports = LimitDialer\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/limit-dialer/index.js\n// module id = 1026\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/limit-dialer/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Connection = __webpack_require__(39).Connection\nconst pull = __webpack_require__(6)\nconst timeout = __webpack_require__(602)\nconst queue = __webpack_require__(223)\nconst debug = __webpack_require__(5)\n\nconst log = debug('libp2p:swarm:dialer:queue')\n\n/**\n * Queue up the amount of dials to a given peer.\n */\nclass DialQueue {\n  /**\n   * Create a new dial queue.\n   *\n   * @param {number} limit\n   * @param {number} dialTimeout\n   */\n  constructor (limit, dialTimeout) {\n    this.dialTimeout = dialTimeout\n\n    this.queue = queue((task, cb) => {\n      this._doWork(task.transport, task.addr, task.token, cb)\n    }, limit)\n  }\n\n  /**\n   * The actual work done by the queue.\n   *\n   * @param {SwarmTransport} transport\n   * @param {Multiaddr} addr\n   * @param {CancelToken} token\n   * @param {function(Error, Connection)} callback\n   * @returns {void}\n   * @private\n   */\n  _doWork (transport, addr, token, callback) {\n    log('work')\n    this._dialWithTimeout(transport, addr, (err, conn) => {\n      if (err) {\n        log('work:error')\n        return callback(null, {error: err})\n      }\n\n      if (token.cancel) {\n        log('work:cancel')\n        // clean up already done dials\n        pull(pull.empty(), conn)\n        // TODO: proper cleanup once the connection interface supports it\n        // return conn.close(() => callback(new Error('Manual cancel'))\n        return callback(null, {cancel: true})\n      }\n\n      // one is enough\n      token.cancel = true\n\n      log('work:success')\n\n      const proxyConn = new Connection()\n      proxyConn.setInnerConn(conn)\n      callback(null, { multiaddr: addr, conn: conn })\n    })\n  }\n\n  /**\n   * Dial the given transport, timing out with the set timeout.\n   *\n   * @param {SwarmTransport} transport\n   * @param {Multiaddr} addr\n   * @param {function(Error, Connection)} callback\n   * @returns {void}\n   *\n   * @private\n   */\n  _dialWithTimeout (transport, addr, callback) {\n    timeout((cb) => {\n      const conn = transport.dial(addr, (err) => {\n        if (err) {\n          return cb(err)\n        }\n\n        cb(null, conn)\n      })\n    }, this.dialTimeout)(callback)\n  }\n\n  /**\n   * Add new work to the queue.\n   *\n   * @param {SwarmTransport} transport\n   * @param {Multiaddr} addr\n   * @param {CancelToken} token\n   * @param {function(Error, Connection)} callback\n   * @returns {void}\n   */\n  push (transport, addr, token, callback) {\n    this.queue.push({transport, addr, token}, callback)\n  }\n}\n\nmodule.exports = DialQueue\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/limit-dialer/queue.js\n// module id = 1027\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/limit-dialer/queue.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst parallel = __webpack_require__(85)\nconst once = __webpack_require__(53)\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:swarm:transport')\n\nconst protocolMuxer = __webpack_require__(194)\nconst LimitDialer = __webpack_require__(1026)\n\n// number of concurrent outbound dials to make per peer, same as go-libp2p-swarm\nconst defaultPerPeerRateLimit = 8\n\n// the amount of time a single dial has to succeed\n// TODO this should be exposed as a option\nconst dialTimeout = 30 * 1000\n\nmodule.exports = function (swarm) {\n  const dialer = new LimitDialer(defaultPerPeerRateLimit, dialTimeout)\n\n  return {\n    add (key, transport, options) {\n      options = options || {}\n\n      log('adding %s', key)\n      if (swarm.transports[key]) {\n        throw new Error('There is already a transport with this key')\n      }\n\n      swarm.transports[key] = transport\n      if (!swarm.transports[key].listeners) {\n        swarm.transports[key].listeners = []\n      }\n    },\n\n    dial (key, pi, callback) {\n      const t = swarm.transports[key]\n      let multiaddrs = pi.multiaddrs.toArray()\n\n      if (!Array.isArray(multiaddrs)) {\n        multiaddrs = [multiaddrs]\n      }\n      // filter the multiaddrs that are actually valid for this transport (use a func from the transport itself) (maybe even make the transport do that)\n      multiaddrs = dialables(t, multiaddrs)\n      log('dialing %s', key, multiaddrs.map((m) => m.toString()))\n\n      dialer.dialMany(pi.id, t, multiaddrs, (err, success) => {\n        if (err) {\n          return callback(err)\n        }\n\n        pi.connect(success.multiaddr)\n        swarm._peerBook.put(pi)\n        callback(null, success.conn)\n      })\n    },\n\n    listen (key, options, handler, callback) {\n      // if no handler is passed, we pass conns to protocolMuxer\n      if (!handler) {\n        handler = protocolMuxer.bind(null, swarm.protocols)\n      }\n\n      const multiaddrs = dialables(swarm.transports[key], swarm._peerInfo.multiaddrs.distinct())\n\n      const transport = swarm.transports[key]\n\n      if (!transport.listeners) {\n        transport.listeners = []\n      }\n\n      let freshMultiaddrs = []\n\n      const createListeners = multiaddrs.map((ma) => {\n        return (cb) => {\n          const done = once(cb)\n          const listener = transport.createListener(handler)\n          listener.once('error', done)\n\n          listener.listen(ma, (err) => {\n            if (err) {\n              return done(err)\n            }\n            listener.removeListener('error', done)\n            listener.getAddrs((err, addrs) => {\n              if (err) {\n                return done(err)\n              }\n              freshMultiaddrs = freshMultiaddrs.concat(addrs)\n              transport.listeners.push(listener)\n              done()\n            })\n          })\n        }\n      })\n\n      parallel(createListeners, (err) => {\n        if (err) {\n          return callback(err)\n        }\n\n        // cause we can listen on port 0 or 0.0.0.0\n        swarm._peerInfo.multiaddrs.replace(multiaddrs, freshMultiaddrs)\n        callback()\n      })\n    },\n\n    close (key, callback) {\n      const transport = swarm.transports[key]\n\n      if (!transport) {\n        return callback(new Error(`Trying to close non existing transport: ${key}`))\n      }\n\n      parallel(transport.listeners.map((listener) => {\n        return (cb) => {\n          listener.close(cb)\n        }\n      }), callback)\n    }\n  }\n}\n\nfunction dialables (tp, multiaddrs) {\n  return tp.filter(multiaddrs)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-switch/src/transport.js\n// module id = 1028\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-switch/src/transport.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:webrtc-star')\nconst multiaddr = __webpack_require__(21)\nconst mafmt = __webpack_require__(99)\nconst io = __webpack_require__(537)\nconst EE = __webpack_require__(15).EventEmitter\nconst SimplePeer = __webpack_require__(1236)\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst Connection = __webpack_require__(39).Connection\nconst toPull = __webpack_require__(310)\nconst once = __webpack_require__(53)\nconst setImmediate = __webpack_require__(8)\nconst webrtcSupport = __webpack_require__(1300)\nconst utils = __webpack_require__(1030)\nconst cleanUrlSIO = utils.cleanUrlSIO\nconst cleanMultiaddr = utils.cleanMultiaddr\n\nconst noop = once(() => {})\n\nconst sioOptions = {\n  transports: ['websocket'],\n  'force new connection': true\n}\n\nclass WebRTCStar {\n  constructor (options) {\n    options = options || {}\n\n    this.maSelf = undefined\n\n    this.sioOptions = {\n      transports: ['websocket'],\n      'force new connection': true\n    }\n\n    if (options.wrtc) {\n      this.wrtc = options.wrtc\n    }\n\n    this.discovery = new EE()\n    this.discovery.start = (callback) => { setImmediate(callback) }\n    this.discovery.stop = (callback) => { setImmediate(callback) }\n\n    this.listenersRefs = {}\n    this._peerDiscovered = this._peerDiscovered.bind(this)\n  }\n\n  dial (ma, options, callback) {\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    callback = callback ? once(callback) : noop\n\n    const intentId = (~~(Math.random() * 1e9)).toString(36) + Date.now()\n\n    const sioClient = this\n      .listenersRefs[Object.keys(this.listenersRefs)[0]].io\n\n    const spOptions = { initiator: true, trickle: false }\n\n    // Use custom WebRTC implementation\n    if (this.wrtc) { spOptions.wrtc = this.wrtc }\n\n    const channel = new SimplePeer(spOptions)\n\n    const conn = new Connection(toPull.duplex(channel))\n    let connected = false\n\n    channel.on('signal', (signal) => {\n      sioClient.emit('ss-handshake', {\n        intentId: intentId,\n        srcMultiaddr: this.maSelf.toString(),\n        dstMultiaddr: ma.toString(),\n        signal: signal\n      })\n    })\n\n    channel.once('timeout', () => callback(new Error('timeout')))\n\n    channel.once('error', (err) => {\n      if (!connected) { callback(err) }\n    })\n\n    // NOTE: aegir segfaults if we do .once on the socket.io event emitter and we\n    // are clueless as to why.\n    sioClient.on('ws-handshake', (offer) => {\n      if (offer.intentId === intentId && offer.err) {\n        return callback(new Error(offer.err))\n      }\n\n      if (offer.intentId !== intentId || !offer.answer) {\n        return\n      }\n\n      channel.once('connect', () => {\n        connected = true\n        conn.destroy = channel.destroy.bind(channel)\n\n        channel.once('close', () => conn.destroy())\n\n        conn.getObservedAddrs = (callback) => callback(null, [ma])\n\n        callback(null, conn)\n      })\n\n      channel.signal(offer.signal)\n    })\n\n    return conn\n  }\n\n  createListener (options, handler) {\n    if (typeof options === 'function') {\n      handler = options\n      options = {}\n    }\n\n    const listener = new EE()\n\n    listener.listen = (ma, callback) => {\n      callback = callback ? once(callback) : noop\n\n      if (!webrtcSupport.support && !this.wrtc) {\n        return setImmediate(() => callback(new Error('no WebRTC support')))\n      }\n\n      this.maSelf = ma\n\n      const sioUrl = cleanUrlSIO(ma)\n\n      log('Dialing to Signalling Server on: ' + sioUrl)\n\n      listener.io = io.connect(sioUrl, sioOptions)\n\n      listener.io.once('connect_error', callback)\n      listener.io.once('error', (err) => {\n        listener.emit('error', err)\n        listener.emit('close')\n      })\n\n      listener.io.on('ws-handshake', incommingDial)\n      listener.io.on('ws-peer', this._peerDiscovered)\n\n      listener.io.on('connect', () => {\n        listener.io.emit('ss-join', ma.toString())\n      })\n\n      listener.io.once('connect', () => {\n        listener.emit('listening')\n        callback()\n      })\n\n      const self = this\n      function incommingDial (offer) {\n        if (offer.answer || offer.err) {\n          return\n        }\n\n        const spOptions = { trickle: false }\n\n        // Use custom WebRTC implementation\n        if (self.wrtc) { spOptions.wrtc = self.wrtc }\n\n        const channel = new SimplePeer(spOptions)\n\n        const conn = new Connection(toPull.duplex(channel))\n\n        channel.once('connect', () => {\n          conn.getObservedAddrs = (callback) => {\n            return callback(null, [offer.srcMultiaddr])\n          }\n\n          listener.emit('connection', conn)\n          handler(conn)\n        })\n\n        channel.once('signal', (signal) => {\n          offer.signal = signal\n          offer.answer = true\n          listener.io.emit('ss-handshake', offer)\n        })\n\n        channel.signal(offer.signal)\n      }\n    }\n\n    listener.close = (callback) => {\n      callback = callback ? once(callback) : noop\n\n      listener.io.emit('ss-leave')\n\n      setImmediate(() => {\n        listener.emit('close')\n        callback()\n      })\n    }\n\n    listener.getAddrs = (callback) => {\n      setImmediate(() => callback(null, [this.maSelf]))\n    }\n\n    this.listenersRefs[multiaddr.toString()] = listener\n    return listener\n  }\n\n  filter (multiaddrs) {\n    if (!Array.isArray(multiaddrs)) {\n      multiaddrs = [multiaddrs]\n    }\n\n    return multiaddrs.filter((ma) => {\n      if (ma.protoNames().indexOf('p2p-circuit') > -1) {\n        return false\n      }\n\n      return mafmt.WebRTCStar.matches(ma)\n    })\n  }\n\n  _peerDiscovered (maStr) {\n    log('Peer Discovered:', maStr)\n    maStr = cleanMultiaddr(maStr)\n\n    const split = maStr.split('/ipfs/')\n    const peerIdStr = split[split.length - 1]\n    const peerId = PeerId.createFromB58String(peerIdStr)\n    const peerInfo = new PeerInfo(peerId)\n    peerInfo.multiaddrs.add(multiaddr(maStr))\n    this.discovery.emit('peer', peerInfo)\n  }\n}\n\nmodule.exports = WebRTCStar\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-webrtc-star/src/index.js\n// module id = 1029\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-webrtc-star/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst multiaddr = __webpack_require__(21)\n\nfunction cleanUrlSIO (ma) {\n  const maStrSplit = ma.toString().split('/')\n  const tcpProto = ma.protos()[1].name\n  const wsProto = ma.protos()[2].name\n  const tcpPort = ma.stringTuples()[1][1]\n\n  if (tcpProto !== 'tcp' || (wsProto !== 'ws' && wsProto !== 'wss')) {\n    throw new Error('invalid multiaddr: ' + ma.toString())\n  }\n\n  if (!multiaddr.isName(ma)) {\n    return 'http://' + maStrSplit[2] + ':' + maStrSplit[4]\n  }\n\n  if (wsProto === 'ws') {\n    return 'http://' + maStrSplit[2] + (tcpPort === 80 ? '' : ':' + tcpPort)\n  }\n\n  if (wsProto === 'wss') {\n    return 'https://' + maStrSplit[2] + (tcpPort === 443 ? '' : ':' + tcpPort)\n  }\n}\n\nfunction cleanMultiaddr (maStr) {\n  const legacy = '/libp2p-webrtc-star'\n\n  if (maStr.indexOf(legacy) !== -1) {\n    maStr = maStr.substring(legacy.length, maStr.length)\n    let ma = multiaddr(maStr)\n    const tuppleIPFS = ma.stringTuples().filter((tupple) => {\n      return tupple[0] === 421 // ipfs code\n    })[0]\n\n    ma = ma.decapsulate('ipfs')\n    ma = ma.encapsulate('p2p-webrtc-star')\n    ma = ma.encapsulate(`/ipfs/${tuppleIPFS[1]}`)\n    maStr = ma.toString()\n  }\n\n  return maStr\n}\n\nexports = module.exports\nexports.cleanUrlSIO = cleanUrlSIO\nexports.cleanMultiaddr = cleanMultiaddr\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-webrtc-star/src/utils.js\n// module id = 1030\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-webrtc-star/src/utils.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:websocket-star')\nconst multiaddr = __webpack_require__(21)\nconst EE = __webpack_require__(15).EventEmitter\nconst PeerId = __webpack_require__(26)\nconst PeerInfo = __webpack_require__(44)\nconst Connection = __webpack_require__(39).Connection\nconst setImmediate = __webpack_require__(8)\nconst utils = __webpack_require__(452)\nconst Listener = __webpack_require__(1032)\nconst cleanUrlSIO = utils.cleanUrlSIO\nconst mafmt = __webpack_require__(99)\n\nclass WebsocketStar {\n  /**\n    * WebsocketStar Transport\n    * @class\n    * @param {Object} options - Options for the listener\n    * @param {PeerId} options.id - Id for the crypto challenge\n    */\n  constructor (options) {\n    options = options || {}\n\n    this.id = options.id\n    this.flag = options.allowJoinWithDisabledChallenge // let's just refer to it as \"flag\"\n\n    this.discovery = new EE()\n    this.discovery.start = (callback) => {\n      setImmediate(callback)\n    }\n    this.discovery.stop = (callback) => {\n      setImmediate(callback)\n    }\n\n    this.listeners_list = {}\n    this._peerDiscovered = this._peerDiscovered.bind(this)\n  }\n\n  /**\n    * Sets the id after transport creation (aka the lazy way)\n    * @param {PeerId} id\n    * @returns {undefined}\n    */\n  lazySetId (id) {\n    if (!id) return\n    this.id = id\n    this.canCrypto = true\n  }\n\n  /**\n    * Dials a peer\n    * @param {Multiaddr} ma - Multiaddr to dial to\n    * @param {Object} options\n    * @param {function} callback\n    * @returns {Connection}\n    */\n  dial (ma, options, callback) {\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    let url\n    try {\n      url = cleanUrlSIO(ma)\n    } catch (err) {\n      return callback(err) // early\n    }\n    const listener = this.listeners_list[url]\n    if (!listener) {\n      callback(new Error('No listener for this server'))\n      return new Connection()\n    }\n    return listener.dial(ma, options, callback)\n  }\n\n  /**\n    * Creates a listener\n    * @param {Object} options\n    * @param {function} handler\n    * @returns {Listener}\n    */\n  createListener (options, handler) {\n    if (typeof options === 'function') {\n      handler = options\n      options = {}\n    }\n\n    const listener = new Listener({\n      id: this.id,\n      handler,\n      listeners: this.listeners_list,\n      flag: this.flag\n    })\n\n    listener.on('peer', this._peerDiscovered)\n\n    return listener\n  }\n\n  /**\n    * Filters multiaddrs\n    * @param {Multiaddr[]} multiaddrs\n    * @returns {boolean}\n    */\n  filter (multiaddrs) {\n    if (!Array.isArray(multiaddrs)) {\n      multiaddrs = [multiaddrs]\n    }\n\n    return multiaddrs.filter((ma) => mafmt.WebSocketStar.matches(ma))\n  }\n\n  /**\n    * Used to fire peer events on the discovery part\n    * @param {Multiaddr} maStr\n    * @fires Discovery#peer\n    * @returns {undefined}\n    * @private\n    */\n  _peerDiscovered (maStr) {\n    log('Peer Discovered:', maStr)\n    const peerIdStr = maStr.split('/ipfs/').pop()\n    const peerId = PeerId.createFromB58String(peerIdStr)\n    const peerInfo = new PeerInfo(peerId)\n\n    peerInfo.multiaddrs.add(multiaddr(maStr))\n    this.discovery.emit('peer', peerInfo)\n  }\n}\n\nmodule.exports = WebsocketStar\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websocket-star/src/index.js\n// module id = 1031\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websocket-star/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:websocket-star:listener')\nconst multiaddr = __webpack_require__(21)\nconst io = __webpack_require__(537)\nconst sp = __webpack_require__(1240)\nconst uuid = __webpack_require__(548)\nconst series = __webpack_require__(51)\nconst EE = __webpack_require__(15).EventEmitter\nconst Connection = __webpack_require__(39).Connection\nconst once = __webpack_require__(53)\nconst setImmediate = __webpack_require__(8)\nconst utils = __webpack_require__(452)\nconst cleanUrlSIO = utils.cleanUrlSIO\nconst crypto = __webpack_require__(79)\n\nconst noop = once(() => {})\n\nconst sioOptions = {\n  transports: ['websocket'],\n  'force new connection': true\n}\n\n/**\n  * Listener for signalling server\n  * @class\n  * @param {Object} options - Options for the listener\n  * @param {PeerId} options.id - Id for the crypto challenge\n  * @param {function} options.handler - Incomming connection handler\n  */\nclass Listener extends EE {\n  constructor (options) {\n    super()\n    this.id = options.id\n    this.log = log.bind(log, 'listener#offline')\n    this.canCrypto = Boolean(options.id)\n    this._handler = options.handler || noop\n    this.listeners_list = options.listeners || {}\n    this.flag = options.flag\n  }\n\n  // \"private\" functions\n  /**\n    * Connects to the signalling server\n    * @param {function} cb - callback\n    * @returns {undefined}\n    * @private\n    */\n  _up (cb) {\n    cb = cb ? once(cb) : noop\n    if (this.io) {\n      return cb()\n    }\n\n    this.log = log.bind(log, 'listener#' + this.server)\n    this.log('dialing to signalling server')\n    const _io = this.io = io.connect(this.server, sioOptions)\n\n    sp(_io, { codec: 'buffer' })\n    _io.once('error', cb)\n    _io.once('connect_error', cb)\n    _io.once('connect', cb)\n\n    const proto = new utils.Protocol(this.log)\n\n    proto.addRequest('ws-peer', ['multiaddr'], (socket, peer) => this.emit('peer', peer))\n    proto.addRequest('ss-incomming', ['string', 'multiaddr', 'function'], this._incommingDial.bind(this))\n    proto.handleSocket(_io)\n  }\n\n  /**\n    * Disconnects from signalling server\n    * @returns {undefined}\n    * @private\n    */\n  _down () {\n    if (!this.io) {\n      return\n    }\n\n    this.io.disconnect()\n    this.emit('close')\n    delete this.io\n  }\n\n  /**\n    * Performs a cryptoChallenge\n    * @param {function} callback - callback\n    * @returns {undefined}\n    * @private\n    */\n  _cryptoChallenge (callback) {\n    if (!this.io) {\n      return callback(new Error('Not connected'))\n    }\n\n    const pubKeyStr = this.canCrypto ? crypto.keys.marshalPublicKey(this.id.pubKey).toString('hex') : ''\n\n    const maStr = this.ma.toString()\n\n    this.io.emit('ss-join', maStr, pubKeyStr, (err, sig) => {\n      if (err) { return callback(err) }\n\n      if (sig) {\n        if (!this.canCrypto) {\n          this._down()\n          return callback(new Error(\"Can't sign cryptoChallenge: No id provided\"))\n        }\n\n        this.log('performing cryptoChallenge')\n\n        this.id.privKey.sign(Buffer.from(sig), (err, signature) => {\n          if (err) {\n            return callback(err)\n          }\n          this.signature = signature.toString('hex')\n          this._join(callback)\n        })\n      } else {\n        if (!this.flag) {\n          this._down()\n          return callback(new Error('Tried to listen on a server with crypto challenge disabled!\\n    This is prohibited by default and can lead to security issues!\\n    Please set \"allowJoinWithDisabledChallenge\" to true in the constructor options (but only if you know what you are doing)!'))\n        }\n        this.signature = '_'\n        callback()\n      }\n    })\n  }\n\n  /**\n    * Performs a cryptoChallenge when no signature is found\n    * @param {function} cb - callback\n    * @returns {undefined}\n    * @private\n    */\n  _crypto (cb) {\n    cb = cb ? once(cb) : noop\n\n    this.log('joining')\n\n    if (!this.io) {\n      return cb(new Error('Not connected'))\n    }\n\n    if (this.signature) {\n      this._join((err, needNewChallenge) => {\n        if (needNewChallenge) {\n          return this.cryptoChallenge(cb)\n        }\n        cb(err)\n      })\n    } else {\n      this._cryptoChallenge(cb)\n    }\n  }\n\n  /**\n    * Emits ss-join with the multiaddr and signature\n    *\n    * @param {function} cb - callback\n    * @returns {undefined}\n    * @private\n    */\n  _join (cb) {\n    this.io.emit('ss-join', this.ma.toString(), this.signature, cb)\n  }\n\n  /**\n    * Handles incomming dials\n    * @listens ss-incomming\n    * @param {socket.io_client} socket\n    * @param {string} dialId - Unique id for this dial\n    * @param {string} dialFrom - Multiaddr as string\n    * @param {function} cb - callback\n    * @returns {undefined}\n    * @private\n    */\n  _incommingDial (socket, dialId, dialFrom, cb) {\n    this.log('dial#' + dialId + ' incomming from', dialFrom)\n    const ma = multiaddr(dialFrom)\n    const source = this.io.createSource(dialId + '.dialer')\n    const sink = this.io.createSink(dialId + '.listener')\n\n    cb()\n\n    const conn = new Connection(\n      {\n        sink: sink,\n        source: source\n      }, {\n        getObservedAddrs: (cb) => cb(null, [ma])\n      }\n    )\n    this.emit('connection', conn)\n    this._handler(conn)\n  }\n\n  // public functions\n  /**\n    * Listens on a multiaddr\n    * @param {Multiaddr} ma\n    * @param {function} callback\n    * @returns {undefined}\n    */\n  listen (ma, callback) {\n    this.ma = ma\n    this.server = cleanUrlSIO(ma)\n    this.listeners_list[this.server] = this\n    callback = callback ? once(callback) : noop\n\n    series([\n      (cb) => this._up(cb),\n      (cb) => this._crypto(cb)\n    ], (err) => {\n      if (err) {\n        this.log('success', err)\n        if (!(err instanceof Error)) err = new Error(err)\n        log(err)\n        this._down()\n        this.emit('error', err)\n        this.emit('close')\n        return callback(err)\n      } else this.log('success')\n\n      this.io.on('reconnect', () => {\n        // force to get a new signature\n        this.signature = null\n        this._crypto((err) => {\n          if (err) {\n            this.log('reconnect error', err)\n            this.emit('error', err)\n          } else this.log('reconnected')\n        })\n      })\n\n      this.emit('listening')\n      callback()\n    })\n  }\n\n  /**\n    * Gets the addresses the listener listens on\n    * @param {function} callback\n    * @returns {undefined}\n    */\n  getAddrs (callback) {\n    setImmediate(() => callback(null, this.ma ? [this.ma] : []))\n  }\n\n  close (callback) {\n    callback = callback ? once(callback) : noop\n\n    this._down()\n\n    callback()\n  }\n\n  // called from transport\n  /**\n    * Dials a peer\n    * @param {Multiaddr} ma - Multiaddr to dial to\n    * @param {Object} options\n    * @param {function} callback\n    * @returns {undefined}\n    */\n  dial (ma, options, callback) {\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    const _ma = multiaddr(ma)\n\n    const conn = new Connection(null)\n\n    const dialId = uuid()\n    const dlog = this.log.bind(log, 'dial#' + dialId)\n\n    callback = callback ? once(callback) : noop\n\n    let io = this.io\n\n    if (!io) {\n      return callback(new Error('Not listening'))\n    }\n\n    const sink = io.createSink(dialId + '.dialer')\n\n    dlog('dialing', ma.toString())\n\n    // \"multiaddr\", \"multiaddr\", \"string\", \"function\" - dialFrom, dialTo, dialId, cb\n    io.emit('ss-dial', this.ma.toString(), ma.toString(), dialId, err => {\n      if (err) return callback(err instanceof Error ? err : new Error(err))\n      dlog(err ? 'error: ' + err.toString() : 'success')\n      const source = io.createSource(dialId + '.listener')\n      conn.setInnerConn(\n        {\n          sink: sink,\n          source: source\n        }, {\n          getObservedAddrs: (cb) => cb(null, [_ma])\n        }\n      )\n      callback(null, conn)\n    })\n\n    return conn\n  }\n}\n\nmodule.exports = Listener\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websocket-star/src/listener.js\n// module id = 1032\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websocket-star/src/listener.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst connect = __webpack_require__(1197)\nconst mafmt = __webpack_require__(99)\nconst includes = __webpack_require__(456)\nconst Connection = __webpack_require__(39).Connection\n\nconst maToUrl = __webpack_require__(1035)\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:websockets:dialer')\n\nconst createListener = __webpack_require__(1034)\n\nclass WebSockets {\n  dial (ma, options, callback) {\n    if (typeof options === 'function') {\n      callback = options\n      options = {}\n    }\n\n    callback = callback || function () {}\n\n    const url = maToUrl(ma)\n    log('dialing %s', url)\n    const socket = connect(url, {\n      binary: true,\n      onConnect: (err) => {\n        callback(err)\n      }\n    })\n\n    const conn = new Connection(socket)\n    conn.getObservedAddrs = (cb) => cb(null, [ma])\n    conn.close = (cb) => socket.close(cb)\n\n    return conn\n  }\n\n  createListener (options, handler) {\n    if (typeof options === 'function') {\n      handler = options\n      options = {}\n    }\n\n    return createListener(options, handler)\n  }\n\n  filter (multiaddrs) {\n    if (!Array.isArray(multiaddrs)) {\n      multiaddrs = [multiaddrs]\n    }\n\n    return multiaddrs.filter((ma) => {\n      if (includes(ma.protoNames(), 'p2p-circuit')) {\n        return false\n      }\n\n      if (includes(ma.protoNames(), 'ipfs')) {\n        ma = ma.decapsulate('ipfs')\n      }\n\n      return mafmt.WebSockets.matches(ma) ||\n        mafmt.WebSocketsSecure.matches(ma)\n    })\n  }\n}\n\nmodule.exports = WebSockets\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websockets/src/index.js\n// module id = 1033\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websockets/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Connection = __webpack_require__(39).Connection\nconst includes = __webpack_require__(456)\nconst multiaddr = __webpack_require__(21)\nconst os = __webpack_require__(296)\n\nfunction noop () {}\n\nconst createServer = __webpack_require__(1355) || noop\n\nmodule.exports = (options, handler) => {\n  const listener = createServer((socket) => {\n    socket.getObservedAddrs = (callback) => {\n      // TODO research if we can reuse the address in anyway\n      return callback(null, [])\n    }\n\n    handler(new Connection(socket))\n  })\n\n  let listeningMultiaddr\n\n  listener._listen = listener.listen\n  listener.listen = (ma, callback) => {\n    callback = callback || noop\n    listeningMultiaddr = ma\n\n    if (includes(ma.protoNames(), 'ipfs')) {\n      ma = ma.decapsulate('ipfs')\n    }\n\n    listener._listen(ma.toOptions(), callback)\n  }\n\n  listener.getAddrs = (callback) => {\n    const multiaddrs = []\n    const address = listener.address()\n\n    if (!address) {\n      return callback(new Error('Listener is not ready yet'))\n    }\n\n    let ipfsId = listeningMultiaddr.getPeerId()\n\n    // Because TCP will only return the IPv6 version\n    // we need to capture from the passed multiaddr\n    if (listeningMultiaddr.toString().indexOf('ip4') !== -1) {\n      let m = listeningMultiaddr.decapsulate('tcp')\n      m = m.encapsulate('/tcp/' + address.port + '/ws')\n      if (listeningMultiaddr.getPeerId()) {\n        m = m.encapsulate('/ipfs/' + ipfsId)\n      }\n\n      if (m.toString().indexOf('0.0.0.0') !== -1) {\n        const netInterfaces = os.networkInterfaces()\n        Object.keys(netInterfaces).forEach((niKey) => {\n          netInterfaces[niKey].forEach((ni) => {\n            if (ni.family === 'IPv4') {\n              multiaddrs.push(multiaddr(m.toString().replace('0.0.0.0', ni.address)))\n            }\n          })\n        })\n      } else {\n        multiaddrs.push(m)\n      }\n    }\n\n    callback(null, multiaddrs)\n  }\n\n  return listener\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websockets/src/listener.js\n// module id = 1034\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websockets/src/listener.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst debug = __webpack_require__(5)\nconst log = debug('libp2p:websockets:dialer')\n\nfunction maToUrl (ma) {\n  const maStrSplit = ma.toString().split('/')\n\n  let proto\n  try {\n    proto = ma.protoNames().filter((proto) => {\n      return proto === 'ws' || proto === 'wss'\n    })[0]\n  } catch (e) {\n    log(e)\n    throw new Error('Not a valid websocket address', e)\n  }\n\n  let port\n  try {\n    port = ma.stringTuples().filter((tuple) => {\n      if (tuple[0] === ma.protos().filter((proto) => {\n        return proto.name === 'tcp'\n      })[0].code) {\n        return true\n      }\n    })[0][1]\n  } catch (e) {\n    log('No port, skipping')\n  }\n\n  let url = `${proto}://${maStrSplit[2]}${(port && (port !== 80 || port !== 443) ? `:${port}` : '')}`\n\n  return url\n}\n\nmodule.exports = maToUrl\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/libp2p-websockets/src/ma-to-url.js\n// module id = 1035\n// module chunks = 0\n\n//# sourceURL=../node_modules/libp2p-websockets/src/ma-to-url.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar immediate = __webpack_require__(1037);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n  if (typeof resolver !== 'function') {\n    throw new TypeError('resolver must be a function');\n  }\n  this.state = PENDING;\n  this.queue = [];\n  this.outcome = void 0;\n  if (resolver !== INTERNAL) {\n    safelyResolveThenable(this, resolver);\n  }\n}\n\nPromise.prototype[\"finally\"] = function (callback) {\n  if (typeof callback !== 'function') {\n    return this;\n  }\n  var p = this.constructor;\n  return this.then(resolve, reject);\n\n  function resolve(value) {\n    function yes () {\n      return value;\n    }\n    return p.resolve(callback()).then(yes);\n  }\n  function reject(reason) {\n    function no () {\n      throw reason;\n    }\n    return p.resolve(callback()).then(no);\n  }\n};\nPromise.prototype[\"catch\"] = function (onRejected) {\n  return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n  if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n    typeof onRejected !== 'function' && this.state === REJECTED) {\n    return this;\n  }\n  var promise = new this.constructor(INTERNAL);\n  if (this.state !== PENDING) {\n    var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n    unwrap(promise, resolver, this.outcome);\n  } else {\n    this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n  }\n\n  return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n  this.promise = promise;\n  if (typeof onFulfilled === 'function') {\n    this.onFulfilled = onFulfilled;\n    this.callFulfilled = this.otherCallFulfilled;\n  }\n  if (typeof onRejected === 'function') {\n    this.onRejected = onRejected;\n    this.callRejected = this.otherCallRejected;\n  }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n  handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n  unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n  handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n  unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n  immediate(function () {\n    var returnValue;\n    try {\n      returnValue = func(value);\n    } catch (e) {\n      return handlers.reject(promise, e);\n    }\n    if (returnValue === promise) {\n      handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n    } else {\n      handlers.resolve(promise, returnValue);\n    }\n  });\n}\n\nhandlers.resolve = function (self, value) {\n  var result = tryCatch(getThen, value);\n  if (result.status === 'error') {\n    return handlers.reject(self, result.value);\n  }\n  var thenable = result.value;\n\n  if (thenable) {\n    safelyResolveThenable(self, thenable);\n  } else {\n    self.state = FULFILLED;\n    self.outcome = value;\n    var i = -1;\n    var len = self.queue.length;\n    while (++i < len) {\n      self.queue[i].callFulfilled(value);\n    }\n  }\n  return self;\n};\nhandlers.reject = function (self, error) {\n  self.state = REJECTED;\n  self.outcome = error;\n  var i = -1;\n  var len = self.queue.length;\n  while (++i < len) {\n    self.queue[i].callRejected(error);\n  }\n  return self;\n};\n\nfunction getThen(obj) {\n  // Make sure we only access the accessor once as required by the spec\n  var then = obj && obj.then;\n  if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n    return function appyThen() {\n      then.apply(obj, arguments);\n    };\n  }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n  // Either fulfill, reject or reject with error\n  var called = false;\n  function onError(value) {\n    if (called) {\n      return;\n    }\n    called = true;\n    handlers.reject(self, value);\n  }\n\n  function onSuccess(value) {\n    if (called) {\n      return;\n    }\n    called = true;\n    handlers.resolve(self, value);\n  }\n\n  function tryToUnwrap() {\n    thenable(onSuccess, onError);\n  }\n\n  var result = tryCatch(tryToUnwrap);\n  if (result.status === 'error') {\n    onError(result.value);\n  }\n}\n\nfunction tryCatch(func, value) {\n  var out = {};\n  try {\n    out.value = func(value);\n    out.status = 'success';\n  } catch (e) {\n    out.status = 'error';\n    out.value = e;\n  }\n  return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n  if (value instanceof this) {\n    return value;\n  }\n  return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n  var promise = new this(INTERNAL);\n  return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n  var self = this;\n  if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n    return this.reject(new TypeError('must be an array'));\n  }\n\n  var len = iterable.length;\n  var called = false;\n  if (!len) {\n    return this.resolve([]);\n  }\n\n  var values = new Array(len);\n  var resolved = 0;\n  var i = -1;\n  var promise = new this(INTERNAL);\n\n  while (++i < len) {\n    allResolver(iterable[i], i);\n  }\n  return promise;\n  function allResolver(value, i) {\n    self.resolve(value).then(resolveFromAll, function (error) {\n      if (!called) {\n        called = true;\n        handlers.reject(promise, error);\n      }\n    });\n    function resolveFromAll(outValue) {\n      values[i] = outValue;\n      if (++resolved === len && !called) {\n        called = true;\n        handlers.resolve(promise, values);\n      }\n    }\n  }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n  var self = this;\n  if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n    return this.reject(new TypeError('must be an array'));\n  }\n\n  var len = iterable.length;\n  var called = false;\n  if (!len) {\n    return this.resolve([]);\n  }\n\n  var i = -1;\n  var promise = new this(INTERNAL);\n\n  while (++i < len) {\n    resolver(iterable[i]);\n  }\n  return promise;\n  function resolver(value) {\n    self.resolve(value).then(function (response) {\n      if (!called) {\n        called = true;\n        handlers.resolve(promise, response);\n      }\n    }, function (error) {\n      if (!called) {\n        called = true;\n        handlers.reject(promise, error);\n      }\n    });\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lie/lib/browser.js\n// module id = 1036\n// module chunks = 0\n\n//# sourceURL=../node_modules/lie/lib/browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global) {\nvar Mutation = global.MutationObserver || global.WebKitMutationObserver;\n\nvar scheduleDrain;\n\n{\n  if (Mutation) {\n    var called = 0;\n    var observer = new Mutation(nextTick);\n    var element = global.document.createTextNode('');\n    observer.observe(element, {\n      characterData: true\n    });\n    scheduleDrain = function () {\n      element.data = (called = ++called % 2);\n    };\n  } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {\n    var channel = new global.MessageChannel();\n    channel.port1.onmessage = nextTick;\n    scheduleDrain = function () {\n      channel.port2.postMessage(0);\n    };\n  } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {\n    scheduleDrain = function () {\n\n      // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\n      // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n      var scriptEl = global.document.createElement('script');\n      scriptEl.onreadystatechange = function () {\n        nextTick();\n\n        scriptEl.onreadystatechange = null;\n        scriptEl.parentNode.removeChild(scriptEl);\n        scriptEl = null;\n      };\n      global.document.documentElement.appendChild(scriptEl);\n    };\n  } else {\n    scheduleDrain = function () {\n      setTimeout(nextTick, 0);\n    };\n  }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n  draining = true;\n  var i, oldQueue;\n  var len = queue.length;\n  while (len) {\n    oldQueue = queue;\n    queue = [];\n    i = -1;\n    while (++i < len) {\n      oldQueue[i]();\n    }\n    len = queue.length;\n  }\n  draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n  if (queue.push(task) === 1 && !draining) {\n    scheduleDrain();\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lie/~/immediate/lib/browser.js\n// module id = 1037\n// module chunks = 0\n\n//# sourceURL=../node_modules/lie/node_modules/immediate/lib/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result[resIndex++] = value;\n    }\n  }\n  return result;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n  var result = [];\n  baseEach(collection, function(value, index, collection) {\n    if (predicate(value, index, collection)) {\n      result.push(value);\n    }\n  });\n  return result;\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    if (collection == null) {\n      return collection;\n    }\n    if (!isArrayLike(collection)) {\n      return eachFunc(collection, iteratee);\n    }\n    var length = collection.length,\n        index = fromRight ? length : -1,\n        iterable = Object(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity]\n *  The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n *   { 'user': 'barney', 'age': 36, 'active': true },\n *   { 'user': 'fred',   'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\nfunction filter(collection, predicate) {\n  var func = isArray(collection) ? arrayFilter : baseFilter;\n  return func(collection, baseIteratee(predicate, 3));\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = filter;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.filter/index.js\n// module id = 1038\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.filter/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991,\n    MAX_INTEGER = 1.7976931348623157e+308,\n    NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n    nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\nfunction createFind(findIndexFunc) {\n  return function(collection, predicate, fromIndex) {\n    var iterable = Object(collection);\n    if (!isArrayLike(collection)) {\n      var iteratee = baseIteratee(predicate, 3);\n      collection = keys(collection);\n      predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n    }\n    var index = findIndexFunc(collection, predicate, fromIndex);\n    return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n  };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity]\n *  The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'active': false },\n *   { 'user': 'fred',    'active': false },\n *   { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n  var length = array ? array.length : 0;\n  if (!length) {\n    return -1;\n  }\n  var index = fromIndex == null ? 0 : toInteger(fromIndex);\n  if (index < 0) {\n    index = nativeMax(length + index, 0);\n  }\n  return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\n/**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity]\n *  The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n *   { 'user': 'barney',  'age': 36, 'active': true },\n *   { 'user': 'fred',    'age': 40, 'active': false },\n *   { 'user': 'pebbles', 'age': 1,  'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\nvar find = createFind(findIndex);\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\nfunction toFinite(value) {\n  if (!value) {\n    return value === 0 ? value : 0;\n  }\n  value = toNumber(value);\n  if (value === INFINITY || value === -INFINITY) {\n    var sign = (value < 0 ? -1 : 1);\n    return sign * MAX_INTEGER;\n  }\n  return value === value ? value : 0;\n}\n\n/**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\nfunction toInteger(value) {\n  var result = toFinite(value),\n      remainder = result % 1;\n\n  return result === result ? (remainder ? result - remainder : result) : 0;\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = find;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.find/index.js\n// module id = 1039\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.find/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    var value = array[index];\n    setter(accumulator, value, iteratee(value), array);\n  }\n  return accumulator;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n  baseEach(collection, function(value, key, collection) {\n    setter(accumulator, value, iteratee(value), collection);\n  });\n  return accumulator;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n  return function(collection, iteratee) {\n    var func = isArray(collection) ? arrayAggregator : baseAggregator,\n        accumulator = initializer ? initializer() : {};\n\n    return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n  };\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    if (collection == null) {\n      return collection;\n    }\n    if (!isArrayLike(collection)) {\n      return eachFunc(collection, iteratee);\n    }\n    var length = collection.length,\n        index = fromRight ? length : -1,\n        iterable = Object(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity]\n *  The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n  if (hasOwnProperty.call(result, key)) {\n    result[key].push(value);\n  } else {\n    result[key] = [value];\n  }\n});\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = groupBy;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.groupby/index.js\n// module id = 1040\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.groupby/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n  return object != null && hasOwnProperty.call(object, key);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n  return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.has/index.js\n// module id = 1041\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.has/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n *   return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n *   if (isGreeting(objValue) && isGreeting(othValue)) {\n *     return true;\n *   }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\nfunction isEqualWith(value, other, customizer) {\n  customizer = typeof customizer == 'function' ? customizer : undefined;\n  var result = customizer ? customizer(value, other) : undefined;\n  return result === undefined ? baseIsEqual(value, other, customizer) : !!result;\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = isEqualWith;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.isequalwith/index.js\n// module id = 1042\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.isequalwith/index.js")},function(module,exports){eval("/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  if (value !== value) {\n    return baseFindIndex(array, baseIsNaN, fromIndex);\n  }\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to search.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOfWith(array, value, fromIndex, comparator) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (comparator(array[index], value)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAll(array, values, iteratee, comparator) {\n  var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n      index = -1,\n      length = values.length,\n      seen = array;\n\n  if (array === values) {\n    values = copyArray(values);\n  }\n  if (iteratee) {\n    seen = arrayMap(array, baseUnary(iteratee));\n  }\n  while (++index < length) {\n    var fromIndex = 0,\n        value = values[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n      if (seen !== array) {\n        splice.call(seen, fromIndex, 1);\n      }\n      splice.call(array, fromIndex, 1);\n    }\n  }\n  return array;\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\n/**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\nfunction pullAllWith(array, values, comparator) {\n  return (array && array.length && values && values.length)\n    ? basePullAll(array, values, undefined, comparator)\n    : array;\n}\n\nmodule.exports = pullAllWith;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.pullallwith/index.js\n// module id = 1043\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.pullallwith/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n  switch (args.length) {\n    case 0: return func.call(thisArg);\n    case 1: return func.call(thisArg, args[0]);\n    case 2: return func.call(thisArg, args[0], args[1]);\n    case 3: return func.call(thisArg, args[0], args[1], args[2]);\n  }\n  return func.apply(thisArg, args);\n}\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice,\n    spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths of elements to pick.\n * @returns {Array} Returns the picked elements.\n */\nfunction baseAt(object, paths) {\n  var index = -1,\n      isNil = object == null,\n      length = paths.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = isNil ? undefined : get(object, paths[index]);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n  var index = -1,\n      length = array.length;\n\n  predicate || (predicate = isFlattenable);\n  result || (result = []);\n\n  while (++index < length) {\n    var value = array[index];\n    if (depth > 0 && predicate(value)) {\n      if (depth > 1) {\n        // Recursively flatten arrays (susceptible to call stack limits).\n        baseFlatten(value, depth - 1, predicate, isStrict, result);\n      } else {\n        arrayPush(result, value);\n      }\n    } else if (!isStrict) {\n      result[result.length] = value;\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\nfunction basePullAt(array, indexes) {\n  var length = array ? indexes.length : 0,\n      lastIndex = length - 1;\n\n  while (length--) {\n    var index = indexes[length];\n    if (length == lastIndex || index !== previous) {\n      var previous = index;\n      if (isIndex(index)) {\n        splice.call(array, index, 1);\n      }\n      else if (!isKey(index, array)) {\n        var path = castPath(index),\n            object = parent(array, path);\n\n        if (object != null) {\n          delete object[toKey(last(path))];\n        }\n      }\n      else {\n        delete array[toKey(index)];\n      }\n    }\n  }\n  return array;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n  return function() {\n    var args = arguments,\n        index = -1,\n        length = nativeMax(args.length - start, 0),\n        array = Array(length);\n\n    while (++index < length) {\n      array[index] = args[start + index];\n    }\n    index = -1;\n    var otherArgs = Array(start + 1);\n    while (++index < start) {\n      otherArgs[index] = args[index];\n    }\n    otherArgs[start] = array;\n    return apply(func, this, otherArgs);\n  };\n}\n\n/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n  var index = -1,\n      length = array.length;\n\n  if (start < 0) {\n    start = -start > length ? 0 : (length + start);\n  }\n  end = end > length ? length : end;\n  if (end < 0) {\n    end += length;\n  }\n  length = start > end ? 0 : ((end - start) >>> 0);\n  start >>>= 0;\n\n  var result = Array(length);\n  while (++index < length) {\n    result[index] = array[index + start];\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n  if (value !== other) {\n    var valIsDefined = value !== undefined,\n        valIsNull = value === null,\n        valIsReflexive = value === value,\n        valIsSymbol = isSymbol(value);\n\n    var othIsDefined = other !== undefined,\n        othIsNull = other === null,\n        othIsReflexive = other === other,\n        othIsSymbol = isSymbol(other);\n\n    if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n        (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n        (valIsNull && othIsDefined && othIsReflexive) ||\n        (!valIsDefined && othIsReflexive) ||\n        !valIsReflexive) {\n      return 1;\n    }\n    if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n        (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n        (othIsNull && valIsDefined && valIsReflexive) ||\n        (!othIsDefined && valIsReflexive) ||\n        !othIsReflexive) {\n      return -1;\n    }\n  }\n  return 0;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n  return isArray(value) || isArguments(value) ||\n    !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n  return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n  var length = array ? array.length : 0;\n  return length ? array[length - 1] : undefined;\n}\n\n/**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\nvar pullAt = baseRest(function(array, indexes) {\n  indexes = baseFlatten(indexes, 1);\n\n  var length = array ? array.length : 0,\n      result = baseAt(array, indexes);\n\n  basePullAt(array, arrayMap(indexes, function(index) {\n    return isIndex(index, length) ? +index : index;\n  }).sort(compareAscending));\n\n  return result;\n});\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = pullAt;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.pullat/index.js\n// module id = 1044\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.pullat/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    symbolTag = '[object Symbol]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    object[key] = value;\n  }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n  if (!isObject(object)) {\n    return object;\n  }\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = -1,\n      length = path.length,\n      lastIndex = length - 1,\n      nested = object;\n\n  while (nested != null && ++index < length) {\n    var key = toKey(path[index]),\n        newValue = value;\n\n    if (index != lastIndex) {\n      var objValue = nested[key];\n      newValue = customizer ? customizer(objValue, key, nested) : undefined;\n      if (newValue === undefined) {\n        newValue = isObject(objValue)\n          ? objValue\n          : (isIndex(path[index + 1]) ? [] : {});\n      }\n    }\n    assignValue(nested, key, newValue);\n    nested = nested[key];\n  }\n  return object;\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n  return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.set/index.js\n// module id = 1045\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.set/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n  switch (args.length) {\n    case 0: return func.call(thisArg);\n    case 1: return func.call(thisArg, args[0]);\n    case 2: return func.call(thisArg, args[0], args[1]);\n    case 3: return func.call(thisArg, args[0], args[1], args[2]);\n  }\n  return func.apply(thisArg, args);\n}\n\n/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array ? array.length : 0,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\n/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n  var length = array.length;\n\n  array.sort(comparer);\n  while (length--) {\n    array[length] = array[length].value;\n  }\n  return array;\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice,\n    spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n    nativeMax = Math.max;\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n  var index = -1,\n      length = array.length;\n\n  predicate || (predicate = isFlattenable);\n  result || (result = []);\n\n  while (++index < length) {\n    var value = array[index];\n    if (depth > 0 && predicate(value)) {\n      if (depth > 1) {\n        // Recursively flatten arrays (susceptible to call stack limits).\n        baseFlatten(value, depth - 1, predicate, isStrict, result);\n      } else {\n        arrayPush(result, value);\n      }\n    } else if (!isStrict) {\n      result[result.length] = value;\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n  return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n  var index = -1,\n      result = isArrayLike(collection) ? Array(collection.length) : [];\n\n  baseEach(collection, function(value, key, collection) {\n    result[++index] = iteratee(value, key, collection);\n  });\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n  var index = -1;\n  iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));\n\n  var result = baseMap(collection, function(value, key, collection) {\n    var criteria = arrayMap(iteratees, function(iteratee) {\n      return iteratee(value);\n    });\n    return { 'criteria': criteria, 'index': ++index, 'value': value };\n  });\n\n  return baseSortBy(result, function(object, other) {\n    return compareMultiple(object, other, orders);\n  });\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n  return function() {\n    var args = arguments,\n        index = -1,\n        length = nativeMax(args.length - start, 0),\n        array = Array(length);\n\n    while (++index < length) {\n      array[index] = args[start + index];\n    }\n    index = -1;\n    var otherArgs = Array(start + 1);\n    while (++index < start) {\n      otherArgs[index] = args[index];\n    }\n    otherArgs[start] = array;\n    return apply(func, this, otherArgs);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n  if (value !== other) {\n    var valIsDefined = value !== undefined,\n        valIsNull = value === null,\n        valIsReflexive = value === value,\n        valIsSymbol = isSymbol(value);\n\n    var othIsDefined = other !== undefined,\n        othIsNull = other === null,\n        othIsReflexive = other === other,\n        othIsSymbol = isSymbol(other);\n\n    if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n        (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n        (valIsNull && othIsDefined && othIsReflexive) ||\n        (!valIsDefined && othIsReflexive) ||\n        !valIsReflexive) {\n      return 1;\n    }\n    if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n        (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n        (othIsNull && valIsDefined && valIsReflexive) ||\n        (!othIsDefined && valIsReflexive) ||\n        !othIsReflexive) {\n      return -1;\n    }\n  }\n  return 0;\n}\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n  var index = -1,\n      objCriteria = object.criteria,\n      othCriteria = other.criteria,\n      length = objCriteria.length,\n      ordersLength = orders.length;\n\n  while (++index < length) {\n    var result = compareAscending(objCriteria[index], othCriteria[index]);\n    if (result) {\n      if (index >= ordersLength) {\n        return result;\n      }\n      var order = orders[index];\n      return result * (order == 'desc' ? -1 : 1);\n    }\n  }\n  // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n  // that causes it, under certain circumstances, to provide the same value for\n  // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n  // for more details.\n  //\n  // This also ensures a stable sort in V8 and other engines.\n  // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n  return object.index - other.index;\n}\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n  return function(collection, iteratee) {\n    if (collection == null) {\n      return collection;\n    }\n    if (!isArrayLike(collection)) {\n      return eachFunc(collection, iteratee);\n    }\n    var length = collection.length,\n        index = fromRight ? length : -1,\n        iterable = Object(collection);\n\n    while ((fromRight ? index-- : ++index < length)) {\n      if (iteratee(iterable[index], index, iterable) === false) {\n        break;\n      }\n    }\n    return collection;\n  };\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n  return function(object, iteratee, keysFunc) {\n    var index = -1,\n        iterable = Object(object),\n        props = keysFunc(object),\n        length = props.length;\n\n    while (length--) {\n      var key = props[fromRight ? length : ++index];\n      if (iteratee(iterable[key], key, iterable) === false) {\n        break;\n      }\n    }\n    return object;\n  };\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n  return isArray(value) || isArguments(value) ||\n    !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n *  else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n  if (!isObject(object)) {\n    return false;\n  }\n  var type = typeof index;\n  if (type == 'number'\n        ? (isArrayLike(object) && isIndex(index, object.length))\n        : (type == 'string' && index in object)\n      ) {\n    return eq(object[index], value);\n  }\n  return false;\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n *  The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n *   { 'user': 'fred',   'age': 48 },\n *   { 'user': 'barney', 'age': 36 },\n *   { 'user': 'fred',   'age': 40 },\n *   { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, function(o) { return o.user; });\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n *\n * _.sortBy(users, 'user', function(o) {\n *   return Math.floor(o.age / 10);\n * });\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\nvar sortBy = baseRest(function(collection, iteratees) {\n  if (collection == null) {\n    return [];\n  }\n  var length = iteratees.length;\n  if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n    iteratees = [];\n  } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n    iteratees = [iteratees[0]];\n  }\n  return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n});\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = sortBy;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.sortby/index.js\n// module id = 1046\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.sortby/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n    nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n *   console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n  return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n *  Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n *  The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n *   'leading': true,\n *   'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n  var lastArgs,\n      lastThis,\n      maxWait,\n      result,\n      timerId,\n      lastCallTime,\n      lastInvokeTime = 0,\n      leading = false,\n      maxing = false,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  wait = toNumber(wait) || 0;\n  if (isObject(options)) {\n    leading = !!options.leading;\n    maxing = 'maxWait' in options;\n    maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n\n  function invokeFunc(time) {\n    var args = lastArgs,\n        thisArg = lastThis;\n\n    lastArgs = lastThis = undefined;\n    lastInvokeTime = time;\n    result = func.apply(thisArg, args);\n    return result;\n  }\n\n  function leadingEdge(time) {\n    // Reset any `maxWait` timer.\n    lastInvokeTime = time;\n    // Start the timer for the trailing edge.\n    timerId = setTimeout(timerExpired, wait);\n    // Invoke the leading edge.\n    return leading ? invokeFunc(time) : result;\n  }\n\n  function remainingWait(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime,\n        result = wait - timeSinceLastCall;\n\n    return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n  }\n\n  function shouldInvoke(time) {\n    var timeSinceLastCall = time - lastCallTime,\n        timeSinceLastInvoke = time - lastInvokeTime;\n\n    // Either this is the first call, activity has stopped and we're at the\n    // trailing edge, the system time has gone backwards and we're treating\n    // it as the trailing edge, or we've hit the `maxWait` limit.\n    return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n      (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n  }\n\n  function timerExpired() {\n    var time = now();\n    if (shouldInvoke(time)) {\n      return trailingEdge(time);\n    }\n    // Restart the timer.\n    timerId = setTimeout(timerExpired, remainingWait(time));\n  }\n\n  function trailingEdge(time) {\n    timerId = undefined;\n\n    // Only invoke if we have `lastArgs` which means `func` has been\n    // debounced at least once.\n    if (trailing && lastArgs) {\n      return invokeFunc(time);\n    }\n    lastArgs = lastThis = undefined;\n    return result;\n  }\n\n  function cancel() {\n    if (timerId !== undefined) {\n      clearTimeout(timerId);\n    }\n    lastInvokeTime = 0;\n    lastArgs = lastCallTime = lastThis = timerId = undefined;\n  }\n\n  function flush() {\n    return timerId === undefined ? result : trailingEdge(now());\n  }\n\n  function debounced() {\n    var time = now(),\n        isInvoking = shouldInvoke(time);\n\n    lastArgs = arguments;\n    lastThis = this;\n    lastCallTime = time;\n\n    if (isInvoking) {\n      if (timerId === undefined) {\n        return leadingEdge(lastCallTime);\n      }\n      if (maxing) {\n        // Handle invocations in a tight loop.\n        timerId = setTimeout(timerExpired, wait);\n        return invokeFunc(lastCallTime);\n      }\n    }\n    if (timerId === undefined) {\n      timerId = setTimeout(timerExpired, wait);\n    }\n    return result;\n  }\n  debounced.cancel = cancel;\n  debounced.flush = flush;\n  return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n *  Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n *  Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n  var leading = true,\n      trailing = true;\n\n  if (typeof func != 'function') {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  if (isObject(options)) {\n    leading = 'leading' in options ? !!options.leading : leading;\n    trailing = 'trailing' in options ? !!options.trailing : trailing;\n  }\n  return debounce(func, wait, {\n    'leading': leading,\n    'maxWait': wait,\n    'trailing': trailing\n  });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n  if (typeof value == 'number') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return NAN;\n  }\n  if (isObject(value)) {\n    var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n    value = isObject(other) ? (other + '') : other;\n  }\n  if (typeof value != 'string') {\n    return value === 0 ? value : +value;\n  }\n  value = value.replace(reTrim, '');\n  var isBinary = reIsBinary.test(value);\n  return (isBinary || reIsOctal.test(value))\n    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n    : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.throttle/index.js\n// module id = 1047\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.throttle/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, module) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to compose bitmasks for comparison styles. */\nvar UNORDERED_COMPARE_FLAG = 1,\n    PARTIAL_COMPARE_FLAG = 2;\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0,\n    MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n    reIsPlainProp = /^\\w*$/,\n    reLeadingDot = /^\\./,\n    rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n  var length = array ? array.length : 0;\n  return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (comparator(value, array[index])) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  if (value !== value) {\n    return baseFindIndex(array, baseIsNaN, fromIndex);\n  }\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\n/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\n/**\n * Checks if a cache value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n  return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Symbol = root.Symbol,\n    Uint8Array = root.Uint8Array,\n    propertyIsEnumerable = objectProto.propertyIsEnumerable,\n    splice = arrayProto.splice;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView'),\n    Map = getNative(root, 'Map'),\n    Promise = getNative(root, 'Promise'),\n    Set = getNative(root, 'Set'),\n    WeakMap = getNative(root, 'WeakMap'),\n    nativeCreate = getNative(Object, 'create');\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n    symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  this.__data__ = new ListCache(entries);\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  return this.__data__['delete'](key);\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var cache = this.__data__;\n  if (cache instanceof ListCache) {\n    var pairs = cache.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      return this;\n    }\n    cache = this.__data__ = new MapCache(pairs);\n  }\n  cache.set(key, value);\n  return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  // Safari 9 makes `arguments.length` enumerable in strict mode.\n  var result = (isArray(value) || isArguments(value))\n    ? baseTimes(value.length, String)\n    : [];\n\n  var length = result.length,\n      skipIndexes = !!length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var index = 0,\n      length = path.length;\n\n  while (object != null && index < length) {\n    object = object[toKey(path[index++])];\n  }\n  return (index && index == length) ? object : undefined;\n}\n\n/**\n * The base implementation of `getTag`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  return objectToString.call(value);\n}\n\n/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n  return object != null && key in Object(object);\n}\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {boolean} [bitmask] The bitmask of comparison flags.\n *  The bitmask may be composed of the following flags:\n *     1 - Unordered comparison\n *     2 - Partial comparison\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, customizer, bitmask, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack);\n}\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = arrayTag,\n      othTag = arrayTag;\n\n  if (!objIsArr) {\n    objTag = getTag(object);\n    objTag = objTag == argsTag ? objectTag : objTag;\n  }\n  if (!othIsArr) {\n    othTag = getTag(other);\n    othTag = othTag == argsTag ? objectTag : othTag;\n  }\n  var objIsObj = objTag == objectTag && !isHostObject(object),\n      othIsObj = othTag == objectTag && !isHostObject(other),\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, equalFunc, customizer, bitmask, stack)\n      : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack);\n  }\n  if (!(bitmask & PARTIAL_COMPARE_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, equalFunc, customizer, bitmask, stack);\n}\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n  var index = matchData.length,\n      length = index,\n      noCustomizer = !customizer;\n\n  if (object == null) {\n    return !length;\n  }\n  object = Object(object);\n  while (index--) {\n    var data = matchData[index];\n    if ((noCustomizer && data[2])\n          ? data[1] !== object[data[0]]\n          : !(data[0] in object)\n        ) {\n      return false;\n    }\n  }\n  while (++index < length) {\n    data = matchData[index];\n    var key = data[0],\n        objValue = object[key],\n        srcValue = data[1];\n\n    if (noCustomizer && data[2]) {\n      if (objValue === undefined && !(key in object)) {\n        return false;\n      }\n    } else {\n      var stack = new Stack;\n      if (customizer) {\n        var result = customizer(objValue, srcValue, key, object, source, stack);\n      }\n      if (!(result === undefined\n            ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)\n            : result\n          )) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n  // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n  // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n  if (typeof value == 'function') {\n    return value;\n  }\n  if (value == null) {\n    return identity;\n  }\n  if (typeof value == 'object') {\n    return isArray(value)\n      ? baseMatchesProperty(value[0], value[1])\n      : baseMatches(value);\n  }\n  return property(value);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n  var matchData = getMatchData(source);\n  if (matchData.length == 1 && matchData[0][2]) {\n    return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n  }\n  return function(object) {\n    return object === source || baseIsMatch(object, source, matchData);\n  };\n}\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n  if (isKey(path) && isStrictComparable(srcValue)) {\n    return matchesStrictComparable(toKey(path), srcValue);\n  }\n  return function(object) {\n    var objValue = get(object, path);\n    return (objValue === undefined && objValue === srcValue)\n      ? hasIn(object, path)\n      : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG);\n  };\n}\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n  return function(object) {\n    return baseGet(object, path);\n  };\n}\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n  // Exit early for strings to avoid a performance hit in some environments.\n  if (typeof value == 'string') {\n    return value;\n  }\n  if (isSymbol(value)) {\n    return symbolToString ? symbolToString.call(value) : '';\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n  var index = -1,\n      includes = arrayIncludes,\n      length = array.length,\n      isCommon = true,\n      result = [],\n      seen = result;\n\n  if (comparator) {\n    isCommon = false;\n    includes = arrayIncludesWith;\n  }\n  else if (length >= LARGE_ARRAY_SIZE) {\n    var set = iteratee ? null : createSet(array);\n    if (set) {\n      return setToArray(set);\n    }\n    isCommon = false;\n    includes = cacheHas;\n    seen = new SetCache;\n  }\n  else {\n    seen = iteratee ? [] : result;\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    value = (comparator || value !== 0) ? value : 0;\n    if (isCommon && computed === computed) {\n      var seenIndex = seen.length;\n      while (seenIndex--) {\n        if (seen[seenIndex] === computed) {\n          continue outer;\n        }\n      }\n      if (iteratee) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n    else if (!includes(seen, computed, comparator)) {\n      if (seen !== result) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n  }\n  return result;\n}\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value) {\n  return isArray(value) ? value : stringToPath(value);\n}\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n  return new Set(values);\n};\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(array);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!seen.has(othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) {\n              return seen.add(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, customizer, bitmask, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & PARTIAL_COMPARE_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= UNORDERED_COMPARE_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Function} customizer The function to customize comparisons.\n * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual`\n *  for more details.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, equalFunc, customizer, bitmask, stack) {\n  var isPartial = bitmask & PARTIAL_COMPARE_FLAG,\n      objProps = keys(object),\n      objLength = objProps.length,\n      othProps = keys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Assume cyclic values are equal.\n  var stacked = stack.get(object);\n  if (stacked && stack.get(other)) {\n    return stacked == other;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n  var result = keys(object),\n      length = result.length;\n\n  while (length--) {\n    var key = result[length],\n        value = object[key];\n\n    result[length] = [key, value, isStrictComparable(value)];\n  }\n  return result;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11,\n// for data views in Edge < 14, and promises in Node.js.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = objectToString.call(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : undefined;\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n  path = isKey(path, object) ? [path] : castPath(path);\n\n  var result,\n      index = -1,\n      length = path.length;\n\n  while (++index < length) {\n    var key = toKey(path[index]);\n    if (!(result = object != null && hasFunc(object, key))) {\n      break;\n    }\n    object = object[key];\n  }\n  if (result) {\n    return result;\n  }\n  var length = object ? object.length : 0;\n  return !!length && isLength(length) && isIndex(key, length) &&\n    (isArray(object) || isArguments(object));\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  length = length == null ? MAX_SAFE_INTEGER : length;\n  return !!length &&\n    (typeof value == 'number' || reIsUint.test(value)) &&\n    (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n  if (isArray(value)) {\n    return false;\n  }\n  var type = typeof value;\n  if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n      value == null || isSymbol(value)) {\n    return true;\n  }\n  return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n    (object != null && value in Object(object));\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n *  equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n  return value === value && !isObject(value);\n}\n\n/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n  return function(object) {\n    if (object == null) {\n      return false;\n    }\n    return object[key] === srcValue &&\n      (srcValue !== undefined || (key in Object(object)));\n  };\n}\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoize(function(string) {\n  string = toString(string);\n\n  var result = [];\n  if (reLeadingDot.test(string)) {\n    result.push('');\n  }\n  string.replace(rePropName, function(match, number, quote, string) {\n    result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));\n  });\n  return result;\n});\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n  if (typeof value == 'string' || isSymbol(value)) {\n    return value;\n  }\n  var result = (value + '');\n  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity]\n *  The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\nfunction uniqBy(array, iteratee) {\n  return (array && array.length)\n    ? baseUniq(array, baseIteratee(iteratee, 2))\n    : [];\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n  if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n    throw new TypeError(FUNC_ERROR_TEXT);\n  }\n  var memoized = function() {\n    var args = arguments,\n        key = resolver ? resolver.apply(this, args) : args[0],\n        cache = memoized.cache;\n\n    if (cache.has(key)) {\n      return cache.get(key);\n    }\n    var result = func.apply(this, args);\n    memoized.cache = cache.set(key, result);\n    return result;\n  };\n  memoized.cache = new (memoize.Cache || MapCache);\n  return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n  // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n  return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n    (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n *  else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n  return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n  return typeof value == 'symbol' ||\n    (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n  return value == null ? '' : baseToString(value);\n}\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n  var result = object == null ? undefined : baseGet(object, path);\n  return result === undefined ? defaultValue : result;\n}\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n  return object != null && hasPath(object, path, baseHasIn);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n  return value;\n}\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n  // No operation performed.\n}\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n *   { 'a': { 'b': 2 } },\n *   { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = uniqBy;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.uniqby/index.js\n// module id = 1048\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.uniqby/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n  var length = array ? array.length : 0;\n  return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\n/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n  var index = -1,\n      length = array ? array.length : 0;\n\n  while (++index < length) {\n    if (comparator(value, array[index])) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  if (value !== value) {\n    return baseFindIndex(array, baseIsNaN, fromIndex);\n  }\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\n/**\n * Checks if a cache value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n  return cache.has(key);\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n  // Many host objects are `Object` objects that can coerce to strings\n  // despite having improperly defined `toString` methods.\n  var result = false;\n  if (value != null && typeof value.toString != 'function') {\n    try {\n      result = !!(value + '');\n    } catch (e) {}\n  }\n  return result;\n}\n\n/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n    funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n    Set = getNative(root, 'Set'),\n    nativeCreate = getNative(Object, 'create');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries ? entries.length : 0;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  getMapData(this, key).set(key, value);\n  return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values ? values.length : 0;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\n/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n  var index = -1,\n      includes = arrayIncludes,\n      length = array.length,\n      isCommon = true,\n      result = [],\n      seen = result;\n\n  if (comparator) {\n    isCommon = false;\n    includes = arrayIncludesWith;\n  }\n  else if (length >= LARGE_ARRAY_SIZE) {\n    var set = iteratee ? null : createSet(array);\n    if (set) {\n      return setToArray(set);\n    }\n    isCommon = false;\n    includes = cacheHas;\n    seen = new SetCache;\n  }\n  else {\n    seen = iteratee ? [] : result;\n  }\n  outer:\n  while (++index < length) {\n    var value = array[index],\n        computed = iteratee ? iteratee(value) : value;\n\n    value = (comparator || value !== 0) ? value : 0;\n    if (isCommon && computed === computed) {\n      var seenIndex = seen.length;\n      while (seenIndex--) {\n        if (seen[seenIndex] === computed) {\n          continue outer;\n        }\n      }\n      if (iteratee) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n    else if (!includes(seen, computed, comparator)) {\n      if (seen !== result) {\n        seen.push(computed);\n      }\n      result.push(value);\n    }\n  }\n  return result;\n}\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n  return new Set(values);\n};\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\n/**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The comparator is invoked with\n * two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\nfunction uniqWith(array, comparator) {\n  return (array && array.length)\n    ? baseUniq(array, undefined, comparator)\n    : [];\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 8-9 which returns 'object' for typed array and other constructors.\n  var tag = isObject(value) ? objectToString.call(value) : '';\n  return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n  // No operation performed.\n}\n\nmodule.exports = uniqWith;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.uniqwith/index.js\n// module id = 1049\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash.uniqwith/index.js")},function(module,exports){eval("/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n  switch (args.length) {\n    case 0: return func.call(thisArg);\n    case 1: return func.call(thisArg, args[0]);\n    case 2: return func.call(thisArg, args[0], args[1]);\n    case 3: return func.call(thisArg, args[0], args[1], args[2]);\n  }\n  return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_apply.js\n// module id = 1050\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_apply.js")},function(module,exports){eval("/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      result = Array(length);\n\n  while (++index < length) {\n    result[index] = iteratee(array[index], index, array);\n  }\n  return result;\n}\n\nmodule.exports = arrayMap;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_arrayMap.js\n// module id = 1051\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_arrayMap.js")},function(module,exports,__webpack_require__){eval("var baseAssignValue = __webpack_require__(460),\n    eq = __webpack_require__(465);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nmodule.exports = assignValue;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_assignValue.js\n// module id = 1052\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_assignValue.js")},function(module,exports){eval("/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n  var length = array.length,\n      index = fromIndex + (fromRight ? 1 : -1);\n\n  while ((fromRight ? index-- : ++index < length)) {\n    if (predicate(array[index], index, array)) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = baseFindIndex;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseFindIndex.js\n// module id = 1053\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseFindIndex.js")},function(module,exports,__webpack_require__){eval("var baseFindIndex = __webpack_require__(1053),\n    baseIsNaN = __webpack_require__(1056),\n    strictIndexOf = __webpack_require__(1082);\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n  return value === value\n    ? strictIndexOf(array, value, fromIndex)\n    : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIndexOf.js\n// module id = 1054\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseIndexOf.js")},function(module,exports,__webpack_require__){eval("var baseGetTag = __webpack_require__(282),\n    isObjectLike = __webpack_require__(286);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n  return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsArguments.js\n// module id = 1055\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseIsArguments.js")},function(module,exports){eval("/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n  return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNaN.js\n// module id = 1056\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseIsNaN.js")},function(module,exports,__webpack_require__){eval("var isFunction = __webpack_require__(466),\n    isMasked = __webpack_require__(1073),\n    isObject = __webpack_require__(147),\n    toSource = __webpack_require__(1083);\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsNative.js\n// module id = 1057\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseIsNative.js")},function(module,exports,__webpack_require__){eval("var baseGetTag = __webpack_require__(282),\n    isLength = __webpack_require__(467),\n    isObjectLike = __webpack_require__(286);\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseIsTypedArray.js\n// module id = 1058\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseIsTypedArray.js")},function(module,exports,__webpack_require__){eval("var isPrototype = __webpack_require__(464),\n    nativeKeys = __webpack_require__(1074);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeys.js\n// module id = 1059\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseKeys.js")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(147),\n    isPrototype = __webpack_require__(464),\n    nativeKeysIn = __webpack_require__(1075);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n  if (!isObject(object)) {\n    return nativeKeysIn(object);\n  }\n  var isProto = isPrototype(object),\n      result = [];\n\n  for (var key in object) {\n    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeysIn;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseKeysIn.js\n// module id = 1060\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseKeysIn.js")},function(module,exports){eval("/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n  return function(object) {\n    return object == null ? undefined : object[key];\n  };\n}\n\nmodule.exports = baseProperty;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseProperty.js\n// module id = 1061\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseProperty.js")},function(module,exports,__webpack_require__){eval("var identity = __webpack_require__(284),\n    overRest = __webpack_require__(1079),\n    setToString = __webpack_require__(1080);\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n  return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseRest.js\n// module id = 1062\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseRest.js")},function(module,exports,__webpack_require__){eval("var constant = __webpack_require__(1085),\n    defineProperty = __webpack_require__(461),\n    identity = __webpack_require__(284);\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n  return defineProperty(func, 'toString', {\n    'configurable': true,\n    'enumerable': false,\n    'value': constant(string),\n    'writable': true\n  });\n};\n\nmodule.exports = baseSetToString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseSetToString.js\n// module id = 1063\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseSetToString.js")},function(module,exports){eval("/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\nmodule.exports = baseTimes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseTimes.js\n// module id = 1064\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseTimes.js")},function(module,exports){eval("/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\nmodule.exports = baseUnary;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_baseUnary.js\n// module id = 1065\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_baseUnary.js")},function(module,exports,__webpack_require__){eval("var assignValue = __webpack_require__(1052),\n    baseAssignValue = __webpack_require__(460);\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  var isNew = !object;\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    if (newValue === undefined) {\n      newValue = source[key];\n    }\n    if (isNew) {\n      baseAssignValue(object, key, newValue);\n    } else {\n      assignValue(object, key, newValue);\n    }\n  }\n  return object;\n}\n\nmodule.exports = copyObject;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_copyObject.js\n// module id = 1066\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_copyObject.js")},function(module,exports,__webpack_require__){eval("var root = __webpack_require__(283);\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_coreJsData.js\n// module id = 1067\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_coreJsData.js")},function(module,exports,__webpack_require__){eval("var baseRest = __webpack_require__(1062),\n    isIterateeCall = __webpack_require__(1072);\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n  return baseRest(function(object, sources) {\n    var index = -1,\n        length = sources.length,\n        customizer = length > 1 ? sources[length - 1] : undefined,\n        guard = length > 2 ? sources[2] : undefined;\n\n    customizer = (assigner.length > 3 && typeof customizer == 'function')\n      ? (length--, customizer)\n      : undefined;\n\n    if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n      customizer = length < 3 ? undefined : customizer;\n      length = 1;\n    }\n    object = Object(object);\n    while (++index < length) {\n      var source = sources[index];\n      if (source) {\n        assigner(object, source, index, customizer);\n      }\n    }\n    return object;\n  });\n}\n\nmodule.exports = createAssigner;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_createAssigner.js\n// module id = 1068\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_createAssigner.js")},function(module,exports,__webpack_require__){eval("var baseIsNative = __webpack_require__(1057),\n    getValue = __webpack_require__(1071);\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getNative.js\n// module id = 1069\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_getNative.js")},function(module,exports,__webpack_require__){eval("var Symbol = __webpack_require__(458);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getRawTag.js\n// module id = 1070\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_getRawTag.js")},function(module,exports){eval("/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_getValue.js\n// module id = 1071\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_getValue.js")},function(module,exports,__webpack_require__){eval("var eq = __webpack_require__(465),\n    isArrayLike = __webpack_require__(98),\n    isIndex = __webpack_require__(463),\n    isObject = __webpack_require__(147);\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n *  else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n  if (!isObject(object)) {\n    return false;\n  }\n  var type = typeof index;\n  if (type == 'number'\n        ? (isArrayLike(object) && isIndex(index, object.length))\n        : (type == 'string' && index in object)\n      ) {\n    return eq(object[index], value);\n  }\n  return false;\n}\n\nmodule.exports = isIterateeCall;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isIterateeCall.js\n// module id = 1072\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_isIterateeCall.js")},function(module,exports,__webpack_require__){eval("var coreJsData = __webpack_require__(1067);\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_isMasked.js\n// module id = 1073\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_isMasked.js")},function(module,exports,__webpack_require__){eval("var overArg = __webpack_require__(1078);\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeys.js\n// module id = 1074\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_nativeKeys.js")},function(module,exports){eval("/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n  var result = [];\n  if (object != null) {\n    for (var key in Object(object)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = nativeKeysIn;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nativeKeysIn.js\n// module id = 1075\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_nativeKeysIn.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(462);\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    return freeProcess && freeProcess.binding && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_nodeUtil.js\n// module id = 1076\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_nodeUtil.js")},function(module,exports){eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_objectToString.js\n// module id = 1077\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_objectToString.js")},function(module,exports){eval("/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\nmodule.exports = overArg;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overArg.js\n// module id = 1078\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_overArg.js")},function(module,exports,__webpack_require__){eval("var apply = __webpack_require__(1050);\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n  start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n  return function() {\n    var args = arguments,\n        index = -1,\n        length = nativeMax(args.length - start, 0),\n        array = Array(length);\n\n    while (++index < length) {\n      array[index] = args[start + index];\n    }\n    index = -1;\n    var otherArgs = Array(start + 1);\n    while (++index < start) {\n      otherArgs[index] = args[index];\n    }\n    otherArgs[start] = transform(array);\n    return apply(func, this, otherArgs);\n  };\n}\n\nmodule.exports = overRest;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_overRest.js\n// module id = 1079\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_overRest.js")},function(module,exports,__webpack_require__){eval("var baseSetToString = __webpack_require__(1063),\n    shortOut = __webpack_require__(1081);\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_setToString.js\n// module id = 1080\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_setToString.js")},function(module,exports){eval("/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n    HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n  var count = 0,\n      lastCalled = 0;\n\n  return function() {\n    var stamp = nativeNow(),\n        remaining = HOT_SPAN - (stamp - lastCalled);\n\n    lastCalled = stamp;\n    if (remaining > 0) {\n      if (++count >= HOT_COUNT) {\n        return arguments[0];\n      }\n    } else {\n      count = 0;\n    }\n    return func.apply(undefined, arguments);\n  };\n}\n\nmodule.exports = shortOut;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_shortOut.js\n// module id = 1081\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_shortOut.js")},function(module,exports){eval("/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n  var index = fromIndex - 1,\n      length = array.length;\n\n  while (++index < length) {\n    if (array[index] === value) {\n      return index;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = strictIndexOf;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_strictIndexOf.js\n// module id = 1082\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_strictIndexOf.js")},function(module,exports){eval("/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\nmodule.exports = toSource;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/_toSource.js\n// module id = 1083\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/_toSource.js")},function(module,exports,__webpack_require__){eval("var copyObject = __webpack_require__(1066),\n    createAssigner = __webpack_require__(1068),\n    keysIn = __webpack_require__(1090);\n\n/**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n *   return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\nvar assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n  copyObject(source, keysIn(source), object, customizer);\n});\n\nmodule.exports = assignInWith;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/assignInWith.js\n// module id = 1084\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/assignInWith.js")},function(module,exports){eval("/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n  return function() {\n    return value;\n  };\n}\n\nmodule.exports = constant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/constant.js\n// module id = 1085\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/constant.js")},function(module,exports,__webpack_require__){eval("var baseIsArguments = __webpack_require__(1055),\n    isObjectLike = __webpack_require__(286);\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n    !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isArguments.js\n// module id = 1086\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isArguments.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {var root = __webpack_require__(283),\n    stubFalse = __webpack_require__(1091);\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isBuffer.js\n// module id = 1087\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isBuffer.js")},function(module,exports,__webpack_require__){eval("var baseIsTypedArray = __webpack_require__(1058),\n    baseUnary = __webpack_require__(1065),\n    nodeUtil = __webpack_require__(1076);\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/isTypedArray.js\n// module id = 1088\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/isTypedArray.js")},function(module,exports,__webpack_require__){eval("var arrayLikeKeys = __webpack_require__(459),\n    baseKeys = __webpack_require__(1059),\n    isArrayLike = __webpack_require__(98);\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/keys.js\n// module id = 1089\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/keys.js")},function(module,exports,__webpack_require__){eval("var arrayLikeKeys = __webpack_require__(459),\n    baseKeysIn = __webpack_require__(1060),\n    isArrayLike = __webpack_require__(98);\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/keysIn.js\n// module id = 1090\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/keysIn.js")},function(module,exports){eval("/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\nmodule.exports = stubFalse;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash/stubFalse.js\n// module id = 1091\n// module chunks = 0\n\n//# sourceURL=../node_modules/lodash/stubFalse.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nexports.compare = function (a, b) {\n\n  if(Buffer.isBuffer(a)) {\n    var l = Math.min(a.length, b.length)\n    for(var i = 0; i < l; i++) {\n      var cmp = a[i] - b[i]\n      if(cmp) return cmp\n    }\n    return a.length - b.length\n  }\n\n  return a < b ? -1 : a > b ? 1 : 0\n}\n\n// to be compatible with the current abstract-leveldown tests\n// nullish or empty strings.\n// I could use !!val but I want to permit numbers and booleans,\n// if possible.\n\nfunction isDef (val) {\n  return val !== undefined && val !== ''\n}\n\nfunction has (range, name) {\n  return Object.hasOwnProperty.call(range, name)\n}\n\nfunction hasKey(range, name) {\n  return Object.hasOwnProperty.call(range, name) && name\n}\n\nvar lowerBoundKey = exports.lowerBoundKey = function (range) {\n    return (\n       hasKey(range, 'gt')\n    || hasKey(range, 'gte')\n    || hasKey(range, 'min')\n    || (range.reverse ? hasKey(range, 'end') : hasKey(range, 'start'))\n    || undefined\n    )\n}\n\nvar lowerBound = exports.lowerBound = function (range, def) {\n  var k = lowerBoundKey(range)\n  return k ? range[k] : def\n}\n\nvar lowerBoundInclusive = exports.lowerBoundInclusive = function (range) {\n  return has(range, 'gt') ? false : true\n}\n\nvar upperBoundInclusive = exports.upperBoundInclusive =\n  function (range) {\n    return (has(range, 'lt') /*&& !range.maxEx*/) ? false : true\n  }\n\nvar lowerBoundExclusive = exports.lowerBoundExclusive =\n  function (range) {\n    return !lowerBoundInclusive(range)\n  }\n\nvar upperBoundExclusive = exports.upperBoundExclusive =\n  function (range) {\n    return !upperBoundInclusive(range)\n  }\n\nvar upperBoundKey = exports.upperBoundKey = function (range) {\n    return (\n       hasKey(range, 'lt')\n    || hasKey(range, 'lte')\n    || hasKey(range, 'max')\n    || (range.reverse ? hasKey(range, 'start') : hasKey(range, 'end'))\n    || undefined\n    )\n}\n\nvar upperBound = exports.upperBound = function (range, def) {\n  var k = upperBoundKey(range)\n  return k ? range[k] : def\n}\n\nexports.start = function (range, def) {\n  return range.reverse ? upperBound(range, def) : lowerBound(range, def)\n}\nexports.end = function (range, def) {\n  return range.reverse ? lowerBound(range, def) : upperBound(range, def)\n}\nexports.startInclusive = function (range) {\n  return (\n    range.reverse\n  ? upperBoundInclusive(range)\n  : lowerBoundInclusive(range)\n  )\n}\nexports.endInclusive = function (range) {\n  return (\n    range.reverse\n  ? lowerBoundInclusive(range)\n  : upperBoundInclusive(range)\n  )\n}\n\nfunction id (e) { return e }\n\nexports.toLtgt = function (range, _range, map, lower, upper) {\n  _range = _range || {}\n  map = map || id\n  var defaults = arguments.length > 3\n  var lb = exports.lowerBoundKey(range)\n  var ub = exports.upperBoundKey(range)\n  if(lb) {\n    if(lb === 'gt') _range.gt = map(range.gt, false)\n    else            _range.gte = map(range[lb], false)\n  }\n  else if(defaults)\n    _range.gte = map(lower, false)\n\n  if(ub) {\n    if(ub === 'lt') _range.lt = map(range.lt, true)\n    else            _range.lte = map(range[ub], true)\n  }\n  else if(defaults)\n    _range.lte = map(upper, true)\n\n  if(range.reverse != null)\n    _range.reverse = !!range.reverse\n\n  //if range was used mutably\n  //(in level-sublevel it's part of an options object\n  //that has more properties on it.)\n  if(has(_range, 'max'))   delete _range.max\n  if(has(_range, 'min'))   delete _range.min\n  if(has(_range, 'start')) delete _range.start\n  if(has(_range, 'end'))   delete _range.end\n\n  return _range\n}\n\nexports.contains = function (range, key, compare) {\n  compare = compare || exports.compare\n\n  var lb = lowerBound(range)\n  if(isDef(lb)) {\n    var cmp = compare(key, lb)\n    if(cmp < 0 || (cmp === 0 && lowerBoundExclusive(range)))\n      return false\n  }\n\n  var ub = upperBound(range)\n  if(isDef(ub)) {\n    var cmp = compare(key, ub)\n    if(cmp > 0 || (cmp === 0) && upperBoundExclusive(range))\n      return false\n  }\n\n  return true\n}\n\nexports.filter = function (range, compare) {\n  return function (key) {\n    return exports.contains(range, key, compare)\n  }\n}\n\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ltgt/index.js\n// module id = 1092\n// module chunks = 0\n\n//# sourceURL=../node_modules/ltgt/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar inherits = __webpack_require__(3)\nvar HashBase = __webpack_require__(1094)\n\nvar ARRAY16 = new Array(16)\n\nfunction MD5 () {\n  HashBase.call(this, 64)\n\n  // state\n  this._a = 0x67452301\n  this._b = 0xefcdab89\n  this._c = 0x98badcfe\n  this._d = 0x10325476\n}\n\ninherits(MD5, HashBase)\n\nMD5.prototype._update = function () {\n  var M = ARRAY16\n  for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\n\n  var a = this._a\n  var b = this._b\n  var c = this._c\n  var d = this._d\n\n  a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\n  d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\n  c = fnF(c, d, a, b, M[2], 0x242070db, 17)\n  b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\n  a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\n  d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\n  c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\n  b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\n  a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\n  d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\n  c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\n  b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\n  a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\n  d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\n  c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\n  b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\n\n  a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\n  d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\n  c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\n  b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\n  a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\n  d = fnG(d, a, b, c, M[10], 0x02441453, 9)\n  c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\n  b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\n  a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\n  d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\n  c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\n  b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\n  a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\n  d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\n  c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\n  b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\n\n  a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\n  d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\n  c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\n  b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\n  a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\n  d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\n  c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\n  b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\n  a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\n  d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\n  c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\n  b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\n  a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\n  d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\n  c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\n  b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\n\n  a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\n  d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\n  c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\n  b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\n  a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\n  d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\n  c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\n  b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\n  a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\n  d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\n  c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\n  b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\n  a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\n  d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\n  c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\n  b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\n\n  this._a = (this._a + a) | 0\n  this._b = (this._b + b) | 0\n  this._c = (this._c + c) | 0\n  this._d = (this._d + d) | 0\n}\n\nMD5.prototype._digest = function () {\n  // create padding and handle blocks\n  this._block[this._blockOffset++] = 0x80\n  if (this._blockOffset > 56) {\n    this._block.fill(0, this._blockOffset, 64)\n    this._update()\n    this._blockOffset = 0\n  }\n\n  this._block.fill(0, this._blockOffset, 56)\n  this._block.writeUInt32LE(this._length[0], 56)\n  this._block.writeUInt32LE(this._length[1], 60)\n  this._update()\n\n  // produce result\n  var buffer = new Buffer(16)\n  buffer.writeInt32LE(this._a, 0)\n  buffer.writeInt32LE(this._b, 4)\n  buffer.writeInt32LE(this._c, 8)\n  buffer.writeInt32LE(this._d, 12)\n  return buffer\n}\n\nfunction rotl (x, n) {\n  return (x << n) | (x >>> (32 - n))\n}\n\nfunction fnF (a, b, c, d, m, k, s) {\n  return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnG (a, b, c, d, m, k, s) {\n  return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnH (a, b, c, d, m, k, s) {\n  return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\n}\n\nfunction fnI (a, b, c, d, m, k, s) {\n  return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\n}\n\nmodule.exports = MD5\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/md5.js/index.js\n// module id = 1093\n// module chunks = 0\n\n//# sourceURL=../node_modules/md5.js/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar Transform = __webpack_require__(46).Transform\nvar inherits = __webpack_require__(3)\n\nfunction throwIfNotStringOrBuffer (val, prefix) {\n  if (!Buffer.isBuffer(val) && typeof val !== 'string') {\n    throw new TypeError(prefix + ' must be a string or a buffer')\n  }\n}\n\nfunction HashBase (blockSize) {\n  Transform.call(this)\n\n  this._block = Buffer.allocUnsafe(blockSize)\n  this._blockSize = blockSize\n  this._blockOffset = 0\n  this._length = [0, 0, 0, 0]\n\n  this._finalized = false\n}\n\ninherits(HashBase, Transform)\n\nHashBase.prototype._transform = function (chunk, encoding, callback) {\n  var error = null\n  try {\n    this.update(chunk, encoding)\n  } catch (err) {\n    error = err\n  }\n\n  callback(error)\n}\n\nHashBase.prototype._flush = function (callback) {\n  var error = null\n  try {\n    this.push(this.digest())\n  } catch (err) {\n    error = err\n  }\n\n  callback(error)\n}\n\nHashBase.prototype.update = function (data, encoding) {\n  throwIfNotStringOrBuffer(data, 'Data')\n  if (this._finalized) throw new Error('Digest already called')\n  if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\n\n  // consume data\n  var block = this._block\n  var offset = 0\n  while (this._blockOffset + data.length - offset >= this._blockSize) {\n    for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\n    this._update()\n    this._blockOffset = 0\n  }\n  while (offset < data.length) block[this._blockOffset++] = data[offset++]\n\n  // update length\n  for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\n    this._length[j] += carry\n    carry = (this._length[j] / 0x0100000000) | 0\n    if (carry > 0) this._length[j] -= 0x0100000000 * carry\n  }\n\n  return this\n}\n\nHashBase.prototype._update = function () {\n  throw new Error('_update is not implemented')\n}\n\nHashBase.prototype.digest = function (encoding) {\n  if (this._finalized) throw new Error('Digest already called')\n  this._finalized = true\n\n  var digest = this._digest()\n  if (encoding !== undefined) digest = digest.toString(encoding)\n\n  // reset state\n  this._block.fill(0)\n  this._blockOffset = 0\n  for (var i = 0; i < 4; ++i) this._length[i] = 0\n\n  return digest\n}\n\nHashBase.prototype._digest = function () {\n  throw new Error('_digest is not implemented')\n}\n\nmodule.exports = HashBase\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/md5.js/~/hash-base/index.js\n// module id = 1094\n// module chunks = 0\n\n//# sourceURL=../node_modules/md5.js/node_modules/hash-base/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// constant-space merkle root calculation algorithm\nmodule.exports = function fastRoot (values, digestFn) {\n  if (!Array.isArray(values)) throw TypeError('Expected values Array')\n  if (typeof digestFn !== 'function') throw TypeError('Expected digest Function')\n\n  var length = values.length\n  var results = values.concat()\n\n  while (length > 1) {\n    var j = 0\n\n    for (var i = 0; i < length; i += 2, ++j) {\n      var left = results[i]\n      var right = i + 1 === length ? left : results[i + 1]\n      var data = Buffer.concat([left, right])\n\n      results[j] = digestFn(data)\n    }\n\n    length = j\n  }\n\n  return results[0]\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/merkle-lib/fastRoot.js\n// module id = 1095\n// module chunks = 0\n\n//# sourceURL=../node_modules/merkle-lib/fastRoot.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {const rlp = __webpack_require__(155)\nconst ethUtil = __webpack_require__(182)\n\nmodule.exports = TrieNode\n\nfunction TrieNode (type, key, value) {\n  if (Array.isArray(type)) {\n    // parse raw node\n    this.parseNode(type)\n  } else {\n    this.type = type\n    if (type === 'branch') {\n      var values = key\n      this.raw = Array.apply(null, Array(17))\n      if (values) {\n        values.forEach(function (keyVal) {\n          this.set.apply(this, keyVal)\n        })\n      }\n    } else {\n      this.raw = Array(2)\n      this.setValue(value)\n      this.setKey(key)\n    }\n  }\n}\n\nTrieNode.isRawNode = isRawNode\nTrieNode.addHexPrefix = addHexPrefix\nTrieNode.removeHexPrefix = removeHexPrefix\nTrieNode.isTerminator = isTerminator\nTrieNode.stringToNibbles = stringToNibbles\nTrieNode.nibblesToBuffer = nibblesToBuffer\nTrieNode.getNodeType = getNodeType\n\nObject.defineProperty(TrieNode.prototype, 'value', {\n  get: function () {\n    return this.getValue()\n  },\n  set: function (v) {\n    this.setValue(v)\n  }\n})\n\nObject.defineProperty(TrieNode.prototype, 'key', {\n  get: function () {\n    return this.getKey()\n  },\n  set: function (k) {\n    this.setKey(k)\n  }\n})\n\n// parses a raw node\nTrieNode.prototype.parseNode = function (rawNode) {\n  this.raw = rawNode\n  this.type = getNodeType(rawNode)\n}\n\n// sets the value of the node\nTrieNode.prototype.setValue = function (key, value) {\n  if (this.type !== 'branch') {\n    this.raw[1] = key\n  } else {\n    if (arguments.length === 1) {\n      value = key\n      key = 16\n    }\n    this.raw[key] = value\n  }\n}\n\nTrieNode.prototype.getValue = function (key) {\n  if (this.type === 'branch') {\n    if (arguments.length === 0) {\n      key = 16\n    }\n\n    var val = this.raw[key]\n    if (val !== null && val !== undefined && val.length !== 0) {\n      return val\n    }\n  } else {\n    return this.raw[1]\n  }\n}\n\nTrieNode.prototype.setKey = function (key) {\n  if (this.type !== 'branch') {\n    if (Buffer.isBuffer(key)) {\n      key = stringToNibbles(key)\n    } else {\n      key = key.slice(0) // copy the key\n    }\n\n    key = addHexPrefix(key, this.type === 'leaf')\n    this.raw[0] = nibblesToBuffer(key)\n  }\n}\n\n// returns the key as a nibble\nTrieNode.prototype.getKey = function () {\n  if (this.type !== 'branch') {\n    var key = this.raw[0]\n    key = removeHexPrefix(stringToNibbles(key))\n    return (key)\n  }\n}\n\nTrieNode.prototype.serialize = function () {\n  return rlp.encode(this.raw)\n}\n\nTrieNode.prototype.hash = function () {\n  return ethUtil.sha3(this.serialize())\n}\n\nTrieNode.prototype.toString = function () {\n  var out = this.type\n  out += ': ['\n  this.raw.forEach(function (el) {\n    if (Buffer.isBuffer(el)) {\n      out += el.toString('hex') + ', '\n    } else if (el) {\n      out += 'object, '\n    } else {\n      out += 'empty, '\n    }\n  })\n  out = out.slice(0, -2)\n  out += ']'\n  return out\n}\n\nTrieNode.prototype.getChildren = function () {\n  var children = []\n  switch (this.type) {\n    case 'leaf':\n      // no children\n      break\n    case 'extention':\n      // one child\n      children.push([this.key, this.getValue()])\n      break\n    case 'branch':\n      for (var index = 0, end = 16; index < end; index++) {\n        var value = this.getValue(index)\n        if (value) {\n          children.push([\n            [index], value\n          ])\n        }\n      }\n      break\n  }\n  return children\n}\n\n/**\n * @param {Array} dataArr\n * @returns {Buffer} - returns buffer of encoded data\n * hexPrefix\n **/\nfunction addHexPrefix (key, terminator) {\n  // odd\n  if (key.length % 2) {\n    key.unshift(1)\n  } else {\n    // even\n    key.unshift(0)\n    key.unshift(0)\n  }\n\n  if (terminator) {\n    key[0] += 2\n  }\n\n  return key\n}\n\nfunction removeHexPrefix (val) {\n  if (val[0] % 2) {\n    val = val.slice(1)\n  } else {\n    val = val.slice(2)\n  }\n\n  return val\n}\n\n/**\n * Determines if a key has Arnold Schwarzenegger in it.\n * @method isTerminator\n * @param {Array} key - an hexprefixed array of nibbles\n */\nfunction isTerminator (key) {\n  return key[0] > 1\n}\n\n/**\n * Converts a string OR a buffer to a nibble array.\n * @method stringToNibbles\n * @param {Buffer| String} key\n */\nfunction stringToNibbles (key) {\n  var bkey = new Buffer(key)\n  var nibbles = []\n\n  for (var i = 0; i < bkey.length; i++) {\n    var q = i * 2\n    nibbles[q] = bkey[i] >> 4\n    ++q\n    nibbles[q] = bkey[i] % 16\n  }\n  return nibbles\n}\n\n/**\n * Converts a nibble array into a buffer.\n * @method nibblesToBuffer\n * @param arr\n */\nfunction nibblesToBuffer (arr) {\n  var buf = new Buffer(arr.length / 2)\n  for (var i = 0; i < buf.length; i++) {\n    var q = i * 2\n    buf[i] = (arr[q] << 4) + arr[++q]\n  }\n  return buf\n}\n\n/**\n * Determines the node type.\n * @returns {String} - the node type\n *   - leaf - if the node is a leaf\n *   - branch - if the node is a branch\n *   - extention - if the node is an extention\n *   - unknown - if something else got borked\n */\nfunction getNodeType (node) {\n  if (node.length === 17) {\n    return 'branch'\n  } else if (node.length === 2) {\n    var key = stringToNibbles(node[0])\n    if (isTerminator(key)) {\n      return 'leaf'\n    }\n\n    return 'extention'\n  }\n}\n\nfunction isRawNode (node) {\n  return Array.isArray(node) && !Buffer.isBuffer(node)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/merkle-patricia-tree/trieNode.js\n// module id = 1096\n// module chunks = 0\n\n//# sourceURL=../node_modules/merkle-patricia-tree/trieNode.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst exp = Math.exp\n\nexports =\nmodule.exports =\nfunction MovingAverage (timespan) {\n  if (typeof timespan !== 'number') { throw new Error('must provide a timespan to the moving average constructor') }\n\n  if (timespan <= 0) { throw new Error('must provide a timespan > 0 to the moving average constructor') }\n\n  let ma     // moving average\n  let v = 0  // variance\n  let d = 0  // deviation\n  let f = 0  // forecast\n\n  let previousTime\n\n  let ret = {}\n\n  function alpha (t, pt) {\n    return 1 - (exp(-(t - pt) / timespan))\n  }\n\n  ret.push =\n  function push (time, value) {\n    if (previousTime) {\n      // calculate moving average\n      const a = alpha(time, previousTime)\n      const diff = value - ma\n      const incr = a * diff\n      ma = a * value + (1 - a) * ma\n      // calculate variance & deviation\n      v = (1 - a) * (v + diff * incr)\n      d = Math.sqrt(v)\n      // calculate forecast\n      f = ma + a * diff\n    } else {\n      ma = value\n    }\n    previousTime = time\n  }\n\n  // Exponential Moving Average\n\n  ret.movingAverage =\n  function movingAverage () {\n    return ma\n  }\n\n  // Variance\n  ret.variance =\n  function variance () {\n    return v\n  }\n\n  ret.deviation =\n  function deviation () {\n    return d\n  }\n\n  ret.forecast =\n  function forecast () {\n    return f\n  }\n\n  return ret\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/moving-average/index.js\n// module id = 1097\n// module chunks = 0\n\n//# sourceURL=../node_modules/moving-average/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst map = __webpack_require__(280)\nconst filter = __webpack_require__(1038)\nconst convert = __webpack_require__(1099)\nconst protocols = __webpack_require__(287)\nconst varint = __webpack_require__(29)\n\n// export codec\nmodule.exports = {\n  stringToStringTuples: stringToStringTuples,\n  stringTuplesToString: stringTuplesToString,\n\n  tuplesToStringTuples: tuplesToStringTuples,\n  stringTuplesToTuples: stringTuplesToTuples,\n\n  bufferToTuples: bufferToTuples,\n  tuplesToBuffer: tuplesToBuffer,\n\n  bufferToString: bufferToString,\n  stringToBuffer: stringToBuffer,\n\n  fromString: fromString,\n  fromBuffer: fromBuffer,\n  validateBuffer: validateBuffer,\n  isValidBuffer: isValidBuffer,\n  cleanPath: cleanPath,\n\n  ParseError: ParseError,\n  protoFromTuple: protoFromTuple,\n\n  sizeForAddr: sizeForAddr\n}\n\n// string -> [[str name, str addr]... ]\nfunction stringToStringTuples (str) {\n  const tuples = []\n  const parts = str.split('/').slice(1) // skip first empty elem\n  if (parts.length === 1 && parts[0] === '') {\n    return []\n  }\n\n  for (let p = 0; p < parts.length; p++) {\n    const part = parts[p]\n    const proto = protocols(part)\n\n    if (proto.size === 0) {\n      tuples.push([part])\n      continue\n    }\n\n    p++ // advance addr part\n    if (p >= parts.length) {\n      throw ParseError('invalid address: ' + str)\n    }\n\n    tuples.push([part, parts[p]])\n  }\n\n  return tuples\n}\n\n// [[str name, str addr]... ] -> string\nfunction stringTuplesToString (tuples) {\n  const parts = []\n  map(tuples, function (tup) {\n    const proto = protoFromTuple(tup)\n    parts.push(proto.name)\n    if (tup.length > 1) {\n      parts.push(tup[1])\n    }\n  })\n\n  return '/' + parts.join('/')\n}\n\n// [[str name, str addr]... ] -> [[int code, Buffer]... ]\nfunction stringTuplesToTuples (tuples) {\n  return map(tuples, function (tup) {\n    if (!Array.isArray(tup)) {\n      tup = [tup]\n    }\n    const proto = protoFromTuple(tup)\n    if (tup.length > 1) {\n      return [proto.code, convert.toBuffer(proto.code, tup[1])]\n    }\n    return [proto.code]\n  })\n}\n\n// [[int code, Buffer]... ] -> [[str name, str addr]... ]\nfunction tuplesToStringTuples (tuples) {\n  return map(tuples, function (tup) {\n    const proto = protoFromTuple(tup)\n    if (tup.length > 1) {\n      return [proto.code, convert.toString(proto.code, tup[1])]\n    }\n    return [proto.code]\n  })\n}\n\n// [[int code, Buffer ]... ] -> Buffer\nfunction tuplesToBuffer (tuples) {\n  return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n    const proto = protoFromTuple(tup)\n    let buf = Buffer.from(varint.encode(proto.code))\n\n    if (tup.length > 1) {\n      buf = Buffer.concat([buf, tup[1]]) // add address buffer\n    }\n\n    return buf\n  })))\n}\n\nfunction sizeForAddr (p, addr) {\n  if (p.size > 0) {\n    return p.size / 8\n  } else if (p.size === 0) {\n    return 0\n  } else {\n    const size = varint.decode(addr)\n    return size + varint.decode.bytes\n  }\n}\n\n// Buffer -> [[int code, Buffer ]... ]\nfunction bufferToTuples (buf) {\n  const tuples = []\n  let i = 0\n  while (i < buf.length) {\n    const code = varint.decode(buf, i)\n    const n = varint.decode.bytes\n\n    const p = protocols(code)\n\n    const size = sizeForAddr(p, buf.slice(i + n))\n\n    if (size === 0) {\n      tuples.push([code])\n      i += n\n      continue\n    }\n\n    const addr = buf.slice(i + n, i + n + size)\n\n    i += (size + n)\n\n    if (i > buf.length) { // did not end _exactly_ at buffer.length\n      throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n    }\n\n    // ok, tuple seems good.\n    tuples.push([code, addr])\n  }\n\n  return tuples\n}\n\n// Buffer -> String\nfunction bufferToString (buf) {\n  const a = bufferToTuples(buf)\n  const b = tuplesToStringTuples(a)\n  return stringTuplesToString(b)\n}\n\n// String -> Buffer\nfunction stringToBuffer (str) {\n  str = cleanPath(str)\n  const a = stringToStringTuples(str)\n  const b = stringTuplesToTuples(a)\n\n  return tuplesToBuffer(b)\n}\n\n// String -> Buffer\nfunction fromString (str) {\n  return stringToBuffer(str)\n}\n\n// Buffer -> Buffer\nfunction fromBuffer (buf) {\n  const err = validateBuffer(buf)\n  if (err) throw err\n  return Buffer.from(buf) // copy\n}\n\nfunction validateBuffer (buf) {\n  try {\n    bufferToTuples(buf) // try to parse. will throw if breaks\n  } catch (err) {\n    return err\n  }\n}\n\nfunction isValidBuffer (buf) {\n  return validateBuffer(buf) === undefined\n}\n\nfunction cleanPath (str) {\n  return '/' + filter(str.trim().split('/')).join('/')\n}\n\nfunction ParseError (str) {\n  return new Error('Error parsing address: ' + str)\n}\n\nfunction protoFromTuple (tup) {\n  const proto = protocols(tup[0])\n  return proto\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiaddr/src/codec.js\n// module id = 1098\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiaddr/src/codec.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst ip = __webpack_require__(883)\nconst protocols = __webpack_require__(287)\nconst bs58 = __webpack_require__(76)\nconst varint = __webpack_require__(29)\n\nmodule.exports = Convert\n\n// converts (serializes) addresses\nfunction Convert (proto, a) {\n  if (a instanceof Buffer) {\n    return Convert.toString(proto, a)\n  } else {\n    return Convert.toBuffer(proto, a)\n  }\n}\n\nConvert.toString = function convertToString (proto, buf) {\n  proto = protocols(proto)\n  switch (proto.code) {\n    case 4: // ipv4\n    case 41: // ipv6\n      return ip.toString(buf)\n\n    case 6: // tcp\n    case 17: // udp\n    case 33: // dccp\n    case 132: // sctp\n      return buf2port(buf)\n\n    case 54: // dns4\n    case 55: // dns6\n    case 56: // dnsaddr\n      return buf2str(buf)\n\n    case 421: // ipfs\n      return buf2mh(buf)\n    default:\n      return buf.toString('hex') // no clue. convert to hex\n  }\n}\n\nConvert.toBuffer = function convertToBuffer (proto, str) {\n  proto = protocols(proto)\n  switch (proto.code) {\n    case 4: // ipv4\n    case 41: // ipv6\n      return ip.toBuffer(str)\n\n    case 6: // tcp\n    case 17: // udp\n    case 33: // dccp\n    case 132: // sctp\n      return port2buf(parseInt(str, 10))\n\n    case 54: // dns4\n    case 55: // dns6\n    case 56: // dnsaddr\n      return str2buf(str)\n\n    case 421: // ipfs\n      return mh2buf(str)\n    default:\n      return Buffer.from(str, 'hex') // no clue. convert from hex\n  }\n}\n\nfunction port2buf (port) {\n  const buf = Buffer.alloc(2)\n  buf.writeUInt16BE(port, 0)\n  return buf\n}\n\nfunction buf2port (buf) {\n  return buf.readUInt16BE(0)\n}\n\nfunction str2buf (str) {\n  const buf = Buffer.from(str)\n  const size = Buffer.from(varint.encode(buf.length))\n  return Buffer.concat([size, buf])\n}\n\nfunction buf2str (buf) {\n  const size = varint.decode(buf)\n  buf = buf.slice(varint.decode.bytes)\n\n  if (buf.length !== size) {\n    throw new Error('inconsistent lengths')\n  }\n\n  return buf.toString()\n}\n\nfunction mh2buf (hash) {\n  // the address is a varint prefixed multihash string representation\n  const mh = Buffer.from(bs58.decode(hash))\n  const size = Buffer.from(varint.encode(mh.length))\n  return Buffer.concat([size, mh])\n}\n\nfunction buf2mh (buf) {\n  const size = varint.decode(buf)\n  const address = buf.slice(varint.decode.bytes)\n\n  if (address.length !== size) {\n    throw new Error('inconsistent lengths')\n  }\n\n  return bs58.encode(address)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiaddr/src/convert.js\n// module id = 1099\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiaddr/src/convert.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nclass Base {\n  constructor (name, code, implementation, alphabet) {\n    this.name = name\n    this.code = code\n    this.alphabet = alphabet\n    if (implementation && alphabet) {\n      this.engine = implementation(alphabet)\n    }\n  }\n\n  encode (stringOrBuffer) {\n    return this.engine.encode(stringOrBuffer)\n  }\n\n  decode (stringOrBuffer) {\n    return this.engine.decode(stringOrBuffer)\n  }\n\n  isImplemented () {\n    return this.engine\n  }\n}\n\nmodule.exports = Base\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/base.js\n// module id = 1100\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/base.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = function base16 (alphabet) {\n  return {\n    encode (input) {\n      if (typeof input === 'string') {\n        return Buffer.from(input).toString('hex')\n      }\n      return input.toString('hex')\n    },\n    decode (input) {\n      for (let char of input) {\n        if (alphabet.indexOf(char) < 0) {\n          throw new Error('invalid base16 character')\n        }\n      }\n      return Buffer.from(input, 'hex')\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/base16.js\n// module id = 1101\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/base16.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nfunction decode (input, alphabet) {\n  input = input.replace(new RegExp('=', 'g'), '')\n  let length = input.length\n\n  let bits = 0\n  let value = 0\n\n  let index = 0\n  let output = new Uint8Array((length * 5 / 8) | 0)\n\n  for (let i = 0; i < length; i++) {\n    value = (value << 5) | alphabet.indexOf(input[i])\n    bits += 5\n\n    if (bits >= 8) {\n      output[index++] = (value >>> (bits - 8)) & 255\n      bits -= 8\n    }\n  }\n\n  return output.buffer\n}\n\nfunction encode (buffer, alphabet) {\n  let length = buffer.byteLength\n  let view = new Uint8Array(buffer)\n  let padding = alphabet.indexOf('=') === alphabet.length - 1\n\n  if (padding) {\n    alphabet = alphabet.substring(0, alphabet.length - 2)\n  }\n\n  let bits = 0\n  let value = 0\n  let output = ''\n\n  for (let i = 0; i < length; i++) {\n    value = (value << 8) | view[i]\n    bits += 8\n\n    while (bits >= 5) {\n      output += alphabet[(value >>> (bits - 5)) & 31]\n      bits -= 5\n    }\n  }\n\n  if (bits > 0) {\n    output += alphabet[(value << (5 - bits)) & 31]\n  }\n\n  if (padding) {\n    while ((output.length % 8) !== 0) {\n      output += '='\n    }\n  }\n\n  return output\n}\n\nmodule.exports = function base32 (alphabet) {\n  return {\n    encode (input) {\n      if (typeof input === 'string') {\n        return encode(Buffer.from(input), alphabet)\n      }\n\n      return encode(input, alphabet)\n    },\n    decode (input) {\n      for (let char of input) {\n        if (alphabet.indexOf(char) < 0) {\n          throw new Error('invalid base32 character')\n        }\n      }\n\n      return decode(input, alphabet)\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/base32.js\n// module id = 1102\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/base32.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nmodule.exports = function base64 (alphabet) {\n  // The alphabet is only used to know:\n  //   1. If padding is enabled (must contain '=')\n  //   2. If the output must be url-safe (must contain '-' and '_')\n  //   3. If the input of the output function is valid\n  // The alphabets from RFC 4648 are always used.\n  const padding = alphabet.indexOf('=') > -1\n  const url = alphabet.indexOf('-') > -1 && alphabet.indexOf('_') > -1\n\n  return {\n    encode (input) {\n      let output = ''\n\n      if (typeof input === 'string') {\n        output = Buffer.from(input).toString('base64')\n      } else {\n        output = input.toString('base64')\n      }\n\n      if (url) {\n        output = output.replace('+', '-')\n        output = output.replace('/', '_')\n      }\n\n      const pad = output.indexOf('=')\n      if (pad > 0 && !padding) {\n        output = output.substring(0, pad)\n      }\n\n      return output\n    },\n    decode (input) {\n      if (url) {\n        input = input.replace('+', '-')\n        input = input.replace('/', '_')\n      }\n\n      for (let char of input) {\n        if (alphabet.indexOf(char) < 0) {\n          throw new Error('invalid base64 character')\n        }\n      }\n\n      return Buffer.from(input, 'base64')\n    }\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/base64.js\n// module id = 1103\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/base64.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Base = __webpack_require__(1100)\nconst baseX = __webpack_require__(339)\nconst base16 = __webpack_require__(1101)\nconst base32 = __webpack_require__(1102)\nconst base64 = __webpack_require__(1103)\n\n// name, code, implementation, alphabet\nconst constants = [\n  ['base1', '1', '', '1'],\n  ['base2', '0', baseX, '01'],\n  ['base8', '7', baseX, '01234567'],\n  ['base10', '9', baseX, '0123456789'],\n  ['base16', 'f', base16, '0123456789abcdef'],\n  ['base32', 'b', base32, 'abcdefghijklmnopqrstuvwxyz234567'],\n  ['base32pad', 'c', base32, 'abcdefghijklmnopqrstuvwxyz234567='],\n  ['base32hex', 'v', base32, '0123456789abcdefghijklmnopqrstuv'],\n  ['base32hexpad', 't', base32, '0123456789abcdefghijklmnopqrstuv='],\n  ['base32z', 'h', base32, 'ybndrfg8ejkmcpqxot1uwisza345h769'],\n  ['base58flickr', 'Z', baseX, '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'],\n  ['base58btc', 'z', baseX, '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'],\n  ['base64', 'm', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'],\n  ['base64pad', 'M', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='],\n  ['base64url', 'u', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'],\n  ['base64urlpad', 'U', base64, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=']\n]\n\nconst names = constants.reduce((prev, tupple) => {\n  prev[tupple[0]] = new Base(tupple[0], tupple[1], tupple[2], tupple[3])\n  return prev\n}, {})\n\nconst codes = constants.reduce((prev, tupple) => {\n  prev[tupple[1]] = names[tupple[0]]\n  return prev\n}, {})\n\nmodule.exports = {\n  names: names,\n  codes: codes\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/constants.js\n// module id = 1104\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/constants.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Implementation of the [multibase](https://github.com/multiformats/multibase) specification.\n * @module Multibase\n */\n\n\nconst constants = __webpack_require__(1104)\n\nexports = module.exports = multibase\nexports.encode = encode\nexports.decode = decode\nexports.isEncoded = isEncoded\n\nconst errNotSupported = new Error('Unsupported encoding')\n\n/**\n * Create a new buffer with the multibase varint+code.\n *\n * @param {string|number} nameOrCode - The multibase name or code number.\n * @param {Buffer} buf - The data to be prefixed with multibase.\n * @memberof Multibase\n * @returns {Buffer}\n */\nfunction multibase (nameOrCode, buf) {\n  if (!buf) {\n    throw new Error('requires an encoded buffer')\n  }\n  const base = getBase(nameOrCode)\n  const codeBuf = Buffer.from(base.code)\n\n  const name = base.name\n  validEncode(name, buf)\n  return Buffer.concat([codeBuf, buf])\n}\n\n/**\n * Encode data with the specified base and add the multibase prefix.\n *\n * @param {string|number} nameOrCode - The multibase name or code number.\n * @param {Buffer} buf - The data to be encoded.\n * @returns {Buffer}\n * @memberof Multibase\n */\nfunction encode (nameOrCode, buf) {\n  const base = getBase(nameOrCode)\n  const name = base.name\n\n  return multibase(name, Buffer.from(base.encode(buf)))\n}\n\n/**\n *\n * Takes a buffer or string encoded with multibase header\n * decodes it and returns an object with the decoded buffer\n * and the encoded type { base: <name>, data: <buffer> }\n *\n * from @theobat : This is not what the multibase.spec.js test is waiting for,\n * hence the return decodeObject.data\n *\n * @param {Buffer|string} bufOrString\n * @returns {Object} result\n * @returns {string} result.base\n * @returns {Buffer} result.data\n * @memberof Multibase\n *\n */\nfunction decode (bufOrString) {\n  if (Buffer.isBuffer(bufOrString)) {\n    bufOrString = bufOrString.toString()\n  }\n\n  const code = bufOrString.substring(0, 1)\n  bufOrString = bufOrString.substring(1, bufOrString.length)\n\n  if (typeof bufOrString === 'string') {\n    bufOrString = Buffer.from(bufOrString)\n  }\n\n  const base = getBase(code)\n\n  const decodeObject = {\n    base: base.name,\n    data: Buffer.from(base.decode(bufOrString.toString()))\n  }\n  return decodeObject.data\n}\n\n/**\n * Is the given data multibase encoded?\n *\n * @param {Buffer|string} bufOrString\n * @returns {boolean}\n * @memberof Multibase\n */\nfunction isEncoded (bufOrString) {\n  if (Buffer.isBuffer(bufOrString)) {\n    bufOrString = bufOrString.toString()\n  }\n\n  const code = bufOrString.substring(0, 1)\n  try {\n    const base = getBase(code)\n    return base.name\n  } catch (err) {\n    return false\n  }\n}\n\n/**\n * @param {string} name\n * @param {Buffer} buf\n * @private\n * @returns {undefined}\n */\nfunction validEncode (name, buf) {\n  const base = getBase(name)\n  base.decode(buf.toString())\n}\n\nfunction getBase (nameOrCode) {\n  let base\n\n  if (constants.names[nameOrCode]) {\n    base = constants.names[nameOrCode]\n  } else if (constants.codes[nameOrCode]) {\n    base = constants.codes[nameOrCode]\n  } else {\n    throw errNotSupported\n  }\n\n  if (!base.isImplemented()) {\n    throw new Error('Base ' + nameOrCode + ' is not implemented yet')\n  }\n\n  return base\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multibase/src/index.js\n// module id = 1105\n// module chunks = 0\n\n//# sourceURL=../node_modules/multibase/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Implementation of the multicodec specification.\n *\n * @module multicodec\n * @example\n * const multicodec = require('multicodec')\n *\n * const prefixedProtobuf = multicodec.addPrefix('protobuf', protobufBuffer)\n * // prefixedProtobuf 0x50...\n *\n */\n\n\nconst varint = __webpack_require__(29)\nconst codecNameToCodeVarint = __webpack_require__(474)\nconst codeToCodecName = __webpack_require__(472)\nconst util = __webpack_require__(473)\n\nexports = module.exports\n\n/**\n * Prefix a buffer with a multicodec-packed.\n *\n * @param {string|number} multicodecStrOrCode\n * @param {Buffer} data\n * @returns {Buffer}\n */\nexports.addPrefix = (multicodecStrOrCode, data) => {\n  let prefix\n\n  if (Buffer.isBuffer(multicodecStrOrCode)) {\n    prefix = util.varintBufferEncode(multicodecStrOrCode)\n  } else {\n    if (codecNameToCodeVarint[multicodecStrOrCode]) {\n      prefix = codecNameToCodeVarint[multicodecStrOrCode]\n    } else {\n      throw new Error('multicodec not recognized')\n    }\n  }\n  return Buffer.concat([prefix, data])\n}\n\n/**\n * Decapsulate the multicodec-packed prefix from the data.\n *\n * @param {Buffer} data\n * @returns {Buffer}\n */\nexports.rmPrefix = (data) => {\n  varint.decode(data)\n  return data.slice(varint.decode.bytes)\n}\n\n/**\n * Get the codec of the prefixed data.\n * @param {Buffer} prefixedData\n * @returns {string}\n */\nexports.getCodec = (prefixedData) => {\n  const code = util.varintBufferDecode(prefixedData)\n  const codecName = codeToCodecName[code.toString('hex')]\n  if (codecName === undefined) {\n    throw new Error('Code `0x' + code.toString('hex') + '` not found')\n  }\n  return codecName\n}\n\n/**\n * Get the code as varint of a codec name.\n * @param {string} codecName\n * @returns {Buffer}\n */\nexports.getCodeVarint = (codecName) => {\n  const code = codecNameToCodeVarint[codecName]\n  if (code === undefined) {\n    throw new Error('Codec `' + codecName + '` not found')\n  }\n  return code\n}\n\n/**\n * Add a new codec\n * @param {string} name Name of the codec\n * @param {Buffer} code The code of the codec\n * @returns {void}\n */\nexports.addCodec = (name, code) => {\n  codecNameToCodeVarint[name] = util.varintBufferEncode(code)\n  codeToCodecName[code.toString('hex')] = name\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multicodec/src/index.js\n// module id = 1106\n// module chunks = 0\n\n//# sourceURL=../node_modules/multicodec/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst blake = __webpack_require__(648)\n\nconst toCallback = __webpack_require__(476).toCallback\n\nconst minB = 0xb201\nconst minS = 0xb241\n\nconst blake2b = {\n  init: blake.blake2bInit,\n  update: blake.blake2bUpdate,\n  digest: blake.blake2bFinal\n}\n\nconst blake2s = {\n  init: blake.blake2sInit,\n  update: blake.blake2sUpdate,\n  digest: blake.blake2sFinal\n}\n\nconst makeB2Hash = (size, hf) => toCallback((buf) => {\n  const ctx = hf.init(size, null)\n  hf.update(ctx, buf)\n  return Buffer.from(hf.digest(ctx))\n})\n\nmodule.exports = (table) => {\n  for (let i = 0; i < 64; i++) {\n    table[minB + i] = makeB2Hash(i + 1, blake2b)\n  }\n  for (let i = 0; i < 32; i++) {\n    table[minS + i] = makeB2Hash(i + 1, blake2s)\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashing-async/src/blake.js\n// module id = 1107\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashing-async/src/blake.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/* global self */\n\n\n\nconst nodeify = __webpack_require__(1134)\n\nconst webCrypto = getWebCrypto()\n\nfunction getWebCrypto () {\n  if (self.crypto) {\n    return self.crypto.subtle || self.crypto.webkitSubtle\n  }\n\n  if (self.msCrypto) {\n    return self.msCrypto.subtle\n  }\n}\n\nfunction webCryptoHash (type) {\n  if (!webCrypto) {\n    throw new Error('Please use a browser with webcrypto support')\n  }\n\n  return (data, callback) => {\n    const res = webCrypto.digest({ name: type }, data)\n\n    if (typeof res.then !== 'function') { // IE11\n      res.onerror = () => {\n        callback(new Error(`hashing data using ${type}`))\n      }\n      res.oncomplete = (e) => {\n        callback(null, e.target.result)\n      }\n      return\n    }\n\n    nodeify(\n      res.then((raw) => Buffer.from(new Uint8Array(raw))),\n      callback\n    )\n  }\n}\n\nfunction sha1 (buf, callback) {\n  webCryptoHash('SHA-1')(buf, callback)\n}\n\nfunction sha2256 (buf, callback) {\n  webCryptoHash('SHA-256')(buf, callback)\n}\n\nfunction sha2512 (buf, callback) {\n  webCryptoHash('SHA-512')(buf, callback)\n}\n\nmodule.exports = {\n  sha1: sha1,\n  sha2256: sha2256,\n  sha2512: sha2512\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashing-async/src/crypto-sha1-2-browser.js\n// module id = 1108\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashing-async/src/crypto-sha1-2-browser.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst sha3 = __webpack_require__(958)\nconst murmur3 = __webpack_require__(1122)\n\nconst utils = __webpack_require__(476)\nconst sha = __webpack_require__(1108)\n\nconst toCallback = utils.toCallback\nconst toBuf = utils.toBuf\nconst fromString = utils.fromString\nconst fromNumberTo32BitBuf = utils.fromNumberTo32BitBuf\n\nconst dblSha2256 = (buf, cb) => {\n  sha.sha2256(buf, (err, firstHash) => {\n    if (err) {\n      cb(err)\n    }\n    sha.sha2256((Buffer.from(firstHash)), cb)\n  })\n}\n\nmodule.exports = {\n  sha1: sha.sha1,\n  sha2256: sha.sha2256,\n  sha2512: sha.sha2512,\n  sha3512: toCallback(toBuf(sha3.sha3_512)),\n  sha3384: toCallback(toBuf(sha3.sha3_384)),\n  sha3256: toCallback(toBuf(sha3.sha3_256)),\n  sha3224: toCallback(toBuf(sha3.sha3_224)),\n  shake128: toCallback(toBuf(sha3.shake_128, 256)),\n  shake256: toCallback(toBuf(sha3.shake_256, 512)),\n  keccak224: toCallback(toBuf(sha3.keccak_224)),\n  keccak256: toCallback(toBuf(sha3.keccak_256)),\n  keccak384: toCallback(toBuf(sha3.keccak_384)),\n  keccak512: toCallback(toBuf(sha3.keccak_512)),\n  murmur3128: toCallback(toBuf(fromString(murmur3.x64.hash128))),\n  murmur332: toCallback(fromNumberTo32BitBuf(fromString(murmur3.x86.hash32))),\n  addBlake: __webpack_require__(1107),\n  dblSha2256: dblSha2256\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multihashing-async/src/crypto.js\n// module id = 1109\n// module chunks = 0\n\n//# sourceURL=../node_modules/multihashing-async/src/crypto.js")},function(module,exports,__webpack_require__){eval("\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = createDebug.debug = createDebug['default'] = createDebug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\nexports.humanize = __webpack_require__(471);\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n */\n\nexports.formatters = {};\n\n/**\n * Previous log timestamp.\n */\n\nvar prevTime;\n\n/**\n * Select a color.\n * @param {String} namespace\n * @return {Number}\n * @api private\n */\n\nfunction selectColor(namespace) {\n  var hash = 0, i;\n\n  for (i in namespace) {\n    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\n    hash |= 0; // Convert to 32bit integer\n  }\n\n  return exports.colors[Math.abs(hash) % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction createDebug(namespace) {\n\n  function debug() {\n    // disabled?\n    if (!debug.enabled) return;\n\n    var self = debug;\n\n    // set `diff` timestamp\n    var curr = +new Date();\n    var ms = curr - (prevTime || curr);\n    self.diff = ms;\n    self.prev = prevTime;\n    self.curr = curr;\n    prevTime = curr;\n\n    // turn the `arguments` into a proper Array\n    var args = new Array(arguments.length);\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i];\n    }\n\n    args[0] = exports.coerce(args[0]);\n\n    if ('string' !== typeof args[0]) {\n      // anything else let's inspect with %O\n      args.unshift('%O');\n    }\n\n    // apply any `formatters` transformations\n    var index = 0;\n    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\n      // if we encounter an escaped % then don't increase the array index\n      if (match === '%%') return match;\n      index++;\n      var formatter = exports.formatters[format];\n      if ('function' === typeof formatter) {\n        var val = args[index];\n        match = formatter.call(self, val);\n\n        // now we need to remove `args[index]` since it's inlined in the `format`\n        args.splice(index, 1);\n        index--;\n      }\n      return match;\n    });\n\n    // apply env-specific formatting (colors, etc.)\n    exports.formatArgs.call(self, args);\n\n    var logFn = debug.log || exports.log || console.log.bind(console);\n    logFn.apply(self, args);\n  }\n\n  debug.namespace = namespace;\n  debug.enabled = exports.enabled(namespace);\n  debug.useColors = exports.useColors();\n  debug.color = selectColor(namespace);\n\n  // env-specific initialization logic for debug instances\n  if ('function' === typeof exports.init) {\n    exports.init(debug);\n  }\n\n  return debug;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n  exports.save(namespaces);\n\n  exports.names = [];\n  exports.skips = [];\n\n  var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n  var len = split.length;\n\n  for (var i = 0; i < len; i++) {\n    if (!split[i]) continue; // ignore empty strings\n    namespaces = split[i].replace(/\\*/g, '.*?');\n    if (namespaces[0] === '-') {\n      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n    } else {\n      exports.names.push(new RegExp('^' + namespaces + '$'));\n    }\n  }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n  exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n  var i, len;\n  for (i = 0, len = exports.skips.length; i < len; i++) {\n    if (exports.skips[i].test(name)) {\n      return false;\n    }\n  }\n  for (i = 0, len = exports.names.length; i < len; i++) {\n    if (exports.names[i].test(name)) {\n      return true;\n    }\n  }\n  return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n  if (val instanceof Error) return val.stack || val.message;\n  return val;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/debug/src/debug.js\n// module id = 1110\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/debug/src/debug.js")},function(module,exports){eval("module.exports = read\n\nvar MSB = 0x80\n  , REST = 0x7F\n\nfunction read(buf, offset) {\n  var res    = 0\n    , offset = offset || 0\n    , shift  = 0\n    , counter = offset\n    , b\n    , l = buf.length\n\n  do {\n    if(counter >= l) {\n      read.bytes = 0\n      read.bytesRead = 0 // DEPRECATED\n      return undefined\n    }\n    b = buf[counter++]\n    res += shift < 28\n      ? (b & REST) << shift\n      : (b & REST) * Math.pow(2, shift)\n    shift += 7\n  } while (b >= MSB)\n\n  read.bytes = counter - offset\n\n  return res\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/varint/decode.js\n// module id = 1111\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/varint/decode.js")},function(module,exports){eval("module.exports = encode\n\nvar MSB = 0x80\n  , REST = 0x7F\n  , MSBALL = ~REST\n  , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n  out = out || []\n  offset = offset || 0\n  var oldOffset = offset\n\n  while(num >= INT) {\n    out[offset++] = (num & 0xFF) | MSB\n    num /= 128\n  }\n  while(num & MSBALL) {\n    out[offset++] = (num & 0xFF) | MSB\n    num >>>= 7\n  }\n  out[offset] = num | 0\n  \n  encode.bytes = offset - oldOffset + 1\n  \n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/varint/encode.js\n// module id = 1112\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/varint/encode.js")},function(module,exports,__webpack_require__){eval("module.exports = {\n    encode: __webpack_require__(1112)\n  , decode: __webpack_require__(1111)\n  , encodingLength: __webpack_require__(1114)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/varint/index.js\n// module id = 1113\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/varint/index.js")},function(module,exports){eval("\nvar N1 = Math.pow(2,  7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n  return (\n    value < N1 ? 1\n  : value < N2 ? 2\n  : value < N3 ? 3\n  : value < N4 ? 4\n  : value < N5 ? 5\n  : value < N6 ? 6\n  : value < N7 ? 7\n  : value < N8 ? 8\n  : value < N9 ? 9\n  :              10\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/~/varint/length.js\n// module id = 1114\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/node_modules/varint/length.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n/* @flow */\n\nconst EventEmitter = __webpack_require__(15).EventEmitter\nconst stream = __webpack_require__(81)\nconst debug = __webpack_require__(477)\n\n/* :: import type Multiplex from './index'\n\nexport type ChannelOpts = {\n  chunked?: bool,\n  halfOpen?: bool,\n  lazy?: bool\n}\n*/\n\nclass Channel extends stream.Duplex {\n  constructor (name/* : Buffer | string */, plex/* : Multiplex */, opts/* : ChannelOpts = {} */) {\n    const halfOpen = Boolean(opts.halfOpen)\n    super({\n      allowHalfOpen: halfOpen\n    })\n\n    this.name = name\n    this.log = debug('mplex:channel:' + this.name.toString())\n    this.channel = 0\n    this.initiator = false\n    this.chunked = Boolean(opts.chunked)\n    this.halfOpen = halfOpen\n    this.destroyed = false\n    this.finalized = false\n\n    this._multiplex = plex\n    this._dataHeader = 0\n    this._opened = false\n    this._awaitDrain = 0\n    this._lazy = Boolean(opts.lazy)\n\n    let finished = false\n    let ended = false\n    this.log('open, halfOpen: ' + this.halfOpen)\n\n    this.once('end', () => {\n      this.log('end')\n      this._read() // trigger drain\n\n      if (this.destroyed) {\n        return\n      }\n\n      ended = true\n      if (finished) {\n        this._finalize()\n      } else if (!this.halfOpen) {\n        this.end()\n      }\n    })\n\n    this.once('finish', function onfinish () {\n      if (this.destroyed) {\n        return\n      }\n\n      if (!this._opened) {\n        return this.once('open', onfinish)\n      }\n\n      if (this._lazy && this.initiator) {\n        this._open()\n      }\n\n      this._multiplex._send(\n        this.channel << 3 | (this.initiator ? 4 : 3),\n        null\n      )\n\n      finished = true\n\n      if (ended) {\n        this._finalize()\n      }\n    })\n  }\n\n  destroy (err/* : Error */) {\n    this._destroy(err, true)\n  }\n\n  _destroy (err/* : Error */, local/* : bool */) {\n    this.log('_destroy:' + (local ? 'local' : 'remote'))\n    if (this.destroyed) {\n      this.log('already destroyed')\n      return\n    }\n\n    this.destroyed = true\n\n    const hasErrorListeners = EventEmitter.listenerCount(this, 'error') > 0\n\n    if (err && (!local || hasErrorListeners)) {\n      this.emit('error', err)\n    }\n\n    this.emit('close')\n\n    if (local && this._opened) {\n      if (this._lazy && this.initiator) {\n        this._open()\n      }\n\n      const msg = err ? new Buffer(err.message) : null\n      try {\n        this._multiplex._send(\n          this.channel << 3 | (this.initiator ? 6 : 5),\n          msg\n        )\n      } catch (e) {}\n    }\n\n    this._finalize()\n  }\n\n  _finalize () {\n    if (this.finalized) {\n      return\n    }\n\n    this.finalized = true\n    this.emit('finalize')\n  }\n\n  _write (data/* : Buffer */, enc/* : string */, cb/* : () => void */) {\n    this.log('write: ', data.length)\n    if (!this._opened) {\n      this.once('open', () => {\n        this._write(data, enc, cb)\n      })\n      return\n    }\n\n    if (this.destroyed) {\n      cb()\n      return\n    }\n\n    if (this._lazy && this.initiator) {\n      this._open()\n    }\n\n    const drained = this._multiplex._send(\n      this._dataHeader,\n      data\n    )\n\n    if (drained) {\n      cb()\n      return\n    }\n\n    this._multiplex._ondrain.push(cb)\n  }\n\n  _read () {\n    if (this._awaitDrain) {\n      const drained = this._awaitDrain\n      this._awaitDrain = 0\n      this._multiplex._onchanneldrain(drained)\n    }\n  }\n\n  _open () {\n    let buf = null\n    if (Buffer.isBuffer(this.name)) {\n      buf = this.name\n    } else if (this.name !== this.channel.toString()) {\n      buf = new Buffer(this.name)\n    }\n\n    this._lazy = false\n    this._multiplex._send(this.channel << 3 | 0, buf)\n  }\n\n  open (channel/* : number */, initiator/* : bool */) {\n    this.log('open: ' + channel)\n    this.channel = channel\n    this.initiator = initiator\n    this._dataHeader = channel << 3 | (initiator ? 2 : 1)\n    this._opened = true\n    if (!this._lazy && this.initiator) this._open()\n    this.emit('open')\n  }\n}\n\nmodule.exports = Channel\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/src/channel.js\n// module id = 1115\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/src/channel.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n/* @flow */\n\nconst stream = __webpack_require__(81)\nconst varint = __webpack_require__(1113)\nconst duplexify = __webpack_require__(817)\nconst debug = __webpack_require__(477)\n\nconst Channel = __webpack_require__(1115)\n/* :: import type {ChannelOpts} from './channel' */\n\nconst SIGNAL_FLUSH = new Buffer([0])\n\nconst empty = new Buffer(0)\nlet pool = new Buffer(10 * 1024)\nlet used = 0\n\n/* ::\ntype MultiplexOpts = {\n  binaryName?: bool,\n  limit?: number,\n  initiator?: bool\n}\n\ntype ChannelCallback = (Channel) => void\n*/\n\nclass Multiplex extends stream.Duplex {\n  constructor (opts/* :: ?: MultiplexOpts | ChannelCallback */, onchannel /* :: ?: ChannelCallback */) {\n    super()\n    if (typeof opts === 'function') {\n      onchannel = opts\n      opts = {}\n    }\n\n    if (!opts) {\n      opts = {}\n    }\n\n    if (onchannel) {\n      this.on('stream', onchannel)\n    }\n\n    this.destroyed = false\n    this.limit = opts.limit || 0\n    if (opts.initiator == null) {\n      opts.initiator = true\n    }\n\n    this.initiator = opts.initiator\n\n    this._corked = 0\n    this._options = opts\n    this._binaryName = Boolean(opts.binaryName)\n    this._local = []\n    this._remote = []\n    this._list = this._local\n    this._receiving = null\n    this._chunked = false\n    this._state = 0\n    this._type = 0\n    this._channel = 0\n    this._missing = 0\n    this._message = null\n\n    this.log = debug('mplex:main:' + Math.floor(Math.random() * 100000))\n    this.log('construction')\n\n    let bufSize = 100\n    if (this.limit) {\n      bufSize = varint.encodingLength(this.limit)\n    }\n    this._buf = new Buffer(bufSize)\n    this._ptr = 0\n    this._awaitChannelDrains = 0\n    this._onwritedrain = null\n    this._ondrain = []\n    this._finished = false\n\n    this.once('finish', this._clear)\n\n    // setup id handling\n    this._nextId = this.initiator ? 0 : 1\n  }\n\n  // Generate the next stream id\n  _nextStreamId ()/* : number */ {\n    let id = this._nextId\n    this._nextId += 2\n    return id\n  }\n\n  createStream (name/* : Buffer | string */, opts/* : ChannelOpts */)/* : Channel */ {\n    if (this.destroyed) {\n      throw new Error('Multiplexer is destroyed')\n    }\n    const id = this._nextStreamId()\n    let channelName = this._name(name || id.toString())\n    const options = Object.assign(this._options, opts)\n    this.log('createStream: %s', id, channelName.toString(), options)\n\n    const channel = new Channel(channelName, this, options)\n    return this._addChannel(channel, id, this._local)\n  }\n\n  receiveStream (name/* : Buffer | string */, opts/* : ChannelOpts */)/* : Channel */ {\n    if (this.destroyed) {\n      throw new Error('Multiplexer is destroyed')\n    }\n\n    if (name === undefined || name === null) {\n      throw new Error('Name is needed when receiving a stream')\n    }\n\n    const channelName = this._name(name)\n    this.log('receiveStream: ' + channelName.toString())\n    const channel = new Channel(\n      channelName,\n      this,\n      Object.assign(this._options, opts)\n    )\n\n    if (!this._receiving) {\n      this._receiving = {}\n    }\n\n    if (this._receiving[channel.name]) {\n      throw new Error('You are already receiving this stream')\n    }\n\n    this._receiving[channel.name] = channel\n\n    return channel\n  }\n\n  createSharedStream (name/* : Buffer | string */, opts/* : ChannelOpts */)/* : stream.Duplex */ {\n    this.log('createSharedStream')\n    return duplexify(this.createStream(name, Object.assign(opts, {lazy: true})), this.receiveStream(name, opts))\n  }\n\n  _name (name/* : Buffer | string */)/* : Buffer | string */ {\n    if (!this._binaryName) {\n      return name.toString()\n    }\n    return Buffer.isBuffer(name) ? name : new Buffer(name)\n  }\n\n  _send (header/* : number */, data /* :: ?: Buffer */)/* : bool */ {\n    const len = data ? data.length : 0\n    const oldUsed = used\n    let drained = true\n\n    this.log('_send', header, len)\n\n    varint.encode(header, pool, used)\n    used += varint.encode.bytes\n    varint.encode(len, pool, used)\n    used += varint.encode.bytes\n\n    drained = this.push(pool.slice(oldUsed, used))\n\n    if (pool.length - used < 100) {\n      pool = new Buffer(10 * 1024)\n      used = 0\n    }\n\n    if (data) {\n      drained = this.push(data)\n    }\n\n    return drained\n  }\n\n  _addChannel (channel/* : Channel */, id/* : number */, list/* : Array<Channel|null> */)/* : Channel */ {\n    this.log('_addChannel', id)\n    list[id] = channel\n    channel.on('finalize', () => {\n      this.log('_remove channel', id)\n      list[id] = null\n    })\n    channel.open(id, list === this._local)\n\n    return channel\n  }\n\n  _writeVarint (data/* : Buffer */, offset/* : number */)/* : number */ {\n    for (offset; offset < data.length; offset++) {\n      if (this._ptr === this._buf.length) {\n        return this._lengthError(data)\n      }\n\n      this._buf[this._ptr++] = data[offset]\n\n      if (!(data[offset] & 0x80)) {\n        if (this._state === 0) {\n          const header = varint.decode(this._buf)\n          this._type = header & 7\n          this._channel = header >> 3\n          this._list = this._type & 1 ? this._local : this._remote\n          const chunked = this._list.length > this._channel &&\n                this._list[this._channel] &&\n                this._list[this._channel].chunked\n\n          this._chunked = !!(this._type === 1 || this._type === 2) && chunked\n        } else {\n          this._missing = varint.decode(this._buf)\n\n          if (this.limit && this._missing > this.limit) {\n            return this._lengthError(data)\n          }\n        }\n\n        this._state++\n        this._ptr = 0\n        return offset + 1\n      }\n    }\n\n    return data.length\n  }\n\n  _lengthError (data/* : Buffer */)/* : number */ {\n    this.destroy(new Error('Incoming message is too big'))\n    return data.length\n  }\n\n  _writeMessage (data/* : Buffer */, offset/* : number */)/* : number */ {\n    const free = data.length - offset\n    const missing = this._missing\n\n    if (!this._message) {\n      if (missing <= free) { // fast track - no copy\n        this._missing = 0\n        this._push(data.slice(offset, offset + missing))\n        return offset + missing\n      }\n      if (this._chunked) {\n        this._missing -= free\n        this._push(data.slice(offset, data.length))\n        return data.length\n      }\n      this._message = new Buffer(missing)\n    }\n\n    data.copy(this._message, this._ptr, offset, offset + missing)\n\n    if (missing <= free) {\n      this._missing = 0\n      this._push(this._message)\n      return offset + missing\n    }\n\n    this._missing -= free\n    this._ptr += free\n\n    return data.length\n  }\n\n  _push (data/* : Buffer */) {\n    this.log('_push', data.length)\n    if (!this._missing) {\n      this._ptr = 0\n      this._state = 0\n      this._message = null\n    }\n\n    if (this._type === 0) { // open\n      this.log('open', this._channel)\n      if (this.destroyed || this._finished) {\n        return\n      }\n\n      let name\n      if (this._binaryName) {\n        name = data\n      } else {\n        name = data.toString() || this._channel.toString()\n      }\n      this.log('open name', name)\n      let channel\n      if (this._receiving && this._receiving[name]) {\n        channel = this._receiving[name]\n        delete this._receiving[name]\n        this._addChannel(channel, this._channel, this._list)\n      } else {\n        channel = new Channel(name, this, this._options)\n        this.emit('stream', this._addChannel(\n          channel,\n          this._channel,\n          this._list), channel.name)\n      }\n      return\n    }\n\n    const stream = this._list[this._channel]\n    if (!stream) {\n      return\n    }\n\n    switch (this._type) {\n      case 5: // local error\n      case 6: // remote error\n        const error = new Error(data.toString() || 'Channel destroyed')\n        stream._destroy(error, false)\n        return\n\n      case 3: // local end\n      case 4: // remote end\n        stream.push(null)\n        return\n\n      case 1: // local packet\n      case 2: // remote packet\n        if (!stream.push(data)) {\n          this._awaitChannelDrains++\n          stream._awaitDrain++\n        }\n        return\n    }\n  }\n\n  _onchanneldrain (drained/* : number */) {\n    this._awaitChannelDrains -= drained\n\n    if (this._awaitChannelDrains) {\n      return\n    }\n\n    const ondrain = this._onwritedrain\n    this._onwritedrain = null\n\n    if (ondrain) {\n      ondrain()\n    }\n  }\n\n  _write (data/* : Buffer */, enc/* : string */, cb/* : () => void */) {\n    this.log('_write', data.length)\n    if (this._finished) {\n      cb()\n      return\n    }\n\n    if (this._corked) {\n      this._onuncork(this._write.bind(this, data, enc, cb))\n      return\n    }\n\n    if (data === SIGNAL_FLUSH) {\n      this._finish(cb)\n      return\n    }\n\n    let offset = 0\n    while (offset < data.length) {\n      if (this._state === 2) {\n        offset = this._writeMessage(data, offset)\n      } else {\n        offset = this._writeVarint(data, offset)\n      }\n    }\n\n    if (this._state === 2 && !this._missing) {\n      this._push(empty)\n    }\n\n    if (this._awaitChannelDrains) {\n      this._onwritedrain = cb\n    } else {\n      cb()\n    }\n  }\n\n  _finish (cb/* : () => void */) {\n    this._onuncork(() => {\n      if (this._writableState.prefinished === false) {\n        this._writableState.prefinished = true\n      }\n      this.emit('prefinish')\n      this._onuncork(cb)\n    })\n  }\n\n  cork () {\n    if (++this._corked === 1) {\n      this.emit('cork')\n    }\n  }\n\n  uncork () {\n    if (this._corked && --this._corked === 0) {\n      this.emit('uncork')\n    }\n  }\n\n  end (data/* :: ?: Buffer | () => void */, enc/* :: ?: string | () => void */, cb/* :: ?: () => void */) {\n    this.log('end')\n    if (typeof data === 'function') {\n      cb = data\n      data = undefined\n    }\n    if (typeof enc === 'function') {\n      cb = enc\n      enc = undefined\n    }\n\n    if (data) {\n      this.write(data)\n    }\n\n    if (!this._writableState.ending) {\n      this.write(SIGNAL_FLUSH)\n    }\n\n    return stream.Writable.prototype.end.call(this, cb)\n  }\n\n  _onuncork (fn/* : () => void */) {\n    if (this._corked) {\n      this.once('uncork', fn)\n      return\n    }\n\n    fn()\n  }\n\n  _read () {\n    while (this._ondrain.length) {\n      this._ondrain.shift()()\n    }\n  }\n\n  _clear () {\n    this.log('_clear')\n    if (this._finished) {\n      return\n    }\n\n    this._finished = true\n\n    const list = this._local.concat(this._remote)\n\n    this._local = []\n    this._remote = []\n\n    list.forEach(function (stream) {\n      if (stream) {\n        stream._destroy(null, false)\n      }\n    })\n\n    this.push(null)\n  }\n\n  finalize () {\n    this._clear()\n  }\n\n  destroy (err/* :: ?: Error */) {\n    this.log('destroy')\n    if (this.destroyed) {\n      this.log('already destroyed')\n      return\n    }\n\n    var list = this._local.concat(this._remote)\n\n    this.destroyed = true\n\n    if (err) {\n      this.emit('error', err)\n    }\n    this.emit('close')\n\n    list.forEach(function (stream) {\n      if (stream) {\n        stream.emit('error', err || new Error('underlying socket has been closed'))\n      }\n    })\n\n    this._clear()\n  }\n}\n\nmodule.exports = Multiplex\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multiplex/src/index.js\n// module id = 1116\n// module chunks = 0\n\n//# sourceURL=../node_modules/multiplex/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst varint = __webpack_require__(29)\nconst pull = __webpack_require__(6)\nconst pullLP = __webpack_require__(45)\nconst Connection = __webpack_require__(39).Connection\nconst util = __webpack_require__(196)\nconst select = __webpack_require__(480)\nconst once = __webpack_require__(53)\n\nconst PROTOCOL_ID = __webpack_require__(478).PROTOCOL_ID\n\n/**\n *\n */\nclass Dialer {\n  /**\n   * Create a new Dialer.\n   */\n  constructor () {\n    this.conn = null\n    this.log = util.log.dialer()\n  }\n\n  /**\n   * Perform the multistream handshake.\n   *\n   * @param {Connection} rawConn - The connection on which\n   * to perform the handshake.\n   * @param {function(Error)} callback - Called when the handshake completed.\n   * @returns {undefined}\n   */\n  handle (rawConn, callback) {\n    this.log('dialer handle conn')\n    callback = once(callback)\n    const s = select(PROTOCOL_ID, (err, conn) => {\n      if (err) {\n        return callback(err)\n      }\n      this.log('handshake success')\n\n      this.conn = new Connection(conn, rawConn)\n\n      callback()\n    }, this.log)\n\n    pull(\n      rawConn,\n      s,\n      rawConn\n    )\n  }\n\n  /**\n   * Select a protocol\n   *\n   * @param {string} protocol - A string of the protocol that we want to handshake.\n   * @param {function(Error, Connection)} callback - `err` is\n   * an error object that gets passed if something wrong happ\n   * end (e.g: if the protocol selected is not supported by\n   * the other end) and conn is the connection handshaked\n   * with the other end.\n   *\n   * @returns {undefined}\n   */\n  select (protocol, callback) {\n    this.log('dialer select ' + protocol)\n    callback = once(callback)\n    if (!this.conn) {\n      return callback(new Error('multistream handshake has not finalized yet'))\n    }\n\n    const s = select(protocol, (err, conn) => {\n      if (err) {\n        this.conn = new Connection(conn, this.conn)\n        return callback(err)\n      }\n      callback(null, new Connection(conn, this.conn))\n    }, this.log)\n\n    pull(\n      this.conn,\n      s,\n      this.conn\n    )\n  }\n\n  /**\n   * List all available protocols.\n   *\n   * @param {function(Error, Array<string>)} callback - If\n   * something wrong happend `Error` exists, otherwise\n   * `protocols` is a list of the supported\n   * protocols on the other end.\n   *\n   * @returns {undefined}\n   */\n  ls (callback) {\n    callback = once(callback)\n\n    const lsStream = select('ls', (err, conn) => {\n      if (err) {\n        return callback(err)\n      }\n\n      pull(\n        conn,\n        pullLP.decode(),\n        collectLs(conn),\n        pull.map(stringify),\n        pull.collect((err, list) => {\n          if (err) {\n            return callback(err)\n          }\n          callback(null, list.slice(1))\n        })\n      )\n    }, this.log)\n\n    pull(\n      this.conn,\n      lsStream,\n      this.conn\n    )\n  }\n}\n\nfunction stringify (buf) {\n  return buf.toString().slice(0, -1)\n}\n\nfunction collectLs (conn) {\n  let first = true\n  let counter = 0\n\n  return pull.take((msg) => {\n    if (first) {\n      varint.decode(msg)\n      counter = varint.decode(msg, varint.decode.bytes)\n      return true\n    }\n\n    return counter-- > 0\n  })\n}\n\nmodule.exports = Dialer\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/dialer/index.js\n// module id = 1117\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/dialer/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst pull = __webpack_require__(6)\nconst isFunction = __webpack_require__(457)\nconst assert = __webpack_require__(16)\nconst select = __webpack_require__(480)\nconst selectHandler = __webpack_require__(1121)\nconst lsHandler = __webpack_require__(1119)\nconst matchExact = __webpack_require__(479)\n\nconst util = __webpack_require__(196)\nconst Connection = __webpack_require__(39).Connection\n\nconst PROTOCOL_ID = __webpack_require__(478).PROTOCOL_ID\n\n/**\n * Listener\n */\nclass Listener {\n  /**\n   * Create a new Listener.\n   */\n  constructor () {\n    this.handlers = {\n      ls: {\n        handlerFunc: (protocol, conn) => lsHandler(this, conn),\n        matchFunc: matchExact\n\n      }\n    }\n    this.log = util.log.listener()\n  }\n\n  /**\n   * Perform the multistream handshake.\n   *\n   * @param {Connection} rawConn - The connection on which\n   * to perform the handshake.\n   * @param {function(Error)} callback - Called when the handshake completed.\n   * @returns {undefined}\n   */\n  handle (rawConn, callback) {\n    this.log('listener handle conn')\n\n    const selectStream = select(PROTOCOL_ID, (err, conn) => {\n      if (err) {\n        return callback(err)\n      }\n\n      const shConn = new Connection(conn, rawConn)\n\n      const sh = selectHandler(shConn, this.handlers, this.log)\n\n      pull(\n        shConn,\n        sh,\n        shConn\n      )\n\n      callback()\n    }, this.log)\n\n    pull(\n      rawConn,\n      selectStream,\n      rawConn\n    )\n  }\n\n  /**\n   * Handle a given `protocol`.\n   *\n   * @param {string} protocol - A string identifying the protocol.\n   * @param {function(string, Connection)} handlerFunc - Will be called if there is a handshake performed on `protocol`.\n   * @param {matchHandler} [matchFunc=matchExact]\n   * @returns {undefined}\n   */\n  addHandler (protocol, handlerFunc, matchFunc) {\n    this.log('adding handler: ' + protocol)\n    assert(isFunction(handlerFunc), 'handler must be a function')\n\n    if (this.handlers[protocol]) {\n      this.log('overwriting handler for ' + protocol)\n    }\n\n    if (!matchFunc) {\n      matchFunc = matchExact\n    }\n\n    this.handlers[protocol] = {\n      handlerFunc: handlerFunc,\n      matchFunc: matchFunc\n    }\n  }\n\n  /**\n   * Receives a protocol and a callback and should\n   * call `callback(err, result)` where `err` is if\n   * there was a error on the matching function, and\n   * `result` is a boolean that represents if a\n   * match happened.\n   *\n   * @callback matchHandler\n   * @param {string} myProtocol\n   * @param {string} senderProtocol\n   * @param {function(Error, boolean)} callback\n   * @returns {undefined}\n   */\n}\n\nmodule.exports = Listener\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/listener/index.js\n// module id = 1118\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/listener/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst pull = __webpack_require__(6)\nconst pullLP = __webpack_require__(45)\nconst varint = __webpack_require__(29)\n\nfunction lsHandler (self, conn) {\n  const protos = Object.keys(self.handlers).filter((key) => key !== 'ls')\n\n  const nProtos = protos.length\n  // total size of the list of protocols, including varint and newline\n  const size = protos.reduce((size, proto) => {\n    const p = Buffer.from(proto + '\\n')\n    const el = varint.encodingLength(p.length)\n    return size + el\n  }, 0)\n\n  const buf = Buffer.concat([\n    Buffer.from(varint.encode(nProtos)),\n    Buffer.from(varint.encode(size)),\n    Buffer.from('\\n')\n  ])\n\n  const encodedProtos = protos.map((proto) => {\n    return Buffer.from(proto + '\\n')\n  })\n  const values = [buf].concat(encodedProtos)\n\n  pull(\n    pull.values(values),\n    pullLP.encode(),\n    conn\n  )\n}\n\nmodule.exports = lsHandler\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/listener/ls-handler.js\n// module id = 1119\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/listener/ls-handler.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst semver = __webpack_require__(1230)\n\n/**\n * Match protocols using semver `~` matching.\n *\n * @param {string} myProtocol\n * @param {string} senderProtocol\n * @param {function(Error, boolean)} callback\n * @returns {undefined}\n * @type {matchHandler}\n */\nfunction matchSemver (myProtocol, senderProtocol, callback) {\n  const mps = myProtocol.split('/')\n  const sps = senderProtocol.split('/')\n  const myName = mps[1]\n  const myVersion = mps[2]\n\n  const senderName = sps[1]\n  const senderVersion = sps[2]\n\n  if (myName !== senderName) {\n    return callback(null, false)\n  }\n  // does my protocol satisfy the sender?\n  const valid = semver.satisfies(myVersion, '~' + senderVersion)\n\n  callback(null, valid)\n}\n\nmodule.exports = matchSemver\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/listener/match-semver.js\n// module id = 1120\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/listener/match-semver.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst handshake = __webpack_require__(102)\nconst lp = __webpack_require__(45)\nconst Connection = __webpack_require__(39).Connection\nconst writeEncoded = __webpack_require__(196).writeEncoded\nconst some = __webpack_require__(601)\n\nfunction selectHandler (rawConn, handlersMap, log) {\n  const cb = (err) => {\n    // incoming errors are irrelevant for the app\n    log.error(err)\n  }\n\n  const stream = handshake({ timeout: 60 * 1000 }, cb)\n  const shake = stream.handshake\n\n  next()\n  return stream\n\n  function next () {\n    lp.decodeFromReader(shake, (err, data) => {\n      if (err) {\n        return cb(err)\n      }\n      log('received:', data.toString())\n      const protocol = data.toString().slice(0, -1)\n\n      matcher(protocol, handlersMap, (err, result) => {\n        if (err) {\n          return cb(err)\n        }\n        const key = result\n\n        if (key) {\n          log('send ack back of: ' + protocol)\n          writeEncoded(shake, data, cb)\n\n          const conn = new Connection(shake.rest(), rawConn)\n          handlersMap[key].handlerFunc(protocol, conn)\n        } else {\n          log('not supported protocol: ' + protocol)\n          writeEncoded(shake, Buffer.from('na\\n'))\n          next()\n        }\n      })\n    })\n  }\n}\n\nfunction matcher (protocol, handlers, callback) {\n  const supportedProtocols = Object.keys(handlers)\n  let supportedProtocol = false\n\n  some(supportedProtocols,\n    (sp, cb) => {\n      handlers[sp].matchFunc(sp, protocol, (err, result) => {\n        if (err) {\n          return cb(err)\n        }\n        if (result) {\n          supportedProtocol = sp\n        }\n        cb()\n      })\n    },\n    (err) => {\n      if (err) {\n        return callback(err)\n      }\n      callback(null, supportedProtocol)\n    }\n  )\n}\n\nmodule.exports = selectHandler\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/multistream-select/src/listener/select-handler.js\n// module id = 1121\n// module chunks = 0\n\n//# sourceURL=../node_modules/multistream-select/src/listener/select-handler.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1123);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/murmurhash3js/index.js\n// module id = 1122\n// module chunks = 0\n\n//# sourceURL=../node_modules/murmurhash3js/index.js")},function(module,exports,__webpack_require__){eval("/* jshint -W086: true */\n// +----------------------------------------------------------------------+\n// | murmurHash3js.js v3.0.1 // https://github.com/pid/murmurHash3js\n// | A javascript implementation of MurmurHash3's x86 hashing algorithms. |\n// |----------------------------------------------------------------------|\n// | Copyright (c) 2012-2015 Karan Lyons                                       |\n// | https://github.com/karanlyons/murmurHash3.js/blob/c1778f75792abef7bdd74bc85d2d4e1a3d25cfe9/murmurHash3.js |\n// | Freely distributable under the MIT license.                          |\n// +----------------------------------------------------------------------+\n\n;(function (root, undefined) {\n    'use strict';\n\n    // Create a local object that'll be exported or referenced globally.\n    var library = {\n        'version': '3.0.1',\n        'x86': {},\n        'x64': {}\n    };\n\n    // PRIVATE FUNCTIONS\n    // -----------------\n\n    function _x86Multiply(m, n) {\n        //\n        // Given two 32bit ints, returns the two multiplied together as a\n        // 32bit int.\n        //\n\n        return ((m & 0xffff) * n) + ((((m >>> 16) * n) & 0xffff) << 16);\n    }\n\n    function _x86Rotl(m, n) {\n        //\n        // Given a 32bit int and an int representing a number of bit positions,\n        // returns the 32bit int rotated left by that number of positions.\n        //\n\n        return (m << n) | (m >>> (32 - n));\n    }\n\n    function _x86Fmix(h) {\n        //\n        // Given a block, returns murmurHash3's final x86 mix of that block.\n        //\n\n        h ^= h >>> 16;\n        h = _x86Multiply(h, 0x85ebca6b);\n        h ^= h >>> 13;\n        h = _x86Multiply(h, 0xc2b2ae35);\n        h ^= h >>> 16;\n\n        return h;\n    }\n\n    function _x64Add(m, n) {\n        //\n        // Given two 64bit ints (as an array of two 32bit ints) returns the two\n        // added together as a 64bit int (as an array of two 32bit ints).\n        //\n\n        m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n        n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n        var o = [0, 0, 0, 0];\n\n        o[3] += m[3] + n[3];\n        o[2] += o[3] >>> 16;\n        o[3] &= 0xffff;\n\n        o[2] += m[2] + n[2];\n        o[1] += o[2] >>> 16;\n        o[2] &= 0xffff;\n\n        o[1] += m[1] + n[1];\n        o[0] += o[1] >>> 16;\n        o[1] &= 0xffff;\n\n        o[0] += m[0] + n[0];\n        o[0] &= 0xffff;\n\n        return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n    }\n\n    function _x64Multiply(m, n) {\n        //\n        // Given two 64bit ints (as an array of two 32bit ints) returns the two\n        // multiplied together as a 64bit int (as an array of two 32bit ints).\n        //\n\n        m = [m[0] >>> 16, m[0] & 0xffff, m[1] >>> 16, m[1] & 0xffff];\n        n = [n[0] >>> 16, n[0] & 0xffff, n[1] >>> 16, n[1] & 0xffff];\n        var o = [0, 0, 0, 0];\n\n        o[3] += m[3] * n[3];\n        o[2] += o[3] >>> 16;\n        o[3] &= 0xffff;\n\n        o[2] += m[2] * n[3];\n        o[1] += o[2] >>> 16;\n        o[2] &= 0xffff;\n\n        o[2] += m[3] * n[2];\n        o[1] += o[2] >>> 16;\n        o[2] &= 0xffff;\n\n        o[1] += m[1] * n[3];\n        o[0] += o[1] >>> 16;\n        o[1] &= 0xffff;\n\n        o[1] += m[2] * n[2];\n        o[0] += o[1] >>> 16;\n        o[1] &= 0xffff;\n\n        o[1] += m[3] * n[1];\n        o[0] += o[1] >>> 16;\n        o[1] &= 0xffff;\n\n        o[0] += (m[0] * n[3]) + (m[1] * n[2]) + (m[2] * n[1]) + (m[3] * n[0]);\n        o[0] &= 0xffff;\n\n        return [(o[0] << 16) | o[1], (o[2] << 16) | o[3]];\n    }\n\n    function _x64Rotl(m, n) {\n        //\n        // Given a 64bit int (as an array of two 32bit ints) and an int\n        // representing a number of bit positions, returns the 64bit int (as an\n        // array of two 32bit ints) rotated left by that number of positions.\n        //\n\n        n %= 64;\n\n        if (n === 32) {\n            return [m[1], m[0]];\n        } else if (n < 32) {\n            return [(m[0] << n) | (m[1] >>> (32 - n)), (m[1] << n) | (m[0] >>> (32 - n))];\n        } else {\n            n -= 32;\n            return [(m[1] << n) | (m[0] >>> (32 - n)), (m[0] << n) | (m[1] >>> (32 - n))];\n        }\n    }\n\n    function _x64LeftShift(m, n) {\n        //\n        // Given a 64bit int (as an array of two 32bit ints) and an int\n        // representing a number of bit positions, returns the 64bit int (as an\n        // array of two 32bit ints) shifted left by that number of positions.\n        //\n\n        n %= 64;\n\n        if (n === 0) {\n            return m;\n        } else if (n < 32) {\n            return [(m[0] << n) | (m[1] >>> (32 - n)), m[1] << n];\n        } else {\n            return [m[1] << (n - 32), 0];\n        }\n    }\n\n    function _x64Xor(m, n) {\n        //\n        // Given two 64bit ints (as an array of two 32bit ints) returns the two\n        // xored together as a 64bit int (as an array of two 32bit ints).\n        //\n\n        return [m[0] ^ n[0], m[1] ^ n[1]];\n    }\n\n    function _x64Fmix(h) {\n        //\n        // Given a block, returns murmurHash3's final x64 mix of that block.\n        // (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the\n        // only place where we need to right shift 64bit ints.)\n        //\n\n        h = _x64Xor(h, [0, h[0] >>> 1]);\n        h = _x64Multiply(h, [0xff51afd7, 0xed558ccd]);\n        h = _x64Xor(h, [0, h[0] >>> 1]);\n        h = _x64Multiply(h, [0xc4ceb9fe, 0x1a85ec53]);\n        h = _x64Xor(h, [0, h[0] >>> 1]);\n\n        return h;\n    }\n\n    // PUBLIC FUNCTIONS\n    // ----------------\n\n    library.x86.hash32 = function (key, seed) {\n        //\n        // Given a string and an optional seed as an int, returns a 32 bit hash\n        // using the x86 flavor of MurmurHash3, as an unsigned int.\n        //\n\n        key = key || '';\n        seed = seed || 0;\n\n        var remainder = key.length % 4;\n        var bytes = key.length - remainder;\n\n        var h1 = seed;\n\n        var k1 = 0;\n\n        var c1 = 0xcc9e2d51;\n        var c2 = 0x1b873593;\n\n        for (var i = 0; i < bytes; i = i + 4) {\n            k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);\n\n            k1 = _x86Multiply(k1, c1);\n            k1 = _x86Rotl(k1, 15);\n            k1 = _x86Multiply(k1, c2);\n\n            h1 ^= k1;\n            h1 = _x86Rotl(h1, 13);\n            h1 = _x86Multiply(h1, 5) + 0xe6546b64;\n        }\n\n        k1 = 0;\n\n        switch (remainder) {\n            case 3:\n                k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n\n            case 2:\n                k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n\n            case 1:\n                k1 ^= (key.charCodeAt(i) & 0xff);\n                k1 = _x86Multiply(k1, c1);\n                k1 = _x86Rotl(k1, 15);\n                k1 = _x86Multiply(k1, c2);\n                h1 ^= k1;\n        }\n\n        h1 ^= key.length;\n        h1 = _x86Fmix(h1);\n\n        return h1 >>> 0;\n    };\n\n    library.x86.hash128 = function (key, seed) {\n        //\n        // Given a string and an optional seed as an int, returns a 128 bit\n        // hash using the x86 flavor of MurmurHash3, as an unsigned hex.\n        //\n\n        key = key || '';\n        seed = seed || 0;\n\n        var remainder = key.length % 16;\n        var bytes = key.length - remainder;\n\n        var h1 = seed;\n        var h2 = seed;\n        var h3 = seed;\n        var h4 = seed;\n\n        var k1 = 0;\n        var k2 = 0;\n        var k3 = 0;\n        var k4 = 0;\n\n        var c1 = 0x239b961b;\n        var c2 = 0xab0e9789;\n        var c3 = 0x38b34ae5;\n        var c4 = 0xa1e38b93;\n\n        for (var i = 0; i < bytes; i = i + 16) {\n            k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);\n            k2 = ((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24);\n            k3 = ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24);\n            k4 = ((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24);\n\n            k1 = _x86Multiply(k1, c1);\n            k1 = _x86Rotl(k1, 15);\n            k1 = _x86Multiply(k1, c2);\n            h1 ^= k1;\n\n            h1 = _x86Rotl(h1, 19);\n            h1 += h2;\n            h1 = _x86Multiply(h1, 5) + 0x561ccd1b;\n\n            k2 = _x86Multiply(k2, c2);\n            k2 = _x86Rotl(k2, 16);\n            k2 = _x86Multiply(k2, c3);\n            h2 ^= k2;\n\n            h2 = _x86Rotl(h2, 17);\n            h2 += h3;\n            h2 = _x86Multiply(h2, 5) + 0x0bcaa747;\n\n            k3 = _x86Multiply(k3, c3);\n            k3 = _x86Rotl(k3, 17);\n            k3 = _x86Multiply(k3, c4);\n            h3 ^= k3;\n\n            h3 = _x86Rotl(h3, 15);\n            h3 += h4;\n            h3 = _x86Multiply(h3, 5) + 0x96cd1c35;\n\n            k4 = _x86Multiply(k4, c4);\n            k4 = _x86Rotl(k4, 18);\n            k4 = _x86Multiply(k4, c1);\n            h4 ^= k4;\n\n            h4 = _x86Rotl(h4, 13);\n            h4 += h1;\n            h4 = _x86Multiply(h4, 5) + 0x32ac3b17;\n        }\n\n        k1 = 0;\n        k2 = 0;\n        k3 = 0;\n        k4 = 0;\n\n        switch (remainder) {\n            case 15:\n                k4 ^= key.charCodeAt(i + 14) << 16;\n\n            case 14:\n                k4 ^= key.charCodeAt(i + 13) << 8;\n\n            case 13:\n                k4 ^= key.charCodeAt(i + 12);\n                k4 = _x86Multiply(k4, c4);\n                k4 = _x86Rotl(k4, 18);\n                k4 = _x86Multiply(k4, c1);\n                h4 ^= k4;\n\n            case 12:\n                k3 ^= key.charCodeAt(i + 11) << 24;\n\n            case 11:\n                k3 ^= key.charCodeAt(i + 10) << 16;\n\n            case 10:\n                k3 ^= key.charCodeAt(i + 9) << 8;\n\n            case 9:\n                k3 ^= key.charCodeAt(i + 8);\n                k3 = _x86Multiply(k3, c3);\n                k3 = _x86Rotl(k3, 17);\n                k3 = _x86Multiply(k3, c4);\n                h3 ^= k3;\n\n            case 8:\n                k2 ^= key.charCodeAt(i + 7) << 24;\n\n            case 7:\n                k2 ^= key.charCodeAt(i + 6) << 16;\n\n            case 6:\n                k2 ^= key.charCodeAt(i + 5) << 8;\n\n            case 5:\n                k2 ^= key.charCodeAt(i + 4);\n                k2 = _x86Multiply(k2, c2);\n                k2 = _x86Rotl(k2, 16);\n                k2 = _x86Multiply(k2, c3);\n                h2 ^= k2;\n\n            case 4:\n                k1 ^= key.charCodeAt(i + 3) << 24;\n\n            case 3:\n                k1 ^= key.charCodeAt(i + 2) << 16;\n\n            case 2:\n                k1 ^= key.charCodeAt(i + 1) << 8;\n\n            case 1:\n                k1 ^= key.charCodeAt(i);\n                k1 = _x86Multiply(k1, c1);\n                k1 = _x86Rotl(k1, 15);\n                k1 = _x86Multiply(k1, c2);\n                h1 ^= k1;\n        }\n\n        h1 ^= key.length;\n        h2 ^= key.length;\n        h3 ^= key.length;\n        h4 ^= key.length;\n\n        h1 += h2;\n        h1 += h3;\n        h1 += h4;\n        h2 += h1;\n        h3 += h1;\n        h4 += h1;\n\n        h1 = _x86Fmix(h1);\n        h2 = _x86Fmix(h2);\n        h3 = _x86Fmix(h3);\n        h4 = _x86Fmix(h4);\n\n        h1 += h2;\n        h1 += h3;\n        h1 += h4;\n        h2 += h1;\n        h3 += h1;\n        h4 += h1;\n\n        return (\"00000000\" + (h1 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h3 >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h4 >>> 0).toString(16)).slice(-8);\n    };\n\n    library.x64.hash128 = function (key, seed) {\n        //\n        // Given a string and an optional seed as an int, returns a 128 bit\n        // hash using the x64 flavor of MurmurHash3, as an unsigned hex.\n        //\n\n        key = key || '';\n        seed = seed || 0;\n\n        var remainder = key.length % 16;\n        var bytes = key.length - remainder;\n\n        var h1 = [0, seed];\n        var h2 = [0, seed];\n\n        var k1 = [0, 0];\n        var k2 = [0, 0];\n\n        var c1 = [0x87c37b91, 0x114253d5];\n        var c2 = [0x4cf5ad43, 0x2745937f];\n\n        for (var i = 0; i < bytes; i = i + 16) {\n            k1 = [((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24), ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) &\n                0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24)];\n            k2 = [((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24), ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i +\n                9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24)];\n\n            k1 = _x64Multiply(k1, c1);\n            k1 = _x64Rotl(k1, 31);\n            k1 = _x64Multiply(k1, c2);\n            h1 = _x64Xor(h1, k1);\n\n            h1 = _x64Rotl(h1, 27);\n            h1 = _x64Add(h1, h2);\n            h1 = _x64Add(_x64Multiply(h1, [0, 5]), [0, 0x52dce729]);\n\n            k2 = _x64Multiply(k2, c2);\n            k2 = _x64Rotl(k2, 33);\n            k2 = _x64Multiply(k2, c1);\n            h2 = _x64Xor(h2, k2);\n\n            h2 = _x64Rotl(h2, 31);\n            h2 = _x64Add(h2, h1);\n            h2 = _x64Add(_x64Multiply(h2, [0, 5]), [0, 0x38495ab5]);\n        }\n\n        k1 = [0, 0];\n        k2 = [0, 0];\n\n        switch (remainder) {\n            case 15:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 14)], 48));\n\n            case 14:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 13)], 40));\n\n            case 13:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 12)], 32));\n\n            case 12:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 11)], 24));\n\n            case 11:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 10)], 16));\n\n            case 10:\n                k2 = _x64Xor(k2, _x64LeftShift([0, key.charCodeAt(i + 9)], 8));\n\n            case 9:\n                k2 = _x64Xor(k2, [0, key.charCodeAt(i + 8)]);\n                k2 = _x64Multiply(k2, c2);\n                k2 = _x64Rotl(k2, 33);\n                k2 = _x64Multiply(k2, c1);\n                h2 = _x64Xor(h2, k2);\n\n            case 8:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 7)], 56));\n\n            case 7:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 6)], 48));\n\n            case 6:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 5)], 40));\n\n            case 5:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 4)], 32));\n\n            case 4:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 3)], 24));\n\n            case 3:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 2)], 16));\n\n            case 2:\n                k1 = _x64Xor(k1, _x64LeftShift([0, key.charCodeAt(i + 1)], 8));\n\n            case 1:\n                k1 = _x64Xor(k1, [0, key.charCodeAt(i)]);\n                k1 = _x64Multiply(k1, c1);\n                k1 = _x64Rotl(k1, 31);\n                k1 = _x64Multiply(k1, c2);\n                h1 = _x64Xor(h1, k1);\n        }\n\n        h1 = _x64Xor(h1, [0, key.length]);\n        h2 = _x64Xor(h2, [0, key.length]);\n\n        h1 = _x64Add(h1, h2);\n        h2 = _x64Add(h2, h1);\n\n        h1 = _x64Fmix(h1);\n        h2 = _x64Fmix(h2);\n\n        h1 = _x64Add(h1, h2);\n        h2 = _x64Add(h2, h1);\n\n        return (\"00000000\" + (h1[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h1[1] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[0] >>> 0).toString(16)).slice(-8) + (\"00000000\" + (h2[1] >>> 0).toString(16)).slice(-8);\n    };\n\n    // INITIALIZATION\n    // --------------\n\n    // Export murmurHash3 for CommonJS, either as an AMD module or just as part\n    // of the global object.\n    if (true) {\n\n        if (typeof module !== 'undefined' && module.exports) {\n            exports = module.exports = library;\n        }\n\n        exports.murmurHash3 = library;\n\n    } else if (typeof define === 'function' && define.amd) {\n\n        define([], function () {\n            return library;\n        });\n    } else {\n\n        // Use murmurHash3.noConflict to restore `murmurHash3` back to its\n        // original value. Returns a reference to the library object, to allow\n        // it to be used under a different name.\n        library._murmurHash3 = root.murmurHash3;\n\n        library.noConflict = function () {\n            root.murmurHash3 = library._murmurHash3;\n            library._murmurHash3 = undefined;\n            library.noConflict = undefined;\n\n            return library;\n        };\n\n        root.murmurHash3 = library;\n    }\n})(this);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/murmurhash3js/lib/murmurHash3js.js\n// module id = 1123\n// module chunks = 0\n\n//# sourceURL=../node_modules/murmurhash3js/lib/murmurHash3js.js")},function(module,exports,__webpack_require__){eval("/**\n * A Javascript implementation of AES Cipher Suites for TLS.\n *\n * @author Dave Longley\n *\n * Copyright (c) 2009-2015 Digital Bazaar, Inc.\n *\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(495);\n\nvar tls = module.exports = forge.tls;\n\n/**\n * Supported cipher suites.\n */\ntls.CipherSuites['TLS_RSA_WITH_AES_128_CBC_SHA'] = {\n  id: [0x00,0x2f],\n  name: 'TLS_RSA_WITH_AES_128_CBC_SHA',\n  initSecurityParameters: function(sp) {\n    sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes;\n    sp.cipher_type = tls.CipherType.block;\n    sp.enc_key_length = 16;\n    sp.block_length = 16;\n    sp.fixed_iv_length = 16;\n    sp.record_iv_length = 16;\n    sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1;\n    sp.mac_length = 20;\n    sp.mac_key_length = 20;\n  },\n  initConnectionState: initConnectionState\n};\ntls.CipherSuites['TLS_RSA_WITH_AES_256_CBC_SHA'] = {\n  id: [0x00,0x35],\n  name: 'TLS_RSA_WITH_AES_256_CBC_SHA',\n  initSecurityParameters: function(sp) {\n    sp.bulk_cipher_algorithm = tls.BulkCipherAlgorithm.aes;\n    sp.cipher_type = tls.CipherType.block;\n    sp.enc_key_length = 32;\n    sp.block_length = 16;\n    sp.fixed_iv_length = 16;\n    sp.record_iv_length = 16;\n    sp.mac_algorithm = tls.MACAlgorithm.hmac_sha1;\n    sp.mac_length = 20;\n    sp.mac_key_length = 20;\n  },\n  initConnectionState: initConnectionState\n};\n\nfunction initConnectionState(state, c, sp) {\n  var client = (c.entity === forge.tls.ConnectionEnd.client);\n\n  // cipher setup\n  state.read.cipherState = {\n    init: false,\n    cipher: forge.cipher.createDecipher('AES-CBC', client ?\n      sp.keys.server_write_key : sp.keys.client_write_key),\n    iv: client ? sp.keys.server_write_IV : sp.keys.client_write_IV\n  };\n  state.write.cipherState = {\n    init: false,\n    cipher: forge.cipher.createCipher('AES-CBC', client ?\n      sp.keys.client_write_key : sp.keys.server_write_key),\n    iv: client ? sp.keys.client_write_IV : sp.keys.server_write_IV\n  };\n  state.read.cipherFunction = decrypt_aes_cbc_sha1;\n  state.write.cipherFunction = encrypt_aes_cbc_sha1;\n\n  // MAC setup\n  state.read.macLength = state.write.macLength = sp.mac_length;\n  state.read.macFunction = state.write.macFunction = tls.hmac_sha1;\n}\n\n/**\n * Encrypts the TLSCompressed record into a TLSCipherText record using AES\n * in CBC mode.\n *\n * @param record the TLSCompressed record to encrypt.\n * @param s the ConnectionState to use.\n *\n * @return true on success, false on failure.\n */\nfunction encrypt_aes_cbc_sha1(record, s) {\n  var rval = false;\n\n  // append MAC to fragment, update sequence number\n  var mac = s.macFunction(s.macKey, s.sequenceNumber, record);\n  record.fragment.putBytes(mac);\n  s.updateSequenceNumber();\n\n  // TLS 1.1+ use an explicit IV every time to protect against CBC attacks\n  var iv;\n  if(record.version.minor === tls.Versions.TLS_1_0.minor) {\n    // use the pre-generated IV when initializing for TLS 1.0, otherwise use\n    // the residue from the previous encryption\n    iv = s.cipherState.init ? null : s.cipherState.iv;\n  } else {\n    iv = forge.random.getBytesSync(16);\n  }\n\n  s.cipherState.init = true;\n\n  // start cipher\n  var cipher = s.cipherState.cipher;\n  cipher.start({iv: iv});\n\n  // TLS 1.1+ write IV into output\n  if(record.version.minor >= tls.Versions.TLS_1_1.minor) {\n    cipher.output.putBytes(iv);\n  }\n\n  // do encryption (default padding is appropriate)\n  cipher.update(record.fragment);\n  if(cipher.finish(encrypt_aes_cbc_sha1_padding)) {\n    // set record fragment to encrypted output\n    record.fragment = cipher.output;\n    record.length = record.fragment.length();\n    rval = true;\n  }\n\n  return rval;\n}\n\n/**\n * Handles padding for aes_cbc_sha1 in encrypt mode.\n *\n * @param blockSize the block size.\n * @param input the input buffer.\n * @param decrypt true in decrypt mode, false in encrypt mode.\n *\n * @return true on success, false on failure.\n */\nfunction encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) {\n  /* The encrypted data length (TLSCiphertext.length) is one more than the sum\n   of SecurityParameters.block_length, TLSCompressed.length,\n   SecurityParameters.mac_length, and padding_length.\n\n   The padding may be any length up to 255 bytes long, as long as it results in\n   the TLSCiphertext.length being an integral multiple of the block length.\n   Lengths longer than necessary might be desirable to frustrate attacks on a\n   protocol based on analysis of the lengths of exchanged messages. Each uint8\n   in the padding data vector must be filled with the padding length value.\n\n   The padding length should be such that the total size of the\n   GenericBlockCipher structure is a multiple of the cipher's block length.\n   Legal values range from zero to 255, inclusive. This length specifies the\n   length of the padding field exclusive of the padding_length field itself.\n\n   This is slightly different from PKCS#7 because the padding value is 1\n   less than the actual number of padding bytes if you include the\n   padding_length uint8 itself as a padding byte. */\n  if(!decrypt) {\n    // get the number of padding bytes required to reach the blockSize and\n    // subtract 1 for the padding value (to make room for the padding_length\n    // uint8)\n    var padding = blockSize - (input.length() % blockSize);\n    input.fillWithByte(padding - 1, padding);\n  }\n  return true;\n}\n\n/**\n * Handles padding for aes_cbc_sha1 in decrypt mode.\n *\n * @param blockSize the block size.\n * @param output the output buffer.\n * @param decrypt true in decrypt mode, false in encrypt mode.\n *\n * @return true on success, false on failure.\n */\nfunction decrypt_aes_cbc_sha1_padding(blockSize, output, decrypt) {\n  var rval = true;\n  if(decrypt) {\n    /* The last byte in the output specifies the number of padding bytes not\n      including itself. Each of the padding bytes has the same value as that\n      last byte (known as the padding_length). Here we check all padding\n      bytes to ensure they have the value of padding_length even if one of\n      them is bad in order to ward-off timing attacks. */\n    var len = output.length();\n    var paddingLength = output.last();\n    for(var i = len - 1 - paddingLength; i < len - 1; ++i) {\n      rval = rval && (output.at(i) == paddingLength);\n    }\n    if(rval) {\n      // trim off padding bytes and last padding length byte\n      output.truncate(paddingLength + 1);\n    }\n  }\n  return rval;\n}\n\n/**\n * Decrypts a TLSCipherText record into a TLSCompressed record using\n * AES in CBC mode.\n *\n * @param record the TLSCipherText record to decrypt.\n * @param s the ConnectionState to use.\n *\n * @return true on success, false on failure.\n */\nvar count = 0;\nfunction decrypt_aes_cbc_sha1(record, s) {\n  var rval = false;\n  ++count;\n\n  var iv;\n  if(record.version.minor === tls.Versions.TLS_1_0.minor) {\n    // use pre-generated IV when initializing for TLS 1.0, otherwise use the\n    // residue from the previous decryption\n    iv = s.cipherState.init ? null : s.cipherState.iv;\n  } else {\n    // TLS 1.1+ use an explicit IV every time to protect against CBC attacks\n    // that is appended to the record fragment\n    iv = record.fragment.getBytes(16);\n  }\n\n  s.cipherState.init = true;\n\n  // start cipher\n  var cipher = s.cipherState.cipher;\n  cipher.start({iv: iv});\n\n  // do decryption\n  cipher.update(record.fragment);\n  rval = cipher.finish(decrypt_aes_cbc_sha1_padding);\n\n  // even if decryption fails, keep going to minimize timing attacks\n\n  // decrypted data:\n  // first (len - 20) bytes = application data\n  // last 20 bytes          = MAC\n  var macLen = s.macLength;\n\n  // create a random MAC to check against should the mac length check fail\n  // Note: do this regardless of the failure to keep timing consistent\n  var mac = forge.random.getBytesSync(macLen);\n\n  // get fragment and mac\n  var len = cipher.output.length();\n  if(len >= macLen) {\n    record.fragment = cipher.output.getBytes(len - macLen);\n    mac = cipher.output.getBytes(macLen);\n  } else {\n    // bad data, but get bytes anyway to try to keep timing consistent\n    record.fragment = cipher.output.getBytes();\n  }\n  record.fragment = forge.util.createBuffer(record.fragment);\n  record.length = record.fragment.length();\n\n  // see if data integrity checks out, update sequence number\n  var mac2 = s.macFunction(s.macKey, s.sequenceNumber, record);\n  s.updateSequenceNumber();\n  rval = compareMacs(s.macKey, mac, mac2) && rval;\n  return rval;\n}\n\n/**\n * Safely compare two MACs. This function will compare two MACs in a way\n * that protects against timing attacks.\n *\n * TODO: Expose elsewhere as a utility API.\n *\n * See: https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2011/february/double-hmac-verification/\n *\n * @param key the MAC key to use.\n * @param mac1 as a binary-encoded string of bytes.\n * @param mac2 as a binary-encoded string of bytes.\n *\n * @return true if the MACs are the same, false if not.\n */\nfunction compareMacs(key, mac1, mac2) {\n  var hmac = forge.hmac.create();\n\n  hmac.start('SHA1', key);\n  hmac.update(mac1);\n  mac1 = hmac.digest().getBytes();\n\n  hmac.start(null, null);\n  hmac.update(mac2);\n  mac2 = hmac.digest().getBytes();\n\n  return mac1 === mac2;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/aesCipherSuites.js\n// module id = 1124\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/aesCipherSuites.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * Base-N/Base-X encoding/decoding functions.\n *\n * Original implementation from base-x:\n * https://github.com/cryptocoinjs/base-x\n *\n * Which is MIT licensed:\n *\n * The MIT License (MIT)\n *\n * Copyright base-x contributors (c) 2016\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nvar api = {};\nmodule.exports = api;\n\n// baseN alphabet indexes\nvar _reverseAlphabets = {};\n\n/**\n * BaseN-encodes a Uint8Array using the given alphabet.\n *\n * @param input the Uint8Array to encode.\n * @param maxline the maximum number of encoded characters per line to use,\n *          defaults to none.\n *\n * @return the baseN-encoded output string.\n */\napi.encode = function(input, alphabet, maxline) {\n  if(typeof alphabet !== 'string') {\n    throw new TypeError('\"alphabet\" must be a string.');\n  }\n  if(maxline !== undefined && typeof maxline !== 'number') {\n    throw new TypeError('\"maxline\" must be a number.');\n  }\n\n  var output = '';\n\n  if(!(input instanceof Uint8Array)) {\n    // assume forge byte buffer\n    output = _encodeWithByteBuffer(input, alphabet);\n  } else {\n    var i = 0;\n    var base = alphabet.length;\n    var first = alphabet.charAt(0);\n    var digits = [0];\n    for(i = 0; i < input.length; ++i) {\n      for(var j = 0, carry = input[i]; j < digits.length; ++j) {\n        carry += digits[j] << 8;\n        digits[j] = carry % base;\n        carry = (carry / base) | 0;\n      }\n\n      while(carry > 0) {\n        digits.push(carry % base);\n        carry = (carry / base) | 0;\n      }\n    }\n\n    // deal with leading zeros\n    for(i = 0; input[i] === 0 && i < input.length - 1; ++i) {\n      output += first;\n    }\n    // convert digits to a string\n    for(i = digits.length - 1; i >= 0; --i) {\n      output += alphabet[digits[i]];\n    }\n  }\n\n  if(maxline) {\n    var regex = new RegExp('.{1,' + maxline + '}', 'g');\n    output = output.match(regex).join('\\r\\n');\n  }\n\n  return output;\n};\n\n/**\n * Decodes a baseN-encoded (using the given alphabet) string to a\n * Uint8Array.\n *\n * @param input the baseN-encoded input string.\n *\n * @return the Uint8Array.\n */\napi.decode = function(input, alphabet) {\n  if(typeof input !== 'string') {\n    throw new TypeError('\"input\" must be a string.');\n  }\n  if(typeof alphabet !== 'string') {\n    throw new TypeError('\"alphabet\" must be a string.');\n  }\n\n  var table = _reverseAlphabets[alphabet];\n  if(!table) {\n    // compute reverse alphabet\n    table = _reverseAlphabets[alphabet] = [];\n    for(var i = 0; i < alphabet.length; ++i) {\n      table[alphabet.charCodeAt(i)] = i;\n    }\n  }\n\n  // remove whitespace characters\n  input = input.replace(/\\s/g, '');\n\n  var base = alphabet.length;\n  var first = alphabet.charAt(0);\n  var bytes = [0];\n  for(var i = 0; i < input.length; i++) {\n    var value = table[input.charCodeAt(i)];\n    if(value === undefined) {\n      return;\n    }\n\n    for(var j = 0, carry = value; j < bytes.length; ++j) {\n      carry += bytes[j] * base;\n      bytes[j] = carry & 0xff;\n      carry >>= 8;\n    }\n\n    while(carry > 0) {\n      bytes.push(carry & 0xff);\n      carry >>= 8;\n    }\n  }\n\n  // deal with leading zeros\n  for(var k = 0; input[k] === first && k < input.length - 1; ++k) {\n    bytes.push(0);\n  }\n\n  if(typeof Buffer !== 'undefined') {\n    return Buffer.from(bytes.reverse());\n  }\n\n  return new Uint8Array(bytes.reverse());\n};\n\nfunction _encodeWithByteBuffer(input, alphabet) {\n  var i = 0;\n  var base = alphabet.length;\n  var first = alphabet.charAt(0);\n  var digits = [0];\n  for(i = 0; i < input.length(); ++i) {\n    for(var j = 0, carry = input.at(i); j < digits.length; ++j) {\n      carry += digits[j] << 8;\n      digits[j] = carry % base;\n      carry = (carry / base) | 0;\n    }\n\n    while(carry > 0) {\n      digits.push(carry % base);\n      carry = (carry / base) | 0;\n    }\n  }\n\n  var output = '';\n\n  // deal with leading zeros\n  for(i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) {\n    output += first;\n  }\n  // convert digits to a string\n  for(i = digits.length - 1; i >= 0; --i) {\n    output += alphabet[digits[i]];\n  }\n\n  return output;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/baseN.js\n// module id = 1125\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/baseN.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {/**\n * JavaScript implementation of Ed25519.\n *\n * Copyright (c) 2017-2018 Digital Bazaar, Inc.\n *\n * This implementation is based on the most excellent TweetNaCl which is\n * in the public domain. Many thanks to its contributors:\n *\n * https://github.com/dchest/tweetnacl-js\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(198);\n__webpack_require__(52);\n__webpack_require__(494);\n__webpack_require__(9);\n\nif(typeof BigInteger === 'undefined') {\n  var BigInteger = forge.jsbn.BigInteger;\n}\n\nvar ByteBuffer = forge.util.ByteBuffer;\nvar NativeBuffer = typeof Buffer === 'undefined' ? Uint8Array : Buffer;\n\n/*\n * Ed25519 algorithms, see RFC 8032:\n * https://tools.ietf.org/html/rfc8032\n */\nforge.pki = forge.pki || {};\nmodule.exports = forge.pki.ed25519 = forge.ed25519 = forge.ed25519 || {};\nvar ed25519 = forge.ed25519;\n\ned25519.constants = {};\ned25519.constants.PUBLIC_KEY_BYTE_LENGTH = 32;\ned25519.constants.PRIVATE_KEY_BYTE_LENGTH = 64;\ned25519.constants.SEED_BYTE_LENGTH = 32;\ned25519.constants.SIGN_BYTE_LENGTH = 64;\ned25519.constants.HASH_BYTE_LENGTH = 64;\n\ned25519.generateKeyPair = function(options) {\n  options = options || {};\n  var seed = options.seed;\n  if(seed === undefined) {\n    // generate seed\n    seed = forge.random.getBytesSync(ed25519.constants.SEED_BYTE_LENGTH);\n  } else if(typeof seed === 'string') {\n    if(seed.length !== ed25519.constants.SEED_BYTE_LENGTH) {\n      throw new TypeError(\n        '\"seed\" must be ' + ed25519.constants.SEED_BYTE_LENGTH +\n        ' bytes in length.');\n    }\n  } else if(!(seed instanceof Uint8Array)) {\n    throw new TypeError(\n      '\"seed\" must be a node.js Buffer, Uint8Array, or a binary string.');\n  }\n\n  seed = messageToNativeBuffer({message: seed, encoding: 'binary'});\n\n  var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH);\n  var sk = new NativeBuffer(ed25519.constants.PRIVATE_KEY_BYTE_LENGTH);\n  for(var i = 0; i < 32; ++i) {\n    sk[i] = seed[i];\n  }\n  crypto_sign_keypair(pk, sk);\n  return {publicKey: pk, privateKey: sk};\n};\n\ned25519.publicKeyFromPrivateKey = function(options) {\n  options = options || {};\n  var privateKey = messageToNativeBuffer({\n    message: options.privateKey, encoding: 'binary'\n  });\n  if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) {\n    throw new TypeError(\n      '\"options.privateKey\" must have a byte length of ' +\n      ed25519.constants.PRIVATE_KEY_BYTE_LENGTH);\n  }\n\n  var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH);\n  for(var i = 0; i < pk.length; ++i) {\n    pk[i] = privateKey[32 + i];\n  }\n  return pk;\n};\n\ned25519.sign = function(options) {\n  options = options || {};\n  var msg = messageToNativeBuffer(options);\n  var privateKey = messageToNativeBuffer({\n    message: options.privateKey,\n    encoding: 'binary'\n  });\n  if(privateKey.length !== ed25519.constants.PRIVATE_KEY_BYTE_LENGTH) {\n    throw new TypeError(\n      '\"options.privateKey\" must have a byte length of ' +\n      ed25519.constants.PRIVATE_KEY_BYTE_LENGTH);\n  }\n\n  var signedMsg = new NativeBuffer(\n    ed25519.constants.SIGN_BYTE_LENGTH + msg.length);\n  crypto_sign(signedMsg, msg, msg.length, privateKey);\n\n  var sig = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH);\n  for(var i = 0; i < sig.length; ++i) {\n    sig[i] = signedMsg[i];\n  }\n  return sig;\n};\n\ned25519.verify = function(options) {\n  options = options || {};\n  var msg = messageToNativeBuffer(options);\n  if(options.signature === undefined) {\n    throw new TypeError(\n      '\"options.signature\" must be a node.js Buffer, a Uint8Array, a forge ' +\n      'ByteBuffer, or a binary string.');\n  }\n  var sig = messageToNativeBuffer({\n    message: options.signature,\n    encoding: 'binary'\n  });\n  if(sig.length !== ed25519.constants.SIGN_BYTE_LENGTH) {\n    throw new TypeError(\n      '\"options.signature\" must have a byte length of ' +\n      ed25519.constants.SIGN_BYTE_LENGTH);\n  }\n  var publicKey = messageToNativeBuffer({\n    message: options.publicKey,\n    encoding: 'binary'\n  });\n  if(publicKey.length !== ed25519.constants.PUBLIC_KEY_BYTE_LENGTH) {\n    throw new TypeError(\n      '\"options.publicKey\" must have a byte length of ' +\n      ed25519.constants.PUBLIC_KEY_BYTE_LENGTH);\n  }\n\n  var sm = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length);\n  var m = new NativeBuffer(ed25519.constants.SIGN_BYTE_LENGTH + msg.length);\n  var i;\n  for(i = 0; i < ed25519.constants.SIGN_BYTE_LENGTH; ++i) {\n    sm[i] = sig[i];\n  }\n  for(i = 0; i < msg.length; ++i) {\n    sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i];\n  }\n  return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nfunction messageToNativeBuffer(options) {\n  var message = options.message;\n  if(message instanceof Uint8Array) {\n    return message;\n  }\n\n  var encoding = options.encoding;\n  if(message === undefined) {\n    if(options.md) {\n      // TODO: more rigorous validation that `md` is a MessageDigest\n      message = options.md.digest().getBytes();\n      encoding = 'binary';\n    } else {\n      throw new TypeError('\"options.message\" or \"options.md\" not specified.');\n    }\n  }\n\n  if(typeof message === 'string' && !encoding) {\n    throw new TypeError('\"options.encoding\" must be \"binary\" or \"utf8\".');\n  }\n\n  if(typeof message === 'string') {\n    if(typeof Buffer !== 'undefined') {\n      return new Buffer(message, encoding);\n    }\n    message = new ByteBuffer(message, encoding);\n  } else if(!(message instanceof ByteBuffer)) {\n    throw new TypeError(\n      '\"options.message\" must be a node.js Buffer, a Uint8Array, a forge ' +\n      'ByteBuffer, or a string with \"options.encoding\" specifying its ' +\n      'encoding.');\n  }\n\n  // convert to native buffer\n  var buffer = new NativeBuffer(message.length());\n  for(var i = 0; i < buffer.length; ++i) {\n    buffer[i] = message.at(i);\n  }\n  return buffer;\n}\n\nvar gf0 = gf();\nvar gf1 = gf([1]);\nvar D = gf([\n  0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070,\n  0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]);\nvar D2 = gf([\n  0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0,\n  0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]);\nvar X = gf([\n  0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c,\n  0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]);\nvar Y = gf([\n  0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666,\n  0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]);\nvar L = new Float64Array([\n  0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58,\n  0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\nvar I = gf([\n  0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43,\n  0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\n// TODO: update forge buffer implementation to use `Buffer` or `Uint8Array`,\n// whichever is available, to improve performance\nfunction sha512(msg, msgLen) {\n  // Note: `out` and `msg` are NativeBuffer\n  var md = forge.md.sha512.create();\n  var buffer = new ByteBuffer(msg);\n  md.update(buffer.getBytes(msgLen), 'binary');\n  var hash = md.digest().getBytes();\n  if(typeof Buffer !== 'undefined') {\n    return new Buffer(hash, 'binary');\n  }\n  var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH);\n  for(var i = 0; i < 64; ++i) {\n    out[i] = hash.charCodeAt(i);\n  }\n  return out;\n}\n\nfunction crypto_sign_keypair(pk, sk) {\n  var p = [gf(), gf(), gf(), gf()];\n  var i;\n\n  var d = sha512(sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  scalarbase(p, d);\n  pack(pk, p);\n\n  for(i = 0; i < 32; ++i) {\n    sk[i + 32] = pk[i];\n  }\n  return 0;\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n  var i, j, x = new Float64Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n\n  var d = sha512(sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  var smlen = n + 64;\n  for(i = 0; i < n; ++i) {\n    sm[64 + i] = m[i];\n  }\n  for(i = 0; i < 32; ++i) {\n    sm[32 + i] = d[32 + i];\n  }\n\n  var r = sha512(sm.subarray(32), n + 32);\n  reduce(r);\n  scalarbase(p, r);\n  pack(sm, p);\n\n  for(i = 32; i < 64; ++i) {\n    sm[i] = sk[i];\n  }\n  var h = sha512(sm, n + 64);\n  reduce(h);\n\n  for(i = 32; i < 64; ++i) {\n    x[i] = 0;\n  }\n  for(i = 0; i < 32; ++i) {\n    x[i] = r[i];\n  }\n  for(i = 0; i < 32; ++i) {\n    for(j = 0; j < 32; j++) {\n      x[i + j] += h[i] * d[j];\n    }\n  }\n\n  modL(sm.subarray(32), x);\n  return smlen;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n  var i, mlen;\n  var t = new NativeBuffer(32);\n  var p = [gf(), gf(), gf(), gf()],\n      q = [gf(), gf(), gf(), gf()];\n\n  mlen = -1;\n  if(n < 64) {\n    return -1;\n  }\n\n  if(unpackneg(q, pk)) {\n    return -1;\n  }\n\n  for(i = 0; i < n; ++i) {\n    m[i] = sm[i];\n  }\n  for(i = 0; i < 32; ++i) {\n    m[i + 32] = pk[i];\n  }\n  var h = sha512(m, n);\n  reduce(h);\n  scalarmult(p, q, h);\n\n  scalarbase(q, sm.subarray(32));\n  add(p, q);\n  pack(t, p);\n\n  n -= 64;\n  if(crypto_verify_32(sm, 0, t, 0)) {\n    for(i = 0; i < n; ++i) {\n      m[i] = 0;\n    }\n    return -1;\n  }\n\n  for(i = 0; i < n; ++i) {\n    m[i] = sm[i + 64];\n  }\n  mlen = n;\n  return mlen;\n}\n\nfunction modL(r, x) {\n  var carry, i, j, k;\n  for(i = 63; i >= 32; --i) {\n    carry = 0;\n    for(j = i - 32, k = i - 12; j < k; ++j) {\n      x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n      carry = (x[j] + 128) >> 8;\n      x[j] -= carry * 256;\n    }\n    x[j] += carry;\n    x[i] = 0;\n  }\n  carry = 0;\n  for(j = 0; j < 32; ++j) {\n    x[j] += carry - (x[31] >> 4) * L[j];\n    carry = x[j] >> 8;\n    x[j] &= 255;\n  }\n  for(j = 0; j < 32; ++j) {\n    x[j] -= carry * L[j];\n  }\n  for(i = 0; i < 32; ++i) {\n    x[i + 1] += x[i] >> 8;\n    r[i] = x[i] & 255;\n  }\n}\n\nfunction reduce(r) {\n  var x = new Float64Array(64);\n  for(var i = 0; i < 64; ++i) {\n    x[i] = r[i];\n    r[i] = 0;\n  }\n  modL(r, x);\n}\n\nfunction add(p, q) {\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf(),\n      g = gf(), h = gf(), t = gf();\n\n  Z(a, p[1], p[0]);\n  Z(t, q[1], q[0]);\n  M(a, a, t);\n  A(b, p[0], p[1]);\n  A(t, q[0], q[1]);\n  M(b, b, t);\n  M(c, p[3], q[3]);\n  M(c, c, D2);\n  M(d, p[2], q[2]);\n  A(d, d, d);\n  Z(e, b, a);\n  Z(f, d, c);\n  A(g, d, c);\n  A(h, b, a);\n\n  M(p[0], e, f);\n  M(p[1], h, g);\n  M(p[2], g, f);\n  M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n  for(var i = 0; i < 4; ++i) {\n    sel25519(p[i], q[i], b);\n  }\n}\n\nfunction pack(r, p) {\n  var tx = gf(), ty = gf(), zi = gf();\n  inv25519(zi, p[2]);\n  M(tx, p[0], zi);\n  M(ty, p[1], zi);\n  pack25519(r, ty);\n  r[31] ^= par25519(tx) << 7;\n}\n\nfunction pack25519(o, n) {\n  var i, j, b;\n  var m = gf(), t = gf();\n  for(i = 0; i < 16; ++i) {\n    t[i] = n[i];\n  }\n  car25519(t);\n  car25519(t);\n  car25519(t);\n  for(j = 0; j < 2; ++j) {\n    m[0] = t[0] - 0xffed;\n    for(i = 1; i < 15; ++i) {\n      m[i] = t[i] - 0xffff - ((m[i - 1] >> 16) & 1);\n      m[i-1] &= 0xffff;\n    }\n    m[15] = t[15] - 0x7fff - ((m[14] >> 16) & 1);\n    b = (m[15] >> 16) & 1;\n    m[14] &= 0xffff;\n    sel25519(t, m, 1 - b);\n  }\n  for (i = 0; i < 16; i++) {\n    o[2 * i] = t[i] & 0xff;\n    o[2 * i + 1] = t[i] >> 8;\n  }\n}\n\nfunction unpackneg(r, p) {\n  var t = gf(), chk = gf(), num = gf(),\n      den = gf(), den2 = gf(), den4 = gf(),\n      den6 = gf();\n\n  set25519(r[2], gf1);\n  unpack25519(r[1], p);\n  S(num, r[1]);\n  M(den, num, D);\n  Z(num, num, r[2]);\n  A(den, r[2], den);\n\n  S(den2, den);\n  S(den4, den2);\n  M(den6, den4, den2);\n  M(t, den6, num);\n  M(t, t, den);\n\n  pow2523(t, t);\n  M(t, t, num);\n  M(t, t, den);\n  M(t, t, den);\n  M(r[0], t, den);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if(neq25519(chk, num)) {\n    M(r[0], r[0], I);\n  }\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if(neq25519(chk, num)) {\n    return -1;\n  }\n\n  if(par25519(r[0]) === (p[31] >> 7)) {\n    Z(r[0], gf0, r[0]);\n  }\n\n  M(r[3], r[0], r[1]);\n  return 0;\n}\n\nfunction unpack25519(o, n) {\n  var i;\n  for(i = 0; i < 16; ++i) {\n    o[i] = n[2 * i] + (n[2 * i + 1] << 8);\n  }\n  o[15] &= 0x7fff;\n}\n\nfunction pow2523(o, i) {\n  var c = gf();\n  var a;\n  for(a = 0; a < 16; ++a) {\n    c[a] = i[a];\n  }\n  for(a = 250; a >= 0; --a) {\n    S(c, c);\n    if(a !== 1) {\n      M(c, c, i);\n    }\n  }\n  for(a = 0; a < 16; ++a) {\n    o[a] = c[a];\n  }\n}\n\nfunction neq25519(a, b) {\n  var c = new NativeBuffer(32);\n  var d = new NativeBuffer(32);\n  pack25519(c, a);\n  pack25519(d, b);\n  return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n  return vn(x, xi, y, yi, 32);\n}\n\nfunction vn(x, xi, y, yi, n) {\n  var i, d = 0;\n  for(i = 0; i < n; ++i) {\n    d |= x[xi + i] ^ y[yi + i];\n  }\n  return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction par25519(a) {\n  var d = new NativeBuffer(32);\n  pack25519(d, a);\n  return d[0] & 1;\n}\n\nfunction scalarmult(p, q, s) {\n  var b, i;\n  set25519(p[0], gf0);\n  set25519(p[1], gf1);\n  set25519(p[2], gf1);\n  set25519(p[3], gf0);\n  for(i = 255; i >= 0; --i) {\n    b = (s[(i / 8)|0] >> (i & 7)) & 1;\n    cswap(p, q, b);\n    add(q, p);\n    add(p, p);\n    cswap(p, q, b);\n  }\n}\n\nfunction scalarbase(p, s) {\n  var q = [gf(), gf(), gf(), gf()];\n  set25519(q[0], X);\n  set25519(q[1], Y);\n  set25519(q[2], gf1);\n  M(q[3], X, Y);\n  scalarmult(p, q, s);\n}\n\nfunction set25519(r, a) {\n  var i;\n  for(i = 0; i < 16; i++) {\n    r[i] = a[i] | 0;\n  }\n}\n\nfunction inv25519(o, i) {\n  var c = gf();\n  var a;\n  for(a = 0; a < 16; ++a) {\n    c[a] = i[a];\n  }\n  for(a = 253; a >= 0; --a) {\n    S(c, c);\n    if(a !== 2 && a !== 4) {\n      M(c, c, i);\n    }\n  }\n  for(a = 0; a < 16; ++a) {\n    o[a] = c[a];\n  }\n}\n\nfunction car25519(o) {\n  var i, v, c = 1;\n  for(i = 0; i < 16; ++i) {\n    v = o[i] + c + 65535;\n    c = Math.floor(v / 65536);\n    o[i] = v - c * 65536;\n  }\n  o[0] += c - 1 + 37 * (c - 1);\n}\n\nfunction sel25519(p, q, b) {\n  var t, c = ~(b - 1);\n  for(var i = 0; i < 16; ++i) {\n    t = c & (p[i] ^ q[i]);\n    p[i] ^= t;\n    q[i] ^= t;\n  }\n}\n\nfunction gf(init) {\n  var i, r = new Float64Array(16);\n  if(init) {\n    for(i = 0; i < init.length; ++i) {\n      r[i] = init[i];\n    }\n  }\n  return r;\n}\n\nfunction A(o, a, b) {\n  for(var i = 0; i < 16; ++i) {\n    o[i] = a[i] + b[i];\n  }\n}\n\nfunction Z(o, a, b) {\n  for(var i = 0; i < 16; ++i) {\n    o[i] = a[i] - b[i];\n  }\n}\n\nfunction S(o, a) {\n  M(o, a, a);\n}\n\nfunction M(o, a, b) {\n  var v, c,\n     t0 = 0,  t1 = 0,  t2 = 0,  t3 = 0,  t4 = 0,  t5 = 0,  t6 = 0,  t7 = 0,\n     t8 = 0,  t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n    t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n    t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n    b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3],\n    b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7],\n    b8 = b[8],\n    b9 = b[9],\n    b10 = b[10],\n    b11 = b[11],\n    b12 = b[12],\n    b13 = b[13],\n    b14 = b[14],\n    b15 = b[15];\n\n  v = a[0];\n  t0 += v * b0;\n  t1 += v * b1;\n  t2 += v * b2;\n  t3 += v * b3;\n  t4 += v * b4;\n  t5 += v * b5;\n  t6 += v * b6;\n  t7 += v * b7;\n  t8 += v * b8;\n  t9 += v * b9;\n  t10 += v * b10;\n  t11 += v * b11;\n  t12 += v * b12;\n  t13 += v * b13;\n  t14 += v * b14;\n  t15 += v * b15;\n  v = a[1];\n  t1 += v * b0;\n  t2 += v * b1;\n  t3 += v * b2;\n  t4 += v * b3;\n  t5 += v * b4;\n  t6 += v * b5;\n  t7 += v * b6;\n  t8 += v * b7;\n  t9 += v * b8;\n  t10 += v * b9;\n  t11 += v * b10;\n  t12 += v * b11;\n  t13 += v * b12;\n  t14 += v * b13;\n  t15 += v * b14;\n  t16 += v * b15;\n  v = a[2];\n  t2 += v * b0;\n  t3 += v * b1;\n  t4 += v * b2;\n  t5 += v * b3;\n  t6 += v * b4;\n  t7 += v * b5;\n  t8 += v * b6;\n  t9 += v * b7;\n  t10 += v * b8;\n  t11 += v * b9;\n  t12 += v * b10;\n  t13 += v * b11;\n  t14 += v * b12;\n  t15 += v * b13;\n  t16 += v * b14;\n  t17 += v * b15;\n  v = a[3];\n  t3 += v * b0;\n  t4 += v * b1;\n  t5 += v * b2;\n  t6 += v * b3;\n  t7 += v * b4;\n  t8 += v * b5;\n  t9 += v * b6;\n  t10 += v * b7;\n  t11 += v * b8;\n  t12 += v * b9;\n  t13 += v * b10;\n  t14 += v * b11;\n  t15 += v * b12;\n  t16 += v * b13;\n  t17 += v * b14;\n  t18 += v * b15;\n  v = a[4];\n  t4 += v * b0;\n  t5 += v * b1;\n  t6 += v * b2;\n  t7 += v * b3;\n  t8 += v * b4;\n  t9 += v * b5;\n  t10 += v * b6;\n  t11 += v * b7;\n  t12 += v * b8;\n  t13 += v * b9;\n  t14 += v * b10;\n  t15 += v * b11;\n  t16 += v * b12;\n  t17 += v * b13;\n  t18 += v * b14;\n  t19 += v * b15;\n  v = a[5];\n  t5 += v * b0;\n  t6 += v * b1;\n  t7 += v * b2;\n  t8 += v * b3;\n  t9 += v * b4;\n  t10 += v * b5;\n  t11 += v * b6;\n  t12 += v * b7;\n  t13 += v * b8;\n  t14 += v * b9;\n  t15 += v * b10;\n  t16 += v * b11;\n  t17 += v * b12;\n  t18 += v * b13;\n  t19 += v * b14;\n  t20 += v * b15;\n  v = a[6];\n  t6 += v * b0;\n  t7 += v * b1;\n  t8 += v * b2;\n  t9 += v * b3;\n  t10 += v * b4;\n  t11 += v * b5;\n  t12 += v * b6;\n  t13 += v * b7;\n  t14 += v * b8;\n  t15 += v * b9;\n  t16 += v * b10;\n  t17 += v * b11;\n  t18 += v * b12;\n  t19 += v * b13;\n  t20 += v * b14;\n  t21 += v * b15;\n  v = a[7];\n  t7 += v * b0;\n  t8 += v * b1;\n  t9 += v * b2;\n  t10 += v * b3;\n  t11 += v * b4;\n  t12 += v * b5;\n  t13 += v * b6;\n  t14 += v * b7;\n  t15 += v * b8;\n  t16 += v * b9;\n  t17 += v * b10;\n  t18 += v * b11;\n  t19 += v * b12;\n  t20 += v * b13;\n  t21 += v * b14;\n  t22 += v * b15;\n  v = a[8];\n  t8 += v * b0;\n  t9 += v * b1;\n  t10 += v * b2;\n  t11 += v * b3;\n  t12 += v * b4;\n  t13 += v * b5;\n  t14 += v * b6;\n  t15 += v * b7;\n  t16 += v * b8;\n  t17 += v * b9;\n  t18 += v * b10;\n  t19 += v * b11;\n  t20 += v * b12;\n  t21 += v * b13;\n  t22 += v * b14;\n  t23 += v * b15;\n  v = a[9];\n  t9 += v * b0;\n  t10 += v * b1;\n  t11 += v * b2;\n  t12 += v * b3;\n  t13 += v * b4;\n  t14 += v * b5;\n  t15 += v * b6;\n  t16 += v * b7;\n  t17 += v * b8;\n  t18 += v * b9;\n  t19 += v * b10;\n  t20 += v * b11;\n  t21 += v * b12;\n  t22 += v * b13;\n  t23 += v * b14;\n  t24 += v * b15;\n  v = a[10];\n  t10 += v * b0;\n  t11 += v * b1;\n  t12 += v * b2;\n  t13 += v * b3;\n  t14 += v * b4;\n  t15 += v * b5;\n  t16 += v * b6;\n  t17 += v * b7;\n  t18 += v * b8;\n  t19 += v * b9;\n  t20 += v * b10;\n  t21 += v * b11;\n  t22 += v * b12;\n  t23 += v * b13;\n  t24 += v * b14;\n  t25 += v * b15;\n  v = a[11];\n  t11 += v * b0;\n  t12 += v * b1;\n  t13 += v * b2;\n  t14 += v * b3;\n  t15 += v * b4;\n  t16 += v * b5;\n  t17 += v * b6;\n  t18 += v * b7;\n  t19 += v * b8;\n  t20 += v * b9;\n  t21 += v * b10;\n  t22 += v * b11;\n  t23 += v * b12;\n  t24 += v * b13;\n  t25 += v * b14;\n  t26 += v * b15;\n  v = a[12];\n  t12 += v * b0;\n  t13 += v * b1;\n  t14 += v * b2;\n  t15 += v * b3;\n  t16 += v * b4;\n  t17 += v * b5;\n  t18 += v * b6;\n  t19 += v * b7;\n  t20 += v * b8;\n  t21 += v * b9;\n  t22 += v * b10;\n  t23 += v * b11;\n  t24 += v * b12;\n  t25 += v * b13;\n  t26 += v * b14;\n  t27 += v * b15;\n  v = a[13];\n  t13 += v * b0;\n  t14 += v * b1;\n  t15 += v * b2;\n  t16 += v * b3;\n  t17 += v * b4;\n  t18 += v * b5;\n  t19 += v * b6;\n  t20 += v * b7;\n  t21 += v * b8;\n  t22 += v * b9;\n  t23 += v * b10;\n  t24 += v * b11;\n  t25 += v * b12;\n  t26 += v * b13;\n  t27 += v * b14;\n  t28 += v * b15;\n  v = a[14];\n  t14 += v * b0;\n  t15 += v * b1;\n  t16 += v * b2;\n  t17 += v * b3;\n  t18 += v * b4;\n  t19 += v * b5;\n  t20 += v * b6;\n  t21 += v * b7;\n  t22 += v * b8;\n  t23 += v * b9;\n  t24 += v * b10;\n  t25 += v * b11;\n  t26 += v * b12;\n  t27 += v * b13;\n  t28 += v * b14;\n  t29 += v * b15;\n  v = a[15];\n  t15 += v * b0;\n  t16 += v * b1;\n  t17 += v * b2;\n  t18 += v * b3;\n  t19 += v * b4;\n  t20 += v * b5;\n  t21 += v * b6;\n  t22 += v * b7;\n  t23 += v * b8;\n  t24 += v * b9;\n  t25 += v * b10;\n  t26 += v * b11;\n  t27 += v * b12;\n  t28 += v * b13;\n  t29 += v * b14;\n  t30 += v * b15;\n\n  t0  += 38 * t16;\n  t1  += 38 * t17;\n  t2  += 38 * t18;\n  t3  += 38 * t19;\n  t4  += 38 * t20;\n  t5  += 38 * t21;\n  t6  += 38 * t22;\n  t7  += 38 * t23;\n  t8  += 38 * t24;\n  t9  += 38 * t25;\n  t10 += 38 * t26;\n  t11 += 38 * t27;\n  t12 += 38 * t28;\n  t13 += 38 * t29;\n  t14 += 38 * t30;\n  // t15 left as is\n\n  // first car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  // second car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  o[ 0] = t0;\n  o[ 1] = t1;\n  o[ 2] = t2;\n  o[ 3] = t3;\n  o[ 4] = t4;\n  o[ 5] = t5;\n  o[ 6] = t6;\n  o[ 7] = t7;\n  o[ 8] = t8;\n  o[ 9] = t9;\n  o[10] = t10;\n  o[11] = t11;\n  o[12] = t12;\n  o[13] = t13;\n  o[14] = t14;\n  o[15] = t15;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/ed25519.js\n// module id = 1126\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/ed25519.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of RSA-KEM.\n *\n * @author Lautaro Cozzani Rodriguez\n * @author Dave Longley\n *\n * Copyright (c) 2014 Lautaro Cozzani <lautaro.cozzani@scytl.com>\n * Copyright (c) 2014 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(9);\n__webpack_require__(52);\n__webpack_require__(198);\n\nmodule.exports = forge.kem = forge.kem || {};\n\nvar BigInteger = forge.jsbn.BigInteger;\n\n/**\n * The API for the RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2.\n */\nforge.kem.rsa = {};\n\n/**\n * Creates an RSA KEM API object for generating a secret asymmetric key.\n *\n * The symmetric key may be generated via a call to 'encrypt', which will\n * produce a ciphertext to be transmitted to the recipient and a key to be\n * kept secret. The ciphertext is a parameter to be passed to 'decrypt' which\n * will produce the same secret key for the recipient to use to decrypt a\n * message that was encrypted with the secret key.\n *\n * @param kdf the KDF API to use (eg: new forge.kem.kdf1()).\n * @param options the options to use.\n *          [prng] a custom crypto-secure pseudo-random number generator to use,\n *            that must define \"getBytesSync\".\n */\nforge.kem.rsa.create = function(kdf, options) {\n  options = options || {};\n  var prng = options.prng || forge.random;\n\n  var kem = {};\n\n  /**\n   * Generates a secret key and its encapsulation.\n   *\n   * @param publicKey the RSA public key to encrypt with.\n   * @param keyLength the length, in bytes, of the secret key to generate.\n   *\n   * @return an object with:\n   *   encapsulation: the ciphertext for generating the secret key, as a\n   *     binary-encoded string of bytes.\n   *   key: the secret key to use for encrypting a message.\n   */\n  kem.encrypt = function(publicKey, keyLength) {\n    // generate a random r where 1 > r > n\n    var byteLength = Math.ceil(publicKey.n.bitLength() / 8);\n    var r;\n    do {\n      r = new BigInteger(\n        forge.util.bytesToHex(prng.getBytesSync(byteLength)),\n        16).mod(publicKey.n);\n    } while(r.equals(BigInteger.ZERO));\n\n    // prepend r with zeros\n    r = forge.util.hexToBytes(r.toString(16));\n    var zeros = byteLength - r.length;\n    if(zeros > 0) {\n      r = forge.util.fillString(String.fromCharCode(0), zeros) + r;\n    }\n\n    // encrypt the random\n    var encapsulation = publicKey.encrypt(r, 'NONE');\n\n    // generate the secret key\n    var key = kdf.generate(r, keyLength);\n\n    return {encapsulation: encapsulation, key: key};\n  };\n\n  /**\n   * Decrypts an encapsulated secret key.\n   *\n   * @param privateKey the RSA private key to decrypt with.\n   * @param encapsulation the ciphertext for generating the secret key, as\n   *          a binary-encoded string of bytes.\n   * @param keyLength the length, in bytes, of the secret key to generate.\n   *\n   * @return the secret key as a binary-encoded string of bytes.\n   */\n  kem.decrypt = function(privateKey, encapsulation, keyLength) {\n    // decrypt the encapsulation and generate the secret key\n    var r = privateKey.decrypt(encapsulation, 'NONE');\n    return kdf.generate(r, keyLength);\n  };\n\n  return kem;\n};\n\n// TODO: add forge.kem.kdf.create('KDF1', {md: ..., ...}) API?\n\n/**\n * Creates a key derivation API object that implements KDF1 per ISO 18033-2.\n *\n * @param md the hash API to use.\n * @param [digestLength] an optional digest length that must be positive and\n *          less than or equal to md.digestLength.\n *\n * @return a KDF1 API object.\n */\nforge.kem.kdf1 = function(md, digestLength) {\n  _createKDF(this, md, 0, digestLength || md.digestLength);\n};\n\n/**\n * Creates a key derivation API object that implements KDF2 per ISO 18033-2.\n *\n * @param md the hash API to use.\n * @param [digestLength] an optional digest length that must be positive and\n *          less than or equal to md.digestLength.\n *\n * @return a KDF2 API object.\n */\nforge.kem.kdf2 = function(md, digestLength) {\n  _createKDF(this, md, 1, digestLength || md.digestLength);\n};\n\n/**\n * Creates a KDF1 or KDF2 API object.\n *\n * @param md the hash API to use.\n * @param counterStart the starting index for the counter.\n * @param digestLength the digest length to use.\n *\n * @return the KDF API object.\n */\nfunction _createKDF(kdf, md, counterStart, digestLength) {\n  /**\n   * Generate a key of the specified length.\n   *\n   * @param x the binary-encoded byte string to generate a key from.\n   * @param length the number of bytes to generate (the size of the key).\n   *\n   * @return the key as a binary-encoded string.\n   */\n  kdf.generate = function(x, length) {\n    var key = new forge.util.ByteBuffer();\n\n    // run counter from counterStart to ceil(length / Hash.len)\n    var k = Math.ceil(length / digestLength) + counterStart;\n\n    var c = new forge.util.ByteBuffer();\n    for(var i = counterStart; i < k; ++i) {\n      // I2OSP(i, 4): convert counter to an octet string of 4 octets\n      c.putInt32(i);\n\n      // digest 'x' and the counter and add the result to the key\n      md.start();\n      md.update(x + c.getBytes());\n      var hash = md.digest();\n      key.putBytes(hash.getBytes(digestLength));\n    }\n\n    // truncate to the correct key length\n    key.truncate(key.length() - length);\n    return key.getBytes();\n  };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/kem.js\n// module id = 1127\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/kem.js")},function(module,exports,__webpack_require__){eval("/**\n * Node.js module for all known Forge message digests.\n *\n * @author Dave Longley\n *\n * Copyright 2011-2017 Digital Bazaar, Inc.\n */\nmodule.exports = __webpack_require__(72);\n\n__webpack_require__(290);\n__webpack_require__(150);\n__webpack_require__(493);\n__webpack_require__(494);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/md.all.js\n// module id = 1128\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/md.all.js")},function(module,exports,__webpack_require__){eval("/**\n * Node.js module for Forge mask generation functions.\n *\n * @author Stefan Siegl\n *\n * Copyright 2012 Stefan Siegl <stesie@brokenpipe.de>\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(484);\n\nmodule.exports = forge.mgf = forge.mgf || {};\nforge.mgf.mgf1 = forge.mgf1;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/mgf.js\n// module id = 1129\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/mgf.js")},function(module,exports,__webpack_require__){eval("/**\n * Javascript implementation of PKCS#7 v1.5.\n *\n * @author Stefan Siegl\n * @author Dave Longley\n *\n * Copyright (c) 2012 Stefan Siegl <stesie@brokenpipe.de>\n * Copyright (c) 2012-2015 Digital Bazaar, Inc.\n *\n * Currently this implementation only supports ContentType of EnvelopedData,\n * EncryptedData, or SignedData at the root level. The top level elements may\n * contain only a ContentInfo of ContentType Data, i.e. plain data. Further\n * nesting is not (yet) supported.\n *\n * The Forge validators for PKCS #7's ASN.1 structures are available from\n * a separate file pkcs7asn1.js, since those are referenced from other\n * PKCS standards like PKCS #12.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(71);\n__webpack_require__(197);\n__webpack_require__(101);\n__webpack_require__(123);\n__webpack_require__(488);\n__webpack_require__(52);\n__webpack_require__(9);\n__webpack_require__(293);\n\n// shortcut for ASN.1 API\nvar asn1 = forge.asn1;\n\n// shortcut for PKCS#7 API\nvar p7 = module.exports = forge.pkcs7 = forge.pkcs7 || {};\n\n/**\n * Converts a PKCS#7 message from PEM format.\n *\n * @param pem the PEM-formatted PKCS#7 message.\n *\n * @return the PKCS#7 message.\n */\np7.messageFromPem = function(pem) {\n  var msg = forge.pem.decode(pem)[0];\n\n  if(msg.type !== 'PKCS7') {\n    var error = new Error('Could not convert PKCS#7 message from PEM; PEM ' +\n      'header type is not \"PKCS#7\".');\n    error.headerType = msg.type;\n    throw error;\n  }\n  if(msg.procType && msg.procType.type === 'ENCRYPTED') {\n    throw new Error('Could not convert PKCS#7 message from PEM; PEM is encrypted.');\n  }\n\n  // convert DER to ASN.1 object\n  var obj = asn1.fromDer(msg.body);\n\n  return p7.messageFromAsn1(obj);\n};\n\n/**\n * Converts a PKCS#7 message to PEM format.\n *\n * @param msg The PKCS#7 message object\n * @param maxline The maximum characters per line, defaults to 64.\n *\n * @return The PEM-formatted PKCS#7 message.\n */\np7.messageToPem = function(msg, maxline) {\n  // convert to ASN.1, then DER, then PEM-encode\n  var pemObj = {\n    type: 'PKCS7',\n    body: asn1.toDer(msg.toAsn1()).getBytes()\n  };\n  return forge.pem.encode(pemObj, {maxline: maxline});\n};\n\n/**\n * Converts a PKCS#7 message from an ASN.1 object.\n *\n * @param obj the ASN.1 representation of a ContentInfo.\n *\n * @return the PKCS#7 message.\n */\np7.messageFromAsn1 = function(obj) {\n  // validate root level ContentInfo and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#7 message. ' +\n      'ASN.1 object is not an PKCS#7 ContentInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  var contentType = asn1.derToOid(capture.contentType);\n  var msg;\n\n  switch(contentType) {\n    case forge.pki.oids.envelopedData:\n      msg = p7.createEnvelopedData();\n      break;\n\n    case forge.pki.oids.encryptedData:\n      msg = p7.createEncryptedData();\n      break;\n\n    case forge.pki.oids.signedData:\n      msg = p7.createSignedData();\n      break;\n\n    default:\n      throw new Error('Cannot read PKCS#7 message. ContentType with OID ' +\n        contentType + ' is not (yet) supported.');\n  }\n\n  msg.fromAsn1(capture.content.value[0]);\n  return msg;\n};\n\np7.createSignedData = function() {\n  var msg = null;\n  msg = {\n    type: forge.pki.oids.signedData,\n    version: 1,\n    certificates: [],\n    crls: [],\n    // TODO: add json-formatted signer stuff here?\n    signers: [],\n    // populated during sign()\n    digestAlgorithmIdentifiers: [],\n    contentInfo: null,\n    signerInfos: [],\n\n    fromAsn1: function(obj) {\n      // validate SignedData content block and capture data.\n      _fromAsn1(msg, obj, p7.asn1.signedDataValidator);\n      msg.certificates = [];\n      msg.crls = [];\n      msg.digestAlgorithmIdentifiers = [];\n      msg.contentInfo = null;\n      msg.signerInfos = [];\n\n      if(msg.rawCapture.certificates) {\n        var certs = msg.rawCapture.certificates.value;\n        for(var i = 0; i < certs.length; ++i) {\n          msg.certificates.push(forge.pki.certificateFromAsn1(certs[i]));\n        }\n      }\n\n      // TODO: parse crls\n    },\n\n    toAsn1: function() {\n      // degenerate case with no content\n      if(!msg.contentInfo) {\n        msg.sign();\n      }\n\n      var certs = [];\n      for(var i = 0; i < msg.certificates.length; ++i) {\n        certs.push(forge.pki.certificateToAsn1(msg.certificates[i]));\n      }\n\n      var crls = [];\n      // TODO: implement CRLs\n\n      // [0] SignedData\n      var signedData = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          // Version\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n            asn1.integerToDer(msg.version).getBytes()),\n          // DigestAlgorithmIdentifiers\n          asn1.create(\n            asn1.Class.UNIVERSAL, asn1.Type.SET, true,\n            msg.digestAlgorithmIdentifiers),\n          // ContentInfo\n          msg.contentInfo\n        ])\n      ]);\n      if(certs.length > 0) {\n        // [0] IMPLICIT ExtendedCertificatesAndCertificates OPTIONAL\n        signedData.value[0].value.push(\n          asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, certs));\n      }\n      if(crls.length > 0) {\n        // [1] IMPLICIT CertificateRevocationLists OPTIONAL\n        signedData.value[0].value.push(\n          asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, crls));\n      }\n      // SignerInfos\n      signedData.value[0].value.push(\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true,\n          msg.signerInfos));\n\n      // ContentInfo\n      return asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          // ContentType\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(msg.type).getBytes()),\n          // [0] SignedData\n          signedData\n        ]);\n    },\n\n    /**\n     * Add (another) entity to list of signers.\n     *\n     * Note: If authenticatedAttributes are provided, then, per RFC 2315,\n     * they must include at least two attributes: content type and\n     * message digest. The message digest attribute value will be\n     * auto-calculated during signing and will be ignored if provided.\n     *\n     * Here's an example of providing these two attributes:\n     *\n     * forge.pkcs7.createSignedData();\n     * p7.addSigner({\n     *   issuer: cert.issuer.attributes,\n     *   serialNumber: cert.serialNumber,\n     *   key: privateKey,\n     *   digestAlgorithm: forge.pki.oids.sha1,\n     *   authenticatedAttributes: [{\n     *     type: forge.pki.oids.contentType,\n     *     value: forge.pki.oids.data\n     *   }, {\n     *     type: forge.pki.oids.messageDigest\n     *   }]\n     * });\n     *\n     * TODO: Support [subjectKeyIdentifier] as signer's ID.\n     *\n     * @param signer the signer information:\n     *          key the signer's private key.\n     *          [certificate] a certificate containing the public key\n     *            associated with the signer's private key; use this option as\n     *            an alternative to specifying signer.issuer and\n     *            signer.serialNumber.\n     *          [issuer] the issuer attributes (eg: cert.issuer.attributes).\n     *          [serialNumber] the signer's certificate's serial number in\n     *           hexadecimal (eg: cert.serialNumber).\n     *          [digestAlgorithm] the message digest OID, as a string, to use\n     *            (eg: forge.pki.oids.sha1).\n     *          [authenticatedAttributes] an optional array of attributes\n     *            to also sign along with the content.\n     */\n    addSigner: function(signer) {\n      var issuer = signer.issuer;\n      var serialNumber = signer.serialNumber;\n      if(signer.certificate) {\n        var cert = signer.certificate;\n        if(typeof cert === 'string') {\n          cert = forge.pki.certificateFromPem(cert);\n        }\n        issuer = cert.issuer.attributes;\n        serialNumber = cert.serialNumber;\n      }\n      var key = signer.key;\n      if(!key) {\n        throw new Error(\n          'Could not add PKCS#7 signer; no private key specified.');\n      }\n      if(typeof key === 'string') {\n        key = forge.pki.privateKeyFromPem(key);\n      }\n\n      // ensure OID known for digest algorithm\n      var digestAlgorithm = signer.digestAlgorithm || forge.pki.oids.sha1;\n      switch(digestAlgorithm) {\n      case forge.pki.oids.sha1:\n      case forge.pki.oids.sha256:\n      case forge.pki.oids.sha384:\n      case forge.pki.oids.sha512:\n      case forge.pki.oids.md5:\n        break;\n      default:\n        throw new Error(\n          'Could not add PKCS#7 signer; unknown message digest algorithm: ' +\n          digestAlgorithm);\n      }\n\n      // if authenticatedAttributes is present, then the attributes\n      // must contain at least PKCS #9 content-type and message-digest\n      var authenticatedAttributes = signer.authenticatedAttributes || [];\n      if(authenticatedAttributes.length > 0) {\n        var contentType = false;\n        var messageDigest = false;\n        for(var i = 0; i < authenticatedAttributes.length; ++i) {\n          var attr = authenticatedAttributes[i];\n          if(!contentType && attr.type === forge.pki.oids.contentType) {\n            contentType = true;\n            if(messageDigest) {\n              break;\n            }\n            continue;\n          }\n          if(!messageDigest && attr.type === forge.pki.oids.messageDigest) {\n            messageDigest = true;\n            if(contentType) {\n              break;\n            }\n            continue;\n          }\n        }\n\n        if(!contentType || !messageDigest) {\n          throw new Error('Invalid signer.authenticatedAttributes. If ' +\n            'signer.authenticatedAttributes is specified, then it must ' +\n            'contain at least two attributes, PKCS #9 content-type and ' +\n            'PKCS #9 message-digest.');\n        }\n      }\n\n      msg.signers.push({\n        key: key,\n        version: 1,\n        issuer: issuer,\n        serialNumber: serialNumber,\n        digestAlgorithm: digestAlgorithm,\n        signatureAlgorithm: forge.pki.oids.rsaEncryption,\n        signature: null,\n        authenticatedAttributes: authenticatedAttributes,\n        unauthenticatedAttributes: []\n      });\n    },\n\n    /**\n     * Signs the content.\n     */\n    sign: function() {\n      // auto-generate content info\n      if(typeof msg.content !== 'object' || msg.contentInfo === null) {\n        // use Data ContentInfo\n        msg.contentInfo = asn1.create(\n          asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n            // ContentType\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n              asn1.oidToDer(forge.pki.oids.data).getBytes())\n          ]);\n\n        // add actual content, if present\n        if('content' in msg) {\n          var content;\n          if(msg.content instanceof forge.util.ByteBuffer) {\n            content = msg.content.bytes();\n          } else if(typeof msg.content === 'string') {\n            content = forge.util.encodeUtf8(msg.content);\n          }\n\n          msg.contentInfo.value.push(\n            // [0] EXPLICIT content\n            asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n              asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n                content)\n            ]));\n        }\n      }\n\n      // no signers, return early (degenerate case for certificate container)\n      if(msg.signers.length === 0) {\n        return;\n      }\n\n      // generate digest algorithm identifiers\n      var mds = addDigestAlgorithmIds();\n\n      // generate signerInfos\n      addSignerInfos(mds);\n    },\n\n    verify: function() {\n      throw new Error('PKCS#7 signature verification not yet implemented.');\n    },\n\n    /**\n     * Add a certificate.\n     *\n     * @param cert the certificate to add.\n     */\n    addCertificate: function(cert) {\n      // convert from PEM\n      if(typeof cert === 'string') {\n        cert = forge.pki.certificateFromPem(cert);\n      }\n      msg.certificates.push(cert);\n    },\n\n    /**\n     * Add a certificate revokation list.\n     *\n     * @param crl the certificate revokation list to add.\n     */\n    addCertificateRevokationList: function(crl) {\n      throw new Error('PKCS#7 CRL support not yet implemented.');\n    }\n  };\n  return msg;\n\n  function addDigestAlgorithmIds() {\n    var mds = {};\n\n    for(var i = 0; i < msg.signers.length; ++i) {\n      var signer = msg.signers[i];\n      var oid = signer.digestAlgorithm;\n      if(!(oid in mds)) {\n        // content digest\n        mds[oid] = forge.md[forge.pki.oids[oid]].create();\n      }\n      if(signer.authenticatedAttributes.length === 0) {\n        // no custom attributes to digest; use content message digest\n        signer.md = mds[oid];\n      } else {\n        // custom attributes to be digested; use own message digest\n        // TODO: optimize to just copy message digest state if that\n        // feature is ever supported with message digests\n        signer.md = forge.md[forge.pki.oids[oid]].create();\n      }\n    }\n\n    // add unique digest algorithm identifiers\n    msg.digestAlgorithmIdentifiers = [];\n    for(var oid in mds) {\n      msg.digestAlgorithmIdentifiers.push(\n        // AlgorithmIdentifier\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n          // algorithm\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n            asn1.oidToDer(oid).getBytes()),\n          // parameters (null)\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n        ]));\n    }\n\n    return mds;\n  }\n\n  function addSignerInfos(mds) {\n    // Note: ContentInfo is a SEQUENCE with 2 values, second value is\n    // the content field and is optional for a ContentInfo but required here\n    // since signers are present\n    if(msg.contentInfo.value.length < 2) {\n      throw new Error(\n        'Could not sign PKCS#7 message; there is no content to sign.');\n    }\n\n    // get ContentInfo content type\n    var contentType = asn1.derToOid(msg.contentInfo.value[0].value);\n\n    // get ContentInfo content\n    var content = msg.contentInfo.value[1];\n    // skip [0] EXPLICIT content wrapper\n    content = content.value[0];\n\n    // serialize content\n    var bytes = asn1.toDer(content);\n\n    // skip identifier and length per RFC 2315 9.3\n    // skip identifier (1 byte)\n    bytes.getByte();\n    // read and discard length bytes\n    asn1.getBerValueLength(bytes);\n    bytes = bytes.getBytes();\n\n    // digest content DER value bytes\n    for(var oid in mds) {\n      mds[oid].start().update(bytes);\n    }\n\n    // sign content\n    var signingTime = new Date();\n    for(var i = 0; i < msg.signers.length; ++i) {\n      var signer = msg.signers[i];\n\n      if(signer.authenticatedAttributes.length === 0) {\n        // if ContentInfo content type is not \"Data\", then\n        // authenticatedAttributes must be present per RFC 2315\n        if(contentType !== forge.pki.oids.data) {\n          throw new Error(\n            'Invalid signer; authenticatedAttributes must be present ' +\n            'when the ContentInfo content type is not PKCS#7 Data.');\n        }\n      } else {\n        // process authenticated attributes\n        // [0] IMPLICIT\n        signer.authenticatedAttributesAsn1 = asn1.create(\n          asn1.Class.CONTEXT_SPECIFIC, 0, true, []);\n\n        // per RFC 2315, attributes are to be digested using a SET container\n        // not the above [0] IMPLICIT container\n        var attrsAsn1 = asn1.create(\n          asn1.Class.UNIVERSAL, asn1.Type.SET, true, []);\n\n        for(var ai = 0; ai < signer.authenticatedAttributes.length; ++ai) {\n          var attr = signer.authenticatedAttributes[ai];\n          if(attr.type === forge.pki.oids.messageDigest) {\n            // use content message digest as value\n            attr.value = mds[signer.digestAlgorithm].digest();\n          } else if(attr.type === forge.pki.oids.signingTime) {\n            // auto-populate signing time if not already set\n            if(!attr.value) {\n              attr.value = signingTime;\n            }\n          }\n\n          // convert to ASN.1 and push onto Attributes SET (for signing) and\n          // onto authenticatedAttributesAsn1 to complete SignedData ASN.1\n          // TODO: optimize away duplication\n          attrsAsn1.value.push(_attributeToAsn1(attr));\n          signer.authenticatedAttributesAsn1.value.push(_attributeToAsn1(attr));\n        }\n\n        // DER-serialize and digest SET OF attributes only\n        bytes = asn1.toDer(attrsAsn1).getBytes();\n        signer.md.start().update(bytes);\n      }\n\n      // sign digest\n      signer.signature = signer.key.sign(signer.md, 'RSASSA-PKCS1-V1_5');\n    }\n\n    // add signer info\n    msg.signerInfos = _signersToAsn1(msg.signers);\n  }\n};\n\n/**\n * Creates an empty PKCS#7 message of type EncryptedData.\n *\n * @return the message.\n */\np7.createEncryptedData = function() {\n  var msg = null;\n  msg = {\n    type: forge.pki.oids.encryptedData,\n    version: 0,\n    encryptedContent: {\n      algorithm: forge.pki.oids['aes256-CBC']\n    },\n\n    /**\n     * Reads an EncryptedData content block (in ASN.1 format)\n     *\n     * @param obj The ASN.1 representation of the EncryptedData content block\n     */\n    fromAsn1: function(obj) {\n      // Validate EncryptedData content block and capture data.\n      _fromAsn1(msg, obj, p7.asn1.encryptedDataValidator);\n    },\n\n    /**\n     * Decrypt encrypted content\n     *\n     * @param key The (symmetric) key as a byte buffer\n     */\n    decrypt: function(key) {\n      if(key !== undefined) {\n        msg.encryptedContent.key = key;\n      }\n      _decryptContent(msg);\n    }\n  };\n  return msg;\n};\n\n/**\n * Creates an empty PKCS#7 message of type EnvelopedData.\n *\n * @return the message.\n */\np7.createEnvelopedData = function() {\n  var msg = null;\n  msg = {\n    type: forge.pki.oids.envelopedData,\n    version: 0,\n    recipients: [],\n    encryptedContent: {\n      algorithm: forge.pki.oids['aes256-CBC']\n    },\n\n    /**\n     * Reads an EnvelopedData content block (in ASN.1 format)\n     *\n     * @param obj the ASN.1 representation of the EnvelopedData content block.\n     */\n    fromAsn1: function(obj) {\n      // validate EnvelopedData content block and capture data\n      var capture = _fromAsn1(msg, obj, p7.asn1.envelopedDataValidator);\n      msg.recipients = _recipientsFromAsn1(capture.recipientInfos.value);\n    },\n\n    toAsn1: function() {\n      // ContentInfo\n      return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n        // ContentType\n        asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n          asn1.oidToDer(msg.type).getBytes()),\n        // [0] EnvelopedData\n        asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n          asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n            // Version\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n              asn1.integerToDer(msg.version).getBytes()),\n            // RecipientInfos\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true,\n              _recipientsToAsn1(msg.recipients)),\n            // EncryptedContentInfo\n            asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true,\n              _encryptedContentToAsn1(msg.encryptedContent))\n          ])\n        ])\n      ]);\n    },\n\n    /**\n     * Find recipient by X.509 certificate's issuer.\n     *\n     * @param cert the certificate with the issuer to look for.\n     *\n     * @return the recipient object.\n     */\n    findRecipient: function(cert) {\n      var sAttr = cert.issuer.attributes;\n\n      for(var i = 0; i < msg.recipients.length; ++i) {\n        var r = msg.recipients[i];\n        var rAttr = r.issuer;\n\n        if(r.serialNumber !== cert.serialNumber) {\n          continue;\n        }\n\n        if(rAttr.length !== sAttr.length) {\n          continue;\n        }\n\n        var match = true;\n        for(var j = 0; j < sAttr.length; ++j) {\n          if(rAttr[j].type !== sAttr[j].type ||\n            rAttr[j].value !== sAttr[j].value) {\n            match = false;\n            break;\n          }\n        }\n\n        if(match) {\n          return r;\n        }\n      }\n\n      return null;\n    },\n\n    /**\n     * Decrypt enveloped content\n     *\n     * @param recipient The recipient object related to the private key\n     * @param privKey The (RSA) private key object\n     */\n    decrypt: function(recipient, privKey) {\n      if(msg.encryptedContent.key === undefined && recipient !== undefined &&\n        privKey !== undefined) {\n        switch(recipient.encryptedContent.algorithm) {\n          case forge.pki.oids.rsaEncryption:\n          case forge.pki.oids.desCBC:\n            var key = privKey.decrypt(recipient.encryptedContent.content);\n            msg.encryptedContent.key = forge.util.createBuffer(key);\n            break;\n\n          default:\n            throw new Error('Unsupported asymmetric cipher, ' +\n              'OID ' + recipient.encryptedContent.algorithm);\n        }\n      }\n\n      _decryptContent(msg);\n    },\n\n    /**\n     * Add (another) entity to list of recipients.\n     *\n     * @param cert The certificate of the entity to add.\n     */\n    addRecipient: function(cert) {\n      msg.recipients.push({\n        version: 0,\n        issuer: cert.issuer.attributes,\n        serialNumber: cert.serialNumber,\n        encryptedContent: {\n          // We simply assume rsaEncryption here, since forge.pki only\n          // supports RSA so far.  If the PKI module supports other\n          // ciphers one day, we need to modify this one as well.\n          algorithm: forge.pki.oids.rsaEncryption,\n          key: cert.publicKey\n        }\n      });\n    },\n\n    /**\n     * Encrypt enveloped content.\n     *\n     * This function supports two optional arguments, cipher and key, which\n     * can be used to influence symmetric encryption.  Unless cipher is\n     * provided, the cipher specified in encryptedContent.algorithm is used\n     * (defaults to AES-256-CBC).  If no key is provided, encryptedContent.key\n     * is (re-)used.  If that one's not set, a random key will be generated\n     * automatically.\n     *\n     * @param [key] The key to be used for symmetric encryption.\n     * @param [cipher] The OID of the symmetric cipher to use.\n     */\n    encrypt: function(key, cipher) {\n      // Part 1: Symmetric encryption\n      if(msg.encryptedContent.content === undefined) {\n        cipher = cipher || msg.encryptedContent.algorithm;\n        key = key || msg.encryptedContent.key;\n\n        var keyLen, ivLen, ciphFn;\n        switch(cipher) {\n          case forge.pki.oids['aes128-CBC']:\n            keyLen = 16;\n            ivLen = 16;\n            ciphFn = forge.aes.createEncryptionCipher;\n            break;\n\n          case forge.pki.oids['aes192-CBC']:\n            keyLen = 24;\n            ivLen = 16;\n            ciphFn = forge.aes.createEncryptionCipher;\n            break;\n\n          case forge.pki.oids['aes256-CBC']:\n            keyLen = 32;\n            ivLen = 16;\n            ciphFn = forge.aes.createEncryptionCipher;\n            break;\n\n          case forge.pki.oids['des-EDE3-CBC']:\n            keyLen = 24;\n            ivLen = 8;\n            ciphFn = forge.des.createEncryptionCipher;\n            break;\n\n          default:\n            throw new Error('Unsupported symmetric cipher, OID ' + cipher);\n        }\n\n        if(key === undefined) {\n          key = forge.util.createBuffer(forge.random.getBytes(keyLen));\n        } else if(key.length() != keyLen) {\n          throw new Error('Symmetric key has wrong length; ' +\n            'got ' + key.length() + ' bytes, expected ' + keyLen + '.');\n        }\n\n        // Keep a copy of the key & IV in the object, so the caller can\n        // use it for whatever reason.\n        msg.encryptedContent.algorithm = cipher;\n        msg.encryptedContent.key = key;\n        msg.encryptedContent.parameter = forge.util.createBuffer(\n          forge.random.getBytes(ivLen));\n\n        var ciph = ciphFn(key);\n        ciph.start(msg.encryptedContent.parameter.copy());\n        ciph.update(msg.content);\n\n        // The finish function does PKCS#7 padding by default, therefore\n        // no action required by us.\n        if(!ciph.finish()) {\n          throw new Error('Symmetric encryption failed.');\n        }\n\n        msg.encryptedContent.content = ciph.output;\n      }\n\n      // Part 2: asymmetric encryption for each recipient\n      for(var i = 0; i < msg.recipients.length; ++i) {\n        var recipient = msg.recipients[i];\n\n        // Nothing to do, encryption already done.\n        if(recipient.encryptedContent.content !== undefined) {\n          continue;\n        }\n\n        switch(recipient.encryptedContent.algorithm) {\n          case forge.pki.oids.rsaEncryption:\n            recipient.encryptedContent.content =\n              recipient.encryptedContent.key.encrypt(\n                msg.encryptedContent.key.data);\n            break;\n\n          default:\n            throw new Error('Unsupported asymmetric cipher, OID ' +\n              recipient.encryptedContent.algorithm);\n        }\n      }\n    }\n  };\n  return msg;\n};\n\n/**\n * Converts a single recipient from an ASN.1 object.\n *\n * @param obj the ASN.1 RecipientInfo.\n *\n * @return the recipient object.\n */\nfunction _recipientFromAsn1(obj) {\n  // validate EnvelopedData content block and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#7 RecipientInfo. ' +\n      'ASN.1 object is not an PKCS#7 RecipientInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  return {\n    version: capture.version.charCodeAt(0),\n    issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n    serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n    encryptedContent: {\n      algorithm: asn1.derToOid(capture.encAlgorithm),\n      parameter: capture.encParameter.value,\n      content: capture.encKey\n    }\n  };\n}\n\n/**\n * Converts a single recipient object to an ASN.1 object.\n *\n * @param obj the recipient object.\n *\n * @return the ASN.1 RecipientInfo.\n */\nfunction _recipientToAsn1(obj) {\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // Version\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(obj.version).getBytes()),\n    // IssuerAndSerialNumber\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // Name\n      forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n      // Serial\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        forge.util.hexToBytes(obj.serialNumber))\n    ]),\n    // KeyEncryptionAlgorithmIdentifier\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // Algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(obj.encryptedContent.algorithm).getBytes()),\n      // Parameter, force NULL, only RSA supported for now.\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n    ]),\n    // EncryptedKey\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n      obj.encryptedContent.content)\n  ]);\n}\n\n/**\n * Map a set of RecipientInfo ASN.1 objects to recipient objects.\n *\n * @param infos an array of ASN.1 representations RecipientInfo (i.e. SET OF).\n *\n * @return an array of recipient objects.\n */\nfunction _recipientsFromAsn1(infos) {\n  var ret = [];\n  for(var i = 0; i < infos.length; ++i) {\n    ret.push(_recipientFromAsn1(infos[i]));\n  }\n  return ret;\n}\n\n/**\n * Map an array of recipient objects to ASN.1 RecipientInfo objects.\n *\n * @param recipients an array of recipientInfo objects.\n *\n * @return an array of ASN.1 RecipientInfos.\n */\nfunction _recipientsToAsn1(recipients) {\n  var ret = [];\n  for(var i = 0; i < recipients.length; ++i) {\n    ret.push(_recipientToAsn1(recipients[i]));\n  }\n  return ret;\n}\n\n/**\n * Converts a single signer from an ASN.1 object.\n *\n * @param obj the ASN.1 representation of a SignerInfo.\n *\n * @return the signer object.\n */\nfunction _signerFromAsn1(obj) {\n  // validate EnvelopedData content block and capture data\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, p7.asn1.signerInfoValidator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#7 SignerInfo. ' +\n      'ASN.1 object is not an PKCS#7 SignerInfo.');\n    error.errors = errors;\n    throw error;\n  }\n\n  var rval = {\n    version: capture.version.charCodeAt(0),\n    issuer: forge.pki.RDNAttributesAsArray(capture.issuer),\n    serialNumber: forge.util.createBuffer(capture.serial).toHex(),\n    digestAlgorithm: asn1.derToOid(capture.digestAlgorithm),\n    signatureAlgorithm: asn1.derToOid(capture.signatureAlgorithm),\n    signature: capture.signature,\n    authenticatedAttributes: [],\n    unauthenticatedAttributes: []\n  };\n\n  // TODO: convert attributes\n  var authenticatedAttributes = capture.authenticatedAttributes || [];\n  var unauthenticatedAttributes = capture.unauthenticatedAttributes || [];\n\n  return rval;\n}\n\n/**\n * Converts a single signerInfo object to an ASN.1 object.\n *\n * @param obj the signerInfo object.\n *\n * @return the ASN.1 representation of a SignerInfo.\n */\nfunction _signerToAsn1(obj) {\n  // SignerInfo\n  var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // version\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n      asn1.integerToDer(obj.version).getBytes()),\n    // issuerAndSerialNumber\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // name\n      forge.pki.distinguishedNameToAsn1({attributes: obj.issuer}),\n      // serial\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.INTEGER, false,\n        forge.util.hexToBytes(obj.serialNumber))\n    ]),\n    // digestAlgorithm\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(obj.digestAlgorithm).getBytes()),\n      // parameters (null)\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n    ])\n  ]);\n\n  // authenticatedAttributes (OPTIONAL)\n  if(obj.authenticatedAttributesAsn1) {\n    // add ASN.1 previously generated during signing\n    rval.value.push(obj.authenticatedAttributesAsn1);\n  }\n\n  // digestEncryptionAlgorithm\n  rval.value.push(asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // algorithm\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n      asn1.oidToDer(obj.signatureAlgorithm).getBytes()),\n    // parameters (null)\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.NULL, false, '')\n  ]));\n\n  // encryptedDigest\n  rval.value.push(asn1.create(\n    asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false, obj.signature));\n\n  // unauthenticatedAttributes (OPTIONAL)\n  if(obj.unauthenticatedAttributes.length > 0) {\n    // [1] IMPLICIT\n    var attrsAsn1 = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, []);\n    for(var i = 0; i < obj.unauthenticatedAttributes.length; ++i) {\n      var attr = obj.unauthenticatedAttributes[i];\n      attrsAsn1.values.push(_attributeToAsn1(attr));\n    }\n    rval.value.push(attrsAsn1);\n  }\n\n  return rval;\n}\n\n/**\n * Map a set of SignerInfo ASN.1 objects to an array of signer objects.\n *\n * @param signerInfoAsn1s an array of ASN.1 SignerInfos (i.e. SET OF).\n *\n * @return an array of signers objects.\n */\nfunction _signersFromAsn1(signerInfoAsn1s) {\n  var ret = [];\n  for(var i = 0; i < signerInfoAsn1s.length; ++i) {\n    ret.push(_signerFromAsn1(signerInfoAsn1s[i]));\n  }\n  return ret;\n}\n\n/**\n * Map an array of signer objects to ASN.1 objects.\n *\n * @param signers an array of signer objects.\n *\n * @return an array of ASN.1 SignerInfos.\n */\nfunction _signersToAsn1(signers) {\n  var ret = [];\n  for(var i = 0; i < signers.length; ++i) {\n    ret.push(_signerToAsn1(signers[i]));\n  }\n  return ret;\n}\n\n/**\n * Convert an attribute object to an ASN.1 Attribute.\n *\n * @param attr the attribute object.\n *\n * @return the ASN.1 Attribute.\n */\nfunction _attributeToAsn1(attr) {\n  var value;\n\n  // TODO: generalize to support more attributes\n  if(attr.type === forge.pki.oids.contentType) {\n    value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n      asn1.oidToDer(attr.value).getBytes());\n  } else if(attr.type === forge.pki.oids.messageDigest) {\n    value = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n      attr.value.bytes());\n  } else if(attr.type === forge.pki.oids.signingTime) {\n    /* Note per RFC 2985: Dates between 1 January 1950 and 31 December 2049\n      (inclusive) MUST be encoded as UTCTime. Any dates with year values\n      before 1950 or after 2049 MUST be encoded as GeneralizedTime. [Further,]\n      UTCTime values MUST be expressed in Greenwich Mean Time (Zulu) and MUST\n      include seconds (i.e., times are YYMMDDHHMMSSZ), even where the\n      number of seconds is zero.  Midnight (GMT) must be represented as\n      \"YYMMDD000000Z\". */\n    // TODO: make these module-level constants\n    var jan_1_1950 = new Date('1950-01-01T00:00:00Z');\n    var jan_1_2050 = new Date('2050-01-01T00:00:00Z');\n    var date = attr.value;\n    if(typeof date === 'string') {\n      // try to parse date\n      var timestamp = Date.parse(date);\n      if(!isNaN(timestamp)) {\n        date = new Date(timestamp);\n      } else if(date.length === 13) {\n        // YYMMDDHHMMSSZ (13 chars for UTCTime)\n        date = asn1.utcTimeToDate(date);\n      } else {\n        // assume generalized time\n        date = asn1.generalizedTimeToDate(date);\n      }\n    }\n\n    if(date >= jan_1_1950 && date < jan_1_2050) {\n      value = asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.UTCTIME, false,\n        asn1.dateToUtcTime(date));\n    } else {\n      value = asn1.create(\n        asn1.Class.UNIVERSAL, asn1.Type.GENERALIZEDTIME, false,\n        asn1.dateToGeneralizedTime(date));\n    }\n  }\n\n  // TODO: expose as common API call\n  // create a RelativeDistinguishedName set\n  // each value in the set is an AttributeTypeAndValue first\n  // containing the type (an OID) and second the value\n  return asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n    // AttributeType\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n      asn1.oidToDer(attr.type).getBytes()),\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, [\n      // AttributeValue\n      value\n    ])\n  ]);\n}\n\n/**\n * Map messages encrypted content to ASN.1 objects.\n *\n * @param ec The encryptedContent object of the message.\n *\n * @return ASN.1 representation of the encryptedContent object (SEQUENCE).\n */\nfunction _encryptedContentToAsn1(ec) {\n  return [\n    // ContentType, always Data for the moment\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n      asn1.oidToDer(forge.pki.oids.data).getBytes()),\n    // ContentEncryptionAlgorithmIdentifier\n    asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [\n      // Algorithm\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OID, false,\n        asn1.oidToDer(ec.algorithm).getBytes()),\n      // Parameters (IV)\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n        ec.parameter.getBytes())\n    ]),\n    // [0] EncryptedContent\n    asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, true, [\n      asn1.create(asn1.Class.UNIVERSAL, asn1.Type.OCTETSTRING, false,\n        ec.content.getBytes())\n    ])\n  ];\n}\n\n/**\n * Reads the \"common part\" of an PKCS#7 content block (in ASN.1 format)\n *\n * This function reads the \"common part\" of the PKCS#7 content blocks\n * EncryptedData and EnvelopedData, i.e. version number and symmetrically\n * encrypted content block.\n *\n * The result of the ASN.1 validate and capture process is returned\n * to allow the caller to extract further data, e.g. the list of recipients\n * in case of a EnvelopedData object.\n *\n * @param msg the PKCS#7 object to read the data to.\n * @param obj the ASN.1 representation of the content block.\n * @param validator the ASN.1 structure validator object to use.\n *\n * @return the value map captured by validator object.\n */\nfunction _fromAsn1(msg, obj, validator) {\n  var capture = {};\n  var errors = [];\n  if(!asn1.validate(obj, validator, capture, errors)) {\n    var error = new Error('Cannot read PKCS#7 message. ' +\n      'ASN.1 object is not a supported PKCS#7 message.');\n    error.errors = error;\n    throw error;\n  }\n\n  // Check contentType, so far we only support (raw) Data.\n  var contentType = asn1.derToOid(capture.contentType);\n  if(contentType !== forge.pki.oids.data) {\n    throw new Error('Unsupported PKCS#7 message. ' +\n      'Only wrapped ContentType Data supported.');\n  }\n\n  if(capture.encryptedContent) {\n    var content = '';\n    if(forge.util.isArray(capture.encryptedContent)) {\n      for(var i = 0; i < capture.encryptedContent.length; ++i) {\n        if(capture.encryptedContent[i].type !== asn1.Type.OCTETSTRING) {\n          throw new Error('Malformed PKCS#7 message, expecting encrypted ' +\n            'content constructed of only OCTET STRING objects.');\n        }\n        content += capture.encryptedContent[i].value;\n      }\n    } else {\n      content = capture.encryptedContent;\n    }\n    msg.encryptedContent = {\n      algorithm: asn1.derToOid(capture.encAlgorithm),\n      parameter: forge.util.createBuffer(capture.encParameter.value),\n      content: forge.util.createBuffer(content)\n    };\n  }\n\n  if(capture.content) {\n    var content = '';\n    if(forge.util.isArray(capture.content)) {\n      for(var i = 0; i < capture.content.length; ++i) {\n        if(capture.content[i].type !== asn1.Type.OCTETSTRING) {\n          throw new Error('Malformed PKCS#7 message, expecting ' +\n            'content constructed of only OCTET STRING objects.');\n        }\n        content += capture.content[i].value;\n      }\n    } else {\n      content = capture.content;\n    }\n    msg.content = forge.util.createBuffer(content);\n  }\n\n  msg.version = capture.version.charCodeAt(0);\n  msg.rawCapture = capture;\n\n  return capture;\n}\n\n/**\n * Decrypt the symmetrically encrypted content block of the PKCS#7 message.\n *\n * Decryption is skipped in case the PKCS#7 message object already has a\n * (decrypted) content attribute.  The algorithm, key and cipher parameters\n * (probably the iv) are taken from the encryptedContent attribute of the\n * message object.\n *\n * @param The PKCS#7 message object.\n */\nfunction _decryptContent(msg) {\n  if(msg.encryptedContent.key === undefined) {\n    throw new Error('Symmetric key not available.');\n  }\n\n  if(msg.content === undefined) {\n    var ciph;\n\n    switch(msg.encryptedContent.algorithm) {\n      case forge.pki.oids['aes128-CBC']:\n      case forge.pki.oids['aes192-CBC']:\n      case forge.pki.oids['aes256-CBC']:\n        ciph = forge.aes.createDecryptionCipher(msg.encryptedContent.key);\n        break;\n\n      case forge.pki.oids['desCBC']:\n      case forge.pki.oids['des-EDE3-CBC']:\n        ciph = forge.des.createDecryptionCipher(msg.encryptedContent.key);\n        break;\n\n      default:\n        throw new Error('Unsupported symmetric cipher, OID ' +\n          msg.encryptedContent.algorithm);\n    }\n    ciph.start(msg.encryptedContent.parameter);\n    ciph.update(msg.encryptedContent.content);\n\n    if(!ciph.finish()) {\n      throw new Error('Symmetric decryption failed.');\n    }\n\n    msg.content = ciph.output;\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/pkcs7.js\n// module id = 1130\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/pkcs7.js")},function(module,exports,__webpack_require__){eval("/**\n * Functions to output keys in SSH-friendly formats.\n *\n * This is part of the Forge project which may be used under the terms of\n * either the BSD License or the GNU General Public License (GPL) Version 2.\n *\n * See: https://github.com/digitalbazaar/forge/blob/cbebca3780658703d925b61b2caffb1d263a6c1d/LICENSE\n *\n * @author https://github.com/shellac\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(100);\n__webpack_require__(148);\n__webpack_require__(290);\n__webpack_require__(150);\n__webpack_require__(9);\n\nvar ssh = module.exports = forge.ssh = forge.ssh || {};\n\n/**\n * Encodes (and optionally encrypts) a private RSA key as a Putty PPK file.\n *\n * @param privateKey the key.\n * @param passphrase a passphrase to protect the key (falsy for no encryption).\n * @param comment a comment to include in the key file.\n *\n * @return the PPK file as a string.\n */\nssh.privateKeyToPutty = function(privateKey, passphrase, comment) {\n  comment = comment || '';\n  passphrase = passphrase || '';\n  var algorithm = 'ssh-rsa';\n  var encryptionAlgorithm = (passphrase === '') ? 'none' : 'aes256-cbc';\n\n  var ppk = 'PuTTY-User-Key-File-2: ' + algorithm + '\\r\\n';\n  ppk += 'Encryption: ' + encryptionAlgorithm + '\\r\\n';\n  ppk += 'Comment: ' + comment + '\\r\\n';\n\n  // public key into buffer for ppk\n  var pubbuffer = forge.util.createBuffer();\n  _addStringToBuffer(pubbuffer, algorithm);\n  _addBigIntegerToBuffer(pubbuffer, privateKey.e);\n  _addBigIntegerToBuffer(pubbuffer, privateKey.n);\n\n  // write public key\n  var pub = forge.util.encode64(pubbuffer.bytes(), 64);\n  var length = Math.floor(pub.length / 66) + 1; // 66 = 64 + \\r\\n\n  ppk += 'Public-Lines: ' + length + '\\r\\n';\n  ppk += pub;\n\n  // private key into a buffer\n  var privbuffer = forge.util.createBuffer();\n  _addBigIntegerToBuffer(privbuffer, privateKey.d);\n  _addBigIntegerToBuffer(privbuffer, privateKey.p);\n  _addBigIntegerToBuffer(privbuffer, privateKey.q);\n  _addBigIntegerToBuffer(privbuffer, privateKey.qInv);\n\n  // optionally encrypt the private key\n  var priv;\n  if(!passphrase) {\n    // use the unencrypted buffer\n    priv = forge.util.encode64(privbuffer.bytes(), 64);\n  } else {\n    // encrypt RSA key using passphrase\n    var encLen = privbuffer.length() + 16 - 1;\n    encLen -= encLen % 16;\n\n    // pad private key with sha1-d data -- needs to be a multiple of 16\n    var padding = _sha1(privbuffer.bytes());\n\n    padding.truncate(padding.length() - encLen + privbuffer.length());\n    privbuffer.putBuffer(padding);\n\n    var aeskey = forge.util.createBuffer();\n    aeskey.putBuffer(_sha1('\\x00\\x00\\x00\\x00', passphrase));\n    aeskey.putBuffer(_sha1('\\x00\\x00\\x00\\x01', passphrase));\n\n    // encrypt some bytes using CBC mode\n    // key is 40 bytes, so truncate *by* 8 bytes\n    var cipher = forge.aes.createEncryptionCipher(aeskey.truncate(8), 'CBC');\n    cipher.start(forge.util.createBuffer().fillWithByte(0, 16));\n    cipher.update(privbuffer.copy());\n    cipher.finish();\n    var encrypted = cipher.output;\n\n    // Note: this appears to differ from Putty -- is forge wrong, or putty?\n    // due to padding we finish as an exact multiple of 16\n    encrypted.truncate(16); // all padding\n\n    priv = forge.util.encode64(encrypted.bytes(), 64);\n  }\n\n  // output private key\n  length = Math.floor(priv.length / 66) + 1; // 64 + \\r\\n\n  ppk += '\\r\\nPrivate-Lines: ' + length + '\\r\\n';\n  ppk += priv;\n\n  // MAC\n  var mackey = _sha1('putty-private-key-file-mac-key', passphrase);\n\n  var macbuffer = forge.util.createBuffer();\n  _addStringToBuffer(macbuffer, algorithm);\n  _addStringToBuffer(macbuffer, encryptionAlgorithm);\n  _addStringToBuffer(macbuffer, comment);\n  macbuffer.putInt32(pubbuffer.length());\n  macbuffer.putBuffer(pubbuffer);\n  macbuffer.putInt32(privbuffer.length());\n  macbuffer.putBuffer(privbuffer);\n\n  var hmac = forge.hmac.create();\n  hmac.start('sha1', mackey);\n  hmac.update(macbuffer.bytes());\n\n  ppk += '\\r\\nPrivate-MAC: ' + hmac.digest().toHex() + '\\r\\n';\n\n  return ppk;\n};\n\n/**\n * Encodes a public RSA key as an OpenSSH file.\n *\n * @param key the key.\n * @param comment a comment.\n *\n * @return the public key in OpenSSH format.\n */\nssh.publicKeyToOpenSSH = function(key, comment) {\n  var type = 'ssh-rsa';\n  comment = comment || '';\n\n  var buffer = forge.util.createBuffer();\n  _addStringToBuffer(buffer, type);\n  _addBigIntegerToBuffer(buffer, key.e);\n  _addBigIntegerToBuffer(buffer, key.n);\n\n  return type + ' ' + forge.util.encode64(buffer.bytes()) + ' ' + comment;\n};\n\n/**\n * Encodes a private RSA key as an OpenSSH file.\n *\n * @param key the key.\n * @param passphrase a passphrase to protect the key (falsy for no encryption).\n *\n * @return the public key in OpenSSH format.\n */\nssh.privateKeyToOpenSSH = function(privateKey, passphrase) {\n  if(!passphrase) {\n    return forge.pki.privateKeyToPem(privateKey);\n  }\n  // OpenSSH private key is just a legacy format, it seems\n  return forge.pki.encryptRsaPrivateKey(privateKey, passphrase,\n    {legacy: true, algorithm: 'aes128'});\n};\n\n/**\n * Gets the SSH fingerprint for the given public key.\n *\n * @param options the options to use.\n *          [md] the message digest object to use (defaults to forge.md.md5).\n *          [encoding] an alternative output encoding, such as 'hex'\n *            (defaults to none, outputs a byte buffer).\n *          [delimiter] the delimiter to use between bytes for 'hex' encoded\n *            output, eg: ':' (defaults to none).\n *\n * @return the fingerprint as a byte buffer or other encoding based on options.\n */\nssh.getPublicKeyFingerprint = function(key, options) {\n  options = options || {};\n  var md = options.md || forge.md.md5.create();\n\n  var type = 'ssh-rsa';\n  var buffer = forge.util.createBuffer();\n  _addStringToBuffer(buffer, type);\n  _addBigIntegerToBuffer(buffer, key.e);\n  _addBigIntegerToBuffer(buffer, key.n);\n\n  // hash public key bytes\n  md.start();\n  md.update(buffer.getBytes());\n  var digest = md.digest();\n  if(options.encoding === 'hex') {\n    var hex = digest.toHex();\n    if(options.delimiter) {\n      return hex.match(/.{2}/g).join(options.delimiter);\n    }\n    return hex;\n  } else if(options.encoding === 'binary') {\n    return digest.getBytes();\n  } else if(options.encoding) {\n    throw new Error('Unknown encoding \"' + options.encoding + '\".');\n  }\n  return digest;\n};\n\n/**\n * Adds len(val) then val to a buffer.\n *\n * @param buffer the buffer to add to.\n * @param val a big integer.\n */\nfunction _addBigIntegerToBuffer(buffer, val) {\n  var hexVal = val.toString(16);\n  // ensure 2s complement +ve\n  if(hexVal[0] >= '8') {\n    hexVal = '00' + hexVal;\n  }\n  var bytes = forge.util.hexToBytes(hexVal);\n  buffer.putInt32(bytes.length);\n  buffer.putBytes(bytes);\n}\n\n/**\n * Adds len(val) then val to a buffer.\n *\n * @param buffer the buffer to add to.\n * @param val a string.\n */\nfunction _addStringToBuffer(buffer, val) {\n  buffer.putInt32(val.length);\n  buffer.putString(val);\n}\n\n/**\n * Hashes the arguments into one value using SHA-1.\n *\n * @return the sha1 hash of the provided arguments.\n */\nfunction _sha1() {\n  var sha = forge.md.sha1.create();\n  var num = arguments.length;\n  for (var i = 0; i < num; ++i) {\n    sha.update(arguments[i]);\n  }\n  return sha.digest();\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/ssh.js\n// module id = 1131\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/ssh.js")},function(module,exports,__webpack_require__){eval("/**\n * Support for concurrent task management and synchronization in web\n * applications.\n *\n * @author Dave Longley\n * @author David I. Lehn <dlehn@digitalbazaar.com>\n *\n * Copyright (c) 2009-2013 Digital Bazaar, Inc.\n */\nvar forge = __webpack_require__(7);\n__webpack_require__(482);\n__webpack_require__(483);\n__webpack_require__(9);\n\n// logging category\nvar cat = 'forge.task';\n\n// verbose level\n// 0: off, 1: a little, 2: a whole lot\n// Verbose debug logging is surrounded by a level check to avoid the\n// performance issues with even calling the logging code regardless if it\n// is actually logged.  For performance reasons this should not be set to 2\n// for production use.\n// ex: if(sVL >= 2) forge.log.verbose(....)\nvar sVL = 0;\n\n// track tasks for debugging\nvar sTasks = {};\nvar sNextTaskId = 0;\n// debug access\nforge.debug.set(cat, 'tasks', sTasks);\n\n// a map of task type to task queue\nvar sTaskQueues = {};\n// debug access\nforge.debug.set(cat, 'queues', sTaskQueues);\n\n// name for unnamed tasks\nvar sNoTaskName = '?';\n\n// maximum number of doNext() recursions before a context swap occurs\n// FIXME: might need to tweak this based on the browser\nvar sMaxRecursions = 30;\n\n// time slice for doing tasks before a context swap occurs\n// FIXME: might need to tweak this based on the browser\nvar sTimeSlice = 20;\n\n/**\n * Task states.\n *\n * READY: ready to start processing\n * RUNNING: task or a subtask is running\n * BLOCKED: task is waiting to acquire N permits to continue\n * SLEEPING: task is sleeping for a period of time\n * DONE: task is done\n * ERROR: task has an error\n */\nvar READY = 'ready';\nvar RUNNING = 'running';\nvar BLOCKED = 'blocked';\nvar SLEEPING = 'sleeping';\nvar DONE = 'done';\nvar ERROR = 'error';\n\n/**\n * Task actions.  Used to control state transitions.\n *\n * STOP: stop processing\n * START: start processing tasks\n * BLOCK: block task from continuing until 1 or more permits are released\n * UNBLOCK: release one or more permits\n * SLEEP: sleep for a period of time\n * WAKEUP: wakeup early from SLEEPING state\n * CANCEL: cancel further tasks\n * FAIL: a failure occured\n */\nvar STOP = 'stop';\nvar START = 'start';\nvar BLOCK = 'block';\nvar UNBLOCK = 'unblock';\nvar SLEEP = 'sleep';\nvar WAKEUP = 'wakeup';\nvar CANCEL = 'cancel';\nvar FAIL = 'fail';\n\n/**\n * State transition table.\n *\n * nextState = sStateTable[currentState][action]\n */\nvar sStateTable = {};\n\nsStateTable[READY] = {};\nsStateTable[READY][STOP] = READY;\nsStateTable[READY][START] = RUNNING;\nsStateTable[READY][CANCEL] = DONE;\nsStateTable[READY][FAIL] = ERROR;\n\nsStateTable[RUNNING] = {};\nsStateTable[RUNNING][STOP] = READY;\nsStateTable[RUNNING][START] = RUNNING;\nsStateTable[RUNNING][BLOCK] = BLOCKED;\nsStateTable[RUNNING][UNBLOCK] = RUNNING;\nsStateTable[RUNNING][SLEEP] = SLEEPING;\nsStateTable[RUNNING][WAKEUP] = RUNNING;\nsStateTable[RUNNING][CANCEL] = DONE;\nsStateTable[RUNNING][FAIL] = ERROR;\n\nsStateTable[BLOCKED] = {};\nsStateTable[BLOCKED][STOP] = BLOCKED;\nsStateTable[BLOCKED][START] = BLOCKED;\nsStateTable[BLOCKED][BLOCK] = BLOCKED;\nsStateTable[BLOCKED][UNBLOCK] = BLOCKED;\nsStateTable[BLOCKED][SLEEP] = BLOCKED;\nsStateTable[BLOCKED][WAKEUP] = BLOCKED;\nsStateTable[BLOCKED][CANCEL] = DONE;\nsStateTable[BLOCKED][FAIL] = ERROR;\n\nsStateTable[SLEEPING] = {};\nsStateTable[SLEEPING][STOP] = SLEEPING;\nsStateTable[SLEEPING][START] = SLEEPING;\nsStateTable[SLEEPING][BLOCK] = SLEEPING;\nsStateTable[SLEEPING][UNBLOCK] = SLEEPING;\nsStateTable[SLEEPING][SLEEP] = SLEEPING;\nsStateTable[SLEEPING][WAKEUP] = SLEEPING;\nsStateTable[SLEEPING][CANCEL] = DONE;\nsStateTable[SLEEPING][FAIL] = ERROR;\n\nsStateTable[DONE] = {};\nsStateTable[DONE][STOP] = DONE;\nsStateTable[DONE][START] = DONE;\nsStateTable[DONE][BLOCK] = DONE;\nsStateTable[DONE][UNBLOCK] = DONE;\nsStateTable[DONE][SLEEP] = DONE;\nsStateTable[DONE][WAKEUP] = DONE;\nsStateTable[DONE][CANCEL] = DONE;\nsStateTable[DONE][FAIL] = ERROR;\n\nsStateTable[ERROR] = {};\nsStateTable[ERROR][STOP] = ERROR;\nsStateTable[ERROR][START] = ERROR;\nsStateTable[ERROR][BLOCK] = ERROR;\nsStateTable[ERROR][UNBLOCK] = ERROR;\nsStateTable[ERROR][SLEEP] = ERROR;\nsStateTable[ERROR][WAKEUP] = ERROR;\nsStateTable[ERROR][CANCEL] = ERROR;\nsStateTable[ERROR][FAIL] = ERROR;\n\n/**\n * Creates a new task.\n *\n * @param options options for this task\n *   run: the run function for the task (required)\n *   name: the run function for the task (optional)\n *   parent: parent of this task (optional)\n *\n * @return the empty task.\n */\nvar Task = function(options) {\n  // task id\n  this.id = -1;\n\n  // task name\n  this.name = options.name || sNoTaskName;\n\n  // task has no parent\n  this.parent = options.parent || null;\n\n  // save run function\n  this.run = options.run;\n\n  // create a queue of subtasks to run\n  this.subtasks = [];\n\n  // error flag\n  this.error = false;\n\n  // state of the task\n  this.state = READY;\n\n  // number of times the task has been blocked (also the number\n  // of permits needed to be released to continue running)\n  this.blocks = 0;\n\n  // timeout id when sleeping\n  this.timeoutId = null;\n\n  // no swap time yet\n  this.swapTime = null;\n\n  // no user data\n  this.userData = null;\n\n  // initialize task\n  // FIXME: deal with overflow\n  this.id = sNextTaskId++;\n  sTasks[this.id] = this;\n  if(sVL >= 1) {\n    forge.log.verbose(cat, '[%s][%s] init', this.id, this.name, this);\n  }\n};\n\n/**\n * Logs debug information on this task and the system state.\n */\nTask.prototype.debug = function(msg) {\n  msg = msg || '';\n  forge.log.debug(cat, msg,\n    '[%s][%s] task:', this.id, this.name, this,\n    'subtasks:', this.subtasks.length,\n    'queue:', sTaskQueues);\n};\n\n/**\n * Adds a subtask to run after task.doNext() or task.fail() is called.\n *\n * @param name human readable name for this task (optional).\n * @param subrun a function to run that takes the current task as\n *          its first parameter.\n *\n * @return the current task (useful for chaining next() calls).\n */\nTask.prototype.next = function(name, subrun) {\n  // juggle parameters if it looks like no name is given\n  if(typeof(name) === 'function') {\n    subrun = name;\n\n    // inherit parent's name\n    name = this.name;\n  }\n  // create subtask, set parent to this task, propagate callbacks\n  var subtask = new Task({\n    run: subrun,\n    name: name,\n    parent: this\n  });\n  // start subtasks running\n  subtask.state = RUNNING;\n  subtask.type = this.type;\n  subtask.successCallback = this.successCallback || null;\n  subtask.failureCallback = this.failureCallback || null;\n\n  // queue a new subtask\n  this.subtasks.push(subtask);\n\n  return this;\n};\n\n/**\n * Adds subtasks to run in parallel after task.doNext() or task.fail()\n * is called.\n *\n * @param name human readable name for this task (optional).\n * @param subrun functions to run that take the current task as\n *          their first parameter.\n *\n * @return the current task (useful for chaining next() calls).\n */\nTask.prototype.parallel = function(name, subrun) {\n  // juggle parameters if it looks like no name is given\n  if(forge.util.isArray(name)) {\n    subrun = name;\n\n    // inherit parent's name\n    name = this.name;\n  }\n  // Wrap parallel tasks in a regular task so they are started at the\n  // proper time.\n  return this.next(name, function(task) {\n    // block waiting for subtasks\n    var ptask = task;\n    ptask.block(subrun.length);\n\n    // we pass the iterator from the loop below as a parameter\n    // to a function because it is otherwise included in the\n    // closure and changes as the loop changes -- causing i\n    // to always be set to its highest value\n    var startParallelTask = function(pname, pi) {\n      forge.task.start({\n        type: pname,\n        run: function(task) {\n           subrun[pi](task);\n        },\n        success: function(task) {\n           ptask.unblock();\n        },\n        failure: function(task) {\n           ptask.unblock();\n        }\n      });\n    };\n\n    for(var i = 0; i < subrun.length; i++) {\n      // Type must be unique so task starts in parallel:\n      //    name + private string + task id + sub-task index\n      // start tasks in parallel and unblock when the finish\n      var pname = name + '__parallel-' + task.id + '-' + i;\n      var pi = i;\n      startParallelTask(pname, pi);\n    }\n  });\n};\n\n/**\n * Stops a running task.\n */\nTask.prototype.stop = function() {\n  this.state = sStateTable[this.state][STOP];\n};\n\n/**\n * Starts running a task.\n */\nTask.prototype.start = function() {\n  this.error = false;\n  this.state = sStateTable[this.state][START];\n\n  // try to restart\n  if(this.state === RUNNING) {\n    this.start = new Date();\n    this.run(this);\n    runNext(this, 0);\n  }\n};\n\n/**\n * Blocks a task until it one or more permits have been released. The\n * task will not resume until the requested number of permits have\n * been released with call(s) to unblock().\n *\n * @param n number of permits to wait for(default: 1).\n */\nTask.prototype.block = function(n) {\n  n = typeof(n) === 'undefined' ? 1 : n;\n  this.blocks += n;\n  if(this.blocks > 0) {\n    this.state = sStateTable[this.state][BLOCK];\n  }\n};\n\n/**\n * Releases a permit to unblock a task. If a task was blocked by\n * requesting N permits via block(), then it will only continue\n * running once enough permits have been released via unblock() calls.\n *\n * If multiple processes need to synchronize with a single task then\n * use a condition variable (see forge.task.createCondition). It is\n * an error to unblock a task more times than it has been blocked.\n *\n * @param n number of permits to release (default: 1).\n *\n * @return the current block count (task is unblocked when count is 0)\n */\nTask.prototype.unblock = function(n) {\n  n = typeof(n) === 'undefined' ? 1 : n;\n  this.blocks -= n;\n  if(this.blocks === 0 && this.state !== DONE) {\n    this.state = RUNNING;\n    runNext(this, 0);\n  }\n  return this.blocks;\n};\n\n/**\n * Sleep for a period of time before resuming tasks.\n *\n * @param n number of milliseconds to sleep (default: 0).\n */\nTask.prototype.sleep = function(n) {\n  n = typeof(n) === 'undefined' ? 0 : n;\n  this.state = sStateTable[this.state][SLEEP];\n  var self = this;\n  this.timeoutId = setTimeout(function() {\n    self.timeoutId = null;\n    self.state = RUNNING;\n    runNext(self, 0);\n  }, n);\n};\n\n/**\n * Waits on a condition variable until notified. The next task will\n * not be scheduled until notification. A condition variable can be\n * created with forge.task.createCondition().\n *\n * Once cond.notify() is called, the task will continue.\n *\n * @param cond the condition variable to wait on.\n */\nTask.prototype.wait = function(cond) {\n  cond.wait(this);\n};\n\n/**\n * If sleeping, wakeup and continue running tasks.\n */\nTask.prototype.wakeup = function() {\n  if(this.state === SLEEPING) {\n    cancelTimeout(this.timeoutId);\n    this.timeoutId = null;\n    this.state = RUNNING;\n    runNext(this, 0);\n  }\n};\n\n/**\n * Cancel all remaining subtasks of this task.\n */\nTask.prototype.cancel = function() {\n  this.state = sStateTable[this.state][CANCEL];\n  // remove permits needed\n  this.permitsNeeded = 0;\n  // cancel timeouts\n  if(this.timeoutId !== null) {\n    cancelTimeout(this.timeoutId);\n    this.timeoutId = null;\n  }\n  // remove subtasks\n  this.subtasks = [];\n};\n\n/**\n * Finishes this task with failure and sets error flag. The entire\n * task will be aborted unless the next task that should execute\n * is passed as a parameter. This allows levels of subtasks to be\n * skipped. For instance, to abort only this tasks's subtasks, then\n * call fail(task.parent). To abort this task's subtasks and its\n * parent's subtasks, call fail(task.parent.parent). To abort\n * all tasks and simply call the task callback, call fail() or\n * fail(null).\n *\n * The task callback (success or failure) will always, eventually, be\n * called.\n *\n * @param next the task to continue at, or null to abort entirely.\n */\nTask.prototype.fail = function(next) {\n  // set error flag\n  this.error = true;\n\n  // finish task\n  finish(this, true);\n\n  if(next) {\n    // propagate task info\n    next.error = this.error;\n    next.swapTime = this.swapTime;\n    next.userData = this.userData;\n\n    // do next task as specified\n    runNext(next, 0);\n  } else {\n    if(this.parent !== null) {\n      // finish root task (ensures it is removed from task queue)\n      var parent = this.parent;\n      while(parent.parent !== null) {\n        // propagate task info\n        parent.error = this.error;\n        parent.swapTime = this.swapTime;\n        parent.userData = this.userData;\n        parent = parent.parent;\n      }\n      finish(parent, true);\n    }\n\n    // call failure callback if one exists\n    if(this.failureCallback) {\n      this.failureCallback(this);\n    }\n  }\n};\n\n/**\n * Asynchronously start a task.\n *\n * @param task the task to start.\n */\nvar start = function(task) {\n  task.error = false;\n  task.state = sStateTable[task.state][START];\n  setTimeout(function() {\n    if(task.state === RUNNING) {\n      task.swapTime = +new Date();\n      task.run(task);\n      runNext(task, 0);\n    }\n  }, 0);\n};\n\n/**\n * Run the next subtask or finish this task.\n *\n * @param task the task to process.\n * @param recurse the recursion count.\n */\nvar runNext = function(task, recurse) {\n  // get time since last context swap (ms), if enough time has passed set\n  // swap to true to indicate that doNext was performed asynchronously\n  // also, if recurse is too high do asynchronously\n  var swap =\n    (recurse > sMaxRecursions) ||\n    (+new Date() - task.swapTime) > sTimeSlice;\n\n  var doNext = function(recurse) {\n    recurse++;\n    if(task.state === RUNNING) {\n      if(swap) {\n        // update swap time\n        task.swapTime = +new Date();\n      }\n\n      if(task.subtasks.length > 0) {\n        // run next subtask\n        var subtask = task.subtasks.shift();\n        subtask.error = task.error;\n        subtask.swapTime = task.swapTime;\n        subtask.userData = task.userData;\n        subtask.run(subtask);\n        if(!subtask.error) {\n           runNext(subtask, recurse);\n        }\n      } else {\n        finish(task);\n\n        if(!task.error) {\n          // chain back up and run parent\n          if(task.parent !== null) {\n            // propagate task info\n            task.parent.error = task.error;\n            task.parent.swapTime = task.swapTime;\n            task.parent.userData = task.userData;\n\n            // no subtasks left, call run next subtask on parent\n            runNext(task.parent, recurse);\n          }\n        }\n      }\n    }\n  };\n\n  if(swap) {\n    // we're swapping, so run asynchronously\n    setTimeout(doNext, 0);\n  } else {\n    // not swapping, so run synchronously\n    doNext(recurse);\n  }\n};\n\n/**\n * Finishes a task and looks for the next task in the queue to start.\n *\n * @param task the task to finish.\n * @param suppressCallbacks true to suppress callbacks.\n */\nvar finish = function(task, suppressCallbacks) {\n  // subtask is now done\n  task.state = DONE;\n\n  delete sTasks[task.id];\n  if(sVL >= 1) {\n    forge.log.verbose(cat, '[%s][%s] finish',\n      task.id, task.name, task);\n  }\n\n  // only do queue processing for root tasks\n  if(task.parent === null) {\n    // report error if queue is missing\n    if(!(task.type in sTaskQueues)) {\n      forge.log.error(cat,\n        '[%s][%s] task queue missing [%s]',\n        task.id, task.name, task.type);\n    } else if(sTaskQueues[task.type].length === 0) {\n      // report error if queue is empty\n      forge.log.error(cat,\n        '[%s][%s] task queue empty [%s]',\n        task.id, task.name, task.type);\n    } else if(sTaskQueues[task.type][0] !== task) {\n      // report error if this task isn't the first in the queue\n      forge.log.error(cat,\n        '[%s][%s] task not first in queue [%s]',\n        task.id, task.name, task.type);\n    } else {\n      // remove ourselves from the queue\n      sTaskQueues[task.type].shift();\n      // clean up queue if it is empty\n      if(sTaskQueues[task.type].length === 0) {\n        if(sVL >= 1) {\n          forge.log.verbose(cat, '[%s][%s] delete queue [%s]',\n            task.id, task.name, task.type);\n        }\n        /* Note: Only a task can delete a queue of its own type. This\n         is used as a way to synchronize tasks. If a queue for a certain\n         task type exists, then a task of that type is running.\n         */\n        delete sTaskQueues[task.type];\n      } else {\n        // dequeue the next task and start it\n        if(sVL >= 1) {\n          forge.log.verbose(cat,\n            '[%s][%s] queue start next [%s] remain:%s',\n            task.id, task.name, task.type,\n            sTaskQueues[task.type].length);\n        }\n        sTaskQueues[task.type][0].start();\n      }\n    }\n\n    if(!suppressCallbacks) {\n      // call final callback if one exists\n      if(task.error && task.failureCallback) {\n        task.failureCallback(task);\n      } else if(!task.error && task.successCallback) {\n        task.successCallback(task);\n      }\n    }\n  }\n};\n\n/* Tasks API */\nmodule.exports = forge.task = forge.task || {};\n\n/**\n * Starts a new task that will run the passed function asynchronously.\n *\n * In order to finish the task, either task.doNext() or task.fail()\n * *must* be called.\n *\n * The task must have a type (a string identifier) that can be used to\n * synchronize it with other tasks of the same type. That type can also\n * be used to cancel tasks that haven't started yet.\n *\n * To start a task, the following object must be provided as a parameter\n * (each function takes a task object as its first parameter):\n *\n * {\n *   type: the type of task.\n *   run: the function to run to execute the task.\n *   success: a callback to call when the task succeeds (optional).\n *   failure: a callback to call when the task fails (optional).\n * }\n *\n * @param options the object as described above.\n */\nforge.task.start = function(options) {\n  // create a new task\n  var task = new Task({\n    run: options.run,\n    name: options.name || sNoTaskName\n  });\n  task.type = options.type;\n  task.successCallback = options.success || null;\n  task.failureCallback = options.failure || null;\n\n  // append the task onto the appropriate queue\n  if(!(task.type in sTaskQueues)) {\n    if(sVL >= 1) {\n      forge.log.verbose(cat, '[%s][%s] create queue [%s]',\n        task.id, task.name, task.type);\n    }\n    // create the queue with the new task\n    sTaskQueues[task.type] = [task];\n    start(task);\n  } else {\n    // push the task onto the queue, it will be run after a task\n    // with the same type completes\n    sTaskQueues[options.type].push(task);\n  }\n};\n\n/**\n * Cancels all tasks of the given type that haven't started yet.\n *\n * @param type the type of task to cancel.\n */\nforge.task.cancel = function(type) {\n  // find the task queue\n  if(type in sTaskQueues) {\n    // empty all but the current task from the queue\n    sTaskQueues[type] = [sTaskQueues[type][0]];\n  }\n};\n\n/**\n * Creates a condition variable to synchronize tasks. To make a task wait\n * on the condition variable, call task.wait(condition). To notify all\n * tasks that are waiting, call condition.notify().\n *\n * @return the condition variable.\n */\nforge.task.createCondition = function() {\n  var cond = {\n    // all tasks that are blocked\n    tasks: {}\n  };\n\n  /**\n   * Causes the given task to block until notify is called. If the task\n   * is already waiting on this condition then this is a no-op.\n   *\n   * @param task the task to cause to wait.\n   */\n  cond.wait = function(task) {\n    // only block once\n    if(!(task.id in cond.tasks)) {\n       task.block();\n       cond.tasks[task.id] = task;\n    }\n  };\n\n  /**\n   * Notifies all waiting tasks to wake up.\n   */\n  cond.notify = function() {\n    // since unblock() will run the next task from here, make sure to\n    // clear the condition's blocked task list before unblocking\n    var tmp = cond.tasks;\n    cond.tasks = {};\n    for(var id in tmp) {\n      tmp[id].unblock();\n    }\n  };\n\n  return cond;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-forge/lib/task.js\n// module id = 1132\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-forge/lib/task.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t    counter = 0,\n\t\t    length = string.length,\n\t\t    value,\n\t\t    extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t//  0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t    inputLength = input.length,\n\t\t    out,\n\t\t    i = 0,\n\t\t    n = initialN,\n\t\t    bias = initialBias,\n\t\t    basic,\n\t\t    j,\n\t\t    index,\n\t\t    oldi,\n\t\t    w,\n\t\t    k,\n\t\t    digit,\n\t\t    t,\n\t\t    /** Cached calculation results */\n\t\t    baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t    delta,\n\t\t    handledCPCount,\n\t\t    basicLength,\n\t\t    bias,\n\t\t    j,\n\t\t    m,\n\t\t    q,\n\t\t    k,\n\t\t    t,\n\t\t    currentValue,\n\t\t    output = [],\n\t\t    /** `inputLength` will hold the number of code points in `input`. */\n\t\t    inputLength,\n\t\t    /** Cached calculation results */\n\t\t    handledCPCountPlusOne,\n\t\t    baseMinusT,\n\t\t    qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttrue\n\t) {\n\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\treturn punycode;\n\t\t}.call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module), __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/node-libs-browser/~/punycode/punycode.js\n// module id = 1133\n// module chunks = 0\n\n//# sourceURL=../node_modules/node-libs-browser/node_modules/punycode/punycode.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(setImmediate, process) {var Promise = __webpack_require__(1135);\nvar isPromise = __webpack_require__(430);\n\nvar nextTick;\nif (typeof setImmediate === 'function') nextTick = setImmediate\nelse if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick\nelse nextTick = function (cb) { setTimeout(cb, 0) }\n\nmodule.exports = nodeify;\nfunction nodeify(promise, cb) {\n  if (typeof cb !== 'function') return promise;\n  return promise\n    .then(function (res) {\n      nextTick(function () {\n        cb(null, res);\n      });\n    }, function (err) {\n      nextTick(function () {\n        cb(err);\n      });\n    });\n}\nfunction nodeifyThis(cb) {\n  return nodeify(this, cb);\n}\n\nnodeify.extend = extend;\nnodeify.Promise = NodeifyPromise;\n\nfunction extend(prom) {\n  if (prom && isPromise(prom)) {\n    prom.nodeify = nodeifyThis;\n    var then = prom.then;\n    prom.then = function () {\n      return extend(then.apply(this, arguments));\n    };\n    return prom;\n  } else if (typeof prom === 'function') {\n    prom.prototype.nodeify = nodeifyThis;\n  } else {\n    Promise.prototype.nodeify = nodeifyThis;\n  }\n}\n\nfunction NodeifyPromise(fn) {\n  if (!(this instanceof NodeifyPromise)) {\n    return new NodeifyPromise(fn);\n  }\n  Promise.call(this, fn);\n  extend(this);\n}\n\nNodeifyPromise.prototype = Object.create(Promise.prototype);\nNodeifyPromise.prototype.constructor = NodeifyPromise;\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/nodeify/index.js\n// module id = 1134\n// module chunks = 0\n\n//# sourceURL=../node_modules/nodeify/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {var isPromise = __webpack_require__(430)\r\n\r\nvar nextTick;\r\nif (typeof setImediate === 'function') nextTick = setImediate\r\nelse if (typeof process === 'object' && process && process.nextTick) nextTick = process.nextTick\r\nelse nextTick = function (cb) { setTimeout(cb, 0) }\r\n\r\nvar extensions = [];\r\n\r\nmodule.exports = Promise\r\nfunction Promise(fn) {\r\n  if (!(this instanceof Promise)) {\r\n    return typeof fn === 'function' ? new Promise(fn) : defer()\r\n  }\r\n  var isResolved = false\r\n  var isFulfilled = false\r\n  var value\r\n  var waiting = []\r\n  var running = false\r\n\r\n  function next(skipTimeout) {\r\n    if (waiting.length) {\r\n      running = true\r\n      waiting.shift()(skipTimeout || false)\r\n    } else {\r\n      running = false\r\n    }\r\n  }\r\n  this.then = then;\r\n  function then(cb, eb) {\r\n    return new Promise(function (resolver) {\r\n      function done(skipTimeout) {\r\n        var callback = isFulfilled ? cb : eb\r\n        if (typeof callback === 'function') {\r\n          function timeoutDone() {\r\n            var val;\r\n            try {\r\n              val = callback(value)\r\n            } catch (ex) {\r\n              resolver.reject(ex)\r\n              return next()\r\n            }\r\n            resolver.fulfill(val);\r\n            next(true);\r\n          }\r\n          if (skipTimeout) timeoutDone()\r\n          else nextTick(timeoutDone)\r\n        } else if (isFulfilled) {\r\n          resolver.fulfill(value)\r\n          next(skipTimeout)\r\n        } else {\r\n          resolver.reject(value)\r\n          next(skipTimeout)\r\n        }\r\n      }\r\n      waiting.push(done)\r\n      if (isResolved && !running) next()\r\n    });\r\n  }\r\n  \r\n  (function () {\r\n    function fulfill(val) {\r\n      if (isResolved) return\r\n      if (isPromise(val)) val.then(fulfill, reject)\r\n      else {\r\n        isResolved = isFulfilled = true\r\n        value = val\r\n        next()\r\n      }\r\n    }\r\n    function reject(err) {\r\n      if (isResolved) return\r\n      isResolved = true\r\n      isFulfilled = false\r\n      value = err\r\n      next()\r\n    }\r\n    var resolver = {fulfill: fulfill, reject: reject};\r\n    for (var i = 0; i < extensions.length; i++) {\r\n      extensions[i](this, resolver);\r\n    }\r\n    if (typeof fn === 'function') {\r\n      try {\r\n        fn(resolver)\r\n      } catch (ex) {\r\n        resolver.reject(ex);\r\n      }\r\n    }\r\n  }());\r\n}\r\nfunction defer() {\r\n  var resolver\r\n  var promise = new Promise(function (res) { resolver = res })\r\n  return {resolver: resolver, promise: promise}\r\n}\r\nPromise.use = function (extension) {\r\n  extensions.push(extension);\r\n};\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/nodeify/~/promise/index.js\n// module id = 1135\n// module chunks = 0\n\n//# sourceURL=../node_modules/nodeify/node_modules/promise/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(0).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/number-to-bn/~/bn.js/lib/bn.js\n// module id = 1136\n// module chunks = 0\n\n//# sourceURL=../node_modules/number-to-bn/node_modules/bn.js/lib/bn.js")},function(module,exports){eval('module.exports = {"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/aesid.json\n// module id = 1137\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/aesid.json')},function(module,exports,__webpack_require__){"use strict";eval("// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js\n// Fedor, you are amazing.\n\n\nvar asn1 = __webpack_require__(151)\n\nexports.certificate = __webpack_require__(1139)\n\nvar RSAPrivateKey = asn1.define('RSAPrivateKey', function () {\n  this.seq().obj(\n    this.key('version').int(),\n    this.key('modulus').int(),\n    this.key('publicExponent').int(),\n    this.key('privateExponent').int(),\n    this.key('prime1').int(),\n    this.key('prime2').int(),\n    this.key('exponent1').int(),\n    this.key('exponent2').int(),\n    this.key('coefficient').int()\n  )\n})\nexports.RSAPrivateKey = RSAPrivateKey\n\nvar RSAPublicKey = asn1.define('RSAPublicKey', function () {\n  this.seq().obj(\n    this.key('modulus').int(),\n    this.key('publicExponent').int()\n  )\n})\nexports.RSAPublicKey = RSAPublicKey\n\nvar PublicKey = asn1.define('SubjectPublicKeyInfo', function () {\n  this.seq().obj(\n    this.key('algorithm').use(AlgorithmIdentifier),\n    this.key('subjectPublicKey').bitstr()\n  )\n})\nexports.PublicKey = PublicKey\n\nvar AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', function () {\n  this.seq().obj(\n    this.key('algorithm').objid(),\n    this.key('none').null_().optional(),\n    this.key('curve').objid().optional(),\n    this.key('params').seq().obj(\n      this.key('p').int(),\n      this.key('q').int(),\n      this.key('g').int()\n    ).optional()\n  )\n})\n\nvar PrivateKeyInfo = asn1.define('PrivateKeyInfo', function () {\n  this.seq().obj(\n    this.key('version').int(),\n    this.key('algorithm').use(AlgorithmIdentifier),\n    this.key('subjectPrivateKey').octstr()\n  )\n})\nexports.PrivateKey = PrivateKeyInfo\nvar EncryptedPrivateKeyInfo = asn1.define('EncryptedPrivateKeyInfo', function () {\n  this.seq().obj(\n    this.key('algorithm').seq().obj(\n      this.key('id').objid(),\n      this.key('decrypt').seq().obj(\n        this.key('kde').seq().obj(\n          this.key('id').objid(),\n          this.key('kdeparams').seq().obj(\n            this.key('salt').octstr(),\n            this.key('iters').int()\n          )\n        ),\n        this.key('cipher').seq().obj(\n          this.key('algo').objid(),\n          this.key('iv').octstr()\n        )\n      )\n    ),\n    this.key('subjectPrivateKey').octstr()\n  )\n})\n\nexports.EncryptedPrivateKey = EncryptedPrivateKeyInfo\n\nvar DSAPrivateKey = asn1.define('DSAPrivateKey', function () {\n  this.seq().obj(\n    this.key('version').int(),\n    this.key('p').int(),\n    this.key('q').int(),\n    this.key('g').int(),\n    this.key('pub_key').int(),\n    this.key('priv_key').int()\n  )\n})\nexports.DSAPrivateKey = DSAPrivateKey\n\nexports.DSAparam = asn1.define('DSAparam', function () {\n  this.int()\n})\n\nvar ECPrivateKey = asn1.define('ECPrivateKey', function () {\n  this.seq().obj(\n    this.key('version').int(),\n    this.key('privateKey').octstr(),\n    this.key('parameters').optional().explicit(0).use(ECParameters),\n    this.key('publicKey').optional().explicit(1).bitstr()\n  )\n})\nexports.ECPrivateKey = ECPrivateKey\n\nvar ECParameters = asn1.define('ECParameters', function () {\n  this.choice({\n    namedCurve: this.objid()\n  })\n})\n\nexports.signature = asn1.define('signature', function () {\n  this.seq().obj(\n    this.key('r').int(),\n    this.key('s').int()\n  )\n})\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/asn1.js\n// module id = 1138\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/asn1.js")},function(module,exports,__webpack_require__){"use strict";eval("// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js\n// thanks to @Rantanen\n\n\n\nvar asn = __webpack_require__(151)\n\nvar Time = asn.define('Time', function () {\n  this.choice({\n    utcTime: this.utctime(),\n    generalTime: this.gentime()\n  })\n})\n\nvar AttributeTypeValue = asn.define('AttributeTypeValue', function () {\n  this.seq().obj(\n    this.key('type').objid(),\n    this.key('value').any()\n  )\n})\n\nvar AlgorithmIdentifier = asn.define('AlgorithmIdentifier', function () {\n  this.seq().obj(\n    this.key('algorithm').objid(),\n    this.key('parameters').optional()\n  )\n})\n\nvar SubjectPublicKeyInfo = asn.define('SubjectPublicKeyInfo', function () {\n  this.seq().obj(\n    this.key('algorithm').use(AlgorithmIdentifier),\n    this.key('subjectPublicKey').bitstr()\n  )\n})\n\nvar RelativeDistinguishedName = asn.define('RelativeDistinguishedName', function () {\n  this.setof(AttributeTypeValue)\n})\n\nvar RDNSequence = asn.define('RDNSequence', function () {\n  this.seqof(RelativeDistinguishedName)\n})\n\nvar Name = asn.define('Name', function () {\n  this.choice({\n    rdnSequence: this.use(RDNSequence)\n  })\n})\n\nvar Validity = asn.define('Validity', function () {\n  this.seq().obj(\n    this.key('notBefore').use(Time),\n    this.key('notAfter').use(Time)\n  )\n})\n\nvar Extension = asn.define('Extension', function () {\n  this.seq().obj(\n    this.key('extnID').objid(),\n    this.key('critical').bool().def(false),\n    this.key('extnValue').octstr()\n  )\n})\n\nvar TBSCertificate = asn.define('TBSCertificate', function () {\n  this.seq().obj(\n    this.key('version').explicit(0).int(),\n    this.key('serialNumber').int(),\n    this.key('signature').use(AlgorithmIdentifier),\n    this.key('issuer').use(Name),\n    this.key('validity').use(Validity),\n    this.key('subject').use(Name),\n    this.key('subjectPublicKeyInfo').use(SubjectPublicKeyInfo),\n    this.key('issuerUniqueID').implicit(1).bitstr().optional(),\n    this.key('subjectUniqueID').implicit(2).bitstr().optional(),\n    this.key('extensions').explicit(3).seqof(Extension).optional()\n  )\n})\n\nvar X509Certificate = asn.define('X509Certificate', function () {\n  this.seq().obj(\n    this.key('tbsCertificate').use(TBSCertificate),\n    this.key('signatureAlgorithm').use(AlgorithmIdentifier),\n    this.key('signatureValue').bitstr()\n  )\n})\n\nmodule.exports = X509Certificate\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/certificate.js\n// module id = 1139\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/certificate.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {// adapted from https://github.com/apatil/pemstrip\nvar findProc = /Proc-Type: 4,ENCRYPTED\\n\\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\\n\\r?\\n\\r?([0-9A-z\\n\\r\\+\\/\\=]+)\\n\\r?/m\nvar startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\n/m\nvar fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\n\\r?([0-9A-z\\n\\r\\+\\/\\=]+)\\n\\r?-----END \\1-----$/m\nvar evp = __webpack_require__(184)\nvar ciphers = __webpack_require__(168)\nmodule.exports = function (okey, password) {\n  var key = okey.toString()\n  var match = key.match(findProc)\n  var decrypted\n  if (!match) {\n    var match2 = key.match(fullRegex)\n    decrypted = new Buffer(match2[2].replace(/\\r?\\n/g, ''), 'base64')\n  } else {\n    var suite = 'aes' + match[1]\n    var iv = new Buffer(match[2], 'hex')\n    var cipherText = new Buffer(match[3].replace(/\\r?\\n/g, ''), 'base64')\n    var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key\n    var out = []\n    var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)\n    out.push(cipher.update(cipherText))\n    out.push(cipher.final())\n    decrypted = Buffer.concat(out)\n  }\n  var tag = key.match(startRegex)[1]\n  return {\n    tag: tag,\n    data: decrypted\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/fixProc.js\n// module id = 1140\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/fixProc.js")},function(module,exports,__webpack_require__){eval("var asn1 = __webpack_require__(151);\nvar inherits = __webpack_require__(3);\n\nvar api = exports;\n\napi.define = function define(name, body) {\n  return new Entity(name, body);\n};\n\nfunction Entity(name, body) {\n  this.name = name;\n  this.body = body;\n\n  this.decoders = {};\n  this.encoders = {};\n};\n\nEntity.prototype._createNamed = function createNamed(base) {\n  var named;\n  try {\n    named = __webpack_require__(551).runInThisContext(\n      '(function ' + this.name + '(entity) {\\n' +\n      '  this._initNamed(entity);\\n' +\n      '})'\n    );\n  } catch (e) {\n    named = function (entity) {\n      this._initNamed(entity);\n    };\n  }\n  inherits(named, base);\n  named.prototype._initNamed = function initnamed(entity) {\n    base.call(this, entity);\n  };\n\n  return new named(this);\n};\n\nEntity.prototype._getDecoder = function _getDecoder(enc) {\n  enc = enc || 'der';\n  // Lazily create decoder\n  if (!this.decoders.hasOwnProperty(enc))\n    this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\n  return this.decoders[enc];\n};\n\nEntity.prototype.decode = function decode(data, enc, options) {\n  return this._getDecoder(enc).decode(data, options);\n};\n\nEntity.prototype._getEncoder = function _getEncoder(enc) {\n  enc = enc || 'der';\n  // Lazily create encoder\n  if (!this.encoders.hasOwnProperty(enc))\n    this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\n  return this.encoders[enc];\n};\n\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\n  return this._getEncoder(enc).encode(data, reporter);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/api.js\n// module id = 1141\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/api.js")},function(module,exports,__webpack_require__){eval("var Reporter = __webpack_require__(152).Reporter;\nvar EncoderBuffer = __webpack_require__(152).EncoderBuffer;\nvar DecoderBuffer = __webpack_require__(152).DecoderBuffer;\nvar assert = __webpack_require__(43);\n\n// Supported tags\nvar tags = [\n  'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n  'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n  'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n  'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n];\n\n// Public methods list\nvar methods = [\n  'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n  'any', 'contains'\n].concat(tags);\n\n// Overrided methods list\nvar overrided = [\n  '_peekTag', '_decodeTag', '_use',\n  '_decodeStr', '_decodeObjid', '_decodeTime',\n  '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n  '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n  '_encodeNull', '_encodeInt', '_encodeBool'\n];\n\nfunction Node(enc, parent) {\n  var state = {};\n  this._baseState = state;\n\n  state.enc = enc;\n\n  state.parent = parent || null;\n  state.children = null;\n\n  // State\n  state.tag = null;\n  state.args = null;\n  state.reverseArgs = null;\n  state.choice = null;\n  state.optional = false;\n  state.any = false;\n  state.obj = false;\n  state.use = null;\n  state.useDecoder = null;\n  state.key = null;\n  state['default'] = null;\n  state.explicit = null;\n  state.implicit = null;\n  state.contains = null;\n\n  // Should create new instance on each method\n  if (!state.parent) {\n    state.children = [];\n    this._wrap();\n  }\n}\nmodule.exports = Node;\n\nvar stateProps = [\n  'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n  'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n  'implicit', 'contains'\n];\n\nNode.prototype.clone = function clone() {\n  var state = this._baseState;\n  var cstate = {};\n  stateProps.forEach(function(prop) {\n    cstate[prop] = state[prop];\n  });\n  var res = new this.constructor(cstate.parent);\n  res._baseState = cstate;\n  return res;\n};\n\nNode.prototype._wrap = function wrap() {\n  var state = this._baseState;\n  methods.forEach(function(method) {\n    this[method] = function _wrappedMethod() {\n      var clone = new this.constructor(this);\n      state.children.push(clone);\n      return clone[method].apply(clone, arguments);\n    };\n  }, this);\n};\n\nNode.prototype._init = function init(body) {\n  var state = this._baseState;\n\n  assert(state.parent === null);\n  body.call(this);\n\n  // Filter children\n  state.children = state.children.filter(function(child) {\n    return child._baseState.parent === this;\n  }, this);\n  assert.equal(state.children.length, 1, 'Root node can have only one child');\n};\n\nNode.prototype._useArgs = function useArgs(args) {\n  var state = this._baseState;\n\n  // Filter children and args\n  var children = args.filter(function(arg) {\n    return arg instanceof this.constructor;\n  }, this);\n  args = args.filter(function(arg) {\n    return !(arg instanceof this.constructor);\n  }, this);\n\n  if (children.length !== 0) {\n    assert(state.children === null);\n    state.children = children;\n\n    // Replace parent to maintain backward link\n    children.forEach(function(child) {\n      child._baseState.parent = this;\n    }, this);\n  }\n  if (args.length !== 0) {\n    assert(state.args === null);\n    state.args = args;\n    state.reverseArgs = args.map(function(arg) {\n      if (typeof arg !== 'object' || arg.constructor !== Object)\n        return arg;\n\n      var res = {};\n      Object.keys(arg).forEach(function(key) {\n        if (key == (key | 0))\n          key |= 0;\n        var value = arg[key];\n        res[value] = key;\n      });\n      return res;\n    });\n  }\n};\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function(method) {\n  Node.prototype[method] = function _overrided() {\n    var state = this._baseState;\n    throw new Error(method + ' not implemented for encoding: ' + state.enc);\n  };\n});\n\n//\n// Public methods\n//\n\ntags.forEach(function(tag) {\n  Node.prototype[tag] = function _tagMethod() {\n    var state = this._baseState;\n    var args = Array.prototype.slice.call(arguments);\n\n    assert(state.tag === null);\n    state.tag = tag;\n\n    this._useArgs(args);\n\n    return this;\n  };\n});\n\nNode.prototype.use = function use(item) {\n  assert(item);\n  var state = this._baseState;\n\n  assert(state.use === null);\n  state.use = item;\n\n  return this;\n};\n\nNode.prototype.optional = function optional() {\n  var state = this._baseState;\n\n  state.optional = true;\n\n  return this;\n};\n\nNode.prototype.def = function def(val) {\n  var state = this._baseState;\n\n  assert(state['default'] === null);\n  state['default'] = val;\n  state.optional = true;\n\n  return this;\n};\n\nNode.prototype.explicit = function explicit(num) {\n  var state = this._baseState;\n\n  assert(state.explicit === null && state.implicit === null);\n  state.explicit = num;\n\n  return this;\n};\n\nNode.prototype.implicit = function implicit(num) {\n  var state = this._baseState;\n\n  assert(state.explicit === null && state.implicit === null);\n  state.implicit = num;\n\n  return this;\n};\n\nNode.prototype.obj = function obj() {\n  var state = this._baseState;\n  var args = Array.prototype.slice.call(arguments);\n\n  state.obj = true;\n\n  if (args.length !== 0)\n    this._useArgs(args);\n\n  return this;\n};\n\nNode.prototype.key = function key(newKey) {\n  var state = this._baseState;\n\n  assert(state.key === null);\n  state.key = newKey;\n\n  return this;\n};\n\nNode.prototype.any = function any() {\n  var state = this._baseState;\n\n  state.any = true;\n\n  return this;\n};\n\nNode.prototype.choice = function choice(obj) {\n  var state = this._baseState;\n\n  assert(state.choice === null);\n  state.choice = obj;\n  this._useArgs(Object.keys(obj).map(function(key) {\n    return obj[key];\n  }));\n\n  return this;\n};\n\nNode.prototype.contains = function contains(item) {\n  var state = this._baseState;\n\n  assert(state.use === null);\n  state.contains = item;\n\n  return this;\n};\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode(input, options) {\n  var state = this._baseState;\n\n  // Decode root node\n  if (state.parent === null)\n    return input.wrapResult(state.children[0]._decode(input, options));\n\n  var result = state['default'];\n  var present = true;\n\n  var prevKey = null;\n  if (state.key !== null)\n    prevKey = input.enterKey(state.key);\n\n  // Check if tag is there\n  if (state.optional) {\n    var tag = null;\n    if (state.explicit !== null)\n      tag = state.explicit;\n    else if (state.implicit !== null)\n      tag = state.implicit;\n    else if (state.tag !== null)\n      tag = state.tag;\n\n    if (tag === null && !state.any) {\n      // Trial and Error\n      var save = input.save();\n      try {\n        if (state.choice === null)\n          this._decodeGeneric(state.tag, input, options);\n        else\n          this._decodeChoice(input, options);\n        present = true;\n      } catch (e) {\n        present = false;\n      }\n      input.restore(save);\n    } else {\n      present = this._peekTag(input, tag, state.any);\n\n      if (input.isError(present))\n        return present;\n    }\n  }\n\n  // Push object on stack\n  var prevObj;\n  if (state.obj && present)\n    prevObj = input.enterObject();\n\n  if (present) {\n    // Unwrap explicit values\n    if (state.explicit !== null) {\n      var explicit = this._decodeTag(input, state.explicit);\n      if (input.isError(explicit))\n        return explicit;\n      input = explicit;\n    }\n\n    var start = input.offset;\n\n    // Unwrap implicit and normal values\n    if (state.use === null && state.choice === null) {\n      if (state.any)\n        var save = input.save();\n      var body = this._decodeTag(\n        input,\n        state.implicit !== null ? state.implicit : state.tag,\n        state.any\n      );\n      if (input.isError(body))\n        return body;\n\n      if (state.any)\n        result = input.raw(save);\n      else\n        input = body;\n    }\n\n    if (options && options.track && state.tag !== null)\n      options.track(input.path(), start, input.length, 'tagged');\n\n    if (options && options.track && state.tag !== null)\n      options.track(input.path(), input.offset, input.length, 'content');\n\n    // Select proper method for tag\n    if (state.any)\n      result = result;\n    else if (state.choice === null)\n      result = this._decodeGeneric(state.tag, input, options);\n    else\n      result = this._decodeChoice(input, options);\n\n    if (input.isError(result))\n      return result;\n\n    // Decode children\n    if (!state.any && state.choice === null && state.children !== null) {\n      state.children.forEach(function decodeChildren(child) {\n        // NOTE: We are ignoring errors here, to let parser continue with other\n        // parts of encoded data\n        child._decode(input, options);\n      });\n    }\n\n    // Decode contained/encoded by schema, only in bit or octet strings\n    if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n      var data = new DecoderBuffer(result);\n      result = this._getUse(state.contains, input._reporterState.obj)\n          ._decode(data, options);\n    }\n  }\n\n  // Pop object\n  if (state.obj && present)\n    result = input.leaveObject(prevObj);\n\n  // Set key\n  if (state.key !== null && (result !== null || present === true))\n    input.leaveKey(prevKey, state.key, result);\n  else if (prevKey !== null)\n    input.exitKey(prevKey);\n\n  return result;\n};\n\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\n  var state = this._baseState;\n\n  if (tag === 'seq' || tag === 'set')\n    return null;\n  if (tag === 'seqof' || tag === 'setof')\n    return this._decodeList(input, tag, state.args[0], options);\n  else if (/str$/.test(tag))\n    return this._decodeStr(input, tag, options);\n  else if (tag === 'objid' && state.args)\n    return this._decodeObjid(input, state.args[0], state.args[1], options);\n  else if (tag === 'objid')\n    return this._decodeObjid(input, null, null, options);\n  else if (tag === 'gentime' || tag === 'utctime')\n    return this._decodeTime(input, tag, options);\n  else if (tag === 'null_')\n    return this._decodeNull(input, options);\n  else if (tag === 'bool')\n    return this._decodeBool(input, options);\n  else if (tag === 'objDesc')\n    return this._decodeStr(input, tag, options);\n  else if (tag === 'int' || tag === 'enum')\n    return this._decodeInt(input, state.args && state.args[0], options);\n\n  if (state.use !== null) {\n    return this._getUse(state.use, input._reporterState.obj)\n        ._decode(input, options);\n  } else {\n    return input.error('unknown tag: ' + tag);\n  }\n};\n\nNode.prototype._getUse = function _getUse(entity, obj) {\n\n  var state = this._baseState;\n  // Create altered use decoder if implicit is set\n  state.useDecoder = this._use(entity, obj);\n  assert(state.useDecoder._baseState.parent === null);\n  state.useDecoder = state.useDecoder._baseState.children[0];\n  if (state.implicit !== state.useDecoder._baseState.implicit) {\n    state.useDecoder = state.useDecoder.clone();\n    state.useDecoder._baseState.implicit = state.implicit;\n  }\n  return state.useDecoder;\n};\n\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\n  var state = this._baseState;\n  var result = null;\n  var match = false;\n\n  Object.keys(state.choice).some(function(key) {\n    var save = input.save();\n    var node = state.choice[key];\n    try {\n      var value = node._decode(input, options);\n      if (input.isError(value))\n        return false;\n\n      result = { type: key, value: value };\n      match = true;\n    } catch (e) {\n      input.restore(save);\n      return false;\n    }\n    return true;\n  }, this);\n\n  if (!match)\n    return input.error('Choice not matched');\n\n  return result;\n};\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\n  return new EncoderBuffer(data, this.reporter);\n};\n\nNode.prototype._encode = function encode(data, reporter, parent) {\n  var state = this._baseState;\n  if (state['default'] !== null && state['default'] === data)\n    return;\n\n  var result = this._encodeValue(data, reporter, parent);\n  if (result === undefined)\n    return;\n\n  if (this._skipDefault(result, reporter, parent))\n    return;\n\n  return result;\n};\n\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\n  var state = this._baseState;\n\n  // Decode root node\n  if (state.parent === null)\n    return state.children[0]._encode(data, reporter || new Reporter());\n\n  var result = null;\n\n  // Set reporter to share it with a child class\n  this.reporter = reporter;\n\n  // Check if data is there\n  if (state.optional && data === undefined) {\n    if (state['default'] !== null)\n      data = state['default']\n    else\n      return;\n  }\n\n  // Encode children first\n  var content = null;\n  var primitive = false;\n  if (state.any) {\n    // Anything that was given is translated to buffer\n    result = this._createEncoderBuffer(data);\n  } else if (state.choice) {\n    result = this._encodeChoice(data, reporter);\n  } else if (state.contains) {\n    content = this._getUse(state.contains, parent)._encode(data, reporter);\n    primitive = true;\n  } else if (state.children) {\n    content = state.children.map(function(child) {\n      if (child._baseState.tag === 'null_')\n        return child._encode(null, reporter, data);\n\n      if (child._baseState.key === null)\n        return reporter.error('Child should have a key');\n      var prevKey = reporter.enterKey(child._baseState.key);\n\n      if (typeof data !== 'object')\n        return reporter.error('Child expected, but input is not object');\n\n      var res = child._encode(data[child._baseState.key], reporter, data);\n      reporter.leaveKey(prevKey);\n\n      return res;\n    }, this).filter(function(child) {\n      return child;\n    });\n    content = this._createEncoderBuffer(content);\n  } else {\n    if (state.tag === 'seqof' || state.tag === 'setof') {\n      // TODO(indutny): this should be thrown on DSL level\n      if (!(state.args && state.args.length === 1))\n        return reporter.error('Too many args for : ' + state.tag);\n\n      if (!Array.isArray(data))\n        return reporter.error('seqof/setof, but data is not Array');\n\n      var child = this.clone();\n      child._baseState.implicit = null;\n      content = this._createEncoderBuffer(data.map(function(item) {\n        var state = this._baseState;\n\n        return this._getUse(state.args[0], data)._encode(item, reporter);\n      }, child));\n    } else if (state.use !== null) {\n      result = this._getUse(state.use, parent)._encode(data, reporter);\n    } else {\n      content = this._encodePrimitive(state.tag, data);\n      primitive = true;\n    }\n  }\n\n  // Encode data itself\n  var result;\n  if (!state.any && state.choice === null) {\n    var tag = state.implicit !== null ? state.implicit : state.tag;\n    var cls = state.implicit === null ? 'universal' : 'context';\n\n    if (tag === null) {\n      if (state.use === null)\n        reporter.error('Tag could be omitted only for .use()');\n    } else {\n      if (state.use === null)\n        result = this._encodeComposite(tag, primitive, cls, content);\n    }\n  }\n\n  // Wrap in explicit\n  if (state.explicit !== null)\n    result = this._encodeComposite(state.explicit, false, 'context', result);\n\n  return result;\n};\n\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\n  var state = this._baseState;\n\n  var node = state.choice[data.type];\n  if (!node) {\n    assert(\n        false,\n        data.type + ' not found in ' +\n            JSON.stringify(Object.keys(state.choice)));\n  }\n  return node._encode(data.value, reporter);\n};\n\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\n  var state = this._baseState;\n\n  if (/str$/.test(tag))\n    return this._encodeStr(data, tag);\n  else if (tag === 'objid' && state.args)\n    return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\n  else if (tag === 'objid')\n    return this._encodeObjid(data, null, null);\n  else if (tag === 'gentime' || tag === 'utctime')\n    return this._encodeTime(data, tag);\n  else if (tag === 'null_')\n    return this._encodeNull();\n  else if (tag === 'int' || tag === 'enum')\n    return this._encodeInt(data, state.args && state.reverseArgs[0]);\n  else if (tag === 'bool')\n    return this._encodeBool(data);\n  else if (tag === 'objDesc')\n    return this._encodeStr(data, tag);\n  else\n    throw new Error('Unsupported tag: ' + tag);\n};\n\nNode.prototype._isNumstr = function isNumstr(str) {\n  return /^[0-9 ]*$/.test(str);\n};\n\nNode.prototype._isPrintstr = function isPrintstr(str) {\n  return /^[A-Za-z0-9 '\\(\\)\\+,\\-\\.\\/:=\\?]*$/.test(str);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/node.js\n// module id = 1142\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/node.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\n\nfunction Reporter(options) {\n  this._reporterState = {\n    obj: null,\n    path: [],\n    options: options || {},\n    errors: []\n  };\n}\nexports.Reporter = Reporter;\n\nReporter.prototype.isError = function isError(obj) {\n  return obj instanceof ReporterError;\n};\n\nReporter.prototype.save = function save() {\n  var state = this._reporterState;\n\n  return { obj: state.obj, pathLen: state.path.length };\n};\n\nReporter.prototype.restore = function restore(data) {\n  var state = this._reporterState;\n\n  state.obj = data.obj;\n  state.path = state.path.slice(0, data.pathLen);\n};\n\nReporter.prototype.enterKey = function enterKey(key) {\n  return this._reporterState.path.push(key);\n};\n\nReporter.prototype.exitKey = function exitKey(index) {\n  var state = this._reporterState;\n\n  state.path = state.path.slice(0, index - 1);\n};\n\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\n  var state = this._reporterState;\n\n  this.exitKey(index);\n  if (state.obj !== null)\n    state.obj[key] = value;\n};\n\nReporter.prototype.path = function path() {\n  return this._reporterState.path.join('/');\n};\n\nReporter.prototype.enterObject = function enterObject() {\n  var state = this._reporterState;\n\n  var prev = state.obj;\n  state.obj = {};\n  return prev;\n};\n\nReporter.prototype.leaveObject = function leaveObject(prev) {\n  var state = this._reporterState;\n\n  var now = state.obj;\n  state.obj = prev;\n  return now;\n};\n\nReporter.prototype.error = function error(msg) {\n  var err;\n  var state = this._reporterState;\n\n  var inherited = msg instanceof ReporterError;\n  if (inherited) {\n    err = msg;\n  } else {\n    err = new ReporterError(state.path.map(function(elem) {\n      return '[' + JSON.stringify(elem) + ']';\n    }).join(''), msg.message || msg, msg.stack);\n  }\n\n  if (!state.options.partial)\n    throw err;\n\n  if (!inherited)\n    state.errors.push(err);\n\n  return err;\n};\n\nReporter.prototype.wrapResult = function wrapResult(result) {\n  var state = this._reporterState;\n  if (!state.options.partial)\n    return result;\n\n  return {\n    result: this.isError(result) ? null : result,\n    errors: state.errors\n  };\n};\n\nfunction ReporterError(path, msg) {\n  this.path = path;\n  this.rethrow(msg);\n};\ninherits(ReporterError, Error);\n\nReporterError.prototype.rethrow = function rethrow(msg) {\n  this.message = msg + ' at: ' + (this.path || '(shallow)');\n  if (Error.captureStackTrace)\n    Error.captureStackTrace(this, ReporterError);\n\n  if (!this.stack) {\n    try {\n      // IE only adds stack when thrown\n      throw new Error(this.message);\n    } catch (e) {\n      this.stack = e.stack;\n    }\n  }\n  return this;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/reporter.js\n// module id = 1143\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/reporter.js")},function(module,exports,__webpack_require__){eval("var constants = __webpack_require__(498);\n\nexports.tagClass = {\n  0: 'universal',\n  1: 'application',\n  2: 'context',\n  3: 'private'\n};\nexports.tagClassByName = constants._reverse(exports.tagClass);\n\nexports.tag = {\n  0x00: 'end',\n  0x01: 'bool',\n  0x02: 'int',\n  0x03: 'bitstr',\n  0x04: 'octstr',\n  0x05: 'null_',\n  0x06: 'objid',\n  0x07: 'objDesc',\n  0x08: 'external',\n  0x09: 'real',\n  0x0a: 'enum',\n  0x0b: 'embed',\n  0x0c: 'utf8str',\n  0x0d: 'relativeOid',\n  0x10: 'seq',\n  0x11: 'set',\n  0x12: 'numstr',\n  0x13: 'printstr',\n  0x14: 't61str',\n  0x15: 'videostr',\n  0x16: 'ia5str',\n  0x17: 'utctime',\n  0x18: 'gentime',\n  0x19: 'graphstr',\n  0x1a: 'iso646str',\n  0x1b: 'genstr',\n  0x1c: 'unistr',\n  0x1d: 'charstr',\n  0x1e: 'bmpstr'\n};\nexports.tagByName = constants._reverse(exports.tag);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/constants/der.js\n// module id = 1144\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/constants/der.js")},function(module,exports,__webpack_require__){eval("var decoders = exports;\n\ndecoders.der = __webpack_require__(499);\ndecoders.pem = __webpack_require__(1146);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/index.js\n// module id = 1145\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/index.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\nvar Buffer = __webpack_require__(0).Buffer;\n\nvar DERDecoder = __webpack_require__(499);\n\nfunction PEMDecoder(entity) {\n  DERDecoder.call(this, entity);\n  this.enc = 'pem';\n};\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n  var lines = data.toString().split(/[\\r\\n]+/g);\n\n  var label = options.label.toUpperCase();\n\n  var re = /^-----(BEGIN|END) ([^-]+)-----$/;\n  var start = -1;\n  var end = -1;\n  for (var i = 0; i < lines.length; i++) {\n    var match = lines[i].match(re);\n    if (match === null)\n      continue;\n\n    if (match[2] !== label)\n      continue;\n\n    if (start === -1) {\n      if (match[1] !== 'BEGIN')\n        break;\n      start = i;\n    } else {\n      if (match[1] !== 'END')\n        break;\n      end = i;\n      break;\n    }\n  }\n  if (start === -1 || end === -1)\n    throw new Error('PEM section not found for: ' + label);\n\n  var base64 = lines.slice(start + 1, end).join('');\n  // Remove excessive symbols\n  base64.replace(/[^a-z0-9\\+\\/=]+/gi, '');\n\n  var input = new Buffer(base64, 'base64');\n  return DERDecoder.prototype.decode.call(this, input, options);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/pem.js\n// module id = 1146\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/pem.js")},function(module,exports,__webpack_require__){eval("var encoders = exports;\n\nencoders.der = __webpack_require__(500);\nencoders.pem = __webpack_require__(1148);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/index.js\n// module id = 1147\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/index.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3);\n\nvar DEREncoder = __webpack_require__(500);\n\nfunction PEMEncoder(entity) {\n  DEREncoder.call(this, entity);\n  this.enc = 'pem';\n};\ninherits(PEMEncoder, DEREncoder);\nmodule.exports = PEMEncoder;\n\nPEMEncoder.prototype.encode = function encode(data, options) {\n  var buf = DEREncoder.prototype.encode.call(this, data);\n\n  var p = buf.toString('base64');\n  var out = [ '-----BEGIN ' + options.label + '-----' ];\n  for (var i = 0; i < p.length; i += 64)\n    out.push(p.slice(i, i + 64));\n  out.push('-----END ' + options.label + '-----');\n  return out.join('\\n');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/pem.js\n// module id = 1148\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/pem.js")},function(module,exports,__webpack_require__){eval("var trim = __webpack_require__(1250)\n  , forEach = __webpack_require__(864)\n  , isArray = function(arg) {\n      return Object.prototype.toString.call(arg) === '[object Array]';\n    }\n\nmodule.exports = function (headers) {\n  if (!headers)\n    return {}\n\n  var result = {}\n\n  forEach(\n      trim(headers).split('\\n')\n    , function (row) {\n        var index = row.indexOf(':')\n          , key = trim(row.slice(0, index)).toLowerCase()\n          , value = trim(row.slice(index + 1))\n\n        if (typeof(result[key]) === 'undefined') {\n          result[key] = value\n        } else if (isArray(result[key])) {\n          result[key].push(value)\n        } else {\n          result[key] = [ result[key], value ]\n        }\n      }\n  )\n\n  return result\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/parse-headers/parse-headers.js\n// module id = 1149\n// module chunks = 0\n\n//# sourceURL=../node_modules/parse-headers/parse-headers.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global, process) {var checkParameters = __webpack_require__(503)\nvar defaultEncoding = __webpack_require__(502)\nvar sync = __webpack_require__(504)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar ZERO_BUF\nvar subtle = global.crypto && global.crypto.subtle\nvar toBrowser = {\n  'sha': 'SHA-1',\n  'sha-1': 'SHA-1',\n  'sha1': 'SHA-1',\n  'sha256': 'SHA-256',\n  'sha-256': 'SHA-256',\n  'sha384': 'SHA-384',\n  'sha-384': 'SHA-384',\n  'sha-512': 'SHA-512',\n  'sha512': 'SHA-512'\n}\nvar checks = []\nfunction checkNative (algo) {\n  if (global.process && !global.process.browser) {\n    return Promise.resolve(false)\n  }\n  if (!subtle || !subtle.importKey || !subtle.deriveBits) {\n    return Promise.resolve(false)\n  }\n  if (checks[algo] !== undefined) {\n    return checks[algo]\n  }\n  ZERO_BUF = ZERO_BUF || Buffer.alloc(8)\n  var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)\n    .then(function () {\n      return true\n    }).catch(function () {\n      return false\n    })\n  checks[algo] = prom\n  return prom\n}\nfunction browserPbkdf2 (password, salt, iterations, length, algo) {\n  return subtle.importKey(\n    'raw', password, {name: 'PBKDF2'}, false, ['deriveBits']\n  ).then(function (key) {\n    return subtle.deriveBits({\n      name: 'PBKDF2',\n      salt: salt,\n      iterations: iterations,\n      hash: {\n        name: algo\n      }\n    }, key, length << 3)\n  }).then(function (res) {\n    return Buffer.from(res)\n  })\n}\nfunction resolvePromise (promise, callback) {\n  promise.then(function (out) {\n    process.nextTick(function () {\n      callback(null, out)\n    })\n  }, function (e) {\n    process.nextTick(function () {\n      callback(e)\n    })\n  })\n}\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\n  if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\n\n  checkParameters(iterations, keylen)\n  if (typeof digest === 'function') {\n    callback = digest\n    digest = undefined\n  }\n  if (typeof callback !== 'function') throw new Error('No callback provided to pbkdf2')\n\n  digest = digest || 'sha1'\n  var algo = toBrowser[digest.toLowerCase()]\n  if (!algo || typeof global.Promise !== 'function') {\n    return process.nextTick(function () {\n      var out\n      try {\n        out = sync(password, salt, iterations, keylen, digest)\n      } catch (e) {\n        return callback(e)\n      }\n      callback(null, out)\n    })\n  }\n  resolvePromise(checkNative(algo).then(function (resp) {\n    if (resp) {\n      return browserPbkdf2(password, salt, iterations, keylen, algo)\n    } else {\n      return sync(password, salt, iterations, keylen, digest)\n    }\n  }), callback)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pbkdf2/lib/async.js\n// module id = 1150\n// module chunks = 0\n\n//# sourceURL=../node_modules/pbkdf2/lib/async.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst ensureMultiaddr = __webpack_require__(506).ensureMultiaddr\nconst uniqBy = __webpack_require__(1048)\n\n// Because JavaScript doesn't let you overload the compare in Set()..\nclass MultiaddrSet {\n  constructor (multiaddrs) {\n    this._multiaddrs = multiaddrs || []\n    this._observedMultiaddrs = []\n  }\n\n  add (ma) {\n    ma = ensureMultiaddr(ma)\n\n    if (!this.has(ma)) {\n      this._multiaddrs.push(ma)\n    }\n  }\n\n  // addSafe - prevent multiaddr explosion™\n  // Multiaddr explosion is when you dial to a bunch of nodes and every node\n  // gives you a different observed address and you start storing them all to\n  // share with other peers. This seems like a good idea until you realize that\n  // most of those addresses are unique to the subnet that peer is in and so,\n  // they are completely worthless for all the other peers. This method is\n  // exclusively used by identify.\n  addSafe (ma) {\n    ma = ensureMultiaddr(ma)\n\n    const check = this._observedMultiaddrs.some((m, i) => {\n      if (m.equals(ma)) {\n        this.add(ma)\n        this._observedMultiaddrs.splice(i, 1)\n        return true\n      }\n    })\n    if (!check) {\n      this._observedMultiaddrs.push(ma)\n    }\n  }\n\n  toArray () {\n    return this._multiaddrs.slice()\n  }\n\n  get size () {\n    return this._multiaddrs.length\n  }\n\n  forEach (fn) {\n    return this._multiaddrs.forEach(fn)\n  }\n\n  has (ma) {\n    ma = ensureMultiaddr(ma)\n    return this._multiaddrs.some((m) => m.equals(ma))\n  }\n\n  delete (ma) {\n    ma = ensureMultiaddr(ma)\n\n    this._multiaddrs.some((m, i) => {\n      if (m.equals(ma)) {\n        this._multiaddrs.splice(i, 1)\n        return true\n      }\n    })\n  }\n\n  // replaces selected existing multiaddrs with new ones\n  replace (existing, fresh) {\n    if (!Array.isArray(existing)) {\n      existing = [existing]\n    }\n    if (!Array.isArray(fresh)) {\n      fresh = [fresh]\n    }\n    existing.forEach((m) => this.delete(m))\n    fresh.forEach((m) => this.add(m))\n  }\n\n  clear () {\n    this._multiaddrs = []\n  }\n\n  // this only really helps make ip6 and ip4 multiaddrs distinct if they are\n  // different\n  // TODO this is not an ideal solution, probably this code should just be\n  // in libp2p-tcp\n  distinct () {\n    return uniqBy(this._multiaddrs, (ma) => {\n      return [ma.toOptions().port, ma.toOptions().transport].join()\n    })\n  }\n}\n\nmodule.exports = MultiaddrSet\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/peer-info/src/multiaddr-set.js\n// module id = 1151\n// module chunks = 0\n\n//# sourceURL=../node_modules/peer-info/src/multiaddr-set.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n/* istanbul ignore next */\nvar MyPromise = typeof Promise !== 'undefined' ? Promise : __webpack_require__(1036);\n\nvar messageIds = 0;\n\nfunction parseJsonSafely(str) {\n  try {\n    return JSON.parse(str);\n  } catch (e) {\n    return false;\n  }\n}\n\nfunction onMessage(self, e) {\n  var message = parseJsonSafely(e.data);\n  if (!message) {\n    // Ignore - this message is not for us.\n    return;\n  }\n  var messageId = message[0];\n  var error = message[1];\n  var result = message[2];\n\n  var callback = self._callbacks[messageId];\n\n  if (!callback) {\n    // Ignore - user might have created multiple PromiseWorkers.\n    // This message is not for us.\n    return;\n  }\n\n  delete self._callbacks[messageId];\n  callback(error, result);\n}\n\nfunction PromiseWorker(worker) {\n  var self = this;\n  self._worker = worker;\n  self._callbacks = {};\n\n  worker.addEventListener('message', function (e) {\n    onMessage(self, e);\n  });\n}\n\nPromiseWorker.prototype.postMessage = function (userMessage) {\n  var self = this;\n  var messageId = messageIds++;\n\n  var messageToSend = [messageId, userMessage];\n\n  return new MyPromise(function (resolve, reject) {\n    self._callbacks[messageId] = function (error, result) {\n      if (error) {\n        return reject(new Error(error.message));\n      }\n      resolve(result);\n    };\n    var jsonMessage = JSON.stringify(messageToSend);\n    /* istanbul ignore if */\n    if (typeof self._worker.controller !== 'undefined') {\n      // service worker, use MessageChannels because e.source is broken in Chrome < 51:\n      // https://bugs.chromium.org/p/chromium/issues/detail?id=543198\n      var channel = new MessageChannel();\n      channel.port1.onmessage = function (e) {\n        onMessage(self, e);\n      };\n      self._worker.controller.postMessage(jsonMessage, [channel.port2]);\n    } else {\n      // web worker\n      self._worker.postMessage(jsonMessage);\n    }\n  });\n};\n\nmodule.exports = PromiseWorker;\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/promise-worker/index.js\n// module id = 1152\n// module chunks = 0\n\n//# sourceURL=../node_modules/promise-worker/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//This file contains the ES6 extensions to the core Promises/A+ API\n\nvar Promise = __webpack_require__(507);\n\nmodule.exports = Promise;\n\n/* Static Functions */\n\nvar TRUE = valuePromise(true);\nvar FALSE = valuePromise(false);\nvar NULL = valuePromise(null);\nvar UNDEFINED = valuePromise(undefined);\nvar ZERO = valuePromise(0);\nvar EMPTYSTRING = valuePromise('');\n\nfunction valuePromise(value) {\n  var p = new Promise(Promise._61);\n  p._81 = 1;\n  p._65 = value;\n  return p;\n}\nPromise.resolve = function (value) {\n  if (value instanceof Promise) return value;\n\n  if (value === null) return NULL;\n  if (value === undefined) return UNDEFINED;\n  if (value === true) return TRUE;\n  if (value === false) return FALSE;\n  if (value === 0) return ZERO;\n  if (value === '') return EMPTYSTRING;\n\n  if (typeof value === 'object' || typeof value === 'function') {\n    try {\n      var then = value.then;\n      if (typeof then === 'function') {\n        return new Promise(then.bind(value));\n      }\n    } catch (ex) {\n      return new Promise(function (resolve, reject) {\n        reject(ex);\n      });\n    }\n  }\n  return valuePromise(value);\n};\n\nPromise.all = function (arr) {\n  var args = Array.prototype.slice.call(arr);\n\n  return new Promise(function (resolve, reject) {\n    if (args.length === 0) return resolve([]);\n    var remaining = args.length;\n    function res(i, val) {\n      if (val && (typeof val === 'object' || typeof val === 'function')) {\n        if (val instanceof Promise && val.then === Promise.prototype.then) {\n          while (val._81 === 3) {\n            val = val._65;\n          }\n          if (val._81 === 1) return res(i, val._65);\n          if (val._81 === 2) reject(val._65);\n          val.then(function (val) {\n            res(i, val);\n          }, reject);\n          return;\n        } else {\n          var then = val.then;\n          if (typeof then === 'function') {\n            var p = new Promise(then.bind(val));\n            p.then(function (val) {\n              res(i, val);\n            }, reject);\n            return;\n          }\n        }\n      }\n      args[i] = val;\n      if (--remaining === 0) {\n        resolve(args);\n      }\n    }\n    for (var i = 0; i < args.length; i++) {\n      res(i, args[i]);\n    }\n  });\n};\n\nPromise.reject = function (value) {\n  return new Promise(function (resolve, reject) {\n    reject(value);\n  });\n};\n\nPromise.race = function (values) {\n  return new Promise(function (resolve, reject) {\n    values.forEach(function(value){\n      Promise.resolve(value).then(resolve, reject);\n    });\n  });\n};\n\n/* Prototype Methods */\n\nPromise.prototype['catch'] = function (onRejected) {\n  return this.then(null, onRejected);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/promise/lib/es6-extensions.js\n// module id = 1153\n// module chunks = 0\n\n//# sourceURL=../node_modules/promise/lib/es6-extensions.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar Promise = __webpack_require__(507);\n\nvar DEFAULT_WHITELIST = [\n  ReferenceError,\n  TypeError,\n  RangeError\n];\n\nvar enabled = false;\nexports.disable = disable;\nfunction disable() {\n  enabled = false;\n  Promise._10 = null;\n  Promise._97 = null;\n}\n\nexports.enable = enable;\nfunction enable(options) {\n  options = options || {};\n  if (enabled) disable();\n  enabled = true;\n  var id = 0;\n  var displayId = 0;\n  var rejections = {};\n  Promise._10 = function (promise) {\n    if (\n      promise._81 === 2 && // IS REJECTED\n      rejections[promise._72]\n    ) {\n      if (rejections[promise._72].logged) {\n        onHandled(promise._72);\n      } else {\n        clearTimeout(rejections[promise._72].timeout);\n      }\n      delete rejections[promise._72];\n    }\n  };\n  Promise._97 = function (promise, err) {\n    if (promise._45 === 0) { // not yet handled\n      promise._72 = id++;\n      rejections[promise._72] = {\n        displayId: null,\n        error: err,\n        timeout: setTimeout(\n          onUnhandled.bind(null, promise._72),\n          // For reference errors and type errors, this almost always\n          // means the programmer made a mistake, so log them after just\n          // 100ms\n          // otherwise, wait 2 seconds to see if they get handled\n          matchWhitelist(err, DEFAULT_WHITELIST)\n            ? 100\n            : 2000\n        ),\n        logged: false\n      };\n    }\n  };\n  function onUnhandled(id) {\n    if (\n      options.allRejections ||\n      matchWhitelist(\n        rejections[id].error,\n        options.whitelist || DEFAULT_WHITELIST\n      )\n    ) {\n      rejections[id].displayId = displayId++;\n      if (options.onUnhandled) {\n        rejections[id].logged = true;\n        options.onUnhandled(\n          rejections[id].displayId,\n          rejections[id].error\n        );\n      } else {\n        rejections[id].logged = true;\n        logError(\n          rejections[id].displayId,\n          rejections[id].error\n        );\n      }\n    }\n  }\n  function onHandled(id) {\n    if (rejections[id].logged) {\n      if (options.onHandled) {\n        options.onHandled(rejections[id].displayId, rejections[id].error);\n      } else if (!rejections[id].onUnhandled) {\n        console.warn(\n          'Promise Rejection Handled (id: ' + rejections[id].displayId + '):'\n        );\n        console.warn(\n          '  This means you can ignore any previous messages of the form \"Possible Unhandled Promise Rejection\" with id ' +\n          rejections[id].displayId + '.'\n        );\n      }\n    }\n  }\n}\n\nfunction logError(id, error) {\n  console.warn('Possible Unhandled Promise Rejection (id: ' + id + '):');\n  var errStr = (error && (error.stack || error)) + '';\n  errStr.split('\\n').forEach(function (line) {\n    console.warn('  ' + line);\n  });\n}\n\nfunction matchWhitelist(error, list) {\n  return list.some(function (cls) {\n    return error instanceof cls;\n  });\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/promise/lib/rejection-tracking.js\n// module id = 1154\n// module chunks = 0\n\n//# sourceURL=../node_modules/promise/lib/rejection-tracking.js")},function(module,exports,__webpack_require__){eval("var parse = __webpack_require__(1156)\nvar stringify = __webpack_require__(1157)\n\nmodule.exports = parse\nmodule.exports.parse = parse\nmodule.exports.stringify = stringify\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protocol-buffers-schema/index.js\n// module id = 1155\n// module chunks = 0\n\n//# sourceURL=../node_modules/protocol-buffers-schema/index.js")},function(module,exports,__webpack_require__){eval("var tokenize = __webpack_require__(1158)\nvar MAX_RANGE = 0x1FFFFFFF\n\n// \"Only repeated fields of primitive numeric types (types which use the varint, 32-bit, or 64-bit wire types) can be declared \"packed\".\"\n// https://developers.google.com/protocol-buffers/docs/encoding#optional\nvar PACKABLE_TYPES = [\n  // varint wire types\n  'int32', 'int64', 'uint32', 'uint64', 'sint32', 'sint64', 'bool',\n  // + ENUMS\n  // 64-bit wire types\n  'fixed64', 'sfixed64', 'double',\n  // 32-bit wire types\n  'fixed32', 'sfixed32', 'float'\n]\n\nvar onfieldoptions = function (tokens) {\n  var opts = {}\n\n  while (tokens.length) {\n    switch (tokens[0]) {\n      case '[':\n      case ',':\n        tokens.shift()\n        var name = tokens.shift()\n        if (name === '(') {       // handling [(A) = B]\n          name = tokens.shift()\n          tokens.shift()          // remove the end of bracket\n        }\n        if (tokens[0] !== '=') throw new Error('Unexpected token in field options: ' + tokens[0])\n        tokens.shift()\n        if (tokens[0] === ']') throw new Error('Unexpected ] in field option')\n        opts[name] = tokens.shift()\n        break\n      case ']':\n        tokens.shift()\n        return opts\n\n      default:\n        throw new Error('Unexpected token in field options: ' + tokens[0])\n    }\n  }\n\n  throw new Error('No closing tag for field options')\n}\n\nvar onfield = function (tokens) {\n  var field = {\n    name: null,\n    type: null,\n    tag: -1,\n    map: null,\n    oneof: null,\n    required: false,\n    repeated: false,\n    options: {}\n  }\n\n  while (tokens.length) {\n    switch (tokens[0]) {\n      case '=':\n        tokens.shift()\n        field.tag = Number(tokens.shift())\n        break\n\n      case 'map':\n        field.type = 'map'\n        field.map = {from: null, to: null}\n        tokens.shift()\n        if (tokens[0] !== '<') throw new Error('Unexpected token in map type: ' + tokens[0])\n        tokens.shift()\n        field.map.from = tokens.shift()\n        if (tokens[0] !== ',') throw new Error('Unexpected token in map type: ' + tokens[0])\n        tokens.shift()\n        field.map.to = tokens.shift()\n        if (tokens[0] !== '>') throw new Error('Unexpected token in map type: ' + tokens[0])\n        tokens.shift()\n        field.name = tokens.shift()\n        break\n\n      case 'repeated':\n      case 'required':\n      case 'optional':\n        var t = tokens.shift()\n        field.required = t === 'required'\n        field.repeated = t === 'repeated'\n        field.type = tokens.shift()\n        field.name = tokens.shift()\n        break\n\n      case '[':\n        field.options = onfieldoptions(tokens)\n        break\n\n      case ';':\n        if (field.name === null) throw new Error('Missing field name')\n        if (field.type === null) throw new Error('Missing type in message field: ' + field.name)\n        if (field.tag === -1) throw new Error('Missing tag number in message field: ' + field.name)\n        tokens.shift()\n        return field\n\n      default:\n        throw new Error('Unexpected token in message field: ' + tokens[0])\n    }\n  }\n\n  throw new Error('No ; found for message field')\n}\n\nvar onmessagebody = function (tokens) {\n  var body = {\n    enums: [],\n    messages: [],\n    fields: [],\n    extends: [],\n    extensions: null\n  }\n\n  while (tokens.length) {\n    switch (tokens[0]) {\n      case 'map':\n      case 'repeated':\n      case 'optional':\n      case 'required':\n        body.fields.push(onfield(tokens))\n        break\n\n      case 'enum':\n        body.enums.push(onenum(tokens))\n        break\n\n      case 'message':\n        body.messages.push(onmessage(tokens))\n        break\n\n      case 'extensions':\n        body.extensions = onextensions(tokens)\n        break\n\n      case 'oneof':\n        tokens.shift()\n        var name = tokens.shift()\n        if (tokens[0] !== '{') throw new Error('Unexpected token in oneof: ' + tokens[0])\n        tokens.shift()\n        while (tokens[0] !== '}') {\n          tokens.unshift('optional')\n          var field = onfield(tokens)\n          field.oneof = name\n          body.fields.push(field)\n        }\n        tokens.shift()\n        break\n\n      case 'extend':\n        body.extends.push(onextend(tokens))\n        break\n\n      case ';':\n        tokens.shift()\n        break\n\n      case 'reserved':\n      case 'option':\n        tokens.shift()\n        while (tokens[0] !== ';') {\n          tokens.shift()\n        }\n        break\n\n      default:\n        // proto3 does not require the use of optional/required, assumed as optional\n        // \"singular: a well-formed message can have zero or one of this field (but not more than one).\"\n        // https://developers.google.com/protocol-buffers/docs/proto3#specifying-field-rules\n        tokens.unshift('optional')\n        body.fields.push(onfield(tokens))\n    }\n  }\n\n  return body\n}\n\nvar onextend = function (tokens) {\n  var out = {\n    name: tokens[1],\n    message: onmessage(tokens)\n  }\n  return out\n}\n\nvar onextensions = function (tokens) {\n  tokens.shift()\n  var from = Number(tokens.shift())\n  if (isNaN(from)) throw new Error('Invalid from in extensions definition')\n  if (tokens.shift() !== 'to') throw new Error(\"Expected keyword 'to' in extensions definition\")\n  var to = tokens.shift()\n  if (to === 'max') to = MAX_RANGE\n  to = Number(to)\n  if (isNaN(to)) throw new Error('Invalid to in extensions definition')\n  if (tokens.shift() !== ';') throw new Error('Missing ; in extensions definition')\n  return {from: from, to: to}\n}\nvar onmessage = function (tokens) {\n  tokens.shift()\n\n  var lvl = 1\n  var body = []\n  var msg = {\n    name: tokens.shift(),\n    enums: [],\n    extends: [],\n    messages: [],\n    fields: []\n  }\n\n  if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n  tokens.shift()\n\n  while (tokens.length) {\n    if (tokens[0] === '{') lvl++\n    else if (tokens[0] === '}') lvl--\n\n    if (!lvl) {\n      tokens.shift()\n      body = onmessagebody(body)\n      msg.enums = body.enums\n      msg.messages = body.messages\n      msg.fields = body.fields\n      msg.extends = body.extends\n      msg.extensions = body.extensions\n      return msg\n    }\n\n    body.push(tokens.shift())\n  }\n\n  if (lvl) throw new Error('No closing tag for message')\n}\n\nvar onpackagename = function (tokens) {\n  tokens.shift()\n  var name = tokens.shift()\n  if (tokens[0] !== ';') throw new Error('Expected ; but found ' + tokens[0])\n  tokens.shift()\n  return name\n}\n\nvar onsyntaxversion = function (tokens) {\n  tokens.shift()\n\n  if (tokens[0] !== '=') throw new Error('Expected = but found ' + tokens[0])\n  tokens.shift()\n\n  var version = tokens.shift()\n  switch (version) {\n    case '\"proto2\"':\n      version = 2\n      break\n\n    case '\"proto3\"':\n      version = 3\n      break\n\n    default:\n      throw new Error('Expected protobuf syntax version but found ' + version)\n  }\n\n  if (tokens[0] !== ';') throw new Error('Expected ; but found ' + tokens[0])\n  tokens.shift()\n\n  return version\n}\n\nvar onenumvalue = function (tokens) {\n  if (tokens.length < 4) throw new Error('Invalid enum value: ' + tokens.slice(0, 3).join(' '))\n  if (tokens[1] !== '=') throw new Error('Expected = but found ' + tokens[1])\n  if (tokens[3] !== ';' && tokens[3] !== '[') throw new Error('Expected ; or [ but found ' + tokens[1])\n\n  var name = tokens.shift()\n  tokens.shift()\n  var val = {\n    value: null,\n    options: {}\n  }\n  val.value = Number(tokens.shift())\n  if (tokens[0] === '[') {\n    val.options = onfieldoptions(tokens)\n  }\n  tokens.shift() // expecting the semicolon here\n\n  return {\n    name: name,\n    val: val\n  }\n}\n\nvar onenum = function (tokens) {\n  tokens.shift()\n  var options = {}\n  var e = {\n    name: tokens.shift(),\n    values: {},\n    options: {}\n  }\n\n  if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n  tokens.shift()\n\n  while (tokens.length) {\n    if (tokens[0] === '}') {\n      tokens.shift()\n      // there goes optional semicolon after the enclosing \"}\"\n      if (tokens[0] === ';') tokens.shift()\n      return e\n    }\n    if (tokens[0] === 'option') {\n      options = onoption(tokens)\n      e.options[options.name] = options.value\n      continue\n    }\n    var val = onenumvalue(tokens)\n    e.values[val.name] = val.val\n  }\n\n  throw new Error('No closing tag for enum')\n}\n\nvar onoption = function (tokens) {\n  var name = null\n  var value = null\n\n  var parse = function (value) {\n    if (value === 'true') return true\n    if (value === 'false') return false\n    return value.replace(/^\"+|\"+$/gm, '')\n  }\n\n  while (tokens.length) {\n    if (tokens[0] === ';') {\n      tokens.shift()\n      return {name: name, value: value}\n    }\n    switch (tokens[0]) {\n      case 'option':\n        tokens.shift()\n\n        var hasBracket = tokens[0] === '('\n        if (hasBracket) tokens.shift()\n\n        name = tokens.shift()\n\n        if (hasBracket) {\n          if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n          tokens.shift()\n        }\n\n        if (tokens[0][0] === '.') {\n          name += tokens.shift()\n        }\n\n        break\n\n      case '=':\n        tokens.shift()\n        if (name === null) throw new Error('Expected key for option with value: ' + tokens[0])\n        value = parse(tokens.shift())\n\n        if (name === 'optimize_for' && !/^(SPEED|CODE_SIZE|LITE_RUNTIME)$/.test(value)) {\n          throw new Error('Unexpected value for option optimize_for: ' + value)\n        } else if (value === '{') {\n          // option foo = {bar: baz}\n          value = onoptionMap(tokens)\n        }\n        break\n\n      default:\n        throw new Error('Unexpected token in option: ' + tokens[0])\n    }\n  }\n}\n\nvar onoptionMap = function (tokens) {\n  var parse = function (value) {\n    if (value === 'true') return true\n    if (value === 'false') return false\n    return value.replace(/^\"+|\"+$/gm, '')\n  }\n\n  var map = {}\n\n  while (tokens.length) {\n    if (tokens[0] === '}') {\n      tokens.shift()\n      return map\n    }\n\n    var hasBracket = tokens[0] === '('\n    if (hasBracket) tokens.shift()\n\n    var key = tokens.shift()\n    if (hasBracket) {\n      if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n      tokens.shift()\n    }\n\n    var value = null\n\n    switch (tokens[0]) {\n      case ':':\n        if (map[key] !== undefined) throw new Error('Duplicate option map key ' + key)\n\n        tokens.shift()\n\n        value = parse(tokens.shift())\n\n        if (value === '{') {\n          // option foo = {bar: baz}\n          value = onoptionMap(tokens)\n        }\n\n        map[key] = value\n\n        if (tokens[0] === ';') {\n          tokens.shift()\n        }\n        break\n\n      case '{':\n        tokens.shift()\n        value = onoptionMap(tokens)\n\n        if (map[key] === undefined) map[key] = []\n        if (!Array.isArray(map[key])) throw new Error('Duplicate option map key ' + key)\n\n        map[key].push(value)\n        break\n\n      default:\n        throw new Error('Unexpected token in option map: ' + tokens[0])\n    }\n  }\n\n  throw new Error('No closing tag for option map')\n}\n\nvar onimport = function (tokens) {\n  tokens.shift()\n  var file = tokens.shift().replace(/^\"+|\"+$/gm, '')\n\n  if (tokens[0] !== ';') throw new Error('Unexpected token: ' + tokens[0] + '. Expected \";\"')\n\n  tokens.shift()\n  return file\n}\n\nvar onservice = function (tokens) {\n  tokens.shift()\n\n  var service = {\n    name: tokens.shift(),\n    methods: [],\n    options: {}\n  }\n\n  if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n  tokens.shift()\n\n  while (tokens.length) {\n    if (tokens[0] === '}') {\n      tokens.shift()\n      // there goes optional semicolon after the enclosing \"}\"\n      if (tokens[0] === ';') tokens.shift()\n      return service\n    }\n\n    switch (tokens[0]) {\n      case 'option':\n        var opt = onoption(tokens)\n        if (service.options[opt.name] !== undefined) throw new Error('Duplicate option ' + opt.name)\n        service.options[opt.name] = opt.value\n        break\n      case 'rpc':\n        service.methods.push(onrpc(tokens))\n        break\n      default:\n        throw new Error('Unexpected token in service: ' + tokens[0])\n    }\n  }\n\n  throw new Error('No closing tag for service')\n}\n\nvar onrpc = function (tokens) {\n  tokens.shift()\n\n  var rpc = {\n    name: tokens.shift(),\n    input_type: null,\n    output_type: null,\n    client_streaming: false,\n    server_streaming: false,\n    options: {}\n  }\n\n  if (tokens[0] !== '(') throw new Error('Expected ( but found ' + tokens[0])\n  tokens.shift()\n\n  if (tokens[0] === 'stream') {\n    tokens.shift()\n    rpc.client_streaming = true\n  }\n\n  rpc.input_type = tokens.shift()\n\n  if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n  tokens.shift()\n\n  if (tokens[0] !== 'returns') throw new Error('Expected returns but found ' + tokens[0])\n  tokens.shift()\n\n  if (tokens[0] !== '(') throw new Error('Expected ( but found ' + tokens[0])\n  tokens.shift()\n\n  if (tokens[0] === 'stream') {\n    tokens.shift()\n    rpc.server_streaming = true\n  }\n\n  rpc.output_type = tokens.shift()\n\n  if (tokens[0] !== ')') throw new Error('Expected ) but found ' + tokens[0])\n  tokens.shift()\n\n  if (tokens[0] === ';') {\n    tokens.shift()\n    return rpc\n  }\n\n  if (tokens[0] !== '{') throw new Error('Expected { but found ' + tokens[0])\n  tokens.shift()\n\n  while (tokens.length) {\n    if (tokens[0] === '}') {\n      tokens.shift()\n      // there goes optional semicolon after the enclosing \"}\"\n      if (tokens[0] === ';') tokens.shift()\n      return rpc\n    }\n\n    if (tokens[0] === 'option') {\n      var opt = onoption(tokens)\n      if (rpc.options[opt.name] !== undefined) throw new Error('Duplicate option ' + opt.name)\n      rpc.options[opt.name] = opt.value\n    } else {\n      throw new Error('Unexpected token in rpc options: ' + tokens[0])\n    }\n  }\n\n  throw new Error('No closing tag for rpc')\n}\n\nvar parse = function (buf) {\n  var tokens = tokenize(buf.toString())\n  // check for isolated strings in tokens by looking for opening quote\n  for (var i = 0; i < tokens.length; i++) {\n    if (/^(\"|')([^'\"]*)$/.test(tokens[i])) {\n      var j\n      if (tokens[i].length === 1) {\n        j = i + 1\n      } else {\n        j = i\n      }\n      // look ahead for the closing quote and collapse all\n      // in-between tokens into a single token\n      for (j; j < tokens.length; j++) {\n        if (/^([^'\"]*)(\"|')$/.test(tokens[j])) {\n          tokens = tokens.slice(0, i).concat(tokens.slice(i, j + 1).join('')).concat(tokens.slice(j + 1))\n          break\n        }\n      }\n    }\n  }\n  var schema = {\n    syntax: 3,\n    package: null,\n    imports: [],\n    enums: [],\n    messages: [],\n    options: {},\n    extends: []\n  }\n\n  var firstline = true\n\n  while (tokens.length) {\n    switch (tokens[0]) {\n      case 'package':\n        schema.package = onpackagename(tokens)\n        break\n\n      case 'syntax':\n        if (!firstline) throw new Error('Protobuf syntax version should be first thing in file')\n        schema.syntax = onsyntaxversion(tokens)\n        break\n\n      case 'message':\n        schema.messages.push(onmessage(tokens))\n        break\n\n      case 'enum':\n        schema.enums.push(onenum(tokens))\n        break\n\n      case 'option':\n        var opt = onoption(tokens)\n        if (schema.options[opt.name]) throw new Error('Duplicate option ' + opt.name)\n        schema.options[opt.name] = opt.value\n        break\n\n      case 'import':\n        schema.imports.push(onimport(tokens))\n        break\n\n      case 'extend':\n        schema.extends.push(onextend(tokens))\n        break\n\n      case 'service':\n        if (!schema.services) schema.services = []\n        schema.services.push(onservice(tokens))\n        break\n\n      default:\n        throw new Error('Unexpected token: ' + tokens[0])\n    }\n    firstline = false\n  }\n\n  // now iterate over messages and propagate extends\n  schema.extends.forEach(function (ext) {\n    schema.messages.forEach(function (msg) {\n      if (msg.name === ext.name) {\n        ext.message.fields.forEach(function (field) {\n          if (!msg.extensions || field.tag < msg.extensions.from || field.tag > msg.extensions.to) {\n            throw new Error(msg.name + ' does not declare ' + field.tag + ' as an extension number')\n          }\n          msg.fields.push(field)\n        })\n      }\n    })\n  })\n\n  schema.messages.forEach(function (msg) {\n    msg.fields.forEach(function (field) {\n      var fieldSplit\n      var messageName\n      var nestedEnumName\n      var message\n\n      function enumNameIsFieldType (en) {\n        return en.name === field.type\n      }\n\n      function enumNameIsNestedEnumName (en) {\n        return en.name === nestedEnumName\n      }\n\n      if (field.options && field.options.packed === 'true') {\n        if (PACKABLE_TYPES.indexOf(field.type) === -1) {\n          // let's see if it's an enum\n          if (field.type.indexOf('.') === -1) {\n            if (msg.enums && msg.enums.some(enumNameIsFieldType)) {\n              return\n            }\n          } else {\n            fieldSplit = field.type.split('.')\n            if (fieldSplit.length > 2) {\n              throw new Error('what is this?')\n            }\n\n            messageName = fieldSplit[0]\n            nestedEnumName = fieldSplit[1]\n\n            schema.messages.some(function (msg) {\n              if (msg.name === messageName) {\n                message = msg\n                return msg\n              }\n            })\n\n            if (message && message.enums && message.enums.some(enumNameIsNestedEnumName)) {\n              return\n            }\n          }\n\n          throw new Error(\n            'Fields of type ' + field.type + ' cannot be declared [packed=true]. ' +\n            'Only repeated fields of primitive numeric types (types which use ' +\n            'the varint, 32-bit, or 64-bit wire types) can be declared \"packed\". ' +\n            'See https://developers.google.com/protocol-buffers/docs/encoding#optional'\n          )\n        }\n      }\n    })\n  })\n\n  return schema\n}\n\nmodule.exports = parse\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protocol-buffers-schema/parse.js\n// module id = 1156\n// module chunks = 0\n\n//# sourceURL=../node_modules/protocol-buffers-schema/parse.js")},function(module,exports){eval("var onfield = function (f, result) {\n  var prefix = f.repeated ? 'repeated' : f.required ? 'required' : 'optional'\n  if (f.type === 'map') prefix = 'map<' + f.map.from + ',' + f.map.to + '>'\n  if (f.oneof) prefix = ''\n\n  var opts = Object.keys(f.options || {}).map(function (key) {\n    return key + ' = ' + f.options[key]\n  }).join(',')\n\n  if (opts) opts = ' [' + opts + ']'\n\n  result.push((prefix ? prefix + ' ' : '') + (f.map === 'map' ? '' : f.type + ' ') + f.name + ' = ' + f.tag + opts + ';')\n  return result\n}\n\nvar onmessage = function (m, result) {\n  result.push('message ' + m.name + ' {')\n\n  if (!m.enums) m.enums = []\n  m.enums.forEach(function (e) {\n    result.push(onenum(e, []))\n  })\n\n  if (!m.messages) m.messages = []\n  m.messages.forEach(function (m) {\n    result.push(onmessage(m, []))\n  })\n\n  var oneofs = {}\n\n  if (!m.fields) m.fields = []\n  m.fields.forEach(function (f) {\n    if (f.oneof) {\n      if (!oneofs[f.oneof]) oneofs[f.oneof] = []\n      oneofs[f.oneof].push(onfield(f, []))\n    } else {\n      result.push(onfield(f, []))\n    }\n  })\n\n  Object.keys(oneofs).forEach(function (n) {\n    oneofs[n].unshift('oneof ' + n + ' {')\n    oneofs[n].push('}')\n    result.push(oneofs[n])\n  })\n\n  result.push('}', '')\n  return result\n}\n\nvar onenum = function (e, result) {\n  result.push('enum ' + e.name + ' {')\n  if (!e.options) e.options = {}\n  var options = onoption(e.options, [])\n  if (options.length > 1) {\n    result.push(options.slice(0, -1))\n  }\n  Object.keys(e.values).map(function (v) {\n    var val = onenumvalue(e.values[v])\n    result.push([v + ' = ' + val + ';'])\n  })\n  result.push('}', '')\n  return result\n}\n\nvar onenumvalue = function (v, result) {\n  var opts = Object.keys(v.options || {}).map(function (key) {\n    return key + ' = ' + v.options[key]\n  }).join(',')\n\n  if (opts) opts = ' [' + opts + ']'\n  var val = v.value + opts\n  return val\n}\n\nvar onoption = function (o, result) {\n  var keys = Object.keys(o)\n  keys.forEach(function (option) {\n    var v = o[option]\n    if (~option.indexOf('.')) option = '(' + option + ')'\n\n    var type = typeof v\n\n    if (type === 'object') {\n      v = onoptionMap(v, [])\n      if (v.length) result.push('option ' + option + ' = {', v, '};')\n    } else {\n      if (type === 'string' && option !== 'optimize_for') v = '\"' + v + '\"'\n      result.push('option ' + option + ' = ' + v + ';')\n    }\n  })\n  if (keys.length > 0) {\n    result.push('')\n  }\n\n  return result\n}\n\nvar onoptionMap = function (o, result) {\n  var keys = Object.keys(o)\n  keys.forEach(function (k) {\n    var v = o[k]\n\n    var type = typeof v\n\n    if (type === 'object') {\n      if (Array.isArray(v)) {\n        v.forEach(function (v) {\n          v = onoptionMap(v, [])\n          if (v.length) result.push(k + ' {', v, '}')\n        })\n      } else {\n        v = onoptionMap(v, [])\n        if (v.length) result.push(k + ' {', v, '}')\n      }\n    } else {\n      if (type === 'string') v = '\"' + v + '\"'\n      result.push(k + ': ' + v)\n    }\n  })\n\n  return result\n}\n\nvar onservices = function (s, result) {\n  result.push('service ' + s.name + ' {')\n\n  if (!s.options) s.options = {}\n  onoption(s.options, result)\n  if (!s.methods) s.methods = []\n  s.methods.forEach(function (m) {\n    result.push(onrpc(m, []))\n  })\n\n  result.push('}', '')\n  return result\n}\n\nvar onrpc = function (rpc, result) {\n  var def = 'rpc ' + rpc.name + '('\n  if (rpc.client_streaming) def += 'stream '\n  def += rpc.input_type + ') returns ('\n  if (rpc.server_streaming) def += 'stream '\n  def += rpc.output_type + ')'\n\n  if (!rpc.options) rpc.options = {}\n\n  var options = onoption(rpc.options, [])\n  if (options.length > 1) {\n    result.push(def + ' {', options.slice(0, -1), '}')\n  } else {\n    result.push(def + ';')\n  }\n\n  return result\n}\n\nvar indent = function (lvl) {\n  return function (line) {\n    if (Array.isArray(line)) return line.map(indent(lvl + '  ')).join('\\n')\n    return lvl + line\n  }\n}\n\nmodule.exports = function (schema) {\n  var result = []\n\n  result.push('syntax = \"proto' + schema.syntax + '\";', '')\n\n  if (schema.package) result.push('package ' + schema.package + ';', '')\n\n  if (!schema.options) schema.options = {}\n\n  onoption(schema.options, result)\n\n  if (!schema.enums) schema.enums = []\n  schema.enums.forEach(function (e) {\n    onenum(e, result)\n  })\n\n  if (!schema.messages) schema.messages = []\n  schema.messages.forEach(function (m) {\n    onmessage(m, result)\n  })\n\n  if (schema.services) {\n    schema.services.forEach(function (s) {\n      onservices(s, result)\n    })\n  }\n  return result.map(indent('')).join('\\n')\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protocol-buffers-schema/stringify.js\n// module id = 1157\n// module chunks = 0\n\n//# sourceURL=../node_modules/protocol-buffers-schema/stringify.js")},function(module,exports){eval("module.exports = function (sch) {\n  var noComments = function (line) {\n    var i = line.indexOf('//')\n    return i > -1 ? line.slice(0, i) : line\n  }\n\n  var noMultilineComments = function () {\n    var inside = false\n    return function (token) {\n      if (token === '/*') {\n        inside = true\n        return false\n      }\n      if (token === '*/') {\n        inside = false\n        return false\n      }\n      return !inside\n    }\n  }\n\n  var trim = function (line) {\n    return line.trim()\n  }\n\n  return sch\n    .replace(/([;,{}()=:[\\]<>]|\\/\\*|\\*\\/)/g, ' $1 ')\n    .split(/\\n/)\n    .map(trim)\n    .filter(Boolean)\n    .map(noComments)\n    .map(trim)\n    .filter(Boolean)\n    .join('\\n')\n    .split(/\\s+|\\n+/gm)\n    .filter(noMultilineComments())\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protocol-buffers-schema/tokenize.js\n// module id = 1158\n// module chunks = 0\n\n//# sourceURL=../node_modules/protocol-buffers-schema/tokenize.js")},function(module,exports,__webpack_require__){"use strict";eval("/* eslint max-depth: 1 */\n\n\nvar varint = __webpack_require__(29)\nvar defined = __webpack_require__(298).defined\n\nfunction compileDecode (m, resolve, enc) {\n  var requiredFields = []\n  var fields = {}\n  var oneofFields = []\n  var vals = []\n\n  for (var i = 0; i < enc.length; i++) {\n    var field = m.fields[i]\n\n    fields[field.tag] = i\n\n    var def = field.options && field.options.default\n    var resolved = resolve(field.type, m.id, false)\n    vals[i] = [def, resolved && resolved.values]\n\n    m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n\n    if (field.required) {\n      requiredFields.push(field.name)\n    }\n\n    if (field.oneof) {\n      oneofFields.push(field.name)\n    }\n  }\n\n  function decodeField (e, field, obj, buf, offset, i) {\n    var name = field.name\n\n    if (field.oneof) {\n      // clear already defined oneof fields\n      var props = Object.keys(obj)\n      for (var j = 0; j < props.length; j++) {\n        if (oneofFields.indexOf(props[j]) > -1) {\n          delete obj[props[j]]\n        }\n      }\n    }\n\n    if (e.message) {\n      var len = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n\n      var decoded = e.decode(buf, offset, offset + len)\n\n      if (field.map) {\n        obj[name] = obj[name] || {}\n        obj[name][decoded.key] = decoded.value\n      } else if (field.repeated) {\n        obj[name] = obj[name] || []\n        obj[name].push(decoded)\n      } else {\n        obj[name] = decoded\n      }\n    } else {\n      if (field.repeated) {\n        obj[name] = obj[name] || []\n        obj[name].push(e.decode(buf, offset))\n      } else {\n        obj[name] = e.decode(buf, offset)\n      }\n    }\n\n    offset += e.decode.bytes\n    return offset\n  }\n\n  return function decode (buf, offset, end) {\n    if (offset == null) {\n      offset = 0\n    }\n\n    if (end == null) {\n      end = buf.length\n    }\n\n    if (!(end <= buf.length && offset <= buf.length)) {\n      throw new Error('Decoded message is not valid')\n    }\n\n    var oldOffset = offset\n    var obj = {}\n    var field\n\n    while (true) {\n      if (end <= offset) {\n        // finished\n\n        // check required methods\n        var name = ''\n        var j = 0\n        for (j = 0; j < requiredFields.length; j++) {\n          name = requiredFields[j]\n          if (!defined(obj[name])) {\n            throw new Error('Decoded message is not valid, missing required field: ' + name)\n          }\n        }\n\n        // fill out missing defaults\n        var val\n        var def\n        for (j = 0; j < enc.length; j++) {\n          field = m.fields[j]\n          def = vals[j][0]\n          val = vals[j][1]\n          name = field.name\n\n          if (defined(obj[name])) {\n            continue\n          }\n\n          var done = false\n          if (field.oneof) {\n            var props = Object.keys(obj)\n            for (var k = 0; k < props.length; k++) {\n              if (oneofFields.indexOf(props[k]) > -1) {\n                done = true\n                break\n              }\n            }\n          }\n\n          if (done) {\n            continue\n          }\n\n          if (val) { // is enum\n            if (field.repeated) {\n              obj[name] = []\n            } else {\n              def = (def && val[def]) ? val[def].value : val[Object.keys(val)[0]].value\n              obj[name] = parseInt(def || 0, 10)\n            }\n          } else {\n            obj[name] = defaultValue(field, def)\n          }\n        }\n\n        decode.bytes = offset - oldOffset\n        return obj\n      }\n\n      var prefix = varint.decode(buf, offset)\n      offset += varint.decode.bytes\n      var tag = prefix >> 3\n\n      var i = fields[tag]\n\n      if (i == null) {\n        offset = skip(prefix & 7, buf, offset)\n        continue\n      }\n\n      var e = enc[i]\n      field = m.fields[i]\n\n      if (field.packed) {\n        var packedEnd = varint.decode(buf, offset)\n        offset += varint.decode.bytes\n        packedEnd += offset\n\n        while (offset < packedEnd) {\n          offset = decodeField(e, field, obj, buf, offset, i)\n        }\n      } else {\n        offset = decodeField(e, field, obj, buf, offset, i)\n      }\n    }\n  }\n}\n\nvar skip = function (type, buffer, offset) {\n  switch (type) {\n    case 0:\n      varint.decode(buffer, offset)\n      return offset + varint.decode.bytes\n\n    case 1:\n      return offset + 8\n\n    case 2:\n      var len = varint.decode(buffer, offset)\n      return offset + varint.decode.bytes + len\n\n    case 3:\n    case 4:\n      throw new Error('Groups are not supported')\n\n    case 5:\n      return offset + 4\n    default:\n      throw new Error('Unknown wire type: ' + type)\n  }\n}\n\nvar defaultValue = function (f, def) {\n  if (f.map) return {}\n  if (f.repeated) return []\n\n  switch (f.type) {\n    case 'string':\n      return def != null ? def : ''\n\n    case 'bool':\n      return def === 'true'\n\n    case 'float':\n    case 'double':\n    case 'sfixed32':\n    case 'fixed32':\n    case 'varint':\n    case 'enum':\n    case 'uint64':\n    case 'uint32':\n    case 'int64':\n    case 'int32':\n    case 'sint64':\n    case 'sint32':\n      return parseInt(def || 0, 10)\n\n    default:\n      return null\n  }\n}\n\nmodule.exports = compileDecode\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/decode.js\n// module id = 1159\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/decode.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar defined = __webpack_require__(298).defined\nvar varint = __webpack_require__(29)\n\nfunction compileEncode (m, resolve, enc, oneofs, encodingLength) {\n  var oneofsKeys = Object.keys(oneofs)\n  var encLength = enc.length\n  var ints = {}\n  for (var i = 0; i < encLength; i++) {\n    ints[i] = {\n      p: varint.encode(m.fields[i].tag << 3 | 2),\n      h: varint.encode(m.fields[i].tag << 3 | enc[i].type)\n    }\n\n    var field = m.fields[i]\n    m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n  }\n\n  function encodeField (buf, offset, h, e, packed, innerVal) {\n    var j = 0\n    if (!packed) {\n      for (j = 0; j < h.length; j++) {\n        buf[offset++] = h[j]\n      }\n    }\n\n    if (e.message) {\n      varint.encode(e.encodingLength(innerVal), buf, offset)\n      offset += varint.encode.bytes\n    }\n\n    e.encode(innerVal, buf, offset)\n    return offset + e.encode.bytes\n  }\n\n  return function encode (obj, buf, offset) {\n    if (offset == null) {\n      offset = 0\n    }\n    if (buf == null) {\n      buf = Buffer.allocUnsafe(encodingLength(obj))\n    }\n\n    var oldOffset = offset\n    var objKeys = Object.keys(obj)\n    var i = 0\n\n    // oneof checks\n\n    var match = false\n    for (i = 0; i < oneofsKeys.length; i++) {\n      var name = oneofsKeys[i]\n      var prop = oneofs[i]\n      if (objKeys.indexOf(prop) > -1) {\n        if (match) {\n          throw new Error('only one of the properties defined in oneof ' + name + ' can be set')\n        }\n\n        match = true\n      }\n    }\n\n    for (i = 0; i < encLength; i++) {\n      var e = enc[i]\n      var field = m.fields[i] // was f\n      var val = obj[field.name]\n      var j = 0\n\n      if (!defined(val)) {\n        if (field.required) {\n          throw new Error(field.name + ' is required')\n        }\n        continue\n      }\n      var p = ints[i].p\n      var h = ints[i].h\n\n      var packed = field.packed\n\n      if (field.map) {\n        var tmp = Object.keys(val)\n        for (j = 0; j < tmp.length; j++) {\n          tmp[j] = {\n            key: tmp[j],\n            value: val[tmp[j]]\n          }\n        }\n        val = tmp\n      }\n\n      if (packed) {\n        var packedLen = 0\n        for (j = 0; j < val.length; j++) {\n          if (!defined(val[j])) {\n            continue\n          }\n\n          packedLen += e.encodingLength(val[j])\n        }\n\n        if (packedLen) {\n          for (j = 0; j < h.length; j++) {\n            buf[offset++] = p[j]\n          }\n          varint.encode(packedLen, buf, offset)\n          offset += varint.encode.bytes\n        }\n      }\n\n      if (field.repeated) {\n        var innerVal\n        for (j = 0; j < val.length; j++) {\n          innerVal = val[j]\n          if (!defined(innerVal)) {\n            continue\n          }\n          offset = encodeField(buf, offset, h, e, packed, innerVal)\n        }\n      } else {\n        offset = encodeField(buf, offset, h, e, packed, val)\n      }\n    }\n\n    encode.bytes = offset - oldOffset\n    return buf\n  }\n}\n\nmodule.exports = compileEncode\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/encode.js\n// module id = 1160\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/encode.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar defined = __webpack_require__(298).defined\nvar varint = __webpack_require__(29)\n\nfunction compileEncodingLength (m, enc, oneofs) {\n  var oneofsKeys = Object.keys(oneofs)\n  var encLength = enc.length\n\n  var hls = new Array(encLength)\n\n  for (var i = 0; i < m.fields.length; i++) {\n    hls[i] = varint.encodingLength(m.fields[i].tag << 3 | enc[i].type)\n\n    var field = m.fields[i]\n    m.fields[i].packed = field.repeated && field.options && field.options.packed && field.options.packed !== 'false'\n  }\n\n  return function encodingLength (obj) {\n    var length = 0\n    var i = 0\n    var j = 0\n\n    for (i = 0; i < oneofsKeys.length; i++) {\n      var name = oneofsKeys[i]\n      var props = oneofs[name]\n\n      var match = false\n      for (j = 0; j < props.length; j++) {\n        if (defined(obj[props[j]])) {\n          if (match) {\n            throw new Error('only one of the properties defined in oneof ' + name + ' can be set')\n          }\n          match = true\n        }\n      }\n    }\n\n    for (i = 0; i < encLength; i++) {\n      var e = enc[i]\n      var field = m.fields[i]\n      var val = obj[field.name]\n      var hl = hls[i]\n      var len\n\n      if (!defined(val)) {\n        if (field.required) {\n          throw new Error(field.name + ' is required')\n        }\n\n        continue\n      }\n\n      if (field.map) {\n        var tmp = Object.keys(val)\n        for (j = 0; j < tmp.length; j++) {\n          tmp[j] = {\n            key: tmp[j],\n            value: val[tmp[j]]\n          }\n        }\n\n        val = tmp\n      }\n\n      if (field.packed) {\n        var packedLen = 0\n        for (j = 0; j < val.length; j++) {\n          if (!defined(val[j])) {\n            continue\n          }\n          len = e.encodingLength(val[j])\n          packedLen += len\n\n          if (e.message) {\n            packedLen += varint.encodingLength(len)\n          }\n        }\n\n        if (packedLen) {\n          length += hl + packedLen + varint.encodingLength(packedLen)\n        }\n      } else if (field.repeated) {\n        for (j = 0; j < val.length; j++) {\n          if (!defined(val[j])) {\n            continue\n          }\n\n          len = e.encodingLength(val[j])\n          length += hl + len + (e.message ? varint.encodingLength(len) : 0)\n        }\n      } else {\n        len = e.encodingLength(val)\n        length += hl + len + (e.message ? varint.encodingLength(len) : 0)\n      }\n    }\n\n    return length\n  }\n}\n\nmodule.exports = compileEncodingLength\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/encoding-length.js\n// module id = 1161\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/encoding-length.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar varint = __webpack_require__(29)\nvar svarint = __webpack_require__(1235)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar encoder = function (type, encode, decode, encodingLength) {\n  encode.bytes = decode.bytes = 0\n\n  return {\n    type: type,\n    encode: encode,\n    decode: decode,\n    encodingLength: encodingLength\n  }\n}\n\nexports.make = encoder\n\nexports.bytes = (function (tag) {\n  var bufferLength = function (val) {\n    return Buffer.isBuffer(val) ? val.length : Buffer.byteLength(val)\n  }\n\n  var encodingLength = function (val) {\n    var len = bufferLength(val)\n    return varint.encodingLength(len) + len\n  }\n\n  var encode = function (val, buffer, offset) {\n    var oldOffset = offset\n    var len = bufferLength(val)\n\n    varint.encode(len, buffer, offset)\n    offset += varint.encode.bytes\n\n    if (Buffer.isBuffer(val)) val.copy(buffer, offset)\n    else buffer.write(val, offset, len)\n    offset += len\n\n    encode.bytes = offset - oldOffset\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var oldOffset = offset\n\n    var len = varint.decode(buffer, offset)\n    offset += varint.decode.bytes\n\n    var val = buffer.slice(offset, offset + len)\n    offset += val.length\n\n    decode.bytes = offset - oldOffset\n    return val\n  }\n\n  return encoder(2, encode, decode, encodingLength)\n})()\n\nexports.string = (function () {\n  var encodingLength = function (val) {\n    var len = Buffer.byteLength(val)\n    return varint.encodingLength(len) + len\n  }\n\n  var encode = function (val, buffer, offset) {\n    var oldOffset = offset\n    var len = Buffer.byteLength(val)\n\n    varint.encode(len, buffer, offset, 'utf-8')\n    offset += varint.encode.bytes\n\n    buffer.write(val, offset, len)\n    offset += len\n\n    encode.bytes = offset - oldOffset\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var oldOffset = offset\n\n    var len = varint.decode(buffer, offset)\n    offset += varint.decode.bytes\n\n    var val = buffer.toString('utf-8', offset, offset + len)\n    offset += len\n\n    decode.bytes = offset - oldOffset\n    return val\n  }\n\n  return encoder(2, encode, decode, encodingLength)\n})()\n\nexports.bool = (function () {\n  var encodingLength = function (val) {\n    return 1\n  }\n\n  var encode = function (val, buffer, offset) {\n    buffer[offset] = val ? 1 : 0\n    encode.bytes = 1\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var bool = buffer[offset] > 0\n    decode.bytes = 1\n    return bool\n  }\n\n  return encoder(0, encode, decode, encodingLength)\n})()\n\nexports.int32 = (function () {\n  var decode = function (buffer, offset) {\n    var val = varint.decode(buffer, offset)\n    decode.bytes = varint.decode.bytes\n    return val > 2147483647 ? val - 4294967296 : val\n  }\n\n  var encode = function (val, buffer, offset) {\n    varint.encode(val < 0 ? val + 4294967296 : val, buffer, offset)\n    encode.bytes = varint.encode.bytes\n    return buffer\n  }\n\n  var encodingLength = function (val) {\n    return varint.encodingLength(val < 0 ? val + 4294967296 : val)\n  }\n\n  return encoder(0, varint.encode, decode, encodingLength)\n})()\n\nexports.int64 = (function () {\n  var decode = function (buffer, offset) {\n    var val = varint.decode(buffer, offset)\n    if (val >= Math.pow(2, 63)) {\n      var limit = 9\n      while (buffer[offset + limit - 1] === 0xff) limit--\n      limit = limit || 9\n      var subset = Buffer.allocUnsafe(limit)\n      buffer.copy(subset, 0, offset, offset + limit)\n      subset[limit - 1] = subset[limit - 1] & 0x7f\n      val = -1 * varint.decode(subset, 0)\n      decode.bytes = 10\n    } else {\n      decode.bytes = varint.decode.bytes\n    }\n    return val\n  }\n\n  var encode = function (val, buffer, offset) {\n    if (val < 0) {\n      var last = offset + 9\n      varint.encode(val * -1, buffer, offset)\n      offset += varint.encode.bytes - 1\n      buffer[offset] = buffer[offset] | 0x80\n      while (offset < last - 1) {\n        offset++\n        buffer[offset] = 0xff\n      }\n      buffer[last] = 0x01\n      encode.bytes = 10\n    } else {\n      varint.encode(val, buffer, offset)\n      encode.bytes = varint.encode.bytes\n    }\n    return buffer\n  }\n\n  var encodingLength = function (val) {\n    return val < 0 ? 10 : varint.encodingLength(val)\n  }\n\n  return encoder(0, encode, decode, encodingLength)\n})()\n\nexports.sint32 =\nexports.sint64 = (function () {\n  return encoder(0, svarint.encode, svarint.decode, svarint.encodingLength)\n})()\n\nexports.uint32 =\nexports.uint64 =\nexports.enum =\nexports.varint = (function () {\n  return encoder(0, varint.encode, varint.decode, varint.encodingLength)\n})()\n\n// we cannot represent these in javascript so we just use buffers\nexports.fixed64 =\nexports.sfixed64 = (function () {\n  var encodingLength = function (val) {\n    return 8\n  }\n\n  var encode = function (val, buffer, offset) {\n    val.copy(buffer, offset)\n    encode.bytes = 8\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var val = buffer.slice(offset, offset + 8)\n    decode.bytes = 8\n    return val\n  }\n\n  return encoder(1, encode, decode, encodingLength)\n})()\n\nexports.double = (function () {\n  var encodingLength = function (val) {\n    return 8\n  }\n\n  var encode = function (val, buffer, offset) {\n    buffer.writeDoubleLE(val, offset)\n    encode.bytes = 8\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var val = buffer.readDoubleLE(offset)\n    decode.bytes = 8\n    return val\n  }\n\n  return encoder(1, encode, decode, encodingLength)\n})()\n\nexports.fixed32 = (function () {\n  var encodingLength = function (val) {\n    return 4\n  }\n\n  var encode = function (val, buffer, offset) {\n    buffer.writeUInt32LE(val, offset)\n    encode.bytes = 4\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var val = buffer.readUInt32LE(offset)\n    decode.bytes = 4\n    return val\n  }\n\n  return encoder(5, encode, decode, encodingLength)\n})()\n\nexports.sfixed32 = (function () {\n  var encodingLength = function (val) {\n    return 4\n  }\n\n  var encode = function (val, buffer, offset) {\n    buffer.writeInt32LE(val, offset)\n    encode.bytes = 4\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var val = buffer.readInt32LE(offset)\n    decode.bytes = 4\n    return val\n  }\n\n  return encoder(5, encode, decode, encodingLength)\n})()\n\nexports.float = (function () {\n  var encodingLength = function (val) {\n    return 4\n  }\n\n  var encode = function (val, buffer, offset) {\n    buffer.writeFloatLE(val, offset)\n    encode.bytes = 4\n    return buffer\n  }\n\n  var decode = function (buffer, offset) {\n    var val = buffer.readFloatLE(offset)\n    decode.bytes = 4\n    return val\n  }\n\n  return encoder(5, encode, decode, encodingLength)\n})()\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/encodings.js\n// module id = 1162\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/encodings.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar encodings = __webpack_require__(1162)\nvar compileDecode = __webpack_require__(1159)\nvar compileEncode = __webpack_require__(1160)\nvar compileEncodingLength = __webpack_require__(1161)\nvar varint = __webpack_require__(29)\n\nvar flatten = function (values) {\n  if (!values) return null\n  var result = {}\n  Object.keys(values).forEach(function (k) {\n    result[k] = values[k].value\n  })\n  return result\n}\n\nmodule.exports = function (schema, extraEncodings) {\n  var messages = {}\n  var enums = {}\n  var cache = {}\n\n  var visit = function (schema, prefix) {\n    if (schema.enums) {\n      schema.enums.forEach(function (e) {\n        e.id = prefix + (prefix ? '.' : '') + e.name\n        enums[e.id] = e\n        visit(e, e.id)\n      })\n    }\n    if (schema.messages) {\n      schema.messages.forEach(function (m) {\n        m.id = prefix + (prefix ? '.' : '') + m.name\n        messages[m.id] = m\n        m.fields.forEach(function (f) {\n          if (!f.map) return\n\n          var name = 'Map_' + f.map.from + '_' + f.map.to\n          var map = {\n            name: name,\n            enums: [],\n            messages: [],\n            fields: [{\n              name: 'key',\n              type: f.map.from,\n              tag: 1,\n              repeated: false,\n              required: true\n            }, {\n              name: 'value',\n              type: f.map.to,\n              tag: 2,\n              repeated: false,\n              required: false\n            }],\n            extensions: null,\n            id: prefix + (prefix ? '.' : '') + name\n          }\n\n          if (!messages[map.id]) {\n            messages[map.id] = map\n            schema.messages.push(map)\n          }\n          f.type = name\n          f.repeated = true\n        })\n        visit(m, m.id)\n      })\n    }\n  }\n\n  visit(schema, '')\n\n  var compileEnum = function (e) {\n    var values = Object.keys(e.values || []).map(function (k) {\n      return parseInt(e.values[k].value, 10)\n    })\n\n    var encode = function encode (val, buf, offset) {\n      if (!values.length || values.indexOf(val) === -1) {\n        throw new Error('Invalid enum value: ' + val)\n      }\n      varint.encode(val, buf, offset)\n      encode.bytes = varint.encode.bytes\n      return buf\n    }\n\n    var decode = function decode (buf, offset) {\n      var val = varint.decode(buf, offset)\n      if (!values.length || values.indexOf(val) === -1) {\n        throw new Error('Invalid enum value: ' + val)\n      }\n      decode.bytes = varint.decode.bytes\n      return val\n    }\n\n    return encodings.make(0, encode, decode, varint.encodingLength)\n  }\n\n  var compileMessage = function (m, exports) {\n    m.messages.forEach(function (nested) {\n      exports[nested.name] = resolve(nested.name, m.id)\n    })\n\n    m.enums.forEach(function (val) {\n      exports[val.name] = flatten(val.values)\n    })\n\n    exports.type = 2\n    exports.message = true\n    exports.name = m.name\n\n    var oneofs = {}\n\n    m.fields.forEach(function (f) {\n      if (!f.oneof) return\n      if (!oneofs[f.oneof]) oneofs[f.oneof] = []\n      oneofs[f.oneof].push(f.name)\n    })\n\n    var enc = m.fields.map(function (f) {\n      return resolve(f.type, m.id)\n    })\n\n    var encodingLength = compileEncodingLength(m, enc, oneofs)\n    var encode = compileEncode(m, resolve, enc, oneofs, encodingLength)\n    var decode = compileDecode(m, resolve, enc)\n\n    // end of compilation - return all the things\n\n    encode.bytes = decode.bytes = 0\n\n    exports.buffer = true\n    exports.encode = encode\n    exports.decode = decode\n    exports.encodingLength = encodingLength\n\n    return exports\n  }\n\n  var resolve = function (name, from, compile) {\n    if (extraEncodings && extraEncodings[name]) return extraEncodings[name]\n    if (encodings[name]) return encodings[name]\n\n    var m = (from ? from + '.' + name : name).split('.')\n      .map(function (part, i, list) {\n        return list.slice(0, i).concat(name).join('.')\n      })\n      .reverse()\n      .reduce(function (result, id) {\n        return result || messages[id] || enums[id]\n      }, null)\n\n    if (compile === false) return m\n    if (!m) throw new Error('Could not resolve ' + name)\n\n    if (m.values) return compileEnum(m)\n    var res = cache[m.id] || compileMessage(m, cache[m.id] = {})\n    return res\n  }\n\n  return (schema.enums || []).concat((schema.messages || []).map(function (message) {\n    return resolve(message.id)\n  }))\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/protons/src/compile/index.js\n// module id = 1163\n// module chunks = 0\n\n//# sourceURL=../node_modules/protons/src/compile/index.js")},function(module,exports,__webpack_require__){eval("exports.publicEncrypt = __webpack_require__(1166);\nexports.privateDecrypt = __webpack_require__(1165);\n\nexports.privateEncrypt = function privateEncrypt(key, buf) {\n  return exports.publicEncrypt(key, buf, true);\n};\n\nexports.publicDecrypt = function publicDecrypt(key, buf) {\n  return exports.privateDecrypt(key, buf, true);\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/browser.js\n// module id = 1164\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/browser.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(200);\nvar mgf = __webpack_require__(509);\nvar xor = __webpack_require__(511);\nvar bn = __webpack_require__(17);\nvar crt = __webpack_require__(238);\nvar createHash = __webpack_require__(59);\nvar withPublic = __webpack_require__(510);\nmodule.exports = function privateDecrypt(private_key, enc, reverse) {\n  var padding;\n  if (private_key.padding) {\n    padding = private_key.padding;\n  } else if (reverse) {\n    padding = 1;\n  } else {\n    padding = 4;\n  }\n  \n  var key = parseKeys(private_key);\n  var k = key.modulus.byteLength();\n  if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) {\n    throw new Error('decryption error');\n  }\n  var msg;\n  if (reverse) {\n    msg = withPublic(new bn(enc), key);\n  } else {\n    msg = crt(enc, key);\n  }\n  var zBuffer = new Buffer(k - msg.length);\n  zBuffer.fill(0);\n  msg = Buffer.concat([zBuffer, msg], k);\n  if (padding === 4) {\n    return oaep(key, msg);\n  } else if (padding === 1) {\n    return pkcs1(key, msg, reverse);\n  } else if (padding === 3) {\n    return msg;\n  } else {\n    throw new Error('unknown padding');\n  }\n};\n\nfunction oaep(key, msg){\n  var n = key.modulus;\n  var k = key.modulus.byteLength();\n  var mLen = msg.length;\n  var iHash = createHash('sha1').update(new Buffer('')).digest();\n  var hLen = iHash.length;\n  var hLen2 = 2 * hLen;\n  if (msg[0] !== 0) {\n    throw new Error('decryption error');\n  }\n  var maskedSeed = msg.slice(1, hLen + 1);\n  var maskedDb =  msg.slice(hLen + 1);\n  var seed = xor(maskedSeed, mgf(maskedDb, hLen));\n  var db = xor(maskedDb, mgf(seed, k - hLen - 1));\n  if (compare(iHash, db.slice(0, hLen))) {\n    throw new Error('decryption error');\n  }\n  var i = hLen;\n  while (db[i] === 0) {\n    i++;\n  }\n  if (db[i++] !== 1) {\n    throw new Error('decryption error');\n  }\n  return db.slice(i);\n}\n\nfunction pkcs1(key, msg, reverse){\n  var p1 = msg.slice(0, 2);\n  var i = 2;\n  var status = 0;\n  while (msg[i++] !== 0) {\n    if (i >= msg.length) {\n      status++;\n      break;\n    }\n  }\n  var ps = msg.slice(2, i - 1);\n  var p2 = msg.slice(i - 1, i);\n\n  if ((p1.toString('hex') !== '0002' && !reverse) || (p1.toString('hex') !== '0001' && reverse)){\n    status++;\n  }\n  if (ps.length < 8) {\n    status++;\n  }\n  if (status) {\n    throw new Error('decryption error');\n  }\n  return  msg.slice(i);\n}\nfunction compare(a, b){\n  a = new Buffer(a);\n  b = new Buffer(b);\n  var dif = 0;\n  var len = a.length;\n  if (a.length !== b.length) {\n    dif++;\n    len = Math.min(a.length, b.length);\n  }\n  var i = -1;\n  while (++i < len) {\n    dif += (a[i] ^ b[i]);\n  }\n  return dif;\n}\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/privateDecrypt.js\n// module id = 1165\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/privateDecrypt.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(200);\nvar randomBytes = __webpack_require__(80);\nvar createHash = __webpack_require__(59);\nvar mgf = __webpack_require__(509);\nvar xor = __webpack_require__(511);\nvar bn = __webpack_require__(17);\nvar withPublic = __webpack_require__(510);\nvar crt = __webpack_require__(238);\n\nvar constants = {\n  RSA_PKCS1_OAEP_PADDING: 4,\n  RSA_PKCS1_PADDIN: 1,\n  RSA_NO_PADDING: 3\n};\n\nmodule.exports = function publicEncrypt(public_key, msg, reverse) {\n  var padding;\n  if (public_key.padding) {\n    padding = public_key.padding;\n  } else if (reverse) {\n    padding = 1;\n  } else {\n    padding = 4;\n  }\n  var key = parseKeys(public_key);\n  var paddedMsg;\n  if (padding === 4) {\n    paddedMsg = oaep(key, msg);\n  } else if (padding === 1) {\n    paddedMsg = pkcs1(key, msg, reverse);\n  } else if (padding === 3) {\n    paddedMsg = new bn(msg);\n    if (paddedMsg.cmp(key.modulus) >= 0) {\n      throw new Error('data too long for modulus');\n    }\n  } else {\n    throw new Error('unknown padding');\n  }\n  if (reverse) {\n    return crt(paddedMsg, key);\n  } else {\n    return withPublic(paddedMsg, key);\n  }\n};\n\nfunction oaep(key, msg){\n  var k = key.modulus.byteLength();\n  var mLen = msg.length;\n  var iHash = createHash('sha1').update(new Buffer('')).digest();\n  var hLen = iHash.length;\n  var hLen2 = 2 * hLen;\n  if (mLen > k - hLen2 - 2) {\n    throw new Error('message too long');\n  }\n  var ps = new Buffer(k - mLen - hLen2 - 2);\n  ps.fill(0);\n  var dblen = k - hLen - 1;\n  var seed = randomBytes(hLen);\n  var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen));\n  var maskedSeed = xor(seed, mgf(maskedDb, hLen));\n  return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k));\n}\nfunction pkcs1(key, msg, reverse){\n  var mLen = msg.length;\n  var k = key.modulus.byteLength();\n  if (mLen > k - 11) {\n    throw new Error('message too long');\n  }\n  var ps;\n  if (reverse) {\n    ps = new Buffer(k - mLen - 3);\n    ps.fill(0xff);\n  } else {\n    ps = nonZero(k - mLen - 3);\n  }\n  return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k));\n}\nfunction nonZero(len, crypto) {\n  var out = new Buffer(len);\n  var i = 0;\n  var cache = randomBytes(len*2);\n  var cur = 0;\n  var num;\n  while (i < len) {\n    if (cur === cache.length) {\n      cache = randomBytes(len*2);\n      cur = 0;\n    }\n    num = cache[cur++];\n    if (num) {\n      out[i++] = num;\n    }\n  }\n  return out;\n}\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/public-encrypt/publicEncrypt.js\n// module id = 1166\n// module chunks = 0\n\n//# sourceURL=../node_modules/public-encrypt/publicEncrypt.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar through = __webpack_require__(206)\n\nfunction lazyConcat (buffers) {\n  if (buffers.length === 1) return buffers[0]\n  return Buffer.concat(buffers)\n}\n\nfunction lazySlice (buf, begin, end) {\n  if (begin === 0 && end === buf.length) return buf\n  return buf.slice(begin, end)\n}\n\nmodule.exports = function block (size, opts) {\n  if (!opts) opts = {}\n  if (typeof size === 'object') {\n    opts = size\n    size = opts.size\n  }\n  size = size || 512\n\n  var zeroPadding\n\n  if (opts.nopad) {\n    zeroPadding = false\n  } else {\n    zeroPadding = typeof opts.zeroPadding !== 'undefined' ? opts.zeroPadding : true\n  }\n\n  var buffered = []\n  var bufferedBytes = 0\n  var bufferSkip = 0\n  var emittedChunk = false\n\n  return through(function transform (data) {\n    if (typeof data === 'number') {\n      data = Buffer.from([data])\n    }\n    bufferedBytes += data.length\n    buffered.push(data)\n\n    while (bufferedBytes >= size) {\n      var targetLength = 0\n      var target = []\n      var index = 0\n      var b, end, out\n\n      while (targetLength < size) {\n        b = buffered[index]\n\n        // Slice as much as we can from the next buffer.\n        end = Math.min(bufferSkip + size - targetLength, b.length)\n        out = lazySlice(b, bufferSkip, end)\n        targetLength += out.length\n        target.push(out)\n\n        if (end === b.length) {\n          // If that consumes the buffer, move on to the next.\n          index++\n          bufferSkip = 0\n        } else {\n          // Otherwise keep track of how much we used.\n          bufferSkip += out.length\n        }\n      }\n\n      // Remove all consumed buffers and output the selection.\n      buffered = buffered.slice(index)\n      bufferedBytes -= targetLength\n      this.queue(lazyConcat(target))\n\n      emittedChunk = true\n    }\n  }, function flush (end) {\n    if ((opts.emitEmpty && !emittedChunk) || bufferedBytes) {\n      if (zeroPadding) {\n        var zeroes = Buffer.alloc(size - bufferedBytes)\n        zeroes.fill(0)\n        buffered.push(zeroes)\n      }\n      if (buffered) {\n        if (buffered.length > 0) {\n          // Don't copy the bufferSkip bytes through concat.\n          buffered[0] = buffered[0].slice(bufferSkip)\n        }\n\n        this.queue(lazyConcat(buffered))\n        buffered = null\n      }\n    }\n    this.queue(null)\n  })\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-block/index.js\n// module id = 1167\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-block/index.js")},function(module,exports){eval("module.exports = function Catch (onError) {\n    onError = onError || function noop () {}\n    var errd\n    return function sink (read) {\n        return function source (abort, cb) {\n            read(abort, function onNext (end, data) {\n                if (errd) return cb(true)\n                if (end && end !== true) {  // if error\n                    var _end = onError(end)\n                    if (_end === false) return cb(end)\n                    if (_end && _end !== true) {\n                        errd = true\n                        return cb(null, _end)\n                    }\n                    return cb(true)\n                }\n                cb(end, data)\n            })\n        }\n    }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-catch/index.js\n// module id = 1168\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-catch/index.js")},function(module,exports){eval("\nmodule.exports = function () {\n  var read, reader, cb, abort, stream\n\n  function delayed (_read) {\n    //if we already have the stream, go!\n    if(stream) return stream(_read)\n\n    read = _read\n    return function (_abort, _cb) {\n      if(reader) reader(_abort, _cb)\n      else abort = _abort, cb = _cb\n\n    }\n  }\n\n  delayed.resolve = function (_stream) {\n    if(stream) throw new Error('already resolved')\n    stream = _stream\n    if(!stream) throw new Error('resolve *must* be passed a transform stream')\n    if(read) {\n      reader = stream(read)\n      if(cb) reader(abort, cb)\n    }\n  }\n\n  return delayed\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-defer/through.js\n// module id = 1169\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-defer/through.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst varint = __webpack_require__(29)\nconst Reader = __webpack_require__(516)\nconst Buffer = __webpack_require__(1).Buffer\nconst pushable = __webpack_require__(54)\n\nexports.decode = decode\nexports.decodeFromReader = decodeFromReader\n\nconst MSB = 0x80\nconst isEndByte = (byte) => !(byte & MSB)\nconst MAX_LENGTH = ((1024 * 1024) * 4)\n\nfunction decode (opts) {\n  let reader = new Reader()\n  let p = pushable((err) => {\n    reader.abort(err)\n  })\n\n  return (read) => {\n    reader(read)\n    function next () {\n      decodeFromReader(reader, opts, (err, msg) => {\n        if (err) return p.end(err)\n\n        p.push(msg)\n        next()\n      })\n    }\n\n    next()\n    return p\n  }\n}\n\nfunction decodeFromReader (reader, opts, cb) {\n  if (typeof opts === 'function') {\n    cb = opts\n    opts = {}\n  }\n\n  opts = Object.assign({\n    fixed: false,\n    bytes: 4\n  }, opts || {})\n\n  if (opts.fixed) {\n    readFixedMessage(reader, opts.bytes, opts.maxLength, cb)\n  } else {\n    readVarintMessage(reader, opts.maxLength, cb)\n  }\n}\n\nfunction readFixedMessage (reader, byteLength, maxLength, cb) {\n  if (typeof maxLength === 'function') {\n    cb = maxLength\n    maxLength = MAX_LENGTH\n  }\n\n  reader.read(byteLength, (err, bytes) => {\n    if (err) {\n      return cb(err)\n    }\n\n    const msgSize = bytes.readInt32BE(0)\n    if (msgSize > maxLength) {\n      return cb('size longer than max permitted length of ' + maxLength + '!')\n    }\n\n    readMessage(reader, msgSize, cb)\n  })\n}\n\nfunction readVarintMessage (reader, maxLength, cb) {\n  if (typeof maxLength === 'function') {\n    cb = maxLength\n    maxLength = MAX_LENGTH\n  }\n\n  let rawMsgSize = []\n  if (rawMsgSize.length === 0) readByte()\n\n  // 1. Read the varint\n  function readByte () {\n    reader.read(1, (err, byte) => {\n      if (err) {\n        return cb(err)\n      }\n\n      rawMsgSize.push(byte)\n\n      if (byte && !isEndByte(byte[0])) {\n        readByte()\n        return\n      }\n\n      const msgSize = varint.decode(Buffer.concat(rawMsgSize))\n      if (msgSize > maxLength) {\n        return cb('size longer than max permitted length of ' + maxLength + '!')\n      }\n      readMessage(reader, msgSize, (err, msg) => {\n        if (err) {\n          return cb(err)\n        }\n\n        rawMsgSize = []\n\n        cb(null, msg)\n      })\n    })\n  }\n}\n\nfunction readMessage (reader, size, cb) {\n  reader.read(size, (err, msg) => {\n    if (err) {\n      return cb(err)\n    }\n\n    cb(null, msg)\n  })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-length-prefixed/src/decode.js\n// module id = 1170\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-length-prefixed/src/decode.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst Buffer = __webpack_require__(1).Buffer\n\nmodule.exports = encode\n\nconst poolSize = 10 * 1024\n\nfunction encode (opts) {\n  opts = Object.assign({\n    fixed: false,\n    bytes: 4\n  }, opts || {})\n\n  // Only needed for varint\n  const varint = __webpack_require__(29)\n  let pool = opts.fixed ? null : createPool()\n  let used = 0\n\n  let ended = false\n\n  return (read) => (end, cb) => {\n    if (end) ended = end\n    if (ended) return cb(ended)\n\n    read(null, (end, data) => {\n      if (end) ended = end\n      if (ended) return cb(ended)\n\n      if (!Buffer.isBuffer(data)) {\n        ended = new Error('data must be a buffer')\n        return cb(ended)\n      }\n\n      let encodedLength\n      if (opts.fixed) {\n        encodedLength = Buffer.alloc(opts.bytes)\n        encodedLength.writeInt32BE(data.length, 0)\n      } else {\n        varint.encode(data.length, pool, used)\n        used += varint.encode.bytes\n        encodedLength = pool.slice(used - varint.encode.bytes, used)\n\n        if (pool.length - used < 100) {\n          pool = createPool()\n          used = 0\n        }\n      }\n\n      cb(null, Buffer.concat([\n        encodedLength,\n        data\n      ]))\n    })\n  }\n}\n\nfunction createPool () {\n  return Buffer.alloc(poolSize)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-length-prefixed/src/encode.js\n// module id = 1171\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-length-prefixed/src/encode.js")},function(module,exports){eval("\n\n/*\nall pull streams have these states:\n\n{\n  START: {\n    read: READING,\n    abort: ABORTING\n  },\n  READY: {\n    read: READING,\n    abort: ABORTING\n  },\n  READING: {\n    cb: READY,\n    err: ERROR,\n    end: END\n  },\n  ABORTING: {\n    cb: END\n  },\n  ERROR: {},\n  END: {}\n}\n\nthis module takes a collection of pull-streams,\nand interleaves their states.\nif all the streams have ended, it ends.\nIf it is in reading state, and one stream goes has READING->cb\nit goes into READY\n\non read, trigger read on every stream in START or READY\n\non abort, trigger abort on all streams immediately***\n\nif a stream is in READY, and big stream is in ABORT,\ntrigger abort\n\nif every stream is in END or ERROR, trigger end or error\n\ncould you describe this declaritively or something?\n*/\n\nmodule.exports = function (ary) {\n\n  var capped = !!ary\n  var inputs = (ary || []).map(create), i = 0, abort, cb\n\n  function create (stream) {\n    return {ready: false, reading: false, ended: false, read: stream, data: null}\n  }\n\n  function check () {\n    if(!cb) return\n    clean()\n    var l = inputs.length\n    var _cb = cb\n    if(l === 0 && (abort || capped)) {\n      cb = null; _cb(abort ||  true)\n      return\n    }\n\n    //scan the inputs to check whether there is one we can use.\n    for(var j = 0; j < l; j++) {\n      var current = inputs[(i + j) % l]\n      if(current.ready && !current.ended) {\n        var data = current.data\n        current.ready = false\n        current.data = null\n        i ++; cb = null\n        return _cb(null, data)\n      }\n    }\n  }\n\n  function clean () {\n    var l = inputs.length\n    //iterate backwards so that we can remove items.\n    while(l--) {\n      if(inputs[l].ended)\n        inputs.splice(l, 1)\n    }\n  }\n\n  function next () {\n    var l = inputs.length\n    while(l--)\n      (function (current) {\n        //read the next item if we aren't already\n        if(l > inputs.length) throw new Error('this should never happen')\n        if(current.reading || current.ended || current.ready) return\n        current.reading = true\n        var sync = true\n        current.read(abort, function next (end, data) {\n          current.data = data\n          current.ready = true\n          current.reading = false\n\n          if(end === true || abort) current.ended = true\n          else if(end) abort = current.ended = end\n          //check whether we need to abort this stream.\n          if(abort && !end) current.read(abort, next)\n          if(!sync) check()\n        })\n        sync = false\n      })(inputs[l])\n\n    //scan the feed\n    check()\n  }\n\n  function read (_abort, _cb) {\n    abort = abort || _abort; cb = _cb; next()\n  }\n\n  read.add = function (stream) {\n    if(!stream) {\n      //the stream will now end when all the streams end.\n      capped = true\n      //we just changed state, so we may need to cb\n      return next()\n    }\n    inputs.push(create(stream))\n    next()\n  }\n\n  read.cap = function (err) {\n    read.add(null)\n  }\n\n  return read\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-many/index.js\n// module id = 1172\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-many/index.js")},function(module,exports){eval("\n\nmodule.exports = function (fn) {\n  var active = false, called = 0\n  return function () {\n    called = true\n    if(!active) {\n      active = true\n      while(called) {\n        called = false\n        fn()\n      }\n      active = false\n    }\n  }\n}\n\n\n\n\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-paramap/~/looper/index.js\n// module id = 1173\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-paramap/node_modules/looper/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nmodule.exports = function () {\n\n  var buffers = [], length = 0\n\n  //just used for debugging...\n  function calcLength () {\n    return buffers.reduce(function (a, b) {\n      return a + b.length\n    }, 0)\n  }\n\n  return {\n    length: length,\n    data: this,\n    add: function (data) {\n      if(!Buffer.isBuffer(data))\n        throw new Error('data must be a buffer, was: ' + JSON.stringify(data))\n      this.length = length = length + data.length\n      buffers.push(data)\n      return this\n    },\n    has: function (n) {\n      if(null == n) return length > 0\n      return length >= n\n    },\n    get: function (n) {\n      var _length\n      if(n == null || n === length) {\n        length = 0\n        var _buffers = buffers\n        buffers = []\n        if(_buffers.length == 1)\n          return _buffers[0]\n        else\n          return Buffer.concat(_buffers)\n      } else if (buffers.length > 1 && n <= (_length = buffers[0].length)) {\n        var buf = buffers[0].slice(0, n)\n        if(n === _length) {\n          buffers.shift()\n        }\n        else {\n          buffers[0] = buffers[0].slice(n, _length)\n        }\n        length -= n\n        return buf\n      }  else if(n < length) {\n        var out = [], len = 0\n\n        while((len + buffers[0].length) < n) {\n          var b = buffers.shift()\n          len += b.length\n          out.push(b)\n        }\n\n        if(len < n) {\n          out.push(buffers[0].slice(0, n - len))\n          buffers[0] = buffers[0].slice(n - len, buffers[0].length)\n          this.length = length = length - n\n        }\n        return Buffer.concat(out)\n      }\n      else\n        throw new Error('could not get ' + n + ' bytes')\n    }\n  }\n\n}\n\n\n\n\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-reader/state.js\n// module id = 1174\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-reader/state.js")},function(module,exports,__webpack_require__){eval("\nvar Source = __webpack_require__(204)\nvar pull = __webpack_require__(6)\n\nmodule.exports = function (compare) {\n\n  var source = Source()\n\n  var sink = pull.collect(function (err, ary) {\n    source.resolve(pull.values(ary.sort(compare)))\n  })\n\n  return function (read) {\n    sink(read)\n    return source\n  }\n\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-sort/index.js\n// module id = 1175\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-sort/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar reduce = __webpack_require__(302)\n\nmodule.exports = function collect (cb) {\n  return reduce(function (arr, item) {\n    arr.push(item)\n    return arr\n  }, [], cb)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/collect.js\n// module id = 1176\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/collect.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar reduce = __webpack_require__(302)\n\nmodule.exports = function concat (cb) {\n  return reduce(function (a, b) {\n    return a + b\n  }, '', cb)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/concat.js\n// module id = 1177\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/concat.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(154)\nvar drain = __webpack_require__(153)\n\nmodule.exports = function find (test, cb) {\n  var ended = false\n  if(!cb)\n    cb = test, test = id\n  else\n    test = prop(test) || id\n\n  return drain(function (data) {\n    if(test(data)) {\n      ended = true\n      cb(null, data)\n    return false\n    }\n  }, function (err) {\n    if(ended) return //already called back\n    cb(err === true ? null : err, null)\n  })\n}\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/find.js\n// module id = 1178\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/find.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  drain: __webpack_require__(153),\n  onEnd: __webpack_require__(1181),\n  log: __webpack_require__(1180),\n  find: __webpack_require__(1178),\n  reduce: __webpack_require__(302),\n  collect: __webpack_require__(1176),\n  concat: __webpack_require__(1177)\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/index.js\n// module id = 1179\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar drain = __webpack_require__(153)\n\nmodule.exports = function log (done) {\n  return drain(function (data) {\n    console.log(data)\n  }, done)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/log.js\n// module id = 1180\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/log.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar drain = __webpack_require__(153)\n\nmodule.exports = function onEnd (done) {\n  return drain(null, done)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sinks/on-end.js\n// module id = 1181\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sinks/on-end.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = function count (max) {\n  var i = 0; max = max || Infinity\n  return function (end, cb) {\n    if(end) return cb && cb(end)\n    if(i > max)\n      return cb(true)\n    cb(null, i++)\n  }\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/count.js\n// module id = 1182\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/count.js")},function(module,exports,__webpack_require__){"use strict";eval("\n//a stream that ends immediately.\nmodule.exports = function empty () {\n  return function (abort, cb) {\n    cb(true)\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/empty.js\n// module id = 1183\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/empty.js")},function(module,exports,__webpack_require__){"use strict";eval("\n//a stream that errors immediately.\nmodule.exports = function error (err) {\n  return function (abort, cb) {\n    cb(err)\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/error.js\n// module id = 1184\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/error.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = {\n  keys: __webpack_require__(1187),\n  once: __webpack_require__(519),\n  values: __webpack_require__(303),\n  count: __webpack_require__(1182),\n  infinite: __webpack_require__(1186),\n  empty: __webpack_require__(1183),\n  error: __webpack_require__(1184)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/index.js\n// module id = 1185\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = function infinite (generate) {\n  generate = generate || Math.random\n  return function (end, cb) {\n    if(end) return cb && cb(end)\n    return cb(null, generate())\n  }\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/infinite.js\n// module id = 1186\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/infinite.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar values = __webpack_require__(303)\nmodule.exports = function (object) {\n  return values(Object.keys(object))\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/sources/keys.js\n// module id = 1187\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/sources/keys.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(154)\n\nmodule.exports = function asyncMap (map) {\n  if(!map) return id\n  map = prop(map)\n  var busy = false, abortCb, aborted\n  return function (read) {\n    return function next (abort, cb) {\n      if(aborted) return cb(aborted)\n      if(abort) {\n        aborted = abort\n        if(!busy) read(abort, function (err) {\n          //incase the source has already ended normally,\n          //we should pass our own error.\n          cb(abort)\n        })\n        else read(abort, function (err) {\n          //if we are still busy, wait for the mapper to complete.\n          if(busy) abortCb = cb\n          else cb(abort)\n        })\n      }\n      else\n        read(null, function (end, data) {\n          if(end) cb(end)\n          else if(aborted) cb(aborted)\n          else {\n            busy = true\n            map(data, function (err, data) {\n              busy = false\n              if(aborted) {\n                cb(aborted)\n                abortCb(aborted)\n              }\n              else if(err) next (err, cb)\n              else cb(null, data)\n            })\n          }\n        })\n    }\n  }\n}\n\n\n\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/async-map.js\n// module id = 1188\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/async-map.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar tester = __webpack_require__(522)\nvar filter = __webpack_require__(304)\n\nmodule.exports = function filterNot (test) {\n  test = tester(test)\n  return filter(function (data) { return !test(data) })\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/filter-not.js\n// module id = 1189\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/filter-not.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar values = __webpack_require__(303)\nvar once = __webpack_require__(519)\n\n//convert a stream of arrays or streams into just a stream.\nmodule.exports = function flatten () {\n  return function (read) {\n    var _read\n    return function (abort, cb) {\n      if (abort) { //abort the current stream, and then stream of streams.\n        _read ? _read(abort, function(err) {\n          read(err || abort, cb)\n        }) : read(abort, cb)\n      }\n      else if(_read) nextChunk()\n      else nextStream()\n\n      function nextChunk () {\n        _read(null, function (err, data) {\n          if (err === true) nextStream()\n          else if (err) {\n            read(true, function(abortErr) {\n              // TODO: what do we do with the abortErr?\n              cb(err)\n            })\n          }\n          else cb(null, data)\n        })\n      }\n      function nextStream () {\n        _read = null\n        read(null, function (end, stream) {\n          if(end)\n            return cb(end)\n          if(Array.isArray(stream) || stream && 'object' === typeof stream)\n            stream = values(stream)\n          else if('function' != typeof stream)\n            stream = once(stream)\n          _read = stream\n          nextChunk()\n        })\n      }\n    }\n  }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/flatten.js\n// module id = 1190\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/flatten.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  map: __webpack_require__(1192),\n  asyncMap: __webpack_require__(1188),\n  filter: __webpack_require__(304),\n  filterNot: __webpack_require__(1189),\n  through: __webpack_require__(1195),\n  take: __webpack_require__(1194),\n  unique: __webpack_require__(520),\n  nonUnique: __webpack_require__(1193),\n  flatten: __webpack_require__(1190)\n}\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/index.js\n// module id = 1191\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction id (e) { return e }\nvar prop = __webpack_require__(154)\n\nmodule.exports = function map (mapper) {\n  if(!mapper) return id\n  mapper = prop(mapper)\n  return function (read) {\n    return function (abort, cb) {\n      read(abort, function (end, data) {\n        try {\n        data = !end ? mapper(data) : null\n        } catch (err) {\n          return read(err, function () {\n            return cb(err)\n          })\n        }\n        cb(end, data)\n      })\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/map.js\n// module id = 1192\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/map.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar unique = __webpack_require__(520)\n\n//passes an item through when you see it for the second time.\nmodule.exports = function nonUnique (field) {\n  return unique(field, true)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/non-unique.js\n// module id = 1193\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/non-unique.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//read a number of items and then stop.\nmodule.exports = function take (test, opts) {\n  opts = opts || {}\n  var last = opts.last || false // whether the first item for which !test(item) should still pass\n  var ended = false\n  if('number' === typeof test) {\n    last = true\n    var n = test; test = function () {\n      return --n\n    }\n  }\n\n  return function (read) {\n\n    function terminate (cb) {\n      read(true, function (err) {\n        last = false; cb(err || true)\n      })\n    }\n\n    return function (end, cb) {\n      if(ended && !end) last ? terminate(cb) : cb(ended)\n      else if(ended = end) read(ended, cb)\n      else\n        read(null, function (end, data) {\n          if(ended = ended || end) {\n            //last ? terminate(cb) :\n            cb(ended)\n          }\n          else if(!test(data)) {\n            ended = true\n            last ? cb(null, data) : terminate(cb)\n          }\n          else\n            cb(null, data)\n        })\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/take.js\n// module id = 1194\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/take.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//a pass through stream that doesn't change the value.\nmodule.exports = function through (op, onEnd) {\n  var a = false\n\n  function once (abort) {\n    if(a || !onEnd) return\n    a = true\n    onEnd(abort === true ? null : abort)\n  }\n\n  return function (read) {\n    return function (end, cb) {\n      if(end) once(end)\n      return read(end, function (end, data) {\n        if(!end) op && op(data)\n        else once(end)\n        cb(end, data)\n      })\n    }\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-stream/throughs/through.js\n// module id = 1195\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-stream/throughs/through.js")},function(module,exports){eval("\n\nmodule.exports = function (fn) {\n  var active = false, called = 0\n  return function () {\n    called = true\n    if(!active) {\n      active = true\n      while(called) {\n        called = false\n        fn()\n      }\n      active = false\n    }\n  }\n}\n\n\n\n\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-write/~/looper/index.js\n// module id = 1196\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-write/node_modules/looper/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n//load websocket library if we are not in the browser\nvar WebSocket = __webpack_require__(1202)\nvar duplex = __webpack_require__(1198)\nvar wsurl = __webpack_require__(1203)\n\nfunction isFunction (f) {\n  return 'function' === typeof f\n}\n\nmodule.exports = function (addr, opts) {\n  if (isFunction(opts)) opts = {onConnect: opts}\n\n  var location = typeof window === 'undefined' ? {} : window.location\n\n  var url = wsurl(addr, location)\n  var socket = new WebSocket(url)\n\n  var stream = duplex(socket, opts)\n  stream.remoteAddress = url\n  stream.close = function (cb) {\n    if (isFunction(cb)) {\n      socket.addEventListener('close', cb)\n    }\n    socket.close()\n  }\n\n  socket.addEventListener('open', function (e) {\n    if (opts && isFunction(opts.onConnect)) {\n      opts.onConnect(null, stream)\n    }\n  })\n\n  return stream\n}\n\nmodule.exports.connect = module.exports\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/client.js\n// module id = 1197\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/client.js")},function(module,exports,__webpack_require__){eval("var source = __webpack_require__(1201)\nvar sink = __webpack_require__(1200)\n\nmodule.exports = duplex\n\nfunction duplex (ws, opts) {\n  var req = ws.upgradeReq || {}\n  if(opts && opts.binaryType)\n    ws.binaryType = opts.binaryType\n  else if(opts && opts.binary)\n    ws.binaryType = 'arraybuffer'\n  return {\n    source: source(ws, opts && opts.onConnect),\n    sink: sink(ws, opts),\n\n    //http properties - useful for routing or auth.\n    headers: req.headers,\n    url: req.url,\n    upgrade: req.upgrade,\n    method: req.method\n  };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/duplex.js\n// module id = 1198\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/duplex.js")},function(module,exports){eval("module.exports = function(socket, callback) {\n  var remove = socket && (socket.removeEventListener || socket.removeListener);\n\n  function cleanup () {\n    if (typeof remove == 'function') {\n      remove.call(socket, 'open', handleOpen);\n      remove.call(socket, 'error', handleErr);\n    }\n  }\n\n  function handleOpen(evt) {\n    cleanup(); callback();\n  }\n\n  function handleErr (evt) {\n    cleanup(); callback(evt);\n  }\n\n  // if the socket is closing or closed, return end\n  if (socket.readyState >= 2) {\n    return callback(true);\n  }\n\n  // if open, trigger the callback\n  if (socket.readyState === 1) {\n    return callback();\n  }\n\n  socket.addEventListener('open', handleOpen);\n  socket.addEventListener('error', handleErr);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/ready.js\n// module id = 1199\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/ready.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(setImmediate, process) {var ready = __webpack_require__(1199);\n\n/**\n  ### `sink(socket, opts?)`\n\n  Create a pull-stream `Sink` that will write data to the `socket`.\n\n  <<< examples/write.js\n\n**/\n\nvar nextTick = typeof setImmediate !== 'undefined' ? setImmediate : process.nextTick\n\nmodule.exports = function(socket, opts) {\n  return function (read) {\n    opts = opts || {}\n    var closeOnEnd = opts.closeOnEnd !== false;\n    var onClose = 'function' === typeof opts ? opts : opts.onClose;\n\n    function next(end, data) {\n      // if the stream has ended, simply return\n      if (end) {\n        if (closeOnEnd && socket.readyState <= 1) {\n          if(onClose)\n            socket.addEventListener('close', function (ev) {\n              if(ev.wasClean || ev.code === 1006) onClose()\n              else {\n                var err = new Error('ws error')\n                err.event = ev\n                onClose(err)\n              }\n            });\n\n          socket.close()\n        }\n\n        return;\n      }\n\n      // socket ready?\n      ready(socket, function(end) {\n        if (end) {\n          return read(end, function () {});\n        }\n        socket.send(data);\n        nextTick(function() {\n          read(null, next);\n        });\n      });\n    }\n\n    read(null, next);\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25).setImmediate, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/sink.js\n// module id = 1200\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/sink.js")},function(module,exports,__webpack_require__){eval("/**\n  ### `source(socket)`\n\n  Create a pull-stream `Source` that will read data from the `socket`.\n\n  <<< examples/read.js\n\n**/\nvar Buffer = __webpack_require__(1).Buffer;\n\n// copied from github.com/feross/buffer\n// Some ArrayBuffers are not passing the instanceof check, so we need to do a bit more work :(\nfunction isArrayBuffer (obj) {\n  return obj instanceof ArrayBuffer ||\n    (obj != null && obj.constructor != null && obj.constructor.name === 'ArrayBuffer' &&\n      typeof obj.byteLength === 'number')\n}\n\nmodule.exports = function(socket, cb) {\n  var buffer = [];\n  var receiver;\n  var ended;\n  var started = false;\n  socket.addEventListener('message', function(evt) {\n    var data = evt.data;\n    if (isArrayBuffer(data)) {\n      data = Buffer.from(data);\n    }\n\n    if (receiver) {\n      return receiver(null, data);\n    }\n\n    buffer.push(data);\n  });\n\n  socket.addEventListener('close', function(evt) {\n    if (ended) return\n    if (receiver) {\n      receiver(ended = true)\n    }\n  });\n\n  socket.addEventListener('error', function (evt) {\n    if (ended) return;\n    ended = evt;\n    if(!started) {\n      started = true\n      cb && cb(evt)\n    }\n    if (receiver) {\n      receiver(ended)\n    }\n  });\n\n  socket.addEventListener('open', function (evt) {\n    if(started || ended) return\n    started = true\n  })\n\n  function read(abort, cb) {\n    receiver = null;\n\n    //if stream has already ended.\n    if (ended)\n      return cb(ended);\n\n    // if ended, abort\n    else if (abort) {\n      //this will callback when socket closes\n      receiver = cb\n      socket.close()\n    }\n\n    // return data, if any\n    else if(buffer.length > 0)\n      cb(null, buffer.shift());\n\n    // wait for more data (or end)\n    else\n      receiver = cb;\n\n  };\n\n  return read;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/source.js\n// module id = 1201\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/source.js")},function(module,exports,__webpack_require__){eval("\nmodule.exports = 'undefined' === typeof WebSocket ? __webpack_require__(1356) : WebSocket\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/web-socket.js\n// module id = 1202\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/web-socket.js")},function(module,exports,__webpack_require__){eval("var rurl = __webpack_require__(1219)\nvar map = {http:'ws', https:'wss'}\nvar def = 'ws'\nmodule.exports = function (url, location) {\n  return rurl(url, location, map, def)\n}\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/pull-ws/ws-url.js\n// module id = 1203\n// module chunks = 0\n\n//# sourceURL=../node_modules/pull-ws/ws-url.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar strictUriEncode = __webpack_require__(1244);\nvar objectAssign = __webpack_require__(295);\nvar decodeComponent = __webpack_require__(801);\n\nfunction encoderForArrayFormat(opts) {\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, index) {\n\t\t\t\treturn value === null ? [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tindex,\n\t\t\t\t\t']'\n\t\t\t\t].join('') : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[',\n\t\t\t\t\tencode(index, opts),\n\t\t\t\t\t']=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'[]=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value) {\n\t\t\t\treturn value === null ? encode(key, opts) : [\n\t\t\t\t\tencode(key, opts),\n\t\t\t\t\t'=',\n\t\t\t\t\tencode(value, opts)\n\t\t\t\t].join('');\n\t\t\t};\n\t}\n}\n\nfunction parserForArrayFormat(opts) {\n\tvar result;\n\n\tswitch (opts.arrayFormat) {\n\t\tcase 'index':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /\\[(\\d*)\\]$/.exec(key);\n\n\t\t\t\tkey = key.replace(/\\[\\d*\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = {};\n\t\t\t\t}\n\n\t\t\t\taccumulator[key][result[1]] = value;\n\t\t\t};\n\n\t\tcase 'bracket':\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tresult = /(\\[\\])$/.exec(key);\n\t\t\t\tkey = key.replace(/\\[\\]$/, '');\n\n\t\t\t\tif (!result) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t} else if (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = [value];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\n\t\tdefault:\n\t\t\treturn function (key, value, accumulator) {\n\t\t\t\tif (accumulator[key] === undefined) {\n\t\t\t\t\taccumulator[key] = value;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\taccumulator[key] = [].concat(accumulator[key], value);\n\t\t\t};\n\t}\n}\n\nfunction encode(value, opts) {\n\tif (opts.encode) {\n\t\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\n\t}\n\n\treturn value;\n}\n\nfunction keysSorter(input) {\n\tif (Array.isArray(input)) {\n\t\treturn input.sort();\n\t} else if (typeof input === 'object') {\n\t\treturn keysSorter(Object.keys(input)).sort(function (a, b) {\n\t\t\treturn Number(a) - Number(b);\n\t\t}).map(function (key) {\n\t\t\treturn input[key];\n\t\t});\n\t}\n\n\treturn input;\n}\n\nfunction extract(str) {\n\tvar queryStart = str.indexOf('?');\n\tif (queryStart === -1) {\n\t\treturn '';\n\t}\n\treturn str.slice(queryStart + 1);\n}\n\nfunction parse(str, opts) {\n\topts = objectAssign({arrayFormat: 'none'}, opts);\n\n\tvar formatter = parserForArrayFormat(opts);\n\n\t// Create an object with no prototype\n\t// https://github.com/sindresorhus/query-string/issues/47\n\tvar ret = Object.create(null);\n\n\tif (typeof str !== 'string') {\n\t\treturn ret;\n\t}\n\n\tstr = str.trim().replace(/^[?#&]/, '');\n\n\tif (!str) {\n\t\treturn ret;\n\t}\n\n\tstr.split('&').forEach(function (param) {\n\t\tvar parts = param.replace(/\\+/g, ' ').split('=');\n\t\t// Firefox (pre 40) decodes `%3D` to `=`\n\t\t// https://github.com/sindresorhus/query-string/pull/37\n\t\tvar key = parts.shift();\n\t\tvar val = parts.length > 0 ? parts.join('=') : undefined;\n\n\t\t// missing `=` should be `null`:\n\t\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\n\t\tval = val === undefined ? null : decodeComponent(val);\n\n\t\tformatter(decodeComponent(key), val, ret);\n\t});\n\n\treturn Object.keys(ret).sort().reduce(function (result, key) {\n\t\tvar val = ret[key];\n\t\tif (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {\n\t\t\t// Sort object keys, not values\n\t\t\tresult[key] = keysSorter(val);\n\t\t} else {\n\t\t\tresult[key] = val;\n\t\t}\n\n\t\treturn result;\n\t}, Object.create(null));\n}\n\nexports.extract = extract;\nexports.parse = parse;\n\nexports.stringify = function (obj, opts) {\n\tvar defaults = {\n\t\tencode: true,\n\t\tstrict: true,\n\t\tarrayFormat: 'none'\n\t};\n\n\topts = objectAssign(defaults, opts);\n\n\tif (opts.sort === false) {\n\t\topts.sort = function () {};\n\t}\n\n\tvar formatter = encoderForArrayFormat(opts);\n\n\treturn obj ? Object.keys(obj).sort(opts.sort).map(function (key) {\n\t\tvar val = obj[key];\n\n\t\tif (val === undefined) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (val === null) {\n\t\t\treturn encode(key, opts);\n\t\t}\n\n\t\tif (Array.isArray(val)) {\n\t\t\tvar result = [];\n\n\t\t\tval.slice().forEach(function (val2) {\n\t\t\t\tif (val2 === undefined) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresult.push(formatter(key, val2, result.length));\n\t\t\t});\n\n\t\t\treturn result.join('&');\n\t\t}\n\n\t\treturn encode(key, opts) + '=' + encode(val, opts);\n\t}).filter(function (x) {\n\t\treturn x.length > 0;\n\t}).join('&') : '';\n};\n\nexports.parseUrl = function (str, opts) {\n\treturn {\n\t\turl: str.split('?')[0] || '',\n\t\tquery: parse(extract(str), opts)\n\t};\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/query-string/index.js\n// module id = 1204\n// module chunks = 0\n\n//# sourceURL=../node_modules/query-string/index.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\n// If obj.hasOwnProperty has been overridden, then calling\n// obj.hasOwnProperty(prop) will break.\n// See: https://github.com/joyent/node/issues/1707\nfunction hasOwnProperty(obj, prop) {\n  return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\nmodule.exports = function(qs, sep, eq, options) {\n  sep = sep || '&';\n  eq = eq || '=';\n  var obj = {};\n\n  if (typeof qs !== 'string' || qs.length === 0) {\n    return obj;\n  }\n\n  var regexp = /\\+/g;\n  qs = qs.split(sep);\n\n  var maxKeys = 1000;\n  if (options && typeof options.maxKeys === 'number') {\n    maxKeys = options.maxKeys;\n  }\n\n  var len = qs.length;\n  // maxKeys <= 0 means that we should not limit keys count\n  if (maxKeys > 0 && len > maxKeys) {\n    len = maxKeys;\n  }\n\n  for (var i = 0; i < len; ++i) {\n    var x = qs[i].replace(regexp, '%20'),\n        idx = x.indexOf(eq),\n        kstr, vstr, k, v;\n\n    if (idx >= 0) {\n      kstr = x.substr(0, idx);\n      vstr = x.substr(idx + 1);\n    } else {\n      kstr = x;\n      vstr = '';\n    }\n\n    k = decodeURIComponent(kstr);\n    v = decodeURIComponent(vstr);\n\n    if (!hasOwnProperty(obj, k)) {\n      obj[k] = v;\n    } else if (isArray(obj[k])) {\n      obj[k].push(v);\n    } else {\n      obj[k] = [obj[k], v];\n    }\n  }\n\n  return obj;\n};\n\nvar isArray = Array.isArray || function (xs) {\n  return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/decode.js\n// module id = 1205\n// module chunks = 0\n\n//# sourceURL=../node_modules/querystring-es3/decode.js")},function(module,exports,__webpack_require__){"use strict";eval("// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n\nvar stringifyPrimitive = function(v) {\n  switch (typeof v) {\n    case 'string':\n      return v;\n\n    case 'boolean':\n      return v ? 'true' : 'false';\n\n    case 'number':\n      return isFinite(v) ? v : '';\n\n    default:\n      return '';\n  }\n};\n\nmodule.exports = function(obj, sep, eq, name) {\n  sep = sep || '&';\n  eq = eq || '=';\n  if (obj === null) {\n    obj = undefined;\n  }\n\n  if (typeof obj === 'object') {\n    return map(objectKeys(obj), function(k) {\n      var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\n      if (isArray(obj[k])) {\n        return map(obj[k], function(v) {\n          return ks + encodeURIComponent(stringifyPrimitive(v));\n        }).join(sep);\n      } else {\n        return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\n      }\n    }).join(sep);\n\n  }\n\n  if (!name) return '';\n  return encodeURIComponent(stringifyPrimitive(name)) + eq +\n         encodeURIComponent(stringifyPrimitive(obj));\n};\n\nvar isArray = Array.isArray || function (xs) {\n  return Object.prototype.toString.call(xs) === '[object Array]';\n};\n\nfunction map (xs, f) {\n  if (xs.map) return xs.map(f);\n  var res = [];\n  for (var i = 0; i < xs.length; i++) {\n    res.push(f(xs[i], i));\n  }\n  return res;\n}\n\nvar objectKeys = Object.keys || function (obj) {\n  var res = [];\n  for (var key in obj) {\n    if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key);\n  }\n  return res;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/encode.js\n// module id = 1206\n// module chunks = 0\n\n//# sourceURL=../node_modules/querystring-es3/encode.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.decode = exports.parse = __webpack_require__(1205);\nexports.encode = exports.stringify = __webpack_require__(1206);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/querystring-es3/index.js\n// module id = 1207\n// module chunks = 0\n\n//# sourceURL=../node_modules/querystring-es3/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, process) {\n\nfunction oldBrowser () {\n  throw new Error('secure random number generation not supported by this browser\\nuse chrome, FireFox or Internet Explorer 11')\n}\nvar safeBuffer = __webpack_require__(1)\nvar randombytes = __webpack_require__(80)\nvar Buffer = safeBuffer.Buffer\nvar kBufferMaxLength = safeBuffer.kMaxLength\nvar crypto = global.crypto || global.msCrypto\nvar kMaxUint32 = Math.pow(2, 32) - 1\nfunction assertOffset (offset, length) {\n  if (typeof offset !== 'number' || offset !== offset) { // eslint-disable-line no-self-compare\n    throw new TypeError('offset must be a number')\n  }\n\n  if (offset > kMaxUint32 || offset < 0) {\n    throw new TypeError('offset must be a uint32')\n  }\n\n  if (offset > kBufferMaxLength || offset > length) {\n    throw new RangeError('offset out of range')\n  }\n}\n\nfunction assertSize (size, offset, length) {\n  if (typeof size !== 'number' || size !== size) { // eslint-disable-line no-self-compare\n    throw new TypeError('size must be a number')\n  }\n\n  if (size > kMaxUint32 || size < 0) {\n    throw new TypeError('size must be a uint32')\n  }\n\n  if (size + offset > length || size > kBufferMaxLength) {\n    throw new RangeError('buffer too small')\n  }\n}\nif ((crypto && crypto.getRandomValues) || !process.browser) {\n  exports.randomFill = randomFill\n  exports.randomFillSync = randomFillSync\n} else {\n  exports.randomFill = oldBrowser\n  exports.randomFillSync = oldBrowser\n}\nfunction randomFill (buf, offset, size, cb) {\n  if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n    throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n  }\n\n  if (typeof offset === 'function') {\n    cb = offset\n    offset = 0\n    size = buf.length\n  } else if (typeof size === 'function') {\n    cb = size\n    size = buf.length - offset\n  } else if (typeof cb !== 'function') {\n    throw new TypeError('\"cb\" argument must be a function')\n  }\n  assertOffset(offset, buf.length)\n  assertSize(size, offset, buf.length)\n  return actualFill(buf, offset, size, cb)\n}\n\nfunction actualFill (buf, offset, size, cb) {\n  if (process.browser) {\n    var ourBuf = buf.buffer\n    var uint = new Uint8Array(ourBuf, offset, size)\n    crypto.getRandomValues(uint)\n    if (cb) {\n      process.nextTick(function () {\n        cb(null, buf)\n      })\n      return\n    }\n    return buf\n  }\n  if (cb) {\n    randombytes(size, function (err, bytes) {\n      if (err) {\n        return cb(err)\n      }\n      bytes.copy(buf, offset)\n      cb(null, buf)\n    })\n    return\n  }\n  var bytes = randombytes(size)\n  bytes.copy(buf, offset)\n  return buf\n}\nfunction randomFillSync (buf, offset, size) {\n  if (typeof offset === 'undefined') {\n    offset = 0\n  }\n  if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\n    throw new TypeError('\"buf\" argument must be a Buffer or Uint8Array')\n  }\n\n  assertOffset(offset, buf.length)\n\n  if (size === undefined) size = buf.length - offset\n\n  assertSize(size, offset, buf.length)\n\n  return actualFill(buf, offset, size)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/randomfill/browser.js\n// module id = 1208\n// module chunks = 0\n\n//# sourceURL=../node_modules/randomfill/browser.js")},function(module,exports){eval("module.exports = window.crypto;\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/randomhex/src/browser.js\n// module id = 1209\n// module chunks = 0\n\n//# sourceURL=../node_modules/randomhex/src/browser.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1209);\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/randomhex/src/crypto.js\n// module id = 1210\n// module chunks = 0\n\n//# sourceURL=../node_modules/randomhex/src/crypto.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(103);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/duplex-browser.js\n// module id = 1211\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/duplex-browser.js")},function(module,exports,__webpack_require__){"use strict";eval('// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// "Software"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// a passthrough stream.\n// basically just the most minimal sort of Transform stream.\n// Every written chunk gets output as-is.\n\n\n\nmodule.exports = PassThrough;\n\nvar Transform = __webpack_require__(527);\n\n/*<replacement>*/\nvar util = __webpack_require__(58);\nutil.inherits = __webpack_require__(3);\n/*</replacement>*/\n\nutil.inherits(PassThrough, Transform);\n\nfunction PassThrough(options) {\n  if (!(this instanceof PassThrough)) return new PassThrough(options);\n\n  Transform.call(this, options);\n}\n\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\n  cb(null, chunk);\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/_stream_passthrough.js\n// module id = 1212\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/_stream_passthrough.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Buffer = __webpack_require__(1).Buffer;\nvar util = __webpack_require__(1358);\n\nfunction copyBuffer(src, target, offset) {\n  src.copy(target, offset);\n}\n\nmodule.exports = function () {\n  function BufferList() {\n    _classCallCheck(this, BufferList);\n\n    this.head = null;\n    this.tail = null;\n    this.length = 0;\n  }\n\n  BufferList.prototype.push = function push(v) {\n    var entry = { data: v, next: null };\n    if (this.length > 0) this.tail.next = entry;else this.head = entry;\n    this.tail = entry;\n    ++this.length;\n  };\n\n  BufferList.prototype.unshift = function unshift(v) {\n    var entry = { data: v, next: this.head };\n    if (this.length === 0) this.tail = entry;\n    this.head = entry;\n    ++this.length;\n  };\n\n  BufferList.prototype.shift = function shift() {\n    if (this.length === 0) return;\n    var ret = this.head.data;\n    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\n    --this.length;\n    return ret;\n  };\n\n  BufferList.prototype.clear = function clear() {\n    this.head = this.tail = null;\n    this.length = 0;\n  };\n\n  BufferList.prototype.join = function join(s) {\n    if (this.length === 0) return '';\n    var p = this.head;\n    var ret = '' + p.data;\n    while (p = p.next) {\n      ret += s + p.data;\n    }return ret;\n  };\n\n  BufferList.prototype.concat = function concat(n) {\n    if (this.length === 0) return Buffer.alloc(0);\n    if (this.length === 1) return this.head.data;\n    var ret = Buffer.allocUnsafe(n >>> 0);\n    var p = this.head;\n    var i = 0;\n    while (p) {\n      copyBuffer(p.data, ret, i);\n      i += p.data.length;\n      p = p.next;\n    }\n    return ret;\n  };\n\n  return BufferList;\n}();\n\nif (util && util.inspect && util.inspect.custom) {\n  module.exports.prototype[util.inspect.custom] = function () {\n    var obj = util.inspect({ length: this.length });\n    return this.constructor.name + ' ' + obj;\n  };\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/lib/internal/streams/BufferList.js\n// module id = 1213\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/BufferList.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(81).PassThrough\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/passthrough.js\n// module id = 1214\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/passthrough.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(81).Transform\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/transform.js\n// module id = 1215\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/transform.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(305);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/readable-stream/writable-browser.js\n// module id = 1216\n// module chunks = 0\n\n//# sourceURL=../node_modules/readable-stream/writable-browser.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g =\n  typeof global === "object" ? global :\n  typeof window === "object" ? window :\n  typeof self === "object" ? self : this;\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n  Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = __webpack_require__(1218);\n\nif (hadRuntime) {\n  // Restore the original runtime.\n  g.regeneratorRuntime = oldRuntime;\n} else {\n  // Remove the global property added by runtime.js.\n  try {\n    delete g.regeneratorRuntime;\n  } catch(e) {\n    g.regeneratorRuntime = undefined;\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/regenerator-runtime/runtime-module.js\n// module id = 1217\n// module chunks = 0\n\n//# sourceURL=../node_modules/regenerator-runtime/runtime-module.js')},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n  "use strict";\n\n  var Op = Object.prototype;\n  var hasOwn = Op.hasOwnProperty;\n  var undefined; // More compressible than void 0.\n  var $Symbol = typeof Symbol === "function" ? Symbol : {};\n  var iteratorSymbol = $Symbol.iterator || "@@iterator";\n  var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";\n  var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";\n\n  var inModule = typeof module === "object";\n  var runtime = global.regeneratorRuntime;\n  if (runtime) {\n    if (inModule) {\n      // If regeneratorRuntime is defined globally and we\'re in a module,\n      // make the exports object identical to regeneratorRuntime.\n      module.exports = runtime;\n    }\n    // Don\'t bother evaluating the rest of this file if the runtime was\n    // already defined globally.\n    return;\n  }\n\n  // Define the runtime globally (as expected by generated code) as either\n  // module.exports (if we\'re in a module) or a new, empty object.\n  runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n  function wrap(innerFn, outerFn, self, tryLocsList) {\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n    var generator = Object.create(protoGenerator.prototype);\n    var context = new Context(tryLocsList || []);\n\n    // The ._invoke method unifies the implementations of the .next,\n    // .throw, and .return methods.\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n    return generator;\n  }\n  runtime.wrap = wrap;\n\n  // Try/catch helper to minimize deoptimizations. Returns a completion\n  // record like context.tryEntries[i].completion. This interface could\n  // have been (and was previously) designed to take a closure to be\n  // invoked without arguments, but in all the cases we care about we\n  // already have an existing method we want to call, so there\'s no need\n  // to create a new function object. We can even get away with assuming\n  // the method takes exactly one argument, since that happens to be true\n  // in every case, so we don\'t have to touch the arguments object. The\n  // only additional allocation required is the completion record, which\n  // has a stable shape and so hopefully should be cheap to allocate.\n  function tryCatch(fn, obj, arg) {\n    try {\n      return { type: "normal", arg: fn.call(obj, arg) };\n    } catch (err) {\n      return { type: "throw", arg: err };\n    }\n  }\n\n  var GenStateSuspendedStart = "suspendedStart";\n  var GenStateSuspendedYield = "suspendedYield";\n  var GenStateExecuting = "executing";\n  var GenStateCompleted = "completed";\n\n  // Returning this object from the innerFn has the same effect as\n  // breaking out of the dispatch switch statement.\n  var ContinueSentinel = {};\n\n  // Dummy constructor functions that we use as the .constructor and\n  // .constructor.prototype properties for functions that return Generator\n  // objects. For full spec compliance, you may wish to configure your\n  // minifier not to mangle the names of these two functions.\n  function Generator() {}\n  function GeneratorFunction() {}\n  function GeneratorFunctionPrototype() {}\n\n  // This is a polyfill for %IteratorPrototype% for environments that\n  // don\'t natively support it.\n  var IteratorPrototype = {};\n  IteratorPrototype[iteratorSymbol] = function () {\n    return this;\n  };\n\n  var getProto = Object.getPrototypeOf;\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n  if (NativeIteratorPrototype &&\n      NativeIteratorPrototype !== Op &&\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n    // This environment has a native %IteratorPrototype%; use it instead\n    // of the polyfill.\n    IteratorPrototype = NativeIteratorPrototype;\n  }\n\n  var Gp = GeneratorFunctionPrototype.prototype =\n    Generator.prototype = Object.create(IteratorPrototype);\n  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n  GeneratorFunctionPrototype.constructor = GeneratorFunction;\n  GeneratorFunctionPrototype[toStringTagSymbol] =\n    GeneratorFunction.displayName = "GeneratorFunction";\n\n  // Helper for defining the .next, .throw, and .return methods of the\n  // Iterator interface in terms of a single ._invoke method.\n  function defineIteratorMethods(prototype) {\n    ["next", "throw", "return"].forEach(function(method) {\n      prototype[method] = function(arg) {\n        return this._invoke(method, arg);\n      };\n    });\n  }\n\n  runtime.isGeneratorFunction = function(genFun) {\n    var ctor = typeof genFun === "function" && genFun.constructor;\n    return ctor\n      ? ctor === GeneratorFunction ||\n        // For the native GeneratorFunction constructor, the best we can\n        // do is to check its .name property.\n        (ctor.displayName || ctor.name) === "GeneratorFunction"\n      : false;\n  };\n\n  runtime.mark = function(genFun) {\n    if (Object.setPrototypeOf) {\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n    } else {\n      genFun.__proto__ = GeneratorFunctionPrototype;\n      if (!(toStringTagSymbol in genFun)) {\n        genFun[toStringTagSymbol] = "GeneratorFunction";\n      }\n    }\n    genFun.prototype = Object.create(Gp);\n    return genFun;\n  };\n\n  // Within the body of any async function, `await x` is transformed to\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n  // `hasOwn.call(value, "__await")` to determine if the yielded value is\n  // meant to be awaited.\n  runtime.awrap = function(arg) {\n    return { __await: arg };\n  };\n\n  function AsyncIterator(generator) {\n    function invoke(method, arg, resolve, reject) {\n      var record = tryCatch(generator[method], generator, arg);\n      if (record.type === "throw") {\n        reject(record.arg);\n      } else {\n        var result = record.arg;\n        var value = result.value;\n        if (value &&\n            typeof value === "object" &&\n            hasOwn.call(value, "__await")) {\n          return Promise.resolve(value.__await).then(function(value) {\n            invoke("next", value, resolve, reject);\n          }, function(err) {\n            invoke("throw", err, resolve, reject);\n          });\n        }\n\n        return Promise.resolve(value).then(function(unwrapped) {\n          // When a yielded Promise is resolved, its final value becomes\n          // the .value of the Promise<{value,done}> result for the\n          // current iteration. If the Promise is rejected, however, the\n          // result for this iteration will be rejected with the same\n          // reason. Note that rejections of yielded Promises are not\n          // thrown back into the generator function, as is the case\n          // when an awaited Promise is rejected. This difference in\n          // behavior between yield and await is important, because it\n          // allows the consumer to decide what to do with the yielded\n          // rejection (swallow it and continue, manually .throw it back\n          // into the generator, abandon iteration, whatever). With\n          // await, by contrast, there is no opportunity to examine the\n          // rejection reason outside the generator function, so the\n          // only option is to throw it from the await expression, and\n          // let the generator function handle the exception.\n          result.value = unwrapped;\n          resolve(result);\n        }, reject);\n      }\n    }\n\n    if (typeof global.process === "object" && global.process.domain) {\n      invoke = global.process.domain.bind(invoke);\n    }\n\n    var previousPromise;\n\n    function enqueue(method, arg) {\n      function callInvokeWithMethodAndArg() {\n        return new Promise(function(resolve, reject) {\n          invoke(method, arg, resolve, reject);\n        });\n      }\n\n      return previousPromise =\n        // If enqueue has been called before, then we want to wait until\n        // all previous Promises have been resolved before calling invoke,\n        // so that results are always delivered in the correct order. If\n        // enqueue has not been called before, then it is important to\n        // call invoke immediately, without waiting on a callback to fire,\n        // so that the async generator function has the opportunity to do\n        // any necessary setup in a predictable way. This predictability\n        // is why the Promise constructor synchronously invokes its\n        // executor callback, and why async functions synchronously\n        // execute code before the first await. Since we implement simple\n        // async functions in terms of async generators, it is especially\n        // important to get this right, even though it requires care.\n        previousPromise ? previousPromise.then(\n          callInvokeWithMethodAndArg,\n          // Avoid propagating failures to Promises returned by later\n          // invocations of the iterator.\n          callInvokeWithMethodAndArg\n        ) : callInvokeWithMethodAndArg();\n    }\n\n    // Define the unified helper method that is used to implement .next,\n    // .throw, and .return (see defineIteratorMethods).\n    this._invoke = enqueue;\n  }\n\n  defineIteratorMethods(AsyncIterator.prototype);\n  AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n    return this;\n  };\n  runtime.AsyncIterator = AsyncIterator;\n\n  // Note that simple async functions are implemented on top of\n  // AsyncIterator objects; they just return a Promise for the value of\n  // the final result produced by the iterator.\n  runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n    var iter = new AsyncIterator(\n      wrap(innerFn, outerFn, self, tryLocsList)\n    );\n\n    return runtime.isGeneratorFunction(outerFn)\n      ? iter // If outerFn is a generator, return the full iterator.\n      : iter.next().then(function(result) {\n          return result.done ? result.value : iter.next();\n        });\n  };\n\n  function makeInvokeMethod(innerFn, self, context) {\n    var state = GenStateSuspendedStart;\n\n    return function invoke(method, arg) {\n      if (state === GenStateExecuting) {\n        throw new Error("Generator is already running");\n      }\n\n      if (state === GenStateCompleted) {\n        if (method === "throw") {\n          throw arg;\n        }\n\n        // Be forgiving, per 25.3.3.3.3 of the spec:\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n        return doneResult();\n      }\n\n      context.method = method;\n      context.arg = arg;\n\n      while (true) {\n        var delegate = context.delegate;\n        if (delegate) {\n          var delegateResult = maybeInvokeDelegate(delegate, context);\n          if (delegateResult) {\n            if (delegateResult === ContinueSentinel) continue;\n            return delegateResult;\n          }\n        }\n\n        if (context.method === "next") {\n          // Setting context._sent for legacy support of Babel\'s\n          // function.sent implementation.\n          context.sent = context._sent = context.arg;\n\n        } else if (context.method === "throw") {\n          if (state === GenStateSuspendedStart) {\n            state = GenStateCompleted;\n            throw context.arg;\n          }\n\n          context.dispatchException(context.arg);\n\n        } else if (context.method === "return") {\n          context.abrupt("return", context.arg);\n        }\n\n        state = GenStateExecuting;\n\n        var record = tryCatch(innerFn, self, context);\n        if (record.type === "normal") {\n          // If an exception is thrown from innerFn, we leave state ===\n          // GenStateExecuting and loop back for another invocation.\n          state = context.done\n            ? GenStateCompleted\n            : GenStateSuspendedYield;\n\n          if (record.arg === ContinueSentinel) {\n            continue;\n          }\n\n          return {\n            value: record.arg,\n            done: context.done\n          };\n\n        } else if (record.type === "throw") {\n          state = GenStateCompleted;\n          // Dispatch the exception by looping back around to the\n          // context.dispatchException(context.arg) call above.\n          context.method = "throw";\n          context.arg = record.arg;\n        }\n      }\n    };\n  }\n\n  // Call delegate.iterator[context.method](context.arg) and handle the\n  // result, either by returning a { value, done } result from the\n  // delegate iterator, or by modifying context.method and context.arg,\n  // setting context.delegate to null, and returning the ContinueSentinel.\n  function maybeInvokeDelegate(delegate, context) {\n    var method = delegate.iterator[context.method];\n    if (method === undefined) {\n      // A .throw or .return when the delegate iterator has no .throw\n      // method always terminates the yield* loop.\n      context.delegate = null;\n\n      if (context.method === "throw") {\n        if (delegate.iterator.return) {\n          // If the delegate iterator has a return method, give it a\n          // chance to clean up.\n          context.method = "return";\n          context.arg = undefined;\n          maybeInvokeDelegate(delegate, context);\n\n          if (context.method === "throw") {\n            // If maybeInvokeDelegate(context) changed context.method from\n            // "return" to "throw", let that override the TypeError below.\n            return ContinueSentinel;\n          }\n        }\n\n        context.method = "throw";\n        context.arg = new TypeError(\n          "The iterator does not provide a \'throw\' method");\n      }\n\n      return ContinueSentinel;\n    }\n\n    var record = tryCatch(method, delegate.iterator, context.arg);\n\n    if (record.type === "throw") {\n      context.method = "throw";\n      context.arg = record.arg;\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    var info = record.arg;\n\n    if (! info) {\n      context.method = "throw";\n      context.arg = new TypeError("iterator result is not an object");\n      context.delegate = null;\n      return ContinueSentinel;\n    }\n\n    if (info.done) {\n      // Assign the result of the finished delegate to the temporary\n      // variable specified by delegate.resultName (see delegateYield).\n      context[delegate.resultName] = info.value;\n\n      // Resume execution at the desired location (see delegateYield).\n      context.next = delegate.nextLoc;\n\n      // If context.method was "throw" but the delegate handled the\n      // exception, let the outer generator proceed normally. If\n      // context.method was "next", forget context.arg since it has been\n      // "consumed" by the delegate iterator. If context.method was\n      // "return", allow the original .return call to continue in the\n      // outer generator.\n      if (context.method !== "return") {\n        context.method = "next";\n        context.arg = undefined;\n      }\n\n    } else {\n      // Re-yield the result returned by the delegate method.\n      return info;\n    }\n\n    // The delegate iterator is finished, so forget it and continue with\n    // the outer generator.\n    context.delegate = null;\n    return ContinueSentinel;\n  }\n\n  // Define Generator.prototype.{next,throw,return} in terms of the\n  // unified ._invoke helper method.\n  defineIteratorMethods(Gp);\n\n  Gp[toStringTagSymbol] = "Generator";\n\n  // A Generator should always return itself as the iterator object when the\n  // @@iterator function is called on it. Some browsers\' implementations of the\n  // iterator prototype chain incorrectly implement this, causing the Generator\n  // object to not be returned from this call. This ensures that doesn\'t happen.\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\n  Gp[iteratorSymbol] = function() {\n    return this;\n  };\n\n  Gp.toString = function() {\n    return "[object Generator]";\n  };\n\n  function pushTryEntry(locs) {\n    var entry = { tryLoc: locs[0] };\n\n    if (1 in locs) {\n      entry.catchLoc = locs[1];\n    }\n\n    if (2 in locs) {\n      entry.finallyLoc = locs[2];\n      entry.afterLoc = locs[3];\n    }\n\n    this.tryEntries.push(entry);\n  }\n\n  function resetTryEntry(entry) {\n    var record = entry.completion || {};\n    record.type = "normal";\n    delete record.arg;\n    entry.completion = record;\n  }\n\n  function Context(tryLocsList) {\n    // The root entry object (effectively a try statement without a catch\n    // or a finally block) gives us a place to store values thrown from\n    // locations where there is no enclosing try statement.\n    this.tryEntries = [{ tryLoc: "root" }];\n    tryLocsList.forEach(pushTryEntry, this);\n    this.reset(true);\n  }\n\n  runtime.keys = function(object) {\n    var keys = [];\n    for (var key in object) {\n      keys.push(key);\n    }\n    keys.reverse();\n\n    // Rather than returning an object with a next method, we keep\n    // things simple and return the next function itself.\n    return function next() {\n      while (keys.length) {\n        var key = keys.pop();\n        if (key in object) {\n          next.value = key;\n          next.done = false;\n          return next;\n        }\n      }\n\n      // To avoid creating an additional object, we just hang the .value\n      // and .done properties off the next function object itself. This\n      // also ensures that the minifier will not anonymize the function.\n      next.done = true;\n      return next;\n    };\n  };\n\n  function values(iterable) {\n    if (iterable) {\n      var iteratorMethod = iterable[iteratorSymbol];\n      if (iteratorMethod) {\n        return iteratorMethod.call(iterable);\n      }\n\n      if (typeof iterable.next === "function") {\n        return iterable;\n      }\n\n      if (!isNaN(iterable.length)) {\n        var i = -1, next = function next() {\n          while (++i < iterable.length) {\n            if (hasOwn.call(iterable, i)) {\n              next.value = iterable[i];\n              next.done = false;\n              return next;\n            }\n          }\n\n          next.value = undefined;\n          next.done = true;\n\n          return next;\n        };\n\n        return next.next = next;\n      }\n    }\n\n    // Return an iterator with no values.\n    return { next: doneResult };\n  }\n  runtime.values = values;\n\n  function doneResult() {\n    return { value: undefined, done: true };\n  }\n\n  Context.prototype = {\n    constructor: Context,\n\n    reset: function(skipTempReset) {\n      this.prev = 0;\n      this.next = 0;\n      // Resetting context._sent for legacy support of Babel\'s\n      // function.sent implementation.\n      this.sent = this._sent = undefined;\n      this.done = false;\n      this.delegate = null;\n\n      this.method = "next";\n      this.arg = undefined;\n\n      this.tryEntries.forEach(resetTryEntry);\n\n      if (!skipTempReset) {\n        for (var name in this) {\n          // Not sure about the optimal order of these conditions:\n          if (name.charAt(0) === "t" &&\n              hasOwn.call(this, name) &&\n              !isNaN(+name.slice(1))) {\n            this[name] = undefined;\n          }\n        }\n      }\n    },\n\n    stop: function() {\n      this.done = true;\n\n      var rootEntry = this.tryEntries[0];\n      var rootRecord = rootEntry.completion;\n      if (rootRecord.type === "throw") {\n        throw rootRecord.arg;\n      }\n\n      return this.rval;\n    },\n\n    dispatchException: function(exception) {\n      if (this.done) {\n        throw exception;\n      }\n\n      var context = this;\n      function handle(loc, caught) {\n        record.type = "throw";\n        record.arg = exception;\n        context.next = loc;\n\n        if (caught) {\n          // If the dispatched exception was caught by a catch block,\n          // then let that catch block handle the exception normally.\n          context.method = "next";\n          context.arg = undefined;\n        }\n\n        return !! caught;\n      }\n\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        var record = entry.completion;\n\n        if (entry.tryLoc === "root") {\n          // Exception thrown outside of any try block that could handle\n          // it, so set the completion value of the entire function to\n          // throw the exception.\n          return handle("end");\n        }\n\n        if (entry.tryLoc <= this.prev) {\n          var hasCatch = hasOwn.call(entry, "catchLoc");\n          var hasFinally = hasOwn.call(entry, "finallyLoc");\n\n          if (hasCatch && hasFinally) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            } else if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else if (hasCatch) {\n            if (this.prev < entry.catchLoc) {\n              return handle(entry.catchLoc, true);\n            }\n\n          } else if (hasFinally) {\n            if (this.prev < entry.finallyLoc) {\n              return handle(entry.finallyLoc);\n            }\n\n          } else {\n            throw new Error("try statement without catch or finally");\n          }\n        }\n      }\n    },\n\n    abrupt: function(type, arg) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc <= this.prev &&\n            hasOwn.call(entry, "finallyLoc") &&\n            this.prev < entry.finallyLoc) {\n          var finallyEntry = entry;\n          break;\n        }\n      }\n\n      if (finallyEntry &&\n          (type === "break" ||\n           type === "continue") &&\n          finallyEntry.tryLoc <= arg &&\n          arg <= finallyEntry.finallyLoc) {\n        // Ignore the finally entry if control is not jumping to a\n        // location outside the try/catch block.\n        finallyEntry = null;\n      }\n\n      var record = finallyEntry ? finallyEntry.completion : {};\n      record.type = type;\n      record.arg = arg;\n\n      if (finallyEntry) {\n        this.method = "next";\n        this.next = finallyEntry.finallyLoc;\n        return ContinueSentinel;\n      }\n\n      return this.complete(record);\n    },\n\n    complete: function(record, afterLoc) {\n      if (record.type === "throw") {\n        throw record.arg;\n      }\n\n      if (record.type === "break" ||\n          record.type === "continue") {\n        this.next = record.arg;\n      } else if (record.type === "return") {\n        this.rval = this.arg = record.arg;\n        this.method = "return";\n        this.next = "end";\n      } else if (record.type === "normal" && afterLoc) {\n        this.next = afterLoc;\n      }\n\n      return ContinueSentinel;\n    },\n\n    finish: function(finallyLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.finallyLoc === finallyLoc) {\n          this.complete(entry.completion, entry.afterLoc);\n          resetTryEntry(entry);\n          return ContinueSentinel;\n        }\n      }\n    },\n\n    "catch": function(tryLoc) {\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n        var entry = this.tryEntries[i];\n        if (entry.tryLoc === tryLoc) {\n          var record = entry.completion;\n          if (record.type === "throw") {\n            var thrown = record.arg;\n            resetTryEntry(entry);\n          }\n          return thrown;\n        }\n      }\n\n      // The context.catch method must only be called with a location\n      // argument that corresponds to a known catch block.\n      throw new Error("illegal catch attempt");\n    },\n\n    delegateYield: function(iterable, resultName, nextLoc) {\n      this.delegate = {\n        iterator: values(iterable),\n        resultName: resultName,\n        nextLoc: nextLoc\n      };\n\n      if (this.method === "next") {\n        // Deliberately forget the last sent value so that we don\'t\n        // accidentally pass it on to the delegate.\n        this.arg = undefined;\n      }\n\n      return ContinueSentinel;\n    }\n  };\n})(\n  // Among the various tricks for obtaining a reference to the global\n  // object, this seems to be the most reliable technique that does not\n  // use indirect eval (which violates Content Security Policy).\n  typeof global === "object" ? global :\n  typeof window === "object" ? window :\n  typeof self === "object" ? self : this\n);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/regenerator-runtime/runtime.js\n// module id = 1218\n// module chunks = 0\n\n//# sourceURL=../node_modules/regenerator-runtime/runtime.js')},function(module,exports,__webpack_require__){eval("\n//normalize a ws url.\nvar URL = __webpack_require__(157)\nmodule.exports = function (url, location, protocolMap, defaultProtocol) {\n  protocolMap = protocolMap ||{}\n  /*\n\n  https://nodejs.org/dist/latest-v6.x/docs/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost\n\n  I didn't know this, but url.parse takes a 3rd\n  argument which interprets \"//foo.com\" as the hostname,\n  but without the protocol. by default, // is interpreted\n  as the path.\n\n  that lets us do what the wsurl module does.\n  https://www.npmjs.com/package/wsurl\n\n  but most of the time, I want to write js\n  that will work on localhost, and will work\n  on a server...\n\n  so I want to just do createWebSocket('/')\n  and get \"ws://mydomain.com/\"\n\n  */\n\n  var url = URL.parse(url, false, true)\n\n  var proto\n  if(url.protocol) proto = url.protocol\n  else {\n    proto = location.protocol ? location.protocol.replace(/:$/,'') : 'http'\n    proto = ((protocolMap)[proto] || defaultProtocol || proto) + ':'\n  }\n\n  //handle quirk in url package\n  if(url.host && url.host[0] === ':')\n    url.host = null\n\n  //useful for websockets\n  if(url.hostname) {\n    return URL.format({\n      protocol: proto,\n      slashes: true,\n      hostname: url.hostname,\n      port: url.port,\n      pathname: url.pathname,\n      search: url.search\n    })\n  }\n  else url.host = location.host\n\n  //included for completeness. would you want to do this?\n  if(url.port) {\n    return URL.format({\n      protocol: proto,\n      slashes: true,\n      host: location.hostname + ':' + url.port,\n      port: url.port,\n      pathname: url.pathname,\n      search: url.search\n    })\n  }\n\n  //definately useful for websockets\n  if(url.pathname) {\n    return URL.format({\n      protocol: proto,\n      slashes: true,\n      host: url.host,\n      pathname: url.pathname,\n      search: url.search\n    })\n  }\n  else\n    url.pathname = location.pathname\n\n  //included for completeness. would you want to do this?\n  if(url.search) {\n    return URL.format({\n      protocol: proto,\n      slashes: true,\n      host: url.host,\n      pathname: url.pathname,\n      search: url.search\n    })\n  }\n  else url.search = location.search\n\n  return url.format(url)\n}\n\n\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/relative-url/index.js\n// module id = 1219\n// module chunks = 0\n\n//# sourceURL=../node_modules/relative-url/index.js")},function(module,exports,__webpack_require__){"use strict";eval('/*jshint node:true*/\n\n\n/**\n * Replaces characters in strings that are illegal/unsafe for filenames.\n * Unsafe characters are either removed or replaced by a substitute set\n * in the optional `options` object.\n *\n * Illegal Characters on Various Operating Systems\n * / ? < > \\ : * | "\n * https://kb.acronis.com/content/39790\n *\n * Unicode Control codes\n * C0 0x00-0x1f & C1 (0x80-0x9f)\n * http://en.wikipedia.org/wiki/C0_and_C1_control_codes\n *\n * Reserved filenames on Unix-based systems (".", "..")\n * Reserved filenames in Windows ("CON", "PRN", "AUX", "NUL", "COM1",\n * "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",\n * "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", and\n * "LPT9") case-insesitively and with or without filename extensions.\n *\n * Capped at 255 characters in length.\n * http://unix.stackexchange.com/questions/32795/what-is-the-maximum-allowed-filename-and-folder-size-with-ecryptfs\n *\n * @param  {String} input   Original filename\n * @param  {Object} options {replacement: String}\n * @return {String}         Sanitized filename\n */\n\nvar truncate = __webpack_require__(1251);\n\nvar illegalRe = /[\\/\\?<>\\\\:\\*\\|":]/g;\nvar controlRe = /[\\x00-\\x1f\\x80-\\x9f]/g;\nvar reservedRe = /^\\.+$/;\nvar windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\\..*)?$/i;\nvar windowsTrailingRe = /[\\. ]+$/;\n\nfunction sanitize(input, replacement) {\n  var sanitized = input\n    .replace(illegalRe, replacement)\n    .replace(controlRe, replacement)\n    .replace(reservedRe, replacement)\n    .replace(windowsReservedRe, replacement)\n    .replace(windowsTrailingRe, replacement);\n  return truncate(sanitized, 255);\n}\n\nmodule.exports = function (input, options) {\n  var replacement = (options && options.replacement) || \'\';\n  var output = sanitize(input, replacement);\n  if (replacement === \'\') {\n    return output;\n  }\n  return sanitize(output, \'\');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sanitize-filename/index.js\n// module id = 1220\n// module chunks = 0\n\n//# sourceURL=../node_modules/sanitize-filename/index.js')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2Sync = __webpack_require__(297).pbkdf2Sync\n\nvar MAX_VALUE = 0x7fffffff\n\n// N = Cpu cost, r = Memory cost, p = parallelization cost\nfunction scrypt (key, salt, N, r, p, dkLen, progressCallback) {\n  if (N === 0 || (N & (N - 1)) !== 0) throw Error('N must be > 0 and a power of 2')\n\n  if (N > MAX_VALUE / 128 / r) throw Error('Parameter N is too large')\n  if (r > MAX_VALUE / 128 / p) throw Error('Parameter r is too large')\n\n  var XY = new Buffer(256 * r)\n  var V = new Buffer(128 * r * N)\n\n  // pseudo global\n  var B32 = new Int32Array(16) // salsa20_8\n  var x = new Int32Array(16) // salsa20_8\n  var _X = new Buffer(64) // blockmix_salsa8\n\n  // pseudo global\n  var B = pbkdf2Sync(key, salt, 1, p * 128 * r, 'sha256')\n\n  var tickCallback\n  if (progressCallback) {\n    var totalOps = p * N * 2\n    var currentOp = 0\n\n    tickCallback = function () {\n      ++currentOp\n\n      // send progress notifications once every 1,000 ops\n      if (currentOp % 1000 === 0) {\n        progressCallback({\n          current: currentOp,\n          total: totalOps,\n          percent: (currentOp / totalOps) * 100.0\n        })\n      }\n    }\n  }\n\n  for (var i = 0; i < p; i++) {\n    smix(B, i * 128 * r, r, N, V, XY)\n  }\n\n  return pbkdf2Sync(key, B, 1, dkLen, 'sha256')\n\n  // all of these functions are actually moved to the top\n  // due to function hoisting\n\n  function smix (B, Bi, r, N, V, XY) {\n    var Xi = 0\n    var Yi = 128 * r\n    var i\n\n    B.copy(XY, Xi, Bi, Bi + Yi)\n\n    for (i = 0; i < N; i++) {\n      XY.copy(V, i * Yi, Xi, Xi + Yi)\n      blockmix_salsa8(XY, Xi, Yi, r)\n\n      if (tickCallback) tickCallback()\n    }\n\n    for (i = 0; i < N; i++) {\n      var offset = Xi + (2 * r - 1) * 64\n      var j = XY.readUInt32LE(offset) & (N - 1)\n      blockxor(V, j * Yi, XY, Xi, Yi)\n      blockmix_salsa8(XY, Xi, Yi, r)\n\n      if (tickCallback) tickCallback()\n    }\n\n    XY.copy(B, Bi, Xi, Xi + Yi)\n  }\n\n  function blockmix_salsa8 (BY, Bi, Yi, r) {\n    var i\n\n    arraycopy(BY, Bi + (2 * r - 1) * 64, _X, 0, 64)\n\n    for (i = 0; i < 2 * r; i++) {\n      blockxor(BY, i * 64, _X, 0, 64)\n      salsa20_8(_X)\n      arraycopy(_X, 0, BY, Yi + (i * 64), 64)\n    }\n\n    for (i = 0; i < r; i++) {\n      arraycopy(BY, Yi + (i * 2) * 64, BY, Bi + (i * 64), 64)\n    }\n\n    for (i = 0; i < r; i++) {\n      arraycopy(BY, Yi + (i * 2 + 1) * 64, BY, Bi + (i + r) * 64, 64)\n    }\n  }\n\n  function R (a, b) {\n    return (a << b) | (a >>> (32 - b))\n  }\n\n  function salsa20_8 (B) {\n    var i\n\n    for (i = 0; i < 16; i++) {\n      B32[i] = (B[i * 4 + 0] & 0xff) << 0\n      B32[i] |= (B[i * 4 + 1] & 0xff) << 8\n      B32[i] |= (B[i * 4 + 2] & 0xff) << 16\n      B32[i] |= (B[i * 4 + 3] & 0xff) << 24\n      // B32[i] = B.readUInt32LE(i*4)   <--- this is signficantly slower even in Node.js\n    }\n\n    arraycopy(B32, 0, x, 0, 16)\n\n    for (i = 8; i > 0; i -= 2) {\n      x[ 4] ^= R(x[ 0] + x[12], 7)\n      x[ 8] ^= R(x[ 4] + x[ 0], 9)\n      x[12] ^= R(x[ 8] + x[ 4], 13)\n      x[ 0] ^= R(x[12] + x[ 8], 18)\n      x[ 9] ^= R(x[ 5] + x[ 1], 7)\n      x[13] ^= R(x[ 9] + x[ 5], 9)\n      x[ 1] ^= R(x[13] + x[ 9], 13)\n      x[ 5] ^= R(x[ 1] + x[13], 18)\n      x[14] ^= R(x[10] + x[ 6], 7)\n      x[ 2] ^= R(x[14] + x[10], 9)\n      x[ 6] ^= R(x[ 2] + x[14], 13)\n      x[10] ^= R(x[ 6] + x[ 2], 18)\n      x[ 3] ^= R(x[15] + x[11], 7)\n      x[ 7] ^= R(x[ 3] + x[15], 9)\n      x[11] ^= R(x[ 7] + x[ 3], 13)\n      x[15] ^= R(x[11] + x[ 7], 18)\n      x[ 1] ^= R(x[ 0] + x[ 3], 7)\n      x[ 2] ^= R(x[ 1] + x[ 0], 9)\n      x[ 3] ^= R(x[ 2] + x[ 1], 13)\n      x[ 0] ^= R(x[ 3] + x[ 2], 18)\n      x[ 6] ^= R(x[ 5] + x[ 4], 7)\n      x[ 7] ^= R(x[ 6] + x[ 5], 9)\n      x[ 4] ^= R(x[ 7] + x[ 6], 13)\n      x[ 5] ^= R(x[ 4] + x[ 7], 18)\n      x[11] ^= R(x[10] + x[ 9], 7)\n      x[ 8] ^= R(x[11] + x[10], 9)\n      x[ 9] ^= R(x[ 8] + x[11], 13)\n      x[10] ^= R(x[ 9] + x[ 8], 18)\n      x[12] ^= R(x[15] + x[14], 7)\n      x[13] ^= R(x[12] + x[15], 9)\n      x[14] ^= R(x[13] + x[12], 13)\n      x[15] ^= R(x[14] + x[13], 18)\n    }\n\n    for (i = 0; i < 16; ++i) B32[i] = x[i] + B32[i]\n\n    for (i = 0; i < 16; i++) {\n      var bi = i * 4\n      B[bi + 0] = (B32[i] >> 0 & 0xff)\n      B[bi + 1] = (B32[i] >> 8 & 0xff)\n      B[bi + 2] = (B32[i] >> 16 & 0xff)\n      B[bi + 3] = (B32[i] >> 24 & 0xff)\n      // B.writeInt32LE(B32[i], i*4)  //<--- this is signficantly slower even in Node.js\n    }\n  }\n\n  // naive approach... going back to loop unrolling may yield additional performance\n  function blockxor (S, Si, D, Di, len) {\n    for (var i = 0; i < len; i++) {\n      D[Di + i] ^= S[Si + i]\n    }\n  }\n}\n\nfunction arraycopy (src, srcPos, dest, destPos, length) {\n  if (Buffer.isBuffer(src) && Buffer.isBuffer(dest)) {\n    src.copy(dest, destPos, srcPos, srcPos + length)\n  } else {\n    while (length--) {\n      dest[destPos++] = src[srcPos++]\n    }\n  }\n}\n\nmodule.exports = scrypt\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/scryptsy/lib/scrypt.js\n// module id = 1221\n// module chunks = 0\n\n//# sourceURL=../node_modules/scryptsy/lib/scrypt.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = __webpack_require__(531)(__webpack_require__(1226))\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/elliptic.js\n// module id = 1222\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/elliptic.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = __webpack_require__(531)(__webpack_require__(1229))\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/js.js\n// module id = 1223\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/js.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nvar toString = Object.prototype.toString\n\n// TypeError\nexports.isArray = function (value, message) {\n  if (!Array.isArray(value)) throw TypeError(message)\n}\n\nexports.isBoolean = function (value, message) {\n  if (toString.call(value) !== '[object Boolean]') throw TypeError(message)\n}\n\nexports.isBuffer = function (value, message) {\n  if (!Buffer.isBuffer(value)) throw TypeError(message)\n}\n\nexports.isFunction = function (value, message) {\n  if (toString.call(value) !== '[object Function]') throw TypeError(message)\n}\n\nexports.isNumber = function (value, message) {\n  if (toString.call(value) !== '[object Number]') throw TypeError(message)\n}\n\nexports.isObject = function (value, message) {\n  if (toString.call(value) !== '[object Object]') throw TypeError(message)\n}\n\n// RangeError\nexports.isBufferLength = function (buffer, length, message) {\n  if (buffer.length !== length) throw RangeError(message)\n}\n\nexports.isBufferLength2 = function (buffer, length1, length2, message) {\n  if (buffer.length !== length1 && buffer.length !== length2) throw RangeError(message)\n}\n\nexports.isLengthGTZero = function (value, message) {\n  if (value.length === 0) throw RangeError(message)\n}\n\nexports.isNumberInInterval = function (number, x, y, message) {\n  if (number <= x || number >= y) throw RangeError(message)\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/assert.js\n// module id = 1224\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/assert.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar bip66 = __webpack_require__(227)\n\nvar EC_PRIVKEY_EXPORT_DER_COMPRESSED = Buffer.from([\n  // begin\n  0x30, 0x81, 0xd3, 0x02, 0x01, 0x01, 0x04, 0x20,\n  // private key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  // middle\n  0xa0, 0x81, 0x85, 0x30, 0x81, 0x82, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n  0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n  0x21, 0x02, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n  0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n  0x17, 0x98, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n  0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x24, 0x03, 0x22, 0x00,\n  // public key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00\n])\n\nvar EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED = Buffer.from([\n  // begin\n  0x30, 0x82, 0x01, 0x13, 0x02, 0x01, 0x01, 0x04, 0x20,\n  // private key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  // middle\n  0xa0, 0x81, 0xa5, 0x30, 0x81, 0xa2, 0x02, 0x01, 0x01, 0x30, 0x2c, 0x06, 0x07, 0x2a, 0x86, 0x48,\n  0xcE, 0x3d, 0x01, 0x01, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xfE, 0xff, 0xff, 0xfc, 0x2f, 0x30, 0x06, 0x04, 0x01, 0x00, 0x04, 0x01, 0x07, 0x04,\n  0x41, 0x04, 0x79, 0xbE, 0x66, 0x7E, 0xf9, 0xdc, 0xbb, 0xac, 0x55, 0xa0, 0x62, 0x95, 0xcE, 0x87,\n  0x0b, 0x07, 0x02, 0x9b, 0xfc, 0xdb, 0x2d, 0xcE, 0x28, 0xd9, 0x59, 0xf2, 0x81, 0x5b, 0x16, 0xf8,\n  0x17, 0x98, 0x48, 0x3a, 0xda, 0x77, 0x26, 0xa3, 0xc4, 0x65, 0x5d, 0xa4, 0xfb, 0xfc, 0x0E, 0x11,\n  0x08, 0xa8, 0xfd, 0x17, 0xb4, 0x48, 0xa6, 0x85, 0x54, 0x19, 0x9c, 0x47, 0xd0, 0x8f, 0xfb, 0x10,\n  0xd4, 0xb8, 0x02, 0x21, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\n  0xff, 0xff, 0xff, 0xff, 0xfE, 0xba, 0xaE, 0xdc, 0xE6, 0xaf, 0x48, 0xa0, 0x3b, 0xbf, 0xd2, 0x5E,\n  0x8c, 0xd0, 0x36, 0x41, 0x41, 0x02, 0x01, 0x01, 0xa1, 0x44, 0x03, 0x42, 0x00,\n  // public key\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n  0x00\n])\n\nexports.privateKeyExport = function (privateKey, publicKey, compressed) {\n  var result = Buffer.from(compressed ? EC_PRIVKEY_EXPORT_DER_COMPRESSED : EC_PRIVKEY_EXPORT_DER_UNCOMPRESSED)\n  privateKey.copy(result, compressed ? 8 : 9)\n  publicKey.copy(result, compressed ? 181 : 214)\n  return result\n}\n\nexports.privateKeyImport = function (privateKey) {\n  var length = privateKey.length\n\n  // sequence header\n  var index = 0\n  if (length < index + 1 || privateKey[index] !== 0x30) return\n  index += 1\n\n  // sequence length constructor\n  if (length < index + 1 || !(privateKey[index] & 0x80)) return\n\n  var lenb = privateKey[index] & 0x7f\n  index += 1\n  if (lenb < 1 || lenb > 2) return\n  if (length < index + lenb) return\n\n  // sequence length\n  var len = privateKey[index + lenb - 1] | (lenb > 1 ? privateKey[index + lenb - 2] << 8 : 0)\n  index += lenb\n  if (length < index + len) return\n\n  // sequence element 0: version number (=1)\n  if (length < index + 3 ||\n      privateKey[index] !== 0x02 ||\n      privateKey[index + 1] !== 0x01 ||\n      privateKey[index + 2] !== 0x01) {\n    return\n  }\n  index += 3\n\n  // sequence element 1: octet string, up to 32 bytes\n  if (length < index + 2 ||\n      privateKey[index] !== 0x04 ||\n      privateKey[index + 1] > 0x20 ||\n      length < index + 2 + privateKey[index + 1]) {\n    return\n  }\n\n  return privateKey.slice(index + 2, index + 2 + privateKey[index + 1])\n}\n\nexports.signatureExport = function (sigObj) {\n  var r = Buffer.concat([Buffer.from([0]), sigObj.r])\n  for (var lenR = 33, posR = 0; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n  var s = Buffer.concat([Buffer.from([0]), sigObj.s])\n  for (var lenS = 33, posS = 0; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n  return bip66.encode(r.slice(posR), s.slice(posS))\n}\n\nexports.signatureImport = function (sig) {\n  var r = Buffer.alloc(32, 0)\n  var s = Buffer.alloc(32, 0)\n\n  try {\n    var sigObj = bip66.decode(sig)\n    if (sigObj.r.length === 33 && sigObj.r[0] === 0x00) sigObj.r = sigObj.r.slice(1)\n    if (sigObj.r.length > 32) throw new Error('R length is too long')\n    if (sigObj.s.length === 33 && sigObj.s[0] === 0x00) sigObj.s = sigObj.s.slice(1)\n    if (sigObj.s.length > 32) throw new Error('S length is too long')\n  } catch (err) {\n    return\n  }\n\n  sigObj.r.copy(r, 32 - sigObj.r.length)\n  sigObj.s.copy(s, 32 - sigObj.s.length)\n\n  return { r: r, s: s }\n}\n\nexports.signatureImportLax = function (sig) {\n  var r = Buffer.alloc(32, 0)\n  var s = Buffer.alloc(32, 0)\n\n  var length = sig.length\n  var index = 0\n\n  // sequence tag byte\n  if (sig[index++] !== 0x30) return\n\n  // sequence length byte\n  var lenbyte = sig[index++]\n  if (lenbyte & 0x80) {\n    index += lenbyte - 0x80\n    if (index > length) return\n  }\n\n  // sequence tag byte for r\n  if (sig[index++] !== 0x02) return\n\n  // length for r\n  var rlen = sig[index++]\n  if (rlen & 0x80) {\n    lenbyte = rlen - 0x80\n    if (index + lenbyte > length) return\n    for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n    for (rlen = 0; lenbyte > 0; index += 1, lenbyte -= 1) rlen = (rlen << 8) + sig[index]\n  }\n  if (rlen > length - index) return\n  var rindex = index\n  index += rlen\n\n  // sequence tag byte for s\n  if (sig[index++] !== 0x02) return\n\n  // length for s\n  var slen = sig[index++]\n  if (slen & 0x80) {\n    lenbyte = slen - 0x80\n    if (index + lenbyte > length) return\n    for (; lenbyte > 0 && sig[index] === 0x00; index += 1, lenbyte -= 1);\n    for (slen = 0; lenbyte > 0; index += 1, lenbyte -= 1) slen = (slen << 8) + sig[index]\n  }\n  if (slen > length - index) return\n  var sindex = index\n  index += slen\n\n  // ignore leading zeros in r\n  for (; rlen > 0 && sig[rindex] === 0x00; rlen -= 1, rindex += 1);\n  // copy r value\n  if (rlen > 32) return\n  var rvalue = sig.slice(rindex, rindex + rlen)\n  rvalue.copy(r, 32 - rvalue.length)\n\n  // ignore leading zeros in s\n  for (; slen > 0 && sig[sindex] === 0x00; slen -= 1, sindex += 1);\n  // copy s value\n  if (slen > 32) return\n  var svalue = sig.slice(sindex, sindex + slen)\n  svalue.copy(s, 32 - svalue.length)\n\n  return { r: r, s: s }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/der.js\n// module id = 1225\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/der.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar createHash = __webpack_require__(59)\nvar BN = __webpack_require__(17)\nvar EC = __webpack_require__(28).ec\n\nvar messages = __webpack_require__(307)\n\nvar ec = new EC('secp256k1')\nvar ecparams = ec.curve\n\nfunction loadCompressedPublicKey (first, xBuffer) {\n  var x = new BN(xBuffer)\n\n  // overflow\n  if (x.cmp(ecparams.p) >= 0) return null\n  x = x.toRed(ecparams.red)\n\n  // compute corresponding Y\n  var y = x.redSqr().redIMul(x).redIAdd(ecparams.b).redSqrt()\n  if ((first === 0x03) !== y.isOdd()) y = y.redNeg()\n\n  return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadUncompressedPublicKey (first, xBuffer, yBuffer) {\n  var x = new BN(xBuffer)\n  var y = new BN(yBuffer)\n\n  // overflow\n  if (x.cmp(ecparams.p) >= 0 || y.cmp(ecparams.p) >= 0) return null\n\n  x = x.toRed(ecparams.red)\n  y = y.toRed(ecparams.red)\n\n  // is odd flag\n  if ((first === 0x06 || first === 0x07) && y.isOdd() !== (first === 0x07)) return null\n\n  // x*x*x + b = y*y\n  var x3 = x.redSqr().redIMul(x)\n  if (!y.redSqr().redISub(x3.redIAdd(ecparams.b)).isZero()) return null\n\n  return ec.keyPair({ pub: { x: x, y: y } })\n}\n\nfunction loadPublicKey (publicKey) {\n  var first = publicKey[0]\n  switch (first) {\n    case 0x02:\n    case 0x03:\n      if (publicKey.length !== 33) return null\n      return loadCompressedPublicKey(first, publicKey.slice(1, 33))\n    case 0x04:\n    case 0x06:\n    case 0x07:\n      if (publicKey.length !== 65) return null\n      return loadUncompressedPublicKey(first, publicKey.slice(1, 33), publicKey.slice(33, 65))\n    default:\n      return null\n  }\n}\n\nexports.privateKeyVerify = function (privateKey) {\n  var bn = new BN(privateKey)\n  return bn.cmp(ecparams.n) < 0 && !bn.isZero()\n}\n\nexports.privateKeyExport = function (privateKey, compressed) {\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL)\n\n  return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed, true))\n}\n\nexports.privateKeyNegate = function (privateKey) {\n  var bn = new BN(privateKey)\n  return bn.isZero() ? Buffer.alloc(32) : ecparams.n.sub(bn).umod(ecparams.n).toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyModInverse = function (privateKey) {\n  var bn = new BN(privateKey)\n  if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_RANGE_INVALID)\n\n  return bn.invm(ecparams.n).toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyTweakAdd = function (privateKey, tweak) {\n  var bn = new BN(tweak)\n  if (bn.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  bn.iadd(new BN(privateKey))\n  if (bn.cmp(ecparams.n) >= 0) bn.isub(ecparams.n)\n  if (bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  return bn.toArrayLike(Buffer, 'be', 32)\n}\n\nexports.privateKeyTweakMul = function (privateKey, tweak) {\n  var bn = new BN(tweak)\n  if (bn.cmp(ecparams.n) >= 0 || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL)\n\n  bn.imul(new BN(privateKey))\n  if (bn.cmp(ecparams.n)) bn = bn.umod(ecparams.n)\n\n  return bn.toArrayLike(Buffer, 'be', 32)\n}\n\nexports.publicKeyCreate = function (privateKey, compressed) {\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL)\n\n  return Buffer.from(ec.keyFromPrivate(privateKey).getPublic(compressed, true))\n}\n\nexports.publicKeyConvert = function (publicKey, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  return Buffer.from(pair.getPublic(compressed, true))\n}\n\nexports.publicKeyVerify = function (publicKey) {\n  return loadPublicKey(publicKey) !== null\n}\n\nexports.publicKeyTweakAdd = function (publicKey, tweak, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = new BN(tweak)\n  if (tweak.cmp(ecparams.n) >= 0) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n  return Buffer.from(ecparams.g.mul(tweak).add(pair.pub).encode(true, compressed))\n}\n\nexports.publicKeyTweakMul = function (publicKey, tweak, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = new BN(tweak)\n  if (tweak.cmp(ecparams.n) >= 0 || tweak.isZero()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL)\n\n  return Buffer.from(pair.pub.mul(tweak).encode(true, compressed))\n}\n\nexports.publicKeyCombine = function (publicKeys, compressed) {\n  var pairs = new Array(publicKeys.length)\n  for (var i = 0; i < publicKeys.length; ++i) {\n    pairs[i] = loadPublicKey(publicKeys[i])\n    if (pairs[i] === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n  }\n\n  var point = pairs[0].pub\n  for (var j = 1; j < pairs.length; ++j) point = point.add(pairs[j].pub)\n  if (point.isInfinity()) throw new Error(messages.EC_PUBLIC_KEY_COMBINE_FAIL)\n\n  return Buffer.from(point.encode(true, compressed))\n}\n\nexports.signatureNormalize = function (signature) {\n  var r = new BN(signature.slice(0, 32))\n  var s = new BN(signature.slice(32, 64))\n  if (r.cmp(ecparams.n) >= 0 || s.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  var result = Buffer.from(signature)\n  if (s.cmp(ec.nh) === 1) ecparams.n.sub(s).toArrayLike(Buffer, 'be', 32).copy(result, 32)\n\n  return result\n}\n\nexports.signatureExport = function (signature) {\n  var r = signature.slice(0, 32)\n  var s = signature.slice(32, 64)\n  if (new BN(r).cmp(ecparams.n) >= 0 || new BN(s).cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  return { r: r, s: s }\n}\n\nexports.signatureImport = function (sigObj) {\n  var r = new BN(sigObj.r)\n  if (r.cmp(ecparams.n) >= 0) r = new BN(0)\n\n  var s = new BN(sigObj.s)\n  if (s.cmp(ecparams.n) >= 0) s = new BN(0)\n\n  return Buffer.concat([\n    r.toArrayLike(Buffer, 'be', 32),\n    s.toArrayLike(Buffer, 'be', 32)\n  ])\n}\n\nexports.sign = function (message, privateKey, noncefn, data) {\n  if (typeof noncefn === 'function') {\n    var getNonce = noncefn\n    noncefn = function (counter) {\n      var nonce = getNonce(message, privateKey, null, data, counter)\n      if (!Buffer.isBuffer(nonce) || nonce.length !== 32) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n      return new BN(nonce)\n    }\n  }\n\n  var d = new BN(privateKey)\n  if (d.cmp(ecparams.n) >= 0 || d.isZero()) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n  var result = ec.sign(message, privateKey, { canonical: true, k: noncefn, pers: data })\n  return {\n    signature: Buffer.concat([\n      result.r.toArrayLike(Buffer, 'be', 32),\n      result.s.toArrayLike(Buffer, 'be', 32)\n    ]),\n    recovery: result.recoveryParam\n  }\n}\n\nexports.verify = function (message, signature, publicKey) {\n  var sigObj = {r: signature.slice(0, 32), s: signature.slice(32, 64)}\n\n  var sigr = new BN(sigObj.r)\n  var sigs = new BN(sigObj.s)\n  if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n  if (sigs.cmp(ec.nh) === 1 || sigr.isZero() || sigs.isZero()) return false\n\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  return ec.verify(message, sigObj, {x: pair.pub.x, y: pair.pub.y})\n}\n\nexports.recover = function (message, signature, recovery, compressed) {\n  var sigObj = {r: signature.slice(0, 32), s: signature.slice(32, 64)}\n\n  var sigr = new BN(sigObj.r)\n  var sigs = new BN(sigObj.s)\n  if (sigr.cmp(ecparams.n) >= 0 || sigs.cmp(ecparams.n) >= 0) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  try {\n    if (sigr.isZero() || sigs.isZero()) throw new Error()\n\n    var point = ec.recoverPubKey(message, sigObj, recovery)\n    return Buffer.from(point.encode(true, compressed))\n  } catch (err) {\n    throw new Error(messages.ECDSA_RECOVER_FAIL)\n  }\n}\n\nexports.ecdh = function (publicKey, privateKey) {\n  var shared = exports.ecdhUnsafe(publicKey, privateKey, true)\n  return createHash('sha256').update(shared).digest()\n}\n\nexports.ecdhUnsafe = function (publicKey, privateKey, compressed) {\n  var pair = loadPublicKey(publicKey)\n  if (pair === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  var scalar = new BN(privateKey)\n  if (scalar.cmp(ecparams.n) >= 0 || scalar.isZero()) throw new Error(messages.ECDH_FAIL)\n\n  return Buffer.from(pair.pub.mul(scalar).encode(true, compressed))\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/elliptic/index.js\n// module id = 1226\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/elliptic/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nexports.umulTo10x10 = function (num1, num2, out) {\n  var a = num1.words\n  var b = num2.words\n  var o = out.words\n  var c = 0\n  var lo\n  var mid\n  var hi\n  var a0 = a[0] | 0\n  var al0 = a0 & 0x1fff\n  var ah0 = a0 >>> 13\n  var a1 = a[1] | 0\n  var al1 = a1 & 0x1fff\n  var ah1 = a1 >>> 13\n  var a2 = a[2] | 0\n  var al2 = a2 & 0x1fff\n  var ah2 = a2 >>> 13\n  var a3 = a[3] | 0\n  var al3 = a3 & 0x1fff\n  var ah3 = a3 >>> 13\n  var a4 = a[4] | 0\n  var al4 = a4 & 0x1fff\n  var ah4 = a4 >>> 13\n  var a5 = a[5] | 0\n  var al5 = a5 & 0x1fff\n  var ah5 = a5 >>> 13\n  var a6 = a[6] | 0\n  var al6 = a6 & 0x1fff\n  var ah6 = a6 >>> 13\n  var a7 = a[7] | 0\n  var al7 = a7 & 0x1fff\n  var ah7 = a7 >>> 13\n  var a8 = a[8] | 0\n  var al8 = a8 & 0x1fff\n  var ah8 = a8 >>> 13\n  var a9 = a[9] | 0\n  var al9 = a9 & 0x1fff\n  var ah9 = a9 >>> 13\n  var b0 = b[0] | 0\n  var bl0 = b0 & 0x1fff\n  var bh0 = b0 >>> 13\n  var b1 = b[1] | 0\n  var bl1 = b1 & 0x1fff\n  var bh1 = b1 >>> 13\n  var b2 = b[2] | 0\n  var bl2 = b2 & 0x1fff\n  var bh2 = b2 >>> 13\n  var b3 = b[3] | 0\n  var bl3 = b3 & 0x1fff\n  var bh3 = b3 >>> 13\n  var b4 = b[4] | 0\n  var bl4 = b4 & 0x1fff\n  var bh4 = b4 >>> 13\n  var b5 = b[5] | 0\n  var bl5 = b5 & 0x1fff\n  var bh5 = b5 >>> 13\n  var b6 = b[6] | 0\n  var bl6 = b6 & 0x1fff\n  var bh6 = b6 >>> 13\n  var b7 = b[7] | 0\n  var bl7 = b7 & 0x1fff\n  var bh7 = b7 >>> 13\n  var b8 = b[8] | 0\n  var bl8 = b8 & 0x1fff\n  var bh8 = b8 >>> 13\n  var b9 = b[9] | 0\n  var bl9 = b9 & 0x1fff\n  var bh9 = b9 >>> 13\n\n  out.length = 19\n  /* k = 0 */\n  lo = Math.imul(al0, bl0)\n  mid = Math.imul(al0, bh0)\n  mid += Math.imul(ah0, bl0)\n  hi = Math.imul(ah0, bh0)\n  var w0 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w0 >>> 26)\n  w0 &= 0x3ffffff\n  /* k = 1 */\n  lo = Math.imul(al1, bl0)\n  mid = Math.imul(al1, bh0)\n  mid += Math.imul(ah1, bl0)\n  hi = Math.imul(ah1, bh0)\n  lo += Math.imul(al0, bl1)\n  mid += Math.imul(al0, bh1)\n  mid += Math.imul(ah0, bl1)\n  hi += Math.imul(ah0, bh1)\n  var w1 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w1 >>> 26)\n  w1 &= 0x3ffffff\n  /* k = 2 */\n  lo = Math.imul(al2, bl0)\n  mid = Math.imul(al2, bh0)\n  mid += Math.imul(ah2, bl0)\n  hi = Math.imul(ah2, bh0)\n  lo += Math.imul(al1, bl1)\n  mid += Math.imul(al1, bh1)\n  mid += Math.imul(ah1, bl1)\n  hi += Math.imul(ah1, bh1)\n  lo += Math.imul(al0, bl2)\n  mid += Math.imul(al0, bh2)\n  mid += Math.imul(ah0, bl2)\n  hi += Math.imul(ah0, bh2)\n  var w2 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w2 >>> 26)\n  w2 &= 0x3ffffff\n  /* k = 3 */\n  lo = Math.imul(al3, bl0)\n  mid = Math.imul(al3, bh0)\n  mid += Math.imul(ah3, bl0)\n  hi = Math.imul(ah3, bh0)\n  lo += Math.imul(al2, bl1)\n  mid += Math.imul(al2, bh1)\n  mid += Math.imul(ah2, bl1)\n  hi += Math.imul(ah2, bh1)\n  lo += Math.imul(al1, bl2)\n  mid += Math.imul(al1, bh2)\n  mid += Math.imul(ah1, bl2)\n  hi += Math.imul(ah1, bh2)\n  lo += Math.imul(al0, bl3)\n  mid += Math.imul(al0, bh3)\n  mid += Math.imul(ah0, bl3)\n  hi += Math.imul(ah0, bh3)\n  var w3 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w3 >>> 26)\n  w3 &= 0x3ffffff\n  /* k = 4 */\n  lo = Math.imul(al4, bl0)\n  mid = Math.imul(al4, bh0)\n  mid += Math.imul(ah4, bl0)\n  hi = Math.imul(ah4, bh0)\n  lo += Math.imul(al3, bl1)\n  mid += Math.imul(al3, bh1)\n  mid += Math.imul(ah3, bl1)\n  hi += Math.imul(ah3, bh1)\n  lo += Math.imul(al2, bl2)\n  mid += Math.imul(al2, bh2)\n  mid += Math.imul(ah2, bl2)\n  hi += Math.imul(ah2, bh2)\n  lo += Math.imul(al1, bl3)\n  mid += Math.imul(al1, bh3)\n  mid += Math.imul(ah1, bl3)\n  hi += Math.imul(ah1, bh3)\n  lo += Math.imul(al0, bl4)\n  mid += Math.imul(al0, bh4)\n  mid += Math.imul(ah0, bl4)\n  hi += Math.imul(ah0, bh4)\n  var w4 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w4 >>> 26)\n  w4 &= 0x3ffffff\n  /* k = 5 */\n  lo = Math.imul(al5, bl0)\n  mid = Math.imul(al5, bh0)\n  mid += Math.imul(ah5, bl0)\n  hi = Math.imul(ah5, bh0)\n  lo += Math.imul(al4, bl1)\n  mid += Math.imul(al4, bh1)\n  mid += Math.imul(ah4, bl1)\n  hi += Math.imul(ah4, bh1)\n  lo += Math.imul(al3, bl2)\n  mid += Math.imul(al3, bh2)\n  mid += Math.imul(ah3, bl2)\n  hi += Math.imul(ah3, bh2)\n  lo += Math.imul(al2, bl3)\n  mid += Math.imul(al2, bh3)\n  mid += Math.imul(ah2, bl3)\n  hi += Math.imul(ah2, bh3)\n  lo += Math.imul(al1, bl4)\n  mid += Math.imul(al1, bh4)\n  mid += Math.imul(ah1, bl4)\n  hi += Math.imul(ah1, bh4)\n  lo += Math.imul(al0, bl5)\n  mid += Math.imul(al0, bh5)\n  mid += Math.imul(ah0, bl5)\n  hi += Math.imul(ah0, bh5)\n  var w5 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w5 >>> 26)\n  w5 &= 0x3ffffff\n  /* k = 6 */\n  lo = Math.imul(al6, bl0)\n  mid = Math.imul(al6, bh0)\n  mid += Math.imul(ah6, bl0)\n  hi = Math.imul(ah6, bh0)\n  lo += Math.imul(al5, bl1)\n  mid += Math.imul(al5, bh1)\n  mid += Math.imul(ah5, bl1)\n  hi += Math.imul(ah5, bh1)\n  lo += Math.imul(al4, bl2)\n  mid += Math.imul(al4, bh2)\n  mid += Math.imul(ah4, bl2)\n  hi += Math.imul(ah4, bh2)\n  lo += Math.imul(al3, bl3)\n  mid += Math.imul(al3, bh3)\n  mid += Math.imul(ah3, bl3)\n  hi += Math.imul(ah3, bh3)\n  lo += Math.imul(al2, bl4)\n  mid += Math.imul(al2, bh4)\n  mid += Math.imul(ah2, bl4)\n  hi += Math.imul(ah2, bh4)\n  lo += Math.imul(al1, bl5)\n  mid += Math.imul(al1, bh5)\n  mid += Math.imul(ah1, bl5)\n  hi += Math.imul(ah1, bh5)\n  lo += Math.imul(al0, bl6)\n  mid += Math.imul(al0, bh6)\n  mid += Math.imul(ah0, bl6)\n  hi += Math.imul(ah0, bh6)\n  var w6 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w6 >>> 26)\n  w6 &= 0x3ffffff\n  /* k = 7 */\n  lo = Math.imul(al7, bl0)\n  mid = Math.imul(al7, bh0)\n  mid += Math.imul(ah7, bl0)\n  hi = Math.imul(ah7, bh0)\n  lo += Math.imul(al6, bl1)\n  mid += Math.imul(al6, bh1)\n  mid += Math.imul(ah6, bl1)\n  hi += Math.imul(ah6, bh1)\n  lo += Math.imul(al5, bl2)\n  mid += Math.imul(al5, bh2)\n  mid += Math.imul(ah5, bl2)\n  hi += Math.imul(ah5, bh2)\n  lo += Math.imul(al4, bl3)\n  mid += Math.imul(al4, bh3)\n  mid += Math.imul(ah4, bl3)\n  hi += Math.imul(ah4, bh3)\n  lo += Math.imul(al3, bl4)\n  mid += Math.imul(al3, bh4)\n  mid += Math.imul(ah3, bl4)\n  hi += Math.imul(ah3, bh4)\n  lo += Math.imul(al2, bl5)\n  mid += Math.imul(al2, bh5)\n  mid += Math.imul(ah2, bl5)\n  hi += Math.imul(ah2, bh5)\n  lo += Math.imul(al1, bl6)\n  mid += Math.imul(al1, bh6)\n  mid += Math.imul(ah1, bl6)\n  hi += Math.imul(ah1, bh6)\n  lo += Math.imul(al0, bl7)\n  mid += Math.imul(al0, bh7)\n  mid += Math.imul(ah0, bl7)\n  hi += Math.imul(ah0, bh7)\n  var w7 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w7 >>> 26)\n  w7 &= 0x3ffffff\n  /* k = 8 */\n  lo = Math.imul(al8, bl0)\n  mid = Math.imul(al8, bh0)\n  mid += Math.imul(ah8, bl0)\n  hi = Math.imul(ah8, bh0)\n  lo += Math.imul(al7, bl1)\n  mid += Math.imul(al7, bh1)\n  mid += Math.imul(ah7, bl1)\n  hi += Math.imul(ah7, bh1)\n  lo += Math.imul(al6, bl2)\n  mid += Math.imul(al6, bh2)\n  mid += Math.imul(ah6, bl2)\n  hi += Math.imul(ah6, bh2)\n  lo += Math.imul(al5, bl3)\n  mid += Math.imul(al5, bh3)\n  mid += Math.imul(ah5, bl3)\n  hi += Math.imul(ah5, bh3)\n  lo += Math.imul(al4, bl4)\n  mid += Math.imul(al4, bh4)\n  mid += Math.imul(ah4, bl4)\n  hi += Math.imul(ah4, bh4)\n  lo += Math.imul(al3, bl5)\n  mid += Math.imul(al3, bh5)\n  mid += Math.imul(ah3, bl5)\n  hi += Math.imul(ah3, bh5)\n  lo += Math.imul(al2, bl6)\n  mid += Math.imul(al2, bh6)\n  mid += Math.imul(ah2, bl6)\n  hi += Math.imul(ah2, bh6)\n  lo += Math.imul(al1, bl7)\n  mid += Math.imul(al1, bh7)\n  mid += Math.imul(ah1, bl7)\n  hi += Math.imul(ah1, bh7)\n  lo += Math.imul(al0, bl8)\n  mid += Math.imul(al0, bh8)\n  mid += Math.imul(ah0, bl8)\n  hi += Math.imul(ah0, bh8)\n  var w8 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w8 >>> 26)\n  w8 &= 0x3ffffff\n  /* k = 9 */\n  lo = Math.imul(al9, bl0)\n  mid = Math.imul(al9, bh0)\n  mid += Math.imul(ah9, bl0)\n  hi = Math.imul(ah9, bh0)\n  lo += Math.imul(al8, bl1)\n  mid += Math.imul(al8, bh1)\n  mid += Math.imul(ah8, bl1)\n  hi += Math.imul(ah8, bh1)\n  lo += Math.imul(al7, bl2)\n  mid += Math.imul(al7, bh2)\n  mid += Math.imul(ah7, bl2)\n  hi += Math.imul(ah7, bh2)\n  lo += Math.imul(al6, bl3)\n  mid += Math.imul(al6, bh3)\n  mid += Math.imul(ah6, bl3)\n  hi += Math.imul(ah6, bh3)\n  lo += Math.imul(al5, bl4)\n  mid += Math.imul(al5, bh4)\n  mid += Math.imul(ah5, bl4)\n  hi += Math.imul(ah5, bh4)\n  lo += Math.imul(al4, bl5)\n  mid += Math.imul(al4, bh5)\n  mid += Math.imul(ah4, bl5)\n  hi += Math.imul(ah4, bh5)\n  lo += Math.imul(al3, bl6)\n  mid += Math.imul(al3, bh6)\n  mid += Math.imul(ah3, bl6)\n  hi += Math.imul(ah3, bh6)\n  lo += Math.imul(al2, bl7)\n  mid += Math.imul(al2, bh7)\n  mid += Math.imul(ah2, bl7)\n  hi += Math.imul(ah2, bh7)\n  lo += Math.imul(al1, bl8)\n  mid += Math.imul(al1, bh8)\n  mid += Math.imul(ah1, bl8)\n  hi += Math.imul(ah1, bh8)\n  lo += Math.imul(al0, bl9)\n  mid += Math.imul(al0, bh9)\n  mid += Math.imul(ah0, bl9)\n  hi += Math.imul(ah0, bh9)\n  var w9 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w9 >>> 26)\n  w9 &= 0x3ffffff\n  /* k = 10 */\n  lo = Math.imul(al9, bl1)\n  mid = Math.imul(al9, bh1)\n  mid += Math.imul(ah9, bl1)\n  hi = Math.imul(ah9, bh1)\n  lo += Math.imul(al8, bl2)\n  mid += Math.imul(al8, bh2)\n  mid += Math.imul(ah8, bl2)\n  hi += Math.imul(ah8, bh2)\n  lo += Math.imul(al7, bl3)\n  mid += Math.imul(al7, bh3)\n  mid += Math.imul(ah7, bl3)\n  hi += Math.imul(ah7, bh3)\n  lo += Math.imul(al6, bl4)\n  mid += Math.imul(al6, bh4)\n  mid += Math.imul(ah6, bl4)\n  hi += Math.imul(ah6, bh4)\n  lo += Math.imul(al5, bl5)\n  mid += Math.imul(al5, bh5)\n  mid += Math.imul(ah5, bl5)\n  hi += Math.imul(ah5, bh5)\n  lo += Math.imul(al4, bl6)\n  mid += Math.imul(al4, bh6)\n  mid += Math.imul(ah4, bl6)\n  hi += Math.imul(ah4, bh6)\n  lo += Math.imul(al3, bl7)\n  mid += Math.imul(al3, bh7)\n  mid += Math.imul(ah3, bl7)\n  hi += Math.imul(ah3, bh7)\n  lo += Math.imul(al2, bl8)\n  mid += Math.imul(al2, bh8)\n  mid += Math.imul(ah2, bl8)\n  hi += Math.imul(ah2, bh8)\n  lo += Math.imul(al1, bl9)\n  mid += Math.imul(al1, bh9)\n  mid += Math.imul(ah1, bl9)\n  hi += Math.imul(ah1, bh9)\n  var w10 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w10 >>> 26)\n  w10 &= 0x3ffffff\n  /* k = 11 */\n  lo = Math.imul(al9, bl2)\n  mid = Math.imul(al9, bh2)\n  mid += Math.imul(ah9, bl2)\n  hi = Math.imul(ah9, bh2)\n  lo += Math.imul(al8, bl3)\n  mid += Math.imul(al8, bh3)\n  mid += Math.imul(ah8, bl3)\n  hi += Math.imul(ah8, bh3)\n  lo += Math.imul(al7, bl4)\n  mid += Math.imul(al7, bh4)\n  mid += Math.imul(ah7, bl4)\n  hi += Math.imul(ah7, bh4)\n  lo += Math.imul(al6, bl5)\n  mid += Math.imul(al6, bh5)\n  mid += Math.imul(ah6, bl5)\n  hi += Math.imul(ah6, bh5)\n  lo += Math.imul(al5, bl6)\n  mid += Math.imul(al5, bh6)\n  mid += Math.imul(ah5, bl6)\n  hi += Math.imul(ah5, bh6)\n  lo += Math.imul(al4, bl7)\n  mid += Math.imul(al4, bh7)\n  mid += Math.imul(ah4, bl7)\n  hi += Math.imul(ah4, bh7)\n  lo += Math.imul(al3, bl8)\n  mid += Math.imul(al3, bh8)\n  mid += Math.imul(ah3, bl8)\n  hi += Math.imul(ah3, bh8)\n  lo += Math.imul(al2, bl9)\n  mid += Math.imul(al2, bh9)\n  mid += Math.imul(ah2, bl9)\n  hi += Math.imul(ah2, bh9)\n  var w11 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w11 >>> 26)\n  w11 &= 0x3ffffff\n  /* k = 12 */\n  lo = Math.imul(al9, bl3)\n  mid = Math.imul(al9, bh3)\n  mid += Math.imul(ah9, bl3)\n  hi = Math.imul(ah9, bh3)\n  lo += Math.imul(al8, bl4)\n  mid += Math.imul(al8, bh4)\n  mid += Math.imul(ah8, bl4)\n  hi += Math.imul(ah8, bh4)\n  lo += Math.imul(al7, bl5)\n  mid += Math.imul(al7, bh5)\n  mid += Math.imul(ah7, bl5)\n  hi += Math.imul(ah7, bh5)\n  lo += Math.imul(al6, bl6)\n  mid += Math.imul(al6, bh6)\n  mid += Math.imul(ah6, bl6)\n  hi += Math.imul(ah6, bh6)\n  lo += Math.imul(al5, bl7)\n  mid += Math.imul(al5, bh7)\n  mid += Math.imul(ah5, bl7)\n  hi += Math.imul(ah5, bh7)\n  lo += Math.imul(al4, bl8)\n  mid += Math.imul(al4, bh8)\n  mid += Math.imul(ah4, bl8)\n  hi += Math.imul(ah4, bh8)\n  lo += Math.imul(al3, bl9)\n  mid += Math.imul(al3, bh9)\n  mid += Math.imul(ah3, bl9)\n  hi += Math.imul(ah3, bh9)\n  var w12 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w12 >>> 26)\n  w12 &= 0x3ffffff\n  /* k = 13 */\n  lo = Math.imul(al9, bl4)\n  mid = Math.imul(al9, bh4)\n  mid += Math.imul(ah9, bl4)\n  hi = Math.imul(ah9, bh4)\n  lo += Math.imul(al8, bl5)\n  mid += Math.imul(al8, bh5)\n  mid += Math.imul(ah8, bl5)\n  hi += Math.imul(ah8, bh5)\n  lo += Math.imul(al7, bl6)\n  mid += Math.imul(al7, bh6)\n  mid += Math.imul(ah7, bl6)\n  hi += Math.imul(ah7, bh6)\n  lo += Math.imul(al6, bl7)\n  mid += Math.imul(al6, bh7)\n  mid += Math.imul(ah6, bl7)\n  hi += Math.imul(ah6, bh7)\n  lo += Math.imul(al5, bl8)\n  mid += Math.imul(al5, bh8)\n  mid += Math.imul(ah5, bl8)\n  hi += Math.imul(ah5, bh8)\n  lo += Math.imul(al4, bl9)\n  mid += Math.imul(al4, bh9)\n  mid += Math.imul(ah4, bl9)\n  hi += Math.imul(ah4, bh9)\n  var w13 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w13 >>> 26)\n  w13 &= 0x3ffffff\n  /* k = 14 */\n  lo = Math.imul(al9, bl5)\n  mid = Math.imul(al9, bh5)\n  mid += Math.imul(ah9, bl5)\n  hi = Math.imul(ah9, bh5)\n  lo += Math.imul(al8, bl6)\n  mid += Math.imul(al8, bh6)\n  mid += Math.imul(ah8, bl6)\n  hi += Math.imul(ah8, bh6)\n  lo += Math.imul(al7, bl7)\n  mid += Math.imul(al7, bh7)\n  mid += Math.imul(ah7, bl7)\n  hi += Math.imul(ah7, bh7)\n  lo += Math.imul(al6, bl8)\n  mid += Math.imul(al6, bh8)\n  mid += Math.imul(ah6, bl8)\n  hi += Math.imul(ah6, bh8)\n  lo += Math.imul(al5, bl9)\n  mid += Math.imul(al5, bh9)\n  mid += Math.imul(ah5, bl9)\n  hi += Math.imul(ah5, bh9)\n  var w14 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w14 >>> 26)\n  w14 &= 0x3ffffff\n  /* k = 15 */\n  lo = Math.imul(al9, bl6)\n  mid = Math.imul(al9, bh6)\n  mid += Math.imul(ah9, bl6)\n  hi = Math.imul(ah9, bh6)\n  lo += Math.imul(al8, bl7)\n  mid += Math.imul(al8, bh7)\n  mid += Math.imul(ah8, bl7)\n  hi += Math.imul(ah8, bh7)\n  lo += Math.imul(al7, bl8)\n  mid += Math.imul(al7, bh8)\n  mid += Math.imul(ah7, bl8)\n  hi += Math.imul(ah7, bh8)\n  lo += Math.imul(al6, bl9)\n  mid += Math.imul(al6, bh9)\n  mid += Math.imul(ah6, bl9)\n  hi += Math.imul(ah6, bh9)\n  var w15 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w15 >>> 26)\n  w15 &= 0x3ffffff\n  /* k = 16 */\n  lo = Math.imul(al9, bl7)\n  mid = Math.imul(al9, bh7)\n  mid += Math.imul(ah9, bl7)\n  hi = Math.imul(ah9, bh7)\n  lo += Math.imul(al8, bl8)\n  mid += Math.imul(al8, bh8)\n  mid += Math.imul(ah8, bl8)\n  hi += Math.imul(ah8, bh8)\n  lo += Math.imul(al7, bl9)\n  mid += Math.imul(al7, bh9)\n  mid += Math.imul(ah7, bl9)\n  hi += Math.imul(ah7, bh9)\n  var w16 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w16 >>> 26)\n  w16 &= 0x3ffffff\n  /* k = 17 */\n  lo = Math.imul(al9, bl8)\n  mid = Math.imul(al9, bh8)\n  mid += Math.imul(ah9, bl8)\n  hi = Math.imul(ah9, bh8)\n  lo += Math.imul(al8, bl9)\n  mid += Math.imul(al8, bh9)\n  mid += Math.imul(ah8, bl9)\n  hi += Math.imul(ah8, bh9)\n  var w17 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w17 >>> 26)\n  w17 &= 0x3ffffff\n  /* k = 18 */\n  lo = Math.imul(al9, bl9)\n  mid = Math.imul(al9, bh9)\n  mid += Math.imul(ah9, bl9)\n  hi = Math.imul(ah9, bh9)\n  var w18 = c + lo + ((mid & 0x1fff) << 13)\n  c = hi + (mid >>> 13) + (w18 >>> 26)\n  w18 &= 0x3ffffff\n  o[0] = w0\n  o[1] = w1\n  o[2] = w2\n  o[3] = w3\n  o[4] = w4\n  o[5] = w5\n  o[6] = w6\n  o[7] = w7\n  o[8] = w8\n  o[9] = w9\n  o[10] = w10\n  o[11] = w11\n  o[12] = w12\n  o[13] = w13\n  o[14] = w14\n  o[15] = w15\n  o[16] = w16\n  o[17] = w17\n  o[18] = w18\n  if (c !== 0) {\n    o[19] = c\n    out.length++\n  }\n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/bn/optimized.js\n// module id = 1227\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/bn/optimized.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar BN = __webpack_require__(208)\nvar ECPoint = __webpack_require__(533)\nvar ECJPoint = __webpack_require__(532)\n\nfunction ECPointG () {\n  this.x = BN.fromBuffer(Buffer.from('79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798', 'hex'))\n  this.y = BN.fromBuffer(Buffer.from('483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8', 'hex'))\n  this.inf = false\n\n  this._precompute()\n}\n\nECPointG.prototype._precompute = function () {\n  var ecpoint = new ECPoint(this.x, this.y)\n\n  var dstep = 4\n  var points = new Array(1 + Math.ceil(257 / dstep))\n  var acc = points[0] = ecpoint\n  for (var i = 1; i < points.length; ++i) {\n    for (var j = 0; j < dstep; j++) acc = acc.dbl()\n    points[i] = acc\n  }\n\n  this.precomputed = {\n    naf: ecpoint._getNAFPoints(7),\n    doubles: {\n      step: dstep,\n      points: points,\n      negpoints: points.map(function (p) { return p.neg() })\n    }\n  }\n}\n\nECPointG.prototype.mul = function (num) {\n  // Algorithm 3.42 Fixed-base NAF windowing method for point multiplication\n  var step = this.precomputed.doubles.step\n  var points = this.precomputed.doubles.points\n  var negpoints = this.precomputed.doubles.negpoints\n\n  var naf = num.getNAF(1)\n  var I = ((1 << (step + 1)) - (step % 2 === 0 ? 2 : 1)) / 3\n\n  // Translate into more windowed form\n  var repr = []\n  for (var j = 0; j < naf.length; j += step) {\n    var nafW = 0\n    for (var k = j + step - 1; k >= j; k--) nafW = (nafW << 1) + naf[k]\n    repr.push(nafW)\n  }\n\n  var a = new ECJPoint(null, null, null)\n  var b = new ECJPoint(null, null, null)\n  for (var i = I; i > 0; i--) {\n    for (var jj = 0; jj < repr.length; jj++) {\n      if (repr[jj] === i) {\n        b = b.mixedAdd(points[jj])\n      } else if (repr[jj] === -i) {\n        b = b.mixedAdd(negpoints[jj])\n      }\n    }\n\n    a = a.add(b)\n  }\n\n  return ECPoint.fromECJPoint(a)\n}\n\nECPointG.prototype.mulAdd = function (k1, p2, k2) {\n  var nafPointsP1 = this.precomputed.naf\n  var nafPointsP2 = p2._getNAFPoints1()\n  var wnd = [nafPointsP1.points, nafPointsP2.points]\n  var naf = [k1.getNAF(nafPointsP1.wnd), k2.getNAF(nafPointsP2.wnd)]\n\n  var acc = new ECJPoint(null, null, null)\n  var tmp = [null, null]\n  for (var i = Math.max(naf[0].length, naf[1].length); i >= 0; i--) {\n    var k = 0\n\n    for (; i >= 0; ++k, --i) {\n      tmp[0] = naf[0][i] | 0\n      tmp[1] = naf[1][i] | 0\n\n      if (tmp[0] !== 0 || tmp[1] !== 0) break\n    }\n\n    if (i >= 0) k += 1\n    acc = acc.dblp(k)\n\n    if (i < 0) break\n\n    for (var jj = 0; jj < 2; jj++) {\n      var z = tmp[jj]\n      var p\n      if (z === 0) {\n        continue\n      } else if (z > 0) {\n        p = wnd[jj][z >> 1]\n      } else if (z < 0) {\n        p = wnd[jj][-z >> 1].neg()\n      }\n\n      // hack: ECPoint detection\n      if (p.z === undefined) {\n        acc = acc.mixedAdd(p)\n      } else {\n        acc = acc.add(p)\n      }\n    }\n  }\n\n  return acc\n}\n\nmodule.exports = new ECPointG()\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/ecpointg.js\n// module id = 1228\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/ecpointg.js")},function(module,exports,__webpack_require__){"use strict";eval("\nvar Buffer = __webpack_require__(1).Buffer\nvar createHash = __webpack_require__(59)\nvar HmacDRBG = __webpack_require__(815)\nvar messages = __webpack_require__(307)\nvar BN = __webpack_require__(208)\nvar ECPoint = __webpack_require__(533)\nvar g = __webpack_require__(1228)\n\nexports.privateKeyVerify = function (privateKey) {\n  var bn = BN.fromBuffer(privateKey)\n  return !(bn.isOverflow() || bn.isZero())\n}\n\nexports.privateKeyExport = function (privateKey, compressed) {\n  var d = BN.fromBuffer(privateKey)\n  if (d.isOverflow() || d.isZero()) throw new Error(messages.EC_PRIVATE_KEY_EXPORT_DER_FAIL)\n\n  return g.mul(d).toPublicKey(compressed)\n}\n\nexports.privateKeyNegate = function (privateKey) {\n  var bn = BN.fromBuffer(privateKey)\n  if (bn.isZero()) return Buffer.alloc(32)\n\n  if (bn.ucmp(BN.n) > 0) bn.isub(BN.n)\n  return BN.n.sub(bn).toBuffer()\n}\n\nexports.privateKeyModInverse = function (privateKey) {\n  var bn = BN.fromBuffer(privateKey)\n  if (bn.isOverflow() || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_RANGE_INVALID)\n\n  return bn.uinvm().toBuffer()\n}\n\nexports.privateKeyTweakAdd = function (privateKey, tweak) {\n  var bn = BN.fromBuffer(tweak)\n  if (bn.isOverflow()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  bn.iadd(BN.fromBuffer(privateKey))\n  if (bn.isOverflow()) bn.isub(BN.n)\n  if (bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_ADD_FAIL)\n\n  return bn.toBuffer()\n}\n\nexports.privateKeyTweakMul = function (privateKey, tweak) {\n  var bn = BN.fromBuffer(tweak)\n  if (bn.isOverflow() || bn.isZero()) throw new Error(messages.EC_PRIVATE_KEY_TWEAK_MUL_FAIL)\n\n  var d = BN.fromBuffer(privateKey)\n  return bn.umul(d).ureduce().toBuffer()\n}\n\nexports.publicKeyCreate = function (privateKey, compressed) {\n  var d = BN.fromBuffer(privateKey)\n  if (d.isOverflow() || d.isZero()) throw new Error(messages.EC_PUBLIC_KEY_CREATE_FAIL)\n\n  return g.mul(d).toPublicKey(compressed)\n}\n\nexports.publicKeyConvert = function (publicKey, compressed) {\n  var point = ECPoint.fromPublicKey(publicKey)\n  if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  return point.toPublicKey(compressed)\n}\n\nexports.publicKeyVerify = function (publicKey) {\n  return ECPoint.fromPublicKey(publicKey) !== null\n}\n\nexports.publicKeyTweakAdd = function (publicKey, tweak, compressed) {\n  var point = ECPoint.fromPublicKey(publicKey)\n  if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = BN.fromBuffer(tweak)\n  if (tweak.isOverflow()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_ADD_FAIL)\n\n  return g.mul(tweak).add(point).toPublicKey(compressed)\n}\n\nexports.publicKeyTweakMul = function (publicKey, tweak, compressed) {\n  var point = ECPoint.fromPublicKey(publicKey)\n  if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  tweak = BN.fromBuffer(tweak)\n  if (tweak.isOverflow() || tweak.isZero()) throw new Error(messages.EC_PUBLIC_KEY_TWEAK_MUL_FAIL)\n\n  return point.mul(tweak).toPublicKey(compressed)\n}\n\nexports.publicKeyCombine = function (publicKeys, compressed) {\n  var points = new Array(publicKeys.length)\n  for (var i = 0; i < publicKeys.length; ++i) {\n    points[i] = ECPoint.fromPublicKey(publicKeys[i])\n    if (points[i] === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n  }\n\n  var point = points[0]\n  for (var j = 1; j < points.length; ++j) point = point.add(points[j])\n  if (point.inf) throw new Error(messages.EC_PUBLIC_KEY_COMBINE_FAIL)\n\n  return point.toPublicKey(compressed)\n}\n\nexports.signatureNormalize = function (signature) {\n  var r = BN.fromBuffer(signature.slice(0, 32))\n  var s = BN.fromBuffer(signature.slice(32, 64))\n  if (r.isOverflow() || s.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  var result = Buffer.from(signature)\n  if (s.isHigh()) BN.n.sub(s).toBuffer().copy(result, 32)\n\n  return result\n}\n\nexports.signatureExport = function (signature) {\n  var r = signature.slice(0, 32)\n  var s = signature.slice(32, 64)\n  if (BN.fromBuffer(r).isOverflow() || BN.fromBuffer(s).isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  return { r: r, s: s }\n}\n\nexports.signatureImport = function (sigObj) {\n  var r = BN.fromBuffer(sigObj.r)\n  if (r.isOverflow()) r = BN.fromNumber(0)\n\n  var s = BN.fromBuffer(sigObj.s)\n  if (s.isOverflow()) s = BN.fromNumber(0)\n\n  return Buffer.concat([r.toBuffer(), s.toBuffer()])\n}\n\nexports.sign = function (message, privateKey, noncefn, data) {\n  var d = BN.fromBuffer(privateKey)\n  if (d.isOverflow() || d.isZero()) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n  if (noncefn === null) {\n    var drbg = new HmacDRBG('sha256', privateKey, message, data)\n    noncefn = function () { return drbg.generate(32) }\n  }\n\n  var bnMessage = BN.fromBuffer(message)\n  for (var count = 0; ; ++count) {\n    var nonce = noncefn(message, privateKey, null, data, count)\n    if (!Buffer.isBuffer(nonce) || nonce.length !== 32) throw new Error(messages.ECDSA_SIGN_FAIL)\n\n    var k = BN.fromBuffer(nonce)\n    if (k.isOverflow() || k.isZero()) continue\n\n    var kp = g.mul(k)\n    var r = kp.x.fireduce()\n    if (r.isZero()) continue\n\n    var s = k.uinvm().umul(r.umul(d).ureduce().iadd(bnMessage).fireduce()).ureduce()\n    if (s.isZero()) continue\n\n    var recovery = (kp.x.ucmp(r) !== 0 ? 2 : 0) | (kp.y.isOdd() ? 1 : 0)\n    if (s.isHigh()) {\n      s = BN.n.sub(s)\n      recovery ^= 1\n    }\n\n    return {\n      signature: Buffer.concat([r.toBuffer(), s.toBuffer()]),\n      recovery: recovery\n    }\n  }\n}\n\nexports.verify = function (message, signature, publicKey) {\n  var sigr = BN.fromBuffer(signature.slice(0, 32))\n  var sigs = BN.fromBuffer(signature.slice(32, 64))\n  if (sigr.isOverflow() || sigs.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  if (sigs.isHigh() || sigr.isZero() || sigs.isZero()) return false\n\n  var pub = ECPoint.fromPublicKey(publicKey)\n  if (pub === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  var sinv = sigs.uinvm()\n  var u1 = sinv.umul(BN.fromBuffer(message)).ureduce()\n  var u2 = sinv.umul(sigr).ureduce()\n  var point = g.mulAdd(u1, pub, u2)\n  if (point.inf) return false\n\n  // return ECPoint.fromECJPoint(point).x.fireduce().ucmp(sigr) === 0\n  // Inversion-free\n  var z2 = point.z.redSqr()\n  if (sigr.redMul(z2).ucmp(point.x) === 0) return true\n  if (sigr.ucmp(BN.psn) >= 0) return false\n\n  return sigr.iadd(BN.psn).redMul(z2).ucmp(point.x) === 0\n}\n\nexports.recover = function (message, signature, recovery, compressed) {\n  var sigr = BN.fromBuffer(signature.slice(0, 32))\n  var sigs = BN.fromBuffer(signature.slice(32, 64))\n  if (sigr.isOverflow() || sigs.isOverflow()) throw new Error(messages.ECDSA_SIGNATURE_PARSE_FAIL)\n\n  do {\n    if (sigr.isZero() || sigs.isZero()) break\n\n    var kpx = sigr\n    if (recovery >> 1) {\n      if (kpx.ucmp(BN.psn) >= 0) break\n      kpx = sigr.add(BN.n)\n    }\n\n    var kpPublicKey = Buffer.concat([Buffer.from([0x02 + (recovery & 0x01)]), kpx.toBuffer()])\n    var kp = ECPoint.fromPublicKey(kpPublicKey)\n    if (kp === null) break\n\n    var rInv = sigr.uinvm()\n    var s1 = BN.n.sub(BN.fromBuffer(message)).umul(rInv).ureduce()\n    var s2 = sigs.umul(rInv).ureduce()\n    var point = ECPoint.fromECJPoint(g.mulAdd(s1, kp, s2))\n    return point.toPublicKey(compressed)\n  } while (false)\n\n  throw new Error(messages.ECDSA_RECOVER_FAIL)\n}\n\nexports.ecdh = function (publicKey, privateKey) {\n  var shared = exports.ecdhUnsafe(publicKey, privateKey, true)\n  return createHash('sha256').update(shared).digest()\n}\n\nexports.ecdhUnsafe = function (publicKey, privateKey, compressed) {\n  var point = ECPoint.fromPublicKey(publicKey)\n  if (point === null) throw new Error(messages.EC_PUBLIC_KEY_PARSE_FAIL)\n\n  var scalar = BN.fromBuffer(privateKey)\n  if (scalar.isOverflow() || scalar.isZero()) throw new Error(messages.ECDH_FAIL)\n\n  return point.mul(scalar).toPublicKey(compressed)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/secp256k1/lib/js/index.js\n// module id = 1229\n// module chunks = 0\n\n//# sourceURL=../node_modules/secp256k1/lib/js/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(process) {exports = module.exports = SemVer;\n\n// The debug function is excluded entirely from the minified version.\n/* nomin */ var debug;\n/* nomin */ if (typeof process === 'object' &&\n    /* nomin */ __webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}) &&\n    /* nomin */ __webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}).NODE_DEBUG &&\n    /* nomin */ /\\bsemver\\b/i.test(__webpack_require__.i({\"NODE_ENV\":\"production\",\"DC_NETWORK\":\"ropsten\",\"PUBLIC_URL\":\"\"}).NODE_DEBUG))\n  /* nomin */ debug = function() {\n    /* nomin */ var args = Array.prototype.slice.call(arguments, 0);\n    /* nomin */ args.unshift('SEMVER');\n    /* nomin */ console.log.apply(console, args);\n    /* nomin */ };\n/* nomin */ else\n  /* nomin */ debug = function() {};\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0';\n\nvar MAX_LENGTH = 256;\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16;\n\n// The actual regexps go on exports.re\nvar re = exports.re = [];\nvar src = exports.src = [];\nvar R = 0;\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\nvar NUMERICIDENTIFIER = R++;\nsrc[NUMERICIDENTIFIER] = '0|[1-9]\\\\d*';\nvar NUMERICIDENTIFIERLOOSE = R++;\nsrc[NUMERICIDENTIFIERLOOSE] = '[0-9]+';\n\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\nvar NONNUMERICIDENTIFIER = R++;\nsrc[NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-][a-zA-Z0-9-]*';\n\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\nvar MAINVERSION = R++;\nsrc[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\\\.' +\n                   '(' + src[NUMERICIDENTIFIER] + ')\\\\.' +\n                   '(' + src[NUMERICIDENTIFIER] + ')';\n\nvar MAINVERSIONLOOSE = R++;\nsrc[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n                        '(' + src[NUMERICIDENTIFIERLOOSE] + ')';\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\nvar PRERELEASEIDENTIFIER = R++;\nsrc[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +\n                            '|' + src[NONNUMERICIDENTIFIER] + ')';\n\nvar PRERELEASEIDENTIFIERLOOSE = R++;\nsrc[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +\n                                 '|' + src[NONNUMERICIDENTIFIER] + ')';\n\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\nvar PRERELEASE = R++;\nsrc[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +\n                  '(?:\\\\.' + src[PRERELEASEIDENTIFIER] + ')*))';\n\nvar PRERELEASELOOSE = R++;\nsrc[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +\n                       '(?:\\\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\nvar BUILDIDENTIFIER = R++;\nsrc[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\nvar BUILD = R++;\nsrc[BUILD] = '(?:\\\\+(' + src[BUILDIDENTIFIER] +\n             '(?:\\\\.' + src[BUILDIDENTIFIER] + ')*))';\n\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups.  The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\nvar FULL = R++;\nvar FULLPLAIN = 'v?' + src[MAINVERSION] +\n                src[PRERELEASE] + '?' +\n                src[BUILD] + '?';\n\nsrc[FULL] = '^' + FULLPLAIN + '$';\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\nvar LOOSEPLAIN = '[v=\\\\s]*' + src[MAINVERSIONLOOSE] +\n                 src[PRERELEASELOOSE] + '?' +\n                 src[BUILD] + '?';\n\nvar LOOSE = R++;\nsrc[LOOSE] = '^' + LOOSEPLAIN + '$';\n\nvar GTLT = R++;\nsrc[GTLT] = '((?:<|>)?=?)';\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\nvar XRANGEIDENTIFIERLOOSE = R++;\nsrc[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*';\nvar XRANGEIDENTIFIER = R++;\nsrc[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\\\*';\n\nvar XRANGEPLAIN = R++;\nsrc[XRANGEPLAIN] = '[v=\\\\s]*(' + src[XRANGEIDENTIFIER] + ')' +\n                   '(?:\\\\.(' + src[XRANGEIDENTIFIER] + ')' +\n                   '(?:\\\\.(' + src[XRANGEIDENTIFIER] + ')' +\n                   '(?:' + src[PRERELEASE] + ')?' +\n                   src[BUILD] + '?' +\n                   ')?)?';\n\nvar XRANGEPLAINLOOSE = R++;\nsrc[XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +\n                        '(?:\\\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +\n                        '(?:\\\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +\n                        '(?:' + src[PRERELEASELOOSE] + ')?' +\n                        src[BUILD] + '?' +\n                        ')?)?';\n\nvar XRANGE = R++;\nsrc[XRANGE] = '^' + src[GTLT] + '\\\\s*' + src[XRANGEPLAIN] + '$';\nvar XRANGELOOSE = R++;\nsrc[XRANGELOOSE] = '^' + src[GTLT] + '\\\\s*' + src[XRANGEPLAINLOOSE] + '$';\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\nvar COERCE = R++;\nsrc[COERCE] = '(?:^|[^\\\\d])' +\n              '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n              '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n              '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n              '(?:$|[^\\\\d])';\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\nvar LONETILDE = R++;\nsrc[LONETILDE] = '(?:~>?)';\n\nvar TILDETRIM = R++;\nsrc[TILDETRIM] = '(\\\\s*)' + src[LONETILDE] + '\\\\s+';\nre[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');\nvar tildeTrimReplace = '$1~';\n\nvar TILDE = R++;\nsrc[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';\nvar TILDELOOSE = R++;\nsrc[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\nvar LONECARET = R++;\nsrc[LONECARET] = '(?:\\\\^)';\n\nvar CARETTRIM = R++;\nsrc[CARETTRIM] = '(\\\\s*)' + src[LONECARET] + '\\\\s+';\nre[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');\nvar caretTrimReplace = '$1^';\n\nvar CARET = R++;\nsrc[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';\nvar CARETLOOSE = R++;\nsrc[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\nvar COMPARATORLOOSE = R++;\nsrc[COMPARATORLOOSE] = '^' + src[GTLT] + '\\\\s*(' + LOOSEPLAIN + ')$|^$';\nvar COMPARATOR = R++;\nsrc[COMPARATOR] = '^' + src[GTLT] + '\\\\s*(' + FULLPLAIN + ')$|^$';\n\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\nvar COMPARATORTRIM = R++;\nsrc[COMPARATORTRIM] = '(\\\\s*)' + src[GTLT] +\n                      '\\\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';\n\n// this one has to use the /g flag\nre[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');\nvar comparatorTrimReplace = '$1$2$3';\n\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\nvar HYPHENRANGE = R++;\nsrc[HYPHENRANGE] = '^\\\\s*(' + src[XRANGEPLAIN] + ')' +\n                   '\\\\s+-\\\\s+' +\n                   '(' + src[XRANGEPLAIN] + ')' +\n                   '\\\\s*$';\n\nvar HYPHENRANGELOOSE = R++;\nsrc[HYPHENRANGELOOSE] = '^\\\\s*(' + src[XRANGEPLAINLOOSE] + ')' +\n                        '\\\\s+-\\\\s+' +\n                        '(' + src[XRANGEPLAINLOOSE] + ')' +\n                        '\\\\s*$';\n\n// Star ranges basically just allow anything at all.\nvar STAR = R++;\nsrc[STAR] = '(<|>)?=?\\\\s*\\\\*';\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n  debug(i, src[i]);\n  if (!re[i])\n    re[i] = new RegExp(src[i]);\n}\n\nexports.parse = parse;\nfunction parse(version, loose) {\n  if (version instanceof SemVer)\n    return version;\n\n  if (typeof version !== 'string')\n    return null;\n\n  if (version.length > MAX_LENGTH)\n    return null;\n\n  var r = loose ? re[LOOSE] : re[FULL];\n  if (!r.test(version))\n    return null;\n\n  try {\n    return new SemVer(version, loose);\n  } catch (er) {\n    return null;\n  }\n}\n\nexports.valid = valid;\nfunction valid(version, loose) {\n  var v = parse(version, loose);\n  return v ? v.version : null;\n}\n\n\nexports.clean = clean;\nfunction clean(version, loose) {\n  var s = parse(version.trim().replace(/^[=v]+/, ''), loose);\n  return s ? s.version : null;\n}\n\nexports.SemVer = SemVer;\n\nfunction SemVer(version, loose) {\n  if (version instanceof SemVer) {\n    if (version.loose === loose)\n      return version;\n    else\n      version = version.version;\n  } else if (typeof version !== 'string') {\n    throw new TypeError('Invalid Version: ' + version);\n  }\n\n  if (version.length > MAX_LENGTH)\n    throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n\n  if (!(this instanceof SemVer))\n    return new SemVer(version, loose);\n\n  debug('SemVer', version, loose);\n  this.loose = loose;\n  var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);\n\n  if (!m)\n    throw new TypeError('Invalid Version: ' + version);\n\n  this.raw = version;\n\n  // these are actually numbers\n  this.major = +m[1];\n  this.minor = +m[2];\n  this.patch = +m[3];\n\n  if (this.major > MAX_SAFE_INTEGER || this.major < 0)\n    throw new TypeError('Invalid major version')\n\n  if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)\n    throw new TypeError('Invalid minor version')\n\n  if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)\n    throw new TypeError('Invalid patch version')\n\n  // numberify any prerelease numeric ids\n  if (!m[4])\n    this.prerelease = [];\n  else\n    this.prerelease = m[4].split('.').map(function(id) {\n      if (/^[0-9]+$/.test(id)) {\n        var num = +id;\n        if (num >= 0 && num < MAX_SAFE_INTEGER)\n          return num;\n      }\n      return id;\n    });\n\n  this.build = m[5] ? m[5].split('.') : [];\n  this.format();\n}\n\nSemVer.prototype.format = function() {\n  this.version = this.major + '.' + this.minor + '.' + this.patch;\n  if (this.prerelease.length)\n    this.version += '-' + this.prerelease.join('.');\n  return this.version;\n};\n\nSemVer.prototype.toString = function() {\n  return this.version;\n};\n\nSemVer.prototype.compare = function(other) {\n  debug('SemVer.compare', this.version, this.loose, other);\n  if (!(other instanceof SemVer))\n    other = new SemVer(other, this.loose);\n\n  return this.compareMain(other) || this.comparePre(other);\n};\n\nSemVer.prototype.compareMain = function(other) {\n  if (!(other instanceof SemVer))\n    other = new SemVer(other, this.loose);\n\n  return compareIdentifiers(this.major, other.major) ||\n         compareIdentifiers(this.minor, other.minor) ||\n         compareIdentifiers(this.patch, other.patch);\n};\n\nSemVer.prototype.comparePre = function(other) {\n  if (!(other instanceof SemVer))\n    other = new SemVer(other, this.loose);\n\n  // NOT having a prerelease is > having one\n  if (this.prerelease.length && !other.prerelease.length)\n    return -1;\n  else if (!this.prerelease.length && other.prerelease.length)\n    return 1;\n  else if (!this.prerelease.length && !other.prerelease.length)\n    return 0;\n\n  var i = 0;\n  do {\n    var a = this.prerelease[i];\n    var b = other.prerelease[i];\n    debug('prerelease compare', i, a, b);\n    if (a === undefined && b === undefined)\n      return 0;\n    else if (b === undefined)\n      return 1;\n    else if (a === undefined)\n      return -1;\n    else if (a === b)\n      continue;\n    else\n      return compareIdentifiers(a, b);\n  } while (++i);\n};\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function(release, identifier) {\n  switch (release) {\n    case 'premajor':\n      this.prerelease.length = 0;\n      this.patch = 0;\n      this.minor = 0;\n      this.major++;\n      this.inc('pre', identifier);\n      break;\n    case 'preminor':\n      this.prerelease.length = 0;\n      this.patch = 0;\n      this.minor++;\n      this.inc('pre', identifier);\n      break;\n    case 'prepatch':\n      // If this is already a prerelease, it will bump to the next version\n      // drop any prereleases that might already exist, since they are not\n      // relevant at this point.\n      this.prerelease.length = 0;\n      this.inc('patch', identifier);\n      this.inc('pre', identifier);\n      break;\n    // If the input is a non-prerelease version, this acts the same as\n    // prepatch.\n    case 'prerelease':\n      if (this.prerelease.length === 0)\n        this.inc('patch', identifier);\n      this.inc('pre', identifier);\n      break;\n\n    case 'major':\n      // If this is a pre-major version, bump up to the same major version.\n      // Otherwise increment major.\n      // 1.0.0-5 bumps to 1.0.0\n      // 1.1.0 bumps to 2.0.0\n      if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)\n        this.major++;\n      this.minor = 0;\n      this.patch = 0;\n      this.prerelease = [];\n      break;\n    case 'minor':\n      // If this is a pre-minor version, bump up to the same minor version.\n      // Otherwise increment minor.\n      // 1.2.0-5 bumps to 1.2.0\n      // 1.2.1 bumps to 1.3.0\n      if (this.patch !== 0 || this.prerelease.length === 0)\n        this.minor++;\n      this.patch = 0;\n      this.prerelease = [];\n      break;\n    case 'patch':\n      // If this is not a pre-release version, it will increment the patch.\n      // If it is a pre-release it will bump up to the same patch version.\n      // 1.2.0-5 patches to 1.2.0\n      // 1.2.0 patches to 1.2.1\n      if (this.prerelease.length === 0)\n        this.patch++;\n      this.prerelease = [];\n      break;\n    // This probably shouldn't be used publicly.\n    // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n    case 'pre':\n      if (this.prerelease.length === 0)\n        this.prerelease = [0];\n      else {\n        var i = this.prerelease.length;\n        while (--i >= 0) {\n          if (typeof this.prerelease[i] === 'number') {\n            this.prerelease[i]++;\n            i = -2;\n          }\n        }\n        if (i === -1) // didn't increment anything\n          this.prerelease.push(0);\n      }\n      if (identifier) {\n        // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n        // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n        if (this.prerelease[0] === identifier) {\n          if (isNaN(this.prerelease[1]))\n            this.prerelease = [identifier, 0];\n        } else\n          this.prerelease = [identifier, 0];\n      }\n      break;\n\n    default:\n      throw new Error('invalid increment argument: ' + release);\n  }\n  this.format();\n  this.raw = this.version;\n  return this;\n};\n\nexports.inc = inc;\nfunction inc(version, release, loose, identifier) {\n  if (typeof(loose) === 'string') {\n    identifier = loose;\n    loose = undefined;\n  }\n\n  try {\n    return new SemVer(version, loose).inc(release, identifier).version;\n  } catch (er) {\n    return null;\n  }\n}\n\nexports.diff = diff;\nfunction diff(version1, version2) {\n  if (eq(version1, version2)) {\n    return null;\n  } else {\n    var v1 = parse(version1);\n    var v2 = parse(version2);\n    if (v1.prerelease.length || v2.prerelease.length) {\n      for (var key in v1) {\n        if (key === 'major' || key === 'minor' || key === 'patch') {\n          if (v1[key] !== v2[key]) {\n            return 'pre'+key;\n          }\n        }\n      }\n      return 'prerelease';\n    }\n    for (var key in v1) {\n      if (key === 'major' || key === 'minor' || key === 'patch') {\n        if (v1[key] !== v2[key]) {\n          return key;\n        }\n      }\n    }\n  }\n}\n\nexports.compareIdentifiers = compareIdentifiers;\n\nvar numeric = /^[0-9]+$/;\nfunction compareIdentifiers(a, b) {\n  var anum = numeric.test(a);\n  var bnum = numeric.test(b);\n\n  if (anum && bnum) {\n    a = +a;\n    b = +b;\n  }\n\n  return (anum && !bnum) ? -1 :\n         (bnum && !anum) ? 1 :\n         a < b ? -1 :\n         a > b ? 1 :\n         0;\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers;\nfunction rcompareIdentifiers(a, b) {\n  return compareIdentifiers(b, a);\n}\n\nexports.major = major;\nfunction major(a, loose) {\n  return new SemVer(a, loose).major;\n}\n\nexports.minor = minor;\nfunction minor(a, loose) {\n  return new SemVer(a, loose).minor;\n}\n\nexports.patch = patch;\nfunction patch(a, loose) {\n  return new SemVer(a, loose).patch;\n}\n\nexports.compare = compare;\nfunction compare(a, b, loose) {\n  return new SemVer(a, loose).compare(new SemVer(b, loose));\n}\n\nexports.compareLoose = compareLoose;\nfunction compareLoose(a, b) {\n  return compare(a, b, true);\n}\n\nexports.rcompare = rcompare;\nfunction rcompare(a, b, loose) {\n  return compare(b, a, loose);\n}\n\nexports.sort = sort;\nfunction sort(list, loose) {\n  return list.sort(function(a, b) {\n    return exports.compare(a, b, loose);\n  });\n}\n\nexports.rsort = rsort;\nfunction rsort(list, loose) {\n  return list.sort(function(a, b) {\n    return exports.rcompare(a, b, loose);\n  });\n}\n\nexports.gt = gt;\nfunction gt(a, b, loose) {\n  return compare(a, b, loose) > 0;\n}\n\nexports.lt = lt;\nfunction lt(a, b, loose) {\n  return compare(a, b, loose) < 0;\n}\n\nexports.eq = eq;\nfunction eq(a, b, loose) {\n  return compare(a, b, loose) === 0;\n}\n\nexports.neq = neq;\nfunction neq(a, b, loose) {\n  return compare(a, b, loose) !== 0;\n}\n\nexports.gte = gte;\nfunction gte(a, b, loose) {\n  return compare(a, b, loose) >= 0;\n}\n\nexports.lte = lte;\nfunction lte(a, b, loose) {\n  return compare(a, b, loose) <= 0;\n}\n\nexports.cmp = cmp;\nfunction cmp(a, op, b, loose) {\n  var ret;\n  switch (op) {\n    case '===':\n      if (typeof a === 'object') a = a.version;\n      if (typeof b === 'object') b = b.version;\n      ret = a === b;\n      break;\n    case '!==':\n      if (typeof a === 'object') a = a.version;\n      if (typeof b === 'object') b = b.version;\n      ret = a !== b;\n      break;\n    case '': case '=': case '==': ret = eq(a, b, loose); break;\n    case '!=': ret = neq(a, b, loose); break;\n    case '>': ret = gt(a, b, loose); break;\n    case '>=': ret = gte(a, b, loose); break;\n    case '<': ret = lt(a, b, loose); break;\n    case '<=': ret = lte(a, b, loose); break;\n    default: throw new TypeError('Invalid operator: ' + op);\n  }\n  return ret;\n}\n\nexports.Comparator = Comparator;\nfunction Comparator(comp, loose) {\n  if (comp instanceof Comparator) {\n    if (comp.loose === loose)\n      return comp;\n    else\n      comp = comp.value;\n  }\n\n  if (!(this instanceof Comparator))\n    return new Comparator(comp, loose);\n\n  debug('comparator', comp, loose);\n  this.loose = loose;\n  this.parse(comp);\n\n  if (this.semver === ANY)\n    this.value = '';\n  else\n    this.value = this.operator + this.semver.version;\n\n  debug('comp', this);\n}\n\nvar ANY = {};\nComparator.prototype.parse = function(comp) {\n  var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];\n  var m = comp.match(r);\n\n  if (!m)\n    throw new TypeError('Invalid comparator: ' + comp);\n\n  this.operator = m[1];\n  if (this.operator === '=')\n    this.operator = '';\n\n  // if it literally is just '>' or '' then allow anything.\n  if (!m[2])\n    this.semver = ANY;\n  else\n    this.semver = new SemVer(m[2], this.loose);\n};\n\nComparator.prototype.toString = function() {\n  return this.value;\n};\n\nComparator.prototype.test = function(version) {\n  debug('Comparator.test', version, this.loose);\n\n  if (this.semver === ANY)\n    return true;\n\n  if (typeof version === 'string')\n    version = new SemVer(version, this.loose);\n\n  return cmp(version, this.operator, this.semver, this.loose);\n};\n\nComparator.prototype.intersects = function(comp, loose) {\n  if (!(comp instanceof Comparator)) {\n    throw new TypeError('a Comparator is required');\n  }\n\n  var rangeTmp;\n\n  if (this.operator === '') {\n    rangeTmp = new Range(comp.value, loose);\n    return satisfies(this.value, rangeTmp, loose);\n  } else if (comp.operator === '') {\n    rangeTmp = new Range(this.value, loose);\n    return satisfies(comp.semver, rangeTmp, loose);\n  }\n\n  var sameDirectionIncreasing =\n    (this.operator === '>=' || this.operator === '>') &&\n    (comp.operator === '>=' || comp.operator === '>');\n  var sameDirectionDecreasing =\n    (this.operator === '<=' || this.operator === '<') &&\n    (comp.operator === '<=' || comp.operator === '<');\n  var sameSemVer = this.semver.version === comp.semver.version;\n  var differentDirectionsInclusive =\n    (this.operator === '>=' || this.operator === '<=') &&\n    (comp.operator === '>=' || comp.operator === '<=');\n  var oppositeDirectionsLessThan =\n    cmp(this.semver, '<', comp.semver, loose) &&\n    ((this.operator === '>=' || this.operator === '>') &&\n    (comp.operator === '<=' || comp.operator === '<'));\n  var oppositeDirectionsGreaterThan =\n    cmp(this.semver, '>', comp.semver, loose) &&\n    ((this.operator === '<=' || this.operator === '<') &&\n    (comp.operator === '>=' || comp.operator === '>'));\n\n  return sameDirectionIncreasing || sameDirectionDecreasing ||\n    (sameSemVer && differentDirectionsInclusive) ||\n    oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;\n};\n\n\nexports.Range = Range;\nfunction Range(range, loose) {\n  if (range instanceof Range) {\n    if (range.loose === loose) {\n      return range;\n    } else {\n      return new Range(range.raw, loose);\n    }\n  }\n\n  if (range instanceof Comparator) {\n    return new Range(range.value, loose);\n  }\n\n  if (!(this instanceof Range))\n    return new Range(range, loose);\n\n  this.loose = loose;\n\n  // First, split based on boolean or ||\n  this.raw = range;\n  this.set = range.split(/\\s*\\|\\|\\s*/).map(function(range) {\n    return this.parseRange(range.trim());\n  }, this).filter(function(c) {\n    // throw out any that are not relevant for whatever reason\n    return c.length;\n  });\n\n  if (!this.set.length) {\n    throw new TypeError('Invalid SemVer Range: ' + range);\n  }\n\n  this.format();\n}\n\nRange.prototype.format = function() {\n  this.range = this.set.map(function(comps) {\n    return comps.join(' ').trim();\n  }).join('||').trim();\n  return this.range;\n};\n\nRange.prototype.toString = function() {\n  return this.range;\n};\n\nRange.prototype.parseRange = function(range) {\n  var loose = this.loose;\n  range = range.trim();\n  debug('range', range, loose);\n  // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n  var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];\n  range = range.replace(hr, hyphenReplace);\n  debug('hyphen replace', range);\n  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n  range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);\n  debug('comparator trim', range, re[COMPARATORTRIM]);\n\n  // `~ 1.2.3` => `~1.2.3`\n  range = range.replace(re[TILDETRIM], tildeTrimReplace);\n\n  // `^ 1.2.3` => `^1.2.3`\n  range = range.replace(re[CARETTRIM], caretTrimReplace);\n\n  // normalize spaces\n  range = range.split(/\\s+/).join(' ');\n\n  // At this point, the range is completely trimmed and\n  // ready to be split into comparators.\n\n  var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];\n  var set = range.split(' ').map(function(comp) {\n    return parseComparator(comp, loose);\n  }).join(' ').split(/\\s+/);\n  if (this.loose) {\n    // in loose mode, throw out any that are not valid comparators\n    set = set.filter(function(comp) {\n      return !!comp.match(compRe);\n    });\n  }\n  set = set.map(function(comp) {\n    return new Comparator(comp, loose);\n  });\n\n  return set;\n};\n\nRange.prototype.intersects = function(range, loose) {\n  if (!(range instanceof Range)) {\n    throw new TypeError('a Range is required');\n  }\n\n  return this.set.some(function(thisComparators) {\n    return thisComparators.every(function(thisComparator) {\n      return range.set.some(function(rangeComparators) {\n        return rangeComparators.every(function(rangeComparator) {\n          return thisComparator.intersects(rangeComparator, loose);\n        });\n      });\n    });\n  });\n};\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators;\nfunction toComparators(range, loose) {\n  return new Range(range, loose).set.map(function(comp) {\n    return comp.map(function(c) {\n      return c.value;\n    }).join(' ').trim().split(' ');\n  });\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator(comp, loose) {\n  debug('comp', comp);\n  comp = replaceCarets(comp, loose);\n  debug('caret', comp);\n  comp = replaceTildes(comp, loose);\n  debug('tildes', comp);\n  comp = replaceXRanges(comp, loose);\n  debug('xrange', comp);\n  comp = replaceStars(comp, loose);\n  debug('stars', comp);\n  return comp;\n}\n\nfunction isX(id) {\n  return !id || id.toLowerCase() === 'x' || id === '*';\n}\n\n// ~, ~> --\x3e * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --\x3e >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --\x3e >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --\x3e >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --\x3e >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --\x3e >=1.2.0 <1.3.0\nfunction replaceTildes(comp, loose) {\n  return comp.trim().split(/\\s+/).map(function(comp) {\n    return replaceTilde(comp, loose);\n  }).join(' ');\n}\n\nfunction replaceTilde(comp, loose) {\n  var r = loose ? re[TILDELOOSE] : re[TILDE];\n  return comp.replace(r, function(_, M, m, p, pr) {\n    debug('tilde', comp, _, M, m, p, pr);\n    var ret;\n\n    if (isX(M))\n      ret = '';\n    else if (isX(m))\n      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';\n    else if (isX(p))\n      // ~1.2 == >=1.2.0 <1.3.0\n      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';\n    else if (pr) {\n      debug('replaceTilde pr', pr);\n      if (pr.charAt(0) !== '-')\n        pr = '-' + pr;\n      ret = '>=' + M + '.' + m + '.' + p + pr +\n            ' <' + M + '.' + (+m + 1) + '.0';\n    } else\n      // ~1.2.3 == >=1.2.3 <1.3.0\n      ret = '>=' + M + '.' + m + '.' + p +\n            ' <' + M + '.' + (+m + 1) + '.0';\n\n    debug('tilde return', ret);\n    return ret;\n  });\n}\n\n// ^ --\x3e * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --\x3e >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --\x3e >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --\x3e >=1.2.0 <2.0.0\n// ^1.2.3 --\x3e >=1.2.3 <2.0.0\n// ^1.2.0 --\x3e >=1.2.0 <2.0.0\nfunction replaceCarets(comp, loose) {\n  return comp.trim().split(/\\s+/).map(function(comp) {\n    return replaceCaret(comp, loose);\n  }).join(' ');\n}\n\nfunction replaceCaret(comp, loose) {\n  debug('caret', comp, loose);\n  var r = loose ? re[CARETLOOSE] : re[CARET];\n  return comp.replace(r, function(_, M, m, p, pr) {\n    debug('caret', comp, _, M, m, p, pr);\n    var ret;\n\n    if (isX(M))\n      ret = '';\n    else if (isX(m))\n      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';\n    else if (isX(p)) {\n      if (M === '0')\n        ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';\n      else\n        ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';\n    } else if (pr) {\n      debug('replaceCaret pr', pr);\n      if (pr.charAt(0) !== '-')\n        pr = '-' + pr;\n      if (M === '0') {\n        if (m === '0')\n          ret = '>=' + M + '.' + m + '.' + p + pr +\n                ' <' + M + '.' + m + '.' + (+p + 1);\n        else\n          ret = '>=' + M + '.' + m + '.' + p + pr +\n                ' <' + M + '.' + (+m + 1) + '.0';\n      } else\n        ret = '>=' + M + '.' + m + '.' + p + pr +\n              ' <' + (+M + 1) + '.0.0';\n    } else {\n      debug('no pr');\n      if (M === '0') {\n        if (m === '0')\n          ret = '>=' + M + '.' + m + '.' + p +\n                ' <' + M + '.' + m + '.' + (+p + 1);\n        else\n          ret = '>=' + M + '.' + m + '.' + p +\n                ' <' + M + '.' + (+m + 1) + '.0';\n      } else\n        ret = '>=' + M + '.' + m + '.' + p +\n              ' <' + (+M + 1) + '.0.0';\n    }\n\n    debug('caret return', ret);\n    return ret;\n  });\n}\n\nfunction replaceXRanges(comp, loose) {\n  debug('replaceXRanges', comp, loose);\n  return comp.split(/\\s+/).map(function(comp) {\n    return replaceXRange(comp, loose);\n  }).join(' ');\n}\n\nfunction replaceXRange(comp, loose) {\n  comp = comp.trim();\n  var r = loose ? re[XRANGELOOSE] : re[XRANGE];\n  return comp.replace(r, function(ret, gtlt, M, m, p, pr) {\n    debug('xRange', comp, ret, gtlt, M, m, p, pr);\n    var xM = isX(M);\n    var xm = xM || isX(m);\n    var xp = xm || isX(p);\n    var anyX = xp;\n\n    if (gtlt === '=' && anyX)\n      gtlt = '';\n\n    if (xM) {\n      if (gtlt === '>' || gtlt === '<') {\n        // nothing is allowed\n        ret = '<0.0.0';\n      } else {\n        // nothing is forbidden\n        ret = '*';\n      }\n    } else if (gtlt && anyX) {\n      // replace X with 0\n      if (xm)\n        m = 0;\n      if (xp)\n        p = 0;\n\n      if (gtlt === '>') {\n        // >1 => >=2.0.0\n        // >1.2 => >=1.3.0\n        // >1.2.3 => >= 1.2.4\n        gtlt = '>=';\n        if (xm) {\n          M = +M + 1;\n          m = 0;\n          p = 0;\n        } else if (xp) {\n          m = +m + 1;\n          p = 0;\n        }\n      } else if (gtlt === '<=') {\n        // <=0.7.x is actually <0.8.0, since any 0.7.x should\n        // pass.  Similarly, <=7.x is actually <8.0.0, etc.\n        gtlt = '<';\n        if (xm)\n          M = +M + 1;\n        else\n          m = +m + 1;\n      }\n\n      ret = gtlt + M + '.' + m + '.' + p;\n    } else if (xm) {\n      ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';\n    } else if (xp) {\n      ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';\n    }\n\n    debug('xRange return', ret);\n\n    return ret;\n  });\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars(comp, loose) {\n  debug('replaceStars', comp, loose);\n  // Looseness is ignored here.  star is always as loose as it gets!\n  return comp.trim().replace(re[STAR], '');\n}\n\n// This function is passed to string.replace(re[HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace($0,\n                       from, fM, fm, fp, fpr, fb,\n                       to, tM, tm, tp, tpr, tb) {\n\n  if (isX(fM))\n    from = '';\n  else if (isX(fm))\n    from = '>=' + fM + '.0.0';\n  else if (isX(fp))\n    from = '>=' + fM + '.' + fm + '.0';\n  else\n    from = '>=' + from;\n\n  if (isX(tM))\n    to = '';\n  else if (isX(tm))\n    to = '<' + (+tM + 1) + '.0.0';\n  else if (isX(tp))\n    to = '<' + tM + '.' + (+tm + 1) + '.0';\n  else if (tpr)\n    to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;\n  else\n    to = '<=' + to;\n\n  return (from + ' ' + to).trim();\n}\n\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function(version) {\n  if (!version)\n    return false;\n\n  if (typeof version === 'string')\n    version = new SemVer(version, this.loose);\n\n  for (var i = 0; i < this.set.length; i++) {\n    if (testSet(this.set[i], version))\n      return true;\n  }\n  return false;\n};\n\nfunction testSet(set, version) {\n  for (var i = 0; i < set.length; i++) {\n    if (!set[i].test(version))\n      return false;\n  }\n\n  if (version.prerelease.length) {\n    // Find the set of versions that are allowed to have prereleases\n    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n    // That should allow `1.2.3-pr.2` to pass.\n    // However, `1.2.4-alpha.notready` should NOT be allowed,\n    // even though it's within the range set by the comparators.\n    for (var i = 0; i < set.length; i++) {\n      debug(set[i].semver);\n      if (set[i].semver === ANY)\n        continue;\n\n      if (set[i].semver.prerelease.length > 0) {\n        var allowed = set[i].semver;\n        if (allowed.major === version.major &&\n            allowed.minor === version.minor &&\n            allowed.patch === version.patch)\n          return true;\n      }\n    }\n\n    // Version has a -pre, but it's not one of the ones we like.\n    return false;\n  }\n\n  return true;\n}\n\nexports.satisfies = satisfies;\nfunction satisfies(version, range, loose) {\n  try {\n    range = new Range(range, loose);\n  } catch (er) {\n    return false;\n  }\n  return range.test(version);\n}\n\nexports.maxSatisfying = maxSatisfying;\nfunction maxSatisfying(versions, range, loose) {\n  var max = null;\n  var maxSV = null;\n  try {\n    var rangeObj = new Range(range, loose);\n  } catch (er) {\n    return null;\n  }\n  versions.forEach(function (v) {\n    if (rangeObj.test(v)) { // satisfies(v, range, loose)\n      if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)\n        max = v;\n        maxSV = new SemVer(max, loose);\n      }\n    }\n  })\n  return max;\n}\n\nexports.minSatisfying = minSatisfying;\nfunction minSatisfying(versions, range, loose) {\n  var min = null;\n  var minSV = null;\n  try {\n    var rangeObj = new Range(range, loose);\n  } catch (er) {\n    return null;\n  }\n  versions.forEach(function (v) {\n    if (rangeObj.test(v)) { // satisfies(v, range, loose)\n      if (!min || minSV.compare(v) === 1) { // compare(min, v, true)\n        min = v;\n        minSV = new SemVer(min, loose);\n      }\n    }\n  })\n  return min;\n}\n\nexports.validRange = validRange;\nfunction validRange(range, loose) {\n  try {\n    // Return '*' instead of '' so that truthiness works.\n    // This will throw if it's invalid anyway\n    return new Range(range, loose).range || '*';\n  } catch (er) {\n    return null;\n  }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr;\nfunction ltr(version, range, loose) {\n  return outside(version, range, '<', loose);\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr;\nfunction gtr(version, range, loose) {\n  return outside(version, range, '>', loose);\n}\n\nexports.outside = outside;\nfunction outside(version, range, hilo, loose) {\n  version = new SemVer(version, loose);\n  range = new Range(range, loose);\n\n  var gtfn, ltefn, ltfn, comp, ecomp;\n  switch (hilo) {\n    case '>':\n      gtfn = gt;\n      ltefn = lte;\n      ltfn = lt;\n      comp = '>';\n      ecomp = '>=';\n      break;\n    case '<':\n      gtfn = lt;\n      ltefn = gte;\n      ltfn = gt;\n      comp = '<';\n      ecomp = '<=';\n      break;\n    default:\n      throw new TypeError('Must provide a hilo val of \"<\" or \">\"');\n  }\n\n  // If it satisifes the range it is not outside\n  if (satisfies(version, range, loose)) {\n    return false;\n  }\n\n  // From now on, variable terms are as if we're in \"gtr\" mode.\n  // but note that everything is flipped for the \"ltr\" function.\n\n  for (var i = 0; i < range.set.length; ++i) {\n    var comparators = range.set[i];\n\n    var high = null;\n    var low = null;\n\n    comparators.forEach(function(comparator) {\n      if (comparator.semver === ANY) {\n        comparator = new Comparator('>=0.0.0')\n      }\n      high = high || comparator;\n      low = low || comparator;\n      if (gtfn(comparator.semver, high.semver, loose)) {\n        high = comparator;\n      } else if (ltfn(comparator.semver, low.semver, loose)) {\n        low = comparator;\n      }\n    });\n\n    // If the edge version comparator has a operator then our version\n    // isn't outside it\n    if (high.operator === comp || high.operator === ecomp) {\n      return false;\n    }\n\n    // If the lowest version comparator has an operator and our version\n    // is less than it then it isn't higher than the range\n    if ((!low.operator || low.operator === comp) &&\n        ltefn(version, low.semver)) {\n      return false;\n    } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexports.prerelease = prerelease;\nfunction prerelease(version, loose) {\n  var parsed = parse(version, loose);\n  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;\n}\n\nexports.intersects = intersects;\nfunction intersects(r1, r2, loose) {\n  r1 = new Range(r1, loose)\n  r2 = new Range(r2, loose)\n  return r1.intersects(r2)\n}\n\nexports.coerce = coerce;\nfunction coerce(version) {\n  if (version instanceof SemVer)\n    return version;\n\n  if (typeof version !== 'string')\n    return null;\n\n  var match = version.match(re[COERCE]);\n\n  if (match == null)\n    return null;\n\n  return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0')); \n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/semver/semver.js\n// module id = 1230\n// module chunks = 0\n\n//# sourceURL=../node_modules/semver/semver.js")},function(module,exports,__webpack_require__){eval("/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\n * in FIPS PUB 180-1\n * This source code is derived from sha1.js of the same repository.\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\n * operation was added.\n */\n\nvar inherits = __webpack_require__(3)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar K = [\n  0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha () {\n  this.init()\n  this._w = W\n\n  Hash.call(this, 64, 56)\n}\n\ninherits(Sha, Hash)\n\nSha.prototype.init = function () {\n  this._a = 0x67452301\n  this._b = 0xefcdab89\n  this._c = 0x98badcfe\n  this._d = 0x10325476\n  this._e = 0xc3d2e1f0\n\n  return this\n}\n\nfunction rotl5 (num) {\n  return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n  return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n  if (s === 0) return (b & c) | ((~b) & d)\n  if (s === 2) return (b & c) | (b & d) | (c & d)\n  return b ^ c ^ d\n}\n\nSha.prototype._update = function (M) {\n  var W = this._w\n\n  var a = this._a | 0\n  var b = this._b | 0\n  var c = this._c | 0\n  var d = this._d | 0\n  var e = this._e | 0\n\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n  for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\n\n  for (var j = 0; j < 80; ++j) {\n    var s = ~~(j / 20)\n    var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n    e = d\n    d = c\n    c = rotl30(b)\n    b = a\n    a = t\n  }\n\n  this._a = (a + this._a) | 0\n  this._b = (b + this._b) | 0\n  this._c = (c + this._c) | 0\n  this._d = (d + this._d) | 0\n  this._e = (e + this._e) | 0\n}\n\nSha.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(20)\n\n  H.writeInt32BE(this._a | 0, 0)\n  H.writeInt32BE(this._b | 0, 4)\n  H.writeInt32BE(this._c | 0, 8)\n  H.writeInt32BE(this._d | 0, 12)\n  H.writeInt32BE(this._e | 0, 16)\n\n  return H\n}\n\nmodule.exports = Sha\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha.js\n// module id = 1231\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha.js")},function(module,exports,__webpack_require__){eval("/*\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\n * in FIPS PUB 180-1\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n * Distributed under the BSD License\n * See http://pajhome.org.uk/crypt/md5 for details.\n */\n\nvar inherits = __webpack_require__(3)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar K = [\n  0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\n]\n\nvar W = new Array(80)\n\nfunction Sha1 () {\n  this.init()\n  this._w = W\n\n  Hash.call(this, 64, 56)\n}\n\ninherits(Sha1, Hash)\n\nSha1.prototype.init = function () {\n  this._a = 0x67452301\n  this._b = 0xefcdab89\n  this._c = 0x98badcfe\n  this._d = 0x10325476\n  this._e = 0xc3d2e1f0\n\n  return this\n}\n\nfunction rotl1 (num) {\n  return (num << 1) | (num >>> 31)\n}\n\nfunction rotl5 (num) {\n  return (num << 5) | (num >>> 27)\n}\n\nfunction rotl30 (num) {\n  return (num << 30) | (num >>> 2)\n}\n\nfunction ft (s, b, c, d) {\n  if (s === 0) return (b & c) | ((~b) & d)\n  if (s === 2) return (b & c) | (b & d) | (c & d)\n  return b ^ c ^ d\n}\n\nSha1.prototype._update = function (M) {\n  var W = this._w\n\n  var a = this._a | 0\n  var b = this._b | 0\n  var c = this._c | 0\n  var d = this._d | 0\n  var e = this._e | 0\n\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\n  for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\n\n  for (var j = 0; j < 80; ++j) {\n    var s = ~~(j / 20)\n    var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\n\n    e = d\n    d = c\n    c = rotl30(b)\n    b = a\n    a = t\n  }\n\n  this._a = (a + this._a) | 0\n  this._b = (b + this._b) | 0\n  this._c = (c + this._c) | 0\n  this._d = (d + this._d) | 0\n  this._e = (e + this._e) | 0\n}\n\nSha1.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(20)\n\n  H.writeInt32BE(this._a | 0, 0)\n  H.writeInt32BE(this._b | 0, 4)\n  H.writeInt32BE(this._c | 0, 8)\n  H.writeInt32BE(this._d | 0, 12)\n  H.writeInt32BE(this._e | 0, 16)\n\n  return H\n}\n\nmodule.exports = Sha1\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha1.js\n// module id = 1232\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha1.js")},function(module,exports,__webpack_require__){eval("/**\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\n * in FIPS 180-2\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\n *\n */\n\nvar inherits = __webpack_require__(3)\nvar Sha256 = __webpack_require__(535)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar W = new Array(64)\n\nfunction Sha224 () {\n  this.init()\n\n  this._w = W // new Array(64)\n\n  Hash.call(this, 64, 56)\n}\n\ninherits(Sha224, Sha256)\n\nSha224.prototype.init = function () {\n  this._a = 0xc1059ed8\n  this._b = 0x367cd507\n  this._c = 0x3070dd17\n  this._d = 0xf70e5939\n  this._e = 0xffc00b31\n  this._f = 0x68581511\n  this._g = 0x64f98fa7\n  this._h = 0xbefa4fa4\n\n  return this\n}\n\nSha224.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(28)\n\n  H.writeInt32BE(this._a, 0)\n  H.writeInt32BE(this._b, 4)\n  H.writeInt32BE(this._c, 8)\n  H.writeInt32BE(this._d, 12)\n  H.writeInt32BE(this._e, 16)\n  H.writeInt32BE(this._f, 20)\n  H.writeInt32BE(this._g, 24)\n\n  return H\n}\n\nmodule.exports = Sha224\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha224.js\n// module id = 1233\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha224.js")},function(module,exports,__webpack_require__){eval("var inherits = __webpack_require__(3)\nvar SHA512 = __webpack_require__(536)\nvar Hash = __webpack_require__(124)\nvar Buffer = __webpack_require__(1).Buffer\n\nvar W = new Array(160)\n\nfunction Sha384 () {\n  this.init()\n  this._w = W\n\n  Hash.call(this, 128, 112)\n}\n\ninherits(Sha384, SHA512)\n\nSha384.prototype.init = function () {\n  this._ah = 0xcbbb9d5d\n  this._bh = 0x629a292a\n  this._ch = 0x9159015a\n  this._dh = 0x152fecd8\n  this._eh = 0x67332667\n  this._fh = 0x8eb44a87\n  this._gh = 0xdb0c2e0d\n  this._hh = 0x47b5481d\n\n  this._al = 0xc1059ed8\n  this._bl = 0x367cd507\n  this._cl = 0x3070dd17\n  this._dl = 0xf70e5939\n  this._el = 0xffc00b31\n  this._fl = 0x68581511\n  this._gl = 0x64f98fa7\n  this._hl = 0xbefa4fa4\n\n  return this\n}\n\nSha384.prototype._hash = function () {\n  var H = Buffer.allocUnsafe(48)\n\n  function writeInt64BE (h, l, offset) {\n    H.writeInt32BE(h, offset)\n    H.writeInt32BE(l, offset + 4)\n  }\n\n  writeInt64BE(this._ah, this._al, 0)\n  writeInt64BE(this._bh, this._bl, 8)\n  writeInt64BE(this._ch, this._cl, 16)\n  writeInt64BE(this._dh, this._dl, 24)\n  writeInt64BE(this._eh, this._el, 32)\n  writeInt64BE(this._fh, this._fl, 40)\n\n  return H\n}\n\nmodule.exports = Sha384\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sha.js/sha384.js\n// module id = 1234\n// module chunks = 0\n\n//# sourceURL=../node_modules/sha.js/sha384.js")},function(module,exports,__webpack_require__){eval("var varint = __webpack_require__(29)\nexports.encode = function encode (v, b, o) {\n  v = v >= 0 ? v*2 : v*-2 - 1\n  var r = varint.encode(v, b, o)\n  encode.bytes = varint.encode.bytes\n  return r\n}\nexports.decode = function decode (b, o) {\n  var v = varint.decode(b, o)\n  decode.bytes = varint.decode.bytes\n  return v & 1 ? (v+1) / -2 : v / 2\n}\n\nexports.encodingLength = function (v) {\n  return varint.encodingLength(v >= 0 ? v*2 : v*-2 - 1)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/signed-varint/index.js\n// module id = 1235\n// module chunks = 0\n\n//# sourceURL=../node_modules/signed-varint/index.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = Peer\n\nvar debug = __webpack_require__(5)('simple-peer')\nvar getBrowserRTC = __webpack_require__(867)\nvar inherits = __webpack_require__(3)\nvar randombytes = __webpack_require__(80)\nvar stream = __webpack_require__(81)\n\nvar MAX_BUFFERED_AMOUNT = 64 * 1024\n\ninherits(Peer, stream.Duplex)\n\n/**\n * WebRTC peer connection. Same API as node core `net.Socket`, plus a few extra methods.\n * Duplex stream.\n * @param {Object} opts\n */\nfunction Peer (opts) {\n  var self = this\n  if (!(self instanceof Peer)) return new Peer(opts)\n\n  self._id = randombytes(4).toString('hex').slice(0, 7)\n  self._debug('new peer %o', opts)\n\n  opts = Object.assign({\n    allowHalfOpen: false\n  }, opts)\n\n  stream.Duplex.call(self, opts)\n\n  self.channelName = opts.initiator\n    ? opts.channelName || randombytes(20).toString('hex')\n    : null\n\n  // Needed by _transformConstraints, so set this early\n  self._isChromium = typeof window !== 'undefined' && !!window.webkitRTCPeerConnection\n\n  self.initiator = opts.initiator || false\n  self.channelConfig = opts.channelConfig || Peer.channelConfig\n  self.config = opts.config || Peer.config\n  self.constraints = self._transformConstraints(opts.constraints || Peer.constraints)\n  self.offerConstraints = self._transformConstraints(opts.offerConstraints || {})\n  self.answerConstraints = self._transformConstraints(opts.answerConstraints || {})\n  self.reconnectTimer = opts.reconnectTimer || false\n  self.sdpTransform = opts.sdpTransform || function (sdp) { return sdp }\n  self.stream = opts.stream || false\n  self.trickle = opts.trickle !== undefined ? opts.trickle : true\n\n  self.destroyed = false\n  self.connected = false\n\n  self.remoteAddress = undefined\n  self.remoteFamily = undefined\n  self.remotePort = undefined\n  self.localAddress = undefined\n  self.localPort = undefined\n\n  self._wrtc = (opts.wrtc && typeof opts.wrtc === 'object')\n    ? opts.wrtc\n    : getBrowserRTC()\n\n  if (!self._wrtc) {\n    if (typeof window === 'undefined') {\n      throw new Error('No WebRTC support: Specify `opts.wrtc` option in this environment')\n    } else {\n      throw new Error('No WebRTC support: Not a supported browser')\n    }\n  }\n\n  self._pcReady = false\n  self._channelReady = false\n  self._iceComplete = false // ice candidate trickle done (got null candidate)\n  self._channel = null\n  self._pendingCandidates = []\n  self._previousStreams = []\n\n  self._chunk = null\n  self._cb = null\n  self._interval = null\n  self._reconnectTimeout = null\n\n  self._pc = new (self._wrtc.RTCPeerConnection)(self.config, self.constraints)\n\n  // We prefer feature detection whenever possible, but sometimes that's not\n  // possible for certain implementations.\n  self._isWrtc = Array.isArray(self._pc.RTCIceConnectionStates)\n  self._isReactNativeWebrtc = typeof self._pc._peerConnectionId === 'number'\n\n  self._pc.oniceconnectionstatechange = function () {\n    self._onIceStateChange()\n  }\n  self._pc.onicegatheringstatechange = function () {\n    self._onIceStateChange()\n  }\n  self._pc.onsignalingstatechange = function () {\n    self._onSignalingStateChange()\n  }\n  self._pc.onicecandidate = function (event) {\n    self._onIceCandidate(event)\n  }\n\n  // Other spec events, unused by this implementation:\n  // - onconnectionstatechange\n  // - onicecandidateerror\n  // - onfingerprintfailure\n\n  if (self.initiator) {\n    var createdOffer = false\n    self._pc.onnegotiationneeded = function () {\n      if (!createdOffer) self._createOffer()\n      createdOffer = true\n    }\n\n    self._setupData({\n      channel: self._pc.createDataChannel(self.channelName, self.channelConfig)\n    })\n  } else {\n    self._pc.ondatachannel = function (event) {\n      self._setupData(event)\n    }\n  }\n\n  if ('addTrack' in self._pc) {\n    // WebRTC Spec, Firefox\n    if (self.stream) {\n      self.stream.getTracks().forEach(function (track) {\n        self._pc.addTrack(track, self.stream)\n      })\n    }\n    self._pc.ontrack = function (event) {\n      self._onTrack(event)\n    }\n  } else {\n    // Chrome, etc. This can be removed once all browsers support `ontrack`\n    if (self.stream) self._pc.addStream(self.stream)\n    self._pc.onaddstream = function (event) {\n      self._onAddStream(event)\n    }\n  }\n\n  // HACK: wrtc doesn't fire the 'negotionneeded' event\n  if (self.initiator && self._isWrtc) {\n    self._pc.onnegotiationneeded()\n  }\n\n  self._onFinishBound = function () {\n    self._onFinish()\n  }\n  self.once('finish', self._onFinishBound)\n}\n\nPeer.WEBRTC_SUPPORT = !!getBrowserRTC()\n\n/**\n * Expose config, constraints, and data channel config for overriding all Peer\n * instances. Otherwise, just set opts.config, opts.constraints, or opts.channelConfig\n * when constructing a Peer.\n */\nPeer.config = {\n  iceServers: [\n    {\n      urls: 'stun:stun.l.google.com:19302'\n    },\n    {\n      urls: 'stun:global.stun.twilio.com:3478?transport=udp'\n    }\n  ]\n}\nPeer.constraints = {}\nPeer.channelConfig = {}\n\nObject.defineProperty(Peer.prototype, 'bufferSize', {\n  get: function () {\n    var self = this\n    return (self._channel && self._channel.bufferedAmount) || 0\n  }\n})\n\nPeer.prototype.address = function () {\n  var self = this\n  return { port: self.localPort, family: 'IPv4', address: self.localAddress }\n}\n\nPeer.prototype.signal = function (data) {\n  var self = this\n  if (self.destroyed) throw new Error('cannot signal after peer is destroyed')\n  if (typeof data === 'string') {\n    try {\n      data = JSON.parse(data)\n    } catch (err) {\n      data = {}\n    }\n  }\n  self._debug('signal()')\n\n  if (data.candidate) {\n    if (self._pc.remoteDescription && self._pc.remoteDescription.type) self._addIceCandidate(data.candidate)\n    else self._pendingCandidates.push(data.candidate)\n  }\n  if (data.sdp) {\n    self._pc.setRemoteDescription(new (self._wrtc.RTCSessionDescription)(data), function () {\n      if (self.destroyed) return\n\n      self._pendingCandidates.forEach(function (candidate) {\n        self._addIceCandidate(candidate)\n      })\n      self._pendingCandidates = []\n\n      if (self._pc.remoteDescription.type === 'offer') self._createAnswer()\n    }, function (err) { self._destroy(err) })\n  }\n  if (!data.sdp && !data.candidate) {\n    self._destroy(new Error('signal() called with invalid signal data'))\n  }\n}\n\nPeer.prototype._addIceCandidate = function (candidate) {\n  var self = this\n  try {\n    self._pc.addIceCandidate(\n      new self._wrtc.RTCIceCandidate(candidate),\n      noop,\n      function (err) { self._destroy(err) }\n    )\n  } catch (err) {\n    self._destroy(new Error('error adding candidate: ' + err.message))\n  }\n}\n\n/**\n * Send text/binary data to the remote peer.\n * @param {TypedArrayView|ArrayBuffer|Buffer|string|Blob|Object} chunk\n */\nPeer.prototype.send = function (chunk) {\n  var self = this\n  self._channel.send(chunk)\n}\n\nPeer.prototype.destroy = function (onclose) {\n  var self = this\n  self._destroy(null, onclose)\n}\n\nPeer.prototype._destroy = function (err, onclose) {\n  var self = this\n  if (self.destroyed) return\n  if (onclose) self.once('close', onclose)\n\n  self._debug('destroy (error: %s)', err && (err.message || err))\n\n  self.readable = self.writable = false\n\n  if (!self._readableState.ended) self.push(null)\n  if (!self._writableState.finished) self.end()\n\n  self.destroyed = true\n  self.connected = false\n  self._pcReady = false\n  self._channelReady = false\n  self._previousStreams = null\n\n  clearInterval(self._interval)\n  clearTimeout(self._reconnectTimeout)\n  self._interval = null\n  self._reconnectTimeout = null\n  self._chunk = null\n  self._cb = null\n\n  if (self._onFinishBound) self.removeListener('finish', self._onFinishBound)\n  self._onFinishBound = null\n\n  if (self._pc) {\n    try {\n      self._pc.close()\n    } catch (err) {}\n\n    self._pc.oniceconnectionstatechange = null\n    self._pc.onicegatheringstatechange = null\n    self._pc.onsignalingstatechange = null\n    self._pc.onicecandidate = null\n    if ('addTrack' in self._pc) {\n      self._pc.ontrack = null\n    } else {\n      self._pc.onaddstream = null\n    }\n    self._pc.onnegotiationneeded = null\n    self._pc.ondatachannel = null\n  }\n\n  if (self._channel) {\n    try {\n      self._channel.close()\n    } catch (err) {}\n\n    self._channel.onmessage = null\n    self._channel.onopen = null\n    self._channel.onclose = null\n    self._channel.onerror = null\n  }\n  self._pc = null\n  self._channel = null\n\n  if (err) self.emit('error', err)\n  self.emit('close')\n}\n\nPeer.prototype._setupData = function (event) {\n  var self = this\n  if (!event.channel) {\n    // In some situations `pc.createDataChannel()` returns `undefined` (in wrtc),\n    // which is invalid behavior. Handle it gracefully.\n    // See: https://github.com/feross/simple-peer/issues/163\n    return self._destroy(new Error('Data channel event is missing `channel` property'))\n  }\n\n  self._channel = event.channel\n  self._channel.binaryType = 'arraybuffer'\n\n  if (typeof self._channel.bufferedAmountLowThreshold === 'number') {\n    self._channel.bufferedAmountLowThreshold = MAX_BUFFERED_AMOUNT\n  }\n\n  self.channelName = self._channel.label\n\n  self._channel.onmessage = function (event) {\n    self._onChannelMessage(event)\n  }\n  self._channel.onbufferedamountlow = function () {\n    self._onChannelBufferedAmountLow()\n  }\n  self._channel.onopen = function () {\n    self._onChannelOpen()\n  }\n  self._channel.onclose = function () {\n    self._onChannelClose()\n  }\n  self._channel.onerror = function (err) {\n    self._destroy(err)\n  }\n}\n\nPeer.prototype._read = function () {}\n\nPeer.prototype._write = function (chunk, encoding, cb) {\n  var self = this\n  if (self.destroyed) return cb(new Error('cannot write after peer is destroyed'))\n\n  if (self.connected) {\n    try {\n      self.send(chunk)\n    } catch (err) {\n      return self._destroy(err)\n    }\n    if (self._channel.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n      self._debug('start backpressure: bufferedAmount %d', self._channel.bufferedAmount)\n      self._cb = cb\n    } else {\n      cb(null)\n    }\n  } else {\n    self._debug('write before connect')\n    self._chunk = chunk\n    self._cb = cb\n  }\n}\n\n// When stream finishes writing, close socket. Half open connections are not\n// supported.\nPeer.prototype._onFinish = function () {\n  var self = this\n  if (self.destroyed) return\n\n  if (self.connected) {\n    destroySoon()\n  } else {\n    self.once('connect', destroySoon)\n  }\n\n  // Wait a bit before destroying so the socket flushes.\n  // TODO: is there a more reliable way to accomplish this?\n  function destroySoon () {\n    setTimeout(function () {\n      self._destroy()\n    }, 1000)\n  }\n}\n\nPeer.prototype._createOffer = function () {\n  var self = this\n  if (self.destroyed) return\n\n  self._pc.createOffer(function (offer) {\n    if (self.destroyed) return\n    offer.sdp = self.sdpTransform(offer.sdp)\n    self._pc.setLocalDescription(offer, onSuccess, onError)\n\n    function onSuccess () {\n      if (self.destroyed) return\n      if (self.trickle || self._iceComplete) sendOffer()\n      else self.once('_iceComplete', sendOffer) // wait for candidates\n    }\n\n    function onError (err) {\n      self._destroy(err)\n    }\n\n    function sendOffer () {\n      var signal = self._pc.localDescription || offer\n      self._debug('signal')\n      self.emit('signal', {\n        type: signal.type,\n        sdp: signal.sdp\n      })\n    }\n  }, function (err) { self._destroy(err) }, self.offerConstraints)\n}\n\nPeer.prototype._createAnswer = function () {\n  var self = this\n  if (self.destroyed) return\n\n  self._pc.createAnswer(function (answer) {\n    if (self.destroyed) return\n    answer.sdp = self.sdpTransform(answer.sdp)\n    self._pc.setLocalDescription(answer, onSuccess, onError)\n\n    function onSuccess () {\n      if (self.destroyed) return\n      if (self.trickle || self._iceComplete) sendAnswer()\n      else self.once('_iceComplete', sendAnswer)\n    }\n\n    function onError (err) {\n      self._destroy(err)\n    }\n\n    function sendAnswer () {\n      var signal = self._pc.localDescription || answer\n      self._debug('signal')\n      self.emit('signal', {\n        type: signal.type,\n        sdp: signal.sdp\n      })\n    }\n  }, function (err) { self._destroy(err) }, self.answerConstraints)\n}\n\nPeer.prototype._onIceStateChange = function () {\n  var self = this\n  if (self.destroyed) return\n  var iceConnectionState = self._pc.iceConnectionState\n  var iceGatheringState = self._pc.iceGatheringState\n\n  self._debug(\n    'iceStateChange (connection: %s) (gathering: %s)',\n    iceConnectionState,\n    iceGatheringState\n  )\n  self.emit('iceStateChange', iceConnectionState, iceGatheringState)\n\n  if (iceConnectionState === 'connected' || iceConnectionState === 'completed') {\n    clearTimeout(self._reconnectTimeout)\n    self._pcReady = true\n    self._maybeReady()\n  }\n  if (iceConnectionState === 'disconnected') {\n    if (self.reconnectTimer) {\n      // If user has set `opt.reconnectTimer`, allow time for ICE to attempt a reconnect\n      clearTimeout(self._reconnectTimeout)\n      self._reconnectTimeout = setTimeout(function () {\n        self._destroy()\n      }, self.reconnectTimer)\n    } else {\n      self._destroy()\n    }\n  }\n  if (iceConnectionState === 'failed') {\n    self._destroy(new Error('Ice connection failed.'))\n  }\n  if (iceConnectionState === 'closed') {\n    self._destroy()\n  }\n}\n\nPeer.prototype.getStats = function (cb) {\n  var self = this\n\n  // Promise-based getStats() (standard)\n  if (self._pc.getStats.length === 0) {\n    self._pc.getStats().then(function (res) {\n      var reports = []\n      res.forEach(function (report) {\n        reports.push(report)\n      })\n      cb(null, reports)\n    }, function (err) { cb(err) })\n\n  // Two-parameter callback-based getStats() (deprecated, former standard)\n  } else if (self._isReactNativeWebrtc) {\n    self._pc.getStats(null, function (res) {\n      var reports = []\n      res.forEach(function (report) {\n        reports.push(report)\n      })\n      cb(null, reports)\n    }, function (err) { cb(err) })\n\n  // Single-parameter callback-based getStats() (non-standard)\n  } else if (self._pc.getStats.length > 0) {\n    self._pc.getStats(function (res) {\n      // If we destroy connection in `connect` callback this code might happen to run when actual connection is already closed\n      if (self.destroyed) return\n\n      var reports = []\n      res.result().forEach(function (result) {\n        var report = {}\n        result.names().forEach(function (name) {\n          report[name] = result.stat(name)\n        })\n        report.id = result.id\n        report.type = result.type\n        report.timestamp = result.timestamp\n        reports.push(report)\n      })\n      cb(null, reports)\n    }, function (err) { cb(err) })\n\n  // Unknown browser, skip getStats() since it's anyone's guess which style of\n  // getStats() they implement.\n  } else {\n    cb(null, [])\n  }\n}\n\nPeer.prototype._maybeReady = function () {\n  var self = this\n  self._debug('maybeReady pc %s channel %s', self._pcReady, self._channelReady)\n  if (self.connected || self._connecting || !self._pcReady || !self._channelReady) return\n\n  self._connecting = true\n\n  // HACK: We can't rely on order here, for details see https://github.com/js-platform/node-webrtc/issues/339\n  function findCandidatePair () {\n    if (self.destroyed) return\n\n    self.getStats(function (err, items) {\n      if (self.destroyed) return\n\n      // Treat getStats error as non-fatal. It's not essential.\n      if (err) items = []\n\n      var remoteCandidates = {}\n      var localCandidates = {}\n      var candidatePairs = {}\n      var foundSelectedCandidatePair = false\n\n      items.forEach(function (item) {\n        // TODO: Once all browsers support the hyphenated stats report types, remove\n        // the non-hypenated ones\n        if (item.type === 'remotecandidate' || item.type === 'remote-candidate') {\n          remoteCandidates[item.id] = item\n        }\n        if (item.type === 'localcandidate' || item.type === 'local-candidate') {\n          localCandidates[item.id] = item\n        }\n        if (item.type === 'candidatepair' || item.type === 'candidate-pair') {\n          candidatePairs[item.id] = item\n        }\n      })\n\n      items.forEach(function (item) {\n        // Spec-compliant\n        if (item.type === 'transport') {\n          setSelectedCandidatePair(candidatePairs[item.selectedCandidatePairId])\n        }\n\n        // Old implementations\n        if (\n          (item.type === 'googCandidatePair' && item.googActiveConnection === 'true') ||\n          ((item.type === 'candidatepair' || item.type === 'candidate-pair') && item.selected)\n        ) {\n          setSelectedCandidatePair(item)\n        }\n      })\n\n      function setSelectedCandidatePair (selectedCandidatePair) {\n        foundSelectedCandidatePair = true\n\n        var local = localCandidates[selectedCandidatePair.localCandidateId]\n\n        if (local && local.ip) {\n          // Spec\n          self.localAddress = local.ip\n          self.localPort = Number(local.port)\n        } else if (local && local.ipAddress) {\n          // Firefox\n          self.localAddress = local.ipAddress\n          self.localPort = Number(local.portNumber)\n        } else if (typeof selectedCandidatePair.googLocalAddress === 'string') {\n          // TODO: remove this once Chrome 58 is released\n          local = selectedCandidatePair.googLocalAddress.split(':')\n          self.localAddress = local[0]\n          self.localPort = Number(local[1])\n        }\n\n        var remote = remoteCandidates[selectedCandidatePair.remoteCandidateId]\n\n        if (remote && remote.ip) {\n          // Spec\n          self.remoteAddress = remote.ip\n          self.remotePort = Number(remote.port)\n        } else if (remote && remote.ipAddress) {\n          // Firefox\n          self.remoteAddress = remote.ipAddress\n          self.remotePort = Number(remote.portNumber)\n        } else if (typeof selectedCandidatePair.googRemoteAddress === 'string') {\n          // TODO: remove this once Chrome 58 is released\n          remote = selectedCandidatePair.googRemoteAddress.split(':')\n          self.remoteAddress = remote[0]\n          self.remotePort = Number(remote[1])\n        }\n        self.remoteFamily = 'IPv4'\n\n        self._debug(\n          'connect local: %s:%s remote: %s:%s',\n          self.localAddress, self.localPort, self.remoteAddress, self.remotePort\n        )\n      }\n\n      // Ignore candidate pair selection in browsers like Safari 11 that do not have any local or remote candidates\n      // But wait until at least 1 candidate pair is available\n      if (!foundSelectedCandidatePair && (!Object.keys(candidatePairs).length || Object.keys(localCandidates).length)) {\n        setTimeout(findCandidatePair, 100)\n        return\n      } else {\n        self._connecting = false\n        self.connected = true\n      }\n\n      if (self._chunk) {\n        try {\n          self.send(self._chunk)\n        } catch (err) {\n          return self._destroy(err)\n        }\n        self._chunk = null\n        self._debug('sent chunk from \"write before connect\"')\n\n        var cb = self._cb\n        self._cb = null\n        cb(null)\n      }\n\n      // If `bufferedAmountLowThreshold` and 'onbufferedamountlow' are unsupported,\n      // fallback to using setInterval to implement backpressure.\n      if (typeof self._channel.bufferedAmountLowThreshold !== 'number') {\n        self._interval = setInterval(function () { self._onInterval() }, 150)\n        if (self._interval.unref) self._interval.unref()\n      }\n\n      self._debug('connect')\n      self.emit('connect')\n    })\n  }\n  findCandidatePair()\n}\n\nPeer.prototype._onInterval = function () {\n  if (!this._cb || !this._channel || this._channel.bufferedAmount > MAX_BUFFERED_AMOUNT) {\n    return\n  }\n  this._onChannelBufferedAmountLow()\n}\n\nPeer.prototype._onSignalingStateChange = function () {\n  var self = this\n  if (self.destroyed) return\n  self._debug('signalingStateChange %s', self._pc.signalingState)\n  self.emit('signalingStateChange', self._pc.signalingState)\n}\n\nPeer.prototype._onIceCandidate = function (event) {\n  var self = this\n  if (self.destroyed) return\n  if (event.candidate && self.trickle) {\n    self.emit('signal', {\n      candidate: {\n        candidate: event.candidate.candidate,\n        sdpMLineIndex: event.candidate.sdpMLineIndex,\n        sdpMid: event.candidate.sdpMid\n      }\n    })\n  } else if (!event.candidate) {\n    self._iceComplete = true\n    self.emit('_iceComplete')\n  }\n}\n\nPeer.prototype._onChannelMessage = function (event) {\n  var self = this\n  if (self.destroyed) return\n  var data = event.data\n  if (data instanceof ArrayBuffer) data = Buffer.from(data)\n  self.push(data)\n}\n\nPeer.prototype._onChannelBufferedAmountLow = function () {\n  var self = this\n  if (self.destroyed || !self._cb) return\n  self._debug('ending backpressure: bufferedAmount %d', self._channel.bufferedAmount)\n  var cb = self._cb\n  self._cb = null\n  cb(null)\n}\n\nPeer.prototype._onChannelOpen = function () {\n  var self = this\n  if (self.connected || self.destroyed) return\n  self._debug('on channel open')\n  self._channelReady = true\n  self._maybeReady()\n}\n\nPeer.prototype._onChannelClose = function () {\n  var self = this\n  if (self.destroyed) return\n  self._debug('on channel close')\n  self._destroy()\n}\n\nPeer.prototype._onAddStream = function (event) {\n  var self = this\n  if (self.destroyed) return\n  self._debug('on add stream')\n  self.emit('stream', event.stream)\n}\n\nPeer.prototype._onTrack = function (event) {\n  var self = this\n  if (self.destroyed) return\n  self._debug('on track')\n  var id = event.streams[0].id\n  if (self._previousStreams.indexOf(id) !== -1) return // Only fire one 'stream' event, even though there may be multiple tracks per stream\n  self._previousStreams.push(id)\n  self.emit('stream', event.streams[0])\n}\n\nPeer.prototype._debug = function () {\n  var self = this\n  var args = [].slice.call(arguments)\n  args[0] = '[' + self._id + '] ' + args[0]\n  debug.apply(null, args)\n}\n\n// Transform constraints objects into the new format (unless Chromium)\n// TODO: This can be removed when Chromium supports the new format\nPeer.prototype._transformConstraints = function (constraints) {\n  var self = this\n\n  if (Object.keys(constraints).length === 0) {\n    return constraints\n  }\n\n  if ((constraints.mandatory || constraints.optional) && !self._isChromium) {\n    // convert to new format\n\n    // Merge mandatory and optional objects, prioritizing mandatory\n    var newConstraints = Object.assign({}, constraints.optional, constraints.mandatory)\n\n    // fix casing\n    if (newConstraints.OfferToReceiveVideo !== undefined) {\n      newConstraints.offerToReceiveVideo = newConstraints.OfferToReceiveVideo\n      delete newConstraints['OfferToReceiveVideo']\n    }\n\n    if (newConstraints.OfferToReceiveAudio !== undefined) {\n      newConstraints.offerToReceiveAudio = newConstraints.OfferToReceiveAudio\n      delete newConstraints['OfferToReceiveAudio']\n    }\n\n    return newConstraints\n  } else if (!constraints.mandatory && !constraints.optional && self._isChromium) {\n    // convert to old format\n\n    // fix casing\n    if (constraints.offerToReceiveVideo !== undefined) {\n      constraints.OfferToReceiveVideo = constraints.offerToReceiveVideo\n      delete constraints['offerToReceiveVideo']\n    }\n\n    if (constraints.offerToReceiveAudio !== undefined) {\n      constraints.OfferToReceiveAudio = constraints.offerToReceiveAudio\n      delete constraints['offerToReceiveAudio']\n    }\n\n    return {\n      mandatory: constraints // NOTE: All constraints are upgraded to mandatory\n    }\n  }\n\n  return constraints\n}\n\nfunction noop () {}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/simple-peer/index.js\n// module id = 1236\n// module chunks = 0\n\n//# sourceURL=../node_modules/simple-peer/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * Error strings\n */\nconst ERRORS = {\n    INVALID_ENCODING: 'Invalid encoding provided. Please specify a valid encoding the internal Node.js Buffer supports.',\n    INVALID_SMARTBUFFER_SIZE: 'Invalid size provided. Size must be a valid integer greater than zero.',\n    INVALID_SMARTBUFFER_BUFFER: 'Invalid Buffer provided in SmartBufferOptions.',\n    INVALID_SMARTBUFFER_OBJECT: 'Invalid SmartBufferOptions object supplied to SmartBuffer constructor or factory methods.',\n    INVALID_OFFSET: 'An invalid offset value was provided.',\n    INVALID_OFFSET_NON_NUMBER: 'An invalid offset value was provided. A numeric value is required.',\n    INVALID_LENGTH: 'An invalid length value was provided.',\n    INVALID_LENGTH_NON_NUMBER: 'An invalid length value was provived. A numeric value is required.',\n    INVALID_TARGET_OFFSET: 'Target offset is beyond the bounds of the internal SmartBuffer data.',\n    INVALID_TARGET_LENGTH: 'Specified length value moves cursor beyong the bounds of the internal SmartBuffer data.',\n    INVALID_READ_BEYOND_BOUNDS: 'Attempted to read beyond the bounds of the managed data.',\n    INVALID_WRITE_BEYOND_BOUNDS: 'Attempted to write beyond the bounds of the managed data.'\n};\nexports.ERRORS = ERRORS;\n/**\n * Checks if a given encoding is a valid Buffer encoding. (Throws an exception if check fails)\n *\n * @param { String } encoding The encoding string to check.\n */\nfunction checkEncoding(encoding) {\n    if (!Buffer.isEncoding(encoding)) {\n        throw new Error(ERRORS.INVALID_ENCODING);\n    }\n}\nexports.checkEncoding = checkEncoding;\n/**\n * Checks if a given number is a finite integer. (Throws an exception if check fails)\n *\n * @param { Number } value The number value to check.\n */\nfunction isFiniteInteger(value) {\n    return typeof value === 'number' && isFinite(value) && isInteger(value);\n}\nexports.isFiniteInteger = isFiniteInteger;\n/**\n * Checks if an offset/length value is valid. (Throws an exception if check fails)\n *\n * @param value The value to check.\n * @param offset True if checking an offset, false if checking a length.\n */\nfunction checkOffsetOrLengthValue(value, offset) {\n    if (typeof value === 'number') {\n        // Check for non finite/non integers\n        if (!isFiniteInteger(value) || value < 0) {\n            throw new Error(offset ? ERRORS.INVALID_OFFSET : ERRORS.INVALID_LENGTH);\n        }\n    }\n    else {\n        throw new Error(offset ? ERRORS.INVALID_OFFSET_NON_NUMBER : ERRORS.INVALID_LENGTH_NON_NUMBER);\n    }\n}\n/**\n * Checks if a length value is valid. (Throws an exception if check fails)\n *\n * @param { Number } length The value to check.\n */\nfunction checkLengthValue(length) {\n    checkOffsetOrLengthValue(length, false);\n}\nexports.checkLengthValue = checkLengthValue;\n/**\n * Checks if a offset value is valid. (Throws an exception if check fails)\n *\n * @param { Number } offset The value to check.\n */\nfunction checkOffsetValue(offset) {\n    checkOffsetOrLengthValue(offset, true);\n}\nexports.checkOffsetValue = checkOffsetValue;\n/**\n * Checks if a target offset value is out of bounds. (Throws an exception if check fails)\n *\n * @param { Number } offset The offset value to check.\n * @param { SmartBuffer } buff The SmartBuffer instance to check against.\n */\nfunction checkTargetOffset(offset, buff) {\n    if (offset < 0 || offset > buff.length) {\n        throw new Error(ERRORS.INVALID_TARGET_OFFSET);\n    }\n}\nexports.checkTargetOffset = checkTargetOffset;\n/**\n * Determines whether a given number is a integer.\n * @param value The number to check.\n */\nfunction isInteger(value) {\n    return typeof value === 'number' && isFinite(value) && Math.floor(value) === value;\n}\n//# sourceMappingURL=utils.js.map\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/smart-buffer/build/utils.js\n// module id = 1237\n// module chunks = 0\n\n//# sourceURL=../node_modules/smart-buffer/build/utils.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\n/**\n * Module dependencies.\n */\n\nvar parseuri = __webpack_require__(501);\nvar debug = __webpack_require__(5)('socket.io-client:url');\n\n/**\n * Module exports.\n */\n\nmodule.exports = url;\n\n/**\n * URL parser.\n *\n * @param {String} url\n * @param {Object} An object meant to mimic window.location.\n *                 Defaults to window.location.\n * @api public\n */\n\nfunction url (uri, loc) {\n  var obj = uri;\n\n  // default to window.location\n  loc = loc || global.location;\n  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\n  // relative path support\n  if ('string' === typeof uri) {\n    if ('/' === uri.charAt(0)) {\n      if ('/' === uri.charAt(1)) {\n        uri = loc.protocol + uri;\n      } else {\n        uri = loc.host + uri;\n      }\n    }\n\n    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n      debug('protocol-less url %s', uri);\n      if ('undefined' !== typeof loc) {\n        uri = loc.protocol + '//' + uri;\n      } else {\n        uri = 'https://' + uri;\n      }\n    }\n\n    // parse\n    debug('parse %s', uri);\n    obj = parseuri(uri);\n  }\n\n  // make sure we treat `localhost:80` and `localhost` equally\n  if (!obj.port) {\n    if (/^(http|ws)$/.test(obj.protocol)) {\n      obj.port = '80';\n    } else if (/^(http|ws)s$/.test(obj.protocol)) {\n      obj.port = '443';\n    }\n  }\n\n  obj.path = obj.path || '/';\n\n  var ipv6 = obj.host.indexOf(':') !== -1;\n  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\n  // define unique id\n  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n  // define href\n  obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));\n\n  return obj;\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-client/lib/url.js\n// module id = 1238\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-client/lib/url.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {/*global Blob,File*/\n\n/**\n * Module requirements\n */\n\nvar isArray = __webpack_require__(542);\nvar isBuf = __webpack_require__(541);\nvar toString = Object.prototype.toString;\nvar withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';\nvar withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';\n\n/**\n * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n * Anything with blobs or files should be fed through removeBlobs before coming\n * here.\n *\n * @param {Object} packet - socket.io event packet\n * @return {Object} with deconstructed packet and list of buffers\n * @api public\n */\n\nexports.deconstructPacket = function(packet) {\n  var buffers = [];\n  var packetData = packet.data;\n  var pack = packet;\n  pack.data = _deconstructPacket(packetData, buffers);\n  pack.attachments = buffers.length; // number of binary 'attachments'\n  return {packet: pack, buffers: buffers};\n};\n\nfunction _deconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (isBuf(data)) {\n    var placeholder = { _placeholder: true, num: buffers.length };\n    buffers.push(data);\n    return placeholder;\n  } else if (isArray(data)) {\n    var newData = new Array(data.length);\n    for (var i = 0; i < data.length; i++) {\n      newData[i] = _deconstructPacket(data[i], buffers);\n    }\n    return newData;\n  } else if (typeof data === 'object' && !(data instanceof Date)) {\n    var newData = {};\n    for (var key in data) {\n      newData[key] = _deconstructPacket(data[key], buffers);\n    }\n    return newData;\n  }\n  return data;\n}\n\n/**\n * Reconstructs a binary packet from its placeholder packet and buffers\n *\n * @param {Object} packet - event packet with placeholders\n * @param {Array} buffers - binary buffers to put in placeholder positions\n * @return {Object} reconstructed packet\n * @api public\n */\n\nexports.reconstructPacket = function(packet, buffers) {\n  packet.data = _reconstructPacket(packet.data, buffers);\n  packet.attachments = undefined; // no longer useful\n  return packet;\n};\n\nfunction _reconstructPacket(data, buffers) {\n  if (!data) return data;\n\n  if (data && data._placeholder) {\n    return buffers[data.num]; // appropriate buffer (should be natural order anyway)\n  } else if (isArray(data)) {\n    for (var i = 0; i < data.length; i++) {\n      data[i] = _reconstructPacket(data[i], buffers);\n    }\n  } else if (typeof data === 'object') {\n    for (var key in data) {\n      data[key] = _reconstructPacket(data[key], buffers);\n    }\n  }\n\n  return data;\n}\n\n/**\n * Asynchronously removes Blobs or Files from data via\n * FileReader's readAsArrayBuffer method. Used before encoding\n * data as msgpack. Calls callback with the blobless data.\n *\n * @param {Object} data\n * @param {Function} callback\n * @api private\n */\n\nexports.removeBlobs = function(data, callback) {\n  function _removeBlobs(obj, curKey, containingObject) {\n    if (!obj) return obj;\n\n    // convert any blob\n    if ((withNativeBlob && obj instanceof Blob) ||\n        (withNativeFile && obj instanceof File)) {\n      pendingBlobs++;\n\n      // async filereader\n      var fileReader = new FileReader();\n      fileReader.onload = function() { // this.result == arraybuffer\n        if (containingObject) {\n          containingObject[curKey] = this.result;\n        }\n        else {\n          bloblessData = this.result;\n        }\n\n        // if nothing pending its callback time\n        if(! --pendingBlobs) {\n          callback(bloblessData);\n        }\n      };\n\n      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n    } else if (isArray(obj)) { // handle array\n      for (var i = 0; i < obj.length; i++) {\n        _removeBlobs(obj[i], i, obj);\n      }\n    } else if (typeof obj === 'object' && !isBuf(obj)) { // and object\n      for (var key in obj) {\n        _removeBlobs(obj[key], key, obj);\n      }\n    }\n  }\n\n  var pendingBlobs = 0;\n  var bloblessData = data;\n  _removeBlobs(bloblessData);\n  if (!pendingBlobs) {\n    callback(bloblessData);\n  }\n};\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-parser/binary.js\n// module id = 1239\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-parser/binary.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\n// socket.io-pull-stream\nconst Queue = __webpack_require__(721)\nconst uuid = __webpack_require__(548)\nconst pull = __webpack_require__(6)\nconst sioname = (type, name) => 'socket.io-pull-stream.' + type + (name ? '.' + name : '')\nconst debug = __webpack_require__(5)\nconst _log = debug('socket.io-pull-stream')\n\nfunction doCodec (codec, data) {\n  if (data == null) return data\n  try {\n    return codec(data)\n  } catch (e) {\n    console.error('Codec Error')\n    console.error(e)\n    return false\n  }\n}\n\nconst codecs = {\n  hex: {\n    encode: v => v.toString('hex'),\n    decode: v => Buffer.from(v, 'hex')\n  },\n  plain: {\n    encode: v => v,\n    decode: v => v\n  },\n  buffer: { // always do Buffer.from because browsers\n    encode: v => Buffer.from(v),\n    decode: v => Buffer.from(v)\n  }\n}\n\nfunction getCodec (c) {\n  if (!c) c = 'plain'\n  if (typeof c === 'object') return c\n  const co = codecs[c]\n  if (!co) throw new Error('Invalid codec ' + c)\n  return co\n}\n\nfunction SIOSource (sio, id, opt) {\n  const q = Queue()\n  const log = sio.sioplog.bind(sio.sioplog, 'source(' + id + ')')\n  const codec = getCodec(opt.codec).decode\n  log('create source')\n  sio.emit(sioname('accept', id))\n\n  function unlisten () {\n    sio.removeAllListeners(sioname('error', id))\n    sio.removeAllListeners(sioname('queue', id))\n  }\n\n  sio.on(sioname('error', id), err => {\n    if (err === true) log('finish')\n    else log('error')\n    unlisten()\n    q.append({end: err})\n  })\n  sio.on(sioname('queue', id), data => {\n    log('queue data')\n    q.append({data: doCodec(codec, data)})\n  })\n  sio.once('disconnect', () => {\n    unlisten()\n    q.append({end: true})\n  })\n  return function (end, cb) {\n    log('reading')\n    if (end) return cb(end)\n    q.get((err, data) => {\n      if (err) return cb(err)\n      if (data.end) {\n        q.error(data.end)\n        return cb(data.end)\n      }\n      return cb(null, data.data)\n    })\n  }\n}\n\nfunction SIOSink (sio, id, opt) {\n  const q = Queue()\n  const log = sio.sioplog.bind(sio.sioplog, '  sink(' + id + ')')\n  const codec = getCodec(opt.codec).encode\n  let ended\n  log('create sink')\n  sio.once(sioname('accept', id), () => {\n    log('start transmission')\n\n    function loop () {\n      q.get((_, val) => {\n        let {data, err} = val || {}\n        if (_) err = _\n        log('send', err && err === true ? 'finish' : err ? 'error' : data ? 'data' : '<invalid>')\n        if (err && !_) q.error(err)\n        if (err) return sio.emit(sioname('error', id), err)\n        if (data) sio.emit(sioname('queue', id), doCodec(codec, data))\n        loop()\n      })\n    }\n    loop()\n  })\n\n  function doErr (end) {\n    q.append({err: end})\n    ended = end\n  }\n\n  sio.once('disconnect', () => doErr(true))\n\n  return function (read) {\n    read(null, function next (end, data) {\n      if (end) return doErr(end)\n      if (ended) return read(ended, next)\n      q.append({data})\n      read(null, next)\n    })\n  }\n}\n\nmodule.exports = function SIOPullStream (sio, opt) {\n  if (sio.createSink) return\n  sio.sioplog = sio.id ? _log.bind(_log, '[' + sio.id + ']') : _log\n  sio.createSink = (id, _) => {\n    if (!id) id = uuid()\n    const sink = SIOSink(sio, id, opt || _)\n    sink.id = id\n    return sink\n  }\n  sio.createSource = (id, _) => {\n    const source = SIOSource(sio, id, opt || _)\n    source.id = id\n    return source\n  }\n  sio.createProxy = (id, tsio, _) => {\n    pull(\n      sio.createSource(id, _),\n      tsio.createSink(id, _)\n    )\n  }\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/socket.io-pull-stream/src/index.js\n// module id = 1240\n// module chunks = 0\n\n//# sourceURL=../node_modules/socket.io-pull-stream/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\n// JS treats subjects of bitwise operators as SIGNED 32 bit numbers,\n// which means the maximum amount of bits we can store inside each byte\n// is 7..\nconst BITS_PER_BYTE = 7\n\nmodule.exports = class SparseArray {\n  constructor () {\n    this._bitArrays = []\n    this._data = []\n    this._length = 0\n    this._changedLength = false\n    this._changedData = false\n  }\n\n  set (index, value) {\n    let pos = this._internalPositionFor(index, false)\n    if (value === undefined) {\n      // unsetting\n      if (pos !== -1) {\n        // remove item from bit array and array itself\n        this._unsetInternalPos(pos)\n        this._unsetBit(index)\n        this._changedLength = true\n        this._changedData = true\n      }\n    } else {\n      let needsSort = false\n      if (pos === -1) {\n        pos = this._data.length\n        this._setBit(index)\n        this._changedData = true\n      } else {\n        needsSort = true\n      }\n      this._setInternalPos(pos, index, value, needsSort)\n      this._changedLength = true\n    }\n  }\n\n  unset (index) {\n    this.set(index, undefined)\n  }\n\n  get (index) {\n    this._sortData()\n    const pos = this._internalPositionFor(index, true)\n    if (pos === -1) {\n      return undefined\n    }\n    return this._data[pos][1]\n  }\n\n  push (value) {\n    this.set(this.length, value)\n    return this.length\n  }\n\n  get length () {\n    this._sortData()\n    if (this._changedLength) {\n      const last = this._data[this._data.length - 1]\n      this._length = last ? last[0] + 1 : 0\n      this._changedLength = false\n    }\n    return this._length\n  }\n\n  forEach (iterator) {\n    let i = 0\n    while(i < this.length) {\n      iterator(this.get(i), i, this)\n      i++\n    }\n  }\n\n  map (iterator) {\n    let i = 0\n    let mapped = new Array(this.length)\n    while(i < this.length) {\n      mapped[i] = iterator(this.get(i), i, this)\n      i++\n    }\n    return mapped\n  }\n\n  reduce (reducer, initialValue) {\n    let i = 0\n    let acc = initialValue\n    while(i < this.length) {\n      const value = this.get(i)\n      acc = reducer(acc, value, i)\n      i++\n    }\n    return acc\n  }\n\n  find (finder) {\n    let i = 0, found, last\n    while ((i < this.length) && !found) {\n      last = this.get(i)\n      found = finder(last)\n      i++\n    }\n    return found ? last : undefined\n  }\n\n  _internalPositionFor (index, noCreate) {\n    const bytePos = this._bytePosFor(index, noCreate)\n    if (bytePos >= this._bitArrays.length) {\n      return -1\n    }\n    const byte = this._bitArrays[bytePos]\n    const bitPos = index - bytePos * BITS_PER_BYTE\n    const exists = (byte & (1 << bitPos)) > 0\n    if (!exists) {\n      return -1\n    }\n    const previousPopCount = this._bitArrays.slice(0, bytePos).reduce(popCountReduce, 0)\n\n    const mask = ~(0xffffffff << (bitPos + 1))\n    const bytePopCount = popCount(byte & mask)\n    const arrayPos = previousPopCount + bytePopCount - 1\n    return arrayPos\n  }\n\n  _bytePosFor (index, noCreate) {\n    const bytePos = Math.floor(index / BITS_PER_BYTE)\n    const targetLength = bytePos + 1\n    while (!noCreate && this._bitArrays.length < targetLength) {\n      this._bitArrays.push(0)\n    }\n    return bytePos\n  }\n\n  _setBit (index) {\n    const bytePos = this._bytePosFor(index, false)\n    this._bitArrays[bytePos] |= (1 << (index - (bytePos * BITS_PER_BYTE)))\n  }\n\n  _unsetBit(index) {\n    const bytePos = this._bytePosFor(index, false)\n    this._bitArrays[bytePos] &= ~(1 << (index - (bytePos * BITS_PER_BYTE)))\n  }\n\n  _setInternalPos(pos, index, value, needsSort) {\n    const data =this._data\n    const elem = [index, value]\n    if (needsSort) {\n      this._sortData()\n      data[pos] = elem\n    } else {\n      // new element. just shove it into the array\n      // but be nice about where we shove it\n      // in order to make sorting it later easier\n      if (data.length) {\n        if (data[data.length - 1][0] >= index) {\n          data.push(elem)\n        } else if (data[0][0] <= index) {\n          data.unshift(elem)\n        } else {\n          const randomIndex = Math.round(data.length / 2)\n          this._data = data.slice(0, randomIndex).concat(elem).concat(data.slice(randomIndex))\n        }\n      } else {\n        this._data.push(elem)\n      }\n      this._changedData = true\n      this._changedLength = true\n    }\n  }\n\n  _unsetInternalPos (pos) {\n    this._data.splice(pos, 1)\n  }\n\n  _sortData () {\n    if (this._changedData) {\n      this._data.sort(sortInternal)\n    }\n  }\n\n  bitField () {\n    const bytes = []\n    let pendingBitsForResultingByte = 8\n    let pendingBitsForNewByte = 0\n    let resultingByte = 0\n    let newByte\n    const pending = this._bitArrays.slice()\n    while (pending.length || pendingBitsForNewByte) {\n      if (pendingBitsForNewByte === 0) {\n        newByte = pending.shift()\n        pendingBitsForNewByte = 7\n      }\n\n      const usingBits = Math.min(pendingBitsForNewByte, pendingBitsForResultingByte)\n      const mask = ~(0b11111111 << usingBits)\n      const masked = newByte & mask\n      resultingByte |= masked << (8 - pendingBitsForResultingByte)\n      newByte = newByte >>> usingBits\n      pendingBitsForNewByte -= usingBits\n      pendingBitsForResultingByte -= usingBits\n\n      if (!pendingBitsForResultingByte || (!pendingBitsForNewByte && !pending.length)) {\n        bytes.push(resultingByte)\n        resultingByte = 0\n        pendingBitsForResultingByte = 8\n      }\n    }\n\n    // remove trailing zeroes\n    for(var i = bytes.length - 1; i > 0; i--) {\n      const value = bytes[i]\n      if (value === 0) {\n        bytes.pop()\n      } else {\n        break\n      }\n    }\n\n    return bytes\n  }\n\n  compactArray () {\n    this._sortData()\n    return this._data.map(valueOnly)\n  }\n}\n\nfunction popCountReduce (count, byte) {\n  return count + popCount(byte)\n}\n\nfunction popCount(_v) {\n  let v = _v\n  v = v - ((v >> 1) & 0x55555555)                    // reuse input as temporary\n  v = (v & 0x33333333) + ((v >> 2) & 0x33333333)     // temp\n  return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24\n}\n\nfunction sortInternal (a, b) {\n  return a[0] - b[0]\n}\n\nfunction valueOnly (elem) {\n  return elem[1]\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/sparse-array/index.js\n// module id = 1241\n// module chunks = 0\n\n//# sourceURL=../node_modules/sparse-array/index.js")},function(module,exports,__webpack_require__){eval("//! stable.js 0.1.8, https://github.com/Two-Screen/stable\n//! © 2018 Angry Bytes and contributors. MIT licensed.\n\n(function (global, factory) {\n   true ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  (global.stable = factory());\n}(this, (function () { 'use strict';\n\n  // A stable array sort, because `Array#sort()` is not guaranteed stable.\n  // This is an implementation of merge sort, without recursion.\n\n  var stable = function (arr, comp) {\n    return exec(arr.slice(), comp)\n  };\n\n  stable.inplace = function (arr, comp) {\n    var result = exec(arr, comp);\n\n    // This simply copies back if the result isn't in the original array,\n    // which happens on an odd number of passes.\n    if (result !== arr) {\n      pass(result, null, arr.length, arr);\n    }\n\n    return arr\n  };\n\n  // Execute the sort using the input array and a second buffer as work space.\n  // Returns one of those two, containing the final result.\n  function exec(arr, comp) {\n    if (typeof(comp) !== 'function') {\n      comp = function (a, b) {\n        return String(a).localeCompare(b)\n      };\n    }\n\n    // Short-circuit when there's nothing to sort.\n    var len = arr.length;\n    if (len <= 1) {\n      return arr\n    }\n\n    // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc.\n    // Chunks are the size of the left or right hand in merge sort.\n    // Stop when the left-hand covers all of the array.\n    var buffer = new Array(len);\n    for (var chk = 1; chk < len; chk *= 2) {\n      pass(arr, comp, chk, buffer);\n\n      var tmp = arr;\n      arr = buffer;\n      buffer = tmp;\n    }\n\n    return arr\n  }\n\n  // Run a single pass with the given chunk size.\n  var pass = function (arr, comp, chk, result) {\n    var len = arr.length;\n    var i = 0;\n    // Step size / double chunk size.\n    var dbl = chk * 2;\n    // Bounds of the left and right chunks.\n    var l, r, e;\n    // Iterators over the left and right chunk.\n    var li, ri;\n\n    // Iterate over pairs of chunks.\n    for (l = 0; l < len; l += dbl) {\n      r = l + chk;\n      e = r + chk;\n      if (r > len) r = len;\n      if (e > len) e = len;\n\n      // Iterate both chunks in parallel.\n      li = l;\n      ri = r;\n      while (true) {\n        // Compare the chunks.\n        if (li < r && ri < e) {\n          // This works for a regular `sort()` compatible comparator,\n          // but also for a simple comparator like: `a > b`\n          if (comp(arr[li], arr[ri]) <= 0) {\n            result[i++] = arr[li++];\n          }\n          else {\n            result[i++] = arr[ri++];\n          }\n        }\n        // Nothing to compare, just flush what's left.\n        else if (li < r) {\n          result[i++] = arr[li++];\n        }\n        else if (ri < e) {\n          result[i++] = arr[ri++];\n        }\n        // Both iterators are at the chunk ends.\n        else {\n          break\n        }\n      }\n    }\n  };\n\n  return stable;\n\n})));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stable/stable.js\n// module id = 1242\n// module chunks = 0\n\n//# sourceURL=../node_modules/stable/stable.js")},function(module,exports){eval("module.exports = shift\n\nfunction shift (stream) {\n  var rs = stream._readableState\n  if (!rs) return null\n  return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))\n}\n\nfunction getStateLength (state) {\n  if (state.buffer.length) {\n    // Since node 6.3.0 state.buffer is a BufferList not an array\n    if (state.buffer.head) {\n      return state.buffer.head.data.length\n    }\n\n    return state.buffer[0].length\n  }\n\n  return state.length\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/stream-shift/index.js\n// module id = 1243\n// module chunks = 0\n\n//# sourceURL=../node_modules/stream-shift/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\nmodule.exports = function (str) {\n\treturn encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n\t\treturn '%' + c.charCodeAt(0).toString(16).toUpperCase();\n\t});\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/strict-uri-encode/index.js\n// module id = 1244\n// module chunks = 0\n\n//# sourceURL=../node_modules/strict-uri-encode/index.js")},function(module,exports){eval('var picker = function picker(type) {\n  return function () {\n    return new Promise(function (resolve, reject) {\n      var fileLoader = function fileLoader(e) {\n        var directory = {};\n        var totalFiles = e.target.files.length;\n        var loadedFiles = 0;\n        [].map.call(e.target.files, function (file) {\n          var reader = new FileReader();\n          reader.onload = function (e) {\n            var data = new Uint8Array(e.target.result);\n            if (type === "directory") {\n              var path = file.webkitRelativePath;\n              directory[path.slice(path.indexOf("/") + 1)] = {\n                type: "text/plain",\n                data: data\n              };\n              if (++loadedFiles === totalFiles) resolve(directory);\n            } else if (type === "file") {\n              var _path = file.webkitRelativePath;\n              resolve({ "type": mimetype.lookup(_path), "data": data });\n            } else {\n              resolve(data);\n            }\n          };\n          reader.readAsArrayBuffer(file);\n        });\n      };\n\n      var fileInput = void 0;\n      if (type === "directory") {\n        fileInput = document.createElement("input");\n        fileInput.addEventListener("change", fileLoader);\n        fileInput.type = "file";\n        fileInput.webkitdirectory = true;\n        fileInput.mozdirectory = true;\n        fileInput.msdirectory = true;\n        fileInput.odirectory = true;\n        fileInput.directory = true;\n      } else {\n        fileInput = document.createElement("input");\n        fileInput.addEventListener("change", fileLoader);\n        fileInput.type = "file";\n      };\n\n      var mouseEvent = document.createEvent("MouseEvents");\n      mouseEvent.initEvent("click", true, false);\n      fileInput.dispatchEvent(mouseEvent);\n    });\n  };\n};\n\nmodule.exports = {\n  data: picker("data"),\n  file: picker("file"),\n  directory: picker("directory")\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/swarm-js/lib/pick.js\n// module id = 1245\n// module chunks = 0\n\n//# sourceURL=../node_modules/swarm-js/lib/pick.js')},function(module,exports,__webpack_require__){eval('// Thanks https://github.com/axic/swarmhash\n\nvar keccak = __webpack_require__(261).keccak256;\nvar Bytes = __webpack_require__(406);\n\nvar swarmHashBlock = function swarmHashBlock(length, data) {\n  var lengthEncoded = Bytes.reverse(Bytes.pad(6, Bytes.fromNumber(length)));\n  var bytes = Bytes.flatten([lengthEncoded, "0x0000", data]);\n  return keccak(bytes).slice(2);\n};\n\n// (Bytes | Uint8Array | String) -> String\nvar swarmHash = function swarmHash(data) {\n  if (typeof data === "string" && data.slice(0, 2) !== "0x") {\n    data = Bytes.fromString(data);\n  } else if (typeof data !== "string" && data.length !== undefined) {\n    data = Bytes.fromUint8Array(data);\n  }\n\n  var length = Bytes.length(data);\n\n  if (length <= 4096) {\n    return swarmHashBlock(length, data);\n  }\n\n  var maxSize = 4096;\n  while (maxSize * (4096 / 32) < length) {\n    maxSize *= 4096 / 32;\n  }\n\n  var innerNodes = [];\n  for (var i = 0; i < length; i += maxSize) {\n    var size = maxSize < length - i ? maxSize : length - i;\n    innerNodes.push(swarmHash(Bytes.slice(data, i, i + size)));\n  }\n\n  return swarmHashBlock(length, Bytes.flatten(innerNodes));\n};\n\nmodule.exports = swarmHash;\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/swarm-js/lib/swarm-hash.js\n// module id = 1246\n// module chunks = 0\n\n//# sourceURL=../node_modules/swarm-js/lib/swarm-hash.js')},function(module,exports){eval('// TODO: this is a temporary fix to hide those libraries from the browser. A\n// slightly better long-term solution would be to split this file into two,\n// separating the functions that are used on Node.js from the functions that\n// are used only on the browser.\nmodule.exports = function (_ref) {\n  var fsp = _ref.fsp,\n      files = _ref.files,\n      os = _ref.os,\n      path = _ref.path,\n      child_process = _ref.child_process,\n      mimetype = _ref.mimetype,\n      defaultArchives = _ref.defaultArchives,\n      request = _ref.request,\n      downloadUrl = _ref.downloadUrl,\n      bytes = _ref.bytes,\n      hash = _ref.hash,\n      pick = _ref.pick;\n\n\n  // ∀ a . String -> JSON -> Map String a -o Map String a\n  //   Inserts a key/val pair in an object impurely.\n  var impureInsert = function impureInsert(key) {\n    return function (val) {\n      return function (map) {\n        return map[key] = val, map;\n      };\n    };\n  };\n\n  // String -> JSON -> Map String JSON\n  //   Merges an array of keys and an array of vals into an object.\n  var toMap = function toMap(keys) {\n    return function (vals) {\n      var map = {};\n      for (var i = 0, l = keys.length; i < l; ++i) {\n        map[keys[i]] = vals[i];\n      }return map;\n    };\n  };\n\n  // ∀ a . Map String a -> Map String a -> Map String a\n  //   Merges two maps into one.\n  var merge = function merge(a) {\n    return function (b) {\n      var map = {};\n      for (var key in a) {\n        map[key] = a[key];\n      }for (var _key in b) {\n        map[_key] = b[_key];\n      }return map;\n    };\n  };\n\n  // ∀ a . [a] -> [a] -> Bool\n  var equals = function equals(a) {\n    return function (b) {\n      if (a.length !== b.length) {\n        return false;\n      } else {\n        for (var i = 0, l = a.length; i < a; ++i) {\n          if (a[i] !== b[i]) return false;\n        }\n      }\n      return true;\n    };\n  };\n\n  // String -> String -> String\n  var rawUrl = function rawUrl(swarmUrl) {\n    return function (hash) {\n      return swarmUrl + "/bzzr:/" + hash;\n    };\n  };\n\n  // String -> String -> Promise Uint8Array\n  //   Gets the raw contents of a Swarm hash address.\n  var downloadData = function downloadData(swarmUrl) {\n    return function (hash) {\n      return request(rawUrl(swarmUrl)(hash), { responseType: "arraybuffer" }).then(function (arrayBuffer) {\n        var uint8Array = new Uint8Array(arrayBuffer);\n        var error404 = [52, 48, 52, 32, 112, 97, 103, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 10];\n        if (equals(uint8Array)(error404)) throw "Error 404.";\n        return uint8Array;\n      });\n    };\n  };\n\n  // type Entry = {"type": String, "hash": String}\n  // type File = {"type": String, "data": Uint8Array}\n\n  // String -> String -> Promise (Map String Entry)\n  //   Solves the manifest of a Swarm address recursively.\n  //   Returns a map from full paths to entries.\n  var downloadEntries = function downloadEntries(swarmUrl) {\n    return function (hash) {\n      var search = function search(hash) {\n        return function (path) {\n          return function (routes) {\n            // Formats an entry to the Swarm.js type.\n            var format = function format(entry) {\n              return {\n                type: entry.contentType,\n                hash: entry.hash };\n            };\n\n            // To download a single entry:\n            //   if type is bzz-manifest, go deeper\n            //   if not, add it to the routing table\n            var downloadEntry = function downloadEntry(entry) {\n              if (entry.path === undefined) {\n                return Promise.resolve();\n              } else {\n                return entry.contentType === "application/bzz-manifest+json" ? search(entry.hash)(path + entry.path)(routes) : Promise.resolve(impureInsert(path + entry.path)(format(entry))(routes));\n              }\n            };\n\n            // Downloads the initial manifest and then each entry.\n            return downloadData(swarmUrl)(hash).then(function (text) {\n              return JSON.parse(toString(text)).entries;\n            }).then(function (entries) {\n              return Promise.all(entries.map(downloadEntry));\n            }).then(function () {\n              return routes;\n            });\n          };\n        };\n      };\n\n      return search(hash)("")({});\n    };\n  };\n\n  // String -> String -> Promise (Map String String)\n  //   Same as `downloadEntries`, but returns only hashes (no types).\n  var downloadRoutes = function downloadRoutes(swarmUrl) {\n    return function (hash) {\n      return downloadEntries(swarmUrl)(hash).then(function (entries) {\n        return toMap(Object.keys(entries))(Object.keys(entries).map(function (route) {\n          return entries[route].hash;\n        }));\n      });\n    };\n  };\n\n  // String -> String -> Promise (Map String File)\n  //   Gets the entire directory tree in a Swarm address.\n  //   Returns a promise mapping paths to file contents.\n  var downloadDirectory = function downloadDirectory(swarmUrl) {\n    return function (hash) {\n      return downloadEntries(swarmUrl)(hash).then(function (entries) {\n        var paths = Object.keys(entries);\n        var hashs = paths.map(function (path) {\n          return entries[path].hash;\n        });\n        var types = paths.map(function (path) {\n          return entries[path].type;\n        });\n        var datas = hashs.map(downloadData(swarmUrl));\n        var files = function files(datas) {\n          return datas.map(function (data, i) {\n            return { type: types[i], data: data };\n          });\n        };\n        return Promise.all(datas).then(function (datas) {\n          return toMap(paths)(files(datas));\n        });\n      });\n    };\n  };\n\n  // String -> String -> String -> Promise String\n  //   Gets the raw contents of a Swarm hash address.\n  //   Returns a promise with the downloaded file path.\n  var downloadDataToDisk = function downloadDataToDisk(swarmUrl) {\n    return function (hash) {\n      return function (filePath) {\n        return files.download(rawUrl(swarmUrl)(hash))(filePath);\n      };\n    };\n  };\n\n  // String -> String -> String -> Promise (Map String String)\n  //   Gets the entire directory tree in a Swarm address.\n  //   Returns a promise mapping paths to file contents.\n  var downloadDirectoryToDisk = function downloadDirectoryToDisk(swarmUrl) {\n    return function (hash) {\n      return function (dirPath) {\n        return downloadRoutes(swarmUrl)(hash).then(function (routingTable) {\n          var downloads = [];\n          for (var route in routingTable) {\n            if (route.length > 0) {\n              var filePath = path.join(dirPath, route);\n              downloads.push(downloadDataToDisk(swarmUrl)(routingTable[route])(filePath));\n            };\n          };\n          return Promise.all(downloads).then(function () {\n            return dirPath;\n          });\n        });\n      };\n    };\n  };\n\n  // String -> Uint8Array -> Promise String\n  //   Uploads raw data to Swarm.\n  //   Returns a promise with the uploaded hash.\n  var uploadData = function uploadData(swarmUrl) {\n    return function (data) {\n      return request(swarmUrl + "/bzzr:/", {\n        body: typeof data === "string" ? fromString(data) : data,\n        method: "POST" });\n    };\n  };\n\n  // String -> String -> String -> File -> Promise String\n  //   Uploads a file to the Swarm manifest at a given hash, under a specific\n  //   route. Returns a promise containing the uploaded hash.\n  //   FIXME: for some reasons Swarm-Gateways is sometimes returning\n  //   error 404 (bad request), so we retry up to 3 times. Why?\n  var uploadToManifest = function uploadToManifest(swarmUrl) {\n    return function (hash) {\n      return function (route) {\n        return function (file) {\n          var attempt = function attempt(n) {\n            var slashRoute = route[0] === "/" ? route : "/" + route;\n            var url = swarmUrl + "/bzz:/" + hash + slashRoute;\n            var opt = {\n              method: "PUT",\n              headers: { "Content-Type": file.type },\n              body: file.data };\n            return request(url, opt).then(function (response) {\n              if (response.indexOf("error") !== -1) {\n                throw response;\n              }\n              return response;\n            }).catch(function (e) {\n              return n > 0 && attempt(n - 1);\n            });\n          };\n          return attempt(3);\n        };\n      };\n    };\n  };\n\n  // String -> {type: String, data: Uint8Array} -> Promise String\n  var uploadFile = function uploadFile(swarmUrl) {\n    return function (file) {\n      return uploadDirectory(swarmUrl)({ "": file });\n    };\n  };\n\n  // String -> String -> Promise String\n  var uploadFileFromDisk = function uploadFileFromDisk(swarmUrl) {\n    return function (filePath) {\n      return fsp.readFile(filePath).then(function (data) {\n        return uploadFile(swarmUrl)({ type: mimetype.lookup(filePath), data: data });\n      });\n    };\n  };\n\n  // String -> Map String File -> Promise String\n  //   Uploads a directory to Swarm. The directory is\n  //   represented as a map of routes and files.\n  //   A default path is encoded by having a "" route.\n  var uploadDirectory = function uploadDirectory(swarmUrl) {\n    return function (directory) {\n      return uploadData(swarmUrl)("{}").then(function (hash) {\n        var uploadRoute = function uploadRoute(route) {\n          return function (hash) {\n            return uploadToManifest(swarmUrl)(hash)(route)(directory[route]);\n          };\n        };\n        var uploadToHash = function uploadToHash(hash, route) {\n          return hash.then(uploadRoute(route));\n        };\n        return Object.keys(directory).reduce(uploadToHash, Promise.resolve(hash));\n      });\n    };\n  };\n\n  // String -> Promise String\n  var uploadDataFromDisk = function uploadDataFromDisk(swarmUrl) {\n    return function (filePath) {\n      return fsp.readFile(filePath).then(uploadData(swarmUrl));\n    };\n  };\n\n  // String -> Nullable String -> String -> Promise String\n  var uploadDirectoryFromDisk = function uploadDirectoryFromDisk(swarmUrl) {\n    return function (defaultPath) {\n      return function (dirPath) {\n        return files.directoryTree(dirPath).then(function (fullPaths) {\n          return Promise.all(fullPaths.map(function (path) {\n            return fsp.readFile(path);\n          })).then(function (datas) {\n            var paths = fullPaths.map(function (path) {\n              return path.slice(dirPath.length);\n            });\n            var types = fullPaths.map(function (path) {\n              return mimetype.lookup(path) || "text/plain";\n            });\n            return toMap(paths)(datas.map(function (data, i) {\n              return { type: types[i], data: data };\n            }));\n          });\n        }).then(function (directory) {\n          return merge(defaultPath ? { "": directory[defaultPath] } : {})(directory);\n        }).then(uploadDirectory(swarmUrl));\n      };\n    };\n  };\n\n  // String -> UploadInfo -> Promise String\n  //   Simplified multi-type upload which calls the correct\n  //   one based on the type of the argument given.\n  var _upload = function _upload(swarmUrl) {\n    return function (arg) {\n      // Upload raw data from browser\n      if (arg.pick === "data") {\n        return pick.data().then(uploadData(swarmUrl));\n\n        // Upload a file from browser\n      } else if (arg.pick === "file") {\n        return pick.file().then(uploadFile(swarmUrl));\n\n        // Upload a directory from browser\n      } else if (arg.pick === "directory") {\n        return pick.directory().then(uploadDirectory(swarmUrl));\n\n        // Upload directory/file from disk\n      } else if (arg.path) {\n        switch (arg.kind) {\n          case "data":\n            return uploadDataFromDisk(swarmUrl)(arg.path);\n          case "file":\n            return uploadFileFromDisk(swarmUrl)(arg.path);\n          case "directory":\n            return uploadDirectoryFromDisk(swarmUrl)(arg.defaultFile)(arg.path);\n        };\n\n        // Upload UTF-8 string or raw data (buffer)\n      } else if (arg.length || typeof arg === "string") {\n        return uploadData(swarmUrl)(arg);\n\n        // Upload directory with JSON\n      } else if (arg instanceof Object) {\n        return uploadDirectory(swarmUrl)(arg);\n      }\n\n      return Promise.reject(new Error("Bad arguments"));\n    };\n  };\n\n  // String -> String -> Nullable String -> Promise (String | Uint8Array | Map String Uint8Array)\n  //   Simplified multi-type download which calls the correct function based on\n  //   the type of the argument given, and on whether the Swwarm address has a\n  //   directory or a file.\n  var _download = function _download(swarmUrl) {\n    return function (hash) {\n      return function (path) {\n        return isDirectory(swarmUrl)(hash).then(function (isDir) {\n          if (isDir) {\n            return path ? downloadDirectoryToDisk(swarmUrl)(hash)(path) : downloadDirectory(swarmUrl)(hash);\n          } else {\n            return path ? downloadDataToDisk(swarmUrl)(hash)(path) : downloadData(swarmUrl)(hash);\n          }\n        });\n      };\n    };\n  };\n\n  // String -> Promise String\n  //   Downloads the Swarm binaries into a path. Returns a promise that only\n  //   resolves when the exact Swarm file is there, and verified to be correct.\n  //   If it was already there to begin with, skips the download.\n  var downloadBinary = function downloadBinary(path, archives) {\n    var system = os.platform().replace("win32", "windows") + "-" + (os.arch() === "x64" ? "amd64" : "386");\n    var archive = (archives || defaultArchives)[system];\n    var archiveUrl = downloadUrl + archive.archive + ".tar.gz";\n    var archiveMD5 = archive.archiveMD5;\n    var binaryMD5 = archive.binaryMD5;\n    return files.safeDownloadArchived(archiveUrl)(archiveMD5)(binaryMD5)(path);\n  };\n\n  // type SwarmSetup = {\n  //   account : String,\n  //   password : String,\n  //   dataDir : String,\n  //   binPath : String,\n  //   ensApi : String,\n  //   onDownloadProgress : Number ~> (),\n  //   archives : [{\n  //     archive: String,\n  //     binaryMD5: String,\n  //     archiveMD5: String\n  //   }]\n  // }\n\n  // SwarmSetup ~> Promise Process\n  //   Starts the Swarm process.\n  var startProcess = function startProcess(swarmSetup) {\n    return new Promise(function (resolve, reject) {\n      var spawn = child_process.spawn;\n\n\n      var hasString = function hasString(str) {\n        return function (buffer) {\n          return (\'\' + buffer).indexOf(str) !== -1;\n        };\n      };\n      var account = swarmSetup.account,\n          password = swarmSetup.password,\n          dataDir = swarmSetup.dataDir,\n          ensApi = swarmSetup.ensApi,\n          privateKey = swarmSetup.privateKey;\n\n\n      var STARTUP_TIMEOUT_SECS = 3;\n      var WAITING_PASSWORD = 0;\n      var STARTING = 1;\n      var LISTENING = 2;\n      var PASSWORD_PROMPT_HOOK = "Passphrase";\n      var LISTENING_HOOK = "Swarm http proxy started";\n\n      var state = WAITING_PASSWORD;\n\n      var swarmProcess = spawn(swarmSetup.binPath, [\'--bzzaccount\', account || privateKey, \'--datadir\', dataDir, \'--ens-api\', ensApi]);\n\n      var handleProcessOutput = function handleProcessOutput(data) {\n        if (state === WAITING_PASSWORD && hasString(PASSWORD_PROMPT_HOOK)(data)) {\n          setTimeout(function () {\n            state = STARTING;\n            swarmProcess.stdin.write(password + \'\\n\');\n          }, 500);\n        } else if (hasString(LISTENING_HOOK)(data)) {\n          state = LISTENING;\n          clearTimeout(timeout);\n          resolve(swarmProcess);\n        }\n      };\n\n      swarmProcess.stdout.on(\'data\', handleProcessOutput);\n      swarmProcess.stderr.on(\'data\', handleProcessOutput);\n      //swarmProcess.on(\'close\', () => setTimeout(restart, 2000));\n\n      var restart = function restart() {\n        return startProcess(swarmSetup).then(resolve).catch(reject);\n      };\n      var error = function error() {\n        return reject(new Error("Couldn\'t start swarm process."));\n      };\n      var timeout = setTimeout(error, 20000);\n    });\n  };\n\n  // Process ~> Promise ()\n  //   Stops the Swarm process.\n  var stopProcess = function stopProcess(process) {\n    return new Promise(function (resolve, reject) {\n      process.stderr.removeAllListeners(\'data\');\n      process.stdout.removeAllListeners(\'data\');\n      process.stdin.removeAllListeners(\'error\');\n      process.removeAllListeners(\'error\');\n      process.removeAllListeners(\'exit\');\n      process.kill(\'SIGINT\');\n\n      var killTimeout = setTimeout(function () {\n        return process.kill(\'SIGKILL\');\n      }, 8000);\n\n      process.once(\'close\', function () {\n        clearTimeout(killTimeout);\n        resolve();\n      });\n    });\n  };\n\n  // SwarmSetup -> (SwarmAPI -> Promise ()) -> Promise ()\n  //   Receives a Swarm configuration object and a callback function. It then\n  //   checks if a local Swarm node is running. If no local Swarm is found, it\n  //   downloads the Swarm binaries to the dataDir (if not there), checksums,\n  //   starts the Swarm process and calls the callback function with an API\n  //   object using the local node. That callback must return a promise which\n  //   will resolve when it is done using the API, so that this function can\n  //   close the Swarm process properly. Returns a promise that resolves when the\n  //   user is done with the API and the Swarm process is closed.\n  //   TODO: check if Swarm process is already running (improve `isAvailable`)\n  var local = function local(swarmSetup) {\n    return function (useAPI) {\n      return _isAvailable("http://localhost:8500").then(function (isAvailable) {\n        return isAvailable ? useAPI(at("http://localhost:8500")).then(function () {}) : downloadBinary(swarmSetup.binPath, swarmSetup.archives).onData(function (data) {\n          return (swarmSetup.onProgress || function () {})(data.length);\n        }).then(function () {\n          return startProcess(swarmSetup);\n        }).then(function (process) {\n          return useAPI(at("http://localhost:8500")).then(function () {\n            return process;\n          });\n        }).then(stopProcess);\n      });\n    };\n  };\n\n  // String ~> Promise Bool\n  //   Returns true if Swarm is available on `url`.\n  //   Perfoms a test upload to determine that.\n  //   TODO: improve this?\n  var _isAvailable = function _isAvailable(swarmUrl) {\n    var testFile = "test";\n    var testHash = "c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7";\n    return uploadData(swarmUrl)(testFile).then(function (hash) {\n      return hash === testHash;\n    }).catch(function () {\n      return false;\n    });\n  };\n\n  // String -> String ~> Promise Bool\n  //   Returns a Promise which is true if that Swarm address is a directory.\n  //   Determines that by checking that it (i) is a JSON, (ii) has a .entries.\n  //   TODO: improve this?\n  var isDirectory = function isDirectory(swarmUrl) {\n    return function (hash) {\n      return downloadData(swarmUrl)(hash).then(function (data) {\n        try {\n          return !!JSON.parse(toString(data)).entries;\n        } catch (e) {\n          return false;\n        }\n      });\n    };\n  };\n\n  // Uncurries a function; used to allow the f(x,y,z) style on exports.\n  var uncurry = function uncurry(f) {\n    return function (a, b, c, d, e) {\n      var p;\n      // Hardcoded because efficiency (`arguments` is very slow).\n      if (typeof a !== "undefined") p = f(a);\n      if (typeof b !== "undefined") p = f(b);\n      if (typeof c !== "undefined") p = f(c);\n      if (typeof d !== "undefined") p = f(d);\n      if (typeof e !== "undefined") p = f(e);\n      return p;\n    };\n  };\n\n  // () -> Promise Bool\n  //   Not sure how to mock Swarm to test it properly. Ideas?\n  var test = function test() {\n    return Promise.resolve(true);\n  };\n\n  // Uint8Array -> String\n  var toString = function toString(uint8Array) {\n    return bytes.toString(bytes.fromUint8Array(uint8Array));\n  };\n\n  // String -> Uint8Array\n  var fromString = function fromString(string) {\n    return bytes.toUint8Array(bytes.fromString(string));\n  };\n\n  // String -> SwarmAPI\n  //   Fixes the `swarmUrl`, returning an API where you don\'t have to pass it.\n  var at = function at(swarmUrl) {\n    return {\n      download: function download(hash, path) {\n        return _download(swarmUrl)(hash)(path);\n      },\n      downloadData: uncurry(downloadData(swarmUrl)),\n      downloadDataToDisk: uncurry(downloadDataToDisk(swarmUrl)),\n      downloadDirectory: uncurry(downloadDirectory(swarmUrl)),\n      downloadDirectoryToDisk: uncurry(downloadDirectoryToDisk(swarmUrl)),\n      downloadEntries: uncurry(downloadEntries(swarmUrl)),\n      downloadRoutes: uncurry(downloadRoutes(swarmUrl)),\n      isAvailable: function isAvailable() {\n        return _isAvailable(swarmUrl);\n      },\n      upload: function upload(arg) {\n        return _upload(swarmUrl)(arg);\n      },\n      uploadData: uncurry(uploadData(swarmUrl)),\n      uploadFile: uncurry(uploadFile(swarmUrl)),\n      uploadFileFromDisk: uncurry(uploadFile(swarmUrl)),\n      uploadDataFromDisk: uncurry(uploadDataFromDisk(swarmUrl)),\n      uploadDirectory: uncurry(uploadDirectory(swarmUrl)),\n      uploadDirectoryFromDisk: uncurry(uploadDirectoryFromDisk(swarmUrl)),\n      uploadToManifest: uncurry(uploadToManifest(swarmUrl)),\n      pick: pick,\n      hash: hash,\n      fromString: fromString,\n      toString: toString\n    };\n  };\n\n  return {\n    at: at,\n    local: local,\n    download: _download,\n    downloadBinary: downloadBinary,\n    downloadData: downloadData,\n    downloadDataToDisk: downloadDataToDisk,\n    downloadDirectory: downloadDirectory,\n    downloadDirectoryToDisk: downloadDirectoryToDisk,\n    downloadEntries: downloadEntries,\n    downloadRoutes: downloadRoutes,\n    isAvailable: _isAvailable,\n    startProcess: startProcess,\n    stopProcess: stopProcess,\n    upload: _upload,\n    uploadData: uploadData,\n    uploadDataFromDisk: uploadDataFromDisk,\n    uploadFile: uploadFile,\n    uploadFileFromDisk: uploadFileFromDisk,\n    uploadDirectory: uploadDirectory,\n    uploadDirectoryFromDisk: uploadDirectoryFromDisk,\n    uploadToManifest: uploadToManifest,\n    pick: pick,\n    hash: hash,\n    fromString: fromString,\n    toString: toString\n  };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/swarm-js/lib/swarm.js\n// module id = 1247\n// module chunks = 0\n\n//# sourceURL=../node_modules/swarm-js/lib/swarm.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\nconst throttle = __webpack_require__(1047)\nexports = module.exports = TimeCache\n\nfunction TimeCache (options) {\n  if (!(this instanceof TimeCache)) {\n    return new TimeCache(options)\n  }\n\n  options = options || {}\n\n  const validity = options.validity || 30 // seconds\n\n  const entries = new Map()\n\n  const sweep = throttle(() => {\n    entries.forEach((entry, key) => {\n      const v = entry.validity || validity\n      const delta = getTimeElapsed(entry.timestamp)\n      if (delta > v) {\n        entries.delete(key)\n      }\n    })\n  }, 200)\n\n  this.put = (key, value, validity) => {\n    if (!this.has(key)) {\n      entries.set(key, {\n        value: value,\n        timestamp: new Date(),\n        validity: validity\n      })\n    }\n\n    sweep()\n  }\n\n  this.get = (key) => {\n    if (entries.has(key)) {\n      return entries.get(key).value\n    } else {\n      throw new Error('key does not exist')\n    }\n  }\n\n  this.has = (key) => {\n    return entries.has(key)\n  }\n}\n\nfunction getTimeElapsed (prevTime) {\n  const currentTime = new Date()\n  const a = currentTime.getTime() - prevTime.getTime()\n\n  return Math.floor(a / 1000)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/time-cache/src/index.js\n// module id = 1248\n// module chunks = 0\n\n//# sourceURL=../node_modules/time-cache/src/index.js")},function(module,exports){eval("module.exports = toArray\n\nfunction toArray(list, index) {\n    var array = []\n\n    index = index || 0\n\n    for (var i = index || 0; i < list.length; i++) {\n        array[i - index] = list[i]\n    }\n\n    return array\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/to-array/index.js\n// module id = 1249\n// module chunks = 0\n\n//# sourceURL=../node_modules/to-array/index.js")},function(module,exports){eval("\nexports = module.exports = trim;\n\nfunction trim(str){\n  return str.replace(/^\\s*|\\s*$/g, '');\n}\n\nexports.left = function(str){\n  return str.replace(/^\\s*/, '');\n};\n\nexports.right = function(str){\n  return str.replace(/\\s*$/, '');\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/trim/index.js\n// module id = 1250\n// module chunks = 0\n\n//# sourceURL=../node_modules/trim/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar truncate = __webpack_require__(1252);\nvar getLength = __webpack_require__(1257);\nmodule.exports = truncate.bind(null, getLength);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/truncate-utf8-bytes/browser.js\n// module id = 1251\n// module chunks = 0\n\n//# sourceURL=../node_modules/truncate-utf8-bytes/browser.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nfunction isHighSurrogate(codePoint) {\n  return codePoint >= 0xd800 && codePoint <= 0xdbff;\n}\n\nfunction isLowSurrogate(codePoint) {\n  return codePoint >= 0xdc00 && codePoint <= 0xdfff;\n}\n\n// Truncate string by size in bytes\nmodule.exports = function truncate(getLength, string, byteLength) {\n  if (typeof string !== "string") {\n    throw new Error("Input must be string");\n  }\n\n  var charLength = string.length;\n  var curByteLength = 0;\n  var codePoint;\n  var segment;\n\n  for (var i = 0; i < charLength; i += 1) {\n    codePoint = string.charCodeAt(i);\n    segment = string[i];\n\n    if (isHighSurrogate(codePoint) && isLowSurrogate(string.charCodeAt(i + 1))) {\n      i += 1;\n      segment += string[i];\n    }\n\n    curByteLength += getLength(segment);\n\n    if (curByteLength === byteLength) {\n      return string.slice(0, i + 1);\n    }\n    else if (curByteLength > byteLength) {\n      return string.slice(0, i - segment.length + 1);\n    }\n  }\n\n  return string;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/truncate-utf8-bytes/lib/truncate.js\n// module id = 1252\n// module chunks = 0\n\n//# sourceURL=../node_modules/truncate-utf8-bytes/lib/truncate.js')},function(module,exports,__webpack_require__){eval("(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n  var i, r = new Float64Array(16);\n  if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n  return r;\n};\n\n//  Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n    gf1 = gf([1]),\n    _121665 = gf([0xdb41, 1]),\n    D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n    D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n    X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n    Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n    I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n  x[i]   = (h >> 24) & 0xff;\n  x[i+1] = (h >> 16) & 0xff;\n  x[i+2] = (h >>  8) & 0xff;\n  x[i+3] = h & 0xff;\n  x[i+4] = (l >> 24)  & 0xff;\n  x[i+5] = (l >> 16)  & 0xff;\n  x[i+6] = (l >>  8)  & 0xff;\n  x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n  var i,d = 0;\n  for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n  return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n  return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n  return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n  var j0  = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n      j1  = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n      j2  = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n      j3  = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n      j4  = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n      j5  = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n      j6  = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n      j7  = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n      j8  = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n      j9  = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n      j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n      j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n      j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n      j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n      j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n      j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n  var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n      x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n      x15 = j15, u;\n\n  for (var i = 0; i < 20; i += 2) {\n    u = x0 + x12 | 0;\n    x4 ^= u<<7 | u>>>(32-7);\n    u = x4 + x0 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x4 | 0;\n    x12 ^= u<<13 | u>>>(32-13);\n    u = x12 + x8 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x1 | 0;\n    x9 ^= u<<7 | u>>>(32-7);\n    u = x9 + x5 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x9 | 0;\n    x1 ^= u<<13 | u>>>(32-13);\n    u = x1 + x13 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x6 | 0;\n    x14 ^= u<<7 | u>>>(32-7);\n    u = x14 + x10 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x14 | 0;\n    x6 ^= u<<13 | u>>>(32-13);\n    u = x6 + x2 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x11 | 0;\n    x3 ^= u<<7 | u>>>(32-7);\n    u = x3 + x15 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x3 | 0;\n    x11 ^= u<<13 | u>>>(32-13);\n    u = x11 + x7 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n\n    u = x0 + x3 | 0;\n    x1 ^= u<<7 | u>>>(32-7);\n    u = x1 + x0 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x1 | 0;\n    x3 ^= u<<13 | u>>>(32-13);\n    u = x3 + x2 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x4 | 0;\n    x6 ^= u<<7 | u>>>(32-7);\n    u = x6 + x5 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x6 | 0;\n    x4 ^= u<<13 | u>>>(32-13);\n    u = x4 + x7 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x9 | 0;\n    x11 ^= u<<7 | u>>>(32-7);\n    u = x11 + x10 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x11 | 0;\n    x9 ^= u<<13 | u>>>(32-13);\n    u = x9 + x8 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x14 | 0;\n    x12 ^= u<<7 | u>>>(32-7);\n    u = x12 + x15 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x12 | 0;\n    x14 ^= u<<13 | u>>>(32-13);\n    u = x14 + x13 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n  }\n   x0 =  x0 +  j0 | 0;\n   x1 =  x1 +  j1 | 0;\n   x2 =  x2 +  j2 | 0;\n   x3 =  x3 +  j3 | 0;\n   x4 =  x4 +  j4 | 0;\n   x5 =  x5 +  j5 | 0;\n   x6 =  x6 +  j6 | 0;\n   x7 =  x7 +  j7 | 0;\n   x8 =  x8 +  j8 | 0;\n   x9 =  x9 +  j9 | 0;\n  x10 = x10 + j10 | 0;\n  x11 = x11 + j11 | 0;\n  x12 = x12 + j12 | 0;\n  x13 = x13 + j13 | 0;\n  x14 = x14 + j14 | 0;\n  x15 = x15 + j15 | 0;\n\n  o[ 0] = x0 >>>  0 & 0xff;\n  o[ 1] = x0 >>>  8 & 0xff;\n  o[ 2] = x0 >>> 16 & 0xff;\n  o[ 3] = x0 >>> 24 & 0xff;\n\n  o[ 4] = x1 >>>  0 & 0xff;\n  o[ 5] = x1 >>>  8 & 0xff;\n  o[ 6] = x1 >>> 16 & 0xff;\n  o[ 7] = x1 >>> 24 & 0xff;\n\n  o[ 8] = x2 >>>  0 & 0xff;\n  o[ 9] = x2 >>>  8 & 0xff;\n  o[10] = x2 >>> 16 & 0xff;\n  o[11] = x2 >>> 24 & 0xff;\n\n  o[12] = x3 >>>  0 & 0xff;\n  o[13] = x3 >>>  8 & 0xff;\n  o[14] = x3 >>> 16 & 0xff;\n  o[15] = x3 >>> 24 & 0xff;\n\n  o[16] = x4 >>>  0 & 0xff;\n  o[17] = x4 >>>  8 & 0xff;\n  o[18] = x4 >>> 16 & 0xff;\n  o[19] = x4 >>> 24 & 0xff;\n\n  o[20] = x5 >>>  0 & 0xff;\n  o[21] = x5 >>>  8 & 0xff;\n  o[22] = x5 >>> 16 & 0xff;\n  o[23] = x5 >>> 24 & 0xff;\n\n  o[24] = x6 >>>  0 & 0xff;\n  o[25] = x6 >>>  8 & 0xff;\n  o[26] = x6 >>> 16 & 0xff;\n  o[27] = x6 >>> 24 & 0xff;\n\n  o[28] = x7 >>>  0 & 0xff;\n  o[29] = x7 >>>  8 & 0xff;\n  o[30] = x7 >>> 16 & 0xff;\n  o[31] = x7 >>> 24 & 0xff;\n\n  o[32] = x8 >>>  0 & 0xff;\n  o[33] = x8 >>>  8 & 0xff;\n  o[34] = x8 >>> 16 & 0xff;\n  o[35] = x8 >>> 24 & 0xff;\n\n  o[36] = x9 >>>  0 & 0xff;\n  o[37] = x9 >>>  8 & 0xff;\n  o[38] = x9 >>> 16 & 0xff;\n  o[39] = x9 >>> 24 & 0xff;\n\n  o[40] = x10 >>>  0 & 0xff;\n  o[41] = x10 >>>  8 & 0xff;\n  o[42] = x10 >>> 16 & 0xff;\n  o[43] = x10 >>> 24 & 0xff;\n\n  o[44] = x11 >>>  0 & 0xff;\n  o[45] = x11 >>>  8 & 0xff;\n  o[46] = x11 >>> 16 & 0xff;\n  o[47] = x11 >>> 24 & 0xff;\n\n  o[48] = x12 >>>  0 & 0xff;\n  o[49] = x12 >>>  8 & 0xff;\n  o[50] = x12 >>> 16 & 0xff;\n  o[51] = x12 >>> 24 & 0xff;\n\n  o[52] = x13 >>>  0 & 0xff;\n  o[53] = x13 >>>  8 & 0xff;\n  o[54] = x13 >>> 16 & 0xff;\n  o[55] = x13 >>> 24 & 0xff;\n\n  o[56] = x14 >>>  0 & 0xff;\n  o[57] = x14 >>>  8 & 0xff;\n  o[58] = x14 >>> 16 & 0xff;\n  o[59] = x14 >>> 24 & 0xff;\n\n  o[60] = x15 >>>  0 & 0xff;\n  o[61] = x15 >>>  8 & 0xff;\n  o[62] = x15 >>> 16 & 0xff;\n  o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n  var j0  = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n      j1  = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n      j2  = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n      j3  = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n      j4  = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n      j5  = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n      j6  = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n      j7  = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n      j8  = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n      j9  = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n      j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n      j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n      j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n      j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n      j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n      j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n  var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n      x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n      x15 = j15, u;\n\n  for (var i = 0; i < 20; i += 2) {\n    u = x0 + x12 | 0;\n    x4 ^= u<<7 | u>>>(32-7);\n    u = x4 + x0 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x4 | 0;\n    x12 ^= u<<13 | u>>>(32-13);\n    u = x12 + x8 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x1 | 0;\n    x9 ^= u<<7 | u>>>(32-7);\n    u = x9 + x5 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x9 | 0;\n    x1 ^= u<<13 | u>>>(32-13);\n    u = x1 + x13 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x6 | 0;\n    x14 ^= u<<7 | u>>>(32-7);\n    u = x14 + x10 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x14 | 0;\n    x6 ^= u<<13 | u>>>(32-13);\n    u = x6 + x2 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x11 | 0;\n    x3 ^= u<<7 | u>>>(32-7);\n    u = x3 + x15 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x3 | 0;\n    x11 ^= u<<13 | u>>>(32-13);\n    u = x11 + x7 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n\n    u = x0 + x3 | 0;\n    x1 ^= u<<7 | u>>>(32-7);\n    u = x1 + x0 | 0;\n    x2 ^= u<<9 | u>>>(32-9);\n    u = x2 + x1 | 0;\n    x3 ^= u<<13 | u>>>(32-13);\n    u = x3 + x2 | 0;\n    x0 ^= u<<18 | u>>>(32-18);\n\n    u = x5 + x4 | 0;\n    x6 ^= u<<7 | u>>>(32-7);\n    u = x6 + x5 | 0;\n    x7 ^= u<<9 | u>>>(32-9);\n    u = x7 + x6 | 0;\n    x4 ^= u<<13 | u>>>(32-13);\n    u = x4 + x7 | 0;\n    x5 ^= u<<18 | u>>>(32-18);\n\n    u = x10 + x9 | 0;\n    x11 ^= u<<7 | u>>>(32-7);\n    u = x11 + x10 | 0;\n    x8 ^= u<<9 | u>>>(32-9);\n    u = x8 + x11 | 0;\n    x9 ^= u<<13 | u>>>(32-13);\n    u = x9 + x8 | 0;\n    x10 ^= u<<18 | u>>>(32-18);\n\n    u = x15 + x14 | 0;\n    x12 ^= u<<7 | u>>>(32-7);\n    u = x12 + x15 | 0;\n    x13 ^= u<<9 | u>>>(32-9);\n    u = x13 + x12 | 0;\n    x14 ^= u<<13 | u>>>(32-13);\n    u = x14 + x13 | 0;\n    x15 ^= u<<18 | u>>>(32-18);\n  }\n\n  o[ 0] = x0 >>>  0 & 0xff;\n  o[ 1] = x0 >>>  8 & 0xff;\n  o[ 2] = x0 >>> 16 & 0xff;\n  o[ 3] = x0 >>> 24 & 0xff;\n\n  o[ 4] = x5 >>>  0 & 0xff;\n  o[ 5] = x5 >>>  8 & 0xff;\n  o[ 6] = x5 >>> 16 & 0xff;\n  o[ 7] = x5 >>> 24 & 0xff;\n\n  o[ 8] = x10 >>>  0 & 0xff;\n  o[ 9] = x10 >>>  8 & 0xff;\n  o[10] = x10 >>> 16 & 0xff;\n  o[11] = x10 >>> 24 & 0xff;\n\n  o[12] = x15 >>>  0 & 0xff;\n  o[13] = x15 >>>  8 & 0xff;\n  o[14] = x15 >>> 16 & 0xff;\n  o[15] = x15 >>> 24 & 0xff;\n\n  o[16] = x6 >>>  0 & 0xff;\n  o[17] = x6 >>>  8 & 0xff;\n  o[18] = x6 >>> 16 & 0xff;\n  o[19] = x6 >>> 24 & 0xff;\n\n  o[20] = x7 >>>  0 & 0xff;\n  o[21] = x7 >>>  8 & 0xff;\n  o[22] = x7 >>> 16 & 0xff;\n  o[23] = x7 >>> 24 & 0xff;\n\n  o[24] = x8 >>>  0 & 0xff;\n  o[25] = x8 >>>  8 & 0xff;\n  o[26] = x8 >>> 16 & 0xff;\n  o[27] = x8 >>> 24 & 0xff;\n\n  o[28] = x9 >>>  0 & 0xff;\n  o[29] = x9 >>>  8 & 0xff;\n  o[30] = x9 >>> 16 & 0xff;\n  o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n  core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n  core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n            // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n  var z = new Uint8Array(16), x = new Uint8Array(64);\n  var u, i;\n  for (i = 0; i < 16; i++) z[i] = 0;\n  for (i = 0; i < 8; i++) z[i] = n[i];\n  while (b >= 64) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n    u = 1;\n    for (i = 8; i < 16; i++) {\n      u = u + (z[i] & 0xff) | 0;\n      z[i] = u & 0xff;\n      u >>>= 8;\n    }\n    b -= 64;\n    cpos += 64;\n    mpos += 64;\n  }\n  if (b > 0) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n  }\n  return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n  var z = new Uint8Array(16), x = new Uint8Array(64);\n  var u, i;\n  for (i = 0; i < 16; i++) z[i] = 0;\n  for (i = 0; i < 8; i++) z[i] = n[i];\n  while (b >= 64) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n    u = 1;\n    for (i = 8; i < 16; i++) {\n      u = u + (z[i] & 0xff) | 0;\n      z[i] = u & 0xff;\n      u >>>= 8;\n    }\n    b -= 64;\n    cpos += 64;\n  }\n  if (b > 0) {\n    crypto_core_salsa20(x,z,k,sigma);\n    for (i = 0; i < b; i++) c[cpos+i] = x[i];\n  }\n  return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n  var s = new Uint8Array(32);\n  crypto_core_hsalsa20(s,n,k,sigma);\n  var sn = new Uint8Array(8);\n  for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n  return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n  var s = new Uint8Array(32);\n  crypto_core_hsalsa20(s,n,k,sigma);\n  var sn = new Uint8Array(8);\n  for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n  return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n  this.buffer = new Uint8Array(16);\n  this.r = new Uint16Array(10);\n  this.h = new Uint16Array(10);\n  this.pad = new Uint16Array(8);\n  this.leftover = 0;\n  this.fin = 0;\n\n  var t0, t1, t2, t3, t4, t5, t6, t7;\n\n  t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0                     ) & 0x1fff;\n  t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 <<  3)) & 0x1fff;\n  t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 <<  6)) & 0x1f03;\n  t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>>  7) | (t3 <<  9)) & 0x1fff;\n  t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>>  4) | (t4 << 12)) & 0x00ff;\n  this.r[5] = ((t4 >>>  1)) & 0x1ffe;\n  t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 <<  2)) & 0x1fff;\n  t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 <<  5)) & 0x1f81;\n  t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>>  8) | (t7 <<  8)) & 0x1fff;\n  this.r[9] = ((t7 >>>  5)) & 0x007f;\n\n  this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n  this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n  this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n  this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n  this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n  this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n  this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n  this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n  var hibit = this.fin ? 0 : (1 << 11);\n  var t0, t1, t2, t3, t4, t5, t6, t7, c;\n  var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n  var h0 = this.h[0],\n      h1 = this.h[1],\n      h2 = this.h[2],\n      h3 = this.h[3],\n      h4 = this.h[4],\n      h5 = this.h[5],\n      h6 = this.h[6],\n      h7 = this.h[7],\n      h8 = this.h[8],\n      h9 = this.h[9];\n\n  var r0 = this.r[0],\n      r1 = this.r[1],\n      r2 = this.r[2],\n      r3 = this.r[3],\n      r4 = this.r[4],\n      r5 = this.r[5],\n      r6 = this.r[6],\n      r7 = this.r[7],\n      r8 = this.r[8],\n      r9 = this.r[9];\n\n  while (bytes >= 16) {\n    t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0                     ) & 0x1fff;\n    t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 <<  3)) & 0x1fff;\n    t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 <<  6)) & 0x1fff;\n    t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>>  7) | (t3 <<  9)) & 0x1fff;\n    t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>>  4) | (t4 << 12)) & 0x1fff;\n    h5 += ((t4 >>>  1)) & 0x1fff;\n    t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 <<  2)) & 0x1fff;\n    t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 <<  5)) & 0x1fff;\n    t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>>  8) | (t7 <<  8)) & 0x1fff;\n    h9 += ((t7 >>> 5)) | hibit;\n\n    c = 0;\n\n    d0 = c;\n    d0 += h0 * r0;\n    d0 += h1 * (5 * r9);\n    d0 += h2 * (5 * r8);\n    d0 += h3 * (5 * r7);\n    d0 += h4 * (5 * r6);\n    c = (d0 >>> 13); d0 &= 0x1fff;\n    d0 += h5 * (5 * r5);\n    d0 += h6 * (5 * r4);\n    d0 += h7 * (5 * r3);\n    d0 += h8 * (5 * r2);\n    d0 += h9 * (5 * r1);\n    c += (d0 >>> 13); d0 &= 0x1fff;\n\n    d1 = c;\n    d1 += h0 * r1;\n    d1 += h1 * r0;\n    d1 += h2 * (5 * r9);\n    d1 += h3 * (5 * r8);\n    d1 += h4 * (5 * r7);\n    c = (d1 >>> 13); d1 &= 0x1fff;\n    d1 += h5 * (5 * r6);\n    d1 += h6 * (5 * r5);\n    d1 += h7 * (5 * r4);\n    d1 += h8 * (5 * r3);\n    d1 += h9 * (5 * r2);\n    c += (d1 >>> 13); d1 &= 0x1fff;\n\n    d2 = c;\n    d2 += h0 * r2;\n    d2 += h1 * r1;\n    d2 += h2 * r0;\n    d2 += h3 * (5 * r9);\n    d2 += h4 * (5 * r8);\n    c = (d2 >>> 13); d2 &= 0x1fff;\n    d2 += h5 * (5 * r7);\n    d2 += h6 * (5 * r6);\n    d2 += h7 * (5 * r5);\n    d2 += h8 * (5 * r4);\n    d2 += h9 * (5 * r3);\n    c += (d2 >>> 13); d2 &= 0x1fff;\n\n    d3 = c;\n    d3 += h0 * r3;\n    d3 += h1 * r2;\n    d3 += h2 * r1;\n    d3 += h3 * r0;\n    d3 += h4 * (5 * r9);\n    c = (d3 >>> 13); d3 &= 0x1fff;\n    d3 += h5 * (5 * r8);\n    d3 += h6 * (5 * r7);\n    d3 += h7 * (5 * r6);\n    d3 += h8 * (5 * r5);\n    d3 += h9 * (5 * r4);\n    c += (d3 >>> 13); d3 &= 0x1fff;\n\n    d4 = c;\n    d4 += h0 * r4;\n    d4 += h1 * r3;\n    d4 += h2 * r2;\n    d4 += h3 * r1;\n    d4 += h4 * r0;\n    c = (d4 >>> 13); d4 &= 0x1fff;\n    d4 += h5 * (5 * r9);\n    d4 += h6 * (5 * r8);\n    d4 += h7 * (5 * r7);\n    d4 += h8 * (5 * r6);\n    d4 += h9 * (5 * r5);\n    c += (d4 >>> 13); d4 &= 0x1fff;\n\n    d5 = c;\n    d5 += h0 * r5;\n    d5 += h1 * r4;\n    d5 += h2 * r3;\n    d5 += h3 * r2;\n    d5 += h4 * r1;\n    c = (d5 >>> 13); d5 &= 0x1fff;\n    d5 += h5 * r0;\n    d5 += h6 * (5 * r9);\n    d5 += h7 * (5 * r8);\n    d5 += h8 * (5 * r7);\n    d5 += h9 * (5 * r6);\n    c += (d5 >>> 13); d5 &= 0x1fff;\n\n    d6 = c;\n    d6 += h0 * r6;\n    d6 += h1 * r5;\n    d6 += h2 * r4;\n    d6 += h3 * r3;\n    d6 += h4 * r2;\n    c = (d6 >>> 13); d6 &= 0x1fff;\n    d6 += h5 * r1;\n    d6 += h6 * r0;\n    d6 += h7 * (5 * r9);\n    d6 += h8 * (5 * r8);\n    d6 += h9 * (5 * r7);\n    c += (d6 >>> 13); d6 &= 0x1fff;\n\n    d7 = c;\n    d7 += h0 * r7;\n    d7 += h1 * r6;\n    d7 += h2 * r5;\n    d7 += h3 * r4;\n    d7 += h4 * r3;\n    c = (d7 >>> 13); d7 &= 0x1fff;\n    d7 += h5 * r2;\n    d7 += h6 * r1;\n    d7 += h7 * r0;\n    d7 += h8 * (5 * r9);\n    d7 += h9 * (5 * r8);\n    c += (d7 >>> 13); d7 &= 0x1fff;\n\n    d8 = c;\n    d8 += h0 * r8;\n    d8 += h1 * r7;\n    d8 += h2 * r6;\n    d8 += h3 * r5;\n    d8 += h4 * r4;\n    c = (d8 >>> 13); d8 &= 0x1fff;\n    d8 += h5 * r3;\n    d8 += h6 * r2;\n    d8 += h7 * r1;\n    d8 += h8 * r0;\n    d8 += h9 * (5 * r9);\n    c += (d8 >>> 13); d8 &= 0x1fff;\n\n    d9 = c;\n    d9 += h0 * r9;\n    d9 += h1 * r8;\n    d9 += h2 * r7;\n    d9 += h3 * r6;\n    d9 += h4 * r5;\n    c = (d9 >>> 13); d9 &= 0x1fff;\n    d9 += h5 * r4;\n    d9 += h6 * r3;\n    d9 += h7 * r2;\n    d9 += h8 * r1;\n    d9 += h9 * r0;\n    c += (d9 >>> 13); d9 &= 0x1fff;\n\n    c = (((c << 2) + c)) | 0;\n    c = (c + d0) | 0;\n    d0 = c & 0x1fff;\n    c = (c >>> 13);\n    d1 += c;\n\n    h0 = d0;\n    h1 = d1;\n    h2 = d2;\n    h3 = d3;\n    h4 = d4;\n    h5 = d5;\n    h6 = d6;\n    h7 = d7;\n    h8 = d8;\n    h9 = d9;\n\n    mpos += 16;\n    bytes -= 16;\n  }\n  this.h[0] = h0;\n  this.h[1] = h1;\n  this.h[2] = h2;\n  this.h[3] = h3;\n  this.h[4] = h4;\n  this.h[5] = h5;\n  this.h[6] = h6;\n  this.h[7] = h7;\n  this.h[8] = h8;\n  this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n  var g = new Uint16Array(10);\n  var c, mask, f, i;\n\n  if (this.leftover) {\n    i = this.leftover;\n    this.buffer[i++] = 1;\n    for (; i < 16; i++) this.buffer[i] = 0;\n    this.fin = 1;\n    this.blocks(this.buffer, 0, 16);\n  }\n\n  c = this.h[1] >>> 13;\n  this.h[1] &= 0x1fff;\n  for (i = 2; i < 10; i++) {\n    this.h[i] += c;\n    c = this.h[i] >>> 13;\n    this.h[i] &= 0x1fff;\n  }\n  this.h[0] += (c * 5);\n  c = this.h[0] >>> 13;\n  this.h[0] &= 0x1fff;\n  this.h[1] += c;\n  c = this.h[1] >>> 13;\n  this.h[1] &= 0x1fff;\n  this.h[2] += c;\n\n  g[0] = this.h[0] + 5;\n  c = g[0] >>> 13;\n  g[0] &= 0x1fff;\n  for (i = 1; i < 10; i++) {\n    g[i] = this.h[i] + c;\n    c = g[i] >>> 13;\n    g[i] &= 0x1fff;\n  }\n  g[9] -= (1 << 13);\n\n  mask = (c ^ 1) - 1;\n  for (i = 0; i < 10; i++) g[i] &= mask;\n  mask = ~mask;\n  for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n  this.h[0] = ((this.h[0]       ) | (this.h[1] << 13)                    ) & 0xffff;\n  this.h[1] = ((this.h[1] >>>  3) | (this.h[2] << 10)                    ) & 0xffff;\n  this.h[2] = ((this.h[2] >>>  6) | (this.h[3] <<  7)                    ) & 0xffff;\n  this.h[3] = ((this.h[3] >>>  9) | (this.h[4] <<  4)                    ) & 0xffff;\n  this.h[4] = ((this.h[4] >>> 12) | (this.h[5] <<  1) | (this.h[6] << 14)) & 0xffff;\n  this.h[5] = ((this.h[6] >>>  2) | (this.h[7] << 11)                    ) & 0xffff;\n  this.h[6] = ((this.h[7] >>>  5) | (this.h[8] <<  8)                    ) & 0xffff;\n  this.h[7] = ((this.h[8] >>>  8) | (this.h[9] <<  5)                    ) & 0xffff;\n\n  f = this.h[0] + this.pad[0];\n  this.h[0] = f & 0xffff;\n  for (i = 1; i < 8; i++) {\n    f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n    this.h[i] = f & 0xffff;\n  }\n\n  mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n  mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n  mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n  mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n  mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n  mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n  mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n  mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n  mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n  mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n  mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n  mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n  mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n  mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n  mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n  mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n  var i, want;\n\n  if (this.leftover) {\n    want = (16 - this.leftover);\n    if (want > bytes)\n      want = bytes;\n    for (i = 0; i < want; i++)\n      this.buffer[this.leftover + i] = m[mpos+i];\n    bytes -= want;\n    mpos += want;\n    this.leftover += want;\n    if (this.leftover < 16)\n      return;\n    this.blocks(this.buffer, 0, 16);\n    this.leftover = 0;\n  }\n\n  if (bytes >= 16) {\n    want = bytes - (bytes % 16);\n    this.blocks(m, mpos, want);\n    mpos += want;\n    bytes -= want;\n  }\n\n  if (bytes) {\n    for (i = 0; i < bytes; i++)\n      this.buffer[this.leftover + i] = m[mpos+i];\n    this.leftover += bytes;\n  }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n  var s = new poly1305(k);\n  s.update(m, mpos, n);\n  s.finish(out, outpos);\n  return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n  var x = new Uint8Array(16);\n  crypto_onetimeauth(x,0,m,mpos,n,k);\n  return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n  var i;\n  if (d < 32) return -1;\n  crypto_stream_xor(c,0,m,0,d,n,k);\n  crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n  for (i = 0; i < 16; i++) c[i] = 0;\n  return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n  var i;\n  var x = new Uint8Array(32);\n  if (d < 32) return -1;\n  crypto_stream(x,0,32,n,k);\n  if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n  crypto_stream_xor(m,0,c,0,d,n,k);\n  for (i = 0; i < 32; i++) m[i] = 0;\n  return 0;\n}\n\nfunction set25519(r, a) {\n  var i;\n  for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n  var i, v, c = 1;\n  for (i = 0; i < 16; i++) {\n    v = o[i] + c + 65535;\n    c = Math.floor(v / 65536);\n    o[i] = v - c * 65536;\n  }\n  o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n  var t, c = ~(b-1);\n  for (var i = 0; i < 16; i++) {\n    t = c & (p[i] ^ q[i]);\n    p[i] ^= t;\n    q[i] ^= t;\n  }\n}\n\nfunction pack25519(o, n) {\n  var i, j, b;\n  var m = gf(), t = gf();\n  for (i = 0; i < 16; i++) t[i] = n[i];\n  car25519(t);\n  car25519(t);\n  car25519(t);\n  for (j = 0; j < 2; j++) {\n    m[0] = t[0] - 0xffed;\n    for (i = 1; i < 15; i++) {\n      m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n      m[i-1] &= 0xffff;\n    }\n    m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n    b = (m[15]>>16) & 1;\n    m[14] &= 0xffff;\n    sel25519(t, m, 1-b);\n  }\n  for (i = 0; i < 16; i++) {\n    o[2*i] = t[i] & 0xff;\n    o[2*i+1] = t[i]>>8;\n  }\n}\n\nfunction neq25519(a, b) {\n  var c = new Uint8Array(32), d = new Uint8Array(32);\n  pack25519(c, a);\n  pack25519(d, b);\n  return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n  var d = new Uint8Array(32);\n  pack25519(d, a);\n  return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n  var i;\n  for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n  o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n  for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n  var v, c,\n     t0 = 0,  t1 = 0,  t2 = 0,  t3 = 0,  t4 = 0,  t5 = 0,  t6 = 0,  t7 = 0,\n     t8 = 0,  t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n    t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n    t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n    b0 = b[0],\n    b1 = b[1],\n    b2 = b[2],\n    b3 = b[3],\n    b4 = b[4],\n    b5 = b[5],\n    b6 = b[6],\n    b7 = b[7],\n    b8 = b[8],\n    b9 = b[9],\n    b10 = b[10],\n    b11 = b[11],\n    b12 = b[12],\n    b13 = b[13],\n    b14 = b[14],\n    b15 = b[15];\n\n  v = a[0];\n  t0 += v * b0;\n  t1 += v * b1;\n  t2 += v * b2;\n  t3 += v * b3;\n  t4 += v * b4;\n  t5 += v * b5;\n  t6 += v * b6;\n  t7 += v * b7;\n  t8 += v * b8;\n  t9 += v * b9;\n  t10 += v * b10;\n  t11 += v * b11;\n  t12 += v * b12;\n  t13 += v * b13;\n  t14 += v * b14;\n  t15 += v * b15;\n  v = a[1];\n  t1 += v * b0;\n  t2 += v * b1;\n  t3 += v * b2;\n  t4 += v * b3;\n  t5 += v * b4;\n  t6 += v * b5;\n  t7 += v * b6;\n  t8 += v * b7;\n  t9 += v * b8;\n  t10 += v * b9;\n  t11 += v * b10;\n  t12 += v * b11;\n  t13 += v * b12;\n  t14 += v * b13;\n  t15 += v * b14;\n  t16 += v * b15;\n  v = a[2];\n  t2 += v * b0;\n  t3 += v * b1;\n  t4 += v * b2;\n  t5 += v * b3;\n  t6 += v * b4;\n  t7 += v * b5;\n  t8 += v * b6;\n  t9 += v * b7;\n  t10 += v * b8;\n  t11 += v * b9;\n  t12 += v * b10;\n  t13 += v * b11;\n  t14 += v * b12;\n  t15 += v * b13;\n  t16 += v * b14;\n  t17 += v * b15;\n  v = a[3];\n  t3 += v * b0;\n  t4 += v * b1;\n  t5 += v * b2;\n  t6 += v * b3;\n  t7 += v * b4;\n  t8 += v * b5;\n  t9 += v * b6;\n  t10 += v * b7;\n  t11 += v * b8;\n  t12 += v * b9;\n  t13 += v * b10;\n  t14 += v * b11;\n  t15 += v * b12;\n  t16 += v * b13;\n  t17 += v * b14;\n  t18 += v * b15;\n  v = a[4];\n  t4 += v * b0;\n  t5 += v * b1;\n  t6 += v * b2;\n  t7 += v * b3;\n  t8 += v * b4;\n  t9 += v * b5;\n  t10 += v * b6;\n  t11 += v * b7;\n  t12 += v * b8;\n  t13 += v * b9;\n  t14 += v * b10;\n  t15 += v * b11;\n  t16 += v * b12;\n  t17 += v * b13;\n  t18 += v * b14;\n  t19 += v * b15;\n  v = a[5];\n  t5 += v * b0;\n  t6 += v * b1;\n  t7 += v * b2;\n  t8 += v * b3;\n  t9 += v * b4;\n  t10 += v * b5;\n  t11 += v * b6;\n  t12 += v * b7;\n  t13 += v * b8;\n  t14 += v * b9;\n  t15 += v * b10;\n  t16 += v * b11;\n  t17 += v * b12;\n  t18 += v * b13;\n  t19 += v * b14;\n  t20 += v * b15;\n  v = a[6];\n  t6 += v * b0;\n  t7 += v * b1;\n  t8 += v * b2;\n  t9 += v * b3;\n  t10 += v * b4;\n  t11 += v * b5;\n  t12 += v * b6;\n  t13 += v * b7;\n  t14 += v * b8;\n  t15 += v * b9;\n  t16 += v * b10;\n  t17 += v * b11;\n  t18 += v * b12;\n  t19 += v * b13;\n  t20 += v * b14;\n  t21 += v * b15;\n  v = a[7];\n  t7 += v * b0;\n  t8 += v * b1;\n  t9 += v * b2;\n  t10 += v * b3;\n  t11 += v * b4;\n  t12 += v * b5;\n  t13 += v * b6;\n  t14 += v * b7;\n  t15 += v * b8;\n  t16 += v * b9;\n  t17 += v * b10;\n  t18 += v * b11;\n  t19 += v * b12;\n  t20 += v * b13;\n  t21 += v * b14;\n  t22 += v * b15;\n  v = a[8];\n  t8 += v * b0;\n  t9 += v * b1;\n  t10 += v * b2;\n  t11 += v * b3;\n  t12 += v * b4;\n  t13 += v * b5;\n  t14 += v * b6;\n  t15 += v * b7;\n  t16 += v * b8;\n  t17 += v * b9;\n  t18 += v * b10;\n  t19 += v * b11;\n  t20 += v * b12;\n  t21 += v * b13;\n  t22 += v * b14;\n  t23 += v * b15;\n  v = a[9];\n  t9 += v * b0;\n  t10 += v * b1;\n  t11 += v * b2;\n  t12 += v * b3;\n  t13 += v * b4;\n  t14 += v * b5;\n  t15 += v * b6;\n  t16 += v * b7;\n  t17 += v * b8;\n  t18 += v * b9;\n  t19 += v * b10;\n  t20 += v * b11;\n  t21 += v * b12;\n  t22 += v * b13;\n  t23 += v * b14;\n  t24 += v * b15;\n  v = a[10];\n  t10 += v * b0;\n  t11 += v * b1;\n  t12 += v * b2;\n  t13 += v * b3;\n  t14 += v * b4;\n  t15 += v * b5;\n  t16 += v * b6;\n  t17 += v * b7;\n  t18 += v * b8;\n  t19 += v * b9;\n  t20 += v * b10;\n  t21 += v * b11;\n  t22 += v * b12;\n  t23 += v * b13;\n  t24 += v * b14;\n  t25 += v * b15;\n  v = a[11];\n  t11 += v * b0;\n  t12 += v * b1;\n  t13 += v * b2;\n  t14 += v * b3;\n  t15 += v * b4;\n  t16 += v * b5;\n  t17 += v * b6;\n  t18 += v * b7;\n  t19 += v * b8;\n  t20 += v * b9;\n  t21 += v * b10;\n  t22 += v * b11;\n  t23 += v * b12;\n  t24 += v * b13;\n  t25 += v * b14;\n  t26 += v * b15;\n  v = a[12];\n  t12 += v * b0;\n  t13 += v * b1;\n  t14 += v * b2;\n  t15 += v * b3;\n  t16 += v * b4;\n  t17 += v * b5;\n  t18 += v * b6;\n  t19 += v * b7;\n  t20 += v * b8;\n  t21 += v * b9;\n  t22 += v * b10;\n  t23 += v * b11;\n  t24 += v * b12;\n  t25 += v * b13;\n  t26 += v * b14;\n  t27 += v * b15;\n  v = a[13];\n  t13 += v * b0;\n  t14 += v * b1;\n  t15 += v * b2;\n  t16 += v * b3;\n  t17 += v * b4;\n  t18 += v * b5;\n  t19 += v * b6;\n  t20 += v * b7;\n  t21 += v * b8;\n  t22 += v * b9;\n  t23 += v * b10;\n  t24 += v * b11;\n  t25 += v * b12;\n  t26 += v * b13;\n  t27 += v * b14;\n  t28 += v * b15;\n  v = a[14];\n  t14 += v * b0;\n  t15 += v * b1;\n  t16 += v * b2;\n  t17 += v * b3;\n  t18 += v * b4;\n  t19 += v * b5;\n  t20 += v * b6;\n  t21 += v * b7;\n  t22 += v * b8;\n  t23 += v * b9;\n  t24 += v * b10;\n  t25 += v * b11;\n  t26 += v * b12;\n  t27 += v * b13;\n  t28 += v * b14;\n  t29 += v * b15;\n  v = a[15];\n  t15 += v * b0;\n  t16 += v * b1;\n  t17 += v * b2;\n  t18 += v * b3;\n  t19 += v * b4;\n  t20 += v * b5;\n  t21 += v * b6;\n  t22 += v * b7;\n  t23 += v * b8;\n  t24 += v * b9;\n  t25 += v * b10;\n  t26 += v * b11;\n  t27 += v * b12;\n  t28 += v * b13;\n  t29 += v * b14;\n  t30 += v * b15;\n\n  t0  += 38 * t16;\n  t1  += 38 * t17;\n  t2  += 38 * t18;\n  t3  += 38 * t19;\n  t4  += 38 * t20;\n  t5  += 38 * t21;\n  t6  += 38 * t22;\n  t7  += 38 * t23;\n  t8  += 38 * t24;\n  t9  += 38 * t25;\n  t10 += 38 * t26;\n  t11 += 38 * t27;\n  t12 += 38 * t28;\n  t13 += 38 * t29;\n  t14 += 38 * t30;\n  // t15 left as is\n\n  // first car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  // second car\n  c = 1;\n  v =  t0 + c + 65535; c = Math.floor(v / 65536);  t0 = v - c * 65536;\n  v =  t1 + c + 65535; c = Math.floor(v / 65536);  t1 = v - c * 65536;\n  v =  t2 + c + 65535; c = Math.floor(v / 65536);  t2 = v - c * 65536;\n  v =  t3 + c + 65535; c = Math.floor(v / 65536);  t3 = v - c * 65536;\n  v =  t4 + c + 65535; c = Math.floor(v / 65536);  t4 = v - c * 65536;\n  v =  t5 + c + 65535; c = Math.floor(v / 65536);  t5 = v - c * 65536;\n  v =  t6 + c + 65535; c = Math.floor(v / 65536);  t6 = v - c * 65536;\n  v =  t7 + c + 65535; c = Math.floor(v / 65536);  t7 = v - c * 65536;\n  v =  t8 + c + 65535; c = Math.floor(v / 65536);  t8 = v - c * 65536;\n  v =  t9 + c + 65535; c = Math.floor(v / 65536);  t9 = v - c * 65536;\n  v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n  v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n  v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n  v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n  v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n  v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n  t0 += c-1 + 37 * (c-1);\n\n  o[ 0] = t0;\n  o[ 1] = t1;\n  o[ 2] = t2;\n  o[ 3] = t3;\n  o[ 4] = t4;\n  o[ 5] = t5;\n  o[ 6] = t6;\n  o[ 7] = t7;\n  o[ 8] = t8;\n  o[ 9] = t9;\n  o[10] = t10;\n  o[11] = t11;\n  o[12] = t12;\n  o[13] = t13;\n  o[14] = t14;\n  o[15] = t15;\n}\n\nfunction S(o, a) {\n  M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 253; a >= 0; a--) {\n    S(c, c);\n    if(a !== 2 && a !== 4) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n  var c = gf();\n  var a;\n  for (a = 0; a < 16; a++) c[a] = i[a];\n  for (a = 250; a >= 0; a--) {\n      S(c, c);\n      if(a !== 1) M(c, c, i);\n  }\n  for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n  var z = new Uint8Array(32);\n  var x = new Float64Array(80), r, i;\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf();\n  for (i = 0; i < 31; i++) z[i] = n[i];\n  z[31]=(n[31]&127)|64;\n  z[0]&=248;\n  unpack25519(x,p);\n  for (i = 0; i < 16; i++) {\n    b[i]=x[i];\n    d[i]=a[i]=c[i]=0;\n  }\n  a[0]=d[0]=1;\n  for (i=254; i>=0; --i) {\n    r=(z[i>>>3]>>>(i&7))&1;\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n    A(e,a,c);\n    Z(a,a,c);\n    A(c,b,d);\n    Z(b,b,d);\n    S(d,e);\n    S(f,a);\n    M(a,c,a);\n    M(c,b,e);\n    A(e,a,c);\n    Z(a,a,c);\n    S(b,a);\n    Z(c,d,f);\n    M(a,c,_121665);\n    A(a,a,d);\n    M(c,c,a);\n    M(a,d,f);\n    M(d,b,x);\n    S(b,e);\n    sel25519(a,b,r);\n    sel25519(c,d,r);\n  }\n  for (i = 0; i < 16; i++) {\n    x[i+16]=a[i];\n    x[i+32]=c[i];\n    x[i+48]=b[i];\n    x[i+64]=d[i];\n  }\n  var x32 = x.subarray(32);\n  var x16 = x.subarray(16);\n  inv25519(x32,x32);\n  M(x16,x16,x32);\n  pack25519(q,x16);\n  return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n  return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n  randombytes(x, 32);\n  return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n  var s = new Uint8Array(32);\n  crypto_scalarmult(s, x, y);\n  return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n  var k = new Uint8Array(32);\n  crypto_box_beforenm(k, y, x);\n  return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n  var k = new Uint8Array(32);\n  crypto_box_beforenm(k, y, x);\n  return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n  var wh = new Int32Array(16), wl = new Int32Array(16),\n      bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n      bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n      th, tl, i, j, h, l, a, b, c, d;\n\n  var ah0 = hh[0],\n      ah1 = hh[1],\n      ah2 = hh[2],\n      ah3 = hh[3],\n      ah4 = hh[4],\n      ah5 = hh[5],\n      ah6 = hh[6],\n      ah7 = hh[7],\n\n      al0 = hl[0],\n      al1 = hl[1],\n      al2 = hl[2],\n      al3 = hl[3],\n      al4 = hl[4],\n      al5 = hl[5],\n      al6 = hl[6],\n      al7 = hl[7];\n\n  var pos = 0;\n  while (n >= 128) {\n    for (i = 0; i < 16; i++) {\n      j = 8 * i + pos;\n      wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n      wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n    }\n    for (i = 0; i < 80; i++) {\n      bh0 = ah0;\n      bh1 = ah1;\n      bh2 = ah2;\n      bh3 = ah3;\n      bh4 = ah4;\n      bh5 = ah5;\n      bh6 = ah6;\n      bh7 = ah7;\n\n      bl0 = al0;\n      bl1 = al1;\n      bl2 = al2;\n      bl3 = al3;\n      bl4 = al4;\n      bl5 = al5;\n      bl6 = al6;\n      bl7 = al7;\n\n      // add\n      h = ah7;\n      l = al7;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      // Sigma1\n      h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n      l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // Ch\n      h = (ah4 & ah5) ^ (~ah4 & ah6);\n      l = (al4 & al5) ^ (~al4 & al6);\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // K\n      h = K[i*2];\n      l = K[i*2+1];\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // w\n      h = wh[i%16];\n      l = wl[i%16];\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      th = c & 0xffff | d << 16;\n      tl = a & 0xffff | b << 16;\n\n      // add\n      h = th;\n      l = tl;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      // Sigma0\n      h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n      l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      // Maj\n      h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n      l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      bh7 = (c & 0xffff) | (d << 16);\n      bl7 = (a & 0xffff) | (b << 16);\n\n      // add\n      h = bh3;\n      l = bl3;\n\n      a = l & 0xffff; b = l >>> 16;\n      c = h & 0xffff; d = h >>> 16;\n\n      h = th;\n      l = tl;\n\n      a += l & 0xffff; b += l >>> 16;\n      c += h & 0xffff; d += h >>> 16;\n\n      b += a >>> 16;\n      c += b >>> 16;\n      d += c >>> 16;\n\n      bh3 = (c & 0xffff) | (d << 16);\n      bl3 = (a & 0xffff) | (b << 16);\n\n      ah1 = bh0;\n      ah2 = bh1;\n      ah3 = bh2;\n      ah4 = bh3;\n      ah5 = bh4;\n      ah6 = bh5;\n      ah7 = bh6;\n      ah0 = bh7;\n\n      al1 = bl0;\n      al2 = bl1;\n      al3 = bl2;\n      al4 = bl3;\n      al5 = bl4;\n      al6 = bl5;\n      al7 = bl6;\n      al0 = bl7;\n\n      if (i%16 === 15) {\n        for (j = 0; j < 16; j++) {\n          // add\n          h = wh[j];\n          l = wl[j];\n\n          a = l & 0xffff; b = l >>> 16;\n          c = h & 0xffff; d = h >>> 16;\n\n          h = wh[(j+9)%16];\n          l = wl[(j+9)%16];\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          // sigma0\n          th = wh[(j+1)%16];\n          tl = wl[(j+1)%16];\n          h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n          l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          // sigma1\n          th = wh[(j+14)%16];\n          tl = wl[(j+14)%16];\n          h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n          l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n          a += l & 0xffff; b += l >>> 16;\n          c += h & 0xffff; d += h >>> 16;\n\n          b += a >>> 16;\n          c += b >>> 16;\n          d += c >>> 16;\n\n          wh[j] = (c & 0xffff) | (d << 16);\n          wl[j] = (a & 0xffff) | (b << 16);\n        }\n      }\n    }\n\n    // add\n    h = ah0;\n    l = al0;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[0];\n    l = hl[0];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[0] = ah0 = (c & 0xffff) | (d << 16);\n    hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n    h = ah1;\n    l = al1;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[1];\n    l = hl[1];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[1] = ah1 = (c & 0xffff) | (d << 16);\n    hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n    h = ah2;\n    l = al2;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[2];\n    l = hl[2];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[2] = ah2 = (c & 0xffff) | (d << 16);\n    hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n    h = ah3;\n    l = al3;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[3];\n    l = hl[3];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[3] = ah3 = (c & 0xffff) | (d << 16);\n    hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n    h = ah4;\n    l = al4;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[4];\n    l = hl[4];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[4] = ah4 = (c & 0xffff) | (d << 16);\n    hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n    h = ah5;\n    l = al5;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[5];\n    l = hl[5];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[5] = ah5 = (c & 0xffff) | (d << 16);\n    hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n    h = ah6;\n    l = al6;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[6];\n    l = hl[6];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[6] = ah6 = (c & 0xffff) | (d << 16);\n    hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n    h = ah7;\n    l = al7;\n\n    a = l & 0xffff; b = l >>> 16;\n    c = h & 0xffff; d = h >>> 16;\n\n    h = hh[7];\n    l = hl[7];\n\n    a += l & 0xffff; b += l >>> 16;\n    c += h & 0xffff; d += h >>> 16;\n\n    b += a >>> 16;\n    c += b >>> 16;\n    d += c >>> 16;\n\n    hh[7] = ah7 = (c & 0xffff) | (d << 16);\n    hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n    pos += 128;\n    n -= 128;\n  }\n\n  return n;\n}\n\nfunction crypto_hash(out, m, n) {\n  var hh = new Int32Array(8),\n      hl = new Int32Array(8),\n      x = new Uint8Array(256),\n      i, b = n;\n\n  hh[0] = 0x6a09e667;\n  hh[1] = 0xbb67ae85;\n  hh[2] = 0x3c6ef372;\n  hh[3] = 0xa54ff53a;\n  hh[4] = 0x510e527f;\n  hh[5] = 0x9b05688c;\n  hh[6] = 0x1f83d9ab;\n  hh[7] = 0x5be0cd19;\n\n  hl[0] = 0xf3bcc908;\n  hl[1] = 0x84caa73b;\n  hl[2] = 0xfe94f82b;\n  hl[3] = 0x5f1d36f1;\n  hl[4] = 0xade682d1;\n  hl[5] = 0x2b3e6c1f;\n  hl[6] = 0xfb41bd6b;\n  hl[7] = 0x137e2179;\n\n  crypto_hashblocks_hl(hh, hl, m, n);\n  n %= 128;\n\n  for (i = 0; i < n; i++) x[i] = m[b-n+i];\n  x[n] = 128;\n\n  n = 256-128*(n<112?1:0);\n  x[n-9] = 0;\n  ts64(x, n-8,  (b / 0x20000000) | 0, b << 3);\n  crypto_hashblocks_hl(hh, hl, x, n);\n\n  for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n  return 0;\n}\n\nfunction add(p, q) {\n  var a = gf(), b = gf(), c = gf(),\n      d = gf(), e = gf(), f = gf(),\n      g = gf(), h = gf(), t = gf();\n\n  Z(a, p[1], p[0]);\n  Z(t, q[1], q[0]);\n  M(a, a, t);\n  A(b, p[0], p[1]);\n  A(t, q[0], q[1]);\n  M(b, b, t);\n  M(c, p[3], q[3]);\n  M(c, c, D2);\n  M(d, p[2], q[2]);\n  A(d, d, d);\n  Z(e, b, a);\n  Z(f, d, c);\n  A(g, d, c);\n  A(h, b, a);\n\n  M(p[0], e, f);\n  M(p[1], h, g);\n  M(p[2], g, f);\n  M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n  var i;\n  for (i = 0; i < 4; i++) {\n    sel25519(p[i], q[i], b);\n  }\n}\n\nfunction pack(r, p) {\n  var tx = gf(), ty = gf(), zi = gf();\n  inv25519(zi, p[2]);\n  M(tx, p[0], zi);\n  M(ty, p[1], zi);\n  pack25519(r, ty);\n  r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n  var b, i;\n  set25519(p[0], gf0);\n  set25519(p[1], gf1);\n  set25519(p[2], gf1);\n  set25519(p[3], gf0);\n  for (i = 255; i >= 0; --i) {\n    b = (s[(i/8)|0] >> (i&7)) & 1;\n    cswap(p, q, b);\n    add(q, p);\n    add(p, p);\n    cswap(p, q, b);\n  }\n}\n\nfunction scalarbase(p, s) {\n  var q = [gf(), gf(), gf(), gf()];\n  set25519(q[0], X);\n  set25519(q[1], Y);\n  set25519(q[2], gf1);\n  M(q[3], X, Y);\n  scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n  var d = new Uint8Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n  var i;\n\n  if (!seeded) randombytes(sk, 32);\n  crypto_hash(d, sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  scalarbase(p, d);\n  pack(pk, p);\n\n  for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n  return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n  var carry, i, j, k;\n  for (i = 63; i >= 32; --i) {\n    carry = 0;\n    for (j = i - 32, k = i - 12; j < k; ++j) {\n      x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n      carry = (x[j] + 128) >> 8;\n      x[j] -= carry * 256;\n    }\n    x[j] += carry;\n    x[i] = 0;\n  }\n  carry = 0;\n  for (j = 0; j < 32; j++) {\n    x[j] += carry - (x[31] >> 4) * L[j];\n    carry = x[j] >> 8;\n    x[j] &= 255;\n  }\n  for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n  for (i = 0; i < 32; i++) {\n    x[i+1] += x[i] >> 8;\n    r[i] = x[i] & 255;\n  }\n}\n\nfunction reduce(r) {\n  var x = new Float64Array(64), i;\n  for (i = 0; i < 64; i++) x[i] = r[i];\n  for (i = 0; i < 64; i++) r[i] = 0;\n  modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n  var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n  var i, j, x = new Float64Array(64);\n  var p = [gf(), gf(), gf(), gf()];\n\n  crypto_hash(d, sk, 32);\n  d[0] &= 248;\n  d[31] &= 127;\n  d[31] |= 64;\n\n  var smlen = n + 64;\n  for (i = 0; i < n; i++) sm[64 + i] = m[i];\n  for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n  crypto_hash(r, sm.subarray(32), n+32);\n  reduce(r);\n  scalarbase(p, r);\n  pack(sm, p);\n\n  for (i = 32; i < 64; i++) sm[i] = sk[i];\n  crypto_hash(h, sm, n + 64);\n  reduce(h);\n\n  for (i = 0; i < 64; i++) x[i] = 0;\n  for (i = 0; i < 32; i++) x[i] = r[i];\n  for (i = 0; i < 32; i++) {\n    for (j = 0; j < 32; j++) {\n      x[i+j] += h[i] * d[j];\n    }\n  }\n\n  modL(sm.subarray(32), x);\n  return smlen;\n}\n\nfunction unpackneg(r, p) {\n  var t = gf(), chk = gf(), num = gf(),\n      den = gf(), den2 = gf(), den4 = gf(),\n      den6 = gf();\n\n  set25519(r[2], gf1);\n  unpack25519(r[1], p);\n  S(num, r[1]);\n  M(den, num, D);\n  Z(num, num, r[2]);\n  A(den, r[2], den);\n\n  S(den2, den);\n  S(den4, den2);\n  M(den6, den4, den2);\n  M(t, den6, num);\n  M(t, t, den);\n\n  pow2523(t, t);\n  M(t, t, num);\n  M(t, t, den);\n  M(t, t, den);\n  M(r[0], t, den);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) M(r[0], r[0], I);\n\n  S(chk, r[0]);\n  M(chk, chk, den);\n  if (neq25519(chk, num)) return -1;\n\n  if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n  M(r[3], r[0], r[1]);\n  return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n  var i, mlen;\n  var t = new Uint8Array(32), h = new Uint8Array(64);\n  var p = [gf(), gf(), gf(), gf()],\n      q = [gf(), gf(), gf(), gf()];\n\n  mlen = -1;\n  if (n < 64) return -1;\n\n  if (unpackneg(q, pk)) return -1;\n\n  for (i = 0; i < n; i++) m[i] = sm[i];\n  for (i = 0; i < 32; i++) m[i+32] = pk[i];\n  crypto_hash(h, m, n);\n  reduce(h);\n  scalarmult(p, q, h);\n\n  scalarbase(q, sm.subarray(32));\n  add(p, q);\n  pack(t, p);\n\n  n -= 64;\n  if (crypto_verify_32(sm, 0, t, 0)) {\n    for (i = 0; i < n; i++) m[i] = 0;\n    return -1;\n  }\n\n  for (i = 0; i < n; i++) m[i] = sm[i + 64];\n  mlen = n;\n  return mlen;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n    crypto_secretbox_NONCEBYTES = 24,\n    crypto_secretbox_ZEROBYTES = 32,\n    crypto_secretbox_BOXZEROBYTES = 16,\n    crypto_scalarmult_BYTES = 32,\n    crypto_scalarmult_SCALARBYTES = 32,\n    crypto_box_PUBLICKEYBYTES = 32,\n    crypto_box_SECRETKEYBYTES = 32,\n    crypto_box_BEFORENMBYTES = 32,\n    crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n    crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n    crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n    crypto_sign_BYTES = 64,\n    crypto_sign_PUBLICKEYBYTES = 32,\n    crypto_sign_SECRETKEYBYTES = 64,\n    crypto_sign_SEEDBYTES = 32,\n    crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n  crypto_core_hsalsa20: crypto_core_hsalsa20,\n  crypto_stream_xor: crypto_stream_xor,\n  crypto_stream: crypto_stream,\n  crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n  crypto_stream_salsa20: crypto_stream_salsa20,\n  crypto_onetimeauth: crypto_onetimeauth,\n  crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n  crypto_verify_16: crypto_verify_16,\n  crypto_verify_32: crypto_verify_32,\n  crypto_secretbox: crypto_secretbox,\n  crypto_secretbox_open: crypto_secretbox_open,\n  crypto_scalarmult: crypto_scalarmult,\n  crypto_scalarmult_base: crypto_scalarmult_base,\n  crypto_box_beforenm: crypto_box_beforenm,\n  crypto_box_afternm: crypto_box_afternm,\n  crypto_box: crypto_box,\n  crypto_box_open: crypto_box_open,\n  crypto_box_keypair: crypto_box_keypair,\n  crypto_hash: crypto_hash,\n  crypto_sign: crypto_sign,\n  crypto_sign_keypair: crypto_sign_keypair,\n  crypto_sign_open: crypto_sign_open,\n\n  crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n  crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n  crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n  crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n  crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n  crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n  crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n  crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n  crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n  crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n  crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n  crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n  crypto_sign_BYTES: crypto_sign_BYTES,\n  crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n  crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n  crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n  crypto_hash_BYTES: crypto_hash_BYTES\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n  if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n  if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n  if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n  if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n  for (var i = 0; i < arguments.length; i++) {\n    if (!(arguments[i] instanceof Uint8Array))\n      throw new TypeError('unexpected type, use Uint8Array');\n  }\n}\n\nfunction cleanup(arr) {\n  for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\nnacl.randomBytes = function(n) {\n  var b = new Uint8Array(n);\n  randombytes(b, n);\n  return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n  checkArrayTypes(msg, nonce, key);\n  checkLengths(key, nonce);\n  var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n  var c = new Uint8Array(m.length);\n  for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n  crypto_secretbox(c, m, m.length, nonce, key);\n  return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n  checkArrayTypes(box, nonce, key);\n  checkLengths(key, nonce);\n  var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n  var m = new Uint8Array(c.length);\n  for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n  if (c.length < 32) return null;\n  if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return null;\n  return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n  checkArrayTypes(n, p);\n  if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n  if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n  var q = new Uint8Array(crypto_scalarmult_BYTES);\n  crypto_scalarmult(q, n, p);\n  return q;\n};\n\nnacl.scalarMult.base = function(n) {\n  checkArrayTypes(n);\n  if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n  var q = new Uint8Array(crypto_scalarmult_BYTES);\n  crypto_scalarmult_base(q, n);\n  return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n  var k = nacl.box.before(publicKey, secretKey);\n  return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n  checkArrayTypes(publicKey, secretKey);\n  checkBoxLengths(publicKey, secretKey);\n  var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n  crypto_box_beforenm(k, publicKey, secretKey);\n  return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n  var k = nacl.box.before(publicKey, secretKey);\n  return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n  crypto_box_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n  crypto_scalarmult_base(pk, secretKey);\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n  checkArrayTypes(msg, secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n  crypto_sign(signedMsg, msg, msg.length, secretKey);\n  return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n  checkArrayTypes(signedMsg, publicKey);\n  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n    throw new Error('bad public key size');\n  var tmp = new Uint8Array(signedMsg.length);\n  var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n  if (mlen < 0) return null;\n  var m = new Uint8Array(mlen);\n  for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n  return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n  var signedMsg = nacl.sign(msg, secretKey);\n  var sig = new Uint8Array(crypto_sign_BYTES);\n  for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n  return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n  checkArrayTypes(msg, sig, publicKey);\n  if (sig.length !== crypto_sign_BYTES)\n    throw new Error('bad signature size');\n  if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n    throw new Error('bad public key size');\n  var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n  var i;\n  for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n  for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n  return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  crypto_sign_keypair(pk, sk);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n  checkArrayTypes(secretKey);\n  if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n    throw new Error('bad secret key size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n  return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n  checkArrayTypes(seed);\n  if (seed.length !== crypto_sign_SEEDBYTES)\n    throw new Error('bad seed size');\n  var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n  var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n  for (var i = 0; i < 32; i++) sk[i] = seed[i];\n  crypto_sign_keypair(pk, sk, true);\n  return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n  checkArrayTypes(msg);\n  var h = new Uint8Array(crypto_hash_BYTES);\n  crypto_hash(h, msg, msg.length);\n  return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n  checkArrayTypes(x, y);\n  // Zero length arguments are considered not equal.\n  if (x.length === 0 || y.length === 0) return false;\n  if (x.length !== y.length) return false;\n  return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n  randombytes = fn;\n};\n\n(function() {\n  // Initialize PRNG if environment provides CSPRNG.\n  // If not, methods calling randombytes will throw.\n  var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n  if (crypto && crypto.getRandomValues) {\n    // Browsers.\n    var QUOTA = 65536;\n    nacl.setPRNG(function(x, n) {\n      var i, v = new Uint8Array(n);\n      for (i = 0; i < n; i += QUOTA) {\n        crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n      }\n      for (i = 0; i < n; i++) x[i] = v[i];\n      cleanup(v);\n    });\n  } else if (true) {\n    // Node.js.\n    crypto = __webpack_require__(1359);\n    if (crypto && crypto.randomBytes) {\n      nacl.setPRNG(function(x, n) {\n        var i, v = crypto.randomBytes(n);\n        for (i = 0; i < n; i++) x[i] = v[i];\n        cleanup(v);\n      });\n    }\n  }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/tweetnacl/nacl-fast.js\n// module id = 1253\n// module chunks = 0\n\n//# sourceURL=../node_modules/tweetnacl/nacl-fast.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var NATIVE = __webpack_require__(311)\nvar ERRORS = __webpack_require__(546)\n\nfunction _Buffer (value) {\n  return Buffer.isBuffer(value)\n}\n\nfunction Hex (value) {\n  return typeof value === 'string' && /^([0-9a-f]{2})+$/i.test(value)\n}\n\nfunction _LengthN (type, length) {\n  var name = type.toJSON()\n\n  function Length (value) {\n    if (!type(value)) return false\n    if (value.length === length) return true\n\n    throw ERRORS.tfCustomError(name + '(Length: ' + length + ')', name + '(Length: ' + value.length + ')')\n  }\n  Length.toJSON = function () { return name }\n\n  return Length\n}\n\nvar _ArrayN = _LengthN.bind(null, NATIVE.Array)\nvar _BufferN = _LengthN.bind(null, _Buffer)\nvar _HexN = _LengthN.bind(null, Hex)\nvar _StringN = _LengthN.bind(null, NATIVE.String)\n\nvar UINT53_MAX = Math.pow(2, 53) - 1\n\nfunction Finite (value) {\n  return typeof value === 'number' && isFinite(value)\n}\nfunction Int8 (value) { return ((value << 24) >> 24) === value }\nfunction Int16 (value) { return ((value << 16) >> 16) === value }\nfunction Int32 (value) { return (value | 0) === value }\nfunction UInt8 (value) { return (value & 0xff) === value }\nfunction UInt16 (value) { return (value & 0xffff) === value }\nfunction UInt32 (value) { return (value >>> 0) === value }\nfunction UInt53 (value) {\n  return typeof value === 'number' &&\n    value >= 0 &&\n    value <= UINT53_MAX &&\n    Math.floor(value) === value\n}\n\nvar types = {\n  ArrayN: _ArrayN,\n  Buffer: _Buffer,\n  BufferN: _BufferN,\n  Finite: Finite,\n  Hex: Hex,\n  HexN: _HexN,\n  Int8: Int8,\n  Int16: Int16,\n  Int32: Int32,\n  StringN: _StringN,\n  UInt8: UInt8,\n  UInt16: UInt16,\n  UInt32: UInt32,\n  UInt53: UInt53\n}\n\nfor (var typeName in types) {\n  types[typeName].toJSON = function (t) {\n    return t\n  }.bind(null, typeName)\n}\n\nmodule.exports = types\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/typeforce/extra.js\n// module id = 1254\n// module chunks = 0\n\n//# sourceURL=../node_modules/typeforce/extra.js")},function(module,exports){eval("module.exports = urlSetQuery\nfunction urlSetQuery (url, query) {\n  if (query) {\n    // remove optional leading symbols\n    query = query.trim().replace(/^(\\?|#|&)/, '')\n\n    // don't append empty query\n    query = query ? ('?' + query) : query\n\n    var parts = url.split(/[\\?\\#]/)\n    var start = parts[0]\n    if (query && /\\:\\/\\/[^\\/]*$/.test(start)) {\n      // e.g. http://foo.com -> http://foo.com/\n      start = start + '/'\n    }\n    var match = url.match(/(\\#.*)$/)\n    url = start + query\n    if (match) { // add hash back in\n      url = url + match[0]\n    }\n  }\n  return url\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/url-set-query/index.js\n// module id = 1255\n// module chunks = 0\n\n//# sourceURL=../node_modules/url-set-query/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nmodule.exports = {\n  isString: function(arg) {\n    return typeof(arg) === 'string';\n  },\n  isObject: function(arg) {\n    return typeof(arg) === 'object' && arg !== null;\n  },\n  isNull: function(arg) {\n    return arg === null;\n  },\n  isNullOrUndefined: function(arg) {\n    return arg == null;\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/url/util.js\n// module id = 1256\n// module chunks = 0\n\n//# sourceURL=../node_modules/url/util.js")},function(module,exports,__webpack_require__){"use strict";eval('\n\nfunction isHighSurrogate(codePoint) {\n  return codePoint >= 0xd800 && codePoint <= 0xdbff;\n}\n\nfunction isLowSurrogate(codePoint) {\n  return codePoint >= 0xdc00 && codePoint <= 0xdfff;\n}\n\n// Truncate string by size in bytes\nmodule.exports = function getByteLength(string) {\n  if (typeof string !== "string") {\n    throw new Error("Input must be string");\n  }\n\n  var charLength = string.length;\n  var byteLength = 0;\n  var codePoint = null;\n  var prevCodePoint = null;\n  for (var i = 0; i < charLength; i++) {\n    codePoint = string.charCodeAt(i);\n    // handle 4-byte non-BMP chars\n    // low surrogate\n    if (isLowSurrogate(codePoint)) {\n      // when parsing previous hi-surrogate, 3 is added to byteLength\n      if (prevCodePoint != null && isHighSurrogate(prevCodePoint)) {\n        byteLength += 1;\n      }\n      else {\n        byteLength += 3;\n      }\n    }\n    else if (codePoint <= 0x7f ) {\n      byteLength += 1;\n    }\n    else if (codePoint >= 0x80 && codePoint <= 0x7ff) {\n      byteLength += 2;\n    }\n    else if (codePoint >= 0x800 && codePoint <= 0xffff) {\n      byteLength += 3;\n    }\n    prevCodePoint = codePoint;\n  }\n\n  return byteLength;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/utf8-byte-length/browser.js\n// module id = 1257\n// module chunks = 0\n\n//# sourceURL=../node_modules/utf8-byte-length/browser.js')},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\n/**\n * Module exports.\n */\n\nmodule.exports = deprecate;\n\n/**\n * Mark that a method should not be used.\n * Returns a modified function which warns once by default.\n *\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\n *\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\n * will throw an Error when invoked.\n *\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\n * will invoke `console.trace()` instead of `console.error()`.\n *\n * @param {Function} fn - the function to deprecate\n * @param {String} msg - the string to print to the console when `fn` is invoked\n * @returns {Function} a new \"deprecated\" version of `fn`\n * @api public\n */\n\nfunction deprecate (fn, msg) {\n  if (config('noDeprecation')) {\n    return fn;\n  }\n\n  var warned = false;\n  function deprecated() {\n    if (!warned) {\n      if (config('throwDeprecation')) {\n        throw new Error(msg);\n      } else if (config('traceDeprecation')) {\n        console.trace(msg);\n      } else {\n        console.warn(msg);\n      }\n      warned = true;\n    }\n    return fn.apply(this, arguments);\n  }\n\n  return deprecated;\n}\n\n/**\n * Checks `localStorage` for boolean values for the given `name`.\n *\n * @param {String} name\n * @returns {Boolean}\n * @api private\n */\n\nfunction config (name) {\n  // accessing global.localStorage can trigger a DOMException in sandboxed iframes\n  try {\n    if (!global.localStorage) return false;\n  } catch (_) {\n    return false;\n  }\n  var val = global.localStorage[name];\n  if (null == val) return false;\n  return String(val).toLowerCase() === 'true';\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/util-deprecate/browser.js\n// module id = 1258\n// module chunks = 0\n\n//# sourceURL=../node_modules/util-deprecate/browser.js")},function(module,exports){eval("if (typeof Object.create === 'function') {\n  // implementation from standard node.js 'util' module\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    ctor.prototype = Object.create(superCtor.prototype, {\n      constructor: {\n        value: ctor,\n        enumerable: false,\n        writable: true,\n        configurable: true\n      }\n    });\n  };\n} else {\n  // old school shim for old browsers\n  module.exports = function inherits(ctor, superCtor) {\n    ctor.super_ = superCtor\n    var TempCtor = function () {}\n    TempCtor.prototype = superCtor.prototype\n    ctor.prototype = new TempCtor()\n    ctor.prototype.constructor = ctor\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/util/~/inherits/inherits_browser.js\n// module id = 1259\n// module chunks = 0\n\n//# sourceURL=../node_modules/util/node_modules/inherits/inherits_browser.js")},function(module,exports){eval("module.exports = function isBuffer(arg) {\n  return arg && typeof arg === 'object'\n    && typeof arg.copy === 'function'\n    && typeof arg.fill === 'function'\n    && typeof arg.readUInt8 === 'function';\n}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/util/support/isBufferBrowser.js\n// module id = 1260\n// module chunks = 0\n\n//# sourceURL=../node_modules/util/support/isBufferBrowser.js")},function(module,exports,__webpack_require__){eval("var rng = __webpack_require__(550);\nvar bytesToUuid = __webpack_require__(549);\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n  var i = buf && offset || 0;\n  var b = buf || [];\n\n  options = options || {};\n  var node = options.node || _nodeId;\n  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n  // node and clockseq need to be initialized to random values if they're not\n  // specified.  We do this lazily to minimize issues related to insufficient\n  // system entropy.  See #189\n  if (node == null || clockseq == null) {\n    var seedBytes = rng();\n    if (node == null) {\n      // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n      node = _nodeId = [\n        seedBytes[0] | 0x01,\n        seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n      ];\n    }\n    if (clockseq == null) {\n      // Per 4.2.2, randomize (14 bit) clockseq\n      clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n    }\n  }\n\n  // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n  // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so\n  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n  // Per 4.2.1.2, use count of uuid's generated during the current clock\n  // cycle to simulate higher resolution clock\n  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n  // Time since last uuid creation (in msecs)\n  var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n  // Per 4.2.1.2, Bump clockseq on clock regression\n  if (dt < 0 && options.clockseq === undefined) {\n    clockseq = clockseq + 1 & 0x3fff;\n  }\n\n  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n  // time interval\n  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n    nsecs = 0;\n  }\n\n  // Per 4.2.1.2 Throw error if too many uuids are requested\n  if (nsecs >= 10000) {\n    throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n  }\n\n  _lastMSecs = msecs;\n  _lastNSecs = nsecs;\n  _clockseq = clockseq;\n\n  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n  msecs += 12219292800000;\n\n  // `time_low`\n  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n  b[i++] = tl >>> 24 & 0xff;\n  b[i++] = tl >>> 16 & 0xff;\n  b[i++] = tl >>> 8 & 0xff;\n  b[i++] = tl & 0xff;\n\n  // `time_mid`\n  var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n  b[i++] = tmh >>> 8 & 0xff;\n  b[i++] = tmh & 0xff;\n\n  // `time_high_and_version`\n  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n  b[i++] = tmh >>> 16 & 0xff;\n\n  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n  b[i++] = clockseq >>> 8 | 0x80;\n\n  // `clock_seq_low`\n  b[i++] = clockseq & 0xff;\n\n  // `node`\n  for (var n = 0; n < 6; ++n) {\n    b[i + n] = node[n];\n  }\n\n  return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/v1.js\n// module id = 1261\n// module chunks = 0\n\n//# sourceURL=../node_modules/uuid/v1.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nconst varint = __webpack_require__(29)\n\nmodule.exports = (buf) => {\n  if (!Buffer.isBuffer(buf)) {\n    throw new Error('arg needs to be a buffer')\n  }\n\n  let result = []\n\n  while (buf.length > 0) {\n    const num = varint.decode(buf)\n    result.push(num)\n    buf = buf.slice(varint.decode.bytes)\n  }\n\n  return result\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varint-decoder/src/index.js\n// module id = 1262\n// module chunks = 0\n\n//# sourceURL=../node_modules/varint-decoder/src/index.js")},function(module,exports){eval("module.exports = read\n\nvar MSB = 0x80\n  , REST = 0x7F\n\nfunction read(buf, offset) {\n  var res    = 0\n    , offset = offset || 0\n    , shift  = 0\n    , counter = offset\n    , b\n    , l = buf.length\n\n  do {\n    if (counter >= l) {\n      read.bytes = 0\n      throw new RangeError('Could not decode varint')\n    }\n    b = buf[counter++]\n    res += shift < 28\n      ? (b & REST) << shift\n      : (b & REST) * Math.pow(2, shift)\n    shift += 7\n  } while (b >= MSB)\n\n  read.bytes = counter - offset\n\n  return res\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varint/decode.js\n// module id = 1263\n// module chunks = 0\n\n//# sourceURL=../node_modules/varint/decode.js")},function(module,exports){eval("module.exports = encode\n\nvar MSB = 0x80\n  , REST = 0x7F\n  , MSBALL = ~REST\n  , INT = Math.pow(2, 31)\n\nfunction encode(num, out, offset) {\n  out = out || []\n  offset = offset || 0\n  var oldOffset = offset\n\n  while(num >= INT) {\n    out[offset++] = (num & 0xFF) | MSB\n    num /= 128\n  }\n  while(num & MSBALL) {\n    out[offset++] = (num & 0xFF) | MSB\n    num >>>= 7\n  }\n  out[offset] = num | 0\n  \n  encode.bytes = offset - oldOffset + 1\n  \n  return out\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varint/encode.js\n// module id = 1264\n// module chunks = 0\n\n//# sourceURL=../node_modules/varint/encode.js")},function(module,exports){eval("\nvar N1 = Math.pow(2,  7)\nvar N2 = Math.pow(2, 14)\nvar N3 = Math.pow(2, 21)\nvar N4 = Math.pow(2, 28)\nvar N5 = Math.pow(2, 35)\nvar N6 = Math.pow(2, 42)\nvar N7 = Math.pow(2, 49)\nvar N8 = Math.pow(2, 56)\nvar N9 = Math.pow(2, 63)\n\nmodule.exports = function (value) {\n  return (\n    value < N1 ? 1\n  : value < N2 ? 2\n  : value < N3 ? 3\n  : value < N4 ? 4\n  : value < N5 ? 5\n  : value < N6 ? 6\n  : value < N7 ? 7\n  : value < N8 ? 8\n  : value < N9 ? 9\n  :              10\n  )\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/varint/length.js\n// module id = 1265\n// module chunks = 0\n\n//# sourceURL=../node_modules/varint/length.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar swarm = __webpack_require__(544);\n\n\nvar Bzz = function Bzz(provider) {\n\n    this.givenProvider = Bzz.givenProvider;\n\n    if (provider && provider._requestManager) {\n        provider = provider.currentProvider;\n    }\n\n    // only allow file picker when in browser\n    if(typeof document !== 'undefined') {\n        this.pick = swarm.pick;\n    }\n\n    this.setProvider(provider);\n};\n\n// set default ethereum provider\n/* jshint ignore:start */\nBzz.givenProvider = null;\nif(typeof ethereumProvider !== 'undefined' && ethereumProvider.bzz) {\n    Bzz.givenProvider = ethereumProvider.bzz;\n}\n/* jshint ignore:end */\n\nBzz.prototype.setProvider = function(provider) {\n    // is ethereum provider\n    if(_.isObject(provider) && _.isString(provider.bzz)) {\n        provider = provider.bzz;\n    // is no string, set default\n    }\n    // else if(!_.isString(provider)) {\n    //      provider = 'http://swarm-gateways.net'; // default to gateway\n    // }\n\n\n    if(_.isString(provider)) {\n        this.currentProvider = provider;\n    } else {\n        this.currentProvider = null;\n\n        var noProviderError = new Error('No provider set, please set one using bzz.setProvider().');\n\n        this.download = this.upload = this.isAvailable = function(){\n            throw noProviderError;\n        };\n\n        return false;\n    }\n\n    // add functions\n    this.download = swarm.at(provider).download;\n    this.upload = swarm.at(provider).upload;\n    this.isAvailable = swarm.at(provider).isAvailable;\n\n    return true;\n};\n\n\nmodule.exports = Bzz;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-bzz/src/index.js\n// module id = 1266\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-bzz/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file errors.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\nmodule.exports = {\n    ErrorResponse: function (result) {\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : JSON.stringify(result);\n        return new Error('Returned error: ' + message);\n    },\n    InvalidNumberOfParams: function (got, expected, method) {\n        return new Error('Invalid number of parameters for \"'+ method +'\". Got '+ got +' expected '+ expected +'!');\n    },\n    InvalidConnection: function (host){\n        return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +'.');\n    },\n    InvalidProvider: function () {\n        return new Error('Provider not set or invalid');\n    },\n    InvalidResponse: function (result){\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response: ' + JSON.stringify(result);\n        return new Error(message);\n    },\n    ConnectionTimeout: function (ms){\n        return new Error('CONNECTION TIMEOUT: timeout of ' + ms + ' ms achived');\n    }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-helpers/src/errors.js\n// module id = 1267\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-helpers/src/errors.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file formatters.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @author Marek Kotewicz <marek@parity.io>\n * @date 2017\n */\n\n\n\n\nvar _ = __webpack_require__(11);\nvar utils = __webpack_require__(47);\nvar Iban = __webpack_require__(559);\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber} number\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n    return utils.toBN(number).toString(10);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n    return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n    if (this && (blockNumber === undefined || blockNumber === null)) {\n        return this.defaultBlock;\n    }\n    if (blockNumber === 'genesis' || blockNumber === 'earliest') {\n        return '0x0';\n    }\n    return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n    if (blockNumber === undefined) {\n        return undefined;\n    } else if (isPredefinedBlockNumber(blockNumber)) {\n        return blockNumber;\n    }\n    return (utils.isHexStrict(blockNumber)) ? ((_.isString(blockNumber)) ? blockNumber.toLowerCase() : blockNumber) : utils.numberToHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method _txInputFormatter\n * @param {Object} transaction options\n * @returns object\n */\nvar _txInputFormatter = function (options){\n\n    if (options.to) { // it might be contract creation\n        options.to = inputAddressFormatter(options.to);\n    }\n\n    if (options.data && options.input) {\n        throw new Error('You can\\'t have \"data\" and \"input\" as properties of transactions at the same time, please use either \"data\" or \"input\" instead.');\n    }\n\n    if (!options.data && options.input) {\n        options.data = options.input;\n        delete options.input;\n    }\n\n    if(options.data && !utils.isHex(options.data)) {\n        throw new Error('The data field must be HEX encoded data.');\n    }\n\n    // allow both\n    if (options.gas || options.gasLimit) {\n        options.gas = options.gas || options.gasLimit;\n    }\n\n    ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n        return options[key] !== undefined;\n    }).forEach(function(key){\n        options[key] = utils.numberToHex(options[key]);\n    });\n\n    return options;\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputCallFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputCallFormatter = function (options){\n\n    options = _txInputFormatter(options);\n\n    var from = options.from || (this ? this.defaultAccount : null);\n\n    if (from) {\n        options.from = inputAddressFormatter(from);\n    }\n\n\n    return options;\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options) {\n\n    options = _txInputFormatter(options);\n\n    // check from, only if not number, or object\n    if (!_.isNumber(options.from) && !_.isObject(options.from)) {\n        options.from = options.from || (this ? this.defaultAccount : null);\n\n        if (!options.from && !_.isNumber(options.from)) {\n            throw new Error('The send transactions \"from\" field must be defined!');\n        }\n\n        options.from = inputAddressFormatter(options.from);\n    }\n\n    return options;\n};\n\n/**\n * Hex encodes the data passed to eth_sign and personal_sign\n *\n * @method inputSignFormatter\n * @param {String} data\n * @returns {String}\n */\nvar inputSignFormatter = function (data) {\n    return (utils.isHexStrict(data)) ? data : utils.utf8ToHex(data);\n};\n\n/**\n * Formats the output of a transaction to its proper values\n *\n * @method outputTransactionFormatter\n * @param {Object} tx\n * @returns {Object}\n*/\nvar outputTransactionFormatter = function (tx){\n    if(tx.blockNumber !== null)\n        tx.blockNumber = utils.hexToNumber(tx.blockNumber);\n    if(tx.transactionIndex !== null)\n        tx.transactionIndex = utils.hexToNumber(tx.transactionIndex);\n    tx.nonce = utils.hexToNumber(tx.nonce);\n    tx.gas = utils.hexToNumber(tx.gas);\n    tx.gasPrice = outputBigNumberFormatter(tx.gasPrice);\n    tx.value = outputBigNumberFormatter(tx.value);\n\n    if(tx.to && utils.isAddress(tx.to)) { // tx.to could be `0x0` or `null` while contract creation\n        tx.to = utils.toChecksumAddress(tx.to);\n    } else {\n        tx.to = null; // set to `null` if invalid address\n    }\n\n    if(tx.from) {\n        tx.from = utils.toChecksumAddress(tx.from);\n    }\n\n    return tx;\n};\n\n/**\n * Formats the output of a transaction receipt to its proper values\n *\n * @method outputTransactionReceiptFormatter\n * @param {Object} receipt\n * @returns {Object}\n*/\nvar outputTransactionReceiptFormatter = function (receipt){\n    if(typeof receipt !== 'object') {\n        throw new Error('Received receipt is invalid: '+ receipt);\n    }\n\n    if(receipt.blockNumber !== null)\n        receipt.blockNumber = utils.hexToNumber(receipt.blockNumber);\n    if(receipt.transactionIndex !== null)\n        receipt.transactionIndex = utils.hexToNumber(receipt.transactionIndex);\n    receipt.cumulativeGasUsed = utils.hexToNumber(receipt.cumulativeGasUsed);\n    receipt.gasUsed = utils.hexToNumber(receipt.gasUsed);\n\n    if(_.isArray(receipt.logs)) {\n        receipt.logs = receipt.logs.map(outputLogFormatter);\n    }\n\n    if(receipt.contractAddress) {\n        receipt.contractAddress = utils.toChecksumAddress(receipt.contractAddress);\n    }\n\n    return receipt;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block\n * @returns {Object}\n*/\nvar outputBlockFormatter = function(block) {\n\n    // transform to number\n    block.gasLimit = utils.hexToNumber(block.gasLimit);\n    block.gasUsed = utils.hexToNumber(block.gasUsed);\n    block.size = utils.hexToNumber(block.size);\n    block.timestamp = utils.hexToNumber(block.timestamp);\n    if (block.number !== null)\n        block.number = utils.hexToNumber(block.number);\n\n    if(block.difficulty)\n        block.difficulty = outputBigNumberFormatter(block.difficulty);\n    if(block.totalDifficulty)\n        block.totalDifficulty = outputBigNumberFormatter(block.totalDifficulty);\n\n    if (_.isArray(block.transactions)) {\n        block.transactions.forEach(function(item){\n            if(!_.isString(item))\n                return outputTransactionFormatter(item);\n        });\n    }\n\n    if (block.miner)\n        block.miner = utils.toChecksumAddress(block.miner);\n\n    return block;\n};\n\n/**\n * Formats the input of a log\n *\n * @method inputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar inputLogFormatter = function(options) {\n    var toTopic = function(value){\n\n        if(value === null || typeof value === 'undefined')\n            return null;\n\n        value = String(value);\n\n        if(value.indexOf('0x') === 0)\n            return value;\n        else\n            return utils.fromUtf8(value);\n    };\n\n    // make sure topics, get converted to hex\n    options.topics = options.topics || [];\n    options.topics = options.topics.map(function(topic){\n        return (_.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n    });\n\n    toTopic = null;\n\n    if (options.address) {\n        options.address = (_.isArray(options.address)) ? options.address.map(function (addr) {\n            return inputAddressFormatter(addr);\n        }) : inputAddressFormatter(options.address);\n    }\n\n    return options;\n};\n\n/**\n * Formats the output of a log\n *\n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n\n    // generate a custom log id\n    if(typeof log.blockHash === 'string' &&\n       typeof log.transactionHash === 'string' &&\n       typeof log.logIndex === 'string') {\n        var shaId = utils.sha3(log.blockHash.replace('0x','') + log.transactionHash.replace('0x','') + log.logIndex.replace('0x',''));\n        log.id = 'log_'+ shaId.replace('0x','').substr(0,8);\n    } else if(!log.id) {\n        log.id = null;\n    }\n\n    if (log.blockNumber !== null)\n        log.blockNumber = utils.hexToNumber(log.blockNumber);\n    if (log.transactionIndex !== null)\n        log.transactionIndex = utils.hexToNumber(log.transactionIndex);\n    if (log.logIndex !== null)\n        log.logIndex = utils.hexToNumber(log.logIndex);\n\n    if (log.address) {\n        log.address = utils.toChecksumAddress(log.address);\n    }\n\n    return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n    // post.payload = utils.toHex(post.payload);\n\n    if (post.ttl)\n        post.ttl = utils.numberToHex(post.ttl);\n    if (post.workToProve)\n        post.workToProve = utils.numberToHex(post.workToProve);\n    if (post.priority)\n        post.priority = utils.numberToHex(post.priority);\n\n    // fallback\n    if (!_.isArray(post.topics)) {\n        post.topics = post.topics ? [post.topics] : [];\n    }\n\n    // format the following options\n    post.topics = post.topics.map(function(topic){\n        // convert only if not hex\n        return (topic.indexOf('0x') === 0) ? topic : utils.fromUtf8(topic);\n    });\n\n    return post;\n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n    post.expiry = utils.hexToNumber(post.expiry);\n    post.sent = utils.hexToNumber(post.sent);\n    post.ttl = utils.hexToNumber(post.ttl);\n    post.workProved = utils.hexToNumber(post.workProved);\n    // post.payloadRaw = post.payload;\n    // post.payload = utils.hexToAscii(post.payload);\n\n    // if (utils.isJson(post.payload)) {\n    //     post.payload = JSON.parse(post.payload);\n    // }\n\n    // format the following options\n    if (!post.topics) {\n        post.topics = [];\n    }\n    post.topics = post.topics.map(function(topic){\n        return utils.toUtf8(topic);\n    });\n\n    return post;\n};\n\nvar inputAddressFormatter = function (address) {\n    var iban = new Iban(address);\n    if (iban.isValid() && iban.isDirect()) {\n        return iban.toAddress().toLowerCase();\n    } else if (utils.isAddress(address)) {\n        return '0x' + address.toLowerCase().replace('0x','');\n    }\n    throw new Error('Provided address \"'+ address +'\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can\\'t be converted.');\n};\n\n\nvar outputSyncingFormatter = function(result) {\n\n    result.startingBlock = utils.hexToNumber(result.startingBlock);\n    result.currentBlock = utils.hexToNumber(result.currentBlock);\n    result.highestBlock = utils.hexToNumber(result.highestBlock);\n    if (result.knownStates) {\n        result.knownStates = utils.hexToNumber(result.knownStates);\n        result.pulledStates = utils.hexToNumber(result.pulledStates);\n    }\n\n    return result;\n};\n\nmodule.exports = {\n    inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n    inputBlockNumberFormatter: inputBlockNumberFormatter,\n    inputCallFormatter: inputCallFormatter,\n    inputTransactionFormatter: inputTransactionFormatter,\n    inputAddressFormatter: inputAddressFormatter,\n    inputPostFormatter: inputPostFormatter,\n    inputLogFormatter: inputLogFormatter,\n    inputSignFormatter: inputSignFormatter,\n    outputBigNumberFormatter: outputBigNumberFormatter,\n    outputTransactionFormatter: outputTransactionFormatter,\n    outputTransactionReceiptFormatter: outputTransactionReceiptFormatter,\n    outputBlockFormatter: outputBlockFormatter,\n    outputLogFormatter: outputLogFormatter,\n    outputPostFormatter: outputPostFormatter,\n    outputSyncingFormatter: outputSyncingFormatter\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-helpers/src/formatters.js\n// module id = 1268\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-helpers/src/formatters.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2015 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.3.1\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function(e){if(true)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module \'"+o+"\'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar SomePromiseArray = Promise._SomePromiseArray;\nfunction any(promises) {\n    var ret = new SomePromiseArray(promises);\n    var promise = ret.promise();\n    ret.setHowMany(1);\n    ret.setUnwrap();\n    ret.init();\n    return promise;\n}\n\nPromise.any = function (promises) {\n    return any(promises);\n};\n\nPromise.prototype.any = function () {\n    return any(this);\n};\n\n};\n\n},{}],2:[function(_dereq_,module,exports){\n"use strict";\nvar firstLineError;\ntry {throw new Error(); } catch (e) {firstLineError = e;}\nvar schedule = _dereq_("./schedule");\nvar Queue = _dereq_("./queue");\nvar util = _dereq_("./util");\n\nfunction Async() {\n    this._isTickUsed = false;\n    this._lateQueue = new Queue(16);\n    this._normalQueue = new Queue(16);\n    this._haveDrainedQueues = false;\n    this._trampolineEnabled = true;\n    var self = this;\n    this.drainQueues = function () {\n        self._drainQueues();\n    };\n    this._schedule = schedule;\n}\n\nAsync.prototype.enableTrampoline = function() {\n    this._trampolineEnabled = true;\n};\n\nAsync.prototype.disableTrampolineIfNecessary = function() {\n    if (util.hasDevTools) {\n        this._trampolineEnabled = false;\n    }\n};\n\nAsync.prototype.haveItemsQueued = function () {\n    return this._isTickUsed || this._haveDrainedQueues;\n};\n\n\nAsync.prototype.fatalError = function(e, isNode) {\n    if (isNode) {\n        process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e));\n        process.exit(2);\n    } else {\n        this.throwLater(e);\n    }\n};\n\nAsync.prototype.throwLater = function(fn, arg) {\n    if (arguments.length === 1) {\n        arg = fn;\n        fn = function () { throw arg; };\n    }\n    if (typeof setTimeout !== "undefined") {\n        setTimeout(function() {\n            fn(arg);\n        }, 0);\n    } else try {\n        this._schedule(function() {\n            fn(arg);\n        });\n    } catch (e) {\n        throw new Error("No async scheduler available\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n};\n\nfunction AsyncInvokeLater(fn, receiver, arg) {\n    this._lateQueue.push(fn, receiver, arg);\n    this._queueTick();\n}\n\nfunction AsyncInvoke(fn, receiver, arg) {\n    this._normalQueue.push(fn, receiver, arg);\n    this._queueTick();\n}\n\nfunction AsyncSettlePromises(promise) {\n    this._normalQueue._pushOne(promise);\n    this._queueTick();\n}\n\nif (!util.hasDevTools) {\n    Async.prototype.invokeLater = AsyncInvokeLater;\n    Async.prototype.invoke = AsyncInvoke;\n    Async.prototype.settlePromises = AsyncSettlePromises;\n} else {\n    Async.prototype.invokeLater = function (fn, receiver, arg) {\n        if (this._trampolineEnabled) {\n            AsyncInvokeLater.call(this, fn, receiver, arg);\n        } else {\n            this._schedule(function() {\n                setTimeout(function() {\n                    fn.call(receiver, arg);\n                }, 100);\n            });\n        }\n    };\n\n    Async.prototype.invoke = function (fn, receiver, arg) {\n        if (this._trampolineEnabled) {\n            AsyncInvoke.call(this, fn, receiver, arg);\n        } else {\n            this._schedule(function() {\n                fn.call(receiver, arg);\n            });\n        }\n    };\n\n    Async.prototype.settlePromises = function(promise) {\n        if (this._trampolineEnabled) {\n            AsyncSettlePromises.call(this, promise);\n        } else {\n            this._schedule(function() {\n                promise._settlePromises();\n            });\n        }\n    };\n}\n\nAsync.prototype.invokeFirst = function (fn, receiver, arg) {\n    this._normalQueue.unshift(fn, receiver, arg);\n    this._queueTick();\n};\n\nAsync.prototype._drainQueue = function(queue) {\n    while (queue.length() > 0) {\n        var fn = queue.shift();\n        if (typeof fn !== "function") {\n            fn._settlePromises();\n            continue;\n        }\n        var receiver = queue.shift();\n        var arg = queue.shift();\n        fn.call(receiver, arg);\n    }\n};\n\nAsync.prototype._drainQueues = function () {\n    this._drainQueue(this._normalQueue);\n    this._reset();\n    this._haveDrainedQueues = true;\n    this._drainQueue(this._lateQueue);\n};\n\nAsync.prototype._queueTick = function () {\n    if (!this._isTickUsed) {\n        this._isTickUsed = true;\n        this._schedule(this.drainQueues);\n    }\n};\n\nAsync.prototype._reset = function () {\n    this._isTickUsed = false;\n};\n\nmodule.exports = Async;\nmodule.exports.firstLineError = firstLineError;\n\n},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\nvar calledBind = false;\nvar rejectThis = function(_, e) {\n    this._reject(e);\n};\n\nvar targetRejected = function(e, context) {\n    context.promiseRejectionQueued = true;\n    context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n};\n\nvar bindingResolved = function(thisArg, context) {\n    if (((this._bitField & 50397184) === 0)) {\n        this._resolveCallback(context.target);\n    }\n};\n\nvar bindingRejected = function(e, context) {\n    if (!context.promiseRejectionQueued) this._reject(e);\n};\n\nPromise.prototype.bind = function (thisArg) {\n    if (!calledBind) {\n        calledBind = true;\n        Promise.prototype._propagateFrom = debug.propagateFromFunction();\n        Promise.prototype._boundValue = debug.boundValueFunction();\n    }\n    var maybePromise = tryConvertToPromise(thisArg);\n    var ret = new Promise(INTERNAL);\n    ret._propagateFrom(this, 1);\n    var target = this._target();\n    ret._setBoundTo(maybePromise);\n    if (maybePromise instanceof Promise) {\n        var context = {\n            promiseRejectionQueued: false,\n            promise: ret,\n            target: target,\n            bindingPromise: maybePromise\n        };\n        target._then(INTERNAL, targetRejected, undefined, ret, context);\n        maybePromise._then(\n            bindingResolved, bindingRejected, undefined, ret, context);\n        ret._setOnCancel(maybePromise);\n    } else {\n        ret._resolveCallback(target);\n    }\n    return ret;\n};\n\nPromise.prototype._setBoundTo = function (obj) {\n    if (obj !== undefined) {\n        this._bitField = this._bitField | 2097152;\n        this._boundTo = obj;\n    } else {\n        this._bitField = this._bitField & (~2097152);\n    }\n};\n\nPromise.prototype._isBound = function () {\n    return (this._bitField & 2097152) === 2097152;\n};\n\nPromise.bind = function (thisArg, value) {\n    return Promise.resolve(value).bind(thisArg);\n};\n};\n\n},{}],4:[function(_dereq_,module,exports){\n"use strict";\nvar old;\nif (typeof Promise !== "undefined") old = Promise;\nfunction noConflict() {\n    try { if (Promise === bluebird) Promise = old; }\n    catch (e) {}\n    return bluebird;\n}\nvar bluebird = _dereq_("./promise")();\nbluebird.noConflict = noConflict;\nmodule.exports = bluebird;\n\n},{"./promise":22}],5:[function(_dereq_,module,exports){\n"use strict";\nvar cr = Object.create;\nif (cr) {\n    var callerCache = cr(null);\n    var getterCache = cr(null);\n    callerCache[" size"] = getterCache[" size"] = 0;\n}\n\nmodule.exports = function(Promise) {\nvar util = _dereq_("./util");\nvar canEvaluate = util.canEvaluate;\nvar isIdentifier = util.isIdentifier;\n\nvar getMethodCaller;\nvar getGetter;\nif (false) {\nvar makeMethodCaller = function (methodName) {\n    return new Function("ensureMethod", "                                    \\n\\\n        return function(obj) {                                               \\n\\\n            \'use strict\'                                                     \\n\\\n            var len = this.length;                                           \\n\\\n            ensureMethod(obj, \'methodName\');                                 \\n\\\n            switch(len) {                                                    \\n\\\n                case 1: return obj.methodName(this[0]);                      \\n\\\n                case 2: return obj.methodName(this[0], this[1]);             \\n\\\n                case 3: return obj.methodName(this[0], this[1], this[2]);    \\n\\\n                case 0: return obj.methodName();                             \\n\\\n                default:                                                     \\n\\\n                    return obj.methodName.apply(obj, this);                  \\n\\\n            }                                                                \\n\\\n        };                                                                   \\n\\\n        ".replace(/methodName/g, methodName))(ensureMethod);\n};\n\nvar makeGetter = function (propertyName) {\n    return new Function("obj", "                                             \\n\\\n        \'use strict\';                                                        \\n\\\n        return obj.propertyName;                                             \\n\\\n        ".replace("propertyName", propertyName));\n};\n\nvar getCompiled = function(name, compiler, cache) {\n    var ret = cache[name];\n    if (typeof ret !== "function") {\n        if (!isIdentifier(name)) {\n            return null;\n        }\n        ret = compiler(name);\n        cache[name] = ret;\n        cache[" size"]++;\n        if (cache[" size"] > 512) {\n            var keys = Object.keys(cache);\n            for (var i = 0; i < 256; ++i) delete cache[keys[i]];\n            cache[" size"] = keys.length - 256;\n        }\n    }\n    return ret;\n};\n\ngetMethodCaller = function(name) {\n    return getCompiled(name, makeMethodCaller, callerCache);\n};\n\ngetGetter = function(name) {\n    return getCompiled(name, makeGetter, getterCache);\n};\n}\n\nfunction ensureMethod(obj, methodName) {\n    var fn;\n    if (obj != null) fn = obj[methodName];\n    if (typeof fn !== "function") {\n        var message = "Object " + util.classString(obj) + " has no method \'" +\n            util.toString(methodName) + "\'";\n        throw new Promise.TypeError(message);\n    }\n    return fn;\n}\n\nfunction caller(obj) {\n    var methodName = this.pop();\n    var fn = ensureMethod(obj, methodName);\n    return fn.apply(obj, this);\n}\nPromise.prototype.call = function (methodName) {\n    var args = [].slice.call(arguments, 1);;\n    if (false) {\n        if (canEvaluate) {\n            var maybeCaller = getMethodCaller(methodName);\n            if (maybeCaller !== null) {\n                return this._then(\n                    maybeCaller, undefined, undefined, args, undefined);\n            }\n        }\n    }\n    args.push(methodName);\n    return this._then(caller, undefined, undefined, args, undefined);\n};\n\nfunction namedGetter(obj) {\n    return obj[this];\n}\nfunction indexedGetter(obj) {\n    var index = +this;\n    if (index < 0) index = Math.max(0, index + obj.length);\n    return obj[index];\n}\nPromise.prototype.get = function (propertyName) {\n    var isIndex = (typeof propertyName === "number");\n    var getter;\n    if (!isIndex) {\n        if (canEvaluate) {\n            var maybeGetter = getGetter(propertyName);\n            getter = maybeGetter !== null ? maybeGetter : namedGetter;\n        } else {\n            getter = namedGetter;\n        }\n    } else {\n        getter = indexedGetter;\n    }\n    return this._then(getter, undefined, undefined, propertyName, undefined);\n};\n};\n\n},{"./util":36}],6:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nPromise.prototype["break"] = Promise.prototype.cancel = function() {\n    if (!debug.cancellation()) return this._warn("cancellation is disabled");\n\n    var promise = this;\n    var child = promise;\n    while (promise.isCancellable()) {\n        if (!promise._cancelBy(child)) {\n            if (child._isFollowing()) {\n                child._followee().cancel();\n            } else {\n                child._cancelBranched();\n            }\n            break;\n        }\n\n        var parent = promise._cancellationParent;\n        if (parent == null || !parent.isCancellable()) {\n            if (promise._isFollowing()) {\n                promise._followee().cancel();\n            } else {\n                promise._cancelBranched();\n            }\n            break;\n        } else {\n            if (promise._isFollowing()) promise._followee().cancel();\n            child = promise;\n            promise = parent;\n        }\n    }\n};\n\nPromise.prototype._branchHasCancelled = function() {\n    this._branchesRemainingToCancel--;\n};\n\nPromise.prototype._enoughBranchesHaveCancelled = function() {\n    return this._branchesRemainingToCancel === undefined ||\n           this._branchesRemainingToCancel <= 0;\n};\n\nPromise.prototype._cancelBy = function(canceller) {\n    if (canceller === this) {\n        this._branchesRemainingToCancel = 0;\n        this._invokeOnCancel();\n        return true;\n    } else {\n        this._branchHasCancelled();\n        if (this._enoughBranchesHaveCancelled()) {\n            this._invokeOnCancel();\n            return true;\n        }\n    }\n    return false;\n};\n\nPromise.prototype._cancelBranched = function() {\n    if (this._enoughBranchesHaveCancelled()) {\n        this._cancel();\n    }\n};\n\nPromise.prototype._cancel = function() {\n    if (!this.isCancellable()) return;\n\n    this._setCancelled();\n    async.invoke(this._cancelPromises, this, undefined);\n};\n\nPromise.prototype._cancelPromises = function() {\n    if (this._length() > 0) this._settlePromises();\n};\n\nPromise.prototype._unsetOnCancel = function() {\n    this._onCancelField = undefined;\n};\n\nPromise.prototype.isCancellable = function() {\n    return this.isPending() && !this.isCancelled();\n};\n\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\n    if (util.isArray(onCancelCallback)) {\n        for (var i = 0; i < onCancelCallback.length; ++i) {\n            this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n        }\n    } else if (onCancelCallback !== undefined) {\n        if (typeof onCancelCallback === "function") {\n            if (!internalOnly) {\n                var e = tryCatch(onCancelCallback).call(this._boundValue());\n                if (e === errorObj) {\n                    this._attachExtraTrace(e.e);\n                    async.throwLater(e.e);\n                }\n            }\n        } else {\n            onCancelCallback._resultCancelled(this);\n        }\n    }\n};\n\nPromise.prototype._invokeOnCancel = function() {\n    var onCancelCallback = this._onCancel();\n    this._unsetOnCancel();\n    async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n};\n\nPromise.prototype._invokeInternalOnCancel = function() {\n    if (this.isCancellable()) {\n        this._doInvokeOnCancel(this._onCancel(), true);\n        this._unsetOnCancel();\n    }\n};\n\nPromise.prototype._resultCancelled = function() {\n    this.cancel();\n};\n\n};\n\n},{"./util":36}],7:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(NEXT_FILTER) {\nvar util = _dereq_("./util");\nvar getKeys = _dereq_("./es5").keys;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction catchFilter(instances, cb, promise) {\n    return function(e) {\n        var boundTo = promise._boundValue();\n        predicateLoop: for (var i = 0; i < instances.length; ++i) {\n            var item = instances[i];\n\n            if (item === Error ||\n                (item != null && item.prototype instanceof Error)) {\n                if (e instanceof item) {\n                    return tryCatch(cb).call(boundTo, e);\n                }\n            } else if (typeof item === "function") {\n                var matchesPredicate = tryCatch(item).call(boundTo, e);\n                if (matchesPredicate === errorObj) {\n                    return matchesPredicate;\n                } else if (matchesPredicate) {\n                    return tryCatch(cb).call(boundTo, e);\n                }\n            } else if (util.isObject(e)) {\n                var keys = getKeys(item);\n                for (var j = 0; j < keys.length; ++j) {\n                    var key = keys[j];\n                    if (item[key] != e[key]) {\n                        continue predicateLoop;\n                    }\n                }\n                return tryCatch(cb).call(boundTo, e);\n            }\n        }\n        return NEXT_FILTER;\n    };\n}\n\nreturn catchFilter;\n};\n\n},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar longStackTraces = false;\nvar contextStack = [];\n\nPromise.prototype._promiseCreated = function() {};\nPromise.prototype._pushContext = function() {};\nPromise.prototype._popContext = function() {return null;};\nPromise._peekContext = Promise.prototype._peekContext = function() {};\n\nfunction Context() {\n    this._trace = new Context.CapturedTrace(peekContext());\n}\nContext.prototype._pushContext = function () {\n    if (this._trace !== undefined) {\n        this._trace._promiseCreated = null;\n        contextStack.push(this._trace);\n    }\n};\n\nContext.prototype._popContext = function () {\n    if (this._trace !== undefined) {\n        var trace = contextStack.pop();\n        var ret = trace._promiseCreated;\n        trace._promiseCreated = null;\n        return ret;\n    }\n    return null;\n};\n\nfunction createContext() {\n    if (longStackTraces) return new Context();\n}\n\nfunction peekContext() {\n    var lastIndex = contextStack.length - 1;\n    if (lastIndex >= 0) {\n        return contextStack[lastIndex];\n    }\n    return undefined;\n}\nContext.CapturedTrace = null;\nContext.create = createContext;\nContext.deactivateLongStackTraces = function() {};\nContext.activateLongStackTraces = function() {\n    var Promise_pushContext = Promise.prototype._pushContext;\n    var Promise_popContext = Promise.prototype._popContext;\n    var Promise_PeekContext = Promise._peekContext;\n    var Promise_peekContext = Promise.prototype._peekContext;\n    var Promise_promiseCreated = Promise.prototype._promiseCreated;\n    Context.deactivateLongStackTraces = function() {\n        Promise.prototype._pushContext = Promise_pushContext;\n        Promise.prototype._popContext = Promise_popContext;\n        Promise._peekContext = Promise_PeekContext;\n        Promise.prototype._peekContext = Promise_peekContext;\n        Promise.prototype._promiseCreated = Promise_promiseCreated;\n        longStackTraces = false;\n    };\n    longStackTraces = true;\n    Promise.prototype._pushContext = Context.prototype._pushContext;\n    Promise.prototype._popContext = Context.prototype._popContext;\n    Promise._peekContext = Promise.prototype._peekContext = peekContext;\n    Promise.prototype._promiseCreated = function() {\n        var ctx = this._peekContext();\n        if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n    };\n};\nreturn Context;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, Context) {\nvar getDomain = Promise._getDomain;\nvar async = Promise._async;\nvar Warning = _dereq_("./errors").Warning;\nvar util = _dereq_("./util");\nvar canAttachTrace = util.canAttachTrace;\nvar unhandledRejectionHandled;\nvar possiblyUnhandledRejection;\nvar bluebirdFramePattern =\n    /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\nvar stackFramePattern = null;\nvar formatStack = null;\nvar indentStackFrames = false;\nvar printWarning;\nvar debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 &&\n                        (true ||\n                         util.env("BLUEBIRD_DEBUG") ||\n                         util.env("NODE_ENV") === "development"));\n\nvar warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 &&\n    (debugging || util.env("BLUEBIRD_WARNINGS")));\n\nvar longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 &&\n    (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));\n\nvar wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 &&\n    (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));\n\nPromise.prototype.suppressUnhandledRejections = function() {\n    var target = this._target();\n    target._bitField = ((target._bitField & (~1048576)) |\n                      524288);\n};\n\nPromise.prototype._ensurePossibleRejectionHandled = function () {\n    if ((this._bitField & 524288) !== 0) return;\n    this._setRejectionIsUnhandled();\n    async.invokeLater(this._notifyUnhandledRejection, this, undefined);\n};\n\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\n    fireRejectionEvent("rejectionHandled",\n                                  unhandledRejectionHandled, undefined, this);\n};\n\nPromise.prototype._setReturnedNonUndefined = function() {\n    this._bitField = this._bitField | 268435456;\n};\n\nPromise.prototype._returnedNonUndefined = function() {\n    return (this._bitField & 268435456) !== 0;\n};\n\nPromise.prototype._notifyUnhandledRejection = function () {\n    if (this._isRejectionUnhandled()) {\n        var reason = this._settledValue();\n        this._setUnhandledRejectionIsNotified();\n        fireRejectionEvent("unhandledRejection",\n                                      possiblyUnhandledRejection, reason, this);\n    }\n};\n\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\n    this._bitField = this._bitField | 262144;\n};\n\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\n    this._bitField = this._bitField & (~262144);\n};\n\nPromise.prototype._isUnhandledRejectionNotified = function () {\n    return (this._bitField & 262144) > 0;\n};\n\nPromise.prototype._setRejectionIsUnhandled = function () {\n    this._bitField = this._bitField | 1048576;\n};\n\nPromise.prototype._unsetRejectionIsUnhandled = function () {\n    this._bitField = this._bitField & (~1048576);\n    if (this._isUnhandledRejectionNotified()) {\n        this._unsetUnhandledRejectionIsNotified();\n        this._notifyUnhandledRejectionIsHandled();\n    }\n};\n\nPromise.prototype._isRejectionUnhandled = function () {\n    return (this._bitField & 1048576) > 0;\n};\n\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\n    return warn(message, shouldUseOwnTrace, promise || this);\n};\n\nPromise.onPossiblyUnhandledRejection = function (fn) {\n    var domain = getDomain();\n    possiblyUnhandledRejection =\n        typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))\n                                 : undefined;\n};\n\nPromise.onUnhandledRejectionHandled = function (fn) {\n    var domain = getDomain();\n    unhandledRejectionHandled =\n        typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))\n                                 : undefined;\n};\n\nvar disableLongStackTraces = function() {};\nPromise.longStackTraces = function () {\n    if (async.haveItemsQueued() && !config.longStackTraces) {\n        throw new Error("cannot enable long stack traces after promises have been created\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    if (!config.longStackTraces && longStackTracesIsSupported()) {\n        var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n        var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n        config.longStackTraces = true;\n        disableLongStackTraces = function() {\n            if (async.haveItemsQueued() && !config.longStackTraces) {\n                throw new Error("cannot enable long stack traces after promises have been created\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n            }\n            Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n            Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n            Context.deactivateLongStackTraces();\n            async.enableTrampoline();\n            config.longStackTraces = false;\n        };\n        Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n        Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n        Context.activateLongStackTraces();\n        async.disableTrampolineIfNecessary();\n    }\n};\n\nPromise.hasLongStackTraces = function () {\n    return config.longStackTraces && longStackTracesIsSupported();\n};\n\nvar fireDomEvent = (function() {\n    try {\n        var event = document.createEvent("CustomEvent");\n        event.initCustomEvent("testingtheevent", false, true, {});\n        util.global.dispatchEvent(event);\n        return function(name, event) {\n            var domEvent = document.createEvent("CustomEvent");\n            domEvent.initCustomEvent(name.toLowerCase(), false, true, event);\n            return !util.global.dispatchEvent(domEvent);\n        };\n    } catch (e) {}\n    return function() {\n        return false;\n    };\n})();\n\nvar fireGlobalEvent = (function() {\n    if (util.isNode) {\n        return function() {\n            return process.emit.apply(process, arguments);\n        };\n    } else {\n        if (!util.global) {\n            return function() {\n                return false;\n            };\n        }\n        return function(name) {\n            var methodName = "on" + name.toLowerCase();\n            var method = util.global[methodName];\n            if (!method) return false;\n            method.apply(util.global, [].slice.call(arguments, 1));\n            return true;\n        };\n    }\n})();\n\nfunction generatePromiseLifecycleEventObject(name, promise) {\n    return {promise: promise};\n}\n\nvar eventToObjectGenerator = {\n    promiseCreated: generatePromiseLifecycleEventObject,\n    promiseFulfilled: generatePromiseLifecycleEventObject,\n    promiseRejected: generatePromiseLifecycleEventObject,\n    promiseResolved: generatePromiseLifecycleEventObject,\n    promiseCancelled: generatePromiseLifecycleEventObject,\n    promiseChained: function(name, promise, child) {\n        return {promise: promise, child: child};\n    },\n    warning: function(name, warning) {\n        return {warning: warning};\n    },\n    unhandledRejection: function (name, reason, promise) {\n        return {reason: reason, promise: promise};\n    },\n    rejectionHandled: generatePromiseLifecycleEventObject\n};\n\nvar activeFireEvent = function (name) {\n    var globalEventFired = false;\n    try {\n        globalEventFired = fireGlobalEvent.apply(null, arguments);\n    } catch (e) {\n        async.throwLater(e);\n        globalEventFired = true;\n    }\n\n    var domEventFired = false;\n    try {\n        domEventFired = fireDomEvent(name,\n                    eventToObjectGenerator[name].apply(null, arguments));\n    } catch (e) {\n        async.throwLater(e);\n        domEventFired = true;\n    }\n\n    return domEventFired || globalEventFired;\n};\n\nPromise.config = function(opts) {\n    opts = Object(opts);\n    if ("longStackTraces" in opts) {\n        if (opts.longStackTraces) {\n            Promise.longStackTraces();\n        } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n            disableLongStackTraces();\n        }\n    }\n    if ("warnings" in opts) {\n        var warningsOption = opts.warnings;\n        config.warnings = !!warningsOption;\n        wForgottenReturn = config.warnings;\n\n        if (util.isObject(warningsOption)) {\n            if ("wForgottenReturn" in warningsOption) {\n                wForgottenReturn = !!warningsOption.wForgottenReturn;\n            }\n        }\n    }\n    if ("cancellation" in opts && opts.cancellation && !config.cancellation) {\n        if (async.haveItemsQueued()) {\n            throw new Error(\n                "cannot enable cancellation after promises are in use");\n        }\n        Promise.prototype._clearCancellationData =\n            cancellationClearCancellationData;\n        Promise.prototype._propagateFrom = cancellationPropagateFrom;\n        Promise.prototype._onCancel = cancellationOnCancel;\n        Promise.prototype._setOnCancel = cancellationSetOnCancel;\n        Promise.prototype._attachCancellationCallback =\n            cancellationAttachCancellationCallback;\n        Promise.prototype._execute = cancellationExecute;\n        propagateFromFunction = cancellationPropagateFrom;\n        config.cancellation = true;\n    }\n    if ("monitoring" in opts) {\n        if (opts.monitoring && !config.monitoring) {\n            config.monitoring = true;\n            Promise.prototype._fireEvent = activeFireEvent;\n        } else if (!opts.monitoring && config.monitoring) {\n            config.monitoring = false;\n            Promise.prototype._fireEvent = defaultFireEvent;\n        }\n    }\n};\n\nfunction defaultFireEvent() { return false; }\n\nPromise.prototype._fireEvent = defaultFireEvent;\nPromise.prototype._execute = function(executor, resolve, reject) {\n    try {\n        executor(resolve, reject);\n    } catch (e) {\n        return e;\n    }\n};\nPromise.prototype._onCancel = function () {};\nPromise.prototype._setOnCancel = function (handler) { ; };\nPromise.prototype._attachCancellationCallback = function(onCancel) {\n    ;\n};\nPromise.prototype._captureStackTrace = function () {};\nPromise.prototype._attachExtraTrace = function () {};\nPromise.prototype._clearCancellationData = function() {};\nPromise.prototype._propagateFrom = function (parent, flags) {\n    ;\n    ;\n};\n\nfunction cancellationExecute(executor, resolve, reject) {\n    var promise = this;\n    try {\n        executor(resolve, reject, function(onCancel) {\n            if (typeof onCancel !== "function") {\n                throw new TypeError("onCancel must be a function, got: " +\n                                    util.toString(onCancel));\n            }\n            promise._attachCancellationCallback(onCancel);\n        });\n    } catch (e) {\n        return e;\n    }\n}\n\nfunction cancellationAttachCancellationCallback(onCancel) {\n    if (!this.isCancellable()) return this;\n\n    var previousOnCancel = this._onCancel();\n    if (previousOnCancel !== undefined) {\n        if (util.isArray(previousOnCancel)) {\n            previousOnCancel.push(onCancel);\n        } else {\n            this._setOnCancel([previousOnCancel, onCancel]);\n        }\n    } else {\n        this._setOnCancel(onCancel);\n    }\n}\n\nfunction cancellationOnCancel() {\n    return this._onCancelField;\n}\n\nfunction cancellationSetOnCancel(onCancel) {\n    this._onCancelField = onCancel;\n}\n\nfunction cancellationClearCancellationData() {\n    this._cancellationParent = undefined;\n    this._onCancelField = undefined;\n}\n\nfunction cancellationPropagateFrom(parent, flags) {\n    if ((flags & 1) !== 0) {\n        this._cancellationParent = parent;\n        var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n        if (branchesRemainingToCancel === undefined) {\n            branchesRemainingToCancel = 0;\n        }\n        parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n    }\n    if ((flags & 2) !== 0 && parent._isBound()) {\n        this._setBoundTo(parent._boundTo);\n    }\n}\n\nfunction bindingPropagateFrom(parent, flags) {\n    if ((flags & 2) !== 0 && parent._isBound()) {\n        this._setBoundTo(parent._boundTo);\n    }\n}\nvar propagateFromFunction = bindingPropagateFrom;\n\nfunction boundValueFunction() {\n    var ret = this._boundTo;\n    if (ret !== undefined) {\n        if (ret instanceof Promise) {\n            if (ret.isFulfilled()) {\n                return ret.value();\n            } else {\n                return undefined;\n            }\n        }\n    }\n    return ret;\n}\n\nfunction longStackTracesCaptureStackTrace() {\n    this._trace = new CapturedTrace(this._peekContext());\n}\n\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\n    if (canAttachTrace(error)) {\n        var trace = this._trace;\n        if (trace !== undefined) {\n            if (ignoreSelf) trace = trace._parent;\n        }\n        if (trace !== undefined) {\n            trace.attachExtraTrace(error);\n        } else if (!error.__stackCleaned__) {\n            var parsed = parseStackAndMessage(error);\n            util.notEnumerableProp(error, "stack",\n                parsed.message + "\\n" + parsed.stack.join("\\n"));\n            util.notEnumerableProp(error, "__stackCleaned__", true);\n        }\n    }\n}\n\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\n                               parent) {\n    if (returnValue === undefined && promiseCreated !== null &&\n        wForgottenReturn) {\n        if (parent !== undefined && parent._returnedNonUndefined()) return;\n\n        if (name) name = name + " ";\n        var msg = "a promise was created in a " + name +\n            "handler but was not returned from it";\n        promise._warn(msg, true, promiseCreated);\n    }\n}\n\nfunction deprecated(name, replacement) {\n    var message = name +\n        " is deprecated and will be removed in a future version.";\n    if (replacement) message += " Use " + replacement + " instead.";\n    return warn(message);\n}\n\nfunction warn(message, shouldUseOwnTrace, promise) {\n    if (!config.warnings) return;\n    var warning = new Warning(message);\n    var ctx;\n    if (shouldUseOwnTrace) {\n        promise._attachExtraTrace(warning);\n    } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n        ctx.attachExtraTrace(warning);\n    } else {\n        var parsed = parseStackAndMessage(warning);\n        warning.stack = parsed.message + "\\n" + parsed.stack.join("\\n");\n    }\n\n    if (!activeFireEvent("warning", warning)) {\n        formatAndLogError(warning, "", true);\n    }\n}\n\nfunction reconstructStack(message, stacks) {\n    for (var i = 0; i < stacks.length - 1; ++i) {\n        stacks[i].push("From previous event:");\n        stacks[i] = stacks[i].join("\\n");\n    }\n    if (i < stacks.length) {\n        stacks[i] = stacks[i].join("\\n");\n    }\n    return message + "\\n" + stacks.join("\\n");\n}\n\nfunction removeDuplicateOrEmptyJumps(stacks) {\n    for (var i = 0; i < stacks.length; ++i) {\n        if (stacks[i].length === 0 ||\n            ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\n            stacks.splice(i, 1);\n            i--;\n        }\n    }\n}\n\nfunction removeCommonRoots(stacks) {\n    var current = stacks[0];\n    for (var i = 1; i < stacks.length; ++i) {\n        var prev = stacks[i];\n        var currentLastIndex = current.length - 1;\n        var currentLastLine = current[currentLastIndex];\n        var commonRootMeetPoint = -1;\n\n        for (var j = prev.length - 1; j >= 0; --j) {\n            if (prev[j] === currentLastLine) {\n                commonRootMeetPoint = j;\n                break;\n            }\n        }\n\n        for (var j = commonRootMeetPoint; j >= 0; --j) {\n            var line = prev[j];\n            if (current[currentLastIndex] === line) {\n                current.pop();\n                currentLastIndex--;\n            } else {\n                break;\n            }\n        }\n        current = prev;\n    }\n}\n\nfunction cleanStack(stack) {\n    var ret = [];\n    for (var i = 0; i < stack.length; ++i) {\n        var line = stack[i];\n        var isTraceLine = "    (No stack trace)" === line ||\n            stackFramePattern.test(line);\n        var isInternalFrame = isTraceLine && shouldIgnore(line);\n        if (isTraceLine && !isInternalFrame) {\n            if (indentStackFrames && line.charAt(0) !== " ") {\n                line = "    " + line;\n            }\n            ret.push(line);\n        }\n    }\n    return ret;\n}\n\nfunction stackFramesAsArray(error) {\n    var stack = error.stack.replace(/\\s+$/g, "").split("\\n");\n    for (var i = 0; i < stack.length; ++i) {\n        var line = stack[i];\n        if ("    (No stack trace)" === line || stackFramePattern.test(line)) {\n            break;\n        }\n    }\n    if (i > 0) {\n        stack = stack.slice(i);\n    }\n    return stack;\n}\n\nfunction parseStackAndMessage(error) {\n    var stack = error.stack;\n    var message = error.toString();\n    stack = typeof stack === "string" && stack.length > 0\n                ? stackFramesAsArray(error) : ["    (No stack trace)"];\n    return {\n        message: message,\n        stack: cleanStack(stack)\n    };\n}\n\nfunction formatAndLogError(error, title, isSoft) {\n    if (typeof console !== "undefined") {\n        var message;\n        if (util.isObject(error)) {\n            var stack = error.stack;\n            message = title + formatStack(stack, error);\n        } else {\n            message = title + String(error);\n        }\n        if (typeof printWarning === "function") {\n            printWarning(message, isSoft);\n        } else if (typeof console.log === "function" ||\n            typeof console.log === "object") {\n            console.log(message);\n        }\n    }\n}\n\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\n    var localEventFired = false;\n    try {\n        if (typeof localHandler === "function") {\n            localEventFired = true;\n            if (name === "rejectionHandled") {\n                localHandler(promise);\n            } else {\n                localHandler(reason, promise);\n            }\n        }\n    } catch (e) {\n        async.throwLater(e);\n    }\n\n    if (name === "unhandledRejection") {\n        if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n            formatAndLogError(reason, "Unhandled rejection ");\n        }\n    } else {\n        activeFireEvent(name, promise);\n    }\n}\n\nfunction formatNonError(obj) {\n    var str;\n    if (typeof obj === "function") {\n        str = "[function " +\n            (obj.name || "anonymous") +\n            "]";\n    } else {\n        str = obj && typeof obj.toString === "function"\n            ? obj.toString() : util.toString(obj);\n        var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n        if (ruselessToString.test(str)) {\n            try {\n                var newStr = JSON.stringify(obj);\n                str = newStr;\n            }\n            catch(e) {\n\n            }\n        }\n        if (str.length === 0) {\n            str = "(empty array)";\n        }\n    }\n    return ("(<" + snip(str) + ">, no stack trace)");\n}\n\nfunction snip(str) {\n    var maxChars = 41;\n    if (str.length < maxChars) {\n        return str;\n    }\n    return str.substr(0, maxChars - 3) + "...";\n}\n\nfunction longStackTracesIsSupported() {\n    return typeof captureStackTrace === "function";\n}\n\nvar shouldIgnore = function() { return false; };\nvar parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\nfunction parseLineInfo(line) {\n    var matches = line.match(parseLineInfoRegex);\n    if (matches) {\n        return {\n            fileName: matches[1],\n            line: parseInt(matches[2], 10)\n        };\n    }\n}\n\nfunction setBounds(firstLineError, lastLineError) {\n    if (!longStackTracesIsSupported()) return;\n    var firstStackLines = firstLineError.stack.split("\\n");\n    var lastStackLines = lastLineError.stack.split("\\n");\n    var firstIndex = -1;\n    var lastIndex = -1;\n    var firstFileName;\n    var lastFileName;\n    for (var i = 0; i < firstStackLines.length; ++i) {\n        var result = parseLineInfo(firstStackLines[i]);\n        if (result) {\n            firstFileName = result.fileName;\n            firstIndex = result.line;\n            break;\n        }\n    }\n    for (var i = 0; i < lastStackLines.length; ++i) {\n        var result = parseLineInfo(lastStackLines[i]);\n        if (result) {\n            lastFileName = result.fileName;\n            lastIndex = result.line;\n            break;\n        }\n    }\n    if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\n        firstFileName !== lastFileName || firstIndex >= lastIndex) {\n        return;\n    }\n\n    shouldIgnore = function(line) {\n        if (bluebirdFramePattern.test(line)) return true;\n        var info = parseLineInfo(line);\n        if (info) {\n            if (info.fileName === firstFileName &&\n                (firstIndex <= info.line && info.line <= lastIndex)) {\n                return true;\n            }\n        }\n        return false;\n    };\n}\n\nfunction CapturedTrace(parent) {\n    this._parent = parent;\n    this._promisesCreated = 0;\n    var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n    captureStackTrace(this, CapturedTrace);\n    if (length > 32) this.uncycle();\n}\nutil.inherits(CapturedTrace, Error);\nContext.CapturedTrace = CapturedTrace;\n\nCapturedTrace.prototype.uncycle = function() {\n    var length = this._length;\n    if (length < 2) return;\n    var nodes = [];\n    var stackToIndex = {};\n\n    for (var i = 0, node = this; node !== undefined; ++i) {\n        nodes.push(node);\n        node = node._parent;\n    }\n    length = this._length = i;\n    for (var i = length - 1; i >= 0; --i) {\n        var stack = nodes[i].stack;\n        if (stackToIndex[stack] === undefined) {\n            stackToIndex[stack] = i;\n        }\n    }\n    for (var i = 0; i < length; ++i) {\n        var currentStack = nodes[i].stack;\n        var index = stackToIndex[currentStack];\n        if (index !== undefined && index !== i) {\n            if (index > 0) {\n                nodes[index - 1]._parent = undefined;\n                nodes[index - 1]._length = 1;\n            }\n            nodes[i]._parent = undefined;\n            nodes[i]._length = 1;\n            var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n\n            if (index < length - 1) {\n                cycleEdgeNode._parent = nodes[index + 1];\n                cycleEdgeNode._parent.uncycle();\n                cycleEdgeNode._length =\n                    cycleEdgeNode._parent._length + 1;\n            } else {\n                cycleEdgeNode._parent = undefined;\n                cycleEdgeNode._length = 1;\n            }\n            var currentChildLength = cycleEdgeNode._length + 1;\n            for (var j = i - 2; j >= 0; --j) {\n                nodes[j]._length = currentChildLength;\n                currentChildLength++;\n            }\n            return;\n        }\n    }\n};\n\nCapturedTrace.prototype.attachExtraTrace = function(error) {\n    if (error.__stackCleaned__) return;\n    this.uncycle();\n    var parsed = parseStackAndMessage(error);\n    var message = parsed.message;\n    var stacks = [parsed.stack];\n\n    var trace = this;\n    while (trace !== undefined) {\n        stacks.push(cleanStack(trace.stack.split("\\n")));\n        trace = trace._parent;\n    }\n    removeCommonRoots(stacks);\n    removeDuplicateOrEmptyJumps(stacks);\n    util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));\n    util.notEnumerableProp(error, "__stackCleaned__", true);\n};\n\nvar captureStackTrace = (function stackDetection() {\n    var v8stackFramePattern = /^\\s*at\\s*/;\n    var v8stackFormatter = function(stack, error) {\n        if (typeof stack === "string") return stack;\n\n        if (error.name !== undefined &&\n            error.message !== undefined) {\n            return error.toString();\n        }\n        return formatNonError(error);\n    };\n\n    if (typeof Error.stackTraceLimit === "number" &&\n        typeof Error.captureStackTrace === "function") {\n        Error.stackTraceLimit += 6;\n        stackFramePattern = v8stackFramePattern;\n        formatStack = v8stackFormatter;\n        var captureStackTrace = Error.captureStackTrace;\n\n        shouldIgnore = function(line) {\n            return bluebirdFramePattern.test(line);\n        };\n        return function(receiver, ignoreUntil) {\n            Error.stackTraceLimit += 6;\n            captureStackTrace(receiver, ignoreUntil);\n            Error.stackTraceLimit -= 6;\n        };\n    }\n    var err = new Error();\n\n    if (typeof err.stack === "string" &&\n        err.stack.split("\\n")[0].indexOf("stackDetection@") >= 0) {\n        stackFramePattern = /@/;\n        formatStack = v8stackFormatter;\n        indentStackFrames = true;\n        return function captureStackTrace(o) {\n            o.stack = new Error().stack;\n        };\n    }\n\n    var hasStackAfterThrow;\n    try { throw new Error(); }\n    catch(e) {\n        hasStackAfterThrow = ("stack" in e);\n    }\n    if (!("stack" in err) && hasStackAfterThrow &&\n        typeof Error.stackTraceLimit === "number") {\n        stackFramePattern = v8stackFramePattern;\n        formatStack = v8stackFormatter;\n        return function captureStackTrace(o) {\n            Error.stackTraceLimit += 6;\n            try { throw new Error(); }\n            catch(e) { o.stack = e.stack; }\n            Error.stackTraceLimit -= 6;\n        };\n    }\n\n    formatStack = function(stack, error) {\n        if (typeof stack === "string") return stack;\n\n        if ((typeof error === "object" ||\n            typeof error === "function") &&\n            error.name !== undefined &&\n            error.message !== undefined) {\n            return error.toString();\n        }\n        return formatNonError(error);\n    };\n\n    return null;\n\n})([]);\n\nif (typeof console !== "undefined" && typeof console.warn !== "undefined") {\n    printWarning = function (message) {\n        console.warn(message);\n    };\n    if (util.isNode && process.stderr.isTTY) {\n        printWarning = function(message, isSoft) {\n            var color = isSoft ? "\\u001b[33m" : "\\u001b[31m";\n            console.warn(color + message + "\\u001b[0m\\n");\n        };\n    } else if (!util.isNode && typeof (new Error().stack) === "string") {\n        printWarning = function(message, isSoft) {\n            console.warn("%c" + message,\n                        isSoft ? "color: darkorange" : "color: red");\n        };\n    }\n}\n\nvar config = {\n    warnings: warnings,\n    longStackTraces: false,\n    cancellation: false,\n    monitoring: false\n};\n\nif (longStackTraces) Promise.longStackTraces();\n\nreturn {\n    longStackTraces: function() {\n        return config.longStackTraces;\n    },\n    warnings: function() {\n        return config.warnings;\n    },\n    cancellation: function() {\n        return config.cancellation;\n    },\n    monitoring: function() {\n        return config.monitoring;\n    },\n    propagateFromFunction: function() {\n        return propagateFromFunction;\n    },\n    boundValueFunction: function() {\n        return boundValueFunction;\n    },\n    checkForgottenReturns: checkForgottenReturns,\n    setBounds: setBounds,\n    warn: warn,\n    deprecated: deprecated,\n    CapturedTrace: CapturedTrace,\n    fireDomEvent: fireDomEvent,\n    fireGlobalEvent: fireGlobalEvent\n};\n};\n\n},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nfunction returner() {\n    return this.value;\n}\nfunction thrower() {\n    throw this.reason;\n}\n\nPromise.prototype["return"] =\nPromise.prototype.thenReturn = function (value) {\n    if (value instanceof Promise) value.suppressUnhandledRejections();\n    return this._then(\n        returner, undefined, undefined, {value: value}, undefined);\n};\n\nPromise.prototype["throw"] =\nPromise.prototype.thenThrow = function (reason) {\n    return this._then(\n        thrower, undefined, undefined, {reason: reason}, undefined);\n};\n\nPromise.prototype.catchThrow = function (reason) {\n    if (arguments.length <= 1) {\n        return this._then(\n            undefined, thrower, undefined, {reason: reason}, undefined);\n    } else {\n        var _reason = arguments[1];\n        var handler = function() {throw _reason;};\n        return this.caught(reason, handler);\n    }\n};\n\nPromise.prototype.catchReturn = function (value) {\n    if (arguments.length <= 1) {\n        if (value instanceof Promise) value.suppressUnhandledRejections();\n        return this._then(\n            undefined, returner, undefined, {value: value}, undefined);\n    } else {\n        var _value = arguments[1];\n        if (_value instanceof Promise) _value.suppressUnhandledRejections();\n        var handler = function() {return _value;};\n        return this.caught(value, handler);\n    }\n};\n};\n\n},{}],11:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseReduce = Promise.reduce;\nvar PromiseAll = Promise.all;\n\nfunction promiseAllThis() {\n    return PromiseAll(this);\n}\n\nfunction PromiseMapSeries(promises, fn) {\n    return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\n}\n\nPromise.prototype.each = function (fn) {\n    return this.mapSeries(fn)\n            ._then(promiseAllThis, undefined, undefined, this, undefined);\n};\n\nPromise.prototype.mapSeries = function (fn) {\n    return PromiseReduce(this, fn, INTERNAL, INTERNAL);\n};\n\nPromise.each = function (promises, fn) {\n    return PromiseMapSeries(promises, fn)\n            ._then(promiseAllThis, undefined, undefined, promises, undefined);\n};\n\nPromise.mapSeries = PromiseMapSeries;\n};\n\n},{}],12:[function(_dereq_,module,exports){\n"use strict";\nvar es5 = _dereq_("./es5");\nvar Objectfreeze = es5.freeze;\nvar util = _dereq_("./util");\nvar inherits = util.inherits;\nvar notEnumerableProp = util.notEnumerableProp;\n\nfunction subError(nameProperty, defaultMessage) {\n    function SubError(message) {\n        if (!(this instanceof SubError)) return new SubError(message);\n        notEnumerableProp(this, "message",\n            typeof message === "string" ? message : defaultMessage);\n        notEnumerableProp(this, "name", nameProperty);\n        if (Error.captureStackTrace) {\n            Error.captureStackTrace(this, this.constructor);\n        } else {\n            Error.call(this);\n        }\n    }\n    inherits(SubError, Error);\n    return SubError;\n}\n\nvar _TypeError, _RangeError;\nvar Warning = subError("Warning", "warning");\nvar CancellationError = subError("CancellationError", "cancellation error");\nvar TimeoutError = subError("TimeoutError", "timeout error");\nvar AggregateError = subError("AggregateError", "aggregate error");\ntry {\n    _TypeError = TypeError;\n    _RangeError = RangeError;\n} catch(e) {\n    _TypeError = subError("TypeError", "type error");\n    _RangeError = subError("RangeError", "range error");\n}\n\nvar methods = ("join pop push shift unshift slice filter forEach some " +\n    "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");\n\nfor (var i = 0; i < methods.length; ++i) {\n    if (typeof Array.prototype[methods[i]] === "function") {\n        AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n    }\n}\n\nes5.defineProperty(AggregateError.prototype, "length", {\n    value: 0,\n    configurable: false,\n    writable: true,\n    enumerable: true\n});\nAggregateError.prototype["isOperational"] = true;\nvar level = 0;\nAggregateError.prototype.toString = function() {\n    var indent = Array(level * 4 + 1).join(" ");\n    var ret = "\\n" + indent + "AggregateError of:" + "\\n";\n    level++;\n    indent = Array(level * 4 + 1).join(" ");\n    for (var i = 0; i < this.length; ++i) {\n        var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";\n        var lines = str.split("\\n");\n        for (var j = 0; j < lines.length; ++j) {\n            lines[j] = indent + lines[j];\n        }\n        str = lines.join("\\n");\n        ret += str + "\\n";\n    }\n    level--;\n    return ret;\n};\n\nfunction OperationalError(message) {\n    if (!(this instanceof OperationalError))\n        return new OperationalError(message);\n    notEnumerableProp(this, "name", "OperationalError");\n    notEnumerableProp(this, "message", message);\n    this.cause = message;\n    this["isOperational"] = true;\n\n    if (message instanceof Error) {\n        notEnumerableProp(this, "message", message.message);\n        notEnumerableProp(this, "stack", message.stack);\n    } else if (Error.captureStackTrace) {\n        Error.captureStackTrace(this, this.constructor);\n    }\n\n}\ninherits(OperationalError, Error);\n\nvar errorTypes = Error["__BluebirdErrorTypes__"];\nif (!errorTypes) {\n    errorTypes = Objectfreeze({\n        CancellationError: CancellationError,\n        TimeoutError: TimeoutError,\n        OperationalError: OperationalError,\n        RejectionError: OperationalError,\n        AggregateError: AggregateError\n    });\n    es5.defineProperty(Error, "__BluebirdErrorTypes__", {\n        value: errorTypes,\n        writable: false,\n        enumerable: false,\n        configurable: false\n    });\n}\n\nmodule.exports = {\n    Error: Error,\n    TypeError: _TypeError,\n    RangeError: _RangeError,\n    CancellationError: errorTypes.CancellationError,\n    OperationalError: errorTypes.OperationalError,\n    TimeoutError: errorTypes.TimeoutError,\n    AggregateError: errorTypes.AggregateError,\n    Warning: Warning\n};\n\n},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){\nvar isES5 = (function(){\n    "use strict";\n    return this === undefined;\n})();\n\nif (isES5) {\n    module.exports = {\n        freeze: Object.freeze,\n        defineProperty: Object.defineProperty,\n        getDescriptor: Object.getOwnPropertyDescriptor,\n        keys: Object.keys,\n        names: Object.getOwnPropertyNames,\n        getPrototypeOf: Object.getPrototypeOf,\n        isArray: Array.isArray,\n        isES5: isES5,\n        propertyIsWritable: function(obj, prop) {\n            var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n            return !!(!descriptor || descriptor.writable || descriptor.set);\n        }\n    };\n} else {\n    var has = {}.hasOwnProperty;\n    var str = {}.toString;\n    var proto = {}.constructor.prototype;\n\n    var ObjectKeys = function (o) {\n        var ret = [];\n        for (var key in o) {\n            if (has.call(o, key)) {\n                ret.push(key);\n            }\n        }\n        return ret;\n    };\n\n    var ObjectGetDescriptor = function(o, key) {\n        return {value: o[key]};\n    };\n\n    var ObjectDefineProperty = function (o, key, desc) {\n        o[key] = desc.value;\n        return o;\n    };\n\n    var ObjectFreeze = function (obj) {\n        return obj;\n    };\n\n    var ObjectGetPrototypeOf = function (obj) {\n        try {\n            return Object(obj).constructor.prototype;\n        }\n        catch (e) {\n            return proto;\n        }\n    };\n\n    var ArrayIsArray = function (obj) {\n        try {\n            return str.call(obj) === "[object Array]";\n        }\n        catch(e) {\n            return false;\n        }\n    };\n\n    module.exports = {\n        isArray: ArrayIsArray,\n        keys: ObjectKeys,\n        names: ObjectKeys,\n        defineProperty: ObjectDefineProperty,\n        getDescriptor: ObjectGetDescriptor,\n        freeze: ObjectFreeze,\n        getPrototypeOf: ObjectGetPrototypeOf,\n        isES5: isES5,\n        propertyIsWritable: function() {\n            return true;\n        }\n    };\n}\n\n},{}],14:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseMap = Promise.map;\n\nPromise.prototype.filter = function (fn, options) {\n    return PromiseMap(this, fn, options, INTERNAL);\n};\n\nPromise.filter = function (promises, fn, options) {\n    return PromiseMap(promises, fn, options, INTERNAL);\n};\n};\n\n},{}],15:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, tryConvertToPromise) {\nvar util = _dereq_("./util");\nvar CancellationError = Promise.CancellationError;\nvar errorObj = util.errorObj;\n\nfunction PassThroughHandlerContext(promise, type, handler) {\n    this.promise = promise;\n    this.type = type;\n    this.handler = handler;\n    this.called = false;\n    this.cancelPromise = null;\n}\n\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\n    return this.type === 0;\n};\n\nfunction FinallyHandlerCancelReaction(finallyHandler) {\n    this.finallyHandler = finallyHandler;\n}\n\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\n    checkCancel(this.finallyHandler);\n};\n\nfunction checkCancel(ctx, reason) {\n    if (ctx.cancelPromise != null) {\n        if (arguments.length > 1) {\n            ctx.cancelPromise._reject(reason);\n        } else {\n            ctx.cancelPromise._cancel();\n        }\n        ctx.cancelPromise = null;\n        return true;\n    }\n    return false;\n}\n\nfunction succeed() {\n    return finallyHandler.call(this, this.promise._target()._settledValue());\n}\nfunction fail(reason) {\n    if (checkCancel(this, reason)) return;\n    errorObj.e = reason;\n    return errorObj;\n}\nfunction finallyHandler(reasonOrValue) {\n    var promise = this.promise;\n    var handler = this.handler;\n\n    if (!this.called) {\n        this.called = true;\n        var ret = this.isFinallyHandler()\n            ? handler.call(promise._boundValue())\n            : handler.call(promise._boundValue(), reasonOrValue);\n        if (ret !== undefined) {\n            promise._setReturnedNonUndefined();\n            var maybePromise = tryConvertToPromise(ret, promise);\n            if (maybePromise instanceof Promise) {\n                if (this.cancelPromise != null) {\n                    if (maybePromise.isCancelled()) {\n                        var reason =\n                            new CancellationError("late cancellation observer");\n                        promise._attachExtraTrace(reason);\n                        errorObj.e = reason;\n                        return errorObj;\n                    } else if (maybePromise.isPending()) {\n                        maybePromise._attachCancellationCallback(\n                            new FinallyHandlerCancelReaction(this));\n                    }\n                }\n                return maybePromise._then(\n                    succeed, fail, undefined, this, undefined);\n            }\n        }\n    }\n\n    if (promise.isRejected()) {\n        checkCancel(this);\n        errorObj.e = reasonOrValue;\n        return errorObj;\n    } else {\n        checkCancel(this);\n        return reasonOrValue;\n    }\n}\n\nPromise.prototype._passThrough = function(handler, type, success, fail) {\n    if (typeof handler !== "function") return this.then();\n    return this._then(success,\n                      fail,\n                      undefined,\n                      new PassThroughHandlerContext(this, type, handler),\n                      undefined);\n};\n\nPromise.prototype.lastly =\nPromise.prototype["finally"] = function (handler) {\n    return this._passThrough(handler,\n                             0,\n                             finallyHandler,\n                             finallyHandler);\n};\n\nPromise.prototype.tap = function (handler) {\n    return this._passThrough(handler, 1, finallyHandler);\n};\n\nreturn PassThroughHandlerContext;\n};\n\n},{"./util":36}],16:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          apiRejection,\n                          INTERNAL,\n                          tryConvertToPromise,\n                          Proxyable,\n                          debug) {\nvar errors = _dereq_("./errors");\nvar TypeError = errors.TypeError;\nvar util = _dereq_("./util");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nvar yieldHandlers = [];\n\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\n    for (var i = 0; i < yieldHandlers.length; ++i) {\n        traceParent._pushContext();\n        var result = tryCatch(yieldHandlers[i])(value);\n        traceParent._popContext();\n        if (result === errorObj) {\n            traceParent._pushContext();\n            var ret = Promise.reject(errorObj.e);\n            traceParent._popContext();\n            return ret;\n        }\n        var maybePromise = tryConvertToPromise(result, traceParent);\n        if (maybePromise instanceof Promise) return maybePromise;\n    }\n    return null;\n}\n\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\n    var promise = this._promise = new Promise(INTERNAL);\n    promise._captureStackTrace();\n    promise._setOnCancel(this);\n    this._stack = stack;\n    this._generatorFunction = generatorFunction;\n    this._receiver = receiver;\n    this._generator = undefined;\n    this._yieldHandlers = typeof yieldHandler === "function"\n        ? [yieldHandler].concat(yieldHandlers)\n        : yieldHandlers;\n    this._yieldedPromise = null;\n}\nutil.inherits(PromiseSpawn, Proxyable);\n\nPromiseSpawn.prototype._isResolved = function() {\n    return this._promise === null;\n};\n\nPromiseSpawn.prototype._cleanup = function() {\n    this._promise = this._generator = null;\n};\n\nPromiseSpawn.prototype._promiseCancelled = function() {\n    if (this._isResolved()) return;\n    var implementsReturn = typeof this._generator["return"] !== "undefined";\n\n    var result;\n    if (!implementsReturn) {\n        var reason = new Promise.CancellationError(\n            "generator .return() sentinel");\n        Promise.coroutine.returnSentinel = reason;\n        this._promise._attachExtraTrace(reason);\n        this._promise._pushContext();\n        result = tryCatch(this._generator["throw"]).call(this._generator,\n                                                         reason);\n        this._promise._popContext();\n        if (result === errorObj && result.e === reason) {\n            result = null;\n        }\n    } else {\n        this._promise._pushContext();\n        result = tryCatch(this._generator["return"]).call(this._generator,\n                                                          undefined);\n        this._promise._popContext();\n    }\n    var promise = this._promise;\n    this._cleanup();\n    if (result === errorObj) {\n        promise._rejectCallback(result.e, false);\n    } else {\n        promise.cancel();\n    }\n};\n\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\n    this._yieldedPromise = null;\n    this._promise._pushContext();\n    var result = tryCatch(this._generator.next).call(this._generator, value);\n    this._promise._popContext();\n    this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseRejected = function(reason) {\n    this._yieldedPromise = null;\n    this._promise._attachExtraTrace(reason);\n    this._promise._pushContext();\n    var result = tryCatch(this._generator["throw"])\n        .call(this._generator, reason);\n    this._promise._popContext();\n    this._continue(result);\n};\n\nPromiseSpawn.prototype._resultCancelled = function() {\n    if (this._yieldedPromise instanceof Promise) {\n        var promise = this._yieldedPromise;\n        this._yieldedPromise = null;\n        promise.cancel();\n    }\n};\n\nPromiseSpawn.prototype.promise = function () {\n    return this._promise;\n};\n\nPromiseSpawn.prototype._run = function () {\n    this._generator = this._generatorFunction.call(this._receiver);\n    this._receiver =\n        this._generatorFunction = undefined;\n    this._promiseFulfilled(undefined);\n};\n\nPromiseSpawn.prototype._continue = function (result) {\n    var promise = this._promise;\n    if (result === errorObj) {\n        this._cleanup();\n        return promise._rejectCallback(result.e, false);\n    }\n\n    var value = result.value;\n    if (result.done === true) {\n        this._cleanup();\n        return promise._resolveCallback(value);\n    } else {\n        var maybePromise = tryConvertToPromise(value, this._promise);\n        if (!(maybePromise instanceof Promise)) {\n            maybePromise =\n                promiseFromYieldHandler(maybePromise,\n                                        this._yieldHandlers,\n                                        this._promise);\n            if (maybePromise === null) {\n                this._promiseRejected(\n                    new TypeError(\n                        "A value %s was yielded that could not be treated as a promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a\\u000a".replace("%s", value) +\n                        "From coroutine:\\u000a" +\n                        this._stack.split("\\n").slice(1, -7).join("\\n")\n                    )\n                );\n                return;\n            }\n        }\n        maybePromise = maybePromise._target();\n        var bitField = maybePromise._bitField;\n        ;\n        if (((bitField & 50397184) === 0)) {\n            this._yieldedPromise = maybePromise;\n            maybePromise._proxy(this, null);\n        } else if (((bitField & 33554432) !== 0)) {\n            this._promiseFulfilled(maybePromise._value());\n        } else if (((bitField & 16777216) !== 0)) {\n            this._promiseRejected(maybePromise._reason());\n        } else {\n            this._promiseCancelled();\n        }\n    }\n};\n\nPromise.coroutine = function (generatorFunction, options) {\n    if (typeof generatorFunction !== "function") {\n        throw new TypeError("generatorFunction must be a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var yieldHandler = Object(options).yieldHandler;\n    var PromiseSpawn$ = PromiseSpawn;\n    var stack = new Error().stack;\n    return function () {\n        var generator = generatorFunction.apply(this, arguments);\n        var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\n                                      stack);\n        var ret = spawn.promise();\n        spawn._generator = generator;\n        spawn._promiseFulfilled(undefined);\n        return ret;\n    };\n};\n\nPromise.coroutine.addYieldHandler = function(fn) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    yieldHandlers.push(fn);\n};\n\nPromise.spawn = function (generatorFunction) {\n    debug.deprecated("Promise.spawn()", "Promise.coroutine()");\n    if (typeof generatorFunction !== "function") {\n        return apiRejection("generatorFunction must be a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var spawn = new PromiseSpawn(generatorFunction, this);\n    var ret = spawn.promise();\n    spawn._run(Promise.spawn);\n    return ret;\n};\n};\n\n},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {\nvar util = _dereq_("./util");\nvar canEvaluate = util.canEvaluate;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar reject;\n\nif (false) {\nif (canEvaluate) {\n    var thenCallback = function(i) {\n        return new Function("value", "holder", "                             \\n\\\n            \'use strict\';                                                    \\n\\\n            holder.pIndex = value;                                           \\n\\\n            holder.checkFulfillment(this);                                   \\n\\\n            ".replace(/Index/g, i));\n    };\n\n    var promiseSetter = function(i) {\n        return new Function("promise", "holder", "                           \\n\\\n            \'use strict\';                                                    \\n\\\n            holder.pIndex = promise;                                         \\n\\\n            ".replace(/Index/g, i));\n    };\n\n    var generateHolderClass = function(total) {\n        var props = new Array(total);\n        for (var i = 0; i < props.length; ++i) {\n            props[i] = "this.p" + (i+1);\n        }\n        var assignment = props.join(" = ") + " = null;";\n        var cancellationCode= "var promise;\\n" + props.map(function(prop) {\n            return "                                                         \\n\\\n                promise = " + prop + ";                                      \\n\\\n                if (promise instanceof Promise) {                            \\n\\\n                    promise.cancel();                                        \\n\\\n                }                                                            \\n\\\n            ";\n        }).join("\\n");\n        var passedArguments = props.join(", ");\n        var name = "Holder$" + total;\n\n\n        var code = "return function(tryCatch, errorObj, Promise) {           \\n\\\n            \'use strict\';                                                    \\n\\\n            function [TheName](fn) {                                         \\n\\\n                [TheProperties]                                              \\n\\\n                this.fn = fn;                                                \\n\\\n                this.now = 0;                                                \\n\\\n            }                                                                \\n\\\n            [TheName].prototype.checkFulfillment = function(promise) {       \\n\\\n                var now = ++this.now;                                        \\n\\\n                if (now === [TheTotal]) {                                    \\n\\\n                    promise._pushContext();                                  \\n\\\n                    var callback = this.fn;                                  \\n\\\n                    var ret = tryCatch(callback)([ThePassedArguments]);      \\n\\\n                    promise._popContext();                                   \\n\\\n                    if (ret === errorObj) {                                  \\n\\\n                        promise._rejectCallback(ret.e, false);               \\n\\\n                    } else {                                                 \\n\\\n                        promise._resolveCallback(ret);                       \\n\\\n                    }                                                        \\n\\\n                }                                                            \\n\\\n            };                                                               \\n\\\n                                                                             \\n\\\n            [TheName].prototype._resultCancelled = function() {              \\n\\\n                [CancellationCode]                                           \\n\\\n            };                                                               \\n\\\n                                                                             \\n\\\n            return [TheName];                                                \\n\\\n        }(tryCatch, errorObj, Promise);                                      \\n\\\n        ";\n\n        code = code.replace(/\\[TheName\\]/g, name)\n            .replace(/\\[TheTotal\\]/g, total)\n            .replace(/\\[ThePassedArguments\\]/g, passedArguments)\n            .replace(/\\[TheProperties\\]/g, assignment)\n            .replace(/\\[CancellationCode\\]/g, cancellationCode);\n\n        return new Function("tryCatch", "errorObj", "Promise", code)\n                           (tryCatch, errorObj, Promise);\n    };\n\n    var holderClasses = [];\n    var thenCallbacks = [];\n    var promiseSetters = [];\n\n    for (var i = 0; i < 8; ++i) {\n        holderClasses.push(generateHolderClass(i + 1));\n        thenCallbacks.push(thenCallback(i + 1));\n        promiseSetters.push(promiseSetter(i + 1));\n    }\n\n    reject = function (reason) {\n        this._reject(reason);\n    };\n}}\n\nPromise.join = function () {\n    var last = arguments.length - 1;\n    var fn;\n    if (last > 0 && typeof arguments[last] === "function") {\n        fn = arguments[last];\n        if (false) {\n            if (last <= 8 && canEvaluate) {\n                var ret = new Promise(INTERNAL);\n                ret._captureStackTrace();\n                var HolderClass = holderClasses[last - 1];\n                var holder = new HolderClass(fn);\n                var callbacks = thenCallbacks;\n\n                for (var i = 0; i < last; ++i) {\n                    var maybePromise = tryConvertToPromise(arguments[i], ret);\n                    if (maybePromise instanceof Promise) {\n                        maybePromise = maybePromise._target();\n                        var bitField = maybePromise._bitField;\n                        ;\n                        if (((bitField & 50397184) === 0)) {\n                            maybePromise._then(callbacks[i], reject,\n                                               undefined, ret, holder);\n                            promiseSetters[i](maybePromise, holder);\n                        } else if (((bitField & 33554432) !== 0)) {\n                            callbacks[i].call(ret,\n                                              maybePromise._value(), holder);\n                        } else if (((bitField & 16777216) !== 0)) {\n                            ret._reject(maybePromise._reason());\n                        } else {\n                            ret._cancel();\n                        }\n                    } else {\n                        callbacks[i].call(ret, maybePromise, holder);\n                    }\n                }\n                if (!ret._isFateSealed()) {\n                    ret._setAsyncGuaranteed();\n                    ret._setOnCancel(holder);\n                }\n                return ret;\n            }\n        }\n    }\n    var args = [].slice.call(arguments);;\n    if (fn) args.pop();\n    var ret = new PromiseArray(args).promise();\n    return fn !== undefined ? ret.spread(fn) : ret;\n};\n\n};\n\n},{"./util":36}],18:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          PromiseArray,\n                          apiRejection,\n                          tryConvertToPromise,\n                          INTERNAL,\n                          debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar EMPTY_ARRAY = [];\n\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\n    this.constructor$(promises);\n    this._promise._captureStackTrace();\n    var domain = getDomain();\n    this._callback = domain === null ? fn : domain.bind(fn);\n    this._preservedValues = _filter === INTERNAL\n        ? new Array(this.length())\n        : null;\n    this._limit = limit;\n    this._inFlight = 0;\n    this._queue = limit >= 1 ? [] : EMPTY_ARRAY;\n    this._init$(undefined, -2);\n}\nutil.inherits(MappingPromiseArray, PromiseArray);\n\nMappingPromiseArray.prototype._init = function () {};\n\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    var values = this._values;\n    var length = this.length();\n    var preservedValues = this._preservedValues;\n    var limit = this._limit;\n\n    if (index < 0) {\n        index = (index * -1) - 1;\n        values[index] = value;\n        if (limit >= 1) {\n            this._inFlight--;\n            this._drainQueue();\n            if (this._isResolved()) return true;\n        }\n    } else {\n        if (limit >= 1 && this._inFlight >= limit) {\n            values[index] = value;\n            this._queue.push(index);\n            return false;\n        }\n        if (preservedValues !== null) preservedValues[index] = value;\n\n        var promise = this._promise;\n        var callback = this._callback;\n        var receiver = promise._boundValue();\n        promise._pushContext();\n        var ret = tryCatch(callback).call(receiver, value, index, length);\n        var promiseCreated = promise._popContext();\n        debug.checkForgottenReturns(\n            ret,\n            promiseCreated,\n            preservedValues !== null ? "Promise.filter" : "Promise.map",\n            promise\n        );\n        if (ret === errorObj) {\n            this._reject(ret.e);\n            return true;\n        }\n\n        var maybePromise = tryConvertToPromise(ret, this._promise);\n        if (maybePromise instanceof Promise) {\n            maybePromise = maybePromise._target();\n            var bitField = maybePromise._bitField;\n            ;\n            if (((bitField & 50397184) === 0)) {\n                if (limit >= 1) this._inFlight++;\n                values[index] = maybePromise;\n                maybePromise._proxy(this, (index + 1) * -1);\n                return false;\n            } else if (((bitField & 33554432) !== 0)) {\n                ret = maybePromise._value();\n            } else if (((bitField & 16777216) !== 0)) {\n                this._reject(maybePromise._reason());\n                return true;\n            } else {\n                this._cancel();\n                return true;\n            }\n        }\n        values[index] = ret;\n    }\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= length) {\n        if (preservedValues !== null) {\n            this._filter(values, preservedValues);\n        } else {\n            this._resolve(values);\n        }\n        return true;\n    }\n    return false;\n};\n\nMappingPromiseArray.prototype._drainQueue = function () {\n    var queue = this._queue;\n    var limit = this._limit;\n    var values = this._values;\n    while (queue.length > 0 && this._inFlight < limit) {\n        if (this._isResolved()) return;\n        var index = queue.pop();\n        this._promiseFulfilled(values[index], index);\n    }\n};\n\nMappingPromiseArray.prototype._filter = function (booleans, values) {\n    var len = values.length;\n    var ret = new Array(len);\n    var j = 0;\n    for (var i = 0; i < len; ++i) {\n        if (booleans[i]) ret[j++] = values[i];\n    }\n    ret.length = j;\n    this._resolve(ret);\n};\n\nMappingPromiseArray.prototype.preservedValues = function () {\n    return this._preservedValues;\n};\n\nfunction map(promises, fn, options, _filter) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var limit = typeof options === "object" && options !== null\n        ? options.concurrency\n        : 0;\n    limit = typeof limit === "number" &&\n        isFinite(limit) && limit >= 1 ? limit : 0;\n    return new MappingPromiseArray(promises, fn, limit, _filter).promise();\n}\n\nPromise.prototype.map = function (fn, options) {\n    return map(this, fn, options, null);\n};\n\nPromise.map = function (promises, fn, options, _filter) {\n    return map(promises, fn, options, _filter);\n};\n\n\n};\n\n},{"./util":36}],19:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\n\nPromise.method = function (fn) {\n    if (typeof fn !== "function") {\n        throw new Promise.TypeError("expecting a function but got " + util.classString(fn));\n    }\n    return function () {\n        var ret = new Promise(INTERNAL);\n        ret._captureStackTrace();\n        ret._pushContext();\n        var value = tryCatch(fn).apply(this, arguments);\n        var promiseCreated = ret._popContext();\n        debug.checkForgottenReturns(\n            value, promiseCreated, "Promise.method", ret);\n        ret._resolveFromSyncValue(value);\n        return ret;\n    };\n};\n\nPromise.attempt = Promise["try"] = function (fn) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    ret._pushContext();\n    var value;\n    if (arguments.length > 1) {\n        debug.deprecated("calling Promise.try with more than 1 argument");\n        var arg = arguments[1];\n        var ctx = arguments[2];\n        value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\n                                  : tryCatch(fn).call(ctx, arg);\n    } else {\n        value = tryCatch(fn)();\n    }\n    var promiseCreated = ret._popContext();\n    debug.checkForgottenReturns(\n        value, promiseCreated, "Promise.try", ret);\n    ret._resolveFromSyncValue(value);\n    return ret;\n};\n\nPromise.prototype._resolveFromSyncValue = function (value) {\n    if (value === util.errorObj) {\n        this._rejectCallback(value.e, false);\n    } else {\n        this._resolveCallback(value, true);\n    }\n};\n};\n\n},{"./util":36}],20:[function(_dereq_,module,exports){\n"use strict";\nvar util = _dereq_("./util");\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar errors = _dereq_("./errors");\nvar OperationalError = errors.OperationalError;\nvar es5 = _dereq_("./es5");\n\nfunction isUntypedError(obj) {\n    return obj instanceof Error &&\n        es5.getPrototypeOf(obj) === Error.prototype;\n}\n\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\nfunction wrapAsOperationalError(obj) {\n    var ret;\n    if (isUntypedError(obj)) {\n        ret = new OperationalError(obj);\n        ret.name = obj.name;\n        ret.message = obj.message;\n        ret.stack = obj.stack;\n        var keys = es5.keys(obj);\n        for (var i = 0; i < keys.length; ++i) {\n            var key = keys[i];\n            if (!rErrorKey.test(key)) {\n                ret[key] = obj[key];\n            }\n        }\n        return ret;\n    }\n    util.markAsOriginatingFromRejection(obj);\n    return obj;\n}\n\nfunction nodebackForPromise(promise, multiArgs) {\n    return function(err, value) {\n        if (promise === null) return;\n        if (err) {\n            var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n            promise._attachExtraTrace(wrapped);\n            promise._reject(wrapped);\n        } else if (!multiArgs) {\n            promise._fulfill(value);\n        } else {\n            var args = [].slice.call(arguments, 1);;\n            promise._fulfill(args);\n        }\n        promise = null;\n    };\n}\n\nmodule.exports = nodebackForPromise;\n\n},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar util = _dereq_("./util");\nvar async = Promise._async;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction spreadAdapter(val, nodeback) {\n    var promise = this;\n    if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\n    var ret =\n        tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\n\nfunction successAdapter(val, nodeback) {\n    var promise = this;\n    var receiver = promise._boundValue();\n    var ret = val === undefined\n        ? tryCatch(nodeback).call(receiver, null)\n        : tryCatch(nodeback).call(receiver, null, val);\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\nfunction errorAdapter(reason, nodeback) {\n    var promise = this;\n    if (!reason) {\n        var newReason = new Error(reason + "");\n        newReason.cause = reason;\n        reason = newReason;\n    }\n    var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\n\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\n                                                                     options) {\n    if (typeof nodeback == "function") {\n        var adapter = successAdapter;\n        if (options !== undefined && Object(options).spread) {\n            adapter = spreadAdapter;\n        }\n        this._then(\n            adapter,\n            errorAdapter,\n            undefined,\n            this,\n            nodeback\n        );\n    }\n    return this;\n};\n};\n\n},{"./util":36}],22:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function() {\nvar makeSelfResolutionError = function () {\n    return new TypeError("circular promise resolution chain\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n};\nvar reflectHandler = function() {\n    return new Promise.PromiseInspection(this._target());\n};\nvar apiRejection = function(msg) {\n    return Promise.reject(new TypeError(msg));\n};\nfunction Proxyable() {}\nvar UNDEFINED_BINDING = {};\nvar util = _dereq_("./util");\n\nvar getDomain;\nif (util.isNode) {\n    getDomain = function() {\n        var ret = process.domain;\n        if (ret === undefined) ret = null;\n        return ret;\n    };\n} else {\n    getDomain = function() {\n        return null;\n    };\n}\nutil.notEnumerableProp(Promise, "_getDomain", getDomain);\n\nvar es5 = _dereq_("./es5");\nvar Async = _dereq_("./async");\nvar async = new Async();\nes5.defineProperty(Promise, "_async", {value: async});\nvar errors = _dereq_("./errors");\nvar TypeError = Promise.TypeError = errors.TypeError;\nPromise.RangeError = errors.RangeError;\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\nPromise.TimeoutError = errors.TimeoutError;\nPromise.OperationalError = errors.OperationalError;\nPromise.RejectionError = errors.OperationalError;\nPromise.AggregateError = errors.AggregateError;\nvar INTERNAL = function(){};\nvar APPLY = {};\nvar NEXT_FILTER = {};\nvar tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL);\nvar PromiseArray =\n    _dereq_("./promise_array")(Promise, INTERNAL,\n                               tryConvertToPromise, apiRejection, Proxyable);\nvar Context = _dereq_("./context")(Promise);\n /*jshint unused:false*/\nvar createContext = Context.create;\nvar debug = _dereq_("./debuggability")(Promise, Context);\nvar CapturedTrace = debug.CapturedTrace;\nvar PassThroughHandlerContext =\n    _dereq_("./finally")(Promise, tryConvertToPromise);\nvar catchFilter = _dereq_("./catch_filter")(NEXT_FILTER);\nvar nodebackForPromise = _dereq_("./nodeback");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nfunction check(self, executor) {\n    if (typeof executor !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(executor));\n    }\n    if (self.constructor !== Promise) {\n        throw new TypeError("the promise constructor cannot be invoked directly\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n}\n\nfunction Promise(executor) {\n    this._bitField = 0;\n    this._fulfillmentHandler0 = undefined;\n    this._rejectionHandler0 = undefined;\n    this._promise0 = undefined;\n    this._receiver0 = undefined;\n    if (executor !== INTERNAL) {\n        check(this, executor);\n        this._resolveFromExecutor(executor);\n    }\n    this._promiseCreated();\n    this._fireEvent("promiseCreated", this);\n}\n\nPromise.prototype.toString = function () {\n    return "[object Promise]";\n};\n\nPromise.prototype.caught = Promise.prototype["catch"] = function (fn) {\n    var len = arguments.length;\n    if (len > 1) {\n        var catchInstances = new Array(len - 1),\n            j = 0, i;\n        for (i = 0; i < len - 1; ++i) {\n            var item = arguments[i];\n            if (util.isObject(item)) {\n                catchInstances[j++] = item;\n            } else {\n                return apiRejection("expecting an object but got " + util.classString(item));\n            }\n        }\n        catchInstances.length = j;\n        fn = arguments[i];\n        return this.then(undefined, catchFilter(catchInstances, fn, this));\n    }\n    return this.then(undefined, fn);\n};\n\nPromise.prototype.reflect = function () {\n    return this._then(reflectHandler,\n        reflectHandler, undefined, this, undefined);\n};\n\nPromise.prototype.then = function (didFulfill, didReject) {\n    if (debug.warnings() && arguments.length > 0 &&\n        typeof didFulfill !== "function" &&\n        typeof didReject !== "function") {\n        var msg = ".then() only accepts functions but was passed: " +\n                util.classString(didFulfill);\n        if (arguments.length > 1) {\n            msg += ", " + util.classString(didReject);\n        }\n        this._warn(msg);\n    }\n    return this._then(didFulfill, didReject, undefined, undefined, undefined);\n};\n\nPromise.prototype.done = function (didFulfill, didReject) {\n    var promise =\n        this._then(didFulfill, didReject, undefined, undefined, undefined);\n    promise._setIsFinal();\n};\n\nPromise.prototype.spread = function (fn) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n};\n\nPromise.prototype.toJSON = function () {\n    var ret = {\n        isFulfilled: false,\n        isRejected: false,\n        fulfillmentValue: undefined,\n        rejectionReason: undefined\n    };\n    if (this.isFulfilled()) {\n        ret.fulfillmentValue = this.value();\n        ret.isFulfilled = true;\n    } else if (this.isRejected()) {\n        ret.rejectionReason = this.reason();\n        ret.isRejected = true;\n    }\n    return ret;\n};\n\nPromise.prototype.all = function () {\n    if (arguments.length > 0) {\n        this._warn(".all() was passed arguments but it does not take any");\n    }\n    return new PromiseArray(this).promise();\n};\n\nPromise.prototype.error = function (fn) {\n    return this.caught(util.originatesFromRejection, fn);\n};\n\nPromise.is = function (val) {\n    return val instanceof Promise;\n};\n\nPromise.fromNode = Promise.fromCallback = function(fn) {\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\n                                         : false;\n    var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n    if (result === errorObj) {\n        ret._rejectCallback(result.e, true);\n    }\n    if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n    return ret;\n};\n\nPromise.all = function (promises) {\n    return new PromiseArray(promises).promise();\n};\n\nPromise.cast = function (obj) {\n    var ret = tryConvertToPromise(obj);\n    if (!(ret instanceof Promise)) {\n        ret = new Promise(INTERNAL);\n        ret._captureStackTrace();\n        ret._setFulfilled();\n        ret._rejectionHandler0 = obj;\n    }\n    return ret;\n};\n\nPromise.resolve = Promise.fulfilled = Promise.cast;\n\nPromise.reject = Promise.rejected = function (reason) {\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    ret._rejectCallback(reason, true);\n    return ret;\n};\n\nPromise.setScheduler = function(fn) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    var prev = async._schedule;\n    async._schedule = fn;\n    return prev;\n};\n\nPromise.prototype._then = function (\n    didFulfill,\n    didReject,\n    _,    receiver,\n    internalData\n) {\n    var haveInternalData = internalData !== undefined;\n    var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n    var target = this._target();\n    var bitField = target._bitField;\n\n    if (!haveInternalData) {\n        promise._propagateFrom(this, 3);\n        promise._captureStackTrace();\n        if (receiver === undefined &&\n            ((this._bitField & 2097152) !== 0)) {\n            if (!((bitField & 50397184) === 0)) {\n                receiver = this._boundValue();\n            } else {\n                receiver = target === this ? undefined : this._boundTo;\n            }\n        }\n        this._fireEvent("promiseChained", this, promise);\n    }\n\n    var domain = getDomain();\n    if (!((bitField & 50397184) === 0)) {\n        var handler, value, settler = target._settlePromiseCtx;\n        if (((bitField & 33554432) !== 0)) {\n            value = target._rejectionHandler0;\n            handler = didFulfill;\n        } else if (((bitField & 16777216) !== 0)) {\n            value = target._fulfillmentHandler0;\n            handler = didReject;\n            target._unsetRejectionIsUnhandled();\n        } else {\n            settler = target._settlePromiseLateCancellationObserver;\n            value = new CancellationError("late cancellation observer");\n            target._attachExtraTrace(value);\n            handler = didReject;\n        }\n\n        async.invoke(settler, target, {\n            handler: domain === null ? handler\n                : (typeof handler === "function" && domain.bind(handler)),\n            promise: promise,\n            receiver: receiver,\n            value: value\n        });\n    } else {\n        target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\n    }\n\n    return promise;\n};\n\nPromise.prototype._length = function () {\n    return this._bitField & 65535;\n};\n\nPromise.prototype._isFateSealed = function () {\n    return (this._bitField & 117506048) !== 0;\n};\n\nPromise.prototype._isFollowing = function () {\n    return (this._bitField & 67108864) === 67108864;\n};\n\nPromise.prototype._setLength = function (len) {\n    this._bitField = (this._bitField & -65536) |\n        (len & 65535);\n};\n\nPromise.prototype._setFulfilled = function () {\n    this._bitField = this._bitField | 33554432;\n    this._fireEvent("promiseFulfilled", this);\n};\n\nPromise.prototype._setRejected = function () {\n    this._bitField = this._bitField | 16777216;\n    this._fireEvent("promiseRejected", this);\n};\n\nPromise.prototype._setFollowing = function () {\n    this._bitField = this._bitField | 67108864;\n    this._fireEvent("promiseResolved", this);\n};\n\nPromise.prototype._setIsFinal = function () {\n    this._bitField = this._bitField | 4194304;\n};\n\nPromise.prototype._isFinal = function () {\n    return (this._bitField & 4194304) > 0;\n};\n\nPromise.prototype._unsetCancelled = function() {\n    this._bitField = this._bitField & (~65536);\n};\n\nPromise.prototype._setCancelled = function() {\n    this._bitField = this._bitField | 65536;\n    this._fireEvent("promiseCancelled", this);\n};\n\nPromise.prototype._setAsyncGuaranteed = function() {\n    this._bitField = this._bitField | 134217728;\n};\n\nPromise.prototype._receiverAt = function (index) {\n    var ret = index === 0 ? this._receiver0 : this[\n            index * 4 - 4 + 3];\n    if (ret === UNDEFINED_BINDING) {\n        return undefined;\n    } else if (ret === undefined && this._isBound()) {\n        return this._boundValue();\n    }\n    return ret;\n};\n\nPromise.prototype._promiseAt = function (index) {\n    return this[\n            index * 4 - 4 + 2];\n};\n\nPromise.prototype._fulfillmentHandlerAt = function (index) {\n    return this[\n            index * 4 - 4 + 0];\n};\n\nPromise.prototype._rejectionHandlerAt = function (index) {\n    return this[\n            index * 4 - 4 + 1];\n};\n\nPromise.prototype._boundValue = function() {};\n\nPromise.prototype._migrateCallback0 = function (follower) {\n    var bitField = follower._bitField;\n    var fulfill = follower._fulfillmentHandler0;\n    var reject = follower._rejectionHandler0;\n    var promise = follower._promise0;\n    var receiver = follower._receiverAt(0);\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._migrateCallbackAt = function (follower, index) {\n    var fulfill = follower._fulfillmentHandlerAt(index);\n    var reject = follower._rejectionHandlerAt(index);\n    var promise = follower._promiseAt(index);\n    var receiver = follower._receiverAt(index);\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._addCallbacks = function (\n    fulfill,\n    reject,\n    promise,\n    receiver,\n    domain\n) {\n    var index = this._length();\n\n    if (index >= 65535 - 4) {\n        index = 0;\n        this._setLength(0);\n    }\n\n    if (index === 0) {\n        this._promise0 = promise;\n        this._receiver0 = receiver;\n        if (typeof fulfill === "function") {\n            this._fulfillmentHandler0 =\n                domain === null ? fulfill : domain.bind(fulfill);\n        }\n        if (typeof reject === "function") {\n            this._rejectionHandler0 =\n                domain === null ? reject : domain.bind(reject);\n        }\n    } else {\n        var base = index * 4 - 4;\n        this[base + 2] = promise;\n        this[base + 3] = receiver;\n        if (typeof fulfill === "function") {\n            this[base + 0] =\n                domain === null ? fulfill : domain.bind(fulfill);\n        }\n        if (typeof reject === "function") {\n            this[base + 1] =\n                domain === null ? reject : domain.bind(reject);\n        }\n    }\n    this._setLength(index + 1);\n    return index;\n};\n\nPromise.prototype._proxy = function (proxyable, arg) {\n    this._addCallbacks(undefined, undefined, arg, proxyable, null);\n};\n\nPromise.prototype._resolveCallback = function(value, shouldBind) {\n    if (((this._bitField & 117506048) !== 0)) return;\n    if (value === this)\n        return this._rejectCallback(makeSelfResolutionError(), false);\n    var maybePromise = tryConvertToPromise(value, this);\n    if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n\n    if (shouldBind) this._propagateFrom(maybePromise, 2);\n\n    var promise = maybePromise._target();\n    var bitField = promise._bitField;\n    if (((bitField & 50397184) === 0)) {\n        var len = this._length();\n        if (len > 0) promise._migrateCallback0(this);\n        for (var i = 1; i < len; ++i) {\n            promise._migrateCallbackAt(this, i);\n        }\n        this._setFollowing();\n        this._setLength(0);\n        this._setFollowee(promise);\n    } else if (((bitField & 33554432) !== 0)) {\n        this._fulfill(promise._value());\n    } else if (((bitField & 16777216) !== 0)) {\n        this._reject(promise._reason());\n    } else {\n        var reason = new CancellationError("late cancellation observer");\n        promise._attachExtraTrace(reason);\n        this._reject(reason);\n    }\n};\n\nPromise.prototype._rejectCallback =\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\n    var trace = util.ensureErrorObject(reason);\n    var hasStack = trace === reason;\n    if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n        var message = "a promise was rejected with a non-error: " +\n            util.classString(reason);\n        this._warn(message, true);\n    }\n    this._attachExtraTrace(trace, synchronous ? hasStack : false);\n    this._reject(reason);\n};\n\nPromise.prototype._resolveFromExecutor = function (executor) {\n    var promise = this;\n    this._captureStackTrace();\n    this._pushContext();\n    var synchronous = true;\n    var r = this._execute(executor, function(value) {\n        promise._resolveCallback(value);\n    }, function (reason) {\n        promise._rejectCallback(reason, synchronous);\n    });\n    synchronous = false;\n    this._popContext();\n\n    if (r !== undefined) {\n        promise._rejectCallback(r, true);\n    }\n};\n\nPromise.prototype._settlePromiseFromHandler = function (\n    handler, receiver, value, promise\n) {\n    var bitField = promise._bitField;\n    if (((bitField & 65536) !== 0)) return;\n    promise._pushContext();\n    var x;\n    if (receiver === APPLY) {\n        if (!value || typeof value.length !== "number") {\n            x = errorObj;\n            x.e = new TypeError("cannot .spread() a non-array: " +\n                                    util.classString(value));\n        } else {\n            x = tryCatch(handler).apply(this._boundValue(), value);\n        }\n    } else {\n        x = tryCatch(handler).call(receiver, value);\n    }\n    var promiseCreated = promise._popContext();\n    bitField = promise._bitField;\n    if (((bitField & 65536) !== 0)) return;\n\n    if (x === NEXT_FILTER) {\n        promise._reject(value);\n    } else if (x === errorObj || x === promise) {\n        var err = x === promise ? makeSelfResolutionError() : x.e;\n        promise._rejectCallback(err, false);\n    } else {\n        debug.checkForgottenReturns(x, promiseCreated, "",  promise, this);\n        promise._resolveCallback(x);\n    }\n};\n\nPromise.prototype._target = function() {\n    var ret = this;\n    while (ret._isFollowing()) ret = ret._followee();\n    return ret;\n};\n\nPromise.prototype._followee = function() {\n    return this._rejectionHandler0;\n};\n\nPromise.prototype._setFollowee = function(promise) {\n    this._rejectionHandler0 = promise;\n};\n\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\n    var isPromise = promise instanceof Promise;\n    var bitField = this._bitField;\n    var asyncGuaranteed = ((bitField & 134217728) !== 0);\n    if (((bitField & 65536) !== 0)) {\n        if (isPromise) promise._invokeInternalOnCancel();\n\n        if (receiver instanceof PassThroughHandlerContext &&\n            receiver.isFinallyHandler()) {\n            receiver.cancelPromise = promise;\n            if (tryCatch(handler).call(receiver, value) === errorObj) {\n                promise._reject(errorObj.e);\n            }\n        } else if (handler === reflectHandler) {\n            promise._fulfill(reflectHandler.call(receiver));\n        } else if (receiver instanceof Proxyable) {\n            receiver._promiseCancelled(promise);\n        } else if (isPromise || promise instanceof PromiseArray) {\n            promise._cancel();\n        } else {\n            receiver.cancel();\n        }\n    } else if (typeof handler === "function") {\n        if (!isPromise) {\n            handler.call(receiver, value, promise);\n        } else {\n            if (asyncGuaranteed) promise._setAsyncGuaranteed();\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\n        }\n    } else if (receiver instanceof Proxyable) {\n        if (!receiver._isResolved()) {\n            if (((bitField & 33554432) !== 0)) {\n                receiver._promiseFulfilled(value, promise);\n            } else {\n                receiver._promiseRejected(value, promise);\n            }\n        }\n    } else if (isPromise) {\n        if (asyncGuaranteed) promise._setAsyncGuaranteed();\n        if (((bitField & 33554432) !== 0)) {\n            promise._fulfill(value);\n        } else {\n            promise._reject(value);\n        }\n    }\n};\n\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\n    var handler = ctx.handler;\n    var promise = ctx.promise;\n    var receiver = ctx.receiver;\n    var value = ctx.value;\n    if (typeof handler === "function") {\n        if (!(promise instanceof Promise)) {\n            handler.call(receiver, value, promise);\n        } else {\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\n        }\n    } else if (promise instanceof Promise) {\n        promise._reject(value);\n    }\n};\n\nPromise.prototype._settlePromiseCtx = function(ctx) {\n    this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n};\n\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\n    var promise = this._promise0;\n    var receiver = this._receiverAt(0);\n    this._promise0 = undefined;\n    this._receiver0 = undefined;\n    this._settlePromise(promise, handler, receiver, value);\n};\n\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\n    var base = index * 4 - 4;\n    this[base + 2] =\n    this[base + 3] =\n    this[base + 0] =\n    this[base + 1] = undefined;\n};\n\nPromise.prototype._fulfill = function (value) {\n    var bitField = this._bitField;\n    if (((bitField & 117506048) >>> 16)) return;\n    if (value === this) {\n        var err = makeSelfResolutionError();\n        this._attachExtraTrace(err);\n        return this._reject(err);\n    }\n    this._setFulfilled();\n    this._rejectionHandler0 = value;\n\n    if ((bitField & 65535) > 0) {\n        if (((bitField & 134217728) !== 0)) {\n            this._settlePromises();\n        } else {\n            async.settlePromises(this);\n        }\n    }\n};\n\nPromise.prototype._reject = function (reason) {\n    var bitField = this._bitField;\n    if (((bitField & 117506048) >>> 16)) return;\n    this._setRejected();\n    this._fulfillmentHandler0 = reason;\n\n    if (this._isFinal()) {\n        return async.fatalError(reason, util.isNode);\n    }\n\n    if ((bitField & 65535) > 0) {\n        if (((bitField & 134217728) !== 0)) {\n            this._settlePromises();\n        } else {\n            async.settlePromises(this);\n        }\n    } else {\n        this._ensurePossibleRejectionHandled();\n    }\n};\n\nPromise.prototype._fulfillPromises = function (len, value) {\n    for (var i = 1; i < len; i++) {\n        var handler = this._fulfillmentHandlerAt(i);\n        var promise = this._promiseAt(i);\n        var receiver = this._receiverAt(i);\n        this._clearCallbackDataAtIndex(i);\n        this._settlePromise(promise, handler, receiver, value);\n    }\n};\n\nPromise.prototype._rejectPromises = function (len, reason) {\n    for (var i = 1; i < len; i++) {\n        var handler = this._rejectionHandlerAt(i);\n        var promise = this._promiseAt(i);\n        var receiver = this._receiverAt(i);\n        this._clearCallbackDataAtIndex(i);\n        this._settlePromise(promise, handler, receiver, reason);\n    }\n};\n\nPromise.prototype._settlePromises = function () {\n    var bitField = this._bitField;\n    var len = (bitField & 65535);\n\n    if (len > 0) {\n        if (((bitField & 16842752) !== 0)) {\n            var reason = this._fulfillmentHandler0;\n            this._settlePromise0(this._rejectionHandler0, reason, bitField);\n            this._rejectPromises(len, reason);\n        } else {\n            var value = this._rejectionHandler0;\n            this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n            this._fulfillPromises(len, value);\n        }\n        this._setLength(0);\n    }\n    this._clearCancellationData();\n};\n\nPromise.prototype._settledValue = function() {\n    var bitField = this._bitField;\n    if (((bitField & 33554432) !== 0)) {\n        return this._rejectionHandler0;\n    } else if (((bitField & 16777216) !== 0)) {\n        return this._fulfillmentHandler0;\n    }\n};\n\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\n\nPromise.defer = Promise.pending = function() {\n    debug.deprecated("Promise.defer", "new Promise");\n    var promise = new Promise(INTERNAL);\n    return {\n        promise: promise,\n        resolve: deferResolve,\n        reject: deferReject\n    };\n};\n\nutil.notEnumerableProp(Promise,\n                       "_makeSelfResolutionError",\n                       makeSelfResolutionError);\n\n_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\n    debug);\n_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug);\n_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug);\n_dereq_("./direct_resolve")(Promise);\n_dereq_("./synchronous_inspection")(Promise);\n_dereq_("./join")(\n    Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug);\nPromise.Promise = Promise;\n_dereq_(\'./map.js\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_(\'./using.js\')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\n_dereq_(\'./timers.js\')(Promise, INTERNAL, debug);\n_dereq_(\'./generators.js\')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\n_dereq_(\'./nodeify.js\')(Promise);\n_dereq_(\'./call_get.js\')(Promise);\n_dereq_(\'./props.js\')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\n_dereq_(\'./race.js\')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\n_dereq_(\'./reduce.js\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_(\'./settle.js\')(Promise, PromiseArray, debug);\n_dereq_(\'./some.js\')(Promise, PromiseArray, apiRejection);\n_dereq_(\'./promisify.js\')(Promise, INTERNAL);\n_dereq_(\'./any.js\')(Promise);\n_dereq_(\'./each.js\')(Promise, INTERNAL);\n_dereq_(\'./filter.js\')(Promise, INTERNAL);\n                                                         \n    util.toFastProperties(Promise);                                          \n    util.toFastProperties(Promise.prototype);                                \n    function fillTypes(value) {                                              \n        var p = new Promise(INTERNAL);                                       \n        p._fulfillmentHandler0 = value;                                      \n        p._rejectionHandler0 = value;                                        \n        p._promise0 = value;                                                 \n        p._receiver0 = value;                                                \n    }                                                                        \n    // Complete slack tracking, opt out of field-type tracking and           \n    // stabilize map                                                         \n    fillTypes({a: 1});                                                       \n    fillTypes({b: 2});                                                       \n    fillTypes({c: 3});                                                       \n    fillTypes(1);                                                            \n    fillTypes(function(){});                                                 \n    fillTypes(undefined);                                                    \n    fillTypes(false);                                                        \n    fillTypes(new Promise(INTERNAL));                                        \n    debug.setBounds(Async.firstLineError, util.lastLineError);               \n    return Promise;                                                          \n\n};\n\n},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\n    apiRejection, Proxyable) {\nvar util = _dereq_("./util");\nvar isArray = util.isArray;\n\nfunction toResolutionValue(val) {\n    switch(val) {\n    case -2: return [];\n    case -3: return {};\n    }\n}\n\nfunction PromiseArray(values) {\n    var promise = this._promise = new Promise(INTERNAL);\n    if (values instanceof Promise) {\n        promise._propagateFrom(values, 3);\n    }\n    promise._setOnCancel(this);\n    this._values = values;\n    this._length = 0;\n    this._totalResolved = 0;\n    this._init(undefined, -2);\n}\nutil.inherits(PromiseArray, Proxyable);\n\nPromiseArray.prototype.length = function () {\n    return this._length;\n};\n\nPromiseArray.prototype.promise = function () {\n    return this._promise;\n};\n\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n    var values = tryConvertToPromise(this._values, this._promise);\n    if (values instanceof Promise) {\n        values = values._target();\n        var bitField = values._bitField;\n        ;\n        this._values = values;\n\n        if (((bitField & 50397184) === 0)) {\n            this._promise._setAsyncGuaranteed();\n            return values._then(\n                init,\n                this._reject,\n                undefined,\n                this,\n                resolveValueIfEmpty\n           );\n        } else if (((bitField & 33554432) !== 0)) {\n            values = values._value();\n        } else if (((bitField & 16777216) !== 0)) {\n            return this._reject(values._reason());\n        } else {\n            return this._cancel();\n        }\n    }\n    values = util.asArray(values);\n    if (values === null) {\n        var err = apiRejection(\n            "expecting an array or an iterable object but got " + util.classString(values)).reason();\n        this._promise._rejectCallback(err, false);\n        return;\n    }\n\n    if (values.length === 0) {\n        if (resolveValueIfEmpty === -5) {\n            this._resolveEmptyArray();\n        }\n        else {\n            this._resolve(toResolutionValue(resolveValueIfEmpty));\n        }\n        return;\n    }\n    this._iterate(values);\n};\n\nPromiseArray.prototype._iterate = function(values) {\n    var len = this.getActualLength(values.length);\n    this._length = len;\n    this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n    var result = this._promise;\n    var isResolved = false;\n    var bitField = null;\n    for (var i = 0; i < len; ++i) {\n        var maybePromise = tryConvertToPromise(values[i], result);\n\n        if (maybePromise instanceof Promise) {\n            maybePromise = maybePromise._target();\n            bitField = maybePromise._bitField;\n        } else {\n            bitField = null;\n        }\n\n        if (isResolved) {\n            if (bitField !== null) {\n                maybePromise.suppressUnhandledRejections();\n            }\n        } else if (bitField !== null) {\n            if (((bitField & 50397184) === 0)) {\n                maybePromise._proxy(this, i);\n                this._values[i] = maybePromise;\n            } else if (((bitField & 33554432) !== 0)) {\n                isResolved = this._promiseFulfilled(maybePromise._value(), i);\n            } else if (((bitField & 16777216) !== 0)) {\n                isResolved = this._promiseRejected(maybePromise._reason(), i);\n            } else {\n                isResolved = this._promiseCancelled(i);\n            }\n        } else {\n            isResolved = this._promiseFulfilled(maybePromise, i);\n        }\n    }\n    if (!isResolved) result._setAsyncGuaranteed();\n};\n\nPromiseArray.prototype._isResolved = function () {\n    return this._values === null;\n};\n\nPromiseArray.prototype._resolve = function (value) {\n    this._values = null;\n    this._promise._fulfill(value);\n};\n\nPromiseArray.prototype._cancel = function() {\n    if (this._isResolved() || !this._promise.isCancellable()) return;\n    this._values = null;\n    this._promise._cancel();\n};\n\nPromiseArray.prototype._reject = function (reason) {\n    this._values = null;\n    this._promise._rejectCallback(reason, false);\n};\n\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    this._values[index] = value;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        this._resolve(this._values);\n        return true;\n    }\n    return false;\n};\n\nPromiseArray.prototype._promiseCancelled = function() {\n    this._cancel();\n    return true;\n};\n\nPromiseArray.prototype._promiseRejected = function (reason) {\n    this._totalResolved++;\n    this._reject(reason);\n    return true;\n};\n\nPromiseArray.prototype._resultCancelled = function() {\n    if (this._isResolved()) return;\n    var values = this._values;\n    this._cancel();\n    if (values instanceof Promise) {\n        values.cancel();\n    } else {\n        for (var i = 0; i < values.length; ++i) {\n            if (values[i] instanceof Promise) {\n                values[i].cancel();\n            }\n        }\n    }\n};\n\nPromiseArray.prototype.shouldCopyValues = function () {\n    return true;\n};\n\nPromiseArray.prototype.getActualLength = function (len) {\n    return len;\n};\n\nreturn PromiseArray;\n};\n\n},{"./util":36}],24:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar THIS = {};\nvar util = _dereq_("./util");\nvar nodebackForPromise = _dereq_("./nodeback");\nvar withAppended = util.withAppended;\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar canEvaluate = util.canEvaluate;\nvar TypeError = _dereq_("./errors").TypeError;\nvar defaultSuffix = "Async";\nvar defaultPromisified = {__isPromisified__: true};\nvar noCopyProps = [\n    "arity",    "length",\n    "name",\n    "arguments",\n    "caller",\n    "callee",\n    "prototype",\n    "__isPromisified__"\n];\nvar noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");\n\nvar defaultFilter = function(name) {\n    return util.isIdentifier(name) &&\n        name.charAt(0) !== "_" &&\n        name !== "constructor";\n};\n\nfunction propsFilter(key) {\n    return !noCopyPropsPattern.test(key);\n}\n\nfunction isPromisified(fn) {\n    try {\n        return fn.__isPromisified__ === true;\n    }\n    catch (e) {\n        return false;\n    }\n}\n\nfunction hasPromisified(obj, key, suffix) {\n    var val = util.getDataPropertyOrDefault(obj, key + suffix,\n                                            defaultPromisified);\n    return val ? isPromisified(val) : false;\n}\nfunction checkValid(ret, suffix, suffixRegexp) {\n    for (var i = 0; i < ret.length; i += 2) {\n        var key = ret[i];\n        if (suffixRegexp.test(key)) {\n            var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");\n            for (var j = 0; j < ret.length; j += 2) {\n                if (ret[j] === keyWithoutAsyncSuffix) {\n                    throw new TypeError("Cannot promisify an API that has normal methods with \'%s\'-suffix\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a"\n                        .replace("%s", suffix));\n                }\n            }\n        }\n    }\n}\n\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\n    var keys = util.inheritedDataKeys(obj);\n    var ret = [];\n    for (var i = 0; i < keys.length; ++i) {\n        var key = keys[i];\n        var value = obj[key];\n        var passesDefaultFilter = filter === defaultFilter\n            ? true : defaultFilter(key, value, obj);\n        if (typeof value === "function" &&\n            !isPromisified(value) &&\n            !hasPromisified(obj, key, suffix) &&\n            filter(key, value, obj, passesDefaultFilter)) {\n            ret.push(key, value);\n        }\n    }\n    checkValid(ret, suffix, suffixRegexp);\n    return ret;\n}\n\nvar escapeIdentRegex = function(str) {\n    return str.replace(/([$])/, "\\\\$");\n};\n\nvar makeNodePromisifiedEval;\nif (false) {\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\n    var ret = [likelyArgumentCount];\n    var min = Math.max(0, likelyArgumentCount - 1 - 3);\n    for(var i = likelyArgumentCount - 1; i >= min; --i) {\n        ret.push(i);\n    }\n    for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\n        ret.push(i);\n    }\n    return ret;\n};\n\nvar argumentSequence = function(argumentCount) {\n    return util.filledRange(argumentCount, "_arg", "");\n};\n\nvar parameterDeclaration = function(parameterCount) {\n    return util.filledRange(\n        Math.max(parameterCount, 3), "_arg", "");\n};\n\nvar parameterCount = function(fn) {\n    if (typeof fn.length === "number") {\n        return Math.max(Math.min(fn.length, 1023 + 1), 0);\n    }\n    return 0;\n};\n\nmakeNodePromisifiedEval =\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\n    var newParameterCount = Math.max(0, parameterCount(fn) - 1);\n    var argumentOrder = switchCaseArgumentOrder(newParameterCount);\n    var shouldProxyThis = typeof callback === "string" || receiver === THIS;\n\n    function generateCallForArgumentCount(count) {\n        var args = argumentSequence(count).join(", ");\n        var comma = count > 0 ? ", " : "";\n        var ret;\n        if (shouldProxyThis) {\n            ret = "ret = callback.call(this, {{args}}, nodeback); break;\\n";\n        } else {\n            ret = receiver === undefined\n                ? "ret = callback({{args}}, nodeback); break;\\n"\n                : "ret = callback.call(receiver, {{args}}, nodeback); break;\\n";\n        }\n        return ret.replace("{{args}}", args).replace(", ", comma);\n    }\n\n    function generateArgumentSwitchCase() {\n        var ret = "";\n        for (var i = 0; i < argumentOrder.length; ++i) {\n            ret += "case " + argumentOrder[i] +":" +\n                generateCallForArgumentCount(argumentOrder[i]);\n        }\n\n        ret += "                                                             \\n\\\n        default:                                                             \\n\\\n            var args = new Array(len + 1);                                   \\n\\\n            var i = 0;                                                       \\n\\\n            for (var i = 0; i < len; ++i) {                                  \\n\\\n               args[i] = arguments[i];                                       \\n\\\n            }                                                                \\n\\\n            args[i] = nodeback;                                              \\n\\\n            [CodeForCall]                                                    \\n\\\n            break;                                                           \\n\\\n        ".replace("[CodeForCall]", (shouldProxyThis\n                                ? "ret = callback.apply(this, args);\\n"\n                                : "ret = callback.apply(receiver, args);\\n"));\n        return ret;\n    }\n\n    var getFunctionCode = typeof callback === "string"\n                                ? ("this != null ? this[\'"+callback+"\'] : fn")\n                                : "fn";\n    var body = "\'use strict\';                                                \\n\\\n        var ret = function (Parameters) {                                    \\n\\\n            \'use strict\';                                                    \\n\\\n            var len = arguments.length;                                      \\n\\\n            var promise = new Promise(INTERNAL);                             \\n\\\n            promise._captureStackTrace();                                    \\n\\\n            var nodeback = nodebackForPromise(promise, " + multiArgs + ");   \\n\\\n            var ret;                                                         \\n\\\n            var callback = tryCatch([GetFunctionCode]);                      \\n\\\n            switch(len) {                                                    \\n\\\n                [CodeForSwitchCase]                                          \\n\\\n            }                                                                \\n\\\n            if (ret === errorObj) {                                          \\n\\\n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\n\\\n            }                                                                \\n\\\n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \\n\\\n            return promise;                                                  \\n\\\n        };                                                                   \\n\\\n        notEnumerableProp(ret, \'__isPromisified__\', true);                   \\n\\\n        return ret;                                                          \\n\\\n    ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase())\n        .replace("[GetFunctionCode]", getFunctionCode);\n    body = body.replace("Parameters", parameterDeclaration(newParameterCount));\n    return new Function("Promise",\n                        "fn",\n                        "receiver",\n                        "withAppended",\n                        "maybeWrapAsError",\n                        "nodebackForPromise",\n                        "tryCatch",\n                        "errorObj",\n                        "notEnumerableProp",\n                        "INTERNAL",\n                        body)(\n                    Promise,\n                    fn,\n                    receiver,\n                    withAppended,\n                    maybeWrapAsError,\n                    nodebackForPromise,\n                    util.tryCatch,\n                    util.errorObj,\n                    util.notEnumerableProp,\n                    INTERNAL);\n};\n}\n\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\n    var defaultThis = (function() {return this;})();\n    var method = callback;\n    if (typeof method === "string") {\n        callback = fn;\n    }\n    function promisified() {\n        var _receiver = receiver;\n        if (receiver === THIS) _receiver = this;\n        var promise = new Promise(INTERNAL);\n        promise._captureStackTrace();\n        var cb = typeof method === "string" && this !== defaultThis\n            ? this[method] : callback;\n        var fn = nodebackForPromise(promise, multiArgs);\n        try {\n            cb.apply(_receiver, withAppended(arguments, fn));\n        } catch(e) {\n            promise._rejectCallback(maybeWrapAsError(e), true, true);\n        }\n        if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\n        return promise;\n    }\n    util.notEnumerableProp(promisified, "__isPromisified__", true);\n    return promisified;\n}\n\nvar makeNodePromisified = canEvaluate\n    ? makeNodePromisifiedEval\n    : makeNodePromisifiedClosure;\n\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\n    var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");\n    var methods =\n        promisifiableMethods(obj, suffix, suffixRegexp, filter);\n\n    for (var i = 0, len = methods.length; i < len; i+= 2) {\n        var key = methods[i];\n        var fn = methods[i+1];\n        var promisifiedKey = key + suffix;\n        if (promisifier === makeNodePromisified) {\n            obj[promisifiedKey] =\n                makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\n        } else {\n            var promisified = promisifier(fn, function() {\n                return makeNodePromisified(key, THIS, key,\n                                           fn, suffix, multiArgs);\n            });\n            util.notEnumerableProp(promisified, "__isPromisified__", true);\n            obj[promisifiedKey] = promisified;\n        }\n    }\n    util.toFastProperties(obj);\n    return obj;\n}\n\nfunction promisify(callback, receiver, multiArgs) {\n    return makeNodePromisified(callback, receiver, undefined,\n                                callback, null, multiArgs);\n}\n\nPromise.promisify = function (fn, options) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    if (isPromisified(fn)) {\n        return fn;\n    }\n    options = Object(options);\n    var receiver = options.context === undefined ? THIS : options.context;\n    var multiArgs = !!options.multiArgs;\n    var ret = promisify(fn, receiver, multiArgs);\n    util.copyDescriptors(fn, ret, propsFilter);\n    return ret;\n};\n\nPromise.promisifyAll = function (target, options) {\n    if (typeof target !== "function" && typeof target !== "object") {\n        throw new TypeError("the target of promisifyAll must be an object or a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    options = Object(options);\n    var multiArgs = !!options.multiArgs;\n    var suffix = options.suffix;\n    if (typeof suffix !== "string") suffix = defaultSuffix;\n    var filter = options.filter;\n    if (typeof filter !== "function") filter = defaultFilter;\n    var promisifier = options.promisifier;\n    if (typeof promisifier !== "function") promisifier = makeNodePromisified;\n\n    if (!util.isIdentifier(suffix)) {\n        throw new RangeError("suffix must be a valid identifier\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n\n    var keys = util.inheritedDataKeys(target);\n    for (var i = 0; i < keys.length; ++i) {\n        var value = target[keys[i]];\n        if (keys[i] !== "constructor" &&\n            util.isClass(value)) {\n            promisifyAll(value.prototype, suffix, filter, promisifier,\n                multiArgs);\n            promisifyAll(value, suffix, filter, promisifier, multiArgs);\n        }\n    }\n\n    return promisifyAll(target, suffix, filter, promisifier, multiArgs);\n};\n};\n\n\n},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(\n    Promise, PromiseArray, tryConvertToPromise, apiRejection) {\nvar util = _dereq_("./util");\nvar isObject = util.isObject;\nvar es5 = _dereq_("./es5");\nvar Es6Map;\nif (typeof Map === "function") Es6Map = Map;\n\nvar mapToEntries = (function() {\n    var index = 0;\n    var size = 0;\n\n    function extractEntry(value, key) {\n        this[index] = value;\n        this[index + size] = key;\n        index++;\n    }\n\n    return function mapToEntries(map) {\n        size = map.size;\n        index = 0;\n        var ret = new Array(map.size * 2);\n        map.forEach(extractEntry, ret);\n        return ret;\n    };\n})();\n\nvar entriesToMap = function(entries) {\n    var ret = new Es6Map();\n    var length = entries.length / 2 | 0;\n    for (var i = 0; i < length; ++i) {\n        var key = entries[length + i];\n        var value = entries[i];\n        ret.set(key, value);\n    }\n    return ret;\n};\n\nfunction PropertiesPromiseArray(obj) {\n    var isMap = false;\n    var entries;\n    if (Es6Map !== undefined && obj instanceof Es6Map) {\n        entries = mapToEntries(obj);\n        isMap = true;\n    } else {\n        var keys = es5.keys(obj);\n        var len = keys.length;\n        entries = new Array(len * 2);\n        for (var i = 0; i < len; ++i) {\n            var key = keys[i];\n            entries[i] = obj[key];\n            entries[i + len] = key;\n        }\n    }\n    this.constructor$(entries);\n    this._isMap = isMap;\n    this._init$(undefined, -3);\n}\nutil.inherits(PropertiesPromiseArray, PromiseArray);\n\nPropertiesPromiseArray.prototype._init = function () {};\n\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    this._values[index] = value;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        var val;\n        if (this._isMap) {\n            val = entriesToMap(this._values);\n        } else {\n            val = {};\n            var keyOffset = this.length();\n            for (var i = 0, len = this.length(); i < len; ++i) {\n                val[this._values[i + keyOffset]] = this._values[i];\n            }\n        }\n        this._resolve(val);\n        return true;\n    }\n    return false;\n};\n\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\n    return false;\n};\n\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\n    return len >> 1;\n};\n\nfunction props(promises) {\n    var ret;\n    var castValue = tryConvertToPromise(promises);\n\n    if (!isObject(castValue)) {\n        return apiRejection("cannot await properties of a non-object\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    } else if (castValue instanceof Promise) {\n        ret = castValue._then(\n            Promise.props, undefined, undefined, undefined, undefined);\n    } else {\n        ret = new PropertiesPromiseArray(castValue).promise();\n    }\n\n    if (castValue instanceof Promise) {\n        ret._propagateFrom(castValue, 2);\n    }\n    return ret;\n}\n\nPromise.prototype.props = function () {\n    return props(this);\n};\n\nPromise.props = function (promises) {\n    return props(promises);\n};\n};\n\n},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){\n"use strict";\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\n    for (var j = 0; j < len; ++j) {\n        dst[j + dstIndex] = src[j + srcIndex];\n        src[j + srcIndex] = void 0;\n    }\n}\n\nfunction Queue(capacity) {\n    this._capacity = capacity;\n    this._length = 0;\n    this._front = 0;\n}\n\nQueue.prototype._willBeOverCapacity = function (size) {\n    return this._capacity < size;\n};\n\nQueue.prototype._pushOne = function (arg) {\n    var length = this.length();\n    this._checkCapacity(length + 1);\n    var i = (this._front + length) & (this._capacity - 1);\n    this[i] = arg;\n    this._length = length + 1;\n};\n\nQueue.prototype._unshiftOne = function(value) {\n    var capacity = this._capacity;\n    this._checkCapacity(this.length() + 1);\n    var front = this._front;\n    var i = (((( front - 1 ) &\n                    ( capacity - 1) ) ^ capacity ) - capacity );\n    this[i] = value;\n    this._front = i;\n    this._length = this.length() + 1;\n};\n\nQueue.prototype.unshift = function(fn, receiver, arg) {\n    this._unshiftOne(arg);\n    this._unshiftOne(receiver);\n    this._unshiftOne(fn);\n};\n\nQueue.prototype.push = function (fn, receiver, arg) {\n    var length = this.length() + 3;\n    if (this._willBeOverCapacity(length)) {\n        this._pushOne(fn);\n        this._pushOne(receiver);\n        this._pushOne(arg);\n        return;\n    }\n    var j = this._front + length - 3;\n    this._checkCapacity(length);\n    var wrapMask = this._capacity - 1;\n    this[(j + 0) & wrapMask] = fn;\n    this[(j + 1) & wrapMask] = receiver;\n    this[(j + 2) & wrapMask] = arg;\n    this._length = length;\n};\n\nQueue.prototype.shift = function () {\n    var front = this._front,\n        ret = this[front];\n\n    this[front] = undefined;\n    this._front = (front + 1) & (this._capacity - 1);\n    this._length--;\n    return ret;\n};\n\nQueue.prototype.length = function () {\n    return this._length;\n};\n\nQueue.prototype._checkCapacity = function (size) {\n    if (this._capacity < size) {\n        this._resizeTo(this._capacity << 1);\n    }\n};\n\nQueue.prototype._resizeTo = function (capacity) {\n    var oldCapacity = this._capacity;\n    this._capacity = capacity;\n    var front = this._front;\n    var length = this._length;\n    var moveItemsCount = (front + length) & (oldCapacity - 1);\n    arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n};\n\nmodule.exports = Queue;\n\n},{}],27:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(\n    Promise, INTERNAL, tryConvertToPromise, apiRejection) {\nvar util = _dereq_("./util");\n\nvar raceLater = function (promise) {\n    return promise.then(function(array) {\n        return race(array, promise);\n    });\n};\n\nfunction race(promises, parent) {\n    var maybePromise = tryConvertToPromise(promises);\n\n    if (maybePromise instanceof Promise) {\n        return raceLater(maybePromise);\n    } else {\n        promises = util.asArray(promises);\n        if (promises === null)\n            return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));\n    }\n\n    var ret = new Promise(INTERNAL);\n    if (parent !== undefined) {\n        ret._propagateFrom(parent, 3);\n    }\n    var fulfill = ret._fulfill;\n    var reject = ret._reject;\n    for (var i = 0, len = promises.length; i < len; ++i) {\n        var val = promises[i];\n\n        if (val === undefined && !(i in promises)) {\n            continue;\n        }\n\n        Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\n    }\n    return ret;\n}\n\nPromise.race = function (promises) {\n    return race(promises, undefined);\n};\n\nPromise.prototype.race = function () {\n    return race(this, undefined);\n};\n\n};\n\n},{"./util":36}],28:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          PromiseArray,\n                          apiRejection,\n                          tryConvertToPromise,\n                          INTERNAL,\n                          debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\n\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\n    this.constructor$(promises);\n    var domain = getDomain();\n    this._fn = domain === null ? fn : domain.bind(fn);\n    if (initialValue !== undefined) {\n        initialValue = Promise.resolve(initialValue);\n        initialValue._attachCancellationCallback(this);\n    }\n    this._initialValue = initialValue;\n    this._currentCancellable = null;\n    this._eachValues = _each === INTERNAL ? [] : undefined;\n    this._promise._captureStackTrace();\n    this._init$(undefined, -5);\n}\nutil.inherits(ReductionPromiseArray, PromiseArray);\n\nReductionPromiseArray.prototype._gotAccum = function(accum) {\n    if (this._eachValues !== undefined && accum !== INTERNAL) {\n        this._eachValues.push(accum);\n    }\n};\n\nReductionPromiseArray.prototype._eachComplete = function(value) {\n    this._eachValues.push(value);\n    return this._eachValues;\n};\n\nReductionPromiseArray.prototype._init = function() {};\n\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\n    this._resolve(this._eachValues !== undefined ? this._eachValues\n                                                 : this._initialValue);\n};\n\nReductionPromiseArray.prototype.shouldCopyValues = function () {\n    return false;\n};\n\nReductionPromiseArray.prototype._resolve = function(value) {\n    this._promise._resolveCallback(value);\n    this._values = null;\n};\n\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\n    if (sender === this._initialValue) return this._cancel();\n    if (this._isResolved()) return;\n    this._resultCancelled$();\n    if (this._currentCancellable instanceof Promise) {\n        this._currentCancellable.cancel();\n    }\n    if (this._initialValue instanceof Promise) {\n        this._initialValue.cancel();\n    }\n};\n\nReductionPromiseArray.prototype._iterate = function (values) {\n    this._values = values;\n    var value;\n    var i;\n    var length = values.length;\n    if (this._initialValue !== undefined) {\n        value = this._initialValue;\n        i = 0;\n    } else {\n        value = Promise.resolve(values[0]);\n        i = 1;\n    }\n\n    this._currentCancellable = value;\n\n    if (!value.isRejected()) {\n        for (; i < length; ++i) {\n            var ctx = {\n                accum: null,\n                value: values[i],\n                index: i,\n                length: length,\n                array: this\n            };\n            value = value._then(gotAccum, undefined, undefined, ctx, undefined);\n        }\n    }\n\n    if (this._eachValues !== undefined) {\n        value = value\n            ._then(this._eachComplete, undefined, undefined, this, undefined);\n    }\n    value._then(completed, completed, undefined, value, this);\n};\n\nPromise.prototype.reduce = function (fn, initialValue) {\n    return reduce(this, fn, initialValue, null);\n};\n\nPromise.reduce = function (promises, fn, initialValue, _each) {\n    return reduce(promises, fn, initialValue, _each);\n};\n\nfunction completed(valueOrReason, array) {\n    if (this.isFulfilled()) {\n        array._resolve(valueOrReason);\n    } else {\n        array._reject(valueOrReason);\n    }\n}\n\nfunction reduce(promises, fn, initialValue, _each) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\n    return array.promise();\n}\n\nfunction gotAccum(accum) {\n    this.accum = accum;\n    this.array._gotAccum(accum);\n    var value = tryConvertToPromise(this.value, this.array._promise);\n    if (value instanceof Promise) {\n        this.array._currentCancellable = value;\n        return value._then(gotValue, undefined, undefined, this, undefined);\n    } else {\n        return gotValue.call(this, value);\n    }\n}\n\nfunction gotValue(value) {\n    var array = this.array;\n    var promise = array._promise;\n    var fn = tryCatch(array._fn);\n    promise._pushContext();\n    var ret;\n    if (array._eachValues !== undefined) {\n        ret = fn.call(promise._boundValue(), value, this.index, this.length);\n    } else {\n        ret = fn.call(promise._boundValue(),\n                              this.accum, value, this.index, this.length);\n    }\n    if (ret instanceof Promise) {\n        array._currentCancellable = ret;\n    }\n    var promiseCreated = promise._popContext();\n    debug.checkForgottenReturns(\n        ret,\n        promiseCreated,\n        array._eachValues !== undefined ? "Promise.each" : "Promise.reduce",\n        promise\n    );\n    return ret;\n}\n};\n\n},{"./util":36}],29:[function(_dereq_,module,exports){\n"use strict";\nvar util = _dereq_("./util");\nvar schedule;\nvar noAsyncScheduler = function() {\n    throw new Error("No async scheduler available\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n};\nif (util.isNode && typeof MutationObserver === "undefined") {\n    var GlobalSetImmediate = global.setImmediate;\n    var ProcessNextTick = process.nextTick;\n    schedule = util.isRecentNode\n                ? function(fn) { GlobalSetImmediate.call(global, fn); }\n                : function(fn) { ProcessNextTick.call(process, fn); };\n} else if ((typeof MutationObserver !== "undefined") &&\n          !(typeof window !== "undefined" &&\n            window.navigator &&\n            window.navigator.standalone)) {\n    schedule = (function() {\n        var div = document.createElement("div");\n        var opts = {attributes: true};\n        var toggleScheduled = false;\n        var div2 = document.createElement("div");\n        var o2 = new MutationObserver(function() {\n            div.classList.toggle("foo");\n          toggleScheduled = false;\n        });\n        o2.observe(div2, opts);\n\n        var scheduleToggle = function() {\n            if (toggleScheduled) return;\n          toggleScheduled = true;\n          div2.classList.toggle("foo");\n        };\n\n        return function schedule(fn) {\n          var o = new MutationObserver(function() {\n            o.disconnect();\n            fn();\n          });\n          o.observe(div, opts);\n          scheduleToggle();\n        };\n    })();\n} else if (typeof setImmediate !== "undefined") {\n    schedule = function (fn) {\n        setImmediate(fn);\n    };\n} else if (typeof setTimeout !== "undefined") {\n    schedule = function (fn) {\n        setTimeout(fn, 0);\n    };\n} else {\n    schedule = noAsyncScheduler;\n}\nmodule.exports = schedule;\n\n},{"./util":36}],30:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\n    function(Promise, PromiseArray, debug) {\nvar PromiseInspection = Promise.PromiseInspection;\nvar util = _dereq_("./util");\n\nfunction SettledPromiseArray(values) {\n    this.constructor$(values);\n}\nutil.inherits(SettledPromiseArray, PromiseArray);\n\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\n    this._values[index] = inspection;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        this._resolve(this._values);\n        return true;\n    }\n    return false;\n};\n\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    var ret = new PromiseInspection();\n    ret._bitField = 33554432;\n    ret._settledValueField = value;\n    return this._promiseResolved(index, ret);\n};\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\n    var ret = new PromiseInspection();\n    ret._bitField = 16777216;\n    ret._settledValueField = reason;\n    return this._promiseResolved(index, ret);\n};\n\nPromise.settle = function (promises) {\n    debug.deprecated(".settle()", ".reflect()");\n    return new SettledPromiseArray(promises).promise();\n};\n\nPromise.prototype.settle = function () {\n    return Promise.settle(this);\n};\n};\n\n},{"./util":36}],31:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, PromiseArray, apiRejection) {\nvar util = _dereq_("./util");\nvar RangeError = _dereq_("./errors").RangeError;\nvar AggregateError = _dereq_("./errors").AggregateError;\nvar isArray = util.isArray;\nvar CANCELLATION = {};\n\n\nfunction SomePromiseArray(values) {\n    this.constructor$(values);\n    this._howMany = 0;\n    this._unwrap = false;\n    this._initialized = false;\n}\nutil.inherits(SomePromiseArray, PromiseArray);\n\nSomePromiseArray.prototype._init = function () {\n    if (!this._initialized) {\n        return;\n    }\n    if (this._howMany === 0) {\n        this._resolve([]);\n        return;\n    }\n    this._init$(undefined, -5);\n    var isArrayResolved = isArray(this._values);\n    if (!this._isResolved() &&\n        isArrayResolved &&\n        this._howMany > this._canPossiblyFulfill()) {\n        this._reject(this._getRangeError(this.length()));\n    }\n};\n\nSomePromiseArray.prototype.init = function () {\n    this._initialized = true;\n    this._init();\n};\n\nSomePromiseArray.prototype.setUnwrap = function () {\n    this._unwrap = true;\n};\n\nSomePromiseArray.prototype.howMany = function () {\n    return this._howMany;\n};\n\nSomePromiseArray.prototype.setHowMany = function (count) {\n    this._howMany = count;\n};\n\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\n    this._addFulfilled(value);\n    if (this._fulfilled() === this.howMany()) {\n        this._values.length = this.howMany();\n        if (this.howMany() === 1 && this._unwrap) {\n            this._resolve(this._values[0]);\n        } else {\n            this._resolve(this._values);\n        }\n        return true;\n    }\n    return false;\n\n};\nSomePromiseArray.prototype._promiseRejected = function (reason) {\n    this._addRejected(reason);\n    return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._promiseCancelled = function () {\n    if (this._values instanceof Promise || this._values == null) {\n        return this._cancel();\n    }\n    this._addRejected(CANCELLATION);\n    return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._checkOutcome = function() {\n    if (this.howMany() > this._canPossiblyFulfill()) {\n        var e = new AggregateError();\n        for (var i = this.length(); i < this._values.length; ++i) {\n            if (this._values[i] !== CANCELLATION) {\n                e.push(this._values[i]);\n            }\n        }\n        if (e.length > 0) {\n            this._reject(e);\n        } else {\n            this._cancel();\n        }\n        return true;\n    }\n    return false;\n};\n\nSomePromiseArray.prototype._fulfilled = function () {\n    return this._totalResolved;\n};\n\nSomePromiseArray.prototype._rejected = function () {\n    return this._values.length - this.length();\n};\n\nSomePromiseArray.prototype._addRejected = function (reason) {\n    this._values.push(reason);\n};\n\nSomePromiseArray.prototype._addFulfilled = function (value) {\n    this._values[this._totalResolved++] = value;\n};\n\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\n    return this.length() - this._rejected();\n};\n\nSomePromiseArray.prototype._getRangeError = function (count) {\n    var message = "Input array must contain at least " +\n            this._howMany + " items but contains only " + count + " items";\n    return new RangeError(message);\n};\n\nSomePromiseArray.prototype._resolveEmptyArray = function () {\n    this._reject(this._getRangeError(0));\n};\n\nfunction some(promises, howMany) {\n    if ((howMany | 0) !== howMany || howMany < 0) {\n        return apiRejection("expecting a positive integer\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var ret = new SomePromiseArray(promises);\n    var promise = ret.promise();\n    ret.setHowMany(howMany);\n    ret.init();\n    return promise;\n}\n\nPromise.some = function (promises, howMany) {\n    return some(promises, howMany);\n};\n\nPromise.prototype.some = function (howMany) {\n    return some(this, howMany);\n};\n\nPromise._SomePromiseArray = SomePromiseArray;\n};\n\n},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nfunction PromiseInspection(promise) {\n    if (promise !== undefined) {\n        promise = promise._target();\n        this._bitField = promise._bitField;\n        this._settledValueField = promise._isFateSealed()\n            ? promise._settledValue() : undefined;\n    }\n    else {\n        this._bitField = 0;\n        this._settledValueField = undefined;\n    }\n}\n\nPromiseInspection.prototype._settledValue = function() {\n    return this._settledValueField;\n};\n\nvar value = PromiseInspection.prototype.value = function () {\n    if (!this.isFulfilled()) {\n        throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    return this._settledValue();\n};\n\nvar reason = PromiseInspection.prototype.error =\nPromiseInspection.prototype.reason = function () {\n    if (!this.isRejected()) {\n        throw new TypeError("cannot get rejection reason of a non-rejected promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    return this._settledValue();\n};\n\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\n    return (this._bitField & 33554432) !== 0;\n};\n\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\n    return (this._bitField & 16777216) !== 0;\n};\n\nvar isPending = PromiseInspection.prototype.isPending = function () {\n    return (this._bitField & 50397184) === 0;\n};\n\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\n    return (this._bitField & 50331648) !== 0;\n};\n\nPromiseInspection.prototype.isCancelled =\nPromise.prototype._isCancelled = function() {\n    return (this._bitField & 65536) === 65536;\n};\n\nPromise.prototype.isCancelled = function() {\n    return this._target()._isCancelled();\n};\n\nPromise.prototype.isPending = function() {\n    return isPending.call(this._target());\n};\n\nPromise.prototype.isRejected = function() {\n    return isRejected.call(this._target());\n};\n\nPromise.prototype.isFulfilled = function() {\n    return isFulfilled.call(this._target());\n};\n\nPromise.prototype.isResolved = function() {\n    return isResolved.call(this._target());\n};\n\nPromise.prototype.value = function() {\n    return value.call(this._target());\n};\n\nPromise.prototype.reason = function() {\n    var target = this._target();\n    target._unsetRejectionIsUnhandled();\n    return reason.call(target);\n};\n\nPromise.prototype._value = function() {\n    return this._settledValue();\n};\n\nPromise.prototype._reason = function() {\n    this._unsetRejectionIsUnhandled();\n    return this._settledValue();\n};\n\nPromise.PromiseInspection = PromiseInspection;\n};\n\n},{}],33:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar util = _dereq_("./util");\nvar errorObj = util.errorObj;\nvar isObject = util.isObject;\n\nfunction tryConvertToPromise(obj, context) {\n    if (isObject(obj)) {\n        if (obj instanceof Promise) return obj;\n        var then = getThen(obj);\n        if (then === errorObj) {\n            if (context) context._pushContext();\n            var ret = Promise.reject(then.e);\n            if (context) context._popContext();\n            return ret;\n        } else if (typeof then === "function") {\n            if (isAnyBluebirdPromise(obj)) {\n                var ret = new Promise(INTERNAL);\n                obj._then(\n                    ret._fulfill,\n                    ret._reject,\n                    undefined,\n                    ret,\n                    null\n                );\n                return ret;\n            }\n            return doThenable(obj, then, context);\n        }\n    }\n    return obj;\n}\n\nfunction doGetThen(obj) {\n    return obj.then;\n}\n\nfunction getThen(obj) {\n    try {\n        return doGetThen(obj);\n    } catch (e) {\n        errorObj.e = e;\n        return errorObj;\n    }\n}\n\nvar hasProp = {}.hasOwnProperty;\nfunction isAnyBluebirdPromise(obj) {\n    return hasProp.call(obj, "_promise0");\n}\n\nfunction doThenable(x, then, context) {\n    var promise = new Promise(INTERNAL);\n    var ret = promise;\n    if (context) context._pushContext();\n    promise._captureStackTrace();\n    if (context) context._popContext();\n    var synchronous = true;\n    var result = util.tryCatch(then).call(x, resolve, reject);\n    synchronous = false;\n\n    if (promise && result === errorObj) {\n        promise._rejectCallback(result.e, true, true);\n        promise = null;\n    }\n\n    function resolve(value) {\n        if (!promise) return;\n        promise._resolveCallback(value);\n        promise = null;\n    }\n\n    function reject(reason) {\n        if (!promise) return;\n        promise._rejectCallback(reason, synchronous, true);\n        promise = null;\n    }\n    return ret;\n}\n\nreturn tryConvertToPromise;\n};\n\n},{"./util":36}],34:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, debug) {\nvar util = _dereq_("./util");\nvar TimeoutError = Promise.TimeoutError;\n\nfunction HandleWrapper(handle)  {\n    this.handle = handle;\n}\n\nHandleWrapper.prototype._resultCancelled = function() {\n    clearTimeout(this.handle);\n};\n\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\nvar delay = Promise.delay = function (ms, value) {\n    var ret;\n    var handle;\n    if (value !== undefined) {\n        ret = Promise.resolve(value)\n                ._then(afterValue, null, null, ms, undefined);\n        if (debug.cancellation() && value instanceof Promise) {\n            ret._setOnCancel(value);\n        }\n    } else {\n        ret = new Promise(INTERNAL);\n        handle = setTimeout(function() { ret._fulfill(); }, +ms);\n        if (debug.cancellation()) {\n            ret._setOnCancel(new HandleWrapper(handle));\n        }\n    }\n    ret._setAsyncGuaranteed();\n    return ret;\n};\n\nPromise.prototype.delay = function (ms) {\n    return delay(ms, this);\n};\n\nvar afterTimeout = function (promise, message, parent) {\n    var err;\n    if (typeof message !== "string") {\n        if (message instanceof Error) {\n            err = message;\n        } else {\n            err = new TimeoutError("operation timed out");\n        }\n    } else {\n        err = new TimeoutError(message);\n    }\n    util.markAsOriginatingFromRejection(err);\n    promise._attachExtraTrace(err);\n    promise._reject(err);\n\n    if (parent != null) {\n        parent.cancel();\n    }\n};\n\nfunction successClear(value) {\n    clearTimeout(this.handle);\n    return value;\n}\n\nfunction failureClear(reason) {\n    clearTimeout(this.handle);\n    throw reason;\n}\n\nPromise.prototype.timeout = function (ms, message) {\n    ms = +ms;\n    var ret, parent;\n\n    var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\n        if (ret.isPending()) {\n            afterTimeout(ret, message, parent);\n        }\n    }, ms));\n\n    if (debug.cancellation()) {\n        parent = this.then();\n        ret = parent._then(successClear, failureClear,\n                            undefined, handleWrapper, undefined);\n        ret._setOnCancel(handleWrapper);\n    } else {\n        ret = this._then(successClear, failureClear,\n                            undefined, handleWrapper, undefined);\n    }\n\n    return ret;\n};\n\n};\n\n},{"./util":36}],35:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\n    createContext, INTERNAL, debug) {\n    var util = _dereq_("./util");\n    var TypeError = _dereq_("./errors").TypeError;\n    var inherits = _dereq_("./util").inherits;\n    var errorObj = util.errorObj;\n    var tryCatch = util.tryCatch;\n\n    function thrower(e) {\n        setTimeout(function(){throw e;}, 0);\n    }\n\n    function castPreservingDisposable(thenable) {\n        var maybePromise = tryConvertToPromise(thenable);\n        if (maybePromise !== thenable &&\n            typeof thenable._isDisposable === "function" &&\n            typeof thenable._getDisposer === "function" &&\n            thenable._isDisposable()) {\n            maybePromise._setDisposable(thenable._getDisposer());\n        }\n        return maybePromise;\n    }\n    function dispose(resources, inspection) {\n        var i = 0;\n        var len = resources.length;\n        var ret = new Promise(INTERNAL);\n        function iterator() {\n            if (i >= len) return ret._fulfill();\n            var maybePromise = castPreservingDisposable(resources[i++]);\n            if (maybePromise instanceof Promise &&\n                maybePromise._isDisposable()) {\n                try {\n                    maybePromise = tryConvertToPromise(\n                        maybePromise._getDisposer().tryDispose(inspection),\n                        resources.promise);\n                } catch (e) {\n                    return thrower(e);\n                }\n                if (maybePromise instanceof Promise) {\n                    return maybePromise._then(iterator, thrower,\n                                              null, null, null);\n                }\n            }\n            iterator();\n        }\n        iterator();\n        return ret;\n    }\n\n    function Disposer(data, promise, context) {\n        this._data = data;\n        this._promise = promise;\n        this._context = context;\n    }\n\n    Disposer.prototype.data = function () {\n        return this._data;\n    };\n\n    Disposer.prototype.promise = function () {\n        return this._promise;\n    };\n\n    Disposer.prototype.resource = function () {\n        if (this.promise().isFulfilled()) {\n            return this.promise().value();\n        }\n        return null;\n    };\n\n    Disposer.prototype.tryDispose = function(inspection) {\n        var resource = this.resource();\n        var context = this._context;\n        if (context !== undefined) context._pushContext();\n        var ret = resource !== null\n            ? this.doDispose(resource, inspection) : null;\n        if (context !== undefined) context._popContext();\n        this._promise._unsetDisposable();\n        this._data = null;\n        return ret;\n    };\n\n    Disposer.isDisposer = function (d) {\n        return (d != null &&\n                typeof d.resource === "function" &&\n                typeof d.tryDispose === "function");\n    };\n\n    function FunctionDisposer(fn, promise, context) {\n        this.constructor$(fn, promise, context);\n    }\n    inherits(FunctionDisposer, Disposer);\n\n    FunctionDisposer.prototype.doDispose = function (resource, inspection) {\n        var fn = this.data();\n        return fn.call(resource, resource, inspection);\n    };\n\n    function maybeUnwrapDisposer(value) {\n        if (Disposer.isDisposer(value)) {\n            this.resources[this.index]._setDisposable(value);\n            return value.promise();\n        }\n        return value;\n    }\n\n    function ResourceList(length) {\n        this.length = length;\n        this.promise = null;\n        this[length-1] = null;\n    }\n\n    ResourceList.prototype._resultCancelled = function() {\n        var len = this.length;\n        for (var i = 0; i < len; ++i) {\n            var item = this[i];\n            if (item instanceof Promise) {\n                item.cancel();\n            }\n        }\n    };\n\n    Promise.using = function () {\n        var len = arguments.length;\n        if (len < 2) return apiRejection(\n                        "you must pass at least 2 arguments to Promise.using");\n        var fn = arguments[len - 1];\n        if (typeof fn !== "function") {\n            return apiRejection("expecting a function but got " + util.classString(fn));\n        }\n        var input;\n        var spreadArgs = true;\n        if (len === 2 && Array.isArray(arguments[0])) {\n            input = arguments[0];\n            len = input.length;\n            spreadArgs = false;\n        } else {\n            input = arguments;\n            len--;\n        }\n        var resources = new ResourceList(len);\n        for (var i = 0; i < len; ++i) {\n            var resource = input[i];\n            if (Disposer.isDisposer(resource)) {\n                var disposer = resource;\n                resource = resource.promise();\n                resource._setDisposable(disposer);\n            } else {\n                var maybePromise = tryConvertToPromise(resource);\n                if (maybePromise instanceof Promise) {\n                    resource =\n                        maybePromise._then(maybeUnwrapDisposer, null, null, {\n                            resources: resources,\n                            index: i\n                    }, undefined);\n                }\n            }\n            resources[i] = resource;\n        }\n\n        var reflectedResources = new Array(resources.length);\n        for (var i = 0; i < reflectedResources.length; ++i) {\n            reflectedResources[i] = Promise.resolve(resources[i]).reflect();\n        }\n\n        var resultPromise = Promise.all(reflectedResources)\n            .then(function(inspections) {\n                for (var i = 0; i < inspections.length; ++i) {\n                    var inspection = inspections[i];\n                    if (inspection.isRejected()) {\n                        errorObj.e = inspection.error();\n                        return errorObj;\n                    } else if (!inspection.isFulfilled()) {\n                        resultPromise.cancel();\n                        return;\n                    }\n                    inspections[i] = inspection.value();\n                }\n                promise._pushContext();\n\n                fn = tryCatch(fn);\n                var ret = spreadArgs\n                    ? fn.apply(undefined, inspections) : fn(inspections);\n                var promiseCreated = promise._popContext();\n                debug.checkForgottenReturns(\n                    ret, promiseCreated, "Promise.using", promise);\n                return ret;\n            });\n\n        var promise = resultPromise.lastly(function() {\n            var inspection = new Promise.PromiseInspection(resultPromise);\n            return dispose(resources, inspection);\n        });\n        resources.promise = promise;\n        promise._setOnCancel(resources);\n        return promise;\n    };\n\n    Promise.prototype._setDisposable = function (disposer) {\n        this._bitField = this._bitField | 131072;\n        this._disposer = disposer;\n    };\n\n    Promise.prototype._isDisposable = function () {\n        return (this._bitField & 131072) > 0;\n    };\n\n    Promise.prototype._getDisposer = function () {\n        return this._disposer;\n    };\n\n    Promise.prototype._unsetDisposable = function () {\n        this._bitField = this._bitField & (~131072);\n        this._disposer = undefined;\n    };\n\n    Promise.prototype.disposer = function (fn) {\n        if (typeof fn === "function") {\n            return new FunctionDisposer(fn, this, createContext());\n        }\n        throw new TypeError();\n    };\n\n};\n\n},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){\n"use strict";\nvar es5 = _dereq_("./es5");\nvar canEvaluate = typeof navigator == "undefined";\n\nvar errorObj = {e: {}};\nvar tryCatchTarget;\nvar globalObject = typeof self !== "undefined" ? self :\n    typeof window !== "undefined" ? window :\n    typeof global !== "undefined" ? global :\n    this !== undefined ? this : null;\n\nfunction tryCatcher() {\n    try {\n        var target = tryCatchTarget;\n        tryCatchTarget = null;\n        return target.apply(this, arguments);\n    } catch (e) {\n        errorObj.e = e;\n        return errorObj;\n    }\n}\nfunction tryCatch(fn) {\n    tryCatchTarget = fn;\n    return tryCatcher;\n}\n\nvar inherits = function(Child, Parent) {\n    var hasProp = {}.hasOwnProperty;\n\n    function T() {\n        this.constructor = Child;\n        this.constructor$ = Parent;\n        for (var propertyName in Parent.prototype) {\n            if (hasProp.call(Parent.prototype, propertyName) &&\n                propertyName.charAt(propertyName.length-1) !== "$"\n           ) {\n                this[propertyName + "$"] = Parent.prototype[propertyName];\n            }\n        }\n    }\n    T.prototype = Parent.prototype;\n    Child.prototype = new T();\n    return Child.prototype;\n};\n\n\nfunction isPrimitive(val) {\n    return val == null || val === true || val === false ||\n        typeof val === "string" || typeof val === "number";\n\n}\n\nfunction isObject(value) {\n    return typeof value === "function" ||\n           typeof value === "object" && value !== null;\n}\n\nfunction maybeWrapAsError(maybeError) {\n    if (!isPrimitive(maybeError)) return maybeError;\n\n    return new Error(safeToString(maybeError));\n}\n\nfunction withAppended(target, appendee) {\n    var len = target.length;\n    var ret = new Array(len + 1);\n    var i;\n    for (i = 0; i < len; ++i) {\n        ret[i] = target[i];\n    }\n    ret[i] = appendee;\n    return ret;\n}\n\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\n    if (es5.isES5) {\n        var desc = Object.getOwnPropertyDescriptor(obj, key);\n\n        if (desc != null) {\n            return desc.get == null && desc.set == null\n                    ? desc.value\n                    : defaultValue;\n        }\n    } else {\n        return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n    }\n}\n\nfunction notEnumerableProp(obj, name, value) {\n    if (isPrimitive(obj)) return obj;\n    var descriptor = {\n        value: value,\n        configurable: true,\n        enumerable: false,\n        writable: true\n    };\n    es5.defineProperty(obj, name, descriptor);\n    return obj;\n}\n\nfunction thrower(r) {\n    throw r;\n}\n\nvar inheritedDataKeys = (function() {\n    var excludedPrototypes = [\n        Array.prototype,\n        Object.prototype,\n        Function.prototype\n    ];\n\n    var isExcludedProto = function(val) {\n        for (var i = 0; i < excludedPrototypes.length; ++i) {\n            if (excludedPrototypes[i] === val) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    if (es5.isES5) {\n        var getKeys = Object.getOwnPropertyNames;\n        return function(obj) {\n            var ret = [];\n            var visitedKeys = Object.create(null);\n            while (obj != null && !isExcludedProto(obj)) {\n                var keys;\n                try {\n                    keys = getKeys(obj);\n                } catch (e) {\n                    return ret;\n                }\n                for (var i = 0; i < keys.length; ++i) {\n                    var key = keys[i];\n                    if (visitedKeys[key]) continue;\n                    visitedKeys[key] = true;\n                    var desc = Object.getOwnPropertyDescriptor(obj, key);\n                    if (desc != null && desc.get == null && desc.set == null) {\n                        ret.push(key);\n                    }\n                }\n                obj = es5.getPrototypeOf(obj);\n            }\n            return ret;\n        };\n    } else {\n        var hasProp = {}.hasOwnProperty;\n        return function(obj) {\n            if (isExcludedProto(obj)) return [];\n            var ret = [];\n\n            /*jshint forin:false */\n            enumeration: for (var key in obj) {\n                if (hasProp.call(obj, key)) {\n                    ret.push(key);\n                } else {\n                    for (var i = 0; i < excludedPrototypes.length; ++i) {\n                        if (hasProp.call(excludedPrototypes[i], key)) {\n                            continue enumeration;\n                        }\n                    }\n                    ret.push(key);\n                }\n            }\n            return ret;\n        };\n    }\n\n})();\n\nvar thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\nfunction isClass(fn) {\n    try {\n        if (typeof fn === "function") {\n            var keys = es5.names(fn.prototype);\n\n            var hasMethods = es5.isES5 && keys.length > 1;\n            var hasMethodsOtherThanConstructor = keys.length > 0 &&\n                !(keys.length === 1 && keys[0] === "constructor");\n            var hasThisAssignmentAndStaticMethods =\n                thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;\n\n            if (hasMethods || hasMethodsOtherThanConstructor ||\n                hasThisAssignmentAndStaticMethods) {\n                return true;\n            }\n        }\n        return false;\n    } catch (e) {\n        return false;\n    }\n}\n\nfunction toFastProperties(obj) {\n    /*jshint -W027,-W055,-W031*/\n    function FakeConstructor() {}\n    FakeConstructor.prototype = obj;\n    var l = 8;\n    while (l--) new FakeConstructor();\n    return obj;\n    eval(obj);\n}\n\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\nfunction isIdentifier(str) {\n    return rident.test(str);\n}\n\nfunction filledRange(count, prefix, suffix) {\n    var ret = new Array(count);\n    for(var i = 0; i < count; ++i) {\n        ret[i] = prefix + i + suffix;\n    }\n    return ret;\n}\n\nfunction safeToString(obj) {\n    try {\n        return obj + "";\n    } catch (e) {\n        return "[no string representation]";\n    }\n}\n\nfunction isError(obj) {\n    return obj !== null &&\n           typeof obj === "object" &&\n           typeof obj.message === "string" &&\n           typeof obj.name === "string";\n}\n\nfunction markAsOriginatingFromRejection(e) {\n    try {\n        notEnumerableProp(e, "isOperational", true);\n    }\n    catch(ignore) {}\n}\n\nfunction originatesFromRejection(e) {\n    if (e == null) return false;\n    return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||\n        e["isOperational"] === true);\n}\n\nfunction canAttachTrace(obj) {\n    return isError(obj) && es5.propertyIsWritable(obj, "stack");\n}\n\nvar ensureErrorObject = (function() {\n    if (!("stack" in new Error())) {\n        return function(value) {\n            if (canAttachTrace(value)) return value;\n            try {throw new Error(safeToString(value));}\n            catch(err) {return err;}\n        };\n    } else {\n        return function(value) {\n            if (canAttachTrace(value)) return value;\n            return new Error(safeToString(value));\n        };\n    }\n})();\n\nfunction classString(obj) {\n    return {}.toString.call(obj);\n}\n\nfunction copyDescriptors(from, to, filter) {\n    var keys = es5.names(from);\n    for (var i = 0; i < keys.length; ++i) {\n        var key = keys[i];\n        if (filter(key)) {\n            try {\n                es5.defineProperty(to, key, es5.getDescriptor(from, key));\n            } catch (ignore) {}\n        }\n    }\n}\n\nvar asArray = function(v) {\n    if (es5.isArray(v)) {\n        return v;\n    }\n    return null;\n};\n\nif (typeof Symbol !== "undefined" && Symbol.iterator) {\n    var ArrayFrom = typeof Array.from === "function" ? function(v) {\n        return Array.from(v);\n    } : function(v) {\n        var ret = [];\n        var it = v[Symbol.iterator]();\n        var itResult;\n        while (!((itResult = it.next()).done)) {\n            ret.push(itResult.value);\n        }\n        return ret;\n    };\n\n    asArray = function(v) {\n        if (es5.isArray(v)) {\n            return v;\n        } else if (v != null && typeof v[Symbol.iterator] === "function") {\n            return ArrayFrom(v);\n        }\n        return null;\n    };\n}\n\nvar isNode = typeof process !== "undefined" &&\n        classString(process).toLowerCase() === "[object process]";\n\nfunction env(key, def) {\n    return isNode ? __webpack_require__.i({"NODE_ENV":"production","DC_NETWORK":"ropsten","PUBLIC_URL":""})[key] : def;\n}\n\nvar ret = {\n    isClass: isClass,\n    isIdentifier: isIdentifier,\n    inheritedDataKeys: inheritedDataKeys,\n    getDataPropertyOrDefault: getDataPropertyOrDefault,\n    thrower: thrower,\n    isArray: es5.isArray,\n    asArray: asArray,\n    notEnumerableProp: notEnumerableProp,\n    isPrimitive: isPrimitive,\n    isObject: isObject,\n    isError: isError,\n    canEvaluate: canEvaluate,\n    errorObj: errorObj,\n    tryCatch: tryCatch,\n    inherits: inherits,\n    withAppended: withAppended,\n    maybeWrapAsError: maybeWrapAsError,\n    toFastProperties: toFastProperties,\n    filledRange: filledRange,\n    toString: safeToString,\n    canAttachTrace: canAttachTrace,\n    ensureErrorObject: ensureErrorObject,\n    originatesFromRejection: originatesFromRejection,\n    markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n    classString: classString,\n    copyDescriptors: copyDescriptors,\n    hasDevTools: typeof chrome !== "undefined" && chrome &&\n                 typeof chrome.loadTimes === "function",\n    isNode: isNode,\n    env: env,\n    global: globalObject\n};\nret.isRecentNode = ret.isNode && (function() {\n    var version = process.versions.node.split(".").map(Number);\n    return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\n})();\n\nif (ret.isNode) ret.toFastProperties(process);\n\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\nmodule.exports = ret;\n\n},{"./es5":13}]},{},[4])(4)\n});                    ;if (typeof window !== \'undefined\' && window !== null) {                               window.P = window.Promise;                                                     } else if (typeof self !== \'undefined\' && self !== null) {                             self.P = self.Promise;                                                         }\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(2), __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-promievent/~/bluebird/js/browser/bluebird.js\n// module id = 1269\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-promievent/node_modules/bluebird/js/browser/bluebird.js')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file batch.js\n * @author Marek Kotewicz <marek@ethdev.com>\n * @date 2015\n */\n\n\n\nvar Jsonrpc = __webpack_require__(553);\nvar errors = __webpack_require__(35).errors;\n\nvar Batch = function (requestManager) {\n    this.requestManager = requestManager;\n    this.requests = [];\n};\n\n/**\n * Should be called to add create new request to batch request\n *\n * @method add\n * @param {Object} jsonrpc requet object\n */\nBatch.prototype.add = function (request) {\n    this.requests.push(request);\n};\n\n/**\n * Should be called to execute batch request\n *\n * @method execute\n */\nBatch.prototype.execute = function () {\n    var requests = this.requests;\n    this.requestManager.sendBatch(requests, function (err, results) {\n        results = results || [];\n        requests.map(function (request, index) {\n            return results[index] || {};\n        }).forEach(function (result, index) {\n            if (requests[index].callback) {\n\n                if (result && result.error) {\n                    return requests[index].callback(errors.ErrorResponse(result));\n                }\n\n                if (!Jsonrpc.isValidResponse(result)) {\n                    return requests[index].callback(errors.InvalidResponse(result));\n                }\n\n                requests[index].callback(null, (requests[index].format ? requests[index].format(result.result) : result.result));\n            }\n        });\n    });\n};\n\nmodule.exports = Batch;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-requestmanager/src/batch.js\n// module id = 1270\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-requestmanager/src/batch.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file givenProvider.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar givenProvider = null;\n\n// ADD GIVEN PROVIDER\n/* jshint ignore:start */\nvar global = Function('return this')();\n\n// EthereumProvider\nif(typeof global.ethereumProvider !== 'undefined') {\n    givenProvider = global.ethereumProvider;\n\n// Legacy web3.currentProvider\n} else if(typeof global.web3 !== 'undefined' && global.web3.currentProvider) {\n\n    if(global.web3.currentProvider.sendAsync) {\n        global.web3.currentProvider.send = global.web3.currentProvider.sendAsync;\n        delete global.web3.currentProvider.sendAsync;\n    }\n\n    // if connection is 'ipcProviderWrapper', add subscription support\n    if(!global.web3.currentProvider.on &&\n        global.web3.currentProvider.connection &&\n        global.web3.currentProvider.connection.constructor.name === 'ipcProviderWrapper') {\n\n        global.web3.currentProvider.on = function (type, callback) {\n\n            if(typeof callback !== 'function')\n                throw new Error('The second parameter callback must be a function.');\n\n            switch(type){\n                case 'data':\n                    this.connection.on('data', function(data) {\n                        var result = '';\n\n                        data = data.toString();\n\n                        try {\n                            result = JSON.parse(data);\n                        } catch(e) {\n                            return callback(new Error('Couldn\\'t parse response data'+ data));\n                        }\n\n                        // notification\n                        if(!result.id && result.method.indexOf('_subscription') !== -1) {\n                            callback(null, result);\n                        }\n\n                    });\n                    break;\n\n                default:\n                    this.connection.on(type, callback);\n                    break;\n            }\n        };\n    }\n\n    givenProvider = global.web3.currentProvider;\n}\n/* jshint ignore:end */\n\n\nmodule.exports = givenProvider;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-requestmanager/src/givenProvider.js\n// module id = 1271\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-requestmanager/src/givenProvider.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(35).errors;\nvar Jsonrpc = __webpack_require__(553);\nvar BatchManager = __webpack_require__(1270);\nvar givenProvider = __webpack_require__(1271);\n\n\n\n    /**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function RequestManager(provider) {\n    this.provider = null;\n    this.providers = RequestManager.providers;\n\n    this.setProvider(provider);\n    this.subscriptions = {};\n};\n\n\n\nRequestManager.givenProvider = givenProvider;\n\nRequestManager.providers = {\n    WebsocketProvider: __webpack_require__(1293),\n    HttpProvider: __webpack_require__(1291),\n    IpcProvider: __webpack_require__(1292)\n};\n\n\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object} p\n */\nRequestManager.prototype.setProvider = function (p, net) {\n    var _this = this;\n\n    // autodetect provider\n    if(p && typeof p === 'string' && this.providers) {\n\n        // HTTP\n        if(/^http(s)?:\\/\\//i.test(p)) {\n            p = new this.providers.HttpProvider(p);\n\n            // WS\n        } else if(/^ws(s)?:\\/\\//i.test(p)) {\n            p = new this.providers.WebsocketProvider(p);\n\n            // IPC\n        } else if(p && typeof net === 'object'  && typeof net.connect === 'function') {\n            p = new this.providers.IpcProvider(p, net);\n\n        } else if(p) {\n            throw new Error('Can\\'t autodetect provider for \"'+ p +'\"');\n        }\n    }\n\n    // reset the old one before changing\n    if(this.provider)\n        this.clearSubscriptions();\n\n\n    this.provider = p || null;\n\n    // listen to incoming notifications\n    if(this.provider && this.provider.on) {\n        this.provider.on('data', function requestManagerNotification(err, result){\n            if(!err) {\n                if(_this.subscriptions[result.params.subscription] && _this.subscriptions[result.params.subscription].callback)\n                    _this.subscriptions[result.params.subscription].callback(null, result.params.result);\n            } else {\n\n                Object.keys(_this.subscriptions).forEach(function(id){\n                    if(_this.subscriptions[id].callback)\n                        _this.subscriptions[id].callback(err);\n                });\n            }\n        });\n    }\n};\n\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.send = function (data, callback) {\n    callback = callback || function(){};\n\n    if (!this.provider) {\n        return callback(errors.InvalidProvider());\n    }\n\n    var payload = Jsonrpc.toPayload(data.method, data.params);\n    this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](payload, function (err, result) {\n        if(result && result.id && payload.id !== result.id) return callback(new Error('Wrong response id \"'+ result.id +'\" (expected: \"'+ payload.id +'\") in '+ JSON.stringify(payload)));\n\n        if (err) {\n            return callback(err);\n        }\n\n        if (result && result.error) {\n            return callback(errors.ErrorResponse(result));\n        }\n\n        if (!Jsonrpc.isValidResponse(result)) {\n            return callback(errors.InvalidResponse(result));\n        }\n\n        callback(null, result.result);\n    });\n};\n\n/**\n * Should be called to asynchronously send batch request\n *\n * @method sendBatch\n * @param {Array} batch data\n * @param {Function} callback\n */\nRequestManager.prototype.sendBatch = function (data, callback) {\n    if (!this.provider) {\n        return callback(errors.InvalidProvider());\n    }\n\n    var payload = Jsonrpc.toBatchPayload(data);\n    this.provider[this.provider.sendAsync ? 'sendAsync' : 'send'](payload, function (err, results) {\n        if (err) {\n            return callback(err);\n        }\n\n        if (!_.isArray(results)) {\n            return callback(errors.InvalidResponse(results));\n        }\n\n        callback(null, results);\n    });\n};\n\n\n/**\n * Waits for notifications\n *\n * @method addSubscription\n * @param {String} id           the subscription id\n * @param {String} name         the subscription name\n * @param {String} type         the subscription namespace (eth, personal, etc)\n * @param {Function} callback   the callback to call for incoming notifications\n */\nRequestManager.prototype.addSubscription = function (id, name, type, callback) {\n    if(this.provider.on) {\n        this.subscriptions[id] = {\n            callback: callback,\n            type: type,\n            name: name\n        };\n\n    } else {\n        throw new Error('The provider doesn\\'t support subscriptions: '+ this.provider.constructor.name);\n    }\n};\n\n/**\n * Waits for notifications\n *\n * @method removeSubscription\n * @param {String} id           the subscription id\n * @param {Function} callback   fired once the subscription is removed\n */\nRequestManager.prototype.removeSubscription = function (id, callback) {\n    var _this = this;\n\n    if(this.subscriptions[id]) {\n\n        this.send({\n            method: this.subscriptions[id].type + '_unsubscribe',\n            params: [id]\n        }, callback);\n\n        // remove subscription\n        delete _this.subscriptions[id];\n    }\n};\n\n/**\n * Should be called to reset the subscriptions\n *\n * @method reset\n */\nRequestManager.prototype.clearSubscriptions = function (keepIsSyncing) {\n    var _this = this;\n\n\n    // uninstall all subscriptions\n    Object.keys(this.subscriptions).forEach(function(id){\n        if(!keepIsSyncing || _this.subscriptions[id].name !== 'syncing')\n            _this.removeSubscription(id);\n    });\n\n\n    //  reset notification callbacks etc.\n    if(this.provider.reset)\n        this.provider.reset();\n};\n\nmodule.exports = {\n    Manager: RequestManager,\n    BatchManager: BatchManager\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-requestmanager/src/index.js\n// module id = 1272\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-requestmanager/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file subscription.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(35).errors;\nvar EventEmitter = __webpack_require__(183);\n\n\nfunction Subscription(options) {\n    EventEmitter.call(this);\n\n    this.id = null;\n    this.callback = null;\n    this.arguments = null;\n    this._reconnectIntervalId = null;\n\n    this.options = {\n        subscription: options.subscription,\n        type: options.type,\n        requestManager: options.requestManager\n    };\n}\n\n// INHERIT\nSubscription.prototype = Object.create(EventEmitter.prototype);\nSubscription.prototype.constructor = Subscription;\n\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\n\nSubscription.prototype._extractCallback = function (args) {\n    if (_.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n *\n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\n\nSubscription.prototype._validateArgs = function (args) {\n    var subscription = this.options.subscription;\n\n    if(!subscription)\n        subscription = {};\n\n    if(!subscription.params)\n        subscription.params = 0;\n\n    if (args.length !== subscription.params) {\n        throw errors.InvalidNumberOfParams(args.length, subscription.params + 1, args[0]);\n    }\n};\n\n/**\n * Should be called to format input args of method\n *\n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\n\nSubscription.prototype._formatInput = function (args) {\n    var subscription = this.options.subscription;\n\n    if (!subscription) {\n        return args;\n    }\n\n    if (!subscription.inputFormatter) {\n        return args;\n    }\n\n    var formattedArgs = subscription.inputFormatter.map(function (formatter, index) {\n        return formatter ? formatter(args[index]) : args[index];\n    });\n\n    return formattedArgs;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\n\nSubscription.prototype._formatOutput = function (result) {\n    var subscription = this.options.subscription;\n\n    return (subscription && subscription.outputFormatter && result) ? subscription.outputFormatter(result) : result;\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nSubscription.prototype._toPayload = function (args) {\n    var params = [];\n    this.callback = this._extractCallback(args);\n\n    if (!this.subscriptionMethod) {\n        this.subscriptionMethod = args.shift();\n\n        // replace subscription with given name\n        if (this.options.subscription.subscriptionName) {\n            this.subscriptionMethod = this.options.subscription.subscriptionName;\n        }\n    }\n\n    if (!this.arguments) {\n        this.arguments = this._formatInput(args);\n        this._validateArgs(this.arguments);\n        args = []; // make empty after validation\n\n    }\n\n    // re-add subscriptionName\n    params.push(this.subscriptionMethod);\n    params = params.concat(this.arguments);\n\n\n    if (args.length) {\n        throw new Error('Only a callback is allowed as parameter on an already instantiated subscription.');\n    }\n\n    return {\n        method: this.options.type + '_subscribe',\n        params: params\n    };\n};\n\n/**\n * Unsubscribes and clears callbacks\n *\n * @method unsubscribe\n * @return {Object}\n */\nSubscription.prototype.unsubscribe = function(callback) {\n    this.options.requestManager.removeSubscription(this.id, callback);\n    this.id = null;\n    this.removeAllListeners();\n    clearInterval(this._reconnectIntervalId);\n};\n\n/**\n * Subscribes and watches for changes\n *\n * @method subscribe\n * @param {String} subscription the subscription\n * @param {Object} options the options object with address topics and fromBlock\n * @return {Object}\n */\nSubscription.prototype.subscribe = function() {\n    var _this = this;\n    var args = Array.prototype.slice.call(arguments);\n    var payload = this._toPayload(args);\n\n    if(!payload) {\n        return this;\n    }\n\n    if(!this.options.requestManager.provider) {\n        var err1 = new Error('No provider set.');\n        this.callback(err1, null, this);\n        this.emit('error', err1);\n        return this;\n    }\n\n    // throw error, if provider doesnt support subscriptions\n    if(!this.options.requestManager.provider.on) {\n        var err2 = new Error('The current provider doesn\\'t support subscriptions: '+ this.options.requestManager.provider.constructor.name);\n        this.callback(err2, null, this);\n        this.emit('error', err2);\n        return this;\n    }\n\n    // if id is there unsubscribe first\n    if (this.id) {\n        this.unsubscribe();\n    }\n\n    // store the params in the options object\n    this.options.params = payload.params[1];\n\n    // get past logs, if fromBlock is available\n    if(payload.params[0] === 'logs' && _.isObject(payload.params[1]) && payload.params[1].hasOwnProperty('fromBlock') && isFinite(payload.params[1].fromBlock)) {\n        // send the subscription request\n        this.options.requestManager.send({\n            method: 'eth_getLogs',\n            params: [payload.params[1]]\n        }, function (err, logs) {\n            if(!err) {\n                logs.forEach(function(log){\n                    var output = _this._formatOutput(log);\n                    _this.callback(null, output, _this);\n                    _this.emit('data', output);\n                });\n\n                // TODO subscribe here? after the past logs?\n\n            } else {\n                _this.callback(err, null, _this);\n                _this.emit('error', err);\n            }\n        });\n    }\n\n    // create subscription\n    // TODO move to separate function? so that past logs can go first?\n\n    if(typeof payload.params[1] === 'object')\n        delete payload.params[1].fromBlock;\n\n    this.options.requestManager.send(payload, function (err, result) {\n        if(!err && result) {\n            _this.id = result;\n\n            // call callback on notifications\n            _this.options.requestManager.addSubscription(_this.id, payload.params[0] , _this.options.type, function(err, result) {\n\n                // TODO remove once its fixed in geth\n                if(_.isArray(result))\n                    result = result[0];\n\n                var output = _this._formatOutput(result);\n\n                if (!err) {\n\n                    if(_.isFunction(_this.options.subscription.subscriptionHandler)) {\n                        return _this.options.subscription.subscriptionHandler.call(_this, output);\n                    } else {\n                        _this.emit('data', output);\n                    }\n\n                } else {\n                    // unsubscribe, but keep listeners\n                    _this.options.requestManager.removeSubscription(_this.id);\n\n                    // re-subscribe, if connection fails\n                    if(_this.options.requestManager.provider.once) {\n                        _this._reconnectIntervalId = setInterval(function () {\n                            // TODO check if that makes sense!\n                            _this.options.requestManager.provider.reconnect();\n                        }, 500);\n\n                        _this.options.requestManager.provider.once('connect', function () {\n                            clearInterval(_this._reconnectIntervalId);\n                            _this.subscribe(_this.callback);\n                        });\n                    }\n                    _this.emit('error', err);\n                }\n\n                // call the callback, last so that unsubscribe there won't affect the emit above\n                if (_.isFunction(_this.callback)) {\n                    _this.callback(err, output, _this);\n                }\n            });\n        } else if (_.isFunction(_this.callback)) {\n            _this.callback(err, null, _this);\n            _this.emit('error', err);\n        } else {\n            // emit the event even if no callback was provided\n            _this.emit('error', err);\n        }\n    });\n\n    // return an object to cancel the subscription\n    return this;\n};\n\nmodule.exports = Subscription;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core-subscriptions/src/subscription.js\n// module id = 1273\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core-subscriptions/src/subscription.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file extend.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar formatters = __webpack_require__(35).formatters;\nvar Method = __webpack_require__(105);\nvar utils = __webpack_require__(47);\n\n\nvar extend = function (pckg) {\n    /* jshint maxcomplexity:5 */\n    var ex = function (extension) {\n\n        var extendedObject;\n        if (extension.property) {\n            if (!pckg[extension.property]) {\n                pckg[extension.property] = {};\n            }\n            extendedObject = pckg[extension.property];\n        } else {\n            extendedObject = pckg;\n        }\n\n        if (extension.methods) {\n            extension.methods.forEach(function (method) {\n                if(!(method instanceof Method)) {\n                    method = new Method(method);\n                }\n\n                method.attachToObject(extendedObject);\n                method.setRequestManager(pckg._requestManager);\n            });\n        }\n\n        return pckg;\n    };\n\n    ex.formatters = formatters;\n    ex.utils = utils;\n    ex.Method = Method;\n\n    return ex;\n};\n\n\n\nmodule.exports = extend;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-core/src/extend.js\n// module id = 1274\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-core/src/extend.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\n  'use strict';\n\n  // Utils\n  function assert (val, msg) {\n    if (!val) throw new Error(msg || 'Assertion failed');\n  }\n\n  // Could use `inherits` module, but don't want to move from single file\n  // architecture yet.\n  function inherits (ctor, superCtor) {\n    ctor.super_ = superCtor;\n    var TempCtor = function () {};\n    TempCtor.prototype = superCtor.prototype;\n    ctor.prototype = new TempCtor();\n    ctor.prototype.constructor = ctor;\n  }\n\n  // BN\n\n  function BN (number, base, endian) {\n    if (BN.isBN(number)) {\n      return number;\n    }\n\n    this.negative = 0;\n    this.words = null;\n    this.length = 0;\n\n    // Reduction context\n    this.red = null;\n\n    if (number !== null) {\n      if (base === 'le' || base === 'be') {\n        endian = base;\n        base = 10;\n      }\n\n      this._init(number || 0, base || 10, endian || 'be');\n    }\n  }\n  if (typeof module === 'object') {\n    module.exports = BN;\n  } else {\n    exports.BN = BN;\n  }\n\n  BN.BN = BN;\n  BN.wordSize = 26;\n\n  var Buffer;\n  try {\n    Buffer = __webpack_require__(0).Buffer;\n  } catch (e) {\n  }\n\n  BN.isBN = function isBN (num) {\n    if (num instanceof BN) {\n      return true;\n    }\n\n    return num !== null && typeof num === 'object' &&\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\n  };\n\n  BN.max = function max (left, right) {\n    if (left.cmp(right) > 0) return left;\n    return right;\n  };\n\n  BN.min = function min (left, right) {\n    if (left.cmp(right) < 0) return left;\n    return right;\n  };\n\n  BN.prototype._init = function init (number, base, endian) {\n    if (typeof number === 'number') {\n      return this._initNumber(number, base, endian);\n    }\n\n    if (typeof number === 'object') {\n      return this._initArray(number, base, endian);\n    }\n\n    if (base === 'hex') {\n      base = 16;\n    }\n    assert(base === (base | 0) && base >= 2 && base <= 36);\n\n    number = number.toString().replace(/\\s+/g, '');\n    var start = 0;\n    if (number[0] === '-') {\n      start++;\n    }\n\n    if (base === 16) {\n      this._parseHex(number, start);\n    } else {\n      this._parseBase(number, base, start);\n    }\n\n    if (number[0] === '-') {\n      this.negative = 1;\n    }\n\n    this.strip();\n\n    if (endian !== 'le') return;\n\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\n    if (number < 0) {\n      this.negative = 1;\n      number = -number;\n    }\n    if (number < 0x4000000) {\n      this.words = [ number & 0x3ffffff ];\n      this.length = 1;\n    } else if (number < 0x10000000000000) {\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff\n      ];\n      this.length = 2;\n    } else {\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\n      this.words = [\n        number & 0x3ffffff,\n        (number / 0x4000000) & 0x3ffffff,\n        1\n      ];\n      this.length = 3;\n    }\n\n    if (endian !== 'le') return;\n\n    // Reverse the bytes\n    this._initArray(this.toArray(), base, endian);\n  };\n\n  BN.prototype._initArray = function _initArray (number, base, endian) {\n    // Perhaps a Uint8Array\n    assert(typeof number.length === 'number');\n    if (number.length <= 0) {\n      this.words = [ 0 ];\n      this.length = 1;\n      return this;\n    }\n\n    this.length = Math.ceil(number.length / 3);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    var off = 0;\n    if (endian === 'be') {\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    } else if (endian === 'le') {\n      for (i = 0, j = 0; i < number.length; i += 3) {\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\n        this.words[j] |= (w << off) & 0x3ffffff;\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\n        off += 24;\n        if (off >= 26) {\n          off -= 26;\n          j++;\n        }\n      }\n    }\n    return this.strip();\n  };\n\n  function parseHex (str, start, end) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r <<= 4;\n\n      // 'a' - 'f'\n      if (c >= 49 && c <= 54) {\n        r |= c - 49 + 0xa;\n\n      // 'A' - 'F'\n      } else if (c >= 17 && c <= 22) {\n        r |= c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r |= c & 0xf;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseHex = function _parseHex (number, start) {\n    // Create possibly bigger array to ensure that it fits the number\n    this.length = Math.ceil((number.length - start) / 6);\n    this.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      this.words[i] = 0;\n    }\n\n    var j, w;\n    // Scan 24-bit chunks and add them to the number\n    var off = 0;\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\n      w = parseHex(number, i, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n      off += 24;\n      if (off >= 26) {\n        off -= 26;\n        j++;\n      }\n    }\n    if (i + 6 !== start) {\n      w = parseHex(number, start, i + 6);\n      this.words[j] |= (w << off) & 0x3ffffff;\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\n    }\n    this.strip();\n  };\n\n  function parseBase (str, start, end, mul) {\n    var r = 0;\n    var len = Math.min(str.length, end);\n    for (var i = start; i < len; i++) {\n      var c = str.charCodeAt(i) - 48;\n\n      r *= mul;\n\n      // 'a'\n      if (c >= 49) {\n        r += c - 49 + 0xa;\n\n      // 'A'\n      } else if (c >= 17) {\n        r += c - 17 + 0xa;\n\n      // '0' - '9'\n      } else {\n        r += c;\n      }\n    }\n    return r;\n  }\n\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\n    // Initialize as zero\n    this.words = [ 0 ];\n    this.length = 1;\n\n    // Find length of limb in base\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\n      limbLen++;\n    }\n    limbLen--;\n    limbPow = (limbPow / base) | 0;\n\n    var total = number.length - start;\n    var mod = total % limbLen;\n    var end = Math.min(total, total - mod) + start;\n\n    var word = 0;\n    for (var i = start; i < end; i += limbLen) {\n      word = parseBase(number, i, i + limbLen, base);\n\n      this.imuln(limbPow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n\n    if (mod !== 0) {\n      var pow = 1;\n      word = parseBase(number, i, number.length, base);\n\n      for (i = 0; i < mod; i++) {\n        pow *= base;\n      }\n\n      this.imuln(pow);\n      if (this.words[0] + word < 0x4000000) {\n        this.words[0] += word;\n      } else {\n        this._iaddn(word);\n      }\n    }\n  };\n\n  BN.prototype.copy = function copy (dest) {\n    dest.words = new Array(this.length);\n    for (var i = 0; i < this.length; i++) {\n      dest.words[i] = this.words[i];\n    }\n    dest.length = this.length;\n    dest.negative = this.negative;\n    dest.red = this.red;\n  };\n\n  BN.prototype.clone = function clone () {\n    var r = new BN(null);\n    this.copy(r);\n    return r;\n  };\n\n  BN.prototype._expand = function _expand (size) {\n    while (this.length < size) {\n      this.words[this.length++] = 0;\n    }\n    return this;\n  };\n\n  // Remove leading `0` from `this`\n  BN.prototype.strip = function strip () {\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\n      this.length--;\n    }\n    return this._normSign();\n  };\n\n  BN.prototype._normSign = function _normSign () {\n    // -0 = 0\n    if (this.length === 1 && this.words[0] === 0) {\n      this.negative = 0;\n    }\n    return this;\n  };\n\n  BN.prototype.inspect = function inspect () {\n    return (this.red ? '<BN-R: ' : '<BN: ') + this.toString(16) + '>';\n  };\n\n  /*\n\n  var zeros = [];\n  var groupSizes = [];\n  var groupBases = [];\n\n  var s = '';\n  var i = -1;\n  while (++i < BN.wordSize) {\n    zeros[i] = s;\n    s += '0';\n  }\n  groupSizes[0] = 0;\n  groupSizes[1] = 0;\n  groupBases[0] = 0;\n  groupBases[1] = 0;\n  var base = 2 - 1;\n  while (++base < 36 + 1) {\n    var groupSize = 0;\n    var groupBase = 1;\n    while (groupBase < (1 << BN.wordSize) / base) {\n      groupBase *= base;\n      groupSize += 1;\n    }\n    groupSizes[base] = groupSize;\n    groupBases[base] = groupBase;\n  }\n\n  */\n\n  var zeros = [\n    '',\n    '0',\n    '00',\n    '000',\n    '0000',\n    '00000',\n    '000000',\n    '0000000',\n    '00000000',\n    '000000000',\n    '0000000000',\n    '00000000000',\n    '000000000000',\n    '0000000000000',\n    '00000000000000',\n    '000000000000000',\n    '0000000000000000',\n    '00000000000000000',\n    '000000000000000000',\n    '0000000000000000000',\n    '00000000000000000000',\n    '000000000000000000000',\n    '0000000000000000000000',\n    '00000000000000000000000',\n    '000000000000000000000000',\n    '0000000000000000000000000'\n  ];\n\n  var groupSizes = [\n    0, 0,\n    25, 16, 12, 11, 10, 9, 8,\n    8, 7, 7, 7, 7, 6, 6,\n    6, 6, 6, 6, 6, 5, 5,\n    5, 5, 5, 5, 5, 5, 5,\n    5, 5, 5, 5, 5, 5, 5\n  ];\n\n  var groupBases = [\n    0, 0,\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\n  ];\n\n  BN.prototype.toString = function toString (base, padding) {\n    base = base || 10;\n    padding = padding | 0 || 1;\n\n    var out;\n    if (base === 16 || base === 'hex') {\n      out = '';\n      var off = 0;\n      var carry = 0;\n      for (var i = 0; i < this.length; i++) {\n        var w = this.words[i];\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\n        carry = (w >>> (24 - off)) & 0xffffff;\n        if (carry !== 0 || i !== this.length - 1) {\n          out = zeros[6 - word.length] + word + out;\n        } else {\n          out = word + out;\n        }\n        off += 2;\n        if (off >= 26) {\n          off -= 26;\n          i--;\n        }\n      }\n      if (carry !== 0) {\n        out = carry.toString(16) + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    if (base === (base | 0) && base >= 2 && base <= 36) {\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\n      var groupSize = groupSizes[base];\n      // var groupBase = Math.pow(base, groupSize);\n      var groupBase = groupBases[base];\n      out = '';\n      var c = this.clone();\n      c.negative = 0;\n      while (!c.isZero()) {\n        var r = c.modn(groupBase).toString(base);\n        c = c.idivn(groupBase);\n\n        if (!c.isZero()) {\n          out = zeros[groupSize - r.length] + r + out;\n        } else {\n          out = r + out;\n        }\n      }\n      if (this.isZero()) {\n        out = '0' + out;\n      }\n      while (out.length % padding !== 0) {\n        out = '0' + out;\n      }\n      if (this.negative !== 0) {\n        out = '-' + out;\n      }\n      return out;\n    }\n\n    assert(false, 'Base should be between 2 and 36');\n  };\n\n  BN.prototype.toNumber = function toNumber () {\n    var ret = this.words[0];\n    if (this.length === 2) {\n      ret += this.words[1] * 0x4000000;\n    } else if (this.length === 3 && this.words[2] === 0x01) {\n      // NOTE: at this stage it is known that the top bit is set\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\n    } else if (this.length > 2) {\n      assert(false, 'Number can only safely store up to 53 bits');\n    }\n    return (this.negative !== 0) ? -ret : ret;\n  };\n\n  BN.prototype.toJSON = function toJSON () {\n    return this.toString(16);\n  };\n\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\n    assert(typeof Buffer !== 'undefined');\n    return this.toArrayLike(Buffer, endian, length);\n  };\n\n  BN.prototype.toArray = function toArray (endian, length) {\n    return this.toArrayLike(Array, endian, length);\n  };\n\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\n    var byteLength = this.byteLength();\n    var reqLength = length || Math.max(1, byteLength);\n    assert(byteLength <= reqLength, 'byte array longer than desired length');\n    assert(reqLength > 0, 'Requested array length <= 0');\n\n    this.strip();\n    var littleEndian = endian === 'le';\n    var res = new ArrayType(reqLength);\n\n    var b, i;\n    var q = this.clone();\n    if (!littleEndian) {\n      // Assume big-endian\n      for (i = 0; i < reqLength - byteLength; i++) {\n        res[i] = 0;\n      }\n\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[reqLength - i - 1] = b;\n      }\n    } else {\n      for (i = 0; !q.isZero(); i++) {\n        b = q.andln(0xff);\n        q.iushrn(8);\n\n        res[i] = b;\n      }\n\n      for (; i < reqLength; i++) {\n        res[i] = 0;\n      }\n    }\n\n    return res;\n  };\n\n  if (Math.clz32) {\n    BN.prototype._countBits = function _countBits (w) {\n      return 32 - Math.clz32(w);\n    };\n  } else {\n    BN.prototype._countBits = function _countBits (w) {\n      var t = w;\n      var r = 0;\n      if (t >= 0x1000) {\n        r += 13;\n        t >>>= 13;\n      }\n      if (t >= 0x40) {\n        r += 7;\n        t >>>= 7;\n      }\n      if (t >= 0x8) {\n        r += 4;\n        t >>>= 4;\n      }\n      if (t >= 0x02) {\n        r += 2;\n        t >>>= 2;\n      }\n      return r + t;\n    };\n  }\n\n  BN.prototype._zeroBits = function _zeroBits (w) {\n    // Short-cut\n    if (w === 0) return 26;\n\n    var t = w;\n    var r = 0;\n    if ((t & 0x1fff) === 0) {\n      r += 13;\n      t >>>= 13;\n    }\n    if ((t & 0x7f) === 0) {\n      r += 7;\n      t >>>= 7;\n    }\n    if ((t & 0xf) === 0) {\n      r += 4;\n      t >>>= 4;\n    }\n    if ((t & 0x3) === 0) {\n      r += 2;\n      t >>>= 2;\n    }\n    if ((t & 0x1) === 0) {\n      r++;\n    }\n    return r;\n  };\n\n  // Return number of used bits in a BN\n  BN.prototype.bitLength = function bitLength () {\n    var w = this.words[this.length - 1];\n    var hi = this._countBits(w);\n    return (this.length - 1) * 26 + hi;\n  };\n\n  function toBitArray (num) {\n    var w = new Array(num.bitLength());\n\n    for (var bit = 0; bit < w.length; bit++) {\n      var off = (bit / 26) | 0;\n      var wbit = bit % 26;\n\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\n    }\n\n    return w;\n  }\n\n  // Number of trailing zero bits\n  BN.prototype.zeroBits = function zeroBits () {\n    if (this.isZero()) return 0;\n\n    var r = 0;\n    for (var i = 0; i < this.length; i++) {\n      var b = this._zeroBits(this.words[i]);\n      r += b;\n      if (b !== 26) break;\n    }\n    return r;\n  };\n\n  BN.prototype.byteLength = function byteLength () {\n    return Math.ceil(this.bitLength() / 8);\n  };\n\n  BN.prototype.toTwos = function toTwos (width) {\n    if (this.negative !== 0) {\n      return this.abs().inotn(width).iaddn(1);\n    }\n    return this.clone();\n  };\n\n  BN.prototype.fromTwos = function fromTwos (width) {\n    if (this.testn(width - 1)) {\n      return this.notn(width).iaddn(1).ineg();\n    }\n    return this.clone();\n  };\n\n  BN.prototype.isNeg = function isNeg () {\n    return this.negative !== 0;\n  };\n\n  // Return negative clone of `this`\n  BN.prototype.neg = function neg () {\n    return this.clone().ineg();\n  };\n\n  BN.prototype.ineg = function ineg () {\n    if (!this.isZero()) {\n      this.negative ^= 1;\n    }\n\n    return this;\n  };\n\n  // Or `num` with `this` in-place\n  BN.prototype.iuor = function iuor (num) {\n    while (this.length < num.length) {\n      this.words[this.length++] = 0;\n    }\n\n    for (var i = 0; i < num.length; i++) {\n      this.words[i] = this.words[i] | num.words[i];\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ior = function ior (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuor(num);\n  };\n\n  // Or `num` with `this`\n  BN.prototype.or = function or (num) {\n    if (this.length > num.length) return this.clone().ior(num);\n    return num.clone().ior(this);\n  };\n\n  BN.prototype.uor = function uor (num) {\n    if (this.length > num.length) return this.clone().iuor(num);\n    return num.clone().iuor(this);\n  };\n\n  // And `num` with `this` in-place\n  BN.prototype.iuand = function iuand (num) {\n    // b = min-length(num, this)\n    var b;\n    if (this.length > num.length) {\n      b = num;\n    } else {\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = this.words[i] & num.words[i];\n    }\n\n    this.length = b.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.iand = function iand (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuand(num);\n  };\n\n  // And `num` with `this`\n  BN.prototype.and = function and (num) {\n    if (this.length > num.length) return this.clone().iand(num);\n    return num.clone().iand(this);\n  };\n\n  BN.prototype.uand = function uand (num) {\n    if (this.length > num.length) return this.clone().iuand(num);\n    return num.clone().iuand(this);\n  };\n\n  // Xor `num` with `this` in-place\n  BN.prototype.iuxor = function iuxor (num) {\n    // a.length > b.length\n    var a;\n    var b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    for (var i = 0; i < b.length; i++) {\n      this.words[i] = a.words[i] ^ b.words[i];\n    }\n\n    if (this !== a) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = a.length;\n\n    return this.strip();\n  };\n\n  BN.prototype.ixor = function ixor (num) {\n    assert((this.negative | num.negative) === 0);\n    return this.iuxor(num);\n  };\n\n  // Xor `num` with `this`\n  BN.prototype.xor = function xor (num) {\n    if (this.length > num.length) return this.clone().ixor(num);\n    return num.clone().ixor(this);\n  };\n\n  BN.prototype.uxor = function uxor (num) {\n    if (this.length > num.length) return this.clone().iuxor(num);\n    return num.clone().iuxor(this);\n  };\n\n  // Not ``this`` with ``width`` bitwidth\n  BN.prototype.inotn = function inotn (width) {\n    assert(typeof width === 'number' && width >= 0);\n\n    var bytesNeeded = Math.ceil(width / 26) | 0;\n    var bitsLeft = width % 26;\n\n    // Extend the buffer with leading zeroes\n    this._expand(bytesNeeded);\n\n    if (bitsLeft > 0) {\n      bytesNeeded--;\n    }\n\n    // Handle complete words\n    for (var i = 0; i < bytesNeeded; i++) {\n      this.words[i] = ~this.words[i] & 0x3ffffff;\n    }\n\n    // Handle the residue\n    if (bitsLeft > 0) {\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\n    }\n\n    // And remove leading zeroes\n    return this.strip();\n  };\n\n  BN.prototype.notn = function notn (width) {\n    return this.clone().inotn(width);\n  };\n\n  // Set `bit` of `this`\n  BN.prototype.setn = function setn (bit, val) {\n    assert(typeof bit === 'number' && bit >= 0);\n\n    var off = (bit / 26) | 0;\n    var wbit = bit % 26;\n\n    this._expand(off + 1);\n\n    if (val) {\n      this.words[off] = this.words[off] | (1 << wbit);\n    } else {\n      this.words[off] = this.words[off] & ~(1 << wbit);\n    }\n\n    return this.strip();\n  };\n\n  // Add `num` to `this` in-place\n  BN.prototype.iadd = function iadd (num) {\n    var r;\n\n    // negative + positive\n    if (this.negative !== 0 && num.negative === 0) {\n      this.negative = 0;\n      r = this.isub(num);\n      this.negative ^= 1;\n      return this._normSign();\n\n    // positive + negative\n    } else if (this.negative === 0 && num.negative !== 0) {\n      num.negative = 0;\n      r = this.isub(num);\n      num.negative = 1;\n      return r._normSign();\n    }\n\n    // a.length > b.length\n    var a, b;\n    if (this.length > num.length) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      this.words[i] = r & 0x3ffffff;\n      carry = r >>> 26;\n    }\n\n    this.length = a.length;\n    if (carry !== 0) {\n      this.words[this.length] = carry;\n      this.length++;\n    // Copy the rest of the words\n    } else if (a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    return this;\n  };\n\n  // Add `num` to `this`\n  BN.prototype.add = function add (num) {\n    var res;\n    if (num.negative !== 0 && this.negative === 0) {\n      num.negative = 0;\n      res = this.sub(num);\n      num.negative ^= 1;\n      return res;\n    } else if (num.negative === 0 && this.negative !== 0) {\n      this.negative = 0;\n      res = num.sub(this);\n      this.negative = 1;\n      return res;\n    }\n\n    if (this.length > num.length) return this.clone().iadd(num);\n\n    return num.clone().iadd(this);\n  };\n\n  // Subtract `num` from `this` in-place\n  BN.prototype.isub = function isub (num) {\n    // this - (-num) = this + num\n    if (num.negative !== 0) {\n      num.negative = 0;\n      var r = this.iadd(num);\n      num.negative = 1;\n      return r._normSign();\n\n    // -this - num = -(this + num)\n    } else if (this.negative !== 0) {\n      this.negative = 0;\n      this.iadd(num);\n      this.negative = 1;\n      return this._normSign();\n    }\n\n    // At this point both numbers are positive\n    var cmp = this.cmp(num);\n\n    // Optimization - zeroify\n    if (cmp === 0) {\n      this.negative = 0;\n      this.length = 1;\n      this.words[0] = 0;\n      return this;\n    }\n\n    // a > b\n    var a, b;\n    if (cmp > 0) {\n      a = this;\n      b = num;\n    } else {\n      a = num;\n      b = this;\n    }\n\n    var carry = 0;\n    for (var i = 0; i < b.length; i++) {\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n    for (; carry !== 0 && i < a.length; i++) {\n      r = (a.words[i] | 0) + carry;\n      carry = r >> 26;\n      this.words[i] = r & 0x3ffffff;\n    }\n\n    // Copy rest of the words\n    if (carry === 0 && i < a.length && a !== this) {\n      for (; i < a.length; i++) {\n        this.words[i] = a.words[i];\n      }\n    }\n\n    this.length = Math.max(this.length, i);\n\n    if (a !== this) {\n      this.negative = 1;\n    }\n\n    return this.strip();\n  };\n\n  // Subtract `num` from `this`\n  BN.prototype.sub = function sub (num) {\n    return this.clone().isub(num);\n  };\n\n  function smallMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    var len = (self.length + num.length) | 0;\n    out.length = len;\n    len = (len - 1) | 0;\n\n    // Peel one iteration (compiler can't do it, because of code complexity)\n    var a = self.words[0] | 0;\n    var b = num.words[0] | 0;\n    var r = a * b;\n\n    var lo = r & 0x3ffffff;\n    var carry = (r / 0x4000000) | 0;\n    out.words[0] = lo;\n\n    for (var k = 1; k < len; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = carry >>> 26;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = (k - j) | 0;\n        a = self.words[i] | 0;\n        b = num.words[j] | 0;\n        r = a * b + rword;\n        ncarry += (r / 0x4000000) | 0;\n        rword = r & 0x3ffffff;\n      }\n      out.words[k] = rword | 0;\n      carry = ncarry | 0;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry | 0;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  // TODO(indutny): it may be reasonable to omit it for users who don't need\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\n  // multiplication (like elliptic secp256k1).\n  var comb10MulTo = function comb10MulTo (self, num, out) {\n    var a = self.words;\n    var b = num.words;\n    var o = out.words;\n    var c = 0;\n    var lo;\n    var mid;\n    var hi;\n    var a0 = a[0] | 0;\n    var al0 = a0 & 0x1fff;\n    var ah0 = a0 >>> 13;\n    var a1 = a[1] | 0;\n    var al1 = a1 & 0x1fff;\n    var ah1 = a1 >>> 13;\n    var a2 = a[2] | 0;\n    var al2 = a2 & 0x1fff;\n    var ah2 = a2 >>> 13;\n    var a3 = a[3] | 0;\n    var al3 = a3 & 0x1fff;\n    var ah3 = a3 >>> 13;\n    var a4 = a[4] | 0;\n    var al4 = a4 & 0x1fff;\n    var ah4 = a4 >>> 13;\n    var a5 = a[5] | 0;\n    var al5 = a5 & 0x1fff;\n    var ah5 = a5 >>> 13;\n    var a6 = a[6] | 0;\n    var al6 = a6 & 0x1fff;\n    var ah6 = a6 >>> 13;\n    var a7 = a[7] | 0;\n    var al7 = a7 & 0x1fff;\n    var ah7 = a7 >>> 13;\n    var a8 = a[8] | 0;\n    var al8 = a8 & 0x1fff;\n    var ah8 = a8 >>> 13;\n    var a9 = a[9] | 0;\n    var al9 = a9 & 0x1fff;\n    var ah9 = a9 >>> 13;\n    var b0 = b[0] | 0;\n    var bl0 = b0 & 0x1fff;\n    var bh0 = b0 >>> 13;\n    var b1 = b[1] | 0;\n    var bl1 = b1 & 0x1fff;\n    var bh1 = b1 >>> 13;\n    var b2 = b[2] | 0;\n    var bl2 = b2 & 0x1fff;\n    var bh2 = b2 >>> 13;\n    var b3 = b[3] | 0;\n    var bl3 = b3 & 0x1fff;\n    var bh3 = b3 >>> 13;\n    var b4 = b[4] | 0;\n    var bl4 = b4 & 0x1fff;\n    var bh4 = b4 >>> 13;\n    var b5 = b[5] | 0;\n    var bl5 = b5 & 0x1fff;\n    var bh5 = b5 >>> 13;\n    var b6 = b[6] | 0;\n    var bl6 = b6 & 0x1fff;\n    var bh6 = b6 >>> 13;\n    var b7 = b[7] | 0;\n    var bl7 = b7 & 0x1fff;\n    var bh7 = b7 >>> 13;\n    var b8 = b[8] | 0;\n    var bl8 = b8 & 0x1fff;\n    var bh8 = b8 >>> 13;\n    var b9 = b[9] | 0;\n    var bl9 = b9 & 0x1fff;\n    var bh9 = b9 >>> 13;\n\n    out.negative = self.negative ^ num.negative;\n    out.length = 19;\n    /* k = 0 */\n    lo = Math.imul(al0, bl0);\n    mid = Math.imul(al0, bh0);\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\n    hi = Math.imul(ah0, bh0);\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\n    w0 &= 0x3ffffff;\n    /* k = 1 */\n    lo = Math.imul(al1, bl0);\n    mid = Math.imul(al1, bh0);\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\n    hi = Math.imul(ah1, bh0);\n    lo = (lo + Math.imul(al0, bl1)) | 0;\n    mid = (mid + Math.imul(al0, bh1)) | 0;\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\n    w1 &= 0x3ffffff;\n    /* k = 2 */\n    lo = Math.imul(al2, bl0);\n    mid = Math.imul(al2, bh0);\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\n    hi = Math.imul(ah2, bh0);\n    lo = (lo + Math.imul(al1, bl1)) | 0;\n    mid = (mid + Math.imul(al1, bh1)) | 0;\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\n    lo = (lo + Math.imul(al0, bl2)) | 0;\n    mid = (mid + Math.imul(al0, bh2)) | 0;\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\n    w2 &= 0x3ffffff;\n    /* k = 3 */\n    lo = Math.imul(al3, bl0);\n    mid = Math.imul(al3, bh0);\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\n    hi = Math.imul(ah3, bh0);\n    lo = (lo + Math.imul(al2, bl1)) | 0;\n    mid = (mid + Math.imul(al2, bh1)) | 0;\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\n    lo = (lo + Math.imul(al1, bl2)) | 0;\n    mid = (mid + Math.imul(al1, bh2)) | 0;\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\n    lo = (lo + Math.imul(al0, bl3)) | 0;\n    mid = (mid + Math.imul(al0, bh3)) | 0;\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\n    w3 &= 0x3ffffff;\n    /* k = 4 */\n    lo = Math.imul(al4, bl0);\n    mid = Math.imul(al4, bh0);\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\n    hi = Math.imul(ah4, bh0);\n    lo = (lo + Math.imul(al3, bl1)) | 0;\n    mid = (mid + Math.imul(al3, bh1)) | 0;\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\n    lo = (lo + Math.imul(al2, bl2)) | 0;\n    mid = (mid + Math.imul(al2, bh2)) | 0;\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\n    lo = (lo + Math.imul(al1, bl3)) | 0;\n    mid = (mid + Math.imul(al1, bh3)) | 0;\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\n    lo = (lo + Math.imul(al0, bl4)) | 0;\n    mid = (mid + Math.imul(al0, bh4)) | 0;\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\n    w4 &= 0x3ffffff;\n    /* k = 5 */\n    lo = Math.imul(al5, bl0);\n    mid = Math.imul(al5, bh0);\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\n    hi = Math.imul(ah5, bh0);\n    lo = (lo + Math.imul(al4, bl1)) | 0;\n    mid = (mid + Math.imul(al4, bh1)) | 0;\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\n    lo = (lo + Math.imul(al3, bl2)) | 0;\n    mid = (mid + Math.imul(al3, bh2)) | 0;\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\n    lo = (lo + Math.imul(al2, bl3)) | 0;\n    mid = (mid + Math.imul(al2, bh3)) | 0;\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\n    lo = (lo + Math.imul(al1, bl4)) | 0;\n    mid = (mid + Math.imul(al1, bh4)) | 0;\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\n    lo = (lo + Math.imul(al0, bl5)) | 0;\n    mid = (mid + Math.imul(al0, bh5)) | 0;\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\n    w5 &= 0x3ffffff;\n    /* k = 6 */\n    lo = Math.imul(al6, bl0);\n    mid = Math.imul(al6, bh0);\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\n    hi = Math.imul(ah6, bh0);\n    lo = (lo + Math.imul(al5, bl1)) | 0;\n    mid = (mid + Math.imul(al5, bh1)) | 0;\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\n    lo = (lo + Math.imul(al4, bl2)) | 0;\n    mid = (mid + Math.imul(al4, bh2)) | 0;\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\n    lo = (lo + Math.imul(al3, bl3)) | 0;\n    mid = (mid + Math.imul(al3, bh3)) | 0;\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\n    lo = (lo + Math.imul(al2, bl4)) | 0;\n    mid = (mid + Math.imul(al2, bh4)) | 0;\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\n    lo = (lo + Math.imul(al1, bl5)) | 0;\n    mid = (mid + Math.imul(al1, bh5)) | 0;\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\n    lo = (lo + Math.imul(al0, bl6)) | 0;\n    mid = (mid + Math.imul(al0, bh6)) | 0;\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\n    w6 &= 0x3ffffff;\n    /* k = 7 */\n    lo = Math.imul(al7, bl0);\n    mid = Math.imul(al7, bh0);\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\n    hi = Math.imul(ah7, bh0);\n    lo = (lo + Math.imul(al6, bl1)) | 0;\n    mid = (mid + Math.imul(al6, bh1)) | 0;\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\n    lo = (lo + Math.imul(al5, bl2)) | 0;\n    mid = (mid + Math.imul(al5, bh2)) | 0;\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\n    lo = (lo + Math.imul(al4, bl3)) | 0;\n    mid = (mid + Math.imul(al4, bh3)) | 0;\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\n    lo = (lo + Math.imul(al3, bl4)) | 0;\n    mid = (mid + Math.imul(al3, bh4)) | 0;\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\n    lo = (lo + Math.imul(al2, bl5)) | 0;\n    mid = (mid + Math.imul(al2, bh5)) | 0;\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\n    lo = (lo + Math.imul(al1, bl6)) | 0;\n    mid = (mid + Math.imul(al1, bh6)) | 0;\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\n    lo = (lo + Math.imul(al0, bl7)) | 0;\n    mid = (mid + Math.imul(al0, bh7)) | 0;\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\n    w7 &= 0x3ffffff;\n    /* k = 8 */\n    lo = Math.imul(al8, bl0);\n    mid = Math.imul(al8, bh0);\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\n    hi = Math.imul(ah8, bh0);\n    lo = (lo + Math.imul(al7, bl1)) | 0;\n    mid = (mid + Math.imul(al7, bh1)) | 0;\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\n    lo = (lo + Math.imul(al6, bl2)) | 0;\n    mid = (mid + Math.imul(al6, bh2)) | 0;\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\n    lo = (lo + Math.imul(al5, bl3)) | 0;\n    mid = (mid + Math.imul(al5, bh3)) | 0;\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\n    lo = (lo + Math.imul(al4, bl4)) | 0;\n    mid = (mid + Math.imul(al4, bh4)) | 0;\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\n    lo = (lo + Math.imul(al3, bl5)) | 0;\n    mid = (mid + Math.imul(al3, bh5)) | 0;\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\n    lo = (lo + Math.imul(al2, bl6)) | 0;\n    mid = (mid + Math.imul(al2, bh6)) | 0;\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\n    lo = (lo + Math.imul(al1, bl7)) | 0;\n    mid = (mid + Math.imul(al1, bh7)) | 0;\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\n    lo = (lo + Math.imul(al0, bl8)) | 0;\n    mid = (mid + Math.imul(al0, bh8)) | 0;\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\n    w8 &= 0x3ffffff;\n    /* k = 9 */\n    lo = Math.imul(al9, bl0);\n    mid = Math.imul(al9, bh0);\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\n    hi = Math.imul(ah9, bh0);\n    lo = (lo + Math.imul(al8, bl1)) | 0;\n    mid = (mid + Math.imul(al8, bh1)) | 0;\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\n    lo = (lo + Math.imul(al7, bl2)) | 0;\n    mid = (mid + Math.imul(al7, bh2)) | 0;\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\n    lo = (lo + Math.imul(al6, bl3)) | 0;\n    mid = (mid + Math.imul(al6, bh3)) | 0;\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\n    lo = (lo + Math.imul(al5, bl4)) | 0;\n    mid = (mid + Math.imul(al5, bh4)) | 0;\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\n    lo = (lo + Math.imul(al4, bl5)) | 0;\n    mid = (mid + Math.imul(al4, bh5)) | 0;\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\n    lo = (lo + Math.imul(al3, bl6)) | 0;\n    mid = (mid + Math.imul(al3, bh6)) | 0;\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\n    lo = (lo + Math.imul(al2, bl7)) | 0;\n    mid = (mid + Math.imul(al2, bh7)) | 0;\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\n    lo = (lo + Math.imul(al1, bl8)) | 0;\n    mid = (mid + Math.imul(al1, bh8)) | 0;\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\n    lo = (lo + Math.imul(al0, bl9)) | 0;\n    mid = (mid + Math.imul(al0, bh9)) | 0;\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\n    w9 &= 0x3ffffff;\n    /* k = 10 */\n    lo = Math.imul(al9, bl1);\n    mid = Math.imul(al9, bh1);\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\n    hi = Math.imul(ah9, bh1);\n    lo = (lo + Math.imul(al8, bl2)) | 0;\n    mid = (mid + Math.imul(al8, bh2)) | 0;\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\n    lo = (lo + Math.imul(al7, bl3)) | 0;\n    mid = (mid + Math.imul(al7, bh3)) | 0;\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\n    lo = (lo + Math.imul(al6, bl4)) | 0;\n    mid = (mid + Math.imul(al6, bh4)) | 0;\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\n    lo = (lo + Math.imul(al5, bl5)) | 0;\n    mid = (mid + Math.imul(al5, bh5)) | 0;\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\n    lo = (lo + Math.imul(al4, bl6)) | 0;\n    mid = (mid + Math.imul(al4, bh6)) | 0;\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\n    lo = (lo + Math.imul(al3, bl7)) | 0;\n    mid = (mid + Math.imul(al3, bh7)) | 0;\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\n    lo = (lo + Math.imul(al2, bl8)) | 0;\n    mid = (mid + Math.imul(al2, bh8)) | 0;\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\n    lo = (lo + Math.imul(al1, bl9)) | 0;\n    mid = (mid + Math.imul(al1, bh9)) | 0;\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\n    w10 &= 0x3ffffff;\n    /* k = 11 */\n    lo = Math.imul(al9, bl2);\n    mid = Math.imul(al9, bh2);\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\n    hi = Math.imul(ah9, bh2);\n    lo = (lo + Math.imul(al8, bl3)) | 0;\n    mid = (mid + Math.imul(al8, bh3)) | 0;\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\n    lo = (lo + Math.imul(al7, bl4)) | 0;\n    mid = (mid + Math.imul(al7, bh4)) | 0;\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\n    lo = (lo + Math.imul(al6, bl5)) | 0;\n    mid = (mid + Math.imul(al6, bh5)) | 0;\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\n    lo = (lo + Math.imul(al5, bl6)) | 0;\n    mid = (mid + Math.imul(al5, bh6)) | 0;\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\n    lo = (lo + Math.imul(al4, bl7)) | 0;\n    mid = (mid + Math.imul(al4, bh7)) | 0;\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\n    lo = (lo + Math.imul(al3, bl8)) | 0;\n    mid = (mid + Math.imul(al3, bh8)) | 0;\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\n    lo = (lo + Math.imul(al2, bl9)) | 0;\n    mid = (mid + Math.imul(al2, bh9)) | 0;\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\n    w11 &= 0x3ffffff;\n    /* k = 12 */\n    lo = Math.imul(al9, bl3);\n    mid = Math.imul(al9, bh3);\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\n    hi = Math.imul(ah9, bh3);\n    lo = (lo + Math.imul(al8, bl4)) | 0;\n    mid = (mid + Math.imul(al8, bh4)) | 0;\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\n    lo = (lo + Math.imul(al7, bl5)) | 0;\n    mid = (mid + Math.imul(al7, bh5)) | 0;\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\n    lo = (lo + Math.imul(al6, bl6)) | 0;\n    mid = (mid + Math.imul(al6, bh6)) | 0;\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\n    lo = (lo + Math.imul(al5, bl7)) | 0;\n    mid = (mid + Math.imul(al5, bh7)) | 0;\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\n    lo = (lo + Math.imul(al4, bl8)) | 0;\n    mid = (mid + Math.imul(al4, bh8)) | 0;\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\n    lo = (lo + Math.imul(al3, bl9)) | 0;\n    mid = (mid + Math.imul(al3, bh9)) | 0;\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\n    w12 &= 0x3ffffff;\n    /* k = 13 */\n    lo = Math.imul(al9, bl4);\n    mid = Math.imul(al9, bh4);\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\n    hi = Math.imul(ah9, bh4);\n    lo = (lo + Math.imul(al8, bl5)) | 0;\n    mid = (mid + Math.imul(al8, bh5)) | 0;\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\n    lo = (lo + Math.imul(al7, bl6)) | 0;\n    mid = (mid + Math.imul(al7, bh6)) | 0;\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\n    lo = (lo + Math.imul(al6, bl7)) | 0;\n    mid = (mid + Math.imul(al6, bh7)) | 0;\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\n    lo = (lo + Math.imul(al5, bl8)) | 0;\n    mid = (mid + Math.imul(al5, bh8)) | 0;\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\n    lo = (lo + Math.imul(al4, bl9)) | 0;\n    mid = (mid + Math.imul(al4, bh9)) | 0;\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\n    w13 &= 0x3ffffff;\n    /* k = 14 */\n    lo = Math.imul(al9, bl5);\n    mid = Math.imul(al9, bh5);\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\n    hi = Math.imul(ah9, bh5);\n    lo = (lo + Math.imul(al8, bl6)) | 0;\n    mid = (mid + Math.imul(al8, bh6)) | 0;\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\n    lo = (lo + Math.imul(al7, bl7)) | 0;\n    mid = (mid + Math.imul(al7, bh7)) | 0;\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\n    lo = (lo + Math.imul(al6, bl8)) | 0;\n    mid = (mid + Math.imul(al6, bh8)) | 0;\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\n    lo = (lo + Math.imul(al5, bl9)) | 0;\n    mid = (mid + Math.imul(al5, bh9)) | 0;\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\n    w14 &= 0x3ffffff;\n    /* k = 15 */\n    lo = Math.imul(al9, bl6);\n    mid = Math.imul(al9, bh6);\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\n    hi = Math.imul(ah9, bh6);\n    lo = (lo + Math.imul(al8, bl7)) | 0;\n    mid = (mid + Math.imul(al8, bh7)) | 0;\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\n    lo = (lo + Math.imul(al7, bl8)) | 0;\n    mid = (mid + Math.imul(al7, bh8)) | 0;\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\n    lo = (lo + Math.imul(al6, bl9)) | 0;\n    mid = (mid + Math.imul(al6, bh9)) | 0;\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\n    w15 &= 0x3ffffff;\n    /* k = 16 */\n    lo = Math.imul(al9, bl7);\n    mid = Math.imul(al9, bh7);\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\n    hi = Math.imul(ah9, bh7);\n    lo = (lo + Math.imul(al8, bl8)) | 0;\n    mid = (mid + Math.imul(al8, bh8)) | 0;\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\n    lo = (lo + Math.imul(al7, bl9)) | 0;\n    mid = (mid + Math.imul(al7, bh9)) | 0;\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\n    w16 &= 0x3ffffff;\n    /* k = 17 */\n    lo = Math.imul(al9, bl8);\n    mid = Math.imul(al9, bh8);\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\n    hi = Math.imul(ah9, bh8);\n    lo = (lo + Math.imul(al8, bl9)) | 0;\n    mid = (mid + Math.imul(al8, bh9)) | 0;\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\n    w17 &= 0x3ffffff;\n    /* k = 18 */\n    lo = Math.imul(al9, bl9);\n    mid = Math.imul(al9, bh9);\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\n    hi = Math.imul(ah9, bh9);\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\n    w18 &= 0x3ffffff;\n    o[0] = w0;\n    o[1] = w1;\n    o[2] = w2;\n    o[3] = w3;\n    o[4] = w4;\n    o[5] = w5;\n    o[6] = w6;\n    o[7] = w7;\n    o[8] = w8;\n    o[9] = w9;\n    o[10] = w10;\n    o[11] = w11;\n    o[12] = w12;\n    o[13] = w13;\n    o[14] = w14;\n    o[15] = w15;\n    o[16] = w16;\n    o[17] = w17;\n    o[18] = w18;\n    if (c !== 0) {\n      o[19] = c;\n      out.length++;\n    }\n    return out;\n  };\n\n  // Polyfill comb\n  if (!Math.imul) {\n    comb10MulTo = smallMulTo;\n  }\n\n  function bigMulTo (self, num, out) {\n    out.negative = num.negative ^ self.negative;\n    out.length = self.length + num.length;\n\n    var carry = 0;\n    var hncarry = 0;\n    for (var k = 0; k < out.length - 1; k++) {\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\n      // note that ncarry could be >= 0x3ffffff\n      var ncarry = hncarry;\n      hncarry = 0;\n      var rword = carry & 0x3ffffff;\n      var maxJ = Math.min(k, num.length - 1);\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\n        var i = k - j;\n        var a = self.words[i] | 0;\n        var b = num.words[j] | 0;\n        var r = a * b;\n\n        var lo = r & 0x3ffffff;\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\n        lo = (lo + rword) | 0;\n        rword = lo & 0x3ffffff;\n        ncarry = (ncarry + (lo >>> 26)) | 0;\n\n        hncarry += ncarry >>> 26;\n        ncarry &= 0x3ffffff;\n      }\n      out.words[k] = rword;\n      carry = ncarry;\n      ncarry = hncarry;\n    }\n    if (carry !== 0) {\n      out.words[k] = carry;\n    } else {\n      out.length--;\n    }\n\n    return out.strip();\n  }\n\n  function jumboMulTo (self, num, out) {\n    var fftm = new FFTM();\n    return fftm.mulp(self, num, out);\n  }\n\n  BN.prototype.mulTo = function mulTo (num, out) {\n    var res;\n    var len = this.length + num.length;\n    if (this.length === 10 && num.length === 10) {\n      res = comb10MulTo(this, num, out);\n    } else if (len < 63) {\n      res = smallMulTo(this, num, out);\n    } else if (len < 1024) {\n      res = bigMulTo(this, num, out);\n    } else {\n      res = jumboMulTo(this, num, out);\n    }\n\n    return res;\n  };\n\n  // Cooley-Tukey algorithm for FFT\n  // slightly revisited to rely on looping instead of recursion\n\n  function FFTM (x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  FFTM.prototype.makeRBT = function makeRBT (N) {\n    var t = new Array(N);\n    var l = BN.prototype._countBits(N) - 1;\n    for (var i = 0; i < N; i++) {\n      t[i] = this.revBin(i, l, N);\n    }\n\n    return t;\n  };\n\n  // Returns binary-reversed representation of `x`\n  FFTM.prototype.revBin = function revBin (x, l, N) {\n    if (x === 0 || x === N - 1) return x;\n\n    var rb = 0;\n    for (var i = 0; i < l; i++) {\n      rb |= (x & 1) << (l - i - 1);\n      x >>= 1;\n    }\n\n    return rb;\n  };\n\n  // Performs \"tweedling\" phase, therefore 'emulating'\n  // behaviour of the recursive algorithm\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\n    for (var i = 0; i < N; i++) {\n      rtws[i] = rws[rbt[i]];\n      itws[i] = iws[rbt[i]];\n    }\n  };\n\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\n    this.permute(rbt, rws, iws, rtws, itws, N);\n\n    for (var s = 1; s < N; s <<= 1) {\n      var l = s << 1;\n\n      var rtwdf = Math.cos(2 * Math.PI / l);\n      var itwdf = Math.sin(2 * Math.PI / l);\n\n      for (var p = 0; p < N; p += l) {\n        var rtwdf_ = rtwdf;\n        var itwdf_ = itwdf;\n\n        for (var j = 0; j < s; j++) {\n          var re = rtws[p + j];\n          var ie = itws[p + j];\n\n          var ro = rtws[p + j + s];\n          var io = itws[p + j + s];\n\n          var rx = rtwdf_ * ro - itwdf_ * io;\n\n          io = rtwdf_ * io + itwdf_ * ro;\n          ro = rx;\n\n          rtws[p + j] = re + ro;\n          itws[p + j] = ie + io;\n\n          rtws[p + j + s] = re - ro;\n          itws[p + j + s] = ie - io;\n\n          /* jshint maxdepth : false */\n          if (j !== l) {\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\n\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\n            rtwdf_ = rx;\n          }\n        }\n      }\n    }\n  };\n\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\n    var N = Math.max(m, n) | 1;\n    var odd = N & 1;\n    var i = 0;\n    for (N = N / 2 | 0; N; N = N >>> 1) {\n      i++;\n    }\n\n    return 1 << i + 1 + odd;\n  };\n\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\n    if (N <= 1) return;\n\n    for (var i = 0; i < N / 2; i++) {\n      var t = rws[i];\n\n      rws[i] = rws[N - i - 1];\n      rws[N - i - 1] = t;\n\n      t = iws[i];\n\n      iws[i] = -iws[N - i - 1];\n      iws[N - i - 1] = -t;\n    }\n  };\n\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\n    var carry = 0;\n    for (var i = 0; i < N / 2; i++) {\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\n        Math.round(ws[2 * i] / N) +\n        carry;\n\n      ws[i] = w & 0x3ffffff;\n\n      if (w < 0x4000000) {\n        carry = 0;\n      } else {\n        carry = w / 0x4000000 | 0;\n      }\n    }\n\n    return ws;\n  };\n\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\n    var carry = 0;\n    for (var i = 0; i < len; i++) {\n      carry = carry + (ws[i] | 0);\n\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\n    }\n\n    // Pad with zeroes\n    for (i = 2 * len; i < N; ++i) {\n      rws[i] = 0;\n    }\n\n    assert(carry === 0);\n    assert((carry & ~0x1fff) === 0);\n  };\n\n  FFTM.prototype.stub = function stub (N) {\n    var ph = new Array(N);\n    for (var i = 0; i < N; i++) {\n      ph[i] = 0;\n    }\n\n    return ph;\n  };\n\n  FFTM.prototype.mulp = function mulp (x, y, out) {\n    var N = 2 * this.guessLen13b(x.length, y.length);\n\n    var rbt = this.makeRBT(N);\n\n    var _ = this.stub(N);\n\n    var rws = new Array(N);\n    var rwst = new Array(N);\n    var iwst = new Array(N);\n\n    var nrws = new Array(N);\n    var nrwst = new Array(N);\n    var niwst = new Array(N);\n\n    var rmws = out.words;\n    rmws.length = N;\n\n    this.convert13b(x.words, x.length, rws, N);\n    this.convert13b(y.words, y.length, nrws, N);\n\n    this.transform(rws, _, rwst, iwst, N, rbt);\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\n\n    for (var i = 0; i < N; i++) {\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\n      rwst[i] = rx;\n    }\n\n    this.conjugate(rwst, iwst, N);\n    this.transform(rwst, iwst, rmws, _, N, rbt);\n    this.conjugate(rmws, _, N);\n    this.normalize13b(rmws, N);\n\n    out.negative = x.negative ^ y.negative;\n    out.length = x.length + y.length;\n    return out.strip();\n  };\n\n  // Multiply `this` by `num`\n  BN.prototype.mul = function mul (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return this.mulTo(num, out);\n  };\n\n  // Multiply employing FFT\n  BN.prototype.mulf = function mulf (num) {\n    var out = new BN(null);\n    out.words = new Array(this.length + num.length);\n    return jumboMulTo(this, num, out);\n  };\n\n  // In-place Multiplication\n  BN.prototype.imul = function imul (num) {\n    return this.clone().mulTo(num, this);\n  };\n\n  BN.prototype.imuln = function imuln (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n\n    // Carry\n    var carry = 0;\n    for (var i = 0; i < this.length; i++) {\n      var w = (this.words[i] | 0) * num;\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\n      carry >>= 26;\n      carry += (w / 0x4000000) | 0;\n      // NOTE: lo is 27bit maximum\n      carry += lo >>> 26;\n      this.words[i] = lo & 0x3ffffff;\n    }\n\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n\n    return this;\n  };\n\n  BN.prototype.muln = function muln (num) {\n    return this.clone().imuln(num);\n  };\n\n  // `this` * `this`\n  BN.prototype.sqr = function sqr () {\n    return this.mul(this);\n  };\n\n  // `this` * `this` in-place\n  BN.prototype.isqr = function isqr () {\n    return this.imul(this.clone());\n  };\n\n  // Math.pow(`this`, `num`)\n  BN.prototype.pow = function pow (num) {\n    var w = toBitArray(num);\n    if (w.length === 0) return new BN(1);\n\n    // Skip leading zeroes\n    var res = this;\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\n      if (w[i] !== 0) break;\n    }\n\n    if (++i < w.length) {\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\n        if (w[i] === 0) continue;\n\n        res = res.mul(q);\n      }\n    }\n\n    return res;\n  };\n\n  // Shift-left in-place\n  BN.prototype.iushln = function iushln (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\n    var i;\n\n    if (r !== 0) {\n      var carry = 0;\n\n      for (i = 0; i < this.length; i++) {\n        var newCarry = this.words[i] & carryMask;\n        var c = ((this.words[i] | 0) - newCarry) << r;\n        this.words[i] = c | carry;\n        carry = newCarry >>> (26 - r);\n      }\n\n      if (carry) {\n        this.words[i] = carry;\n        this.length++;\n      }\n    }\n\n    if (s !== 0) {\n      for (i = this.length - 1; i >= 0; i--) {\n        this.words[i + s] = this.words[i];\n      }\n\n      for (i = 0; i < s; i++) {\n        this.words[i] = 0;\n      }\n\n      this.length += s;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishln = function ishln (bits) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushln(bits);\n  };\n\n  // Shift-right in-place\n  // NOTE: `hint` is a lowest bit before trailing zeroes\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var h;\n    if (hint) {\n      h = (hint - (hint % 26)) / 26;\n    } else {\n      h = 0;\n    }\n\n    var r = bits % 26;\n    var s = Math.min((bits - r) / 26, this.length);\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n    var maskedWords = extended;\n\n    h -= s;\n    h = Math.max(0, h);\n\n    // Extended mode, copy masked part\n    if (maskedWords) {\n      for (var i = 0; i < s; i++) {\n        maskedWords.words[i] = this.words[i];\n      }\n      maskedWords.length = s;\n    }\n\n    if (s === 0) {\n      // No-op, we should not move anything at all\n    } else if (this.length > s) {\n      this.length -= s;\n      for (i = 0; i < this.length; i++) {\n        this.words[i] = this.words[i + s];\n      }\n    } else {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    var carry = 0;\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\n      var word = this.words[i] | 0;\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\n      carry = word & mask;\n    }\n\n    // Push carried bits as a mask\n    if (maskedWords && carry !== 0) {\n      maskedWords.words[maskedWords.length++] = carry;\n    }\n\n    if (this.length === 0) {\n      this.words[0] = 0;\n      this.length = 1;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\n    // TODO(indutny): implement me\n    assert(this.negative === 0);\n    return this.iushrn(bits, hint, extended);\n  };\n\n  // Shift-left\n  BN.prototype.shln = function shln (bits) {\n    return this.clone().ishln(bits);\n  };\n\n  BN.prototype.ushln = function ushln (bits) {\n    return this.clone().iushln(bits);\n  };\n\n  // Shift-right\n  BN.prototype.shrn = function shrn (bits) {\n    return this.clone().ishrn(bits);\n  };\n\n  BN.prototype.ushrn = function ushrn (bits) {\n    return this.clone().iushrn(bits);\n  };\n\n  // Test if n bit is set\n  BN.prototype.testn = function testn (bit) {\n    assert(typeof bit === 'number' && bit >= 0);\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) return false;\n\n    // Check bit and return\n    var w = this.words[s];\n\n    return !!(w & q);\n  };\n\n  // Return only lowers bits of number (in-place)\n  BN.prototype.imaskn = function imaskn (bits) {\n    assert(typeof bits === 'number' && bits >= 0);\n    var r = bits % 26;\n    var s = (bits - r) / 26;\n\n    assert(this.negative === 0, 'imaskn works only with positive numbers');\n\n    if (this.length <= s) {\n      return this;\n    }\n\n    if (r !== 0) {\n      s++;\n    }\n    this.length = Math.min(s, this.length);\n\n    if (r !== 0) {\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\n      this.words[this.length - 1] &= mask;\n    }\n\n    return this.strip();\n  };\n\n  // Return only lowers bits of number\n  BN.prototype.maskn = function maskn (bits) {\n    return this.clone().imaskn(bits);\n  };\n\n  // Add plain number `num` to `this`\n  BN.prototype.iaddn = function iaddn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.isubn(-num);\n\n    // Possible sign change\n    if (this.negative !== 0) {\n      if (this.length === 1 && (this.words[0] | 0) < num) {\n        this.words[0] = num - (this.words[0] | 0);\n        this.negative = 0;\n        return this;\n      }\n\n      this.negative = 0;\n      this.isubn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    // Add without checks\n    return this._iaddn(num);\n  };\n\n  BN.prototype._iaddn = function _iaddn (num) {\n    this.words[0] += num;\n\n    // Carry\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\n      this.words[i] -= 0x4000000;\n      if (i === this.length - 1) {\n        this.words[i + 1] = 1;\n      } else {\n        this.words[i + 1]++;\n      }\n    }\n    this.length = Math.max(this.length, i + 1);\n\n    return this;\n  };\n\n  // Subtract plain number `num` from `this`\n  BN.prototype.isubn = function isubn (num) {\n    assert(typeof num === 'number');\n    assert(num < 0x4000000);\n    if (num < 0) return this.iaddn(-num);\n\n    if (this.negative !== 0) {\n      this.negative = 0;\n      this.iaddn(num);\n      this.negative = 1;\n      return this;\n    }\n\n    this.words[0] -= num;\n\n    if (this.length === 1 && this.words[0] < 0) {\n      this.words[0] = -this.words[0];\n      this.negative = 1;\n    } else {\n      // Carry\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\n        this.words[i] += 0x4000000;\n        this.words[i + 1] -= 1;\n      }\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.addn = function addn (num) {\n    return this.clone().iaddn(num);\n  };\n\n  BN.prototype.subn = function subn (num) {\n    return this.clone().isubn(num);\n  };\n\n  BN.prototype.iabs = function iabs () {\n    this.negative = 0;\n\n    return this;\n  };\n\n  BN.prototype.abs = function abs () {\n    return this.clone().iabs();\n  };\n\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\n    var len = num.length + shift;\n    var i;\n\n    this._expand(len);\n\n    var w;\n    var carry = 0;\n    for (i = 0; i < num.length; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      var right = (num.words[i] | 0) * mul;\n      w -= right & 0x3ffffff;\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n    for (; i < this.length - shift; i++) {\n      w = (this.words[i + shift] | 0) + carry;\n      carry = w >> 26;\n      this.words[i + shift] = w & 0x3ffffff;\n    }\n\n    if (carry === 0) return this.strip();\n\n    // Subtraction overflow\n    assert(carry === -1);\n    carry = 0;\n    for (i = 0; i < this.length; i++) {\n      w = -(this.words[i] | 0) + carry;\n      carry = w >> 26;\n      this.words[i] = w & 0x3ffffff;\n    }\n    this.negative = 1;\n\n    return this.strip();\n  };\n\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\n    var shift = this.length - num.length;\n\n    var a = this.clone();\n    var b = num;\n\n    // Normalize\n    var bhi = b.words[b.length - 1] | 0;\n    var bhiBits = this._countBits(bhi);\n    shift = 26 - bhiBits;\n    if (shift !== 0) {\n      b = b.ushln(shift);\n      a.iushln(shift);\n      bhi = b.words[b.length - 1] | 0;\n    }\n\n    // Initialize quotient\n    var m = a.length - b.length;\n    var q;\n\n    if (mode !== 'mod') {\n      q = new BN(null);\n      q.length = m + 1;\n      q.words = new Array(q.length);\n      for (var i = 0; i < q.length; i++) {\n        q.words[i] = 0;\n      }\n    }\n\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\n    if (diff.negative === 0) {\n      a = diff;\n      if (q) {\n        q.words[m] = 1;\n      }\n    }\n\n    for (var j = m - 1; j >= 0; j--) {\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\n        (a.words[b.length + j - 1] | 0);\n\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\n      // (0x7ffffff)\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\n\n      a._ishlnsubmul(b, qj, j);\n      while (a.negative !== 0) {\n        qj--;\n        a.negative = 0;\n        a._ishlnsubmul(b, 1, j);\n        if (!a.isZero()) {\n          a.negative ^= 1;\n        }\n      }\n      if (q) {\n        q.words[j] = qj;\n      }\n    }\n    if (q) {\n      q.strip();\n    }\n    a.strip();\n\n    // Denormalize\n    if (mode !== 'div' && shift !== 0) {\n      a.iushrn(shift);\n    }\n\n    return {\n      div: q || null,\n      mod: a\n    };\n  };\n\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\n  //       to `div` to request div only, or be absent to\n  //       request both div & mod\n  //       2) `positive` is true if unsigned mod is requested\n  BN.prototype.divmod = function divmod (num, mode, positive) {\n    assert(!num.isZero());\n\n    if (this.isZero()) {\n      return {\n        div: new BN(0),\n        mod: new BN(0)\n      };\n    }\n\n    var div, mod, res;\n    if (this.negative !== 0 && num.negative === 0) {\n      res = this.neg().divmod(num, mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.iadd(num);\n        }\n      }\n\n      return {\n        div: div,\n        mod: mod\n      };\n    }\n\n    if (this.negative === 0 && num.negative !== 0) {\n      res = this.divmod(num.neg(), mode);\n\n      if (mode !== 'mod') {\n        div = res.div.neg();\n      }\n\n      return {\n        div: div,\n        mod: res.mod\n      };\n    }\n\n    if ((this.negative & num.negative) !== 0) {\n      res = this.neg().divmod(num.neg(), mode);\n\n      if (mode !== 'div') {\n        mod = res.mod.neg();\n        if (positive && mod.negative !== 0) {\n          mod.isub(num);\n        }\n      }\n\n      return {\n        div: res.div,\n        mod: mod\n      };\n    }\n\n    // Both numbers are positive at this point\n\n    // Strip both numbers to approximate shift value\n    if (num.length > this.length || this.cmp(num) < 0) {\n      return {\n        div: new BN(0),\n        mod: this\n      };\n    }\n\n    // Very short reduction\n    if (num.length === 1) {\n      if (mode === 'div') {\n        return {\n          div: this.divn(num.words[0]),\n          mod: null\n        };\n      }\n\n      if (mode === 'mod') {\n        return {\n          div: null,\n          mod: new BN(this.modn(num.words[0]))\n        };\n      }\n\n      return {\n        div: this.divn(num.words[0]),\n        mod: new BN(this.modn(num.words[0]))\n      };\n    }\n\n    return this._wordDiv(num, mode);\n  };\n\n  // Find `this` / `num`\n  BN.prototype.div = function div (num) {\n    return this.divmod(num, 'div', false).div;\n  };\n\n  // Find `this` % `num`\n  BN.prototype.mod = function mod (num) {\n    return this.divmod(num, 'mod', false).mod;\n  };\n\n  BN.prototype.umod = function umod (num) {\n    return this.divmod(num, 'mod', true).mod;\n  };\n\n  // Find Round(`this` / `num`)\n  BN.prototype.divRound = function divRound (num) {\n    var dm = this.divmod(num);\n\n    // Fast case - exact division\n    if (dm.mod.isZero()) return dm.div;\n\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\n\n    var half = num.ushrn(1);\n    var r2 = num.andln(1);\n    var cmp = mod.cmp(half);\n\n    // Round down\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\n\n    // Round up\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\n  };\n\n  BN.prototype.modn = function modn (num) {\n    assert(num <= 0x3ffffff);\n    var p = (1 << 26) % num;\n\n    var acc = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      acc = (p * acc + (this.words[i] | 0)) % num;\n    }\n\n    return acc;\n  };\n\n  // In-place division by number\n  BN.prototype.idivn = function idivn (num) {\n    assert(num <= 0x3ffffff);\n\n    var carry = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var w = (this.words[i] | 0) + carry * 0x4000000;\n      this.words[i] = (w / num) | 0;\n      carry = w % num;\n    }\n\n    return this.strip();\n  };\n\n  BN.prototype.divn = function divn (num) {\n    return this.clone().idivn(num);\n  };\n\n  BN.prototype.egcd = function egcd (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var x = this;\n    var y = p.clone();\n\n    if (x.negative !== 0) {\n      x = x.umod(p);\n    } else {\n      x = x.clone();\n    }\n\n    // A * x + B * y = x\n    var A = new BN(1);\n    var B = new BN(0);\n\n    // C * x + D * y = y\n    var C = new BN(0);\n    var D = new BN(1);\n\n    var g = 0;\n\n    while (x.isEven() && y.isEven()) {\n      x.iushrn(1);\n      y.iushrn(1);\n      ++g;\n    }\n\n    var yp = y.clone();\n    var xp = x.clone();\n\n    while (!x.isZero()) {\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        x.iushrn(i);\n        while (i-- > 0) {\n          if (A.isOdd() || B.isOdd()) {\n            A.iadd(yp);\n            B.isub(xp);\n          }\n\n          A.iushrn(1);\n          B.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        y.iushrn(j);\n        while (j-- > 0) {\n          if (C.isOdd() || D.isOdd()) {\n            C.iadd(yp);\n            D.isub(xp);\n          }\n\n          C.iushrn(1);\n          D.iushrn(1);\n        }\n      }\n\n      if (x.cmp(y) >= 0) {\n        x.isub(y);\n        A.isub(C);\n        B.isub(D);\n      } else {\n        y.isub(x);\n        C.isub(A);\n        D.isub(B);\n      }\n    }\n\n    return {\n      a: C,\n      b: D,\n      gcd: y.iushln(g)\n    };\n  };\n\n  // This is reduced incarnation of the binary EEA\n  // above, designated to invert members of the\n  // _prime_ fields F(p) at a maximal speed\n  BN.prototype._invmp = function _invmp (p) {\n    assert(p.negative === 0);\n    assert(!p.isZero());\n\n    var a = this;\n    var b = p.clone();\n\n    if (a.negative !== 0) {\n      a = a.umod(p);\n    } else {\n      a = a.clone();\n    }\n\n    var x1 = new BN(1);\n    var x2 = new BN(0);\n\n    var delta = b.clone();\n\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\n      if (i > 0) {\n        a.iushrn(i);\n        while (i-- > 0) {\n          if (x1.isOdd()) {\n            x1.iadd(delta);\n          }\n\n          x1.iushrn(1);\n        }\n      }\n\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\n      if (j > 0) {\n        b.iushrn(j);\n        while (j-- > 0) {\n          if (x2.isOdd()) {\n            x2.iadd(delta);\n          }\n\n          x2.iushrn(1);\n        }\n      }\n\n      if (a.cmp(b) >= 0) {\n        a.isub(b);\n        x1.isub(x2);\n      } else {\n        b.isub(a);\n        x2.isub(x1);\n      }\n    }\n\n    var res;\n    if (a.cmpn(1) === 0) {\n      res = x1;\n    } else {\n      res = x2;\n    }\n\n    if (res.cmpn(0) < 0) {\n      res.iadd(p);\n    }\n\n    return res;\n  };\n\n  BN.prototype.gcd = function gcd (num) {\n    if (this.isZero()) return num.abs();\n    if (num.isZero()) return this.abs();\n\n    var a = this.clone();\n    var b = num.clone();\n    a.negative = 0;\n    b.negative = 0;\n\n    // Remove common factor of two\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\n      a.iushrn(1);\n      b.iushrn(1);\n    }\n\n    do {\n      while (a.isEven()) {\n        a.iushrn(1);\n      }\n      while (b.isEven()) {\n        b.iushrn(1);\n      }\n\n      var r = a.cmp(b);\n      if (r < 0) {\n        // Swap `a` and `b` to make `a` always bigger than `b`\n        var t = a;\n        a = b;\n        b = t;\n      } else if (r === 0 || b.cmpn(1) === 0) {\n        break;\n      }\n\n      a.isub(b);\n    } while (true);\n\n    return b.iushln(shift);\n  };\n\n  // Invert number in the field F(num)\n  BN.prototype.invm = function invm (num) {\n    return this.egcd(num).a.umod(num);\n  };\n\n  BN.prototype.isEven = function isEven () {\n    return (this.words[0] & 1) === 0;\n  };\n\n  BN.prototype.isOdd = function isOdd () {\n    return (this.words[0] & 1) === 1;\n  };\n\n  // And first word and num\n  BN.prototype.andln = function andln (num) {\n    return this.words[0] & num;\n  };\n\n  // Increment at the bit position in-line\n  BN.prototype.bincn = function bincn (bit) {\n    assert(typeof bit === 'number');\n    var r = bit % 26;\n    var s = (bit - r) / 26;\n    var q = 1 << r;\n\n    // Fast case: bit is much higher than all existing words\n    if (this.length <= s) {\n      this._expand(s + 1);\n      this.words[s] |= q;\n      return this;\n    }\n\n    // Add bit and propagate, if needed\n    var carry = q;\n    for (var i = s; carry !== 0 && i < this.length; i++) {\n      var w = this.words[i] | 0;\n      w += carry;\n      carry = w >>> 26;\n      w &= 0x3ffffff;\n      this.words[i] = w;\n    }\n    if (carry !== 0) {\n      this.words[i] = carry;\n      this.length++;\n    }\n    return this;\n  };\n\n  BN.prototype.isZero = function isZero () {\n    return this.length === 1 && this.words[0] === 0;\n  };\n\n  BN.prototype.cmpn = function cmpn (num) {\n    var negative = num < 0;\n\n    if (this.negative !== 0 && !negative) return -1;\n    if (this.negative === 0 && negative) return 1;\n\n    this.strip();\n\n    var res;\n    if (this.length > 1) {\n      res = 1;\n    } else {\n      if (negative) {\n        num = -num;\n      }\n\n      assert(num <= 0x3ffffff, 'Number is too big');\n\n      var w = this.words[0] | 0;\n      res = w === num ? 0 : w < num ? -1 : 1;\n    }\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Compare two numbers and return:\n  // 1 - if `this` > `num`\n  // 0 - if `this` == `num`\n  // -1 - if `this` < `num`\n  BN.prototype.cmp = function cmp (num) {\n    if (this.negative !== 0 && num.negative === 0) return -1;\n    if (this.negative === 0 && num.negative !== 0) return 1;\n\n    var res = this.ucmp(num);\n    if (this.negative !== 0) return -res | 0;\n    return res;\n  };\n\n  // Unsigned comparison\n  BN.prototype.ucmp = function ucmp (num) {\n    // At this point both numbers have the same sign\n    if (this.length > num.length) return 1;\n    if (this.length < num.length) return -1;\n\n    var res = 0;\n    for (var i = this.length - 1; i >= 0; i--) {\n      var a = this.words[i] | 0;\n      var b = num.words[i] | 0;\n\n      if (a === b) continue;\n      if (a < b) {\n        res = -1;\n      } else if (a > b) {\n        res = 1;\n      }\n      break;\n    }\n    return res;\n  };\n\n  BN.prototype.gtn = function gtn (num) {\n    return this.cmpn(num) === 1;\n  };\n\n  BN.prototype.gt = function gt (num) {\n    return this.cmp(num) === 1;\n  };\n\n  BN.prototype.gten = function gten (num) {\n    return this.cmpn(num) >= 0;\n  };\n\n  BN.prototype.gte = function gte (num) {\n    return this.cmp(num) >= 0;\n  };\n\n  BN.prototype.ltn = function ltn (num) {\n    return this.cmpn(num) === -1;\n  };\n\n  BN.prototype.lt = function lt (num) {\n    return this.cmp(num) === -1;\n  };\n\n  BN.prototype.lten = function lten (num) {\n    return this.cmpn(num) <= 0;\n  };\n\n  BN.prototype.lte = function lte (num) {\n    return this.cmp(num) <= 0;\n  };\n\n  BN.prototype.eqn = function eqn (num) {\n    return this.cmpn(num) === 0;\n  };\n\n  BN.prototype.eq = function eq (num) {\n    return this.cmp(num) === 0;\n  };\n\n  //\n  // A reduce context, could be using montgomery or something better, depending\n  // on the `m` itself.\n  //\n  BN.red = function red (num) {\n    return new Red(num);\n  };\n\n  BN.prototype.toRed = function toRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    assert(this.negative === 0, 'red works only with positives');\n    return ctx.convertTo(this)._forceRed(ctx);\n  };\n\n  BN.prototype.fromRed = function fromRed () {\n    assert(this.red, 'fromRed works only with numbers in reduction context');\n    return this.red.convertFrom(this);\n  };\n\n  BN.prototype._forceRed = function _forceRed (ctx) {\n    this.red = ctx;\n    return this;\n  };\n\n  BN.prototype.forceRed = function forceRed (ctx) {\n    assert(!this.red, 'Already a number in reduction context');\n    return this._forceRed(ctx);\n  };\n\n  BN.prototype.redAdd = function redAdd (num) {\n    assert(this.red, 'redAdd works only with red numbers');\n    return this.red.add(this, num);\n  };\n\n  BN.prototype.redIAdd = function redIAdd (num) {\n    assert(this.red, 'redIAdd works only with red numbers');\n    return this.red.iadd(this, num);\n  };\n\n  BN.prototype.redSub = function redSub (num) {\n    assert(this.red, 'redSub works only with red numbers');\n    return this.red.sub(this, num);\n  };\n\n  BN.prototype.redISub = function redISub (num) {\n    assert(this.red, 'redISub works only with red numbers');\n    return this.red.isub(this, num);\n  };\n\n  BN.prototype.redShl = function redShl (num) {\n    assert(this.red, 'redShl works only with red numbers');\n    return this.red.shl(this, num);\n  };\n\n  BN.prototype.redMul = function redMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.mul(this, num);\n  };\n\n  BN.prototype.redIMul = function redIMul (num) {\n    assert(this.red, 'redMul works only with red numbers');\n    this.red._verify2(this, num);\n    return this.red.imul(this, num);\n  };\n\n  BN.prototype.redSqr = function redSqr () {\n    assert(this.red, 'redSqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqr(this);\n  };\n\n  BN.prototype.redISqr = function redISqr () {\n    assert(this.red, 'redISqr works only with red numbers');\n    this.red._verify1(this);\n    return this.red.isqr(this);\n  };\n\n  // Square root over p\n  BN.prototype.redSqrt = function redSqrt () {\n    assert(this.red, 'redSqrt works only with red numbers');\n    this.red._verify1(this);\n    return this.red.sqrt(this);\n  };\n\n  BN.prototype.redInvm = function redInvm () {\n    assert(this.red, 'redInvm works only with red numbers');\n    this.red._verify1(this);\n    return this.red.invm(this);\n  };\n\n  // Return negative clone of `this` % `red modulo`\n  BN.prototype.redNeg = function redNeg () {\n    assert(this.red, 'redNeg works only with red numbers');\n    this.red._verify1(this);\n    return this.red.neg(this);\n  };\n\n  BN.prototype.redPow = function redPow (num) {\n    assert(this.red && !num.red, 'redPow(normalNum)');\n    this.red._verify1(this);\n    return this.red.pow(this, num);\n  };\n\n  // Prime numbers with efficient reduction\n  var primes = {\n    k256: null,\n    p224: null,\n    p192: null,\n    p25519: null\n  };\n\n  // Pseudo-Mersenne prime\n  function MPrime (name, p) {\n    // P = 2 ^ N - K\n    this.name = name;\n    this.p = new BN(p, 16);\n    this.n = this.p.bitLength();\n    this.k = new BN(1).iushln(this.n).isub(this.p);\n\n    this.tmp = this._tmp();\n  }\n\n  MPrime.prototype._tmp = function _tmp () {\n    var tmp = new BN(null);\n    tmp.words = new Array(Math.ceil(this.n / 13));\n    return tmp;\n  };\n\n  MPrime.prototype.ireduce = function ireduce (num) {\n    // Assumes that `num` is less than `P^2`\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\n    var r = num;\n    var rlen;\n\n    do {\n      this.split(r, this.tmp);\n      r = this.imulK(r);\n      r = r.iadd(this.tmp);\n      rlen = r.bitLength();\n    } while (rlen > this.n);\n\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\n    if (cmp === 0) {\n      r.words[0] = 0;\n      r.length = 1;\n    } else if (cmp > 0) {\n      r.isub(this.p);\n    } else {\n      r.strip();\n    }\n\n    return r;\n  };\n\n  MPrime.prototype.split = function split (input, out) {\n    input.iushrn(this.n, 0, out);\n  };\n\n  MPrime.prototype.imulK = function imulK (num) {\n    return num.imul(this.k);\n  };\n\n  function K256 () {\n    MPrime.call(\n      this,\n      'k256',\n      'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f');\n  }\n  inherits(K256, MPrime);\n\n  K256.prototype.split = function split (input, output) {\n    // 256 = 9 * 26 + 22\n    var mask = 0x3fffff;\n\n    var outLen = Math.min(input.length, 9);\n    for (var i = 0; i < outLen; i++) {\n      output.words[i] = input.words[i];\n    }\n    output.length = outLen;\n\n    if (input.length <= 9) {\n      input.words[0] = 0;\n      input.length = 1;\n      return;\n    }\n\n    // Shift by 9 limbs\n    var prev = input.words[9];\n    output.words[output.length++] = prev & mask;\n\n    for (i = 10; i < input.length; i++) {\n      var next = input.words[i] | 0;\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\n      prev = next;\n    }\n    prev >>>= 22;\n    input.words[i - 10] = prev;\n    if (prev === 0 && input.length > 10) {\n      input.length -= 10;\n    } else {\n      input.length -= 9;\n    }\n  };\n\n  K256.prototype.imulK = function imulK (num) {\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\n    num.words[num.length] = 0;\n    num.words[num.length + 1] = 0;\n    num.length += 2;\n\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\n    var lo = 0;\n    for (var i = 0; i < num.length; i++) {\n      var w = num.words[i] | 0;\n      lo += w * 0x3d1;\n      num.words[i] = lo & 0x3ffffff;\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\n    }\n\n    // Fast length reduction\n    if (num.words[num.length - 1] === 0) {\n      num.length--;\n      if (num.words[num.length - 1] === 0) {\n        num.length--;\n      }\n    }\n    return num;\n  };\n\n  function P224 () {\n    MPrime.call(\n      this,\n      'p224',\n      'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001');\n  }\n  inherits(P224, MPrime);\n\n  function P192 () {\n    MPrime.call(\n      this,\n      'p192',\n      'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff');\n  }\n  inherits(P192, MPrime);\n\n  function P25519 () {\n    // 2 ^ 255 - 19\n    MPrime.call(\n      this,\n      '25519',\n      '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed');\n  }\n  inherits(P25519, MPrime);\n\n  P25519.prototype.imulK = function imulK (num) {\n    // K = 0x13\n    var carry = 0;\n    for (var i = 0; i < num.length; i++) {\n      var hi = (num.words[i] | 0) * 0x13 + carry;\n      var lo = hi & 0x3ffffff;\n      hi >>>= 26;\n\n      num.words[i] = lo;\n      carry = hi;\n    }\n    if (carry !== 0) {\n      num.words[num.length++] = carry;\n    }\n    return num;\n  };\n\n  // Exported mostly for testing purposes, use plain name instead\n  BN._prime = function prime (name) {\n    // Cached version of prime\n    if (primes[name]) return primes[name];\n\n    var prime;\n    if (name === 'k256') {\n      prime = new K256();\n    } else if (name === 'p224') {\n      prime = new P224();\n    } else if (name === 'p192') {\n      prime = new P192();\n    } else if (name === 'p25519') {\n      prime = new P25519();\n    } else {\n      throw new Error('Unknown prime ' + name);\n    }\n    primes[name] = prime;\n\n    return prime;\n  };\n\n  //\n  // Base reduction engine\n  //\n  function Red (m) {\n    if (typeof m === 'string') {\n      var prime = BN._prime(m);\n      this.m = prime.p;\n      this.prime = prime;\n    } else {\n      assert(m.gtn(1), 'modulus must be greater than 1');\n      this.m = m;\n      this.prime = null;\n    }\n  }\n\n  Red.prototype._verify1 = function _verify1 (a) {\n    assert(a.negative === 0, 'red works only with positives');\n    assert(a.red, 'red works only with red numbers');\n  };\n\n  Red.prototype._verify2 = function _verify2 (a, b) {\n    assert((a.negative | b.negative) === 0, 'red works only with positives');\n    assert(a.red && a.red === b.red,\n      'red works only with red numbers');\n  };\n\n  Red.prototype.imod = function imod (a) {\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\n    return a.umod(this.m)._forceRed(this);\n  };\n\n  Red.prototype.neg = function neg (a) {\n    if (a.isZero()) {\n      return a.clone();\n    }\n\n    return this.m.sub(a)._forceRed(this);\n  };\n\n  Red.prototype.add = function add (a, b) {\n    this._verify2(a, b);\n\n    var res = a.add(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.iadd = function iadd (a, b) {\n    this._verify2(a, b);\n\n    var res = a.iadd(b);\n    if (res.cmp(this.m) >= 0) {\n      res.isub(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.sub = function sub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.sub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res._forceRed(this);\n  };\n\n  Red.prototype.isub = function isub (a, b) {\n    this._verify2(a, b);\n\n    var res = a.isub(b);\n    if (res.cmpn(0) < 0) {\n      res.iadd(this.m);\n    }\n    return res;\n  };\n\n  Red.prototype.shl = function shl (a, num) {\n    this._verify1(a);\n    return this.imod(a.ushln(num));\n  };\n\n  Red.prototype.imul = function imul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.imul(b));\n  };\n\n  Red.prototype.mul = function mul (a, b) {\n    this._verify2(a, b);\n    return this.imod(a.mul(b));\n  };\n\n  Red.prototype.isqr = function isqr (a) {\n    return this.imul(a, a.clone());\n  };\n\n  Red.prototype.sqr = function sqr (a) {\n    return this.mul(a, a);\n  };\n\n  Red.prototype.sqrt = function sqrt (a) {\n    if (a.isZero()) return a.clone();\n\n    var mod3 = this.m.andln(3);\n    assert(mod3 % 2 === 1);\n\n    // Fast case\n    if (mod3 === 3) {\n      var pow = this.m.add(new BN(1)).iushrn(2);\n      return this.pow(a, pow);\n    }\n\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\n    //\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\n    var q = this.m.subn(1);\n    var s = 0;\n    while (!q.isZero() && q.andln(1) === 0) {\n      s++;\n      q.iushrn(1);\n    }\n    assert(!q.isZero());\n\n    var one = new BN(1).toRed(this);\n    var nOne = one.redNeg();\n\n    // Find quadratic non-residue\n    // NOTE: Max is such because of generalized Riemann hypothesis.\n    var lpow = this.m.subn(1).iushrn(1);\n    var z = this.m.bitLength();\n    z = new BN(2 * z * z).toRed(this);\n\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\n      z.redIAdd(nOne);\n    }\n\n    var c = this.pow(z, q);\n    var r = this.pow(a, q.addn(1).iushrn(1));\n    var t = this.pow(a, q);\n    var m = s;\n    while (t.cmp(one) !== 0) {\n      var tmp = t;\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\n        tmp = tmp.redSqr();\n      }\n      assert(i < m);\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\n\n      r = r.redMul(b);\n      c = b.redSqr();\n      t = t.redMul(c);\n      m = i;\n    }\n\n    return r;\n  };\n\n  Red.prototype.invm = function invm (a) {\n    var inv = a._invmp(this.m);\n    if (inv.negative !== 0) {\n      inv.negative = 0;\n      return this.imod(inv).redNeg();\n    } else {\n      return this.imod(inv);\n    }\n  };\n\n  Red.prototype.pow = function pow (a, num) {\n    if (num.isZero()) return new BN(1);\n    if (num.cmpn(1) === 0) return a.clone();\n\n    var windowSize = 4;\n    var wnd = new Array(1 << windowSize);\n    wnd[0] = new BN(1).toRed(this);\n    wnd[1] = a;\n    for (var i = 2; i < wnd.length; i++) {\n      wnd[i] = this.mul(wnd[i - 1], a);\n    }\n\n    var res = wnd[0];\n    var current = 0;\n    var currentLen = 0;\n    var start = num.bitLength() % 26;\n    if (start === 0) {\n      start = 26;\n    }\n\n    for (i = num.length - 1; i >= 0; i--) {\n      var word = num.words[i];\n      for (var j = start - 1; j >= 0; j--) {\n        var bit = (word >> j) & 1;\n        if (res !== wnd[0]) {\n          res = this.sqr(res);\n        }\n\n        if (bit === 0 && current === 0) {\n          currentLen = 0;\n          continue;\n        }\n\n        current <<= 1;\n        current |= bit;\n        currentLen++;\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\n\n        res = this.mul(res, wnd[current]);\n        currentLen = 0;\n        current = 0;\n      }\n      start = 26;\n    }\n\n    return res;\n  };\n\n  Red.prototype.convertTo = function convertTo (num) {\n    var r = num.umod(this.m);\n\n    return r === num ? r.clone() : r;\n  };\n\n  Red.prototype.convertFrom = function convertFrom (num) {\n    var res = num.clone();\n    res.red = null;\n    return res;\n  };\n\n  //\n  // Montgomery method engine\n  //\n\n  BN.mont = function mont (num) {\n    return new Mont(num);\n  };\n\n  function Mont (m) {\n    Red.call(this, m);\n\n    this.shift = this.m.bitLength();\n    if (this.shift % 26 !== 0) {\n      this.shift += 26 - (this.shift % 26);\n    }\n\n    this.r = new BN(1).iushln(this.shift);\n    this.r2 = this.imod(this.r.sqr());\n    this.rinv = this.r._invmp(this.m);\n\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\n    this.minv = this.minv.umod(this.r);\n    this.minv = this.r.sub(this.minv);\n  }\n  inherits(Mont, Red);\n\n  Mont.prototype.convertTo = function convertTo (num) {\n    return this.imod(num.ushln(this.shift));\n  };\n\n  Mont.prototype.convertFrom = function convertFrom (num) {\n    var r = this.imod(num.mul(this.rinv));\n    r.red = null;\n    return r;\n  };\n\n  Mont.prototype.imul = function imul (a, b) {\n    if (a.isZero() || b.isZero()) {\n      a.words[0] = 0;\n      a.length = 1;\n      return a;\n    }\n\n    var t = a.imul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.mul = function mul (a, b) {\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\n\n    var t = a.mul(b);\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\n    var u = t.isub(c).iushrn(this.shift);\n    var res = u;\n    if (u.cmp(this.m) >= 0) {\n      res = u.isub(this.m);\n    } else if (u.cmpn(0) < 0) {\n      res = u.iadd(this.m);\n    }\n\n    return res._forceRed(this);\n  };\n\n  Mont.prototype.invm = function invm (a) {\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\n    return res._forceRed(this);\n  };\n})(typeof module === 'undefined' || module, this);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)(module)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/~/bn.js/lib/bn.js\n// module id = 1275\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/node_modules/bn.js/lib/bn.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar formatters = __webpack_require__(35).formatters;\nvar SolidityType = __webpack_require__(107);\n\n/**\n * SolidityTypeAddress is a protoype that represents address type\n * It matches:\n * address\n * address[]\n * address[4]\n * address[][]\n * address[3][]\n * address[][6][], ...\n */\nvar SolidityTypeAddress = function () {\n    this._inputFormatter = function(){\n        var args = Array.prototype.slice.call(arguments);\n        args[0] = (!args[0] || args[0] === '0x0') ? '' : formatters.inputAddressFormatter(args[0]);\n        return f.formatInputInt.apply(this, args);\n    };\n    this._outputFormatter = f.formatOutputAddress;\n};\n\nSolidityTypeAddress.prototype = new SolidityType({});\nSolidityTypeAddress.prototype.constructor = SolidityTypeAddress;\n\nSolidityTypeAddress.prototype.isType = function (name) {\n    return !!name.match(/address(\\[([0-9]*)\\])?/);\n};\n\nmodule.exports = SolidityTypeAddress;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/address.js\n// module id = 1276\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/address.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\n/**\n * SolidityTypeBool is a protoype that represents bool type\n * It matches:\n * bool\n * bool[]\n * bool[4]\n * bool[][]\n * bool[3][]\n * bool[][6][], ...\n */\nvar SolidityTypeBool = function () {\n    this._inputFormatter = f.formatInputBool;\n    this._outputFormatter = f.formatOutputBool;\n};\n\nSolidityTypeBool.prototype = new SolidityType({});\nSolidityTypeBool.prototype.constructor = SolidityTypeBool;\n\nSolidityTypeBool.prototype.isType = function (name) {\n    return !!name.match(/^bool(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeBool;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/bool.js\n// module id = 1277\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/bool.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\n/**\n * SolidityTypeBytes is a prototype that represents the bytes type.\n * It matches:\n * bytes\n * bytes[]\n * bytes[4]\n * bytes[][]\n * bytes[3][]\n * bytes[][6][], ...\n * bytes32\n * bytes8[4]\n * bytes[3][]\n */\nvar SolidityTypeBytes = function () {\n    this._inputFormatter = f.formatInputBytes;\n    this._outputFormatter = f.formatOutputBytes;\n};\n\nSolidityTypeBytes.prototype = new SolidityType({});\nSolidityTypeBytes.prototype.constructor = SolidityTypeBytes;\n\nSolidityTypeBytes.prototype.isType = function (name) {\n    return !!name.match(/^bytes([0-9]{1,})(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeBytes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/bytes.js\n// module id = 1278\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/bytes.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\nvar SolidityTypeDynamicBytes = function () {\n    this._inputFormatter = f.formatInputDynamicBytes;\n    this._outputFormatter = f.formatOutputDynamicBytes;\n};\n\nSolidityTypeDynamicBytes.prototype = new SolidityType({});\nSolidityTypeDynamicBytes.prototype.constructor = SolidityTypeDynamicBytes;\n\nSolidityTypeDynamicBytes.prototype.isType = function (name) {\n    return !!name.match(/^bytes(\\[([0-9]*)\\])*$/);\n};\n\nSolidityTypeDynamicBytes.prototype.isDynamicType = function () {\n    return true;\n};\n\nmodule.exports = SolidityTypeDynamicBytes;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/dynamicbytes.js\n// module id = 1279\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/dynamicbytes.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\n/**\n * SolidityTypeInt is a protoype that represents int type\n * It matches:\n * int\n * int[]\n * int[4]\n * int[][]\n * int[3][]\n * int[][6][], ...\n * int32\n * int64[]\n * int8[4]\n * int256[][]\n * int[3][]\n * int64[][6][], ...\n */\nvar SolidityTypeInt = function () {\n    this._inputFormatter = f.formatInputInt;\n    this._outputFormatter = f.formatOutputInt;\n};\n\nSolidityTypeInt.prototype = new SolidityType({});\nSolidityTypeInt.prototype.constructor = SolidityTypeInt;\n\nSolidityTypeInt.prototype.isType = function (name) {\n    return !!name.match(/^int([0-9]*)?(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeInt;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/int.js\n// module id = 1280\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/int.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\nvar SolidityTypeString = function () {\n    this._inputFormatter = f.formatInputString;\n    this._outputFormatter = f.formatOutputString;\n};\n\nSolidityTypeString.prototype = new SolidityType({});\nSolidityTypeString.prototype.constructor = SolidityTypeString;\n\nSolidityTypeString.prototype.isType = function (name) {\n    return !!name.match(/^string(\\[([0-9]*)\\])*$/);\n};\n\nSolidityTypeString.prototype.isDynamicType = function () {\n    return true;\n};\n\nmodule.exports = SolidityTypeString;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/string.js\n// module id = 1281\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/string.js")},function(module,exports,__webpack_require__){eval("var f = __webpack_require__(65);\nvar SolidityType = __webpack_require__(107);\n\n/**\n * SolidityTypeUInt is a protoype that represents uint type\n * It matches:\n * uint\n * uint[]\n * uint[4]\n * uint[][]\n * uint[3][]\n * uint[][6][], ...\n * uint32\n * uint64[]\n * uint8[4]\n * uint256[][]\n * uint[3][]\n * uint64[][6][], ...\n */\nvar SolidityTypeUInt = function () {\n    this._inputFormatter = f.formatInputInt;\n    this._outputFormatter = f.formatOutputUInt;\n};\n\nSolidityTypeUInt.prototype = new SolidityType({});\nSolidityTypeUInt.prototype.constructor = SolidityTypeUInt;\n\nSolidityTypeUInt.prototype.isType = function (name) {\n    return !!name.match(/^uint([0-9]*)?(\\[([0-9]*)\\])*$/);\n};\n\nmodule.exports = SolidityTypeUInt;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-abi/src/types/uint.js\n// module id = 1282\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-abi/src/types/uint.js")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve\n * The MIT License (MIT)\n * \n * Copyright (c) 2013-2015 Petka Antonov\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the "Software"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n * \n */\n/**\n * bluebird build version 3.3.1\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\n*/\n!function(e){if(true)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module \'"+o+"\'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar SomePromiseArray = Promise._SomePromiseArray;\nfunction any(promises) {\n    var ret = new SomePromiseArray(promises);\n    var promise = ret.promise();\n    ret.setHowMany(1);\n    ret.setUnwrap();\n    ret.init();\n    return promise;\n}\n\nPromise.any = function (promises) {\n    return any(promises);\n};\n\nPromise.prototype.any = function () {\n    return any(this);\n};\n\n};\n\n},{}],2:[function(_dereq_,module,exports){\n"use strict";\nvar firstLineError;\ntry {throw new Error(); } catch (e) {firstLineError = e;}\nvar schedule = _dereq_("./schedule");\nvar Queue = _dereq_("./queue");\nvar util = _dereq_("./util");\n\nfunction Async() {\n    this._isTickUsed = false;\n    this._lateQueue = new Queue(16);\n    this._normalQueue = new Queue(16);\n    this._haveDrainedQueues = false;\n    this._trampolineEnabled = true;\n    var self = this;\n    this.drainQueues = function () {\n        self._drainQueues();\n    };\n    this._schedule = schedule;\n}\n\nAsync.prototype.enableTrampoline = function() {\n    this._trampolineEnabled = true;\n};\n\nAsync.prototype.disableTrampolineIfNecessary = function() {\n    if (util.hasDevTools) {\n        this._trampolineEnabled = false;\n    }\n};\n\nAsync.prototype.haveItemsQueued = function () {\n    return this._isTickUsed || this._haveDrainedQueues;\n};\n\n\nAsync.prototype.fatalError = function(e, isNode) {\n    if (isNode) {\n        process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e));\n        process.exit(2);\n    } else {\n        this.throwLater(e);\n    }\n};\n\nAsync.prototype.throwLater = function(fn, arg) {\n    if (arguments.length === 1) {\n        arg = fn;\n        fn = function () { throw arg; };\n    }\n    if (typeof setTimeout !== "undefined") {\n        setTimeout(function() {\n            fn(arg);\n        }, 0);\n    } else try {\n        this._schedule(function() {\n            fn(arg);\n        });\n    } catch (e) {\n        throw new Error("No async scheduler available\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n};\n\nfunction AsyncInvokeLater(fn, receiver, arg) {\n    this._lateQueue.push(fn, receiver, arg);\n    this._queueTick();\n}\n\nfunction AsyncInvoke(fn, receiver, arg) {\n    this._normalQueue.push(fn, receiver, arg);\n    this._queueTick();\n}\n\nfunction AsyncSettlePromises(promise) {\n    this._normalQueue._pushOne(promise);\n    this._queueTick();\n}\n\nif (!util.hasDevTools) {\n    Async.prototype.invokeLater = AsyncInvokeLater;\n    Async.prototype.invoke = AsyncInvoke;\n    Async.prototype.settlePromises = AsyncSettlePromises;\n} else {\n    Async.prototype.invokeLater = function (fn, receiver, arg) {\n        if (this._trampolineEnabled) {\n            AsyncInvokeLater.call(this, fn, receiver, arg);\n        } else {\n            this._schedule(function() {\n                setTimeout(function() {\n                    fn.call(receiver, arg);\n                }, 100);\n            });\n        }\n    };\n\n    Async.prototype.invoke = function (fn, receiver, arg) {\n        if (this._trampolineEnabled) {\n            AsyncInvoke.call(this, fn, receiver, arg);\n        } else {\n            this._schedule(function() {\n                fn.call(receiver, arg);\n            });\n        }\n    };\n\n    Async.prototype.settlePromises = function(promise) {\n        if (this._trampolineEnabled) {\n            AsyncSettlePromises.call(this, promise);\n        } else {\n            this._schedule(function() {\n                promise._settlePromises();\n            });\n        }\n    };\n}\n\nAsync.prototype.invokeFirst = function (fn, receiver, arg) {\n    this._normalQueue.unshift(fn, receiver, arg);\n    this._queueTick();\n};\n\nAsync.prototype._drainQueue = function(queue) {\n    while (queue.length() > 0) {\n        var fn = queue.shift();\n        if (typeof fn !== "function") {\n            fn._settlePromises();\n            continue;\n        }\n        var receiver = queue.shift();\n        var arg = queue.shift();\n        fn.call(receiver, arg);\n    }\n};\n\nAsync.prototype._drainQueues = function () {\n    this._drainQueue(this._normalQueue);\n    this._reset();\n    this._haveDrainedQueues = true;\n    this._drainQueue(this._lateQueue);\n};\n\nAsync.prototype._queueTick = function () {\n    if (!this._isTickUsed) {\n        this._isTickUsed = true;\n        this._schedule(this.drainQueues);\n    }\n};\n\nAsync.prototype._reset = function () {\n    this._isTickUsed = false;\n};\n\nmodule.exports = Async;\nmodule.exports.firstLineError = firstLineError;\n\n},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\nvar calledBind = false;\nvar rejectThis = function(_, e) {\n    this._reject(e);\n};\n\nvar targetRejected = function(e, context) {\n    context.promiseRejectionQueued = true;\n    context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\n};\n\nvar bindingResolved = function(thisArg, context) {\n    if (((this._bitField & 50397184) === 0)) {\n        this._resolveCallback(context.target);\n    }\n};\n\nvar bindingRejected = function(e, context) {\n    if (!context.promiseRejectionQueued) this._reject(e);\n};\n\nPromise.prototype.bind = function (thisArg) {\n    if (!calledBind) {\n        calledBind = true;\n        Promise.prototype._propagateFrom = debug.propagateFromFunction();\n        Promise.prototype._boundValue = debug.boundValueFunction();\n    }\n    var maybePromise = tryConvertToPromise(thisArg);\n    var ret = new Promise(INTERNAL);\n    ret._propagateFrom(this, 1);\n    var target = this._target();\n    ret._setBoundTo(maybePromise);\n    if (maybePromise instanceof Promise) {\n        var context = {\n            promiseRejectionQueued: false,\n            promise: ret,\n            target: target,\n            bindingPromise: maybePromise\n        };\n        target._then(INTERNAL, targetRejected, undefined, ret, context);\n        maybePromise._then(\n            bindingResolved, bindingRejected, undefined, ret, context);\n        ret._setOnCancel(maybePromise);\n    } else {\n        ret._resolveCallback(target);\n    }\n    return ret;\n};\n\nPromise.prototype._setBoundTo = function (obj) {\n    if (obj !== undefined) {\n        this._bitField = this._bitField | 2097152;\n        this._boundTo = obj;\n    } else {\n        this._bitField = this._bitField & (~2097152);\n    }\n};\n\nPromise.prototype._isBound = function () {\n    return (this._bitField & 2097152) === 2097152;\n};\n\nPromise.bind = function (thisArg, value) {\n    return Promise.resolve(value).bind(thisArg);\n};\n};\n\n},{}],4:[function(_dereq_,module,exports){\n"use strict";\nvar old;\nif (typeof Promise !== "undefined") old = Promise;\nfunction noConflict() {\n    try { if (Promise === bluebird) Promise = old; }\n    catch (e) {}\n    return bluebird;\n}\nvar bluebird = _dereq_("./promise")();\nbluebird.noConflict = noConflict;\nmodule.exports = bluebird;\n\n},{"./promise":22}],5:[function(_dereq_,module,exports){\n"use strict";\nvar cr = Object.create;\nif (cr) {\n    var callerCache = cr(null);\n    var getterCache = cr(null);\n    callerCache[" size"] = getterCache[" size"] = 0;\n}\n\nmodule.exports = function(Promise) {\nvar util = _dereq_("./util");\nvar canEvaluate = util.canEvaluate;\nvar isIdentifier = util.isIdentifier;\n\nvar getMethodCaller;\nvar getGetter;\nif (false) {\nvar makeMethodCaller = function (methodName) {\n    return new Function("ensureMethod", "                                    \\n\\\n        return function(obj) {                                               \\n\\\n            \'use strict\'                                                     \\n\\\n            var len = this.length;                                           \\n\\\n            ensureMethod(obj, \'methodName\');                                 \\n\\\n            switch(len) {                                                    \\n\\\n                case 1: return obj.methodName(this[0]);                      \\n\\\n                case 2: return obj.methodName(this[0], this[1]);             \\n\\\n                case 3: return obj.methodName(this[0], this[1], this[2]);    \\n\\\n                case 0: return obj.methodName();                             \\n\\\n                default:                                                     \\n\\\n                    return obj.methodName.apply(obj, this);                  \\n\\\n            }                                                                \\n\\\n        };                                                                   \\n\\\n        ".replace(/methodName/g, methodName))(ensureMethod);\n};\n\nvar makeGetter = function (propertyName) {\n    return new Function("obj", "                                             \\n\\\n        \'use strict\';                                                        \\n\\\n        return obj.propertyName;                                             \\n\\\n        ".replace("propertyName", propertyName));\n};\n\nvar getCompiled = function(name, compiler, cache) {\n    var ret = cache[name];\n    if (typeof ret !== "function") {\n        if (!isIdentifier(name)) {\n            return null;\n        }\n        ret = compiler(name);\n        cache[name] = ret;\n        cache[" size"]++;\n        if (cache[" size"] > 512) {\n            var keys = Object.keys(cache);\n            for (var i = 0; i < 256; ++i) delete cache[keys[i]];\n            cache[" size"] = keys.length - 256;\n        }\n    }\n    return ret;\n};\n\ngetMethodCaller = function(name) {\n    return getCompiled(name, makeMethodCaller, callerCache);\n};\n\ngetGetter = function(name) {\n    return getCompiled(name, makeGetter, getterCache);\n};\n}\n\nfunction ensureMethod(obj, methodName) {\n    var fn;\n    if (obj != null) fn = obj[methodName];\n    if (typeof fn !== "function") {\n        var message = "Object " + util.classString(obj) + " has no method \'" +\n            util.toString(methodName) + "\'";\n        throw new Promise.TypeError(message);\n    }\n    return fn;\n}\n\nfunction caller(obj) {\n    var methodName = this.pop();\n    var fn = ensureMethod(obj, methodName);\n    return fn.apply(obj, this);\n}\nPromise.prototype.call = function (methodName) {\n    var args = [].slice.call(arguments, 1);;\n    if (false) {\n        if (canEvaluate) {\n            var maybeCaller = getMethodCaller(methodName);\n            if (maybeCaller !== null) {\n                return this._then(\n                    maybeCaller, undefined, undefined, args, undefined);\n            }\n        }\n    }\n    args.push(methodName);\n    return this._then(caller, undefined, undefined, args, undefined);\n};\n\nfunction namedGetter(obj) {\n    return obj[this];\n}\nfunction indexedGetter(obj) {\n    var index = +this;\n    if (index < 0) index = Math.max(0, index + obj.length);\n    return obj[index];\n}\nPromise.prototype.get = function (propertyName) {\n    var isIndex = (typeof propertyName === "number");\n    var getter;\n    if (!isIndex) {\n        if (canEvaluate) {\n            var maybeGetter = getGetter(propertyName);\n            getter = maybeGetter !== null ? maybeGetter : namedGetter;\n        } else {\n            getter = namedGetter;\n        }\n    } else {\n        getter = indexedGetter;\n    }\n    return this._then(getter, undefined, undefined, propertyName, undefined);\n};\n};\n\n},{"./util":36}],6:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar async = Promise._async;\n\nPromise.prototype["break"] = Promise.prototype.cancel = function() {\n    if (!debug.cancellation()) return this._warn("cancellation is disabled");\n\n    var promise = this;\n    var child = promise;\n    while (promise.isCancellable()) {\n        if (!promise._cancelBy(child)) {\n            if (child._isFollowing()) {\n                child._followee().cancel();\n            } else {\n                child._cancelBranched();\n            }\n            break;\n        }\n\n        var parent = promise._cancellationParent;\n        if (parent == null || !parent.isCancellable()) {\n            if (promise._isFollowing()) {\n                promise._followee().cancel();\n            } else {\n                promise._cancelBranched();\n            }\n            break;\n        } else {\n            if (promise._isFollowing()) promise._followee().cancel();\n            child = promise;\n            promise = parent;\n        }\n    }\n};\n\nPromise.prototype._branchHasCancelled = function() {\n    this._branchesRemainingToCancel--;\n};\n\nPromise.prototype._enoughBranchesHaveCancelled = function() {\n    return this._branchesRemainingToCancel === undefined ||\n           this._branchesRemainingToCancel <= 0;\n};\n\nPromise.prototype._cancelBy = function(canceller) {\n    if (canceller === this) {\n        this._branchesRemainingToCancel = 0;\n        this._invokeOnCancel();\n        return true;\n    } else {\n        this._branchHasCancelled();\n        if (this._enoughBranchesHaveCancelled()) {\n            this._invokeOnCancel();\n            return true;\n        }\n    }\n    return false;\n};\n\nPromise.prototype._cancelBranched = function() {\n    if (this._enoughBranchesHaveCancelled()) {\n        this._cancel();\n    }\n};\n\nPromise.prototype._cancel = function() {\n    if (!this.isCancellable()) return;\n\n    this._setCancelled();\n    async.invoke(this._cancelPromises, this, undefined);\n};\n\nPromise.prototype._cancelPromises = function() {\n    if (this._length() > 0) this._settlePromises();\n};\n\nPromise.prototype._unsetOnCancel = function() {\n    this._onCancelField = undefined;\n};\n\nPromise.prototype.isCancellable = function() {\n    return this.isPending() && !this.isCancelled();\n};\n\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\n    if (util.isArray(onCancelCallback)) {\n        for (var i = 0; i < onCancelCallback.length; ++i) {\n            this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\n        }\n    } else if (onCancelCallback !== undefined) {\n        if (typeof onCancelCallback === "function") {\n            if (!internalOnly) {\n                var e = tryCatch(onCancelCallback).call(this._boundValue());\n                if (e === errorObj) {\n                    this._attachExtraTrace(e.e);\n                    async.throwLater(e.e);\n                }\n            }\n        } else {\n            onCancelCallback._resultCancelled(this);\n        }\n    }\n};\n\nPromise.prototype._invokeOnCancel = function() {\n    var onCancelCallback = this._onCancel();\n    this._unsetOnCancel();\n    async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\n};\n\nPromise.prototype._invokeInternalOnCancel = function() {\n    if (this.isCancellable()) {\n        this._doInvokeOnCancel(this._onCancel(), true);\n        this._unsetOnCancel();\n    }\n};\n\nPromise.prototype._resultCancelled = function() {\n    this.cancel();\n};\n\n};\n\n},{"./util":36}],7:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(NEXT_FILTER) {\nvar util = _dereq_("./util");\nvar getKeys = _dereq_("./es5").keys;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction catchFilter(instances, cb, promise) {\n    return function(e) {\n        var boundTo = promise._boundValue();\n        predicateLoop: for (var i = 0; i < instances.length; ++i) {\n            var item = instances[i];\n\n            if (item === Error ||\n                (item != null && item.prototype instanceof Error)) {\n                if (e instanceof item) {\n                    return tryCatch(cb).call(boundTo, e);\n                }\n            } else if (typeof item === "function") {\n                var matchesPredicate = tryCatch(item).call(boundTo, e);\n                if (matchesPredicate === errorObj) {\n                    return matchesPredicate;\n                } else if (matchesPredicate) {\n                    return tryCatch(cb).call(boundTo, e);\n                }\n            } else if (util.isObject(e)) {\n                var keys = getKeys(item);\n                for (var j = 0; j < keys.length; ++j) {\n                    var key = keys[j];\n                    if (item[key] != e[key]) {\n                        continue predicateLoop;\n                    }\n                }\n                return tryCatch(cb).call(boundTo, e);\n            }\n        }\n        return NEXT_FILTER;\n    };\n}\n\nreturn catchFilter;\n};\n\n},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar longStackTraces = false;\nvar contextStack = [];\n\nPromise.prototype._promiseCreated = function() {};\nPromise.prototype._pushContext = function() {};\nPromise.prototype._popContext = function() {return null;};\nPromise._peekContext = Promise.prototype._peekContext = function() {};\n\nfunction Context() {\n    this._trace = new Context.CapturedTrace(peekContext());\n}\nContext.prototype._pushContext = function () {\n    if (this._trace !== undefined) {\n        this._trace._promiseCreated = null;\n        contextStack.push(this._trace);\n    }\n};\n\nContext.prototype._popContext = function () {\n    if (this._trace !== undefined) {\n        var trace = contextStack.pop();\n        var ret = trace._promiseCreated;\n        trace._promiseCreated = null;\n        return ret;\n    }\n    return null;\n};\n\nfunction createContext() {\n    if (longStackTraces) return new Context();\n}\n\nfunction peekContext() {\n    var lastIndex = contextStack.length - 1;\n    if (lastIndex >= 0) {\n        return contextStack[lastIndex];\n    }\n    return undefined;\n}\nContext.CapturedTrace = null;\nContext.create = createContext;\nContext.deactivateLongStackTraces = function() {};\nContext.activateLongStackTraces = function() {\n    var Promise_pushContext = Promise.prototype._pushContext;\n    var Promise_popContext = Promise.prototype._popContext;\n    var Promise_PeekContext = Promise._peekContext;\n    var Promise_peekContext = Promise.prototype._peekContext;\n    var Promise_promiseCreated = Promise.prototype._promiseCreated;\n    Context.deactivateLongStackTraces = function() {\n        Promise.prototype._pushContext = Promise_pushContext;\n        Promise.prototype._popContext = Promise_popContext;\n        Promise._peekContext = Promise_PeekContext;\n        Promise.prototype._peekContext = Promise_peekContext;\n        Promise.prototype._promiseCreated = Promise_promiseCreated;\n        longStackTraces = false;\n    };\n    longStackTraces = true;\n    Promise.prototype._pushContext = Context.prototype._pushContext;\n    Promise.prototype._popContext = Context.prototype._popContext;\n    Promise._peekContext = Promise.prototype._peekContext = peekContext;\n    Promise.prototype._promiseCreated = function() {\n        var ctx = this._peekContext();\n        if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\n    };\n};\nreturn Context;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, Context) {\nvar getDomain = Promise._getDomain;\nvar async = Promise._async;\nvar Warning = _dereq_("./errors").Warning;\nvar util = _dereq_("./util");\nvar canAttachTrace = util.canAttachTrace;\nvar unhandledRejectionHandled;\nvar possiblyUnhandledRejection;\nvar bluebirdFramePattern =\n    /[\\\\\\/]bluebird[\\\\\\/]js[\\\\\\/](release|debug|instrumented)/;\nvar stackFramePattern = null;\nvar formatStack = null;\nvar indentStackFrames = false;\nvar printWarning;\nvar debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 &&\n                        (true ||\n                         util.env("BLUEBIRD_DEBUG") ||\n                         util.env("NODE_ENV") === "development"));\n\nvar warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 &&\n    (debugging || util.env("BLUEBIRD_WARNINGS")));\n\nvar longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 &&\n    (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES")));\n\nvar wForgottenReturn = util.env("BLUEBIRD_W_FORGOTTEN_RETURN") != 0 &&\n    (warnings || !!util.env("BLUEBIRD_W_FORGOTTEN_RETURN"));\n\nPromise.prototype.suppressUnhandledRejections = function() {\n    var target = this._target();\n    target._bitField = ((target._bitField & (~1048576)) |\n                      524288);\n};\n\nPromise.prototype._ensurePossibleRejectionHandled = function () {\n    if ((this._bitField & 524288) !== 0) return;\n    this._setRejectionIsUnhandled();\n    async.invokeLater(this._notifyUnhandledRejection, this, undefined);\n};\n\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\n    fireRejectionEvent("rejectionHandled",\n                                  unhandledRejectionHandled, undefined, this);\n};\n\nPromise.prototype._setReturnedNonUndefined = function() {\n    this._bitField = this._bitField | 268435456;\n};\n\nPromise.prototype._returnedNonUndefined = function() {\n    return (this._bitField & 268435456) !== 0;\n};\n\nPromise.prototype._notifyUnhandledRejection = function () {\n    if (this._isRejectionUnhandled()) {\n        var reason = this._settledValue();\n        this._setUnhandledRejectionIsNotified();\n        fireRejectionEvent("unhandledRejection",\n                                      possiblyUnhandledRejection, reason, this);\n    }\n};\n\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\n    this._bitField = this._bitField | 262144;\n};\n\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\n    this._bitField = this._bitField & (~262144);\n};\n\nPromise.prototype._isUnhandledRejectionNotified = function () {\n    return (this._bitField & 262144) > 0;\n};\n\nPromise.prototype._setRejectionIsUnhandled = function () {\n    this._bitField = this._bitField | 1048576;\n};\n\nPromise.prototype._unsetRejectionIsUnhandled = function () {\n    this._bitField = this._bitField & (~1048576);\n    if (this._isUnhandledRejectionNotified()) {\n        this._unsetUnhandledRejectionIsNotified();\n        this._notifyUnhandledRejectionIsHandled();\n    }\n};\n\nPromise.prototype._isRejectionUnhandled = function () {\n    return (this._bitField & 1048576) > 0;\n};\n\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\n    return warn(message, shouldUseOwnTrace, promise || this);\n};\n\nPromise.onPossiblyUnhandledRejection = function (fn) {\n    var domain = getDomain();\n    possiblyUnhandledRejection =\n        typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))\n                                 : undefined;\n};\n\nPromise.onUnhandledRejectionHandled = function (fn) {\n    var domain = getDomain();\n    unhandledRejectionHandled =\n        typeof fn === "function" ? (domain === null ? fn : domain.bind(fn))\n                                 : undefined;\n};\n\nvar disableLongStackTraces = function() {};\nPromise.longStackTraces = function () {\n    if (async.haveItemsQueued() && !config.longStackTraces) {\n        throw new Error("cannot enable long stack traces after promises have been created\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    if (!config.longStackTraces && longStackTracesIsSupported()) {\n        var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\n        var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\n        config.longStackTraces = true;\n        disableLongStackTraces = function() {\n            if (async.haveItemsQueued() && !config.longStackTraces) {\n                throw new Error("cannot enable long stack traces after promises have been created\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n            }\n            Promise.prototype._captureStackTrace = Promise_captureStackTrace;\n            Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\n            Context.deactivateLongStackTraces();\n            async.enableTrampoline();\n            config.longStackTraces = false;\n        };\n        Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\n        Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\n        Context.activateLongStackTraces();\n        async.disableTrampolineIfNecessary();\n    }\n};\n\nPromise.hasLongStackTraces = function () {\n    return config.longStackTraces && longStackTracesIsSupported();\n};\n\nvar fireDomEvent = (function() {\n    try {\n        var event = document.createEvent("CustomEvent");\n        event.initCustomEvent("testingtheevent", false, true, {});\n        util.global.dispatchEvent(event);\n        return function(name, event) {\n            var domEvent = document.createEvent("CustomEvent");\n            domEvent.initCustomEvent(name.toLowerCase(), false, true, event);\n            return !util.global.dispatchEvent(domEvent);\n        };\n    } catch (e) {}\n    return function() {\n        return false;\n    };\n})();\n\nvar fireGlobalEvent = (function() {\n    if (util.isNode) {\n        return function() {\n            return process.emit.apply(process, arguments);\n        };\n    } else {\n        if (!util.global) {\n            return function() {\n                return false;\n            };\n        }\n        return function(name) {\n            var methodName = "on" + name.toLowerCase();\n            var method = util.global[methodName];\n            if (!method) return false;\n            method.apply(util.global, [].slice.call(arguments, 1));\n            return true;\n        };\n    }\n})();\n\nfunction generatePromiseLifecycleEventObject(name, promise) {\n    return {promise: promise};\n}\n\nvar eventToObjectGenerator = {\n    promiseCreated: generatePromiseLifecycleEventObject,\n    promiseFulfilled: generatePromiseLifecycleEventObject,\n    promiseRejected: generatePromiseLifecycleEventObject,\n    promiseResolved: generatePromiseLifecycleEventObject,\n    promiseCancelled: generatePromiseLifecycleEventObject,\n    promiseChained: function(name, promise, child) {\n        return {promise: promise, child: child};\n    },\n    warning: function(name, warning) {\n        return {warning: warning};\n    },\n    unhandledRejection: function (name, reason, promise) {\n        return {reason: reason, promise: promise};\n    },\n    rejectionHandled: generatePromiseLifecycleEventObject\n};\n\nvar activeFireEvent = function (name) {\n    var globalEventFired = false;\n    try {\n        globalEventFired = fireGlobalEvent.apply(null, arguments);\n    } catch (e) {\n        async.throwLater(e);\n        globalEventFired = true;\n    }\n\n    var domEventFired = false;\n    try {\n        domEventFired = fireDomEvent(name,\n                    eventToObjectGenerator[name].apply(null, arguments));\n    } catch (e) {\n        async.throwLater(e);\n        domEventFired = true;\n    }\n\n    return domEventFired || globalEventFired;\n};\n\nPromise.config = function(opts) {\n    opts = Object(opts);\n    if ("longStackTraces" in opts) {\n        if (opts.longStackTraces) {\n            Promise.longStackTraces();\n        } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\n            disableLongStackTraces();\n        }\n    }\n    if ("warnings" in opts) {\n        var warningsOption = opts.warnings;\n        config.warnings = !!warningsOption;\n        wForgottenReturn = config.warnings;\n\n        if (util.isObject(warningsOption)) {\n            if ("wForgottenReturn" in warningsOption) {\n                wForgottenReturn = !!warningsOption.wForgottenReturn;\n            }\n        }\n    }\n    if ("cancellation" in opts && opts.cancellation && !config.cancellation) {\n        if (async.haveItemsQueued()) {\n            throw new Error(\n                "cannot enable cancellation after promises are in use");\n        }\n        Promise.prototype._clearCancellationData =\n            cancellationClearCancellationData;\n        Promise.prototype._propagateFrom = cancellationPropagateFrom;\n        Promise.prototype._onCancel = cancellationOnCancel;\n        Promise.prototype._setOnCancel = cancellationSetOnCancel;\n        Promise.prototype._attachCancellationCallback =\n            cancellationAttachCancellationCallback;\n        Promise.prototype._execute = cancellationExecute;\n        propagateFromFunction = cancellationPropagateFrom;\n        config.cancellation = true;\n    }\n    if ("monitoring" in opts) {\n        if (opts.monitoring && !config.monitoring) {\n            config.monitoring = true;\n            Promise.prototype._fireEvent = activeFireEvent;\n        } else if (!opts.monitoring && config.monitoring) {\n            config.monitoring = false;\n            Promise.prototype._fireEvent = defaultFireEvent;\n        }\n    }\n};\n\nfunction defaultFireEvent() { return false; }\n\nPromise.prototype._fireEvent = defaultFireEvent;\nPromise.prototype._execute = function(executor, resolve, reject) {\n    try {\n        executor(resolve, reject);\n    } catch (e) {\n        return e;\n    }\n};\nPromise.prototype._onCancel = function () {};\nPromise.prototype._setOnCancel = function (handler) { ; };\nPromise.prototype._attachCancellationCallback = function(onCancel) {\n    ;\n};\nPromise.prototype._captureStackTrace = function () {};\nPromise.prototype._attachExtraTrace = function () {};\nPromise.prototype._clearCancellationData = function() {};\nPromise.prototype._propagateFrom = function (parent, flags) {\n    ;\n    ;\n};\n\nfunction cancellationExecute(executor, resolve, reject) {\n    var promise = this;\n    try {\n        executor(resolve, reject, function(onCancel) {\n            if (typeof onCancel !== "function") {\n                throw new TypeError("onCancel must be a function, got: " +\n                                    util.toString(onCancel));\n            }\n            promise._attachCancellationCallback(onCancel);\n        });\n    } catch (e) {\n        return e;\n    }\n}\n\nfunction cancellationAttachCancellationCallback(onCancel) {\n    if (!this.isCancellable()) return this;\n\n    var previousOnCancel = this._onCancel();\n    if (previousOnCancel !== undefined) {\n        if (util.isArray(previousOnCancel)) {\n            previousOnCancel.push(onCancel);\n        } else {\n            this._setOnCancel([previousOnCancel, onCancel]);\n        }\n    } else {\n        this._setOnCancel(onCancel);\n    }\n}\n\nfunction cancellationOnCancel() {\n    return this._onCancelField;\n}\n\nfunction cancellationSetOnCancel(onCancel) {\n    this._onCancelField = onCancel;\n}\n\nfunction cancellationClearCancellationData() {\n    this._cancellationParent = undefined;\n    this._onCancelField = undefined;\n}\n\nfunction cancellationPropagateFrom(parent, flags) {\n    if ((flags & 1) !== 0) {\n        this._cancellationParent = parent;\n        var branchesRemainingToCancel = parent._branchesRemainingToCancel;\n        if (branchesRemainingToCancel === undefined) {\n            branchesRemainingToCancel = 0;\n        }\n        parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\n    }\n    if ((flags & 2) !== 0 && parent._isBound()) {\n        this._setBoundTo(parent._boundTo);\n    }\n}\n\nfunction bindingPropagateFrom(parent, flags) {\n    if ((flags & 2) !== 0 && parent._isBound()) {\n        this._setBoundTo(parent._boundTo);\n    }\n}\nvar propagateFromFunction = bindingPropagateFrom;\n\nfunction boundValueFunction() {\n    var ret = this._boundTo;\n    if (ret !== undefined) {\n        if (ret instanceof Promise) {\n            if (ret.isFulfilled()) {\n                return ret.value();\n            } else {\n                return undefined;\n            }\n        }\n    }\n    return ret;\n}\n\nfunction longStackTracesCaptureStackTrace() {\n    this._trace = new CapturedTrace(this._peekContext());\n}\n\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\n    if (canAttachTrace(error)) {\n        var trace = this._trace;\n        if (trace !== undefined) {\n            if (ignoreSelf) trace = trace._parent;\n        }\n        if (trace !== undefined) {\n            trace.attachExtraTrace(error);\n        } else if (!error.__stackCleaned__) {\n            var parsed = parseStackAndMessage(error);\n            util.notEnumerableProp(error, "stack",\n                parsed.message + "\\n" + parsed.stack.join("\\n"));\n            util.notEnumerableProp(error, "__stackCleaned__", true);\n        }\n    }\n}\n\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\n                               parent) {\n    if (returnValue === undefined && promiseCreated !== null &&\n        wForgottenReturn) {\n        if (parent !== undefined && parent._returnedNonUndefined()) return;\n\n        if (name) name = name + " ";\n        var msg = "a promise was created in a " + name +\n            "handler but was not returned from it";\n        promise._warn(msg, true, promiseCreated);\n    }\n}\n\nfunction deprecated(name, replacement) {\n    var message = name +\n        " is deprecated and will be removed in a future version.";\n    if (replacement) message += " Use " + replacement + " instead.";\n    return warn(message);\n}\n\nfunction warn(message, shouldUseOwnTrace, promise) {\n    if (!config.warnings) return;\n    var warning = new Warning(message);\n    var ctx;\n    if (shouldUseOwnTrace) {\n        promise._attachExtraTrace(warning);\n    } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\n        ctx.attachExtraTrace(warning);\n    } else {\n        var parsed = parseStackAndMessage(warning);\n        warning.stack = parsed.message + "\\n" + parsed.stack.join("\\n");\n    }\n\n    if (!activeFireEvent("warning", warning)) {\n        formatAndLogError(warning, "", true);\n    }\n}\n\nfunction reconstructStack(message, stacks) {\n    for (var i = 0; i < stacks.length - 1; ++i) {\n        stacks[i].push("From previous event:");\n        stacks[i] = stacks[i].join("\\n");\n    }\n    if (i < stacks.length) {\n        stacks[i] = stacks[i].join("\\n");\n    }\n    return message + "\\n" + stacks.join("\\n");\n}\n\nfunction removeDuplicateOrEmptyJumps(stacks) {\n    for (var i = 0; i < stacks.length; ++i) {\n        if (stacks[i].length === 0 ||\n            ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\n            stacks.splice(i, 1);\n            i--;\n        }\n    }\n}\n\nfunction removeCommonRoots(stacks) {\n    var current = stacks[0];\n    for (var i = 1; i < stacks.length; ++i) {\n        var prev = stacks[i];\n        var currentLastIndex = current.length - 1;\n        var currentLastLine = current[currentLastIndex];\n        var commonRootMeetPoint = -1;\n\n        for (var j = prev.length - 1; j >= 0; --j) {\n            if (prev[j] === currentLastLine) {\n                commonRootMeetPoint = j;\n                break;\n            }\n        }\n\n        for (var j = commonRootMeetPoint; j >= 0; --j) {\n            var line = prev[j];\n            if (current[currentLastIndex] === line) {\n                current.pop();\n                currentLastIndex--;\n            } else {\n                break;\n            }\n        }\n        current = prev;\n    }\n}\n\nfunction cleanStack(stack) {\n    var ret = [];\n    for (var i = 0; i < stack.length; ++i) {\n        var line = stack[i];\n        var isTraceLine = "    (No stack trace)" === line ||\n            stackFramePattern.test(line);\n        var isInternalFrame = isTraceLine && shouldIgnore(line);\n        if (isTraceLine && !isInternalFrame) {\n            if (indentStackFrames && line.charAt(0) !== " ") {\n                line = "    " + line;\n            }\n            ret.push(line);\n        }\n    }\n    return ret;\n}\n\nfunction stackFramesAsArray(error) {\n    var stack = error.stack.replace(/\\s+$/g, "").split("\\n");\n    for (var i = 0; i < stack.length; ++i) {\n        var line = stack[i];\n        if ("    (No stack trace)" === line || stackFramePattern.test(line)) {\n            break;\n        }\n    }\n    if (i > 0) {\n        stack = stack.slice(i);\n    }\n    return stack;\n}\n\nfunction parseStackAndMessage(error) {\n    var stack = error.stack;\n    var message = error.toString();\n    stack = typeof stack === "string" && stack.length > 0\n                ? stackFramesAsArray(error) : ["    (No stack trace)"];\n    return {\n        message: message,\n        stack: cleanStack(stack)\n    };\n}\n\nfunction formatAndLogError(error, title, isSoft) {\n    if (typeof console !== "undefined") {\n        var message;\n        if (util.isObject(error)) {\n            var stack = error.stack;\n            message = title + formatStack(stack, error);\n        } else {\n            message = title + String(error);\n        }\n        if (typeof printWarning === "function") {\n            printWarning(message, isSoft);\n        } else if (typeof console.log === "function" ||\n            typeof console.log === "object") {\n            console.log(message);\n        }\n    }\n}\n\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\n    var localEventFired = false;\n    try {\n        if (typeof localHandler === "function") {\n            localEventFired = true;\n            if (name === "rejectionHandled") {\n                localHandler(promise);\n            } else {\n                localHandler(reason, promise);\n            }\n        }\n    } catch (e) {\n        async.throwLater(e);\n    }\n\n    if (name === "unhandledRejection") {\n        if (!activeFireEvent(name, reason, promise) && !localEventFired) {\n            formatAndLogError(reason, "Unhandled rejection ");\n        }\n    } else {\n        activeFireEvent(name, promise);\n    }\n}\n\nfunction formatNonError(obj) {\n    var str;\n    if (typeof obj === "function") {\n        str = "[function " +\n            (obj.name || "anonymous") +\n            "]";\n    } else {\n        str = obj && typeof obj.toString === "function"\n            ? obj.toString() : util.toString(obj);\n        var ruselessToString = /\\[object [a-zA-Z0-9$_]+\\]/;\n        if (ruselessToString.test(str)) {\n            try {\n                var newStr = JSON.stringify(obj);\n                str = newStr;\n            }\n            catch(e) {\n\n            }\n        }\n        if (str.length === 0) {\n            str = "(empty array)";\n        }\n    }\n    return ("(<" + snip(str) + ">, no stack trace)");\n}\n\nfunction snip(str) {\n    var maxChars = 41;\n    if (str.length < maxChars) {\n        return str;\n    }\n    return str.substr(0, maxChars - 3) + "...";\n}\n\nfunction longStackTracesIsSupported() {\n    return typeof captureStackTrace === "function";\n}\n\nvar shouldIgnore = function() { return false; };\nvar parseLineInfoRegex = /[\\/<\\(]([^:\\/]+):(\\d+):(?:\\d+)\\)?\\s*$/;\nfunction parseLineInfo(line) {\n    var matches = line.match(parseLineInfoRegex);\n    if (matches) {\n        return {\n            fileName: matches[1],\n            line: parseInt(matches[2], 10)\n        };\n    }\n}\n\nfunction setBounds(firstLineError, lastLineError) {\n    if (!longStackTracesIsSupported()) return;\n    var firstStackLines = firstLineError.stack.split("\\n");\n    var lastStackLines = lastLineError.stack.split("\\n");\n    var firstIndex = -1;\n    var lastIndex = -1;\n    var firstFileName;\n    var lastFileName;\n    for (var i = 0; i < firstStackLines.length; ++i) {\n        var result = parseLineInfo(firstStackLines[i]);\n        if (result) {\n            firstFileName = result.fileName;\n            firstIndex = result.line;\n            break;\n        }\n    }\n    for (var i = 0; i < lastStackLines.length; ++i) {\n        var result = parseLineInfo(lastStackLines[i]);\n        if (result) {\n            lastFileName = result.fileName;\n            lastIndex = result.line;\n            break;\n        }\n    }\n    if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\n        firstFileName !== lastFileName || firstIndex >= lastIndex) {\n        return;\n    }\n\n    shouldIgnore = function(line) {\n        if (bluebirdFramePattern.test(line)) return true;\n        var info = parseLineInfo(line);\n        if (info) {\n            if (info.fileName === firstFileName &&\n                (firstIndex <= info.line && info.line <= lastIndex)) {\n                return true;\n            }\n        }\n        return false;\n    };\n}\n\nfunction CapturedTrace(parent) {\n    this._parent = parent;\n    this._promisesCreated = 0;\n    var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\n    captureStackTrace(this, CapturedTrace);\n    if (length > 32) this.uncycle();\n}\nutil.inherits(CapturedTrace, Error);\nContext.CapturedTrace = CapturedTrace;\n\nCapturedTrace.prototype.uncycle = function() {\n    var length = this._length;\n    if (length < 2) return;\n    var nodes = [];\n    var stackToIndex = {};\n\n    for (var i = 0, node = this; node !== undefined; ++i) {\n        nodes.push(node);\n        node = node._parent;\n    }\n    length = this._length = i;\n    for (var i = length - 1; i >= 0; --i) {\n        var stack = nodes[i].stack;\n        if (stackToIndex[stack] === undefined) {\n            stackToIndex[stack] = i;\n        }\n    }\n    for (var i = 0; i < length; ++i) {\n        var currentStack = nodes[i].stack;\n        var index = stackToIndex[currentStack];\n        if (index !== undefined && index !== i) {\n            if (index > 0) {\n                nodes[index - 1]._parent = undefined;\n                nodes[index - 1]._length = 1;\n            }\n            nodes[i]._parent = undefined;\n            nodes[i]._length = 1;\n            var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\n\n            if (index < length - 1) {\n                cycleEdgeNode._parent = nodes[index + 1];\n                cycleEdgeNode._parent.uncycle();\n                cycleEdgeNode._length =\n                    cycleEdgeNode._parent._length + 1;\n            } else {\n                cycleEdgeNode._parent = undefined;\n                cycleEdgeNode._length = 1;\n            }\n            var currentChildLength = cycleEdgeNode._length + 1;\n            for (var j = i - 2; j >= 0; --j) {\n                nodes[j]._length = currentChildLength;\n                currentChildLength++;\n            }\n            return;\n        }\n    }\n};\n\nCapturedTrace.prototype.attachExtraTrace = function(error) {\n    if (error.__stackCleaned__) return;\n    this.uncycle();\n    var parsed = parseStackAndMessage(error);\n    var message = parsed.message;\n    var stacks = [parsed.stack];\n\n    var trace = this;\n    while (trace !== undefined) {\n        stacks.push(cleanStack(trace.stack.split("\\n")));\n        trace = trace._parent;\n    }\n    removeCommonRoots(stacks);\n    removeDuplicateOrEmptyJumps(stacks);\n    util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));\n    util.notEnumerableProp(error, "__stackCleaned__", true);\n};\n\nvar captureStackTrace = (function stackDetection() {\n    var v8stackFramePattern = /^\\s*at\\s*/;\n    var v8stackFormatter = function(stack, error) {\n        if (typeof stack === "string") return stack;\n\n        if (error.name !== undefined &&\n            error.message !== undefined) {\n            return error.toString();\n        }\n        return formatNonError(error);\n    };\n\n    if (typeof Error.stackTraceLimit === "number" &&\n        typeof Error.captureStackTrace === "function") {\n        Error.stackTraceLimit += 6;\n        stackFramePattern = v8stackFramePattern;\n        formatStack = v8stackFormatter;\n        var captureStackTrace = Error.captureStackTrace;\n\n        shouldIgnore = function(line) {\n            return bluebirdFramePattern.test(line);\n        };\n        return function(receiver, ignoreUntil) {\n            Error.stackTraceLimit += 6;\n            captureStackTrace(receiver, ignoreUntil);\n            Error.stackTraceLimit -= 6;\n        };\n    }\n    var err = new Error();\n\n    if (typeof err.stack === "string" &&\n        err.stack.split("\\n")[0].indexOf("stackDetection@") >= 0) {\n        stackFramePattern = /@/;\n        formatStack = v8stackFormatter;\n        indentStackFrames = true;\n        return function captureStackTrace(o) {\n            o.stack = new Error().stack;\n        };\n    }\n\n    var hasStackAfterThrow;\n    try { throw new Error(); }\n    catch(e) {\n        hasStackAfterThrow = ("stack" in e);\n    }\n    if (!("stack" in err) && hasStackAfterThrow &&\n        typeof Error.stackTraceLimit === "number") {\n        stackFramePattern = v8stackFramePattern;\n        formatStack = v8stackFormatter;\n        return function captureStackTrace(o) {\n            Error.stackTraceLimit += 6;\n            try { throw new Error(); }\n            catch(e) { o.stack = e.stack; }\n            Error.stackTraceLimit -= 6;\n        };\n    }\n\n    formatStack = function(stack, error) {\n        if (typeof stack === "string") return stack;\n\n        if ((typeof error === "object" ||\n            typeof error === "function") &&\n            error.name !== undefined &&\n            error.message !== undefined) {\n            return error.toString();\n        }\n        return formatNonError(error);\n    };\n\n    return null;\n\n})([]);\n\nif (typeof console !== "undefined" && typeof console.warn !== "undefined") {\n    printWarning = function (message) {\n        console.warn(message);\n    };\n    if (util.isNode && process.stderr.isTTY) {\n        printWarning = function(message, isSoft) {\n            var color = isSoft ? "\\u001b[33m" : "\\u001b[31m";\n            console.warn(color + message + "\\u001b[0m\\n");\n        };\n    } else if (!util.isNode && typeof (new Error().stack) === "string") {\n        printWarning = function(message, isSoft) {\n            console.warn("%c" + message,\n                        isSoft ? "color: darkorange" : "color: red");\n        };\n    }\n}\n\nvar config = {\n    warnings: warnings,\n    longStackTraces: false,\n    cancellation: false,\n    monitoring: false\n};\n\nif (longStackTraces) Promise.longStackTraces();\n\nreturn {\n    longStackTraces: function() {\n        return config.longStackTraces;\n    },\n    warnings: function() {\n        return config.warnings;\n    },\n    cancellation: function() {\n        return config.cancellation;\n    },\n    monitoring: function() {\n        return config.monitoring;\n    },\n    propagateFromFunction: function() {\n        return propagateFromFunction;\n    },\n    boundValueFunction: function() {\n        return boundValueFunction;\n    },\n    checkForgottenReturns: checkForgottenReturns,\n    setBounds: setBounds,\n    warn: warn,\n    deprecated: deprecated,\n    CapturedTrace: CapturedTrace,\n    fireDomEvent: fireDomEvent,\n    fireGlobalEvent: fireGlobalEvent\n};\n};\n\n},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nfunction returner() {\n    return this.value;\n}\nfunction thrower() {\n    throw this.reason;\n}\n\nPromise.prototype["return"] =\nPromise.prototype.thenReturn = function (value) {\n    if (value instanceof Promise) value.suppressUnhandledRejections();\n    return this._then(\n        returner, undefined, undefined, {value: value}, undefined);\n};\n\nPromise.prototype["throw"] =\nPromise.prototype.thenThrow = function (reason) {\n    return this._then(\n        thrower, undefined, undefined, {reason: reason}, undefined);\n};\n\nPromise.prototype.catchThrow = function (reason) {\n    if (arguments.length <= 1) {\n        return this._then(\n            undefined, thrower, undefined, {reason: reason}, undefined);\n    } else {\n        var _reason = arguments[1];\n        var handler = function() {throw _reason;};\n        return this.caught(reason, handler);\n    }\n};\n\nPromise.prototype.catchReturn = function (value) {\n    if (arguments.length <= 1) {\n        if (value instanceof Promise) value.suppressUnhandledRejections();\n        return this._then(\n            undefined, returner, undefined, {value: value}, undefined);\n    } else {\n        var _value = arguments[1];\n        if (_value instanceof Promise) _value.suppressUnhandledRejections();\n        var handler = function() {return _value;};\n        return this.caught(value, handler);\n    }\n};\n};\n\n},{}],11:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseReduce = Promise.reduce;\nvar PromiseAll = Promise.all;\n\nfunction promiseAllThis() {\n    return PromiseAll(this);\n}\n\nfunction PromiseMapSeries(promises, fn) {\n    return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\n}\n\nPromise.prototype.each = function (fn) {\n    return this.mapSeries(fn)\n            ._then(promiseAllThis, undefined, undefined, this, undefined);\n};\n\nPromise.prototype.mapSeries = function (fn) {\n    return PromiseReduce(this, fn, INTERNAL, INTERNAL);\n};\n\nPromise.each = function (promises, fn) {\n    return PromiseMapSeries(promises, fn)\n            ._then(promiseAllThis, undefined, undefined, promises, undefined);\n};\n\nPromise.mapSeries = PromiseMapSeries;\n};\n\n},{}],12:[function(_dereq_,module,exports){\n"use strict";\nvar es5 = _dereq_("./es5");\nvar Objectfreeze = es5.freeze;\nvar util = _dereq_("./util");\nvar inherits = util.inherits;\nvar notEnumerableProp = util.notEnumerableProp;\n\nfunction subError(nameProperty, defaultMessage) {\n    function SubError(message) {\n        if (!(this instanceof SubError)) return new SubError(message);\n        notEnumerableProp(this, "message",\n            typeof message === "string" ? message : defaultMessage);\n        notEnumerableProp(this, "name", nameProperty);\n        if (Error.captureStackTrace) {\n            Error.captureStackTrace(this, this.constructor);\n        } else {\n            Error.call(this);\n        }\n    }\n    inherits(SubError, Error);\n    return SubError;\n}\n\nvar _TypeError, _RangeError;\nvar Warning = subError("Warning", "warning");\nvar CancellationError = subError("CancellationError", "cancellation error");\nvar TimeoutError = subError("TimeoutError", "timeout error");\nvar AggregateError = subError("AggregateError", "aggregate error");\ntry {\n    _TypeError = TypeError;\n    _RangeError = RangeError;\n} catch(e) {\n    _TypeError = subError("TypeError", "type error");\n    _RangeError = subError("RangeError", "range error");\n}\n\nvar methods = ("join pop push shift unshift slice filter forEach some " +\n    "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");\n\nfor (var i = 0; i < methods.length; ++i) {\n    if (typeof Array.prototype[methods[i]] === "function") {\n        AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\n    }\n}\n\nes5.defineProperty(AggregateError.prototype, "length", {\n    value: 0,\n    configurable: false,\n    writable: true,\n    enumerable: true\n});\nAggregateError.prototype["isOperational"] = true;\nvar level = 0;\nAggregateError.prototype.toString = function() {\n    var indent = Array(level * 4 + 1).join(" ");\n    var ret = "\\n" + indent + "AggregateError of:" + "\\n";\n    level++;\n    indent = Array(level * 4 + 1).join(" ");\n    for (var i = 0; i < this.length; ++i) {\n        var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";\n        var lines = str.split("\\n");\n        for (var j = 0; j < lines.length; ++j) {\n            lines[j] = indent + lines[j];\n        }\n        str = lines.join("\\n");\n        ret += str + "\\n";\n    }\n    level--;\n    return ret;\n};\n\nfunction OperationalError(message) {\n    if (!(this instanceof OperationalError))\n        return new OperationalError(message);\n    notEnumerableProp(this, "name", "OperationalError");\n    notEnumerableProp(this, "message", message);\n    this.cause = message;\n    this["isOperational"] = true;\n\n    if (message instanceof Error) {\n        notEnumerableProp(this, "message", message.message);\n        notEnumerableProp(this, "stack", message.stack);\n    } else if (Error.captureStackTrace) {\n        Error.captureStackTrace(this, this.constructor);\n    }\n\n}\ninherits(OperationalError, Error);\n\nvar errorTypes = Error["__BluebirdErrorTypes__"];\nif (!errorTypes) {\n    errorTypes = Objectfreeze({\n        CancellationError: CancellationError,\n        TimeoutError: TimeoutError,\n        OperationalError: OperationalError,\n        RejectionError: OperationalError,\n        AggregateError: AggregateError\n    });\n    es5.defineProperty(Error, "__BluebirdErrorTypes__", {\n        value: errorTypes,\n        writable: false,\n        enumerable: false,\n        configurable: false\n    });\n}\n\nmodule.exports = {\n    Error: Error,\n    TypeError: _TypeError,\n    RangeError: _RangeError,\n    CancellationError: errorTypes.CancellationError,\n    OperationalError: errorTypes.OperationalError,\n    TimeoutError: errorTypes.TimeoutError,\n    AggregateError: errorTypes.AggregateError,\n    Warning: Warning\n};\n\n},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){\nvar isES5 = (function(){\n    "use strict";\n    return this === undefined;\n})();\n\nif (isES5) {\n    module.exports = {\n        freeze: Object.freeze,\n        defineProperty: Object.defineProperty,\n        getDescriptor: Object.getOwnPropertyDescriptor,\n        keys: Object.keys,\n        names: Object.getOwnPropertyNames,\n        getPrototypeOf: Object.getPrototypeOf,\n        isArray: Array.isArray,\n        isES5: isES5,\n        propertyIsWritable: function(obj, prop) {\n            var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\n            return !!(!descriptor || descriptor.writable || descriptor.set);\n        }\n    };\n} else {\n    var has = {}.hasOwnProperty;\n    var str = {}.toString;\n    var proto = {}.constructor.prototype;\n\n    var ObjectKeys = function (o) {\n        var ret = [];\n        for (var key in o) {\n            if (has.call(o, key)) {\n                ret.push(key);\n            }\n        }\n        return ret;\n    };\n\n    var ObjectGetDescriptor = function(o, key) {\n        return {value: o[key]};\n    };\n\n    var ObjectDefineProperty = function (o, key, desc) {\n        o[key] = desc.value;\n        return o;\n    };\n\n    var ObjectFreeze = function (obj) {\n        return obj;\n    };\n\n    var ObjectGetPrototypeOf = function (obj) {\n        try {\n            return Object(obj).constructor.prototype;\n        }\n        catch (e) {\n            return proto;\n        }\n    };\n\n    var ArrayIsArray = function (obj) {\n        try {\n            return str.call(obj) === "[object Array]";\n        }\n        catch(e) {\n            return false;\n        }\n    };\n\n    module.exports = {\n        isArray: ArrayIsArray,\n        keys: ObjectKeys,\n        names: ObjectKeys,\n        defineProperty: ObjectDefineProperty,\n        getDescriptor: ObjectGetDescriptor,\n        freeze: ObjectFreeze,\n        getPrototypeOf: ObjectGetPrototypeOf,\n        isES5: isES5,\n        propertyIsWritable: function() {\n            return true;\n        }\n    };\n}\n\n},{}],14:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar PromiseMap = Promise.map;\n\nPromise.prototype.filter = function (fn, options) {\n    return PromiseMap(this, fn, options, INTERNAL);\n};\n\nPromise.filter = function (promises, fn, options) {\n    return PromiseMap(promises, fn, options, INTERNAL);\n};\n};\n\n},{}],15:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, tryConvertToPromise) {\nvar util = _dereq_("./util");\nvar CancellationError = Promise.CancellationError;\nvar errorObj = util.errorObj;\n\nfunction PassThroughHandlerContext(promise, type, handler) {\n    this.promise = promise;\n    this.type = type;\n    this.handler = handler;\n    this.called = false;\n    this.cancelPromise = null;\n}\n\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\n    return this.type === 0;\n};\n\nfunction FinallyHandlerCancelReaction(finallyHandler) {\n    this.finallyHandler = finallyHandler;\n}\n\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\n    checkCancel(this.finallyHandler);\n};\n\nfunction checkCancel(ctx, reason) {\n    if (ctx.cancelPromise != null) {\n        if (arguments.length > 1) {\n            ctx.cancelPromise._reject(reason);\n        } else {\n            ctx.cancelPromise._cancel();\n        }\n        ctx.cancelPromise = null;\n        return true;\n    }\n    return false;\n}\n\nfunction succeed() {\n    return finallyHandler.call(this, this.promise._target()._settledValue());\n}\nfunction fail(reason) {\n    if (checkCancel(this, reason)) return;\n    errorObj.e = reason;\n    return errorObj;\n}\nfunction finallyHandler(reasonOrValue) {\n    var promise = this.promise;\n    var handler = this.handler;\n\n    if (!this.called) {\n        this.called = true;\n        var ret = this.isFinallyHandler()\n            ? handler.call(promise._boundValue())\n            : handler.call(promise._boundValue(), reasonOrValue);\n        if (ret !== undefined) {\n            promise._setReturnedNonUndefined();\n            var maybePromise = tryConvertToPromise(ret, promise);\n            if (maybePromise instanceof Promise) {\n                if (this.cancelPromise != null) {\n                    if (maybePromise.isCancelled()) {\n                        var reason =\n                            new CancellationError("late cancellation observer");\n                        promise._attachExtraTrace(reason);\n                        errorObj.e = reason;\n                        return errorObj;\n                    } else if (maybePromise.isPending()) {\n                        maybePromise._attachCancellationCallback(\n                            new FinallyHandlerCancelReaction(this));\n                    }\n                }\n                return maybePromise._then(\n                    succeed, fail, undefined, this, undefined);\n            }\n        }\n    }\n\n    if (promise.isRejected()) {\n        checkCancel(this);\n        errorObj.e = reasonOrValue;\n        return errorObj;\n    } else {\n        checkCancel(this);\n        return reasonOrValue;\n    }\n}\n\nPromise.prototype._passThrough = function(handler, type, success, fail) {\n    if (typeof handler !== "function") return this.then();\n    return this._then(success,\n                      fail,\n                      undefined,\n                      new PassThroughHandlerContext(this, type, handler),\n                      undefined);\n};\n\nPromise.prototype.lastly =\nPromise.prototype["finally"] = function (handler) {\n    return this._passThrough(handler,\n                             0,\n                             finallyHandler,\n                             finallyHandler);\n};\n\nPromise.prototype.tap = function (handler) {\n    return this._passThrough(handler, 1, finallyHandler);\n};\n\nreturn PassThroughHandlerContext;\n};\n\n},{"./util":36}],16:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          apiRejection,\n                          INTERNAL,\n                          tryConvertToPromise,\n                          Proxyable,\n                          debug) {\nvar errors = _dereq_("./errors");\nvar TypeError = errors.TypeError;\nvar util = _dereq_("./util");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nvar yieldHandlers = [];\n\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\n    for (var i = 0; i < yieldHandlers.length; ++i) {\n        traceParent._pushContext();\n        var result = tryCatch(yieldHandlers[i])(value);\n        traceParent._popContext();\n        if (result === errorObj) {\n            traceParent._pushContext();\n            var ret = Promise.reject(errorObj.e);\n            traceParent._popContext();\n            return ret;\n        }\n        var maybePromise = tryConvertToPromise(result, traceParent);\n        if (maybePromise instanceof Promise) return maybePromise;\n    }\n    return null;\n}\n\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\n    var promise = this._promise = new Promise(INTERNAL);\n    promise._captureStackTrace();\n    promise._setOnCancel(this);\n    this._stack = stack;\n    this._generatorFunction = generatorFunction;\n    this._receiver = receiver;\n    this._generator = undefined;\n    this._yieldHandlers = typeof yieldHandler === "function"\n        ? [yieldHandler].concat(yieldHandlers)\n        : yieldHandlers;\n    this._yieldedPromise = null;\n}\nutil.inherits(PromiseSpawn, Proxyable);\n\nPromiseSpawn.prototype._isResolved = function() {\n    return this._promise === null;\n};\n\nPromiseSpawn.prototype._cleanup = function() {\n    this._promise = this._generator = null;\n};\n\nPromiseSpawn.prototype._promiseCancelled = function() {\n    if (this._isResolved()) return;\n    var implementsReturn = typeof this._generator["return"] !== "undefined";\n\n    var result;\n    if (!implementsReturn) {\n        var reason = new Promise.CancellationError(\n            "generator .return() sentinel");\n        Promise.coroutine.returnSentinel = reason;\n        this._promise._attachExtraTrace(reason);\n        this._promise._pushContext();\n        result = tryCatch(this._generator["throw"]).call(this._generator,\n                                                         reason);\n        this._promise._popContext();\n        if (result === errorObj && result.e === reason) {\n            result = null;\n        }\n    } else {\n        this._promise._pushContext();\n        result = tryCatch(this._generator["return"]).call(this._generator,\n                                                          undefined);\n        this._promise._popContext();\n    }\n    var promise = this._promise;\n    this._cleanup();\n    if (result === errorObj) {\n        promise._rejectCallback(result.e, false);\n    } else {\n        promise.cancel();\n    }\n};\n\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\n    this._yieldedPromise = null;\n    this._promise._pushContext();\n    var result = tryCatch(this._generator.next).call(this._generator, value);\n    this._promise._popContext();\n    this._continue(result);\n};\n\nPromiseSpawn.prototype._promiseRejected = function(reason) {\n    this._yieldedPromise = null;\n    this._promise._attachExtraTrace(reason);\n    this._promise._pushContext();\n    var result = tryCatch(this._generator["throw"])\n        .call(this._generator, reason);\n    this._promise._popContext();\n    this._continue(result);\n};\n\nPromiseSpawn.prototype._resultCancelled = function() {\n    if (this._yieldedPromise instanceof Promise) {\n        var promise = this._yieldedPromise;\n        this._yieldedPromise = null;\n        promise.cancel();\n    }\n};\n\nPromiseSpawn.prototype.promise = function () {\n    return this._promise;\n};\n\nPromiseSpawn.prototype._run = function () {\n    this._generator = this._generatorFunction.call(this._receiver);\n    this._receiver =\n        this._generatorFunction = undefined;\n    this._promiseFulfilled(undefined);\n};\n\nPromiseSpawn.prototype._continue = function (result) {\n    var promise = this._promise;\n    if (result === errorObj) {\n        this._cleanup();\n        return promise._rejectCallback(result.e, false);\n    }\n\n    var value = result.value;\n    if (result.done === true) {\n        this._cleanup();\n        return promise._resolveCallback(value);\n    } else {\n        var maybePromise = tryConvertToPromise(value, this._promise);\n        if (!(maybePromise instanceof Promise)) {\n            maybePromise =\n                promiseFromYieldHandler(maybePromise,\n                                        this._yieldHandlers,\n                                        this._promise);\n            if (maybePromise === null) {\n                this._promiseRejected(\n                    new TypeError(\n                        "A value %s was yielded that could not be treated as a promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a\\u000a".replace("%s", value) +\n                        "From coroutine:\\u000a" +\n                        this._stack.split("\\n").slice(1, -7).join("\\n")\n                    )\n                );\n                return;\n            }\n        }\n        maybePromise = maybePromise._target();\n        var bitField = maybePromise._bitField;\n        ;\n        if (((bitField & 50397184) === 0)) {\n            this._yieldedPromise = maybePromise;\n            maybePromise._proxy(this, null);\n        } else if (((bitField & 33554432) !== 0)) {\n            this._promiseFulfilled(maybePromise._value());\n        } else if (((bitField & 16777216) !== 0)) {\n            this._promiseRejected(maybePromise._reason());\n        } else {\n            this._promiseCancelled();\n        }\n    }\n};\n\nPromise.coroutine = function (generatorFunction, options) {\n    if (typeof generatorFunction !== "function") {\n        throw new TypeError("generatorFunction must be a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var yieldHandler = Object(options).yieldHandler;\n    var PromiseSpawn$ = PromiseSpawn;\n    var stack = new Error().stack;\n    return function () {\n        var generator = generatorFunction.apply(this, arguments);\n        var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\n                                      stack);\n        var ret = spawn.promise();\n        spawn._generator = generator;\n        spawn._promiseFulfilled(undefined);\n        return ret;\n    };\n};\n\nPromise.coroutine.addYieldHandler = function(fn) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    yieldHandlers.push(fn);\n};\n\nPromise.spawn = function (generatorFunction) {\n    debug.deprecated("Promise.spawn()", "Promise.coroutine()");\n    if (typeof generatorFunction !== "function") {\n        return apiRejection("generatorFunction must be a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var spawn = new PromiseSpawn(generatorFunction, this);\n    var ret = spawn.promise();\n    spawn._run(Promise.spawn);\n    return ret;\n};\n};\n\n},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {\nvar util = _dereq_("./util");\nvar canEvaluate = util.canEvaluate;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar reject;\n\nif (false) {\nif (canEvaluate) {\n    var thenCallback = function(i) {\n        return new Function("value", "holder", "                             \\n\\\n            \'use strict\';                                                    \\n\\\n            holder.pIndex = value;                                           \\n\\\n            holder.checkFulfillment(this);                                   \\n\\\n            ".replace(/Index/g, i));\n    };\n\n    var promiseSetter = function(i) {\n        return new Function("promise", "holder", "                           \\n\\\n            \'use strict\';                                                    \\n\\\n            holder.pIndex = promise;                                         \\n\\\n            ".replace(/Index/g, i));\n    };\n\n    var generateHolderClass = function(total) {\n        var props = new Array(total);\n        for (var i = 0; i < props.length; ++i) {\n            props[i] = "this.p" + (i+1);\n        }\n        var assignment = props.join(" = ") + " = null;";\n        var cancellationCode= "var promise;\\n" + props.map(function(prop) {\n            return "                                                         \\n\\\n                promise = " + prop + ";                                      \\n\\\n                if (promise instanceof Promise) {                            \\n\\\n                    promise.cancel();                                        \\n\\\n                }                                                            \\n\\\n            ";\n        }).join("\\n");\n        var passedArguments = props.join(", ");\n        var name = "Holder$" + total;\n\n\n        var code = "return function(tryCatch, errorObj, Promise) {           \\n\\\n            \'use strict\';                                                    \\n\\\n            function [TheName](fn) {                                         \\n\\\n                [TheProperties]                                              \\n\\\n                this.fn = fn;                                                \\n\\\n                this.now = 0;                                                \\n\\\n            }                                                                \\n\\\n            [TheName].prototype.checkFulfillment = function(promise) {       \\n\\\n                var now = ++this.now;                                        \\n\\\n                if (now === [TheTotal]) {                                    \\n\\\n                    promise._pushContext();                                  \\n\\\n                    var callback = this.fn;                                  \\n\\\n                    var ret = tryCatch(callback)([ThePassedArguments]);      \\n\\\n                    promise._popContext();                                   \\n\\\n                    if (ret === errorObj) {                                  \\n\\\n                        promise._rejectCallback(ret.e, false);               \\n\\\n                    } else {                                                 \\n\\\n                        promise._resolveCallback(ret);                       \\n\\\n                    }                                                        \\n\\\n                }                                                            \\n\\\n            };                                                               \\n\\\n                                                                             \\n\\\n            [TheName].prototype._resultCancelled = function() {              \\n\\\n                [CancellationCode]                                           \\n\\\n            };                                                               \\n\\\n                                                                             \\n\\\n            return [TheName];                                                \\n\\\n        }(tryCatch, errorObj, Promise);                                      \\n\\\n        ";\n\n        code = code.replace(/\\[TheName\\]/g, name)\n            .replace(/\\[TheTotal\\]/g, total)\n            .replace(/\\[ThePassedArguments\\]/g, passedArguments)\n            .replace(/\\[TheProperties\\]/g, assignment)\n            .replace(/\\[CancellationCode\\]/g, cancellationCode);\n\n        return new Function("tryCatch", "errorObj", "Promise", code)\n                           (tryCatch, errorObj, Promise);\n    };\n\n    var holderClasses = [];\n    var thenCallbacks = [];\n    var promiseSetters = [];\n\n    for (var i = 0; i < 8; ++i) {\n        holderClasses.push(generateHolderClass(i + 1));\n        thenCallbacks.push(thenCallback(i + 1));\n        promiseSetters.push(promiseSetter(i + 1));\n    }\n\n    reject = function (reason) {\n        this._reject(reason);\n    };\n}}\n\nPromise.join = function () {\n    var last = arguments.length - 1;\n    var fn;\n    if (last > 0 && typeof arguments[last] === "function") {\n        fn = arguments[last];\n        if (false) {\n            if (last <= 8 && canEvaluate) {\n                var ret = new Promise(INTERNAL);\n                ret._captureStackTrace();\n                var HolderClass = holderClasses[last - 1];\n                var holder = new HolderClass(fn);\n                var callbacks = thenCallbacks;\n\n                for (var i = 0; i < last; ++i) {\n                    var maybePromise = tryConvertToPromise(arguments[i], ret);\n                    if (maybePromise instanceof Promise) {\n                        maybePromise = maybePromise._target();\n                        var bitField = maybePromise._bitField;\n                        ;\n                        if (((bitField & 50397184) === 0)) {\n                            maybePromise._then(callbacks[i], reject,\n                                               undefined, ret, holder);\n                            promiseSetters[i](maybePromise, holder);\n                        } else if (((bitField & 33554432) !== 0)) {\n                            callbacks[i].call(ret,\n                                              maybePromise._value(), holder);\n                        } else if (((bitField & 16777216) !== 0)) {\n                            ret._reject(maybePromise._reason());\n                        } else {\n                            ret._cancel();\n                        }\n                    } else {\n                        callbacks[i].call(ret, maybePromise, holder);\n                    }\n                }\n                if (!ret._isFateSealed()) {\n                    ret._setAsyncGuaranteed();\n                    ret._setOnCancel(holder);\n                }\n                return ret;\n            }\n        }\n    }\n    var args = [].slice.call(arguments);;\n    if (fn) args.pop();\n    var ret = new PromiseArray(args).promise();\n    return fn !== undefined ? ret.spread(fn) : ret;\n};\n\n};\n\n},{"./util":36}],18:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          PromiseArray,\n                          apiRejection,\n                          tryConvertToPromise,\n                          INTERNAL,\n                          debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\nvar EMPTY_ARRAY = [];\n\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\n    this.constructor$(promises);\n    this._promise._captureStackTrace();\n    var domain = getDomain();\n    this._callback = domain === null ? fn : domain.bind(fn);\n    this._preservedValues = _filter === INTERNAL\n        ? new Array(this.length())\n        : null;\n    this._limit = limit;\n    this._inFlight = 0;\n    this._queue = limit >= 1 ? [] : EMPTY_ARRAY;\n    this._init$(undefined, -2);\n}\nutil.inherits(MappingPromiseArray, PromiseArray);\n\nMappingPromiseArray.prototype._init = function () {};\n\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    var values = this._values;\n    var length = this.length();\n    var preservedValues = this._preservedValues;\n    var limit = this._limit;\n\n    if (index < 0) {\n        index = (index * -1) - 1;\n        values[index] = value;\n        if (limit >= 1) {\n            this._inFlight--;\n            this._drainQueue();\n            if (this._isResolved()) return true;\n        }\n    } else {\n        if (limit >= 1 && this._inFlight >= limit) {\n            values[index] = value;\n            this._queue.push(index);\n            return false;\n        }\n        if (preservedValues !== null) preservedValues[index] = value;\n\n        var promise = this._promise;\n        var callback = this._callback;\n        var receiver = promise._boundValue();\n        promise._pushContext();\n        var ret = tryCatch(callback).call(receiver, value, index, length);\n        var promiseCreated = promise._popContext();\n        debug.checkForgottenReturns(\n            ret,\n            promiseCreated,\n            preservedValues !== null ? "Promise.filter" : "Promise.map",\n            promise\n        );\n        if (ret === errorObj) {\n            this._reject(ret.e);\n            return true;\n        }\n\n        var maybePromise = tryConvertToPromise(ret, this._promise);\n        if (maybePromise instanceof Promise) {\n            maybePromise = maybePromise._target();\n            var bitField = maybePromise._bitField;\n            ;\n            if (((bitField & 50397184) === 0)) {\n                if (limit >= 1) this._inFlight++;\n                values[index] = maybePromise;\n                maybePromise._proxy(this, (index + 1) * -1);\n                return false;\n            } else if (((bitField & 33554432) !== 0)) {\n                ret = maybePromise._value();\n            } else if (((bitField & 16777216) !== 0)) {\n                this._reject(maybePromise._reason());\n                return true;\n            } else {\n                this._cancel();\n                return true;\n            }\n        }\n        values[index] = ret;\n    }\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= length) {\n        if (preservedValues !== null) {\n            this._filter(values, preservedValues);\n        } else {\n            this._resolve(values);\n        }\n        return true;\n    }\n    return false;\n};\n\nMappingPromiseArray.prototype._drainQueue = function () {\n    var queue = this._queue;\n    var limit = this._limit;\n    var values = this._values;\n    while (queue.length > 0 && this._inFlight < limit) {\n        if (this._isResolved()) return;\n        var index = queue.pop();\n        this._promiseFulfilled(values[index], index);\n    }\n};\n\nMappingPromiseArray.prototype._filter = function (booleans, values) {\n    var len = values.length;\n    var ret = new Array(len);\n    var j = 0;\n    for (var i = 0; i < len; ++i) {\n        if (booleans[i]) ret[j++] = values[i];\n    }\n    ret.length = j;\n    this._resolve(ret);\n};\n\nMappingPromiseArray.prototype.preservedValues = function () {\n    return this._preservedValues;\n};\n\nfunction map(promises, fn, options, _filter) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var limit = typeof options === "object" && options !== null\n        ? options.concurrency\n        : 0;\n    limit = typeof limit === "number" &&\n        isFinite(limit) && limit >= 1 ? limit : 0;\n    return new MappingPromiseArray(promises, fn, limit, _filter).promise();\n}\n\nPromise.prototype.map = function (fn, options) {\n    return map(this, fn, options, null);\n};\n\nPromise.map = function (promises, fn, options, _filter) {\n    return map(promises, fn, options, _filter);\n};\n\n\n};\n\n},{"./util":36}],19:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\n\nPromise.method = function (fn) {\n    if (typeof fn !== "function") {\n        throw new Promise.TypeError("expecting a function but got " + util.classString(fn));\n    }\n    return function () {\n        var ret = new Promise(INTERNAL);\n        ret._captureStackTrace();\n        ret._pushContext();\n        var value = tryCatch(fn).apply(this, arguments);\n        var promiseCreated = ret._popContext();\n        debug.checkForgottenReturns(\n            value, promiseCreated, "Promise.method", ret);\n        ret._resolveFromSyncValue(value);\n        return ret;\n    };\n};\n\nPromise.attempt = Promise["try"] = function (fn) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    ret._pushContext();\n    var value;\n    if (arguments.length > 1) {\n        debug.deprecated("calling Promise.try with more than 1 argument");\n        var arg = arguments[1];\n        var ctx = arguments[2];\n        value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\n                                  : tryCatch(fn).call(ctx, arg);\n    } else {\n        value = tryCatch(fn)();\n    }\n    var promiseCreated = ret._popContext();\n    debug.checkForgottenReturns(\n        value, promiseCreated, "Promise.try", ret);\n    ret._resolveFromSyncValue(value);\n    return ret;\n};\n\nPromise.prototype._resolveFromSyncValue = function (value) {\n    if (value === util.errorObj) {\n        this._rejectCallback(value.e, false);\n    } else {\n        this._resolveCallback(value, true);\n    }\n};\n};\n\n},{"./util":36}],20:[function(_dereq_,module,exports){\n"use strict";\nvar util = _dereq_("./util");\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar errors = _dereq_("./errors");\nvar OperationalError = errors.OperationalError;\nvar es5 = _dereq_("./es5");\n\nfunction isUntypedError(obj) {\n    return obj instanceof Error &&\n        es5.getPrototypeOf(obj) === Error.prototype;\n}\n\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\nfunction wrapAsOperationalError(obj) {\n    var ret;\n    if (isUntypedError(obj)) {\n        ret = new OperationalError(obj);\n        ret.name = obj.name;\n        ret.message = obj.message;\n        ret.stack = obj.stack;\n        var keys = es5.keys(obj);\n        for (var i = 0; i < keys.length; ++i) {\n            var key = keys[i];\n            if (!rErrorKey.test(key)) {\n                ret[key] = obj[key];\n            }\n        }\n        return ret;\n    }\n    util.markAsOriginatingFromRejection(obj);\n    return obj;\n}\n\nfunction nodebackForPromise(promise, multiArgs) {\n    return function(err, value) {\n        if (promise === null) return;\n        if (err) {\n            var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\n            promise._attachExtraTrace(wrapped);\n            promise._reject(wrapped);\n        } else if (!multiArgs) {\n            promise._fulfill(value);\n        } else {\n            var args = [].slice.call(arguments, 1);;\n            promise._fulfill(args);\n        }\n        promise = null;\n    };\n}\n\nmodule.exports = nodebackForPromise;\n\n},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nvar util = _dereq_("./util");\nvar async = Promise._async;\nvar tryCatch = util.tryCatch;\nvar errorObj = util.errorObj;\n\nfunction spreadAdapter(val, nodeback) {\n    var promise = this;\n    if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\n    var ret =\n        tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\n\nfunction successAdapter(val, nodeback) {\n    var promise = this;\n    var receiver = promise._boundValue();\n    var ret = val === undefined\n        ? tryCatch(nodeback).call(receiver, null)\n        : tryCatch(nodeback).call(receiver, null, val);\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\nfunction errorAdapter(reason, nodeback) {\n    var promise = this;\n    if (!reason) {\n        var newReason = new Error(reason + "");\n        newReason.cause = reason;\n        reason = newReason;\n    }\n    var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\n    if (ret === errorObj) {\n        async.throwLater(ret.e);\n    }\n}\n\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\n                                                                     options) {\n    if (typeof nodeback == "function") {\n        var adapter = successAdapter;\n        if (options !== undefined && Object(options).spread) {\n            adapter = spreadAdapter;\n        }\n        this._then(\n            adapter,\n            errorAdapter,\n            undefined,\n            this,\n            nodeback\n        );\n    }\n    return this;\n};\n};\n\n},{"./util":36}],22:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function() {\nvar makeSelfResolutionError = function () {\n    return new TypeError("circular promise resolution chain\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n};\nvar reflectHandler = function() {\n    return new Promise.PromiseInspection(this._target());\n};\nvar apiRejection = function(msg) {\n    return Promise.reject(new TypeError(msg));\n};\nfunction Proxyable() {}\nvar UNDEFINED_BINDING = {};\nvar util = _dereq_("./util");\n\nvar getDomain;\nif (util.isNode) {\n    getDomain = function() {\n        var ret = process.domain;\n        if (ret === undefined) ret = null;\n        return ret;\n    };\n} else {\n    getDomain = function() {\n        return null;\n    };\n}\nutil.notEnumerableProp(Promise, "_getDomain", getDomain);\n\nvar es5 = _dereq_("./es5");\nvar Async = _dereq_("./async");\nvar async = new Async();\nes5.defineProperty(Promise, "_async", {value: async});\nvar errors = _dereq_("./errors");\nvar TypeError = Promise.TypeError = errors.TypeError;\nPromise.RangeError = errors.RangeError;\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\nPromise.TimeoutError = errors.TimeoutError;\nPromise.OperationalError = errors.OperationalError;\nPromise.RejectionError = errors.OperationalError;\nPromise.AggregateError = errors.AggregateError;\nvar INTERNAL = function(){};\nvar APPLY = {};\nvar NEXT_FILTER = {};\nvar tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL);\nvar PromiseArray =\n    _dereq_("./promise_array")(Promise, INTERNAL,\n                               tryConvertToPromise, apiRejection, Proxyable);\nvar Context = _dereq_("./context")(Promise);\n /*jshint unused:false*/\nvar createContext = Context.create;\nvar debug = _dereq_("./debuggability")(Promise, Context);\nvar CapturedTrace = debug.CapturedTrace;\nvar PassThroughHandlerContext =\n    _dereq_("./finally")(Promise, tryConvertToPromise);\nvar catchFilter = _dereq_("./catch_filter")(NEXT_FILTER);\nvar nodebackForPromise = _dereq_("./nodeback");\nvar errorObj = util.errorObj;\nvar tryCatch = util.tryCatch;\nfunction check(self, executor) {\n    if (typeof executor !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(executor));\n    }\n    if (self.constructor !== Promise) {\n        throw new TypeError("the promise constructor cannot be invoked directly\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n}\n\nfunction Promise(executor) {\n    this._bitField = 0;\n    this._fulfillmentHandler0 = undefined;\n    this._rejectionHandler0 = undefined;\n    this._promise0 = undefined;\n    this._receiver0 = undefined;\n    if (executor !== INTERNAL) {\n        check(this, executor);\n        this._resolveFromExecutor(executor);\n    }\n    this._promiseCreated();\n    this._fireEvent("promiseCreated", this);\n}\n\nPromise.prototype.toString = function () {\n    return "[object Promise]";\n};\n\nPromise.prototype.caught = Promise.prototype["catch"] = function (fn) {\n    var len = arguments.length;\n    if (len > 1) {\n        var catchInstances = new Array(len - 1),\n            j = 0, i;\n        for (i = 0; i < len - 1; ++i) {\n            var item = arguments[i];\n            if (util.isObject(item)) {\n                catchInstances[j++] = item;\n            } else {\n                return apiRejection("expecting an object but got " + util.classString(item));\n            }\n        }\n        catchInstances.length = j;\n        fn = arguments[i];\n        return this.then(undefined, catchFilter(catchInstances, fn, this));\n    }\n    return this.then(undefined, fn);\n};\n\nPromise.prototype.reflect = function () {\n    return this._then(reflectHandler,\n        reflectHandler, undefined, this, undefined);\n};\n\nPromise.prototype.then = function (didFulfill, didReject) {\n    if (debug.warnings() && arguments.length > 0 &&\n        typeof didFulfill !== "function" &&\n        typeof didReject !== "function") {\n        var msg = ".then() only accepts functions but was passed: " +\n                util.classString(didFulfill);\n        if (arguments.length > 1) {\n            msg += ", " + util.classString(didReject);\n        }\n        this._warn(msg);\n    }\n    return this._then(didFulfill, didReject, undefined, undefined, undefined);\n};\n\nPromise.prototype.done = function (didFulfill, didReject) {\n    var promise =\n        this._then(didFulfill, didReject, undefined, undefined, undefined);\n    promise._setIsFinal();\n};\n\nPromise.prototype.spread = function (fn) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    return this.all()._then(fn, undefined, undefined, APPLY, undefined);\n};\n\nPromise.prototype.toJSON = function () {\n    var ret = {\n        isFulfilled: false,\n        isRejected: false,\n        fulfillmentValue: undefined,\n        rejectionReason: undefined\n    };\n    if (this.isFulfilled()) {\n        ret.fulfillmentValue = this.value();\n        ret.isFulfilled = true;\n    } else if (this.isRejected()) {\n        ret.rejectionReason = this.reason();\n        ret.isRejected = true;\n    }\n    return ret;\n};\n\nPromise.prototype.all = function () {\n    if (arguments.length > 0) {\n        this._warn(".all() was passed arguments but it does not take any");\n    }\n    return new PromiseArray(this).promise();\n};\n\nPromise.prototype.error = function (fn) {\n    return this.caught(util.originatesFromRejection, fn);\n};\n\nPromise.is = function (val) {\n    return val instanceof Promise;\n};\n\nPromise.fromNode = Promise.fromCallback = function(fn) {\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\n                                         : false;\n    var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\n    if (result === errorObj) {\n        ret._rejectCallback(result.e, true);\n    }\n    if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\n    return ret;\n};\n\nPromise.all = function (promises) {\n    return new PromiseArray(promises).promise();\n};\n\nPromise.cast = function (obj) {\n    var ret = tryConvertToPromise(obj);\n    if (!(ret instanceof Promise)) {\n        ret = new Promise(INTERNAL);\n        ret._captureStackTrace();\n        ret._setFulfilled();\n        ret._rejectionHandler0 = obj;\n    }\n    return ret;\n};\n\nPromise.resolve = Promise.fulfilled = Promise.cast;\n\nPromise.reject = Promise.rejected = function (reason) {\n    var ret = new Promise(INTERNAL);\n    ret._captureStackTrace();\n    ret._rejectCallback(reason, true);\n    return ret;\n};\n\nPromise.setScheduler = function(fn) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    var prev = async._schedule;\n    async._schedule = fn;\n    return prev;\n};\n\nPromise.prototype._then = function (\n    didFulfill,\n    didReject,\n    _,    receiver,\n    internalData\n) {\n    var haveInternalData = internalData !== undefined;\n    var promise = haveInternalData ? internalData : new Promise(INTERNAL);\n    var target = this._target();\n    var bitField = target._bitField;\n\n    if (!haveInternalData) {\n        promise._propagateFrom(this, 3);\n        promise._captureStackTrace();\n        if (receiver === undefined &&\n            ((this._bitField & 2097152) !== 0)) {\n            if (!((bitField & 50397184) === 0)) {\n                receiver = this._boundValue();\n            } else {\n                receiver = target === this ? undefined : this._boundTo;\n            }\n        }\n        this._fireEvent("promiseChained", this, promise);\n    }\n\n    var domain = getDomain();\n    if (!((bitField & 50397184) === 0)) {\n        var handler, value, settler = target._settlePromiseCtx;\n        if (((bitField & 33554432) !== 0)) {\n            value = target._rejectionHandler0;\n            handler = didFulfill;\n        } else if (((bitField & 16777216) !== 0)) {\n            value = target._fulfillmentHandler0;\n            handler = didReject;\n            target._unsetRejectionIsUnhandled();\n        } else {\n            settler = target._settlePromiseLateCancellationObserver;\n            value = new CancellationError("late cancellation observer");\n            target._attachExtraTrace(value);\n            handler = didReject;\n        }\n\n        async.invoke(settler, target, {\n            handler: domain === null ? handler\n                : (typeof handler === "function" && domain.bind(handler)),\n            promise: promise,\n            receiver: receiver,\n            value: value\n        });\n    } else {\n        target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\n    }\n\n    return promise;\n};\n\nPromise.prototype._length = function () {\n    return this._bitField & 65535;\n};\n\nPromise.prototype._isFateSealed = function () {\n    return (this._bitField & 117506048) !== 0;\n};\n\nPromise.prototype._isFollowing = function () {\n    return (this._bitField & 67108864) === 67108864;\n};\n\nPromise.prototype._setLength = function (len) {\n    this._bitField = (this._bitField & -65536) |\n        (len & 65535);\n};\n\nPromise.prototype._setFulfilled = function () {\n    this._bitField = this._bitField | 33554432;\n    this._fireEvent("promiseFulfilled", this);\n};\n\nPromise.prototype._setRejected = function () {\n    this._bitField = this._bitField | 16777216;\n    this._fireEvent("promiseRejected", this);\n};\n\nPromise.prototype._setFollowing = function () {\n    this._bitField = this._bitField | 67108864;\n    this._fireEvent("promiseResolved", this);\n};\n\nPromise.prototype._setIsFinal = function () {\n    this._bitField = this._bitField | 4194304;\n};\n\nPromise.prototype._isFinal = function () {\n    return (this._bitField & 4194304) > 0;\n};\n\nPromise.prototype._unsetCancelled = function() {\n    this._bitField = this._bitField & (~65536);\n};\n\nPromise.prototype._setCancelled = function() {\n    this._bitField = this._bitField | 65536;\n    this._fireEvent("promiseCancelled", this);\n};\n\nPromise.prototype._setAsyncGuaranteed = function() {\n    this._bitField = this._bitField | 134217728;\n};\n\nPromise.prototype._receiverAt = function (index) {\n    var ret = index === 0 ? this._receiver0 : this[\n            index * 4 - 4 + 3];\n    if (ret === UNDEFINED_BINDING) {\n        return undefined;\n    } else if (ret === undefined && this._isBound()) {\n        return this._boundValue();\n    }\n    return ret;\n};\n\nPromise.prototype._promiseAt = function (index) {\n    return this[\n            index * 4 - 4 + 2];\n};\n\nPromise.prototype._fulfillmentHandlerAt = function (index) {\n    return this[\n            index * 4 - 4 + 0];\n};\n\nPromise.prototype._rejectionHandlerAt = function (index) {\n    return this[\n            index * 4 - 4 + 1];\n};\n\nPromise.prototype._boundValue = function() {};\n\nPromise.prototype._migrateCallback0 = function (follower) {\n    var bitField = follower._bitField;\n    var fulfill = follower._fulfillmentHandler0;\n    var reject = follower._rejectionHandler0;\n    var promise = follower._promise0;\n    var receiver = follower._receiverAt(0);\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._migrateCallbackAt = function (follower, index) {\n    var fulfill = follower._fulfillmentHandlerAt(index);\n    var reject = follower._rejectionHandlerAt(index);\n    var promise = follower._promiseAt(index);\n    var receiver = follower._receiverAt(index);\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\n};\n\nPromise.prototype._addCallbacks = function (\n    fulfill,\n    reject,\n    promise,\n    receiver,\n    domain\n) {\n    var index = this._length();\n\n    if (index >= 65535 - 4) {\n        index = 0;\n        this._setLength(0);\n    }\n\n    if (index === 0) {\n        this._promise0 = promise;\n        this._receiver0 = receiver;\n        if (typeof fulfill === "function") {\n            this._fulfillmentHandler0 =\n                domain === null ? fulfill : domain.bind(fulfill);\n        }\n        if (typeof reject === "function") {\n            this._rejectionHandler0 =\n                domain === null ? reject : domain.bind(reject);\n        }\n    } else {\n        var base = index * 4 - 4;\n        this[base + 2] = promise;\n        this[base + 3] = receiver;\n        if (typeof fulfill === "function") {\n            this[base + 0] =\n                domain === null ? fulfill : domain.bind(fulfill);\n        }\n        if (typeof reject === "function") {\n            this[base + 1] =\n                domain === null ? reject : domain.bind(reject);\n        }\n    }\n    this._setLength(index + 1);\n    return index;\n};\n\nPromise.prototype._proxy = function (proxyable, arg) {\n    this._addCallbacks(undefined, undefined, arg, proxyable, null);\n};\n\nPromise.prototype._resolveCallback = function(value, shouldBind) {\n    if (((this._bitField & 117506048) !== 0)) return;\n    if (value === this)\n        return this._rejectCallback(makeSelfResolutionError(), false);\n    var maybePromise = tryConvertToPromise(value, this);\n    if (!(maybePromise instanceof Promise)) return this._fulfill(value);\n\n    if (shouldBind) this._propagateFrom(maybePromise, 2);\n\n    var promise = maybePromise._target();\n    var bitField = promise._bitField;\n    if (((bitField & 50397184) === 0)) {\n        var len = this._length();\n        if (len > 0) promise._migrateCallback0(this);\n        for (var i = 1; i < len; ++i) {\n            promise._migrateCallbackAt(this, i);\n        }\n        this._setFollowing();\n        this._setLength(0);\n        this._setFollowee(promise);\n    } else if (((bitField & 33554432) !== 0)) {\n        this._fulfill(promise._value());\n    } else if (((bitField & 16777216) !== 0)) {\n        this._reject(promise._reason());\n    } else {\n        var reason = new CancellationError("late cancellation observer");\n        promise._attachExtraTrace(reason);\n        this._reject(reason);\n    }\n};\n\nPromise.prototype._rejectCallback =\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\n    var trace = util.ensureErrorObject(reason);\n    var hasStack = trace === reason;\n    if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\n        var message = "a promise was rejected with a non-error: " +\n            util.classString(reason);\n        this._warn(message, true);\n    }\n    this._attachExtraTrace(trace, synchronous ? hasStack : false);\n    this._reject(reason);\n};\n\nPromise.prototype._resolveFromExecutor = function (executor) {\n    var promise = this;\n    this._captureStackTrace();\n    this._pushContext();\n    var synchronous = true;\n    var r = this._execute(executor, function(value) {\n        promise._resolveCallback(value);\n    }, function (reason) {\n        promise._rejectCallback(reason, synchronous);\n    });\n    synchronous = false;\n    this._popContext();\n\n    if (r !== undefined) {\n        promise._rejectCallback(r, true);\n    }\n};\n\nPromise.prototype._settlePromiseFromHandler = function (\n    handler, receiver, value, promise\n) {\n    var bitField = promise._bitField;\n    if (((bitField & 65536) !== 0)) return;\n    promise._pushContext();\n    var x;\n    if (receiver === APPLY) {\n        if (!value || typeof value.length !== "number") {\n            x = errorObj;\n            x.e = new TypeError("cannot .spread() a non-array: " +\n                                    util.classString(value));\n        } else {\n            x = tryCatch(handler).apply(this._boundValue(), value);\n        }\n    } else {\n        x = tryCatch(handler).call(receiver, value);\n    }\n    var promiseCreated = promise._popContext();\n    bitField = promise._bitField;\n    if (((bitField & 65536) !== 0)) return;\n\n    if (x === NEXT_FILTER) {\n        promise._reject(value);\n    } else if (x === errorObj || x === promise) {\n        var err = x === promise ? makeSelfResolutionError() : x.e;\n        promise._rejectCallback(err, false);\n    } else {\n        debug.checkForgottenReturns(x, promiseCreated, "",  promise, this);\n        promise._resolveCallback(x);\n    }\n};\n\nPromise.prototype._target = function() {\n    var ret = this;\n    while (ret._isFollowing()) ret = ret._followee();\n    return ret;\n};\n\nPromise.prototype._followee = function() {\n    return this._rejectionHandler0;\n};\n\nPromise.prototype._setFollowee = function(promise) {\n    this._rejectionHandler0 = promise;\n};\n\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\n    var isPromise = promise instanceof Promise;\n    var bitField = this._bitField;\n    var asyncGuaranteed = ((bitField & 134217728) !== 0);\n    if (((bitField & 65536) !== 0)) {\n        if (isPromise) promise._invokeInternalOnCancel();\n\n        if (receiver instanceof PassThroughHandlerContext &&\n            receiver.isFinallyHandler()) {\n            receiver.cancelPromise = promise;\n            if (tryCatch(handler).call(receiver, value) === errorObj) {\n                promise._reject(errorObj.e);\n            }\n        } else if (handler === reflectHandler) {\n            promise._fulfill(reflectHandler.call(receiver));\n        } else if (receiver instanceof Proxyable) {\n            receiver._promiseCancelled(promise);\n        } else if (isPromise || promise instanceof PromiseArray) {\n            promise._cancel();\n        } else {\n            receiver.cancel();\n        }\n    } else if (typeof handler === "function") {\n        if (!isPromise) {\n            handler.call(receiver, value, promise);\n        } else {\n            if (asyncGuaranteed) promise._setAsyncGuaranteed();\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\n        }\n    } else if (receiver instanceof Proxyable) {\n        if (!receiver._isResolved()) {\n            if (((bitField & 33554432) !== 0)) {\n                receiver._promiseFulfilled(value, promise);\n            } else {\n                receiver._promiseRejected(value, promise);\n            }\n        }\n    } else if (isPromise) {\n        if (asyncGuaranteed) promise._setAsyncGuaranteed();\n        if (((bitField & 33554432) !== 0)) {\n            promise._fulfill(value);\n        } else {\n            promise._reject(value);\n        }\n    }\n};\n\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\n    var handler = ctx.handler;\n    var promise = ctx.promise;\n    var receiver = ctx.receiver;\n    var value = ctx.value;\n    if (typeof handler === "function") {\n        if (!(promise instanceof Promise)) {\n            handler.call(receiver, value, promise);\n        } else {\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\n        }\n    } else if (promise instanceof Promise) {\n        promise._reject(value);\n    }\n};\n\nPromise.prototype._settlePromiseCtx = function(ctx) {\n    this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\n};\n\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\n    var promise = this._promise0;\n    var receiver = this._receiverAt(0);\n    this._promise0 = undefined;\n    this._receiver0 = undefined;\n    this._settlePromise(promise, handler, receiver, value);\n};\n\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\n    var base = index * 4 - 4;\n    this[base + 2] =\n    this[base + 3] =\n    this[base + 0] =\n    this[base + 1] = undefined;\n};\n\nPromise.prototype._fulfill = function (value) {\n    var bitField = this._bitField;\n    if (((bitField & 117506048) >>> 16)) return;\n    if (value === this) {\n        var err = makeSelfResolutionError();\n        this._attachExtraTrace(err);\n        return this._reject(err);\n    }\n    this._setFulfilled();\n    this._rejectionHandler0 = value;\n\n    if ((bitField & 65535) > 0) {\n        if (((bitField & 134217728) !== 0)) {\n            this._settlePromises();\n        } else {\n            async.settlePromises(this);\n        }\n    }\n};\n\nPromise.prototype._reject = function (reason) {\n    var bitField = this._bitField;\n    if (((bitField & 117506048) >>> 16)) return;\n    this._setRejected();\n    this._fulfillmentHandler0 = reason;\n\n    if (this._isFinal()) {\n        return async.fatalError(reason, util.isNode);\n    }\n\n    if ((bitField & 65535) > 0) {\n        if (((bitField & 134217728) !== 0)) {\n            this._settlePromises();\n        } else {\n            async.settlePromises(this);\n        }\n    } else {\n        this._ensurePossibleRejectionHandled();\n    }\n};\n\nPromise.prototype._fulfillPromises = function (len, value) {\n    for (var i = 1; i < len; i++) {\n        var handler = this._fulfillmentHandlerAt(i);\n        var promise = this._promiseAt(i);\n        var receiver = this._receiverAt(i);\n        this._clearCallbackDataAtIndex(i);\n        this._settlePromise(promise, handler, receiver, value);\n    }\n};\n\nPromise.prototype._rejectPromises = function (len, reason) {\n    for (var i = 1; i < len; i++) {\n        var handler = this._rejectionHandlerAt(i);\n        var promise = this._promiseAt(i);\n        var receiver = this._receiverAt(i);\n        this._clearCallbackDataAtIndex(i);\n        this._settlePromise(promise, handler, receiver, reason);\n    }\n};\n\nPromise.prototype._settlePromises = function () {\n    var bitField = this._bitField;\n    var len = (bitField & 65535);\n\n    if (len > 0) {\n        if (((bitField & 16842752) !== 0)) {\n            var reason = this._fulfillmentHandler0;\n            this._settlePromise0(this._rejectionHandler0, reason, bitField);\n            this._rejectPromises(len, reason);\n        } else {\n            var value = this._rejectionHandler0;\n            this._settlePromise0(this._fulfillmentHandler0, value, bitField);\n            this._fulfillPromises(len, value);\n        }\n        this._setLength(0);\n    }\n    this._clearCancellationData();\n};\n\nPromise.prototype._settledValue = function() {\n    var bitField = this._bitField;\n    if (((bitField & 33554432) !== 0)) {\n        return this._rejectionHandler0;\n    } else if (((bitField & 16777216) !== 0)) {\n        return this._fulfillmentHandler0;\n    }\n};\n\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\n\nPromise.defer = Promise.pending = function() {\n    debug.deprecated("Promise.defer", "new Promise");\n    var promise = new Promise(INTERNAL);\n    return {\n        promise: promise,\n        resolve: deferResolve,\n        reject: deferReject\n    };\n};\n\nutil.notEnumerableProp(Promise,\n                       "_makeSelfResolutionError",\n                       makeSelfResolutionError);\n\n_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\n    debug);\n_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug);\n_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug);\n_dereq_("./direct_resolve")(Promise);\n_dereq_("./synchronous_inspection")(Promise);\n_dereq_("./join")(\n    Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug);\nPromise.Promise = Promise;\n_dereq_(\'./map.js\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_(\'./using.js\')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\n_dereq_(\'./timers.js\')(Promise, INTERNAL, debug);\n_dereq_(\'./generators.js\')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\n_dereq_(\'./nodeify.js\')(Promise);\n_dereq_(\'./call_get.js\')(Promise);\n_dereq_(\'./props.js\')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\n_dereq_(\'./race.js\')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\n_dereq_(\'./reduce.js\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\n_dereq_(\'./settle.js\')(Promise, PromiseArray, debug);\n_dereq_(\'./some.js\')(Promise, PromiseArray, apiRejection);\n_dereq_(\'./promisify.js\')(Promise, INTERNAL);\n_dereq_(\'./any.js\')(Promise);\n_dereq_(\'./each.js\')(Promise, INTERNAL);\n_dereq_(\'./filter.js\')(Promise, INTERNAL);\n                                                         \n    util.toFastProperties(Promise);                                          \n    util.toFastProperties(Promise.prototype);                                \n    function fillTypes(value) {                                              \n        var p = new Promise(INTERNAL);                                       \n        p._fulfillmentHandler0 = value;                                      \n        p._rejectionHandler0 = value;                                        \n        p._promise0 = value;                                                 \n        p._receiver0 = value;                                                \n    }                                                                        \n    // Complete slack tracking, opt out of field-type tracking and           \n    // stabilize map                                                         \n    fillTypes({a: 1});                                                       \n    fillTypes({b: 2});                                                       \n    fillTypes({c: 3});                                                       \n    fillTypes(1);                                                            \n    fillTypes(function(){});                                                 \n    fillTypes(undefined);                                                    \n    fillTypes(false);                                                        \n    fillTypes(new Promise(INTERNAL));                                        \n    debug.setBounds(Async.firstLineError, util.lastLineError);               \n    return Promise;                                                          \n\n};\n\n},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\n    apiRejection, Proxyable) {\nvar util = _dereq_("./util");\nvar isArray = util.isArray;\n\nfunction toResolutionValue(val) {\n    switch(val) {\n    case -2: return [];\n    case -3: return {};\n    }\n}\n\nfunction PromiseArray(values) {\n    var promise = this._promise = new Promise(INTERNAL);\n    if (values instanceof Promise) {\n        promise._propagateFrom(values, 3);\n    }\n    promise._setOnCancel(this);\n    this._values = values;\n    this._length = 0;\n    this._totalResolved = 0;\n    this._init(undefined, -2);\n}\nutil.inherits(PromiseArray, Proxyable);\n\nPromiseArray.prototype.length = function () {\n    return this._length;\n};\n\nPromiseArray.prototype.promise = function () {\n    return this._promise;\n};\n\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\n    var values = tryConvertToPromise(this._values, this._promise);\n    if (values instanceof Promise) {\n        values = values._target();\n        var bitField = values._bitField;\n        ;\n        this._values = values;\n\n        if (((bitField & 50397184) === 0)) {\n            this._promise._setAsyncGuaranteed();\n            return values._then(\n                init,\n                this._reject,\n                undefined,\n                this,\n                resolveValueIfEmpty\n           );\n        } else if (((bitField & 33554432) !== 0)) {\n            values = values._value();\n        } else if (((bitField & 16777216) !== 0)) {\n            return this._reject(values._reason());\n        } else {\n            return this._cancel();\n        }\n    }\n    values = util.asArray(values);\n    if (values === null) {\n        var err = apiRejection(\n            "expecting an array or an iterable object but got " + util.classString(values)).reason();\n        this._promise._rejectCallback(err, false);\n        return;\n    }\n\n    if (values.length === 0) {\n        if (resolveValueIfEmpty === -5) {\n            this._resolveEmptyArray();\n        }\n        else {\n            this._resolve(toResolutionValue(resolveValueIfEmpty));\n        }\n        return;\n    }\n    this._iterate(values);\n};\n\nPromiseArray.prototype._iterate = function(values) {\n    var len = this.getActualLength(values.length);\n    this._length = len;\n    this._values = this.shouldCopyValues() ? new Array(len) : this._values;\n    var result = this._promise;\n    var isResolved = false;\n    var bitField = null;\n    for (var i = 0; i < len; ++i) {\n        var maybePromise = tryConvertToPromise(values[i], result);\n\n        if (maybePromise instanceof Promise) {\n            maybePromise = maybePromise._target();\n            bitField = maybePromise._bitField;\n        } else {\n            bitField = null;\n        }\n\n        if (isResolved) {\n            if (bitField !== null) {\n                maybePromise.suppressUnhandledRejections();\n            }\n        } else if (bitField !== null) {\n            if (((bitField & 50397184) === 0)) {\n                maybePromise._proxy(this, i);\n                this._values[i] = maybePromise;\n            } else if (((bitField & 33554432) !== 0)) {\n                isResolved = this._promiseFulfilled(maybePromise._value(), i);\n            } else if (((bitField & 16777216) !== 0)) {\n                isResolved = this._promiseRejected(maybePromise._reason(), i);\n            } else {\n                isResolved = this._promiseCancelled(i);\n            }\n        } else {\n            isResolved = this._promiseFulfilled(maybePromise, i);\n        }\n    }\n    if (!isResolved) result._setAsyncGuaranteed();\n};\n\nPromiseArray.prototype._isResolved = function () {\n    return this._values === null;\n};\n\nPromiseArray.prototype._resolve = function (value) {\n    this._values = null;\n    this._promise._fulfill(value);\n};\n\nPromiseArray.prototype._cancel = function() {\n    if (this._isResolved() || !this._promise.isCancellable()) return;\n    this._values = null;\n    this._promise._cancel();\n};\n\nPromiseArray.prototype._reject = function (reason) {\n    this._values = null;\n    this._promise._rejectCallback(reason, false);\n};\n\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    this._values[index] = value;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        this._resolve(this._values);\n        return true;\n    }\n    return false;\n};\n\nPromiseArray.prototype._promiseCancelled = function() {\n    this._cancel();\n    return true;\n};\n\nPromiseArray.prototype._promiseRejected = function (reason) {\n    this._totalResolved++;\n    this._reject(reason);\n    return true;\n};\n\nPromiseArray.prototype._resultCancelled = function() {\n    if (this._isResolved()) return;\n    var values = this._values;\n    this._cancel();\n    if (values instanceof Promise) {\n        values.cancel();\n    } else {\n        for (var i = 0; i < values.length; ++i) {\n            if (values[i] instanceof Promise) {\n                values[i].cancel();\n            }\n        }\n    }\n};\n\nPromiseArray.prototype.shouldCopyValues = function () {\n    return true;\n};\n\nPromiseArray.prototype.getActualLength = function (len) {\n    return len;\n};\n\nreturn PromiseArray;\n};\n\n},{"./util":36}],24:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar THIS = {};\nvar util = _dereq_("./util");\nvar nodebackForPromise = _dereq_("./nodeback");\nvar withAppended = util.withAppended;\nvar maybeWrapAsError = util.maybeWrapAsError;\nvar canEvaluate = util.canEvaluate;\nvar TypeError = _dereq_("./errors").TypeError;\nvar defaultSuffix = "Async";\nvar defaultPromisified = {__isPromisified__: true};\nvar noCopyProps = [\n    "arity",    "length",\n    "name",\n    "arguments",\n    "caller",\n    "callee",\n    "prototype",\n    "__isPromisified__"\n];\nvar noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$");\n\nvar defaultFilter = function(name) {\n    return util.isIdentifier(name) &&\n        name.charAt(0) !== "_" &&\n        name !== "constructor";\n};\n\nfunction propsFilter(key) {\n    return !noCopyPropsPattern.test(key);\n}\n\nfunction isPromisified(fn) {\n    try {\n        return fn.__isPromisified__ === true;\n    }\n    catch (e) {\n        return false;\n    }\n}\n\nfunction hasPromisified(obj, key, suffix) {\n    var val = util.getDataPropertyOrDefault(obj, key + suffix,\n                                            defaultPromisified);\n    return val ? isPromisified(val) : false;\n}\nfunction checkValid(ret, suffix, suffixRegexp) {\n    for (var i = 0; i < ret.length; i += 2) {\n        var key = ret[i];\n        if (suffixRegexp.test(key)) {\n            var keyWithoutAsyncSuffix = key.replace(suffixRegexp, "");\n            for (var j = 0; j < ret.length; j += 2) {\n                if (ret[j] === keyWithoutAsyncSuffix) {\n                    throw new TypeError("Cannot promisify an API that has normal methods with \'%s\'-suffix\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a"\n                        .replace("%s", suffix));\n                }\n            }\n        }\n    }\n}\n\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\n    var keys = util.inheritedDataKeys(obj);\n    var ret = [];\n    for (var i = 0; i < keys.length; ++i) {\n        var key = keys[i];\n        var value = obj[key];\n        var passesDefaultFilter = filter === defaultFilter\n            ? true : defaultFilter(key, value, obj);\n        if (typeof value === "function" &&\n            !isPromisified(value) &&\n            !hasPromisified(obj, key, suffix) &&\n            filter(key, value, obj, passesDefaultFilter)) {\n            ret.push(key, value);\n        }\n    }\n    checkValid(ret, suffix, suffixRegexp);\n    return ret;\n}\n\nvar escapeIdentRegex = function(str) {\n    return str.replace(/([$])/, "\\\\$");\n};\n\nvar makeNodePromisifiedEval;\nif (false) {\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\n    var ret = [likelyArgumentCount];\n    var min = Math.max(0, likelyArgumentCount - 1 - 3);\n    for(var i = likelyArgumentCount - 1; i >= min; --i) {\n        ret.push(i);\n    }\n    for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\n        ret.push(i);\n    }\n    return ret;\n};\n\nvar argumentSequence = function(argumentCount) {\n    return util.filledRange(argumentCount, "_arg", "");\n};\n\nvar parameterDeclaration = function(parameterCount) {\n    return util.filledRange(\n        Math.max(parameterCount, 3), "_arg", "");\n};\n\nvar parameterCount = function(fn) {\n    if (typeof fn.length === "number") {\n        return Math.max(Math.min(fn.length, 1023 + 1), 0);\n    }\n    return 0;\n};\n\nmakeNodePromisifiedEval =\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\n    var newParameterCount = Math.max(0, parameterCount(fn) - 1);\n    var argumentOrder = switchCaseArgumentOrder(newParameterCount);\n    var shouldProxyThis = typeof callback === "string" || receiver === THIS;\n\n    function generateCallForArgumentCount(count) {\n        var args = argumentSequence(count).join(", ");\n        var comma = count > 0 ? ", " : "";\n        var ret;\n        if (shouldProxyThis) {\n            ret = "ret = callback.call(this, {{args}}, nodeback); break;\\n";\n        } else {\n            ret = receiver === undefined\n                ? "ret = callback({{args}}, nodeback); break;\\n"\n                : "ret = callback.call(receiver, {{args}}, nodeback); break;\\n";\n        }\n        return ret.replace("{{args}}", args).replace(", ", comma);\n    }\n\n    function generateArgumentSwitchCase() {\n        var ret = "";\n        for (var i = 0; i < argumentOrder.length; ++i) {\n            ret += "case " + argumentOrder[i] +":" +\n                generateCallForArgumentCount(argumentOrder[i]);\n        }\n\n        ret += "                                                             \\n\\\n        default:                                                             \\n\\\n            var args = new Array(len + 1);                                   \\n\\\n            var i = 0;                                                       \\n\\\n            for (var i = 0; i < len; ++i) {                                  \\n\\\n               args[i] = arguments[i];                                       \\n\\\n            }                                                                \\n\\\n            args[i] = nodeback;                                              \\n\\\n            [CodeForCall]                                                    \\n\\\n            break;                                                           \\n\\\n        ".replace("[CodeForCall]", (shouldProxyThis\n                                ? "ret = callback.apply(this, args);\\n"\n                                : "ret = callback.apply(receiver, args);\\n"));\n        return ret;\n    }\n\n    var getFunctionCode = typeof callback === "string"\n                                ? ("this != null ? this[\'"+callback+"\'] : fn")\n                                : "fn";\n    var body = "\'use strict\';                                                \\n\\\n        var ret = function (Parameters) {                                    \\n\\\n            \'use strict\';                                                    \\n\\\n            var len = arguments.length;                                      \\n\\\n            var promise = new Promise(INTERNAL);                             \\n\\\n            promise._captureStackTrace();                                    \\n\\\n            var nodeback = nodebackForPromise(promise, " + multiArgs + ");   \\n\\\n            var ret;                                                         \\n\\\n            var callback = tryCatch([GetFunctionCode]);                      \\n\\\n            switch(len) {                                                    \\n\\\n                [CodeForSwitchCase]                                          \\n\\\n            }                                                                \\n\\\n            if (ret === errorObj) {                                          \\n\\\n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\n\\\n            }                                                                \\n\\\n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \\n\\\n            return promise;                                                  \\n\\\n        };                                                                   \\n\\\n        notEnumerableProp(ret, \'__isPromisified__\', true);                   \\n\\\n        return ret;                                                          \\n\\\n    ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase())\n        .replace("[GetFunctionCode]", getFunctionCode);\n    body = body.replace("Parameters", parameterDeclaration(newParameterCount));\n    return new Function("Promise",\n                        "fn",\n                        "receiver",\n                        "withAppended",\n                        "maybeWrapAsError",\n                        "nodebackForPromise",\n                        "tryCatch",\n                        "errorObj",\n                        "notEnumerableProp",\n                        "INTERNAL",\n                        body)(\n                    Promise,\n                    fn,\n                    receiver,\n                    withAppended,\n                    maybeWrapAsError,\n                    nodebackForPromise,\n                    util.tryCatch,\n                    util.errorObj,\n                    util.notEnumerableProp,\n                    INTERNAL);\n};\n}\n\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\n    var defaultThis = (function() {return this;})();\n    var method = callback;\n    if (typeof method === "string") {\n        callback = fn;\n    }\n    function promisified() {\n        var _receiver = receiver;\n        if (receiver === THIS) _receiver = this;\n        var promise = new Promise(INTERNAL);\n        promise._captureStackTrace();\n        var cb = typeof method === "string" && this !== defaultThis\n            ? this[method] : callback;\n        var fn = nodebackForPromise(promise, multiArgs);\n        try {\n            cb.apply(_receiver, withAppended(arguments, fn));\n        } catch(e) {\n            promise._rejectCallback(maybeWrapAsError(e), true, true);\n        }\n        if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\n        return promise;\n    }\n    util.notEnumerableProp(promisified, "__isPromisified__", true);\n    return promisified;\n}\n\nvar makeNodePromisified = canEvaluate\n    ? makeNodePromisifiedEval\n    : makeNodePromisifiedClosure;\n\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\n    var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$");\n    var methods =\n        promisifiableMethods(obj, suffix, suffixRegexp, filter);\n\n    for (var i = 0, len = methods.length; i < len; i+= 2) {\n        var key = methods[i];\n        var fn = methods[i+1];\n        var promisifiedKey = key + suffix;\n        if (promisifier === makeNodePromisified) {\n            obj[promisifiedKey] =\n                makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\n        } else {\n            var promisified = promisifier(fn, function() {\n                return makeNodePromisified(key, THIS, key,\n                                           fn, suffix, multiArgs);\n            });\n            util.notEnumerableProp(promisified, "__isPromisified__", true);\n            obj[promisifiedKey] = promisified;\n        }\n    }\n    util.toFastProperties(obj);\n    return obj;\n}\n\nfunction promisify(callback, receiver, multiArgs) {\n    return makeNodePromisified(callback, receiver, undefined,\n                                callback, null, multiArgs);\n}\n\nPromise.promisify = function (fn, options) {\n    if (typeof fn !== "function") {\n        throw new TypeError("expecting a function but got " + util.classString(fn));\n    }\n    if (isPromisified(fn)) {\n        return fn;\n    }\n    options = Object(options);\n    var receiver = options.context === undefined ? THIS : options.context;\n    var multiArgs = !!options.multiArgs;\n    var ret = promisify(fn, receiver, multiArgs);\n    util.copyDescriptors(fn, ret, propsFilter);\n    return ret;\n};\n\nPromise.promisifyAll = function (target, options) {\n    if (typeof target !== "function" && typeof target !== "object") {\n        throw new TypeError("the target of promisifyAll must be an object or a function\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    options = Object(options);\n    var multiArgs = !!options.multiArgs;\n    var suffix = options.suffix;\n    if (typeof suffix !== "string") suffix = defaultSuffix;\n    var filter = options.filter;\n    if (typeof filter !== "function") filter = defaultFilter;\n    var promisifier = options.promisifier;\n    if (typeof promisifier !== "function") promisifier = makeNodePromisified;\n\n    if (!util.isIdentifier(suffix)) {\n        throw new RangeError("suffix must be a valid identifier\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n\n    var keys = util.inheritedDataKeys(target);\n    for (var i = 0; i < keys.length; ++i) {\n        var value = target[keys[i]];\n        if (keys[i] !== "constructor" &&\n            util.isClass(value)) {\n            promisifyAll(value.prototype, suffix, filter, promisifier,\n                multiArgs);\n            promisifyAll(value, suffix, filter, promisifier, multiArgs);\n        }\n    }\n\n    return promisifyAll(target, suffix, filter, promisifier, multiArgs);\n};\n};\n\n\n},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(\n    Promise, PromiseArray, tryConvertToPromise, apiRejection) {\nvar util = _dereq_("./util");\nvar isObject = util.isObject;\nvar es5 = _dereq_("./es5");\nvar Es6Map;\nif (typeof Map === "function") Es6Map = Map;\n\nvar mapToEntries = (function() {\n    var index = 0;\n    var size = 0;\n\n    function extractEntry(value, key) {\n        this[index] = value;\n        this[index + size] = key;\n        index++;\n    }\n\n    return function mapToEntries(map) {\n        size = map.size;\n        index = 0;\n        var ret = new Array(map.size * 2);\n        map.forEach(extractEntry, ret);\n        return ret;\n    };\n})();\n\nvar entriesToMap = function(entries) {\n    var ret = new Es6Map();\n    var length = entries.length / 2 | 0;\n    for (var i = 0; i < length; ++i) {\n        var key = entries[length + i];\n        var value = entries[i];\n        ret.set(key, value);\n    }\n    return ret;\n};\n\nfunction PropertiesPromiseArray(obj) {\n    var isMap = false;\n    var entries;\n    if (Es6Map !== undefined && obj instanceof Es6Map) {\n        entries = mapToEntries(obj);\n        isMap = true;\n    } else {\n        var keys = es5.keys(obj);\n        var len = keys.length;\n        entries = new Array(len * 2);\n        for (var i = 0; i < len; ++i) {\n            var key = keys[i];\n            entries[i] = obj[key];\n            entries[i + len] = key;\n        }\n    }\n    this.constructor$(entries);\n    this._isMap = isMap;\n    this._init$(undefined, -3);\n}\nutil.inherits(PropertiesPromiseArray, PromiseArray);\n\nPropertiesPromiseArray.prototype._init = function () {};\n\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    this._values[index] = value;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        var val;\n        if (this._isMap) {\n            val = entriesToMap(this._values);\n        } else {\n            val = {};\n            var keyOffset = this.length();\n            for (var i = 0, len = this.length(); i < len; ++i) {\n                val[this._values[i + keyOffset]] = this._values[i];\n            }\n        }\n        this._resolve(val);\n        return true;\n    }\n    return false;\n};\n\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\n    return false;\n};\n\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\n    return len >> 1;\n};\n\nfunction props(promises) {\n    var ret;\n    var castValue = tryConvertToPromise(promises);\n\n    if (!isObject(castValue)) {\n        return apiRejection("cannot await properties of a non-object\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    } else if (castValue instanceof Promise) {\n        ret = castValue._then(\n            Promise.props, undefined, undefined, undefined, undefined);\n    } else {\n        ret = new PropertiesPromiseArray(castValue).promise();\n    }\n\n    if (castValue instanceof Promise) {\n        ret._propagateFrom(castValue, 2);\n    }\n    return ret;\n}\n\nPromise.prototype.props = function () {\n    return props(this);\n};\n\nPromise.props = function (promises) {\n    return props(promises);\n};\n};\n\n},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){\n"use strict";\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\n    for (var j = 0; j < len; ++j) {\n        dst[j + dstIndex] = src[j + srcIndex];\n        src[j + srcIndex] = void 0;\n    }\n}\n\nfunction Queue(capacity) {\n    this._capacity = capacity;\n    this._length = 0;\n    this._front = 0;\n}\n\nQueue.prototype._willBeOverCapacity = function (size) {\n    return this._capacity < size;\n};\n\nQueue.prototype._pushOne = function (arg) {\n    var length = this.length();\n    this._checkCapacity(length + 1);\n    var i = (this._front + length) & (this._capacity - 1);\n    this[i] = arg;\n    this._length = length + 1;\n};\n\nQueue.prototype._unshiftOne = function(value) {\n    var capacity = this._capacity;\n    this._checkCapacity(this.length() + 1);\n    var front = this._front;\n    var i = (((( front - 1 ) &\n                    ( capacity - 1) ) ^ capacity ) - capacity );\n    this[i] = value;\n    this._front = i;\n    this._length = this.length() + 1;\n};\n\nQueue.prototype.unshift = function(fn, receiver, arg) {\n    this._unshiftOne(arg);\n    this._unshiftOne(receiver);\n    this._unshiftOne(fn);\n};\n\nQueue.prototype.push = function (fn, receiver, arg) {\n    var length = this.length() + 3;\n    if (this._willBeOverCapacity(length)) {\n        this._pushOne(fn);\n        this._pushOne(receiver);\n        this._pushOne(arg);\n        return;\n    }\n    var j = this._front + length - 3;\n    this._checkCapacity(length);\n    var wrapMask = this._capacity - 1;\n    this[(j + 0) & wrapMask] = fn;\n    this[(j + 1) & wrapMask] = receiver;\n    this[(j + 2) & wrapMask] = arg;\n    this._length = length;\n};\n\nQueue.prototype.shift = function () {\n    var front = this._front,\n        ret = this[front];\n\n    this[front] = undefined;\n    this._front = (front + 1) & (this._capacity - 1);\n    this._length--;\n    return ret;\n};\n\nQueue.prototype.length = function () {\n    return this._length;\n};\n\nQueue.prototype._checkCapacity = function (size) {\n    if (this._capacity < size) {\n        this._resizeTo(this._capacity << 1);\n    }\n};\n\nQueue.prototype._resizeTo = function (capacity) {\n    var oldCapacity = this._capacity;\n    this._capacity = capacity;\n    var front = this._front;\n    var length = this._length;\n    var moveItemsCount = (front + length) & (oldCapacity - 1);\n    arrayMove(this, 0, this, oldCapacity, moveItemsCount);\n};\n\nmodule.exports = Queue;\n\n},{}],27:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(\n    Promise, INTERNAL, tryConvertToPromise, apiRejection) {\nvar util = _dereq_("./util");\n\nvar raceLater = function (promise) {\n    return promise.then(function(array) {\n        return race(array, promise);\n    });\n};\n\nfunction race(promises, parent) {\n    var maybePromise = tryConvertToPromise(promises);\n\n    if (maybePromise instanceof Promise) {\n        return raceLater(maybePromise);\n    } else {\n        promises = util.asArray(promises);\n        if (promises === null)\n            return apiRejection("expecting an array or an iterable object but got " + util.classString(promises));\n    }\n\n    var ret = new Promise(INTERNAL);\n    if (parent !== undefined) {\n        ret._propagateFrom(parent, 3);\n    }\n    var fulfill = ret._fulfill;\n    var reject = ret._reject;\n    for (var i = 0, len = promises.length; i < len; ++i) {\n        var val = promises[i];\n\n        if (val === undefined && !(i in promises)) {\n            continue;\n        }\n\n        Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\n    }\n    return ret;\n}\n\nPromise.race = function (promises) {\n    return race(promises, undefined);\n};\n\nPromise.prototype.race = function () {\n    return race(this, undefined);\n};\n\n};\n\n},{"./util":36}],28:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise,\n                          PromiseArray,\n                          apiRejection,\n                          tryConvertToPromise,\n                          INTERNAL,\n                          debug) {\nvar getDomain = Promise._getDomain;\nvar util = _dereq_("./util");\nvar tryCatch = util.tryCatch;\n\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\n    this.constructor$(promises);\n    var domain = getDomain();\n    this._fn = domain === null ? fn : domain.bind(fn);\n    if (initialValue !== undefined) {\n        initialValue = Promise.resolve(initialValue);\n        initialValue._attachCancellationCallback(this);\n    }\n    this._initialValue = initialValue;\n    this._currentCancellable = null;\n    this._eachValues = _each === INTERNAL ? [] : undefined;\n    this._promise._captureStackTrace();\n    this._init$(undefined, -5);\n}\nutil.inherits(ReductionPromiseArray, PromiseArray);\n\nReductionPromiseArray.prototype._gotAccum = function(accum) {\n    if (this._eachValues !== undefined && accum !== INTERNAL) {\n        this._eachValues.push(accum);\n    }\n};\n\nReductionPromiseArray.prototype._eachComplete = function(value) {\n    this._eachValues.push(value);\n    return this._eachValues;\n};\n\nReductionPromiseArray.prototype._init = function() {};\n\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\n    this._resolve(this._eachValues !== undefined ? this._eachValues\n                                                 : this._initialValue);\n};\n\nReductionPromiseArray.prototype.shouldCopyValues = function () {\n    return false;\n};\n\nReductionPromiseArray.prototype._resolve = function(value) {\n    this._promise._resolveCallback(value);\n    this._values = null;\n};\n\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\n    if (sender === this._initialValue) return this._cancel();\n    if (this._isResolved()) return;\n    this._resultCancelled$();\n    if (this._currentCancellable instanceof Promise) {\n        this._currentCancellable.cancel();\n    }\n    if (this._initialValue instanceof Promise) {\n        this._initialValue.cancel();\n    }\n};\n\nReductionPromiseArray.prototype._iterate = function (values) {\n    this._values = values;\n    var value;\n    var i;\n    var length = values.length;\n    if (this._initialValue !== undefined) {\n        value = this._initialValue;\n        i = 0;\n    } else {\n        value = Promise.resolve(values[0]);\n        i = 1;\n    }\n\n    this._currentCancellable = value;\n\n    if (!value.isRejected()) {\n        for (; i < length; ++i) {\n            var ctx = {\n                accum: null,\n                value: values[i],\n                index: i,\n                length: length,\n                array: this\n            };\n            value = value._then(gotAccum, undefined, undefined, ctx, undefined);\n        }\n    }\n\n    if (this._eachValues !== undefined) {\n        value = value\n            ._then(this._eachComplete, undefined, undefined, this, undefined);\n    }\n    value._then(completed, completed, undefined, value, this);\n};\n\nPromise.prototype.reduce = function (fn, initialValue) {\n    return reduce(this, fn, initialValue, null);\n};\n\nPromise.reduce = function (promises, fn, initialValue, _each) {\n    return reduce(promises, fn, initialValue, _each);\n};\n\nfunction completed(valueOrReason, array) {\n    if (this.isFulfilled()) {\n        array._resolve(valueOrReason);\n    } else {\n        array._reject(valueOrReason);\n    }\n}\n\nfunction reduce(promises, fn, initialValue, _each) {\n    if (typeof fn !== "function") {\n        return apiRejection("expecting a function but got " + util.classString(fn));\n    }\n    var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\n    return array.promise();\n}\n\nfunction gotAccum(accum) {\n    this.accum = accum;\n    this.array._gotAccum(accum);\n    var value = tryConvertToPromise(this.value, this.array._promise);\n    if (value instanceof Promise) {\n        this.array._currentCancellable = value;\n        return value._then(gotValue, undefined, undefined, this, undefined);\n    } else {\n        return gotValue.call(this, value);\n    }\n}\n\nfunction gotValue(value) {\n    var array = this.array;\n    var promise = array._promise;\n    var fn = tryCatch(array._fn);\n    promise._pushContext();\n    var ret;\n    if (array._eachValues !== undefined) {\n        ret = fn.call(promise._boundValue(), value, this.index, this.length);\n    } else {\n        ret = fn.call(promise._boundValue(),\n                              this.accum, value, this.index, this.length);\n    }\n    if (ret instanceof Promise) {\n        array._currentCancellable = ret;\n    }\n    var promiseCreated = promise._popContext();\n    debug.checkForgottenReturns(\n        ret,\n        promiseCreated,\n        array._eachValues !== undefined ? "Promise.each" : "Promise.reduce",\n        promise\n    );\n    return ret;\n}\n};\n\n},{"./util":36}],29:[function(_dereq_,module,exports){\n"use strict";\nvar util = _dereq_("./util");\nvar schedule;\nvar noAsyncScheduler = function() {\n    throw new Error("No async scheduler available\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n};\nif (util.isNode && typeof MutationObserver === "undefined") {\n    var GlobalSetImmediate = global.setImmediate;\n    var ProcessNextTick = process.nextTick;\n    schedule = util.isRecentNode\n                ? function(fn) { GlobalSetImmediate.call(global, fn); }\n                : function(fn) { ProcessNextTick.call(process, fn); };\n} else if ((typeof MutationObserver !== "undefined") &&\n          !(typeof window !== "undefined" &&\n            window.navigator &&\n            window.navigator.standalone)) {\n    schedule = (function() {\n        var div = document.createElement("div");\n        var opts = {attributes: true};\n        var toggleScheduled = false;\n        var div2 = document.createElement("div");\n        var o2 = new MutationObserver(function() {\n            div.classList.toggle("foo");\n          toggleScheduled = false;\n        });\n        o2.observe(div2, opts);\n\n        var scheduleToggle = function() {\n            if (toggleScheduled) return;\n          toggleScheduled = true;\n          div2.classList.toggle("foo");\n        };\n\n        return function schedule(fn) {\n          var o = new MutationObserver(function() {\n            o.disconnect();\n            fn();\n          });\n          o.observe(div, opts);\n          scheduleToggle();\n        };\n    })();\n} else if (typeof setImmediate !== "undefined") {\n    schedule = function (fn) {\n        setImmediate(fn);\n    };\n} else if (typeof setTimeout !== "undefined") {\n    schedule = function (fn) {\n        setTimeout(fn, 0);\n    };\n} else {\n    schedule = noAsyncScheduler;\n}\nmodule.exports = schedule;\n\n},{"./util":36}],30:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\n    function(Promise, PromiseArray, debug) {\nvar PromiseInspection = Promise.PromiseInspection;\nvar util = _dereq_("./util");\n\nfunction SettledPromiseArray(values) {\n    this.constructor$(values);\n}\nutil.inherits(SettledPromiseArray, PromiseArray);\n\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\n    this._values[index] = inspection;\n    var totalResolved = ++this._totalResolved;\n    if (totalResolved >= this._length) {\n        this._resolve(this._values);\n        return true;\n    }\n    return false;\n};\n\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\n    var ret = new PromiseInspection();\n    ret._bitField = 33554432;\n    ret._settledValueField = value;\n    return this._promiseResolved(index, ret);\n};\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\n    var ret = new PromiseInspection();\n    ret._bitField = 16777216;\n    ret._settledValueField = reason;\n    return this._promiseResolved(index, ret);\n};\n\nPromise.settle = function (promises) {\n    debug.deprecated(".settle()", ".reflect()");\n    return new SettledPromiseArray(promises).promise();\n};\n\nPromise.prototype.settle = function () {\n    return Promise.settle(this);\n};\n};\n\n},{"./util":36}],31:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports =\nfunction(Promise, PromiseArray, apiRejection) {\nvar util = _dereq_("./util");\nvar RangeError = _dereq_("./errors").RangeError;\nvar AggregateError = _dereq_("./errors").AggregateError;\nvar isArray = util.isArray;\nvar CANCELLATION = {};\n\n\nfunction SomePromiseArray(values) {\n    this.constructor$(values);\n    this._howMany = 0;\n    this._unwrap = false;\n    this._initialized = false;\n}\nutil.inherits(SomePromiseArray, PromiseArray);\n\nSomePromiseArray.prototype._init = function () {\n    if (!this._initialized) {\n        return;\n    }\n    if (this._howMany === 0) {\n        this._resolve([]);\n        return;\n    }\n    this._init$(undefined, -5);\n    var isArrayResolved = isArray(this._values);\n    if (!this._isResolved() &&\n        isArrayResolved &&\n        this._howMany > this._canPossiblyFulfill()) {\n        this._reject(this._getRangeError(this.length()));\n    }\n};\n\nSomePromiseArray.prototype.init = function () {\n    this._initialized = true;\n    this._init();\n};\n\nSomePromiseArray.prototype.setUnwrap = function () {\n    this._unwrap = true;\n};\n\nSomePromiseArray.prototype.howMany = function () {\n    return this._howMany;\n};\n\nSomePromiseArray.prototype.setHowMany = function (count) {\n    this._howMany = count;\n};\n\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\n    this._addFulfilled(value);\n    if (this._fulfilled() === this.howMany()) {\n        this._values.length = this.howMany();\n        if (this.howMany() === 1 && this._unwrap) {\n            this._resolve(this._values[0]);\n        } else {\n            this._resolve(this._values);\n        }\n        return true;\n    }\n    return false;\n\n};\nSomePromiseArray.prototype._promiseRejected = function (reason) {\n    this._addRejected(reason);\n    return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._promiseCancelled = function () {\n    if (this._values instanceof Promise || this._values == null) {\n        return this._cancel();\n    }\n    this._addRejected(CANCELLATION);\n    return this._checkOutcome();\n};\n\nSomePromiseArray.prototype._checkOutcome = function() {\n    if (this.howMany() > this._canPossiblyFulfill()) {\n        var e = new AggregateError();\n        for (var i = this.length(); i < this._values.length; ++i) {\n            if (this._values[i] !== CANCELLATION) {\n                e.push(this._values[i]);\n            }\n        }\n        if (e.length > 0) {\n            this._reject(e);\n        } else {\n            this._cancel();\n        }\n        return true;\n    }\n    return false;\n};\n\nSomePromiseArray.prototype._fulfilled = function () {\n    return this._totalResolved;\n};\n\nSomePromiseArray.prototype._rejected = function () {\n    return this._values.length - this.length();\n};\n\nSomePromiseArray.prototype._addRejected = function (reason) {\n    this._values.push(reason);\n};\n\nSomePromiseArray.prototype._addFulfilled = function (value) {\n    this._values[this._totalResolved++] = value;\n};\n\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\n    return this.length() - this._rejected();\n};\n\nSomePromiseArray.prototype._getRangeError = function (count) {\n    var message = "Input array must contain at least " +\n            this._howMany + " items but contains only " + count + " items";\n    return new RangeError(message);\n};\n\nSomePromiseArray.prototype._resolveEmptyArray = function () {\n    this._reject(this._getRangeError(0));\n};\n\nfunction some(promises, howMany) {\n    if ((howMany | 0) !== howMany || howMany < 0) {\n        return apiRejection("expecting a positive integer\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    var ret = new SomePromiseArray(promises);\n    var promise = ret.promise();\n    ret.setHowMany(howMany);\n    ret.init();\n    return promise;\n}\n\nPromise.some = function (promises, howMany) {\n    return some(promises, howMany);\n};\n\nPromise.prototype.some = function (howMany) {\n    return some(this, howMany);\n};\n\nPromise._SomePromiseArray = SomePromiseArray;\n};\n\n},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise) {\nfunction PromiseInspection(promise) {\n    if (promise !== undefined) {\n        promise = promise._target();\n        this._bitField = promise._bitField;\n        this._settledValueField = promise._isFateSealed()\n            ? promise._settledValue() : undefined;\n    }\n    else {\n        this._bitField = 0;\n        this._settledValueField = undefined;\n    }\n}\n\nPromiseInspection.prototype._settledValue = function() {\n    return this._settledValueField;\n};\n\nvar value = PromiseInspection.prototype.value = function () {\n    if (!this.isFulfilled()) {\n        throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    return this._settledValue();\n};\n\nvar reason = PromiseInspection.prototype.error =\nPromiseInspection.prototype.reason = function () {\n    if (!this.isRejected()) {\n        throw new TypeError("cannot get rejection reason of a non-rejected promise\\u000a\\u000a    See http://goo.gl/MqrFmX\\u000a");\n    }\n    return this._settledValue();\n};\n\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\n    return (this._bitField & 33554432) !== 0;\n};\n\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\n    return (this._bitField & 16777216) !== 0;\n};\n\nvar isPending = PromiseInspection.prototype.isPending = function () {\n    return (this._bitField & 50397184) === 0;\n};\n\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\n    return (this._bitField & 50331648) !== 0;\n};\n\nPromiseInspection.prototype.isCancelled =\nPromise.prototype._isCancelled = function() {\n    return (this._bitField & 65536) === 65536;\n};\n\nPromise.prototype.isCancelled = function() {\n    return this._target()._isCancelled();\n};\n\nPromise.prototype.isPending = function() {\n    return isPending.call(this._target());\n};\n\nPromise.prototype.isRejected = function() {\n    return isRejected.call(this._target());\n};\n\nPromise.prototype.isFulfilled = function() {\n    return isFulfilled.call(this._target());\n};\n\nPromise.prototype.isResolved = function() {\n    return isResolved.call(this._target());\n};\n\nPromise.prototype.value = function() {\n    return value.call(this._target());\n};\n\nPromise.prototype.reason = function() {\n    var target = this._target();\n    target._unsetRejectionIsUnhandled();\n    return reason.call(target);\n};\n\nPromise.prototype._value = function() {\n    return this._settledValue();\n};\n\nPromise.prototype._reason = function() {\n    this._unsetRejectionIsUnhandled();\n    return this._settledValue();\n};\n\nPromise.PromiseInspection = PromiseInspection;\n};\n\n},{}],33:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL) {\nvar util = _dereq_("./util");\nvar errorObj = util.errorObj;\nvar isObject = util.isObject;\n\nfunction tryConvertToPromise(obj, context) {\n    if (isObject(obj)) {\n        if (obj instanceof Promise) return obj;\n        var then = getThen(obj);\n        if (then === errorObj) {\n            if (context) context._pushContext();\n            var ret = Promise.reject(then.e);\n            if (context) context._popContext();\n            return ret;\n        } else if (typeof then === "function") {\n            if (isAnyBluebirdPromise(obj)) {\n                var ret = new Promise(INTERNAL);\n                obj._then(\n                    ret._fulfill,\n                    ret._reject,\n                    undefined,\n                    ret,\n                    null\n                );\n                return ret;\n            }\n            return doThenable(obj, then, context);\n        }\n    }\n    return obj;\n}\n\nfunction doGetThen(obj) {\n    return obj.then;\n}\n\nfunction getThen(obj) {\n    try {\n        return doGetThen(obj);\n    } catch (e) {\n        errorObj.e = e;\n        return errorObj;\n    }\n}\n\nvar hasProp = {}.hasOwnProperty;\nfunction isAnyBluebirdPromise(obj) {\n    return hasProp.call(obj, "_promise0");\n}\n\nfunction doThenable(x, then, context) {\n    var promise = new Promise(INTERNAL);\n    var ret = promise;\n    if (context) context._pushContext();\n    promise._captureStackTrace();\n    if (context) context._popContext();\n    var synchronous = true;\n    var result = util.tryCatch(then).call(x, resolve, reject);\n    synchronous = false;\n\n    if (promise && result === errorObj) {\n        promise._rejectCallback(result.e, true, true);\n        promise = null;\n    }\n\n    function resolve(value) {\n        if (!promise) return;\n        promise._resolveCallback(value);\n        promise = null;\n    }\n\n    function reject(reason) {\n        if (!promise) return;\n        promise._rejectCallback(reason, synchronous, true);\n        promise = null;\n    }\n    return ret;\n}\n\nreturn tryConvertToPromise;\n};\n\n},{"./util":36}],34:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function(Promise, INTERNAL, debug) {\nvar util = _dereq_("./util");\nvar TimeoutError = Promise.TimeoutError;\n\nfunction HandleWrapper(handle)  {\n    this.handle = handle;\n}\n\nHandleWrapper.prototype._resultCancelled = function() {\n    clearTimeout(this.handle);\n};\n\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\nvar delay = Promise.delay = function (ms, value) {\n    var ret;\n    var handle;\n    if (value !== undefined) {\n        ret = Promise.resolve(value)\n                ._then(afterValue, null, null, ms, undefined);\n        if (debug.cancellation() && value instanceof Promise) {\n            ret._setOnCancel(value);\n        }\n    } else {\n        ret = new Promise(INTERNAL);\n        handle = setTimeout(function() { ret._fulfill(); }, +ms);\n        if (debug.cancellation()) {\n            ret._setOnCancel(new HandleWrapper(handle));\n        }\n    }\n    ret._setAsyncGuaranteed();\n    return ret;\n};\n\nPromise.prototype.delay = function (ms) {\n    return delay(ms, this);\n};\n\nvar afterTimeout = function (promise, message, parent) {\n    var err;\n    if (typeof message !== "string") {\n        if (message instanceof Error) {\n            err = message;\n        } else {\n            err = new TimeoutError("operation timed out");\n        }\n    } else {\n        err = new TimeoutError(message);\n    }\n    util.markAsOriginatingFromRejection(err);\n    promise._attachExtraTrace(err);\n    promise._reject(err);\n\n    if (parent != null) {\n        parent.cancel();\n    }\n};\n\nfunction successClear(value) {\n    clearTimeout(this.handle);\n    return value;\n}\n\nfunction failureClear(reason) {\n    clearTimeout(this.handle);\n    throw reason;\n}\n\nPromise.prototype.timeout = function (ms, message) {\n    ms = +ms;\n    var ret, parent;\n\n    var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\n        if (ret.isPending()) {\n            afterTimeout(ret, message, parent);\n        }\n    }, ms));\n\n    if (debug.cancellation()) {\n        parent = this.then();\n        ret = parent._then(successClear, failureClear,\n                            undefined, handleWrapper, undefined);\n        ret._setOnCancel(handleWrapper);\n    } else {\n        ret = this._then(successClear, failureClear,\n                            undefined, handleWrapper, undefined);\n    }\n\n    return ret;\n};\n\n};\n\n},{"./util":36}],35:[function(_dereq_,module,exports){\n"use strict";\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\n    createContext, INTERNAL, debug) {\n    var util = _dereq_("./util");\n    var TypeError = _dereq_("./errors").TypeError;\n    var inherits = _dereq_("./util").inherits;\n    var errorObj = util.errorObj;\n    var tryCatch = util.tryCatch;\n\n    function thrower(e) {\n        setTimeout(function(){throw e;}, 0);\n    }\n\n    function castPreservingDisposable(thenable) {\n        var maybePromise = tryConvertToPromise(thenable);\n        if (maybePromise !== thenable &&\n            typeof thenable._isDisposable === "function" &&\n            typeof thenable._getDisposer === "function" &&\n            thenable._isDisposable()) {\n            maybePromise._setDisposable(thenable._getDisposer());\n        }\n        return maybePromise;\n    }\n    function dispose(resources, inspection) {\n        var i = 0;\n        var len = resources.length;\n        var ret = new Promise(INTERNAL);\n        function iterator() {\n            if (i >= len) return ret._fulfill();\n            var maybePromise = castPreservingDisposable(resources[i++]);\n            if (maybePromise instanceof Promise &&\n                maybePromise._isDisposable()) {\n                try {\n                    maybePromise = tryConvertToPromise(\n                        maybePromise._getDisposer().tryDispose(inspection),\n                        resources.promise);\n                } catch (e) {\n                    return thrower(e);\n                }\n                if (maybePromise instanceof Promise) {\n                    return maybePromise._then(iterator, thrower,\n                                              null, null, null);\n                }\n            }\n            iterator();\n        }\n        iterator();\n        return ret;\n    }\n\n    function Disposer(data, promise, context) {\n        this._data = data;\n        this._promise = promise;\n        this._context = context;\n    }\n\n    Disposer.prototype.data = function () {\n        return this._data;\n    };\n\n    Disposer.prototype.promise = function () {\n        return this._promise;\n    };\n\n    Disposer.prototype.resource = function () {\n        if (this.promise().isFulfilled()) {\n            return this.promise().value();\n        }\n        return null;\n    };\n\n    Disposer.prototype.tryDispose = function(inspection) {\n        var resource = this.resource();\n        var context = this._context;\n        if (context !== undefined) context._pushContext();\n        var ret = resource !== null\n            ? this.doDispose(resource, inspection) : null;\n        if (context !== undefined) context._popContext();\n        this._promise._unsetDisposable();\n        this._data = null;\n        return ret;\n    };\n\n    Disposer.isDisposer = function (d) {\n        return (d != null &&\n                typeof d.resource === "function" &&\n                typeof d.tryDispose === "function");\n    };\n\n    function FunctionDisposer(fn, promise, context) {\n        this.constructor$(fn, promise, context);\n    }\n    inherits(FunctionDisposer, Disposer);\n\n    FunctionDisposer.prototype.doDispose = function (resource, inspection) {\n        var fn = this.data();\n        return fn.call(resource, resource, inspection);\n    };\n\n    function maybeUnwrapDisposer(value) {\n        if (Disposer.isDisposer(value)) {\n            this.resources[this.index]._setDisposable(value);\n            return value.promise();\n        }\n        return value;\n    }\n\n    function ResourceList(length) {\n        this.length = length;\n        this.promise = null;\n        this[length-1] = null;\n    }\n\n    ResourceList.prototype._resultCancelled = function() {\n        var len = this.length;\n        for (var i = 0; i < len; ++i) {\n            var item = this[i];\n            if (item instanceof Promise) {\n                item.cancel();\n            }\n        }\n    };\n\n    Promise.using = function () {\n        var len = arguments.length;\n        if (len < 2) return apiRejection(\n                        "you must pass at least 2 arguments to Promise.using");\n        var fn = arguments[len - 1];\n        if (typeof fn !== "function") {\n            return apiRejection("expecting a function but got " + util.classString(fn));\n        }\n        var input;\n        var spreadArgs = true;\n        if (len === 2 && Array.isArray(arguments[0])) {\n            input = arguments[0];\n            len = input.length;\n            spreadArgs = false;\n        } else {\n            input = arguments;\n            len--;\n        }\n        var resources = new ResourceList(len);\n        for (var i = 0; i < len; ++i) {\n            var resource = input[i];\n            if (Disposer.isDisposer(resource)) {\n                var disposer = resource;\n                resource = resource.promise();\n                resource._setDisposable(disposer);\n            } else {\n                var maybePromise = tryConvertToPromise(resource);\n                if (maybePromise instanceof Promise) {\n                    resource =\n                        maybePromise._then(maybeUnwrapDisposer, null, null, {\n                            resources: resources,\n                            index: i\n                    }, undefined);\n                }\n            }\n            resources[i] = resource;\n        }\n\n        var reflectedResources = new Array(resources.length);\n        for (var i = 0; i < reflectedResources.length; ++i) {\n            reflectedResources[i] = Promise.resolve(resources[i]).reflect();\n        }\n\n        var resultPromise = Promise.all(reflectedResources)\n            .then(function(inspections) {\n                for (var i = 0; i < inspections.length; ++i) {\n                    var inspection = inspections[i];\n                    if (inspection.isRejected()) {\n                        errorObj.e = inspection.error();\n                        return errorObj;\n                    } else if (!inspection.isFulfilled()) {\n                        resultPromise.cancel();\n                        return;\n                    }\n                    inspections[i] = inspection.value();\n                }\n                promise._pushContext();\n\n                fn = tryCatch(fn);\n                var ret = spreadArgs\n                    ? fn.apply(undefined, inspections) : fn(inspections);\n                var promiseCreated = promise._popContext();\n                debug.checkForgottenReturns(\n                    ret, promiseCreated, "Promise.using", promise);\n                return ret;\n            });\n\n        var promise = resultPromise.lastly(function() {\n            var inspection = new Promise.PromiseInspection(resultPromise);\n            return dispose(resources, inspection);\n        });\n        resources.promise = promise;\n        promise._setOnCancel(resources);\n        return promise;\n    };\n\n    Promise.prototype._setDisposable = function (disposer) {\n        this._bitField = this._bitField | 131072;\n        this._disposer = disposer;\n    };\n\n    Promise.prototype._isDisposable = function () {\n        return (this._bitField & 131072) > 0;\n    };\n\n    Promise.prototype._getDisposer = function () {\n        return this._disposer;\n    };\n\n    Promise.prototype._unsetDisposable = function () {\n        this._bitField = this._bitField & (~131072);\n        this._disposer = undefined;\n    };\n\n    Promise.prototype.disposer = function (fn) {\n        if (typeof fn === "function") {\n            return new FunctionDisposer(fn, this, createContext());\n        }\n        throw new TypeError();\n    };\n\n};\n\n},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){\n"use strict";\nvar es5 = _dereq_("./es5");\nvar canEvaluate = typeof navigator == "undefined";\n\nvar errorObj = {e: {}};\nvar tryCatchTarget;\nvar globalObject = typeof self !== "undefined" ? self :\n    typeof window !== "undefined" ? window :\n    typeof global !== "undefined" ? global :\n    this !== undefined ? this : null;\n\nfunction tryCatcher() {\n    try {\n        var target = tryCatchTarget;\n        tryCatchTarget = null;\n        return target.apply(this, arguments);\n    } catch (e) {\n        errorObj.e = e;\n        return errorObj;\n    }\n}\nfunction tryCatch(fn) {\n    tryCatchTarget = fn;\n    return tryCatcher;\n}\n\nvar inherits = function(Child, Parent) {\n    var hasProp = {}.hasOwnProperty;\n\n    function T() {\n        this.constructor = Child;\n        this.constructor$ = Parent;\n        for (var propertyName in Parent.prototype) {\n            if (hasProp.call(Parent.prototype, propertyName) &&\n                propertyName.charAt(propertyName.length-1) !== "$"\n           ) {\n                this[propertyName + "$"] = Parent.prototype[propertyName];\n            }\n        }\n    }\n    T.prototype = Parent.prototype;\n    Child.prototype = new T();\n    return Child.prototype;\n};\n\n\nfunction isPrimitive(val) {\n    return val == null || val === true || val === false ||\n        typeof val === "string" || typeof val === "number";\n\n}\n\nfunction isObject(value) {\n    return typeof value === "function" ||\n           typeof value === "object" && value !== null;\n}\n\nfunction maybeWrapAsError(maybeError) {\n    if (!isPrimitive(maybeError)) return maybeError;\n\n    return new Error(safeToString(maybeError));\n}\n\nfunction withAppended(target, appendee) {\n    var len = target.length;\n    var ret = new Array(len + 1);\n    var i;\n    for (i = 0; i < len; ++i) {\n        ret[i] = target[i];\n    }\n    ret[i] = appendee;\n    return ret;\n}\n\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\n    if (es5.isES5) {\n        var desc = Object.getOwnPropertyDescriptor(obj, key);\n\n        if (desc != null) {\n            return desc.get == null && desc.set == null\n                    ? desc.value\n                    : defaultValue;\n        }\n    } else {\n        return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\n    }\n}\n\nfunction notEnumerableProp(obj, name, value) {\n    if (isPrimitive(obj)) return obj;\n    var descriptor = {\n        value: value,\n        configurable: true,\n        enumerable: false,\n        writable: true\n    };\n    es5.defineProperty(obj, name, descriptor);\n    return obj;\n}\n\nfunction thrower(r) {\n    throw r;\n}\n\nvar inheritedDataKeys = (function() {\n    var excludedPrototypes = [\n        Array.prototype,\n        Object.prototype,\n        Function.prototype\n    ];\n\n    var isExcludedProto = function(val) {\n        for (var i = 0; i < excludedPrototypes.length; ++i) {\n            if (excludedPrototypes[i] === val) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    if (es5.isES5) {\n        var getKeys = Object.getOwnPropertyNames;\n        return function(obj) {\n            var ret = [];\n            var visitedKeys = Object.create(null);\n            while (obj != null && !isExcludedProto(obj)) {\n                var keys;\n                try {\n                    keys = getKeys(obj);\n                } catch (e) {\n                    return ret;\n                }\n                for (var i = 0; i < keys.length; ++i) {\n                    var key = keys[i];\n                    if (visitedKeys[key]) continue;\n                    visitedKeys[key] = true;\n                    var desc = Object.getOwnPropertyDescriptor(obj, key);\n                    if (desc != null && desc.get == null && desc.set == null) {\n                        ret.push(key);\n                    }\n                }\n                obj = es5.getPrototypeOf(obj);\n            }\n            return ret;\n        };\n    } else {\n        var hasProp = {}.hasOwnProperty;\n        return function(obj) {\n            if (isExcludedProto(obj)) return [];\n            var ret = [];\n\n            /*jshint forin:false */\n            enumeration: for (var key in obj) {\n                if (hasProp.call(obj, key)) {\n                    ret.push(key);\n                } else {\n                    for (var i = 0; i < excludedPrototypes.length; ++i) {\n                        if (hasProp.call(excludedPrototypes[i], key)) {\n                            continue enumeration;\n                        }\n                    }\n                    ret.push(key);\n                }\n            }\n            return ret;\n        };\n    }\n\n})();\n\nvar thisAssignmentPattern = /this\\s*\\.\\s*\\S+\\s*=/;\nfunction isClass(fn) {\n    try {\n        if (typeof fn === "function") {\n            var keys = es5.names(fn.prototype);\n\n            var hasMethods = es5.isES5 && keys.length > 1;\n            var hasMethodsOtherThanConstructor = keys.length > 0 &&\n                !(keys.length === 1 && keys[0] === "constructor");\n            var hasThisAssignmentAndStaticMethods =\n                thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0;\n\n            if (hasMethods || hasMethodsOtherThanConstructor ||\n                hasThisAssignmentAndStaticMethods) {\n                return true;\n            }\n        }\n        return false;\n    } catch (e) {\n        return false;\n    }\n}\n\nfunction toFastProperties(obj) {\n    /*jshint -W027,-W055,-W031*/\n    function FakeConstructor() {}\n    FakeConstructor.prototype = obj;\n    var l = 8;\n    while (l--) new FakeConstructor();\n    return obj;\n    eval(obj);\n}\n\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\nfunction isIdentifier(str) {\n    return rident.test(str);\n}\n\nfunction filledRange(count, prefix, suffix) {\n    var ret = new Array(count);\n    for(var i = 0; i < count; ++i) {\n        ret[i] = prefix + i + suffix;\n    }\n    return ret;\n}\n\nfunction safeToString(obj) {\n    try {\n        return obj + "";\n    } catch (e) {\n        return "[no string representation]";\n    }\n}\n\nfunction isError(obj) {\n    return obj !== null &&\n           typeof obj === "object" &&\n           typeof obj.message === "string" &&\n           typeof obj.name === "string";\n}\n\nfunction markAsOriginatingFromRejection(e) {\n    try {\n        notEnumerableProp(e, "isOperational", true);\n    }\n    catch(ignore) {}\n}\n\nfunction originatesFromRejection(e) {\n    if (e == null) return false;\n    return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) ||\n        e["isOperational"] === true);\n}\n\nfunction canAttachTrace(obj) {\n    return isError(obj) && es5.propertyIsWritable(obj, "stack");\n}\n\nvar ensureErrorObject = (function() {\n    if (!("stack" in new Error())) {\n        return function(value) {\n            if (canAttachTrace(value)) return value;\n            try {throw new Error(safeToString(value));}\n            catch(err) {return err;}\n        };\n    } else {\n        return function(value) {\n            if (canAttachTrace(value)) return value;\n            return new Error(safeToString(value));\n        };\n    }\n})();\n\nfunction classString(obj) {\n    return {}.toString.call(obj);\n}\n\nfunction copyDescriptors(from, to, filter) {\n    var keys = es5.names(from);\n    for (var i = 0; i < keys.length; ++i) {\n        var key = keys[i];\n        if (filter(key)) {\n            try {\n                es5.defineProperty(to, key, es5.getDescriptor(from, key));\n            } catch (ignore) {}\n        }\n    }\n}\n\nvar asArray = function(v) {\n    if (es5.isArray(v)) {\n        return v;\n    }\n    return null;\n};\n\nif (typeof Symbol !== "undefined" && Symbol.iterator) {\n    var ArrayFrom = typeof Array.from === "function" ? function(v) {\n        return Array.from(v);\n    } : function(v) {\n        var ret = [];\n        var it = v[Symbol.iterator]();\n        var itResult;\n        while (!((itResult = it.next()).done)) {\n            ret.push(itResult.value);\n        }\n        return ret;\n    };\n\n    asArray = function(v) {\n        if (es5.isArray(v)) {\n            return v;\n        } else if (v != null && typeof v[Symbol.iterator] === "function") {\n            return ArrayFrom(v);\n        }\n        return null;\n    };\n}\n\nvar isNode = typeof process !== "undefined" &&\n        classString(process).toLowerCase() === "[object process]";\n\nfunction env(key, def) {\n    return isNode ? __webpack_require__.i({"NODE_ENV":"production","DC_NETWORK":"ropsten","PUBLIC_URL":""})[key] : def;\n}\n\nvar ret = {\n    isClass: isClass,\n    isIdentifier: isIdentifier,\n    inheritedDataKeys: inheritedDataKeys,\n    getDataPropertyOrDefault: getDataPropertyOrDefault,\n    thrower: thrower,\n    isArray: es5.isArray,\n    asArray: asArray,\n    notEnumerableProp: notEnumerableProp,\n    isPrimitive: isPrimitive,\n    isObject: isObject,\n    isError: isError,\n    canEvaluate: canEvaluate,\n    errorObj: errorObj,\n    tryCatch: tryCatch,\n    inherits: inherits,\n    withAppended: withAppended,\n    maybeWrapAsError: maybeWrapAsError,\n    toFastProperties: toFastProperties,\n    filledRange: filledRange,\n    toString: safeToString,\n    canAttachTrace: canAttachTrace,\n    ensureErrorObject: ensureErrorObject,\n    originatesFromRejection: originatesFromRejection,\n    markAsOriginatingFromRejection: markAsOriginatingFromRejection,\n    classString: classString,\n    copyDescriptors: copyDescriptors,\n    hasDevTools: typeof chrome !== "undefined" && chrome &&\n                 typeof chrome.loadTimes === "function",\n    isNode: isNode,\n    env: env,\n    global: globalObject\n};\nret.isRecentNode = ret.isNode && (function() {\n    var version = process.versions.node.split(".").map(Number);\n    return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\n})();\n\nif (ret.isNode) ret.toFastProperties(process);\n\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\nmodule.exports = ret;\n\n},{"./es5":13}]},{},[4])(4)\n});                    ;if (typeof window !== \'undefined\' && window !== null) {                               window.P = window.Promise;                                                     } else if (typeof self !== \'undefined\' && self !== null) {                             self.P = self.Promise;                                                         }\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(2), __webpack_require__(25).setImmediate))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/bluebird/js/browser/bluebird.js\n// module id = 1283\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/bluebird/js/browser/bluebird.js')},function(module,exports){eval("var generate = function generate(num, fn) {\n  var a = [];\n  for (var i = 0; i < num; ++i) {\n    a.push(fn(i));\n  }return a;\n};\n\nvar replicate = function replicate(num, val) {\n  return generate(num, function () {\n    return val;\n  });\n};\n\nvar concat = function concat(a, b) {\n  return a.concat(b);\n};\n\nvar flatten = function flatten(a) {\n  var r = [];\n  for (var j = 0, J = a.length; j < J; ++j) {\n    for (var i = 0, I = a[j].length; i < I; ++i) {\n      r.push(a[j][i]);\n    }\n  }return r;\n};\n\nvar chunksOf = function chunksOf(n, a) {\n  var b = [];\n  for (var i = 0, l = a.length; i < l; i += n) {\n    b.push(a.slice(i, i + n));\n  }return b;\n};\n\nmodule.exports = {\n  generate: generate,\n  replicate: replicate,\n  concat: concat,\n  flatten: flatten,\n  chunksOf: chunksOf\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/eth-lib/lib/array.js\n// module id = 1284\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/array.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(global) {\nvar rng;\n\nif (global.crypto && crypto.getRandomValues) {\n  // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n  // Moderately fast, high quality\n  var _rnds8 = new Uint8Array(16);\n  rng = function whatwgRNG() {\n    crypto.getRandomValues(_rnds8);\n    return _rnds8;\n  };\n}\n\nif (!rng) {\n  // Math.random()-based (RNG)\n  //\n  // If all else fails, use Math.random().  It's fast, but is of unspecified\n  // quality.\n  var  _rnds = new Array(16);\n  rng = function() {\n    for (var i = 0, r; i < 16; i++) {\n      if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n      _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n    }\n\n    return _rnds;\n  };\n}\n\nmodule.exports = rng;\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/uuid/rng-browser.js\n// module id = 1285\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/uuid/rng-browser.js")},function(module,exports,__webpack_require__){eval("//     uuid.js\n//\n//     Copyright (c) 2010-2012 Robert Kieffer\n//     MIT License - http://opensource.org/licenses/mit-license.php\n\n// Unique ID creation requires a high quality random # generator.  We feature\n// detect to determine the best RNG source, normalizing to a function that\n// returns 128-bits of randomness, since that's what's usually required\nvar _rng = __webpack_require__(1285);\n\n// Maps for number <-> hex string conversion\nvar _byteToHex = [];\nvar _hexToByte = {};\nfor (var i = 0; i < 256; i++) {\n  _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n  _hexToByte[_byteToHex[i]] = i;\n}\n\n// **`parse()` - Parse a UUID into it's component bytes**\nfunction parse(s, buf, offset) {\n  var i = (buf && offset) || 0, ii = 0;\n\n  buf = buf || [];\n  s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {\n    if (ii < 16) { // Don't overflow!\n      buf[i + ii++] = _hexToByte[oct];\n    }\n  });\n\n  // Zero out remaining bytes if string was short\n  while (ii < 16) {\n    buf[i + ii++] = 0;\n  }\n\n  return buf;\n}\n\n// **`unparse()` - Convert UUID byte array (ala parse()) into a string**\nfunction unparse(buf, offset) {\n  var i = offset || 0, bth = _byteToHex;\n  return  bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] + '-' +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]] +\n          bth[buf[i++]] + bth[buf[i++]];\n}\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\n// random #'s we need to init node and clockseq\nvar _seedBytes = _rng();\n\n// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\nvar _nodeId = [\n  _seedBytes[0] | 0x01,\n  _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\n];\n\n// Per 4.2.2, randomize (14 bit) clockseq\nvar _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\n\n// Previous uuid creation time\nvar _lastMSecs = 0, _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n  var i = buf && offset || 0;\n  var b = buf || [];\n\n  options = options || {};\n\n  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n  // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n  // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so\n  // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n  // Per 4.2.1.2, use count of uuid's generated during the current clock\n  // cycle to simulate higher resolution clock\n  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n  // Time since last uuid creation (in msecs)\n  var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n  // Per 4.2.1.2, Bump clockseq on clock regression\n  if (dt < 0 && options.clockseq === undefined) {\n    clockseq = clockseq + 1 & 0x3fff;\n  }\n\n  // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n  // time interval\n  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n    nsecs = 0;\n  }\n\n  // Per 4.2.1.2 Throw error if too many uuids are requested\n  if (nsecs >= 10000) {\n    throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n  }\n\n  _lastMSecs = msecs;\n  _lastNSecs = nsecs;\n  _clockseq = clockseq;\n\n  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n  msecs += 12219292800000;\n\n  // `time_low`\n  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n  b[i++] = tl >>> 24 & 0xff;\n  b[i++] = tl >>> 16 & 0xff;\n  b[i++] = tl >>> 8 & 0xff;\n  b[i++] = tl & 0xff;\n\n  // `time_mid`\n  var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n  b[i++] = tmh >>> 8 & 0xff;\n  b[i++] = tmh & 0xff;\n\n  // `time_high_and_version`\n  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n  b[i++] = tmh >>> 16 & 0xff;\n\n  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n  b[i++] = clockseq >>> 8 | 0x80;\n\n  // `clock_seq_low`\n  b[i++] = clockseq & 0xff;\n\n  // `node`\n  var node = options.node || _nodeId;\n  for (var n = 0; n < 6; n++) {\n    b[i + n] = node[n];\n  }\n\n  return buf ? buf : unparse(b);\n}\n\n// **`v4()` - Generate random UUID**\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v4(options, buf, offset) {\n  // Deprecated - 'format' argument, as supported in v1.2\n  var i = buf && offset || 0;\n\n  if (typeof(options) == 'string') {\n    buf = options == 'binary' ? new Array(16) : null;\n    options = null;\n  }\n  options = options || {};\n\n  var rnds = options.random || (options.rng || _rng)();\n\n  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n  rnds[6] = (rnds[6] & 0x0f) | 0x40;\n  rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n  // Copy bytes to buffer, if provided\n  if (buf) {\n    for (var ii = 0; ii < 16; ii++) {\n      buf[i + ii] = rnds[ii];\n    }\n  }\n\n  return buf || unparse(rnds);\n}\n\n// Export public API\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\nuuid.parse = parse;\nuuid.unparse = unparse;\n\nmodule.exports = uuid;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/~/uuid/uuid.js\n// module id = 1286\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/uuid/uuid.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file accounts.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(106);\nvar Method = __webpack_require__(105);\nvar Promise = __webpack_require__(1283);\nvar Account = __webpack_require__(314);\nvar Hash = __webpack_require__(556);\nvar RLP = __webpack_require__(558);\nvar Nat = __webpack_require__(557);\nvar Bytes = __webpack_require__(315);\nvar cryp = (typeof global === 'undefined') ? __webpack_require__(60) : __webpack_require__(60);\nvar scryptsy = __webpack_require__(530);\nvar uuid = __webpack_require__(1286);\nvar utils = __webpack_require__(47);\nvar helpers = __webpack_require__(35);\n\nvar isNot = function(value) {\n    return (_.isUndefined(value) || _.isNull(value));\n};\n\nvar trimLeadingZero = function (hex) {\n    while (hex && hex.startsWith('0x0')) {\n        hex = '0x' + hex.slice(3);\n    }\n    return hex;\n};\n\nvar makeEven = function (hex) {\n    if(hex.length % 2 === 1) {\n        hex = hex.replace('0x', '0x0');\n    }\n    return hex;\n};\n\n\nvar Accounts = function Accounts() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // remove unecessary core functions\n    delete this.BatchRequest;\n    delete this.extend;\n\n    var _ethereumCall = [\n        new Method({\n            name: 'getId',\n            call: 'net_version',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getGasPrice',\n            call: 'eth_gasPrice',\n            params: 0\n        }),\n        new Method({\n            name: 'getTransactionCount',\n            call: 'eth_getTransactionCount',\n            params: 2,\n            inputFormatter: [function (address) {\n                if (utils.isAddress(address)) {\n                    return address;\n                } else {\n                    throw new Error('Address '+ address +' is not a valid address to get the \"transactionCount\".');\n                }\n            }, function () { return 'latest'; }]\n        })\n    ];\n    // attach methods to this._ethereumCall\n    this._ethereumCall = {};\n    _.each(_ethereumCall, function (method) {\n        method.attachToObject(_this._ethereumCall);\n        method.setRequestManager(_this._requestManager);\n    });\n\n\n    this.wallet = new Wallet(this);\n};\n\nAccounts.prototype._addAccountFunctions = function (account) {\n    var _this = this;\n\n    // add sign functions\n    account.signTransaction = function signTransaction(tx, callback) {\n        return _this.signTransaction(tx, account.privateKey, callback);\n    };\n    account.sign = function sign(data) {\n        return _this.sign(data, account.privateKey);\n    };\n\n    account.encrypt = function encrypt(password, options) {\n        return _this.encrypt(account.privateKey, password, options);\n    };\n\n\n    return account;\n};\n\nAccounts.prototype.create = function create(entropy) {\n    return this._addAccountFunctions(Account.create(entropy || utils.randomHex(32)));\n};\n\nAccounts.prototype.privateKeyToAccount = function privateKeyToAccount(privateKey) {\n    return this._addAccountFunctions(Account.fromPrivate(privateKey));\n};\n\nAccounts.prototype.signTransaction = function signTransaction(tx, privateKey, callback) {\n    var _this = this,\n        error = false,\n        result;\n\n    callback = callback || function () {};\n\n    if (!tx) {\n        error = new Error('No transaction object given!');\n\n        callback(error);\n        return Promise.reject(error);\n    }\n\n    function signed (tx) {\n\n        if (!tx.gas && !tx.gasLimit) {\n            error = new Error('\"gas\" is missing');\n        }\n\n        if (tx.nonce  < 0 ||\n            tx.gas  < 0 ||\n            tx.gasPrice  < 0 ||\n            tx.chainId  < 0) {\n            error = new Error('Gas, gasPrice, nonce or chainId is lower than 0');\n        }\n\n        if (error) {\n            callback(error);\n            return Promise.reject(new Error('\"gas\" is missing'));\n        }\n\n        try {\n            tx = helpers.formatters.inputCallFormatter(tx);\n\n            var transaction = tx;\n            transaction.to = tx.to || '0x';\n            transaction.data = tx.data || '0x';\n            transaction.value = tx.value || '0x';\n            transaction.chainId = utils.numberToHex(tx.chainId);\n\n            var rlpEncoded = RLP.encode([\n                Bytes.fromNat(transaction.nonce),\n                Bytes.fromNat(transaction.gasPrice),\n                Bytes.fromNat(transaction.gas),\n                transaction.to.toLowerCase(),\n                Bytes.fromNat(transaction.value),\n                transaction.data,\n                Bytes.fromNat(transaction.chainId || \"0x1\"),\n                \"0x\",\n                \"0x\"]);\n\n\n            var hash = Hash.keccak256(rlpEncoded);\n\n            var signature = Account.makeSigner(Nat.toNumber(transaction.chainId || \"0x1\") * 2 + 35)(Hash.keccak256(rlpEncoded), privateKey);\n\n            var rawTx = RLP.decode(rlpEncoded).slice(0, 6).concat(Account.decodeSignature(signature));\n\n            rawTx[6] = makeEven(trimLeadingZero(rawTx[6]));\n            rawTx[7] = makeEven(trimLeadingZero(rawTx[7]));\n            rawTx[8] = makeEven(trimLeadingZero(rawTx[8]));\n\n            var rawTransaction = RLP.encode(rawTx);\n\n            var values = RLP.decode(rawTransaction);\n            result = {\n                messageHash: hash,\n                v: trimLeadingZero(values[6]),\n                r: trimLeadingZero(values[7]),\n                s: trimLeadingZero(values[8]),\n                rawTransaction: rawTransaction\n            };\n\n        } catch(e) {\n            callback(e);\n            return Promise.reject(e);\n        }\n\n        callback(null, result);\n        return result;\n    }\n\n    // Resolve immediately if nonce, chainId and price are provided\n    if (tx.nonce !== undefined && tx.chainId !== undefined && tx.gasPrice !== undefined) {\n        return Promise.resolve(signed(tx));\n    }\n\n\n    // Otherwise, get the missing info from the Ethereum Node\n    return Promise.all([\n        isNot(tx.chainId) ? _this._ethereumCall.getId() : tx.chainId,\n        isNot(tx.gasPrice) ? _this._ethereumCall.getGasPrice() : tx.gasPrice,\n        isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(_this.privateKeyToAccount(privateKey).address) : tx.nonce\n    ]).then(function (args) {\n        if (isNot(args[0]) || isNot(args[1]) || isNot(args[2])) {\n            throw new Error('One of the values \"chainId\", \"gasPrice\", or \"nonce\" couldn\\'t be fetched: '+ JSON.stringify(args));\n        }\n        return signed(_.extend(tx, {chainId: args[0], gasPrice: args[1], nonce: args[2]}));\n    });\n};\n\n/* jshint ignore:start */\nAccounts.prototype.recoverTransaction = function recoverTransaction(rawTx) {\n    var values = RLP.decode(rawTx);\n    var signature = Account.encodeSignature(values.slice(6,9));\n    var recovery = Bytes.toNumber(values[6]);\n    var extraData = recovery < 35 ? [] : [Bytes.fromNumber((recovery - 35) >> 1), \"0x\", \"0x\"];\n    var signingData = values.slice(0,6).concat(extraData);\n    var signingDataHex = RLP.encode(signingData);\n    return Account.recover(Hash.keccak256(signingDataHex), signature);\n};\n/* jshint ignore:end */\n\nAccounts.prototype.hashMessage = function hashMessage(data) {\n    var message = utils.isHexStrict(data) ? utils.hexToUtf8(data) : data;\n    var ethMessage = \"\\x19Ethereum Signed Message:\\n\" + message.length + message;\n    return Hash.keccak256s(ethMessage);\n};\n\nAccounts.prototype.sign = function sign(data, privateKey) {\n\n    var hash = this.hashMessage(data);\n    var signature = Account.sign(hash, privateKey);\n    var vrs = Account.decodeSignature(signature);\n    return {\n        message: data,\n        messageHash: hash,\n        v: vrs[0],\n        r: vrs[1],\n        s: vrs[2],\n        signature: signature\n    };\n};\n\nAccounts.prototype.recover = function recover(hash, signature) {\n\n    if (_.isObject(hash)) {\n        return this.recover(hash.messageHash, Account.encodeSignature([hash.v, hash.r, hash.s]));\n    }\n\n    if (!utils.isHexStrict(hash)) {\n        hash = this.hashMessage(hash);\n    }\n\n    if (arguments.length === 4) {\n        return this.recover(hash, Account.encodeSignature([].slice.call(arguments, 1, 4))); // v, r, s\n    }\n    return Account.recover(hash, signature);\n};\n\n// Taken from https://github.com/ethereumjs/ethereumjs-wallet\nAccounts.prototype.decrypt = function (v3Keystore, password, nonStrict) {\n    /* jshint maxcomplexity: 10 */\n\n    if(!_.isString(password)) {\n        throw new Error('No password given.');\n    }\n\n    var json = (_.isObject(v3Keystore)) ? v3Keystore : JSON.parse(nonStrict ? v3Keystore.toLowerCase() : v3Keystore);\n\n    if (json.version !== 3) {\n        throw new Error('Not a valid V3 wallet');\n    }\n\n    var derivedKey;\n    var kdfparams;\n    if (json.crypto.kdf === 'scrypt') {\n        kdfparams = json.crypto.kdfparams;\n\n        // FIXME: support progress reporting callback\n        derivedKey = scryptsy(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\n    } else if (json.crypto.kdf === 'pbkdf2') {\n        kdfparams = json.crypto.kdfparams;\n\n        if (kdfparams.prf !== 'hmac-sha256') {\n            throw new Error('Unsupported parameters to PBKDF2');\n        }\n\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, 'hex'), kdfparams.c, kdfparams.dklen, 'sha256');\n    } else {\n        throw new Error('Unsupported key derivation scheme');\n    }\n\n    var ciphertext = new Buffer(json.crypto.ciphertext, 'hex');\n\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), ciphertext ])).replace('0x','');\n    if (mac !== json.crypto.mac) {\n        throw new Error('Key derivation failed - possibly wrong password');\n    }\n\n    var decipher = cryp.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, 'hex'));\n    var seed = '0x'+ Buffer.concat([ decipher.update(ciphertext), decipher.final() ]).toString('hex');\n\n    return this.privateKeyToAccount(seed);\n};\n\nAccounts.prototype.encrypt = function (privateKey, password, options) {\n    /* jshint maxcomplexity: 20 */\n    var account = this.privateKeyToAccount(privateKey);\n\n    options = options || {};\n    var salt = options.salt || cryp.randomBytes(32);\n    var iv = options.iv || cryp.randomBytes(16);\n\n    var derivedKey;\n    var kdf = options.kdf || 'scrypt';\n    var kdfparams = {\n        dklen: options.dklen || 32,\n        salt: salt.toString('hex')\n    };\n\n    if (kdf === 'pbkdf2') {\n        kdfparams.c = options.c || 262144;\n        kdfparams.prf = 'hmac-sha256';\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, 'sha256');\n    } else if (kdf === 'scrypt') {\n        // FIXME: support progress reporting callback\n        kdfparams.n = options.n || 8192; // 2048 4096 8192 16384\n        kdfparams.r = options.r || 8;\n        kdfparams.p = options.p || 1;\n        derivedKey = scryptsy(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\n    } else {\n        throw new Error('Unsupported kdf');\n    }\n\n    var cipher = cryp.createCipheriv(options.cipher || 'aes-128-ctr', derivedKey.slice(0, 16), iv);\n    if (!cipher) {\n        throw new Error('Unsupported cipher');\n    }\n\n    var ciphertext = Buffer.concat([ cipher.update(new Buffer(account.privateKey.replace('0x',''), 'hex')), cipher.final() ]);\n\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), new Buffer(ciphertext, 'hex') ])).replace('0x','');\n\n    return {\n        version: 3,\n        id: uuid.v4({ random: options.uuid || cryp.randomBytes(16) }),\n        address: account.address.toLowerCase().replace('0x',''),\n        crypto: {\n            ciphertext: ciphertext.toString('hex'),\n            cipherparams: {\n                iv: iv.toString('hex')\n            },\n            cipher: options.cipher || 'aes-128-ctr',\n            kdf: kdf,\n            kdfparams: kdfparams,\n            mac: mac.toString('hex')\n        }\n    };\n};\n\n\n// Note: this is trying to follow closely the specs on\n// http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html\n\nfunction Wallet(accounts) {\n    this._accounts = accounts;\n    this.length = 0;\n    this.defaultKeyName = \"web3js_wallet\";\n}\n\nWallet.prototype._findSafeIndex = function (pointer) {\n    pointer = pointer || 0;\n    if (_.has(this, pointer)) {\n        return this._findSafeIndex(pointer + 1);\n    } else {\n        return pointer;\n    }\n};\n\nWallet.prototype._currentIndexes = function () {\n    var keys = Object.keys(this);\n    var indexes = keys\n        .map(function(key) { return parseInt(key); })\n        .filter(function(n) { return (n < 9e20); });\n\n    return indexes;\n};\n\nWallet.prototype.create = function (numberOfAccounts, entropy) {\n    for (var i = 0; i < numberOfAccounts; ++i) {\n        this.add(this._accounts.create(entropy).privateKey);\n    }\n    return this;\n};\n\nWallet.prototype.add = function (account) {\n\n    if (_.isString(account)) {\n        account = this._accounts.privateKeyToAccount(account);\n    }\n    if (!this[account.address]) {\n        account = this._accounts.privateKeyToAccount(account.privateKey);\n        account.index = this._findSafeIndex();\n\n        this[account.index] = account;\n        this[account.address] = account;\n        this[account.address.toLowerCase()] = account;\n\n        this.length++;\n\n        return account;\n    } else {\n        return this[account.address];\n    }\n};\n\nWallet.prototype.remove = function (addressOrIndex) {\n    var account = this[addressOrIndex];\n\n    if (account && account.address) {\n        // address\n        this[account.address].privateKey = null;\n        delete this[account.address];\n        // address lowercase\n        this[account.address.toLowerCase()].privateKey = null;\n        delete this[account.address.toLowerCase()];\n        // index\n        this[account.index].privateKey = null;\n        delete this[account.index];\n\n        this.length--;\n\n        return true;\n    } else {\n        return false;\n    }\n};\n\nWallet.prototype.clear = function () {\n    var _this = this;\n    var indexes = this._currentIndexes();\n\n    indexes.forEach(function(index) {\n        _this.remove(index);\n    });\n\n    return this;\n};\n\nWallet.prototype.encrypt = function (password, options) {\n    var _this = this;\n    var indexes = this._currentIndexes();\n\n    var accounts = indexes.map(function(index) {\n        return _this[index].encrypt(password, options);\n    });\n\n    return accounts;\n};\n\n\nWallet.prototype.decrypt = function (encryptedWallet, password) {\n    var _this = this;\n\n    encryptedWallet.forEach(function (keystore) {\n        var account = _this._accounts.decrypt(keystore, password);\n\n        if (account) {\n            _this.add(account);\n        } else {\n            throw new Error('Couldn\\'t decrypt accounts. Password wrong?');\n        }\n    });\n\n    return this;\n};\n\nWallet.prototype.save = function (password, keyName) {\n    localStorage.setItem(keyName || this.defaultKeyName, JSON.stringify(this.encrypt(password)));\n\n    return true;\n};\n\nWallet.prototype.load = function (password, keyName) {\n    var keystore = localStorage.getItem(keyName || this.defaultKeyName);\n\n    if (keystore) {\n        try {\n            keystore = JSON.parse(keystore);\n        } catch(e) {\n\n        }\n    }\n\n    return this.decrypt(keystore || [], password);\n};\n\nif (typeof localStorage === 'undefined') {\n    delete Wallet.prototype.save;\n    delete Wallet.prototype.load;\n}\n\n\nmodule.exports = Accounts;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-accounts/src/index.js\n// module id = 1287\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-accounts/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file contract.js\n *\n * To initialize a contract use:\n *\n *  var Contract = require('web3-eth-contract');\n *  Contract.setProvider('ws://localhost:8546');\n *  var contract = new Contract(abi, address, ...);\n *\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(106);\nvar Method = __webpack_require__(105);\nvar utils = __webpack_require__(47);\nvar Subscription = __webpack_require__(210).subscription;\nvar formatters = __webpack_require__(35).formatters;\nvar errors = __webpack_require__(35).errors;\nvar promiEvent = __webpack_require__(552);\nvar abi = __webpack_require__(554);\n\n\n/**\n * Should be called to create new contract instance\n *\n * @method Contract\n * @constructor\n * @param {Array} jsonInterface\n * @param {String} address\n * @param {Object} options\n */\nvar Contract = function Contract(jsonInterface, address, options) {\n    var _this = this,\n        args = Array.prototype.slice.call(arguments);\n\n    if(!(this instanceof Contract)) {\n        throw new Error('Please use the \"new\" keyword to instantiate a web3.eth.contract() object!');\n    }\n\n    // sets _requestmanager\n    core.packageInit(this, [this.constructor.currentProvider]);\n\n    this.clearSubscriptions = this._requestManager.clearSubscriptions;\n\n\n\n    if(!jsonInterface || !(Array.isArray(jsonInterface))) {\n        throw new Error('You must provide the json interface of the contract when instantiating a contract object.');\n    }\n\n\n\n    // create the options object\n    this.options = {};\n\n    var lastArg = args[args.length - 1];\n    if(_.isObject(lastArg) && !_.isArray(lastArg)) {\n        options = lastArg;\n\n        this.options = _.extend(this.options, this._getOrSetDefaultOptions(options));\n        if(_.isObject(address)) {\n            address = null;\n        }\n    }\n\n    // set address\n    Object.defineProperty(this.options, 'address', {\n        set: function(value){\n            if(value) {\n                _this._address = utils.toChecksumAddress(formatters.inputAddressFormatter(value));\n            }\n        },\n        get: function(){\n            return _this._address;\n        },\n        enumerable: true\n    });\n\n    // add method and event signatures, when the jsonInterface gets set\n    Object.defineProperty(this.options, 'jsonInterface', {\n        set: function(value){\n            _this.methods = {};\n            _this.events = {};\n\n            _this._jsonInterface = value.map(function(method) {\n                var func,\n                    funcName;\n\n                if (method.name) {\n                    funcName = utils._jsonInterfaceMethodToString(method);\n                }\n\n\n                // function\n                if (method.type === 'function') {\n                    method.signature = abi.encodeFunctionSignature(funcName);\n                    func = _this._createTxObject.bind({\n                        method: method,\n                        parent: _this\n                    });\n\n\n                    // add method only if not one already exists\n                    if(!_this.methods[method.name]) {\n                        _this.methods[method.name] = func;\n                    } else {\n                        var cascadeFunc = _this._createTxObject.bind({\n                            method: method,\n                            parent: _this,\n                            nextMethod: _this.methods[method.name]\n                        });\n                        _this.methods[method.name] = cascadeFunc;\n                    }\n\n                    // definitely add the method based on its signature\n                    _this.methods[method.signature] = func;\n\n                    // add method by name\n                    _this.methods[funcName] = func;\n\n\n                // event\n                } else if (method.type === 'event') {\n                    method.signature = abi.encodeEventSignature(funcName);\n                    var event = _this._on.bind(_this, method.signature);\n\n                    // add method only if not already exists\n                    if(!_this.events[method.name] || _this.events[method.name].name === 'bound ')\n                        _this.events[method.name] = event;\n\n                    // definitely add the method based on its signature\n                    _this.events[method.signature] = event;\n\n                    // add event by name\n                    _this.events[funcName] = event;\n                }\n\n\n                return method;\n            });\n\n            // add allEvents\n            _this.events.allEvents = _this._on.bind(_this, 'allevents');\n\n            return _this._jsonInterface;\n        },\n        get: function(){\n            return _this._jsonInterface;\n        },\n        enumerable: true\n    });\n\n    // get default account from the Class\n    var defaultAccount = this.constructor.defaultAccount;\n    var defaultBlock = this.constructor.defaultBlock || 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\n            }\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n\n            return val;\n        },\n        enumerable: true\n    });\n\n    // properties\n    this.methods = {};\n    this.events = {};\n\n    this._address = null;\n    this._jsonInterface = [];\n\n    // set getter/setter properties\n    this.options.address = address;\n    this.options.jsonInterface = jsonInterface;\n\n};\n\nContract.setProvider = function(provider, accounts) {\n    // Contract.currentProvider = provider;\n    core.packageInit(this, [provider]);\n\n    this._ethAccounts = accounts;\n};\n\n\n/**\n * Get the callback and modiufy the array if necessary\n *\n * @method _getCallback\n * @param {Array} args\n * @return {Function} the callback\n */\nContract.prototype._getCallback = function getCallback(args) {\n    if (args && _.isFunction(args[args.length - 1])) {\n        return args.pop(); // modify the args array!\n    }\n};\n\n/**\n * Checks that no listener with name \"newListener\" or \"removeListener\" is added.\n *\n * @method _checkListener\n * @param {String} type\n * @param {String} event\n * @return {Object} the contract instance\n */\nContract.prototype._checkListener = function(type, event){\n    if(event === type) {\n        throw new Error('The event \"'+ type +'\" is a reserved event name, you can\\'t use it.');\n    }\n};\n\n\n/**\n * Use default values, if options are not available\n *\n * @method _getOrSetDefaultOptions\n * @param {Object} options the options gived by the user\n * @return {Object} the options with gaps filled by defaults\n */\nContract.prototype._getOrSetDefaultOptions = function getOrSetDefaultOptions(options) {\n    var gasPrice = options.gasPrice ? String(options.gasPrice): null;\n    var from = options.from ? utils.toChecksumAddress(formatters.inputAddressFormatter(options.from)) : null;\n\n    options.data = options.data || this.options.data;\n\n    options.from = from || this.options.from;\n    options.gasPrice = gasPrice || this.options.gasPrice;\n    options.gas = options.gas || options.gasLimit || this.options.gas;\n\n    // TODO replace with only gasLimit?\n    delete options.gasLimit;\n\n    return options;\n};\n\n\n/**\n * Should be used to encode indexed params and options to one final object\n *\n * @method _encodeEventABI\n * @param {Object} event\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nContract.prototype._encodeEventABI = function (event, options) {\n    options = options || {};\n    var filter = options.filter || {},\n        result = {};\n\n    ['fromBlock', 'toBlock'].filter(function (f) {\n        return options[f] !== undefined;\n    }).forEach(function (f) {\n        result[f] = formatters.inputBlockNumberFormatter(options[f]);\n    });\n\n    // use given topics\n    if(_.isArray(options.topics)) {\n        result.topics = options.topics;\n\n    // create topics based on filter\n    } else {\n\n        result.topics = [];\n\n        // add event signature\n        if (event && !event.anonymous && event.name !== 'ALLEVENTS') {\n            result.topics.push(event.signature);\n        }\n\n        // add event topics (indexed arguments)\n        if (event.name !== 'ALLEVENTS') {\n            var indexedTopics = event.inputs.filter(function (i) {\n                return i.indexed === true;\n            }).map(function (i) {\n                var value = filter[i.name];\n                if (!value) {\n                    return null;\n                }\n\n                // TODO: https://github.com/ethereum/web3.js/issues/344\n\n                if (_.isArray(value)) {\n                    return value.map(function (v) {\n                        return abi.encodeParameter(i.type, v);\n                    });\n                }\n                return abi.encodeParameter(i.type, value);\n            });\n\n            result.topics = result.topics.concat(indexedTopics);\n        }\n\n        if(!result.topics.length)\n            delete result.topics;\n    }\n\n    if(this.options.address) {\n        result.address = this.options.address.toLowerCase();\n    }\n\n    return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method _decodeEventABI\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nContract.prototype._decodeEventABI = function (data) {\n    var event = this;\n\n    data.data = data.data || '';\n    data.topics = data.topics || [];\n    var result = formatters.outputLogFormatter(data);\n\n    // if allEvents get the right event\n    if(event.name === 'ALLEVENTS') {\n        event = event.jsonInterface.find(function (intf) {\n            return (intf.signature === data.topics[0]);\n        }) || {anonymous: true};\n    }\n\n    // create empty inputs if none are present (e.g. anonymous events on allEvents)\n    event.inputs = event.inputs || [];\n\n\n    var argTopics = event.anonymous ? data.topics : data.topics.slice(1);\n\n    result.returnValues = abi.decodeLog(event.inputs, data.data, argTopics);\n    delete result.returnValues.__length__;\n\n    // add name\n    result.event = event.name;\n\n    // add signature\n    result.signature = (event.anonymous || !data.topics[0]) ? null : data.topics[0];\n\n    // move the data and topics to \"raw\"\n    result.raw = {\n        data: result.data,\n        topics: result.topics\n    };\n    delete result.data;\n    delete result.topics;\n\n\n    return result;\n};\n\n/**\n * Encodes an ABI for a method, including signature or the method.\n * Or when constructor encodes only the constructor parameters.\n *\n * @method _encodeMethodABI\n * @param {Mixed} args the arguments to encode\n * @param {String} the encoded ABI\n */\nContract.prototype._encodeMethodABI = function _encodeMethodABI() {\n    var methodSignature = this._method.signature,\n        args = this.arguments || [];\n\n    var signature = false,\n        paramsABI = this._parent.options.jsonInterface.filter(function (json) {\n            return ((methodSignature === 'constructor' && json.type === methodSignature) ||\n                ((json.signature === methodSignature || json.signature === methodSignature.replace('0x','') || json.name === methodSignature) && json.type === 'function'));\n        }).map(function (json) {\n            var inputLength = (_.isArray(json.inputs)) ? json.inputs.length : 0;\n\n            if (inputLength !== args.length) {\n                throw new Error('The number of arguments is not matching the methods required number. You need to pass '+ inputLength +' arguments.');\n            }\n\n            if (json.type === 'function') {\n                signature = json.signature;\n            }\n            return _.isArray(json.inputs) ? json.inputs.map(function (input) { return input.type; }) : [];\n        }).map(function (types) {\n            return abi.encodeParameters(types, args).replace('0x','');\n        })[0] || '';\n\n    // return constructor\n    if(methodSignature === 'constructor') {\n        if(!this._deployData)\n            throw new Error('The contract has no contract data option set. This is necessary to append the constructor parameters.');\n\n        return this._deployData + paramsABI;\n\n    // return method\n    } else {\n\n        var returnValue = (signature) ? signature + paramsABI : paramsABI;\n\n        if(!returnValue) {\n            throw new Error('Couldn\\'t find a matching contract method named \"'+ this._method.name +'\".');\n        } else {\n            return returnValue;\n        }\n    }\n\n};\n\n\n/**\n * Decode method return values\n *\n * @method _decodeMethodReturn\n * @param {Array} outputs\n * @param {String} returnValues\n * @return {Object} decoded output return values\n */\nContract.prototype._decodeMethodReturn = function (outputs, returnValues) {\n    if (!returnValues) {\n        return null;\n    }\n\n    returnValues = returnValues.length >= 2 ? returnValues.slice(2) : returnValues;\n    var result = abi.decodeParameters(outputs, returnValues);\n\n    if (result.__length__ === 1) {\n        return result[0];\n    } else {\n        delete result.__length__;\n        return result;\n    }\n};\n\n\n/**\n * Deploys a contract and fire events based on its state: transactionHash, receipt\n *\n * All event listeners will be removed, once the last possible event is fired (\"error\", or \"receipt\")\n *\n * @method deploy\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} EventEmitter possible events are \"error\", \"transactionHash\" and \"receipt\"\n */\nContract.prototype.deploy = function(options, callback){\n\n    options = options || {};\n\n    options.arguments = options.arguments || [];\n    options = this._getOrSetDefaultOptions(options);\n\n\n    // return error, if no \"data\" is specified\n    if(!options.data) {\n        return utils._fireError(new Error('No \"data\" specified in neither the given options, nor the default options.'), null, null, callback);\n    }\n\n    var constructor = _.find(this.options.jsonInterface, function (method) {\n        return (method.type === 'constructor');\n    }) || {};\n    constructor.signature = 'constructor';\n\n    return this._createTxObject.apply({\n        method: constructor,\n        parent: this,\n        deployData: options.data,\n        _ethAccounts: this.constructor._ethAccounts\n    }, options.arguments);\n\n};\n\n/**\n * Gets the event signature and outputformatters\n *\n * @method _generateEventOptions\n * @param {Object} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event options object\n */\nContract.prototype._generateEventOptions = function() {\n    var args = Array.prototype.slice.call(arguments);\n\n    // get the callback\n    var callback = this._getCallback(args);\n\n    // get the options\n    var options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\n\n    var event = (_.isString(args[0])) ? args[0] : 'allevents';\n    event = (event.toLowerCase() === 'allevents') ? {\n            name: 'ALLEVENTS',\n            jsonInterface: this.options.jsonInterface\n        } : this.options.jsonInterface.find(function (json) {\n            return (json.type === 'event' && (json.name === event || json.signature === '0x'+ event.replace('0x','')));\n        });\n\n    if (!event) {\n        throw new Error('Event \"' + event.name + '\" doesn\\'t exist in this contract.');\n    }\n\n    if (!utils.isAddress(this.options.address)) {\n        throw new Error('This contract object doesn\\'t have address set yet, please set an address first.');\n    }\n\n    return {\n        params: this._encodeEventABI(event, options),\n        event: event,\n        callback: callback\n    };\n};\n\n/**\n * Adds event listeners and creates a subscription, and remove it once its fired.\n *\n * @method clone\n * @return {Object} the event subscription\n */\nContract.prototype.clone = function() {\n    return new this.constructor(this.options.jsonInterface, this.options.address, this.options);\n};\n\n\n/**\n * Adds event listeners and creates a subscription, and remove it once its fired.\n *\n * @method once\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event subscription\n */\nContract.prototype.once = function(event, options, callback) {\n    var args = Array.prototype.slice.call(arguments);\n\n    // get the callback\n    callback = this._getCallback(args);\n\n    if (!callback) {\n        throw new Error('Once requires a callback as the second parameter.');\n    }\n\n    // don't allow fromBlock\n    if (options)\n        delete options.fromBlock;\n\n    // don't return as once shouldn't provide \"on\"\n    this._on(event, options, function (err, res, sub) {\n        sub.unsubscribe();\n        if(_.isFunction(callback)){\n            callback(err, res, sub);\n        }\n    });\n\n    return undefined;\n};\n\n/**\n * Adds event listeners and creates a subscription.\n *\n * @method _on\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the event subscription\n */\nContract.prototype._on = function(){\n    var subOptions = this._generateEventOptions.apply(this, arguments);\n\n\n    // prevent the event \"newListener\" and \"removeListener\" from being overwritten\n    this._checkListener('newListener', subOptions.event.name, subOptions.callback);\n    this._checkListener('removeListener', subOptions.event.name, subOptions.callback);\n\n    // TODO check if listener already exists? and reuse subscription if options are the same.\n\n    // create new subscription\n    var subscription = new Subscription({\n        subscription: {\n            params: 1,\n            inputFormatter: [formatters.inputLogFormatter],\n            outputFormatter: this._decodeEventABI.bind(subOptions.event),\n            // DUBLICATE, also in web3-eth\n            subscriptionHandler: function (output) {\n                if(output.removed) {\n                    this.emit('changed', output);\n                } else {\n                    this.emit('data', output);\n                }\n\n                if (_.isFunction(this.callback)) {\n                    this.callback(null, output, this);\n                }\n            }\n        },\n        type: 'eth',\n        requestManager: this._requestManager\n    });\n    subscription.subscribe('logs', subOptions.params, subOptions.callback || function () {});\n\n    return subscription;\n};\n\n/**\n * Get past events from contracts\n *\n * @method getPastEvents\n * @param {String} event\n * @param {Object} options\n * @param {Function} callback\n * @return {Object} the promievent\n */\nContract.prototype.getPastEvents = function(){\n    var subOptions = this._generateEventOptions.apply(this, arguments);\n\n    var getPastLogs = new Method({\n        name: 'getPastLogs',\n        call: 'eth_getLogs',\n        params: 1,\n        inputFormatter: [formatters.inputLogFormatter],\n        outputFormatter: this._decodeEventABI.bind(subOptions.event)\n    });\n    getPastLogs.setRequestManager(this._requestManager);\n    var call = getPastLogs.buildCall();\n\n    getPastLogs = null;\n\n    return call(subOptions.params, subOptions.callback);\n};\n\n\n/**\n * returns the an object with call, send, estimate functions\n *\n * @method _createTxObject\n * @returns {Object} an object with functions to call the methods\n */\nContract.prototype._createTxObject =  function _createTxObject(){\n    var args = Array.prototype.slice.call(arguments);\n    var txObject = {};\n\n    if(this.method.type === 'function') {\n\n        txObject.call = this.parent._executeMethod.bind(txObject, 'call');\n        txObject.call.request = this.parent._executeMethod.bind(txObject, 'call', true); // to make batch requests\n\n    }\n\n    txObject.send = this.parent._executeMethod.bind(txObject, 'send');\n    txObject.send.request = this.parent._executeMethod.bind(txObject, 'send', true); // to make batch requests\n    txObject.encodeABI = this.parent._encodeMethodABI.bind(txObject);\n    txObject.estimateGas = this.parent._executeMethod.bind(txObject, 'estimate');\n\n    if (args && this.method.inputs && args.length !== this.method.inputs.length) {\n        if (this.nextMethod) {\n            return this.nextMethod.apply(null, args);\n        }\n        throw errors.InvalidNumberOfParams(args.length, this.method.inputs.length, this.method.name);\n    }\n\n    txObject.arguments = args || [];\n    txObject._method = this.method;\n    txObject._parent = this.parent;\n    txObject._ethAccounts = this.parent.constructor._ethAccounts || this._ethAccounts;\n\n    if(this.deployData) {\n        txObject._deployData = this.deployData;\n    }\n\n    return txObject;\n};\n\n\n/**\n * Generates the options for the execute call\n *\n * @method _processExecuteArguments\n * @param {Array} args\n * @param {Promise} defer\n */\nContract.prototype._processExecuteArguments = function _processExecuteArguments(args, defer) {\n    var processedArgs = {};\n\n    processedArgs.type = args.shift();\n\n    // get the callback\n    processedArgs.callback = this._parent._getCallback(args);\n\n    // get block number to use for call\n    if(processedArgs.type === 'call' && args[args.length - 1] !== true && (_.isString(args[args.length - 1]) || isFinite(args[args.length - 1])))\n        processedArgs.defaultBlock = args.pop();\n\n    // get the options\n    processedArgs.options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\n\n    // get the generateRequest argument for batch requests\n    processedArgs.generateRequest = (args[args.length - 1] === true)? args.pop() : false;\n\n    processedArgs.options = this._parent._getOrSetDefaultOptions(processedArgs.options);\n    processedArgs.options.data = this.encodeABI();\n\n    // add contract address\n    if(!this._deployData && !utils.isAddress(this._parent.options.address))\n        throw new Error('This contract object doesn\\'t have address set yet, please set an address first.');\n\n    if(!this._deployData)\n        processedArgs.options.to = this._parent.options.address;\n\n    // return error, if no \"data\" is specified\n    if(!processedArgs.options.data)\n        return utils._fireError(new Error('Couldn\\'t find a matching contract method, or the number of parameters is wrong.'), defer.eventEmitter, defer.reject, processedArgs.callback);\n\n    return processedArgs;\n};\n\n/**\n * Executes a call, transact or estimateGas on a contract function\n *\n * @method _executeMethod\n * @param {String} type the type this execute function should execute\n * @param {Boolean} makeRequest if true, it simply returns the request parameters, rather than executing it\n */\nContract.prototype._executeMethod = function _executeMethod(){\n    var _this = this,\n        args = this._parent._processExecuteArguments.call(this, Array.prototype.slice.call(arguments), defer),\n        defer = promiEvent((args.type !== 'send')),\n        ethAccounts = _this.constructor._ethAccounts || _this._ethAccounts;\n\n    // simple return request for batch requests\n    if(args.generateRequest) {\n\n        var payload = {\n            params: [formatters.inputCallFormatter.call(this._parent, args.options), formatters.inputDefaultBlockNumberFormatter.call(this._parent, args.defaultBlock)],\n            callback: args.callback\n        };\n\n        if(args.type === 'call') {\n            payload.method = 'eth_call';\n            payload.format = this._parent._decodeMethodReturn.bind(null, this._method.outputs);\n        } else {\n            payload.method = 'eth_sendTransaction';\n        }\n\n        return payload;\n\n    } else {\n\n        switch (args.type) {\n            case 'estimate':\n\n                var estimateGas = (new Method({\n                    name: 'estimateGas',\n                    call: 'eth_estimateGas',\n                    params: 1,\n                    inputFormatter: [formatters.inputCallFormatter],\n                    outputFormatter: utils.hexToNumber,\n                    requestManager: _this._parent._requestManager,\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock\n                })).createFunction();\n\n                return estimateGas(args.options, args.callback);\n\n            case 'call':\n\n                // TODO check errors: missing \"from\" should give error on deploy and send, call ?\n\n                var call = (new Method({\n                    name: 'call',\n                    call: 'eth_call',\n                    params: 2,\n                    inputFormatter: [formatters.inputCallFormatter, formatters.inputDefaultBlockNumberFormatter],\n                    // add output formatter for decoding\n                    outputFormatter: function (result) {\n                        return _this._parent._decodeMethodReturn(_this._method.outputs, result);\n                    },\n                    requestManager: _this._parent._requestManager,\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock\n                })).createFunction();\n\n                return call(args.options, args.defaultBlock, args.callback);\n\n            case 'send':\n\n                // return error, if no \"from\" is specified\n                if(!utils.isAddress(args.options.from)) {\n                    return utils._fireError(new Error('No \"from\" address specified in neither the given options, nor the default options.'), defer.eventEmitter, defer.reject, args.callback);\n                }\n\n                if (_.isBoolean(this._method.payable) && !this._method.payable && args.options.value && args.options.value > 0) {\n                    return utils._fireError(new Error('Can not send value to non-payable contract method or constructor'), defer.eventEmitter, defer.reject, args.callback);\n                }\n\n\n                // make sure receipt logs are decoded\n                var extraFormatters = {\n                    receiptFormatter: function (receipt) {\n                        if (_.isArray(receipt.logs)) {\n\n                            // decode logs\n                            var events = _.map(receipt.logs, function(log) {\n                                return _this._parent._decodeEventABI.call({\n                                    name: 'ALLEVENTS',\n                                    jsonInterface: _this._parent.options.jsonInterface\n                                }, log);\n                            });\n\n                            // make log names keys\n                            receipt.events = {};\n                            var count = 0;\n                            events.forEach(function (ev) {\n                                if (ev.event) {\n                                    // if > 1 of the same event, don't overwrite any existing events\n                                    if (receipt.events[ev.event]) {\n                                        if (Array.isArray(receipt.events[ ev.event ])) {\n                                            receipt.events[ ev.event ].push(ev);\n                                        } else {\n                                            receipt.events[ev.event] = [receipt.events[ev.event], ev];\n                                        }\n                                    } else {\n                                        receipt.events[ ev.event ] = ev;\n                                    }\n                                } else {\n                                    receipt.events[count] = ev;\n                                    count++;\n                                }\n                            });\n\n                            delete receipt.logs;\n                        }\n                        return receipt;\n                    },\n                    contractDeployFormatter: function (receipt) {\n                        var newContract = _this._parent.clone();\n                        newContract.options.address = receipt.contractAddress;\n                        return newContract;\n                    }\n                };\n\n                var sendTransaction = (new Method({\n                    name: 'sendTransaction',\n                    call: 'eth_sendTransaction',\n                    params: 1,\n                    inputFormatter: [formatters.inputTransactionFormatter],\n                    requestManager: _this._parent._requestManager,\n                    accounts: _this.constructor._ethAccounts || _this._ethAccounts, // is eth.accounts (necessary for wallet signing)\n                    defaultAccount: _this._parent.defaultAccount,\n                    defaultBlock: _this._parent.defaultBlock,\n                    extraFormatters: extraFormatters\n                })).createFunction();\n\n                return sendTransaction(args.options, args.callback);\n\n        }\n\n    }\n\n};\n\nmodule.exports = Contract;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth-contract/src/index.js\n// module id = 1288\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth-contract/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file getNetworkType.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\n\nvar getNetworkType = function (callback) {\n    var _this = this,\n        id;\n\n\n    return this.net.getId()\n        .then(function (givenId) {\n\n            id = givenId;\n\n            return _this.getBlock(0);\n        })\n        .then(function (genesis) {\n            var returnValue = 'private';\n\n            if (genesis.hash === '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3' &&\n                id === 1) {\n                returnValue = 'main';\n            }\n            if (genesis.hash === '0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303' &&\n                id === 2) {\n                returnValue = 'morden';\n            }\n            if (genesis.hash === '0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d' &&\n                id === 3) {\n                returnValue = 'ropsten';\n            }\n            if (genesis.hash === '0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177' &&\n                id === 4) {\n                returnValue = 'rinkeby';\n            }\n            if (genesis.hash === '0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9' &&\n                id === 42) {\n                returnValue = 'kovan';\n            }\n\n            if (_.isFunction(callback)) {\n                callback(null, returnValue);\n            }\n\n            return returnValue;\n        })\n        .catch(function (err) {\n            if (_.isFunction(callback)) {\n                callback(err);\n            } else {\n                throw err;\n            }\n        });\n};\n\nmodule.exports = getNetworkType;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth/src/getNetworkType.js\n// module id = 1289\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth/src/getNetworkType.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar core = __webpack_require__(106);\nvar helpers = __webpack_require__(35);\nvar Subscriptions = __webpack_require__(210).subscriptions;\nvar Method = __webpack_require__(105);\nvar utils = __webpack_require__(47);\nvar Net = __webpack_require__(211);\n\nvar Personal = __webpack_require__(560);\nvar BaseContract = __webpack_require__(1288);\nvar Iban = __webpack_require__(559);\nvar Accounts = __webpack_require__(1287);\nvar abi = __webpack_require__(554);\n\nvar getNetworkType = __webpack_require__(1289);\nvar formatter = helpers.formatters;\n\n\nvar blockCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n    return (_.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n\nvar Eth = function Eth() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // overwrite setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function () {\n        setProvider.apply(_this, arguments);\n        _this.net.setProvider.apply(_this, arguments);\n        _this.personal.setProvider.apply(_this, arguments);\n        _this.accounts.setProvider.apply(_this, arguments);\n        _this.Contract.setProvider(_this.currentProvider, _this.accounts);\n    };\n\n\n    var defaultAccount = null;\n    var defaultBlock = 'latest';\n\n    Object.defineProperty(this, 'defaultAccount', {\n        get: function () {\n            return defaultAccount;\n        },\n        set: function (val) {\n            if(val) {\n                defaultAccount = utils.toChecksumAddress(formatter.inputAddressFormatter(val));\n            }\n\n            // also set on the Contract object\n            _this.Contract.defaultAccount = defaultAccount;\n            _this.personal.defaultAccount = defaultAccount;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultAccount = defaultAccount;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n    Object.defineProperty(this, 'defaultBlock', {\n        get: function () {\n            return defaultBlock;\n        },\n        set: function (val) {\n            defaultBlock = val;\n            // also set on the Contract object\n            _this.Contract.defaultBlock = defaultBlock;\n            _this.personal.defaultBlock = defaultBlock;\n\n            // update defaultBlock\n            methods.forEach(function(method) {\n                method.defaultBlock = defaultBlock;\n            });\n\n            return val;\n        },\n        enumerable: true\n    });\n\n\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\n\n    // add net\n    this.net = new Net(this.currentProvider);\n    // add chain detection\n    this.net.getNetworkType = getNetworkType.bind(this);\n\n    // add accounts\n    this.accounts = new Accounts(this.currentProvider);\n\n    // add personal\n    this.personal = new Personal(this.currentProvider);\n    this.personal.defaultAccount = this.defaultAccount;\n\n    // create a proxy Contract type for this instance, as a Contract's provider\n    // is stored as a class member rather than an instance variable. If we do\n    // not create this proxy type, changing the provider in one instance of\n    // web3-eth would subsequently change the provider for _all_ contract\n    // instances!\n    var Contract = function Contract() {\n        BaseContract.apply(this, arguments);\n    };\n\n    Contract.setProvider = function() {\n        BaseContract.setProvider.apply(this, arguments);\n    };\n\n    // make our proxy Contract inherit from web3-eth-contract so that it has all\n    // the right functionality and so that instanceof and friends work properly\n    Contract.prototype = Object.create(BaseContract.prototype);\n    Contract.prototype.constructor = Contract;\n\n    // add contract\n    this.Contract = Contract;\n    this.Contract.defaultAccount = this.defaultAccount;\n    this.Contract.defaultBlock = this.defaultBlock;\n    this.Contract.setProvider(this.currentProvider, this.accounts);\n\n    // add IBAN\n    this.Iban = Iban;\n\n    // add ABI\n    this.abi = abi;\n\n\n    var methods = [\n        new Method({\n            name: 'getProtocolVersion',\n            call: 'eth_protocolVersion',\n            params: 0\n        }),\n        new Method({\n            name: 'getCoinbase',\n            call: 'eth_coinbase',\n            params: 0\n        }),\n        new Method({\n            name: 'isMining',\n            call: 'eth_mining',\n            params: 0\n        }),\n        new Method({\n            name: 'getHashrate',\n            call: 'eth_hashrate',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'isSyncing',\n            call: 'eth_syncing',\n            params: 0,\n            outputFormatter: formatter.outputSyncingFormatter\n        }),\n        new Method({\n            name: 'getGasPrice',\n            call: 'eth_gasPrice',\n            params: 0,\n            outputFormatter: formatter.outputBigNumberFormatter\n        }),\n        new Method({\n            name: 'getAccounts',\n            call: 'eth_accounts',\n            params: 0,\n            outputFormatter: utils.toChecksumAddress\n        }),\n        new Method({\n            name: 'getBlockNumber',\n            call: 'eth_blockNumber',\n            params: 0,\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getBalance',\n            call: 'eth_getBalance',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\n            outputFormatter: formatter.outputBigNumberFormatter\n        }),\n        new Method({\n            name: 'getStorageAt',\n            call: 'eth_getStorageAt',\n            params: 3,\n            inputFormatter: [formatter.inputAddressFormatter, utils.numberToHex, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'getCode',\n            call: 'eth_getCode',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'getBlock',\n            call: blockCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, function (val) { return !!val; }],\n            outputFormatter: formatter.outputBlockFormatter\n        }),\n        new Method({\n            name: 'getUncle',\n            call: uncleCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\n            outputFormatter: formatter.outputBlockFormatter,\n\n        }),\n        new Method({\n            name: 'getBlockTransactionCount',\n            call: getBlockTransactionCountCall,\n            params: 1,\n            inputFormatter: [formatter.inputBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getBlockUncleCount',\n            call: uncleCountCall,\n            params: 1,\n            inputFormatter: [formatter.inputBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getTransaction',\n            call: 'eth_getTransactionByHash',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatter.outputTransactionFormatter\n        }),\n        new Method({\n            name: 'getTransactionFromBlock',\n            call: transactionFromBlockCall,\n            params: 2,\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\n            outputFormatter: formatter.outputTransactionFormatter\n        }),\n        new Method({\n            name: 'getTransactionReceipt',\n            call: 'eth_getTransactionReceipt',\n            params: 1,\n            inputFormatter: [null],\n            outputFormatter: formatter.outputTransactionReceiptFormatter\n        }),\n        new Method({\n            name: 'getTransactionCount',\n            call: 'eth_getTransactionCount',\n            params: 2,\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'sendSignedTransaction',\n            call: 'eth_sendRawTransaction',\n            params: 1,\n            inputFormatter: [null]\n        }),\n        new Method({\n            name: 'signTransaction',\n            call: 'eth_signTransaction',\n            params: 1,\n            inputFormatter: [formatter.inputTransactionFormatter]\n        }),\n        new Method({\n            name: 'sendTransaction',\n            call: 'eth_sendTransaction',\n            params: 1,\n            inputFormatter: [formatter.inputTransactionFormatter]\n        }),\n        new Method({\n            name: 'sign',\n            call: 'eth_sign',\n            params: 2,\n            inputFormatter: [formatter.inputSignFormatter, formatter.inputAddressFormatter],\n            transformPayload: function (payload) {\n                payload.params.reverse();\n                return payload;\n            }\n        }),\n        new Method({\n            name: 'call',\n            call: 'eth_call',\n            params: 2,\n            inputFormatter: [formatter.inputCallFormatter, formatter.inputDefaultBlockNumberFormatter]\n        }),\n        new Method({\n            name: 'estimateGas',\n            call: 'eth_estimateGas',\n            params: 1,\n            inputFormatter: [formatter.inputCallFormatter],\n            outputFormatter: utils.hexToNumber\n        }),\n        new Method({\n            name: 'getCompilers',\n            call: 'eth_getCompilers',\n            params: 0\n        }),\n        new Method({\n            name: 'compile.solidity',\n            call: 'eth_compileSolidity',\n            params: 1\n        }),\n        new Method({\n            name: 'compile.lll',\n            call: 'eth_compileLLL',\n            params: 1\n        }),\n        new Method({\n            name: 'compile.serpent',\n            call: 'eth_compileSerpent',\n            params: 1\n        }),\n        new Method({\n            name: 'submitWork',\n            call: 'eth_submitWork',\n            params: 3\n        }),\n        new Method({\n            name: 'getWork',\n            call: 'eth_getWork',\n            params: 0\n        }),\n        new Method({\n            name: 'getPastLogs',\n            call: 'eth_getLogs',\n            params: 1,\n            inputFormatter: [formatter.inputLogFormatter],\n            outputFormatter: formatter.outputLogFormatter\n        }),\n\n        // subscriptions\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'eth',\n            subscriptions: {\n                'newBlockHeaders': {\n                    // TODO rename on RPC side?\n                    subscriptionName: 'newHeads', // replace subscription with this name\n                    params: 0,\n                    outputFormatter: formatter.outputBlockFormatter\n                },\n                'pendingTransactions': {\n                    subscriptionName: 'newPendingTransactions', // replace subscription with this name\n                    params: 0\n                },\n                'logs': {\n                    params: 1,\n                    inputFormatter: [formatter.inputLogFormatter],\n                    outputFormatter: formatter.outputLogFormatter,\n                    // DUBLICATE, also in web3-eth-contract\n                    subscriptionHandler: function (output) {\n                        if(output.removed) {\n                            this.emit('changed', output);\n                        } else {\n                            this.emit('data', output);\n                        }\n\n                        if (_.isFunction(this.callback)) {\n                            this.callback(null, output, this);\n                        }\n                    }\n                },\n                'syncing': {\n                    params: 0,\n                    outputFormatter: formatter.outputSyncingFormatter,\n                    subscriptionHandler: function (output) {\n                        var _this = this;\n\n                        // fire TRUE at start\n                        if(this._isSyncing !== true) {\n                            this._isSyncing = true;\n                            this.emit('changed', _this._isSyncing);\n\n                            if (_.isFunction(this.callback)) {\n                                this.callback(null, _this._isSyncing, this);\n                            }\n\n                            setTimeout(function () {\n                                _this.emit('data', output);\n\n                                if (_.isFunction(_this.callback)) {\n                                    _this.callback(null, output, _this);\n                                }\n                            }, 0);\n\n                            // fire sync status\n                        } else {\n                            this.emit('data', output);\n                            if (_.isFunction(_this.callback)) {\n                                this.callback(null, output, this);\n                            }\n\n                            // wait for some time before fireing the FALSE\n                            clearTimeout(this._isSyncingTimeout);\n                            this._isSyncingTimeout = setTimeout(function () {\n                                if(output.currentBlock > output.highestBlock - 200) {\n                                    _this._isSyncing = false;\n                                    _this.emit('changed', _this._isSyncing);\n\n                                    if (_.isFunction(_this.callback)) {\n                                        _this.callback(null, _this._isSyncing, _this);\n                                    }\n                                }\n                            }, 500);\n                        }\n                    }\n                }\n            }\n        })\n    ];\n\n    methods.forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager, _this.accounts); // second param means is eth.accounts (necessary for wallet signing)\n        method.defaultBlock = _this.defaultBlock;\n        method.defaultAccount = _this.defaultAccount;\n    });\n\n};\n\ncore.addProviders(Eth);\n\n\nmodule.exports = Eth;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-eth/src/index.js\n// module id = 1290\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-eth/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file httpprovider.js\n * @authors:\n *   Marek Kotewicz <marek@parity.io>\n *   Marian Oancea\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2015\n */\n\nvar errors = __webpack_require__(35).errors;\nvar XHR2 = __webpack_require__(563); // jshint ignore: line\n\n/**\n * HttpProvider should be used to send rpc calls over http\n */\nvar HttpProvider = function HttpProvider(host, timeout, headers) {\n    this.host = host || 'http://localhost:8545';\n    this.timeout = timeout || 0;\n    this.connected = false;\n    this.headers = headers;\n};\n\nHttpProvider.prototype._prepareRequest = function(){\n    var request = new XHR2();\n\n    request.open('POST', this.host, true);\n    request.setRequestHeader('Content-Type','application/json');\n\n    if(this.headers) {\n        this.headers.forEach(function(header) {\n            request.setRequestHeader(header.name, header.value);\n        });\n    }\n\n    return request;\n};\n\n/**\n * Should be used to make async request\n *\n * @method send\n * @param {Object} payload\n * @param {Function} callback triggered on end with (err, result)\n */\nHttpProvider.prototype.send = function (payload, callback) {\n    var _this = this;\n    var request = this._prepareRequest();\n\n\n    request.onreadystatechange = function() {\n        if (request.readyState === 4 && request.timeout !== 1) {\n            var result = request.responseText;\n            var error = null;\n\n            try {\n                result = JSON.parse(result);\n            } catch(e) {\n                error = errors.InvalidResponse(request.responseText);\n            }\n\n            _this.connected = true;\n            callback(error, result);\n        }\n    };\n\n    request.ontimeout = function() {\n        _this.connected = false;\n        callback(errors.ConnectionTimeout(this.timeout));\n    };\n\n    try {\n        request.send(JSON.stringify(payload));\n    } catch(error) {\n        this.connected = false;\n        callback(errors.InvalidConnection(this.host));\n    }\n};\n\n\nmodule.exports = HttpProvider;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-providers-http/src/index.js\n// module id = 1291\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-providers-http/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/** @file index.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(35).errors;\nvar oboe = __webpack_require__(496);\n\n\nvar IpcProvider = function IpcProvider(path, net) {\n    var _this = this;\n    this.responseCallbacks = {};\n    this.notificationCallbacks = [];\n    this.path = path;\n\n    this.connection = net.connect({path: this.path});\n\n    this.addDefaultEvents();\n\n    // LISTEN FOR CONNECTION RESPONSES\n    var callback = function(result) {\n        /*jshint maxcomplexity: 6 */\n\n        var id = null;\n\n        // get the id which matches the returned id\n        if(_.isArray(result)) {\n            result.forEach(function(load){\n                if(_this.responseCallbacks[load.id])\n                    id = load.id;\n            });\n        } else {\n            id = result.id;\n        }\n\n        // notification\n        if(!id && result.method.indexOf('_subscription') !== -1) {\n            _this.notificationCallbacks.forEach(function(callback){\n                if(_.isFunction(callback))\n                    callback(null, result);\n            });\n\n            // fire the callback\n        } else if(_this.responseCallbacks[id]) {\n            _this.responseCallbacks[id](null, result);\n            delete _this.responseCallbacks[id];\n        }\n    };\n\n    // use oboe.js for Sockets\n    if (net.constructor.name === 'Socket') {\n        oboe(this.connection)\n        .done(callback);\n    } else {\n        this.connection.on('data', function(data){\n            _this._parseResponse(data.toString()).forEach(callback);\n        });\n    }\n};\n\n/**\nWill add the error and end event to timeout existing calls\n\n@method addDefaultEvents\n*/\nIpcProvider.prototype.addDefaultEvents = function(){\n    var _this = this;\n\n    this.connection.on('connect', function(){\n    });\n\n    this.connection.on('error', function(){\n        _this._timeout();\n    });\n\n    this.connection.on('end', function(){\n        _this._timeout();\n\n        // inform notifications\n        _this.notificationCallbacks.forEach(function (callback) {\n            if (_.isFunction(callback))\n                callback(new Error('IPC socket connection closed'));\n        });\n    });\n\n    this.connection.on('timeout', function(){\n        _this._timeout();\n    });\n};\n\n\n/**\n Will parse the response and make an array out of it.\n\n NOTE, this exists for backwards compatibility reasons.\n\n @method _parseResponse\n @param {String} data\n */\nIpcProvider.prototype._parseResponse = function(data) {\n    var _this = this,\n        returnValues = [];\n\n    // DE-CHUNKER\n    var dechunkedData = data\n        .replace(/\\}[\\n\\r]?\\{/g,'}|--|{') // }{\n        .replace(/\\}\\][\\n\\r]?\\[\\{/g,'}]|--|[{') // }][{\n        .replace(/\\}[\\n\\r]?\\[\\{/g,'}|--|[{') // }[{\n        .replace(/\\}\\][\\n\\r]?\\{/g,'}]|--|{') // }]{\n        .split('|--|');\n\n    dechunkedData.forEach(function(data){\n\n        // prepend the last chunk\n        if(_this.lastChunk)\n            data = _this.lastChunk + data;\n\n        var result = null;\n\n        try {\n            result = JSON.parse(data);\n\n        } catch(e) {\n\n            _this.lastChunk = data;\n\n            // start timeout to cancel all requests\n            clearTimeout(_this.lastChunkTimeout);\n            _this.lastChunkTimeout = setTimeout(function(){\n                _this._timeout();\n                throw errors.InvalidResponse(data);\n            }, 1000 * 15);\n\n            return;\n        }\n\n        // cancel timeout and set chunk to null\n        clearTimeout(_this.lastChunkTimeout);\n        _this.lastChunk = null;\n\n        if(result)\n            returnValues.push(result);\n    });\n\n    return returnValues;\n};\n\n\n/**\nGet the adds a callback to the responseCallbacks object,\nwhich will be called if a response matching the response Id will arrive.\n\n@method _addResponseCallback\n*/\nIpcProvider.prototype._addResponseCallback = function(payload, callback) {\n    var id = payload.id || payload[0].id;\n    var method = payload.method || payload[0].method;\n\n    this.responseCallbacks[id] = callback;\n    this.responseCallbacks[id].method = method;\n};\n\n/**\nTimeout all requests when the end/error event is fired\n\n@method _timeout\n*/\nIpcProvider.prototype._timeout = function() {\n    for(var key in this.responseCallbacks) {\n        if(this.responseCallbacks.hasOwnProperty(key)){\n            this.responseCallbacks[key](errors.InvalidConnection('on IPC'));\n            delete this.responseCallbacks[key];\n        }\n    }\n};\n\n/**\n Try to reconnect\n\n @method reconnect\n */\nIpcProvider.prototype.reconnect = function() {\n    this.connection.connect({path: this.path});\n};\n\n\nIpcProvider.prototype.send = function (payload, callback) {\n    // try reconnect, when connection is gone\n    if(!this.connection.writable)\n        this.connection.connect({path: this.path});\n\n\n    this.connection.write(JSON.stringify(payload));\n    this._addResponseCallback(payload, callback);\n};\n\n/**\nSubscribes to provider events.provider\n\n@method on\n@param {String} type    'notification', 'connect', 'error', 'end' or 'data'\n@param {Function} callback   the callback to call\n*/\nIpcProvider.prototype.on = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.push(callback);\n            break;\n\n        default:\n            this.connection.on(type, callback);\n            break;\n    }\n};\n\n/**\n Subscribes to provider events.provider\n\n @method on\n @param {String} type    'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nIpcProvider.prototype.once = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    this.connection.once(type, callback);\n};\n\n/**\nRemoves event listener\n\n@method removeListener\n@param {String} type    'data', 'connect', 'error', 'end' or 'data'\n@param {Function} callback   the callback to call\n*/\nIpcProvider.prototype.removeListener = function (type, callback) {\n    var _this = this;\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.forEach(function(cb, index){\n                if(cb === callback)\n                    _this.notificationCallbacks.splice(index, 1);\n            });\n            break;\n\n        default:\n            this.connection.removeListener(type, callback);\n            break;\n    }\n};\n\n/**\nRemoves all event listeners\n\n@method removeAllListeners\n@param {String} type    'data', 'connect', 'error', 'end' or 'data'\n*/\nIpcProvider.prototype.removeAllListeners = function (type) {\n    switch(type){\n        case 'data':\n            this.notificationCallbacks = [];\n            break;\n\n        default:\n            this.connection.removeAllListeners(type);\n            break;\n    }\n};\n\n/**\nResets the providers, clears all callbacks\n\n@method reset\n*/\nIpcProvider.prototype.reset = function () {\n    this._timeout();\n    this.notificationCallbacks = [];\n\n    this.connection.removeAllListeners('error');\n    this.connection.removeAllListeners('end');\n    this.connection.removeAllListeners('timeout');\n\n    this.addDefaultEvents();\n};\n\nmodule.exports = IpcProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-providers-ipc/src/index.js\n// module id = 1292\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-providers-ipc/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/** @file WebsocketProvider.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar _ = __webpack_require__(11);\nvar errors = __webpack_require__(35).errors;\n\nvar Ws = null;\nif (typeof window !== 'undefined') {\n    Ws = window.WebSocket;\n} else {\n    Ws = __webpack_require__(1301).w3cwebsocket;\n}\n// Default connection ws://localhost:8546\n\n\n\nvar WebsocketProvider = function WebsocketProvider(url)  {\n    var _this = this;\n    this.responseCallbacks = {};\n    this.notificationCallbacks = [];\n    this.connection = new Ws(url);\n\n\n    this.addDefaultEvents();\n\n\n    // LISTEN FOR CONNECTION RESPONSES\n    this.connection.onmessage = function(e) {\n        /*jshint maxcomplexity: 6 */\n        var data = (typeof e.data === 'string') ? e.data : '';\n\n        _this._parseResponse(data).forEach(function(result){\n\n            var id = null;\n\n            // get the id which matches the returned id\n            if(_.isArray(result)) {\n                result.forEach(function(load){\n                    if(_this.responseCallbacks[load.id])\n                        id = load.id;\n                });\n            } else {\n                id = result.id;\n            }\n\n            // notification\n            if(!id && result.method.indexOf('_subscription') !== -1) {\n                _this.notificationCallbacks.forEach(function(callback){\n                    if(_.isFunction(callback))\n                        callback(null, result);\n                });\n\n                // fire the callback\n            } else if(_this.responseCallbacks[id]) {\n                _this.responseCallbacks[id](null, result);\n                delete _this.responseCallbacks[id];\n            }\n        });\n    };\n};\n\n/**\n Will add the error and end event to timeout existing calls\n\n @method addDefaultEvents\n */\nWebsocketProvider.prototype.addDefaultEvents = function(){\n    var _this = this;\n\n    this.connection.onerror = function(){\n        _this._timeout();\n    };\n\n    this.connection.onclose = function(e){\n        _this._timeout();\n\n        var noteCb = _this.notificationCallbacks;\n\n        // reset all requests and callbacks\n        _this.reset();\n\n        // cancel subscriptions\n        noteCb.forEach(function (callback) {\n            if (_.isFunction(callback))\n                callback(e);\n        });\n    };\n\n    // this.connection.on('timeout', function(){\n    //     _this._timeout();\n    // });\n};\n\n/**\n Will parse the response and make an array out of it.\n\n @method _parseResponse\n @param {String} data\n */\nWebsocketProvider.prototype._parseResponse = function(data) {\n    var _this = this,\n        returnValues = [];\n\n    // DE-CHUNKER\n    var dechunkedData = data\n        .replace(/\\}[\\n\\r]?\\{/g,'}|--|{') // }{\n        .replace(/\\}\\][\\n\\r]?\\[\\{/g,'}]|--|[{') // }][{\n        .replace(/\\}[\\n\\r]?\\[\\{/g,'}|--|[{') // }[{\n        .replace(/\\}\\][\\n\\r]?\\{/g,'}]|--|{') // }]{\n        .split('|--|');\n\n    dechunkedData.forEach(function(data){\n\n        // prepend the last chunk\n        if(_this.lastChunk)\n            data = _this.lastChunk + data;\n\n        var result = null;\n\n        try {\n            result = JSON.parse(data);\n\n        } catch(e) {\n\n            _this.lastChunk = data;\n\n            // start timeout to cancel all requests\n            clearTimeout(_this.lastChunkTimeout);\n            _this.lastChunkTimeout = setTimeout(function(){\n                _this._timeout();\n                throw errors.InvalidResponse(data);\n            }, 1000 * 15);\n\n            return;\n        }\n\n        // cancel timeout and set chunk to null\n        clearTimeout(_this.lastChunkTimeout);\n        _this.lastChunk = null;\n\n        if(result)\n            returnValues.push(result);\n    });\n\n    return returnValues;\n};\n\n\n/**\n Get the adds a callback to the responseCallbacks object,\n which will be called if a response matching the response Id will arrive.\n\n @method _addResponseCallback\n */\nWebsocketProvider.prototype._addResponseCallback = function(payload, callback) {\n    var id = payload.id || payload[0].id;\n    var method = payload.method || payload[0].method;\n\n    this.responseCallbacks[id] = callback;\n    this.responseCallbacks[id].method = method;\n};\n\n/**\n Timeout all requests when the end/error event is fired\n\n @method _timeout\n */\nWebsocketProvider.prototype._timeout = function() {\n    for(var key in this.responseCallbacks) {\n        if(this.responseCallbacks.hasOwnProperty(key)){\n            this.responseCallbacks[key](errors.InvalidConnection('on IPC'));\n            delete this.responseCallbacks[key];\n        }\n    }\n};\n\n\nWebsocketProvider.prototype.send = function (payload, callback) {\n    var _this = this;\n\n    if (this.connection.readyState === this.connection.CONNECTING) {\n        setTimeout(function () {\n            _this.send(payload, callback);\n        }, 10);\n        return;\n    }\n\n    // try reconnect, when connection is gone\n    // if(!this.connection.writable)\n    //     this.connection.connect({url: this.url});\n    if (this.connection.readyState !== this.connection.OPEN) {\n        console.error('connection not open on send()');\n        if (typeof this.connection.onerror === 'function') {\n            this.connection.onerror(new Error('connection not open'));\n        } else {\n            console.error('no error callback');\n        }\n        callback(new Error('connection not open'));\n        return;\n    }\n\n    this.connection.send(JSON.stringify(payload));\n    this._addResponseCallback(payload, callback);\n};\n\n/**\n Subscribes to provider events.provider\n\n @method on\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nWebsocketProvider.prototype.on = function (type, callback) {\n\n    if(typeof callback !== 'function')\n        throw new Error('The second parameter callback must be a function.');\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.push(callback);\n            break;\n\n        case 'connect':\n            this.connection.onopen = callback;\n            break;\n\n        case 'end':\n            this.connection.onclose = callback;\n            break;\n\n        case 'error':\n            this.connection.onerror = callback;\n            break;\n\n        // default:\n        //     this.connection.on(type, callback);\n        //     break;\n    }\n};\n\n// TODO add once\n\n/**\n Removes event listener\n\n @method removeListener\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n @param {Function} callback   the callback to call\n */\nWebsocketProvider.prototype.removeListener = function (type, callback) {\n    var _this = this;\n\n    switch(type){\n        case 'data':\n            this.notificationCallbacks.forEach(function(cb, index){\n                if(cb === callback)\n                    _this.notificationCallbacks.splice(index, 1);\n            });\n            break;\n\n        // TODO remvoving connect missing\n\n        // default:\n        //     this.connection.removeListener(type, callback);\n        //     break;\n    }\n};\n\n/**\n Removes all event listeners\n\n @method removeAllListeners\n @param {String} type    'notifcation', 'connect', 'error', 'end' or 'data'\n */\nWebsocketProvider.prototype.removeAllListeners = function (type) {\n    switch(type){\n        case 'data':\n            this.notificationCallbacks = [];\n            break;\n\n        // TODO remvoving connect properly missing\n\n        case 'connect':\n            this.connection.onopen = null;\n            break;\n\n        case 'end':\n            this.connection.onclose = null;\n            break;\n\n        case 'error':\n            this.connection.onerror = null;\n            break;\n\n        default:\n            // this.connection.removeAllListeners(type);\n            break;\n    }\n};\n\n/**\n Resets the providers, clears all callbacks\n\n @method reset\n */\nWebsocketProvider.prototype.reset = function () {\n    this._timeout();\n    this.notificationCallbacks = [];\n\n    // this.connection.removeAllListeners('error');\n    // this.connection.removeAllListeners('end');\n    // this.connection.removeAllListeners('timeout');\n\n    this.addDefaultEvents();\n};\n\nmodule.exports = WebsocketProvider;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-providers-ws/src/index.js\n// module id = 1293\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-providers-ws/src/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\n\n\nvar core = __webpack_require__(106);\nvar Subscriptions = __webpack_require__(210).subscriptions;\nvar Method = __webpack_require__(105);\n// var formatters = require('web3-core-helpers').formatters;\nvar Net = __webpack_require__(211);\n\n\nvar Shh = function Shh() {\n    var _this = this;\n\n    // sets _requestmanager\n    core.packageInit(this, arguments);\n\n    // overwrite setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function () {\n        setProvider.apply(_this, arguments);\n        _this.net.setProvider.apply(_this, arguments);\n    };\n\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\n\n    this.net = new Net(this.currentProvider);\n\n\n    [\n        new Subscriptions({\n            name: 'subscribe',\n            type: 'shh',\n            subscriptions: {\n                'messages': {\n                    params: 1\n                    // inputFormatter: [formatters.inputPostFormatter],\n                    // outputFormatter: formatters.outputPostFormatter\n                }\n            }\n        }),\n\n        new Method({\n            name: 'getVersion',\n            call: 'shh_version',\n            params: 0\n        }),\n        new Method({\n            name: 'getInfo',\n            call: 'shh_info',\n            params: 0\n        }),\n        new Method({\n            name: 'setMaxMessageSize',\n            call: 'shh_setMaxMessageSize',\n            params: 1\n        }),\n        new Method({\n            name: 'setMinPoW',\n            call: 'shh_setMinPoW',\n            params: 1\n        }),\n        new Method({\n            name: 'markTrustedPeer',\n            call: 'shh_markTrustedPeer',\n            params: 1\n        }),\n        new Method({\n            name: 'newKeyPair',\n            call: 'shh_newKeyPair',\n            params: 0\n        }),\n        new Method({\n            name: 'addPrivateKey',\n            call: 'shh_addPrivateKey',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteKeyPair',\n            call: 'shh_deleteKeyPair',\n            params: 1\n        }),\n        new Method({\n            name: 'hasKeyPair',\n            call: 'shh_hasKeyPair',\n            params: 1\n        }),\n        new Method({\n            name: 'getPublicKey',\n            call: 'shh_getPublicKey',\n            params: 1\n        }),\n        new Method({\n            name: 'getPrivateKey',\n            call: 'shh_getPrivateKey',\n            params: 1\n        }),\n        new Method({\n            name: 'newSymKey',\n            call: 'shh_newSymKey',\n            params: 0\n        }),\n        new Method({\n            name: 'addSymKey',\n            call: 'shh_addSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'generateSymKeyFromPassword',\n            call: 'shh_generateSymKeyFromPassword',\n            params: 1\n        }),\n        new Method({\n            name: 'hasSymKey',\n            call: 'shh_hasSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'getSymKey',\n            call: 'shh_getSymKey',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteSymKey',\n            call: 'shh_deleteSymKey',\n            params: 1\n        }),\n\n        new Method({\n            name: 'newMessageFilter',\n            call: 'shh_newMessageFilter',\n            params: 1\n        }),\n        new Method({\n            name: 'getFilterMessages',\n            call: 'shh_getFilterMessages',\n            params: 1\n        }),\n        new Method({\n            name: 'deleteMessageFilter',\n            call: 'shh_deleteMessageFilter',\n            params: 1\n        }),\n\n        new Method({\n            name: 'post',\n            call: 'shh_post',\n            params: 1,\n            inputFormatter: [null]\n        })\n    ].forEach(function(method) {\n        method.attachToObject(_this);\n        method.setRequestManager(_this._requestManager);\n    });\n};\n\ncore.addProviders(Shh);\n\n\n\nmodule.exports = Shh;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-shh/src/index.js\n// module id = 1294\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-shh/src/index.js")},function(module,exports,__webpack_require__){eval("/*\n This file is part of web3.js.\n\n web3.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n web3.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n */\n/**\n * @file soliditySha3.js\n * @author Fabian Vogelsteller <fabian@ethereum.org>\n * @date 2017\n */\n\nvar _ = __webpack_require__(11);\nvar BN = __webpack_require__(561);\nvar utils = __webpack_require__(562);\n\n\nvar _elementaryName = function (name) {\n    /*jshint maxcomplexity:false */\n\n    if (name.startsWith('int[')) {\n        return 'int256' + name.slice(3);\n    } else if (name === 'int') {\n        return 'int256';\n    } else if (name.startsWith('uint[')) {\n        return 'uint256' + name.slice(4);\n    } else if (name === 'uint') {\n        return 'uint256';\n    } else if (name.startsWith('fixed[')) {\n        return 'fixed128x128' + name.slice(5);\n    } else if (name === 'fixed') {\n        return 'fixed128x128';\n    } else if (name.startsWith('ufixed[')) {\n        return 'ufixed128x128' + name.slice(6);\n    } else if (name === 'ufixed') {\n        return 'ufixed128x128';\n    }\n    return name;\n};\n\n// Parse N from type<N>\nvar _parseTypeN = function (type) {\n    var typesize = /^\\D+(\\d+).*$/.exec(type);\n    return typesize ? parseInt(typesize[1], 10) : null;\n};\n\n// Parse N from type[<N>]\nvar _parseTypeNArray = function (type) {\n    var arraySize = /^\\D+\\d*\\[(\\d+)\\]$/.exec(type);\n    return arraySize ? parseInt(arraySize[1], 10) : null;\n};\n\nvar _parseNumber = function (arg) {\n    var type = typeof arg;\n    if (type === 'string') {\n        if (utils.isHexStrict(arg)) {\n            return new BN(arg.replace(/0x/i,''), 16);\n        } else {\n            return new BN(arg, 10);\n        }\n    } else if (type === 'number') {\n        return new BN(arg);\n    } else if (utils.isBigNumber(arg)) {\n        return new BN(arg.toString(10));\n    } else if (utils.isBN(arg)) {\n        return arg;\n    } else {\n        throw new Error(arg +' is not a number');\n    }\n};\n\nvar _solidityPack = function (type, value, arraySize) {\n    /*jshint maxcomplexity:false */\n\n    var size, num;\n    type = _elementaryName(type);\n\n\n    if (type === 'bytes') {\n\n        if (value.replace(/^0x/i,'').length % 2 !== 0) {\n            throw new Error('Invalid bytes characters '+ value.length);\n        }\n\n        return value;\n    } else if (type === 'string') {\n        return utils.utf8ToHex(value);\n    } else if (type === 'bool') {\n        return value ? '01' : '00';\n    } else if (type.startsWith('address')) {\n        if(arraySize) {\n            size = 64;\n        } else {\n            size = 40;\n        }\n\n        if(!utils.isAddress(value)) {\n            throw new Error(value +' is not a valid address, or the checksum is invalid.');\n        }\n\n        return utils.leftPad(value.toLowerCase(), size);\n    }\n\n    size = _parseTypeN(type);\n\n    if (type.startsWith('bytes')) {\n\n        if(!size) {\n            throw new Error('bytes[] not yet supported in solidity');\n        }\n\n        // must be 32 byte slices when in an array\n        if(arraySize) {\n            size = 32;\n        }\n\n        if (size < 1 || size > 32 || size < value.replace(/^0x/i,'').length / 2 ) {\n            throw new Error('Invalid bytes' + size +' for '+ value);\n        }\n\n        return utils.rightPad(value, size * 2);\n    } else if (type.startsWith('uint')) {\n\n        if ((size % 8) || (size < 8) || (size > 256)) {\n            throw new Error('Invalid uint'+size+' size');\n        }\n\n        num = _parseNumber(value);\n        if (num.bitLength() > size) {\n            throw new Error('Supplied uint exceeds width: ' + size + ' vs ' + num.bitLength());\n        }\n\n        if(num.lt(new BN(0))) {\n            throw new Error('Supplied uint '+ num.toString() +' is negative');\n        }\n\n        return size ? utils.leftPad(num.toString('hex'), size/8 * 2) : num;\n    } else if (type.startsWith('int')) {\n\n        if ((size % 8) || (size < 8) || (size > 256)) {\n            throw new Error('Invalid int'+size+' size');\n        }\n\n        num = _parseNumber(value);\n        if (num.bitLength() > size) {\n            throw new Error('Supplied int exceeds width: ' + size + ' vs ' + num.bitLength());\n        }\n\n        if(num.lt(new BN(0))) {\n            return num.toTwos(size).toString('hex');\n        } else {\n            return size ? utils.leftPad(num.toString('hex'), size/8 * 2) : num;\n        }\n\n    } else {\n        // FIXME: support all other types\n        throw new Error('Unsupported or invalid type: ' + type);\n    }\n};\n\n\nvar _processSoliditySha3Args = function (arg) {\n    /*jshint maxcomplexity:false */\n\n    if(_.isArray(arg)) {\n        throw new Error('Autodetection of array types is not supported.');\n    }\n\n    var type, value = '';\n    var hexArg, arraySize;\n\n    // if type is given\n    if (_.isObject(arg) && (arg.hasOwnProperty('v') || arg.hasOwnProperty('t') || arg.hasOwnProperty('value') || arg.hasOwnProperty('type'))) {\n        type = arg.t || arg.type;\n        value = arg.v || arg.value;\n\n    // otherwise try to guess the type\n    } else {\n\n        type = utils.toHex(arg, true);\n        value = utils.toHex(arg);\n\n        if (!type.startsWith('int') && !type.startsWith('uint')) {\n            type = 'bytes';\n        }\n    }\n\n    if ((type.startsWith('int') || type.startsWith('uint')) &&  typeof value === 'string' && !/^(-)?0x/i.test(value)) {\n        value = new BN(value);\n    }\n\n    // get the array size\n    if(_.isArray(value)) {\n        arraySize = _parseTypeNArray(type);\n        if(arraySize && value.length !== arraySize) {\n            throw new Error(type +' is not matching the given array '+ JSON.stringify(value));\n        } else {\n            arraySize = value.length;\n        }\n    }\n\n\n    if (_.isArray(value)) {\n        hexArg = value.map(function (val) {\n            return _solidityPack(type, val, arraySize).toString('hex').replace('0x','');\n        });\n        return hexArg.join('');\n    } else {\n        hexArg = _solidityPack(type, value, arraySize);\n        return hexArg.toString('hex').replace('0x','');\n    }\n\n};\n\n/**\n * Hashes solidity values to a sha3 hash using keccak 256\n *\n * @method soliditySha3\n * @return {Object} the sha3\n */\nvar soliditySha3 = function () {\n    /*jshint maxcomplexity:false */\n\n    var args = Array.prototype.slice.call(arguments);\n\n    var hexArgs = _.map(args, _processSoliditySha3Args);\n\n    // console.log(args, hexArgs);\n    // console.log('0x'+ hexArgs.join(''));\n\n    return utils.sha3('0x'+ hexArgs.join(''));\n};\n\n\nmodule.exports = soliditySha3;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3-utils/src/soliditySha3.js\n// module id = 1295\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3-utils/src/soliditySha3.js")},function(module,exports){eval('module.exports = {"_args":[["web3@1.0.0-beta.30","/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib"]],"_from":"web3@1.0.0-beta.30","_id":"web3@1.0.0-beta.30","_inBundle":false,"_integrity":"sha1-rT52GEWusvQKd2DN51eTdzpDHs0=","_location":"/web3","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"web3@1.0.0-beta.30","name":"web3","escapedName":"web3","rawSpec":"1.0.0-beta.30","saveSpec":null,"fetchSpec":"1.0.0-beta.30"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.30.tgz","_spec":"1.0.0-beta.30","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib","author":{"name":"ethereum.org"},"authors":[{"name":"Fabian Vogelsteller","email":"fabian@ethereum.org","homepage":"http://frozeman.de"},{"name":"Marek Kotewicz","email":"marek@parity.io","url":"https://github.com/debris"},{"name":"Marian Oancea","url":"https://github.com/cubedro"},{"name":"Gav Wood","email":"g@parity.io","homepage":"http://gavwood.com"},{"name":"Jeffery Wilcke","email":"jeffrey.wilcke@ethereum.org","url":"https://github.com/obscuren"}],"bugs":{"url":"https://github.com/ethereum/web3.js/issues"},"dependencies":{"web3-bzz":"1.0.0-beta.30","web3-core":"1.0.0-beta.30","web3-eth":"1.0.0-beta.30","web3-eth-personal":"1.0.0-beta.30","web3-net":"1.0.0-beta.30","web3-shh":"1.0.0-beta.30","web3-utils":"1.0.0-beta.30"},"description":"Ethereum JavaScript API","keywords":["Ethereum","JavaScript","API"],"license":"LGPL-3.0","main":"src/index.js","name":"web3","namespace":"ethereum","repository":{"type":"git","url":"https://github.com/ethereum/web3.js/tree/master/packages/web3"},"types":"index.d.ts","version":"1.0.0-beta.30"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3/package.json\n// module id = 1296\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3/package.json')},function(module,exports,__webpack_require__){"use strict";eval("/*\n    This file is part of web3.js.\n\n    web3.js is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Lesser General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    web3.js is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Lesser General Public License for more details.\n\n    You should have received a copy of the GNU Lesser General Public License\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\n*/\n/**\n * @file index.js\n * @authors:\n *   Fabian Vogelsteller <fabian@ethereum.org>\n *   Gav Wood <gav@parity.io>\n *   Jeffrey Wilcke <jeffrey.wilcke@ethereum.org>\n *   Marek Kotewicz <marek@parity.io>\n *   Marian Oancea <marian@ethereum.org>\n * @date 2017\n */\n\n\n\n\nvar version = __webpack_require__(1296).version;\nvar core = __webpack_require__(106);\nvar Eth = __webpack_require__(1290);\nvar Net = __webpack_require__(211);\nvar Personal = __webpack_require__(560);\nvar Shh = __webpack_require__(1294);\nvar Bzz = __webpack_require__(1266);\nvar utils = __webpack_require__(47);\n\nvar Web3 = function Web3() {\n    var _this = this;\n\n    // sets _requestmanager etc\n    core.packageInit(this, arguments);\n\n    this.version = version;\n    this.utils = utils;\n\n    this.eth = new Eth(this);\n    this.shh = new Shh(this);\n    this.bzz = new Bzz(this);\n\n    // overwrite package setProvider\n    var setProvider = this.setProvider;\n    this.setProvider = function (provider, net) {\n        setProvider.apply(_this, arguments);\n\n        this.eth.setProvider(provider, net);\n        this.shh.setProvider(provider, net);\n        this.bzz.setProvider(provider);\n\n        return true;\n    };\n};\n\nWeb3.version = version;\nWeb3.utils = utils;\nWeb3.modules = {\n    Eth: Eth,\n    Net: Net,\n    Personal: Personal,\n    Shh: Shh,\n    Bzz: Bzz\n};\n\ncore.addProviders(Web3);\n\nmodule.exports = Web3;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/web3/src/index.js\n// module id = 1297\n// module chunks = 0\n\n//# sourceURL=../node_modules/web3/src/index.js")},function(module,exports){eval("/**\n * @file Web Cryptography API shim\n * @author Artem S Vybornov <vybornov@gmail.com>\n * @license MIT\n */\nmodule.exports = function webcryptoShim (global) {\n    'use strict';\n\n    if ( typeof Promise !== 'function' )\n        throw \"Promise support required\";\n\n    var _crypto = global.crypto || global.msCrypto;\n    if ( !_crypto ) return;\n\n    var _subtle = _crypto.subtle || _crypto.webkitSubtle;\n    if ( !_subtle ) return;\n\n    var _Crypto     = global.Crypto || _crypto.constructor || Object,\n        _SubtleCrypto = global.SubtleCrypto || _subtle.constructor || Object,\n        _CryptoKey  = global.CryptoKey || global.Key || Object;\n\n    var isEdge = global.navigator.userAgent.indexOf('Edge/') > -1\n    var isIE    = !!global.msCrypto && !isEdge,\n        isWebkit = !_crypto.subtle && !!_crypto.webkitSubtle;\n    if ( !isIE && !isWebkit ) return;\n\n    function s2a ( s ) {\n        return btoa(s).replace(/\\=+$/, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n    }\n\n    function a2s ( s ) {\n        s += '===', s = s.slice( 0, -s.length % 4 );\n        return atob( s.replace(/-/g, '+').replace(/_/g, '/') );\n    }\n\n    function s2b ( s ) {\n        var b = new Uint8Array(s.length);\n        for ( var i = 0; i < s.length; i++ ) b[i] = s.charCodeAt(i);\n        return b;\n    }\n\n    function b2s ( b ) {\n        if ( b instanceof ArrayBuffer ) b = new Uint8Array(b);\n        return String.fromCharCode.apply( String, b );\n    }\n\n    function alg ( a ) {\n        var r = { 'name': (a.name || a || '').toUpperCase().replace('V','v') };\n        switch ( r.name ) {\n            case 'SHA-1':\n            case 'SHA-256':\n            case 'SHA-384':\n            case 'SHA-512':\n                break;\n            case 'AES-CBC':\n            case 'AES-GCM':\n            case 'AES-KW':\n                if ( a.length ) r['length'] = a.length;\n                break;\n            case 'HMAC':\n                if ( a.hash ) r['hash'] = alg(a.hash);\n                if ( a.length ) r['length'] = a.length;\n                break;\n            case 'RSAES-PKCS1-v1_5':\n                if ( a.publicExponent ) r['publicExponent'] = new Uint8Array(a.publicExponent);\n                if ( a.modulusLength ) r['modulusLength'] = a.modulusLength;\n                break;\n            case 'RSASSA-PKCS1-v1_5':\n            case 'RSA-OAEP':\n                if ( a.hash ) r['hash'] = alg(a.hash);\n                if ( a.publicExponent ) r['publicExponent'] = new Uint8Array(a.publicExponent);\n                if ( a.modulusLength ) r['modulusLength'] = a.modulusLength;\n                break;\n            default:\n                throw new SyntaxError(\"Bad algorithm name\");\n        }\n        return r;\n    };\n\n    function jwkAlg ( a ) {\n        return {\n            'HMAC': {\n                'SHA-1': 'HS1',\n                'SHA-256': 'HS256',\n                'SHA-384': 'HS384',\n                'SHA-512': 'HS512',\n            },\n            'RSASSA-PKCS1-v1_5': {\n                'SHA-1': 'RS1',\n                'SHA-256': 'RS256',\n                'SHA-384': 'RS384',\n                'SHA-512': 'RS512',\n            },\n            'RSAES-PKCS1-v1_5': {\n                '': 'RSA1_5',\n            },\n            'RSA-OAEP': {\n                'SHA-1': 'RSA-OAEP',\n                'SHA-256': 'RSA-OAEP-256',\n            },\n            'AES-KW': {\n                '128': 'A128KW',\n                '192': 'A192KW',\n                '256': 'A256KW',\n            },\n            'AES-GCM': {\n                '128': 'A128GCM',\n                '192': 'A192GCM',\n                '256': 'A256GCM',\n            },\n            'AES-CBC': {\n                '128': 'A128CBC',\n                '192': 'A192CBC',\n                '256': 'A256CBC',\n            },\n        }[a.name][ ( a.hash || {} ).name || a.length || '' ];\n    }\n\n    function b2jwk ( k ) {\n        if ( k instanceof ArrayBuffer || k instanceof Uint8Array ) k = JSON.parse( decodeURIComponent( escape( b2s(k) ) ) );\n        var jwk = { 'kty': k.kty, 'alg': k.alg, 'ext': k.ext || k.extractable };\n        switch ( jwk.kty ) {\n            case 'oct':\n                jwk.k = k.k;\n            case 'RSA':\n                [ 'n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi', 'oth' ].forEach( function ( x ) { if ( x in k ) jwk[x] = k[x] } );\n                break;\n            default:\n                throw new TypeError(\"Unsupported key type\");\n        }\n        return jwk;\n    }\n\n    function jwk2b ( k ) {\n        var jwk = b2jwk(k);\n        if ( isIE ) jwk['extractable'] = jwk.ext, delete jwk.ext;\n        return s2b( unescape( encodeURIComponent( JSON.stringify(jwk) ) ) ).buffer;\n    }\n\n    function pkcs2jwk ( k ) {\n        var info = b2der(k), prv = false;\n        if ( info.length > 2 ) prv = true, info.shift(); // remove version from PKCS#8 PrivateKeyInfo structure\n        var jwk = { 'ext': true };\n        switch ( info[0][0] ) {\n            case '1.2.840.113549.1.1.1':\n                var rsaComp = [ 'n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi' ],\n                    rsaKey  = b2der( info[1] );\n                if ( prv ) rsaKey.shift(); // remove version from PKCS#1 RSAPrivateKey structure\n                for ( var i = 0; i < rsaKey.length; i++ ) {\n                    if ( !rsaKey[i][0] ) rsaKey[i] = rsaKey[i].subarray(1);\n                    jwk[ rsaComp[i] ] = s2a( b2s( rsaKey[i] ) );\n                }\n                jwk['kty'] = 'RSA';\n                break;\n            default:\n                throw new TypeError(\"Unsupported key type\");\n        }\n        return jwk;\n    }\n\n    function jwk2pkcs ( k ) {\n        var key, info = [ [ '', null ] ], prv = false;\n        switch ( k.kty ) {\n            case 'RSA':\n                var rsaComp = [ 'n', 'e', 'd', 'p', 'q', 'dp', 'dq', 'qi' ],\n                    rsaKey = [];\n                for ( var i = 0; i < rsaComp.length; i++ ) {\n                    if ( !( rsaComp[i] in k ) ) break;\n                    var b = rsaKey[i] = s2b( a2s( k[ rsaComp[i] ] ) );\n                    if ( b[0] & 0x80 ) rsaKey[i] = new Uint8Array(b.length + 1), rsaKey[i].set( b, 1 );\n                }\n                if ( rsaKey.length > 2 ) prv = true, rsaKey.unshift( new Uint8Array([0]) ); // add version to PKCS#1 RSAPrivateKey structure\n                info[0][0] = '1.2.840.113549.1.1.1';\n                key = rsaKey;\n                break;\n            default:\n                throw new TypeError(\"Unsupported key type\");\n        }\n        info.push( new Uint8Array( der2b(key) ).buffer );\n        if ( !prv ) info[1] = { 'tag': 0x03, 'value': info[1] };\n        else info.unshift( new Uint8Array([0]) ); // add version to PKCS#8 PrivateKeyInfo structure\n        return new Uint8Array( der2b(info) ).buffer;\n    }\n\n    var oid2str = { 'KoZIhvcNAQEB': '1.2.840.113549.1.1.1' },\n        str2oid = { '1.2.840.113549.1.1.1': 'KoZIhvcNAQEB' };\n\n    function b2der ( buf, ctx ) {\n        if ( buf instanceof ArrayBuffer ) buf = new Uint8Array(buf);\n        if ( !ctx ) ctx = { pos: 0, end: buf.length };\n\n        if ( ctx.end - ctx.pos < 2 || ctx.end > buf.length ) throw new RangeError(\"Malformed DER\");\n\n        var tag = buf[ctx.pos++],\n            len = buf[ctx.pos++];\n\n        if ( len >= 0x80 ) {\n            len &= 0x7f;\n            if ( ctx.end - ctx.pos < len ) throw new RangeError(\"Malformed DER\");\n            for ( var xlen = 0; len--; ) xlen <<= 8, xlen |= buf[ctx.pos++];\n            len = xlen;\n        }\n\n        if ( ctx.end - ctx.pos < len ) throw new RangeError(\"Malformed DER\");\n\n        var rv;\n\n        switch ( tag ) {\n            case 0x02: // Universal Primitive INTEGER\n                rv = buf.subarray( ctx.pos, ctx.pos += len );\n                break;\n            case 0x03: // Universal Primitive BIT STRING\n                if ( buf[ctx.pos++] ) throw new Error( \"Unsupported bit string\" );\n                len--;\n            case 0x04: // Universal Primitive OCTET STRING\n                rv = new Uint8Array( buf.subarray( ctx.pos, ctx.pos += len ) ).buffer;\n                break;\n            case 0x05: // Universal Primitive NULL\n                rv = null;\n                break;\n            case 0x06: // Universal Primitive OBJECT IDENTIFIER\n                var oid = btoa( b2s( buf.subarray( ctx.pos, ctx.pos += len ) ) );\n                if ( !( oid in oid2str ) ) throw new Error( \"Unsupported OBJECT ID \" + oid );\n                rv = oid2str[oid];\n                break;\n            case 0x30: // Universal Constructed SEQUENCE\n                rv = [];\n                for ( var end = ctx.pos + len; ctx.pos < end; ) rv.push( b2der( buf, ctx ) );\n                break;\n            default:\n                throw new Error( \"Unsupported DER tag 0x\" + tag.toString(16) );\n        }\n\n        return rv;\n    }\n\n    function der2b ( val, buf ) {\n        if ( !buf ) buf = [];\n\n        var tag = 0, len = 0,\n            pos = buf.length + 2;\n\n        buf.push( 0, 0 ); // placeholder\n\n        if ( val instanceof Uint8Array ) {  // Universal Primitive INTEGER\n            tag = 0x02, len = val.length;\n            for ( var i = 0; i < len; i++ ) buf.push( val[i] );\n        }\n        else if ( val instanceof ArrayBuffer ) { // Universal Primitive OCTET STRING\n            tag = 0x04, len = val.byteLength, val = new Uint8Array(val);\n            for ( var i = 0; i < len; i++ ) buf.push( val[i] );\n        }\n        else if ( val === null ) { // Universal Primitive NULL\n            tag = 0x05, len = 0;\n        }\n        else if ( typeof val === 'string' && val in str2oid ) { // Universal Primitive OBJECT IDENTIFIER\n            var oid = s2b( atob( str2oid[val] ) );\n            tag = 0x06, len = oid.length;\n            for ( var i = 0; i < len; i++ ) buf.push( oid[i] );\n        }\n        else if ( val instanceof Array ) { // Universal Constructed SEQUENCE\n            for ( var i = 0; i < val.length; i++ ) der2b( val[i], buf );\n            tag = 0x30, len = buf.length - pos;\n        }\n        else if ( typeof val === 'object' && val.tag === 0x03 && val.value instanceof ArrayBuffer ) { // Tag hint\n            val = new Uint8Array(val.value), tag = 0x03, len = val.byteLength;\n            buf.push(0); for ( var i = 0; i < len; i++ ) buf.push( val[i] );\n            len++;\n        }\n        else {\n            throw new Error( \"Unsupported DER value \" + val );\n        }\n\n        if ( len >= 0x80 ) {\n            var xlen = len, len = 4;\n            buf.splice( pos, 0, (xlen >> 24) & 0xff, (xlen >> 16) & 0xff, (xlen >> 8) & 0xff, xlen & 0xff );\n            while ( len > 1 && !(xlen >> 24) ) xlen <<= 8, len--;\n            if ( len < 4 ) buf.splice( pos, 4 - len );\n            len |= 0x80;\n        }\n\n        buf.splice( pos - 2, 2, tag, len );\n\n        return buf;\n    }\n\n    function CryptoKey ( key, alg, ext, use ) {\n        Object.defineProperties( this, {\n            _key: {\n                value: key\n            },\n            type: {\n                value: key.type,\n                enumerable: true,\n            },\n            extractable: {\n                value: (ext === undefined) ? key.extractable : ext,\n                enumerable: true,\n            },\n            algorithm: {\n                value: (alg === undefined) ? key.algorithm : alg,\n                enumerable: true,\n            },\n            usages: {\n                value: (use === undefined) ? key.usages : use,\n                enumerable: true,\n            },\n        });\n    }\n\n    function isPubKeyUse ( u ) {\n        return u === 'verify' || u === 'encrypt' || u === 'wrapKey';\n    }\n\n    function isPrvKeyUse ( u ) {\n        return u === 'sign' || u === 'decrypt' || u === 'unwrapKey';\n    }\n\n    [ 'generateKey', 'importKey', 'unwrapKey' ]\n        .forEach( function ( m ) {\n            var _fn = _subtle[m];\n\n            _subtle[m] = function ( a, b, c ) {\n                var args = [].slice.call(arguments),\n                    ka, kx, ku;\n\n                switch ( m ) {\n                    case 'generateKey':\n                        ka = alg(a), kx = b, ku = c;\n                        break;\n                    case 'importKey':\n                        ka = alg(c), kx = args[3], ku = args[4];\n                        if ( a === 'jwk' ) {\n                            b = b2jwk(b);\n                            if ( !b.alg ) b.alg = jwkAlg(ka);\n                            if ( !b.key_ops ) b.key_ops = ( b.kty !== 'oct' ) ? ( 'd' in b ) ? ku.filter(isPrvKeyUse) : ku.filter(isPubKeyUse) : ku.slice();\n                            args[1] = jwk2b(b);\n                        }\n                        break;\n                    case 'unwrapKey':\n                        ka = args[4], kx = args[5], ku = args[6];\n                        args[2] = c._key;\n                        break;\n                }\n\n                if ( m === 'generateKey' && ka.name === 'HMAC' && ka.hash ) {\n                    ka.length = ka.length || { 'SHA-1': 512, 'SHA-256': 512, 'SHA-384': 1024, 'SHA-512': 1024 }[ka.hash.name];\n                    return _subtle.importKey( 'raw', _crypto.getRandomValues( new Uint8Array( (ka.length+7)>>3 ) ), ka, kx, ku );\n                }\n\n                if ( isWebkit && m === 'generateKey' && ka.name === 'RSASSA-PKCS1-v1_5' && ( !ka.modulusLength || ka.modulusLength >= 2048 ) ) {\n                    a = alg(a), a.name = 'RSAES-PKCS1-v1_5', delete a.hash;\n                    return _subtle.generateKey( a, true, [ 'encrypt', 'decrypt' ] )\n                        .then( function ( k ) {\n                            return Promise.all([\n                                _subtle.exportKey( 'jwk', k.publicKey ),\n                                _subtle.exportKey( 'jwk', k.privateKey ),\n                            ]);\n                        })\n                        .then( function ( keys ) {\n                            keys[0].alg = keys[1].alg = jwkAlg(ka);\n                            keys[0].key_ops = ku.filter(isPubKeyUse), keys[1].key_ops = ku.filter(isPrvKeyUse);\n                            return Promise.all([\n                                _subtle.importKey( 'jwk', keys[0], ka, true, keys[0].key_ops ),\n                                _subtle.importKey( 'jwk', keys[1], ka, kx, keys[1].key_ops ),\n                            ]);\n                        })\n                        .then( function ( keys ) {\n                            return {\n                                publicKey: keys[0],\n                                privateKey: keys[1],\n                            };\n                        });\n                }\n\n                if ( ( isWebkit || ( isIE && ( ka.hash || {} ).name === 'SHA-1' ) )\n                        && m === 'importKey' && a === 'jwk' && ka.name === 'HMAC' && b.kty === 'oct' ) {\n                    return _subtle.importKey( 'raw', s2b( a2s(b.k) ), c, args[3], args[4] );\n                }\n\n                if ( isWebkit && m === 'importKey' && ( a === 'spki' || a === 'pkcs8' ) ) {\n                    return _subtle.importKey( 'jwk', pkcs2jwk(b), c, args[3], args[4] );\n                }\n\n                if ( isIE && m === 'unwrapKey' ) {\n                    return _subtle.decrypt( args[3], c, b )\n                        .then( function ( k ) {\n                            return _subtle.importKey( a, k, args[4], args[5], args[6] );\n                        });\n                }\n\n                var op;\n                try {\n                    op = _fn.apply( _subtle, args );\n                }\n                catch ( e ) {\n                    return Promise.reject(e);\n                }\n\n                if ( isIE ) {\n                    op = new Promise( function ( res, rej ) {\n                        op.onabort =\n                        op.onerror =    function ( e ) { rej(e)               };\n                        op.oncomplete = function ( r ) { res(r.target.result) };\n                    });\n                }\n\n                op = op.then( function ( k ) {\n                    if ( ka.name === 'HMAC' ) {\n                        if ( !ka.length ) ka.length = 8 * k.algorithm.length;\n                    }\n                    if ( ka.name.search('RSA') == 0 ) {\n                        if ( !ka.modulusLength ) ka.modulusLength = (k.publicKey || k).algorithm.modulusLength;\n                        if ( !ka.publicExponent ) ka.publicExponent = (k.publicKey || k).algorithm.publicExponent;\n                    }\n                    if ( k.publicKey && k.privateKey ) {\n                        k = {\n                            publicKey: new CryptoKey( k.publicKey, ka, kx, ku.filter(isPubKeyUse) ),\n                            privateKey: new CryptoKey( k.privateKey, ka, kx, ku.filter(isPrvKeyUse) ),\n                        };\n                    }\n                    else {\n                        k = new CryptoKey( k, ka, kx, ku );\n                    }\n                    return k;\n                });\n\n                return op;\n            }\n        });\n\n    [ 'exportKey', 'wrapKey' ]\n        .forEach( function ( m ) {\n            var _fn = _subtle[m];\n\n            _subtle[m] = function ( a, b, c ) {\n                var args = [].slice.call(arguments);\n\n                switch ( m ) {\n                    case 'exportKey':\n                        args[1] = b._key;\n                        break;\n                    case 'wrapKey':\n                        args[1] = b._key, args[2] = c._key;\n                        break;\n                }\n\n                if ( ( isWebkit || ( isIE && ( b.algorithm.hash || {} ).name === 'SHA-1' ) )\n                        && m === 'exportKey' && a === 'jwk' && b.algorithm.name === 'HMAC' ) {\n                    args[0] = 'raw';\n                }\n\n                if ( isWebkit && m === 'exportKey' && ( a === 'spki' || a === 'pkcs8' ) ) {\n                    args[0] = 'jwk';\n                }\n\n                if ( isIE && m === 'wrapKey' ) {\n                    return _subtle.exportKey( a, b )\n                        .then( function ( k ) {\n                            if ( a === 'jwk' ) k = s2b( unescape( encodeURIComponent( JSON.stringify( b2jwk(k) ) ) ) );\n                            return  _subtle.encrypt( args[3], c, k );\n                        });\n                }\n\n                var op;\n                try {\n                    op = _fn.apply( _subtle, args );\n                }\n                catch ( e ) {\n                    return Promise.reject(e);\n                }\n\n                if ( isIE ) {\n                    op = new Promise( function ( res, rej ) {\n                        op.onabort =\n                        op.onerror =    function ( e ) { rej(e)               };\n                        op.oncomplete = function ( r ) { res(r.target.result) };\n                    });\n                }\n\n                if ( m === 'exportKey' && a === 'jwk' ) {\n                    op = op.then( function ( k ) {\n                        if ( ( isWebkit || ( isIE && ( b.algorithm.hash || {} ).name === 'SHA-1' ) )\n                                && b.algorithm.name === 'HMAC') {\n                            return { 'kty': 'oct', 'alg': jwkAlg(b.algorithm), 'key_ops': b.usages.slice(), 'ext': true, 'k': s2a( b2s(k) ) };\n                        }\n                        k = b2jwk(k);\n                        if ( !k.alg ) k['alg'] = jwkAlg(b.algorithm);\n                        if ( !k.key_ops ) k['key_ops'] = ( b.type === 'public' ) ? b.usages.filter(isPubKeyUse) : ( b.type === 'private' ) ? b.usages.filter(isPrvKeyUse) : b.usages.slice();\n                        return k;\n                    });\n                }\n\n                if ( isWebkit && m === 'exportKey' && ( a === 'spki' || a === 'pkcs8' ) ) {\n                    op = op.then( function ( k ) {\n                        k = jwk2pkcs( b2jwk(k) );\n                        return k;\n                    });\n                }\n\n                return op;\n            }\n        });\n\n    [ 'encrypt', 'decrypt', 'sign', 'verify' ]\n        .forEach( function ( m ) {\n            var _fn = _subtle[m];\n\n            _subtle[m] = function ( a, b, c, d ) {\n                if ( isIE && ( !c.byteLength || ( d && !d.byteLength ) ) )\n                    throw new Error(\"Empy input is not allowed\");\n\n                var args = [].slice.call(arguments),\n                    ka = alg(a);\n\n                if ( isIE && m === 'decrypt' && ka.name === 'AES-GCM' ) {\n                    var tl = a.tagLength >> 3;\n                    args[2] = (c.buffer || c).slice( 0, c.byteLength - tl ),\n                    a.tag = (c.buffer || c).slice( c.byteLength - tl );\n                }\n\n                args[1] = b._key;\n\n                var op;\n                try {\n                    op = _fn.apply( _subtle, args );\n                }\n                catch ( e ) {\n                    return Promise.reject(e);\n                }\n\n                if ( isIE ) {\n                    op = new Promise( function ( res, rej ) {\n                        op.onabort =\n                        op.onerror = function ( e ) {\n                            rej(e);\n                        };\n\n                        op.oncomplete = function ( r ) {\n                            var r = r.target.result;\n\n                            if ( m === 'encrypt' && r instanceof AesGcmEncryptResult ) {\n                                var c = r.ciphertext, t = r.tag;\n                                r = new Uint8Array( c.byteLength + t.byteLength );\n                                r.set( new Uint8Array(c), 0 );\n                                r.set( new Uint8Array(t), c.byteLength );\n                                r = r.buffer;\n                            }\n\n                            res(r);\n                        };\n                    });\n                }\n\n                return op;\n            }\n        });\n\n    if ( isIE ) {\n        var _digest = _subtle.digest;\n\n        _subtle['digest'] = function ( a, b ) {\n            if ( !b.byteLength )\n                throw new Error(\"Empy input is not allowed\");\n\n            var op;\n            try {\n                op = _digest.call( _subtle, a, b );\n            }\n            catch ( e ) {\n                return Promise.reject(e);\n            }\n\n            op = new Promise( function ( res, rej ) {\n                op.onabort =\n                op.onerror =    function ( e ) { rej(e)               };\n                op.oncomplete = function ( r ) { res(r.target.result) };\n            });\n\n            return op;\n        };\n\n        global.crypto = Object.create( _crypto, {\n            getRandomValues: { value: function ( a ) { return _crypto.getRandomValues(a) } },\n            subtle:          { value: _subtle },\n        });\n\n        global.CryptoKey = CryptoKey;\n    }\n\n    if ( isWebkit ) {\n        _crypto.subtle = _subtle;\n\n        global.Crypto = _Crypto;\n        global.SubtleCrypto = _SubtleCrypto;\n        global.CryptoKey = CryptoKey;\n    }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/webcrypto-shim/webcrypto-shim.js\n// module id = 1298\n// module chunks = 0\n\n//# sourceURL=../node_modules/webcrypto-shim/webcrypto-shim.js")},function(module,exports){eval("/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {/* globals __webpack_amd_options__ */\r\nmodule.exports = __webpack_amd_options__;\r\n\n/* WEBPACK VAR INJECTION */}.call(exports, {}))\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/amd-options.js\n// module id = 1299\n// module chunks = 0\n\n//# sourceURL=../node_modules/webpack/buildin/amd-options.js")},function(module,exports){eval("/* global self */\n\n// created by @HenrikJoreteg\nvar prefix\nvar version\n\nif (self.mozRTCPeerConnection || navigator.mozGetUserMedia) {\n  prefix = 'moz'\n  version = parseInt(navigator.userAgent.match(/Firefox\\/([0-9]+)\\./)[1], 10)\n} else if (self.webkitRTCPeerConnection || navigator.webkitGetUserMedia) {\n  prefix = 'webkit'\n  version = navigator.userAgent.match(/Chrom(e|ium)/) && parseInt(navigator.userAgent.match(/Chrom(e|ium)\\/([0-9]+)\\./)[2], 10)\n}\n\nvar PC = self.RTCPeerConnection || self.mozRTCPeerConnection || self.webkitRTCPeerConnection\nvar IceCandidate = self.mozRTCIceCandidate || self.RTCIceCandidate\nvar SessionDescription = self.mozRTCSessionDescription || self.RTCSessionDescription\nvar MediaStream = self.webkitMediaStream || self.MediaStream\nvar screenSharing = self.location.protocol === 'https:' &&\n    ((prefix === 'webkit' && version >= 26) ||\n     (prefix === 'moz' && version >= 33))\nvar AudioContext = self.AudioContext || self.webkitAudioContext\nvar videoEl = self.document && document.createElement('video')\nvar supportVp8 = videoEl && videoEl.canPlayType && videoEl.canPlayType('video/webm; codecs=\"vp8\", vorbis') === 'probably'\nvar getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia\n\n// export support flags and constructors.prototype && PC\nmodule.exports = {\n  prefix: prefix,\n  browserVersion: version,\n  support: !!PC && !!getUserMedia,\n    // new support style\n  supportRTCPeerConnection: !!PC,\n  supportVp8: supportVp8,\n  supportGetUserMedia: !!getUserMedia,\n  supportDataChannel: !!(PC && PC.prototype && PC.prototype.createDataChannel),\n  supportWebAudio: !!(AudioContext && AudioContext.prototype.createMediaStreamSource),\n  supportMediaStream: !!(MediaStream && MediaStream.prototype.removeTrack),\n  supportScreenSharing: !!screenSharing,\n    // constructors\n  AudioContext: AudioContext,\n  PeerConnection: PC,\n  SessionDescription: SessionDescription,\n  IceCandidate: IceCandidate,\n  MediaStream: MediaStream,\n  getUserMedia: getUserMedia\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/webrtcsupport/index-browser.js\n// module id = 1300\n// module chunks = 0\n\n//# sourceURL=../node_modules/webrtcsupport/index-browser.js")},function(module,exports,__webpack_require__){eval("var _global = (function() { return this || {}; })();\nvar NativeWebSocket = _global.WebSocket || _global.MozWebSocket;\nvar websocket_version = __webpack_require__(1302);\n\n\n/**\n * Expose a W3C WebSocket class with just one or two arguments.\n */\nfunction W3CWebSocket(uri, protocols) {\n\tvar native_instance;\n\n\tif (protocols) {\n\t\tnative_instance = new NativeWebSocket(uri, protocols);\n\t}\n\telse {\n\t\tnative_instance = new NativeWebSocket(uri);\n\t}\n\n\t/**\n\t * 'native_instance' is an instance of nativeWebSocket (the browser's WebSocket\n\t * class). Since it is an Object it will be returned as it is when creating an\n\t * instance of W3CWebSocket via 'new W3CWebSocket()'.\n\t *\n\t * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2\n\t */\n\treturn native_instance;\n}\n\n\n/**\n * Module exports.\n */\nmodule.exports = {\n    'w3cwebsocket' : NativeWebSocket ? W3CWebSocket : null,\n    'version'      : websocket_version\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/websocket/lib/browser.js\n// module id = 1301\n// module chunks = 0\n\n//# sourceURL=../node_modules/websocket/lib/browser.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1303).version;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/websocket/lib/version.js\n// module id = 1302\n// module chunks = 0\n\n//# sourceURL=../node_modules/websocket/lib/version.js")},function(module,exports){eval('module.exports = {"_from":"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","_id":"websocket@1.0.24","_inBundle":false,"_location":"/websocket","_phantomChildren":{"is-typedarray":"1.0.0","ms":"2.0.0"},"_requested":{"type":"git","raw":"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","name":"websocket","escapedName":"websocket","rawSpec":"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","saveSpec":"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","fetchSpec":"git://github.com/frozeman/WebSocket-Node.git","gitCommittish":"7004c39c42ac98875ab61126e5b4a925430f592c"},"_requiredBy":["/web3-providers-ws"],"_resolved":"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","_spec":"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib","author":{"name":"Brian McKelvey","email":"brian@worlize.com","url":"https://www.worlize.com/"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/theturtle32/WebSocket-Node/issues"},"bundleDependencies":false,"config":{"verbose":false},"contributors":[{"name":"Iñaki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"debug":"^2.2.0","nan":"^2.3.3","typedarray-to-buffer":"^3.1.2","yaeti":"^0.0.6"},"deprecated":false,"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","faucet":"^0.0.1","gulp":"git+https://github.com/gulpjs/gulp.git#4.0","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.0.1"},"directories":{"lib":"./lib"},"engines":{"node":">=0.8.0"},"homepage":"https://github.com/theturtle32/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","name":"websocket","repository":{"type":"git","url":"git+https://github.com/theturtle32/WebSocket-Node.git"},"scripts":{"gulp":"gulp","install":"(node-gyp rebuild 2> builderror.log) || (exit 0)","test":"faucet test/unit"},"version":"1.0.24"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/websocket/package.json\n// module id = 1303\n// module chunks = 0\n\n//# sourceURL=../node_modules/websocket/package.json')},function(module,exports){eval("(function(self) {\n  'use strict';\n\n  if (self.fetch) {\n    return\n  }\n\n  var support = {\n    searchParams: 'URLSearchParams' in self,\n    iterable: 'Symbol' in self && 'iterator' in Symbol,\n    blob: 'FileReader' in self && 'Blob' in self && (function() {\n      try {\n        new Blob()\n        return true\n      } catch(e) {\n        return false\n      }\n    })(),\n    formData: 'FormData' in self,\n    arrayBuffer: 'ArrayBuffer' in self\n  }\n\n  if (support.arrayBuffer) {\n    var viewClasses = [\n      '[object Int8Array]',\n      '[object Uint8Array]',\n      '[object Uint8ClampedArray]',\n      '[object Int16Array]',\n      '[object Uint16Array]',\n      '[object Int32Array]',\n      '[object Uint32Array]',\n      '[object Float32Array]',\n      '[object Float64Array]'\n    ]\n\n    var isDataView = function(obj) {\n      return obj && DataView.prototype.isPrototypeOf(obj)\n    }\n\n    var isArrayBufferView = ArrayBuffer.isView || function(obj) {\n      return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n    }\n  }\n\n  function normalizeName(name) {\n    if (typeof name !== 'string') {\n      name = String(name)\n    }\n    if (/[^a-z0-9\\-#$%&'*+.\\^_`|~]/i.test(name)) {\n      throw new TypeError('Invalid character in header field name')\n    }\n    return name.toLowerCase()\n  }\n\n  function normalizeValue(value) {\n    if (typeof value !== 'string') {\n      value = String(value)\n    }\n    return value\n  }\n\n  // Build a destructive iterator for the value list\n  function iteratorFor(items) {\n    var iterator = {\n      next: function() {\n        var value = items.shift()\n        return {done: value === undefined, value: value}\n      }\n    }\n\n    if (support.iterable) {\n      iterator[Symbol.iterator] = function() {\n        return iterator\n      }\n    }\n\n    return iterator\n  }\n\n  function Headers(headers) {\n    this.map = {}\n\n    if (headers instanceof Headers) {\n      headers.forEach(function(value, name) {\n        this.append(name, value)\n      }, this)\n    } else if (Array.isArray(headers)) {\n      headers.forEach(function(header) {\n        this.append(header[0], header[1])\n      }, this)\n    } else if (headers) {\n      Object.getOwnPropertyNames(headers).forEach(function(name) {\n        this.append(name, headers[name])\n      }, this)\n    }\n  }\n\n  Headers.prototype.append = function(name, value) {\n    name = normalizeName(name)\n    value = normalizeValue(value)\n    var oldValue = this.map[name]\n    this.map[name] = oldValue ? oldValue+','+value : value\n  }\n\n  Headers.prototype['delete'] = function(name) {\n    delete this.map[normalizeName(name)]\n  }\n\n  Headers.prototype.get = function(name) {\n    name = normalizeName(name)\n    return this.has(name) ? this.map[name] : null\n  }\n\n  Headers.prototype.has = function(name) {\n    return this.map.hasOwnProperty(normalizeName(name))\n  }\n\n  Headers.prototype.set = function(name, value) {\n    this.map[normalizeName(name)] = normalizeValue(value)\n  }\n\n  Headers.prototype.forEach = function(callback, thisArg) {\n    for (var name in this.map) {\n      if (this.map.hasOwnProperty(name)) {\n        callback.call(thisArg, this.map[name], name, this)\n      }\n    }\n  }\n\n  Headers.prototype.keys = function() {\n    var items = []\n    this.forEach(function(value, name) { items.push(name) })\n    return iteratorFor(items)\n  }\n\n  Headers.prototype.values = function() {\n    var items = []\n    this.forEach(function(value) { items.push(value) })\n    return iteratorFor(items)\n  }\n\n  Headers.prototype.entries = function() {\n    var items = []\n    this.forEach(function(value, name) { items.push([name, value]) })\n    return iteratorFor(items)\n  }\n\n  if (support.iterable) {\n    Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n  }\n\n  function consumed(body) {\n    if (body.bodyUsed) {\n      return Promise.reject(new TypeError('Already read'))\n    }\n    body.bodyUsed = true\n  }\n\n  function fileReaderReady(reader) {\n    return new Promise(function(resolve, reject) {\n      reader.onload = function() {\n        resolve(reader.result)\n      }\n      reader.onerror = function() {\n        reject(reader.error)\n      }\n    })\n  }\n\n  function readBlobAsArrayBuffer(blob) {\n    var reader = new FileReader()\n    var promise = fileReaderReady(reader)\n    reader.readAsArrayBuffer(blob)\n    return promise\n  }\n\n  function readBlobAsText(blob) {\n    var reader = new FileReader()\n    var promise = fileReaderReady(reader)\n    reader.readAsText(blob)\n    return promise\n  }\n\n  function readArrayBufferAsText(buf) {\n    var view = new Uint8Array(buf)\n    var chars = new Array(view.length)\n\n    for (var i = 0; i < view.length; i++) {\n      chars[i] = String.fromCharCode(view[i])\n    }\n    return chars.join('')\n  }\n\n  function bufferClone(buf) {\n    if (buf.slice) {\n      return buf.slice(0)\n    } else {\n      var view = new Uint8Array(buf.byteLength)\n      view.set(new Uint8Array(buf))\n      return view.buffer\n    }\n  }\n\n  function Body() {\n    this.bodyUsed = false\n\n    this._initBody = function(body) {\n      this._bodyInit = body\n      if (!body) {\n        this._bodyText = ''\n      } else if (typeof body === 'string') {\n        this._bodyText = body\n      } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n        this._bodyBlob = body\n      } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n        this._bodyFormData = body\n      } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n        this._bodyText = body.toString()\n      } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n        this._bodyArrayBuffer = bufferClone(body.buffer)\n        // IE 10-11 can't handle a DataView body.\n        this._bodyInit = new Blob([this._bodyArrayBuffer])\n      } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n        this._bodyArrayBuffer = bufferClone(body)\n      } else {\n        throw new Error('unsupported BodyInit type')\n      }\n\n      if (!this.headers.get('content-type')) {\n        if (typeof body === 'string') {\n          this.headers.set('content-type', 'text/plain;charset=UTF-8')\n        } else if (this._bodyBlob && this._bodyBlob.type) {\n          this.headers.set('content-type', this._bodyBlob.type)\n        } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n          this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n        }\n      }\n    }\n\n    if (support.blob) {\n      this.blob = function() {\n        var rejected = consumed(this)\n        if (rejected) {\n          return rejected\n        }\n\n        if (this._bodyBlob) {\n          return Promise.resolve(this._bodyBlob)\n        } else if (this._bodyArrayBuffer) {\n          return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n        } else if (this._bodyFormData) {\n          throw new Error('could not read FormData body as blob')\n        } else {\n          return Promise.resolve(new Blob([this._bodyText]))\n        }\n      }\n\n      this.arrayBuffer = function() {\n        if (this._bodyArrayBuffer) {\n          return consumed(this) || Promise.resolve(this._bodyArrayBuffer)\n        } else {\n          return this.blob().then(readBlobAsArrayBuffer)\n        }\n      }\n    }\n\n    this.text = function() {\n      var rejected = consumed(this)\n      if (rejected) {\n        return rejected\n      }\n\n      if (this._bodyBlob) {\n        return readBlobAsText(this._bodyBlob)\n      } else if (this._bodyArrayBuffer) {\n        return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n      } else if (this._bodyFormData) {\n        throw new Error('could not read FormData body as text')\n      } else {\n        return Promise.resolve(this._bodyText)\n      }\n    }\n\n    if (support.formData) {\n      this.formData = function() {\n        return this.text().then(decode)\n      }\n    }\n\n    this.json = function() {\n      return this.text().then(JSON.parse)\n    }\n\n    return this\n  }\n\n  // HTTP methods whose capitalization should be normalized\n  var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\n  function normalizeMethod(method) {\n    var upcased = method.toUpperCase()\n    return (methods.indexOf(upcased) > -1) ? upcased : method\n  }\n\n  function Request(input, options) {\n    options = options || {}\n    var body = options.body\n\n    if (input instanceof Request) {\n      if (input.bodyUsed) {\n        throw new TypeError('Already read')\n      }\n      this.url = input.url\n      this.credentials = input.credentials\n      if (!options.headers) {\n        this.headers = new Headers(input.headers)\n      }\n      this.method = input.method\n      this.mode = input.mode\n      if (!body && input._bodyInit != null) {\n        body = input._bodyInit\n        input.bodyUsed = true\n      }\n    } else {\n      this.url = String(input)\n    }\n\n    this.credentials = options.credentials || this.credentials || 'omit'\n    if (options.headers || !this.headers) {\n      this.headers = new Headers(options.headers)\n    }\n    this.method = normalizeMethod(options.method || this.method || 'GET')\n    this.mode = options.mode || this.mode || null\n    this.referrer = null\n\n    if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n      throw new TypeError('Body not allowed for GET or HEAD requests')\n    }\n    this._initBody(body)\n  }\n\n  Request.prototype.clone = function() {\n    return new Request(this, { body: this._bodyInit })\n  }\n\n  function decode(body) {\n    var form = new FormData()\n    body.trim().split('&').forEach(function(bytes) {\n      if (bytes) {\n        var split = bytes.split('=')\n        var name = split.shift().replace(/\\+/g, ' ')\n        var value = split.join('=').replace(/\\+/g, ' ')\n        form.append(decodeURIComponent(name), decodeURIComponent(value))\n      }\n    })\n    return form\n  }\n\n  function parseHeaders(rawHeaders) {\n    var headers = new Headers()\n    rawHeaders.split(/\\r?\\n/).forEach(function(line) {\n      var parts = line.split(':')\n      var key = parts.shift().trim()\n      if (key) {\n        var value = parts.join(':').trim()\n        headers.append(key, value)\n      }\n    })\n    return headers\n  }\n\n  Body.call(Request.prototype)\n\n  function Response(bodyInit, options) {\n    if (!options) {\n      options = {}\n    }\n\n    this.type = 'default'\n    this.status = 'status' in options ? options.status : 200\n    this.ok = this.status >= 200 && this.status < 300\n    this.statusText = 'statusText' in options ? options.statusText : 'OK'\n    this.headers = new Headers(options.headers)\n    this.url = options.url || ''\n    this._initBody(bodyInit)\n  }\n\n  Body.call(Response.prototype)\n\n  Response.prototype.clone = function() {\n    return new Response(this._bodyInit, {\n      status: this.status,\n      statusText: this.statusText,\n      headers: new Headers(this.headers),\n      url: this.url\n    })\n  }\n\n  Response.error = function() {\n    var response = new Response(null, {status: 0, statusText: ''})\n    response.type = 'error'\n    return response\n  }\n\n  var redirectStatuses = [301, 302, 303, 307, 308]\n\n  Response.redirect = function(url, status) {\n    if (redirectStatuses.indexOf(status) === -1) {\n      throw new RangeError('Invalid status code')\n    }\n\n    return new Response(null, {status: status, headers: {location: url}})\n  }\n\n  self.Headers = Headers\n  self.Request = Request\n  self.Response = Response\n\n  self.fetch = function(input, init) {\n    return new Promise(function(resolve, reject) {\n      var request = new Request(input, init)\n      var xhr = new XMLHttpRequest()\n\n      xhr.onload = function() {\n        var options = {\n          status: xhr.status,\n          statusText: xhr.statusText,\n          headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n        }\n        options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n        var body = 'response' in xhr ? xhr.response : xhr.responseText\n        resolve(new Response(body, options))\n      }\n\n      xhr.onerror = function() {\n        reject(new TypeError('Network request failed'))\n      }\n\n      xhr.ontimeout = function() {\n        reject(new TypeError('Network request failed'))\n      }\n\n      xhr.open(request.method, request.url, true)\n\n      if (request.credentials === 'include') {\n        xhr.withCredentials = true\n      }\n\n      if ('responseType' in xhr && support.blob) {\n        xhr.responseType = 'blob'\n      }\n\n      request.headers.forEach(function(value, name) {\n        xhr.setRequestHeader(name, value)\n      })\n\n      xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n    })\n  }\n  self.fetch.polyfill = true\n})(typeof self !== 'undefined' ? self : this);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/whatwg-fetch/fetch.js\n// module id = 1304\n// module chunks = 0\n\n//# sourceURL=../node_modules/whatwg-fetch/fetch.js")},function(module,exports,__webpack_require__){eval("/* WEBPACK VAR INJECTION */(function(Buffer) {var bs58check = __webpack_require__(239)\n\nfunction decodeRaw (buffer, version) {\n  // check version only if defined\n  if (version !== undefined && buffer[0] !== version) throw new Error('Invalid network version')\n\n  // uncompressed\n  if (buffer.length === 33) {\n    return {\n      version: buffer[0],\n      privateKey: buffer.slice(1, 33),\n      compressed: false\n    }\n  }\n\n  // invalid length\n  if (buffer.length !== 34) throw new Error('Invalid WIF length')\n\n  // invalid compression flag\n  if (buffer[33] !== 0x01) throw new Error('Invalid compression flag')\n\n  return {\n    version: buffer[0],\n    privateKey: buffer.slice(1, 33),\n    compressed: true\n  }\n}\n\nfunction encodeRaw (version, privateKey, compressed) {\n  var result = new Buffer(compressed ? 34 : 33)\n\n  result.writeUInt8(version, 0)\n  privateKey.copy(result, 1)\n\n  if (compressed) {\n    result[33] = 0x01\n  }\n\n  return result\n}\n\nfunction decode (string, version) {\n  return decodeRaw(bs58check.decode(string), version)\n}\n\nfunction encode (version, privateKey, compressed) {\n  if (typeof version === 'number') return bs58check.encode(encodeRaw(version, privateKey, compressed))\n\n  return bs58check.encode(\n    encodeRaw(\n      version.version,\n      version.privateKey,\n      version.compressed\n    )\n  )\n}\n\nmodule.exports = {\n  decode: decode,\n  decodeRaw: decodeRaw,\n  encode: encode,\n  encodeRaw: encodeRaw\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/wif/index.js\n// module id = 1305\n// module chunks = 0\n\n//# sourceURL=../node_modules/wif/index.js")},function(module,exports,__webpack_require__){eval('module.exports = function() {\n  return __webpack_require__(1307)("!function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};__webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,\\"a\\",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p=\\"/\\",__webpack_require__(__webpack_require__.s=173)}([function(module,exports){eval(\\"if (typeof Object.create === \'function\') {\\\\n  // implementation from standard node.js \'util\' module\\\\n  module.exports = function inherits(ctor, superCtor) {\\\\n    ctor.super_ = superCtor\\\\n    ctor.prototype = Object.create(superCtor.prototype, {\\\\n      constructor: {\\\\n        value: ctor,\\\\n        enumerable: false,\\\\n        writable: true,\\\\n        configurable: true\\\\n      }\\\\n    });\\\\n  };\\\\n} else {\\\\n  // old school shim for old browsers\\\\n  module.exports = function inherits(ctor, superCtor) {\\\\n    ctor.super_ = superCtor\\\\n    var TempCtor = function () {}\\\\n    TempCtor.prototype = superCtor.prototype\\\\n    ctor.prototype = new TempCtor()\\\\n    ctor.prototype.constructor = ctor\\\\n  }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/inherits/inherits_browser.js\\\\n// module id = 0\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/inherits/inherits_browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(global) {/*!\\\\n * The buffer module from node.js, for the browser.\\\\n *\\\\n * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\\\\n * @license  MIT\\\\n */\\\\n/* eslint-disable no-proto */\\\\n\\\\n\\\\n\\\\nvar base64 = __webpack_require__(180)\\\\nvar ieee754 = __webpack_require__(277)\\\\nvar isArray = __webpack_require__(134)\\\\n\\\\nexports.Buffer = Buffer\\\\nexports.SlowBuffer = SlowBuffer\\\\nexports.INSPECT_MAX_BYTES = 50\\\\n\\\\n/**\\\\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\\\\n *   === true    Use Uint8Array implementation (fastest)\\\\n *   === false   Use Object implementation (most compatible, even IE6)\\\\n *\\\\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\\\\n * Opera 11.6+, iOS 4.2+.\\\\n *\\\\n * Due to various browser bugs, sometimes the Object implementation will be used even\\\\n * when the browser supports typed arrays.\\\\n *\\\\n * Note:\\\\n *\\\\n *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\\\\n *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\\\\n *\\\\n *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\\\\n *\\\\n *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\\\\n *     incorrect length in some situations.\\\\n\\\\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\\\\n * get the Object implementation, which is slower but behaves correctly.\\\\n */\\\\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\\\\n  ? global.TYPED_ARRAY_SUPPORT\\\\n  : typedArraySupport()\\\\n\\\\n/*\\\\n * Export kMaxLength after typed array support is determined.\\\\n */\\\\nexports.kMaxLength = kMaxLength()\\\\n\\\\nfunction typedArraySupport () {\\\\n  try {\\\\n    var arr = new Uint8Array(1)\\\\n    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\\\\n    return arr.foo() === 42 && // typed array instances can be augmented\\\\n        typeof arr.subarray === \'function\' && // chrome 9-10 lack `subarray`\\\\n        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\\\\n  } catch (e) {\\\\n    return false\\\\n  }\\\\n}\\\\n\\\\nfunction kMaxLength () {\\\\n  return Buffer.TYPED_ARRAY_SUPPORT\\\\n    ? 0x7fffffff\\\\n    : 0x3fffffff\\\\n}\\\\n\\\\nfunction createBuffer (that, length) {\\\\n  if (kMaxLength() < length) {\\\\n    throw new RangeError(\'Invalid typed array length\')\\\\n  }\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    // Return an augmented `Uint8Array` instance, for best performance\\\\n    that = new Uint8Array(length)\\\\n    that.__proto__ = Buffer.prototype\\\\n  } else {\\\\n    // Fallback: Return an object instance of the Buffer class\\\\n    if (that === null) {\\\\n      that = new Buffer(length)\\\\n    }\\\\n    that.length = length\\\\n  }\\\\n\\\\n  return that\\\\n}\\\\n\\\\n/**\\\\n * The Buffer constructor returns instances of `Uint8Array` that have their\\\\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\\\\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\\\\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\\\\n * returns a single octet.\\\\n *\\\\n * The `Uint8Array` prototype remains unmodified.\\\\n */\\\\n\\\\nfunction Buffer (arg, encodingOrOffset, length) {\\\\n  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\\\\n    return new Buffer(arg, encodingOrOffset, length)\\\\n  }\\\\n\\\\n  // Common case.\\\\n  if (typeof arg === \'number\') {\\\\n    if (typeof encodingOrOffset === \'string\') {\\\\n      throw new Error(\\\\n        \'If encoding is specified then the first argument must be a string\'\\\\n      )\\\\n    }\\\\n    return allocUnsafe(this, arg)\\\\n  }\\\\n  return from(this, arg, encodingOrOffset, length)\\\\n}\\\\n\\\\nBuffer.poolSize = 8192 // not used by this implementation\\\\n\\\\n// TODO: Legacy, not needed anymore. Remove in next major version.\\\\nBuffer._augment = function (arr) {\\\\n  arr.__proto__ = Buffer.prototype\\\\n  return arr\\\\n}\\\\n\\\\nfunction from (that, value, encodingOrOffset, length) {\\\\n  if (typeof value === \'number\') {\\\\n    throw new TypeError(\'\\\\\\"value\\\\\\" argument must not be a number\')\\\\n  }\\\\n\\\\n  if (typeof ArrayBuffer !== \'undefined\' && value instanceof ArrayBuffer) {\\\\n    return fromArrayBuffer(that, value, encodingOrOffset, length)\\\\n  }\\\\n\\\\n  if (typeof value === \'string\') {\\\\n    return fromString(that, value, encodingOrOffset)\\\\n  }\\\\n\\\\n  return fromObject(that, value)\\\\n}\\\\n\\\\n/**\\\\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\\\\n * if value is a number.\\\\n * Buffer.from(str[, encoding])\\\\n * Buffer.from(array)\\\\n * Buffer.from(buffer)\\\\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\\\\n **/\\\\nBuffer.from = function (value, encodingOrOffset, length) {\\\\n  return from(null, value, encodingOrOffset, length)\\\\n}\\\\n\\\\nif (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n  Buffer.prototype.__proto__ = Uint8Array.prototype\\\\n  Buffer.__proto__ = Uint8Array\\\\n  if (typeof Symbol !== \'undefined\' && Symbol.species &&\\\\n      Buffer[Symbol.species] === Buffer) {\\\\n    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\\\\n    Object.defineProperty(Buffer, Symbol.species, {\\\\n      value: null,\\\\n      configurable: true\\\\n    })\\\\n  }\\\\n}\\\\n\\\\nfunction assertSize (size) {\\\\n  if (typeof size !== \'number\') {\\\\n    throw new TypeError(\'\\\\\\"size\\\\\\" argument must be a number\')\\\\n  } else if (size < 0) {\\\\n    throw new RangeError(\'\\\\\\"size\\\\\\" argument must not be negative\')\\\\n  }\\\\n}\\\\n\\\\nfunction alloc (that, size, fill, encoding) {\\\\n  assertSize(size)\\\\n  if (size <= 0) {\\\\n    return createBuffer(that, size)\\\\n  }\\\\n  if (fill !== undefined) {\\\\n    // Only pay attention to encoding if it\'s a string. This\\\\n    // prevents accidentally sending in a number that would\\\\n    // be interpretted as a start offset.\\\\n    return typeof encoding === \'string\'\\\\n      ? createBuffer(that, size).fill(fill, encoding)\\\\n      : createBuffer(that, size).fill(fill)\\\\n  }\\\\n  return createBuffer(that, size)\\\\n}\\\\n\\\\n/**\\\\n * Creates a new filled Buffer instance.\\\\n * alloc(size[, fill[, encoding]])\\\\n **/\\\\nBuffer.alloc = function (size, fill, encoding) {\\\\n  return alloc(null, size, fill, encoding)\\\\n}\\\\n\\\\nfunction allocUnsafe (that, size) {\\\\n  assertSize(size)\\\\n  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\\\\n  if (!Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    for (var i = 0; i < size; ++i) {\\\\n      that[i] = 0\\\\n    }\\\\n  }\\\\n  return that\\\\n}\\\\n\\\\n/**\\\\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\\\\n * */\\\\nBuffer.allocUnsafe = function (size) {\\\\n  return allocUnsafe(null, size)\\\\n}\\\\n/**\\\\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\\\\n */\\\\nBuffer.allocUnsafeSlow = function (size) {\\\\n  return allocUnsafe(null, size)\\\\n}\\\\n\\\\nfunction fromString (that, string, encoding) {\\\\n  if (typeof encoding !== \'string\' || encoding === \'\') {\\\\n    encoding = \'utf8\'\\\\n  }\\\\n\\\\n  if (!Buffer.isEncoding(encoding)) {\\\\n    throw new TypeError(\'\\\\\\"encoding\\\\\\" must be a valid string encoding\')\\\\n  }\\\\n\\\\n  var length = byteLength(string, encoding) | 0\\\\n  that = createBuffer(that, length)\\\\n\\\\n  var actual = that.write(string, encoding)\\\\n\\\\n  if (actual !== length) {\\\\n    // Writing a hex string, for example, that contains invalid characters will\\\\n    // cause everything after the first invalid character to be ignored. (e.g.\\\\n    // \'abxxcd\' will be treated as \'ab\')\\\\n    that = that.slice(0, actual)\\\\n  }\\\\n\\\\n  return that\\\\n}\\\\n\\\\nfunction fromArrayLike (that, array) {\\\\n  var length = array.length < 0 ? 0 : checked(array.length) | 0\\\\n  that = createBuffer(that, length)\\\\n  for (var i = 0; i < length; i += 1) {\\\\n    that[i] = array[i] & 255\\\\n  }\\\\n  return that\\\\n}\\\\n\\\\nfunction fromArrayBuffer (that, array, byteOffset, length) {\\\\n  array.byteLength // this throws if `array` is not a valid ArrayBuffer\\\\n\\\\n  if (byteOffset < 0 || array.byteLength < byteOffset) {\\\\n    throw new RangeError(\'\\\\\\\\\'offset\\\\\\\\\' is out of bounds\')\\\\n  }\\\\n\\\\n  if (array.byteLength < byteOffset + (length || 0)) {\\\\n    throw new RangeError(\'\\\\\\\\\'length\\\\\\\\\' is out of bounds\')\\\\n  }\\\\n\\\\n  if (byteOffset === undefined && length === undefined) {\\\\n    array = new Uint8Array(array)\\\\n  } else if (length === undefined) {\\\\n    array = new Uint8Array(array, byteOffset)\\\\n  } else {\\\\n    array = new Uint8Array(array, byteOffset, length)\\\\n  }\\\\n\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    // Return an augmented `Uint8Array` instance, for best performance\\\\n    that = array\\\\n    that.__proto__ = Buffer.prototype\\\\n  } else {\\\\n    // Fallback: Return an object instance of the Buffer class\\\\n    that = fromArrayLike(that, array)\\\\n  }\\\\n  return that\\\\n}\\\\n\\\\nfunction fromObject (that, obj) {\\\\n  if (Buffer.isBuffer(obj)) {\\\\n    var len = checked(obj.length) | 0\\\\n    that = createBuffer(that, len)\\\\n\\\\n    if (that.length === 0) {\\\\n      return that\\\\n    }\\\\n\\\\n    obj.copy(that, 0, 0, len)\\\\n    return that\\\\n  }\\\\n\\\\n  if (obj) {\\\\n    if ((typeof ArrayBuffer !== \'undefined\' &&\\\\n        obj.buffer instanceof ArrayBuffer) || \'length\' in obj) {\\\\n      if (typeof obj.length !== \'number\' || isnan(obj.length)) {\\\\n        return createBuffer(that, 0)\\\\n      }\\\\n      return fromArrayLike(that, obj)\\\\n    }\\\\n\\\\n    if (obj.type === \'Buffer\' && isArray(obj.data)) {\\\\n      return fromArrayLike(that, obj.data)\\\\n    }\\\\n  }\\\\n\\\\n  throw new TypeError(\'First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.\')\\\\n}\\\\n\\\\nfunction checked (length) {\\\\n  // Note: cannot use `length < kMaxLength()` here because that fails when\\\\n  // length is NaN (which is otherwise coerced to zero.)\\\\n  if (length >= kMaxLength()) {\\\\n    throw new RangeError(\'Attempt to allocate Buffer larger than maximum \' +\\\\n                         \'size: 0x\' + kMaxLength().toString(16) + \' bytes\')\\\\n  }\\\\n  return length | 0\\\\n}\\\\n\\\\nfunction SlowBuffer (length) {\\\\n  if (+length != length) { // eslint-disable-line eqeqeq\\\\n    length = 0\\\\n  }\\\\n  return Buffer.alloc(+length)\\\\n}\\\\n\\\\nBuffer.isBuffer = function isBuffer (b) {\\\\n  return !!(b != null && b._isBuffer)\\\\n}\\\\n\\\\nBuffer.compare = function compare (a, b) {\\\\n  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\\\\n    throw new TypeError(\'Arguments must be Buffers\')\\\\n  }\\\\n\\\\n  if (a === b) return 0\\\\n\\\\n  var x = a.length\\\\n  var y = b.length\\\\n\\\\n  for (var i = 0, len = Math.min(x, y); i < len; ++i) {\\\\n    if (a[i] !== b[i]) {\\\\n      x = a[i]\\\\n      y = b[i]\\\\n      break\\\\n    }\\\\n  }\\\\n\\\\n  if (x < y) return -1\\\\n  if (y < x) return 1\\\\n  return 0\\\\n}\\\\n\\\\nBuffer.isEncoding = function isEncoding (encoding) {\\\\n  switch (String(encoding).toLowerCase()) {\\\\n    case \'hex\':\\\\n    case \'utf8\':\\\\n    case \'utf-8\':\\\\n    case \'ascii\':\\\\n    case \'latin1\':\\\\n    case \'binary\':\\\\n    case \'base64\':\\\\n    case \'ucs2\':\\\\n    case \'ucs-2\':\\\\n    case \'utf16le\':\\\\n    case \'utf-16le\':\\\\n      return true\\\\n    default:\\\\n      return false\\\\n  }\\\\n}\\\\n\\\\nBuffer.concat = function concat (list, length) {\\\\n  if (!isArray(list)) {\\\\n    throw new TypeError(\'\\\\\\"list\\\\\\" argument must be an Array of Buffers\')\\\\n  }\\\\n\\\\n  if (list.length === 0) {\\\\n    return Buffer.alloc(0)\\\\n  }\\\\n\\\\n  var i\\\\n  if (length === undefined) {\\\\n    length = 0\\\\n    for (i = 0; i < list.length; ++i) {\\\\n      length += list[i].length\\\\n    }\\\\n  }\\\\n\\\\n  var buffer = Buffer.allocUnsafe(length)\\\\n  var pos = 0\\\\n  for (i = 0; i < list.length; ++i) {\\\\n    var buf = list[i]\\\\n    if (!Buffer.isBuffer(buf)) {\\\\n      throw new TypeError(\'\\\\\\"list\\\\\\" argument must be an Array of Buffers\')\\\\n    }\\\\n    buf.copy(buffer, pos)\\\\n    pos += buf.length\\\\n  }\\\\n  return buffer\\\\n}\\\\n\\\\nfunction byteLength (string, encoding) {\\\\n  if (Buffer.isBuffer(string)) {\\\\n    return string.length\\\\n  }\\\\n  if (typeof ArrayBuffer !== \'undefined\' && typeof ArrayBuffer.isView === \'function\' &&\\\\n      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\\\\n    return string.byteLength\\\\n  }\\\\n  if (typeof string !== \'string\') {\\\\n    string = \'\' + string\\\\n  }\\\\n\\\\n  var len = string.length\\\\n  if (len === 0) return 0\\\\n\\\\n  // Use a for loop to avoid recursion\\\\n  var loweredCase = false\\\\n  for (;;) {\\\\n    switch (encoding) {\\\\n      case \'ascii\':\\\\n      case \'latin1\':\\\\n      case \'binary\':\\\\n        return len\\\\n      case \'utf8\':\\\\n      case \'utf-8\':\\\\n      case undefined:\\\\n        return utf8ToBytes(string).length\\\\n      case \'ucs2\':\\\\n      case \'ucs-2\':\\\\n      case \'utf16le\':\\\\n      case \'utf-16le\':\\\\n        return len * 2\\\\n      case \'hex\':\\\\n        return len >>> 1\\\\n      case \'base64\':\\\\n        return base64ToBytes(string).length\\\\n      default:\\\\n        if (loweredCase) return utf8ToBytes(string).length // assume utf8\\\\n        encoding = (\'\' + encoding).toLowerCase()\\\\n        loweredCase = true\\\\n    }\\\\n  }\\\\n}\\\\nBuffer.byteLength = byteLength\\\\n\\\\nfunction slowToString (encoding, start, end) {\\\\n  var loweredCase = false\\\\n\\\\n  // No need to verify that \\\\\\"this.length <= MAX_UINT32\\\\\\" since it\'s a read-only\\\\n  // property of a typed array.\\\\n\\\\n  // This behaves neither like String nor Uint8Array in that we set start/end\\\\n  // to their upper/lower bounds if the value passed is out of range.\\\\n  // undefined is handled specially as per ECMA-262 6th Edition,\\\\n  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\\\\n  if (start === undefined || start < 0) {\\\\n    start = 0\\\\n  }\\\\n  // Return early if start > this.length. Done here to prevent potential uint32\\\\n  // coercion fail below.\\\\n  if (start > this.length) {\\\\n    return \'\'\\\\n  }\\\\n\\\\n  if (end === undefined || end > this.length) {\\\\n    end = this.length\\\\n  }\\\\n\\\\n  if (end <= 0) {\\\\n    return \'\'\\\\n  }\\\\n\\\\n  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\\\\n  end >>>= 0\\\\n  start >>>= 0\\\\n\\\\n  if (end <= start) {\\\\n    return \'\'\\\\n  }\\\\n\\\\n  if (!encoding) encoding = \'utf8\'\\\\n\\\\n  while (true) {\\\\n    switch (encoding) {\\\\n      case \'hex\':\\\\n        return hexSlice(this, start, end)\\\\n\\\\n      case \'utf8\':\\\\n      case \'utf-8\':\\\\n        return utf8Slice(this, start, end)\\\\n\\\\n      case \'ascii\':\\\\n        return asciiSlice(this, start, end)\\\\n\\\\n      case \'latin1\':\\\\n      case \'binary\':\\\\n        return latin1Slice(this, start, end)\\\\n\\\\n      case \'base64\':\\\\n        return base64Slice(this, start, end)\\\\n\\\\n      case \'ucs2\':\\\\n      case \'ucs-2\':\\\\n      case \'utf16le\':\\\\n      case \'utf-16le\':\\\\n        return utf16leSlice(this, start, end)\\\\n\\\\n      default:\\\\n        if (loweredCase) throw new TypeError(\'Unknown encoding: \' + encoding)\\\\n        encoding = (encoding + \'\').toLowerCase()\\\\n        loweredCase = true\\\\n    }\\\\n  }\\\\n}\\\\n\\\\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\\\\n// Buffer instances.\\\\nBuffer.prototype._isBuffer = true\\\\n\\\\nfunction swap (b, n, m) {\\\\n  var i = b[n]\\\\n  b[n] = b[m]\\\\n  b[m] = i\\\\n}\\\\n\\\\nBuffer.prototype.swap16 = function swap16 () {\\\\n  var len = this.length\\\\n  if (len % 2 !== 0) {\\\\n    throw new RangeError(\'Buffer size must be a multiple of 16-bits\')\\\\n  }\\\\n  for (var i = 0; i < len; i += 2) {\\\\n    swap(this, i, i + 1)\\\\n  }\\\\n  return this\\\\n}\\\\n\\\\nBuffer.prototype.swap32 = function swap32 () {\\\\n  var len = this.length\\\\n  if (len % 4 !== 0) {\\\\n    throw new RangeError(\'Buffer size must be a multiple of 32-bits\')\\\\n  }\\\\n  for (var i = 0; i < len; i += 4) {\\\\n    swap(this, i, i + 3)\\\\n    swap(this, i + 1, i + 2)\\\\n  }\\\\n  return this\\\\n}\\\\n\\\\nBuffer.prototype.swap64 = function swap64 () {\\\\n  var len = this.length\\\\n  if (len % 8 !== 0) {\\\\n    throw new RangeError(\'Buffer size must be a multiple of 64-bits\')\\\\n  }\\\\n  for (var i = 0; i < len; i += 8) {\\\\n    swap(this, i, i + 7)\\\\n    swap(this, i + 1, i + 6)\\\\n    swap(this, i + 2, i + 5)\\\\n    swap(this, i + 3, i + 4)\\\\n  }\\\\n  return this\\\\n}\\\\n\\\\nBuffer.prototype.toString = function toString () {\\\\n  var length = this.length | 0\\\\n  if (length === 0) return \'\'\\\\n  if (arguments.length === 0) return utf8Slice(this, 0, length)\\\\n  return slowToString.apply(this, arguments)\\\\n}\\\\n\\\\nBuffer.prototype.equals = function equals (b) {\\\\n  if (!Buffer.isBuffer(b)) throw new TypeError(\'Argument must be a Buffer\')\\\\n  if (this === b) return true\\\\n  return Buffer.compare(this, b) === 0\\\\n}\\\\n\\\\nBuffer.prototype.inspect = function inspect () {\\\\n  var str = \'\'\\\\n  var max = exports.INSPECT_MAX_BYTES\\\\n  if (this.length > 0) {\\\\n    str = this.toString(\'hex\', 0, max).match(/.{2}/g).join(\' \')\\\\n    if (this.length > max) str += \' ... \'\\\\n  }\\\\n  return \'<Buffer \' + str + \'>\'\\\\n}\\\\n\\\\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\\\\n  if (!Buffer.isBuffer(target)) {\\\\n    throw new TypeError(\'Argument must be a Buffer\')\\\\n  }\\\\n\\\\n  if (start === undefined) {\\\\n    start = 0\\\\n  }\\\\n  if (end === undefined) {\\\\n    end = target ? target.length : 0\\\\n  }\\\\n  if (thisStart === undefined) {\\\\n    thisStart = 0\\\\n  }\\\\n  if (thisEnd === undefined) {\\\\n    thisEnd = this.length\\\\n  }\\\\n\\\\n  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\\\\n    throw new RangeError(\'out of range index\')\\\\n  }\\\\n\\\\n  if (thisStart >= thisEnd && start >= end) {\\\\n    return 0\\\\n  }\\\\n  if (thisStart >= thisEnd) {\\\\n    return -1\\\\n  }\\\\n  if (start >= end) {\\\\n    return 1\\\\n  }\\\\n\\\\n  start >>>= 0\\\\n  end >>>= 0\\\\n  thisStart >>>= 0\\\\n  thisEnd >>>= 0\\\\n\\\\n  if (this === target) return 0\\\\n\\\\n  var x = thisEnd - thisStart\\\\n  var y = end - start\\\\n  var len = Math.min(x, y)\\\\n\\\\n  var thisCopy = this.slice(thisStart, thisEnd)\\\\n  var targetCopy = target.slice(start, end)\\\\n\\\\n  for (var i = 0; i < len; ++i) {\\\\n    if (thisCopy[i] !== targetCopy[i]) {\\\\n      x = thisCopy[i]\\\\n      y = targetCopy[i]\\\\n      break\\\\n    }\\\\n  }\\\\n\\\\n  if (x < y) return -1\\\\n  if (y < x) return 1\\\\n  return 0\\\\n}\\\\n\\\\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\\\\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\\\\n//\\\\n// Arguments:\\\\n// - buffer - a Buffer to search\\\\n// - val - a string, Buffer, or number\\\\n// - byteOffset - an index into `buffer`; will be clamped to an int32\\\\n// - encoding - an optional encoding, relevant is val is a string\\\\n// - dir - true for indexOf, false for lastIndexOf\\\\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\\\\n  // Empty buffer means no match\\\\n  if (buffer.length === 0) return -1\\\\n\\\\n  // Normalize byteOffset\\\\n  if (typeof byteOffset === \'string\') {\\\\n    encoding = byteOffset\\\\n    byteOffset = 0\\\\n  } else if (byteOffset > 0x7fffffff) {\\\\n    byteOffset = 0x7fffffff\\\\n  } else if (byteOffset < -0x80000000) {\\\\n    byteOffset = -0x80000000\\\\n  }\\\\n  byteOffset = +byteOffset  // Coerce to Number.\\\\n  if (isNaN(byteOffset)) {\\\\n    // byteOffset: it it\'s undefined, null, NaN, \\\\\\"foo\\\\\\", etc, search whole buffer\\\\n    byteOffset = dir ? 0 : (buffer.length - 1)\\\\n  }\\\\n\\\\n  // Normalize byteOffset: negative offsets start from the end of the buffer\\\\n  if (byteOffset < 0) byteOffset = buffer.length + byteOffset\\\\n  if (byteOffset >= buffer.length) {\\\\n    if (dir) return -1\\\\n    else byteOffset = buffer.length - 1\\\\n  } else if (byteOffset < 0) {\\\\n    if (dir) byteOffset = 0\\\\n    else return -1\\\\n  }\\\\n\\\\n  // Normalize val\\\\n  if (typeof val === \'string\') {\\\\n    val = Buffer.from(val, encoding)\\\\n  }\\\\n\\\\n  // Finally, search either indexOf (if dir is true) or lastIndexOf\\\\n  if (Buffer.isBuffer(val)) {\\\\n    // Special case: looking for empty string/buffer always fails\\\\n    if (val.length === 0) {\\\\n      return -1\\\\n    }\\\\n    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\\\\n  } else if (typeof val === \'number\') {\\\\n    val = val & 0xFF // Search for a byte value [0-255]\\\\n    if (Buffer.TYPED_ARRAY_SUPPORT &&\\\\n        typeof Uint8Array.prototype.indexOf === \'function\') {\\\\n      if (dir) {\\\\n        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\\\\n      } else {\\\\n        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\\\\n      }\\\\n    }\\\\n    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\\\\n  }\\\\n\\\\n  throw new TypeError(\'val must be string, number or Buffer\')\\\\n}\\\\n\\\\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\\\\n  var indexSize = 1\\\\n  var arrLength = arr.length\\\\n  var valLength = val.length\\\\n\\\\n  if (encoding !== undefined) {\\\\n    encoding = String(encoding).toLowerCase()\\\\n    if (encoding === \'ucs2\' || encoding === \'ucs-2\' ||\\\\n        encoding === \'utf16le\' || encoding === \'utf-16le\') {\\\\n      if (arr.length < 2 || val.length < 2) {\\\\n        return -1\\\\n      }\\\\n      indexSize = 2\\\\n      arrLength /= 2\\\\n      valLength /= 2\\\\n      byteOffset /= 2\\\\n    }\\\\n  }\\\\n\\\\n  function read (buf, i) {\\\\n    if (indexSize === 1) {\\\\n      return buf[i]\\\\n    } else {\\\\n      return buf.readUInt16BE(i * indexSize)\\\\n    }\\\\n  }\\\\n\\\\n  var i\\\\n  if (dir) {\\\\n    var foundIndex = -1\\\\n    for (i = byteOffset; i < arrLength; i++) {\\\\n      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\\\\n        if (foundIndex === -1) foundIndex = i\\\\n        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\\\\n      } else {\\\\n        if (foundIndex !== -1) i -= i - foundIndex\\\\n        foundIndex = -1\\\\n      }\\\\n    }\\\\n  } else {\\\\n    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\\\\n    for (i = byteOffset; i >= 0; i--) {\\\\n      var found = true\\\\n      for (var j = 0; j < valLength; j++) {\\\\n        if (read(arr, i + j) !== read(val, j)) {\\\\n          found = false\\\\n          break\\\\n        }\\\\n      }\\\\n      if (found) return i\\\\n    }\\\\n  }\\\\n\\\\n  return -1\\\\n}\\\\n\\\\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\\\\n  return this.indexOf(val, byteOffset, encoding) !== -1\\\\n}\\\\n\\\\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\\\\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\\\\n}\\\\n\\\\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\\\\n  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\\\\n}\\\\n\\\\nfunction hexWrite (buf, string, offset, length) {\\\\n  offset = Number(offset) || 0\\\\n  var remaining = buf.length - offset\\\\n  if (!length) {\\\\n    length = remaining\\\\n  } else {\\\\n    length = Number(length)\\\\n    if (length > remaining) {\\\\n      length = remaining\\\\n    }\\\\n  }\\\\n\\\\n  // must be an even number of digits\\\\n  var strLen = string.length\\\\n  if (strLen % 2 !== 0) throw new TypeError(\'Invalid hex string\')\\\\n\\\\n  if (length > strLen / 2) {\\\\n    length = strLen / 2\\\\n  }\\\\n  for (var i = 0; i < length; ++i) {\\\\n    var parsed = parseInt(string.substr(i * 2, 2), 16)\\\\n    if (isNaN(parsed)) return i\\\\n    buf[offset + i] = parsed\\\\n  }\\\\n  return i\\\\n}\\\\n\\\\nfunction utf8Write (buf, string, offset, length) {\\\\n  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\\\\n}\\\\n\\\\nfunction asciiWrite (buf, string, offset, length) {\\\\n  return blitBuffer(asciiToBytes(string), buf, offset, length)\\\\n}\\\\n\\\\nfunction latin1Write (buf, string, offset, length) {\\\\n  return asciiWrite(buf, string, offset, length)\\\\n}\\\\n\\\\nfunction base64Write (buf, string, offset, length) {\\\\n  return blitBuffer(base64ToBytes(string), buf, offset, length)\\\\n}\\\\n\\\\nfunction ucs2Write (buf, string, offset, length) {\\\\n  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\\\\n}\\\\n\\\\nBuffer.prototype.write = function write (string, offset, length, encoding) {\\\\n  // Buffer#write(string)\\\\n  if (offset === undefined) {\\\\n    encoding = \'utf8\'\\\\n    length = this.length\\\\n    offset = 0\\\\n  // Buffer#write(string, encoding)\\\\n  } else if (length === undefined && typeof offset === \'string\') {\\\\n    encoding = offset\\\\n    length = this.length\\\\n    offset = 0\\\\n  // Buffer#write(string, offset[, length][, encoding])\\\\n  } else if (isFinite(offset)) {\\\\n    offset = offset | 0\\\\n    if (isFinite(length)) {\\\\n      length = length | 0\\\\n      if (encoding === undefined) encoding = \'utf8\'\\\\n    } else {\\\\n      encoding = length\\\\n      length = undefined\\\\n    }\\\\n  // legacy write(string, encoding, offset, length) - remove in v0.13\\\\n  } else {\\\\n    throw new Error(\\\\n      \'Buffer.write(string, encoding, offset[, length]) is no longer supported\'\\\\n    )\\\\n  }\\\\n\\\\n  var remaining = this.length - offset\\\\n  if (length === undefined || length > remaining) length = remaining\\\\n\\\\n  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\\\\n    throw new RangeError(\'Attempt to write outside buffer bounds\')\\\\n  }\\\\n\\\\n  if (!encoding) encoding = \'utf8\'\\\\n\\\\n  var loweredCase = false\\\\n  for (;;) {\\\\n    switch (encoding) {\\\\n      case \'hex\':\\\\n        return hexWrite(this, string, offset, length)\\\\n\\\\n      case \'utf8\':\\\\n      case \'utf-8\':\\\\n        return utf8Write(this, string, offset, length)\\\\n\\\\n      case \'ascii\':\\\\n        return asciiWrite(this, string, offset, length)\\\\n\\\\n      case \'latin1\':\\\\n      case \'binary\':\\\\n        return latin1Write(this, string, offset, length)\\\\n\\\\n      case \'base64\':\\\\n        // Warning: maxLength not taken into account in base64Write\\\\n        return base64Write(this, string, offset, length)\\\\n\\\\n      case \'ucs2\':\\\\n      case \'ucs-2\':\\\\n      case \'utf16le\':\\\\n      case \'utf-16le\':\\\\n        return ucs2Write(this, string, offset, length)\\\\n\\\\n      default:\\\\n        if (loweredCase) throw new TypeError(\'Unknown encoding: \' + encoding)\\\\n        encoding = (\'\' + encoding).toLowerCase()\\\\n        loweredCase = true\\\\n    }\\\\n  }\\\\n}\\\\n\\\\nBuffer.prototype.toJSON = function toJSON () {\\\\n  return {\\\\n    type: \'Buffer\',\\\\n    data: Array.prototype.slice.call(this._arr || this, 0)\\\\n  }\\\\n}\\\\n\\\\nfunction base64Slice (buf, start, end) {\\\\n  if (start === 0 && end === buf.length) {\\\\n    return base64.fromByteArray(buf)\\\\n  } else {\\\\n    return base64.fromByteArray(buf.slice(start, end))\\\\n  }\\\\n}\\\\n\\\\nfunction utf8Slice (buf, start, end) {\\\\n  end = Math.min(buf.length, end)\\\\n  var res = []\\\\n\\\\n  var i = start\\\\n  while (i < end) {\\\\n    var firstByte = buf[i]\\\\n    var codePoint = null\\\\n    var bytesPerSequence = (firstByte > 0xEF) ? 4\\\\n      : (firstByte > 0xDF) ? 3\\\\n      : (firstByte > 0xBF) ? 2\\\\n      : 1\\\\n\\\\n    if (i + bytesPerSequence <= end) {\\\\n      var secondByte, thirdByte, fourthByte, tempCodePoint\\\\n\\\\n      switch (bytesPerSequence) {\\\\n        case 1:\\\\n          if (firstByte < 0x80) {\\\\n            codePoint = firstByte\\\\n          }\\\\n          break\\\\n        case 2:\\\\n          secondByte = buf[i + 1]\\\\n          if ((secondByte & 0xC0) === 0x80) {\\\\n            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\\\\n            if (tempCodePoint > 0x7F) {\\\\n              codePoint = tempCodePoint\\\\n            }\\\\n          }\\\\n          break\\\\n        case 3:\\\\n          secondByte = buf[i + 1]\\\\n          thirdByte = buf[i + 2]\\\\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\\\\n            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\\\\n            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\\\\n              codePoint = tempCodePoint\\\\n            }\\\\n          }\\\\n          break\\\\n        case 4:\\\\n          secondByte = buf[i + 1]\\\\n          thirdByte = buf[i + 2]\\\\n          fourthByte = buf[i + 3]\\\\n          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\\\\n            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\\\\n            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\\\\n              codePoint = tempCodePoint\\\\n            }\\\\n          }\\\\n      }\\\\n    }\\\\n\\\\n    if (codePoint === null) {\\\\n      // we did not generate a valid codePoint so insert a\\\\n      // replacement char (U+FFFD) and advance only 1 byte\\\\n      codePoint = 0xFFFD\\\\n      bytesPerSequence = 1\\\\n    } else if (codePoint > 0xFFFF) {\\\\n      // encode to utf16 (surrogate pair dance)\\\\n      codePoint -= 0x10000\\\\n      res.push(codePoint >>> 10 & 0x3FF | 0xD800)\\\\n      codePoint = 0xDC00 | codePoint & 0x3FF\\\\n    }\\\\n\\\\n    res.push(codePoint)\\\\n    i += bytesPerSequence\\\\n  }\\\\n\\\\n  return decodeCodePointsArray(res)\\\\n}\\\\n\\\\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\\\\n// the lowest limit is Chrome, with 0x10000 args.\\\\n// We go 1 magnitude less, for safety\\\\nvar MAX_ARGUMENTS_LENGTH = 0x1000\\\\n\\\\nfunction decodeCodePointsArray (codePoints) {\\\\n  var len = codePoints.length\\\\n  if (len <= MAX_ARGUMENTS_LENGTH) {\\\\n    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\\\\n  }\\\\n\\\\n  // Decode in chunks to avoid \\\\\\"call stack size exceeded\\\\\\".\\\\n  var res = \'\'\\\\n  var i = 0\\\\n  while (i < len) {\\\\n    res += String.fromCharCode.apply(\\\\n      String,\\\\n      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\\\\n    )\\\\n  }\\\\n  return res\\\\n}\\\\n\\\\nfunction asciiSlice (buf, start, end) {\\\\n  var ret = \'\'\\\\n  end = Math.min(buf.length, end)\\\\n\\\\n  for (var i = start; i < end; ++i) {\\\\n    ret += String.fromCharCode(buf[i] & 0x7F)\\\\n  }\\\\n  return ret\\\\n}\\\\n\\\\nfunction latin1Slice (buf, start, end) {\\\\n  var ret = \'\'\\\\n  end = Math.min(buf.length, end)\\\\n\\\\n  for (var i = start; i < end; ++i) {\\\\n    ret += String.fromCharCode(buf[i])\\\\n  }\\\\n  return ret\\\\n}\\\\n\\\\nfunction hexSlice (buf, start, end) {\\\\n  var len = buf.length\\\\n\\\\n  if (!start || start < 0) start = 0\\\\n  if (!end || end < 0 || end > len) end = len\\\\n\\\\n  var out = \'\'\\\\n  for (var i = start; i < end; ++i) {\\\\n    out += toHex(buf[i])\\\\n  }\\\\n  return out\\\\n}\\\\n\\\\nfunction utf16leSlice (buf, start, end) {\\\\n  var bytes = buf.slice(start, end)\\\\n  var res = \'\'\\\\n  for (var i = 0; i < bytes.length; i += 2) {\\\\n    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\\\\n  }\\\\n  return res\\\\n}\\\\n\\\\nBuffer.prototype.slice = function slice (start, end) {\\\\n  var len = this.length\\\\n  start = ~~start\\\\n  end = end === undefined ? len : ~~end\\\\n\\\\n  if (start < 0) {\\\\n    start += len\\\\n    if (start < 0) start = 0\\\\n  } else if (start > len) {\\\\n    start = len\\\\n  }\\\\n\\\\n  if (end < 0) {\\\\n    end += len\\\\n    if (end < 0) end = 0\\\\n  } else if (end > len) {\\\\n    end = len\\\\n  }\\\\n\\\\n  if (end < start) end = start\\\\n\\\\n  var newBuf\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    newBuf = this.subarray(start, end)\\\\n    newBuf.__proto__ = Buffer.prototype\\\\n  } else {\\\\n    var sliceLen = end - start\\\\n    newBuf = new Buffer(sliceLen, undefined)\\\\n    for (var i = 0; i < sliceLen; ++i) {\\\\n      newBuf[i] = this[i + start]\\\\n    }\\\\n  }\\\\n\\\\n  return newBuf\\\\n}\\\\n\\\\n/*\\\\n * Need to make sure that buffer isn\'t trying to write out of bounds.\\\\n */\\\\nfunction checkOffset (offset, ext, length) {\\\\n  if ((offset % 1) !== 0 || offset < 0) throw new RangeError(\'offset is not uint\')\\\\n  if (offset + ext > length) throw new RangeError(\'Trying to access beyond buffer length\')\\\\n}\\\\n\\\\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\\\\n\\\\n  var val = this[offset]\\\\n  var mul = 1\\\\n  var i = 0\\\\n  while (++i < byteLength && (mul *= 0x100)) {\\\\n    val += this[offset + i] * mul\\\\n  }\\\\n\\\\n  return val\\\\n}\\\\n\\\\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) {\\\\n    checkOffset(offset, byteLength, this.length)\\\\n  }\\\\n\\\\n  var val = this[offset + --byteLength]\\\\n  var mul = 1\\\\n  while (byteLength > 0 && (mul *= 0x100)) {\\\\n    val += this[offset + --byteLength] * mul\\\\n  }\\\\n\\\\n  return val\\\\n}\\\\n\\\\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 1, this.length)\\\\n  return this[offset]\\\\n}\\\\n\\\\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 2, this.length)\\\\n  return this[offset] | (this[offset + 1] << 8)\\\\n}\\\\n\\\\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 2, this.length)\\\\n  return (this[offset] << 8) | this[offset + 1]\\\\n}\\\\n\\\\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n\\\\n  return ((this[offset]) |\\\\n      (this[offset + 1] << 8) |\\\\n      (this[offset + 2] << 16)) +\\\\n      (this[offset + 3] * 0x1000000)\\\\n}\\\\n\\\\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n\\\\n  return (this[offset] * 0x1000000) +\\\\n    ((this[offset + 1] << 16) |\\\\n    (this[offset + 2] << 8) |\\\\n    this[offset + 3])\\\\n}\\\\n\\\\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\\\\n\\\\n  var val = this[offset]\\\\n  var mul = 1\\\\n  var i = 0\\\\n  while (++i < byteLength && (mul *= 0x100)) {\\\\n    val += this[offset + i] * mul\\\\n  }\\\\n  mul *= 0x80\\\\n\\\\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\\\\n\\\\n  return val\\\\n}\\\\n\\\\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) checkOffset(offset, byteLength, this.length)\\\\n\\\\n  var i = byteLength\\\\n  var mul = 1\\\\n  var val = this[offset + --i]\\\\n  while (i > 0 && (mul *= 0x100)) {\\\\n    val += this[offset + --i] * mul\\\\n  }\\\\n  mul *= 0x80\\\\n\\\\n  if (val >= mul) val -= Math.pow(2, 8 * byteLength)\\\\n\\\\n  return val\\\\n}\\\\n\\\\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 1, this.length)\\\\n  if (!(this[offset] & 0x80)) return (this[offset])\\\\n  return ((0xff - this[offset] + 1) * -1)\\\\n}\\\\n\\\\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 2, this.length)\\\\n  var val = this[offset] | (this[offset + 1] << 8)\\\\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\\\\n}\\\\n\\\\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 2, this.length)\\\\n  var val = this[offset + 1] | (this[offset] << 8)\\\\n  return (val & 0x8000) ? val | 0xFFFF0000 : val\\\\n}\\\\n\\\\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n\\\\n  return (this[offset]) |\\\\n    (this[offset + 1] << 8) |\\\\n    (this[offset + 2] << 16) |\\\\n    (this[offset + 3] << 24)\\\\n}\\\\n\\\\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n\\\\n  return (this[offset] << 24) |\\\\n    (this[offset + 1] << 16) |\\\\n    (this[offset + 2] << 8) |\\\\n    (this[offset + 3])\\\\n}\\\\n\\\\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n  return ieee754.read(this, offset, true, 23, 4)\\\\n}\\\\n\\\\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 4, this.length)\\\\n  return ieee754.read(this, offset, false, 23, 4)\\\\n}\\\\n\\\\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 8, this.length)\\\\n  return ieee754.read(this, offset, true, 52, 8)\\\\n}\\\\n\\\\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\\\\n  if (!noAssert) checkOffset(offset, 8, this.length)\\\\n  return ieee754.read(this, offset, false, 52, 8)\\\\n}\\\\n\\\\nfunction checkInt (buf, value, offset, ext, max, min) {\\\\n  if (!Buffer.isBuffer(buf)) throw new TypeError(\'\\\\\\"buffer\\\\\\" argument must be a Buffer instance\')\\\\n  if (value > max || value < min) throw new RangeError(\'\\\\\\"value\\\\\\" argument is out of bounds\')\\\\n  if (offset + ext > buf.length) throw new RangeError(\'Index out of range\')\\\\n}\\\\n\\\\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) {\\\\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\\\\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\\\\n  }\\\\n\\\\n  var mul = 1\\\\n  var i = 0\\\\n  this[offset] = value & 0xFF\\\\n  while (++i < byteLength && (mul *= 0x100)) {\\\\n    this[offset + i] = (value / mul) & 0xFF\\\\n  }\\\\n\\\\n  return offset + byteLength\\\\n}\\\\n\\\\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  byteLength = byteLength | 0\\\\n  if (!noAssert) {\\\\n    var maxBytes = Math.pow(2, 8 * byteLength) - 1\\\\n    checkInt(this, value, offset, byteLength, maxBytes, 0)\\\\n  }\\\\n\\\\n  var i = byteLength - 1\\\\n  var mul = 1\\\\n  this[offset + i] = value & 0xFF\\\\n  while (--i >= 0 && (mul *= 0x100)) {\\\\n    this[offset + i] = (value / mul) & 0xFF\\\\n  }\\\\n\\\\n  return offset + byteLength\\\\n}\\\\n\\\\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\\\\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\\\\n  this[offset] = (value & 0xff)\\\\n  return offset + 1\\\\n}\\\\n\\\\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\\\\n  if (value < 0) value = 0xffff + value + 1\\\\n  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\\\\n    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\\\\n      (littleEndian ? i : 1 - i) * 8\\\\n  }\\\\n}\\\\n\\\\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value & 0xff)\\\\n    this[offset + 1] = (value >>> 8)\\\\n  } else {\\\\n    objectWriteUInt16(this, value, offset, true)\\\\n  }\\\\n  return offset + 2\\\\n}\\\\n\\\\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value >>> 8)\\\\n    this[offset + 1] = (value & 0xff)\\\\n  } else {\\\\n    objectWriteUInt16(this, value, offset, false)\\\\n  }\\\\n  return offset + 2\\\\n}\\\\n\\\\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\\\\n  if (value < 0) value = 0xffffffff + value + 1\\\\n  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\\\\n    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\\\\n  }\\\\n}\\\\n\\\\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset + 3] = (value >>> 24)\\\\n    this[offset + 2] = (value >>> 16)\\\\n    this[offset + 1] = (value >>> 8)\\\\n    this[offset] = (value & 0xff)\\\\n  } else {\\\\n    objectWriteUInt32(this, value, offset, true)\\\\n  }\\\\n  return offset + 4\\\\n}\\\\n\\\\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value >>> 24)\\\\n    this[offset + 1] = (value >>> 16)\\\\n    this[offset + 2] = (value >>> 8)\\\\n    this[offset + 3] = (value & 0xff)\\\\n  } else {\\\\n    objectWriteUInt32(this, value, offset, false)\\\\n  }\\\\n  return offset + 4\\\\n}\\\\n\\\\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) {\\\\n    var limit = Math.pow(2, 8 * byteLength - 1)\\\\n\\\\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\\\\n  }\\\\n\\\\n  var i = 0\\\\n  var mul = 1\\\\n  var sub = 0\\\\n  this[offset] = value & 0xFF\\\\n  while (++i < byteLength && (mul *= 0x100)) {\\\\n    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\\\\n      sub = 1\\\\n    }\\\\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\\\\n  }\\\\n\\\\n  return offset + byteLength\\\\n}\\\\n\\\\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) {\\\\n    var limit = Math.pow(2, 8 * byteLength - 1)\\\\n\\\\n    checkInt(this, value, offset, byteLength, limit - 1, -limit)\\\\n  }\\\\n\\\\n  var i = byteLength - 1\\\\n  var mul = 1\\\\n  var sub = 0\\\\n  this[offset + i] = value & 0xFF\\\\n  while (--i >= 0 && (mul *= 0x100)) {\\\\n    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\\\\n      sub = 1\\\\n    }\\\\n    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\\\\n  }\\\\n\\\\n  return offset + byteLength\\\\n}\\\\n\\\\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\\\\n  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\\\\n  if (value < 0) value = 0xff + value + 1\\\\n  this[offset] = (value & 0xff)\\\\n  return offset + 1\\\\n}\\\\n\\\\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value & 0xff)\\\\n    this[offset + 1] = (value >>> 8)\\\\n  } else {\\\\n    objectWriteUInt16(this, value, offset, true)\\\\n  }\\\\n  return offset + 2\\\\n}\\\\n\\\\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value >>> 8)\\\\n    this[offset + 1] = (value & 0xff)\\\\n  } else {\\\\n    objectWriteUInt16(this, value, offset, false)\\\\n  }\\\\n  return offset + 2\\\\n}\\\\n\\\\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value & 0xff)\\\\n    this[offset + 1] = (value >>> 8)\\\\n    this[offset + 2] = (value >>> 16)\\\\n    this[offset + 3] = (value >>> 24)\\\\n  } else {\\\\n    objectWriteUInt32(this, value, offset, true)\\\\n  }\\\\n  return offset + 4\\\\n}\\\\n\\\\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\\\\n  value = +value\\\\n  offset = offset | 0\\\\n  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\\\\n  if (value < 0) value = 0xffffffff + value + 1\\\\n  if (Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    this[offset] = (value >>> 24)\\\\n    this[offset + 1] = (value >>> 16)\\\\n    this[offset + 2] = (value >>> 8)\\\\n    this[offset + 3] = (value & 0xff)\\\\n  } else {\\\\n    objectWriteUInt32(this, value, offset, false)\\\\n  }\\\\n  return offset + 4\\\\n}\\\\n\\\\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\\\\n  if (offset + ext > buf.length) throw new RangeError(\'Index out of range\')\\\\n  if (offset < 0) throw new RangeError(\'Index out of range\')\\\\n}\\\\n\\\\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\\\\n  if (!noAssert) {\\\\n    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\\\\n  }\\\\n  ieee754.write(buf, value, offset, littleEndian, 23, 4)\\\\n  return offset + 4\\\\n}\\\\n\\\\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\\\\n  return writeFloat(this, value, offset, true, noAssert)\\\\n}\\\\n\\\\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\\\\n  return writeFloat(this, value, offset, false, noAssert)\\\\n}\\\\n\\\\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\\\\n  if (!noAssert) {\\\\n    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\\\\n  }\\\\n  ieee754.write(buf, value, offset, littleEndian, 52, 8)\\\\n  return offset + 8\\\\n}\\\\n\\\\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\\\\n  return writeDouble(this, value, offset, true, noAssert)\\\\n}\\\\n\\\\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\\\\n  return writeDouble(this, value, offset, false, noAssert)\\\\n}\\\\n\\\\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\\\\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\\\\n  if (!start) start = 0\\\\n  if (!end && end !== 0) end = this.length\\\\n  if (targetStart >= target.length) targetStart = target.length\\\\n  if (!targetStart) targetStart = 0\\\\n  if (end > 0 && end < start) end = start\\\\n\\\\n  // Copy 0 bytes; we\'re done\\\\n  if (end === start) return 0\\\\n  if (target.length === 0 || this.length === 0) return 0\\\\n\\\\n  // Fatal error conditions\\\\n  if (targetStart < 0) {\\\\n    throw new RangeError(\'targetStart out of bounds\')\\\\n  }\\\\n  if (start < 0 || start >= this.length) throw new RangeError(\'sourceStart out of bounds\')\\\\n  if (end < 0) throw new RangeError(\'sourceEnd out of bounds\')\\\\n\\\\n  // Are we oob?\\\\n  if (end > this.length) end = this.length\\\\n  if (target.length - targetStart < end - start) {\\\\n    end = target.length - targetStart + start\\\\n  }\\\\n\\\\n  var len = end - start\\\\n  var i\\\\n\\\\n  if (this === target && start < targetStart && targetStart < end) {\\\\n    // descending copy from end\\\\n    for (i = len - 1; i >= 0; --i) {\\\\n      target[i + targetStart] = this[i + start]\\\\n    }\\\\n  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\\\\n    // ascending copy from start\\\\n    for (i = 0; i < len; ++i) {\\\\n      target[i + targetStart] = this[i + start]\\\\n    }\\\\n  } else {\\\\n    Uint8Array.prototype.set.call(\\\\n      target,\\\\n      this.subarray(start, start + len),\\\\n      targetStart\\\\n    )\\\\n  }\\\\n\\\\n  return len\\\\n}\\\\n\\\\n// Usage:\\\\n//    buffer.fill(number[, offset[, end]])\\\\n//    buffer.fill(buffer[, offset[, end]])\\\\n//    buffer.fill(string[, offset[, end]][, encoding])\\\\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\\\\n  // Handle string cases:\\\\n  if (typeof val === \'string\') {\\\\n    if (typeof start === \'string\') {\\\\n      encoding = start\\\\n      start = 0\\\\n      end = this.length\\\\n    } else if (typeof end === \'string\') {\\\\n      encoding = end\\\\n      end = this.length\\\\n    }\\\\n    if (val.length === 1) {\\\\n      var code = val.charCodeAt(0)\\\\n      if (code < 256) {\\\\n        val = code\\\\n      }\\\\n    }\\\\n    if (encoding !== undefined && typeof encoding !== \'string\') {\\\\n      throw new TypeError(\'encoding must be a string\')\\\\n    }\\\\n    if (typeof encoding === \'string\' && !Buffer.isEncoding(encoding)) {\\\\n      throw new TypeError(\'Unknown encoding: \' + encoding)\\\\n    }\\\\n  } else if (typeof val === \'number\') {\\\\n    val = val & 255\\\\n  }\\\\n\\\\n  // Invalid ranges are not set to a default, so can range check early.\\\\n  if (start < 0 || this.length < start || this.length < end) {\\\\n    throw new RangeError(\'Out of range index\')\\\\n  }\\\\n\\\\n  if (end <= start) {\\\\n    return this\\\\n  }\\\\n\\\\n  start = start >>> 0\\\\n  end = end === undefined ? this.length : end >>> 0\\\\n\\\\n  if (!val) val = 0\\\\n\\\\n  var i\\\\n  if (typeof val === \'number\') {\\\\n    for (i = start; i < end; ++i) {\\\\n      this[i] = val\\\\n    }\\\\n  } else {\\\\n    var bytes = Buffer.isBuffer(val)\\\\n      ? val\\\\n      : utf8ToBytes(new Buffer(val, encoding).toString())\\\\n    var len = bytes.length\\\\n    for (i = 0; i < end - start; ++i) {\\\\n      this[i + start] = bytes[i % len]\\\\n    }\\\\n  }\\\\n\\\\n  return this\\\\n}\\\\n\\\\n// HELPER FUNCTIONS\\\\n// ================\\\\n\\\\nvar INVALID_BASE64_RE = /[^+\\\\\\\\/0-9A-Za-z-_]/g\\\\n\\\\nfunction base64clean (str) {\\\\n  // Node strips out invalid characters like \\\\\\\\n and \\\\\\\\t from the string, base64-js does not\\\\n  str = stringtrim(str).replace(INVALID_BASE64_RE, \'\')\\\\n  // Node converts strings with length < 2 to \'\'\\\\n  if (str.length < 2) return \'\'\\\\n  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\\\\n  while (str.length % 4 !== 0) {\\\\n    str = str + \'=\'\\\\n  }\\\\n  return str\\\\n}\\\\n\\\\nfunction stringtrim (str) {\\\\n  if (str.trim) return str.trim()\\\\n  return str.replace(/^\\\\\\\\s+|\\\\\\\\s+$/g, \'\')\\\\n}\\\\n\\\\nfunction toHex (n) {\\\\n  if (n < 16) return \'0\' + n.toString(16)\\\\n  return n.toString(16)\\\\n}\\\\n\\\\nfunction utf8ToBytes (string, units) {\\\\n  units = units || Infinity\\\\n  var codePoint\\\\n  var length = string.length\\\\n  var leadSurrogate = null\\\\n  var bytes = []\\\\n\\\\n  for (var i = 0; i < length; ++i) {\\\\n    codePoint = string.charCodeAt(i)\\\\n\\\\n    // is surrogate component\\\\n    if (codePoint > 0xD7FF && codePoint < 0xE000) {\\\\n      // last char was a lead\\\\n      if (!leadSurrogate) {\\\\n        // no lead yet\\\\n        if (codePoint > 0xDBFF) {\\\\n          // unexpected trail\\\\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\\\n          continue\\\\n        } else if (i + 1 === length) {\\\\n          // unpaired lead\\\\n          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\\\n          continue\\\\n        }\\\\n\\\\n        // valid lead\\\\n        leadSurrogate = codePoint\\\\n\\\\n        continue\\\\n      }\\\\n\\\\n      // 2 leads in a row\\\\n      if (codePoint < 0xDC00) {\\\\n        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\\\n        leadSurrogate = codePoint\\\\n        continue\\\\n      }\\\\n\\\\n      // valid surrogate pair\\\\n      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\\\\n    } else if (leadSurrogate) {\\\\n      // valid bmp char, but last char was a lead\\\\n      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\\\\n    }\\\\n\\\\n    leadSurrogate = null\\\\n\\\\n    // encode utf8\\\\n    if (codePoint < 0x80) {\\\\n      if ((units -= 1) < 0) break\\\\n      bytes.push(codePoint)\\\\n    } else if (codePoint < 0x800) {\\\\n      if ((units -= 2) < 0) break\\\\n      bytes.push(\\\\n        codePoint >> 0x6 | 0xC0,\\\\n        codePoint & 0x3F | 0x80\\\\n      )\\\\n    } else if (codePoint < 0x10000) {\\\\n      if ((units -= 3) < 0) break\\\\n      bytes.push(\\\\n        codePoint >> 0xC | 0xE0,\\\\n        codePoint >> 0x6 & 0x3F | 0x80,\\\\n        codePoint & 0x3F | 0x80\\\\n      )\\\\n    } else if (codePoint < 0x110000) {\\\\n      if ((units -= 4) < 0) break\\\\n      bytes.push(\\\\n        codePoint >> 0x12 | 0xF0,\\\\n        codePoint >> 0xC & 0x3F | 0x80,\\\\n        codePoint >> 0x6 & 0x3F | 0x80,\\\\n        codePoint & 0x3F | 0x80\\\\n      )\\\\n    } else {\\\\n      throw new Error(\'Invalid code point\')\\\\n    }\\\\n  }\\\\n\\\\n  return bytes\\\\n}\\\\n\\\\nfunction asciiToBytes (str) {\\\\n  var byteArray = []\\\\n  for (var i = 0; i < str.length; ++i) {\\\\n    // Node\'s code seems to be doing this and not & 0x7F..\\\\n    byteArray.push(str.charCodeAt(i) & 0xFF)\\\\n  }\\\\n  return byteArray\\\\n}\\\\n\\\\nfunction utf16leToBytes (str, units) {\\\\n  var c, hi, lo\\\\n  var byteArray = []\\\\n  for (var i = 0; i < str.length; ++i) {\\\\n    if ((units -= 2) < 0) break\\\\n\\\\n    c = str.charCodeAt(i)\\\\n    hi = c >> 8\\\\n    lo = c % 256\\\\n    byteArray.push(lo)\\\\n    byteArray.push(hi)\\\\n  }\\\\n\\\\n  return byteArray\\\\n}\\\\n\\\\nfunction base64ToBytes (str) {\\\\n  return base64.toByteArray(base64clean(str))\\\\n}\\\\n\\\\nfunction blitBuffer (src, dst, offset, length) {\\\\n  for (var i = 0; i < length; ++i) {\\\\n    if ((i + offset >= dst.length) || (i >= src.length)) break\\\\n    dst[i + offset] = src[i]\\\\n  }\\\\n  return i\\\\n}\\\\n\\\\nfunction isnan (val) {\\\\n  return val !== val // eslint-disable-line no-self-compare\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/node-libs-browser/~/buffer/index.js\\\\n// module id = 1\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/node-libs-browser/node_modules/buffer/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* eslint-disable node/no-deprecated-api */\\\\nvar buffer = __webpack_require__(1)\\\\nvar Buffer = buffer.Buffer\\\\n\\\\n// alternative to using Object.keys for old browsers\\\\nfunction copyProps (src, dst) {\\\\n  for (var key in src) {\\\\n    dst[key] = src[key]\\\\n  }\\\\n}\\\\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\\\\n  module.exports = buffer\\\\n} else {\\\\n  // Copy properties from require(\'buffer\')\\\\n  copyProps(buffer, exports)\\\\n  exports.Buffer = SafeBuffer\\\\n}\\\\n\\\\nfunction SafeBuffer (arg, encodingOrOffset, length) {\\\\n  return Buffer(arg, encodingOrOffset, length)\\\\n}\\\\n\\\\n// Copy static methods from Buffer\\\\ncopyProps(Buffer, SafeBuffer)\\\\n\\\\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\\\\n  if (typeof arg === \'number\') {\\\\n    throw new TypeError(\'Argument must not be a number\')\\\\n  }\\\\n  return Buffer(arg, encodingOrOffset, length)\\\\n}\\\\n\\\\nSafeBuffer.alloc = function (size, fill, encoding) {\\\\n  if (typeof size !== \'number\') {\\\\n    throw new TypeError(\'Argument must be a number\')\\\\n  }\\\\n  var buf = Buffer(size)\\\\n  if (fill !== undefined) {\\\\n    if (typeof encoding === \'string\') {\\\\n      buf.fill(fill, encoding)\\\\n    } else {\\\\n      buf.fill(fill)\\\\n    }\\\\n  } else {\\\\n    buf.fill(0)\\\\n  }\\\\n  return buf\\\\n}\\\\n\\\\nSafeBuffer.allocUnsafe = function (size) {\\\\n  if (typeof size !== \'number\') {\\\\n    throw new TypeError(\'Argument must be a number\')\\\\n  }\\\\n  return Buffer(size)\\\\n}\\\\n\\\\nSafeBuffer.allocUnsafeSlow = function (size) {\\\\n  if (typeof size !== \'number\') {\\\\n    throw new TypeError(\'Argument must be a number\')\\\\n  }\\\\n  return buffer.SlowBuffer(size)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/safe-buffer/index.js\\\\n// module id = 2\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/safe-buffer/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\\\\n  \'use strict\';\\\\n\\\\n  // Utils\\\\n  function assert (val, msg) {\\\\n    if (!val) throw new Error(msg || \'Assertion failed\');\\\\n  }\\\\n\\\\n  // Could use `inherits` module, but don\'t want to move from single file\\\\n  // architecture yet.\\\\n  function inherits (ctor, superCtor) {\\\\n    ctor.super_ = superCtor;\\\\n    var TempCtor = function () {};\\\\n    TempCtor.prototype = superCtor.prototype;\\\\n    ctor.prototype = new TempCtor();\\\\n    ctor.prototype.constructor = ctor;\\\\n  }\\\\n\\\\n  // BN\\\\n\\\\n  function BN (number, base, endian) {\\\\n    if (BN.isBN(number)) {\\\\n      return number;\\\\n    }\\\\n\\\\n    this.negative = 0;\\\\n    this.words = null;\\\\n    this.length = 0;\\\\n\\\\n    // Reduction context\\\\n    this.red = null;\\\\n\\\\n    if (number !== null) {\\\\n      if (base === \'le\' || base === \'be\') {\\\\n        endian = base;\\\\n        base = 10;\\\\n      }\\\\n\\\\n      this._init(number || 0, base || 10, endian || \'be\');\\\\n    }\\\\n  }\\\\n  if (typeof module === \'object\') {\\\\n    module.exports = BN;\\\\n  } else {\\\\n    exports.BN = BN;\\\\n  }\\\\n\\\\n  BN.BN = BN;\\\\n  BN.wordSize = 26;\\\\n\\\\n  var Buffer;\\\\n  try {\\\\n    Buffer = __webpack_require__(377).Buffer;\\\\n  } catch (e) {\\\\n  }\\\\n\\\\n  BN.isBN = function isBN (num) {\\\\n    if (num instanceof BN) {\\\\n      return true;\\\\n    }\\\\n\\\\n    return num !== null && typeof num === \'object\' &&\\\\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\\\\n  };\\\\n\\\\n  BN.max = function max (left, right) {\\\\n    if (left.cmp(right) > 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.min = function min (left, right) {\\\\n    if (left.cmp(right) < 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.prototype._init = function init (number, base, endian) {\\\\n    if (typeof number === \'number\') {\\\\n      return this._initNumber(number, base, endian);\\\\n    }\\\\n\\\\n    if (typeof number === \'object\') {\\\\n      return this._initArray(number, base, endian);\\\\n    }\\\\n\\\\n    if (base === \'hex\') {\\\\n      base = 16;\\\\n    }\\\\n    assert(base === (base | 0) && base >= 2 && base <= 36);\\\\n\\\\n    number = number.toString().replace(/\\\\\\\\s+/g, \'\');\\\\n    var start = 0;\\\\n    if (number[0] === \'-\') {\\\\n      start++;\\\\n    }\\\\n\\\\n    if (base === 16) {\\\\n      this._parseHex(number, start);\\\\n    } else {\\\\n      this._parseBase(number, base, start);\\\\n    }\\\\n\\\\n    if (number[0] === \'-\') {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    this.strip();\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\\\\n    if (number < 0) {\\\\n      this.negative = 1;\\\\n      number = -number;\\\\n    }\\\\n    if (number < 0x4000000) {\\\\n      this.words = [ number & 0x3ffffff ];\\\\n      this.length = 1;\\\\n    } else if (number < 0x10000000000000) {\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff\\\\n      ];\\\\n      this.length = 2;\\\\n    } else {\\\\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff,\\\\n        1\\\\n      ];\\\\n      this.length = 3;\\\\n    }\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    // Reverse the bytes\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initArray = function _initArray (number, base, endian) {\\\\n    // Perhaps a Uint8Array\\\\n    assert(typeof number.length === \'number\');\\\\n    if (number.length <= 0) {\\\\n      this.words = [ 0 ];\\\\n      this.length = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.length = Math.ceil(number.length / 3);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    var off = 0;\\\\n    if (endian === \'be\') {\\\\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\\\\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    } else if (endian === \'le\') {\\\\n      for (i = 0, j = 0; i < number.length; i += 3) {\\\\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    }\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  function parseHex (str, start, end) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r <<= 4;\\\\n\\\\n      // \'a\' - \'f\'\\\\n      if (c >= 49 && c <= 54) {\\\\n        r |= c - 49 + 0xa;\\\\n\\\\n      // \'A\' - \'F\'\\\\n      } else if (c >= 17 && c <= 22) {\\\\n        r |= c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r |= c & 0xf;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseHex = function _parseHex (number, start) {\\\\n    // Create possibly bigger array to ensure that it fits the number\\\\n    this.length = Math.ceil((number.length - start) / 6);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    // Scan 24-bit chunks and add them to the number\\\\n    var off = 0;\\\\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\\\\n      w = parseHex(number, i, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n      off += 24;\\\\n      if (off >= 26) {\\\\n        off -= 26;\\\\n        j++;\\\\n      }\\\\n    }\\\\n    if (i + 6 !== start) {\\\\n      w = parseHex(number, start, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n    }\\\\n    this.strip();\\\\n  };\\\\n\\\\n  function parseBase (str, start, end, mul) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r *= mul;\\\\n\\\\n      // \'a\'\\\\n      if (c >= 49) {\\\\n        r += c - 49 + 0xa;\\\\n\\\\n      // \'A\'\\\\n      } else if (c >= 17) {\\\\n        r += c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r += c;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\\\\n    // Initialize as zero\\\\n    this.words = [ 0 ];\\\\n    this.length = 1;\\\\n\\\\n    // Find length of limb in base\\\\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\\\\n      limbLen++;\\\\n    }\\\\n    limbLen--;\\\\n    limbPow = (limbPow / base) | 0;\\\\n\\\\n    var total = number.length - start;\\\\n    var mod = total % limbLen;\\\\n    var end = Math.min(total, total - mod) + start;\\\\n\\\\n    var word = 0;\\\\n    for (var i = start; i < end; i += limbLen) {\\\\n      word = parseBase(number, i, i + limbLen, base);\\\\n\\\\n      this.imuln(limbPow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n\\\\n    if (mod !== 0) {\\\\n      var pow = 1;\\\\n      word = parseBase(number, i, number.length, base);\\\\n\\\\n      for (i = 0; i < mod; i++) {\\\\n        pow *= base;\\\\n      }\\\\n\\\\n      this.imuln(pow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  BN.prototype.copy = function copy (dest) {\\\\n    dest.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      dest.words[i] = this.words[i];\\\\n    }\\\\n    dest.length = this.length;\\\\n    dest.negative = this.negative;\\\\n    dest.red = this.red;\\\\n  };\\\\n\\\\n  BN.prototype.clone = function clone () {\\\\n    var r = new BN(null);\\\\n    this.copy(r);\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype._expand = function _expand (size) {\\\\n    while (this.length < size) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  // Remove leading `0` from `this`\\\\n  BN.prototype.strip = function strip () {\\\\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\\\\n      this.length--;\\\\n    }\\\\n    return this._normSign();\\\\n  };\\\\n\\\\n  BN.prototype._normSign = function _normSign () {\\\\n    // -0 = 0\\\\n    if (this.length === 1 && this.words[0] === 0) {\\\\n      this.negative = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.inspect = function inspect () {\\\\n    return (this.red ? \'<BN-R: \' : \'<BN: \') + this.toString(16) + \'>\';\\\\n  };\\\\n\\\\n  /*\\\\n\\\\n  var zeros = [];\\\\n  var groupSizes = [];\\\\n  var groupBases = [];\\\\n\\\\n  var s = \'\';\\\\n  var i = -1;\\\\n  while (++i < BN.wordSize) {\\\\n    zeros[i] = s;\\\\n    s += \'0\';\\\\n  }\\\\n  groupSizes[0] = 0;\\\\n  groupSizes[1] = 0;\\\\n  groupBases[0] = 0;\\\\n  groupBases[1] = 0;\\\\n  var base = 2 - 1;\\\\n  while (++base < 36 + 1) {\\\\n    var groupSize = 0;\\\\n    var groupBase = 1;\\\\n    while (groupBase < (1 << BN.wordSize) / base) {\\\\n      groupBase *= base;\\\\n      groupSize += 1;\\\\n    }\\\\n    groupSizes[base] = groupSize;\\\\n    groupBases[base] = groupBase;\\\\n  }\\\\n\\\\n  */\\\\n\\\\n  var zeros = [\\\\n    \'\',\\\\n    \'0\',\\\\n    \'00\',\\\\n    \'000\',\\\\n    \'0000\',\\\\n    \'00000\',\\\\n    \'000000\',\\\\n    \'0000000\',\\\\n    \'00000000\',\\\\n    \'000000000\',\\\\n    \'0000000000\',\\\\n    \'00000000000\',\\\\n    \'000000000000\',\\\\n    \'0000000000000\',\\\\n    \'00000000000000\',\\\\n    \'000000000000000\',\\\\n    \'0000000000000000\',\\\\n    \'00000000000000000\',\\\\n    \'000000000000000000\',\\\\n    \'0000000000000000000\',\\\\n    \'00000000000000000000\',\\\\n    \'000000000000000000000\',\\\\n    \'0000000000000000000000\',\\\\n    \'00000000000000000000000\',\\\\n    \'000000000000000000000000\',\\\\n    \'0000000000000000000000000\'\\\\n  ];\\\\n\\\\n  var groupSizes = [\\\\n    0, 0,\\\\n    25, 16, 12, 11, 10, 9, 8,\\\\n    8, 7, 7, 7, 7, 6, 6,\\\\n    6, 6, 6, 6, 6, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5\\\\n  ];\\\\n\\\\n  var groupBases = [\\\\n    0, 0,\\\\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\\\\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\\\\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\\\\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\\\\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\\\\n  ];\\\\n\\\\n  BN.prototype.toString = function toString (base, padding) {\\\\n    base = base || 10;\\\\n    padding = padding | 0 || 1;\\\\n\\\\n    var out;\\\\n    if (base === 16 || base === \'hex\') {\\\\n      out = \'\';\\\\n      var off = 0;\\\\n      var carry = 0;\\\\n      for (var i = 0; i < this.length; i++) {\\\\n        var w = this.words[i];\\\\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\\\\n        carry = (w >>> (24 - off)) & 0xffffff;\\\\n        if (carry !== 0 || i !== this.length - 1) {\\\\n          out = zeros[6 - word.length] + word + out;\\\\n        } else {\\\\n          out = word + out;\\\\n        }\\\\n        off += 2;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          i--;\\\\n        }\\\\n      }\\\\n      if (carry !== 0) {\\\\n        out = carry.toString(16) + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    if (base === (base | 0) && base >= 2 && base <= 36) {\\\\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\\\\n      var groupSize = groupSizes[base];\\\\n      // var groupBase = Math.pow(base, groupSize);\\\\n      var groupBase = groupBases[base];\\\\n      out = \'\';\\\\n      var c = this.clone();\\\\n      c.negative = 0;\\\\n      while (!c.isZero()) {\\\\n        var r = c.modn(groupBase).toString(base);\\\\n        c = c.idivn(groupBase);\\\\n\\\\n        if (!c.isZero()) {\\\\n          out = zeros[groupSize - r.length] + r + out;\\\\n        } else {\\\\n          out = r + out;\\\\n        }\\\\n      }\\\\n      if (this.isZero()) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    assert(false, \'Base should be between 2 and 36\');\\\\n  };\\\\n\\\\n  BN.prototype.toNumber = function toNumber () {\\\\n    var ret = this.words[0];\\\\n    if (this.length === 2) {\\\\n      ret += this.words[1] * 0x4000000;\\\\n    } else if (this.length === 3 && this.words[2] === 0x01) {\\\\n      // NOTE: at this stage it is known that the top bit is set\\\\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\\\\n    } else if (this.length > 2) {\\\\n      assert(false, \'Number can only safely store up to 53 bits\');\\\\n    }\\\\n    return (this.negative !== 0) ? -ret : ret;\\\\n  };\\\\n\\\\n  BN.prototype.toJSON = function toJSON () {\\\\n    return this.toString(16);\\\\n  };\\\\n\\\\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\\\\n    assert(typeof Buffer !== \'undefined\');\\\\n    return this.toArrayLike(Buffer, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArray = function toArray (endian, length) {\\\\n    return this.toArrayLike(Array, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\\\\n    var byteLength = this.byteLength();\\\\n    var reqLength = length || Math.max(1, byteLength);\\\\n    assert(byteLength <= reqLength, \'byte array longer than desired length\');\\\\n    assert(reqLength > 0, \'Requested array length <= 0\');\\\\n\\\\n    this.strip();\\\\n    var littleEndian = endian === \'le\';\\\\n    var res = new ArrayType(reqLength);\\\\n\\\\n    var b, i;\\\\n    var q = this.clone();\\\\n    if (!littleEndian) {\\\\n      // Assume big-endian\\\\n      for (i = 0; i < reqLength - byteLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[reqLength - i - 1] = b;\\\\n      }\\\\n    } else {\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[i] = b;\\\\n      }\\\\n\\\\n      for (; i < reqLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  if (Math.clz32) {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      return 32 - Math.clz32(w);\\\\n    };\\\\n  } else {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      var t = w;\\\\n      var r = 0;\\\\n      if (t >= 0x1000) {\\\\n        r += 13;\\\\n        t >>>= 13;\\\\n      }\\\\n      if (t >= 0x40) {\\\\n        r += 7;\\\\n        t >>>= 7;\\\\n      }\\\\n      if (t >= 0x8) {\\\\n        r += 4;\\\\n        t >>>= 4;\\\\n      }\\\\n      if (t >= 0x02) {\\\\n        r += 2;\\\\n        t >>>= 2;\\\\n      }\\\\n      return r + t;\\\\n    };\\\\n  }\\\\n\\\\n  BN.prototype._zeroBits = function _zeroBits (w) {\\\\n    // Short-cut\\\\n    if (w === 0) return 26;\\\\n\\\\n    var t = w;\\\\n    var r = 0;\\\\n    if ((t & 0x1fff) === 0) {\\\\n      r += 13;\\\\n      t >>>= 13;\\\\n    }\\\\n    if ((t & 0x7f) === 0) {\\\\n      r += 7;\\\\n      t >>>= 7;\\\\n    }\\\\n    if ((t & 0xf) === 0) {\\\\n      r += 4;\\\\n      t >>>= 4;\\\\n    }\\\\n    if ((t & 0x3) === 0) {\\\\n      r += 2;\\\\n      t >>>= 2;\\\\n    }\\\\n    if ((t & 0x1) === 0) {\\\\n      r++;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  // Return number of used bits in a BN\\\\n  BN.prototype.bitLength = function bitLength () {\\\\n    var w = this.words[this.length - 1];\\\\n    var hi = this._countBits(w);\\\\n    return (this.length - 1) * 26 + hi;\\\\n  };\\\\n\\\\n  function toBitArray (num) {\\\\n    var w = new Array(num.bitLength());\\\\n\\\\n    for (var bit = 0; bit < w.length; bit++) {\\\\n      var off = (bit / 26) | 0;\\\\n      var wbit = bit % 26;\\\\n\\\\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\\\\n    }\\\\n\\\\n    return w;\\\\n  }\\\\n\\\\n  // Number of trailing zero bits\\\\n  BN.prototype.zeroBits = function zeroBits () {\\\\n    if (this.isZero()) return 0;\\\\n\\\\n    var r = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var b = this._zeroBits(this.words[i]);\\\\n      r += b;\\\\n      if (b !== 26) break;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype.byteLength = function byteLength () {\\\\n    return Math.ceil(this.bitLength() / 8);\\\\n  };\\\\n\\\\n  BN.prototype.toTwos = function toTwos (width) {\\\\n    if (this.negative !== 0) {\\\\n      return this.abs().inotn(width).iaddn(1);\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.fromTwos = function fromTwos (width) {\\\\n    if (this.testn(width - 1)) {\\\\n      return this.notn(width).iaddn(1).ineg();\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.isNeg = function isNeg () {\\\\n    return this.negative !== 0;\\\\n  };\\\\n\\\\n  // Return negative clone of `this`\\\\n  BN.prototype.neg = function neg () {\\\\n    return this.clone().ineg();\\\\n  };\\\\n\\\\n  BN.prototype.ineg = function ineg () {\\\\n    if (!this.isZero()) {\\\\n      this.negative ^= 1;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Or `num` with `this` in-place\\\\n  BN.prototype.iuor = function iuor (num) {\\\\n    while (this.length < num.length) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      this.words[i] = this.words[i] | num.words[i];\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ior = function ior (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuor(num);\\\\n  };\\\\n\\\\n  // Or `num` with `this`\\\\n  BN.prototype.or = function or (num) {\\\\n    if (this.length > num.length) return this.clone().ior(num);\\\\n    return num.clone().ior(this);\\\\n  };\\\\n\\\\n  BN.prototype.uor = function uor (num) {\\\\n    if (this.length > num.length) return this.clone().iuor(num);\\\\n    return num.clone().iuor(this);\\\\n  };\\\\n\\\\n  // And `num` with `this` in-place\\\\n  BN.prototype.iuand = function iuand (num) {\\\\n    // b = min-length(num, this)\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      b = num;\\\\n    } else {\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = this.words[i] & num.words[i];\\\\n    }\\\\n\\\\n    this.length = b.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.iand = function iand (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuand(num);\\\\n  };\\\\n\\\\n  // And `num` with `this`\\\\n  BN.prototype.and = function and (num) {\\\\n    if (this.length > num.length) return this.clone().iand(num);\\\\n    return num.clone().iand(this);\\\\n  };\\\\n\\\\n  BN.prototype.uand = function uand (num) {\\\\n    if (this.length > num.length) return this.clone().iuand(num);\\\\n    return num.clone().iuand(this);\\\\n  };\\\\n\\\\n  // Xor `num` with `this` in-place\\\\n  BN.prototype.iuxor = function iuxor (num) {\\\\n    // a.length > b.length\\\\n    var a;\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = a.words[i] ^ b.words[i];\\\\n    }\\\\n\\\\n    if (this !== a) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ixor = function ixor (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuxor(num);\\\\n  };\\\\n\\\\n  // Xor `num` with `this`\\\\n  BN.prototype.xor = function xor (num) {\\\\n    if (this.length > num.length) return this.clone().ixor(num);\\\\n    return num.clone().ixor(this);\\\\n  };\\\\n\\\\n  BN.prototype.uxor = function uxor (num) {\\\\n    if (this.length > num.length) return this.clone().iuxor(num);\\\\n    return num.clone().iuxor(this);\\\\n  };\\\\n\\\\n  // Not ``this`` with ``width`` bitwidth\\\\n  BN.prototype.inotn = function inotn (width) {\\\\n    assert(typeof width === \'number\' && width >= 0);\\\\n\\\\n    var bytesNeeded = Math.ceil(width / 26) | 0;\\\\n    var bitsLeft = width % 26;\\\\n\\\\n    // Extend the buffer with leading zeroes\\\\n    this._expand(bytesNeeded);\\\\n\\\\n    if (bitsLeft > 0) {\\\\n      bytesNeeded--;\\\\n    }\\\\n\\\\n    // Handle complete words\\\\n    for (var i = 0; i < bytesNeeded; i++) {\\\\n      this.words[i] = ~this.words[i] & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Handle the residue\\\\n    if (bitsLeft > 0) {\\\\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\\\\n    }\\\\n\\\\n    // And remove leading zeroes\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.notn = function notn (width) {\\\\n    return this.clone().inotn(width);\\\\n  };\\\\n\\\\n  // Set `bit` of `this`\\\\n  BN.prototype.setn = function setn (bit, val) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n\\\\n    var off = (bit / 26) | 0;\\\\n    var wbit = bit % 26;\\\\n\\\\n    this._expand(off + 1);\\\\n\\\\n    if (val) {\\\\n      this.words[off] = this.words[off] | (1 << wbit);\\\\n    } else {\\\\n      this.words[off] = this.words[off] & ~(1 << wbit);\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Add `num` to `this` in-place\\\\n  BN.prototype.iadd = function iadd (num) {\\\\n    var r;\\\\n\\\\n    // negative + positive\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      this.negative = 0;\\\\n      r = this.isub(num);\\\\n      this.negative ^= 1;\\\\n      return this._normSign();\\\\n\\\\n    // positive + negative\\\\n    } else if (this.negative === 0 && num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      r = this.isub(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n    }\\\\n\\\\n    // a.length > b.length\\\\n    var a, b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n    if (carry !== 0) {\\\\n      this.words[this.length] = carry;\\\\n      this.length++;\\\\n    // Copy the rest of the words\\\\n    } else if (a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Add `num` to `this`\\\\n  BN.prototype.add = function add (num) {\\\\n    var res;\\\\n    if (num.negative !== 0 && this.negative === 0) {\\\\n      num.negative = 0;\\\\n      res = this.sub(num);\\\\n      num.negative ^= 1;\\\\n      return res;\\\\n    } else if (num.negative === 0 && this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      res = num.sub(this);\\\\n      this.negative = 1;\\\\n      return res;\\\\n    }\\\\n\\\\n    if (this.length > num.length) return this.clone().iadd(num);\\\\n\\\\n    return num.clone().iadd(this);\\\\n  };\\\\n\\\\n  // Subtract `num` from `this` in-place\\\\n  BN.prototype.isub = function isub (num) {\\\\n    // this - (-num) = this + num\\\\n    if (num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      var r = this.iadd(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n\\\\n    // -this - num = -(this + num)\\\\n    } else if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iadd(num);\\\\n      this.negative = 1;\\\\n      return this._normSign();\\\\n    }\\\\n\\\\n    // At this point both numbers are positive\\\\n    var cmp = this.cmp(num);\\\\n\\\\n    // Optimization - zeroify\\\\n    if (cmp === 0) {\\\\n      this.negative = 0;\\\\n      this.length = 1;\\\\n      this.words[0] = 0;\\\\n      return this;\\\\n    }\\\\n\\\\n    // a > b\\\\n    var a, b;\\\\n    if (cmp > 0) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Copy rest of the words\\\\n    if (carry === 0 && i < a.length && a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = Math.max(this.length, i);\\\\n\\\\n    if (a !== this) {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Subtract `num` from `this`\\\\n  BN.prototype.sub = function sub (num) {\\\\n    return this.clone().isub(num);\\\\n  };\\\\n\\\\n  function smallMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    var len = (self.length + num.length) | 0;\\\\n    out.length = len;\\\\n    len = (len - 1) | 0;\\\\n\\\\n    // Peel one iteration (compiler can\'t do it, because of code complexity)\\\\n    var a = self.words[0] | 0;\\\\n    var b = num.words[0] | 0;\\\\n    var r = a * b;\\\\n\\\\n    var lo = r & 0x3ffffff;\\\\n    var carry = (r / 0x4000000) | 0;\\\\n    out.words[0] = lo;\\\\n\\\\n    for (var k = 1; k < len; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = carry >>> 26;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = (k - j) | 0;\\\\n        a = self.words[i] | 0;\\\\n        b = num.words[j] | 0;\\\\n        r = a * b + rword;\\\\n        ncarry += (r / 0x4000000) | 0;\\\\n        rword = r & 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword | 0;\\\\n      carry = ncarry | 0;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry | 0;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  // TODO(indutny): it may be reasonable to omit it for users who don\'t need\\\\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\\\\n  // multiplication (like elliptic secp256k1).\\\\n  var comb10MulTo = function comb10MulTo (self, num, out) {\\\\n    var a = self.words;\\\\n    var b = num.words;\\\\n    var o = out.words;\\\\n    var c = 0;\\\\n    var lo;\\\\n    var mid;\\\\n    var hi;\\\\n    var a0 = a[0] | 0;\\\\n    var al0 = a0 & 0x1fff;\\\\n    var ah0 = a0 >>> 13;\\\\n    var a1 = a[1] | 0;\\\\n    var al1 = a1 & 0x1fff;\\\\n    var ah1 = a1 >>> 13;\\\\n    var a2 = a[2] | 0;\\\\n    var al2 = a2 & 0x1fff;\\\\n    var ah2 = a2 >>> 13;\\\\n    var a3 = a[3] | 0;\\\\n    var al3 = a3 & 0x1fff;\\\\n    var ah3 = a3 >>> 13;\\\\n    var a4 = a[4] | 0;\\\\n    var al4 = a4 & 0x1fff;\\\\n    var ah4 = a4 >>> 13;\\\\n    var a5 = a[5] | 0;\\\\n    var al5 = a5 & 0x1fff;\\\\n    var ah5 = a5 >>> 13;\\\\n    var a6 = a[6] | 0;\\\\n    var al6 = a6 & 0x1fff;\\\\n    var ah6 = a6 >>> 13;\\\\n    var a7 = a[7] | 0;\\\\n    var al7 = a7 & 0x1fff;\\\\n    var ah7 = a7 >>> 13;\\\\n    var a8 = a[8] | 0;\\\\n    var al8 = a8 & 0x1fff;\\\\n    var ah8 = a8 >>> 13;\\\\n    var a9 = a[9] | 0;\\\\n    var al9 = a9 & 0x1fff;\\\\n    var ah9 = a9 >>> 13;\\\\n    var b0 = b[0] | 0;\\\\n    var bl0 = b0 & 0x1fff;\\\\n    var bh0 = b0 >>> 13;\\\\n    var b1 = b[1] | 0;\\\\n    var bl1 = b1 & 0x1fff;\\\\n    var bh1 = b1 >>> 13;\\\\n    var b2 = b[2] | 0;\\\\n    var bl2 = b2 & 0x1fff;\\\\n    var bh2 = b2 >>> 13;\\\\n    var b3 = b[3] | 0;\\\\n    var bl3 = b3 & 0x1fff;\\\\n    var bh3 = b3 >>> 13;\\\\n    var b4 = b[4] | 0;\\\\n    var bl4 = b4 & 0x1fff;\\\\n    var bh4 = b4 >>> 13;\\\\n    var b5 = b[5] | 0;\\\\n    var bl5 = b5 & 0x1fff;\\\\n    var bh5 = b5 >>> 13;\\\\n    var b6 = b[6] | 0;\\\\n    var bl6 = b6 & 0x1fff;\\\\n    var bh6 = b6 >>> 13;\\\\n    var b7 = b[7] | 0;\\\\n    var bl7 = b7 & 0x1fff;\\\\n    var bh7 = b7 >>> 13;\\\\n    var b8 = b[8] | 0;\\\\n    var bl8 = b8 & 0x1fff;\\\\n    var bh8 = b8 >>> 13;\\\\n    var b9 = b[9] | 0;\\\\n    var bl9 = b9 & 0x1fff;\\\\n    var bh9 = b9 >>> 13;\\\\n\\\\n    out.negative = self.negative ^ num.negative;\\\\n    out.length = 19;\\\\n    /* k = 0 */\\\\n    lo = Math.imul(al0, bl0);\\\\n    mid = Math.imul(al0, bh0);\\\\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\\\\n    hi = Math.imul(ah0, bh0);\\\\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\\\\n    w0 &= 0x3ffffff;\\\\n    /* k = 1 */\\\\n    lo = Math.imul(al1, bl0);\\\\n    mid = Math.imul(al1, bh0);\\\\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\\\\n    hi = Math.imul(ah1, bh0);\\\\n    lo = (lo + Math.imul(al0, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\\\\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\\\\n    w1 &= 0x3ffffff;\\\\n    /* k = 2 */\\\\n    lo = Math.imul(al2, bl0);\\\\n    mid = Math.imul(al2, bh0);\\\\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\\\\n    hi = Math.imul(ah2, bh0);\\\\n    lo = (lo + Math.imul(al1, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\\\\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\\\\n    w2 &= 0x3ffffff;\\\\n    /* k = 3 */\\\\n    lo = Math.imul(al3, bl0);\\\\n    mid = Math.imul(al3, bh0);\\\\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\\\\n    hi = Math.imul(ah3, bh0);\\\\n    lo = (lo + Math.imul(al2, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\\\\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\\\\n    w3 &= 0x3ffffff;\\\\n    /* k = 4 */\\\\n    lo = Math.imul(al4, bl0);\\\\n    mid = Math.imul(al4, bh0);\\\\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\\\\n    hi = Math.imul(ah4, bh0);\\\\n    lo = (lo + Math.imul(al3, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\\\\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\\\\n    w4 &= 0x3ffffff;\\\\n    /* k = 5 */\\\\n    lo = Math.imul(al5, bl0);\\\\n    mid = Math.imul(al5, bh0);\\\\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\\\\n    hi = Math.imul(ah5, bh0);\\\\n    lo = (lo + Math.imul(al4, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\\\\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\\\\n    w5 &= 0x3ffffff;\\\\n    /* k = 6 */\\\\n    lo = Math.imul(al6, bl0);\\\\n    mid = Math.imul(al6, bh0);\\\\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\\\\n    hi = Math.imul(ah6, bh0);\\\\n    lo = (lo + Math.imul(al5, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\\\\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\\\\n    w6 &= 0x3ffffff;\\\\n    /* k = 7 */\\\\n    lo = Math.imul(al7, bl0);\\\\n    mid = Math.imul(al7, bh0);\\\\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\\\\n    hi = Math.imul(ah7, bh0);\\\\n    lo = (lo + Math.imul(al6, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\\\\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\\\\n    w7 &= 0x3ffffff;\\\\n    /* k = 8 */\\\\n    lo = Math.imul(al8, bl0);\\\\n    mid = Math.imul(al8, bh0);\\\\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\\\\n    hi = Math.imul(ah8, bh0);\\\\n    lo = (lo + Math.imul(al7, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\\\\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\\\\n    w8 &= 0x3ffffff;\\\\n    /* k = 9 */\\\\n    lo = Math.imul(al9, bl0);\\\\n    mid = Math.imul(al9, bh0);\\\\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\\\\n    hi = Math.imul(ah9, bh0);\\\\n    lo = (lo + Math.imul(al8, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\\\\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\\\\n    w9 &= 0x3ffffff;\\\\n    /* k = 10 */\\\\n    lo = Math.imul(al9, bl1);\\\\n    mid = Math.imul(al9, bh1);\\\\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\\\\n    hi = Math.imul(ah9, bh1);\\\\n    lo = (lo + Math.imul(al8, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\\\\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\\\\n    w10 &= 0x3ffffff;\\\\n    /* k = 11 */\\\\n    lo = Math.imul(al9, bl2);\\\\n    mid = Math.imul(al9, bh2);\\\\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\\\\n    hi = Math.imul(ah9, bh2);\\\\n    lo = (lo + Math.imul(al8, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\\\\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\\\\n    w11 &= 0x3ffffff;\\\\n    /* k = 12 */\\\\n    lo = Math.imul(al9, bl3);\\\\n    mid = Math.imul(al9, bh3);\\\\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\\\\n    hi = Math.imul(ah9, bh3);\\\\n    lo = (lo + Math.imul(al8, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\\\\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\\\\n    w12 &= 0x3ffffff;\\\\n    /* k = 13 */\\\\n    lo = Math.imul(al9, bl4);\\\\n    mid = Math.imul(al9, bh4);\\\\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\\\\n    hi = Math.imul(ah9, bh4);\\\\n    lo = (lo + Math.imul(al8, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\\\\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\\\\n    w13 &= 0x3ffffff;\\\\n    /* k = 14 */\\\\n    lo = Math.imul(al9, bl5);\\\\n    mid = Math.imul(al9, bh5);\\\\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\\\\n    hi = Math.imul(ah9, bh5);\\\\n    lo = (lo + Math.imul(al8, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\\\\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\\\\n    w14 &= 0x3ffffff;\\\\n    /* k = 15 */\\\\n    lo = Math.imul(al9, bl6);\\\\n    mid = Math.imul(al9, bh6);\\\\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\\\\n    hi = Math.imul(ah9, bh6);\\\\n    lo = (lo + Math.imul(al8, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\\\\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\\\\n    w15 &= 0x3ffffff;\\\\n    /* k = 16 */\\\\n    lo = Math.imul(al9, bl7);\\\\n    mid = Math.imul(al9, bh7);\\\\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\\\\n    hi = Math.imul(ah9, bh7);\\\\n    lo = (lo + Math.imul(al8, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\\\\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\\\\n    w16 &= 0x3ffffff;\\\\n    /* k = 17 */\\\\n    lo = Math.imul(al9, bl8);\\\\n    mid = Math.imul(al9, bh8);\\\\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\\\\n    hi = Math.imul(ah9, bh8);\\\\n    lo = (lo + Math.imul(al8, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\\\\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\\\\n    w17 &= 0x3ffffff;\\\\n    /* k = 18 */\\\\n    lo = Math.imul(al9, bl9);\\\\n    mid = Math.imul(al9, bh9);\\\\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\\\\n    hi = Math.imul(ah9, bh9);\\\\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\\\\n    w18 &= 0x3ffffff;\\\\n    o[0] = w0;\\\\n    o[1] = w1;\\\\n    o[2] = w2;\\\\n    o[3] = w3;\\\\n    o[4] = w4;\\\\n    o[5] = w5;\\\\n    o[6] = w6;\\\\n    o[7] = w7;\\\\n    o[8] = w8;\\\\n    o[9] = w9;\\\\n    o[10] = w10;\\\\n    o[11] = w11;\\\\n    o[12] = w12;\\\\n    o[13] = w13;\\\\n    o[14] = w14;\\\\n    o[15] = w15;\\\\n    o[16] = w16;\\\\n    o[17] = w17;\\\\n    o[18] = w18;\\\\n    if (c !== 0) {\\\\n      o[19] = c;\\\\n      out.length++;\\\\n    }\\\\n    return out;\\\\n  };\\\\n\\\\n  // Polyfill comb\\\\n  if (!Math.imul) {\\\\n    comb10MulTo = smallMulTo;\\\\n  }\\\\n\\\\n  function bigMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    out.length = self.length + num.length;\\\\n\\\\n    var carry = 0;\\\\n    var hncarry = 0;\\\\n    for (var k = 0; k < out.length - 1; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = hncarry;\\\\n      hncarry = 0;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = k - j;\\\\n        var a = self.words[i] | 0;\\\\n        var b = num.words[j] | 0;\\\\n        var r = a * b;\\\\n\\\\n        var lo = r & 0x3ffffff;\\\\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\\\\n        lo = (lo + rword) | 0;\\\\n        rword = lo & 0x3ffffff;\\\\n        ncarry = (ncarry + (lo >>> 26)) | 0;\\\\n\\\\n        hncarry += ncarry >>> 26;\\\\n        ncarry &= 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword;\\\\n      carry = ncarry;\\\\n      ncarry = hncarry;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  function jumboMulTo (self, num, out) {\\\\n    var fftm = new FFTM();\\\\n    return fftm.mulp(self, num, out);\\\\n  }\\\\n\\\\n  BN.prototype.mulTo = function mulTo (num, out) {\\\\n    var res;\\\\n    var len = this.length + num.length;\\\\n    if (this.length === 10 && num.length === 10) {\\\\n      res = comb10MulTo(this, num, out);\\\\n    } else if (len < 63) {\\\\n      res = smallMulTo(this, num, out);\\\\n    } else if (len < 1024) {\\\\n      res = bigMulTo(this, num, out);\\\\n    } else {\\\\n      res = jumboMulTo(this, num, out);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Cooley-Tukey algorithm for FFT\\\\n  // slightly revisited to rely on looping instead of recursion\\\\n\\\\n  function FFTM (x, y) {\\\\n    this.x = x;\\\\n    this.y = y;\\\\n  }\\\\n\\\\n  FFTM.prototype.makeRBT = function makeRBT (N) {\\\\n    var t = new Array(N);\\\\n    var l = BN.prototype._countBits(N) - 1;\\\\n    for (var i = 0; i < N; i++) {\\\\n      t[i] = this.revBin(i, l, N);\\\\n    }\\\\n\\\\n    return t;\\\\n  };\\\\n\\\\n  // Returns binary-reversed representation of `x`\\\\n  FFTM.prototype.revBin = function revBin (x, l, N) {\\\\n    if (x === 0 || x === N - 1) return x;\\\\n\\\\n    var rb = 0;\\\\n    for (var i = 0; i < l; i++) {\\\\n      rb |= (x & 1) << (l - i - 1);\\\\n      x >>= 1;\\\\n    }\\\\n\\\\n    return rb;\\\\n  };\\\\n\\\\n  // Performs \\\\\\"tweedling\\\\\\" phase, therefore \'emulating\'\\\\n  // behaviour of the recursive algorithm\\\\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\\\\n    for (var i = 0; i < N; i++) {\\\\n      rtws[i] = rws[rbt[i]];\\\\n      itws[i] = iws[rbt[i]];\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\\\\n    this.permute(rbt, rws, iws, rtws, itws, N);\\\\n\\\\n    for (var s = 1; s < N; s <<= 1) {\\\\n      var l = s << 1;\\\\n\\\\n      var rtwdf = Math.cos(2 * Math.PI / l);\\\\n      var itwdf = Math.sin(2 * Math.PI / l);\\\\n\\\\n      for (var p = 0; p < N; p += l) {\\\\n        var rtwdf_ = rtwdf;\\\\n        var itwdf_ = itwdf;\\\\n\\\\n        for (var j = 0; j < s; j++) {\\\\n          var re = rtws[p + j];\\\\n          var ie = itws[p + j];\\\\n\\\\n          var ro = rtws[p + j + s];\\\\n          var io = itws[p + j + s];\\\\n\\\\n          var rx = rtwdf_ * ro - itwdf_ * io;\\\\n\\\\n          io = rtwdf_ * io + itwdf_ * ro;\\\\n          ro = rx;\\\\n\\\\n          rtws[p + j] = re + ro;\\\\n          itws[p + j] = ie + io;\\\\n\\\\n          rtws[p + j + s] = re - ro;\\\\n          itws[p + j + s] = ie - io;\\\\n\\\\n          /* jshint maxdepth : false */\\\\n          if (j !== l) {\\\\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\\\\n\\\\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\\\\n            rtwdf_ = rx;\\\\n          }\\\\n        }\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\\\\n    var N = Math.max(m, n) | 1;\\\\n    var odd = N & 1;\\\\n    var i = 0;\\\\n    for (N = N / 2 | 0; N; N = N >>> 1) {\\\\n      i++;\\\\n    }\\\\n\\\\n    return 1 << i + 1 + odd;\\\\n  };\\\\n\\\\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\\\\n    if (N <= 1) return;\\\\n\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var t = rws[i];\\\\n\\\\n      rws[i] = rws[N - i - 1];\\\\n      rws[N - i - 1] = t;\\\\n\\\\n      t = iws[i];\\\\n\\\\n      iws[i] = -iws[N - i - 1];\\\\n      iws[N - i - 1] = -t;\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\\\\n        Math.round(ws[2 * i] / N) +\\\\n        carry;\\\\n\\\\n      ws[i] = w & 0x3ffffff;\\\\n\\\\n      if (w < 0x4000000) {\\\\n        carry = 0;\\\\n      } else {\\\\n        carry = w / 0x4000000 | 0;\\\\n      }\\\\n    }\\\\n\\\\n    return ws;\\\\n  };\\\\n\\\\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < len; i++) {\\\\n      carry = carry + (ws[i] | 0);\\\\n\\\\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\\\\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\\\\n    }\\\\n\\\\n    // Pad with zeroes\\\\n    for (i = 2 * len; i < N; ++i) {\\\\n      rws[i] = 0;\\\\n    }\\\\n\\\\n    assert(carry === 0);\\\\n    assert((carry & ~0x1fff) === 0);\\\\n  };\\\\n\\\\n  FFTM.prototype.stub = function stub (N) {\\\\n    var ph = new Array(N);\\\\n    for (var i = 0; i < N; i++) {\\\\n      ph[i] = 0;\\\\n    }\\\\n\\\\n    return ph;\\\\n  };\\\\n\\\\n  FFTM.prototype.mulp = function mulp (x, y, out) {\\\\n    var N = 2 * this.guessLen13b(x.length, y.length);\\\\n\\\\n    var rbt = this.makeRBT(N);\\\\n\\\\n    var _ = this.stub(N);\\\\n\\\\n    var rws = new Array(N);\\\\n    var rwst = new Array(N);\\\\n    var iwst = new Array(N);\\\\n\\\\n    var nrws = new Array(N);\\\\n    var nrwst = new Array(N);\\\\n    var niwst = new Array(N);\\\\n\\\\n    var rmws = out.words;\\\\n    rmws.length = N;\\\\n\\\\n    this.convert13b(x.words, x.length, rws, N);\\\\n    this.convert13b(y.words, y.length, nrws, N);\\\\n\\\\n    this.transform(rws, _, rwst, iwst, N, rbt);\\\\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\\\\n\\\\n    for (var i = 0; i < N; i++) {\\\\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\\\\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\\\\n      rwst[i] = rx;\\\\n    }\\\\n\\\\n    this.conjugate(rwst, iwst, N);\\\\n    this.transform(rwst, iwst, rmws, _, N, rbt);\\\\n    this.conjugate(rmws, _, N);\\\\n    this.normalize13b(rmws, N);\\\\n\\\\n    out.negative = x.negative ^ y.negative;\\\\n    out.length = x.length + y.length;\\\\n    return out.strip();\\\\n  };\\\\n\\\\n  // Multiply `this` by `num`\\\\n  BN.prototype.mul = function mul (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return this.mulTo(num, out);\\\\n  };\\\\n\\\\n  // Multiply employing FFT\\\\n  BN.prototype.mulf = function mulf (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return jumboMulTo(this, num, out);\\\\n  };\\\\n\\\\n  // In-place Multiplication\\\\n  BN.prototype.imul = function imul (num) {\\\\n    return this.clone().mulTo(num, this);\\\\n  };\\\\n\\\\n  BN.prototype.imuln = function imuln (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n\\\\n    // Carry\\\\n    var carry = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var w = (this.words[i] | 0) * num;\\\\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\\\\n      carry >>= 26;\\\\n      carry += (w / 0x4000000) | 0;\\\\n      // NOTE: lo is 27bit maximum\\\\n      carry += lo >>> 26;\\\\n      this.words[i] = lo & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.muln = function muln (num) {\\\\n    return this.clone().imuln(num);\\\\n  };\\\\n\\\\n  // `this` * `this`\\\\n  BN.prototype.sqr = function sqr () {\\\\n    return this.mul(this);\\\\n  };\\\\n\\\\n  // `this` * `this` in-place\\\\n  BN.prototype.isqr = function isqr () {\\\\n    return this.imul(this.clone());\\\\n  };\\\\n\\\\n  // Math.pow(`this`, `num`)\\\\n  BN.prototype.pow = function pow (num) {\\\\n    var w = toBitArray(num);\\\\n    if (w.length === 0) return new BN(1);\\\\n\\\\n    // Skip leading zeroes\\\\n    var res = this;\\\\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\\\\n      if (w[i] !== 0) break;\\\\n    }\\\\n\\\\n    if (++i < w.length) {\\\\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\\\\n        if (w[i] === 0) continue;\\\\n\\\\n        res = res.mul(q);\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Shift-left in-place\\\\n  BN.prototype.iushln = function iushln (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\\\\n    var i;\\\\n\\\\n    if (r !== 0) {\\\\n      var carry = 0;\\\\n\\\\n      for (i = 0; i < this.length; i++) {\\\\n        var newCarry = this.words[i] & carryMask;\\\\n        var c = ((this.words[i] | 0) - newCarry) << r;\\\\n        this.words[i] = c | carry;\\\\n        carry = newCarry >>> (26 - r);\\\\n      }\\\\n\\\\n      if (carry) {\\\\n        this.words[i] = carry;\\\\n        this.length++;\\\\n      }\\\\n    }\\\\n\\\\n    if (s !== 0) {\\\\n      for (i = this.length - 1; i >= 0; i--) {\\\\n        this.words[i + s] = this.words[i];\\\\n      }\\\\n\\\\n      for (i = 0; i < s; i++) {\\\\n        this.words[i] = 0;\\\\n      }\\\\n\\\\n      this.length += s;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishln = function ishln (bits) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right in-place\\\\n  // NOTE: `hint` is a lowest bit before trailing zeroes\\\\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\\\\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var h;\\\\n    if (hint) {\\\\n      h = (hint - (hint % 26)) / 26;\\\\n    } else {\\\\n      h = 0;\\\\n    }\\\\n\\\\n    var r = bits % 26;\\\\n    var s = Math.min((bits - r) / 26, this.length);\\\\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n    var maskedWords = extended;\\\\n\\\\n    h -= s;\\\\n    h = Math.max(0, h);\\\\n\\\\n    // Extended mode, copy masked part\\\\n    if (maskedWords) {\\\\n      for (var i = 0; i < s; i++) {\\\\n        maskedWords.words[i] = this.words[i];\\\\n      }\\\\n      maskedWords.length = s;\\\\n    }\\\\n\\\\n    if (s === 0) {\\\\n      // No-op, we should not move anything at all\\\\n    } else if (this.length > s) {\\\\n      this.length -= s;\\\\n      for (i = 0; i < this.length; i++) {\\\\n        this.words[i] = this.words[i + s];\\\\n      }\\\\n    } else {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\\\\n      var word = this.words[i] | 0;\\\\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\\\\n      carry = word & mask;\\\\n    }\\\\n\\\\n    // Push carried bits as a mask\\\\n    if (maskedWords && carry !== 0) {\\\\n      maskedWords.words[maskedWords.length++] = carry;\\\\n    }\\\\n\\\\n    if (this.length === 0) {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushrn(bits, hint, extended);\\\\n  };\\\\n\\\\n  // Shift-left\\\\n  BN.prototype.shln = function shln (bits) {\\\\n    return this.clone().ishln(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushln = function ushln (bits) {\\\\n    return this.clone().iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right\\\\n  BN.prototype.shrn = function shrn (bits) {\\\\n    return this.clone().ishrn(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushrn = function ushrn (bits) {\\\\n    return this.clone().iushrn(bits);\\\\n  };\\\\n\\\\n  // Test if n bit is set\\\\n  BN.prototype.testn = function testn (bit) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) return false;\\\\n\\\\n    // Check bit and return\\\\n    var w = this.words[s];\\\\n\\\\n    return !!(w & q);\\\\n  };\\\\n\\\\n  // Return only lowers bits of number (in-place)\\\\n  BN.prototype.imaskn = function imaskn (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n\\\\n    assert(this.negative === 0, \'imaskn works only with positive numbers\');\\\\n\\\\n    if (this.length <= s) {\\\\n      return this;\\\\n    }\\\\n\\\\n    if (r !== 0) {\\\\n      s++;\\\\n    }\\\\n    this.length = Math.min(s, this.length);\\\\n\\\\n    if (r !== 0) {\\\\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n      this.words[this.length - 1] &= mask;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Return only lowers bits of number\\\\n  BN.prototype.maskn = function maskn (bits) {\\\\n    return this.clone().imaskn(bits);\\\\n  };\\\\n\\\\n  // Add plain number `num` to `this`\\\\n  BN.prototype.iaddn = function iaddn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.isubn(-num);\\\\n\\\\n    // Possible sign change\\\\n    if (this.negative !== 0) {\\\\n      if (this.length === 1 && (this.words[0] | 0) < num) {\\\\n        this.words[0] = num - (this.words[0] | 0);\\\\n        this.negative = 0;\\\\n        return this;\\\\n      }\\\\n\\\\n      this.negative = 0;\\\\n      this.isubn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add without checks\\\\n    return this._iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype._iaddn = function _iaddn (num) {\\\\n    this.words[0] += num;\\\\n\\\\n    // Carry\\\\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\\\\n      this.words[i] -= 0x4000000;\\\\n      if (i === this.length - 1) {\\\\n        this.words[i + 1] = 1;\\\\n      } else {\\\\n        this.words[i + 1]++;\\\\n      }\\\\n    }\\\\n    this.length = Math.max(this.length, i + 1);\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Subtract plain number `num` from `this`\\\\n  BN.prototype.isubn = function isubn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.iaddn(-num);\\\\n\\\\n    if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iaddn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.words[0] -= num;\\\\n\\\\n    if (this.length === 1 && this.words[0] < 0) {\\\\n      this.words[0] = -this.words[0];\\\\n      this.negative = 1;\\\\n    } else {\\\\n      // Carry\\\\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\\\\n        this.words[i] += 0x4000000;\\\\n        this.words[i + 1] -= 1;\\\\n      }\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.addn = function addn (num) {\\\\n    return this.clone().iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype.subn = function subn (num) {\\\\n    return this.clone().isubn(num);\\\\n  };\\\\n\\\\n  BN.prototype.iabs = function iabs () {\\\\n    this.negative = 0;\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.abs = function abs () {\\\\n    return this.clone().iabs();\\\\n  };\\\\n\\\\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\\\\n    var len = num.length + shift;\\\\n    var i;\\\\n\\\\n    this._expand(len);\\\\n\\\\n    var w;\\\\n    var carry = 0;\\\\n    for (i = 0; i < num.length; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      var right = (num.words[i] | 0) * mul;\\\\n      w -= right & 0x3ffffff;\\\\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n    for (; i < this.length - shift; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry === 0) return this.strip();\\\\n\\\\n    // Subtraction overflow\\\\n    assert(carry === -1);\\\\n    carry = 0;\\\\n    for (i = 0; i < this.length; i++) {\\\\n      w = -(this.words[i] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i] = w & 0x3ffffff;\\\\n    }\\\\n    this.negative = 1;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\\\\n    var shift = this.length - num.length;\\\\n\\\\n    var a = this.clone();\\\\n    var b = num;\\\\n\\\\n    // Normalize\\\\n    var bhi = b.words[b.length - 1] | 0;\\\\n    var bhiBits = this._countBits(bhi);\\\\n    shift = 26 - bhiBits;\\\\n    if (shift !== 0) {\\\\n      b = b.ushln(shift);\\\\n      a.iushln(shift);\\\\n      bhi = b.words[b.length - 1] | 0;\\\\n    }\\\\n\\\\n    // Initialize quotient\\\\n    var m = a.length - b.length;\\\\n    var q;\\\\n\\\\n    if (mode !== \'mod\') {\\\\n      q = new BN(null);\\\\n      q.length = m + 1;\\\\n      q.words = new Array(q.length);\\\\n      for (var i = 0; i < q.length; i++) {\\\\n        q.words[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\\\\n    if (diff.negative === 0) {\\\\n      a = diff;\\\\n      if (q) {\\\\n        q.words[m] = 1;\\\\n      }\\\\n    }\\\\n\\\\n    for (var j = m - 1; j >= 0; j--) {\\\\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\\\\n        (a.words[b.length + j - 1] | 0);\\\\n\\\\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\\\\n      // (0x7ffffff)\\\\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\\\\n\\\\n      a._ishlnsubmul(b, qj, j);\\\\n      while (a.negative !== 0) {\\\\n        qj--;\\\\n        a.negative = 0;\\\\n        a._ishlnsubmul(b, 1, j);\\\\n        if (!a.isZero()) {\\\\n          a.negative ^= 1;\\\\n        }\\\\n      }\\\\n      if (q) {\\\\n        q.words[j] = qj;\\\\n      }\\\\n    }\\\\n    if (q) {\\\\n      q.strip();\\\\n    }\\\\n    a.strip();\\\\n\\\\n    // Denormalize\\\\n    if (mode !== \'div\' && shift !== 0) {\\\\n      a.iushrn(shift);\\\\n    }\\\\n\\\\n    return {\\\\n      div: q || null,\\\\n      mod: a\\\\n    };\\\\n  };\\\\n\\\\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\\\\n  //       to `div` to request div only, or be absent to\\\\n  //       request both div & mod\\\\n  //       2) `positive` is true if unsigned mod is requested\\\\n  BN.prototype.divmod = function divmod (num, mode, positive) {\\\\n    assert(!num.isZero());\\\\n\\\\n    if (this.isZero()) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: new BN(0)\\\\n      };\\\\n    }\\\\n\\\\n    var div, mod, res;\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      res = this.neg().divmod(num, mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.iadd(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    if (this.negative === 0 && num.negative !== 0) {\\\\n      res = this.divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: res.mod\\\\n      };\\\\n    }\\\\n\\\\n    if ((this.negative & num.negative) !== 0) {\\\\n      res = this.neg().divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.isub(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: res.div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    // Both numbers are positive at this point\\\\n\\\\n    // Strip both numbers to approximate shift value\\\\n    if (num.length > this.length || this.cmp(num) < 0) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: this\\\\n      };\\\\n    }\\\\n\\\\n    // Very short reduction\\\\n    if (num.length === 1) {\\\\n      if (mode === \'div\') {\\\\n        return {\\\\n          div: this.divn(num.words[0]),\\\\n          mod: null\\\\n        };\\\\n      }\\\\n\\\\n      if (mode === \'mod\') {\\\\n        return {\\\\n          div: null,\\\\n          mod: new BN(this.modn(num.words[0]))\\\\n        };\\\\n      }\\\\n\\\\n      return {\\\\n        div: this.divn(num.words[0]),\\\\n        mod: new BN(this.modn(num.words[0]))\\\\n      };\\\\n    }\\\\n\\\\n    return this._wordDiv(num, mode);\\\\n  };\\\\n\\\\n  // Find `this` / `num`\\\\n  BN.prototype.div = function div (num) {\\\\n    return this.divmod(num, \'div\', false).div;\\\\n  };\\\\n\\\\n  // Find `this` % `num`\\\\n  BN.prototype.mod = function mod (num) {\\\\n    return this.divmod(num, \'mod\', false).mod;\\\\n  };\\\\n\\\\n  BN.prototype.umod = function umod (num) {\\\\n    return this.divmod(num, \'mod\', true).mod;\\\\n  };\\\\n\\\\n  // Find Round(`this` / `num`)\\\\n  BN.prototype.divRound = function divRound (num) {\\\\n    var dm = this.divmod(num);\\\\n\\\\n    // Fast case - exact division\\\\n    if (dm.mod.isZero()) return dm.div;\\\\n\\\\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\\\\n\\\\n    var half = num.ushrn(1);\\\\n    var r2 = num.andln(1);\\\\n    var cmp = mod.cmp(half);\\\\n\\\\n    // Round down\\\\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\\\\n\\\\n    // Round up\\\\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\\\\n  };\\\\n\\\\n  BN.prototype.modn = function modn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n    var p = (1 << 26) % num;\\\\n\\\\n    var acc = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      acc = (p * acc + (this.words[i] | 0)) % num;\\\\n    }\\\\n\\\\n    return acc;\\\\n  };\\\\n\\\\n  // In-place division by number\\\\n  BN.prototype.idivn = function idivn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n\\\\n    var carry = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var w = (this.words[i] | 0) + carry * 0x4000000;\\\\n      this.words[i] = (w / num) | 0;\\\\n      carry = w % num;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.divn = function divn (num) {\\\\n    return this.clone().idivn(num);\\\\n  };\\\\n\\\\n  BN.prototype.egcd = function egcd (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var x = this;\\\\n    var y = p.clone();\\\\n\\\\n    if (x.negative !== 0) {\\\\n      x = x.umod(p);\\\\n    } else {\\\\n      x = x.clone();\\\\n    }\\\\n\\\\n    // A * x + B * y = x\\\\n    var A = new BN(1);\\\\n    var B = new BN(0);\\\\n\\\\n    // C * x + D * y = y\\\\n    var C = new BN(0);\\\\n    var D = new BN(1);\\\\n\\\\n    var g = 0;\\\\n\\\\n    while (x.isEven() && y.isEven()) {\\\\n      x.iushrn(1);\\\\n      y.iushrn(1);\\\\n      ++g;\\\\n    }\\\\n\\\\n    var yp = y.clone();\\\\n    var xp = x.clone();\\\\n\\\\n    while (!x.isZero()) {\\\\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        x.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (A.isOdd() || B.isOdd()) {\\\\n            A.iadd(yp);\\\\n            B.isub(xp);\\\\n          }\\\\n\\\\n          A.iushrn(1);\\\\n          B.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        y.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (C.isOdd() || D.isOdd()) {\\\\n            C.iadd(yp);\\\\n            D.isub(xp);\\\\n          }\\\\n\\\\n          C.iushrn(1);\\\\n          D.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (x.cmp(y) >= 0) {\\\\n        x.isub(y);\\\\n        A.isub(C);\\\\n        B.isub(D);\\\\n      } else {\\\\n        y.isub(x);\\\\n        C.isub(A);\\\\n        D.isub(B);\\\\n      }\\\\n    }\\\\n\\\\n    return {\\\\n      a: C,\\\\n      b: D,\\\\n      gcd: y.iushln(g)\\\\n    };\\\\n  };\\\\n\\\\n  // This is reduced incarnation of the binary EEA\\\\n  // above, designated to invert members of the\\\\n  // _prime_ fields F(p) at a maximal speed\\\\n  BN.prototype._invmp = function _invmp (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var a = this;\\\\n    var b = p.clone();\\\\n\\\\n    if (a.negative !== 0) {\\\\n      a = a.umod(p);\\\\n    } else {\\\\n      a = a.clone();\\\\n    }\\\\n\\\\n    var x1 = new BN(1);\\\\n    var x2 = new BN(0);\\\\n\\\\n    var delta = b.clone();\\\\n\\\\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\\\\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        a.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (x1.isOdd()) {\\\\n            x1.iadd(delta);\\\\n          }\\\\n\\\\n          x1.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        b.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (x2.isOdd()) {\\\\n            x2.iadd(delta);\\\\n          }\\\\n\\\\n          x2.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (a.cmp(b) >= 0) {\\\\n        a.isub(b);\\\\n        x1.isub(x2);\\\\n      } else {\\\\n        b.isub(a);\\\\n        x2.isub(x1);\\\\n      }\\\\n    }\\\\n\\\\n    var res;\\\\n    if (a.cmpn(1) === 0) {\\\\n      res = x1;\\\\n    } else {\\\\n      res = x2;\\\\n    }\\\\n\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(p);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gcd = function gcd (num) {\\\\n    if (this.isZero()) return num.abs();\\\\n    if (num.isZero()) return this.abs();\\\\n\\\\n    var a = this.clone();\\\\n    var b = num.clone();\\\\n    a.negative = 0;\\\\n    b.negative = 0;\\\\n\\\\n    // Remove common factor of two\\\\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\\\\n      a.iushrn(1);\\\\n      b.iushrn(1);\\\\n    }\\\\n\\\\n    do {\\\\n      while (a.isEven()) {\\\\n        a.iushrn(1);\\\\n      }\\\\n      while (b.isEven()) {\\\\n        b.iushrn(1);\\\\n      }\\\\n\\\\n      var r = a.cmp(b);\\\\n      if (r < 0) {\\\\n        // Swap `a` and `b` to make `a` always bigger than `b`\\\\n        var t = a;\\\\n        a = b;\\\\n        b = t;\\\\n      } else if (r === 0 || b.cmpn(1) === 0) {\\\\n        break;\\\\n      }\\\\n\\\\n      a.isub(b);\\\\n    } while (true);\\\\n\\\\n    return b.iushln(shift);\\\\n  };\\\\n\\\\n  // Invert number in the field F(num)\\\\n  BN.prototype.invm = function invm (num) {\\\\n    return this.egcd(num).a.umod(num);\\\\n  };\\\\n\\\\n  BN.prototype.isEven = function isEven () {\\\\n    return (this.words[0] & 1) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.isOdd = function isOdd () {\\\\n    return (this.words[0] & 1) === 1;\\\\n  };\\\\n\\\\n  // And first word and num\\\\n  BN.prototype.andln = function andln (num) {\\\\n    return this.words[0] & num;\\\\n  };\\\\n\\\\n  // Increment at the bit position in-line\\\\n  BN.prototype.bincn = function bincn (bit) {\\\\n    assert(typeof bit === \'number\');\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) {\\\\n      this._expand(s + 1);\\\\n      this.words[s] |= q;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add bit and propagate, if needed\\\\n    var carry = q;\\\\n    for (var i = s; carry !== 0 && i < this.length; i++) {\\\\n      var w = this.words[i] | 0;\\\\n      w += carry;\\\\n      carry = w >>> 26;\\\\n      w &= 0x3ffffff;\\\\n      this.words[i] = w;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.isZero = function isZero () {\\\\n    return this.length === 1 && this.words[0] === 0;\\\\n  };\\\\n\\\\n  BN.prototype.cmpn = function cmpn (num) {\\\\n    var negative = num < 0;\\\\n\\\\n    if (this.negative !== 0 && !negative) return -1;\\\\n    if (this.negative === 0 && negative) return 1;\\\\n\\\\n    this.strip();\\\\n\\\\n    var res;\\\\n    if (this.length > 1) {\\\\n      res = 1;\\\\n    } else {\\\\n      if (negative) {\\\\n        num = -num;\\\\n      }\\\\n\\\\n      assert(num <= 0x3ffffff, \'Number is too big\');\\\\n\\\\n      var w = this.words[0] | 0;\\\\n      res = w === num ? 0 : w < num ? -1 : 1;\\\\n    }\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Compare two numbers and return:\\\\n  // 1 - if `this` > `num`\\\\n  // 0 - if `this` == `num`\\\\n  // -1 - if `this` < `num`\\\\n  BN.prototype.cmp = function cmp (num) {\\\\n    if (this.negative !== 0 && num.negative === 0) return -1;\\\\n    if (this.negative === 0 && num.negative !== 0) return 1;\\\\n\\\\n    var res = this.ucmp(num);\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Unsigned comparison\\\\n  BN.prototype.ucmp = function ucmp (num) {\\\\n    // At this point both numbers have the same sign\\\\n    if (this.length > num.length) return 1;\\\\n    if (this.length < num.length) return -1;\\\\n\\\\n    var res = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var a = this.words[i] | 0;\\\\n      var b = num.words[i] | 0;\\\\n\\\\n      if (a === b) continue;\\\\n      if (a < b) {\\\\n        res = -1;\\\\n      } else if (a > b) {\\\\n        res = 1;\\\\n      }\\\\n      break;\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gtn = function gtn (num) {\\\\n    return this.cmpn(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gt = function gt (num) {\\\\n    return this.cmp(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gten = function gten (num) {\\\\n    return this.cmpn(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.gte = function gte (num) {\\\\n    return this.cmp(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.ltn = function ltn (num) {\\\\n    return this.cmpn(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lt = function lt (num) {\\\\n    return this.cmp(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lten = function lten (num) {\\\\n    return this.cmpn(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.lte = function lte (num) {\\\\n    return this.cmp(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.eqn = function eqn (num) {\\\\n    return this.cmpn(num) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.eq = function eq (num) {\\\\n    return this.cmp(num) === 0;\\\\n  };\\\\n\\\\n  //\\\\n  // A reduce context, could be using montgomery or something better, depending\\\\n  // on the `m` itself.\\\\n  //\\\\n  BN.red = function red (num) {\\\\n    return new Red(num);\\\\n  };\\\\n\\\\n  BN.prototype.toRed = function toRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    assert(this.negative === 0, \'red works only with positives\');\\\\n    return ctx.convertTo(this)._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.fromRed = function fromRed () {\\\\n    assert(this.red, \'fromRed works only with numbers in reduction context\');\\\\n    return this.red.convertFrom(this);\\\\n  };\\\\n\\\\n  BN.prototype._forceRed = function _forceRed (ctx) {\\\\n    this.red = ctx;\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.forceRed = function forceRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    return this._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.redAdd = function redAdd (num) {\\\\n    assert(this.red, \'redAdd works only with red numbers\');\\\\n    return this.red.add(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIAdd = function redIAdd (num) {\\\\n    assert(this.red, \'redIAdd works only with red numbers\');\\\\n    return this.red.iadd(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSub = function redSub (num) {\\\\n    assert(this.red, \'redSub works only with red numbers\');\\\\n    return this.red.sub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redISub = function redISub (num) {\\\\n    assert(this.red, \'redISub works only with red numbers\');\\\\n    return this.red.isub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redShl = function redShl (num) {\\\\n    assert(this.red, \'redShl works only with red numbers\');\\\\n    return this.red.shl(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redMul = function redMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.mul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIMul = function redIMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.imul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSqr = function redSqr () {\\\\n    assert(this.red, \'redSqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqr(this);\\\\n  };\\\\n\\\\n  BN.prototype.redISqr = function redISqr () {\\\\n    assert(this.red, \'redISqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.isqr(this);\\\\n  };\\\\n\\\\n  // Square root over p\\\\n  BN.prototype.redSqrt = function redSqrt () {\\\\n    assert(this.red, \'redSqrt works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqrt(this);\\\\n  };\\\\n\\\\n  BN.prototype.redInvm = function redInvm () {\\\\n    assert(this.red, \'redInvm works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.invm(this);\\\\n  };\\\\n\\\\n  // Return negative clone of `this` % `red modulo`\\\\n  BN.prototype.redNeg = function redNeg () {\\\\n    assert(this.red, \'redNeg works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.neg(this);\\\\n  };\\\\n\\\\n  BN.prototype.redPow = function redPow (num) {\\\\n    assert(this.red && !num.red, \'redPow(normalNum)\');\\\\n    this.red._verify1(this);\\\\n    return this.red.pow(this, num);\\\\n  };\\\\n\\\\n  // Prime numbers with efficient reduction\\\\n  var primes = {\\\\n    k256: null,\\\\n    p224: null,\\\\n    p192: null,\\\\n    p25519: null\\\\n  };\\\\n\\\\n  // Pseudo-Mersenne prime\\\\n  function MPrime (name, p) {\\\\n    // P = 2 ^ N - K\\\\n    this.name = name;\\\\n    this.p = new BN(p, 16);\\\\n    this.n = this.p.bitLength();\\\\n    this.k = new BN(1).iushln(this.n).isub(this.p);\\\\n\\\\n    this.tmp = this._tmp();\\\\n  }\\\\n\\\\n  MPrime.prototype._tmp = function _tmp () {\\\\n    var tmp = new BN(null);\\\\n    tmp.words = new Array(Math.ceil(this.n / 13));\\\\n    return tmp;\\\\n  };\\\\n\\\\n  MPrime.prototype.ireduce = function ireduce (num) {\\\\n    // Assumes that `num` is less than `P^2`\\\\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\\\\n    var r = num;\\\\n    var rlen;\\\\n\\\\n    do {\\\\n      this.split(r, this.tmp);\\\\n      r = this.imulK(r);\\\\n      r = r.iadd(this.tmp);\\\\n      rlen = r.bitLength();\\\\n    } while (rlen > this.n);\\\\n\\\\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\\\\n    if (cmp === 0) {\\\\n      r.words[0] = 0;\\\\n      r.length = 1;\\\\n    } else if (cmp > 0) {\\\\n      r.isub(this.p);\\\\n    } else {\\\\n      r.strip();\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  MPrime.prototype.split = function split (input, out) {\\\\n    input.iushrn(this.n, 0, out);\\\\n  };\\\\n\\\\n  MPrime.prototype.imulK = function imulK (num) {\\\\n    return num.imul(this.k);\\\\n  };\\\\n\\\\n  function K256 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'k256\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\');\\\\n  }\\\\n  inherits(K256, MPrime);\\\\n\\\\n  K256.prototype.split = function split (input, output) {\\\\n    // 256 = 9 * 26 + 22\\\\n    var mask = 0x3fffff;\\\\n\\\\n    var outLen = Math.min(input.length, 9);\\\\n    for (var i = 0; i < outLen; i++) {\\\\n      output.words[i] = input.words[i];\\\\n    }\\\\n    output.length = outLen;\\\\n\\\\n    if (input.length <= 9) {\\\\n      input.words[0] = 0;\\\\n      input.length = 1;\\\\n      return;\\\\n    }\\\\n\\\\n    // Shift by 9 limbs\\\\n    var prev = input.words[9];\\\\n    output.words[output.length++] = prev & mask;\\\\n\\\\n    for (i = 10; i < input.length; i++) {\\\\n      var next = input.words[i] | 0;\\\\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\\\\n      prev = next;\\\\n    }\\\\n    prev >>>= 22;\\\\n    input.words[i - 10] = prev;\\\\n    if (prev === 0 && input.length > 10) {\\\\n      input.length -= 10;\\\\n    } else {\\\\n      input.length -= 9;\\\\n    }\\\\n  };\\\\n\\\\n  K256.prototype.imulK = function imulK (num) {\\\\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\\\\n    num.words[num.length] = 0;\\\\n    num.words[num.length + 1] = 0;\\\\n    num.length += 2;\\\\n\\\\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\\\\n    var lo = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var w = num.words[i] | 0;\\\\n      lo += w * 0x3d1;\\\\n      num.words[i] = lo & 0x3ffffff;\\\\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\\\\n    }\\\\n\\\\n    // Fast length reduction\\\\n    if (num.words[num.length - 1] === 0) {\\\\n      num.length--;\\\\n      if (num.words[num.length - 1] === 0) {\\\\n        num.length--;\\\\n      }\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  function P224 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p224\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\');\\\\n  }\\\\n  inherits(P224, MPrime);\\\\n\\\\n  function P192 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p192\',\\\\n      \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\');\\\\n  }\\\\n  inherits(P192, MPrime);\\\\n\\\\n  function P25519 () {\\\\n    // 2 ^ 255 - 19\\\\n    MPrime.call(\\\\n      this,\\\\n      \'25519\',\\\\n      \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\');\\\\n  }\\\\n  inherits(P25519, MPrime);\\\\n\\\\n  P25519.prototype.imulK = function imulK (num) {\\\\n    // K = 0x13\\\\n    var carry = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var hi = (num.words[i] | 0) * 0x13 + carry;\\\\n      var lo = hi & 0x3ffffff;\\\\n      hi >>>= 26;\\\\n\\\\n      num.words[i] = lo;\\\\n      carry = hi;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      num.words[num.length++] = carry;\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  // Exported mostly for testing purposes, use plain name instead\\\\n  BN._prime = function prime (name) {\\\\n    // Cached version of prime\\\\n    if (primes[name]) return primes[name];\\\\n\\\\n    var prime;\\\\n    if (name === \'k256\') {\\\\n      prime = new K256();\\\\n    } else if (name === \'p224\') {\\\\n      prime = new P224();\\\\n    } else if (name === \'p192\') {\\\\n      prime = new P192();\\\\n    } else if (name === \'p25519\') {\\\\n      prime = new P25519();\\\\n    } else {\\\\n      throw new Error(\'Unknown prime \' + name);\\\\n    }\\\\n    primes[name] = prime;\\\\n\\\\n    return prime;\\\\n  };\\\\n\\\\n  //\\\\n  // Base reduction engine\\\\n  //\\\\n  function Red (m) {\\\\n    if (typeof m === \'string\') {\\\\n      var prime = BN._prime(m);\\\\n      this.m = prime.p;\\\\n      this.prime = prime;\\\\n    } else {\\\\n      assert(m.gtn(1), \'modulus must be greater than 1\');\\\\n      this.m = m;\\\\n      this.prime = null;\\\\n    }\\\\n  }\\\\n\\\\n  Red.prototype._verify1 = function _verify1 (a) {\\\\n    assert(a.negative === 0, \'red works only with positives\');\\\\n    assert(a.red, \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype._verify2 = function _verify2 (a, b) {\\\\n    assert((a.negative | b.negative) === 0, \'red works only with positives\');\\\\n    assert(a.red && a.red === b.red,\\\\n      \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype.imod = function imod (a) {\\\\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\\\\n    return a.umod(this.m)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.neg = function neg (a) {\\\\n    if (a.isZero()) {\\\\n      return a.clone();\\\\n    }\\\\n\\\\n    return this.m.sub(a)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.add = function add (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.add(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.iadd = function iadd (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.iadd(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.sub = function sub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.sub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.isub = function isub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.isub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.shl = function shl (a, num) {\\\\n    this._verify1(a);\\\\n    return this.imod(a.ushln(num));\\\\n  };\\\\n\\\\n  Red.prototype.imul = function imul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.imul(b));\\\\n  };\\\\n\\\\n  Red.prototype.mul = function mul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.mul(b));\\\\n  };\\\\n\\\\n  Red.prototype.isqr = function isqr (a) {\\\\n    return this.imul(a, a.clone());\\\\n  };\\\\n\\\\n  Red.prototype.sqr = function sqr (a) {\\\\n    return this.mul(a, a);\\\\n  };\\\\n\\\\n  Red.prototype.sqrt = function sqrt (a) {\\\\n    if (a.isZero()) return a.clone();\\\\n\\\\n    var mod3 = this.m.andln(3);\\\\n    assert(mod3 % 2 === 1);\\\\n\\\\n    // Fast case\\\\n    if (mod3 === 3) {\\\\n      var pow = this.m.add(new BN(1)).iushrn(2);\\\\n      return this.pow(a, pow);\\\\n    }\\\\n\\\\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\\\\n    //\\\\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\\\\n    var q = this.m.subn(1);\\\\n    var s = 0;\\\\n    while (!q.isZero() && q.andln(1) === 0) {\\\\n      s++;\\\\n      q.iushrn(1);\\\\n    }\\\\n    assert(!q.isZero());\\\\n\\\\n    var one = new BN(1).toRed(this);\\\\n    var nOne = one.redNeg();\\\\n\\\\n    // Find quadratic non-residue\\\\n    // NOTE: Max is such because of generalized Riemann hypothesis.\\\\n    var lpow = this.m.subn(1).iushrn(1);\\\\n    var z = this.m.bitLength();\\\\n    z = new BN(2 * z * z).toRed(this);\\\\n\\\\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\\\\n      z.redIAdd(nOne);\\\\n    }\\\\n\\\\n    var c = this.pow(z, q);\\\\n    var r = this.pow(a, q.addn(1).iushrn(1));\\\\n    var t = this.pow(a, q);\\\\n    var m = s;\\\\n    while (t.cmp(one) !== 0) {\\\\n      var tmp = t;\\\\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\\\\n        tmp = tmp.redSqr();\\\\n      }\\\\n      assert(i < m);\\\\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\\\\n\\\\n      r = r.redMul(b);\\\\n      c = b.redSqr();\\\\n      t = t.redMul(c);\\\\n      m = i;\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  Red.prototype.invm = function invm (a) {\\\\n    var inv = a._invmp(this.m);\\\\n    if (inv.negative !== 0) {\\\\n      inv.negative = 0;\\\\n      return this.imod(inv).redNeg();\\\\n    } else {\\\\n      return this.imod(inv);\\\\n    }\\\\n  };\\\\n\\\\n  Red.prototype.pow = function pow (a, num) {\\\\n    if (num.isZero()) return new BN(1).toRed(this);\\\\n    if (num.cmpn(1) === 0) return a.clone();\\\\n\\\\n    var windowSize = 4;\\\\n    var wnd = new Array(1 << windowSize);\\\\n    wnd[0] = new BN(1).toRed(this);\\\\n    wnd[1] = a;\\\\n    for (var i = 2; i < wnd.length; i++) {\\\\n      wnd[i] = this.mul(wnd[i - 1], a);\\\\n    }\\\\n\\\\n    var res = wnd[0];\\\\n    var current = 0;\\\\n    var currentLen = 0;\\\\n    var start = num.bitLength() % 26;\\\\n    if (start === 0) {\\\\n      start = 26;\\\\n    }\\\\n\\\\n    for (i = num.length - 1; i >= 0; i--) {\\\\n      var word = num.words[i];\\\\n      for (var j = start - 1; j >= 0; j--) {\\\\n        var bit = (word >> j) & 1;\\\\n        if (res !== wnd[0]) {\\\\n          res = this.sqr(res);\\\\n        }\\\\n\\\\n        if (bit === 0 && current === 0) {\\\\n          currentLen = 0;\\\\n          continue;\\\\n        }\\\\n\\\\n        current <<= 1;\\\\n        current |= bit;\\\\n        currentLen++;\\\\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\\\\n\\\\n        res = this.mul(res, wnd[current]);\\\\n        currentLen = 0;\\\\n        current = 0;\\\\n      }\\\\n      start = 26;\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.convertTo = function convertTo (num) {\\\\n    var r = num.umod(this.m);\\\\n\\\\n    return r === num ? r.clone() : r;\\\\n  };\\\\n\\\\n  Red.prototype.convertFrom = function convertFrom (num) {\\\\n    var res = num.clone();\\\\n    res.red = null;\\\\n    return res;\\\\n  };\\\\n\\\\n  //\\\\n  // Montgomery method engine\\\\n  //\\\\n\\\\n  BN.mont = function mont (num) {\\\\n    return new Mont(num);\\\\n  };\\\\n\\\\n  function Mont (m) {\\\\n    Red.call(this, m);\\\\n\\\\n    this.shift = this.m.bitLength();\\\\n    if (this.shift % 26 !== 0) {\\\\n      this.shift += 26 - (this.shift % 26);\\\\n    }\\\\n\\\\n    this.r = new BN(1).iushln(this.shift);\\\\n    this.r2 = this.imod(this.r.sqr());\\\\n    this.rinv = this.r._invmp(this.m);\\\\n\\\\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\\\\n    this.minv = this.minv.umod(this.r);\\\\n    this.minv = this.r.sub(this.minv);\\\\n  }\\\\n  inherits(Mont, Red);\\\\n\\\\n  Mont.prototype.convertTo = function convertTo (num) {\\\\n    return this.imod(num.ushln(this.shift));\\\\n  };\\\\n\\\\n  Mont.prototype.convertFrom = function convertFrom (num) {\\\\n    var r = this.imod(num.mul(this.rinv));\\\\n    r.red = null;\\\\n    return r;\\\\n  };\\\\n\\\\n  Mont.prototype.imul = function imul (a, b) {\\\\n    if (a.isZero() || b.isZero()) {\\\\n      a.words[0] = 0;\\\\n      a.length = 1;\\\\n      return a;\\\\n    }\\\\n\\\\n    var t = a.imul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.mul = function mul (a, b) {\\\\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\\\\n\\\\n    var t = a.mul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.invm = function invm (a) {\\\\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\\\\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\\\\n    return res._forceRed(this);\\\\n  };\\\\n})(typeof module === \'undefined\' || module, this);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/bn.js/lib/bn.js\\\\n// module id = 3\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/bn.js/lib/bn.js\\")},function(module,exports){eval(\'var g;\\\\r\\\\n\\\\r\\\\n// This works in non-strict mode\\\\r\\\\ng = (function() {\\\\r\\\\n\\\\treturn this;\\\\r\\\\n})();\\\\r\\\\n\\\\r\\\\ntry {\\\\r\\\\n\\\\t// This works if eval is allowed (see CSP)\\\\r\\\\n\\\\tg = g || Function(\\"return this\\")() || (1,eval)(\\"this\\");\\\\r\\\\n} catch(e) {\\\\r\\\\n\\\\t// This works if the window reference is available\\\\r\\\\n\\\\tif(typeof window === \\"object\\")\\\\r\\\\n\\\\t\\\\tg = window;\\\\r\\\\n}\\\\r\\\\n\\\\r\\\\n// g can still be undefined, but nothing to do about it...\\\\r\\\\n// We return undefined, instead of nothing here, so it\\\\\'s\\\\r\\\\n// easier to handle this case. if(!global) { ...}\\\\r\\\\n\\\\r\\\\nmodule.exports = g;\\\\r\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// (webpack)/buildin/global.js\\\\n// module id = 4\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/webpack/buildin/global.js\')},function(module,exports,__webpack_require__){eval(\\"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;//     Underscore.js 1.8.3\\\\n//     http://underscorejs.org\\\\n//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\\\\n//     Underscore may be freely distributed under the MIT license.\\\\n\\\\n(function() {\\\\n\\\\n  // Baseline setup\\\\n  // --------------\\\\n\\\\n  // Establish the root object, `window` in the browser, or `exports` on the server.\\\\n  var root = this;\\\\n\\\\n  // Save the previous value of the `_` variable.\\\\n  var previousUnderscore = root._;\\\\n\\\\n  // Save bytes in the minified (but not gzipped) version:\\\\n  var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;\\\\n\\\\n  // Create quick reference variables for speed access to core prototypes.\\\\n  var\\\\n    push             = ArrayProto.push,\\\\n    slice            = ArrayProto.slice,\\\\n    toString         = ObjProto.toString,\\\\n    hasOwnProperty   = ObjProto.hasOwnProperty;\\\\n\\\\n  // All **ECMAScript 5** native function implementations that we hope to use\\\\n  // are declared here.\\\\n  var\\\\n    nativeIsArray      = Array.isArray,\\\\n    nativeKeys         = Object.keys,\\\\n    nativeBind         = FuncProto.bind,\\\\n    nativeCreate       = Object.create;\\\\n\\\\n  // Naked function reference for surrogate-prototype-swapping.\\\\n  var Ctor = function(){};\\\\n\\\\n  // Create a safe reference to the Underscore object for use below.\\\\n  var _ = function(obj) {\\\\n    if (obj instanceof _) return obj;\\\\n    if (!(this instanceof _)) return new _(obj);\\\\n    this._wrapped = obj;\\\\n  };\\\\n\\\\n  // Export the Underscore object for **Node.js**, with\\\\n  // backwards-compatibility for the old `require()` API. If we\'re in\\\\n  // the browser, add `_` as a global object.\\\\n  if (true) {\\\\n    if (typeof module !== \'undefined\' && module.exports) {\\\\n      exports = module.exports = _;\\\\n    }\\\\n    exports._ = _;\\\\n  } else {\\\\n    root._ = _;\\\\n  }\\\\n\\\\n  // Current version.\\\\n  _.VERSION = \'1.8.3\';\\\\n\\\\n  // Internal function that returns an efficient (for current engines) version\\\\n  // of the passed-in callback, to be repeatedly applied in other Underscore\\\\n  // functions.\\\\n  var optimizeCb = function(func, context, argCount) {\\\\n    if (context === void 0) return func;\\\\n    switch (argCount == null ? 3 : argCount) {\\\\n      case 1: return function(value) {\\\\n        return func.call(context, value);\\\\n      };\\\\n      case 2: return function(value, other) {\\\\n        return func.call(context, value, other);\\\\n      };\\\\n      case 3: return function(value, index, collection) {\\\\n        return func.call(context, value, index, collection);\\\\n      };\\\\n      case 4: return function(accumulator, value, index, collection) {\\\\n        return func.call(context, accumulator, value, index, collection);\\\\n      };\\\\n    }\\\\n    return function() {\\\\n      return func.apply(context, arguments);\\\\n    };\\\\n  };\\\\n\\\\n  // A mostly-internal function to generate callbacks that can be applied\\\\n  // to each element in a collection, returning the desired result — either\\\\n  // identity, an arbitrary callback, a property matcher, or a property accessor.\\\\n  var cb = function(value, context, argCount) {\\\\n    if (value == null) return _.identity;\\\\n    if (_.isFunction(value)) return optimizeCb(value, context, argCount);\\\\n    if (_.isObject(value)) return _.matcher(value);\\\\n    return _.property(value);\\\\n  };\\\\n  _.iteratee = function(value, context) {\\\\n    return cb(value, context, Infinity);\\\\n  };\\\\n\\\\n  // An internal function for creating assigner functions.\\\\n  var createAssigner = function(keysFunc, undefinedOnly) {\\\\n    return function(obj) {\\\\n      var length = arguments.length;\\\\n      if (length < 2 || obj == null) return obj;\\\\n      for (var index = 1; index < length; index++) {\\\\n        var source = arguments[index],\\\\n            keys = keysFunc(source),\\\\n            l = keys.length;\\\\n        for (var i = 0; i < l; i++) {\\\\n          var key = keys[i];\\\\n          if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key];\\\\n        }\\\\n      }\\\\n      return obj;\\\\n    };\\\\n  };\\\\n\\\\n  // An internal function for creating a new object that inherits from another.\\\\n  var baseCreate = function(prototype) {\\\\n    if (!_.isObject(prototype)) return {};\\\\n    if (nativeCreate) return nativeCreate(prototype);\\\\n    Ctor.prototype = prototype;\\\\n    var result = new Ctor;\\\\n    Ctor.prototype = null;\\\\n    return result;\\\\n  };\\\\n\\\\n  var property = function(key) {\\\\n    return function(obj) {\\\\n      return obj == null ? void 0 : obj[key];\\\\n    };\\\\n  };\\\\n\\\\n  // Helper for collection methods to determine whether a collection\\\\n  // should be iterated as an array or as an object\\\\n  // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\\\\n  // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\\\\n  var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\\\\n  var getLength = property(\'length\');\\\\n  var isArrayLike = function(collection) {\\\\n    var length = getLength(collection);\\\\n    return typeof length == \'number\' && length >= 0 && length <= MAX_ARRAY_INDEX;\\\\n  };\\\\n\\\\n  // Collection Functions\\\\n  // --------------------\\\\n\\\\n  // The cornerstone, an `each` implementation, aka `forEach`.\\\\n  // Handles raw objects in addition to array-likes. Treats all\\\\n  // sparse array-likes as if they were dense.\\\\n  _.each = _.forEach = function(obj, iteratee, context) {\\\\n    iteratee = optimizeCb(iteratee, context);\\\\n    var i, length;\\\\n    if (isArrayLike(obj)) {\\\\n      for (i = 0, length = obj.length; i < length; i++) {\\\\n        iteratee(obj[i], i, obj);\\\\n      }\\\\n    } else {\\\\n      var keys = _.keys(obj);\\\\n      for (i = 0, length = keys.length; i < length; i++) {\\\\n        iteratee(obj[keys[i]], keys[i], obj);\\\\n      }\\\\n    }\\\\n    return obj;\\\\n  };\\\\n\\\\n  // Return the results of applying the iteratee to each element.\\\\n  _.map = _.collect = function(obj, iteratee, context) {\\\\n    iteratee = cb(iteratee, context);\\\\n    var keys = !isArrayLike(obj) && _.keys(obj),\\\\n        length = (keys || obj).length,\\\\n        results = Array(length);\\\\n    for (var index = 0; index < length; index++) {\\\\n      var currentKey = keys ? keys[index] : index;\\\\n      results[index] = iteratee(obj[currentKey], currentKey, obj);\\\\n    }\\\\n    return results;\\\\n  };\\\\n\\\\n  // Create a reducing function iterating left or right.\\\\n  function createReduce(dir) {\\\\n    // Optimized iterator function as using arguments.length\\\\n    // in the main function will deoptimize the, see #1991.\\\\n    function iterator(obj, iteratee, memo, keys, index, length) {\\\\n      for (; index >= 0 && index < length; index += dir) {\\\\n        var currentKey = keys ? keys[index] : index;\\\\n        memo = iteratee(memo, obj[currentKey], currentKey, obj);\\\\n      }\\\\n      return memo;\\\\n    }\\\\n\\\\n    return function(obj, iteratee, memo, context) {\\\\n      iteratee = optimizeCb(iteratee, context, 4);\\\\n      var keys = !isArrayLike(obj) && _.keys(obj),\\\\n          length = (keys || obj).length,\\\\n          index = dir > 0 ? 0 : length - 1;\\\\n      // Determine the initial value if none is provided.\\\\n      if (arguments.length < 3) {\\\\n        memo = obj[keys ? keys[index] : index];\\\\n        index += dir;\\\\n      }\\\\n      return iterator(obj, iteratee, memo, keys, index, length);\\\\n    };\\\\n  }\\\\n\\\\n  // **Reduce** builds up a single result from a list of values, aka `inject`,\\\\n  // or `foldl`.\\\\n  _.reduce = _.foldl = _.inject = createReduce(1);\\\\n\\\\n  // The right-associative version of reduce, also known as `foldr`.\\\\n  _.reduceRight = _.foldr = createReduce(-1);\\\\n\\\\n  // Return the first value which passes a truth test. Aliased as `detect`.\\\\n  _.find = _.detect = function(obj, predicate, context) {\\\\n    var key;\\\\n    if (isArrayLike(obj)) {\\\\n      key = _.findIndex(obj, predicate, context);\\\\n    } else {\\\\n      key = _.findKey(obj, predicate, context);\\\\n    }\\\\n    if (key !== void 0 && key !== -1) return obj[key];\\\\n  };\\\\n\\\\n  // Return all the elements that pass a truth test.\\\\n  // Aliased as `select`.\\\\n  _.filter = _.select = function(obj, predicate, context) {\\\\n    var results = [];\\\\n    predicate = cb(predicate, context);\\\\n    _.each(obj, function(value, index, list) {\\\\n      if (predicate(value, index, list)) results.push(value);\\\\n    });\\\\n    return results;\\\\n  };\\\\n\\\\n  // Return all the elements for which a truth test fails.\\\\n  _.reject = function(obj, predicate, context) {\\\\n    return _.filter(obj, _.negate(cb(predicate)), context);\\\\n  };\\\\n\\\\n  // Determine whether all of the elements match a truth test.\\\\n  // Aliased as `all`.\\\\n  _.every = _.all = function(obj, predicate, context) {\\\\n    predicate = cb(predicate, context);\\\\n    var keys = !isArrayLike(obj) && _.keys(obj),\\\\n        length = (keys || obj).length;\\\\n    for (var index = 0; index < length; index++) {\\\\n      var currentKey = keys ? keys[index] : index;\\\\n      if (!predicate(obj[currentKey], currentKey, obj)) return false;\\\\n    }\\\\n    return true;\\\\n  };\\\\n\\\\n  // Determine if at least one element in the object matches a truth test.\\\\n  // Aliased as `any`.\\\\n  _.some = _.any = function(obj, predicate, context) {\\\\n    predicate = cb(predicate, context);\\\\n    var keys = !isArrayLike(obj) && _.keys(obj),\\\\n        length = (keys || obj).length;\\\\n    for (var index = 0; index < length; index++) {\\\\n      var currentKey = keys ? keys[index] : index;\\\\n      if (predicate(obj[currentKey], currentKey, obj)) return true;\\\\n    }\\\\n    return false;\\\\n  };\\\\n\\\\n  // Determine if the array or object contains a given item (using `===`).\\\\n  // Aliased as `includes` and `include`.\\\\n  _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\\\\n    if (!isArrayLike(obj)) obj = _.values(obj);\\\\n    if (typeof fromIndex != \'number\' || guard) fromIndex = 0;\\\\n    return _.indexOf(obj, item, fromIndex) >= 0;\\\\n  };\\\\n\\\\n  // Invoke a method (with arguments) on every item in a collection.\\\\n  _.invoke = function(obj, method) {\\\\n    var args = slice.call(arguments, 2);\\\\n    var isFunc = _.isFunction(method);\\\\n    return _.map(obj, function(value) {\\\\n      var func = isFunc ? method : value[method];\\\\n      return func == null ? func : func.apply(value, args);\\\\n    });\\\\n  };\\\\n\\\\n  // Convenience version of a common use case of `map`: fetching a property.\\\\n  _.pluck = function(obj, key) {\\\\n    return _.map(obj, _.property(key));\\\\n  };\\\\n\\\\n  // Convenience version of a common use case of `filter`: selecting only objects\\\\n  // containing specific `key:value` pairs.\\\\n  _.where = function(obj, attrs) {\\\\n    return _.filter(obj, _.matcher(attrs));\\\\n  };\\\\n\\\\n  // Convenience version of a common use case of `find`: getting the first object\\\\n  // containing specific `key:value` pairs.\\\\n  _.findWhere = function(obj, attrs) {\\\\n    return _.find(obj, _.matcher(attrs));\\\\n  };\\\\n\\\\n  // Return the maximum element (or element-based computation).\\\\n  _.max = function(obj, iteratee, context) {\\\\n    var result = -Infinity, lastComputed = -Infinity,\\\\n        value, computed;\\\\n    if (iteratee == null && obj != null) {\\\\n      obj = isArrayLike(obj) ? obj : _.values(obj);\\\\n      for (var i = 0, length = obj.length; i < length; i++) {\\\\n        value = obj[i];\\\\n        if (value > result) {\\\\n          result = value;\\\\n        }\\\\n      }\\\\n    } else {\\\\n      iteratee = cb(iteratee, context);\\\\n      _.each(obj, function(value, index, list) {\\\\n        computed = iteratee(value, index, list);\\\\n        if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\\\\n          result = value;\\\\n          lastComputed = computed;\\\\n        }\\\\n      });\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Return the minimum element (or element-based computation).\\\\n  _.min = function(obj, iteratee, context) {\\\\n    var result = Infinity, lastComputed = Infinity,\\\\n        value, computed;\\\\n    if (iteratee == null && obj != null) {\\\\n      obj = isArrayLike(obj) ? obj : _.values(obj);\\\\n      for (var i = 0, length = obj.length; i < length; i++) {\\\\n        value = obj[i];\\\\n        if (value < result) {\\\\n          result = value;\\\\n        }\\\\n      }\\\\n    } else {\\\\n      iteratee = cb(iteratee, context);\\\\n      _.each(obj, function(value, index, list) {\\\\n        computed = iteratee(value, index, list);\\\\n        if (computed < lastComputed || computed === Infinity && result === Infinity) {\\\\n          result = value;\\\\n          lastComputed = computed;\\\\n        }\\\\n      });\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Shuffle a collection, using the modern version of the\\\\n  // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\\\\n  _.shuffle = function(obj) {\\\\n    var set = isArrayLike(obj) ? obj : _.values(obj);\\\\n    var length = set.length;\\\\n    var shuffled = Array(length);\\\\n    for (var index = 0, rand; index < length; index++) {\\\\n      rand = _.random(0, index);\\\\n      if (rand !== index) shuffled[index] = shuffled[rand];\\\\n      shuffled[rand] = set[index];\\\\n    }\\\\n    return shuffled;\\\\n  };\\\\n\\\\n  // Sample **n** random values from a collection.\\\\n  // If **n** is not specified, returns a single random element.\\\\n  // The internal `guard` argument allows it to work with `map`.\\\\n  _.sample = function(obj, n, guard) {\\\\n    if (n == null || guard) {\\\\n      if (!isArrayLike(obj)) obj = _.values(obj);\\\\n      return obj[_.random(obj.length - 1)];\\\\n    }\\\\n    return _.shuffle(obj).slice(0, Math.max(0, n));\\\\n  };\\\\n\\\\n  // Sort the object\'s values by a criterion produced by an iteratee.\\\\n  _.sortBy = function(obj, iteratee, context) {\\\\n    iteratee = cb(iteratee, context);\\\\n    return _.pluck(_.map(obj, function(value, index, list) {\\\\n      return {\\\\n        value: value,\\\\n        index: index,\\\\n        criteria: iteratee(value, index, list)\\\\n      };\\\\n    }).sort(function(left, right) {\\\\n      var a = left.criteria;\\\\n      var b = right.criteria;\\\\n      if (a !== b) {\\\\n        if (a > b || a === void 0) return 1;\\\\n        if (a < b || b === void 0) return -1;\\\\n      }\\\\n      return left.index - right.index;\\\\n    }), \'value\');\\\\n  };\\\\n\\\\n  // An internal function used for aggregate \\\\\\"group by\\\\\\" operations.\\\\n  var group = function(behavior) {\\\\n    return function(obj, iteratee, context) {\\\\n      var result = {};\\\\n      iteratee = cb(iteratee, context);\\\\n      _.each(obj, function(value, index) {\\\\n        var key = iteratee(value, index, obj);\\\\n        behavior(result, value, key);\\\\n      });\\\\n      return result;\\\\n    };\\\\n  };\\\\n\\\\n  // Groups the object\'s values by a criterion. Pass either a string attribute\\\\n  // to group by, or a function that returns the criterion.\\\\n  _.groupBy = group(function(result, value, key) {\\\\n    if (_.has(result, key)) result[key].push(value); else result[key] = [value];\\\\n  });\\\\n\\\\n  // Indexes the object\'s values by a criterion, similar to `groupBy`, but for\\\\n  // when you know that your index values will be unique.\\\\n  _.indexBy = group(function(result, value, key) {\\\\n    result[key] = value;\\\\n  });\\\\n\\\\n  // Counts instances of an object that group by a certain criterion. Pass\\\\n  // either a string attribute to count by, or a function that returns the\\\\n  // criterion.\\\\n  _.countBy = group(function(result, value, key) {\\\\n    if (_.has(result, key)) result[key]++; else result[key] = 1;\\\\n  });\\\\n\\\\n  // Safely create a real, live array from anything iterable.\\\\n  _.toArray = function(obj) {\\\\n    if (!obj) return [];\\\\n    if (_.isArray(obj)) return slice.call(obj);\\\\n    if (isArrayLike(obj)) return _.map(obj, _.identity);\\\\n    return _.values(obj);\\\\n  };\\\\n\\\\n  // Return the number of elements in an object.\\\\n  _.size = function(obj) {\\\\n    if (obj == null) return 0;\\\\n    return isArrayLike(obj) ? obj.length : _.keys(obj).length;\\\\n  };\\\\n\\\\n  // Split a collection into two arrays: one whose elements all satisfy the given\\\\n  // predicate, and one whose elements all do not satisfy the predicate.\\\\n  _.partition = function(obj, predicate, context) {\\\\n    predicate = cb(predicate, context);\\\\n    var pass = [], fail = [];\\\\n    _.each(obj, function(value, key, obj) {\\\\n      (predicate(value, key, obj) ? pass : fail).push(value);\\\\n    });\\\\n    return [pass, fail];\\\\n  };\\\\n\\\\n  // Array Functions\\\\n  // ---------------\\\\n\\\\n  // Get the first element of an array. Passing **n** will return the first N\\\\n  // values in the array. Aliased as `head` and `take`. The **guard** check\\\\n  // allows it to work with `_.map`.\\\\n  _.first = _.head = _.take = function(array, n, guard) {\\\\n    if (array == null) return void 0;\\\\n    if (n == null || guard) return array[0];\\\\n    return _.initial(array, array.length - n);\\\\n  };\\\\n\\\\n  // Returns everything but the last entry of the array. Especially useful on\\\\n  // the arguments object. Passing **n** will return all the values in\\\\n  // the array, excluding the last N.\\\\n  _.initial = function(array, n, guard) {\\\\n    return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\\\\n  };\\\\n\\\\n  // Get the last element of an array. Passing **n** will return the last N\\\\n  // values in the array.\\\\n  _.last = function(array, n, guard) {\\\\n    if (array == null) return void 0;\\\\n    if (n == null || guard) return array[array.length - 1];\\\\n    return _.rest(array, Math.max(0, array.length - n));\\\\n  };\\\\n\\\\n  // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\\\\n  // Especially useful on the arguments object. Passing an **n** will return\\\\n  // the rest N values in the array.\\\\n  _.rest = _.tail = _.drop = function(array, n, guard) {\\\\n    return slice.call(array, n == null || guard ? 1 : n);\\\\n  };\\\\n\\\\n  // Trim out all falsy values from an array.\\\\n  _.compact = function(array) {\\\\n    return _.filter(array, _.identity);\\\\n  };\\\\n\\\\n  // Internal implementation of a recursive `flatten` function.\\\\n  var flatten = function(input, shallow, strict, startIndex) {\\\\n    var output = [], idx = 0;\\\\n    for (var i = startIndex || 0, length = getLength(input); i < length; i++) {\\\\n      var value = input[i];\\\\n      if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\\\\n        //flatten current level of array or arguments object\\\\n        if (!shallow) value = flatten(value, shallow, strict);\\\\n        var j = 0, len = value.length;\\\\n        output.length += len;\\\\n        while (j < len) {\\\\n          output[idx++] = value[j++];\\\\n        }\\\\n      } else if (!strict) {\\\\n        output[idx++] = value;\\\\n      }\\\\n    }\\\\n    return output;\\\\n  };\\\\n\\\\n  // Flatten out an array, either recursively (by default), or just one level.\\\\n  _.flatten = function(array, shallow) {\\\\n    return flatten(array, shallow, false);\\\\n  };\\\\n\\\\n  // Return a version of the array that does not contain the specified value(s).\\\\n  _.without = function(array) {\\\\n    return _.difference(array, slice.call(arguments, 1));\\\\n  };\\\\n\\\\n  // Produce a duplicate-free version of the array. If the array has already\\\\n  // been sorted, you have the option of using a faster algorithm.\\\\n  // Aliased as `unique`.\\\\n  _.uniq = _.unique = function(array, isSorted, iteratee, context) {\\\\n    if (!_.isBoolean(isSorted)) {\\\\n      context = iteratee;\\\\n      iteratee = isSorted;\\\\n      isSorted = false;\\\\n    }\\\\n    if (iteratee != null) iteratee = cb(iteratee, context);\\\\n    var result = [];\\\\n    var seen = [];\\\\n    for (var i = 0, length = getLength(array); i < length; i++) {\\\\n      var value = array[i],\\\\n          computed = iteratee ? iteratee(value, i, array) : value;\\\\n      if (isSorted) {\\\\n        if (!i || seen !== computed) result.push(value);\\\\n        seen = computed;\\\\n      } else if (iteratee) {\\\\n        if (!_.contains(seen, computed)) {\\\\n          seen.push(computed);\\\\n          result.push(value);\\\\n        }\\\\n      } else if (!_.contains(result, value)) {\\\\n        result.push(value);\\\\n      }\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Produce an array that contains the union: each distinct element from all of\\\\n  // the passed-in arrays.\\\\n  _.union = function() {\\\\n    return _.uniq(flatten(arguments, true, true));\\\\n  };\\\\n\\\\n  // Produce an array that contains every item shared between all the\\\\n  // passed-in arrays.\\\\n  _.intersection = function(array) {\\\\n    var result = [];\\\\n    var argsLength = arguments.length;\\\\n    for (var i = 0, length = getLength(array); i < length; i++) {\\\\n      var item = array[i];\\\\n      if (_.contains(result, item)) continue;\\\\n      for (var j = 1; j < argsLength; j++) {\\\\n        if (!_.contains(arguments[j], item)) break;\\\\n      }\\\\n      if (j === argsLength) result.push(item);\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Take the difference between one array and a number of other arrays.\\\\n  // Only the elements present in just the first array will remain.\\\\n  _.difference = function(array) {\\\\n    var rest = flatten(arguments, true, true, 1);\\\\n    return _.filter(array, function(value){\\\\n      return !_.contains(rest, value);\\\\n    });\\\\n  };\\\\n\\\\n  // Zip together multiple lists into a single array -- elements that share\\\\n  // an index go together.\\\\n  _.zip = function() {\\\\n    return _.unzip(arguments);\\\\n  };\\\\n\\\\n  // Complement of _.zip. Unzip accepts an array of arrays and groups\\\\n  // each array\'s elements on shared indices\\\\n  _.unzip = function(array) {\\\\n    var length = array && _.max(array, getLength).length || 0;\\\\n    var result = Array(length);\\\\n\\\\n    for (var index = 0; index < length; index++) {\\\\n      result[index] = _.pluck(array, index);\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Converts lists into objects. Pass either a single array of `[key, value]`\\\\n  // pairs, or two parallel arrays of the same length -- one of keys, and one of\\\\n  // the corresponding values.\\\\n  _.object = function(list, values) {\\\\n    var result = {};\\\\n    for (var i = 0, length = getLength(list); i < length; i++) {\\\\n      if (values) {\\\\n        result[list[i]] = values[i];\\\\n      } else {\\\\n        result[list[i][0]] = list[i][1];\\\\n      }\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Generator function to create the findIndex and findLastIndex functions\\\\n  function createPredicateIndexFinder(dir) {\\\\n    return function(array, predicate, context) {\\\\n      predicate = cb(predicate, context);\\\\n      var length = getLength(array);\\\\n      var index = dir > 0 ? 0 : length - 1;\\\\n      for (; index >= 0 && index < length; index += dir) {\\\\n        if (predicate(array[index], index, array)) return index;\\\\n      }\\\\n      return -1;\\\\n    };\\\\n  }\\\\n\\\\n  // Returns the first index on an array-like that passes a predicate test\\\\n  _.findIndex = createPredicateIndexFinder(1);\\\\n  _.findLastIndex = createPredicateIndexFinder(-1);\\\\n\\\\n  // Use a comparator function to figure out the smallest index at which\\\\n  // an object should be inserted so as to maintain order. Uses binary search.\\\\n  _.sortedIndex = function(array, obj, iteratee, context) {\\\\n    iteratee = cb(iteratee, context, 1);\\\\n    var value = iteratee(obj);\\\\n    var low = 0, high = getLength(array);\\\\n    while (low < high) {\\\\n      var mid = Math.floor((low + high) / 2);\\\\n      if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\\\\n    }\\\\n    return low;\\\\n  };\\\\n\\\\n  // Generator function to create the indexOf and lastIndexOf functions\\\\n  function createIndexFinder(dir, predicateFind, sortedIndex) {\\\\n    return function(array, item, idx) {\\\\n      var i = 0, length = getLength(array);\\\\n      if (typeof idx == \'number\') {\\\\n        if (dir > 0) {\\\\n            i = idx >= 0 ? idx : Math.max(idx + length, i);\\\\n        } else {\\\\n            length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\\\\n        }\\\\n      } else if (sortedIndex && idx && length) {\\\\n        idx = sortedIndex(array, item);\\\\n        return array[idx] === item ? idx : -1;\\\\n      }\\\\n      if (item !== item) {\\\\n        idx = predicateFind(slice.call(array, i, length), _.isNaN);\\\\n        return idx >= 0 ? idx + i : -1;\\\\n      }\\\\n      for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\\\\n        if (array[idx] === item) return idx;\\\\n      }\\\\n      return -1;\\\\n    };\\\\n  }\\\\n\\\\n  // Return the position of the first occurrence of an item in an array,\\\\n  // or -1 if the item is not included in the array.\\\\n  // If the array is large and already in sort order, pass `true`\\\\n  // for **isSorted** to use binary search.\\\\n  _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\\\\n  _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\\\\n\\\\n  // Generate an integer Array containing an arithmetic progression. A port of\\\\n  // the native Python `range()` function. See\\\\n  // [the Python documentation](http://docs.python.org/library/functions.html#range).\\\\n  _.range = function(start, stop, step) {\\\\n    if (stop == null) {\\\\n      stop = start || 0;\\\\n      start = 0;\\\\n    }\\\\n    step = step || 1;\\\\n\\\\n    var length = Math.max(Math.ceil((stop - start) / step), 0);\\\\n    var range = Array(length);\\\\n\\\\n    for (var idx = 0; idx < length; idx++, start += step) {\\\\n      range[idx] = start;\\\\n    }\\\\n\\\\n    return range;\\\\n  };\\\\n\\\\n  // Function (ahem) Functions\\\\n  // ------------------\\\\n\\\\n  // Determines whether to execute a function as a constructor\\\\n  // or a normal function with the provided arguments\\\\n  var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\\\\n    if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\\\\n    var self = baseCreate(sourceFunc.prototype);\\\\n    var result = sourceFunc.apply(self, args);\\\\n    if (_.isObject(result)) return result;\\\\n    return self;\\\\n  };\\\\n\\\\n  // Create a function bound to a given object (assigning `this`, and arguments,\\\\n  // optionally). Delegates to **ECMAScript 5**\'s native `Function.bind` if\\\\n  // available.\\\\n  _.bind = function(func, context) {\\\\n    if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));\\\\n    if (!_.isFunction(func)) throw new TypeError(\'Bind must be called on a function\');\\\\n    var args = slice.call(arguments, 2);\\\\n    var bound = function() {\\\\n      return executeBound(func, bound, context, this, args.concat(slice.call(arguments)));\\\\n    };\\\\n    return bound;\\\\n  };\\\\n\\\\n  // Partially apply a function by creating a version that has had some of its\\\\n  // arguments pre-filled, without changing its dynamic `this` context. _ acts\\\\n  // as a placeholder, allowing any combination of arguments to be pre-filled.\\\\n  _.partial = function(func) {\\\\n    var boundArgs = slice.call(arguments, 1);\\\\n    var bound = function() {\\\\n      var position = 0, length = boundArgs.length;\\\\n      var args = Array(length);\\\\n      for (var i = 0; i < length; i++) {\\\\n        args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i];\\\\n      }\\\\n      while (position < arguments.length) args.push(arguments[position++]);\\\\n      return executeBound(func, bound, this, this, args);\\\\n    };\\\\n    return bound;\\\\n  };\\\\n\\\\n  // Bind a number of an object\'s methods to that object. Remaining arguments\\\\n  // are the method names to be bound. Useful for ensuring that all callbacks\\\\n  // defined on an object belong to it.\\\\n  _.bindAll = function(obj) {\\\\n    var i, length = arguments.length, key;\\\\n    if (length <= 1) throw new Error(\'bindAll must be passed function names\');\\\\n    for (i = 1; i < length; i++) {\\\\n      key = arguments[i];\\\\n      obj[key] = _.bind(obj[key], obj);\\\\n    }\\\\n    return obj;\\\\n  };\\\\n\\\\n  // Memoize an expensive function by storing its results.\\\\n  _.memoize = function(func, hasher) {\\\\n    var memoize = function(key) {\\\\n      var cache = memoize.cache;\\\\n      var address = \'\' + (hasher ? hasher.apply(this, arguments) : key);\\\\n      if (!_.has(cache, address)) cache[address] = func.apply(this, arguments);\\\\n      return cache[address];\\\\n    };\\\\n    memoize.cache = {};\\\\n    return memoize;\\\\n  };\\\\n\\\\n  // Delays a function for the given number of milliseconds, and then calls\\\\n  // it with the arguments supplied.\\\\n  _.delay = function(func, wait) {\\\\n    var args = slice.call(arguments, 2);\\\\n    return setTimeout(function(){\\\\n      return func.apply(null, args);\\\\n    }, wait);\\\\n  };\\\\n\\\\n  // Defers a function, scheduling it to run after the current call stack has\\\\n  // cleared.\\\\n  _.defer = _.partial(_.delay, _, 1);\\\\n\\\\n  // Returns a function, that, when invoked, will only be triggered at most once\\\\n  // during a given window of time. Normally, the throttled function will run\\\\n  // as much as it can, without ever going more than once per `wait` duration;\\\\n  // but if you\'d like to disable the execution on the leading edge, pass\\\\n  // `{leading: false}`. To disable execution on the trailing edge, ditto.\\\\n  _.throttle = function(func, wait, options) {\\\\n    var context, args, result;\\\\n    var timeout = null;\\\\n    var previous = 0;\\\\n    if (!options) options = {};\\\\n    var later = function() {\\\\n      previous = options.leading === false ? 0 : _.now();\\\\n      timeout = null;\\\\n      result = func.apply(context, args);\\\\n      if (!timeout) context = args = null;\\\\n    };\\\\n    return function() {\\\\n      var now = _.now();\\\\n      if (!previous && options.leading === false) previous = now;\\\\n      var remaining = wait - (now - previous);\\\\n      context = this;\\\\n      args = arguments;\\\\n      if (remaining <= 0 || remaining > wait) {\\\\n        if (timeout) {\\\\n          clearTimeout(timeout);\\\\n          timeout = null;\\\\n        }\\\\n        previous = now;\\\\n        result = func.apply(context, args);\\\\n        if (!timeout) context = args = null;\\\\n      } else if (!timeout && options.trailing !== false) {\\\\n        timeout = setTimeout(later, remaining);\\\\n      }\\\\n      return result;\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a function, that, as long as it continues to be invoked, will not\\\\n  // be triggered. The function will be called after it stops being called for\\\\n  // N milliseconds. If `immediate` is passed, trigger the function on the\\\\n  // leading edge, instead of the trailing.\\\\n  _.debounce = function(func, wait, immediate) {\\\\n    var timeout, args, context, timestamp, result;\\\\n\\\\n    var later = function() {\\\\n      var last = _.now() - timestamp;\\\\n\\\\n      if (last < wait && last >= 0) {\\\\n        timeout = setTimeout(later, wait - last);\\\\n      } else {\\\\n        timeout = null;\\\\n        if (!immediate) {\\\\n          result = func.apply(context, args);\\\\n          if (!timeout) context = args = null;\\\\n        }\\\\n      }\\\\n    };\\\\n\\\\n    return function() {\\\\n      context = this;\\\\n      args = arguments;\\\\n      timestamp = _.now();\\\\n      var callNow = immediate && !timeout;\\\\n      if (!timeout) timeout = setTimeout(later, wait);\\\\n      if (callNow) {\\\\n        result = func.apply(context, args);\\\\n        context = args = null;\\\\n      }\\\\n\\\\n      return result;\\\\n    };\\\\n  };\\\\n\\\\n  // Returns the first function passed as an argument to the second,\\\\n  // allowing you to adjust arguments, run code before and after, and\\\\n  // conditionally execute the original function.\\\\n  _.wrap = function(func, wrapper) {\\\\n    return _.partial(wrapper, func);\\\\n  };\\\\n\\\\n  // Returns a negated version of the passed-in predicate.\\\\n  _.negate = function(predicate) {\\\\n    return function() {\\\\n      return !predicate.apply(this, arguments);\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a function that is the composition of a list of functions, each\\\\n  // consuming the return value of the function that follows.\\\\n  _.compose = function() {\\\\n    var args = arguments;\\\\n    var start = args.length - 1;\\\\n    return function() {\\\\n      var i = start;\\\\n      var result = args[start].apply(this, arguments);\\\\n      while (i--) result = args[i].call(this, result);\\\\n      return result;\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a function that will only be executed on and after the Nth call.\\\\n  _.after = function(times, func) {\\\\n    return function() {\\\\n      if (--times < 1) {\\\\n        return func.apply(this, arguments);\\\\n      }\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a function that will only be executed up to (but not including) the Nth call.\\\\n  _.before = function(times, func) {\\\\n    var memo;\\\\n    return function() {\\\\n      if (--times > 0) {\\\\n        memo = func.apply(this, arguments);\\\\n      }\\\\n      if (times <= 1) func = null;\\\\n      return memo;\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a function that will be executed at most one time, no matter how\\\\n  // often you call it. Useful for lazy initialization.\\\\n  _.once = _.partial(_.before, 2);\\\\n\\\\n  // Object Functions\\\\n  // ----------------\\\\n\\\\n  // Keys in IE < 9 that won\'t be iterated by `for key in ...` and thus missed.\\\\n  var hasEnumBug = !{toString: null}.propertyIsEnumerable(\'toString\');\\\\n  var nonEnumerableProps = [\'valueOf\', \'isPrototypeOf\', \'toString\',\\\\n                      \'propertyIsEnumerable\', \'hasOwnProperty\', \'toLocaleString\'];\\\\n\\\\n  function collectNonEnumProps(obj, keys) {\\\\n    var nonEnumIdx = nonEnumerableProps.length;\\\\n    var constructor = obj.constructor;\\\\n    var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto;\\\\n\\\\n    // Constructor is a special case.\\\\n    var prop = \'constructor\';\\\\n    if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\\\\n\\\\n    while (nonEnumIdx--) {\\\\n      prop = nonEnumerableProps[nonEnumIdx];\\\\n      if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\\\\n        keys.push(prop);\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  // Retrieve the names of an object\'s own properties.\\\\n  // Delegates to **ECMAScript 5**\'s native `Object.keys`\\\\n  _.keys = function(obj) {\\\\n    if (!_.isObject(obj)) return [];\\\\n    if (nativeKeys) return nativeKeys(obj);\\\\n    var keys = [];\\\\n    for (var key in obj) if (_.has(obj, key)) keys.push(key);\\\\n    // Ahem, IE < 9.\\\\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\\\\n    return keys;\\\\n  };\\\\n\\\\n  // Retrieve all the property names of an object.\\\\n  _.allKeys = function(obj) {\\\\n    if (!_.isObject(obj)) return [];\\\\n    var keys = [];\\\\n    for (var key in obj) keys.push(key);\\\\n    // Ahem, IE < 9.\\\\n    if (hasEnumBug) collectNonEnumProps(obj, keys);\\\\n    return keys;\\\\n  };\\\\n\\\\n  // Retrieve the values of an object\'s properties.\\\\n  _.values = function(obj) {\\\\n    var keys = _.keys(obj);\\\\n    var length = keys.length;\\\\n    var values = Array(length);\\\\n    for (var i = 0; i < length; i++) {\\\\n      values[i] = obj[keys[i]];\\\\n    }\\\\n    return values;\\\\n  };\\\\n\\\\n  // Returns the results of applying the iteratee to each element of the object\\\\n  // In contrast to _.map it returns an object\\\\n  _.mapObject = function(obj, iteratee, context) {\\\\n    iteratee = cb(iteratee, context);\\\\n    var keys =  _.keys(obj),\\\\n          length = keys.length,\\\\n          results = {},\\\\n          currentKey;\\\\n      for (var index = 0; index < length; index++) {\\\\n        currentKey = keys[index];\\\\n        results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\\\\n      }\\\\n      return results;\\\\n  };\\\\n\\\\n  // Convert an object into a list of `[key, value]` pairs.\\\\n  _.pairs = function(obj) {\\\\n    var keys = _.keys(obj);\\\\n    var length = keys.length;\\\\n    var pairs = Array(length);\\\\n    for (var i = 0; i < length; i++) {\\\\n      pairs[i] = [keys[i], obj[keys[i]]];\\\\n    }\\\\n    return pairs;\\\\n  };\\\\n\\\\n  // Invert the keys and values of an object. The values must be serializable.\\\\n  _.invert = function(obj) {\\\\n    var result = {};\\\\n    var keys = _.keys(obj);\\\\n    for (var i = 0, length = keys.length; i < length; i++) {\\\\n      result[obj[keys[i]]] = keys[i];\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n  // Return a sorted list of the function names available on the object.\\\\n  // Aliased as `methods`\\\\n  _.functions = _.methods = function(obj) {\\\\n    var names = [];\\\\n    for (var key in obj) {\\\\n      if (_.isFunction(obj[key])) names.push(key);\\\\n    }\\\\n    return names.sort();\\\\n  };\\\\n\\\\n  // Extend a given object with all the properties in passed-in object(s).\\\\n  _.extend = createAssigner(_.allKeys);\\\\n\\\\n  // Assigns a given object with all the own properties in the passed-in object(s)\\\\n  // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\\\\n  _.extendOwn = _.assign = createAssigner(_.keys);\\\\n\\\\n  // Returns the first key on an object that passes a predicate test\\\\n  _.findKey = function(obj, predicate, context) {\\\\n    predicate = cb(predicate, context);\\\\n    var keys = _.keys(obj), key;\\\\n    for (var i = 0, length = keys.length; i < length; i++) {\\\\n      key = keys[i];\\\\n      if (predicate(obj[key], key, obj)) return key;\\\\n    }\\\\n  };\\\\n\\\\n  // Return a copy of the object only containing the whitelisted properties.\\\\n  _.pick = function(object, oiteratee, context) {\\\\n    var result = {}, obj = object, iteratee, keys;\\\\n    if (obj == null) return result;\\\\n    if (_.isFunction(oiteratee)) {\\\\n      keys = _.allKeys(obj);\\\\n      iteratee = optimizeCb(oiteratee, context);\\\\n    } else {\\\\n      keys = flatten(arguments, false, false, 1);\\\\n      iteratee = function(value, key, obj) { return key in obj; };\\\\n      obj = Object(obj);\\\\n    }\\\\n    for (var i = 0, length = keys.length; i < length; i++) {\\\\n      var key = keys[i];\\\\n      var value = obj[key];\\\\n      if (iteratee(value, key, obj)) result[key] = value;\\\\n    }\\\\n    return result;\\\\n  };\\\\n\\\\n   // Return a copy of the object without the blacklisted properties.\\\\n  _.omit = function(obj, iteratee, context) {\\\\n    if (_.isFunction(iteratee)) {\\\\n      iteratee = _.negate(iteratee);\\\\n    } else {\\\\n      var keys = _.map(flatten(arguments, false, false, 1), String);\\\\n      iteratee = function(value, key) {\\\\n        return !_.contains(keys, key);\\\\n      };\\\\n    }\\\\n    return _.pick(obj, iteratee, context);\\\\n  };\\\\n\\\\n  // Fill in a given object with default properties.\\\\n  _.defaults = createAssigner(_.allKeys, true);\\\\n\\\\n  // Creates an object that inherits from the given prototype object.\\\\n  // If additional properties are provided then they will be added to the\\\\n  // created object.\\\\n  _.create = function(prototype, props) {\\\\n    var result = baseCreate(prototype);\\\\n    if (props) _.extendOwn(result, props);\\\\n    return result;\\\\n  };\\\\n\\\\n  // Create a (shallow-cloned) duplicate of an object.\\\\n  _.clone = function(obj) {\\\\n    if (!_.isObject(obj)) return obj;\\\\n    return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\\\\n  };\\\\n\\\\n  // Invokes interceptor with the obj, and then returns obj.\\\\n  // The primary purpose of this method is to \\\\\\"tap into\\\\\\" a method chain, in\\\\n  // order to perform operations on intermediate results within the chain.\\\\n  _.tap = function(obj, interceptor) {\\\\n    interceptor(obj);\\\\n    return obj;\\\\n  };\\\\n\\\\n  // Returns whether an object has a given set of `key:value` pairs.\\\\n  _.isMatch = function(object, attrs) {\\\\n    var keys = _.keys(attrs), length = keys.length;\\\\n    if (object == null) return !length;\\\\n    var obj = Object(object);\\\\n    for (var i = 0; i < length; i++) {\\\\n      var key = keys[i];\\\\n      if (attrs[key] !== obj[key] || !(key in obj)) return false;\\\\n    }\\\\n    return true;\\\\n  };\\\\n\\\\n\\\\n  // Internal recursive comparison function for `isEqual`.\\\\n  var eq = function(a, b, aStack, bStack) {\\\\n    // Identical objects are equal. `0 === -0`, but they aren\'t identical.\\\\n    // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\\\\n    if (a === b) return a !== 0 || 1 / a === 1 / b;\\\\n    // A strict comparison is necessary because `null == undefined`.\\\\n    if (a == null || b == null) return a === b;\\\\n    // Unwrap any wrapped objects.\\\\n    if (a instanceof _) a = a._wrapped;\\\\n    if (b instanceof _) b = b._wrapped;\\\\n    // Compare `[[Class]]` names.\\\\n    var className = toString.call(a);\\\\n    if (className !== toString.call(b)) return false;\\\\n    switch (className) {\\\\n      // Strings, numbers, regular expressions, dates, and booleans are compared by value.\\\\n      case \'[object RegExp]\':\\\\n      // RegExps are coerced to strings for comparison (Note: \'\' + /a/i === \'/a/i\')\\\\n      case \'[object String]\':\\\\n        // Primitives and their corresponding object wrappers are equivalent; thus, `\\\\\\"5\\\\\\"` is\\\\n        // equivalent to `new String(\\\\\\"5\\\\\\")`.\\\\n        return \'\' + a === \'\' + b;\\\\n      case \'[object Number]\':\\\\n        // `NaN`s are equivalent, but non-reflexive.\\\\n        // Object(NaN) is equivalent to NaN\\\\n        if (+a !== +a) return +b !== +b;\\\\n        // An `egal` comparison is performed for other numeric values.\\\\n        return +a === 0 ? 1 / +a === 1 / b : +a === +b;\\\\n      case \'[object Date]\':\\\\n      case \'[object Boolean]\':\\\\n        // Coerce dates and booleans to numeric primitive values. Dates are compared by their\\\\n        // millisecond representations. Note that invalid dates with millisecond representations\\\\n        // of `NaN` are not equivalent.\\\\n        return +a === +b;\\\\n    }\\\\n\\\\n    var areArrays = className === \'[object Array]\';\\\\n    if (!areArrays) {\\\\n      if (typeof a != \'object\' || typeof b != \'object\') return false;\\\\n\\\\n      // Objects with different constructors are not equivalent, but `Object`s or `Array`s\\\\n      // from different frames are.\\\\n      var aCtor = a.constructor, bCtor = b.constructor;\\\\n      if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\\\\n                               _.isFunction(bCtor) && bCtor instanceof bCtor)\\\\n                          && (\'constructor\' in a && \'constructor\' in b)) {\\\\n        return false;\\\\n      }\\\\n    }\\\\n    // Assume equality for cyclic structures. The algorithm for detecting cyclic\\\\n    // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\\\\n\\\\n    // Initializing stack of traversed objects.\\\\n    // It\'s done here since we only need them for objects and arrays comparison.\\\\n    aStack = aStack || [];\\\\n    bStack = bStack || [];\\\\n    var length = aStack.length;\\\\n    while (length--) {\\\\n      // Linear search. Performance is inversely proportional to the number of\\\\n      // unique nested structures.\\\\n      if (aStack[length] === a) return bStack[length] === b;\\\\n    }\\\\n\\\\n    // Add the first object to the stack of traversed objects.\\\\n    aStack.push(a);\\\\n    bStack.push(b);\\\\n\\\\n    // Recursively compare objects and arrays.\\\\n    if (areArrays) {\\\\n      // Compare array lengths to determine if a deep comparison is necessary.\\\\n      length = a.length;\\\\n      if (length !== b.length) return false;\\\\n      // Deep compare the contents, ignoring non-numeric properties.\\\\n      while (length--) {\\\\n        if (!eq(a[length], b[length], aStack, bStack)) return false;\\\\n      }\\\\n    } else {\\\\n      // Deep compare objects.\\\\n      var keys = _.keys(a), key;\\\\n      length = keys.length;\\\\n      // Ensure that both objects contain the same number of properties before comparing deep equality.\\\\n      if (_.keys(b).length !== length) return false;\\\\n      while (length--) {\\\\n        // Deep compare each member\\\\n        key = keys[length];\\\\n        if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\\\\n      }\\\\n    }\\\\n    // Remove the first object from the stack of traversed objects.\\\\n    aStack.pop();\\\\n    bStack.pop();\\\\n    return true;\\\\n  };\\\\n\\\\n  // Perform a deep comparison to check if two objects are equal.\\\\n  _.isEqual = function(a, b) {\\\\n    return eq(a, b);\\\\n  };\\\\n\\\\n  // Is a given array, string, or object empty?\\\\n  // An \\\\\\"empty\\\\\\" object has no enumerable own-properties.\\\\n  _.isEmpty = function(obj) {\\\\n    if (obj == null) return true;\\\\n    if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\\\\n    return _.keys(obj).length === 0;\\\\n  };\\\\n\\\\n  // Is a given value a DOM element?\\\\n  _.isElement = function(obj) {\\\\n    return !!(obj && obj.nodeType === 1);\\\\n  };\\\\n\\\\n  // Is a given value an array?\\\\n  // Delegates to ECMA5\'s native Array.isArray\\\\n  _.isArray = nativeIsArray || function(obj) {\\\\n    return toString.call(obj) === \'[object Array]\';\\\\n  };\\\\n\\\\n  // Is a given variable an object?\\\\n  _.isObject = function(obj) {\\\\n    var type = typeof obj;\\\\n    return type === \'function\' || type === \'object\' && !!obj;\\\\n  };\\\\n\\\\n  // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError.\\\\n  _.each([\'Arguments\', \'Function\', \'String\', \'Number\', \'Date\', \'RegExp\', \'Error\'], function(name) {\\\\n    _[\'is\' + name] = function(obj) {\\\\n      return toString.call(obj) === \'[object \' + name + \']\';\\\\n    };\\\\n  });\\\\n\\\\n  // Define a fallback version of the method in browsers (ahem, IE < 9), where\\\\n  // there isn\'t any inspectable \\\\\\"Arguments\\\\\\" type.\\\\n  if (!_.isArguments(arguments)) {\\\\n    _.isArguments = function(obj) {\\\\n      return _.has(obj, \'callee\');\\\\n    };\\\\n  }\\\\n\\\\n  // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\\\\n  // IE 11 (#1621), and in Safari 8 (#1929).\\\\n  if (typeof /./ != \'function\' && typeof Int8Array != \'object\') {\\\\n    _.isFunction = function(obj) {\\\\n      return typeof obj == \'function\' || false;\\\\n    };\\\\n  }\\\\n\\\\n  // Is a given object a finite number?\\\\n  _.isFinite = function(obj) {\\\\n    return isFinite(obj) && !isNaN(parseFloat(obj));\\\\n  };\\\\n\\\\n  // Is the given value `NaN`? (NaN is the only number which does not equal itself).\\\\n  _.isNaN = function(obj) {\\\\n    return _.isNumber(obj) && obj !== +obj;\\\\n  };\\\\n\\\\n  // Is a given value a boolean?\\\\n  _.isBoolean = function(obj) {\\\\n    return obj === true || obj === false || toString.call(obj) === \'[object Boolean]\';\\\\n  };\\\\n\\\\n  // Is a given value equal to null?\\\\n  _.isNull = function(obj) {\\\\n    return obj === null;\\\\n  };\\\\n\\\\n  // Is a given variable undefined?\\\\n  _.isUndefined = function(obj) {\\\\n    return obj === void 0;\\\\n  };\\\\n\\\\n  // Shortcut function for checking if an object has a given property directly\\\\n  // on itself (in other words, not on a prototype).\\\\n  _.has = function(obj, key) {\\\\n    return obj != null && hasOwnProperty.call(obj, key);\\\\n  };\\\\n\\\\n  // Utility Functions\\\\n  // -----------------\\\\n\\\\n  // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\\\\n  // previous owner. Returns a reference to the Underscore object.\\\\n  _.noConflict = function() {\\\\n    root._ = previousUnderscore;\\\\n    return this;\\\\n  };\\\\n\\\\n  // Keep the identity function around for default iteratees.\\\\n  _.identity = function(value) {\\\\n    return value;\\\\n  };\\\\n\\\\n  // Predicate-generating functions. Often useful outside of Underscore.\\\\n  _.constant = function(value) {\\\\n    return function() {\\\\n      return value;\\\\n    };\\\\n  };\\\\n\\\\n  _.noop = function(){};\\\\n\\\\n  _.property = property;\\\\n\\\\n  // Generates a function for a given object that returns a given property.\\\\n  _.propertyOf = function(obj) {\\\\n    return obj == null ? function(){} : function(key) {\\\\n      return obj[key];\\\\n    };\\\\n  };\\\\n\\\\n  // Returns a predicate for checking whether an object has a given set of\\\\n  // `key:value` pairs.\\\\n  _.matcher = _.matches = function(attrs) {\\\\n    attrs = _.extendOwn({}, attrs);\\\\n    return function(obj) {\\\\n      return _.isMatch(obj, attrs);\\\\n    };\\\\n  };\\\\n\\\\n  // Run a function **n** times.\\\\n  _.times = function(n, iteratee, context) {\\\\n    var accum = Array(Math.max(0, n));\\\\n    iteratee = optimizeCb(iteratee, context, 1);\\\\n    for (var i = 0; i < n; i++) accum[i] = iteratee(i);\\\\n    return accum;\\\\n  };\\\\n\\\\n  // Return a random integer between min and max (inclusive).\\\\n  _.random = function(min, max) {\\\\n    if (max == null) {\\\\n      max = min;\\\\n      min = 0;\\\\n    }\\\\n    return min + Math.floor(Math.random() * (max - min + 1));\\\\n  };\\\\n\\\\n  // A (possibly faster) way to get the current timestamp as an integer.\\\\n  _.now = Date.now || function() {\\\\n    return new Date().getTime();\\\\n  };\\\\n\\\\n   // List of HTML entities for escaping.\\\\n  var escapeMap = {\\\\n    \'&\': \'&amp;\',\\\\n    \'<\': \'&lt;\',\\\\n    \'>\': \'&gt;\',\\\\n    \'\\\\\\"\': \'&quot;\',\\\\n    \\\\\\"\'\\\\\\": \'&#x27;\',\\\\n    \'`\': \'&#x60;\'\\\\n  };\\\\n  var unescapeMap = _.invert(escapeMap);\\\\n\\\\n  // Functions for escaping and unescaping strings to/from HTML interpolation.\\\\n  var createEscaper = function(map) {\\\\n    var escaper = function(match) {\\\\n      return map[match];\\\\n    };\\\\n    // Regexes for identifying a key that needs to be escaped\\\\n    var source = \'(?:\' + _.keys(map).join(\'|\') + \')\';\\\\n    var testRegexp = RegExp(source);\\\\n    var replaceRegexp = RegExp(source, \'g\');\\\\n    return function(string) {\\\\n      string = string == null ? \'\' : \'\' + string;\\\\n      return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\\\\n    };\\\\n  };\\\\n  _.escape = createEscaper(escapeMap);\\\\n  _.unescape = createEscaper(unescapeMap);\\\\n\\\\n  // If the value of the named `property` is a function then invoke it with the\\\\n  // `object` as context; otherwise, return it.\\\\n  _.result = function(object, property, fallback) {\\\\n    var value = object == null ? void 0 : object[property];\\\\n    if (value === void 0) {\\\\n      value = fallback;\\\\n    }\\\\n    return _.isFunction(value) ? value.call(object) : value;\\\\n  };\\\\n\\\\n  // Generate a unique integer id (unique within the entire client session).\\\\n  // Useful for temporary DOM ids.\\\\n  var idCounter = 0;\\\\n  _.uniqueId = function(prefix) {\\\\n    var id = ++idCounter + \'\';\\\\n    return prefix ? prefix + id : id;\\\\n  };\\\\n\\\\n  // By default, Underscore uses ERB-style template delimiters, change the\\\\n  // following template settings to use alternative delimiters.\\\\n  _.templateSettings = {\\\\n    evaluate    : /<%([\\\\\\\\s\\\\\\\\S]+?)%>/g,\\\\n    interpolate : /<%=([\\\\\\\\s\\\\\\\\S]+?)%>/g,\\\\n    escape      : /<%-([\\\\\\\\s\\\\\\\\S]+?)%>/g\\\\n  };\\\\n\\\\n  // When customizing `templateSettings`, if you don\'t want to define an\\\\n  // interpolation, evaluation or escaping regex, we need one that is\\\\n  // guaranteed not to match.\\\\n  var noMatch = /(.)^/;\\\\n\\\\n  // Certain characters need to be escaped so that they can be put into a\\\\n  // string literal.\\\\n  var escapes = {\\\\n    \\\\\\"\'\\\\\\":      \\\\\\"\'\\\\\\",\\\\n    \'\\\\\\\\\\\\\\\\\':     \'\\\\\\\\\\\\\\\\\',\\\\n    \'\\\\\\\\r\':     \'r\',\\\\n    \'\\\\\\\\n\':     \'n\',\\\\n    \'\\\\\\\\u2028\': \'u2028\',\\\\n    \'\\\\\\\\u2029\': \'u2029\'\\\\n  };\\\\n\\\\n  var escaper = /\\\\\\\\\\\\\\\\|\'|\\\\\\\\r|\\\\\\\\n|\\\\\\\\u2028|\\\\\\\\u2029/g;\\\\n\\\\n  var escapeChar = function(match) {\\\\n    return \'\\\\\\\\\\\\\\\\\' + escapes[match];\\\\n  };\\\\n\\\\n  // JavaScript micro-templating, similar to John Resig\'s implementation.\\\\n  // Underscore templating handles arbitrary delimiters, preserves whitespace,\\\\n  // and correctly escapes quotes within interpolated code.\\\\n  // NB: `oldSettings` only exists for backwards compatibility.\\\\n  _.template = function(text, settings, oldSettings) {\\\\n    if (!settings && oldSettings) settings = oldSettings;\\\\n    settings = _.defaults({}, settings, _.templateSettings);\\\\n\\\\n    // Combine delimiters into one regular expression via alternation.\\\\n    var matcher = RegExp([\\\\n      (settings.escape || noMatch).source,\\\\n      (settings.interpolate || noMatch).source,\\\\n      (settings.evaluate || noMatch).source\\\\n    ].join(\'|\') + \'|$\', \'g\');\\\\n\\\\n    // Compile the template source, escaping string literals appropriately.\\\\n    var index = 0;\\\\n    var source = \\\\\\"__p+=\'\\\\\\";\\\\n    text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\\\\n      source += text.slice(index, offset).replace(escaper, escapeChar);\\\\n      index = offset + match.length;\\\\n\\\\n      if (escape) {\\\\n        source += \\\\\\"\'+\\\\\\\\n((__t=(\\\\\\" + escape + \\\\\\"))==null?\'\':_.escape(__t))+\\\\\\\\n\'\\\\\\";\\\\n      } else if (interpolate) {\\\\n        source += \\\\\\"\'+\\\\\\\\n((__t=(\\\\\\" + interpolate + \\\\\\"))==null?\'\':__t)+\\\\\\\\n\'\\\\\\";\\\\n      } else if (evaluate) {\\\\n        source += \\\\\\"\';\\\\\\\\n\\\\\\" + evaluate + \\\\\\"\\\\\\\\n__p+=\'\\\\\\";\\\\n      }\\\\n\\\\n      // Adobe VMs need the match returned to produce the correct offest.\\\\n      return match;\\\\n    });\\\\n    source += \\\\\\"\';\\\\\\\\n\\\\\\";\\\\n\\\\n    // If a variable is not specified, place data values in local scope.\\\\n    if (!settings.variable) source = \'with(obj||{}){\\\\\\\\n\' + source + \'}\\\\\\\\n\';\\\\n\\\\n    source = \\\\\\"var __t,__p=\'\',__j=Array.prototype.join,\\\\\\" +\\\\n      \\\\\\"print=function(){__p+=__j.call(arguments,\'\');};\\\\\\\\n\\\\\\" +\\\\n      source + \'return __p;\\\\\\\\n\';\\\\n\\\\n    try {\\\\n      var render = new Function(settings.variable || \'obj\', \'_\', source);\\\\n    } catch (e) {\\\\n      e.source = source;\\\\n      throw e;\\\\n    }\\\\n\\\\n    var template = function(data) {\\\\n      return render.call(this, data, _);\\\\n    };\\\\n\\\\n    // Provide the compiled source as a convenience for precompilation.\\\\n    var argument = settings.variable || \'obj\';\\\\n    template.source = \'function(\' + argument + \'){\\\\\\\\n\' + source + \'}\';\\\\n\\\\n    return template;\\\\n  };\\\\n\\\\n  // Add a \\\\\\"chain\\\\\\" function. Start chaining a wrapped Underscore object.\\\\n  _.chain = function(obj) {\\\\n    var instance = _(obj);\\\\n    instance._chain = true;\\\\n    return instance;\\\\n  };\\\\n\\\\n  // OOP\\\\n  // ---------------\\\\n  // If Underscore is called as a function, it returns a wrapped object that\\\\n  // can be used OO-style. This wrapper holds altered versions of all the\\\\n  // underscore functions. Wrapped objects may be chained.\\\\n\\\\n  // Helper function to continue chaining intermediate results.\\\\n  var result = function(instance, obj) {\\\\n    return instance._chain ? _(obj).chain() : obj;\\\\n  };\\\\n\\\\n  // Add your own custom functions to the Underscore object.\\\\n  _.mixin = function(obj) {\\\\n    _.each(_.functions(obj), function(name) {\\\\n      var func = _[name] = obj[name];\\\\n      _.prototype[name] = function() {\\\\n        var args = [this._wrapped];\\\\n        push.apply(args, arguments);\\\\n        return result(this, func.apply(_, args));\\\\n      };\\\\n    });\\\\n  };\\\\n\\\\n  // Add all of the Underscore functions to the wrapper object.\\\\n  _.mixin(_);\\\\n\\\\n  // Add all mutator Array functions to the wrapper.\\\\n  _.each([\'pop\', \'push\', \'reverse\', \'shift\', \'sort\', \'splice\', \'unshift\'], function(name) {\\\\n    var method = ArrayProto[name];\\\\n    _.prototype[name] = function() {\\\\n      var obj = this._wrapped;\\\\n      method.apply(obj, arguments);\\\\n      if ((name === \'shift\' || name === \'splice\') && obj.length === 0) delete obj[0];\\\\n      return result(this, obj);\\\\n    };\\\\n  });\\\\n\\\\n  // Add all accessor Array functions to the wrapper.\\\\n  _.each([\'concat\', \'join\', \'slice\'], function(name) {\\\\n    var method = ArrayProto[name];\\\\n    _.prototype[name] = function() {\\\\n      return result(this, method.apply(this._wrapped, arguments));\\\\n    };\\\\n  });\\\\n\\\\n  // Extracts the result from a wrapped and chained object.\\\\n  _.prototype.value = function() {\\\\n    return this._wrapped;\\\\n  };\\\\n\\\\n  // Provide unwrapping proxy for some methods used in engine operations\\\\n  // such as arithmetic and JSON stringification.\\\\n  _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\\\\n\\\\n  _.prototype.toString = function() {\\\\n    return \'\' + this._wrapped;\\\\n  };\\\\n\\\\n  // AMD registration happens at the end for compatibility with AMD loaders\\\\n  // that may not enforce next-turn semantics on modules. Even though general\\\\n  // practice for AMD registration is to be anonymous, underscore registers\\\\n  // as a named module because, like jQuery, it is a base library that is\\\\n  // popular enough to be bundled in a third party lib, but not be part of\\\\n  // an AMD load request. Those cases could generate an error when an\\\\n  // anonymous define() is called outside of a loader request.\\\\n  if (true) {\\\\n    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {\\\\n      return _;\\\\n    }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\\\\n\\\\t\\\\t\\\\t\\\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\\\n  }\\\\n}.call(this));\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/underscore/underscore.js\\\\n// module id = 5\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/underscore/underscore.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar elliptic = exports;\\\\n\\\\nelliptic.version = __webpack_require__(263).version;\\\\nelliptic.utils = __webpack_require__(262);\\\\nelliptic.rand = __webpack_require__(97);\\\\nelliptic.curve = __webpack_require__(51);\\\\nelliptic.curves = __webpack_require__(254);\\\\n\\\\n// Protocols\\\\nelliptic.ec = __webpack_require__(255);\\\\nelliptic.eddsa = __webpack_require__(258);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic.js\\\\n// module id = 6\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar errors = __webpack_require__(335);\\\\nvar formatters = __webpack_require__(336);\\\\n\\\\nmodule.exports = {\\\\n    errors: errors,\\\\n    formatters: formatters\\\\n};\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-helpers/src/index.js\\\\n// module id = 7\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-helpers/src/index.js\\")},function(module,exports){eval(\\"// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\\\\nvar global = module.exports = typeof window != \'undefined\' && window.Math == Math\\\\n  ? window : typeof self != \'undefined\' && self.Math == Math ? self\\\\n  // eslint-disable-next-line no-new-func\\\\n  : Function(\'return this\')();\\\\nif (typeof __g == \'number\') __g = global; // eslint-disable-line no-undef\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_global.js\\\\n// module id = 8\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_global.js\\")},function(module,exports,__webpack_require__){eval(\\"var store = __webpack_require__(74)(\'wks\');\\\\nvar uid = __webpack_require__(50);\\\\nvar Symbol = __webpack_require__(8).Symbol;\\\\nvar USE_SYMBOL = typeof Symbol == \'function\';\\\\n\\\\nvar $exports = module.exports = function (name) {\\\\n  return store[name] || (store[name] =\\\\n    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)(\'Symbol.\' + name));\\\\n};\\\\n\\\\n$exports.store = store;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_wks.js\\\\n// module id = 9\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_wks.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file utils.js\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar ethjsUnit = __webpack_require__(265);\\\\nvar utils = __webpack_require__(165);\\\\nvar soliditySha3 = __webpack_require__(363);\\\\nvar randomHex = __webpack_require__(307);\\\\n\\\\n\\\\n\\\\n/**\\\\n * Fires an error in an event emitter and callback and returns the eventemitter\\\\n *\\\\n * @method _fireError\\\\n * @param {Object} error a string, a error, or an object with {message, data}\\\\n * @param {Object} emitter\\\\n * @param {Function} reject\\\\n * @param {Function} callback\\\\n * @return {Object} the emitter\\\\n */\\\\nvar _fireError = function (error, emitter, reject, callback) {\\\\n    /*jshint maxcomplexity: 10 */\\\\n\\\\n    // add data if given\\\\n    if(_.isObject(error) && !(error instanceof Error) &&  error.data) {\\\\n        if(_.isObject(error.data) || _.isArray(error.data)) {\\\\n            error.data = JSON.stringify(error.data, null, 2);\\\\n        }\\\\n\\\\n        error = error.message +\\\\\\"\\\\\\\\n\\\\\\"+ error.data;\\\\n    }\\\\n\\\\n    if(_.isString(error)) {\\\\n        error = new Error(error);\\\\n    }\\\\n\\\\n    if (_.isFunction(callback)) {\\\\n        callback(error);\\\\n    }\\\\n    if (_.isFunction(reject)) {\\\\n        // suppress uncatched error if an error listener is present\\\\n        if (emitter &&\\\\n            _.isFunction(emitter.listeners) &&\\\\n            emitter.listeners(\'error\').length &&\\\\n            _.isFunction(emitter.suppressUnhandledRejections)) {\\\\n            emitter.suppressUnhandledRejections();\\\\n        // OR suppress uncatched error if an callback listener is present\\\\n        } else if(_.isFunction(callback) &&\\\\n            _.isFunction(emitter.suppressUnhandledRejections)) {\\\\n            emitter.suppressUnhandledRejections();\\\\n        }\\\\n        // reject later, to be able to return emitter\\\\n        setTimeout(function () {\\\\n            reject(error);\\\\n        }, 1);\\\\n    }\\\\n\\\\n    if(emitter && _.isFunction(emitter.emit)) {\\\\n        // emit later, to be able to return emitter\\\\n        setTimeout(function () {\\\\n            emitter.emit(\'error\', error);\\\\n            emitter.removeAllListeners();\\\\n        }, 1);\\\\n    }\\\\n\\\\n    return emitter;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to create full function/event name from json abi\\\\n *\\\\n * @method _jsonInterfaceMethodToString\\\\n * @param {Object} json\\\\n * @return {String} full function/event name\\\\n */\\\\nvar _jsonInterfaceMethodToString = function (json) {\\\\n    if (_.isObject(json) && json.name && json.name.indexOf(\'(\') !== -1) {\\\\n        return json.name;\\\\n    }\\\\n\\\\n    var typeName = json.inputs.map(function(i){return i.type; }).join(\',\');\\\\n    return json.name + \'(\' + typeName + \')\';\\\\n};\\\\n\\\\n\\\\n\\\\n/**\\\\n * Should be called to get ascii from it\'s hex representation\\\\n *\\\\n * @method hexToAscii\\\\n * @param {String} hex\\\\n * @returns {String} ascii string representation of hex value\\\\n */\\\\nvar hexToAscii = function(hex) {\\\\n    if (!utils.isHexStrict(hex))\\\\n        throw new Error(\'The parameter must be a valid HEX string.\');\\\\n\\\\n    var str = \\\\\\"\\\\\\";\\\\n    var i = 0, l = hex.length;\\\\n    if (hex.substring(0, 2) === \'0x\') {\\\\n        i = 2;\\\\n    }\\\\n    for (; i < l; i+=2) {\\\\n        var code = parseInt(hex.substr(i, 2), 16);\\\\n        str += String.fromCharCode(code);\\\\n    }\\\\n\\\\n    return str;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get hex representation (prefixed by 0x) of ascii string\\\\n *\\\\n * @method asciiToHex\\\\n * @param {String} str\\\\n * @returns {String} hex representation of input string\\\\n */\\\\nvar asciiToHex = function(str) {\\\\n    if(!str)\\\\n        return \\\\\\"0x00\\\\\\";\\\\n    var hex = \\\\\\"\\\\\\";\\\\n    for(var i = 0; i < str.length; i++) {\\\\n        var code = str.charCodeAt(i);\\\\n        var n = code.toString(16);\\\\n        hex += n.length < 2 ? \'0\' + n : n;\\\\n    }\\\\n\\\\n    return \\\\\\"0x\\\\\\" + hex;\\\\n};\\\\n\\\\n\\\\n\\\\n/**\\\\n * Returns value of unit in Wei\\\\n *\\\\n * @method getUnitValue\\\\n * @param {String} unit the unit to convert to, default ether\\\\n * @returns {BN} value of the unit (in Wei)\\\\n * @throws error if the unit is not correct:w\\\\n */\\\\nvar getUnitValue = function (unit) {\\\\n    unit = unit ? unit.toLowerCase() : \'ether\';\\\\n    if (!ethjsUnit.unitMap[unit]) {\\\\n        throw new Error(\'This unit \\\\\\"\'+ unit +\'\\\\\\" doesn\\\\\\\\\'t exist, please use the one of the following units\' + JSON.stringify(ethjsUnit.unitMap, null, 2));\\\\n    }\\\\n    return unit;\\\\n};\\\\n\\\\n/**\\\\n * Takes a number of wei and converts it to any other ether unit.\\\\n *\\\\n * Possible units are:\\\\n *   SI Short   SI Full        Effigy       Other\\\\n * - kwei       femtoether     babbage\\\\n * - mwei       picoether      lovelace\\\\n * - gwei       nanoether      shannon      nano\\\\n * - --         microether     szabo        micro\\\\n * - --         milliether     finney       milli\\\\n * - ether      --             --\\\\n * - kether                    --           grand\\\\n * - mether\\\\n * - gether\\\\n * - tether\\\\n *\\\\n * @method fromWei\\\\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\\\\n * @param {String} unit the unit to convert to, default ether\\\\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\\\\n */\\\\nvar fromWei = function(number, unit) {\\\\n    unit = getUnitValue(unit);\\\\n\\\\n    if(!utils.isBN(number) && !_.isString(number)) {\\\\n        throw new Error(\'Please pass numbers as strings or BigNumber objects to avoid precision errors.\');\\\\n    }\\\\n\\\\n    return utils.isBN(number) ? ethjsUnit.fromWei(number, unit) : ethjsUnit.fromWei(number, unit).toString(10);\\\\n};\\\\n\\\\n/**\\\\n * Takes a number of a unit and converts it to wei.\\\\n *\\\\n * Possible units are:\\\\n *   SI Short   SI Full        Effigy       Other\\\\n * - kwei       femtoether     babbage\\\\n * - mwei       picoether      lovelace\\\\n * - gwei       nanoether      shannon      nano\\\\n * - --         microether     szabo        micro\\\\n * - --         microether     szabo        micro\\\\n * - --         milliether     finney       milli\\\\n * - ether      --             --\\\\n * - kether                    --           grand\\\\n * - mether\\\\n * - gether\\\\n * - tether\\\\n *\\\\n * @method toWei\\\\n * @param {Number|String|BN} number can be a number, number string or a HEX of a decimal\\\\n * @param {String} unit the unit to convert from, default ether\\\\n * @return {String|Object} When given a BN object it returns one as well, otherwise a number\\\\n */\\\\nvar toWei = function(number, unit) {\\\\n    unit = getUnitValue(unit);\\\\n\\\\n    if(!utils.isBN(number) && !_.isString(number)) {\\\\n        throw new Error(\'Please pass numbers as strings or BigNumber objects to avoid precision errors.\');\\\\n    }\\\\n\\\\n    return utils.isBN(number) ? ethjsUnit.toWei(number, unit) : ethjsUnit.toWei(number, unit).toString(10);\\\\n};\\\\n\\\\n\\\\n\\\\n\\\\n/**\\\\n * Converts to a checksum address\\\\n *\\\\n * @method toChecksumAddress\\\\n * @param {String} address the given HEX address\\\\n * @return {String}\\\\n */\\\\nvar toChecksumAddress = function (address) {\\\\n    if (typeof address === \'undefined\') return \'\';\\\\n\\\\n    if(!/^(0x)?[0-9a-f]{40}$/i.test(address))\\\\n        throw new Error(\'Given address \\\\\\"\'+ address +\'\\\\\\" is not a valid Ethereum address.\');\\\\n\\\\n\\\\n\\\\n    address = address.toLowerCase().replace(/^0x/i,\'\');\\\\n    var addressHash = utils.sha3(address).replace(/^0x/i,\'\');\\\\n    var checksumAddress = \'0x\';\\\\n\\\\n    for (var i = 0; i < address.length; i++ ) {\\\\n        // If ith character is 9 to f then make it uppercase\\\\n        if (parseInt(addressHash[i], 16) > 7) {\\\\n            checksumAddress += address[i].toUpperCase();\\\\n        } else {\\\\n            checksumAddress += address[i];\\\\n        }\\\\n    }\\\\n    return checksumAddress;\\\\n};\\\\n\\\\n\\\\n\\\\nmodule.exports = {\\\\n    _fireError: _fireError,\\\\n    _jsonInterfaceMethodToString: _jsonInterfaceMethodToString,\\\\n    // extractDisplayName: extractDisplayName,\\\\n    // extractTypeName: extractTypeName,\\\\n    randomHex: randomHex,\\\\n    _: _,\\\\n    BN: utils.BN,\\\\n    isBN: utils.isBN,\\\\n    isBigNumber: utils.isBigNumber,\\\\n    isHex: utils.isHex,\\\\n    isHexStrict: utils.isHexStrict,\\\\n    sha3: utils.sha3,\\\\n    keccak256: utils.sha3,\\\\n    soliditySha3: soliditySha3,\\\\n    isAddress: utils.isAddress,\\\\n    checkAddressChecksum: utils.checkAddressChecksum,\\\\n    toChecksumAddress: toChecksumAddress,\\\\n    toHex: utils.toHex,\\\\n    toBN: utils.toBN,\\\\n\\\\n    bytesToHex: utils.bytesToHex,\\\\n    hexToBytes: utils.hexToBytes,\\\\n\\\\n    hexToNumberString: utils.hexToNumberString,\\\\n\\\\n    hexToNumber: utils.hexToNumber,\\\\n    toDecimal: utils.hexToNumber, // alias\\\\n\\\\n    numberToHex: utils.numberToHex,\\\\n    fromDecimal: utils.numberToHex, // alias\\\\n\\\\n    hexToUtf8: utils.hexToUtf8,\\\\n    hexToString: utils.hexToUtf8,\\\\n    toUtf8: utils.hexToUtf8,\\\\n\\\\n    utf8ToHex: utils.utf8ToHex,\\\\n    stringToHex: utils.utf8ToHex,\\\\n    fromUtf8: utils.utf8ToHex,\\\\n\\\\n    hexToAscii: hexToAscii,\\\\n    toAscii: hexToAscii,\\\\n    asciiToHex: asciiToHex,\\\\n    fromAscii: asciiToHex,\\\\n\\\\n    unitMap: ethjsUnit.unitMap,\\\\n    toWei: toWei,\\\\n    fromWei: fromWei,\\\\n\\\\n    padLeft: utils.leftPad,\\\\n    leftPad: utils.leftPad,\\\\n    padRight: utils.rightPad,\\\\n    rightPad: utils.rightPad,\\\\n    toTwosComplement: utils.toTwosComplement\\\\n};\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-utils/src/index.js\\\\n// module id = 10\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-utils/src/index.js\\")},function(module,exports){eval(\\"var core = module.exports = { version: \'2.5.5\' };\\\\nif (typeof __e == \'number\') __e = core; // eslint-disable-line no-undef\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_core.js\\\\n// module id = 11\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_core.js\\")},function(module,exports){eval(\\"module.exports = assert;\\\\n\\\\nfunction assert(val, msg) {\\\\n  if (!val)\\\\n    throw new Error(msg || \'Assertion failed\');\\\\n}\\\\n\\\\nassert.equal = function assertEqual(l, r, msg) {\\\\n  if (l != r)\\\\n    throw new Error(msg || (\'Assertion failed: \' + l + \' != \' + r));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/minimalistic-assert/index.js\\\\n// module id = 12\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/minimalistic-assert/index.js\\")},function(module,exports){eval(\\"// shim for using process in browser\\\\nvar process = module.exports = {};\\\\n\\\\n// cached from whatever global is present so that test runners that stub it\\\\n// don\'t break things.  But we need to wrap it in a try catch in case it is\\\\n// wrapped in strict mode code which doesn\'t define any globals.  It\'s inside a\\\\n// function because try/catches deoptimize in certain engines.\\\\n\\\\nvar cachedSetTimeout;\\\\nvar cachedClearTimeout;\\\\n\\\\nfunction defaultSetTimout() {\\\\n    throw new Error(\'setTimeout has not been defined\');\\\\n}\\\\nfunction defaultClearTimeout () {\\\\n    throw new Error(\'clearTimeout has not been defined\');\\\\n}\\\\n(function () {\\\\n    try {\\\\n        if (typeof setTimeout === \'function\') {\\\\n            cachedSetTimeout = setTimeout;\\\\n        } else {\\\\n            cachedSetTimeout = defaultSetTimout;\\\\n        }\\\\n    } catch (e) {\\\\n        cachedSetTimeout = defaultSetTimout;\\\\n    }\\\\n    try {\\\\n        if (typeof clearTimeout === \'function\') {\\\\n            cachedClearTimeout = clearTimeout;\\\\n        } else {\\\\n            cachedClearTimeout = defaultClearTimeout;\\\\n        }\\\\n    } catch (e) {\\\\n        cachedClearTimeout = defaultClearTimeout;\\\\n    }\\\\n} ())\\\\nfunction runTimeout(fun) {\\\\n    if (cachedSetTimeout === setTimeout) {\\\\n        //normal enviroments in sane situations\\\\n        return setTimeout(fun, 0);\\\\n    }\\\\n    // if setTimeout wasn\'t available but was latter defined\\\\n    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\\\\n        cachedSetTimeout = setTimeout;\\\\n        return setTimeout(fun, 0);\\\\n    }\\\\n    try {\\\\n        // when when somebody has screwed with setTimeout but no I.E. maddness\\\\n        return cachedSetTimeout(fun, 0);\\\\n    } catch(e){\\\\n        try {\\\\n            // When we are in I.E. but the script has been evaled so I.E. doesn\'t trust the global object when called normally\\\\n            return cachedSetTimeout.call(null, fun, 0);\\\\n        } catch(e){\\\\n            // same as above but when it\'s a version of I.E. that must have the global object for \'this\', hopfully our context correct otherwise it will throw a global error\\\\n            return cachedSetTimeout.call(this, fun, 0);\\\\n        }\\\\n    }\\\\n\\\\n\\\\n}\\\\nfunction runClearTimeout(marker) {\\\\n    if (cachedClearTimeout === clearTimeout) {\\\\n        //normal enviroments in sane situations\\\\n        return clearTimeout(marker);\\\\n    }\\\\n    // if clearTimeout wasn\'t available but was latter defined\\\\n    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\\\\n        cachedClearTimeout = clearTimeout;\\\\n        return clearTimeout(marker);\\\\n    }\\\\n    try {\\\\n        // when when somebody has screwed with setTimeout but no I.E. maddness\\\\n        return cachedClearTimeout(marker);\\\\n    } catch (e){\\\\n        try {\\\\n            // When we are in I.E. but the script has been evaled so I.E. doesn\'t  trust the global object when called normally\\\\n            return cachedClearTimeout.call(null, marker);\\\\n        } catch (e){\\\\n            // same as above but when it\'s a version of I.E. that must have the global object for \'this\', hopfully our context correct otherwise it will throw a global error.\\\\n            // Some versions of I.E. have different rules for clearTimeout vs setTimeout\\\\n            return cachedClearTimeout.call(this, marker);\\\\n        }\\\\n    }\\\\n\\\\n\\\\n\\\\n}\\\\nvar queue = [];\\\\nvar draining = false;\\\\nvar currentQueue;\\\\nvar queueIndex = -1;\\\\n\\\\nfunction cleanUpNextTick() {\\\\n    if (!draining || !currentQueue) {\\\\n        return;\\\\n    }\\\\n    draining = false;\\\\n    if (currentQueue.length) {\\\\n        queue = currentQueue.concat(queue);\\\\n    } else {\\\\n        queueIndex = -1;\\\\n    }\\\\n    if (queue.length) {\\\\n        drainQueue();\\\\n    }\\\\n}\\\\n\\\\nfunction drainQueue() {\\\\n    if (draining) {\\\\n        return;\\\\n    }\\\\n    var timeout = runTimeout(cleanUpNextTick);\\\\n    draining = true;\\\\n\\\\n    var len = queue.length;\\\\n    while(len) {\\\\n        currentQueue = queue;\\\\n        queue = [];\\\\n        while (++queueIndex < len) {\\\\n            if (currentQueue) {\\\\n                currentQueue[queueIndex].run();\\\\n            }\\\\n        }\\\\n        queueIndex = -1;\\\\n        len = queue.length;\\\\n    }\\\\n    currentQueue = null;\\\\n    draining = false;\\\\n    runClearTimeout(timeout);\\\\n}\\\\n\\\\nprocess.nextTick = function (fun) {\\\\n    var args = new Array(arguments.length - 1);\\\\n    if (arguments.length > 1) {\\\\n        for (var i = 1; i < arguments.length; i++) {\\\\n            args[i - 1] = arguments[i];\\\\n        }\\\\n    }\\\\n    queue.push(new Item(fun, args));\\\\n    if (queue.length === 1 && !draining) {\\\\n        runTimeout(drainQueue);\\\\n    }\\\\n};\\\\n\\\\n// v8 likes predictible objects\\\\nfunction Item(fun, array) {\\\\n    this.fun = fun;\\\\n    this.array = array;\\\\n}\\\\nItem.prototype.run = function () {\\\\n    this.fun.apply(null, this.array);\\\\n};\\\\nprocess.title = \'browser\';\\\\nprocess.browser = true;\\\\nprocess.env = {};\\\\nprocess.argv = [];\\\\nprocess.version = \'\'; // empty string to avoid regexp issues\\\\nprocess.versions = {};\\\\n\\\\nfunction noop() {}\\\\n\\\\nprocess.on = noop;\\\\nprocess.addListener = noop;\\\\nprocess.once = noop;\\\\nprocess.off = noop;\\\\nprocess.removeListener = noop;\\\\nprocess.removeAllListeners = noop;\\\\nprocess.emit = noop;\\\\nprocess.prependListener = noop;\\\\nprocess.prependOnceListener = noop;\\\\n\\\\nprocess.listeners = function (name) { return [] }\\\\n\\\\nprocess.binding = function (name) {\\\\n    throw new Error(\'process.binding is not supported\');\\\\n};\\\\n\\\\nprocess.cwd = function () { return \'/\' };\\\\nprocess.chdir = function (dir) {\\\\n    throw new Error(\'process.chdir is not supported\');\\\\n};\\\\nprocess.umask = function() { return 0; };\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/node-libs-browser/~/process/browser.js\\\\n// module id = 13\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/node-libs-browser/node_modules/process/browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar assert = __webpack_require__(12);\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\nexports.inherits = inherits;\\\\n\\\\nfunction toArray(msg, enc) {\\\\n  if (Array.isArray(msg))\\\\n    return msg.slice();\\\\n  if (!msg)\\\\n    return [];\\\\n  var res = [];\\\\n  if (typeof msg === \'string\') {\\\\n    if (!enc) {\\\\n      for (var i = 0; i < msg.length; i++) {\\\\n        var c = msg.charCodeAt(i);\\\\n        var hi = c >> 8;\\\\n        var lo = c & 0xff;\\\\n        if (hi)\\\\n          res.push(hi, lo);\\\\n        else\\\\n          res.push(lo);\\\\n      }\\\\n    } else if (enc === \'hex\') {\\\\n      msg = msg.replace(/[^a-z0-9]+/ig, \'\');\\\\n      if (msg.length % 2 !== 0)\\\\n        msg = \'0\' + msg;\\\\n      for (i = 0; i < msg.length; i += 2)\\\\n        res.push(parseInt(msg[i] + msg[i + 1], 16));\\\\n    }\\\\n  } else {\\\\n    for (i = 0; i < msg.length; i++)\\\\n      res[i] = msg[i] | 0;\\\\n  }\\\\n  return res;\\\\n}\\\\nexports.toArray = toArray;\\\\n\\\\nfunction toHex(msg) {\\\\n  var res = \'\';\\\\n  for (var i = 0; i < msg.length; i++)\\\\n    res += zero2(msg[i].toString(16));\\\\n  return res;\\\\n}\\\\nexports.toHex = toHex;\\\\n\\\\nfunction htonl(w) {\\\\n  var res = (w >>> 24) |\\\\n            ((w >>> 8) & 0xff00) |\\\\n            ((w << 8) & 0xff0000) |\\\\n            ((w & 0xff) << 24);\\\\n  return res >>> 0;\\\\n}\\\\nexports.htonl = htonl;\\\\n\\\\nfunction toHex32(msg, endian) {\\\\n  var res = \'\';\\\\n  for (var i = 0; i < msg.length; i++) {\\\\n    var w = msg[i];\\\\n    if (endian === \'little\')\\\\n      w = htonl(w);\\\\n    res += zero8(w.toString(16));\\\\n  }\\\\n  return res;\\\\n}\\\\nexports.toHex32 = toHex32;\\\\n\\\\nfunction zero2(word) {\\\\n  if (word.length === 1)\\\\n    return \'0\' + word;\\\\n  else\\\\n    return word;\\\\n}\\\\nexports.zero2 = zero2;\\\\n\\\\nfunction zero8(word) {\\\\n  if (word.length === 7)\\\\n    return \'0\' + word;\\\\n  else if (word.length === 6)\\\\n    return \'00\' + word;\\\\n  else if (word.length === 5)\\\\n    return \'000\' + word;\\\\n  else if (word.length === 4)\\\\n    return \'0000\' + word;\\\\n  else if (word.length === 3)\\\\n    return \'00000\' + word;\\\\n  else if (word.length === 2)\\\\n    return \'000000\' + word;\\\\n  else if (word.length === 1)\\\\n    return \'0000000\' + word;\\\\n  else\\\\n    return word;\\\\n}\\\\nexports.zero8 = zero8;\\\\n\\\\nfunction join32(msg, start, end, endian) {\\\\n  var len = end - start;\\\\n  assert(len % 4 === 0);\\\\n  var res = new Array(len / 4);\\\\n  for (var i = 0, k = start; i < res.length; i++, k += 4) {\\\\n    var w;\\\\n    if (endian === \'big\')\\\\n      w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\\\\n    else\\\\n      w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\\\\n    res[i] = w >>> 0;\\\\n  }\\\\n  return res;\\\\n}\\\\nexports.join32 = join32;\\\\n\\\\nfunction split32(msg, endian) {\\\\n  var res = new Array(msg.length * 4);\\\\n  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\\\\n    var m = msg[i];\\\\n    if (endian === \'big\') {\\\\n      res[k] = m >>> 24;\\\\n      res[k + 1] = (m >>> 16) & 0xff;\\\\n      res[k + 2] = (m >>> 8) & 0xff;\\\\n      res[k + 3] = m & 0xff;\\\\n    } else {\\\\n      res[k + 3] = m >>> 24;\\\\n      res[k + 2] = (m >>> 16) & 0xff;\\\\n      res[k + 1] = (m >>> 8) & 0xff;\\\\n      res[k] = m & 0xff;\\\\n    }\\\\n  }\\\\n  return res;\\\\n}\\\\nexports.split32 = split32;\\\\n\\\\nfunction rotr32(w, b) {\\\\n  return (w >>> b) | (w << (32 - b));\\\\n}\\\\nexports.rotr32 = rotr32;\\\\n\\\\nfunction rotl32(w, b) {\\\\n  return (w << b) | (w >>> (32 - b));\\\\n}\\\\nexports.rotl32 = rotl32;\\\\n\\\\nfunction sum32(a, b) {\\\\n  return (a + b) >>> 0;\\\\n}\\\\nexports.sum32 = sum32;\\\\n\\\\nfunction sum32_3(a, b, c) {\\\\n  return (a + b + c) >>> 0;\\\\n}\\\\nexports.sum32_3 = sum32_3;\\\\n\\\\nfunction sum32_4(a, b, c, d) {\\\\n  return (a + b + c + d) >>> 0;\\\\n}\\\\nexports.sum32_4 = sum32_4;\\\\n\\\\nfunction sum32_5(a, b, c, d, e) {\\\\n  return (a + b + c + d + e) >>> 0;\\\\n}\\\\nexports.sum32_5 = sum32_5;\\\\n\\\\nfunction sum64(buf, pos, ah, al) {\\\\n  var bh = buf[pos];\\\\n  var bl = buf[pos + 1];\\\\n\\\\n  var lo = (al + bl) >>> 0;\\\\n  var hi = (lo < al ? 1 : 0) + ah + bh;\\\\n  buf[pos] = hi >>> 0;\\\\n  buf[pos + 1] = lo;\\\\n}\\\\nexports.sum64 = sum64;\\\\n\\\\nfunction sum64_hi(ah, al, bh, bl) {\\\\n  var lo = (al + bl) >>> 0;\\\\n  var hi = (lo < al ? 1 : 0) + ah + bh;\\\\n  return hi >>> 0;\\\\n}\\\\nexports.sum64_hi = sum64_hi;\\\\n\\\\nfunction sum64_lo(ah, al, bh, bl) {\\\\n  var lo = al + bl;\\\\n  return lo >>> 0;\\\\n}\\\\nexports.sum64_lo = sum64_lo;\\\\n\\\\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\\\\n  var carry = 0;\\\\n  var lo = al;\\\\n  lo = (lo + bl) >>> 0;\\\\n  carry += lo < al ? 1 : 0;\\\\n  lo = (lo + cl) >>> 0;\\\\n  carry += lo < cl ? 1 : 0;\\\\n  lo = (lo + dl) >>> 0;\\\\n  carry += lo < dl ? 1 : 0;\\\\n\\\\n  var hi = ah + bh + ch + dh + carry;\\\\n  return hi >>> 0;\\\\n}\\\\nexports.sum64_4_hi = sum64_4_hi;\\\\n\\\\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\\\\n  var lo = al + bl + cl + dl;\\\\n  return lo >>> 0;\\\\n}\\\\nexports.sum64_4_lo = sum64_4_lo;\\\\n\\\\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\\\\n  var carry = 0;\\\\n  var lo = al;\\\\n  lo = (lo + bl) >>> 0;\\\\n  carry += lo < al ? 1 : 0;\\\\n  lo = (lo + cl) >>> 0;\\\\n  carry += lo < cl ? 1 : 0;\\\\n  lo = (lo + dl) >>> 0;\\\\n  carry += lo < dl ? 1 : 0;\\\\n  lo = (lo + el) >>> 0;\\\\n  carry += lo < el ? 1 : 0;\\\\n\\\\n  var hi = ah + bh + ch + dh + eh + carry;\\\\n  return hi >>> 0;\\\\n}\\\\nexports.sum64_5_hi = sum64_5_hi;\\\\n\\\\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\\\\n  var lo = al + bl + cl + dl + el;\\\\n\\\\n  return lo >>> 0;\\\\n}\\\\nexports.sum64_5_lo = sum64_5_lo;\\\\n\\\\nfunction rotr64_hi(ah, al, num) {\\\\n  var r = (al << (32 - num)) | (ah >>> num);\\\\n  return r >>> 0;\\\\n}\\\\nexports.rotr64_hi = rotr64_hi;\\\\n\\\\nfunction rotr64_lo(ah, al, num) {\\\\n  var r = (ah << (32 - num)) | (al >>> num);\\\\n  return r >>> 0;\\\\n}\\\\nexports.rotr64_lo = rotr64_lo;\\\\n\\\\nfunction shr64_hi(ah, al, num) {\\\\n  return ah >>> num;\\\\n}\\\\nexports.shr64_hi = shr64_hi;\\\\n\\\\nfunction shr64_lo(ah, al, num) {\\\\n  var r = (ah << (32 - num)) | (al >>> num);\\\\n  return r >>> 0;\\\\n}\\\\nexports.shr64_lo = shr64_lo;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/utils.js\\\\n// module id = 14\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/utils.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file formatters.js\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @author Fabian Vogelsteller <fabian@frozeman.de>\\\\n * @date 2017\\\\n */\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar utils = __webpack_require__(10);\\\\nvar BN = __webpack_require__(343);\\\\nvar SolidityParam = __webpack_require__(158);\\\\n\\\\n\\\\n\\\\n/**\\\\n * Formats input value to byte representation of int\\\\n * If value is negative, return it\'s two\'s complement\\\\n * If the value is floating point, round it down\\\\n *\\\\n * @method formatInputInt\\\\n * @param {String|Number|BN} value that needs to be formatted\\\\n * @returns {SolidityParam}\\\\n */\\\\nvar formatInputInt = function (value) {\\\\n    if(_.isNumber(value)) {\\\\n        value = Math.trunc(value);\\\\n    }\\\\n    return new SolidityParam(utils.toTwosComplement(value).replace(\'0x\',\'\'));\\\\n};\\\\n\\\\n/**\\\\n * Formats input bytes\\\\n *\\\\n * @method formatInputBytes\\\\n * @param {String} value\\\\n * @returns {SolidityParam}\\\\n */\\\\nvar formatInputBytes = function (value) {\\\\n    if(!utils.isHexStrict(value)) {\\\\n        throw new Error(\'Given parameter is not bytes: \\\\\\"\'+ value + \'\\\\\\"\');\\\\n    }\\\\n\\\\n    var result = value.replace(/^0x/i,\'\');\\\\n\\\\n    if(result.length % 2 !== 0) {\\\\n        throw new Error(\'Given parameter bytes has an invalid length: \\\\\\"\'+ value + \'\\\\\\"\');\\\\n    }\\\\n\\\\n    if (result.length > 64) {\\\\n        throw new Error(\'Given parameter bytes is too long: \\\\\\"\' + value + \'\\\\\\"\');\\\\n    }\\\\n\\\\n    var l = Math.floor((result.length + 63) / 64);\\\\n    result = utils.padRight(result, l * 64);\\\\n    return new SolidityParam(result);\\\\n};\\\\n\\\\n/**\\\\n * Formats input bytes\\\\n *\\\\n * @method formatDynamicInputBytes\\\\n * @param {String} value\\\\n * @returns {SolidityParam}\\\\n */\\\\nvar formatInputDynamicBytes = function (value) {\\\\n    if(!utils.isHexStrict(value)) {\\\\n        throw new Error(\'Given parameter is not bytes: \\\\\\"\'+ value + \'\\\\\\"\');\\\\n    }\\\\n\\\\n    var result = value.replace(/^0x/i,\'\');\\\\n\\\\n    if(result.length % 2 !== 0) {\\\\n        throw new Error(\'Given parameter bytes has an invalid length: \\\\\\"\'+ value + \'\\\\\\"\');\\\\n    }\\\\n\\\\n    var length = result.length / 2;\\\\n    var l = Math.floor((result.length + 63) / 64);\\\\n    result = utils.padRight(result, l * 64);\\\\n    return new SolidityParam(formatInputInt(length).value + result);\\\\n};\\\\n\\\\n/**\\\\n * Formats input value to byte representation of string\\\\n *\\\\n * @method formatInputString\\\\n * @param {String}\\\\n * @returns {SolidityParam}\\\\n */\\\\nvar formatInputString = function (value) {\\\\n    if(!_.isString(value)) {\\\\n        throw new Error(\'Given parameter is not a valid string: \' + value);\\\\n    }\\\\n\\\\n    var result = utils.utf8ToHex(value).replace(/^0x/i,\'\');\\\\n    var length = result.length / 2;\\\\n    var l = Math.floor((result.length + 63) / 64);\\\\n    result = utils.padRight(result, l * 64);\\\\n    return new SolidityParam(formatInputInt(length).value + result);\\\\n};\\\\n\\\\n/**\\\\n * Formats input value to byte representation of bool\\\\n *\\\\n * @method formatInputBool\\\\n * @param {Boolean}\\\\n * @returns {SolidityParam}\\\\n */\\\\nvar formatInputBool = function (value) {\\\\n    var result = \'000000000000000000000000000000000000000000000000000000000000000\' + (value ?  \'1\' : \'0\');\\\\n    return new SolidityParam(result);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Check if input value is negative\\\\n *\\\\n * @method signedIsNegative\\\\n * @param {String} value is hex format\\\\n * @returns {Boolean} true if it is negative, otherwise false\\\\n */\\\\nvar signedIsNegative = function (value) {\\\\n    return (new BN(value.substr(0, 1), 16).toString(2).substr(0, 1)) === \'1\';\\\\n};\\\\n\\\\n/**\\\\n * Formats right-aligned output bytes to int\\\\n *\\\\n * @method formatOutputInt\\\\n * @param {SolidityParam} param\\\\n * @returns {BN} right-aligned output bytes formatted to big number\\\\n */\\\\nvar formatOutputInt = function (param) {\\\\n    var value = param.staticPart();\\\\n\\\\n    if(!value && !param.rawValue) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue);\\\\n    }\\\\n\\\\n    // check if it\'s negative number\\\\n    // it it is, return two\'s complement\\\\n    if (signedIsNegative(value)) {\\\\n        return new BN(value, 16).fromTwos(256).toString(10);\\\\n    }\\\\n    return new BN(value, 16).toString(10);\\\\n};\\\\n\\\\n/**\\\\n * Formats right-aligned output bytes to uint\\\\n *\\\\n * @method formatOutputUInt\\\\n * @param {SolidityParam} param\\\\n * @returns {BN} right-aligned output bytes formatted to uint\\\\n */\\\\nvar formatOutputUInt = function (param, name) {\\\\n    var value = param.staticPart();\\\\n\\\\n    if(!value && !param.rawValue) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue);\\\\n    }\\\\n\\\\n    return new BN(value, 16).toString(10);\\\\n};\\\\n\\\\n\\\\n\\\\n/**\\\\n * Should be used to format output bool\\\\n *\\\\n * @method formatOutputBool\\\\n * @param {SolidityParam} param\\\\n * @param {String} name type name\\\\n * @returns {Boolean} right-aligned input bytes formatted to bool\\\\n */\\\\nvar formatOutputBool = function (param, name) {\\\\n    var value = param.staticPart();\\\\n\\\\n    if(!value && !param.rawValue) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue);\\\\n    }\\\\n\\\\n    return (value === \'0000000000000000000000000000000000000000000000000000000000000001\');\\\\n};\\\\n\\\\n/**\\\\n * Should be used to format output bytes\\\\n *\\\\n * @method formatOutputBytes\\\\n * @param {SolidityParam} param left-aligned hex representation of string\\\\n * @param {String} name type name\\\\n * @returns {String} hex string\\\\n */\\\\nvar formatOutputBytes = function (param, name) {\\\\n    var matches = name.match(/^bytes([0-9]*)/);\\\\n    var size = parseInt(matches[1]);\\\\n\\\\n    if(param.staticPart().slice(0, 2 * size).length !== size * 2) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue + \' The size doesn\\\\\\\\\'t match.\');\\\\n    }\\\\n\\\\n    return \'0x\' + param.staticPart().slice(0, 2 * size);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to format output bytes\\\\n *\\\\n * @method formatOutputDynamicBytes\\\\n * @param {SolidityParam} param left-aligned hex representation of string\\\\n * @param {String} name type name\\\\n * @returns {String} hex string\\\\n */\\\\nvar formatOutputDynamicBytes = function (param, name) {\\\\n    var hex = param.dynamicPart().slice(0, 64);\\\\n\\\\n    if (!hex) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue);\\\\n    }\\\\n\\\\n    var length = (new BN(hex, 16)).toNumber() * 2;\\\\n    return \'0x\' + param.dynamicPart().substr(64, length);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to format output string\\\\n *\\\\n * @method formatOutputString\\\\n * @param {SolidityParam} left-aligned hex representation of string\\\\n * @returns {String} ascii string\\\\n */\\\\nvar formatOutputString = function (param) {\\\\n    var hex = param.dynamicPart().slice(0, 64);\\\\n\\\\n    if(!hex) {\\\\n        throw new Error(\'ERROR: The returned value is not a convertible string:\'+ hex);\\\\n    }\\\\n\\\\n    var length = (new BN(hex, 16)).toNumber() * 2;\\\\n    return length ? utils.hexToUtf8(\'0x\'+ param.dynamicPart().substr(64, length).replace(/^0x/i, \'\')) : \'\';\\\\n};\\\\n\\\\n/**\\\\n * Should be used to format output address\\\\n *\\\\n * @method formatOutputAddress\\\\n * @param {SolidityParam} param right-aligned input bytes\\\\n * @param {String} name type name\\\\n * @returns {String} address\\\\n */\\\\nvar formatOutputAddress = function (param, name) {\\\\n    var value = param.staticPart();\\\\n\\\\n    if (!value) {\\\\n        throw new Error(\'Couldn\\\\\\\\\'t decode \'+ name +\' from ABI: 0x\'+ param.rawValue);\\\\n    }\\\\n\\\\n    return utils.toChecksumAddress(\\\\\\"0x\\\\\\" + value.slice(value.length - 40, value.length));\\\\n};\\\\n\\\\nmodule.exports = {\\\\n    formatInputInt: formatInputInt,\\\\n    formatInputBytes: formatInputBytes,\\\\n    formatInputDynamicBytes: formatInputDynamicBytes,\\\\n    formatInputString: formatInputString,\\\\n    formatInputBool: formatInputBool,\\\\n    formatOutputInt: formatOutputInt,\\\\n    formatOutputUInt: formatOutputUInt,\\\\n    formatOutputBool: formatOutputBool,\\\\n    formatOutputBytes: formatOutputBytes,\\\\n    formatOutputDynamicBytes: formatOutputDynamicBytes,\\\\n    formatOutputString: formatOutputString,\\\\n    formatOutputAddress: formatOutputAddress,\\\\n    toTwosComplement: utils.toTwosComplement\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/formatters.js\\\\n// module id = 15\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/formatters.js\\")},function(module,exports,__webpack_require__){eval(\\"var anObject = __webpack_require__(18);\\\\nvar IE8_DOM_DEFINE = __webpack_require__(107);\\\\nvar toPrimitive = __webpack_require__(78);\\\\nvar dP = Object.defineProperty;\\\\n\\\\nexports.f = __webpack_require__(19) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\\\\n  anObject(O);\\\\n  P = toPrimitive(P, true);\\\\n  anObject(Attributes);\\\\n  if (IE8_DOM_DEFINE) try {\\\\n    return dP(O, P, Attributes);\\\\n  } catch (e) { /* empty */ }\\\\n  if (\'get\' in Attributes || \'set\' in Attributes) throw TypeError(\'Accessors not supported!\');\\\\n  if (\'value\' in Attributes) O[P] = Attributes.value;\\\\n  return O;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-dp.js\\\\n// module id = 16\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-dp.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\nvar Transform = __webpack_require__(56).Transform\\\\nvar StringDecoder = __webpack_require__(91).StringDecoder\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction CipherBase (hashMode) {\\\\n  Transform.call(this)\\\\n  this.hashMode = typeof hashMode === \'string\'\\\\n  if (this.hashMode) {\\\\n    this[hashMode] = this._finalOrDigest\\\\n  } else {\\\\n    this.final = this._finalOrDigest\\\\n  }\\\\n  if (this._final) {\\\\n    this.__final = this._final\\\\n    this._final = null\\\\n  }\\\\n  this._decoder = null\\\\n  this._encoding = null\\\\n}\\\\ninherits(CipherBase, Transform)\\\\n\\\\nCipherBase.prototype.update = function (data, inputEnc, outputEnc) {\\\\n  if (typeof data === \'string\') {\\\\n    data = Buffer.from(data, inputEnc)\\\\n  }\\\\n\\\\n  var outData = this._update(data)\\\\n  if (this.hashMode) return this\\\\n\\\\n  if (outputEnc) {\\\\n    outData = this._toString(outData, outputEnc)\\\\n  }\\\\n\\\\n  return outData\\\\n}\\\\n\\\\nCipherBase.prototype.setAutoPadding = function () {}\\\\nCipherBase.prototype.getAuthTag = function () {\\\\n  throw new Error(\'trying to get auth tag in unsupported state\')\\\\n}\\\\n\\\\nCipherBase.prototype.setAuthTag = function () {\\\\n  throw new Error(\'trying to set auth tag in unsupported state\')\\\\n}\\\\n\\\\nCipherBase.prototype.setAAD = function () {\\\\n  throw new Error(\'trying to set aad in unsupported state\')\\\\n}\\\\n\\\\nCipherBase.prototype._transform = function (data, _, next) {\\\\n  var err\\\\n  try {\\\\n    if (this.hashMode) {\\\\n      this._update(data)\\\\n    } else {\\\\n      this.push(this._update(data))\\\\n    }\\\\n  } catch (e) {\\\\n    err = e\\\\n  } finally {\\\\n    next(err)\\\\n  }\\\\n}\\\\nCipherBase.prototype._flush = function (done) {\\\\n  var err\\\\n  try {\\\\n    this.push(this.__final())\\\\n  } catch (e) {\\\\n    err = e\\\\n  }\\\\n\\\\n  done(err)\\\\n}\\\\nCipherBase.prototype._finalOrDigest = function (outputEnc) {\\\\n  var outData = this.__final() || Buffer.alloc(0)\\\\n  if (outputEnc) {\\\\n    outData = this._toString(outData, outputEnc, true)\\\\n  }\\\\n  return outData\\\\n}\\\\n\\\\nCipherBase.prototype._toString = function (value, enc, fin) {\\\\n  if (!this._decoder) {\\\\n    this._decoder = new StringDecoder(enc)\\\\n    this._encoding = enc\\\\n  }\\\\n\\\\n  if (this._encoding !== enc) throw new Error(\'can\\\\\\\\\'t switch encodings\')\\\\n\\\\n  var out = this._decoder.write(value)\\\\n  if (fin) {\\\\n    out += this._decoder.end()\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\nmodule.exports = CipherBase\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/cipher-base/index.js\\\\n// module id = 17\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/cipher-base/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var isObject = __webpack_require__(23);\\\\nmodule.exports = function (it) {\\\\n  if (!isObject(it)) throw TypeError(it + \' is not an object!\');\\\\n  return it;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_an-object.js\\\\n// module id = 18\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_an-object.js\\")},function(module,exports,__webpack_require__){eval(\\"// Thank\'s IE8 for his funny defineProperty\\\\nmodule.exports = !__webpack_require__(35)(function () {\\\\n  return Object.defineProperty({}, \'a\', { get: function () { return 7; } }).a != 7;\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_descriptors.js\\\\n// module id = 19\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_descriptors.js\\")},function(module,exports,__webpack_require__){eval(\\"var global = __webpack_require__(8);\\\\nvar core = __webpack_require__(11);\\\\nvar ctx = __webpack_require__(34);\\\\nvar hide = __webpack_require__(22);\\\\nvar has = __webpack_require__(21);\\\\nvar PROTOTYPE = \'prototype\';\\\\n\\\\nvar $export = function (type, name, source) {\\\\n  var IS_FORCED = type & $export.F;\\\\n  var IS_GLOBAL = type & $export.G;\\\\n  var IS_STATIC = type & $export.S;\\\\n  var IS_PROTO = type & $export.P;\\\\n  var IS_BIND = type & $export.B;\\\\n  var IS_WRAP = type & $export.W;\\\\n  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\\\\n  var expProto = exports[PROTOTYPE];\\\\n  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\\\\n  var key, own, out;\\\\n  if (IS_GLOBAL) source = name;\\\\n  for (key in source) {\\\\n    // contains in native\\\\n    own = !IS_FORCED && target && target[key] !== undefined;\\\\n    if (own && has(exports, key)) continue;\\\\n    // export native or passed\\\\n    out = own ? target[key] : source[key];\\\\n    // prevent global pollution for namespaces\\\\n    exports[key] = IS_GLOBAL && typeof target[key] != \'function\' ? source[key]\\\\n    // bind timers to global for call from export context\\\\n    : IS_BIND && own ? ctx(out, global)\\\\n    // wrap global constructors for prevent change them in library\\\\n    : IS_WRAP && target[key] == out ? (function (C) {\\\\n      var F = function (a, b, c) {\\\\n        if (this instanceof C) {\\\\n          switch (arguments.length) {\\\\n            case 0: return new C();\\\\n            case 1: return new C(a);\\\\n            case 2: return new C(a, b);\\\\n          } return new C(a, b, c);\\\\n        } return C.apply(this, arguments);\\\\n      };\\\\n      F[PROTOTYPE] = C[PROTOTYPE];\\\\n      return F;\\\\n    // make static versions for prototype methods\\\\n    })(out) : IS_PROTO && typeof out == \'function\' ? ctx(Function.call, out) : out;\\\\n    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\\\\n    if (IS_PROTO) {\\\\n      (exports.virtual || (exports.virtual = {}))[key] = out;\\\\n      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\\\\n      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\\\\n    }\\\\n  }\\\\n};\\\\n// type bitmap\\\\n$export.F = 1;   // forced\\\\n$export.G = 2;   // global\\\\n$export.S = 4;   // static\\\\n$export.P = 8;   // proto\\\\n$export.B = 16;  // bind\\\\n$export.W = 32;  // wrap\\\\n$export.U = 64;  // safe\\\\n$export.R = 128; // real proto method for `library`\\\\nmodule.exports = $export;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_export.js\\\\n// module id = 20\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_export.js\\")},function(module,exports){eval(\\"var hasOwnProperty = {}.hasOwnProperty;\\\\nmodule.exports = function (it, key) {\\\\n  return hasOwnProperty.call(it, key);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_has.js\\\\n// module id = 21\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_has.js\\")},function(module,exports,__webpack_require__){eval(\\"var dP = __webpack_require__(16);\\\\nvar createDesc = __webpack_require__(37);\\\\nmodule.exports = __webpack_require__(19) ? function (object, key, value) {\\\\n  return dP.f(object, key, createDesc(1, value));\\\\n} : function (object, key, value) {\\\\n  object[key] = value;\\\\n  return object;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_hide.js\\\\n// module id = 22\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_hide.js\\")},function(module,exports){eval(\\"module.exports = function (it) {\\\\n  return typeof it === \'object\' ? it !== null : typeof it === \'function\';\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_is-object.js\\\\n// module id = 23\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_is-object.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n// a duplex stream is just a stream that is both readable and writable.\\\\n// Since JS doesn\'t have multiple prototypal inheritance, this class\\\\n// prototypally inherits from Readable, and then parasitically from\\\\n// Writable.\\\\n\\\\n\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar processNextTick = __webpack_require__(55).nextTick;\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar objectKeys = Object.keys || function (obj) {\\\\n  var keys = [];\\\\n  for (var key in obj) {\\\\n    keys.push(key);\\\\n  }return keys;\\\\n};\\\\n/*</replacement>*/\\\\n\\\\nmodule.exports = Duplex;\\\\n\\\\n/*<replacement>*/\\\\nvar util = __webpack_require__(38);\\\\nutil.inherits = __webpack_require__(0);\\\\n/*</replacement>*/\\\\n\\\\nvar Readable = __webpack_require__(149);\\\\nvar Writable = __webpack_require__(87);\\\\n\\\\nutil.inherits(Duplex, Readable);\\\\n\\\\nvar keys = objectKeys(Writable.prototype);\\\\nfor (var v = 0; v < keys.length; v++) {\\\\n  var method = keys[v];\\\\n  if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];\\\\n}\\\\n\\\\nfunction Duplex(options) {\\\\n  if (!(this instanceof Duplex)) return new Duplex(options);\\\\n\\\\n  Readable.call(this, options);\\\\n  Writable.call(this, options);\\\\n\\\\n  if (options && options.readable === false) this.readable = false;\\\\n\\\\n  if (options && options.writable === false) this.writable = false;\\\\n\\\\n  this.allowHalfOpen = true;\\\\n  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;\\\\n\\\\n  this.once(\'end\', onend);\\\\n}\\\\n\\\\n// the no-half-open enforcer\\\\nfunction onend() {\\\\n  // if we allow half-open state, or if the writable side ended,\\\\n  // then we\'re ok.\\\\n  if (this.allowHalfOpen || this._writableState.ended) return;\\\\n\\\\n  // no more data can be written.\\\\n  // But allow more writes to happen in this tick.\\\\n  processNextTick(onEndNT, this);\\\\n}\\\\n\\\\nfunction onEndNT(self) {\\\\n  self.end();\\\\n}\\\\n\\\\nObject.defineProperty(Duplex.prototype, \'destroyed\', {\\\\n  get: function () {\\\\n    if (this._readableState === undefined || this._writableState === undefined) {\\\\n      return false;\\\\n    }\\\\n    return this._readableState.destroyed && this._writableState.destroyed;\\\\n  },\\\\n  set: function (value) {\\\\n    // we ignore the value if the stream\\\\n    // has not been initialized yet\\\\n    if (this._readableState === undefined || this._writableState === undefined) {\\\\n      return;\\\\n    }\\\\n\\\\n    // backward compatibility, the user is explicitly\\\\n    // managing destroyed\\\\n    this._readableState.destroyed = value;\\\\n    this._writableState.destroyed = value;\\\\n  }\\\\n});\\\\n\\\\nDuplex.prototype._destroy = function (err, cb) {\\\\n  this.push(null);\\\\n  this.end();\\\\n\\\\n  processNextTick(cb, err);\\\\n};\\\\n\\\\nfunction forEach(xs, f) {\\\\n  for (var i = 0, l = xs.length; i < l; i++) {\\\\n    f(xs[i], i);\\\\n  }\\\\n}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/_stream_duplex.js\\\\n// module id = 24\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/_stream_duplex.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar formatters = __webpack_require__(7).formatters;\\\\nvar utils = __webpack_require__(10);\\\\nvar promiEvent = __webpack_require__(155);\\\\nvar Subscriptions = __webpack_require__(57).subscriptions;\\\\n\\\\nvar TIMEOUTBLOCK = 50;\\\\nvar CONFIRMATIONBLOCKS = 24;\\\\n\\\\nvar Method = function Method(options) {\\\\n\\\\n    if(!options.call || !options.name) {\\\\n        throw new Error(\'When creating a method you need to provide at least the \\\\\\"name\\\\\\" and \\\\\\"call\\\\\\" property.\');\\\\n    }\\\\n\\\\n    this.name = options.name;\\\\n    this.call = options.call;\\\\n    this.params = options.params || 0;\\\\n    this.inputFormatter = options.inputFormatter;\\\\n    this.outputFormatter = options.outputFormatter;\\\\n    this.transformPayload = options.transformPayload;\\\\n    this.extraFormatters = options.extraFormatters;\\\\n\\\\n    this.requestManager = options.requestManager;\\\\n\\\\n    // reference to eth.accounts\\\\n    this.accounts = options.accounts;\\\\n\\\\n    this.defaultBlock = options.defaultBlock || \'latest\';\\\\n    this.defaultAccount = options.defaultAccount || null;\\\\n};\\\\n\\\\nMethod.prototype.setRequestManager = function (requestManager, accounts) {\\\\n    this.requestManager = requestManager;\\\\n\\\\n    // reference to eth.accounts\\\\n    if (accounts) {\\\\n        this.accounts = accounts;\\\\n    }\\\\n\\\\n};\\\\n\\\\nMethod.prototype.createFunction = function (requestManager, accounts) {\\\\n    var func = this.buildCall();\\\\n    func.call = this.call;\\\\n\\\\n    this.setRequestManager(requestManager || this.requestManager, accounts || this.accounts);\\\\n\\\\n    return func;\\\\n};\\\\n\\\\nMethod.prototype.attachToObject = function (obj) {\\\\n    var func = this.buildCall();\\\\n    func.call = this.call;\\\\n    var name = this.name.split(\'.\');\\\\n    if (name.length > 1) {\\\\n        obj[name[0]] = obj[name[0]] || {};\\\\n        obj[name[0]][name[1]] = func;\\\\n    } else {\\\\n        obj[name[0]] = func;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be used to determine name of the jsonrpc method based on arguments\\\\n *\\\\n * @method getCall\\\\n * @param {Array} arguments\\\\n * @return {String} name of jsonrpc method\\\\n */\\\\nMethod.prototype.getCall = function (args) {\\\\n    return _.isFunction(this.call) ? this.call(args) : this.call;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to extract callback from array of arguments. Modifies input param\\\\n *\\\\n * @method extractCallback\\\\n * @param {Array} arguments\\\\n * @return {Function|Null} callback, if exists\\\\n */\\\\nMethod.prototype.extractCallback = function (args) {\\\\n    if (_.isFunction(args[args.length - 1])) {\\\\n        return args.pop(); // modify the args array!\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if the number of arguments is correct\\\\n *\\\\n * @method validateArgs\\\\n * @param {Array} arguments\\\\n * @throws {Error} if it is not\\\\n */\\\\nMethod.prototype.validateArgs = function (args) {\\\\n    if (args.length !== this.params) {\\\\n        throw errors.InvalidNumberOfParams(args.length, this.params, this.name);\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to format input args of method\\\\n *\\\\n * @method formatInput\\\\n * @param {Array}\\\\n * @return {Array}\\\\n */\\\\nMethod.prototype.formatInput = function (args) {\\\\n    var _this = this;\\\\n\\\\n    if (!this.inputFormatter) {\\\\n        return args;\\\\n    }\\\\n\\\\n    return this.inputFormatter.map(function (formatter, index) {\\\\n        // bind this for defaultBlock, and defaultAccount\\\\n        return formatter ? formatter.call(_this, args[index]) : args[index];\\\\n    });\\\\n};\\\\n\\\\n/**\\\\n * Should be called to format output(result) of method\\\\n *\\\\n * @method formatOutput\\\\n * @param {Object}\\\\n * @return {Object}\\\\n */\\\\nMethod.prototype.formatOutput = function (result) {\\\\n    var _this = this;\\\\n\\\\n    if(_.isArray(result)) {\\\\n        return result.map(function(res){\\\\n            return _this.outputFormatter && res ? _this.outputFormatter(res) : res;\\\\n        });\\\\n    } else {\\\\n        return this.outputFormatter && result ? this.outputFormatter(result) : result;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should create payload from given input args\\\\n *\\\\n * @method toPayload\\\\n * @param {Array} args\\\\n * @return {Object}\\\\n */\\\\nMethod.prototype.toPayload = function (args) {\\\\n    var call = this.getCall(args);\\\\n    var callback = this.extractCallback(args);\\\\n    var params = this.formatInput(args);\\\\n    this.validateArgs(params);\\\\n\\\\n    var payload = {\\\\n        method: call,\\\\n        params: params,\\\\n        callback: callback\\\\n    };\\\\n\\\\n    if (this.transformPayload) {\\\\n        payload = this.transformPayload(payload);\\\\n    }\\\\n\\\\n    return payload;\\\\n};\\\\n\\\\n\\\\nMethod.prototype._confirmTransaction = function (defer, result, payload) {\\\\n    var method = this,\\\\n        promiseResolved = false,\\\\n        canUnsubscribe = true,\\\\n        timeoutCount = 0,\\\\n        confirmationCount = 0,\\\\n        intervalId = null,\\\\n        gasProvided = (_.isObject(payload.params[0]) && payload.params[0].gas) ? payload.params[0].gas : null,\\\\n        isContractDeployment = _.isObject(payload.params[0]) &&\\\\n            payload.params[0].data &&\\\\n            payload.params[0].from &&\\\\n            !payload.params[0].to;\\\\n\\\\n\\\\n    // add custom send Methods\\\\n    var _ethereumCalls = [\\\\n        new Method({\\\\n            name: \'getTransactionReceipt\',\\\\n            call: \'eth_getTransactionReceipt\',\\\\n            params: 1,\\\\n            inputFormatter: [null],\\\\n            outputFormatter: formatters.outputTransactionReceiptFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getCode\',\\\\n            call: \'eth_getCode\',\\\\n            params: 2,\\\\n            inputFormatter: [formatters.inputAddressFormatter, formatters.inputDefaultBlockNumberFormatter]\\\\n        }),\\\\n        new Subscriptions({\\\\n            name: \'subscribe\',\\\\n            type: \'eth\',\\\\n            subscriptions: {\\\\n                \'newBlockHeaders\': {\\\\n                    subscriptionName: \'newHeads\', // replace subscription with this name\\\\n                    params: 0,\\\\n                    outputFormatter: formatters.outputBlockFormatter\\\\n                }\\\\n            }\\\\n        })\\\\n    ];\\\\n    // attach methods to this._ethereumCall\\\\n    var _ethereumCall = {};\\\\n    _.each(_ethereumCalls, function (mthd) {\\\\n        mthd.attachToObject(_ethereumCall);\\\\n        mthd.requestManager = method.requestManager; // assign rather than call setRequestManager()\\\\n    });\\\\n\\\\n\\\\n    // fire \\\\\\"receipt\\\\\\" and confirmation events and resolve after\\\\n    var checkConfirmation = function (err, blockHeader, sub, existingReceipt) {\\\\n        if (!err) {\\\\n            // create fake unsubscribe\\\\n            if (!sub) {\\\\n                sub = {\\\\n                    unsubscribe: function () {\\\\n                        clearInterval(intervalId);\\\\n                    }\\\\n                };\\\\n            }\\\\n            // if we have a valid receipt we don\'t need to send a request\\\\n            return (existingReceipt ? promiEvent.resolve(existingReceipt) : _ethereumCall.getTransactionReceipt(result))\\\\n            // catch error from requesting receipt\\\\n            .catch(function (err) {\\\\n                sub.unsubscribe();\\\\n                promiseResolved = true;\\\\n                utils._fireError({message: \'Failed to check for transaction receipt:\', data: err}, defer.eventEmitter, defer.reject);\\\\n            })\\\\n            // if CONFIRMATION listener exists check for confirmations, by setting canUnsubscribe = false\\\\n            .then(function(receipt) {\\\\n\\\\n                if (!receipt || !receipt.blockHash) {\\\\n                    throw new Error(\'Receipt missing or blockHash null\');\\\\n                }\\\\n\\\\n                // apply extra formatters\\\\n                if (method.extraFormatters && method.extraFormatters.receiptFormatter) {\\\\n                    receipt = method.extraFormatters.receiptFormatter(receipt);\\\\n                }\\\\n\\\\n                // check if confirmation listener exists\\\\n                if (defer.eventEmitter.listeners(\'confirmation\').length > 0) {\\\\n\\\\n                    defer.eventEmitter.emit(\'confirmation\', confirmationCount, receipt);\\\\n\\\\n                    canUnsubscribe = false;\\\\n                    confirmationCount++;\\\\n\\\\n                    if (confirmationCount === CONFIRMATIONBLOCKS + 1) { // add 1 so we account for conf 0\\\\n                        sub.unsubscribe();\\\\n                        defer.eventEmitter.removeAllListeners();\\\\n                    }\\\\n                }\\\\n\\\\n                return receipt;\\\\n            })\\\\n            // CHECK for CONTRACT DEPLOYMENT\\\\n            .then(function(receipt) {\\\\n\\\\n                if (isContractDeployment && !promiseResolved) {\\\\n\\\\n                    if (!receipt.contractAddress) {\\\\n\\\\n                        if (canUnsubscribe) {\\\\n                            sub.unsubscribe();\\\\n                            promiseResolved = true;\\\\n                        }\\\\n\\\\n                        return utils._fireError(new Error(\'The transaction receipt didn\\\\\\\\\'t contain a contract address.\'), defer.eventEmitter, defer.reject);\\\\n                    }\\\\n\\\\n                    _ethereumCall.getCode(receipt.contractAddress, function (e, code) {\\\\n\\\\n                        if (!code) {\\\\n                            return;\\\\n                        }\\\\n\\\\n\\\\n                        if (code.length > 2) {\\\\n                            defer.eventEmitter.emit(\'receipt\', receipt);\\\\n\\\\n                            // if contract, return instance instead of receipt\\\\n                            if (method.extraFormatters && method.extraFormatters.contractDeployFormatter) {\\\\n                                defer.resolve(method.extraFormatters.contractDeployFormatter(receipt));\\\\n                            } else {\\\\n                                defer.resolve(receipt);\\\\n                            }\\\\n\\\\n                            // need to remove listeners, as they aren\'t removed automatically when succesfull\\\\n                            if (canUnsubscribe) {\\\\n                                defer.eventEmitter.removeAllListeners();\\\\n                            }\\\\n\\\\n                        } else {\\\\n                            utils._fireError(new Error(\'The contract code couldn\\\\\\\\\'t be stored, please check your gas limit.\'), defer.eventEmitter, defer.reject);\\\\n                        }\\\\n\\\\n                        if (canUnsubscribe) {\\\\n                            sub.unsubscribe();\\\\n                        }\\\\n                        promiseResolved = true;\\\\n                    });\\\\n                }\\\\n\\\\n                return receipt;\\\\n            })\\\\n            // CHECK for normal tx check for receipt only\\\\n            .then(function(receipt) {\\\\n\\\\n                if (!isContractDeployment && !promiseResolved) {\\\\n\\\\n                    if(!receipt.outOfGas &&\\\\n                       (!gasProvided || gasProvided !== receipt.gasUsed)) {\\\\n                        defer.eventEmitter.emit(\'receipt\', receipt);\\\\n                        defer.resolve(receipt);\\\\n\\\\n                        // need to remove listeners, as they aren\'t removed automatically when succesfull\\\\n                        if (canUnsubscribe) {\\\\n                            defer.eventEmitter.removeAllListeners();\\\\n                        }\\\\n\\\\n                    } else {\\\\n                        if(receipt) {\\\\n                            receipt = JSON.stringify(receipt, null, 2);\\\\n                        }\\\\n                        utils._fireError(new Error(\\\\\\"Transaction ran out of gas. Please provide more gas:\\\\\\\\n\\\\\\"+ receipt), defer.eventEmitter, defer.reject);\\\\n                    }\\\\n\\\\n                    if (canUnsubscribe) {\\\\n                        sub.unsubscribe();\\\\n                    }\\\\n                    promiseResolved = true;\\\\n                }\\\\n\\\\n            })\\\\n            // time out the transaction if not mined after 50 blocks\\\\n            .catch(function () {\\\\n                timeoutCount++;\\\\n\\\\n                if (timeoutCount - 1 >= TIMEOUTBLOCK) {\\\\n                    sub.unsubscribe();\\\\n                    promiseResolved = true;\\\\n                    return utils._fireError(new Error(\'Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!\'), defer.eventEmitter, defer.reject);\\\\n                }\\\\n            });\\\\n\\\\n\\\\n        } else {\\\\n            sub.unsubscribe();\\\\n            promiseResolved = true;\\\\n            return utils._fireError({message: \'Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.\', data: err}, defer.eventEmitter, defer.reject);\\\\n        }\\\\n    };\\\\n\\\\n  // start watching for confirmation depending on the support features of the provider\\\\n  var startWatching = function() {\\\\n      // if provider allows PUB/SUB\\\\n      if (_.isFunction(this.requestManager.provider.on)) {\\\\n          _ethereumCall.subscribe(\'newBlockHeaders\', checkConfirmation);\\\\n      } else {\\\\n          intervalId = setInterval(checkConfirmation, 1000);\\\\n      }\\\\n  }.bind(this);\\\\n\\\\n\\\\n  // first check if we already have a confirmed transaction\\\\n  _ethereumCall.getTransactionReceipt(result)\\\\n  .then(function(receipt) {\\\\n      if (receipt && receipt.blockHash) {\\\\n          if (defer.eventEmitter.listeners(\'confirmation\').length > 0) {\\\\n              // if the promise has not been resolved we must keep on watching for new Blocks, if a confrimation listener is present\\\\n              setTimeout(function(){\\\\n                  if (!promiseResolved) startWatching();\\\\n              }, 1000);\\\\n          }\\\\n\\\\n          return checkConfirmation(null, null, null, receipt);\\\\n      } else if (!promiseResolved) {\\\\n          startWatching();\\\\n      }\\\\n  })\\\\n  .catch(function(){\\\\n      if (!promiseResolved) startWatching();\\\\n  });\\\\n\\\\n};\\\\n\\\\n\\\\nvar getWallet = function(from, accounts) {\\\\n    var wallet = null;\\\\n\\\\n    // is index given\\\\n    if (_.isNumber(from)) {\\\\n        wallet = accounts.wallet[from];\\\\n\\\\n        // is account given\\\\n    } else if (_.isObject(from) && from.address && from.privateKey) {\\\\n        wallet = from;\\\\n\\\\n        // search in wallet for address\\\\n    } else {\\\\n        wallet = accounts.wallet[from.toLowerCase()];\\\\n    }\\\\n\\\\n    return wallet;\\\\n};\\\\n\\\\nMethod.prototype.buildCall = function() {\\\\n    var method = this,\\\\n        isSendTx = (method.call === \'eth_sendTransaction\' || method.call === \'eth_sendRawTransaction\'); // || method.call === \'personal_sendTransaction\'\\\\n\\\\n    // actual send function\\\\n    var send = function () {\\\\n        var defer = promiEvent(!isSendTx),\\\\n            payload = method.toPayload(Array.prototype.slice.call(arguments));\\\\n\\\\n\\\\n        // CALLBACK function\\\\n        var sendTxCallback = function (err, result) {\\\\n            try {\\\\n                result = method.formatOutput(result);\\\\n            } catch(e) {\\\\n                err = e;\\\\n            }\\\\n\\\\n            if (result instanceof Error) {\\\\n                err = result;\\\\n            }\\\\n\\\\n            if (!err) {\\\\n                if (payload.callback) {\\\\n                    payload.callback(null, result);\\\\n                }\\\\n            } else {\\\\n                if(err.error) {\\\\n                    err = err.error;\\\\n                }\\\\n\\\\n                return utils._fireError(err, defer.eventEmitter, defer.reject, payload.callback);\\\\n            }\\\\n\\\\n            // return PROMISE\\\\n            if (!isSendTx) {\\\\n\\\\n                if (!err) {\\\\n                    defer.resolve(result);\\\\n\\\\n                }\\\\n\\\\n            // return PROMIEVENT\\\\n            } else {\\\\n                defer.eventEmitter.emit(\'transactionHash\', result);\\\\n\\\\n                method._confirmTransaction(defer, result, payload);\\\\n            }\\\\n\\\\n        };\\\\n\\\\n        // SENDS the SIGNED SIGNATURE\\\\n        var sendSignedTx = function(sign){\\\\n\\\\n            var signedPayload = _.extend({}, payload, {\\\\n                method: \'eth_sendRawTransaction\',\\\\n                params: [sign.rawTransaction]\\\\n            });\\\\n\\\\n            method.requestManager.send(signedPayload, sendTxCallback);\\\\n        };\\\\n\\\\n\\\\n        var sendRequest = function(payload, method) {\\\\n\\\\n            if (method && method.accounts && method.accounts.wallet && method.accounts.wallet.length) {\\\\n                var wallet;\\\\n\\\\n                // ETH_SENDTRANSACTION\\\\n                if (payload.method === \'eth_sendTransaction\') {\\\\n                    var tx = payload.params[0];\\\\n                    wallet = getWallet((_.isObject(tx)) ? tx.from : null, method.accounts);\\\\n\\\\n\\\\n                    // If wallet was found, sign tx, and send using sendRawTransaction\\\\n                    if (wallet && wallet.privateKey) {\\\\n                        return method.accounts.signTransaction(_.omit(tx, \'from\'), wallet.privateKey).then(sendSignedTx);\\\\n                    }\\\\n\\\\n                // ETH_SIGN\\\\n                } else if (payload.method === \'eth_sign\') {\\\\n                    var data = payload.params[1];\\\\n                    wallet = getWallet(payload.params[0], method.accounts);\\\\n\\\\n                    // If wallet was found, sign tx, and send using sendRawTransaction\\\\n                    if (wallet && wallet.privateKey) {\\\\n                        var sign = method.accounts.sign(data, wallet.privateKey);\\\\n\\\\n                        if (payload.callback) {\\\\n                            payload.callback(null, sign.signature);\\\\n                        }\\\\n\\\\n                        defer.resolve(sign.signature);\\\\n                        return;\\\\n                    }\\\\n\\\\n\\\\n                }\\\\n            }\\\\n\\\\n            return method.requestManager.send(payload, sendTxCallback);\\\\n        };\\\\n\\\\n        // Send the actual transaction\\\\n        if(isSendTx && _.isObject(payload.params[0]) && !payload.params[0].gasPrice) {\\\\n\\\\n            var getGasPrice = (new Method({\\\\n                name: \'getGasPrice\',\\\\n                call: \'eth_gasPrice\',\\\\n                params: 0\\\\n            })).createFunction(method.requestManager);\\\\n\\\\n            getGasPrice(function (err, gasPrice) {\\\\n\\\\n                if (gasPrice) {\\\\n                    payload.params[0].gasPrice = gasPrice;\\\\n                }\\\\n                sendRequest(payload, method);\\\\n            });\\\\n\\\\n        } else {\\\\n            sendRequest(payload, method);\\\\n        }\\\\n\\\\n\\\\n        return defer.eventEmitter;\\\\n    };\\\\n\\\\n    // necessary to attach things to the method\\\\n    send.method = method;\\\\n    // necessary for batch requests\\\\n    send.request = this.request.bind(this);\\\\n    return send;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to create the pure JSONRPC request which can be used in a batch request\\\\n *\\\\n * @method request\\\\n * @return {Object} jsonrpc request\\\\n */\\\\nMethod.prototype.request = function () {\\\\n    var payload = this.toPayload(Array.prototype.slice.call(arguments));\\\\n    payload.format = this.formatOutput.bind(this);\\\\n    return payload;\\\\n};\\\\n\\\\nmodule.exports = Method;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-method/src/index.js\\\\n// module id = 25\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-method/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\nvar requestManager = __webpack_require__(340);\\\\nvar extend = __webpack_require__(342);\\\\n\\\\nmodule.exports = {\\\\n    packageInit: function (pkg, args) {\\\\n        args = Array.prototype.slice.call(args);\\\\n\\\\n        if (!pkg) {\\\\n            throw new Error(\'You need to instantiate using the \\\\\\"new\\\\\\" keyword.\');\\\\n        }\\\\n\\\\n\\\\n        // make property of pkg._provider, which can properly set providers\\\\n        Object.defineProperty(pkg, \'currentProvider\', {\\\\n            get: function () {\\\\n                return pkg._provider;\\\\n            },\\\\n            set: function (value) {\\\\n                return pkg.setProvider(value);\\\\n            },\\\\n            enumerable: true,\\\\n            configurable: true\\\\n        });\\\\n\\\\n        // inherit from web3 umbrella package\\\\n        if (args[0] && args[0]._requestManager) {\\\\n            pkg._requestManager = new requestManager.Manager(args[0].currentProvider);\\\\n\\\\n        // set requestmanager on package\\\\n        } else {\\\\n            pkg._requestManager = new requestManager.Manager();\\\\n            pkg._requestManager.setProvider(args[0], args[1]);\\\\n        }\\\\n\\\\n        // add givenProvider\\\\n        pkg.givenProvider = requestManager.Manager.givenProvider;\\\\n        pkg.providers = requestManager.Manager.providers;\\\\n\\\\n         pkg._provider =  pkg._requestManager.provider;\\\\n\\\\n        // add SETPROVIDER function (don\'t overwrite if already existing)\\\\n        if (!pkg.setProvider) {\\\\n            pkg.setProvider = function (provider, net) {\\\\n                pkg._requestManager.setProvider(provider, net);\\\\n                pkg._provider = pkg._requestManager.provider;\\\\n                return true;\\\\n            };\\\\n        }\\\\n\\\\n        // attach batch request creation\\\\n        pkg.BatchRequest = requestManager.BatchManager.bind(null, pkg._requestManager);\\\\n\\\\n        // attach extend function\\\\n        pkg.extend = extend(pkg);\\\\n    },\\\\n    addProviders: function (pkg) {\\\\n        pkg.givenProvider = requestManager.Manager.givenProvider;\\\\n        pkg.providers = requestManager.Manager.providers;\\\\n    }\\\\n};\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core/src/index.js\\\\n// module id = 26\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core/src/index.js\\")},function(module,exports,__webpack_require__){eval(\'var f = __webpack_require__(15);\\\\nvar SolidityParam = __webpack_require__(158);\\\\n\\\\n/**\\\\n * SolidityType prototype is used to encode/decode solidity params of certain type\\\\n */\\\\nvar SolidityType = function (config) {\\\\n    this._inputFormatter = config.inputFormatter;\\\\n    this._outputFormatter = config.outputFormatter;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to determine if this SolidityType do match given name\\\\n *\\\\n * @method isType\\\\n * @param {String} name\\\\n * @return {Bool} true if type match this SolidityType, otherwise false\\\\n */\\\\nSolidityType.prototype.isType = function (name) {\\\\n    throw \\"This method should be overwritten for type \\" + name;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to determine what is the length of static part in given type\\\\n *\\\\n * @method staticPartLength\\\\n * @param {String} name\\\\n * @return {Number} length of static part in bytes\\\\n */\\\\nSolidityType.prototype.staticPartLength = function (name) {\\\\n    // If name isn\\\\\'t an array then treat it like a single element array.\\\\n    return (this.nestedTypes(name) || [\\\\\'[1]\\\\\'])\\\\n        .map(function (type) {\\\\n            // the length of the nested array\\\\n            return parseInt(type.slice(1, -1), 10) || 1;\\\\n        })\\\\n        .reduce(function (previous, current) {\\\\n            return previous * current;\\\\n        // all basic types are 32 bytes long\\\\n        }, 32);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to determine if type is dynamic array\\\\n * eg:\\\\n * \\"type[]\\" => true\\\\n * \\"type[4]\\" => false\\\\n *\\\\n * @method isDynamicArray\\\\n * @param {String} name\\\\n * @return {Bool} true if the type is dynamic array\\\\n */\\\\nSolidityType.prototype.isDynamicArray = function (name) {\\\\n    var nestedTypes = this.nestedTypes(name);\\\\n    return !!nestedTypes && !nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to determine if type is static array\\\\n * eg:\\\\n * \\"type[]\\" => false\\\\n * \\"type[4]\\" => true\\\\n *\\\\n * @method isStaticArray\\\\n * @param {String} name\\\\n * @return {Bool} true if the type is static array\\\\n */\\\\nSolidityType.prototype.isStaticArray = function (name) {\\\\n    var nestedTypes = this.nestedTypes(name);\\\\n    return !!nestedTypes && !!nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g);\\\\n};\\\\n\\\\n/**\\\\n * Should return length of static array\\\\n * eg.\\\\n * \\"int[32]\\" => 32\\\\n * \\"int256[14]\\" => 14\\\\n * \\"int[2][3]\\" => 3\\\\n * \\"int\\" => 1\\\\n * \\"int[1]\\" => 1\\\\n * \\"int[]\\" => 1\\\\n *\\\\n * @method staticArrayLength\\\\n * @param {String} name\\\\n * @return {Number} static array length\\\\n */\\\\nSolidityType.prototype.staticArrayLength = function (name) {\\\\n    var nestedTypes = this.nestedTypes(name);\\\\n    if (nestedTypes) {\\\\n       return parseInt(nestedTypes[nestedTypes.length - 1].match(/[0-9]{1,}/g) || 1);\\\\n    }\\\\n    return 1;\\\\n};\\\\n\\\\n/**\\\\n * Should return nested type\\\\n * eg.\\\\n * \\"int[32]\\" => \\"int\\"\\\\n * \\"int256[14]\\" => \\"int256\\"\\\\n * \\"int[2][3]\\" => \\"int[2]\\"\\\\n * \\"int\\" => \\"int\\"\\\\n * \\"int[]\\" => \\"int\\"\\\\n *\\\\n * @method nestedName\\\\n * @param {String} name\\\\n * @return {String} nested name\\\\n */\\\\nSolidityType.prototype.nestedName = function (name) {\\\\n    // remove last [] in name\\\\n    var nestedTypes = this.nestedTypes(name);\\\\n    if (!nestedTypes) {\\\\n        return name;\\\\n    }\\\\n\\\\n    return name.substr(0, name.length - nestedTypes[nestedTypes.length - 1].length);\\\\n};\\\\n\\\\n/**\\\\n * Should return true if type has dynamic size by default\\\\n * such types are \\"string\\", \\"bytes\\"\\\\n *\\\\n * @method isDynamicType\\\\n * @param {String} name\\\\n * @return {Bool} true if is dynamic, otherwise false\\\\n */\\\\nSolidityType.prototype.isDynamicType = function () {\\\\n    return false;\\\\n};\\\\n\\\\n/**\\\\n * Should return array of nested types\\\\n * eg.\\\\n * \\"int[2][3][]\\" => [\\"[2]\\", \\"[3]\\", \\"[]\\"]\\\\n * \\"int[] => [\\"[]\\"]\\\\n * \\"int\\" => null\\\\n *\\\\n * @method nestedTypes\\\\n * @param {String} name\\\\n * @return {Array} array of nested types\\\\n */\\\\nSolidityType.prototype.nestedTypes = function (name) {\\\\n    // return list of strings eg. \\"[]\\", \\"[3]\\", \\"[]\\", \\"[2]\\"\\\\n    return name.match(/(\\\\\\\\[[0-9]*\\\\\\\\])/g);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to encode the value\\\\n *\\\\n * @method encode\\\\n * @param {Object} value\\\\n * @param {String} name\\\\n * @return {String} encoded value\\\\n */\\\\nSolidityType.prototype.encode = function (value, name) {\\\\n    var self = this;\\\\n    if (this.isDynamicArray(name)) {\\\\n\\\\n        return (function () {\\\\n            var length = value.length;                          // in int\\\\n            var nestedName = self.nestedName(name);\\\\n\\\\n            var result = [];\\\\n            result.push(f.formatInputInt(length).encode());\\\\n\\\\n            value.forEach(function (v) {\\\\n                result.push(self.encode(v, nestedName));\\\\n            });\\\\n\\\\n            return result;\\\\n        })();\\\\n\\\\n    } else if (this.isStaticArray(name)) {\\\\n\\\\n        return (function () {\\\\n            var length = self.staticArrayLength(name);          // in int\\\\n            var nestedName = self.nestedName(name);\\\\n\\\\n            var result = [];\\\\n            for (var i = 0; i < length; i++) {\\\\n                result.push(self.encode(value[i], nestedName));\\\\n            }\\\\n\\\\n            return result;\\\\n        })();\\\\n\\\\n    }\\\\n\\\\n    return this._inputFormatter(value, name).encode();\\\\n};\\\\n\\\\n/**\\\\n * Should be used to decode value from bytes\\\\n *\\\\n * @method decode\\\\n * @param {String} bytes\\\\n * @param {Number} offset in bytes\\\\n * @param {String} name type name\\\\n * @returns {Object} decoded value\\\\n */\\\\nSolidityType.prototype.decode = function (bytes, offset, name) {\\\\n    var self = this;\\\\n\\\\n    if (this.isDynamicArray(name)) {\\\\n\\\\n        return (function () {\\\\n            var arrayOffset = parseInt(\\\\\'0x\\\\\' + bytes.substr(offset * 2, 64)); // in bytes\\\\n            var length = parseInt(\\\\\'0x\\\\\' + bytes.substr(arrayOffset * 2, 64)); // in int\\\\n            var arrayStart = arrayOffset + 32; // array starts after length; // in bytes\\\\n\\\\n            var nestedName = self.nestedName(name);\\\\n            var nestedStaticPartLength = self.staticPartLength(nestedName);  // in bytes\\\\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\\\\n            var result = [];\\\\n\\\\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\\\\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\\\\n            }\\\\n\\\\n            return result;\\\\n        })();\\\\n\\\\n    } else if (this.isStaticArray(name)) {\\\\n\\\\n        return (function () {\\\\n            var length = self.staticArrayLength(name);                      // in int\\\\n            var arrayStart = offset;                                        // in bytes\\\\n\\\\n            var nestedName = self.nestedName(name);\\\\n            var nestedStaticPartLength = self.staticPartLength(nestedName); // in bytes\\\\n            var roundedNestedStaticPartLength = Math.floor((nestedStaticPartLength + 31) / 32) * 32;\\\\n            var result = [];\\\\n\\\\n            for (var i = 0; i < length * roundedNestedStaticPartLength; i += roundedNestedStaticPartLength) {\\\\n                result.push(self.decode(bytes, arrayStart + i, nestedName));\\\\n            }\\\\n\\\\n            return result;\\\\n        })();\\\\n    } else if (this.isDynamicType(name)) {\\\\n\\\\n        return (function () {\\\\n            var dynamicOffset = parseInt(\\\\\'0x\\\\\' + bytes.substr(offset * 2, 64));      // in bytes\\\\n            var length = parseInt(\\\\\'0x\\\\\' + bytes.substr(dynamicOffset * 2, 64));      // in bytes\\\\n            var roundedLength = Math.floor((length + 31) / 32);                     // in int\\\\n            var param = new SolidityParam(bytes.substr(dynamicOffset * 2, ( 1 + roundedLength) * 64), 0, bytes);\\\\n            return self._outputFormatter(param, name);\\\\n        })();\\\\n    }\\\\n\\\\n    var length = this.staticPartLength(name);\\\\n    var param = new SolidityParam(bytes.substr(offset * 2, length * 2), undefined, bytes);\\\\n    return this._outputFormatter(param, name);\\\\n};\\\\n\\\\nmodule.exports = SolidityType;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/type.js\\\\n// module id = 27\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/type.js\')},function(module,exports,__webpack_require__){eval(\\"// to indexed object, toObject with fallback for non-array-like ES3 strings\\\\nvar IObject = __webpack_require__(108);\\\\nvar defined = __webpack_require__(68);\\\\nmodule.exports = function (it) {\\\\n  return IObject(defined(it));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-iobject.js\\\\n// module id = 28\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-iobject.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(global, process) {\\\\n\\\\nfunction oldBrowser () {\\\\n  throw new Error(\'Secure random number generation is not supported by this browser.\\\\\\\\nUse Chrome, Firefox or Internet Explorer 11\')\\\\n}\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar crypto = global.crypto || global.msCrypto\\\\n\\\\nif (crypto && crypto.getRandomValues) {\\\\n  module.exports = randomBytes\\\\n} else {\\\\n  module.exports = oldBrowser\\\\n}\\\\n\\\\nfunction randomBytes (size, cb) {\\\\n  // phantomjs needs to throw\\\\n  if (size > 65536) throw new Error(\'requested too many random bytes\')\\\\n  // in case browserify  isn\'t using the Uint8Array version\\\\n  var rawBytes = new global.Uint8Array(size)\\\\n\\\\n  // This will not work in older browsers.\\\\n  // See https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues\\\\n  if (size > 0) {  // getRandomValues fails on IE if size == 0\\\\n    crypto.getRandomValues(rawBytes)\\\\n  }\\\\n\\\\n  // XXX: phantomjs doesn\'t like a buffer being passed here\\\\n  var bytes = Buffer.from(rawBytes.buffer)\\\\n\\\\n  if (typeof cb === \'function\') {\\\\n    return process.nextTick(function () {\\\\n      cb(null, bytes)\\\\n    })\\\\n  }\\\\n\\\\n  return bytes\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/randombytes/browser.js\\\\n// module id = 29\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/randombytes/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\n\\\\n// prototype class for hash functions\\\\nfunction Hash (blockSize, finalSize) {\\\\n  this._block = Buffer.alloc(blockSize)\\\\n  this._finalSize = finalSize\\\\n  this._blockSize = blockSize\\\\n  this._len = 0\\\\n}\\\\n\\\\nHash.prototype.update = function (data, enc) {\\\\n  if (typeof data === \'string\') {\\\\n    enc = enc || \'utf8\'\\\\n    data = Buffer.from(data, enc)\\\\n  }\\\\n\\\\n  var block = this._block\\\\n  var blockSize = this._blockSize\\\\n  var length = data.length\\\\n  var accum = this._len\\\\n\\\\n  for (var offset = 0; offset < length;) {\\\\n    var assigned = accum % blockSize\\\\n    var remainder = Math.min(length - offset, blockSize - assigned)\\\\n\\\\n    for (var i = 0; i < remainder; i++) {\\\\n      block[assigned + i] = data[offset + i]\\\\n    }\\\\n\\\\n    accum += remainder\\\\n    offset += remainder\\\\n\\\\n    if ((accum % blockSize) === 0) {\\\\n      this._update(block)\\\\n    }\\\\n  }\\\\n\\\\n  this._len += length\\\\n  return this\\\\n}\\\\n\\\\nHash.prototype.digest = function (enc) {\\\\n  var rem = this._len % this._blockSize\\\\n\\\\n  this._block[rem] = 0x80\\\\n\\\\n  // zero (rem + 1) trailing bits, where (rem + 1) is the smallest\\\\n  // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize\\\\n  this._block.fill(0, rem + 1)\\\\n\\\\n  if (rem >= this._finalSize) {\\\\n    this._update(this._block)\\\\n    this._block.fill(0)\\\\n  }\\\\n\\\\n  var bits = this._len * 8\\\\n\\\\n  // uint32\\\\n  if (bits <= 0xffffffff) {\\\\n    this._block.writeUInt32BE(bits, this._blockSize - 4)\\\\n\\\\n  // uint64\\\\n  } else {\\\\n    var lowBits = (bits & 0xffffffff) >>> 0\\\\n    var highBits = (bits - lowBits) / 0x100000000\\\\n\\\\n    this._block.writeUInt32BE(highBits, this._blockSize - 8)\\\\n    this._block.writeUInt32BE(lowBits, this._blockSize - 4)\\\\n  }\\\\n\\\\n  this._update(this._block)\\\\n  var hash = this._hash()\\\\n\\\\n  return enc ? hash.toString(enc) : hash\\\\n}\\\\n\\\\nHash.prototype._update = function () {\\\\n  throw new Error(\'_update must be implemented by subclass\')\\\\n}\\\\n\\\\nmodule.exports = Hash\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/hash.js\\\\n// module id = 30\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/hash.js\\")},function(module,exports){eval(\'module.exports = function(module) {\\\\r\\\\n\\\\tif(!module.webpackPolyfill) {\\\\r\\\\n\\\\t\\\\tmodule.deprecate = function() {};\\\\r\\\\n\\\\t\\\\tmodule.paths = [];\\\\r\\\\n\\\\t\\\\t// module.parent = undefined by default\\\\r\\\\n\\\\t\\\\tif(!module.children) module.children = [];\\\\r\\\\n\\\\t\\\\tObject.defineProperty(module, \\"loaded\\", {\\\\r\\\\n\\\\t\\\\t\\\\tenumerable: true,\\\\r\\\\n\\\\t\\\\t\\\\tget: function() {\\\\r\\\\n\\\\t\\\\t\\\\t\\\\treturn module.l;\\\\r\\\\n\\\\t\\\\t\\\\t}\\\\r\\\\n\\\\t\\\\t});\\\\r\\\\n\\\\t\\\\tObject.defineProperty(module, \\"id\\", {\\\\r\\\\n\\\\t\\\\t\\\\tenumerable: true,\\\\r\\\\n\\\\t\\\\t\\\\tget: function() {\\\\r\\\\n\\\\t\\\\t\\\\t\\\\treturn module.i;\\\\r\\\\n\\\\t\\\\t\\\\t}\\\\r\\\\n\\\\t\\\\t});\\\\r\\\\n\\\\t\\\\tmodule.webpackPolyfill = 1;\\\\r\\\\n\\\\t}\\\\r\\\\n\\\\treturn module;\\\\r\\\\n};\\\\r\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// (webpack)/buildin/module.js\\\\n// module id = 31\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/webpack/buildin/module.js\')},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = function xor (a, b) {\\\\n  var length = Math.min(a.length, b.length)\\\\n  var buffer = new Buffer(length)\\\\n\\\\n  for (var i = 0; i < length; ++i) {\\\\n    buffer[i] = a[i] ^ b[i]\\\\n  }\\\\n\\\\n  return buffer\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/buffer-xor/index.js\\\\n// module id = 32\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/buffer-xor/index.js\\")},function(module,exports){eval(\\"var toString = {}.toString;\\\\n\\\\nmodule.exports = function (it) {\\\\n  return toString.call(it).slice(8, -1);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_cof.js\\\\n// module id = 33\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_cof.js\\")},function(module,exports,__webpack_require__){eval(\\"// optional / simple context binding\\\\nvar aFunction = __webpack_require__(45);\\\\nmodule.exports = function (fn, that, length) {\\\\n  aFunction(fn);\\\\n  if (that === undefined) return fn;\\\\n  switch (length) {\\\\n    case 1: return function (a) {\\\\n      return fn.call(that, a);\\\\n    };\\\\n    case 2: return function (a, b) {\\\\n      return fn.call(that, a, b);\\\\n    };\\\\n    case 3: return function (a, b, c) {\\\\n      return fn.call(that, a, b, c);\\\\n    };\\\\n  }\\\\n  return function (/* ...args */) {\\\\n    return fn.apply(that, arguments);\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_ctx.js\\\\n// module id = 34\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_ctx.js\\")},function(module,exports){eval(\\"module.exports = function (exec) {\\\\n  try {\\\\n    return !!exec();\\\\n  } catch (e) {\\\\n    return true;\\\\n  }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_fails.js\\\\n// module id = 35\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_fails.js\\")},function(module,exports){eval(\\"module.exports = {};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iterators.js\\\\n// module id = 36\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iterators.js\\")},function(module,exports){eval(\\"module.exports = function (bitmap, value) {\\\\n  return {\\\\n    enumerable: !(bitmap & 1),\\\\n    configurable: !(bitmap & 2),\\\\n    writable: !(bitmap & 4),\\\\n    value: value\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_property-desc.js\\\\n// module id = 37\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_property-desc.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n// NOTE: These type checking functions intentionally don\'t use `instanceof`\\\\n// because it is fragile and can be easily faked with `Object.create()`.\\\\n\\\\nfunction isArray(arg) {\\\\n  if (Array.isArray) {\\\\n    return Array.isArray(arg);\\\\n  }\\\\n  return objectToString(arg) === \'[object Array]\';\\\\n}\\\\nexports.isArray = isArray;\\\\n\\\\nfunction isBoolean(arg) {\\\\n  return typeof arg === \'boolean\';\\\\n}\\\\nexports.isBoolean = isBoolean;\\\\n\\\\nfunction isNull(arg) {\\\\n  return arg === null;\\\\n}\\\\nexports.isNull = isNull;\\\\n\\\\nfunction isNullOrUndefined(arg) {\\\\n  return arg == null;\\\\n}\\\\nexports.isNullOrUndefined = isNullOrUndefined;\\\\n\\\\nfunction isNumber(arg) {\\\\n  return typeof arg === \'number\';\\\\n}\\\\nexports.isNumber = isNumber;\\\\n\\\\nfunction isString(arg) {\\\\n  return typeof arg === \'string\';\\\\n}\\\\nexports.isString = isString;\\\\n\\\\nfunction isSymbol(arg) {\\\\n  return typeof arg === \'symbol\';\\\\n}\\\\nexports.isSymbol = isSymbol;\\\\n\\\\nfunction isUndefined(arg) {\\\\n  return arg === void 0;\\\\n}\\\\nexports.isUndefined = isUndefined;\\\\n\\\\nfunction isRegExp(re) {\\\\n  return objectToString(re) === \'[object RegExp]\';\\\\n}\\\\nexports.isRegExp = isRegExp;\\\\n\\\\nfunction isObject(arg) {\\\\n  return typeof arg === \'object\' && arg !== null;\\\\n}\\\\nexports.isObject = isObject;\\\\n\\\\nfunction isDate(d) {\\\\n  return objectToString(d) === \'[object Date]\';\\\\n}\\\\nexports.isDate = isDate;\\\\n\\\\nfunction isError(e) {\\\\n  return (objectToString(e) === \'[object Error]\' || e instanceof Error);\\\\n}\\\\nexports.isError = isError;\\\\n\\\\nfunction isFunction(arg) {\\\\n  return typeof arg === \'function\';\\\\n}\\\\nexports.isFunction = isFunction;\\\\n\\\\nfunction isPrimitive(arg) {\\\\n  return arg === null ||\\\\n         typeof arg === \'boolean\' ||\\\\n         typeof arg === \'number\' ||\\\\n         typeof arg === \'string\' ||\\\\n         typeof arg === \'symbol\' ||  // ES6 symbol\\\\n         typeof arg === \'undefined\';\\\\n}\\\\nexports.isPrimitive = isPrimitive;\\\\n\\\\nexports.isBuffer = Buffer.isBuffer;\\\\n\\\\nfunction objectToString(o) {\\\\n  return Object.prototype.toString.call(o);\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-util-is/lib/util.js\\\\n// module id = 38\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-util-is/lib/util.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {\\\\nvar inherits = __webpack_require__(0)\\\\nvar md5 = __webpack_require__(82)\\\\nvar RIPEMD160 = __webpack_require__(89)\\\\nvar sha = __webpack_require__(90)\\\\n\\\\nvar Base = __webpack_require__(17)\\\\n\\\\nfunction HashNoConstructor (hash) {\\\\n  Base.call(this, \'digest\')\\\\n\\\\n  this._hash = hash\\\\n  this.buffers = []\\\\n}\\\\n\\\\ninherits(HashNoConstructor, Base)\\\\n\\\\nHashNoConstructor.prototype._update = function (data) {\\\\n  this.buffers.push(data)\\\\n}\\\\n\\\\nHashNoConstructor.prototype._final = function () {\\\\n  var buf = Buffer.concat(this.buffers)\\\\n  var r = this._hash(buf)\\\\n  this.buffers = null\\\\n\\\\n  return r\\\\n}\\\\n\\\\nfunction Hash (hash) {\\\\n  Base.call(this, \'digest\')\\\\n\\\\n  this._hash = hash\\\\n}\\\\n\\\\ninherits(Hash, Base)\\\\n\\\\nHash.prototype._update = function (data) {\\\\n  this._hash.update(data)\\\\n}\\\\n\\\\nHash.prototype._final = function () {\\\\n  return this._hash.digest()\\\\n}\\\\n\\\\nmodule.exports = function createHash (alg) {\\\\n  alg = alg.toLowerCase()\\\\n  if (alg === \'md5\') return new HashNoConstructor(md5)\\\\n  if (alg === \'rmd160\' || alg === \'ripemd160\') return new Hash(new RIPEMD160())\\\\n\\\\n  return new Hash(sha(alg))\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-hash/browser.js\\\\n// module id = 39\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-hash/browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(29)\\\\nexports.createHash = exports.Hash = __webpack_require__(39)\\\\nexports.createHmac = exports.Hmac = __webpack_require__(124)\\\\n\\\\nvar algos = __webpack_require__(193)\\\\nvar algoKeys = Object.keys(algos)\\\\nvar hashes = [\'sha1\', \'sha224\', \'sha256\', \'sha384\', \'sha512\', \'md5\', \'rmd160\'].concat(algoKeys)\\\\nexports.getHashes = function () {\\\\n  return hashes\\\\n}\\\\n\\\\nvar p = __webpack_require__(86)\\\\nexports.pbkdf2 = p.pbkdf2\\\\nexports.pbkdf2Sync = p.pbkdf2Sync\\\\n\\\\nvar aes = __webpack_require__(190)\\\\n\\\\nexports.Cipher = aes.Cipher\\\\nexports.createCipher = aes.createCipher\\\\nexports.Cipheriv = aes.Cipheriv\\\\nexports.createCipheriv = aes.createCipheriv\\\\nexports.Decipher = aes.Decipher\\\\nexports.createDecipher = aes.createDecipher\\\\nexports.Decipheriv = aes.Decipheriv\\\\nexports.createDecipheriv = aes.createDecipheriv\\\\nexports.getCiphers = aes.getCiphers\\\\nexports.listCiphers = aes.listCiphers\\\\n\\\\nvar dh = __webpack_require__(247)\\\\n\\\\nexports.DiffieHellmanGroup = dh.DiffieHellmanGroup\\\\nexports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup\\\\nexports.getDiffieHellman = dh.getDiffieHellman\\\\nexports.createDiffieHellman = dh.createDiffieHellman\\\\nexports.DiffieHellman = dh.DiffieHellman\\\\n\\\\nvar sign = __webpack_require__(194)\\\\n\\\\nexports.createSign = sign.createSign\\\\nexports.Sign = sign.Sign\\\\nexports.createVerify = sign.createVerify\\\\nexports.Verify = sign.Verify\\\\n\\\\nexports.createECDH = __webpack_require__(235)\\\\n\\\\nvar publicEncrypt = __webpack_require__(300)\\\\n\\\\nexports.publicEncrypt = publicEncrypt.publicEncrypt\\\\nexports.privateEncrypt = publicEncrypt.privateEncrypt\\\\nexports.publicDecrypt = publicEncrypt.publicDecrypt\\\\nexports.privateDecrypt = publicEncrypt.privateDecrypt\\\\n\\\\n// the least I can do is make error messages for the rest of the node.js/crypto api.\\\\n// ;[\\\\n//   \'createCredentials\'\\\\n// ].forEach(function (name) {\\\\n//   exports[name] = function () {\\\\n//     throw new Error([\\\\n//       \'sorry, \' + name + \' is not implemented yet\',\\\\n//       \'we accept pull requests\',\\\\n//       \'https://github.com/crypto-browserify/crypto-browserify\'\\\\n//     ].join(\'\\\\\\\\n\'))\\\\n//   }\\\\n// })\\\\n\\\\nvar rf = __webpack_require__(304)\\\\n\\\\nexports.randomFill = rf.randomFill\\\\nexports.randomFillSync = rf.randomFillSync\\\\n\\\\nexports.createCredentials = function () {\\\\n  throw new Error([\\\\n    \'sorry, createCredentials is not implemented yet\',\\\\n    \'we accept pull requests\',\\\\n    \'https://github.com/crypto-browserify/crypto-browserify\'\\\\n  ].join(\'\\\\\\\\n\'))\\\\n}\\\\n\\\\nexports.constants = {\\\\n  \'DH_CHECK_P_NOT_SAFE_PRIME\': 2,\\\\n  \'DH_CHECK_P_NOT_PRIME\': 1,\\\\n  \'DH_UNABLE_TO_CHECK_GENERATOR\': 4,\\\\n  \'DH_NOT_SUITABLE_GENERATOR\': 8,\\\\n  \'NPN_ENABLED\': 1,\\\\n  \'ALPN_ENABLED\': 1,\\\\n  \'RSA_PKCS1_PADDING\': 1,\\\\n  \'RSA_SSLV23_PADDING\': 2,\\\\n  \'RSA_NO_PADDING\': 3,\\\\n  \'RSA_PKCS1_OAEP_PADDING\': 4,\\\\n  \'RSA_X931_PADDING\': 5,\\\\n  \'RSA_PKCS1_PSS_PADDING\': 6,\\\\n  \'POINT_CONVERSION_COMPRESSED\': 2,\\\\n  \'POINT_CONVERSION_UNCOMPRESSED\': 4,\\\\n  \'POINT_CONVERSION_HYBRID\': 6\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/crypto-browserify/index.js\\\\n// module id = 40\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/crypto-browserify/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nfunction BlockHash() {\\\\n  this.pending = null;\\\\n  this.pendingTotal = 0;\\\\n  this.blockSize = this.constructor.blockSize;\\\\n  this.outSize = this.constructor.outSize;\\\\n  this.hmacStrength = this.constructor.hmacStrength;\\\\n  this.padLength = this.constructor.padLength / 8;\\\\n  this.endian = \'big\';\\\\n\\\\n  this._delta8 = this.blockSize / 8;\\\\n  this._delta32 = this.blockSize / 32;\\\\n}\\\\nexports.BlockHash = BlockHash;\\\\n\\\\nBlockHash.prototype.update = function update(msg, enc) {\\\\n  // Convert message to array, pad it, and join into 32bit blocks\\\\n  msg = utils.toArray(msg, enc);\\\\n  if (!this.pending)\\\\n    this.pending = msg;\\\\n  else\\\\n    this.pending = this.pending.concat(msg);\\\\n  this.pendingTotal += msg.length;\\\\n\\\\n  // Enough data, try updating\\\\n  if (this.pending.length >= this._delta8) {\\\\n    msg = this.pending;\\\\n\\\\n    // Process pending data in blocks\\\\n    var r = msg.length % this._delta8;\\\\n    this.pending = msg.slice(msg.length - r, msg.length);\\\\n    if (this.pending.length === 0)\\\\n      this.pending = null;\\\\n\\\\n    msg = utils.join32(msg, 0, msg.length - r, this.endian);\\\\n    for (var i = 0; i < msg.length; i += this._delta32)\\\\n      this._update(msg, i, i + this._delta32);\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nBlockHash.prototype.digest = function digest(enc) {\\\\n  this.update(this._pad());\\\\n  assert(this.pending === null);\\\\n\\\\n  return this._digest(enc);\\\\n};\\\\n\\\\nBlockHash.prototype._pad = function pad() {\\\\n  var len = this.pendingTotal;\\\\n  var bytes = this._delta8;\\\\n  var k = bytes - ((len + this.padLength) % bytes);\\\\n  var res = new Array(k + this.padLength);\\\\n  res[0] = 0x80;\\\\n  for (var i = 1; i < k; i++)\\\\n    res[i] = 0;\\\\n\\\\n  // Append length\\\\n  len <<= 3;\\\\n  if (this.endian === \'big\') {\\\\n    for (var t = 8; t < this.padLength; t++)\\\\n      res[i++] = 0;\\\\n\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n    res[i++] = (len >>> 24) & 0xff;\\\\n    res[i++] = (len >>> 16) & 0xff;\\\\n    res[i++] = (len >>> 8) & 0xff;\\\\n    res[i++] = len & 0xff;\\\\n  } else {\\\\n    res[i++] = len & 0xff;\\\\n    res[i++] = (len >>> 8) & 0xff;\\\\n    res[i++] = (len >>> 16) & 0xff;\\\\n    res[i++] = (len >>> 24) & 0xff;\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n    res[i++] = 0;\\\\n\\\\n    for (t = 8; t < this.padLength; t++)\\\\n      res[i++] = 0;\\\\n  }\\\\n\\\\n  return res;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/common.js\\\\n// module id = 41\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/common.js\\")},function(module,exports,__webpack_require__){eval(\\"var asn1 = exports;\\\\n\\\\nasn1.bignum = __webpack_require__(3);\\\\n\\\\nasn1.define = __webpack_require__(289).define;\\\\nasn1.base = __webpack_require__(43);\\\\nasn1.constants = __webpack_require__(140);\\\\nasn1.decoders = __webpack_require__(293);\\\\nasn1.encoders = __webpack_require__(295);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1.js\\\\n// module id = 42\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1.js\\")},function(module,exports,__webpack_require__){eval(\\"var base = exports;\\\\n\\\\nbase.Reporter = __webpack_require__(291).Reporter;\\\\nbase.DecoderBuffer = __webpack_require__(139).DecoderBuffer;\\\\nbase.EncoderBuffer = __webpack_require__(139).EncoderBuffer;\\\\nbase.Node = __webpack_require__(290);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/index.js\\\\n// module id = 43\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/index.js\\")},function(module,exports,__webpack_require__){eval(\\"// based on the aes implimentation in triple sec\\\\n// https://github.com/keybase/triplesec\\\\n// which is in turn based on the one from crypto-js\\\\n// https://code.google.com/p/crypto-js/\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nfunction asUInt32Array (buf) {\\\\n  if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\\\\n\\\\n  var len = (buf.length / 4) | 0\\\\n  var out = new Array(len)\\\\n\\\\n  for (var i = 0; i < len; i++) {\\\\n    out[i] = buf.readUInt32BE(i * 4)\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\nfunction scrubVec (v) {\\\\n  for (var i = 0; i < v.length; v++) {\\\\n    v[i] = 0\\\\n  }\\\\n}\\\\n\\\\nfunction cryptBlock (M, keySchedule, SUB_MIX, SBOX, nRounds) {\\\\n  var SUB_MIX0 = SUB_MIX[0]\\\\n  var SUB_MIX1 = SUB_MIX[1]\\\\n  var SUB_MIX2 = SUB_MIX[2]\\\\n  var SUB_MIX3 = SUB_MIX[3]\\\\n\\\\n  var s0 = M[0] ^ keySchedule[0]\\\\n  var s1 = M[1] ^ keySchedule[1]\\\\n  var s2 = M[2] ^ keySchedule[2]\\\\n  var s3 = M[3] ^ keySchedule[3]\\\\n  var t0, t1, t2, t3\\\\n  var ksRow = 4\\\\n\\\\n  for (var round = 1; round < nRounds; round++) {\\\\n    t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[(s1 >>> 16) & 0xff] ^ SUB_MIX2[(s2 >>> 8) & 0xff] ^ SUB_MIX3[s3 & 0xff] ^ keySchedule[ksRow++]\\\\n    t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[(s2 >>> 16) & 0xff] ^ SUB_MIX2[(s3 >>> 8) & 0xff] ^ SUB_MIX3[s0 & 0xff] ^ keySchedule[ksRow++]\\\\n    t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[(s3 >>> 16) & 0xff] ^ SUB_MIX2[(s0 >>> 8) & 0xff] ^ SUB_MIX3[s1 & 0xff] ^ keySchedule[ksRow++]\\\\n    t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[(s0 >>> 16) & 0xff] ^ SUB_MIX2[(s1 >>> 8) & 0xff] ^ SUB_MIX3[s2 & 0xff] ^ keySchedule[ksRow++]\\\\n    s0 = t0\\\\n    s1 = t1\\\\n    s2 = t2\\\\n    s3 = t3\\\\n  }\\\\n\\\\n  t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]\\\\n  t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]\\\\n  t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]\\\\n  t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]\\\\n  t0 = t0 >>> 0\\\\n  t1 = t1 >>> 0\\\\n  t2 = t2 >>> 0\\\\n  t3 = t3 >>> 0\\\\n\\\\n  return [t0, t1, t2, t3]\\\\n}\\\\n\\\\n// AES constants\\\\nvar RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]\\\\nvar G = (function () {\\\\n  // Compute double table\\\\n  var d = new Array(256)\\\\n  for (var j = 0; j < 256; j++) {\\\\n    if (j < 128) {\\\\n      d[j] = j << 1\\\\n    } else {\\\\n      d[j] = (j << 1) ^ 0x11b\\\\n    }\\\\n  }\\\\n\\\\n  var SBOX = []\\\\n  var INV_SBOX = []\\\\n  var SUB_MIX = [[], [], [], []]\\\\n  var INV_SUB_MIX = [[], [], [], []]\\\\n\\\\n  // Walk GF(2^8)\\\\n  var x = 0\\\\n  var xi = 0\\\\n  for (var i = 0; i < 256; ++i) {\\\\n    // Compute sbox\\\\n    var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4)\\\\n    sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63\\\\n    SBOX[x] = sx\\\\n    INV_SBOX[sx] = x\\\\n\\\\n    // Compute multiplication\\\\n    var x2 = d[x]\\\\n    var x4 = d[x2]\\\\n    var x8 = d[x4]\\\\n\\\\n    // Compute sub bytes, mix columns tables\\\\n    var t = (d[sx] * 0x101) ^ (sx * 0x1010100)\\\\n    SUB_MIX[0][x] = (t << 24) | (t >>> 8)\\\\n    SUB_MIX[1][x] = (t << 16) | (t >>> 16)\\\\n    SUB_MIX[2][x] = (t << 8) | (t >>> 24)\\\\n    SUB_MIX[3][x] = t\\\\n\\\\n    // Compute inv sub bytes, inv mix columns tables\\\\n    t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100)\\\\n    INV_SUB_MIX[0][sx] = (t << 24) | (t >>> 8)\\\\n    INV_SUB_MIX[1][sx] = (t << 16) | (t >>> 16)\\\\n    INV_SUB_MIX[2][sx] = (t << 8) | (t >>> 24)\\\\n    INV_SUB_MIX[3][sx] = t\\\\n\\\\n    if (x === 0) {\\\\n      x = xi = 1\\\\n    } else {\\\\n      x = x2 ^ d[d[d[x8 ^ x2]]]\\\\n      xi ^= d[d[xi]]\\\\n    }\\\\n  }\\\\n\\\\n  return {\\\\n    SBOX: SBOX,\\\\n    INV_SBOX: INV_SBOX,\\\\n    SUB_MIX: SUB_MIX,\\\\n    INV_SUB_MIX: INV_SUB_MIX\\\\n  }\\\\n})()\\\\n\\\\nfunction AES (key) {\\\\n  this._key = asUInt32Array(key)\\\\n  this._reset()\\\\n}\\\\n\\\\nAES.blockSize = 4 * 4\\\\nAES.keySize = 256 / 8\\\\nAES.prototype.blockSize = AES.blockSize\\\\nAES.prototype.keySize = AES.keySize\\\\nAES.prototype._reset = function () {\\\\n  var keyWords = this._key\\\\n  var keySize = keyWords.length\\\\n  var nRounds = keySize + 6\\\\n  var ksRows = (nRounds + 1) * 4\\\\n\\\\n  var keySchedule = []\\\\n  for (var k = 0; k < keySize; k++) {\\\\n    keySchedule[k] = keyWords[k]\\\\n  }\\\\n\\\\n  for (k = keySize; k < ksRows; k++) {\\\\n    var t = keySchedule[k - 1]\\\\n\\\\n    if (k % keySize === 0) {\\\\n      t = (t << 8) | (t >>> 24)\\\\n      t =\\\\n        (G.SBOX[t >>> 24] << 24) |\\\\n        (G.SBOX[(t >>> 16) & 0xff] << 16) |\\\\n        (G.SBOX[(t >>> 8) & 0xff] << 8) |\\\\n        (G.SBOX[t & 0xff])\\\\n\\\\n      t ^= RCON[(k / keySize) | 0] << 24\\\\n    } else if (keySize > 6 && k % keySize === 4) {\\\\n      t =\\\\n        (G.SBOX[t >>> 24] << 24) |\\\\n        (G.SBOX[(t >>> 16) & 0xff] << 16) |\\\\n        (G.SBOX[(t >>> 8) & 0xff] << 8) |\\\\n        (G.SBOX[t & 0xff])\\\\n    }\\\\n\\\\n    keySchedule[k] = keySchedule[k - keySize] ^ t\\\\n  }\\\\n\\\\n  var invKeySchedule = []\\\\n  for (var ik = 0; ik < ksRows; ik++) {\\\\n    var ksR = ksRows - ik\\\\n    var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)]\\\\n\\\\n    if (ik < 4 || ksR <= 4) {\\\\n      invKeySchedule[ik] = tt\\\\n    } else {\\\\n      invKeySchedule[ik] =\\\\n        G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^\\\\n        G.INV_SUB_MIX[1][G.SBOX[(tt >>> 16) & 0xff]] ^\\\\n        G.INV_SUB_MIX[2][G.SBOX[(tt >>> 8) & 0xff]] ^\\\\n        G.INV_SUB_MIX[3][G.SBOX[tt & 0xff]]\\\\n    }\\\\n  }\\\\n\\\\n  this._nRounds = nRounds\\\\n  this._keySchedule = keySchedule\\\\n  this._invKeySchedule = invKeySchedule\\\\n}\\\\n\\\\nAES.prototype.encryptBlockRaw = function (M) {\\\\n  M = asUInt32Array(M)\\\\n  return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds)\\\\n}\\\\n\\\\nAES.prototype.encryptBlock = function (M) {\\\\n  var out = this.encryptBlockRaw(M)\\\\n  var buf = Buffer.allocUnsafe(16)\\\\n  buf.writeUInt32BE(out[0], 0)\\\\n  buf.writeUInt32BE(out[1], 4)\\\\n  buf.writeUInt32BE(out[2], 8)\\\\n  buf.writeUInt32BE(out[3], 12)\\\\n  return buf\\\\n}\\\\n\\\\nAES.prototype.decryptBlock = function (M) {\\\\n  M = asUInt32Array(M)\\\\n\\\\n  // swap\\\\n  var m1 = M[1]\\\\n  M[1] = M[3]\\\\n  M[3] = m1\\\\n\\\\n  var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds)\\\\n  var buf = Buffer.allocUnsafe(16)\\\\n  buf.writeUInt32BE(out[0], 0)\\\\n  buf.writeUInt32BE(out[3], 4)\\\\n  buf.writeUInt32BE(out[2], 8)\\\\n  buf.writeUInt32BE(out[1], 12)\\\\n  return buf\\\\n}\\\\n\\\\nAES.prototype.scrub = function () {\\\\n  scrubVec(this._keySchedule)\\\\n  scrubVec(this._invKeySchedule)\\\\n  scrubVec(this._key)\\\\n}\\\\n\\\\nmodule.exports.AES = AES\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/aes.js\\\\n// module id = 44\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/aes.js\\")},function(module,exports){eval(\\"module.exports = function (it) {\\\\n  if (typeof it != \'function\') throw TypeError(it + \' is not a function!\');\\\\n  return it;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_a-function.js\\\\n// module id = 45\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_a-function.js\\")},function(module,exports){eval(\\"module.exports = true;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_library.js\\\\n// module id = 46\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_library.js\\")},function(module,exports,__webpack_require__){eval(\\"// 19.1.2.14 / 15.2.3.14 Object.keys(O)\\\\nvar $keys = __webpack_require__(115);\\\\nvar enumBugKeys = __webpack_require__(70);\\\\n\\\\nmodule.exports = Object.keys || function keys(O) {\\\\n  return $keys(O, enumBugKeys);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-keys.js\\\\n// module id = 47\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-keys.js\\")},function(module,exports){eval(\\"exports.f = {}.propertyIsEnumerable;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-pie.js\\\\n// module id = 48\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-pie.js\\")},function(module,exports,__webpack_require__){eval(\\"var def = __webpack_require__(16).f;\\\\nvar has = __webpack_require__(21);\\\\nvar TAG = __webpack_require__(9)(\'toStringTag\');\\\\n\\\\nmodule.exports = function (it, tag, stat) {\\\\n  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_set-to-string-tag.js\\\\n// module id = 49\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_set-to-string-tag.js\\")},function(module,exports){eval(\\"var id = 0;\\\\nvar px = Math.random();\\\\nmodule.exports = function (key) {\\\\n  return \'Symbol(\'.concat(key === undefined ? \'\' : key, \')_\', (++id + px).toString(36));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_uid.js\\\\n// module id = 50\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_uid.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar curve = exports;\\\\n\\\\ncurve.base = __webpack_require__(250);\\\\ncurve.short = __webpack_require__(253);\\\\ncurve.mont = __webpack_require__(252);\\\\ncurve.edwards = __webpack_require__(251);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curve/index.js\\\\n// module id = 51\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\nvar MD5 = __webpack_require__(280)\\\\n\\\\n/* eslint-disable camelcase */\\\\nfunction EVP_BytesToKey (password, salt, keyBits, ivLen) {\\\\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, \'binary\')\\\\n  if (salt) {\\\\n    if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, \'binary\')\\\\n    if (salt.length !== 8) throw new RangeError(\'salt should be Buffer with 8 byte length\')\\\\n  }\\\\n\\\\n  var keyLen = keyBits / 8\\\\n  var key = Buffer.alloc(keyLen)\\\\n  var iv = Buffer.alloc(ivLen || 0)\\\\n  var tmp = Buffer.alloc(0)\\\\n\\\\n  while (keyLen > 0 || ivLen > 0) {\\\\n    var hash = new MD5()\\\\n    hash.update(tmp)\\\\n    hash.update(password)\\\\n    if (salt) hash.update(salt)\\\\n    tmp = hash.digest()\\\\n\\\\n    var used = 0\\\\n\\\\n    if (keyLen > 0) {\\\\n      var keyStart = key.length - keyLen\\\\n      used = Math.min(keyLen, tmp.length)\\\\n      tmp.copy(key, keyStart, 0, used)\\\\n      keyLen -= used\\\\n    }\\\\n\\\\n    if (used < tmp.length && ivLen > 0) {\\\\n      var ivStart = iv.length - ivLen\\\\n      var length = Math.min(ivLen, tmp.length - used)\\\\n      tmp.copy(iv, ivStart, used, used + length)\\\\n      ivLen -= length\\\\n    }\\\\n  }\\\\n\\\\n  tmp.fill(0)\\\\n  return { key: key, iv: iv }\\\\n}\\\\n\\\\nmodule.exports = EVP_BytesToKey\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/evp_bytestokey/index.js\\\\n// module id = 52\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/evp_bytestokey/index.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(global) {var apply = Function.prototype.apply;\\\\n\\\\n// DOM APIs, for completeness\\\\n\\\\nexports.setTimeout = function() {\\\\n  return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\\\\n};\\\\nexports.setInterval = function() {\\\\n  return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\\\\n};\\\\nexports.clearTimeout =\\\\nexports.clearInterval = function(timeout) {\\\\n  if (timeout) {\\\\n    timeout.close();\\\\n  }\\\\n};\\\\n\\\\nfunction Timeout(id, clearFn) {\\\\n  this._id = id;\\\\n  this._clearFn = clearFn;\\\\n}\\\\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\\\\nTimeout.prototype.close = function() {\\\\n  this._clearFn.call(window, this._id);\\\\n};\\\\n\\\\n// Does not start the time, just sets up the members needed.\\\\nexports.enroll = function(item, msecs) {\\\\n  clearTimeout(item._idleTimeoutId);\\\\n  item._idleTimeout = msecs;\\\\n};\\\\n\\\\nexports.unenroll = function(item) {\\\\n  clearTimeout(item._idleTimeoutId);\\\\n  item._idleTimeout = -1;\\\\n};\\\\n\\\\nexports._unrefActive = exports.active = function(item) {\\\\n  clearTimeout(item._idleTimeoutId);\\\\n\\\\n  var msecs = item._idleTimeout;\\\\n  if (msecs >= 0) {\\\\n    item._idleTimeoutId = setTimeout(function onTimeout() {\\\\n      if (item._onTimeout)\\\\n        item._onTimeout();\\\\n    }, msecs);\\\\n  }\\\\n};\\\\n\\\\n// setimmediate attaches itself to the global object\\\\n__webpack_require__(318);\\\\n// On some exotic environments, it\\\\\'s not clear which object `setimmeidate` was\\\\n// able to install onto.  Search each possibility in the same order as the\\\\n// `setimmediate` library.\\\\nexports.setImmediate = (typeof self !== \\"undefined\\" && self.setImmediate) ||\\\\n                       (typeof global !== \\"undefined\\" && global.setImmediate) ||\\\\n                       (this && this.setImmediate);\\\\nexports.clearImmediate = (typeof self !== \\"undefined\\" && self.clearImmediate) ||\\\\n                         (typeof global !== \\"undefined\\" && global.clearImmediate) ||\\\\n                         (this && this.clearImmediate);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/node-libs-browser/~/timers-browserify/main.js\\\\n// module id = 53\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/node-libs-browser/node_modules/timers-browserify/main.js\')},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var asn1 = __webpack_require__(286)\\\\nvar aesid = __webpack_require__(285)\\\\nvar fixProc = __webpack_require__(288)\\\\nvar ciphers = __webpack_require__(65)\\\\nvar compat = __webpack_require__(86)\\\\nmodule.exports = parseKeys\\\\n\\\\nfunction parseKeys (buffer) {\\\\n  var password\\\\n  if (typeof buffer === \'object\' && !Buffer.isBuffer(buffer)) {\\\\n    password = buffer.passphrase\\\\n    buffer = buffer.key\\\\n  }\\\\n  if (typeof buffer === \'string\') {\\\\n    buffer = new Buffer(buffer)\\\\n  }\\\\n\\\\n  var stripped = fixProc(buffer, password)\\\\n\\\\n  var type = stripped.tag\\\\n  var data = stripped.data\\\\n  var subtype, ndata\\\\n  switch (type) {\\\\n    case \'CERTIFICATE\':\\\\n      ndata = asn1.certificate.decode(data, \'der\').tbsCertificate.subjectPublicKeyInfo\\\\n      // falls through\\\\n    case \'PUBLIC KEY\':\\\\n      if (!ndata) {\\\\n        ndata = asn1.PublicKey.decode(data, \'der\')\\\\n      }\\\\n      subtype = ndata.algorithm.algorithm.join(\'.\')\\\\n      switch (subtype) {\\\\n        case \'1.2.840.113549.1.1.1\':\\\\n          return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, \'der\')\\\\n        case \'1.2.840.10045.2.1\':\\\\n          ndata.subjectPrivateKey = ndata.subjectPublicKey\\\\n          return {\\\\n            type: \'ec\',\\\\n            data: ndata\\\\n          }\\\\n        case \'1.2.840.10040.4.1\':\\\\n          ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, \'der\')\\\\n          return {\\\\n            type: \'dsa\',\\\\n            data: ndata.algorithm.params\\\\n          }\\\\n        default: throw new Error(\'unknown key id \' + subtype)\\\\n      }\\\\n      throw new Error(\'unknown key type \' + type)\\\\n    case \'ENCRYPTED PRIVATE KEY\':\\\\n      data = asn1.EncryptedPrivateKey.decode(data, \'der\')\\\\n      data = decrypt(data, password)\\\\n      // falls through\\\\n    case \'PRIVATE KEY\':\\\\n      ndata = asn1.PrivateKey.decode(data, \'der\')\\\\n      subtype = ndata.algorithm.algorithm.join(\'.\')\\\\n      switch (subtype) {\\\\n        case \'1.2.840.113549.1.1.1\':\\\\n          return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, \'der\')\\\\n        case \'1.2.840.10045.2.1\':\\\\n          return {\\\\n            curve: ndata.algorithm.curve,\\\\n            privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, \'der\').privateKey\\\\n          }\\\\n        case \'1.2.840.10040.4.1\':\\\\n          ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, \'der\')\\\\n          return {\\\\n            type: \'dsa\',\\\\n            params: ndata.algorithm.params\\\\n          }\\\\n        default: throw new Error(\'unknown key id \' + subtype)\\\\n      }\\\\n      throw new Error(\'unknown key type \' + type)\\\\n    case \'RSA PUBLIC KEY\':\\\\n      return asn1.RSAPublicKey.decode(data, \'der\')\\\\n    case \'RSA PRIVATE KEY\':\\\\n      return asn1.RSAPrivateKey.decode(data, \'der\')\\\\n    case \'DSA PRIVATE KEY\':\\\\n      return {\\\\n        type: \'dsa\',\\\\n        params: asn1.DSAPrivateKey.decode(data, \'der\')\\\\n      }\\\\n    case \'EC PRIVATE KEY\':\\\\n      data = asn1.ECPrivateKey.decode(data, \'der\')\\\\n      return {\\\\n        curve: data.parameters.value,\\\\n        privateKey: data.privateKey\\\\n      }\\\\n    default: throw new Error(\'unknown key type \' + type)\\\\n  }\\\\n}\\\\nparseKeys.signature = asn1.signature\\\\nfunction decrypt (data, password) {\\\\n  var salt = data.algorithm.decrypt.kde.kdeparams.salt\\\\n  var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10)\\\\n  var algo = aesid[data.algorithm.decrypt.cipher.algo.join(\'.\')]\\\\n  var iv = data.algorithm.decrypt.cipher.iv\\\\n  var cipherText = data.subjectPrivateKey\\\\n  var keylen = parseInt(algo.split(\'-\')[1], 10) / 8\\\\n  var key = compat.pbkdf2Sync(password, salt, iters, keylen)\\\\n  var cipher = ciphers.createDecipheriv(algo, key, iv)\\\\n  var out = []\\\\n  out.push(cipher.update(cipherText))\\\\n  out.push(cipher.final())\\\\n  return Buffer.concat(out)\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/index.js\\\\n// module id = 54\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(process) {\\\\n\\\\nif (!process.version ||\\\\n    process.version.indexOf(\'v0.\') === 0 ||\\\\n    process.version.indexOf(\'v1.\') === 0 && process.version.indexOf(\'v1.8.\') !== 0) {\\\\n  module.exports = { nextTick: nextTick };\\\\n} else {\\\\n  module.exports = process\\\\n}\\\\n\\\\nfunction nextTick(fn, arg1, arg2, arg3) {\\\\n  if (typeof fn !== \'function\') {\\\\n    throw new TypeError(\'\\\\\\"callback\\\\\\" argument must be a function\');\\\\n  }\\\\n  var len = arguments.length;\\\\n  var args, i;\\\\n  switch (len) {\\\\n  case 0:\\\\n  case 1:\\\\n    return process.nextTick(fn);\\\\n  case 2:\\\\n    return process.nextTick(function afterTickOne() {\\\\n      fn.call(null, arg1);\\\\n    });\\\\n  case 3:\\\\n    return process.nextTick(function afterTickTwo() {\\\\n      fn.call(null, arg1, arg2);\\\\n    });\\\\n  case 4:\\\\n    return process.nextTick(function afterTickThree() {\\\\n      fn.call(null, arg1, arg2, arg3);\\\\n    });\\\\n  default:\\\\n    args = new Array(len - 1);\\\\n    i = 0;\\\\n    while (i < args.length) {\\\\n      args[i++] = arguments[i];\\\\n    }\\\\n    return process.nextTick(function afterTick() {\\\\n      fn.apply(null, args);\\\\n    });\\\\n  }\\\\n}\\\\n\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/process-nextick-args/index.js\\\\n// module id = 55\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/process-nextick-args/index.js\\")},function(module,exports,__webpack_require__){eval(\\"// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\nmodule.exports = Stream;\\\\n\\\\nvar EE = __webpack_require__(84).EventEmitter;\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\ninherits(Stream, EE);\\\\nStream.Readable = __webpack_require__(88);\\\\nStream.Writable = __webpack_require__(313);\\\\nStream.Duplex = __webpack_require__(308);\\\\nStream.Transform = __webpack_require__(312);\\\\nStream.PassThrough = __webpack_require__(311);\\\\n\\\\n// Backwards-compat with node 0.4.x\\\\nStream.Stream = Stream;\\\\n\\\\n\\\\n\\\\n// old-style streams.  Note that the pipe method (the only relevant\\\\n// part of this class) is overridden in the Readable class.\\\\n\\\\nfunction Stream() {\\\\n  EE.call(this);\\\\n}\\\\n\\\\nStream.prototype.pipe = function(dest, options) {\\\\n  var source = this;\\\\n\\\\n  function ondata(chunk) {\\\\n    if (dest.writable) {\\\\n      if (false === dest.write(chunk) && source.pause) {\\\\n        source.pause();\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  source.on(\'data\', ondata);\\\\n\\\\n  function ondrain() {\\\\n    if (source.readable && source.resume) {\\\\n      source.resume();\\\\n    }\\\\n  }\\\\n\\\\n  dest.on(\'drain\', ondrain);\\\\n\\\\n  // If the \'end\' option is not supplied, dest.end() will be called when\\\\n  // source gets the \'end\' or \'close\' events.  Only dest.end() once.\\\\n  if (!dest._isStdio && (!options || options.end !== false)) {\\\\n    source.on(\'end\', onend);\\\\n    source.on(\'close\', onclose);\\\\n  }\\\\n\\\\n  var didOnEnd = false;\\\\n  function onend() {\\\\n    if (didOnEnd) return;\\\\n    didOnEnd = true;\\\\n\\\\n    dest.end();\\\\n  }\\\\n\\\\n\\\\n  function onclose() {\\\\n    if (didOnEnd) return;\\\\n    didOnEnd = true;\\\\n\\\\n    if (typeof dest.destroy === \'function\') dest.destroy();\\\\n  }\\\\n\\\\n  // don\'t leave dangling pipes when there are errors.\\\\n  function onerror(er) {\\\\n    cleanup();\\\\n    if (EE.listenerCount(this, \'error\') === 0) {\\\\n      throw er; // Unhandled stream error in pipe.\\\\n    }\\\\n  }\\\\n\\\\n  source.on(\'error\', onerror);\\\\n  dest.on(\'error\', onerror);\\\\n\\\\n  // remove all the event listeners that were added.\\\\n  function cleanup() {\\\\n    source.removeListener(\'data\', ondata);\\\\n    dest.removeListener(\'drain\', ondrain);\\\\n\\\\n    source.removeListener(\'end\', onend);\\\\n    source.removeListener(\'close\', onclose);\\\\n\\\\n    source.removeListener(\'error\', onerror);\\\\n    dest.removeListener(\'error\', onerror);\\\\n\\\\n    source.removeListener(\'end\', cleanup);\\\\n    source.removeListener(\'close\', cleanup);\\\\n\\\\n    dest.removeListener(\'close\', cleanup);\\\\n  }\\\\n\\\\n  source.on(\'end\', cleanup);\\\\n  source.on(\'close\', cleanup);\\\\n\\\\n  dest.on(\'close\', cleanup);\\\\n\\\\n  dest.emit(\'pipe\', source);\\\\n\\\\n  // Allow for unix-like usage: A.pipe(B).pipe(C)\\\\n  return dest;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/stream-browserify/index.js\\\\n// module id = 56\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/stream-browserify/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar Subscription = __webpack_require__(341);\\\\n\\\\n\\\\nvar Subscriptions = function Subscriptions(options) {\\\\n    this.name = options.name;\\\\n    this.type = options.type;\\\\n    this.subscriptions = options.subscriptions || {};\\\\n    this.requestManager = null;\\\\n};\\\\n\\\\n\\\\nSubscriptions.prototype.setRequestManager = function (rm) {\\\\n    this.requestManager = rm;\\\\n};\\\\n\\\\n\\\\nSubscriptions.prototype.attachToObject = function (obj) {\\\\n    var func = this.buildCall();\\\\n    func.call = this.call;\\\\n    var name = this.name.split(\'.\');\\\\n    if (name.length > 1) {\\\\n        obj[name[0]] = obj[name[0]] || {};\\\\n        obj[name[0]][name[1]] = func;\\\\n    } else {\\\\n        obj[name[0]] = func;\\\\n    }\\\\n};\\\\n\\\\n\\\\nSubscriptions.prototype.buildCall = function() {\\\\n    var _this = this;\\\\n\\\\n    return function(){\\\\n        if(!_this.subscriptions[arguments[0]]) {\\\\n            console.warn(\'Subscription \'+ JSON.stringify(arguments[0]) +\' doesn\\\\\\\\\'t exist. Subscribing anyway.\');\\\\n        }\\\\n\\\\n        var subscription = new Subscription({\\\\n            subscription: _this.subscriptions[arguments[0]],\\\\n            requestManager: _this.requestManager,\\\\n            type: _this.type\\\\n        });\\\\n\\\\n        return subscription.subscribe.apply(subscription, arguments);\\\\n    };\\\\n};\\\\n\\\\n\\\\nmodule.exports = {\\\\n    subscriptions: Subscriptions,\\\\n    subscription: Subscription\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-subscriptions/src/index.js\\\\n// module id = 57\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-subscriptions/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar core = __webpack_require__(26);\\\\nvar Method = __webpack_require__(25);\\\\nvar utils = __webpack_require__(10);\\\\n\\\\n\\\\nvar Net = function () {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, arguments);\\\\n\\\\n\\\\n    [\\\\n        new Method({\\\\n            name: \'getId\',\\\\n            call: \'net_version\',\\\\n            params: 0,\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'isListening\',\\\\n            call: \'net_listening\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getPeerCount\',\\\\n            call: \'net_peerCount\',\\\\n            params: 0,\\\\n            outputFormatter: utils.hexToNumber\\\\n        })\\\\n    ].forEach(function(method) {\\\\n        method.attachToObject(_this);\\\\n        method.setRequestManager(_this._requestManager);\\\\n    });\\\\n\\\\n};\\\\n\\\\ncore.addProviders(Net);\\\\n\\\\n\\\\nmodule.exports = Net;\\\\n\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-net/src/index.js\\\\n// module id = 58\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-net/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar config = void 0;\\\\n\\\\nif (false) {\\\\n  config = require(\'./local/config\');\\\\n}\\\\n\\\\nif (true) {\\\\n  config = __webpack_require__(170);\\\\n}\\\\n\\\\nmodule.exports = config;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/config/config.js\\\\n// module id = 59\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=config/config.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\nexports.__esModule = true;\\\\n\\\\nvar _promise = __webpack_require__(96);\\\\n\\\\nvar _promise2 = _interopRequireDefault(_promise);\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nexports.default = function (fn) {\\\\n  return function () {\\\\n    var gen = fn.apply(this, arguments);\\\\n    return new _promise2.default(function (resolve, reject) {\\\\n      function step(key, arg) {\\\\n        try {\\\\n          var info = gen[key](arg);\\\\n          var value = info.value;\\\\n        } catch (error) {\\\\n          reject(error);\\\\n          return;\\\\n        }\\\\n\\\\n        if (info.done) {\\\\n          resolve(value);\\\\n        } else {\\\\n          return _promise2.default.resolve(value).then(function (value) {\\\\n            step(\\"next\\", value);\\\\n          }, function (err) {\\\\n            step(\\"throw\\", err);\\\\n          });\\\\n        }\\\\n      }\\\\n\\\\n      return step(\\"next\\");\\\\n    });\\\\n  };\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/helpers/asyncToGenerator.js\\\\n// module id = 60\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/helpers/asyncToGenerator.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\nexports.__esModule = true;\\\\n\\\\nexports.default = function (instance, Constructor) {\\\\n  if (!(instance instanceof Constructor)) {\\\\n    throw new TypeError(\\"Cannot call a class as a function\\");\\\\n  }\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/helpers/classCallCheck.js\\\\n// module id = 61\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/helpers/classCallCheck.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\nexports.__esModule = true;\\\\n\\\\nvar _defineProperty = __webpack_require__(176);\\\\n\\\\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nexports.default = function () {\\\\n  function defineProperties(target, props) {\\\\n    for (var i = 0; i < props.length; i++) {\\\\n      var descriptor = props[i];\\\\n      descriptor.enumerable = descriptor.enumerable || false;\\\\n      descriptor.configurable = true;\\\\n      if (\\"value\\" in descriptor) descriptor.writable = true;\\\\n      (0, _defineProperty2.default)(target, descriptor.key, descriptor);\\\\n    }\\\\n  }\\\\n\\\\n  return function (Constructor, protoProps, staticProps) {\\\\n    if (protoProps) defineProperties(Constructor.prototype, protoProps);\\\\n    if (staticProps) defineProperties(Constructor, staticProps);\\\\n    return Constructor;\\\\n  };\\\\n}();\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/helpers/createClass.js\\\\n// module id = 62\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/helpers/createClass.js\')},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(314);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/regenerator/index.js\\\\n// module id = 63\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/regenerator/index.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(Buffer) {var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\\"return\\"]) _i[\\"return\\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\\"Invalid attempt to destructure non-iterable instance\\"); } }; }();\\\\n\\\\nvar Bytes = __webpack_require__(92);\\\\nvar Nat = __webpack_require__(160);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar rlp = __webpack_require__(161);\\\\nvar secp256k1 = new elliptic.ec(\\"secp256k1\\"); // eslint-disable-line\\\\n\\\\nvar _require = __webpack_require__(159),\\\\n    keccak256 = _require.keccak256,\\\\n    keccak256s = _require.keccak256s;\\\\n\\\\nvar create = function create(entropy) {\\\\n  var innerHex = keccak256(Bytes.concat(Bytes.random(32), entropy || Bytes.random(32)));\\\\n  var middleHex = Bytes.concat(Bytes.concat(Bytes.random(32), innerHex), Bytes.random(32));\\\\n  var outerHex = keccak256(middleHex);\\\\n  return fromPrivate(outerHex);\\\\n};\\\\n\\\\nvar toChecksum = function toChecksum(address) {\\\\n  var addressHash = keccak256s(address.slice(2));\\\\n  var checksumAddress = \\"0x\\";\\\\n  for (var i = 0; i < 40; i++) {\\\\n    checksumAddress += parseInt(addressHash[i + 2], 16) > 7 ? address[i + 2].toUpperCase() : address[i + 2];\\\\n  }return checksumAddress;\\\\n};\\\\n\\\\nvar fromPrivate = function fromPrivate(privateKey) {\\\\n  var buffer = new Buffer(privateKey.slice(2), \\"hex\\");\\\\n  var ecKey = secp256k1.keyFromPrivate(buffer);\\\\n  var publicKey = \\"0x\\" + ecKey.getPublic(false, \\\\\'hex\\\\\').slice(2);\\\\n  var publicHash = keccak256(publicKey);\\\\n  var address = toChecksum(\\"0x\\" + publicHash.slice(-40));\\\\n  return {\\\\n    address: address,\\\\n    privateKey: privateKey\\\\n  };\\\\n};\\\\n\\\\nvar encodeSignature = function encodeSignature(_ref) {\\\\n  var _ref2 = _slicedToArray(_ref, 3),\\\\n      v = _ref2[0],\\\\n      r = Bytes.pad(32, _ref2[1]),\\\\n      s = Bytes.pad(32, _ref2[2]);\\\\n\\\\n  return Bytes.flatten([r, s, v]);\\\\n};\\\\n\\\\nvar decodeSignature = function decodeSignature(hex) {\\\\n  return [Bytes.slice(64, Bytes.length(hex), hex), Bytes.slice(0, 32, hex), Bytes.slice(32, 64, hex)];\\\\n};\\\\n\\\\nvar makeSigner = function makeSigner(addToV) {\\\\n  return function (hash, privateKey) {\\\\n    var signature = secp256k1.keyFromPrivate(new Buffer(privateKey.slice(2), \\"hex\\")).sign(new Buffer(hash.slice(2), \\"hex\\"), { canonical: true });\\\\n    return encodeSignature([Nat.fromString(Bytes.fromNumber(addToV + signature.recoveryParam)), Bytes.pad(32, Bytes.fromNat(\\"0x\\" + signature.r.toString(16))), Bytes.pad(32, Bytes.fromNat(\\"0x\\" + signature.s.toString(16)))]);\\\\n  };\\\\n};\\\\n\\\\nvar sign = makeSigner(27); // v=27|28 instead of 0|1...\\\\n\\\\nvar recover = function recover(hash, signature) {\\\\n  var vals = decodeSignature(signature);\\\\n  var vrs = { v: Bytes.toNumber(vals[0]), r: vals[1].slice(2), s: vals[2].slice(2) };\\\\n  var ecPublicKey = secp256k1.recoverPubKey(new Buffer(hash.slice(2), \\"hex\\"), vrs, vrs.v < 2 ? vrs.v : 1 - vrs.v % 2); // because odd vals mean v=0... sadly that means v=0 means v=1... I hate that\\\\n  var publicKey = \\"0x\\" + ecPublicKey.encode(\\"hex\\", false).slice(2);\\\\n  var publicHash = keccak256(publicKey);\\\\n  var address = toChecksum(\\"0x\\" + publicHash.slice(-40));\\\\n  return address;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  create: create,\\\\n  toChecksum: toChecksum,\\\\n  fromPrivate: fromPrivate,\\\\n  sign: sign,\\\\n  makeSigner: makeSigner,\\\\n  recover: recover,\\\\n  encodeSignature: encodeSignature,\\\\n  decodeSignature: decodeSignature\\\\n};\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/account.js\\\\n// module id = 64\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/account.js\')},function(module,exports,__webpack_require__){eval(\\"var ciphers = __webpack_require__(182)\\\\nvar deciphers = __webpack_require__(181)\\\\nvar modes = __webpack_require__(101)\\\\n\\\\nfunction getCiphers () {\\\\n  return Object.keys(modes)\\\\n}\\\\n\\\\nexports.createCipher = exports.Cipher = ciphers.createCipher\\\\nexports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv\\\\nexports.createDecipher = exports.Decipher = deciphers.createDecipher\\\\nexports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv\\\\nexports.listCiphers = exports.getCiphers = getCiphers\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/browser.js\\\\n// module id = 65\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"var modeModules = {\\\\n  ECB: __webpack_require__(188),\\\\n  CBC: __webpack_require__(184),\\\\n  CFB: __webpack_require__(185),\\\\n  CFB8: __webpack_require__(187),\\\\n  CFB1: __webpack_require__(186),\\\\n  OFB: __webpack_require__(189),\\\\n  CTR: __webpack_require__(100),\\\\n  GCM: __webpack_require__(100)\\\\n}\\\\n\\\\nvar modes = __webpack_require__(101)\\\\n\\\\nfor (var key in modes) {\\\\n  modes[key].module = modeModules[modes[key].mode]\\\\n}\\\\n\\\\nmodule.exports = modes\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/index.js\\\\n// module id = 66\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(3);\\\\nvar randomBytes = __webpack_require__(29);\\\\nmodule.exports = crt;\\\\nfunction blind(priv) {\\\\n  var r = getr(priv);\\\\n  var blinder = r.toRed(bn.mont(priv.modulus))\\\\n  .redPow(new bn(priv.publicExponent)).fromRed();\\\\n  return {\\\\n    blinder: blinder,\\\\n    unblinder:r.invm(priv.modulus)\\\\n  };\\\\n}\\\\nfunction crt(msg, priv) {\\\\n  var blinds = blind(priv);\\\\n  var len = priv.modulus.byteLength();\\\\n  var mod = bn.mont(priv.modulus);\\\\n  var blinded = new bn(msg).mul(blinds.blinder).umod(priv.modulus);\\\\n  var c1 = blinded.toRed(bn.mont(priv.prime1));\\\\n  var c2 = blinded.toRed(bn.mont(priv.prime2));\\\\n  var qinv = priv.coefficient;\\\\n  var p = priv.prime1;\\\\n  var q = priv.prime2;\\\\n  var m1 = c1.redPow(priv.exponent1);\\\\n  var m2 = c2.redPow(priv.exponent2);\\\\n  m1 = m1.fromRed();\\\\n  m2 = m2.fromRed();\\\\n  var h = m1.isub(m2).imul(qinv).umod(p);\\\\n  h.imul(q);\\\\n  m2.iadd(h);\\\\n  return new Buffer(m2.imul(blinds.unblinder).umod(priv.modulus).toArray(false, len));\\\\n}\\\\ncrt.getr = getr;\\\\nfunction getr(priv) {\\\\n  var len = priv.modulus.byteLength();\\\\n  var r = new bn(randomBytes(len));\\\\n  while (r.cmp(priv.modulus) >=  0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) {\\\\n    r = new bn(randomBytes(len));\\\\n  }\\\\n  return r;\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-rsa/index.js\\\\n// module id = 67\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-rsa/index.js\\")},function(module,exports){eval(\'// 7.2.1 RequireObjectCoercible(argument)\\\\nmodule.exports = function (it) {\\\\n  if (it == undefined) throw TypeError(\\"Can\\\\\'t call method on  \\" + it);\\\\n  return it;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_defined.js\\\\n// module id = 68\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_defined.js\')},function(module,exports,__webpack_require__){eval(\\"var isObject = __webpack_require__(23);\\\\nvar document = __webpack_require__(8).document;\\\\n// typeof document.createElement is \'object\' in old IE\\\\nvar is = isObject(document) && isObject(document.createElement);\\\\nmodule.exports = function (it) {\\\\n  return is ? document.createElement(it) : {};\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_dom-create.js\\\\n// module id = 69\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_dom-create.js\\")},function(module,exports){eval(\\"// IE 8- don\'t enum bug keys\\\\nmodule.exports = (\\\\n  \'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf\'\\\\n).split(\',\');\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_enum-bug-keys.js\\\\n// module id = 70\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_enum-bug-keys.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n// 25.4.1.5 NewPromiseCapability(C)\\\\nvar aFunction = __webpack_require__(45);\\\\n\\\\nfunction PromiseCapability(C) {\\\\n  var resolve, reject;\\\\n  this.promise = new C(function ($$resolve, $$reject) {\\\\n    if (resolve !== undefined || reject !== undefined) throw TypeError(\'Bad Promise constructor\');\\\\n    resolve = $$resolve;\\\\n    reject = $$reject;\\\\n  });\\\\n  this.resolve = aFunction(resolve);\\\\n  this.reject = aFunction(reject);\\\\n}\\\\n\\\\nmodule.exports.f = function (C) {\\\\n  return new PromiseCapability(C);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_new-promise-capability.js\\\\n// module id = 71\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_new-promise-capability.js\\")},function(module,exports){eval(\\"exports.f = Object.getOwnPropertySymbols;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-gops.js\\\\n// module id = 72\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-gops.js\\")},function(module,exports,__webpack_require__){eval(\\"var shared = __webpack_require__(74)(\'keys\');\\\\nvar uid = __webpack_require__(50);\\\\nmodule.exports = function (key) {\\\\n  return shared[key] || (shared[key] = uid(key));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_shared-key.js\\\\n// module id = 73\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_shared-key.js\\")},function(module,exports,__webpack_require__){eval(\\"var global = __webpack_require__(8);\\\\nvar SHARED = \'__core-js_shared__\';\\\\nvar store = global[SHARED] || (global[SHARED] = {});\\\\nmodule.exports = function (key) {\\\\n  return store[key] || (store[key] = {});\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_shared.js\\\\n// module id = 74\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_shared.js\\")},function(module,exports){eval(\\"// 7.1.4 ToInteger\\\\nvar ceil = Math.ceil;\\\\nvar floor = Math.floor;\\\\nmodule.exports = function (it) {\\\\n  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-integer.js\\\\n// module id = 75\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-integer.js\\")},function(module,exports,__webpack_require__){eval(\\"// 7.1.15 ToLength\\\\nvar toInteger = __webpack_require__(75);\\\\nvar min = Math.min;\\\\nmodule.exports = function (it) {\\\\n  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-length.js\\\\n// module id = 76\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-length.js\\")},function(module,exports,__webpack_require__){eval(\\"// 7.1.13 ToObject(argument)\\\\nvar defined = __webpack_require__(68);\\\\nmodule.exports = function (it) {\\\\n  return Object(defined(it));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-object.js\\\\n// module id = 77\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-object.js\\")},function(module,exports,__webpack_require__){eval(\\"// 7.1.1 ToPrimitive(input [, PreferredType])\\\\nvar isObject = __webpack_require__(23);\\\\n// instead of the ES6 spec version, we didn\'t implement @@toPrimitive case\\\\n// and the second argument - flag - preferred type is a string\\\\nmodule.exports = function (it, S) {\\\\n  if (!isObject(it)) return it;\\\\n  var fn, val;\\\\n  if (S && typeof (fn = it.toString) == \'function\' && !isObject(val = fn.call(it))) return val;\\\\n  if (typeof (fn = it.valueOf) == \'function\' && !isObject(val = fn.call(it))) return val;\\\\n  if (!S && typeof (fn = it.toString) == \'function\' && !isObject(val = fn.call(it))) return val;\\\\n  throw TypeError(\\\\\\"Can\'t convert object to primitive value\\\\\\");\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-primitive.js\\\\n// module id = 78\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-primitive.js\\")},function(module,exports,__webpack_require__){eval(\\"var global = __webpack_require__(8);\\\\nvar core = __webpack_require__(11);\\\\nvar LIBRARY = __webpack_require__(46);\\\\nvar wksExt = __webpack_require__(80);\\\\nvar defineProperty = __webpack_require__(16).f;\\\\nmodule.exports = function (name) {\\\\n  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\\\\n  if (name.charAt(0) != \'_\' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_wks-define.js\\\\n// module id = 79\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_wks-define.js\\")},function(module,exports,__webpack_require__){eval(\\"exports.f = __webpack_require__(9);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_wks-ext.js\\\\n// module id = 80\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_wks-ext.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar $at = __webpack_require__(223)(true);\\\\n\\\\n// 21.1.3.27 String.prototype[@@iterator]()\\\\n__webpack_require__(111)(String, \'String\', function (iterated) {\\\\n  this._t = String(iterated); // target\\\\n  this._i = 0;                // next index\\\\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\\\\n}, function () {\\\\n  var O = this._t;\\\\n  var index = this._i;\\\\n  var point;\\\\n  if (index >= O.length) return { value: undefined, done: true };\\\\n  point = $at(O, index);\\\\n  this._i += point.length;\\\\n  return { value: point, done: false };\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.string.iterator.js\\\\n// module id = 81\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.string.iterator.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n/*\\\\n * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message\\\\n * Digest Algorithm, as defined in RFC 1321.\\\\n * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.\\\\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\\\\n * Distributed under the BSD License\\\\n * See http://pajhome.org.uk/crypt/md5 for more info.\\\\n */\\\\n\\\\nvar makeHash = __webpack_require__(236)\\\\n\\\\n/*\\\\n * Calculate the MD5 of an array of little-endian words, and a bit length\\\\n */\\\\nfunction core_md5 (x, len) {\\\\n  /* append padding */\\\\n  x[len >> 5] |= 0x80 << ((len) % 32)\\\\n  x[(((len + 64) >>> 9) << 4) + 14] = len\\\\n\\\\n  var a = 1732584193\\\\n  var b = -271733879\\\\n  var c = -1732584194\\\\n  var d = 271733878\\\\n\\\\n  for (var i = 0; i < x.length; i += 16) {\\\\n    var olda = a\\\\n    var oldb = b\\\\n    var oldc = c\\\\n    var oldd = d\\\\n\\\\n    a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936)\\\\n    d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586)\\\\n    c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819)\\\\n    b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330)\\\\n    a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897)\\\\n    d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426)\\\\n    c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341)\\\\n    b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983)\\\\n    a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416)\\\\n    d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417)\\\\n    c = md5_ff(c, d, a, b, x[i + 10], 17, -42063)\\\\n    b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162)\\\\n    a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682)\\\\n    d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101)\\\\n    c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290)\\\\n    b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329)\\\\n\\\\n    a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510)\\\\n    d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632)\\\\n    c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713)\\\\n    b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302)\\\\n    a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691)\\\\n    d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083)\\\\n    c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335)\\\\n    b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848)\\\\n    a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438)\\\\n    d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690)\\\\n    c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961)\\\\n    b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501)\\\\n    a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467)\\\\n    d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784)\\\\n    c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473)\\\\n    b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734)\\\\n\\\\n    a = md5_hh(a, b, c, d, x[i + 5], 4, -378558)\\\\n    d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463)\\\\n    c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562)\\\\n    b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556)\\\\n    a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060)\\\\n    d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353)\\\\n    c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632)\\\\n    b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640)\\\\n    a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174)\\\\n    d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222)\\\\n    c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979)\\\\n    b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189)\\\\n    a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487)\\\\n    d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835)\\\\n    c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520)\\\\n    b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651)\\\\n\\\\n    a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844)\\\\n    d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415)\\\\n    c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905)\\\\n    b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055)\\\\n    a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571)\\\\n    d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606)\\\\n    c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523)\\\\n    b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799)\\\\n    a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359)\\\\n    d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744)\\\\n    c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380)\\\\n    b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649)\\\\n    a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070)\\\\n    d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379)\\\\n    c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259)\\\\n    b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551)\\\\n\\\\n    a = safe_add(a, olda)\\\\n    b = safe_add(b, oldb)\\\\n    c = safe_add(c, oldc)\\\\n    d = safe_add(d, oldd)\\\\n  }\\\\n\\\\n  return [a, b, c, d]\\\\n}\\\\n\\\\n/*\\\\n * These functions implement the four basic operations the algorithm uses.\\\\n */\\\\nfunction md5_cmn (q, a, b, x, s, t) {\\\\n  return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)\\\\n}\\\\n\\\\nfunction md5_ff (a, b, c, d, x, s, t) {\\\\n  return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t)\\\\n}\\\\n\\\\nfunction md5_gg (a, b, c, d, x, s, t) {\\\\n  return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t)\\\\n}\\\\n\\\\nfunction md5_hh (a, b, c, d, x, s, t) {\\\\n  return md5_cmn(b ^ c ^ d, a, b, x, s, t)\\\\n}\\\\n\\\\nfunction md5_ii (a, b, c, d, x, s, t) {\\\\n  return md5_cmn(c ^ (b | (~d)), a, b, x, s, t)\\\\n}\\\\n\\\\n/*\\\\n * Add integers, wrapping at 2^32. This uses 16-bit operations internally\\\\n * to work around bugs in some JS interpreters.\\\\n */\\\\nfunction safe_add (x, y) {\\\\n  var lsw = (x & 0xFFFF) + (y & 0xFFFF)\\\\n  var msw = (x >> 16) + (y >> 16) + (lsw >> 16)\\\\n  return (msw << 16) | (lsw & 0xFFFF)\\\\n}\\\\n\\\\n/*\\\\n * Bitwise rotate a 32-bit number to the left.\\\\n */\\\\nfunction bit_rol (num, cnt) {\\\\n  return (num << cnt) | (num >>> (32 - cnt))\\\\n}\\\\n\\\\nmodule.exports = function md5 (buf) {\\\\n  return makeHash(buf, core_md5)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-hash/md5.js\\\\n// module id = 82\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-hash/md5.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.utils = __webpack_require__(245);\\\\nexports.Cipher = __webpack_require__(242);\\\\nexports.DES = __webpack_require__(243);\\\\nexports.CBC = __webpack_require__(241);\\\\nexports.EDE = __webpack_require__(244);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des.js\\\\n// module id = 83\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des.js\\")},function(module,exports){eval(\\"// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\nfunction EventEmitter() {\\\\n  this._events = this._events || {};\\\\n  this._maxListeners = this._maxListeners || undefined;\\\\n}\\\\nmodule.exports = EventEmitter;\\\\n\\\\n// Backwards-compat with node 0.10.x\\\\nEventEmitter.EventEmitter = EventEmitter;\\\\n\\\\nEventEmitter.prototype._events = undefined;\\\\nEventEmitter.prototype._maxListeners = undefined;\\\\n\\\\n// By default EventEmitters will print a warning if more than 10 listeners are\\\\n// added to it. This is a useful default which helps finding memory leaks.\\\\nEventEmitter.defaultMaxListeners = 10;\\\\n\\\\n// Obviously not all Emitters should be limited to 10. This function allows\\\\n// that to be increased. Set to zero for unlimited.\\\\nEventEmitter.prototype.setMaxListeners = function(n) {\\\\n  if (!isNumber(n) || n < 0 || isNaN(n))\\\\n    throw TypeError(\'n must be a positive number\');\\\\n  this._maxListeners = n;\\\\n  return this;\\\\n};\\\\n\\\\nEventEmitter.prototype.emit = function(type) {\\\\n  var er, handler, len, args, i, listeners;\\\\n\\\\n  if (!this._events)\\\\n    this._events = {};\\\\n\\\\n  // If there is no \'error\' event listener then throw.\\\\n  if (type === \'error\') {\\\\n    if (!this._events.error ||\\\\n        (isObject(this._events.error) && !this._events.error.length)) {\\\\n      er = arguments[1];\\\\n      if (er instanceof Error) {\\\\n        throw er; // Unhandled \'error\' event\\\\n      } else {\\\\n        // At least give some kind of context to the user\\\\n        var err = new Error(\'Uncaught, unspecified \\\\\\"error\\\\\\" event. (\' + er + \')\');\\\\n        err.context = er;\\\\n        throw err;\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  handler = this._events[type];\\\\n\\\\n  if (isUndefined(handler))\\\\n    return false;\\\\n\\\\n  if (isFunction(handler)) {\\\\n    switch (arguments.length) {\\\\n      // fast cases\\\\n      case 1:\\\\n        handler.call(this);\\\\n        break;\\\\n      case 2:\\\\n        handler.call(this, arguments[1]);\\\\n        break;\\\\n      case 3:\\\\n        handler.call(this, arguments[1], arguments[2]);\\\\n        break;\\\\n      // slower\\\\n      default:\\\\n        args = Array.prototype.slice.call(arguments, 1);\\\\n        handler.apply(this, args);\\\\n    }\\\\n  } else if (isObject(handler)) {\\\\n    args = Array.prototype.slice.call(arguments, 1);\\\\n    listeners = handler.slice();\\\\n    len = listeners.length;\\\\n    for (i = 0; i < len; i++)\\\\n      listeners[i].apply(this, args);\\\\n  }\\\\n\\\\n  return true;\\\\n};\\\\n\\\\nEventEmitter.prototype.addListener = function(type, listener) {\\\\n  var m;\\\\n\\\\n  if (!isFunction(listener))\\\\n    throw TypeError(\'listener must be a function\');\\\\n\\\\n  if (!this._events)\\\\n    this._events = {};\\\\n\\\\n  // To avoid recursion in the case that type === \\\\\\"newListener\\\\\\"! Before\\\\n  // adding it to the listeners, first emit \\\\\\"newListener\\\\\\".\\\\n  if (this._events.newListener)\\\\n    this.emit(\'newListener\', type,\\\\n              isFunction(listener.listener) ?\\\\n              listener.listener : listener);\\\\n\\\\n  if (!this._events[type])\\\\n    // Optimize the case of one listener. Don\'t need the extra array object.\\\\n    this._events[type] = listener;\\\\n  else if (isObject(this._events[type]))\\\\n    // If we\'ve already got an array, just append.\\\\n    this._events[type].push(listener);\\\\n  else\\\\n    // Adding the second element, need to change to array.\\\\n    this._events[type] = [this._events[type], listener];\\\\n\\\\n  // Check for listener leak\\\\n  if (isObject(this._events[type]) && !this._events[type].warned) {\\\\n    if (!isUndefined(this._maxListeners)) {\\\\n      m = this._maxListeners;\\\\n    } else {\\\\n      m = EventEmitter.defaultMaxListeners;\\\\n    }\\\\n\\\\n    if (m && m > 0 && this._events[type].length > m) {\\\\n      this._events[type].warned = true;\\\\n      console.error(\'(node) warning: possible EventEmitter memory \' +\\\\n                    \'leak detected. %d listeners added. \' +\\\\n                    \'Use emitter.setMaxListeners() to increase limit.\',\\\\n                    this._events[type].length);\\\\n      if (typeof console.trace === \'function\') {\\\\n        // not supported in IE 10\\\\n        console.trace();\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\\\\n\\\\nEventEmitter.prototype.once = function(type, listener) {\\\\n  if (!isFunction(listener))\\\\n    throw TypeError(\'listener must be a function\');\\\\n\\\\n  var fired = false;\\\\n\\\\n  function g() {\\\\n    this.removeListener(type, g);\\\\n\\\\n    if (!fired) {\\\\n      fired = true;\\\\n      listener.apply(this, arguments);\\\\n    }\\\\n  }\\\\n\\\\n  g.listener = listener;\\\\n  this.on(type, g);\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n// emits a \'removeListener\' event iff the listener was removed\\\\nEventEmitter.prototype.removeListener = function(type, listener) {\\\\n  var list, position, length, i;\\\\n\\\\n  if (!isFunction(listener))\\\\n    throw TypeError(\'listener must be a function\');\\\\n\\\\n  if (!this._events || !this._events[type])\\\\n    return this;\\\\n\\\\n  list = this._events[type];\\\\n  length = list.length;\\\\n  position = -1;\\\\n\\\\n  if (list === listener ||\\\\n      (isFunction(list.listener) && list.listener === listener)) {\\\\n    delete this._events[type];\\\\n    if (this._events.removeListener)\\\\n      this.emit(\'removeListener\', type, listener);\\\\n\\\\n  } else if (isObject(list)) {\\\\n    for (i = length; i-- > 0;) {\\\\n      if (list[i] === listener ||\\\\n          (list[i].listener && list[i].listener === listener)) {\\\\n        position = i;\\\\n        break;\\\\n      }\\\\n    }\\\\n\\\\n    if (position < 0)\\\\n      return this;\\\\n\\\\n    if (list.length === 1) {\\\\n      list.length = 0;\\\\n      delete this._events[type];\\\\n    } else {\\\\n      list.splice(position, 1);\\\\n    }\\\\n\\\\n    if (this._events.removeListener)\\\\n      this.emit(\'removeListener\', type, listener);\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nEventEmitter.prototype.removeAllListeners = function(type) {\\\\n  var key, listeners;\\\\n\\\\n  if (!this._events)\\\\n    return this;\\\\n\\\\n  // not listening for removeListener, no need to emit\\\\n  if (!this._events.removeListener) {\\\\n    if (arguments.length === 0)\\\\n      this._events = {};\\\\n    else if (this._events[type])\\\\n      delete this._events[type];\\\\n    return this;\\\\n  }\\\\n\\\\n  // emit removeListener for all listeners on all events\\\\n  if (arguments.length === 0) {\\\\n    for (key in this._events) {\\\\n      if (key === \'removeListener\') continue;\\\\n      this.removeAllListeners(key);\\\\n    }\\\\n    this.removeAllListeners(\'removeListener\');\\\\n    this._events = {};\\\\n    return this;\\\\n  }\\\\n\\\\n  listeners = this._events[type];\\\\n\\\\n  if (isFunction(listeners)) {\\\\n    this.removeListener(type, listeners);\\\\n  } else if (listeners) {\\\\n    // LIFO order\\\\n    while (listeners.length)\\\\n      this.removeListener(type, listeners[listeners.length - 1]);\\\\n  }\\\\n  delete this._events[type];\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nEventEmitter.prototype.listeners = function(type) {\\\\n  var ret;\\\\n  if (!this._events || !this._events[type])\\\\n    ret = [];\\\\n  else if (isFunction(this._events[type]))\\\\n    ret = [this._events[type]];\\\\n  else\\\\n    ret = this._events[type].slice();\\\\n  return ret;\\\\n};\\\\n\\\\nEventEmitter.prototype.listenerCount = function(type) {\\\\n  if (this._events) {\\\\n    var evlistener = this._events[type];\\\\n\\\\n    if (isFunction(evlistener))\\\\n      return 1;\\\\n    else if (evlistener)\\\\n      return evlistener.length;\\\\n  }\\\\n  return 0;\\\\n};\\\\n\\\\nEventEmitter.listenerCount = function(emitter, type) {\\\\n  return emitter.listenerCount(type);\\\\n};\\\\n\\\\nfunction isFunction(arg) {\\\\n  return typeof arg === \'function\';\\\\n}\\\\n\\\\nfunction isNumber(arg) {\\\\n  return typeof arg === \'number\';\\\\n}\\\\n\\\\nfunction isObject(arg) {\\\\n  return typeof arg === \'object\' && arg !== null;\\\\n}\\\\n\\\\nfunction isUndefined(arg) {\\\\n  return arg === void 0;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/events/events.js\\\\n// module id = 84\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/events/events.js\\")},function(module,exports,__webpack_require__){eval(\\"var hash = exports;\\\\n\\\\nhash.utils = __webpack_require__(14);\\\\nhash.common = __webpack_require__(41);\\\\nhash.sha = __webpack_require__(272);\\\\nhash.ripemd = __webpack_require__(271);\\\\nhash.hmac = __webpack_require__(270);\\\\n\\\\n// Proxy hash functions to the main object\\\\nhash.sha1 = hash.sha.sha1;\\\\nhash.sha256 = hash.sha.sha256;\\\\nhash.sha224 = hash.sha.sha224;\\\\nhash.sha384 = hash.sha.sha384;\\\\nhash.sha512 = hash.sha.sha512;\\\\nhash.ripemd160 = hash.ripemd.ripemd160;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash.js\\\\n// module id = 85\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash.js\\")},function(module,exports,__webpack_require__){eval(\\"\\\\nexports.pbkdf2 = __webpack_require__(298)\\\\n\\\\nexports.pbkdf2Sync = __webpack_require__(145)\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/pbkdf2/browser.js\\\\n// module id = 86\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/pbkdf2/browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(process, setImmediate, global) {// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n// A bit simpler than readable streams.\\\\n// Implement an async ._write(chunk, encoding, cb), and it\'ll handle all\\\\n// the drain event emission and buffering.\\\\n\\\\n\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar processNextTick = __webpack_require__(55).nextTick;\\\\n/*</replacement>*/\\\\n\\\\nmodule.exports = Writable;\\\\n\\\\n/* <replacement> */\\\\nfunction WriteReq(chunk, encoding, cb) {\\\\n  this.chunk = chunk;\\\\n  this.encoding = encoding;\\\\n  this.callback = cb;\\\\n  this.next = null;\\\\n}\\\\n\\\\n// It seems a linked list but it is not\\\\n// there will be only 2 of these for each stream\\\\nfunction CorkedRequest(state) {\\\\n  var _this = this;\\\\n\\\\n  this.next = null;\\\\n  this.entry = null;\\\\n  this.finish = function () {\\\\n    onCorkedFinish(_this, state);\\\\n  };\\\\n}\\\\n/* </replacement> */\\\\n\\\\n/*<replacement>*/\\\\nvar asyncWrite = !process.browser && [\'v0.10\', \'v0.9.\'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar Duplex;\\\\n/*</replacement>*/\\\\n\\\\nWritable.WritableState = WritableState;\\\\n\\\\n/*<replacement>*/\\\\nvar util = __webpack_require__(38);\\\\nutil.inherits = __webpack_require__(0);\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar internalUtil = {\\\\n  deprecate: __webpack_require__(332)\\\\n};\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar Stream = __webpack_require__(152);\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer;\\\\nvar OurUint8Array = global.Uint8Array || function () {};\\\\nfunction _uint8ArrayToBuffer(chunk) {\\\\n  return Buffer.from(chunk);\\\\n}\\\\nfunction _isUint8Array(obj) {\\\\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\\\\n}\\\\n\\\\n/*</replacement>*/\\\\n\\\\nvar destroyImpl = __webpack_require__(151);\\\\n\\\\nutil.inherits(Writable, Stream);\\\\n\\\\nfunction nop() {}\\\\n\\\\nfunction WritableState(options, stream) {\\\\n  Duplex = Duplex || __webpack_require__(24);\\\\n\\\\n  options = options || {};\\\\n\\\\n  // Duplex streams are both readable and writable, but share\\\\n  // the same options object.\\\\n  // However, some cases require setting options to different\\\\n  // values for the readable and the writable sides of the duplex stream.\\\\n  // These options can be provided separately as readableXXX and writableXXX.\\\\n  var isDuplex = stream instanceof Duplex;\\\\n\\\\n  // object stream flag to indicate whether or not this stream\\\\n  // contains buffers or objects.\\\\n  this.objectMode = !!options.objectMode;\\\\n\\\\n  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;\\\\n\\\\n  // the point at which write() starts returning false\\\\n  // Note: 0 is a valid value, means that we always return false if\\\\n  // the entire buffer is not flushed immediately on write()\\\\n  var hwm = options.highWaterMark;\\\\n  var writableHwm = options.writableHighWaterMark;\\\\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\\\\n\\\\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;\\\\n\\\\n  // cast to ints.\\\\n  this.highWaterMark = Math.floor(this.highWaterMark);\\\\n\\\\n  // if _final has been called\\\\n  this.finalCalled = false;\\\\n\\\\n  // drain event flag.\\\\n  this.needDrain = false;\\\\n  // at the start of calling end()\\\\n  this.ending = false;\\\\n  // when end() has been called, and returned\\\\n  this.ended = false;\\\\n  // when \'finish\' is emitted\\\\n  this.finished = false;\\\\n\\\\n  // has it been destroyed\\\\n  this.destroyed = false;\\\\n\\\\n  // should we decode strings into buffers before passing to _write?\\\\n  // this is here so that some node-core streams can optimize string\\\\n  // handling at a lower level.\\\\n  var noDecode = options.decodeStrings === false;\\\\n  this.decodeStrings = !noDecode;\\\\n\\\\n  // Crypto is kind of old and crusty.  Historically, its default string\\\\n  // encoding is \'binary\' so we have to make this configurable.\\\\n  // Everything else in the universe uses \'utf8\', though.\\\\n  this.defaultEncoding = options.defaultEncoding || \'utf8\';\\\\n\\\\n  // not an actual buffer we keep track of, but a measurement\\\\n  // of how much we\'re waiting to get pushed to some underlying\\\\n  // socket or file.\\\\n  this.length = 0;\\\\n\\\\n  // a flag to see when we\'re in the middle of a write.\\\\n  this.writing = false;\\\\n\\\\n  // when true all writes will be buffered until .uncork() call\\\\n  this.corked = 0;\\\\n\\\\n  // a flag to be able to tell if the onwrite cb is called immediately,\\\\n  // or on a later tick.  We set this to true at first, because any\\\\n  // actions that shouldn\'t happen until \\\\\\"later\\\\\\" should generally also\\\\n  // not happen before the first write call.\\\\n  this.sync = true;\\\\n\\\\n  // a flag to know if we\'re processing previously buffered items, which\\\\n  // may call the _write() callback in the same tick, so that we don\'t\\\\n  // end up in an overlapped onwrite situation.\\\\n  this.bufferProcessing = false;\\\\n\\\\n  // the callback that\'s passed to _write(chunk,cb)\\\\n  this.onwrite = function (er) {\\\\n    onwrite(stream, er);\\\\n  };\\\\n\\\\n  // the callback that the user supplies to write(chunk,encoding,cb)\\\\n  this.writecb = null;\\\\n\\\\n  // the amount that is being written when _write is called.\\\\n  this.writelen = 0;\\\\n\\\\n  this.bufferedRequest = null;\\\\n  this.lastBufferedRequest = null;\\\\n\\\\n  // number of pending user-supplied write callbacks\\\\n  // this must be 0 before \'finish\' can be emitted\\\\n  this.pendingcb = 0;\\\\n\\\\n  // emit prefinish if the only thing we\'re waiting for is _write cbs\\\\n  // This is relevant for synchronous Transform streams\\\\n  this.prefinished = false;\\\\n\\\\n  // True if the error was already emitted and should not be thrown again\\\\n  this.errorEmitted = false;\\\\n\\\\n  // count buffered requests\\\\n  this.bufferedRequestCount = 0;\\\\n\\\\n  // allocate the first CorkedRequest, there is always\\\\n  // one allocated and free to use, and we maintain at most two\\\\n  this.corkedRequestsFree = new CorkedRequest(this);\\\\n}\\\\n\\\\nWritableState.prototype.getBuffer = function getBuffer() {\\\\n  var current = this.bufferedRequest;\\\\n  var out = [];\\\\n  while (current) {\\\\n    out.push(current);\\\\n    current = current.next;\\\\n  }\\\\n  return out;\\\\n};\\\\n\\\\n(function () {\\\\n  try {\\\\n    Object.defineProperty(WritableState.prototype, \'buffer\', {\\\\n      get: internalUtil.deprecate(function () {\\\\n        return this.getBuffer();\\\\n      }, \'_writableState.buffer is deprecated. Use _writableState.getBuffer \' + \'instead.\', \'DEP0003\')\\\\n    });\\\\n  } catch (_) {}\\\\n})();\\\\n\\\\n// Test _writableState for inheritance to account for Duplex streams,\\\\n// whose prototype chain only points to Readable.\\\\nvar realHasInstance;\\\\nif (typeof Symbol === \'function\' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === \'function\') {\\\\n  realHasInstance = Function.prototype[Symbol.hasInstance];\\\\n  Object.defineProperty(Writable, Symbol.hasInstance, {\\\\n    value: function (object) {\\\\n      if (realHasInstance.call(this, object)) return true;\\\\n      if (this !== Writable) return false;\\\\n\\\\n      return object && object._writableState instanceof WritableState;\\\\n    }\\\\n  });\\\\n} else {\\\\n  realHasInstance = function (object) {\\\\n    return object instanceof this;\\\\n  };\\\\n}\\\\n\\\\nfunction Writable(options) {\\\\n  Duplex = Duplex || __webpack_require__(24);\\\\n\\\\n  // Writable ctor is applied to Duplexes, too.\\\\n  // `realHasInstance` is necessary because using plain `instanceof`\\\\n  // would return false, as no `_writableState` property is attached.\\\\n\\\\n  // Trying to use the custom `instanceof` for Writable here will also break the\\\\n  // Node.js LazyTransform implementation, which has a non-trivial getter for\\\\n  // `_writableState` that would lead to infinite recursion.\\\\n  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {\\\\n    return new Writable(options);\\\\n  }\\\\n\\\\n  this._writableState = new WritableState(options, this);\\\\n\\\\n  // legacy.\\\\n  this.writable = true;\\\\n\\\\n  if (options) {\\\\n    if (typeof options.write === \'function\') this._write = options.write;\\\\n\\\\n    if (typeof options.writev === \'function\') this._writev = options.writev;\\\\n\\\\n    if (typeof options.destroy === \'function\') this._destroy = options.destroy;\\\\n\\\\n    if (typeof options.final === \'function\') this._final = options.final;\\\\n  }\\\\n\\\\n  Stream.call(this);\\\\n}\\\\n\\\\n// Otherwise people can pipe Writable streams, which is just wrong.\\\\nWritable.prototype.pipe = function () {\\\\n  this.emit(\'error\', new Error(\'Cannot pipe, not readable\'));\\\\n};\\\\n\\\\nfunction writeAfterEnd(stream, cb) {\\\\n  var er = new Error(\'write after end\');\\\\n  // TODO: defer error events consistently everywhere, not just the cb\\\\n  stream.emit(\'error\', er);\\\\n  processNextTick(cb, er);\\\\n}\\\\n\\\\n// Checks that a user-supplied chunk is valid, especially for the particular\\\\n// mode the stream is in. Currently this means that `null` is never accepted\\\\n// and undefined/non-string values are only allowed in object mode.\\\\nfunction validChunk(stream, state, chunk, cb) {\\\\n  var valid = true;\\\\n  var er = false;\\\\n\\\\n  if (chunk === null) {\\\\n    er = new TypeError(\'May not write null values to stream\');\\\\n  } else if (typeof chunk !== \'string\' && chunk !== undefined && !state.objectMode) {\\\\n    er = new TypeError(\'Invalid non-string/buffer chunk\');\\\\n  }\\\\n  if (er) {\\\\n    stream.emit(\'error\', er);\\\\n    processNextTick(cb, er);\\\\n    valid = false;\\\\n  }\\\\n  return valid;\\\\n}\\\\n\\\\nWritable.prototype.write = function (chunk, encoding, cb) {\\\\n  var state = this._writableState;\\\\n  var ret = false;\\\\n  var isBuf = !state.objectMode && _isUint8Array(chunk);\\\\n\\\\n  if (isBuf && !Buffer.isBuffer(chunk)) {\\\\n    chunk = _uint8ArrayToBuffer(chunk);\\\\n  }\\\\n\\\\n  if (typeof encoding === \'function\') {\\\\n    cb = encoding;\\\\n    encoding = null;\\\\n  }\\\\n\\\\n  if (isBuf) encoding = \'buffer\';else if (!encoding) encoding = state.defaultEncoding;\\\\n\\\\n  if (typeof cb !== \'function\') cb = nop;\\\\n\\\\n  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {\\\\n    state.pendingcb++;\\\\n    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);\\\\n  }\\\\n\\\\n  return ret;\\\\n};\\\\n\\\\nWritable.prototype.cork = function () {\\\\n  var state = this._writableState;\\\\n\\\\n  state.corked++;\\\\n};\\\\n\\\\nWritable.prototype.uncork = function () {\\\\n  var state = this._writableState;\\\\n\\\\n  if (state.corked) {\\\\n    state.corked--;\\\\n\\\\n    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);\\\\n  }\\\\n};\\\\n\\\\nWritable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {\\\\n  // node::ParseEncoding() requires lower case.\\\\n  if (typeof encoding === \'string\') encoding = encoding.toLowerCase();\\\\n  if (!([\'hex\', \'utf8\', \'utf-8\', \'ascii\', \'binary\', \'base64\', \'ucs2\', \'ucs-2\', \'utf16le\', \'utf-16le\', \'raw\'].indexOf((encoding + \'\').toLowerCase()) > -1)) throw new TypeError(\'Unknown encoding: \' + encoding);\\\\n  this._writableState.defaultEncoding = encoding;\\\\n  return this;\\\\n};\\\\n\\\\nfunction decodeChunk(state, chunk, encoding) {\\\\n  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === \'string\') {\\\\n    chunk = Buffer.from(chunk, encoding);\\\\n  }\\\\n  return chunk;\\\\n}\\\\n\\\\n// if we\'re already writing something, then just put this\\\\n// in the queue, and wait our turn.  Otherwise, call _write\\\\n// If we return false, then we need a drain event, so set that flag.\\\\nfunction writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {\\\\n  if (!isBuf) {\\\\n    var newChunk = decodeChunk(state, chunk, encoding);\\\\n    if (chunk !== newChunk) {\\\\n      isBuf = true;\\\\n      encoding = \'buffer\';\\\\n      chunk = newChunk;\\\\n    }\\\\n  }\\\\n  var len = state.objectMode ? 1 : chunk.length;\\\\n\\\\n  state.length += len;\\\\n\\\\n  var ret = state.length < state.highWaterMark;\\\\n  // we must ensure that previous needDrain will not be reset to false.\\\\n  if (!ret) state.needDrain = true;\\\\n\\\\n  if (state.writing || state.corked) {\\\\n    var last = state.lastBufferedRequest;\\\\n    state.lastBufferedRequest = {\\\\n      chunk: chunk,\\\\n      encoding: encoding,\\\\n      isBuf: isBuf,\\\\n      callback: cb,\\\\n      next: null\\\\n    };\\\\n    if (last) {\\\\n      last.next = state.lastBufferedRequest;\\\\n    } else {\\\\n      state.bufferedRequest = state.lastBufferedRequest;\\\\n    }\\\\n    state.bufferedRequestCount += 1;\\\\n  } else {\\\\n    doWrite(stream, state, false, len, chunk, encoding, cb);\\\\n  }\\\\n\\\\n  return ret;\\\\n}\\\\n\\\\nfunction doWrite(stream, state, writev, len, chunk, encoding, cb) {\\\\n  state.writelen = len;\\\\n  state.writecb = cb;\\\\n  state.writing = true;\\\\n  state.sync = true;\\\\n  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);\\\\n  state.sync = false;\\\\n}\\\\n\\\\nfunction onwriteError(stream, state, sync, er, cb) {\\\\n  --state.pendingcb;\\\\n\\\\n  if (sync) {\\\\n    // defer the callback if we are being called synchronously\\\\n    // to avoid piling up things on the stack\\\\n    processNextTick(cb, er);\\\\n    // this can emit finish, and it will always happen\\\\n    // after error\\\\n    processNextTick(finishMaybe, stream, state);\\\\n    stream._writableState.errorEmitted = true;\\\\n    stream.emit(\'error\', er);\\\\n  } else {\\\\n    // the caller expect this to happen before if\\\\n    // it is async\\\\n    cb(er);\\\\n    stream._writableState.errorEmitted = true;\\\\n    stream.emit(\'error\', er);\\\\n    // this can emit finish, but finish must\\\\n    // always follow error\\\\n    finishMaybe(stream, state);\\\\n  }\\\\n}\\\\n\\\\nfunction onwriteStateUpdate(state) {\\\\n  state.writing = false;\\\\n  state.writecb = null;\\\\n  state.length -= state.writelen;\\\\n  state.writelen = 0;\\\\n}\\\\n\\\\nfunction onwrite(stream, er) {\\\\n  var state = stream._writableState;\\\\n  var sync = state.sync;\\\\n  var cb = state.writecb;\\\\n\\\\n  onwriteStateUpdate(state);\\\\n\\\\n  if (er) onwriteError(stream, state, sync, er, cb);else {\\\\n    // Check if we\'re actually ready to finish, but don\'t emit yet\\\\n    var finished = needFinish(state);\\\\n\\\\n    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {\\\\n      clearBuffer(stream, state);\\\\n    }\\\\n\\\\n    if (sync) {\\\\n      /*<replacement>*/\\\\n      asyncWrite(afterWrite, stream, state, finished, cb);\\\\n      /*</replacement>*/\\\\n    } else {\\\\n      afterWrite(stream, state, finished, cb);\\\\n    }\\\\n  }\\\\n}\\\\n\\\\nfunction afterWrite(stream, state, finished, cb) {\\\\n  if (!finished) onwriteDrain(stream, state);\\\\n  state.pendingcb--;\\\\n  cb();\\\\n  finishMaybe(stream, state);\\\\n}\\\\n\\\\n// Must force callback to be called on nextTick, so that we don\'t\\\\n// emit \'drain\' before the write() consumer gets the \'false\' return\\\\n// value, and has a chance to attach a \'drain\' listener.\\\\nfunction onwriteDrain(stream, state) {\\\\n  if (state.length === 0 && state.needDrain) {\\\\n    state.needDrain = false;\\\\n    stream.emit(\'drain\');\\\\n  }\\\\n}\\\\n\\\\n// if there\'s something in the buffer waiting, then process it\\\\nfunction clearBuffer(stream, state) {\\\\n  state.bufferProcessing = true;\\\\n  var entry = state.bufferedRequest;\\\\n\\\\n  if (stream._writev && entry && entry.next) {\\\\n    // Fast case, write everything using _writev()\\\\n    var l = state.bufferedRequestCount;\\\\n    var buffer = new Array(l);\\\\n    var holder = state.corkedRequestsFree;\\\\n    holder.entry = entry;\\\\n\\\\n    var count = 0;\\\\n    var allBuffers = true;\\\\n    while (entry) {\\\\n      buffer[count] = entry;\\\\n      if (!entry.isBuf) allBuffers = false;\\\\n      entry = entry.next;\\\\n      count += 1;\\\\n    }\\\\n    buffer.allBuffers = allBuffers;\\\\n\\\\n    doWrite(stream, state, true, state.length, buffer, \'\', holder.finish);\\\\n\\\\n    // doWrite is almost always async, defer these to save a bit of time\\\\n    // as the hot path ends with doWrite\\\\n    state.pendingcb++;\\\\n    state.lastBufferedRequest = null;\\\\n    if (holder.next) {\\\\n      state.corkedRequestsFree = holder.next;\\\\n      holder.next = null;\\\\n    } else {\\\\n      state.corkedRequestsFree = new CorkedRequest(state);\\\\n    }\\\\n    state.bufferedRequestCount = 0;\\\\n  } else {\\\\n    // Slow case, write chunks one-by-one\\\\n    while (entry) {\\\\n      var chunk = entry.chunk;\\\\n      var encoding = entry.encoding;\\\\n      var cb = entry.callback;\\\\n      var len = state.objectMode ? 1 : chunk.length;\\\\n\\\\n      doWrite(stream, state, false, len, chunk, encoding, cb);\\\\n      entry = entry.next;\\\\n      state.bufferedRequestCount--;\\\\n      // if we didn\'t call the onwrite immediately, then\\\\n      // it means that we need to wait until it does.\\\\n      // also, that means that the chunk and cb are currently\\\\n      // being processed, so move the buffer counter past them.\\\\n      if (state.writing) {\\\\n        break;\\\\n      }\\\\n    }\\\\n\\\\n    if (entry === null) state.lastBufferedRequest = null;\\\\n  }\\\\n\\\\n  state.bufferedRequest = entry;\\\\n  state.bufferProcessing = false;\\\\n}\\\\n\\\\nWritable.prototype._write = function (chunk, encoding, cb) {\\\\n  cb(new Error(\'_write() is not implemented\'));\\\\n};\\\\n\\\\nWritable.prototype._writev = null;\\\\n\\\\nWritable.prototype.end = function (chunk, encoding, cb) {\\\\n  var state = this._writableState;\\\\n\\\\n  if (typeof chunk === \'function\') {\\\\n    cb = chunk;\\\\n    chunk = null;\\\\n    encoding = null;\\\\n  } else if (typeof encoding === \'function\') {\\\\n    cb = encoding;\\\\n    encoding = null;\\\\n  }\\\\n\\\\n  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);\\\\n\\\\n  // .end() fully uncorks\\\\n  if (state.corked) {\\\\n    state.corked = 1;\\\\n    this.uncork();\\\\n  }\\\\n\\\\n  // ignore unnecessary end() calls.\\\\n  if (!state.ending && !state.finished) endWritable(this, state, cb);\\\\n};\\\\n\\\\nfunction needFinish(state) {\\\\n  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;\\\\n}\\\\nfunction callFinal(stream, state) {\\\\n  stream._final(function (err) {\\\\n    state.pendingcb--;\\\\n    if (err) {\\\\n      stream.emit(\'error\', err);\\\\n    }\\\\n    state.prefinished = true;\\\\n    stream.emit(\'prefinish\');\\\\n    finishMaybe(stream, state);\\\\n  });\\\\n}\\\\nfunction prefinish(stream, state) {\\\\n  if (!state.prefinished && !state.finalCalled) {\\\\n    if (typeof stream._final === \'function\') {\\\\n      state.pendingcb++;\\\\n      state.finalCalled = true;\\\\n      processNextTick(callFinal, stream, state);\\\\n    } else {\\\\n      state.prefinished = true;\\\\n      stream.emit(\'prefinish\');\\\\n    }\\\\n  }\\\\n}\\\\n\\\\nfunction finishMaybe(stream, state) {\\\\n  var need = needFinish(state);\\\\n  if (need) {\\\\n    prefinish(stream, state);\\\\n    if (state.pendingcb === 0) {\\\\n      state.finished = true;\\\\n      stream.emit(\'finish\');\\\\n    }\\\\n  }\\\\n  return need;\\\\n}\\\\n\\\\nfunction endWritable(stream, state, cb) {\\\\n  state.ending = true;\\\\n  finishMaybe(stream, state);\\\\n  if (cb) {\\\\n    if (state.finished) processNextTick(cb);else stream.once(\'finish\', cb);\\\\n  }\\\\n  state.ended = true;\\\\n  stream.writable = false;\\\\n}\\\\n\\\\nfunction onCorkedFinish(corkReq, state, err) {\\\\n  var entry = corkReq.entry;\\\\n  corkReq.entry = null;\\\\n  while (entry) {\\\\n    var cb = entry.callback;\\\\n    state.pendingcb--;\\\\n    cb(err);\\\\n    entry = entry.next;\\\\n  }\\\\n  if (state.corkedRequestsFree) {\\\\n    state.corkedRequestsFree.next = corkReq;\\\\n  } else {\\\\n    state.corkedRequestsFree = corkReq;\\\\n  }\\\\n}\\\\n\\\\nObject.defineProperty(Writable.prototype, \'destroyed\', {\\\\n  get: function () {\\\\n    if (this._writableState === undefined) {\\\\n      return false;\\\\n    }\\\\n    return this._writableState.destroyed;\\\\n  },\\\\n  set: function (value) {\\\\n    // we ignore the value if the stream\\\\n    // has not been initialized yet\\\\n    if (!this._writableState) {\\\\n      return;\\\\n    }\\\\n\\\\n    // backward compatibility, the user is explicitly\\\\n    // managing destroyed\\\\n    this._writableState.destroyed = value;\\\\n  }\\\\n});\\\\n\\\\nWritable.prototype.destroy = destroyImpl.destroy;\\\\nWritable.prototype._undestroy = destroyImpl.undestroy;\\\\nWritable.prototype._destroy = function (err, cb) {\\\\n  this.end();\\\\n  cb(err);\\\\n};\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13), __webpack_require__(53).setImmediate, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/_stream_writable.js\\\\n// module id = 87\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/_stream_writable.js\\")},function(module,exports,__webpack_require__){eval(\\"exports = module.exports = __webpack_require__(149);\\\\nexports.Stream = exports;\\\\nexports.Readable = exports;\\\\nexports.Writable = __webpack_require__(87);\\\\nexports.Duplex = __webpack_require__(24);\\\\nexports.Transform = __webpack_require__(150);\\\\nexports.PassThrough = __webpack_require__(309);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/readable-browser.js\\\\n// module id = 88\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/readable-browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {\\\\nvar inherits = __webpack_require__(0)\\\\nvar HashBase = __webpack_require__(269)\\\\n\\\\nfunction RIPEMD160 () {\\\\n  HashBase.call(this, 64)\\\\n\\\\n  // state\\\\n  this._a = 0x67452301\\\\n  this._b = 0xefcdab89\\\\n  this._c = 0x98badcfe\\\\n  this._d = 0x10325476\\\\n  this._e = 0xc3d2e1f0\\\\n}\\\\n\\\\ninherits(RIPEMD160, HashBase)\\\\n\\\\nRIPEMD160.prototype._update = function () {\\\\n  var m = new Array(16)\\\\n  for (var i = 0; i < 16; ++i) m[i] = this._block.readInt32LE(i * 4)\\\\n\\\\n  var al = this._a\\\\n  var bl = this._b\\\\n  var cl = this._c\\\\n  var dl = this._d\\\\n  var el = this._e\\\\n\\\\n  // Mj = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\\\\n  // K = 0x00000000\\\\n  // Sj = 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8\\\\n  al = fn1(al, bl, cl, dl, el, m[0], 0x00000000, 11); cl = rotl(cl, 10)\\\\n  el = fn1(el, al, bl, cl, dl, m[1], 0x00000000, 14); bl = rotl(bl, 10)\\\\n  dl = fn1(dl, el, al, bl, cl, m[2], 0x00000000, 15); al = rotl(al, 10)\\\\n  cl = fn1(cl, dl, el, al, bl, m[3], 0x00000000, 12); el = rotl(el, 10)\\\\n  bl = fn1(bl, cl, dl, el, al, m[4], 0x00000000, 5); dl = rotl(dl, 10)\\\\n  al = fn1(al, bl, cl, dl, el, m[5], 0x00000000, 8); cl = rotl(cl, 10)\\\\n  el = fn1(el, al, bl, cl, dl, m[6], 0x00000000, 7); bl = rotl(bl, 10)\\\\n  dl = fn1(dl, el, al, bl, cl, m[7], 0x00000000, 9); al = rotl(al, 10)\\\\n  cl = fn1(cl, dl, el, al, bl, m[8], 0x00000000, 11); el = rotl(el, 10)\\\\n  bl = fn1(bl, cl, dl, el, al, m[9], 0x00000000, 13); dl = rotl(dl, 10)\\\\n  al = fn1(al, bl, cl, dl, el, m[10], 0x00000000, 14); cl = rotl(cl, 10)\\\\n  el = fn1(el, al, bl, cl, dl, m[11], 0x00000000, 15); bl = rotl(bl, 10)\\\\n  dl = fn1(dl, el, al, bl, cl, m[12], 0x00000000, 6); al = rotl(al, 10)\\\\n  cl = fn1(cl, dl, el, al, bl, m[13], 0x00000000, 7); el = rotl(el, 10)\\\\n  bl = fn1(bl, cl, dl, el, al, m[14], 0x00000000, 9); dl = rotl(dl, 10)\\\\n  al = fn1(al, bl, cl, dl, el, m[15], 0x00000000, 8); cl = rotl(cl, 10)\\\\n\\\\n  // Mj = 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8\\\\n  // K = 0x5a827999\\\\n  // Sj = 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12\\\\n  el = fn2(el, al, bl, cl, dl, m[7], 0x5a827999, 7); bl = rotl(bl, 10)\\\\n  dl = fn2(dl, el, al, bl, cl, m[4], 0x5a827999, 6); al = rotl(al, 10)\\\\n  cl = fn2(cl, dl, el, al, bl, m[13], 0x5a827999, 8); el = rotl(el, 10)\\\\n  bl = fn2(bl, cl, dl, el, al, m[1], 0x5a827999, 13); dl = rotl(dl, 10)\\\\n  al = fn2(al, bl, cl, dl, el, m[10], 0x5a827999, 11); cl = rotl(cl, 10)\\\\n  el = fn2(el, al, bl, cl, dl, m[6], 0x5a827999, 9); bl = rotl(bl, 10)\\\\n  dl = fn2(dl, el, al, bl, cl, m[15], 0x5a827999, 7); al = rotl(al, 10)\\\\n  cl = fn2(cl, dl, el, al, bl, m[3], 0x5a827999, 15); el = rotl(el, 10)\\\\n  bl = fn2(bl, cl, dl, el, al, m[12], 0x5a827999, 7); dl = rotl(dl, 10)\\\\n  al = fn2(al, bl, cl, dl, el, m[0], 0x5a827999, 12); cl = rotl(cl, 10)\\\\n  el = fn2(el, al, bl, cl, dl, m[9], 0x5a827999, 15); bl = rotl(bl, 10)\\\\n  dl = fn2(dl, el, al, bl, cl, m[5], 0x5a827999, 9); al = rotl(al, 10)\\\\n  cl = fn2(cl, dl, el, al, bl, m[2], 0x5a827999, 11); el = rotl(el, 10)\\\\n  bl = fn2(bl, cl, dl, el, al, m[14], 0x5a827999, 7); dl = rotl(dl, 10)\\\\n  al = fn2(al, bl, cl, dl, el, m[11], 0x5a827999, 13); cl = rotl(cl, 10)\\\\n  el = fn2(el, al, bl, cl, dl, m[8], 0x5a827999, 12); bl = rotl(bl, 10)\\\\n\\\\n  // Mj = 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12\\\\n  // K = 0x6ed9eba1\\\\n  // Sj = 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5\\\\n  dl = fn3(dl, el, al, bl, cl, m[3], 0x6ed9eba1, 11); al = rotl(al, 10)\\\\n  cl = fn3(cl, dl, el, al, bl, m[10], 0x6ed9eba1, 13); el = rotl(el, 10)\\\\n  bl = fn3(bl, cl, dl, el, al, m[14], 0x6ed9eba1, 6); dl = rotl(dl, 10)\\\\n  al = fn3(al, bl, cl, dl, el, m[4], 0x6ed9eba1, 7); cl = rotl(cl, 10)\\\\n  el = fn3(el, al, bl, cl, dl, m[9], 0x6ed9eba1, 14); bl = rotl(bl, 10)\\\\n  dl = fn3(dl, el, al, bl, cl, m[15], 0x6ed9eba1, 9); al = rotl(al, 10)\\\\n  cl = fn3(cl, dl, el, al, bl, m[8], 0x6ed9eba1, 13); el = rotl(el, 10)\\\\n  bl = fn3(bl, cl, dl, el, al, m[1], 0x6ed9eba1, 15); dl = rotl(dl, 10)\\\\n  al = fn3(al, bl, cl, dl, el, m[2], 0x6ed9eba1, 14); cl = rotl(cl, 10)\\\\n  el = fn3(el, al, bl, cl, dl, m[7], 0x6ed9eba1, 8); bl = rotl(bl, 10)\\\\n  dl = fn3(dl, el, al, bl, cl, m[0], 0x6ed9eba1, 13); al = rotl(al, 10)\\\\n  cl = fn3(cl, dl, el, al, bl, m[6], 0x6ed9eba1, 6); el = rotl(el, 10)\\\\n  bl = fn3(bl, cl, dl, el, al, m[13], 0x6ed9eba1, 5); dl = rotl(dl, 10)\\\\n  al = fn3(al, bl, cl, dl, el, m[11], 0x6ed9eba1, 12); cl = rotl(cl, 10)\\\\n  el = fn3(el, al, bl, cl, dl, m[5], 0x6ed9eba1, 7); bl = rotl(bl, 10)\\\\n  dl = fn3(dl, el, al, bl, cl, m[12], 0x6ed9eba1, 5); al = rotl(al, 10)\\\\n\\\\n  // Mj = 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2\\\\n  // K = 0x8f1bbcdc\\\\n  // Sj = 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12\\\\n  cl = fn4(cl, dl, el, al, bl, m[1], 0x8f1bbcdc, 11); el = rotl(el, 10)\\\\n  bl = fn4(bl, cl, dl, el, al, m[9], 0x8f1bbcdc, 12); dl = rotl(dl, 10)\\\\n  al = fn4(al, bl, cl, dl, el, m[11], 0x8f1bbcdc, 14); cl = rotl(cl, 10)\\\\n  el = fn4(el, al, bl, cl, dl, m[10], 0x8f1bbcdc, 15); bl = rotl(bl, 10)\\\\n  dl = fn4(dl, el, al, bl, cl, m[0], 0x8f1bbcdc, 14); al = rotl(al, 10)\\\\n  cl = fn4(cl, dl, el, al, bl, m[8], 0x8f1bbcdc, 15); el = rotl(el, 10)\\\\n  bl = fn4(bl, cl, dl, el, al, m[12], 0x8f1bbcdc, 9); dl = rotl(dl, 10)\\\\n  al = fn4(al, bl, cl, dl, el, m[4], 0x8f1bbcdc, 8); cl = rotl(cl, 10)\\\\n  el = fn4(el, al, bl, cl, dl, m[13], 0x8f1bbcdc, 9); bl = rotl(bl, 10)\\\\n  dl = fn4(dl, el, al, bl, cl, m[3], 0x8f1bbcdc, 14); al = rotl(al, 10)\\\\n  cl = fn4(cl, dl, el, al, bl, m[7], 0x8f1bbcdc, 5); el = rotl(el, 10)\\\\n  bl = fn4(bl, cl, dl, el, al, m[15], 0x8f1bbcdc, 6); dl = rotl(dl, 10)\\\\n  al = fn4(al, bl, cl, dl, el, m[14], 0x8f1bbcdc, 8); cl = rotl(cl, 10)\\\\n  el = fn4(el, al, bl, cl, dl, m[5], 0x8f1bbcdc, 6); bl = rotl(bl, 10)\\\\n  dl = fn4(dl, el, al, bl, cl, m[6], 0x8f1bbcdc, 5); al = rotl(al, 10)\\\\n  cl = fn4(cl, dl, el, al, bl, m[2], 0x8f1bbcdc, 12); el = rotl(el, 10)\\\\n\\\\n  // Mj = 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\\\\n  // K = 0xa953fd4e\\\\n  // Sj = 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\\\\n  bl = fn5(bl, cl, dl, el, al, m[4], 0xa953fd4e, 9); dl = rotl(dl, 10)\\\\n  al = fn5(al, bl, cl, dl, el, m[0], 0xa953fd4e, 15); cl = rotl(cl, 10)\\\\n  el = fn5(el, al, bl, cl, dl, m[5], 0xa953fd4e, 5); bl = rotl(bl, 10)\\\\n  dl = fn5(dl, el, al, bl, cl, m[9], 0xa953fd4e, 11); al = rotl(al, 10)\\\\n  cl = fn5(cl, dl, el, al, bl, m[7], 0xa953fd4e, 6); el = rotl(el, 10)\\\\n  bl = fn5(bl, cl, dl, el, al, m[12], 0xa953fd4e, 8); dl = rotl(dl, 10)\\\\n  al = fn5(al, bl, cl, dl, el, m[2], 0xa953fd4e, 13); cl = rotl(cl, 10)\\\\n  el = fn5(el, al, bl, cl, dl, m[10], 0xa953fd4e, 12); bl = rotl(bl, 10)\\\\n  dl = fn5(dl, el, al, bl, cl, m[14], 0xa953fd4e, 5); al = rotl(al, 10)\\\\n  cl = fn5(cl, dl, el, al, bl, m[1], 0xa953fd4e, 12); el = rotl(el, 10)\\\\n  bl = fn5(bl, cl, dl, el, al, m[3], 0xa953fd4e, 13); dl = rotl(dl, 10)\\\\n  al = fn5(al, bl, cl, dl, el, m[8], 0xa953fd4e, 14); cl = rotl(cl, 10)\\\\n  el = fn5(el, al, bl, cl, dl, m[11], 0xa953fd4e, 11); bl = rotl(bl, 10)\\\\n  dl = fn5(dl, el, al, bl, cl, m[6], 0xa953fd4e, 8); al = rotl(al, 10)\\\\n  cl = fn5(cl, dl, el, al, bl, m[15], 0xa953fd4e, 5); el = rotl(el, 10)\\\\n  bl = fn5(bl, cl, dl, el, al, m[13], 0xa953fd4e, 6); dl = rotl(dl, 10)\\\\n\\\\n  var ar = this._a\\\\n  var br = this._b\\\\n  var cr = this._c\\\\n  var dr = this._d\\\\n  var er = this._e\\\\n\\\\n  // M\'j = 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12\\\\n  // K\' = 0x50a28be6\\\\n  // S\'j = 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6\\\\n  ar = fn5(ar, br, cr, dr, er, m[5], 0x50a28be6, 8); cr = rotl(cr, 10)\\\\n  er = fn5(er, ar, br, cr, dr, m[14], 0x50a28be6, 9); br = rotl(br, 10)\\\\n  dr = fn5(dr, er, ar, br, cr, m[7], 0x50a28be6, 9); ar = rotl(ar, 10)\\\\n  cr = fn5(cr, dr, er, ar, br, m[0], 0x50a28be6, 11); er = rotl(er, 10)\\\\n  br = fn5(br, cr, dr, er, ar, m[9], 0x50a28be6, 13); dr = rotl(dr, 10)\\\\n  ar = fn5(ar, br, cr, dr, er, m[2], 0x50a28be6, 15); cr = rotl(cr, 10)\\\\n  er = fn5(er, ar, br, cr, dr, m[11], 0x50a28be6, 15); br = rotl(br, 10)\\\\n  dr = fn5(dr, er, ar, br, cr, m[4], 0x50a28be6, 5); ar = rotl(ar, 10)\\\\n  cr = fn5(cr, dr, er, ar, br, m[13], 0x50a28be6, 7); er = rotl(er, 10)\\\\n  br = fn5(br, cr, dr, er, ar, m[6], 0x50a28be6, 7); dr = rotl(dr, 10)\\\\n  ar = fn5(ar, br, cr, dr, er, m[15], 0x50a28be6, 8); cr = rotl(cr, 10)\\\\n  er = fn5(er, ar, br, cr, dr, m[8], 0x50a28be6, 11); br = rotl(br, 10)\\\\n  dr = fn5(dr, er, ar, br, cr, m[1], 0x50a28be6, 14); ar = rotl(ar, 10)\\\\n  cr = fn5(cr, dr, er, ar, br, m[10], 0x50a28be6, 14); er = rotl(er, 10)\\\\n  br = fn5(br, cr, dr, er, ar, m[3], 0x50a28be6, 12); dr = rotl(dr, 10)\\\\n  ar = fn5(ar, br, cr, dr, er, m[12], 0x50a28be6, 6); cr = rotl(cr, 10)\\\\n\\\\n  // M\'j = 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2\\\\n  // K\' = 0x5c4dd124\\\\n  // S\'j = 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11\\\\n  er = fn4(er, ar, br, cr, dr, m[6], 0x5c4dd124, 9); br = rotl(br, 10)\\\\n  dr = fn4(dr, er, ar, br, cr, m[11], 0x5c4dd124, 13); ar = rotl(ar, 10)\\\\n  cr = fn4(cr, dr, er, ar, br, m[3], 0x5c4dd124, 15); er = rotl(er, 10)\\\\n  br = fn4(br, cr, dr, er, ar, m[7], 0x5c4dd124, 7); dr = rotl(dr, 10)\\\\n  ar = fn4(ar, br, cr, dr, er, m[0], 0x5c4dd124, 12); cr = rotl(cr, 10)\\\\n  er = fn4(er, ar, br, cr, dr, m[13], 0x5c4dd124, 8); br = rotl(br, 10)\\\\n  dr = fn4(dr, er, ar, br, cr, m[5], 0x5c4dd124, 9); ar = rotl(ar, 10)\\\\n  cr = fn4(cr, dr, er, ar, br, m[10], 0x5c4dd124, 11); er = rotl(er, 10)\\\\n  br = fn4(br, cr, dr, er, ar, m[14], 0x5c4dd124, 7); dr = rotl(dr, 10)\\\\n  ar = fn4(ar, br, cr, dr, er, m[15], 0x5c4dd124, 7); cr = rotl(cr, 10)\\\\n  er = fn4(er, ar, br, cr, dr, m[8], 0x5c4dd124, 12); br = rotl(br, 10)\\\\n  dr = fn4(dr, er, ar, br, cr, m[12], 0x5c4dd124, 7); ar = rotl(ar, 10)\\\\n  cr = fn4(cr, dr, er, ar, br, m[4], 0x5c4dd124, 6); er = rotl(er, 10)\\\\n  br = fn4(br, cr, dr, er, ar, m[9], 0x5c4dd124, 15); dr = rotl(dr, 10)\\\\n  ar = fn4(ar, br, cr, dr, er, m[1], 0x5c4dd124, 13); cr = rotl(cr, 10)\\\\n  er = fn4(er, ar, br, cr, dr, m[2], 0x5c4dd124, 11); br = rotl(br, 10)\\\\n\\\\n  // M\'j = 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13\\\\n  // K\' = 0x6d703ef3\\\\n  // S\'j = 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5\\\\n  dr = fn3(dr, er, ar, br, cr, m[15], 0x6d703ef3, 9); ar = rotl(ar, 10)\\\\n  cr = fn3(cr, dr, er, ar, br, m[5], 0x6d703ef3, 7); er = rotl(er, 10)\\\\n  br = fn3(br, cr, dr, er, ar, m[1], 0x6d703ef3, 15); dr = rotl(dr, 10)\\\\n  ar = fn3(ar, br, cr, dr, er, m[3], 0x6d703ef3, 11); cr = rotl(cr, 10)\\\\n  er = fn3(er, ar, br, cr, dr, m[7], 0x6d703ef3, 8); br = rotl(br, 10)\\\\n  dr = fn3(dr, er, ar, br, cr, m[14], 0x6d703ef3, 6); ar = rotl(ar, 10)\\\\n  cr = fn3(cr, dr, er, ar, br, m[6], 0x6d703ef3, 6); er = rotl(er, 10)\\\\n  br = fn3(br, cr, dr, er, ar, m[9], 0x6d703ef3, 14); dr = rotl(dr, 10)\\\\n  ar = fn3(ar, br, cr, dr, er, m[11], 0x6d703ef3, 12); cr = rotl(cr, 10)\\\\n  er = fn3(er, ar, br, cr, dr, m[8], 0x6d703ef3, 13); br = rotl(br, 10)\\\\n  dr = fn3(dr, er, ar, br, cr, m[12], 0x6d703ef3, 5); ar = rotl(ar, 10)\\\\n  cr = fn3(cr, dr, er, ar, br, m[2], 0x6d703ef3, 14); er = rotl(er, 10)\\\\n  br = fn3(br, cr, dr, er, ar, m[10], 0x6d703ef3, 13); dr = rotl(dr, 10)\\\\n  ar = fn3(ar, br, cr, dr, er, m[0], 0x6d703ef3, 13); cr = rotl(cr, 10)\\\\n  er = fn3(er, ar, br, cr, dr, m[4], 0x6d703ef3, 7); br = rotl(br, 10)\\\\n  dr = fn3(dr, er, ar, br, cr, m[13], 0x6d703ef3, 5); ar = rotl(ar, 10)\\\\n\\\\n  // M\'j = 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14\\\\n  // K\' = 0x7a6d76e9\\\\n  // S\'j = 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8\\\\n  cr = fn2(cr, dr, er, ar, br, m[8], 0x7a6d76e9, 15); er = rotl(er, 10)\\\\n  br = fn2(br, cr, dr, er, ar, m[6], 0x7a6d76e9, 5); dr = rotl(dr, 10)\\\\n  ar = fn2(ar, br, cr, dr, er, m[4], 0x7a6d76e9, 8); cr = rotl(cr, 10)\\\\n  er = fn2(er, ar, br, cr, dr, m[1], 0x7a6d76e9, 11); br = rotl(br, 10)\\\\n  dr = fn2(dr, er, ar, br, cr, m[3], 0x7a6d76e9, 14); ar = rotl(ar, 10)\\\\n  cr = fn2(cr, dr, er, ar, br, m[11], 0x7a6d76e9, 14); er = rotl(er, 10)\\\\n  br = fn2(br, cr, dr, er, ar, m[15], 0x7a6d76e9, 6); dr = rotl(dr, 10)\\\\n  ar = fn2(ar, br, cr, dr, er, m[0], 0x7a6d76e9, 14); cr = rotl(cr, 10)\\\\n  er = fn2(er, ar, br, cr, dr, m[5], 0x7a6d76e9, 6); br = rotl(br, 10)\\\\n  dr = fn2(dr, er, ar, br, cr, m[12], 0x7a6d76e9, 9); ar = rotl(ar, 10)\\\\n  cr = fn2(cr, dr, er, ar, br, m[2], 0x7a6d76e9, 12); er = rotl(er, 10)\\\\n  br = fn2(br, cr, dr, er, ar, m[13], 0x7a6d76e9, 9); dr = rotl(dr, 10)\\\\n  ar = fn2(ar, br, cr, dr, er, m[9], 0x7a6d76e9, 12); cr = rotl(cr, 10)\\\\n  er = fn2(er, ar, br, cr, dr, m[7], 0x7a6d76e9, 5); br = rotl(br, 10)\\\\n  dr = fn2(dr, er, ar, br, cr, m[10], 0x7a6d76e9, 15); ar = rotl(ar, 10)\\\\n  cr = fn2(cr, dr, er, ar, br, m[14], 0x7a6d76e9, 8); er = rotl(er, 10)\\\\n\\\\n  // M\'j = 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\\\\n  // K\' = 0x00000000\\\\n  // S\'j = 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\\\\n  br = fn1(br, cr, dr, er, ar, m[12], 0x00000000, 8); dr = rotl(dr, 10)\\\\n  ar = fn1(ar, br, cr, dr, er, m[15], 0x00000000, 5); cr = rotl(cr, 10)\\\\n  er = fn1(er, ar, br, cr, dr, m[10], 0x00000000, 12); br = rotl(br, 10)\\\\n  dr = fn1(dr, er, ar, br, cr, m[4], 0x00000000, 9); ar = rotl(ar, 10)\\\\n  cr = fn1(cr, dr, er, ar, br, m[1], 0x00000000, 12); er = rotl(er, 10)\\\\n  br = fn1(br, cr, dr, er, ar, m[5], 0x00000000, 5); dr = rotl(dr, 10)\\\\n  ar = fn1(ar, br, cr, dr, er, m[8], 0x00000000, 14); cr = rotl(cr, 10)\\\\n  er = fn1(er, ar, br, cr, dr, m[7], 0x00000000, 6); br = rotl(br, 10)\\\\n  dr = fn1(dr, er, ar, br, cr, m[6], 0x00000000, 8); ar = rotl(ar, 10)\\\\n  cr = fn1(cr, dr, er, ar, br, m[2], 0x00000000, 13); er = rotl(er, 10)\\\\n  br = fn1(br, cr, dr, er, ar, m[13], 0x00000000, 6); dr = rotl(dr, 10)\\\\n  ar = fn1(ar, br, cr, dr, er, m[14], 0x00000000, 5); cr = rotl(cr, 10)\\\\n  er = fn1(er, ar, br, cr, dr, m[0], 0x00000000, 15); br = rotl(br, 10)\\\\n  dr = fn1(dr, er, ar, br, cr, m[3], 0x00000000, 13); ar = rotl(ar, 10)\\\\n  cr = fn1(cr, dr, er, ar, br, m[9], 0x00000000, 11); er = rotl(er, 10)\\\\n  br = fn1(br, cr, dr, er, ar, m[11], 0x00000000, 11); dr = rotl(dr, 10)\\\\n\\\\n  // change state\\\\n  var t = (this._b + cl + dr) | 0\\\\n  this._b = (this._c + dl + er) | 0\\\\n  this._c = (this._d + el + ar) | 0\\\\n  this._d = (this._e + al + br) | 0\\\\n  this._e = (this._a + bl + cr) | 0\\\\n  this._a = t\\\\n}\\\\n\\\\nRIPEMD160.prototype._digest = function () {\\\\n  // create padding and handle blocks\\\\n  this._block[this._blockOffset++] = 0x80\\\\n  if (this._blockOffset > 56) {\\\\n    this._block.fill(0, this._blockOffset, 64)\\\\n    this._update()\\\\n    this._blockOffset = 0\\\\n  }\\\\n\\\\n  this._block.fill(0, this._blockOffset, 56)\\\\n  this._block.writeUInt32LE(this._length[0], 56)\\\\n  this._block.writeUInt32LE(this._length[1], 60)\\\\n  this._update()\\\\n\\\\n  // produce result\\\\n  var buffer = new Buffer(20)\\\\n  buffer.writeInt32LE(this._a, 0)\\\\n  buffer.writeInt32LE(this._b, 4)\\\\n  buffer.writeInt32LE(this._c, 8)\\\\n  buffer.writeInt32LE(this._d, 12)\\\\n  buffer.writeInt32LE(this._e, 16)\\\\n  return buffer\\\\n}\\\\n\\\\nfunction rotl (x, n) {\\\\n  return (x << n) | (x >>> (32 - n))\\\\n}\\\\n\\\\nfunction fn1 (a, b, c, d, e, m, k, s) {\\\\n  return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + e) | 0\\\\n}\\\\n\\\\nfunction fn2 (a, b, c, d, e, m, k, s) {\\\\n  return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + e) | 0\\\\n}\\\\n\\\\nfunction fn3 (a, b, c, d, e, m, k, s) {\\\\n  return (rotl((a + ((b | (~c)) ^ d) + m + k) | 0, s) + e) | 0\\\\n}\\\\n\\\\nfunction fn4 (a, b, c, d, e, m, k, s) {\\\\n  return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + e) | 0\\\\n}\\\\n\\\\nfunction fn5 (a, b, c, d, e, m, k, s) {\\\\n  return (rotl((a + (b ^ (c | (~d))) + m + k) | 0, s) + e) | 0\\\\n}\\\\n\\\\nmodule.exports = RIPEMD160\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/ripemd160/index.js\\\\n// module id = 89\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/ripemd160/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var exports = module.exports = function SHA (algorithm) {\\\\n  algorithm = algorithm.toLowerCase()\\\\n\\\\n  var Algorithm = exports[algorithm]\\\\n  if (!Algorithm) throw new Error(algorithm + \' is not supported (we accept pull requests)\')\\\\n\\\\n  return new Algorithm()\\\\n}\\\\n\\\\nexports.sha = __webpack_require__(319)\\\\nexports.sha1 = __webpack_require__(320)\\\\nexports.sha224 = __webpack_require__(321)\\\\nexports.sha256 = __webpack_require__(153)\\\\nexports.sha384 = __webpack_require__(322)\\\\nexports.sha512 = __webpack_require__(154)\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/index.js\\\\n// module id = 90\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer;\\\\n/*</replacement>*/\\\\n\\\\nvar isEncoding = Buffer.isEncoding || function (encoding) {\\\\n  encoding = \'\' + encoding;\\\\n  switch (encoding && encoding.toLowerCase()) {\\\\n    case \'hex\':case \'utf8\':case \'utf-8\':case \'ascii\':case \'binary\':case \'base64\':case \'ucs2\':case \'ucs-2\':case \'utf16le\':case \'utf-16le\':case \'raw\':\\\\n      return true;\\\\n    default:\\\\n      return false;\\\\n  }\\\\n};\\\\n\\\\nfunction _normalizeEncoding(enc) {\\\\n  if (!enc) return \'utf8\';\\\\n  var retried;\\\\n  while (true) {\\\\n    switch (enc) {\\\\n      case \'utf8\':\\\\n      case \'utf-8\':\\\\n        return \'utf8\';\\\\n      case \'ucs2\':\\\\n      case \'ucs-2\':\\\\n      case \'utf16le\':\\\\n      case \'utf-16le\':\\\\n        return \'utf16le\';\\\\n      case \'latin1\':\\\\n      case \'binary\':\\\\n        return \'latin1\';\\\\n      case \'base64\':\\\\n      case \'ascii\':\\\\n      case \'hex\':\\\\n        return enc;\\\\n      default:\\\\n        if (retried) return; // undefined\\\\n        enc = (\'\' + enc).toLowerCase();\\\\n        retried = true;\\\\n    }\\\\n  }\\\\n};\\\\n\\\\n// Do not cache `Buffer.isEncoding` when checking encoding names as some\\\\n// modules monkey-patch it to support additional encodings\\\\nfunction normalizeEncoding(enc) {\\\\n  var nenc = _normalizeEncoding(enc);\\\\n  if (typeof nenc !== \'string\' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error(\'Unknown encoding: \' + enc);\\\\n  return nenc || enc;\\\\n}\\\\n\\\\n// StringDecoder provides an interface for efficiently splitting a series of\\\\n// buffers into a series of JS strings without breaking apart multi-byte\\\\n// characters.\\\\nexports.StringDecoder = StringDecoder;\\\\nfunction StringDecoder(encoding) {\\\\n  this.encoding = normalizeEncoding(encoding);\\\\n  var nb;\\\\n  switch (this.encoding) {\\\\n    case \'utf16le\':\\\\n      this.text = utf16Text;\\\\n      this.end = utf16End;\\\\n      nb = 4;\\\\n      break;\\\\n    case \'utf8\':\\\\n      this.fillLast = utf8FillLast;\\\\n      nb = 4;\\\\n      break;\\\\n    case \'base64\':\\\\n      this.text = base64Text;\\\\n      this.end = base64End;\\\\n      nb = 3;\\\\n      break;\\\\n    default:\\\\n      this.write = simpleWrite;\\\\n      this.end = simpleEnd;\\\\n      return;\\\\n  }\\\\n  this.lastNeed = 0;\\\\n  this.lastTotal = 0;\\\\n  this.lastChar = Buffer.allocUnsafe(nb);\\\\n}\\\\n\\\\nStringDecoder.prototype.write = function (buf) {\\\\n  if (buf.length === 0) return \'\';\\\\n  var r;\\\\n  var i;\\\\n  if (this.lastNeed) {\\\\n    r = this.fillLast(buf);\\\\n    if (r === undefined) return \'\';\\\\n    i = this.lastNeed;\\\\n    this.lastNeed = 0;\\\\n  } else {\\\\n    i = 0;\\\\n  }\\\\n  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);\\\\n  return r || \'\';\\\\n};\\\\n\\\\nStringDecoder.prototype.end = utf8End;\\\\n\\\\n// Returns only complete characters in a Buffer\\\\nStringDecoder.prototype.text = utf8Text;\\\\n\\\\n// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer\\\\nStringDecoder.prototype.fillLast = function (buf) {\\\\n  if (this.lastNeed <= buf.length) {\\\\n    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);\\\\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\\\\n  }\\\\n  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);\\\\n  this.lastNeed -= buf.length;\\\\n};\\\\n\\\\n// Checks the type of a UTF-8 byte, whether it\'s ASCII, a leading byte, or a\\\\n// continuation byte. If an invalid byte is detected, -2 is returned.\\\\nfunction utf8CheckByte(byte) {\\\\n  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\\\\n  return byte >> 6 === 0x02 ? -1 : -2;\\\\n}\\\\n\\\\n// Checks at most 3 bytes at the end of a Buffer in order to detect an\\\\n// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)\\\\n// needed to complete the UTF-8 character (if applicable) are returned.\\\\nfunction utf8CheckIncomplete(self, buf, i) {\\\\n  var j = buf.length - 1;\\\\n  if (j < i) return 0;\\\\n  var nb = utf8CheckByte(buf[j]);\\\\n  if (nb >= 0) {\\\\n    if (nb > 0) self.lastNeed = nb - 1;\\\\n    return nb;\\\\n  }\\\\n  if (--j < i || nb === -2) return 0;\\\\n  nb = utf8CheckByte(buf[j]);\\\\n  if (nb >= 0) {\\\\n    if (nb > 0) self.lastNeed = nb - 2;\\\\n    return nb;\\\\n  }\\\\n  if (--j < i || nb === -2) return 0;\\\\n  nb = utf8CheckByte(buf[j]);\\\\n  if (nb >= 0) {\\\\n    if (nb > 0) {\\\\n      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;\\\\n    }\\\\n    return nb;\\\\n  }\\\\n  return 0;\\\\n}\\\\n\\\\n// Validates as many continuation bytes for a multi-byte UTF-8 character as\\\\n// needed or are available. If we see a non-continuation byte where we expect\\\\n// one, we \\\\\\"replace\\\\\\" the validated continuation bytes we\'ve seen so far with\\\\n// a single UTF-8 replacement character (\'\\\\\\\\ufffd\'), to match v8\'s UTF-8 decoding\\\\n// behavior. The continuation byte check is included three times in the case\\\\n// where all of the continuation bytes for a character exist in the same buffer.\\\\n// It is also done this way as a slight performance increase instead of using a\\\\n// loop.\\\\nfunction utf8CheckExtraBytes(self, buf, p) {\\\\n  if ((buf[0] & 0xC0) !== 0x80) {\\\\n    self.lastNeed = 0;\\\\n    return \'\\\\\\\\ufffd\';\\\\n  }\\\\n  if (self.lastNeed > 1 && buf.length > 1) {\\\\n    if ((buf[1] & 0xC0) !== 0x80) {\\\\n      self.lastNeed = 1;\\\\n      return \'\\\\\\\\ufffd\';\\\\n    }\\\\n    if (self.lastNeed > 2 && buf.length > 2) {\\\\n      if ((buf[2] & 0xC0) !== 0x80) {\\\\n        self.lastNeed = 2;\\\\n        return \'\\\\\\\\ufffd\';\\\\n      }\\\\n    }\\\\n  }\\\\n}\\\\n\\\\n// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.\\\\nfunction utf8FillLast(buf) {\\\\n  var p = this.lastTotal - this.lastNeed;\\\\n  var r = utf8CheckExtraBytes(this, buf, p);\\\\n  if (r !== undefined) return r;\\\\n  if (this.lastNeed <= buf.length) {\\\\n    buf.copy(this.lastChar, p, 0, this.lastNeed);\\\\n    return this.lastChar.toString(this.encoding, 0, this.lastTotal);\\\\n  }\\\\n  buf.copy(this.lastChar, p, 0, buf.length);\\\\n  this.lastNeed -= buf.length;\\\\n}\\\\n\\\\n// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a\\\\n// partial character, the character\'s bytes are buffered until the required\\\\n// number of bytes are available.\\\\nfunction utf8Text(buf, i) {\\\\n  var total = utf8CheckIncomplete(this, buf, i);\\\\n  if (!this.lastNeed) return buf.toString(\'utf8\', i);\\\\n  this.lastTotal = total;\\\\n  var end = buf.length - (total - this.lastNeed);\\\\n  buf.copy(this.lastChar, 0, end);\\\\n  return buf.toString(\'utf8\', i, end);\\\\n}\\\\n\\\\n// For UTF-8, a replacement character is added when ending on a partial\\\\n// character.\\\\nfunction utf8End(buf) {\\\\n  var r = buf && buf.length ? this.write(buf) : \'\';\\\\n  if (this.lastNeed) return r + \'\\\\\\\\ufffd\';\\\\n  return r;\\\\n}\\\\n\\\\n// UTF-16LE typically needs two bytes per character, but even if we have an even\\\\n// number of bytes available, we need to check if we end on a leading/high\\\\n// surrogate. In that case, we need to wait for the next two bytes in order to\\\\n// decode the last character properly.\\\\nfunction utf16Text(buf, i) {\\\\n  if ((buf.length - i) % 2 === 0) {\\\\n    var r = buf.toString(\'utf16le\', i);\\\\n    if (r) {\\\\n      var c = r.charCodeAt(r.length - 1);\\\\n      if (c >= 0xD800 && c <= 0xDBFF) {\\\\n        this.lastNeed = 2;\\\\n        this.lastTotal = 4;\\\\n        this.lastChar[0] = buf[buf.length - 2];\\\\n        this.lastChar[1] = buf[buf.length - 1];\\\\n        return r.slice(0, -1);\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n  this.lastNeed = 1;\\\\n  this.lastTotal = 2;\\\\n  this.lastChar[0] = buf[buf.length - 1];\\\\n  return buf.toString(\'utf16le\', i, buf.length - 1);\\\\n}\\\\n\\\\n// For UTF-16LE we do not explicitly append special replacement characters if we\\\\n// end on a partial character, we simply let v8 handle that.\\\\nfunction utf16End(buf) {\\\\n  var r = buf && buf.length ? this.write(buf) : \'\';\\\\n  if (this.lastNeed) {\\\\n    var end = this.lastTotal - this.lastNeed;\\\\n    return r + this.lastChar.toString(\'utf16le\', 0, end);\\\\n  }\\\\n  return r;\\\\n}\\\\n\\\\nfunction base64Text(buf, i) {\\\\n  var n = (buf.length - i) % 3;\\\\n  if (n === 0) return buf.toString(\'base64\', i);\\\\n  this.lastNeed = 3 - n;\\\\n  this.lastTotal = 3;\\\\n  if (n === 1) {\\\\n    this.lastChar[0] = buf[buf.length - 1];\\\\n  } else {\\\\n    this.lastChar[0] = buf[buf.length - 2];\\\\n    this.lastChar[1] = buf[buf.length - 1];\\\\n  }\\\\n  return buf.toString(\'base64\', i, buf.length - n);\\\\n}\\\\n\\\\nfunction base64End(buf) {\\\\n  var r = buf && buf.length ? this.write(buf) : \'\';\\\\n  if (this.lastNeed) return r + this.lastChar.toString(\'base64\', 0, 3 - this.lastNeed);\\\\n  return r;\\\\n}\\\\n\\\\n// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)\\\\nfunction simpleWrite(buf) {\\\\n  return buf.toString(this.encoding);\\\\n}\\\\n\\\\nfunction simpleEnd(buf) {\\\\n  return buf && buf.length ? this.write(buf) : \'\';\\\\n}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/string_decoder/lib/string_decoder.js\\\\n// module id = 91\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/string_decoder/lib/string_decoder.js\\")},function(module,exports,__webpack_require__){eval(\'var A = __webpack_require__(352);\\\\n\\\\nvar at = function at(bytes, index) {\\\\n  return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\\\\n};\\\\n\\\\nvar random = function random(bytes) {\\\\n  var rnd = void 0;\\\\n  if (typeof window !== \\"undefined\\" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(40).randomBytes(bytes);else throw \\"Safe random numbers not available.\\";\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0; i < bytes; ++i) {\\\\n    hex += (\\"00\\" + rnd[i].toString(16)).slice(-2);\\\\n  }return hex;\\\\n};\\\\n\\\\nvar length = function length(a) {\\\\n  return (a.length - 2) / 2;\\\\n};\\\\n\\\\nvar flatten = function flatten(a) {\\\\n  return \\"0x\\" + a.reduce(function (r, s) {\\\\n    return r + s.slice(2);\\\\n  }, \\"\\");\\\\n};\\\\n\\\\nvar slice = function slice(i, j, bs) {\\\\n  return \\"0x\\" + bs.slice(i * 2 + 2, j * 2 + 2);\\\\n};\\\\n\\\\nvar reverse = function reverse(hex) {\\\\n  var rev = \\"0x\\";\\\\n  for (var i = 0, l = length(hex); i < l; ++i) {\\\\n    rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\\\\n  }\\\\n  return rev;\\\\n};\\\\n\\\\nvar pad = function pad(l, hex) {\\\\n  return hex.length === l * 2 + 2 ? hex : pad(l, \\"0x\\" + \\"0\\" + hex.slice(2));\\\\n};\\\\n\\\\nvar padRight = function padRight(l, hex) {\\\\n  return hex.length === l * 2 + 2 ? hex : padRight(l, hex + \\"0\\");\\\\n};\\\\n\\\\nvar toArray = function toArray(hex) {\\\\n  var arr = [];\\\\n  for (var i = 2, l = hex.length; i < l; i += 2) {\\\\n    arr.push(parseInt(hex.slice(i, i + 2), 16));\\\\n  }return arr;\\\\n};\\\\n\\\\nvar fromArray = function fromArray(arr) {\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0, l = arr.length; i < l; ++i) {\\\\n    var b = arr[i];\\\\n    hex += (b < 16 ? \\"0\\" : \\"\\") + b.toString(16);\\\\n  }\\\\n  return hex;\\\\n};\\\\n\\\\nvar toUint8Array = function toUint8Array(hex) {\\\\n  return new Uint8Array(toArray(hex));\\\\n};\\\\n\\\\nvar fromUint8Array = function fromUint8Array(arr) {\\\\n  return fromArray([].slice.call(arr, 0));\\\\n};\\\\n\\\\nvar fromNumber = function fromNumber(num) {\\\\n  var hex = num.toString(16);\\\\n  return hex.length % 2 === 0 ? \\"0x\\" + hex : \\"0x0\\" + hex;\\\\n};\\\\n\\\\nvar toNumber = function toNumber(hex) {\\\\n  return parseInt(hex.slice(2), 16);\\\\n};\\\\n\\\\nvar concat = function concat(a, b) {\\\\n  return a.concat(b.slice(2));\\\\n};\\\\n\\\\nvar fromNat = function fromNat(bn) {\\\\n  return bn === \\"0x0\\" ? \\"0x\\" : bn.length % 2 === 0 ? bn : \\"0x0\\" + bn.slice(2);\\\\n};\\\\n\\\\nvar toNat = function toNat(bn) {\\\\n  return bn[2] === \\"0\\" ? \\"0x\\" + bn.slice(3) : bn;\\\\n};\\\\n\\\\nvar fromAscii = function fromAscii(ascii) {\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0; i < ascii.length; ++i) {\\\\n    hex += (\\"00\\" + ascii.charCodeAt(i).toString(16)).slice(-2);\\\\n  }return hex;\\\\n};\\\\n\\\\nvar toAscii = function toAscii(hex) {\\\\n  var ascii = \\"\\";\\\\n  for (var i = 2; i < hex.length; i += 2) {\\\\n    ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\\\\n  }return ascii;\\\\n};\\\\n\\\\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\\\\nvar fromString = function fromString(s) {\\\\n  var makeByte = function makeByte(uint8) {\\\\n    var b = uint8.toString(16);\\\\n    return b.length < 2 ? \\"0\\" + b : b;\\\\n  };\\\\n  var bytes = \\"0x\\";\\\\n  for (var ci = 0; ci != s.length; ci++) {\\\\n    var c = s.charCodeAt(ci);\\\\n    if (c < 128) {\\\\n      bytes += makeByte(c);\\\\n      continue;\\\\n    }\\\\n    if (c < 2048) {\\\\n      bytes += makeByte(c >> 6 | 192);\\\\n    } else {\\\\n      if (c > 0xd7ff && c < 0xdc00) {\\\\n        if (++ci == s.length) return null;\\\\n        var c2 = s.charCodeAt(ci);\\\\n        if (c2 < 0xdc00 || c2 > 0xdfff) return null;\\\\n        c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\\\\n        bytes += makeByte(c >> 18 | 240);\\\\n        bytes += makeByte(c >> 12 & 63 | 128);\\\\n      } else {\\\\n        // c <= 0xffff\\\\n        bytes += makeByte(c >> 12 | 224);\\\\n      }\\\\n      bytes += makeByte(c >> 6 & 63 | 128);\\\\n    }\\\\n    bytes += makeByte(c & 63 | 128);\\\\n  }\\\\n  return bytes;\\\\n};\\\\n\\\\nvar toString = function toString(bytes) {\\\\n  var s = \\\\\'\\\\\';\\\\n  var i = 0;\\\\n  var l = length(bytes);\\\\n  while (i < l) {\\\\n    var c = at(bytes, i++);\\\\n    if (c > 127) {\\\\n      if (c > 191 && c < 224) {\\\\n        if (i >= l) return null;\\\\n        c = (c & 31) << 6 | at(bytes, i) & 63;\\\\n      } else if (c > 223 && c < 240) {\\\\n        if (i + 1 >= l) return null;\\\\n        c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\\\\n      } else if (c > 239 && c < 248) {\\\\n        if (i + 2 >= l) return null;\\\\n        c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\\\\n      } else return null;\\\\n      ++i;\\\\n    }\\\\n    if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\\\\n      c -= 0x10000;\\\\n      s += String.fromCharCode(c >> 10 | 0xd800);\\\\n      s += String.fromCharCode(c & 0x3FF | 0xdc00);\\\\n    } else return null;\\\\n  }\\\\n  return s;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  random: random,\\\\n  length: length,\\\\n  concat: concat,\\\\n  flatten: flatten,\\\\n  slice: slice,\\\\n  reverse: reverse,\\\\n  pad: pad,\\\\n  padRight: padRight,\\\\n  fromAscii: fromAscii,\\\\n  toAscii: toAscii,\\\\n  fromString: fromString,\\\\n  toString: toString,\\\\n  fromNumber: fromNumber,\\\\n  toNumber: toNumber,\\\\n  fromNat: fromNat,\\\\n  toNat: toNat,\\\\n  fromArray: fromArray,\\\\n  toArray: toArray,\\\\n  fromUint8Array: fromUint8Array,\\\\n  toUint8Array: toUint8Array\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/bytes.js\\\\n// module id = 92\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/bytes.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nObject.defineProperty(exports, \\\\\\"__esModule\\\\\\", {\\\\n  value: true\\\\n});\\\\nexports.concatUint8Array = exports.makeSeed = exports.add0x = exports.remove0x = exports.buf2bytes32 = exports.buf2hex = exports.pad = exports.hexToString = exports.hexToNum = exports.numToHex = exports.toFixed = exports.hashName = exports.checksum = exports.debugLog = exports.sha3 = undefined;\\\\n\\\\nvar _toConsumableArray2 = __webpack_require__(94);\\\\n\\\\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\\\\n\\\\nexports.dec2bet = dec2bet;\\\\nexports.bet2dec = bet2dec;\\\\nexports.clearcode = clearcode;\\\\n\\\\nvar _debug = __webpack_require__(238);\\\\n\\\\nvar _debug2 = _interopRequireDefault(_debug);\\\\n\\\\nvar _config2 = __webpack_require__(59);\\\\n\\\\nvar _config3 = _interopRequireDefault(_config2);\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nvar web3_utils = __webpack_require__(10);\\\\n// const web3sha3 = require(\'web3-utils/src/soliditySha3.js\')\\\\n\\\\nvar sha3 = exports.sha3 = web3_utils.soliditySha3;\\\\n\\\\nvar debugLog = exports.debugLog = function debugLog(data) {\\\\n  var loglevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _config3.default.loglevel;\\\\n  var enable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\\\\n\\\\n  var log = (0, _debug2.default)(_config3.default.logname);\\\\n\\\\n  if (loglevel === \'hight\') log.enabled = true;\\\\n\\\\n  loglevel === \'light\' && !enable ? log.enabled = false : log.enabled = true;\\\\n\\\\n  if (loglevel === \'error\') {\\\\n    log = (0, _debug2.default)(loglevel);\\\\n    log.enabled = true;\\\\n  }\\\\n\\\\n  if (loglevel === \'none\') log.enabled = false;\\\\n\\\\n  if (Array.isArray(data)) return log.apply(undefined, (0, _toConsumableArray3.default)(data));\\\\n\\\\n  return log(data);\\\\n};\\\\n\\\\n/**\\\\n * Convert BET from decimal, to \\\\\\"human\\\\\\" format, ex: 110000000 = 1.1BET\\\\n * @param  {number} bets\\\\n * @param  {number} toFixed - values after zero\\\\n * @return {number} - bet in human format\\\\n */\\\\nfunction dec2bet(val) {\\\\n  var r = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\\\\n\\\\n  if (!val) return 0;\\\\n  var n = web3_utils.fromWei(val + \'\');\\\\n  return (+n).toFixed(r);\\\\n}\\\\n\\\\n/**\\\\n * Conver decimal, to BET format\\\\n *\\\\n * @export\\\\n * @param {number} val - value in decimal format\\\\n * @returns {number} - value in BETS FIRMAT\\\\n *\\\\n * @example\\\\n * DCLib.Utils.bet2dec(31024891841492)\\\\n * return: 310248.92\\\\n */\\\\nfunction bet2dec(val) {\\\\n  var b = web3_utils.toWei(val + \'\'); // \'\' + (val * 100000000)\\\\n  if (b.indexOf(\'.\') > -1) {\\\\n    b = b.split(\'.\')[0] * 1;\\\\n  }\\\\n  return b * 1;\\\\n}\\\\n\\\\n/**\\\\n * @ignore\\\\n */\\\\nfunction clearcode(string) {\\\\n  return string.toString().split(\'\\\\\\\\t\').join(\'\').split(\'\\\\\\\\n\').join(\'\').split(\'  \').join(\' \');\\\\n}\\\\n\\\\nvar checksum = exports.checksum = function checksum(string) {\\\\n  return sha3(clearcode(string));\\\\n};\\\\n\\\\nvar hashName = exports.hashName = function hashName(name) {\\\\n  return sha3(name).substr(2, 8);\\\\n};\\\\n\\\\nvar toFixed = exports.toFixed = function toFixed(value, precision) {\\\\n  precision = Math.pow(10, precision);\\\\n  return Math.ceil(value * precision) / precision;\\\\n};\\\\n\\\\nvar numToHex = exports.numToHex = function numToHex(num) {\\\\n  return num.toString(16);\\\\n};\\\\n\\\\nvar hexToNum = exports.hexToNum = function hexToNum(str) {\\\\n  return parseInt(str, 16);\\\\n};\\\\n\\\\nvar hexToString = exports.hexToString = function hexToString(hex) {\\\\n  var str = \'\';\\\\n  for (var i = 0; i < hex.length; i += 2) {\\\\n    str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));\\\\n  }\\\\n  return str;\\\\n};\\\\n\\\\nvar pad = exports.pad = function pad(num, size) {\\\\n  var s = num + \'\';\\\\n  while (s.length < size) {\\\\n    s = \'0\' + s;\\\\n  }return s;\\\\n};\\\\n\\\\nvar buf2hex = exports.buf2hex = function buf2hex(buffer) {\\\\n  return Array.prototype.map.call(new Uint8Array(buffer), function (x) {\\\\n    return (\'00\' + x.toString(16)).slice(-2);\\\\n  }).join(\'\');\\\\n};\\\\nvar buf2bytes32 = exports.buf2bytes32 = function buf2bytes32(buffer) {\\\\n  return \'0x\' + buf2hex(buffer);\\\\n};\\\\n\\\\nvar remove0x = exports.remove0x = function remove0x(str) {\\\\n  if (str.length > 2 && str.substr(0, 2) === \'0x\') {\\\\n    str = str.substr(2);\\\\n  }\\\\n  return str;\\\\n};\\\\n\\\\nvar add0x = exports.add0x = function add0x(str) {\\\\n  if (str.substr(0, 2) !== \'0x\') {\\\\n    str = \'0x\' + str;\\\\n  }\\\\n  return str;\\\\n};\\\\n\\\\nvar makeSeed = exports.makeSeed = function makeSeed() {\\\\n  var str = \'0x\';\\\\n  var possible = \'abcdef0123456789\';\\\\n\\\\n  for (var i = 0; i < 64; i++) {\\\\n    if (new Date().getTime() % 2 === 0) {\\\\n      str += possible.charAt(Math.floor(Math.random() * possible.length));\\\\n    } else {\\\\n      str += possible.charAt(Math.floor(Math.random() * (possible.length - 1)));\\\\n    }\\\\n  }\\\\n\\\\n  return sha3(numToHex(str));\\\\n};\\\\n\\\\nvar concatUint8Array = exports.concatUint8Array = function concatUint8Array(buffer1, buffer2) {\\\\n  var tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength);\\\\n  tmp.set(new Uint8Array(buffer1), 0);\\\\n  tmp.set(new Uint8Array(buffer2), buffer1.byteLength);\\\\n  return tmp.buffer;\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/utils/utils.js\\\\n// module id = 93\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=utils/utils.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.__esModule = true;\\\\n\\\\nvar _from = __webpack_require__(174);\\\\n\\\\nvar _from2 = _interopRequireDefault(_from);\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nexports.default = function (arr) {\\\\n  if (Array.isArray(arr)) {\\\\n    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\\\\n      arr2[i] = arr[i];\\\\n    }\\\\n\\\\n    return arr2;\\\\n  } else {\\\\n    return (0, _from2.default)(arr);\\\\n  }\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/helpers/toConsumableArray.js\\\\n// module id = 94\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/helpers/toConsumableArray.js\\")},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(198), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/json/stringify.js\\\\n// module id = 95\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/json/stringify.js\')},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(201), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/promise.js\\\\n// module id = 96\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/promise.js\')},function(module,exports,__webpack_require__){eval(\\"var r;\\\\n\\\\nmodule.exports = function rand(len) {\\\\n  if (!r)\\\\n    r = new Rand(null);\\\\n\\\\n  return r.generate(len);\\\\n};\\\\n\\\\nfunction Rand(rand) {\\\\n  this.rand = rand;\\\\n}\\\\nmodule.exports.Rand = Rand;\\\\n\\\\nRand.prototype.generate = function generate(len) {\\\\n  return this._rand(len);\\\\n};\\\\n\\\\n// Emulate crypto API using randy\\\\nRand.prototype._rand = function _rand(n) {\\\\n  if (this.rand.getBytes)\\\\n    return this.rand.getBytes(n);\\\\n\\\\n  var res = new Uint8Array(n);\\\\n  for (var i = 0; i < res.length; i++)\\\\n    res[i] = this.rand.getByte();\\\\n  return res;\\\\n};\\\\n\\\\nif (typeof self === \'object\') {\\\\n  if (self.crypto && self.crypto.getRandomValues) {\\\\n    // Modern browsers\\\\n    Rand.prototype._rand = function _rand(n) {\\\\n      var arr = new Uint8Array(n);\\\\n      self.crypto.getRandomValues(arr);\\\\n      return arr;\\\\n    };\\\\n  } else if (self.msCrypto && self.msCrypto.getRandomValues) {\\\\n    // IE\\\\n    Rand.prototype._rand = function _rand(n) {\\\\n      var arr = new Uint8Array(n);\\\\n      self.msCrypto.getRandomValues(arr);\\\\n      return arr;\\\\n    };\\\\n\\\\n  // Safari\'s WebWorkers do not have `crypto`\\\\n  } else if (typeof window === \'object\') {\\\\n    // Old junk\\\\n    Rand.prototype._rand = function() {\\\\n      throw new Error(\'Not implemented yet\');\\\\n    };\\\\n  }\\\\n} else {\\\\n  // Node.js or Web worker with no crypto support\\\\n  try {\\\\n    var crypto = __webpack_require__(378);\\\\n    if (typeof crypto.randomBytes !== \'function\')\\\\n      throw new Error(\'Not supported\');\\\\n\\\\n    Rand.prototype._rand = function _rand(n) {\\\\n      return crypto.randomBytes(n);\\\\n    };\\\\n  } catch (e) {\\\\n  }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/brorand/index.js\\\\n// module id = 97\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/brorand/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var aes = __webpack_require__(44)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar Transform = __webpack_require__(17)\\\\nvar inherits = __webpack_require__(0)\\\\nvar GHASH = __webpack_require__(183)\\\\nvar xor = __webpack_require__(32)\\\\nvar incr32 = __webpack_require__(99)\\\\n\\\\nfunction xorTest (a, b) {\\\\n  var out = 0\\\\n  if (a.length !== b.length) out++\\\\n\\\\n  var len = Math.min(a.length, b.length)\\\\n  for (var i = 0; i < len; ++i) {\\\\n    out += (a[i] ^ b[i])\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\nfunction calcIv (self, iv, ck) {\\\\n  if (iv.length === 12) {\\\\n    self._finID = Buffer.concat([iv, Buffer.from([0, 0, 0, 1])])\\\\n    return Buffer.concat([iv, Buffer.from([0, 0, 0, 2])])\\\\n  }\\\\n  var ghash = new GHASH(ck)\\\\n  var len = iv.length\\\\n  var toPad = len % 16\\\\n  ghash.update(iv)\\\\n  if (toPad) {\\\\n    toPad = 16 - toPad\\\\n    ghash.update(Buffer.alloc(toPad, 0))\\\\n  }\\\\n  ghash.update(Buffer.alloc(8, 0))\\\\n  var ivBits = len * 8\\\\n  var tail = Buffer.alloc(8)\\\\n  tail.writeUIntBE(ivBits, 0, 8)\\\\n  ghash.update(tail)\\\\n  self._finID = ghash.state\\\\n  var out = Buffer.from(self._finID)\\\\n  incr32(out)\\\\n  return out\\\\n}\\\\nfunction StreamCipher (mode, key, iv, decrypt) {\\\\n  Transform.call(this)\\\\n\\\\n  var h = Buffer.alloc(4, 0)\\\\n\\\\n  this._cipher = new aes.AES(key)\\\\n  var ck = this._cipher.encryptBlock(h)\\\\n  this._ghash = new GHASH(ck)\\\\n  iv = calcIv(this, iv, ck)\\\\n\\\\n  this._prev = Buffer.from(iv)\\\\n  this._cache = Buffer.allocUnsafe(0)\\\\n  this._secCache = Buffer.allocUnsafe(0)\\\\n  this._decrypt = decrypt\\\\n  this._alen = 0\\\\n  this._len = 0\\\\n  this._mode = mode\\\\n\\\\n  this._authTag = null\\\\n  this._called = false\\\\n}\\\\n\\\\ninherits(StreamCipher, Transform)\\\\n\\\\nStreamCipher.prototype._update = function (chunk) {\\\\n  if (!this._called && this._alen) {\\\\n    var rump = 16 - (this._alen % 16)\\\\n    if (rump < 16) {\\\\n      rump = Buffer.alloc(rump, 0)\\\\n      this._ghash.update(rump)\\\\n    }\\\\n  }\\\\n\\\\n  this._called = true\\\\n  var out = this._mode.encrypt(this, chunk)\\\\n  if (this._decrypt) {\\\\n    this._ghash.update(chunk)\\\\n  } else {\\\\n    this._ghash.update(out)\\\\n  }\\\\n  this._len += chunk.length\\\\n  return out\\\\n}\\\\n\\\\nStreamCipher.prototype._final = function () {\\\\n  if (this._decrypt && !this._authTag) throw new Error(\'Unsupported state or unable to authenticate data\')\\\\n\\\\n  var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID))\\\\n  if (this._decrypt && xorTest(tag, this._authTag)) throw new Error(\'Unsupported state or unable to authenticate data\')\\\\n\\\\n  this._authTag = tag\\\\n  this._cipher.scrub()\\\\n}\\\\n\\\\nStreamCipher.prototype.getAuthTag = function getAuthTag () {\\\\n  if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error(\'Attempting to get auth tag in unsupported state\')\\\\n\\\\n  return this._authTag\\\\n}\\\\n\\\\nStreamCipher.prototype.setAuthTag = function setAuthTag (tag) {\\\\n  if (!this._decrypt) throw new Error(\'Attempting to set auth tag in unsupported state\')\\\\n\\\\n  this._authTag = tag\\\\n}\\\\n\\\\nStreamCipher.prototype.setAAD = function setAAD (buf) {\\\\n  if (this._called) throw new Error(\'Attempting to set AAD in unsupported state\')\\\\n\\\\n  this._ghash.update(buf)\\\\n  this._alen += buf.length\\\\n}\\\\n\\\\nmodule.exports = StreamCipher\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/authCipher.js\\\\n// module id = 98\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/authCipher.js\\")},function(module,exports){eval(\\"function incr32 (iv) {\\\\n  var len = iv.length\\\\n  var item\\\\n  while (len--) {\\\\n    item = iv.readUInt8(len)\\\\n    if (item === 255) {\\\\n      iv.writeUInt8(0, len)\\\\n    } else {\\\\n      item++\\\\n      iv.writeUInt8(item, len)\\\\n      break\\\\n    }\\\\n  }\\\\n}\\\\nmodule.exports = incr32\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/incr32.js\\\\n// module id = 99\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/incr32.js\\")},function(module,exports,__webpack_require__){eval(\\"var xor = __webpack_require__(32)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar incr32 = __webpack_require__(99)\\\\n\\\\nfunction getBlock (self) {\\\\n  var out = self._cipher.encryptBlockRaw(self._prev)\\\\n  incr32(self._prev)\\\\n  return out\\\\n}\\\\n\\\\nvar blockSize = 16\\\\nexports.encrypt = function (self, chunk) {\\\\n  var chunkNum = Math.ceil(chunk.length / blockSize)\\\\n  var start = self._cache.length\\\\n  self._cache = Buffer.concat([\\\\n    self._cache,\\\\n    Buffer.allocUnsafe(chunkNum * blockSize)\\\\n  ])\\\\n  for (var i = 0; i < chunkNum; i++) {\\\\n    var out = getBlock(self)\\\\n    var offset = start + i * blockSize\\\\n    self._cache.writeUInt32BE(out[0], offset + 0)\\\\n    self._cache.writeUInt32BE(out[1], offset + 4)\\\\n    self._cache.writeUInt32BE(out[2], offset + 8)\\\\n    self._cache.writeUInt32BE(out[3], offset + 12)\\\\n  }\\\\n  var pad = self._cache.slice(0, chunk.length)\\\\n  self._cache = self._cache.slice(chunk.length)\\\\n  return xor(chunk, pad)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/ctr.js\\\\n// module id = 100\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/ctr.js\\")},function(module,exports){eval(\'module.exports = {\\"aes-128-ecb\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":0,\\"mode\\":\\"ECB\\",\\"type\\":\\"block\\"},\\"aes-192-ecb\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":0,\\"mode\\":\\"ECB\\",\\"type\\":\\"block\\"},\\"aes-256-ecb\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":0,\\"mode\\":\\"ECB\\",\\"type\\":\\"block\\"},\\"aes-128-cbc\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes-192-cbc\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes-256-cbc\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes128\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes192\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes256\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CBC\\",\\"type\\":\\"block\\"},\\"aes-128-cfb\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CFB\\",\\"type\\":\\"stream\\"},\\"aes-192-cfb\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CFB\\",\\"type\\":\\"stream\\"},\\"aes-256-cfb\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CFB\\",\\"type\\":\\"stream\\"},\\"aes-128-cfb8\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CFB8\\",\\"type\\":\\"stream\\"},\\"aes-192-cfb8\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CFB8\\",\\"type\\":\\"stream\\"},\\"aes-256-cfb8\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CFB8\\",\\"type\\":\\"stream\\"},\\"aes-128-cfb1\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CFB1\\",\\"type\\":\\"stream\\"},\\"aes-192-cfb1\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CFB1\\",\\"type\\":\\"stream\\"},\\"aes-256-cfb1\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CFB1\\",\\"type\\":\\"stream\\"},\\"aes-128-ofb\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"OFB\\",\\"type\\":\\"stream\\"},\\"aes-192-ofb\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"OFB\\",\\"type\\":\\"stream\\"},\\"aes-256-ofb\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"OFB\\",\\"type\\":\\"stream\\"},\\"aes-128-ctr\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":16,\\"mode\\":\\"CTR\\",\\"type\\":\\"stream\\"},\\"aes-192-ctr\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":16,\\"mode\\":\\"CTR\\",\\"type\\":\\"stream\\"},\\"aes-256-ctr\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":16,\\"mode\\":\\"CTR\\",\\"type\\":\\"stream\\"},\\"aes-128-gcm\\":{\\"cipher\\":\\"AES\\",\\"key\\":128,\\"iv\\":12,\\"mode\\":\\"GCM\\",\\"type\\":\\"auth\\"},\\"aes-192-gcm\\":{\\"cipher\\":\\"AES\\",\\"key\\":192,\\"iv\\":12,\\"mode\\":\\"GCM\\",\\"type\\":\\"auth\\"},\\"aes-256-gcm\\":{\\"cipher\\":\\"AES\\",\\"key\\":256,\\"iv\\":12,\\"mode\\":\\"GCM\\",\\"type\\":\\"auth\\"}}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/list.json\\\\n// module id = 101\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/list.json\')},function(module,exports,__webpack_require__){eval(\\"var aes = __webpack_require__(44)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar Transform = __webpack_require__(17)\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction StreamCipher (mode, key, iv, decrypt) {\\\\n  Transform.call(this)\\\\n\\\\n  this._cipher = new aes.AES(key)\\\\n  this._prev = Buffer.from(iv)\\\\n  this._cache = Buffer.allocUnsafe(0)\\\\n  this._secCache = Buffer.allocUnsafe(0)\\\\n  this._decrypt = decrypt\\\\n  this._mode = mode\\\\n}\\\\n\\\\ninherits(StreamCipher, Transform)\\\\n\\\\nStreamCipher.prototype._update = function (chunk) {\\\\n  return this._mode.encrypt(this, chunk, this._decrypt)\\\\n}\\\\n\\\\nStreamCipher.prototype._final = function () {\\\\n  this._cipher.scrub()\\\\n}\\\\n\\\\nmodule.exports = StreamCipher\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/streamCipher.js\\\\n// module id = 102\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/streamCipher.js\\")},function(module,exports){eval(\'module.exports = {\\"sha224WithRSAEncryption\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"sha224\\",\\"id\\":\\"302d300d06096086480165030402040500041c\\"},\\"RSA-SHA224\\":{\\"sign\\":\\"ecdsa/rsa\\",\\"hash\\":\\"sha224\\",\\"id\\":\\"302d300d06096086480165030402040500041c\\"},\\"sha256WithRSAEncryption\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"sha256\\",\\"id\\":\\"3031300d060960864801650304020105000420\\"},\\"RSA-SHA256\\":{\\"sign\\":\\"ecdsa/rsa\\",\\"hash\\":\\"sha256\\",\\"id\\":\\"3031300d060960864801650304020105000420\\"},\\"sha384WithRSAEncryption\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"sha384\\",\\"id\\":\\"3041300d060960864801650304020205000430\\"},\\"RSA-SHA384\\":{\\"sign\\":\\"ecdsa/rsa\\",\\"hash\\":\\"sha384\\",\\"id\\":\\"3041300d060960864801650304020205000430\\"},\\"sha512WithRSAEncryption\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"sha512\\",\\"id\\":\\"3051300d060960864801650304020305000440\\"},\\"RSA-SHA512\\":{\\"sign\\":\\"ecdsa/rsa\\",\\"hash\\":\\"sha512\\",\\"id\\":\\"3051300d060960864801650304020305000440\\"},\\"RSA-SHA1\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"sha1\\",\\"id\\":\\"3021300906052b0e03021a05000414\\"},\\"ecdsa-with-SHA1\\":{\\"sign\\":\\"ecdsa\\",\\"hash\\":\\"sha1\\",\\"id\\":\\"\\"},\\"sha256\\":{\\"sign\\":\\"ecdsa\\",\\"hash\\":\\"sha256\\",\\"id\\":\\"\\"},\\"sha224\\":{\\"sign\\":\\"ecdsa\\",\\"hash\\":\\"sha224\\",\\"id\\":\\"\\"},\\"sha384\\":{\\"sign\\":\\"ecdsa\\",\\"hash\\":\\"sha384\\",\\"id\\":\\"\\"},\\"sha512\\":{\\"sign\\":\\"ecdsa\\",\\"hash\\":\\"sha512\\",\\"id\\":\\"\\"},\\"DSA-SHA\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha1\\",\\"id\\":\\"\\"},\\"DSA-SHA1\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha1\\",\\"id\\":\\"\\"},\\"DSA\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha1\\",\\"id\\":\\"\\"},\\"DSA-WITH-SHA224\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha224\\",\\"id\\":\\"\\"},\\"DSA-SHA224\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha224\\",\\"id\\":\\"\\"},\\"DSA-WITH-SHA256\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha256\\",\\"id\\":\\"\\"},\\"DSA-SHA256\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha256\\",\\"id\\":\\"\\"},\\"DSA-WITH-SHA384\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha384\\",\\"id\\":\\"\\"},\\"DSA-SHA384\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha384\\",\\"id\\":\\"\\"},\\"DSA-WITH-SHA512\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha512\\",\\"id\\":\\"\\"},\\"DSA-SHA512\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"sha512\\",\\"id\\":\\"\\"},\\"DSA-RIPEMD160\\":{\\"sign\\":\\"dsa\\",\\"hash\\":\\"rmd160\\",\\"id\\":\\"\\"},\\"ripemd160WithRSA\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"rmd160\\",\\"id\\":\\"3021300906052b2403020105000414\\"},\\"RSA-RIPEMD160\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"rmd160\\",\\"id\\":\\"3021300906052b2403020105000414\\"},\\"md5WithRSAEncryption\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"md5\\",\\"id\\":\\"3020300c06082a864886f70d020505000410\\"},\\"RSA-MD5\\":{\\"sign\\":\\"rsa\\",\\"hash\\":\\"md5\\",\\"id\\":\\"3020300c06082a864886f70d020505000410\\"}}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/browser/algorithms.json\\\\n// module id = 103\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/browser/algorithms.json\')},function(module,exports){eval(\'module.exports = {\\"1.3.132.0.10\\":\\"secp256k1\\",\\"1.3.132.0.33\\":\\"p224\\",\\"1.2.840.10045.3.1.1\\":\\"p192\\",\\"1.2.840.10045.3.1.7\\":\\"p256\\",\\"1.3.132.0.34\\":\\"p384\\",\\"1.3.132.0.35\\":\\"p521\\"}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/browser/curves.json\\\\n// module id = 104\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/browser/curves.json\')},function(module,exports,__webpack_require__){eval(\\"// getting tag from 19.1.3.6 Object.prototype.toString()\\\\nvar cof = __webpack_require__(33);\\\\nvar TAG = __webpack_require__(9)(\'toStringTag\');\\\\n// ES3 wrong here\\\\nvar ARG = cof(function () { return arguments; }()) == \'Arguments\';\\\\n\\\\n// fallback for IE11 Script Access Denied error\\\\nvar tryGet = function (it, key) {\\\\n  try {\\\\n    return it[key];\\\\n  } catch (e) { /* empty */ }\\\\n};\\\\n\\\\nmodule.exports = function (it) {\\\\n  var O, T, B;\\\\n  return it === undefined ? \'Undefined\' : it === null ? \'Null\'\\\\n    // @@toStringTag case\\\\n    : typeof (T = tryGet(O = Object(it), TAG)) == \'string\' ? T\\\\n    // builtinTag case\\\\n    : ARG ? cof(O)\\\\n    // ES3 arguments fallback\\\\n    : (B = cof(O)) == \'Object\' && typeof O.callee == \'function\' ? \'Arguments\' : B;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_classof.js\\\\n// module id = 105\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_classof.js\\")},function(module,exports,__webpack_require__){eval(\\"var document = __webpack_require__(8).document;\\\\nmodule.exports = document && document.documentElement;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_html.js\\\\n// module id = 106\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_html.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = !__webpack_require__(19) && !__webpack_require__(35)(function () {\\\\n  return Object.defineProperty(__webpack_require__(69)(\'div\'), \'a\', { get: function () { return 7; } }).a != 7;\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_ie8-dom-define.js\\\\n// module id = 107\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_ie8-dom-define.js\\")},function(module,exports,__webpack_require__){eval(\\"// fallback for non-array-like ES3 and non-enumerable old V8 strings\\\\nvar cof = __webpack_require__(33);\\\\n// eslint-disable-next-line no-prototype-builtins\\\\nmodule.exports = Object(\'z\').propertyIsEnumerable(0) ? Object : function (it) {\\\\n  return cof(it) == \'String\' ? it.split(\'\') : Object(it);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iobject.js\\\\n// module id = 108\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iobject.js\\")},function(module,exports,__webpack_require__){eval(\\"// check on default Array iterator\\\\nvar Iterators = __webpack_require__(36);\\\\nvar ITERATOR = __webpack_require__(9)(\'iterator\');\\\\nvar ArrayProto = Array.prototype;\\\\n\\\\nmodule.exports = function (it) {\\\\n  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_is-array-iter.js\\\\n// module id = 109\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_is-array-iter.js\\")},function(module,exports,__webpack_require__){eval(\\"// call something on iterator step with safe closing on error\\\\nvar anObject = __webpack_require__(18);\\\\nmodule.exports = function (iterator, fn, value, entries) {\\\\n  try {\\\\n    return entries ? fn(anObject(value)[0], value[1]) : fn(value);\\\\n  // 7.4.6 IteratorClose(iterator, completion)\\\\n  } catch (e) {\\\\n    var ret = iterator[\'return\'];\\\\n    if (ret !== undefined) anObject(ret.call(iterator));\\\\n    throw e;\\\\n  }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iter-call.js\\\\n// module id = 110\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iter-call.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar LIBRARY = __webpack_require__(46);\\\\nvar $export = __webpack_require__(20);\\\\nvar redefine = __webpack_require__(118);\\\\nvar hide = __webpack_require__(22);\\\\nvar Iterators = __webpack_require__(36);\\\\nvar $iterCreate = __webpack_require__(212);\\\\nvar setToStringTag = __webpack_require__(49);\\\\nvar getPrototypeOf = __webpack_require__(220);\\\\nvar ITERATOR = __webpack_require__(9)(\'iterator\');\\\\nvar BUGGY = !([].keys && \'next\' in [].keys()); // Safari has buggy iterators w/o `next`\\\\nvar FF_ITERATOR = \'@@iterator\';\\\\nvar KEYS = \'keys\';\\\\nvar VALUES = \'values\';\\\\n\\\\nvar returnThis = function () { return this; };\\\\n\\\\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\\\\n  $iterCreate(Constructor, NAME, next);\\\\n  var getMethod = function (kind) {\\\\n    if (!BUGGY && kind in proto) return proto[kind];\\\\n    switch (kind) {\\\\n      case KEYS: return function keys() { return new Constructor(this, kind); };\\\\n      case VALUES: return function values() { return new Constructor(this, kind); };\\\\n    } return function entries() { return new Constructor(this, kind); };\\\\n  };\\\\n  var TAG = NAME + \' Iterator\';\\\\n  var DEF_VALUES = DEFAULT == VALUES;\\\\n  var VALUES_BUG = false;\\\\n  var proto = Base.prototype;\\\\n  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\\\\n  var $default = $native || getMethod(DEFAULT);\\\\n  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod(\'entries\') : undefined;\\\\n  var $anyNative = NAME == \'Array\' ? proto.entries || $native : $native;\\\\n  var methods, key, IteratorPrototype;\\\\n  // Fix native\\\\n  if ($anyNative) {\\\\n    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\\\\n    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\\\\n      // Set @@toStringTag to native iterators\\\\n      setToStringTag(IteratorPrototype, TAG, true);\\\\n      // fix for some old engines\\\\n      if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != \'function\') hide(IteratorPrototype, ITERATOR, returnThis);\\\\n    }\\\\n  }\\\\n  // fix Array#{values, @@iterator}.name in V8 / FF\\\\n  if (DEF_VALUES && $native && $native.name !== VALUES) {\\\\n    VALUES_BUG = true;\\\\n    $default = function values() { return $native.call(this); };\\\\n  }\\\\n  // Define iterator\\\\n  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\\\\n    hide(proto, ITERATOR, $default);\\\\n  }\\\\n  // Plug for library\\\\n  Iterators[NAME] = $default;\\\\n  Iterators[TAG] = returnThis;\\\\n  if (DEFAULT) {\\\\n    methods = {\\\\n      values: DEF_VALUES ? $default : getMethod(VALUES),\\\\n      keys: IS_SET ? $default : getMethod(KEYS),\\\\n      entries: $entries\\\\n    };\\\\n    if (FORCED) for (key in methods) {\\\\n      if (!(key in proto)) redefine(proto, key, methods[key]);\\\\n    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\\\\n  }\\\\n  return methods;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iter-define.js\\\\n// module id = 111\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iter-define.js\\")},function(module,exports,__webpack_require__){eval(\\"var ITERATOR = __webpack_require__(9)(\'iterator\');\\\\nvar SAFE_CLOSING = false;\\\\n\\\\ntry {\\\\n  var riter = [7][ITERATOR]();\\\\n  riter[\'return\'] = function () { SAFE_CLOSING = true; };\\\\n  // eslint-disable-next-line no-throw-literal\\\\n  Array.from(riter, function () { throw 2; });\\\\n} catch (e) { /* empty */ }\\\\n\\\\nmodule.exports = function (exec, skipClosing) {\\\\n  if (!skipClosing && !SAFE_CLOSING) return false;\\\\n  var safe = false;\\\\n  try {\\\\n    var arr = [7];\\\\n    var iter = arr[ITERATOR]();\\\\n    iter.next = function () { return { done: safe = true }; };\\\\n    arr[ITERATOR] = function () { return iter; };\\\\n    exec(arr);\\\\n  } catch (e) { /* empty */ }\\\\n  return safe;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iter-detect.js\\\\n// module id = 112\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iter-detect.js\\")},function(module,exports,__webpack_require__){eval(\\"// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\\\\nvar anObject = __webpack_require__(18);\\\\nvar dPs = __webpack_require__(217);\\\\nvar enumBugKeys = __webpack_require__(70);\\\\nvar IE_PROTO = __webpack_require__(73)(\'IE_PROTO\');\\\\nvar Empty = function () { /* empty */ };\\\\nvar PROTOTYPE = \'prototype\';\\\\n\\\\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\\\\nvar createDict = function () {\\\\n  // Thrash, waste and sodomy: IE GC bug\\\\n  var iframe = __webpack_require__(69)(\'iframe\');\\\\n  var i = enumBugKeys.length;\\\\n  var lt = \'<\';\\\\n  var gt = \'>\';\\\\n  var iframeDocument;\\\\n  iframe.style.display = \'none\';\\\\n  __webpack_require__(106).appendChild(iframe);\\\\n  iframe.src = \'javascript:\'; // eslint-disable-line no-script-url\\\\n  // createDict = iframe.contentWindow.Object;\\\\n  // html.removeChild(iframe);\\\\n  iframeDocument = iframe.contentWindow.document;\\\\n  iframeDocument.open();\\\\n  iframeDocument.write(lt + \'script\' + gt + \'document.F=Object\' + lt + \'/script\' + gt);\\\\n  iframeDocument.close();\\\\n  createDict = iframeDocument.F;\\\\n  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\\\\n  return createDict();\\\\n};\\\\n\\\\nmodule.exports = Object.create || function create(O, Properties) {\\\\n  var result;\\\\n  if (O !== null) {\\\\n    Empty[PROTOTYPE] = anObject(O);\\\\n    result = new Empty();\\\\n    Empty[PROTOTYPE] = null;\\\\n    // add \\\\\\"__proto__\\\\\\" for Object.getPrototypeOf polyfill\\\\n    result[IE_PROTO] = O;\\\\n  } else result = createDict();\\\\n  return Properties === undefined ? result : dPs(result, Properties);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-create.js\\\\n// module id = 113\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-create.js\\")},function(module,exports,__webpack_require__){eval(\\"// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\\\\nvar $keys = __webpack_require__(115);\\\\nvar hiddenKeys = __webpack_require__(70).concat(\'length\', \'prototype\');\\\\n\\\\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\\\\n  return $keys(O, hiddenKeys);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-gopn.js\\\\n// module id = 114\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopn.js\\")},function(module,exports,__webpack_require__){eval(\\"var has = __webpack_require__(21);\\\\nvar toIObject = __webpack_require__(28);\\\\nvar arrayIndexOf = __webpack_require__(206)(false);\\\\nvar IE_PROTO = __webpack_require__(73)(\'IE_PROTO\');\\\\n\\\\nmodule.exports = function (object, names) {\\\\n  var O = toIObject(object);\\\\n  var i = 0;\\\\n  var result = [];\\\\n  var key;\\\\n  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\\\\n  // Don\'t enum bug & hidden keys\\\\n  while (names.length > i) if (has(O, key = names[i++])) {\\\\n    ~arrayIndexOf(result, key) || result.push(key);\\\\n  }\\\\n  return result;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-keys-internal.js\\\\n// module id = 115\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-keys-internal.js\\")},function(module,exports){eval(\\"module.exports = function (exec) {\\\\n  try {\\\\n    return { e: false, v: exec() };\\\\n  } catch (e) {\\\\n    return { e: true, v: e };\\\\n  }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_perform.js\\\\n// module id = 116\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_perform.js\\")},function(module,exports,__webpack_require__){eval(\\"var anObject = __webpack_require__(18);\\\\nvar isObject = __webpack_require__(23);\\\\nvar newPromiseCapability = __webpack_require__(71);\\\\n\\\\nmodule.exports = function (C, x) {\\\\n  anObject(C);\\\\n  if (isObject(x) && x.constructor === C) return x;\\\\n  var promiseCapability = newPromiseCapability.f(C);\\\\n  var resolve = promiseCapability.resolve;\\\\n  resolve(x);\\\\n  return promiseCapability.promise;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_promise-resolve.js\\\\n// module id = 117\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_promise-resolve.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(22);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_redefine.js\\\\n// module id = 118\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_redefine.js\\")},function(module,exports,__webpack_require__){eval(\\"// 7.3.20 SpeciesConstructor(O, defaultConstructor)\\\\nvar anObject = __webpack_require__(18);\\\\nvar aFunction = __webpack_require__(45);\\\\nvar SPECIES = __webpack_require__(9)(\'species\');\\\\nmodule.exports = function (O, D) {\\\\n  var C = anObject(O).constructor;\\\\n  var S;\\\\n  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_species-constructor.js\\\\n// module id = 119\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_species-constructor.js\\")},function(module,exports,__webpack_require__){eval(\\"var ctx = __webpack_require__(34);\\\\nvar invoke = __webpack_require__(210);\\\\nvar html = __webpack_require__(106);\\\\nvar cel = __webpack_require__(69);\\\\nvar global = __webpack_require__(8);\\\\nvar process = global.process;\\\\nvar setTask = global.setImmediate;\\\\nvar clearTask = global.clearImmediate;\\\\nvar MessageChannel = global.MessageChannel;\\\\nvar Dispatch = global.Dispatch;\\\\nvar counter = 0;\\\\nvar queue = {};\\\\nvar ONREADYSTATECHANGE = \'onreadystatechange\';\\\\nvar defer, channel, port;\\\\nvar run = function () {\\\\n  var id = +this;\\\\n  // eslint-disable-next-line no-prototype-builtins\\\\n  if (queue.hasOwnProperty(id)) {\\\\n    var fn = queue[id];\\\\n    delete queue[id];\\\\n    fn();\\\\n  }\\\\n};\\\\nvar listener = function (event) {\\\\n  run.call(event.data);\\\\n};\\\\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\\\\nif (!setTask || !clearTask) {\\\\n  setTask = function setImmediate(fn) {\\\\n    var args = [];\\\\n    var i = 1;\\\\n    while (arguments.length > i) args.push(arguments[i++]);\\\\n    queue[++counter] = function () {\\\\n      // eslint-disable-next-line no-new-func\\\\n      invoke(typeof fn == \'function\' ? fn : Function(fn), args);\\\\n    };\\\\n    defer(counter);\\\\n    return counter;\\\\n  };\\\\n  clearTask = function clearImmediate(id) {\\\\n    delete queue[id];\\\\n  };\\\\n  // Node.js 0.8-\\\\n  if (__webpack_require__(33)(process) == \'process\') {\\\\n    defer = function (id) {\\\\n      process.nextTick(ctx(run, id, 1));\\\\n    };\\\\n  // Sphere (JS game engine) Dispatch API\\\\n  } else if (Dispatch && Dispatch.now) {\\\\n    defer = function (id) {\\\\n      Dispatch.now(ctx(run, id, 1));\\\\n    };\\\\n  // Browsers with MessageChannel, includes WebWorkers\\\\n  } else if (MessageChannel) {\\\\n    channel = new MessageChannel();\\\\n    port = channel.port2;\\\\n    channel.port1.onmessage = listener;\\\\n    defer = ctx(port.postMessage, port, 1);\\\\n  // Browsers with postMessage, skip WebWorkers\\\\n  // IE8 has postMessage, but it\'s sync & typeof its postMessage is \'object\'\\\\n  } else if (global.addEventListener && typeof postMessage == \'function\' && !global.importScripts) {\\\\n    defer = function (id) {\\\\n      global.postMessage(id + \'\', \'*\');\\\\n    };\\\\n    global.addEventListener(\'message\', listener, false);\\\\n  // IE8-\\\\n  } else if (ONREADYSTATECHANGE in cel(\'script\')) {\\\\n    defer = function (id) {\\\\n      html.appendChild(cel(\'script\'))[ONREADYSTATECHANGE] = function () {\\\\n        html.removeChild(this);\\\\n        run.call(id);\\\\n      };\\\\n    };\\\\n  // Rest old browsers\\\\n  } else {\\\\n    defer = function (id) {\\\\n      setTimeout(ctx(run, id, 1), 0);\\\\n    };\\\\n  }\\\\n}\\\\nmodule.exports = {\\\\n  set: setTask,\\\\n  clear: clearTask\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_task.js\\\\n// module id = 120\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_task.js\\")},function(module,exports,__webpack_require__){eval(\\"var classof = __webpack_require__(105);\\\\nvar ITERATOR = __webpack_require__(9)(\'iterator\');\\\\nvar Iterators = __webpack_require__(36);\\\\nmodule.exports = __webpack_require__(11).getIteratorMethod = function (it) {\\\\n  if (it != undefined) return it[ITERATOR]\\\\n    || it[\'@@iterator\']\\\\n    || Iterators[classof(it)];\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/core.get-iterator-method.js\\\\n// module id = 121\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/core.get-iterator-method.js\\")},function(module,exports){eval(\\"\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.object.to-string.js\\\\n// module id = 122\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.to-string.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(226);\\\\nvar global = __webpack_require__(8);\\\\nvar hide = __webpack_require__(22);\\\\nvar Iterators = __webpack_require__(36);\\\\nvar TO_STRING_TAG = __webpack_require__(9)(\'toStringTag\');\\\\n\\\\nvar DOMIterables = (\'CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,\' +\\\\n  \'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,\' +\\\\n  \'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,\' +\\\\n  \'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,\' +\\\\n  \'TextTrackList,TouchList\').split(\',\');\\\\n\\\\nfor (var i = 0; i < DOMIterables.length; i++) {\\\\n  var NAME = DOMIterables[i];\\\\n  var Collection = global[NAME];\\\\n  var proto = Collection && Collection.prototype;\\\\n  if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\\\\n  Iterators[NAME] = Iterators.Array;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/web.dom.iterable.js\\\\n// module id = 123\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/web.dom.iterable.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar inherits = __webpack_require__(0)\\\\nvar Legacy = __webpack_require__(237)\\\\nvar Base = __webpack_require__(17)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar md5 = __webpack_require__(82)\\\\nvar RIPEMD160 = __webpack_require__(89)\\\\n\\\\nvar sha = __webpack_require__(90)\\\\n\\\\nvar ZEROS = Buffer.alloc(128)\\\\n\\\\nfunction Hmac (alg, key) {\\\\n  Base.call(this, \'digest\')\\\\n  if (typeof key === \'string\') {\\\\n    key = Buffer.from(key)\\\\n  }\\\\n\\\\n  var blocksize = (alg === \'sha512\' || alg === \'sha384\') ? 128 : 64\\\\n\\\\n  this._alg = alg\\\\n  this._key = key\\\\n  if (key.length > blocksize) {\\\\n    var hash = alg === \'rmd160\' ? new RIPEMD160() : sha(alg)\\\\n    key = hash.update(key).digest()\\\\n  } else if (key.length < blocksize) {\\\\n    key = Buffer.concat([key, ZEROS], blocksize)\\\\n  }\\\\n\\\\n  var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\\\\n  var opad = this._opad = Buffer.allocUnsafe(blocksize)\\\\n\\\\n  for (var i = 0; i < blocksize; i++) {\\\\n    ipad[i] = key[i] ^ 0x36\\\\n    opad[i] = key[i] ^ 0x5C\\\\n  }\\\\n  this._hash = alg === \'rmd160\' ? new RIPEMD160() : sha(alg)\\\\n  this._hash.update(ipad)\\\\n}\\\\n\\\\ninherits(Hmac, Base)\\\\n\\\\nHmac.prototype._update = function (data) {\\\\n  this._hash.update(data)\\\\n}\\\\n\\\\nHmac.prototype._final = function () {\\\\n  var h = this._hash.digest()\\\\n  var hash = this._alg === \'rmd160\' ? new RIPEMD160() : sha(this._alg)\\\\n  return hash.update(this._opad).update(h).digest()\\\\n}\\\\n\\\\nmodule.exports = function createHmac (alg, key) {\\\\n  alg = alg.toLowerCase()\\\\n  if (alg === \'rmd160\' || alg === \'ripemd160\') {\\\\n    return new Hmac(\'rmd160\', key)\\\\n  }\\\\n  if (alg === \'md5\') {\\\\n    return new Legacy(md5, key)\\\\n  }\\\\n  return new Hmac(alg, key)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-hmac/browser.js\\\\n// module id = 124\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-hmac/browser.js\\")},function(module,__webpack_exports__,__webpack_require__){\\"use strict\\";eval(\'Object.defineProperty(__webpack_exports__, \\"__esModule\\", { value: true });\\\\n/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*\\\\n * Dexie.js - a minimalistic wrapper for IndexedDB\\\\n * ===============================================\\\\n *\\\\n * By David Fahlander, david.fahlander@gmail.com\\\\n *\\\\n * Version {version}, {date}\\\\n *\\\\n * http://dexie.org\\\\n *\\\\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\\\\n */\\\\n \\\\nvar keys = Object.keys;\\\\nvar isArray = Array.isArray;\\\\nvar _global = typeof self !== \\\\\'undefined\\\\\' ? self :\\\\n    typeof window !== \\\\\'undefined\\\\\' ? window :\\\\n        global;\\\\nfunction extend(obj, extension) {\\\\n    if (typeof extension !== \\\\\'object\\\\\')\\\\n        return obj;\\\\n    keys(extension).forEach(function (key) {\\\\n        obj[key] = extension[key];\\\\n    });\\\\n    return obj;\\\\n}\\\\nvar getProto = Object.getPrototypeOf;\\\\nvar _hasOwn = {}.hasOwnProperty;\\\\nfunction hasOwn(obj, prop) {\\\\n    return _hasOwn.call(obj, prop);\\\\n}\\\\nfunction props(proto, extension) {\\\\n    if (typeof extension === \\\\\'function\\\\\')\\\\n        extension = extension(getProto(proto));\\\\n    keys(extension).forEach(function (key) {\\\\n        setProp(proto, key, extension[key]);\\\\n    });\\\\n}\\\\nvar defineProperty = Object.defineProperty;\\\\nfunction setProp(obj, prop, functionOrGetSet, options) {\\\\n    defineProperty(obj, prop, extend(functionOrGetSet && hasOwn(functionOrGetSet, \\"get\\") && typeof functionOrGetSet.get === \\\\\'function\\\\\' ?\\\\n        { get: functionOrGetSet.get, set: functionOrGetSet.set, configurable: true } :\\\\n        { value: functionOrGetSet, configurable: true, writable: true }, options));\\\\n}\\\\nfunction derive(Child) {\\\\n    return {\\\\n        from: function (Parent) {\\\\n            Child.prototype = Object.create(Parent.prototype);\\\\n            setProp(Child.prototype, \\"constructor\\", Child);\\\\n            return {\\\\n                extend: props.bind(null, Child.prototype)\\\\n            };\\\\n        }\\\\n    };\\\\n}\\\\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\\\\nfunction getPropertyDescriptor(obj, prop) {\\\\n    var pd = getOwnPropertyDescriptor(obj, prop), proto;\\\\n    return pd || (proto = getProto(obj)) && getPropertyDescriptor(proto, prop);\\\\n}\\\\nvar _slice = [].slice;\\\\nfunction slice(args, start, end) {\\\\n    return _slice.call(args, start, end);\\\\n}\\\\nfunction override(origFunc, overridedFactory) {\\\\n    return overridedFactory(origFunc);\\\\n}\\\\nfunction assert(b) {\\\\n    if (!b)\\\\n        throw new Error(\\"Assertion Failed\\");\\\\n}\\\\nfunction asap(fn) {\\\\n    if (_global.setImmediate)\\\\n        setImmediate(fn);\\\\n    else\\\\n        setTimeout(fn, 0);\\\\n}\\\\n\\\\n/** Generate an object (hash map) based on given array.\\\\n * @param extractor Function taking an array item and its index and returning an array of 2 items ([key, value]) to\\\\n *        instert on the resulting object for each item in the array. If this function returns a falsy value, the\\\\n *        current item wont affect the resulting object.\\\\n */\\\\nfunction arrayToObject(array, extractor) {\\\\n    return array.reduce(function (result, item, i) {\\\\n        var nameAndValue = extractor(item, i);\\\\n        if (nameAndValue)\\\\n            result[nameAndValue[0]] = nameAndValue[1];\\\\n        return result;\\\\n    }, {});\\\\n}\\\\nfunction trycatcher(fn, reject) {\\\\n    return function () {\\\\n        try {\\\\n            fn.apply(this, arguments);\\\\n        }\\\\n        catch (e) {\\\\n            reject(e);\\\\n        }\\\\n    };\\\\n}\\\\nfunction tryCatch(fn, onerror, args) {\\\\n    try {\\\\n        fn.apply(null, args);\\\\n    }\\\\n    catch (ex) {\\\\n        onerror && onerror(ex);\\\\n    }\\\\n}\\\\nfunction getByKeyPath(obj, keyPath) {\\\\n    // http://www.w3.org/TR/IndexedDB/#steps-for-extracting-a-key-from-a-value-using-a-key-path\\\\n    if (hasOwn(obj, keyPath))\\\\n        return obj[keyPath]; // This line is moved from last to first for optimization purpose.\\\\n    if (!keyPath)\\\\n        return obj;\\\\n    if (typeof keyPath !== \\\\\'string\\\\\') {\\\\n        var rv = [];\\\\n        for (var i = 0, l = keyPath.length; i < l; ++i) {\\\\n            var val = getByKeyPath(obj, keyPath[i]);\\\\n            rv.push(val);\\\\n        }\\\\n        return rv;\\\\n    }\\\\n    var period = keyPath.indexOf(\\\\\'.\\\\\');\\\\n    if (period !== -1) {\\\\n        var innerObj = obj[keyPath.substr(0, period)];\\\\n        return innerObj === undefined ? undefined : getByKeyPath(innerObj, keyPath.substr(period + 1));\\\\n    }\\\\n    return undefined;\\\\n}\\\\nfunction setByKeyPath(obj, keyPath, value) {\\\\n    if (!obj || keyPath === undefined)\\\\n        return;\\\\n    if (\\\\\'isFrozen\\\\\' in Object && Object.isFrozen(obj))\\\\n        return;\\\\n    if (typeof keyPath !== \\\\\'string\\\\\' && \\\\\'length\\\\\' in keyPath) {\\\\n        assert(typeof value !== \\\\\'string\\\\\' && \\\\\'length\\\\\' in value);\\\\n        for (var i = 0, l = keyPath.length; i < l; ++i) {\\\\n            setByKeyPath(obj, keyPath[i], value[i]);\\\\n        }\\\\n    }\\\\n    else {\\\\n        var period = keyPath.indexOf(\\\\\'.\\\\\');\\\\n        if (period !== -1) {\\\\n            var currentKeyPath = keyPath.substr(0, period);\\\\n            var remainingKeyPath = keyPath.substr(period + 1);\\\\n            if (remainingKeyPath === \\"\\")\\\\n                if (value === undefined)\\\\n                    delete obj[currentKeyPath];\\\\n                else\\\\n                    obj[currentKeyPath] = value;\\\\n            else {\\\\n                var innerObj = obj[currentKeyPath];\\\\n                if (!innerObj)\\\\n                    innerObj = (obj[currentKeyPath] = {});\\\\n                setByKeyPath(innerObj, remainingKeyPath, value);\\\\n            }\\\\n        }\\\\n        else {\\\\n            if (value === undefined)\\\\n                delete obj[keyPath];\\\\n            else\\\\n                obj[keyPath] = value;\\\\n        }\\\\n    }\\\\n}\\\\nfunction delByKeyPath(obj, keyPath) {\\\\n    if (typeof keyPath === \\\\\'string\\\\\')\\\\n        setByKeyPath(obj, keyPath, undefined);\\\\n    else if (\\\\\'length\\\\\' in keyPath)\\\\n        [].map.call(keyPath, function (kp) {\\\\n            setByKeyPath(obj, kp, undefined);\\\\n        });\\\\n}\\\\nfunction shallowClone(obj) {\\\\n    var rv = {};\\\\n    for (var m in obj) {\\\\n        if (hasOwn(obj, m))\\\\n            rv[m] = obj[m];\\\\n    }\\\\n    return rv;\\\\n}\\\\nvar concat = [].concat;\\\\nfunction flatten(a) {\\\\n    return concat.apply([], a);\\\\n}\\\\n//https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\\\\nvar intrinsicTypes = \\"Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set\\"\\\\n    .split(\\\\\',\\\\\').concat(flatten([8, 16, 32, 64].map(function (num) { return [\\"Int\\", \\"Uint\\", \\"Float\\"].map(function (t) { return t + num + \\"Array\\"; }); }))).filter(function (t) { return _global[t]; }).map(function (t) { return _global[t]; });\\\\nfunction deepClone(any) {\\\\n    if (!any || typeof any !== \\\\\'object\\\\\')\\\\n        return any;\\\\n    var rv;\\\\n    if (isArray(any)) {\\\\n        rv = [];\\\\n        for (var i = 0, l = any.length; i < l; ++i) {\\\\n            rv.push(deepClone(any[i]));\\\\n        }\\\\n    }\\\\n    else if (intrinsicTypes.indexOf(any.constructor) >= 0) {\\\\n        rv = any;\\\\n    }\\\\n    else {\\\\n        rv = any.constructor ? Object.create(any.constructor.prototype) : {};\\\\n        for (var prop in any) {\\\\n            if (hasOwn(any, prop)) {\\\\n                rv[prop] = deepClone(any[prop]);\\\\n            }\\\\n        }\\\\n    }\\\\n    return rv;\\\\n}\\\\nfunction getObjectDiff(a, b, rv, prfx) {\\\\n    // Compares objects a and b and produces a diff object.\\\\n    rv = rv || {};\\\\n    prfx = prfx || \\\\\'\\\\\';\\\\n    keys(a).forEach(function (prop) {\\\\n        if (!hasOwn(b, prop))\\\\n            rv[prfx + prop] = undefined; // Property removed\\\\n        else {\\\\n            var ap = a[prop], bp = b[prop];\\\\n            if (typeof ap === \\\\\'object\\\\\' && typeof bp === \\\\\'object\\\\\' &&\\\\n                ap && bp &&\\\\n                // Now compare constructors are same (not equal because wont work in Safari)\\\\n                (\\\\\'\\\\\' + ap.constructor) === (\\\\\'\\\\\' + bp.constructor))\\\\n                // Same type of object but its properties may have changed\\\\n                getObjectDiff(ap, bp, rv, prfx + prop + \\".\\");\\\\n            else if (ap !== bp)\\\\n                rv[prfx + prop] = b[prop]; // Primitive value changed\\\\n        }\\\\n    });\\\\n    keys(b).forEach(function (prop) {\\\\n        if (!hasOwn(a, prop)) {\\\\n            rv[prfx + prop] = b[prop]; // Property added\\\\n        }\\\\n    });\\\\n    return rv;\\\\n}\\\\n// If first argument is iterable or array-like, return it as an array\\\\nvar iteratorSymbol = typeof Symbol !== \\\\\'undefined\\\\\' && Symbol.iterator;\\\\nvar getIteratorOf = iteratorSymbol ? function (x) {\\\\n    var i;\\\\n    return x != null && (i = x[iteratorSymbol]) && i.apply(x);\\\\n} : function () { return null; };\\\\nvar NO_CHAR_ARRAY = {};\\\\n// Takes one or several arguments and returns an array based on the following criteras:\\\\n// * If several arguments provided, return arguments converted to an array in a way that\\\\n//   still allows javascript engine to optimize the code.\\\\n// * If single argument is an array, return a clone of it.\\\\n// * If this-pointer equals NO_CHAR_ARRAY, don\\\\\'t accept strings as valid iterables as a special\\\\n//   case to the two bullets below.\\\\n// * If single argument is an iterable, convert it to an array and return the resulting array.\\\\n// * If single argument is array-like (has length of type number), convert it to an array.\\\\nfunction getArrayOf(arrayLike) {\\\\n    var i, a, x, it;\\\\n    if (arguments.length === 1) {\\\\n        if (isArray(arrayLike))\\\\n            return arrayLike.slice();\\\\n        if (this === NO_CHAR_ARRAY && typeof arrayLike === \\\\\'string\\\\\')\\\\n            return [arrayLike];\\\\n        if ((it = getIteratorOf(arrayLike))) {\\\\n            a = [];\\\\n            while ((x = it.next()), !x.done)\\\\n                a.push(x.value);\\\\n            return a;\\\\n        }\\\\n        if (arrayLike == null)\\\\n            return [arrayLike];\\\\n        i = arrayLike.length;\\\\n        if (typeof i === \\\\\'number\\\\\') {\\\\n            a = new Array(i);\\\\n            while (i--)\\\\n                a[i] = arrayLike[i];\\\\n            return a;\\\\n        }\\\\n        return [arrayLike];\\\\n    }\\\\n    i = arguments.length;\\\\n    a = new Array(i);\\\\n    while (i--)\\\\n        a[i] = arguments[i];\\\\n    return a;\\\\n}\\\\n\\\\n// By default, debug will be true only if platform is a web platform and its page is served from localhost.\\\\n// When debug = true, error\\\\\'s stacks will contain asyncronic long stacks.\\\\nvar debug = typeof location !== \\\\\'undefined\\\\\' &&\\\\n    // By default, use debug mode if served from localhost.\\\\n    /^(http|https):\\\\\\\\/\\\\\\\\/(localhost|127\\\\\\\\.0\\\\\\\\.0\\\\\\\\.1)/.test(location.href);\\\\nfunction setDebug(value, filter) {\\\\n    debug = value;\\\\n    libraryFilter = filter;\\\\n}\\\\nvar libraryFilter = function () { return true; };\\\\nvar NEEDS_THROW_FOR_STACK = !new Error(\\"\\").stack;\\\\nfunction getErrorWithStack() {\\\\n    \\"use strict\\";\\\\n    if (NEEDS_THROW_FOR_STACK)\\\\n        try {\\\\n            // Doing something naughty in strict mode here to trigger a specific error\\\\n            // that can be explicitely ignored in debugger\\\\\'s exception settings.\\\\n            // If we\\\\\'d just throw new Error() here, IE\\\\\'s debugger\\\\\'s exception settings\\\\n            // will just consider it as \\"exception thrown by javascript code\\" which is\\\\n            // something you wouldn\\\\\'t want it to ignore.\\\\n            getErrorWithStack.arguments;\\\\n            throw new Error(); // Fallback if above line don\\\\\'t throw.\\\\n        }\\\\n        catch (e) {\\\\n            return e;\\\\n        }\\\\n    return new Error();\\\\n}\\\\nfunction prettyStack(exception, numIgnoredFrames) {\\\\n    var stack = exception.stack;\\\\n    if (!stack)\\\\n        return \\"\\";\\\\n    numIgnoredFrames = (numIgnoredFrames || 0);\\\\n    if (stack.indexOf(exception.name) === 0)\\\\n        numIgnoredFrames += (exception.name + exception.message).split(\\\\\'\\\\\\\\n\\\\\').length;\\\\n    return stack.split(\\\\\'\\\\\\\\n\\\\\')\\\\n        .slice(numIgnoredFrames)\\\\n        .filter(libraryFilter)\\\\n        .map(function (frame) { return \\"\\\\\\\\n\\" + frame; })\\\\n        .join(\\\\\'\\\\\');\\\\n}\\\\nfunction deprecated(what, fn) {\\\\n    return function () {\\\\n        console.warn(what + \\" is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. \\" + prettyStack(getErrorWithStack(), 1));\\\\n        return fn.apply(this, arguments);\\\\n    };\\\\n}\\\\n\\\\nvar dexieErrorNames = [\\\\n    \\\\\'Modify\\\\\',\\\\n    \\\\\'Bulk\\\\\',\\\\n    \\\\\'OpenFailed\\\\\',\\\\n    \\\\\'VersionChange\\\\\',\\\\n    \\\\\'Schema\\\\\',\\\\n    \\\\\'Upgrade\\\\\',\\\\n    \\\\\'InvalidTable\\\\\',\\\\n    \\\\\'MissingAPI\\\\\',\\\\n    \\\\\'NoSuchDatabase\\\\\',\\\\n    \\\\\'InvalidArgument\\\\\',\\\\n    \\\\\'SubTransaction\\\\\',\\\\n    \\\\\'Unsupported\\\\\',\\\\n    \\\\\'Internal\\\\\',\\\\n    \\\\\'DatabaseClosed\\\\\',\\\\n    \\\\\'PrematureCommit\\\\\',\\\\n    \\\\\'ForeignAwait\\\\\'\\\\n];\\\\nvar idbDomErrorNames = [\\\\n    \\\\\'Unknown\\\\\',\\\\n    \\\\\'Constraint\\\\\',\\\\n    \\\\\'Data\\\\\',\\\\n    \\\\\'TransactionInactive\\\\\',\\\\n    \\\\\'ReadOnly\\\\\',\\\\n    \\\\\'Version\\\\\',\\\\n    \\\\\'NotFound\\\\\',\\\\n    \\\\\'InvalidState\\\\\',\\\\n    \\\\\'InvalidAccess\\\\\',\\\\n    \\\\\'Abort\\\\\',\\\\n    \\\\\'Timeout\\\\\',\\\\n    \\\\\'QuotaExceeded\\\\\',\\\\n    \\\\\'Syntax\\\\\',\\\\n    \\\\\'DataClone\\\\\'\\\\n];\\\\nvar errorList = dexieErrorNames.concat(idbDomErrorNames);\\\\nvar defaultTexts = {\\\\n    VersionChanged: \\"Database version changed by other database connection\\",\\\\n    DatabaseClosed: \\"Database has been closed\\",\\\\n    Abort: \\"Transaction aborted\\",\\\\n    TransactionInactive: \\"Transaction has already completed or failed\\"\\\\n};\\\\n//\\\\n// DexieError - base class of all out exceptions.\\\\n//\\\\nfunction DexieError(name, msg) {\\\\n    // Reason we don\\\\\'t use ES6 classes is because:\\\\n    // 1. It bloats transpiled code and increases size of minified code.\\\\n    // 2. It doesn\\\\\'t give us much in this case.\\\\n    // 3. It would require sub classes to call super(), which\\\\n    //    is not needed when deriving from Error.\\\\n    this._e = getErrorWithStack();\\\\n    this.name = name;\\\\n    this.message = msg;\\\\n}\\\\nderive(DexieError).from(Error).extend({\\\\n    stack: {\\\\n        get: function () {\\\\n            return this._stack ||\\\\n                (this._stack = this.name + \\": \\" + this.message + prettyStack(this._e, 2));\\\\n        }\\\\n    },\\\\n    toString: function () { return this.name + \\": \\" + this.message; }\\\\n});\\\\nfunction getMultiErrorMessage(msg, failures) {\\\\n    return msg + \\". Errors: \\" + failures\\\\n        .map(function (f) { return f.toString(); })\\\\n        .filter(function (v, i, s) { return s.indexOf(v) === i; }) // Only unique error strings\\\\n        .join(\\\\\'\\\\\\\\n\\\\\');\\\\n}\\\\n//\\\\n// ModifyError - thrown in Collection.modify()\\\\n// Specific constructor because it contains members failures and failedKeys.\\\\n//\\\\nfunction ModifyError(msg, failures, successCount, failedKeys) {\\\\n    this._e = getErrorWithStack();\\\\n    this.failures = failures;\\\\n    this.failedKeys = failedKeys;\\\\n    this.successCount = successCount;\\\\n}\\\\nderive(ModifyError).from(DexieError);\\\\nfunction BulkError(msg, failures) {\\\\n    this._e = getErrorWithStack();\\\\n    this.name = \\"BulkError\\";\\\\n    this.failures = failures;\\\\n    this.message = getMultiErrorMessage(msg, failures);\\\\n}\\\\nderive(BulkError).from(DexieError);\\\\n//\\\\n//\\\\n// Dynamically generate error names and exception classes based\\\\n// on the names in errorList.\\\\n//\\\\n//\\\\n// Map of {ErrorName -> ErrorName + \\"Error\\"}\\\\nvar errnames = errorList.reduce(function (obj, name) { return (obj[name] = name + \\"Error\\", obj); }, {});\\\\n// Need an alias for DexieError because we\\\\\'re gonna create subclasses with the same name.\\\\nvar BaseException = DexieError;\\\\n// Map of {ErrorName -> exception constructor}\\\\nvar exceptions = errorList.reduce(function (obj, name) {\\\\n    // Let the name be \\"DexieError\\" because this name may\\\\n    // be shown in call stack and when debugging. DexieError is\\\\n    // the most true name because it derives from DexieError,\\\\n    // and we cannot change Function.name programatically without\\\\n    // dynamically create a Function object, which would be considered\\\\n    // \\\\\'eval-evil\\\\\'.\\\\n    var fullName = name + \\"Error\\";\\\\n    function DexieError(msgOrInner, inner) {\\\\n        this._e = getErrorWithStack();\\\\n        this.name = fullName;\\\\n        if (!msgOrInner) {\\\\n            this.message = defaultTexts[name] || fullName;\\\\n            this.inner = null;\\\\n        }\\\\n        else if (typeof msgOrInner === \\\\\'string\\\\\') {\\\\n            this.message = msgOrInner;\\\\n            this.inner = inner || null;\\\\n        }\\\\n        else if (typeof msgOrInner === \\\\\'object\\\\\') {\\\\n            this.message = msgOrInner.name + \\" \\" + msgOrInner.message;\\\\n            this.inner = msgOrInner;\\\\n        }\\\\n    }\\\\n    derive(DexieError).from(BaseException);\\\\n    obj[name] = DexieError;\\\\n    return obj;\\\\n}, {});\\\\n// Use ECMASCRIPT standard exceptions where applicable:\\\\nexceptions.Syntax = SyntaxError;\\\\nexceptions.Type = TypeError;\\\\nexceptions.Range = RangeError;\\\\nvar exceptionMap = idbDomErrorNames.reduce(function (obj, name) {\\\\n    obj[name + \\"Error\\"] = exceptions[name];\\\\n    return obj;\\\\n}, {});\\\\nfunction mapError(domError, message) {\\\\n    if (!domError || domError instanceof DexieError || domError instanceof TypeError || domError instanceof SyntaxError || !domError.name || !exceptionMap[domError.name])\\\\n        return domError;\\\\n    var rv = new exceptionMap[domError.name](message || domError.message, domError);\\\\n    if (\\"stack\\" in domError) {\\\\n        // Derive stack from inner exception if it has a stack\\\\n        setProp(rv, \\"stack\\", { get: function () {\\\\n                return this.inner.stack;\\\\n            } });\\\\n    }\\\\n    return rv;\\\\n}\\\\nvar fullNameExceptions = errorList.reduce(function (obj, name) {\\\\n    if ([\\"Syntax\\", \\"Type\\", \\"Range\\"].indexOf(name) === -1)\\\\n        obj[name + \\"Error\\"] = exceptions[name];\\\\n    return obj;\\\\n}, {});\\\\nfullNameExceptions.ModifyError = ModifyError;\\\\nfullNameExceptions.DexieError = DexieError;\\\\nfullNameExceptions.BulkError = BulkError;\\\\n\\\\nfunction nop() { }\\\\nfunction mirror(val) { return val; }\\\\nfunction pureFunctionChain(f1, f2) {\\\\n    // Enables chained events that takes ONE argument and returns it to the next function in chain.\\\\n    // This pattern is used in the hook(\\"reading\\") event.\\\\n    if (f1 == null || f1 === mirror)\\\\n        return f2;\\\\n    return function (val) {\\\\n        return f2(f1(val));\\\\n    };\\\\n}\\\\nfunction callBoth(on1, on2) {\\\\n    return function () {\\\\n        on1.apply(this, arguments);\\\\n        on2.apply(this, arguments);\\\\n    };\\\\n}\\\\nfunction hookCreatingChain(f1, f2) {\\\\n    // Enables chained events that takes several arguments and may modify first argument by making a modification and then returning the same instance.\\\\n    // This pattern is used in the hook(\\"creating\\") event.\\\\n    if (f1 === nop)\\\\n        return f2;\\\\n    return function () {\\\\n        var res = f1.apply(this, arguments);\\\\n        if (res !== undefined)\\\\n            arguments[0] = res;\\\\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\\\\n        onerror = this.onerror; // In case event listener has set this.onerror\\\\n        this.onsuccess = null;\\\\n        this.onerror = null;\\\\n        var res2 = f2.apply(this, arguments);\\\\n        if (onsuccess)\\\\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\\\\n        if (onerror)\\\\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\\\\n        return res2 !== undefined ? res2 : res;\\\\n    };\\\\n}\\\\nfunction hookDeletingChain(f1, f2) {\\\\n    if (f1 === nop)\\\\n        return f2;\\\\n    return function () {\\\\n        f1.apply(this, arguments);\\\\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\\\\n        onerror = this.onerror; // In case event listener has set this.onerror\\\\n        this.onsuccess = this.onerror = null;\\\\n        f2.apply(this, arguments);\\\\n        if (onsuccess)\\\\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\\\\n        if (onerror)\\\\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\\\\n    };\\\\n}\\\\nfunction hookUpdatingChain(f1, f2) {\\\\n    if (f1 === nop)\\\\n        return f2;\\\\n    return function (modifications) {\\\\n        var res = f1.apply(this, arguments);\\\\n        extend(modifications, res); // If f1 returns new modifications, extend caller\\\\\'s modifications with the result before calling next in chain.\\\\n        var onsuccess = this.onsuccess, // In case event listener has set this.onsuccess\\\\n        onerror = this.onerror; // In case event listener has set this.onerror\\\\n        this.onsuccess = null;\\\\n        this.onerror = null;\\\\n        var res2 = f2.apply(this, arguments);\\\\n        if (onsuccess)\\\\n            this.onsuccess = this.onsuccess ? callBoth(onsuccess, this.onsuccess) : onsuccess;\\\\n        if (onerror)\\\\n            this.onerror = this.onerror ? callBoth(onerror, this.onerror) : onerror;\\\\n        return res === undefined ?\\\\n            (res2 === undefined ? undefined : res2) :\\\\n            (extend(res, res2));\\\\n    };\\\\n}\\\\nfunction reverseStoppableEventChain(f1, f2) {\\\\n    if (f1 === nop)\\\\n        return f2;\\\\n    return function () {\\\\n        if (f2.apply(this, arguments) === false)\\\\n            return false;\\\\n        return f1.apply(this, arguments);\\\\n    };\\\\n}\\\\n\\\\nfunction promisableChain(f1, f2) {\\\\n    if (f1 === nop)\\\\n        return f2;\\\\n    return function () {\\\\n        var res = f1.apply(this, arguments);\\\\n        if (res && typeof res.then === \\\\\'function\\\\\') {\\\\n            var thiz = this, i = arguments.length, args = new Array(i);\\\\n            while (i--)\\\\n                args[i] = arguments[i];\\\\n            return res.then(function () {\\\\n                return f2.apply(thiz, args);\\\\n            });\\\\n        }\\\\n        return f2.apply(this, arguments);\\\\n    };\\\\n}\\\\n\\\\n/*\\\\n * Copyright (c) 2014-2017 David Fahlander\\\\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/LICENSE-2.0\\\\n */\\\\n//\\\\n// Promise and Zone (PSD) for Dexie library\\\\n//\\\\n// I started out writing this Promise class by copying promise-light (https://github.com/taylorhakes/promise-light) by\\\\n// https://github.com/taylorhakes - an A+ and ECMASCRIPT 6 compliant Promise implementation.\\\\n//\\\\n// In previous versions this was fixed by not calling setTimeout when knowing that the resolve() or reject() came from another\\\\n// tick. In Dexie v1.4.0, I\\\\\'ve rewritten the Promise class entirely. Just some fragments of promise-light is left. I use\\\\n// another strategy now that simplifies everything a lot: to always execute callbacks in a new micro-task, but have an own micro-task\\\\n// engine that is indexedDB compliant across all browsers.\\\\n// Promise class has also been optimized a lot with inspiration from bluebird - to avoid closures as much as possible.\\\\n// Also with inspiration from bluebird, asyncronic stacks in debug mode.\\\\n//\\\\n// Specific non-standard features of this Promise class:\\\\n// * Custom zone support (a.k.a. PSD) with ability to keep zones also when using native promises as well as\\\\n//   native async / await.\\\\n// * Promise.follow() method built upon the custom zone engine, that allows user to track all promises created from current stack frame\\\\n//   and below + all promises that those promises creates or awaits.\\\\n// * Detect any unhandled promise in a PSD-scope (PSD.onunhandled). \\\\n//\\\\n// David Fahlander, https://github.com/dfahlander\\\\n//\\\\n// Just a pointer that only this module knows about.\\\\n// Used in Promise constructor to emulate a private constructor.\\\\nvar INTERNAL = {};\\\\n// Async stacks (long stacks) must not grow infinitely.\\\\nvar LONG_STACKS_CLIP_LIMIT = 100;\\\\nvar MAX_LONG_STACKS = 20;\\\\nvar ZONE_ECHO_LIMIT = 7;\\\\nvar nativePromiseInstanceAndProto = (function () {\\\\n    try {\\\\n        // Be able to patch native async functions\\\\n        return new Function(\\"let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];\\")();\\\\n    }\\\\n    catch (e) {\\\\n        var P = _global.Promise;\\\\n        return P ?\\\\n            [P.resolve(), P.prototype, P.resolve()] :\\\\n            [];\\\\n    }\\\\n})();\\\\nvar resolvedNativePromise = nativePromiseInstanceAndProto[0];\\\\nvar nativePromiseProto = nativePromiseInstanceAndProto[1];\\\\nvar resolvedGlobalPromise = nativePromiseInstanceAndProto[2];\\\\nvar nativePromiseThen = nativePromiseProto && nativePromiseProto.then;\\\\nvar NativePromise = resolvedNativePromise && resolvedNativePromise.constructor;\\\\nvar AsyncFunction = nativePromiseInstanceAndProto[3];\\\\nvar patchGlobalPromise = !!resolvedGlobalPromise;\\\\nvar stack_being_generated = false;\\\\n/* The default function used only for the very first promise in a promise chain.\\\\n   As soon as then promise is resolved or rejected, all next tasks will be executed in micro ticks\\\\n   emulated in this module. For indexedDB compatibility, this means that every method needs to\\\\n   execute at least one promise before doing an indexedDB operation. Dexie will always call\\\\n   db.ready().then() for every operation to make sure the indexedDB event is started in an\\\\n   indexedDB-compatible emulated micro task loop.\\\\n*/\\\\nvar schedulePhysicalTick = resolvedGlobalPromise ?\\\\n    function () { resolvedGlobalPromise.then(physicalTick); }\\\\n    :\\\\n        _global.setImmediate ?\\\\n            // setImmediate supported. Those modern platforms also supports Function.bind().\\\\n            setImmediate.bind(null, physicalTick) :\\\\n            _global.MutationObserver ?\\\\n                // MutationObserver supported\\\\n                function () {\\\\n                    var hiddenDiv = document.createElement(\\"div\\");\\\\n                    (new MutationObserver(function () {\\\\n                        physicalTick();\\\\n                        hiddenDiv = null;\\\\n                    })).observe(hiddenDiv, { attributes: true });\\\\n                    hiddenDiv.setAttribute(\\\\\'i\\\\\', \\\\\'1\\\\\');\\\\n                } :\\\\n                // No support for setImmediate or MutationObserver. No worry, setTimeout is only called\\\\n                // once time. Every tick that follows will be our emulated micro tick.\\\\n                // Could have uses setTimeout.bind(null, 0, physicalTick) if it wasnt for that FF13 and below has a bug \\\\n                function () { setTimeout(physicalTick, 0); };\\\\n// Configurable through Promise.scheduler.\\\\n// Don\\\\\'t export because it would be unsafe to let unknown\\\\n// code call it unless they do try..catch within their callback.\\\\n// This function can be retrieved through getter of Promise.scheduler though,\\\\n// but users must not do Promise.scheduler = myFuncThatThrowsException\\\\nvar asap$1 = function (callback, args) {\\\\n    microtickQueue.push([callback, args]);\\\\n    if (needsNewPhysicalTick) {\\\\n        schedulePhysicalTick();\\\\n        needsNewPhysicalTick = false;\\\\n    }\\\\n};\\\\nvar isOutsideMicroTick = true;\\\\nvar needsNewPhysicalTick = true;\\\\nvar unhandledErrors = [];\\\\nvar rejectingErrors = [];\\\\nvar currentFulfiller = null;\\\\nvar rejectionMapper = mirror; // Remove in next major when removing error mapping of DOMErrors and DOMExceptions\\\\nvar globalPSD = {\\\\n    id: \\\\\'global\\\\\',\\\\n    global: true,\\\\n    ref: 0,\\\\n    unhandleds: [],\\\\n    onunhandled: globalError,\\\\n    pgp: false,\\\\n    env: {},\\\\n    finalize: function () {\\\\n        this.unhandleds.forEach(function (uh) {\\\\n            try {\\\\n                globalError(uh[0], uh[1]);\\\\n            }\\\\n            catch (e) { }\\\\n        });\\\\n    }\\\\n};\\\\nvar PSD = globalPSD;\\\\nvar microtickQueue = []; // Callbacks to call in this or next physical tick.\\\\nvar numScheduledCalls = 0; // Number of listener-calls left to do in this physical tick.\\\\nvar tickFinalizers = []; // Finalizers to call when there are no more async calls scheduled within current physical tick.\\\\nfunction Promise(fn) {\\\\n    if (typeof this !== \\\\\'object\\\\\')\\\\n        throw new TypeError(\\\\\'Promises must be constructed via new\\\\\');\\\\n    this._listeners = [];\\\\n    this.onuncatched = nop; // Deprecate in next major. Not needed. Better to use global error handler.\\\\n    // A library may set `promise._lib = true;` after promise is created to make resolve() or reject()\\\\n    // execute the microtask engine implicitely within the call to resolve() or reject().\\\\n    // To remain A+ compliant, a library must only set `_lib=true` if it can guarantee that the stack\\\\n    // only contains library code when calling resolve() or reject().\\\\n    // RULE OF THUMB: ONLY set _lib = true for promises explicitely resolving/rejecting directly from\\\\n    // global scope (event handler, timer etc)!\\\\n    this._lib = false;\\\\n    // Current async scope\\\\n    var psd = (this._PSD = PSD);\\\\n    if (debug) {\\\\n        this._stackHolder = getErrorWithStack();\\\\n        this._prev = null;\\\\n        this._numPrev = 0; // Number of previous promises (for long stacks)\\\\n    }\\\\n    if (typeof fn !== \\\\\'function\\\\\') {\\\\n        if (fn !== INTERNAL)\\\\n            throw new TypeError(\\\\\'Not a function\\\\\');\\\\n        // Private constructor (INTERNAL, state, value).\\\\n        // Used internally by Promise.resolve() and Promise.reject().\\\\n        this._state = arguments[1];\\\\n        this._value = arguments[2];\\\\n        if (this._state === false)\\\\n            handleRejection(this, this._value); // Map error, set stack and addPossiblyUnhandledError().\\\\n        return;\\\\n    }\\\\n    this._state = null; // null (=pending), false (=rejected) or true (=resolved)\\\\n    this._value = null; // error or result\\\\n    ++psd.ref; // Refcounting current scope\\\\n    executePromiseTask(this, fn);\\\\n}\\\\n// Prepare a property descriptor to put onto Promise.prototype.then\\\\nvar thenProp = {\\\\n    get: function () {\\\\n        var psd = PSD, microTaskId = totalEchoes;\\\\n        function then(onFulfilled, onRejected) {\\\\n            var _this = this;\\\\n            var possibleAwait = !psd.global && (psd !== PSD || microTaskId !== totalEchoes);\\\\n            if (possibleAwait)\\\\n                decrementExpectedAwaits();\\\\n            var rv = new Promise(function (resolve, reject) {\\\\n                propagateToListener(_this, new Listener(nativeAwaitCompatibleWrap(onFulfilled, psd, possibleAwait), nativeAwaitCompatibleWrap(onRejected, psd, possibleAwait), resolve, reject, psd));\\\\n            });\\\\n            debug && linkToPreviousPromise(rv, this);\\\\n            return rv;\\\\n        }\\\\n        then.prototype = INTERNAL; // For idempotense, see setter below.\\\\n        return then;\\\\n    },\\\\n    // Be idempotent and allow another framework (such as zone.js or another instance of a Dexie.Promise module) to replace Promise.prototype.then\\\\n    // and when that framework wants to restore the original property, we must identify that and restore the original property descriptor.\\\\n    set: function (value) {\\\\n        setProp(this, \\\\\'then\\\\\', value && value.prototype === INTERNAL ?\\\\n            thenProp : // Restore to original property descriptor.\\\\n            {\\\\n                get: function () {\\\\n                    return value; // Getter returning provided value (behaves like value is just changed)\\\\n                },\\\\n                set: thenProp.set // Keep a setter that is prepared to restore original.\\\\n            });\\\\n    }\\\\n};\\\\nprops(Promise.prototype, {\\\\n    then: thenProp,\\\\n    _then: function (onFulfilled, onRejected) {\\\\n        // A little tinier version of then() that don\\\\\'t have to create a resulting promise.\\\\n        propagateToListener(this, new Listener(null, null, onFulfilled, onRejected, PSD));\\\\n    },\\\\n    catch: function (onRejected) {\\\\n        if (arguments.length === 1)\\\\n            return this.then(null, onRejected);\\\\n        // First argument is the Error type to catch\\\\n        var type = arguments[0], handler = arguments[1];\\\\n        return typeof type === \\\\\'function\\\\\' ? this.then(null, function (err) {\\\\n            // Catching errors by its constructor type (similar to java / c++ / c#)\\\\n            // Sample: promise.catch(TypeError, function (e) { ... });\\\\n            return err instanceof type ? handler(err) : PromiseReject(err);\\\\n        })\\\\n            : this.then(null, function (err) {\\\\n                // Catching errors by the error.name property. Makes sense for indexedDB where error type\\\\n                // is always DOMError but where e.name tells the actual error type.\\\\n                // Sample: promise.catch(\\\\\'ConstraintError\\\\\', function (e) { ... });\\\\n                return err && err.name === type ? handler(err) : PromiseReject(err);\\\\n            });\\\\n    },\\\\n    finally: function (onFinally) {\\\\n        return this.then(function (value) {\\\\n            onFinally();\\\\n            return value;\\\\n        }, function (err) {\\\\n            onFinally();\\\\n            return PromiseReject(err);\\\\n        });\\\\n    },\\\\n    stack: {\\\\n        get: function () {\\\\n            if (this._stack)\\\\n                return this._stack;\\\\n            try {\\\\n                stack_being_generated = true;\\\\n                var stacks = getStack(this, [], MAX_LONG_STACKS);\\\\n                var stack = stacks.join(\\"\\\\\\\\nFrom previous: \\");\\\\n                if (this._state !== null)\\\\n                    this._stack = stack; // Stack may be updated on reject.\\\\n                return stack;\\\\n            }\\\\n            finally {\\\\n                stack_being_generated = false;\\\\n            }\\\\n        }\\\\n    },\\\\n    timeout: function (ms, msg) {\\\\n        var _this = this;\\\\n        return ms < Infinity ?\\\\n            new Promise(function (resolve, reject) {\\\\n                var handle = setTimeout(function () { return reject(new exceptions.Timeout(msg)); }, ms);\\\\n                _this.then(resolve, reject).finally(clearTimeout.bind(null, handle));\\\\n            }) : this;\\\\n    }\\\\n});\\\\nif (typeof Symbol !== \\\\\'undefined\\\\\' && Symbol.toStringTag)\\\\n    setProp(Promise.prototype, Symbol.toStringTag, \\\\\'Promise\\\\\');\\\\n// Now that Promise.prototype is defined, we have all it takes to set globalPSD.env.\\\\n// Environment globals snapshotted on leaving global zone\\\\nglobalPSD.env = snapShot();\\\\nfunction Listener(onFulfilled, onRejected, resolve, reject, zone) {\\\\n    this.onFulfilled = typeof onFulfilled === \\\\\'function\\\\\' ? onFulfilled : null;\\\\n    this.onRejected = typeof onRejected === \\\\\'function\\\\\' ? onRejected : null;\\\\n    this.resolve = resolve;\\\\n    this.reject = reject;\\\\n    this.psd = zone;\\\\n}\\\\n// Promise Static Properties\\\\nprops(Promise, {\\\\n    all: function () {\\\\n        var values = getArrayOf.apply(null, arguments) // Supports iterables, implicit arguments and array-like.\\\\n            .map(onPossibleParallellAsync); // Handle parallell async/awaits \\\\n        return new Promise(function (resolve, reject) {\\\\n            if (values.length === 0)\\\\n                resolve([]);\\\\n            var remaining = values.length;\\\\n            values.forEach(function (a, i) { return Promise.resolve(a).then(function (x) {\\\\n                values[i] = x;\\\\n                if (!--remaining)\\\\n                    resolve(values);\\\\n            }, reject); });\\\\n        });\\\\n    },\\\\n    resolve: function (value) {\\\\n        if (value instanceof Promise)\\\\n            return value;\\\\n        if (value && typeof value.then === \\\\\'function\\\\\')\\\\n            return new Promise(function (resolve, reject) {\\\\n                value.then(resolve, reject);\\\\n            });\\\\n        var rv = new Promise(INTERNAL, true, value);\\\\n        linkToPreviousPromise(rv, currentFulfiller);\\\\n        return rv;\\\\n    },\\\\n    reject: PromiseReject,\\\\n    race: function () {\\\\n        var values = getArrayOf.apply(null, arguments).map(onPossibleParallellAsync);\\\\n        return new Promise(function (resolve, reject) {\\\\n            values.map(function (value) { return Promise.resolve(value).then(resolve, reject); });\\\\n        });\\\\n    },\\\\n    PSD: {\\\\n        get: function () { return PSD; },\\\\n        set: function (value) { return PSD = value; }\\\\n    },\\\\n    //totalEchoes: {get: ()=>totalEchoes},\\\\n    //task: {get: ()=>task},\\\\n    newPSD: newScope,\\\\n    usePSD: usePSD,\\\\n    scheduler: {\\\\n        get: function () { return asap$1; },\\\\n        set: function (value) { asap$1 = value; }\\\\n    },\\\\n    rejectionMapper: {\\\\n        get: function () { return rejectionMapper; },\\\\n        set: function (value) { rejectionMapper = value; } // Map reject failures\\\\n    },\\\\n    follow: function (fn, zoneProps) {\\\\n        return new Promise(function (resolve, reject) {\\\\n            return newScope(function (resolve, reject) {\\\\n                var psd = PSD;\\\\n                psd.unhandleds = []; // For unhandled standard- or 3rd party Promises. Checked at psd.finalize()\\\\n                psd.onunhandled = reject; // Triggered directly on unhandled promises of this library.\\\\n                psd.finalize = callBoth(function () {\\\\n                    var _this = this;\\\\n                    // Unhandled standard or 3rd part promises are put in PSD.unhandleds and\\\\n                    // examined upon scope completion while unhandled rejections in this Promise\\\\n                    // will trigger directly through psd.onunhandled\\\\n                    run_at_end_of_this_or_next_physical_tick(function () {\\\\n                        _this.unhandleds.length === 0 ? resolve() : reject(_this.unhandleds[0]);\\\\n                    });\\\\n                }, psd.finalize);\\\\n                fn();\\\\n            }, zoneProps, resolve, reject);\\\\n        });\\\\n    }\\\\n});\\\\n/**\\\\n* Take a potentially misbehaving resolver function and make sure\\\\n* onFulfilled and onRejected are only called once.\\\\n*\\\\n* Makes no guarantees about asynchrony.\\\\n*/\\\\nfunction executePromiseTask(promise, fn) {\\\\n    // Promise Resolution Procedure:\\\\n    // https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\\\\n    try {\\\\n        fn(function (value) {\\\\n            if (promise._state !== null)\\\\n                return; // Already settled\\\\n            if (value === promise)\\\\n                throw new TypeError(\\\\\'A promise cannot be resolved with itself.\\\\\');\\\\n            var shouldExecuteTick = promise._lib && beginMicroTickScope();\\\\n            if (value && typeof value.then === \\\\\'function\\\\\') {\\\\n                executePromiseTask(promise, function (resolve, reject) {\\\\n                    value instanceof Promise ?\\\\n                        value._then(resolve, reject) :\\\\n                        value.then(resolve, reject);\\\\n                });\\\\n            }\\\\n            else {\\\\n                promise._state = true;\\\\n                promise._value = value;\\\\n                propagateAllListeners(promise);\\\\n            }\\\\n            if (shouldExecuteTick)\\\\n                endMicroTickScope();\\\\n        }, handleRejection.bind(null, promise)); // If Function.bind is not supported. Exception is handled in catch below\\\\n    }\\\\n    catch (ex) {\\\\n        handleRejection(promise, ex);\\\\n    }\\\\n}\\\\nfunction handleRejection(promise, reason) {\\\\n    rejectingErrors.push(reason);\\\\n    if (promise._state !== null)\\\\n        return;\\\\n    var shouldExecuteTick = promise._lib && beginMicroTickScope();\\\\n    reason = rejectionMapper(reason);\\\\n    promise._state = false;\\\\n    promise._value = reason;\\\\n    debug && reason !== null && typeof reason === \\\\\'object\\\\\' && !reason._promise && tryCatch(function () {\\\\n        var origProp = getPropertyDescriptor(reason, \\"stack\\");\\\\n        reason._promise = promise;\\\\n        setProp(reason, \\"stack\\", {\\\\n            get: function () {\\\\n                return stack_being_generated ?\\\\n                    origProp && (origProp.get ?\\\\n                        origProp.get.apply(reason) :\\\\n                        origProp.value) :\\\\n                    promise.stack;\\\\n            }\\\\n        });\\\\n    });\\\\n    // Add the failure to a list of possibly uncaught errors\\\\n    addPossiblyUnhandledError(promise);\\\\n    propagateAllListeners(promise);\\\\n    if (shouldExecuteTick)\\\\n        endMicroTickScope();\\\\n}\\\\nfunction propagateAllListeners(promise) {\\\\n    //debug && linkToPreviousPromise(promise);\\\\n    var listeners = promise._listeners;\\\\n    promise._listeners = [];\\\\n    for (var i = 0, len = listeners.length; i < len; ++i) {\\\\n        propagateToListener(promise, listeners[i]);\\\\n    }\\\\n    var psd = promise._PSD;\\\\n    --psd.ref || psd.finalize(); // if psd.ref reaches zero, call psd.finalize();\\\\n    if (numScheduledCalls === 0) {\\\\n        // If numScheduledCalls is 0, it means that our stack is not in a callback of a scheduled call,\\\\n        // and that no deferreds where listening to this rejection or success.\\\\n        // Since there is a risk that our stack can contain application code that may\\\\n        // do stuff after this code is finished that may generate new calls, we cannot\\\\n        // call finalizers here.\\\\n        ++numScheduledCalls;\\\\n        asap$1(function () {\\\\n            if (--numScheduledCalls === 0)\\\\n                finalizePhysicalTick(); // Will detect unhandled errors\\\\n        }, []);\\\\n    }\\\\n}\\\\nfunction propagateToListener(promise, listener) {\\\\n    if (promise._state === null) {\\\\n        promise._listeners.push(listener);\\\\n        return;\\\\n    }\\\\n    var cb = promise._state ? listener.onFulfilled : listener.onRejected;\\\\n    if (cb === null) {\\\\n        // This Listener doesnt have a listener for the event being triggered (onFulfilled or onReject) so lets forward the event to any eventual listeners on the Promise instance returned by then() or catch()\\\\n        return (promise._state ? listener.resolve : listener.reject)(promise._value);\\\\n    }\\\\n    ++listener.psd.ref;\\\\n    ++numScheduledCalls;\\\\n    asap$1(callListener, [cb, promise, listener]);\\\\n}\\\\nfunction callListener(cb, promise, listener) {\\\\n    try {\\\\n        // Set static variable currentFulfiller to the promise that is being fullfilled,\\\\n        // so that we connect the chain of promises (for long stacks support)\\\\n        currentFulfiller = promise;\\\\n        // Call callback and resolve our listener with it\\\\\'s return value.\\\\n        var ret, value = promise._value;\\\\n        if (promise._state) {\\\\n            // cb is onResolved\\\\n            ret = cb(value);\\\\n        }\\\\n        else {\\\\n            // cb is onRejected\\\\n            if (rejectingErrors.length)\\\\n                rejectingErrors = [];\\\\n            ret = cb(value);\\\\n            if (rejectingErrors.indexOf(value) === -1)\\\\n                markErrorAsHandled(promise); // Callback didnt do Promise.reject(err) nor reject(err) onto another promise.\\\\n        }\\\\n        listener.resolve(ret);\\\\n    }\\\\n    catch (e) {\\\\n        // Exception thrown in callback. Reject our listener.\\\\n        listener.reject(e);\\\\n    }\\\\n    finally {\\\\n        // Restore env and currentFulfiller.\\\\n        currentFulfiller = null;\\\\n        if (--numScheduledCalls === 0)\\\\n            finalizePhysicalTick();\\\\n        --listener.psd.ref || listener.psd.finalize();\\\\n    }\\\\n}\\\\nfunction getStack(promise, stacks, limit) {\\\\n    if (stacks.length === limit)\\\\n        return stacks;\\\\n    var stack = \\"\\";\\\\n    if (promise._state === false) {\\\\n        var failure = promise._value, errorName, message;\\\\n        if (failure != null) {\\\\n            errorName = failure.name || \\"Error\\";\\\\n            message = failure.message || failure;\\\\n            stack = prettyStack(failure, 0);\\\\n        }\\\\n        else {\\\\n            errorName = failure; // If error is undefined or null, show that.\\\\n            message = \\"\\";\\\\n        }\\\\n        stacks.push(errorName + (message ? \\": \\" + message : \\"\\") + stack);\\\\n    }\\\\n    if (debug) {\\\\n        stack = prettyStack(promise._stackHolder, 2);\\\\n        if (stack && stacks.indexOf(stack) === -1)\\\\n            stacks.push(stack);\\\\n        if (promise._prev)\\\\n            getStack(promise._prev, stacks, limit);\\\\n    }\\\\n    return stacks;\\\\n}\\\\nfunction linkToPreviousPromise(promise, prev) {\\\\n    // Support long stacks by linking to previous completed promise.\\\\n    var numPrev = prev ? prev._numPrev + 1 : 0;\\\\n    if (numPrev < LONG_STACKS_CLIP_LIMIT) {\\\\n        promise._prev = prev;\\\\n        promise._numPrev = numPrev;\\\\n    }\\\\n}\\\\n/* The callback to schedule with setImmediate() or setTimeout().\\\\n   It runs a virtual microtick and executes any callback registered in microtickQueue.\\\\n */\\\\nfunction physicalTick() {\\\\n    beginMicroTickScope() && endMicroTickScope();\\\\n}\\\\nfunction beginMicroTickScope() {\\\\n    var wasRootExec = isOutsideMicroTick;\\\\n    isOutsideMicroTick = false;\\\\n    needsNewPhysicalTick = false;\\\\n    return wasRootExec;\\\\n}\\\\n/* Executes micro-ticks without doing try..catch.\\\\n   This can be possible because we only use this internally and\\\\n   the registered functions are exception-safe (they do try..catch\\\\n   internally before calling any external method). If registering\\\\n   functions in the microtickQueue that are not exception-safe, this\\\\n   would destroy the framework and make it instable. So we don\\\\\'t export\\\\n   our asap method.\\\\n*/\\\\nfunction endMicroTickScope() {\\\\n    var callbacks, i, l;\\\\n    do {\\\\n        while (microtickQueue.length > 0) {\\\\n            callbacks = microtickQueue;\\\\n            microtickQueue = [];\\\\n            l = callbacks.length;\\\\n            for (i = 0; i < l; ++i) {\\\\n                var item = callbacks[i];\\\\n                item[0].apply(null, item[1]);\\\\n            }\\\\n        }\\\\n    } while (microtickQueue.length > 0);\\\\n    isOutsideMicroTick = true;\\\\n    needsNewPhysicalTick = true;\\\\n}\\\\nfunction finalizePhysicalTick() {\\\\n    var unhandledErrs = unhandledErrors;\\\\n    unhandledErrors = [];\\\\n    unhandledErrs.forEach(function (p) {\\\\n        p._PSD.onunhandled.call(null, p._value, p);\\\\n    });\\\\n    var finalizers = tickFinalizers.slice(0); // Clone first because finalizer may remove itself from list.\\\\n    var i = finalizers.length;\\\\n    while (i)\\\\n        finalizers[--i]();\\\\n}\\\\nfunction run_at_end_of_this_or_next_physical_tick(fn) {\\\\n    function finalizer() {\\\\n        fn();\\\\n        tickFinalizers.splice(tickFinalizers.indexOf(finalizer), 1);\\\\n    }\\\\n    tickFinalizers.push(finalizer);\\\\n    ++numScheduledCalls;\\\\n    asap$1(function () {\\\\n        if (--numScheduledCalls === 0)\\\\n            finalizePhysicalTick();\\\\n    }, []);\\\\n}\\\\nfunction addPossiblyUnhandledError(promise) {\\\\n    // Only add to unhandledErrors if not already there. The first one to add to this list\\\\n    // will be upon the first rejection so that the root cause (first promise in the\\\\n    // rejection chain) is the one listed.\\\\n    if (!unhandledErrors.some(function (p) { return p._value === promise._value; }))\\\\n        unhandledErrors.push(promise);\\\\n}\\\\nfunction markErrorAsHandled(promise) {\\\\n    // Called when a reject handled is actually being called.\\\\n    // Search in unhandledErrors for any promise whos _value is this promise_value (list\\\\n    // contains only rejected promises, and only one item per error)\\\\n    var i = unhandledErrors.length;\\\\n    while (i)\\\\n        if (unhandledErrors[--i]._value === promise._value) {\\\\n            // Found a promise that failed with this same error object pointer,\\\\n            // Remove that since there is a listener that actually takes care of it.\\\\n            unhandledErrors.splice(i, 1);\\\\n            return;\\\\n        }\\\\n}\\\\nfunction PromiseReject(reason) {\\\\n    return new Promise(INTERNAL, false, reason);\\\\n}\\\\nfunction wrap(fn, errorCatcher) {\\\\n    var psd = PSD;\\\\n    return function () {\\\\n        var wasRootExec = beginMicroTickScope(), outerScope = PSD;\\\\n        try {\\\\n            switchToZone(psd, true);\\\\n            return fn.apply(this, arguments);\\\\n        }\\\\n        catch (e) {\\\\n            errorCatcher && errorCatcher(e);\\\\n        }\\\\n        finally {\\\\n            switchToZone(outerScope, false);\\\\n            if (wasRootExec)\\\\n                endMicroTickScope();\\\\n        }\\\\n    };\\\\n}\\\\n//\\\\n// variables used for native await support\\\\n//\\\\nvar task = { awaits: 0, echoes: 0, id: 0 }; // The ongoing macro-task when using zone-echoing.\\\\nvar taskCounter = 0; // ID counter for macro tasks.\\\\nvar zoneStack = []; // Stack of left zones to restore asynchronically.\\\\nvar zoneEchoes = 0; // zoneEchoes is a must in order to persist zones between native await expressions.\\\\nvar totalEchoes = 0; // ID counter for micro-tasks. Used to detect possible native await in our Promise.prototype.then.\\\\nvar zone_id_counter = 0;\\\\nfunction newScope(fn, props$$1, a1, a2) {\\\\n    var parent = PSD, psd = Object.create(parent);\\\\n    psd.parent = parent;\\\\n    psd.ref = 0;\\\\n    psd.global = false;\\\\n    psd.id = ++zone_id_counter;\\\\n    // Prepare for promise patching (done in usePSD):\\\\n    var globalEnv = globalPSD.env;\\\\n    psd.env = patchGlobalPromise ? {\\\\n        Promise: Promise,\\\\n        PromiseProp: { value: Promise, configurable: true, writable: true },\\\\n        all: Promise.all,\\\\n        race: Promise.race,\\\\n        resolve: Promise.resolve,\\\\n        reject: Promise.reject,\\\\n        nthen: getPatchedPromiseThen(globalEnv.nthen, psd),\\\\n        gthen: getPatchedPromiseThen(globalEnv.gthen, psd) // global then\\\\n    } : {};\\\\n    if (props$$1)\\\\n        extend(psd, props$$1);\\\\n    // unhandleds and onunhandled should not be specifically set here.\\\\n    // Leave them on parent prototype.\\\\n    // unhandleds.push(err) will push to parent\\\\\'s prototype\\\\n    // onunhandled() will call parents onunhandled (with this scope\\\\\'s this-pointer though!)\\\\n    ++parent.ref;\\\\n    psd.finalize = function () {\\\\n        --this.parent.ref || this.parent.finalize();\\\\n    };\\\\n    var rv = usePSD(psd, fn, a1, a2);\\\\n    if (psd.ref === 0)\\\\n        psd.finalize();\\\\n    return rv;\\\\n}\\\\n// Function to call if scopeFunc returns NativePromise\\\\n// Also for each NativePromise in the arguments to Promise.all()\\\\nfunction incrementExpectedAwaits() {\\\\n    if (!task.id)\\\\n        task.id = ++taskCounter;\\\\n    ++task.awaits;\\\\n    task.echoes += ZONE_ECHO_LIMIT;\\\\n    return task.id;\\\\n}\\\\n// Function to call when \\\\\'then\\\\\' calls back on a native promise where onAwaitExpected() had been called.\\\\n// Also call this when a native await calls then method on a promise. In that case, don\\\\\'t supply\\\\n// sourceTaskId because we already know it refers to current task.\\\\nfunction decrementExpectedAwaits(sourceTaskId) {\\\\n    if (!task.awaits || (sourceTaskId && sourceTaskId !== task.id))\\\\n        return;\\\\n    if (--task.awaits === 0)\\\\n        task.id = 0;\\\\n    task.echoes = task.awaits * ZONE_ECHO_LIMIT; // Will reset echoes to 0 if awaits is 0.\\\\n}\\\\n// Call from Promise.all() and Promise.race()\\\\nfunction onPossibleParallellAsync(possiblePromise) {\\\\n    if (task.echoes && possiblePromise && possiblePromise.constructor === NativePromise) {\\\\n        incrementExpectedAwaits();\\\\n        return possiblePromise.then(function (x) {\\\\n            decrementExpectedAwaits();\\\\n            return x;\\\\n        }, function (e) {\\\\n            decrementExpectedAwaits();\\\\n            return rejection(e);\\\\n        });\\\\n    }\\\\n    return possiblePromise;\\\\n}\\\\nfunction zoneEnterEcho(targetZone) {\\\\n    ++totalEchoes;\\\\n    if (!task.echoes || --task.echoes === 0) {\\\\n        task.echoes = task.id = 0; // Cancel zone echoing.\\\\n    }\\\\n    zoneStack.push(PSD);\\\\n    switchToZone(targetZone, true);\\\\n}\\\\nfunction zoneLeaveEcho() {\\\\n    var zone = zoneStack[zoneStack.length - 1];\\\\n    zoneStack.pop();\\\\n    switchToZone(zone, false);\\\\n}\\\\nfunction switchToZone(targetZone, bEnteringZone) {\\\\n    var currentZone = PSD;\\\\n    if (bEnteringZone ? task.echoes && (!zoneEchoes++ || targetZone !== PSD) : zoneEchoes && (!--zoneEchoes || targetZone !== PSD)) {\\\\n        // Enter or leave zone asynchronically as well, so that tasks initiated during current tick\\\\n        // will be surrounded by the zone when they are invoked.\\\\n        enqueueNativeMicroTask(bEnteringZone ? zoneEnterEcho.bind(null, targetZone) : zoneLeaveEcho);\\\\n    }\\\\n    if (targetZone === PSD)\\\\n        return;\\\\n    PSD = targetZone; // The actual zone switch occurs at this line.\\\\n    // Snapshot on every leave from global zone.\\\\n    if (currentZone === globalPSD)\\\\n        globalPSD.env = snapShot();\\\\n    if (patchGlobalPromise) {\\\\n        // Let\\\\\'s patch the global and native Promises (may be same or may be different)\\\\n        var GlobalPromise = globalPSD.env.Promise;\\\\n        // Swich environments (may be PSD-zone or the global zone. Both apply.)\\\\n        var targetEnv = targetZone.env;\\\\n        // Change Promise.prototype.then for native and global Promise (they MAY differ on polyfilled environments, but both can be accessed)\\\\n        // Must be done on each zone change because the patched method contains targetZone in its closure.\\\\n        nativePromiseProto.then = targetEnv.nthen;\\\\n        GlobalPromise.prototype.then = targetEnv.gthen;\\\\n        if (currentZone.global || targetZone.global) {\\\\n            // Leaving or entering global zone. It\\\\\'s time to patch / restore global Promise.\\\\n            // Set this Promise to window.Promise so that transiled async functions will work on Firefox, Safari and IE, as well as with Zonejs and angular.\\\\n            Object.defineProperty(_global, \\\\\'Promise\\\\\', targetEnv.PromiseProp);\\\\n            // Support Promise.all() etc to work indexedDB-safe also when people are including es6-promise as a module (they might\\\\n            // not be accessing global.Promise but a local reference to it)\\\\n            GlobalPromise.all = targetEnv.all;\\\\n            GlobalPromise.race = targetEnv.race;\\\\n            GlobalPromise.resolve = targetEnv.resolve;\\\\n            GlobalPromise.reject = targetEnv.reject;\\\\n        }\\\\n    }\\\\n}\\\\nfunction snapShot() {\\\\n    var GlobalPromise = _global.Promise;\\\\n    return patchGlobalPromise ? {\\\\n        Promise: GlobalPromise,\\\\n        PromiseProp: Object.getOwnPropertyDescriptor(_global, \\"Promise\\"),\\\\n        all: GlobalPromise.all,\\\\n        race: GlobalPromise.race,\\\\n        resolve: GlobalPromise.resolve,\\\\n        reject: GlobalPromise.reject,\\\\n        nthen: nativePromiseProto.then,\\\\n        gthen: GlobalPromise.prototype.then\\\\n    } : {};\\\\n}\\\\nfunction usePSD(psd, fn, a1, a2, a3) {\\\\n    var outerScope = PSD;\\\\n    try {\\\\n        switchToZone(psd, true);\\\\n        return fn(a1, a2, a3);\\\\n    }\\\\n    finally {\\\\n        switchToZone(outerScope, false);\\\\n    }\\\\n}\\\\nfunction enqueueNativeMicroTask(job) {\\\\n    //\\\\n    // Precondition: nativePromiseThen !== undefined\\\\n    //\\\\n    nativePromiseThen.call(resolvedNativePromise, job);\\\\n}\\\\nfunction nativeAwaitCompatibleWrap(fn, zone, possibleAwait) {\\\\n    return typeof fn !== \\\\\'function\\\\\' ? fn : function () {\\\\n        var outerZone = PSD;\\\\n        if (possibleAwait)\\\\n            incrementExpectedAwaits();\\\\n        switchToZone(zone, true);\\\\n        try {\\\\n            return fn.apply(this, arguments);\\\\n        }\\\\n        finally {\\\\n            switchToZone(outerZone, false);\\\\n        }\\\\n    };\\\\n}\\\\nfunction getPatchedPromiseThen(origThen, zone) {\\\\n    return function (onResolved, onRejected) {\\\\n        return origThen.call(this, nativeAwaitCompatibleWrap(onResolved, zone, false), nativeAwaitCompatibleWrap(onRejected, zone, false));\\\\n    };\\\\n}\\\\nvar UNHANDLEDREJECTION = \\"unhandledrejection\\";\\\\nfunction globalError(err, promise) {\\\\n    var rv;\\\\n    try {\\\\n        rv = promise.onuncatched(err);\\\\n    }\\\\n    catch (e) { }\\\\n    if (rv !== false)\\\\n        try {\\\\n            var event, eventData = { promise: promise, reason: err };\\\\n            if (_global.document && document.createEvent) {\\\\n                event = document.createEvent(\\\\\'Event\\\\\');\\\\n                event.initEvent(UNHANDLEDREJECTION, true, true);\\\\n                extend(event, eventData);\\\\n            }\\\\n            else if (_global.CustomEvent) {\\\\n                event = new CustomEvent(UNHANDLEDREJECTION, { detail: eventData });\\\\n                extend(event, eventData);\\\\n            }\\\\n            if (event && _global.dispatchEvent) {\\\\n                dispatchEvent(event);\\\\n                if (!_global.PromiseRejectionEvent && _global.onunhandledrejection)\\\\n                    // No native support for PromiseRejectionEvent but user has set window.onunhandledrejection. Manually call it.\\\\n                    try {\\\\n                        _global.onunhandledrejection(event);\\\\n                    }\\\\n                    catch (_) { }\\\\n            }\\\\n            if (!event.defaultPrevented) {\\\\n                console.warn(\\"Unhandled rejection: \\" + (err.stack || err));\\\\n            }\\\\n        }\\\\n        catch (e) { }\\\\n}\\\\nvar rejection = Promise.reject;\\\\n\\\\nfunction Events(ctx) {\\\\n    var evs = {};\\\\n    var rv = function (eventName, subscriber) {\\\\n        if (subscriber) {\\\\n            // Subscribe. If additional arguments than just the subscriber was provided, forward them as well.\\\\n            var i = arguments.length, args = new Array(i - 1);\\\\n            while (--i)\\\\n                args[i - 1] = arguments[i];\\\\n            evs[eventName].subscribe.apply(null, args);\\\\n            return ctx;\\\\n        }\\\\n        else if (typeof (eventName) === \\\\\'string\\\\\') {\\\\n            // Return interface allowing to fire or unsubscribe from event\\\\n            return evs[eventName];\\\\n        }\\\\n    };\\\\n    rv.addEventType = add;\\\\n    for (var i = 1, l = arguments.length; i < l; ++i) {\\\\n        add(arguments[i]);\\\\n    }\\\\n    return rv;\\\\n    function add(eventName, chainFunction, defaultFunction) {\\\\n        if (typeof eventName === \\\\\'object\\\\\')\\\\n            return addConfiguredEvents(eventName);\\\\n        if (!chainFunction)\\\\n            chainFunction = reverseStoppableEventChain;\\\\n        if (!defaultFunction)\\\\n            defaultFunction = nop;\\\\n        var context = {\\\\n            subscribers: [],\\\\n            fire: defaultFunction,\\\\n            subscribe: function (cb) {\\\\n                if (context.subscribers.indexOf(cb) === -1) {\\\\n                    context.subscribers.push(cb);\\\\n                    context.fire = chainFunction(context.fire, cb);\\\\n                }\\\\n            },\\\\n            unsubscribe: function (cb) {\\\\n                context.subscribers = context.subscribers.filter(function (fn) { return fn !== cb; });\\\\n                context.fire = context.subscribers.reduce(chainFunction, defaultFunction);\\\\n            }\\\\n        };\\\\n        evs[eventName] = rv[eventName] = context;\\\\n        return context;\\\\n    }\\\\n    function addConfiguredEvents(cfg) {\\\\n        // events(this, {reading: [functionChain, nop]});\\\\n        keys(cfg).forEach(function (eventName) {\\\\n            var args = cfg[eventName];\\\\n            if (isArray(args)) {\\\\n                add(eventName, cfg[eventName][0], cfg[eventName][1]);\\\\n            }\\\\n            else if (args === \\\\\'asap\\\\\') {\\\\n                // Rather than approaching event subscription using a functional approach, we here do it in a for-loop where subscriber is executed in its own stack\\\\n                // enabling that any exception that occur wont disturb the initiator and also not nescessary be catched and forgotten.\\\\n                var context = add(eventName, mirror, function fire() {\\\\n                    // Optimazation-safe cloning of arguments into args.\\\\n                    var i = arguments.length, args = new Array(i);\\\\n                    while (i--)\\\\n                        args[i] = arguments[i];\\\\n                    // All each subscriber:\\\\n                    context.subscribers.forEach(function (fn) {\\\\n                        asap(function fireEvent() {\\\\n                            fn.apply(null, args);\\\\n                        });\\\\n                    });\\\\n                });\\\\n            }\\\\n            else\\\\n                throw new exceptions.InvalidArgument(\\"Invalid event config\\");\\\\n        });\\\\n    }\\\\n}\\\\n\\\\n/*\\\\n * Dexie.js - a minimalistic wrapper for IndexedDB\\\\n * ===============================================\\\\n *\\\\n * Copyright (c) 2014-2017 David Fahlander\\\\n *\\\\n * Version {version}, {date}\\\\n *\\\\n * http://dexie.org\\\\n *\\\\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/LICENSE-2.0\\\\n *\\\\n */\\\\nvar DEXIE_VERSION = \\\\\'{version}\\\\\';\\\\nvar maxString = String.fromCharCode(65535);\\\\nvar maxKey = (function () { try {\\\\n    IDBKeyRange.only([[]]);\\\\n    return [[]];\\\\n}\\\\ncatch (e) {\\\\n    return maxString;\\\\n} })();\\\\nvar minKey = -Infinity;\\\\nvar INVALID_KEY_ARGUMENT = \\"Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.\\";\\\\nvar STRING_EXPECTED = \\"String expected.\\";\\\\nvar connections = [];\\\\nvar isIEOrEdge = typeof navigator !== \\\\\'undefined\\\\\' && /(MSIE|Trident|Edge)/.test(navigator.userAgent);\\\\nvar hasIEDeleteObjectStoreBug = isIEOrEdge;\\\\nvar hangsOnDeleteLargeKeyRange = isIEOrEdge;\\\\nvar dexieStackFrameFilter = function (frame) { return !/(dexie\\\\\\\\.js|dexie\\\\\\\\.min\\\\\\\\.js)/.test(frame); };\\\\nvar dbNamesDB; // Global database for backing Dexie.getDatabaseNames() on browser without indexedDB.webkitGetDatabaseNames() \\\\n// Init debug\\\\nsetDebug(debug, dexieStackFrameFilter);\\\\nfunction Dexie(dbName, options) {\\\\n    /// <param name=\\"options\\" type=\\"Object\\" optional=\\"true\\">Specify only if you wich to control which addons that should run on this instance</param>\\\\n    var deps = Dexie.dependencies;\\\\n    var opts = extend({\\\\n        // Default Options\\\\n        addons: Dexie.addons,\\\\n        autoOpen: true,\\\\n        indexedDB: deps.indexedDB,\\\\n        IDBKeyRange: deps.IDBKeyRange // Backend IDBKeyRange api. Default to browser env.\\\\n    }, options);\\\\n    var addons = opts.addons, autoOpen = opts.autoOpen, indexedDB = opts.indexedDB, IDBKeyRange = opts.IDBKeyRange;\\\\n    var globalSchema = this._dbSchema = {};\\\\n    var versions = [];\\\\n    var dbStoreNames = [];\\\\n    var allTables = {};\\\\n    ///<var type=\\"IDBDatabase\\" />\\\\n    var idbdb = null; // Instance of IDBDatabase\\\\n    var dbOpenError = null;\\\\n    var isBeingOpened = false;\\\\n    var onReadyBeingFired = null;\\\\n    var openComplete = false;\\\\n    var READONLY = \\"readonly\\", READWRITE = \\"readwrite\\";\\\\n    var db = this;\\\\n    var dbReadyResolve, dbReadyPromise = new Promise(function (resolve) {\\\\n        dbReadyResolve = resolve;\\\\n    }), cancelOpen, openCanceller = new Promise(function (_, reject) {\\\\n        cancelOpen = reject;\\\\n    });\\\\n    var autoSchema = true;\\\\n    var hasNativeGetDatabaseNames = !!getNativeGetDatabaseNamesFn(indexedDB), hasGetAll;\\\\n    function init() {\\\\n        // Default subscribers to \\"versionchange\\" and \\"blocked\\".\\\\n        // Can be overridden by custom handlers. If custom handlers return false, these default\\\\n        // behaviours will be prevented.\\\\n        db.on(\\"versionchange\\", function (ev) {\\\\n            // Default behavior for versionchange event is to close database connection.\\\\n            // Caller can override this behavior by doing db.on(\\"versionchange\\", function(){ return false; });\\\\n            // Let\\\\\'s not block the other window from making it\\\\\'s delete() or open() call.\\\\n            // NOTE! This event is never fired in IE,Edge or Safari.\\\\n            if (ev.newVersion > 0)\\\\n                console.warn(\\"Another connection wants to upgrade database \\\\\'\\" + db.name + \\"\\\\\'. Closing db now to resume the upgrade.\\");\\\\n            else\\\\n                console.warn(\\"Another connection wants to delete database \\\\\'\\" + db.name + \\"\\\\\'. Closing db now to resume the delete request.\\");\\\\n            db.close();\\\\n            // In many web applications, it would be recommended to force window.reload()\\\\n            // when this event occurs. To do that, subscribe to the versionchange event\\\\n            // and call window.location.reload(true) if ev.newVersion > 0 (not a deletion)\\\\n            // The reason for this is that your current web app obviously has old schema code that needs\\\\n            // to be updated. Another window got a newer version of the app and needs to upgrade DB but\\\\n            // your window is blocking it unless we close it here.\\\\n        });\\\\n        db.on(\\"blocked\\", function (ev) {\\\\n            if (!ev.newVersion || ev.newVersion < ev.oldVersion)\\\\n                console.warn(\\"Dexie.delete(\\\\\'\\" + db.name + \\"\\\\\') was blocked\\");\\\\n            else\\\\n                console.warn(\\"Upgrade \\\\\'\\" + db.name + \\"\\\\\' blocked by other connection holding version \\" + ev.oldVersion / 10);\\\\n        });\\\\n    }\\\\n    //\\\\n    //\\\\n    //\\\\n    // ------------------------- Versioning Framework---------------------------\\\\n    //\\\\n    //\\\\n    //\\\\n    this.version = function (versionNumber) {\\\\n        /// <param name=\\"versionNumber\\" type=\\"Number\\"></param>\\\\n        /// <returns type=\\"Version\\"></returns>\\\\n        if (idbdb || isBeingOpened)\\\\n            throw new exceptions.Schema(\\"Cannot add version when database is open\\");\\\\n        this.verno = Math.max(this.verno, versionNumber);\\\\n        var versionInstance = versions.filter(function (v) { return v._cfg.version === versionNumber; })[0];\\\\n        if (versionInstance)\\\\n            return versionInstance;\\\\n        versionInstance = new Version(versionNumber);\\\\n        versions.push(versionInstance);\\\\n        versions.sort(lowerVersionFirst);\\\\n        // Disable autoschema mode, as at least one version is specified.\\\\n        autoSchema = false;\\\\n        return versionInstance;\\\\n    };\\\\n    function Version(versionNumber) {\\\\n        this._cfg = {\\\\n            version: versionNumber,\\\\n            storesSource: null,\\\\n            dbschema: {},\\\\n            tables: {},\\\\n            contentUpgrade: null\\\\n        };\\\\n        this.stores({}); // Derive earlier schemas by default.\\\\n    }\\\\n    extend(Version.prototype, {\\\\n        stores: function (stores) {\\\\n            /// <summary>\\\\n            ///   Defines the schema for a particular version\\\\n            /// </summary>\\\\n            /// <param name=\\"stores\\" type=\\"Object\\">\\\\n            /// Example: <br/>\\\\n            ///   {users: \\"id++,first,last,&amp;username,*email\\", <br/>\\\\n            ///   passwords: \\"id++,&amp;username\\"}<br/>\\\\n            /// <br/>\\\\n            /// Syntax: {Table: \\"[primaryKey][++],[&amp;][*]index1,[&amp;][*]index2,...\\"}<br/><br/>\\\\n            /// Special characters:<br/>\\\\n            ///  \\"&amp;\\"  means unique key, <br/>\\\\n            ///  \\"*\\"  means value is multiEntry, <br/>\\\\n            ///  \\"++\\" means auto-increment and only applicable for primary key <br/>\\\\n            /// </param>\\\\n            this._cfg.storesSource = this._cfg.storesSource ? extend(this._cfg.storesSource, stores) : stores;\\\\n            // Derive stores from earlier versions if they are not explicitely specified as null or a new syntax.\\\\n            var storesSpec = {};\\\\n            versions.forEach(function (version) {\\\\n                extend(storesSpec, version._cfg.storesSource);\\\\n            });\\\\n            var dbschema = (this._cfg.dbschema = {});\\\\n            this._parseStoresSpec(storesSpec, dbschema);\\\\n            // Update the latest schema to this version\\\\n            // Update API\\\\n            globalSchema = db._dbSchema = dbschema;\\\\n            removeTablesApi([allTables, db, Transaction.prototype]); // Keep Transaction.prototype even though it should be depr.\\\\n            setApiOnPlace([allTables, db, Transaction.prototype, this._cfg.tables], keys(dbschema), dbschema);\\\\n            dbStoreNames = keys(dbschema);\\\\n            return this;\\\\n        },\\\\n        upgrade: function (upgradeFunction) {\\\\n            this._cfg.contentUpgrade = upgradeFunction;\\\\n            return this;\\\\n        },\\\\n        _parseStoresSpec: function (stores, outSchema) {\\\\n            keys(stores).forEach(function (tableName) {\\\\n                if (stores[tableName] !== null) {\\\\n                    var instanceTemplate = {};\\\\n                    var indexes = parseIndexSyntax(stores[tableName]);\\\\n                    var primKey = indexes.shift();\\\\n                    if (primKey.multi)\\\\n                        throw new exceptions.Schema(\\"Primary key cannot be multi-valued\\");\\\\n                    if (primKey.keyPath)\\\\n                        setByKeyPath(instanceTemplate, primKey.keyPath, primKey.auto ? 0 : primKey.keyPath);\\\\n                    indexes.forEach(function (idx) {\\\\n                        if (idx.auto)\\\\n                            throw new exceptions.Schema(\\"Only primary key can be marked as autoIncrement (++)\\");\\\\n                        if (!idx.keyPath)\\\\n                            throw new exceptions.Schema(\\"Index must have a name and cannot be an empty string\\");\\\\n                        setByKeyPath(instanceTemplate, idx.keyPath, idx.compound ? idx.keyPath.map(function () { return \\"\\"; }) : \\"\\");\\\\n                    });\\\\n                    outSchema[tableName] = new TableSchema(tableName, primKey, indexes, instanceTemplate);\\\\n                }\\\\n            });\\\\n        }\\\\n    });\\\\n    function runUpgraders(oldVersion, idbtrans, reject) {\\\\n        var trans = db._createTransaction(READWRITE, dbStoreNames, globalSchema);\\\\n        trans.create(idbtrans);\\\\n        trans._completion.catch(reject);\\\\n        var rejectTransaction = trans._reject.bind(trans);\\\\n        newScope(function () {\\\\n            PSD.trans = trans;\\\\n            if (oldVersion === 0) {\\\\n                // Create tables:\\\\n                keys(globalSchema).forEach(function (tableName) {\\\\n                    createTable(idbtrans, tableName, globalSchema[tableName].primKey, globalSchema[tableName].indexes);\\\\n                });\\\\n                Promise.follow(function () { return db.on.populate.fire(trans); }).catch(rejectTransaction);\\\\n            }\\\\n            else\\\\n                updateTablesAndIndexes(oldVersion, trans, idbtrans).catch(rejectTransaction);\\\\n        });\\\\n    }\\\\n    function updateTablesAndIndexes(oldVersion, trans, idbtrans) {\\\\n        // Upgrade version to version, step-by-step from oldest to newest version.\\\\n        // Each transaction object will contain the table set that was current in that version (but also not-yet-deleted tables from its previous version)\\\\n        var queue = [];\\\\n        var oldVersionStruct = versions.filter(function (version) { return version._cfg.version === oldVersion; })[0];\\\\n        if (!oldVersionStruct)\\\\n            throw new exceptions.Upgrade(\\"Dexie specification of currently installed DB version is missing\\");\\\\n        globalSchema = db._dbSchema = oldVersionStruct._cfg.dbschema;\\\\n        var anyContentUpgraderHasRun = false;\\\\n        var versToRun = versions.filter(function (v) { return v._cfg.version > oldVersion; });\\\\n        versToRun.forEach(function (version) {\\\\n            /// <param name=\\"version\\" type=\\"Version\\"></param>\\\\n            queue.push(function () {\\\\n                var oldSchema = globalSchema;\\\\n                var newSchema = version._cfg.dbschema;\\\\n                adjustToExistingIndexNames(oldSchema, idbtrans);\\\\n                adjustToExistingIndexNames(newSchema, idbtrans);\\\\n                globalSchema = db._dbSchema = newSchema;\\\\n                var diff = getSchemaDiff(oldSchema, newSchema);\\\\n                // Add tables           \\\\n                diff.add.forEach(function (tuple) {\\\\n                    createTable(idbtrans, tuple[0], tuple[1].primKey, tuple[1].indexes);\\\\n                });\\\\n                // Change tables\\\\n                diff.change.forEach(function (change) {\\\\n                    if (change.recreate) {\\\\n                        throw new exceptions.Upgrade(\\"Not yet support for changing primary key\\");\\\\n                    }\\\\n                    else {\\\\n                        var store = idbtrans.objectStore(change.name);\\\\n                        // Add indexes\\\\n                        change.add.forEach(function (idx) {\\\\n                            addIndex(store, idx);\\\\n                        });\\\\n                        // Update indexes\\\\n                        change.change.forEach(function (idx) {\\\\n                            store.deleteIndex(idx.name);\\\\n                            addIndex(store, idx);\\\\n                        });\\\\n                        // Delete indexes\\\\n                        change.del.forEach(function (idxName) {\\\\n                            store.deleteIndex(idxName);\\\\n                        });\\\\n                    }\\\\n                });\\\\n                if (version._cfg.contentUpgrade) {\\\\n                    anyContentUpgraderHasRun = true;\\\\n                    return Promise.follow(function () {\\\\n                        version._cfg.contentUpgrade(trans);\\\\n                    });\\\\n                }\\\\n            });\\\\n            queue.push(function (idbtrans) {\\\\n                if (!anyContentUpgraderHasRun || !hasIEDeleteObjectStoreBug) {\\\\n                    var newSchema = version._cfg.dbschema;\\\\n                    // Delete old tables\\\\n                    deleteRemovedTables(newSchema, idbtrans);\\\\n                }\\\\n            });\\\\n        });\\\\n        // Now, create a queue execution engine\\\\n        function runQueue() {\\\\n            return queue.length ? Promise.resolve(queue.shift()(trans.idbtrans)).then(runQueue) :\\\\n                Promise.resolve();\\\\n        }\\\\n        return runQueue().then(function () {\\\\n            createMissingTables(globalSchema, idbtrans); // At last, make sure to create any missing tables. (Needed by addons that add stores to DB without specifying version)\\\\n        });\\\\n    }\\\\n    function getSchemaDiff(oldSchema, newSchema) {\\\\n        var diff = {\\\\n            del: [],\\\\n            add: [],\\\\n            change: [] // Array of {name: tableName, recreate: newDefinition, del: delIndexNames, add: newIndexDefs, change: changedIndexDefs}\\\\n        };\\\\n        for (var table in oldSchema) {\\\\n            if (!newSchema[table])\\\\n                diff.del.push(table);\\\\n        }\\\\n        for (table in newSchema) {\\\\n            var oldDef = oldSchema[table], newDef = newSchema[table];\\\\n            if (!oldDef) {\\\\n                diff.add.push([table, newDef]);\\\\n            }\\\\n            else {\\\\n                var change = {\\\\n                    name: table,\\\\n                    def: newDef,\\\\n                    recreate: false,\\\\n                    del: [],\\\\n                    add: [],\\\\n                    change: []\\\\n                };\\\\n                if (oldDef.primKey.src !== newDef.primKey.src) {\\\\n                    // Primary key has changed. Remove and re-add table.\\\\n                    change.recreate = true;\\\\n                    diff.change.push(change);\\\\n                }\\\\n                else {\\\\n                    // Same primary key. Just find out what differs:\\\\n                    var oldIndexes = oldDef.idxByName;\\\\n                    var newIndexes = newDef.idxByName;\\\\n                    for (var idxName in oldIndexes) {\\\\n                        if (!newIndexes[idxName])\\\\n                            change.del.push(idxName);\\\\n                    }\\\\n                    for (idxName in newIndexes) {\\\\n                        var oldIdx = oldIndexes[idxName], newIdx = newIndexes[idxName];\\\\n                        if (!oldIdx)\\\\n                            change.add.push(newIdx);\\\\n                        else if (oldIdx.src !== newIdx.src)\\\\n                            change.change.push(newIdx);\\\\n                    }\\\\n                    if (change.del.length > 0 || change.add.length > 0 || change.change.length > 0) {\\\\n                        diff.change.push(change);\\\\n                    }\\\\n                }\\\\n            }\\\\n        }\\\\n        return diff;\\\\n    }\\\\n    function createTable(idbtrans, tableName, primKey, indexes) {\\\\n        /// <param name=\\"idbtrans\\" type=\\"IDBTransaction\\"></param>\\\\n        var store = idbtrans.db.createObjectStore(tableName, primKey.keyPath ? { keyPath: primKey.keyPath, autoIncrement: primKey.auto } : { autoIncrement: primKey.auto });\\\\n        indexes.forEach(function (idx) { addIndex(store, idx); });\\\\n        return store;\\\\n    }\\\\n    function createMissingTables(newSchema, idbtrans) {\\\\n        keys(newSchema).forEach(function (tableName) {\\\\n            if (!idbtrans.db.objectStoreNames.contains(tableName)) {\\\\n                createTable(idbtrans, tableName, newSchema[tableName].primKey, newSchema[tableName].indexes);\\\\n            }\\\\n        });\\\\n    }\\\\n    function deleteRemovedTables(newSchema, idbtrans) {\\\\n        for (var i = 0; i < idbtrans.db.objectStoreNames.length; ++i) {\\\\n            var storeName = idbtrans.db.objectStoreNames[i];\\\\n            if (newSchema[storeName] == null) {\\\\n                idbtrans.db.deleteObjectStore(storeName);\\\\n            }\\\\n        }\\\\n    }\\\\n    function addIndex(store, idx) {\\\\n        store.createIndex(idx.name, idx.keyPath, { unique: idx.unique, multiEntry: idx.multi });\\\\n    }\\\\n    //\\\\n    //\\\\n    //      Dexie Protected API\\\\n    //\\\\n    //\\\\n    this._allTables = allTables;\\\\n    this._createTransaction = function (mode, storeNames, dbschema, parentTransaction) {\\\\n        return new Transaction(mode, storeNames, dbschema, parentTransaction);\\\\n    };\\\\n    /* Generate a temporary transaction when db operations are done outside a transaction scope.\\\\n    */\\\\n    function tempTransaction(mode, storeNames, fn) {\\\\n        if (!openComplete && (!PSD.letThrough)) {\\\\n            if (!isBeingOpened) {\\\\n                if (!autoOpen)\\\\n                    return rejection(new exceptions.DatabaseClosed());\\\\n                db.open().catch(nop); // Open in background. If if fails, it will be catched by the final promise anyway.\\\\n            }\\\\n            return dbReadyPromise.then(function () { return tempTransaction(mode, storeNames, fn); });\\\\n        }\\\\n        else {\\\\n            var trans = db._createTransaction(mode, storeNames, globalSchema);\\\\n            try {\\\\n                trans.create();\\\\n            }\\\\n            catch (ex) {\\\\n                return rejection(ex);\\\\n            }\\\\n            return trans._promise(mode, function (resolve, reject) {\\\\n                return newScope(function () {\\\\n                    PSD.trans = trans;\\\\n                    return fn(resolve, reject, trans);\\\\n                });\\\\n            }).then(function (result) {\\\\n                // Instead of resolving value directly, wait with resolving it until transaction has completed.\\\\n                // Otherwise the data would not be in the DB if requesting it in the then() operation.\\\\n                // Specifically, to ensure that the following expression will work:\\\\n                //\\\\n                //   db.friends.put({name: \\"Arne\\"}).then(function () {\\\\n                //       db.friends.where(\\"name\\").equals(\\"Arne\\").count(function(count) {\\\\n                //           assert (count === 1);\\\\n                //       });\\\\n                //   });\\\\n                //\\\\n                return trans._completion.then(function () { return result; });\\\\n            }); /*.catch(err => { // Don\\\\\'t do this as of now. If would affect bulk- and modify methods in a way that could be more intuitive. But wait! Maybe change in next major.\\\\n                trans._reject(err);\\\\n                return rejection(err);\\\\n            });*/\\\\n        }\\\\n    }\\\\n    this._whenReady = function (fn) {\\\\n        return openComplete || PSD.letThrough ? fn() : new Promise(function (resolve, reject) {\\\\n            if (!isBeingOpened) {\\\\n                if (!autoOpen) {\\\\n                    reject(new exceptions.DatabaseClosed());\\\\n                    return;\\\\n                }\\\\n                db.open().catch(nop); // Open in background. If if fails, it will be catched by the final promise anyway.\\\\n            }\\\\n            dbReadyPromise.then(resolve, reject);\\\\n        }).then(fn);\\\\n    };\\\\n    //\\\\n    //\\\\n    //\\\\n    //\\\\n    //      Dexie API\\\\n    //\\\\n    //\\\\n    //\\\\n    this.verno = 0;\\\\n    this.open = function () {\\\\n        if (isBeingOpened || idbdb)\\\\n            return dbReadyPromise.then(function () { return dbOpenError ? rejection(dbOpenError) : db; });\\\\n        debug && (openCanceller._stackHolder = getErrorWithStack()); // Let stacks point to when open() was called rather than where new Dexie() was called.\\\\n        isBeingOpened = true;\\\\n        dbOpenError = null;\\\\n        openComplete = false;\\\\n        // Function pointers to call when the core opening process completes.\\\\n        var resolveDbReady = dbReadyResolve, \\\\n        // upgradeTransaction to abort on failure.\\\\n        upgradeTransaction = null;\\\\n        return Promise.race([openCanceller, new Promise(function (resolve, reject) {\\\\n                // Multiply db.verno with 10 will be needed to workaround upgrading bug in IE:\\\\n                // IE fails when deleting objectStore after reading from it.\\\\n                // A future version of Dexie.js will stopover an intermediate version to workaround this.\\\\n                // At that point, we want to be backward compatible. Could have been multiplied with 2, but by using 10, it is easier to map the number to the real version number.\\\\n                // If no API, throw!\\\\n                if (!indexedDB)\\\\n                    throw new exceptions.MissingAPI(\\"indexedDB API not found. If using IE10+, make sure to run your code on a server URL \\" +\\\\n                        \\"(not locally). If using old Safari versions, make sure to include indexedDB polyfill.\\");\\\\n                var req = autoSchema ? indexedDB.open(dbName) : indexedDB.open(dbName, Math.round(db.verno * 10));\\\\n                if (!req)\\\\n                    throw new exceptions.MissingAPI(\\"IndexedDB API not available\\"); // May happen in Safari private mode, see https://github.com/dfahlander/Dexie.js/issues/134\\\\n                req.onerror = eventRejectHandler(reject);\\\\n                req.onblocked = wrap(fireOnBlocked);\\\\n                req.onupgradeneeded = wrap(function (e) {\\\\n                    upgradeTransaction = req.transaction;\\\\n                    if (autoSchema && !db._allowEmptyDB) {\\\\n                        // Caller did not specify a version or schema. Doing that is only acceptable for opening alread existing databases.\\\\n                        // If onupgradeneeded is called it means database did not exist. Reject the open() promise and make sure that we\\\\n                        // do not create a new database by accident here.\\\\n                        req.onerror = preventDefault; // Prohibit onabort error from firing before we\\\\\'re done!\\\\n                        upgradeTransaction.abort(); // Abort transaction (would hope that this would make DB disappear but it doesnt.)\\\\n                        // Close database and delete it.\\\\n                        req.result.close();\\\\n                        var delreq = indexedDB.deleteDatabase(dbName); // The upgrade transaction is atomic, and javascript is single threaded - meaning that there is no risk that we delete someone elses database here!\\\\n                        delreq.onsuccess = delreq.onerror = wrap(function () {\\\\n                            reject(new exceptions.NoSuchDatabase(\\"Database \\" + dbName + \\" doesnt exist\\"));\\\\n                        });\\\\n                    }\\\\n                    else {\\\\n                        upgradeTransaction.onerror = eventRejectHandler(reject);\\\\n                        var oldVer = e.oldVersion > Math.pow(2, 62) ? 0 : e.oldVersion; // Safari 8 fix.\\\\n                        runUpgraders(oldVer / 10, upgradeTransaction, reject, req);\\\\n                    }\\\\n                }, reject);\\\\n                req.onsuccess = wrap(function () {\\\\n                    // Core opening procedure complete. Now let\\\\\'s just record some stuff.\\\\n                    upgradeTransaction = null;\\\\n                    idbdb = req.result;\\\\n                    connections.push(db); // Used for emulating versionchange event on IE/Edge/Safari.\\\\n                    if (autoSchema)\\\\n                        readGlobalSchema();\\\\n                    else if (idbdb.objectStoreNames.length > 0) {\\\\n                        try {\\\\n                            adjustToExistingIndexNames(globalSchema, idbdb.transaction(safariMultiStoreFix(idbdb.objectStoreNames), READONLY));\\\\n                        }\\\\n                        catch (e) {\\\\n                            // Safari may bail out if > 1 store names. However, this shouldnt be a showstopper. Issue #120.\\\\n                        }\\\\n                    }\\\\n                    idbdb.onversionchange = wrap(function (ev) {\\\\n                        db._vcFired = true; // detect implementations that not support versionchange (IE/Edge/Safari)\\\\n                        db.on(\\"versionchange\\").fire(ev);\\\\n                    });\\\\n                    if (!hasNativeGetDatabaseNames && dbName !== \\\\\'__dbnames\\\\\') {\\\\n                        dbNamesDB.dbnames.put({ name: dbName }).catch(nop);\\\\n                    }\\\\n                    resolve();\\\\n                }, reject);\\\\n            })]).then(function () {\\\\n            // Before finally resolving the dbReadyPromise and this promise,\\\\n            // call and await all on(\\\\\'ready\\\\\') subscribers:\\\\n            // Dexie.vip() makes subscribers able to use the database while being opened.\\\\n            // This is a must since these subscribers take part of the opening procedure.\\\\n            onReadyBeingFired = [];\\\\n            return Promise.resolve(Dexie.vip(db.on.ready.fire)).then(function fireRemainders() {\\\\n                if (onReadyBeingFired.length > 0) {\\\\n                    // In case additional subscribers to db.on(\\\\\'ready\\\\\') were added during the time db.on.ready.fire was executed.\\\\n                    var remainders = onReadyBeingFired.reduce(promisableChain, nop);\\\\n                    onReadyBeingFired = [];\\\\n                    return Promise.resolve(Dexie.vip(remainders)).then(fireRemainders);\\\\n                }\\\\n            });\\\\n        }).finally(function () {\\\\n            onReadyBeingFired = null;\\\\n        }).then(function () {\\\\n            // Resolve the db.open() with the db instance.\\\\n            isBeingOpened = false;\\\\n            return db;\\\\n        }).catch(function (err) {\\\\n            try {\\\\n                // Did we fail within onupgradeneeded? Make sure to abort the upgrade transaction so it doesnt commit.\\\\n                upgradeTransaction && upgradeTransaction.abort();\\\\n            }\\\\n            catch (e) { }\\\\n            isBeingOpened = false; // Set before calling db.close() so that it doesnt reject openCanceller again (leads to unhandled rejection event).\\\\n            db.close(); // Closes and resets idbdb, removes connections, resets dbReadyPromise and openCanceller so that a later db.open() is fresh.\\\\n            // A call to db.close() may have made on-ready subscribers fail. Use dbOpenError if set, since err could be a follow-up error on that.\\\\n            dbOpenError = err; // Record the error. It will be used to reject further promises of db operations.\\\\n            return rejection(dbOpenError);\\\\n        }).finally(function () {\\\\n            openComplete = true;\\\\n            resolveDbReady(); // dbReadyPromise is resolved no matter if open() rejects or resolved. It\\\\\'s just to wake up waiters.\\\\n        });\\\\n    };\\\\n    this.close = function () {\\\\n        var idx = connections.indexOf(db);\\\\n        if (idx >= 0)\\\\n            connections.splice(idx, 1);\\\\n        if (idbdb) {\\\\n            try {\\\\n                idbdb.close();\\\\n            }\\\\n            catch (e) { }\\\\n            idbdb = null;\\\\n        }\\\\n        autoOpen = false;\\\\n        dbOpenError = new exceptions.DatabaseClosed();\\\\n        if (isBeingOpened)\\\\n            cancelOpen(dbOpenError);\\\\n        // Reset dbReadyPromise promise:\\\\n        dbReadyPromise = new Promise(function (resolve) {\\\\n            dbReadyResolve = resolve;\\\\n        });\\\\n        openCanceller = new Promise(function (_, reject) {\\\\n            cancelOpen = reject;\\\\n        });\\\\n    };\\\\n    this.delete = function () {\\\\n        var hasArguments = arguments.length > 0;\\\\n        return new Promise(function (resolve, reject) {\\\\n            if (hasArguments)\\\\n                throw new exceptions.InvalidArgument(\\"Arguments not allowed in db.delete()\\");\\\\n            if (isBeingOpened) {\\\\n                dbReadyPromise.then(doDelete);\\\\n            }\\\\n            else {\\\\n                doDelete();\\\\n            }\\\\n            function doDelete() {\\\\n                db.close();\\\\n                var req = indexedDB.deleteDatabase(dbName);\\\\n                req.onsuccess = wrap(function () {\\\\n                    if (!hasNativeGetDatabaseNames) {\\\\n                        dbNamesDB.dbnames.delete(dbName).catch(nop);\\\\n                    }\\\\n                    resolve();\\\\n                });\\\\n                req.onerror = eventRejectHandler(reject);\\\\n                req.onblocked = fireOnBlocked;\\\\n            }\\\\n        });\\\\n    };\\\\n    this.backendDB = function () {\\\\n        return idbdb;\\\\n    };\\\\n    this.isOpen = function () {\\\\n        return idbdb !== null;\\\\n    };\\\\n    this.hasBeenClosed = function () {\\\\n        return dbOpenError && (dbOpenError instanceof exceptions.DatabaseClosed);\\\\n    };\\\\n    this.hasFailed = function () {\\\\n        return dbOpenError !== null;\\\\n    };\\\\n    this.dynamicallyOpened = function () {\\\\n        return autoSchema;\\\\n    };\\\\n    //\\\\n    // Properties\\\\n    //\\\\n    this.name = dbName;\\\\n    // db.tables - an array of all Table instances.\\\\n    props(this, {\\\\n        tables: {\\\\n            get: function () {\\\\n                /// <returns type=\\"Array\\" elementType=\\"Table\\" />\\\\n                return keys(allTables).map(function (name) { return allTables[name]; });\\\\n            }\\\\n        }\\\\n    });\\\\n    //\\\\n    // Events\\\\n    //\\\\n    this.on = Events(this, \\"populate\\", \\"blocked\\", \\"versionchange\\", { ready: [promisableChain, nop] });\\\\n    this.on.ready.subscribe = override(this.on.ready.subscribe, function (subscribe) {\\\\n        return function (subscriber, bSticky) {\\\\n            Dexie.vip(function () {\\\\n                if (openComplete) {\\\\n                    // Database already open. Call subscriber asap.\\\\n                    if (!dbOpenError)\\\\n                        Promise.resolve().then(subscriber);\\\\n                    // bSticky: Also subscribe to future open sucesses (after close / reopen) \\\\n                    if (bSticky)\\\\n                        subscribe(subscriber);\\\\n                }\\\\n                else if (onReadyBeingFired) {\\\\n                    // db.on(\\\\\'ready\\\\\') subscribers are currently being executed and have not yet resolved or rejected\\\\n                    onReadyBeingFired.push(subscriber);\\\\n                    if (bSticky)\\\\n                        subscribe(subscriber);\\\\n                }\\\\n                else {\\\\n                    // Database not yet open. Subscribe to it.\\\\n                    subscribe(subscriber);\\\\n                    // If bSticky is falsy, make sure to unsubscribe subscriber when fired once.\\\\n                    if (!bSticky)\\\\n                        subscribe(function unsubscribe() {\\\\n                            db.on.ready.unsubscribe(subscriber);\\\\n                            db.on.ready.unsubscribe(unsubscribe);\\\\n                        });\\\\n                }\\\\n            });\\\\n        };\\\\n    });\\\\n    this.transaction = function () {\\\\n        /// <summary>\\\\n        ///\\\\n        /// </summary>\\\\n        /// <param name=\\"mode\\" type=\\"String\\">\\"r\\" for readonly, or \\"rw\\" for readwrite</param>\\\\n        /// <param name=\\"tableInstances\\">Table instance, Array of Table instances, String or String Array of object stores to include in the transaction</param>\\\\n        /// <param name=\\"scopeFunc\\" type=\\"Function\\">Function to execute with transaction</param>\\\\n        var args = extractTransactionArgs.apply(this, arguments);\\\\n        return this._transaction.apply(this, args);\\\\n    };\\\\n    function extractTransactionArgs(mode, _tableArgs_, scopeFunc) {\\\\n        // Let table arguments be all arguments between mode and last argument.\\\\n        var i = arguments.length;\\\\n        if (i < 2)\\\\n            throw new exceptions.InvalidArgument(\\"Too few arguments\\");\\\\n        // Prevent optimzation killer (https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments)\\\\n        // and clone arguments except the first one into local var \\\\\'args\\\\\'.\\\\n        var args = new Array(i - 1);\\\\n        while (--i)\\\\n            args[i - 1] = arguments[i];\\\\n        // Let scopeFunc be the last argument and pop it so that args now only contain the table arguments.\\\\n        scopeFunc = args.pop();\\\\n        var tables = flatten(args); // Support using array as middle argument, or a mix of arrays and non-arrays.\\\\n        return [mode, tables, scopeFunc];\\\\n    }\\\\n    this._transaction = function (mode, tables, scopeFunc) {\\\\n        var parentTransaction = PSD.trans;\\\\n        // Check if parent transactions is bound to this db instance, and if caller wants to reuse it\\\\n        if (!parentTransaction || parentTransaction.db !== db || mode.indexOf(\\\\\'!\\\\\') !== -1)\\\\n            parentTransaction = null;\\\\n        var onlyIfCompatible = mode.indexOf(\\\\\'?\\\\\') !== -1;\\\\n        mode = mode.replace(\\\\\'!\\\\\', \\\\\'\\\\\').replace(\\\\\'?\\\\\', \\\\\'\\\\\'); // Ok. Will change arguments[0] as well but we wont touch arguments henceforth.\\\\n        try {\\\\n            //\\\\n            // Get storeNames from arguments. Either through given table instances, or through given table names.\\\\n            //\\\\n            var storeNames = tables.map(function (table) {\\\\n                var storeName = table instanceof Table ? table.name : table;\\\\n                if (typeof storeName !== \\\\\'string\\\\\')\\\\n                    throw new TypeError(\\"Invalid table argument to Dexie.transaction(). Only Table or String are allowed\\");\\\\n                return storeName;\\\\n            });\\\\n            //\\\\n            // Resolve mode. Allow shortcuts \\"r\\" and \\"rw\\".\\\\n            //\\\\n            if (mode == \\"r\\" || mode == READONLY)\\\\n                mode = READONLY;\\\\n            else if (mode == \\"rw\\" || mode == READWRITE)\\\\n                mode = READWRITE;\\\\n            else\\\\n                throw new exceptions.InvalidArgument(\\"Invalid transaction mode: \\" + mode);\\\\n            if (parentTransaction) {\\\\n                // Basic checks\\\\n                if (parentTransaction.mode === READONLY && mode === READWRITE) {\\\\n                    if (onlyIfCompatible) {\\\\n                        // Spawn new transaction instead.\\\\n                        parentTransaction = null;\\\\n                    }\\\\n                    else\\\\n                        throw new exceptions.SubTransaction(\\"Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY\\");\\\\n                }\\\\n                if (parentTransaction) {\\\\n                    storeNames.forEach(function (storeName) {\\\\n                        if (parentTransaction && parentTransaction.storeNames.indexOf(storeName) === -1) {\\\\n                            if (onlyIfCompatible) {\\\\n                                // Spawn new transaction instead.\\\\n                                parentTransaction = null;\\\\n                            }\\\\n                            else\\\\n                                throw new exceptions.SubTransaction(\\"Table \\" + storeName +\\\\n                                    \\" not included in parent transaction.\\");\\\\n                        }\\\\n                    });\\\\n                }\\\\n                if (onlyIfCompatible && parentTransaction && !parentTransaction.active) {\\\\n                    // \\\\\'?\\\\\' mode should not keep using an inactive transaction.\\\\n                    parentTransaction = null;\\\\n                }\\\\n            }\\\\n        }\\\\n        catch (e) {\\\\n            return parentTransaction ?\\\\n                parentTransaction._promise(null, function (_, reject) { reject(e); }) :\\\\n                rejection(e);\\\\n        }\\\\n        // If this is a sub-transaction, lock the parent and then launch the sub-transaction.\\\\n        return (parentTransaction ?\\\\n            parentTransaction._promise(mode, enterTransactionScope, \\"lock\\") :\\\\n            PSD.trans ?\\\\n                // no parent transaction despite PSD.trans exists. Make sure also\\\\n                // that the zone we create is not a sub-zone of current, because\\\\n                // Promise.follow() should not wait for it if so.\\\\n                usePSD(PSD.transless, function () { return db._whenReady(enterTransactionScope); }) :\\\\n                db._whenReady(enterTransactionScope));\\\\n        function enterTransactionScope() {\\\\n            return Promise.resolve().then(function () {\\\\n                // Keep a pointer to last non-transactional PSD to use if someone calls Dexie.ignoreTransaction().\\\\n                var transless = PSD.transless || PSD;\\\\n                // Our transaction.\\\\n                //return new Promise((resolve, reject) => {\\\\n                var trans = db._createTransaction(mode, storeNames, globalSchema, parentTransaction);\\\\n                // Let the transaction instance be part of a Promise-specific data (PSD) value.\\\\n                var zoneProps = {\\\\n                    trans: trans,\\\\n                    transless: transless\\\\n                };\\\\n                if (parentTransaction) {\\\\n                    // Emulate transaction commit awareness for inner transaction (must \\\\\'commit\\\\\' when the inner transaction has no more operations ongoing)\\\\n                    trans.idbtrans = parentTransaction.idbtrans;\\\\n                }\\\\n                else {\\\\n                    trans.create(); // Create the backend transaction so that complete() or error() will trigger even if no operation is made upon it.\\\\n                }\\\\n                // Support for native async await.\\\\n                if (scopeFunc.constructor === AsyncFunction) {\\\\n                    incrementExpectedAwaits();\\\\n                }\\\\n                var returnValue;\\\\n                var promiseFollowed = Promise.follow(function () {\\\\n                    // Finally, call the scope function with our table and transaction arguments.\\\\n                    returnValue = scopeFunc.call(trans, trans);\\\\n                    if (returnValue) {\\\\n                        if (returnValue.constructor === NativePromise) {\\\\n                            var decrementor = decrementExpectedAwaits.bind(null, null);\\\\n                            returnValue.then(decrementor, decrementor);\\\\n                        }\\\\n                        else if (typeof returnValue.next === \\\\\'function\\\\\' && typeof returnValue.throw === \\\\\'function\\\\\') {\\\\n                            // scopeFunc returned an iterator with throw-support. Handle yield as await.\\\\n                            returnValue = awaitIterator(returnValue);\\\\n                        }\\\\n                    }\\\\n                }, zoneProps);\\\\n                return (returnValue && typeof returnValue.then === \\\\\'function\\\\\' ?\\\\n                    // Promise returned. User uses promise-style transactions.\\\\n                    Promise.resolve(returnValue).then(function (x) { return trans.active ?\\\\n                        x // Transaction still active. Continue.\\\\n                        : rejection(new exceptions.PrematureCommit(\\"Transaction committed too early. See http://bit.ly/2kdckMn\\")); })\\\\n                    // No promise returned. Wait for all outstanding promises before continuing. \\\\n                    : promiseFollowed.then(function () { return returnValue; })).then(function (x) {\\\\n                    // sub transactions don\\\\\'t react to idbtrans.oncomplete. We must trigger a completion:\\\\n                    if (parentTransaction)\\\\n                        trans._resolve();\\\\n                    // wait for trans._completion\\\\n                    // (if root transaction, this means \\\\\'complete\\\\\' event. If sub-transaction, we\\\\\'ve just fired it ourselves)\\\\n                    return trans._completion.then(function () { return x; });\\\\n                }).catch(function (e) {\\\\n                    trans._reject(e); // Yes, above then-handler were maybe not called because of an unhandled rejection in scopeFunc!\\\\n                    return rejection(e);\\\\n                });\\\\n            });\\\\n        }\\\\n    };\\\\n    this.table = function (tableName) {\\\\n        /// <returns type=\\"Table\\"></returns>\\\\n        if (!hasOwn(allTables, tableName)) {\\\\n            throw new exceptions.InvalidTable(\\"Table \\" + tableName + \\" does not exist\\");\\\\n        }\\\\n        return allTables[tableName];\\\\n    };\\\\n    //\\\\n    //\\\\n    //\\\\n    // Table Class\\\\n    //\\\\n    //\\\\n    //\\\\n    function Table(name, tableSchema, optionalTrans) {\\\\n        /// <param name=\\"name\\" type=\\"String\\"></param>\\\\n        this.name = name;\\\\n        this.schema = tableSchema;\\\\n        this._tx = optionalTrans;\\\\n        this.hook = allTables[name] ? allTables[name].hook : Events(null, {\\\\n            \\"creating\\": [hookCreatingChain, nop],\\\\n            \\"reading\\": [pureFunctionChain, mirror],\\\\n            \\"updating\\": [hookUpdatingChain, nop],\\\\n            \\"deleting\\": [hookDeletingChain, nop]\\\\n        });\\\\n    }\\\\n    function BulkErrorHandlerCatchAll(errorList, done, supportHooks) {\\\\n        return (supportHooks ? hookedEventRejectHandler : eventRejectHandler)(function (e) {\\\\n            errorList.push(e);\\\\n            done && done();\\\\n        });\\\\n    }\\\\n    function bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook) {\\\\n        // If hasDeleteHook, keysOrTuples must be an array of tuples: [[key1, value2],[key2,value2],...],\\\\n        // else keysOrTuples must be just an array of keys: [key1, key2, ...].\\\\n        return new Promise(function (resolve, reject) {\\\\n            var len = keysOrTuples.length, lastItem = len - 1;\\\\n            if (len === 0)\\\\n                return resolve();\\\\n            if (!hasDeleteHook) {\\\\n                for (var i = 0; i < len; ++i) {\\\\n                    var req = idbstore.delete(keysOrTuples[i]);\\\\n                    req.onerror = eventRejectHandler(reject);\\\\n                    if (i === lastItem)\\\\n                        req.onsuccess = wrap(function () { return resolve(); });\\\\n                }\\\\n            }\\\\n            else {\\\\n                var hookCtx, errorHandler = hookedEventRejectHandler(reject), successHandler = hookedEventSuccessHandler(null);\\\\n                tryCatch(function () {\\\\n                    for (var i = 0; i < len; ++i) {\\\\n                        hookCtx = { onsuccess: null, onerror: null };\\\\n                        var tuple = keysOrTuples[i];\\\\n                        deletingHook.call(hookCtx, tuple[0], tuple[1], trans);\\\\n                        var req = idbstore.delete(tuple[0]);\\\\n                        req._hookCtx = hookCtx;\\\\n                        req.onerror = errorHandler;\\\\n                        if (i === lastItem)\\\\n                            req.onsuccess = hookedEventSuccessHandler(resolve);\\\\n                        else\\\\n                            req.onsuccess = successHandler;\\\\n                    }\\\\n                }, function (err) {\\\\n                    hookCtx.onerror && hookCtx.onerror(err);\\\\n                    throw err;\\\\n                });\\\\n            }\\\\n        });\\\\n    }\\\\n    props(Table.prototype, {\\\\n        //\\\\n        // Table Protected Methods\\\\n        //\\\\n        _trans: function getTransaction(mode, fn, writeLocked) {\\\\n            var trans = this._tx || PSD.trans;\\\\n            return trans && trans.db === db ?\\\\n                trans === PSD.trans ?\\\\n                    trans._promise(mode, fn, writeLocked) :\\\\n                    newScope(function () { return trans._promise(mode, fn, writeLocked); }, { trans: trans, transless: PSD.transless || PSD }) :\\\\n                tempTransaction(mode, [this.name], fn);\\\\n        },\\\\n        _idbstore: function getIDBObjectStore(mode, fn, writeLocked) {\\\\n            var tableName = this.name;\\\\n            function supplyIdbStore(resolve, reject, trans) {\\\\n                if (trans.storeNames.indexOf(tableName) === -1)\\\\n                    throw new exceptions.NotFound(\\"Table\\" + tableName + \\" not part of transaction\\");\\\\n                return fn(resolve, reject, trans.idbtrans.objectStore(tableName), trans);\\\\n            }\\\\n            return this._trans(mode, supplyIdbStore, writeLocked);\\\\n        },\\\\n        //\\\\n        // Table Public Methods\\\\n        //\\\\n        get: function (keyOrCrit, cb) {\\\\n            if (keyOrCrit && keyOrCrit.constructor === Object)\\\\n                return this.where(keyOrCrit).first(cb);\\\\n            var self = this;\\\\n            return this._idbstore(READONLY, function (resolve, reject, idbstore) {\\\\n                var req = idbstore.get(keyOrCrit);\\\\n                req.onerror = eventRejectHandler(reject);\\\\n                req.onsuccess = wrap(function () {\\\\n                    resolve(self.hook.reading.fire(req.result));\\\\n                }, reject);\\\\n            }).then(cb);\\\\n        },\\\\n        where: function (indexOrCrit) {\\\\n            if (typeof indexOrCrit === \\\\\'string\\\\\')\\\\n                return new WhereClause(this, indexOrCrit);\\\\n            if (isArray(indexOrCrit))\\\\n                return new WhereClause(this, \\"[\\" + indexOrCrit.join(\\\\\'+\\\\\') + \\"]\\");\\\\n            // indexOrCrit is an object map of {[keyPath]:value} \\\\n            var keyPaths = keys(indexOrCrit);\\\\n            if (keyPaths.length === 1)\\\\n                // Only one critera. This was the easy case:\\\\n                return this\\\\n                    .where(keyPaths[0])\\\\n                    .equals(indexOrCrit[keyPaths[0]]);\\\\n            // Multiple criterias.\\\\n            // Let\\\\\'s try finding a compound index that matches all keyPaths in\\\\n            // arbritary order:\\\\n            var compoundIndex = this.schema.indexes.concat(this.schema.primKey).filter(function (ix) {\\\\n                return ix.compound &&\\\\n                    keyPaths.every(function (keyPath) { return ix.keyPath.indexOf(keyPath) >= 0; }) &&\\\\n                    ix.keyPath.every(function (keyPath) { return keyPaths.indexOf(keyPath) >= 0; });\\\\n            })[0];\\\\n            if (compoundIndex && maxKey !== maxString)\\\\n                // Cool! We found such compound index\\\\n                // and this browser supports compound indexes (maxKey !== maxString)!\\\\n                return this\\\\n                    .where(compoundIndex.name)\\\\n                    .equals(compoundIndex.keyPath.map(function (kp) { return indexOrCrit[kp]; }));\\\\n            if (!compoundIndex)\\\\n                console.warn(\\"The query \\" + JSON.stringify(indexOrCrit) + \\" on \\" + this.name + \\" would benefit of a \\" +\\\\n                    (\\"compound index [\\" + keyPaths.join(\\\\\'+\\\\\') + \\"]\\"));\\\\n            // Ok, now let\\\\\'s fallback to finding at least one matching index\\\\n            // and filter the rest.\\\\n            var idxByName = this.schema.idxByName;\\\\n            var simpleIndex = keyPaths.reduce(function (r, keyPath) { return [\\\\n                r[0] || idxByName[keyPath],\\\\n                r[0] || !idxByName[keyPath] ?\\\\n                    combine(r[1], function (x) { return \\\\\'\\\\\' + getByKeyPath(x, keyPath) ==\\\\n                        \\\\\'\\\\\' + indexOrCrit[keyPath]; })\\\\n                    : r[1]\\\\n            ]; }, [null, null]);\\\\n            var idx = simpleIndex[0];\\\\n            return idx ?\\\\n                this.where(idx.name).equals(indexOrCrit[idx.keyPath])\\\\n                    .filter(simpleIndex[1]) :\\\\n                compoundIndex ?\\\\n                    this.filter(simpleIndex[1]) : // Has compound but browser bad. Allow filter.\\\\n                    this.where(keyPaths).equals(\\\\\'\\\\\'); // No index at all. Fail lazily.\\\\n        },\\\\n        count: function (cb) {\\\\n            return this.toCollection().count(cb);\\\\n        },\\\\n        offset: function (offset) {\\\\n            return this.toCollection().offset(offset);\\\\n        },\\\\n        limit: function (numRows) {\\\\n            return this.toCollection().limit(numRows);\\\\n        },\\\\n        reverse: function () {\\\\n            return this.toCollection().reverse();\\\\n        },\\\\n        filter: function (filterFunction) {\\\\n            return this.toCollection().and(filterFunction);\\\\n        },\\\\n        each: function (fn) {\\\\n            return this.toCollection().each(fn);\\\\n        },\\\\n        toArray: function (cb) {\\\\n            return this.toCollection().toArray(cb);\\\\n        },\\\\n        orderBy: function (index) {\\\\n            return new Collection(new WhereClause(this, isArray(index) ?\\\\n                \\"[\\" + index.join(\\\\\'+\\\\\') + \\"]\\" :\\\\n                index));\\\\n        },\\\\n        toCollection: function () {\\\\n            return new Collection(new WhereClause(this));\\\\n        },\\\\n        mapToClass: function (constructor, structure) {\\\\n            /// <summary>\\\\n            ///     Map table to a javascript constructor function. Objects returned from the database will be instances of this class, making\\\\n            ///     it possible to the instanceOf operator as well as extending the class using constructor.prototype.method = function(){...}.\\\\n            /// </summary>\\\\n            /// <param name=\\"constructor\\">Constructor function representing the class.</param>\\\\n            /// <param name=\\"structure\\" optional=\\"true\\">Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\\\\n            /// know what type each member has. Example: {name: String, emailAddresses: [String], password}</param>\\\\n            this.schema.mappedClass = constructor;\\\\n            var instanceTemplate = Object.create(constructor.prototype);\\\\n            if (structure) {\\\\n                // structure and instanceTemplate is for IDE code competion only while constructor.prototype is for actual inheritance.\\\\n                applyStructure(instanceTemplate, structure);\\\\n            }\\\\n            this.schema.instanceTemplate = instanceTemplate;\\\\n            // Now, subscribe to the when(\\"reading\\") event to make all objects that come out from this table inherit from given class\\\\n            // no matter which method to use for reading (Table.get() or Table.where(...)... )\\\\n            var readHook = function (obj) {\\\\n                if (!obj)\\\\n                    return obj; // No valid object. (Value is null). Return as is.\\\\n                // Create a new object that derives from constructor:\\\\n                var res = Object.create(constructor.prototype);\\\\n                // Clone members:\\\\n                for (var m in obj)\\\\n                    if (hasOwn(obj, m))\\\\n                        try {\\\\n                            res[m] = obj[m];\\\\n                        }\\\\n                        catch (_) { }\\\\n                return res;\\\\n            };\\\\n            if (this.schema.readHook) {\\\\n                this.hook.reading.unsubscribe(this.schema.readHook);\\\\n            }\\\\n            this.schema.readHook = readHook;\\\\n            this.hook(\\"reading\\", readHook);\\\\n            return constructor;\\\\n        },\\\\n        defineClass: function (structure) {\\\\n            /// <summary>\\\\n            ///     Define all members of the class that represents the table. This will help code completion of when objects are read from the database\\\\n            ///     as well as making it possible to extend the prototype of the returned constructor function.\\\\n            /// </summary>\\\\n            /// <param name=\\"structure\\">Helps IDE code completion by knowing the members that objects contain and not just the indexes. Also\\\\n            /// know what type each member has. Example: {name: String, emailAddresses: [String], properties: {shoeSize: Number}}</param>\\\\n            return this.mapToClass(Dexie.defineClass(structure), structure);\\\\n        },\\\\n        bulkDelete: function (keys$$1) {\\\\n            if (this.hook.deleting.fire === nop) {\\\\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\\\\n                    resolve(bulkDelete(idbstore, trans, keys$$1, false, nop));\\\\n                });\\\\n            }\\\\n            else {\\\\n                return this\\\\n                    .where(\\\\\':id\\\\\')\\\\n                    .anyOf(keys$$1)\\\\n                    .delete()\\\\n                    .then(function () { }); // Resolve with undefined.\\\\n            }\\\\n        },\\\\n        bulkPut: function (objects, keys$$1) {\\\\n            var _this = this;\\\\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\\\\n                if (!idbstore.keyPath && !_this.schema.primKey.auto && !keys$$1)\\\\n                    throw new exceptions.InvalidArgument(\\"bulkPut() with non-inbound keys requires keys array in second argument\\");\\\\n                if (idbstore.keyPath && keys$$1)\\\\n                    throw new exceptions.InvalidArgument(\\"bulkPut(): keys argument invalid on tables with inbound keys\\");\\\\n                if (keys$$1 && keys$$1.length !== objects.length)\\\\n                    throw new exceptions.InvalidArgument(\\"Arguments objects and keys must have the same length\\");\\\\n                if (objects.length === 0)\\\\n                    return resolve(); // Caller provided empty list.\\\\n                var done = function (result) {\\\\n                    if (errorList.length === 0)\\\\n                        resolve(result);\\\\n                    else\\\\n                        reject(new BulkError(_this.name + \\".bulkPut(): \\" + errorList.length + \\" of \\" + numObjs + \\" operations failed\\", errorList));\\\\n                };\\\\n                var req, errorList = [], errorHandler, numObjs = objects.length, table = _this;\\\\n                if (_this.hook.creating.fire === nop && _this.hook.updating.fire === nop) {\\\\n                    //\\\\n                    // Standard Bulk (no \\\\\'creating\\\\\' or \\\\\'updating\\\\\' hooks to care about)\\\\n                    //\\\\n                    errorHandler = BulkErrorHandlerCatchAll(errorList);\\\\n                    for (var i = 0, l = objects.length; i < l; ++i) {\\\\n                        req = keys$$1 ? idbstore.put(objects[i], keys$$1[i]) : idbstore.put(objects[i]);\\\\n                        req.onerror = errorHandler;\\\\n                    }\\\\n                    // Only need to catch success or error on the last operation\\\\n                    // according to the IDB spec.\\\\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done);\\\\n                    req.onsuccess = eventSuccessHandler(done);\\\\n                }\\\\n                else {\\\\n                    var effectiveKeys = keys$$1 || idbstore.keyPath && objects.map(function (o) { return getByKeyPath(o, idbstore.keyPath); });\\\\n                    // Generate map of {[key]: object}\\\\n                    var objectLookup = effectiveKeys && arrayToObject(effectiveKeys, function (key, i) { return key != null && [key, objects[i]]; });\\\\n                    var promise = !effectiveKeys ?\\\\n                        // Auto-incremented key-less objects only without any keys argument.\\\\n                        table.bulkAdd(objects) :\\\\n                        // Keys provided. Either as inbound in provided objects, or as a keys argument.\\\\n                        // Begin with updating those that exists in DB:\\\\n                        table.where(\\\\\':id\\\\\').anyOf(effectiveKeys.filter(function (key) { return key != null; })).modify(function () {\\\\n                            this.value = objectLookup[this.primKey];\\\\n                            objectLookup[this.primKey] = null; // Mark as \\"don\\\\\'t add this\\"\\\\n                        }).catch(ModifyError, function (e) {\\\\n                            errorList = e.failures; // No need to concat here. These are the first errors added.\\\\n                        }).then(function () {\\\\n                            // Now, let\\\\\'s examine which items didnt exist so we can add them:\\\\n                            var objsToAdd = [], keysToAdd = keys$$1 && [];\\\\n                            // Iterate backwards. Why? Because if same key was used twice, just add the last one.\\\\n                            for (var i = effectiveKeys.length - 1; i >= 0; --i) {\\\\n                                var key = effectiveKeys[i];\\\\n                                if (key == null || objectLookup[key]) {\\\\n                                    objsToAdd.push(objects[i]);\\\\n                                    keys$$1 && keysToAdd.push(key);\\\\n                                    if (key != null)\\\\n                                        objectLookup[key] = null; // Mark as \\"dont add again\\"\\\\n                                }\\\\n                            }\\\\n                            // The items are in reverse order so reverse them before adding.\\\\n                            // Could be important in order to get auto-incremented keys the way the caller\\\\n                            // would expect. Could have used unshift instead of push()/reverse(),\\\\n                            // but: http://jsperf.com/unshift-vs-reverse\\\\n                            objsToAdd.reverse();\\\\n                            keys$$1 && keysToAdd.reverse();\\\\n                            return table.bulkAdd(objsToAdd, keysToAdd);\\\\n                        }).then(function (lastAddedKey) {\\\\n                            // Resolve with key of the last object in given arguments to bulkPut():\\\\n                            var lastEffectiveKey = effectiveKeys[effectiveKeys.length - 1]; // Key was provided.\\\\n                            return lastEffectiveKey != null ? lastEffectiveKey : lastAddedKey;\\\\n                        });\\\\n                    promise.then(done).catch(BulkError, function (e) {\\\\n                        // Concat failure from ModifyError and reject using our \\\\\'done\\\\\' method.\\\\n                        errorList = errorList.concat(e.failures);\\\\n                        done();\\\\n                    }).catch(reject);\\\\n                }\\\\n            }, \\"locked\\"); // If called from transaction scope, lock transaction til all steps are done.\\\\n        },\\\\n        bulkAdd: function (objects, keys$$1) {\\\\n            var self = this, creatingHook = this.hook.creating.fire;\\\\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\\\\n                if (!idbstore.keyPath && !self.schema.primKey.auto && !keys$$1)\\\\n                    throw new exceptions.InvalidArgument(\\"bulkAdd() with non-inbound keys requires keys array in second argument\\");\\\\n                if (idbstore.keyPath && keys$$1)\\\\n                    throw new exceptions.InvalidArgument(\\"bulkAdd(): keys argument invalid on tables with inbound keys\\");\\\\n                if (keys$$1 && keys$$1.length !== objects.length)\\\\n                    throw new exceptions.InvalidArgument(\\"Arguments objects and keys must have the same length\\");\\\\n                if (objects.length === 0)\\\\n                    return resolve(); // Caller provided empty list.\\\\n                function done(result) {\\\\n                    if (errorList.length === 0)\\\\n                        resolve(result);\\\\n                    else\\\\n                        reject(new BulkError(self.name + \\".bulkAdd(): \\" + errorList.length + \\" of \\" + numObjs + \\" operations failed\\", errorList));\\\\n                }\\\\n                var req, errorList = [], errorHandler, successHandler, numObjs = objects.length;\\\\n                if (creatingHook !== nop) {\\\\n                    //\\\\n                    // There are subscribers to hook(\\\\\'creating\\\\\')\\\\n                    // Must behave as documented.\\\\n                    //\\\\n                    var keyPath = idbstore.keyPath, hookCtx;\\\\n                    errorHandler = BulkErrorHandlerCatchAll(errorList, null, true);\\\\n                    successHandler = hookedEventSuccessHandler(null);\\\\n                    tryCatch(function () {\\\\n                        for (var i = 0, l = objects.length; i < l; ++i) {\\\\n                            hookCtx = { onerror: null, onsuccess: null };\\\\n                            var key = keys$$1 && keys$$1[i];\\\\n                            var obj = objects[i], effectiveKey = keys$$1 ? key : keyPath ? getByKeyPath(obj, keyPath) : undefined, keyToUse = creatingHook.call(hookCtx, effectiveKey, obj, trans);\\\\n                            if (effectiveKey == null && keyToUse != null) {\\\\n                                if (keyPath) {\\\\n                                    obj = deepClone(obj);\\\\n                                    setByKeyPath(obj, keyPath, keyToUse);\\\\n                                }\\\\n                                else {\\\\n                                    key = keyToUse;\\\\n                                }\\\\n                            }\\\\n                            req = key != null ? idbstore.add(obj, key) : idbstore.add(obj);\\\\n                            req._hookCtx = hookCtx;\\\\n                            if (i < l - 1) {\\\\n                                req.onerror = errorHandler;\\\\n                                if (hookCtx.onsuccess)\\\\n                                    req.onsuccess = successHandler;\\\\n                            }\\\\n                        }\\\\n                    }, function (err) {\\\\n                        hookCtx.onerror && hookCtx.onerror(err);\\\\n                        throw err;\\\\n                    });\\\\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done, true);\\\\n                    req.onsuccess = hookedEventSuccessHandler(done);\\\\n                }\\\\n                else {\\\\n                    //\\\\n                    // Standard Bulk (no \\\\\'creating\\\\\' hook to care about)\\\\n                    //\\\\n                    errorHandler = BulkErrorHandlerCatchAll(errorList);\\\\n                    for (var i = 0, l = objects.length; i < l; ++i) {\\\\n                        req = keys$$1 ? idbstore.add(objects[i], keys$$1[i]) : idbstore.add(objects[i]);\\\\n                        req.onerror = errorHandler;\\\\n                    }\\\\n                    // Only need to catch success or error on the last operation\\\\n                    // according to the IDB spec.\\\\n                    req.onerror = BulkErrorHandlerCatchAll(errorList, done);\\\\n                    req.onsuccess = eventSuccessHandler(done);\\\\n                }\\\\n            });\\\\n        },\\\\n        add: function (obj, key) {\\\\n            /// <summary>\\\\n            ///   Add an object to the database. In case an object with same primary key already exists, the object will not be added.\\\\n            /// </summary>\\\\n            /// <param name=\\"obj\\" type=\\"Object\\">A javascript object to insert</param>\\\\n            /// <param name=\\"key\\" optional=\\"true\\">Primary key</param>\\\\n            var creatingHook = this.hook.creating.fire;\\\\n            return this._idbstore(READWRITE, function (resolve, reject, idbstore, trans) {\\\\n                var hookCtx = { onsuccess: null, onerror: null };\\\\n                if (creatingHook !== nop) {\\\\n                    var effectiveKey = (key != null) ? key : (idbstore.keyPath ? getByKeyPath(obj, idbstore.keyPath) : undefined);\\\\n                    var keyToUse = creatingHook.call(hookCtx, effectiveKey, obj, trans); // Allow subscribers to when(\\"creating\\") to generate the key.\\\\n                    if (effectiveKey == null && keyToUse != null) {\\\\n                        if (idbstore.keyPath)\\\\n                            setByKeyPath(obj, idbstore.keyPath, keyToUse);\\\\n                        else\\\\n                            key = keyToUse;\\\\n                    }\\\\n                }\\\\n                try {\\\\n                    var req = key != null ? idbstore.add(obj, key) : idbstore.add(obj);\\\\n                    req._hookCtx = hookCtx;\\\\n                    req.onerror = hookedEventRejectHandler(reject);\\\\n                    req.onsuccess = hookedEventSuccessHandler(function (result) {\\\\n                        // TODO: Remove these two lines in next major release (2.0?)\\\\n                        // It\\\\\'s no good practice to have side effects on provided parameters\\\\n                        var keyPath = idbstore.keyPath;\\\\n                        if (keyPath)\\\\n                            setByKeyPath(obj, keyPath, result);\\\\n                        resolve(result);\\\\n                    });\\\\n                }\\\\n                catch (e) {\\\\n                    if (hookCtx.onerror)\\\\n                        hookCtx.onerror(e);\\\\n                    throw e;\\\\n                }\\\\n            });\\\\n        },\\\\n        put: function (obj, key) {\\\\n            var _this = this;\\\\n            /// <summary>\\\\n            ///   Add an object to the database but in case an object with same primary key alread exists, the existing one will get updated.\\\\n            /// </summary>\\\\n            /// <param name=\\"obj\\" type=\\"Object\\">A javascript object to insert or update</param>\\\\n            /// <param name=\\"key\\" optional=\\"true\\">Primary key</param>\\\\n            var creatingHook = this.hook.creating.fire, updatingHook = this.hook.updating.fire;\\\\n            if (creatingHook !== nop || updatingHook !== nop) {\\\\n                //\\\\n                // People listens to when(\\"creating\\") or when(\\"updating\\") events!\\\\n                // We must know whether the put operation results in an CREATE or UPDATE.\\\\n                //\\\\n                var keyPath = this.schema.primKey.keyPath;\\\\n                var effectiveKey = (key !== undefined) ? key : (keyPath && getByKeyPath(obj, keyPath));\\\\n                if (effectiveKey == null)\\\\n                    return this.add(obj);\\\\n                // Since key is optional, make sure we get it from obj if not provided\\\\n                // Primary key exist. Lock transaction and try modifying existing. If nothing modified, call add().\\\\n                // clone obj before this async call. If caller modifies obj the line after put(), the IDB spec requires that it should not affect operation.\\\\n                obj = deepClone(obj);\\\\n                return this._trans(READWRITE, function () {\\\\n                    return _this.where(\\":id\\").equals(effectiveKey).modify(function () {\\\\n                        // Replace extisting value with our object\\\\n                        // CRUD event firing handled in Collection.modify()\\\\n                        this.value = obj;\\\\n                    }).then(function (count) { return count === 0 ? _this.add(obj, key) : effectiveKey; });\\\\n                }, \\"locked\\"); // Lock needed because operation is splitted into modify() and add().\\\\n            }\\\\n            else {\\\\n                // Use the standard IDB put() method.\\\\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\\\\n                    var req = key !== undefined ? idbstore.put(obj, key) : idbstore.put(obj);\\\\n                    req.onerror = eventRejectHandler(reject);\\\\n                    req.onsuccess = wrap(function (ev) {\\\\n                        var keyPath = idbstore.keyPath;\\\\n                        if (keyPath)\\\\n                            setByKeyPath(obj, keyPath, ev.target.result);\\\\n                        resolve(req.result);\\\\n                    });\\\\n                });\\\\n            }\\\\n        },\\\\n        \\\\\'delete\\\\\': function (key) {\\\\n            /// <param name=\\"key\\">Primary key of the object to delete</param>\\\\n            if (this.hook.deleting.subscribers.length) {\\\\n                // People listens to when(\\"deleting\\") event. Must implement delete using Collection.delete() that will\\\\n                // call the CRUD event. Only Collection.delete() will know whether an object was actually deleted.\\\\n                return this.where(\\":id\\").equals(key).delete();\\\\n            }\\\\n            else {\\\\n                // No one listens. Use standard IDB delete() method.\\\\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\\\\n                    var req = idbstore.delete(key);\\\\n                    req.onerror = eventRejectHandler(reject);\\\\n                    req.onsuccess = wrap(function () {\\\\n                        resolve(req.result);\\\\n                    });\\\\n                });\\\\n            }\\\\n        },\\\\n        clear: function () {\\\\n            if (this.hook.deleting.subscribers.length) {\\\\n                // People listens to when(\\"deleting\\") event. Must implement delete using Collection.delete() that will\\\\n                // call the CRUD event. Only Collection.delete() will knows which objects that are actually deleted.\\\\n                return this.toCollection().delete();\\\\n            }\\\\n            else {\\\\n                return this._idbstore(READWRITE, function (resolve, reject, idbstore) {\\\\n                    var req = idbstore.clear();\\\\n                    req.onerror = eventRejectHandler(reject);\\\\n                    req.onsuccess = wrap(function () {\\\\n                        resolve(req.result);\\\\n                    });\\\\n                });\\\\n            }\\\\n        },\\\\n        update: function (keyOrObject, modifications) {\\\\n            if (typeof modifications !== \\\\\'object\\\\\' || isArray(modifications))\\\\n                throw new exceptions.InvalidArgument(\\"Modifications must be an object.\\");\\\\n            if (typeof keyOrObject === \\\\\'object\\\\\' && !isArray(keyOrObject)) {\\\\n                // object to modify. Also modify given object with the modifications:\\\\n                keys(modifications).forEach(function (keyPath) {\\\\n                    setByKeyPath(keyOrObject, keyPath, modifications[keyPath]);\\\\n                });\\\\n                var key = getByKeyPath(keyOrObject, this.schema.primKey.keyPath);\\\\n                if (key === undefined)\\\\n                    return rejection(new exceptions.InvalidArgument(\\"Given object does not contain its primary key\\"));\\\\n                return this.where(\\":id\\").equals(key).modify(modifications);\\\\n            }\\\\n            else {\\\\n                // key to modify\\\\n                return this.where(\\":id\\").equals(keyOrObject).modify(modifications);\\\\n            }\\\\n        }\\\\n    });\\\\n    //\\\\n    //\\\\n    //\\\\n    // Transaction Class\\\\n    //\\\\n    //\\\\n    //\\\\n    function Transaction(mode, storeNames, dbschema, parent) {\\\\n        var _this = this;\\\\n        /// <summary>\\\\n        ///    Transaction class. Represents a database transaction. All operations on db goes through a Transaction.\\\\n        /// </summary>\\\\n        /// <param name=\\"mode\\" type=\\"String\\">Any of \\"readwrite\\" or \\"readonly\\"</param>\\\\n        /// <param name=\\"storeNames\\" type=\\"Array\\">Array of table names to operate on</param>\\\\n        this.db = db;\\\\n        this.mode = mode;\\\\n        this.storeNames = storeNames;\\\\n        this.idbtrans = null;\\\\n        this.on = Events(this, \\"complete\\", \\"error\\", \\"abort\\");\\\\n        this.parent = parent || null;\\\\n        this.active = true;\\\\n        this._reculock = 0;\\\\n        this._blockedFuncs = [];\\\\n        this._resolve = null;\\\\n        this._reject = null;\\\\n        this._waitingFor = null;\\\\n        this._waitingQueue = null;\\\\n        this._spinCount = 0; // Just for debugging waitFor()\\\\n        this._completion = new Promise(function (resolve, reject) {\\\\n            _this._resolve = resolve;\\\\n            _this._reject = reject;\\\\n        });\\\\n        this._completion.then(function () {\\\\n            _this.active = false;\\\\n            _this.on.complete.fire();\\\\n        }, function (e) {\\\\n            var wasActive = _this.active;\\\\n            _this.active = false;\\\\n            _this.on.error.fire(e);\\\\n            _this.parent ?\\\\n                _this.parent._reject(e) :\\\\n                wasActive && _this.idbtrans && _this.idbtrans.abort();\\\\n            return rejection(e); // Indicate we actually DO NOT catch this error.\\\\n        });\\\\n    }\\\\n    props(Transaction.prototype, {\\\\n        //\\\\n        // Transaction Protected Methods (not required by API users, but needed internally and eventually by dexie extensions)\\\\n        //\\\\n        _lock: function () {\\\\n            assert(!PSD.global); // Locking and unlocking reuires to be within a PSD scope.\\\\n            // Temporary set all requests into a pending queue if they are called before database is ready.\\\\n            ++this._reculock; // Recursive read/write lock pattern using PSD (Promise Specific Data) instead of TLS (Thread Local Storage)\\\\n            if (this._reculock === 1 && !PSD.global)\\\\n                PSD.lockOwnerFor = this;\\\\n            return this;\\\\n        },\\\\n        _unlock: function () {\\\\n            assert(!PSD.global); // Locking and unlocking reuires to be within a PSD scope.\\\\n            if (--this._reculock === 0) {\\\\n                if (!PSD.global)\\\\n                    PSD.lockOwnerFor = null;\\\\n                while (this._blockedFuncs.length > 0 && !this._locked()) {\\\\n                    var fnAndPSD = this._blockedFuncs.shift();\\\\n                    try {\\\\n                        usePSD(fnAndPSD[1], fnAndPSD[0]);\\\\n                    }\\\\n                    catch (e) { }\\\\n                }\\\\n            }\\\\n            return this;\\\\n        },\\\\n        _locked: function () {\\\\n            // Checks if any write-lock is applied on this transaction.\\\\n            // To simplify the Dexie API for extension implementations, we support recursive locks.\\\\n            // This is accomplished by using \\"Promise Specific Data\\" (PSD).\\\\n            // PSD data is bound to a Promise and any child Promise emitted through then() or resolve( new Promise() ).\\\\n            // PSD is local to code executing on top of the call stacks of any of any code executed by Promise():\\\\n            //         * callback given to the Promise() constructor  (function (resolve, reject){...})\\\\n            //         * callbacks given to then()/catch()/finally() methods (function (value){...})\\\\n            // If creating a new independant Promise instance from within a Promise call stack, the new Promise will derive the PSD from the call stack of the parent Promise.\\\\n            // Derivation is done so that the inner PSD __proto__ points to the outer PSD.\\\\n            // PSD.lockOwnerFor will point to current transaction object if the currently executing PSD scope owns the lock.\\\\n            return this._reculock && PSD.lockOwnerFor !== this;\\\\n        },\\\\n        create: function (idbtrans) {\\\\n            var _this = this;\\\\n            if (!this.mode)\\\\n                return this;\\\\n            assert(!this.idbtrans);\\\\n            if (!idbtrans && !idbdb) {\\\\n                switch (dbOpenError && dbOpenError.name) {\\\\n                    case \\"DatabaseClosedError\\":\\\\n                        // Errors where it is no difference whether it was caused by the user operation or an earlier call to db.open()\\\\n                        throw new exceptions.DatabaseClosed(dbOpenError);\\\\n                    case \\"MissingAPIError\\":\\\\n                        // Errors where it is no difference whether it was caused by the user operation or an earlier call to db.open()\\\\n                        throw new exceptions.MissingAPI(dbOpenError.message, dbOpenError);\\\\n                    default:\\\\n                        // Make it clear that the user operation was not what caused the error - the error had occurred earlier on db.open()!\\\\n                        throw new exceptions.OpenFailed(dbOpenError);\\\\n                }\\\\n            }\\\\n            if (!this.active)\\\\n                throw new exceptions.TransactionInactive();\\\\n            assert(this._completion._state === null);\\\\n            idbtrans = this.idbtrans = idbtrans || idbdb.transaction(safariMultiStoreFix(this.storeNames), this.mode);\\\\n            idbtrans.onerror = wrap(function (ev) {\\\\n                preventDefault(ev); // Prohibit default bubbling to window.error\\\\n                _this._reject(idbtrans.error);\\\\n            });\\\\n            idbtrans.onabort = wrap(function (ev) {\\\\n                preventDefault(ev);\\\\n                _this.active && _this._reject(new exceptions.Abort(idbtrans.error));\\\\n                _this.active = false;\\\\n                _this.on(\\"abort\\").fire(ev);\\\\n            });\\\\n            idbtrans.oncomplete = wrap(function () {\\\\n                _this.active = false;\\\\n                _this._resolve();\\\\n            });\\\\n            return this;\\\\n        },\\\\n        _promise: function (mode, fn, bWriteLock) {\\\\n            var _this = this;\\\\n            if (mode === READWRITE && this.mode !== READWRITE)\\\\n                return rejection(new exceptions.ReadOnly(\\"Transaction is readonly\\"));\\\\n            if (!this.active)\\\\n                return rejection(new exceptions.TransactionInactive());\\\\n            if (this._locked()) {\\\\n                return new Promise(function (resolve, reject) {\\\\n                    _this._blockedFuncs.push([function () {\\\\n                            _this._promise(mode, fn, bWriteLock).then(resolve, reject);\\\\n                        }, PSD]);\\\\n                });\\\\n            }\\\\n            else if (bWriteLock) {\\\\n                return newScope(function () {\\\\n                    var p = new Promise(function (resolve, reject) {\\\\n                        _this._lock();\\\\n                        var rv = fn(resolve, reject, _this);\\\\n                        if (rv && rv.then)\\\\n                            rv.then(resolve, reject);\\\\n                    });\\\\n                    p.finally(function () { return _this._unlock(); });\\\\n                    p._lib = true;\\\\n                    return p;\\\\n                });\\\\n            }\\\\n            else {\\\\n                var p = new Promise(function (resolve, reject) {\\\\n                    var rv = fn(resolve, reject, _this);\\\\n                    if (rv && rv.then)\\\\n                        rv.then(resolve, reject);\\\\n                });\\\\n                p._lib = true;\\\\n                return p;\\\\n            }\\\\n        },\\\\n        _root: function () {\\\\n            return this.parent ? this.parent._root() : this;\\\\n        },\\\\n        waitFor: function (promise) {\\\\n            // Always operate on the root transaction (in case this is a sub stransaction)\\\\n            var root = this._root();\\\\n            // For stability reasons, convert parameter to promise no matter what type is passed to waitFor().\\\\n            // (We must be able to call .then() on it.)\\\\n            promise = Promise.resolve(promise);\\\\n            if (root._waitingFor) {\\\\n                // Already called waitFor(). Wait for both to complete.\\\\n                root._waitingFor = root._waitingFor.then(function () { return promise; });\\\\n            }\\\\n            else {\\\\n                // We\\\\\'re not in waiting state. Start waiting state.\\\\n                root._waitingFor = promise;\\\\n                root._waitingQueue = [];\\\\n                // Start interacting with indexedDB until promise completes:\\\\n                var store = root.idbtrans.objectStore(root.storeNames[0]);\\\\n                (function spin() {\\\\n                    ++root._spinCount; // For debugging only\\\\n                    while (root._waitingQueue.length)\\\\n                        (root._waitingQueue.shift())();\\\\n                    if (root._waitingFor)\\\\n                        store.get(-Infinity).onsuccess = spin;\\\\n                }());\\\\n            }\\\\n            var currentWaitPromise = root._waitingFor;\\\\n            return new Promise(function (resolve, reject) {\\\\n                promise.then(function (res) { return root._waitingQueue.push(wrap(resolve.bind(null, res))); }, function (err) { return root._waitingQueue.push(wrap(reject.bind(null, err))); }).finally(function () {\\\\n                    if (root._waitingFor === currentWaitPromise) {\\\\n                        // No one added a wait after us. Safe to stop the spinning.\\\\n                        root._waitingFor = null;\\\\n                    }\\\\n                });\\\\n            });\\\\n        },\\\\n        //\\\\n        // Transaction Public Properties and Methods\\\\n        //\\\\n        abort: function () {\\\\n            this.active && this._reject(new exceptions.Abort());\\\\n            this.active = false;\\\\n        },\\\\n        tables: {\\\\n            get: deprecated(\\"Transaction.tables\\", function () { return allTables; })\\\\n        },\\\\n        table: function (name) {\\\\n            var table = db.table(name); // Don\\\\\'t check that table is part of transaction. It must fail lazily!\\\\n            return new Table(name, table.schema, this);\\\\n        }\\\\n    });\\\\n    //\\\\n    //\\\\n    //\\\\n    // WhereClause\\\\n    //\\\\n    //\\\\n    //\\\\n    function WhereClause(table, index, orCollection) {\\\\n        /// <param name=\\"table\\" type=\\"Table\\"></param>\\\\n        /// <param name=\\"index\\" type=\\"String\\" optional=\\"true\\"></param>\\\\n        /// <param name=\\"orCollection\\" type=\\"Collection\\" optional=\\"true\\"></param>\\\\n        this._ctx = {\\\\n            table: table,\\\\n            index: index === \\":id\\" ? null : index,\\\\n            or: orCollection\\\\n        };\\\\n    }\\\\n    props(WhereClause.prototype, function () {\\\\n        // WhereClause private methods\\\\n        function fail(collectionOrWhereClause, err, T) {\\\\n            var collection = collectionOrWhereClause instanceof WhereClause ?\\\\n                new Collection(collectionOrWhereClause) :\\\\n                collectionOrWhereClause;\\\\n            collection._ctx.error = T ? new T(err) : new TypeError(err);\\\\n            return collection;\\\\n        }\\\\n        function emptyCollection(whereClause) {\\\\n            return new Collection(whereClause, function () { return IDBKeyRange.only(\\"\\"); }).limit(0);\\\\n        }\\\\n        function upperFactory(dir) {\\\\n            return dir === \\"next\\" ? function (s) { return s.toUpperCase(); } : function (s) { return s.toLowerCase(); };\\\\n        }\\\\n        function lowerFactory(dir) {\\\\n            return dir === \\"next\\" ? function (s) { return s.toLowerCase(); } : function (s) { return s.toUpperCase(); };\\\\n        }\\\\n        function nextCasing(key, lowerKey, upperNeedle, lowerNeedle, cmp, dir) {\\\\n            var length = Math.min(key.length, lowerNeedle.length);\\\\n            var llp = -1;\\\\n            for (var i = 0; i < length; ++i) {\\\\n                var lwrKeyChar = lowerKey[i];\\\\n                if (lwrKeyChar !== lowerNeedle[i]) {\\\\n                    if (cmp(key[i], upperNeedle[i]) < 0)\\\\n                        return key.substr(0, i) + upperNeedle[i] + upperNeedle.substr(i + 1);\\\\n                    if (cmp(key[i], lowerNeedle[i]) < 0)\\\\n                        return key.substr(0, i) + lowerNeedle[i] + upperNeedle.substr(i + 1);\\\\n                    if (llp >= 0)\\\\n                        return key.substr(0, llp) + lowerKey[llp] + upperNeedle.substr(llp + 1);\\\\n                    return null;\\\\n                }\\\\n                if (cmp(key[i], lwrKeyChar) < 0)\\\\n                    llp = i;\\\\n            }\\\\n            if (length < lowerNeedle.length && dir === \\"next\\")\\\\n                return key + upperNeedle.substr(key.length);\\\\n            if (length < key.length && dir === \\"prev\\")\\\\n                return key.substr(0, upperNeedle.length);\\\\n            return (llp < 0 ? null : key.substr(0, llp) + lowerNeedle[llp] + upperNeedle.substr(llp + 1));\\\\n        }\\\\n        function addIgnoreCaseAlgorithm(whereClause, match, needles, suffix) {\\\\n            /// <param name=\\"needles\\" type=\\"Array\\" elementType=\\"String\\"></param>\\\\n            var upper, lower, compare, upperNeedles, lowerNeedles, direction, nextKeySuffix, needlesLen = needles.length;\\\\n            if (!needles.every(function (s) { return typeof s === \\\\\'string\\\\\'; })) {\\\\n                return fail(whereClause, STRING_EXPECTED);\\\\n            }\\\\n            function initDirection(dir) {\\\\n                upper = upperFactory(dir);\\\\n                lower = lowerFactory(dir);\\\\n                compare = (dir === \\"next\\" ? simpleCompare : simpleCompareReverse);\\\\n                var needleBounds = needles.map(function (needle) {\\\\n                    return { lower: lower(needle), upper: upper(needle) };\\\\n                }).sort(function (a, b) {\\\\n                    return compare(a.lower, b.lower);\\\\n                });\\\\n                upperNeedles = needleBounds.map(function (nb) { return nb.upper; });\\\\n                lowerNeedles = needleBounds.map(function (nb) { return nb.lower; });\\\\n                direction = dir;\\\\n                nextKeySuffix = (dir === \\"next\\" ? \\"\\" : suffix);\\\\n            }\\\\n            initDirection(\\"next\\");\\\\n            var c = new Collection(whereClause, function () {\\\\n                return IDBKeyRange.bound(upperNeedles[0], lowerNeedles[needlesLen - 1] + suffix);\\\\n            });\\\\n            c._ondirectionchange = function (direction) {\\\\n                // This event onlys occur before filter is called the first time.\\\\n                initDirection(direction);\\\\n            };\\\\n            var firstPossibleNeedle = 0;\\\\n            c._addAlgorithm(function (cursor, advance, resolve) {\\\\n                /// <param name=\\"cursor\\" type=\\"IDBCursor\\"></param>\\\\n                /// <param name=\\"advance\\" type=\\"Function\\"></param>\\\\n                /// <param name=\\"resolve\\" type=\\"Function\\"></param>\\\\n                var key = cursor.key;\\\\n                if (typeof key !== \\\\\'string\\\\\')\\\\n                    return false;\\\\n                var lowerKey = lower(key);\\\\n                if (match(lowerKey, lowerNeedles, firstPossibleNeedle)) {\\\\n                    return true;\\\\n                }\\\\n                else {\\\\n                    var lowestPossibleCasing = null;\\\\n                    for (var i = firstPossibleNeedle; i < needlesLen; ++i) {\\\\n                        var casing = nextCasing(key, lowerKey, upperNeedles[i], lowerNeedles[i], compare, direction);\\\\n                        if (casing === null && lowestPossibleCasing === null)\\\\n                            firstPossibleNeedle = i + 1;\\\\n                        else if (lowestPossibleCasing === null || compare(lowestPossibleCasing, casing) > 0) {\\\\n                            lowestPossibleCasing = casing;\\\\n                        }\\\\n                    }\\\\n                    if (lowestPossibleCasing !== null) {\\\\n                        advance(function () { cursor.continue(lowestPossibleCasing + nextKeySuffix); });\\\\n                    }\\\\n                    else {\\\\n                        advance(resolve);\\\\n                    }\\\\n                    return false;\\\\n                }\\\\n            });\\\\n            return c;\\\\n        }\\\\n        //\\\\n        // WhereClause public methods\\\\n        //\\\\n        return {\\\\n            between: function (lower, upper, includeLower, includeUpper) {\\\\n                /// <summary>\\\\n                ///     Filter out records whose where-field lays between given lower and upper values. Applies to Strings, Numbers and Dates.\\\\n                /// </summary>\\\\n                /// <param name=\\"lower\\"></param>\\\\n                /// <param name=\\"upper\\"></param>\\\\n                /// <param name=\\"includeLower\\" optional=\\"true\\">Whether items that equals lower should be included. Default true.</param>\\\\n                /// <param name=\\"includeUpper\\" optional=\\"true\\">Whether items that equals upper should be included. Default false.</param>\\\\n                /// <returns type=\\"Collection\\"></returns>\\\\n                includeLower = includeLower !== false; // Default to true\\\\n                includeUpper = includeUpper === true; // Default to false\\\\n                try {\\\\n                    if ((cmp(lower, upper) > 0) ||\\\\n                        (cmp(lower, upper) === 0 && (includeLower || includeUpper) && !(includeLower && includeUpper)))\\\\n                        return emptyCollection(this); // Workaround for idiotic W3C Specification that DataError must be thrown if lower > upper. The natural result would be to return an empty collection.\\\\n                    return new Collection(this, function () { return IDBKeyRange.bound(lower, upper, !includeLower, !includeUpper); });\\\\n                }\\\\n                catch (e) {\\\\n                    return fail(this, INVALID_KEY_ARGUMENT);\\\\n                }\\\\n            },\\\\n            equals: function (value) {\\\\n                return new Collection(this, function () { return IDBKeyRange.only(value); });\\\\n            },\\\\n            above: function (value) {\\\\n                return new Collection(this, function () { return IDBKeyRange.lowerBound(value, true); });\\\\n            },\\\\n            aboveOrEqual: function (value) {\\\\n                return new Collection(this, function () { return IDBKeyRange.lowerBound(value); });\\\\n            },\\\\n            below: function (value) {\\\\n                return new Collection(this, function () { return IDBKeyRange.upperBound(value, true); });\\\\n            },\\\\n            belowOrEqual: function (value) {\\\\n                return new Collection(this, function () { return IDBKeyRange.upperBound(value); });\\\\n            },\\\\n            startsWith: function (str) {\\\\n                /// <param name=\\"str\\" type=\\"String\\"></param>\\\\n                if (typeof str !== \\\\\'string\\\\\')\\\\n                    return fail(this, STRING_EXPECTED);\\\\n                return this.between(str, str + maxString, true, true);\\\\n            },\\\\n            startsWithIgnoreCase: function (str) {\\\\n                /// <param name=\\"str\\" type=\\"String\\"></param>\\\\n                if (str === \\"\\")\\\\n                    return this.startsWith(str);\\\\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return x.indexOf(a[0]) === 0; }, [str], maxString);\\\\n            },\\\\n            equalsIgnoreCase: function (str) {\\\\n                /// <param name=\\"str\\" type=\\"String\\"></param>\\\\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return x === a[0]; }, [str], \\"\\");\\\\n            },\\\\n            anyOfIgnoreCase: function () {\\\\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\\\\n                if (set.length === 0)\\\\n                    return emptyCollection(this);\\\\n                return addIgnoreCaseAlgorithm(this, function (x, a) { return a.indexOf(x) !== -1; }, set, \\"\\");\\\\n            },\\\\n            startsWithAnyOfIgnoreCase: function () {\\\\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\\\\n                if (set.length === 0)\\\\n                    return emptyCollection(this);\\\\n                return addIgnoreCaseAlgorithm(this, function (x, a) {\\\\n                    return a.some(function (n) {\\\\n                        return x.indexOf(n) === 0;\\\\n                    });\\\\n                }, set, maxString);\\\\n            },\\\\n            anyOf: function () {\\\\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\\\\n                var compare = ascending;\\\\n                try {\\\\n                    set.sort(compare);\\\\n                }\\\\n                catch (e) {\\\\n                    return fail(this, INVALID_KEY_ARGUMENT);\\\\n                }\\\\n                if (set.length === 0)\\\\n                    return emptyCollection(this);\\\\n                var c = new Collection(this, function () { return IDBKeyRange.bound(set[0], set[set.length - 1]); });\\\\n                c._ondirectionchange = function (direction) {\\\\n                    compare = (direction === \\"next\\" ? ascending : descending);\\\\n                    set.sort(compare);\\\\n                };\\\\n                var i = 0;\\\\n                c._addAlgorithm(function (cursor, advance, resolve) {\\\\n                    var key = cursor.key;\\\\n                    while (compare(key, set[i]) > 0) {\\\\n                        // The cursor has passed beyond this key. Check next.\\\\n                        ++i;\\\\n                        if (i === set.length) {\\\\n                            // There is no next. Stop searching.\\\\n                            advance(resolve);\\\\n                            return false;\\\\n                        }\\\\n                    }\\\\n                    if (compare(key, set[i]) === 0) {\\\\n                        // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\\\\n                        return true;\\\\n                    }\\\\n                    else {\\\\n                        // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\\\\n                        advance(function () { cursor.continue(set[i]); });\\\\n                        return false;\\\\n                    }\\\\n                });\\\\n                return c;\\\\n            },\\\\n            notEqual: function (value) {\\\\n                return this.inAnyRange([[minKey, value], [value, maxKey]], { includeLowers: false, includeUppers: false });\\\\n            },\\\\n            noneOf: function () {\\\\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\\\\n                if (set.length === 0)\\\\n                    return new Collection(this); // Return entire collection.\\\\n                try {\\\\n                    set.sort(ascending);\\\\n                }\\\\n                catch (e) {\\\\n                    return fail(this, INVALID_KEY_ARGUMENT);\\\\n                }\\\\n                // Transform [\\"a\\",\\"b\\",\\"c\\"] to a set of ranges for between/above/below: [[minKey,\\"a\\"], [\\"a\\",\\"b\\"], [\\"b\\",\\"c\\"], [\\"c\\",maxKey]]\\\\n                var ranges = set.reduce(function (res, val) { return res ? res.concat([[res[res.length - 1][1], val]]) : [[minKey, val]]; }, null);\\\\n                ranges.push([set[set.length - 1], maxKey]);\\\\n                return this.inAnyRange(ranges, { includeLowers: false, includeUppers: false });\\\\n            },\\\\n            /** Filter out values withing given set of ranges.\\\\n            * Example, give children and elders a rebate of 50%:\\\\n            *\\\\n            *   db.friends.where(\\\\\'age\\\\\').inAnyRange([[0,18],[65,Infinity]]).modify({Rebate: 1/2});\\\\n            *\\\\n            * @param {(string|number|Date|Array)[][]} ranges\\\\n            * @param {{includeLowers: boolean, includeUppers: boolean}} options\\\\n            */\\\\n            inAnyRange: function (ranges, options) {\\\\n                if (ranges.length === 0)\\\\n                    return emptyCollection(this);\\\\n                if (!ranges.every(function (range) { return range[0] !== undefined && range[1] !== undefined && ascending(range[0], range[1]) <= 0; })) {\\\\n                    return fail(this, \\"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower\\", exceptions.InvalidArgument);\\\\n                }\\\\n                var includeLowers = !options || options.includeLowers !== false; // Default to true\\\\n                var includeUppers = options && options.includeUppers === true; // Default to false\\\\n                function addRange(ranges, newRange) {\\\\n                    for (var i = 0, l = ranges.length; i < l; ++i) {\\\\n                        var range = ranges[i];\\\\n                        if (cmp(newRange[0], range[1]) < 0 && cmp(newRange[1], range[0]) > 0) {\\\\n                            range[0] = min(range[0], newRange[0]);\\\\n                            range[1] = max(range[1], newRange[1]);\\\\n                            break;\\\\n                        }\\\\n                    }\\\\n                    if (i === l)\\\\n                        ranges.push(newRange);\\\\n                    return ranges;\\\\n                }\\\\n                var sortDirection = ascending;\\\\n                function rangeSorter(a, b) { return sortDirection(a[0], b[0]); }\\\\n                // Join overlapping ranges\\\\n                var set;\\\\n                try {\\\\n                    set = ranges.reduce(addRange, []);\\\\n                    set.sort(rangeSorter);\\\\n                }\\\\n                catch (ex) {\\\\n                    return fail(this, INVALID_KEY_ARGUMENT);\\\\n                }\\\\n                var i = 0;\\\\n                var keyIsBeyondCurrentEntry = includeUppers ?\\\\n                    function (key) { return ascending(key, set[i][1]) > 0; } :\\\\n                    function (key) { return ascending(key, set[i][1]) >= 0; };\\\\n                var keyIsBeforeCurrentEntry = includeLowers ?\\\\n                    function (key) { return descending(key, set[i][0]) > 0; } :\\\\n                    function (key) { return descending(key, set[i][0]) >= 0; };\\\\n                function keyWithinCurrentRange(key) {\\\\n                    return !keyIsBeyondCurrentEntry(key) && !keyIsBeforeCurrentEntry(key);\\\\n                }\\\\n                var checkKey = keyIsBeyondCurrentEntry;\\\\n                var c = new Collection(this, function () {\\\\n                    return IDBKeyRange.bound(set[0][0], set[set.length - 1][1], !includeLowers, !includeUppers);\\\\n                });\\\\n                c._ondirectionchange = function (direction) {\\\\n                    if (direction === \\"next\\") {\\\\n                        checkKey = keyIsBeyondCurrentEntry;\\\\n                        sortDirection = ascending;\\\\n                    }\\\\n                    else {\\\\n                        checkKey = keyIsBeforeCurrentEntry;\\\\n                        sortDirection = descending;\\\\n                    }\\\\n                    set.sort(rangeSorter);\\\\n                };\\\\n                c._addAlgorithm(function (cursor, advance, resolve) {\\\\n                    var key = cursor.key;\\\\n                    while (checkKey(key)) {\\\\n                        // The cursor has passed beyond this key. Check next.\\\\n                        ++i;\\\\n                        if (i === set.length) {\\\\n                            // There is no next. Stop searching.\\\\n                            advance(resolve);\\\\n                            return false;\\\\n                        }\\\\n                    }\\\\n                    if (keyWithinCurrentRange(key)) {\\\\n                        // The current cursor value should be included and we should continue a single step in case next item has the same key or possibly our next key in set.\\\\n                        return true;\\\\n                    }\\\\n                    else if (cmp(key, set[i][1]) === 0 || cmp(key, set[i][0]) === 0) {\\\\n                        // includeUpper or includeLower is false so keyWithinCurrentRange() returns false even though we are at range border.\\\\n                        // Continue to next key but don\\\\\'t include this one.\\\\n                        return false;\\\\n                    }\\\\n                    else {\\\\n                        // cursor.key not yet at set[i]. Forward cursor to the next key to hunt for.\\\\n                        advance(function () {\\\\n                            if (sortDirection === ascending)\\\\n                                cursor.continue(set[i][0]);\\\\n                            else\\\\n                                cursor.continue(set[i][1]);\\\\n                        });\\\\n                        return false;\\\\n                    }\\\\n                });\\\\n                return c;\\\\n            },\\\\n            startsWithAnyOf: function () {\\\\n                var set = getArrayOf.apply(NO_CHAR_ARRAY, arguments);\\\\n                if (!set.every(function (s) { return typeof s === \\\\\'string\\\\\'; })) {\\\\n                    return fail(this, \\"startsWithAnyOf() only works with strings\\");\\\\n                }\\\\n                if (set.length === 0)\\\\n                    return emptyCollection(this);\\\\n                return this.inAnyRange(set.map(function (str) {\\\\n                    return [str, str + maxString];\\\\n                }));\\\\n            }\\\\n        };\\\\n    });\\\\n    //\\\\n    //\\\\n    //\\\\n    // Collection Class\\\\n    //\\\\n    //\\\\n    //\\\\n    function Collection(whereClause, keyRangeGenerator) {\\\\n        /// <summary>\\\\n        ///\\\\n        /// </summary>\\\\n        /// <param name=\\"whereClause\\" type=\\"WhereClause\\">Where clause instance</param>\\\\n        /// <param name=\\"keyRangeGenerator\\" value=\\"function(){ return IDBKeyRange.bound(0,1);}\\" optional=\\"true\\"></param>\\\\n        var keyRange = null, error = null;\\\\n        if (keyRangeGenerator)\\\\n            try {\\\\n                keyRange = keyRangeGenerator();\\\\n            }\\\\n            catch (ex) {\\\\n                error = ex;\\\\n            }\\\\n        var whereCtx = whereClause._ctx, table = whereCtx.table;\\\\n        this._ctx = {\\\\n            table: table,\\\\n            index: whereCtx.index,\\\\n            isPrimKey: (!whereCtx.index || (table.schema.primKey.keyPath && whereCtx.index === table.schema.primKey.name)),\\\\n            range: keyRange,\\\\n            keysOnly: false,\\\\n            dir: \\"next\\",\\\\n            unique: \\"\\",\\\\n            algorithm: null,\\\\n            filter: null,\\\\n            replayFilter: null,\\\\n            justLimit: true,\\\\n            isMatch: null,\\\\n            offset: 0,\\\\n            limit: Infinity,\\\\n            error: error,\\\\n            or: whereCtx.or,\\\\n            valueMapper: table.hook.reading.fire\\\\n        };\\\\n    }\\\\n    function isPlainKeyRange(ctx, ignoreLimitFilter) {\\\\n        return !(ctx.filter || ctx.algorithm || ctx.or) &&\\\\n            (ignoreLimitFilter ? ctx.justLimit : !ctx.replayFilter);\\\\n    }\\\\n    props(Collection.prototype, function () {\\\\n        //\\\\n        // Collection Private Functions\\\\n        //\\\\n        function addFilter(ctx, fn) {\\\\n            ctx.filter = combine(ctx.filter, fn);\\\\n        }\\\\n        function addReplayFilter(ctx, factory, isLimitFilter) {\\\\n            var curr = ctx.replayFilter;\\\\n            ctx.replayFilter = curr ? function () { return combine(curr(), factory()); } : factory;\\\\n            ctx.justLimit = isLimitFilter && !curr;\\\\n        }\\\\n        function addMatchFilter(ctx, fn) {\\\\n            ctx.isMatch = combine(ctx.isMatch, fn);\\\\n        }\\\\n        /** @param ctx {\\\\n         *      isPrimKey: boolean,\\\\n         *      table: Table,\\\\n         *      index: string\\\\n         * }\\\\n         * @param store IDBObjectStore\\\\n         **/\\\\n        function getIndexOrStore(ctx, store) {\\\\n            if (ctx.isPrimKey)\\\\n                return store;\\\\n            var indexSpec = ctx.table.schema.idxByName[ctx.index];\\\\n            if (!indexSpec)\\\\n                throw new exceptions.Schema(\\"KeyPath \\" + ctx.index + \\" on object store \\" + store.name + \\" is not indexed\\");\\\\n            return store.index(indexSpec.name);\\\\n        }\\\\n        /** @param ctx {\\\\n         *      isPrimKey: boolean,\\\\n         *      table: Table,\\\\n         *      index: string,\\\\n         *      keysOnly: boolean,\\\\n         *      range?: IDBKeyRange,\\\\n         *      dir: \\"next\\" | \\"prev\\"\\\\n         * }\\\\n         */\\\\n        function openCursor(ctx, store) {\\\\n            var idxOrStore = getIndexOrStore(ctx, store);\\\\n            return ctx.keysOnly && \\\\\'openKeyCursor\\\\\' in idxOrStore ?\\\\n                idxOrStore.openKeyCursor(ctx.range || null, ctx.dir + ctx.unique) :\\\\n                idxOrStore.openCursor(ctx.range || null, ctx.dir + ctx.unique);\\\\n        }\\\\n        function iter(ctx, fn, resolve, reject, idbstore) {\\\\n            var filter = ctx.replayFilter ? combine(ctx.filter, ctx.replayFilter()) : ctx.filter;\\\\n            if (!ctx.or) {\\\\n                iterate(openCursor(ctx, idbstore), combine(ctx.algorithm, filter), fn, resolve, reject, !ctx.keysOnly && ctx.valueMapper);\\\\n            }\\\\n            else\\\\n                (function () {\\\\n                    var set = {};\\\\n                    var resolved = 0;\\\\n                    function resolveboth() {\\\\n                        if (++resolved === 2)\\\\n                            resolve(); // Seems like we just support or btwn max 2 expressions, but there are no limit because we do recursion.\\\\n                    }\\\\n                    function union(item, cursor, advance) {\\\\n                        if (!filter || filter(cursor, advance, resolveboth, reject)) {\\\\n                            var primaryKey = cursor.primaryKey;\\\\n                            var key = \\\\\'\\\\\' + primaryKey;\\\\n                            if (key === \\\\\'[object ArrayBuffer]\\\\\')\\\\n                                key = \\\\\'\\\\\' + new Uint8Array(primaryKey);\\\\n                            if (!hasOwn(set, key)) {\\\\n                                set[key] = true;\\\\n                                fn(item, cursor, advance);\\\\n                            }\\\\n                        }\\\\n                    }\\\\n                    ctx.or._iterate(union, resolveboth, reject, idbstore);\\\\n                    iterate(openCursor(ctx, idbstore), ctx.algorithm, union, resolveboth, reject, !ctx.keysOnly && ctx.valueMapper);\\\\n                })();\\\\n        }\\\\n        return {\\\\n            //\\\\n            // Collection Protected Functions\\\\n            //\\\\n            _read: function (fn, cb) {\\\\n                var ctx = this._ctx;\\\\n                return ctx.error ?\\\\n                    ctx.table._trans(null, rejection.bind(null, ctx.error)) :\\\\n                    ctx.table._idbstore(READONLY, fn).then(cb);\\\\n            },\\\\n            _write: function (fn) {\\\\n                var ctx = this._ctx;\\\\n                return ctx.error ?\\\\n                    ctx.table._trans(null, rejection.bind(null, ctx.error)) :\\\\n                    ctx.table._idbstore(READWRITE, fn, \\"locked\\"); // When doing write operations on collections, always lock the operation so that upcoming operations gets queued.\\\\n            },\\\\n            _addAlgorithm: function (fn) {\\\\n                var ctx = this._ctx;\\\\n                ctx.algorithm = combine(ctx.algorithm, fn);\\\\n            },\\\\n            _iterate: function (fn, resolve, reject, idbstore) {\\\\n                return iter(this._ctx, fn, resolve, reject, idbstore);\\\\n            },\\\\n            clone: function (props$$1) {\\\\n                var rv = Object.create(this.constructor.prototype), ctx = Object.create(this._ctx);\\\\n                if (props$$1)\\\\n                    extend(ctx, props$$1);\\\\n                rv._ctx = ctx;\\\\n                return rv;\\\\n            },\\\\n            raw: function () {\\\\n                this._ctx.valueMapper = null;\\\\n                return this;\\\\n            },\\\\n            //\\\\n            // Collection Public methods\\\\n            //\\\\n            each: function (fn) {\\\\n                var ctx = this._ctx;\\\\n                return this._read(function (resolve, reject, idbstore) {\\\\n                    iter(ctx, fn, resolve, reject, idbstore);\\\\n                });\\\\n            },\\\\n            count: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                if (isPlainKeyRange(ctx, true)) {\\\\n                    // This is a plain key range. We can use the count() method if the index.\\\\n                    return this._read(function (resolve, reject, idbstore) {\\\\n                        var idx = getIndexOrStore(ctx, idbstore);\\\\n                        var req = (ctx.range ? idx.count(ctx.range) : idx.count());\\\\n                        req.onerror = eventRejectHandler(reject);\\\\n                        req.onsuccess = function (e) {\\\\n                            resolve(Math.min(e.target.result, ctx.limit));\\\\n                        };\\\\n                    }, cb);\\\\n                }\\\\n                else {\\\\n                    // Algorithms, filters or expressions are applied. Need to count manually.\\\\n                    var count = 0;\\\\n                    return this._read(function (resolve, reject, idbstore) {\\\\n                        iter(ctx, function () { ++count; return false; }, function () { resolve(count); }, reject, idbstore);\\\\n                    }, cb);\\\\n                }\\\\n            },\\\\n            sortBy: function (keyPath, cb) {\\\\n                /// <param name=\\"keyPath\\" type=\\"String\\"></param>\\\\n                var parts = keyPath.split(\\\\\'.\\\\\').reverse(), lastPart = parts[0], lastIndex = parts.length - 1;\\\\n                function getval(obj, i) {\\\\n                    if (i)\\\\n                        return getval(obj[parts[i]], i - 1);\\\\n                    return obj[lastPart];\\\\n                }\\\\n                var order = this._ctx.dir === \\"next\\" ? 1 : -1;\\\\n                function sorter(a, b) {\\\\n                    var aVal = getval(a, lastIndex), bVal = getval(b, lastIndex);\\\\n                    return aVal < bVal ? -order : aVal > bVal ? order : 0;\\\\n                }\\\\n                return this.toArray(function (a) {\\\\n                    return a.sort(sorter);\\\\n                }).then(cb);\\\\n            },\\\\n            toArray: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                return this._read(function (resolve, reject, idbstore) {\\\\n                    if (hasGetAll && ctx.dir === \\\\\'next\\\\\' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {\\\\n                        // Special optimation if we could use IDBObjectStore.getAll() or\\\\n                        // IDBKeyRange.getAll():\\\\n                        var readingHook = ctx.table.hook.reading.fire;\\\\n                        var idxOrStore = getIndexOrStore(ctx, idbstore);\\\\n                        var req = ctx.limit < Infinity ?\\\\n                            idxOrStore.getAll(ctx.range, ctx.limit) :\\\\n                            idxOrStore.getAll(ctx.range);\\\\n                        req.onerror = eventRejectHandler(reject);\\\\n                        req.onsuccess = readingHook === mirror ?\\\\n                            eventSuccessHandler(resolve) :\\\\n                            eventSuccessHandler(function (res) {\\\\n                                try {\\\\n                                    resolve(res.map(readingHook));\\\\n                                }\\\\n                                catch (e) {\\\\n                                    reject(e);\\\\n                                }\\\\n                            });\\\\n                    }\\\\n                    else {\\\\n                        // Getting array through a cursor.\\\\n                        var a = [];\\\\n                        iter(ctx, function (item) { a.push(item); }, function arrayComplete() {\\\\n                            resolve(a);\\\\n                        }, reject, idbstore);\\\\n                    }\\\\n                }, cb);\\\\n            },\\\\n            offset: function (offset) {\\\\n                var ctx = this._ctx;\\\\n                if (offset <= 0)\\\\n                    return this;\\\\n                ctx.offset += offset; // For count()\\\\n                if (isPlainKeyRange(ctx)) {\\\\n                    addReplayFilter(ctx, function () {\\\\n                        var offsetLeft = offset;\\\\n                        return function (cursor, advance) {\\\\n                            if (offsetLeft === 0)\\\\n                                return true;\\\\n                            if (offsetLeft === 1) {\\\\n                                --offsetLeft;\\\\n                                return false;\\\\n                            }\\\\n                            advance(function () {\\\\n                                cursor.advance(offsetLeft);\\\\n                                offsetLeft = 0;\\\\n                            });\\\\n                            return false;\\\\n                        };\\\\n                    });\\\\n                }\\\\n                else {\\\\n                    addReplayFilter(ctx, function () {\\\\n                        var offsetLeft = offset;\\\\n                        return function () { return (--offsetLeft < 0); };\\\\n                    });\\\\n                }\\\\n                return this;\\\\n            },\\\\n            limit: function (numRows) {\\\\n                this._ctx.limit = Math.min(this._ctx.limit, numRows); // For count()\\\\n                addReplayFilter(this._ctx, function () {\\\\n                    var rowsLeft = numRows;\\\\n                    return function (cursor, advance, resolve) {\\\\n                        if (--rowsLeft <= 0)\\\\n                            advance(resolve); // Stop after this item has been included\\\\n                        return rowsLeft >= 0; // If numRows is already below 0, return false because then 0 was passed to numRows initially. Otherwise we wouldnt come here.\\\\n                    };\\\\n                }, true);\\\\n                return this;\\\\n            },\\\\n            until: function (filterFunction, bIncludeStopEntry) {\\\\n                addFilter(this._ctx, function (cursor, advance, resolve) {\\\\n                    if (filterFunction(cursor.value)) {\\\\n                        advance(resolve);\\\\n                        return bIncludeStopEntry;\\\\n                    }\\\\n                    else {\\\\n                        return true;\\\\n                    }\\\\n                });\\\\n                return this;\\\\n            },\\\\n            first: function (cb) {\\\\n                return this.limit(1).toArray(function (a) { return a[0]; }).then(cb);\\\\n            },\\\\n            last: function (cb) {\\\\n                return this.reverse().first(cb);\\\\n            },\\\\n            filter: function (filterFunction) {\\\\n                /// <param name=\\"jsFunctionFilter\\" type=\\"Function\\">function(val){return true/false}</param>\\\\n                addFilter(this._ctx, function (cursor) {\\\\n                    return filterFunction(cursor.value);\\\\n                });\\\\n                // match filters not used in Dexie.js but can be used by 3rd part libraries to test a\\\\n                // collection for a match without querying DB. Used by Dexie.Observable.\\\\n                addMatchFilter(this._ctx, filterFunction);\\\\n                return this;\\\\n            },\\\\n            and: function (filterFunction) {\\\\n                return this.filter(filterFunction);\\\\n            },\\\\n            or: function (indexName) {\\\\n                return new WhereClause(this._ctx.table, indexName, this);\\\\n            },\\\\n            reverse: function () {\\\\n                this._ctx.dir = (this._ctx.dir === \\"prev\\" ? \\"next\\" : \\"prev\\");\\\\n                if (this._ondirectionchange)\\\\n                    this._ondirectionchange(this._ctx.dir);\\\\n                return this;\\\\n            },\\\\n            desc: function () {\\\\n                return this.reverse();\\\\n            },\\\\n            eachKey: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                ctx.keysOnly = !ctx.isMatch;\\\\n                return this.each(function (val, cursor) { cb(cursor.key, cursor); });\\\\n            },\\\\n            eachUniqueKey: function (cb) {\\\\n                this._ctx.unique = \\"unique\\";\\\\n                return this.eachKey(cb);\\\\n            },\\\\n            eachPrimaryKey: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                ctx.keysOnly = !ctx.isMatch;\\\\n                return this.each(function (val, cursor) { cb(cursor.primaryKey, cursor); });\\\\n            },\\\\n            keys: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                ctx.keysOnly = !ctx.isMatch;\\\\n                var a = [];\\\\n                return this.each(function (item, cursor) {\\\\n                    a.push(cursor.key);\\\\n                }).then(function () {\\\\n                    return a;\\\\n                }).then(cb);\\\\n            },\\\\n            primaryKeys: function (cb) {\\\\n                var ctx = this._ctx;\\\\n                if (hasGetAll && ctx.dir === \\\\\'next\\\\\' && isPlainKeyRange(ctx, true) && ctx.limit > 0) {\\\\n                    // Special optimation if we could use IDBObjectStore.getAllKeys() or\\\\n                    // IDBKeyRange.getAllKeys():\\\\n                    return this._read(function (resolve, reject, idbstore) {\\\\n                        var idxOrStore = getIndexOrStore(ctx, idbstore);\\\\n                        var req = ctx.limit < Infinity ?\\\\n                            idxOrStore.getAllKeys(ctx.range, ctx.limit) :\\\\n                            idxOrStore.getAllKeys(ctx.range);\\\\n                        req.onerror = eventRejectHandler(reject);\\\\n                        req.onsuccess = eventSuccessHandler(resolve);\\\\n                    }).then(cb);\\\\n                }\\\\n                ctx.keysOnly = !ctx.isMatch;\\\\n                var a = [];\\\\n                return this.each(function (item, cursor) {\\\\n                    a.push(cursor.primaryKey);\\\\n                }).then(function () {\\\\n                    return a;\\\\n                }).then(cb);\\\\n            },\\\\n            uniqueKeys: function (cb) {\\\\n                this._ctx.unique = \\"unique\\";\\\\n                return this.keys(cb);\\\\n            },\\\\n            firstKey: function (cb) {\\\\n                return this.limit(1).keys(function (a) { return a[0]; }).then(cb);\\\\n            },\\\\n            lastKey: function (cb) {\\\\n                return this.reverse().firstKey(cb);\\\\n            },\\\\n            distinct: function () {\\\\n                var ctx = this._ctx, idx = ctx.index && ctx.table.schema.idxByName[ctx.index];\\\\n                if (!idx || !idx.multi)\\\\n                    return this; // distinct() only makes differencies on multiEntry indexes.\\\\n                var set = {};\\\\n                addFilter(this._ctx, function (cursor) {\\\\n                    var strKey = cursor.primaryKey.toString(); // Converts any Date to String, String to String, Number to String and Array to comma-separated string\\\\n                    var found = hasOwn(set, strKey);\\\\n                    set[strKey] = true;\\\\n                    return !found;\\\\n                });\\\\n                return this;\\\\n            },\\\\n            //\\\\n            // Methods that mutate storage\\\\n            //\\\\n            modify: function (changes) {\\\\n                var self = this, ctx = this._ctx, hook = ctx.table.hook, updatingHook = hook.updating.fire, deletingHook = hook.deleting.fire;\\\\n                return this._write(function (resolve, reject, idbstore, trans) {\\\\n                    var modifyer;\\\\n                    if (typeof changes === \\\\\'function\\\\\') {\\\\n                        // Changes is a function that may update, add or delete propterties or even require a deletion the object itself (delete this.item)\\\\n                        if (updatingHook === nop && deletingHook === nop) {\\\\n                            // Noone cares about what is being changed. Just let the modifier function be the given argument as is.\\\\n                            modifyer = changes;\\\\n                        }\\\\n                        else {\\\\n                            // People want to know exactly what is being modified or deleted.\\\\n                            // Let modifyer be a proxy function that finds out what changes the caller is actually doing\\\\n                            // and call the hooks accordingly!\\\\n                            modifyer = function (item) {\\\\n                                var origItem = deepClone(item); // Clone the item first so we can compare laters.\\\\n                                if (changes.call(this, item, this) === false)\\\\n                                    return false; // Call the real modifyer function (If it returns false explicitely, it means it dont want to modify anyting on this object)\\\\n                                if (!hasOwn(this, \\"value\\")) {\\\\n                                    // The real modifyer function requests a deletion of the object. Inform the deletingHook that a deletion is taking place.\\\\n                                    deletingHook.call(this, this.primKey, item, trans);\\\\n                                }\\\\n                                else {\\\\n                                    // No deletion. Check what was changed\\\\n                                    var objectDiff = getObjectDiff(origItem, this.value);\\\\n                                    var additionalChanges = updatingHook.call(this, objectDiff, this.primKey, origItem, trans);\\\\n                                    if (additionalChanges) {\\\\n                                        // Hook want to apply additional modifications. Make sure to fullfill the will of the hook.\\\\n                                        item = this.value;\\\\n                                        keys(additionalChanges).forEach(function (keyPath) {\\\\n                                            setByKeyPath(item, keyPath, additionalChanges[keyPath]); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\\\\n                                        });\\\\n                                    }\\\\n                                }\\\\n                            };\\\\n                        }\\\\n                    }\\\\n                    else if (updatingHook === nop) {\\\\n                        // changes is a set of {keyPath: value} and no one is listening to the updating hook.\\\\n                        var keyPaths = keys(changes);\\\\n                        var numKeys = keyPaths.length;\\\\n                        modifyer = function (item) {\\\\n                            var anythingModified = false;\\\\n                            for (var i = 0; i < numKeys; ++i) {\\\\n                                var keyPath = keyPaths[i], val = changes[keyPath];\\\\n                                if (getByKeyPath(item, keyPath) !== val) {\\\\n                                    setByKeyPath(item, keyPath, val); // Adding {keyPath: undefined} means that the keyPath should be deleted. Handled by setByKeyPath\\\\n                                    anythingModified = true;\\\\n                                }\\\\n                            }\\\\n                            return anythingModified;\\\\n                        };\\\\n                    }\\\\n                    else {\\\\n                        // changes is a set of {keyPath: value} and people are listening to the updating hook so we need to call it and\\\\n                        // allow it to add additional modifications to make.\\\\n                        var origChanges = changes;\\\\n                        changes = shallowClone(origChanges); // Let\\\\\'s work with a clone of the changes keyPath/value set so that we can restore it in case a hook extends it.\\\\n                        modifyer = function (item) {\\\\n                            var anythingModified = false;\\\\n                            var additionalChanges = updatingHook.call(this, changes, this.primKey, deepClone(item), trans);\\\\n                            if (additionalChanges)\\\\n                                extend(changes, additionalChanges);\\\\n                            keys(changes).forEach(function (keyPath) {\\\\n                                var val = changes[keyPath];\\\\n                                if (getByKeyPath(item, keyPath) !== val) {\\\\n                                    setByKeyPath(item, keyPath, val);\\\\n                                    anythingModified = true;\\\\n                                }\\\\n                            });\\\\n                            if (additionalChanges)\\\\n                                changes = shallowClone(origChanges); // Restore original changes for next iteration\\\\n                            return anythingModified;\\\\n                        };\\\\n                    }\\\\n                    var count = 0;\\\\n                    var successCount = 0;\\\\n                    var iterationComplete = false;\\\\n                    var failures = [];\\\\n                    var failKeys = [];\\\\n                    var currentKey = null;\\\\n                    function modifyItem(item, cursor) {\\\\n                        currentKey = cursor.primaryKey;\\\\n                        var thisContext = {\\\\n                            primKey: cursor.primaryKey,\\\\n                            value: item,\\\\n                            onsuccess: null,\\\\n                            onerror: null\\\\n                        };\\\\n                        function onerror(e) {\\\\n                            failures.push(e);\\\\n                            failKeys.push(thisContext.primKey);\\\\n                            checkFinished();\\\\n                            return true; // Catch these errors and let a final rejection decide whether or not to abort entire transaction\\\\n                        }\\\\n                        if (modifyer.call(thisContext, item, thisContext) !== false) {\\\\n                            var bDelete = !hasOwn(thisContext, \\"value\\");\\\\n                            ++count;\\\\n                            tryCatch(function () {\\\\n                                var req = (bDelete ? cursor.delete() : cursor.update(thisContext.value));\\\\n                                req._hookCtx = thisContext;\\\\n                                req.onerror = hookedEventRejectHandler(onerror);\\\\n                                req.onsuccess = hookedEventSuccessHandler(function () {\\\\n                                    ++successCount;\\\\n                                    checkFinished();\\\\n                                });\\\\n                            }, onerror);\\\\n                        }\\\\n                        else if (thisContext.onsuccess) {\\\\n                            // Hook will expect either onerror or onsuccess to always be called!\\\\n                            thisContext.onsuccess(thisContext.value);\\\\n                        }\\\\n                    }\\\\n                    function doReject(e) {\\\\n                        if (e) {\\\\n                            failures.push(e);\\\\n                            failKeys.push(currentKey);\\\\n                        }\\\\n                        return reject(new ModifyError(\\"Error modifying one or more objects\\", failures, successCount, failKeys));\\\\n                    }\\\\n                    function checkFinished() {\\\\n                        if (iterationComplete && successCount + failures.length === count) {\\\\n                            if (failures.length > 0)\\\\n                                doReject();\\\\n                            else\\\\n                                resolve(successCount);\\\\n                        }\\\\n                    }\\\\n                    self.clone().raw()._iterate(modifyItem, function () {\\\\n                        iterationComplete = true;\\\\n                        checkFinished();\\\\n                    }, doReject, idbstore);\\\\n                });\\\\n            },\\\\n            \\\\\'delete\\\\\': function () {\\\\n                var _this = this;\\\\n                var ctx = this._ctx, range = ctx.range, deletingHook = ctx.table.hook.deleting.fire, hasDeleteHook = deletingHook !== nop;\\\\n                if (!hasDeleteHook &&\\\\n                    isPlainKeyRange(ctx) &&\\\\n                    ((ctx.isPrimKey && !hangsOnDeleteLargeKeyRange) || !range)) {\\\\n                    // May use IDBObjectStore.delete(IDBKeyRange) in this case (Issue #208)\\\\n                    // For chromium, this is the way most optimized version.\\\\n                    // For IE/Edge, this could hang the indexedDB engine and make operating system instable\\\\n                    // (https://gist.github.com/dfahlander/5a39328f029de18222cf2125d56c38f7)\\\\n                    return this._write(function (resolve, reject, idbstore) {\\\\n                        // Our API contract is to return a count of deleted items, so we have to count() before delete().\\\\n                        var onerror = eventRejectHandler(reject), countReq = (range ? idbstore.count(range) : idbstore.count());\\\\n                        countReq.onerror = onerror;\\\\n                        countReq.onsuccess = function () {\\\\n                            var count = countReq.result;\\\\n                            tryCatch(function () {\\\\n                                var delReq = (range ? idbstore.delete(range) : idbstore.clear());\\\\n                                delReq.onerror = onerror;\\\\n                                delReq.onsuccess = function () { return resolve(count); };\\\\n                            }, function (err) { return reject(err); });\\\\n                        };\\\\n                    });\\\\n                }\\\\n                // Default version to use when collection is not a vanilla IDBKeyRange on the primary key.\\\\n                // Divide into chunks to not starve RAM.\\\\n                // If has delete hook, we will have to collect not just keys but also objects, so it will use\\\\n                // more memory and need lower chunk size.\\\\n                var CHUNKSIZE = hasDeleteHook ? 2000 : 10000;\\\\n                return this._write(function (resolve, reject, idbstore, trans) {\\\\n                    var totalCount = 0;\\\\n                    // Clone collection and change its table and set a limit of CHUNKSIZE on the cloned Collection instance.\\\\n                    var collection = _this\\\\n                        .clone({\\\\n                        keysOnly: !ctx.isMatch && !hasDeleteHook\\\\n                    }) // load just keys (unless filter() or and() or deleteHook has subscribers)\\\\n                        .distinct() // In case multiEntry is used, never delete same key twice because resulting count\\\\n                        .limit(CHUNKSIZE)\\\\n                        .raw(); // Don\\\\\'t filter through reading-hooks (like mapped classes etc)\\\\n                    var keysOrTuples = [];\\\\n                    // We\\\\\'re gonna do things on as many chunks that are needed.\\\\n                    // Use recursion of nextChunk function:\\\\n                    var nextChunk = function () { return collection.each(hasDeleteHook ? function (val, cursor) {\\\\n                        // Somebody subscribes to hook(\\\\\'deleting\\\\\'). Collect all primary keys and their values,\\\\n                        // so that the hook can be called with its values in bulkDelete().\\\\n                        keysOrTuples.push([cursor.primaryKey, cursor.value]);\\\\n                    } : function (val, cursor) {\\\\n                        // No one subscribes to hook(\\\\\'deleting\\\\\'). Collect only primary keys:\\\\n                        keysOrTuples.push(cursor.primaryKey);\\\\n                    }).then(function () {\\\\n                        // Chromium deletes faster when doing it in sort order.\\\\n                        hasDeleteHook ?\\\\n                            keysOrTuples.sort(function (a, b) { return ascending(a[0], b[0]); }) :\\\\n                            keysOrTuples.sort(ascending);\\\\n                        return bulkDelete(idbstore, trans, keysOrTuples, hasDeleteHook, deletingHook);\\\\n                    }).then(function () {\\\\n                        var count = keysOrTuples.length;\\\\n                        totalCount += count;\\\\n                        keysOrTuples = [];\\\\n                        return count < CHUNKSIZE ? totalCount : nextChunk();\\\\n                    }); };\\\\n                    resolve(nextChunk());\\\\n                });\\\\n            }\\\\n        };\\\\n    });\\\\n    //\\\\n    //\\\\n    //\\\\n    // ------------------------- Help functions ---------------------------\\\\n    //\\\\n    //\\\\n    //\\\\n    function lowerVersionFirst(a, b) {\\\\n        return a._cfg.version - b._cfg.version;\\\\n    }\\\\n    function setApiOnPlace(objs, tableNames, dbschema) {\\\\n        tableNames.forEach(function (tableName) {\\\\n            var schema = dbschema[tableName];\\\\n            objs.forEach(function (obj) {\\\\n                if (!(tableName in obj)) {\\\\n                    if (obj === Transaction.prototype || obj instanceof Transaction) {\\\\n                        // obj is a Transaction prototype (or prototype of a subclass to Transaction)\\\\n                        // Make the API a getter that returns this.table(tableName)\\\\n                        setProp(obj, tableName, { get: function () { return this.table(tableName); } });\\\\n                    }\\\\n                    else {\\\\n                        // Table will not be bound to a transaction (will use Dexie.currentTransaction)\\\\n                        obj[tableName] = new Table(tableName, schema);\\\\n                    }\\\\n                }\\\\n            });\\\\n        });\\\\n    }\\\\n    function removeTablesApi(objs) {\\\\n        objs.forEach(function (obj) {\\\\n            for (var key in obj) {\\\\n                if (obj[key] instanceof Table)\\\\n                    delete obj[key];\\\\n            }\\\\n        });\\\\n    }\\\\n    function iterate(req, filter, fn, resolve, reject, valueMapper) {\\\\n        // Apply valueMapper (hook(\\\\\'reading\\\\\') or mappped class)\\\\n        var mappedFn = valueMapper ? function (x, c, a) { return fn(valueMapper(x), c, a); } : fn;\\\\n        // Wrap fn with PSD and microtick stuff from Promise.\\\\n        var wrappedFn = wrap(mappedFn, reject);\\\\n        if (!req.onerror)\\\\n            req.onerror = eventRejectHandler(reject);\\\\n        if (filter) {\\\\n            req.onsuccess = trycatcher(function filter_record() {\\\\n                var cursor = req.result;\\\\n                if (cursor) {\\\\n                    var c = function () { cursor.continue(); };\\\\n                    if (filter(cursor, function (advancer) { c = advancer; }, resolve, reject))\\\\n                        wrappedFn(cursor.value, cursor, function (advancer) { c = advancer; });\\\\n                    c();\\\\n                }\\\\n                else {\\\\n                    resolve();\\\\n                }\\\\n            }, reject);\\\\n        }\\\\n        else {\\\\n            req.onsuccess = trycatcher(function filter_record() {\\\\n                var cursor = req.result;\\\\n                if (cursor) {\\\\n                    var c = function () { cursor.continue(); };\\\\n                    wrappedFn(cursor.value, cursor, function (advancer) { c = advancer; });\\\\n                    c();\\\\n                }\\\\n                else {\\\\n                    resolve();\\\\n                }\\\\n            }, reject);\\\\n        }\\\\n    }\\\\n    function parseIndexSyntax(indexes) {\\\\n        /// <param name=\\"indexes\\" type=\\"String\\"></param>\\\\n        /// <returns type=\\"Array\\" elementType=\\"IndexSpec\\"></returns>\\\\n        var rv = [];\\\\n        indexes.split(\\\\\',\\\\\').forEach(function (index) {\\\\n            index = index.trim();\\\\n            var name = index.replace(/([&*]|\\\\\\\\+\\\\\\\\+)/g, \\"\\"); // Remove \\"&\\", \\"++\\" and \\"*\\"\\\\n            // Let keyPath of \\"[a+b]\\" be [\\"a\\",\\"b\\"]:\\\\n            var keyPath = /^\\\\\\\\[/.test(name) ? name.match(/^\\\\\\\\[(.*)\\\\\\\\]$/)[1].split(\\\\\'+\\\\\') : name;\\\\n            rv.push(new IndexSpec(name, keyPath || null, /\\\\\\\\&/.test(index), /\\\\\\\\*/.test(index), /\\\\\\\\+\\\\\\\\+/.test(index), isArray(keyPath), /\\\\\\\\./.test(index)));\\\\n        });\\\\n        return rv;\\\\n    }\\\\n    function cmp(key1, key2) {\\\\n        return indexedDB.cmp(key1, key2);\\\\n    }\\\\n    function min(a, b) {\\\\n        return cmp(a, b) < 0 ? a : b;\\\\n    }\\\\n    function max(a, b) {\\\\n        return cmp(a, b) > 0 ? a : b;\\\\n    }\\\\n    function ascending(a, b) {\\\\n        return indexedDB.cmp(a, b);\\\\n    }\\\\n    function descending(a, b) {\\\\n        return indexedDB.cmp(b, a);\\\\n    }\\\\n    function simpleCompare(a, b) {\\\\n        return a < b ? -1 : a === b ? 0 : 1;\\\\n    }\\\\n    function simpleCompareReverse(a, b) {\\\\n        return a > b ? -1 : a === b ? 0 : 1;\\\\n    }\\\\n    function combine(filter1, filter2) {\\\\n        return filter1 ?\\\\n            filter2 ?\\\\n                function () { return filter1.apply(this, arguments) && filter2.apply(this, arguments); } :\\\\n                filter1 :\\\\n            filter2;\\\\n    }\\\\n    function readGlobalSchema() {\\\\n        db.verno = idbdb.version / 10;\\\\n        db._dbSchema = globalSchema = {};\\\\n        dbStoreNames = slice(idbdb.objectStoreNames, 0);\\\\n        if (dbStoreNames.length === 0)\\\\n            return; // Database contains no stores.\\\\n        var trans = idbdb.transaction(safariMultiStoreFix(dbStoreNames), \\\\\'readonly\\\\\');\\\\n        dbStoreNames.forEach(function (storeName) {\\\\n            var store = trans.objectStore(storeName), keyPath = store.keyPath, dotted = keyPath && typeof keyPath === \\\\\'string\\\\\' && keyPath.indexOf(\\\\\'.\\\\\') !== -1;\\\\n            var primKey = new IndexSpec(keyPath, keyPath || \\"\\", false, false, !!store.autoIncrement, keyPath && typeof keyPath !== \\\\\'string\\\\\', dotted);\\\\n            var indexes = [];\\\\n            for (var j = 0; j < store.indexNames.length; ++j) {\\\\n                var idbindex = store.index(store.indexNames[j]);\\\\n                keyPath = idbindex.keyPath;\\\\n                dotted = keyPath && typeof keyPath === \\\\\'string\\\\\' && keyPath.indexOf(\\\\\'.\\\\\') !== -1;\\\\n                var index = new IndexSpec(idbindex.name, keyPath, !!idbindex.unique, !!idbindex.multiEntry, false, keyPath && typeof keyPath !== \\\\\'string\\\\\', dotted);\\\\n                indexes.push(index);\\\\n            }\\\\n            globalSchema[storeName] = new TableSchema(storeName, primKey, indexes, {});\\\\n        });\\\\n        setApiOnPlace([allTables], keys(globalSchema), globalSchema);\\\\n    }\\\\n    function adjustToExistingIndexNames(schema, idbtrans) {\\\\n        /// <summary>\\\\n        /// Issue #30 Problem with existing db - adjust to existing index names when migrating from non-dexie db\\\\n        /// </summary>\\\\n        /// <param name=\\"schema\\" type=\\"Object\\">Map between name and TableSchema</param>\\\\n        /// <param name=\\"idbtrans\\" type=\\"IDBTransaction\\"></param>\\\\n        var storeNames = idbtrans.db.objectStoreNames;\\\\n        for (var i = 0; i < storeNames.length; ++i) {\\\\n            var storeName = storeNames[i];\\\\n            var store = idbtrans.objectStore(storeName);\\\\n            hasGetAll = \\\\\'getAll\\\\\' in store;\\\\n            for (var j = 0; j < store.indexNames.length; ++j) {\\\\n                var indexName = store.indexNames[j];\\\\n                var keyPath = store.index(indexName).keyPath;\\\\n                var dexieName = typeof keyPath === \\\\\'string\\\\\' ? keyPath : \\"[\\" + slice(keyPath).join(\\\\\'+\\\\\') + \\"]\\";\\\\n                if (schema[storeName]) {\\\\n                    var indexSpec = schema[storeName].idxByName[dexieName];\\\\n                    if (indexSpec)\\\\n                        indexSpec.name = indexName;\\\\n                }\\\\n            }\\\\n        }\\\\n        // Bug with getAll() on Safari ver<604 on Workers only, see discussion following PR #579\\\\n        if (/Safari/.test(navigator.userAgent) &&\\\\n            !/(Chrome\\\\\\\\/|Edge\\\\\\\\/)/.test(navigator.userAgent) &&\\\\n            _global.WorkerGlobalScope && _global instanceof _global.WorkerGlobalScope &&\\\\n            [].concat(navigator.userAgent.match(/Safari\\\\\\\\/(\\\\\\\\d*)/))[1] < 604) {\\\\n            hasGetAll = false;\\\\n        }\\\\n    }\\\\n    function fireOnBlocked(ev) {\\\\n        db.on(\\"blocked\\").fire(ev);\\\\n        // Workaround (not fully*) for missing \\"versionchange\\" event in IE,Edge and Safari:\\\\n        connections\\\\n            .filter(function (c) { return c.name === db.name && c !== db && !c._vcFired; })\\\\n            .map(function (c) { return c.on(\\"versionchange\\").fire(ev); });\\\\n    }\\\\n    extend(this, {\\\\n        Collection: Collection,\\\\n        Table: Table,\\\\n        Transaction: Transaction,\\\\n        Version: Version,\\\\n        WhereClause: WhereClause\\\\n    });\\\\n    init();\\\\n    addons.forEach(function (fn) {\\\\n        fn(db);\\\\n    });\\\\n}\\\\nfunction parseType(type) {\\\\n    if (typeof type === \\\\\'function\\\\\') {\\\\n        return new type();\\\\n    }\\\\n    else if (isArray(type)) {\\\\n        return [parseType(type[0])];\\\\n    }\\\\n    else if (type && typeof type === \\\\\'object\\\\\') {\\\\n        var rv = {};\\\\n        applyStructure(rv, type);\\\\n        return rv;\\\\n    }\\\\n    else {\\\\n        return type;\\\\n    }\\\\n}\\\\nfunction applyStructure(obj, structure) {\\\\n    keys(structure).forEach(function (member) {\\\\n        var value = parseType(structure[member]);\\\\n        obj[member] = value;\\\\n    });\\\\n    return obj;\\\\n}\\\\nfunction hookedEventSuccessHandler(resolve) {\\\\n    // wrap() is needed when calling hooks because the rare scenario of:\\\\n    //  * hook does a db operation that fails immediately (IDB throws exception)\\\\n    //    For calling db operations on correct transaction, wrap makes sure to set PSD correctly.\\\\n    //    wrap() will also execute in a virtual tick.\\\\n    //  * If not wrapped in a virtual tick, direct exception will launch a new physical tick.\\\\n    //  * If this was the last event in the bulk, the promise will resolve after a physical tick\\\\n    //    and the transaction will have committed already.\\\\n    // If no hook, the virtual tick will be executed in the reject()/resolve of the final promise,\\\\n    // because it is always marked with _lib = true when created using Transaction._promise().\\\\n    return wrap(function (event) {\\\\n        var req = event.target, ctx = req._hookCtx, // Contains the hook error handler. Put here instead of closure to boost performance.\\\\n        result = ctx.value || req.result, // Pass the object value on updates. The result from IDB is the primary key.\\\\n        hookSuccessHandler = ctx && ctx.onsuccess;\\\\n        hookSuccessHandler && hookSuccessHandler(result);\\\\n        resolve && resolve(result);\\\\n    }, resolve);\\\\n}\\\\nfunction eventRejectHandler(reject) {\\\\n    return wrap(function (event) {\\\\n        preventDefault(event);\\\\n        reject(event.target.error);\\\\n        return false;\\\\n    });\\\\n}\\\\nfunction eventSuccessHandler(resolve) {\\\\n    return wrap(function (event) {\\\\n        resolve(event.target.result);\\\\n    });\\\\n}\\\\nfunction hookedEventRejectHandler(reject) {\\\\n    return wrap(function (event) {\\\\n        // See comment on hookedEventSuccessHandler() why wrap() is needed only when supporting hooks.\\\\n        var req = event.target, err = req.error, ctx = req._hookCtx, // Contains the hook error handler. Put here instead of closure to boost performance.\\\\n        hookErrorHandler = ctx && ctx.onerror;\\\\n        hookErrorHandler && hookErrorHandler(err);\\\\n        preventDefault(event);\\\\n        reject(err);\\\\n        return false;\\\\n    });\\\\n}\\\\nfunction preventDefault(event) {\\\\n    if (event.stopPropagation)\\\\n        event.stopPropagation();\\\\n    if (event.preventDefault)\\\\n        event.preventDefault();\\\\n}\\\\nfunction awaitIterator(iterator) {\\\\n    var callNext = function (result) { return iterator.next(result); }, doThrow = function (error) { return iterator.throw(error); }, onSuccess = step(callNext), onError = step(doThrow);\\\\n    function step(getNext) {\\\\n        return function (val) {\\\\n            var next = getNext(val), value = next.value;\\\\n            return next.done ? value :\\\\n                (!value || typeof value.then !== \\\\\'function\\\\\' ?\\\\n                    isArray(value) ? Promise.all(value).then(onSuccess, onError) : onSuccess(value) :\\\\n                    value.then(onSuccess, onError));\\\\n        };\\\\n    }\\\\n    return step(callNext)();\\\\n}\\\\n//\\\\n// IndexSpec struct\\\\n//\\\\nfunction IndexSpec(name, keyPath, unique, multi, auto, compound, dotted) {\\\\n    /// <param name=\\"name\\" type=\\"String\\"></param>\\\\n    /// <param name=\\"keyPath\\" type=\\"String\\"></param>\\\\n    /// <param name=\\"unique\\" type=\\"Boolean\\"></param>\\\\n    /// <param name=\\"multi\\" type=\\"Boolean\\"></param>\\\\n    /// <param name=\\"auto\\" type=\\"Boolean\\"></param>\\\\n    /// <param name=\\"compound\\" type=\\"Boolean\\"></param>\\\\n    /// <param name=\\"dotted\\" type=\\"Boolean\\"></param>\\\\n    this.name = name;\\\\n    this.keyPath = keyPath;\\\\n    this.unique = unique;\\\\n    this.multi = multi;\\\\n    this.auto = auto;\\\\n    this.compound = compound;\\\\n    this.dotted = dotted;\\\\n    var keyPathSrc = typeof keyPath === \\\\\'string\\\\\' ? keyPath : keyPath && (\\\\\'[\\\\\' + [].join.call(keyPath, \\\\\'+\\\\\') + \\\\\']\\\\\');\\\\n    this.src = (unique ? \\\\\'&\\\\\' : \\\\\'\\\\\') + (multi ? \\\\\'*\\\\\' : \\\\\'\\\\\') + (auto ? \\"++\\" : \\"\\") + keyPathSrc;\\\\n}\\\\n//\\\\n// TableSchema struct\\\\n//\\\\nfunction TableSchema(name, primKey, indexes, instanceTemplate) {\\\\n    /// <param name=\\"name\\" type=\\"String\\"></param>\\\\n    /// <param name=\\"primKey\\" type=\\"IndexSpec\\"></param>\\\\n    /// <param name=\\"indexes\\" type=\\"Array\\" elementType=\\"IndexSpec\\"></param>\\\\n    /// <param name=\\"instanceTemplate\\" type=\\"Object\\"></param>\\\\n    this.name = name;\\\\n    this.primKey = primKey || new IndexSpec();\\\\n    this.indexes = indexes || [new IndexSpec()];\\\\n    this.instanceTemplate = instanceTemplate;\\\\n    this.mappedClass = null;\\\\n    this.idxByName = arrayToObject(indexes, function (index) { return [index.name, index]; });\\\\n}\\\\nfunction safariMultiStoreFix(storeNames) {\\\\n    return storeNames.length === 1 ? storeNames[0] : storeNames;\\\\n}\\\\nfunction getNativeGetDatabaseNamesFn(indexedDB) {\\\\n    var fn = indexedDB && (indexedDB.getDatabaseNames || indexedDB.webkitGetDatabaseNames);\\\\n    return fn && fn.bind(indexedDB);\\\\n}\\\\n// Export Error classes\\\\nprops(Dexie, fullNameExceptions); // Dexie.XXXError = class XXXError {...};\\\\n//\\\\n// Static methods and properties\\\\n// \\\\nprops(Dexie, {\\\\n    //\\\\n    // Static delete() method.\\\\n    //\\\\n    delete: function (databaseName) {\\\\n        var db = new Dexie(databaseName), promise = db.delete();\\\\n        promise.onblocked = function (fn) {\\\\n            db.on(\\"blocked\\", fn);\\\\n            return this;\\\\n        };\\\\n        return promise;\\\\n    },\\\\n    //\\\\n    // Static exists() method.\\\\n    //\\\\n    exists: function (name) {\\\\n        return new Dexie(name).open().then(function (db) {\\\\n            db.close();\\\\n            return true;\\\\n        }).catch(Dexie.NoSuchDatabaseError, function () { return false; });\\\\n    },\\\\n    //\\\\n    // Static method for retrieving a list of all existing databases at current host.\\\\n    //\\\\n    getDatabaseNames: function (cb) {\\\\n        var getDatabaseNames = getNativeGetDatabaseNamesFn(Dexie.dependencies.indexedDB);\\\\n        return getDatabaseNames ? new Promise(function (resolve, reject) {\\\\n            var req = getDatabaseNames();\\\\n            req.onsuccess = function (event) {\\\\n                resolve(slice(event.target.result, 0)); // Converst DOMStringList to Array<String>\\\\n            };\\\\n            req.onerror = eventRejectHandler(reject);\\\\n        }).then(cb) : dbNamesDB.dbnames.toCollection().primaryKeys(cb);\\\\n    },\\\\n    defineClass: function () {\\\\n        // Default constructor able to copy given properties into this object.\\\\n        function Class(properties) {\\\\n            /// <param name=\\"properties\\" type=\\"Object\\" optional=\\"true\\">Properties to initialize object with.\\\\n            /// </param>\\\\n            if (properties)\\\\n                extend(this, properties);\\\\n        }\\\\n        return Class;\\\\n    },\\\\n    applyStructure: applyStructure,\\\\n    ignoreTransaction: function (scopeFunc) {\\\\n        // In case caller is within a transaction but needs to create a separate transaction.\\\\n        // Example of usage:\\\\n        //\\\\n        // Let\\\\\'s say we have a logger function in our app. Other application-logic should be unaware of the\\\\n        // logger function and not need to include the \\\\\'logentries\\\\\' table in all transaction it performs.\\\\n        // The logging should always be done in a separate transaction and not be dependant on the current\\\\n        // running transaction context. Then you could use Dexie.ignoreTransaction() to run code that starts a new transaction.\\\\n        //\\\\n        //     Dexie.ignoreTransaction(function() {\\\\n        //         db.logentries.add(newLogEntry);\\\\n        //     });\\\\n        //\\\\n        // Unless using Dexie.ignoreTransaction(), the above example would try to reuse the current transaction\\\\n        // in current Promise-scope.\\\\n        //\\\\n        // An alternative to Dexie.ignoreTransaction() would be setImmediate() or setTimeout(). The reason we still provide an\\\\n        // API for this because\\\\n        //  1) The intention of writing the statement could be unclear if using setImmediate() or setTimeout().\\\\n        //  2) setTimeout() would wait unnescessary until firing. This is however not the case with setImmediate().\\\\n        //  3) setImmediate() is not supported in the ES standard.\\\\n        //  4) You might want to keep other PSD state that was set in a parent PSD, such as PSD.letThrough.\\\\n        return PSD.trans ?\\\\n            usePSD(PSD.transless, scopeFunc) : // Use the closest parent that was non-transactional.\\\\n            scopeFunc(); // No need to change scope because there is no ongoing transaction.\\\\n    },\\\\n    vip: function (fn) {\\\\n        // To be used by subscribers to the on(\\\\\'ready\\\\\') event.\\\\n        // This will let caller through to access DB even when it is blocked while the db.ready() subscribers are firing.\\\\n        // This would have worked automatically if we were certain that the Provider was using Dexie.Promise for all asyncronic operations. The promise PSD\\\\n        // from the provider.connect() call would then be derived all the way to when provider would call localDatabase.applyChanges(). But since\\\\n        // the provider more likely is using non-promise async APIs or other thenable implementations, we cannot assume that.\\\\n        // Note that this method is only useful for on(\\\\\'ready\\\\\') subscribers that is returning a Promise from the event. If not using vip()\\\\n        // the database could deadlock since it wont open until the returned Promise is resolved, and any non-VIPed operation started by\\\\n        // the caller will not resolve until database is opened.\\\\n        return newScope(function () {\\\\n            PSD.letThrough = true; // Make sure we are let through if still blocking db due to onready is firing.\\\\n            return fn();\\\\n        });\\\\n    },\\\\n    async: function (generatorFn) {\\\\n        return function () {\\\\n            try {\\\\n                var rv = awaitIterator(generatorFn.apply(this, arguments));\\\\n                if (!rv || typeof rv.then !== \\\\\'function\\\\\')\\\\n                    return Promise.resolve(rv);\\\\n                return rv;\\\\n            }\\\\n            catch (e) {\\\\n                return rejection(e);\\\\n            }\\\\n        };\\\\n    },\\\\n    spawn: function (generatorFn, args, thiz) {\\\\n        try {\\\\n            var rv = awaitIterator(generatorFn.apply(thiz, args || []));\\\\n            if (!rv || typeof rv.then !== \\\\\'function\\\\\')\\\\n                return Promise.resolve(rv);\\\\n            return rv;\\\\n        }\\\\n        catch (e) {\\\\n            return rejection(e);\\\\n        }\\\\n    },\\\\n    // Dexie.currentTransaction property\\\\n    currentTransaction: {\\\\n        get: function () { return PSD.trans || null; }\\\\n    },\\\\n    waitFor: function (promiseOrFunction, optionalTimeout) {\\\\n        // If a function is provided, invoke it and pass the returning value to Transaction.waitFor()\\\\n        var promise = Promise.resolve(typeof promiseOrFunction === \\\\\'function\\\\\' ? Dexie.ignoreTransaction(promiseOrFunction) : promiseOrFunction)\\\\n            .timeout(optionalTimeout || 60000); // Default the timeout to one minute. Caller may specify Infinity if required.       \\\\n        // Run given promise on current transaction. If no current transaction, just return a Dexie promise based\\\\n        // on given value.\\\\n        return PSD.trans ? PSD.trans.waitFor(promise) : promise;\\\\n    },\\\\n    // Export our Promise implementation since it can be handy as a standalone Promise implementation\\\\n    Promise: Promise,\\\\n    // Dexie.debug proptery:\\\\n    // Dexie.debug = false\\\\n    // Dexie.debug = true\\\\n    // Dexie.debug = \\"dexie\\" - don\\\\\'t hide dexie\\\\\'s stack frames.\\\\n    debug: {\\\\n        get: function () { return debug; },\\\\n        set: function (value) {\\\\n            setDebug(value, value === \\\\\'dexie\\\\\' ? function () { return true; } : dexieStackFrameFilter);\\\\n        }\\\\n    },\\\\n    // Export our derive/extend/override methodology\\\\n    derive: derive,\\\\n    extend: extend,\\\\n    props: props,\\\\n    override: override,\\\\n    // Export our Events() function - can be handy as a toolkit\\\\n    Events: Events,\\\\n    // Utilities\\\\n    getByKeyPath: getByKeyPath,\\\\n    setByKeyPath: setByKeyPath,\\\\n    delByKeyPath: delByKeyPath,\\\\n    shallowClone: shallowClone,\\\\n    deepClone: deepClone,\\\\n    getObjectDiff: getObjectDiff,\\\\n    asap: asap,\\\\n    maxKey: maxKey,\\\\n    minKey: minKey,\\\\n    // Addon registry\\\\n    addons: [],\\\\n    // Global DB connection list\\\\n    connections: connections,\\\\n    MultiModifyError: exceptions.Modify,\\\\n    errnames: errnames,\\\\n    // Export other static classes\\\\n    IndexSpec: IndexSpec,\\\\n    TableSchema: TableSchema,\\\\n    //\\\\n    // Dependencies\\\\n    //\\\\n    // These will automatically work in browsers with indexedDB support, or where an indexedDB polyfill has been included.\\\\n    //\\\\n    // In node.js, however, these properties must be set \\"manually\\" before instansiating a new Dexie().\\\\n    // For node.js, you need to require indexeddb-js or similar and then set these deps.\\\\n    //\\\\n    dependencies: {\\\\n        // Required:\\\\n        indexedDB: _global.indexedDB || _global.mozIndexedDB || _global.webkitIndexedDB || _global.msIndexedDB,\\\\n        IDBKeyRange: _global.IDBKeyRange || _global.webkitIDBKeyRange\\\\n    },\\\\n    // API Version Number: Type Number, make sure to always set a version number that can be comparable correctly. Example: 0.9, 0.91, 0.92, 1.0, 1.01, 1.1, 1.2, 1.21, etc.\\\\n    semVer: DEXIE_VERSION,\\\\n    version: DEXIE_VERSION.split(\\\\\'.\\\\\')\\\\n        .map(function (n) { return parseInt(n); })\\\\n        .reduce(function (p, c, i) { return p + (c / Math.pow(10, i * 2)); }),\\\\n    // https://github.com/dfahlander/Dexie.js/issues/186\\\\n    // typescript compiler tsc in mode ts--\\\\x3ees5 & commonJS, will expect require() to return\\\\n    // x.default. Workaround: Set Dexie.default = Dexie.\\\\n    default: Dexie,\\\\n    // Make it possible to import {Dexie} (non-default import)\\\\n    // Reason 1: May switch to that in future.\\\\n    // Reason 2: We declare it both default and named exported in d.ts to make it possible\\\\n    // to let addons extend the Dexie interface with Typescript 2.1 (works only when explicitely\\\\n    // exporting the symbol, not just default exporting)\\\\n    Dexie: Dexie\\\\n});\\\\n// Map DOMErrors and DOMExceptions to corresponding Dexie errors. May change in Dexie v2.0.\\\\nPromise.rejectionMapper = mapError;\\\\n// Initialize dbNamesDB (won\\\\\'t ever be opened on chromium browsers\\\\\')\\\\ndbNamesDB = new Dexie(\\\\\'__dbnames\\\\\');\\\\ndbNamesDB.version(1).stores({ dbnames: \\\\\'name\\\\\' });\\\\n(function () {\\\\n    // Migrate from Dexie 1.x database names stored in localStorage:\\\\n    var DBNAMES = \\\\\'Dexie.DatabaseNames\\\\\';\\\\n    try {\\\\n        if (typeof localStorage !== undefined && _global.document !== undefined) {\\\\n            // Have localStorage and is not executing in a worker. Lets migrate from Dexie 1.x.\\\\n            JSON.parse(localStorage.getItem(DBNAMES) || \\"[]\\")\\\\n                .forEach(function (name) { return dbNamesDB.dbnames.put({ name: name }).catch(nop); });\\\\n            localStorage.removeItem(DBNAMES);\\\\n        }\\\\n    }\\\\n    catch (_e) { }\\\\n})();\\\\n\\\\n/* harmony default export */ __webpack_exports__[\\"default\\"] = (Dexie);\\\\n//# sourceMappingURL=dexie.es.js.map\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(4), __webpack_require__(53).setImmediate))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/dexie/dist/dexie.es.js\\\\n// module id = 125\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/dexie/dist/dexie.es.js\')},function(module,exports,__webpack_require__){eval(\\"var randomBytes = __webpack_require__(29);\\\\nmodule.exports = findPrime;\\\\nfindPrime.simpleSieve = simpleSieve;\\\\nfindPrime.fermatTest = fermatTest;\\\\nvar BN = __webpack_require__(3);\\\\nvar TWENTYFOUR = new BN(24);\\\\nvar MillerRabin = __webpack_require__(135);\\\\nvar millerRabin = new MillerRabin();\\\\nvar ONE = new BN(1);\\\\nvar TWO = new BN(2);\\\\nvar FIVE = new BN(5);\\\\nvar SIXTEEN = new BN(16);\\\\nvar EIGHT = new BN(8);\\\\nvar TEN = new BN(10);\\\\nvar THREE = new BN(3);\\\\nvar SEVEN = new BN(7);\\\\nvar ELEVEN = new BN(11);\\\\nvar FOUR = new BN(4);\\\\nvar TWELVE = new BN(12);\\\\nvar primes = null;\\\\n\\\\nfunction _getPrimes() {\\\\n  if (primes !== null)\\\\n    return primes;\\\\n\\\\n  var limit = 0x100000;\\\\n  var res = [];\\\\n  res[0] = 2;\\\\n  for (var i = 1, k = 3; k < limit; k += 2) {\\\\n    var sqrt = Math.ceil(Math.sqrt(k));\\\\n    for (var j = 0; j < i && res[j] <= sqrt; j++)\\\\n      if (k % res[j] === 0)\\\\n        break;\\\\n\\\\n    if (i !== j && res[j] <= sqrt)\\\\n      continue;\\\\n\\\\n    res[i++] = k;\\\\n  }\\\\n  primes = res;\\\\n  return res;\\\\n}\\\\n\\\\nfunction simpleSieve(p) {\\\\n  var primes = _getPrimes();\\\\n\\\\n  for (var i = 0; i < primes.length; i++)\\\\n    if (p.modn(primes[i]) === 0) {\\\\n      if (p.cmpn(primes[i]) === 0) {\\\\n        return true;\\\\n      } else {\\\\n        return false;\\\\n      }\\\\n    }\\\\n\\\\n  return true;\\\\n}\\\\n\\\\nfunction fermatTest(p) {\\\\n  var red = BN.mont(p);\\\\n  return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;\\\\n}\\\\n\\\\nfunction findPrime(bits, gen) {\\\\n  if (bits < 16) {\\\\n    // this is what openssl does\\\\n    if (gen === 2 || gen === 5) {\\\\n      return new BN([0x8c, 0x7b]);\\\\n    } else {\\\\n      return new BN([0x8c, 0x27]);\\\\n    }\\\\n  }\\\\n  gen = new BN(gen);\\\\n\\\\n  var num, n2;\\\\n\\\\n  while (true) {\\\\n    num = new BN(randomBytes(Math.ceil(bits / 8)));\\\\n    while (num.bitLength() > bits) {\\\\n      num.ishrn(1);\\\\n    }\\\\n    if (num.isEven()) {\\\\n      num.iadd(ONE);\\\\n    }\\\\n    if (!num.testn(1)) {\\\\n      num.iadd(TWO);\\\\n    }\\\\n    if (!gen.cmp(TWO)) {\\\\n      while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {\\\\n        num.iadd(FOUR);\\\\n      }\\\\n    } else if (!gen.cmp(FIVE)) {\\\\n      while (num.mod(TEN).cmp(THREE)) {\\\\n        num.iadd(FOUR);\\\\n      }\\\\n    }\\\\n    n2 = num.shrn(1);\\\\n    if (simpleSieve(n2) && simpleSieve(num) &&\\\\n      fermatTest(n2) && fermatTest(num) &&\\\\n      millerRabin.test(n2) && millerRabin.test(num)) {\\\\n      return num;\\\\n    }\\\\n  }\\\\n\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/diffie-hellman/lib/generatePrime.js\\\\n// module id = 126\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/diffie-hellman/lib/generatePrime.js\\")},function(module,exports,__webpack_require__){eval(\'var A = __webpack_require__(264);\\\\n\\\\nvar at = function at(bytes, index) {\\\\n  return parseInt(bytes.slice(index * 2 + 2, index * 2 + 4), 16);\\\\n};\\\\n\\\\nvar random = function random(bytes) {\\\\n  var rnd = void 0;\\\\n  if (typeof window !== \\"undefined\\" && window.crypto && window.crypto.getRandomValues) rnd = window.crypto.getRandomValues(new Uint8Array(bytes));else if (true) rnd = __webpack_require__(40).randomBytes(bytes);else throw \\"Safe random numbers not available.\\";\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0; i < bytes; ++i) {\\\\n    hex += (\\"00\\" + rnd[i].toString(16)).slice(-2);\\\\n  }return hex;\\\\n};\\\\n\\\\nvar length = function length(a) {\\\\n  return (a.length - 2) / 2;\\\\n};\\\\n\\\\nvar flatten = function flatten(a) {\\\\n  return \\"0x\\" + a.reduce(function (r, s) {\\\\n    return r + s.slice(2);\\\\n  }, \\"\\");\\\\n};\\\\n\\\\nvar slice = function slice(i, j, bs) {\\\\n  return \\"0x\\" + bs.slice(i * 2 + 2, j * 2 + 2);\\\\n};\\\\n\\\\nvar reverse = function reverse(hex) {\\\\n  var rev = \\"0x\\";\\\\n  for (var i = 0, l = length(hex); i < l; ++i) {\\\\n    rev += hex.slice((l - i) * 2, (l - i + 1) * 2);\\\\n  }\\\\n  return rev;\\\\n};\\\\n\\\\nvar pad = function pad(l, hex) {\\\\n  return hex.length === l * 2 + 2 ? hex : pad(l, \\"0x\\" + \\"0\\" + hex.slice(2));\\\\n};\\\\n\\\\nvar padRight = function padRight(l, hex) {\\\\n  return hex.length === l * 2 + 2 ? hex : padRight(l, hex + \\"0\\");\\\\n};\\\\n\\\\nvar toArray = function toArray(hex) {\\\\n  var arr = [];\\\\n  for (var i = 2, l = hex.length; i < l; i += 2) {\\\\n    arr.push(parseInt(hex.slice(i, i + 2), 16));\\\\n  }return arr;\\\\n};\\\\n\\\\nvar fromArray = function fromArray(arr) {\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0, l = arr.length; i < l; ++i) {\\\\n    var b = arr[i];\\\\n    hex += (b < 16 ? \\"0\\" : \\"\\") + b.toString(16);\\\\n  }\\\\n  return hex;\\\\n};\\\\n\\\\nvar toUint8Array = function toUint8Array(hex) {\\\\n  return new Uint8Array(toArray(hex));\\\\n};\\\\n\\\\nvar fromUint8Array = function fromUint8Array(arr) {\\\\n  return fromArray([].slice.call(arr, 0));\\\\n};\\\\n\\\\nvar fromNumber = function fromNumber(num) {\\\\n  var hex = num.toString(16);\\\\n  return hex.length % 2 === 0 ? \\"0x\\" + hex : \\"0x0\\" + hex;\\\\n};\\\\n\\\\nvar toNumber = function toNumber(hex) {\\\\n  return parseInt(hex.slice(2), 16);\\\\n};\\\\n\\\\nvar concat = function concat(a, b) {\\\\n  return a.concat(b.slice(2));\\\\n};\\\\n\\\\nvar fromNat = function fromNat(bn) {\\\\n  return bn === \\"0x0\\" ? \\"0x\\" : bn.length % 2 === 0 ? bn : \\"0x0\\" + bn.slice(2);\\\\n};\\\\n\\\\nvar toNat = function toNat(bn) {\\\\n  return bn[2] === \\"0\\" ? \\"0x\\" + bn.slice(3) : bn;\\\\n};\\\\n\\\\nvar fromAscii = function fromAscii(ascii) {\\\\n  var hex = \\"0x\\";\\\\n  for (var i = 0; i < ascii.length; ++i) {\\\\n    hex += (\\"00\\" + ascii.charCodeAt(i).toString(16)).slice(-2);\\\\n  }return hex;\\\\n};\\\\n\\\\nvar toAscii = function toAscii(hex) {\\\\n  var ascii = \\"\\";\\\\n  for (var i = 2; i < hex.length; i += 2) {\\\\n    ascii += String.fromCharCode(parseInt(hex.slice(i, i + 2), 16));\\\\n  }return ascii;\\\\n};\\\\n\\\\n// From https://gist.github.com/pascaldekloe/62546103a1576803dade9269ccf76330\\\\nvar fromString = function fromString(s) {\\\\n  var makeByte = function makeByte(uint8) {\\\\n    var b = uint8.toString(16);\\\\n    return b.length < 2 ? \\"0\\" + b : b;\\\\n  };\\\\n  var bytes = \\"0x\\";\\\\n  for (var ci = 0; ci != s.length; ci++) {\\\\n    var c = s.charCodeAt(ci);\\\\n    if (c < 128) {\\\\n      bytes += makeByte(c);\\\\n      continue;\\\\n    }\\\\n    if (c < 2048) {\\\\n      bytes += makeByte(c >> 6 | 192);\\\\n    } else {\\\\n      if (c > 0xd7ff && c < 0xdc00) {\\\\n        if (++ci == s.length) return null;\\\\n        var c2 = s.charCodeAt(ci);\\\\n        if (c2 < 0xdc00 || c2 > 0xdfff) return null;\\\\n        c = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\\\\n        bytes += makeByte(c >> 18 | 240);\\\\n        bytes += makeByte(c >> 12 & 63 | 128);\\\\n      } else {\\\\n        // c <= 0xffff\\\\n        bytes += makeByte(c >> 12 | 224);\\\\n      }\\\\n      bytes += makeByte(c >> 6 & 63 | 128);\\\\n    }\\\\n    bytes += makeByte(c & 63 | 128);\\\\n  }\\\\n  return bytes;\\\\n};\\\\n\\\\nvar toString = function toString(bytes) {\\\\n  var s = \\\\\'\\\\\';\\\\n  var i = 0;\\\\n  var l = length(bytes);\\\\n  while (i < l) {\\\\n    var c = at(bytes, i++);\\\\n    if (c > 127) {\\\\n      if (c > 191 && c < 224) {\\\\n        if (i >= l) return null;\\\\n        c = (c & 31) << 6 | at(bytes, i) & 63;\\\\n      } else if (c > 223 && c < 240) {\\\\n        if (i + 1 >= l) return null;\\\\n        c = (c & 15) << 12 | (at(bytes, i) & 63) << 6 | at(bytes, ++i) & 63;\\\\n      } else if (c > 239 && c < 248) {\\\\n        if (i + 2 >= l) return null;\\\\n        c = (c & 7) << 18 | (at(bytes, i) & 63) << 12 | (at(bytes, ++i) & 63) << 6 | at(bytes, ++i) & 63;\\\\n      } else return null;\\\\n      ++i;\\\\n    }\\\\n    if (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\\\\n      c -= 0x10000;\\\\n      s += String.fromCharCode(c >> 10 | 0xd800);\\\\n      s += String.fromCharCode(c & 0x3FF | 0xdc00);\\\\n    } else return null;\\\\n  }\\\\n  return s;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  random: random,\\\\n  length: length,\\\\n  concat: concat,\\\\n  flatten: flatten,\\\\n  slice: slice,\\\\n  reverse: reverse,\\\\n  pad: pad,\\\\n  padRight: padRight,\\\\n  fromAscii: fromAscii,\\\\n  toAscii: toAscii,\\\\n  fromString: fromString,\\\\n  toString: toString,\\\\n  fromNumber: fromNumber,\\\\n  toNumber: toNumber,\\\\n  fromNat: fromNat,\\\\n  toNat: toNat,\\\\n  fromArray: fromArray,\\\\n  toArray: toArray,\\\\n  fromUint8Array: fromUint8Array,\\\\n  toUint8Array: toUint8Array\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/eth-lib/lib/bytes.js\\\\n// module id = 127\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/eth-lib/lib/bytes.js\')},function(module,exports){eval(\'// This was ported from https://github.com/emn178/js-sha3, with some minor\\\\n// modifications and pruning. It is licensed under MIT:\\\\n//\\\\n// Copyright 2015-2016 Chen, Yi-Cyuan\\\\n//  \\\\n// Permission is hereby granted, free of charge, to any person obtaining\\\\n// a copy of this software and associated documentation files (the\\\\n// \\"Software\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to\\\\n// permit persons to whom the Software is furnished to do so, subject to\\\\n// the following conditions:\\\\n// \\\\n// The above copyright notice and this permission notice shall be\\\\n// included in all copies or substantial portions of the Software.\\\\n// \\\\n// THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND,\\\\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\\\\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\\\\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\\\\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\\\\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\nvar HEX_CHARS = \\\\\'0123456789abcdef\\\\\'.split(\\\\\'\\\\\');\\\\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\\\\nvar SHIFT = [0, 8, 16, 24];\\\\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\\\\n\\\\nvar Keccak = function Keccak(bits) {\\\\n  return {\\\\n    blocks: [],\\\\n    reset: true,\\\\n    block: 0,\\\\n    start: 0,\\\\n    blockCount: 1600 - (bits << 1) >> 5,\\\\n    outputBlocks: bits >> 5,\\\\n    s: function (s) {\\\\n      return [].concat(s, s, s, s, s);\\\\n    }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\\\\n  };\\\\n};\\\\n\\\\nvar update = function update(state, message) {\\\\n  var length = message.length,\\\\n      blocks = state.blocks,\\\\n      byteCount = state.blockCount << 2,\\\\n      blockCount = state.blockCount,\\\\n      outputBlocks = state.outputBlocks,\\\\n      s = state.s,\\\\n      index = 0,\\\\n      i,\\\\n      code;\\\\n\\\\n  // update\\\\n  while (index < length) {\\\\n    if (state.reset) {\\\\n      state.reset = false;\\\\n      blocks[0] = state.block;\\\\n      for (i = 1; i < blockCount + 1; ++i) {\\\\n        blocks[i] = 0;\\\\n      }\\\\n    }\\\\n    if (typeof message !== \\"string\\") {\\\\n      for (i = state.start; index < length && i < byteCount; ++index) {\\\\n        blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\\\\n      }\\\\n    } else {\\\\n      for (i = state.start; index < length && i < byteCount; ++index) {\\\\n        code = message.charCodeAt(index);\\\\n        if (code < 0x80) {\\\\n          blocks[i >> 2] |= code << SHIFT[i++ & 3];\\\\n        } else if (code < 0x800) {\\\\n          blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        } else if (code < 0xd800 || code >= 0xe000) {\\\\n          blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        } else {\\\\n          code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\\\\n          blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        }\\\\n      }\\\\n    }\\\\n    state.lastByteIndex = i;\\\\n    if (i >= byteCount) {\\\\n      state.start = i - byteCount;\\\\n      state.block = blocks[blockCount];\\\\n      for (i = 0; i < blockCount; ++i) {\\\\n        s[i] ^= blocks[i];\\\\n      }\\\\n      f(s);\\\\n      state.reset = true;\\\\n    } else {\\\\n      state.start = i;\\\\n    }\\\\n  }\\\\n\\\\n  // finalize\\\\n  i = state.lastByteIndex;\\\\n  blocks[i >> 2] |= KECCAK_PADDING[i & 3];\\\\n  if (state.lastByteIndex === byteCount) {\\\\n    blocks[0] = blocks[blockCount];\\\\n    for (i = 1; i < blockCount + 1; ++i) {\\\\n      blocks[i] = 0;\\\\n    }\\\\n  }\\\\n  blocks[blockCount - 1] |= 0x80000000;\\\\n  for (i = 0; i < blockCount; ++i) {\\\\n    s[i] ^= blocks[i];\\\\n  }\\\\n  f(s);\\\\n\\\\n  // toString\\\\n  var hex = \\\\\'\\\\\',\\\\n      i = 0,\\\\n      j = 0,\\\\n      block;\\\\n  while (j < outputBlocks) {\\\\n    for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\\\\n      block = s[i];\\\\n      hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\\\\n    }\\\\n    if (j % blockCount === 0) {\\\\n      f(s);\\\\n      i = 0;\\\\n    }\\\\n  }\\\\n  return \\"0x\\" + hex;\\\\n};\\\\n\\\\nvar f = function f(s) {\\\\n  var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\\\\n\\\\n  for (n = 0; n < 48; n += 2) {\\\\n    c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\\\\n    c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\\\\n    c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\\\\n    c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\\\\n    c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\\\\n    c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\\\\n    c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\\\\n    c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\\\\n    c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\\\\n    c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\\\\n\\\\n    h = c8 ^ (c2 << 1 | c3 >>> 31);\\\\n    l = c9 ^ (c3 << 1 | c2 >>> 31);\\\\n    s[0] ^= h;\\\\n    s[1] ^= l;\\\\n    s[10] ^= h;\\\\n    s[11] ^= l;\\\\n    s[20] ^= h;\\\\n    s[21] ^= l;\\\\n    s[30] ^= h;\\\\n    s[31] ^= l;\\\\n    s[40] ^= h;\\\\n    s[41] ^= l;\\\\n    h = c0 ^ (c4 << 1 | c5 >>> 31);\\\\n    l = c1 ^ (c5 << 1 | c4 >>> 31);\\\\n    s[2] ^= h;\\\\n    s[3] ^= l;\\\\n    s[12] ^= h;\\\\n    s[13] ^= l;\\\\n    s[22] ^= h;\\\\n    s[23] ^= l;\\\\n    s[32] ^= h;\\\\n    s[33] ^= l;\\\\n    s[42] ^= h;\\\\n    s[43] ^= l;\\\\n    h = c2 ^ (c6 << 1 | c7 >>> 31);\\\\n    l = c3 ^ (c7 << 1 | c6 >>> 31);\\\\n    s[4] ^= h;\\\\n    s[5] ^= l;\\\\n    s[14] ^= h;\\\\n    s[15] ^= l;\\\\n    s[24] ^= h;\\\\n    s[25] ^= l;\\\\n    s[34] ^= h;\\\\n    s[35] ^= l;\\\\n    s[44] ^= h;\\\\n    s[45] ^= l;\\\\n    h = c4 ^ (c8 << 1 | c9 >>> 31);\\\\n    l = c5 ^ (c9 << 1 | c8 >>> 31);\\\\n    s[6] ^= h;\\\\n    s[7] ^= l;\\\\n    s[16] ^= h;\\\\n    s[17] ^= l;\\\\n    s[26] ^= h;\\\\n    s[27] ^= l;\\\\n    s[36] ^= h;\\\\n    s[37] ^= l;\\\\n    s[46] ^= h;\\\\n    s[47] ^= l;\\\\n    h = c6 ^ (c0 << 1 | c1 >>> 31);\\\\n    l = c7 ^ (c1 << 1 | c0 >>> 31);\\\\n    s[8] ^= h;\\\\n    s[9] ^= l;\\\\n    s[18] ^= h;\\\\n    s[19] ^= l;\\\\n    s[28] ^= h;\\\\n    s[29] ^= l;\\\\n    s[38] ^= h;\\\\n    s[39] ^= l;\\\\n    s[48] ^= h;\\\\n    s[49] ^= l;\\\\n\\\\n    b0 = s[0];\\\\n    b1 = s[1];\\\\n    b32 = s[11] << 4 | s[10] >>> 28;\\\\n    b33 = s[10] << 4 | s[11] >>> 28;\\\\n    b14 = s[20] << 3 | s[21] >>> 29;\\\\n    b15 = s[21] << 3 | s[20] >>> 29;\\\\n    b46 = s[31] << 9 | s[30] >>> 23;\\\\n    b47 = s[30] << 9 | s[31] >>> 23;\\\\n    b28 = s[40] << 18 | s[41] >>> 14;\\\\n    b29 = s[41] << 18 | s[40] >>> 14;\\\\n    b20 = s[2] << 1 | s[3] >>> 31;\\\\n    b21 = s[3] << 1 | s[2] >>> 31;\\\\n    b2 = s[13] << 12 | s[12] >>> 20;\\\\n    b3 = s[12] << 12 | s[13] >>> 20;\\\\n    b34 = s[22] << 10 | s[23] >>> 22;\\\\n    b35 = s[23] << 10 | s[22] >>> 22;\\\\n    b16 = s[33] << 13 | s[32] >>> 19;\\\\n    b17 = s[32] << 13 | s[33] >>> 19;\\\\n    b48 = s[42] << 2 | s[43] >>> 30;\\\\n    b49 = s[43] << 2 | s[42] >>> 30;\\\\n    b40 = s[5] << 30 | s[4] >>> 2;\\\\n    b41 = s[4] << 30 | s[5] >>> 2;\\\\n    b22 = s[14] << 6 | s[15] >>> 26;\\\\n    b23 = s[15] << 6 | s[14] >>> 26;\\\\n    b4 = s[25] << 11 | s[24] >>> 21;\\\\n    b5 = s[24] << 11 | s[25] >>> 21;\\\\n    b36 = s[34] << 15 | s[35] >>> 17;\\\\n    b37 = s[35] << 15 | s[34] >>> 17;\\\\n    b18 = s[45] << 29 | s[44] >>> 3;\\\\n    b19 = s[44] << 29 | s[45] >>> 3;\\\\n    b10 = s[6] << 28 | s[7] >>> 4;\\\\n    b11 = s[7] << 28 | s[6] >>> 4;\\\\n    b42 = s[17] << 23 | s[16] >>> 9;\\\\n    b43 = s[16] << 23 | s[17] >>> 9;\\\\n    b24 = s[26] << 25 | s[27] >>> 7;\\\\n    b25 = s[27] << 25 | s[26] >>> 7;\\\\n    b6 = s[36] << 21 | s[37] >>> 11;\\\\n    b7 = s[37] << 21 | s[36] >>> 11;\\\\n    b38 = s[47] << 24 | s[46] >>> 8;\\\\n    b39 = s[46] << 24 | s[47] >>> 8;\\\\n    b30 = s[8] << 27 | s[9] >>> 5;\\\\n    b31 = s[9] << 27 | s[8] >>> 5;\\\\n    b12 = s[18] << 20 | s[19] >>> 12;\\\\n    b13 = s[19] << 20 | s[18] >>> 12;\\\\n    b44 = s[29] << 7 | s[28] >>> 25;\\\\n    b45 = s[28] << 7 | s[29] >>> 25;\\\\n    b26 = s[38] << 8 | s[39] >>> 24;\\\\n    b27 = s[39] << 8 | s[38] >>> 24;\\\\n    b8 = s[48] << 14 | s[49] >>> 18;\\\\n    b9 = s[49] << 14 | s[48] >>> 18;\\\\n\\\\n    s[0] = b0 ^ ~b2 & b4;\\\\n    s[1] = b1 ^ ~b3 & b5;\\\\n    s[10] = b10 ^ ~b12 & b14;\\\\n    s[11] = b11 ^ ~b13 & b15;\\\\n    s[20] = b20 ^ ~b22 & b24;\\\\n    s[21] = b21 ^ ~b23 & b25;\\\\n    s[30] = b30 ^ ~b32 & b34;\\\\n    s[31] = b31 ^ ~b33 & b35;\\\\n    s[40] = b40 ^ ~b42 & b44;\\\\n    s[41] = b41 ^ ~b43 & b45;\\\\n    s[2] = b2 ^ ~b4 & b6;\\\\n    s[3] = b3 ^ ~b5 & b7;\\\\n    s[12] = b12 ^ ~b14 & b16;\\\\n    s[13] = b13 ^ ~b15 & b17;\\\\n    s[22] = b22 ^ ~b24 & b26;\\\\n    s[23] = b23 ^ ~b25 & b27;\\\\n    s[32] = b32 ^ ~b34 & b36;\\\\n    s[33] = b33 ^ ~b35 & b37;\\\\n    s[42] = b42 ^ ~b44 & b46;\\\\n    s[43] = b43 ^ ~b45 & b47;\\\\n    s[4] = b4 ^ ~b6 & b8;\\\\n    s[5] = b5 ^ ~b7 & b9;\\\\n    s[14] = b14 ^ ~b16 & b18;\\\\n    s[15] = b15 ^ ~b17 & b19;\\\\n    s[24] = b24 ^ ~b26 & b28;\\\\n    s[25] = b25 ^ ~b27 & b29;\\\\n    s[34] = b34 ^ ~b36 & b38;\\\\n    s[35] = b35 ^ ~b37 & b39;\\\\n    s[44] = b44 ^ ~b46 & b48;\\\\n    s[45] = b45 ^ ~b47 & b49;\\\\n    s[6] = b6 ^ ~b8 & b0;\\\\n    s[7] = b7 ^ ~b9 & b1;\\\\n    s[16] = b16 ^ ~b18 & b10;\\\\n    s[17] = b17 ^ ~b19 & b11;\\\\n    s[26] = b26 ^ ~b28 & b20;\\\\n    s[27] = b27 ^ ~b29 & b21;\\\\n    s[36] = b36 ^ ~b38 & b30;\\\\n    s[37] = b37 ^ ~b39 & b31;\\\\n    s[46] = b46 ^ ~b48 & b40;\\\\n    s[47] = b47 ^ ~b49 & b41;\\\\n    s[8] = b8 ^ ~b0 & b2;\\\\n    s[9] = b9 ^ ~b1 & b3;\\\\n    s[18] = b18 ^ ~b10 & b12;\\\\n    s[19] = b19 ^ ~b11 & b13;\\\\n    s[28] = b28 ^ ~b20 & b22;\\\\n    s[29] = b29 ^ ~b21 & b23;\\\\n    s[38] = b38 ^ ~b30 & b32;\\\\n    s[39] = b39 ^ ~b31 & b33;\\\\n    s[48] = b48 ^ ~b40 & b42;\\\\n    s[49] = b49 ^ ~b41 & b43;\\\\n\\\\n    s[0] ^= RC[n];\\\\n    s[1] ^= RC[n + 1];\\\\n  }\\\\n};\\\\n\\\\nvar keccak = function keccak(bits) {\\\\n  return function (str) {\\\\n    var msg;\\\\n    if (str.slice(0, 2) === \\"0x\\") {\\\\n      msg = [];\\\\n      for (var i = 2, l = str.length; i < l; i += 2) {\\\\n        msg.push(parseInt(str.slice(i, i + 2), 16));\\\\n      }\\\\n    } else {\\\\n      msg = str;\\\\n    }\\\\n    return update(Keccak(bits, bits), msg);\\\\n  };\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  keccak256: keccak(256),\\\\n  keccak512: keccak(512),\\\\n  keccak256s: keccak(256),\\\\n  keccak512s: keccak(512)\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/eth-lib/lib/hash.js\\\\n// module id = 128\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/eth-lib/lib/hash.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\n//\\\\n// We store our EE objects in a plain object whose properties are event names.\\\\n// If `Object.create(null)` is not supported we prefix the event names with a\\\\n// `~` to make sure that the built-in object properties are not overridden or\\\\n// used as an attack vector.\\\\n// We also assume that `Object.create(null)` is available when the event name\\\\n// is an ES6 Symbol.\\\\n//\\\\nvar prefix = typeof Object.create !== \'function\' ? \'~\' : false;\\\\n\\\\n/**\\\\n * Representation of a single EventEmitter function.\\\\n *\\\\n * @param {Function} fn Event handler to be called.\\\\n * @param {Mixed} context Context for function execution.\\\\n * @param {Boolean} once Only emit once\\\\n * @api private\\\\n */\\\\nfunction EE(fn, context, once) {\\\\n  this.fn = fn;\\\\n  this.context = context;\\\\n  this.once = once || false;\\\\n}\\\\n\\\\n/**\\\\n * Minimal EventEmitter interface that is molded against the Node.js\\\\n * EventEmitter interface.\\\\n *\\\\n * @constructor\\\\n * @api public\\\\n */\\\\nfunction EventEmitter() { /* Nothing to set */ }\\\\n\\\\n/**\\\\n * Holds the assigned EventEmitters by name.\\\\n *\\\\n * @type {Object}\\\\n * @private\\\\n */\\\\nEventEmitter.prototype._events = undefined;\\\\n\\\\n/**\\\\n * Return a list of assigned event listeners.\\\\n *\\\\n * @param {String} event The events that should be listed.\\\\n * @param {Boolean} exists We only need to know if there are listeners.\\\\n * @returns {Array|Boolean}\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.listeners = function listeners(event, exists) {\\\\n  var evt = prefix ? prefix + event : event\\\\n    , available = this._events && this._events[evt];\\\\n\\\\n  if (exists) return !!available;\\\\n  if (!available) return [];\\\\n  if (available.fn) return [available.fn];\\\\n\\\\n  for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\\\\n    ee[i] = available[i].fn;\\\\n  }\\\\n\\\\n  return ee;\\\\n};\\\\n\\\\n/**\\\\n * Emit an event to all registered event listeners.\\\\n *\\\\n * @param {String} event The name of the event.\\\\n * @returns {Boolean} Indication if we\'ve emitted an event.\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\\\\n  var evt = prefix ? prefix + event : event;\\\\n\\\\n  if (!this._events || !this._events[evt]) return false;\\\\n\\\\n  var listeners = this._events[evt]\\\\n    , len = arguments.length\\\\n    , args\\\\n    , i;\\\\n\\\\n  if (\'function\' === typeof listeners.fn) {\\\\n    if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\\\\n\\\\n    switch (len) {\\\\n      case 1: return listeners.fn.call(listeners.context), true;\\\\n      case 2: return listeners.fn.call(listeners.context, a1), true;\\\\n      case 3: return listeners.fn.call(listeners.context, a1, a2), true;\\\\n      case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\\\\n      case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\\\\n      case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\\\\n    }\\\\n\\\\n    for (i = 1, args = new Array(len -1); i < len; i++) {\\\\n      args[i - 1] = arguments[i];\\\\n    }\\\\n\\\\n    listeners.fn.apply(listeners.context, args);\\\\n  } else {\\\\n    var length = listeners.length\\\\n      , j;\\\\n\\\\n    for (i = 0; i < length; i++) {\\\\n      if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\\\\n\\\\n      switch (len) {\\\\n        case 1: listeners[i].fn.call(listeners[i].context); break;\\\\n        case 2: listeners[i].fn.call(listeners[i].context, a1); break;\\\\n        case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\\\\n        default:\\\\n          if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\\\\n            args[j - 1] = arguments[j];\\\\n          }\\\\n\\\\n          listeners[i].fn.apply(listeners[i].context, args);\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  return true;\\\\n};\\\\n\\\\n/**\\\\n * Register a new EventListener for the given event.\\\\n *\\\\n * @param {String} event Name of the event.\\\\n * @param {Functon} fn Callback function.\\\\n * @param {Mixed} context The context of the function.\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.on = function on(event, fn, context) {\\\\n  var listener = new EE(fn, context || this)\\\\n    , evt = prefix ? prefix + event : event;\\\\n\\\\n  if (!this._events) this._events = prefix ? {} : Object.create(null);\\\\n  if (!this._events[evt]) this._events[evt] = listener;\\\\n  else {\\\\n    if (!this._events[evt].fn) this._events[evt].push(listener);\\\\n    else this._events[evt] = [\\\\n      this._events[evt], listener\\\\n    ];\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n/**\\\\n * Add an EventListener that\'s only called once.\\\\n *\\\\n * @param {String} event Name of the event.\\\\n * @param {Function} fn Callback function.\\\\n * @param {Mixed} context The context of the function.\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.once = function once(event, fn, context) {\\\\n  var listener = new EE(fn, context || this, true)\\\\n    , evt = prefix ? prefix + event : event;\\\\n\\\\n  if (!this._events) this._events = prefix ? {} : Object.create(null);\\\\n  if (!this._events[evt]) this._events[evt] = listener;\\\\n  else {\\\\n    if (!this._events[evt].fn) this._events[evt].push(listener);\\\\n    else this._events[evt] = [\\\\n      this._events[evt], listener\\\\n    ];\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n/**\\\\n * Remove event listeners.\\\\n *\\\\n * @param {String} event The event we want to remove.\\\\n * @param {Function} fn The listener that we need to find.\\\\n * @param {Mixed} context Only remove listeners matching this context.\\\\n * @param {Boolean} once Only remove once listeners.\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\\\\n  var evt = prefix ? prefix + event : event;\\\\n\\\\n  if (!this._events || !this._events[evt]) return this;\\\\n\\\\n  var listeners = this._events[evt]\\\\n    , events = [];\\\\n\\\\n  if (fn) {\\\\n    if (listeners.fn) {\\\\n      if (\\\\n           listeners.fn !== fn\\\\n        || (once && !listeners.once)\\\\n        || (context && listeners.context !== context)\\\\n      ) {\\\\n        events.push(listeners);\\\\n      }\\\\n    } else {\\\\n      for (var i = 0, length = listeners.length; i < length; i++) {\\\\n        if (\\\\n             listeners[i].fn !== fn\\\\n          || (once && !listeners[i].once)\\\\n          || (context && listeners[i].context !== context)\\\\n        ) {\\\\n          events.push(listeners[i]);\\\\n        }\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  //\\\\n  // Reset the array, or remove it completely if we have no more listeners.\\\\n  //\\\\n  if (events.length) {\\\\n    this._events[evt] = events.length === 1 ? events[0] : events;\\\\n  } else {\\\\n    delete this._events[evt];\\\\n  }\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n/**\\\\n * Remove all listeners or only the listeners for the specified event.\\\\n *\\\\n * @param {String} event The event want to remove all listeners for.\\\\n * @api public\\\\n */\\\\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\\\\n  if (!this._events) return this;\\\\n\\\\n  if (event) delete this._events[prefix ? prefix + event : event];\\\\n  else this._events = prefix ? {} : Object.create(null);\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n//\\\\n// Alias methods names because people roll like that.\\\\n//\\\\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\\\\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\\\\n\\\\n//\\\\n// This function doesn\'t apply anymore.\\\\n//\\\\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\\\\n  return this;\\\\n};\\\\n\\\\n//\\\\n// Expose the prefix.\\\\n//\\\\nEventEmitter.prefixed = prefix;\\\\n\\\\n//\\\\n// Expose the module.\\\\n//\\\\nif (true) {\\\\n  module.exports = EventEmitter;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/eventemitter3/index.js\\\\n// module id = 129\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/eventemitter3/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar common = __webpack_require__(41);\\\\nvar shaCommon = __webpack_require__(132);\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nvar sum32 = utils.sum32;\\\\nvar sum32_4 = utils.sum32_4;\\\\nvar sum32_5 = utils.sum32_5;\\\\nvar ch32 = shaCommon.ch32;\\\\nvar maj32 = shaCommon.maj32;\\\\nvar s0_256 = shaCommon.s0_256;\\\\nvar s1_256 = shaCommon.s1_256;\\\\nvar g0_256 = shaCommon.g0_256;\\\\nvar g1_256 = shaCommon.g1_256;\\\\n\\\\nvar BlockHash = common.BlockHash;\\\\n\\\\nvar sha256_K = [\\\\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\\\\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\\\\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\\\\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\\\\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\\\\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\\\\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\\\\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\\\\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\\\\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\\\\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\\\\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\\\\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\\\\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\\\\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\\\\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\\\\n];\\\\n\\\\nfunction SHA256() {\\\\n  if (!(this instanceof SHA256))\\\\n    return new SHA256();\\\\n\\\\n  BlockHash.call(this);\\\\n  this.h = [\\\\n    0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\\\\n    0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19\\\\n  ];\\\\n  this.k = sha256_K;\\\\n  this.W = new Array(64);\\\\n}\\\\nutils.inherits(SHA256, BlockHash);\\\\nmodule.exports = SHA256;\\\\n\\\\nSHA256.blockSize = 512;\\\\nSHA256.outSize = 256;\\\\nSHA256.hmacStrength = 192;\\\\nSHA256.padLength = 64;\\\\n\\\\nSHA256.prototype._update = function _update(msg, start) {\\\\n  var W = this.W;\\\\n\\\\n  for (var i = 0; i < 16; i++)\\\\n    W[i] = msg[start + i];\\\\n  for (; i < W.length; i++)\\\\n    W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\\\\n\\\\n  var a = this.h[0];\\\\n  var b = this.h[1];\\\\n  var c = this.h[2];\\\\n  var d = this.h[3];\\\\n  var e = this.h[4];\\\\n  var f = this.h[5];\\\\n  var g = this.h[6];\\\\n  var h = this.h[7];\\\\n\\\\n  assert(this.k.length === W.length);\\\\n  for (i = 0; i < W.length; i++) {\\\\n    var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\\\\n    var T2 = sum32(s0_256(a), maj32(a, b, c));\\\\n    h = g;\\\\n    g = f;\\\\n    f = e;\\\\n    e = sum32(d, T1);\\\\n    d = c;\\\\n    c = b;\\\\n    b = a;\\\\n    a = sum32(T1, T2);\\\\n  }\\\\n\\\\n  this.h[0] = sum32(this.h[0], a);\\\\n  this.h[1] = sum32(this.h[1], b);\\\\n  this.h[2] = sum32(this.h[2], c);\\\\n  this.h[3] = sum32(this.h[3], d);\\\\n  this.h[4] = sum32(this.h[4], e);\\\\n  this.h[5] = sum32(this.h[5], f);\\\\n  this.h[6] = sum32(this.h[6], g);\\\\n  this.h[7] = sum32(this.h[7], h);\\\\n};\\\\n\\\\nSHA256.prototype._digest = function digest(enc) {\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h, \'big\');\\\\n  else\\\\n    return utils.split32(this.h, \'big\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/256.js\\\\n// module id = 130\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/256.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar common = __webpack_require__(41);\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nvar rotr64_hi = utils.rotr64_hi;\\\\nvar rotr64_lo = utils.rotr64_lo;\\\\nvar shr64_hi = utils.shr64_hi;\\\\nvar shr64_lo = utils.shr64_lo;\\\\nvar sum64 = utils.sum64;\\\\nvar sum64_hi = utils.sum64_hi;\\\\nvar sum64_lo = utils.sum64_lo;\\\\nvar sum64_4_hi = utils.sum64_4_hi;\\\\nvar sum64_4_lo = utils.sum64_4_lo;\\\\nvar sum64_5_hi = utils.sum64_5_hi;\\\\nvar sum64_5_lo = utils.sum64_5_lo;\\\\n\\\\nvar BlockHash = common.BlockHash;\\\\n\\\\nvar sha512_K = [\\\\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\\\\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\\\\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\\\\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\\\\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\\\\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\\\\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\\\\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\\\\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\\\\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\\\\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\\\\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\\\\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\\\\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\\\\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\\\\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\\\\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\\\\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\\\\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\\\\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\\\\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\\\\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\\\\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\\\\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\\\\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\\\\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\\\\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\\\\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\\\\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\\\\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\\\\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\\\\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\\\\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\\\\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\\\\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\\\\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\\\\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\\\\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\\\\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\\\\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\\\\n];\\\\n\\\\nfunction SHA512() {\\\\n  if (!(this instanceof SHA512))\\\\n    return new SHA512();\\\\n\\\\n  BlockHash.call(this);\\\\n  this.h = [\\\\n    0x6a09e667, 0xf3bcc908,\\\\n    0xbb67ae85, 0x84caa73b,\\\\n    0x3c6ef372, 0xfe94f82b,\\\\n    0xa54ff53a, 0x5f1d36f1,\\\\n    0x510e527f, 0xade682d1,\\\\n    0x9b05688c, 0x2b3e6c1f,\\\\n    0x1f83d9ab, 0xfb41bd6b,\\\\n    0x5be0cd19, 0x137e2179 ];\\\\n  this.k = sha512_K;\\\\n  this.W = new Array(160);\\\\n}\\\\nutils.inherits(SHA512, BlockHash);\\\\nmodule.exports = SHA512;\\\\n\\\\nSHA512.blockSize = 1024;\\\\nSHA512.outSize = 512;\\\\nSHA512.hmacStrength = 192;\\\\nSHA512.padLength = 128;\\\\n\\\\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\\\\n  var W = this.W;\\\\n\\\\n  // 32 x 32bit words\\\\n  for (var i = 0; i < 32; i++)\\\\n    W[i] = msg[start + i];\\\\n  for (; i < W.length; i += 2) {\\\\n    var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);  // i - 2\\\\n    var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\\\\n    var c1_hi = W[i - 14];  // i - 7\\\\n    var c1_lo = W[i - 13];\\\\n    var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);  // i - 15\\\\n    var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\\\\n    var c3_hi = W[i - 32];  // i - 16\\\\n    var c3_lo = W[i - 31];\\\\n\\\\n    W[i] = sum64_4_hi(\\\\n      c0_hi, c0_lo,\\\\n      c1_hi, c1_lo,\\\\n      c2_hi, c2_lo,\\\\n      c3_hi, c3_lo);\\\\n    W[i + 1] = sum64_4_lo(\\\\n      c0_hi, c0_lo,\\\\n      c1_hi, c1_lo,\\\\n      c2_hi, c2_lo,\\\\n      c3_hi, c3_lo);\\\\n  }\\\\n};\\\\n\\\\nSHA512.prototype._update = function _update(msg, start) {\\\\n  this._prepareBlock(msg, start);\\\\n\\\\n  var W = this.W;\\\\n\\\\n  var ah = this.h[0];\\\\n  var al = this.h[1];\\\\n  var bh = this.h[2];\\\\n  var bl = this.h[3];\\\\n  var ch = this.h[4];\\\\n  var cl = this.h[5];\\\\n  var dh = this.h[6];\\\\n  var dl = this.h[7];\\\\n  var eh = this.h[8];\\\\n  var el = this.h[9];\\\\n  var fh = this.h[10];\\\\n  var fl = this.h[11];\\\\n  var gh = this.h[12];\\\\n  var gl = this.h[13];\\\\n  var hh = this.h[14];\\\\n  var hl = this.h[15];\\\\n\\\\n  assert(this.k.length === W.length);\\\\n  for (var i = 0; i < W.length; i += 2) {\\\\n    var c0_hi = hh;\\\\n    var c0_lo = hl;\\\\n    var c1_hi = s1_512_hi(eh, el);\\\\n    var c1_lo = s1_512_lo(eh, el);\\\\n    var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\\\\n    var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\\\\n    var c3_hi = this.k[i];\\\\n    var c3_lo = this.k[i + 1];\\\\n    var c4_hi = W[i];\\\\n    var c4_lo = W[i + 1];\\\\n\\\\n    var T1_hi = sum64_5_hi(\\\\n      c0_hi, c0_lo,\\\\n      c1_hi, c1_lo,\\\\n      c2_hi, c2_lo,\\\\n      c3_hi, c3_lo,\\\\n      c4_hi, c4_lo);\\\\n    var T1_lo = sum64_5_lo(\\\\n      c0_hi, c0_lo,\\\\n      c1_hi, c1_lo,\\\\n      c2_hi, c2_lo,\\\\n      c3_hi, c3_lo,\\\\n      c4_hi, c4_lo);\\\\n\\\\n    c0_hi = s0_512_hi(ah, al);\\\\n    c0_lo = s0_512_lo(ah, al);\\\\n    c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\\\\n    c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\\\\n\\\\n    var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\\\\n    var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\\\\n\\\\n    hh = gh;\\\\n    hl = gl;\\\\n\\\\n    gh = fh;\\\\n    gl = fl;\\\\n\\\\n    fh = eh;\\\\n    fl = el;\\\\n\\\\n    eh = sum64_hi(dh, dl, T1_hi, T1_lo);\\\\n    el = sum64_lo(dl, dl, T1_hi, T1_lo);\\\\n\\\\n    dh = ch;\\\\n    dl = cl;\\\\n\\\\n    ch = bh;\\\\n    cl = bl;\\\\n\\\\n    bh = ah;\\\\n    bl = al;\\\\n\\\\n    ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\\\\n    al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\\\\n  }\\\\n\\\\n  sum64(this.h, 0, ah, al);\\\\n  sum64(this.h, 2, bh, bl);\\\\n  sum64(this.h, 4, ch, cl);\\\\n  sum64(this.h, 6, dh, dl);\\\\n  sum64(this.h, 8, eh, el);\\\\n  sum64(this.h, 10, fh, fl);\\\\n  sum64(this.h, 12, gh, gl);\\\\n  sum64(this.h, 14, hh, hl);\\\\n};\\\\n\\\\nSHA512.prototype._digest = function digest(enc) {\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h, \'big\');\\\\n  else\\\\n    return utils.split32(this.h, \'big\');\\\\n};\\\\n\\\\nfunction ch64_hi(xh, xl, yh, yl, zh) {\\\\n  var r = (xh & yh) ^ ((~xh) & zh);\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\\\\n  var r = (xl & yl) ^ ((~xl) & zl);\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction maj64_hi(xh, xl, yh, yl, zh) {\\\\n  var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\\\\n  var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction s0_512_hi(xh, xl) {\\\\n  var c0_hi = rotr64_hi(xh, xl, 28);\\\\n  var c1_hi = rotr64_hi(xl, xh, 2);  // 34\\\\n  var c2_hi = rotr64_hi(xl, xh, 7);  // 39\\\\n\\\\n  var r = c0_hi ^ c1_hi ^ c2_hi;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction s0_512_lo(xh, xl) {\\\\n  var c0_lo = rotr64_lo(xh, xl, 28);\\\\n  var c1_lo = rotr64_lo(xl, xh, 2);  // 34\\\\n  var c2_lo = rotr64_lo(xl, xh, 7);  // 39\\\\n\\\\n  var r = c0_lo ^ c1_lo ^ c2_lo;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction s1_512_hi(xh, xl) {\\\\n  var c0_hi = rotr64_hi(xh, xl, 14);\\\\n  var c1_hi = rotr64_hi(xh, xl, 18);\\\\n  var c2_hi = rotr64_hi(xl, xh, 9);  // 41\\\\n\\\\n  var r = c0_hi ^ c1_hi ^ c2_hi;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction s1_512_lo(xh, xl) {\\\\n  var c0_lo = rotr64_lo(xh, xl, 14);\\\\n  var c1_lo = rotr64_lo(xh, xl, 18);\\\\n  var c2_lo = rotr64_lo(xl, xh, 9);  // 41\\\\n\\\\n  var r = c0_lo ^ c1_lo ^ c2_lo;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction g0_512_hi(xh, xl) {\\\\n  var c0_hi = rotr64_hi(xh, xl, 1);\\\\n  var c1_hi = rotr64_hi(xh, xl, 8);\\\\n  var c2_hi = shr64_hi(xh, xl, 7);\\\\n\\\\n  var r = c0_hi ^ c1_hi ^ c2_hi;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction g0_512_lo(xh, xl) {\\\\n  var c0_lo = rotr64_lo(xh, xl, 1);\\\\n  var c1_lo = rotr64_lo(xh, xl, 8);\\\\n  var c2_lo = shr64_lo(xh, xl, 7);\\\\n\\\\n  var r = c0_lo ^ c1_lo ^ c2_lo;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction g1_512_hi(xh, xl) {\\\\n  var c0_hi = rotr64_hi(xh, xl, 19);\\\\n  var c1_hi = rotr64_hi(xl, xh, 29);  // 61\\\\n  var c2_hi = shr64_hi(xh, xl, 6);\\\\n\\\\n  var r = c0_hi ^ c1_hi ^ c2_hi;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\nfunction g1_512_lo(xh, xl) {\\\\n  var c0_lo = rotr64_lo(xh, xl, 19);\\\\n  var c1_lo = rotr64_lo(xl, xh, 29);  // 61\\\\n  var c2_lo = shr64_lo(xh, xl, 6);\\\\n\\\\n  var r = c0_lo ^ c1_lo ^ c2_lo;\\\\n  if (r < 0)\\\\n    r += 0x100000000;\\\\n  return r;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/512.js\\\\n// module id = 131\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/512.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar rotr32 = utils.rotr32;\\\\n\\\\nfunction ft_1(s, x, y, z) {\\\\n  if (s === 0)\\\\n    return ch32(x, y, z);\\\\n  if (s === 1 || s === 3)\\\\n    return p32(x, y, z);\\\\n  if (s === 2)\\\\n    return maj32(x, y, z);\\\\n}\\\\nexports.ft_1 = ft_1;\\\\n\\\\nfunction ch32(x, y, z) {\\\\n  return (x & y) ^ ((~x) & z);\\\\n}\\\\nexports.ch32 = ch32;\\\\n\\\\nfunction maj32(x, y, z) {\\\\n  return (x & y) ^ (x & z) ^ (y & z);\\\\n}\\\\nexports.maj32 = maj32;\\\\n\\\\nfunction p32(x, y, z) {\\\\n  return x ^ y ^ z;\\\\n}\\\\nexports.p32 = p32;\\\\n\\\\nfunction s0_256(x) {\\\\n  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\\\\n}\\\\nexports.s0_256 = s0_256;\\\\n\\\\nfunction s1_256(x) {\\\\n  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\\\\n}\\\\nexports.s1_256 = s1_256;\\\\n\\\\nfunction g0_256(x) {\\\\n  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\\\\n}\\\\nexports.g0_256 = g0_256;\\\\n\\\\nfunction g1_256(x) {\\\\n  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\\\\n}\\\\nexports.g1_256 = g1_256;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/common.js\\\\n// module id = 132\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/common.js\\")},function(module,exports){eval(\\"module.exports = isFunction\\\\n\\\\nvar toString = Object.prototype.toString\\\\n\\\\nfunction isFunction (fn) {\\\\n  var string = toString.call(fn)\\\\n  return string === \'[object Function]\' ||\\\\n    (typeof fn === \'function\' && string !== \'[object RegExp]\') ||\\\\n    (typeof window !== \'undefined\' &&\\\\n     // IE8 and below\\\\n     (fn === window.setTimeout ||\\\\n      fn === window.alert ||\\\\n      fn === window.confirm ||\\\\n      fn === window.prompt))\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/is-function/index.js\\\\n// module id = 133\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/is-function/index.js\\")},function(module,exports){eval(\\"var toString = {}.toString;\\\\n\\\\nmodule.exports = Array.isArray || function (arr) {\\\\n  return toString.call(arr) == \'[object Array]\';\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/isarray/index.js\\\\n// module id = 134\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/isarray/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var bn = __webpack_require__(3);\\\\nvar brorand = __webpack_require__(97);\\\\n\\\\nfunction MillerRabin(rand) {\\\\n  this.rand = rand || new brorand.Rand();\\\\n}\\\\nmodule.exports = MillerRabin;\\\\n\\\\nMillerRabin.create = function create(rand) {\\\\n  return new MillerRabin(rand);\\\\n};\\\\n\\\\nMillerRabin.prototype._randbelow = function _randbelow(n) {\\\\n  var len = n.bitLength();\\\\n  var min_bytes = Math.ceil(len / 8);\\\\n\\\\n  // Generage random bytes until a number less than n is found.\\\\n  // This ensures that 0..n-1 have an equal probability of being selected.\\\\n  do\\\\n    var a = new bn(this.rand.generate(min_bytes));\\\\n  while (a.cmp(n) >= 0);\\\\n\\\\n  return a;\\\\n};\\\\n\\\\nMillerRabin.prototype._randrange = function _randrange(start, stop) {\\\\n  // Generate a random number greater than or equal to start and less than stop.\\\\n  var size = stop.sub(start);\\\\n  return start.add(this._randbelow(size));\\\\n};\\\\n\\\\nMillerRabin.prototype.test = function test(n, k, cb) {\\\\n  var len = n.bitLength();\\\\n  var red = bn.mont(n);\\\\n  var rone = new bn(1).toRed(red);\\\\n\\\\n  if (!k)\\\\n    k = Math.max(1, (len / 48) | 0);\\\\n\\\\n  // Find d and s, (n - 1) = (2 ^ s) * d;\\\\n  var n1 = n.subn(1);\\\\n  for (var s = 0; !n1.testn(s); s++) {}\\\\n  var d = n.shrn(s);\\\\n\\\\n  var rn1 = n1.toRed(red);\\\\n\\\\n  var prime = true;\\\\n  for (; k > 0; k--) {\\\\n    var a = this._randrange(new bn(2), n1);\\\\n    if (cb)\\\\n      cb(a);\\\\n\\\\n    var x = a.toRed(red).redPow(d);\\\\n    if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\\\\n      continue;\\\\n\\\\n    for (var i = 1; i < s; i++) {\\\\n      x = x.redSqr();\\\\n\\\\n      if (x.cmp(rone) === 0)\\\\n        return false;\\\\n      if (x.cmp(rn1) === 0)\\\\n        break;\\\\n    }\\\\n\\\\n    if (i === s)\\\\n      return false;\\\\n  }\\\\n\\\\n  return prime;\\\\n};\\\\n\\\\nMillerRabin.prototype.getDivisor = function getDivisor(n, k) {\\\\n  var len = n.bitLength();\\\\n  var red = bn.mont(n);\\\\n  var rone = new bn(1).toRed(red);\\\\n\\\\n  if (!k)\\\\n    k = Math.max(1, (len / 48) | 0);\\\\n\\\\n  // Find d and s, (n - 1) = (2 ^ s) * d;\\\\n  var n1 = n.subn(1);\\\\n  for (var s = 0; !n1.testn(s); s++) {}\\\\n  var d = n.shrn(s);\\\\n\\\\n  var rn1 = n1.toRed(red);\\\\n\\\\n  for (; k > 0; k--) {\\\\n    var a = this._randrange(new bn(2), n1);\\\\n\\\\n    var g = n.gcd(a);\\\\n    if (g.cmpn(1) !== 0)\\\\n      return g;\\\\n\\\\n    var x = a.toRed(red).redPow(d);\\\\n    if (x.cmp(rone) === 0 || x.cmp(rn1) === 0)\\\\n      continue;\\\\n\\\\n    for (var i = 1; i < s; i++) {\\\\n      x = x.redSqr();\\\\n\\\\n      if (x.cmp(rone) === 0)\\\\n        return x.fromRed().subn(1).gcd(n);\\\\n      if (x.cmp(rn1) === 0)\\\\n        break;\\\\n    }\\\\n\\\\n    if (i === s) {\\\\n      x = x.redSqr();\\\\n      return x.fromRed().subn(1).gcd(n);\\\\n    }\\\\n  }\\\\n\\\\n  return false;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/miller-rabin/lib/mr.js\\\\n// module id = 135\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/miller-rabin/lib/mr.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = exports;\\\\n\\\\nfunction toArray(msg, enc) {\\\\n  if (Array.isArray(msg))\\\\n    return msg.slice();\\\\n  if (!msg)\\\\n    return [];\\\\n  var res = [];\\\\n  if (typeof msg !== \'string\') {\\\\n    for (var i = 0; i < msg.length; i++)\\\\n      res[i] = msg[i] | 0;\\\\n    return res;\\\\n  }\\\\n  if (enc === \'hex\') {\\\\n    msg = msg.replace(/[^a-z0-9]+/ig, \'\');\\\\n    if (msg.length % 2 !== 0)\\\\n      msg = \'0\' + msg;\\\\n    for (var i = 0; i < msg.length; i += 2)\\\\n      res.push(parseInt(msg[i] + msg[i + 1], 16));\\\\n  } else {\\\\n    for (var i = 0; i < msg.length; i++) {\\\\n      var c = msg.charCodeAt(i);\\\\n      var hi = c >> 8;\\\\n      var lo = c & 0xff;\\\\n      if (hi)\\\\n        res.push(hi, lo);\\\\n      else\\\\n        res.push(lo);\\\\n    }\\\\n  }\\\\n  return res;\\\\n}\\\\nutils.toArray = toArray;\\\\n\\\\nfunction zero2(word) {\\\\n  if (word.length === 1)\\\\n    return \'0\' + word;\\\\n  else\\\\n    return word;\\\\n}\\\\nutils.zero2 = zero2;\\\\n\\\\nfunction toHex(msg) {\\\\n  var res = \'\';\\\\n  for (var i = 0; i < msg.length; i++)\\\\n    res += zero2(msg[i].toString(16));\\\\n  return res;\\\\n}\\\\nutils.toHex = toHex;\\\\n\\\\nutils.encode = function encode(arr, enc) {\\\\n  if (enc === \'hex\')\\\\n    return toHex(arr);\\\\n  else\\\\n    return arr;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/minimalistic-crypto-utils/lib/utils.js\\\\n// module id = 136\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/minimalistic-crypto-utils/lib/utils.js\\")},function(module,exports,__webpack_require__){eval(\\"var BN = __webpack_require__(283);\\\\nvar stripHexPrefix = __webpack_require__(324);\\\\n\\\\n/**\\\\n * Returns a BN object, converts a number value to a BN\\\\n * @param {String|Number|Object} `arg` input a string number, hex string number, number, BigNumber or BN object\\\\n * @return {Object} `output` BN object of the number\\\\n * @throws if the argument is not an array, object that isn\'t a bignumber, not a string number or number\\\\n */\\\\nmodule.exports = function numberToBN(arg) {\\\\n  if (typeof arg === \'string\' || typeof arg === \'number\') {\\\\n    var multiplier = new BN(1); // eslint-disable-line\\\\n    var formattedString = String(arg).toLowerCase().trim();\\\\n    var isHexPrefixed = formattedString.substr(0, 2) === \'0x\' || formattedString.substr(0, 3) === \'-0x\';\\\\n    var stringArg = stripHexPrefix(formattedString); // eslint-disable-line\\\\n    if (stringArg.substr(0, 1) === \'-\') {\\\\n      stringArg = stripHexPrefix(stringArg.slice(1));\\\\n      multiplier = new BN(-1, 10);\\\\n    }\\\\n    stringArg = stringArg === \'\' ? \'0\' : stringArg;\\\\n\\\\n    if ((!stringArg.match(/^-?[0-9]+$/) && stringArg.match(/^[0-9A-Fa-f]+$/))\\\\n      || stringArg.match(/^[a-fA-F]+$/)\\\\n      || (isHexPrefixed === true && stringArg.match(/^[0-9A-Fa-f]+$/))) {\\\\n      return new BN(stringArg, 16).mul(multiplier);\\\\n    }\\\\n\\\\n    if ((stringArg.match(/^-?[0-9]+$/) || stringArg === \'\') && isHexPrefixed === false) {\\\\n      return new BN(stringArg, 10).mul(multiplier);\\\\n    }\\\\n  } else if (typeof arg === \'object\' && arg.toString && (!arg.pop && !arg.push)) {\\\\n    if (arg.toString(10).match(/^-?[0-9]+$/) && (arg.mul || arg.dividedToIntegerBy)) {\\\\n      return new BN(arg.toString(10), 10);\\\\n    }\\\\n  }\\\\n\\\\n  throw new Error(\'[number-to-bn] while converting number \' + JSON.stringify(arg) + \' to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.\');\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/number-to-bn/src/index.js\\\\n// module id = 137\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/number-to-bn/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\nobject-assign\\\\n(c) Sindre Sorhus\\\\n@license MIT\\\\n*/\\\\n\\\\n\\\\n/* eslint-disable no-unused-vars */\\\\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\\\\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\\\\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\\\\n\\\\nfunction toObject(val) {\\\\n\\\\tif (val === null || val === undefined) {\\\\n\\\\t\\\\tthrow new TypeError(\'Object.assign cannot be called with null or undefined\');\\\\n\\\\t}\\\\n\\\\n\\\\treturn Object(val);\\\\n}\\\\n\\\\nfunction shouldUseNative() {\\\\n\\\\ttry {\\\\n\\\\t\\\\tif (!Object.assign) {\\\\n\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// Detect buggy property enumeration order in older V8 versions.\\\\n\\\\n\\\\t\\\\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\\\\n\\\\t\\\\tvar test1 = new String(\'abc\');  // eslint-disable-line no-new-wrappers\\\\n\\\\t\\\\ttest1[5] = \'de\';\\\\n\\\\t\\\\tif (Object.getOwnPropertyNames(test1)[0] === \'5\') {\\\\n\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\\\\n\\\\t\\\\tvar test2 = {};\\\\n\\\\t\\\\tfor (var i = 0; i < 10; i++) {\\\\n\\\\t\\\\t\\\\ttest2[\'_\' + String.fromCharCode(i)] = i;\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\\\\n\\\\t\\\\t\\\\treturn test2[n];\\\\n\\\\t\\\\t});\\\\n\\\\t\\\\tif (order2.join(\'\') !== \'0123456789\') {\\\\n\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\\\\n\\\\t\\\\tvar test3 = {};\\\\n\\\\t\\\\t\'abcdefghijklmnopqrst\'.split(\'\').forEach(function (letter) {\\\\n\\\\t\\\\t\\\\ttest3[letter] = letter;\\\\n\\\\t\\\\t});\\\\n\\\\t\\\\tif (Object.keys(Object.assign({}, test3)).join(\'\') !==\\\\n\\\\t\\\\t\\\\t\\\\t\'abcdefghijklmnopqrst\') {\\\\n\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\treturn true;\\\\n\\\\t} catch (err) {\\\\n\\\\t\\\\t// We don\'t expect any of the above to throw, but better to be safe.\\\\n\\\\t\\\\treturn false;\\\\n\\\\t}\\\\n}\\\\n\\\\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\\\\n\\\\tvar from;\\\\n\\\\tvar to = toObject(target);\\\\n\\\\tvar symbols;\\\\n\\\\n\\\\tfor (var s = 1; s < arguments.length; s++) {\\\\n\\\\t\\\\tfrom = Object(arguments[s]);\\\\n\\\\n\\\\t\\\\tfor (var key in from) {\\\\n\\\\t\\\\t\\\\tif (hasOwnProperty.call(from, key)) {\\\\n\\\\t\\\\t\\\\t\\\\tto[key] = from[key];\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tif (getOwnPropertySymbols) {\\\\n\\\\t\\\\t\\\\tsymbols = getOwnPropertySymbols(from);\\\\n\\\\t\\\\t\\\\tfor (var i = 0; i < symbols.length; i++) {\\\\n\\\\t\\\\t\\\\t\\\\tif (propIsEnumerable.call(from, symbols[i])) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tto[symbols[i]] = from[symbols[i]];\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\n\\\\treturn to;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/object-assign/index.js\\\\n// module id = 138\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/object-assign/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\nvar Reporter = __webpack_require__(43).Reporter;\\\\nvar Buffer = __webpack_require__(1).Buffer;\\\\n\\\\nfunction DecoderBuffer(base, options) {\\\\n  Reporter.call(this, options);\\\\n  if (!Buffer.isBuffer(base)) {\\\\n    this.error(\'Input not Buffer\');\\\\n    return;\\\\n  }\\\\n\\\\n  this.base = base;\\\\n  this.offset = 0;\\\\n  this.length = base.length;\\\\n}\\\\ninherits(DecoderBuffer, Reporter);\\\\nexports.DecoderBuffer = DecoderBuffer;\\\\n\\\\nDecoderBuffer.prototype.save = function save() {\\\\n  return { offset: this.offset, reporter: Reporter.prototype.save.call(this) };\\\\n};\\\\n\\\\nDecoderBuffer.prototype.restore = function restore(save) {\\\\n  // Return skipped data\\\\n  var res = new DecoderBuffer(this.base);\\\\n  res.offset = save.offset;\\\\n  res.length = this.offset;\\\\n\\\\n  this.offset = save.offset;\\\\n  Reporter.prototype.restore.call(this, save.reporter);\\\\n\\\\n  return res;\\\\n};\\\\n\\\\nDecoderBuffer.prototype.isEmpty = function isEmpty() {\\\\n  return this.offset === this.length;\\\\n};\\\\n\\\\nDecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {\\\\n  if (this.offset + 1 <= this.length)\\\\n    return this.base.readUInt8(this.offset++, true);\\\\n  else\\\\n    return this.error(fail || \'DecoderBuffer overrun\');\\\\n}\\\\n\\\\nDecoderBuffer.prototype.skip = function skip(bytes, fail) {\\\\n  if (!(this.offset + bytes <= this.length))\\\\n    return this.error(fail || \'DecoderBuffer overrun\');\\\\n\\\\n  var res = new DecoderBuffer(this.base);\\\\n\\\\n  // Share reporter state\\\\n  res._reporterState = this._reporterState;\\\\n\\\\n  res.offset = this.offset;\\\\n  res.length = this.offset + bytes;\\\\n  this.offset += bytes;\\\\n  return res;\\\\n}\\\\n\\\\nDecoderBuffer.prototype.raw = function raw(save) {\\\\n  return this.base.slice(save ? save.offset : this.offset, this.length);\\\\n}\\\\n\\\\nfunction EncoderBuffer(value, reporter) {\\\\n  if (Array.isArray(value)) {\\\\n    this.length = 0;\\\\n    this.value = value.map(function(item) {\\\\n      if (!(item instanceof EncoderBuffer))\\\\n        item = new EncoderBuffer(item, reporter);\\\\n      this.length += item.length;\\\\n      return item;\\\\n    }, this);\\\\n  } else if (typeof value === \'number\') {\\\\n    if (!(0 <= value && value <= 0xff))\\\\n      return reporter.error(\'non-byte EncoderBuffer value\');\\\\n    this.value = value;\\\\n    this.length = 1;\\\\n  } else if (typeof value === \'string\') {\\\\n    this.value = value;\\\\n    this.length = Buffer.byteLength(value);\\\\n  } else if (Buffer.isBuffer(value)) {\\\\n    this.value = value;\\\\n    this.length = value.length;\\\\n  } else {\\\\n    return reporter.error(\'Unsupported type: \' + typeof value);\\\\n  }\\\\n}\\\\nexports.EncoderBuffer = EncoderBuffer;\\\\n\\\\nEncoderBuffer.prototype.join = function join(out, offset) {\\\\n  if (!out)\\\\n    out = new Buffer(this.length);\\\\n  if (!offset)\\\\n    offset = 0;\\\\n\\\\n  if (this.length === 0)\\\\n    return out;\\\\n\\\\n  if (Array.isArray(this.value)) {\\\\n    this.value.forEach(function(item) {\\\\n      item.join(out, offset);\\\\n      offset += item.length;\\\\n    });\\\\n  } else {\\\\n    if (typeof this.value === \'number\')\\\\n      out[offset] = this.value;\\\\n    else if (typeof this.value === \'string\')\\\\n      out.write(this.value, offset);\\\\n    else if (Buffer.isBuffer(this.value))\\\\n      this.value.copy(out, offset);\\\\n    offset += this.length;\\\\n  }\\\\n\\\\n  return out;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/buffer.js\\\\n// module id = 139\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/buffer.js\\")},function(module,exports,__webpack_require__){eval(\\"var constants = exports;\\\\n\\\\n// Helper\\\\nconstants._reverse = function reverse(map) {\\\\n  var res = {};\\\\n\\\\n  Object.keys(map).forEach(function(key) {\\\\n    // Convert key to integer if it is stringified\\\\n    if ((key | 0) == key)\\\\n      key = key | 0;\\\\n\\\\n    var value = map[key];\\\\n    res[value] = key;\\\\n  });\\\\n\\\\n  return res;\\\\n};\\\\n\\\\nconstants.der = __webpack_require__(292);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/constants/index.js\\\\n// module id = 140\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/constants/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\n\\\\nvar asn1 = __webpack_require__(42);\\\\nvar base = asn1.base;\\\\nvar bignum = asn1.bignum;\\\\n\\\\n// Import DER constants\\\\nvar der = asn1.constants.der;\\\\n\\\\nfunction DERDecoder(entity) {\\\\n  this.enc = \'der\';\\\\n  this.name = entity.name;\\\\n  this.entity = entity;\\\\n\\\\n  // Construct base tree\\\\n  this.tree = new DERNode();\\\\n  this.tree._init(entity.body);\\\\n};\\\\nmodule.exports = DERDecoder;\\\\n\\\\nDERDecoder.prototype.decode = function decode(data, options) {\\\\n  if (!(data instanceof base.DecoderBuffer))\\\\n    data = new base.DecoderBuffer(data, options);\\\\n\\\\n  return this.tree._decode(data, options);\\\\n};\\\\n\\\\n// Tree methods\\\\n\\\\nfunction DERNode(parent) {\\\\n  base.Node.call(this, \'der\', parent);\\\\n}\\\\ninherits(DERNode, base.Node);\\\\n\\\\nDERNode.prototype._peekTag = function peekTag(buffer, tag, any) {\\\\n  if (buffer.isEmpty())\\\\n    return false;\\\\n\\\\n  var state = buffer.save();\\\\n  var decodedTag = derDecodeTag(buffer, \'Failed to peek tag: \\\\\\"\' + tag + \'\\\\\\"\');\\\\n  if (buffer.isError(decodedTag))\\\\n    return decodedTag;\\\\n\\\\n  buffer.restore(state);\\\\n\\\\n  return decodedTag.tag === tag || decodedTag.tagStr === tag ||\\\\n    (decodedTag.tagStr + \'of\') === tag || any;\\\\n};\\\\n\\\\nDERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {\\\\n  var decodedTag = derDecodeTag(buffer,\\\\n                                \'Failed to decode tag of \\\\\\"\' + tag + \'\\\\\\"\');\\\\n  if (buffer.isError(decodedTag))\\\\n    return decodedTag;\\\\n\\\\n  var len = derDecodeLen(buffer,\\\\n                         decodedTag.primitive,\\\\n                         \'Failed to get length of \\\\\\"\' + tag + \'\\\\\\"\');\\\\n\\\\n  // Failure\\\\n  if (buffer.isError(len))\\\\n    return len;\\\\n\\\\n  if (!any &&\\\\n      decodedTag.tag !== tag &&\\\\n      decodedTag.tagStr !== tag &&\\\\n      decodedTag.tagStr + \'of\' !== tag) {\\\\n    return buffer.error(\'Failed to match tag: \\\\\\"\' + tag + \'\\\\\\"\');\\\\n  }\\\\n\\\\n  if (decodedTag.primitive || len !== null)\\\\n    return buffer.skip(len, \'Failed to match body of: \\\\\\"\' + tag + \'\\\\\\"\');\\\\n\\\\n  // Indefinite length... find END tag\\\\n  var state = buffer.save();\\\\n  var res = this._skipUntilEnd(\\\\n      buffer,\\\\n      \'Failed to skip indefinite length body: \\\\\\"\' + this.tag + \'\\\\\\"\');\\\\n  if (buffer.isError(res))\\\\n    return res;\\\\n\\\\n  len = buffer.offset - state.offset;\\\\n  buffer.restore(state);\\\\n  return buffer.skip(len, \'Failed to match body of: \\\\\\"\' + tag + \'\\\\\\"\');\\\\n};\\\\n\\\\nDERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {\\\\n  while (true) {\\\\n    var tag = derDecodeTag(buffer, fail);\\\\n    if (buffer.isError(tag))\\\\n      return tag;\\\\n    var len = derDecodeLen(buffer, tag.primitive, fail);\\\\n    if (buffer.isError(len))\\\\n      return len;\\\\n\\\\n    var res;\\\\n    if (tag.primitive || len !== null)\\\\n      res = buffer.skip(len)\\\\n    else\\\\n      res = this._skipUntilEnd(buffer, fail);\\\\n\\\\n    // Failure\\\\n    if (buffer.isError(res))\\\\n      return res;\\\\n\\\\n    if (tag.tagStr === \'end\')\\\\n      break;\\\\n  }\\\\n};\\\\n\\\\nDERNode.prototype._decodeList = function decodeList(buffer, tag, decoder,\\\\n                                                    options) {\\\\n  var result = [];\\\\n  while (!buffer.isEmpty()) {\\\\n    var possibleEnd = this._peekTag(buffer, \'end\');\\\\n    if (buffer.isError(possibleEnd))\\\\n      return possibleEnd;\\\\n\\\\n    var res = decoder.decode(buffer, \'der\', options);\\\\n    if (buffer.isError(res) && possibleEnd)\\\\n      break;\\\\n    result.push(res);\\\\n  }\\\\n  return result;\\\\n};\\\\n\\\\nDERNode.prototype._decodeStr = function decodeStr(buffer, tag) {\\\\n  if (tag === \'bitstr\') {\\\\n    var unused = buffer.readUInt8();\\\\n    if (buffer.isError(unused))\\\\n      return unused;\\\\n    return { unused: unused, data: buffer.raw() };\\\\n  } else if (tag === \'bmpstr\') {\\\\n    var raw = buffer.raw();\\\\n    if (raw.length % 2 === 1)\\\\n      return buffer.error(\'Decoding of string type: bmpstr length mismatch\');\\\\n\\\\n    var str = \'\';\\\\n    for (var i = 0; i < raw.length / 2; i++) {\\\\n      str += String.fromCharCode(raw.readUInt16BE(i * 2));\\\\n    }\\\\n    return str;\\\\n  } else if (tag === \'numstr\') {\\\\n    var numstr = buffer.raw().toString(\'ascii\');\\\\n    if (!this._isNumstr(numstr)) {\\\\n      return buffer.error(\'Decoding of string type: \' +\\\\n                          \'numstr unsupported characters\');\\\\n    }\\\\n    return numstr;\\\\n  } else if (tag === \'octstr\') {\\\\n    return buffer.raw();\\\\n  } else if (tag === \'objDesc\') {\\\\n    return buffer.raw();\\\\n  } else if (tag === \'printstr\') {\\\\n    var printstr = buffer.raw().toString(\'ascii\');\\\\n    if (!this._isPrintstr(printstr)) {\\\\n      return buffer.error(\'Decoding of string type: \' +\\\\n                          \'printstr unsupported characters\');\\\\n    }\\\\n    return printstr;\\\\n  } else if (/str$/.test(tag)) {\\\\n    return buffer.raw().toString();\\\\n  } else {\\\\n    return buffer.error(\'Decoding of string type: \' + tag + \' unsupported\');\\\\n  }\\\\n};\\\\n\\\\nDERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {\\\\n  var result;\\\\n  var identifiers = [];\\\\n  var ident = 0;\\\\n  while (!buffer.isEmpty()) {\\\\n    var subident = buffer.readUInt8();\\\\n    ident <<= 7;\\\\n    ident |= subident & 0x7f;\\\\n    if ((subident & 0x80) === 0) {\\\\n      identifiers.push(ident);\\\\n      ident = 0;\\\\n    }\\\\n  }\\\\n  if (subident & 0x80)\\\\n    identifiers.push(ident);\\\\n\\\\n  var first = (identifiers[0] / 40) | 0;\\\\n  var second = identifiers[0] % 40;\\\\n\\\\n  if (relative)\\\\n    result = identifiers;\\\\n  else\\\\n    result = [first, second].concat(identifiers.slice(1));\\\\n\\\\n  if (values) {\\\\n    var tmp = values[result.join(\' \')];\\\\n    if (tmp === undefined)\\\\n      tmp = values[result.join(\'.\')];\\\\n    if (tmp !== undefined)\\\\n      result = tmp;\\\\n  }\\\\n\\\\n  return result;\\\\n};\\\\n\\\\nDERNode.prototype._decodeTime = function decodeTime(buffer, tag) {\\\\n  var str = buffer.raw().toString();\\\\n  if (tag === \'gentime\') {\\\\n    var year = str.slice(0, 4) | 0;\\\\n    var mon = str.slice(4, 6) | 0;\\\\n    var day = str.slice(6, 8) | 0;\\\\n    var hour = str.slice(8, 10) | 0;\\\\n    var min = str.slice(10, 12) | 0;\\\\n    var sec = str.slice(12, 14) | 0;\\\\n  } else if (tag === \'utctime\') {\\\\n    var year = str.slice(0, 2) | 0;\\\\n    var mon = str.slice(2, 4) | 0;\\\\n    var day = str.slice(4, 6) | 0;\\\\n    var hour = str.slice(6, 8) | 0;\\\\n    var min = str.slice(8, 10) | 0;\\\\n    var sec = str.slice(10, 12) | 0;\\\\n    if (year < 70)\\\\n      year = 2000 + year;\\\\n    else\\\\n      year = 1900 + year;\\\\n  } else {\\\\n    return buffer.error(\'Decoding \' + tag + \' time is not supported yet\');\\\\n  }\\\\n\\\\n  return Date.UTC(year, mon - 1, day, hour, min, sec, 0);\\\\n};\\\\n\\\\nDERNode.prototype._decodeNull = function decodeNull(buffer) {\\\\n  return null;\\\\n};\\\\n\\\\nDERNode.prototype._decodeBool = function decodeBool(buffer) {\\\\n  var res = buffer.readUInt8();\\\\n  if (buffer.isError(res))\\\\n    return res;\\\\n  else\\\\n    return res !== 0;\\\\n};\\\\n\\\\nDERNode.prototype._decodeInt = function decodeInt(buffer, values) {\\\\n  // Bigint, return as it is (assume big endian)\\\\n  var raw = buffer.raw();\\\\n  var res = new bignum(raw);\\\\n\\\\n  if (values)\\\\n    res = values[res.toString(10)] || res;\\\\n\\\\n  return res;\\\\n};\\\\n\\\\nDERNode.prototype._use = function use(entity, obj) {\\\\n  if (typeof entity === \'function\')\\\\n    entity = entity(obj);\\\\n  return entity._getDecoder(\'der\').tree;\\\\n};\\\\n\\\\n// Utility methods\\\\n\\\\nfunction derDecodeTag(buf, fail) {\\\\n  var tag = buf.readUInt8(fail);\\\\n  if (buf.isError(tag))\\\\n    return tag;\\\\n\\\\n  var cls = der.tagClass[tag >> 6];\\\\n  var primitive = (tag & 0x20) === 0;\\\\n\\\\n  // Multi-octet tag - load\\\\n  if ((tag & 0x1f) === 0x1f) {\\\\n    var oct = tag;\\\\n    tag = 0;\\\\n    while ((oct & 0x80) === 0x80) {\\\\n      oct = buf.readUInt8(fail);\\\\n      if (buf.isError(oct))\\\\n        return oct;\\\\n\\\\n      tag <<= 7;\\\\n      tag |= oct & 0x7f;\\\\n    }\\\\n  } else {\\\\n    tag &= 0x1f;\\\\n  }\\\\n  var tagStr = der.tag[tag];\\\\n\\\\n  return {\\\\n    cls: cls,\\\\n    primitive: primitive,\\\\n    tag: tag,\\\\n    tagStr: tagStr\\\\n  };\\\\n}\\\\n\\\\nfunction derDecodeLen(buf, primitive, fail) {\\\\n  var len = buf.readUInt8(fail);\\\\n  if (buf.isError(len))\\\\n    return len;\\\\n\\\\n  // Indefinite form\\\\n  if (!primitive && len === 0x80)\\\\n    return null;\\\\n\\\\n  // Definite form\\\\n  if ((len & 0x80) === 0) {\\\\n    // Short form\\\\n    return len;\\\\n  }\\\\n\\\\n  // Long form\\\\n  var num = len & 0x7f;\\\\n  if (num > 4)\\\\n    return buf.error(\'length octect is too long\');\\\\n\\\\n  len = 0;\\\\n  for (var i = 0; i < num; i++) {\\\\n    len <<= 8;\\\\n    var j = buf.readUInt8(fail);\\\\n    if (buf.isError(j))\\\\n      return j;\\\\n    len |= j;\\\\n  }\\\\n\\\\n  return len;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/der.js\\\\n// module id = 141\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/der.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\nvar Buffer = __webpack_require__(1).Buffer;\\\\n\\\\nvar asn1 = __webpack_require__(42);\\\\nvar base = asn1.base;\\\\n\\\\n// Import DER constants\\\\nvar der = asn1.constants.der;\\\\n\\\\nfunction DEREncoder(entity) {\\\\n  this.enc = \'der\';\\\\n  this.name = entity.name;\\\\n  this.entity = entity;\\\\n\\\\n  // Construct base tree\\\\n  this.tree = new DERNode();\\\\n  this.tree._init(entity.body);\\\\n};\\\\nmodule.exports = DEREncoder;\\\\n\\\\nDEREncoder.prototype.encode = function encode(data, reporter) {\\\\n  return this.tree._encode(data, reporter).join();\\\\n};\\\\n\\\\n// Tree methods\\\\n\\\\nfunction DERNode(parent) {\\\\n  base.Node.call(this, \'der\', parent);\\\\n}\\\\ninherits(DERNode, base.Node);\\\\n\\\\nDERNode.prototype._encodeComposite = function encodeComposite(tag,\\\\n                                                              primitive,\\\\n                                                              cls,\\\\n                                                              content) {\\\\n  var encodedTag = encodeTag(tag, primitive, cls, this.reporter);\\\\n\\\\n  // Short form\\\\n  if (content.length < 0x80) {\\\\n    var header = new Buffer(2);\\\\n    header[0] = encodedTag;\\\\n    header[1] = content.length;\\\\n    return this._createEncoderBuffer([ header, content ]);\\\\n  }\\\\n\\\\n  // Long form\\\\n  // Count octets required to store length\\\\n  var lenOctets = 1;\\\\n  for (var i = content.length; i >= 0x100; i >>= 8)\\\\n    lenOctets++;\\\\n\\\\n  var header = new Buffer(1 + 1 + lenOctets);\\\\n  header[0] = encodedTag;\\\\n  header[1] = 0x80 | lenOctets;\\\\n\\\\n  for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8)\\\\n    header[i] = j & 0xff;\\\\n\\\\n  return this._createEncoderBuffer([ header, content ]);\\\\n};\\\\n\\\\nDERNode.prototype._encodeStr = function encodeStr(str, tag) {\\\\n  if (tag === \'bitstr\') {\\\\n    return this._createEncoderBuffer([ str.unused | 0, str.data ]);\\\\n  } else if (tag === \'bmpstr\') {\\\\n    var buf = new Buffer(str.length * 2);\\\\n    for (var i = 0; i < str.length; i++) {\\\\n      buf.writeUInt16BE(str.charCodeAt(i), i * 2);\\\\n    }\\\\n    return this._createEncoderBuffer(buf);\\\\n  } else if (tag === \'numstr\') {\\\\n    if (!this._isNumstr(str)) {\\\\n      return this.reporter.error(\'Encoding of string type: numstr supports \' +\\\\n                                 \'only digits and space\');\\\\n    }\\\\n    return this._createEncoderBuffer(str);\\\\n  } else if (tag === \'printstr\') {\\\\n    if (!this._isPrintstr(str)) {\\\\n      return this.reporter.error(\'Encoding of string type: printstr supports \' +\\\\n                                 \'only latin upper and lower case letters, \' +\\\\n                                 \'digits, space, apostrophe, left and rigth \' +\\\\n                                 \'parenthesis, plus sign, comma, hyphen, \' +\\\\n                                 \'dot, slash, colon, equal sign, \' +\\\\n                                 \'question mark\');\\\\n    }\\\\n    return this._createEncoderBuffer(str);\\\\n  } else if (/str$/.test(tag)) {\\\\n    return this._createEncoderBuffer(str);\\\\n  } else if (tag === \'objDesc\') {\\\\n    return this._createEncoderBuffer(str);\\\\n  } else {\\\\n    return this.reporter.error(\'Encoding of string type: \' + tag +\\\\n                               \' unsupported\');\\\\n  }\\\\n};\\\\n\\\\nDERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {\\\\n  if (typeof id === \'string\') {\\\\n    if (!values)\\\\n      return this.reporter.error(\'string objid given, but no values map found\');\\\\n    if (!values.hasOwnProperty(id))\\\\n      return this.reporter.error(\'objid not found in values map\');\\\\n    id = values[id].split(/[\\\\\\\\s\\\\\\\\.]+/g);\\\\n    for (var i = 0; i < id.length; i++)\\\\n      id[i] |= 0;\\\\n  } else if (Array.isArray(id)) {\\\\n    id = id.slice();\\\\n    for (var i = 0; i < id.length; i++)\\\\n      id[i] |= 0;\\\\n  }\\\\n\\\\n  if (!Array.isArray(id)) {\\\\n    return this.reporter.error(\'objid() should be either array or string, \' +\\\\n                               \'got: \' + JSON.stringify(id));\\\\n  }\\\\n\\\\n  if (!relative) {\\\\n    if (id[1] >= 40)\\\\n      return this.reporter.error(\'Second objid identifier OOB\');\\\\n    id.splice(0, 2, id[0] * 40 + id[1]);\\\\n  }\\\\n\\\\n  // Count number of octets\\\\n  var size = 0;\\\\n  for (var i = 0; i < id.length; i++) {\\\\n    var ident = id[i];\\\\n    for (size++; ident >= 0x80; ident >>= 7)\\\\n      size++;\\\\n  }\\\\n\\\\n  var objid = new Buffer(size);\\\\n  var offset = objid.length - 1;\\\\n  for (var i = id.length - 1; i >= 0; i--) {\\\\n    var ident = id[i];\\\\n    objid[offset--] = ident & 0x7f;\\\\n    while ((ident >>= 7) > 0)\\\\n      objid[offset--] = 0x80 | (ident & 0x7f);\\\\n  }\\\\n\\\\n  return this._createEncoderBuffer(objid);\\\\n};\\\\n\\\\nfunction two(num) {\\\\n  if (num < 10)\\\\n    return \'0\' + num;\\\\n  else\\\\n    return num;\\\\n}\\\\n\\\\nDERNode.prototype._encodeTime = function encodeTime(time, tag) {\\\\n  var str;\\\\n  var date = new Date(time);\\\\n\\\\n  if (tag === \'gentime\') {\\\\n    str = [\\\\n      two(date.getFullYear()),\\\\n      two(date.getUTCMonth() + 1),\\\\n      two(date.getUTCDate()),\\\\n      two(date.getUTCHours()),\\\\n      two(date.getUTCMinutes()),\\\\n      two(date.getUTCSeconds()),\\\\n      \'Z\'\\\\n    ].join(\'\');\\\\n  } else if (tag === \'utctime\') {\\\\n    str = [\\\\n      two(date.getFullYear() % 100),\\\\n      two(date.getUTCMonth() + 1),\\\\n      two(date.getUTCDate()),\\\\n      two(date.getUTCHours()),\\\\n      two(date.getUTCMinutes()),\\\\n      two(date.getUTCSeconds()),\\\\n      \'Z\'\\\\n    ].join(\'\');\\\\n  } else {\\\\n    this.reporter.error(\'Encoding \' + tag + \' time is not supported yet\');\\\\n  }\\\\n\\\\n  return this._encodeStr(str, \'octstr\');\\\\n};\\\\n\\\\nDERNode.prototype._encodeNull = function encodeNull() {\\\\n  return this._createEncoderBuffer(\'\');\\\\n};\\\\n\\\\nDERNode.prototype._encodeInt = function encodeInt(num, values) {\\\\n  if (typeof num === \'string\') {\\\\n    if (!values)\\\\n      return this.reporter.error(\'String int or enum given, but no values map\');\\\\n    if (!values.hasOwnProperty(num)) {\\\\n      return this.reporter.error(\'Values map doesn\\\\\\\\\'t contain: \' +\\\\n                                 JSON.stringify(num));\\\\n    }\\\\n    num = values[num];\\\\n  }\\\\n\\\\n  // Bignum, assume big endian\\\\n  if (typeof num !== \'number\' && !Buffer.isBuffer(num)) {\\\\n    var numArray = num.toArray();\\\\n    if (!num.sign && numArray[0] & 0x80) {\\\\n      numArray.unshift(0);\\\\n    }\\\\n    num = new Buffer(numArray);\\\\n  }\\\\n\\\\n  if (Buffer.isBuffer(num)) {\\\\n    var size = num.length;\\\\n    if (num.length === 0)\\\\n      size++;\\\\n\\\\n    var out = new Buffer(size);\\\\n    num.copy(out);\\\\n    if (num.length === 0)\\\\n      out[0] = 0\\\\n    return this._createEncoderBuffer(out);\\\\n  }\\\\n\\\\n  if (num < 0x80)\\\\n    return this._createEncoderBuffer(num);\\\\n\\\\n  if (num < 0x100)\\\\n    return this._createEncoderBuffer([0, num]);\\\\n\\\\n  var size = 1;\\\\n  for (var i = num; i >= 0x100; i >>= 8)\\\\n    size++;\\\\n\\\\n  var out = new Array(size);\\\\n  for (var i = out.length - 1; i >= 0; i--) {\\\\n    out[i] = num & 0xff;\\\\n    num >>= 8;\\\\n  }\\\\n  if(out[0] & 0x80) {\\\\n    out.unshift(0);\\\\n  }\\\\n\\\\n  return this._createEncoderBuffer(new Buffer(out));\\\\n};\\\\n\\\\nDERNode.prototype._encodeBool = function encodeBool(value) {\\\\n  return this._createEncoderBuffer(value ? 0xff : 0);\\\\n};\\\\n\\\\nDERNode.prototype._use = function use(entity, obj) {\\\\n  if (typeof entity === \'function\')\\\\n    entity = entity(obj);\\\\n  return entity._getEncoder(\'der\').tree;\\\\n};\\\\n\\\\nDERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {\\\\n  var state = this._baseState;\\\\n  var i;\\\\n  if (state[\'default\'] === null)\\\\n    return false;\\\\n\\\\n  var data = dataBuffer.join();\\\\n  if (state.defaultBuffer === undefined)\\\\n    state.defaultBuffer = this._encodeValue(state[\'default\'], reporter, parent).join();\\\\n\\\\n  if (data.length !== state.defaultBuffer.length)\\\\n    return false;\\\\n\\\\n  for (i=0; i < data.length; i++)\\\\n    if (data[i] !== state.defaultBuffer[i])\\\\n      return false;\\\\n\\\\n  return true;\\\\n};\\\\n\\\\n// Utility methods\\\\n\\\\nfunction encodeTag(tag, primitive, cls, reporter) {\\\\n  var res;\\\\n\\\\n  if (tag === \'seqof\')\\\\n    tag = \'seq\';\\\\n  else if (tag === \'setof\')\\\\n    tag = \'set\';\\\\n\\\\n  if (der.tagByName.hasOwnProperty(tag))\\\\n    res = der.tagByName[tag];\\\\n  else if (typeof tag === \'number\' && (tag | 0) === tag)\\\\n    res = tag;\\\\n  else\\\\n    return reporter.error(\'Unknown tag: \' + tag);\\\\n\\\\n  if (res >= 0x1f)\\\\n    return reporter.error(\'Multi-octet tag encoding unsupported\');\\\\n\\\\n  if (!primitive)\\\\n    res |= 0x20;\\\\n\\\\n  res |= (der.tagClassByName[cls || \'universal\'] << 6);\\\\n\\\\n  return res;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/der.js\\\\n// module id = 142\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/der.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(process) {var defaultEncoding\\\\n/* istanbul ignore next */\\\\nif (process.browser) {\\\\n  defaultEncoding = \'utf-8\'\\\\n} else {\\\\n  var pVersionMajor = parseInt(process.version.split(\'.\')[0].slice(1), 10)\\\\n\\\\n  defaultEncoding = pVersionMajor >= 6 ? \'utf-8\' : \'binary\'\\\\n}\\\\nmodule.exports = defaultEncoding\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/pbkdf2/lib/default-encoding.js\\\\n// module id = 143\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/pbkdf2/lib/default-encoding.js\\")},function(module,exports){eval(\\"var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs\\\\nmodule.exports = function (iterations, keylen) {\\\\n  if (typeof iterations !== \'number\') {\\\\n    throw new TypeError(\'Iterations not a number\')\\\\n  }\\\\n\\\\n  if (iterations < 0) {\\\\n    throw new TypeError(\'Bad iterations\')\\\\n  }\\\\n\\\\n  if (typeof keylen !== \'number\') {\\\\n    throw new TypeError(\'Key length not a number\')\\\\n  }\\\\n\\\\n  if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) { /* eslint no-self-compare: 0 */\\\\n    throw new TypeError(\'Bad key length\')\\\\n  }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/pbkdf2/lib/precondition.js\\\\n// module id = 144\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/pbkdf2/lib/precondition.js\\")},function(module,exports,__webpack_require__){eval(\\"var md5 = __webpack_require__(82)\\\\nvar rmd160 = __webpack_require__(89)\\\\nvar sha = __webpack_require__(90)\\\\n\\\\nvar checkParameters = __webpack_require__(144)\\\\nvar defaultEncoding = __webpack_require__(143)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar ZEROS = Buffer.alloc(128)\\\\nvar sizes = {\\\\n  md5: 16,\\\\n  sha1: 20,\\\\n  sha224: 28,\\\\n  sha256: 32,\\\\n  sha384: 48,\\\\n  sha512: 64,\\\\n  rmd160: 20,\\\\n  ripemd160: 20\\\\n}\\\\n\\\\nfunction Hmac (alg, key, saltLen) {\\\\n  var hash = getDigest(alg)\\\\n  var blocksize = (alg === \'sha512\' || alg === \'sha384\') ? 128 : 64\\\\n\\\\n  if (key.length > blocksize) {\\\\n    key = hash(key)\\\\n  } else if (key.length < blocksize) {\\\\n    key = Buffer.concat([key, ZEROS], blocksize)\\\\n  }\\\\n\\\\n  var ipad = Buffer.allocUnsafe(blocksize + sizes[alg])\\\\n  var opad = Buffer.allocUnsafe(blocksize + sizes[alg])\\\\n  for (var i = 0; i < blocksize; i++) {\\\\n    ipad[i] = key[i] ^ 0x36\\\\n    opad[i] = key[i] ^ 0x5C\\\\n  }\\\\n\\\\n  var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4)\\\\n  ipad.copy(ipad1, 0, 0, blocksize)\\\\n  this.ipad1 = ipad1\\\\n  this.ipad2 = ipad\\\\n  this.opad = opad\\\\n  this.alg = alg\\\\n  this.blocksize = blocksize\\\\n  this.hash = hash\\\\n  this.size = sizes[alg]\\\\n}\\\\n\\\\nHmac.prototype.run = function (data, ipad) {\\\\n  data.copy(ipad, this.blocksize)\\\\n  var h = this.hash(ipad)\\\\n  h.copy(this.opad, this.blocksize)\\\\n  return this.hash(this.opad)\\\\n}\\\\n\\\\nfunction getDigest (alg) {\\\\n  function shaFunc (data) {\\\\n    return sha(alg).update(data).digest()\\\\n  }\\\\n\\\\n  if (alg === \'rmd160\' || alg === \'ripemd160\') return rmd160\\\\n  if (alg === \'md5\') return md5\\\\n  return shaFunc\\\\n}\\\\n\\\\nfunction pbkdf2 (password, salt, iterations, keylen, digest) {\\\\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\\\\n  if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\\\\n\\\\n  checkParameters(iterations, keylen)\\\\n\\\\n  digest = digest || \'sha1\'\\\\n\\\\n  var hmac = new Hmac(digest, password, salt.length)\\\\n\\\\n  var DK = Buffer.allocUnsafe(keylen)\\\\n  var block1 = Buffer.allocUnsafe(salt.length + 4)\\\\n  salt.copy(block1, 0, 0, salt.length)\\\\n\\\\n  var destPos = 0\\\\n  var hLen = sizes[digest]\\\\n  var l = Math.ceil(keylen / hLen)\\\\n\\\\n  for (var i = 1; i <= l; i++) {\\\\n    block1.writeUInt32BE(i, salt.length)\\\\n\\\\n    var T = hmac.run(block1, hmac.ipad1)\\\\n    var U = T\\\\n\\\\n    for (var j = 1; j < iterations; j++) {\\\\n      U = hmac.run(U, hmac.ipad2)\\\\n      for (var k = 0; k < hLen; k++) T[k] ^= U[k]\\\\n    }\\\\n\\\\n    T.copy(DK, destPos)\\\\n    destPos += hLen\\\\n  }\\\\n\\\\n  return DK\\\\n}\\\\n\\\\nmodule.exports = pbkdf2\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/pbkdf2/lib/sync-browser.js\\\\n// module id = 145\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/pbkdf2/lib/sync-browser.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(39);\\\\nmodule.exports = function (seed, len) {\\\\n  var t = new Buffer(\'\');\\\\n  var  i = 0, c;\\\\n  while (t.length < len) {\\\\n    c = i2ops(i++);\\\\n    t = Buffer.concat([t, createHash(\'sha1\').update(seed).update(c).digest()]);\\\\n  }\\\\n  return t.slice(0, len);\\\\n};\\\\n\\\\nfunction i2ops(c) {\\\\n  var out = new Buffer(4);\\\\n  out.writeUInt32BE(c,0);\\\\n  return out;\\\\n}\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/mgf.js\\\\n// module id = 146\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/mgf.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var bn = __webpack_require__(3);\\\\nfunction withPublic(paddedMsg, key) {\\\\n  return new Buffer(paddedMsg\\\\n    .toRed(bn.mont(key.modulus))\\\\n    .redPow(new bn(key.publicExponent))\\\\n    .fromRed()\\\\n    .toArray());\\\\n}\\\\n\\\\nmodule.exports = withPublic;\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/withPublic.js\\\\n// module id = 147\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/withPublic.js\\")},function(module,exports){eval(\\"module.exports = function xor(a, b) {\\\\n  var len = a.length;\\\\n  var i = -1;\\\\n  while (++i < len) {\\\\n    a[i] ^= b[i];\\\\n  }\\\\n  return a\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/xor.js\\\\n// module id = 148\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/xor.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar processNextTick = __webpack_require__(55).nextTick;\\\\n/*</replacement>*/\\\\n\\\\nmodule.exports = Readable;\\\\n\\\\n/*<replacement>*/\\\\nvar isArray = __webpack_require__(134);\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar Duplex;\\\\n/*</replacement>*/\\\\n\\\\nReadable.ReadableState = ReadableState;\\\\n\\\\n/*<replacement>*/\\\\nvar EE = __webpack_require__(84).EventEmitter;\\\\n\\\\nvar EElistenerCount = function (emitter, type) {\\\\n  return emitter.listeners(type).length;\\\\n};\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar Stream = __webpack_require__(152);\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer;\\\\nvar OurUint8Array = global.Uint8Array || function () {};\\\\nfunction _uint8ArrayToBuffer(chunk) {\\\\n  return Buffer.from(chunk);\\\\n}\\\\nfunction _isUint8Array(obj) {\\\\n  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;\\\\n}\\\\n\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar util = __webpack_require__(38);\\\\nutil.inherits = __webpack_require__(0);\\\\n/*</replacement>*/\\\\n\\\\n/*<replacement>*/\\\\nvar debugUtil = __webpack_require__(379);\\\\nvar debug = void 0;\\\\nif (debugUtil && debugUtil.debuglog) {\\\\n  debug = debugUtil.debuglog(\'stream\');\\\\n} else {\\\\n  debug = function () {};\\\\n}\\\\n/*</replacement>*/\\\\n\\\\nvar BufferList = __webpack_require__(310);\\\\nvar destroyImpl = __webpack_require__(151);\\\\nvar StringDecoder;\\\\n\\\\nutil.inherits(Readable, Stream);\\\\n\\\\nvar kProxyEvents = [\'error\', \'close\', \'destroy\', \'pause\', \'resume\'];\\\\n\\\\nfunction prependListener(emitter, event, fn) {\\\\n  // Sadly this is not cacheable as some libraries bundle their own\\\\n  // event emitter implementation with them.\\\\n  if (typeof emitter.prependListener === \'function\') return emitter.prependListener(event, fn);\\\\n\\\\n  // This is a hack to make sure that our error handler is attached before any\\\\n  // userland ones.  NEVER DO THIS. This is here only because this code needs\\\\n  // to continue to work with older versions of Node.js that do not include\\\\n  // the prependListener() method. The goal is to eventually remove this hack.\\\\n  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];\\\\n}\\\\n\\\\nfunction ReadableState(options, stream) {\\\\n  Duplex = Duplex || __webpack_require__(24);\\\\n\\\\n  options = options || {};\\\\n\\\\n  // Duplex streams are both readable and writable, but share\\\\n  // the same options object.\\\\n  // However, some cases require setting options to different\\\\n  // values for the readable and the writable sides of the duplex stream.\\\\n  // These options can be provided separately as readableXXX and writableXXX.\\\\n  var isDuplex = stream instanceof Duplex;\\\\n\\\\n  // object stream flag. Used to make read(n) ignore n and to\\\\n  // make all the buffer merging and length checks go away\\\\n  this.objectMode = !!options.objectMode;\\\\n\\\\n  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;\\\\n\\\\n  // the point at which it stops calling _read() to fill the buffer\\\\n  // Note: 0 is a valid value, means \\\\\\"don\'t call _read preemptively ever\\\\\\"\\\\n  var hwm = options.highWaterMark;\\\\n  var readableHwm = options.readableHighWaterMark;\\\\n  var defaultHwm = this.objectMode ? 16 : 16 * 1024;\\\\n\\\\n  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;\\\\n\\\\n  // cast to ints.\\\\n  this.highWaterMark = Math.floor(this.highWaterMark);\\\\n\\\\n  // A linked list is used to store data chunks instead of an array because the\\\\n  // linked list can remove elements from the beginning faster than\\\\n  // array.shift()\\\\n  this.buffer = new BufferList();\\\\n  this.length = 0;\\\\n  this.pipes = null;\\\\n  this.pipesCount = 0;\\\\n  this.flowing = null;\\\\n  this.ended = false;\\\\n  this.endEmitted = false;\\\\n  this.reading = false;\\\\n\\\\n  // a flag to be able to tell if the event \'readable\'/\'data\' is emitted\\\\n  // immediately, or on a later tick.  We set this to true at first, because\\\\n  // any actions that shouldn\'t happen until \\\\\\"later\\\\\\" should generally also\\\\n  // not happen before the first read call.\\\\n  this.sync = true;\\\\n\\\\n  // whenever we return null, then we set a flag to say\\\\n  // that we\'re awaiting a \'readable\' event emission.\\\\n  this.needReadable = false;\\\\n  this.emittedReadable = false;\\\\n  this.readableListening = false;\\\\n  this.resumeScheduled = false;\\\\n\\\\n  // has it been destroyed\\\\n  this.destroyed = false;\\\\n\\\\n  // Crypto is kind of old and crusty.  Historically, its default string\\\\n  // encoding is \'binary\' so we have to make this configurable.\\\\n  // Everything else in the universe uses \'utf8\', though.\\\\n  this.defaultEncoding = options.defaultEncoding || \'utf8\';\\\\n\\\\n  // the number of writers that are awaiting a drain event in .pipe()s\\\\n  this.awaitDrain = 0;\\\\n\\\\n  // if true, a maybeReadMore has been scheduled\\\\n  this.readingMore = false;\\\\n\\\\n  this.decoder = null;\\\\n  this.encoding = null;\\\\n  if (options.encoding) {\\\\n    if (!StringDecoder) StringDecoder = __webpack_require__(91).StringDecoder;\\\\n    this.decoder = new StringDecoder(options.encoding);\\\\n    this.encoding = options.encoding;\\\\n  }\\\\n}\\\\n\\\\nfunction Readable(options) {\\\\n  Duplex = Duplex || __webpack_require__(24);\\\\n\\\\n  if (!(this instanceof Readable)) return new Readable(options);\\\\n\\\\n  this._readableState = new ReadableState(options, this);\\\\n\\\\n  // legacy\\\\n  this.readable = true;\\\\n\\\\n  if (options) {\\\\n    if (typeof options.read === \'function\') this._read = options.read;\\\\n\\\\n    if (typeof options.destroy === \'function\') this._destroy = options.destroy;\\\\n  }\\\\n\\\\n  Stream.call(this);\\\\n}\\\\n\\\\nObject.defineProperty(Readable.prototype, \'destroyed\', {\\\\n  get: function () {\\\\n    if (this._readableState === undefined) {\\\\n      return false;\\\\n    }\\\\n    return this._readableState.destroyed;\\\\n  },\\\\n  set: function (value) {\\\\n    // we ignore the value if the stream\\\\n    // has not been initialized yet\\\\n    if (!this._readableState) {\\\\n      return;\\\\n    }\\\\n\\\\n    // backward compatibility, the user is explicitly\\\\n    // managing destroyed\\\\n    this._readableState.destroyed = value;\\\\n  }\\\\n});\\\\n\\\\nReadable.prototype.destroy = destroyImpl.destroy;\\\\nReadable.prototype._undestroy = destroyImpl.undestroy;\\\\nReadable.prototype._destroy = function (err, cb) {\\\\n  this.push(null);\\\\n  cb(err);\\\\n};\\\\n\\\\n// Manually shove something into the read() buffer.\\\\n// This returns true if the highWaterMark has not been hit yet,\\\\n// similar to how Writable.write() returns true if you should\\\\n// write() some more.\\\\nReadable.prototype.push = function (chunk, encoding) {\\\\n  var state = this._readableState;\\\\n  var skipChunkCheck;\\\\n\\\\n  if (!state.objectMode) {\\\\n    if (typeof chunk === \'string\') {\\\\n      encoding = encoding || state.defaultEncoding;\\\\n      if (encoding !== state.encoding) {\\\\n        chunk = Buffer.from(chunk, encoding);\\\\n        encoding = \'\';\\\\n      }\\\\n      skipChunkCheck = true;\\\\n    }\\\\n  } else {\\\\n    skipChunkCheck = true;\\\\n  }\\\\n\\\\n  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);\\\\n};\\\\n\\\\n// Unshift should *always* be something directly out of read()\\\\nReadable.prototype.unshift = function (chunk) {\\\\n  return readableAddChunk(this, chunk, null, true, false);\\\\n};\\\\n\\\\nfunction readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {\\\\n  var state = stream._readableState;\\\\n  if (chunk === null) {\\\\n    state.reading = false;\\\\n    onEofChunk(stream, state);\\\\n  } else {\\\\n    var er;\\\\n    if (!skipChunkCheck) er = chunkInvalid(state, chunk);\\\\n    if (er) {\\\\n      stream.emit(\'error\', er);\\\\n    } else if (state.objectMode || chunk && chunk.length > 0) {\\\\n      if (typeof chunk !== \'string\' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {\\\\n        chunk = _uint8ArrayToBuffer(chunk);\\\\n      }\\\\n\\\\n      if (addToFront) {\\\\n        if (state.endEmitted) stream.emit(\'error\', new Error(\'stream.unshift() after end event\'));else addChunk(stream, state, chunk, true);\\\\n      } else if (state.ended) {\\\\n        stream.emit(\'error\', new Error(\'stream.push() after EOF\'));\\\\n      } else {\\\\n        state.reading = false;\\\\n        if (state.decoder && !encoding) {\\\\n          chunk = state.decoder.write(chunk);\\\\n          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);\\\\n        } else {\\\\n          addChunk(stream, state, chunk, false);\\\\n        }\\\\n      }\\\\n    } else if (!addToFront) {\\\\n      state.reading = false;\\\\n    }\\\\n  }\\\\n\\\\n  return needMoreData(state);\\\\n}\\\\n\\\\nfunction addChunk(stream, state, chunk, addToFront) {\\\\n  if (state.flowing && state.length === 0 && !state.sync) {\\\\n    stream.emit(\'data\', chunk);\\\\n    stream.read(0);\\\\n  } else {\\\\n    // update the buffer info.\\\\n    state.length += state.objectMode ? 1 : chunk.length;\\\\n    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);\\\\n\\\\n    if (state.needReadable) emitReadable(stream);\\\\n  }\\\\n  maybeReadMore(stream, state);\\\\n}\\\\n\\\\nfunction chunkInvalid(state, chunk) {\\\\n  var er;\\\\n  if (!_isUint8Array(chunk) && typeof chunk !== \'string\' && chunk !== undefined && !state.objectMode) {\\\\n    er = new TypeError(\'Invalid non-string/buffer chunk\');\\\\n  }\\\\n  return er;\\\\n}\\\\n\\\\n// if it\'s past the high water mark, we can push in some more.\\\\n// Also, if we have no data yet, we can stand some\\\\n// more bytes.  This is to work around cases where hwm=0,\\\\n// such as the repl.  Also, if the push() triggered a\\\\n// readable event, and the user called read(largeNumber) such that\\\\n// needReadable was set, then we ought to push more, so that another\\\\n// \'readable\' event will be triggered.\\\\nfunction needMoreData(state) {\\\\n  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);\\\\n}\\\\n\\\\nReadable.prototype.isPaused = function () {\\\\n  return this._readableState.flowing === false;\\\\n};\\\\n\\\\n// backwards compatibility.\\\\nReadable.prototype.setEncoding = function (enc) {\\\\n  if (!StringDecoder) StringDecoder = __webpack_require__(91).StringDecoder;\\\\n  this._readableState.decoder = new StringDecoder(enc);\\\\n  this._readableState.encoding = enc;\\\\n  return this;\\\\n};\\\\n\\\\n// Don\'t raise the hwm > 8MB\\\\nvar MAX_HWM = 0x800000;\\\\nfunction computeNewHighWaterMark(n) {\\\\n  if (n >= MAX_HWM) {\\\\n    n = MAX_HWM;\\\\n  } else {\\\\n    // Get the next highest power of 2 to prevent increasing hwm excessively in\\\\n    // tiny amounts\\\\n    n--;\\\\n    n |= n >>> 1;\\\\n    n |= n >>> 2;\\\\n    n |= n >>> 4;\\\\n    n |= n >>> 8;\\\\n    n |= n >>> 16;\\\\n    n++;\\\\n  }\\\\n  return n;\\\\n}\\\\n\\\\n// This function is designed to be inlinable, so please take care when making\\\\n// changes to the function body.\\\\nfunction howMuchToRead(n, state) {\\\\n  if (n <= 0 || state.length === 0 && state.ended) return 0;\\\\n  if (state.objectMode) return 1;\\\\n  if (n !== n) {\\\\n    // Only flow one buffer at a time\\\\n    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;\\\\n  }\\\\n  // If we\'re asking for more than the current hwm, then raise the hwm.\\\\n  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);\\\\n  if (n <= state.length) return n;\\\\n  // Don\'t have enough\\\\n  if (!state.ended) {\\\\n    state.needReadable = true;\\\\n    return 0;\\\\n  }\\\\n  return state.length;\\\\n}\\\\n\\\\n// you can override either this method, or the async _read(n) below.\\\\nReadable.prototype.read = function (n) {\\\\n  debug(\'read\', n);\\\\n  n = parseInt(n, 10);\\\\n  var state = this._readableState;\\\\n  var nOrig = n;\\\\n\\\\n  if (n !== 0) state.emittedReadable = false;\\\\n\\\\n  // if we\'re doing read(0) to trigger a readable event, but we\\\\n  // already have a bunch of data in the buffer, then just trigger\\\\n  // the \'readable\' event and move on.\\\\n  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {\\\\n    debug(\'read: emitReadable\', state.length, state.ended);\\\\n    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);\\\\n    return null;\\\\n  }\\\\n\\\\n  n = howMuchToRead(n, state);\\\\n\\\\n  // if we\'ve ended, and we\'re now clear, then finish it up.\\\\n  if (n === 0 && state.ended) {\\\\n    if (state.length === 0) endReadable(this);\\\\n    return null;\\\\n  }\\\\n\\\\n  // All the actual chunk generation logic needs to be\\\\n  // *below* the call to _read.  The reason is that in certain\\\\n  // synthetic stream cases, such as passthrough streams, _read\\\\n  // may be a completely synchronous operation which may change\\\\n  // the state of the read buffer, providing enough data when\\\\n  // before there was *not* enough.\\\\n  //\\\\n  // So, the steps are:\\\\n  // 1. Figure out what the state of things will be after we do\\\\n  // a read from the buffer.\\\\n  //\\\\n  // 2. If that resulting state will trigger a _read, then call _read.\\\\n  // Note that this may be asynchronous, or synchronous.  Yes, it is\\\\n  // deeply ugly to write APIs this way, but that still doesn\'t mean\\\\n  // that the Readable class should behave improperly, as streams are\\\\n  // designed to be sync/async agnostic.\\\\n  // Take note if the _read call is sync or async (ie, if the read call\\\\n  // has returned yet), so that we know whether or not it\'s safe to emit\\\\n  // \'readable\' etc.\\\\n  //\\\\n  // 3. Actually pull the requested chunks out of the buffer and return.\\\\n\\\\n  // if we need a readable event, then we need to do some reading.\\\\n  var doRead = state.needReadable;\\\\n  debug(\'need readable\', doRead);\\\\n\\\\n  // if we currently have less than the highWaterMark, then also read some\\\\n  if (state.length === 0 || state.length - n < state.highWaterMark) {\\\\n    doRead = true;\\\\n    debug(\'length less than watermark\', doRead);\\\\n  }\\\\n\\\\n  // however, if we\'ve ended, then there\'s no point, and if we\'re already\\\\n  // reading, then it\'s unnecessary.\\\\n  if (state.ended || state.reading) {\\\\n    doRead = false;\\\\n    debug(\'reading or ended\', doRead);\\\\n  } else if (doRead) {\\\\n    debug(\'do read\');\\\\n    state.reading = true;\\\\n    state.sync = true;\\\\n    // if the length is currently zero, then we *need* a readable event.\\\\n    if (state.length === 0) state.needReadable = true;\\\\n    // call internal read method\\\\n    this._read(state.highWaterMark);\\\\n    state.sync = false;\\\\n    // If _read pushed data synchronously, then `reading` will be false,\\\\n    // and we need to re-evaluate how much data we can return to the user.\\\\n    if (!state.reading) n = howMuchToRead(nOrig, state);\\\\n  }\\\\n\\\\n  var ret;\\\\n  if (n > 0) ret = fromList(n, state);else ret = null;\\\\n\\\\n  if (ret === null) {\\\\n    state.needReadable = true;\\\\n    n = 0;\\\\n  } else {\\\\n    state.length -= n;\\\\n  }\\\\n\\\\n  if (state.length === 0) {\\\\n    // If we have nothing in the buffer, then we want to know\\\\n    // as soon as we *do* get something into the buffer.\\\\n    if (!state.ended) state.needReadable = true;\\\\n\\\\n    // If we tried to read() past the EOF, then emit end on the next tick.\\\\n    if (nOrig !== n && state.ended) endReadable(this);\\\\n  }\\\\n\\\\n  if (ret !== null) this.emit(\'data\', ret);\\\\n\\\\n  return ret;\\\\n};\\\\n\\\\nfunction onEofChunk(stream, state) {\\\\n  if (state.ended) return;\\\\n  if (state.decoder) {\\\\n    var chunk = state.decoder.end();\\\\n    if (chunk && chunk.length) {\\\\n      state.buffer.push(chunk);\\\\n      state.length += state.objectMode ? 1 : chunk.length;\\\\n    }\\\\n  }\\\\n  state.ended = true;\\\\n\\\\n  // emit \'readable\' now to make sure it gets picked up.\\\\n  emitReadable(stream);\\\\n}\\\\n\\\\n// Don\'t emit readable right away in sync mode, because this can trigger\\\\n// another read() call => stack overflow.  This way, it might trigger\\\\n// a nextTick recursion warning, but that\'s not so bad.\\\\nfunction emitReadable(stream) {\\\\n  var state = stream._readableState;\\\\n  state.needReadable = false;\\\\n  if (!state.emittedReadable) {\\\\n    debug(\'emitReadable\', state.flowing);\\\\n    state.emittedReadable = true;\\\\n    if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);\\\\n  }\\\\n}\\\\n\\\\nfunction emitReadable_(stream) {\\\\n  debug(\'emit readable\');\\\\n  stream.emit(\'readable\');\\\\n  flow(stream);\\\\n}\\\\n\\\\n// at this point, the user has presumably seen the \'readable\' event,\\\\n// and called read() to consume some data.  that may have triggered\\\\n// in turn another _read(n) call, in which case reading = true if\\\\n// it\'s in progress.\\\\n// However, if we\'re not ended, or reading, and the length < hwm,\\\\n// then go ahead and try to read some more preemptively.\\\\nfunction maybeReadMore(stream, state) {\\\\n  if (!state.readingMore) {\\\\n    state.readingMore = true;\\\\n    processNextTick(maybeReadMore_, stream, state);\\\\n  }\\\\n}\\\\n\\\\nfunction maybeReadMore_(stream, state) {\\\\n  var len = state.length;\\\\n  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {\\\\n    debug(\'maybeReadMore read 0\');\\\\n    stream.read(0);\\\\n    if (len === state.length)\\\\n      // didn\'t get any data, stop spinning.\\\\n      break;else len = state.length;\\\\n  }\\\\n  state.readingMore = false;\\\\n}\\\\n\\\\n// abstract method.  to be overridden in specific implementation classes.\\\\n// call cb(er, data) where data is <= n in length.\\\\n// for virtual (non-string, non-buffer) streams, \\\\\\"length\\\\\\" is somewhat\\\\n// arbitrary, and perhaps not very meaningful.\\\\nReadable.prototype._read = function (n) {\\\\n  this.emit(\'error\', new Error(\'_read() is not implemented\'));\\\\n};\\\\n\\\\nReadable.prototype.pipe = function (dest, pipeOpts) {\\\\n  var src = this;\\\\n  var state = this._readableState;\\\\n\\\\n  switch (state.pipesCount) {\\\\n    case 0:\\\\n      state.pipes = dest;\\\\n      break;\\\\n    case 1:\\\\n      state.pipes = [state.pipes, dest];\\\\n      break;\\\\n    default:\\\\n      state.pipes.push(dest);\\\\n      break;\\\\n  }\\\\n  state.pipesCount += 1;\\\\n  debug(\'pipe count=%d opts=%j\', state.pipesCount, pipeOpts);\\\\n\\\\n  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;\\\\n\\\\n  var endFn = doEnd ? onend : unpipe;\\\\n  if (state.endEmitted) processNextTick(endFn);else src.once(\'end\', endFn);\\\\n\\\\n  dest.on(\'unpipe\', onunpipe);\\\\n  function onunpipe(readable, unpipeInfo) {\\\\n    debug(\'onunpipe\');\\\\n    if (readable === src) {\\\\n      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {\\\\n        unpipeInfo.hasUnpiped = true;\\\\n        cleanup();\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  function onend() {\\\\n    debug(\'onend\');\\\\n    dest.end();\\\\n  }\\\\n\\\\n  // when the dest drains, it reduces the awaitDrain counter\\\\n  // on the source.  This would be more elegant with a .once()\\\\n  // handler in flow(), but adding and removing repeatedly is\\\\n  // too slow.\\\\n  var ondrain = pipeOnDrain(src);\\\\n  dest.on(\'drain\', ondrain);\\\\n\\\\n  var cleanedUp = false;\\\\n  function cleanup() {\\\\n    debug(\'cleanup\');\\\\n    // cleanup event handlers once the pipe is broken\\\\n    dest.removeListener(\'close\', onclose);\\\\n    dest.removeListener(\'finish\', onfinish);\\\\n    dest.removeListener(\'drain\', ondrain);\\\\n    dest.removeListener(\'error\', onerror);\\\\n    dest.removeListener(\'unpipe\', onunpipe);\\\\n    src.removeListener(\'end\', onend);\\\\n    src.removeListener(\'end\', unpipe);\\\\n    src.removeListener(\'data\', ondata);\\\\n\\\\n    cleanedUp = true;\\\\n\\\\n    // if the reader is waiting for a drain event from this\\\\n    // specific writer, then it would cause it to never start\\\\n    // flowing again.\\\\n    // So, if this is awaiting a drain, then we just call it now.\\\\n    // If we don\'t know, then assume that we are waiting for one.\\\\n    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();\\\\n  }\\\\n\\\\n  // If the user pushes more data while we\'re writing to dest then we\'ll end up\\\\n  // in ondata again. However, we only want to increase awaitDrain once because\\\\n  // dest will only emit one \'drain\' event for the multiple writes.\\\\n  // => Introduce a guard on increasing awaitDrain.\\\\n  var increasedAwaitDrain = false;\\\\n  src.on(\'data\', ondata);\\\\n  function ondata(chunk) {\\\\n    debug(\'ondata\');\\\\n    increasedAwaitDrain = false;\\\\n    var ret = dest.write(chunk);\\\\n    if (false === ret && !increasedAwaitDrain) {\\\\n      // If the user unpiped during `dest.write()`, it is possible\\\\n      // to get stuck in a permanently paused state if that write\\\\n      // also returned false.\\\\n      // => Check whether `dest` is still a piping destination.\\\\n      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {\\\\n        debug(\'false write response, pause\', src._readableState.awaitDrain);\\\\n        src._readableState.awaitDrain++;\\\\n        increasedAwaitDrain = true;\\\\n      }\\\\n      src.pause();\\\\n    }\\\\n  }\\\\n\\\\n  // if the dest has an error, then stop piping into it.\\\\n  // however, don\'t suppress the throwing behavior for this.\\\\n  function onerror(er) {\\\\n    debug(\'onerror\', er);\\\\n    unpipe();\\\\n    dest.removeListener(\'error\', onerror);\\\\n    if (EElistenerCount(dest, \'error\') === 0) dest.emit(\'error\', er);\\\\n  }\\\\n\\\\n  // Make sure our error handler is attached before userland ones.\\\\n  prependListener(dest, \'error\', onerror);\\\\n\\\\n  // Both close and finish should trigger unpipe, but only once.\\\\n  function onclose() {\\\\n    dest.removeListener(\'finish\', onfinish);\\\\n    unpipe();\\\\n  }\\\\n  dest.once(\'close\', onclose);\\\\n  function onfinish() {\\\\n    debug(\'onfinish\');\\\\n    dest.removeListener(\'close\', onclose);\\\\n    unpipe();\\\\n  }\\\\n  dest.once(\'finish\', onfinish);\\\\n\\\\n  function unpipe() {\\\\n    debug(\'unpipe\');\\\\n    src.unpipe(dest);\\\\n  }\\\\n\\\\n  // tell the dest that it\'s being piped to\\\\n  dest.emit(\'pipe\', src);\\\\n\\\\n  // start the flow if it hasn\'t been started already.\\\\n  if (!state.flowing) {\\\\n    debug(\'pipe resume\');\\\\n    src.resume();\\\\n  }\\\\n\\\\n  return dest;\\\\n};\\\\n\\\\nfunction pipeOnDrain(src) {\\\\n  return function () {\\\\n    var state = src._readableState;\\\\n    debug(\'pipeOnDrain\', state.awaitDrain);\\\\n    if (state.awaitDrain) state.awaitDrain--;\\\\n    if (state.awaitDrain === 0 && EElistenerCount(src, \'data\')) {\\\\n      state.flowing = true;\\\\n      flow(src);\\\\n    }\\\\n  };\\\\n}\\\\n\\\\nReadable.prototype.unpipe = function (dest) {\\\\n  var state = this._readableState;\\\\n  var unpipeInfo = { hasUnpiped: false };\\\\n\\\\n  // if we\'re not piping anywhere, then do nothing.\\\\n  if (state.pipesCount === 0) return this;\\\\n\\\\n  // just one destination.  most common case.\\\\n  if (state.pipesCount === 1) {\\\\n    // passed in one, but it\'s not the right one.\\\\n    if (dest && dest !== state.pipes) return this;\\\\n\\\\n    if (!dest) dest = state.pipes;\\\\n\\\\n    // got a match.\\\\n    state.pipes = null;\\\\n    state.pipesCount = 0;\\\\n    state.flowing = false;\\\\n    if (dest) dest.emit(\'unpipe\', this, unpipeInfo);\\\\n    return this;\\\\n  }\\\\n\\\\n  // slow case. multiple pipe destinations.\\\\n\\\\n  if (!dest) {\\\\n    // remove all.\\\\n    var dests = state.pipes;\\\\n    var len = state.pipesCount;\\\\n    state.pipes = null;\\\\n    state.pipesCount = 0;\\\\n    state.flowing = false;\\\\n\\\\n    for (var i = 0; i < len; i++) {\\\\n      dests[i].emit(\'unpipe\', this, unpipeInfo);\\\\n    }return this;\\\\n  }\\\\n\\\\n  // try to find the right one.\\\\n  var index = indexOf(state.pipes, dest);\\\\n  if (index === -1) return this;\\\\n\\\\n  state.pipes.splice(index, 1);\\\\n  state.pipesCount -= 1;\\\\n  if (state.pipesCount === 1) state.pipes = state.pipes[0];\\\\n\\\\n  dest.emit(\'unpipe\', this, unpipeInfo);\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n// set up data events if they are asked for\\\\n// Ensure readable listeners eventually get something\\\\nReadable.prototype.on = function (ev, fn) {\\\\n  var res = Stream.prototype.on.call(this, ev, fn);\\\\n\\\\n  if (ev === \'data\') {\\\\n    // Start flowing on next tick if stream isn\'t explicitly paused\\\\n    if (this._readableState.flowing !== false) this.resume();\\\\n  } else if (ev === \'readable\') {\\\\n    var state = this._readableState;\\\\n    if (!state.endEmitted && !state.readableListening) {\\\\n      state.readableListening = state.needReadable = true;\\\\n      state.emittedReadable = false;\\\\n      if (!state.reading) {\\\\n        processNextTick(nReadingNextTick, this);\\\\n      } else if (state.length) {\\\\n        emitReadable(this);\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  return res;\\\\n};\\\\nReadable.prototype.addListener = Readable.prototype.on;\\\\n\\\\nfunction nReadingNextTick(self) {\\\\n  debug(\'readable nexttick read 0\');\\\\n  self.read(0);\\\\n}\\\\n\\\\n// pause() and resume() are remnants of the legacy readable stream API\\\\n// If the user uses them, then switch into old mode.\\\\nReadable.prototype.resume = function () {\\\\n  var state = this._readableState;\\\\n  if (!state.flowing) {\\\\n    debug(\'resume\');\\\\n    state.flowing = true;\\\\n    resume(this, state);\\\\n  }\\\\n  return this;\\\\n};\\\\n\\\\nfunction resume(stream, state) {\\\\n  if (!state.resumeScheduled) {\\\\n    state.resumeScheduled = true;\\\\n    processNextTick(resume_, stream, state);\\\\n  }\\\\n}\\\\n\\\\nfunction resume_(stream, state) {\\\\n  if (!state.reading) {\\\\n    debug(\'resume read 0\');\\\\n    stream.read(0);\\\\n  }\\\\n\\\\n  state.resumeScheduled = false;\\\\n  state.awaitDrain = 0;\\\\n  stream.emit(\'resume\');\\\\n  flow(stream);\\\\n  if (state.flowing && !state.reading) stream.read(0);\\\\n}\\\\n\\\\nReadable.prototype.pause = function () {\\\\n  debug(\'call pause flowing=%j\', this._readableState.flowing);\\\\n  if (false !== this._readableState.flowing) {\\\\n    debug(\'pause\');\\\\n    this._readableState.flowing = false;\\\\n    this.emit(\'pause\');\\\\n  }\\\\n  return this;\\\\n};\\\\n\\\\nfunction flow(stream) {\\\\n  var state = stream._readableState;\\\\n  debug(\'flow\', state.flowing);\\\\n  while (state.flowing && stream.read() !== null) {}\\\\n}\\\\n\\\\n// wrap an old-style stream as the async data source.\\\\n// This is *not* part of the readable stream interface.\\\\n// It is an ugly unfortunate mess of history.\\\\nReadable.prototype.wrap = function (stream) {\\\\n  var _this = this;\\\\n\\\\n  var state = this._readableState;\\\\n  var paused = false;\\\\n\\\\n  stream.on(\'end\', function () {\\\\n    debug(\'wrapped end\');\\\\n    if (state.decoder && !state.ended) {\\\\n      var chunk = state.decoder.end();\\\\n      if (chunk && chunk.length) _this.push(chunk);\\\\n    }\\\\n\\\\n    _this.push(null);\\\\n  });\\\\n\\\\n  stream.on(\'data\', function (chunk) {\\\\n    debug(\'wrapped data\');\\\\n    if (state.decoder) chunk = state.decoder.write(chunk);\\\\n\\\\n    // don\'t skip over falsy values in objectMode\\\\n    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;\\\\n\\\\n    var ret = _this.push(chunk);\\\\n    if (!ret) {\\\\n      paused = true;\\\\n      stream.pause();\\\\n    }\\\\n  });\\\\n\\\\n  // proxy all the other methods.\\\\n  // important when wrapping filters and duplexes.\\\\n  for (var i in stream) {\\\\n    if (this[i] === undefined && typeof stream[i] === \'function\') {\\\\n      this[i] = function (method) {\\\\n        return function () {\\\\n          return stream[method].apply(stream, arguments);\\\\n        };\\\\n      }(i);\\\\n    }\\\\n  }\\\\n\\\\n  // proxy certain important events.\\\\n  for (var n = 0; n < kProxyEvents.length; n++) {\\\\n    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));\\\\n  }\\\\n\\\\n  // when we try to consume some more bytes, simply unpause the\\\\n  // underlying stream.\\\\n  this._read = function (n) {\\\\n    debug(\'wrapped _read\', n);\\\\n    if (paused) {\\\\n      paused = false;\\\\n      stream.resume();\\\\n    }\\\\n  };\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n// exposed for testing purposes only.\\\\nReadable._fromList = fromList;\\\\n\\\\n// Pluck off n bytes from an array of buffers.\\\\n// Length is the combined lengths of all the buffers in the list.\\\\n// This function is designed to be inlinable, so please take care when making\\\\n// changes to the function body.\\\\nfunction fromList(n, state) {\\\\n  // nothing buffered\\\\n  if (state.length === 0) return null;\\\\n\\\\n  var ret;\\\\n  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {\\\\n    // read it all, truncate the list\\\\n    if (state.decoder) ret = state.buffer.join(\'\');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);\\\\n    state.buffer.clear();\\\\n  } else {\\\\n    // read part of list\\\\n    ret = fromListPartial(n, state.buffer, state.decoder);\\\\n  }\\\\n\\\\n  return ret;\\\\n}\\\\n\\\\n// Extracts only enough buffered data to satisfy the amount requested.\\\\n// This function is designed to be inlinable, so please take care when making\\\\n// changes to the function body.\\\\nfunction fromListPartial(n, list, hasStrings) {\\\\n  var ret;\\\\n  if (n < list.head.data.length) {\\\\n    // slice is the same for buffers and strings\\\\n    ret = list.head.data.slice(0, n);\\\\n    list.head.data = list.head.data.slice(n);\\\\n  } else if (n === list.head.data.length) {\\\\n    // first chunk is a perfect match\\\\n    ret = list.shift();\\\\n  } else {\\\\n    // result spans more than one buffer\\\\n    ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);\\\\n  }\\\\n  return ret;\\\\n}\\\\n\\\\n// Copies a specified amount of characters from the list of buffered data\\\\n// chunks.\\\\n// This function is designed to be inlinable, so please take care when making\\\\n// changes to the function body.\\\\nfunction copyFromBufferString(n, list) {\\\\n  var p = list.head;\\\\n  var c = 1;\\\\n  var ret = p.data;\\\\n  n -= ret.length;\\\\n  while (p = p.next) {\\\\n    var str = p.data;\\\\n    var nb = n > str.length ? str.length : n;\\\\n    if (nb === str.length) ret += str;else ret += str.slice(0, n);\\\\n    n -= nb;\\\\n    if (n === 0) {\\\\n      if (nb === str.length) {\\\\n        ++c;\\\\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\\\\n      } else {\\\\n        list.head = p;\\\\n        p.data = str.slice(nb);\\\\n      }\\\\n      break;\\\\n    }\\\\n    ++c;\\\\n  }\\\\n  list.length -= c;\\\\n  return ret;\\\\n}\\\\n\\\\n// Copies a specified amount of bytes from the list of buffered data chunks.\\\\n// This function is designed to be inlinable, so please take care when making\\\\n// changes to the function body.\\\\nfunction copyFromBuffer(n, list) {\\\\n  var ret = Buffer.allocUnsafe(n);\\\\n  var p = list.head;\\\\n  var c = 1;\\\\n  p.data.copy(ret);\\\\n  n -= p.data.length;\\\\n  while (p = p.next) {\\\\n    var buf = p.data;\\\\n    var nb = n > buf.length ? buf.length : n;\\\\n    buf.copy(ret, ret.length - n, 0, nb);\\\\n    n -= nb;\\\\n    if (n === 0) {\\\\n      if (nb === buf.length) {\\\\n        ++c;\\\\n        if (p.next) list.head = p.next;else list.head = list.tail = null;\\\\n      } else {\\\\n        list.head = p;\\\\n        p.data = buf.slice(nb);\\\\n      }\\\\n      break;\\\\n    }\\\\n    ++c;\\\\n  }\\\\n  list.length -= c;\\\\n  return ret;\\\\n}\\\\n\\\\nfunction endReadable(stream) {\\\\n  var state = stream._readableState;\\\\n\\\\n  // If we get here before consuming all the bytes, then that is a\\\\n  // bug in node.  Should never happen.\\\\n  if (state.length > 0) throw new Error(\'\\\\\\"endReadable()\\\\\\" called on non-empty stream\');\\\\n\\\\n  if (!state.endEmitted) {\\\\n    state.ended = true;\\\\n    processNextTick(endReadableNT, state, stream);\\\\n  }\\\\n}\\\\n\\\\nfunction endReadableNT(state, stream) {\\\\n  // Check that we didn\'t get one last unshift.\\\\n  if (!state.endEmitted && state.length === 0) {\\\\n    state.endEmitted = true;\\\\n    stream.readable = false;\\\\n    stream.emit(\'end\');\\\\n  }\\\\n}\\\\n\\\\nfunction forEach(xs, f) {\\\\n  for (var i = 0, l = xs.length; i < l; i++) {\\\\n    f(xs[i], i);\\\\n  }\\\\n}\\\\n\\\\nfunction indexOf(xs, x) {\\\\n  for (var i = 0, l = xs.length; i < l; i++) {\\\\n    if (xs[i] === x) return i;\\\\n  }\\\\n  return -1;\\\\n}\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/_stream_readable.js\\\\n// module id = 149\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/_stream_readable.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\\\\\"Software\\\\\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\\\\\"AS IS\\\\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n// a transform stream is a readable/writable stream where you do\\\\n// something with the data.  Sometimes it\'s called a \\\\\\"filter\\\\\\",\\\\n// but that\'s not a great name for it, since that implies a thing where\\\\n// some bits pass through, and others are simply ignored.  (That would\\\\n// be a valid example of a transform, of course.)\\\\n//\\\\n// While the output is causally related to the input, it\'s not a\\\\n// necessarily symmetric or synchronous transformation.  For example,\\\\n// a zlib stream might take multiple plain-text writes(), and then\\\\n// emit a single compressed chunk some time in the future.\\\\n//\\\\n// Here\'s how this works:\\\\n//\\\\n// The Transform stream has all the aspects of the readable and writable\\\\n// stream classes.  When you write(chunk), that calls _write(chunk,cb)\\\\n// internally, and returns false if there\'s a lot of pending writes\\\\n// buffered up.  When you call read(), that calls _read(n) until\\\\n// there\'s enough pending readable data buffered up.\\\\n//\\\\n// In a transform stream, the written data is placed in a buffer.  When\\\\n// _read(n) is called, it transforms the queued up data, calling the\\\\n// buffered _write cb\'s as it consumes chunks.  If consuming a single\\\\n// written chunk would result in multiple output chunks, then the first\\\\n// outputted bit calls the readcb, and subsequent chunks just go into\\\\n// the read buffer, and will cause it to emit \'readable\' if necessary.\\\\n//\\\\n// This way, back-pressure is actually determined by the reading side,\\\\n// since _read has to be called to start processing a new chunk.  However,\\\\n// a pathological inflate type of transform can cause excessive buffering\\\\n// here.  For example, imagine a stream where every byte of input is\\\\n// interpreted as an integer from 0-255, and then results in that many\\\\n// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in\\\\n// 1kb of data being output.  In this case, you could write a very small\\\\n// amount of input, and end up with a very large amount of output.  In\\\\n// such a pathological inflating mechanism, there\'d be no way to tell\\\\n// the system to stop doing the transform.  A single 4MB write could\\\\n// cause the system to run out of memory.\\\\n//\\\\n// However, even in such a pathological case, only a single written chunk\\\\n// would be consumed, and then the rest would wait (un-transformed) until\\\\n// the results of the previous transformed chunk were consumed.\\\\n\\\\n\\\\n\\\\nmodule.exports = Transform;\\\\n\\\\nvar Duplex = __webpack_require__(24);\\\\n\\\\n/*<replacement>*/\\\\nvar util = __webpack_require__(38);\\\\nutil.inherits = __webpack_require__(0);\\\\n/*</replacement>*/\\\\n\\\\nutil.inherits(Transform, Duplex);\\\\n\\\\nfunction afterTransform(er, data) {\\\\n  var ts = this._transformState;\\\\n  ts.transforming = false;\\\\n\\\\n  var cb = ts.writecb;\\\\n\\\\n  if (!cb) {\\\\n    return this.emit(\'error\', new Error(\'write callback called multiple times\'));\\\\n  }\\\\n\\\\n  ts.writechunk = null;\\\\n  ts.writecb = null;\\\\n\\\\n  if (data != null) // single equals check for both `null` and `undefined`\\\\n    this.push(data);\\\\n\\\\n  cb(er);\\\\n\\\\n  var rs = this._readableState;\\\\n  rs.reading = false;\\\\n  if (rs.needReadable || rs.length < rs.highWaterMark) {\\\\n    this._read(rs.highWaterMark);\\\\n  }\\\\n}\\\\n\\\\nfunction Transform(options) {\\\\n  if (!(this instanceof Transform)) return new Transform(options);\\\\n\\\\n  Duplex.call(this, options);\\\\n\\\\n  this._transformState = {\\\\n    afterTransform: afterTransform.bind(this),\\\\n    needTransform: false,\\\\n    transforming: false,\\\\n    writecb: null,\\\\n    writechunk: null,\\\\n    writeencoding: null\\\\n  };\\\\n\\\\n  // start out asking for a readable event once data is transformed.\\\\n  this._readableState.needReadable = true;\\\\n\\\\n  // we have implemented the _read method, and done the other things\\\\n  // that Readable wants before the first _read call, so unset the\\\\n  // sync guard flag.\\\\n  this._readableState.sync = false;\\\\n\\\\n  if (options) {\\\\n    if (typeof options.transform === \'function\') this._transform = options.transform;\\\\n\\\\n    if (typeof options.flush === \'function\') this._flush = options.flush;\\\\n  }\\\\n\\\\n  // When the writable side finishes, then flush out anything remaining.\\\\n  this.on(\'prefinish\', prefinish);\\\\n}\\\\n\\\\nfunction prefinish() {\\\\n  var _this = this;\\\\n\\\\n  if (typeof this._flush === \'function\') {\\\\n    this._flush(function (er, data) {\\\\n      done(_this, er, data);\\\\n    });\\\\n  } else {\\\\n    done(this, null, null);\\\\n  }\\\\n}\\\\n\\\\nTransform.prototype.push = function (chunk, encoding) {\\\\n  this._transformState.needTransform = false;\\\\n  return Duplex.prototype.push.call(this, chunk, encoding);\\\\n};\\\\n\\\\n// This is the part where you do stuff!\\\\n// override this function in implementation classes.\\\\n// \'chunk\' is an input chunk.\\\\n//\\\\n// Call `push(newChunk)` to pass along transformed output\\\\n// to the readable side.  You may call \'push\' zero or more times.\\\\n//\\\\n// Call `cb(err)` when you are done with this chunk.  If you pass\\\\n// an error, then that\'ll put the hurt on the whole operation.  If you\\\\n// never call cb(), then you\'ll never get another chunk.\\\\nTransform.prototype._transform = function (chunk, encoding, cb) {\\\\n  throw new Error(\'_transform() is not implemented\');\\\\n};\\\\n\\\\nTransform.prototype._write = function (chunk, encoding, cb) {\\\\n  var ts = this._transformState;\\\\n  ts.writecb = cb;\\\\n  ts.writechunk = chunk;\\\\n  ts.writeencoding = encoding;\\\\n  if (!ts.transforming) {\\\\n    var rs = this._readableState;\\\\n    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);\\\\n  }\\\\n};\\\\n\\\\n// Doesn\'t matter what the args are here.\\\\n// _transform does all the work.\\\\n// That we got here means that the readable side wants more data.\\\\nTransform.prototype._read = function (n) {\\\\n  var ts = this._transformState;\\\\n\\\\n  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {\\\\n    ts.transforming = true;\\\\n    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);\\\\n  } else {\\\\n    // mark that we need a transform, so that any data that comes in\\\\n    // will get processed, now that we\'ve asked for it.\\\\n    ts.needTransform = true;\\\\n  }\\\\n};\\\\n\\\\nTransform.prototype._destroy = function (err, cb) {\\\\n  var _this2 = this;\\\\n\\\\n  Duplex.prototype._destroy.call(this, err, function (err2) {\\\\n    cb(err2);\\\\n    _this2.emit(\'close\');\\\\n  });\\\\n};\\\\n\\\\nfunction done(stream, er, data) {\\\\n  if (er) return stream.emit(\'error\', er);\\\\n\\\\n  if (data != null) // single equals check for both `null` and `undefined`\\\\n    stream.push(data);\\\\n\\\\n  // if there\'s nothing in the write buffer, then that means\\\\n  // that nothing more will ever be provided\\\\n  if (stream._writableState.length) throw new Error(\'Calling transform done when ws.length != 0\');\\\\n\\\\n  if (stream._transformState.transforming) throw new Error(\'Calling transform done when still transforming\');\\\\n\\\\n  return stream.push(null);\\\\n}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/_stream_transform.js\\\\n// module id = 150\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/_stream_transform.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\n/*<replacement>*/\\\\n\\\\nvar processNextTick = __webpack_require__(55).nextTick;\\\\n/*</replacement>*/\\\\n\\\\n// undocumented cb() API, needed for core, not for public API\\\\nfunction destroy(err, cb) {\\\\n  var _this = this;\\\\n\\\\n  var readableDestroyed = this._readableState && this._readableState.destroyed;\\\\n  var writableDestroyed = this._writableState && this._writableState.destroyed;\\\\n\\\\n  if (readableDestroyed || writableDestroyed) {\\\\n    if (cb) {\\\\n      cb(err);\\\\n    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {\\\\n      processNextTick(emitErrorNT, this, err);\\\\n    }\\\\n    return this;\\\\n  }\\\\n\\\\n  // we set destroyed to true before firing error callbacks in order\\\\n  // to make it re-entrance safe in case destroy() is called within callbacks\\\\n\\\\n  if (this._readableState) {\\\\n    this._readableState.destroyed = true;\\\\n  }\\\\n\\\\n  // if this is a duplex stream mark the writable part as destroyed as well\\\\n  if (this._writableState) {\\\\n    this._writableState.destroyed = true;\\\\n  }\\\\n\\\\n  this._destroy(err || null, function (err) {\\\\n    if (!cb && err) {\\\\n      processNextTick(emitErrorNT, _this, err);\\\\n      if (_this._writableState) {\\\\n        _this._writableState.errorEmitted = true;\\\\n      }\\\\n    } else if (cb) {\\\\n      cb(err);\\\\n    }\\\\n  });\\\\n\\\\n  return this;\\\\n}\\\\n\\\\nfunction undestroy() {\\\\n  if (this._readableState) {\\\\n    this._readableState.destroyed = false;\\\\n    this._readableState.reading = false;\\\\n    this._readableState.ended = false;\\\\n    this._readableState.endEmitted = false;\\\\n  }\\\\n\\\\n  if (this._writableState) {\\\\n    this._writableState.destroyed = false;\\\\n    this._writableState.ended = false;\\\\n    this._writableState.ending = false;\\\\n    this._writableState.finished = false;\\\\n    this._writableState.errorEmitted = false;\\\\n  }\\\\n}\\\\n\\\\nfunction emitErrorNT(self, err) {\\\\n  self.emit(\'error\', err);\\\\n}\\\\n\\\\nmodule.exports = {\\\\n  destroy: destroy,\\\\n  undestroy: undestroy\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/internal/streams/destroy.js\\\\n// module id = 151\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/destroy.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(84).EventEmitter;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/internal/streams/stream-browser.js\\\\n// module id = 152\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/stream-browser.js\\")},function(module,exports,__webpack_require__){eval(\\"/**\\\\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\\\\n * in FIPS 180-2\\\\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\\\\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\\\\n *\\\\n */\\\\n\\\\nvar inherits = __webpack_require__(0)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar K = [\\\\n  0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,\\\\n  0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,\\\\n  0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,\\\\n  0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,\\\\n  0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,\\\\n  0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,\\\\n  0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,\\\\n  0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,\\\\n  0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,\\\\n  0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,\\\\n  0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,\\\\n  0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,\\\\n  0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,\\\\n  0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,\\\\n  0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,\\\\n  0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2\\\\n]\\\\n\\\\nvar W = new Array(64)\\\\n\\\\nfunction Sha256 () {\\\\n  this.init()\\\\n\\\\n  this._w = W // new Array(64)\\\\n\\\\n  Hash.call(this, 64, 56)\\\\n}\\\\n\\\\ninherits(Sha256, Hash)\\\\n\\\\nSha256.prototype.init = function () {\\\\n  this._a = 0x6a09e667\\\\n  this._b = 0xbb67ae85\\\\n  this._c = 0x3c6ef372\\\\n  this._d = 0xa54ff53a\\\\n  this._e = 0x510e527f\\\\n  this._f = 0x9b05688c\\\\n  this._g = 0x1f83d9ab\\\\n  this._h = 0x5be0cd19\\\\n\\\\n  return this\\\\n}\\\\n\\\\nfunction ch (x, y, z) {\\\\n  return z ^ (x & (y ^ z))\\\\n}\\\\n\\\\nfunction maj (x, y, z) {\\\\n  return (x & y) | (z & (x | y))\\\\n}\\\\n\\\\nfunction sigma0 (x) {\\\\n  return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10)\\\\n}\\\\n\\\\nfunction sigma1 (x) {\\\\n  return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7)\\\\n}\\\\n\\\\nfunction gamma0 (x) {\\\\n  return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3)\\\\n}\\\\n\\\\nfunction gamma1 (x) {\\\\n  return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10)\\\\n}\\\\n\\\\nSha256.prototype._update = function (M) {\\\\n  var W = this._w\\\\n\\\\n  var a = this._a | 0\\\\n  var b = this._b | 0\\\\n  var c = this._c | 0\\\\n  var d = this._d | 0\\\\n  var e = this._e | 0\\\\n  var f = this._f | 0\\\\n  var g = this._g | 0\\\\n  var h = this._h | 0\\\\n\\\\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\\\\n  for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0\\\\n\\\\n  for (var j = 0; j < 64; ++j) {\\\\n    var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0\\\\n    var T2 = (sigma0(a) + maj(a, b, c)) | 0\\\\n\\\\n    h = g\\\\n    g = f\\\\n    f = e\\\\n    e = (d + T1) | 0\\\\n    d = c\\\\n    c = b\\\\n    b = a\\\\n    a = (T1 + T2) | 0\\\\n  }\\\\n\\\\n  this._a = (a + this._a) | 0\\\\n  this._b = (b + this._b) | 0\\\\n  this._c = (c + this._c) | 0\\\\n  this._d = (d + this._d) | 0\\\\n  this._e = (e + this._e) | 0\\\\n  this._f = (f + this._f) | 0\\\\n  this._g = (g + this._g) | 0\\\\n  this._h = (h + this._h) | 0\\\\n}\\\\n\\\\nSha256.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(32)\\\\n\\\\n  H.writeInt32BE(this._a, 0)\\\\n  H.writeInt32BE(this._b, 4)\\\\n  H.writeInt32BE(this._c, 8)\\\\n  H.writeInt32BE(this._d, 12)\\\\n  H.writeInt32BE(this._e, 16)\\\\n  H.writeInt32BE(this._f, 20)\\\\n  H.writeInt32BE(this._g, 24)\\\\n  H.writeInt32BE(this._h, 28)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha256\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha256.js\\\\n// module id = 153\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha256.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar K = [\\\\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\\\\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\\\\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\\\\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\\\\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\\\\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\\\\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\\\\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\\\\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\\\\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\\\\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\\\\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\\\\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\\\\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\\\\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\\\\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\\\\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\\\\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\\\\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\\\\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\\\\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\\\\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\\\\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\\\\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\\\\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\\\\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\\\\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\\\\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\\\\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\\\\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\\\\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\\\\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\\\\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\\\\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\\\\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\\\\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\\\\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\\\\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\\\\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\\\\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\\\\n]\\\\n\\\\nvar W = new Array(160)\\\\n\\\\nfunction Sha512 () {\\\\n  this.init()\\\\n  this._w = W\\\\n\\\\n  Hash.call(this, 128, 112)\\\\n}\\\\n\\\\ninherits(Sha512, Hash)\\\\n\\\\nSha512.prototype.init = function () {\\\\n  this._ah = 0x6a09e667\\\\n  this._bh = 0xbb67ae85\\\\n  this._ch = 0x3c6ef372\\\\n  this._dh = 0xa54ff53a\\\\n  this._eh = 0x510e527f\\\\n  this._fh = 0x9b05688c\\\\n  this._gh = 0x1f83d9ab\\\\n  this._hh = 0x5be0cd19\\\\n\\\\n  this._al = 0xf3bcc908\\\\n  this._bl = 0x84caa73b\\\\n  this._cl = 0xfe94f82b\\\\n  this._dl = 0x5f1d36f1\\\\n  this._el = 0xade682d1\\\\n  this._fl = 0x2b3e6c1f\\\\n  this._gl = 0xfb41bd6b\\\\n  this._hl = 0x137e2179\\\\n\\\\n  return this\\\\n}\\\\n\\\\nfunction Ch (x, y, z) {\\\\n  return z ^ (x & (y ^ z))\\\\n}\\\\n\\\\nfunction maj (x, y, z) {\\\\n  return (x & y) | (z & (x | y))\\\\n}\\\\n\\\\nfunction sigma0 (x, xl) {\\\\n  return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25)\\\\n}\\\\n\\\\nfunction sigma1 (x, xl) {\\\\n  return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23)\\\\n}\\\\n\\\\nfunction Gamma0 (x, xl) {\\\\n  return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7)\\\\n}\\\\n\\\\nfunction Gamma0l (x, xl) {\\\\n  return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25)\\\\n}\\\\n\\\\nfunction Gamma1 (x, xl) {\\\\n  return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6)\\\\n}\\\\n\\\\nfunction Gamma1l (x, xl) {\\\\n  return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26)\\\\n}\\\\n\\\\nfunction getCarry (a, b) {\\\\n  return (a >>> 0) < (b >>> 0) ? 1 : 0\\\\n}\\\\n\\\\nSha512.prototype._update = function (M) {\\\\n  var W = this._w\\\\n\\\\n  var ah = this._ah | 0\\\\n  var bh = this._bh | 0\\\\n  var ch = this._ch | 0\\\\n  var dh = this._dh | 0\\\\n  var eh = this._eh | 0\\\\n  var fh = this._fh | 0\\\\n  var gh = this._gh | 0\\\\n  var hh = this._hh | 0\\\\n\\\\n  var al = this._al | 0\\\\n  var bl = this._bl | 0\\\\n  var cl = this._cl | 0\\\\n  var dl = this._dl | 0\\\\n  var el = this._el | 0\\\\n  var fl = this._fl | 0\\\\n  var gl = this._gl | 0\\\\n  var hl = this._hl | 0\\\\n\\\\n  for (var i = 0; i < 32; i += 2) {\\\\n    W[i] = M.readInt32BE(i * 4)\\\\n    W[i + 1] = M.readInt32BE(i * 4 + 4)\\\\n  }\\\\n  for (; i < 160; i += 2) {\\\\n    var xh = W[i - 15 * 2]\\\\n    var xl = W[i - 15 * 2 + 1]\\\\n    var gamma0 = Gamma0(xh, xl)\\\\n    var gamma0l = Gamma0l(xl, xh)\\\\n\\\\n    xh = W[i - 2 * 2]\\\\n    xl = W[i - 2 * 2 + 1]\\\\n    var gamma1 = Gamma1(xh, xl)\\\\n    var gamma1l = Gamma1l(xl, xh)\\\\n\\\\n    // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\\\\n    var Wi7h = W[i - 7 * 2]\\\\n    var Wi7l = W[i - 7 * 2 + 1]\\\\n\\\\n    var Wi16h = W[i - 16 * 2]\\\\n    var Wi16l = W[i - 16 * 2 + 1]\\\\n\\\\n    var Wil = (gamma0l + Wi7l) | 0\\\\n    var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0\\\\n    Wil = (Wil + gamma1l) | 0\\\\n    Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0\\\\n    Wil = (Wil + Wi16l) | 0\\\\n    Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0\\\\n\\\\n    W[i] = Wih\\\\n    W[i + 1] = Wil\\\\n  }\\\\n\\\\n  for (var j = 0; j < 160; j += 2) {\\\\n    Wih = W[j]\\\\n    Wil = W[j + 1]\\\\n\\\\n    var majh = maj(ah, bh, ch)\\\\n    var majl = maj(al, bl, cl)\\\\n\\\\n    var sigma0h = sigma0(ah, al)\\\\n    var sigma0l = sigma0(al, ah)\\\\n    var sigma1h = sigma1(eh, el)\\\\n    var sigma1l = sigma1(el, eh)\\\\n\\\\n    // t1 = h + sigma1 + ch + K[j] + W[j]\\\\n    var Kih = K[j]\\\\n    var Kil = K[j + 1]\\\\n\\\\n    var chh = Ch(eh, fh, gh)\\\\n    var chl = Ch(el, fl, gl)\\\\n\\\\n    var t1l = (hl + sigma1l) | 0\\\\n    var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0\\\\n    t1l = (t1l + chl) | 0\\\\n    t1h = (t1h + chh + getCarry(t1l, chl)) | 0\\\\n    t1l = (t1l + Kil) | 0\\\\n    t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0\\\\n    t1l = (t1l + Wil) | 0\\\\n    t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0\\\\n\\\\n    // t2 = sigma0 + maj\\\\n    var t2l = (sigma0l + majl) | 0\\\\n    var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0\\\\n\\\\n    hh = gh\\\\n    hl = gl\\\\n    gh = fh\\\\n    gl = fl\\\\n    fh = eh\\\\n    fl = el\\\\n    el = (dl + t1l) | 0\\\\n    eh = (dh + t1h + getCarry(el, dl)) | 0\\\\n    dh = ch\\\\n    dl = cl\\\\n    ch = bh\\\\n    cl = bl\\\\n    bh = ah\\\\n    bl = al\\\\n    al = (t1l + t2l) | 0\\\\n    ah = (t1h + t2h + getCarry(al, t1l)) | 0\\\\n  }\\\\n\\\\n  this._al = (this._al + al) | 0\\\\n  this._bl = (this._bl + bl) | 0\\\\n  this._cl = (this._cl + cl) | 0\\\\n  this._dl = (this._dl + dl) | 0\\\\n  this._el = (this._el + el) | 0\\\\n  this._fl = (this._fl + fl) | 0\\\\n  this._gl = (this._gl + gl) | 0\\\\n  this._hl = (this._hl + hl) | 0\\\\n\\\\n  this._ah = (this._ah + ah + getCarry(this._al, al)) | 0\\\\n  this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0\\\\n  this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0\\\\n  this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0\\\\n  this._eh = (this._eh + eh + getCarry(this._el, el)) | 0\\\\n  this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0\\\\n  this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0\\\\n  this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0\\\\n}\\\\n\\\\nSha512.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(64)\\\\n\\\\n  function writeInt64BE (h, l, offset) {\\\\n    H.writeInt32BE(h, offset)\\\\n    H.writeInt32BE(l, offset + 4)\\\\n  }\\\\n\\\\n  writeInt64BE(this._ah, this._al, 0)\\\\n  writeInt64BE(this._bh, this._bl, 8)\\\\n  writeInt64BE(this._ch, this._cl, 16)\\\\n  writeInt64BE(this._dh, this._dl, 24)\\\\n  writeInt64BE(this._eh, this._el, 32)\\\\n  writeInt64BE(this._fh, this._fl, 40)\\\\n  writeInt64BE(this._gh, this._gl, 48)\\\\n  writeInt64BE(this._hh, this._hl, 56)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha512\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha512.js\\\\n// module id = 154\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha512.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2016\\\\n */\\\\n\\\\n\\\\n\\\\nvar EventEmitter = __webpack_require__(129);\\\\nvar Promise = __webpack_require__(337);\\\\n\\\\n/**\\\\n * This function generates a defer promise and adds eventEmitter functionality to it\\\\n *\\\\n * @method eventifiedPromise\\\\n */\\\\nvar PromiEvent = function PromiEvent(justPromise) {\\\\n    var resolve, reject,\\\\n        eventEmitter = new Promise(function() {\\\\n            resolve = arguments[0];\\\\n            reject = arguments[1];\\\\n        });\\\\n\\\\n    if(justPromise) {\\\\n        return {\\\\n            resolve: resolve,\\\\n            reject: reject,\\\\n            eventEmitter: eventEmitter\\\\n        };\\\\n    }\\\\n\\\\n    // get eventEmitter\\\\n    var emitter = new EventEmitter();\\\\n\\\\n    // add eventEmitter to the promise\\\\n    eventEmitter._events = emitter._events;\\\\n    eventEmitter.emit = emitter.emit;\\\\n    eventEmitter.on = emitter.on;\\\\n    eventEmitter.once = emitter.once;\\\\n    eventEmitter.off = emitter.off;\\\\n    eventEmitter.listeners = emitter.listeners;\\\\n    eventEmitter.addListener = emitter.addListener;\\\\n    eventEmitter.removeListener = emitter.removeListener;\\\\n    eventEmitter.removeAllListeners = emitter.removeAllListeners;\\\\n\\\\n    return {\\\\n        resolve: resolve,\\\\n        reject: reject,\\\\n        eventEmitter: eventEmitter\\\\n    };\\\\n};\\\\n\\\\nPromiEvent.resolve = function(value) {\\\\n    var promise = PromiEvent(true);\\\\n    promise.resolve(value);\\\\n    return promise.eventEmitter;\\\\n};\\\\n\\\\nmodule.exports = PromiEvent;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-promievent/src/index.js\\\\n// module id = 155\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-promievent/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/** @file jsonrpc.js\\\\n * @authors:\\\\n *   Fabian Vogelsteller <fabian@ethereum.org>\\\\n *   Marek Kotewicz <marek@ethdev.com>\\\\n *   Aaron Kumavis <aaron@kumavis.me>\\\\n * @date 2015\\\\n */\\\\n\\\\n\\\\n\\\\n// Initialize Jsonrpc as a simple object with utility functions.\\\\nvar Jsonrpc = {\\\\n    messageId: 0\\\\n};\\\\n\\\\n/**\\\\n * Should be called to valid json create payload object\\\\n *\\\\n * @method toPayload\\\\n * @param {Function} method of jsonrpc call, required\\\\n * @param {Array} params, an array of method params, optional\\\\n * @returns {Object} valid jsonrpc payload object\\\\n */\\\\nJsonrpc.toPayload = function (method, params) {\\\\n    if (!method) {\\\\n        throw new Error(\'JSONRPC method should be specified for params: \\\\\\"\'+ JSON.stringify(params) +\'\\\\\\"!\');\\\\n    }\\\\n\\\\n    // advance message ID\\\\n    Jsonrpc.messageId++;\\\\n\\\\n    return {\\\\n        jsonrpc: \'2.0\',\\\\n        id: Jsonrpc.messageId,\\\\n        method: method,\\\\n        params: params || []\\\\n    };\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if jsonrpc response is valid\\\\n *\\\\n * @method isValidResponse\\\\n * @param {Object}\\\\n * @returns {Boolean} true if response is valid, otherwise false\\\\n */\\\\nJsonrpc.isValidResponse = function (response) {\\\\n    return Array.isArray(response) ? response.every(validateSingleMessage) : validateSingleMessage(response);\\\\n\\\\n    function validateSingleMessage(message){\\\\n      return !!message &&\\\\n        !message.error &&\\\\n        message.jsonrpc === \'2.0\' &&\\\\n        (typeof message.id === \'number\' || typeof message.id === \'string\') &&\\\\n        message.result !== undefined; // only undefined is not valid json object\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to create batch payload object\\\\n *\\\\n * @method toBatchPayload\\\\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\\\\n * @returns {Array} batch payload\\\\n */\\\\nJsonrpc.toBatchPayload = function (messages) {\\\\n    return messages.map(function (message) {\\\\n        return Jsonrpc.toPayload(message.method, message.params);\\\\n    });\\\\n};\\\\n\\\\nmodule.exports = Jsonrpc;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-requestmanager/src/jsonrpc.js\\\\n// module id = 156\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-requestmanager/src/jsonrpc.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file index.js\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @author Fabian Vogelsteller <fabian@frozeman.de>\\\\n * @date 2017\\\\n */\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar utils = __webpack_require__(10);\\\\n\\\\nvar f = __webpack_require__(15);\\\\n\\\\nvar SolidityTypeAddress = __webpack_require__(344);\\\\nvar SolidityTypeBool = __webpack_require__(345);\\\\nvar SolidityTypeInt = __webpack_require__(348);\\\\nvar SolidityTypeUInt = __webpack_require__(350);\\\\nvar SolidityTypeDynamicBytes = __webpack_require__(347);\\\\nvar SolidityTypeString = __webpack_require__(349);\\\\nvar SolidityTypeBytes = __webpack_require__(346);\\\\n\\\\nvar isDynamic = function (solidityType, type) {\\\\n    return solidityType.isDynamicType(type) ||\\\\n        solidityType.isDynamicArray(type);\\\\n};\\\\n\\\\n\\\\n// result method\\\\nfunction Result() {}\\\\n\\\\n\\\\n/**\\\\n * ABICoder prototype should be used to encode/decode solidity params of any type\\\\n */\\\\nvar ABICoder = function (types) {\\\\n    this._types = types;\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to transform type to SolidityType\\\\n *\\\\n * @method _requireType\\\\n * @param {String} type\\\\n * @returns {SolidityType}\\\\n * @throws {Error} throws if no matching type is found\\\\n */\\\\nABICoder.prototype._requireType = function (type) {\\\\n    var solidityType = this._types.filter(function (t) {\\\\n        return t.isType(type);\\\\n    })[0];\\\\n\\\\n    if (!solidityType) {\\\\n        throw Error(\'Invalid solidity type: \' + type);\\\\n    }\\\\n\\\\n    return solidityType;\\\\n};\\\\n\\\\n\\\\n\\\\nABICoder.prototype._getOffsets = function (types, solidityTypes) {\\\\n    var lengths =  solidityTypes.map(function (solidityType, index) {\\\\n        return solidityType.staticPartLength(types[index]);\\\\n    });\\\\n\\\\n    for (var i = 1; i < lengths.length; i++) {\\\\n        // sum with length of previous element\\\\n        lengths[i] += lengths[i - 1];\\\\n    }\\\\n\\\\n    return lengths.map(function (length, index) {\\\\n        // remove the current length, so the length is sum of previous elements\\\\n        var staticPartLength = solidityTypes[index].staticPartLength(types[index]);\\\\n        return length - staticPartLength;\\\\n    });\\\\n};\\\\n\\\\nABICoder.prototype._getSolidityTypes = function (types) {\\\\n    var self = this;\\\\n    return types.map(function (type) {\\\\n        return self._requireType(type);\\\\n    });\\\\n};\\\\n\\\\n\\\\nABICoder.prototype._encodeMultiWithOffset = function (types, solidityTypes, encodeds, dynamicOffset) {\\\\n    var result = \\\\\\"\\\\\\";\\\\n    var self = this;\\\\n\\\\n    types.forEach(function (type, i) {\\\\n        if (isDynamic(solidityTypes[i], types[i])) {\\\\n            result += f.formatInputInt(dynamicOffset).encode();\\\\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\\\\n            dynamicOffset += e.length / 2;\\\\n        } else {\\\\n            // don\'t add length to dynamicOffset. it\'s already counted\\\\n            result += self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\\\\n        }\\\\n\\\\n        // TODO: figure out nested arrays\\\\n    });\\\\n\\\\n    types.forEach(function (type, i) {\\\\n        if (isDynamic(solidityTypes[i], types[i])) {\\\\n            var e = self._encodeWithOffset(types[i], solidityTypes[i], encodeds[i], dynamicOffset);\\\\n            dynamicOffset += e.length / 2;\\\\n            result += e;\\\\n        }\\\\n    });\\\\n    return result;\\\\n};\\\\n\\\\n// TODO: refactor whole encoding!\\\\nABICoder.prototype._encodeWithOffset = function (type, solidityType, encoded, offset) {\\\\n    var self = this;\\\\n    if (solidityType.isDynamicArray(type)) {\\\\n        return (function () {\\\\n            // offset was already set\\\\n            var nestedName = solidityType.nestedName(type);\\\\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\\\\n            var result = encoded[0];\\\\n\\\\n            (function () {\\\\n                var previousLength = 2; // in int\\\\n                if (solidityType.isDynamicArray(nestedName)) {\\\\n                    for (var i = 1; i < encoded.length; i++) {\\\\n                        previousLength += +(encoded[i - 1])[0] || 0;\\\\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\\\\n                    }\\\\n                }\\\\n            })();\\\\n\\\\n            // first element is length, skip it\\\\n            (function () {\\\\n                for (var i = 0; i < encoded.length - 1; i++) {\\\\n                    var additionalOffset = result / 2;\\\\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i + 1], offset +  additionalOffset);\\\\n                }\\\\n            })();\\\\n\\\\n            return result;\\\\n        })();\\\\n\\\\n    } else if (solidityType.isStaticArray(type)) {\\\\n        return (function () {\\\\n            var nestedName = solidityType.nestedName(type);\\\\n            var nestedStaticPartLength = solidityType.staticPartLength(nestedName);\\\\n            var result = \\\\\\"\\\\\\";\\\\n\\\\n\\\\n            if (solidityType.isDynamicArray(nestedName)) {\\\\n                (function () {\\\\n                    var previousLength = 0; // in int\\\\n                    for (var i = 0; i < encoded.length; i++) {\\\\n                        // calculate length of previous item\\\\n                        previousLength += +(encoded[i - 1] || [])[0] || 0;\\\\n                        result += f.formatInputInt(offset + i * nestedStaticPartLength + previousLength * 32).encode();\\\\n                    }\\\\n                })();\\\\n            }\\\\n\\\\n            (function () {\\\\n                for (var i = 0; i < encoded.length; i++) {\\\\n                    var additionalOffset = result / 2;\\\\n                    result += self._encodeWithOffset(nestedName, solidityType, encoded[i], offset + additionalOffset);\\\\n                }\\\\n            })();\\\\n\\\\n            return result;\\\\n        })();\\\\n    }\\\\n\\\\n    return encoded;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\\\\n *\\\\n * @method encodeFunctionSignature\\\\n * @param {String|Object} functionName\\\\n * @return {String} encoded function name\\\\n */\\\\nABICoder.prototype.encodeFunctionSignature = function (functionName) {\\\\n    if(_.isObject(functionName)) {\\\\n        functionName = utils._jsonInterfaceMethodToString(functionName);\\\\n    }\\\\n\\\\n    return utils.sha3(functionName).slice(0, 10);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Encodes the function name to its ABI representation, which are the first 4 bytes of the sha3 of the function name including  types.\\\\n *\\\\n * @method encodeEventSignature\\\\n * @param {String|Object} functionName\\\\n * @return {String} encoded function name\\\\n */\\\\nABICoder.prototype.encodeEventSignature = function (functionName) {\\\\n    if(_.isObject(functionName)) {\\\\n        functionName = utils._jsonInterfaceMethodToString(functionName);\\\\n    }\\\\n\\\\n    return utils.sha3(functionName);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Should be used to encode plain param\\\\n *\\\\n * @method encodeParameter\\\\n * @param {String} type\\\\n * @param {Object} param\\\\n * @return {String} encoded plain param\\\\n */\\\\nABICoder.prototype.encodeParameter = function (type, param) {\\\\n    return this.encodeParameters([type], [param]);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to encode list of params\\\\n *\\\\n * @method encodeParameters\\\\n * @param {Array} types\\\\n * @param {Array} params\\\\n * @return {String} encoded list of params\\\\n */\\\\nABICoder.prototype.encodeParameters = function (types, params) {\\\\n    // given a json interface\\\\n    if(_.isObject(types) && types.inputs) {\\\\n        types = _.map(types.inputs, function (input) {\\\\n            return input.type;\\\\n        });\\\\n    }\\\\n\\\\n    var solidityTypes = this._getSolidityTypes(types);\\\\n\\\\n    var encodeds = solidityTypes.map(function (solidityType, index) {\\\\n        return solidityType.encode(params[index], types[index]);\\\\n    });\\\\n\\\\n    var dynamicOffset = solidityTypes.reduce(function (acc, solidityType, index) {\\\\n        var staticPartLength = solidityType.staticPartLength(types[index]);\\\\n        var roundedStaticPartLength = Math.floor((staticPartLength + 31) / 32) * 32;\\\\n\\\\n        return acc + (isDynamic(solidityTypes[index], types[index]) ?\\\\n                32 :\\\\n                roundedStaticPartLength);\\\\n    }, 0);\\\\n\\\\n    return \'0x\'+ this._encodeMultiWithOffset(types, solidityTypes, encodeds, dynamicOffset);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Encodes a function call from its json interface and parameters.\\\\n *\\\\n * @method encodeFunctionCall\\\\n * @param {Array} jsonInterface\\\\n * @param {Array} params\\\\n * @return {String} The encoded ABI for this function call\\\\n */\\\\nABICoder.prototype.encodeFunctionCall = function (jsonInterface, params) {\\\\n    return this.encodeFunctionSignature(jsonInterface) + this.encodeParameters(jsonInterface, params).replace(\'0x\',\'\');\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Should be used to decode bytes to plain param\\\\n *\\\\n * @method decodeParameter\\\\n * @param {String} type\\\\n * @param {String} bytes\\\\n * @return {Object} plain param\\\\n */\\\\nABICoder.prototype.decodeParameter = function (type, bytes) {\\\\n\\\\n    if (!_.isString(type)) {\\\\n        throw new Error(\'Given parameter type is not a string: \'+ type);\\\\n    }\\\\n\\\\n    return this.decodeParameters([{type: type}], bytes)[0];\\\\n};\\\\n\\\\n/**\\\\n * Should be used to decode list of params\\\\n *\\\\n * @method decodeParameter\\\\n * @param {Array} outputs\\\\n * @param {String} bytes\\\\n * @return {Array} array of plain params\\\\n */\\\\nABICoder.prototype.decodeParameters = function (outputs, bytes) {\\\\n    var isTypeArray = _.isArray(outputs) && _.isString(outputs[0]);\\\\n    var types = (isTypeArray) ? outputs : [];\\\\n\\\\n    if(!isTypeArray) {\\\\n        outputs.forEach(function (output) {\\\\n            types.push(output.type);\\\\n        });\\\\n    }\\\\n\\\\n    var solidityTypes = this._getSolidityTypes(types);\\\\n    var offsets = this._getOffsets(types, solidityTypes);\\\\n\\\\n    var returnValue = new Result();\\\\n    returnValue.__length__ = 0;\\\\n    var count = 0;\\\\n\\\\n    outputs.forEach(function (output, i) {\\\\n        var decodedValue = solidityTypes[count].decode(bytes.replace(/^0x/i,\'\'), offsets[count],  types[count], count);\\\\n        decodedValue = (decodedValue === \'0x\') ? null : decodedValue;\\\\n\\\\n        returnValue[i] = decodedValue;\\\\n\\\\n        if (_.isObject(output) && output.name) {\\\\n            returnValue[output.name] = decodedValue;\\\\n        }\\\\n\\\\n        returnValue.__length__++;\\\\n        count++;\\\\n    });\\\\n\\\\n    return returnValue;\\\\n};\\\\n\\\\n/**\\\\n * Decodes events non- and indexed parameters.\\\\n *\\\\n * @method decodeLog\\\\n * @param {Object} inputs\\\\n * @param {String} data\\\\n * * @param {Array} topics\\\\n * @return {Array} array of plain params\\\\n */\\\\nABICoder.prototype.decodeLog = function (inputs, data, topics) {\\\\n\\\\n    data = data || \'\';\\\\n\\\\n    var notIndexedInputs = [];\\\\n    var indexedInputs = [];\\\\n\\\\n    inputs.forEach(function (input, i) {\\\\n        if (input.indexed) {\\\\n            indexedInputs[i] = input;\\\\n        } else {\\\\n            notIndexedInputs[i] = input;\\\\n        }\\\\n    });\\\\n\\\\n    var nonIndexedData = data.slice(2);\\\\n    var indexedData = _.isArray(topics) ? topics.map(function (topic) { return topic.slice(2); }).join(\'\') : topics;\\\\n\\\\n    var notIndexedParams = this.decodeParameters(notIndexedInputs, nonIndexedData);\\\\n    var indexedParams = this.decodeParameters(indexedInputs, indexedData);\\\\n\\\\n\\\\n    var returnValue = new Result();\\\\n    returnValue.__length__ = 0;\\\\n\\\\n    inputs.forEach(function (res, i) {\\\\n        returnValue[i] = (res.type === \'string\') ? \'\' : null;\\\\n\\\\n        if (notIndexedParams[i]) {\\\\n            returnValue[i] = notIndexedParams[i];\\\\n        }\\\\n        if (indexedParams[i]) {\\\\n            returnValue[i] = indexedParams[i];\\\\n        }\\\\n\\\\n        if(res.name) {\\\\n            returnValue[res.name] = returnValue[i];\\\\n        }\\\\n\\\\n        returnValue.__length__++;\\\\n    });\\\\n\\\\n    return returnValue;\\\\n};\\\\n\\\\n\\\\nvar coder = new ABICoder([\\\\n    new SolidityTypeAddress(),\\\\n    new SolidityTypeBool(),\\\\n    new SolidityTypeInt(),\\\\n    new SolidityTypeUInt(),\\\\n    new SolidityTypeDynamicBytes(),\\\\n    new SolidityTypeBytes(),\\\\n    new SolidityTypeString()\\\\n]);\\\\n\\\\nmodule.exports = coder;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/index.js\\\\n// module id = 157\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file param.js\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @date 2015\\\\n */\\\\n\\\\nvar formatters = __webpack_require__(15);\\\\n\\\\n/**\\\\n * SolidityParam object prototype.\\\\n * Should be used when encoding, decoding solidity bytes\\\\n */\\\\nvar SolidityParam = function (value, offset, rawValue) {\\\\n    this.value = value || \'\';\\\\n    this.offset = offset; // offset in bytes\\\\n    this.rawValue = rawValue; // used for debugging\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to get length of params\'s dynamic part\\\\n *\\\\n * @method dynamicPartLength\\\\n * @returns {Number} length of dynamic part (in bytes)\\\\n */\\\\nSolidityParam.prototype.dynamicPartLength = function () {\\\\n    return this.dynamicPart().length / 2;\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to create copy of solidity param with different offset\\\\n *\\\\n * @method withOffset\\\\n * @param {Number} offset length in bytes\\\\n * @returns {SolidityParam} new solidity param with applied offset\\\\n */\\\\nSolidityParam.prototype.withOffset = function (offset) {\\\\n    return new SolidityParam(this.value, offset);\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to combine solidity params together\\\\n * eg. when appending an array\\\\n *\\\\n * @method combine\\\\n * @param {SolidityParam} param with which we should combine\\\\n * @param {SolidityParam} result of combination\\\\n */\\\\nSolidityParam.prototype.combine = function (param) {\\\\n    return new SolidityParam(this.value + param.value);\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to check if param has dynamic size.\\\\n * If it has, it returns true, otherwise false\\\\n *\\\\n * @method isDynamic\\\\n * @returns {Boolean}\\\\n */\\\\nSolidityParam.prototype.isDynamic = function () {\\\\n    return this.offset !== undefined;\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to transform offset to bytes\\\\n *\\\\n * @method offsetAsBytes\\\\n * @returns {String} bytes representation of offset\\\\n */\\\\nSolidityParam.prototype.offsetAsBytes = function () {\\\\n    return !this.isDynamic() ? \'\' : formatters.toTwosComplement(this.offset).replace(\'0x\',\'\');\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to get static part of param\\\\n *\\\\n * @method staticPart\\\\n * @returns {String} offset if it is a dynamic param, otherwise value\\\\n */\\\\nSolidityParam.prototype.staticPart = function () {\\\\n    if (!this.isDynamic()) {\\\\n        return this.value;\\\\n    }\\\\n    return this.offsetAsBytes();\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to get dynamic part of param\\\\n *\\\\n * @method dynamicPart\\\\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\\\\n */\\\\nSolidityParam.prototype.dynamicPart = function () {\\\\n    return this.isDynamic() ? this.value : \'\';\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to encode param\\\\n *\\\\n * @method encode\\\\n * @returns {String}\\\\n */\\\\nSolidityParam.prototype.encode = function () {\\\\n    return this.staticPart() + this.dynamicPart();\\\\n};\\\\n\\\\n/**\\\\n * This method should be called to encode array of params\\\\n *\\\\n * @method encodeList\\\\n * @param {Array[SolidityParam]} params\\\\n * @returns {String}\\\\n */\\\\nSolidityParam.encodeList = function (params) {\\\\n\\\\n    // updating offsets\\\\n    var totalOffset = params.length * 32;\\\\n    var offsetParams = params.map(function (param) {\\\\n        if (!param.isDynamic()) {\\\\n            return param;\\\\n        }\\\\n        var offset = totalOffset;\\\\n        totalOffset += param.dynamicPartLength();\\\\n        return param.withOffset(offset);\\\\n    });\\\\n\\\\n    // encode everything!\\\\n    return offsetParams.reduce(function (result, param) {\\\\n        return result + param.dynamicPart();\\\\n    }, offsetParams.reduce(function (result, param) {\\\\n        return result + param.staticPart();\\\\n    }, \'\'));\\\\n};\\\\n\\\\n\\\\n\\\\nmodule.exports = SolidityParam;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/param.js\\\\n// module id = 158\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/param.js\\")},function(module,exports){eval(\'// This was ported from https://github.com/emn178/js-sha3, with some minor\\\\n// modifications and pruning. It is licensed under MIT:\\\\n//\\\\n// Copyright 2015-2016 Chen, Yi-Cyuan\\\\n//  \\\\n// Permission is hereby granted, free of charge, to any person obtaining\\\\n// a copy of this software and associated documentation files (the\\\\n// \\"Software\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to\\\\n// permit persons to whom the Software is furnished to do so, subject to\\\\n// the following conditions:\\\\n// \\\\n// The above copyright notice and this permission notice shall be\\\\n// included in all copies or substantial portions of the Software.\\\\n// \\\\n// THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND,\\\\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\\\\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\\\\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\\\\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\\\\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\nvar HEX_CHARS = \\\\\'0123456789abcdef\\\\\'.split(\\\\\'\\\\\');\\\\nvar KECCAK_PADDING = [1, 256, 65536, 16777216];\\\\nvar SHIFT = [0, 8, 16, 24];\\\\nvar RC = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];\\\\n\\\\nvar Keccak = function Keccak(bits) {\\\\n  return {\\\\n    blocks: [],\\\\n    reset: true,\\\\n    block: 0,\\\\n    start: 0,\\\\n    blockCount: 1600 - (bits << 1) >> 5,\\\\n    outputBlocks: bits >> 5,\\\\n    s: function (s) {\\\\n      return [].concat(s, s, s, s, s);\\\\n    }([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\\\\n  };\\\\n};\\\\n\\\\nvar update = function update(state, message) {\\\\n  var length = message.length,\\\\n      blocks = state.blocks,\\\\n      byteCount = state.blockCount << 2,\\\\n      blockCount = state.blockCount,\\\\n      outputBlocks = state.outputBlocks,\\\\n      s = state.s,\\\\n      index = 0,\\\\n      i,\\\\n      code;\\\\n\\\\n  // update\\\\n  while (index < length) {\\\\n    if (state.reset) {\\\\n      state.reset = false;\\\\n      blocks[0] = state.block;\\\\n      for (i = 1; i < blockCount + 1; ++i) {\\\\n        blocks[i] = 0;\\\\n      }\\\\n    }\\\\n    if (typeof message !== \\"string\\") {\\\\n      for (i = state.start; index < length && i < byteCount; ++index) {\\\\n        blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\\\\n      }\\\\n    } else {\\\\n      for (i = state.start; index < length && i < byteCount; ++index) {\\\\n        code = message.charCodeAt(index);\\\\n        if (code < 0x80) {\\\\n          blocks[i >> 2] |= code << SHIFT[i++ & 3];\\\\n        } else if (code < 0x800) {\\\\n          blocks[i >> 2] |= (0xc0 | code >> 6) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        } else if (code < 0xd800 || code >= 0xe000) {\\\\n          blocks[i >> 2] |= (0xe0 | code >> 12) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        } else {\\\\n          code = 0x10000 + ((code & 0x3ff) << 10 | message.charCodeAt(++index) & 0x3ff);\\\\n          blocks[i >> 2] |= (0xf0 | code >> 18) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 12 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code >> 6 & 0x3f) << SHIFT[i++ & 3];\\\\n          blocks[i >> 2] |= (0x80 | code & 0x3f) << SHIFT[i++ & 3];\\\\n        }\\\\n      }\\\\n    }\\\\n    state.lastByteIndex = i;\\\\n    if (i >= byteCount) {\\\\n      state.start = i - byteCount;\\\\n      state.block = blocks[blockCount];\\\\n      for (i = 0; i < blockCount; ++i) {\\\\n        s[i] ^= blocks[i];\\\\n      }\\\\n      f(s);\\\\n      state.reset = true;\\\\n    } else {\\\\n      state.start = i;\\\\n    }\\\\n  }\\\\n\\\\n  // finalize\\\\n  i = state.lastByteIndex;\\\\n  blocks[i >> 2] |= KECCAK_PADDING[i & 3];\\\\n  if (state.lastByteIndex === byteCount) {\\\\n    blocks[0] = blocks[blockCount];\\\\n    for (i = 1; i < blockCount + 1; ++i) {\\\\n      blocks[i] = 0;\\\\n    }\\\\n  }\\\\n  blocks[blockCount - 1] |= 0x80000000;\\\\n  for (i = 0; i < blockCount; ++i) {\\\\n    s[i] ^= blocks[i];\\\\n  }\\\\n  f(s);\\\\n\\\\n  // toString\\\\n  var hex = \\\\\'\\\\\',\\\\n      i = 0,\\\\n      j = 0,\\\\n      block;\\\\n  while (j < outputBlocks) {\\\\n    for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {\\\\n      block = s[i];\\\\n      hex += HEX_CHARS[block >> 4 & 0x0F] + HEX_CHARS[block & 0x0F] + HEX_CHARS[block >> 12 & 0x0F] + HEX_CHARS[block >> 8 & 0x0F] + HEX_CHARS[block >> 20 & 0x0F] + HEX_CHARS[block >> 16 & 0x0F] + HEX_CHARS[block >> 28 & 0x0F] + HEX_CHARS[block >> 24 & 0x0F];\\\\n    }\\\\n    if (j % blockCount === 0) {\\\\n      f(s);\\\\n      i = 0;\\\\n    }\\\\n  }\\\\n  return \\"0x\\" + hex;\\\\n};\\\\n\\\\nvar f = function f(s) {\\\\n  var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;\\\\n\\\\n  for (n = 0; n < 48; n += 2) {\\\\n    c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];\\\\n    c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];\\\\n    c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];\\\\n    c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];\\\\n    c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];\\\\n    c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];\\\\n    c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];\\\\n    c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];\\\\n    c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];\\\\n    c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];\\\\n\\\\n    h = c8 ^ (c2 << 1 | c3 >>> 31);\\\\n    l = c9 ^ (c3 << 1 | c2 >>> 31);\\\\n    s[0] ^= h;\\\\n    s[1] ^= l;\\\\n    s[10] ^= h;\\\\n    s[11] ^= l;\\\\n    s[20] ^= h;\\\\n    s[21] ^= l;\\\\n    s[30] ^= h;\\\\n    s[31] ^= l;\\\\n    s[40] ^= h;\\\\n    s[41] ^= l;\\\\n    h = c0 ^ (c4 << 1 | c5 >>> 31);\\\\n    l = c1 ^ (c5 << 1 | c4 >>> 31);\\\\n    s[2] ^= h;\\\\n    s[3] ^= l;\\\\n    s[12] ^= h;\\\\n    s[13] ^= l;\\\\n    s[22] ^= h;\\\\n    s[23] ^= l;\\\\n    s[32] ^= h;\\\\n    s[33] ^= l;\\\\n    s[42] ^= h;\\\\n    s[43] ^= l;\\\\n    h = c2 ^ (c6 << 1 | c7 >>> 31);\\\\n    l = c3 ^ (c7 << 1 | c6 >>> 31);\\\\n    s[4] ^= h;\\\\n    s[5] ^= l;\\\\n    s[14] ^= h;\\\\n    s[15] ^= l;\\\\n    s[24] ^= h;\\\\n    s[25] ^= l;\\\\n    s[34] ^= h;\\\\n    s[35] ^= l;\\\\n    s[44] ^= h;\\\\n    s[45] ^= l;\\\\n    h = c4 ^ (c8 << 1 | c9 >>> 31);\\\\n    l = c5 ^ (c9 << 1 | c8 >>> 31);\\\\n    s[6] ^= h;\\\\n    s[7] ^= l;\\\\n    s[16] ^= h;\\\\n    s[17] ^= l;\\\\n    s[26] ^= h;\\\\n    s[27] ^= l;\\\\n    s[36] ^= h;\\\\n    s[37] ^= l;\\\\n    s[46] ^= h;\\\\n    s[47] ^= l;\\\\n    h = c6 ^ (c0 << 1 | c1 >>> 31);\\\\n    l = c7 ^ (c1 << 1 | c0 >>> 31);\\\\n    s[8] ^= h;\\\\n    s[9] ^= l;\\\\n    s[18] ^= h;\\\\n    s[19] ^= l;\\\\n    s[28] ^= h;\\\\n    s[29] ^= l;\\\\n    s[38] ^= h;\\\\n    s[39] ^= l;\\\\n    s[48] ^= h;\\\\n    s[49] ^= l;\\\\n\\\\n    b0 = s[0];\\\\n    b1 = s[1];\\\\n    b32 = s[11] << 4 | s[10] >>> 28;\\\\n    b33 = s[10] << 4 | s[11] >>> 28;\\\\n    b14 = s[20] << 3 | s[21] >>> 29;\\\\n    b15 = s[21] << 3 | s[20] >>> 29;\\\\n    b46 = s[31] << 9 | s[30] >>> 23;\\\\n    b47 = s[30] << 9 | s[31] >>> 23;\\\\n    b28 = s[40] << 18 | s[41] >>> 14;\\\\n    b29 = s[41] << 18 | s[40] >>> 14;\\\\n    b20 = s[2] << 1 | s[3] >>> 31;\\\\n    b21 = s[3] << 1 | s[2] >>> 31;\\\\n    b2 = s[13] << 12 | s[12] >>> 20;\\\\n    b3 = s[12] << 12 | s[13] >>> 20;\\\\n    b34 = s[22] << 10 | s[23] >>> 22;\\\\n    b35 = s[23] << 10 | s[22] >>> 22;\\\\n    b16 = s[33] << 13 | s[32] >>> 19;\\\\n    b17 = s[32] << 13 | s[33] >>> 19;\\\\n    b48 = s[42] << 2 | s[43] >>> 30;\\\\n    b49 = s[43] << 2 | s[42] >>> 30;\\\\n    b40 = s[5] << 30 | s[4] >>> 2;\\\\n    b41 = s[4] << 30 | s[5] >>> 2;\\\\n    b22 = s[14] << 6 | s[15] >>> 26;\\\\n    b23 = s[15] << 6 | s[14] >>> 26;\\\\n    b4 = s[25] << 11 | s[24] >>> 21;\\\\n    b5 = s[24] << 11 | s[25] >>> 21;\\\\n    b36 = s[34] << 15 | s[35] >>> 17;\\\\n    b37 = s[35] << 15 | s[34] >>> 17;\\\\n    b18 = s[45] << 29 | s[44] >>> 3;\\\\n    b19 = s[44] << 29 | s[45] >>> 3;\\\\n    b10 = s[6] << 28 | s[7] >>> 4;\\\\n    b11 = s[7] << 28 | s[6] >>> 4;\\\\n    b42 = s[17] << 23 | s[16] >>> 9;\\\\n    b43 = s[16] << 23 | s[17] >>> 9;\\\\n    b24 = s[26] << 25 | s[27] >>> 7;\\\\n    b25 = s[27] << 25 | s[26] >>> 7;\\\\n    b6 = s[36] << 21 | s[37] >>> 11;\\\\n    b7 = s[37] << 21 | s[36] >>> 11;\\\\n    b38 = s[47] << 24 | s[46] >>> 8;\\\\n    b39 = s[46] << 24 | s[47] >>> 8;\\\\n    b30 = s[8] << 27 | s[9] >>> 5;\\\\n    b31 = s[9] << 27 | s[8] >>> 5;\\\\n    b12 = s[18] << 20 | s[19] >>> 12;\\\\n    b13 = s[19] << 20 | s[18] >>> 12;\\\\n    b44 = s[29] << 7 | s[28] >>> 25;\\\\n    b45 = s[28] << 7 | s[29] >>> 25;\\\\n    b26 = s[38] << 8 | s[39] >>> 24;\\\\n    b27 = s[39] << 8 | s[38] >>> 24;\\\\n    b8 = s[48] << 14 | s[49] >>> 18;\\\\n    b9 = s[49] << 14 | s[48] >>> 18;\\\\n\\\\n    s[0] = b0 ^ ~b2 & b4;\\\\n    s[1] = b1 ^ ~b3 & b5;\\\\n    s[10] = b10 ^ ~b12 & b14;\\\\n    s[11] = b11 ^ ~b13 & b15;\\\\n    s[20] = b20 ^ ~b22 & b24;\\\\n    s[21] = b21 ^ ~b23 & b25;\\\\n    s[30] = b30 ^ ~b32 & b34;\\\\n    s[31] = b31 ^ ~b33 & b35;\\\\n    s[40] = b40 ^ ~b42 & b44;\\\\n    s[41] = b41 ^ ~b43 & b45;\\\\n    s[2] = b2 ^ ~b4 & b6;\\\\n    s[3] = b3 ^ ~b5 & b7;\\\\n    s[12] = b12 ^ ~b14 & b16;\\\\n    s[13] = b13 ^ ~b15 & b17;\\\\n    s[22] = b22 ^ ~b24 & b26;\\\\n    s[23] = b23 ^ ~b25 & b27;\\\\n    s[32] = b32 ^ ~b34 & b36;\\\\n    s[33] = b33 ^ ~b35 & b37;\\\\n    s[42] = b42 ^ ~b44 & b46;\\\\n    s[43] = b43 ^ ~b45 & b47;\\\\n    s[4] = b4 ^ ~b6 & b8;\\\\n    s[5] = b5 ^ ~b7 & b9;\\\\n    s[14] = b14 ^ ~b16 & b18;\\\\n    s[15] = b15 ^ ~b17 & b19;\\\\n    s[24] = b24 ^ ~b26 & b28;\\\\n    s[25] = b25 ^ ~b27 & b29;\\\\n    s[34] = b34 ^ ~b36 & b38;\\\\n    s[35] = b35 ^ ~b37 & b39;\\\\n    s[44] = b44 ^ ~b46 & b48;\\\\n    s[45] = b45 ^ ~b47 & b49;\\\\n    s[6] = b6 ^ ~b8 & b0;\\\\n    s[7] = b7 ^ ~b9 & b1;\\\\n    s[16] = b16 ^ ~b18 & b10;\\\\n    s[17] = b17 ^ ~b19 & b11;\\\\n    s[26] = b26 ^ ~b28 & b20;\\\\n    s[27] = b27 ^ ~b29 & b21;\\\\n    s[36] = b36 ^ ~b38 & b30;\\\\n    s[37] = b37 ^ ~b39 & b31;\\\\n    s[46] = b46 ^ ~b48 & b40;\\\\n    s[47] = b47 ^ ~b49 & b41;\\\\n    s[8] = b8 ^ ~b0 & b2;\\\\n    s[9] = b9 ^ ~b1 & b3;\\\\n    s[18] = b18 ^ ~b10 & b12;\\\\n    s[19] = b19 ^ ~b11 & b13;\\\\n    s[28] = b28 ^ ~b20 & b22;\\\\n    s[29] = b29 ^ ~b21 & b23;\\\\n    s[38] = b38 ^ ~b30 & b32;\\\\n    s[39] = b39 ^ ~b31 & b33;\\\\n    s[48] = b48 ^ ~b40 & b42;\\\\n    s[49] = b49 ^ ~b41 & b43;\\\\n\\\\n    s[0] ^= RC[n];\\\\n    s[1] ^= RC[n + 1];\\\\n  }\\\\n};\\\\n\\\\nvar keccak = function keccak(bits) {\\\\n  return function (str) {\\\\n    var msg;\\\\n    if (str.slice(0, 2) === \\"0x\\") {\\\\n      msg = [];\\\\n      for (var i = 2, l = str.length; i < l; i += 2) {\\\\n        msg.push(parseInt(str.slice(i, i + 2), 16));\\\\n      }\\\\n    } else {\\\\n      msg = str;\\\\n    }\\\\n    return update(Keccak(bits, bits), msg);\\\\n  };\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  keccak256: keccak(256),\\\\n  keccak512: keccak(512),\\\\n  keccak256s: keccak(256),\\\\n  keccak512s: keccak(512)\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/hash.js\\\\n// module id = 159\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/hash.js\')},function(module,exports,__webpack_require__){eval(\'var BN = __webpack_require__(3);\\\\nvar Bytes = __webpack_require__(92);\\\\n\\\\nvar fromBN = function fromBN(bn) {\\\\n  return \\"0x\\" + bn.toString(\\"hex\\");\\\\n};\\\\n\\\\nvar toBN = function toBN(str) {\\\\n  return new BN(str.slice(2), 16);\\\\n};\\\\n\\\\nvar fromString = function fromString(str) {\\\\n  var bn = \\"0x\\" + (str.slice(0, 2) === \\"0x\\" ? new BN(str.slice(2), 16) : new BN(str, 10)).toString(\\"hex\\");\\\\n  return bn === \\"0x0\\" ? \\"0x\\" : bn;\\\\n};\\\\n\\\\nvar toEther = function toEther(wei) {\\\\n  return toNumber(div(wei, fromString(\\"10000000000\\"))) / 100000000;\\\\n};\\\\n\\\\nvar fromEther = function fromEther(eth) {\\\\n  return mul(fromNumber(Math.floor(eth * 100000000)), fromString(\\"10000000000\\"));\\\\n};\\\\n\\\\nvar toString = function toString(a) {\\\\n  return toBN(a).toString(10);\\\\n};\\\\n\\\\nvar fromNumber = function fromNumber(a) {\\\\n  return typeof a === \\"string\\" ? /^0x/.test(a) ? a : \\"0x\\" + a : \\"0x\\" + new BN(a).toString(\\"hex\\");\\\\n};\\\\n\\\\nvar toNumber = function toNumber(a) {\\\\n  return toBN(a).toNumber();\\\\n};\\\\n\\\\nvar toUint256 = function toUint256(a) {\\\\n  return Bytes.pad(32, a);\\\\n};\\\\n\\\\nvar bin = function bin(method) {\\\\n  return function (a, b) {\\\\n    return fromBN(toBN(a)[method](toBN(b)));\\\\n  };\\\\n};\\\\n\\\\nvar add = bin(\\"add\\");\\\\nvar mul = bin(\\"mul\\");\\\\nvar div = bin(\\"div\\");\\\\nvar sub = bin(\\"sub\\");\\\\n\\\\nmodule.exports = {\\\\n  toString: toString,\\\\n  fromString: fromString,\\\\n  toNumber: toNumber,\\\\n  fromNumber: fromNumber,\\\\n  toEther: toEther,\\\\n  fromEther: fromEther,\\\\n  toUint256: toUint256,\\\\n  add: add,\\\\n  mul: mul,\\\\n  div: div,\\\\n  sub: sub\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/nat.js\\\\n// module id = 160\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/nat.js\')},function(module,exports){eval(\'// The RLP format\\\\n// Serialization and deserialization for the BytesTree type, under the following grammar:\\\\n// | First byte | Meaning                                                                    |\\\\n// | ---------- | -------------------------------------------------------------------------- |\\\\n// | 0   to 127 | HEX(leaf)                                                                  |\\\\n// | 128 to 183 | HEX(length_of_leaf + 128) + HEX(leaf)                                      |\\\\n// | 184 to 191 | HEX(length_of_length_of_leaf + 128 + 55) + HEX(length_of_leaf) + HEX(leaf) |\\\\n// | 192 to 247 | HEX(length_of_node + 192) + HEX(node)                                      |\\\\n// | 248 to 255 | HEX(length_of_length_of_node + 128 + 55) + HEX(length_of_node) + HEX(node) |\\\\n\\\\nvar encode = function encode(tree) {\\\\n  var padEven = function padEven(str) {\\\\n    return str.length % 2 === 0 ? str : \\"0\\" + str;\\\\n  };\\\\n\\\\n  var uint = function uint(num) {\\\\n    return padEven(num.toString(16));\\\\n  };\\\\n\\\\n  var length = function length(len, add) {\\\\n    return len < 56 ? uint(add + len) : uint(add + uint(len).length / 2 + 55) + uint(len);\\\\n  };\\\\n\\\\n  var dataTree = function dataTree(tree) {\\\\n    if (typeof tree === \\"string\\") {\\\\n      var hex = tree.slice(2);\\\\n      var pre = hex.length != 2 || hex >= \\"80\\" ? length(hex.length / 2, 128) : \\"\\";\\\\n      return pre + hex;\\\\n    } else {\\\\n      var _hex = tree.map(dataTree).join(\\"\\");\\\\n      var _pre = length(_hex.length / 2, 192);\\\\n      return _pre + _hex;\\\\n    }\\\\n  };\\\\n\\\\n  return \\"0x\\" + dataTree(tree);\\\\n};\\\\n\\\\nvar decode = function decode(hex) {\\\\n  var i = 2;\\\\n\\\\n  var parseTree = function parseTree() {\\\\n    if (i >= hex.length) throw \\"\\";\\\\n    var head = hex.slice(i, i + 2);\\\\n    return head < \\"80\\" ? (i += 2, \\"0x\\" + head) : head < \\"c0\\" ? parseHex() : parseList();\\\\n  };\\\\n\\\\n  var parseLength = function parseLength() {\\\\n    var len = parseInt(hex.slice(i, i += 2), 16) % 64;\\\\n    return len < 56 ? len : parseInt(hex.slice(i, i += (len - 55) * 2), 16);\\\\n  };\\\\n\\\\n  var parseHex = function parseHex() {\\\\n    var len = parseLength();\\\\n    return \\"0x\\" + hex.slice(i, i += len * 2);\\\\n  };\\\\n\\\\n  var parseList = function parseList() {\\\\n    var lim = parseLength() * 2 + i;\\\\n    var list = [];\\\\n    while (i < lim) {\\\\n      list.push(parseTree());\\\\n    }return list;\\\\n  };\\\\n\\\\n  try {\\\\n    return parseTree();\\\\n  } catch (e) {\\\\n    return [];\\\\n  }\\\\n};\\\\n\\\\nmodule.exports = { encode: encode, decode: decode };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/rlp.js\\\\n// module id = 161\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/rlp.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file iban.js\\\\n *\\\\n * Details: https://github.com/ethereum/wiki/wiki/ICAP:-Inter-exchange-Client-Address-Protocol\\\\n *\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @date 2015\\\\n */\\\\n\\\\n\\\\n\\\\nvar utils = __webpack_require__(10);\\\\nvar BigNumber = __webpack_require__(3);\\\\n\\\\n\\\\nvar leftPad = function (string, bytes) {\\\\n    var result = string;\\\\n    while (result.length < bytes * 2) {\\\\n        result = \'0\' + result;\\\\n    }\\\\n    return result;\\\\n};\\\\n\\\\n/**\\\\n * Prepare an IBAN for mod 97 computation by moving the first 4 chars to the end and transforming the letters to\\\\n * numbers (A = 10, B = 11, ..., Z = 35), as specified in ISO13616.\\\\n *\\\\n * @method iso13616Prepare\\\\n * @param {String} iban the IBAN\\\\n * @returns {String} the prepared IBAN\\\\n */\\\\nvar iso13616Prepare = function (iban) {\\\\n    var A = \'A\'.charCodeAt(0);\\\\n    var Z = \'Z\'.charCodeAt(0);\\\\n\\\\n    iban = iban.toUpperCase();\\\\n    iban = iban.substr(4) + iban.substr(0,4);\\\\n\\\\n    return iban.split(\'\').map(function(n){\\\\n        var code = n.charCodeAt(0);\\\\n        if (code >= A && code <= Z){\\\\n            // A = 10, B = 11, ... Z = 35\\\\n            return code - A + 10;\\\\n        } else {\\\\n            return n;\\\\n        }\\\\n    }).join(\'\');\\\\n};\\\\n\\\\n/**\\\\n * Calculates the MOD 97 10 of the passed IBAN as specified in ISO7064.\\\\n *\\\\n * @method mod9710\\\\n * @param {String} iban\\\\n * @returns {Number}\\\\n */\\\\nvar mod9710 = function (iban) {\\\\n    var remainder = iban,\\\\n        block;\\\\n\\\\n    while (remainder.length > 2){\\\\n        block = remainder.slice(0, 9);\\\\n        remainder = parseInt(block, 10) % 97 + remainder.slice(block.length);\\\\n    }\\\\n\\\\n    return parseInt(remainder, 10) % 97;\\\\n};\\\\n\\\\n/**\\\\n * This prototype should be used to create iban object from iban correct string\\\\n *\\\\n * @param {String} iban\\\\n */\\\\nvar Iban = function Iban(iban) {\\\\n    this._iban = iban;\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to create an ethereum address from a direct iban address\\\\n *\\\\n * @method toAddress\\\\n * @param {String} iban address\\\\n * @return {String} the ethereum address\\\\n */\\\\nIban.toAddress = function (ib) {\\\\n    ib = new Iban(ib);\\\\n\\\\n    if(!ib.isDirect()) {\\\\n        throw new Error(\'IBAN is indirect and can\\\\\\\\\'t be converted\');\\\\n    }\\\\n\\\\n    return ib.toAddress();\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to create iban address from an ethereum address\\\\n *\\\\n * @method toIban\\\\n * @param {String} address\\\\n * @return {String} the IBAN address\\\\n */\\\\nIban.toIban = function (address) {\\\\n    return Iban.fromAddress(address).toString();\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to create iban object from an ethereum address\\\\n *\\\\n * @method fromAddress\\\\n * @param {String} address\\\\n * @return {Iban} the IBAN object\\\\n */\\\\nIban.fromAddress = function (address) {\\\\n    if(!utils.isAddress(address)){\\\\n        throw new Error(\'Provided address is not a valid address: \'+ address);\\\\n    }\\\\n\\\\n    address = address.replace(\'0x\',\'\').replace(\'0X\',\'\');\\\\n\\\\n    var asBn = new BigNumber(address, 16);\\\\n    var base36 = asBn.toString(36);\\\\n    var padded = leftPad(base36, 15);\\\\n    return Iban.fromBban(padded.toUpperCase());\\\\n};\\\\n\\\\n/**\\\\n * Convert the passed BBAN to an IBAN for this country specification.\\\\n * Please note that <i>\\\\\\"generation of the IBAN shall be the exclusive responsibility of the bank/branch servicing the account\\\\\\"</i>.\\\\n * This method implements the preferred algorithm described in http://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits\\\\n *\\\\n * @method fromBban\\\\n * @param {String} bban the BBAN to convert to IBAN\\\\n * @returns {Iban} the IBAN object\\\\n */\\\\nIban.fromBban = function (bban) {\\\\n    var countryCode = \'XE\';\\\\n\\\\n    var remainder = mod9710(iso13616Prepare(countryCode + \'00\' + bban));\\\\n    var checkDigit = (\'0\' + (98 - remainder)).slice(-2);\\\\n\\\\n    return new Iban(countryCode + checkDigit + bban);\\\\n};\\\\n\\\\n/**\\\\n * Should be used to create IBAN object for given institution and identifier\\\\n *\\\\n * @method createIndirect\\\\n * @param {Object} options, required options are \\\\\\"institution\\\\\\" and \\\\\\"identifier\\\\\\"\\\\n * @return {Iban} the IBAN object\\\\n */\\\\nIban.createIndirect = function (options) {\\\\n    return Iban.fromBban(\'ETH\' + options.institution + options.identifier);\\\\n};\\\\n\\\\n/**\\\\n * This method should be used to check if given string is valid iban object\\\\n *\\\\n * @method isValid\\\\n * @param {String} iban string\\\\n * @return {Boolean} true if it is valid IBAN\\\\n */\\\\nIban.isValid = function (iban) {\\\\n    var i = new Iban(iban);\\\\n    return i.isValid();\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if iban is correct\\\\n *\\\\n * @method isValid\\\\n * @returns {Boolean} true if it is, otherwise false\\\\n */\\\\nIban.prototype.isValid = function () {\\\\n    return /^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban) &&\\\\n        mod9710(iso13616Prepare(this._iban)) === 1;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if iban number is direct\\\\n *\\\\n * @method isDirect\\\\n * @returns {Boolean} true if it is, otherwise false\\\\n */\\\\nIban.prototype.isDirect = function () {\\\\n    return this._iban.length === 34 || this._iban.length === 35;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if iban number if indirect\\\\n *\\\\n * @method isIndirect\\\\n * @returns {Boolean} true if it is, otherwise false\\\\n */\\\\nIban.prototype.isIndirect = function () {\\\\n    return this._iban.length === 20;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get iban checksum\\\\n * Uses the mod-97-10 checksumming protocol (ISO/IEC 7064:2003)\\\\n *\\\\n * @method checksum\\\\n * @returns {String} checksum\\\\n */\\\\nIban.prototype.checksum = function () {\\\\n    return this._iban.substr(2, 2);\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get institution identifier\\\\n * eg. XREG\\\\n *\\\\n * @method institution\\\\n * @returns {String} institution identifier\\\\n */\\\\nIban.prototype.institution = function () {\\\\n    return this.isIndirect() ? this._iban.substr(7, 4) : \'\';\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get client identifier within institution\\\\n * eg. GAVOFYORK\\\\n *\\\\n * @method client\\\\n * @returns {String} client identifier\\\\n */\\\\nIban.prototype.client = function () {\\\\n    return this.isIndirect() ? this._iban.substr(11) : \'\';\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get client direct address\\\\n *\\\\n * @method toAddress\\\\n * @returns {String} ethereum address\\\\n */\\\\nIban.prototype.toAddress = function () {\\\\n    if (this.isDirect()) {\\\\n        var base36 = this._iban.substr(4);\\\\n        var asBn = new BigNumber(base36, 36);\\\\n        return utils.toChecksumAddress(asBn.toString(16, 20));\\\\n    }\\\\n\\\\n    return \'\';\\\\n};\\\\n\\\\nIban.prototype.toString = function () {\\\\n    return this._iban;\\\\n};\\\\n\\\\nmodule.exports = Iban;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-iban/src/index.js\\\\n// module id = 162\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-iban/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar core = __webpack_require__(26);\\\\nvar Method = __webpack_require__(25);\\\\nvar utils = __webpack_require__(10);\\\\nvar Net = __webpack_require__(58);\\\\n\\\\nvar formatters = __webpack_require__(7).formatters;\\\\n\\\\n\\\\nvar Personal = function Personal() {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, arguments);\\\\n\\\\n    this.net = new Net(this.currentProvider);\\\\n\\\\n    var defaultAccount = null;\\\\n    var defaultBlock = \'latest\';\\\\n\\\\n    Object.defineProperty(this, \'defaultAccount\', {\\\\n        get: function () {\\\\n            return defaultAccount;\\\\n        },\\\\n        set: function (val) {\\\\n            if(val) {\\\\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\\\\n            }\\\\n\\\\n            // update defaultBlock\\\\n            methods.forEach(function(method) {\\\\n                method.defaultAccount = defaultAccount;\\\\n            });\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n    Object.defineProperty(this, \'defaultBlock\', {\\\\n        get: function () {\\\\n            return defaultBlock;\\\\n        },\\\\n        set: function (val) {\\\\n            defaultBlock = val;\\\\n\\\\n            // update defaultBlock\\\\n            methods.forEach(function(method) {\\\\n                method.defaultBlock = defaultBlock;\\\\n            });\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n\\\\n\\\\n    var methods = [\\\\n        new Method({\\\\n            name: \'getAccounts\',\\\\n            call: \'personal_listAccounts\',\\\\n            params: 0,\\\\n            outputFormatter: utils.toChecksumAddress\\\\n        }),\\\\n        new Method({\\\\n            name: \'newAccount\',\\\\n            call: \'personal_newAccount\',\\\\n            params: 1,\\\\n            inputFormatter: [null],\\\\n            outputFormatter: utils.toChecksumAddress\\\\n        }),\\\\n        new Method({\\\\n            name: \'unlockAccount\',\\\\n            call: \'personal_unlockAccount\',\\\\n            params: 3,\\\\n            inputFormatter: [formatters.inputAddressFormatter, null, null]\\\\n        }),\\\\n        new Method({\\\\n            name: \'lockAccount\',\\\\n            call: \'personal_lockAccount\',\\\\n            params: 1,\\\\n            inputFormatter: [formatters.inputAddressFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'importRawKey\',\\\\n            call: \'personal_importRawKey\',\\\\n            params: 2\\\\n        }),\\\\n        new Method({\\\\n            name: \'sendTransaction\',\\\\n            call: \'personal_sendTransaction\',\\\\n            params: 2,\\\\n            inputFormatter: [formatters.inputTransactionFormatter, null]\\\\n        }),\\\\n        new Method({\\\\n            name: \'sign\',\\\\n            call: \'personal_sign\',\\\\n            params: 3,\\\\n            inputFormatter: [formatters.inputSignFormatter, formatters.inputAddressFormatter, null]\\\\n        }),\\\\n        new Method({\\\\n            name: \'ecRecover\',\\\\n            call: \'personal_ecRecover\',\\\\n            params: 2,\\\\n            inputFormatter: [formatters.inputSignFormatter, null]\\\\n        })\\\\n    ];\\\\n    methods.forEach(function(method) {\\\\n        method.attachToObject(_this);\\\\n        method.setRequestManager(_this._requestManager);\\\\n        method.defaultBlock = _this.defaultBlock;\\\\n        method.defaultAccount = _this.defaultAccount;\\\\n    });\\\\n};\\\\n\\\\ncore.addProviders(Personal);\\\\n\\\\n\\\\n\\\\nmodule.exports = Personal;\\\\n\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-personal/src/index.js\\\\n// module id = 163\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-personal/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\\\\n  \'use strict\';\\\\n\\\\n  // Utils\\\\n  function assert (val, msg) {\\\\n    if (!val) throw new Error(msg || \'Assertion failed\');\\\\n  }\\\\n\\\\n  // Could use `inherits` module, but don\'t want to move from single file\\\\n  // architecture yet.\\\\n  function inherits (ctor, superCtor) {\\\\n    ctor.super_ = superCtor;\\\\n    var TempCtor = function () {};\\\\n    TempCtor.prototype = superCtor.prototype;\\\\n    ctor.prototype = new TempCtor();\\\\n    ctor.prototype.constructor = ctor;\\\\n  }\\\\n\\\\n  // BN\\\\n\\\\n  function BN (number, base, endian) {\\\\n    if (BN.isBN(number)) {\\\\n      return number;\\\\n    }\\\\n\\\\n    this.negative = 0;\\\\n    this.words = null;\\\\n    this.length = 0;\\\\n\\\\n    // Reduction context\\\\n    this.red = null;\\\\n\\\\n    if (number !== null) {\\\\n      if (base === \'le\' || base === \'be\') {\\\\n        endian = base;\\\\n        base = 10;\\\\n      }\\\\n\\\\n      this._init(number || 0, base || 10, endian || \'be\');\\\\n    }\\\\n  }\\\\n  if (typeof module === \'object\') {\\\\n    module.exports = BN;\\\\n  } else {\\\\n    exports.BN = BN;\\\\n  }\\\\n\\\\n  BN.BN = BN;\\\\n  BN.wordSize = 26;\\\\n\\\\n  var Buffer;\\\\n  try {\\\\n    Buffer = __webpack_require__(1).Buffer;\\\\n  } catch (e) {\\\\n  }\\\\n\\\\n  BN.isBN = function isBN (num) {\\\\n    if (num instanceof BN) {\\\\n      return true;\\\\n    }\\\\n\\\\n    return num !== null && typeof num === \'object\' &&\\\\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\\\\n  };\\\\n\\\\n  BN.max = function max (left, right) {\\\\n    if (left.cmp(right) > 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.min = function min (left, right) {\\\\n    if (left.cmp(right) < 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.prototype._init = function init (number, base, endian) {\\\\n    if (typeof number === \'number\') {\\\\n      return this._initNumber(number, base, endian);\\\\n    }\\\\n\\\\n    if (typeof number === \'object\') {\\\\n      return this._initArray(number, base, endian);\\\\n    }\\\\n\\\\n    if (base === \'hex\') {\\\\n      base = 16;\\\\n    }\\\\n    assert(base === (base | 0) && base >= 2 && base <= 36);\\\\n\\\\n    number = number.toString().replace(/\\\\\\\\s+/g, \'\');\\\\n    var start = 0;\\\\n    if (number[0] === \'-\') {\\\\n      start++;\\\\n    }\\\\n\\\\n    if (base === 16) {\\\\n      this._parseHex(number, start);\\\\n    } else {\\\\n      this._parseBase(number, base, start);\\\\n    }\\\\n\\\\n    if (number[0] === \'-\') {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    this.strip();\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\\\\n    if (number < 0) {\\\\n      this.negative = 1;\\\\n      number = -number;\\\\n    }\\\\n    if (number < 0x4000000) {\\\\n      this.words = [ number & 0x3ffffff ];\\\\n      this.length = 1;\\\\n    } else if (number < 0x10000000000000) {\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff\\\\n      ];\\\\n      this.length = 2;\\\\n    } else {\\\\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff,\\\\n        1\\\\n      ];\\\\n      this.length = 3;\\\\n    }\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    // Reverse the bytes\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initArray = function _initArray (number, base, endian) {\\\\n    // Perhaps a Uint8Array\\\\n    assert(typeof number.length === \'number\');\\\\n    if (number.length <= 0) {\\\\n      this.words = [ 0 ];\\\\n      this.length = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.length = Math.ceil(number.length / 3);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    var off = 0;\\\\n    if (endian === \'be\') {\\\\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\\\\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    } else if (endian === \'le\') {\\\\n      for (i = 0, j = 0; i < number.length; i += 3) {\\\\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    }\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  function parseHex (str, start, end) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r <<= 4;\\\\n\\\\n      // \'a\' - \'f\'\\\\n      if (c >= 49 && c <= 54) {\\\\n        r |= c - 49 + 0xa;\\\\n\\\\n      // \'A\' - \'F\'\\\\n      } else if (c >= 17 && c <= 22) {\\\\n        r |= c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r |= c & 0xf;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseHex = function _parseHex (number, start) {\\\\n    // Create possibly bigger array to ensure that it fits the number\\\\n    this.length = Math.ceil((number.length - start) / 6);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    // Scan 24-bit chunks and add them to the number\\\\n    var off = 0;\\\\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\\\\n      w = parseHex(number, i, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n      off += 24;\\\\n      if (off >= 26) {\\\\n        off -= 26;\\\\n        j++;\\\\n      }\\\\n    }\\\\n    if (i + 6 !== start) {\\\\n      w = parseHex(number, start, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n    }\\\\n    this.strip();\\\\n  };\\\\n\\\\n  function parseBase (str, start, end, mul) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r *= mul;\\\\n\\\\n      // \'a\'\\\\n      if (c >= 49) {\\\\n        r += c - 49 + 0xa;\\\\n\\\\n      // \'A\'\\\\n      } else if (c >= 17) {\\\\n        r += c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r += c;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\\\\n    // Initialize as zero\\\\n    this.words = [ 0 ];\\\\n    this.length = 1;\\\\n\\\\n    // Find length of limb in base\\\\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\\\\n      limbLen++;\\\\n    }\\\\n    limbLen--;\\\\n    limbPow = (limbPow / base) | 0;\\\\n\\\\n    var total = number.length - start;\\\\n    var mod = total % limbLen;\\\\n    var end = Math.min(total, total - mod) + start;\\\\n\\\\n    var word = 0;\\\\n    for (var i = start; i < end; i += limbLen) {\\\\n      word = parseBase(number, i, i + limbLen, base);\\\\n\\\\n      this.imuln(limbPow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n\\\\n    if (mod !== 0) {\\\\n      var pow = 1;\\\\n      word = parseBase(number, i, number.length, base);\\\\n\\\\n      for (i = 0; i < mod; i++) {\\\\n        pow *= base;\\\\n      }\\\\n\\\\n      this.imuln(pow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  BN.prototype.copy = function copy (dest) {\\\\n    dest.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      dest.words[i] = this.words[i];\\\\n    }\\\\n    dest.length = this.length;\\\\n    dest.negative = this.negative;\\\\n    dest.red = this.red;\\\\n  };\\\\n\\\\n  BN.prototype.clone = function clone () {\\\\n    var r = new BN(null);\\\\n    this.copy(r);\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype._expand = function _expand (size) {\\\\n    while (this.length < size) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  // Remove leading `0` from `this`\\\\n  BN.prototype.strip = function strip () {\\\\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\\\\n      this.length--;\\\\n    }\\\\n    return this._normSign();\\\\n  };\\\\n\\\\n  BN.prototype._normSign = function _normSign () {\\\\n    // -0 = 0\\\\n    if (this.length === 1 && this.words[0] === 0) {\\\\n      this.negative = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.inspect = function inspect () {\\\\n    return (this.red ? \'<BN-R: \' : \'<BN: \') + this.toString(16) + \'>\';\\\\n  };\\\\n\\\\n  /*\\\\n\\\\n  var zeros = [];\\\\n  var groupSizes = [];\\\\n  var groupBases = [];\\\\n\\\\n  var s = \'\';\\\\n  var i = -1;\\\\n  while (++i < BN.wordSize) {\\\\n    zeros[i] = s;\\\\n    s += \'0\';\\\\n  }\\\\n  groupSizes[0] = 0;\\\\n  groupSizes[1] = 0;\\\\n  groupBases[0] = 0;\\\\n  groupBases[1] = 0;\\\\n  var base = 2 - 1;\\\\n  while (++base < 36 + 1) {\\\\n    var groupSize = 0;\\\\n    var groupBase = 1;\\\\n    while (groupBase < (1 << BN.wordSize) / base) {\\\\n      groupBase *= base;\\\\n      groupSize += 1;\\\\n    }\\\\n    groupSizes[base] = groupSize;\\\\n    groupBases[base] = groupBase;\\\\n  }\\\\n\\\\n  */\\\\n\\\\n  var zeros = [\\\\n    \'\',\\\\n    \'0\',\\\\n    \'00\',\\\\n    \'000\',\\\\n    \'0000\',\\\\n    \'00000\',\\\\n    \'000000\',\\\\n    \'0000000\',\\\\n    \'00000000\',\\\\n    \'000000000\',\\\\n    \'0000000000\',\\\\n    \'00000000000\',\\\\n    \'000000000000\',\\\\n    \'0000000000000\',\\\\n    \'00000000000000\',\\\\n    \'000000000000000\',\\\\n    \'0000000000000000\',\\\\n    \'00000000000000000\',\\\\n    \'000000000000000000\',\\\\n    \'0000000000000000000\',\\\\n    \'00000000000000000000\',\\\\n    \'000000000000000000000\',\\\\n    \'0000000000000000000000\',\\\\n    \'00000000000000000000000\',\\\\n    \'000000000000000000000000\',\\\\n    \'0000000000000000000000000\'\\\\n  ];\\\\n\\\\n  var groupSizes = [\\\\n    0, 0,\\\\n    25, 16, 12, 11, 10, 9, 8,\\\\n    8, 7, 7, 7, 7, 6, 6,\\\\n    6, 6, 6, 6, 6, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5\\\\n  ];\\\\n\\\\n  var groupBases = [\\\\n    0, 0,\\\\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\\\\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\\\\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\\\\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\\\\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\\\\n  ];\\\\n\\\\n  BN.prototype.toString = function toString (base, padding) {\\\\n    base = base || 10;\\\\n    padding = padding | 0 || 1;\\\\n\\\\n    var out;\\\\n    if (base === 16 || base === \'hex\') {\\\\n      out = \'\';\\\\n      var off = 0;\\\\n      var carry = 0;\\\\n      for (var i = 0; i < this.length; i++) {\\\\n        var w = this.words[i];\\\\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\\\\n        carry = (w >>> (24 - off)) & 0xffffff;\\\\n        if (carry !== 0 || i !== this.length - 1) {\\\\n          out = zeros[6 - word.length] + word + out;\\\\n        } else {\\\\n          out = word + out;\\\\n        }\\\\n        off += 2;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          i--;\\\\n        }\\\\n      }\\\\n      if (carry !== 0) {\\\\n        out = carry.toString(16) + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    if (base === (base | 0) && base >= 2 && base <= 36) {\\\\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\\\\n      var groupSize = groupSizes[base];\\\\n      // var groupBase = Math.pow(base, groupSize);\\\\n      var groupBase = groupBases[base];\\\\n      out = \'\';\\\\n      var c = this.clone();\\\\n      c.negative = 0;\\\\n      while (!c.isZero()) {\\\\n        var r = c.modn(groupBase).toString(base);\\\\n        c = c.idivn(groupBase);\\\\n\\\\n        if (!c.isZero()) {\\\\n          out = zeros[groupSize - r.length] + r + out;\\\\n        } else {\\\\n          out = r + out;\\\\n        }\\\\n      }\\\\n      if (this.isZero()) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    assert(false, \'Base should be between 2 and 36\');\\\\n  };\\\\n\\\\n  BN.prototype.toNumber = function toNumber () {\\\\n    var ret = this.words[0];\\\\n    if (this.length === 2) {\\\\n      ret += this.words[1] * 0x4000000;\\\\n    } else if (this.length === 3 && this.words[2] === 0x01) {\\\\n      // NOTE: at this stage it is known that the top bit is set\\\\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\\\\n    } else if (this.length > 2) {\\\\n      assert(false, \'Number can only safely store up to 53 bits\');\\\\n    }\\\\n    return (this.negative !== 0) ? -ret : ret;\\\\n  };\\\\n\\\\n  BN.prototype.toJSON = function toJSON () {\\\\n    return this.toString(16);\\\\n  };\\\\n\\\\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\\\\n    assert(typeof Buffer !== \'undefined\');\\\\n    return this.toArrayLike(Buffer, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArray = function toArray (endian, length) {\\\\n    return this.toArrayLike(Array, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\\\\n    var byteLength = this.byteLength();\\\\n    var reqLength = length || Math.max(1, byteLength);\\\\n    assert(byteLength <= reqLength, \'byte array longer than desired length\');\\\\n    assert(reqLength > 0, \'Requested array length <= 0\');\\\\n\\\\n    this.strip();\\\\n    var littleEndian = endian === \'le\';\\\\n    var res = new ArrayType(reqLength);\\\\n\\\\n    var b, i;\\\\n    var q = this.clone();\\\\n    if (!littleEndian) {\\\\n      // Assume big-endian\\\\n      for (i = 0; i < reqLength - byteLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[reqLength - i - 1] = b;\\\\n      }\\\\n    } else {\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[i] = b;\\\\n      }\\\\n\\\\n      for (; i < reqLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  if (Math.clz32) {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      return 32 - Math.clz32(w);\\\\n    };\\\\n  } else {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      var t = w;\\\\n      var r = 0;\\\\n      if (t >= 0x1000) {\\\\n        r += 13;\\\\n        t >>>= 13;\\\\n      }\\\\n      if (t >= 0x40) {\\\\n        r += 7;\\\\n        t >>>= 7;\\\\n      }\\\\n      if (t >= 0x8) {\\\\n        r += 4;\\\\n        t >>>= 4;\\\\n      }\\\\n      if (t >= 0x02) {\\\\n        r += 2;\\\\n        t >>>= 2;\\\\n      }\\\\n      return r + t;\\\\n    };\\\\n  }\\\\n\\\\n  BN.prototype._zeroBits = function _zeroBits (w) {\\\\n    // Short-cut\\\\n    if (w === 0) return 26;\\\\n\\\\n    var t = w;\\\\n    var r = 0;\\\\n    if ((t & 0x1fff) === 0) {\\\\n      r += 13;\\\\n      t >>>= 13;\\\\n    }\\\\n    if ((t & 0x7f) === 0) {\\\\n      r += 7;\\\\n      t >>>= 7;\\\\n    }\\\\n    if ((t & 0xf) === 0) {\\\\n      r += 4;\\\\n      t >>>= 4;\\\\n    }\\\\n    if ((t & 0x3) === 0) {\\\\n      r += 2;\\\\n      t >>>= 2;\\\\n    }\\\\n    if ((t & 0x1) === 0) {\\\\n      r++;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  // Return number of used bits in a BN\\\\n  BN.prototype.bitLength = function bitLength () {\\\\n    var w = this.words[this.length - 1];\\\\n    var hi = this._countBits(w);\\\\n    return (this.length - 1) * 26 + hi;\\\\n  };\\\\n\\\\n  function toBitArray (num) {\\\\n    var w = new Array(num.bitLength());\\\\n\\\\n    for (var bit = 0; bit < w.length; bit++) {\\\\n      var off = (bit / 26) | 0;\\\\n      var wbit = bit % 26;\\\\n\\\\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\\\\n    }\\\\n\\\\n    return w;\\\\n  }\\\\n\\\\n  // Number of trailing zero bits\\\\n  BN.prototype.zeroBits = function zeroBits () {\\\\n    if (this.isZero()) return 0;\\\\n\\\\n    var r = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var b = this._zeroBits(this.words[i]);\\\\n      r += b;\\\\n      if (b !== 26) break;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype.byteLength = function byteLength () {\\\\n    return Math.ceil(this.bitLength() / 8);\\\\n  };\\\\n\\\\n  BN.prototype.toTwos = function toTwos (width) {\\\\n    if (this.negative !== 0) {\\\\n      return this.abs().inotn(width).iaddn(1);\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.fromTwos = function fromTwos (width) {\\\\n    if (this.testn(width - 1)) {\\\\n      return this.notn(width).iaddn(1).ineg();\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.isNeg = function isNeg () {\\\\n    return this.negative !== 0;\\\\n  };\\\\n\\\\n  // Return negative clone of `this`\\\\n  BN.prototype.neg = function neg () {\\\\n    return this.clone().ineg();\\\\n  };\\\\n\\\\n  BN.prototype.ineg = function ineg () {\\\\n    if (!this.isZero()) {\\\\n      this.negative ^= 1;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Or `num` with `this` in-place\\\\n  BN.prototype.iuor = function iuor (num) {\\\\n    while (this.length < num.length) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      this.words[i] = this.words[i] | num.words[i];\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ior = function ior (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuor(num);\\\\n  };\\\\n\\\\n  // Or `num` with `this`\\\\n  BN.prototype.or = function or (num) {\\\\n    if (this.length > num.length) return this.clone().ior(num);\\\\n    return num.clone().ior(this);\\\\n  };\\\\n\\\\n  BN.prototype.uor = function uor (num) {\\\\n    if (this.length > num.length) return this.clone().iuor(num);\\\\n    return num.clone().iuor(this);\\\\n  };\\\\n\\\\n  // And `num` with `this` in-place\\\\n  BN.prototype.iuand = function iuand (num) {\\\\n    // b = min-length(num, this)\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      b = num;\\\\n    } else {\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = this.words[i] & num.words[i];\\\\n    }\\\\n\\\\n    this.length = b.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.iand = function iand (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuand(num);\\\\n  };\\\\n\\\\n  // And `num` with `this`\\\\n  BN.prototype.and = function and (num) {\\\\n    if (this.length > num.length) return this.clone().iand(num);\\\\n    return num.clone().iand(this);\\\\n  };\\\\n\\\\n  BN.prototype.uand = function uand (num) {\\\\n    if (this.length > num.length) return this.clone().iuand(num);\\\\n    return num.clone().iuand(this);\\\\n  };\\\\n\\\\n  // Xor `num` with `this` in-place\\\\n  BN.prototype.iuxor = function iuxor (num) {\\\\n    // a.length > b.length\\\\n    var a;\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = a.words[i] ^ b.words[i];\\\\n    }\\\\n\\\\n    if (this !== a) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ixor = function ixor (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuxor(num);\\\\n  };\\\\n\\\\n  // Xor `num` with `this`\\\\n  BN.prototype.xor = function xor (num) {\\\\n    if (this.length > num.length) return this.clone().ixor(num);\\\\n    return num.clone().ixor(this);\\\\n  };\\\\n\\\\n  BN.prototype.uxor = function uxor (num) {\\\\n    if (this.length > num.length) return this.clone().iuxor(num);\\\\n    return num.clone().iuxor(this);\\\\n  };\\\\n\\\\n  // Not ``this`` with ``width`` bitwidth\\\\n  BN.prototype.inotn = function inotn (width) {\\\\n    assert(typeof width === \'number\' && width >= 0);\\\\n\\\\n    var bytesNeeded = Math.ceil(width / 26) | 0;\\\\n    var bitsLeft = width % 26;\\\\n\\\\n    // Extend the buffer with leading zeroes\\\\n    this._expand(bytesNeeded);\\\\n\\\\n    if (bitsLeft > 0) {\\\\n      bytesNeeded--;\\\\n    }\\\\n\\\\n    // Handle complete words\\\\n    for (var i = 0; i < bytesNeeded; i++) {\\\\n      this.words[i] = ~this.words[i] & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Handle the residue\\\\n    if (bitsLeft > 0) {\\\\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\\\\n    }\\\\n\\\\n    // And remove leading zeroes\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.notn = function notn (width) {\\\\n    return this.clone().inotn(width);\\\\n  };\\\\n\\\\n  // Set `bit` of `this`\\\\n  BN.prototype.setn = function setn (bit, val) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n\\\\n    var off = (bit / 26) | 0;\\\\n    var wbit = bit % 26;\\\\n\\\\n    this._expand(off + 1);\\\\n\\\\n    if (val) {\\\\n      this.words[off] = this.words[off] | (1 << wbit);\\\\n    } else {\\\\n      this.words[off] = this.words[off] & ~(1 << wbit);\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Add `num` to `this` in-place\\\\n  BN.prototype.iadd = function iadd (num) {\\\\n    var r;\\\\n\\\\n    // negative + positive\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      this.negative = 0;\\\\n      r = this.isub(num);\\\\n      this.negative ^= 1;\\\\n      return this._normSign();\\\\n\\\\n    // positive + negative\\\\n    } else if (this.negative === 0 && num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      r = this.isub(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n    }\\\\n\\\\n    // a.length > b.length\\\\n    var a, b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n    if (carry !== 0) {\\\\n      this.words[this.length] = carry;\\\\n      this.length++;\\\\n    // Copy the rest of the words\\\\n    } else if (a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Add `num` to `this`\\\\n  BN.prototype.add = function add (num) {\\\\n    var res;\\\\n    if (num.negative !== 0 && this.negative === 0) {\\\\n      num.negative = 0;\\\\n      res = this.sub(num);\\\\n      num.negative ^= 1;\\\\n      return res;\\\\n    } else if (num.negative === 0 && this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      res = num.sub(this);\\\\n      this.negative = 1;\\\\n      return res;\\\\n    }\\\\n\\\\n    if (this.length > num.length) return this.clone().iadd(num);\\\\n\\\\n    return num.clone().iadd(this);\\\\n  };\\\\n\\\\n  // Subtract `num` from `this` in-place\\\\n  BN.prototype.isub = function isub (num) {\\\\n    // this - (-num) = this + num\\\\n    if (num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      var r = this.iadd(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n\\\\n    // -this - num = -(this + num)\\\\n    } else if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iadd(num);\\\\n      this.negative = 1;\\\\n      return this._normSign();\\\\n    }\\\\n\\\\n    // At this point both numbers are positive\\\\n    var cmp = this.cmp(num);\\\\n\\\\n    // Optimization - zeroify\\\\n    if (cmp === 0) {\\\\n      this.negative = 0;\\\\n      this.length = 1;\\\\n      this.words[0] = 0;\\\\n      return this;\\\\n    }\\\\n\\\\n    // a > b\\\\n    var a, b;\\\\n    if (cmp > 0) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Copy rest of the words\\\\n    if (carry === 0 && i < a.length && a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = Math.max(this.length, i);\\\\n\\\\n    if (a !== this) {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Subtract `num` from `this`\\\\n  BN.prototype.sub = function sub (num) {\\\\n    return this.clone().isub(num);\\\\n  };\\\\n\\\\n  function smallMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    var len = (self.length + num.length) | 0;\\\\n    out.length = len;\\\\n    len = (len - 1) | 0;\\\\n\\\\n    // Peel one iteration (compiler can\'t do it, because of code complexity)\\\\n    var a = self.words[0] | 0;\\\\n    var b = num.words[0] | 0;\\\\n    var r = a * b;\\\\n\\\\n    var lo = r & 0x3ffffff;\\\\n    var carry = (r / 0x4000000) | 0;\\\\n    out.words[0] = lo;\\\\n\\\\n    for (var k = 1; k < len; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = carry >>> 26;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = (k - j) | 0;\\\\n        a = self.words[i] | 0;\\\\n        b = num.words[j] | 0;\\\\n        r = a * b + rword;\\\\n        ncarry += (r / 0x4000000) | 0;\\\\n        rword = r & 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword | 0;\\\\n      carry = ncarry | 0;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry | 0;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  // TODO(indutny): it may be reasonable to omit it for users who don\'t need\\\\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\\\\n  // multiplication (like elliptic secp256k1).\\\\n  var comb10MulTo = function comb10MulTo (self, num, out) {\\\\n    var a = self.words;\\\\n    var b = num.words;\\\\n    var o = out.words;\\\\n    var c = 0;\\\\n    var lo;\\\\n    var mid;\\\\n    var hi;\\\\n    var a0 = a[0] | 0;\\\\n    var al0 = a0 & 0x1fff;\\\\n    var ah0 = a0 >>> 13;\\\\n    var a1 = a[1] | 0;\\\\n    var al1 = a1 & 0x1fff;\\\\n    var ah1 = a1 >>> 13;\\\\n    var a2 = a[2] | 0;\\\\n    var al2 = a2 & 0x1fff;\\\\n    var ah2 = a2 >>> 13;\\\\n    var a3 = a[3] | 0;\\\\n    var al3 = a3 & 0x1fff;\\\\n    var ah3 = a3 >>> 13;\\\\n    var a4 = a[4] | 0;\\\\n    var al4 = a4 & 0x1fff;\\\\n    var ah4 = a4 >>> 13;\\\\n    var a5 = a[5] | 0;\\\\n    var al5 = a5 & 0x1fff;\\\\n    var ah5 = a5 >>> 13;\\\\n    var a6 = a[6] | 0;\\\\n    var al6 = a6 & 0x1fff;\\\\n    var ah6 = a6 >>> 13;\\\\n    var a7 = a[7] | 0;\\\\n    var al7 = a7 & 0x1fff;\\\\n    var ah7 = a7 >>> 13;\\\\n    var a8 = a[8] | 0;\\\\n    var al8 = a8 & 0x1fff;\\\\n    var ah8 = a8 >>> 13;\\\\n    var a9 = a[9] | 0;\\\\n    var al9 = a9 & 0x1fff;\\\\n    var ah9 = a9 >>> 13;\\\\n    var b0 = b[0] | 0;\\\\n    var bl0 = b0 & 0x1fff;\\\\n    var bh0 = b0 >>> 13;\\\\n    var b1 = b[1] | 0;\\\\n    var bl1 = b1 & 0x1fff;\\\\n    var bh1 = b1 >>> 13;\\\\n    var b2 = b[2] | 0;\\\\n    var bl2 = b2 & 0x1fff;\\\\n    var bh2 = b2 >>> 13;\\\\n    var b3 = b[3] | 0;\\\\n    var bl3 = b3 & 0x1fff;\\\\n    var bh3 = b3 >>> 13;\\\\n    var b4 = b[4] | 0;\\\\n    var bl4 = b4 & 0x1fff;\\\\n    var bh4 = b4 >>> 13;\\\\n    var b5 = b[5] | 0;\\\\n    var bl5 = b5 & 0x1fff;\\\\n    var bh5 = b5 >>> 13;\\\\n    var b6 = b[6] | 0;\\\\n    var bl6 = b6 & 0x1fff;\\\\n    var bh6 = b6 >>> 13;\\\\n    var b7 = b[7] | 0;\\\\n    var bl7 = b7 & 0x1fff;\\\\n    var bh7 = b7 >>> 13;\\\\n    var b8 = b[8] | 0;\\\\n    var bl8 = b8 & 0x1fff;\\\\n    var bh8 = b8 >>> 13;\\\\n    var b9 = b[9] | 0;\\\\n    var bl9 = b9 & 0x1fff;\\\\n    var bh9 = b9 >>> 13;\\\\n\\\\n    out.negative = self.negative ^ num.negative;\\\\n    out.length = 19;\\\\n    /* k = 0 */\\\\n    lo = Math.imul(al0, bl0);\\\\n    mid = Math.imul(al0, bh0);\\\\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\\\\n    hi = Math.imul(ah0, bh0);\\\\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\\\\n    w0 &= 0x3ffffff;\\\\n    /* k = 1 */\\\\n    lo = Math.imul(al1, bl0);\\\\n    mid = Math.imul(al1, bh0);\\\\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\\\\n    hi = Math.imul(ah1, bh0);\\\\n    lo = (lo + Math.imul(al0, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\\\\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\\\\n    w1 &= 0x3ffffff;\\\\n    /* k = 2 */\\\\n    lo = Math.imul(al2, bl0);\\\\n    mid = Math.imul(al2, bh0);\\\\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\\\\n    hi = Math.imul(ah2, bh0);\\\\n    lo = (lo + Math.imul(al1, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\\\\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\\\\n    w2 &= 0x3ffffff;\\\\n    /* k = 3 */\\\\n    lo = Math.imul(al3, bl0);\\\\n    mid = Math.imul(al3, bh0);\\\\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\\\\n    hi = Math.imul(ah3, bh0);\\\\n    lo = (lo + Math.imul(al2, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\\\\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\\\\n    w3 &= 0x3ffffff;\\\\n    /* k = 4 */\\\\n    lo = Math.imul(al4, bl0);\\\\n    mid = Math.imul(al4, bh0);\\\\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\\\\n    hi = Math.imul(ah4, bh0);\\\\n    lo = (lo + Math.imul(al3, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\\\\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\\\\n    w4 &= 0x3ffffff;\\\\n    /* k = 5 */\\\\n    lo = Math.imul(al5, bl0);\\\\n    mid = Math.imul(al5, bh0);\\\\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\\\\n    hi = Math.imul(ah5, bh0);\\\\n    lo = (lo + Math.imul(al4, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\\\\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\\\\n    w5 &= 0x3ffffff;\\\\n    /* k = 6 */\\\\n    lo = Math.imul(al6, bl0);\\\\n    mid = Math.imul(al6, bh0);\\\\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\\\\n    hi = Math.imul(ah6, bh0);\\\\n    lo = (lo + Math.imul(al5, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\\\\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\\\\n    w6 &= 0x3ffffff;\\\\n    /* k = 7 */\\\\n    lo = Math.imul(al7, bl0);\\\\n    mid = Math.imul(al7, bh0);\\\\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\\\\n    hi = Math.imul(ah7, bh0);\\\\n    lo = (lo + Math.imul(al6, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\\\\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\\\\n    w7 &= 0x3ffffff;\\\\n    /* k = 8 */\\\\n    lo = Math.imul(al8, bl0);\\\\n    mid = Math.imul(al8, bh0);\\\\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\\\\n    hi = Math.imul(ah8, bh0);\\\\n    lo = (lo + Math.imul(al7, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\\\\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\\\\n    w8 &= 0x3ffffff;\\\\n    /* k = 9 */\\\\n    lo = Math.imul(al9, bl0);\\\\n    mid = Math.imul(al9, bh0);\\\\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\\\\n    hi = Math.imul(ah9, bh0);\\\\n    lo = (lo + Math.imul(al8, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\\\\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\\\\n    w9 &= 0x3ffffff;\\\\n    /* k = 10 */\\\\n    lo = Math.imul(al9, bl1);\\\\n    mid = Math.imul(al9, bh1);\\\\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\\\\n    hi = Math.imul(ah9, bh1);\\\\n    lo = (lo + Math.imul(al8, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\\\\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\\\\n    w10 &= 0x3ffffff;\\\\n    /* k = 11 */\\\\n    lo = Math.imul(al9, bl2);\\\\n    mid = Math.imul(al9, bh2);\\\\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\\\\n    hi = Math.imul(ah9, bh2);\\\\n    lo = (lo + Math.imul(al8, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\\\\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\\\\n    w11 &= 0x3ffffff;\\\\n    /* k = 12 */\\\\n    lo = Math.imul(al9, bl3);\\\\n    mid = Math.imul(al9, bh3);\\\\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\\\\n    hi = Math.imul(ah9, bh3);\\\\n    lo = (lo + Math.imul(al8, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\\\\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\\\\n    w12 &= 0x3ffffff;\\\\n    /* k = 13 */\\\\n    lo = Math.imul(al9, bl4);\\\\n    mid = Math.imul(al9, bh4);\\\\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\\\\n    hi = Math.imul(ah9, bh4);\\\\n    lo = (lo + Math.imul(al8, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\\\\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\\\\n    w13 &= 0x3ffffff;\\\\n    /* k = 14 */\\\\n    lo = Math.imul(al9, bl5);\\\\n    mid = Math.imul(al9, bh5);\\\\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\\\\n    hi = Math.imul(ah9, bh5);\\\\n    lo = (lo + Math.imul(al8, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\\\\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\\\\n    w14 &= 0x3ffffff;\\\\n    /* k = 15 */\\\\n    lo = Math.imul(al9, bl6);\\\\n    mid = Math.imul(al9, bh6);\\\\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\\\\n    hi = Math.imul(ah9, bh6);\\\\n    lo = (lo + Math.imul(al8, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\\\\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\\\\n    w15 &= 0x3ffffff;\\\\n    /* k = 16 */\\\\n    lo = Math.imul(al9, bl7);\\\\n    mid = Math.imul(al9, bh7);\\\\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\\\\n    hi = Math.imul(ah9, bh7);\\\\n    lo = (lo + Math.imul(al8, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\\\\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\\\\n    w16 &= 0x3ffffff;\\\\n    /* k = 17 */\\\\n    lo = Math.imul(al9, bl8);\\\\n    mid = Math.imul(al9, bh8);\\\\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\\\\n    hi = Math.imul(ah9, bh8);\\\\n    lo = (lo + Math.imul(al8, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\\\\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\\\\n    w17 &= 0x3ffffff;\\\\n    /* k = 18 */\\\\n    lo = Math.imul(al9, bl9);\\\\n    mid = Math.imul(al9, bh9);\\\\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\\\\n    hi = Math.imul(ah9, bh9);\\\\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\\\\n    w18 &= 0x3ffffff;\\\\n    o[0] = w0;\\\\n    o[1] = w1;\\\\n    o[2] = w2;\\\\n    o[3] = w3;\\\\n    o[4] = w4;\\\\n    o[5] = w5;\\\\n    o[6] = w6;\\\\n    o[7] = w7;\\\\n    o[8] = w8;\\\\n    o[9] = w9;\\\\n    o[10] = w10;\\\\n    o[11] = w11;\\\\n    o[12] = w12;\\\\n    o[13] = w13;\\\\n    o[14] = w14;\\\\n    o[15] = w15;\\\\n    o[16] = w16;\\\\n    o[17] = w17;\\\\n    o[18] = w18;\\\\n    if (c !== 0) {\\\\n      o[19] = c;\\\\n      out.length++;\\\\n    }\\\\n    return out;\\\\n  };\\\\n\\\\n  // Polyfill comb\\\\n  if (!Math.imul) {\\\\n    comb10MulTo = smallMulTo;\\\\n  }\\\\n\\\\n  function bigMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    out.length = self.length + num.length;\\\\n\\\\n    var carry = 0;\\\\n    var hncarry = 0;\\\\n    for (var k = 0; k < out.length - 1; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = hncarry;\\\\n      hncarry = 0;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = k - j;\\\\n        var a = self.words[i] | 0;\\\\n        var b = num.words[j] | 0;\\\\n        var r = a * b;\\\\n\\\\n        var lo = r & 0x3ffffff;\\\\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\\\\n        lo = (lo + rword) | 0;\\\\n        rword = lo & 0x3ffffff;\\\\n        ncarry = (ncarry + (lo >>> 26)) | 0;\\\\n\\\\n        hncarry += ncarry >>> 26;\\\\n        ncarry &= 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword;\\\\n      carry = ncarry;\\\\n      ncarry = hncarry;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  function jumboMulTo (self, num, out) {\\\\n    var fftm = new FFTM();\\\\n    return fftm.mulp(self, num, out);\\\\n  }\\\\n\\\\n  BN.prototype.mulTo = function mulTo (num, out) {\\\\n    var res;\\\\n    var len = this.length + num.length;\\\\n    if (this.length === 10 && num.length === 10) {\\\\n      res = comb10MulTo(this, num, out);\\\\n    } else if (len < 63) {\\\\n      res = smallMulTo(this, num, out);\\\\n    } else if (len < 1024) {\\\\n      res = bigMulTo(this, num, out);\\\\n    } else {\\\\n      res = jumboMulTo(this, num, out);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Cooley-Tukey algorithm for FFT\\\\n  // slightly revisited to rely on looping instead of recursion\\\\n\\\\n  function FFTM (x, y) {\\\\n    this.x = x;\\\\n    this.y = y;\\\\n  }\\\\n\\\\n  FFTM.prototype.makeRBT = function makeRBT (N) {\\\\n    var t = new Array(N);\\\\n    var l = BN.prototype._countBits(N) - 1;\\\\n    for (var i = 0; i < N; i++) {\\\\n      t[i] = this.revBin(i, l, N);\\\\n    }\\\\n\\\\n    return t;\\\\n  };\\\\n\\\\n  // Returns binary-reversed representation of `x`\\\\n  FFTM.prototype.revBin = function revBin (x, l, N) {\\\\n    if (x === 0 || x === N - 1) return x;\\\\n\\\\n    var rb = 0;\\\\n    for (var i = 0; i < l; i++) {\\\\n      rb |= (x & 1) << (l - i - 1);\\\\n      x >>= 1;\\\\n    }\\\\n\\\\n    return rb;\\\\n  };\\\\n\\\\n  // Performs \\\\\\"tweedling\\\\\\" phase, therefore \'emulating\'\\\\n  // behaviour of the recursive algorithm\\\\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\\\\n    for (var i = 0; i < N; i++) {\\\\n      rtws[i] = rws[rbt[i]];\\\\n      itws[i] = iws[rbt[i]];\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\\\\n    this.permute(rbt, rws, iws, rtws, itws, N);\\\\n\\\\n    for (var s = 1; s < N; s <<= 1) {\\\\n      var l = s << 1;\\\\n\\\\n      var rtwdf = Math.cos(2 * Math.PI / l);\\\\n      var itwdf = Math.sin(2 * Math.PI / l);\\\\n\\\\n      for (var p = 0; p < N; p += l) {\\\\n        var rtwdf_ = rtwdf;\\\\n        var itwdf_ = itwdf;\\\\n\\\\n        for (var j = 0; j < s; j++) {\\\\n          var re = rtws[p + j];\\\\n          var ie = itws[p + j];\\\\n\\\\n          var ro = rtws[p + j + s];\\\\n          var io = itws[p + j + s];\\\\n\\\\n          var rx = rtwdf_ * ro - itwdf_ * io;\\\\n\\\\n          io = rtwdf_ * io + itwdf_ * ro;\\\\n          ro = rx;\\\\n\\\\n          rtws[p + j] = re + ro;\\\\n          itws[p + j] = ie + io;\\\\n\\\\n          rtws[p + j + s] = re - ro;\\\\n          itws[p + j + s] = ie - io;\\\\n\\\\n          /* jshint maxdepth : false */\\\\n          if (j !== l) {\\\\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\\\\n\\\\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\\\\n            rtwdf_ = rx;\\\\n          }\\\\n        }\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\\\\n    var N = Math.max(m, n) | 1;\\\\n    var odd = N & 1;\\\\n    var i = 0;\\\\n    for (N = N / 2 | 0; N; N = N >>> 1) {\\\\n      i++;\\\\n    }\\\\n\\\\n    return 1 << i + 1 + odd;\\\\n  };\\\\n\\\\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\\\\n    if (N <= 1) return;\\\\n\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var t = rws[i];\\\\n\\\\n      rws[i] = rws[N - i - 1];\\\\n      rws[N - i - 1] = t;\\\\n\\\\n      t = iws[i];\\\\n\\\\n      iws[i] = -iws[N - i - 1];\\\\n      iws[N - i - 1] = -t;\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\\\\n        Math.round(ws[2 * i] / N) +\\\\n        carry;\\\\n\\\\n      ws[i] = w & 0x3ffffff;\\\\n\\\\n      if (w < 0x4000000) {\\\\n        carry = 0;\\\\n      } else {\\\\n        carry = w / 0x4000000 | 0;\\\\n      }\\\\n    }\\\\n\\\\n    return ws;\\\\n  };\\\\n\\\\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < len; i++) {\\\\n      carry = carry + (ws[i] | 0);\\\\n\\\\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\\\\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\\\\n    }\\\\n\\\\n    // Pad with zeroes\\\\n    for (i = 2 * len; i < N; ++i) {\\\\n      rws[i] = 0;\\\\n    }\\\\n\\\\n    assert(carry === 0);\\\\n    assert((carry & ~0x1fff) === 0);\\\\n  };\\\\n\\\\n  FFTM.prototype.stub = function stub (N) {\\\\n    var ph = new Array(N);\\\\n    for (var i = 0; i < N; i++) {\\\\n      ph[i] = 0;\\\\n    }\\\\n\\\\n    return ph;\\\\n  };\\\\n\\\\n  FFTM.prototype.mulp = function mulp (x, y, out) {\\\\n    var N = 2 * this.guessLen13b(x.length, y.length);\\\\n\\\\n    var rbt = this.makeRBT(N);\\\\n\\\\n    var _ = this.stub(N);\\\\n\\\\n    var rws = new Array(N);\\\\n    var rwst = new Array(N);\\\\n    var iwst = new Array(N);\\\\n\\\\n    var nrws = new Array(N);\\\\n    var nrwst = new Array(N);\\\\n    var niwst = new Array(N);\\\\n\\\\n    var rmws = out.words;\\\\n    rmws.length = N;\\\\n\\\\n    this.convert13b(x.words, x.length, rws, N);\\\\n    this.convert13b(y.words, y.length, nrws, N);\\\\n\\\\n    this.transform(rws, _, rwst, iwst, N, rbt);\\\\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\\\\n\\\\n    for (var i = 0; i < N; i++) {\\\\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\\\\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\\\\n      rwst[i] = rx;\\\\n    }\\\\n\\\\n    this.conjugate(rwst, iwst, N);\\\\n    this.transform(rwst, iwst, rmws, _, N, rbt);\\\\n    this.conjugate(rmws, _, N);\\\\n    this.normalize13b(rmws, N);\\\\n\\\\n    out.negative = x.negative ^ y.negative;\\\\n    out.length = x.length + y.length;\\\\n    return out.strip();\\\\n  };\\\\n\\\\n  // Multiply `this` by `num`\\\\n  BN.prototype.mul = function mul (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return this.mulTo(num, out);\\\\n  };\\\\n\\\\n  // Multiply employing FFT\\\\n  BN.prototype.mulf = function mulf (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return jumboMulTo(this, num, out);\\\\n  };\\\\n\\\\n  // In-place Multiplication\\\\n  BN.prototype.imul = function imul (num) {\\\\n    return this.clone().mulTo(num, this);\\\\n  };\\\\n\\\\n  BN.prototype.imuln = function imuln (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n\\\\n    // Carry\\\\n    var carry = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var w = (this.words[i] | 0) * num;\\\\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\\\\n      carry >>= 26;\\\\n      carry += (w / 0x4000000) | 0;\\\\n      // NOTE: lo is 27bit maximum\\\\n      carry += lo >>> 26;\\\\n      this.words[i] = lo & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.muln = function muln (num) {\\\\n    return this.clone().imuln(num);\\\\n  };\\\\n\\\\n  // `this` * `this`\\\\n  BN.prototype.sqr = function sqr () {\\\\n    return this.mul(this);\\\\n  };\\\\n\\\\n  // `this` * `this` in-place\\\\n  BN.prototype.isqr = function isqr () {\\\\n    return this.imul(this.clone());\\\\n  };\\\\n\\\\n  // Math.pow(`this`, `num`)\\\\n  BN.prototype.pow = function pow (num) {\\\\n    var w = toBitArray(num);\\\\n    if (w.length === 0) return new BN(1);\\\\n\\\\n    // Skip leading zeroes\\\\n    var res = this;\\\\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\\\\n      if (w[i] !== 0) break;\\\\n    }\\\\n\\\\n    if (++i < w.length) {\\\\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\\\\n        if (w[i] === 0) continue;\\\\n\\\\n        res = res.mul(q);\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Shift-left in-place\\\\n  BN.prototype.iushln = function iushln (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\\\\n    var i;\\\\n\\\\n    if (r !== 0) {\\\\n      var carry = 0;\\\\n\\\\n      for (i = 0; i < this.length; i++) {\\\\n        var newCarry = this.words[i] & carryMask;\\\\n        var c = ((this.words[i] | 0) - newCarry) << r;\\\\n        this.words[i] = c | carry;\\\\n        carry = newCarry >>> (26 - r);\\\\n      }\\\\n\\\\n      if (carry) {\\\\n        this.words[i] = carry;\\\\n        this.length++;\\\\n      }\\\\n    }\\\\n\\\\n    if (s !== 0) {\\\\n      for (i = this.length - 1; i >= 0; i--) {\\\\n        this.words[i + s] = this.words[i];\\\\n      }\\\\n\\\\n      for (i = 0; i < s; i++) {\\\\n        this.words[i] = 0;\\\\n      }\\\\n\\\\n      this.length += s;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishln = function ishln (bits) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right in-place\\\\n  // NOTE: `hint` is a lowest bit before trailing zeroes\\\\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\\\\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var h;\\\\n    if (hint) {\\\\n      h = (hint - (hint % 26)) / 26;\\\\n    } else {\\\\n      h = 0;\\\\n    }\\\\n\\\\n    var r = bits % 26;\\\\n    var s = Math.min((bits - r) / 26, this.length);\\\\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n    var maskedWords = extended;\\\\n\\\\n    h -= s;\\\\n    h = Math.max(0, h);\\\\n\\\\n    // Extended mode, copy masked part\\\\n    if (maskedWords) {\\\\n      for (var i = 0; i < s; i++) {\\\\n        maskedWords.words[i] = this.words[i];\\\\n      }\\\\n      maskedWords.length = s;\\\\n    }\\\\n\\\\n    if (s === 0) {\\\\n      // No-op, we should not move anything at all\\\\n    } else if (this.length > s) {\\\\n      this.length -= s;\\\\n      for (i = 0; i < this.length; i++) {\\\\n        this.words[i] = this.words[i + s];\\\\n      }\\\\n    } else {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\\\\n      var word = this.words[i] | 0;\\\\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\\\\n      carry = word & mask;\\\\n    }\\\\n\\\\n    // Push carried bits as a mask\\\\n    if (maskedWords && carry !== 0) {\\\\n      maskedWords.words[maskedWords.length++] = carry;\\\\n    }\\\\n\\\\n    if (this.length === 0) {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushrn(bits, hint, extended);\\\\n  };\\\\n\\\\n  // Shift-left\\\\n  BN.prototype.shln = function shln (bits) {\\\\n    return this.clone().ishln(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushln = function ushln (bits) {\\\\n    return this.clone().iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right\\\\n  BN.prototype.shrn = function shrn (bits) {\\\\n    return this.clone().ishrn(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushrn = function ushrn (bits) {\\\\n    return this.clone().iushrn(bits);\\\\n  };\\\\n\\\\n  // Test if n bit is set\\\\n  BN.prototype.testn = function testn (bit) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) return false;\\\\n\\\\n    // Check bit and return\\\\n    var w = this.words[s];\\\\n\\\\n    return !!(w & q);\\\\n  };\\\\n\\\\n  // Return only lowers bits of number (in-place)\\\\n  BN.prototype.imaskn = function imaskn (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n\\\\n    assert(this.negative === 0, \'imaskn works only with positive numbers\');\\\\n\\\\n    if (this.length <= s) {\\\\n      return this;\\\\n    }\\\\n\\\\n    if (r !== 0) {\\\\n      s++;\\\\n    }\\\\n    this.length = Math.min(s, this.length);\\\\n\\\\n    if (r !== 0) {\\\\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n      this.words[this.length - 1] &= mask;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Return only lowers bits of number\\\\n  BN.prototype.maskn = function maskn (bits) {\\\\n    return this.clone().imaskn(bits);\\\\n  };\\\\n\\\\n  // Add plain number `num` to `this`\\\\n  BN.prototype.iaddn = function iaddn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.isubn(-num);\\\\n\\\\n    // Possible sign change\\\\n    if (this.negative !== 0) {\\\\n      if (this.length === 1 && (this.words[0] | 0) < num) {\\\\n        this.words[0] = num - (this.words[0] | 0);\\\\n        this.negative = 0;\\\\n        return this;\\\\n      }\\\\n\\\\n      this.negative = 0;\\\\n      this.isubn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add without checks\\\\n    return this._iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype._iaddn = function _iaddn (num) {\\\\n    this.words[0] += num;\\\\n\\\\n    // Carry\\\\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\\\\n      this.words[i] -= 0x4000000;\\\\n      if (i === this.length - 1) {\\\\n        this.words[i + 1] = 1;\\\\n      } else {\\\\n        this.words[i + 1]++;\\\\n      }\\\\n    }\\\\n    this.length = Math.max(this.length, i + 1);\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Subtract plain number `num` from `this`\\\\n  BN.prototype.isubn = function isubn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.iaddn(-num);\\\\n\\\\n    if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iaddn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.words[0] -= num;\\\\n\\\\n    if (this.length === 1 && this.words[0] < 0) {\\\\n      this.words[0] = -this.words[0];\\\\n      this.negative = 1;\\\\n    } else {\\\\n      // Carry\\\\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\\\\n        this.words[i] += 0x4000000;\\\\n        this.words[i + 1] -= 1;\\\\n      }\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.addn = function addn (num) {\\\\n    return this.clone().iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype.subn = function subn (num) {\\\\n    return this.clone().isubn(num);\\\\n  };\\\\n\\\\n  BN.prototype.iabs = function iabs () {\\\\n    this.negative = 0;\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.abs = function abs () {\\\\n    return this.clone().iabs();\\\\n  };\\\\n\\\\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\\\\n    var len = num.length + shift;\\\\n    var i;\\\\n\\\\n    this._expand(len);\\\\n\\\\n    var w;\\\\n    var carry = 0;\\\\n    for (i = 0; i < num.length; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      var right = (num.words[i] | 0) * mul;\\\\n      w -= right & 0x3ffffff;\\\\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n    for (; i < this.length - shift; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry === 0) return this.strip();\\\\n\\\\n    // Subtraction overflow\\\\n    assert(carry === -1);\\\\n    carry = 0;\\\\n    for (i = 0; i < this.length; i++) {\\\\n      w = -(this.words[i] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i] = w & 0x3ffffff;\\\\n    }\\\\n    this.negative = 1;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\\\\n    var shift = this.length - num.length;\\\\n\\\\n    var a = this.clone();\\\\n    var b = num;\\\\n\\\\n    // Normalize\\\\n    var bhi = b.words[b.length - 1] | 0;\\\\n    var bhiBits = this._countBits(bhi);\\\\n    shift = 26 - bhiBits;\\\\n    if (shift !== 0) {\\\\n      b = b.ushln(shift);\\\\n      a.iushln(shift);\\\\n      bhi = b.words[b.length - 1] | 0;\\\\n    }\\\\n\\\\n    // Initialize quotient\\\\n    var m = a.length - b.length;\\\\n    var q;\\\\n\\\\n    if (mode !== \'mod\') {\\\\n      q = new BN(null);\\\\n      q.length = m + 1;\\\\n      q.words = new Array(q.length);\\\\n      for (var i = 0; i < q.length; i++) {\\\\n        q.words[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\\\\n    if (diff.negative === 0) {\\\\n      a = diff;\\\\n      if (q) {\\\\n        q.words[m] = 1;\\\\n      }\\\\n    }\\\\n\\\\n    for (var j = m - 1; j >= 0; j--) {\\\\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\\\\n        (a.words[b.length + j - 1] | 0);\\\\n\\\\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\\\\n      // (0x7ffffff)\\\\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\\\\n\\\\n      a._ishlnsubmul(b, qj, j);\\\\n      while (a.negative !== 0) {\\\\n        qj--;\\\\n        a.negative = 0;\\\\n        a._ishlnsubmul(b, 1, j);\\\\n        if (!a.isZero()) {\\\\n          a.negative ^= 1;\\\\n        }\\\\n      }\\\\n      if (q) {\\\\n        q.words[j] = qj;\\\\n      }\\\\n    }\\\\n    if (q) {\\\\n      q.strip();\\\\n    }\\\\n    a.strip();\\\\n\\\\n    // Denormalize\\\\n    if (mode !== \'div\' && shift !== 0) {\\\\n      a.iushrn(shift);\\\\n    }\\\\n\\\\n    return {\\\\n      div: q || null,\\\\n      mod: a\\\\n    };\\\\n  };\\\\n\\\\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\\\\n  //       to `div` to request div only, or be absent to\\\\n  //       request both div & mod\\\\n  //       2) `positive` is true if unsigned mod is requested\\\\n  BN.prototype.divmod = function divmod (num, mode, positive) {\\\\n    assert(!num.isZero());\\\\n\\\\n    if (this.isZero()) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: new BN(0)\\\\n      };\\\\n    }\\\\n\\\\n    var div, mod, res;\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      res = this.neg().divmod(num, mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.iadd(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    if (this.negative === 0 && num.negative !== 0) {\\\\n      res = this.divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: res.mod\\\\n      };\\\\n    }\\\\n\\\\n    if ((this.negative & num.negative) !== 0) {\\\\n      res = this.neg().divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.isub(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: res.div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    // Both numbers are positive at this point\\\\n\\\\n    // Strip both numbers to approximate shift value\\\\n    if (num.length > this.length || this.cmp(num) < 0) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: this\\\\n      };\\\\n    }\\\\n\\\\n    // Very short reduction\\\\n    if (num.length === 1) {\\\\n      if (mode === \'div\') {\\\\n        return {\\\\n          div: this.divn(num.words[0]),\\\\n          mod: null\\\\n        };\\\\n      }\\\\n\\\\n      if (mode === \'mod\') {\\\\n        return {\\\\n          div: null,\\\\n          mod: new BN(this.modn(num.words[0]))\\\\n        };\\\\n      }\\\\n\\\\n      return {\\\\n        div: this.divn(num.words[0]),\\\\n        mod: new BN(this.modn(num.words[0]))\\\\n      };\\\\n    }\\\\n\\\\n    return this._wordDiv(num, mode);\\\\n  };\\\\n\\\\n  // Find `this` / `num`\\\\n  BN.prototype.div = function div (num) {\\\\n    return this.divmod(num, \'div\', false).div;\\\\n  };\\\\n\\\\n  // Find `this` % `num`\\\\n  BN.prototype.mod = function mod (num) {\\\\n    return this.divmod(num, \'mod\', false).mod;\\\\n  };\\\\n\\\\n  BN.prototype.umod = function umod (num) {\\\\n    return this.divmod(num, \'mod\', true).mod;\\\\n  };\\\\n\\\\n  // Find Round(`this` / `num`)\\\\n  BN.prototype.divRound = function divRound (num) {\\\\n    var dm = this.divmod(num);\\\\n\\\\n    // Fast case - exact division\\\\n    if (dm.mod.isZero()) return dm.div;\\\\n\\\\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\\\\n\\\\n    var half = num.ushrn(1);\\\\n    var r2 = num.andln(1);\\\\n    var cmp = mod.cmp(half);\\\\n\\\\n    // Round down\\\\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\\\\n\\\\n    // Round up\\\\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\\\\n  };\\\\n\\\\n  BN.prototype.modn = function modn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n    var p = (1 << 26) % num;\\\\n\\\\n    var acc = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      acc = (p * acc + (this.words[i] | 0)) % num;\\\\n    }\\\\n\\\\n    return acc;\\\\n  };\\\\n\\\\n  // In-place division by number\\\\n  BN.prototype.idivn = function idivn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n\\\\n    var carry = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var w = (this.words[i] | 0) + carry * 0x4000000;\\\\n      this.words[i] = (w / num) | 0;\\\\n      carry = w % num;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.divn = function divn (num) {\\\\n    return this.clone().idivn(num);\\\\n  };\\\\n\\\\n  BN.prototype.egcd = function egcd (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var x = this;\\\\n    var y = p.clone();\\\\n\\\\n    if (x.negative !== 0) {\\\\n      x = x.umod(p);\\\\n    } else {\\\\n      x = x.clone();\\\\n    }\\\\n\\\\n    // A * x + B * y = x\\\\n    var A = new BN(1);\\\\n    var B = new BN(0);\\\\n\\\\n    // C * x + D * y = y\\\\n    var C = new BN(0);\\\\n    var D = new BN(1);\\\\n\\\\n    var g = 0;\\\\n\\\\n    while (x.isEven() && y.isEven()) {\\\\n      x.iushrn(1);\\\\n      y.iushrn(1);\\\\n      ++g;\\\\n    }\\\\n\\\\n    var yp = y.clone();\\\\n    var xp = x.clone();\\\\n\\\\n    while (!x.isZero()) {\\\\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        x.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (A.isOdd() || B.isOdd()) {\\\\n            A.iadd(yp);\\\\n            B.isub(xp);\\\\n          }\\\\n\\\\n          A.iushrn(1);\\\\n          B.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        y.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (C.isOdd() || D.isOdd()) {\\\\n            C.iadd(yp);\\\\n            D.isub(xp);\\\\n          }\\\\n\\\\n          C.iushrn(1);\\\\n          D.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (x.cmp(y) >= 0) {\\\\n        x.isub(y);\\\\n        A.isub(C);\\\\n        B.isub(D);\\\\n      } else {\\\\n        y.isub(x);\\\\n        C.isub(A);\\\\n        D.isub(B);\\\\n      }\\\\n    }\\\\n\\\\n    return {\\\\n      a: C,\\\\n      b: D,\\\\n      gcd: y.iushln(g)\\\\n    };\\\\n  };\\\\n\\\\n  // This is reduced incarnation of the binary EEA\\\\n  // above, designated to invert members of the\\\\n  // _prime_ fields F(p) at a maximal speed\\\\n  BN.prototype._invmp = function _invmp (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var a = this;\\\\n    var b = p.clone();\\\\n\\\\n    if (a.negative !== 0) {\\\\n      a = a.umod(p);\\\\n    } else {\\\\n      a = a.clone();\\\\n    }\\\\n\\\\n    var x1 = new BN(1);\\\\n    var x2 = new BN(0);\\\\n\\\\n    var delta = b.clone();\\\\n\\\\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\\\\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        a.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (x1.isOdd()) {\\\\n            x1.iadd(delta);\\\\n          }\\\\n\\\\n          x1.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        b.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (x2.isOdd()) {\\\\n            x2.iadd(delta);\\\\n          }\\\\n\\\\n          x2.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (a.cmp(b) >= 0) {\\\\n        a.isub(b);\\\\n        x1.isub(x2);\\\\n      } else {\\\\n        b.isub(a);\\\\n        x2.isub(x1);\\\\n      }\\\\n    }\\\\n\\\\n    var res;\\\\n    if (a.cmpn(1) === 0) {\\\\n      res = x1;\\\\n    } else {\\\\n      res = x2;\\\\n    }\\\\n\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(p);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gcd = function gcd (num) {\\\\n    if (this.isZero()) return num.abs();\\\\n    if (num.isZero()) return this.abs();\\\\n\\\\n    var a = this.clone();\\\\n    var b = num.clone();\\\\n    a.negative = 0;\\\\n    b.negative = 0;\\\\n\\\\n    // Remove common factor of two\\\\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\\\\n      a.iushrn(1);\\\\n      b.iushrn(1);\\\\n    }\\\\n\\\\n    do {\\\\n      while (a.isEven()) {\\\\n        a.iushrn(1);\\\\n      }\\\\n      while (b.isEven()) {\\\\n        b.iushrn(1);\\\\n      }\\\\n\\\\n      var r = a.cmp(b);\\\\n      if (r < 0) {\\\\n        // Swap `a` and `b` to make `a` always bigger than `b`\\\\n        var t = a;\\\\n        a = b;\\\\n        b = t;\\\\n      } else if (r === 0 || b.cmpn(1) === 0) {\\\\n        break;\\\\n      }\\\\n\\\\n      a.isub(b);\\\\n    } while (true);\\\\n\\\\n    return b.iushln(shift);\\\\n  };\\\\n\\\\n  // Invert number in the field F(num)\\\\n  BN.prototype.invm = function invm (num) {\\\\n    return this.egcd(num).a.umod(num);\\\\n  };\\\\n\\\\n  BN.prototype.isEven = function isEven () {\\\\n    return (this.words[0] & 1) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.isOdd = function isOdd () {\\\\n    return (this.words[0] & 1) === 1;\\\\n  };\\\\n\\\\n  // And first word and num\\\\n  BN.prototype.andln = function andln (num) {\\\\n    return this.words[0] & num;\\\\n  };\\\\n\\\\n  // Increment at the bit position in-line\\\\n  BN.prototype.bincn = function bincn (bit) {\\\\n    assert(typeof bit === \'number\');\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) {\\\\n      this._expand(s + 1);\\\\n      this.words[s] |= q;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add bit and propagate, if needed\\\\n    var carry = q;\\\\n    for (var i = s; carry !== 0 && i < this.length; i++) {\\\\n      var w = this.words[i] | 0;\\\\n      w += carry;\\\\n      carry = w >>> 26;\\\\n      w &= 0x3ffffff;\\\\n      this.words[i] = w;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.isZero = function isZero () {\\\\n    return this.length === 1 && this.words[0] === 0;\\\\n  };\\\\n\\\\n  BN.prototype.cmpn = function cmpn (num) {\\\\n    var negative = num < 0;\\\\n\\\\n    if (this.negative !== 0 && !negative) return -1;\\\\n    if (this.negative === 0 && negative) return 1;\\\\n\\\\n    this.strip();\\\\n\\\\n    var res;\\\\n    if (this.length > 1) {\\\\n      res = 1;\\\\n    } else {\\\\n      if (negative) {\\\\n        num = -num;\\\\n      }\\\\n\\\\n      assert(num <= 0x3ffffff, \'Number is too big\');\\\\n\\\\n      var w = this.words[0] | 0;\\\\n      res = w === num ? 0 : w < num ? -1 : 1;\\\\n    }\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Compare two numbers and return:\\\\n  // 1 - if `this` > `num`\\\\n  // 0 - if `this` == `num`\\\\n  // -1 - if `this` < `num`\\\\n  BN.prototype.cmp = function cmp (num) {\\\\n    if (this.negative !== 0 && num.negative === 0) return -1;\\\\n    if (this.negative === 0 && num.negative !== 0) return 1;\\\\n\\\\n    var res = this.ucmp(num);\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Unsigned comparison\\\\n  BN.prototype.ucmp = function ucmp (num) {\\\\n    // At this point both numbers have the same sign\\\\n    if (this.length > num.length) return 1;\\\\n    if (this.length < num.length) return -1;\\\\n\\\\n    var res = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var a = this.words[i] | 0;\\\\n      var b = num.words[i] | 0;\\\\n\\\\n      if (a === b) continue;\\\\n      if (a < b) {\\\\n        res = -1;\\\\n      } else if (a > b) {\\\\n        res = 1;\\\\n      }\\\\n      break;\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gtn = function gtn (num) {\\\\n    return this.cmpn(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gt = function gt (num) {\\\\n    return this.cmp(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gten = function gten (num) {\\\\n    return this.cmpn(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.gte = function gte (num) {\\\\n    return this.cmp(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.ltn = function ltn (num) {\\\\n    return this.cmpn(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lt = function lt (num) {\\\\n    return this.cmp(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lten = function lten (num) {\\\\n    return this.cmpn(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.lte = function lte (num) {\\\\n    return this.cmp(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.eqn = function eqn (num) {\\\\n    return this.cmpn(num) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.eq = function eq (num) {\\\\n    return this.cmp(num) === 0;\\\\n  };\\\\n\\\\n  //\\\\n  // A reduce context, could be using montgomery or something better, depending\\\\n  // on the `m` itself.\\\\n  //\\\\n  BN.red = function red (num) {\\\\n    return new Red(num);\\\\n  };\\\\n\\\\n  BN.prototype.toRed = function toRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    assert(this.negative === 0, \'red works only with positives\');\\\\n    return ctx.convertTo(this)._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.fromRed = function fromRed () {\\\\n    assert(this.red, \'fromRed works only with numbers in reduction context\');\\\\n    return this.red.convertFrom(this);\\\\n  };\\\\n\\\\n  BN.prototype._forceRed = function _forceRed (ctx) {\\\\n    this.red = ctx;\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.forceRed = function forceRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    return this._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.redAdd = function redAdd (num) {\\\\n    assert(this.red, \'redAdd works only with red numbers\');\\\\n    return this.red.add(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIAdd = function redIAdd (num) {\\\\n    assert(this.red, \'redIAdd works only with red numbers\');\\\\n    return this.red.iadd(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSub = function redSub (num) {\\\\n    assert(this.red, \'redSub works only with red numbers\');\\\\n    return this.red.sub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redISub = function redISub (num) {\\\\n    assert(this.red, \'redISub works only with red numbers\');\\\\n    return this.red.isub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redShl = function redShl (num) {\\\\n    assert(this.red, \'redShl works only with red numbers\');\\\\n    return this.red.shl(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redMul = function redMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.mul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIMul = function redIMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.imul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSqr = function redSqr () {\\\\n    assert(this.red, \'redSqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqr(this);\\\\n  };\\\\n\\\\n  BN.prototype.redISqr = function redISqr () {\\\\n    assert(this.red, \'redISqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.isqr(this);\\\\n  };\\\\n\\\\n  // Square root over p\\\\n  BN.prototype.redSqrt = function redSqrt () {\\\\n    assert(this.red, \'redSqrt works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqrt(this);\\\\n  };\\\\n\\\\n  BN.prototype.redInvm = function redInvm () {\\\\n    assert(this.red, \'redInvm works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.invm(this);\\\\n  };\\\\n\\\\n  // Return negative clone of `this` % `red modulo`\\\\n  BN.prototype.redNeg = function redNeg () {\\\\n    assert(this.red, \'redNeg works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.neg(this);\\\\n  };\\\\n\\\\n  BN.prototype.redPow = function redPow (num) {\\\\n    assert(this.red && !num.red, \'redPow(normalNum)\');\\\\n    this.red._verify1(this);\\\\n    return this.red.pow(this, num);\\\\n  };\\\\n\\\\n  // Prime numbers with efficient reduction\\\\n  var primes = {\\\\n    k256: null,\\\\n    p224: null,\\\\n    p192: null,\\\\n    p25519: null\\\\n  };\\\\n\\\\n  // Pseudo-Mersenne prime\\\\n  function MPrime (name, p) {\\\\n    // P = 2 ^ N - K\\\\n    this.name = name;\\\\n    this.p = new BN(p, 16);\\\\n    this.n = this.p.bitLength();\\\\n    this.k = new BN(1).iushln(this.n).isub(this.p);\\\\n\\\\n    this.tmp = this._tmp();\\\\n  }\\\\n\\\\n  MPrime.prototype._tmp = function _tmp () {\\\\n    var tmp = new BN(null);\\\\n    tmp.words = new Array(Math.ceil(this.n / 13));\\\\n    return tmp;\\\\n  };\\\\n\\\\n  MPrime.prototype.ireduce = function ireduce (num) {\\\\n    // Assumes that `num` is less than `P^2`\\\\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\\\\n    var r = num;\\\\n    var rlen;\\\\n\\\\n    do {\\\\n      this.split(r, this.tmp);\\\\n      r = this.imulK(r);\\\\n      r = r.iadd(this.tmp);\\\\n      rlen = r.bitLength();\\\\n    } while (rlen > this.n);\\\\n\\\\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\\\\n    if (cmp === 0) {\\\\n      r.words[0] = 0;\\\\n      r.length = 1;\\\\n    } else if (cmp > 0) {\\\\n      r.isub(this.p);\\\\n    } else {\\\\n      r.strip();\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  MPrime.prototype.split = function split (input, out) {\\\\n    input.iushrn(this.n, 0, out);\\\\n  };\\\\n\\\\n  MPrime.prototype.imulK = function imulK (num) {\\\\n    return num.imul(this.k);\\\\n  };\\\\n\\\\n  function K256 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'k256\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\');\\\\n  }\\\\n  inherits(K256, MPrime);\\\\n\\\\n  K256.prototype.split = function split (input, output) {\\\\n    // 256 = 9 * 26 + 22\\\\n    var mask = 0x3fffff;\\\\n\\\\n    var outLen = Math.min(input.length, 9);\\\\n    for (var i = 0; i < outLen; i++) {\\\\n      output.words[i] = input.words[i];\\\\n    }\\\\n    output.length = outLen;\\\\n\\\\n    if (input.length <= 9) {\\\\n      input.words[0] = 0;\\\\n      input.length = 1;\\\\n      return;\\\\n    }\\\\n\\\\n    // Shift by 9 limbs\\\\n    var prev = input.words[9];\\\\n    output.words[output.length++] = prev & mask;\\\\n\\\\n    for (i = 10; i < input.length; i++) {\\\\n      var next = input.words[i] | 0;\\\\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\\\\n      prev = next;\\\\n    }\\\\n    prev >>>= 22;\\\\n    input.words[i - 10] = prev;\\\\n    if (prev === 0 && input.length > 10) {\\\\n      input.length -= 10;\\\\n    } else {\\\\n      input.length -= 9;\\\\n    }\\\\n  };\\\\n\\\\n  K256.prototype.imulK = function imulK (num) {\\\\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\\\\n    num.words[num.length] = 0;\\\\n    num.words[num.length + 1] = 0;\\\\n    num.length += 2;\\\\n\\\\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\\\\n    var lo = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var w = num.words[i] | 0;\\\\n      lo += w * 0x3d1;\\\\n      num.words[i] = lo & 0x3ffffff;\\\\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\\\\n    }\\\\n\\\\n    // Fast length reduction\\\\n    if (num.words[num.length - 1] === 0) {\\\\n      num.length--;\\\\n      if (num.words[num.length - 1] === 0) {\\\\n        num.length--;\\\\n      }\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  function P224 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p224\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\');\\\\n  }\\\\n  inherits(P224, MPrime);\\\\n\\\\n  function P192 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p192\',\\\\n      \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\');\\\\n  }\\\\n  inherits(P192, MPrime);\\\\n\\\\n  function P25519 () {\\\\n    // 2 ^ 255 - 19\\\\n    MPrime.call(\\\\n      this,\\\\n      \'25519\',\\\\n      \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\');\\\\n  }\\\\n  inherits(P25519, MPrime);\\\\n\\\\n  P25519.prototype.imulK = function imulK (num) {\\\\n    // K = 0x13\\\\n    var carry = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var hi = (num.words[i] | 0) * 0x13 + carry;\\\\n      var lo = hi & 0x3ffffff;\\\\n      hi >>>= 26;\\\\n\\\\n      num.words[i] = lo;\\\\n      carry = hi;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      num.words[num.length++] = carry;\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  // Exported mostly for testing purposes, use plain name instead\\\\n  BN._prime = function prime (name) {\\\\n    // Cached version of prime\\\\n    if (primes[name]) return primes[name];\\\\n\\\\n    var prime;\\\\n    if (name === \'k256\') {\\\\n      prime = new K256();\\\\n    } else if (name === \'p224\') {\\\\n      prime = new P224();\\\\n    } else if (name === \'p192\') {\\\\n      prime = new P192();\\\\n    } else if (name === \'p25519\') {\\\\n      prime = new P25519();\\\\n    } else {\\\\n      throw new Error(\'Unknown prime \' + name);\\\\n    }\\\\n    primes[name] = prime;\\\\n\\\\n    return prime;\\\\n  };\\\\n\\\\n  //\\\\n  // Base reduction engine\\\\n  //\\\\n  function Red (m) {\\\\n    if (typeof m === \'string\') {\\\\n      var prime = BN._prime(m);\\\\n      this.m = prime.p;\\\\n      this.prime = prime;\\\\n    } else {\\\\n      assert(m.gtn(1), \'modulus must be greater than 1\');\\\\n      this.m = m;\\\\n      this.prime = null;\\\\n    }\\\\n  }\\\\n\\\\n  Red.prototype._verify1 = function _verify1 (a) {\\\\n    assert(a.negative === 0, \'red works only with positives\');\\\\n    assert(a.red, \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype._verify2 = function _verify2 (a, b) {\\\\n    assert((a.negative | b.negative) === 0, \'red works only with positives\');\\\\n    assert(a.red && a.red === b.red,\\\\n      \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype.imod = function imod (a) {\\\\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\\\\n    return a.umod(this.m)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.neg = function neg (a) {\\\\n    if (a.isZero()) {\\\\n      return a.clone();\\\\n    }\\\\n\\\\n    return this.m.sub(a)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.add = function add (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.add(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.iadd = function iadd (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.iadd(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.sub = function sub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.sub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.isub = function isub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.isub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.shl = function shl (a, num) {\\\\n    this._verify1(a);\\\\n    return this.imod(a.ushln(num));\\\\n  };\\\\n\\\\n  Red.prototype.imul = function imul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.imul(b));\\\\n  };\\\\n\\\\n  Red.prototype.mul = function mul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.mul(b));\\\\n  };\\\\n\\\\n  Red.prototype.isqr = function isqr (a) {\\\\n    return this.imul(a, a.clone());\\\\n  };\\\\n\\\\n  Red.prototype.sqr = function sqr (a) {\\\\n    return this.mul(a, a);\\\\n  };\\\\n\\\\n  Red.prototype.sqrt = function sqrt (a) {\\\\n    if (a.isZero()) return a.clone();\\\\n\\\\n    var mod3 = this.m.andln(3);\\\\n    assert(mod3 % 2 === 1);\\\\n\\\\n    // Fast case\\\\n    if (mod3 === 3) {\\\\n      var pow = this.m.add(new BN(1)).iushrn(2);\\\\n      return this.pow(a, pow);\\\\n    }\\\\n\\\\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\\\\n    //\\\\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\\\\n    var q = this.m.subn(1);\\\\n    var s = 0;\\\\n    while (!q.isZero() && q.andln(1) === 0) {\\\\n      s++;\\\\n      q.iushrn(1);\\\\n    }\\\\n    assert(!q.isZero());\\\\n\\\\n    var one = new BN(1).toRed(this);\\\\n    var nOne = one.redNeg();\\\\n\\\\n    // Find quadratic non-residue\\\\n    // NOTE: Max is such because of generalized Riemann hypothesis.\\\\n    var lpow = this.m.subn(1).iushrn(1);\\\\n    var z = this.m.bitLength();\\\\n    z = new BN(2 * z * z).toRed(this);\\\\n\\\\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\\\\n      z.redIAdd(nOne);\\\\n    }\\\\n\\\\n    var c = this.pow(z, q);\\\\n    var r = this.pow(a, q.addn(1).iushrn(1));\\\\n    var t = this.pow(a, q);\\\\n    var m = s;\\\\n    while (t.cmp(one) !== 0) {\\\\n      var tmp = t;\\\\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\\\\n        tmp = tmp.redSqr();\\\\n      }\\\\n      assert(i < m);\\\\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\\\\n\\\\n      r = r.redMul(b);\\\\n      c = b.redSqr();\\\\n      t = t.redMul(c);\\\\n      m = i;\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  Red.prototype.invm = function invm (a) {\\\\n    var inv = a._invmp(this.m);\\\\n    if (inv.negative !== 0) {\\\\n      inv.negative = 0;\\\\n      return this.imod(inv).redNeg();\\\\n    } else {\\\\n      return this.imod(inv);\\\\n    }\\\\n  };\\\\n\\\\n  Red.prototype.pow = function pow (a, num) {\\\\n    if (num.isZero()) return new BN(1);\\\\n    if (num.cmpn(1) === 0) return a.clone();\\\\n\\\\n    var windowSize = 4;\\\\n    var wnd = new Array(1 << windowSize);\\\\n    wnd[0] = new BN(1).toRed(this);\\\\n    wnd[1] = a;\\\\n    for (var i = 2; i < wnd.length; i++) {\\\\n      wnd[i] = this.mul(wnd[i - 1], a);\\\\n    }\\\\n\\\\n    var res = wnd[0];\\\\n    var current = 0;\\\\n    var currentLen = 0;\\\\n    var start = num.bitLength() % 26;\\\\n    if (start === 0) {\\\\n      start = 26;\\\\n    }\\\\n\\\\n    for (i = num.length - 1; i >= 0; i--) {\\\\n      var word = num.words[i];\\\\n      for (var j = start - 1; j >= 0; j--) {\\\\n        var bit = (word >> j) & 1;\\\\n        if (res !== wnd[0]) {\\\\n          res = this.sqr(res);\\\\n        }\\\\n\\\\n        if (bit === 0 && current === 0) {\\\\n          currentLen = 0;\\\\n          continue;\\\\n        }\\\\n\\\\n        current <<= 1;\\\\n        current |= bit;\\\\n        currentLen++;\\\\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\\\\n\\\\n        res = this.mul(res, wnd[current]);\\\\n        currentLen = 0;\\\\n        current = 0;\\\\n      }\\\\n      start = 26;\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.convertTo = function convertTo (num) {\\\\n    var r = num.umod(this.m);\\\\n\\\\n    return r === num ? r.clone() : r;\\\\n  };\\\\n\\\\n  Red.prototype.convertFrom = function convertFrom (num) {\\\\n    var res = num.clone();\\\\n    res.red = null;\\\\n    return res;\\\\n  };\\\\n\\\\n  //\\\\n  // Montgomery method engine\\\\n  //\\\\n\\\\n  BN.mont = function mont (num) {\\\\n    return new Mont(num);\\\\n  };\\\\n\\\\n  function Mont (m) {\\\\n    Red.call(this, m);\\\\n\\\\n    this.shift = this.m.bitLength();\\\\n    if (this.shift % 26 !== 0) {\\\\n      this.shift += 26 - (this.shift % 26);\\\\n    }\\\\n\\\\n    this.r = new BN(1).iushln(this.shift);\\\\n    this.r2 = this.imod(this.r.sqr());\\\\n    this.rinv = this.r._invmp(this.m);\\\\n\\\\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\\\\n    this.minv = this.minv.umod(this.r);\\\\n    this.minv = this.r.sub(this.minv);\\\\n  }\\\\n  inherits(Mont, Red);\\\\n\\\\n  Mont.prototype.convertTo = function convertTo (num) {\\\\n    return this.imod(num.ushln(this.shift));\\\\n  };\\\\n\\\\n  Mont.prototype.convertFrom = function convertFrom (num) {\\\\n    var r = this.imod(num.mul(this.rinv));\\\\n    r.red = null;\\\\n    return r;\\\\n  };\\\\n\\\\n  Mont.prototype.imul = function imul (a, b) {\\\\n    if (a.isZero() || b.isZero()) {\\\\n      a.words[0] = 0;\\\\n      a.length = 1;\\\\n      return a;\\\\n    }\\\\n\\\\n    var t = a.imul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.mul = function mul (a, b) {\\\\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\\\\n\\\\n    var t = a.mul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.invm = function invm (a) {\\\\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\\\\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\\\\n    return res._forceRed(this);\\\\n  };\\\\n})(typeof module === \'undefined\' || module, this);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-utils/~/bn.js/lib/bn.js\\\\n// module id = 164\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-utils/node_modules/bn.js/lib/bn.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file utils.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar BN = __webpack_require__(164);\\\\nvar numberToBN = __webpack_require__(137);\\\\nvar utf8 = __webpack_require__(331);\\\\nvar Hash = __webpack_require__(128);\\\\n\\\\n\\\\n/**\\\\n * Returns true if object is BN, otherwise false\\\\n *\\\\n * @method isBN\\\\n * @param {Object} object\\\\n * @return {Boolean}\\\\n */\\\\nvar isBN = function (object) {\\\\n    return object instanceof BN ||\\\\n        (object && object.constructor && object.constructor.name === \'BN\');\\\\n};\\\\n\\\\n/**\\\\n * Returns true if object is BigNumber, otherwise false\\\\n *\\\\n * @method isBigNumber\\\\n * @param {Object} object\\\\n * @return {Boolean}\\\\n */\\\\nvar isBigNumber = function (object) {\\\\n    return object && object.constructor && object.constructor.name === \'BigNumber\';\\\\n};\\\\n\\\\n/**\\\\n * Takes an input and transforms it into an BN\\\\n *\\\\n * @method toBN\\\\n * @param {Number|String|BN} number, string, HEX string or BN\\\\n * @return {BN} BN\\\\n */\\\\nvar toBN = function(number){\\\\n    try {\\\\n        return numberToBN.apply(null, arguments);\\\\n    } catch(e) {\\\\n        throw new Error(e + \' Given value: \\\\\\"\'+ number +\'\\\\\\"\');\\\\n    }\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Takes and input transforms it into BN and if it is negative value, into two\'s complement\\\\n *\\\\n * @method toTwosComplement\\\\n * @param {Number|String|BN} number\\\\n * @return {String}\\\\n */\\\\nvar toTwosComplement = function (number) {\\\\n    return \'0x\'+ toBN(number).toTwos(256).toString(16, 64);\\\\n};\\\\n\\\\n/**\\\\n * Checks if the given string is an address\\\\n *\\\\n * @method isAddress\\\\n * @param {String} address the given HEX address\\\\n * @return {Boolean}\\\\n */\\\\nvar isAddress = function (address) {\\\\n    // check if it has the basic requirements of an address\\\\n    if (!/^(0x)?[0-9a-f]{40}$/i.test(address)) {\\\\n        return false;\\\\n        // If it\'s ALL lowercase or ALL upppercase\\\\n    } else if (/^(0x|0X)?[0-9a-f]{40}$/.test(address) || /^(0x|0X)?[0-9A-F]{40}$/.test(address)) {\\\\n        return true;\\\\n        // Otherwise check each case\\\\n    } else {\\\\n        return checkAddressChecksum(address);\\\\n    }\\\\n};\\\\n\\\\n\\\\n\\\\n/**\\\\n * Checks if the given string is a checksummed address\\\\n *\\\\n * @method checkAddressChecksum\\\\n * @param {String} address the given HEX address\\\\n * @return {Boolean}\\\\n */\\\\nvar checkAddressChecksum = function (address) {\\\\n    // Check each case\\\\n    address = address.replace(/^0x/i,\'\');\\\\n    var addressHash = sha3(address.toLowerCase()).replace(/^0x/i,\'\');\\\\n\\\\n    for (var i = 0; i < 40; i++ ) {\\\\n        // the nth letter should be uppercase if the nth digit of casemap is 1\\\\n        if ((parseInt(addressHash[i], 16) > 7 && address[i].toUpperCase() !== address[i]) || (parseInt(addressHash[i], 16) <= 7 && address[i].toLowerCase() !== address[i])) {\\\\n            return false;\\\\n        }\\\\n    }\\\\n    return true;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to pad string to expected length\\\\n *\\\\n * @method leftPad\\\\n * @param {String} string to be padded\\\\n * @param {Number} chars that result string should have\\\\n * @param {String} sign, by default 0\\\\n * @returns {String} right aligned string\\\\n */\\\\nvar leftPad = function (string, chars, sign) {\\\\n    var hasPrefix = /^0x/i.test(string) || typeof string === \'number\';\\\\n    string = string.toString(16).replace(/^0x/i,\'\');\\\\n\\\\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\\\\n\\\\n    return (hasPrefix ? \'0x\' : \'\') + new Array(padding).join(sign ? sign : \\\\\\"0\\\\\\") + string;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to pad string to expected length\\\\n *\\\\n * @method rightPad\\\\n * @param {String} string to be padded\\\\n * @param {Number} chars that result string should have\\\\n * @param {String} sign, by default 0\\\\n * @returns {String} right aligned string\\\\n */\\\\nvar rightPad = function (string, chars, sign) {\\\\n    var hasPrefix = /^0x/i.test(string) || typeof string === \'number\';\\\\n    string = string.toString(16).replace(/^0x/i,\'\');\\\\n\\\\n    var padding = (chars - string.length + 1 >= 0) ? chars - string.length + 1 : 0;\\\\n\\\\n    return (hasPrefix ? \'0x\' : \'\') + string + (new Array(padding).join(sign ? sign : \\\\\\"0\\\\\\"));\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Should be called to get hex representation (prefixed by 0x) of utf8 string\\\\n *\\\\n * @method utf8ToHex\\\\n * @param {String} str\\\\n * @returns {String} hex representation of input string\\\\n */\\\\nvar utf8ToHex = function(str) {\\\\n    str = utf8.encode(str);\\\\n    var hex = \\\\\\"\\\\\\";\\\\n\\\\n    // remove \\\\\\\\u0000 padding from either side\\\\n    str = str.replace(/^(?:\\\\\\\\u0000)*/,\'\');\\\\n    str = str.split(\\\\\\"\\\\\\").reverse().join(\\\\\\"\\\\\\");\\\\n    str = str.replace(/^(?:\\\\\\\\u0000)*/,\'\');\\\\n    str = str.split(\\\\\\"\\\\\\").reverse().join(\\\\\\"\\\\\\");\\\\n\\\\n    for(var i = 0; i < str.length; i++) {\\\\n        var code = str.charCodeAt(i);\\\\n        // if (code !== 0) {\\\\n        var n = code.toString(16);\\\\n        hex += n.length < 2 ? \'0\' + n : n;\\\\n        // }\\\\n    }\\\\n\\\\n    return \\\\\\"0x\\\\\\" + hex;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to get utf8 from it\'s hex representation\\\\n *\\\\n * @method hexToUtf8\\\\n * @param {String} hex\\\\n * @returns {String} ascii string representation of hex value\\\\n */\\\\nvar hexToUtf8 = function(hex) {\\\\n    if (!isHexStrict(hex))\\\\n        throw new Error(\'The parameter \\\\\\"\'+ hex +\'\\\\\\" must be a valid HEX string.\');\\\\n\\\\n    var str = \\\\\\"\\\\\\";\\\\n    var code = 0;\\\\n    hex = hex.replace(/^0x/i,\'\');\\\\n\\\\n    // remove 00 padding from either side\\\\n    hex = hex.replace(/^(?:00)*/,\'\');\\\\n    hex = hex.split(\\\\\\"\\\\\\").reverse().join(\\\\\\"\\\\\\");\\\\n    hex = hex.replace(/^(?:00)*/,\'\');\\\\n    hex = hex.split(\\\\\\"\\\\\\").reverse().join(\\\\\\"\\\\\\");\\\\n\\\\n    var l = hex.length;\\\\n\\\\n    for (var i=0; i < l; i+=2) {\\\\n        code = parseInt(hex.substr(i, 2), 16);\\\\n        // if (code !== 0) {\\\\n        str += String.fromCharCode(code);\\\\n        // }\\\\n    }\\\\n\\\\n    return utf8.decode(str);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Converts value to it\'s number representation\\\\n *\\\\n * @method hexToNumber\\\\n * @param {String|Number|BN} value\\\\n * @return {String}\\\\n */\\\\nvar hexToNumber = function (value) {\\\\n    if (!value) {\\\\n        return value;\\\\n    }\\\\n\\\\n    return toBN(value).toNumber();\\\\n};\\\\n\\\\n/**\\\\n * Converts value to it\'s decimal representation in string\\\\n *\\\\n * @method hexToNumberString\\\\n * @param {String|Number|BN} value\\\\n * @return {String}\\\\n */\\\\nvar hexToNumberString = function (value) {\\\\n    if (!value) return value;\\\\n\\\\n    return toBN(value).toString(10);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Converts value to it\'s hex representation\\\\n *\\\\n * @method numberToHex\\\\n * @param {String|Number|BN} value\\\\n * @return {String}\\\\n */\\\\nvar numberToHex = function (value) {\\\\n    if (_.isNull(value) || _.isUndefined(value)) {\\\\n        return value;\\\\n    }\\\\n\\\\n    if (!isFinite(value) && !isHexStrict(value)) {\\\\n        throw new Error(\'Given input \\\\\\"\'+value+\'\\\\\\" is not a number.\');\\\\n    }\\\\n\\\\n    var number = toBN(value);\\\\n    var result = number.toString(16);\\\\n\\\\n    return number.lt(new BN(0)) ? \'-0x\' + result.substr(1) : \'0x\' + result;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Convert a byte array to a hex string\\\\n *\\\\n * Note: Implementation from crypto-js\\\\n *\\\\n * @method bytesToHex\\\\n * @param {Array} bytes\\\\n * @return {String} the hex string\\\\n */\\\\nvar bytesToHex = function(bytes) {\\\\n    for (var hex = [], i = 0; i < bytes.length; i++) {\\\\n        /* jshint ignore:start */\\\\n        hex.push((bytes[i] >>> 4).toString(16));\\\\n        hex.push((bytes[i] & 0xF).toString(16));\\\\n        /* jshint ignore:end */\\\\n    }\\\\n    return \'0x\'+ hex.join(\\\\\\"\\\\\\");\\\\n};\\\\n\\\\n/**\\\\n * Convert a hex string to a byte array\\\\n *\\\\n * Note: Implementation from crypto-js\\\\n *\\\\n * @method hexToBytes\\\\n * @param {string} hex\\\\n * @return {Array} the byte array\\\\n */\\\\nvar hexToBytes = function(hex) {\\\\n    hex = hex.toString(16);\\\\n\\\\n    if (!isHexStrict(hex)) {\\\\n        throw new Error(\'Given value \\\\\\"\'+ hex +\'\\\\\\" is not a valid hex string.\');\\\\n    }\\\\n\\\\n    hex = hex.replace(/^0x/i,\'\');\\\\n\\\\n    for (var bytes = [], c = 0; c < hex.length; c += 2)\\\\n        bytes.push(parseInt(hex.substr(c, 2), 16));\\\\n    return bytes;\\\\n};\\\\n\\\\n/**\\\\n * Auto converts any given value into it\'s hex representation.\\\\n *\\\\n * And even stringifys objects before.\\\\n *\\\\n * @method toHex\\\\n * @param {String|Number|BN|Object} value\\\\n * @param {Boolean} returnType\\\\n * @return {String}\\\\n */\\\\nvar toHex = function (value, returnType) {\\\\n    /*jshint maxcomplexity: false */\\\\n\\\\n    if (isAddress(value)) {\\\\n        return returnType ? \'address\' : \'0x\'+ value.toLowerCase().replace(/^0x/i,\'\');\\\\n    }\\\\n\\\\n    if (_.isBoolean(value)) {\\\\n        return returnType ? \'bool\' : value ? \'0x01\' : \'0x00\';\\\\n    }\\\\n\\\\n\\\\n    if (_.isObject(value) && !isBigNumber(value) && !isBN(value)) {\\\\n        return returnType ? \'string\' : utf8ToHex(JSON.stringify(value));\\\\n    }\\\\n\\\\n    // if its a negative number, pass it through numberToHex\\\\n    if (_.isString(value)) {\\\\n        if (value.indexOf(\'-0x\') === 0 || value.indexOf(\'-0X\') === 0) {\\\\n            return returnType ? \'int256\' : numberToHex(value);\\\\n        } else if(value.indexOf(\'0x\') === 0 || value.indexOf(\'0X\') === 0) {\\\\n            return returnType ? \'bytes\' : value;\\\\n        } else if (!isFinite(value)) {\\\\n            return returnType ? \'string\' : utf8ToHex(value);\\\\n        }\\\\n    }\\\\n\\\\n    return returnType ? (value < 0 ? \'int256\' : \'uint256\') : numberToHex(value);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Check if string is HEX, requires a 0x in front\\\\n *\\\\n * @method isHexStrict\\\\n * @param {String} hex to be checked\\\\n * @returns {Boolean}\\\\n */\\\\nvar isHexStrict = function (hex) {\\\\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-)?0x[0-9a-f]*$/i.test(hex));\\\\n};\\\\n\\\\n/**\\\\n * Check if string is HEX\\\\n *\\\\n * @method isHex\\\\n * @param {String} hex to be checked\\\\n * @returns {Boolean}\\\\n */\\\\nvar isHex = function (hex) {\\\\n    return ((_.isString(hex) || _.isNumber(hex)) && /^(-0x|0x)?[0-9a-f]*$/i.test(hex));\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Returns true if given string is a valid Ethereum block header bloom.\\\\n *\\\\n * TODO UNDOCUMENTED\\\\n *\\\\n * @method isBloom\\\\n * @param {String} hex encoded bloom filter\\\\n * @return {Boolean}\\\\n */\\\\nvar isBloom = function (bloom) {\\\\n    if (!/^(0x)?[0-9a-f]{512}$/i.test(bloom)) {\\\\n        return false;\\\\n    } else if (/^(0x)?[0-9a-f]{512}$/.test(bloom) || /^(0x)?[0-9A-F]{512}$/.test(bloom)) {\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\n/**\\\\n * Returns true if given string is a valid log topic.\\\\n *\\\\n * TODO UNDOCUMENTED\\\\n *\\\\n * @method isTopic\\\\n * @param {String} hex encoded topic\\\\n * @return {Boolean}\\\\n */\\\\nvar isTopic = function (topic) {\\\\n    if (!/^(0x)?[0-9a-f]{64}$/i.test(topic)) {\\\\n        return false;\\\\n    } else if (/^(0x)?[0-9a-f]{64}$/.test(topic) || /^(0x)?[0-9A-F]{64}$/.test(topic)) {\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Hashes values to a sha3 hash using keccak 256\\\\n *\\\\n * To hash a HEX string the hex must have 0x in front.\\\\n *\\\\n * @method sha3\\\\n * @return {String} the sha3 string\\\\n */\\\\nvar SHA3_NULL_S = \'0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470\';\\\\n\\\\nvar sha3 = function (value) {\\\\n    if (isHexStrict(value) && /^0x/i.test((value).toString())) {\\\\n        value = hexToBytes(value);\\\\n    }\\\\n\\\\n    var returnValue = Hash.keccak256(value); // jshint ignore:line\\\\n\\\\n    if(returnValue === SHA3_NULL_S) {\\\\n        return null;\\\\n    } else {\\\\n        return returnValue;\\\\n    }\\\\n};\\\\n// expose the under the hood keccak256\\\\nsha3._Hash = Hash;\\\\n\\\\n\\\\nmodule.exports = {\\\\n    BN: BN,\\\\n    isBN: isBN,\\\\n    isBigNumber: isBigNumber,\\\\n    toBN: toBN,\\\\n    isAddress: isAddress,\\\\n    isBloom: isBloom, // TODO UNDOCUMENTED\\\\n    isTopic: isTopic, // TODO UNDOCUMENTED\\\\n    checkAddressChecksum: checkAddressChecksum,\\\\n    utf8ToHex: utf8ToHex,\\\\n    hexToUtf8: hexToUtf8,\\\\n    hexToNumber: hexToNumber,\\\\n    hexToNumberString: hexToNumberString,\\\\n    numberToHex: numberToHex,\\\\n    toHex: toHex,\\\\n    hexToBytes: hexToBytes,\\\\n    bytesToHex: bytesToHex,\\\\n    isHex: isHex,\\\\n    isHexStrict: isHexStrict,\\\\n    leftPad: leftPad,\\\\n    rightPad: rightPad,\\\\n    toTwosComplement: toTwosComplement,\\\\n    sha3: sha3\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-utils/src/utils.js\\\\n// module id = 165\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-utils/src/utils.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nObject.defineProperty(exports, \\\\\\"__esModule\\\\\\", {\\\\n  value: true\\\\n});\\\\n\\\\nvar _typeof2 = __webpack_require__(179);\\\\n\\\\nvar _typeof3 = _interopRequireDefault(_typeof2);\\\\n\\\\nvar _promise = __webpack_require__(96);\\\\n\\\\nvar _promise2 = _interopRequireDefault(_promise);\\\\n\\\\nvar _regenerator = __webpack_require__(63);\\\\n\\\\nvar _regenerator2 = _interopRequireDefault(_regenerator);\\\\n\\\\nvar _stringify = __webpack_require__(95);\\\\n\\\\nvar _stringify2 = _interopRequireDefault(_stringify);\\\\n\\\\nvar _asyncToGenerator2 = __webpack_require__(60);\\\\n\\\\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\\\\n\\\\nvar _assign = __webpack_require__(175);\\\\n\\\\nvar _assign2 = _interopRequireDefault(_assign);\\\\n\\\\nvar _classCallCheck2 = __webpack_require__(61);\\\\n\\\\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\\\\n\\\\nvar _createClass2 = __webpack_require__(62);\\\\n\\\\nvar _createClass3 = _interopRequireDefault(_createClass2);\\\\n\\\\nvar _config2 = __webpack_require__(59);\\\\n\\\\nvar _config3 = _interopRequireDefault(_config2);\\\\n\\\\nvar _utils = __webpack_require__(93);\\\\n\\\\nvar Utils = _interopRequireWildcard(_utils);\\\\n\\\\nvar _DB = __webpack_require__(169);\\\\n\\\\nvar _DB2 = _interopRequireDefault(_DB);\\\\n\\\\nvar _web = __webpack_require__(365);\\\\n\\\\nvar _web2 = _interopRequireDefault(_web);\\\\n\\\\nvar _account = __webpack_require__(64);\\\\n\\\\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nvar _config = {}; /* global fetch */\\\\n\\\\nvar _wallet = { openkey: false\\\\n\\\\n  /**\\\\n   * Class for work with [Ethereum Account/Wallet](http://ethdocs.org/en/latest/account-management.html).\\\\n   *\\\\n   * ETH **account creates automatically** when DCLib init, and stored in Store.\\\\n   * For creating account lib user [web3.eth.accounts](web3js.readthedocs.io/en/1.0/web3-eth-accounts.html)\\\\n   *\\\\n   * ## About accounts in ETH\\\\n   * Accounts play a central role in Ethereum. There are two types of accounts: externally owned accounts (EOAs) and contract accounts. Here we focus on externally owned accounts, which will be referred to simply as accounts. Contract accounts will be referred to as contracts and are discussed in detail in Contracts. This generic notion of account subsuming both externally owned accounts and contracts is justified in that these entities are so called state objects. These entities have a state: accounts have balance and contracts have both balance and contract storage. The state of all accounts is the state of the Ethereum network which is updated with every block and which the network really needs to reach a consensus about. Accounts are essential for users to interact with the Ethereum blockchain via transactions.\\\\n   * If we restrict Ethereum to only externally owned accounts and allow only transactions between them, we arrive at an “altcoin” system that is less powerful than bitcoin itself and can only be used to transfer ether.\\\\n   *\\\\n   * @export\\\\n   * @class Account\\\\n   * @extends {DCLib}\\\\n   */\\\\n};\\\\nvar Account = function () {\\\\n  /**\\\\n  * @ignore\\\\n  */\\\\n  function Account(config) {\\\\n    var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\\\\n    (0, _classCallCheck3.default)(this, Account);\\\\n\\\\n    callback = callback || function () {};\\\\n\\\\n    _config = (0, _assign2.default)(_config3.default, config);\\\\n    // this._wallet = _wallet\\\\n    this._config = _config;\\\\n\\\\n    /**\\\\n     * @ignore\\\\n     */\\\\n\\\\n    this.web3 = new _web2.default(new _web2.default.providers.HttpProvider(_config.rpc_url));\\\\n\\\\n    // Init ERC20 contract\\\\n    this._ERC20 = new this.web3.eth.Contract(_config.contracts.erc20.abi, _config.contracts.erc20.address);\\\\n\\\\n    callback();\\\\n  }\\\\n\\\\n  (0, _createClass3.default)(Account, [{\\\\n    key: \'initAccount\',\\\\n    value: function () {\\\\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {\\\\n        var _this = this;\\\\n\\\\n        var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\\\\n        var ethwallet, privateKey;\\\\n        return _regenerator2.default.wrap(function _callee$(_context) {\\\\n          while (1) {\\\\n            switch (_context.prev = _context.next) {\\\\n              case 0:\\\\n                ethwallet = _DB2.default.getItem(\'ethwallet\');\\\\n\\\\n\\\\n                if (ethwallet) {\\\\n                  try {\\\\n                    _wallet.openkey = \'0x\' + JSON.parse(ethwallet).address;\\\\n                  } catch (e) {\\\\n                    Utils.debugLog([\'Error!\', e], \'error\');\\\\n                  }\\\\n                }\\\\n\\\\n                if (_wallet.openkey) {\\\\n                  _context.next = 16;\\\\n                  break;\\\\n                }\\\\n\\\\n                if (!(typeof window === \'undefined\')) {\\\\n                  _context.next = 6;\\\\n                  break;\\\\n                }\\\\n\\\\n                setTimeout(function () {\\\\n                  _this.initAccount();\\\\n                }, 333);\\\\n                return _context.abrupt(\'return\');\\\\n\\\\n              case 6:\\\\n                _context.next = 8;\\\\n                return this.getAccountFromServer();\\\\n\\\\n              case 8:\\\\n                _context.t0 = _context.sent;\\\\n\\\\n                if (_context.t0) {\\\\n                  _context.next = 11;\\\\n                  break;\\\\n                }\\\\n\\\\n                _context.t0 = this.web3.eth.accounts.create().privateKey;\\\\n\\\\n              case 11:\\\\n                privateKey = _context.t0;\\\\n                _context.next = 14;\\\\n                return _DB2.default.setItem(\'ethwallet\', (0, _stringify2.default)(this.web3.eth.accounts.encrypt(privateKey, this._config.wallet_pass)));\\\\n\\\\n              case 14:\\\\n\\\\n                this.web3.eth.accounts.wallet.add(privateKey);\\\\n\\\\n                Utils.debugLog([\' 👤 New account created:\', _wallet.openkey], _config.loglevel);\\\\n\\\\n              case 16:\\\\n\\\\n                this.unlockAccount();\\\\n                if (callback) callback();\\\\n\\\\n              case 18:\\\\n              case \'end\':\\\\n                return _context.stop();\\\\n            }\\\\n          }\\\\n        }, _callee, this);\\\\n      }));\\\\n\\\\n      function initAccount() {\\\\n        return _ref.apply(this, arguments);\\\\n      }\\\\n\\\\n      return initAccount;\\\\n    }()\\\\n\\\\n    /**\\\\n     * @ignore\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'getAccountFromServer\',\\\\n    value: function getAccountFromServer() {\\\\n      var localStorageStatusKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \'statusGetAccfromFaucet\';\\\\n\\\\n      var status = _DB2.default.getItem(localStorageStatusKey);\\\\n\\\\n      if (status) {\\\\n        if (status === \'wait\') {\\\\n          return new _promise2.default(function (resolve, reject) {\\\\n            var waitTimer = function waitTimer() {\\\\n              setTimeout(function () {\\\\n                var newStatus = _DB2.default.getItem(localStorageStatusKey);\\\\n                if ((typeof newStatus === \'undefined\' ? \'undefined\' : (0, _typeof3.default)(newStatus)) === \'object\' && newStatus.privateKey) {\\\\n                  resolve(newStatus);\\\\n                } else {\\\\n                  waitTimer();\\\\n                }\\\\n              }, 1000);\\\\n            };\\\\n            waitTimer();\\\\n          });\\\\n        }\\\\n        return;\\\\n      }\\\\n\\\\n      _DB2.default.setItem(localStorageStatusKey, \'wait\');\\\\n\\\\n      return fetch(_config.api_url + \'?get=account\').then(function (res) {\\\\n        return res.json();\\\\n      }).then(function (acc) {\\\\n        Utils.debugLog([\'Server account data:\', acc], _config.loglevel);\\\\n        _DB2.default.setItem(localStorageStatusKey, (0, _stringify2.default)(acc));\\\\n\\\\n        _wallet.openkey = acc.address;\\\\n        return acc.privateKey;\\\\n      }).catch(function (e) {\\\\n        Utils.debugLog(e);\\\\n        return false;\\\\n      });\\\\n    }\\\\n\\\\n    /**\\\\n     * ## DCLib.Account.unlockAccount(password)\\\\n     * method recover user account on password\\\\n     *\\\\n     * @example\\\\n     * > DCLib.Account.unlockAccount(\'1234\') // \'1234\' - User Password\\\\n     *\\\\n     *\\\\n     * @example\\\\n     * // method returns\\\\n     *\\\\n     * {\\\\n     *   address: \\\\\\"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\\\\\\"\\\\n     *   encrypt: encrypt(password, options)\\\\n     *   openkey: \\\\\\"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\\\\\\"\\\\n     *   privateKey: \\\\\\"0xd8c226915b298530ee9ede352a1c9fe49f15a78167477e34731e26ccc7f577aa\\\\\\"\\\\n     * }\\\\n     *\\\\n     * @param {String} [password=false] - User password for decrypt privateKey and unlock user account\\\\n     * @returns {Object} - _wallet object for the work of the Account\\\\n     *\\\\n     * @extends {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'unlockAccount\',\\\\n    value: function unlockAccount() {\\\\n      var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\\\\n\\\\n      password = password || this._config.wallet_pass;\\\\n\\\\n      if (!_DB2.default.getItem(\'ethwallet\')) return false;\\\\n\\\\n      _wallet = this.web3.eth.accounts.decrypt(_DB2.default.getItem(\'ethwallet\'), password);\\\\n\\\\n      this.web3.eth.accounts.wallet.add(_wallet.privateKey);\\\\n\\\\n      _wallet.openkey = _wallet.address;\\\\n\\\\n      /**\\\\n       * @ignore\\\\n       */\\\\n      this.signTransaction = _wallet.signTransaction;\\\\n\\\\n      return _wallet;\\\\n    }\\\\n\\\\n    /**\\\\n     * ## DCLib.Account.exportPrivateKey(password)\\\\n     * method get privateKey from account on user password\\\\n     *\\\\n     * @example\\\\n     * > DCLib.Account.exportPrivateKey(\'1234\') // \'1234\' user password for decrypt private key\\\\n     *\\\\n     * @example\\\\n     * // method return\\\\n     * > \\\\\\"0xd8c226915b298530ee9ede352a1c9fe49f15a78167477e34731e26ccc7f577aa\\\\\\" // PrivateKey\\\\n     *\\\\n     * @param {string} [password=false] - user passwod for decrypt privateKey\\\\n     * @returns {string} - Private key for user account\\\\n     *\\\\n     * @extends {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'exportPrivateKey\',\\\\n    value: function exportPrivateKey() {\\\\n      var password = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\\\\n\\\\n      // if (_wallet.privateKey) return _wallet.privateKey\\\\n\\\\n      return this.unlockAccount(password).privateKey;\\\\n    }\\\\n\\\\n    /**\\\\n     * ## DCLib.Account.get()\\\\n     * method getting account information\\\\n     *\\\\n     * @example\\\\n     * > DCLib.Account.get()\\\\n     *\\\\n     * @example\\\\n     * // method return\\\\n     *\\\\n     * {\\\\n     *   address: \\\\\\"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\\\\\\"\\\\n     *   encrypt: method\\\\n     *   openkey: \\\\\\"0xD4E9F60fc84b97080A1803CF2D4E1003313a2Ea2\\\\\\"\\\\n     *   sign: method\\\\n     *   signTransaction: method\\\\n     * }\\\\n     *\\\\n     * @returns {Object} - account info and user method\'s\\\\n     *\\\\n     * @extends {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'get\',\\\\n    value: function get() {\\\\n      var w = (0, _assign2.default)({}, _wallet);\\\\n      delete w.privateKey;\\\\n      return w;\\\\n    }\\\\n\\\\n    /**\\\\n     * ## DCLib.Account.sign(raw)\\\\n     * Signs arbitrary data. This data is before\\\\n     * UTF-8 HEX decoded and enveloped as follows:\\\\n     * \\\\\\"\\\\\\\\x19Ethereum Signed Message:\\\\\\\\n\\\\\\" + message.length + message\\\\n     *\\\\n     * @example\\\\n     * > DCLib.Account.sign(\'Hello world\')\\\\n     *\\\\n     * @example\\\\n     * // method return\\\\n     *\\\\n     * {\\\\n     *   message: \\\\\\"Hello world\\\\\\"\\\\n     *   messageHash: \\\\\\"0x25674ba4b416425b2ac42fdb33d0b0c20c59824a76e1ee4ecc04b8d48f8f6af7\\\\\\"\\\\n     *   r: \\\\\\"0x6a1bcec4ff132aadb511cfd83131e456fab8b94d92c219448113697b5d75308b\\\\\\"\\\\n     *   s: \\\\\\"0x3b805ef93c60b561b72d7c985fac11a574be0c2b2e4f3a8701cd01afa8e6edd7\\\\\\"\\\\n     *   v: \\\\\\"0x1b\\\\\\"\\\\n     *   signature: `\\\\\\"0x04450a98e9a4d72f3b83b225c10954fc78569ebb637dd6600041ac61b320b\\\\n     *   b8b0ba760038313b7e2a01674e773e5c2dec046b09fde1560dca38f35ca928765631c\\\\\\"`\\\\n     * }\\\\n     *\\\\n     * @param {string} raw - message for sign\\\\n     * @returns {Object} - sign data\\\\n     *\\\\n     * @extends {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'sign\',\\\\n    value: function sign(raw) {\\\\n      Utils.debugLog([\'call %web3.eth.accounts.sign\', [\'font-weight:bold;\']], _config.loglevel);\\\\n      Utils.debugLog(\'More docs: http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html#sign\', _config.loglevel);\\\\n\\\\n      raw = Utils.remove0x(raw);\\\\n      Utils.debugLog(raw, _config.loglevel);\\\\n      return _wallet.sign(raw);\\\\n    }\\\\n\\\\n    /**\\\\n     * ## DCLib.Account.signHash(hash)\\\\n     * method sign hashMessage\\\\n     *\\\\n     *\\\\n     * @example\\\\n     * > DCLib.Account.signHash(\\\\\\"0xAb23..\\\\\\")\\\\n       *\\\\n     * @example\\\\n     * // method return\\\\n     * > `0x6a1bcec4ff132aadb511cfd83131e456fab8b94d92c219448113697b5d75308b3b805\\\\n     *  ef93c60b561b72d7c985fac11a574be0c2b2e4f3a8701cd01afa8e6edd71b`\\\\n     *\\\\n     * @param {String} hash - message which need turn in hash\\\\n     * @returns {String} - hashed Message\\\\n     *\\\\n     * @memberOf {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'signHash\',\\\\n    value: function signHash(hash) {\\\\n      hash = Utils.add0x(hash);\\\\n      if (!this.web3.utils.isHexStrict(hash)) {\\\\n        console.log(hash + \' is not correct hex\');\\\\n        console.log(\'Use DCLib.Utils.makeSeed or Utils.soliditySHA3(your_args) to create valid hash\');\\\\n      }\\\\n\\\\n      return (0, _account.sign)(hash, Utils.add0x(this.exportPrivateKey()));\\\\n    }\\\\n\\\\n    /**\\\\n     * ## method init DCLib.Account.reset()\\\\n     * method delete account of localStorage\\\\n     *\\\\n     * @example\\\\n     * DCLib.Account.reset()\\\\n     *\\\\n     * @returns - none\\\\n     * @memberOf {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'reset\',\\\\n    value: function reset() {\\\\n      _DB2.default.setItem(\'ethwallet\', \'\');\\\\n    }\\\\n\\\\n    /**\\\\n     * This callback is\\\\n     * @callback onTxMined\\\\n     * @param {Object} receipt - information about mined trasaction\\\\n     */\\\\n    /**\\\\n     * ## DCLib.Account.sendBets(to, amount)\\\\n     * sendBets from current account to another account\\\\n     * you can use it with \\\\\\"await\\\\\\"\\\\n     *\\\\n     * @async\\\\n     *\\\\n     * @example\\\\n     * const r = await DCLib.Account.sendBets(\'0xAb5\', 10)\\\\n     *\\\\n     * @example\\\\n     * // or classic callback\\\\n     * DCLib.Account.sendBets(\'0xAb5...\', 10, function(receipt){ ... })\\\\n     *\\\\n     * @param  {string} to - bytes32 address\\\\n     * @param  {number} amount - how many bets send, 1 - 1BET, 22 - 22BET\\\\n     * @param  {onTxMined} callback - callback, when transacrion mined\\\\n     * @return {Promise.receipt} - return web3.send promise,\\\\n     *\\\\n     * @memberOf {Account}\\\\n     */\\\\n\\\\n  }, {\\\\n    key: \'sendBets\',\\\\n    value: function () {\\\\n      var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(toInput, amountInput) {\\\\n        var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\\\\n        var to, amount;\\\\n        return _regenerator2.default.wrap(function _callee2$(_context2) {\\\\n          while (1) {\\\\n            switch (_context2.prev = _context2.next) {\\\\n              case 0:\\\\n                to = Utils.add0x(toInput);\\\\n                amount = Utils.bet2dec(amountInput);\\\\n                _context2.t0 = this._ERC20.methods.transfer(to, amount);\\\\n                _context2.t1 = this.get().openkey;\\\\n                _context2.t2 = this._config.gasPrice;\\\\n                _context2.next = 7;\\\\n                return this._ERC20.methods.transfer(to, amount).estimateGas({ from: this.get().openkey });\\\\n\\\\n              case 7:\\\\n                _context2.t3 = _context2.sent;\\\\n                _context2.t4 = {\\\\n                  from: _context2.t1,\\\\n                  gasPrice: _context2.t2,\\\\n                  gas: _context2.t3\\\\n                };\\\\n\\\\n                _context2.t5 = function (transactionHash) {\\\\n                  Utils.debugLog(\'transactionHash:\', transactionHash);\\\\n                };\\\\n\\\\n                _context2.t6 = function (receipt) {\\\\n                  Utils.debugLog(\'receipt:\', receipt);\\\\n                };\\\\n\\\\n                _context2.t7 = function (receipt) {\\\\n                  if (callback) callback(receipt);\\\\n                  return receipt;\\\\n                };\\\\n\\\\n                _context2.t8 = function (err) {\\\\n                  return Utils.debugLog(\'Send bets .catch \', err);\\\\n                };\\\\n\\\\n                return _context2.abrupt(\'return\', _context2.t0.send.call(_context2.t0, _context2.t4).on(\'transactionHash\', _context2.t5).on(\'receipt\', _context2.t6).then(_context2.t7, _context2.t8));\\\\n\\\\n              case 14:\\\\n              case \'end\':\\\\n                return _context2.stop();\\\\n            }\\\\n          }\\\\n        }, _callee2, this);\\\\n      }));\\\\n\\\\n      function sendBets(_x7, _x8) {\\\\n        return _ref2.apply(this, arguments);\\\\n      }\\\\n\\\\n      return sendBets;\\\\n    }()\\\\n  }]);\\\\n  return Account;\\\\n}();\\\\n\\\\nexports.default = Account;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/Eth/Account.js\\\\n// module id = 166\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=Eth/Account.js\\")},function(module,exports,__webpack_require__){eval(\'// Copyright (c) 2005  Tom Wu\\\\n// All Rights Reserved.\\\\n// See \\"LICENSE\\" for details.\\\\n// Basic JavaScript BN library - subset useful for RSA encryption.\\\\n\\\\n// Bits per digit\\\\nvar dbits;\\\\n\\\\n// (public) Constructor\\\\n\\\\nfunction BigInteger(a, b, c) {\\\\n    if (a != null) if (\\"number\\" == typeof a) this.fromNumber(a, b, c);\\\\n    else if (b == null && \\"string\\" != typeof a) this.fromString(a, 256);\\\\n    else this.fromString(a, b);\\\\n}\\\\n\\\\n// return new, unset BigInteger\\\\n\\\\nfunction nbi() {\\\\n    return new BigInteger(null);\\\\n}\\\\n\\\\n// am avoids a big mult-and-extract completely.\\\\n// Max digit bits should be <= 30 because we do bitwise ops\\\\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\\\\n\\\\nfunction am(i, x, w, j, c, n) {\\\\n    var xl = x & 0x7fff,\\\\n        xh = x >> 15;\\\\n    while (--n >= 0) {\\\\n        var l = this[i] & 0x7fff;\\\\n        var h = this[i++] >> 15;\\\\n        var m = xh * l + h * xl;\\\\n        l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\\\\n        c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\\\\n        w[j++] = l & 0x3fffffff;\\\\n    }\\\\n    return c;\\\\n}\\\\n\\\\nBigInteger.prototype.am = am;\\\\ndbits = 30;\\\\n\\\\nBigInteger.prototype.DB = dbits;\\\\nBigInteger.prototype.DM = ((1 << dbits) - 1);\\\\nBigInteger.prototype.DV = (1 << dbits);\\\\n\\\\nvar BI_FP = 52;\\\\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\\\\nBigInteger.prototype.F1 = BI_FP - dbits;\\\\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\\\\n\\\\n// Digit conversions\\\\nvar BI_RM = \\"0123456789abcdefghijklmnopqrstuvwxyz\\";\\\\nvar BI_RC = new Array();\\\\nvar rr, vv;\\\\nrr = \\"0\\".charCodeAt(0);\\\\nfor (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\\\\nrr = \\"a\\".charCodeAt(0);\\\\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\\\\nrr = \\"A\\".charCodeAt(0);\\\\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\\\\n\\\\nfunction int2char(n) {\\\\n    return BI_RM.charAt(n);\\\\n}\\\\n\\\\nfunction intAt(s, i) {\\\\n    var c = BI_RC[s.charCodeAt(i)];\\\\n    return (c == null) ? -1 : c;\\\\n}\\\\n\\\\n// (protected) copy this to r\\\\n\\\\nfunction bnpCopyTo(r) {\\\\n    for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\\\\n    r.t = this.t;\\\\n    r.s = this.s;\\\\n}\\\\n\\\\n// (protected) set from integer value x, -DV <= x < DV\\\\n\\\\nfunction bnpFromInt(x) {\\\\n    this.t = 1;\\\\n    this.s = (x < 0) ? -1 : 0;\\\\n    if (x > 0) this[0] = x;\\\\n    else if (x < -1) this[0] = x + DV;\\\\n    else this.t = 0;\\\\n}\\\\n\\\\n// return bigint initialized to value\\\\n\\\\nfunction nbv(i) {\\\\n    var r = nbi();\\\\n    r.fromInt(i);\\\\n    return r;\\\\n}\\\\n\\\\n// (protected) set from string and radix\\\\n\\\\nfunction bnpFromString(s, b) {\\\\n    var k;\\\\n    if (b == 16) k = 4;\\\\n    else if (b == 8) k = 3;\\\\n    else if (b == 256) k = 8; // byte array\\\\n    else if (b == 2) k = 1;\\\\n    else if (b == 32) k = 5;\\\\n    else if (b == 4) k = 2;\\\\n    else {\\\\n        this.fromRadix(s, b);\\\\n        return;\\\\n    }\\\\n    this.t = 0;\\\\n    this.s = 0;\\\\n    var i = s.length,\\\\n        mi = false,\\\\n        sh = 0;\\\\n    while (--i >= 0) {\\\\n        var x = (k == 8) ? s[i] & 0xff : intAt(s, i);\\\\n        if (x < 0) {\\\\n            if (s.charAt(i) == \\"-\\") mi = true;\\\\n            continue;\\\\n        }\\\\n        mi = false;\\\\n        if (sh == 0) this[this.t++] = x;\\\\n        else if (sh + k > this.DB) {\\\\n            this[this.t - 1] |= (x & ((1 << (this.DB - sh)) - 1)) << sh;\\\\n            this[this.t++] = (x >> (this.DB - sh));\\\\n        }\\\\n        else this[this.t - 1] |= x << sh;\\\\n        sh += k;\\\\n        if (sh >= this.DB) sh -= this.DB;\\\\n    }\\\\n    if (k == 8 && (s[0] & 0x80) != 0) {\\\\n        this.s = -1;\\\\n        if (sh > 0) this[this.t - 1] |= ((1 << (this.DB - sh)) - 1) << sh;\\\\n    }\\\\n    this.clamp();\\\\n    if (mi) BigInteger.ZERO.subTo(this, this);\\\\n}\\\\n\\\\n// (protected) clamp off excess high words\\\\n\\\\nfunction bnpClamp() {\\\\n    var c = this.s & this.DM;\\\\n    while (this.t > 0 && this[this.t - 1] == c)--this.t;\\\\n}\\\\n\\\\n// (public) return string representation in given radix\\\\n\\\\nfunction bnToString(b) {\\\\n    if (this.s < 0) return \\"-\\" + this.negate().toString(b);\\\\n    var k;\\\\n    if (b == 16) k = 4;\\\\n    else if (b == 8) k = 3;\\\\n    else if (b == 2) k = 1;\\\\n    else if (b == 32) k = 5;\\\\n    else if (b == 64) k = 6;\\\\n    else if (b == 4) k = 2;\\\\n    else return this.toRadix(b);\\\\n    var km = (1 << k) - 1,\\\\n        d, m = false,\\\\n        r = \\"\\",\\\\n        i = this.t;\\\\n    var p = this.DB - (i * this.DB) % k;\\\\n    if (i-- > 0) {\\\\n        if (p < this.DB && (d = this[i] >> p) > 0) {\\\\n            m = true;\\\\n            r = int2char(d);\\\\n        }\\\\n        while (i >= 0) {\\\\n            if (p < k) {\\\\n                d = (this[i] & ((1 << p) - 1)) << (k - p);\\\\n                d |= this[--i] >> (p += this.DB - k);\\\\n            }\\\\n            else {\\\\n                d = (this[i] >> (p -= k)) & km;\\\\n                if (p <= 0) {\\\\n                    p += this.DB;\\\\n                    --i;\\\\n                }\\\\n            }\\\\n            if (d > 0) m = true;\\\\n            if (m) r += int2char(d);\\\\n        }\\\\n    }\\\\n    return m ? r : \\"0\\";\\\\n}\\\\n\\\\n// (public) -this\\\\n\\\\nfunction bnNegate() {\\\\n    var r = nbi();\\\\n    BigInteger.ZERO.subTo(this, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) |this|\\\\n\\\\nfunction bnAbs() {\\\\n    return (this.s < 0) ? this.negate() : this;\\\\n}\\\\n\\\\n// (public) return + if this > a, - if this < a, 0 if equal\\\\n\\\\nfunction bnCompareTo(a) {\\\\n    var r = this.s - a.s;\\\\n    if (r != 0) return r;\\\\n    var i = this.t;\\\\n    r = i - a.t;\\\\n    if (r != 0) return r;\\\\n    while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\\\\n    return 0;\\\\n}\\\\n\\\\n// returns bit length of the integer x\\\\n\\\\nfunction nbits(x) {\\\\n    var r = 1,\\\\n        t;\\\\n    if ((t = x >>> 16) != 0) {\\\\n        x = t;\\\\n        r += 16;\\\\n    }\\\\n    if ((t = x >> 8) != 0) {\\\\n        x = t;\\\\n        r += 8;\\\\n    }\\\\n    if ((t = x >> 4) != 0) {\\\\n        x = t;\\\\n        r += 4;\\\\n    }\\\\n    if ((t = x >> 2) != 0) {\\\\n        x = t;\\\\n        r += 2;\\\\n    }\\\\n    if ((t = x >> 1) != 0) {\\\\n        x = t;\\\\n        r += 1;\\\\n    }\\\\n    return r;\\\\n}\\\\n\\\\n// (public) return the number of bits in \\"this\\"\\\\n\\\\nfunction bnBitLength() {\\\\n    if (this.t <= 0) return 0;\\\\n    return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\\\\n}\\\\n\\\\n// (protected) r = this << n*DB\\\\n\\\\nfunction bnpDLShiftTo(n, r) {\\\\n    var i;\\\\n    for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i];\\\\n    for (i = n - 1; i >= 0; --i) r[i] = 0;\\\\n    r.t = this.t + n;\\\\n    r.s = this.s;\\\\n}\\\\n\\\\n// (protected) r = this >> n*DB\\\\n\\\\nfunction bnpDRShiftTo(n, r) {\\\\n    for (var i = n; i < this.t; ++i) r[i - n] = this[i];\\\\n    r.t = Math.max(this.t - n, 0);\\\\n    r.s = this.s;\\\\n}\\\\n\\\\n// (protected) r = this << n\\\\n\\\\nfunction bnpLShiftTo(n, r) {\\\\n    var bs = n % this.DB;\\\\n    var cbs = this.DB - bs;\\\\n    var bm = (1 << cbs) - 1;\\\\n    var ds = Math.floor(n / this.DB),\\\\n        c = (this.s << bs) & this.DM,\\\\n        i;\\\\n    for (i = this.t - 1; i >= 0; --i) {\\\\n        r[i + ds + 1] = (this[i] >> cbs) | c;\\\\n        c = (this[i] & bm) << bs;\\\\n    }\\\\n    for (i = ds - 1; i >= 0; --i) r[i] = 0;\\\\n    r[ds] = c;\\\\n    r.t = this.t + ds + 1;\\\\n    r.s = this.s;\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (protected) r = this >> n\\\\n\\\\nfunction bnpRShiftTo(n, r) {\\\\n    r.s = this.s;\\\\n    var ds = Math.floor(n / this.DB);\\\\n    if (ds >= this.t) {\\\\n        r.t = 0;\\\\n        return;\\\\n    }\\\\n    var bs = n % this.DB;\\\\n    var cbs = this.DB - bs;\\\\n    var bm = (1 << bs) - 1;\\\\n    r[0] = this[ds] >> bs;\\\\n    for (var i = ds + 1; i < this.t; ++i) {\\\\n        r[i - ds - 1] |= (this[i] & bm) << cbs;\\\\n        r[i - ds] = this[i] >> bs;\\\\n    }\\\\n    if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\\\\n    r.t = this.t - ds;\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (protected) r = this - a\\\\n\\\\nfunction bnpSubTo(a, r) {\\\\n    var i = 0,\\\\n        c = 0,\\\\n        m = Math.min(a.t, this.t);\\\\n    while (i < m) {\\\\n        c += this[i] - a[i];\\\\n        r[i++] = c & this.DM;\\\\n        c >>= this.DB;\\\\n    }\\\\n    if (a.t < this.t) {\\\\n        c -= a.s;\\\\n        while (i < this.t) {\\\\n            c += this[i];\\\\n            r[i++] = c & this.DM;\\\\n            c >>= this.DB;\\\\n        }\\\\n        c += this.s;\\\\n    }\\\\n    else {\\\\n        c += this.s;\\\\n        while (i < a.t) {\\\\n            c -= a[i];\\\\n            r[i++] = c & this.DM;\\\\n            c >>= this.DB;\\\\n        }\\\\n        c -= a.s;\\\\n    }\\\\n    r.s = (c < 0) ? -1 : 0;\\\\n    if (c < -1) r[i++] = this.DV + c;\\\\n    else if (c > 0) r[i++] = c;\\\\n    r.t = i;\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (protected) r = this * a, r != this,a (HAC 14.12)\\\\n// \\"this\\" should be the larger one if appropriate.\\\\n\\\\nfunction bnpMultiplyTo(a, r) {\\\\n    var x = this.abs(),\\\\n        y = a.abs();\\\\n    var i = x.t;\\\\n    r.t = i + y.t;\\\\n    while (--i >= 0) r[i] = 0;\\\\n    for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\\\\n    r.s = 0;\\\\n    r.clamp();\\\\n    if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\\\\n}\\\\n\\\\n// (protected) r = this^2, r != this (HAC 14.16)\\\\n\\\\nfunction bnpSquareTo(r) {\\\\n    var x = this.abs();\\\\n    var i = r.t = 2 * x.t;\\\\n    while (--i >= 0) r[i] = 0;\\\\n    for (i = 0; i < x.t - 1; ++i) {\\\\n        var c = x.am(i, x[i], r, 2 * i, 0, 1);\\\\n        if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\\\\n            r[i + x.t] -= x.DV;\\\\n            r[i + x.t + 1] = 1;\\\\n        }\\\\n    }\\\\n    if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\\\\n    r.s = 0;\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\\\\n// r != q, this != m.  q or r may be null.\\\\n\\\\nfunction bnpDivRemTo(m, q, r) {\\\\n    var pm = m.abs();\\\\n    if (pm.t <= 0) return;\\\\n    var pt = this.abs();\\\\n    if (pt.t < pm.t) {\\\\n        if (q != null) q.fromInt(0);\\\\n        if (r != null) this.copyTo(r);\\\\n        return;\\\\n    }\\\\n    if (r == null) r = nbi();\\\\n    var y = nbi(),\\\\n        ts = this.s,\\\\n        ms = m.s;\\\\n    var nsh = this.DB - nbits(pm[pm.t - 1]); // normalize modulus\\\\n    if (nsh > 0) {\\\\n        pm.lShiftTo(nsh, y);\\\\n        pt.lShiftTo(nsh, r);\\\\n    }\\\\n    else {\\\\n        pm.copyTo(y);\\\\n        pt.copyTo(r);\\\\n    }\\\\n    var ys = y.t;\\\\n    var y0 = y[ys - 1];\\\\n    if (y0 == 0) return;\\\\n    var yt = y0 * (1 << this.F1) + ((ys > 1) ? y[ys - 2] >> this.F2 : 0);\\\\n    var d1 = this.FV / yt,\\\\n        d2 = (1 << this.F1) / yt,\\\\n        e = 1 << this.F2;\\\\n    var i = r.t,\\\\n        j = i - ys,\\\\n        t = (q == null) ? nbi() : q;\\\\n    y.dlShiftTo(j, t);\\\\n    if (r.compareTo(t) >= 0) {\\\\n        r[r.t++] = 1;\\\\n        r.subTo(t, r);\\\\n    }\\\\n    BigInteger.ONE.dlShiftTo(ys, t);\\\\n    t.subTo(y, y); // \\"negative\\" y so we can replace sub with am later\\\\n    while (y.t < ys) y[y.t++] = 0;\\\\n    while (--j >= 0) {\\\\n        // Estimate quotient digit\\\\n        var qd = (r[--i] == y0) ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\\\\n        if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) { // Try it out\\\\n            y.dlShiftTo(j, t);\\\\n            r.subTo(t, r);\\\\n            while (r[i] < --qd) r.subTo(t, r);\\\\n        }\\\\n    }\\\\n    if (q != null) {\\\\n        r.drShiftTo(ys, q);\\\\n        if (ts != ms) BigInteger.ZERO.subTo(q, q);\\\\n    }\\\\n    r.t = ys;\\\\n    r.clamp();\\\\n    if (nsh > 0) r.rShiftTo(nsh, r); // Denormalize remainder\\\\n    if (ts < 0) BigInteger.ZERO.subTo(r, r);\\\\n}\\\\n\\\\n// (public) this mod a\\\\n\\\\nfunction bnMod(a) {\\\\n    var r = nbi();\\\\n    this.abs().divRemTo(a, null, r);\\\\n    if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\\\\n    return r;\\\\n}\\\\n\\\\n// Modular reduction using \\"classic\\" algorithm\\\\n\\\\nfunction Classic(m) {\\\\n    this.m = m;\\\\n}\\\\n\\\\nfunction cConvert(x) {\\\\n    if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\\\\n    else return x;\\\\n}\\\\n\\\\nfunction cRevert(x) {\\\\n    return x;\\\\n}\\\\n\\\\nfunction cReduce(x) {\\\\n    x.divRemTo(this.m, null, x);\\\\n}\\\\n\\\\nfunction cMulTo(x, y, r) {\\\\n    x.multiplyTo(y, r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\nfunction cSqrTo(x, r) {\\\\n    x.squareTo(r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\nClassic.prototype.convert = cConvert;\\\\nClassic.prototype.revert = cRevert;\\\\nClassic.prototype.reduce = cReduce;\\\\nClassic.prototype.mulTo = cMulTo;\\\\nClassic.prototype.sqrTo = cSqrTo;\\\\n\\\\n// (protected) return \\"-1/this % 2^DB\\"; useful for Mont. reduction\\\\n// justification:\\\\n//         xy == 1 (mod m)\\\\n//         xy =  1+km\\\\n//   xy(2-xy) = (1+km)(1-km)\\\\n// x[y(2-xy)] = 1-k^2m^2\\\\n// x[y(2-xy)] == 1 (mod m^2)\\\\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\\\\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\\\\n// JS multiply \\"overflows\\" differently from C/C++, so care is needed here.\\\\n\\\\nfunction bnpInvDigit() {\\\\n    if (this.t < 1) return 0;\\\\n    var x = this[0];\\\\n    if ((x & 1) == 0) return 0;\\\\n    var y = x & 3; // y == 1/x mod 2^2\\\\n    y = (y * (2 - (x & 0xf) * y)) & 0xf; // y == 1/x mod 2^4\\\\n    y = (y * (2 - (x & 0xff) * y)) & 0xff; // y == 1/x mod 2^8\\\\n    y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff; // y == 1/x mod 2^16\\\\n    // last step - calculate inverse mod DV directly;\\\\n    // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\\\\n    y = (y * (2 - x * y % this.DV)) % this.DV; // y == 1/x mod 2^dbits\\\\n    // we really want the negative inverse, and -DV < y < DV\\\\n    return (y > 0) ? this.DV - y : -y;\\\\n}\\\\n\\\\n// Montgomery reduction\\\\n\\\\nfunction Montgomery(m) {\\\\n    this.m = m;\\\\n    this.mp = m.invDigit();\\\\n    this.mpl = this.mp & 0x7fff;\\\\n    this.mph = this.mp >> 15;\\\\n    this.um = (1 << (m.DB - 15)) - 1;\\\\n    this.mt2 = 2 * m.t;\\\\n}\\\\n\\\\n// xR mod m\\\\n\\\\nfunction montConvert(x) {\\\\n    var r = nbi();\\\\n    x.abs().dlShiftTo(this.m.t, r);\\\\n    r.divRemTo(this.m, null, r);\\\\n    if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\\\\n    return r;\\\\n}\\\\n\\\\n// x/R mod m\\\\n\\\\nfunction montRevert(x) {\\\\n    var r = nbi();\\\\n    x.copyTo(r);\\\\n    this.reduce(r);\\\\n    return r;\\\\n}\\\\n\\\\n// x = x/R mod m (HAC 14.32)\\\\n\\\\nfunction montReduce(x) {\\\\n    while (x.t <= this.mt2) // pad x so am has enough room later\\\\n    x[x.t++] = 0;\\\\n    for (var i = 0; i < this.m.t; ++i) {\\\\n        // faster way of calculating u0 = x[i]*mp mod DV\\\\n        var j = x[i] & 0x7fff;\\\\n        var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\\\\n        // use am to combine the multiply-shift-add into one call\\\\n        j = i + this.m.t;\\\\n        x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\\\\n        // propagate carry\\\\n        while (x[j] >= x.DV) {\\\\n            x[j] -= x.DV;\\\\n            x[++j]++;\\\\n        }\\\\n    }\\\\n    x.clamp();\\\\n    x.drShiftTo(this.m.t, x);\\\\n    if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\\\\n}\\\\n\\\\n// r = \\"x^2/R mod m\\"; x != r\\\\n\\\\nfunction montSqrTo(x, r) {\\\\n    x.squareTo(r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\n// r = \\"xy/R mod m\\"; x,y != r\\\\n\\\\nfunction montMulTo(x, y, r) {\\\\n    x.multiplyTo(y, r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\nMontgomery.prototype.convert = montConvert;\\\\nMontgomery.prototype.revert = montRevert;\\\\nMontgomery.prototype.reduce = montReduce;\\\\nMontgomery.prototype.mulTo = montMulTo;\\\\nMontgomery.prototype.sqrTo = montSqrTo;\\\\n\\\\n// (protected) true iff this is even\\\\n\\\\nfunction bnpIsEven() {\\\\n    return ((this.t > 0) ? (this[0] & 1) : this.s) == 0;\\\\n}\\\\n\\\\n// (protected) this^e, e < 2^32, doing sqr and mul with \\"r\\" (HAC 14.79)\\\\n\\\\nfunction bnpExp(e, z) {\\\\n    if (e > 0xffffffff || e < 1) return BigInteger.ONE;\\\\n    var r = nbi(),\\\\n        r2 = nbi(),\\\\n        g = z.convert(this),\\\\n        i = nbits(e) - 1;\\\\n    g.copyTo(r);\\\\n    while (--i >= 0) {\\\\n        z.sqrTo(r, r2);\\\\n        if ((e & (1 << i)) > 0) z.mulTo(r2, g, r);\\\\n        else {\\\\n            var t = r;\\\\n            r = r2;\\\\n            r2 = t;\\\\n        }\\\\n    }\\\\n    return z.revert(r);\\\\n}\\\\n\\\\n// (public) this^e % m, 0 <= e < 2^32\\\\n\\\\nfunction bnModPowInt(e, m) {\\\\n    var z;\\\\n    if (e < 256 || m.isEven()) z = new Classic(m);\\\\n    else z = new Montgomery(m);\\\\n    return this.exp(e, z);\\\\n}\\\\n\\\\n// protected\\\\nBigInteger.prototype.copyTo = bnpCopyTo;\\\\nBigInteger.prototype.fromInt = bnpFromInt;\\\\nBigInteger.prototype.fromString = bnpFromString;\\\\nBigInteger.prototype.clamp = bnpClamp;\\\\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\\\\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\\\\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\\\\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\\\\nBigInteger.prototype.subTo = bnpSubTo;\\\\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\\\\nBigInteger.prototype.squareTo = bnpSquareTo;\\\\nBigInteger.prototype.divRemTo = bnpDivRemTo;\\\\nBigInteger.prototype.invDigit = bnpInvDigit;\\\\nBigInteger.prototype.isEven = bnpIsEven;\\\\nBigInteger.prototype.exp = bnpExp;\\\\n\\\\n// public\\\\nBigInteger.prototype.toString = bnToString;\\\\nBigInteger.prototype.negate = bnNegate;\\\\nBigInteger.prototype.abs = bnAbs;\\\\nBigInteger.prototype.compareTo = bnCompareTo;\\\\nBigInteger.prototype.bitLength = bnBitLength;\\\\nBigInteger.prototype.mod = bnMod;\\\\nBigInteger.prototype.modPowInt = bnModPowInt;\\\\n\\\\n// \\"constants\\"\\\\nBigInteger.ZERO = nbv(0);\\\\nBigInteger.ONE = nbv(1);\\\\n\\\\n\\\\nfunction bnClone() {\\\\n    var r = nbi();\\\\n    this.copyTo(r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) return value as integer\\\\n\\\\nfunction bnIntValue() {\\\\n    if (this.s < 0) {\\\\n        if (this.t == 1) return this[0] - this.DV;\\\\n        else if (this.t == 0) return -1;\\\\n    }\\\\n    else if (this.t == 1) return this[0];\\\\n    else if (this.t == 0) return 0;\\\\n    // assumes 16 < DB < 32\\\\n    return ((this[1] & ((1 << (32 - this.DB)) - 1)) << this.DB) | this[0];\\\\n}\\\\n\\\\n// (public) return value as byte\\\\n\\\\nfunction bnByteValue() {\\\\n    return (this.t == 0) ? this.s : (this[0] << 24) >> 24;\\\\n}\\\\n\\\\n// (public) return value as short (assumes DB>=16)\\\\n\\\\nfunction bnShortValue() {\\\\n    return (this.t == 0) ? this.s : (this[0] << 16) >> 16;\\\\n}\\\\n\\\\n// (protected) return x s.t. r^x < DV\\\\n\\\\nfunction bnpChunkSize(r) {\\\\n    return Math.floor(Math.LN2 * this.DB / Math.log(r));\\\\n}\\\\n\\\\n// (public) 0 if this == 0, 1 if this > 0\\\\n\\\\nfunction bnSigNum() {\\\\n    if (this.s < 0) return -1;\\\\n    else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\\\\n    else return 1;\\\\n}\\\\n\\\\n// (protected) convert to radix string\\\\n\\\\nfunction bnpToRadix(b) {\\\\n    if (b == null) b = 10;\\\\n    if (this.signum() == 0 || b < 2 || b > 36) return \\"0\\";\\\\n    var cs = this.chunkSize(b);\\\\n    var a = Math.pow(b, cs);\\\\n    var d = nbv(a),\\\\n        y = nbi(),\\\\n        z = nbi(),\\\\n        r = \\"\\";\\\\n    this.divRemTo(d, y, z);\\\\n    while (y.signum() > 0) {\\\\n        r = (a + z.intValue()).toString(b).substr(1) + r;\\\\n        y.divRemTo(d, y, z);\\\\n    }\\\\n    return z.intValue().toString(b) + r;\\\\n}\\\\n\\\\n// (protected) convert from radix string\\\\n\\\\nfunction bnpFromRadix(s, b) {\\\\n    this.fromInt(0);\\\\n    if (b == null) b = 10;\\\\n    var cs = this.chunkSize(b);\\\\n    var d = Math.pow(b, cs),\\\\n        mi = false,\\\\n        j = 0,\\\\n        w = 0;\\\\n    for (var i = 0; i < s.length; ++i) {\\\\n        var x = intAt(s, i);\\\\n        if (x < 0) {\\\\n            if (s.charAt(i) == \\"-\\" && this.signum() == 0) mi = true;\\\\n            continue;\\\\n        }\\\\n        w = b * w + x;\\\\n        if (++j >= cs) {\\\\n            this.dMultiply(d);\\\\n            this.dAddOffset(w, 0);\\\\n            j = 0;\\\\n            w = 0;\\\\n        }\\\\n    }\\\\n    if (j > 0) {\\\\n        this.dMultiply(Math.pow(b, j));\\\\n        this.dAddOffset(w, 0);\\\\n    }\\\\n    if (mi) BigInteger.ZERO.subTo(this, this);\\\\n}\\\\n\\\\n// (protected) alternate constructor\\\\n\\\\nfunction bnpFromNumber(a, b, c) {\\\\n    if (\\"number\\" == typeof b) {\\\\n        // new BigInteger(int,int,RNG)\\\\n        if (a < 2) this.fromInt(1);\\\\n        else {\\\\n            this.fromNumber(a, c);\\\\n            if (!this.testBit(a - 1)) // force MSB set\\\\n            this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this);\\\\n            if (this.isEven()) this.dAddOffset(1, 0); // force odd\\\\n            while (!this.isProbablePrime(b)) {\\\\n                this.dAddOffset(2, 0);\\\\n                if (this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a - 1), this);\\\\n            }\\\\n        }\\\\n    }\\\\n    else {\\\\n        // new BigInteger(int,RNG)\\\\n        var x = new Array(),\\\\n            t = a & 7;\\\\n        x.length = (a >> 3) + 1;\\\\n        b.nextBytes(x);\\\\n        if (t > 0) x[0] &= ((1 << t) - 1);\\\\n        else x[0] = 0;\\\\n        this.fromString(x, 256);\\\\n    }\\\\n}\\\\n\\\\n// (public) convert to bigendian byte array\\\\n\\\\nfunction bnToByteArray() {\\\\n    var i = this.t,\\\\n        r = new Array();\\\\n    r[0] = this.s;\\\\n    var p = this.DB - (i * this.DB) % 8,\\\\n        d, k = 0;\\\\n    if (i-- > 0) {\\\\n        if (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p) r[k++] = d | (this.s << (this.DB - p));\\\\n        while (i >= 0) {\\\\n            if (p < 8) {\\\\n                d = (this[i] & ((1 << p) - 1)) << (8 - p);\\\\n                d |= this[--i] >> (p += this.DB - 8);\\\\n            }\\\\n            else {\\\\n                d = (this[i] >> (p -= 8)) & 0xff;\\\\n                if (p <= 0) {\\\\n                    p += this.DB;\\\\n                    --i;\\\\n                }\\\\n            }\\\\n            if ((d & 0x80) != 0) d |= -256;\\\\n            if (k == 0 && (this.s & 0x80) != (d & 0x80))++k;\\\\n            if (k > 0 || d != this.s) r[k++] = d;\\\\n        }\\\\n    }\\\\n    return r;\\\\n}\\\\n\\\\nfunction bnEquals(a) {\\\\n    return (this.compareTo(a) == 0);\\\\n}\\\\n\\\\nfunction bnMin(a) {\\\\n    return (this.compareTo(a) < 0) ? this : a;\\\\n}\\\\n\\\\nfunction bnMax(a) {\\\\n    return (this.compareTo(a) > 0) ? this : a;\\\\n}\\\\n\\\\n// (protected) r = this op a (bitwise)\\\\n\\\\nfunction bnpBitwiseTo(a, op, r) {\\\\n    var i, f, m = Math.min(a.t, this.t);\\\\n    for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]);\\\\n    if (a.t < this.t) {\\\\n        f = a.s & this.DM;\\\\n        for (i = m; i < this.t; ++i) r[i] = op(this[i], f);\\\\n        r.t = this.t;\\\\n    }\\\\n    else {\\\\n        f = this.s & this.DM;\\\\n        for (i = m; i < a.t; ++i) r[i] = op(f, a[i]);\\\\n        r.t = a.t;\\\\n    }\\\\n    r.s = op(this.s, a.s);\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (public) this & a\\\\n\\\\nfunction op_and(x, y) {\\\\n    return x & y;\\\\n}\\\\n\\\\nfunction bnAnd(a) {\\\\n    var r = nbi();\\\\n    this.bitwiseTo(a, op_and, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this | a\\\\n\\\\nfunction op_or(x, y) {\\\\n    return x | y;\\\\n}\\\\n\\\\nfunction bnOr(a) {\\\\n    var r = nbi();\\\\n    this.bitwiseTo(a, op_or, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this ^ a\\\\n\\\\nfunction op_xor(x, y) {\\\\n    return x ^ y;\\\\n}\\\\n\\\\nfunction bnXor(a) {\\\\n    var r = nbi();\\\\n    this.bitwiseTo(a, op_xor, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this & ~a\\\\n\\\\nfunction op_andnot(x, y) {\\\\n    return x & ~y;\\\\n}\\\\n\\\\nfunction bnAndNot(a) {\\\\n    var r = nbi();\\\\n    this.bitwiseTo(a, op_andnot, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) ~this\\\\n\\\\nfunction bnNot() {\\\\n    var r = nbi();\\\\n    for (var i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i];\\\\n    r.t = this.t;\\\\n    r.s = ~this.s;\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this << n\\\\n\\\\nfunction bnShiftLeft(n) {\\\\n    var r = nbi();\\\\n    if (n < 0) this.rShiftTo(-n, r);\\\\n    else this.lShiftTo(n, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this >> n\\\\n\\\\nfunction bnShiftRight(n) {\\\\n    var r = nbi();\\\\n    if (n < 0) this.lShiftTo(-n, r);\\\\n    else this.rShiftTo(n, r);\\\\n    return r;\\\\n}\\\\n\\\\n// return index of lowest 1-bit in x, x < 2^31\\\\n\\\\nfunction lbit(x) {\\\\n    if (x == 0) return -1;\\\\n    var r = 0;\\\\n    if ((x & 0xffff) == 0) {\\\\n        x >>= 16;\\\\n        r += 16;\\\\n    }\\\\n    if ((x & 0xff) == 0) {\\\\n        x >>= 8;\\\\n        r += 8;\\\\n    }\\\\n    if ((x & 0xf) == 0) {\\\\n        x >>= 4;\\\\n        r += 4;\\\\n    }\\\\n    if ((x & 3) == 0) {\\\\n        x >>= 2;\\\\n        r += 2;\\\\n    }\\\\n    if ((x & 1) == 0)++r;\\\\n    return r;\\\\n}\\\\n\\\\n// (public) returns index of lowest 1-bit (or -1 if none)\\\\n\\\\nfunction bnGetLowestSetBit() {\\\\n    for (var i = 0; i < this.t; ++i)\\\\n    if (this[i] != 0) return i * this.DB + lbit(this[i]);\\\\n    if (this.s < 0) return this.t * this.DB;\\\\n    return -1;\\\\n}\\\\n\\\\n// return number of 1 bits in x\\\\n\\\\nfunction cbit(x) {\\\\n    var r = 0;\\\\n    while (x != 0) {\\\\n        x &= x - 1;\\\\n        ++r;\\\\n    }\\\\n    return r;\\\\n}\\\\n\\\\n// (public) return number of set bits\\\\n\\\\nfunction bnBitCount() {\\\\n    var r = 0,\\\\n        x = this.s & this.DM;\\\\n    for (var i = 0; i < this.t; ++i) r += cbit(this[i] ^ x);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) true iff nth bit is set\\\\n\\\\nfunction bnTestBit(n) {\\\\n    var j = Math.floor(n / this.DB);\\\\n    if (j >= this.t) return (this.s != 0);\\\\n    return ((this[j] & (1 << (n % this.DB))) != 0);\\\\n}\\\\n\\\\n// (protected) this op (1<<n)\\\\n\\\\nfunction bnpChangeBit(n, op) {\\\\n    var r = BigInteger.ONE.shiftLeft(n);\\\\n    this.bitwiseTo(r, op, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this | (1<<n)\\\\n\\\\nfunction bnSetBit(n) {\\\\n    return this.changeBit(n, op_or);\\\\n}\\\\n\\\\n// (public) this & ~(1<<n)\\\\n\\\\nfunction bnClearBit(n) {\\\\n    return this.changeBit(n, op_andnot);\\\\n}\\\\n\\\\n// (public) this ^ (1<<n)\\\\n\\\\nfunction bnFlipBit(n) {\\\\n    return this.changeBit(n, op_xor);\\\\n}\\\\n\\\\n// (protected) r = this + a\\\\n\\\\nfunction bnpAddTo(a, r) {\\\\n    var i = 0,\\\\n        c = 0,\\\\n        m = Math.min(a.t, this.t);\\\\n    while (i < m) {\\\\n        c += this[i] + a[i];\\\\n        r[i++] = c & this.DM;\\\\n        c >>= this.DB;\\\\n    }\\\\n    if (a.t < this.t) {\\\\n        c += a.s;\\\\n        while (i < this.t) {\\\\n            c += this[i];\\\\n            r[i++] = c & this.DM;\\\\n            c >>= this.DB;\\\\n        }\\\\n        c += this.s;\\\\n    }\\\\n    else {\\\\n        c += this.s;\\\\n        while (i < a.t) {\\\\n            c += a[i];\\\\n            r[i++] = c & this.DM;\\\\n            c >>= this.DB;\\\\n        }\\\\n        c += a.s;\\\\n    }\\\\n    r.s = (c < 0) ? -1 : 0;\\\\n    if (c > 0) r[i++] = c;\\\\n    else if (c < -1) r[i++] = this.DV + c;\\\\n    r.t = i;\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (public) this + a\\\\n\\\\nfunction bnAdd(a) {\\\\n    var r = nbi();\\\\n    this.addTo(a, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this - a\\\\n\\\\nfunction bnSubtract(a) {\\\\n    var r = nbi();\\\\n    this.subTo(a, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this * a\\\\n\\\\nfunction bnMultiply(a) {\\\\n    var r = nbi();\\\\n    this.multiplyTo(a, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this^2\\\\n\\\\nfunction bnSquare() {\\\\n    var r = nbi();\\\\n    this.squareTo(r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this / a\\\\n\\\\nfunction bnDivide(a) {\\\\n    var r = nbi();\\\\n    this.divRemTo(a, r, null);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) this % a\\\\n\\\\nfunction bnRemainder(a) {\\\\n    var r = nbi();\\\\n    this.divRemTo(a, null, r);\\\\n    return r;\\\\n}\\\\n\\\\n// (public) [this/a,this%a]\\\\n\\\\nfunction bnDivideAndRemainder(a) {\\\\n    var q = nbi(),\\\\n        r = nbi();\\\\n    this.divRemTo(a, q, r);\\\\n    return new Array(q, r);\\\\n}\\\\n\\\\n// (protected) this *= n, this >= 0, 1 < n < DV\\\\n\\\\nfunction bnpDMultiply(n) {\\\\n    this[this.t] = this.am(0, n - 1, this, 0, 0, this.t);\\\\n    ++this.t;\\\\n    this.clamp();\\\\n}\\\\n\\\\n// (protected) this += n << w words, this >= 0\\\\n\\\\nfunction bnpDAddOffset(n, w) {\\\\n    if (n == 0) return;\\\\n    while (this.t <= w) this[this.t++] = 0;\\\\n    this[w] += n;\\\\n    while (this[w] >= this.DV) {\\\\n        this[w] -= this.DV;\\\\n        if (++w >= this.t) this[this.t++] = 0;\\\\n        ++this[w];\\\\n    }\\\\n}\\\\n\\\\n// A \\"null\\" reducer\\\\n\\\\nfunction NullExp() {}\\\\n\\\\nfunction nNop(x) {\\\\n    return x;\\\\n}\\\\n\\\\nfunction nMulTo(x, y, r) {\\\\n    x.multiplyTo(y, r);\\\\n}\\\\n\\\\nfunction nSqrTo(x, r) {\\\\n    x.squareTo(r);\\\\n}\\\\n\\\\nNullExp.prototype.convert = nNop;\\\\nNullExp.prototype.revert = nNop;\\\\nNullExp.prototype.mulTo = nMulTo;\\\\nNullExp.prototype.sqrTo = nSqrTo;\\\\n\\\\n// (public) this^e\\\\n\\\\nfunction bnPow(e) {\\\\n    return this.exp(e, new NullExp());\\\\n}\\\\n\\\\n// (protected) r = lower n words of \\"this * a\\", a.t <= n\\\\n// \\"this\\" should be the larger one if appropriate.\\\\n\\\\nfunction bnpMultiplyLowerTo(a, n, r) {\\\\n    var i = Math.min(this.t + a.t, n);\\\\n    r.s = 0; // assumes a,this >= 0\\\\n    r.t = i;\\\\n    while (i > 0) r[--i] = 0;\\\\n    var j;\\\\n    for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t);\\\\n    for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i);\\\\n    r.clamp();\\\\n}\\\\n\\\\n// (protected) r = \\"this * a\\" without lower n words, n > 0\\\\n// \\"this\\" should be the larger one if appropriate.\\\\n\\\\nfunction bnpMultiplyUpperTo(a, n, r) {\\\\n    --n;\\\\n    var i = r.t = this.t + a.t - n;\\\\n    r.s = 0; // assumes a,this >= 0\\\\n    while (--i >= 0) r[i] = 0;\\\\n    for (i = Math.max(n - this.t, 0); i < a.t; ++i)\\\\n    r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n);\\\\n    r.clamp();\\\\n    r.drShiftTo(1, r);\\\\n}\\\\n\\\\n// Barrett modular reduction\\\\n\\\\nfunction Barrett(m) {\\\\n    // setup Barrett\\\\n    this.r2 = nbi();\\\\n    this.q3 = nbi();\\\\n    BigInteger.ONE.dlShiftTo(2 * m.t, this.r2);\\\\n    this.mu = this.r2.divide(m);\\\\n    this.m = m;\\\\n}\\\\n\\\\nfunction barrettConvert(x) {\\\\n    if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m);\\\\n    else if (x.compareTo(this.m) < 0) return x;\\\\n    else {\\\\n        var r = nbi();\\\\n        x.copyTo(r);\\\\n        this.reduce(r);\\\\n        return r;\\\\n    }\\\\n}\\\\n\\\\nfunction barrettRevert(x) {\\\\n    return x;\\\\n}\\\\n\\\\n// x = x mod m (HAC 14.42)\\\\n\\\\nfunction barrettReduce(x) {\\\\n    x.drShiftTo(this.m.t - 1, this.r2);\\\\n    if (x.t > this.m.t + 1) {\\\\n        x.t = this.m.t + 1;\\\\n        x.clamp();\\\\n    }\\\\n    this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3);\\\\n    this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2);\\\\n    while (x.compareTo(this.r2) < 0) x.dAddOffset(1, this.m.t + 1);\\\\n    x.subTo(this.r2, x);\\\\n    while (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\\\\n}\\\\n\\\\n// r = x^2 mod m; x != r\\\\n\\\\nfunction barrettSqrTo(x, r) {\\\\n    x.squareTo(r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\n// r = x*y mod m; x,y != r\\\\n\\\\nfunction barrettMulTo(x, y, r) {\\\\n    x.multiplyTo(y, r);\\\\n    this.reduce(r);\\\\n}\\\\n\\\\nBarrett.prototype.convert = barrettConvert;\\\\nBarrett.prototype.revert = barrettRevert;\\\\nBarrett.prototype.reduce = barrettReduce;\\\\nBarrett.prototype.mulTo = barrettMulTo;\\\\nBarrett.prototype.sqrTo = barrettSqrTo;\\\\n\\\\n// (public) this^e % m (HAC 14.85)\\\\n\\\\nfunction bnModPow(e, m) {\\\\n    var i = e.bitLength(),\\\\n        k, r = nbv(1),\\\\n        z;\\\\n    if (i <= 0) return r;\\\\n    else if (i < 18) k = 1;\\\\n    else if (i < 48) k = 3;\\\\n    else if (i < 144) k = 4;\\\\n    else if (i < 768) k = 5;\\\\n    else k = 6;\\\\n    if (i < 8) z = new Classic(m);\\\\n    else if (m.isEven()) z = new Barrett(m);\\\\n    else z = new Montgomery(m);\\\\n\\\\n    // precomputation\\\\n    var g = new Array(),\\\\n        n = 3,\\\\n        k1 = k - 1,\\\\n        km = (1 << k) - 1;\\\\n    g[1] = z.convert(this);\\\\n    if (k > 1) {\\\\n        var g2 = nbi();\\\\n        z.sqrTo(g[1], g2);\\\\n        while (n <= km) {\\\\n            g[n] = nbi();\\\\n            z.mulTo(g2, g[n - 2], g[n]);\\\\n            n += 2;\\\\n        }\\\\n    }\\\\n\\\\n    var j = e.t - 1,\\\\n        w, is1 = true,\\\\n        r2 = nbi(),\\\\n        t;\\\\n    i = nbits(e[j]) - 1;\\\\n    while (j >= 0) {\\\\n        if (i >= k1) w = (e[j] >> (i - k1)) & km;\\\\n        else {\\\\n            w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\\\\n            if (j > 0) w |= e[j - 1] >> (this.DB + i - k1);\\\\n        }\\\\n\\\\n        n = k;\\\\n        while ((w & 1) == 0) {\\\\n            w >>= 1;\\\\n            --n;\\\\n        }\\\\n        if ((i -= n) < 0) {\\\\n            i += this.DB;\\\\n            --j;\\\\n        }\\\\n        if (is1) { // ret == 1, don\\\\\'t bother squaring or multiplying it\\\\n            g[w].copyTo(r);\\\\n            is1 = false;\\\\n        }\\\\n        else {\\\\n            while (n > 1) {\\\\n                z.sqrTo(r, r2);\\\\n                z.sqrTo(r2, r);\\\\n                n -= 2;\\\\n            }\\\\n            if (n > 0) z.sqrTo(r, r2);\\\\n            else {\\\\n                t = r;\\\\n                r = r2;\\\\n                r2 = t;\\\\n            }\\\\n            z.mulTo(r2, g[w], r);\\\\n        }\\\\n\\\\n        while (j >= 0 && (e[j] & (1 << i)) == 0) {\\\\n            z.sqrTo(r, r2);\\\\n            t = r;\\\\n            r = r2;\\\\n            r2 = t;\\\\n            if (--i < 0) {\\\\n                i = this.DB - 1;\\\\n                --j;\\\\n            }\\\\n        }\\\\n    }\\\\n    return z.revert(r);\\\\n}\\\\n\\\\n// (public) gcd(this,a) (HAC 14.54)\\\\n\\\\nfunction bnGCD(a) {\\\\n    var x = (this.s < 0) ? this.negate() : this.clone();\\\\n    var y = (a.s < 0) ? a.negate() : a.clone();\\\\n    if (x.compareTo(y) < 0) {\\\\n        var t = x;\\\\n        x = y;\\\\n        y = t;\\\\n    }\\\\n    var i = x.getLowestSetBit(),\\\\n        g = y.getLowestSetBit();\\\\n    if (g < 0) return x;\\\\n    if (i < g) g = i;\\\\n    if (g > 0) {\\\\n        x.rShiftTo(g, x);\\\\n        y.rShiftTo(g, y);\\\\n    }\\\\n    while (x.signum() > 0) {\\\\n        if ((i = x.getLowestSetBit()) > 0) x.rShiftTo(i, x);\\\\n        if ((i = y.getLowestSetBit()) > 0) y.rShiftTo(i, y);\\\\n        if (x.compareTo(y) >= 0) {\\\\n            x.subTo(y, x);\\\\n            x.rShiftTo(1, x);\\\\n        }\\\\n        else {\\\\n            y.subTo(x, y);\\\\n            y.rShiftTo(1, y);\\\\n        }\\\\n    }\\\\n    if (g > 0) y.lShiftTo(g, y);\\\\n    return y;\\\\n}\\\\n\\\\n// (protected) this % n, n < 2^26\\\\n\\\\nfunction bnpModInt(n) {\\\\n    if (n <= 0) return 0;\\\\n    var d = this.DV % n,\\\\n        r = (this.s < 0) ? n - 1 : 0;\\\\n    if (this.t > 0) if (d == 0) r = this[0] % n;\\\\n    else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n;\\\\n    return r;\\\\n}\\\\n\\\\n// (public) 1/this % m (HAC 14.61)\\\\n\\\\nfunction bnModInverse(m) {\\\\n    var ac = m.isEven();\\\\n    if ((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\\\\n    var u = m.clone(),\\\\n        v = this.clone();\\\\n    var a = nbv(1),\\\\n        b = nbv(0),\\\\n        c = nbv(0),\\\\n        d = nbv(1);\\\\n    while (u.signum() != 0) {\\\\n        while (u.isEven()) {\\\\n            u.rShiftTo(1, u);\\\\n            if (ac) {\\\\n                if (!a.isEven() || !b.isEven()) {\\\\n                    a.addTo(this, a);\\\\n                    b.subTo(m, b);\\\\n                }\\\\n                a.rShiftTo(1, a);\\\\n            }\\\\n            else if (!b.isEven()) b.subTo(m, b);\\\\n            b.rShiftTo(1, b);\\\\n        }\\\\n        while (v.isEven()) {\\\\n            v.rShiftTo(1, v);\\\\n            if (ac) {\\\\n                if (!c.isEven() || !d.isEven()) {\\\\n                    c.addTo(this, c);\\\\n                    d.subTo(m, d);\\\\n                }\\\\n                c.rShiftTo(1, c);\\\\n            }\\\\n            else if (!d.isEven()) d.subTo(m, d);\\\\n            d.rShiftTo(1, d);\\\\n        }\\\\n        if (u.compareTo(v) >= 0) {\\\\n            u.subTo(v, u);\\\\n            if (ac) a.subTo(c, a);\\\\n            b.subTo(d, b);\\\\n        }\\\\n        else {\\\\n            v.subTo(u, v);\\\\n            if (ac) c.subTo(a, c);\\\\n            d.subTo(b, d);\\\\n        }\\\\n    }\\\\n    if (v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\\\\n    if (d.compareTo(m) >= 0) return d.subtract(m);\\\\n    if (d.signum() < 0) d.addTo(m, d);\\\\n    else return d;\\\\n    if (d.signum() < 0) return d.add(m);\\\\n    else return d;\\\\n}\\\\n\\\\nvar lowprimes = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997];\\\\nvar lplim = (1 << 26) / lowprimes[lowprimes.length - 1];\\\\n\\\\n// (public) test primality with certainty >= 1-.5^t\\\\n\\\\nfunction bnIsProbablePrime(t) {\\\\n    var i, x = this.abs();\\\\n    if (x.t == 1 && x[0] <= lowprimes[lowprimes.length - 1]) {\\\\n        for (i = 0; i < lowprimes.length; ++i)\\\\n        if (x[0] == lowprimes[i]) return true;\\\\n        return false;\\\\n    }\\\\n    if (x.isEven()) return false;\\\\n    i = 1;\\\\n    while (i < lowprimes.length) {\\\\n        var m = lowprimes[i],\\\\n            j = i + 1;\\\\n        while (j < lowprimes.length && m < lplim) m *= lowprimes[j++];\\\\n        m = x.modInt(m);\\\\n        while (i < j) if (m % lowprimes[i++] == 0) return false;\\\\n    }\\\\n    return x.millerRabin(t);\\\\n}\\\\n\\\\n// (protected) true if probably prime (HAC 4.24, Miller-Rabin)\\\\n\\\\nfunction bnpMillerRabin(t) {\\\\n    var n1 = this.subtract(BigInteger.ONE);\\\\n    var k = n1.getLowestSetBit();\\\\n    if (k <= 0) return false;\\\\n    var r = n1.shiftRight(k);\\\\n    t = (t + 1) >> 1;\\\\n    if (t > lowprimes.length) t = lowprimes.length;\\\\n    var a = nbi();\\\\n    for (var i = 0; i < t; ++i) {\\\\n        //Pick bases at random, instead of starting at 2\\\\n        a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]);\\\\n        var y = a.modPow(r, this);\\\\n        if (y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\\\\n            var j = 1;\\\\n            while (j++ < k && y.compareTo(n1) != 0) {\\\\n                y = y.modPowInt(2, this);\\\\n                if (y.compareTo(BigInteger.ONE) == 0) return false;\\\\n            }\\\\n            if (y.compareTo(n1) != 0) return false;\\\\n        }\\\\n    }\\\\n    return true;\\\\n}\\\\n\\\\n// protected\\\\nBigInteger.prototype.chunkSize = bnpChunkSize;\\\\nBigInteger.prototype.toRadix = bnpToRadix;\\\\nBigInteger.prototype.fromRadix = bnpFromRadix;\\\\nBigInteger.prototype.fromNumber = bnpFromNumber;\\\\nBigInteger.prototype.bitwiseTo = bnpBitwiseTo;\\\\nBigInteger.prototype.changeBit = bnpChangeBit;\\\\nBigInteger.prototype.addTo = bnpAddTo;\\\\nBigInteger.prototype.dMultiply = bnpDMultiply;\\\\nBigInteger.prototype.dAddOffset = bnpDAddOffset;\\\\nBigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\\\\nBigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\\\\nBigInteger.prototype.modInt = bnpModInt;\\\\nBigInteger.prototype.millerRabin = bnpMillerRabin;\\\\n\\\\n// public\\\\nBigInteger.prototype.clone = bnClone;\\\\nBigInteger.prototype.intValue = bnIntValue;\\\\nBigInteger.prototype.byteValue = bnByteValue;\\\\nBigInteger.prototype.shortValue = bnShortValue;\\\\nBigInteger.prototype.signum = bnSigNum;\\\\nBigInteger.prototype.toByteArray = bnToByteArray;\\\\nBigInteger.prototype.equals = bnEquals;\\\\nBigInteger.prototype.min = bnMin;\\\\nBigInteger.prototype.max = bnMax;\\\\nBigInteger.prototype.and = bnAnd;\\\\nBigInteger.prototype.or = bnOr;\\\\nBigInteger.prototype.xor = bnXor;\\\\nBigInteger.prototype.andNot = bnAndNot;\\\\nBigInteger.prototype.not = bnNot;\\\\nBigInteger.prototype.shiftLeft = bnShiftLeft;\\\\nBigInteger.prototype.shiftRight = bnShiftRight;\\\\nBigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\\\\nBigInteger.prototype.bitCount = bnBitCount;\\\\nBigInteger.prototype.testBit = bnTestBit;\\\\nBigInteger.prototype.setBit = bnSetBit;\\\\nBigInteger.prototype.clearBit = bnClearBit;\\\\nBigInteger.prototype.flipBit = bnFlipBit;\\\\nBigInteger.prototype.add = bnAdd;\\\\nBigInteger.prototype.subtract = bnSubtract;\\\\nBigInteger.prototype.multiply = bnMultiply;\\\\nBigInteger.prototype.divide = bnDivide;\\\\nBigInteger.prototype.remainder = bnRemainder;\\\\nBigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\\\\nBigInteger.prototype.modPow = bnModPow;\\\\nBigInteger.prototype.modInverse = bnModInverse;\\\\nBigInteger.prototype.pow = bnPow;\\\\nBigInteger.prototype.gcd = bnGCD;\\\\nBigInteger.prototype.isProbablePrime = bnIsProbablePrime;\\\\n\\\\n// JSBN-specific extension\\\\nBigInteger.prototype.square = bnSquare;// seedrandom.js version 2.0.\\\\n// Author: David Bau 4/2/2011\\\\n//\\\\n// Defines a method Math.seedrandom() that, when called, substitutes\\\\n// an explicitly seeded RC4-based algorithm for Math.random().  Also\\\\n// supports automatic seeding from local or network sources of entropy.\\\\n//\\\\n// Usage:\\\\n//\\\\n//   <script src=http://davidbau.com/encode/seedrandom-min.js><\\\\/script>\\\\n//\\\\n//   Math.seedrandom(\\\\\'yipee\\\\\'); Sets Math.random to a function that is\\\\n//                             initialized using the given explicit seed.\\\\n//\\\\n//   Math.seedrandom();        Sets Math.random to a function that is\\\\n//                             seeded using the current time, dom state,\\\\n//                             and other accumulated local entropy.\\\\n//                             The generated seed string is returned.\\\\n//\\\\n//   Math.seedrandom(\\\\\'yowza\\\\\', true);\\\\n//                             Seeds using the given explicit seed mixed\\\\n//                             together with accumulated entropy.\\\\n//\\\\n//   <script src=\\"http://bit.ly/srandom-512\\"><\\\\/script>\\\\n//                             Seeds using physical random bits downloaded\\\\n//                             from random.org.\\\\n//\\\\n//   <script src=\\"https://jsonlib.appspot.com/urandom?callback=Math.seedrandom\\">\\\\n//   <\\\\/script>                 Seeds using urandom bits from call.jsonlib.com,\\\\n//                             which is faster than random.org.\\\\n//\\\\n// Examples:\\\\n//\\\\n//   Math.seedrandom(\\"hello\\");            // Use \\"hello\\" as the seed.\\\\n//   document.write(Math.random());       // Always 0.5463663768140734\\\\n//   document.write(Math.random());       // Always 0.43973793770592234\\\\n//   var rng1 = Math.random;              // Remember the current prng.\\\\n//\\\\n//   var autoseed = Math.seedrandom();    // New prng with an automatic seed.\\\\n//   document.write(Math.random());       // Pretty much unpredictable.\\\\n//\\\\n//   Math.random = rng1;                  // Continue \\"hello\\" prng sequence.\\\\n//   document.write(Math.random());       // Always 0.554769432473455\\\\n//\\\\n//   Math.seedrandom(autoseed);           // Restart at the previous seed.\\\\n//   document.write(Math.random());       // Repeat the \\\\\'unpredictable\\\\\' value.\\\\n//\\\\n// Notes:\\\\n//\\\\n// Each time seedrandom(\\\\\'arg\\\\\') is called, entropy from the passed seed\\\\n// is accumulated in a pool to help generate future seeds for the\\\\n// zero-argument form of Math.seedrandom, so entropy can be injected over\\\\n// time by calling seedrandom with explicit data repeatedly.\\\\n//\\\\n// On speed - This javascript implementation of Math.random() is about\\\\n// 3-10x slower than the built-in Math.random() because it is not native\\\\n// code, but this is typically fast enough anyway.  Seeding is more expensive,\\\\n// especially if you use auto-seeding.  Some details (timings on Chrome 4):\\\\n//\\\\n// Our Math.random()            - avg less than 0.002 milliseconds per call\\\\n// seedrandom(\\\\\'explicit\\\\\')       - avg less than 0.5 milliseconds per call\\\\n// seedrandom(\\\\\'explicit\\\\\', true) - avg less than 2 milliseconds per call\\\\n// seedrandom()                 - avg about 38 milliseconds per call\\\\n//\\\\n// LICENSE (BSD):\\\\n//\\\\n// Copyright 2010 David Bau, all rights reserved.\\\\n//\\\\n// Redistribution and use in source and binary forms, with or without\\\\n// modification, are permitted provided that the following conditions are met:\\\\n// \\\\n//   1. Redistributions of source code must retain the above copyright\\\\n//      notice, this list of conditions and the following disclaimer.\\\\n//\\\\n//   2. Redistributions in binary form must reproduce the above copyright\\\\n//      notice, this list of conditions and the following disclaimer in the\\\\n//      documentation and/or other materials provided with the distribution.\\\\n// \\\\n//   3. Neither the name of this module nor the names of its contributors may\\\\n//      be used to endorse or promote products derived from this software\\\\n//      without specific prior written permission.\\\\n// \\\\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\\\\n// \\"AS IS\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\\\\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\\\\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\\\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\\\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\\\\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\\\\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\\\\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\\\\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\\\\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\\\n//\\\\n/**\\\\n * All code is in an anonymous closure to keep the global namespace clean.\\\\n *\\\\n * @param {number=} overflow \\\\n * @param {number=} startdenom\\\\n */\\\\n(function (pool, math, width, chunks, significance, overflow, startdenom)\\\\n{\\\\n\\\\n\\\\n    //\\\\n    // seedrandom()\\\\n    // This is the seedrandom function described above.\\\\n    //\\\\n    math[\\\\\'seedrandom\\\\\'] = function seedrandom(seed, use_entropy)\\\\n    {\\\\n        var key = [];\\\\n        var arc4;\\\\n\\\\n        // Flatten the seed string or build one from local entropy if needed.\\\\n        seed = mixkey(flatten(\\\\n        use_entropy ? [seed, pool] : arguments.length ? seed : [new Date().getTime(), pool], 3), key);\\\\n\\\\n        // Use the seed to initialize an ARC4 generator.\\\\n        arc4 = new ARC4(key);\\\\n\\\\n        // Mix the randomness into accumulated entropy.\\\\n        mixkey(arc4.S, pool);\\\\n\\\\n        // Override Math.random\\\\n        // This function returns a random double in [0, 1) that contains\\\\n        // randomness in every bit of the mantissa of the IEEE 754 value.\\\\n        math[\\\\\'random\\\\\'] = function random()\\\\n        { // Closure to return a random double:\\\\n            var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48\\\\n            var d = startdenom; //   and denominator d = 2 ^ 48.\\\\n            var x = 0; //   and no \\\\\'extra last byte\\\\\'.\\\\n            while (n < significance)\\\\n            { // Fill up all significant digits by\\\\n                n = (n + x) * width; //   shifting numerator and\\\\n                d *= width; //   denominator and generating a\\\\n                x = arc4.g(1); //   new least-significant-byte.\\\\n            }\\\\n            while (n >= overflow)\\\\n            { // To avoid rounding up, before adding\\\\n                n /= 2; //   last byte, shift everything\\\\n                d /= 2; //   right using integer math until\\\\n                x >>>= 1; //   we have exactly the desired bits.\\\\n            }\\\\n            return (n + x) / d; // Form the number within [0, 1).\\\\n        };\\\\n\\\\n        // Return the seed that was used\\\\n        return seed;\\\\n    };\\\\n\\\\n    //\\\\n    // ARC4\\\\n    //\\\\n    // An ARC4 implementation.  The constructor takes a key in the form of\\\\n    // an array of at most (width) integers that should be 0 <= x < (width).\\\\n    //\\\\n    // The g(count) method returns a pseudorandom integer that concatenates\\\\n    // the next (count) outputs from ARC4.  Its return value is a number x\\\\n    // that is in the range 0 <= x < (width ^ count).\\\\n    //\\\\n    /** @constructor */\\\\n\\\\n    function ARC4(key)\\\\n    {\\\\n        var t, u, me = this,\\\\n            keylen = key.length;\\\\n        var i = 0,\\\\n            j = me.i = me.j = me.m = 0;\\\\n        me.S = [];\\\\n        me.c = [];\\\\n\\\\n        // The empty key [] is treated as [0].\\\\n        if (!keylen)\\\\n        {\\\\n            key = [keylen++];\\\\n        }\\\\n\\\\n        // Set up S using the standard key scheduling algorithm.\\\\n        while (i < width)\\\\n        {\\\\n            me.S[i] = i++;\\\\n        }\\\\n        for (i = 0; i < width; i++)\\\\n        {\\\\n            t = me.S[i];\\\\n            j = lowbits(j + t + key[i % keylen]);\\\\n            u = me.S[j];\\\\n            me.S[i] = u;\\\\n            me.S[j] = t;\\\\n        }\\\\n\\\\n        // The \\"g\\" method returns the next (count) outputs as one number.\\\\n        me.g = function getnext(count)\\\\n        {\\\\n            var s = me.S;\\\\n            var i = lowbits(me.i + 1);\\\\n            var t = s[i];\\\\n            var j = lowbits(me.j + t);\\\\n            var u = s[j];\\\\n            s[i] = u;\\\\n            s[j] = t;\\\\n            var r = s[lowbits(t + u)];\\\\n            while (--count)\\\\n            {\\\\n                i = lowbits(i + 1);\\\\n                t = s[i];\\\\n                j = lowbits(j + t);\\\\n                u = s[j];\\\\n                s[i] = u;\\\\n                s[j] = t;\\\\n                r = r * width + s[lowbits(t + u)];\\\\n            }\\\\n            me.i = i;\\\\n            me.j = j;\\\\n            return r;\\\\n        };\\\\n        // For robust unpredictability discard an initial batch of values.\\\\n        // See http://www.rsa.com/rsalabs/node.asp?id=2009\\\\n        me.g(width);\\\\n    }\\\\n\\\\n    //\\\\n    // flatten()\\\\n    // Converts an object tree to nested arrays of strings.\\\\n    //\\\\n    /** @param {Object=} result \\\\n     * @param {string=} prop\\\\n     * @param {string=} typ */\\\\n\\\\n    function flatten(obj, depth, result, prop, typ)\\\\n    {\\\\n        result = [];\\\\n        typ = typeof (obj);\\\\n        if (depth && typ == \\\\\'object\\\\\')\\\\n        {\\\\n            for (prop in obj)\\\\n            {\\\\n                if (prop.indexOf(\\\\\'S\\\\\') < 5)\\\\n                { // Avoid FF3 bug (local/sessionStorage)\\\\n                    try\\\\n                    {\\\\n                        result.push(flatten(obj[prop], depth - 1));\\\\n                    }\\\\n                    catch (e)\\\\n                    {}\\\\n                }\\\\n            }\\\\n        }\\\\n        return (result.length ? result : obj + (typ != \\\\\'string\\\\\' ? \\\\\'\\\\\\\\0\\\\\' : \\\\\'\\\\\'));\\\\n    }\\\\n\\\\n    //\\\\n    // mixkey()\\\\n    // Mixes a string seed into a key that is an array of integers, and\\\\n    // returns a shortened string seed that is equivalent to the result key.\\\\n    //\\\\n    /** @param {number=} smear \\\\n     * @param {number=} j */\\\\n\\\\n    function mixkey(seed, key, smear, j)\\\\n    {\\\\n        seed += \\\\\'\\\\\'; // Ensure the seed is a string\\\\n        smear = 0;\\\\n        for (j = 0; j < seed.length; j++)\\\\n        {\\\\n            key[lowbits(j)] = lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j));\\\\n        }\\\\n        seed = \\\\\'\\\\\';\\\\n        for (j in key)\\\\n        {\\\\n            seed += String.fromCharCode(key[j]);\\\\n        }\\\\n        return seed;\\\\n    }\\\\n\\\\n    //\\\\n    // lowbits()\\\\n    // A quick \\"n mod width\\" for width a power of 2.\\\\n    //\\\\n\\\\n\\\\n    function lowbits(n)\\\\n    {\\\\n        return n & (width - 1);\\\\n    }\\\\n\\\\n    //\\\\n    // The following constants are related to IEEE 754 limits.\\\\n    //\\\\n    startdenom = math.pow(width, chunks);\\\\n    significance = math.pow(2, significance);\\\\n    overflow = significance * 2;\\\\n\\\\n    //\\\\n    // When seedrandom.js is loaded, we immediately mix a few bits\\\\n    // from the built-in RNG into the entropy pool.  Because we do\\\\n    // not want to intefere with determinstic PRNG state later,\\\\n    // seedrandom will not call math.random on its own again after\\\\n    // initialization.\\\\n    //\\\\n    mixkey(math.random(), pool);\\\\n\\\\n    // End anonymous scope, and pass initial values.\\\\n})([], // pool: entropy pool starts empty\\\\nMath, // math: package containing random, pow, and seedrandom\\\\n256, // width: each RC4 output is 0 <= x < 256\\\\n6, // chunks: at least six RC4 outputs for each double\\\\n52 // significance: there are 52 significant digits in a double\\\\n);\\\\n\\\\n\\\\n// This is not really a random number generator object, and two SeededRandom\\\\n// objects will conflict with one another, but it\\\\\'s good enough for generating \\\\n// the rsa key.\\\\nfunction SeededRandom(){}\\\\n\\\\nfunction SRnextBytes(ba)\\\\n{\\\\n    var i;\\\\n    for(i = 0; i < ba.length; i++)\\\\n    {\\\\n        ba[i] = Math.floor(Math.random() * 256);\\\\n    }\\\\n}\\\\n\\\\nSeededRandom.prototype.nextBytes = SRnextBytes;\\\\n\\\\n// prng4.js - uses Arcfour as a PRNG\\\\n\\\\nfunction Arcfour() {\\\\n  this.i = 0;\\\\n  this.j = 0;\\\\n  this.S = new Array();\\\\n}\\\\n\\\\n// Initialize arcfour context from key, an array of ints, each from [0..255]\\\\nfunction ARC4init(key) {\\\\n  var i, j, t;\\\\n  for(i = 0; i < 256; ++i)\\\\n    this.S[i] = i;\\\\n  j = 0;\\\\n  for(i = 0; i < 256; ++i) {\\\\n    j = (j + this.S[i] + key[i % key.length]) & 255;\\\\n    t = this.S[i];\\\\n    this.S[i] = this.S[j];\\\\n    this.S[j] = t;\\\\n  }\\\\n  this.i = 0;\\\\n  this.j = 0;\\\\n}\\\\n\\\\nfunction ARC4next() {\\\\n  var t;\\\\n  this.i = (this.i + 1) & 255;\\\\n  this.j = (this.j + this.S[this.i]) & 255;\\\\n  t = this.S[this.i];\\\\n  this.S[this.i] = this.S[this.j];\\\\n  this.S[this.j] = t;\\\\n  return this.S[(t + this.S[this.i]) & 255];\\\\n}\\\\n\\\\nArcfour.prototype.init = ARC4init;\\\\nArcfour.prototype.next = ARC4next;\\\\n\\\\n// Plug in your RNG constructor here\\\\nfunction prng_newstate() {\\\\n  return new Arcfour();\\\\n}\\\\n\\\\n// Pool size must be a multiple of 4 and greater than 32.\\\\n// An array of bytes the size of the pool will be passed to init()\\\\nvar rng_psize = 256;\\\\n\\\\n// Random number generator - requires a PRNG backend, e.g. prng4.js\\\\n\\\\n// For best results, put code like\\\\n// <body onClick=\\\\\'rng_seed_time();\\\\\' onKeyPress=\\\\\'rng_seed_time();\\\\\'>\\\\n// in your main HTML document.\\\\n\\\\nvar rng_state;\\\\nvar rng_pool;\\\\nvar rng_pptr;\\\\n\\\\n// Mix in a 32-bit integer into the pool\\\\nfunction rng_seed_int(x) {\\\\n  rng_pool[rng_pptr++] ^= x & 255;\\\\n  rng_pool[rng_pptr++] ^= (x >> 8) & 255;\\\\n  rng_pool[rng_pptr++] ^= (x >> 16) & 255;\\\\n  rng_pool[rng_pptr++] ^= (x >> 24) & 255;\\\\n  if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\\\\n}\\\\n\\\\n// Mix in the current time (w/milliseconds) into the pool\\\\nfunction rng_seed_time() {\\\\n  rng_seed_int(new Date().getTime());\\\\n}\\\\n\\\\n// Initialize the pool with junk if needed.\\\\nif(rng_pool == null) {\\\\n  rng_pool = new Array();\\\\n  rng_pptr = 0;\\\\n  var t;\\\\n  while(rng_pptr < rng_psize) {  // extract some randomness from Math.random()\\\\n    t = Math.floor(65536 * Math.random());\\\\n    rng_pool[rng_pptr++] = t >>> 8;\\\\n    rng_pool[rng_pptr++] = t & 255;\\\\n  }\\\\n  rng_pptr = 0;\\\\n  rng_seed_time();\\\\n  //rng_seed_int(window.screenX);\\\\n  //rng_seed_int(window.screenY);\\\\n}\\\\n\\\\nfunction rng_get_byte() {\\\\n  if(rng_state == null) {\\\\n    rng_seed_time();\\\\n    rng_state = prng_newstate();\\\\n    rng_state.init(rng_pool);\\\\n    for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\\\\n      rng_pool[rng_pptr] = 0;\\\\n    rng_pptr = 0;\\\\n    //rng_pool = null;\\\\n  }\\\\n  // TODO: allow reseeding after first request\\\\n  return rng_state.next();\\\\n}\\\\n\\\\nfunction rng_get_bytes(ba) {\\\\n  var i;\\\\n  for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\\\\n}\\\\n\\\\nfunction SecureRandom() {}\\\\n\\\\nSecureRandom.prototype.nextBytes = rng_get_bytes;/**\\\\n*\\\\n*  Secure Hash Algorithm (SHA256)\\\\n*  http://www.webtoolkit.info/\\\\n*\\\\n*  Original code by Angel Marin, Paul Johnston.\\\\n*\\\\n**/\\\\n\\\\nvar crypto = __webpack_require__(40);\\\\n \\\\nfunction SHA256(s){\\\\n\\\\treturn crypto.createHash(\\\\\'sha256\\\\\').update(s, \\\\\'utf8\\\\\').digest(\\\\\'hex\\\\\');\\\\n}\\\\n\\\\nvar sha256 = {}\\\\nsha256.hex = function(s)\\\\n{\\\\n    return SHA256(s);\\\\n}\\\\n\\\\n/**\\\\n*\\\\n*  Secure Hash Algorithm (SHA1)\\\\n*  http://www.webtoolkit.info/\\\\n*\\\\n**/\\\\n \\\\nfunction SHA1 (msg) {\\\\n\\\\treturn crypto.createHash(\\\\\'sha1\\\\\').update(msg, \\\\\'utf8\\\\\').digest(\\\\\'hex\\\\\'); \\\\n}\\\\n\\\\nvar sha1 = {}\\\\nsha1.hex = function(s)\\\\n{\\\\n    return SHA1(s);\\\\n}\\\\n\\\\n/**\\\\n*\\\\n*  MD5 (Message-Digest Algorithm)\\\\n*  http://www.webtoolkit.info/\\\\n*\\\\n**/\\\\n \\\\nvar MD5 = function (string) {\\\\n\\\\treturn crypto.createHash(\\\\\'md5\\\\\').update(string, \\\\\'utf8\\\\\').digest(\\\\\'hex\\\\\');\\\\n}// Depends on jsbn.js and rng.js\\\\n// Version 1.1: support utf-8 encoding in pkcs1pad2\\\\n// convert a (hex) string to a bignum object\\\\n\\\\n\\\\nfunction parseBigInt(str, r)\\\\n{\\\\n    return new BigInteger(str, r);\\\\n}\\\\n\\\\nfunction linebrk(s, n)\\\\n{\\\\n    var ret = \\"\\";\\\\n    var i = 0;\\\\n    while (i + n < s.length)\\\\n    {\\\\n        ret += s.substring(i, i + n) + \\"\\\\\\\\n\\";\\\\n        i += n;\\\\n    }\\\\n    return ret + s.substring(i, s.length);\\\\n}\\\\n\\\\nfunction byte2Hex(b)\\\\n{\\\\n    if (b < 0x10) return \\"0\\" + b.toString(16);\\\\n    else return b.toString(16);\\\\n}\\\\n\\\\n// PKCS#1 (type 2, random) pad input string s to n bytes, and return a bigint\\\\n\\\\n\\\\nfunction pkcs1pad2(s, n)\\\\n{\\\\n    if (n < s.length + 11)\\\\n    { // TODO: fix for utf-8\\\\n        //alert(\\"Message too long for RSA (n=\\" + n + \\", l=\\" + s.length + \\")\\");\\\\n        //return null;\\\\n        throw \\"Message too long for RSA (n=\\" + n + \\", l=\\" + s.length + \\")\\";\\\\n    }\\\\n    var ba = new Array();\\\\n    var i = s.length - 1;\\\\n    while (i >= 0 && n > 0)\\\\n    {\\\\n        var c = s.charCodeAt(i--);\\\\n        if (c < 128)\\\\n        { // encode using utf-8\\\\n            ba[--n] = c;\\\\n        }\\\\n        else if ((c > 127) && (c < 2048))\\\\n        {\\\\n            ba[--n] = (c & 63) | 128;\\\\n            ba[--n] = (c >> 6) | 192;\\\\n        }\\\\n        else\\\\n        {\\\\n            ba[--n] = (c & 63) | 128;\\\\n            ba[--n] = ((c >> 6) & 63) | 128;\\\\n            ba[--n] = (c >> 12) | 224;\\\\n        }\\\\n    }\\\\n    ba[--n] = 0;\\\\n    var rng = new SecureRandom();\\\\n    var x = new Array();\\\\n    while (n > 2)\\\\n    { // random non-zero pad\\\\n        x[0] = 0;\\\\n        while (x[0] == 0) rng.nextBytes(x);\\\\n        ba[--n] = x[0];\\\\n    }\\\\n    ba[--n] = 2;\\\\n    ba[--n] = 0;\\\\n    return new BigInteger(ba);\\\\n}\\\\n\\\\n// \\"empty\\" RSA key constructor\\\\n\\\\n\\\\nfunction RSAKey()\\\\n{\\\\n    this.n = null;\\\\n    this.e = 0;\\\\n    this.d = null;\\\\n    this.p = null;\\\\n    this.q = null;\\\\n    this.dmp1 = null;\\\\n    this.dmq1 = null;\\\\n    this.coeff = null;\\\\n}\\\\n// Set the public key fields N and e from hex strings\\\\n\\\\n\\\\nfunction RSASetPublic(N, E)\\\\n{\\\\n    if (N != null && E != null && N.length > 0 && E.length > 0)\\\\n    {\\\\n        this.n = parseBigInt(N, 16);\\\\n        this.e = parseInt(E, 16);\\\\n    }\\\\n    else alert(\\"Invalid RSA public key\\");\\\\n}\\\\n\\\\n// Perform raw public operation on \\"x\\": return x^e (mod n)\\\\n\\\\n\\\\nfunction RSADoPublic(x)\\\\n{\\\\n    return x.modPowInt(this.e, this.n);\\\\n}\\\\n\\\\n// Return the PKCS#1 RSA encryption of \\"text\\" as an even-length hex string\\\\n\\\\n\\\\nfunction RSAEncrypt(text)\\\\n{\\\\n    var m = pkcs1pad2(text, (this.n.bitLength() + 7) >> 3);\\\\n    if (m == null) return null;\\\\n    var c = this.doPublic(m);\\\\n    if (c == null) return null;\\\\n    var h = c.toString(16);\\\\n    if ((h.length & 1) == 0) return h;\\\\n    else return \\"0\\" + h;\\\\n}\\\\n\\\\nfunction RSAToJSON()\\\\n{\\\\n    return {\\\\n        coeff: this.coeff.toString(16),\\\\n        d: this.d.toString(16),\\\\n        dmp1: this.dmp1.toString(16),\\\\n        dmq1: this.dmq1.toString(16),\\\\n        e: this.e.toString(16),\\\\n        n: this.n.toString(16),\\\\n        p: this.p.toString(16),\\\\n        q: this.q.toString(16),\\\\n    }\\\\n}\\\\n\\\\nfunction RSAParse(rsaString) {\\\\n    var json = JSON.parse(rsaString);\\\\n    var rsa = new RSAKey();\\\\n\\\\n    rsa.setPrivateEx(json.n, json.e, json.d, json.p, json.q, json.dmp1, json.dmq1, json.coeff);\\\\n\\\\n    return rsa;\\\\n}\\\\n\\\\n// Return the PKCS#1 RSA encryption of \\"text\\" as a Base64-encoded string\\\\n//function RSAEncryptB64(text) {\\\\n//  var h = this.encrypt(text);\\\\n//  if(h) return hex2b64(h); else return null;\\\\n//}\\\\n// protected\\\\nRSAKey.prototype.doPublic = RSADoPublic;\\\\n\\\\n// public\\\\nRSAKey.prototype.parseInt = parseBigInt;\\\\nRSAKey.prototype.setPublic = RSASetPublic;\\\\nRSAKey.prototype.encrypt = RSAEncrypt;\\\\nRSAKey.prototype.toJSON = RSAToJSON;\\\\nRSAKey.parse = RSAParse;\\\\n\\\\n// Version 1.1: support utf-8 decoding in pkcs1unpad2\\\\n// Undo PKCS#1 (type 2, random) padding and, if valid, return the plaintext\\\\n\\\\nfunction pkcs1unpad2(d, n)\\\\n{\\\\n    var b = d.toByteArray();\\\\n    var i = 0;\\\\n    while (i < b.length && b[i] == 0)++i;\\\\n    if (b.length - i != n - 1 || b[i] != 2) return null;\\\\n    ++i;\\\\n    while (b[i] != 0)\\\\n    if (++i >= b.length) return null;\\\\n    var ret = \\"\\";\\\\n    while (++i < b.length)\\\\n    {\\\\n        var c = b[i] & 255;\\\\n        if (c < 128)\\\\n        { // utf-8 decode\\\\n            ret += String.fromCharCode(c);\\\\n        }\\\\n        else if ((c > 191) && (c < 224))\\\\n        {\\\\n            ret += String.fromCharCode(((c & 31) << 6) | (b[i + 1] & 63));\\\\n            ++i;\\\\n        }\\\\n        else\\\\n        {\\\\n            ret += String.fromCharCode(((c & 15) << 12) | ((b[i + 1] & 63) << 6) | (b[i + 2] & 63));\\\\n            i += 2;\\\\n        }\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\n// Set the private key fields N, e, and d from hex strings\\\\nfunction RSASetPrivate(N, E, D)\\\\n{\\\\n    if (N != null && E != null && N.length > 0 && E.length > 0)\\\\n    {\\\\n        this.n = parseBigInt(N, 16);\\\\n        this.e = parseInt(E, 16);\\\\n        this.d = parseBigInt(D, 16);\\\\n    }\\\\n    else alert(\\"Invalid RSA private key\\");\\\\n}\\\\n\\\\n// Set the private key fields N, e, d and CRT params from hex strings\\\\nfunction RSASetPrivateEx(N, E, D, P, Q, DP, DQ, C)\\\\n{\\\\n    if (N != null && E != null && N.length > 0 && E.length > 0)\\\\n    {\\\\n        this.n = parseBigInt(N, 16);\\\\n        this.e = parseInt(E, 16);\\\\n        this.d = parseBigInt(D, 16);\\\\n        this.p = parseBigInt(P, 16);\\\\n        this.q = parseBigInt(Q, 16);\\\\n        this.dmp1 = parseBigInt(DP, 16);\\\\n        this.dmq1 = parseBigInt(DQ, 16);\\\\n        this.coeff = parseBigInt(C, 16);\\\\n    }\\\\n    else alert(\\"Invalid RSA private key\\");\\\\n}\\\\n\\\\n// Generate a new random private key B bits long, using public expt E\\\\nfunction RSAGenerate(B, E)\\\\n{\\\\n    var rng = new SeededRandom();\\\\n    var qs = B >> 1;\\\\n    this.e = parseInt(E, 16);\\\\n    var ee = new BigInteger(E, 16);\\\\n    for (;;)\\\\n    {\\\\n        for (;;)\\\\n        {\\\\n            this.p = new BigInteger(B - qs, 1, rng);\\\\n            if (this.p.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.p.isProbablePrime(10)) break;\\\\n        }\\\\n        for (;;)\\\\n        {\\\\n            this.q = new BigInteger(qs, 1, rng);\\\\n            if (this.q.subtract(BigInteger.ONE).gcd(ee).compareTo(BigInteger.ONE) == 0 && this.q.isProbablePrime(10)) break;\\\\n        }\\\\n        if (this.p.compareTo(this.q) <= 0)\\\\n        {\\\\n            var t = this.p;\\\\n            this.p = this.q;\\\\n            this.q = t;\\\\n        }\\\\n        var p1 = this.p.subtract(BigInteger.ONE);\\\\n        var q1 = this.q.subtract(BigInteger.ONE);\\\\n        var phi = p1.multiply(q1);\\\\n        if (phi.gcd(ee).compareTo(BigInteger.ONE) == 0)\\\\n        {\\\\n            this.n = this.p.multiply(this.q);\\\\n            this.d = ee.modInverse(phi);\\\\n            this.dmp1 = this.d.mod(p1);\\\\n            this.dmq1 = this.d.mod(q1);\\\\n            this.coeff = this.q.modInverse(this.p);\\\\n            break;\\\\n        }\\\\n    }\\\\n}\\\\n\\\\n// Perform raw private operation on \\"x\\": return x^d (mod n)\\\\nfunction RSADoPrivate(x)\\\\n{\\\\n    if (this.p == null || this.q == null) return x.modPow(this.d, this.n);\\\\n    // TODO: re-calculate any missing CRT params\\\\n    var xp = x.mod(this.p).modPow(this.dmp1, this.p);\\\\n    var xq = x.mod(this.q).modPow(this.dmq1, this.q);\\\\n    while (xp.compareTo(xq) < 0)\\\\n    xp = xp.add(this.p);\\\\n    return xp.subtract(xq).multiply(this.coeff).mod(this.p).multiply(this.q).add(xq);\\\\n}\\\\n\\\\n// Return the PKCS#1 RSA decryption of \\"ctext\\".\\\\n// \\"ctext\\" is an even-length hex string and the output is a plain string.\\\\nfunction RSADecrypt(ctext)\\\\n{\\\\n    var c = parseBigInt(ctext, 16);\\\\n    var m = this.doPrivate(c);\\\\n    if (m == null) return null;\\\\n    return pkcs1unpad2(m, (this.n.bitLength() + 7) >> 3);\\\\n}\\\\n\\\\n// protected\\\\nRSAKey.prototype.doPrivate = RSADoPrivate;\\\\n\\\\n// public\\\\nRSAKey.prototype.setPrivate = RSASetPrivate;\\\\nRSAKey.prototype.setPrivateEx = RSASetPrivateEx;\\\\nRSAKey.prototype.generate = RSAGenerate;\\\\nRSAKey.prototype.decrypt = RSADecrypt;\\\\n\\\\n\\\\n//\\\\n// rsa-sign.js - adding signing functions to RSAKey class.\\\\n//\\\\n//\\\\n// version: 1.0 (2010-Jun-03)\\\\n//\\\\n// Copyright (c) 2010 Kenji Urushima (kenji.urushima@gmail.com)\\\\n//\\\\n// This software is licensed under the terms of the MIT License.\\\\n// http://www.opensource.org/licenses/mit-license.php\\\\n//\\\\n// The above copyright and license notice shall be \\\\n// included in all copies or substantial portions of the Software.\\\\n//\\\\n// Depends on:\\\\n//   function sha1.hex(s) of sha1.js\\\\n//   jsbn.js\\\\n//   jsbn2.js\\\\n//   rsa.js\\\\n//   rsa2.js\\\\n//\\\\n// keysize / pmstrlen\\\\n//  512 /  128\\\\n// 1024 /  256\\\\n// 2048 /  512\\\\n// 4096 / 1024\\\\n// As for _RSASGIN_DIHEAD values for each hash algorithm, see PKCS#1 v2.1 spec (p38).\\\\nvar _RSASIGN_DIHEAD = [];\\\\n_RSASIGN_DIHEAD[\\\\\'sha1\\\\\'] = \\"3021300906052b0e03021a05000414\\";\\\\n_RSASIGN_DIHEAD[\\\\\'sha256\\\\\'] = \\"3031300d060960864801650304020105000420\\";\\\\n//_RSASIGN_DIHEAD[\\\\\'md2\\\\\'] = \\"3020300c06082a864886f70d020205000410\\";\\\\n//_RSASIGN_DIHEAD[\\\\\'md5\\\\\'] = \\"3020300c06082a864886f70d020505000410\\";\\\\n//_RSASIGN_DIHEAD[\\\\\'sha384\\\\\'] = \\"3041300d060960864801650304020205000430\\";\\\\n//_RSASIGN_DIHEAD[\\\\\'sha512\\\\\'] = \\"3051300d060960864801650304020305000440\\";\\\\nvar _RSASIGN_HASHHEXFUNC = [];\\\\n_RSASIGN_HASHHEXFUNC[\\\\\'sha1\\\\\'] = sha1.hex;\\\\n_RSASIGN_HASHHEXFUNC[\\\\\'sha256\\\\\'] = sha256.hex;\\\\n\\\\n// ========================================================================\\\\n// Signature Generation\\\\n// ========================================================================\\\\n\\\\nfunction _rsasign_getHexPaddedDigestInfoForString(s, keySize, hashAlg)\\\\n{\\\\n    var pmStrLen = keySize / 4;\\\\n    var hashFunc = _RSASIGN_HASHHEXFUNC[hashAlg];\\\\n    var sHashHex = hashFunc(s);\\\\n\\\\n    var sHead = \\"0001\\";\\\\n    var sTail = \\"00\\" + _RSASIGN_DIHEAD[hashAlg] + sHashHex;\\\\n    var sMid = \\"\\";\\\\n    var fLen = pmStrLen - sHead.length - sTail.length;\\\\n    for (var i = 0; i < fLen; i += 2)\\\\n    {\\\\n        sMid += \\"ff\\";\\\\n    }\\\\n    sPaddedMessageHex = sHead + sMid + sTail;\\\\n    return sPaddedMessageHex;\\\\n}\\\\n\\\\nfunction _rsasign_signString(s, hashAlg)\\\\n{\\\\n    var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), hashAlg);\\\\n    var biPaddedMessage = parseBigInt(hPM, 16);\\\\n    var biSign = this.doPrivate(biPaddedMessage);\\\\n    var hexSign = biSign.toString(16);\\\\n    return hexSign;\\\\n}\\\\n\\\\nfunction _rsasign_signStringWithSHA1(s)\\\\n{\\\\n    var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), \\\\\'sha1\\\\\');\\\\n    var biPaddedMessage = parseBigInt(hPM, 16);\\\\n    var biSign = this.doPrivate(biPaddedMessage);\\\\n    var hexSign = biSign.toString(16);\\\\n    return hexSign;\\\\n}\\\\n\\\\nfunction _rsasign_signStringWithSHA256(s)\\\\n{\\\\n    var hPM = _rsasign_getHexPaddedDigestInfoForString(s, this.n.bitLength(), \\\\\'sha256\\\\\');\\\\n    var biPaddedMessage = parseBigInt(hPM, 16);\\\\n    var biSign = this.doPrivate(biPaddedMessage);\\\\n    var hexSign = biSign.toString(16);\\\\n    return hexSign;\\\\n}\\\\n\\\\n// ========================================================================\\\\n// Signature Verification\\\\n// ========================================================================\\\\n\\\\nfunction _rsasign_getDecryptSignatureBI(biSig, hN, hE)\\\\n{\\\\n    var rsa = new RSAKey();\\\\n    rsa.setPublic(hN, hE);\\\\n    var biDecryptedSig = rsa.doPublic(biSig);\\\\n    return biDecryptedSig;\\\\n}\\\\n\\\\nfunction _rsasign_getHexDigestInfoFromSig(biSig, hN, hE)\\\\n{\\\\n    var biDecryptedSig = _rsasign_getDecryptSignatureBI(biSig, hN, hE);\\\\n    var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, \\\\\'\\\\\');\\\\n    return hDigestInfo;\\\\n}\\\\n\\\\nfunction _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo)\\\\n{\\\\n    for (var algName in _RSASIGN_DIHEAD)\\\\n    {\\\\n        var head = _RSASIGN_DIHEAD[algName];\\\\n        var len = head.length;\\\\n        if (hDigestInfo.substring(0, len) == head)\\\\n        {\\\\n            var a = [algName, hDigestInfo.substring(len)];\\\\n            return a;\\\\n        }\\\\n    }\\\\n    return [];\\\\n}\\\\n\\\\nfunction _rsasign_verifySignatureWithArgs(sMsg, biSig, hN, hE)\\\\n{\\\\n    var hDigestInfo = _rsasign_getHexDigestInfoFromSig(biSig, hN, hE);\\\\n    var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo);\\\\n    if (digestInfoAry.length == 0) return false;\\\\n    var algName = digestInfoAry[0];\\\\n    var diHashValue = digestInfoAry[1];\\\\n    var ff = _RSASIGN_HASHHEXFUNC[algName];\\\\n    var msgHashValue = ff(sMsg);\\\\n    return (diHashValue == msgHashValue);\\\\n}\\\\n\\\\nfunction _rsasign_verifyHexSignatureForMessage(hSig, sMsg)\\\\n{\\\\n    var biSig = parseBigInt(hSig, 16);\\\\n    var result = _rsasign_verifySignatureWithArgs(sMsg, biSig, this.n.toString(16), this.e.toString(16));\\\\n    return result;\\\\n}\\\\n\\\\nfunction _rsasign_verifyString(sMsg, hSig)\\\\n{\\\\n    hSig = hSig.replace(/[ \\\\\\\\n]+/g, \\"\\");\\\\n    var biSig = parseBigInt(hSig, 16);\\\\n    var biDecryptedSig = this.doPublic(biSig);\\\\n    var hDigestInfo = biDecryptedSig.toString(16).replace(/^1f+00/, \\\\\'\\\\\');\\\\n    var digestInfoAry = _rsasign_getAlgNameAndHashFromHexDisgestInfo(hDigestInfo);\\\\n\\\\n    if (digestInfoAry.length == 0) return false;\\\\n    var algName = digestInfoAry[0];\\\\n    var diHashValue = digestInfoAry[1];\\\\n    var ff = _RSASIGN_HASHHEXFUNC[algName];\\\\n    var msgHashValue = ff(sMsg);\\\\n    return (diHashValue == msgHashValue);\\\\n}\\\\n\\\\nRSAKey.prototype.signString = _rsasign_signString;\\\\nRSAKey.prototype.signStringWithSHA1 = _rsasign_signStringWithSHA1;\\\\nRSAKey.prototype.signStringWithSHA256 = _rsasign_signStringWithSHA256;\\\\n\\\\nRSAKey.prototype.verifyString = _rsasign_verifyString;\\\\nRSAKey.prototype.verifyHexSignatureForMessage = _rsasign_verifyHexSignatureForMessage;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n/*\\\\n *  jsaes version 0.1  -  Copyright 2006 B. Poettering\\\\n *\\\\n *  This program is free software; you can redistribute it and/or\\\\n *  modify it under the terms of the GNU General Public License as\\\\n *  published by the Free Software Foundation; either version 2 of the\\\\n *  License, or (at your option) any later version.\\\\n *\\\\n *  This program is distributed in the hope that it will be useful,\\\\n *  but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\\\\n *  General Public License for more details.\\\\n *\\\\n *  You should have received a copy of the GNU General Public License\\\\n *  along with this program; if not, write to the Free Software\\\\n *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA\\\\n *  02111-1307 USA\\\\n */\\\\n \\\\n // later modifications by wwwtyro@github\\\\n \\\\nvar aes = (function () {\\\\n\\\\n    var my = {};\\\\n\\\\n    my.Sbox = new Array(99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22);\\\\n\\\\n    my.ShiftRowTab = new Array(0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11);\\\\n\\\\n    my.Init = function () {\\\\n        my.Sbox_Inv = new Array(256);\\\\n        for (var i = 0; i < 256; i++)\\\\n        my.Sbox_Inv[my.Sbox[i]] = i;\\\\n\\\\n        my.ShiftRowTab_Inv = new Array(16);\\\\n        for (var i = 0; i < 16; i++)\\\\n        my.ShiftRowTab_Inv[my.ShiftRowTab[i]] = i;\\\\n\\\\n        my.xtime = new Array(256);\\\\n        for (var i = 0; i < 128; i++) {\\\\n            my.xtime[i] = i << 1;\\\\n            my.xtime[128 + i] = (i << 1) ^ 0x1b;\\\\n        }\\\\n    }\\\\n\\\\n    my.Done = function () {\\\\n        delete my.Sbox_Inv;\\\\n        delete my.ShiftRowTab_Inv;\\\\n        delete my.xtime;\\\\n    }\\\\n\\\\n    my.ExpandKey = function (key) {\\\\n        var kl = key.length,\\\\n            ks, Rcon = 1;\\\\n        switch (kl) {\\\\n        case 16:\\\\n            ks = 16 * (10 + 1);\\\\n            break;\\\\n        case 24:\\\\n            ks = 16 * (12 + 1);\\\\n            break;\\\\n        case 32:\\\\n            ks = 16 * (14 + 1);\\\\n            break;\\\\n        default:\\\\n            alert(\\"my.ExpandKey: Only key lengths of 16, 24 or 32 bytes allowed!\\");\\\\n        }\\\\n        for (var i = kl; i < ks; i += 4) {\\\\n            var temp = key.slice(i - 4, i);\\\\n            if (i % kl == 0) {\\\\n                temp = new Array(my.Sbox[temp[1]] ^ Rcon, my.Sbox[temp[2]], my.Sbox[temp[3]], my.Sbox[temp[0]]);\\\\n                if ((Rcon <<= 1) >= 256) Rcon ^= 0x11b;\\\\n            }\\\\n            else if ((kl > 24) && (i % kl == 16)) temp = new Array(my.Sbox[temp[0]], my.Sbox[temp[1]], my.Sbox[temp[2]], my.Sbox[temp[3]]);\\\\n            for (var j = 0; j < 4; j++)\\\\n            key[i + j] = key[i + j - kl] ^ temp[j];\\\\n        }\\\\n    }\\\\n\\\\n    my.Encrypt = function (block, key) {\\\\n        var l = key.length;\\\\n        my.AddRoundKey(block, key.slice(0, 16));\\\\n        for (var i = 16; i < l - 16; i += 16) {\\\\n            my.SubBytes(block, my.Sbox);\\\\n            my.ShiftRows(block, my.ShiftRowTab);\\\\n            my.MixColumns(block);\\\\n            my.AddRoundKey(block, key.slice(i, i + 16));\\\\n        }\\\\n        my.SubBytes(block, my.Sbox);\\\\n        my.ShiftRows(block, my.ShiftRowTab);\\\\n        my.AddRoundKey(block, key.slice(i, l));\\\\n    }\\\\n\\\\n    my.Decrypt = function (block, key) {\\\\n        var l = key.length;\\\\n        my.AddRoundKey(block, key.slice(l - 16, l));\\\\n        my.ShiftRows(block, my.ShiftRowTab_Inv);\\\\n        my.SubBytes(block, my.Sbox_Inv);\\\\n        for (var i = l - 32; i >= 16; i -= 16) {\\\\n            my.AddRoundKey(block, key.slice(i, i + 16));\\\\n            my.MixColumns_Inv(block);\\\\n            my.ShiftRows(block, my.ShiftRowTab_Inv);\\\\n            my.SubBytes(block, my.Sbox_Inv);\\\\n        }\\\\n        my.AddRoundKey(block, key.slice(0, 16));\\\\n    }\\\\n\\\\n    my.SubBytes = function (state, sbox) {\\\\n        for (var i = 0; i < 16; i++)\\\\n        state[i] = sbox[state[i]];\\\\n    }\\\\n\\\\n    my.AddRoundKey = function (state, rkey) {\\\\n        for (var i = 0; i < 16; i++)\\\\n        state[i] ^= rkey[i];\\\\n    }\\\\n\\\\n    my.ShiftRows = function (state, shifttab) {\\\\n        var h = new Array().concat(state);\\\\n        for (var i = 0; i < 16; i++)\\\\n        state[i] = h[shifttab[i]];\\\\n    }\\\\n\\\\n    my.MixColumns = function (state) {\\\\n        for (var i = 0; i < 16; i += 4) {\\\\n            var s0 = state[i + 0],\\\\n                s1 = state[i + 1];\\\\n            var s2 = state[i + 2],\\\\n                s3 = state[i + 3];\\\\n            var h = s0 ^ s1 ^ s2 ^ s3;\\\\n            state[i + 0] ^= h ^ my.xtime[s0 ^ s1];\\\\n            state[i + 1] ^= h ^ my.xtime[s1 ^ s2];\\\\n            state[i + 2] ^= h ^ my.xtime[s2 ^ s3];\\\\n            state[i + 3] ^= h ^ my.xtime[s3 ^ s0];\\\\n        }\\\\n    }\\\\n\\\\n    my.MixColumns_Inv = function (state) {\\\\n        for (var i = 0; i < 16; i += 4) {\\\\n            var s0 = state[i + 0],\\\\n                s1 = state[i + 1];\\\\n            var s2 = state[i + 2],\\\\n                s3 = state[i + 3];\\\\n            var h = s0 ^ s1 ^ s2 ^ s3;\\\\n            var xh = my.xtime[h];\\\\n            var h1 = my.xtime[my.xtime[xh ^ s0 ^ s2]] ^ h;\\\\n            var h2 = my.xtime[my.xtime[xh ^ s1 ^ s3]] ^ h;\\\\n            state[i + 0] ^= h1 ^ my.xtime[s0 ^ s1];\\\\n            state[i + 1] ^= h2 ^ my.xtime[s1 ^ s2];\\\\n            state[i + 2] ^= h1 ^ my.xtime[s2 ^ s3];\\\\n            state[i + 3] ^= h2 ^ my.xtime[s3 ^ s0];\\\\n        }\\\\n    }\\\\n\\\\n    return my;\\\\n\\\\n}());var cryptico = module.exports = (function() {\\\\n\\\\n    var my = {};\\\\n\\\\n    aes.Init();\\\\n\\\\n    var base64Chars = \\\\\'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\\\\\';\\\\n\\\\n    my.b256to64 = function(t) {\\\\n        var a, c, n;\\\\n        var r = \\\\\'\\\\\', l = 0, s = 0;\\\\n        var tl = t.length;\\\\n        for (n = 0; n < tl; n++)\\\\n        {\\\\n            c = t.charCodeAt(n);\\\\n            if (s == 0)\\\\n            {\\\\n                r += base64Chars.charAt((c >> 2) & 63);\\\\n                a = (c & 3) << 4;\\\\n            }\\\\n            else if (s == 1)\\\\n            {\\\\n                r += base64Chars.charAt((a | (c >> 4) & 15));\\\\n                a = (c & 15) << 2;\\\\n            }\\\\n            else if (s == 2)\\\\n            {\\\\n                r += base64Chars.charAt(a | ((c >> 6) & 3));\\\\n                l += 1;\\\\n                r += base64Chars.charAt(c & 63);\\\\n            }\\\\n            l += 1;\\\\n            s += 1;\\\\n            if (s == 3) s = 0;\\\\n        }\\\\n        if (s > 0)\\\\n        {\\\\n            r += base64Chars.charAt(a);\\\\n            l += 1;\\\\n            r += \\\\\'=\\\\\';\\\\n            l += 1;\\\\n        }\\\\n        if (s == 1)\\\\n        {\\\\n            r += \\\\\'=\\\\\';\\\\n        }\\\\n        return r;\\\\n    }\\\\n\\\\n    my.b64to256 = function(t) \\\\n    {\\\\n        var c, n;\\\\n        var r = \\\\\'\\\\\', s = 0, a = 0;\\\\n        var tl = t.length;\\\\n        for (n = 0; n < tl; n++)\\\\n        {\\\\n            c = base64Chars.indexOf(t.charAt(n));\\\\n            if (c >= 0)\\\\n            {\\\\n                if (s) r += String.fromCharCode(a | (c >> (6 - s)) & 255);\\\\n                s = (s + 2) & 7;\\\\n                a = (c << s) & 255;\\\\n            }\\\\n        }\\\\n        return r;\\\\n    }    \\\\n\\\\n    my.b16to64 = function(h) {\\\\n        var i;\\\\n        var c;\\\\n        var ret = \\"\\";\\\\n        if(h.length % 2 == 1)\\\\n        {\\\\n            h = \\"0\\" + h;\\\\n        }\\\\n        for (i = 0; i + 3 <= h.length; i += 3)\\\\n        {\\\\n            c = parseInt(h.substring(i, i + 3), 16);\\\\n            ret += base64Chars.charAt(c >> 6) + base64Chars.charAt(c & 63);\\\\n        }\\\\n        if (i + 1 == h.length)\\\\n        {\\\\n            c = parseInt(h.substring(i, i + 1), 16);\\\\n            ret += base64Chars.charAt(c << 2);\\\\n        }\\\\n        else if (i + 2 == h.length)\\\\n        {\\\\n            c = parseInt(h.substring(i, i + 2), 16);\\\\n            ret += base64Chars.charAt(c >> 2) + base64Chars.charAt((c & 3) << 4);\\\\n        }\\\\n        while ((ret.length & 3) > 0) ret += \\"=\\";\\\\n        return ret;\\\\n    }\\\\n\\\\n    my.b64to16 = function(s) {\\\\n        var ret = \\"\\";\\\\n        var i;\\\\n        var k = 0;\\\\n        var slop;\\\\n        for (i = 0; i < s.length; ++i)\\\\n        {\\\\n            if (s.charAt(i) == \\"=\\") break;\\\\n            v = base64Chars.indexOf(s.charAt(i));\\\\n            if (v < 0) continue;\\\\n            if (k == 0)\\\\n            {\\\\n                ret += int2char(v >> 2);\\\\n                slop = v & 3;\\\\n                k = 1;\\\\n            }\\\\n            else if (k == 1)\\\\n            {\\\\n                ret += int2char((slop << 2) | (v >> 4));\\\\n                slop = v & 0xf;\\\\n                k = 2;\\\\n            }\\\\n            else if (k == 2)\\\\n            {\\\\n                ret += int2char(slop);\\\\n                ret += int2char(v >> 2);\\\\n                slop = v & 3;\\\\n                k = 3;\\\\n            }\\\\n            else\\\\n            {\\\\n                ret += int2char((slop << 2) | (v >> 4));\\\\n                ret += int2char(v & 0xf);\\\\n                k = 0;\\\\n            }\\\\n        }\\\\n        if (k == 1) ret += int2char(slop << 2);\\\\n        return ret;\\\\n    }\\\\n    \\\\n    // Converts a string to a byte array.\\\\n    my.string2bytes = function(string)\\\\n    {\\\\n        var bytes = new Array();\\\\n        for(var i = 0; i < string.length; i++) \\\\n        {\\\\n            bytes.push(string.charCodeAt(i));\\\\n        }\\\\n        return bytes;\\\\n    }\\\\n\\\\n    // Converts a byte array to a string.\\\\n    my.bytes2string = function(bytes)\\\\n    {\\\\n        var string = \\"\\";\\\\n        for(var i = 0; i < bytes.length; i++)\\\\n        {\\\\n            string += String.fromCharCode(bytes[i]);\\\\n        }   \\\\n        return string;\\\\n    }\\\\n    \\\\n    // Returns a XOR b, where a and b are 16-byte byte arrays.\\\\n    my.blockXOR = function(a, b)\\\\n    {\\\\n        var xor = new Array(16);\\\\n        for(var i = 0; i < 16; i++)\\\\n        {\\\\n            xor[i] = a[i] ^ b[i];\\\\n        }\\\\n        return xor;\\\\n    }\\\\n    \\\\n    // Returns a 16-byte initialization vector.\\\\n    my.blockIV = function()\\\\n    {\\\\n        var r = new SecureRandom();\\\\n        var IV = new Array(16);\\\\n        r.nextBytes(IV);\\\\n        return IV;\\\\n    }\\\\n    \\\\n    // Returns a copy of bytes with zeros appended to the end\\\\n    // so that the (length of bytes) % 16 == 0.\\\\n    my.pad16 = function(bytes)\\\\n    {\\\\n        var newBytes = bytes.slice(0);\\\\n        var padding = (16 - (bytes.length % 16)) % 16;\\\\n        for(i = bytes.length; i < bytes.length + padding; i++)\\\\n        {\\\\n            newBytes.push(0);\\\\n        }\\\\n        return newBytes;\\\\n    }\\\\n    \\\\n    // Removes trailing zeros from a byte array.\\\\n    my.depad = function(bytes)\\\\n    {\\\\n        var newBytes = bytes.slice(0);\\\\n        while(newBytes[newBytes.length - 1] == 0)\\\\n        {\\\\n            newBytes = newBytes.slice(0, newBytes.length - 1);\\\\n        }\\\\n        return newBytes;\\\\n    }\\\\n    \\\\n    // AES CBC Encryption.\\\\n    my.encryptAESCBC = function(plaintext, key)\\\\n    {\\\\n        var exkey = key.slice(0);\\\\n        aes.ExpandKey(exkey);\\\\n        var blocks = my.string2bytes(plaintext);\\\\n        blocks = my.pad16(blocks);\\\\n        var encryptedBlocks = my.blockIV();\\\\n        for(var i = 0; i < blocks.length/16; i++)\\\\n        {\\\\n            var tempBlock = blocks.slice(i * 16, i * 16 + 16);\\\\n            var prevBlock = encryptedBlocks.slice((i) * 16, (i) * 16 + 16);\\\\n            tempBlock = my.blockXOR(prevBlock, tempBlock);\\\\n            aes.Encrypt(tempBlock, exkey);\\\\n            encryptedBlocks = encryptedBlocks.concat(tempBlock);\\\\n        }\\\\n        var ciphertext = my.bytes2string(encryptedBlocks);\\\\n        return my.b256to64(ciphertext)\\\\n    }\\\\n\\\\n    // AES CBC Decryption.\\\\n    my.decryptAESCBC = function(encryptedText, key)\\\\n    {\\\\n        var exkey = key.slice(0);\\\\n        aes.ExpandKey(exkey);\\\\n        var encryptedText = my.b64to256(encryptedText);\\\\n        var encryptedBlocks = my.string2bytes(encryptedText);\\\\n        var decryptedBlocks = new Array();\\\\n        for(var i = 1; i < encryptedBlocks.length/16; i++)\\\\n        {\\\\n            var tempBlock = encryptedBlocks.slice(i * 16, i * 16 + 16);\\\\n            var prevBlock = encryptedBlocks.slice((i-1) * 16, (i-1) * 16 + 16);\\\\n            aes.Decrypt(tempBlock, exkey);\\\\n            tempBlock = my.blockXOR(prevBlock, tempBlock);\\\\n            decryptedBlocks = decryptedBlocks.concat(tempBlock);\\\\n        }\\\\n        decryptedBlocks = my.depad(decryptedBlocks);\\\\n        return my.bytes2string(decryptedBlocks);\\\\n    }\\\\n    \\\\n    // Wraps a string to 60 characters.\\\\n    my.wrap60 = function(string) \\\\n    {\\\\n        var outstr = \\"\\";\\\\n        for(var i = 0; i < string.length; i++) {\\\\n            if(i % 60 == 0 && i != 0) outstr += \\"\\\\\\\\n\\";\\\\n            outstr += string[i]; }\\\\n        return outstr; \\\\n    }\\\\n\\\\n    // Generate a random key for the AES-encrypted message.\\\\n    my.generateAESKey = function()\\\\n    {\\\\n        var key = new Array(32);\\\\n        var r = new SecureRandom();\\\\n        r.nextBytes(key);\\\\n        return key;\\\\n    }\\\\n\\\\n    // Generates an RSA key from a passphrase.\\\\n    my.generateRSAKey = function(passphrase, bitlength)\\\\n    {\\\\n        Math.seedrandom(sha256.hex(passphrase));\\\\n        var rsa = new RSAKey();\\\\n        rsa.generate(bitlength, \\"03\\");\\\\n        return rsa;\\\\n    }\\\\n\\\\n    // Returns the ascii-armored version of the public key.\\\\n    my.publicKeyString = function(rsakey) \\\\n    {\\\\n        pubkey = my.b16to64(rsakey.n.toString(16));\\\\n        return pubkey; \\\\n    }\\\\n    \\\\n    // Returns an MD5 sum of a publicKeyString for easier identification.\\\\n    my.publicKeyID = function(publicKeyString)\\\\n    {\\\\n        return MD5(publicKeyString);\\\\n    }\\\\n    \\\\n    my.publicKeyFromString = function(string)\\\\n    {\\\\n        var N = my.b64to16(string.split(\\"|\\")[0]);\\\\n        var E = \\"03\\";\\\\n        var rsa = new RSAKey();\\\\n        rsa.setPublic(N, E);\\\\n        return rsa\\\\n    }\\\\n    \\\\n    my.encrypt = function(plaintext, publickeystring, signingkey)\\\\n    {\\\\n        var cipherblock = \\"\\";\\\\n        var aeskey = my.generateAESKey();\\\\n        try\\\\n        {\\\\n            var publickey = my.publicKeyFromString(publickeystring);\\\\n            cipherblock += my.b16to64(publickey.encrypt(my.bytes2string(aeskey))) + \\"?\\";\\\\n        }\\\\n        catch(err)\\\\n        {\\\\n            return {status: \\"Invalid public key\\"};\\\\n        }\\\\n        if(signingkey)\\\\n        {\\\\n            signString = cryptico.b16to64(signingkey.signString(plaintext, \\"sha256\\"));\\\\n            plaintext += \\"::52cee64bb3a38f6403386519a39ac91c::\\";\\\\n            plaintext += cryptico.publicKeyString(signingkey);\\\\n            plaintext += \\"::52cee64bb3a38f6403386519a39ac91c::\\";\\\\n            plaintext += signString;\\\\n        }\\\\n        cipherblock += my.encryptAESCBC(plaintext, aeskey);    \\\\n        return {status: \\"success\\", cipher: cipherblock};\\\\n    }\\\\n\\\\n    my.decrypt = function(ciphertext, key)\\\\n    {\\\\n        var cipherblock = ciphertext.split(\\"?\\");\\\\n        var aeskey = key.decrypt(my.b64to16(cipherblock[0]));\\\\n        if(aeskey == null)\\\\n        {\\\\n            return {status: \\"failure\\"};\\\\n        }\\\\n        aeskey = my.string2bytes(aeskey);\\\\n        var plaintext = my.decryptAESCBC(cipherblock[1], aeskey).split(\\"::52cee64bb3a38f6403386519a39ac91c::\\");\\\\n        if(plaintext.length == 3)\\\\n        {\\\\n            var publickey = my.publicKeyFromString(plaintext[1]);\\\\n            var signature = my.b64to16(plaintext[2]);\\\\n            if(publickey.verifyString(plaintext[0], signature))\\\\n            {\\\\n                return {status: \\"success\\", \\\\n                        plaintext: plaintext[0], \\\\n                        signature: \\"verified\\", \\\\n                        publicKeyString: my.publicKeyString(publickey)};\\\\n            }\\\\n            else\\\\n            {\\\\n                return {status: \\"success\\", \\\\n                        plaintext: plaintext[0], \\\\n                        signature: \\"forged\\", \\\\n                        publicKeyString: my.publicKeyString(publickey)};\\\\n            }\\\\n        }\\\\n        else\\\\n        {\\\\n            return {status: \\"success\\", plaintext: plaintext[0], signature: \\"unsigned\\"};\\\\n        }\\\\n    }\\\\n\\\\n    return my;\\\\n\\\\n}());\\\\n\\\\nmodule.exports.RSAKey = RSAKey;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/js-cryptico/lib/cryptico.js\\\\n// module id = 167\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/js-cryptico/lib/cryptico.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar isPromise = __webpack_require__(299);\\\\n\\\\nfunction parseJsonSafely(str) {\\\\n  try {\\\\n    return JSON.parse(str);\\\\n  } catch (e) {\\\\n    return false;\\\\n  }\\\\n}\\\\n\\\\nfunction registerPromiseWorker(callback) {\\\\n\\\\n  function postOutgoingMessage(e, messageId, error, result) {\\\\n    function postMessage(msg) {\\\\n      /* istanbul ignore if */\\\\n      if (typeof self.postMessage !== \'function\') { // service worker\\\\n        e.ports[0].postMessage(msg);\\\\n      } else { // web worker\\\\n        self.postMessage(msg);\\\\n      }\\\\n    }\\\\n    if (error) {\\\\n      /* istanbul ignore else */\\\\n      if (typeof console !== \'undefined\' && \'error\' in console) {\\\\n        // This is to make errors easier to debug. I think it\'s important\\\\n        // enough to just leave here without giving the user an option\\\\n        // to silence it.\\\\n        console.error(\'Worker caught an error:\', error);\\\\n      }\\\\n      postMessage(JSON.stringify([messageId, {\\\\n        message: error.message\\\\n      }]));\\\\n    } else {\\\\n      postMessage(JSON.stringify([messageId, null, result]));\\\\n    }\\\\n  }\\\\n\\\\n  function tryCatchFunc(callback, message) {\\\\n    try {\\\\n      return {res: callback(message)};\\\\n    } catch (e) {\\\\n      return {err: e};\\\\n    }\\\\n  }\\\\n\\\\n  function handleIncomingMessage(e, callback, messageId, message) {\\\\n\\\\n    var result = tryCatchFunc(callback, message);\\\\n\\\\n    if (result.err) {\\\\n      postOutgoingMessage(e, messageId, result.err);\\\\n    } else if (!isPromise(result.res)) {\\\\n      postOutgoingMessage(e, messageId, null, result.res);\\\\n    } else {\\\\n      result.res.then(function (finalResult) {\\\\n        postOutgoingMessage(e, messageId, null, finalResult);\\\\n      }, function (finalError) {\\\\n        postOutgoingMessage(e, messageId, finalError);\\\\n      });\\\\n    }\\\\n  }\\\\n\\\\n  function onIncomingMessage(e) {\\\\n    var payload = parseJsonSafely(e.data);\\\\n    if (!payload) {\\\\n      // message isn\'t stringified json; ignore\\\\n      return;\\\\n    }\\\\n    var messageId = payload[0];\\\\n    var message = payload[1];\\\\n\\\\n    if (typeof callback !== \'function\') {\\\\n      postOutgoingMessage(e, messageId, new Error(\\\\n        \'Please pass a function into register().\'));\\\\n    } else {\\\\n      handleIncomingMessage(e, callback, messageId, message);\\\\n    }\\\\n  }\\\\n\\\\n  self.addEventListener(\'message\', onIncomingMessage);\\\\n}\\\\n\\\\nmodule.exports = registerPromiseWorker;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/promise-worker/register.js\\\\n// module id = 168\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/promise-worker/register.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nObject.defineProperty(exports, \\\\\\"__esModule\\\\\\", {\\\\n  value: true\\\\n});\\\\n\\\\nvar _regenerator = __webpack_require__(63);\\\\n\\\\nvar _regenerator2 = _interopRequireDefault(_regenerator);\\\\n\\\\nvar _stringify = __webpack_require__(95);\\\\n\\\\nvar _stringify2 = _interopRequireDefault(_stringify);\\\\n\\\\nvar _asyncToGenerator2 = __webpack_require__(60);\\\\n\\\\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\\\\n\\\\nvar _classCallCheck2 = __webpack_require__(61);\\\\n\\\\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\\\\n\\\\nvar _createClass2 = __webpack_require__(62);\\\\n\\\\nvar _createClass3 = _interopRequireDefault(_createClass2);\\\\n\\\\nvar _dexie = __webpack_require__(125);\\\\n\\\\nvar _dexie2 = _interopRequireDefault(_dexie);\\\\n\\\\n__webpack_require__(246);\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nvar DB = new _dexie2.default(\'DC\');\\\\nDB.version(1).stores({\\\\n  keyval: \'key, val\'\\\\n});\\\\n\\\\nexports.default = new (function () {\\\\n  function Store() {\\\\n    var _this = this;\\\\n\\\\n    (0, _classCallCheck3.default)(this, Store);\\\\n\\\\n    this.prefix = \'window: \';\\\\n    if (typeof window === \'undefined\') this.prefix = \'WORKER: \';\\\\n\\\\n    this.items = {};\\\\n    this.DB = DB;\\\\n\\\\n    DB.on(\'changes\', function () {\\\\n      _this.syncData();\\\\n    });\\\\n    DB.open();\\\\n\\\\n    if (typeof window !== \'undefined\' && window.localStorage) {\\\\n      this.items = window.localStorage;\\\\n    } else {\\\\n      this.syncData();\\\\n    }\\\\n  }\\\\n\\\\n  (0, _createClass3.default)(Store, [{\\\\n    key: \'syncData\',\\\\n    value: function syncData() {\\\\n      var _this2 = this;\\\\n\\\\n      DB.keyval.toArray(function (arr) {\\\\n        for (var k in arr) {\\\\n          var i = arr[k];\\\\n          _this2.items[i.key] = i.val;\\\\n          if (typeof window !== \'undefined\' && window.localStorage) window.localStorage.setItem(i.key, i.val);\\\\n        }\\\\n      });\\\\n    }\\\\n  }, {\\\\n    key: \'set\',\\\\n    value: function () {\\\\n      var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(key, val) {\\\\n        var encode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\\\\n        return _regenerator2.default.wrap(function _callee$(_context) {\\\\n          while (1) {\\\\n            switch (_context.prev = _context.next) {\\\\n              case 0:\\\\n                if (encode) val = (0, _stringify2.default)(val);\\\\n\\\\n                _context.next = 3;\\\\n                return DB.keyval.put({\\\\n                  key: key,\\\\n                  val: val\\\\n                });\\\\n\\\\n              case 3:\\\\n              case \'end\':\\\\n                return _context.stop();\\\\n            }\\\\n          }\\\\n        }, _callee, this);\\\\n      }));\\\\n\\\\n      function set(_x2, _x3) {\\\\n        return _ref.apply(this, arguments);\\\\n      }\\\\n\\\\n      return set;\\\\n    }()\\\\n  }, {\\\\n    key: \'get\',\\\\n    value: function () {\\\\n      var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(key) {\\\\n        var decode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\\\\n        var res;\\\\n        return _regenerator2.default.wrap(function _callee2$(_context2) {\\\\n          while (1) {\\\\n            switch (_context2.prev = _context2.next) {\\\\n              case 0:\\\\n                _context2.next = 2;\\\\n                return DB.keyval.get(key);\\\\n\\\\n              case 2:\\\\n                res = _context2.sent;\\\\n\\\\n                if (res) {\\\\n                  _context2.next = 5;\\\\n                  break;\\\\n                }\\\\n\\\\n                return _context2.abrupt(\'return\', null);\\\\n\\\\n              case 5:\\\\n\\\\n                if (decode) res.val = JSON.parse(res.val);\\\\n                return _context2.abrupt(\'return\', res.val);\\\\n\\\\n              case 7:\\\\n              case \'end\':\\\\n                return _context2.stop();\\\\n            }\\\\n          }\\\\n        }, _callee2, this);\\\\n      }));\\\\n\\\\n      function get(_x5) {\\\\n        return _ref2.apply(this, arguments);\\\\n      }\\\\n\\\\n      return get;\\\\n    }()\\\\n\\\\n    // localStorage compatability\\\\n\\\\n  }, {\\\\n    key: \'setItem\',\\\\n    value: function () {\\\\n      var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(key, val) {\\\\n        return _regenerator2.default.wrap(function _callee3$(_context3) {\\\\n          while (1) {\\\\n            switch (_context3.prev = _context3.next) {\\\\n              case 0:\\\\n                this.items[key] = val;\\\\n                _context3.next = 3;\\\\n                return this.set(key, val, false);\\\\n\\\\n              case 3:\\\\n                if (typeof window !== \'undefined\' && window.localStorage) window.localStorage.setItem(key, val);\\\\n\\\\n              case 4:\\\\n              case \'end\':\\\\n                return _context3.stop();\\\\n            }\\\\n          }\\\\n        }, _callee3, this);\\\\n      }));\\\\n\\\\n      function setItem(_x6, _x7) {\\\\n        return _ref3.apply(this, arguments);\\\\n      }\\\\n\\\\n      return setItem;\\\\n    }()\\\\n  }, {\\\\n    key: \'getItem\',\\\\n    value: function getItem(key) {\\\\n      return this.items[key] || null;\\\\n    }\\\\n  }]);\\\\n  return Store;\\\\n}())();\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/API/DB.js\\\\n// module id = 169\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=API/DB.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar erc20 = void 0,\\\\n    paychannel = void 0;\\\\n\\\\nif (true) {\\\\n  erc20 = __webpack_require__(171);\\\\n  paychannel = __webpack_require__(172);\\\\n}\\\\n\\\\nmodule.exports = {\\\\n  upd: \'17.10.2017\',\\\\n\\\\n  wallet_pass: \'1234\',\\\\n\\\\n  db_name: \'DCLib\',\\\\n  rtc_room: \'dc-room1\',\\\\n  rtc_store: \'rtc_msgs\',\\\\n  logname: \'dclib\',\\\\n  loglevel: \'hight\',\\\\n\\\\n  network: \'ropsten\',\\\\n  rpc_url: \'https://ropsten.infura.io/JCnK5ifEPH9qcQkX0Ahl\',\\\\n  api_url: \'https://platform.dao.casino/faucet2\',\\\\n  // signal : \'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star\',\\\\n  // signal  : \'/ip4/46.101.244.101/tcp/9090/ws/p2p-websocket-star/\',\\\\n  // signal  : \'/ip4/146.185.173.84/tcp/9090/ws/p2p-websocket-star/\',\\\\n  signal: \'/dns4/ws.dao.casino/tcp/443/wss/p2p-websocket-star/\',\\\\n\\\\n  tx_confirmations: 2,\\\\n\\\\n  contracts: {\\\\n    erc20: erc20,\\\\n    paychannel: paychannel\\\\n  },\\\\n\\\\n  gasPrice: 100 * 1000000000,\\\\n  gasLimit: 40 * 100000\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/config/ropsten/config.js\\\\n// module id = 170\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=config/ropsten/config.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\n/*\\\\n *  Dao.Casino ERC20 test Contract\\\\n *. 0x95a48dca999c89e4e284930d9b9af973a7481287\\\\n *  https://ropsten.etherscan.io/address/0x95a48dca999c89e4e284930d9b9af973a7481287#readContract\\\\n *\\\\n */\\\\n\\\\n// module.exports = {\\\\n//   address : \\\\\'0x95a48dca999c89e4e284930d9b9af973a7481287\\\\\',\\\\n//   abi     : JSON.parse(\\\\\'[{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"name\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"string\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_spender\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"approve\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"totalSupply\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_from\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"transferFrom\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"decimals\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint8\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"standard\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"string\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"name\\":\\"balanceOf\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"symbol\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"string\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"transfer\\",\\"outputs\\":[],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_spender\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_extraData\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"approveAndCall\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"},{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"name\\":\\"allowance\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"type\\":\\"function\\"},{\\"inputs\\":[],\\"payable\\":false,\\"type\\":\\"constructor\\"},{\\"payable\\":false,\\"type\\":\\"fallback\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":true,\\"name\\":\\"from\\",\\"type\\":\\"address\\"},{\\"indexed\\":true,\\"name\\":\\"to\\",\\"type\\":\\"address\\"},{\\"indexed\\":false,\\"name\\":\\"value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"Transfer\\",\\"type\\":\\"event\\"}]\\\\\')\\\\n// }\\\\n\\\\nmodule.exports = {\\\\n  address: \\\\\'0x5D1E47F703729fc87FdB9bA5C20fE4c1b7c7bf57\\\\\',\\\\n  abi: JSON.parse(\\\\\'[{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"name\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"string\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_spender\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"approve\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"totalSupply\\",\\"outputs\\":[{\\"name\\":\\"totalSupply\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_from\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"transferFrom\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"decimals\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint8\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"faucetTo\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_owner\\",\\"type\\":\\"address\\"}],\\"name\\":\\"balanceOf\\",\\"outputs\\":[{\\"name\\":\\"balance\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[],\\"name\\":\\"acceptOwnership\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"owner\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"symbol\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"string\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"transfer\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"newOwner\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"tokenAddress\\",\\"type\\":\\"address\\"},{\\"name\\":\\"amount\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"transferAnyERC20Token\\",\\"outputs\\":[{\\"name\\":\\"success\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_owner\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_spender\\",\\"type\\":\\"address\\"}],\\"name\\":\\"allowance\\",\\"outputs\\":[{\\"name\\":\\"remaining\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[],\\"name\\":\\"faucet\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_newOwner\\",\\"type\\":\\"address\\"}],\\"name\\":\\"transferOwnership\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"inputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"constructor\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":true,\\"name\\":\\"_from\\",\\"type\\":\\"address\\"},{\\"indexed\\":true,\\"name\\":\\"_to\\",\\"type\\":\\"address\\"}],\\"name\\":\\"OwnershipTransferred\\",\\"type\\":\\"event\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":true,\\"name\\":\\"_from\\",\\"type\\":\\"address\\"},{\\"indexed\\":true,\\"name\\":\\"_to\\",\\"type\\":\\"address\\"},{\\"indexed\\":false,\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"Transfer\\",\\"type\\":\\"event\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":true,\\"name\\":\\"_owner\\",\\"type\\":\\"address\\"},{\\"indexed\\":true,\\"name\\":\\"_spender\\",\\"type\\":\\"address\\"},{\\"indexed\\":false,\\"name\\":\\"_value\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"Approval\\",\\"type\\":\\"event\\"}]\\\\\')\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/config/ropsten/contracts/erc20.js\\\\n// module id = 171\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=config/ropsten/contracts/erc20.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\n/*\\\\n        ___                           __    _______                      __\\\\n      / _ \\\\\\\\___ ___ ____ _  ___ ___  / /_  / ___/ /  ___ ____  ___  ___ / /\\\\n     / ___/ _ `/ // /  \\\\\' \\\\\\\\/ -_) _ \\\\\\\\/ __/ / /__/ _ \\\\\\\\/ _ `/ _ \\\\\\\\/ _ \\\\\\\\/ -_) /\\\\n    /_/   \\\\\\\\_,_/\\\\\\\\_, /_/_/_/\\\\\\\\__/_//_/\\\\\\\\__/  \\\\\\\\___/_//_/\\\\\\\\_,_/_//_/_//_/\\\\\\\\__/_/\\\\n              /___/\\\\n\\\\n  Dao.Casino PaymentChannleContract\\\\n  0x029c61e3e9958b06bb63cc5c213c47cd114ab971\\\\n  https://ropsten.etherscan.io/address/0x029c61e3e9958b06bb63cc5c213c47cd114ab971#code\\\\n\\\\n  version 1.0\\\\n  more about payment channels:\\\\n  https://en.bitcoin.it/wiki/Payment_channels\\\\n*/\\\\n\\\\n// module.exports = {\\\\n//   address: \\\\\'0x6826f7155843651939c81cb367a72ca4a4912289\\\\\',\\\\n//   abi: JSON.parse(\\\\\'[{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"disputes\\",\\"outputs\\":[{\\"name\\":\\"disputeSeed\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"disputeBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"initiator\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_disputeBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_disputeSeed\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"openDispute\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"getProfit\\",\\"outputs\\":[{\\"name\\":\\"_profit\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"playerWL\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_N\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_E\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_rsaSign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"resolveDispute\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"updateChannel\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"config\\",\\"outputs\\":[{\\"name\\":\\"maxBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"minBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"gameDevReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"bankrollReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"platformReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"refererReward\\",\\"type\\":\\"uint8\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"channels\\",\\"outputs\\":[{\\"name\\":\\"state\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"player\\",\\"type\\":\\"address\\"},{\\"name\\":\\"bankroller\\",\\"type\\":\\"address\\"},{\\"name\\":\\"playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"endBlock\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"RSAHash\\",\\"type\\":\\"bytes32\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"rsa\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_hash\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"signature\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"recoverSigner\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_sigseed\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_min\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_max\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"generateRnd\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_close\\",\\"type\\":\\"bool\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"closeByConsent\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_sigseed\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"game\\",\\"outputs\\":[{\\"name\\":\\"_win\\",\\"type\\":\\"bool\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"developer\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"safeTime\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"refContract\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_player\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_bankroller\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_openingBlock\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_N\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_E\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"openChannel\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"gameWL\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"closeByTime\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"checkGameData\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"token\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"inputs\\":[{\\"name\\":\\"_token\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_ref\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_gameWL\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_playerWL\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_rsa\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"constructor\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":false,\\"name\\":\\"action\\",\\"type\\":\\"string\\"},{\\"indexed\\":false,\\"name\\":\\"id\\",\\"type\\":\\"bytes32\\"},{\\"indexed\\":false,\\"name\\":\\"playerBalance\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"logChannel\\",\\"type\\":\\"event\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":false,\\"name\\":\\"action\\",\\"type\\":\\"string\\"},{\\"indexed\\":false,\\"name\\":\\"initiator\\",\\"type\\":\\"address\\"},{\\"indexed\\":false,\\"name\\":\\"id\\",\\"type\\":\\"bytes32\\"},{\\"indexed\\":false,\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"seed\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"logDispute\\",\\"type\\":\\"event\\"}]\\\\\')\\\\n// }\\\\n\\\\nmodule.exports = {\\\\n  address: \\\\\'0x7f7e7dd90602ecab0791ac3370872b533bbdb9cc\\\\\',\\\\n  abi: JSON.parse(\\\\\'[{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"disputes\\",\\"outputs\\":[{\\"name\\":\\"disputeSeed\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"disputeBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"initiator\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_disputeBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_disputeSeed\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"openDispute\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"getProfit\\",\\"outputs\\":[{\\"name\\":\\"_profit\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"playerWL\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_N\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_E\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_rsaSign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"resolveDispute\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"updateChannel\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"config\\",\\"outputs\\":[{\\"name\\":\\"maxBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"minBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"gameDevReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"bankrollReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"platformReward\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"refererReward\\",\\"type\\":\\"uint8\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"channels\\",\\"outputs\\":[{\\"name\\":\\"state\\",\\"type\\":\\"uint8\\"},{\\"name\\":\\"player\\",\\"type\\":\\"address\\"},{\\"name\\":\\"bankroller\\",\\"type\\":\\"address\\"},{\\"name\\":\\"playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"endBlock\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"RSAHash\\",\\"type\\":\\"bytes32\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"rsa\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_hash\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"signature\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"recoverSigner\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_sigseed\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_min\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_max\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"generateRnd\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"pure\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_totalBet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_session\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_close\\",\\"type\\":\\"bool\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"closeByConsent\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_sigseed\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"game\\",\\"outputs\\":[{\\"name\\":\\"_win\\",\\"type\\":\\"bool\\"},{\\"name\\":\\"_amount\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"developer\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"safeTime\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"uint256\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"refContract\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"},{\\"name\\":\\"_player\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_bankroller\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_playerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_openingBlock\\",\\"type\\":\\"uint256\\"},{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_N\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_E\\",\\"type\\":\\"bytes\\"},{\\"name\\":\\"_sign\\",\\"type\\":\\"bytes\\"}],\\"name\\":\\"openChannel\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"gameWL\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":false,\\"inputs\\":[{\\"name\\":\\"_id\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"closeByTime\\",\\"outputs\\":[],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[{\\"name\\":\\"_gameData\\",\\"type\\":\\"uint256[]\\"},{\\"name\\":\\"_bet\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"checkGameData\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"bool\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"constant\\":true,\\"inputs\\":[],\\"name\\":\\"token\\",\\"outputs\\":[{\\"name\\":\\"\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"view\\",\\"type\\":\\"function\\"},{\\"inputs\\":[{\\"name\\":\\"_token\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_ref\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_gameWL\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_playerWL\\",\\"type\\":\\"address\\"},{\\"name\\":\\"_rsa\\",\\"type\\":\\"address\\"}],\\"payable\\":false,\\"stateMutability\\":\\"nonpayable\\",\\"type\\":\\"constructor\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":false,\\"name\\":\\"action\\",\\"type\\":\\"string\\"},{\\"indexed\\":false,\\"name\\":\\"id\\",\\"type\\":\\"bytes32\\"},{\\"indexed\\":false,\\"name\\":\\"playerBalance\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"bankrollerBalance\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"}],\\"name\\":\\"logChannel\\",\\"type\\":\\"event\\"},{\\"anonymous\\":false,\\"inputs\\":[{\\"indexed\\":false,\\"name\\":\\"action\\",\\"type\\":\\"string\\"},{\\"indexed\\":false,\\"name\\":\\"initiator\\",\\"type\\":\\"address\\"},{\\"indexed\\":false,\\"name\\":\\"id\\",\\"type\\":\\"bytes32\\"},{\\"indexed\\":false,\\"name\\":\\"session\\",\\"type\\":\\"uint256\\"},{\\"indexed\\":false,\\"name\\":\\"seed\\",\\"type\\":\\"bytes32\\"}],\\"name\\":\\"logDispute\\",\\"type\\":\\"event\\"}]\\\\\')\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./src/config/ropsten/contracts/paychannel.js\\\\n// module id = 172\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=config/ropsten/contracts/paychannel.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar _regenerator = __webpack_require__(63);\\\\n\\\\nvar _regenerator2 = _interopRequireDefault(_regenerator);\\\\n\\\\nvar _toConsumableArray2 = __webpack_require__(94);\\\\n\\\\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\\\\n\\\\nvar _asyncToGenerator2 = __webpack_require__(60);\\\\n\\\\nvar _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);\\\\n\\\\nvar _classCallCheck2 = __webpack_require__(61);\\\\n\\\\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\\\\n\\\\nvar _createClass2 = __webpack_require__(62);\\\\n\\\\nvar _createClass3 = _interopRequireDefault(_createClass2);\\\\n\\\\nvar _jsCryptico = __webpack_require__(167);\\\\n\\\\nvar _jsCryptico2 = _interopRequireDefault(_jsCryptico);\\\\n\\\\nvar _config2 = __webpack_require__(59);\\\\n\\\\nvar _config3 = _interopRequireDefault(_config2);\\\\n\\\\nvar _register = __webpack_require__(168);\\\\n\\\\nvar _register2 = _interopRequireDefault(_register);\\\\n\\\\nvar _Account = __webpack_require__(166);\\\\n\\\\nvar _Account2 = _interopRequireDefault(_Account);\\\\n\\\\nvar _utils = __webpack_require__(93);\\\\n\\\\nvar Utils = _interopRequireWildcard(_utils);\\\\n\\\\nvar _account = __webpack_require__(64);\\\\n\\\\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nvar Account = new _Account2.default(_config3.default, function () {}, false);\\\\nvar web3 = Account.web3;\\\\n// Account.initAccount()\\\\n\\\\nvar parseBigInt = function parseBigInt(a, b) {\\\\n  return new _jsCryptico2.default.RSAKey().parseInt(a, b);\\\\n};\\\\n\\\\nvar Crypto = function () {\\\\n  function Crypto() {\\\\n    var publickExponent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \'10001\';\\\\n    (0, _classCallCheck3.default)(this, Crypto);\\\\n\\\\n    this.RSA = new _jsCryptico2.default.RSAKey();\\\\n    this.publicExponent = publickExponent;\\\\n  }\\\\n\\\\n  // Method for creation public RSA keys for verify (for Player)\\\\n\\\\n\\\\n  (0, _createClass3.default)(Crypto, [{\\\\n    key: \'create\',\\\\n    value: function create(modulus) {\\\\n      var exponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \'10001\';\\\\n\\\\n      var publicExponent = exponent || this.publicExponent;\\\\n      this.RSA.setPublic(modulus, publicExponent);\\\\n    }\\\\n\\\\n    // Verification rawMsg and Signed msg\\\\n\\\\n  }, {\\\\n    key: \'verify\',\\\\n    value: function verify(message, signedMessage) {\\\\n      var msg = parseBigInt(message, 16);\\\\n      var sigMsg = parseBigInt(signedMessage, 16);\\\\n      msg = msg.mod(this.RSA.n);\\\\n      var newMessage = this.RSA.doPublic(sigMsg);\\\\n      return newMessage.equals(msg);\\\\n    }\\\\n  }, {\\\\n    key: \'signHash\',\\\\n    value: function signHash(hash) {\\\\n      hash = Utils.add0x(hash);\\\\n      if (!web3.utils.isHexStrict(hash)) {\\\\n        console.log(\'err\');\\\\n        Utils.debugLog(hash + \' is not correct hex\', _config3.default.loglevel);\\\\n        Utils.debugLog(\'Use DCLib.Utils.makeSeed or Utils.soliditySHA3(your_args) to create valid hash\', _config3.default.loglevel);\\\\n      }\\\\n\\\\n      return (0, _account.sign)(hash, Utils.add0x(Account.exportPrivateKey()));\\\\n    }\\\\n  }, {\\\\n    key: \'checkHashSig\',\\\\n    value: function checkHashSig(rawMsg, signedMsg, needAddress) {\\\\n      return needAddress.toLowerCase() === web3.eth.accounts.recover(rawMsg, signedMsg).toLowerCase();\\\\n    }\\\\n  }]);\\\\n  return Crypto;\\\\n}();\\\\n\\\\nvar crypto = new Crypto();\\\\n\\\\n(0, _register2.default)(function () {\\\\n  var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(msg) {\\\\n    var action, data, verify_hash;\\\\n    return _regenerator2.default.wrap(function _callee$(_context) {\\\\n      while (1) {\\\\n        switch (_context.prev = _context.next) {\\\\n          case 0:\\\\n            action = msg.action;\\\\n            data = msg.data;\\\\n\\\\n            if (!(action === \'sign_hash\' && data.hash)) {\\\\n              _context.next = 4;\\\\n              break;\\\\n            }\\\\n\\\\n            return _context.abrupt(\'return\', crypto.signHash(data.hash));\\\\n\\\\n          case 4:\\\\n            if (!(action === \'create_rsa\')) {\\\\n              _context.next = 9;\\\\n              break;\\\\n            }\\\\n\\\\n            if (!(!data._N || !data._E)) {\\\\n              _context.next = 7;\\\\n              break;\\\\n            }\\\\n\\\\n            throw new Error(\'Inc data\');\\\\n\\\\n          case 7:\\\\n            crypto.create(Utils.remove0x(data._N), data._E);\\\\n            return _context.abrupt(\'return\', true);\\\\n\\\\n          case 9:\\\\n            if (!(action === \'check_sign\')) {\\\\n              _context.next = 16;\\\\n              break;\\\\n            }\\\\n\\\\n            if (!(!data.verify_hash_args && !data.verify_hash || !data.bankroller_address || !data.bankroller_sign)) {\\\\n              _context.next = 12;\\\\n              break;\\\\n            }\\\\n\\\\n            throw new Error(\'Incomplete data\');\\\\n\\\\n          case 12:\\\\n            verify_hash = data.verify_hash || Utils.sha3.apply(Utils, (0, _toConsumableArray3.default)(data.verify_hash_args));\\\\n\\\\n            if (crypto.checkHashSig(verify_hash, data.bankroller_sign, data.bankroller_address)) {\\\\n              _context.next = 15;\\\\n              break;\\\\n            }\\\\n\\\\n            throw new Error(\'Invalid sign\');\\\\n\\\\n          case 15:\\\\n            return _context.abrupt(\'return\', true);\\\\n\\\\n          case 16:\\\\n            if (!(action === \'rsa_verify\')) {\\\\n              _context.next = 22;\\\\n              break;\\\\n            }\\\\n\\\\n            if (!(!data.rnd_hash || !data.rnd_sign)) {\\\\n              _context.next = 19;\\\\n              break;\\\\n            }\\\\n\\\\n            throw new Error(\'Incompleate data\');\\\\n\\\\n          case 19:\\\\n            if (crypto.verify(Utils.sha3.apply(Utils, (0, _toConsumableArray3.default)(data.rnd_hash)), data.rnd_sign)) {\\\\n              _context.next = 21;\\\\n              break;\\\\n            }\\\\n\\\\n            throw new Error(\'Invalid rsa verify\');\\\\n\\\\n          case 21:\\\\n            return _context.abrupt(\'return\', true);\\\\n\\\\n          case 22:\\\\n          case \'end\':\\\\n            return _context.stop();\\\\n        }\\\\n      }\\\\n    }, _callee, undefined);\\\\n  }));\\\\n\\\\n  return function (_x3) {\\\\n    return _ref.apply(this, arguments);\\\\n  };\\\\n}());\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-loader/lib?{\\\\\\"presets\\\\\\":[[\\\\\\"env\\\\\\",{\\\\\\"targets\\\\\\":{\\\\\\"browsers\\\\\\":[\\\\\\"last 2 versions\\\\\\",\\\\\\"safari >= 7\\\\\\"]}}]]}!./src/API/crypto.worker.js\\\\n// module id = 173\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=API/crypto.worker.js\\")},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(197), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/array/from.js\\\\n// module id = 174\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/array/from.js\')},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(199), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/object/assign.js\\\\n// module id = 175\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/object/assign.js\')},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(200), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/object/define-property.js\\\\n// module id = 176\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/object/define-property.js\')},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(202), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/symbol.js\\\\n// module id = 177\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/symbol.js\')},function(module,exports,__webpack_require__){eval(\'module.exports = { \\"default\\": __webpack_require__(203), __esModule: true };\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/core-js/symbol/iterator.js\\\\n// module id = 178\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/core-js/symbol/iterator.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\n\\\\nexports.__esModule = true;\\\\n\\\\nvar _iterator = __webpack_require__(178);\\\\n\\\\nvar _iterator2 = _interopRequireDefault(_iterator);\\\\n\\\\nvar _symbol = __webpack_require__(177);\\\\n\\\\nvar _symbol2 = _interopRequireDefault(_symbol);\\\\n\\\\nvar _typeof = typeof _symbol2.default === \\"function\\" && typeof _iterator2.default === \\"symbol\\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === \\"function\\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \\"symbol\\" : typeof obj; };\\\\n\\\\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\\\\n\\\\nexports.default = typeof _symbol2.default === \\"function\\" && _typeof(_iterator2.default) === \\"symbol\\" ? function (obj) {\\\\n  return typeof obj === \\"undefined\\" ? \\"undefined\\" : _typeof(obj);\\\\n} : function (obj) {\\\\n  return obj && typeof _symbol2.default === \\"function\\" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? \\"symbol\\" : typeof obj === \\"undefined\\" ? \\"undefined\\" : _typeof(obj);\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/babel-runtime/helpers/typeof.js\\\\n// module id = 179\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/babel-runtime/helpers/typeof.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.byteLength = byteLength\\\\nexports.toByteArray = toByteArray\\\\nexports.fromByteArray = fromByteArray\\\\n\\\\nvar lookup = []\\\\nvar revLookup = []\\\\nvar Arr = typeof Uint8Array !== \'undefined\' ? Uint8Array : Array\\\\n\\\\nvar code = \'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\'\\\\nfor (var i = 0, len = code.length; i < len; ++i) {\\\\n  lookup[i] = code[i]\\\\n  revLookup[code.charCodeAt(i)] = i\\\\n}\\\\n\\\\n// Support decoding URL-safe base64 strings, as Node.js does.\\\\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\\\\nrevLookup[\'-\'.charCodeAt(0)] = 62\\\\nrevLookup[\'_\'.charCodeAt(0)] = 63\\\\n\\\\nfunction placeHoldersCount (b64) {\\\\n  var len = b64.length\\\\n  if (len % 4 > 0) {\\\\n    throw new Error(\'Invalid string. Length must be a multiple of 4\')\\\\n  }\\\\n\\\\n  // the number of equal signs (place holders)\\\\n  // if there are two placeholders, than the two characters before it\\\\n  // represent one byte\\\\n  // if there is only one, then the three characters before it represent 2 bytes\\\\n  // this is just a cheap hack to not do indexOf twice\\\\n  return b64[len - 2] === \'=\' ? 2 : b64[len - 1] === \'=\' ? 1 : 0\\\\n}\\\\n\\\\nfunction byteLength (b64) {\\\\n  // base64 is 4/3 + up to two characters of the original data\\\\n  return (b64.length * 3 / 4) - placeHoldersCount(b64)\\\\n}\\\\n\\\\nfunction toByteArray (b64) {\\\\n  var i, l, tmp, placeHolders, arr\\\\n  var len = b64.length\\\\n  placeHolders = placeHoldersCount(b64)\\\\n\\\\n  arr = new Arr((len * 3 / 4) - placeHolders)\\\\n\\\\n  // if there are placeholders, only get up to the last complete 4 chars\\\\n  l = placeHolders > 0 ? len - 4 : len\\\\n\\\\n  var L = 0\\\\n\\\\n  for (i = 0; i < l; i += 4) {\\\\n    tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]\\\\n    arr[L++] = (tmp >> 16) & 0xFF\\\\n    arr[L++] = (tmp >> 8) & 0xFF\\\\n    arr[L++] = tmp & 0xFF\\\\n  }\\\\n\\\\n  if (placeHolders === 2) {\\\\n    tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)\\\\n    arr[L++] = tmp & 0xFF\\\\n  } else if (placeHolders === 1) {\\\\n    tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)\\\\n    arr[L++] = (tmp >> 8) & 0xFF\\\\n    arr[L++] = tmp & 0xFF\\\\n  }\\\\n\\\\n  return arr\\\\n}\\\\n\\\\nfunction tripletToBase64 (num) {\\\\n  return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]\\\\n}\\\\n\\\\nfunction encodeChunk (uint8, start, end) {\\\\n  var tmp\\\\n  var output = []\\\\n  for (var i = start; i < end; i += 3) {\\\\n    tmp = ((uint8[i] << 16) & 0xFF0000) + ((uint8[i + 1] << 8) & 0xFF00) + (uint8[i + 2] & 0xFF)\\\\n    output.push(tripletToBase64(tmp))\\\\n  }\\\\n  return output.join(\'\')\\\\n}\\\\n\\\\nfunction fromByteArray (uint8) {\\\\n  var tmp\\\\n  var len = uint8.length\\\\n  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\\\\n  var output = \'\'\\\\n  var parts = []\\\\n  var maxChunkLength = 16383 // must be multiple of 3\\\\n\\\\n  // go through the array every three bytes, we\'ll deal with trailing stuff later\\\\n  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\\\\n    parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\\\\n  }\\\\n\\\\n  // pad the end with zeros, but make sure to not forget the extra bytes\\\\n  if (extraBytes === 1) {\\\\n    tmp = uint8[len - 1]\\\\n    output += lookup[tmp >> 2]\\\\n    output += lookup[(tmp << 4) & 0x3F]\\\\n    output += \'==\'\\\\n  } else if (extraBytes === 2) {\\\\n    tmp = (uint8[len - 2] << 8) + (uint8[len - 1])\\\\n    output += lookup[tmp >> 10]\\\\n    output += lookup[(tmp >> 4) & 0x3F]\\\\n    output += lookup[(tmp << 2) & 0x3F]\\\\n    output += \'=\'\\\\n  }\\\\n\\\\n  parts.push(output)\\\\n\\\\n  return parts.join(\'\')\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/base64-js/index.js\\\\n// module id = 180\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/base64-js/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var AuthCipher = __webpack_require__(98)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar MODES = __webpack_require__(66)\\\\nvar StreamCipher = __webpack_require__(102)\\\\nvar Transform = __webpack_require__(17)\\\\nvar aes = __webpack_require__(44)\\\\nvar ebtk = __webpack_require__(52)\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction Decipher (mode, key, iv) {\\\\n  Transform.call(this)\\\\n\\\\n  this._cache = new Splitter()\\\\n  this._last = void 0\\\\n  this._cipher = new aes.AES(key)\\\\n  this._prev = Buffer.from(iv)\\\\n  this._mode = mode\\\\n  this._autopadding = true\\\\n}\\\\n\\\\ninherits(Decipher, Transform)\\\\n\\\\nDecipher.prototype._update = function (data) {\\\\n  this._cache.add(data)\\\\n  var chunk\\\\n  var thing\\\\n  var out = []\\\\n  while ((chunk = this._cache.get(this._autopadding))) {\\\\n    thing = this._mode.decrypt(this, chunk)\\\\n    out.push(thing)\\\\n  }\\\\n  return Buffer.concat(out)\\\\n}\\\\n\\\\nDecipher.prototype._final = function () {\\\\n  var chunk = this._cache.flush()\\\\n  if (this._autopadding) {\\\\n    return unpad(this._mode.decrypt(this, chunk))\\\\n  } else if (chunk) {\\\\n    throw new Error(\'data not multiple of block length\')\\\\n  }\\\\n}\\\\n\\\\nDecipher.prototype.setAutoPadding = function (setTo) {\\\\n  this._autopadding = !!setTo\\\\n  return this\\\\n}\\\\n\\\\nfunction Splitter () {\\\\n  this.cache = Buffer.allocUnsafe(0)\\\\n}\\\\n\\\\nSplitter.prototype.add = function (data) {\\\\n  this.cache = Buffer.concat([this.cache, data])\\\\n}\\\\n\\\\nSplitter.prototype.get = function (autoPadding) {\\\\n  var out\\\\n  if (autoPadding) {\\\\n    if (this.cache.length > 16) {\\\\n      out = this.cache.slice(0, 16)\\\\n      this.cache = this.cache.slice(16)\\\\n      return out\\\\n    }\\\\n  } else {\\\\n    if (this.cache.length >= 16) {\\\\n      out = this.cache.slice(0, 16)\\\\n      this.cache = this.cache.slice(16)\\\\n      return out\\\\n    }\\\\n  }\\\\n\\\\n  return null\\\\n}\\\\n\\\\nSplitter.prototype.flush = function () {\\\\n  if (this.cache.length) return this.cache\\\\n}\\\\n\\\\nfunction unpad (last) {\\\\n  var padded = last[15]\\\\n  if (padded < 1 || padded > 16) {\\\\n    throw new Error(\'unable to decrypt data\')\\\\n  }\\\\n  var i = -1\\\\n  while (++i < padded) {\\\\n    if (last[(i + (16 - padded))] !== padded) {\\\\n      throw new Error(\'unable to decrypt data\')\\\\n    }\\\\n  }\\\\n  if (padded === 16) return\\\\n\\\\n  return last.slice(0, 16 - padded)\\\\n}\\\\n\\\\nfunction createDecipheriv (suite, password, iv) {\\\\n  var config = MODES[suite.toLowerCase()]\\\\n  if (!config) throw new TypeError(\'invalid suite type\')\\\\n\\\\n  if (typeof iv === \'string\') iv = Buffer.from(iv)\\\\n  if (config.mode !== \'GCM\' && iv.length !== config.iv) throw new TypeError(\'invalid iv length \' + iv.length)\\\\n\\\\n  if (typeof password === \'string\') password = Buffer.from(password)\\\\n  if (password.length !== config.key / 8) throw new TypeError(\'invalid key length \' + password.length)\\\\n\\\\n  if (config.type === \'stream\') {\\\\n    return new StreamCipher(config.module, password, iv, true)\\\\n  } else if (config.type === \'auth\') {\\\\n    return new AuthCipher(config.module, password, iv, true)\\\\n  }\\\\n\\\\n  return new Decipher(config.module, password, iv)\\\\n}\\\\n\\\\nfunction createDecipher (suite, password) {\\\\n  var config = MODES[suite.toLowerCase()]\\\\n  if (!config) throw new TypeError(\'invalid suite type\')\\\\n\\\\n  var keys = ebtk(password, false, config.key, config.iv)\\\\n  return createDecipheriv(suite, keys.key, keys.iv)\\\\n}\\\\n\\\\nexports.createDecipher = createDecipher\\\\nexports.createDecipheriv = createDecipheriv\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/decrypter.js\\\\n// module id = 181\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/decrypter.js\\")},function(module,exports,__webpack_require__){eval(\\"var MODES = __webpack_require__(66)\\\\nvar AuthCipher = __webpack_require__(98)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar StreamCipher = __webpack_require__(102)\\\\nvar Transform = __webpack_require__(17)\\\\nvar aes = __webpack_require__(44)\\\\nvar ebtk = __webpack_require__(52)\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction Cipher (mode, key, iv) {\\\\n  Transform.call(this)\\\\n\\\\n  this._cache = new Splitter()\\\\n  this._cipher = new aes.AES(key)\\\\n  this._prev = Buffer.from(iv)\\\\n  this._mode = mode\\\\n  this._autopadding = true\\\\n}\\\\n\\\\ninherits(Cipher, Transform)\\\\n\\\\nCipher.prototype._update = function (data) {\\\\n  this._cache.add(data)\\\\n  var chunk\\\\n  var thing\\\\n  var out = []\\\\n\\\\n  while ((chunk = this._cache.get())) {\\\\n    thing = this._mode.encrypt(this, chunk)\\\\n    out.push(thing)\\\\n  }\\\\n\\\\n  return Buffer.concat(out)\\\\n}\\\\n\\\\nvar PADDING = Buffer.alloc(16, 0x10)\\\\n\\\\nCipher.prototype._final = function () {\\\\n  var chunk = this._cache.flush()\\\\n  if (this._autopadding) {\\\\n    chunk = this._mode.encrypt(this, chunk)\\\\n    this._cipher.scrub()\\\\n    return chunk\\\\n  }\\\\n\\\\n  if (!chunk.equals(PADDING)) {\\\\n    this._cipher.scrub()\\\\n    throw new Error(\'data not multiple of block length\')\\\\n  }\\\\n}\\\\n\\\\nCipher.prototype.setAutoPadding = function (setTo) {\\\\n  this._autopadding = !!setTo\\\\n  return this\\\\n}\\\\n\\\\nfunction Splitter () {\\\\n  this.cache = Buffer.allocUnsafe(0)\\\\n}\\\\n\\\\nSplitter.prototype.add = function (data) {\\\\n  this.cache = Buffer.concat([this.cache, data])\\\\n}\\\\n\\\\nSplitter.prototype.get = function () {\\\\n  if (this.cache.length > 15) {\\\\n    var out = this.cache.slice(0, 16)\\\\n    this.cache = this.cache.slice(16)\\\\n    return out\\\\n  }\\\\n  return null\\\\n}\\\\n\\\\nSplitter.prototype.flush = function () {\\\\n  var len = 16 - this.cache.length\\\\n  var padBuff = Buffer.allocUnsafe(len)\\\\n\\\\n  var i = -1\\\\n  while (++i < len) {\\\\n    padBuff.writeUInt8(len, i)\\\\n  }\\\\n\\\\n  return Buffer.concat([this.cache, padBuff])\\\\n}\\\\n\\\\nfunction createCipheriv (suite, password, iv) {\\\\n  var config = MODES[suite.toLowerCase()]\\\\n  if (!config) throw new TypeError(\'invalid suite type\')\\\\n\\\\n  if (typeof password === \'string\') password = Buffer.from(password)\\\\n  if (password.length !== config.key / 8) throw new TypeError(\'invalid key length \' + password.length)\\\\n\\\\n  if (typeof iv === \'string\') iv = Buffer.from(iv)\\\\n  if (config.mode !== \'GCM\' && iv.length !== config.iv) throw new TypeError(\'invalid iv length \' + iv.length)\\\\n\\\\n  if (config.type === \'stream\') {\\\\n    return new StreamCipher(config.module, password, iv)\\\\n  } else if (config.type === \'auth\') {\\\\n    return new AuthCipher(config.module, password, iv)\\\\n  }\\\\n\\\\n  return new Cipher(config.module, password, iv)\\\\n}\\\\n\\\\nfunction createCipher (suite, password) {\\\\n  var config = MODES[suite.toLowerCase()]\\\\n  if (!config) throw new TypeError(\'invalid suite type\')\\\\n\\\\n  var keys = ebtk(password, false, config.key, config.iv)\\\\n  return createCipheriv(suite, keys.key, keys.iv)\\\\n}\\\\n\\\\nexports.createCipheriv = createCipheriv\\\\nexports.createCipher = createCipher\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/encrypter.js\\\\n// module id = 182\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/encrypter.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\nvar ZEROES = Buffer.alloc(16, 0)\\\\n\\\\nfunction toArray (buf) {\\\\n  return [\\\\n    buf.readUInt32BE(0),\\\\n    buf.readUInt32BE(4),\\\\n    buf.readUInt32BE(8),\\\\n    buf.readUInt32BE(12)\\\\n  ]\\\\n}\\\\n\\\\nfunction fromArray (out) {\\\\n  var buf = Buffer.allocUnsafe(16)\\\\n  buf.writeUInt32BE(out[0] >>> 0, 0)\\\\n  buf.writeUInt32BE(out[1] >>> 0, 4)\\\\n  buf.writeUInt32BE(out[2] >>> 0, 8)\\\\n  buf.writeUInt32BE(out[3] >>> 0, 12)\\\\n  return buf\\\\n}\\\\n\\\\nfunction GHASH (key) {\\\\n  this.h = key\\\\n  this.state = Buffer.alloc(16, 0)\\\\n  this.cache = Buffer.allocUnsafe(0)\\\\n}\\\\n\\\\n// from http://bitwiseshiftleft.github.io/sjcl/doc/symbols/src/core_gcm.js.html\\\\n// by Juho Vähä-Herttua\\\\nGHASH.prototype.ghash = function (block) {\\\\n  var i = -1\\\\n  while (++i < block.length) {\\\\n    this.state[i] ^= block[i]\\\\n  }\\\\n  this._multiply()\\\\n}\\\\n\\\\nGHASH.prototype._multiply = function () {\\\\n  var Vi = toArray(this.h)\\\\n  var Zi = [0, 0, 0, 0]\\\\n  var j, xi, lsbVi\\\\n  var i = -1\\\\n  while (++i < 128) {\\\\n    xi = (this.state[~~(i / 8)] & (1 << (7 - (i % 8)))) !== 0\\\\n    if (xi) {\\\\n      // Z_i+1 = Z_i ^ V_i\\\\n      Zi[0] ^= Vi[0]\\\\n      Zi[1] ^= Vi[1]\\\\n      Zi[2] ^= Vi[2]\\\\n      Zi[3] ^= Vi[3]\\\\n    }\\\\n\\\\n    // Store the value of LSB(V_i)\\\\n    lsbVi = (Vi[3] & 1) !== 0\\\\n\\\\n    // V_i+1 = V_i >> 1\\\\n    for (j = 3; j > 0; j--) {\\\\n      Vi[j] = (Vi[j] >>> 1) | ((Vi[j - 1] & 1) << 31)\\\\n    }\\\\n    Vi[0] = Vi[0] >>> 1\\\\n\\\\n    // If LSB(V_i) is 1, V_i+1 = (V_i >> 1) ^ R\\\\n    if (lsbVi) {\\\\n      Vi[0] = Vi[0] ^ (0xe1 << 24)\\\\n    }\\\\n  }\\\\n  this.state = fromArray(Zi)\\\\n}\\\\n\\\\nGHASH.prototype.update = function (buf) {\\\\n  this.cache = Buffer.concat([this.cache, buf])\\\\n  var chunk\\\\n  while (this.cache.length >= 16) {\\\\n    chunk = this.cache.slice(0, 16)\\\\n    this.cache = this.cache.slice(16)\\\\n    this.ghash(chunk)\\\\n  }\\\\n}\\\\n\\\\nGHASH.prototype.final = function (abl, bl) {\\\\n  if (this.cache.length) {\\\\n    this.ghash(Buffer.concat([this.cache, ZEROES], 16))\\\\n  }\\\\n\\\\n  this.ghash(fromArray([0, abl, 0, bl]))\\\\n  return this.state\\\\n}\\\\n\\\\nmodule.exports = GHASH\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/ghash.js\\\\n// module id = 183\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/ghash.js\\")},function(module,exports,__webpack_require__){eval(\\"var xor = __webpack_require__(32)\\\\n\\\\nexports.encrypt = function (self, block) {\\\\n  var data = xor(block, self._prev)\\\\n\\\\n  self._prev = self._cipher.encryptBlock(data)\\\\n  return self._prev\\\\n}\\\\n\\\\nexports.decrypt = function (self, block) {\\\\n  var pad = self._prev\\\\n\\\\n  self._prev = block\\\\n  var out = self._cipher.decryptBlock(block)\\\\n\\\\n  return xor(out, pad)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/cbc.js\\\\n// module id = 184\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/cbc.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\nvar xor = __webpack_require__(32)\\\\n\\\\nfunction encryptStart (self, data, decrypt) {\\\\n  var len = data.length\\\\n  var out = xor(data, self._cache)\\\\n  self._cache = self._cache.slice(len)\\\\n  self._prev = Buffer.concat([self._prev, decrypt ? data : out])\\\\n  return out\\\\n}\\\\n\\\\nexports.encrypt = function (self, data, decrypt) {\\\\n  var out = Buffer.allocUnsafe(0)\\\\n  var len\\\\n\\\\n  while (data.length) {\\\\n    if (self._cache.length === 0) {\\\\n      self._cache = self._cipher.encryptBlock(self._prev)\\\\n      self._prev = Buffer.allocUnsafe(0)\\\\n    }\\\\n\\\\n    if (self._cache.length <= data.length) {\\\\n      len = self._cache.length\\\\n      out = Buffer.concat([out, encryptStart(self, data.slice(0, len), decrypt)])\\\\n      data = data.slice(len)\\\\n    } else {\\\\n      out = Buffer.concat([out, encryptStart(self, data, decrypt)])\\\\n      break\\\\n    }\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/cfb.js\\\\n// module id = 185\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/cfb.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\n\\\\nfunction encryptByte (self, byteParam, decrypt) {\\\\n  var pad\\\\n  var i = -1\\\\n  var len = 8\\\\n  var out = 0\\\\n  var bit, value\\\\n  while (++i < len) {\\\\n    pad = self._cipher.encryptBlock(self._prev)\\\\n    bit = (byteParam & (1 << (7 - i))) ? 0x80 : 0\\\\n    value = pad[0] ^ bit\\\\n    out += ((value & 0x80) >> (i % 8))\\\\n    self._prev = shiftIn(self._prev, decrypt ? bit : value)\\\\n  }\\\\n  return out\\\\n}\\\\n\\\\nfunction shiftIn (buffer, value) {\\\\n  var len = buffer.length\\\\n  var i = -1\\\\n  var out = Buffer.allocUnsafe(buffer.length)\\\\n  buffer = Buffer.concat([buffer, Buffer.from([value])])\\\\n\\\\n  while (++i < len) {\\\\n    out[i] = buffer[i] << 1 | buffer[i + 1] >> (7)\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\nexports.encrypt = function (self, chunk, decrypt) {\\\\n  var len = chunk.length\\\\n  var out = Buffer.allocUnsafe(len)\\\\n  var i = -1\\\\n\\\\n  while (++i < len) {\\\\n    out[i] = encryptByte(self, chunk[i], decrypt)\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/cfb1.js\\\\n// module id = 186\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/cfb1.js\\")},function(module,exports,__webpack_require__){eval(\\"var Buffer = __webpack_require__(2).Buffer\\\\n\\\\nfunction encryptByte (self, byteParam, decrypt) {\\\\n  var pad = self._cipher.encryptBlock(self._prev)\\\\n  var out = pad[0] ^ byteParam\\\\n\\\\n  self._prev = Buffer.concat([\\\\n    self._prev.slice(1),\\\\n    Buffer.from([decrypt ? byteParam : out])\\\\n  ])\\\\n\\\\n  return out\\\\n}\\\\n\\\\nexports.encrypt = function (self, chunk, decrypt) {\\\\n  var len = chunk.length\\\\n  var out = Buffer.allocUnsafe(len)\\\\n  var i = -1\\\\n\\\\n  while (++i < len) {\\\\n    out[i] = encryptByte(self, chunk[i], decrypt)\\\\n  }\\\\n\\\\n  return out\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/cfb8.js\\\\n// module id = 187\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/cfb8.js\\")},function(module,exports){eval(\\"exports.encrypt = function (self, block) {\\\\n  return self._cipher.encryptBlock(block)\\\\n}\\\\n\\\\nexports.decrypt = function (self, block) {\\\\n  return self._cipher.decryptBlock(block)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/ecb.js\\\\n// module id = 188\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/ecb.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var xor = __webpack_require__(32)\\\\n\\\\nfunction getBlock (self) {\\\\n  self._prev = self._cipher.encryptBlock(self._prev)\\\\n  return self._prev\\\\n}\\\\n\\\\nexports.encrypt = function (self, chunk) {\\\\n  while (self._cache.length < chunk.length) {\\\\n    self._cache = Buffer.concat([self._cache, getBlock(self)])\\\\n  }\\\\n\\\\n  var pad = self._cache.slice(0, chunk.length)\\\\n  self._cache = self._cache.slice(chunk.length)\\\\n  return xor(chunk, pad)\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-aes/modes/ofb.js\\\\n// module id = 189\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-aes/modes/ofb.js\\")},function(module,exports,__webpack_require__){eval(\\"var ebtk = __webpack_require__(52)\\\\nvar aes = __webpack_require__(65)\\\\nvar DES = __webpack_require__(191)\\\\nvar desModes = __webpack_require__(192)\\\\nvar aesModes = __webpack_require__(66)\\\\nfunction createCipher (suite, password) {\\\\n  var keyLen, ivLen\\\\n  suite = suite.toLowerCase()\\\\n  if (aesModes[suite]) {\\\\n    keyLen = aesModes[suite].key\\\\n    ivLen = aesModes[suite].iv\\\\n  } else if (desModes[suite]) {\\\\n    keyLen = desModes[suite].key * 8\\\\n    ivLen = desModes[suite].iv\\\\n  } else {\\\\n    throw new TypeError(\'invalid suite type\')\\\\n  }\\\\n  var keys = ebtk(password, false, keyLen, ivLen)\\\\n  return createCipheriv(suite, keys.key, keys.iv)\\\\n}\\\\nfunction createDecipher (suite, password) {\\\\n  var keyLen, ivLen\\\\n  suite = suite.toLowerCase()\\\\n  if (aesModes[suite]) {\\\\n    keyLen = aesModes[suite].key\\\\n    ivLen = aesModes[suite].iv\\\\n  } else if (desModes[suite]) {\\\\n    keyLen = desModes[suite].key * 8\\\\n    ivLen = desModes[suite].iv\\\\n  } else {\\\\n    throw new TypeError(\'invalid suite type\')\\\\n  }\\\\n  var keys = ebtk(password, false, keyLen, ivLen)\\\\n  return createDecipheriv(suite, keys.key, keys.iv)\\\\n}\\\\n\\\\nfunction createCipheriv (suite, key, iv) {\\\\n  suite = suite.toLowerCase()\\\\n  if (aesModes[suite]) {\\\\n    return aes.createCipheriv(suite, key, iv)\\\\n  } else if (desModes[suite]) {\\\\n    return new DES({\\\\n      key: key,\\\\n      iv: iv,\\\\n      mode: suite\\\\n    })\\\\n  } else {\\\\n    throw new TypeError(\'invalid suite type\')\\\\n  }\\\\n}\\\\nfunction createDecipheriv (suite, key, iv) {\\\\n  suite = suite.toLowerCase()\\\\n  if (aesModes[suite]) {\\\\n    return aes.createDecipheriv(suite, key, iv)\\\\n  } else if (desModes[suite]) {\\\\n    return new DES({\\\\n      key: key,\\\\n      iv: iv,\\\\n      mode: suite,\\\\n      decrypt: true\\\\n    })\\\\n  } else {\\\\n    throw new TypeError(\'invalid suite type\')\\\\n  }\\\\n}\\\\nexports.createCipher = exports.Cipher = createCipher\\\\nexports.createCipheriv = exports.Cipheriv = createCipheriv\\\\nexports.createDecipher = exports.Decipher = createDecipher\\\\nexports.createDecipheriv = exports.Decipheriv = createDecipheriv\\\\nfunction getCiphers () {\\\\n  return Object.keys(desModes).concat(aes.getCiphers())\\\\n}\\\\nexports.listCiphers = exports.getCiphers = getCiphers\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-cipher/browser.js\\\\n// module id = 190\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-cipher/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var CipherBase = __webpack_require__(17)\\\\nvar des = __webpack_require__(83)\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nvar modes = {\\\\n  \'des-ede3-cbc\': des.CBC.instantiate(des.EDE),\\\\n  \'des-ede3\': des.EDE,\\\\n  \'des-ede-cbc\': des.CBC.instantiate(des.EDE),\\\\n  \'des-ede\': des.EDE,\\\\n  \'des-cbc\': des.CBC.instantiate(des.DES),\\\\n  \'des-ecb\': des.DES\\\\n}\\\\nmodes.des = modes[\'des-cbc\']\\\\nmodes.des3 = modes[\'des-ede3-cbc\']\\\\nmodule.exports = DES\\\\ninherits(DES, CipherBase)\\\\nfunction DES (opts) {\\\\n  CipherBase.call(this)\\\\n  var modeName = opts.mode.toLowerCase()\\\\n  var mode = modes[modeName]\\\\n  var type\\\\n  if (opts.decrypt) {\\\\n    type = \'decrypt\'\\\\n  } else {\\\\n    type = \'encrypt\'\\\\n  }\\\\n  var key = opts.key\\\\n  if (modeName === \'des-ede\' || modeName === \'des-ede-cbc\') {\\\\n    key = Buffer.concat([key, key.slice(0, 8)])\\\\n  }\\\\n  var iv = opts.iv\\\\n  this._des = mode.create({\\\\n    key: key,\\\\n    iv: iv,\\\\n    type: type\\\\n  })\\\\n}\\\\nDES.prototype._update = function (data) {\\\\n  return new Buffer(this._des.update(data))\\\\n}\\\\nDES.prototype._final = function () {\\\\n  return new Buffer(this._des.final())\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-des/index.js\\\\n// module id = 191\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-des/index.js\\")},function(module,exports){eval(\\"exports[\'des-ecb\'] = {\\\\n  key: 8,\\\\n  iv: 0\\\\n}\\\\nexports[\'des-cbc\'] = exports.des = {\\\\n  key: 8,\\\\n  iv: 8\\\\n}\\\\nexports[\'des-ede3-cbc\'] = exports.des3 = {\\\\n  key: 24,\\\\n  iv: 8\\\\n}\\\\nexports[\'des-ede3\'] = {\\\\n  key: 24,\\\\n  iv: 0\\\\n}\\\\nexports[\'des-ede-cbc\'] = {\\\\n  key: 16,\\\\n  iv: 8\\\\n}\\\\nexports[\'des-ede\'] = {\\\\n  key: 16,\\\\n  iv: 0\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-des/modes.js\\\\n// module id = 192\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-des/modes.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(103)\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/algos.js\\\\n// module id = 193\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/algos.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var createHash = __webpack_require__(39)\\\\nvar stream = __webpack_require__(56)\\\\nvar inherits = __webpack_require__(0)\\\\nvar sign = __webpack_require__(195)\\\\nvar verify = __webpack_require__(196)\\\\n\\\\nvar algorithms = __webpack_require__(103)\\\\nObject.keys(algorithms).forEach(function (key) {\\\\n  algorithms[key].id = new Buffer(algorithms[key].id, \'hex\')\\\\n  algorithms[key.toLowerCase()] = algorithms[key]\\\\n})\\\\n\\\\nfunction Sign (algorithm) {\\\\n  stream.Writable.call(this)\\\\n\\\\n  var data = algorithms[algorithm]\\\\n  if (!data) throw new Error(\'Unknown message digest\')\\\\n\\\\n  this._hashType = data.hash\\\\n  this._hash = createHash(data.hash)\\\\n  this._tag = data.id\\\\n  this._signType = data.sign\\\\n}\\\\ninherits(Sign, stream.Writable)\\\\n\\\\nSign.prototype._write = function _write (data, _, done) {\\\\n  this._hash.update(data)\\\\n  done()\\\\n}\\\\n\\\\nSign.prototype.update = function update (data, enc) {\\\\n  if (typeof data === \'string\') data = new Buffer(data, enc)\\\\n\\\\n  this._hash.update(data)\\\\n  return this\\\\n}\\\\n\\\\nSign.prototype.sign = function signMethod (key, enc) {\\\\n  this.end()\\\\n  var hash = this._hash.digest()\\\\n  var sig = sign(hash, key, this._hashType, this._signType, this._tag)\\\\n\\\\n  return enc ? sig.toString(enc) : sig\\\\n}\\\\n\\\\nfunction Verify (algorithm) {\\\\n  stream.Writable.call(this)\\\\n\\\\n  var data = algorithms[algorithm]\\\\n  if (!data) throw new Error(\'Unknown message digest\')\\\\n\\\\n  this._hash = createHash(data.hash)\\\\n  this._tag = data.id\\\\n  this._signType = data.sign\\\\n}\\\\ninherits(Verify, stream.Writable)\\\\n\\\\nVerify.prototype._write = function _write (data, _, done) {\\\\n  this._hash.update(data)\\\\n  done()\\\\n}\\\\n\\\\nVerify.prototype.update = function update (data, enc) {\\\\n  if (typeof data === \'string\') data = new Buffer(data, enc)\\\\n\\\\n  this._hash.update(data)\\\\n  return this\\\\n}\\\\n\\\\nVerify.prototype.verify = function verifyMethod (key, sig, enc) {\\\\n  if (typeof sig === \'string\') sig = new Buffer(sig, enc)\\\\n\\\\n  this.end()\\\\n  var hash = this._hash.digest()\\\\n  return verify(sig, hash, key, this._signType, this._tag)\\\\n}\\\\n\\\\nfunction createSign (algorithm) {\\\\n  return new Sign(algorithm)\\\\n}\\\\n\\\\nfunction createVerify (algorithm) {\\\\n  return new Verify(algorithm)\\\\n}\\\\n\\\\nmodule.exports = {\\\\n  Sign: createSign,\\\\n  Verify: createVerify,\\\\n  createSign: createSign,\\\\n  createVerify: createVerify\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/browser/index.js\\\\n// module id = 194\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/browser/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\\\\nvar createHmac = __webpack_require__(124)\\\\nvar crt = __webpack_require__(67)\\\\nvar EC = __webpack_require__(6).ec\\\\nvar BN = __webpack_require__(3)\\\\nvar parseKeys = __webpack_require__(54)\\\\nvar curves = __webpack_require__(104)\\\\n\\\\nfunction sign (hash, key, hashType, signType, tag) {\\\\n  var priv = parseKeys(key)\\\\n  if (priv.curve) {\\\\n    // rsa keys can be interpreted as ecdsa ones in openssl\\\\n    if (signType !== \'ecdsa\' && signType !== \'ecdsa/rsa\') throw new Error(\'wrong private key type\')\\\\n    return ecSign(hash, priv)\\\\n  } else if (priv.type === \'dsa\') {\\\\n    if (signType !== \'dsa\') throw new Error(\'wrong private key type\')\\\\n    return dsaSign(hash, priv, hashType)\\\\n  } else {\\\\n    if (signType !== \'rsa\' && signType !== \'ecdsa/rsa\') throw new Error(\'wrong private key type\')\\\\n  }\\\\n  hash = Buffer.concat([tag, hash])\\\\n  var len = priv.modulus.byteLength()\\\\n  var pad = [ 0, 1 ]\\\\n  while (hash.length + pad.length + 1 < len) pad.push(0xff)\\\\n  pad.push(0x00)\\\\n  var i = -1\\\\n  while (++i < hash.length) pad.push(hash[i])\\\\n\\\\n  var out = crt(pad, priv)\\\\n  return out\\\\n}\\\\n\\\\nfunction ecSign (hash, priv) {\\\\n  var curveId = curves[priv.curve.join(\'.\')]\\\\n  if (!curveId) throw new Error(\'unknown curve \' + priv.curve.join(\'.\'))\\\\n\\\\n  var curve = new EC(curveId)\\\\n  var key = curve.keyFromPrivate(priv.privateKey)\\\\n  var out = key.sign(hash)\\\\n\\\\n  return new Buffer(out.toDER())\\\\n}\\\\n\\\\nfunction dsaSign (hash, priv, algo) {\\\\n  var x = priv.params.priv_key\\\\n  var p = priv.params.p\\\\n  var q = priv.params.q\\\\n  var g = priv.params.g\\\\n  var r = new BN(0)\\\\n  var k\\\\n  var H = bits2int(hash, q).mod(q)\\\\n  var s = false\\\\n  var kv = getKey(x, q, hash, algo)\\\\n  while (s === false) {\\\\n    k = makeKey(q, kv, algo)\\\\n    r = makeR(g, k, p, q)\\\\n    s = k.invm(q).imul(H.add(x.mul(r))).mod(q)\\\\n    if (s.cmpn(0) === 0) {\\\\n      s = false\\\\n      r = new BN(0)\\\\n    }\\\\n  }\\\\n  return toDER(r, s)\\\\n}\\\\n\\\\nfunction toDER (r, s) {\\\\n  r = r.toArray()\\\\n  s = s.toArray()\\\\n\\\\n  // Pad values\\\\n  if (r[0] & 0x80) r = [ 0 ].concat(r)\\\\n  if (s[0] & 0x80) s = [ 0 ].concat(s)\\\\n\\\\n  var total = r.length + s.length + 4\\\\n  var res = [ 0x30, total, 0x02, r.length ]\\\\n  res = res.concat(r, [ 0x02, s.length ], s)\\\\n  return new Buffer(res)\\\\n}\\\\n\\\\nfunction getKey (x, q, hash, algo) {\\\\n  x = new Buffer(x.toArray())\\\\n  if (x.length < q.byteLength()) {\\\\n    var zeros = new Buffer(q.byteLength() - x.length)\\\\n    zeros.fill(0)\\\\n    x = Buffer.concat([ zeros, x ])\\\\n  }\\\\n  var hlen = hash.length\\\\n  var hbits = bits2octets(hash, q)\\\\n  var v = new Buffer(hlen)\\\\n  v.fill(1)\\\\n  var k = new Buffer(hlen)\\\\n  k.fill(0)\\\\n  k = createHmac(algo, k).update(v).update(new Buffer([ 0 ])).update(x).update(hbits).digest()\\\\n  v = createHmac(algo, k).update(v).digest()\\\\n  k = createHmac(algo, k).update(v).update(new Buffer([ 1 ])).update(x).update(hbits).digest()\\\\n  v = createHmac(algo, k).update(v).digest()\\\\n  return { k: k, v: v }\\\\n}\\\\n\\\\nfunction bits2int (obits, q) {\\\\n  var bits = new BN(obits)\\\\n  var shift = (obits.length << 3) - q.bitLength()\\\\n  if (shift > 0) bits.ishrn(shift)\\\\n  return bits\\\\n}\\\\n\\\\nfunction bits2octets (bits, q) {\\\\n  bits = bits2int(bits, q)\\\\n  bits = bits.mod(q)\\\\n  var out = new Buffer(bits.toArray())\\\\n  if (out.length < q.byteLength()) {\\\\n    var zeros = new Buffer(q.byteLength() - out.length)\\\\n    zeros.fill(0)\\\\n    out = Buffer.concat([ zeros, out ])\\\\n  }\\\\n  return out\\\\n}\\\\n\\\\nfunction makeKey (q, kv, algo) {\\\\n  var t\\\\n  var k\\\\n\\\\n  do {\\\\n    t = new Buffer(0)\\\\n\\\\n    while (t.length * 8 < q.bitLength()) {\\\\n      kv.v = createHmac(algo, kv.k).update(kv.v).digest()\\\\n      t = Buffer.concat([ t, kv.v ])\\\\n    }\\\\n\\\\n    k = bits2int(t, q)\\\\n    kv.k = createHmac(algo, kv.k).update(kv.v).update(new Buffer([ 0 ])).digest()\\\\n    kv.v = createHmac(algo, kv.k).update(kv.v).digest()\\\\n  } while (k.cmp(q) !== -1)\\\\n\\\\n  return k\\\\n}\\\\n\\\\nfunction makeR (g, k, p, q) {\\\\n  return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q)\\\\n}\\\\n\\\\nmodule.exports = sign\\\\nmodule.exports.getKey = getKey\\\\nmodule.exports.makeKey = makeKey\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/browser/sign.js\\\\n// module id = 195\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/browser/sign.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {// much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js\\\\nvar BN = __webpack_require__(3)\\\\nvar EC = __webpack_require__(6).ec\\\\nvar parseKeys = __webpack_require__(54)\\\\nvar curves = __webpack_require__(104)\\\\n\\\\nfunction verify (sig, hash, key, signType, tag) {\\\\n  var pub = parseKeys(key)\\\\n  if (pub.type === \'ec\') {\\\\n    // rsa keys can be interpreted as ecdsa ones in openssl\\\\n    if (signType !== \'ecdsa\' && signType !== \'ecdsa/rsa\') throw new Error(\'wrong public key type\')\\\\n    return ecVerify(sig, hash, pub)\\\\n  } else if (pub.type === \'dsa\') {\\\\n    if (signType !== \'dsa\') throw new Error(\'wrong public key type\')\\\\n    return dsaVerify(sig, hash, pub)\\\\n  } else {\\\\n    if (signType !== \'rsa\' && signType !== \'ecdsa/rsa\') throw new Error(\'wrong public key type\')\\\\n  }\\\\n  hash = Buffer.concat([tag, hash])\\\\n  var len = pub.modulus.byteLength()\\\\n  var pad = [ 1 ]\\\\n  var padNum = 0\\\\n  while (hash.length + pad.length + 2 < len) {\\\\n    pad.push(0xff)\\\\n    padNum++\\\\n  }\\\\n  pad.push(0x00)\\\\n  var i = -1\\\\n  while (++i < hash.length) {\\\\n    pad.push(hash[i])\\\\n  }\\\\n  pad = new Buffer(pad)\\\\n  var red = BN.mont(pub.modulus)\\\\n  sig = new BN(sig).toRed(red)\\\\n\\\\n  sig = sig.redPow(new BN(pub.publicExponent))\\\\n  sig = new Buffer(sig.fromRed().toArray())\\\\n  var out = padNum < 8 ? 1 : 0\\\\n  len = Math.min(sig.length, pad.length)\\\\n  if (sig.length !== pad.length) out = 1\\\\n\\\\n  i = -1\\\\n  while (++i < len) out |= sig[i] ^ pad[i]\\\\n  return out === 0\\\\n}\\\\n\\\\nfunction ecVerify (sig, hash, pub) {\\\\n  var curveId = curves[pub.data.algorithm.curve.join(\'.\')]\\\\n  if (!curveId) throw new Error(\'unknown curve \' + pub.data.algorithm.curve.join(\'.\'))\\\\n\\\\n  var curve = new EC(curveId)\\\\n  var pubkey = pub.data.subjectPrivateKey.data\\\\n\\\\n  return curve.verify(hash, sig, pubkey)\\\\n}\\\\n\\\\nfunction dsaVerify (sig, hash, pub) {\\\\n  var p = pub.data.p\\\\n  var q = pub.data.q\\\\n  var g = pub.data.g\\\\n  var y = pub.data.pub_key\\\\n  var unpacked = parseKeys.signature.decode(sig, \'der\')\\\\n  var s = unpacked.s\\\\n  var r = unpacked.r\\\\n  checkValue(s, q)\\\\n  checkValue(r, q)\\\\n  var montp = BN.mont(p)\\\\n  var w = s.invm(q)\\\\n  var v = g.toRed(montp)\\\\n    .redPow(new BN(hash).mul(w).mod(q))\\\\n    .fromRed()\\\\n    .mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed())\\\\n    .mod(p)\\\\n    .mod(q)\\\\n  return v.cmp(r) === 0\\\\n}\\\\n\\\\nfunction checkValue (b, q) {\\\\n  if (b.cmpn(0) <= 0) throw new Error(\'invalid sig\')\\\\n  if (b.cmp(q) >= q) throw new Error(\'invalid sig\')\\\\n}\\\\n\\\\nmodule.exports = verify\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/browserify-sign/browser/verify.js\\\\n// module id = 196\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/browserify-sign/browser/verify.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(81);\\\\n__webpack_require__(225);\\\\nmodule.exports = __webpack_require__(11).Array.from;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/array/from.js\\\\n// module id = 197\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/array/from.js\\")},function(module,exports,__webpack_require__){eval(\\"var core = __webpack_require__(11);\\\\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\\\\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\\\\n  return $JSON.stringify.apply($JSON, arguments);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/json/stringify.js\\\\n// module id = 198\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/json/stringify.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(227);\\\\nmodule.exports = __webpack_require__(11).Object.assign;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/object/assign.js\\\\n// module id = 199\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/object/assign.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(228);\\\\nvar $Object = __webpack_require__(11).Object;\\\\nmodule.exports = function defineProperty(it, key, desc) {\\\\n  return $Object.defineProperty(it, key, desc);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/object/define-property.js\\\\n// module id = 200\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/object/define-property.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(122);\\\\n__webpack_require__(81);\\\\n__webpack_require__(123);\\\\n__webpack_require__(229);\\\\n__webpack_require__(231);\\\\n__webpack_require__(232);\\\\nmodule.exports = __webpack_require__(11).Promise;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/promise.js\\\\n// module id = 201\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/promise.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(230);\\\\n__webpack_require__(122);\\\\n__webpack_require__(233);\\\\n__webpack_require__(234);\\\\nmodule.exports = __webpack_require__(11).Symbol;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/symbol/index.js\\\\n// module id = 202\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/symbol/index.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(81);\\\\n__webpack_require__(123);\\\\nmodule.exports = __webpack_require__(80).f(\'iterator\');\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/fn/symbol/iterator.js\\\\n// module id = 203\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/fn/symbol/iterator.js\\")},function(module,exports){eval(\\"module.exports = function () { /* empty */ };\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_add-to-unscopables.js\\\\n// module id = 204\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_add-to-unscopables.js\\")},function(module,exports){eval(\\"module.exports = function (it, Constructor, name, forbiddenField) {\\\\n  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\\\\n    throw TypeError(name + \': incorrect invocation!\');\\\\n  } return it;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_an-instance.js\\\\n// module id = 205\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_an-instance.js\\")},function(module,exports,__webpack_require__){eval(\\"// false -> Array#indexOf\\\\n// true  -> Array#includes\\\\nvar toIObject = __webpack_require__(28);\\\\nvar toLength = __webpack_require__(76);\\\\nvar toAbsoluteIndex = __webpack_require__(224);\\\\nmodule.exports = function (IS_INCLUDES) {\\\\n  return function ($this, el, fromIndex) {\\\\n    var O = toIObject($this);\\\\n    var length = toLength(O.length);\\\\n    var index = toAbsoluteIndex(fromIndex, length);\\\\n    var value;\\\\n    // Array#includes uses SameValueZero equality algorithm\\\\n    // eslint-disable-next-line no-self-compare\\\\n    if (IS_INCLUDES && el != el) while (length > index) {\\\\n      value = O[index++];\\\\n      // eslint-disable-next-line no-self-compare\\\\n      if (value != value) return true;\\\\n    // Array#indexOf ignores holes, Array#includes - not\\\\n    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\\\\n      if (O[index] === el) return IS_INCLUDES || index || 0;\\\\n    } return !IS_INCLUDES && -1;\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_array-includes.js\\\\n// module id = 206\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_array-includes.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar $defineProperty = __webpack_require__(16);\\\\nvar createDesc = __webpack_require__(37);\\\\n\\\\nmodule.exports = function (object, index, value) {\\\\n  if (index in object) $defineProperty.f(object, index, createDesc(0, value));\\\\n  else object[index] = value;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_create-property.js\\\\n// module id = 207\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_create-property.js\\")},function(module,exports,__webpack_require__){eval(\\"// all enumerable object keys, includes symbols\\\\nvar getKeys = __webpack_require__(47);\\\\nvar gOPS = __webpack_require__(72);\\\\nvar pIE = __webpack_require__(48);\\\\nmodule.exports = function (it) {\\\\n  var result = getKeys(it);\\\\n  var getSymbols = gOPS.f;\\\\n  if (getSymbols) {\\\\n    var symbols = getSymbols(it);\\\\n    var isEnum = pIE.f;\\\\n    var i = 0;\\\\n    var key;\\\\n    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\\\\n  } return result;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_enum-keys.js\\\\n// module id = 208\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_enum-keys.js\\")},function(module,exports,__webpack_require__){eval(\\"var ctx = __webpack_require__(34);\\\\nvar call = __webpack_require__(110);\\\\nvar isArrayIter = __webpack_require__(109);\\\\nvar anObject = __webpack_require__(18);\\\\nvar toLength = __webpack_require__(76);\\\\nvar getIterFn = __webpack_require__(121);\\\\nvar BREAK = {};\\\\nvar RETURN = {};\\\\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\\\\n  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\\\\n  var f = ctx(fn, that, entries ? 2 : 1);\\\\n  var index = 0;\\\\n  var length, step, iterator, result;\\\\n  if (typeof iterFn != \'function\') throw TypeError(iterable + \' is not iterable!\');\\\\n  // fast case for arrays with default iterator\\\\n  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\\\\n    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\\\\n    if (result === BREAK || result === RETURN) return result;\\\\n  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\\\\n    result = call(iterator, f, step.value, entries);\\\\n    if (result === BREAK || result === RETURN) return result;\\\\n  }\\\\n};\\\\nexports.BREAK = BREAK;\\\\nexports.RETURN = RETURN;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_for-of.js\\\\n// module id = 209\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_for-of.js\\")},function(module,exports){eval(\\"// fast apply, http://jsperf.lnkit.com/fast-apply/5\\\\nmodule.exports = function (fn, args, that) {\\\\n  var un = that === undefined;\\\\n  switch (args.length) {\\\\n    case 0: return un ? fn()\\\\n                      : fn.call(that);\\\\n    case 1: return un ? fn(args[0])\\\\n                      : fn.call(that, args[0]);\\\\n    case 2: return un ? fn(args[0], args[1])\\\\n                      : fn.call(that, args[0], args[1]);\\\\n    case 3: return un ? fn(args[0], args[1], args[2])\\\\n                      : fn.call(that, args[0], args[1], args[2]);\\\\n    case 4: return un ? fn(args[0], args[1], args[2], args[3])\\\\n                      : fn.call(that, args[0], args[1], args[2], args[3]);\\\\n  } return fn.apply(that, args);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_invoke.js\\\\n// module id = 210\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_invoke.js\\")},function(module,exports,__webpack_require__){eval(\\"// 7.2.2 IsArray(argument)\\\\nvar cof = __webpack_require__(33);\\\\nmodule.exports = Array.isArray || function isArray(arg) {\\\\n  return cof(arg) == \'Array\';\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_is-array.js\\\\n// module id = 211\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_is-array.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar create = __webpack_require__(113);\\\\nvar descriptor = __webpack_require__(37);\\\\nvar setToStringTag = __webpack_require__(49);\\\\nvar IteratorPrototype = {};\\\\n\\\\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\\\\n__webpack_require__(22)(IteratorPrototype, __webpack_require__(9)(\'iterator\'), function () { return this; });\\\\n\\\\nmodule.exports = function (Constructor, NAME, next) {\\\\n  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\\\\n  setToStringTag(Constructor, NAME + \' Iterator\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iter-create.js\\\\n// module id = 212\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iter-create.js\\")},function(module,exports){eval(\\"module.exports = function (done, value) {\\\\n  return { value: value, done: !!done };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_iter-step.js\\\\n// module id = 213\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_iter-step.js\\")},function(module,exports,__webpack_require__){eval(\\"var META = __webpack_require__(50)(\'meta\');\\\\nvar isObject = __webpack_require__(23);\\\\nvar has = __webpack_require__(21);\\\\nvar setDesc = __webpack_require__(16).f;\\\\nvar id = 0;\\\\nvar isExtensible = Object.isExtensible || function () {\\\\n  return true;\\\\n};\\\\nvar FREEZE = !__webpack_require__(35)(function () {\\\\n  return isExtensible(Object.preventExtensions({}));\\\\n});\\\\nvar setMeta = function (it) {\\\\n  setDesc(it, META, { value: {\\\\n    i: \'O\' + ++id, // object ID\\\\n    w: {}          // weak collections IDs\\\\n  } });\\\\n};\\\\nvar fastKey = function (it, create) {\\\\n  // return primitive with prefix\\\\n  if (!isObject(it)) return typeof it == \'symbol\' ? it : (typeof it == \'string\' ? \'S\' : \'P\') + it;\\\\n  if (!has(it, META)) {\\\\n    // can\'t set metadata to uncaught frozen object\\\\n    if (!isExtensible(it)) return \'F\';\\\\n    // not necessary to add metadata\\\\n    if (!create) return \'E\';\\\\n    // add missing metadata\\\\n    setMeta(it);\\\\n  // return object ID\\\\n  } return it[META].i;\\\\n};\\\\nvar getWeak = function (it, create) {\\\\n  if (!has(it, META)) {\\\\n    // can\'t set metadata to uncaught frozen object\\\\n    if (!isExtensible(it)) return true;\\\\n    // not necessary to add metadata\\\\n    if (!create) return false;\\\\n    // add missing metadata\\\\n    setMeta(it);\\\\n  // return hash weak collections IDs\\\\n  } return it[META].w;\\\\n};\\\\n// add metadata on freeze-family methods calling\\\\nvar onFreeze = function (it) {\\\\n  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\\\\n  return it;\\\\n};\\\\nvar meta = module.exports = {\\\\n  KEY: META,\\\\n  NEED: false,\\\\n  fastKey: fastKey,\\\\n  getWeak: getWeak,\\\\n  onFreeze: onFreeze\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_meta.js\\\\n// module id = 214\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_meta.js\\")},function(module,exports,__webpack_require__){eval(\\"var global = __webpack_require__(8);\\\\nvar macrotask = __webpack_require__(120).set;\\\\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\\\\nvar process = global.process;\\\\nvar Promise = global.Promise;\\\\nvar isNode = __webpack_require__(33)(process) == \'process\';\\\\n\\\\nmodule.exports = function () {\\\\n  var head, last, notify;\\\\n\\\\n  var flush = function () {\\\\n    var parent, fn;\\\\n    if (isNode && (parent = process.domain)) parent.exit();\\\\n    while (head) {\\\\n      fn = head.fn;\\\\n      head = head.next;\\\\n      try {\\\\n        fn();\\\\n      } catch (e) {\\\\n        if (head) notify();\\\\n        else last = undefined;\\\\n        throw e;\\\\n      }\\\\n    } last = undefined;\\\\n    if (parent) parent.enter();\\\\n  };\\\\n\\\\n  // Node.js\\\\n  if (isNode) {\\\\n    notify = function () {\\\\n      process.nextTick(flush);\\\\n    };\\\\n  // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\\\\n  } else if (Observer && !(global.navigator && global.navigator.standalone)) {\\\\n    var toggle = true;\\\\n    var node = document.createTextNode(\'\');\\\\n    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\\\\n    notify = function () {\\\\n      node.data = toggle = !toggle;\\\\n    };\\\\n  // environments with maybe non-completely correct, but existent Promise\\\\n  } else if (Promise && Promise.resolve) {\\\\n    var promise = Promise.resolve();\\\\n    notify = function () {\\\\n      promise.then(flush);\\\\n    };\\\\n  // for other environments - macrotask based on:\\\\n  // - setImmediate\\\\n  // - MessageChannel\\\\n  // - window.postMessag\\\\n  // - onreadystatechange\\\\n  // - setTimeout\\\\n  } else {\\\\n    notify = function () {\\\\n      // strange IE + webpack dev server bug - use .call(global)\\\\n      macrotask.call(global, flush);\\\\n    };\\\\n  }\\\\n\\\\n  return function (fn) {\\\\n    var task = { fn: fn, next: undefined };\\\\n    if (last) last.next = task;\\\\n    if (!head) {\\\\n      head = task;\\\\n      notify();\\\\n    } last = task;\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_microtask.js\\\\n// module id = 215\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_microtask.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n// 19.1.2.1 Object.assign(target, source, ...)\\\\nvar getKeys = __webpack_require__(47);\\\\nvar gOPS = __webpack_require__(72);\\\\nvar pIE = __webpack_require__(48);\\\\nvar toObject = __webpack_require__(77);\\\\nvar IObject = __webpack_require__(108);\\\\nvar $assign = Object.assign;\\\\n\\\\n// should work with symbols and should have deterministic property order (V8 bug)\\\\nmodule.exports = !$assign || __webpack_require__(35)(function () {\\\\n  var A = {};\\\\n  var B = {};\\\\n  // eslint-disable-next-line no-undef\\\\n  var S = Symbol();\\\\n  var K = \'abcdefghijklmnopqrst\';\\\\n  A[S] = 7;\\\\n  K.split(\'\').forEach(function (k) { B[k] = k; });\\\\n  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join(\'\') != K;\\\\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\\\\n  var T = toObject(target);\\\\n  var aLen = arguments.length;\\\\n  var index = 1;\\\\n  var getSymbols = gOPS.f;\\\\n  var isEnum = pIE.f;\\\\n  while (aLen > index) {\\\\n    var S = IObject(arguments[index++]);\\\\n    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\\\\n    var length = keys.length;\\\\n    var j = 0;\\\\n    var key;\\\\n    while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\\\\n  } return T;\\\\n} : $assign;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-assign.js\\\\n// module id = 216\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-assign.js\\")},function(module,exports,__webpack_require__){eval(\\"var dP = __webpack_require__(16);\\\\nvar anObject = __webpack_require__(18);\\\\nvar getKeys = __webpack_require__(47);\\\\n\\\\nmodule.exports = __webpack_require__(19) ? Object.defineProperties : function defineProperties(O, Properties) {\\\\n  anObject(O);\\\\n  var keys = getKeys(Properties);\\\\n  var length = keys.length;\\\\n  var i = 0;\\\\n  var P;\\\\n  while (length > i) dP.f(O, P = keys[i++], Properties[P]);\\\\n  return O;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-dps.js\\\\n// module id = 217\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-dps.js\\")},function(module,exports,__webpack_require__){eval(\\"var pIE = __webpack_require__(48);\\\\nvar createDesc = __webpack_require__(37);\\\\nvar toIObject = __webpack_require__(28);\\\\nvar toPrimitive = __webpack_require__(78);\\\\nvar has = __webpack_require__(21);\\\\nvar IE8_DOM_DEFINE = __webpack_require__(107);\\\\nvar gOPD = Object.getOwnPropertyDescriptor;\\\\n\\\\nexports.f = __webpack_require__(19) ? gOPD : function getOwnPropertyDescriptor(O, P) {\\\\n  O = toIObject(O);\\\\n  P = toPrimitive(P, true);\\\\n  if (IE8_DOM_DEFINE) try {\\\\n    return gOPD(O, P);\\\\n  } catch (e) { /* empty */ }\\\\n  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-gopd.js\\\\n// module id = 218\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopd.js\\")},function(module,exports,__webpack_require__){eval(\\"// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\\\\nvar toIObject = __webpack_require__(28);\\\\nvar gOPN = __webpack_require__(114).f;\\\\nvar toString = {}.toString;\\\\n\\\\nvar windowNames = typeof window == \'object\' && window && Object.getOwnPropertyNames\\\\n  ? Object.getOwnPropertyNames(window) : [];\\\\n\\\\nvar getWindowNames = function (it) {\\\\n  try {\\\\n    return gOPN(it);\\\\n  } catch (e) {\\\\n    return windowNames.slice();\\\\n  }\\\\n};\\\\n\\\\nmodule.exports.f = function getOwnPropertyNames(it) {\\\\n  return windowNames && toString.call(it) == \'[object Window]\' ? getWindowNames(it) : gOPN(toIObject(it));\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-gopn-ext.js\\\\n// module id = 219\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-gopn-ext.js\\")},function(module,exports,__webpack_require__){eval(\\"// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\\\\nvar has = __webpack_require__(21);\\\\nvar toObject = __webpack_require__(77);\\\\nvar IE_PROTO = __webpack_require__(73)(\'IE_PROTO\');\\\\nvar ObjectProto = Object.prototype;\\\\n\\\\nmodule.exports = Object.getPrototypeOf || function (O) {\\\\n  O = toObject(O);\\\\n  if (has(O, IE_PROTO)) return O[IE_PROTO];\\\\n  if (typeof O.constructor == \'function\' && O instanceof O.constructor) {\\\\n    return O.constructor.prototype;\\\\n  } return O instanceof Object ? ObjectProto : null;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_object-gpo.js\\\\n// module id = 220\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_object-gpo.js\\")},function(module,exports,__webpack_require__){eval(\\"var hide = __webpack_require__(22);\\\\nmodule.exports = function (target, src, safe) {\\\\n  for (var key in src) {\\\\n    if (safe && target[key]) target[key] = src[key];\\\\n    else hide(target, key, src[key]);\\\\n  } return target;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_redefine-all.js\\\\n// module id = 221\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_redefine-all.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar global = __webpack_require__(8);\\\\nvar core = __webpack_require__(11);\\\\nvar dP = __webpack_require__(16);\\\\nvar DESCRIPTORS = __webpack_require__(19);\\\\nvar SPECIES = __webpack_require__(9)(\'species\');\\\\n\\\\nmodule.exports = function (KEY) {\\\\n  var C = typeof core[KEY] == \'function\' ? core[KEY] : global[KEY];\\\\n  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\\\\n    configurable: true,\\\\n    get: function () { return this; }\\\\n  });\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_set-species.js\\\\n// module id = 222\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_set-species.js\\")},function(module,exports,__webpack_require__){eval(\\"var toInteger = __webpack_require__(75);\\\\nvar defined = __webpack_require__(68);\\\\n// true  -> String#at\\\\n// false -> String#codePointAt\\\\nmodule.exports = function (TO_STRING) {\\\\n  return function (that, pos) {\\\\n    var s = String(defined(that));\\\\n    var i = toInteger(pos);\\\\n    var l = s.length;\\\\n    var a, b;\\\\n    if (i < 0 || i >= l) return TO_STRING ? \'\' : undefined;\\\\n    a = s.charCodeAt(i);\\\\n    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\\\\n      ? TO_STRING ? s.charAt(i) : a\\\\n      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_string-at.js\\\\n// module id = 223\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_string-at.js\\")},function(module,exports,__webpack_require__){eval(\\"var toInteger = __webpack_require__(75);\\\\nvar max = Math.max;\\\\nvar min = Math.min;\\\\nmodule.exports = function (index, length) {\\\\n  index = toInteger(index);\\\\n  return index < 0 ? max(index + length, 0) : min(index, length);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/_to-absolute-index.js\\\\n// module id = 224\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/_to-absolute-index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar ctx = __webpack_require__(34);\\\\nvar $export = __webpack_require__(20);\\\\nvar toObject = __webpack_require__(77);\\\\nvar call = __webpack_require__(110);\\\\nvar isArrayIter = __webpack_require__(109);\\\\nvar toLength = __webpack_require__(76);\\\\nvar createProperty = __webpack_require__(207);\\\\nvar getIterFn = __webpack_require__(121);\\\\n\\\\n$export($export.S + $export.F * !__webpack_require__(112)(function (iter) { Array.from(iter); }), \'Array\', {\\\\n  // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\\\\n  from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\\\\n    var O = toObject(arrayLike);\\\\n    var C = typeof this == \'function\' ? this : Array;\\\\n    var aLen = arguments.length;\\\\n    var mapfn = aLen > 1 ? arguments[1] : undefined;\\\\n    var mapping = mapfn !== undefined;\\\\n    var index = 0;\\\\n    var iterFn = getIterFn(O);\\\\n    var length, result, step, iterator;\\\\n    if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\\\\n    // if object isn\'t iterable or it\'s array with default iterator - use simple case\\\\n    if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\\\\n      for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\\\\n        createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\\\\n      }\\\\n    } else {\\\\n      length = toLength(O.length);\\\\n      for (result = new C(length); length > index; index++) {\\\\n        createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\\\\n      }\\\\n    }\\\\n    result.length = index;\\\\n    return result;\\\\n  }\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.array.from.js\\\\n// module id = 225\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.array.from.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar addToUnscopables = __webpack_require__(204);\\\\nvar step = __webpack_require__(213);\\\\nvar Iterators = __webpack_require__(36);\\\\nvar toIObject = __webpack_require__(28);\\\\n\\\\n// 22.1.3.4 Array.prototype.entries()\\\\n// 22.1.3.13 Array.prototype.keys()\\\\n// 22.1.3.29 Array.prototype.values()\\\\n// 22.1.3.30 Array.prototype[@@iterator]()\\\\nmodule.exports = __webpack_require__(111)(Array, \'Array\', function (iterated, kind) {\\\\n  this._t = toIObject(iterated); // target\\\\n  this._i = 0;                   // next index\\\\n  this._k = kind;                // kind\\\\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\\\\n}, function () {\\\\n  var O = this._t;\\\\n  var kind = this._k;\\\\n  var index = this._i++;\\\\n  if (!O || index >= O.length) {\\\\n    this._t = undefined;\\\\n    return step(1);\\\\n  }\\\\n  if (kind == \'keys\') return step(0, index);\\\\n  if (kind == \'values\') return step(0, O[index]);\\\\n  return step(0, [index, O[index]]);\\\\n}, \'values\');\\\\n\\\\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\\\\nIterators.Arguments = Iterators.Array;\\\\n\\\\naddToUnscopables(\'keys\');\\\\naddToUnscopables(\'values\');\\\\naddToUnscopables(\'entries\');\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.array.iterator.js\\\\n// module id = 226\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.array.iterator.js\\")},function(module,exports,__webpack_require__){eval(\\"// 19.1.3.1 Object.assign(target, source)\\\\nvar $export = __webpack_require__(20);\\\\n\\\\n$export($export.S + $export.F, \'Object\', { assign: __webpack_require__(216) });\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.object.assign.js\\\\n// module id = 227\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.assign.js\\")},function(module,exports,__webpack_require__){eval(\\"var $export = __webpack_require__(20);\\\\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\\\\n$export($export.S + $export.F * !__webpack_require__(19), \'Object\', { defineProperty: __webpack_require__(16).f });\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.object.define-property.js\\\\n// module id = 228\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.object.define-property.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar LIBRARY = __webpack_require__(46);\\\\nvar global = __webpack_require__(8);\\\\nvar ctx = __webpack_require__(34);\\\\nvar classof = __webpack_require__(105);\\\\nvar $export = __webpack_require__(20);\\\\nvar isObject = __webpack_require__(23);\\\\nvar aFunction = __webpack_require__(45);\\\\nvar anInstance = __webpack_require__(205);\\\\nvar forOf = __webpack_require__(209);\\\\nvar speciesConstructor = __webpack_require__(119);\\\\nvar task = __webpack_require__(120).set;\\\\nvar microtask = __webpack_require__(215)();\\\\nvar newPromiseCapabilityModule = __webpack_require__(71);\\\\nvar perform = __webpack_require__(116);\\\\nvar promiseResolve = __webpack_require__(117);\\\\nvar PROMISE = \'Promise\';\\\\nvar TypeError = global.TypeError;\\\\nvar process = global.process;\\\\nvar $Promise = global[PROMISE];\\\\nvar isNode = classof(process) == \'process\';\\\\nvar empty = function () { /* empty */ };\\\\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\\\\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\\\\n\\\\nvar USE_NATIVE = !!function () {\\\\n  try {\\\\n    // correct subclassing with @@species support\\\\n    var promise = $Promise.resolve(1);\\\\n    var FakePromise = (promise.constructor = {})[__webpack_require__(9)(\'species\')] = function (exec) {\\\\n      exec(empty, empty);\\\\n    };\\\\n    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\\\\n    return (isNode || typeof PromiseRejectionEvent == \'function\') && promise.then(empty) instanceof FakePromise;\\\\n  } catch (e) { /* empty */ }\\\\n}();\\\\n\\\\n// helpers\\\\nvar isThenable = function (it) {\\\\n  var then;\\\\n  return isObject(it) && typeof (then = it.then) == \'function\' ? then : false;\\\\n};\\\\nvar notify = function (promise, isReject) {\\\\n  if (promise._n) return;\\\\n  promise._n = true;\\\\n  var chain = promise._c;\\\\n  microtask(function () {\\\\n    var value = promise._v;\\\\n    var ok = promise._s == 1;\\\\n    var i = 0;\\\\n    var run = function (reaction) {\\\\n      var handler = ok ? reaction.ok : reaction.fail;\\\\n      var resolve = reaction.resolve;\\\\n      var reject = reaction.reject;\\\\n      var domain = reaction.domain;\\\\n      var result, then, exited;\\\\n      try {\\\\n        if (handler) {\\\\n          if (!ok) {\\\\n            if (promise._h == 2) onHandleUnhandled(promise);\\\\n            promise._h = 1;\\\\n          }\\\\n          if (handler === true) result = value;\\\\n          else {\\\\n            if (domain) domain.enter();\\\\n            result = handler(value); // may throw\\\\n            if (domain) {\\\\n              domain.exit();\\\\n              exited = true;\\\\n            }\\\\n          }\\\\n          if (result === reaction.promise) {\\\\n            reject(TypeError(\'Promise-chain cycle\'));\\\\n          } else if (then = isThenable(result)) {\\\\n            then.call(result, resolve, reject);\\\\n          } else resolve(result);\\\\n        } else reject(value);\\\\n      } catch (e) {\\\\n        if (domain && !exited) domain.exit();\\\\n        reject(e);\\\\n      }\\\\n    };\\\\n    while (chain.length > i) run(chain[i++]); // variable length - can\'t use forEach\\\\n    promise._c = [];\\\\n    promise._n = false;\\\\n    if (isReject && !promise._h) onUnhandled(promise);\\\\n  });\\\\n};\\\\nvar onUnhandled = function (promise) {\\\\n  task.call(global, function () {\\\\n    var value = promise._v;\\\\n    var unhandled = isUnhandled(promise);\\\\n    var result, handler, console;\\\\n    if (unhandled) {\\\\n      result = perform(function () {\\\\n        if (isNode) {\\\\n          process.emit(\'unhandledRejection\', value, promise);\\\\n        } else if (handler = global.onunhandledrejection) {\\\\n          handler({ promise: promise, reason: value });\\\\n        } else if ((console = global.console) && console.error) {\\\\n          console.error(\'Unhandled promise rejection\', value);\\\\n        }\\\\n      });\\\\n      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\\\\n      promise._h = isNode || isUnhandled(promise) ? 2 : 1;\\\\n    } promise._a = undefined;\\\\n    if (unhandled && result.e) throw result.v;\\\\n  });\\\\n};\\\\nvar isUnhandled = function (promise) {\\\\n  return promise._h !== 1 && (promise._a || promise._c).length === 0;\\\\n};\\\\nvar onHandleUnhandled = function (promise) {\\\\n  task.call(global, function () {\\\\n    var handler;\\\\n    if (isNode) {\\\\n      process.emit(\'rejectionHandled\', promise);\\\\n    } else if (handler = global.onrejectionhandled) {\\\\n      handler({ promise: promise, reason: promise._v });\\\\n    }\\\\n  });\\\\n};\\\\nvar $reject = function (value) {\\\\n  var promise = this;\\\\n  if (promise._d) return;\\\\n  promise._d = true;\\\\n  promise = promise._w || promise; // unwrap\\\\n  promise._v = value;\\\\n  promise._s = 2;\\\\n  if (!promise._a) promise._a = promise._c.slice();\\\\n  notify(promise, true);\\\\n};\\\\nvar $resolve = function (value) {\\\\n  var promise = this;\\\\n  var then;\\\\n  if (promise._d) return;\\\\n  promise._d = true;\\\\n  promise = promise._w || promise; // unwrap\\\\n  try {\\\\n    if (promise === value) throw TypeError(\\\\\\"Promise can\'t be resolved itself\\\\\\");\\\\n    if (then = isThenable(value)) {\\\\n      microtask(function () {\\\\n        var wrapper = { _w: promise, _d: false }; // wrap\\\\n        try {\\\\n          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\\\\n        } catch (e) {\\\\n          $reject.call(wrapper, e);\\\\n        }\\\\n      });\\\\n    } else {\\\\n      promise._v = value;\\\\n      promise._s = 1;\\\\n      notify(promise, false);\\\\n    }\\\\n  } catch (e) {\\\\n    $reject.call({ _w: promise, _d: false }, e); // wrap\\\\n  }\\\\n};\\\\n\\\\n// constructor polyfill\\\\nif (!USE_NATIVE) {\\\\n  // 25.4.3.1 Promise(executor)\\\\n  $Promise = function Promise(executor) {\\\\n    anInstance(this, $Promise, PROMISE, \'_h\');\\\\n    aFunction(executor);\\\\n    Internal.call(this);\\\\n    try {\\\\n      executor(ctx($resolve, this, 1), ctx($reject, this, 1));\\\\n    } catch (err) {\\\\n      $reject.call(this, err);\\\\n    }\\\\n  };\\\\n  // eslint-disable-next-line no-unused-vars\\\\n  Internal = function Promise(executor) {\\\\n    this._c = [];             // <- awaiting reactions\\\\n    this._a = undefined;      // <- checked in isUnhandled reactions\\\\n    this._s = 0;              // <- state\\\\n    this._d = false;          // <- done\\\\n    this._v = undefined;      // <- value\\\\n    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\\\\n    this._n = false;          // <- notify\\\\n  };\\\\n  Internal.prototype = __webpack_require__(221)($Promise.prototype, {\\\\n    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\\\\n    then: function then(onFulfilled, onRejected) {\\\\n      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\\\\n      reaction.ok = typeof onFulfilled == \'function\' ? onFulfilled : true;\\\\n      reaction.fail = typeof onRejected == \'function\' && onRejected;\\\\n      reaction.domain = isNode ? process.domain : undefined;\\\\n      this._c.push(reaction);\\\\n      if (this._a) this._a.push(reaction);\\\\n      if (this._s) notify(this, false);\\\\n      return reaction.promise;\\\\n    },\\\\n    // 25.4.5.1 Promise.prototype.catch(onRejected)\\\\n    \'catch\': function (onRejected) {\\\\n      return this.then(undefined, onRejected);\\\\n    }\\\\n  });\\\\n  OwnPromiseCapability = function () {\\\\n    var promise = new Internal();\\\\n    this.promise = promise;\\\\n    this.resolve = ctx($resolve, promise, 1);\\\\n    this.reject = ctx($reject, promise, 1);\\\\n  };\\\\n  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\\\\n    return C === $Promise || C === Wrapper\\\\n      ? new OwnPromiseCapability(C)\\\\n      : newGenericPromiseCapability(C);\\\\n  };\\\\n}\\\\n\\\\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\\\\n__webpack_require__(49)($Promise, PROMISE);\\\\n__webpack_require__(222)(PROMISE);\\\\nWrapper = __webpack_require__(11)[PROMISE];\\\\n\\\\n// statics\\\\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\\\\n  // 25.4.4.5 Promise.reject(r)\\\\n  reject: function reject(r) {\\\\n    var capability = newPromiseCapability(this);\\\\n    var $$reject = capability.reject;\\\\n    $$reject(r);\\\\n    return capability.promise;\\\\n  }\\\\n});\\\\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\\\\n  // 25.4.4.6 Promise.resolve(x)\\\\n  resolve: function resolve(x) {\\\\n    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\\\\n  }\\\\n});\\\\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(112)(function (iter) {\\\\n  $Promise.all(iter)[\'catch\'](empty);\\\\n})), PROMISE, {\\\\n  // 25.4.4.1 Promise.all(iterable)\\\\n  all: function all(iterable) {\\\\n    var C = this;\\\\n    var capability = newPromiseCapability(C);\\\\n    var resolve = capability.resolve;\\\\n    var reject = capability.reject;\\\\n    var result = perform(function () {\\\\n      var values = [];\\\\n      var index = 0;\\\\n      var remaining = 1;\\\\n      forOf(iterable, false, function (promise) {\\\\n        var $index = index++;\\\\n        var alreadyCalled = false;\\\\n        values.push(undefined);\\\\n        remaining++;\\\\n        C.resolve(promise).then(function (value) {\\\\n          if (alreadyCalled) return;\\\\n          alreadyCalled = true;\\\\n          values[$index] = value;\\\\n          --remaining || resolve(values);\\\\n        }, reject);\\\\n      });\\\\n      --remaining || resolve(values);\\\\n    });\\\\n    if (result.e) reject(result.v);\\\\n    return capability.promise;\\\\n  },\\\\n  // 25.4.4.4 Promise.race(iterable)\\\\n  race: function race(iterable) {\\\\n    var C = this;\\\\n    var capability = newPromiseCapability(C);\\\\n    var reject = capability.reject;\\\\n    var result = perform(function () {\\\\n      forOf(iterable, false, function (promise) {\\\\n        C.resolve(promise).then(capability.resolve, reject);\\\\n      });\\\\n    });\\\\n    if (result.e) reject(result.v);\\\\n    return capability.promise;\\\\n  }\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.promise.js\\\\n// module id = 229\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.promise.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n// ECMAScript 6 symbols shim\\\\nvar global = __webpack_require__(8);\\\\nvar has = __webpack_require__(21);\\\\nvar DESCRIPTORS = __webpack_require__(19);\\\\nvar $export = __webpack_require__(20);\\\\nvar redefine = __webpack_require__(118);\\\\nvar META = __webpack_require__(214).KEY;\\\\nvar $fails = __webpack_require__(35);\\\\nvar shared = __webpack_require__(74);\\\\nvar setToStringTag = __webpack_require__(49);\\\\nvar uid = __webpack_require__(50);\\\\nvar wks = __webpack_require__(9);\\\\nvar wksExt = __webpack_require__(80);\\\\nvar wksDefine = __webpack_require__(79);\\\\nvar enumKeys = __webpack_require__(208);\\\\nvar isArray = __webpack_require__(211);\\\\nvar anObject = __webpack_require__(18);\\\\nvar isObject = __webpack_require__(23);\\\\nvar toIObject = __webpack_require__(28);\\\\nvar toPrimitive = __webpack_require__(78);\\\\nvar createDesc = __webpack_require__(37);\\\\nvar _create = __webpack_require__(113);\\\\nvar gOPNExt = __webpack_require__(219);\\\\nvar $GOPD = __webpack_require__(218);\\\\nvar $DP = __webpack_require__(16);\\\\nvar $keys = __webpack_require__(47);\\\\nvar gOPD = $GOPD.f;\\\\nvar dP = $DP.f;\\\\nvar gOPN = gOPNExt.f;\\\\nvar $Symbol = global.Symbol;\\\\nvar $JSON = global.JSON;\\\\nvar _stringify = $JSON && $JSON.stringify;\\\\nvar PROTOTYPE = \'prototype\';\\\\nvar HIDDEN = wks(\'_hidden\');\\\\nvar TO_PRIMITIVE = wks(\'toPrimitive\');\\\\nvar isEnum = {}.propertyIsEnumerable;\\\\nvar SymbolRegistry = shared(\'symbol-registry\');\\\\nvar AllSymbols = shared(\'symbols\');\\\\nvar OPSymbols = shared(\'op-symbols\');\\\\nvar ObjectProto = Object[PROTOTYPE];\\\\nvar USE_NATIVE = typeof $Symbol == \'function\';\\\\nvar QObject = global.QObject;\\\\n// Don\'t use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\\\\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\\\\n\\\\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\\\\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\\\\n  return _create(dP({}, \'a\', {\\\\n    get: function () { return dP(this, \'a\', { value: 7 }).a; }\\\\n  })).a != 7;\\\\n}) ? function (it, key, D) {\\\\n  var protoDesc = gOPD(ObjectProto, key);\\\\n  if (protoDesc) delete ObjectProto[key];\\\\n  dP(it, key, D);\\\\n  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\\\\n} : dP;\\\\n\\\\nvar wrap = function (tag) {\\\\n  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\\\\n  sym._k = tag;\\\\n  return sym;\\\\n};\\\\n\\\\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == \'symbol\' ? function (it) {\\\\n  return typeof it == \'symbol\';\\\\n} : function (it) {\\\\n  return it instanceof $Symbol;\\\\n};\\\\n\\\\nvar $defineProperty = function defineProperty(it, key, D) {\\\\n  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\\\\n  anObject(it);\\\\n  key = toPrimitive(key, true);\\\\n  anObject(D);\\\\n  if (has(AllSymbols, key)) {\\\\n    if (!D.enumerable) {\\\\n      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\\\\n      it[HIDDEN][key] = true;\\\\n    } else {\\\\n      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\\\\n      D = _create(D, { enumerable: createDesc(0, false) });\\\\n    } return setSymbolDesc(it, key, D);\\\\n  } return dP(it, key, D);\\\\n};\\\\nvar $defineProperties = function defineProperties(it, P) {\\\\n  anObject(it);\\\\n  var keys = enumKeys(P = toIObject(P));\\\\n  var i = 0;\\\\n  var l = keys.length;\\\\n  var key;\\\\n  while (l > i) $defineProperty(it, key = keys[i++], P[key]);\\\\n  return it;\\\\n};\\\\nvar $create = function create(it, P) {\\\\n  return P === undefined ? _create(it) : $defineProperties(_create(it), P);\\\\n};\\\\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\\\\n  var E = isEnum.call(this, key = toPrimitive(key, true));\\\\n  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\\\\n  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\\\\n};\\\\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\\\\n  it = toIObject(it);\\\\n  key = toPrimitive(key, true);\\\\n  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\\\\n  var D = gOPD(it, key);\\\\n  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\\\\n  return D;\\\\n};\\\\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\\\\n  var names = gOPN(toIObject(it));\\\\n  var result = [];\\\\n  var i = 0;\\\\n  var key;\\\\n  while (names.length > i) {\\\\n    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\\\\n  } return result;\\\\n};\\\\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\\\\n  var IS_OP = it === ObjectProto;\\\\n  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\\\\n  var result = [];\\\\n  var i = 0;\\\\n  var key;\\\\n  while (names.length > i) {\\\\n    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\\\\n  } return result;\\\\n};\\\\n\\\\n// 19.4.1.1 Symbol([description])\\\\nif (!USE_NATIVE) {\\\\n  $Symbol = function Symbol() {\\\\n    if (this instanceof $Symbol) throw TypeError(\'Symbol is not a constructor!\');\\\\n    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\\\\n    var $set = function (value) {\\\\n      if (this === ObjectProto) $set.call(OPSymbols, value);\\\\n      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\\\\n      setSymbolDesc(this, tag, createDesc(1, value));\\\\n    };\\\\n    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\\\\n    return wrap(tag);\\\\n  };\\\\n  redefine($Symbol[PROTOTYPE], \'toString\', function toString() {\\\\n    return this._k;\\\\n  });\\\\n\\\\n  $GOPD.f = $getOwnPropertyDescriptor;\\\\n  $DP.f = $defineProperty;\\\\n  __webpack_require__(114).f = gOPNExt.f = $getOwnPropertyNames;\\\\n  __webpack_require__(48).f = $propertyIsEnumerable;\\\\n  __webpack_require__(72).f = $getOwnPropertySymbols;\\\\n\\\\n  if (DESCRIPTORS && !__webpack_require__(46)) {\\\\n    redefine(ObjectProto, \'propertyIsEnumerable\', $propertyIsEnumerable, true);\\\\n  }\\\\n\\\\n  wksExt.f = function (name) {\\\\n    return wrap(wks(name));\\\\n  };\\\\n}\\\\n\\\\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\\\\n\\\\nfor (var es6Symbols = (\\\\n  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\\\\n  \'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables\'\\\\n).split(\',\'), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\\\\n\\\\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\\\\n\\\\n$export($export.S + $export.F * !USE_NATIVE, \'Symbol\', {\\\\n  // 19.4.2.1 Symbol.for(key)\\\\n  \'for\': function (key) {\\\\n    return has(SymbolRegistry, key += \'\')\\\\n      ? SymbolRegistry[key]\\\\n      : SymbolRegistry[key] = $Symbol(key);\\\\n  },\\\\n  // 19.4.2.5 Symbol.keyFor(sym)\\\\n  keyFor: function keyFor(sym) {\\\\n    if (!isSymbol(sym)) throw TypeError(sym + \' is not a symbol!\');\\\\n    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\\\\n  },\\\\n  useSetter: function () { setter = true; },\\\\n  useSimple: function () { setter = false; }\\\\n});\\\\n\\\\n$export($export.S + $export.F * !USE_NATIVE, \'Object\', {\\\\n  // 19.1.2.2 Object.create(O [, Properties])\\\\n  create: $create,\\\\n  // 19.1.2.4 Object.defineProperty(O, P, Attributes)\\\\n  defineProperty: $defineProperty,\\\\n  // 19.1.2.3 Object.defineProperties(O, Properties)\\\\n  defineProperties: $defineProperties,\\\\n  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\\\\n  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\\\\n  // 19.1.2.7 Object.getOwnPropertyNames(O)\\\\n  getOwnPropertyNames: $getOwnPropertyNames,\\\\n  // 19.1.2.8 Object.getOwnPropertySymbols(O)\\\\n  getOwnPropertySymbols: $getOwnPropertySymbols\\\\n});\\\\n\\\\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\\\\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\\\\n  var S = $Symbol();\\\\n  // MS Edge converts symbol values to JSON as {}\\\\n  // WebKit converts symbol values to JSON as null\\\\n  // V8 throws on boxed symbols\\\\n  return _stringify([S]) != \'[null]\' || _stringify({ a: S }) != \'{}\' || _stringify(Object(S)) != \'{}\';\\\\n})), \'JSON\', {\\\\n  stringify: function stringify(it) {\\\\n    var args = [it];\\\\n    var i = 1;\\\\n    var replacer, $replacer;\\\\n    while (arguments.length > i) args.push(arguments[i++]);\\\\n    $replacer = replacer = args[1];\\\\n    if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\\\\n    if (!isArray(replacer)) replacer = function (key, value) {\\\\n      if (typeof $replacer == \'function\') value = $replacer.call(this, key, value);\\\\n      if (!isSymbol(value)) return value;\\\\n    };\\\\n    args[1] = replacer;\\\\n    return _stringify.apply($JSON, args);\\\\n  }\\\\n});\\\\n\\\\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\\\\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(22)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\\\\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\\\\nsetToStringTag($Symbol, \'Symbol\');\\\\n// 20.2.1.9 Math[@@toStringTag]\\\\nsetToStringTag(Math, \'Math\', true);\\\\n// 24.3.3 JSON[@@toStringTag]\\\\nsetToStringTag(global.JSON, \'JSON\', true);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es6.symbol.js\\\\n// module id = 230\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es6.symbol.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// https://github.com/tc39/proposal-promise-finally\\\\n\\\\nvar $export = __webpack_require__(20);\\\\nvar core = __webpack_require__(11);\\\\nvar global = __webpack_require__(8);\\\\nvar speciesConstructor = __webpack_require__(119);\\\\nvar promiseResolve = __webpack_require__(117);\\\\n\\\\n$export($export.P + $export.R, \'Promise\', { \'finally\': function (onFinally) {\\\\n  var C = speciesConstructor(this, core.Promise || global.Promise);\\\\n  var isFunction = typeof onFinally == \'function\';\\\\n  return this.then(\\\\n    isFunction ? function (x) {\\\\n      return promiseResolve(C, onFinally()).then(function () { return x; });\\\\n    } : onFinally,\\\\n    isFunction ? function (e) {\\\\n      return promiseResolve(C, onFinally()).then(function () { throw e; });\\\\n    } : onFinally\\\\n  );\\\\n} });\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es7.promise.finally.js\\\\n// module id = 231\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es7.promise.finally.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n// https://github.com/tc39/proposal-promise-try\\\\nvar $export = __webpack_require__(20);\\\\nvar newPromiseCapability = __webpack_require__(71);\\\\nvar perform = __webpack_require__(116);\\\\n\\\\n$export($export.S, \'Promise\', { \'try\': function (callbackfn) {\\\\n  var promiseCapability = newPromiseCapability.f(this);\\\\n  var result = perform(callbackfn);\\\\n  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\\\\n  return promiseCapability.promise;\\\\n} });\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es7.promise.try.js\\\\n// module id = 232\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es7.promise.try.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(79)(\'asyncIterator\');\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es7.symbol.async-iterator.js\\\\n// module id = 233\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es7.symbol.async-iterator.js\\")},function(module,exports,__webpack_require__){eval(\\"__webpack_require__(79)(\'observable\');\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/core-js/library/modules/es7.symbol.observable.js\\\\n// module id = 234\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/core-js/library/modules/es7.symbol.observable.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var elliptic = __webpack_require__(6);\\\\nvar BN = __webpack_require__(3);\\\\n\\\\nmodule.exports = function createECDH(curve) {\\\\n\\\\treturn new ECDH(curve);\\\\n};\\\\n\\\\nvar aliases = {\\\\n\\\\tsecp256k1: {\\\\n\\\\t\\\\tname: \'secp256k1\',\\\\n\\\\t\\\\tbyteLength: 32\\\\n\\\\t},\\\\n\\\\tsecp224r1: {\\\\n\\\\t\\\\tname: \'p224\',\\\\n\\\\t\\\\tbyteLength: 28\\\\n\\\\t},\\\\n\\\\tprime256v1: {\\\\n\\\\t\\\\tname: \'p256\',\\\\n\\\\t\\\\tbyteLength: 32\\\\n\\\\t},\\\\n\\\\tprime192v1: {\\\\n\\\\t\\\\tname: \'p192\',\\\\n\\\\t\\\\tbyteLength: 24\\\\n\\\\t},\\\\n\\\\ted25519: {\\\\n\\\\t\\\\tname: \'ed25519\',\\\\n\\\\t\\\\tbyteLength: 32\\\\n\\\\t},\\\\n\\\\tsecp384r1: {\\\\n\\\\t\\\\tname: \'p384\',\\\\n\\\\t\\\\tbyteLength: 48\\\\n\\\\t},\\\\n\\\\tsecp521r1: {\\\\n\\\\t\\\\tname: \'p521\',\\\\n\\\\t\\\\tbyteLength: 66\\\\n\\\\t}\\\\n};\\\\n\\\\naliases.p224 = aliases.secp224r1;\\\\naliases.p256 = aliases.secp256r1 = aliases.prime256v1;\\\\naliases.p192 = aliases.secp192r1 = aliases.prime192v1;\\\\naliases.p384 = aliases.secp384r1;\\\\naliases.p521 = aliases.secp521r1;\\\\n\\\\nfunction ECDH(curve) {\\\\n\\\\tthis.curveType = aliases[curve];\\\\n\\\\tif (!this.curveType ) {\\\\n\\\\t\\\\tthis.curveType = {\\\\n\\\\t\\\\t\\\\tname: curve\\\\n\\\\t\\\\t};\\\\n\\\\t}\\\\n\\\\tthis.curve = new elliptic.ec(this.curveType.name);\\\\n\\\\tthis.keys = void 0;\\\\n}\\\\n\\\\nECDH.prototype.generateKeys = function (enc, format) {\\\\n\\\\tthis.keys = this.curve.genKeyPair();\\\\n\\\\treturn this.getPublicKey(enc, format);\\\\n};\\\\n\\\\nECDH.prototype.computeSecret = function (other, inenc, enc) {\\\\n\\\\tinenc = inenc || \'utf8\';\\\\n\\\\tif (!Buffer.isBuffer(other)) {\\\\n\\\\t\\\\tother = new Buffer(other, inenc);\\\\n\\\\t}\\\\n\\\\tvar otherPub = this.curve.keyFromPublic(other).getPublic();\\\\n\\\\tvar out = otherPub.mul(this.keys.getPrivate()).getX();\\\\n\\\\treturn formatReturnValue(out, enc, this.curveType.byteLength);\\\\n};\\\\n\\\\nECDH.prototype.getPublicKey = function (enc, format) {\\\\n\\\\tvar key = this.keys.getPublic(format === \'compressed\', true);\\\\n\\\\tif (format === \'hybrid\') {\\\\n\\\\t\\\\tif (key[key.length - 1] % 2) {\\\\n\\\\t\\\\t\\\\tkey[0] = 7;\\\\n\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\tkey [0] = 6;\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\treturn formatReturnValue(key, enc);\\\\n};\\\\n\\\\nECDH.prototype.getPrivateKey = function (enc) {\\\\n\\\\treturn formatReturnValue(this.keys.getPrivate(), enc);\\\\n};\\\\n\\\\nECDH.prototype.setPublicKey = function (pub, enc) {\\\\n\\\\tenc = enc || \'utf8\';\\\\n\\\\tif (!Buffer.isBuffer(pub)) {\\\\n\\\\t\\\\tpub = new Buffer(pub, enc);\\\\n\\\\t}\\\\n\\\\tthis.keys._importPublic(pub);\\\\n\\\\treturn this;\\\\n};\\\\n\\\\nECDH.prototype.setPrivateKey = function (priv, enc) {\\\\n\\\\tenc = enc || \'utf8\';\\\\n\\\\tif (!Buffer.isBuffer(priv)) {\\\\n\\\\t\\\\tpriv = new Buffer(priv, enc);\\\\n\\\\t}\\\\n\\\\tvar _priv = new BN(priv);\\\\n\\\\t_priv = _priv.toString(16);\\\\n\\\\tthis.keys._importPrivate(_priv);\\\\n\\\\treturn this;\\\\n};\\\\n\\\\nfunction formatReturnValue(bn, enc, len) {\\\\n\\\\tif (!Array.isArray(bn)) {\\\\n\\\\t\\\\tbn = bn.toArray();\\\\n\\\\t}\\\\n\\\\tvar buf = new Buffer(bn);\\\\n\\\\tif (len && buf.length < len) {\\\\n\\\\t\\\\tvar zeros = new Buffer(len - buf.length);\\\\n\\\\t\\\\tzeros.fill(0);\\\\n\\\\t\\\\tbuf = Buffer.concat([zeros, buf]);\\\\n\\\\t}\\\\n\\\\tif (!enc) {\\\\n\\\\t\\\\treturn buf;\\\\n\\\\t} else {\\\\n\\\\t\\\\treturn buf.toString(enc);\\\\n\\\\t}\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-ecdh/browser.js\\\\n// module id = 235\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-ecdh/browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {\\\\nvar intSize = 4\\\\nvar zeroBuffer = new Buffer(intSize)\\\\nzeroBuffer.fill(0)\\\\n\\\\nvar charSize = 8\\\\nvar hashSize = 16\\\\n\\\\nfunction toArray (buf) {\\\\n  if ((buf.length % intSize) !== 0) {\\\\n    var len = buf.length + (intSize - (buf.length % intSize))\\\\n    buf = Buffer.concat([buf, zeroBuffer], len)\\\\n  }\\\\n\\\\n  var arr = new Array(buf.length >>> 2)\\\\n  for (var i = 0, j = 0; i < buf.length; i += intSize, j++) {\\\\n    arr[j] = buf.readInt32LE(i)\\\\n  }\\\\n\\\\n  return arr\\\\n}\\\\n\\\\nmodule.exports = function hash (buf, fn) {\\\\n  var arr = fn(toArray(buf), buf.length * charSize)\\\\n  buf = new Buffer(hashSize)\\\\n  for (var i = 0; i < arr.length; i++) {\\\\n    buf.writeInt32LE(arr[i], i << 2, true)\\\\n  }\\\\n  return buf\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-hash/make-hash.js\\\\n// module id = 236\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-hash/make-hash.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar inherits = __webpack_require__(0)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar Base = __webpack_require__(17)\\\\n\\\\nvar ZEROS = Buffer.alloc(128)\\\\nvar blocksize = 64\\\\n\\\\nfunction Hmac (alg, key) {\\\\n  Base.call(this, \'digest\')\\\\n  if (typeof key === \'string\') {\\\\n    key = Buffer.from(key)\\\\n  }\\\\n\\\\n  this._alg = alg\\\\n  this._key = key\\\\n\\\\n  if (key.length > blocksize) {\\\\n    key = alg(key)\\\\n  } else if (key.length < blocksize) {\\\\n    key = Buffer.concat([key, ZEROS], blocksize)\\\\n  }\\\\n\\\\n  var ipad = this._ipad = Buffer.allocUnsafe(blocksize)\\\\n  var opad = this._opad = Buffer.allocUnsafe(blocksize)\\\\n\\\\n  for (var i = 0; i < blocksize; i++) {\\\\n    ipad[i] = key[i] ^ 0x36\\\\n    opad[i] = key[i] ^ 0x5C\\\\n  }\\\\n\\\\n  this._hash = [ipad]\\\\n}\\\\n\\\\ninherits(Hmac, Base)\\\\n\\\\nHmac.prototype._update = function (data) {\\\\n  this._hash.push(data)\\\\n}\\\\n\\\\nHmac.prototype._final = function () {\\\\n  var h = this._alg(Buffer.concat(this._hash))\\\\n  return this._alg(Buffer.concat([this._opad, h]))\\\\n}\\\\nmodule.exports = Hmac\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/create-hmac/legacy.js\\\\n// module id = 237\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/create-hmac/legacy.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(process) {/**\\\\n * This is the web browser implementation of `debug()`.\\\\n *\\\\n * Expose `debug()` as the module.\\\\n */\\\\n\\\\nexports = module.exports = __webpack_require__(239);\\\\nexports.log = log;\\\\nexports.formatArgs = formatArgs;\\\\nexports.save = save;\\\\nexports.load = load;\\\\nexports.useColors = useColors;\\\\nexports.storage = \'undefined\' != typeof chrome\\\\n               && \'undefined\' != typeof chrome.storage\\\\n                  ? chrome.storage.local\\\\n                  : localstorage();\\\\n\\\\n/**\\\\n * Colors.\\\\n */\\\\n\\\\nexports.colors = [\\\\n  \'#0000CC\', \'#0000FF\', \'#0033CC\', \'#0033FF\', \'#0066CC\', \'#0066FF\', \'#0099CC\',\\\\n  \'#0099FF\', \'#00CC00\', \'#00CC33\', \'#00CC66\', \'#00CC99\', \'#00CCCC\', \'#00CCFF\',\\\\n  \'#3300CC\', \'#3300FF\', \'#3333CC\', \'#3333FF\', \'#3366CC\', \'#3366FF\', \'#3399CC\',\\\\n  \'#3399FF\', \'#33CC00\', \'#33CC33\', \'#33CC66\', \'#33CC99\', \'#33CCCC\', \'#33CCFF\',\\\\n  \'#6600CC\', \'#6600FF\', \'#6633CC\', \'#6633FF\', \'#66CC00\', \'#66CC33\', \'#9900CC\',\\\\n  \'#9900FF\', \'#9933CC\', \'#9933FF\', \'#99CC00\', \'#99CC33\', \'#CC0000\', \'#CC0033\',\\\\n  \'#CC0066\', \'#CC0099\', \'#CC00CC\', \'#CC00FF\', \'#CC3300\', \'#CC3333\', \'#CC3366\',\\\\n  \'#CC3399\', \'#CC33CC\', \'#CC33FF\', \'#CC6600\', \'#CC6633\', \'#CC9900\', \'#CC9933\',\\\\n  \'#CCCC00\', \'#CCCC33\', \'#FF0000\', \'#FF0033\', \'#FF0066\', \'#FF0099\', \'#FF00CC\',\\\\n  \'#FF00FF\', \'#FF3300\', \'#FF3333\', \'#FF3366\', \'#FF3399\', \'#FF33CC\', \'#FF33FF\',\\\\n  \'#FF6600\', \'#FF6633\', \'#FF9900\', \'#FF9933\', \'#FFCC00\', \'#FFCC33\'\\\\n];\\\\n\\\\n/**\\\\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\\\\n * and the Firebug extension (any Firefox version) are known\\\\n * to support \\\\\\"%c\\\\\\" CSS customizations.\\\\n *\\\\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\\\\n */\\\\n\\\\nfunction useColors() {\\\\n  // NB: In an Electron preload script, document will be defined but not fully\\\\n  // initialized. Since we know we\'re in Chrome, we\'ll just detect this case\\\\n  // explicitly\\\\n  if (typeof window !== \'undefined\' && window.process && window.process.type === \'renderer\') {\\\\n    return true;\\\\n  }\\\\n\\\\n  // Internet Explorer and Edge do not support colors.\\\\n  if (typeof navigator !== \'undefined\' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\\\\\\\/(\\\\\\\\d+)/)) {\\\\n    return false;\\\\n  }\\\\n\\\\n  // is webkit? http://stackoverflow.com/a/16459606/376773\\\\n  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\\\\n  return (typeof document !== \'undefined\' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\\\\n    // is firebug? http://stackoverflow.com/a/398120/376773\\\\n    (typeof window !== \'undefined\' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\\\\n    // is firefox >= v31?\\\\n    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\\\\n    (typeof navigator !== \'undefined\' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\\\\\\\/(\\\\\\\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\\\\n    // double check webkit in userAgent just in case we are in a worker\\\\n    (typeof navigator !== \'undefined\' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\\\\\\\/(\\\\\\\\d+)/));\\\\n}\\\\n\\\\n/**\\\\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\\\\n */\\\\n\\\\nexports.formatters.j = function(v) {\\\\n  try {\\\\n    return JSON.stringify(v);\\\\n  } catch (err) {\\\\n    return \'[UnexpectedJSONParseError]: \' + err.message;\\\\n  }\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Colorize log arguments if enabled.\\\\n *\\\\n * @api public\\\\n */\\\\n\\\\nfunction formatArgs(args) {\\\\n  var useColors = this.useColors;\\\\n\\\\n  args[0] = (useColors ? \'%c\' : \'\')\\\\n    + this.namespace\\\\n    + (useColors ? \' %c\' : \' \')\\\\n    + args[0]\\\\n    + (useColors ? \'%c \' : \' \')\\\\n    + \'+\' + exports.humanize(this.diff);\\\\n\\\\n  if (!useColors) return;\\\\n\\\\n  var c = \'color: \' + this.color;\\\\n  args.splice(1, 0, c, \'color: inherit\')\\\\n\\\\n  // the final \\\\\\"%c\\\\\\" is somewhat tricky, because there could be other\\\\n  // arguments passed either before or after the %c, so we need to\\\\n  // figure out the correct index to insert the CSS into\\\\n  var index = 0;\\\\n  var lastC = 0;\\\\n  args[0].replace(/%[a-zA-Z%]/g, function(match) {\\\\n    if (\'%%\' === match) return;\\\\n    index++;\\\\n    if (\'%c\' === match) {\\\\n      // we only are interested in the *last* %c\\\\n      // (the user may have provided their own)\\\\n      lastC = index;\\\\n    }\\\\n  });\\\\n\\\\n  args.splice(lastC, 0, c);\\\\n}\\\\n\\\\n/**\\\\n * Invokes `console.log()` when available.\\\\n * No-op when `console.log` is not a \\\\\\"function\\\\\\".\\\\n *\\\\n * @api public\\\\n */\\\\n\\\\nfunction log() {\\\\n  // this hackery is required for IE8/9, where\\\\n  // the `console.log` function doesn\'t have \'apply\'\\\\n  return \'object\' === typeof console\\\\n    && console.log\\\\n    && Function.prototype.apply.call(console.log, console, arguments);\\\\n}\\\\n\\\\n/**\\\\n * Save `namespaces`.\\\\n *\\\\n * @param {String} namespaces\\\\n * @api private\\\\n */\\\\n\\\\nfunction save(namespaces) {\\\\n  try {\\\\n    if (null == namespaces) {\\\\n      exports.storage.removeItem(\'debug\');\\\\n    } else {\\\\n      exports.storage.debug = namespaces;\\\\n    }\\\\n  } catch(e) {}\\\\n}\\\\n\\\\n/**\\\\n * Load `namespaces`.\\\\n *\\\\n * @return {String} returns the previously persisted debug modes\\\\n * @api private\\\\n */\\\\n\\\\nfunction load() {\\\\n  var r;\\\\n  try {\\\\n    r = exports.storage.debug;\\\\n  } catch(e) {}\\\\n\\\\n  // If debug isn\'t set in LS, and we\'re in Electron, try to load $DEBUG\\\\n  if (!r && typeof process !== \'undefined\' && \'env\' in process) {\\\\n    r = __webpack_require__.i({\\\\\\"NODE_ENV\\\\\\":\\\\\\"production\\\\\\",\\\\\\"DC_NETWORK\\\\\\":\\\\\\"ropsten\\\\\\",\\\\\\"PUBLIC_URL\\\\\\":\\\\\\"\\\\\\"}).DEBUG;\\\\n  }\\\\n\\\\n  return r;\\\\n}\\\\n\\\\n/**\\\\n * Enable namespaces listed in `localStorage.debug` initially.\\\\n */\\\\n\\\\nexports.enable(load());\\\\n\\\\n/**\\\\n * Localstorage attempts to return the localstorage.\\\\n *\\\\n * This is necessary because safari throws\\\\n * when a user disables cookies/localstorage\\\\n * and you attempt to access it.\\\\n *\\\\n * @return {LocalStorage}\\\\n * @api private\\\\n */\\\\n\\\\nfunction localstorage() {\\\\n  try {\\\\n    return window.localStorage;\\\\n  } catch (e) {}\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/debug/src/browser.js\\\\n// module id = 238\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/debug/src/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"\\\\n/**\\\\n * This is the common logic for both the Node.js and web browser\\\\n * implementations of `debug()`.\\\\n *\\\\n * Expose `debug()` as the module.\\\\n */\\\\n\\\\nexports = module.exports = createDebug.debug = createDebug[\'default\'] = createDebug;\\\\nexports.coerce = coerce;\\\\nexports.disable = disable;\\\\nexports.enable = enable;\\\\nexports.enabled = enabled;\\\\nexports.humanize = __webpack_require__(282);\\\\n\\\\n/**\\\\n * Active `debug` instances.\\\\n */\\\\nexports.instances = [];\\\\n\\\\n/**\\\\n * The currently active debug mode names, and names to skip.\\\\n */\\\\n\\\\nexports.names = [];\\\\nexports.skips = [];\\\\n\\\\n/**\\\\n * Map of special \\\\\\"%n\\\\\\" handling functions, for the debug \\\\\\"format\\\\\\" argument.\\\\n *\\\\n * Valid key names are a single, lower or upper-case letter, i.e. \\\\\\"n\\\\\\" and \\\\\\"N\\\\\\".\\\\n */\\\\n\\\\nexports.formatters = {};\\\\n\\\\n/**\\\\n * Select a color.\\\\n * @param {String} namespace\\\\n * @return {Number}\\\\n * @api private\\\\n */\\\\n\\\\nfunction selectColor(namespace) {\\\\n  var hash = 0, i;\\\\n\\\\n  for (i in namespace) {\\\\n    hash  = ((hash << 5) - hash) + namespace.charCodeAt(i);\\\\n    hash |= 0; // Convert to 32bit integer\\\\n  }\\\\n\\\\n  return exports.colors[Math.abs(hash) % exports.colors.length];\\\\n}\\\\n\\\\n/**\\\\n * Create a debugger with the given `namespace`.\\\\n *\\\\n * @param {String} namespace\\\\n * @return {Function}\\\\n * @api public\\\\n */\\\\n\\\\nfunction createDebug(namespace) {\\\\n\\\\n  var prevTime;\\\\n\\\\n  function debug() {\\\\n    // disabled?\\\\n    if (!debug.enabled) return;\\\\n\\\\n    var self = debug;\\\\n\\\\n    // set `diff` timestamp\\\\n    var curr = +new Date();\\\\n    var ms = curr - (prevTime || curr);\\\\n    self.diff = ms;\\\\n    self.prev = prevTime;\\\\n    self.curr = curr;\\\\n    prevTime = curr;\\\\n\\\\n    // turn the `arguments` into a proper Array\\\\n    var args = new Array(arguments.length);\\\\n    for (var i = 0; i < args.length; i++) {\\\\n      args[i] = arguments[i];\\\\n    }\\\\n\\\\n    args[0] = exports.coerce(args[0]);\\\\n\\\\n    if (\'string\' !== typeof args[0]) {\\\\n      // anything else let\'s inspect with %O\\\\n      args.unshift(\'%O\');\\\\n    }\\\\n\\\\n    // apply any `formatters` transformations\\\\n    var index = 0;\\\\n    args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {\\\\n      // if we encounter an escaped % then don\'t increase the array index\\\\n      if (match === \'%%\') return match;\\\\n      index++;\\\\n      var formatter = exports.formatters[format];\\\\n      if (\'function\' === typeof formatter) {\\\\n        var val = args[index];\\\\n        match = formatter.call(self, val);\\\\n\\\\n        // now we need to remove `args[index]` since it\'s inlined in the `format`\\\\n        args.splice(index, 1);\\\\n        index--;\\\\n      }\\\\n      return match;\\\\n    });\\\\n\\\\n    // apply env-specific formatting (colors, etc.)\\\\n    exports.formatArgs.call(self, args);\\\\n\\\\n    var logFn = debug.log || exports.log || console.log.bind(console);\\\\n    logFn.apply(self, args);\\\\n  }\\\\n\\\\n  debug.namespace = namespace;\\\\n  debug.enabled = exports.enabled(namespace);\\\\n  debug.useColors = exports.useColors();\\\\n  debug.color = selectColor(namespace);\\\\n  debug.destroy = destroy;\\\\n\\\\n  // env-specific initialization logic for debug instances\\\\n  if (\'function\' === typeof exports.init) {\\\\n    exports.init(debug);\\\\n  }\\\\n\\\\n  exports.instances.push(debug);\\\\n\\\\n  return debug;\\\\n}\\\\n\\\\nfunction destroy () {\\\\n  var index = exports.instances.indexOf(this);\\\\n  if (index !== -1) {\\\\n    exports.instances.splice(index, 1);\\\\n    return true;\\\\n  } else {\\\\n    return false;\\\\n  }\\\\n}\\\\n\\\\n/**\\\\n * Enables a debug mode by namespaces. This can include modes\\\\n * separated by a colon and wildcards.\\\\n *\\\\n * @param {String} namespaces\\\\n * @api public\\\\n */\\\\n\\\\nfunction enable(namespaces) {\\\\n  exports.save(namespaces);\\\\n\\\\n  exports.names = [];\\\\n  exports.skips = [];\\\\n\\\\n  var i;\\\\n  var split = (typeof namespaces === \'string\' ? namespaces : \'\').split(/[\\\\\\\\s,]+/);\\\\n  var len = split.length;\\\\n\\\\n  for (i = 0; i < len; i++) {\\\\n    if (!split[i]) continue; // ignore empty strings\\\\n    namespaces = split[i].replace(/\\\\\\\\*/g, \'.*?\');\\\\n    if (namespaces[0] === \'-\') {\\\\n      exports.skips.push(new RegExp(\'^\' + namespaces.substr(1) + \'$\'));\\\\n    } else {\\\\n      exports.names.push(new RegExp(\'^\' + namespaces + \'$\'));\\\\n    }\\\\n  }\\\\n\\\\n  for (i = 0; i < exports.instances.length; i++) {\\\\n    var instance = exports.instances[i];\\\\n    instance.enabled = exports.enabled(instance.namespace);\\\\n  }\\\\n}\\\\n\\\\n/**\\\\n * Disable debug output.\\\\n *\\\\n * @api public\\\\n */\\\\n\\\\nfunction disable() {\\\\n  exports.enable(\'\');\\\\n}\\\\n\\\\n/**\\\\n * Returns true if the given mode name is enabled, false otherwise.\\\\n *\\\\n * @param {String} name\\\\n * @return {Boolean}\\\\n * @api public\\\\n */\\\\n\\\\nfunction enabled(name) {\\\\n  if (name[name.length - 1] === \'*\') {\\\\n    return true;\\\\n  }\\\\n  var i, len;\\\\n  for (i = 0, len = exports.skips.length; i < len; i++) {\\\\n    if (exports.skips[i].test(name)) {\\\\n      return false;\\\\n    }\\\\n  }\\\\n  for (i = 0, len = exports.names.length; i < len; i++) {\\\\n    if (exports.names[i].test(name)) {\\\\n      return true;\\\\n    }\\\\n  }\\\\n  return false;\\\\n}\\\\n\\\\n/**\\\\n * Coerce `val`.\\\\n *\\\\n * @param {Mixed} val\\\\n * @return {Mixed}\\\\n * @api private\\\\n */\\\\n\\\\nfunction coerce(val) {\\\\n  if (val instanceof Error) return val.stack || val.message;\\\\n  return val;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/debug/src/debug.js\\\\n// module id = 239\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/debug/src/debug.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar token = \'%[a-f0-9]{2}\';\\\\nvar singleMatcher = new RegExp(token, \'gi\');\\\\nvar multiMatcher = new RegExp(\'(\' + token + \')+\', \'gi\');\\\\n\\\\nfunction decodeComponents(components, split) {\\\\n\\\\ttry {\\\\n\\\\t\\\\t// Try to decode the entire string first\\\\n\\\\t\\\\treturn decodeURIComponent(components.join(\'\'));\\\\n\\\\t} catch (err) {\\\\n\\\\t\\\\t// Do nothing\\\\n\\\\t}\\\\n\\\\n\\\\tif (components.length === 1) {\\\\n\\\\t\\\\treturn components;\\\\n\\\\t}\\\\n\\\\n\\\\tsplit = split || 1;\\\\n\\\\n\\\\t// Split the array in 2 parts\\\\n\\\\tvar left = components.slice(0, split);\\\\n\\\\tvar right = components.slice(split);\\\\n\\\\n\\\\treturn Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));\\\\n}\\\\n\\\\nfunction decode(input) {\\\\n\\\\ttry {\\\\n\\\\t\\\\treturn decodeURIComponent(input);\\\\n\\\\t} catch (err) {\\\\n\\\\t\\\\tvar tokens = input.match(singleMatcher);\\\\n\\\\n\\\\t\\\\tfor (var i = 1; i < tokens.length; i++) {\\\\n\\\\t\\\\t\\\\tinput = decodeComponents(tokens, i).join(\'\');\\\\n\\\\n\\\\t\\\\t\\\\ttokens = input.match(singleMatcher);\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\treturn input;\\\\n\\\\t}\\\\n}\\\\n\\\\nfunction customDecodeURIComponent(input) {\\\\n\\\\t// Keep track of all the replacements and prefill the map with the `BOM`\\\\n\\\\tvar replaceMap = {\\\\n\\\\t\\\\t\'%FE%FF\': \'\\\\\\\\uFFFD\\\\\\\\uFFFD\',\\\\n\\\\t\\\\t\'%FF%FE\': \'\\\\\\\\uFFFD\\\\\\\\uFFFD\'\\\\n\\\\t};\\\\n\\\\n\\\\tvar match = multiMatcher.exec(input);\\\\n\\\\twhile (match) {\\\\n\\\\t\\\\ttry {\\\\n\\\\t\\\\t\\\\t// Decode as big chunks as possible\\\\n\\\\t\\\\t\\\\treplaceMap[match[0]] = decodeURIComponent(match[0]);\\\\n\\\\t\\\\t} catch (err) {\\\\n\\\\t\\\\t\\\\tvar result = decode(match[0]);\\\\n\\\\n\\\\t\\\\t\\\\tif (result !== match[0]) {\\\\n\\\\t\\\\t\\\\t\\\\treplaceMap[match[0]] = result;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tmatch = multiMatcher.exec(input);\\\\n\\\\t}\\\\n\\\\n\\\\t// Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else\\\\n\\\\treplaceMap[\'%C2\'] = \'\\\\\\\\uFFFD\';\\\\n\\\\n\\\\tvar entries = Object.keys(replaceMap);\\\\n\\\\n\\\\tfor (var i = 0; i < entries.length; i++) {\\\\n\\\\t\\\\t// Replace all decoded components\\\\n\\\\t\\\\tvar key = entries[i];\\\\n\\\\t\\\\tinput = input.replace(new RegExp(key, \'g\'), replaceMap[key]);\\\\n\\\\t}\\\\n\\\\n\\\\treturn input;\\\\n}\\\\n\\\\nmodule.exports = function (encodedURI) {\\\\n\\\\tif (typeof encodedURI !== \'string\') {\\\\n\\\\t\\\\tthrow new TypeError(\'Expected `encodedURI` to be of type `string`, got `\' + typeof encodedURI + \'`\');\\\\n\\\\t}\\\\n\\\\n\\\\ttry {\\\\n\\\\t\\\\tencodedURI = encodedURI.replace(/\\\\\\\\+/g, \' \');\\\\n\\\\n\\\\t\\\\t// Try the built in decoder first\\\\n\\\\t\\\\treturn decodeURIComponent(encodedURI);\\\\n\\\\t} catch (err) {\\\\n\\\\t\\\\t// Fallback to a more advanced decoder\\\\n\\\\t\\\\treturn customDecodeURIComponent(encodedURI);\\\\n\\\\t}\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/decode-uri-component/index.js\\\\n// module id = 240\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/decode-uri-component/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar assert = __webpack_require__(12);\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\nvar proto = {};\\\\n\\\\nfunction CBCState(iv) {\\\\n  assert.equal(iv.length, 8, \'Invalid IV length\');\\\\n\\\\n  this.iv = new Array(8);\\\\n  for (var i = 0; i < this.iv.length; i++)\\\\n    this.iv[i] = iv[i];\\\\n}\\\\n\\\\nfunction instantiate(Base) {\\\\n  function CBC(options) {\\\\n    Base.call(this, options);\\\\n    this._cbcInit();\\\\n  }\\\\n  inherits(CBC, Base);\\\\n\\\\n  var keys = Object.keys(proto);\\\\n  for (var i = 0; i < keys.length; i++) {\\\\n    var key = keys[i];\\\\n    CBC.prototype[key] = proto[key];\\\\n  }\\\\n\\\\n  CBC.create = function create(options) {\\\\n    return new CBC(options);\\\\n  };\\\\n\\\\n  return CBC;\\\\n}\\\\n\\\\nexports.instantiate = instantiate;\\\\n\\\\nproto._cbcInit = function _cbcInit() {\\\\n  var state = new CBCState(this.options.iv);\\\\n  this._cbcState = state;\\\\n};\\\\n\\\\nproto._update = function _update(inp, inOff, out, outOff) {\\\\n  var state = this._cbcState;\\\\n  var superProto = this.constructor.super_.prototype;\\\\n\\\\n  var iv = state.iv;\\\\n  if (this.type === \'encrypt\') {\\\\n    for (var i = 0; i < this.blockSize; i++)\\\\n      iv[i] ^= inp[inOff + i];\\\\n\\\\n    superProto._update.call(this, iv, 0, out, outOff);\\\\n\\\\n    for (var i = 0; i < this.blockSize; i++)\\\\n      iv[i] = out[outOff + i];\\\\n  } else {\\\\n    superProto._update.call(this, inp, inOff, out, outOff);\\\\n\\\\n    for (var i = 0; i < this.blockSize; i++)\\\\n      out[outOff + i] ^= iv[i];\\\\n\\\\n    for (var i = 0; i < this.blockSize; i++)\\\\n      iv[i] = inp[inOff + i];\\\\n  }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des/cbc.js\\\\n// module id = 241\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des/cbc.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nfunction Cipher(options) {\\\\n  this.options = options;\\\\n\\\\n  this.type = this.options.type;\\\\n  this.blockSize = 8;\\\\n  this._init();\\\\n\\\\n  this.buffer = new Array(this.blockSize);\\\\n  this.bufferOff = 0;\\\\n}\\\\nmodule.exports = Cipher;\\\\n\\\\nCipher.prototype._init = function _init() {\\\\n  // Might be overrided\\\\n};\\\\n\\\\nCipher.prototype.update = function update(data) {\\\\n  if (data.length === 0)\\\\n    return [];\\\\n\\\\n  if (this.type === \'decrypt\')\\\\n    return this._updateDecrypt(data);\\\\n  else\\\\n    return this._updateEncrypt(data);\\\\n};\\\\n\\\\nCipher.prototype._buffer = function _buffer(data, off) {\\\\n  // Append data to buffer\\\\n  var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);\\\\n  for (var i = 0; i < min; i++)\\\\n    this.buffer[this.bufferOff + i] = data[off + i];\\\\n  this.bufferOff += min;\\\\n\\\\n  // Shift next\\\\n  return min;\\\\n};\\\\n\\\\nCipher.prototype._flushBuffer = function _flushBuffer(out, off) {\\\\n  this._update(this.buffer, 0, out, off);\\\\n  this.bufferOff = 0;\\\\n  return this.blockSize;\\\\n};\\\\n\\\\nCipher.prototype._updateEncrypt = function _updateEncrypt(data) {\\\\n  var inputOff = 0;\\\\n  var outputOff = 0;\\\\n\\\\n  var count = ((this.bufferOff + data.length) / this.blockSize) | 0;\\\\n  var out = new Array(count * this.blockSize);\\\\n\\\\n  if (this.bufferOff !== 0) {\\\\n    inputOff += this._buffer(data, inputOff);\\\\n\\\\n    if (this.bufferOff === this.buffer.length)\\\\n      outputOff += this._flushBuffer(out, outputOff);\\\\n  }\\\\n\\\\n  // Write blocks\\\\n  var max = data.length - ((data.length - inputOff) % this.blockSize);\\\\n  for (; inputOff < max; inputOff += this.blockSize) {\\\\n    this._update(data, inputOff, out, outputOff);\\\\n    outputOff += this.blockSize;\\\\n  }\\\\n\\\\n  // Queue rest\\\\n  for (; inputOff < data.length; inputOff++, this.bufferOff++)\\\\n    this.buffer[this.bufferOff] = data[inputOff];\\\\n\\\\n  return out;\\\\n};\\\\n\\\\nCipher.prototype._updateDecrypt = function _updateDecrypt(data) {\\\\n  var inputOff = 0;\\\\n  var outputOff = 0;\\\\n\\\\n  var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;\\\\n  var out = new Array(count * this.blockSize);\\\\n\\\\n  // TODO(indutny): optimize it, this is far from optimal\\\\n  for (; count > 0; count--) {\\\\n    inputOff += this._buffer(data, inputOff);\\\\n    outputOff += this._flushBuffer(out, outputOff);\\\\n  }\\\\n\\\\n  // Buffer rest of the input\\\\n  inputOff += this._buffer(data, inputOff);\\\\n\\\\n  return out;\\\\n};\\\\n\\\\nCipher.prototype.final = function final(buffer) {\\\\n  var first;\\\\n  if (buffer)\\\\n    first = this.update(buffer);\\\\n\\\\n  var last;\\\\n  if (this.type === \'encrypt\')\\\\n    last = this._finalEncrypt();\\\\n  else\\\\n    last = this._finalDecrypt();\\\\n\\\\n  if (first)\\\\n    return first.concat(last);\\\\n  else\\\\n    return last;\\\\n};\\\\n\\\\nCipher.prototype._pad = function _pad(buffer, off) {\\\\n  if (off === 0)\\\\n    return false;\\\\n\\\\n  while (off < buffer.length)\\\\n    buffer[off++] = 0;\\\\n\\\\n  return true;\\\\n};\\\\n\\\\nCipher.prototype._finalEncrypt = function _finalEncrypt() {\\\\n  if (!this._pad(this.buffer, this.bufferOff))\\\\n    return [];\\\\n\\\\n  var out = new Array(this.blockSize);\\\\n  this._update(this.buffer, 0, out, 0);\\\\n  return out;\\\\n};\\\\n\\\\nCipher.prototype._unpad = function _unpad(buffer) {\\\\n  return buffer;\\\\n};\\\\n\\\\nCipher.prototype._finalDecrypt = function _finalDecrypt() {\\\\n  assert.equal(this.bufferOff, this.blockSize, \'Not enough data to decrypt\');\\\\n  var out = new Array(this.blockSize);\\\\n  this._flushBuffer(out, 0);\\\\n\\\\n  return this._unpad(out);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des/cipher.js\\\\n// module id = 242\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des/cipher.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar assert = __webpack_require__(12);\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\nvar des = __webpack_require__(83);\\\\nvar utils = des.utils;\\\\nvar Cipher = des.Cipher;\\\\n\\\\nfunction DESState() {\\\\n  this.tmp = new Array(2);\\\\n  this.keys = null;\\\\n}\\\\n\\\\nfunction DES(options) {\\\\n  Cipher.call(this, options);\\\\n\\\\n  var state = new DESState();\\\\n  this._desState = state;\\\\n\\\\n  this.deriveKeys(state, options.key);\\\\n}\\\\ninherits(DES, Cipher);\\\\nmodule.exports = DES;\\\\n\\\\nDES.create = function create(options) {\\\\n  return new DES(options);\\\\n};\\\\n\\\\nvar shiftTable = [\\\\n  1, 1, 2, 2, 2, 2, 2, 2,\\\\n  1, 2, 2, 2, 2, 2, 2, 1\\\\n];\\\\n\\\\nDES.prototype.deriveKeys = function deriveKeys(state, key) {\\\\n  state.keys = new Array(16 * 2);\\\\n\\\\n  assert.equal(key.length, this.blockSize, \'Invalid key length\');\\\\n\\\\n  var kL = utils.readUInt32BE(key, 0);\\\\n  var kR = utils.readUInt32BE(key, 4);\\\\n\\\\n  utils.pc1(kL, kR, state.tmp, 0);\\\\n  kL = state.tmp[0];\\\\n  kR = state.tmp[1];\\\\n  for (var i = 0; i < state.keys.length; i += 2) {\\\\n    var shift = shiftTable[i >>> 1];\\\\n    kL = utils.r28shl(kL, shift);\\\\n    kR = utils.r28shl(kR, shift);\\\\n    utils.pc2(kL, kR, state.keys, i);\\\\n  }\\\\n};\\\\n\\\\nDES.prototype._update = function _update(inp, inOff, out, outOff) {\\\\n  var state = this._desState;\\\\n\\\\n  var l = utils.readUInt32BE(inp, inOff);\\\\n  var r = utils.readUInt32BE(inp, inOff + 4);\\\\n\\\\n  // Initial Permutation\\\\n  utils.ip(l, r, state.tmp, 0);\\\\n  l = state.tmp[0];\\\\n  r = state.tmp[1];\\\\n\\\\n  if (this.type === \'encrypt\')\\\\n    this._encrypt(state, l, r, state.tmp, 0);\\\\n  else\\\\n    this._decrypt(state, l, r, state.tmp, 0);\\\\n\\\\n  l = state.tmp[0];\\\\n  r = state.tmp[1];\\\\n\\\\n  utils.writeUInt32BE(out, l, outOff);\\\\n  utils.writeUInt32BE(out, r, outOff + 4);\\\\n};\\\\n\\\\nDES.prototype._pad = function _pad(buffer, off) {\\\\n  var value = buffer.length - off;\\\\n  for (var i = off; i < buffer.length; i++)\\\\n    buffer[i] = value;\\\\n\\\\n  return true;\\\\n};\\\\n\\\\nDES.prototype._unpad = function _unpad(buffer) {\\\\n  var pad = buffer[buffer.length - 1];\\\\n  for (var i = buffer.length - pad; i < buffer.length; i++)\\\\n    assert.equal(buffer[i], pad);\\\\n\\\\n  return buffer.slice(0, buffer.length - pad);\\\\n};\\\\n\\\\nDES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {\\\\n  var l = lStart;\\\\n  var r = rStart;\\\\n\\\\n  // Apply f() x16 times\\\\n  for (var i = 0; i < state.keys.length; i += 2) {\\\\n    var keyL = state.keys[i];\\\\n    var keyR = state.keys[i + 1];\\\\n\\\\n    // f(r, k)\\\\n    utils.expand(r, state.tmp, 0);\\\\n\\\\n    keyL ^= state.tmp[0];\\\\n    keyR ^= state.tmp[1];\\\\n    var s = utils.substitute(keyL, keyR);\\\\n    var f = utils.permute(s);\\\\n\\\\n    var t = r;\\\\n    r = (l ^ f) >>> 0;\\\\n    l = t;\\\\n  }\\\\n\\\\n  // Reverse Initial Permutation\\\\n  utils.rip(r, l, out, off);\\\\n};\\\\n\\\\nDES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {\\\\n  var l = rStart;\\\\n  var r = lStart;\\\\n\\\\n  // Apply f() x16 times\\\\n  for (var i = state.keys.length - 2; i >= 0; i -= 2) {\\\\n    var keyL = state.keys[i];\\\\n    var keyR = state.keys[i + 1];\\\\n\\\\n    // f(r, k)\\\\n    utils.expand(l, state.tmp, 0);\\\\n\\\\n    keyL ^= state.tmp[0];\\\\n    keyR ^= state.tmp[1];\\\\n    var s = utils.substitute(keyL, keyR);\\\\n    var f = utils.permute(s);\\\\n\\\\n    var t = l;\\\\n    l = (r ^ f) >>> 0;\\\\n    r = t;\\\\n  }\\\\n\\\\n  // Reverse Initial Permutation\\\\n  utils.rip(l, r, out, off);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des/des.js\\\\n// module id = 243\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des/des.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar assert = __webpack_require__(12);\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\nvar des = __webpack_require__(83);\\\\nvar Cipher = des.Cipher;\\\\nvar DES = des.DES;\\\\n\\\\nfunction EDEState(type, key) {\\\\n  assert.equal(key.length, 24, \'Invalid key length\');\\\\n\\\\n  var k1 = key.slice(0, 8);\\\\n  var k2 = key.slice(8, 16);\\\\n  var k3 = key.slice(16, 24);\\\\n\\\\n  if (type === \'encrypt\') {\\\\n    this.ciphers = [\\\\n      DES.create({ type: \'encrypt\', key: k1 }),\\\\n      DES.create({ type: \'decrypt\', key: k2 }),\\\\n      DES.create({ type: \'encrypt\', key: k3 })\\\\n    ];\\\\n  } else {\\\\n    this.ciphers = [\\\\n      DES.create({ type: \'decrypt\', key: k3 }),\\\\n      DES.create({ type: \'encrypt\', key: k2 }),\\\\n      DES.create({ type: \'decrypt\', key: k1 })\\\\n    ];\\\\n  }\\\\n}\\\\n\\\\nfunction EDE(options) {\\\\n  Cipher.call(this, options);\\\\n\\\\n  var state = new EDEState(this.type, this.options.key);\\\\n  this._edeState = state;\\\\n}\\\\ninherits(EDE, Cipher);\\\\n\\\\nmodule.exports = EDE;\\\\n\\\\nEDE.create = function create(options) {\\\\n  return new EDE(options);\\\\n};\\\\n\\\\nEDE.prototype._update = function _update(inp, inOff, out, outOff) {\\\\n  var state = this._edeState;\\\\n\\\\n  state.ciphers[0]._update(inp, inOff, out, outOff);\\\\n  state.ciphers[1]._update(out, outOff, out, outOff);\\\\n  state.ciphers[2]._update(out, outOff, out, outOff);\\\\n};\\\\n\\\\nEDE.prototype._pad = DES.prototype._pad;\\\\nEDE.prototype._unpad = DES.prototype._unpad;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des/ede.js\\\\n// module id = 244\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des/ede.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.readUInt32BE = function readUInt32BE(bytes, off) {\\\\n  var res =  (bytes[0 + off] << 24) |\\\\n             (bytes[1 + off] << 16) |\\\\n             (bytes[2 + off] << 8) |\\\\n             bytes[3 + off];\\\\n  return res >>> 0;\\\\n};\\\\n\\\\nexports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {\\\\n  bytes[0 + off] = value >>> 24;\\\\n  bytes[1 + off] = (value >>> 16) & 0xff;\\\\n  bytes[2 + off] = (value >>> 8) & 0xff;\\\\n  bytes[3 + off] = value & 0xff;\\\\n};\\\\n\\\\nexports.ip = function ip(inL, inR, out, off) {\\\\n  var outL = 0;\\\\n  var outR = 0;\\\\n\\\\n  for (var i = 6; i >= 0; i -= 2) {\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outL <<= 1;\\\\n      outL |= (inR >>> (j + i)) & 1;\\\\n    }\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outL <<= 1;\\\\n      outL |= (inL >>> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n\\\\n  for (var i = 6; i >= 0; i -= 2) {\\\\n    for (var j = 1; j <= 25; j += 8) {\\\\n      outR <<= 1;\\\\n      outR |= (inR >>> (j + i)) & 1;\\\\n    }\\\\n    for (var j = 1; j <= 25; j += 8) {\\\\n      outR <<= 1;\\\\n      outR |= (inL >>> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n\\\\n  out[off + 0] = outL >>> 0;\\\\n  out[off + 1] = outR >>> 0;\\\\n};\\\\n\\\\nexports.rip = function rip(inL, inR, out, off) {\\\\n  var outL = 0;\\\\n  var outR = 0;\\\\n\\\\n  for (var i = 0; i < 4; i++) {\\\\n    for (var j = 24; j >= 0; j -= 8) {\\\\n      outL <<= 1;\\\\n      outL |= (inR >>> (j + i)) & 1;\\\\n      outL <<= 1;\\\\n      outL |= (inL >>> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n  for (var i = 4; i < 8; i++) {\\\\n    for (var j = 24; j >= 0; j -= 8) {\\\\n      outR <<= 1;\\\\n      outR |= (inR >>> (j + i)) & 1;\\\\n      outR <<= 1;\\\\n      outR |= (inL >>> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n\\\\n  out[off + 0] = outL >>> 0;\\\\n  out[off + 1] = outR >>> 0;\\\\n};\\\\n\\\\nexports.pc1 = function pc1(inL, inR, out, off) {\\\\n  var outL = 0;\\\\n  var outR = 0;\\\\n\\\\n  // 7, 15, 23, 31, 39, 47, 55, 63\\\\n  // 6, 14, 22, 30, 39, 47, 55, 63\\\\n  // 5, 13, 21, 29, 39, 47, 55, 63\\\\n  // 4, 12, 20, 28\\\\n  for (var i = 7; i >= 5; i--) {\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outL <<= 1;\\\\n      outL |= (inR >> (j + i)) & 1;\\\\n    }\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outL <<= 1;\\\\n      outL |= (inL >> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n  for (var j = 0; j <= 24; j += 8) {\\\\n    outL <<= 1;\\\\n    outL |= (inR >> (j + i)) & 1;\\\\n  }\\\\n\\\\n  // 1, 9, 17, 25, 33, 41, 49, 57\\\\n  // 2, 10, 18, 26, 34, 42, 50, 58\\\\n  // 3, 11, 19, 27, 35, 43, 51, 59\\\\n  // 36, 44, 52, 60\\\\n  for (var i = 1; i <= 3; i++) {\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outR <<= 1;\\\\n      outR |= (inR >> (j + i)) & 1;\\\\n    }\\\\n    for (var j = 0; j <= 24; j += 8) {\\\\n      outR <<= 1;\\\\n      outR |= (inL >> (j + i)) & 1;\\\\n    }\\\\n  }\\\\n  for (var j = 0; j <= 24; j += 8) {\\\\n    outR <<= 1;\\\\n    outR |= (inL >> (j + i)) & 1;\\\\n  }\\\\n\\\\n  out[off + 0] = outL >>> 0;\\\\n  out[off + 1] = outR >>> 0;\\\\n};\\\\n\\\\nexports.r28shl = function r28shl(num, shift) {\\\\n  return ((num << shift) & 0xfffffff) | (num >>> (28 - shift));\\\\n};\\\\n\\\\nvar pc2table = [\\\\n  // inL => outL\\\\n  14, 11, 17, 4, 27, 23, 25, 0,\\\\n  13, 22, 7, 18, 5, 9, 16, 24,\\\\n  2, 20, 12, 21, 1, 8, 15, 26,\\\\n\\\\n  // inR => outR\\\\n  15, 4, 25, 19, 9, 1, 26, 16,\\\\n  5, 11, 23, 8, 12, 7, 17, 0,\\\\n  22, 3, 10, 14, 6, 20, 27, 24\\\\n];\\\\n\\\\nexports.pc2 = function pc2(inL, inR, out, off) {\\\\n  var outL = 0;\\\\n  var outR = 0;\\\\n\\\\n  var len = pc2table.length >>> 1;\\\\n  for (var i = 0; i < len; i++) {\\\\n    outL <<= 1;\\\\n    outL |= (inL >>> pc2table[i]) & 0x1;\\\\n  }\\\\n  for (var i = len; i < pc2table.length; i++) {\\\\n    outR <<= 1;\\\\n    outR |= (inR >>> pc2table[i]) & 0x1;\\\\n  }\\\\n\\\\n  out[off + 0] = outL >>> 0;\\\\n  out[off + 1] = outR >>> 0;\\\\n};\\\\n\\\\nexports.expand = function expand(r, out, off) {\\\\n  var outL = 0;\\\\n  var outR = 0;\\\\n\\\\n  outL = ((r & 1) << 5) | (r >>> 27);\\\\n  for (var i = 23; i >= 15; i -= 4) {\\\\n    outL <<= 6;\\\\n    outL |= (r >>> i) & 0x3f;\\\\n  }\\\\n  for (var i = 11; i >= 3; i -= 4) {\\\\n    outR |= (r >>> i) & 0x3f;\\\\n    outR <<= 6;\\\\n  }\\\\n  outR |= ((r & 0x1f) << 1) | (r >>> 31);\\\\n\\\\n  out[off + 0] = outL >>> 0;\\\\n  out[off + 1] = outR >>> 0;\\\\n};\\\\n\\\\nvar sTable = [\\\\n  14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1,\\\\n  3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8,\\\\n  4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7,\\\\n  15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13,\\\\n\\\\n  15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14,\\\\n  9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5,\\\\n  0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2,\\\\n  5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9,\\\\n\\\\n  10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10,\\\\n  1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1,\\\\n  13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7,\\\\n  11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12,\\\\n\\\\n  7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3,\\\\n  1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9,\\\\n  10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8,\\\\n  15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14,\\\\n\\\\n  2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1,\\\\n  8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6,\\\\n  4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13,\\\\n  15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3,\\\\n\\\\n  12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5,\\\\n  0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8,\\\\n  9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10,\\\\n  7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13,\\\\n\\\\n  4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10,\\\\n  3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6,\\\\n  1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7,\\\\n  10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12,\\\\n\\\\n  13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4,\\\\n  10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2,\\\\n  7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13,\\\\n  0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11\\\\n];\\\\n\\\\nexports.substitute = function substitute(inL, inR) {\\\\n  var out = 0;\\\\n  for (var i = 0; i < 4; i++) {\\\\n    var b = (inL >>> (18 - i * 6)) & 0x3f;\\\\n    var sb = sTable[i * 0x40 + b];\\\\n\\\\n    out <<= 4;\\\\n    out |= sb;\\\\n  }\\\\n  for (var i = 0; i < 4; i++) {\\\\n    var b = (inR >>> (18 - i * 6)) & 0x3f;\\\\n    var sb = sTable[4 * 0x40 + i * 0x40 + b];\\\\n\\\\n    out <<= 4;\\\\n    out |= sb;\\\\n  }\\\\n  return out >>> 0;\\\\n};\\\\n\\\\nvar permuteTable = [\\\\n  16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22,\\\\n  30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7\\\\n];\\\\n\\\\nexports.permute = function permute(num) {\\\\n  var out = 0;\\\\n  for (var i = 0; i < permuteTable.length; i++) {\\\\n    out <<= 1;\\\\n    out |= (num >>> permuteTable[i]) & 0x1;\\\\n  }\\\\n  return out >>> 0;\\\\n};\\\\n\\\\nexports.padSplit = function padSplit(num, size, group) {\\\\n  var str = num.toString(2);\\\\n  while (str.length < size)\\\\n    str = \'0\' + str;\\\\n\\\\n  var out = [];\\\\n  for (var i = 0; i < size; i += group)\\\\n    out.push(str.slice(i, i + group));\\\\n  return out.join(\' \');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/des.js/lib/des/utils.js\\\\n// module id = 245\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/des.js/lib/des/utils.js\\")},function(module,__webpack_exports__,__webpack_require__){\\"use strict\\";eval(\'Object.defineProperty(__webpack_exports__, \\"__esModule\\", { value: true });\\\\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_dexie__ = __webpack_require__(125);\\\\n/* ========================================================================== \\\\r\\\\n *                           dexie-observable.js\\\\r\\\\n * ==========================================================================\\\\r\\\\n *\\\\r\\\\n * Dexie addon for observing database changes not just on local db instance\\\\r\\\\n * but also on other instances, tabs and windows.\\\\r\\\\n *\\\\r\\\\n * Comprises a base framework for dexie-syncable.js\\\\r\\\\n *\\\\r\\\\n * By David Fahlander, david.fahlander@gmail.com,\\\\r\\\\n *    Nikolas Poniros, https://github.com/nponiros\\\\r\\\\n *\\\\r\\\\n * ==========================================================================\\\\r\\\\n *\\\\r\\\\n * Version {version}, {date}\\\\r\\\\n *\\\\r\\\\n * http://dexie.org\\\\r\\\\n *\\\\r\\\\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\\\\r\\\\n * \\\\r\\\\n */\\\\r\\\\n\\\\n\\\\n\\\\nfunction nop() { }\\\\r\\\\nfunction promisableChain(f1, f2) {\\\\r\\\\n    if (f1 === nop)\\\\r\\\\n        return f2;\\\\r\\\\n    return function () {\\\\r\\\\n        var res = f1.apply(this, arguments);\\\\r\\\\n        if (res && typeof res.then === \\\\\'function\\\\\') {\\\\r\\\\n            var thiz = this, args = arguments;\\\\r\\\\n            return res.then(function () {\\\\r\\\\n                return f2.apply(thiz, args);\\\\r\\\\n            });\\\\r\\\\n        }\\\\r\\\\n        return f2.apply(this, arguments);\\\\r\\\\n    };\\\\r\\\\n}\\\\r\\\\nfunction createUUID() {\\\\r\\\\n    // Decent solution from http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript\\\\r\\\\n    var d = Date.now();\\\\r\\\\n    var uuid = \\\\\'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\\\\\'.replace(/[xy]/g, function (c) {\\\\r\\\\n        var r = (d + Math.random() * 16) % 16 | 0;\\\\r\\\\n        d = Math.floor(d / 16);\\\\r\\\\n        return (c === \\\\\'x\\\\\' ? r : (r & 0x7 | 0x8)).toString(16);\\\\r\\\\n    });\\\\r\\\\n    return uuid;\\\\r\\\\n}\\\\n\\\\nfunction initOverrideCreateTransaction(db, wakeupObservers) {\\\\r\\\\n    return function overrideCreateTransaction(origFunc) {\\\\r\\\\n        return function (mode, storenames, dbschema, parent) {\\\\r\\\\n            if (db.dynamicallyOpened())\\\\r\\\\n                return origFunc.apply(this, arguments); // Don\\\\\'t observe dynamically opened databases.\\\\r\\\\n            var addChanges = false;\\\\r\\\\n            if (mode === \\\\\'readwrite\\\\\' && storenames.some(function (storeName) {\\\\r\\\\n                return dbschema[storeName] && dbschema[storeName].observable;\\\\r\\\\n            })) {\\\\r\\\\n                // At least one included store is a observable store. Make sure to also include the _changes store.\\\\r\\\\n                addChanges = true;\\\\r\\\\n                storenames = storenames.slice(0); // Clone\\\\r\\\\n                if (storenames.indexOf(\\"_changes\\") === -1)\\\\r\\\\n                    storenames.push(\\"_changes\\"); // Otherwise, firefox will hang... (I\\\\\'ve reported the bug to Mozilla@Bugzilla)\\\\r\\\\n            }\\\\r\\\\n            // Call original db._createTransaction()\\\\r\\\\n            var trans = origFunc.call(this, mode, storenames, dbschema, parent);\\\\r\\\\n            // If this transaction is bound to any observable table, make sure to add changes when transaction completes.\\\\r\\\\n            if (addChanges) {\\\\r\\\\n                trans._lastWrittenRevision = 0;\\\\r\\\\n                trans.on(\\\\\'complete\\\\\', function () {\\\\r\\\\n                    if (trans._lastWrittenRevision) {\\\\r\\\\n                        // Changes were written in this transaction.\\\\r\\\\n                        if (!parent) {\\\\r\\\\n                            // This is root-level transaction, i.e. a physical commit has happened.\\\\r\\\\n                            // Delay-trigger a wakeup call:\\\\r\\\\n                            if (wakeupObservers.timeoutHandle)\\\\r\\\\n                                clearTimeout(wakeupObservers.timeoutHandle);\\\\r\\\\n                            wakeupObservers.timeoutHandle = setTimeout(function () {\\\\r\\\\n                                delete wakeupObservers.timeoutHandle;\\\\r\\\\n                                wakeupObservers(trans._lastWrittenRevision);\\\\r\\\\n                            }, 25);\\\\r\\\\n                        }\\\\r\\\\n                        else {\\\\r\\\\n                            // This is just a virtual commit of a sub transaction.\\\\r\\\\n                            // Wait with waking up observers until root transaction has committed.\\\\r\\\\n                            // Make sure to mark root transaction so that it will wakeup observers upon commit.\\\\r\\\\n                            var rootTransaction = (function findRootTransaction(trans) {\\\\r\\\\n                                return trans.parent ? findRootTransaction(trans.parent) : trans;\\\\r\\\\n                            })(parent);\\\\r\\\\n                            rootTransaction._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rootTransaction.lastWrittenRevision || 0);\\\\r\\\\n                        }\\\\r\\\\n                    }\\\\r\\\\n                });\\\\r\\\\n                // Derive \\"source\\" property from parent transaction by default\\\\r\\\\n                if (trans.parent && trans.parent.source)\\\\r\\\\n                    trans.source = trans.parent.source;\\\\r\\\\n            }\\\\r\\\\n            return trans;\\\\r\\\\n        };\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initWakeupObservers(db, Observable, localStorage) {\\\\r\\\\n    return function wakeupObservers(lastWrittenRevision) {\\\\r\\\\n        // Make sure Observable.latestRevision[db.name] is still below our value, now when some time has elapsed and other db instances in same window possibly could have made changes too.\\\\r\\\\n        if (Observable.latestRevision[db.name] < lastWrittenRevision) {\\\\r\\\\n            // Set the static property lastRevision[db.name] to the revision of the last written change.\\\\r\\\\n            Observable.latestRevision[db.name] = lastWrittenRevision;\\\\r\\\\n            // Wakeup ourselves, and any other db instances on this window:\\\\r\\\\n            __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n                Observable.on(\\\\\'latestRevisionIncremented\\\\\').fire(db.name, lastWrittenRevision);\\\\r\\\\n            });\\\\r\\\\n            // Observable.on.latestRevisionIncremented will only wakeup db\\\\\'s in current window.\\\\r\\\\n            // We need a storage event to wakeup other windwos.\\\\r\\\\n            // Since indexedDB lacks storage events, let\\\\\'s use the storage event from WebStorage just for\\\\r\\\\n            // the purpose to wakeup db instances in other windows.\\\\r\\\\n            if (localStorage)\\\\r\\\\n                localStorage.setItem(\\\\\'Dexie.Observable/latestRevision/\\\\\' + db.name, lastWrittenRevision); // In IE, this will also wakeup our own window. However, onLatestRevisionIncremented will work around this by only running once per revision id.\\\\r\\\\n        }\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\n// Change Types\\\\r\\\\n// Change Types\\\\r\\\\nvar CREATE = 1;\\\\r\\\\nvar UPDATE = 2;\\\\r\\\\nvar DELETE = 3;\\\\n\\\\nfunction initCreatingHook(db, table) {\\\\r\\\\n    return function creatingHook(primKey, obj, trans) {\\\\r\\\\n        /// <param name=\\"trans\\" type=\\"db.Transaction\\"></param>\\\\r\\\\n        var rv = undefined;\\\\r\\\\n        if (primKey === undefined && table.schema.primKey.uuid) {\\\\r\\\\n            primKey = rv = createUUID();\\\\r\\\\n            if (table.schema.primKey.keyPath) {\\\\r\\\\n                __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].setByKeyPath(obj, table.schema.primKey.keyPath, primKey);\\\\r\\\\n            }\\\\r\\\\n        }\\\\r\\\\n        var change = {\\\\r\\\\n            source: trans.source || null,\\\\r\\\\n            table: table.name,\\\\r\\\\n            key: primKey === undefined ? null : primKey,\\\\r\\\\n            type: CREATE,\\\\r\\\\n            obj: obj\\\\r\\\\n        };\\\\r\\\\n        var promise = db._changes.add(change).then(function (rev) {\\\\r\\\\n            trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\\\\r\\\\n            return rev;\\\\r\\\\n        });\\\\r\\\\n        // Wait for onsuccess so that we have the primKey if it is auto-incremented and update the change item if so.\\\\r\\\\n        this.onsuccess = function (resultKey) {\\\\r\\\\n            if (primKey != resultKey)\\\\r\\\\n                promise._then(function () {\\\\r\\\\n                    change.key = resultKey;\\\\r\\\\n                    db._changes.put(change);\\\\r\\\\n                });\\\\r\\\\n        };\\\\r\\\\n        this.onerror = function () {\\\\r\\\\n            // If the main operation fails, make sure to regret the change\\\\r\\\\n            promise._then(function (rev) {\\\\r\\\\n                // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\\\\r\\\\n                db._changes.delete(rev);\\\\r\\\\n            });\\\\r\\\\n        };\\\\r\\\\n        return rv;\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initUpdatingHook(db, tableName) {\\\\r\\\\n    return function updatingHook(mods, primKey, oldObj, trans) {\\\\r\\\\n        /// <param name=\\"trans\\" type=\\"db.Transaction\\"></param>\\\\r\\\\n        // mods may contain property paths with undefined as value if the property\\\\r\\\\n        // is being deleted. Since we cannot persist undefined we need to act\\\\r\\\\n        // like those changes is setting the value to null instead.\\\\r\\\\n        var modsWithoutUndefined = {};\\\\r\\\\n        // As of current Dexie version (1.0.3) hook may be called even if it wouldn\\\\\'t really change.\\\\r\\\\n        // Therefore we may do that kind of optimization here - to not add change entries if\\\\r\\\\n        // there\\\\\'s nothing to change.\\\\r\\\\n        var anythingChanged = false;\\\\r\\\\n        var newObj = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].deepClone(oldObj);\\\\r\\\\n        for (var propPath in mods) {\\\\r\\\\n            var mod = mods[propPath];\\\\r\\\\n            if (typeof mod === \\\\\'undefined\\\\\') {\\\\r\\\\n                __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].delByKeyPath(newObj, propPath);\\\\r\\\\n                modsWithoutUndefined[propPath] = null; // Null is as close we could come to deleting a property when not allowing undefined.\\\\r\\\\n                anythingChanged = true;\\\\r\\\\n            }\\\\r\\\\n            else {\\\\r\\\\n                var currentValue = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].getByKeyPath(oldObj, propPath);\\\\r\\\\n                if (mod !== currentValue && JSON.stringify(mod) !== JSON.stringify(currentValue)) {\\\\r\\\\n                    __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].setByKeyPath(newObj, propPath, mod);\\\\r\\\\n                    modsWithoutUndefined[propPath] = mod;\\\\r\\\\n                    anythingChanged = true;\\\\r\\\\n                }\\\\r\\\\n            }\\\\r\\\\n        }\\\\r\\\\n        if (anythingChanged) {\\\\r\\\\n            var change = {\\\\r\\\\n                source: trans.source || null,\\\\r\\\\n                table: tableName,\\\\r\\\\n                key: primKey,\\\\r\\\\n                type: UPDATE,\\\\r\\\\n                mods: modsWithoutUndefined,\\\\r\\\\n                oldObj: oldObj,\\\\r\\\\n                obj: newObj\\\\r\\\\n            };\\\\r\\\\n            var promise = db._changes.add(change); // Just so we get the correct revision order of the update...\\\\r\\\\n            this.onsuccess = function () {\\\\r\\\\n                promise._then(function (rev) {\\\\r\\\\n                    trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\\\\r\\\\n                });\\\\r\\\\n            };\\\\r\\\\n            this.onerror = function () {\\\\r\\\\n                // If the main operation fails, make sure to regret the change.\\\\r\\\\n                promise._then(function (rev) {\\\\r\\\\n                    // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\\\\r\\\\n                    db._changes.delete(rev);\\\\r\\\\n                });\\\\r\\\\n            };\\\\r\\\\n        }\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initDeletingHook(db, tableName) {\\\\r\\\\n    return function deletingHook(primKey, obj, trans) {\\\\r\\\\n        /// <param name=\\"trans\\" type=\\"db.Transaction\\"></param>\\\\r\\\\n        var promise = db._changes.add({\\\\r\\\\n            source: trans.source || null,\\\\r\\\\n            table: tableName,\\\\r\\\\n            key: primKey,\\\\r\\\\n            type: DELETE,\\\\r\\\\n            oldObj: obj\\\\r\\\\n        }).then(function (rev) {\\\\r\\\\n            trans._lastWrittenRevision = Math.max(trans._lastWrittenRevision, rev);\\\\r\\\\n            return rev;\\\\r\\\\n        })\\\\r\\\\n            .catch(function (e) {\\\\r\\\\n            console.log(obj);\\\\r\\\\n            console.log(e.stack);\\\\r\\\\n        });\\\\r\\\\n        this.onerror = function () {\\\\r\\\\n            // If the main operation fails, make sure to regret the change.\\\\r\\\\n            // Using _then because if promise is already fullfilled, the standard then() would\\\\r\\\\n            // do setTimeout() and we would loose the transaction.\\\\r\\\\n            promise._then(function (rev) {\\\\r\\\\n                // Will only happen if app code catches the main operation error to prohibit transaction from aborting.\\\\r\\\\n                db._changes.delete(rev);\\\\r\\\\n            });\\\\r\\\\n        };\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initCrudMonitor(db) {\\\\r\\\\n    //\\\\r\\\\n    // The Creating/Updating/Deleting hook will make sure any change is stored to the changes table\\\\r\\\\n    //\\\\r\\\\n    return function crudMonitor(table) {\\\\r\\\\n        /// <param name=\\"table\\" type=\\"db.Table\\"></param>\\\\r\\\\n        if (table.hook._observing)\\\\r\\\\n            return;\\\\r\\\\n        table.hook._observing = true;\\\\r\\\\n        var tableName = table.name;\\\\r\\\\n        table.hook(\\\\\'creating\\\\\').subscribe(initCreatingHook(db, table));\\\\r\\\\n        table.hook(\\\\\'updating\\\\\').subscribe(initUpdatingHook(db, tableName));\\\\r\\\\n        table.hook(\\\\\'deleting\\\\\').subscribe(initDeletingHook(db, tableName));\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initOnStorage(Observable) {\\\\r\\\\n    return function onStorage(event) {\\\\r\\\\n        // We use the onstorage event to trigger onLatestRevisionIncremented since we will wake up when other windows modify the DB as well!\\\\r\\\\n        if (event.key.indexOf(\\"Dexie.Observable/\\") === 0) {\\\\r\\\\n            var parts = event.key.split(\\\\\'/\\\\\');\\\\r\\\\n            var prop = parts[1];\\\\r\\\\n            var dbname = parts[2];\\\\r\\\\n            if (prop === \\\\\'latestRevision\\\\\') {\\\\r\\\\n                var rev = parseInt(event.newValue, 10);\\\\r\\\\n                if (!isNaN(rev) && rev > Observable.latestRevision[dbname]) {\\\\r\\\\n                    Observable.latestRevision[dbname] = rev;\\\\r\\\\n                    __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n                        Observable.on(\\\\\'latestRevisionIncremented\\\\\').fire(dbname, rev);\\\\r\\\\n                    });\\\\r\\\\n                }\\\\r\\\\n            }\\\\r\\\\n            else if (prop.indexOf(\\"deadnode:\\") === 0) {\\\\r\\\\n                var nodeID = parseInt(prop.split(\\\\\':\\\\\')[1], 10);\\\\r\\\\n                if (event.newValue) {\\\\r\\\\n                    Observable.on.suicideNurseCall.fire(dbname, nodeID);\\\\r\\\\n                }\\\\r\\\\n            }\\\\r\\\\n            else if (prop === \\\\\'intercomm\\\\\') {\\\\r\\\\n                if (event.newValue) {\\\\r\\\\n                    Observable.on.intercomm.fire(dbname);\\\\r\\\\n                }\\\\r\\\\n            }\\\\r\\\\n        }\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction initOverrideOpen(db, SyncNode, crudMonitor) {\\\\r\\\\n    return function overrideOpen(origOpen) {\\\\r\\\\n        return function () {\\\\r\\\\n            //\\\\r\\\\n            // Make sure to subscribe to \\"creating\\", \\"updating\\" and \\"deleting\\" hooks for all observable tables that were created in the stores() method.\\\\r\\\\n            //\\\\r\\\\n            Object.keys(db._allTables).forEach(function (tableName) {\\\\r\\\\n                var table = db._allTables[tableName];\\\\r\\\\n                if (table.schema.observable) {\\\\r\\\\n                    crudMonitor(table);\\\\r\\\\n                }\\\\r\\\\n                if (table.name === \\"_syncNodes\\") {\\\\r\\\\n                    table.mapToClass(SyncNode);\\\\r\\\\n                }\\\\r\\\\n            });\\\\r\\\\n            return origOpen.apply(this, arguments);\\\\r\\\\n        };\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nvar Promise$1 = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].Promise;\\\\r\\\\nfunction initIntercomm(db, Observable, SyncNode, mySyncNode, localStorage) {\\\\r\\\\n    //\\\\r\\\\n    // Intercommunication between nodes\\\\r\\\\n    //\\\\r\\\\n    // Enable inter-process communication between browser windows using localStorage storage event (is registered in Dexie.Observable)\\\\r\\\\n    var requestsWaitingForReply = {};\\\\r\\\\n    /**\\\\r\\\\n     * @param {string} type Type of message\\\\r\\\\n     * @param message Message to send\\\\r\\\\n     * @param {number} destinationNode ID of destination node\\\\r\\\\n     * @param {{wantReply: boolean, isFailure: boolean, requestId: number}} options If {wantReply: true}, the returned promise will complete with the reply from remote. Otherwise it will complete when message has been successfully sent.</param>\\\\r\\\\n     */\\\\r\\\\n    db.observable.sendMessage = function (type, message, destinationNode, options) {\\\\r\\\\n        /// <param name=\\"type\\" type=\\"String\\">Type of message</param>\\\\r\\\\n        /// <param name=\\"message\\">Message to send</param>\\\\r\\\\n        /// <param name=\\"destinationNode\\" type=\\"Number\\">ID of destination node</param>\\\\r\\\\n        /// <param name=\\"options\\" type=\\"Object\\" optional=\\"true\\">{wantReply: Boolean, isFailure: Boolean, requestId: Number}. If wantReply, the returned promise will complete with the reply from remote. Otherwise it will complete when message has been successfully sent.</param>\\\\r\\\\n        options = options || {};\\\\r\\\\n        if (!mySyncNode.node)\\\\r\\\\n            return options.wantReply ?\\\\r\\\\n                Promise$1.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].DatabaseClosedError()) :\\\\r\\\\n                Promise$1.resolve(); // If caller doesn\\\\\'t want a reply, it won\\\\\'t catch errors either.\\\\r\\\\n        var msg = { message: message, destinationNode: destinationNode, sender: mySyncNode.node.id, type: type };\\\\r\\\\n        __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].extend(msg, options); // wantReply: wantReply, success: !isFailure, requestId: ...\\\\r\\\\n        return __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n            var tables = [\\"_intercomm\\"];\\\\r\\\\n            if (options.wantReply)\\\\r\\\\n                tables.push(\\"_syncNodes\\"); // If caller wants a reply, include \\"_syncNodes\\" in transaction to check that there\\\\\'s a receiver there. Otherwise, new master will get it.\\\\r\\\\n            var promise = db.transaction(\\\\\'rw\\\\\', tables, function () {\\\\r\\\\n                if (options.wantReply) {\\\\r\\\\n                    // Check that there is a receiver there to take the request.\\\\r\\\\n                    return db._syncNodes.where(\\\\\'id\\\\\').equals(destinationNode).count(function (receiverAlive) {\\\\r\\\\n                        if (receiverAlive)\\\\r\\\\n                            return db._intercomm.add(msg);\\\\r\\\\n                        else\\\\r\\\\n                            return db._syncNodes.where(\\\\\'isMaster\\\\\').above(0).first(function (masterNode) {\\\\r\\\\n                                msg.destinationNode = masterNode.id;\\\\r\\\\n                                return db._intercomm.add(msg);\\\\r\\\\n                            });\\\\r\\\\n                    });\\\\r\\\\n                }\\\\r\\\\n                else {\\\\r\\\\n                    // If caller doesn\\\\\'t need a response, we don\\\\\'t have to make sure that it gets one.\\\\r\\\\n                    return db._intercomm.add(msg);\\\\r\\\\n                }\\\\r\\\\n            }).then(function (messageId) {\\\\r\\\\n                var rv = null;\\\\r\\\\n                if (options.wantReply) {\\\\r\\\\n                    rv = new Promise$1(function (resolve, reject) {\\\\r\\\\n                        requestsWaitingForReply[messageId.toString()] = { resolve: resolve, reject: reject };\\\\r\\\\n                    });\\\\r\\\\n                }\\\\r\\\\n                if (localStorage) {\\\\r\\\\n                    localStorage.setItem(\\"Dexie.Observable/intercomm/\\" + db.name, messageId.toString());\\\\r\\\\n                }\\\\r\\\\n                Observable.on.intercomm.fire(db.name);\\\\r\\\\n                return rv;\\\\r\\\\n            });\\\\r\\\\n            if (!options.wantReply) {\\\\r\\\\n                promise.catch(function () {\\\\r\\\\n                });\\\\r\\\\n                return;\\\\r\\\\n            }\\\\r\\\\n            else {\\\\r\\\\n                // Forward rejection to caller if it waits for reply.\\\\r\\\\n                return promise;\\\\r\\\\n            }\\\\r\\\\n        });\\\\r\\\\n    };\\\\r\\\\n    // Send a message to all local _syncNodes\\\\r\\\\n    db.observable.broadcastMessage = function (type, message, bIncludeSelf) {\\\\r\\\\n        if (!mySyncNode.node)\\\\r\\\\n            return;\\\\r\\\\n        var mySyncNodeId = mySyncNode.node.id;\\\\r\\\\n        __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n            db._syncNodes.toArray(function (nodes) {\\\\r\\\\n                return Promise$1.all(nodes\\\\r\\\\n                    .filter(function (node) { return node.type === \\\\\'local\\\\\' && (bIncludeSelf || node.id !== mySyncNodeId); })\\\\r\\\\n                    .map(function (node) { return db.observable.sendMessage(type, message, node.id); }));\\\\r\\\\n            }).catch(function () {\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    };\\\\r\\\\n    function consumeIntercommMessages() {\\\\r\\\\n        // Check if we got messages:\\\\r\\\\n        if (!mySyncNode.node)\\\\r\\\\n            return Promise$1.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].DatabaseClosedError());\\\\r\\\\n        return __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n            return db.transaction(\\\\\'rw\\\\\', \\\\\'_intercomm\\\\\', function () {\\\\r\\\\n                return db._intercomm.where({ destinationNode: mySyncNode.node.id }).toArray(function (messages) {\\\\r\\\\n                    messages.forEach(function (msg) { return consumeMessage(msg); });\\\\r\\\\n                    return db._intercomm.where(\\\\\'id\\\\\').anyOf(messages.map(function (msg) { return msg.id; })).delete();\\\\r\\\\n                });\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    }\\\\r\\\\n    function consumeMessage(msg) {\\\\r\\\\n        if (msg.type === \\\\\'response\\\\\') {\\\\r\\\\n            // This is a response. Lookup pending request and fulfill its promise.\\\\r\\\\n            var request = requestsWaitingForReply[msg.requestId.toString()];\\\\r\\\\n            if (request) {\\\\r\\\\n                if (msg.isFailure) {\\\\r\\\\n                    request.reject(msg.message.error);\\\\r\\\\n                }\\\\r\\\\n                else {\\\\r\\\\n                    request.resolve(msg.message.result);\\\\r\\\\n                }\\\\r\\\\n                delete requestsWaitingForReply[msg.requestId.toString()];\\\\r\\\\n            }\\\\r\\\\n        }\\\\r\\\\n        else {\\\\r\\\\n            // This is a message or request. Fire the event and add an API for the subscriber to use if reply is requested\\\\r\\\\n            msg.resolve = function (result) {\\\\r\\\\n                db.observable.sendMessage(\\\\\'response\\\\\', { result: result }, msg.sender, { requestId: msg.id });\\\\r\\\\n            };\\\\r\\\\n            msg.reject = function (error) {\\\\r\\\\n                db.observable.sendMessage(\\\\\'response\\\\\', { error: error.toString() }, msg.sender, { isFailure: true, requestId: msg.id });\\\\r\\\\n            };\\\\r\\\\n            db.on.message.fire(msg);\\\\r\\\\n        }\\\\r\\\\n    }\\\\r\\\\n    // Listener for \\\\\'intercomm\\\\\' events\\\\r\\\\n    // Gets fired when we get a \\\\\'storage\\\\\' event from local storage or when sendMessage is called\\\\r\\\\n    // \\\\\'storage\\\\\' is used to communicate between tabs (sendMessage changes the localStorage to trigger the event)\\\\r\\\\n    // sendMessage is used to communicate in the same tab and to trigger a storage event\\\\r\\\\n    function onIntercomm(dbname) {\\\\r\\\\n        // When storage event trigger us to check\\\\r\\\\n        if (dbname === db.name) {\\\\r\\\\n            consumeIntercommMessages().catch(\\\\\'DatabaseClosedError\\\\\', function () { });\\\\r\\\\n        }\\\\r\\\\n    }\\\\r\\\\n    return {\\\\r\\\\n        onIntercomm: onIntercomm,\\\\r\\\\n        consumeIntercommMessages: consumeIntercommMessages\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction overrideParseStoresSpec(origFunc) {\\\\r\\\\n    return function (stores, dbSchema) {\\\\r\\\\n        // Create the _changes and _syncNodes tables\\\\r\\\\n        stores[\\"_changes\\"] = \\"++rev\\";\\\\r\\\\n        stores[\\"_syncNodes\\"] = \\"++id,myRevision,lastHeartBeat,&url,isMaster,type,status\\";\\\\r\\\\n        stores[\\"_intercomm\\"] = \\"++id,destinationNode\\";\\\\r\\\\n        stores[\\"_uncommittedChanges\\"] = \\"++id,node\\"; // For remote syncing when server returns a partial result.\\\\r\\\\n        // Call default implementation. Will populate the dbSchema structures.\\\\r\\\\n        origFunc.call(this, stores, dbSchema);\\\\r\\\\n        // Allow UUID primary keys using $$ prefix on primary key or indexes\\\\r\\\\n        Object.keys(dbSchema).forEach(function (tableName) {\\\\r\\\\n            var schema = dbSchema[tableName];\\\\r\\\\n            if (schema.primKey.name.indexOf(\\\\\'$$\\\\\') === 0) {\\\\r\\\\n                schema.primKey.uuid = true;\\\\r\\\\n                schema.primKey.name = schema.primKey.name.substr(2);\\\\r\\\\n                schema.primKey.keyPath = schema.primKey.keyPath.substr(2);\\\\r\\\\n            }\\\\r\\\\n        });\\\\r\\\\n        // Now mark all observable tables\\\\r\\\\n        Object.keys(dbSchema).forEach(function (tableName) {\\\\r\\\\n            // Marked observable tables with \\"observable\\" in their TableSchema.\\\\r\\\\n            if (tableName.indexOf(\\\\\'_\\\\\') !== 0 && tableName.indexOf(\\\\\'$\\\\\') !== 0) {\\\\r\\\\n                dbSchema[tableName].observable = true;\\\\r\\\\n            }\\\\r\\\\n        });\\\\r\\\\n    };\\\\r\\\\n}\\\\n\\\\nfunction deleteOldChanges(db) {\\\\r\\\\n    // This is a background job and should never be done within\\\\r\\\\n    // a caller\\\\\'s transaction. Use Dexie.ignoreTransaction() to ensure that.\\\\r\\\\n    // We should not return the Promise but catch it ourselves instead.\\\\r\\\\n    // To prohibit starving the database we want to lock transactions as short as possible\\\\r\\\\n    // and since we\\\\\'re not in a hurry, we could do this job in chunks and reschedule a\\\\r\\\\n    // continuation every 500 ms.\\\\r\\\\n    var CHUNK_SIZE = 100;\\\\r\\\\n    __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n        return db._syncNodes.orderBy(\\"myRevision\\").first(function (oldestNode) {\\\\r\\\\n            return db._changes\\\\r\\\\n                .where(\\"rev\\").below(oldestNode.myRevision)\\\\r\\\\n                .limit(CHUNK_SIZE)\\\\r\\\\n                .primaryKeys();\\\\r\\\\n        }).then(function (keysToDelete) {\\\\r\\\\n            if (keysToDelete.length === 0)\\\\r\\\\n                return; // Done.\\\\r\\\\n            return db._changes.bulkDelete(keysToDelete).then(function () {\\\\r\\\\n                // If not done garbage collecting, reschedule a continuation of it until done.\\\\r\\\\n                if (keysToDelete.length === CHUNK_SIZE) {\\\\r\\\\n                    // Limit reached. Changes are there are more job to do. Schedule again:\\\\r\\\\n                    setTimeout(function () { return db.isOpen() && deleteOldChanges(db); }, 500);\\\\r\\\\n                }\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    }).catch(function () {\\\\r\\\\n        // The operation is not crucial. A failure could almost only be due to that database has been closed.\\\\r\\\\n        // No need to log this.\\\\r\\\\n    });\\\\r\\\\n}\\\\n\\\\n/* ==========================================================================\\\\r\\\\n *                           dexie-observable.js\\\\r\\\\n * ==========================================================================\\\\r\\\\n *\\\\r\\\\n * Dexie addon for observing database changes not just on local db instance\\\\r\\\\n * but also on other instances, tabs and windows.\\\\r\\\\n *\\\\r\\\\n * Comprises a base framework for dexie-syncable.js\\\\r\\\\n *\\\\r\\\\n * By David Fahlander, david.fahlander@gmail.com,\\\\r\\\\n *    Nikolas Poniros, https://github.com/nponiros\\\\r\\\\n *\\\\r\\\\n * ==========================================================================\\\\r\\\\n *\\\\r\\\\n * Version {version}, {date}\\\\r\\\\n *\\\\r\\\\n * http://dexie.org\\\\r\\\\n *\\\\r\\\\n * Apache License Version 2.0, January 2004, http://www.apache.org/licenses/\\\\r\\\\n *\\\\r\\\\n */\\\\r\\\\nvar global = self;\\\\r\\\\n/** class DatabaseChange\\\\r\\\\n    *\\\\r\\\\n    *  Object contained by the _changes table.\\\\r\\\\n    */\\\\r\\\\nvar DatabaseChange = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].defineClass({\\\\r\\\\n    rev: Number,\\\\r\\\\n    source: String,\\\\r\\\\n    table: String,\\\\r\\\\n    key: Object,\\\\r\\\\n    type: Number,\\\\r\\\\n    obj: Object,\\\\r\\\\n    mods: Object,\\\\r\\\\n    oldObj: Object // DELETE: oldObj contains the object deleted. UPDATE: oldObj contains the old object before updates applied.\\\\r\\\\n});\\\\r\\\\n// Import some usable helper functions\\\\r\\\\nvar override = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].override;\\\\r\\\\nvar Promise = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].Promise;\\\\r\\\\nvar browserIsShuttingDown = false;\\\\r\\\\nfunction Observable(db) {\\\\r\\\\n    /// <summary>\\\\r\\\\n    ///   Extension to Dexie providing Syncronization capabilities to Dexie.\\\\r\\\\n    /// </summary>\\\\r\\\\n    /// <param name=\\"db\\" type=\\"Dexie\\"></param>\\\\r\\\\n    var NODE_TIMEOUT = 20000, // 20 seconds before local db instances are timed out. This is so that old changes can be deleted when not needed and to garbage collect old _syncNodes objects.\\\\r\\\\n    HIBERNATE_GRACE_PERIOD = 20000, // 20 seconds\\\\r\\\\n    // LOCAL_POLL: The time to wait before polling local db for changes and cleaning up old nodes. \\\\r\\\\n    // Polling for changes is a fallback only needed in certain circomstances (when the onstorage event doesnt reach all listeners - when different browser windows doesnt share the same process)\\\\r\\\\n    LOCAL_POLL = 500, // 500 ms. In real-world there will be this value + the time it takes to poll(). A small value is needed in Workers where we cannot rely on storage event.\\\\r\\\\n    HEARTBEAT_INTERVAL = NODE_TIMEOUT - 5000;\\\\r\\\\n    var localStorage = Observable.localStorageImpl;\\\\r\\\\n    /** class SyncNode\\\\r\\\\n        *\\\\r\\\\n        * Object contained in the _syncNodes table.\\\\r\\\\n        */\\\\r\\\\n    var SyncNode = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].defineClass({\\\\r\\\\n        //id: Number,\\\\r\\\\n        myRevision: Number,\\\\r\\\\n        type: String,\\\\r\\\\n        lastHeartBeat: Number,\\\\r\\\\n        deleteTimeStamp: Number,\\\\r\\\\n        url: String,\\\\r\\\\n        isMaster: Number,\\\\r\\\\n        // Below properties should be extended in Dexie.Syncable. Not here. They apply to remote nodes only (type == \\"remote\\"):\\\\r\\\\n        syncProtocol: String,\\\\r\\\\n        syncContext: null,\\\\r\\\\n        syncOptions: Object,\\\\r\\\\n        connected: false,\\\\r\\\\n        status: Number,\\\\r\\\\n        appliedRemoteRevision: null,\\\\r\\\\n        remoteBaseRevisions: [{ local: Number, remote: null }],\\\\r\\\\n        dbUploadState: {\\\\r\\\\n            tablesToUpload: [String],\\\\r\\\\n            currentTable: String,\\\\r\\\\n            currentKey: null,\\\\r\\\\n            localBaseRevision: Number\\\\r\\\\n        }\\\\r\\\\n    });\\\\r\\\\n    db.observable = {};\\\\r\\\\n    db.observable.SyncNode = SyncNode;\\\\r\\\\n    var wakeupObservers = initWakeupObservers(db, Observable, localStorage);\\\\r\\\\n    var overrideCreateTransaction = initOverrideCreateTransaction(db, wakeupObservers);\\\\r\\\\n    var crudMonitor = initCrudMonitor(db);\\\\r\\\\n    var overrideOpen = initOverrideOpen(db, SyncNode, crudMonitor);\\\\r\\\\n    var mySyncNode = { node: null };\\\\r\\\\n    var intercomm = initIntercomm(db, Observable, SyncNode, mySyncNode, localStorage);\\\\r\\\\n    var onIntercomm = intercomm.onIntercomm;\\\\r\\\\n    var consumeIntercommMessages = intercomm.consumeIntercommMessages;\\\\r\\\\n    // Allow other addons to access the local sync node. May be needed by Dexie.Syncable.\\\\r\\\\n    Object.defineProperty(db, \\"_localSyncNode\\", {\\\\r\\\\n        get: function () { return mySyncNode.node; }\\\\r\\\\n    });\\\\r\\\\n    var pollHandle = null, heartbeatHandle = null;\\\\r\\\\n    if (__WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].fake) {\\\\r\\\\n        // This code will never run.\\\\r\\\\n        // It\\\\\'s here just to enable auto-complete in visual studio - helps a lot when writing code.\\\\r\\\\n        db.version(1).stores({\\\\r\\\\n            _syncNodes: \\"++id,myRevision,lastHeartBeat\\",\\\\r\\\\n            _changes: \\"++rev\\",\\\\r\\\\n            _intercomm: \\"++id,destinationNode\\",\\\\r\\\\n            _uncommittedChanges: \\"++id,node\\"\\\\r\\\\n        });\\\\r\\\\n        db._syncNodes.mapToClass(SyncNode);\\\\r\\\\n        db._changes.mapToClass(DatabaseChange);\\\\r\\\\n        mySyncNode.node = new SyncNode({\\\\r\\\\n            myRevision: 0,\\\\r\\\\n            type: \\"local\\",\\\\r\\\\n            lastHeartBeat: Date.now(),\\\\r\\\\n            deleteTimeStamp: null\\\\r\\\\n        });\\\\r\\\\n    }\\\\r\\\\n    //\\\\r\\\\n    // Override parsing the stores to add \\"_changes\\" and \\"_syncNodes\\" tables.\\\\r\\\\n    // It also adds UUID support for the primary key and sets tables as observable tables.\\\\r\\\\n    //\\\\r\\\\n    db.Version.prototype._parseStoresSpec = override(db.Version.prototype._parseStoresSpec, overrideParseStoresSpec);\\\\r\\\\n    // changes event on db:\\\\r\\\\n    db.on.addEventType({\\\\r\\\\n        changes: \\\\\'asap\\\\\',\\\\r\\\\n        cleanup: [promisableChain, nop],\\\\r\\\\n        message: \\\\\'asap\\\\\'\\\\r\\\\n    });\\\\r\\\\n    //\\\\r\\\\n    // Override transaction creation to always include the \\"_changes\\" store when any observable store is involved.\\\\r\\\\n    //\\\\r\\\\n    db._createTransaction = override(db._createTransaction, overrideCreateTransaction);\\\\r\\\\n    // If Observable.latestRevsion[db.name] is undefined, set it to 0 so that comparing against it always works.\\\\r\\\\n    // You might think that it will always be undefined before this call, but in case another Dexie instance in the same\\\\r\\\\n    // window with the same database name has been created already, this static property will already be set correctly.\\\\r\\\\n    Observable.latestRevision[db.name] = Observable.latestRevision[db.name] || 0;\\\\r\\\\n    //\\\\r\\\\n    // Override open to setup hooks for db changes and map the _syncNodes table to class\\\\r\\\\n    //\\\\r\\\\n    db.open = override(db.open, overrideOpen);\\\\r\\\\n    db.close = override(db.close, function (origClose) {\\\\r\\\\n        return function () {\\\\r\\\\n            if (db.dynamicallyOpened())\\\\r\\\\n                return origClose.apply(this, arguments); // Don\\\\\'t observe dynamically opened databases.\\\\r\\\\n            // Teardown our framework.\\\\r\\\\n            if (wakeupObservers.timeoutHandle) {\\\\r\\\\n                clearTimeout(wakeupObservers.timeoutHandle);\\\\r\\\\n                delete wakeupObservers.timeoutHandle;\\\\r\\\\n            }\\\\r\\\\n            Observable.on(\\\\\'latestRevisionIncremented\\\\\').unsubscribe(onLatestRevisionIncremented);\\\\r\\\\n            Observable.on(\\\\\'suicideNurseCall\\\\\').unsubscribe(onSuicide);\\\\r\\\\n            Observable.on(\\\\\'intercomm\\\\\').unsubscribe(onIntercomm);\\\\r\\\\n            Observable.on(\\\\\'beforeunload\\\\\').unsubscribe(onBeforeUnload);\\\\r\\\\n            // Inform other db instances in same window that we are dying:\\\\r\\\\n            if (mySyncNode.node && mySyncNode.node.id) {\\\\r\\\\n                Observable.on.suicideNurseCall.fire(db.name, mySyncNode.node.id);\\\\r\\\\n                // Inform other windows as well:\\\\r\\\\n                if (localStorage) {\\\\r\\\\n                    localStorage.setItem(\\\\\'Dexie.Observable/deadnode:\\\\\' + mySyncNode.node.id.toString() + \\\\\'/\\\\\' + db.name, \\"dead\\"); // In IE, this will also wakeup our own window. cleanup() may trigger twice per other db instance. But that doesnt to anything.\\\\r\\\\n                }\\\\r\\\\n                mySyncNode.node.deleteTimeStamp = 1; // One millisecond after 1970. Makes it occur in the past but still keeps it truthy.\\\\r\\\\n                mySyncNode.node.lastHeartBeat = 0;\\\\r\\\\n                db._syncNodes.put(mySyncNode.node); // This async operation may be cancelled since the browser is closing down now.\\\\r\\\\n                mySyncNode.node = null;\\\\r\\\\n            }\\\\r\\\\n            if (pollHandle)\\\\r\\\\n                clearTimeout(pollHandle);\\\\r\\\\n            pollHandle = null;\\\\r\\\\n            if (heartbeatHandle)\\\\r\\\\n                clearTimeout(heartbeatHandle);\\\\r\\\\n            heartbeatHandle = null;\\\\r\\\\n            return origClose.apply(this, arguments);\\\\r\\\\n        };\\\\r\\\\n    });\\\\r\\\\n    // Override Dexie.delete() in order to delete Observable.latestRevision[db.name].\\\\r\\\\n    db.delete = override(db.delete, function (origDelete) {\\\\r\\\\n        return function () {\\\\r\\\\n            return origDelete.apply(this, arguments).then(function (result) {\\\\r\\\\n                // Reset Observable.latestRevision[db.name]\\\\r\\\\n                Observable.latestRevision[db.name] = 0;\\\\r\\\\n                return result;\\\\r\\\\n            });\\\\r\\\\n        };\\\\r\\\\n    });\\\\r\\\\n    // When db opens, make sure to start monitor any changes before other db operations will start.\\\\r\\\\n    db.on(\\"ready\\", function startObserving() {\\\\r\\\\n        if (db.dynamicallyOpened())\\\\r\\\\n            return db; // Don\\\\\'t observe dynamically opened databases.\\\\r\\\\n        return db.table(\\"_changes\\").orderBy(\\"rev\\").last(function (lastChange) {\\\\r\\\\n            // Since startObserving() is called before database open() method, this will be the first database operation enqueued to db.\\\\r\\\\n            // Therefore we know that the retrieved value will be This query will\\\\r\\\\n            var latestRevision = (lastChange ? lastChange.rev : 0);\\\\r\\\\n            mySyncNode.node = new SyncNode({\\\\r\\\\n                myRevision: latestRevision,\\\\r\\\\n                type: \\"local\\",\\\\r\\\\n                lastHeartBeat: Date.now(),\\\\r\\\\n                deleteTimeStamp: null,\\\\r\\\\n                isMaster: 0\\\\r\\\\n            });\\\\r\\\\n            if (Observable.latestRevision[db.name] < latestRevision) {\\\\r\\\\n                // Side track . For correctness whenever setting Observable.latestRevision[db.name] we must make sure the event is fired if increased:\\\\r\\\\n                // There are other db instances in same window that hasnt yet been informed about a new revision\\\\r\\\\n                Observable.latestRevision[db.name] = latestRevision;\\\\r\\\\n                __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].ignoreTransaction(function () {\\\\r\\\\n                    Observable.on.latestRevisionIncremented.fire(latestRevision);\\\\r\\\\n                });\\\\r\\\\n            }\\\\r\\\\n            // Add new sync node or if this is a reopening of the database after a close() call, update it.\\\\r\\\\n            return db.transaction(\\\\\'rw\\\\\', \\\\\'_syncNodes\\\\\', function () {\\\\r\\\\n                return db._syncNodes\\\\r\\\\n                    .where(\\\\\'isMaster\\\\\').equals(1)\\\\r\\\\n                    .first(function (currentMaster) {\\\\r\\\\n                    if (!currentMaster) {\\\\r\\\\n                        // There\\\\\'s no master. We must be the master\\\\r\\\\n                        mySyncNode.node.isMaster = 1;\\\\r\\\\n                    }\\\\r\\\\n                    else if (currentMaster.lastHeartBeat < Date.now() - NODE_TIMEOUT) {\\\\r\\\\n                        // Master have been inactive for too long\\\\r\\\\n                        // Take over mastership\\\\r\\\\n                        mySyncNode.node.isMaster = 1;\\\\r\\\\n                        currentMaster.isMaster = 0;\\\\r\\\\n                        return db._syncNodes.put(currentMaster);\\\\r\\\\n                    }\\\\r\\\\n                }).then(function () {\\\\r\\\\n                    // Add our node to DB and start subscribing to events\\\\r\\\\n                    return db._syncNodes.add(mySyncNode.node).then(function () {\\\\r\\\\n                        Observable.on(\\\\\'latestRevisionIncremented\\\\\', onLatestRevisionIncremented); // Wakeup when a new revision is available.\\\\r\\\\n                        Observable.on(\\\\\'beforeunload\\\\\', onBeforeUnload);\\\\r\\\\n                        Observable.on(\\\\\'suicideNurseCall\\\\\', onSuicide);\\\\r\\\\n                        Observable.on(\\\\\'intercomm\\\\\', onIntercomm);\\\\r\\\\n                        // Start polling for changes and do cleanups:\\\\r\\\\n                        pollHandle = setTimeout(poll, LOCAL_POLL);\\\\r\\\\n                        // Start heartbeat\\\\r\\\\n                        heartbeatHandle = setTimeout(heartbeat, HEARTBEAT_INTERVAL);\\\\r\\\\n                    });\\\\r\\\\n                });\\\\r\\\\n            }).then(function () {\\\\r\\\\n                cleanup();\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    }, true); // True means the on(ready) event will survive a db reopening (db.close() / db.open()).\\\\r\\\\n    var handledRevision = 0;\\\\r\\\\n    function onLatestRevisionIncremented(dbname, latestRevision) {\\\\r\\\\n        if (dbname === db.name) {\\\\r\\\\n            if (handledRevision >= latestRevision)\\\\r\\\\n                return; // Make sure to only run once per revision. (Workaround for IE triggering storage event on same window)\\\\r\\\\n            handledRevision = latestRevision;\\\\r\\\\n            __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].vip(function () {\\\\r\\\\n                readChanges(latestRevision).catch(\\\\\'DatabaseClosedError\\\\\', function () {\\\\r\\\\n                    // Handle database closed error gracefully while reading changes.\\\\r\\\\n                    // Don\\\\\'t trigger \\\\\'unhandledrejection\\\\\'.\\\\r\\\\n                    // Even though we intercept the close() method, it might be called when in the middle of\\\\r\\\\n                    // reading changes and then that flow will cancel with DatabaseClosedError.\\\\r\\\\n                });\\\\r\\\\n            });\\\\r\\\\n        }\\\\r\\\\n    }\\\\r\\\\n    function readChanges(latestRevision, recursion, wasPartial) {\\\\r\\\\n        // Whenever changes are read, fire db.on(\\"changes\\") with the array of changes. Eventually, limit the array to 1000 entries or so (an entire database is\\\\r\\\\n        // downloaded from server AFTER we are initiated. For example, if first sync call fails, then after a while we get reconnected. However, that scenario\\\\r\\\\n        // should be handled in case database is totally empty we should fail if sync is not available)\\\\r\\\\n        if (!recursion && readChanges.ongoingOperation) {\\\\r\\\\n            // We are already reading changes. Prohibit a parallell execution of this which would lead to duplicate trigging of \\\\\'changes\\\\\' event.\\\\r\\\\n            // Instead, the callback in toArray() will always check Observable.latestRevision[db.name] to see if it has changed and if so, re-launch readChanges().\\\\r\\\\n            // The caller should get the Promise instance from the ongoing operation so that the then() method will resolve when operation is finished.\\\\r\\\\n            return readChanges.ongoingOperation;\\\\r\\\\n        }\\\\r\\\\n        var partial = false;\\\\r\\\\n        var ourSyncNode = mySyncNode.node; // Because mySyncNode can suddenly be set to null on database close, and worse, can be set to a new value if database is reopened.\\\\r\\\\n        if (!ourSyncNode) {\\\\r\\\\n            return Promise.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].DatabaseClosedError());\\\\r\\\\n        }\\\\r\\\\n        var LIMIT = 1000;\\\\r\\\\n        var promise = db._changes.where(\\"rev\\").above(ourSyncNode.myRevision).limit(LIMIT).toArray(function (changes) {\\\\r\\\\n            if (changes.length > 0) {\\\\r\\\\n                var lastChange = changes[changes.length - 1];\\\\r\\\\n                partial = (changes.length === LIMIT);\\\\r\\\\n                db.on(\\\\\'changes\\\\\').fire(changes, partial);\\\\r\\\\n                ourSyncNode.myRevision = lastChange.rev;\\\\r\\\\n            }\\\\r\\\\n            else if (wasPartial) {\\\\r\\\\n                // No more changes, BUT since we have triggered on(\\\\\'changes\\\\\') with partial = true,\\\\r\\\\n                // we HAVE TO trigger changes again with empty list and partial = false\\\\r\\\\n                db.on(\\\\\'changes\\\\\').fire([], false);\\\\r\\\\n            }\\\\r\\\\n            var ourNodeStillExists = false;\\\\r\\\\n            return db._syncNodes.where(\\\\\':id\\\\\').equals(ourSyncNode.id).modify(function (syncNode) {\\\\r\\\\n                ourNodeStillExists = true;\\\\r\\\\n                syncNode.lastHeartBeat = Date.now(); // Update heart beat (not nescessary, but why not!)\\\\r\\\\n                syncNode.deleteTimeStamp = null; // Reset \\"deleteTimeStamp\\" flag if it was there.\\\\r\\\\n                syncNode.myRevision = Math.max(syncNode.myRevision, ourSyncNode.myRevision);\\\\r\\\\n            }).then(function () { return ourNodeStillExists; });\\\\r\\\\n        }).then(function (ourNodeStillExists) {\\\\r\\\\n            if (!ourNodeStillExists) {\\\\r\\\\n                // My node has been deleted. We must have been lazy and got removed by another node.\\\\r\\\\n                if (browserIsShuttingDown) {\\\\r\\\\n                    throw new Error(\\"Browser is shutting down\\");\\\\r\\\\n                }\\\\r\\\\n                else {\\\\r\\\\n                    db.close();\\\\r\\\\n                    console.error(\\"Out of sync\\"); // TODO: What to do? Reload the page?\\\\r\\\\n                    if (global.location)\\\\r\\\\n                        global.location.reload(true);\\\\r\\\\n                    throw new Error(\\"Out of sync\\"); // Will make current promise reject\\\\r\\\\n                }\\\\r\\\\n            }\\\\r\\\\n            // Check if more changes have come since we started reading changes in the first place. If so, relaunch readChanges and let the ongoing promise not\\\\r\\\\n            // resolve until all changes have been read.\\\\r\\\\n            if (partial || Observable.latestRevision[db.name] > ourSyncNode.myRevision) {\\\\r\\\\n                // Either there were more than 1000 changes or additional changes where added while we were reading these changes,\\\\r\\\\n                // In either case, call readChanges() again until we\\\\\'re done.\\\\r\\\\n                return readChanges(Observable.latestRevision[db.name], (recursion || 0) + 1, partial);\\\\r\\\\n            }\\\\r\\\\n        }).finally(function () {\\\\r\\\\n            delete readChanges.ongoingOperation;\\\\r\\\\n        });\\\\r\\\\n        if (!recursion) {\\\\r\\\\n            readChanges.ongoingOperation = promise;\\\\r\\\\n        }\\\\r\\\\n        return promise;\\\\r\\\\n    }\\\\r\\\\n    /**\\\\r\\\\n     * The reason we need heartbeat in parallell with poll() is due to the risk of long-running\\\\r\\\\n     * transactions while syncing changes from server to client in Dexie.Syncable. That transaction will\\\\r\\\\n     * include _changes (which will block readChanges()) but not _syncNodes. So this heartbeat will go on\\\\r\\\\n     * during that changes are being applied and update our lastHeartBeat property while poll() is waiting.\\\\r\\\\n     * When cleanup() (who also is blocked by the sync) wakes up, it won\\\\\'t kill the master node because this\\\\r\\\\n     * heartbeat job will have updated the master node\\\\\'s heartbeat during the long-running sync transaction.\\\\r\\\\n     *\\\\r\\\\n     * If we did not have this heartbeat, and a server send lots of changes that took more than NODE_TIMEOUT\\\\r\\\\n     * (20 seconds), another node waking up after the sync would kill the master node and take over because\\\\r\\\\n     * it would believe it was dead.\\\\r\\\\n     */\\\\r\\\\n    function heartbeat() {\\\\r\\\\n        heartbeatHandle = null;\\\\r\\\\n        var currentInstance = mySyncNode.node && mySyncNode.node.id;\\\\r\\\\n        if (!currentInstance)\\\\r\\\\n            return;\\\\r\\\\n        db.transaction(\\\\\'rw!\\\\\', db._syncNodes, function () {\\\\r\\\\n            db._syncNodes.where({ id: currentInstance }).first(function (ourSyncNode) {\\\\r\\\\n                if (!ourSyncNode) {\\\\r\\\\n                    // We do not exist anymore. Call db.close() to teardown polls etc.\\\\r\\\\n                    if (db.isOpen())\\\\r\\\\n                        db.close();\\\\r\\\\n                    return;\\\\r\\\\n                }\\\\r\\\\n                ourSyncNode.lastHeartBeat = Date.now();\\\\r\\\\n                ourSyncNode.deleteTimeStamp = null; // Reset \\"deleteTimeStamp\\" flag if it was there.\\\\r\\\\n                return db._syncNodes.put(ourSyncNode);\\\\r\\\\n            });\\\\r\\\\n        }).catch(\\\\\'DatabaseClosedError\\\\\', function () {\\\\r\\\\n            // Ignore silently\\\\r\\\\n        }).finally(function () {\\\\r\\\\n            if (mySyncNode.node && mySyncNode.node.id === currentInstance && db.isOpen()) {\\\\r\\\\n                heartbeatHandle = setTimeout(heartbeat, HEARTBEAT_INTERVAL);\\\\r\\\\n            }\\\\r\\\\n        });\\\\r\\\\n    }\\\\r\\\\n    function poll() {\\\\r\\\\n        pollHandle = null;\\\\r\\\\n        var currentInstance = mySyncNode.node && mySyncNode.node.id;\\\\r\\\\n        if (!currentInstance)\\\\r\\\\n            return;\\\\r\\\\n        __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].vip(function () {\\\\r\\\\n            readChanges(Observable.latestRevision[db.name]).then(cleanup).then(consumeIntercommMessages)\\\\r\\\\n                .catch(\\\\\'DatabaseClosedError\\\\\', function () {\\\\r\\\\n                // Handle database closed error gracefully while reading changes.\\\\r\\\\n                // Don\\\\\'t trigger \\\\\'unhandledrejection\\\\\'.\\\\r\\\\n                // Even though we intercept the close() method, it might be called when in the middle of\\\\r\\\\n                // reading changes and then that flow will cancel with DatabaseClosedError.\\\\r\\\\n            })\\\\r\\\\n                .finally(function () {\\\\r\\\\n                // Poll again in given interval:\\\\r\\\\n                if (mySyncNode.node && mySyncNode.node.id === currentInstance && db.isOpen()) {\\\\r\\\\n                    pollHandle = setTimeout(poll, LOCAL_POLL);\\\\r\\\\n                }\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    }\\\\r\\\\n    function cleanup() {\\\\r\\\\n        var ourSyncNode = mySyncNode.node;\\\\r\\\\n        if (!ourSyncNode)\\\\r\\\\n            return Promise.reject(new __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].DatabaseClosedError());\\\\r\\\\n        return db.transaction(\\\\\'rw\\\\\', \\\\\'_syncNodes\\\\\', \\\\\'_changes\\\\\', \\\\\'_intercomm\\\\\', function () {\\\\r\\\\n            // Cleanup dead local nodes that has no heartbeat for over a minute\\\\r\\\\n            // Dont do the following:\\\\r\\\\n            //nodes.where(\\"lastHeartBeat\\").below(Date.now() - NODE_TIMEOUT).and(function (node) { return node.type == \\"local\\"; }).delete();\\\\r\\\\n            // Because client may have been in hybernate mode and recently woken up. That would lead to deletion of all nodes.\\\\r\\\\n            // Instead, we should mark any old nodes for deletion in a minute or so. If they still dont wakeup after that minute we could consider them dead.\\\\r\\\\n            var weBecameMaster = false;\\\\r\\\\n            db._syncNodes.where(\\"lastHeartBeat\\").below(Date.now() - NODE_TIMEOUT).filter(function (node) { return node.type === \\\\\'local\\\\\'; }).modify(function (node) {\\\\r\\\\n                if (node.deleteTimeStamp && node.deleteTimeStamp < Date.now()) {\\\\r\\\\n                    // Delete the node.\\\\r\\\\n                    delete this.value;\\\\r\\\\n                    // Cleanup localStorage \\"deadnode:\\" entry for this node (localStorage API was used to wakeup other windows (onstorage event) - an event type missing in indexedDB.)\\\\r\\\\n                    if (localStorage) {\\\\r\\\\n                        localStorage.removeItem(\\\\\'Dexie.Observable/deadnode:\\\\\' + node.id + \\\\\'/\\\\\' + db.name);\\\\r\\\\n                    }\\\\r\\\\n                    // Check if we are deleting a master node\\\\r\\\\n                    if (node.isMaster) {\\\\r\\\\n                        // The node we are deleting is master. We must take over that role.\\\\r\\\\n                        // OK to call nodes.update(). No need to call Dexie.vip() because nodes is opened in existing transaction!\\\\r\\\\n                        db._syncNodes.update(ourSyncNode, { isMaster: 1 });\\\\r\\\\n                        weBecameMaster = true;\\\\r\\\\n                    }\\\\r\\\\n                    // Cleanup intercomm messages destinated to the node being deleted.\\\\r\\\\n                    // Those that waits for reply should be redirected to us.\\\\r\\\\n                    db._intercomm.where({ destinationNode: node.id }).modify(function (msg) {\\\\r\\\\n                        if (msg.wantReply)\\\\r\\\\n                            msg.destinationNode = ourSyncNode.id;\\\\r\\\\n                        else\\\\r\\\\n                            // Delete the message from DB and if someone is waiting for reply, let ourselved answer the request.\\\\r\\\\n                            delete this.value;\\\\r\\\\n                    });\\\\r\\\\n                }\\\\r\\\\n                else if (!node.deleteTimeStamp) {\\\\r\\\\n                    // Mark the node for deletion\\\\r\\\\n                    node.deleteTimeStamp = Date.now() + HIBERNATE_GRACE_PERIOD;\\\\r\\\\n                }\\\\r\\\\n            }).then(function () {\\\\r\\\\n                // Cleanup old revisions that no node is interested of.\\\\r\\\\n                Observable.deleteOldChanges(db);\\\\r\\\\n                return db.on(\\"cleanup\\").fire(weBecameMaster);\\\\r\\\\n            });\\\\r\\\\n        });\\\\r\\\\n    }\\\\r\\\\n    function onBeforeUnload() {\\\\r\\\\n        // Mark our own sync node for deletion.\\\\r\\\\n        if (!mySyncNode.node)\\\\r\\\\n            return;\\\\r\\\\n        browserIsShuttingDown = true;\\\\r\\\\n        mySyncNode.node.deleteTimeStamp = 1; // One millisecond after 1970. Makes it occur in the past but still keeps it truthy.\\\\r\\\\n        mySyncNode.node.lastHeartBeat = 0;\\\\r\\\\n        db._syncNodes.put(mySyncNode.node); // This async operation may be cancelled since the browser is closing down now.\\\\r\\\\n        Observable.wereTheOneDying = true; // If other nodes in same window wakes up by this call, make sure they dont start taking over mastership and stuff...\\\\r\\\\n        // Inform other windows that we\\\\\'re gone, so that they may take over our role if needed. Setting localStorage item below will trigger Observable.onStorage, which will trigger onSuicie() below:\\\\r\\\\n        if (localStorage) {\\\\r\\\\n            localStorage.setItem(\\\\\'Dexie.Observable/deadnode:\\\\\' + mySyncNode.node.id.toString() + \\\\\'/\\\\\' + db.name, \\"dead\\"); // In IE, this will also wakeup our own window. However, that is doublechecked in nursecall subscriber below.\\\\r\\\\n        }\\\\r\\\\n    }\\\\r\\\\n    function onSuicide(dbname, nodeID) {\\\\r\\\\n        if (dbname === db.name && !Observable.wereTheOneDying) {\\\\r\\\\n            // Make sure it\\\\\'s dead indeed. Second bullet. Why? Because it has marked itself for deletion in the onbeforeunload event, which is fired just before window dies.\\\\r\\\\n            // It\\\\\'s own call to put() may have been cancelled.\\\\r\\\\n            // Note also that in IE, this event may be called twice, but that doesnt harm!\\\\r\\\\n            __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].vip(function () {\\\\r\\\\n                db._syncNodes.update(nodeID, { deleteTimeStamp: 1, lastHeartBeat: 0 }).then(cleanup);\\\\r\\\\n            });\\\\r\\\\n        }\\\\r\\\\n    }\\\\r\\\\n}\\\\r\\\\n//\\\\r\\\\n// Static properties and methods\\\\r\\\\n// \\\\r\\\\nObservable.latestRevision = {}; // Latest revision PER DATABASE. Example: Observable.latestRevision.FriendsDB = 37;\\\\r\\\\nObservable.on = __WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].Events(null, \\"latestRevisionIncremented\\", \\"suicideNurseCall\\", \\"intercomm\\", \\"beforeunload\\"); // fire(dbname, value);\\\\r\\\\nObservable.createUUID = createUUID;\\\\r\\\\nObservable.deleteOldChanges = deleteOldChanges;\\\\r\\\\nObservable._onStorage = initOnStorage(Observable);\\\\r\\\\nObservable._onBeforeUnload = function () {\\\\r\\\\n    Observable.on.beforeunload.fire();\\\\r\\\\n};\\\\r\\\\ntry {\\\\r\\\\n    Observable.localStorageImpl = global.localStorage;\\\\r\\\\n}\\\\r\\\\ncatch (ex) { }\\\\r\\\\n//\\\\r\\\\n// Map window events to static events in Dexie.Observable:\\\\r\\\\n//\\\\r\\\\nif (global.addEventListener) {\\\\r\\\\n    global.addEventListener(\\"storage\\", Observable._onStorage);\\\\r\\\\n    global.addEventListener(\\"beforeunload\\", Observable._onBeforeUnload);\\\\r\\\\n}\\\\r\\\\n// Register addon:\\\\r\\\\n__WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].Observable = Observable;\\\\r\\\\n__WEBPACK_IMPORTED_MODULE_0_dexie__[\\"default\\"].addons.push(Observable);\\\\n\\\\n/* harmony default export */ __webpack_exports__[\\"default\\"] = (Observable);\\\\n//# sourceMappingURL=dexie-observable.es.js.map\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/dexie-observable/dist/dexie-observable.es.js\\\\n// module id = 246\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/dexie-observable/dist/dexie-observable.es.js\')},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var generatePrime = __webpack_require__(126)\\\\nvar primes = __webpack_require__(249)\\\\n\\\\nvar DH = __webpack_require__(248)\\\\n\\\\nfunction getDiffieHellman (mod) {\\\\n  var prime = new Buffer(primes[mod].prime, \'hex\')\\\\n  var gen = new Buffer(primes[mod].gen, \'hex\')\\\\n\\\\n  return new DH(prime, gen)\\\\n}\\\\n\\\\nvar ENCODINGS = {\\\\n  \'binary\': true, \'hex\': true, \'base64\': true\\\\n}\\\\n\\\\nfunction createDiffieHellman (prime, enc, generator, genc) {\\\\n  if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {\\\\n    return createDiffieHellman(prime, \'binary\', enc, generator)\\\\n  }\\\\n\\\\n  enc = enc || \'binary\'\\\\n  genc = genc || \'binary\'\\\\n  generator = generator || new Buffer([2])\\\\n\\\\n  if (!Buffer.isBuffer(generator)) {\\\\n    generator = new Buffer(generator, genc)\\\\n  }\\\\n\\\\n  if (typeof prime === \'number\') {\\\\n    return new DH(generatePrime(prime, generator), generator, true)\\\\n  }\\\\n\\\\n  if (!Buffer.isBuffer(prime)) {\\\\n    prime = new Buffer(prime, enc)\\\\n  }\\\\n\\\\n  return new DH(prime, generator, true)\\\\n}\\\\n\\\\nexports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman\\\\nexports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/diffie-hellman/browser.js\\\\n// module id = 247\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/diffie-hellman/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var BN = __webpack_require__(3);\\\\nvar MillerRabin = __webpack_require__(135);\\\\nvar millerRabin = new MillerRabin();\\\\nvar TWENTYFOUR = new BN(24);\\\\nvar ELEVEN = new BN(11);\\\\nvar TEN = new BN(10);\\\\nvar THREE = new BN(3);\\\\nvar SEVEN = new BN(7);\\\\nvar primes = __webpack_require__(126);\\\\nvar randomBytes = __webpack_require__(29);\\\\nmodule.exports = DH;\\\\n\\\\nfunction setPublicKey(pub, enc) {\\\\n  enc = enc || \'utf8\';\\\\n  if (!Buffer.isBuffer(pub)) {\\\\n    pub = new Buffer(pub, enc);\\\\n  }\\\\n  this._pub = new BN(pub);\\\\n  return this;\\\\n}\\\\n\\\\nfunction setPrivateKey(priv, enc) {\\\\n  enc = enc || \'utf8\';\\\\n  if (!Buffer.isBuffer(priv)) {\\\\n    priv = new Buffer(priv, enc);\\\\n  }\\\\n  this._priv = new BN(priv);\\\\n  return this;\\\\n}\\\\n\\\\nvar primeCache = {};\\\\nfunction checkPrime(prime, generator) {\\\\n  var gen = generator.toString(\'hex\');\\\\n  var hex = [gen, prime.toString(16)].join(\'_\');\\\\n  if (hex in primeCache) {\\\\n    return primeCache[hex];\\\\n  }\\\\n  var error = 0;\\\\n\\\\n  if (prime.isEven() ||\\\\n    !primes.simpleSieve ||\\\\n    !primes.fermatTest(prime) ||\\\\n    !millerRabin.test(prime)) {\\\\n    //not a prime so +1\\\\n    error += 1;\\\\n\\\\n    if (gen === \'02\' || gen === \'05\') {\\\\n      // we\'d be able to check the generator\\\\n      // it would fail so +8\\\\n      error += 8;\\\\n    } else {\\\\n      //we wouldn\'t be able to test the generator\\\\n      // so +4\\\\n      error += 4;\\\\n    }\\\\n    primeCache[hex] = error;\\\\n    return error;\\\\n  }\\\\n  if (!millerRabin.test(prime.shrn(1))) {\\\\n    //not a safe prime\\\\n    error += 2;\\\\n  }\\\\n  var rem;\\\\n  switch (gen) {\\\\n    case \'02\':\\\\n      if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {\\\\n        // unsuidable generator\\\\n        error += 8;\\\\n      }\\\\n      break;\\\\n    case \'05\':\\\\n      rem = prime.mod(TEN);\\\\n      if (rem.cmp(THREE) && rem.cmp(SEVEN)) {\\\\n        // prime mod 10 needs to equal 3 or 7\\\\n        error += 8;\\\\n      }\\\\n      break;\\\\n    default:\\\\n      error += 4;\\\\n  }\\\\n  primeCache[hex] = error;\\\\n  return error;\\\\n}\\\\n\\\\nfunction DH(prime, generator, malleable) {\\\\n  this.setGenerator(generator);\\\\n  this.__prime = new BN(prime);\\\\n  this._prime = BN.mont(this.__prime);\\\\n  this._primeLen = prime.length;\\\\n  this._pub = undefined;\\\\n  this._priv = undefined;\\\\n  this._primeCode = undefined;\\\\n  if (malleable) {\\\\n    this.setPublicKey = setPublicKey;\\\\n    this.setPrivateKey = setPrivateKey;\\\\n  } else {\\\\n    this._primeCode = 8;\\\\n  }\\\\n}\\\\nObject.defineProperty(DH.prototype, \'verifyError\', {\\\\n  enumerable: true,\\\\n  get: function () {\\\\n    if (typeof this._primeCode !== \'number\') {\\\\n      this._primeCode = checkPrime(this.__prime, this.__gen);\\\\n    }\\\\n    return this._primeCode;\\\\n  }\\\\n});\\\\nDH.prototype.generateKeys = function () {\\\\n  if (!this._priv) {\\\\n    this._priv = new BN(randomBytes(this._primeLen));\\\\n  }\\\\n  this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();\\\\n  return this.getPublicKey();\\\\n};\\\\n\\\\nDH.prototype.computeSecret = function (other) {\\\\n  other = new BN(other);\\\\n  other = other.toRed(this._prime);\\\\n  var secret = other.redPow(this._priv).fromRed();\\\\n  var out = new Buffer(secret.toArray());\\\\n  var prime = this.getPrime();\\\\n  if (out.length < prime.length) {\\\\n    var front = new Buffer(prime.length - out.length);\\\\n    front.fill(0);\\\\n    out = Buffer.concat([front, out]);\\\\n  }\\\\n  return out;\\\\n};\\\\n\\\\nDH.prototype.getPublicKey = function getPublicKey(enc) {\\\\n  return formatReturnValue(this._pub, enc);\\\\n};\\\\n\\\\nDH.prototype.getPrivateKey = function getPrivateKey(enc) {\\\\n  return formatReturnValue(this._priv, enc);\\\\n};\\\\n\\\\nDH.prototype.getPrime = function (enc) {\\\\n  return formatReturnValue(this.__prime, enc);\\\\n};\\\\n\\\\nDH.prototype.getGenerator = function (enc) {\\\\n  return formatReturnValue(this._gen, enc);\\\\n};\\\\n\\\\nDH.prototype.setGenerator = function (gen, enc) {\\\\n  enc = enc || \'utf8\';\\\\n  if (!Buffer.isBuffer(gen)) {\\\\n    gen = new Buffer(gen, enc);\\\\n  }\\\\n  this.__gen = gen;\\\\n  this._gen = new BN(gen);\\\\n  return this;\\\\n};\\\\n\\\\nfunction formatReturnValue(bn, enc) {\\\\n  var buf = new Buffer(bn.toArray());\\\\n  if (!enc) {\\\\n    return buf;\\\\n  } else {\\\\n    return buf.toString(enc);\\\\n  }\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/diffie-hellman/lib/dh.js\\\\n// module id = 248\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/diffie-hellman/lib/dh.js\\")},function(module,exports){eval(\'module.exports = {\\"modp1\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff\\"},\\"modp2\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff\\"},\\"modp5\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff\\"},\\"modp14\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff\\"},\\"modp15\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff\\"},\\"modp16\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff\\"},\\"modp17\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff\\"},\\"modp18\\":{\\"gen\\":\\"02\\",\\"prime\\":\\"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff\\"}}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/diffie-hellman/lib/primes.json\\\\n// module id = 249\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/diffie-hellman/lib/primes.json\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(3);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar getNAF = utils.getNAF;\\\\nvar getJSF = utils.getJSF;\\\\nvar assert = utils.assert;\\\\n\\\\nfunction BaseCurve(type, conf) {\\\\n  this.type = type;\\\\n  this.p = new BN(conf.p, 16);\\\\n\\\\n  // Use Montgomery, when there is no fast reduction for the prime\\\\n  this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);\\\\n\\\\n  // Useful for many curves\\\\n  this.zero = new BN(0).toRed(this.red);\\\\n  this.one = new BN(1).toRed(this.red);\\\\n  this.two = new BN(2).toRed(this.red);\\\\n\\\\n  // Curve configuration, optional\\\\n  this.n = conf.n && new BN(conf.n, 16);\\\\n  this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\\\\n\\\\n  // Temporary arrays\\\\n  this._wnafT1 = new Array(4);\\\\n  this._wnafT2 = new Array(4);\\\\n  this._wnafT3 = new Array(4);\\\\n  this._wnafT4 = new Array(4);\\\\n\\\\n  // Generalized Greg Maxwell\'s trick\\\\n  var adjustCount = this.n && this.p.div(this.n);\\\\n  if (!adjustCount || adjustCount.cmpn(100) > 0) {\\\\n    this.redN = null;\\\\n  } else {\\\\n    this._maxwellTrick = true;\\\\n    this.redN = this.n.toRed(this.red);\\\\n  }\\\\n}\\\\nmodule.exports = BaseCurve;\\\\n\\\\nBaseCurve.prototype.point = function point() {\\\\n  throw new Error(\'Not implemented\');\\\\n};\\\\n\\\\nBaseCurve.prototype.validate = function validate() {\\\\n  throw new Error(\'Not implemented\');\\\\n};\\\\n\\\\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\\\\n  assert(p.precomputed);\\\\n  var doubles = p._getDoubles();\\\\n\\\\n  var naf = getNAF(k, 1);\\\\n  var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\\\\n  I /= 3;\\\\n\\\\n  // Translate into more windowed form\\\\n  var repr = [];\\\\n  for (var j = 0; j < naf.length; j += doubles.step) {\\\\n    var nafW = 0;\\\\n    for (var k = j + doubles.step - 1; k >= j; k--)\\\\n      nafW = (nafW << 1) + naf[k];\\\\n    repr.push(nafW);\\\\n  }\\\\n\\\\n  var a = this.jpoint(null, null, null);\\\\n  var b = this.jpoint(null, null, null);\\\\n  for (var i = I; i > 0; i--) {\\\\n    for (var j = 0; j < repr.length; j++) {\\\\n      var nafW = repr[j];\\\\n      if (nafW === i)\\\\n        b = b.mixedAdd(doubles.points[j]);\\\\n      else if (nafW === -i)\\\\n        b = b.mixedAdd(doubles.points[j].neg());\\\\n    }\\\\n    a = a.add(b);\\\\n  }\\\\n  return a.toP();\\\\n};\\\\n\\\\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\\\\n  var w = 4;\\\\n\\\\n  // Precompute window\\\\n  var nafPoints = p._getNAFPoints(w);\\\\n  w = nafPoints.wnd;\\\\n  var wnd = nafPoints.points;\\\\n\\\\n  // Get NAF form\\\\n  var naf = getNAF(k, w);\\\\n\\\\n  // Add `this`*(N+1) for every w-NAF index\\\\n  var acc = this.jpoint(null, null, null);\\\\n  for (var i = naf.length - 1; i >= 0; i--) {\\\\n    // Count zeroes\\\\n    for (var k = 0; i >= 0 && naf[i] === 0; i--)\\\\n      k++;\\\\n    if (i >= 0)\\\\n      k++;\\\\n    acc = acc.dblp(k);\\\\n\\\\n    if (i < 0)\\\\n      break;\\\\n    var z = naf[i];\\\\n    assert(z !== 0);\\\\n    if (p.type === \'affine\') {\\\\n      // J +- P\\\\n      if (z > 0)\\\\n        acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\\\\n      else\\\\n        acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\\\\n    } else {\\\\n      // J +- J\\\\n      if (z > 0)\\\\n        acc = acc.add(wnd[(z - 1) >> 1]);\\\\n      else\\\\n        acc = acc.add(wnd[(-z - 1) >> 1].neg());\\\\n    }\\\\n  }\\\\n  return p.type === \'affine\' ? acc.toP() : acc;\\\\n};\\\\n\\\\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\\\\n                                                       points,\\\\n                                                       coeffs,\\\\n                                                       len,\\\\n                                                       jacobianResult) {\\\\n  var wndWidth = this._wnafT1;\\\\n  var wnd = this._wnafT2;\\\\n  var naf = this._wnafT3;\\\\n\\\\n  // Fill all arrays\\\\n  var max = 0;\\\\n  for (var i = 0; i < len; i++) {\\\\n    var p = points[i];\\\\n    var nafPoints = p._getNAFPoints(defW);\\\\n    wndWidth[i] = nafPoints.wnd;\\\\n    wnd[i] = nafPoints.points;\\\\n  }\\\\n\\\\n  // Comb small window NAFs\\\\n  for (var i = len - 1; i >= 1; i -= 2) {\\\\n    var a = i - 1;\\\\n    var b = i;\\\\n    if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\\\\n      naf[a] = getNAF(coeffs[a], wndWidth[a]);\\\\n      naf[b] = getNAF(coeffs[b], wndWidth[b]);\\\\n      max = Math.max(naf[a].length, max);\\\\n      max = Math.max(naf[b].length, max);\\\\n      continue;\\\\n    }\\\\n\\\\n    var comb = [\\\\n      points[a], /* 1 */\\\\n      null, /* 3 */\\\\n      null, /* 5 */\\\\n      points[b] /* 7 */\\\\n    ];\\\\n\\\\n    // Try to avoid Projective points, if possible\\\\n    if (points[a].y.cmp(points[b].y) === 0) {\\\\n      comb[1] = points[a].add(points[b]);\\\\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\\\\n    } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\\\\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\\\\n      comb[2] = points[a].add(points[b].neg());\\\\n    } else {\\\\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\\\\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\\\\n    }\\\\n\\\\n    var index = [\\\\n      -3, /* -1 -1 */\\\\n      -1, /* -1 0 */\\\\n      -5, /* -1 1 */\\\\n      -7, /* 0 -1 */\\\\n      0, /* 0 0 */\\\\n      7, /* 0 1 */\\\\n      5, /* 1 -1 */\\\\n      1, /* 1 0 */\\\\n      3  /* 1 1 */\\\\n    ];\\\\n\\\\n    var jsf = getJSF(coeffs[a], coeffs[b]);\\\\n    max = Math.max(jsf[0].length, max);\\\\n    naf[a] = new Array(max);\\\\n    naf[b] = new Array(max);\\\\n    for (var j = 0; j < max; j++) {\\\\n      var ja = jsf[0][j] | 0;\\\\n      var jb = jsf[1][j] | 0;\\\\n\\\\n      naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\\\\n      naf[b][j] = 0;\\\\n      wnd[a] = comb;\\\\n    }\\\\n  }\\\\n\\\\n  var acc = this.jpoint(null, null, null);\\\\n  var tmp = this._wnafT4;\\\\n  for (var i = max; i >= 0; i--) {\\\\n    var k = 0;\\\\n\\\\n    while (i >= 0) {\\\\n      var zero = true;\\\\n      for (var j = 0; j < len; j++) {\\\\n        tmp[j] = naf[j][i] | 0;\\\\n        if (tmp[j] !== 0)\\\\n          zero = false;\\\\n      }\\\\n      if (!zero)\\\\n        break;\\\\n      k++;\\\\n      i--;\\\\n    }\\\\n    if (i >= 0)\\\\n      k++;\\\\n    acc = acc.dblp(k);\\\\n    if (i < 0)\\\\n      break;\\\\n\\\\n    for (var j = 0; j < len; j++) {\\\\n      var z = tmp[j];\\\\n      var p;\\\\n      if (z === 0)\\\\n        continue;\\\\n      else if (z > 0)\\\\n        p = wnd[j][(z - 1) >> 1];\\\\n      else if (z < 0)\\\\n        p = wnd[j][(-z - 1) >> 1].neg();\\\\n\\\\n      if (p.type === \'affine\')\\\\n        acc = acc.mixedAdd(p);\\\\n      else\\\\n        acc = acc.add(p);\\\\n    }\\\\n  }\\\\n  // Zeroify references\\\\n  for (var i = 0; i < len; i++)\\\\n    wnd[i] = null;\\\\n\\\\n  if (jacobianResult)\\\\n    return acc;\\\\n  else\\\\n    return acc.toP();\\\\n};\\\\n\\\\nfunction BasePoint(curve, type) {\\\\n  this.curve = curve;\\\\n  this.type = type;\\\\n  this.precomputed = null;\\\\n}\\\\nBaseCurve.BasePoint = BasePoint;\\\\n\\\\nBasePoint.prototype.eq = function eq(/*other*/) {\\\\n  throw new Error(\'Not implemented\');\\\\n};\\\\n\\\\nBasePoint.prototype.validate = function validate() {\\\\n  return this.curve.validate(this);\\\\n};\\\\n\\\\nBaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\\\\n  bytes = utils.toArray(bytes, enc);\\\\n\\\\n  var len = this.p.byteLength();\\\\n\\\\n  // uncompressed, hybrid-odd, hybrid-even\\\\n  if ((bytes[0] === 0x04 || bytes[0] === 0x06 || bytes[0] === 0x07) &&\\\\n      bytes.length - 1 === 2 * len) {\\\\n    if (bytes[0] === 0x06)\\\\n      assert(bytes[bytes.length - 1] % 2 === 0);\\\\n    else if (bytes[0] === 0x07)\\\\n      assert(bytes[bytes.length - 1] % 2 === 1);\\\\n\\\\n    var res =  this.point(bytes.slice(1, 1 + len),\\\\n                          bytes.slice(1 + len, 1 + 2 * len));\\\\n\\\\n    return res;\\\\n  } else if ((bytes[0] === 0x02 || bytes[0] === 0x03) &&\\\\n              bytes.length - 1 === len) {\\\\n    return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 0x03);\\\\n  }\\\\n  throw new Error(\'Unknown point format\');\\\\n};\\\\n\\\\nBasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {\\\\n  return this.encode(enc, true);\\\\n};\\\\n\\\\nBasePoint.prototype._encode = function _encode(compact) {\\\\n  var len = this.curve.p.byteLength();\\\\n  var x = this.getX().toArray(\'be\', len);\\\\n\\\\n  if (compact)\\\\n    return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(x);\\\\n\\\\n  return [ 0x04 ].concat(x, this.getY().toArray(\'be\', len)) ;\\\\n};\\\\n\\\\nBasePoint.prototype.encode = function encode(enc, compact) {\\\\n  return utils.encode(this._encode(compact), enc);\\\\n};\\\\n\\\\nBasePoint.prototype.precompute = function precompute(power) {\\\\n  if (this.precomputed)\\\\n    return this;\\\\n\\\\n  var precomputed = {\\\\n    doubles: null,\\\\n    naf: null,\\\\n    beta: null\\\\n  };\\\\n  precomputed.naf = this._getNAFPoints(8);\\\\n  precomputed.doubles = this._getDoubles(4, power);\\\\n  precomputed.beta = this._getBeta();\\\\n  this.precomputed = precomputed;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nBasePoint.prototype._hasDoubles = function _hasDoubles(k) {\\\\n  if (!this.precomputed)\\\\n    return false;\\\\n\\\\n  var doubles = this.precomputed.doubles;\\\\n  if (!doubles)\\\\n    return false;\\\\n\\\\n  return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);\\\\n};\\\\n\\\\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\\\\n  if (this.precomputed && this.precomputed.doubles)\\\\n    return this.precomputed.doubles;\\\\n\\\\n  var doubles = [ this ];\\\\n  var acc = this;\\\\n  for (var i = 0; i < power; i += step) {\\\\n    for (var j = 0; j < step; j++)\\\\n      acc = acc.dbl();\\\\n    doubles.push(acc);\\\\n  }\\\\n  return {\\\\n    step: step,\\\\n    points: doubles\\\\n  };\\\\n};\\\\n\\\\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\\\\n  if (this.precomputed && this.precomputed.naf)\\\\n    return this.precomputed.naf;\\\\n\\\\n  var res = [ this ];\\\\n  var max = (1 << wnd) - 1;\\\\n  var dbl = max === 1 ? null : this.dbl();\\\\n  for (var i = 1; i < max; i++)\\\\n    res[i] = res[i - 1].add(dbl);\\\\n  return {\\\\n    wnd: wnd,\\\\n    points: res\\\\n  };\\\\n};\\\\n\\\\nBasePoint.prototype._getBeta = function _getBeta() {\\\\n  return null;\\\\n};\\\\n\\\\nBasePoint.prototype.dblp = function dblp(k) {\\\\n  var r = this;\\\\n  for (var i = 0; i < k; i++)\\\\n    r = r.dbl();\\\\n  return r;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curve/base.js\\\\n// module id = 250\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/base.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar curve = __webpack_require__(51);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar BN = __webpack_require__(3);\\\\nvar inherits = __webpack_require__(0);\\\\nvar Base = curve.base;\\\\n\\\\nvar assert = elliptic.utils.assert;\\\\n\\\\nfunction EdwardsCurve(conf) {\\\\n  // NOTE: Important as we are creating point in Base.call()\\\\n  this.twisted = (conf.a | 0) !== 1;\\\\n  this.mOneA = this.twisted && (conf.a | 0) === -1;\\\\n  this.extended = this.mOneA;\\\\n\\\\n  Base.call(this, \'edwards\', conf);\\\\n\\\\n  this.a = new BN(conf.a, 16).umod(this.red.m);\\\\n  this.a = this.a.toRed(this.red);\\\\n  this.c = new BN(conf.c, 16).toRed(this.red);\\\\n  this.c2 = this.c.redSqr();\\\\n  this.d = new BN(conf.d, 16).toRed(this.red);\\\\n  this.dd = this.d.redAdd(this.d);\\\\n\\\\n  assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\\\\n  this.oneC = (conf.c | 0) === 1;\\\\n}\\\\ninherits(EdwardsCurve, Base);\\\\nmodule.exports = EdwardsCurve;\\\\n\\\\nEdwardsCurve.prototype._mulA = function _mulA(num) {\\\\n  if (this.mOneA)\\\\n    return num.redNeg();\\\\n  else\\\\n    return this.a.redMul(num);\\\\n};\\\\n\\\\nEdwardsCurve.prototype._mulC = function _mulC(num) {\\\\n  if (this.oneC)\\\\n    return num;\\\\n  else\\\\n    return this.c.redMul(num);\\\\n};\\\\n\\\\n// Just for compatibility with Short curve\\\\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\\\\n  return this.point(x, y, z, t);\\\\n};\\\\n\\\\nEdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {\\\\n  x = new BN(x, 16);\\\\n  if (!x.red)\\\\n    x = x.toRed(this.red);\\\\n\\\\n  var x2 = x.redSqr();\\\\n  var rhs = this.c2.redSub(this.a.redMul(x2));\\\\n  var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\\\\n\\\\n  var y2 = rhs.redMul(lhs.redInvm());\\\\n  var y = y2.redSqrt();\\\\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\\\\n    throw new Error(\'invalid point\');\\\\n\\\\n  var isOdd = y.fromRed().isOdd();\\\\n  if (odd && !isOdd || !odd && isOdd)\\\\n    y = y.redNeg();\\\\n\\\\n  return this.point(x, y);\\\\n};\\\\n\\\\nEdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {\\\\n  y = new BN(y, 16);\\\\n  if (!y.red)\\\\n    y = y.toRed(this.red);\\\\n\\\\n  // x^2 = (y^2 - 1) / (d y^2 + 1)\\\\n  var y2 = y.redSqr();\\\\n  var lhs = y2.redSub(this.one);\\\\n  var rhs = y2.redMul(this.d).redAdd(this.one);\\\\n  var x2 = lhs.redMul(rhs.redInvm());\\\\n\\\\n  if (x2.cmp(this.zero) === 0) {\\\\n    if (odd)\\\\n      throw new Error(\'invalid point\');\\\\n    else\\\\n      return this.point(this.zero, y);\\\\n  }\\\\n\\\\n  var x = x2.redSqrt();\\\\n  if (x.redSqr().redSub(x2).cmp(this.zero) !== 0)\\\\n    throw new Error(\'invalid point\');\\\\n\\\\n  if (x.isOdd() !== odd)\\\\n    x = x.redNeg();\\\\n\\\\n  return this.point(x, y);\\\\n};\\\\n\\\\nEdwardsCurve.prototype.validate = function validate(point) {\\\\n  if (point.isInfinity())\\\\n    return true;\\\\n\\\\n  // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\\\\n  point.normalize();\\\\n\\\\n  var x2 = point.x.redSqr();\\\\n  var y2 = point.y.redSqr();\\\\n  var lhs = x2.redMul(this.a).redAdd(y2);\\\\n  var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\\\\n\\\\n  return lhs.cmp(rhs) === 0;\\\\n};\\\\n\\\\nfunction Point(curve, x, y, z, t) {\\\\n  Base.BasePoint.call(this, curve, \'projective\');\\\\n  if (x === null && y === null && z === null) {\\\\n    this.x = this.curve.zero;\\\\n    this.y = this.curve.one;\\\\n    this.z = this.curve.one;\\\\n    this.t = this.curve.zero;\\\\n    this.zOne = true;\\\\n  } else {\\\\n    this.x = new BN(x, 16);\\\\n    this.y = new BN(y, 16);\\\\n    this.z = z ? new BN(z, 16) : this.curve.one;\\\\n    this.t = t && new BN(t, 16);\\\\n    if (!this.x.red)\\\\n      this.x = this.x.toRed(this.curve.red);\\\\n    if (!this.y.red)\\\\n      this.y = this.y.toRed(this.curve.red);\\\\n    if (!this.z.red)\\\\n      this.z = this.z.toRed(this.curve.red);\\\\n    if (this.t && !this.t.red)\\\\n      this.t = this.t.toRed(this.curve.red);\\\\n    this.zOne = this.z === this.curve.one;\\\\n\\\\n    // Use extended coordinates\\\\n    if (this.curve.extended && !this.t) {\\\\n      this.t = this.x.redMul(this.y);\\\\n      if (!this.zOne)\\\\n        this.t = this.t.redMul(this.z.redInvm());\\\\n    }\\\\n  }\\\\n}\\\\ninherits(Point, Base.BasePoint);\\\\n\\\\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\\\\n  return Point.fromJSON(this, obj);\\\\n};\\\\n\\\\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\\\\n  return new Point(this, x, y, z, t);\\\\n};\\\\n\\\\nPoint.fromJSON = function fromJSON(curve, obj) {\\\\n  return new Point(curve, obj[0], obj[1], obj[2]);\\\\n};\\\\n\\\\nPoint.prototype.inspect = function inspect() {\\\\n  if (this.isInfinity())\\\\n    return \'<EC Point Infinity>\';\\\\n  return \'<EC Point x: \' + this.x.fromRed().toString(16, 2) +\\\\n      \' y: \' + this.y.fromRed().toString(16, 2) +\\\\n      \' z: \' + this.z.fromRed().toString(16, 2) + \'>\';\\\\n};\\\\n\\\\nPoint.prototype.isInfinity = function isInfinity() {\\\\n  // XXX This code assumes that zero is always zero in red\\\\n  return this.x.cmpn(0) === 0 &&\\\\n         this.y.cmp(this.z) === 0;\\\\n};\\\\n\\\\nPoint.prototype._extDbl = function _extDbl() {\\\\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\\\\n  //     #doubling-dbl-2008-hwcd\\\\n  // 4M + 4S\\\\n\\\\n  // A = X1^2\\\\n  var a = this.x.redSqr();\\\\n  // B = Y1^2\\\\n  var b = this.y.redSqr();\\\\n  // C = 2 * Z1^2\\\\n  var c = this.z.redSqr();\\\\n  c = c.redIAdd(c);\\\\n  // D = a * A\\\\n  var d = this.curve._mulA(a);\\\\n  // E = (X1 + Y1)^2 - A - B\\\\n  var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\\\\n  // G = D + B\\\\n  var g = d.redAdd(b);\\\\n  // F = G - C\\\\n  var f = g.redSub(c);\\\\n  // H = D - B\\\\n  var h = d.redSub(b);\\\\n  // X3 = E * F\\\\n  var nx = e.redMul(f);\\\\n  // Y3 = G * H\\\\n  var ny = g.redMul(h);\\\\n  // T3 = E * H\\\\n  var nt = e.redMul(h);\\\\n  // Z3 = F * G\\\\n  var nz = f.redMul(g);\\\\n  return this.curve.point(nx, ny, nz, nt);\\\\n};\\\\n\\\\nPoint.prototype._projDbl = function _projDbl() {\\\\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\\\\n  //     #doubling-dbl-2008-bbjlp\\\\n  //     #doubling-dbl-2007-bl\\\\n  // and others\\\\n  // Generally 3M + 4S or 2M + 4S\\\\n\\\\n  // B = (X1 + Y1)^2\\\\n  var b = this.x.redAdd(this.y).redSqr();\\\\n  // C = X1^2\\\\n  var c = this.x.redSqr();\\\\n  // D = Y1^2\\\\n  var d = this.y.redSqr();\\\\n\\\\n  var nx;\\\\n  var ny;\\\\n  var nz;\\\\n  if (this.curve.twisted) {\\\\n    // E = a * C\\\\n    var e = this.curve._mulA(c);\\\\n    // F = E + D\\\\n    var f = e.redAdd(d);\\\\n    if (this.zOne) {\\\\n      // X3 = (B - C - D) * (F - 2)\\\\n      nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\\\\n      // Y3 = F * (E - D)\\\\n      ny = f.redMul(e.redSub(d));\\\\n      // Z3 = F^2 - 2 * F\\\\n      nz = f.redSqr().redSub(f).redSub(f);\\\\n    } else {\\\\n      // H = Z1^2\\\\n      var h = this.z.redSqr();\\\\n      // J = F - 2 * H\\\\n      var j = f.redSub(h).redISub(h);\\\\n      // X3 = (B-C-D)*J\\\\n      nx = b.redSub(c).redISub(d).redMul(j);\\\\n      // Y3 = F * (E - D)\\\\n      ny = f.redMul(e.redSub(d));\\\\n      // Z3 = F * J\\\\n      nz = f.redMul(j);\\\\n    }\\\\n  } else {\\\\n    // E = C + D\\\\n    var e = c.redAdd(d);\\\\n    // H = (c * Z1)^2\\\\n    var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();\\\\n    // J = E - 2 * H\\\\n    var j = e.redSub(h).redSub(h);\\\\n    // X3 = c * (B - E) * J\\\\n    nx = this.curve._mulC(b.redISub(e)).redMul(j);\\\\n    // Y3 = c * E * (C - D)\\\\n    ny = this.curve._mulC(e).redMul(c.redISub(d));\\\\n    // Z3 = E * J\\\\n    nz = e.redMul(j);\\\\n  }\\\\n  return this.curve.point(nx, ny, nz);\\\\n};\\\\n\\\\nPoint.prototype.dbl = function dbl() {\\\\n  if (this.isInfinity())\\\\n    return this;\\\\n\\\\n  // Double in extended coordinates\\\\n  if (this.curve.extended)\\\\n    return this._extDbl();\\\\n  else\\\\n    return this._projDbl();\\\\n};\\\\n\\\\nPoint.prototype._extAdd = function _extAdd(p) {\\\\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\\\\n  //     #addition-add-2008-hwcd-3\\\\n  // 8M\\\\n\\\\n  // A = (Y1 - X1) * (Y2 - X2)\\\\n  var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\\\\n  // B = (Y1 + X1) * (Y2 + X2)\\\\n  var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\\\\n  // C = T1 * k * T2\\\\n  var c = this.t.redMul(this.curve.dd).redMul(p.t);\\\\n  // D = Z1 * 2 * Z2\\\\n  var d = this.z.redMul(p.z.redAdd(p.z));\\\\n  // E = B - A\\\\n  var e = b.redSub(a);\\\\n  // F = D - C\\\\n  var f = d.redSub(c);\\\\n  // G = D + C\\\\n  var g = d.redAdd(c);\\\\n  // H = B + A\\\\n  var h = b.redAdd(a);\\\\n  // X3 = E * F\\\\n  var nx = e.redMul(f);\\\\n  // Y3 = G * H\\\\n  var ny = g.redMul(h);\\\\n  // T3 = E * H\\\\n  var nt = e.redMul(h);\\\\n  // Z3 = F * G\\\\n  var nz = f.redMul(g);\\\\n  return this.curve.point(nx, ny, nz, nt);\\\\n};\\\\n\\\\nPoint.prototype._projAdd = function _projAdd(p) {\\\\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\\\\n  //     #addition-add-2008-bbjlp\\\\n  //     #addition-add-2007-bl\\\\n  // 10M + 1S\\\\n\\\\n  // A = Z1 * Z2\\\\n  var a = this.z.redMul(p.z);\\\\n  // B = A^2\\\\n  var b = a.redSqr();\\\\n  // C = X1 * X2\\\\n  var c = this.x.redMul(p.x);\\\\n  // D = Y1 * Y2\\\\n  var d = this.y.redMul(p.y);\\\\n  // E = d * C * D\\\\n  var e = this.curve.d.redMul(c).redMul(d);\\\\n  // F = B - E\\\\n  var f = b.redSub(e);\\\\n  // G = B + E\\\\n  var g = b.redAdd(e);\\\\n  // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\\\\n  var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\\\\n  var nx = a.redMul(f).redMul(tmp);\\\\n  var ny;\\\\n  var nz;\\\\n  if (this.curve.twisted) {\\\\n    // Y3 = A * G * (D - a * C)\\\\n    ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\\\\n    // Z3 = F * G\\\\n    nz = f.redMul(g);\\\\n  } else {\\\\n    // Y3 = A * G * (D - C)\\\\n    ny = a.redMul(g).redMul(d.redSub(c));\\\\n    // Z3 = c * F * G\\\\n    nz = this.curve._mulC(f).redMul(g);\\\\n  }\\\\n  return this.curve.point(nx, ny, nz);\\\\n};\\\\n\\\\nPoint.prototype.add = function add(p) {\\\\n  if (this.isInfinity())\\\\n    return p;\\\\n  if (p.isInfinity())\\\\n    return this;\\\\n\\\\n  if (this.curve.extended)\\\\n    return this._extAdd(p);\\\\n  else\\\\n    return this._projAdd(p);\\\\n};\\\\n\\\\nPoint.prototype.mul = function mul(k) {\\\\n  if (this._hasDoubles(k))\\\\n    return this.curve._fixedNafMul(this, k);\\\\n  else\\\\n    return this.curve._wnafMul(this, k);\\\\n};\\\\n\\\\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\\\\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);\\\\n};\\\\n\\\\nPoint.prototype.jmulAdd = function jmulAdd(k1, p, k2) {\\\\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);\\\\n};\\\\n\\\\nPoint.prototype.normalize = function normalize() {\\\\n  if (this.zOne)\\\\n    return this;\\\\n\\\\n  // Normalize coordinates\\\\n  var zi = this.z.redInvm();\\\\n  this.x = this.x.redMul(zi);\\\\n  this.y = this.y.redMul(zi);\\\\n  if (this.t)\\\\n    this.t = this.t.redMul(zi);\\\\n  this.z = this.curve.one;\\\\n  this.zOne = true;\\\\n  return this;\\\\n};\\\\n\\\\nPoint.prototype.neg = function neg() {\\\\n  return this.curve.point(this.x.redNeg(),\\\\n                          this.y,\\\\n                          this.z,\\\\n                          this.t && this.t.redNeg());\\\\n};\\\\n\\\\nPoint.prototype.getX = function getX() {\\\\n  this.normalize();\\\\n  return this.x.fromRed();\\\\n};\\\\n\\\\nPoint.prototype.getY = function getY() {\\\\n  this.normalize();\\\\n  return this.y.fromRed();\\\\n};\\\\n\\\\nPoint.prototype.eq = function eq(other) {\\\\n  return this === other ||\\\\n         this.getX().cmp(other.getX()) === 0 &&\\\\n         this.getY().cmp(other.getY()) === 0;\\\\n};\\\\n\\\\nPoint.prototype.eqXToP = function eqXToP(x) {\\\\n  var rx = x.toRed(this.curve.red).redMul(this.z);\\\\n  if (this.x.cmp(rx) === 0)\\\\n    return true;\\\\n\\\\n  var xc = x.clone();\\\\n  var t = this.curve.redN.redMul(this.z);\\\\n  for (;;) {\\\\n    xc.iadd(this.curve.n);\\\\n    if (xc.cmp(this.curve.p) >= 0)\\\\n      return false;\\\\n\\\\n    rx.redIAdd(t);\\\\n    if (this.x.cmp(rx) === 0)\\\\n      return true;\\\\n  }\\\\n  return false;\\\\n};\\\\n\\\\n// Compatibility with BaseCurve\\\\nPoint.prototype.toP = Point.prototype.normalize;\\\\nPoint.prototype.mixedAdd = Point.prototype.add;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curve/edwards.js\\\\n// module id = 251\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/edwards.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar curve = __webpack_require__(51);\\\\nvar BN = __webpack_require__(3);\\\\nvar inherits = __webpack_require__(0);\\\\nvar Base = curve.base;\\\\n\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\n\\\\nfunction MontCurve(conf) {\\\\n  Base.call(this, \'mont\', conf);\\\\n\\\\n  this.a = new BN(conf.a, 16).toRed(this.red);\\\\n  this.b = new BN(conf.b, 16).toRed(this.red);\\\\n  this.i4 = new BN(4).toRed(this.red).redInvm();\\\\n  this.two = new BN(2).toRed(this.red);\\\\n  this.a24 = this.i4.redMul(this.a.redAdd(this.two));\\\\n}\\\\ninherits(MontCurve, Base);\\\\nmodule.exports = MontCurve;\\\\n\\\\nMontCurve.prototype.validate = function validate(point) {\\\\n  var x = point.normalize().x;\\\\n  var x2 = x.redSqr();\\\\n  var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\\\\n  var y = rhs.redSqrt();\\\\n\\\\n  return y.redSqr().cmp(rhs) === 0;\\\\n};\\\\n\\\\nfunction Point(curve, x, z) {\\\\n  Base.BasePoint.call(this, curve, \'projective\');\\\\n  if (x === null && z === null) {\\\\n    this.x = this.curve.one;\\\\n    this.z = this.curve.zero;\\\\n  } else {\\\\n    this.x = new BN(x, 16);\\\\n    this.z = new BN(z, 16);\\\\n    if (!this.x.red)\\\\n      this.x = this.x.toRed(this.curve.red);\\\\n    if (!this.z.red)\\\\n      this.z = this.z.toRed(this.curve.red);\\\\n  }\\\\n}\\\\ninherits(Point, Base.BasePoint);\\\\n\\\\nMontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {\\\\n  return this.point(utils.toArray(bytes, enc), 1);\\\\n};\\\\n\\\\nMontCurve.prototype.point = function point(x, z) {\\\\n  return new Point(this, x, z);\\\\n};\\\\n\\\\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\\\\n  return Point.fromJSON(this, obj);\\\\n};\\\\n\\\\nPoint.prototype.precompute = function precompute() {\\\\n  // No-op\\\\n};\\\\n\\\\nPoint.prototype._encode = function _encode() {\\\\n  return this.getX().toArray(\'be\', this.curve.p.byteLength());\\\\n};\\\\n\\\\nPoint.fromJSON = function fromJSON(curve, obj) {\\\\n  return new Point(curve, obj[0], obj[1] || curve.one);\\\\n};\\\\n\\\\nPoint.prototype.inspect = function inspect() {\\\\n  if (this.isInfinity())\\\\n    return \'<EC Point Infinity>\';\\\\n  return \'<EC Point x: \' + this.x.fromRed().toString(16, 2) +\\\\n      \' z: \' + this.z.fromRed().toString(16, 2) + \'>\';\\\\n};\\\\n\\\\nPoint.prototype.isInfinity = function isInfinity() {\\\\n  // XXX This code assumes that zero is always zero in red\\\\n  return this.z.cmpn(0) === 0;\\\\n};\\\\n\\\\nPoint.prototype.dbl = function dbl() {\\\\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\\\\n  // 2M + 2S + 4A\\\\n\\\\n  // A = X1 + Z1\\\\n  var a = this.x.redAdd(this.z);\\\\n  // AA = A^2\\\\n  var aa = a.redSqr();\\\\n  // B = X1 - Z1\\\\n  var b = this.x.redSub(this.z);\\\\n  // BB = B^2\\\\n  var bb = b.redSqr();\\\\n  // C = AA - BB\\\\n  var c = aa.redSub(bb);\\\\n  // X3 = AA * BB\\\\n  var nx = aa.redMul(bb);\\\\n  // Z3 = C * (BB + A24 * C)\\\\n  var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\\\\n  return this.curve.point(nx, nz);\\\\n};\\\\n\\\\nPoint.prototype.add = function add() {\\\\n  throw new Error(\'Not supported on Montgomery curve\');\\\\n};\\\\n\\\\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\\\\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\\\\n  // 4M + 2S + 6A\\\\n\\\\n  // A = X2 + Z2\\\\n  var a = this.x.redAdd(this.z);\\\\n  // B = X2 - Z2\\\\n  var b = this.x.redSub(this.z);\\\\n  // C = X3 + Z3\\\\n  var c = p.x.redAdd(p.z);\\\\n  // D = X3 - Z3\\\\n  var d = p.x.redSub(p.z);\\\\n  // DA = D * A\\\\n  var da = d.redMul(a);\\\\n  // CB = C * B\\\\n  var cb = c.redMul(b);\\\\n  // X5 = Z1 * (DA + CB)^2\\\\n  var nx = diff.z.redMul(da.redAdd(cb).redSqr());\\\\n  // Z5 = X1 * (DA - CB)^2\\\\n  var nz = diff.x.redMul(da.redISub(cb).redSqr());\\\\n  return this.curve.point(nx, nz);\\\\n};\\\\n\\\\nPoint.prototype.mul = function mul(k) {\\\\n  var t = k.clone();\\\\n  var a = this; // (N / 2) * Q + Q\\\\n  var b = this.curve.point(null, null); // (N / 2) * Q\\\\n  var c = this; // Q\\\\n\\\\n  for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1))\\\\n    bits.push(t.andln(1));\\\\n\\\\n  for (var i = bits.length - 1; i >= 0; i--) {\\\\n    if (bits[i] === 0) {\\\\n      // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\\\\n      a = a.diffAdd(b, c);\\\\n      // N * Q = 2 * ((N / 2) * Q + Q))\\\\n      b = b.dbl();\\\\n    } else {\\\\n      // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\\\\n      b = a.diffAdd(b, c);\\\\n      // N * Q + Q = 2 * ((N / 2) * Q + Q)\\\\n      a = a.dbl();\\\\n    }\\\\n  }\\\\n  return b;\\\\n};\\\\n\\\\nPoint.prototype.mulAdd = function mulAdd() {\\\\n  throw new Error(\'Not supported on Montgomery curve\');\\\\n};\\\\n\\\\nPoint.prototype.jumlAdd = function jumlAdd() {\\\\n  throw new Error(\'Not supported on Montgomery curve\');\\\\n};\\\\n\\\\nPoint.prototype.eq = function eq(other) {\\\\n  return this.getX().cmp(other.getX()) === 0;\\\\n};\\\\n\\\\nPoint.prototype.normalize = function normalize() {\\\\n  this.x = this.x.redMul(this.z.redInvm());\\\\n  this.z = this.curve.one;\\\\n  return this;\\\\n};\\\\n\\\\nPoint.prototype.getX = function getX() {\\\\n  // Normalize coordinates\\\\n  this.normalize();\\\\n\\\\n  return this.x.fromRed();\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curve/mont.js\\\\n// module id = 252\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/mont.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar curve = __webpack_require__(51);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar BN = __webpack_require__(3);\\\\nvar inherits = __webpack_require__(0);\\\\nvar Base = curve.base;\\\\n\\\\nvar assert = elliptic.utils.assert;\\\\n\\\\nfunction ShortCurve(conf) {\\\\n  Base.call(this, \'short\', conf);\\\\n\\\\n  this.a = new BN(conf.a, 16).toRed(this.red);\\\\n  this.b = new BN(conf.b, 16).toRed(this.red);\\\\n  this.tinv = this.two.redInvm();\\\\n\\\\n  this.zeroA = this.a.fromRed().cmpn(0) === 0;\\\\n  this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\\\\n\\\\n  // If the curve is endomorphic, precalculate beta and lambda\\\\n  this.endo = this._getEndomorphism(conf);\\\\n  this._endoWnafT1 = new Array(4);\\\\n  this._endoWnafT2 = new Array(4);\\\\n}\\\\ninherits(ShortCurve, Base);\\\\nmodule.exports = ShortCurve;\\\\n\\\\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\\\\n  // No efficient endomorphism\\\\n  if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\\\\n    return;\\\\n\\\\n  // Compute beta and lambda, that lambda * P = (beta * Px; Py)\\\\n  var beta;\\\\n  var lambda;\\\\n  if (conf.beta) {\\\\n    beta = new BN(conf.beta, 16).toRed(this.red);\\\\n  } else {\\\\n    var betas = this._getEndoRoots(this.p);\\\\n    // Choose the smallest beta\\\\n    beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\\\\n    beta = beta.toRed(this.red);\\\\n  }\\\\n  if (conf.lambda) {\\\\n    lambda = new BN(conf.lambda, 16);\\\\n  } else {\\\\n    // Choose the lambda that is matching selected beta\\\\n    var lambdas = this._getEndoRoots(this.n);\\\\n    if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\\\\n      lambda = lambdas[0];\\\\n    } else {\\\\n      lambda = lambdas[1];\\\\n      assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\\\\n    }\\\\n  }\\\\n\\\\n  // Get basis vectors, used for balanced length-two representation\\\\n  var basis;\\\\n  if (conf.basis) {\\\\n    basis = conf.basis.map(function(vec) {\\\\n      return {\\\\n        a: new BN(vec.a, 16),\\\\n        b: new BN(vec.b, 16)\\\\n      };\\\\n    });\\\\n  } else {\\\\n    basis = this._getEndoBasis(lambda);\\\\n  }\\\\n\\\\n  return {\\\\n    beta: beta,\\\\n    lambda: lambda,\\\\n    basis: basis\\\\n  };\\\\n};\\\\n\\\\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\\\\n  // Find roots of for x^2 + x + 1 in F\\\\n  // Root = (-1 +- Sqrt(-3)) / 2\\\\n  //\\\\n  var red = num === this.p ? this.red : BN.mont(num);\\\\n  var tinv = new BN(2).toRed(red).redInvm();\\\\n  var ntinv = tinv.redNeg();\\\\n\\\\n  var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);\\\\n\\\\n  var l1 = ntinv.redAdd(s).fromRed();\\\\n  var l2 = ntinv.redSub(s).fromRed();\\\\n  return [ l1, l2 ];\\\\n};\\\\n\\\\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\\\\n  // aprxSqrt >= sqrt(this.n)\\\\n  var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));\\\\n\\\\n  // 3.74\\\\n  // Run EGCD, until r(L + 1) < aprxSqrt\\\\n  var u = lambda;\\\\n  var v = this.n.clone();\\\\n  var x1 = new BN(1);\\\\n  var y1 = new BN(0);\\\\n  var x2 = new BN(0);\\\\n  var y2 = new BN(1);\\\\n\\\\n  // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\\\\n  var a0;\\\\n  var b0;\\\\n  // First vector\\\\n  var a1;\\\\n  var b1;\\\\n  // Second vector\\\\n  var a2;\\\\n  var b2;\\\\n\\\\n  var prevR;\\\\n  var i = 0;\\\\n  var r;\\\\n  var x;\\\\n  while (u.cmpn(0) !== 0) {\\\\n    var q = v.div(u);\\\\n    r = v.sub(q.mul(u));\\\\n    x = x2.sub(q.mul(x1));\\\\n    var y = y2.sub(q.mul(y1));\\\\n\\\\n    if (!a1 && r.cmp(aprxSqrt) < 0) {\\\\n      a0 = prevR.neg();\\\\n      b0 = x1;\\\\n      a1 = r.neg();\\\\n      b1 = x;\\\\n    } else if (a1 && ++i === 2) {\\\\n      break;\\\\n    }\\\\n    prevR = r;\\\\n\\\\n    v = u;\\\\n    u = r;\\\\n    x2 = x1;\\\\n    x1 = x;\\\\n    y2 = y1;\\\\n    y1 = y;\\\\n  }\\\\n  a2 = r.neg();\\\\n  b2 = x;\\\\n\\\\n  var len1 = a1.sqr().add(b1.sqr());\\\\n  var len2 = a2.sqr().add(b2.sqr());\\\\n  if (len2.cmp(len1) >= 0) {\\\\n    a2 = a0;\\\\n    b2 = b0;\\\\n  }\\\\n\\\\n  // Normalize signs\\\\n  if (a1.negative) {\\\\n    a1 = a1.neg();\\\\n    b1 = b1.neg();\\\\n  }\\\\n  if (a2.negative) {\\\\n    a2 = a2.neg();\\\\n    b2 = b2.neg();\\\\n  }\\\\n\\\\n  return [\\\\n    { a: a1, b: b1 },\\\\n    { a: a2, b: b2 }\\\\n  ];\\\\n};\\\\n\\\\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\\\\n  var basis = this.endo.basis;\\\\n  var v1 = basis[0];\\\\n  var v2 = basis[1];\\\\n\\\\n  var c1 = v2.b.mul(k).divRound(this.n);\\\\n  var c2 = v1.b.neg().mul(k).divRound(this.n);\\\\n\\\\n  var p1 = c1.mul(v1.a);\\\\n  var p2 = c2.mul(v2.a);\\\\n  var q1 = c1.mul(v1.b);\\\\n  var q2 = c2.mul(v2.b);\\\\n\\\\n  // Calculate answer\\\\n  var k1 = k.sub(p1).sub(p2);\\\\n  var k2 = q1.add(q2).neg();\\\\n  return { k1: k1, k2: k2 };\\\\n};\\\\n\\\\nShortCurve.prototype.pointFromX = function pointFromX(x, odd) {\\\\n  x = new BN(x, 16);\\\\n  if (!x.red)\\\\n    x = x.toRed(this.red);\\\\n\\\\n  var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\\\\n  var y = y2.redSqrt();\\\\n  if (y.redSqr().redSub(y2).cmp(this.zero) !== 0)\\\\n    throw new Error(\'invalid point\');\\\\n\\\\n  // XXX Is there any way to tell if the number is odd without converting it\\\\n  // to non-red form?\\\\n  var isOdd = y.fromRed().isOdd();\\\\n  if (odd && !isOdd || !odd && isOdd)\\\\n    y = y.redNeg();\\\\n\\\\n  return this.point(x, y);\\\\n};\\\\n\\\\nShortCurve.prototype.validate = function validate(point) {\\\\n  if (point.inf)\\\\n    return true;\\\\n\\\\n  var x = point.x;\\\\n  var y = point.y;\\\\n\\\\n  var ax = this.a.redMul(x);\\\\n  var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\\\\n  return y.redSqr().redISub(rhs).cmpn(0) === 0;\\\\n};\\\\n\\\\nShortCurve.prototype._endoWnafMulAdd =\\\\n    function _endoWnafMulAdd(points, coeffs, jacobianResult) {\\\\n  var npoints = this._endoWnafT1;\\\\n  var ncoeffs = this._endoWnafT2;\\\\n  for (var i = 0; i < points.length; i++) {\\\\n    var split = this._endoSplit(coeffs[i]);\\\\n    var p = points[i];\\\\n    var beta = p._getBeta();\\\\n\\\\n    if (split.k1.negative) {\\\\n      split.k1.ineg();\\\\n      p = p.neg(true);\\\\n    }\\\\n    if (split.k2.negative) {\\\\n      split.k2.ineg();\\\\n      beta = beta.neg(true);\\\\n    }\\\\n\\\\n    npoints[i * 2] = p;\\\\n    npoints[i * 2 + 1] = beta;\\\\n    ncoeffs[i * 2] = split.k1;\\\\n    ncoeffs[i * 2 + 1] = split.k2;\\\\n  }\\\\n  var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);\\\\n\\\\n  // Clean-up references to points and coefficients\\\\n  for (var j = 0; j < i * 2; j++) {\\\\n    npoints[j] = null;\\\\n    ncoeffs[j] = null;\\\\n  }\\\\n  return res;\\\\n};\\\\n\\\\nfunction Point(curve, x, y, isRed) {\\\\n  Base.BasePoint.call(this, curve, \'affine\');\\\\n  if (x === null && y === null) {\\\\n    this.x = null;\\\\n    this.y = null;\\\\n    this.inf = true;\\\\n  } else {\\\\n    this.x = new BN(x, 16);\\\\n    this.y = new BN(y, 16);\\\\n    // Force redgomery representation when loading from JSON\\\\n    if (isRed) {\\\\n      this.x.forceRed(this.curve.red);\\\\n      this.y.forceRed(this.curve.red);\\\\n    }\\\\n    if (!this.x.red)\\\\n      this.x = this.x.toRed(this.curve.red);\\\\n    if (!this.y.red)\\\\n      this.y = this.y.toRed(this.curve.red);\\\\n    this.inf = false;\\\\n  }\\\\n}\\\\ninherits(Point, Base.BasePoint);\\\\n\\\\nShortCurve.prototype.point = function point(x, y, isRed) {\\\\n  return new Point(this, x, y, isRed);\\\\n};\\\\n\\\\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\\\\n  return Point.fromJSON(this, obj, red);\\\\n};\\\\n\\\\nPoint.prototype._getBeta = function _getBeta() {\\\\n  if (!this.curve.endo)\\\\n    return;\\\\n\\\\n  var pre = this.precomputed;\\\\n  if (pre && pre.beta)\\\\n    return pre.beta;\\\\n\\\\n  var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\\\\n  if (pre) {\\\\n    var curve = this.curve;\\\\n    var endoMul = function(p) {\\\\n      return curve.point(p.x.redMul(curve.endo.beta), p.y);\\\\n    };\\\\n    pre.beta = beta;\\\\n    beta.precomputed = {\\\\n      beta: null,\\\\n      naf: pre.naf && {\\\\n        wnd: pre.naf.wnd,\\\\n        points: pre.naf.points.map(endoMul)\\\\n      },\\\\n      doubles: pre.doubles && {\\\\n        step: pre.doubles.step,\\\\n        points: pre.doubles.points.map(endoMul)\\\\n      }\\\\n    };\\\\n  }\\\\n  return beta;\\\\n};\\\\n\\\\nPoint.prototype.toJSON = function toJSON() {\\\\n  if (!this.precomputed)\\\\n    return [ this.x, this.y ];\\\\n\\\\n  return [ this.x, this.y, this.precomputed && {\\\\n    doubles: this.precomputed.doubles && {\\\\n      step: this.precomputed.doubles.step,\\\\n      points: this.precomputed.doubles.points.slice(1)\\\\n    },\\\\n    naf: this.precomputed.naf && {\\\\n      wnd: this.precomputed.naf.wnd,\\\\n      points: this.precomputed.naf.points.slice(1)\\\\n    }\\\\n  } ];\\\\n};\\\\n\\\\nPoint.fromJSON = function fromJSON(curve, obj, red) {\\\\n  if (typeof obj === \'string\')\\\\n    obj = JSON.parse(obj);\\\\n  var res = curve.point(obj[0], obj[1], red);\\\\n  if (!obj[2])\\\\n    return res;\\\\n\\\\n  function obj2point(obj) {\\\\n    return curve.point(obj[0], obj[1], red);\\\\n  }\\\\n\\\\n  var pre = obj[2];\\\\n  res.precomputed = {\\\\n    beta: null,\\\\n    doubles: pre.doubles && {\\\\n      step: pre.doubles.step,\\\\n      points: [ res ].concat(pre.doubles.points.map(obj2point))\\\\n    },\\\\n    naf: pre.naf && {\\\\n      wnd: pre.naf.wnd,\\\\n      points: [ res ].concat(pre.naf.points.map(obj2point))\\\\n    }\\\\n  };\\\\n  return res;\\\\n};\\\\n\\\\nPoint.prototype.inspect = function inspect() {\\\\n  if (this.isInfinity())\\\\n    return \'<EC Point Infinity>\';\\\\n  return \'<EC Point x: \' + this.x.fromRed().toString(16, 2) +\\\\n      \' y: \' + this.y.fromRed().toString(16, 2) + \'>\';\\\\n};\\\\n\\\\nPoint.prototype.isInfinity = function isInfinity() {\\\\n  return this.inf;\\\\n};\\\\n\\\\nPoint.prototype.add = function add(p) {\\\\n  // O + P = P\\\\n  if (this.inf)\\\\n    return p;\\\\n\\\\n  // P + O = P\\\\n  if (p.inf)\\\\n    return this;\\\\n\\\\n  // P + P = 2P\\\\n  if (this.eq(p))\\\\n    return this.dbl();\\\\n\\\\n  // P + (-P) = O\\\\n  if (this.neg().eq(p))\\\\n    return this.curve.point(null, null);\\\\n\\\\n  // P + Q = O\\\\n  if (this.x.cmp(p.x) === 0)\\\\n    return this.curve.point(null, null);\\\\n\\\\n  var c = this.y.redSub(p.y);\\\\n  if (c.cmpn(0) !== 0)\\\\n    c = c.redMul(this.x.redSub(p.x).redInvm());\\\\n  var nx = c.redSqr().redISub(this.x).redISub(p.x);\\\\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\\\\n  return this.curve.point(nx, ny);\\\\n};\\\\n\\\\nPoint.prototype.dbl = function dbl() {\\\\n  if (this.inf)\\\\n    return this;\\\\n\\\\n  // 2P = O\\\\n  var ys1 = this.y.redAdd(this.y);\\\\n  if (ys1.cmpn(0) === 0)\\\\n    return this.curve.point(null, null);\\\\n\\\\n  var a = this.curve.a;\\\\n\\\\n  var x2 = this.x.redSqr();\\\\n  var dyinv = ys1.redInvm();\\\\n  var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\\\\n\\\\n  var nx = c.redSqr().redISub(this.x.redAdd(this.x));\\\\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\\\\n  return this.curve.point(nx, ny);\\\\n};\\\\n\\\\nPoint.prototype.getX = function getX() {\\\\n  return this.x.fromRed();\\\\n};\\\\n\\\\nPoint.prototype.getY = function getY() {\\\\n  return this.y.fromRed();\\\\n};\\\\n\\\\nPoint.prototype.mul = function mul(k) {\\\\n  k = new BN(k, 16);\\\\n\\\\n  if (this._hasDoubles(k))\\\\n    return this.curve._fixedNafMul(this, k);\\\\n  else if (this.curve.endo)\\\\n    return this.curve._endoWnafMulAdd([ this ], [ k ]);\\\\n  else\\\\n    return this.curve._wnafMul(this, k);\\\\n};\\\\n\\\\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\\\\n  var points = [ this, p2 ];\\\\n  var coeffs = [ k1, k2 ];\\\\n  if (this.curve.endo)\\\\n    return this.curve._endoWnafMulAdd(points, coeffs);\\\\n  else\\\\n    return this.curve._wnafMulAdd(1, points, coeffs, 2);\\\\n};\\\\n\\\\nPoint.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {\\\\n  var points = [ this, p2 ];\\\\n  var coeffs = [ k1, k2 ];\\\\n  if (this.curve.endo)\\\\n    return this.curve._endoWnafMulAdd(points, coeffs, true);\\\\n  else\\\\n    return this.curve._wnafMulAdd(1, points, coeffs, 2, true);\\\\n};\\\\n\\\\nPoint.prototype.eq = function eq(p) {\\\\n  return this === p ||\\\\n         this.inf === p.inf &&\\\\n             (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\\\\n};\\\\n\\\\nPoint.prototype.neg = function neg(_precompute) {\\\\n  if (this.inf)\\\\n    return this;\\\\n\\\\n  var res = this.curve.point(this.x, this.y.redNeg());\\\\n  if (_precompute && this.precomputed) {\\\\n    var pre = this.precomputed;\\\\n    var negate = function(p) {\\\\n      return p.neg();\\\\n    };\\\\n    res.precomputed = {\\\\n      naf: pre.naf && {\\\\n        wnd: pre.naf.wnd,\\\\n        points: pre.naf.points.map(negate)\\\\n      },\\\\n      doubles: pre.doubles && {\\\\n        step: pre.doubles.step,\\\\n        points: pre.doubles.points.map(negate)\\\\n      }\\\\n    };\\\\n  }\\\\n  return res;\\\\n};\\\\n\\\\nPoint.prototype.toJ = function toJ() {\\\\n  if (this.inf)\\\\n    return this.curve.jpoint(null, null, null);\\\\n\\\\n  var res = this.curve.jpoint(this.x, this.y, this.curve.one);\\\\n  return res;\\\\n};\\\\n\\\\nfunction JPoint(curve, x, y, z) {\\\\n  Base.BasePoint.call(this, curve, \'jacobian\');\\\\n  if (x === null && y === null && z === null) {\\\\n    this.x = this.curve.one;\\\\n    this.y = this.curve.one;\\\\n    this.z = new BN(0);\\\\n  } else {\\\\n    this.x = new BN(x, 16);\\\\n    this.y = new BN(y, 16);\\\\n    this.z = new BN(z, 16);\\\\n  }\\\\n  if (!this.x.red)\\\\n    this.x = this.x.toRed(this.curve.red);\\\\n  if (!this.y.red)\\\\n    this.y = this.y.toRed(this.curve.red);\\\\n  if (!this.z.red)\\\\n    this.z = this.z.toRed(this.curve.red);\\\\n\\\\n  this.zOne = this.z === this.curve.one;\\\\n}\\\\ninherits(JPoint, Base.BasePoint);\\\\n\\\\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\\\\n  return new JPoint(this, x, y, z);\\\\n};\\\\n\\\\nJPoint.prototype.toP = function toP() {\\\\n  if (this.isInfinity())\\\\n    return this.curve.point(null, null);\\\\n\\\\n  var zinv = this.z.redInvm();\\\\n  var zinv2 = zinv.redSqr();\\\\n  var ax = this.x.redMul(zinv2);\\\\n  var ay = this.y.redMul(zinv2).redMul(zinv);\\\\n\\\\n  return this.curve.point(ax, ay);\\\\n};\\\\n\\\\nJPoint.prototype.neg = function neg() {\\\\n  return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\\\\n};\\\\n\\\\nJPoint.prototype.add = function add(p) {\\\\n  // O + P = P\\\\n  if (this.isInfinity())\\\\n    return p;\\\\n\\\\n  // P + O = P\\\\n  if (p.isInfinity())\\\\n    return this;\\\\n\\\\n  // 12M + 4S + 7A\\\\n  var pz2 = p.z.redSqr();\\\\n  var z2 = this.z.redSqr();\\\\n  var u1 = this.x.redMul(pz2);\\\\n  var u2 = p.x.redMul(z2);\\\\n  var s1 = this.y.redMul(pz2.redMul(p.z));\\\\n  var s2 = p.y.redMul(z2.redMul(this.z));\\\\n\\\\n  var h = u1.redSub(u2);\\\\n  var r = s1.redSub(s2);\\\\n  if (h.cmpn(0) === 0) {\\\\n    if (r.cmpn(0) !== 0)\\\\n      return this.curve.jpoint(null, null, null);\\\\n    else\\\\n      return this.dbl();\\\\n  }\\\\n\\\\n  var h2 = h.redSqr();\\\\n  var h3 = h2.redMul(h);\\\\n  var v = u1.redMul(h2);\\\\n\\\\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\\\\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\\\\n  var nz = this.z.redMul(p.z).redMul(h);\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\\\\n  // O + P = P\\\\n  if (this.isInfinity())\\\\n    return p.toJ();\\\\n\\\\n  // P + O = P\\\\n  if (p.isInfinity())\\\\n    return this;\\\\n\\\\n  // 8M + 3S + 7A\\\\n  var z2 = this.z.redSqr();\\\\n  var u1 = this.x;\\\\n  var u2 = p.x.redMul(z2);\\\\n  var s1 = this.y;\\\\n  var s2 = p.y.redMul(z2).redMul(this.z);\\\\n\\\\n  var h = u1.redSub(u2);\\\\n  var r = s1.redSub(s2);\\\\n  if (h.cmpn(0) === 0) {\\\\n    if (r.cmpn(0) !== 0)\\\\n      return this.curve.jpoint(null, null, null);\\\\n    else\\\\n      return this.dbl();\\\\n  }\\\\n\\\\n  var h2 = h.redSqr();\\\\n  var h3 = h2.redMul(h);\\\\n  var v = u1.redMul(h2);\\\\n\\\\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\\\\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\\\\n  var nz = this.z.redMul(h);\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype.dblp = function dblp(pow) {\\\\n  if (pow === 0)\\\\n    return this;\\\\n  if (this.isInfinity())\\\\n    return this;\\\\n  if (!pow)\\\\n    return this.dbl();\\\\n\\\\n  if (this.curve.zeroA || this.curve.threeA) {\\\\n    var r = this;\\\\n    for (var i = 0; i < pow; i++)\\\\n      r = r.dbl();\\\\n    return r;\\\\n  }\\\\n\\\\n  // 1M + 2S + 1A + N * (4S + 5M + 8A)\\\\n  // N = 1 => 6M + 6S + 9A\\\\n  var a = this.curve.a;\\\\n  var tinv = this.curve.tinv;\\\\n\\\\n  var jx = this.x;\\\\n  var jy = this.y;\\\\n  var jz = this.z;\\\\n  var jz4 = jz.redSqr().redSqr();\\\\n\\\\n  // Reuse results\\\\n  var jyd = jy.redAdd(jy);\\\\n  for (var i = 0; i < pow; i++) {\\\\n    var jx2 = jx.redSqr();\\\\n    var jyd2 = jyd.redSqr();\\\\n    var jyd4 = jyd2.redSqr();\\\\n    var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\\\\n\\\\n    var t1 = jx.redMul(jyd2);\\\\n    var nx = c.redSqr().redISub(t1.redAdd(t1));\\\\n    var t2 = t1.redISub(nx);\\\\n    var dny = c.redMul(t2);\\\\n    dny = dny.redIAdd(dny).redISub(jyd4);\\\\n    var nz = jyd.redMul(jz);\\\\n    if (i + 1 < pow)\\\\n      jz4 = jz4.redMul(jyd4);\\\\n\\\\n    jx = nx;\\\\n    jz = nz;\\\\n    jyd = dny;\\\\n  }\\\\n\\\\n  return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\\\\n};\\\\n\\\\nJPoint.prototype.dbl = function dbl() {\\\\n  if (this.isInfinity())\\\\n    return this;\\\\n\\\\n  if (this.curve.zeroA)\\\\n    return this._zeroDbl();\\\\n  else if (this.curve.threeA)\\\\n    return this._threeDbl();\\\\n  else\\\\n    return this._dbl();\\\\n};\\\\n\\\\nJPoint.prototype._zeroDbl = function _zeroDbl() {\\\\n  var nx;\\\\n  var ny;\\\\n  var nz;\\\\n  // Z = 1\\\\n  if (this.zOne) {\\\\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\\\\n    //     #doubling-mdbl-2007-bl\\\\n    // 1M + 5S + 14A\\\\n\\\\n    // XX = X1^2\\\\n    var xx = this.x.redSqr();\\\\n    // YY = Y1^2\\\\n    var yy = this.y.redSqr();\\\\n    // YYYY = YY^2\\\\n    var yyyy = yy.redSqr();\\\\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\\\\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\\\\n    s = s.redIAdd(s);\\\\n    // M = 3 * XX + a; a = 0\\\\n    var m = xx.redAdd(xx).redIAdd(xx);\\\\n    // T = M ^ 2 - 2*S\\\\n    var t = m.redSqr().redISub(s).redISub(s);\\\\n\\\\n    // 8 * YYYY\\\\n    var yyyy8 = yyyy.redIAdd(yyyy);\\\\n    yyyy8 = yyyy8.redIAdd(yyyy8);\\\\n    yyyy8 = yyyy8.redIAdd(yyyy8);\\\\n\\\\n    // X3 = T\\\\n    nx = t;\\\\n    // Y3 = M * (S - T) - 8 * YYYY\\\\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\\\\n    // Z3 = 2*Y1\\\\n    nz = this.y.redAdd(this.y);\\\\n  } else {\\\\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\\\\n    //     #doubling-dbl-2009-l\\\\n    // 2M + 5S + 13A\\\\n\\\\n    // A = X1^2\\\\n    var a = this.x.redSqr();\\\\n    // B = Y1^2\\\\n    var b = this.y.redSqr();\\\\n    // C = B^2\\\\n    var c = b.redSqr();\\\\n    // D = 2 * ((X1 + B)^2 - A - C)\\\\n    var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\\\\n    d = d.redIAdd(d);\\\\n    // E = 3 * A\\\\n    var e = a.redAdd(a).redIAdd(a);\\\\n    // F = E^2\\\\n    var f = e.redSqr();\\\\n\\\\n    // 8 * C\\\\n    var c8 = c.redIAdd(c);\\\\n    c8 = c8.redIAdd(c8);\\\\n    c8 = c8.redIAdd(c8);\\\\n\\\\n    // X3 = F - 2 * D\\\\n    nx = f.redISub(d).redISub(d);\\\\n    // Y3 = E * (D - X3) - 8 * C\\\\n    ny = e.redMul(d.redISub(nx)).redISub(c8);\\\\n    // Z3 = 2 * Y1 * Z1\\\\n    nz = this.y.redMul(this.z);\\\\n    nz = nz.redIAdd(nz);\\\\n  }\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype._threeDbl = function _threeDbl() {\\\\n  var nx;\\\\n  var ny;\\\\n  var nz;\\\\n  // Z = 1\\\\n  if (this.zOne) {\\\\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\\\\n    //     #doubling-mdbl-2007-bl\\\\n    // 1M + 5S + 15A\\\\n\\\\n    // XX = X1^2\\\\n    var xx = this.x.redSqr();\\\\n    // YY = Y1^2\\\\n    var yy = this.y.redSqr();\\\\n    // YYYY = YY^2\\\\n    var yyyy = yy.redSqr();\\\\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\\\\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\\\\n    s = s.redIAdd(s);\\\\n    // M = 3 * XX + a\\\\n    var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\\\\n    // T = M^2 - 2 * S\\\\n    var t = m.redSqr().redISub(s).redISub(s);\\\\n    // X3 = T\\\\n    nx = t;\\\\n    // Y3 = M * (S - T) - 8 * YYYY\\\\n    var yyyy8 = yyyy.redIAdd(yyyy);\\\\n    yyyy8 = yyyy8.redIAdd(yyyy8);\\\\n    yyyy8 = yyyy8.redIAdd(yyyy8);\\\\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\\\\n    // Z3 = 2 * Y1\\\\n    nz = this.y.redAdd(this.y);\\\\n  } else {\\\\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\\\\n    // 3M + 5S\\\\n\\\\n    // delta = Z1^2\\\\n    var delta = this.z.redSqr();\\\\n    // gamma = Y1^2\\\\n    var gamma = this.y.redSqr();\\\\n    // beta = X1 * gamma\\\\n    var beta = this.x.redMul(gamma);\\\\n    // alpha = 3 * (X1 - delta) * (X1 + delta)\\\\n    var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\\\\n    alpha = alpha.redAdd(alpha).redIAdd(alpha);\\\\n    // X3 = alpha^2 - 8 * beta\\\\n    var beta4 = beta.redIAdd(beta);\\\\n    beta4 = beta4.redIAdd(beta4);\\\\n    var beta8 = beta4.redAdd(beta4);\\\\n    nx = alpha.redSqr().redISub(beta8);\\\\n    // Z3 = (Y1 + Z1)^2 - gamma - delta\\\\n    nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\\\\n    // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\\\\n    var ggamma8 = gamma.redSqr();\\\\n    ggamma8 = ggamma8.redIAdd(ggamma8);\\\\n    ggamma8 = ggamma8.redIAdd(ggamma8);\\\\n    ggamma8 = ggamma8.redIAdd(ggamma8);\\\\n    ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\\\\n  }\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype._dbl = function _dbl() {\\\\n  var a = this.curve.a;\\\\n\\\\n  // 4M + 6S + 10A\\\\n  var jx = this.x;\\\\n  var jy = this.y;\\\\n  var jz = this.z;\\\\n  var jz4 = jz.redSqr().redSqr();\\\\n\\\\n  var jx2 = jx.redSqr();\\\\n  var jy2 = jy.redSqr();\\\\n\\\\n  var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\\\\n\\\\n  var jxd4 = jx.redAdd(jx);\\\\n  jxd4 = jxd4.redIAdd(jxd4);\\\\n  var t1 = jxd4.redMul(jy2);\\\\n  var nx = c.redSqr().redISub(t1.redAdd(t1));\\\\n  var t2 = t1.redISub(nx);\\\\n\\\\n  var jyd8 = jy2.redSqr();\\\\n  jyd8 = jyd8.redIAdd(jyd8);\\\\n  jyd8 = jyd8.redIAdd(jyd8);\\\\n  jyd8 = jyd8.redIAdd(jyd8);\\\\n  var ny = c.redMul(t2).redISub(jyd8);\\\\n  var nz = jy.redAdd(jy).redMul(jz);\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype.trpl = function trpl() {\\\\n  if (!this.curve.zeroA)\\\\n    return this.dbl().add(this);\\\\n\\\\n  // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\\\\n  // 5M + 10S + ...\\\\n\\\\n  // XX = X1^2\\\\n  var xx = this.x.redSqr();\\\\n  // YY = Y1^2\\\\n  var yy = this.y.redSqr();\\\\n  // ZZ = Z1^2\\\\n  var zz = this.z.redSqr();\\\\n  // YYYY = YY^2\\\\n  var yyyy = yy.redSqr();\\\\n  // M = 3 * XX + a * ZZ2; a = 0\\\\n  var m = xx.redAdd(xx).redIAdd(xx);\\\\n  // MM = M^2\\\\n  var mm = m.redSqr();\\\\n  // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\\\\n  var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\\\\n  e = e.redIAdd(e);\\\\n  e = e.redAdd(e).redIAdd(e);\\\\n  e = e.redISub(mm);\\\\n  // EE = E^2\\\\n  var ee = e.redSqr();\\\\n  // T = 16*YYYY\\\\n  var t = yyyy.redIAdd(yyyy);\\\\n  t = t.redIAdd(t);\\\\n  t = t.redIAdd(t);\\\\n  t = t.redIAdd(t);\\\\n  // U = (M + E)^2 - MM - EE - T\\\\n  var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\\\\n  // X3 = 4 * (X1 * EE - 4 * YY * U)\\\\n  var yyu4 = yy.redMul(u);\\\\n  yyu4 = yyu4.redIAdd(yyu4);\\\\n  yyu4 = yyu4.redIAdd(yyu4);\\\\n  var nx = this.x.redMul(ee).redISub(yyu4);\\\\n  nx = nx.redIAdd(nx);\\\\n  nx = nx.redIAdd(nx);\\\\n  // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\\\\n  var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\\\\n  ny = ny.redIAdd(ny);\\\\n  ny = ny.redIAdd(ny);\\\\n  ny = ny.redIAdd(ny);\\\\n  // Z3 = (Z1 + E)^2 - ZZ - EE\\\\n  var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\\\\n\\\\n  return this.curve.jpoint(nx, ny, nz);\\\\n};\\\\n\\\\nJPoint.prototype.mul = function mul(k, kbase) {\\\\n  k = new BN(k, kbase);\\\\n\\\\n  return this.curve._wnafMul(this, k);\\\\n};\\\\n\\\\nJPoint.prototype.eq = function eq(p) {\\\\n  if (p.type === \'affine\')\\\\n    return this.eq(p.toJ());\\\\n\\\\n  if (this === p)\\\\n    return true;\\\\n\\\\n  // x1 * z2^2 == x2 * z1^2\\\\n  var z2 = this.z.redSqr();\\\\n  var pz2 = p.z.redSqr();\\\\n  if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\\\\n    return false;\\\\n\\\\n  // y1 * z2^3 == y2 * z1^3\\\\n  var z3 = z2.redMul(this.z);\\\\n  var pz3 = pz2.redMul(p.z);\\\\n  return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\\\\n};\\\\n\\\\nJPoint.prototype.eqXToP = function eqXToP(x) {\\\\n  var zs = this.z.redSqr();\\\\n  var rx = x.toRed(this.curve.red).redMul(zs);\\\\n  if (this.x.cmp(rx) === 0)\\\\n    return true;\\\\n\\\\n  var xc = x.clone();\\\\n  var t = this.curve.redN.redMul(zs);\\\\n  for (;;) {\\\\n    xc.iadd(this.curve.n);\\\\n    if (xc.cmp(this.curve.p) >= 0)\\\\n      return false;\\\\n\\\\n    rx.redIAdd(t);\\\\n    if (this.x.cmp(rx) === 0)\\\\n      return true;\\\\n  }\\\\n  return false;\\\\n};\\\\n\\\\nJPoint.prototype.inspect = function inspect() {\\\\n  if (this.isInfinity())\\\\n    return \'<EC JPoint Infinity>\';\\\\n  return \'<EC JPoint x: \' + this.x.toString(16, 2) +\\\\n      \' y: \' + this.y.toString(16, 2) +\\\\n      \' z: \' + this.z.toString(16, 2) + \'>\';\\\\n};\\\\n\\\\nJPoint.prototype.isInfinity = function isInfinity() {\\\\n  // XXX This code assumes that zero is always zero in red\\\\n  return this.z.cmpn(0) === 0;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curve/short.js\\\\n// module id = 253\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curve/short.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar curves = exports;\\\\n\\\\nvar hash = __webpack_require__(85);\\\\nvar elliptic = __webpack_require__(6);\\\\n\\\\nvar assert = elliptic.utils.assert;\\\\n\\\\nfunction PresetCurve(options) {\\\\n  if (options.type === \'short\')\\\\n    this.curve = new elliptic.curve.short(options);\\\\n  else if (options.type === \'edwards\')\\\\n    this.curve = new elliptic.curve.edwards(options);\\\\n  else\\\\n    this.curve = new elliptic.curve.mont(options);\\\\n  this.g = this.curve.g;\\\\n  this.n = this.curve.n;\\\\n  this.hash = options.hash;\\\\n\\\\n  assert(this.g.validate(), \'Invalid curve\');\\\\n  assert(this.g.mul(this.n).isInfinity(), \'Invalid curve, G*N != O\');\\\\n}\\\\ncurves.PresetCurve = PresetCurve;\\\\n\\\\nfunction defineCurve(name, options) {\\\\n  Object.defineProperty(curves, name, {\\\\n    configurable: true,\\\\n    enumerable: true,\\\\n    get: function() {\\\\n      var curve = new PresetCurve(options);\\\\n      Object.defineProperty(curves, name, {\\\\n        configurable: true,\\\\n        enumerable: true,\\\\n        value: curve\\\\n      });\\\\n      return curve;\\\\n    }\\\\n  });\\\\n}\\\\n\\\\ndefineCurve(\'p192\', {\\\\n  type: \'short\',\\\\n  prime: \'p192\',\\\\n  p: \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\',\\\\n  a: \'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc\',\\\\n  b: \'64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1\',\\\\n  n: \'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831\',\\\\n  hash: hash.sha256,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012\',\\\\n    \'07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'p224\', {\\\\n  type: \'short\',\\\\n  prime: \'p224\',\\\\n  p: \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\',\\\\n  a: \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe\',\\\\n  b: \'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4\',\\\\n  n: \'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d\',\\\\n  hash: hash.sha256,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21\',\\\\n    \'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'p256\', {\\\\n  type: \'short\',\\\\n  prime: null,\\\\n  p: \'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff\',\\\\n  a: \'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc\',\\\\n  b: \'5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b\',\\\\n  n: \'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551\',\\\\n  hash: hash.sha256,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296\',\\\\n    \'4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'p384\', {\\\\n  type: \'short\',\\\\n  prime: null,\\\\n  p: \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'fffffffe ffffffff 00000000 00000000 ffffffff\',\\\\n  a: \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'fffffffe ffffffff 00000000 00000000 fffffffc\',\\\\n  b: \'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f \' +\\\\n     \'5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef\',\\\\n  n: \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 \' +\\\\n     \'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973\',\\\\n  hash: hash.sha384,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 \' +\\\\n    \'5502f25d bf55296c 3a545e38 72760ab7\',\\\\n    \'3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 \' +\\\\n    \'0a60b1ce 1d7e819d 7a431d7c 90ea0e5f\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'p521\', {\\\\n  type: \'short\',\\\\n  prime: null,\\\\n  p: \'000001ff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'ffffffff ffffffff ffffffff ffffffff ffffffff\',\\\\n  a: \'000001ff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'ffffffff ffffffff ffffffff ffffffff fffffffc\',\\\\n  b: \'00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b \' +\\\\n     \'99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd \' +\\\\n     \'3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00\',\\\\n  n: \'000001ff ffffffff ffffffff ffffffff ffffffff ffffffff \' +\\\\n     \'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 \' +\\\\n     \'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409\',\\\\n  hash: hash.sha512,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 \' +\\\\n    \'053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 \' +\\\\n    \'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66\',\\\\n    \'00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 \' +\\\\n    \'579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 \' +\\\\n    \'3fad0761 353c7086 a272c240 88be9476 9fd16650\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'curve25519\', {\\\\n  type: \'mont\',\\\\n  prime: \'p25519\',\\\\n  p: \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\',\\\\n  a: \'76d06\',\\\\n  b: \'1\',\\\\n  n: \'1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\',\\\\n  hash: hash.sha256,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'9\'\\\\n  ]\\\\n});\\\\n\\\\ndefineCurve(\'ed25519\', {\\\\n  type: \'edwards\',\\\\n  prime: \'p25519\',\\\\n  p: \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\',\\\\n  a: \'-1\',\\\\n  c: \'1\',\\\\n  // -121665 * (121666^(-1)) (mod P)\\\\n  d: \'52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3\',\\\\n  n: \'1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed\',\\\\n  hash: hash.sha256,\\\\n  gRed: false,\\\\n  g: [\\\\n    \'216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a\',\\\\n\\\\n    // 4/5\\\\n    \'6666666666666666666666666666666666666666666666666666666666666658\'\\\\n  ]\\\\n});\\\\n\\\\nvar pre;\\\\ntry {\\\\n  pre = __webpack_require__(261);\\\\n} catch (e) {\\\\n  pre = undefined;\\\\n}\\\\n\\\\ndefineCurve(\'secp256k1\', {\\\\n  type: \'short\',\\\\n  prime: \'k256\',\\\\n  p: \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\',\\\\n  a: \'0\',\\\\n  b: \'7\',\\\\n  n: \'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141\',\\\\n  h: \'1\',\\\\n  hash: hash.sha256,\\\\n\\\\n  // Precomputed endomorphism\\\\n  beta: \'7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee\',\\\\n  lambda: \'5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72\',\\\\n  basis: [\\\\n    {\\\\n      a: \'3086d221a7d46bcde86c90e49284eb15\',\\\\n      b: \'-e4437ed6010e88286f547fa90abfe4c3\'\\\\n    },\\\\n    {\\\\n      a: \'114ca50f7a8e2f3f657c1108d9d44cfd8\',\\\\n      b: \'3086d221a7d46bcde86c90e49284eb15\'\\\\n    }\\\\n  ],\\\\n\\\\n  gRed: false,\\\\n  g: [\\\\n    \'79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798\',\\\\n    \'483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8\',\\\\n    pre\\\\n  ]\\\\n});\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/curves.js\\\\n// module id = 254\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/curves.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(3);\\\\nvar HmacDRBG = __webpack_require__(276);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\n\\\\nvar KeyPair = __webpack_require__(256);\\\\nvar Signature = __webpack_require__(257);\\\\n\\\\nfunction EC(options) {\\\\n  if (!(this instanceof EC))\\\\n    return new EC(options);\\\\n\\\\n  // Shortcut `elliptic.ec(curve-name)`\\\\n  if (typeof options === \'string\') {\\\\n    assert(elliptic.curves.hasOwnProperty(options), \'Unknown curve \' + options);\\\\n\\\\n    options = elliptic.curves[options];\\\\n  }\\\\n\\\\n  // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\\\\n  if (options instanceof elliptic.curves.PresetCurve)\\\\n    options = { curve: options };\\\\n\\\\n  this.curve = options.curve.curve;\\\\n  this.n = this.curve.n;\\\\n  this.nh = this.n.ushrn(1);\\\\n  this.g = this.curve.g;\\\\n\\\\n  // Point on curve\\\\n  this.g = options.curve.g;\\\\n  this.g.precompute(options.curve.n.bitLength() + 1);\\\\n\\\\n  // Hash for function for DRBG\\\\n  this.hash = options.hash || options.curve.hash;\\\\n}\\\\nmodule.exports = EC;\\\\n\\\\nEC.prototype.keyPair = function keyPair(options) {\\\\n  return new KeyPair(this, options);\\\\n};\\\\n\\\\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\\\\n  return KeyPair.fromPrivate(this, priv, enc);\\\\n};\\\\n\\\\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\\\\n  return KeyPair.fromPublic(this, pub, enc);\\\\n};\\\\n\\\\nEC.prototype.genKeyPair = function genKeyPair(options) {\\\\n  if (!options)\\\\n    options = {};\\\\n\\\\n  // Instantiate Hmac_DRBG\\\\n  var drbg = new HmacDRBG({\\\\n    hash: this.hash,\\\\n    pers: options.pers,\\\\n    persEnc: options.persEnc || \'utf8\',\\\\n    entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),\\\\n    entropyEnc: options.entropy && options.entropyEnc || \'utf8\',\\\\n    nonce: this.n.toArray()\\\\n  });\\\\n\\\\n  var bytes = this.n.byteLength();\\\\n  var ns2 = this.n.sub(new BN(2));\\\\n  do {\\\\n    var priv = new BN(drbg.generate(bytes));\\\\n    if (priv.cmp(ns2) > 0)\\\\n      continue;\\\\n\\\\n    priv.iaddn(1);\\\\n    return this.keyFromPrivate(priv);\\\\n  } while (true);\\\\n};\\\\n\\\\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\\\\n  var delta = msg.byteLength() * 8 - this.n.bitLength();\\\\n  if (delta > 0)\\\\n    msg = msg.ushrn(delta);\\\\n  if (!truncOnly && msg.cmp(this.n) >= 0)\\\\n    return msg.sub(this.n);\\\\n  else\\\\n    return msg;\\\\n};\\\\n\\\\nEC.prototype.sign = function sign(msg, key, enc, options) {\\\\n  if (typeof enc === \'object\') {\\\\n    options = enc;\\\\n    enc = null;\\\\n  }\\\\n  if (!options)\\\\n    options = {};\\\\n\\\\n  key = this.keyFromPrivate(key, enc);\\\\n  msg = this._truncateToN(new BN(msg, 16));\\\\n\\\\n  // Zero-extend key to provide enough entropy\\\\n  var bytes = this.n.byteLength();\\\\n  var bkey = key.getPrivate().toArray(\'be\', bytes);\\\\n\\\\n  // Zero-extend nonce to have the same byte size as N\\\\n  var nonce = msg.toArray(\'be\', bytes);\\\\n\\\\n  // Instantiate Hmac_DRBG\\\\n  var drbg = new HmacDRBG({\\\\n    hash: this.hash,\\\\n    entropy: bkey,\\\\n    nonce: nonce,\\\\n    pers: options.pers,\\\\n    persEnc: options.persEnc || \'utf8\'\\\\n  });\\\\n\\\\n  // Number of bytes to generate\\\\n  var ns1 = this.n.sub(new BN(1));\\\\n\\\\n  for (var iter = 0; true; iter++) {\\\\n    var k = options.k ?\\\\n        options.k(iter) :\\\\n        new BN(drbg.generate(this.n.byteLength()));\\\\n    k = this._truncateToN(k, true);\\\\n    if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\\\\n      continue;\\\\n\\\\n    var kp = this.g.mul(k);\\\\n    if (kp.isInfinity())\\\\n      continue;\\\\n\\\\n    var kpX = kp.getX();\\\\n    var r = kpX.umod(this.n);\\\\n    if (r.cmpn(0) === 0)\\\\n      continue;\\\\n\\\\n    var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));\\\\n    s = s.umod(this.n);\\\\n    if (s.cmpn(0) === 0)\\\\n      continue;\\\\n\\\\n    var recoveryParam = (kp.getY().isOdd() ? 1 : 0) |\\\\n                        (kpX.cmp(r) !== 0 ? 2 : 0);\\\\n\\\\n    // Use complement of `s`, if it is > `n / 2`\\\\n    if (options.canonical && s.cmp(this.nh) > 0) {\\\\n      s = this.n.sub(s);\\\\n      recoveryParam ^= 1;\\\\n    }\\\\n\\\\n    return new Signature({ r: r, s: s, recoveryParam: recoveryParam });\\\\n  }\\\\n};\\\\n\\\\nEC.prototype.verify = function verify(msg, signature, key, enc) {\\\\n  msg = this._truncateToN(new BN(msg, 16));\\\\n  key = this.keyFromPublic(key, enc);\\\\n  signature = new Signature(signature, \'hex\');\\\\n\\\\n  // Perform primitive values validation\\\\n  var r = signature.r;\\\\n  var s = signature.s;\\\\n  if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\\\\n    return false;\\\\n  if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\\\\n    return false;\\\\n\\\\n  // Validate signature\\\\n  var sinv = s.invm(this.n);\\\\n  var u1 = sinv.mul(msg).umod(this.n);\\\\n  var u2 = sinv.mul(r).umod(this.n);\\\\n\\\\n  if (!this.curve._maxwellTrick) {\\\\n    var p = this.g.mulAdd(u1, key.getPublic(), u2);\\\\n    if (p.isInfinity())\\\\n      return false;\\\\n\\\\n    return p.getX().umod(this.n).cmp(r) === 0;\\\\n  }\\\\n\\\\n  // NOTE: Greg Maxwell\'s trick, inspired by:\\\\n  // https://git.io/vad3K\\\\n\\\\n  var p = this.g.jmulAdd(u1, key.getPublic(), u2);\\\\n  if (p.isInfinity())\\\\n    return false;\\\\n\\\\n  // Compare `p.x` of Jacobian point with `r`,\\\\n  // this will do `p.x == r * p.z^2` instead of multiplying `p.x` by the\\\\n  // inverse of `p.z^2`\\\\n  return p.eqXToP(r);\\\\n};\\\\n\\\\nEC.prototype.recoverPubKey = function(msg, signature, j, enc) {\\\\n  assert((3 & j) === j, \'The recovery param is more than two bits\');\\\\n  signature = new Signature(signature, enc);\\\\n\\\\n  var n = this.n;\\\\n  var e = new BN(msg);\\\\n  var r = signature.r;\\\\n  var s = signature.s;\\\\n\\\\n  // A set LSB signifies that the y-coordinate is odd\\\\n  var isYOdd = j & 1;\\\\n  var isSecondKey = j >> 1;\\\\n  if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey)\\\\n    throw new Error(\'Unable to find sencond key candinate\');\\\\n\\\\n  // 1.1. Let x = r + jn.\\\\n  if (isSecondKey)\\\\n    r = this.curve.pointFromX(r.add(this.curve.n), isYOdd);\\\\n  else\\\\n    r = this.curve.pointFromX(r, isYOdd);\\\\n\\\\n  var rInv = signature.r.invm(n);\\\\n  var s1 = n.sub(e).mul(rInv).umod(n);\\\\n  var s2 = s.mul(rInv).umod(n);\\\\n\\\\n  // 1.6.1 Compute Q = r^-1 (sR -  eG)\\\\n  //               Q = r^-1 (sR + -eG)\\\\n  return this.g.mulAdd(s1, r, s2);\\\\n};\\\\n\\\\nEC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {\\\\n  signature = new Signature(signature, enc);\\\\n  if (signature.recoveryParam !== null)\\\\n    return signature.recoveryParam;\\\\n\\\\n  for (var i = 0; i < 4; i++) {\\\\n    var Qprime;\\\\n    try {\\\\n      Qprime = this.recoverPubKey(e, signature, i);\\\\n    } catch (e) {\\\\n      continue;\\\\n    }\\\\n\\\\n    if (Qprime.eq(Q))\\\\n      return i;\\\\n  }\\\\n  throw new Error(\'Unable to find valid recovery factor\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/ec/index.js\\\\n// module id = 255\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(3);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\n\\\\nfunction KeyPair(ec, options) {\\\\n  this.ec = ec;\\\\n  this.priv = null;\\\\n  this.pub = null;\\\\n\\\\n  // KeyPair(ec, { priv: ..., pub: ... })\\\\n  if (options.priv)\\\\n    this._importPrivate(options.priv, options.privEnc);\\\\n  if (options.pub)\\\\n    this._importPublic(options.pub, options.pubEnc);\\\\n}\\\\nmodule.exports = KeyPair;\\\\n\\\\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\\\\n  if (pub instanceof KeyPair)\\\\n    return pub;\\\\n\\\\n  return new KeyPair(ec, {\\\\n    pub: pub,\\\\n    pubEnc: enc\\\\n  });\\\\n};\\\\n\\\\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\\\\n  if (priv instanceof KeyPair)\\\\n    return priv;\\\\n\\\\n  return new KeyPair(ec, {\\\\n    priv: priv,\\\\n    privEnc: enc\\\\n  });\\\\n};\\\\n\\\\nKeyPair.prototype.validate = function validate() {\\\\n  var pub = this.getPublic();\\\\n\\\\n  if (pub.isInfinity())\\\\n    return { result: false, reason: \'Invalid public key\' };\\\\n  if (!pub.validate())\\\\n    return { result: false, reason: \'Public key is not a point\' };\\\\n  if (!pub.mul(this.ec.curve.n).isInfinity())\\\\n    return { result: false, reason: \'Public key * N != O\' };\\\\n\\\\n  return { result: true, reason: null };\\\\n};\\\\n\\\\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\\\\n  // compact is optional argument\\\\n  if (typeof compact === \'string\') {\\\\n    enc = compact;\\\\n    compact = null;\\\\n  }\\\\n\\\\n  if (!this.pub)\\\\n    this.pub = this.ec.g.mul(this.priv);\\\\n\\\\n  if (!enc)\\\\n    return this.pub;\\\\n\\\\n  return this.pub.encode(enc, compact);\\\\n};\\\\n\\\\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\\\\n  if (enc === \'hex\')\\\\n    return this.priv.toString(16, 2);\\\\n  else\\\\n    return this.priv;\\\\n};\\\\n\\\\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\\\\n  this.priv = new BN(key, enc || 16);\\\\n\\\\n  // Ensure that the priv won\'t be bigger than n, otherwise we may fail\\\\n  // in fixed multiplication method\\\\n  this.priv = this.priv.umod(this.ec.curve.n);\\\\n};\\\\n\\\\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\\\\n  if (key.x || key.y) {\\\\n    // Montgomery points only have an `x` coordinate.\\\\n    // Weierstrass/Edwards points on the other hand have both `x` and\\\\n    // `y` coordinates.\\\\n    if (this.ec.curve.type === \'mont\') {\\\\n      assert(key.x, \'Need x coordinate\');\\\\n    } else if (this.ec.curve.type === \'short\' ||\\\\n               this.ec.curve.type === \'edwards\') {\\\\n      assert(key.x && key.y, \'Need both x and y coordinate\');\\\\n    }\\\\n    this.pub = this.ec.curve.point(key.x, key.y);\\\\n    return;\\\\n  }\\\\n  this.pub = this.ec.curve.decodePoint(key, enc);\\\\n};\\\\n\\\\n// ECDH\\\\nKeyPair.prototype.derive = function derive(pub) {\\\\n  return pub.mul(this.priv).getX();\\\\n};\\\\n\\\\n// ECDSA\\\\nKeyPair.prototype.sign = function sign(msg, enc, options) {\\\\n  return this.ec.sign(msg, this, enc, options);\\\\n};\\\\n\\\\nKeyPair.prototype.verify = function verify(msg, signature) {\\\\n  return this.ec.verify(msg, signature, this);\\\\n};\\\\n\\\\nKeyPair.prototype.inspect = function inspect() {\\\\n  return \'<Key priv: \' + (this.priv && this.priv.toString(16, 2)) +\\\\n         \' pub: \' + (this.pub && this.pub.inspect()) + \' >\';\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/ec/key.js\\\\n// module id = 256\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/key.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(3);\\\\n\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\n\\\\nfunction Signature(options, enc) {\\\\n  if (options instanceof Signature)\\\\n    return options;\\\\n\\\\n  if (this._importDER(options, enc))\\\\n    return;\\\\n\\\\n  assert(options.r && options.s, \'Signature without r or s\');\\\\n  this.r = new BN(options.r, 16);\\\\n  this.s = new BN(options.s, 16);\\\\n  if (options.recoveryParam === undefined)\\\\n    this.recoveryParam = null;\\\\n  else\\\\n    this.recoveryParam = options.recoveryParam;\\\\n}\\\\nmodule.exports = Signature;\\\\n\\\\nfunction Position() {\\\\n  this.place = 0;\\\\n}\\\\n\\\\nfunction getLength(buf, p) {\\\\n  var initial = buf[p.place++];\\\\n  if (!(initial & 0x80)) {\\\\n    return initial;\\\\n  }\\\\n  var octetLen = initial & 0xf;\\\\n  var val = 0;\\\\n  for (var i = 0, off = p.place; i < octetLen; i++, off++) {\\\\n    val <<= 8;\\\\n    val |= buf[off];\\\\n  }\\\\n  p.place = off;\\\\n  return val;\\\\n}\\\\n\\\\nfunction rmPadding(buf) {\\\\n  var i = 0;\\\\n  var len = buf.length - 1;\\\\n  while (!buf[i] && !(buf[i + 1] & 0x80) && i < len) {\\\\n    i++;\\\\n  }\\\\n  if (i === 0) {\\\\n    return buf;\\\\n  }\\\\n  return buf.slice(i);\\\\n}\\\\n\\\\nSignature.prototype._importDER = function _importDER(data, enc) {\\\\n  data = utils.toArray(data, enc);\\\\n  var p = new Position();\\\\n  if (data[p.place++] !== 0x30) {\\\\n    return false;\\\\n  }\\\\n  var len = getLength(data, p);\\\\n  if ((len + p.place) !== data.length) {\\\\n    return false;\\\\n  }\\\\n  if (data[p.place++] !== 0x02) {\\\\n    return false;\\\\n  }\\\\n  var rlen = getLength(data, p);\\\\n  var r = data.slice(p.place, rlen + p.place);\\\\n  p.place += rlen;\\\\n  if (data[p.place++] !== 0x02) {\\\\n    return false;\\\\n  }\\\\n  var slen = getLength(data, p);\\\\n  if (data.length !== slen + p.place) {\\\\n    return false;\\\\n  }\\\\n  var s = data.slice(p.place, slen + p.place);\\\\n  if (r[0] === 0 && (r[1] & 0x80)) {\\\\n    r = r.slice(1);\\\\n  }\\\\n  if (s[0] === 0 && (s[1] & 0x80)) {\\\\n    s = s.slice(1);\\\\n  }\\\\n\\\\n  this.r = new BN(r);\\\\n  this.s = new BN(s);\\\\n  this.recoveryParam = null;\\\\n\\\\n  return true;\\\\n};\\\\n\\\\nfunction constructLength(arr, len) {\\\\n  if (len < 0x80) {\\\\n    arr.push(len);\\\\n    return;\\\\n  }\\\\n  var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);\\\\n  arr.push(octets | 0x80);\\\\n  while (--octets) {\\\\n    arr.push((len >>> (octets << 3)) & 0xff);\\\\n  }\\\\n  arr.push(len);\\\\n}\\\\n\\\\nSignature.prototype.toDER = function toDER(enc) {\\\\n  var r = this.r.toArray();\\\\n  var s = this.s.toArray();\\\\n\\\\n  // Pad values\\\\n  if (r[0] & 0x80)\\\\n    r = [ 0 ].concat(r);\\\\n  // Pad values\\\\n  if (s[0] & 0x80)\\\\n    s = [ 0 ].concat(s);\\\\n\\\\n  r = rmPadding(r);\\\\n  s = rmPadding(s);\\\\n\\\\n  while (!s[0] && !(s[1] & 0x80)) {\\\\n    s = s.slice(1);\\\\n  }\\\\n  var arr = [ 0x02 ];\\\\n  constructLength(arr, r.length);\\\\n  arr = arr.concat(r);\\\\n  arr.push(0x02);\\\\n  constructLength(arr, s.length);\\\\n  var backHalf = arr.concat(s);\\\\n  var res = [ 0x30 ];\\\\n  constructLength(res, backHalf.length);\\\\n  res = res.concat(backHalf);\\\\n  return utils.encode(res, enc);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/ec/signature.js\\\\n// module id = 257\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/ec/signature.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar hash = __webpack_require__(85);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\nvar parseBytes = utils.parseBytes;\\\\nvar KeyPair = __webpack_require__(259);\\\\nvar Signature = __webpack_require__(260);\\\\n\\\\nfunction EDDSA(curve) {\\\\n  assert(curve === \'ed25519\', \'only tested with ed25519 so far\');\\\\n\\\\n  if (!(this instanceof EDDSA))\\\\n    return new EDDSA(curve);\\\\n\\\\n  var curve = elliptic.curves[curve].curve;\\\\n  this.curve = curve;\\\\n  this.g = curve.g;\\\\n  this.g.precompute(curve.n.bitLength() + 1);\\\\n\\\\n  this.pointClass = curve.point().constructor;\\\\n  this.encodingLength = Math.ceil(curve.n.bitLength() / 8);\\\\n  this.hash = hash.sha512;\\\\n}\\\\n\\\\nmodule.exports = EDDSA;\\\\n\\\\n/**\\\\n* @param {Array|String} message - message bytes\\\\n* @param {Array|String|KeyPair} secret - secret bytes or a keypair\\\\n* @returns {Signature} - signature\\\\n*/\\\\nEDDSA.prototype.sign = function sign(message, secret) {\\\\n  message = parseBytes(message);\\\\n  var key = this.keyFromSecret(secret);\\\\n  var r = this.hashInt(key.messagePrefix(), message);\\\\n  var R = this.g.mul(r);\\\\n  var Rencoded = this.encodePoint(R);\\\\n  var s_ = this.hashInt(Rencoded, key.pubBytes(), message)\\\\n               .mul(key.priv());\\\\n  var S = r.add(s_).umod(this.curve.n);\\\\n  return this.makeSignature({ R: R, S: S, Rencoded: Rencoded });\\\\n};\\\\n\\\\n/**\\\\n* @param {Array} message - message bytes\\\\n* @param {Array|String|Signature} sig - sig bytes\\\\n* @param {Array|String|Point|KeyPair} pub - public key\\\\n* @returns {Boolean} - true if public key matches sig of message\\\\n*/\\\\nEDDSA.prototype.verify = function verify(message, sig, pub) {\\\\n  message = parseBytes(message);\\\\n  sig = this.makeSignature(sig);\\\\n  var key = this.keyFromPublic(pub);\\\\n  var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);\\\\n  var SG = this.g.mul(sig.S());\\\\n  var RplusAh = sig.R().add(key.pub().mul(h));\\\\n  return RplusAh.eq(SG);\\\\n};\\\\n\\\\nEDDSA.prototype.hashInt = function hashInt() {\\\\n  var hash = this.hash();\\\\n  for (var i = 0; i < arguments.length; i++)\\\\n    hash.update(arguments[i]);\\\\n  return utils.intFromLE(hash.digest()).umod(this.curve.n);\\\\n};\\\\n\\\\nEDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {\\\\n  return KeyPair.fromPublic(this, pub);\\\\n};\\\\n\\\\nEDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {\\\\n  return KeyPair.fromSecret(this, secret);\\\\n};\\\\n\\\\nEDDSA.prototype.makeSignature = function makeSignature(sig) {\\\\n  if (sig instanceof Signature)\\\\n    return sig;\\\\n  return new Signature(this, sig);\\\\n};\\\\n\\\\n/**\\\\n* * https://tools.ietf.org/html/draft-josefsson-eddsa-ed25519-03#section-5.2\\\\n*\\\\n* EDDSA defines methods for encoding and decoding points and integers. These are\\\\n* helper convenience methods, that pass along to utility functions implied\\\\n* parameters.\\\\n*\\\\n*/\\\\nEDDSA.prototype.encodePoint = function encodePoint(point) {\\\\n  var enc = point.getY().toArray(\'le\', this.encodingLength);\\\\n  enc[this.encodingLength - 1] |= point.getX().isOdd() ? 0x80 : 0;\\\\n  return enc;\\\\n};\\\\n\\\\nEDDSA.prototype.decodePoint = function decodePoint(bytes) {\\\\n  bytes = utils.parseBytes(bytes);\\\\n\\\\n  var lastIx = bytes.length - 1;\\\\n  var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~0x80);\\\\n  var xIsOdd = (bytes[lastIx] & 0x80) !== 0;\\\\n\\\\n  var y = utils.intFromLE(normed);\\\\n  return this.curve.pointFromY(y, xIsOdd);\\\\n};\\\\n\\\\nEDDSA.prototype.encodeInt = function encodeInt(num) {\\\\n  return num.toArray(\'le\', this.encodingLength);\\\\n};\\\\n\\\\nEDDSA.prototype.decodeInt = function decodeInt(bytes) {\\\\n  return utils.intFromLE(bytes);\\\\n};\\\\n\\\\nEDDSA.prototype.isPoint = function isPoint(val) {\\\\n  return val instanceof this.pointClass;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/eddsa/index.js\\\\n// module id = 258\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\nvar parseBytes = utils.parseBytes;\\\\nvar cachedProperty = utils.cachedProperty;\\\\n\\\\n/**\\\\n* @param {EDDSA} eddsa - instance\\\\n* @param {Object} params - public/private key parameters\\\\n*\\\\n* @param {Array<Byte>} [params.secret] - secret seed bytes\\\\n* @param {Point} [params.pub] - public key point (aka `A` in eddsa terms)\\\\n* @param {Array<Byte>} [params.pub] - public key point encoded as bytes\\\\n*\\\\n*/\\\\nfunction KeyPair(eddsa, params) {\\\\n  this.eddsa = eddsa;\\\\n  this._secret = parseBytes(params.secret);\\\\n  if (eddsa.isPoint(params.pub))\\\\n    this._pub = params.pub;\\\\n  else\\\\n    this._pubBytes = parseBytes(params.pub);\\\\n}\\\\n\\\\nKeyPair.fromPublic = function fromPublic(eddsa, pub) {\\\\n  if (pub instanceof KeyPair)\\\\n    return pub;\\\\n  return new KeyPair(eddsa, { pub: pub });\\\\n};\\\\n\\\\nKeyPair.fromSecret = function fromSecret(eddsa, secret) {\\\\n  if (secret instanceof KeyPair)\\\\n    return secret;\\\\n  return new KeyPair(eddsa, { secret: secret });\\\\n};\\\\n\\\\nKeyPair.prototype.secret = function secret() {\\\\n  return this._secret;\\\\n};\\\\n\\\\ncachedProperty(KeyPair, \'pubBytes\', function pubBytes() {\\\\n  return this.eddsa.encodePoint(this.pub());\\\\n});\\\\n\\\\ncachedProperty(KeyPair, \'pub\', function pub() {\\\\n  if (this._pubBytes)\\\\n    return this.eddsa.decodePoint(this._pubBytes);\\\\n  return this.eddsa.g.mul(this.priv());\\\\n});\\\\n\\\\ncachedProperty(KeyPair, \'privBytes\', function privBytes() {\\\\n  var eddsa = this.eddsa;\\\\n  var hash = this.hash();\\\\n  var lastIx = eddsa.encodingLength - 1;\\\\n\\\\n  var a = hash.slice(0, eddsa.encodingLength);\\\\n  a[0] &= 248;\\\\n  a[lastIx] &= 127;\\\\n  a[lastIx] |= 64;\\\\n\\\\n  return a;\\\\n});\\\\n\\\\ncachedProperty(KeyPair, \'priv\', function priv() {\\\\n  return this.eddsa.decodeInt(this.privBytes());\\\\n});\\\\n\\\\ncachedProperty(KeyPair, \'hash\', function hash() {\\\\n  return this.eddsa.hash().update(this.secret()).digest();\\\\n});\\\\n\\\\ncachedProperty(KeyPair, \'messagePrefix\', function messagePrefix() {\\\\n  return this.hash().slice(this.eddsa.encodingLength);\\\\n});\\\\n\\\\nKeyPair.prototype.sign = function sign(message) {\\\\n  assert(this._secret, \'KeyPair can only verify\');\\\\n  return this.eddsa.sign(message, this);\\\\n};\\\\n\\\\nKeyPair.prototype.verify = function verify(message, sig) {\\\\n  return this.eddsa.verify(message, sig, this);\\\\n};\\\\n\\\\nKeyPair.prototype.getSecret = function getSecret(enc) {\\\\n  assert(this._secret, \'KeyPair is public only\');\\\\n  return utils.encode(this.secret(), enc);\\\\n};\\\\n\\\\nKeyPair.prototype.getPublic = function getPublic(enc) {\\\\n  return utils.encode(this.pubBytes(), enc);\\\\n};\\\\n\\\\nmodule.exports = KeyPair;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/eddsa/key.js\\\\n// module id = 259\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/key.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(3);\\\\nvar elliptic = __webpack_require__(6);\\\\nvar utils = elliptic.utils;\\\\nvar assert = utils.assert;\\\\nvar cachedProperty = utils.cachedProperty;\\\\nvar parseBytes = utils.parseBytes;\\\\n\\\\n/**\\\\n* @param {EDDSA} eddsa - eddsa instance\\\\n* @param {Array<Bytes>|Object} sig -\\\\n* @param {Array<Bytes>|Point} [sig.R] - R point as Point or bytes\\\\n* @param {Array<Bytes>|bn} [sig.S] - S scalar as bn or bytes\\\\n* @param {Array<Bytes>} [sig.Rencoded] - R point encoded\\\\n* @param {Array<Bytes>} [sig.Sencoded] - S scalar encoded\\\\n*/\\\\nfunction Signature(eddsa, sig) {\\\\n  this.eddsa = eddsa;\\\\n\\\\n  if (typeof sig !== \'object\')\\\\n    sig = parseBytes(sig);\\\\n\\\\n  if (Array.isArray(sig)) {\\\\n    sig = {\\\\n      R: sig.slice(0, eddsa.encodingLength),\\\\n      S: sig.slice(eddsa.encodingLength)\\\\n    };\\\\n  }\\\\n\\\\n  assert(sig.R && sig.S, \'Signature without R or S\');\\\\n\\\\n  if (eddsa.isPoint(sig.R))\\\\n    this._R = sig.R;\\\\n  if (sig.S instanceof BN)\\\\n    this._S = sig.S;\\\\n\\\\n  this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;\\\\n  this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;\\\\n}\\\\n\\\\ncachedProperty(Signature, \'S\', function S() {\\\\n  return this.eddsa.decodeInt(this.Sencoded());\\\\n});\\\\n\\\\ncachedProperty(Signature, \'R\', function R() {\\\\n  return this.eddsa.decodePoint(this.Rencoded());\\\\n});\\\\n\\\\ncachedProperty(Signature, \'Rencoded\', function Rencoded() {\\\\n  return this.eddsa.encodePoint(this.R());\\\\n});\\\\n\\\\ncachedProperty(Signature, \'Sencoded\', function Sencoded() {\\\\n  return this.eddsa.encodeInt(this.S());\\\\n});\\\\n\\\\nSignature.prototype.toBytes = function toBytes() {\\\\n  return this.Rencoded().concat(this.Sencoded());\\\\n};\\\\n\\\\nSignature.prototype.toHex = function toHex() {\\\\n  return utils.encode(this.toBytes(), \'hex\').toUpperCase();\\\\n};\\\\n\\\\nmodule.exports = Signature;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/eddsa/signature.js\\\\n// module id = 260\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/eddsa/signature.js\\")},function(module,exports){eval(\\"module.exports = {\\\\n  doubles: {\\\\n    step: 4,\\\\n    points: [\\\\n      [\\\\n        \'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a\',\\\\n        \'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821\'\\\\n      ],\\\\n      [\\\\n        \'8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508\',\\\\n        \'11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf\'\\\\n      ],\\\\n      [\\\\n        \'175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739\',\\\\n        \'d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695\'\\\\n      ],\\\\n      [\\\\n        \'363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640\',\\\\n        \'4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9\'\\\\n      ],\\\\n      [\\\\n        \'8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c\',\\\\n        \'4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36\'\\\\n      ],\\\\n      [\\\\n        \'723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda\',\\\\n        \'96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f\'\\\\n      ],\\\\n      [\\\\n        \'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa\',\\\\n        \'5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999\'\\\\n      ],\\\\n      [\\\\n        \'100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0\',\\\\n        \'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09\'\\\\n      ],\\\\n      [\\\\n        \'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d\',\\\\n        \'9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d\'\\\\n      ],\\\\n      [\\\\n        \'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d\',\\\\n        \'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088\'\\\\n      ],\\\\n      [\\\\n        \'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1\',\\\\n        \'9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d\'\\\\n      ],\\\\n      [\\\\n        \'53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0\',\\\\n        \'5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8\'\\\\n      ],\\\\n      [\\\\n        \'8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047\',\\\\n        \'10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a\'\\\\n      ],\\\\n      [\\\\n        \'385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862\',\\\\n        \'283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453\'\\\\n      ],\\\\n      [\\\\n        \'6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7\',\\\\n        \'7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160\'\\\\n      ],\\\\n      [\\\\n        \'3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd\',\\\\n        \'56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0\'\\\\n      ],\\\\n      [\\\\n        \'85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83\',\\\\n        \'7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6\'\\\\n      ],\\\\n      [\\\\n        \'948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a\',\\\\n        \'53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589\'\\\\n      ],\\\\n      [\\\\n        \'6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8\',\\\\n        \'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17\'\\\\n      ],\\\\n      [\\\\n        \'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d\',\\\\n        \'4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda\'\\\\n      ],\\\\n      [\\\\n        \'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725\',\\\\n        \'7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd\'\\\\n      ],\\\\n      [\\\\n        \'213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754\',\\\\n        \'4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2\'\\\\n      ],\\\\n      [\\\\n        \'4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c\',\\\\n        \'17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6\'\\\\n      ],\\\\n      [\\\\n        \'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6\',\\\\n        \'6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f\'\\\\n      ],\\\\n      [\\\\n        \'76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39\',\\\\n        \'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01\'\\\\n      ],\\\\n      [\\\\n        \'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891\',\\\\n        \'893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3\'\\\\n      ],\\\\n      [\\\\n        \'d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b\',\\\\n        \'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f\'\\\\n      ],\\\\n      [\\\\n        \'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03\',\\\\n        \'2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7\'\\\\n      ],\\\\n      [\\\\n        \'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d\',\\\\n        \'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78\'\\\\n      ],\\\\n      [\\\\n        \'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070\',\\\\n        \'7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1\'\\\\n      ],\\\\n      [\\\\n        \'90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4\',\\\\n        \'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150\'\\\\n      ],\\\\n      [\\\\n        \'8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da\',\\\\n        \'662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82\'\\\\n      ],\\\\n      [\\\\n        \'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11\',\\\\n        \'1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc\'\\\\n      ],\\\\n      [\\\\n        \'8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e\',\\\\n        \'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b\'\\\\n      ],\\\\n      [\\\\n        \'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41\',\\\\n        \'2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51\'\\\\n      ],\\\\n      [\\\\n        \'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef\',\\\\n        \'67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45\'\\\\n      ],\\\\n      [\\\\n        \'d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8\',\\\\n        \'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120\'\\\\n      ],\\\\n      [\\\\n        \'324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d\',\\\\n        \'648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84\'\\\\n      ],\\\\n      [\\\\n        \'4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96\',\\\\n        \'35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d\'\\\\n      ],\\\\n      [\\\\n        \'9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd\',\\\\n        \'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d\'\\\\n      ],\\\\n      [\\\\n        \'6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5\',\\\\n        \'9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8\'\\\\n      ],\\\\n      [\\\\n        \'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266\',\\\\n        \'40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8\'\\\\n      ],\\\\n      [\\\\n        \'7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71\',\\\\n        \'34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac\'\\\\n      ],\\\\n      [\\\\n        \'928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac\',\\\\n        \'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f\'\\\\n      ],\\\\n      [\\\\n        \'85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751\',\\\\n        \'1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962\'\\\\n      ],\\\\n      [\\\\n        \'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e\',\\\\n        \'493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907\'\\\\n      ],\\\\n      [\\\\n        \'827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241\',\\\\n        \'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec\'\\\\n      ],\\\\n      [\\\\n        \'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3\',\\\\n        \'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d\'\\\\n      ],\\\\n      [\\\\n        \'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f\',\\\\n        \'4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414\'\\\\n      ],\\\\n      [\\\\n        \'1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19\',\\\\n        \'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd\'\\\\n      ],\\\\n      [\\\\n        \'146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be\',\\\\n        \'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0\'\\\\n      ],\\\\n      [\\\\n        \'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9\',\\\\n        \'6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811\'\\\\n      ],\\\\n      [\\\\n        \'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2\',\\\\n        \'8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1\'\\\\n      ],\\\\n      [\\\\n        \'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13\',\\\\n        \'7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c\'\\\\n      ],\\\\n      [\\\\n        \'174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c\',\\\\n        \'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73\'\\\\n      ],\\\\n      [\\\\n        \'959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba\',\\\\n        \'2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd\'\\\\n      ],\\\\n      [\\\\n        \'d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151\',\\\\n        \'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405\'\\\\n      ],\\\\n      [\\\\n        \'64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073\',\\\\n        \'d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589\'\\\\n      ],\\\\n      [\\\\n        \'8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458\',\\\\n        \'38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e\'\\\\n      ],\\\\n      [\\\\n        \'13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b\',\\\\n        \'69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27\'\\\\n      ],\\\\n      [\\\\n        \'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366\',\\\\n        \'d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1\'\\\\n      ],\\\\n      [\\\\n        \'8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa\',\\\\n        \'40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482\'\\\\n      ],\\\\n      [\\\\n        \'8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0\',\\\\n        \'620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945\'\\\\n      ],\\\\n      [\\\\n        \'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787\',\\\\n        \'7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573\'\\\\n      ],\\\\n      [\\\\n        \'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e\',\\\\n        \'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82\'\\\\n      ]\\\\n    ]\\\\n  },\\\\n  naf: {\\\\n    wnd: 7,\\\\n    points: [\\\\n      [\\\\n        \'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9\',\\\\n        \'388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672\'\\\\n      ],\\\\n      [\\\\n        \'2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4\',\\\\n        \'d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6\'\\\\n      ],\\\\n      [\\\\n        \'5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc\',\\\\n        \'6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da\'\\\\n      ],\\\\n      [\\\\n        \'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe\',\\\\n        \'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37\'\\\\n      ],\\\\n      [\\\\n        \'774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb\',\\\\n        \'d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b\'\\\\n      ],\\\\n      [\\\\n        \'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8\',\\\\n        \'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81\'\\\\n      ],\\\\n      [\\\\n        \'d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e\',\\\\n        \'581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58\'\\\\n      ],\\\\n      [\\\\n        \'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34\',\\\\n        \'4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77\'\\\\n      ],\\\\n      [\\\\n        \'2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c\',\\\\n        \'85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a\'\\\\n      ],\\\\n      [\\\\n        \'352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5\',\\\\n        \'321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c\'\\\\n      ],\\\\n      [\\\\n        \'2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f\',\\\\n        \'2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67\'\\\\n      ],\\\\n      [\\\\n        \'9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714\',\\\\n        \'73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402\'\\\\n      ],\\\\n      [\\\\n        \'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729\',\\\\n        \'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55\'\\\\n      ],\\\\n      [\\\\n        \'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db\',\\\\n        \'2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482\'\\\\n      ],\\\\n      [\\\\n        \'6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4\',\\\\n        \'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82\'\\\\n      ],\\\\n      [\\\\n        \'1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5\',\\\\n        \'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396\'\\\\n      ],\\\\n      [\\\\n        \'605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479\',\\\\n        \'2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49\'\\\\n      ],\\\\n      [\\\\n        \'62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d\',\\\\n        \'80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf\'\\\\n      ],\\\\n      [\\\\n        \'80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f\',\\\\n        \'1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a\'\\\\n      ],\\\\n      [\\\\n        \'7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb\',\\\\n        \'d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7\'\\\\n      ],\\\\n      [\\\\n        \'d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9\',\\\\n        \'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933\'\\\\n      ],\\\\n      [\\\\n        \'49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963\',\\\\n        \'758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a\'\\\\n      ],\\\\n      [\\\\n        \'77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74\',\\\\n        \'958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6\'\\\\n      ],\\\\n      [\\\\n        \'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530\',\\\\n        \'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37\'\\\\n      ],\\\\n      [\\\\n        \'463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b\',\\\\n        \'5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e\'\\\\n      ],\\\\n      [\\\\n        \'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247\',\\\\n        \'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6\'\\\\n      ],\\\\n      [\\\\n        \'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1\',\\\\n        \'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476\'\\\\n      ],\\\\n      [\\\\n        \'2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120\',\\\\n        \'4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40\'\\\\n      ],\\\\n      [\\\\n        \'7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435\',\\\\n        \'91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61\'\\\\n      ],\\\\n      [\\\\n        \'754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18\',\\\\n        \'673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683\'\\\\n      ],\\\\n      [\\\\n        \'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8\',\\\\n        \'59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5\'\\\\n      ],\\\\n      [\\\\n        \'186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb\',\\\\n        \'3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b\'\\\\n      ],\\\\n      [\\\\n        \'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f\',\\\\n        \'55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417\'\\\\n      ],\\\\n      [\\\\n        \'5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143\',\\\\n        \'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868\'\\\\n      ],\\\\n      [\\\\n        \'290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba\',\\\\n        \'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a\'\\\\n      ],\\\\n      [\\\\n        \'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45\',\\\\n        \'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6\'\\\\n      ],\\\\n      [\\\\n        \'766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a\',\\\\n        \'744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996\'\\\\n      ],\\\\n      [\\\\n        \'59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e\',\\\\n        \'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e\'\\\\n      ],\\\\n      [\\\\n        \'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8\',\\\\n        \'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d\'\\\\n      ],\\\\n      [\\\\n        \'7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c\',\\\\n        \'30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2\'\\\\n      ],\\\\n      [\\\\n        \'948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519\',\\\\n        \'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e\'\\\\n      ],\\\\n      [\\\\n        \'7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab\',\\\\n        \'100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437\'\\\\n      ],\\\\n      [\\\\n        \'3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca\',\\\\n        \'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311\'\\\\n      ],\\\\n      [\\\\n        \'d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf\',\\\\n        \'8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4\'\\\\n      ],\\\\n      [\\\\n        \'1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610\',\\\\n        \'68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575\'\\\\n      ],\\\\n      [\\\\n        \'733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4\',\\\\n        \'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d\'\\\\n      ],\\\\n      [\\\\n        \'15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c\',\\\\n        \'d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d\'\\\\n      ],\\\\n      [\\\\n        \'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940\',\\\\n        \'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629\'\\\\n      ],\\\\n      [\\\\n        \'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980\',\\\\n        \'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06\'\\\\n      ],\\\\n      [\\\\n        \'311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3\',\\\\n        \'66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374\'\\\\n      ],\\\\n      [\\\\n        \'34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf\',\\\\n        \'9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee\'\\\\n      ],\\\\n      [\\\\n        \'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63\',\\\\n        \'4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1\'\\\\n      ],\\\\n      [\\\\n        \'d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448\',\\\\n        \'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b\'\\\\n      ],\\\\n      [\\\\n        \'32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf\',\\\\n        \'5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661\'\\\\n      ],\\\\n      [\\\\n        \'7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5\',\\\\n        \'8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6\'\\\\n      ],\\\\n      [\\\\n        \'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6\',\\\\n        \'8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e\'\\\\n      ],\\\\n      [\\\\n        \'16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5\',\\\\n        \'5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d\'\\\\n      ],\\\\n      [\\\\n        \'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99\',\\\\n        \'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc\'\\\\n      ],\\\\n      [\\\\n        \'78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51\',\\\\n        \'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4\'\\\\n      ],\\\\n      [\\\\n        \'494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5\',\\\\n        \'42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c\'\\\\n      ],\\\\n      [\\\\n        \'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5\',\\\\n        \'204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b\'\\\\n      ],\\\\n      [\\\\n        \'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997\',\\\\n        \'4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913\'\\\\n      ],\\\\n      [\\\\n        \'841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881\',\\\\n        \'73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154\'\\\\n      ],\\\\n      [\\\\n        \'5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5\',\\\\n        \'39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865\'\\\\n      ],\\\\n      [\\\\n        \'36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66\',\\\\n        \'d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc\'\\\\n      ],\\\\n      [\\\\n        \'336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726\',\\\\n        \'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224\'\\\\n      ],\\\\n      [\\\\n        \'8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede\',\\\\n        \'6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e\'\\\\n      ],\\\\n      [\\\\n        \'1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94\',\\\\n        \'60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6\'\\\\n      ],\\\\n      [\\\\n        \'85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31\',\\\\n        \'3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511\'\\\\n      ],\\\\n      [\\\\n        \'29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51\',\\\\n        \'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b\'\\\\n      ],\\\\n      [\\\\n        \'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252\',\\\\n        \'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2\'\\\\n      ],\\\\n      [\\\\n        \'4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5\',\\\\n        \'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c\'\\\\n      ],\\\\n      [\\\\n        \'d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b\',\\\\n        \'6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3\'\\\\n      ],\\\\n      [\\\\n        \'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4\',\\\\n        \'322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d\'\\\\n      ],\\\\n      [\\\\n        \'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f\',\\\\n        \'6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700\'\\\\n      ],\\\\n      [\\\\n        \'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889\',\\\\n        \'2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4\'\\\\n      ],\\\\n      [\\\\n        \'591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246\',\\\\n        \'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196\'\\\\n      ],\\\\n      [\\\\n        \'11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984\',\\\\n        \'998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4\'\\\\n      ],\\\\n      [\\\\n        \'3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a\',\\\\n        \'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257\'\\\\n      ],\\\\n      [\\\\n        \'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030\',\\\\n        \'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13\'\\\\n      ],\\\\n      [\\\\n        \'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197\',\\\\n        \'6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096\'\\\\n      ],\\\\n      [\\\\n        \'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593\',\\\\n        \'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38\'\\\\n      ],\\\\n      [\\\\n        \'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef\',\\\\n        \'21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f\'\\\\n      ],\\\\n      [\\\\n        \'347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38\',\\\\n        \'60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448\'\\\\n      ],\\\\n      [\\\\n        \'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a\',\\\\n        \'49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a\'\\\\n      ],\\\\n      [\\\\n        \'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111\',\\\\n        \'5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4\'\\\\n      ],\\\\n      [\\\\n        \'4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502\',\\\\n        \'7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437\'\\\\n      ],\\\\n      [\\\\n        \'3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea\',\\\\n        \'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7\'\\\\n      ],\\\\n      [\\\\n        \'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26\',\\\\n        \'8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d\'\\\\n      ],\\\\n      [\\\\n        \'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986\',\\\\n        \'39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a\'\\\\n      ],\\\\n      [\\\\n        \'d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e\',\\\\n        \'62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54\'\\\\n      ],\\\\n      [\\\\n        \'48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4\',\\\\n        \'25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77\'\\\\n      ],\\\\n      [\\\\n        \'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda\',\\\\n        \'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517\'\\\\n      ],\\\\n      [\\\\n        \'6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859\',\\\\n        \'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10\'\\\\n      ],\\\\n      [\\\\n        \'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f\',\\\\n        \'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125\'\\\\n      ],\\\\n      [\\\\n        \'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c\',\\\\n        \'6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e\'\\\\n      ],\\\\n      [\\\\n        \'13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942\',\\\\n        \'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1\'\\\\n      ],\\\\n      [\\\\n        \'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a\',\\\\n        \'1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2\'\\\\n      ],\\\\n      [\\\\n        \'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80\',\\\\n        \'5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423\'\\\\n      ],\\\\n      [\\\\n        \'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d\',\\\\n        \'438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8\'\\\\n      ],\\\\n      [\\\\n        \'8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1\',\\\\n        \'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758\'\\\\n      ],\\\\n      [\\\\n        \'52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63\',\\\\n        \'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375\'\\\\n      ],\\\\n      [\\\\n        \'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352\',\\\\n        \'6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d\'\\\\n      ],\\\\n      [\\\\n        \'7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193\',\\\\n        \'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec\'\\\\n      ],\\\\n      [\\\\n        \'5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00\',\\\\n        \'9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0\'\\\\n      ],\\\\n      [\\\\n        \'32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58\',\\\\n        \'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c\'\\\\n      ],\\\\n      [\\\\n        \'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7\',\\\\n        \'d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4\'\\\\n      ],\\\\n      [\\\\n        \'8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8\',\\\\n        \'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f\'\\\\n      ],\\\\n      [\\\\n        \'4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e\',\\\\n        \'67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649\'\\\\n      ],\\\\n      [\\\\n        \'3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d\',\\\\n        \'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826\'\\\\n      ],\\\\n      [\\\\n        \'674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b\',\\\\n        \'299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5\'\\\\n      ],\\\\n      [\\\\n        \'d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f\',\\\\n        \'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87\'\\\\n      ],\\\\n      [\\\\n        \'30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6\',\\\\n        \'462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b\'\\\\n      ],\\\\n      [\\\\n        \'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297\',\\\\n        \'62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc\'\\\\n      ],\\\\n      [\\\\n        \'93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a\',\\\\n        \'7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c\'\\\\n      ],\\\\n      [\\\\n        \'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c\',\\\\n        \'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f\'\\\\n      ],\\\\n      [\\\\n        \'d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52\',\\\\n        \'4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a\'\\\\n      ],\\\\n      [\\\\n        \'d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb\',\\\\n        \'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46\'\\\\n      ],\\\\n      [\\\\n        \'463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065\',\\\\n        \'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f\'\\\\n      ],\\\\n      [\\\\n        \'7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917\',\\\\n        \'603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03\'\\\\n      ],\\\\n      [\\\\n        \'74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9\',\\\\n        \'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08\'\\\\n      ],\\\\n      [\\\\n        \'30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3\',\\\\n        \'553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8\'\\\\n      ],\\\\n      [\\\\n        \'9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57\',\\\\n        \'712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373\'\\\\n      ],\\\\n      [\\\\n        \'176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66\',\\\\n        \'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3\'\\\\n      ],\\\\n      [\\\\n        \'75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8\',\\\\n        \'9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8\'\\\\n      ],\\\\n      [\\\\n        \'809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721\',\\\\n        \'9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1\'\\\\n      ],\\\\n      [\\\\n        \'1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180\',\\\\n        \'4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9\'\\\\n      ]\\\\n    ]\\\\n  }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/precomputed/secp256k1.js\\\\n// module id = 261\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = exports;\\\\nvar BN = __webpack_require__(3);\\\\nvar minAssert = __webpack_require__(12);\\\\nvar minUtils = __webpack_require__(136);\\\\n\\\\nutils.assert = minAssert;\\\\nutils.toArray = minUtils.toArray;\\\\nutils.zero2 = minUtils.zero2;\\\\nutils.toHex = minUtils.toHex;\\\\nutils.encode = minUtils.encode;\\\\n\\\\n// Represent num in a w-NAF form\\\\nfunction getNAF(num, w) {\\\\n  var naf = [];\\\\n  var ws = 1 << (w + 1);\\\\n  var k = num.clone();\\\\n  while (k.cmpn(1) >= 0) {\\\\n    var z;\\\\n    if (k.isOdd()) {\\\\n      var mod = k.andln(ws - 1);\\\\n      if (mod > (ws >> 1) - 1)\\\\n        z = (ws >> 1) - mod;\\\\n      else\\\\n        z = mod;\\\\n      k.isubn(z);\\\\n    } else {\\\\n      z = 0;\\\\n    }\\\\n    naf.push(z);\\\\n\\\\n    // Optimization, shift by word if possible\\\\n    var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;\\\\n    for (var i = 1; i < shift; i++)\\\\n      naf.push(0);\\\\n    k.iushrn(shift);\\\\n  }\\\\n\\\\n  return naf;\\\\n}\\\\nutils.getNAF = getNAF;\\\\n\\\\n// Represent k1, k2 in a Joint Sparse Form\\\\nfunction getJSF(k1, k2) {\\\\n  var jsf = [\\\\n    [],\\\\n    []\\\\n  ];\\\\n\\\\n  k1 = k1.clone();\\\\n  k2 = k2.clone();\\\\n  var d1 = 0;\\\\n  var d2 = 0;\\\\n  while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\\\\n\\\\n    // First phase\\\\n    var m14 = (k1.andln(3) + d1) & 3;\\\\n    var m24 = (k2.andln(3) + d2) & 3;\\\\n    if (m14 === 3)\\\\n      m14 = -1;\\\\n    if (m24 === 3)\\\\n      m24 = -1;\\\\n    var u1;\\\\n    if ((m14 & 1) === 0) {\\\\n      u1 = 0;\\\\n    } else {\\\\n      var m8 = (k1.andln(7) + d1) & 7;\\\\n      if ((m8 === 3 || m8 === 5) && m24 === 2)\\\\n        u1 = -m14;\\\\n      else\\\\n        u1 = m14;\\\\n    }\\\\n    jsf[0].push(u1);\\\\n\\\\n    var u2;\\\\n    if ((m24 & 1) === 0) {\\\\n      u2 = 0;\\\\n    } else {\\\\n      var m8 = (k2.andln(7) + d2) & 7;\\\\n      if ((m8 === 3 || m8 === 5) && m14 === 2)\\\\n        u2 = -m24;\\\\n      else\\\\n        u2 = m24;\\\\n    }\\\\n    jsf[1].push(u2);\\\\n\\\\n    // Second phase\\\\n    if (2 * d1 === u1 + 1)\\\\n      d1 = 1 - d1;\\\\n    if (2 * d2 === u2 + 1)\\\\n      d2 = 1 - d2;\\\\n    k1.iushrn(1);\\\\n    k2.iushrn(1);\\\\n  }\\\\n\\\\n  return jsf;\\\\n}\\\\nutils.getJSF = getJSF;\\\\n\\\\nfunction cachedProperty(obj, name, computer) {\\\\n  var key = \'_\' + name;\\\\n  obj.prototype[name] = function cachedProperty() {\\\\n    return this[key] !== undefined ? this[key] :\\\\n           this[key] = computer.call(this);\\\\n  };\\\\n}\\\\nutils.cachedProperty = cachedProperty;\\\\n\\\\nfunction parseBytes(bytes) {\\\\n  return typeof bytes === \'string\' ? utils.toArray(bytes, \'hex\') :\\\\n                                     bytes;\\\\n}\\\\nutils.parseBytes = parseBytes;\\\\n\\\\nfunction intFromLE(bytes) {\\\\n  return new BN(bytes, \'hex\', \'le\');\\\\n}\\\\nutils.intFromLE = intFromLE;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/lib/elliptic/utils.js\\\\n// module id = 262\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/lib/elliptic/utils.js\\")},function(module,exports){eval(\'module.exports = {\\"_args\\":[[\\"elliptic@6.4.0\\",\\"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib\\"]],\\"_from\\":\\"elliptic@6.4.0\\",\\"_id\\":\\"elliptic@6.4.0\\",\\"_inBundle\\":false,\\"_integrity\\":\\"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=\\",\\"_location\\":\\"/elliptic\\",\\"_phantomChildren\\":{},\\"_requested\\":{\\"type\\":\\"version\\",\\"registry\\":true,\\"raw\\":\\"elliptic@6.4.0\\",\\"name\\":\\"elliptic\\",\\"escapedName\\":\\"elliptic\\",\\"rawSpec\\":\\"6.4.0\\",\\"saveSpec\\":null,\\"fetchSpec\\":\\"6.4.0\\"},\\"_requiredBy\\":[\\"/browserify-sign\\",\\"/create-ecdh\\",\\"/dc-messaging/web3-eth-accounts/eth-lib\\",\\"/eth-lib\\",\\"/secp256k1\\",\\"/web3-eth-accounts/eth-lib\\"],\\"_resolved\\":\\"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz\\",\\"_spec\\":\\"6.4.0\\",\\"_where\\":\\"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib\\",\\"author\\":{\\"name\\":\\"Fedor Indutny\\",\\"email\\":\\"fedor@indutny.com\\"},\\"bugs\\":{\\"url\\":\\"https://github.com/indutny/elliptic/issues\\"},\\"dependencies\\":{\\"bn.js\\":\\"^4.4.0\\",\\"brorand\\":\\"^1.0.1\\",\\"hash.js\\":\\"^1.0.0\\",\\"hmac-drbg\\":\\"^1.0.0\\",\\"inherits\\":\\"^2.0.1\\",\\"minimalistic-assert\\":\\"^1.0.0\\",\\"minimalistic-crypto-utils\\":\\"^1.0.0\\"},\\"description\\":\\"EC cryptography\\",\\"devDependencies\\":{\\"brfs\\":\\"^1.4.3\\",\\"coveralls\\":\\"^2.11.3\\",\\"grunt\\":\\"^0.4.5\\",\\"grunt-browserify\\":\\"^5.0.0\\",\\"grunt-cli\\":\\"^1.2.0\\",\\"grunt-contrib-connect\\":\\"^1.0.0\\",\\"grunt-contrib-copy\\":\\"^1.0.0\\",\\"grunt-contrib-uglify\\":\\"^1.0.1\\",\\"grunt-mocha-istanbul\\":\\"^3.0.1\\",\\"grunt-saucelabs\\":\\"^8.6.2\\",\\"istanbul\\":\\"^0.4.2\\",\\"jscs\\":\\"^2.9.0\\",\\"jshint\\":\\"^2.6.0\\",\\"mocha\\":\\"^2.1.0\\"},\\"files\\":[\\"lib\\"],\\"homepage\\":\\"https://github.com/indutny/elliptic\\",\\"keywords\\":[\\"EC\\",\\"Elliptic\\",\\"curve\\",\\"Cryptography\\"],\\"license\\":\\"MIT\\",\\"main\\":\\"lib/elliptic.js\\",\\"name\\":\\"elliptic\\",\\"repository\\":{\\"type\\":\\"git\\",\\"url\\":\\"git+ssh://git@github.com/indutny/elliptic.git\\"},\\"scripts\\":{\\"jscs\\":\\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\\",\\"jshint\\":\\"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js\\",\\"lint\\":\\"npm run jscs && npm run jshint\\",\\"test\\":\\"npm run lint && npm run unit\\",\\"unit\\":\\"istanbul test _mocha --reporter=spec test/index.js\\",\\"version\\":\\"grunt dist && git add dist/\\"},\\"version\\":\\"6.4.0\\"}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/elliptic/package.json\\\\n// module id = 263\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/elliptic/package.json\')},function(module,exports){eval(\\"var generate = function generate(num, fn) {\\\\n  var a = [];\\\\n  for (var i = 0; i < num; ++i) {\\\\n    a.push(fn(i));\\\\n  }return a;\\\\n};\\\\n\\\\nvar replicate = function replicate(num, val) {\\\\n  return generate(num, function () {\\\\n    return val;\\\\n  });\\\\n};\\\\n\\\\nvar concat = function concat(a, b) {\\\\n  return a.concat(b);\\\\n};\\\\n\\\\nvar flatten = function flatten(a) {\\\\n  var r = [];\\\\n  for (var j = 0, J = a.length; j < J; ++j) {\\\\n    for (var i = 0, I = a[j].length; i < I; ++i) {\\\\n      r.push(a[j][i]);\\\\n    }\\\\n  }return r;\\\\n};\\\\n\\\\nvar chunksOf = function chunksOf(n, a) {\\\\n  var b = [];\\\\n  for (var i = 0, l = a.length; i < l; i += n) {\\\\n    b.push(a.slice(i, i + n));\\\\n  }return b;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  generate: generate,\\\\n  replicate: replicate,\\\\n  concat: concat,\\\\n  flatten: flatten,\\\\n  chunksOf: chunksOf\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/eth-lib/lib/array.js\\\\n// module id = 264\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/eth-lib/lib/array.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar BN = __webpack_require__(266);\\\\nvar numberToBN = __webpack_require__(137);\\\\n\\\\nvar zero = new BN(0);\\\\nvar negative1 = new BN(-1);\\\\n\\\\n// complete ethereum unit map\\\\nvar unitMap = {\\\\n  \'noether\': \'0\', // eslint-disable-line\\\\n  \'wei\': \'1\', // eslint-disable-line\\\\n  \'kwei\': \'1000\', // eslint-disable-line\\\\n  \'Kwei\': \'1000\', // eslint-disable-line\\\\n  \'babbage\': \'1000\', // eslint-disable-line\\\\n  \'femtoether\': \'1000\', // eslint-disable-line\\\\n  \'mwei\': \'1000000\', // eslint-disable-line\\\\n  \'Mwei\': \'1000000\', // eslint-disable-line\\\\n  \'lovelace\': \'1000000\', // eslint-disable-line\\\\n  \'picoether\': \'1000000\', // eslint-disable-line\\\\n  \'gwei\': \'1000000000\', // eslint-disable-line\\\\n  \'Gwei\': \'1000000000\', // eslint-disable-line\\\\n  \'shannon\': \'1000000000\', // eslint-disable-line\\\\n  \'nanoether\': \'1000000000\', // eslint-disable-line\\\\n  \'nano\': \'1000000000\', // eslint-disable-line\\\\n  \'szabo\': \'1000000000000\', // eslint-disable-line\\\\n  \'microether\': \'1000000000000\', // eslint-disable-line\\\\n  \'micro\': \'1000000000000\', // eslint-disable-line\\\\n  \'finney\': \'1000000000000000\', // eslint-disable-line\\\\n  \'milliether\': \'1000000000000000\', // eslint-disable-line\\\\n  \'milli\': \'1000000000000000\', // eslint-disable-line\\\\n  \'ether\': \'1000000000000000000\', // eslint-disable-line\\\\n  \'kether\': \'1000000000000000000000\', // eslint-disable-line\\\\n  \'grand\': \'1000000000000000000000\', // eslint-disable-line\\\\n  \'mether\': \'1000000000000000000000000\', // eslint-disable-line\\\\n  \'gether\': \'1000000000000000000000000000\', // eslint-disable-line\\\\n  \'tether\': \'1000000000000000000000000000000\' };\\\\n\\\\n/**\\\\n * Returns value of unit in Wei\\\\n *\\\\n * @method getValueOfUnit\\\\n * @param {String} unit the unit to convert to, default ether\\\\n * @returns {BigNumber} value of the unit (in Wei)\\\\n * @throws error if the unit is not correct:w\\\\n */\\\\nfunction getValueOfUnit(unitInput) {\\\\n  var unit = unitInput ? unitInput.toLowerCase() : \'ether\';\\\\n  var unitValue = unitMap[unit]; // eslint-disable-line\\\\n\\\\n  if (typeof unitValue !== \'string\') {\\\\n    throw new Error(\'[ethjs-unit] the unit provided \' + unitInput + \' doesn\\\\\\\\\'t exists, please use the one of the following units \' + JSON.stringify(unitMap, null, 2));\\\\n  }\\\\n\\\\n  return new BN(unitValue, 10);\\\\n}\\\\n\\\\nfunction numberToString(arg) {\\\\n  if (typeof arg === \'string\') {\\\\n    if (!arg.match(/^-?[0-9.]+$/)) {\\\\n      throw new Error(\'while converting number to string, invalid number value \\\\\\\\\'\' + arg + \'\\\\\\\\\', should be a number matching (^-?[0-9.]+).\');\\\\n    }\\\\n    return arg;\\\\n  } else if (typeof arg === \'number\') {\\\\n    return String(arg);\\\\n  } else if (typeof arg === \'object\' && arg.toString && (arg.toTwos || arg.dividedToIntegerBy)) {\\\\n    if (arg.toPrecision) {\\\\n      return String(arg.toPrecision());\\\\n    } else {\\\\n      // eslint-disable-line\\\\n      return arg.toString(10);\\\\n    }\\\\n  }\\\\n  throw new Error(\'while converting number to string, invalid number value \\\\\\\\\'\' + arg + \'\\\\\\\\\' type \' + typeof arg + \'.\');\\\\n}\\\\n\\\\nfunction fromWei(weiInput, unit, optionsInput) {\\\\n  var wei = numberToBN(weiInput); // eslint-disable-line\\\\n  var negative = wei.lt(zero); // eslint-disable-line\\\\n  var base = getValueOfUnit(unit);\\\\n  var baseLength = unitMap[unit].length - 1 || 1;\\\\n  var options = optionsInput || {};\\\\n\\\\n  if (negative) {\\\\n    wei = wei.mul(negative1);\\\\n  }\\\\n\\\\n  var fraction = wei.mod(base).toString(10); // eslint-disable-line\\\\n\\\\n  while (fraction.length < baseLength) {\\\\n    fraction = \'0\' + fraction;\\\\n  }\\\\n\\\\n  if (!options.pad) {\\\\n    fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];\\\\n  }\\\\n\\\\n  var whole = wei.div(base).toString(10); // eslint-disable-line\\\\n\\\\n  if (options.commify) {\\\\n    whole = whole.replace(/\\\\\\\\B(?=(\\\\\\\\d{3})+(?!\\\\\\\\d))/g, \',\');\\\\n  }\\\\n\\\\n  var value = \'\' + whole + (fraction == \'0\' ? \'\' : \'.\' + fraction); // eslint-disable-line\\\\n\\\\n  if (negative) {\\\\n    value = \'-\' + value;\\\\n  }\\\\n\\\\n  return value;\\\\n}\\\\n\\\\nfunction toWei(etherInput, unit) {\\\\n  var ether = numberToString(etherInput); // eslint-disable-line\\\\n  var base = getValueOfUnit(unit);\\\\n  var baseLength = unitMap[unit].length - 1 || 1;\\\\n\\\\n  // Is it negative?\\\\n  var negative = ether.substring(0, 1) === \'-\'; // eslint-disable-line\\\\n  if (negative) {\\\\n    ether = ether.substring(1);\\\\n  }\\\\n\\\\n  if (ether === \'.\') {\\\\n    throw new Error(\'[ethjs-unit] while converting number \' + etherInput + \' to wei, invalid value\');\\\\n  }\\\\n\\\\n  // Split it into a whole and fractional part\\\\n  var comps = ether.split(\'.\'); // eslint-disable-line\\\\n  if (comps.length > 2) {\\\\n    throw new Error(\'[ethjs-unit] while converting number \' + etherInput + \' to wei,  too many decimal points\');\\\\n  }\\\\n\\\\n  var whole = comps[0],\\\\n      fraction = comps[1]; // eslint-disable-line\\\\n\\\\n  if (!whole) {\\\\n    whole = \'0\';\\\\n  }\\\\n  if (!fraction) {\\\\n    fraction = \'0\';\\\\n  }\\\\n  if (fraction.length > baseLength) {\\\\n    throw new Error(\'[ethjs-unit] while converting number \' + etherInput + \' to wei, too many decimal places\');\\\\n  }\\\\n\\\\n  while (fraction.length < baseLength) {\\\\n    fraction += \'0\';\\\\n  }\\\\n\\\\n  whole = new BN(whole);\\\\n  fraction = new BN(fraction);\\\\n  var wei = whole.mul(base).add(fraction); // eslint-disable-line\\\\n\\\\n  if (negative) {\\\\n    wei = wei.mul(negative1);\\\\n  }\\\\n\\\\n  return new BN(wei.toString(10), 10);\\\\n}\\\\n\\\\nmodule.exports = {\\\\n  unitMap: unitMap,\\\\n  numberToString: numberToString,\\\\n  getValueOfUnit: getValueOfUnit,\\\\n  fromWei: fromWei,\\\\n  toWei: toWei\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/ethjs-unit/lib/index.js\\\\n// module id = 265\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/ethjs-unit/lib/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\\\\n  \'use strict\';\\\\n\\\\n  // Utils\\\\n  function assert (val, msg) {\\\\n    if (!val) throw new Error(msg || \'Assertion failed\');\\\\n  }\\\\n\\\\n  // Could use `inherits` module, but don\'t want to move from single file\\\\n  // architecture yet.\\\\n  function inherits (ctor, superCtor) {\\\\n    ctor.super_ = superCtor;\\\\n    var TempCtor = function () {};\\\\n    TempCtor.prototype = superCtor.prototype;\\\\n    ctor.prototype = new TempCtor();\\\\n    ctor.prototype.constructor = ctor;\\\\n  }\\\\n\\\\n  // BN\\\\n\\\\n  function BN (number, base, endian) {\\\\n    if (BN.isBN(number)) {\\\\n      return number;\\\\n    }\\\\n\\\\n    this.negative = 0;\\\\n    this.words = null;\\\\n    this.length = 0;\\\\n\\\\n    // Reduction context\\\\n    this.red = null;\\\\n\\\\n    if (number !== null) {\\\\n      if (base === \'le\' || base === \'be\') {\\\\n        endian = base;\\\\n        base = 10;\\\\n      }\\\\n\\\\n      this._init(number || 0, base || 10, endian || \'be\');\\\\n    }\\\\n  }\\\\n  if (typeof module === \'object\') {\\\\n    module.exports = BN;\\\\n  } else {\\\\n    exports.BN = BN;\\\\n  }\\\\n\\\\n  BN.BN = BN;\\\\n  BN.wordSize = 26;\\\\n\\\\n  var Buffer;\\\\n  try {\\\\n    Buffer = __webpack_require__(1).Buffer;\\\\n  } catch (e) {\\\\n  }\\\\n\\\\n  BN.isBN = function isBN (num) {\\\\n    if (num instanceof BN) {\\\\n      return true;\\\\n    }\\\\n\\\\n    return num !== null && typeof num === \'object\' &&\\\\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\\\\n  };\\\\n\\\\n  BN.max = function max (left, right) {\\\\n    if (left.cmp(right) > 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.min = function min (left, right) {\\\\n    if (left.cmp(right) < 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.prototype._init = function init (number, base, endian) {\\\\n    if (typeof number === \'number\') {\\\\n      return this._initNumber(number, base, endian);\\\\n    }\\\\n\\\\n    if (typeof number === \'object\') {\\\\n      return this._initArray(number, base, endian);\\\\n    }\\\\n\\\\n    if (base === \'hex\') {\\\\n      base = 16;\\\\n    }\\\\n    assert(base === (base | 0) && base >= 2 && base <= 36);\\\\n\\\\n    number = number.toString().replace(/\\\\\\\\s+/g, \'\');\\\\n    var start = 0;\\\\n    if (number[0] === \'-\') {\\\\n      start++;\\\\n    }\\\\n\\\\n    if (base === 16) {\\\\n      this._parseHex(number, start);\\\\n    } else {\\\\n      this._parseBase(number, base, start);\\\\n    }\\\\n\\\\n    if (number[0] === \'-\') {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    this.strip();\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\\\\n    if (number < 0) {\\\\n      this.negative = 1;\\\\n      number = -number;\\\\n    }\\\\n    if (number < 0x4000000) {\\\\n      this.words = [ number & 0x3ffffff ];\\\\n      this.length = 1;\\\\n    } else if (number < 0x10000000000000) {\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff\\\\n      ];\\\\n      this.length = 2;\\\\n    } else {\\\\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff,\\\\n        1\\\\n      ];\\\\n      this.length = 3;\\\\n    }\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    // Reverse the bytes\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initArray = function _initArray (number, base, endian) {\\\\n    // Perhaps a Uint8Array\\\\n    assert(typeof number.length === \'number\');\\\\n    if (number.length <= 0) {\\\\n      this.words = [ 0 ];\\\\n      this.length = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.length = Math.ceil(number.length / 3);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    var off = 0;\\\\n    if (endian === \'be\') {\\\\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\\\\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    } else if (endian === \'le\') {\\\\n      for (i = 0, j = 0; i < number.length; i += 3) {\\\\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    }\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  function parseHex (str, start, end) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r <<= 4;\\\\n\\\\n      // \'a\' - \'f\'\\\\n      if (c >= 49 && c <= 54) {\\\\n        r |= c - 49 + 0xa;\\\\n\\\\n      // \'A\' - \'F\'\\\\n      } else if (c >= 17 && c <= 22) {\\\\n        r |= c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r |= c & 0xf;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseHex = function _parseHex (number, start) {\\\\n    // Create possibly bigger array to ensure that it fits the number\\\\n    this.length = Math.ceil((number.length - start) / 6);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    // Scan 24-bit chunks and add them to the number\\\\n    var off = 0;\\\\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\\\\n      w = parseHex(number, i, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n      off += 24;\\\\n      if (off >= 26) {\\\\n        off -= 26;\\\\n        j++;\\\\n      }\\\\n    }\\\\n    if (i + 6 !== start) {\\\\n      w = parseHex(number, start, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n    }\\\\n    this.strip();\\\\n  };\\\\n\\\\n  function parseBase (str, start, end, mul) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r *= mul;\\\\n\\\\n      // \'a\'\\\\n      if (c >= 49) {\\\\n        r += c - 49 + 0xa;\\\\n\\\\n      // \'A\'\\\\n      } else if (c >= 17) {\\\\n        r += c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r += c;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\\\\n    // Initialize as zero\\\\n    this.words = [ 0 ];\\\\n    this.length = 1;\\\\n\\\\n    // Find length of limb in base\\\\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\\\\n      limbLen++;\\\\n    }\\\\n    limbLen--;\\\\n    limbPow = (limbPow / base) | 0;\\\\n\\\\n    var total = number.length - start;\\\\n    var mod = total % limbLen;\\\\n    var end = Math.min(total, total - mod) + start;\\\\n\\\\n    var word = 0;\\\\n    for (var i = start; i < end; i += limbLen) {\\\\n      word = parseBase(number, i, i + limbLen, base);\\\\n\\\\n      this.imuln(limbPow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n\\\\n    if (mod !== 0) {\\\\n      var pow = 1;\\\\n      word = parseBase(number, i, number.length, base);\\\\n\\\\n      for (i = 0; i < mod; i++) {\\\\n        pow *= base;\\\\n      }\\\\n\\\\n      this.imuln(pow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  BN.prototype.copy = function copy (dest) {\\\\n    dest.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      dest.words[i] = this.words[i];\\\\n    }\\\\n    dest.length = this.length;\\\\n    dest.negative = this.negative;\\\\n    dest.red = this.red;\\\\n  };\\\\n\\\\n  BN.prototype.clone = function clone () {\\\\n    var r = new BN(null);\\\\n    this.copy(r);\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype._expand = function _expand (size) {\\\\n    while (this.length < size) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  // Remove leading `0` from `this`\\\\n  BN.prototype.strip = function strip () {\\\\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\\\\n      this.length--;\\\\n    }\\\\n    return this._normSign();\\\\n  };\\\\n\\\\n  BN.prototype._normSign = function _normSign () {\\\\n    // -0 = 0\\\\n    if (this.length === 1 && this.words[0] === 0) {\\\\n      this.negative = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.inspect = function inspect () {\\\\n    return (this.red ? \'<BN-R: \' : \'<BN: \') + this.toString(16) + \'>\';\\\\n  };\\\\n\\\\n  /*\\\\n\\\\n  var zeros = [];\\\\n  var groupSizes = [];\\\\n  var groupBases = [];\\\\n\\\\n  var s = \'\';\\\\n  var i = -1;\\\\n  while (++i < BN.wordSize) {\\\\n    zeros[i] = s;\\\\n    s += \'0\';\\\\n  }\\\\n  groupSizes[0] = 0;\\\\n  groupSizes[1] = 0;\\\\n  groupBases[0] = 0;\\\\n  groupBases[1] = 0;\\\\n  var base = 2 - 1;\\\\n  while (++base < 36 + 1) {\\\\n    var groupSize = 0;\\\\n    var groupBase = 1;\\\\n    while (groupBase < (1 << BN.wordSize) / base) {\\\\n      groupBase *= base;\\\\n      groupSize += 1;\\\\n    }\\\\n    groupSizes[base] = groupSize;\\\\n    groupBases[base] = groupBase;\\\\n  }\\\\n\\\\n  */\\\\n\\\\n  var zeros = [\\\\n    \'\',\\\\n    \'0\',\\\\n    \'00\',\\\\n    \'000\',\\\\n    \'0000\',\\\\n    \'00000\',\\\\n    \'000000\',\\\\n    \'0000000\',\\\\n    \'00000000\',\\\\n    \'000000000\',\\\\n    \'0000000000\',\\\\n    \'00000000000\',\\\\n    \'000000000000\',\\\\n    \'0000000000000\',\\\\n    \'00000000000000\',\\\\n    \'000000000000000\',\\\\n    \'0000000000000000\',\\\\n    \'00000000000000000\',\\\\n    \'000000000000000000\',\\\\n    \'0000000000000000000\',\\\\n    \'00000000000000000000\',\\\\n    \'000000000000000000000\',\\\\n    \'0000000000000000000000\',\\\\n    \'00000000000000000000000\',\\\\n    \'000000000000000000000000\',\\\\n    \'0000000000000000000000000\'\\\\n  ];\\\\n\\\\n  var groupSizes = [\\\\n    0, 0,\\\\n    25, 16, 12, 11, 10, 9, 8,\\\\n    8, 7, 7, 7, 7, 6, 6,\\\\n    6, 6, 6, 6, 6, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5\\\\n  ];\\\\n\\\\n  var groupBases = [\\\\n    0, 0,\\\\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\\\\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\\\\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\\\\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\\\\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\\\\n  ];\\\\n\\\\n  BN.prototype.toString = function toString (base, padding) {\\\\n    base = base || 10;\\\\n    padding = padding | 0 || 1;\\\\n\\\\n    var out;\\\\n    if (base === 16 || base === \'hex\') {\\\\n      out = \'\';\\\\n      var off = 0;\\\\n      var carry = 0;\\\\n      for (var i = 0; i < this.length; i++) {\\\\n        var w = this.words[i];\\\\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\\\\n        carry = (w >>> (24 - off)) & 0xffffff;\\\\n        if (carry !== 0 || i !== this.length - 1) {\\\\n          out = zeros[6 - word.length] + word + out;\\\\n        } else {\\\\n          out = word + out;\\\\n        }\\\\n        off += 2;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          i--;\\\\n        }\\\\n      }\\\\n      if (carry !== 0) {\\\\n        out = carry.toString(16) + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    if (base === (base | 0) && base >= 2 && base <= 36) {\\\\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\\\\n      var groupSize = groupSizes[base];\\\\n      // var groupBase = Math.pow(base, groupSize);\\\\n      var groupBase = groupBases[base];\\\\n      out = \'\';\\\\n      var c = this.clone();\\\\n      c.negative = 0;\\\\n      while (!c.isZero()) {\\\\n        var r = c.modn(groupBase).toString(base);\\\\n        c = c.idivn(groupBase);\\\\n\\\\n        if (!c.isZero()) {\\\\n          out = zeros[groupSize - r.length] + r + out;\\\\n        } else {\\\\n          out = r + out;\\\\n        }\\\\n      }\\\\n      if (this.isZero()) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    assert(false, \'Base should be between 2 and 36\');\\\\n  };\\\\n\\\\n  BN.prototype.toNumber = function toNumber () {\\\\n    var ret = this.words[0];\\\\n    if (this.length === 2) {\\\\n      ret += this.words[1] * 0x4000000;\\\\n    } else if (this.length === 3 && this.words[2] === 0x01) {\\\\n      // NOTE: at this stage it is known that the top bit is set\\\\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\\\\n    } else if (this.length > 2) {\\\\n      assert(false, \'Number can only safely store up to 53 bits\');\\\\n    }\\\\n    return (this.negative !== 0) ? -ret : ret;\\\\n  };\\\\n\\\\n  BN.prototype.toJSON = function toJSON () {\\\\n    return this.toString(16);\\\\n  };\\\\n\\\\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\\\\n    assert(typeof Buffer !== \'undefined\');\\\\n    return this.toArrayLike(Buffer, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArray = function toArray (endian, length) {\\\\n    return this.toArrayLike(Array, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\\\\n    var byteLength = this.byteLength();\\\\n    var reqLength = length || Math.max(1, byteLength);\\\\n    assert(byteLength <= reqLength, \'byte array longer than desired length\');\\\\n    assert(reqLength > 0, \'Requested array length <= 0\');\\\\n\\\\n    this.strip();\\\\n    var littleEndian = endian === \'le\';\\\\n    var res = new ArrayType(reqLength);\\\\n\\\\n    var b, i;\\\\n    var q = this.clone();\\\\n    if (!littleEndian) {\\\\n      // Assume big-endian\\\\n      for (i = 0; i < reqLength - byteLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[reqLength - i - 1] = b;\\\\n      }\\\\n    } else {\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[i] = b;\\\\n      }\\\\n\\\\n      for (; i < reqLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  if (Math.clz32) {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      return 32 - Math.clz32(w);\\\\n    };\\\\n  } else {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      var t = w;\\\\n      var r = 0;\\\\n      if (t >= 0x1000) {\\\\n        r += 13;\\\\n        t >>>= 13;\\\\n      }\\\\n      if (t >= 0x40) {\\\\n        r += 7;\\\\n        t >>>= 7;\\\\n      }\\\\n      if (t >= 0x8) {\\\\n        r += 4;\\\\n        t >>>= 4;\\\\n      }\\\\n      if (t >= 0x02) {\\\\n        r += 2;\\\\n        t >>>= 2;\\\\n      }\\\\n      return r + t;\\\\n    };\\\\n  }\\\\n\\\\n  BN.prototype._zeroBits = function _zeroBits (w) {\\\\n    // Short-cut\\\\n    if (w === 0) return 26;\\\\n\\\\n    var t = w;\\\\n    var r = 0;\\\\n    if ((t & 0x1fff) === 0) {\\\\n      r += 13;\\\\n      t >>>= 13;\\\\n    }\\\\n    if ((t & 0x7f) === 0) {\\\\n      r += 7;\\\\n      t >>>= 7;\\\\n    }\\\\n    if ((t & 0xf) === 0) {\\\\n      r += 4;\\\\n      t >>>= 4;\\\\n    }\\\\n    if ((t & 0x3) === 0) {\\\\n      r += 2;\\\\n      t >>>= 2;\\\\n    }\\\\n    if ((t & 0x1) === 0) {\\\\n      r++;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  // Return number of used bits in a BN\\\\n  BN.prototype.bitLength = function bitLength () {\\\\n    var w = this.words[this.length - 1];\\\\n    var hi = this._countBits(w);\\\\n    return (this.length - 1) * 26 + hi;\\\\n  };\\\\n\\\\n  function toBitArray (num) {\\\\n    var w = new Array(num.bitLength());\\\\n\\\\n    for (var bit = 0; bit < w.length; bit++) {\\\\n      var off = (bit / 26) | 0;\\\\n      var wbit = bit % 26;\\\\n\\\\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\\\\n    }\\\\n\\\\n    return w;\\\\n  }\\\\n\\\\n  // Number of trailing zero bits\\\\n  BN.prototype.zeroBits = function zeroBits () {\\\\n    if (this.isZero()) return 0;\\\\n\\\\n    var r = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var b = this._zeroBits(this.words[i]);\\\\n      r += b;\\\\n      if (b !== 26) break;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype.byteLength = function byteLength () {\\\\n    return Math.ceil(this.bitLength() / 8);\\\\n  };\\\\n\\\\n  BN.prototype.toTwos = function toTwos (width) {\\\\n    if (this.negative !== 0) {\\\\n      return this.abs().inotn(width).iaddn(1);\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.fromTwos = function fromTwos (width) {\\\\n    if (this.testn(width - 1)) {\\\\n      return this.notn(width).iaddn(1).ineg();\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.isNeg = function isNeg () {\\\\n    return this.negative !== 0;\\\\n  };\\\\n\\\\n  // Return negative clone of `this`\\\\n  BN.prototype.neg = function neg () {\\\\n    return this.clone().ineg();\\\\n  };\\\\n\\\\n  BN.prototype.ineg = function ineg () {\\\\n    if (!this.isZero()) {\\\\n      this.negative ^= 1;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Or `num` with `this` in-place\\\\n  BN.prototype.iuor = function iuor (num) {\\\\n    while (this.length < num.length) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      this.words[i] = this.words[i] | num.words[i];\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ior = function ior (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuor(num);\\\\n  };\\\\n\\\\n  // Or `num` with `this`\\\\n  BN.prototype.or = function or (num) {\\\\n    if (this.length > num.length) return this.clone().ior(num);\\\\n    return num.clone().ior(this);\\\\n  };\\\\n\\\\n  BN.prototype.uor = function uor (num) {\\\\n    if (this.length > num.length) return this.clone().iuor(num);\\\\n    return num.clone().iuor(this);\\\\n  };\\\\n\\\\n  // And `num` with `this` in-place\\\\n  BN.prototype.iuand = function iuand (num) {\\\\n    // b = min-length(num, this)\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      b = num;\\\\n    } else {\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = this.words[i] & num.words[i];\\\\n    }\\\\n\\\\n    this.length = b.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.iand = function iand (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuand(num);\\\\n  };\\\\n\\\\n  // And `num` with `this`\\\\n  BN.prototype.and = function and (num) {\\\\n    if (this.length > num.length) return this.clone().iand(num);\\\\n    return num.clone().iand(this);\\\\n  };\\\\n\\\\n  BN.prototype.uand = function uand (num) {\\\\n    if (this.length > num.length) return this.clone().iuand(num);\\\\n    return num.clone().iuand(this);\\\\n  };\\\\n\\\\n  // Xor `num` with `this` in-place\\\\n  BN.prototype.iuxor = function iuxor (num) {\\\\n    // a.length > b.length\\\\n    var a;\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = a.words[i] ^ b.words[i];\\\\n    }\\\\n\\\\n    if (this !== a) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ixor = function ixor (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuxor(num);\\\\n  };\\\\n\\\\n  // Xor `num` with `this`\\\\n  BN.prototype.xor = function xor (num) {\\\\n    if (this.length > num.length) return this.clone().ixor(num);\\\\n    return num.clone().ixor(this);\\\\n  };\\\\n\\\\n  BN.prototype.uxor = function uxor (num) {\\\\n    if (this.length > num.length) return this.clone().iuxor(num);\\\\n    return num.clone().iuxor(this);\\\\n  };\\\\n\\\\n  // Not ``this`` with ``width`` bitwidth\\\\n  BN.prototype.inotn = function inotn (width) {\\\\n    assert(typeof width === \'number\' && width >= 0);\\\\n\\\\n    var bytesNeeded = Math.ceil(width / 26) | 0;\\\\n    var bitsLeft = width % 26;\\\\n\\\\n    // Extend the buffer with leading zeroes\\\\n    this._expand(bytesNeeded);\\\\n\\\\n    if (bitsLeft > 0) {\\\\n      bytesNeeded--;\\\\n    }\\\\n\\\\n    // Handle complete words\\\\n    for (var i = 0; i < bytesNeeded; i++) {\\\\n      this.words[i] = ~this.words[i] & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Handle the residue\\\\n    if (bitsLeft > 0) {\\\\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\\\\n    }\\\\n\\\\n    // And remove leading zeroes\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.notn = function notn (width) {\\\\n    return this.clone().inotn(width);\\\\n  };\\\\n\\\\n  // Set `bit` of `this`\\\\n  BN.prototype.setn = function setn (bit, val) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n\\\\n    var off = (bit / 26) | 0;\\\\n    var wbit = bit % 26;\\\\n\\\\n    this._expand(off + 1);\\\\n\\\\n    if (val) {\\\\n      this.words[off] = this.words[off] | (1 << wbit);\\\\n    } else {\\\\n      this.words[off] = this.words[off] & ~(1 << wbit);\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Add `num` to `this` in-place\\\\n  BN.prototype.iadd = function iadd (num) {\\\\n    var r;\\\\n\\\\n    // negative + positive\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      this.negative = 0;\\\\n      r = this.isub(num);\\\\n      this.negative ^= 1;\\\\n      return this._normSign();\\\\n\\\\n    // positive + negative\\\\n    } else if (this.negative === 0 && num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      r = this.isub(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n    }\\\\n\\\\n    // a.length > b.length\\\\n    var a, b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n    if (carry !== 0) {\\\\n      this.words[this.length] = carry;\\\\n      this.length++;\\\\n    // Copy the rest of the words\\\\n    } else if (a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Add `num` to `this`\\\\n  BN.prototype.add = function add (num) {\\\\n    var res;\\\\n    if (num.negative !== 0 && this.negative === 0) {\\\\n      num.negative = 0;\\\\n      res = this.sub(num);\\\\n      num.negative ^= 1;\\\\n      return res;\\\\n    } else if (num.negative === 0 && this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      res = num.sub(this);\\\\n      this.negative = 1;\\\\n      return res;\\\\n    }\\\\n\\\\n    if (this.length > num.length) return this.clone().iadd(num);\\\\n\\\\n    return num.clone().iadd(this);\\\\n  };\\\\n\\\\n  // Subtract `num` from `this` in-place\\\\n  BN.prototype.isub = function isub (num) {\\\\n    // this - (-num) = this + num\\\\n    if (num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      var r = this.iadd(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n\\\\n    // -this - num = -(this + num)\\\\n    } else if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iadd(num);\\\\n      this.negative = 1;\\\\n      return this._normSign();\\\\n    }\\\\n\\\\n    // At this point both numbers are positive\\\\n    var cmp = this.cmp(num);\\\\n\\\\n    // Optimization - zeroify\\\\n    if (cmp === 0) {\\\\n      this.negative = 0;\\\\n      this.length = 1;\\\\n      this.words[0] = 0;\\\\n      return this;\\\\n    }\\\\n\\\\n    // a > b\\\\n    var a, b;\\\\n    if (cmp > 0) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Copy rest of the words\\\\n    if (carry === 0 && i < a.length && a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = Math.max(this.length, i);\\\\n\\\\n    if (a !== this) {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Subtract `num` from `this`\\\\n  BN.prototype.sub = function sub (num) {\\\\n    return this.clone().isub(num);\\\\n  };\\\\n\\\\n  function smallMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    var len = (self.length + num.length) | 0;\\\\n    out.length = len;\\\\n    len = (len - 1) | 0;\\\\n\\\\n    // Peel one iteration (compiler can\'t do it, because of code complexity)\\\\n    var a = self.words[0] | 0;\\\\n    var b = num.words[0] | 0;\\\\n    var r = a * b;\\\\n\\\\n    var lo = r & 0x3ffffff;\\\\n    var carry = (r / 0x4000000) | 0;\\\\n    out.words[0] = lo;\\\\n\\\\n    for (var k = 1; k < len; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = carry >>> 26;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = (k - j) | 0;\\\\n        a = self.words[i] | 0;\\\\n        b = num.words[j] | 0;\\\\n        r = a * b + rword;\\\\n        ncarry += (r / 0x4000000) | 0;\\\\n        rword = r & 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword | 0;\\\\n      carry = ncarry | 0;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry | 0;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  // TODO(indutny): it may be reasonable to omit it for users who don\'t need\\\\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\\\\n  // multiplication (like elliptic secp256k1).\\\\n  var comb10MulTo = function comb10MulTo (self, num, out) {\\\\n    var a = self.words;\\\\n    var b = num.words;\\\\n    var o = out.words;\\\\n    var c = 0;\\\\n    var lo;\\\\n    var mid;\\\\n    var hi;\\\\n    var a0 = a[0] | 0;\\\\n    var al0 = a0 & 0x1fff;\\\\n    var ah0 = a0 >>> 13;\\\\n    var a1 = a[1] | 0;\\\\n    var al1 = a1 & 0x1fff;\\\\n    var ah1 = a1 >>> 13;\\\\n    var a2 = a[2] | 0;\\\\n    var al2 = a2 & 0x1fff;\\\\n    var ah2 = a2 >>> 13;\\\\n    var a3 = a[3] | 0;\\\\n    var al3 = a3 & 0x1fff;\\\\n    var ah3 = a3 >>> 13;\\\\n    var a4 = a[4] | 0;\\\\n    var al4 = a4 & 0x1fff;\\\\n    var ah4 = a4 >>> 13;\\\\n    var a5 = a[5] | 0;\\\\n    var al5 = a5 & 0x1fff;\\\\n    var ah5 = a5 >>> 13;\\\\n    var a6 = a[6] | 0;\\\\n    var al6 = a6 & 0x1fff;\\\\n    var ah6 = a6 >>> 13;\\\\n    var a7 = a[7] | 0;\\\\n    var al7 = a7 & 0x1fff;\\\\n    var ah7 = a7 >>> 13;\\\\n    var a8 = a[8] | 0;\\\\n    var al8 = a8 & 0x1fff;\\\\n    var ah8 = a8 >>> 13;\\\\n    var a9 = a[9] | 0;\\\\n    var al9 = a9 & 0x1fff;\\\\n    var ah9 = a9 >>> 13;\\\\n    var b0 = b[0] | 0;\\\\n    var bl0 = b0 & 0x1fff;\\\\n    var bh0 = b0 >>> 13;\\\\n    var b1 = b[1] | 0;\\\\n    var bl1 = b1 & 0x1fff;\\\\n    var bh1 = b1 >>> 13;\\\\n    var b2 = b[2] | 0;\\\\n    var bl2 = b2 & 0x1fff;\\\\n    var bh2 = b2 >>> 13;\\\\n    var b3 = b[3] | 0;\\\\n    var bl3 = b3 & 0x1fff;\\\\n    var bh3 = b3 >>> 13;\\\\n    var b4 = b[4] | 0;\\\\n    var bl4 = b4 & 0x1fff;\\\\n    var bh4 = b4 >>> 13;\\\\n    var b5 = b[5] | 0;\\\\n    var bl5 = b5 & 0x1fff;\\\\n    var bh5 = b5 >>> 13;\\\\n    var b6 = b[6] | 0;\\\\n    var bl6 = b6 & 0x1fff;\\\\n    var bh6 = b6 >>> 13;\\\\n    var b7 = b[7] | 0;\\\\n    var bl7 = b7 & 0x1fff;\\\\n    var bh7 = b7 >>> 13;\\\\n    var b8 = b[8] | 0;\\\\n    var bl8 = b8 & 0x1fff;\\\\n    var bh8 = b8 >>> 13;\\\\n    var b9 = b[9] | 0;\\\\n    var bl9 = b9 & 0x1fff;\\\\n    var bh9 = b9 >>> 13;\\\\n\\\\n    out.negative = self.negative ^ num.negative;\\\\n    out.length = 19;\\\\n    /* k = 0 */\\\\n    lo = Math.imul(al0, bl0);\\\\n    mid = Math.imul(al0, bh0);\\\\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\\\\n    hi = Math.imul(ah0, bh0);\\\\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\\\\n    w0 &= 0x3ffffff;\\\\n    /* k = 1 */\\\\n    lo = Math.imul(al1, bl0);\\\\n    mid = Math.imul(al1, bh0);\\\\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\\\\n    hi = Math.imul(ah1, bh0);\\\\n    lo = (lo + Math.imul(al0, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\\\\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\\\\n    w1 &= 0x3ffffff;\\\\n    /* k = 2 */\\\\n    lo = Math.imul(al2, bl0);\\\\n    mid = Math.imul(al2, bh0);\\\\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\\\\n    hi = Math.imul(ah2, bh0);\\\\n    lo = (lo + Math.imul(al1, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\\\\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\\\\n    w2 &= 0x3ffffff;\\\\n    /* k = 3 */\\\\n    lo = Math.imul(al3, bl0);\\\\n    mid = Math.imul(al3, bh0);\\\\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\\\\n    hi = Math.imul(ah3, bh0);\\\\n    lo = (lo + Math.imul(al2, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\\\\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\\\\n    w3 &= 0x3ffffff;\\\\n    /* k = 4 */\\\\n    lo = Math.imul(al4, bl0);\\\\n    mid = Math.imul(al4, bh0);\\\\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\\\\n    hi = Math.imul(ah4, bh0);\\\\n    lo = (lo + Math.imul(al3, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\\\\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\\\\n    w4 &= 0x3ffffff;\\\\n    /* k = 5 */\\\\n    lo = Math.imul(al5, bl0);\\\\n    mid = Math.imul(al5, bh0);\\\\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\\\\n    hi = Math.imul(ah5, bh0);\\\\n    lo = (lo + Math.imul(al4, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\\\\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\\\\n    w5 &= 0x3ffffff;\\\\n    /* k = 6 */\\\\n    lo = Math.imul(al6, bl0);\\\\n    mid = Math.imul(al6, bh0);\\\\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\\\\n    hi = Math.imul(ah6, bh0);\\\\n    lo = (lo + Math.imul(al5, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\\\\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\\\\n    w6 &= 0x3ffffff;\\\\n    /* k = 7 */\\\\n    lo = Math.imul(al7, bl0);\\\\n    mid = Math.imul(al7, bh0);\\\\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\\\\n    hi = Math.imul(ah7, bh0);\\\\n    lo = (lo + Math.imul(al6, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\\\\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\\\\n    w7 &= 0x3ffffff;\\\\n    /* k = 8 */\\\\n    lo = Math.imul(al8, bl0);\\\\n    mid = Math.imul(al8, bh0);\\\\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\\\\n    hi = Math.imul(ah8, bh0);\\\\n    lo = (lo + Math.imul(al7, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\\\\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\\\\n    w8 &= 0x3ffffff;\\\\n    /* k = 9 */\\\\n    lo = Math.imul(al9, bl0);\\\\n    mid = Math.imul(al9, bh0);\\\\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\\\\n    hi = Math.imul(ah9, bh0);\\\\n    lo = (lo + Math.imul(al8, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\\\\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\\\\n    w9 &= 0x3ffffff;\\\\n    /* k = 10 */\\\\n    lo = Math.imul(al9, bl1);\\\\n    mid = Math.imul(al9, bh1);\\\\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\\\\n    hi = Math.imul(ah9, bh1);\\\\n    lo = (lo + Math.imul(al8, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\\\\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\\\\n    w10 &= 0x3ffffff;\\\\n    /* k = 11 */\\\\n    lo = Math.imul(al9, bl2);\\\\n    mid = Math.imul(al9, bh2);\\\\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\\\\n    hi = Math.imul(ah9, bh2);\\\\n    lo = (lo + Math.imul(al8, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\\\\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\\\\n    w11 &= 0x3ffffff;\\\\n    /* k = 12 */\\\\n    lo = Math.imul(al9, bl3);\\\\n    mid = Math.imul(al9, bh3);\\\\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\\\\n    hi = Math.imul(ah9, bh3);\\\\n    lo = (lo + Math.imul(al8, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\\\\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\\\\n    w12 &= 0x3ffffff;\\\\n    /* k = 13 */\\\\n    lo = Math.imul(al9, bl4);\\\\n    mid = Math.imul(al9, bh4);\\\\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\\\\n    hi = Math.imul(ah9, bh4);\\\\n    lo = (lo + Math.imul(al8, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\\\\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\\\\n    w13 &= 0x3ffffff;\\\\n    /* k = 14 */\\\\n    lo = Math.imul(al9, bl5);\\\\n    mid = Math.imul(al9, bh5);\\\\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\\\\n    hi = Math.imul(ah9, bh5);\\\\n    lo = (lo + Math.imul(al8, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\\\\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\\\\n    w14 &= 0x3ffffff;\\\\n    /* k = 15 */\\\\n    lo = Math.imul(al9, bl6);\\\\n    mid = Math.imul(al9, bh6);\\\\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\\\\n    hi = Math.imul(ah9, bh6);\\\\n    lo = (lo + Math.imul(al8, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\\\\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\\\\n    w15 &= 0x3ffffff;\\\\n    /* k = 16 */\\\\n    lo = Math.imul(al9, bl7);\\\\n    mid = Math.imul(al9, bh7);\\\\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\\\\n    hi = Math.imul(ah9, bh7);\\\\n    lo = (lo + Math.imul(al8, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\\\\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\\\\n    w16 &= 0x3ffffff;\\\\n    /* k = 17 */\\\\n    lo = Math.imul(al9, bl8);\\\\n    mid = Math.imul(al9, bh8);\\\\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\\\\n    hi = Math.imul(ah9, bh8);\\\\n    lo = (lo + Math.imul(al8, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\\\\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\\\\n    w17 &= 0x3ffffff;\\\\n    /* k = 18 */\\\\n    lo = Math.imul(al9, bl9);\\\\n    mid = Math.imul(al9, bh9);\\\\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\\\\n    hi = Math.imul(ah9, bh9);\\\\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\\\\n    w18 &= 0x3ffffff;\\\\n    o[0] = w0;\\\\n    o[1] = w1;\\\\n    o[2] = w2;\\\\n    o[3] = w3;\\\\n    o[4] = w4;\\\\n    o[5] = w5;\\\\n    o[6] = w6;\\\\n    o[7] = w7;\\\\n    o[8] = w8;\\\\n    o[9] = w9;\\\\n    o[10] = w10;\\\\n    o[11] = w11;\\\\n    o[12] = w12;\\\\n    o[13] = w13;\\\\n    o[14] = w14;\\\\n    o[15] = w15;\\\\n    o[16] = w16;\\\\n    o[17] = w17;\\\\n    o[18] = w18;\\\\n    if (c !== 0) {\\\\n      o[19] = c;\\\\n      out.length++;\\\\n    }\\\\n    return out;\\\\n  };\\\\n\\\\n  // Polyfill comb\\\\n  if (!Math.imul) {\\\\n    comb10MulTo = smallMulTo;\\\\n  }\\\\n\\\\n  function bigMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    out.length = self.length + num.length;\\\\n\\\\n    var carry = 0;\\\\n    var hncarry = 0;\\\\n    for (var k = 0; k < out.length - 1; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = hncarry;\\\\n      hncarry = 0;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = k - j;\\\\n        var a = self.words[i] | 0;\\\\n        var b = num.words[j] | 0;\\\\n        var r = a * b;\\\\n\\\\n        var lo = r & 0x3ffffff;\\\\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\\\\n        lo = (lo + rword) | 0;\\\\n        rword = lo & 0x3ffffff;\\\\n        ncarry = (ncarry + (lo >>> 26)) | 0;\\\\n\\\\n        hncarry += ncarry >>> 26;\\\\n        ncarry &= 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword;\\\\n      carry = ncarry;\\\\n      ncarry = hncarry;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  function jumboMulTo (self, num, out) {\\\\n    var fftm = new FFTM();\\\\n    return fftm.mulp(self, num, out);\\\\n  }\\\\n\\\\n  BN.prototype.mulTo = function mulTo (num, out) {\\\\n    var res;\\\\n    var len = this.length + num.length;\\\\n    if (this.length === 10 && num.length === 10) {\\\\n      res = comb10MulTo(this, num, out);\\\\n    } else if (len < 63) {\\\\n      res = smallMulTo(this, num, out);\\\\n    } else if (len < 1024) {\\\\n      res = bigMulTo(this, num, out);\\\\n    } else {\\\\n      res = jumboMulTo(this, num, out);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Cooley-Tukey algorithm for FFT\\\\n  // slightly revisited to rely on looping instead of recursion\\\\n\\\\n  function FFTM (x, y) {\\\\n    this.x = x;\\\\n    this.y = y;\\\\n  }\\\\n\\\\n  FFTM.prototype.makeRBT = function makeRBT (N) {\\\\n    var t = new Array(N);\\\\n    var l = BN.prototype._countBits(N) - 1;\\\\n    for (var i = 0; i < N; i++) {\\\\n      t[i] = this.revBin(i, l, N);\\\\n    }\\\\n\\\\n    return t;\\\\n  };\\\\n\\\\n  // Returns binary-reversed representation of `x`\\\\n  FFTM.prototype.revBin = function revBin (x, l, N) {\\\\n    if (x === 0 || x === N - 1) return x;\\\\n\\\\n    var rb = 0;\\\\n    for (var i = 0; i < l; i++) {\\\\n      rb |= (x & 1) << (l - i - 1);\\\\n      x >>= 1;\\\\n    }\\\\n\\\\n    return rb;\\\\n  };\\\\n\\\\n  // Performs \\\\\\"tweedling\\\\\\" phase, therefore \'emulating\'\\\\n  // behaviour of the recursive algorithm\\\\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\\\\n    for (var i = 0; i < N; i++) {\\\\n      rtws[i] = rws[rbt[i]];\\\\n      itws[i] = iws[rbt[i]];\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\\\\n    this.permute(rbt, rws, iws, rtws, itws, N);\\\\n\\\\n    for (var s = 1; s < N; s <<= 1) {\\\\n      var l = s << 1;\\\\n\\\\n      var rtwdf = Math.cos(2 * Math.PI / l);\\\\n      var itwdf = Math.sin(2 * Math.PI / l);\\\\n\\\\n      for (var p = 0; p < N; p += l) {\\\\n        var rtwdf_ = rtwdf;\\\\n        var itwdf_ = itwdf;\\\\n\\\\n        for (var j = 0; j < s; j++) {\\\\n          var re = rtws[p + j];\\\\n          var ie = itws[p + j];\\\\n\\\\n          var ro = rtws[p + j + s];\\\\n          var io = itws[p + j + s];\\\\n\\\\n          var rx = rtwdf_ * ro - itwdf_ * io;\\\\n\\\\n          io = rtwdf_ * io + itwdf_ * ro;\\\\n          ro = rx;\\\\n\\\\n          rtws[p + j] = re + ro;\\\\n          itws[p + j] = ie + io;\\\\n\\\\n          rtws[p + j + s] = re - ro;\\\\n          itws[p + j + s] = ie - io;\\\\n\\\\n          /* jshint maxdepth : false */\\\\n          if (j !== l) {\\\\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\\\\n\\\\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\\\\n            rtwdf_ = rx;\\\\n          }\\\\n        }\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\\\\n    var N = Math.max(m, n) | 1;\\\\n    var odd = N & 1;\\\\n    var i = 0;\\\\n    for (N = N / 2 | 0; N; N = N >>> 1) {\\\\n      i++;\\\\n    }\\\\n\\\\n    return 1 << i + 1 + odd;\\\\n  };\\\\n\\\\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\\\\n    if (N <= 1) return;\\\\n\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var t = rws[i];\\\\n\\\\n      rws[i] = rws[N - i - 1];\\\\n      rws[N - i - 1] = t;\\\\n\\\\n      t = iws[i];\\\\n\\\\n      iws[i] = -iws[N - i - 1];\\\\n      iws[N - i - 1] = -t;\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\\\\n        Math.round(ws[2 * i] / N) +\\\\n        carry;\\\\n\\\\n      ws[i] = w & 0x3ffffff;\\\\n\\\\n      if (w < 0x4000000) {\\\\n        carry = 0;\\\\n      } else {\\\\n        carry = w / 0x4000000 | 0;\\\\n      }\\\\n    }\\\\n\\\\n    return ws;\\\\n  };\\\\n\\\\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < len; i++) {\\\\n      carry = carry + (ws[i] | 0);\\\\n\\\\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\\\\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\\\\n    }\\\\n\\\\n    // Pad with zeroes\\\\n    for (i = 2 * len; i < N; ++i) {\\\\n      rws[i] = 0;\\\\n    }\\\\n\\\\n    assert(carry === 0);\\\\n    assert((carry & ~0x1fff) === 0);\\\\n  };\\\\n\\\\n  FFTM.prototype.stub = function stub (N) {\\\\n    var ph = new Array(N);\\\\n    for (var i = 0; i < N; i++) {\\\\n      ph[i] = 0;\\\\n    }\\\\n\\\\n    return ph;\\\\n  };\\\\n\\\\n  FFTM.prototype.mulp = function mulp (x, y, out) {\\\\n    var N = 2 * this.guessLen13b(x.length, y.length);\\\\n\\\\n    var rbt = this.makeRBT(N);\\\\n\\\\n    var _ = this.stub(N);\\\\n\\\\n    var rws = new Array(N);\\\\n    var rwst = new Array(N);\\\\n    var iwst = new Array(N);\\\\n\\\\n    var nrws = new Array(N);\\\\n    var nrwst = new Array(N);\\\\n    var niwst = new Array(N);\\\\n\\\\n    var rmws = out.words;\\\\n    rmws.length = N;\\\\n\\\\n    this.convert13b(x.words, x.length, rws, N);\\\\n    this.convert13b(y.words, y.length, nrws, N);\\\\n\\\\n    this.transform(rws, _, rwst, iwst, N, rbt);\\\\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\\\\n\\\\n    for (var i = 0; i < N; i++) {\\\\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\\\\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\\\\n      rwst[i] = rx;\\\\n    }\\\\n\\\\n    this.conjugate(rwst, iwst, N);\\\\n    this.transform(rwst, iwst, rmws, _, N, rbt);\\\\n    this.conjugate(rmws, _, N);\\\\n    this.normalize13b(rmws, N);\\\\n\\\\n    out.negative = x.negative ^ y.negative;\\\\n    out.length = x.length + y.length;\\\\n    return out.strip();\\\\n  };\\\\n\\\\n  // Multiply `this` by `num`\\\\n  BN.prototype.mul = function mul (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return this.mulTo(num, out);\\\\n  };\\\\n\\\\n  // Multiply employing FFT\\\\n  BN.prototype.mulf = function mulf (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return jumboMulTo(this, num, out);\\\\n  };\\\\n\\\\n  // In-place Multiplication\\\\n  BN.prototype.imul = function imul (num) {\\\\n    return this.clone().mulTo(num, this);\\\\n  };\\\\n\\\\n  BN.prototype.imuln = function imuln (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n\\\\n    // Carry\\\\n    var carry = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var w = (this.words[i] | 0) * num;\\\\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\\\\n      carry >>= 26;\\\\n      carry += (w / 0x4000000) | 0;\\\\n      // NOTE: lo is 27bit maximum\\\\n      carry += lo >>> 26;\\\\n      this.words[i] = lo & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.muln = function muln (num) {\\\\n    return this.clone().imuln(num);\\\\n  };\\\\n\\\\n  // `this` * `this`\\\\n  BN.prototype.sqr = function sqr () {\\\\n    return this.mul(this);\\\\n  };\\\\n\\\\n  // `this` * `this` in-place\\\\n  BN.prototype.isqr = function isqr () {\\\\n    return this.imul(this.clone());\\\\n  };\\\\n\\\\n  // Math.pow(`this`, `num`)\\\\n  BN.prototype.pow = function pow (num) {\\\\n    var w = toBitArray(num);\\\\n    if (w.length === 0) return new BN(1);\\\\n\\\\n    // Skip leading zeroes\\\\n    var res = this;\\\\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\\\\n      if (w[i] !== 0) break;\\\\n    }\\\\n\\\\n    if (++i < w.length) {\\\\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\\\\n        if (w[i] === 0) continue;\\\\n\\\\n        res = res.mul(q);\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Shift-left in-place\\\\n  BN.prototype.iushln = function iushln (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\\\\n    var i;\\\\n\\\\n    if (r !== 0) {\\\\n      var carry = 0;\\\\n\\\\n      for (i = 0; i < this.length; i++) {\\\\n        var newCarry = this.words[i] & carryMask;\\\\n        var c = ((this.words[i] | 0) - newCarry) << r;\\\\n        this.words[i] = c | carry;\\\\n        carry = newCarry >>> (26 - r);\\\\n      }\\\\n\\\\n      if (carry) {\\\\n        this.words[i] = carry;\\\\n        this.length++;\\\\n      }\\\\n    }\\\\n\\\\n    if (s !== 0) {\\\\n      for (i = this.length - 1; i >= 0; i--) {\\\\n        this.words[i + s] = this.words[i];\\\\n      }\\\\n\\\\n      for (i = 0; i < s; i++) {\\\\n        this.words[i] = 0;\\\\n      }\\\\n\\\\n      this.length += s;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishln = function ishln (bits) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right in-place\\\\n  // NOTE: `hint` is a lowest bit before trailing zeroes\\\\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\\\\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var h;\\\\n    if (hint) {\\\\n      h = (hint - (hint % 26)) / 26;\\\\n    } else {\\\\n      h = 0;\\\\n    }\\\\n\\\\n    var r = bits % 26;\\\\n    var s = Math.min((bits - r) / 26, this.length);\\\\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n    var maskedWords = extended;\\\\n\\\\n    h -= s;\\\\n    h = Math.max(0, h);\\\\n\\\\n    // Extended mode, copy masked part\\\\n    if (maskedWords) {\\\\n      for (var i = 0; i < s; i++) {\\\\n        maskedWords.words[i] = this.words[i];\\\\n      }\\\\n      maskedWords.length = s;\\\\n    }\\\\n\\\\n    if (s === 0) {\\\\n      // No-op, we should not move anything at all\\\\n    } else if (this.length > s) {\\\\n      this.length -= s;\\\\n      for (i = 0; i < this.length; i++) {\\\\n        this.words[i] = this.words[i + s];\\\\n      }\\\\n    } else {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\\\\n      var word = this.words[i] | 0;\\\\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\\\\n      carry = word & mask;\\\\n    }\\\\n\\\\n    // Push carried bits as a mask\\\\n    if (maskedWords && carry !== 0) {\\\\n      maskedWords.words[maskedWords.length++] = carry;\\\\n    }\\\\n\\\\n    if (this.length === 0) {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushrn(bits, hint, extended);\\\\n  };\\\\n\\\\n  // Shift-left\\\\n  BN.prototype.shln = function shln (bits) {\\\\n    return this.clone().ishln(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushln = function ushln (bits) {\\\\n    return this.clone().iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right\\\\n  BN.prototype.shrn = function shrn (bits) {\\\\n    return this.clone().ishrn(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushrn = function ushrn (bits) {\\\\n    return this.clone().iushrn(bits);\\\\n  };\\\\n\\\\n  // Test if n bit is set\\\\n  BN.prototype.testn = function testn (bit) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) return false;\\\\n\\\\n    // Check bit and return\\\\n    var w = this.words[s];\\\\n\\\\n    return !!(w & q);\\\\n  };\\\\n\\\\n  // Return only lowers bits of number (in-place)\\\\n  BN.prototype.imaskn = function imaskn (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n\\\\n    assert(this.negative === 0, \'imaskn works only with positive numbers\');\\\\n\\\\n    if (this.length <= s) {\\\\n      return this;\\\\n    }\\\\n\\\\n    if (r !== 0) {\\\\n      s++;\\\\n    }\\\\n    this.length = Math.min(s, this.length);\\\\n\\\\n    if (r !== 0) {\\\\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n      this.words[this.length - 1] &= mask;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Return only lowers bits of number\\\\n  BN.prototype.maskn = function maskn (bits) {\\\\n    return this.clone().imaskn(bits);\\\\n  };\\\\n\\\\n  // Add plain number `num` to `this`\\\\n  BN.prototype.iaddn = function iaddn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.isubn(-num);\\\\n\\\\n    // Possible sign change\\\\n    if (this.negative !== 0) {\\\\n      if (this.length === 1 && (this.words[0] | 0) < num) {\\\\n        this.words[0] = num - (this.words[0] | 0);\\\\n        this.negative = 0;\\\\n        return this;\\\\n      }\\\\n\\\\n      this.negative = 0;\\\\n      this.isubn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add without checks\\\\n    return this._iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype._iaddn = function _iaddn (num) {\\\\n    this.words[0] += num;\\\\n\\\\n    // Carry\\\\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\\\\n      this.words[i] -= 0x4000000;\\\\n      if (i === this.length - 1) {\\\\n        this.words[i + 1] = 1;\\\\n      } else {\\\\n        this.words[i + 1]++;\\\\n      }\\\\n    }\\\\n    this.length = Math.max(this.length, i + 1);\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Subtract plain number `num` from `this`\\\\n  BN.prototype.isubn = function isubn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.iaddn(-num);\\\\n\\\\n    if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iaddn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.words[0] -= num;\\\\n\\\\n    if (this.length === 1 && this.words[0] < 0) {\\\\n      this.words[0] = -this.words[0];\\\\n      this.negative = 1;\\\\n    } else {\\\\n      // Carry\\\\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\\\\n        this.words[i] += 0x4000000;\\\\n        this.words[i + 1] -= 1;\\\\n      }\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.addn = function addn (num) {\\\\n    return this.clone().iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype.subn = function subn (num) {\\\\n    return this.clone().isubn(num);\\\\n  };\\\\n\\\\n  BN.prototype.iabs = function iabs () {\\\\n    this.negative = 0;\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.abs = function abs () {\\\\n    return this.clone().iabs();\\\\n  };\\\\n\\\\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\\\\n    var len = num.length + shift;\\\\n    var i;\\\\n\\\\n    this._expand(len);\\\\n\\\\n    var w;\\\\n    var carry = 0;\\\\n    for (i = 0; i < num.length; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      var right = (num.words[i] | 0) * mul;\\\\n      w -= right & 0x3ffffff;\\\\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n    for (; i < this.length - shift; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry === 0) return this.strip();\\\\n\\\\n    // Subtraction overflow\\\\n    assert(carry === -1);\\\\n    carry = 0;\\\\n    for (i = 0; i < this.length; i++) {\\\\n      w = -(this.words[i] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i] = w & 0x3ffffff;\\\\n    }\\\\n    this.negative = 1;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\\\\n    var shift = this.length - num.length;\\\\n\\\\n    var a = this.clone();\\\\n    var b = num;\\\\n\\\\n    // Normalize\\\\n    var bhi = b.words[b.length - 1] | 0;\\\\n    var bhiBits = this._countBits(bhi);\\\\n    shift = 26 - bhiBits;\\\\n    if (shift !== 0) {\\\\n      b = b.ushln(shift);\\\\n      a.iushln(shift);\\\\n      bhi = b.words[b.length - 1] | 0;\\\\n    }\\\\n\\\\n    // Initialize quotient\\\\n    var m = a.length - b.length;\\\\n    var q;\\\\n\\\\n    if (mode !== \'mod\') {\\\\n      q = new BN(null);\\\\n      q.length = m + 1;\\\\n      q.words = new Array(q.length);\\\\n      for (var i = 0; i < q.length; i++) {\\\\n        q.words[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\\\\n    if (diff.negative === 0) {\\\\n      a = diff;\\\\n      if (q) {\\\\n        q.words[m] = 1;\\\\n      }\\\\n    }\\\\n\\\\n    for (var j = m - 1; j >= 0; j--) {\\\\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\\\\n        (a.words[b.length + j - 1] | 0);\\\\n\\\\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\\\\n      // (0x7ffffff)\\\\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\\\\n\\\\n      a._ishlnsubmul(b, qj, j);\\\\n      while (a.negative !== 0) {\\\\n        qj--;\\\\n        a.negative = 0;\\\\n        a._ishlnsubmul(b, 1, j);\\\\n        if (!a.isZero()) {\\\\n          a.negative ^= 1;\\\\n        }\\\\n      }\\\\n      if (q) {\\\\n        q.words[j] = qj;\\\\n      }\\\\n    }\\\\n    if (q) {\\\\n      q.strip();\\\\n    }\\\\n    a.strip();\\\\n\\\\n    // Denormalize\\\\n    if (mode !== \'div\' && shift !== 0) {\\\\n      a.iushrn(shift);\\\\n    }\\\\n\\\\n    return {\\\\n      div: q || null,\\\\n      mod: a\\\\n    };\\\\n  };\\\\n\\\\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\\\\n  //       to `div` to request div only, or be absent to\\\\n  //       request both div & mod\\\\n  //       2) `positive` is true if unsigned mod is requested\\\\n  BN.prototype.divmod = function divmod (num, mode, positive) {\\\\n    assert(!num.isZero());\\\\n\\\\n    if (this.isZero()) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: new BN(0)\\\\n      };\\\\n    }\\\\n\\\\n    var div, mod, res;\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      res = this.neg().divmod(num, mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.iadd(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    if (this.negative === 0 && num.negative !== 0) {\\\\n      res = this.divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: res.mod\\\\n      };\\\\n    }\\\\n\\\\n    if ((this.negative & num.negative) !== 0) {\\\\n      res = this.neg().divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.isub(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: res.div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    // Both numbers are positive at this point\\\\n\\\\n    // Strip both numbers to approximate shift value\\\\n    if (num.length > this.length || this.cmp(num) < 0) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: this\\\\n      };\\\\n    }\\\\n\\\\n    // Very short reduction\\\\n    if (num.length === 1) {\\\\n      if (mode === \'div\') {\\\\n        return {\\\\n          div: this.divn(num.words[0]),\\\\n          mod: null\\\\n        };\\\\n      }\\\\n\\\\n      if (mode === \'mod\') {\\\\n        return {\\\\n          div: null,\\\\n          mod: new BN(this.modn(num.words[0]))\\\\n        };\\\\n      }\\\\n\\\\n      return {\\\\n        div: this.divn(num.words[0]),\\\\n        mod: new BN(this.modn(num.words[0]))\\\\n      };\\\\n    }\\\\n\\\\n    return this._wordDiv(num, mode);\\\\n  };\\\\n\\\\n  // Find `this` / `num`\\\\n  BN.prototype.div = function div (num) {\\\\n    return this.divmod(num, \'div\', false).div;\\\\n  };\\\\n\\\\n  // Find `this` % `num`\\\\n  BN.prototype.mod = function mod (num) {\\\\n    return this.divmod(num, \'mod\', false).mod;\\\\n  };\\\\n\\\\n  BN.prototype.umod = function umod (num) {\\\\n    return this.divmod(num, \'mod\', true).mod;\\\\n  };\\\\n\\\\n  // Find Round(`this` / `num`)\\\\n  BN.prototype.divRound = function divRound (num) {\\\\n    var dm = this.divmod(num);\\\\n\\\\n    // Fast case - exact division\\\\n    if (dm.mod.isZero()) return dm.div;\\\\n\\\\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\\\\n\\\\n    var half = num.ushrn(1);\\\\n    var r2 = num.andln(1);\\\\n    var cmp = mod.cmp(half);\\\\n\\\\n    // Round down\\\\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\\\\n\\\\n    // Round up\\\\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\\\\n  };\\\\n\\\\n  BN.prototype.modn = function modn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n    var p = (1 << 26) % num;\\\\n\\\\n    var acc = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      acc = (p * acc + (this.words[i] | 0)) % num;\\\\n    }\\\\n\\\\n    return acc;\\\\n  };\\\\n\\\\n  // In-place division by number\\\\n  BN.prototype.idivn = function idivn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n\\\\n    var carry = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var w = (this.words[i] | 0) + carry * 0x4000000;\\\\n      this.words[i] = (w / num) | 0;\\\\n      carry = w % num;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.divn = function divn (num) {\\\\n    return this.clone().idivn(num);\\\\n  };\\\\n\\\\n  BN.prototype.egcd = function egcd (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var x = this;\\\\n    var y = p.clone();\\\\n\\\\n    if (x.negative !== 0) {\\\\n      x = x.umod(p);\\\\n    } else {\\\\n      x = x.clone();\\\\n    }\\\\n\\\\n    // A * x + B * y = x\\\\n    var A = new BN(1);\\\\n    var B = new BN(0);\\\\n\\\\n    // C * x + D * y = y\\\\n    var C = new BN(0);\\\\n    var D = new BN(1);\\\\n\\\\n    var g = 0;\\\\n\\\\n    while (x.isEven() && y.isEven()) {\\\\n      x.iushrn(1);\\\\n      y.iushrn(1);\\\\n      ++g;\\\\n    }\\\\n\\\\n    var yp = y.clone();\\\\n    var xp = x.clone();\\\\n\\\\n    while (!x.isZero()) {\\\\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        x.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (A.isOdd() || B.isOdd()) {\\\\n            A.iadd(yp);\\\\n            B.isub(xp);\\\\n          }\\\\n\\\\n          A.iushrn(1);\\\\n          B.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        y.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (C.isOdd() || D.isOdd()) {\\\\n            C.iadd(yp);\\\\n            D.isub(xp);\\\\n          }\\\\n\\\\n          C.iushrn(1);\\\\n          D.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (x.cmp(y) >= 0) {\\\\n        x.isub(y);\\\\n        A.isub(C);\\\\n        B.isub(D);\\\\n      } else {\\\\n        y.isub(x);\\\\n        C.isub(A);\\\\n        D.isub(B);\\\\n      }\\\\n    }\\\\n\\\\n    return {\\\\n      a: C,\\\\n      b: D,\\\\n      gcd: y.iushln(g)\\\\n    };\\\\n  };\\\\n\\\\n  // This is reduced incarnation of the binary EEA\\\\n  // above, designated to invert members of the\\\\n  // _prime_ fields F(p) at a maximal speed\\\\n  BN.prototype._invmp = function _invmp (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var a = this;\\\\n    var b = p.clone();\\\\n\\\\n    if (a.negative !== 0) {\\\\n      a = a.umod(p);\\\\n    } else {\\\\n      a = a.clone();\\\\n    }\\\\n\\\\n    var x1 = new BN(1);\\\\n    var x2 = new BN(0);\\\\n\\\\n    var delta = b.clone();\\\\n\\\\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\\\\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        a.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (x1.isOdd()) {\\\\n            x1.iadd(delta);\\\\n          }\\\\n\\\\n          x1.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        b.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (x2.isOdd()) {\\\\n            x2.iadd(delta);\\\\n          }\\\\n\\\\n          x2.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (a.cmp(b) >= 0) {\\\\n        a.isub(b);\\\\n        x1.isub(x2);\\\\n      } else {\\\\n        b.isub(a);\\\\n        x2.isub(x1);\\\\n      }\\\\n    }\\\\n\\\\n    var res;\\\\n    if (a.cmpn(1) === 0) {\\\\n      res = x1;\\\\n    } else {\\\\n      res = x2;\\\\n    }\\\\n\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(p);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gcd = function gcd (num) {\\\\n    if (this.isZero()) return num.abs();\\\\n    if (num.isZero()) return this.abs();\\\\n\\\\n    var a = this.clone();\\\\n    var b = num.clone();\\\\n    a.negative = 0;\\\\n    b.negative = 0;\\\\n\\\\n    // Remove common factor of two\\\\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\\\\n      a.iushrn(1);\\\\n      b.iushrn(1);\\\\n    }\\\\n\\\\n    do {\\\\n      while (a.isEven()) {\\\\n        a.iushrn(1);\\\\n      }\\\\n      while (b.isEven()) {\\\\n        b.iushrn(1);\\\\n      }\\\\n\\\\n      var r = a.cmp(b);\\\\n      if (r < 0) {\\\\n        // Swap `a` and `b` to make `a` always bigger than `b`\\\\n        var t = a;\\\\n        a = b;\\\\n        b = t;\\\\n      } else if (r === 0 || b.cmpn(1) === 0) {\\\\n        break;\\\\n      }\\\\n\\\\n      a.isub(b);\\\\n    } while (true);\\\\n\\\\n    return b.iushln(shift);\\\\n  };\\\\n\\\\n  // Invert number in the field F(num)\\\\n  BN.prototype.invm = function invm (num) {\\\\n    return this.egcd(num).a.umod(num);\\\\n  };\\\\n\\\\n  BN.prototype.isEven = function isEven () {\\\\n    return (this.words[0] & 1) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.isOdd = function isOdd () {\\\\n    return (this.words[0] & 1) === 1;\\\\n  };\\\\n\\\\n  // And first word and num\\\\n  BN.prototype.andln = function andln (num) {\\\\n    return this.words[0] & num;\\\\n  };\\\\n\\\\n  // Increment at the bit position in-line\\\\n  BN.prototype.bincn = function bincn (bit) {\\\\n    assert(typeof bit === \'number\');\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) {\\\\n      this._expand(s + 1);\\\\n      this.words[s] |= q;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add bit and propagate, if needed\\\\n    var carry = q;\\\\n    for (var i = s; carry !== 0 && i < this.length; i++) {\\\\n      var w = this.words[i] | 0;\\\\n      w += carry;\\\\n      carry = w >>> 26;\\\\n      w &= 0x3ffffff;\\\\n      this.words[i] = w;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.isZero = function isZero () {\\\\n    return this.length === 1 && this.words[0] === 0;\\\\n  };\\\\n\\\\n  BN.prototype.cmpn = function cmpn (num) {\\\\n    var negative = num < 0;\\\\n\\\\n    if (this.negative !== 0 && !negative) return -1;\\\\n    if (this.negative === 0 && negative) return 1;\\\\n\\\\n    this.strip();\\\\n\\\\n    var res;\\\\n    if (this.length > 1) {\\\\n      res = 1;\\\\n    } else {\\\\n      if (negative) {\\\\n        num = -num;\\\\n      }\\\\n\\\\n      assert(num <= 0x3ffffff, \'Number is too big\');\\\\n\\\\n      var w = this.words[0] | 0;\\\\n      res = w === num ? 0 : w < num ? -1 : 1;\\\\n    }\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Compare two numbers and return:\\\\n  // 1 - if `this` > `num`\\\\n  // 0 - if `this` == `num`\\\\n  // -1 - if `this` < `num`\\\\n  BN.prototype.cmp = function cmp (num) {\\\\n    if (this.negative !== 0 && num.negative === 0) return -1;\\\\n    if (this.negative === 0 && num.negative !== 0) return 1;\\\\n\\\\n    var res = this.ucmp(num);\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Unsigned comparison\\\\n  BN.prototype.ucmp = function ucmp (num) {\\\\n    // At this point both numbers have the same sign\\\\n    if (this.length > num.length) return 1;\\\\n    if (this.length < num.length) return -1;\\\\n\\\\n    var res = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var a = this.words[i] | 0;\\\\n      var b = num.words[i] | 0;\\\\n\\\\n      if (a === b) continue;\\\\n      if (a < b) {\\\\n        res = -1;\\\\n      } else if (a > b) {\\\\n        res = 1;\\\\n      }\\\\n      break;\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gtn = function gtn (num) {\\\\n    return this.cmpn(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gt = function gt (num) {\\\\n    return this.cmp(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gten = function gten (num) {\\\\n    return this.cmpn(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.gte = function gte (num) {\\\\n    return this.cmp(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.ltn = function ltn (num) {\\\\n    return this.cmpn(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lt = function lt (num) {\\\\n    return this.cmp(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lten = function lten (num) {\\\\n    return this.cmpn(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.lte = function lte (num) {\\\\n    return this.cmp(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.eqn = function eqn (num) {\\\\n    return this.cmpn(num) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.eq = function eq (num) {\\\\n    return this.cmp(num) === 0;\\\\n  };\\\\n\\\\n  //\\\\n  // A reduce context, could be using montgomery or something better, depending\\\\n  // on the `m` itself.\\\\n  //\\\\n  BN.red = function red (num) {\\\\n    return new Red(num);\\\\n  };\\\\n\\\\n  BN.prototype.toRed = function toRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    assert(this.negative === 0, \'red works only with positives\');\\\\n    return ctx.convertTo(this)._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.fromRed = function fromRed () {\\\\n    assert(this.red, \'fromRed works only with numbers in reduction context\');\\\\n    return this.red.convertFrom(this);\\\\n  };\\\\n\\\\n  BN.prototype._forceRed = function _forceRed (ctx) {\\\\n    this.red = ctx;\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.forceRed = function forceRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    return this._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.redAdd = function redAdd (num) {\\\\n    assert(this.red, \'redAdd works only with red numbers\');\\\\n    return this.red.add(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIAdd = function redIAdd (num) {\\\\n    assert(this.red, \'redIAdd works only with red numbers\');\\\\n    return this.red.iadd(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSub = function redSub (num) {\\\\n    assert(this.red, \'redSub works only with red numbers\');\\\\n    return this.red.sub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redISub = function redISub (num) {\\\\n    assert(this.red, \'redISub works only with red numbers\');\\\\n    return this.red.isub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redShl = function redShl (num) {\\\\n    assert(this.red, \'redShl works only with red numbers\');\\\\n    return this.red.shl(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redMul = function redMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.mul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIMul = function redIMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.imul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSqr = function redSqr () {\\\\n    assert(this.red, \'redSqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqr(this);\\\\n  };\\\\n\\\\n  BN.prototype.redISqr = function redISqr () {\\\\n    assert(this.red, \'redISqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.isqr(this);\\\\n  };\\\\n\\\\n  // Square root over p\\\\n  BN.prototype.redSqrt = function redSqrt () {\\\\n    assert(this.red, \'redSqrt works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqrt(this);\\\\n  };\\\\n\\\\n  BN.prototype.redInvm = function redInvm () {\\\\n    assert(this.red, \'redInvm works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.invm(this);\\\\n  };\\\\n\\\\n  // Return negative clone of `this` % `red modulo`\\\\n  BN.prototype.redNeg = function redNeg () {\\\\n    assert(this.red, \'redNeg works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.neg(this);\\\\n  };\\\\n\\\\n  BN.prototype.redPow = function redPow (num) {\\\\n    assert(this.red && !num.red, \'redPow(normalNum)\');\\\\n    this.red._verify1(this);\\\\n    return this.red.pow(this, num);\\\\n  };\\\\n\\\\n  // Prime numbers with efficient reduction\\\\n  var primes = {\\\\n    k256: null,\\\\n    p224: null,\\\\n    p192: null,\\\\n    p25519: null\\\\n  };\\\\n\\\\n  // Pseudo-Mersenne prime\\\\n  function MPrime (name, p) {\\\\n    // P = 2 ^ N - K\\\\n    this.name = name;\\\\n    this.p = new BN(p, 16);\\\\n    this.n = this.p.bitLength();\\\\n    this.k = new BN(1).iushln(this.n).isub(this.p);\\\\n\\\\n    this.tmp = this._tmp();\\\\n  }\\\\n\\\\n  MPrime.prototype._tmp = function _tmp () {\\\\n    var tmp = new BN(null);\\\\n    tmp.words = new Array(Math.ceil(this.n / 13));\\\\n    return tmp;\\\\n  };\\\\n\\\\n  MPrime.prototype.ireduce = function ireduce (num) {\\\\n    // Assumes that `num` is less than `P^2`\\\\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\\\\n    var r = num;\\\\n    var rlen;\\\\n\\\\n    do {\\\\n      this.split(r, this.tmp);\\\\n      r = this.imulK(r);\\\\n      r = r.iadd(this.tmp);\\\\n      rlen = r.bitLength();\\\\n    } while (rlen > this.n);\\\\n\\\\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\\\\n    if (cmp === 0) {\\\\n      r.words[0] = 0;\\\\n      r.length = 1;\\\\n    } else if (cmp > 0) {\\\\n      r.isub(this.p);\\\\n    } else {\\\\n      r.strip();\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  MPrime.prototype.split = function split (input, out) {\\\\n    input.iushrn(this.n, 0, out);\\\\n  };\\\\n\\\\n  MPrime.prototype.imulK = function imulK (num) {\\\\n    return num.imul(this.k);\\\\n  };\\\\n\\\\n  function K256 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'k256\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\');\\\\n  }\\\\n  inherits(K256, MPrime);\\\\n\\\\n  K256.prototype.split = function split (input, output) {\\\\n    // 256 = 9 * 26 + 22\\\\n    var mask = 0x3fffff;\\\\n\\\\n    var outLen = Math.min(input.length, 9);\\\\n    for (var i = 0; i < outLen; i++) {\\\\n      output.words[i] = input.words[i];\\\\n    }\\\\n    output.length = outLen;\\\\n\\\\n    if (input.length <= 9) {\\\\n      input.words[0] = 0;\\\\n      input.length = 1;\\\\n      return;\\\\n    }\\\\n\\\\n    // Shift by 9 limbs\\\\n    var prev = input.words[9];\\\\n    output.words[output.length++] = prev & mask;\\\\n\\\\n    for (i = 10; i < input.length; i++) {\\\\n      var next = input.words[i] | 0;\\\\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\\\\n      prev = next;\\\\n    }\\\\n    prev >>>= 22;\\\\n    input.words[i - 10] = prev;\\\\n    if (prev === 0 && input.length > 10) {\\\\n      input.length -= 10;\\\\n    } else {\\\\n      input.length -= 9;\\\\n    }\\\\n  };\\\\n\\\\n  K256.prototype.imulK = function imulK (num) {\\\\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\\\\n    num.words[num.length] = 0;\\\\n    num.words[num.length + 1] = 0;\\\\n    num.length += 2;\\\\n\\\\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\\\\n    var lo = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var w = num.words[i] | 0;\\\\n      lo += w * 0x3d1;\\\\n      num.words[i] = lo & 0x3ffffff;\\\\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\\\\n    }\\\\n\\\\n    // Fast length reduction\\\\n    if (num.words[num.length - 1] === 0) {\\\\n      num.length--;\\\\n      if (num.words[num.length - 1] === 0) {\\\\n        num.length--;\\\\n      }\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  function P224 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p224\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\');\\\\n  }\\\\n  inherits(P224, MPrime);\\\\n\\\\n  function P192 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p192\',\\\\n      \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\');\\\\n  }\\\\n  inherits(P192, MPrime);\\\\n\\\\n  function P25519 () {\\\\n    // 2 ^ 255 - 19\\\\n    MPrime.call(\\\\n      this,\\\\n      \'25519\',\\\\n      \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\');\\\\n  }\\\\n  inherits(P25519, MPrime);\\\\n\\\\n  P25519.prototype.imulK = function imulK (num) {\\\\n    // K = 0x13\\\\n    var carry = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var hi = (num.words[i] | 0) * 0x13 + carry;\\\\n      var lo = hi & 0x3ffffff;\\\\n      hi >>>= 26;\\\\n\\\\n      num.words[i] = lo;\\\\n      carry = hi;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      num.words[num.length++] = carry;\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  // Exported mostly for testing purposes, use plain name instead\\\\n  BN._prime = function prime (name) {\\\\n    // Cached version of prime\\\\n    if (primes[name]) return primes[name];\\\\n\\\\n    var prime;\\\\n    if (name === \'k256\') {\\\\n      prime = new K256();\\\\n    } else if (name === \'p224\') {\\\\n      prime = new P224();\\\\n    } else if (name === \'p192\') {\\\\n      prime = new P192();\\\\n    } else if (name === \'p25519\') {\\\\n      prime = new P25519();\\\\n    } else {\\\\n      throw new Error(\'Unknown prime \' + name);\\\\n    }\\\\n    primes[name] = prime;\\\\n\\\\n    return prime;\\\\n  };\\\\n\\\\n  //\\\\n  // Base reduction engine\\\\n  //\\\\n  function Red (m) {\\\\n    if (typeof m === \'string\') {\\\\n      var prime = BN._prime(m);\\\\n      this.m = prime.p;\\\\n      this.prime = prime;\\\\n    } else {\\\\n      assert(m.gtn(1), \'modulus must be greater than 1\');\\\\n      this.m = m;\\\\n      this.prime = null;\\\\n    }\\\\n  }\\\\n\\\\n  Red.prototype._verify1 = function _verify1 (a) {\\\\n    assert(a.negative === 0, \'red works only with positives\');\\\\n    assert(a.red, \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype._verify2 = function _verify2 (a, b) {\\\\n    assert((a.negative | b.negative) === 0, \'red works only with positives\');\\\\n    assert(a.red && a.red === b.red,\\\\n      \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype.imod = function imod (a) {\\\\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\\\\n    return a.umod(this.m)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.neg = function neg (a) {\\\\n    if (a.isZero()) {\\\\n      return a.clone();\\\\n    }\\\\n\\\\n    return this.m.sub(a)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.add = function add (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.add(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.iadd = function iadd (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.iadd(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.sub = function sub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.sub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.isub = function isub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.isub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.shl = function shl (a, num) {\\\\n    this._verify1(a);\\\\n    return this.imod(a.ushln(num));\\\\n  };\\\\n\\\\n  Red.prototype.imul = function imul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.imul(b));\\\\n  };\\\\n\\\\n  Red.prototype.mul = function mul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.mul(b));\\\\n  };\\\\n\\\\n  Red.prototype.isqr = function isqr (a) {\\\\n    return this.imul(a, a.clone());\\\\n  };\\\\n\\\\n  Red.prototype.sqr = function sqr (a) {\\\\n    return this.mul(a, a);\\\\n  };\\\\n\\\\n  Red.prototype.sqrt = function sqrt (a) {\\\\n    if (a.isZero()) return a.clone();\\\\n\\\\n    var mod3 = this.m.andln(3);\\\\n    assert(mod3 % 2 === 1);\\\\n\\\\n    // Fast case\\\\n    if (mod3 === 3) {\\\\n      var pow = this.m.add(new BN(1)).iushrn(2);\\\\n      return this.pow(a, pow);\\\\n    }\\\\n\\\\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\\\\n    //\\\\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\\\\n    var q = this.m.subn(1);\\\\n    var s = 0;\\\\n    while (!q.isZero() && q.andln(1) === 0) {\\\\n      s++;\\\\n      q.iushrn(1);\\\\n    }\\\\n    assert(!q.isZero());\\\\n\\\\n    var one = new BN(1).toRed(this);\\\\n    var nOne = one.redNeg();\\\\n\\\\n    // Find quadratic non-residue\\\\n    // NOTE: Max is such because of generalized Riemann hypothesis.\\\\n    var lpow = this.m.subn(1).iushrn(1);\\\\n    var z = this.m.bitLength();\\\\n    z = new BN(2 * z * z).toRed(this);\\\\n\\\\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\\\\n      z.redIAdd(nOne);\\\\n    }\\\\n\\\\n    var c = this.pow(z, q);\\\\n    var r = this.pow(a, q.addn(1).iushrn(1));\\\\n    var t = this.pow(a, q);\\\\n    var m = s;\\\\n    while (t.cmp(one) !== 0) {\\\\n      var tmp = t;\\\\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\\\\n        tmp = tmp.redSqr();\\\\n      }\\\\n      assert(i < m);\\\\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\\\\n\\\\n      r = r.redMul(b);\\\\n      c = b.redSqr();\\\\n      t = t.redMul(c);\\\\n      m = i;\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  Red.prototype.invm = function invm (a) {\\\\n    var inv = a._invmp(this.m);\\\\n    if (inv.negative !== 0) {\\\\n      inv.negative = 0;\\\\n      return this.imod(inv).redNeg();\\\\n    } else {\\\\n      return this.imod(inv);\\\\n    }\\\\n  };\\\\n\\\\n  Red.prototype.pow = function pow (a, num) {\\\\n    if (num.isZero()) return new BN(1);\\\\n    if (num.cmpn(1) === 0) return a.clone();\\\\n\\\\n    var windowSize = 4;\\\\n    var wnd = new Array(1 << windowSize);\\\\n    wnd[0] = new BN(1).toRed(this);\\\\n    wnd[1] = a;\\\\n    for (var i = 2; i < wnd.length; i++) {\\\\n      wnd[i] = this.mul(wnd[i - 1], a);\\\\n    }\\\\n\\\\n    var res = wnd[0];\\\\n    var current = 0;\\\\n    var currentLen = 0;\\\\n    var start = num.bitLength() % 26;\\\\n    if (start === 0) {\\\\n      start = 26;\\\\n    }\\\\n\\\\n    for (i = num.length - 1; i >= 0; i--) {\\\\n      var word = num.words[i];\\\\n      for (var j = start - 1; j >= 0; j--) {\\\\n        var bit = (word >> j) & 1;\\\\n        if (res !== wnd[0]) {\\\\n          res = this.sqr(res);\\\\n        }\\\\n\\\\n        if (bit === 0 && current === 0) {\\\\n          currentLen = 0;\\\\n          continue;\\\\n        }\\\\n\\\\n        current <<= 1;\\\\n        current |= bit;\\\\n        currentLen++;\\\\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\\\\n\\\\n        res = this.mul(res, wnd[current]);\\\\n        currentLen = 0;\\\\n        current = 0;\\\\n      }\\\\n      start = 26;\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.convertTo = function convertTo (num) {\\\\n    var r = num.umod(this.m);\\\\n\\\\n    return r === num ? r.clone() : r;\\\\n  };\\\\n\\\\n  Red.prototype.convertFrom = function convertFrom (num) {\\\\n    var res = num.clone();\\\\n    res.red = null;\\\\n    return res;\\\\n  };\\\\n\\\\n  //\\\\n  // Montgomery method engine\\\\n  //\\\\n\\\\n  BN.mont = function mont (num) {\\\\n    return new Mont(num);\\\\n  };\\\\n\\\\n  function Mont (m) {\\\\n    Red.call(this, m);\\\\n\\\\n    this.shift = this.m.bitLength();\\\\n    if (this.shift % 26 !== 0) {\\\\n      this.shift += 26 - (this.shift % 26);\\\\n    }\\\\n\\\\n    this.r = new BN(1).iushln(this.shift);\\\\n    this.r2 = this.imod(this.r.sqr());\\\\n    this.rinv = this.r._invmp(this.m);\\\\n\\\\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\\\\n    this.minv = this.minv.umod(this.r);\\\\n    this.minv = this.r.sub(this.minv);\\\\n  }\\\\n  inherits(Mont, Red);\\\\n\\\\n  Mont.prototype.convertTo = function convertTo (num) {\\\\n    return this.imod(num.ushln(this.shift));\\\\n  };\\\\n\\\\n  Mont.prototype.convertFrom = function convertFrom (num) {\\\\n    var r = this.imod(num.mul(this.rinv));\\\\n    r.red = null;\\\\n    return r;\\\\n  };\\\\n\\\\n  Mont.prototype.imul = function imul (a, b) {\\\\n    if (a.isZero() || b.isZero()) {\\\\n      a.words[0] = 0;\\\\n      a.length = 1;\\\\n      return a;\\\\n    }\\\\n\\\\n    var t = a.imul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.mul = function mul (a, b) {\\\\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\\\\n\\\\n    var t = a.mul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.invm = function invm (a) {\\\\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\\\\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\\\\n    return res._forceRed(this);\\\\n  };\\\\n})(typeof module === \'undefined\' || module, this);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/ethjs-unit/~/bn.js/lib/bn.js\\\\n// module id = 266\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js\\")},function(module,exports,__webpack_require__){eval(\\"var isFunction = __webpack_require__(133)\\\\n\\\\nmodule.exports = forEach\\\\n\\\\nvar toString = Object.prototype.toString\\\\nvar hasOwnProperty = Object.prototype.hasOwnProperty\\\\n\\\\nfunction forEach(list, iterator, context) {\\\\n    if (!isFunction(iterator)) {\\\\n        throw new TypeError(\'iterator must be a function\')\\\\n    }\\\\n\\\\n    if (arguments.length < 3) {\\\\n        context = this\\\\n    }\\\\n    \\\\n    if (toString.call(list) === \'[object Array]\')\\\\n        forEachArray(list, iterator, context)\\\\n    else if (typeof list === \'string\')\\\\n        forEachString(list, iterator, context)\\\\n    else\\\\n        forEachObject(list, iterator, context)\\\\n}\\\\n\\\\nfunction forEachArray(array, iterator, context) {\\\\n    for (var i = 0, len = array.length; i < len; i++) {\\\\n        if (hasOwnProperty.call(array, i)) {\\\\n            iterator.call(context, array[i], i, array)\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction forEachString(string, iterator, context) {\\\\n    for (var i = 0, len = string.length; i < len; i++) {\\\\n        // no such thing as a sparse string.\\\\n        iterator.call(context, string.charAt(i), i, string)\\\\n    }\\\\n}\\\\n\\\\nfunction forEachObject(object, iterator, context) {\\\\n    for (var k in object) {\\\\n        if (hasOwnProperty.call(object, k)) {\\\\n            iterator.call(context, object[k], k, object)\\\\n        }\\\\n    }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/for-each/index.js\\\\n// module id = 267\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/for-each/index.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(global) {var win;\\\\n\\\\nif (typeof window !== \\"undefined\\") {\\\\n    win = window;\\\\n} else if (typeof global !== \\"undefined\\") {\\\\n    win = global;\\\\n} else if (typeof self !== \\"undefined\\"){\\\\n    win = self;\\\\n} else {\\\\n    win = {};\\\\n}\\\\n\\\\nmodule.exports = win;\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/global/window.js\\\\n// module id = 268\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/global/window.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {\\\\nvar Transform = __webpack_require__(56).Transform\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction HashBase (blockSize) {\\\\n  Transform.call(this)\\\\n\\\\n  this._block = new Buffer(blockSize)\\\\n  this._blockSize = blockSize\\\\n  this._blockOffset = 0\\\\n  this._length = [0, 0, 0, 0]\\\\n\\\\n  this._finalized = false\\\\n}\\\\n\\\\ninherits(HashBase, Transform)\\\\n\\\\nHashBase.prototype._transform = function (chunk, encoding, callback) {\\\\n  var error = null\\\\n  try {\\\\n    if (encoding !== \'buffer\') chunk = new Buffer(chunk, encoding)\\\\n    this.update(chunk)\\\\n  } catch (err) {\\\\n    error = err\\\\n  }\\\\n\\\\n  callback(error)\\\\n}\\\\n\\\\nHashBase.prototype._flush = function (callback) {\\\\n  var error = null\\\\n  try {\\\\n    this.push(this._digest())\\\\n  } catch (err) {\\\\n    error = err\\\\n  }\\\\n\\\\n  callback(error)\\\\n}\\\\n\\\\nHashBase.prototype.update = function (data, encoding) {\\\\n  if (!Buffer.isBuffer(data) && typeof data !== \'string\') throw new TypeError(\'Data must be a string or a buffer\')\\\\n  if (this._finalized) throw new Error(\'Digest already called\')\\\\n  if (!Buffer.isBuffer(data)) data = new Buffer(data, encoding || \'binary\')\\\\n\\\\n  // consume data\\\\n  var block = this._block\\\\n  var offset = 0\\\\n  while (this._blockOffset + data.length - offset >= this._blockSize) {\\\\n    for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\\\\n    this._update()\\\\n    this._blockOffset = 0\\\\n  }\\\\n  while (offset < data.length) block[this._blockOffset++] = data[offset++]\\\\n\\\\n  // update length\\\\n  for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\\\\n    this._length[j] += carry\\\\n    carry = (this._length[j] / 0x0100000000) | 0\\\\n    if (carry > 0) this._length[j] -= 0x0100000000 * carry\\\\n  }\\\\n\\\\n  return this\\\\n}\\\\n\\\\nHashBase.prototype._update = function (data) {\\\\n  throw new Error(\'_update is not implemented\')\\\\n}\\\\n\\\\nHashBase.prototype.digest = function (encoding) {\\\\n  if (this._finalized) throw new Error(\'Digest already called\')\\\\n  this._finalized = true\\\\n\\\\n  var digest = this._digest()\\\\n  if (encoding !== undefined) digest = digest.toString(encoding)\\\\n  return digest\\\\n}\\\\n\\\\nHashBase.prototype._digest = function () {\\\\n  throw new Error(\'_digest is not implemented\')\\\\n}\\\\n\\\\nmodule.exports = HashBase\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash-base/index.js\\\\n// module id = 269\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash-base/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nfunction Hmac(hash, key, enc) {\\\\n  if (!(this instanceof Hmac))\\\\n    return new Hmac(hash, key, enc);\\\\n  this.Hash = hash;\\\\n  this.blockSize = hash.blockSize / 8;\\\\n  this.outSize = hash.outSize / 8;\\\\n  this.inner = null;\\\\n  this.outer = null;\\\\n\\\\n  this._init(utils.toArray(key, enc));\\\\n}\\\\nmodule.exports = Hmac;\\\\n\\\\nHmac.prototype._init = function init(key) {\\\\n  // Shorten key, if needed\\\\n  if (key.length > this.blockSize)\\\\n    key = new this.Hash().update(key).digest();\\\\n  assert(key.length <= this.blockSize);\\\\n\\\\n  // Add padding to key\\\\n  for (var i = key.length; i < this.blockSize; i++)\\\\n    key.push(0);\\\\n\\\\n  for (i = 0; i < key.length; i++)\\\\n    key[i] ^= 0x36;\\\\n  this.inner = new this.Hash().update(key);\\\\n\\\\n  // 0x36 ^ 0x5c = 0x6a\\\\n  for (i = 0; i < key.length; i++)\\\\n    key[i] ^= 0x6a;\\\\n  this.outer = new this.Hash().update(key);\\\\n};\\\\n\\\\nHmac.prototype.update = function update(msg, enc) {\\\\n  this.inner.update(msg, enc);\\\\n  return this;\\\\n};\\\\n\\\\nHmac.prototype.digest = function digest(enc) {\\\\n  this.outer.update(this.inner.digest());\\\\n  return this.outer.digest(enc);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/hmac.js\\\\n// module id = 270\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/hmac.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar common = __webpack_require__(41);\\\\n\\\\nvar rotl32 = utils.rotl32;\\\\nvar sum32 = utils.sum32;\\\\nvar sum32_3 = utils.sum32_3;\\\\nvar sum32_4 = utils.sum32_4;\\\\nvar BlockHash = common.BlockHash;\\\\n\\\\nfunction RIPEMD160() {\\\\n  if (!(this instanceof RIPEMD160))\\\\n    return new RIPEMD160();\\\\n\\\\n  BlockHash.call(this);\\\\n\\\\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\\\\n  this.endian = \'little\';\\\\n}\\\\nutils.inherits(RIPEMD160, BlockHash);\\\\nexports.ripemd160 = RIPEMD160;\\\\n\\\\nRIPEMD160.blockSize = 512;\\\\nRIPEMD160.outSize = 160;\\\\nRIPEMD160.hmacStrength = 192;\\\\nRIPEMD160.padLength = 64;\\\\n\\\\nRIPEMD160.prototype._update = function update(msg, start) {\\\\n  var A = this.h[0];\\\\n  var B = this.h[1];\\\\n  var C = this.h[2];\\\\n  var D = this.h[3];\\\\n  var E = this.h[4];\\\\n  var Ah = A;\\\\n  var Bh = B;\\\\n  var Ch = C;\\\\n  var Dh = D;\\\\n  var Eh = E;\\\\n  for (var j = 0; j < 80; j++) {\\\\n    var T = sum32(\\\\n      rotl32(\\\\n        sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\\\\n        s[j]),\\\\n      E);\\\\n    A = E;\\\\n    E = D;\\\\n    D = rotl32(C, 10);\\\\n    C = B;\\\\n    B = T;\\\\n    T = sum32(\\\\n      rotl32(\\\\n        sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\\\\n        sh[j]),\\\\n      Eh);\\\\n    Ah = Eh;\\\\n    Eh = Dh;\\\\n    Dh = rotl32(Ch, 10);\\\\n    Ch = Bh;\\\\n    Bh = T;\\\\n  }\\\\n  T = sum32_3(this.h[1], C, Dh);\\\\n  this.h[1] = sum32_3(this.h[2], D, Eh);\\\\n  this.h[2] = sum32_3(this.h[3], E, Ah);\\\\n  this.h[3] = sum32_3(this.h[4], A, Bh);\\\\n  this.h[4] = sum32_3(this.h[0], B, Ch);\\\\n  this.h[0] = T;\\\\n};\\\\n\\\\nRIPEMD160.prototype._digest = function digest(enc) {\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h, \'little\');\\\\n  else\\\\n    return utils.split32(this.h, \'little\');\\\\n};\\\\n\\\\nfunction f(j, x, y, z) {\\\\n  if (j <= 15)\\\\n    return x ^ y ^ z;\\\\n  else if (j <= 31)\\\\n    return (x & y) | ((~x) & z);\\\\n  else if (j <= 47)\\\\n    return (x | (~y)) ^ z;\\\\n  else if (j <= 63)\\\\n    return (x & z) | (y & (~z));\\\\n  else\\\\n    return x ^ (y | (~z));\\\\n}\\\\n\\\\nfunction K(j) {\\\\n  if (j <= 15)\\\\n    return 0x00000000;\\\\n  else if (j <= 31)\\\\n    return 0x5a827999;\\\\n  else if (j <= 47)\\\\n    return 0x6ed9eba1;\\\\n  else if (j <= 63)\\\\n    return 0x8f1bbcdc;\\\\n  else\\\\n    return 0xa953fd4e;\\\\n}\\\\n\\\\nfunction Kh(j) {\\\\n  if (j <= 15)\\\\n    return 0x50a28be6;\\\\n  else if (j <= 31)\\\\n    return 0x5c4dd124;\\\\n  else if (j <= 47)\\\\n    return 0x6d703ef3;\\\\n  else if (j <= 63)\\\\n    return 0x7a6d76e9;\\\\n  else\\\\n    return 0x00000000;\\\\n}\\\\n\\\\nvar r = [\\\\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\\\\n  7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\\\\n  3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\\\\n  1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\\\\n  4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\\\\n];\\\\n\\\\nvar rh = [\\\\n  5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\\\\n  6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\\\\n  15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\\\\n  8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\\\\n  12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\\\\n];\\\\n\\\\nvar s = [\\\\n  11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\\\\n  7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\\\\n  11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\\\\n  11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\\\\n  9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\\\\n];\\\\n\\\\nvar sh = [\\\\n  8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\\\\n  9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\\\\n  9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\\\\n  15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\\\\n  8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\\\\n];\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/ripemd.js\\\\n// module id = 271\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/ripemd.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nexports.sha1 = __webpack_require__(273);\\\\nexports.sha224 = __webpack_require__(274);\\\\nexports.sha256 = __webpack_require__(130);\\\\nexports.sha384 = __webpack_require__(275);\\\\nexports.sha512 = __webpack_require__(131);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha.js\\\\n// module id = 272\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar common = __webpack_require__(41);\\\\nvar shaCommon = __webpack_require__(132);\\\\n\\\\nvar rotl32 = utils.rotl32;\\\\nvar sum32 = utils.sum32;\\\\nvar sum32_5 = utils.sum32_5;\\\\nvar ft_1 = shaCommon.ft_1;\\\\nvar BlockHash = common.BlockHash;\\\\n\\\\nvar sha1_K = [\\\\n  0x5A827999, 0x6ED9EBA1,\\\\n  0x8F1BBCDC, 0xCA62C1D6\\\\n];\\\\n\\\\nfunction SHA1() {\\\\n  if (!(this instanceof SHA1))\\\\n    return new SHA1();\\\\n\\\\n  BlockHash.call(this);\\\\n  this.h = [\\\\n    0x67452301, 0xefcdab89, 0x98badcfe,\\\\n    0x10325476, 0xc3d2e1f0 ];\\\\n  this.W = new Array(80);\\\\n}\\\\n\\\\nutils.inherits(SHA1, BlockHash);\\\\nmodule.exports = SHA1;\\\\n\\\\nSHA1.blockSize = 512;\\\\nSHA1.outSize = 160;\\\\nSHA1.hmacStrength = 80;\\\\nSHA1.padLength = 64;\\\\n\\\\nSHA1.prototype._update = function _update(msg, start) {\\\\n  var W = this.W;\\\\n\\\\n  for (var i = 0; i < 16; i++)\\\\n    W[i] = msg[start + i];\\\\n\\\\n  for(; i < W.length; i++)\\\\n    W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\\\\n\\\\n  var a = this.h[0];\\\\n  var b = this.h[1];\\\\n  var c = this.h[2];\\\\n  var d = this.h[3];\\\\n  var e = this.h[4];\\\\n\\\\n  for (i = 0; i < W.length; i++) {\\\\n    var s = ~~(i / 20);\\\\n    var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\\\\n    e = d;\\\\n    d = c;\\\\n    c = rotl32(b, 30);\\\\n    b = a;\\\\n    a = t;\\\\n  }\\\\n\\\\n  this.h[0] = sum32(this.h[0], a);\\\\n  this.h[1] = sum32(this.h[1], b);\\\\n  this.h[2] = sum32(this.h[2], c);\\\\n  this.h[3] = sum32(this.h[3], d);\\\\n  this.h[4] = sum32(this.h[4], e);\\\\n};\\\\n\\\\nSHA1.prototype._digest = function digest(enc) {\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h, \'big\');\\\\n  else\\\\n    return utils.split32(this.h, \'big\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/1.js\\\\n// module id = 273\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/1.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\nvar SHA256 = __webpack_require__(130);\\\\n\\\\nfunction SHA224() {\\\\n  if (!(this instanceof SHA224))\\\\n    return new SHA224();\\\\n\\\\n  SHA256.call(this);\\\\n  this.h = [\\\\n    0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\\\\n    0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\\\\n}\\\\nutils.inherits(SHA224, SHA256);\\\\nmodule.exports = SHA224;\\\\n\\\\nSHA224.blockSize = 512;\\\\nSHA224.outSize = 224;\\\\nSHA224.hmacStrength = 192;\\\\nSHA224.padLength = 64;\\\\n\\\\nSHA224.prototype._digest = function digest(enc) {\\\\n  // Just truncate output\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h.slice(0, 7), \'big\');\\\\n  else\\\\n    return utils.split32(this.h.slice(0, 7), \'big\');\\\\n};\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/224.js\\\\n// module id = 274\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/224.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar utils = __webpack_require__(14);\\\\n\\\\nvar SHA512 = __webpack_require__(131);\\\\n\\\\nfunction SHA384() {\\\\n  if (!(this instanceof SHA384))\\\\n    return new SHA384();\\\\n\\\\n  SHA512.call(this);\\\\n  this.h = [\\\\n    0xcbbb9d5d, 0xc1059ed8,\\\\n    0x629a292a, 0x367cd507,\\\\n    0x9159015a, 0x3070dd17,\\\\n    0x152fecd8, 0xf70e5939,\\\\n    0x67332667, 0xffc00b31,\\\\n    0x8eb44a87, 0x68581511,\\\\n    0xdb0c2e0d, 0x64f98fa7,\\\\n    0x47b5481d, 0xbefa4fa4 ];\\\\n}\\\\nutils.inherits(SHA384, SHA512);\\\\nmodule.exports = SHA384;\\\\n\\\\nSHA384.blockSize = 1024;\\\\nSHA384.outSize = 384;\\\\nSHA384.hmacStrength = 192;\\\\nSHA384.padLength = 128;\\\\n\\\\nSHA384.prototype._digest = function digest(enc) {\\\\n  if (enc === \'hex\')\\\\n    return utils.toHex32(this.h.slice(0, 12), \'big\');\\\\n  else\\\\n    return utils.split32(this.h.slice(0, 12), \'big\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hash.js/lib/hash/sha/384.js\\\\n// module id = 275\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hash.js/lib/hash/sha/384.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nvar hash = __webpack_require__(85);\\\\nvar utils = __webpack_require__(136);\\\\nvar assert = __webpack_require__(12);\\\\n\\\\nfunction HmacDRBG(options) {\\\\n  if (!(this instanceof HmacDRBG))\\\\n    return new HmacDRBG(options);\\\\n  this.hash = options.hash;\\\\n  this.predResist = !!options.predResist;\\\\n\\\\n  this.outLen = this.hash.outSize;\\\\n  this.minEntropy = options.minEntropy || this.hash.hmacStrength;\\\\n\\\\n  this._reseed = null;\\\\n  this.reseedInterval = null;\\\\n  this.K = null;\\\\n  this.V = null;\\\\n\\\\n  var entropy = utils.toArray(options.entropy, options.entropyEnc || \'hex\');\\\\n  var nonce = utils.toArray(options.nonce, options.nonceEnc || \'hex\');\\\\n  var pers = utils.toArray(options.pers, options.persEnc || \'hex\');\\\\n  assert(entropy.length >= (this.minEntropy / 8),\\\\n         \'Not enough entropy. Minimum is: \' + this.minEntropy + \' bits\');\\\\n  this._init(entropy, nonce, pers);\\\\n}\\\\nmodule.exports = HmacDRBG;\\\\n\\\\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\\\\n  var seed = entropy.concat(nonce).concat(pers);\\\\n\\\\n  this.K = new Array(this.outLen / 8);\\\\n  this.V = new Array(this.outLen / 8);\\\\n  for (var i = 0; i < this.V.length; i++) {\\\\n    this.K[i] = 0x00;\\\\n    this.V[i] = 0x01;\\\\n  }\\\\n\\\\n  this._update(seed);\\\\n  this._reseed = 1;\\\\n  this.reseedInterval = 0x1000000000000;  // 2^48\\\\n};\\\\n\\\\nHmacDRBG.prototype._hmac = function hmac() {\\\\n  return new hash.hmac(this.hash, this.K);\\\\n};\\\\n\\\\nHmacDRBG.prototype._update = function update(seed) {\\\\n  var kmac = this._hmac()\\\\n                 .update(this.V)\\\\n                 .update([ 0x00 ]);\\\\n  if (seed)\\\\n    kmac = kmac.update(seed);\\\\n  this.K = kmac.digest();\\\\n  this.V = this._hmac().update(this.V).digest();\\\\n  if (!seed)\\\\n    return;\\\\n\\\\n  this.K = this._hmac()\\\\n               .update(this.V)\\\\n               .update([ 0x01 ])\\\\n               .update(seed)\\\\n               .digest();\\\\n  this.V = this._hmac().update(this.V).digest();\\\\n};\\\\n\\\\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\\\\n  // Optional entropy enc\\\\n  if (typeof entropyEnc !== \'string\') {\\\\n    addEnc = add;\\\\n    add = entropyEnc;\\\\n    entropyEnc = null;\\\\n  }\\\\n\\\\n  entropy = utils.toArray(entropy, entropyEnc);\\\\n  add = utils.toArray(add, addEnc);\\\\n\\\\n  assert(entropy.length >= (this.minEntropy / 8),\\\\n         \'Not enough entropy. Minimum is: \' + this.minEntropy + \' bits\');\\\\n\\\\n  this._update(entropy.concat(add || []));\\\\n  this._reseed = 1;\\\\n};\\\\n\\\\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\\\\n  if (this._reseed > this.reseedInterval)\\\\n    throw new Error(\'Reseed is required\');\\\\n\\\\n  // Optional encoding\\\\n  if (typeof enc !== \'string\') {\\\\n    addEnc = add;\\\\n    add = enc;\\\\n    enc = null;\\\\n  }\\\\n\\\\n  // Optional additional data\\\\n  if (add) {\\\\n    add = utils.toArray(add, addEnc || \'hex\');\\\\n    this._update(add);\\\\n  }\\\\n\\\\n  var temp = [];\\\\n  while (temp.length < len) {\\\\n    this.V = this._hmac().update(this.V).digest();\\\\n    temp = temp.concat(this.V);\\\\n  }\\\\n\\\\n  var res = temp.slice(0, len);\\\\n  this._update(add);\\\\n  this._reseed++;\\\\n  return utils.encode(res, enc);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/hmac-drbg/lib/hmac-drbg.js\\\\n// module id = 276\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/hmac-drbg/lib/hmac-drbg.js\\")},function(module,exports){eval(\\"exports.read = function (buffer, offset, isLE, mLen, nBytes) {\\\\n  var e, m\\\\n  var eLen = (nBytes * 8) - mLen - 1\\\\n  var eMax = (1 << eLen) - 1\\\\n  var eBias = eMax >> 1\\\\n  var nBits = -7\\\\n  var i = isLE ? (nBytes - 1) : 0\\\\n  var d = isLE ? -1 : 1\\\\n  var s = buffer[offset + i]\\\\n\\\\n  i += d\\\\n\\\\n  e = s & ((1 << (-nBits)) - 1)\\\\n  s >>= (-nBits)\\\\n  nBits += eLen\\\\n  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\\\\n\\\\n  m = e & ((1 << (-nBits)) - 1)\\\\n  e >>= (-nBits)\\\\n  nBits += mLen\\\\n  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\\\\n\\\\n  if (e === 0) {\\\\n    e = 1 - eBias\\\\n  } else if (e === eMax) {\\\\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\\\\n  } else {\\\\n    m = m + Math.pow(2, mLen)\\\\n    e = e - eBias\\\\n  }\\\\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\\\\n}\\\\n\\\\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\\\\n  var e, m, c\\\\n  var eLen = (nBytes * 8) - mLen - 1\\\\n  var eMax = (1 << eLen) - 1\\\\n  var eBias = eMax >> 1\\\\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\\\\n  var i = isLE ? 0 : (nBytes - 1)\\\\n  var d = isLE ? 1 : -1\\\\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\\\\n\\\\n  value = Math.abs(value)\\\\n\\\\n  if (isNaN(value) || value === Infinity) {\\\\n    m = isNaN(value) ? 1 : 0\\\\n    e = eMax\\\\n  } else {\\\\n    e = Math.floor(Math.log(value) / Math.LN2)\\\\n    if (value * (c = Math.pow(2, -e)) < 1) {\\\\n      e--\\\\n      c *= 2\\\\n    }\\\\n    if (e + eBias >= 1) {\\\\n      value += rt / c\\\\n    } else {\\\\n      value += rt * Math.pow(2, 1 - eBias)\\\\n    }\\\\n    if (value * c >= 2) {\\\\n      e++\\\\n      c /= 2\\\\n    }\\\\n\\\\n    if (e + eBias >= eMax) {\\\\n      m = 0\\\\n      e = eMax\\\\n    } else if (e + eBias >= 1) {\\\\n      m = ((value * c) - 1) * Math.pow(2, mLen)\\\\n      e = e + eBias\\\\n    } else {\\\\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\\\\n      e = 0\\\\n    }\\\\n  }\\\\n\\\\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\\\\n\\\\n  e = (e << mLen) | m\\\\n  eLen += mLen\\\\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\\\\n\\\\n  buffer[offset + i - d] |= s * 128\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/ieee754/index.js\\\\n// module id = 277\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/ieee754/index.js\\")},function(module,exports){eval(\\"\\\\nvar indexOf = [].indexOf;\\\\n\\\\nmodule.exports = function(arr, obj){\\\\n  if (indexOf) return arr.indexOf(obj);\\\\n  for (var i = 0; i < arr.length; ++i) {\\\\n    if (arr[i] === obj) return i;\\\\n  }\\\\n  return -1;\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/indexof/index.js\\\\n// module id = 278\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/indexof/index.js\\")},function(module,exports){eval(\\"/**\\\\n * Returns a `Boolean` on whether or not the a `String` starts with \'0x\'\\\\n * @param {String} str the string input value\\\\n * @return {Boolean} a boolean if it is or is not hex prefixed\\\\n * @throws if the str input is not a string\\\\n */\\\\nmodule.exports = function isHexPrefixed(str) {\\\\n  if (typeof str !== \'string\') {\\\\n    throw new Error(\\\\\\"[is-hex-prefixed] value must be type \'string\', is currently type \\\\\\" + (typeof str) + \\\\\\", while checking isHexPrefixed.\\\\\\");\\\\n  }\\\\n\\\\n  return str.slice(0, 2) === \'0x\';\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/is-hex-prefixed/src/index.js\\\\n// module id = 279\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/is-hex-prefixed/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {\\\\nvar inherits = __webpack_require__(0)\\\\nvar HashBase = __webpack_require__(281)\\\\n\\\\nvar ARRAY16 = new Array(16)\\\\n\\\\nfunction MD5 () {\\\\n  HashBase.call(this, 64)\\\\n\\\\n  // state\\\\n  this._a = 0x67452301\\\\n  this._b = 0xefcdab89\\\\n  this._c = 0x98badcfe\\\\n  this._d = 0x10325476\\\\n}\\\\n\\\\ninherits(MD5, HashBase)\\\\n\\\\nMD5.prototype._update = function () {\\\\n  var M = ARRAY16\\\\n  for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4)\\\\n\\\\n  var a = this._a\\\\n  var b = this._b\\\\n  var c = this._c\\\\n  var d = this._d\\\\n\\\\n  a = fnF(a, b, c, d, M[0], 0xd76aa478, 7)\\\\n  d = fnF(d, a, b, c, M[1], 0xe8c7b756, 12)\\\\n  c = fnF(c, d, a, b, M[2], 0x242070db, 17)\\\\n  b = fnF(b, c, d, a, M[3], 0xc1bdceee, 22)\\\\n  a = fnF(a, b, c, d, M[4], 0xf57c0faf, 7)\\\\n  d = fnF(d, a, b, c, M[5], 0x4787c62a, 12)\\\\n  c = fnF(c, d, a, b, M[6], 0xa8304613, 17)\\\\n  b = fnF(b, c, d, a, M[7], 0xfd469501, 22)\\\\n  a = fnF(a, b, c, d, M[8], 0x698098d8, 7)\\\\n  d = fnF(d, a, b, c, M[9], 0x8b44f7af, 12)\\\\n  c = fnF(c, d, a, b, M[10], 0xffff5bb1, 17)\\\\n  b = fnF(b, c, d, a, M[11], 0x895cd7be, 22)\\\\n  a = fnF(a, b, c, d, M[12], 0x6b901122, 7)\\\\n  d = fnF(d, a, b, c, M[13], 0xfd987193, 12)\\\\n  c = fnF(c, d, a, b, M[14], 0xa679438e, 17)\\\\n  b = fnF(b, c, d, a, M[15], 0x49b40821, 22)\\\\n\\\\n  a = fnG(a, b, c, d, M[1], 0xf61e2562, 5)\\\\n  d = fnG(d, a, b, c, M[6], 0xc040b340, 9)\\\\n  c = fnG(c, d, a, b, M[11], 0x265e5a51, 14)\\\\n  b = fnG(b, c, d, a, M[0], 0xe9b6c7aa, 20)\\\\n  a = fnG(a, b, c, d, M[5], 0xd62f105d, 5)\\\\n  d = fnG(d, a, b, c, M[10], 0x02441453, 9)\\\\n  c = fnG(c, d, a, b, M[15], 0xd8a1e681, 14)\\\\n  b = fnG(b, c, d, a, M[4], 0xe7d3fbc8, 20)\\\\n  a = fnG(a, b, c, d, M[9], 0x21e1cde6, 5)\\\\n  d = fnG(d, a, b, c, M[14], 0xc33707d6, 9)\\\\n  c = fnG(c, d, a, b, M[3], 0xf4d50d87, 14)\\\\n  b = fnG(b, c, d, a, M[8], 0x455a14ed, 20)\\\\n  a = fnG(a, b, c, d, M[13], 0xa9e3e905, 5)\\\\n  d = fnG(d, a, b, c, M[2], 0xfcefa3f8, 9)\\\\n  c = fnG(c, d, a, b, M[7], 0x676f02d9, 14)\\\\n  b = fnG(b, c, d, a, M[12], 0x8d2a4c8a, 20)\\\\n\\\\n  a = fnH(a, b, c, d, M[5], 0xfffa3942, 4)\\\\n  d = fnH(d, a, b, c, M[8], 0x8771f681, 11)\\\\n  c = fnH(c, d, a, b, M[11], 0x6d9d6122, 16)\\\\n  b = fnH(b, c, d, a, M[14], 0xfde5380c, 23)\\\\n  a = fnH(a, b, c, d, M[1], 0xa4beea44, 4)\\\\n  d = fnH(d, a, b, c, M[4], 0x4bdecfa9, 11)\\\\n  c = fnH(c, d, a, b, M[7], 0xf6bb4b60, 16)\\\\n  b = fnH(b, c, d, a, M[10], 0xbebfbc70, 23)\\\\n  a = fnH(a, b, c, d, M[13], 0x289b7ec6, 4)\\\\n  d = fnH(d, a, b, c, M[0], 0xeaa127fa, 11)\\\\n  c = fnH(c, d, a, b, M[3], 0xd4ef3085, 16)\\\\n  b = fnH(b, c, d, a, M[6], 0x04881d05, 23)\\\\n  a = fnH(a, b, c, d, M[9], 0xd9d4d039, 4)\\\\n  d = fnH(d, a, b, c, M[12], 0xe6db99e5, 11)\\\\n  c = fnH(c, d, a, b, M[15], 0x1fa27cf8, 16)\\\\n  b = fnH(b, c, d, a, M[2], 0xc4ac5665, 23)\\\\n\\\\n  a = fnI(a, b, c, d, M[0], 0xf4292244, 6)\\\\n  d = fnI(d, a, b, c, M[7], 0x432aff97, 10)\\\\n  c = fnI(c, d, a, b, M[14], 0xab9423a7, 15)\\\\n  b = fnI(b, c, d, a, M[5], 0xfc93a039, 21)\\\\n  a = fnI(a, b, c, d, M[12], 0x655b59c3, 6)\\\\n  d = fnI(d, a, b, c, M[3], 0x8f0ccc92, 10)\\\\n  c = fnI(c, d, a, b, M[10], 0xffeff47d, 15)\\\\n  b = fnI(b, c, d, a, M[1], 0x85845dd1, 21)\\\\n  a = fnI(a, b, c, d, M[8], 0x6fa87e4f, 6)\\\\n  d = fnI(d, a, b, c, M[15], 0xfe2ce6e0, 10)\\\\n  c = fnI(c, d, a, b, M[6], 0xa3014314, 15)\\\\n  b = fnI(b, c, d, a, M[13], 0x4e0811a1, 21)\\\\n  a = fnI(a, b, c, d, M[4], 0xf7537e82, 6)\\\\n  d = fnI(d, a, b, c, M[11], 0xbd3af235, 10)\\\\n  c = fnI(c, d, a, b, M[2], 0x2ad7d2bb, 15)\\\\n  b = fnI(b, c, d, a, M[9], 0xeb86d391, 21)\\\\n\\\\n  this._a = (this._a + a) | 0\\\\n  this._b = (this._b + b) | 0\\\\n  this._c = (this._c + c) | 0\\\\n  this._d = (this._d + d) | 0\\\\n}\\\\n\\\\nMD5.prototype._digest = function () {\\\\n  // create padding and handle blocks\\\\n  this._block[this._blockOffset++] = 0x80\\\\n  if (this._blockOffset > 56) {\\\\n    this._block.fill(0, this._blockOffset, 64)\\\\n    this._update()\\\\n    this._blockOffset = 0\\\\n  }\\\\n\\\\n  this._block.fill(0, this._blockOffset, 56)\\\\n  this._block.writeUInt32LE(this._length[0], 56)\\\\n  this._block.writeUInt32LE(this._length[1], 60)\\\\n  this._update()\\\\n\\\\n  // produce result\\\\n  var buffer = new Buffer(16)\\\\n  buffer.writeInt32LE(this._a, 0)\\\\n  buffer.writeInt32LE(this._b, 4)\\\\n  buffer.writeInt32LE(this._c, 8)\\\\n  buffer.writeInt32LE(this._d, 12)\\\\n  return buffer\\\\n}\\\\n\\\\nfunction rotl (x, n) {\\\\n  return (x << n) | (x >>> (32 - n))\\\\n}\\\\n\\\\nfunction fnF (a, b, c, d, m, k, s) {\\\\n  return (rotl((a + ((b & c) | ((~b) & d)) + m + k) | 0, s) + b) | 0\\\\n}\\\\n\\\\nfunction fnG (a, b, c, d, m, k, s) {\\\\n  return (rotl((a + ((b & d) | (c & (~d))) + m + k) | 0, s) + b) | 0\\\\n}\\\\n\\\\nfunction fnH (a, b, c, d, m, k, s) {\\\\n  return (rotl((a + (b ^ c ^ d) + m + k) | 0, s) + b) | 0\\\\n}\\\\n\\\\nfunction fnI (a, b, c, d, m, k, s) {\\\\n  return (rotl((a + ((c ^ (b | (~d)))) + m + k) | 0, s) + b) | 0\\\\n}\\\\n\\\\nmodule.exports = MD5\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/md5.js/index.js\\\\n// module id = 280\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/md5.js/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\nvar Transform = __webpack_require__(56).Transform\\\\nvar inherits = __webpack_require__(0)\\\\n\\\\nfunction throwIfNotStringOrBuffer (val, prefix) {\\\\n  if (!Buffer.isBuffer(val) && typeof val !== \'string\') {\\\\n    throw new TypeError(prefix + \' must be a string or a buffer\')\\\\n  }\\\\n}\\\\n\\\\nfunction HashBase (blockSize) {\\\\n  Transform.call(this)\\\\n\\\\n  this._block = Buffer.allocUnsafe(blockSize)\\\\n  this._blockSize = blockSize\\\\n  this._blockOffset = 0\\\\n  this._length = [0, 0, 0, 0]\\\\n\\\\n  this._finalized = false\\\\n}\\\\n\\\\ninherits(HashBase, Transform)\\\\n\\\\nHashBase.prototype._transform = function (chunk, encoding, callback) {\\\\n  var error = null\\\\n  try {\\\\n    this.update(chunk, encoding)\\\\n  } catch (err) {\\\\n    error = err\\\\n  }\\\\n\\\\n  callback(error)\\\\n}\\\\n\\\\nHashBase.prototype._flush = function (callback) {\\\\n  var error = null\\\\n  try {\\\\n    this.push(this.digest())\\\\n  } catch (err) {\\\\n    error = err\\\\n  }\\\\n\\\\n  callback(error)\\\\n}\\\\n\\\\nHashBase.prototype.update = function (data, encoding) {\\\\n  throwIfNotStringOrBuffer(data, \'Data\')\\\\n  if (this._finalized) throw new Error(\'Digest already called\')\\\\n  if (!Buffer.isBuffer(data)) data = Buffer.from(data, encoding)\\\\n\\\\n  // consume data\\\\n  var block = this._block\\\\n  var offset = 0\\\\n  while (this._blockOffset + data.length - offset >= this._blockSize) {\\\\n    for (var i = this._blockOffset; i < this._blockSize;) block[i++] = data[offset++]\\\\n    this._update()\\\\n    this._blockOffset = 0\\\\n  }\\\\n  while (offset < data.length) block[this._blockOffset++] = data[offset++]\\\\n\\\\n  // update length\\\\n  for (var j = 0, carry = data.length * 8; carry > 0; ++j) {\\\\n    this._length[j] += carry\\\\n    carry = (this._length[j] / 0x0100000000) | 0\\\\n    if (carry > 0) this._length[j] -= 0x0100000000 * carry\\\\n  }\\\\n\\\\n  return this\\\\n}\\\\n\\\\nHashBase.prototype._update = function () {\\\\n  throw new Error(\'_update is not implemented\')\\\\n}\\\\n\\\\nHashBase.prototype.digest = function (encoding) {\\\\n  if (this._finalized) throw new Error(\'Digest already called\')\\\\n  this._finalized = true\\\\n\\\\n  var digest = this._digest()\\\\n  if (encoding !== undefined) digest = digest.toString(encoding)\\\\n\\\\n  // reset state\\\\n  this._block.fill(0)\\\\n  this._blockOffset = 0\\\\n  for (var i = 0; i < 4; ++i) this._length[i] = 0\\\\n\\\\n  return digest\\\\n}\\\\n\\\\nHashBase.prototype._digest = function () {\\\\n  throw new Error(\'_digest is not implemented\')\\\\n}\\\\n\\\\nmodule.exports = HashBase\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/md5.js/~/hash-base/index.js\\\\n// module id = 281\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/md5.js/node_modules/hash-base/index.js\\")},function(module,exports){eval(\\"/**\\\\n * Helpers.\\\\n */\\\\n\\\\nvar s = 1000;\\\\nvar m = s * 60;\\\\nvar h = m * 60;\\\\nvar d = h * 24;\\\\nvar y = d * 365.25;\\\\n\\\\n/**\\\\n * Parse or format the given `val`.\\\\n *\\\\n * Options:\\\\n *\\\\n *  - `long` verbose formatting [false]\\\\n *\\\\n * @param {String|Number} val\\\\n * @param {Object} [options]\\\\n * @throws {Error} throw an error if val is not a non-empty string or a number\\\\n * @return {String|Number}\\\\n * @api public\\\\n */\\\\n\\\\nmodule.exports = function(val, options) {\\\\n  options = options || {};\\\\n  var type = typeof val;\\\\n  if (type === \'string\' && val.length > 0) {\\\\n    return parse(val);\\\\n  } else if (type === \'number\' && isNaN(val) === false) {\\\\n    return options.long ? fmtLong(val) : fmtShort(val);\\\\n  }\\\\n  throw new Error(\\\\n    \'val is not a non-empty string or a valid number. val=\' +\\\\n      JSON.stringify(val)\\\\n  );\\\\n};\\\\n\\\\n/**\\\\n * Parse the given `str` and return milliseconds.\\\\n *\\\\n * @param {String} str\\\\n * @return {Number}\\\\n * @api private\\\\n */\\\\n\\\\nfunction parse(str) {\\\\n  str = String(str);\\\\n  if (str.length > 100) {\\\\n    return;\\\\n  }\\\\n  var match = /^((?:\\\\\\\\d+)?\\\\\\\\.?\\\\\\\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(\\\\n    str\\\\n  );\\\\n  if (!match) {\\\\n    return;\\\\n  }\\\\n  var n = parseFloat(match[1]);\\\\n  var type = (match[2] || \'ms\').toLowerCase();\\\\n  switch (type) {\\\\n    case \'years\':\\\\n    case \'year\':\\\\n    case \'yrs\':\\\\n    case \'yr\':\\\\n    case \'y\':\\\\n      return n * y;\\\\n    case \'days\':\\\\n    case \'day\':\\\\n    case \'d\':\\\\n      return n * d;\\\\n    case \'hours\':\\\\n    case \'hour\':\\\\n    case \'hrs\':\\\\n    case \'hr\':\\\\n    case \'h\':\\\\n      return n * h;\\\\n    case \'minutes\':\\\\n    case \'minute\':\\\\n    case \'mins\':\\\\n    case \'min\':\\\\n    case \'m\':\\\\n      return n * m;\\\\n    case \'seconds\':\\\\n    case \'second\':\\\\n    case \'secs\':\\\\n    case \'sec\':\\\\n    case \'s\':\\\\n      return n * s;\\\\n    case \'milliseconds\':\\\\n    case \'millisecond\':\\\\n    case \'msecs\':\\\\n    case \'msec\':\\\\n    case \'ms\':\\\\n      return n;\\\\n    default:\\\\n      return undefined;\\\\n  }\\\\n}\\\\n\\\\n/**\\\\n * Short format for `ms`.\\\\n *\\\\n * @param {Number} ms\\\\n * @return {String}\\\\n * @api private\\\\n */\\\\n\\\\nfunction fmtShort(ms) {\\\\n  if (ms >= d) {\\\\n    return Math.round(ms / d) + \'d\';\\\\n  }\\\\n  if (ms >= h) {\\\\n    return Math.round(ms / h) + \'h\';\\\\n  }\\\\n  if (ms >= m) {\\\\n    return Math.round(ms / m) + \'m\';\\\\n  }\\\\n  if (ms >= s) {\\\\n    return Math.round(ms / s) + \'s\';\\\\n  }\\\\n  return ms + \'ms\';\\\\n}\\\\n\\\\n/**\\\\n * Long format for `ms`.\\\\n *\\\\n * @param {Number} ms\\\\n * @return {String}\\\\n * @api private\\\\n */\\\\n\\\\nfunction fmtLong(ms) {\\\\n  return plural(ms, d, \'day\') ||\\\\n    plural(ms, h, \'hour\') ||\\\\n    plural(ms, m, \'minute\') ||\\\\n    plural(ms, s, \'second\') ||\\\\n    ms + \' ms\';\\\\n}\\\\n\\\\n/**\\\\n * Pluralization helper.\\\\n */\\\\n\\\\nfunction plural(ms, n, name) {\\\\n  if (ms < n) {\\\\n    return;\\\\n  }\\\\n  if (ms < n * 1.5) {\\\\n    return Math.floor(ms / n) + \' \' + name;\\\\n  }\\\\n  return Math.ceil(ms / n) + \' \' + name + \'s\';\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/ms/index.js\\\\n// module id = 282\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/ms/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\\\\n  \'use strict\';\\\\n\\\\n  // Utils\\\\n  function assert (val, msg) {\\\\n    if (!val) throw new Error(msg || \'Assertion failed\');\\\\n  }\\\\n\\\\n  // Could use `inherits` module, but don\'t want to move from single file\\\\n  // architecture yet.\\\\n  function inherits (ctor, superCtor) {\\\\n    ctor.super_ = superCtor;\\\\n    var TempCtor = function () {};\\\\n    TempCtor.prototype = superCtor.prototype;\\\\n    ctor.prototype = new TempCtor();\\\\n    ctor.prototype.constructor = ctor;\\\\n  }\\\\n\\\\n  // BN\\\\n\\\\n  function BN (number, base, endian) {\\\\n    if (BN.isBN(number)) {\\\\n      return number;\\\\n    }\\\\n\\\\n    this.negative = 0;\\\\n    this.words = null;\\\\n    this.length = 0;\\\\n\\\\n    // Reduction context\\\\n    this.red = null;\\\\n\\\\n    if (number !== null) {\\\\n      if (base === \'le\' || base === \'be\') {\\\\n        endian = base;\\\\n        base = 10;\\\\n      }\\\\n\\\\n      this._init(number || 0, base || 10, endian || \'be\');\\\\n    }\\\\n  }\\\\n  if (typeof module === \'object\') {\\\\n    module.exports = BN;\\\\n  } else {\\\\n    exports.BN = BN;\\\\n  }\\\\n\\\\n  BN.BN = BN;\\\\n  BN.wordSize = 26;\\\\n\\\\n  var Buffer;\\\\n  try {\\\\n    Buffer = __webpack_require__(1).Buffer;\\\\n  } catch (e) {\\\\n  }\\\\n\\\\n  BN.isBN = function isBN (num) {\\\\n    if (num instanceof BN) {\\\\n      return true;\\\\n    }\\\\n\\\\n    return num !== null && typeof num === \'object\' &&\\\\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\\\\n  };\\\\n\\\\n  BN.max = function max (left, right) {\\\\n    if (left.cmp(right) > 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.min = function min (left, right) {\\\\n    if (left.cmp(right) < 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.prototype._init = function init (number, base, endian) {\\\\n    if (typeof number === \'number\') {\\\\n      return this._initNumber(number, base, endian);\\\\n    }\\\\n\\\\n    if (typeof number === \'object\') {\\\\n      return this._initArray(number, base, endian);\\\\n    }\\\\n\\\\n    if (base === \'hex\') {\\\\n      base = 16;\\\\n    }\\\\n    assert(base === (base | 0) && base >= 2 && base <= 36);\\\\n\\\\n    number = number.toString().replace(/\\\\\\\\s+/g, \'\');\\\\n    var start = 0;\\\\n    if (number[0] === \'-\') {\\\\n      start++;\\\\n    }\\\\n\\\\n    if (base === 16) {\\\\n      this._parseHex(number, start);\\\\n    } else {\\\\n      this._parseBase(number, base, start);\\\\n    }\\\\n\\\\n    if (number[0] === \'-\') {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    this.strip();\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\\\\n    if (number < 0) {\\\\n      this.negative = 1;\\\\n      number = -number;\\\\n    }\\\\n    if (number < 0x4000000) {\\\\n      this.words = [ number & 0x3ffffff ];\\\\n      this.length = 1;\\\\n    } else if (number < 0x10000000000000) {\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff\\\\n      ];\\\\n      this.length = 2;\\\\n    } else {\\\\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff,\\\\n        1\\\\n      ];\\\\n      this.length = 3;\\\\n    }\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    // Reverse the bytes\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initArray = function _initArray (number, base, endian) {\\\\n    // Perhaps a Uint8Array\\\\n    assert(typeof number.length === \'number\');\\\\n    if (number.length <= 0) {\\\\n      this.words = [ 0 ];\\\\n      this.length = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.length = Math.ceil(number.length / 3);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    var off = 0;\\\\n    if (endian === \'be\') {\\\\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\\\\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    } else if (endian === \'le\') {\\\\n      for (i = 0, j = 0; i < number.length; i += 3) {\\\\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    }\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  function parseHex (str, start, end) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r <<= 4;\\\\n\\\\n      // \'a\' - \'f\'\\\\n      if (c >= 49 && c <= 54) {\\\\n        r |= c - 49 + 0xa;\\\\n\\\\n      // \'A\' - \'F\'\\\\n      } else if (c >= 17 && c <= 22) {\\\\n        r |= c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r |= c & 0xf;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseHex = function _parseHex (number, start) {\\\\n    // Create possibly bigger array to ensure that it fits the number\\\\n    this.length = Math.ceil((number.length - start) / 6);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    // Scan 24-bit chunks and add them to the number\\\\n    var off = 0;\\\\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\\\\n      w = parseHex(number, i, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n      off += 24;\\\\n      if (off >= 26) {\\\\n        off -= 26;\\\\n        j++;\\\\n      }\\\\n    }\\\\n    if (i + 6 !== start) {\\\\n      w = parseHex(number, start, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n    }\\\\n    this.strip();\\\\n  };\\\\n\\\\n  function parseBase (str, start, end, mul) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r *= mul;\\\\n\\\\n      // \'a\'\\\\n      if (c >= 49) {\\\\n        r += c - 49 + 0xa;\\\\n\\\\n      // \'A\'\\\\n      } else if (c >= 17) {\\\\n        r += c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r += c;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\\\\n    // Initialize as zero\\\\n    this.words = [ 0 ];\\\\n    this.length = 1;\\\\n\\\\n    // Find length of limb in base\\\\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\\\\n      limbLen++;\\\\n    }\\\\n    limbLen--;\\\\n    limbPow = (limbPow / base) | 0;\\\\n\\\\n    var total = number.length - start;\\\\n    var mod = total % limbLen;\\\\n    var end = Math.min(total, total - mod) + start;\\\\n\\\\n    var word = 0;\\\\n    for (var i = start; i < end; i += limbLen) {\\\\n      word = parseBase(number, i, i + limbLen, base);\\\\n\\\\n      this.imuln(limbPow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n\\\\n    if (mod !== 0) {\\\\n      var pow = 1;\\\\n      word = parseBase(number, i, number.length, base);\\\\n\\\\n      for (i = 0; i < mod; i++) {\\\\n        pow *= base;\\\\n      }\\\\n\\\\n      this.imuln(pow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  BN.prototype.copy = function copy (dest) {\\\\n    dest.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      dest.words[i] = this.words[i];\\\\n    }\\\\n    dest.length = this.length;\\\\n    dest.negative = this.negative;\\\\n    dest.red = this.red;\\\\n  };\\\\n\\\\n  BN.prototype.clone = function clone () {\\\\n    var r = new BN(null);\\\\n    this.copy(r);\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype._expand = function _expand (size) {\\\\n    while (this.length < size) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  // Remove leading `0` from `this`\\\\n  BN.prototype.strip = function strip () {\\\\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\\\\n      this.length--;\\\\n    }\\\\n    return this._normSign();\\\\n  };\\\\n\\\\n  BN.prototype._normSign = function _normSign () {\\\\n    // -0 = 0\\\\n    if (this.length === 1 && this.words[0] === 0) {\\\\n      this.negative = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.inspect = function inspect () {\\\\n    return (this.red ? \'<BN-R: \' : \'<BN: \') + this.toString(16) + \'>\';\\\\n  };\\\\n\\\\n  /*\\\\n\\\\n  var zeros = [];\\\\n  var groupSizes = [];\\\\n  var groupBases = [];\\\\n\\\\n  var s = \'\';\\\\n  var i = -1;\\\\n  while (++i < BN.wordSize) {\\\\n    zeros[i] = s;\\\\n    s += \'0\';\\\\n  }\\\\n  groupSizes[0] = 0;\\\\n  groupSizes[1] = 0;\\\\n  groupBases[0] = 0;\\\\n  groupBases[1] = 0;\\\\n  var base = 2 - 1;\\\\n  while (++base < 36 + 1) {\\\\n    var groupSize = 0;\\\\n    var groupBase = 1;\\\\n    while (groupBase < (1 << BN.wordSize) / base) {\\\\n      groupBase *= base;\\\\n      groupSize += 1;\\\\n    }\\\\n    groupSizes[base] = groupSize;\\\\n    groupBases[base] = groupBase;\\\\n  }\\\\n\\\\n  */\\\\n\\\\n  var zeros = [\\\\n    \'\',\\\\n    \'0\',\\\\n    \'00\',\\\\n    \'000\',\\\\n    \'0000\',\\\\n    \'00000\',\\\\n    \'000000\',\\\\n    \'0000000\',\\\\n    \'00000000\',\\\\n    \'000000000\',\\\\n    \'0000000000\',\\\\n    \'00000000000\',\\\\n    \'000000000000\',\\\\n    \'0000000000000\',\\\\n    \'00000000000000\',\\\\n    \'000000000000000\',\\\\n    \'0000000000000000\',\\\\n    \'00000000000000000\',\\\\n    \'000000000000000000\',\\\\n    \'0000000000000000000\',\\\\n    \'00000000000000000000\',\\\\n    \'000000000000000000000\',\\\\n    \'0000000000000000000000\',\\\\n    \'00000000000000000000000\',\\\\n    \'000000000000000000000000\',\\\\n    \'0000000000000000000000000\'\\\\n  ];\\\\n\\\\n  var groupSizes = [\\\\n    0, 0,\\\\n    25, 16, 12, 11, 10, 9, 8,\\\\n    8, 7, 7, 7, 7, 6, 6,\\\\n    6, 6, 6, 6, 6, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5\\\\n  ];\\\\n\\\\n  var groupBases = [\\\\n    0, 0,\\\\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\\\\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\\\\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\\\\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\\\\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\\\\n  ];\\\\n\\\\n  BN.prototype.toString = function toString (base, padding) {\\\\n    base = base || 10;\\\\n    padding = padding | 0 || 1;\\\\n\\\\n    var out;\\\\n    if (base === 16 || base === \'hex\') {\\\\n      out = \'\';\\\\n      var off = 0;\\\\n      var carry = 0;\\\\n      for (var i = 0; i < this.length; i++) {\\\\n        var w = this.words[i];\\\\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\\\\n        carry = (w >>> (24 - off)) & 0xffffff;\\\\n        if (carry !== 0 || i !== this.length - 1) {\\\\n          out = zeros[6 - word.length] + word + out;\\\\n        } else {\\\\n          out = word + out;\\\\n        }\\\\n        off += 2;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          i--;\\\\n        }\\\\n      }\\\\n      if (carry !== 0) {\\\\n        out = carry.toString(16) + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    if (base === (base | 0) && base >= 2 && base <= 36) {\\\\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\\\\n      var groupSize = groupSizes[base];\\\\n      // var groupBase = Math.pow(base, groupSize);\\\\n      var groupBase = groupBases[base];\\\\n      out = \'\';\\\\n      var c = this.clone();\\\\n      c.negative = 0;\\\\n      while (!c.isZero()) {\\\\n        var r = c.modn(groupBase).toString(base);\\\\n        c = c.idivn(groupBase);\\\\n\\\\n        if (!c.isZero()) {\\\\n          out = zeros[groupSize - r.length] + r + out;\\\\n        } else {\\\\n          out = r + out;\\\\n        }\\\\n      }\\\\n      if (this.isZero()) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    assert(false, \'Base should be between 2 and 36\');\\\\n  };\\\\n\\\\n  BN.prototype.toNumber = function toNumber () {\\\\n    var ret = this.words[0];\\\\n    if (this.length === 2) {\\\\n      ret += this.words[1] * 0x4000000;\\\\n    } else if (this.length === 3 && this.words[2] === 0x01) {\\\\n      // NOTE: at this stage it is known that the top bit is set\\\\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\\\\n    } else if (this.length > 2) {\\\\n      assert(false, \'Number can only safely store up to 53 bits\');\\\\n    }\\\\n    return (this.negative !== 0) ? -ret : ret;\\\\n  };\\\\n\\\\n  BN.prototype.toJSON = function toJSON () {\\\\n    return this.toString(16);\\\\n  };\\\\n\\\\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\\\\n    assert(typeof Buffer !== \'undefined\');\\\\n    return this.toArrayLike(Buffer, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArray = function toArray (endian, length) {\\\\n    return this.toArrayLike(Array, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\\\\n    var byteLength = this.byteLength();\\\\n    var reqLength = length || Math.max(1, byteLength);\\\\n    assert(byteLength <= reqLength, \'byte array longer than desired length\');\\\\n    assert(reqLength > 0, \'Requested array length <= 0\');\\\\n\\\\n    this.strip();\\\\n    var littleEndian = endian === \'le\';\\\\n    var res = new ArrayType(reqLength);\\\\n\\\\n    var b, i;\\\\n    var q = this.clone();\\\\n    if (!littleEndian) {\\\\n      // Assume big-endian\\\\n      for (i = 0; i < reqLength - byteLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[reqLength - i - 1] = b;\\\\n      }\\\\n    } else {\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[i] = b;\\\\n      }\\\\n\\\\n      for (; i < reqLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  if (Math.clz32) {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      return 32 - Math.clz32(w);\\\\n    };\\\\n  } else {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      var t = w;\\\\n      var r = 0;\\\\n      if (t >= 0x1000) {\\\\n        r += 13;\\\\n        t >>>= 13;\\\\n      }\\\\n      if (t >= 0x40) {\\\\n        r += 7;\\\\n        t >>>= 7;\\\\n      }\\\\n      if (t >= 0x8) {\\\\n        r += 4;\\\\n        t >>>= 4;\\\\n      }\\\\n      if (t >= 0x02) {\\\\n        r += 2;\\\\n        t >>>= 2;\\\\n      }\\\\n      return r + t;\\\\n    };\\\\n  }\\\\n\\\\n  BN.prototype._zeroBits = function _zeroBits (w) {\\\\n    // Short-cut\\\\n    if (w === 0) return 26;\\\\n\\\\n    var t = w;\\\\n    var r = 0;\\\\n    if ((t & 0x1fff) === 0) {\\\\n      r += 13;\\\\n      t >>>= 13;\\\\n    }\\\\n    if ((t & 0x7f) === 0) {\\\\n      r += 7;\\\\n      t >>>= 7;\\\\n    }\\\\n    if ((t & 0xf) === 0) {\\\\n      r += 4;\\\\n      t >>>= 4;\\\\n    }\\\\n    if ((t & 0x3) === 0) {\\\\n      r += 2;\\\\n      t >>>= 2;\\\\n    }\\\\n    if ((t & 0x1) === 0) {\\\\n      r++;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  // Return number of used bits in a BN\\\\n  BN.prototype.bitLength = function bitLength () {\\\\n    var w = this.words[this.length - 1];\\\\n    var hi = this._countBits(w);\\\\n    return (this.length - 1) * 26 + hi;\\\\n  };\\\\n\\\\n  function toBitArray (num) {\\\\n    var w = new Array(num.bitLength());\\\\n\\\\n    for (var bit = 0; bit < w.length; bit++) {\\\\n      var off = (bit / 26) | 0;\\\\n      var wbit = bit % 26;\\\\n\\\\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\\\\n    }\\\\n\\\\n    return w;\\\\n  }\\\\n\\\\n  // Number of trailing zero bits\\\\n  BN.prototype.zeroBits = function zeroBits () {\\\\n    if (this.isZero()) return 0;\\\\n\\\\n    var r = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var b = this._zeroBits(this.words[i]);\\\\n      r += b;\\\\n      if (b !== 26) break;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype.byteLength = function byteLength () {\\\\n    return Math.ceil(this.bitLength() / 8);\\\\n  };\\\\n\\\\n  BN.prototype.toTwos = function toTwos (width) {\\\\n    if (this.negative !== 0) {\\\\n      return this.abs().inotn(width).iaddn(1);\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.fromTwos = function fromTwos (width) {\\\\n    if (this.testn(width - 1)) {\\\\n      return this.notn(width).iaddn(1).ineg();\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.isNeg = function isNeg () {\\\\n    return this.negative !== 0;\\\\n  };\\\\n\\\\n  // Return negative clone of `this`\\\\n  BN.prototype.neg = function neg () {\\\\n    return this.clone().ineg();\\\\n  };\\\\n\\\\n  BN.prototype.ineg = function ineg () {\\\\n    if (!this.isZero()) {\\\\n      this.negative ^= 1;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Or `num` with `this` in-place\\\\n  BN.prototype.iuor = function iuor (num) {\\\\n    while (this.length < num.length) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      this.words[i] = this.words[i] | num.words[i];\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ior = function ior (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuor(num);\\\\n  };\\\\n\\\\n  // Or `num` with `this`\\\\n  BN.prototype.or = function or (num) {\\\\n    if (this.length > num.length) return this.clone().ior(num);\\\\n    return num.clone().ior(this);\\\\n  };\\\\n\\\\n  BN.prototype.uor = function uor (num) {\\\\n    if (this.length > num.length) return this.clone().iuor(num);\\\\n    return num.clone().iuor(this);\\\\n  };\\\\n\\\\n  // And `num` with `this` in-place\\\\n  BN.prototype.iuand = function iuand (num) {\\\\n    // b = min-length(num, this)\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      b = num;\\\\n    } else {\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = this.words[i] & num.words[i];\\\\n    }\\\\n\\\\n    this.length = b.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.iand = function iand (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuand(num);\\\\n  };\\\\n\\\\n  // And `num` with `this`\\\\n  BN.prototype.and = function and (num) {\\\\n    if (this.length > num.length) return this.clone().iand(num);\\\\n    return num.clone().iand(this);\\\\n  };\\\\n\\\\n  BN.prototype.uand = function uand (num) {\\\\n    if (this.length > num.length) return this.clone().iuand(num);\\\\n    return num.clone().iuand(this);\\\\n  };\\\\n\\\\n  // Xor `num` with `this` in-place\\\\n  BN.prototype.iuxor = function iuxor (num) {\\\\n    // a.length > b.length\\\\n    var a;\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = a.words[i] ^ b.words[i];\\\\n    }\\\\n\\\\n    if (this !== a) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ixor = function ixor (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuxor(num);\\\\n  };\\\\n\\\\n  // Xor `num` with `this`\\\\n  BN.prototype.xor = function xor (num) {\\\\n    if (this.length > num.length) return this.clone().ixor(num);\\\\n    return num.clone().ixor(this);\\\\n  };\\\\n\\\\n  BN.prototype.uxor = function uxor (num) {\\\\n    if (this.length > num.length) return this.clone().iuxor(num);\\\\n    return num.clone().iuxor(this);\\\\n  };\\\\n\\\\n  // Not ``this`` with ``width`` bitwidth\\\\n  BN.prototype.inotn = function inotn (width) {\\\\n    assert(typeof width === \'number\' && width >= 0);\\\\n\\\\n    var bytesNeeded = Math.ceil(width / 26) | 0;\\\\n    var bitsLeft = width % 26;\\\\n\\\\n    // Extend the buffer with leading zeroes\\\\n    this._expand(bytesNeeded);\\\\n\\\\n    if (bitsLeft > 0) {\\\\n      bytesNeeded--;\\\\n    }\\\\n\\\\n    // Handle complete words\\\\n    for (var i = 0; i < bytesNeeded; i++) {\\\\n      this.words[i] = ~this.words[i] & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Handle the residue\\\\n    if (bitsLeft > 0) {\\\\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\\\\n    }\\\\n\\\\n    // And remove leading zeroes\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.notn = function notn (width) {\\\\n    return this.clone().inotn(width);\\\\n  };\\\\n\\\\n  // Set `bit` of `this`\\\\n  BN.prototype.setn = function setn (bit, val) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n\\\\n    var off = (bit / 26) | 0;\\\\n    var wbit = bit % 26;\\\\n\\\\n    this._expand(off + 1);\\\\n\\\\n    if (val) {\\\\n      this.words[off] = this.words[off] | (1 << wbit);\\\\n    } else {\\\\n      this.words[off] = this.words[off] & ~(1 << wbit);\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Add `num` to `this` in-place\\\\n  BN.prototype.iadd = function iadd (num) {\\\\n    var r;\\\\n\\\\n    // negative + positive\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      this.negative = 0;\\\\n      r = this.isub(num);\\\\n      this.negative ^= 1;\\\\n      return this._normSign();\\\\n\\\\n    // positive + negative\\\\n    } else if (this.negative === 0 && num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      r = this.isub(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n    }\\\\n\\\\n    // a.length > b.length\\\\n    var a, b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n    if (carry !== 0) {\\\\n      this.words[this.length] = carry;\\\\n      this.length++;\\\\n    // Copy the rest of the words\\\\n    } else if (a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Add `num` to `this`\\\\n  BN.prototype.add = function add (num) {\\\\n    var res;\\\\n    if (num.negative !== 0 && this.negative === 0) {\\\\n      num.negative = 0;\\\\n      res = this.sub(num);\\\\n      num.negative ^= 1;\\\\n      return res;\\\\n    } else if (num.negative === 0 && this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      res = num.sub(this);\\\\n      this.negative = 1;\\\\n      return res;\\\\n    }\\\\n\\\\n    if (this.length > num.length) return this.clone().iadd(num);\\\\n\\\\n    return num.clone().iadd(this);\\\\n  };\\\\n\\\\n  // Subtract `num` from `this` in-place\\\\n  BN.prototype.isub = function isub (num) {\\\\n    // this - (-num) = this + num\\\\n    if (num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      var r = this.iadd(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n\\\\n    // -this - num = -(this + num)\\\\n    } else if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iadd(num);\\\\n      this.negative = 1;\\\\n      return this._normSign();\\\\n    }\\\\n\\\\n    // At this point both numbers are positive\\\\n    var cmp = this.cmp(num);\\\\n\\\\n    // Optimization - zeroify\\\\n    if (cmp === 0) {\\\\n      this.negative = 0;\\\\n      this.length = 1;\\\\n      this.words[0] = 0;\\\\n      return this;\\\\n    }\\\\n\\\\n    // a > b\\\\n    var a, b;\\\\n    if (cmp > 0) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Copy rest of the words\\\\n    if (carry === 0 && i < a.length && a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = Math.max(this.length, i);\\\\n\\\\n    if (a !== this) {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Subtract `num` from `this`\\\\n  BN.prototype.sub = function sub (num) {\\\\n    return this.clone().isub(num);\\\\n  };\\\\n\\\\n  function smallMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    var len = (self.length + num.length) | 0;\\\\n    out.length = len;\\\\n    len = (len - 1) | 0;\\\\n\\\\n    // Peel one iteration (compiler can\'t do it, because of code complexity)\\\\n    var a = self.words[0] | 0;\\\\n    var b = num.words[0] | 0;\\\\n    var r = a * b;\\\\n\\\\n    var lo = r & 0x3ffffff;\\\\n    var carry = (r / 0x4000000) | 0;\\\\n    out.words[0] = lo;\\\\n\\\\n    for (var k = 1; k < len; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = carry >>> 26;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = (k - j) | 0;\\\\n        a = self.words[i] | 0;\\\\n        b = num.words[j] | 0;\\\\n        r = a * b + rword;\\\\n        ncarry += (r / 0x4000000) | 0;\\\\n        rword = r & 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword | 0;\\\\n      carry = ncarry | 0;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry | 0;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  // TODO(indutny): it may be reasonable to omit it for users who don\'t need\\\\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\\\\n  // multiplication (like elliptic secp256k1).\\\\n  var comb10MulTo = function comb10MulTo (self, num, out) {\\\\n    var a = self.words;\\\\n    var b = num.words;\\\\n    var o = out.words;\\\\n    var c = 0;\\\\n    var lo;\\\\n    var mid;\\\\n    var hi;\\\\n    var a0 = a[0] | 0;\\\\n    var al0 = a0 & 0x1fff;\\\\n    var ah0 = a0 >>> 13;\\\\n    var a1 = a[1] | 0;\\\\n    var al1 = a1 & 0x1fff;\\\\n    var ah1 = a1 >>> 13;\\\\n    var a2 = a[2] | 0;\\\\n    var al2 = a2 & 0x1fff;\\\\n    var ah2 = a2 >>> 13;\\\\n    var a3 = a[3] | 0;\\\\n    var al3 = a3 & 0x1fff;\\\\n    var ah3 = a3 >>> 13;\\\\n    var a4 = a[4] | 0;\\\\n    var al4 = a4 & 0x1fff;\\\\n    var ah4 = a4 >>> 13;\\\\n    var a5 = a[5] | 0;\\\\n    var al5 = a5 & 0x1fff;\\\\n    var ah5 = a5 >>> 13;\\\\n    var a6 = a[6] | 0;\\\\n    var al6 = a6 & 0x1fff;\\\\n    var ah6 = a6 >>> 13;\\\\n    var a7 = a[7] | 0;\\\\n    var al7 = a7 & 0x1fff;\\\\n    var ah7 = a7 >>> 13;\\\\n    var a8 = a[8] | 0;\\\\n    var al8 = a8 & 0x1fff;\\\\n    var ah8 = a8 >>> 13;\\\\n    var a9 = a[9] | 0;\\\\n    var al9 = a9 & 0x1fff;\\\\n    var ah9 = a9 >>> 13;\\\\n    var b0 = b[0] | 0;\\\\n    var bl0 = b0 & 0x1fff;\\\\n    var bh0 = b0 >>> 13;\\\\n    var b1 = b[1] | 0;\\\\n    var bl1 = b1 & 0x1fff;\\\\n    var bh1 = b1 >>> 13;\\\\n    var b2 = b[2] | 0;\\\\n    var bl2 = b2 & 0x1fff;\\\\n    var bh2 = b2 >>> 13;\\\\n    var b3 = b[3] | 0;\\\\n    var bl3 = b3 & 0x1fff;\\\\n    var bh3 = b3 >>> 13;\\\\n    var b4 = b[4] | 0;\\\\n    var bl4 = b4 & 0x1fff;\\\\n    var bh4 = b4 >>> 13;\\\\n    var b5 = b[5] | 0;\\\\n    var bl5 = b5 & 0x1fff;\\\\n    var bh5 = b5 >>> 13;\\\\n    var b6 = b[6] | 0;\\\\n    var bl6 = b6 & 0x1fff;\\\\n    var bh6 = b6 >>> 13;\\\\n    var b7 = b[7] | 0;\\\\n    var bl7 = b7 & 0x1fff;\\\\n    var bh7 = b7 >>> 13;\\\\n    var b8 = b[8] | 0;\\\\n    var bl8 = b8 & 0x1fff;\\\\n    var bh8 = b8 >>> 13;\\\\n    var b9 = b[9] | 0;\\\\n    var bl9 = b9 & 0x1fff;\\\\n    var bh9 = b9 >>> 13;\\\\n\\\\n    out.negative = self.negative ^ num.negative;\\\\n    out.length = 19;\\\\n    /* k = 0 */\\\\n    lo = Math.imul(al0, bl0);\\\\n    mid = Math.imul(al0, bh0);\\\\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\\\\n    hi = Math.imul(ah0, bh0);\\\\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\\\\n    w0 &= 0x3ffffff;\\\\n    /* k = 1 */\\\\n    lo = Math.imul(al1, bl0);\\\\n    mid = Math.imul(al1, bh0);\\\\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\\\\n    hi = Math.imul(ah1, bh0);\\\\n    lo = (lo + Math.imul(al0, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\\\\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\\\\n    w1 &= 0x3ffffff;\\\\n    /* k = 2 */\\\\n    lo = Math.imul(al2, bl0);\\\\n    mid = Math.imul(al2, bh0);\\\\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\\\\n    hi = Math.imul(ah2, bh0);\\\\n    lo = (lo + Math.imul(al1, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\\\\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\\\\n    w2 &= 0x3ffffff;\\\\n    /* k = 3 */\\\\n    lo = Math.imul(al3, bl0);\\\\n    mid = Math.imul(al3, bh0);\\\\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\\\\n    hi = Math.imul(ah3, bh0);\\\\n    lo = (lo + Math.imul(al2, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\\\\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\\\\n    w3 &= 0x3ffffff;\\\\n    /* k = 4 */\\\\n    lo = Math.imul(al4, bl0);\\\\n    mid = Math.imul(al4, bh0);\\\\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\\\\n    hi = Math.imul(ah4, bh0);\\\\n    lo = (lo + Math.imul(al3, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\\\\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\\\\n    w4 &= 0x3ffffff;\\\\n    /* k = 5 */\\\\n    lo = Math.imul(al5, bl0);\\\\n    mid = Math.imul(al5, bh0);\\\\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\\\\n    hi = Math.imul(ah5, bh0);\\\\n    lo = (lo + Math.imul(al4, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\\\\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\\\\n    w5 &= 0x3ffffff;\\\\n    /* k = 6 */\\\\n    lo = Math.imul(al6, bl0);\\\\n    mid = Math.imul(al6, bh0);\\\\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\\\\n    hi = Math.imul(ah6, bh0);\\\\n    lo = (lo + Math.imul(al5, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\\\\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\\\\n    w6 &= 0x3ffffff;\\\\n    /* k = 7 */\\\\n    lo = Math.imul(al7, bl0);\\\\n    mid = Math.imul(al7, bh0);\\\\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\\\\n    hi = Math.imul(ah7, bh0);\\\\n    lo = (lo + Math.imul(al6, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\\\\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\\\\n    w7 &= 0x3ffffff;\\\\n    /* k = 8 */\\\\n    lo = Math.imul(al8, bl0);\\\\n    mid = Math.imul(al8, bh0);\\\\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\\\\n    hi = Math.imul(ah8, bh0);\\\\n    lo = (lo + Math.imul(al7, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\\\\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\\\\n    w8 &= 0x3ffffff;\\\\n    /* k = 9 */\\\\n    lo = Math.imul(al9, bl0);\\\\n    mid = Math.imul(al9, bh0);\\\\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\\\\n    hi = Math.imul(ah9, bh0);\\\\n    lo = (lo + Math.imul(al8, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\\\\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\\\\n    w9 &= 0x3ffffff;\\\\n    /* k = 10 */\\\\n    lo = Math.imul(al9, bl1);\\\\n    mid = Math.imul(al9, bh1);\\\\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\\\\n    hi = Math.imul(ah9, bh1);\\\\n    lo = (lo + Math.imul(al8, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\\\\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\\\\n    w10 &= 0x3ffffff;\\\\n    /* k = 11 */\\\\n    lo = Math.imul(al9, bl2);\\\\n    mid = Math.imul(al9, bh2);\\\\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\\\\n    hi = Math.imul(ah9, bh2);\\\\n    lo = (lo + Math.imul(al8, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\\\\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\\\\n    w11 &= 0x3ffffff;\\\\n    /* k = 12 */\\\\n    lo = Math.imul(al9, bl3);\\\\n    mid = Math.imul(al9, bh3);\\\\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\\\\n    hi = Math.imul(ah9, bh3);\\\\n    lo = (lo + Math.imul(al8, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\\\\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\\\\n    w12 &= 0x3ffffff;\\\\n    /* k = 13 */\\\\n    lo = Math.imul(al9, bl4);\\\\n    mid = Math.imul(al9, bh4);\\\\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\\\\n    hi = Math.imul(ah9, bh4);\\\\n    lo = (lo + Math.imul(al8, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\\\\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\\\\n    w13 &= 0x3ffffff;\\\\n    /* k = 14 */\\\\n    lo = Math.imul(al9, bl5);\\\\n    mid = Math.imul(al9, bh5);\\\\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\\\\n    hi = Math.imul(ah9, bh5);\\\\n    lo = (lo + Math.imul(al8, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\\\\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\\\\n    w14 &= 0x3ffffff;\\\\n    /* k = 15 */\\\\n    lo = Math.imul(al9, bl6);\\\\n    mid = Math.imul(al9, bh6);\\\\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\\\\n    hi = Math.imul(ah9, bh6);\\\\n    lo = (lo + Math.imul(al8, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\\\\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\\\\n    w15 &= 0x3ffffff;\\\\n    /* k = 16 */\\\\n    lo = Math.imul(al9, bl7);\\\\n    mid = Math.imul(al9, bh7);\\\\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\\\\n    hi = Math.imul(ah9, bh7);\\\\n    lo = (lo + Math.imul(al8, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\\\\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\\\\n    w16 &= 0x3ffffff;\\\\n    /* k = 17 */\\\\n    lo = Math.imul(al9, bl8);\\\\n    mid = Math.imul(al9, bh8);\\\\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\\\\n    hi = Math.imul(ah9, bh8);\\\\n    lo = (lo + Math.imul(al8, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\\\\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\\\\n    w17 &= 0x3ffffff;\\\\n    /* k = 18 */\\\\n    lo = Math.imul(al9, bl9);\\\\n    mid = Math.imul(al9, bh9);\\\\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\\\\n    hi = Math.imul(ah9, bh9);\\\\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\\\\n    w18 &= 0x3ffffff;\\\\n    o[0] = w0;\\\\n    o[1] = w1;\\\\n    o[2] = w2;\\\\n    o[3] = w3;\\\\n    o[4] = w4;\\\\n    o[5] = w5;\\\\n    o[6] = w6;\\\\n    o[7] = w7;\\\\n    o[8] = w8;\\\\n    o[9] = w9;\\\\n    o[10] = w10;\\\\n    o[11] = w11;\\\\n    o[12] = w12;\\\\n    o[13] = w13;\\\\n    o[14] = w14;\\\\n    o[15] = w15;\\\\n    o[16] = w16;\\\\n    o[17] = w17;\\\\n    o[18] = w18;\\\\n    if (c !== 0) {\\\\n      o[19] = c;\\\\n      out.length++;\\\\n    }\\\\n    return out;\\\\n  };\\\\n\\\\n  // Polyfill comb\\\\n  if (!Math.imul) {\\\\n    comb10MulTo = smallMulTo;\\\\n  }\\\\n\\\\n  function bigMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    out.length = self.length + num.length;\\\\n\\\\n    var carry = 0;\\\\n    var hncarry = 0;\\\\n    for (var k = 0; k < out.length - 1; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = hncarry;\\\\n      hncarry = 0;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = k - j;\\\\n        var a = self.words[i] | 0;\\\\n        var b = num.words[j] | 0;\\\\n        var r = a * b;\\\\n\\\\n        var lo = r & 0x3ffffff;\\\\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\\\\n        lo = (lo + rword) | 0;\\\\n        rword = lo & 0x3ffffff;\\\\n        ncarry = (ncarry + (lo >>> 26)) | 0;\\\\n\\\\n        hncarry += ncarry >>> 26;\\\\n        ncarry &= 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword;\\\\n      carry = ncarry;\\\\n      ncarry = hncarry;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  function jumboMulTo (self, num, out) {\\\\n    var fftm = new FFTM();\\\\n    return fftm.mulp(self, num, out);\\\\n  }\\\\n\\\\n  BN.prototype.mulTo = function mulTo (num, out) {\\\\n    var res;\\\\n    var len = this.length + num.length;\\\\n    if (this.length === 10 && num.length === 10) {\\\\n      res = comb10MulTo(this, num, out);\\\\n    } else if (len < 63) {\\\\n      res = smallMulTo(this, num, out);\\\\n    } else if (len < 1024) {\\\\n      res = bigMulTo(this, num, out);\\\\n    } else {\\\\n      res = jumboMulTo(this, num, out);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Cooley-Tukey algorithm for FFT\\\\n  // slightly revisited to rely on looping instead of recursion\\\\n\\\\n  function FFTM (x, y) {\\\\n    this.x = x;\\\\n    this.y = y;\\\\n  }\\\\n\\\\n  FFTM.prototype.makeRBT = function makeRBT (N) {\\\\n    var t = new Array(N);\\\\n    var l = BN.prototype._countBits(N) - 1;\\\\n    for (var i = 0; i < N; i++) {\\\\n      t[i] = this.revBin(i, l, N);\\\\n    }\\\\n\\\\n    return t;\\\\n  };\\\\n\\\\n  // Returns binary-reversed representation of `x`\\\\n  FFTM.prototype.revBin = function revBin (x, l, N) {\\\\n    if (x === 0 || x === N - 1) return x;\\\\n\\\\n    var rb = 0;\\\\n    for (var i = 0; i < l; i++) {\\\\n      rb |= (x & 1) << (l - i - 1);\\\\n      x >>= 1;\\\\n    }\\\\n\\\\n    return rb;\\\\n  };\\\\n\\\\n  // Performs \\\\\\"tweedling\\\\\\" phase, therefore \'emulating\'\\\\n  // behaviour of the recursive algorithm\\\\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\\\\n    for (var i = 0; i < N; i++) {\\\\n      rtws[i] = rws[rbt[i]];\\\\n      itws[i] = iws[rbt[i]];\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\\\\n    this.permute(rbt, rws, iws, rtws, itws, N);\\\\n\\\\n    for (var s = 1; s < N; s <<= 1) {\\\\n      var l = s << 1;\\\\n\\\\n      var rtwdf = Math.cos(2 * Math.PI / l);\\\\n      var itwdf = Math.sin(2 * Math.PI / l);\\\\n\\\\n      for (var p = 0; p < N; p += l) {\\\\n        var rtwdf_ = rtwdf;\\\\n        var itwdf_ = itwdf;\\\\n\\\\n        for (var j = 0; j < s; j++) {\\\\n          var re = rtws[p + j];\\\\n          var ie = itws[p + j];\\\\n\\\\n          var ro = rtws[p + j + s];\\\\n          var io = itws[p + j + s];\\\\n\\\\n          var rx = rtwdf_ * ro - itwdf_ * io;\\\\n\\\\n          io = rtwdf_ * io + itwdf_ * ro;\\\\n          ro = rx;\\\\n\\\\n          rtws[p + j] = re + ro;\\\\n          itws[p + j] = ie + io;\\\\n\\\\n          rtws[p + j + s] = re - ro;\\\\n          itws[p + j + s] = ie - io;\\\\n\\\\n          /* jshint maxdepth : false */\\\\n          if (j !== l) {\\\\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\\\\n\\\\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\\\\n            rtwdf_ = rx;\\\\n          }\\\\n        }\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\\\\n    var N = Math.max(m, n) | 1;\\\\n    var odd = N & 1;\\\\n    var i = 0;\\\\n    for (N = N / 2 | 0; N; N = N >>> 1) {\\\\n      i++;\\\\n    }\\\\n\\\\n    return 1 << i + 1 + odd;\\\\n  };\\\\n\\\\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\\\\n    if (N <= 1) return;\\\\n\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var t = rws[i];\\\\n\\\\n      rws[i] = rws[N - i - 1];\\\\n      rws[N - i - 1] = t;\\\\n\\\\n      t = iws[i];\\\\n\\\\n      iws[i] = -iws[N - i - 1];\\\\n      iws[N - i - 1] = -t;\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\\\\n        Math.round(ws[2 * i] / N) +\\\\n        carry;\\\\n\\\\n      ws[i] = w & 0x3ffffff;\\\\n\\\\n      if (w < 0x4000000) {\\\\n        carry = 0;\\\\n      } else {\\\\n        carry = w / 0x4000000 | 0;\\\\n      }\\\\n    }\\\\n\\\\n    return ws;\\\\n  };\\\\n\\\\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < len; i++) {\\\\n      carry = carry + (ws[i] | 0);\\\\n\\\\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\\\\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\\\\n    }\\\\n\\\\n    // Pad with zeroes\\\\n    for (i = 2 * len; i < N; ++i) {\\\\n      rws[i] = 0;\\\\n    }\\\\n\\\\n    assert(carry === 0);\\\\n    assert((carry & ~0x1fff) === 0);\\\\n  };\\\\n\\\\n  FFTM.prototype.stub = function stub (N) {\\\\n    var ph = new Array(N);\\\\n    for (var i = 0; i < N; i++) {\\\\n      ph[i] = 0;\\\\n    }\\\\n\\\\n    return ph;\\\\n  };\\\\n\\\\n  FFTM.prototype.mulp = function mulp (x, y, out) {\\\\n    var N = 2 * this.guessLen13b(x.length, y.length);\\\\n\\\\n    var rbt = this.makeRBT(N);\\\\n\\\\n    var _ = this.stub(N);\\\\n\\\\n    var rws = new Array(N);\\\\n    var rwst = new Array(N);\\\\n    var iwst = new Array(N);\\\\n\\\\n    var nrws = new Array(N);\\\\n    var nrwst = new Array(N);\\\\n    var niwst = new Array(N);\\\\n\\\\n    var rmws = out.words;\\\\n    rmws.length = N;\\\\n\\\\n    this.convert13b(x.words, x.length, rws, N);\\\\n    this.convert13b(y.words, y.length, nrws, N);\\\\n\\\\n    this.transform(rws, _, rwst, iwst, N, rbt);\\\\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\\\\n\\\\n    for (var i = 0; i < N; i++) {\\\\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\\\\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\\\\n      rwst[i] = rx;\\\\n    }\\\\n\\\\n    this.conjugate(rwst, iwst, N);\\\\n    this.transform(rwst, iwst, rmws, _, N, rbt);\\\\n    this.conjugate(rmws, _, N);\\\\n    this.normalize13b(rmws, N);\\\\n\\\\n    out.negative = x.negative ^ y.negative;\\\\n    out.length = x.length + y.length;\\\\n    return out.strip();\\\\n  };\\\\n\\\\n  // Multiply `this` by `num`\\\\n  BN.prototype.mul = function mul (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return this.mulTo(num, out);\\\\n  };\\\\n\\\\n  // Multiply employing FFT\\\\n  BN.prototype.mulf = function mulf (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return jumboMulTo(this, num, out);\\\\n  };\\\\n\\\\n  // In-place Multiplication\\\\n  BN.prototype.imul = function imul (num) {\\\\n    return this.clone().mulTo(num, this);\\\\n  };\\\\n\\\\n  BN.prototype.imuln = function imuln (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n\\\\n    // Carry\\\\n    var carry = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var w = (this.words[i] | 0) * num;\\\\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\\\\n      carry >>= 26;\\\\n      carry += (w / 0x4000000) | 0;\\\\n      // NOTE: lo is 27bit maximum\\\\n      carry += lo >>> 26;\\\\n      this.words[i] = lo & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.muln = function muln (num) {\\\\n    return this.clone().imuln(num);\\\\n  };\\\\n\\\\n  // `this` * `this`\\\\n  BN.prototype.sqr = function sqr () {\\\\n    return this.mul(this);\\\\n  };\\\\n\\\\n  // `this` * `this` in-place\\\\n  BN.prototype.isqr = function isqr () {\\\\n    return this.imul(this.clone());\\\\n  };\\\\n\\\\n  // Math.pow(`this`, `num`)\\\\n  BN.prototype.pow = function pow (num) {\\\\n    var w = toBitArray(num);\\\\n    if (w.length === 0) return new BN(1);\\\\n\\\\n    // Skip leading zeroes\\\\n    var res = this;\\\\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\\\\n      if (w[i] !== 0) break;\\\\n    }\\\\n\\\\n    if (++i < w.length) {\\\\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\\\\n        if (w[i] === 0) continue;\\\\n\\\\n        res = res.mul(q);\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Shift-left in-place\\\\n  BN.prototype.iushln = function iushln (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\\\\n    var i;\\\\n\\\\n    if (r !== 0) {\\\\n      var carry = 0;\\\\n\\\\n      for (i = 0; i < this.length; i++) {\\\\n        var newCarry = this.words[i] & carryMask;\\\\n        var c = ((this.words[i] | 0) - newCarry) << r;\\\\n        this.words[i] = c | carry;\\\\n        carry = newCarry >>> (26 - r);\\\\n      }\\\\n\\\\n      if (carry) {\\\\n        this.words[i] = carry;\\\\n        this.length++;\\\\n      }\\\\n    }\\\\n\\\\n    if (s !== 0) {\\\\n      for (i = this.length - 1; i >= 0; i--) {\\\\n        this.words[i + s] = this.words[i];\\\\n      }\\\\n\\\\n      for (i = 0; i < s; i++) {\\\\n        this.words[i] = 0;\\\\n      }\\\\n\\\\n      this.length += s;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishln = function ishln (bits) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right in-place\\\\n  // NOTE: `hint` is a lowest bit before trailing zeroes\\\\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\\\\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var h;\\\\n    if (hint) {\\\\n      h = (hint - (hint % 26)) / 26;\\\\n    } else {\\\\n      h = 0;\\\\n    }\\\\n\\\\n    var r = bits % 26;\\\\n    var s = Math.min((bits - r) / 26, this.length);\\\\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n    var maskedWords = extended;\\\\n\\\\n    h -= s;\\\\n    h = Math.max(0, h);\\\\n\\\\n    // Extended mode, copy masked part\\\\n    if (maskedWords) {\\\\n      for (var i = 0; i < s; i++) {\\\\n        maskedWords.words[i] = this.words[i];\\\\n      }\\\\n      maskedWords.length = s;\\\\n    }\\\\n\\\\n    if (s === 0) {\\\\n      // No-op, we should not move anything at all\\\\n    } else if (this.length > s) {\\\\n      this.length -= s;\\\\n      for (i = 0; i < this.length; i++) {\\\\n        this.words[i] = this.words[i + s];\\\\n      }\\\\n    } else {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\\\\n      var word = this.words[i] | 0;\\\\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\\\\n      carry = word & mask;\\\\n    }\\\\n\\\\n    // Push carried bits as a mask\\\\n    if (maskedWords && carry !== 0) {\\\\n      maskedWords.words[maskedWords.length++] = carry;\\\\n    }\\\\n\\\\n    if (this.length === 0) {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushrn(bits, hint, extended);\\\\n  };\\\\n\\\\n  // Shift-left\\\\n  BN.prototype.shln = function shln (bits) {\\\\n    return this.clone().ishln(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushln = function ushln (bits) {\\\\n    return this.clone().iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right\\\\n  BN.prototype.shrn = function shrn (bits) {\\\\n    return this.clone().ishrn(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushrn = function ushrn (bits) {\\\\n    return this.clone().iushrn(bits);\\\\n  };\\\\n\\\\n  // Test if n bit is set\\\\n  BN.prototype.testn = function testn (bit) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) return false;\\\\n\\\\n    // Check bit and return\\\\n    var w = this.words[s];\\\\n\\\\n    return !!(w & q);\\\\n  };\\\\n\\\\n  // Return only lowers bits of number (in-place)\\\\n  BN.prototype.imaskn = function imaskn (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n\\\\n    assert(this.negative === 0, \'imaskn works only with positive numbers\');\\\\n\\\\n    if (this.length <= s) {\\\\n      return this;\\\\n    }\\\\n\\\\n    if (r !== 0) {\\\\n      s++;\\\\n    }\\\\n    this.length = Math.min(s, this.length);\\\\n\\\\n    if (r !== 0) {\\\\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n      this.words[this.length - 1] &= mask;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Return only lowers bits of number\\\\n  BN.prototype.maskn = function maskn (bits) {\\\\n    return this.clone().imaskn(bits);\\\\n  };\\\\n\\\\n  // Add plain number `num` to `this`\\\\n  BN.prototype.iaddn = function iaddn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.isubn(-num);\\\\n\\\\n    // Possible sign change\\\\n    if (this.negative !== 0) {\\\\n      if (this.length === 1 && (this.words[0] | 0) < num) {\\\\n        this.words[0] = num - (this.words[0] | 0);\\\\n        this.negative = 0;\\\\n        return this;\\\\n      }\\\\n\\\\n      this.negative = 0;\\\\n      this.isubn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add without checks\\\\n    return this._iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype._iaddn = function _iaddn (num) {\\\\n    this.words[0] += num;\\\\n\\\\n    // Carry\\\\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\\\\n      this.words[i] -= 0x4000000;\\\\n      if (i === this.length - 1) {\\\\n        this.words[i + 1] = 1;\\\\n      } else {\\\\n        this.words[i + 1]++;\\\\n      }\\\\n    }\\\\n    this.length = Math.max(this.length, i + 1);\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Subtract plain number `num` from `this`\\\\n  BN.prototype.isubn = function isubn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.iaddn(-num);\\\\n\\\\n    if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iaddn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.words[0] -= num;\\\\n\\\\n    if (this.length === 1 && this.words[0] < 0) {\\\\n      this.words[0] = -this.words[0];\\\\n      this.negative = 1;\\\\n    } else {\\\\n      // Carry\\\\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\\\\n        this.words[i] += 0x4000000;\\\\n        this.words[i + 1] -= 1;\\\\n      }\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.addn = function addn (num) {\\\\n    return this.clone().iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype.subn = function subn (num) {\\\\n    return this.clone().isubn(num);\\\\n  };\\\\n\\\\n  BN.prototype.iabs = function iabs () {\\\\n    this.negative = 0;\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.abs = function abs () {\\\\n    return this.clone().iabs();\\\\n  };\\\\n\\\\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\\\\n    var len = num.length + shift;\\\\n    var i;\\\\n\\\\n    this._expand(len);\\\\n\\\\n    var w;\\\\n    var carry = 0;\\\\n    for (i = 0; i < num.length; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      var right = (num.words[i] | 0) * mul;\\\\n      w -= right & 0x3ffffff;\\\\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n    for (; i < this.length - shift; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry === 0) return this.strip();\\\\n\\\\n    // Subtraction overflow\\\\n    assert(carry === -1);\\\\n    carry = 0;\\\\n    for (i = 0; i < this.length; i++) {\\\\n      w = -(this.words[i] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i] = w & 0x3ffffff;\\\\n    }\\\\n    this.negative = 1;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\\\\n    var shift = this.length - num.length;\\\\n\\\\n    var a = this.clone();\\\\n    var b = num;\\\\n\\\\n    // Normalize\\\\n    var bhi = b.words[b.length - 1] | 0;\\\\n    var bhiBits = this._countBits(bhi);\\\\n    shift = 26 - bhiBits;\\\\n    if (shift !== 0) {\\\\n      b = b.ushln(shift);\\\\n      a.iushln(shift);\\\\n      bhi = b.words[b.length - 1] | 0;\\\\n    }\\\\n\\\\n    // Initialize quotient\\\\n    var m = a.length - b.length;\\\\n    var q;\\\\n\\\\n    if (mode !== \'mod\') {\\\\n      q = new BN(null);\\\\n      q.length = m + 1;\\\\n      q.words = new Array(q.length);\\\\n      for (var i = 0; i < q.length; i++) {\\\\n        q.words[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\\\\n    if (diff.negative === 0) {\\\\n      a = diff;\\\\n      if (q) {\\\\n        q.words[m] = 1;\\\\n      }\\\\n    }\\\\n\\\\n    for (var j = m - 1; j >= 0; j--) {\\\\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\\\\n        (a.words[b.length + j - 1] | 0);\\\\n\\\\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\\\\n      // (0x7ffffff)\\\\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\\\\n\\\\n      a._ishlnsubmul(b, qj, j);\\\\n      while (a.negative !== 0) {\\\\n        qj--;\\\\n        a.negative = 0;\\\\n        a._ishlnsubmul(b, 1, j);\\\\n        if (!a.isZero()) {\\\\n          a.negative ^= 1;\\\\n        }\\\\n      }\\\\n      if (q) {\\\\n        q.words[j] = qj;\\\\n      }\\\\n    }\\\\n    if (q) {\\\\n      q.strip();\\\\n    }\\\\n    a.strip();\\\\n\\\\n    // Denormalize\\\\n    if (mode !== \'div\' && shift !== 0) {\\\\n      a.iushrn(shift);\\\\n    }\\\\n\\\\n    return {\\\\n      div: q || null,\\\\n      mod: a\\\\n    };\\\\n  };\\\\n\\\\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\\\\n  //       to `div` to request div only, or be absent to\\\\n  //       request both div & mod\\\\n  //       2) `positive` is true if unsigned mod is requested\\\\n  BN.prototype.divmod = function divmod (num, mode, positive) {\\\\n    assert(!num.isZero());\\\\n\\\\n    if (this.isZero()) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: new BN(0)\\\\n      };\\\\n    }\\\\n\\\\n    var div, mod, res;\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      res = this.neg().divmod(num, mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.iadd(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    if (this.negative === 0 && num.negative !== 0) {\\\\n      res = this.divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: res.mod\\\\n      };\\\\n    }\\\\n\\\\n    if ((this.negative & num.negative) !== 0) {\\\\n      res = this.neg().divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.isub(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: res.div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    // Both numbers are positive at this point\\\\n\\\\n    // Strip both numbers to approximate shift value\\\\n    if (num.length > this.length || this.cmp(num) < 0) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: this\\\\n      };\\\\n    }\\\\n\\\\n    // Very short reduction\\\\n    if (num.length === 1) {\\\\n      if (mode === \'div\') {\\\\n        return {\\\\n          div: this.divn(num.words[0]),\\\\n          mod: null\\\\n        };\\\\n      }\\\\n\\\\n      if (mode === \'mod\') {\\\\n        return {\\\\n          div: null,\\\\n          mod: new BN(this.modn(num.words[0]))\\\\n        };\\\\n      }\\\\n\\\\n      return {\\\\n        div: this.divn(num.words[0]),\\\\n        mod: new BN(this.modn(num.words[0]))\\\\n      };\\\\n    }\\\\n\\\\n    return this._wordDiv(num, mode);\\\\n  };\\\\n\\\\n  // Find `this` / `num`\\\\n  BN.prototype.div = function div (num) {\\\\n    return this.divmod(num, \'div\', false).div;\\\\n  };\\\\n\\\\n  // Find `this` % `num`\\\\n  BN.prototype.mod = function mod (num) {\\\\n    return this.divmod(num, \'mod\', false).mod;\\\\n  };\\\\n\\\\n  BN.prototype.umod = function umod (num) {\\\\n    return this.divmod(num, \'mod\', true).mod;\\\\n  };\\\\n\\\\n  // Find Round(`this` / `num`)\\\\n  BN.prototype.divRound = function divRound (num) {\\\\n    var dm = this.divmod(num);\\\\n\\\\n    // Fast case - exact division\\\\n    if (dm.mod.isZero()) return dm.div;\\\\n\\\\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\\\\n\\\\n    var half = num.ushrn(1);\\\\n    var r2 = num.andln(1);\\\\n    var cmp = mod.cmp(half);\\\\n\\\\n    // Round down\\\\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\\\\n\\\\n    // Round up\\\\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\\\\n  };\\\\n\\\\n  BN.prototype.modn = function modn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n    var p = (1 << 26) % num;\\\\n\\\\n    var acc = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      acc = (p * acc + (this.words[i] | 0)) % num;\\\\n    }\\\\n\\\\n    return acc;\\\\n  };\\\\n\\\\n  // In-place division by number\\\\n  BN.prototype.idivn = function idivn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n\\\\n    var carry = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var w = (this.words[i] | 0) + carry * 0x4000000;\\\\n      this.words[i] = (w / num) | 0;\\\\n      carry = w % num;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.divn = function divn (num) {\\\\n    return this.clone().idivn(num);\\\\n  };\\\\n\\\\n  BN.prototype.egcd = function egcd (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var x = this;\\\\n    var y = p.clone();\\\\n\\\\n    if (x.negative !== 0) {\\\\n      x = x.umod(p);\\\\n    } else {\\\\n      x = x.clone();\\\\n    }\\\\n\\\\n    // A * x + B * y = x\\\\n    var A = new BN(1);\\\\n    var B = new BN(0);\\\\n\\\\n    // C * x + D * y = y\\\\n    var C = new BN(0);\\\\n    var D = new BN(1);\\\\n\\\\n    var g = 0;\\\\n\\\\n    while (x.isEven() && y.isEven()) {\\\\n      x.iushrn(1);\\\\n      y.iushrn(1);\\\\n      ++g;\\\\n    }\\\\n\\\\n    var yp = y.clone();\\\\n    var xp = x.clone();\\\\n\\\\n    while (!x.isZero()) {\\\\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        x.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (A.isOdd() || B.isOdd()) {\\\\n            A.iadd(yp);\\\\n            B.isub(xp);\\\\n          }\\\\n\\\\n          A.iushrn(1);\\\\n          B.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        y.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (C.isOdd() || D.isOdd()) {\\\\n            C.iadd(yp);\\\\n            D.isub(xp);\\\\n          }\\\\n\\\\n          C.iushrn(1);\\\\n          D.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (x.cmp(y) >= 0) {\\\\n        x.isub(y);\\\\n        A.isub(C);\\\\n        B.isub(D);\\\\n      } else {\\\\n        y.isub(x);\\\\n        C.isub(A);\\\\n        D.isub(B);\\\\n      }\\\\n    }\\\\n\\\\n    return {\\\\n      a: C,\\\\n      b: D,\\\\n      gcd: y.iushln(g)\\\\n    };\\\\n  };\\\\n\\\\n  // This is reduced incarnation of the binary EEA\\\\n  // above, designated to invert members of the\\\\n  // _prime_ fields F(p) at a maximal speed\\\\n  BN.prototype._invmp = function _invmp (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var a = this;\\\\n    var b = p.clone();\\\\n\\\\n    if (a.negative !== 0) {\\\\n      a = a.umod(p);\\\\n    } else {\\\\n      a = a.clone();\\\\n    }\\\\n\\\\n    var x1 = new BN(1);\\\\n    var x2 = new BN(0);\\\\n\\\\n    var delta = b.clone();\\\\n\\\\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\\\\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        a.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (x1.isOdd()) {\\\\n            x1.iadd(delta);\\\\n          }\\\\n\\\\n          x1.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        b.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (x2.isOdd()) {\\\\n            x2.iadd(delta);\\\\n          }\\\\n\\\\n          x2.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (a.cmp(b) >= 0) {\\\\n        a.isub(b);\\\\n        x1.isub(x2);\\\\n      } else {\\\\n        b.isub(a);\\\\n        x2.isub(x1);\\\\n      }\\\\n    }\\\\n\\\\n    var res;\\\\n    if (a.cmpn(1) === 0) {\\\\n      res = x1;\\\\n    } else {\\\\n      res = x2;\\\\n    }\\\\n\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(p);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gcd = function gcd (num) {\\\\n    if (this.isZero()) return num.abs();\\\\n    if (num.isZero()) return this.abs();\\\\n\\\\n    var a = this.clone();\\\\n    var b = num.clone();\\\\n    a.negative = 0;\\\\n    b.negative = 0;\\\\n\\\\n    // Remove common factor of two\\\\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\\\\n      a.iushrn(1);\\\\n      b.iushrn(1);\\\\n    }\\\\n\\\\n    do {\\\\n      while (a.isEven()) {\\\\n        a.iushrn(1);\\\\n      }\\\\n      while (b.isEven()) {\\\\n        b.iushrn(1);\\\\n      }\\\\n\\\\n      var r = a.cmp(b);\\\\n      if (r < 0) {\\\\n        // Swap `a` and `b` to make `a` always bigger than `b`\\\\n        var t = a;\\\\n        a = b;\\\\n        b = t;\\\\n      } else if (r === 0 || b.cmpn(1) === 0) {\\\\n        break;\\\\n      }\\\\n\\\\n      a.isub(b);\\\\n    } while (true);\\\\n\\\\n    return b.iushln(shift);\\\\n  };\\\\n\\\\n  // Invert number in the field F(num)\\\\n  BN.prototype.invm = function invm (num) {\\\\n    return this.egcd(num).a.umod(num);\\\\n  };\\\\n\\\\n  BN.prototype.isEven = function isEven () {\\\\n    return (this.words[0] & 1) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.isOdd = function isOdd () {\\\\n    return (this.words[0] & 1) === 1;\\\\n  };\\\\n\\\\n  // And first word and num\\\\n  BN.prototype.andln = function andln (num) {\\\\n    return this.words[0] & num;\\\\n  };\\\\n\\\\n  // Increment at the bit position in-line\\\\n  BN.prototype.bincn = function bincn (bit) {\\\\n    assert(typeof bit === \'number\');\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) {\\\\n      this._expand(s + 1);\\\\n      this.words[s] |= q;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add bit and propagate, if needed\\\\n    var carry = q;\\\\n    for (var i = s; carry !== 0 && i < this.length; i++) {\\\\n      var w = this.words[i] | 0;\\\\n      w += carry;\\\\n      carry = w >>> 26;\\\\n      w &= 0x3ffffff;\\\\n      this.words[i] = w;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.isZero = function isZero () {\\\\n    return this.length === 1 && this.words[0] === 0;\\\\n  };\\\\n\\\\n  BN.prototype.cmpn = function cmpn (num) {\\\\n    var negative = num < 0;\\\\n\\\\n    if (this.negative !== 0 && !negative) return -1;\\\\n    if (this.negative === 0 && negative) return 1;\\\\n\\\\n    this.strip();\\\\n\\\\n    var res;\\\\n    if (this.length > 1) {\\\\n      res = 1;\\\\n    } else {\\\\n      if (negative) {\\\\n        num = -num;\\\\n      }\\\\n\\\\n      assert(num <= 0x3ffffff, \'Number is too big\');\\\\n\\\\n      var w = this.words[0] | 0;\\\\n      res = w === num ? 0 : w < num ? -1 : 1;\\\\n    }\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Compare two numbers and return:\\\\n  // 1 - if `this` > `num`\\\\n  // 0 - if `this` == `num`\\\\n  // -1 - if `this` < `num`\\\\n  BN.prototype.cmp = function cmp (num) {\\\\n    if (this.negative !== 0 && num.negative === 0) return -1;\\\\n    if (this.negative === 0 && num.negative !== 0) return 1;\\\\n\\\\n    var res = this.ucmp(num);\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Unsigned comparison\\\\n  BN.prototype.ucmp = function ucmp (num) {\\\\n    // At this point both numbers have the same sign\\\\n    if (this.length > num.length) return 1;\\\\n    if (this.length < num.length) return -1;\\\\n\\\\n    var res = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var a = this.words[i] | 0;\\\\n      var b = num.words[i] | 0;\\\\n\\\\n      if (a === b) continue;\\\\n      if (a < b) {\\\\n        res = -1;\\\\n      } else if (a > b) {\\\\n        res = 1;\\\\n      }\\\\n      break;\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gtn = function gtn (num) {\\\\n    return this.cmpn(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gt = function gt (num) {\\\\n    return this.cmp(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gten = function gten (num) {\\\\n    return this.cmpn(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.gte = function gte (num) {\\\\n    return this.cmp(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.ltn = function ltn (num) {\\\\n    return this.cmpn(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lt = function lt (num) {\\\\n    return this.cmp(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lten = function lten (num) {\\\\n    return this.cmpn(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.lte = function lte (num) {\\\\n    return this.cmp(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.eqn = function eqn (num) {\\\\n    return this.cmpn(num) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.eq = function eq (num) {\\\\n    return this.cmp(num) === 0;\\\\n  };\\\\n\\\\n  //\\\\n  // A reduce context, could be using montgomery or something better, depending\\\\n  // on the `m` itself.\\\\n  //\\\\n  BN.red = function red (num) {\\\\n    return new Red(num);\\\\n  };\\\\n\\\\n  BN.prototype.toRed = function toRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    assert(this.negative === 0, \'red works only with positives\');\\\\n    return ctx.convertTo(this)._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.fromRed = function fromRed () {\\\\n    assert(this.red, \'fromRed works only with numbers in reduction context\');\\\\n    return this.red.convertFrom(this);\\\\n  };\\\\n\\\\n  BN.prototype._forceRed = function _forceRed (ctx) {\\\\n    this.red = ctx;\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.forceRed = function forceRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    return this._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.redAdd = function redAdd (num) {\\\\n    assert(this.red, \'redAdd works only with red numbers\');\\\\n    return this.red.add(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIAdd = function redIAdd (num) {\\\\n    assert(this.red, \'redIAdd works only with red numbers\');\\\\n    return this.red.iadd(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSub = function redSub (num) {\\\\n    assert(this.red, \'redSub works only with red numbers\');\\\\n    return this.red.sub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redISub = function redISub (num) {\\\\n    assert(this.red, \'redISub works only with red numbers\');\\\\n    return this.red.isub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redShl = function redShl (num) {\\\\n    assert(this.red, \'redShl works only with red numbers\');\\\\n    return this.red.shl(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redMul = function redMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.mul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIMul = function redIMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.imul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSqr = function redSqr () {\\\\n    assert(this.red, \'redSqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqr(this);\\\\n  };\\\\n\\\\n  BN.prototype.redISqr = function redISqr () {\\\\n    assert(this.red, \'redISqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.isqr(this);\\\\n  };\\\\n\\\\n  // Square root over p\\\\n  BN.prototype.redSqrt = function redSqrt () {\\\\n    assert(this.red, \'redSqrt works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqrt(this);\\\\n  };\\\\n\\\\n  BN.prototype.redInvm = function redInvm () {\\\\n    assert(this.red, \'redInvm works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.invm(this);\\\\n  };\\\\n\\\\n  // Return negative clone of `this` % `red modulo`\\\\n  BN.prototype.redNeg = function redNeg () {\\\\n    assert(this.red, \'redNeg works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.neg(this);\\\\n  };\\\\n\\\\n  BN.prototype.redPow = function redPow (num) {\\\\n    assert(this.red && !num.red, \'redPow(normalNum)\');\\\\n    this.red._verify1(this);\\\\n    return this.red.pow(this, num);\\\\n  };\\\\n\\\\n  // Prime numbers with efficient reduction\\\\n  var primes = {\\\\n    k256: null,\\\\n    p224: null,\\\\n    p192: null,\\\\n    p25519: null\\\\n  };\\\\n\\\\n  // Pseudo-Mersenne prime\\\\n  function MPrime (name, p) {\\\\n    // P = 2 ^ N - K\\\\n    this.name = name;\\\\n    this.p = new BN(p, 16);\\\\n    this.n = this.p.bitLength();\\\\n    this.k = new BN(1).iushln(this.n).isub(this.p);\\\\n\\\\n    this.tmp = this._tmp();\\\\n  }\\\\n\\\\n  MPrime.prototype._tmp = function _tmp () {\\\\n    var tmp = new BN(null);\\\\n    tmp.words = new Array(Math.ceil(this.n / 13));\\\\n    return tmp;\\\\n  };\\\\n\\\\n  MPrime.prototype.ireduce = function ireduce (num) {\\\\n    // Assumes that `num` is less than `P^2`\\\\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\\\\n    var r = num;\\\\n    var rlen;\\\\n\\\\n    do {\\\\n      this.split(r, this.tmp);\\\\n      r = this.imulK(r);\\\\n      r = r.iadd(this.tmp);\\\\n      rlen = r.bitLength();\\\\n    } while (rlen > this.n);\\\\n\\\\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\\\\n    if (cmp === 0) {\\\\n      r.words[0] = 0;\\\\n      r.length = 1;\\\\n    } else if (cmp > 0) {\\\\n      r.isub(this.p);\\\\n    } else {\\\\n      r.strip();\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  MPrime.prototype.split = function split (input, out) {\\\\n    input.iushrn(this.n, 0, out);\\\\n  };\\\\n\\\\n  MPrime.prototype.imulK = function imulK (num) {\\\\n    return num.imul(this.k);\\\\n  };\\\\n\\\\n  function K256 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'k256\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\');\\\\n  }\\\\n  inherits(K256, MPrime);\\\\n\\\\n  K256.prototype.split = function split (input, output) {\\\\n    // 256 = 9 * 26 + 22\\\\n    var mask = 0x3fffff;\\\\n\\\\n    var outLen = Math.min(input.length, 9);\\\\n    for (var i = 0; i < outLen; i++) {\\\\n      output.words[i] = input.words[i];\\\\n    }\\\\n    output.length = outLen;\\\\n\\\\n    if (input.length <= 9) {\\\\n      input.words[0] = 0;\\\\n      input.length = 1;\\\\n      return;\\\\n    }\\\\n\\\\n    // Shift by 9 limbs\\\\n    var prev = input.words[9];\\\\n    output.words[output.length++] = prev & mask;\\\\n\\\\n    for (i = 10; i < input.length; i++) {\\\\n      var next = input.words[i] | 0;\\\\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\\\\n      prev = next;\\\\n    }\\\\n    prev >>>= 22;\\\\n    input.words[i - 10] = prev;\\\\n    if (prev === 0 && input.length > 10) {\\\\n      input.length -= 10;\\\\n    } else {\\\\n      input.length -= 9;\\\\n    }\\\\n  };\\\\n\\\\n  K256.prototype.imulK = function imulK (num) {\\\\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\\\\n    num.words[num.length] = 0;\\\\n    num.words[num.length + 1] = 0;\\\\n    num.length += 2;\\\\n\\\\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\\\\n    var lo = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var w = num.words[i] | 0;\\\\n      lo += w * 0x3d1;\\\\n      num.words[i] = lo & 0x3ffffff;\\\\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\\\\n    }\\\\n\\\\n    // Fast length reduction\\\\n    if (num.words[num.length - 1] === 0) {\\\\n      num.length--;\\\\n      if (num.words[num.length - 1] === 0) {\\\\n        num.length--;\\\\n      }\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  function P224 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p224\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\');\\\\n  }\\\\n  inherits(P224, MPrime);\\\\n\\\\n  function P192 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p192\',\\\\n      \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\');\\\\n  }\\\\n  inherits(P192, MPrime);\\\\n\\\\n  function P25519 () {\\\\n    // 2 ^ 255 - 19\\\\n    MPrime.call(\\\\n      this,\\\\n      \'25519\',\\\\n      \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\');\\\\n  }\\\\n  inherits(P25519, MPrime);\\\\n\\\\n  P25519.prototype.imulK = function imulK (num) {\\\\n    // K = 0x13\\\\n    var carry = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var hi = (num.words[i] | 0) * 0x13 + carry;\\\\n      var lo = hi & 0x3ffffff;\\\\n      hi >>>= 26;\\\\n\\\\n      num.words[i] = lo;\\\\n      carry = hi;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      num.words[num.length++] = carry;\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  // Exported mostly for testing purposes, use plain name instead\\\\n  BN._prime = function prime (name) {\\\\n    // Cached version of prime\\\\n    if (primes[name]) return primes[name];\\\\n\\\\n    var prime;\\\\n    if (name === \'k256\') {\\\\n      prime = new K256();\\\\n    } else if (name === \'p224\') {\\\\n      prime = new P224();\\\\n    } else if (name === \'p192\') {\\\\n      prime = new P192();\\\\n    } else if (name === \'p25519\') {\\\\n      prime = new P25519();\\\\n    } else {\\\\n      throw new Error(\'Unknown prime \' + name);\\\\n    }\\\\n    primes[name] = prime;\\\\n\\\\n    return prime;\\\\n  };\\\\n\\\\n  //\\\\n  // Base reduction engine\\\\n  //\\\\n  function Red (m) {\\\\n    if (typeof m === \'string\') {\\\\n      var prime = BN._prime(m);\\\\n      this.m = prime.p;\\\\n      this.prime = prime;\\\\n    } else {\\\\n      assert(m.gtn(1), \'modulus must be greater than 1\');\\\\n      this.m = m;\\\\n      this.prime = null;\\\\n    }\\\\n  }\\\\n\\\\n  Red.prototype._verify1 = function _verify1 (a) {\\\\n    assert(a.negative === 0, \'red works only with positives\');\\\\n    assert(a.red, \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype._verify2 = function _verify2 (a, b) {\\\\n    assert((a.negative | b.negative) === 0, \'red works only with positives\');\\\\n    assert(a.red && a.red === b.red,\\\\n      \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype.imod = function imod (a) {\\\\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\\\\n    return a.umod(this.m)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.neg = function neg (a) {\\\\n    if (a.isZero()) {\\\\n      return a.clone();\\\\n    }\\\\n\\\\n    return this.m.sub(a)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.add = function add (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.add(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.iadd = function iadd (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.iadd(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.sub = function sub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.sub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.isub = function isub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.isub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.shl = function shl (a, num) {\\\\n    this._verify1(a);\\\\n    return this.imod(a.ushln(num));\\\\n  };\\\\n\\\\n  Red.prototype.imul = function imul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.imul(b));\\\\n  };\\\\n\\\\n  Red.prototype.mul = function mul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.mul(b));\\\\n  };\\\\n\\\\n  Red.prototype.isqr = function isqr (a) {\\\\n    return this.imul(a, a.clone());\\\\n  };\\\\n\\\\n  Red.prototype.sqr = function sqr (a) {\\\\n    return this.mul(a, a);\\\\n  };\\\\n\\\\n  Red.prototype.sqrt = function sqrt (a) {\\\\n    if (a.isZero()) return a.clone();\\\\n\\\\n    var mod3 = this.m.andln(3);\\\\n    assert(mod3 % 2 === 1);\\\\n\\\\n    // Fast case\\\\n    if (mod3 === 3) {\\\\n      var pow = this.m.add(new BN(1)).iushrn(2);\\\\n      return this.pow(a, pow);\\\\n    }\\\\n\\\\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\\\\n    //\\\\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\\\\n    var q = this.m.subn(1);\\\\n    var s = 0;\\\\n    while (!q.isZero() && q.andln(1) === 0) {\\\\n      s++;\\\\n      q.iushrn(1);\\\\n    }\\\\n    assert(!q.isZero());\\\\n\\\\n    var one = new BN(1).toRed(this);\\\\n    var nOne = one.redNeg();\\\\n\\\\n    // Find quadratic non-residue\\\\n    // NOTE: Max is such because of generalized Riemann hypothesis.\\\\n    var lpow = this.m.subn(1).iushrn(1);\\\\n    var z = this.m.bitLength();\\\\n    z = new BN(2 * z * z).toRed(this);\\\\n\\\\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\\\\n      z.redIAdd(nOne);\\\\n    }\\\\n\\\\n    var c = this.pow(z, q);\\\\n    var r = this.pow(a, q.addn(1).iushrn(1));\\\\n    var t = this.pow(a, q);\\\\n    var m = s;\\\\n    while (t.cmp(one) !== 0) {\\\\n      var tmp = t;\\\\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\\\\n        tmp = tmp.redSqr();\\\\n      }\\\\n      assert(i < m);\\\\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\\\\n\\\\n      r = r.redMul(b);\\\\n      c = b.redSqr();\\\\n      t = t.redMul(c);\\\\n      m = i;\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  Red.prototype.invm = function invm (a) {\\\\n    var inv = a._invmp(this.m);\\\\n    if (inv.negative !== 0) {\\\\n      inv.negative = 0;\\\\n      return this.imod(inv).redNeg();\\\\n    } else {\\\\n      return this.imod(inv);\\\\n    }\\\\n  };\\\\n\\\\n  Red.prototype.pow = function pow (a, num) {\\\\n    if (num.isZero()) return new BN(1);\\\\n    if (num.cmpn(1) === 0) return a.clone();\\\\n\\\\n    var windowSize = 4;\\\\n    var wnd = new Array(1 << windowSize);\\\\n    wnd[0] = new BN(1).toRed(this);\\\\n    wnd[1] = a;\\\\n    for (var i = 2; i < wnd.length; i++) {\\\\n      wnd[i] = this.mul(wnd[i - 1], a);\\\\n    }\\\\n\\\\n    var res = wnd[0];\\\\n    var current = 0;\\\\n    var currentLen = 0;\\\\n    var start = num.bitLength() % 26;\\\\n    if (start === 0) {\\\\n      start = 26;\\\\n    }\\\\n\\\\n    for (i = num.length - 1; i >= 0; i--) {\\\\n      var word = num.words[i];\\\\n      for (var j = start - 1; j >= 0; j--) {\\\\n        var bit = (word >> j) & 1;\\\\n        if (res !== wnd[0]) {\\\\n          res = this.sqr(res);\\\\n        }\\\\n\\\\n        if (bit === 0 && current === 0) {\\\\n          currentLen = 0;\\\\n          continue;\\\\n        }\\\\n\\\\n        current <<= 1;\\\\n        current |= bit;\\\\n        currentLen++;\\\\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\\\\n\\\\n        res = this.mul(res, wnd[current]);\\\\n        currentLen = 0;\\\\n        current = 0;\\\\n      }\\\\n      start = 26;\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.convertTo = function convertTo (num) {\\\\n    var r = num.umod(this.m);\\\\n\\\\n    return r === num ? r.clone() : r;\\\\n  };\\\\n\\\\n  Red.prototype.convertFrom = function convertFrom (num) {\\\\n    var res = num.clone();\\\\n    res.red = null;\\\\n    return res;\\\\n  };\\\\n\\\\n  //\\\\n  // Montgomery method engine\\\\n  //\\\\n\\\\n  BN.mont = function mont (num) {\\\\n    return new Mont(num);\\\\n  };\\\\n\\\\n  function Mont (m) {\\\\n    Red.call(this, m);\\\\n\\\\n    this.shift = this.m.bitLength();\\\\n    if (this.shift % 26 !== 0) {\\\\n      this.shift += 26 - (this.shift % 26);\\\\n    }\\\\n\\\\n    this.r = new BN(1).iushln(this.shift);\\\\n    this.r2 = this.imod(this.r.sqr());\\\\n    this.rinv = this.r._invmp(this.m);\\\\n\\\\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\\\\n    this.minv = this.minv.umod(this.r);\\\\n    this.minv = this.r.sub(this.minv);\\\\n  }\\\\n  inherits(Mont, Red);\\\\n\\\\n  Mont.prototype.convertTo = function convertTo (num) {\\\\n    return this.imod(num.ushln(this.shift));\\\\n  };\\\\n\\\\n  Mont.prototype.convertFrom = function convertFrom (num) {\\\\n    var r = this.imod(num.mul(this.rinv));\\\\n    r.red = null;\\\\n    return r;\\\\n  };\\\\n\\\\n  Mont.prototype.imul = function imul (a, b) {\\\\n    if (a.isZero() || b.isZero()) {\\\\n      a.words[0] = 0;\\\\n      a.length = 1;\\\\n      return a;\\\\n    }\\\\n\\\\n    var t = a.imul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.mul = function mul (a, b) {\\\\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\\\\n\\\\n    var t = a.mul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.invm = function invm (a) {\\\\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\\\\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\\\\n    return res._forceRed(this);\\\\n  };\\\\n})(typeof module === \'undefined\' || module, this);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/number-to-bn/~/bn.js/lib/bn.js\\\\n// module id = 283\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/number-to-bn/node_modules/bn.js/lib/bn.js\\")},function(module,exports,__webpack_require__){eval(\\"var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// This file is the concatenation of many js files.\\\\n// See http://github.com/jimhigson/oboe.js for the raw source\\\\n\\\\n// having a local undefined, window, Object etc allows slightly better minification:\\\\n(function  (window, Object, Array, Error, JSON, undefined ) {\\\\n\\\\n   // v2.1.3\\\\n\\\\n/*\\\\n\\\\nCopyright (c) 2013, Jim Higson\\\\n\\\\nAll rights reserved.\\\\n\\\\nRedistribution and use in source and binary forms, with or without\\\\nmodification, are permitted provided that the following conditions are\\\\nmet:\\\\n\\\\n1.  Redistributions of source code must retain the above copyright\\\\n    notice, this list of conditions and the following disclaimer.\\\\n\\\\n2.  Redistributions in binary form must reproduce the above copyright\\\\n    notice, this list of conditions and the following disclaimer in the\\\\n    documentation and/or other materials provided with the distribution.\\\\n\\\\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\\\\"AS\\\\nIS\\\\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\\\\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\\\\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\\\\nHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\\\\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED\\\\nTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\\\\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\\\\nLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\\\\nNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\\\\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\\\\n\\\\n*/\\\\n\\\\n/** \\\\n * Partially complete a function.\\\\n * \\\\n *  var add3 = partialComplete( function add(a,b){return a+b}, 3 );\\\\n *  \\\\n *  add3(4) // gives 7\\\\n *  \\\\n *  function wrap(left, right, cen){return left + \\\\\\" \\\\\\" + cen + \\\\\\" \\\\\\" + right;}\\\\n *  \\\\n *  var pirateGreeting = partialComplete( wrap , \\\\\\"I\'m\\\\\\", \\\\\\", a mighty pirate!\\\\\\" );\\\\n *  \\\\n *  pirateGreeting(\\\\\\"Guybrush Threepwood\\\\\\"); \\\\n *  // gives \\\\\\"I\'m Guybrush Threepwood, a mighty pirate!\\\\\\"\\\\n */\\\\nvar partialComplete = varArgs(function( fn, args ) {\\\\n\\\\n      // this isn\'t the shortest way to write this but it does\\\\n      // avoid creating a new array each time to pass to fn.apply,\\\\n      // otherwise could just call boundArgs.concat(callArgs)       \\\\n\\\\n      var numBoundArgs = args.length;\\\\n\\\\n      return varArgs(function( callArgs ) {\\\\n         \\\\n         for (var i = 0; i < callArgs.length; i++) {\\\\n            args[numBoundArgs + i] = callArgs[i];\\\\n         }\\\\n         \\\\n         args.length = numBoundArgs + callArgs.length;         \\\\n                     \\\\n         return fn.apply(this, args);\\\\n      }); \\\\n   }),\\\\n\\\\n/**\\\\n * Compose zero or more functions:\\\\n * \\\\n *    compose(f1, f2, f3)(x) = f1(f2(f3(x))))\\\\n * \\\\n * The last (inner-most) function may take more than one parameter:\\\\n * \\\\n *    compose(f1, f2, f3)(x,y) = f1(f2(f3(x,y))))\\\\n */\\\\n   compose = varArgs(function(fns) {\\\\n\\\\n      var fnsList = arrayAsList(fns);\\\\n   \\\\n      function next(params, curFn) {  \\\\n         return [apply(params, curFn)];   \\\\n      }\\\\n            \\\\n      return varArgs(function(startParams){\\\\n        \\\\n         return foldR(next, startParams, fnsList)[0];\\\\n      });\\\\n   });\\\\n\\\\n/**\\\\n * A more optimised version of compose that takes exactly two functions\\\\n * @param f1\\\\n * @param f2\\\\n */\\\\nfunction compose2(f1, f2){\\\\n   return function(){\\\\n      return f1.call(this,f2.apply(this,arguments));\\\\n   }\\\\n}\\\\n\\\\n/**\\\\n * Generic form for a function to get a property from an object\\\\n * \\\\n *    var o = {\\\\n *       foo:\'bar\'\\\\n *    }\\\\n *    \\\\n *    var getFoo = attr(\'foo\')\\\\n *    \\\\n *    fetFoo(o) // returns \'bar\'\\\\n * \\\\n * @param {String} key the property name\\\\n */\\\\nfunction attr(key) {\\\\n   return function(o) { return o[key]; };\\\\n}\\\\n        \\\\n/**\\\\n * Call a list of functions with the same args until one returns a \\\\n * truthy result. Similar to the || operator.\\\\n * \\\\n * So:\\\\n *      lazyUnion([f1,f2,f3 ... fn])( p1, p2 ... pn )\\\\n *      \\\\n * Is equivalent to: \\\\n *      apply([p1, p2 ... pn], f1) || \\\\n *      apply([p1, p2 ... pn], f2) || \\\\n *      apply([p1, p2 ... pn], f3) ... apply(fn, [p1, p2 ... pn])  \\\\n *  \\\\n * @returns the first return value that is given that is truthy.\\\\n */\\\\n   var lazyUnion = varArgs(function(fns) {\\\\n\\\\n      return varArgs(function(params){\\\\n   \\\\n         var maybeValue;\\\\n   \\\\n         for (var i = 0; i < len(fns); i++) {\\\\n   \\\\n            maybeValue = apply(params, fns[i]);\\\\n   \\\\n            if( maybeValue ) {\\\\n               return maybeValue;\\\\n            }\\\\n         }\\\\n      });\\\\n   });   \\\\n\\\\n/**\\\\n * This file declares various pieces of functional programming.\\\\n * \\\\n * This isn\'t a general purpose functional library, to keep things small it\\\\n * has just the parts useful for Oboe.js.\\\\n */\\\\n\\\\n\\\\n/**\\\\n * Call a single function with the given arguments array.\\\\n * Basically, a functional-style version of the OO-style Function#apply for \\\\n * when we don\'t care about the context (\'this\') of the call.\\\\n * \\\\n * The order of arguments allows partial completion of the arguments array\\\\n */\\\\nfunction apply(args, fn) {\\\\n   return fn.apply(undefined, args);\\\\n}\\\\n\\\\n/**\\\\n * Define variable argument functions but cut out all that tedious messing about \\\\n * with the arguments object. Delivers the variable-length part of the arguments\\\\n * list as an array.\\\\n * \\\\n * Eg:\\\\n * \\\\n * var myFunction = varArgs(\\\\n *    function( fixedArgument, otherFixedArgument, variableNumberOfArguments ){\\\\n *       console.log( variableNumberOfArguments );\\\\n *    }\\\\n * )\\\\n * \\\\n * myFunction(\'a\', \'b\', 1, 2, 3); // logs [1,2,3]\\\\n * \\\\n * var myOtherFunction = varArgs(function( variableNumberOfArguments ){\\\\n *    console.log( variableNumberOfArguments );\\\\n * })\\\\n * \\\\n * myFunction(1, 2, 3); // logs [1,2,3]\\\\n * \\\\n */\\\\nfunction varArgs(fn){\\\\n\\\\n   var numberOfFixedArguments = fn.length -1,\\\\n       slice = Array.prototype.slice;          \\\\n         \\\\n                   \\\\n   if( numberOfFixedArguments == 0 ) {\\\\n      // an optimised case for when there are no fixed args:   \\\\n   \\\\n      return function(){\\\\n         return fn.call(this, slice.call(arguments));\\\\n      }\\\\n      \\\\n   } else if( numberOfFixedArguments == 1 ) {\\\\n      // an optimised case for when there are is one fixed args:\\\\n   \\\\n      return function(){\\\\n         return fn.call(this, arguments[0], slice.call(arguments, 1));\\\\n      }\\\\n   }\\\\n   \\\\n   // general case   \\\\n\\\\n   // we know how many arguments fn will always take. Create a\\\\n   // fixed-size array to hold that many, to be re-used on\\\\n   // every call to the returned function\\\\n   var argsHolder = Array(fn.length);   \\\\n                             \\\\n   return function(){\\\\n                            \\\\n      for (var i = 0; i < numberOfFixedArguments; i++) {\\\\n         argsHolder[i] = arguments[i];         \\\\n      }\\\\n\\\\n      argsHolder[numberOfFixedArguments] = \\\\n         slice.call(arguments, numberOfFixedArguments);\\\\n                                \\\\n      return fn.apply( this, argsHolder);      \\\\n   }       \\\\n}\\\\n\\\\n\\\\n/**\\\\n * Swap the order of parameters to a binary function\\\\n * \\\\n * A bit like this flip: http://zvon.org/other/haskell/Outputprelude/flip_f.html\\\\n */\\\\nfunction flip(fn){\\\\n   return function(a, b){\\\\n      return fn(b,a);\\\\n   }\\\\n}\\\\n\\\\n\\\\n/**\\\\n * Create a function which is the intersection of two other functions.\\\\n * \\\\n * Like the && operator, if the first is truthy, the second is never called,\\\\n * otherwise the return value from the second is returned.\\\\n */\\\\nfunction lazyIntersection(fn1, fn2) {\\\\n\\\\n   return function (param) {\\\\n                                                              \\\\n      return fn1(param) && fn2(param);\\\\n   };   \\\\n}\\\\n\\\\n/**\\\\n * A function which does nothing\\\\n */\\\\nfunction noop(){}\\\\n\\\\n/**\\\\n * A function which is always happy\\\\n */\\\\nfunction always(){return true}\\\\n\\\\n/**\\\\n * Create a function which always returns the same\\\\n * value\\\\n * \\\\n * var return3 = functor(3);\\\\n * \\\\n * return3() // gives 3\\\\n * return3() // still gives 3\\\\n * return3() // will always give 3\\\\n */\\\\nfunction functor(val){\\\\n   return function(){\\\\n      return val;\\\\n   }\\\\n}\\\\n\\\\n/**\\\\n * This file defines some loosely associated syntactic sugar for \\\\n * Javascript programming \\\\n */\\\\n\\\\n\\\\n/**\\\\n * Returns true if the given candidate is of type T\\\\n */\\\\nfunction isOfType(T, maybeSomething){\\\\n   return maybeSomething && maybeSomething.constructor === T;\\\\n}\\\\n\\\\nvar len = attr(\'length\'),    \\\\n    isString = partialComplete(isOfType, String);\\\\n\\\\n/** \\\\n * I don\'t like saying this:\\\\n * \\\\n *    foo !=== undefined\\\\n *    \\\\n * because of the double-negative. I find this:\\\\n * \\\\n *    defined(foo)\\\\n *    \\\\n * easier to read.\\\\n */ \\\\nfunction defined( value ) {\\\\n   return value !== undefined;\\\\n}\\\\n\\\\n/**\\\\n * Returns true if object o has a key named like every property in \\\\n * the properties array. Will give false if any are missing, or if o \\\\n * is not an object.\\\\n */\\\\nfunction hasAllProperties(fieldList, o) {\\\\n\\\\n   return      (o instanceof Object) \\\\n            &&\\\\n               all(function (field) {         \\\\n                  return (field in o);         \\\\n               }, fieldList);\\\\n}\\\\n/**\\\\n * Like cons in Lisp\\\\n */\\\\nfunction cons(x, xs) {\\\\n   \\\\n   /* Internally lists are linked 2-element Javascript arrays.\\\\n          \\\\n      Ideally the return here would be Object.freeze([x,xs])\\\\n      so that bugs related to mutation are found fast.\\\\n      However, cons is right on the critical path for\\\\n      performance and this slows oboe-mark down by\\\\n      ~25%. Under theoretical future JS engines that freeze more\\\\n      efficiently (possibly even use immutability to\\\\n      run faster) this should be considered for\\\\n      restoration.\\\\n   */\\\\n   \\\\n   return [x,xs];\\\\n}\\\\n\\\\n/**\\\\n * The empty list\\\\n */\\\\nvar emptyList = null,\\\\n\\\\n/**\\\\n * Get the head of a list.\\\\n * \\\\n * Ie, head(cons(a,b)) = a\\\\n */\\\\n    head = attr(0),\\\\n\\\\n/**\\\\n * Get the tail of a list.\\\\n * \\\\n * Ie, tail(cons(a,b)) = b\\\\n */\\\\n    tail = attr(1);\\\\n\\\\n\\\\n/** \\\\n * Converts an array to a list \\\\n * \\\\n *    asList([a,b,c])\\\\n * \\\\n * is equivalent to:\\\\n *    \\\\n *    cons(a, cons(b, cons(c, emptyList))) \\\\n **/\\\\nfunction arrayAsList(inputArray){\\\\n\\\\n   return reverseList( \\\\n      inputArray.reduce(\\\\n         flip(cons),\\\\n         emptyList \\\\n      )\\\\n   );\\\\n}\\\\n\\\\n/**\\\\n * A varargs version of arrayAsList. Works a bit like list\\\\n * in LISP.\\\\n * \\\\n *    list(a,b,c) \\\\n *    \\\\n * is equivalent to:\\\\n * \\\\n *    cons(a, cons(b, cons(c, emptyList)))\\\\n */\\\\nvar list = varArgs(arrayAsList);\\\\n\\\\n/**\\\\n * Convert a list back to a js native array\\\\n */\\\\nfunction listAsArray(list){\\\\n\\\\n   return foldR( function(arraySoFar, listItem){\\\\n      \\\\n      arraySoFar.unshift(listItem);\\\\n      return arraySoFar;\\\\n           \\\\n   }, [], list );\\\\n   \\\\n}\\\\n\\\\n/**\\\\n * Map a function over a list \\\\n */\\\\nfunction map(fn, list) {\\\\n\\\\n   return list\\\\n            ? cons(fn(head(list)), map(fn,tail(list)))\\\\n            : emptyList\\\\n            ;\\\\n}\\\\n\\\\n/**\\\\n * foldR implementation. Reduce a list down to a single value.\\\\n * \\\\n * @pram {Function} fn     (rightEval, curVal) -> result \\\\n */\\\\nfunction foldR(fn, startValue, list) {\\\\n      \\\\n   return list \\\\n            ? fn(foldR(fn, startValue, tail(list)), head(list))\\\\n            : startValue\\\\n            ;\\\\n}\\\\n\\\\n/**\\\\n * foldR implementation. Reduce a list down to a single value.\\\\n * \\\\n * @pram {Function} fn     (rightEval, curVal) -> result \\\\n */\\\\nfunction foldR1(fn, list) {\\\\n      \\\\n   return tail(list) \\\\n            ? fn(foldR1(fn, tail(list)), head(list))\\\\n            : head(list)\\\\n            ;\\\\n}\\\\n\\\\n\\\\n/**\\\\n * Return a list like the one given but with the first instance equal \\\\n * to item removed \\\\n */\\\\nfunction without(list, test, removedFn) {\\\\n \\\\n   return withoutInner(list, removedFn || noop);\\\\n \\\\n   function withoutInner(subList, removedFn) {\\\\n      return subList  \\\\n         ?  ( test(head(subList)) \\\\n                  ? (removedFn(head(subList)), tail(subList)) \\\\n                  : cons(head(subList), withoutInner(tail(subList), removedFn))\\\\n            )\\\\n         : emptyList\\\\n         ;\\\\n   }               \\\\n}\\\\n\\\\n/** \\\\n * Returns true if the given function holds for every item in \\\\n * the list, false otherwise \\\\n */\\\\nfunction all(fn, list) {\\\\n   \\\\n   return !list || \\\\n          ( fn(head(list)) && all(fn, tail(list)) );\\\\n}\\\\n\\\\n/**\\\\n * Call every function in a list of functions with the same arguments\\\\n * \\\\n * This doesn\'t make any sense if we\'re doing pure functional because \\\\n * it doesn\'t return anything. Hence, this is only really useful if the\\\\n * functions being called have side-effects. \\\\n */\\\\nfunction applyEach(fnList, args) {\\\\n\\\\n   if( fnList ) {  \\\\n      head(fnList).apply(null, args);\\\\n      \\\\n      applyEach(tail(fnList), args);\\\\n   }\\\\n}\\\\n\\\\n/**\\\\n * Reverse the order of a list\\\\n */\\\\nfunction reverseList(list){ \\\\n\\\\n   // js re-implementation of 3rd solution from:\\\\n   //    http://www.haskell.org/haskellwiki/99_questions/Solutions/5\\\\n   function reverseInner( list, reversedAlready ) {\\\\n      if( !list ) {\\\\n         return reversedAlready;\\\\n      }\\\\n      \\\\n      return reverseInner(tail(list), cons(head(list), reversedAlready))\\\\n   }\\\\n\\\\n   return reverseInner(list, emptyList);\\\\n}\\\\n\\\\nfunction first(test, list) {\\\\n   return   list &&\\\\n               (test(head(list)) \\\\n                  ? head(list) \\\\n                  : first(test,tail(list))); \\\\n}\\\\n\\\\n/* \\\\n   This is a slightly hacked-up browser only version of clarinet \\\\n   \\\\n      *  some features removed to help keep browser Oboe under \\\\n         the 5k micro-library limit\\\\n      *  plug directly into event bus\\\\n   \\\\n   For the original go here:\\\\n      https://github.com/dscape/clarinet\\\\n\\\\n   We receive the events:\\\\n      STREAM_DATA\\\\n      STREAM_END\\\\n      \\\\n   We emit the events:\\\\n      SAX_KEY\\\\n      SAX_VALUE_OPEN\\\\n      SAX_VALUE_CLOSE      \\\\n      FAIL_EVENT      \\\\n */\\\\n\\\\nfunction clarinet(eventBus) {\\\\n  \\\\\\"use strict\\\\\\";\\\\n   \\\\n  var \\\\n      // shortcut some events on the bus\\\\n      emitSaxKey           = eventBus(SAX_KEY).emit,\\\\n      emitValueOpen        = eventBus(SAX_VALUE_OPEN).emit,\\\\n      emitValueClose       = eventBus(SAX_VALUE_CLOSE).emit,\\\\n      emitFail             = eventBus(FAIL_EVENT).emit,\\\\n              \\\\n      MAX_BUFFER_LENGTH = 64 * 1024\\\\n  ,   stringTokenPattern = /[\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\n]/g\\\\n  ,   _n = 0\\\\n  \\\\n      // states\\\\n  ,   BEGIN                = _n++\\\\n  ,   VALUE                = _n++ // general stuff\\\\n  ,   OPEN_OBJECT          = _n++ // {\\\\n  ,   CLOSE_OBJECT         = _n++ // }\\\\n  ,   OPEN_ARRAY           = _n++ // [\\\\n  ,   CLOSE_ARRAY          = _n++ // ]\\\\n  ,   STRING               = _n++ // \\\\\\"\\\\\\"\\\\n  ,   OPEN_KEY             = _n++ // , \\\\\\"a\\\\\\"\\\\n  ,   CLOSE_KEY            = _n++ // :\\\\n  ,   TRUE                 = _n++ // r\\\\n  ,   TRUE2                = _n++ // u\\\\n  ,   TRUE3                = _n++ // e\\\\n  ,   FALSE                = _n++ // a\\\\n  ,   FALSE2               = _n++ // l\\\\n  ,   FALSE3               = _n++ // s\\\\n  ,   FALSE4               = _n++ // e\\\\n  ,   NULL                 = _n++ // u\\\\n  ,   NULL2                = _n++ // l\\\\n  ,   NULL3                = _n++ // l\\\\n  ,   NUMBER_DECIMAL_POINT = _n++ // .\\\\n  ,   NUMBER_DIGIT         = _n   // [0-9]\\\\n\\\\n      // setup initial parser values\\\\n  ,   bufferCheckPosition  = MAX_BUFFER_LENGTH\\\\n  ,   latestError                \\\\n  ,   c                    \\\\n  ,   p                    \\\\n  ,   textNode             = undefined\\\\n  ,   numberNode           = \\\\\\"\\\\\\"     \\\\n  ,   slashed              = false\\\\n  ,   closed               = false\\\\n  ,   state                = BEGIN\\\\n  ,   stack                = []\\\\n  ,   unicodeS             = null\\\\n  ,   unicodeI             = 0\\\\n  ,   depth                = 0\\\\n  ,   position             = 0\\\\n  ,   column               = 0  //mostly for error reporting\\\\n  ,   line                 = 1\\\\n  ;\\\\n\\\\n  function checkBufferLength () {\\\\n     \\\\n    var maxActual = 0;\\\\n     \\\\n    if (textNode !== undefined && textNode.length > MAX_BUFFER_LENGTH) {\\\\n      emitError(\\\\\\"Max buffer length exceeded: textNode\\\\\\");\\\\n      maxActual = Math.max(maxActual, textNode.length);\\\\n    }\\\\n    if (numberNode.length > MAX_BUFFER_LENGTH) {\\\\n      emitError(\\\\\\"Max buffer length exceeded: numberNode\\\\\\");\\\\n      maxActual = Math.max(maxActual, numberNode.length);\\\\n    }\\\\n     \\\\n    bufferCheckPosition = (MAX_BUFFER_LENGTH - maxActual)\\\\n                               + position;\\\\n  }\\\\n\\\\n  eventBus(STREAM_DATA).on(handleData);\\\\n\\\\n   /* At the end of the http content close the clarinet \\\\n    This will provide an error if the total content provided was not \\\\n    valid json, ie if not all arrays, objects and Strings closed properly */\\\\n  eventBus(STREAM_END).on(handleStreamEnd);   \\\\n\\\\n  function emitError (errorString) {\\\\n     if (textNode !== undefined) {\\\\n        emitValueOpen(textNode);\\\\n        emitValueClose();\\\\n        textNode = undefined;\\\\n     }\\\\n\\\\n     latestError = Error(errorString + \\\\\\"\\\\\\\\nLn: \\\\\\"+line+\\\\n                                       \\\\\\"\\\\\\\\nCol: \\\\\\"+column+\\\\n                                       \\\\\\"\\\\\\\\nChr: \\\\\\"+c);\\\\n     \\\\n     emitFail(errorReport(undefined, undefined, latestError));\\\\n  }\\\\n\\\\n  function handleStreamEnd() {\\\\n    if( state == BEGIN ) {\\\\n      // Handle the case where the stream closes without ever receiving\\\\n      // any input. This isn\'t an error - response bodies can be blank,\\\\n      // particularly for 204 http responses\\\\n      \\\\n      // Because of how Oboe is currently implemented, we parse a\\\\n      // completely empty stream as containing an empty object.\\\\n      // This is because Oboe\'s done event is only fired when the\\\\n      // root object of the JSON stream closes.\\\\n      \\\\n      // This should be decoupled and attached instead to the input stream\\\\n      // from the http (or whatever) resource ending.\\\\n      // If this decoupling could happen the SAX parser could simply emit\\\\n      // zero events on a completely empty input.\\\\n      emitValueOpen({});\\\\n      emitValueClose();\\\\n\\\\n      closed = true;\\\\n      return;\\\\n    }\\\\n  \\\\n    if (state !== VALUE || depth !== 0)\\\\n      emitError(\\\\\\"Unexpected end\\\\\\");\\\\n \\\\n    if (textNode !== undefined) {\\\\n      emitValueOpen(textNode);\\\\n      emitValueClose();\\\\n      textNode = undefined;\\\\n    }\\\\n     \\\\n    closed = true;\\\\n  }\\\\n\\\\n  function whitespace(c){\\\\n     return c == \'\\\\\\\\r\' || c == \'\\\\\\\\n\' || c == \' \' || c == \'\\\\\\\\t\';\\\\n  }\\\\n   \\\\n  function handleData (chunk) {\\\\n         \\\\n    // this used to throw the error but inside Oboe we will have already\\\\n    // gotten the error when it was emitted. The important thing is to\\\\n    // not continue with the parse.\\\\n    if (latestError)\\\\n      return;\\\\n      \\\\n    if (closed) {\\\\n       return emitError(\\\\\\"Cannot write after close\\\\\\");\\\\n    }\\\\n\\\\n    var i = 0;\\\\n    c = chunk[0]; \\\\n\\\\n    while (c) {\\\\n      p = c;\\\\n      c = chunk[i++];\\\\n      if(!c) break;\\\\n\\\\n      position ++;\\\\n      if (c == \\\\\\"\\\\\\\\n\\\\\\") {\\\\n        line ++;\\\\n        column = 0;\\\\n      } else column ++;\\\\n      switch (state) {\\\\n\\\\n        case BEGIN:\\\\n          if (c === \\\\\\"{\\\\\\") state = OPEN_OBJECT;\\\\n          else if (c === \\\\\\"[\\\\\\") state = OPEN_ARRAY;\\\\n          else if (!whitespace(c))\\\\n            return emitError(\\\\\\"Non-whitespace before {[.\\\\\\");\\\\n        continue;\\\\n\\\\n        case OPEN_KEY:\\\\n        case OPEN_OBJECT:\\\\n          if (whitespace(c)) continue;\\\\n          if(state === OPEN_KEY) stack.push(CLOSE_KEY);\\\\n          else {\\\\n            if(c === \'}\') {\\\\n              emitValueOpen({});\\\\n              emitValueClose();\\\\n              state = stack.pop() || VALUE;\\\\n              continue;\\\\n            } else  stack.push(CLOSE_OBJECT);\\\\n          }\\\\n          if(c === \'\\\\\\"\')\\\\n             state = STRING;\\\\n          else\\\\n             return emitError(\\\\\\"Malformed object key should start with \\\\\\\\\\\\\\" \\\\\\");\\\\n        continue;\\\\n\\\\n        case CLOSE_KEY:\\\\n        case CLOSE_OBJECT:\\\\n          if (whitespace(c)) continue;\\\\n\\\\n          if(c===\':\') {\\\\n            if(state === CLOSE_OBJECT) {\\\\n              stack.push(CLOSE_OBJECT);\\\\n\\\\n               if (textNode !== undefined) {\\\\n                  // was previously (in upstream Clarinet) one event\\\\n                  //  - object open came with the text of the first\\\\n                  emitValueOpen({});\\\\n                  emitSaxKey(textNode);\\\\n                  textNode = undefined;\\\\n               }\\\\n               depth++;\\\\n            } else {\\\\n               if (textNode !== undefined) {\\\\n                  emitSaxKey(textNode);\\\\n                  textNode = undefined;\\\\n               }\\\\n            }\\\\n             state  = VALUE;\\\\n          } else if (c===\'}\') {\\\\n             if (textNode !== undefined) {\\\\n                emitValueOpen(textNode);\\\\n                emitValueClose();\\\\n                textNode = undefined;\\\\n             }\\\\n             emitValueClose();\\\\n            depth--;\\\\n            state = stack.pop() || VALUE;\\\\n          } else if(c===\',\') {\\\\n            if(state === CLOSE_OBJECT)\\\\n              stack.push(CLOSE_OBJECT);\\\\n             if (textNode !== undefined) {\\\\n                emitValueOpen(textNode);\\\\n                emitValueClose();\\\\n                textNode = undefined;\\\\n             }\\\\n             state  = OPEN_KEY;\\\\n          } else \\\\n             return emitError(\'Bad object\');\\\\n        continue;\\\\n\\\\n        case OPEN_ARRAY: // after an array there always a value\\\\n        case VALUE:\\\\n          if (whitespace(c)) continue;\\\\n          if(state===OPEN_ARRAY) {\\\\n            emitValueOpen([]);\\\\n            depth++;             \\\\n            state = VALUE;\\\\n            if(c === \']\') {\\\\n              emitValueClose();\\\\n              depth--;\\\\n              state = stack.pop() || VALUE;\\\\n              continue;\\\\n            } else {\\\\n              stack.push(CLOSE_ARRAY);\\\\n            }\\\\n          }\\\\n               if(c === \'\\\\\\"\') state = STRING;\\\\n          else if(c === \'{\') state = OPEN_OBJECT;\\\\n          else if(c === \'[\') state = OPEN_ARRAY;\\\\n          else if(c === \'t\') state = TRUE;\\\\n          else if(c === \'f\') state = FALSE;\\\\n          else if(c === \'n\') state = NULL;\\\\n          else if(c === \'-\') { // keep and continue\\\\n            numberNode += c;\\\\n          } else if(c===\'0\') {\\\\n            numberNode += c;\\\\n            state = NUMBER_DIGIT;\\\\n          } else if(\'123456789\'.indexOf(c) !== -1) {\\\\n            numberNode += c;\\\\n            state = NUMBER_DIGIT;\\\\n          } else               \\\\n            return emitError(\\\\\\"Bad value\\\\\\");\\\\n        continue;\\\\n\\\\n        case CLOSE_ARRAY:\\\\n          if(c===\',\') {\\\\n            stack.push(CLOSE_ARRAY);\\\\n             if (textNode !== undefined) {\\\\n                emitValueOpen(textNode);\\\\n                emitValueClose();\\\\n                textNode = undefined;\\\\n             }\\\\n             state  = VALUE;\\\\n          } else if (c===\']\') {\\\\n             if (textNode !== undefined) {\\\\n                emitValueOpen(textNode);\\\\n                emitValueClose();\\\\n                textNode = undefined;\\\\n             }\\\\n             emitValueClose();\\\\n            depth--;\\\\n            state = stack.pop() || VALUE;\\\\n          } else if (whitespace(c))\\\\n              continue;\\\\n          else \\\\n             return emitError(\'Bad array\');\\\\n        continue;\\\\n\\\\n        case STRING:\\\\n          if (textNode === undefined) {\\\\n              textNode = \\\\\\"\\\\\\";\\\\n          }\\\\n\\\\n          // thanks thejh, this is an about 50% performance improvement.\\\\n          var starti              = i-1;\\\\n           \\\\n          STRING_BIGLOOP: while (true) {\\\\n\\\\n            // zero means \\\\\\"no unicode active\\\\\\". 1-4 mean \\\\\\"parse some more\\\\\\". end after 4.\\\\n            while (unicodeI > 0) {\\\\n              unicodeS += c;\\\\n              c = chunk.charAt(i++);\\\\n              if (unicodeI === 4) {\\\\n                // TODO this might be slow? well, probably not used too often anyway\\\\n                textNode += String.fromCharCode(parseInt(unicodeS, 16));\\\\n                unicodeI = 0;\\\\n                starti = i-1;\\\\n              } else {\\\\n                unicodeI++;\\\\n              }\\\\n              // we can just break here: no stuff we skipped that still has to be sliced out or so\\\\n              if (!c) break STRING_BIGLOOP;\\\\n            }\\\\n            if (c === \'\\\\\\"\' && !slashed) {\\\\n              state = stack.pop() || VALUE;\\\\n              textNode += chunk.substring(starti, i-1);\\\\n              break;\\\\n            }\\\\n            if (c === \'\\\\\\\\\\\\\\\\\' && !slashed) {\\\\n              slashed = true;\\\\n              textNode += chunk.substring(starti, i-1);\\\\n               c = chunk.charAt(i++);\\\\n              if (!c) break;\\\\n            }\\\\n            if (slashed) {\\\\n              slashed = false;\\\\n                   if (c === \'n\') { textNode += \'\\\\\\\\n\'; }\\\\n              else if (c === \'r\') { textNode += \'\\\\\\\\r\'; }\\\\n              else if (c === \'t\') { textNode += \'\\\\\\\\t\'; }\\\\n              else if (c === \'f\') { textNode += \'\\\\\\\\f\'; }\\\\n              else if (c === \'b\') { textNode += \'\\\\\\\\b\'; }\\\\n              else if (c === \'u\') {\\\\n                // \\\\\\\\uxxxx. meh!\\\\n                unicodeI = 1;\\\\n                unicodeS = \'\';\\\\n              } else {\\\\n                textNode += c;\\\\n              }\\\\n              c = chunk.charAt(i++);\\\\n              starti = i-1;\\\\n              if (!c) break;\\\\n              else continue;\\\\n            }\\\\n\\\\n            stringTokenPattern.lastIndex = i;\\\\n            var reResult = stringTokenPattern.exec(chunk);\\\\n            if (!reResult) {\\\\n              i = chunk.length+1;\\\\n              textNode += chunk.substring(starti, i-1);\\\\n              break;\\\\n            }\\\\n            i = reResult.index+1;\\\\n            c = chunk.charAt(reResult.index);\\\\n            if (!c) {\\\\n              textNode += chunk.substring(starti, i-1);\\\\n              break;\\\\n            }\\\\n          }\\\\n        continue;\\\\n\\\\n        case TRUE:\\\\n          if (!c)  continue; // strange buffers\\\\n          if (c===\'r\') state = TRUE2;\\\\n          else\\\\n             return emitError( \'Invalid true started with t\'+ c);\\\\n        continue;\\\\n\\\\n        case TRUE2:\\\\n          if (!c)  continue;\\\\n          if (c===\'u\') state = TRUE3;\\\\n          else\\\\n             return emitError(\'Invalid true started with tr\'+ c);\\\\n        continue;\\\\n\\\\n        case TRUE3:\\\\n          if (!c) continue;\\\\n          if(c===\'e\') {\\\\n            emitValueOpen(true);\\\\n            emitValueClose();\\\\n            state = stack.pop() || VALUE;\\\\n          } else\\\\n             return emitError(\'Invalid true started with tru\'+ c);\\\\n        continue;\\\\n\\\\n        case FALSE:\\\\n          if (!c)  continue;\\\\n          if (c===\'a\') state = FALSE2;\\\\n          else\\\\n             return emitError(\'Invalid false started with f\'+ c);\\\\n        continue;\\\\n\\\\n        case FALSE2:\\\\n          if (!c)  continue;\\\\n          if (c===\'l\') state = FALSE3;\\\\n          else\\\\n             return emitError(\'Invalid false started with fa\'+ c);\\\\n        continue;\\\\n\\\\n        case FALSE3:\\\\n          if (!c)  continue;\\\\n          if (c===\'s\') state = FALSE4;\\\\n          else\\\\n             return emitError(\'Invalid false started with fal\'+ c);\\\\n        continue;\\\\n\\\\n        case FALSE4:\\\\n          if (!c)  continue;\\\\n          if (c===\'e\') {\\\\n            emitValueOpen(false);\\\\n            emitValueClose();\\\\n            state = stack.pop() || VALUE;\\\\n          } else\\\\n             return emitError(\'Invalid false started with fals\'+ c);\\\\n        continue;\\\\n\\\\n        case NULL:\\\\n          if (!c)  continue;\\\\n          if (c===\'u\') state = NULL2;\\\\n          else\\\\n             return emitError(\'Invalid null started with n\'+ c);\\\\n        continue;\\\\n\\\\n        case NULL2:\\\\n          if (!c)  continue;\\\\n          if (c===\'l\') state = NULL3;\\\\n          else\\\\n             return emitError(\'Invalid null started with nu\'+ c);\\\\n        continue;\\\\n\\\\n        case NULL3:\\\\n          if (!c) continue;\\\\n          if(c===\'l\') {\\\\n            emitValueOpen(null);\\\\n            emitValueClose();\\\\n            state = stack.pop() || VALUE;\\\\n          } else \\\\n             return emitError(\'Invalid null started with nul\'+ c);\\\\n        continue;\\\\n\\\\n        case NUMBER_DECIMAL_POINT:\\\\n          if(c===\'.\') {\\\\n            numberNode += c;\\\\n            state       = NUMBER_DIGIT;\\\\n          } else \\\\n             return emitError(\'Leading zero not followed by .\');\\\\n        continue;\\\\n\\\\n        case NUMBER_DIGIT:\\\\n          if(\'0123456789\'.indexOf(c) !== -1) numberNode += c;\\\\n          else if (c===\'.\') {\\\\n            if(numberNode.indexOf(\'.\')!==-1)\\\\n               return emitError(\'Invalid number has two dots\');\\\\n            numberNode += c;\\\\n          } else if (c===\'e\' || c===\'E\') {\\\\n            if(numberNode.indexOf(\'e\')!==-1 ||\\\\n               numberNode.indexOf(\'E\')!==-1 )\\\\n               return emitError(\'Invalid number has two exponential\');\\\\n            numberNode += c;\\\\n          } else if (c===\\\\\\"+\\\\\\" || c===\\\\\\"-\\\\\\") {\\\\n            if(!(p===\'e\' || p===\'E\'))\\\\n               return emitError(\'Invalid symbol in number\');\\\\n            numberNode += c;\\\\n          } else {\\\\n            if (numberNode) {\\\\n              emitValueOpen(parseFloat(numberNode));\\\\n              emitValueClose();\\\\n              numberNode = \\\\\\"\\\\\\";\\\\n            }\\\\n            i--; // go back one\\\\n            state = stack.pop() || VALUE;\\\\n          }\\\\n        continue;\\\\n\\\\n        default:\\\\n          return emitError(\\\\\\"Unknown state: \\\\\\" + state);\\\\n      }\\\\n    }\\\\n    if (position >= bufferCheckPosition)\\\\n      checkBufferLength();\\\\n  }\\\\n}\\\\n\\\\n\\\\n/** \\\\n * A bridge used to assign stateless functions to listen to clarinet.\\\\n * \\\\n * As well as the parameter from clarinet, each callback will also be passed\\\\n * the result of the last callback.\\\\n * \\\\n * This may also be used to clear all listeners by assigning zero handlers:\\\\n * \\\\n *    ascentManager( clarinet, {} )\\\\n */\\\\nfunction ascentManager(oboeBus, handlers){\\\\n   \\\\\\"use strict\\\\\\";\\\\n   \\\\n   var listenerId = {},\\\\n       ascent;\\\\n\\\\n   function stateAfter(handler) {\\\\n      return function(param){\\\\n         ascent = handler( ascent, param);\\\\n      }\\\\n   }\\\\n   \\\\n   for( var eventName in handlers ) {\\\\n\\\\n      oboeBus(eventName).on(stateAfter(handlers[eventName]), listenerId);\\\\n   }\\\\n   \\\\n   oboeBus(NODE_SWAP).on(function(newNode) {\\\\n      \\\\n      var oldHead = head(ascent),\\\\n          key = keyOf(oldHead),\\\\n          ancestors = tail(ascent),\\\\n          parentNode;\\\\n\\\\n      if( ancestors ) {\\\\n         parentNode = nodeOf(head(ancestors));\\\\n         parentNode[key] = newNode;\\\\n      }\\\\n   });\\\\n\\\\n   oboeBus(NODE_DROP).on(function() {\\\\n\\\\n      var oldHead = head(ascent),\\\\n          key = keyOf(oldHead),\\\\n          ancestors = tail(ascent),\\\\n          parentNode;\\\\n\\\\n      if( ancestors ) {\\\\n         parentNode = nodeOf(head(ancestors));\\\\n \\\\n         delete parentNode[key];\\\\n      }\\\\n   });\\\\n\\\\n   oboeBus(ABORTING).on(function(){\\\\n      \\\\n      for( var eventName in handlers ) {\\\\n         oboeBus(eventName).un(listenerId);\\\\n      }\\\\n   });   \\\\n}\\\\n\\\\n// based on gist https://gist.github.com/monsur/706839\\\\n\\\\n/**\\\\n * XmlHttpRequest\'s getAllResponseHeaders() method returns a string of response\\\\n * headers according to the format described here:\\\\n * http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method\\\\n * This method parses that string into a user-friendly key/value pair object.\\\\n */\\\\nfunction parseResponseHeaders(headerStr) {\\\\n   var headers = {};\\\\n   \\\\n   headerStr && headerStr.split(\'\\\\\\\\u000d\\\\\\\\u000a\')\\\\n      .forEach(function(headerPair){\\\\n   \\\\n         // Can\'t use split() here because it does the wrong thing\\\\n         // if the header value has the string \\\\\\": \\\\\\" in it.\\\\n         var index = headerPair.indexOf(\'\\\\\\\\u003a\\\\\\\\u0020\');\\\\n         \\\\n         headers[headerPair.substring(0, index)] \\\\n                     = headerPair.substring(index + 2);\\\\n      });\\\\n   \\\\n   return headers;\\\\n}\\\\n\\\\n/**\\\\n * Detect if a given URL is cross-origin in the scope of the\\\\n * current page.\\\\n * \\\\n * Browser only (since cross-origin has no meaning in Node.js)\\\\n *\\\\n * @param {Object} pageLocation - as in window.location\\\\n * @param {Object} ajaxHost - an object like window.location describing the \\\\n *    origin of the url that we want to ajax in\\\\n */\\\\nfunction isCrossOrigin(pageLocation, ajaxHost) {\\\\n\\\\n   /*\\\\n    * NB: defaultPort only knows http and https.\\\\n    * Returns undefined otherwise.\\\\n    */\\\\n   function defaultPort(protocol) {\\\\n      return {\'http:\':80, \'https:\':443}[protocol];\\\\n   }\\\\n   \\\\n   function portOf(location) {\\\\n      // pageLocation should always have a protocol. ajaxHost if no port or\\\\n      // protocol is specified, should use the port of the containing page\\\\n      \\\\n      return location.port || defaultPort(location.protocol||pageLocation.protocol);\\\\n   }\\\\n\\\\n   // if ajaxHost doesn\'t give a domain, port is the same as pageLocation\\\\n   // it can\'t give a protocol but not a domain\\\\n   // it can\'t give a port but not a domain\\\\n   \\\\n   return !!(  (ajaxHost.protocol  && (ajaxHost.protocol  != pageLocation.protocol)) ||\\\\n               (ajaxHost.host      && (ajaxHost.host      != pageLocation.host))     ||\\\\n               (ajaxHost.host      && (portOf(ajaxHost) != portOf(pageLocation)))\\\\n          );\\\\n}\\\\n\\\\n/* turn any url into an object like window.location */\\\\nfunction parseUrlOrigin(url) {\\\\n   // url could be domain-relative\\\\n   // url could give a domain\\\\n\\\\n   // cross origin means:\\\\n   //    same domain\\\\n   //    same port\\\\n   //    some protocol\\\\n   // so, same everything up to the first (single) slash \\\\n   // if such is given\\\\n   //\\\\n   // can ignore everything after that   \\\\n   \\\\n   var URL_HOST_PATTERN = /(\\\\\\\\w+:)?(?:\\\\\\\\/\\\\\\\\/)([\\\\\\\\w.-]+)?(?::(\\\\\\\\d+))?\\\\\\\\/?/,\\\\n\\\\n         // if no match, use an empty array so that\\\\n         // subexpressions 1,2,3 are all undefined\\\\n         // and will ultimately return all empty\\\\n         // strings as the parse result:\\\\n       urlHostMatch = URL_HOST_PATTERN.exec(url) || [];\\\\n   \\\\n   return {\\\\n      protocol:   urlHostMatch[1] || \'\',\\\\n      host:       urlHostMatch[2] || \'\',\\\\n      port:       urlHostMatch[3] || \'\'\\\\n   };\\\\n}\\\\n\\\\nfunction httpTransport(){\\\\n   return new XMLHttpRequest();\\\\n}\\\\n\\\\n/**\\\\n * A wrapper around the browser XmlHttpRequest object that raises an \\\\n * event whenever a new part of the response is available.\\\\n * \\\\n * In older browsers progressive reading is impossible so all the \\\\n * content is given in a single call. For newer ones several events\\\\n * should be raised, allowing progressive interpretation of the response.\\\\n *      \\\\n * @param {Function} oboeBus an event bus local to this Oboe instance\\\\n * @param {XMLHttpRequest} xhr the xhr to use as the transport. Under normal\\\\n *          operation, will have been created using httpTransport() above\\\\n *          but for tests a stub can be provided instead.\\\\n * @param {String} method one of \'GET\' \'POST\' \'PUT\' \'PATCH\' \'DELETE\'\\\\n * @param {String} url the url to make a request to\\\\n * @param {String|Null} data some content to be sent with the request.\\\\n *                      Only valid if method is POST or PUT.\\\\n * @param {Object} [headers] the http request headers to send\\\\n * @param {boolean} withCredentials the XHR withCredentials property will be\\\\n *    set to this value\\\\n */  \\\\nfunction streamingHttp(oboeBus, xhr, method, url, data, headers, withCredentials) {\\\\n           \\\\n   \\\\\\"use strict\\\\\\";\\\\n   \\\\n   var emitStreamData = oboeBus(STREAM_DATA).emit,\\\\n       emitFail       = oboeBus(FAIL_EVENT).emit,\\\\n       numberOfCharsAlreadyGivenToCallback = 0,\\\\n       stillToSendStartEvent = true;\\\\n\\\\n   // When an ABORTING message is put on the event bus abort \\\\n   // the ajax request         \\\\n   oboeBus( ABORTING ).on( function(){\\\\n  \\\\n      // if we keep the onreadystatechange while aborting the XHR gives \\\\n      // a callback like a successful call so first remove this listener\\\\n      // by assigning null:\\\\n      xhr.onreadystatechange = null;\\\\n            \\\\n      xhr.abort();\\\\n   });\\\\n\\\\n   /** \\\\n    * Handle input from the underlying xhr: either a state change,\\\\n    * the progress event or the request being complete.\\\\n    */\\\\n   function handleProgress() {\\\\n                        \\\\n      var textSoFar = xhr.responseText,\\\\n          newText = textSoFar.substr(numberOfCharsAlreadyGivenToCallback);\\\\n      \\\\n      \\\\n      /* Raise the event for new text.\\\\n      \\\\n         On older browsers, the new text is the whole response. \\\\n         On newer/better ones, the fragment part that we got since \\\\n         last progress. */\\\\n         \\\\n      if( newText ) {\\\\n         emitStreamData( newText );\\\\n      } \\\\n\\\\n      numberOfCharsAlreadyGivenToCallback = len(textSoFar);\\\\n   }\\\\n   \\\\n   \\\\n   if(\'onprogress\' in xhr){  // detect browser support for progressive delivery\\\\n      xhr.onprogress = handleProgress;\\\\n   }\\\\n      \\\\n   xhr.onreadystatechange = function() {\\\\n\\\\n      function sendStartIfNotAlready() {\\\\n         // Internet Explorer is very unreliable as to when xhr.status etc can\\\\n         // be read so has to be protected with try/catch and tried again on \\\\n         // the next readyState if it fails\\\\n         try{\\\\n            stillToSendStartEvent && oboeBus( HTTP_START ).emit(\\\\n               xhr.status,\\\\n               parseResponseHeaders(xhr.getAllResponseHeaders()) );\\\\n            stillToSendStartEvent = false;\\\\n         } catch(e){/* do nothing, will try again on next readyState*/}\\\\n      }\\\\n      \\\\n      switch( xhr.readyState ) {\\\\n               \\\\n         case 2: // HEADERS_RECEIVED\\\\n         case 3: // LOADING\\\\n            return sendStartIfNotAlready();\\\\n            \\\\n         case 4: // DONE\\\\n            sendStartIfNotAlready(); // if xhr.status hasn\'t been available yet, it must be NOW, huh IE?\\\\n            \\\\n            // is this a 2xx http code?\\\\n            var successful = String(xhr.status)[0] == 2;\\\\n            \\\\n            if( successful ) {\\\\n               // In Chrome 29 (not 28) no onprogress is emitted when a response\\\\n               // is complete before the onload. We need to always do handleInput\\\\n               // in case we get the load but have not had a final progress event.\\\\n               // This looks like a bug and may change in future but let\'s take\\\\n               // the safest approach and assume we might not have received a \\\\n               // progress event for each part of the response\\\\n               handleProgress();\\\\n               \\\\n               oboeBus(STREAM_END).emit();\\\\n            } else {\\\\n\\\\n               emitFail( errorReport(\\\\n                  xhr.status, \\\\n                  xhr.responseText\\\\n               ));\\\\n            }\\\\n      }\\\\n   };\\\\n   \\\\n   try{\\\\n   \\\\n      xhr.open(method, url, true);\\\\n   \\\\n      for( var headerName in headers ){\\\\n         xhr.setRequestHeader(headerName, headers[headerName]);\\\\n      }\\\\n      \\\\n      if( !isCrossOrigin(window.location, parseUrlOrigin(url)) ) {\\\\n         xhr.setRequestHeader(\'X-Requested-With\', \'XMLHttpRequest\');\\\\n      }\\\\n\\\\n      xhr.withCredentials = withCredentials;\\\\n      \\\\n      xhr.send(data);\\\\n      \\\\n   } catch( e ) {\\\\n      \\\\n      // To keep a consistent interface with Node, we can\'t emit an event here.\\\\n      // Node\'s streaming http adaptor receives the error as an asynchronous\\\\n      // event rather than as an exception. If we emitted now, the Oboe user\\\\n      // has had no chance to add a .fail listener so there is no way\\\\n      // the event could be useful. For both these reasons defer the\\\\n      // firing to the next JS frame.  \\\\n      window.setTimeout(\\\\n         partialComplete(emitFail, errorReport(undefined, undefined, e))\\\\n      ,  0\\\\n      );\\\\n   }            \\\\n}\\\\n\\\\nvar jsonPathSyntax = (function() {\\\\n \\\\n   var\\\\n   \\\\n   /** \\\\n    * Export a regular expression as a simple function by exposing just \\\\n    * the Regex#exec. This allows regex tests to be used under the same \\\\n    * interface as differently implemented tests, or for a user of the\\\\n    * tests to not concern themselves with their implementation as regular\\\\n    * expressions.\\\\n    * \\\\n    * This could also be expressed point-free as:\\\\n    *   Function.prototype.bind.bind(RegExp.prototype.exec),\\\\n    *   \\\\n    * But that\'s far too confusing! (and not even smaller once minified \\\\n    * and gzipped)\\\\n    */\\\\n       regexDescriptor = function regexDescriptor(regex) {\\\\n            return regex.exec.bind(regex);\\\\n       }\\\\n       \\\\n   /**\\\\n    * Join several regular expressions and express as a function.\\\\n    * This allows the token patterns to reuse component regular expressions\\\\n    * instead of being expressed in full using huge and confusing regular\\\\n    * expressions.\\\\n    */       \\\\n   ,   jsonPathClause = varArgs(function( componentRegexes ) {\\\\n\\\\n            // The regular expressions all start with ^ because we \\\\n            // only want to find matches at the start of the \\\\n            // JSONPath fragment we are inspecting           \\\\n            componentRegexes.unshift(/^/);\\\\n            \\\\n            return   regexDescriptor(\\\\n                        RegExp(\\\\n                           componentRegexes.map(attr(\'source\')).join(\'\')\\\\n                        )\\\\n                     );\\\\n       })\\\\n       \\\\n   ,   possiblyCapturing =           /(\\\\\\\\$?)/\\\\n   ,   namedNode =                   /([\\\\\\\\w-_]+|\\\\\\\\*)/\\\\n   ,   namePlaceholder =             /()/\\\\n   ,   nodeInArrayNotation =         /\\\\\\\\[\\\\\\"([^\\\\\\"]+)\\\\\\"\\\\\\\\]/\\\\n   ,   numberedNodeInArrayNotation = /\\\\\\\\[(\\\\\\\\d+|\\\\\\\\*)\\\\\\\\]/\\\\n   ,   fieldList =                      /{([\\\\\\\\w ]*?)}/\\\\n   ,   optionalFieldList =           /(?:{([\\\\\\\\w ]*?)})?/\\\\n    \\\\n\\\\n       //   foo or *                  \\\\n   ,   jsonPathNamedNodeInObjectNotation   = jsonPathClause( \\\\n                                                possiblyCapturing, \\\\n                                                namedNode, \\\\n                                                optionalFieldList\\\\n                                             )\\\\n                                             \\\\n       //   [\\\\\\"foo\\\\\\"]   \\\\n   ,   jsonPathNamedNodeInArrayNotation    = jsonPathClause( \\\\n                                                possiblyCapturing, \\\\n                                                nodeInArrayNotation, \\\\n                                                optionalFieldList\\\\n                                             )  \\\\n\\\\n       //   [2] or [*]       \\\\n   ,   jsonPathNumberedNodeInArrayNotation = jsonPathClause( \\\\n                                                possiblyCapturing, \\\\n                                                numberedNodeInArrayNotation, \\\\n                                                optionalFieldList\\\\n                                             )\\\\n\\\\n       //   {a b c}      \\\\n   ,   jsonPathPureDuckTyping              = jsonPathClause( \\\\n                                                possiblyCapturing, \\\\n                                                namePlaceholder, \\\\n                                                fieldList\\\\n                                             )\\\\n   \\\\n       //   ..\\\\n   ,   jsonPathDoubleDot                   = jsonPathClause(/\\\\\\\\.\\\\\\\\./)                  \\\\n   \\\\n       //   .\\\\n   ,   jsonPathDot                         = jsonPathClause(/\\\\\\\\./)                    \\\\n   \\\\n       //   !\\\\n   ,   jsonPathBang                        = jsonPathClause(\\\\n                                                possiblyCapturing, \\\\n                                                /!/\\\\n                                             )  \\\\n   \\\\n       //   nada!\\\\n   ,   emptyString                         = jsonPathClause(/$/)                     \\\\n   \\\\n   ;\\\\n   \\\\n  \\\\n   /* We export only a single function. When called, this function injects \\\\n      into another function the descriptors from above.             \\\\n    */\\\\n   return function (fn){      \\\\n      return fn(      \\\\n         lazyUnion(\\\\n            jsonPathNamedNodeInObjectNotation\\\\n         ,  jsonPathNamedNodeInArrayNotation\\\\n         ,  jsonPathNumberedNodeInArrayNotation\\\\n         ,  jsonPathPureDuckTyping \\\\n         )\\\\n      ,  jsonPathDoubleDot\\\\n      ,  jsonPathDot\\\\n      ,  jsonPathBang\\\\n      ,  emptyString \\\\n      );\\\\n   }; \\\\n\\\\n}());\\\\n/**\\\\n * Get a new key->node mapping\\\\n * \\\\n * @param {String|Number} key\\\\n * @param {Object|Array|String|Number|null} node a value found in the json\\\\n */\\\\nfunction namedNode(key, node) {\\\\n   return {key:key, node:node};\\\\n}\\\\n\\\\n/** get the key of a namedNode */\\\\nvar keyOf = attr(\'key\');\\\\n\\\\n/** get the node from a namedNode */\\\\nvar nodeOf = attr(\'node\');\\\\n/** \\\\n * This file provides various listeners which can be used to build up\\\\n * a changing ascent based on the callbacks provided by Clarinet. It listens\\\\n * to the low-level events from Clarinet and emits higher-level ones.\\\\n *  \\\\n * The building up is stateless so to track a JSON file\\\\n * ascentManager.js is required to store the ascent state\\\\n * between calls.\\\\n */\\\\n\\\\n\\\\n\\\\n/** \\\\n * A special value to use in the path list to represent the path \'to\' a root \\\\n * object (which doesn\'t really have any path). This prevents the need for \\\\n * special-casing detection of the root object and allows it to be treated \\\\n * like any other object. We might think of this as being similar to the \\\\n * \'unnamed root\' domain \\\\\\".\\\\\\", eg if I go to \\\\n * http://en.wikipedia.org./wiki/En/Main_page the dot after \'org\' deliminates \\\\n * the unnamed root of the DNS.\\\\n * \\\\n * This is kept as an object to take advantage that in Javascript\'s OO objects \\\\n * are guaranteed to be distinct, therefore no other object can possibly clash \\\\n * with this one. Strings, numbers etc provide no such guarantee. \\\\n **/\\\\nvar ROOT_PATH = {};\\\\n\\\\n\\\\n/**\\\\n * Create a new set of handlers for clarinet\'s events, bound to the emit \\\\n * function given.  \\\\n */ \\\\nfunction incrementalContentBuilder( oboeBus ) {\\\\n\\\\n   var emitNodeOpened = oboeBus(NODE_OPENED).emit,\\\\n       emitNodeClosed = oboeBus(NODE_CLOSED).emit,\\\\n       emitRootOpened = oboeBus(ROOT_PATH_FOUND).emit,\\\\n       emitRootClosed = oboeBus(ROOT_NODE_FOUND).emit;\\\\n\\\\n   function arrayIndicesAreKeys( possiblyInconsistentAscent, newDeepestNode) {\\\\n   \\\\n      /* for values in arrays we aren\'t pre-warned of the coming paths \\\\n         (Clarinet gives no call to onkey like it does for values in objects) \\\\n         so if we are in an array we need to create this path ourselves. The \\\\n         key will be len(parentNode) because array keys are always sequential \\\\n         numbers. */\\\\n\\\\n      var parentNode = nodeOf( head( possiblyInconsistentAscent));\\\\n      \\\\n      return      isOfType( Array, parentNode)\\\\n               ?\\\\n                  keyFound(  possiblyInconsistentAscent, \\\\n                              len(parentNode), \\\\n                              newDeepestNode\\\\n                  )\\\\n               :  \\\\n                  // nothing needed, return unchanged\\\\n                  possiblyInconsistentAscent \\\\n               ;\\\\n   }\\\\n                 \\\\n   function nodeOpened( ascent, newDeepestNode ) {\\\\n      \\\\n      if( !ascent ) {\\\\n         // we discovered the root node,         \\\\n         emitRootOpened( newDeepestNode);\\\\n                    \\\\n         return keyFound( ascent, ROOT_PATH, newDeepestNode);         \\\\n      }\\\\n\\\\n      // we discovered a non-root node\\\\n                 \\\\n      var arrayConsistentAscent  = arrayIndicesAreKeys( ascent, newDeepestNode),      \\\\n          ancestorBranches       = tail( arrayConsistentAscent),\\\\n          previouslyUnmappedName = keyOf( head( arrayConsistentAscent));\\\\n          \\\\n      appendBuiltContent( \\\\n         ancestorBranches, \\\\n         previouslyUnmappedName, \\\\n         newDeepestNode \\\\n      );\\\\n                                                                                                         \\\\n      return cons( \\\\n               namedNode( previouslyUnmappedName, newDeepestNode ), \\\\n               ancestorBranches\\\\n      );                                                                          \\\\n   }\\\\n\\\\n\\\\n   /**\\\\n    * Add a new value to the object we are building up to represent the\\\\n    * parsed JSON\\\\n    */\\\\n   function appendBuiltContent( ancestorBranches, key, node ){\\\\n     \\\\n      nodeOf( head( ancestorBranches))[key] = node;\\\\n   }\\\\n\\\\n     \\\\n   /**\\\\n    * For when we find a new key in the json.\\\\n    * \\\\n    * @param {String|Number|Object} newDeepestName the key. If we are in an \\\\n    *    array will be a number, otherwise a string. May take the special \\\\n    *    value ROOT_PATH if the root node has just been found\\\\n    *    \\\\n    * @param {String|Number|Object|Array|Null|undefined} [maybeNewDeepestNode] \\\\n    *    usually this won\'t be known so can be undefined. Can\'t use null \\\\n    *    to represent unknown because null is a valid value in JSON\\\\n    **/  \\\\n   function keyFound(ascent, newDeepestName, maybeNewDeepestNode) {\\\\n\\\\n      if( ascent ) { // if not root\\\\n      \\\\n         // If we have the key but (unless adding to an array) no known value\\\\n         // yet. Put that key in the output but against no defined value:      \\\\n         appendBuiltContent( ascent, newDeepestName, maybeNewDeepestNode );\\\\n      }\\\\n   \\\\n      var ascentWithNewPath = cons( \\\\n                                 namedNode( newDeepestName, \\\\n                                            maybeNewDeepestNode), \\\\n                                 ascent\\\\n                              );\\\\n\\\\n      emitNodeOpened( ascentWithNewPath);\\\\n \\\\n      return ascentWithNewPath;\\\\n   }\\\\n\\\\n\\\\n   /**\\\\n    * For when the current node ends.\\\\n    */\\\\n   function nodeClosed( ascent ) {\\\\n\\\\n      emitNodeClosed( ascent);\\\\n       \\\\n      return tail( ascent) ||\\\\n             // If there are no nodes left in the ascent the root node\\\\n             // just closed. Emit a special event for this: \\\\n             emitRootClosed(nodeOf(head(ascent)));\\\\n   }      \\\\n\\\\n   var contentBuilderHandlers = {};\\\\n   contentBuilderHandlers[SAX_VALUE_OPEN] = nodeOpened;\\\\n   contentBuilderHandlers[SAX_VALUE_CLOSE] = nodeClosed;\\\\n   contentBuilderHandlers[SAX_KEY] = keyFound;\\\\n   return contentBuilderHandlers;\\\\n}\\\\n\\\\n/**\\\\n * The jsonPath evaluator compiler used for Oboe.js. \\\\n * \\\\n * One function is exposed. This function takes a String JSONPath spec and \\\\n * returns a function to test candidate ascents for matches.\\\\n * \\\\n *  String jsonPath -> (List ascent) -> Boolean|Object\\\\n *\\\\n * This file is coded in a pure functional style. That is, no function has \\\\n * side effects, every function evaluates to the same value for the same \\\\n * arguments and no variables are reassigned.\\\\n */  \\\\n// the call to jsonPathSyntax injects the token syntaxes that are needed \\\\n// inside the compiler\\\\nvar jsonPathCompiler = jsonPathSyntax(function (pathNodeSyntax, \\\\n                                                doubleDotSyntax, \\\\n                                                dotSyntax,\\\\n                                                bangSyntax,\\\\n                                                emptySyntax ) {\\\\n\\\\n   var CAPTURING_INDEX = 1;\\\\n   var NAME_INDEX = 2;\\\\n   var FIELD_LIST_INDEX = 3;\\\\n\\\\n   var headKey  = compose2(keyOf, head),\\\\n       headNode = compose2(nodeOf, head);\\\\n                   \\\\n   /**\\\\n    * Create an evaluator function for a named path node, expressed in the\\\\n    * JSONPath like:\\\\n    *    foo\\\\n    *    [\\\\\\"bar\\\\\\"]\\\\n    *    [2]   \\\\n    */\\\\n   function nameClause(previousExpr, detection ) {\\\\n     \\\\n      var name = detection[NAME_INDEX],\\\\n            \\\\n          matchesName = ( !name || name == \'*\' ) \\\\n                           ?  always\\\\n                           :  function(ascent){return headKey(ascent) == name};\\\\n     \\\\n\\\\n      return lazyIntersection(matchesName, previousExpr);\\\\n   }\\\\n\\\\n   /**\\\\n    * Create an evaluator function for a a duck-typed node, expressed like:\\\\n    * \\\\n    *    {spin, taste, colour}\\\\n    *    .particle{spin, taste, colour}\\\\n    *    *{spin, taste, colour}\\\\n    */\\\\n   function duckTypeClause(previousExpr, detection) {\\\\n\\\\n      var fieldListStr = detection[FIELD_LIST_INDEX];\\\\n\\\\n      if (!fieldListStr) \\\\n         return previousExpr; // don\'t wrap at all, return given expr as-is      \\\\n\\\\n      var hasAllrequiredFields = partialComplete(\\\\n                                    hasAllProperties, \\\\n                                    arrayAsList(fieldListStr.split(/\\\\\\\\W+/))\\\\n                                 ),\\\\n                                 \\\\n          isMatch =  compose2( \\\\n                        hasAllrequiredFields, \\\\n                        headNode\\\\n                     );\\\\n\\\\n      return lazyIntersection(isMatch, previousExpr);\\\\n   }\\\\n\\\\n   /**\\\\n    * Expression for $, returns the evaluator function\\\\n    */\\\\n   function capture( previousExpr, detection ) {\\\\n\\\\n      // extract meaning from the detection      \\\\n      var capturing = !!detection[CAPTURING_INDEX];\\\\n\\\\n      if (!capturing)          \\\\n         return previousExpr; // don\'t wrap at all, return given expr as-is      \\\\n      \\\\n      return lazyIntersection(previousExpr, head);\\\\n            \\\\n   }            \\\\n      \\\\n   /**\\\\n    * Create an evaluator function that moves onto the next item on the \\\\n    * lists. This function is the place where the logic to move up a \\\\n    * level in the ascent exists. \\\\n    * \\\\n    * Eg, for JSONPath \\\\\\".foo\\\\\\" we need skip1(nameClause(always, [,\'foo\']))\\\\n    */\\\\n   function skip1(previousExpr) {\\\\n   \\\\n   \\\\n      if( previousExpr == always ) {\\\\n         /* If there is no previous expression this consume command \\\\n            is at the start of the jsonPath.\\\\n            Since JSONPath specifies what we\'d like to find but not \\\\n            necessarily everything leading down to it, when running\\\\n            out of JSONPath to check against we default to true */\\\\n         return always;\\\\n      }\\\\n\\\\n      /** return true if the ascent we have contains only the JSON root,\\\\n       *  false otherwise\\\\n       */\\\\n      function notAtRoot(ascent){\\\\n         return headKey(ascent) != ROOT_PATH;\\\\n      }\\\\n      \\\\n      return lazyIntersection(\\\\n               /* If we\'re already at the root but there are more \\\\n                  expressions to satisfy, can\'t consume any more. No match.\\\\n\\\\n                  This check is why none of the other exprs have to be able \\\\n                  to handle empty lists; skip1 is the only evaluator that \\\\n                  moves onto the next token and it refuses to do so once it \\\\n                  reaches the last item in the list. */\\\\n               notAtRoot,\\\\n               \\\\n               /* We are not at the root of the ascent yet.\\\\n                  Move to the next level of the ascent by handing only \\\\n                  the tail to the previous expression */ \\\\n               compose2(previousExpr, tail) \\\\n      );\\\\n                                                                                                               \\\\n   }   \\\\n   \\\\n   /**\\\\n    * Create an evaluator function for the .. (double dot) token. Consumes\\\\n    * zero or more levels of the ascent, the fewest that are required to find\\\\n    * a match when given to previousExpr.\\\\n    */   \\\\n   function skipMany(previousExpr) {\\\\n\\\\n      if( previousExpr == always ) {\\\\n         /* If there is no previous expression this consume command \\\\n            is at the start of the jsonPath.\\\\n            Since JSONPath specifies what we\'d like to find but not \\\\n            necessarily everything leading down to it, when running\\\\n            out of JSONPath to check against we default to true */            \\\\n         return always;\\\\n      }\\\\n          \\\\n      var \\\\n          // In JSONPath .. is equivalent to !.. so if .. reaches the root\\\\n          // the match has succeeded. Ie, we might write ..foo or !..foo\\\\n          // and both should match identically.\\\\n          terminalCaseWhenArrivingAtRoot = rootExpr(),\\\\n          terminalCaseWhenPreviousExpressionIsSatisfied = previousExpr,\\\\n          recursiveCase = skip1(function(ascent) {\\\\n             return cases(ascent);\\\\n          }),\\\\n\\\\n          cases = lazyUnion(\\\\n                     terminalCaseWhenArrivingAtRoot\\\\n                  ,  terminalCaseWhenPreviousExpressionIsSatisfied\\\\n                  ,  recursiveCase  \\\\n                  );\\\\n      \\\\n      return cases;\\\\n   }      \\\\n   \\\\n   /**\\\\n    * Generate an evaluator for ! - matches only the root element of the json\\\\n    * and ignores any previous expressions since nothing may precede !. \\\\n    */   \\\\n   function rootExpr() {\\\\n      \\\\n      return function(ascent){\\\\n         return headKey(ascent) == ROOT_PATH;\\\\n      };\\\\n   }   \\\\n         \\\\n   /**\\\\n    * Generate a statement wrapper to sit around the outermost \\\\n    * clause evaluator.\\\\n    * \\\\n    * Handles the case where the capturing is implicit because the JSONPath\\\\n    * did not contain a \'$\' by returning the last node.\\\\n    */   \\\\n   function statementExpr(lastClause) {\\\\n      \\\\n      return function(ascent) {\\\\n   \\\\n         // kick off the evaluation by passing through to the last clause\\\\n         var exprMatch = lastClause(ascent);\\\\n                                                     \\\\n         return exprMatch === true ? head(ascent) : exprMatch;\\\\n      };\\\\n   }      \\\\n                          \\\\n   /**\\\\n    * For when a token has been found in the JSONPath input.\\\\n    * Compiles the parser for that token and returns in combination with the\\\\n    * parser already generated.\\\\n    * \\\\n    * @param {Function} exprs  a list of the clause evaluator generators for\\\\n    *                          the token that was found\\\\n    * @param {Function} parserGeneratedSoFar the parser already found\\\\n    * @param {Array} detection the match given by the regex engine when \\\\n    *                          the feature was found\\\\n    */\\\\n   function expressionsReader( exprs, parserGeneratedSoFar, detection ) {\\\\n                     \\\\n      // if exprs is zero-length foldR will pass back the \\\\n      // parserGeneratedSoFar as-is so we don\'t need to treat \\\\n      // this as a special case\\\\n      \\\\n      return   foldR( \\\\n                  function( parserGeneratedSoFar, expr ){\\\\n         \\\\n                     return expr(parserGeneratedSoFar, detection);\\\\n                  }, \\\\n                  parserGeneratedSoFar, \\\\n                  exprs\\\\n               );                     \\\\n\\\\n   }\\\\n\\\\n   /** \\\\n    *  If jsonPath matches the given detector function, creates a function which\\\\n    *  evaluates against every clause in the clauseEvaluatorGenerators. The\\\\n    *  created function is propagated to the onSuccess function, along with\\\\n    *  the remaining unparsed JSONPath substring.\\\\n    *  \\\\n    *  The intended use is to create a clauseMatcher by filling in\\\\n    *  the first two arguments, thus providing a function that knows\\\\n    *  some syntax to match and what kind of generator to create if it\\\\n    *  finds it. The parameter list once completed is:\\\\n    *  \\\\n    *    (jsonPath, parserGeneratedSoFar, onSuccess)\\\\n    *  \\\\n    *  onSuccess may be compileJsonPathToFunction, to recursively continue \\\\n    *  parsing after finding a match or returnFoundParser to stop here.\\\\n    */\\\\n   function generateClauseReaderIfTokenFound (\\\\n     \\\\n                        tokenDetector, clauseEvaluatorGenerators,\\\\n                         \\\\n                        jsonPath, parserGeneratedSoFar, onSuccess) {\\\\n                        \\\\n      var detected = tokenDetector(jsonPath);\\\\n\\\\n      if(detected) {\\\\n         var compiledParser = expressionsReader(\\\\n                                 clauseEvaluatorGenerators, \\\\n                                 parserGeneratedSoFar, \\\\n                                 detected\\\\n                              ),\\\\n         \\\\n             remainingUnparsedJsonPath = jsonPath.substr(len(detected[0]));                \\\\n                               \\\\n         return onSuccess(remainingUnparsedJsonPath, compiledParser);\\\\n      }         \\\\n   }\\\\n                 \\\\n   /**\\\\n    * Partially completes generateClauseReaderIfTokenFound above. \\\\n    */\\\\n   function clauseMatcher(tokenDetector, exprs) {\\\\n        \\\\n      return   partialComplete( \\\\n                  generateClauseReaderIfTokenFound, \\\\n                  tokenDetector, \\\\n                  exprs \\\\n               );\\\\n   }\\\\n\\\\n   /**\\\\n    * clauseForJsonPath is a function which attempts to match against \\\\n    * several clause matchers in order until one matches. If non match the\\\\n    * jsonPath expression is invalid and an error is thrown.\\\\n    * \\\\n    * The parameter list is the same as a single clauseMatcher:\\\\n    * \\\\n    *    (jsonPath, parserGeneratedSoFar, onSuccess)\\\\n    */     \\\\n   var clauseForJsonPath = lazyUnion(\\\\n\\\\n      clauseMatcher(pathNodeSyntax   , list( capture, \\\\n                                             duckTypeClause, \\\\n                                             nameClause, \\\\n                                             skip1 ))\\\\n                                                     \\\\n   ,  clauseMatcher(doubleDotSyntax  , list( skipMany))\\\\n       \\\\n       // dot is a separator only (like whitespace in other languages) but \\\\n       // rather than make it a special case, use an empty list of \\\\n       // expressions when this token is found\\\\n   ,  clauseMatcher(dotSyntax        , list() )  \\\\n                                                                                      \\\\n   ,  clauseMatcher(bangSyntax       , list( capture,\\\\n                                             rootExpr))\\\\n                                                          \\\\n   ,  clauseMatcher(emptySyntax      , list( statementExpr))\\\\n   \\\\n   ,  function (jsonPath) {\\\\n         throw Error(\'\\\\\\"\' + jsonPath + \'\\\\\\" could not be tokenised\')      \\\\n      }\\\\n   );\\\\n\\\\n\\\\n   /**\\\\n    * One of two possible values for the onSuccess argument of \\\\n    * generateClauseReaderIfTokenFound.\\\\n    * \\\\n    * When this function is used, generateClauseReaderIfTokenFound simply \\\\n    * returns the compiledParser that it made, regardless of if there is \\\\n    * any remaining jsonPath to be compiled.\\\\n    */\\\\n   function returnFoundParser(_remainingJsonPath, compiledParser){ \\\\n      return compiledParser \\\\n   }     \\\\n              \\\\n   /**\\\\n    * Recursively compile a JSONPath expression.\\\\n    * \\\\n    * This function serves as one of two possible values for the onSuccess \\\\n    * argument of generateClauseReaderIfTokenFound, meaning continue to\\\\n    * recursively compile. Otherwise, returnFoundParser is given and\\\\n    * compilation terminates.\\\\n    */\\\\n   function compileJsonPathToFunction( uncompiledJsonPath, \\\\n                                       parserGeneratedSoFar ) {\\\\n\\\\n      /**\\\\n       * On finding a match, if there is remaining text to be compiled\\\\n       * we want to either continue parsing using a recursive call to \\\\n       * compileJsonPathToFunction. Otherwise, we want to stop and return \\\\n       * the parser that we have found so far.\\\\n       */\\\\n      var onFind =      uncompiledJsonPath\\\\n                     ?  compileJsonPathToFunction \\\\n                     :  returnFoundParser;\\\\n                   \\\\n      return   clauseForJsonPath( \\\\n                  uncompiledJsonPath, \\\\n                  parserGeneratedSoFar, \\\\n                  onFind\\\\n               );                              \\\\n   }\\\\n\\\\n   /**\\\\n    * This is the function that we expose to the rest of the library.\\\\n    */\\\\n   return function(jsonPath){\\\\n        \\\\n      try {\\\\n         // Kick off the recursive parsing of the jsonPath \\\\n         return compileJsonPathToFunction(jsonPath, always);\\\\n         \\\\n      } catch( e ) {\\\\n         throw Error( \'Could not compile \\\\\\"\' + jsonPath + \\\\n                      \'\\\\\\" because \' + e.message\\\\n         );\\\\n      }\\\\n   }\\\\n\\\\n});\\\\n\\\\n/** \\\\n * A pub/sub which is responsible for a single event type. A \\\\n * multi-event type event bus is created by pubSub by collecting\\\\n * several of these.\\\\n * \\\\n * @param {String} eventType                   \\\\n *    the name of the events managed by this singleEventPubSub\\\\n * @param {singleEventPubSub} [newListener]    \\\\n *    place to notify of new listeners\\\\n * @param {singleEventPubSub} [removeListener] \\\\n *    place to notify of when listeners are removed\\\\n */\\\\nfunction singleEventPubSub(eventType, newListener, removeListener){\\\\n\\\\n   /** we are optimised for emitting events over firing them.\\\\n    *  As well as the tuple list which stores event ids and\\\\n    *  listeners there is a list with just the listeners which \\\\n    *  can be iterated more quickly when we are emitting\\\\n    */\\\\n   var listenerTupleList,\\\\n       listenerList;\\\\n\\\\n   function hasId(id){\\\\n      return function(tuple) {\\\\n         return tuple.id == id;      \\\\n      };  \\\\n   }\\\\n              \\\\n   return {\\\\n\\\\n      /**\\\\n       * @param {Function} listener\\\\n       * @param {*} listenerId \\\\n       *    an id that this listener can later by removed by. \\\\n       *    Can be of any type, to be compared to other ids using ==\\\\n       */\\\\n      on:function( listener, listenerId ) {\\\\n         \\\\n         var tuple = {\\\\n            listener: listener\\\\n         ,  id:       listenerId || listener // when no id is given use the\\\\n                                             // listener function as the id\\\\n         };\\\\n\\\\n         if( newListener ) {\\\\n            newListener.emit(eventType, listener, tuple.id);\\\\n         }\\\\n         \\\\n         listenerTupleList = cons( tuple,    listenerTupleList );\\\\n         listenerList      = cons( listener, listenerList      );\\\\n\\\\n         return this; // chaining\\\\n      },\\\\n     \\\\n      emit:function () {                                                                                           \\\\n         applyEach( listenerList, arguments );\\\\n      },\\\\n      \\\\n      un: function( listenerId ) {\\\\n             \\\\n         var removed;             \\\\n              \\\\n         listenerTupleList = without(\\\\n            listenerTupleList,\\\\n            hasId(listenerId),\\\\n            function(tuple){\\\\n               removed = tuple;\\\\n            }\\\\n         );    \\\\n         \\\\n         if( removed ) {\\\\n            listenerList = without( listenerList, function(listener){\\\\n               return listener == removed.listener;\\\\n            });\\\\n         \\\\n            if( removeListener ) {\\\\n               removeListener.emit(eventType, removed.listener, removed.id);\\\\n            }\\\\n         }\\\\n      },\\\\n      \\\\n      listeners: function(){\\\\n         // differs from Node EventEmitter: returns list, not array\\\\n         return listenerList;\\\\n      },\\\\n      \\\\n      hasListener: function(listenerId){\\\\n         var test = listenerId? hasId(listenerId) : always;\\\\n      \\\\n         return defined(first( test, listenerTupleList));\\\\n      }\\\\n   };\\\\n}\\\\n/**\\\\n * pubSub is a curried interface for listening to and emitting\\\\n * events.\\\\n * \\\\n * If we get a bus:\\\\n *    \\\\n *    var bus = pubSub();\\\\n * \\\\n * We can listen to event \'foo\' like:\\\\n * \\\\n *    bus(\'foo\').on(myCallback)\\\\n *    \\\\n * And emit event foo like:\\\\n * \\\\n *    bus(\'foo\').emit()\\\\n *    \\\\n * or, with a parameter:\\\\n * \\\\n *    bus(\'foo\').emit(\'bar\')\\\\n *     \\\\n * All functions can be cached and don\'t need to be \\\\n * bound. Ie:\\\\n * \\\\n *    var fooEmitter = bus(\'foo\').emit\\\\n *    fooEmitter(\'bar\');  // emit an event\\\\n *    fooEmitter(\'baz\');  // emit another\\\\n *    \\\\n * There\'s also an uncurried[1] shortcut for .emit and .on:\\\\n * \\\\n *    bus.on(\'foo\', callback)\\\\n *    bus.emit(\'foo\', \'bar\')\\\\n * \\\\n * [1]: http://zvon.org/other/haskell/Outputprelude/uncurry_f.html\\\\n */\\\\nfunction pubSub(){\\\\n\\\\n   var singles = {},\\\\n       newListener = newSingle(\'newListener\'),\\\\n       removeListener = newSingle(\'removeListener\'); \\\\n      \\\\n   function newSingle(eventName) {\\\\n      return singles[eventName] = singleEventPubSub(\\\\n         eventName, \\\\n         newListener, \\\\n         removeListener\\\\n      );   \\\\n   }      \\\\n\\\\n   /** pubSub instances are functions */\\\\n   function pubSubInstance( eventName ){   \\\\n      \\\\n      return singles[eventName] || newSingle( eventName );   \\\\n   }\\\\n\\\\n   // add convenience EventEmitter-style uncurried form of \'emit\' and \'on\'\\\\n   [\'emit\', \'on\', \'un\'].forEach(function(methodName){\\\\n   \\\\n      pubSubInstance[methodName] = varArgs(function(eventName, parameters){\\\\n         apply( parameters, pubSubInstance( eventName )[methodName]);\\\\n      });   \\\\n   });\\\\n         \\\\n   return pubSubInstance;\\\\n}\\\\n\\\\n/**\\\\n * This file declares some constants to use as names for event types.\\\\n */\\\\n\\\\nvar // the events which are never exported are kept as \\\\n    // the smallest possible representation, in numbers:\\\\n    _S = 1,\\\\n\\\\n    // fired whenever a new node starts in the JSON stream:\\\\n    NODE_OPENED     = _S++,\\\\n\\\\n    // fired whenever a node closes in the JSON stream:\\\\n    NODE_CLOSED     = _S++,\\\\n\\\\n    // called if a .node callback returns a value - \\\\n    NODE_SWAP       = _S++,\\\\n    NODE_DROP       = _S++,\\\\n\\\\n    FAIL_EVENT      = \'fail\',\\\\n   \\\\n    ROOT_NODE_FOUND = _S++,\\\\n    ROOT_PATH_FOUND = _S++,\\\\n   \\\\n    HTTP_START      = \'start\',\\\\n    STREAM_DATA     = \'data\',\\\\n    STREAM_END      = \'end\',\\\\n    ABORTING        = _S++,\\\\n\\\\n    // SAX events butchered from Clarinet\\\\n    SAX_KEY          = _S++,\\\\n    SAX_VALUE_OPEN   = _S++,\\\\n    SAX_VALUE_CLOSE  = _S++;\\\\n    \\\\nfunction errorReport(statusCode, body, error) {\\\\n   try{\\\\n      var jsonBody = JSON.parse(body);\\\\n   }catch(e){}\\\\n\\\\n   return {\\\\n      statusCode:statusCode,\\\\n      body:body,\\\\n      jsonBody:jsonBody,\\\\n      thrown:error\\\\n   };\\\\n}    \\\\n\\\\n/** \\\\n *  The pattern adaptor listens for newListener and removeListener\\\\n *  events. When patterns are added or removed it compiles the JSONPath\\\\n *  and wires them up.\\\\n *  \\\\n *  When nodes and paths are found it emits the fully-qualified match \\\\n *  events with parameters ready to ship to the outside world\\\\n */\\\\n\\\\nfunction patternAdapter(oboeBus, jsonPathCompiler) {\\\\n\\\\n   var predicateEventMap = {\\\\n      node:oboeBus(NODE_CLOSED)\\\\n   ,  path:oboeBus(NODE_OPENED)\\\\n   };\\\\n     \\\\n   function emitMatchingNode(emitMatch, node, ascent) {\\\\n         \\\\n      /* \\\\n         We\'re now calling to the outside world where Lisp-style \\\\n         lists will not be familiar. Convert to standard arrays. \\\\n   \\\\n         Also, reverse the order because it is more common to \\\\n         list paths \\\\\\"root to leaf\\\\\\" than \\\\\\"leaf to root\\\\\\"  */\\\\n      var descent     = reverseList(ascent);\\\\n                \\\\n      emitMatch(\\\\n         node,\\\\n         \\\\n         // To make a path, strip off the last item which is the special\\\\n         // ROOT_PATH token for the \'path\' to the root node          \\\\n         listAsArray(tail(map(keyOf,descent))),  // path\\\\n         listAsArray(map(nodeOf, descent))       // ancestors    \\\\n      );         \\\\n   }\\\\n\\\\n   /* \\\\n    * Set up the catching of events such as NODE_CLOSED and NODE_OPENED and, if \\\\n    * matching the specified pattern, propagate to pattern-match events such as \\\\n    * oboeBus(\'node:!\')\\\\n    * \\\\n    * \\\\n    * \\\\n    * @param {Function} predicateEvent \\\\n    *          either oboeBus(NODE_CLOSED) or oboeBus(NODE_OPENED).\\\\n    * @param {Function} compiledJsonPath          \\\\n    */\\\\n   function addUnderlyingListener( fullEventName, predicateEvent, compiledJsonPath ){\\\\n   \\\\n      var emitMatch = oboeBus(fullEventName).emit;\\\\n   \\\\n      predicateEvent.on( function (ascent) {\\\\n\\\\n         var maybeMatchingMapping = compiledJsonPath(ascent);\\\\n\\\\n         /* Possible values for maybeMatchingMapping are now:\\\\n\\\\n          false: \\\\n          we did not match \\\\n\\\\n          an object/array/string/number/null: \\\\n          we matched and have the node that matched.\\\\n          Because nulls are valid json values this can be null.\\\\n\\\\n          undefined:\\\\n          we matched but don\'t have the matching node yet.\\\\n          ie, we know there is an upcoming node that matches but we \\\\n          can\'t say anything else about it. \\\\n          */\\\\n         if (maybeMatchingMapping !== false) {\\\\n\\\\n            emitMatchingNode(\\\\n               emitMatch, \\\\n               nodeOf(maybeMatchingMapping), \\\\n               ascent\\\\n            );\\\\n         }\\\\n      }, fullEventName);\\\\n     \\\\n      oboeBus(\'removeListener\').on( function(removedEventName){\\\\n\\\\n         // if the fully qualified match event listener is later removed, clean up \\\\n         // by removing the underlying listener if it was the last using that pattern:\\\\n      \\\\n         if( removedEventName == fullEventName ) {\\\\n         \\\\n            if( !oboeBus(removedEventName).listeners(  )) {\\\\n               predicateEvent.un( fullEventName );\\\\n            }\\\\n         }\\\\n      });   \\\\n   }\\\\n\\\\n   oboeBus(\'newListener\').on( function(fullEventName){\\\\n\\\\n      var match = /(node|path):(.*)/.exec(fullEventName);\\\\n      \\\\n      if( match ) {\\\\n         var predicateEvent = predicateEventMap[match[1]];\\\\n                    \\\\n         if( !predicateEvent.hasListener( fullEventName) ) {  \\\\n                  \\\\n            addUnderlyingListener(\\\\n               fullEventName,\\\\n               predicateEvent, \\\\n               jsonPathCompiler( match[2] )\\\\n            );\\\\n         }\\\\n      }    \\\\n   })\\\\n\\\\n}\\\\n\\\\n/**\\\\n * The instance API is the thing that is returned when oboe() is called.\\\\n * it allows:\\\\n *\\\\n *    - listeners for various events to be added and removed\\\\n *    - the http response header/headers to be read\\\\n */\\\\nfunction instanceApi(oboeBus, contentSource){\\\\n\\\\n   var oboeApi,\\\\n       fullyQualifiedNamePattern = /^(node|path):./,\\\\n       rootNodeFinishedEvent = oboeBus(ROOT_NODE_FOUND),\\\\n       emitNodeDrop = oboeBus(NODE_DROP).emit,\\\\n       emitNodeSwap = oboeBus(NODE_SWAP).emit,\\\\n\\\\n       /**\\\\n        * Add any kind of listener that the instance api exposes\\\\n        */\\\\n       addListener = varArgs(function( eventId, parameters ){\\\\n\\\\n            if( oboeApi[eventId] ) {\\\\n\\\\n               // for events added as .on(event, callback), if there is a\\\\n               // .event() equivalent with special behaviour , pass through\\\\n               // to that:\\\\n               apply(parameters, oboeApi[eventId]);\\\\n            } else {\\\\n\\\\n               // we have a standard Node.js EventEmitter 2-argument call.\\\\n               // The first parameter is the listener.\\\\n               var event = oboeBus(eventId),\\\\n                   listener = parameters[0];\\\\n\\\\n               if( fullyQualifiedNamePattern.test(eventId) ) {\\\\n\\\\n                  // allow fully-qualified node/path listeners\\\\n                  // to be added\\\\n                  addForgettableCallback(event, listener);\\\\n               } else  {\\\\n\\\\n                  // the event has no special handling, pass through\\\\n                  // directly onto the event bus:\\\\n                  event.on( listener);\\\\n               }\\\\n            }\\\\n\\\\n            return oboeApi; // chaining\\\\n       }),\\\\n\\\\n       /**\\\\n        * Remove any kind of listener that the instance api exposes\\\\n        */\\\\n       removeListener = function( eventId, p2, p3 ){\\\\n\\\\n            if( eventId == \'done\' ) {\\\\n\\\\n               rootNodeFinishedEvent.un(p2);\\\\n\\\\n            } else if( eventId == \'node\' || eventId == \'path\' ) {\\\\n\\\\n               // allow removal of node and path\\\\n               oboeBus.un(eventId + \':\' + p2, p3);\\\\n            } else {\\\\n\\\\n               // we have a standard Node.js EventEmitter 2-argument call.\\\\n               // The second parameter is the listener. This may be a call\\\\n               // to remove a fully-qualified node/path listener but requires\\\\n               // no special handling\\\\n               var listener = p2;\\\\n\\\\n               oboeBus(eventId).un(listener);\\\\n            }\\\\n\\\\n            return oboeApi; // chaining\\\\n       };\\\\n\\\\n   /**\\\\n    * Add a callback, wrapped in a try/catch so as to not break the\\\\n    * execution of Oboe if an exception is thrown (fail events are\\\\n    * fired instead)\\\\n    *\\\\n    * The callback is used as the listener id so that it can later be\\\\n    * removed using .un(callback)\\\\n    */\\\\n   function addProtectedCallback(eventName, callback) {\\\\n      oboeBus(eventName).on(protectedCallback(callback), callback);\\\\n      return oboeApi; // chaining\\\\n   }\\\\n\\\\n   /**\\\\n    * Add a callback where, if .forget() is called during the callback\'s\\\\n    * execution, the callback will be de-registered\\\\n    */\\\\n   function addForgettableCallback(event, callback, listenerId) {\\\\n\\\\n      // listenerId is optional and if not given, the original\\\\n      // callback will be used\\\\n      listenerId = listenerId || callback;\\\\n\\\\n      var safeCallback = protectedCallback(callback);\\\\n\\\\n      event.on( function() {\\\\n\\\\n         var discard = false;\\\\n\\\\n         oboeApi.forget = function(){\\\\n            discard = true;\\\\n         };\\\\n\\\\n         apply( arguments, safeCallback );\\\\n\\\\n         delete oboeApi.forget;\\\\n\\\\n         if( discard ) {\\\\n            event.un(listenerId);\\\\n         }\\\\n      }, listenerId);\\\\n\\\\n      return oboeApi; // chaining\\\\n   }\\\\n\\\\n   /**\\\\n    *  wrap a callback so that if it throws, Oboe.js doesn\'t crash but instead\\\\n    *  throw the error in another event loop\\\\n    */\\\\n   function protectedCallback( callback ) {\\\\n      return function() {\\\\n         try{\\\\n            return callback.apply(oboeApi, arguments);\\\\n         }catch(e)  {\\\\n            setTimeout(function() {\\\\n              throw e;\\\\n            });\\\\n         }\\\\n      }\\\\n   }\\\\n\\\\n   /**\\\\n    * Return the fully qualified event for when a pattern matches\\\\n    * either a node or a path\\\\n    *\\\\n    * @param type {String} either \'node\' or \'path\'\\\\n    */\\\\n   function fullyQualifiedPatternMatchEvent(type, pattern) {\\\\n      return oboeBus(type + \':\' + pattern);\\\\n   }\\\\n\\\\n   function wrapCallbackToSwapNodeIfSomethingReturned( callback ) {\\\\n      return function() {\\\\n         var returnValueFromCallback = callback.apply(this, arguments);\\\\n\\\\n         if( defined(returnValueFromCallback) ) {\\\\n\\\\n            if( returnValueFromCallback == oboe.drop ) {\\\\n               emitNodeDrop();\\\\n            } else {\\\\n               emitNodeSwap(returnValueFromCallback);\\\\n            }\\\\n         }\\\\n      }\\\\n   }\\\\n\\\\n   function addSingleNodeOrPathListener(eventId, pattern, callback) {\\\\n\\\\n      var effectiveCallback;\\\\n\\\\n      if( eventId == \'node\' ) {\\\\n         effectiveCallback = wrapCallbackToSwapNodeIfSomethingReturned(callback);\\\\n      } else {\\\\n         effectiveCallback = callback;\\\\n      }\\\\n\\\\n      addForgettableCallback(\\\\n         fullyQualifiedPatternMatchEvent(eventId, pattern),\\\\n         effectiveCallback,\\\\n         callback\\\\n      );\\\\n   }\\\\n\\\\n   /**\\\\n    * Add several listeners at a time, from a map\\\\n    */\\\\n   function addMultipleNodeOrPathListeners(eventId, listenerMap) {\\\\n\\\\n      for( var pattern in listenerMap ) {\\\\n         addSingleNodeOrPathListener(eventId, pattern, listenerMap[pattern]);\\\\n      }\\\\n   }\\\\n\\\\n   /**\\\\n    * implementation behind .onPath() and .onNode()\\\\n    */\\\\n   function addNodeOrPathListenerApi( eventId, jsonPathOrListenerMap, callback ){\\\\n\\\\n      if( isString(jsonPathOrListenerMap) ) {\\\\n         addSingleNodeOrPathListener(eventId, jsonPathOrListenerMap, callback);\\\\n\\\\n      } else {\\\\n         addMultipleNodeOrPathListeners(eventId, jsonPathOrListenerMap);\\\\n      }\\\\n\\\\n      return oboeApi; // chaining\\\\n   }\\\\n\\\\n\\\\n   // some interface methods are only filled in after we receive\\\\n   // values and are noops before that:\\\\n   oboeBus(ROOT_PATH_FOUND).on( function(rootNode) {\\\\n      oboeApi.root = functor(rootNode);\\\\n   });\\\\n\\\\n   /**\\\\n    * When content starts make the headers readable through the\\\\n    * instance API\\\\n    */\\\\n   oboeBus(HTTP_START).on( function(_statusCode, headers) {\\\\n\\\\n      oboeApi.header =  function(name) {\\\\n                           return name ? headers[name]\\\\n                                       : headers\\\\n                                       ;\\\\n                        }\\\\n   });\\\\n\\\\n   /**\\\\n    * Construct and return the public API of the Oboe instance to be\\\\n    * returned to the calling application\\\\n    */\\\\n   return oboeApi = {\\\\n      on             : addListener,\\\\n      addListener    : addListener,\\\\n      removeListener : removeListener,\\\\n      emit           : oboeBus.emit,\\\\n\\\\n      node           : partialComplete(addNodeOrPathListenerApi, \'node\'),\\\\n      path           : partialComplete(addNodeOrPathListenerApi, \'path\'),\\\\n\\\\n      done           : partialComplete(addForgettableCallback, rootNodeFinishedEvent),\\\\n      start          : partialComplete(addProtectedCallback, HTTP_START ),\\\\n\\\\n      // fail doesn\'t use protectedCallback because\\\\n      // could lead to non-terminating loops\\\\n      fail           : oboeBus(FAIL_EVENT).on,\\\\n\\\\n      // public api calling abort fires the ABORTING event\\\\n      abort          : oboeBus(ABORTING).emit,\\\\n\\\\n      // initially return nothing for header and root\\\\n      header         : noop,\\\\n      root           : noop,\\\\n\\\\n      source         : contentSource\\\\n   };\\\\n}\\\\n\\\\n/**\\\\n * This file sits just behind the API which is used to attain a new\\\\n * Oboe instance. It creates the new components that are required\\\\n * and introduces them to each other.\\\\n */\\\\n\\\\nfunction wire (httpMethodName, contentSource, body, headers, withCredentials){\\\\n\\\\n   var oboeBus = pubSub();\\\\n   \\\\n   // Wire the input stream in if we are given a content source.\\\\n   // This will usually be the case. If not, the instance created\\\\n   // will have to be passed content from an external source.\\\\n  \\\\n   if( contentSource ) {\\\\n\\\\n      streamingHttp( oboeBus,\\\\n                     httpTransport(), \\\\n                     httpMethodName,\\\\n                     contentSource,\\\\n                     body,\\\\n                     headers,\\\\n                     withCredentials\\\\n      );\\\\n   }\\\\n\\\\n   clarinet(oboeBus);\\\\n\\\\n   ascentManager(oboeBus, incrementalContentBuilder(oboeBus));\\\\n      \\\\n   patternAdapter(oboeBus, jsonPathCompiler);      \\\\n      \\\\n   return instanceApi(oboeBus, contentSource);\\\\n}\\\\n\\\\nfunction applyDefaults( passthrough, url, httpMethodName, body, headers, withCredentials, cached ){\\\\n\\\\n   headers = headers ?\\\\n      // Shallow-clone the headers array. This allows it to be\\\\n      // modified without side effects to the caller. We don\'t\\\\n      // want to change objects that the user passes in.\\\\n      JSON.parse(JSON.stringify(headers))\\\\n      : {};\\\\n\\\\n   if( body ) {\\\\n      if( !isString(body) ) {\\\\n\\\\n         // If the body is not a string, stringify it. This allows objects to\\\\n         // be given which will be sent as JSON.\\\\n         body = JSON.stringify(body);\\\\n\\\\n         // Default Content-Type to JSON unless given otherwise.\\\\n         headers[\'Content-Type\'] = headers[\'Content-Type\'] || \'application/json\';\\\\n      }\\\\n   } else {\\\\n      body = null;\\\\n   }\\\\n\\\\n   // support cache busting like jQuery.ajax({cache:false})\\\\n   function modifiedUrl(baseUrl, cached) {\\\\n\\\\n      if( cached === false ) {\\\\n\\\\n         if( baseUrl.indexOf(\'?\') == -1 ) {\\\\n            baseUrl += \'?\';\\\\n         } else {\\\\n            baseUrl += \'&\';\\\\n         }\\\\n\\\\n         baseUrl += \'_=\' + new Date().getTime();\\\\n      }\\\\n      return baseUrl;\\\\n   }\\\\n\\\\n   return passthrough( httpMethodName || \'GET\', modifiedUrl(url, cached), body, headers, withCredentials || false );\\\\n}\\\\n\\\\n// export public API\\\\nfunction oboe(arg1) {\\\\n\\\\n   // We use duck-typing to detect if the parameter given is a stream, with the\\\\n   // below list of parameters.\\\\n   // Unpipe and unshift would normally be present on a stream but this breaks\\\\n   // compatibility with Request streams.\\\\n   // See https://github.com/jimhigson/oboe.js/issues/65\\\\n   \\\\n   var nodeStreamMethodNames = list(\'resume\', \'pause\', \'pipe\'),\\\\n       isStream = partialComplete(\\\\n                     hasAllProperties\\\\n                  ,  nodeStreamMethodNames\\\\n                  );\\\\n   \\\\n   if( arg1 ) {\\\\n      if (isStream(arg1) || isString(arg1)) {\\\\n\\\\n         //  simple version for GETs. Signature is:\\\\n         //    oboe( url )\\\\n         //  or, under node:\\\\n         //    oboe( readableStream )\\\\n         return applyDefaults(\\\\n            wire,\\\\n            arg1 // url\\\\n         );\\\\n\\\\n      } else {\\\\n\\\\n         // method signature is:\\\\n         //    oboe({method:m, url:u, body:b, headers:{...}})\\\\n\\\\n         return applyDefaults(\\\\n            wire,\\\\n            arg1.url,\\\\n            arg1.method,\\\\n            arg1.body,\\\\n            arg1.headers,\\\\n            arg1.withCredentials,\\\\n            arg1.cached\\\\n         );\\\\n         \\\\n      }\\\\n   } else {\\\\n      // wire up a no-AJAX, no-stream Oboe. Will have to have content \\\\n      // fed in externally and using .emit.\\\\n      return wire();\\\\n   }\\\\n}\\\\n\\\\n/* oboe.drop is a special value. If a node callback returns this value the\\\\n   parsed node is deleted from the JSON\\\\n */\\\\noboe.drop = function() {\\\\n   return oboe.drop;\\\\n};\\\\n\\\\n\\\\n   if ( true ) {\\\\n      !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () { return oboe; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\\\\n\\\\t\\\\t\\\\t\\\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\\\n   } else if (typeof exports === \'object\') {\\\\n      module.exports = oboe;\\\\n   } else {\\\\n      window.oboe = oboe;\\\\n   }\\\\n})((function(){\\\\n   // Access to the window object throws an exception in HTML5 web workers so\\\\n   // point it to \\\\\\"self\\\\\\" if it runs in a web worker\\\\n      try {\\\\n         return window;\\\\n      } catch (e) {\\\\n         return self;\\\\n      }\\\\n   }()), Object, Array, Error, JSON);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/oboe/dist/oboe-browser.js\\\\n// module id = 284\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/oboe/dist/oboe-browser.js\\")},function(module,exports){eval(\'module.exports = {\\"2.16.840.1.101.3.4.1.1\\":\\"aes-128-ecb\\",\\"2.16.840.1.101.3.4.1.2\\":\\"aes-128-cbc\\",\\"2.16.840.1.101.3.4.1.3\\":\\"aes-128-ofb\\",\\"2.16.840.1.101.3.4.1.4\\":\\"aes-128-cfb\\",\\"2.16.840.1.101.3.4.1.21\\":\\"aes-192-ecb\\",\\"2.16.840.1.101.3.4.1.22\\":\\"aes-192-cbc\\",\\"2.16.840.1.101.3.4.1.23\\":\\"aes-192-ofb\\",\\"2.16.840.1.101.3.4.1.24\\":\\"aes-192-cfb\\",\\"2.16.840.1.101.3.4.1.41\\":\\"aes-256-ecb\\",\\"2.16.840.1.101.3.4.1.42\\":\\"aes-256-cbc\\",\\"2.16.840.1.101.3.4.1.43\\":\\"aes-256-ofb\\",\\"2.16.840.1.101.3.4.1.44\\":\\"aes-256-cfb\\"}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/aesid.json\\\\n// module id = 285\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/aesid.json\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js\\\\n// Fedor, you are amazing.\\\\n\\\\n\\\\nvar asn1 = __webpack_require__(42)\\\\n\\\\nexports.certificate = __webpack_require__(287)\\\\n\\\\nvar RSAPrivateKey = asn1.define(\'RSAPrivateKey\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'version\').int(),\\\\n    this.key(\'modulus\').int(),\\\\n    this.key(\'publicExponent\').int(),\\\\n    this.key(\'privateExponent\').int(),\\\\n    this.key(\'prime1\').int(),\\\\n    this.key(\'prime2\').int(),\\\\n    this.key(\'exponent1\').int(),\\\\n    this.key(\'exponent2\').int(),\\\\n    this.key(\'coefficient\').int()\\\\n  )\\\\n})\\\\nexports.RSAPrivateKey = RSAPrivateKey\\\\n\\\\nvar RSAPublicKey = asn1.define(\'RSAPublicKey\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'modulus\').int(),\\\\n    this.key(\'publicExponent\').int()\\\\n  )\\\\n})\\\\nexports.RSAPublicKey = RSAPublicKey\\\\n\\\\nvar PublicKey = asn1.define(\'SubjectPublicKeyInfo\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'algorithm\').use(AlgorithmIdentifier),\\\\n    this.key(\'subjectPublicKey\').bitstr()\\\\n  )\\\\n})\\\\nexports.PublicKey = PublicKey\\\\n\\\\nvar AlgorithmIdentifier = asn1.define(\'AlgorithmIdentifier\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'algorithm\').objid(),\\\\n    this.key(\'none\').null_().optional(),\\\\n    this.key(\'curve\').objid().optional(),\\\\n    this.key(\'params\').seq().obj(\\\\n      this.key(\'p\').int(),\\\\n      this.key(\'q\').int(),\\\\n      this.key(\'g\').int()\\\\n    ).optional()\\\\n  )\\\\n})\\\\n\\\\nvar PrivateKeyInfo = asn1.define(\'PrivateKeyInfo\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'version\').int(),\\\\n    this.key(\'algorithm\').use(AlgorithmIdentifier),\\\\n    this.key(\'subjectPrivateKey\').octstr()\\\\n  )\\\\n})\\\\nexports.PrivateKey = PrivateKeyInfo\\\\nvar EncryptedPrivateKeyInfo = asn1.define(\'EncryptedPrivateKeyInfo\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'algorithm\').seq().obj(\\\\n      this.key(\'id\').objid(),\\\\n      this.key(\'decrypt\').seq().obj(\\\\n        this.key(\'kde\').seq().obj(\\\\n          this.key(\'id\').objid(),\\\\n          this.key(\'kdeparams\').seq().obj(\\\\n            this.key(\'salt\').octstr(),\\\\n            this.key(\'iters\').int()\\\\n          )\\\\n        ),\\\\n        this.key(\'cipher\').seq().obj(\\\\n          this.key(\'algo\').objid(),\\\\n          this.key(\'iv\').octstr()\\\\n        )\\\\n      )\\\\n    ),\\\\n    this.key(\'subjectPrivateKey\').octstr()\\\\n  )\\\\n})\\\\n\\\\nexports.EncryptedPrivateKey = EncryptedPrivateKeyInfo\\\\n\\\\nvar DSAPrivateKey = asn1.define(\'DSAPrivateKey\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'version\').int(),\\\\n    this.key(\'p\').int(),\\\\n    this.key(\'q\').int(),\\\\n    this.key(\'g\').int(),\\\\n    this.key(\'pub_key\').int(),\\\\n    this.key(\'priv_key\').int()\\\\n  )\\\\n})\\\\nexports.DSAPrivateKey = DSAPrivateKey\\\\n\\\\nexports.DSAparam = asn1.define(\'DSAparam\', function () {\\\\n  this.int()\\\\n})\\\\n\\\\nvar ECPrivateKey = asn1.define(\'ECPrivateKey\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'version\').int(),\\\\n    this.key(\'privateKey\').octstr(),\\\\n    this.key(\'parameters\').optional().explicit(0).use(ECParameters),\\\\n    this.key(\'publicKey\').optional().explicit(1).bitstr()\\\\n  )\\\\n})\\\\nexports.ECPrivateKey = ECPrivateKey\\\\n\\\\nvar ECParameters = asn1.define(\'ECParameters\', function () {\\\\n  this.choice({\\\\n    namedCurve: this.objid()\\\\n  })\\\\n})\\\\n\\\\nexports.signature = asn1.define(\'signature\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'r\').int(),\\\\n    this.key(\'s\').int()\\\\n  )\\\\n})\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/asn1.js\\\\n// module id = 286\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/asn1.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"// from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js\\\\n// thanks to @Rantanen\\\\n\\\\n\\\\n\\\\nvar asn = __webpack_require__(42)\\\\n\\\\nvar Time = asn.define(\'Time\', function () {\\\\n  this.choice({\\\\n    utcTime: this.utctime(),\\\\n    generalTime: this.gentime()\\\\n  })\\\\n})\\\\n\\\\nvar AttributeTypeValue = asn.define(\'AttributeTypeValue\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'type\').objid(),\\\\n    this.key(\'value\').any()\\\\n  )\\\\n})\\\\n\\\\nvar AlgorithmIdentifier = asn.define(\'AlgorithmIdentifier\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'algorithm\').objid(),\\\\n    this.key(\'parameters\').optional()\\\\n  )\\\\n})\\\\n\\\\nvar SubjectPublicKeyInfo = asn.define(\'SubjectPublicKeyInfo\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'algorithm\').use(AlgorithmIdentifier),\\\\n    this.key(\'subjectPublicKey\').bitstr()\\\\n  )\\\\n})\\\\n\\\\nvar RelativeDistinguishedName = asn.define(\'RelativeDistinguishedName\', function () {\\\\n  this.setof(AttributeTypeValue)\\\\n})\\\\n\\\\nvar RDNSequence = asn.define(\'RDNSequence\', function () {\\\\n  this.seqof(RelativeDistinguishedName)\\\\n})\\\\n\\\\nvar Name = asn.define(\'Name\', function () {\\\\n  this.choice({\\\\n    rdnSequence: this.use(RDNSequence)\\\\n  })\\\\n})\\\\n\\\\nvar Validity = asn.define(\'Validity\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'notBefore\').use(Time),\\\\n    this.key(\'notAfter\').use(Time)\\\\n  )\\\\n})\\\\n\\\\nvar Extension = asn.define(\'Extension\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'extnID\').objid(),\\\\n    this.key(\'critical\').bool().def(false),\\\\n    this.key(\'extnValue\').octstr()\\\\n  )\\\\n})\\\\n\\\\nvar TBSCertificate = asn.define(\'TBSCertificate\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'version\').explicit(0).int(),\\\\n    this.key(\'serialNumber\').int(),\\\\n    this.key(\'signature\').use(AlgorithmIdentifier),\\\\n    this.key(\'issuer\').use(Name),\\\\n    this.key(\'validity\').use(Validity),\\\\n    this.key(\'subject\').use(Name),\\\\n    this.key(\'subjectPublicKeyInfo\').use(SubjectPublicKeyInfo),\\\\n    this.key(\'issuerUniqueID\').implicit(1).bitstr().optional(),\\\\n    this.key(\'subjectUniqueID\').implicit(2).bitstr().optional(),\\\\n    this.key(\'extensions\').explicit(3).seqof(Extension).optional()\\\\n  )\\\\n})\\\\n\\\\nvar X509Certificate = asn.define(\'X509Certificate\', function () {\\\\n  this.seq().obj(\\\\n    this.key(\'tbsCertificate\').use(TBSCertificate),\\\\n    this.key(\'signatureAlgorithm\').use(AlgorithmIdentifier),\\\\n    this.key(\'signatureValue\').bitstr()\\\\n  )\\\\n})\\\\n\\\\nmodule.exports = X509Certificate\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/certificate.js\\\\n// module id = 287\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/certificate.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {// adapted from https://github.com/apatil/pemstrip\\\\nvar findProc = /Proc-Type: 4,ENCRYPTED\\\\\\\\n\\\\\\\\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\\\\\\\\n\\\\\\\\r?\\\\\\\\n\\\\\\\\r?([0-9A-z\\\\\\\\n\\\\\\\\r\\\\\\\\+\\\\\\\\/\\\\\\\\=]+)\\\\\\\\n\\\\\\\\r?/m\\\\nvar startRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\\\\\\\n/m\\\\nvar fullRegex = /^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\\\\\\\\n\\\\\\\\r?([0-9A-z\\\\\\\\n\\\\\\\\r\\\\\\\\+\\\\\\\\/\\\\\\\\=]+)\\\\\\\\n\\\\\\\\r?-----END \\\\\\\\1-----$/m\\\\nvar evp = __webpack_require__(52)\\\\nvar ciphers = __webpack_require__(65)\\\\nmodule.exports = function (okey, password) {\\\\n  var key = okey.toString()\\\\n  var match = key.match(findProc)\\\\n  var decrypted\\\\n  if (!match) {\\\\n    var match2 = key.match(fullRegex)\\\\n    decrypted = new Buffer(match2[2].replace(/\\\\\\\\r?\\\\\\\\n/g, \'\'), \'base64\')\\\\n  } else {\\\\n    var suite = \'aes\' + match[1]\\\\n    var iv = new Buffer(match[2], \'hex\')\\\\n    var cipherText = new Buffer(match[3].replace(/\\\\\\\\r?\\\\\\\\n/g, \'\'), \'base64\')\\\\n    var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key\\\\n    var out = []\\\\n    var cipher = ciphers.createDecipheriv(suite, cipherKey, iv)\\\\n    out.push(cipher.update(cipherText))\\\\n    out.push(cipher.final())\\\\n    decrypted = Buffer.concat(out)\\\\n  }\\\\n  var tag = key.match(startRegex)[1]\\\\n  return {\\\\n    tag: tag,\\\\n    data: decrypted\\\\n  }\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/fixProc.js\\\\n// module id = 288\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/fixProc.js\\")},function(module,exports,__webpack_require__){eval(\\"var asn1 = __webpack_require__(42);\\\\nvar inherits = __webpack_require__(0);\\\\n\\\\nvar api = exports;\\\\n\\\\napi.define = function define(name, body) {\\\\n  return new Entity(name, body);\\\\n};\\\\n\\\\nfunction Entity(name, body) {\\\\n  this.name = name;\\\\n  this.body = body;\\\\n\\\\n  this.decoders = {};\\\\n  this.encoders = {};\\\\n};\\\\n\\\\nEntity.prototype._createNamed = function createNamed(base) {\\\\n  var named;\\\\n  try {\\\\n    named = __webpack_require__(333).runInThisContext(\\\\n      \'(function \' + this.name + \'(entity) {\\\\\\\\n\' +\\\\n      \'  this._initNamed(entity);\\\\\\\\n\' +\\\\n      \'})\'\\\\n    );\\\\n  } catch (e) {\\\\n    named = function (entity) {\\\\n      this._initNamed(entity);\\\\n    };\\\\n  }\\\\n  inherits(named, base);\\\\n  named.prototype._initNamed = function initnamed(entity) {\\\\n    base.call(this, entity);\\\\n  };\\\\n\\\\n  return new named(this);\\\\n};\\\\n\\\\nEntity.prototype._getDecoder = function _getDecoder(enc) {\\\\n  enc = enc || \'der\';\\\\n  // Lazily create decoder\\\\n  if (!this.decoders.hasOwnProperty(enc))\\\\n    this.decoders[enc] = this._createNamed(asn1.decoders[enc]);\\\\n  return this.decoders[enc];\\\\n};\\\\n\\\\nEntity.prototype.decode = function decode(data, enc, options) {\\\\n  return this._getDecoder(enc).decode(data, options);\\\\n};\\\\n\\\\nEntity.prototype._getEncoder = function _getEncoder(enc) {\\\\n  enc = enc || \'der\';\\\\n  // Lazily create encoder\\\\n  if (!this.encoders.hasOwnProperty(enc))\\\\n    this.encoders[enc] = this._createNamed(asn1.encoders[enc]);\\\\n  return this.encoders[enc];\\\\n};\\\\n\\\\nEntity.prototype.encode = function encode(data, enc, /* internal */ reporter) {\\\\n  return this._getEncoder(enc).encode(data, reporter);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/api.js\\\\n// module id = 289\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/api.js\\")},function(module,exports,__webpack_require__){eval(\\"var Reporter = __webpack_require__(43).Reporter;\\\\nvar EncoderBuffer = __webpack_require__(43).EncoderBuffer;\\\\nvar DecoderBuffer = __webpack_require__(43).DecoderBuffer;\\\\nvar assert = __webpack_require__(12);\\\\n\\\\n// Supported tags\\\\nvar tags = [\\\\n  \'seq\', \'seqof\', \'set\', \'setof\', \'objid\', \'bool\',\\\\n  \'gentime\', \'utctime\', \'null_\', \'enum\', \'int\', \'objDesc\',\\\\n  \'bitstr\', \'bmpstr\', \'charstr\', \'genstr\', \'graphstr\', \'ia5str\', \'iso646str\',\\\\n  \'numstr\', \'octstr\', \'printstr\', \'t61str\', \'unistr\', \'utf8str\', \'videostr\'\\\\n];\\\\n\\\\n// Public methods list\\\\nvar methods = [\\\\n  \'key\', \'obj\', \'use\', \'optional\', \'explicit\', \'implicit\', \'def\', \'choice\',\\\\n  \'any\', \'contains\'\\\\n].concat(tags);\\\\n\\\\n// Overrided methods list\\\\nvar overrided = [\\\\n  \'_peekTag\', \'_decodeTag\', \'_use\',\\\\n  \'_decodeStr\', \'_decodeObjid\', \'_decodeTime\',\\\\n  \'_decodeNull\', \'_decodeInt\', \'_decodeBool\', \'_decodeList\',\\\\n\\\\n  \'_encodeComposite\', \'_encodeStr\', \'_encodeObjid\', \'_encodeTime\',\\\\n  \'_encodeNull\', \'_encodeInt\', \'_encodeBool\'\\\\n];\\\\n\\\\nfunction Node(enc, parent) {\\\\n  var state = {};\\\\n  this._baseState = state;\\\\n\\\\n  state.enc = enc;\\\\n\\\\n  state.parent = parent || null;\\\\n  state.children = null;\\\\n\\\\n  // State\\\\n  state.tag = null;\\\\n  state.args = null;\\\\n  state.reverseArgs = null;\\\\n  state.choice = null;\\\\n  state.optional = false;\\\\n  state.any = false;\\\\n  state.obj = false;\\\\n  state.use = null;\\\\n  state.useDecoder = null;\\\\n  state.key = null;\\\\n  state[\'default\'] = null;\\\\n  state.explicit = null;\\\\n  state.implicit = null;\\\\n  state.contains = null;\\\\n\\\\n  // Should create new instance on each method\\\\n  if (!state.parent) {\\\\n    state.children = [];\\\\n    this._wrap();\\\\n  }\\\\n}\\\\nmodule.exports = Node;\\\\n\\\\nvar stateProps = [\\\\n  \'enc\', \'parent\', \'children\', \'tag\', \'args\', \'reverseArgs\', \'choice\',\\\\n  \'optional\', \'any\', \'obj\', \'use\', \'alteredUse\', \'key\', \'default\', \'explicit\',\\\\n  \'implicit\', \'contains\'\\\\n];\\\\n\\\\nNode.prototype.clone = function clone() {\\\\n  var state = this._baseState;\\\\n  var cstate = {};\\\\n  stateProps.forEach(function(prop) {\\\\n    cstate[prop] = state[prop];\\\\n  });\\\\n  var res = new this.constructor(cstate.parent);\\\\n  res._baseState = cstate;\\\\n  return res;\\\\n};\\\\n\\\\nNode.prototype._wrap = function wrap() {\\\\n  var state = this._baseState;\\\\n  methods.forEach(function(method) {\\\\n    this[method] = function _wrappedMethod() {\\\\n      var clone = new this.constructor(this);\\\\n      state.children.push(clone);\\\\n      return clone[method].apply(clone, arguments);\\\\n    };\\\\n  }, this);\\\\n};\\\\n\\\\nNode.prototype._init = function init(body) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.parent === null);\\\\n  body.call(this);\\\\n\\\\n  // Filter children\\\\n  state.children = state.children.filter(function(child) {\\\\n    return child._baseState.parent === this;\\\\n  }, this);\\\\n  assert.equal(state.children.length, 1, \'Root node can have only one child\');\\\\n};\\\\n\\\\nNode.prototype._useArgs = function useArgs(args) {\\\\n  var state = this._baseState;\\\\n\\\\n  // Filter children and args\\\\n  var children = args.filter(function(arg) {\\\\n    return arg instanceof this.constructor;\\\\n  }, this);\\\\n  args = args.filter(function(arg) {\\\\n    return !(arg instanceof this.constructor);\\\\n  }, this);\\\\n\\\\n  if (children.length !== 0) {\\\\n    assert(state.children === null);\\\\n    state.children = children;\\\\n\\\\n    // Replace parent to maintain backward link\\\\n    children.forEach(function(child) {\\\\n      child._baseState.parent = this;\\\\n    }, this);\\\\n  }\\\\n  if (args.length !== 0) {\\\\n    assert(state.args === null);\\\\n    state.args = args;\\\\n    state.reverseArgs = args.map(function(arg) {\\\\n      if (typeof arg !== \'object\' || arg.constructor !== Object)\\\\n        return arg;\\\\n\\\\n      var res = {};\\\\n      Object.keys(arg).forEach(function(key) {\\\\n        if (key == (key | 0))\\\\n          key |= 0;\\\\n        var value = arg[key];\\\\n        res[value] = key;\\\\n      });\\\\n      return res;\\\\n    });\\\\n  }\\\\n};\\\\n\\\\n//\\\\n// Overrided methods\\\\n//\\\\n\\\\noverrided.forEach(function(method) {\\\\n  Node.prototype[method] = function _overrided() {\\\\n    var state = this._baseState;\\\\n    throw new Error(method + \' not implemented for encoding: \' + state.enc);\\\\n  };\\\\n});\\\\n\\\\n//\\\\n// Public methods\\\\n//\\\\n\\\\ntags.forEach(function(tag) {\\\\n  Node.prototype[tag] = function _tagMethod() {\\\\n    var state = this._baseState;\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n\\\\n    assert(state.tag === null);\\\\n    state.tag = tag;\\\\n\\\\n    this._useArgs(args);\\\\n\\\\n    return this;\\\\n  };\\\\n});\\\\n\\\\nNode.prototype.use = function use(item) {\\\\n  assert(item);\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.use === null);\\\\n  state.use = item;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.optional = function optional() {\\\\n  var state = this._baseState;\\\\n\\\\n  state.optional = true;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.def = function def(val) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state[\'default\'] === null);\\\\n  state[\'default\'] = val;\\\\n  state.optional = true;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.explicit = function explicit(num) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.explicit === null && state.implicit === null);\\\\n  state.explicit = num;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.implicit = function implicit(num) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.explicit === null && state.implicit === null);\\\\n  state.implicit = num;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.obj = function obj() {\\\\n  var state = this._baseState;\\\\n  var args = Array.prototype.slice.call(arguments);\\\\n\\\\n  state.obj = true;\\\\n\\\\n  if (args.length !== 0)\\\\n    this._useArgs(args);\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.key = function key(newKey) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.key === null);\\\\n  state.key = newKey;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.any = function any() {\\\\n  var state = this._baseState;\\\\n\\\\n  state.any = true;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.choice = function choice(obj) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.choice === null);\\\\n  state.choice = obj;\\\\n  this._useArgs(Object.keys(obj).map(function(key) {\\\\n    return obj[key];\\\\n  }));\\\\n\\\\n  return this;\\\\n};\\\\n\\\\nNode.prototype.contains = function contains(item) {\\\\n  var state = this._baseState;\\\\n\\\\n  assert(state.use === null);\\\\n  state.contains = item;\\\\n\\\\n  return this;\\\\n};\\\\n\\\\n//\\\\n// Decoding\\\\n//\\\\n\\\\nNode.prototype._decode = function decode(input, options) {\\\\n  var state = this._baseState;\\\\n\\\\n  // Decode root node\\\\n  if (state.parent === null)\\\\n    return input.wrapResult(state.children[0]._decode(input, options));\\\\n\\\\n  var result = state[\'default\'];\\\\n  var present = true;\\\\n\\\\n  var prevKey = null;\\\\n  if (state.key !== null)\\\\n    prevKey = input.enterKey(state.key);\\\\n\\\\n  // Check if tag is there\\\\n  if (state.optional) {\\\\n    var tag = null;\\\\n    if (state.explicit !== null)\\\\n      tag = state.explicit;\\\\n    else if (state.implicit !== null)\\\\n      tag = state.implicit;\\\\n    else if (state.tag !== null)\\\\n      tag = state.tag;\\\\n\\\\n    if (tag === null && !state.any) {\\\\n      // Trial and Error\\\\n      var save = input.save();\\\\n      try {\\\\n        if (state.choice === null)\\\\n          this._decodeGeneric(state.tag, input, options);\\\\n        else\\\\n          this._decodeChoice(input, options);\\\\n        present = true;\\\\n      } catch (e) {\\\\n        present = false;\\\\n      }\\\\n      input.restore(save);\\\\n    } else {\\\\n      present = this._peekTag(input, tag, state.any);\\\\n\\\\n      if (input.isError(present))\\\\n        return present;\\\\n    }\\\\n  }\\\\n\\\\n  // Push object on stack\\\\n  var prevObj;\\\\n  if (state.obj && present)\\\\n    prevObj = input.enterObject();\\\\n\\\\n  if (present) {\\\\n    // Unwrap explicit values\\\\n    if (state.explicit !== null) {\\\\n      var explicit = this._decodeTag(input, state.explicit);\\\\n      if (input.isError(explicit))\\\\n        return explicit;\\\\n      input = explicit;\\\\n    }\\\\n\\\\n    var start = input.offset;\\\\n\\\\n    // Unwrap implicit and normal values\\\\n    if (state.use === null && state.choice === null) {\\\\n      if (state.any)\\\\n        var save = input.save();\\\\n      var body = this._decodeTag(\\\\n        input,\\\\n        state.implicit !== null ? state.implicit : state.tag,\\\\n        state.any\\\\n      );\\\\n      if (input.isError(body))\\\\n        return body;\\\\n\\\\n      if (state.any)\\\\n        result = input.raw(save);\\\\n      else\\\\n        input = body;\\\\n    }\\\\n\\\\n    if (options && options.track && state.tag !== null)\\\\n      options.track(input.path(), start, input.length, \'tagged\');\\\\n\\\\n    if (options && options.track && state.tag !== null)\\\\n      options.track(input.path(), input.offset, input.length, \'content\');\\\\n\\\\n    // Select proper method for tag\\\\n    if (state.any)\\\\n      result = result;\\\\n    else if (state.choice === null)\\\\n      result = this._decodeGeneric(state.tag, input, options);\\\\n    else\\\\n      result = this._decodeChoice(input, options);\\\\n\\\\n    if (input.isError(result))\\\\n      return result;\\\\n\\\\n    // Decode children\\\\n    if (!state.any && state.choice === null && state.children !== null) {\\\\n      state.children.forEach(function decodeChildren(child) {\\\\n        // NOTE: We are ignoring errors here, to let parser continue with other\\\\n        // parts of encoded data\\\\n        child._decode(input, options);\\\\n      });\\\\n    }\\\\n\\\\n    // Decode contained/encoded by schema, only in bit or octet strings\\\\n    if (state.contains && (state.tag === \'octstr\' || state.tag === \'bitstr\')) {\\\\n      var data = new DecoderBuffer(result);\\\\n      result = this._getUse(state.contains, input._reporterState.obj)\\\\n          ._decode(data, options);\\\\n    }\\\\n  }\\\\n\\\\n  // Pop object\\\\n  if (state.obj && present)\\\\n    result = input.leaveObject(prevObj);\\\\n\\\\n  // Set key\\\\n  if (state.key !== null && (result !== null || present === true))\\\\n    input.leaveKey(prevKey, state.key, result);\\\\n  else if (prevKey !== null)\\\\n    input.exitKey(prevKey);\\\\n\\\\n  return result;\\\\n};\\\\n\\\\nNode.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {\\\\n  var state = this._baseState;\\\\n\\\\n  if (tag === \'seq\' || tag === \'set\')\\\\n    return null;\\\\n  if (tag === \'seqof\' || tag === \'setof\')\\\\n    return this._decodeList(input, tag, state.args[0], options);\\\\n  else if (/str$/.test(tag))\\\\n    return this._decodeStr(input, tag, options);\\\\n  else if (tag === \'objid\' && state.args)\\\\n    return this._decodeObjid(input, state.args[0], state.args[1], options);\\\\n  else if (tag === \'objid\')\\\\n    return this._decodeObjid(input, null, null, options);\\\\n  else if (tag === \'gentime\' || tag === \'utctime\')\\\\n    return this._decodeTime(input, tag, options);\\\\n  else if (tag === \'null_\')\\\\n    return this._decodeNull(input, options);\\\\n  else if (tag === \'bool\')\\\\n    return this._decodeBool(input, options);\\\\n  else if (tag === \'objDesc\')\\\\n    return this._decodeStr(input, tag, options);\\\\n  else if (tag === \'int\' || tag === \'enum\')\\\\n    return this._decodeInt(input, state.args && state.args[0], options);\\\\n\\\\n  if (state.use !== null) {\\\\n    return this._getUse(state.use, input._reporterState.obj)\\\\n        ._decode(input, options);\\\\n  } else {\\\\n    return input.error(\'unknown tag: \' + tag);\\\\n  }\\\\n};\\\\n\\\\nNode.prototype._getUse = function _getUse(entity, obj) {\\\\n\\\\n  var state = this._baseState;\\\\n  // Create altered use decoder if implicit is set\\\\n  state.useDecoder = this._use(entity, obj);\\\\n  assert(state.useDecoder._baseState.parent === null);\\\\n  state.useDecoder = state.useDecoder._baseState.children[0];\\\\n  if (state.implicit !== state.useDecoder._baseState.implicit) {\\\\n    state.useDecoder = state.useDecoder.clone();\\\\n    state.useDecoder._baseState.implicit = state.implicit;\\\\n  }\\\\n  return state.useDecoder;\\\\n};\\\\n\\\\nNode.prototype._decodeChoice = function decodeChoice(input, options) {\\\\n  var state = this._baseState;\\\\n  var result = null;\\\\n  var match = false;\\\\n\\\\n  Object.keys(state.choice).some(function(key) {\\\\n    var save = input.save();\\\\n    var node = state.choice[key];\\\\n    try {\\\\n      var value = node._decode(input, options);\\\\n      if (input.isError(value))\\\\n        return false;\\\\n\\\\n      result = { type: key, value: value };\\\\n      match = true;\\\\n    } catch (e) {\\\\n      input.restore(save);\\\\n      return false;\\\\n    }\\\\n    return true;\\\\n  }, this);\\\\n\\\\n  if (!match)\\\\n    return input.error(\'Choice not matched\');\\\\n\\\\n  return result;\\\\n};\\\\n\\\\n//\\\\n// Encoding\\\\n//\\\\n\\\\nNode.prototype._createEncoderBuffer = function createEncoderBuffer(data) {\\\\n  return new EncoderBuffer(data, this.reporter);\\\\n};\\\\n\\\\nNode.prototype._encode = function encode(data, reporter, parent) {\\\\n  var state = this._baseState;\\\\n  if (state[\'default\'] !== null && state[\'default\'] === data)\\\\n    return;\\\\n\\\\n  var result = this._encodeValue(data, reporter, parent);\\\\n  if (result === undefined)\\\\n    return;\\\\n\\\\n  if (this._skipDefault(result, reporter, parent))\\\\n    return;\\\\n\\\\n  return result;\\\\n};\\\\n\\\\nNode.prototype._encodeValue = function encode(data, reporter, parent) {\\\\n  var state = this._baseState;\\\\n\\\\n  // Decode root node\\\\n  if (state.parent === null)\\\\n    return state.children[0]._encode(data, reporter || new Reporter());\\\\n\\\\n  var result = null;\\\\n\\\\n  // Set reporter to share it with a child class\\\\n  this.reporter = reporter;\\\\n\\\\n  // Check if data is there\\\\n  if (state.optional && data === undefined) {\\\\n    if (state[\'default\'] !== null)\\\\n      data = state[\'default\']\\\\n    else\\\\n      return;\\\\n  }\\\\n\\\\n  // Encode children first\\\\n  var content = null;\\\\n  var primitive = false;\\\\n  if (state.any) {\\\\n    // Anything that was given is translated to buffer\\\\n    result = this._createEncoderBuffer(data);\\\\n  } else if (state.choice) {\\\\n    result = this._encodeChoice(data, reporter);\\\\n  } else if (state.contains) {\\\\n    content = this._getUse(state.contains, parent)._encode(data, reporter);\\\\n    primitive = true;\\\\n  } else if (state.children) {\\\\n    content = state.children.map(function(child) {\\\\n      if (child._baseState.tag === \'null_\')\\\\n        return child._encode(null, reporter, data);\\\\n\\\\n      if (child._baseState.key === null)\\\\n        return reporter.error(\'Child should have a key\');\\\\n      var prevKey = reporter.enterKey(child._baseState.key);\\\\n\\\\n      if (typeof data !== \'object\')\\\\n        return reporter.error(\'Child expected, but input is not object\');\\\\n\\\\n      var res = child._encode(data[child._baseState.key], reporter, data);\\\\n      reporter.leaveKey(prevKey);\\\\n\\\\n      return res;\\\\n    }, this).filter(function(child) {\\\\n      return child;\\\\n    });\\\\n    content = this._createEncoderBuffer(content);\\\\n  } else {\\\\n    if (state.tag === \'seqof\' || state.tag === \'setof\') {\\\\n      // TODO(indutny): this should be thrown on DSL level\\\\n      if (!(state.args && state.args.length === 1))\\\\n        return reporter.error(\'Too many args for : \' + state.tag);\\\\n\\\\n      if (!Array.isArray(data))\\\\n        return reporter.error(\'seqof/setof, but data is not Array\');\\\\n\\\\n      var child = this.clone();\\\\n      child._baseState.implicit = null;\\\\n      content = this._createEncoderBuffer(data.map(function(item) {\\\\n        var state = this._baseState;\\\\n\\\\n        return this._getUse(state.args[0], data)._encode(item, reporter);\\\\n      }, child));\\\\n    } else if (state.use !== null) {\\\\n      result = this._getUse(state.use, parent)._encode(data, reporter);\\\\n    } else {\\\\n      content = this._encodePrimitive(state.tag, data);\\\\n      primitive = true;\\\\n    }\\\\n  }\\\\n\\\\n  // Encode data itself\\\\n  var result;\\\\n  if (!state.any && state.choice === null) {\\\\n    var tag = state.implicit !== null ? state.implicit : state.tag;\\\\n    var cls = state.implicit === null ? \'universal\' : \'context\';\\\\n\\\\n    if (tag === null) {\\\\n      if (state.use === null)\\\\n        reporter.error(\'Tag could be omitted only for .use()\');\\\\n    } else {\\\\n      if (state.use === null)\\\\n        result = this._encodeComposite(tag, primitive, cls, content);\\\\n    }\\\\n  }\\\\n\\\\n  // Wrap in explicit\\\\n  if (state.explicit !== null)\\\\n    result = this._encodeComposite(state.explicit, false, \'context\', result);\\\\n\\\\n  return result;\\\\n};\\\\n\\\\nNode.prototype._encodeChoice = function encodeChoice(data, reporter) {\\\\n  var state = this._baseState;\\\\n\\\\n  var node = state.choice[data.type];\\\\n  if (!node) {\\\\n    assert(\\\\n        false,\\\\n        data.type + \' not found in \' +\\\\n            JSON.stringify(Object.keys(state.choice)));\\\\n  }\\\\n  return node._encode(data.value, reporter);\\\\n};\\\\n\\\\nNode.prototype._encodePrimitive = function encodePrimitive(tag, data) {\\\\n  var state = this._baseState;\\\\n\\\\n  if (/str$/.test(tag))\\\\n    return this._encodeStr(data, tag);\\\\n  else if (tag === \'objid\' && state.args)\\\\n    return this._encodeObjid(data, state.reverseArgs[0], state.args[1]);\\\\n  else if (tag === \'objid\')\\\\n    return this._encodeObjid(data, null, null);\\\\n  else if (tag === \'gentime\' || tag === \'utctime\')\\\\n    return this._encodeTime(data, tag);\\\\n  else if (tag === \'null_\')\\\\n    return this._encodeNull();\\\\n  else if (tag === \'int\' || tag === \'enum\')\\\\n    return this._encodeInt(data, state.args && state.reverseArgs[0]);\\\\n  else if (tag === \'bool\')\\\\n    return this._encodeBool(data);\\\\n  else if (tag === \'objDesc\')\\\\n    return this._encodeStr(data, tag);\\\\n  else\\\\n    throw new Error(\'Unsupported tag: \' + tag);\\\\n};\\\\n\\\\nNode.prototype._isNumstr = function isNumstr(str) {\\\\n  return /^[0-9 ]*$/.test(str);\\\\n};\\\\n\\\\nNode.prototype._isPrintstr = function isPrintstr(str) {\\\\n  return /^[A-Za-z0-9 \'\\\\\\\\(\\\\\\\\)\\\\\\\\+,\\\\\\\\-\\\\\\\\.\\\\\\\\/:=\\\\\\\\?]*$/.test(str);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/node.js\\\\n// module id = 290\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/node.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\n\\\\nfunction Reporter(options) {\\\\n  this._reporterState = {\\\\n    obj: null,\\\\n    path: [],\\\\n    options: options || {},\\\\n    errors: []\\\\n  };\\\\n}\\\\nexports.Reporter = Reporter;\\\\n\\\\nReporter.prototype.isError = function isError(obj) {\\\\n  return obj instanceof ReporterError;\\\\n};\\\\n\\\\nReporter.prototype.save = function save() {\\\\n  var state = this._reporterState;\\\\n\\\\n  return { obj: state.obj, pathLen: state.path.length };\\\\n};\\\\n\\\\nReporter.prototype.restore = function restore(data) {\\\\n  var state = this._reporterState;\\\\n\\\\n  state.obj = data.obj;\\\\n  state.path = state.path.slice(0, data.pathLen);\\\\n};\\\\n\\\\nReporter.prototype.enterKey = function enterKey(key) {\\\\n  return this._reporterState.path.push(key);\\\\n};\\\\n\\\\nReporter.prototype.exitKey = function exitKey(index) {\\\\n  var state = this._reporterState;\\\\n\\\\n  state.path = state.path.slice(0, index - 1);\\\\n};\\\\n\\\\nReporter.prototype.leaveKey = function leaveKey(index, key, value) {\\\\n  var state = this._reporterState;\\\\n\\\\n  this.exitKey(index);\\\\n  if (state.obj !== null)\\\\n    state.obj[key] = value;\\\\n};\\\\n\\\\nReporter.prototype.path = function path() {\\\\n  return this._reporterState.path.join(\'/\');\\\\n};\\\\n\\\\nReporter.prototype.enterObject = function enterObject() {\\\\n  var state = this._reporterState;\\\\n\\\\n  var prev = state.obj;\\\\n  state.obj = {};\\\\n  return prev;\\\\n};\\\\n\\\\nReporter.prototype.leaveObject = function leaveObject(prev) {\\\\n  var state = this._reporterState;\\\\n\\\\n  var now = state.obj;\\\\n  state.obj = prev;\\\\n  return now;\\\\n};\\\\n\\\\nReporter.prototype.error = function error(msg) {\\\\n  var err;\\\\n  var state = this._reporterState;\\\\n\\\\n  var inherited = msg instanceof ReporterError;\\\\n  if (inherited) {\\\\n    err = msg;\\\\n  } else {\\\\n    err = new ReporterError(state.path.map(function(elem) {\\\\n      return \'[\' + JSON.stringify(elem) + \']\';\\\\n    }).join(\'\'), msg.message || msg, msg.stack);\\\\n  }\\\\n\\\\n  if (!state.options.partial)\\\\n    throw err;\\\\n\\\\n  if (!inherited)\\\\n    state.errors.push(err);\\\\n\\\\n  return err;\\\\n};\\\\n\\\\nReporter.prototype.wrapResult = function wrapResult(result) {\\\\n  var state = this._reporterState;\\\\n  if (!state.options.partial)\\\\n    return result;\\\\n\\\\n  return {\\\\n    result: this.isError(result) ? null : result,\\\\n    errors: state.errors\\\\n  };\\\\n};\\\\n\\\\nfunction ReporterError(path, msg) {\\\\n  this.path = path;\\\\n  this.rethrow(msg);\\\\n};\\\\ninherits(ReporterError, Error);\\\\n\\\\nReporterError.prototype.rethrow = function rethrow(msg) {\\\\n  this.message = msg + \' at: \' + (this.path || \'(shallow)\');\\\\n  if (Error.captureStackTrace)\\\\n    Error.captureStackTrace(this, ReporterError);\\\\n\\\\n  if (!this.stack) {\\\\n    try {\\\\n      // IE only adds stack when thrown\\\\n      throw new Error(this.message);\\\\n    } catch (e) {\\\\n      this.stack = e.stack;\\\\n    }\\\\n  }\\\\n  return this;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/base/reporter.js\\\\n// module id = 291\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/base/reporter.js\\")},function(module,exports,__webpack_require__){eval(\\"var constants = __webpack_require__(140);\\\\n\\\\nexports.tagClass = {\\\\n  0: \'universal\',\\\\n  1: \'application\',\\\\n  2: \'context\',\\\\n  3: \'private\'\\\\n};\\\\nexports.tagClassByName = constants._reverse(exports.tagClass);\\\\n\\\\nexports.tag = {\\\\n  0x00: \'end\',\\\\n  0x01: \'bool\',\\\\n  0x02: \'int\',\\\\n  0x03: \'bitstr\',\\\\n  0x04: \'octstr\',\\\\n  0x05: \'null_\',\\\\n  0x06: \'objid\',\\\\n  0x07: \'objDesc\',\\\\n  0x08: \'external\',\\\\n  0x09: \'real\',\\\\n  0x0a: \'enum\',\\\\n  0x0b: \'embed\',\\\\n  0x0c: \'utf8str\',\\\\n  0x0d: \'relativeOid\',\\\\n  0x10: \'seq\',\\\\n  0x11: \'set\',\\\\n  0x12: \'numstr\',\\\\n  0x13: \'printstr\',\\\\n  0x14: \'t61str\',\\\\n  0x15: \'videostr\',\\\\n  0x16: \'ia5str\',\\\\n  0x17: \'utctime\',\\\\n  0x18: \'gentime\',\\\\n  0x19: \'graphstr\',\\\\n  0x1a: \'iso646str\',\\\\n  0x1b: \'genstr\',\\\\n  0x1c: \'unistr\',\\\\n  0x1d: \'charstr\',\\\\n  0x1e: \'bmpstr\'\\\\n};\\\\nexports.tagByName = constants._reverse(exports.tag);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/constants/der.js\\\\n// module id = 292\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/constants/der.js\\")},function(module,exports,__webpack_require__){eval(\\"var decoders = exports;\\\\n\\\\ndecoders.der = __webpack_require__(141);\\\\ndecoders.pem = __webpack_require__(294);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/index.js\\\\n// module id = 293\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\nvar Buffer = __webpack_require__(1).Buffer;\\\\n\\\\nvar DERDecoder = __webpack_require__(141);\\\\n\\\\nfunction PEMDecoder(entity) {\\\\n  DERDecoder.call(this, entity);\\\\n  this.enc = \'pem\';\\\\n};\\\\ninherits(PEMDecoder, DERDecoder);\\\\nmodule.exports = PEMDecoder;\\\\n\\\\nPEMDecoder.prototype.decode = function decode(data, options) {\\\\n  var lines = data.toString().split(/[\\\\\\\\r\\\\\\\\n]+/g);\\\\n\\\\n  var label = options.label.toUpperCase();\\\\n\\\\n  var re = /^-----(BEGIN|END) ([^-]+)-----$/;\\\\n  var start = -1;\\\\n  var end = -1;\\\\n  for (var i = 0; i < lines.length; i++) {\\\\n    var match = lines[i].match(re);\\\\n    if (match === null)\\\\n      continue;\\\\n\\\\n    if (match[2] !== label)\\\\n      continue;\\\\n\\\\n    if (start === -1) {\\\\n      if (match[1] !== \'BEGIN\')\\\\n        break;\\\\n      start = i;\\\\n    } else {\\\\n      if (match[1] !== \'END\')\\\\n        break;\\\\n      end = i;\\\\n      break;\\\\n    }\\\\n  }\\\\n  if (start === -1 || end === -1)\\\\n    throw new Error(\'PEM section not found for: \' + label);\\\\n\\\\n  var base64 = lines.slice(start + 1, end).join(\'\');\\\\n  // Remove excessive symbols\\\\n  base64.replace(/[^a-z0-9\\\\\\\\+\\\\\\\\/=]+/gi, \'\');\\\\n\\\\n  var input = new Buffer(base64, \'base64\');\\\\n  return DERDecoder.prototype.decode.call(this, input, options);\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/decoders/pem.js\\\\n// module id = 294\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/decoders/pem.js\\")},function(module,exports,__webpack_require__){eval(\\"var encoders = exports;\\\\n\\\\nencoders.der = __webpack_require__(142);\\\\nencoders.pem = __webpack_require__(296);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/index.js\\\\n// module id = 295\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0);\\\\n\\\\nvar DEREncoder = __webpack_require__(142);\\\\n\\\\nfunction PEMEncoder(entity) {\\\\n  DEREncoder.call(this, entity);\\\\n  this.enc = \'pem\';\\\\n};\\\\ninherits(PEMEncoder, DEREncoder);\\\\nmodule.exports = PEMEncoder;\\\\n\\\\nPEMEncoder.prototype.encode = function encode(data, options) {\\\\n  var buf = DEREncoder.prototype.encode.call(this, data);\\\\n\\\\n  var p = buf.toString(\'base64\');\\\\n  var out = [ \'-----BEGIN \' + options.label + \'-----\' ];\\\\n  for (var i = 0; i < p.length; i += 64)\\\\n    out.push(p.slice(i, i + 64));\\\\n  out.push(\'-----END \' + options.label + \'-----\');\\\\n  return out.join(\'\\\\\\\\n\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-asn1/~/asn1.js/lib/asn1/encoders/pem.js\\\\n// module id = 296\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-asn1/node_modules/asn1.js/lib/asn1/encoders/pem.js\\")},function(module,exports,__webpack_require__){eval(\\"var trim = __webpack_require__(329)\\\\n  , forEach = __webpack_require__(267)\\\\n  , isArray = function(arg) {\\\\n      return Object.prototype.toString.call(arg) === \'[object Array]\';\\\\n    }\\\\n\\\\nmodule.exports = function (headers) {\\\\n  if (!headers)\\\\n    return {}\\\\n\\\\n  var result = {}\\\\n\\\\n  forEach(\\\\n      trim(headers).split(\'\\\\\\\\n\')\\\\n    , function (row) {\\\\n        var index = row.indexOf(\':\')\\\\n          , key = trim(row.slice(0, index)).toLowerCase()\\\\n          , value = trim(row.slice(index + 1))\\\\n\\\\n        if (typeof(result[key]) === \'undefined\') {\\\\n          result[key] = value\\\\n        } else if (isArray(result[key])) {\\\\n          result[key].push(value)\\\\n        } else {\\\\n          result[key] = [ result[key], value ]\\\\n        }\\\\n      }\\\\n  )\\\\n\\\\n  return result\\\\n}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/parse-headers/parse-headers.js\\\\n// module id = 297\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/parse-headers/parse-headers.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(global, process) {var checkParameters = __webpack_require__(144)\\\\nvar defaultEncoding = __webpack_require__(143)\\\\nvar sync = __webpack_require__(145)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar ZERO_BUF\\\\nvar subtle = global.crypto && global.crypto.subtle\\\\nvar toBrowser = {\\\\n  \'sha\': \'SHA-1\',\\\\n  \'sha-1\': \'SHA-1\',\\\\n  \'sha1\': \'SHA-1\',\\\\n  \'sha256\': \'SHA-256\',\\\\n  \'sha-256\': \'SHA-256\',\\\\n  \'sha384\': \'SHA-384\',\\\\n  \'sha-384\': \'SHA-384\',\\\\n  \'sha-512\': \'SHA-512\',\\\\n  \'sha512\': \'SHA-512\'\\\\n}\\\\nvar checks = []\\\\nfunction checkNative (algo) {\\\\n  if (global.process && !global.process.browser) {\\\\n    return Promise.resolve(false)\\\\n  }\\\\n  if (!subtle || !subtle.importKey || !subtle.deriveBits) {\\\\n    return Promise.resolve(false)\\\\n  }\\\\n  if (checks[algo] !== undefined) {\\\\n    return checks[algo]\\\\n  }\\\\n  ZERO_BUF = ZERO_BUF || Buffer.alloc(8)\\\\n  var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo)\\\\n    .then(function () {\\\\n      return true\\\\n    }).catch(function () {\\\\n      return false\\\\n    })\\\\n  checks[algo] = prom\\\\n  return prom\\\\n}\\\\nfunction browserPbkdf2 (password, salt, iterations, length, algo) {\\\\n  return subtle.importKey(\\\\n    \'raw\', password, {name: \'PBKDF2\'}, false, [\'deriveBits\']\\\\n  ).then(function (key) {\\\\n    return subtle.deriveBits({\\\\n      name: \'PBKDF2\',\\\\n      salt: salt,\\\\n      iterations: iterations,\\\\n      hash: {\\\\n        name: algo\\\\n      }\\\\n    }, key, length << 3)\\\\n  }).then(function (res) {\\\\n    return Buffer.from(res)\\\\n  })\\\\n}\\\\nfunction resolvePromise (promise, callback) {\\\\n  promise.then(function (out) {\\\\n    process.nextTick(function () {\\\\n      callback(null, out)\\\\n    })\\\\n  }, function (e) {\\\\n    process.nextTick(function () {\\\\n      callback(e)\\\\n    })\\\\n  })\\\\n}\\\\nmodule.exports = function (password, salt, iterations, keylen, digest, callback) {\\\\n  if (!Buffer.isBuffer(password)) password = Buffer.from(password, defaultEncoding)\\\\n  if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, defaultEncoding)\\\\n\\\\n  checkParameters(iterations, keylen)\\\\n  if (typeof digest === \'function\') {\\\\n    callback = digest\\\\n    digest = undefined\\\\n  }\\\\n  if (typeof callback !== \'function\') throw new Error(\'No callback provided to pbkdf2\')\\\\n\\\\n  digest = digest || \'sha1\'\\\\n  var algo = toBrowser[digest.toLowerCase()]\\\\n  if (!algo || typeof global.Promise !== \'function\') {\\\\n    return process.nextTick(function () {\\\\n      var out\\\\n      try {\\\\n        out = sync(password, salt, iterations, keylen, digest)\\\\n      } catch (e) {\\\\n        return callback(e)\\\\n      }\\\\n      callback(null, out)\\\\n    })\\\\n  }\\\\n  resolvePromise(checkNative(algo).then(function (resp) {\\\\n    if (resp) {\\\\n      return browserPbkdf2(password, salt, iterations, keylen, algo)\\\\n    } else {\\\\n      return sync(password, salt, iterations, keylen, digest)\\\\n    }\\\\n  }), callback)\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/pbkdf2/lib/async.js\\\\n// module id = 298\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/pbkdf2/lib/async.js\\")},function(module,exports){eval(\\"module.exports = isPromise;\\\\n\\\\nfunction isPromise(obj) {\\\\n  return !!obj && (typeof obj === \'object\' || typeof obj === \'function\') && typeof obj.then === \'function\';\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/promise-worker/~/is-promise/index.js\\\\n// module id = 299\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/promise-worker/node_modules/is-promise/index.js\\")},function(module,exports,__webpack_require__){eval(\\"exports.publicEncrypt = __webpack_require__(302);\\\\nexports.privateDecrypt = __webpack_require__(301);\\\\n\\\\nexports.privateEncrypt = function privateEncrypt(key, buf) {\\\\n  return exports.publicEncrypt(key, buf, true);\\\\n};\\\\n\\\\nexports.publicDecrypt = function publicDecrypt(key, buf) {\\\\n  return exports.privateDecrypt(key, buf, true);\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/browser.js\\\\n// module id = 300\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(54);\\\\nvar mgf = __webpack_require__(146);\\\\nvar xor = __webpack_require__(148);\\\\nvar bn = __webpack_require__(3);\\\\nvar crt = __webpack_require__(67);\\\\nvar createHash = __webpack_require__(39);\\\\nvar withPublic = __webpack_require__(147);\\\\nmodule.exports = function privateDecrypt(private_key, enc, reverse) {\\\\n  var padding;\\\\n  if (private_key.padding) {\\\\n    padding = private_key.padding;\\\\n  } else if (reverse) {\\\\n    padding = 1;\\\\n  } else {\\\\n    padding = 4;\\\\n  }\\\\n  \\\\n  var key = parseKeys(private_key);\\\\n  var k = key.modulus.byteLength();\\\\n  if (enc.length > k || new bn(enc).cmp(key.modulus) >= 0) {\\\\n    throw new Error(\'decryption error\');\\\\n  }\\\\n  var msg;\\\\n  if (reverse) {\\\\n    msg = withPublic(new bn(enc), key);\\\\n  } else {\\\\n    msg = crt(enc, key);\\\\n  }\\\\n  var zBuffer = new Buffer(k - msg.length);\\\\n  zBuffer.fill(0);\\\\n  msg = Buffer.concat([zBuffer, msg], k);\\\\n  if (padding === 4) {\\\\n    return oaep(key, msg);\\\\n  } else if (padding === 1) {\\\\n    return pkcs1(key, msg, reverse);\\\\n  } else if (padding === 3) {\\\\n    return msg;\\\\n  } else {\\\\n    throw new Error(\'unknown padding\');\\\\n  }\\\\n};\\\\n\\\\nfunction oaep(key, msg){\\\\n  var n = key.modulus;\\\\n  var k = key.modulus.byteLength();\\\\n  var mLen = msg.length;\\\\n  var iHash = createHash(\'sha1\').update(new Buffer(\'\')).digest();\\\\n  var hLen = iHash.length;\\\\n  var hLen2 = 2 * hLen;\\\\n  if (msg[0] !== 0) {\\\\n    throw new Error(\'decryption error\');\\\\n  }\\\\n  var maskedSeed = msg.slice(1, hLen + 1);\\\\n  var maskedDb =  msg.slice(hLen + 1);\\\\n  var seed = xor(maskedSeed, mgf(maskedDb, hLen));\\\\n  var db = xor(maskedDb, mgf(seed, k - hLen - 1));\\\\n  if (compare(iHash, db.slice(0, hLen))) {\\\\n    throw new Error(\'decryption error\');\\\\n  }\\\\n  var i = hLen;\\\\n  while (db[i] === 0) {\\\\n    i++;\\\\n  }\\\\n  if (db[i++] !== 1) {\\\\n    throw new Error(\'decryption error\');\\\\n  }\\\\n  return db.slice(i);\\\\n}\\\\n\\\\nfunction pkcs1(key, msg, reverse){\\\\n  var p1 = msg.slice(0, 2);\\\\n  var i = 2;\\\\n  var status = 0;\\\\n  while (msg[i++] !== 0) {\\\\n    if (i >= msg.length) {\\\\n      status++;\\\\n      break;\\\\n    }\\\\n  }\\\\n  var ps = msg.slice(2, i - 1);\\\\n  var p2 = msg.slice(i - 1, i);\\\\n\\\\n  if ((p1.toString(\'hex\') !== \'0002\' && !reverse) || (p1.toString(\'hex\') !== \'0001\' && reverse)){\\\\n    status++;\\\\n  }\\\\n  if (ps.length < 8) {\\\\n    status++;\\\\n  }\\\\n  if (status) {\\\\n    throw new Error(\'decryption error\');\\\\n  }\\\\n  return  msg.slice(i);\\\\n}\\\\nfunction compare(a, b){\\\\n  a = new Buffer(a);\\\\n  b = new Buffer(b);\\\\n  var dif = 0;\\\\n  var len = a.length;\\\\n  if (a.length !== b.length) {\\\\n    dif++;\\\\n    len = Math.min(a.length, b.length);\\\\n  }\\\\n  var i = -1;\\\\n  while (++i < len) {\\\\n    dif += (a[i] ^ b[i]);\\\\n  }\\\\n  return dif;\\\\n}\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/privateDecrypt.js\\\\n// module id = 301\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/privateDecrypt.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var parseKeys = __webpack_require__(54);\\\\nvar randomBytes = __webpack_require__(29);\\\\nvar createHash = __webpack_require__(39);\\\\nvar mgf = __webpack_require__(146);\\\\nvar xor = __webpack_require__(148);\\\\nvar bn = __webpack_require__(3);\\\\nvar withPublic = __webpack_require__(147);\\\\nvar crt = __webpack_require__(67);\\\\n\\\\nvar constants = {\\\\n  RSA_PKCS1_OAEP_PADDING: 4,\\\\n  RSA_PKCS1_PADDIN: 1,\\\\n  RSA_NO_PADDING: 3\\\\n};\\\\n\\\\nmodule.exports = function publicEncrypt(public_key, msg, reverse) {\\\\n  var padding;\\\\n  if (public_key.padding) {\\\\n    padding = public_key.padding;\\\\n  } else if (reverse) {\\\\n    padding = 1;\\\\n  } else {\\\\n    padding = 4;\\\\n  }\\\\n  var key = parseKeys(public_key);\\\\n  var paddedMsg;\\\\n  if (padding === 4) {\\\\n    paddedMsg = oaep(key, msg);\\\\n  } else if (padding === 1) {\\\\n    paddedMsg = pkcs1(key, msg, reverse);\\\\n  } else if (padding === 3) {\\\\n    paddedMsg = new bn(msg);\\\\n    if (paddedMsg.cmp(key.modulus) >= 0) {\\\\n      throw new Error(\'data too long for modulus\');\\\\n    }\\\\n  } else {\\\\n    throw new Error(\'unknown padding\');\\\\n  }\\\\n  if (reverse) {\\\\n    return crt(paddedMsg, key);\\\\n  } else {\\\\n    return withPublic(paddedMsg, key);\\\\n  }\\\\n};\\\\n\\\\nfunction oaep(key, msg){\\\\n  var k = key.modulus.byteLength();\\\\n  var mLen = msg.length;\\\\n  var iHash = createHash(\'sha1\').update(new Buffer(\'\')).digest();\\\\n  var hLen = iHash.length;\\\\n  var hLen2 = 2 * hLen;\\\\n  if (mLen > k - hLen2 - 2) {\\\\n    throw new Error(\'message too long\');\\\\n  }\\\\n  var ps = new Buffer(k - mLen - hLen2 - 2);\\\\n  ps.fill(0);\\\\n  var dblen = k - hLen - 1;\\\\n  var seed = randomBytes(hLen);\\\\n  var maskedDb = xor(Buffer.concat([iHash, ps, new Buffer([1]), msg], dblen), mgf(seed, dblen));\\\\n  var maskedSeed = xor(seed, mgf(maskedDb, hLen));\\\\n  return new bn(Buffer.concat([new Buffer([0]), maskedSeed, maskedDb], k));\\\\n}\\\\nfunction pkcs1(key, msg, reverse){\\\\n  var mLen = msg.length;\\\\n  var k = key.modulus.byteLength();\\\\n  if (mLen > k - 11) {\\\\n    throw new Error(\'message too long\');\\\\n  }\\\\n  var ps;\\\\n  if (reverse) {\\\\n    ps = new Buffer(k - mLen - 3);\\\\n    ps.fill(0xff);\\\\n  } else {\\\\n    ps = nonZero(k - mLen - 3);\\\\n  }\\\\n  return new bn(Buffer.concat([new Buffer([0, reverse?1:2]), ps, new Buffer([0]), msg], k));\\\\n}\\\\nfunction nonZero(len, crypto) {\\\\n  var out = new Buffer(len);\\\\n  var i = 0;\\\\n  var cache = randomBytes(len*2);\\\\n  var cur = 0;\\\\n  var num;\\\\n  while (i < len) {\\\\n    if (cur === cache.length) {\\\\n      cache = randomBytes(len*2);\\\\n      cur = 0;\\\\n    }\\\\n    num = cache[cur++];\\\\n    if (num) {\\\\n      out[i++] = num;\\\\n    }\\\\n  }\\\\n  return out;\\\\n}\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/public-encrypt/publicEncrypt.js\\\\n// module id = 302\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/public-encrypt/publicEncrypt.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nvar strictUriEncode = __webpack_require__(323);\\\\nvar objectAssign = __webpack_require__(138);\\\\nvar decodeComponent = __webpack_require__(240);\\\\n\\\\nfunction encoderForArrayFormat(opts) {\\\\n\\\\tswitch (opts.arrayFormat) {\\\\n\\\\t\\\\tcase \'index\':\\\\n\\\\t\\\\t\\\\treturn function (key, value, index) {\\\\n\\\\t\\\\t\\\\t\\\\treturn value === null ? [\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(key, opts),\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\'[\',\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tindex,\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\']\'\\\\n\\\\t\\\\t\\\\t\\\\t].join(\'\') : [\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(key, opts),\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\'[\',\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(index, opts),\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\']=\',\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(value, opts)\\\\n\\\\t\\\\t\\\\t\\\\t].join(\'\');\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\n\\\\t\\\\tcase \'bracket\':\\\\n\\\\t\\\\t\\\\treturn function (key, value) {\\\\n\\\\t\\\\t\\\\t\\\\treturn value === null ? encode(key, opts) : [\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(key, opts),\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\'[]=\',\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(value, opts)\\\\n\\\\t\\\\t\\\\t\\\\t].join(\'\');\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\n\\\\t\\\\tdefault:\\\\n\\\\t\\\\t\\\\treturn function (key, value) {\\\\n\\\\t\\\\t\\\\t\\\\treturn value === null ? encode(key, opts) : [\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(key, opts),\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t\'=\',\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tencode(value, opts)\\\\n\\\\t\\\\t\\\\t\\\\t].join(\'\');\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\t}\\\\n}\\\\n\\\\nfunction parserForArrayFormat(opts) {\\\\n\\\\tvar result;\\\\n\\\\n\\\\tswitch (opts.arrayFormat) {\\\\n\\\\t\\\\tcase \'index\':\\\\n\\\\t\\\\t\\\\treturn function (key, value, accumulator) {\\\\n\\\\t\\\\t\\\\t\\\\tresult = /\\\\\\\\[(\\\\\\\\d*)\\\\\\\\]$/.exec(key);\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tkey = key.replace(/\\\\\\\\[\\\\\\\\d*\\\\\\\\]$/, \'\');\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tif (!result) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\taccumulator[key] = value;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tif (accumulator[key] === undefined) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\taccumulator[key] = {};\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\t\\\\taccumulator[key][result[1]] = value;\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\n\\\\t\\\\tcase \'bracket\':\\\\n\\\\t\\\\t\\\\treturn function (key, value, accumulator) {\\\\n\\\\t\\\\t\\\\t\\\\tresult = /(\\\\\\\\[\\\\\\\\])$/.exec(key);\\\\n\\\\t\\\\t\\\\t\\\\tkey = key.replace(/\\\\\\\\[\\\\\\\\]$/, \'\');\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tif (!result) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\taccumulator[key] = value;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn;\\\\n\\\\t\\\\t\\\\t\\\\t} else if (accumulator[key] === undefined) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\taccumulator[key] = [value];\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\t\\\\taccumulator[key] = [].concat(accumulator[key], value);\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\n\\\\t\\\\tdefault:\\\\n\\\\t\\\\t\\\\treturn function (key, value, accumulator) {\\\\n\\\\t\\\\t\\\\t\\\\tif (accumulator[key] === undefined) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\taccumulator[key] = value;\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\t\\\\taccumulator[key] = [].concat(accumulator[key], value);\\\\n\\\\t\\\\t\\\\t};\\\\n\\\\t}\\\\n}\\\\n\\\\nfunction encode(value, opts) {\\\\n\\\\tif (opts.encode) {\\\\n\\\\t\\\\treturn opts.strict ? strictUriEncode(value) : encodeURIComponent(value);\\\\n\\\\t}\\\\n\\\\n\\\\treturn value;\\\\n}\\\\n\\\\nfunction keysSorter(input) {\\\\n\\\\tif (Array.isArray(input)) {\\\\n\\\\t\\\\treturn input.sort();\\\\n\\\\t} else if (typeof input === \'object\') {\\\\n\\\\t\\\\treturn keysSorter(Object.keys(input)).sort(function (a, b) {\\\\n\\\\t\\\\t\\\\treturn Number(a) - Number(b);\\\\n\\\\t\\\\t}).map(function (key) {\\\\n\\\\t\\\\t\\\\treturn input[key];\\\\n\\\\t\\\\t});\\\\n\\\\t}\\\\n\\\\n\\\\treturn input;\\\\n}\\\\n\\\\nfunction extract(str) {\\\\n\\\\tvar queryStart = str.indexOf(\'?\');\\\\n\\\\tif (queryStart === -1) {\\\\n\\\\t\\\\treturn \'\';\\\\n\\\\t}\\\\n\\\\treturn str.slice(queryStart + 1);\\\\n}\\\\n\\\\nfunction parse(str, opts) {\\\\n\\\\topts = objectAssign({arrayFormat: \'none\'}, opts);\\\\n\\\\n\\\\tvar formatter = parserForArrayFormat(opts);\\\\n\\\\n\\\\t// Create an object with no prototype\\\\n\\\\t// https://github.com/sindresorhus/query-string/issues/47\\\\n\\\\tvar ret = Object.create(null);\\\\n\\\\n\\\\tif (typeof str !== \'string\') {\\\\n\\\\t\\\\treturn ret;\\\\n\\\\t}\\\\n\\\\n\\\\tstr = str.trim().replace(/^[?#&]/, \'\');\\\\n\\\\n\\\\tif (!str) {\\\\n\\\\t\\\\treturn ret;\\\\n\\\\t}\\\\n\\\\n\\\\tstr.split(\'&\').forEach(function (param) {\\\\n\\\\t\\\\tvar parts = param.replace(/\\\\\\\\+/g, \' \').split(\'=\');\\\\n\\\\t\\\\t// Firefox (pre 40) decodes `%3D` to `=`\\\\n\\\\t\\\\t// https://github.com/sindresorhus/query-string/pull/37\\\\n\\\\t\\\\tvar key = parts.shift();\\\\n\\\\t\\\\tvar val = parts.length > 0 ? parts.join(\'=\') : undefined;\\\\n\\\\n\\\\t\\\\t// missing `=` should be `null`:\\\\n\\\\t\\\\t// http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters\\\\n\\\\t\\\\tval = val === undefined ? null : decodeComponent(val);\\\\n\\\\n\\\\t\\\\tformatter(decodeComponent(key), val, ret);\\\\n\\\\t});\\\\n\\\\n\\\\treturn Object.keys(ret).sort().reduce(function (result, key) {\\\\n\\\\t\\\\tvar val = ret[key];\\\\n\\\\t\\\\tif (Boolean(val) && typeof val === \'object\' && !Array.isArray(val)) {\\\\n\\\\t\\\\t\\\\t// Sort object keys, not values\\\\n\\\\t\\\\t\\\\tresult[key] = keysSorter(val);\\\\n\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\tresult[key] = val;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\treturn result;\\\\n\\\\t}, Object.create(null));\\\\n}\\\\n\\\\nexports.extract = extract;\\\\nexports.parse = parse;\\\\n\\\\nexports.stringify = function (obj, opts) {\\\\n\\\\tvar defaults = {\\\\n\\\\t\\\\tencode: true,\\\\n\\\\t\\\\tstrict: true,\\\\n\\\\t\\\\tarrayFormat: \'none\'\\\\n\\\\t};\\\\n\\\\n\\\\topts = objectAssign(defaults, opts);\\\\n\\\\n\\\\tif (opts.sort === false) {\\\\n\\\\t\\\\topts.sort = function () {};\\\\n\\\\t}\\\\n\\\\n\\\\tvar formatter = encoderForArrayFormat(opts);\\\\n\\\\n\\\\treturn obj ? Object.keys(obj).sort(opts.sort).map(function (key) {\\\\n\\\\t\\\\tvar val = obj[key];\\\\n\\\\n\\\\t\\\\tif (val === undefined) {\\\\n\\\\t\\\\t\\\\treturn \'\';\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tif (val === null) {\\\\n\\\\t\\\\t\\\\treturn encode(key, opts);\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tif (Array.isArray(val)) {\\\\n\\\\t\\\\t\\\\tvar result = [];\\\\n\\\\n\\\\t\\\\t\\\\tval.slice().forEach(function (val2) {\\\\n\\\\t\\\\t\\\\t\\\\tif (val2 === undefined) {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\treturn;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t\\\\t\\\\tresult.push(formatter(key, val2, result.length));\\\\n\\\\t\\\\t\\\\t});\\\\n\\\\n\\\\t\\\\t\\\\treturn result.join(\'&\');\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\treturn encode(key, opts) + \'=\' + encode(val, opts);\\\\n\\\\t}).filter(function (x) {\\\\n\\\\t\\\\treturn x.length > 0;\\\\n\\\\t}).join(\'&\') : \'\';\\\\n};\\\\n\\\\nexports.parseUrl = function (str, opts) {\\\\n\\\\treturn {\\\\n\\\\t\\\\turl: str.split(\'?\')[0] || \'\',\\\\n\\\\t\\\\tquery: parse(extract(str), opts)\\\\n\\\\t};\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/query-string/index.js\\\\n// module id = 303\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/query-string/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(global, process) {\\\\n\\\\nfunction oldBrowser () {\\\\n  throw new Error(\'secure random number generation not supported by this browser\\\\\\\\nuse chrome, FireFox or Internet Explorer 11\')\\\\n}\\\\nvar safeBuffer = __webpack_require__(2)\\\\nvar randombytes = __webpack_require__(29)\\\\nvar Buffer = safeBuffer.Buffer\\\\nvar kBufferMaxLength = safeBuffer.kMaxLength\\\\nvar crypto = global.crypto || global.msCrypto\\\\nvar kMaxUint32 = Math.pow(2, 32) - 1\\\\nfunction assertOffset (offset, length) {\\\\n  if (typeof offset !== \'number\' || offset !== offset) { // eslint-disable-line no-self-compare\\\\n    throw new TypeError(\'offset must be a number\')\\\\n  }\\\\n\\\\n  if (offset > kMaxUint32 || offset < 0) {\\\\n    throw new TypeError(\'offset must be a uint32\')\\\\n  }\\\\n\\\\n  if (offset > kBufferMaxLength || offset > length) {\\\\n    throw new RangeError(\'offset out of range\')\\\\n  }\\\\n}\\\\n\\\\nfunction assertSize (size, offset, length) {\\\\n  if (typeof size !== \'number\' || size !== size) { // eslint-disable-line no-self-compare\\\\n    throw new TypeError(\'size must be a number\')\\\\n  }\\\\n\\\\n  if (size > kMaxUint32 || size < 0) {\\\\n    throw new TypeError(\'size must be a uint32\')\\\\n  }\\\\n\\\\n  if (size + offset > length || size > kBufferMaxLength) {\\\\n    throw new RangeError(\'buffer too small\')\\\\n  }\\\\n}\\\\nif ((crypto && crypto.getRandomValues) || !process.browser) {\\\\n  exports.randomFill = randomFill\\\\n  exports.randomFillSync = randomFillSync\\\\n} else {\\\\n  exports.randomFill = oldBrowser\\\\n  exports.randomFillSync = oldBrowser\\\\n}\\\\nfunction randomFill (buf, offset, size, cb) {\\\\n  if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\\\\n    throw new TypeError(\'\\\\\\"buf\\\\\\" argument must be a Buffer or Uint8Array\')\\\\n  }\\\\n\\\\n  if (typeof offset === \'function\') {\\\\n    cb = offset\\\\n    offset = 0\\\\n    size = buf.length\\\\n  } else if (typeof size === \'function\') {\\\\n    cb = size\\\\n    size = buf.length - offset\\\\n  } else if (typeof cb !== \'function\') {\\\\n    throw new TypeError(\'\\\\\\"cb\\\\\\" argument must be a function\')\\\\n  }\\\\n  assertOffset(offset, buf.length)\\\\n  assertSize(size, offset, buf.length)\\\\n  return actualFill(buf, offset, size, cb)\\\\n}\\\\n\\\\nfunction actualFill (buf, offset, size, cb) {\\\\n  if (process.browser) {\\\\n    var ourBuf = buf.buffer\\\\n    var uint = new Uint8Array(ourBuf, offset, size)\\\\n    crypto.getRandomValues(uint)\\\\n    if (cb) {\\\\n      process.nextTick(function () {\\\\n        cb(null, buf)\\\\n      })\\\\n      return\\\\n    }\\\\n    return buf\\\\n  }\\\\n  if (cb) {\\\\n    randombytes(size, function (err, bytes) {\\\\n      if (err) {\\\\n        return cb(err)\\\\n      }\\\\n      bytes.copy(buf, offset)\\\\n      cb(null, buf)\\\\n    })\\\\n    return\\\\n  }\\\\n  var bytes = randombytes(size)\\\\n  bytes.copy(buf, offset)\\\\n  return buf\\\\n}\\\\nfunction randomFillSync (buf, offset, size) {\\\\n  if (typeof offset === \'undefined\') {\\\\n    offset = 0\\\\n  }\\\\n  if (!Buffer.isBuffer(buf) && !(buf instanceof global.Uint8Array)) {\\\\n    throw new TypeError(\'\\\\\\"buf\\\\\\" argument must be a Buffer or Uint8Array\')\\\\n  }\\\\n\\\\n  assertOffset(offset, buf.length)\\\\n\\\\n  if (size === undefined) size = buf.length - offset\\\\n\\\\n  assertSize(size, offset, buf.length)\\\\n\\\\n  return actualFill(buf, offset, size)\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/randomfill/browser.js\\\\n// module id = 304\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/randomfill/browser.js\\")},function(module,exports){eval(\\"module.exports = window.crypto;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/randomhex/src/browser.js\\\\n// module id = 305\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/randomhex/src/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(305);\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/randomhex/src/crypto.js\\\\n// module id = 306\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/randomhex/src/crypto.js\\")},function(module,exports,__webpack_require__){eval(\\"var randomHex = function(size, callback) {\\\\n    var crypto = __webpack_require__(306);\\\\n    var isCallback = (typeof callback === \'function\');\\\\n\\\\n    \\\\n    if (size > 65536) {\\\\n        if(isCallback) {\\\\n            callback(new Error(\'Requested too many random bytes.\'));\\\\n        } else {\\\\n            throw new Error(\'Requested too many random bytes.\');\\\\n        }\\\\n    };\\\\n\\\\n\\\\n    // is node\\\\n    if (typeof crypto !== \'undefined\' && crypto.randomBytes) {\\\\n\\\\n        if(isCallback) {\\\\n            crypto.randomBytes(size, function(err, result){\\\\n                if(!err) {\\\\n                    callback(null, \'0x\'+ result.toString(\'hex\'));\\\\n                } else {\\\\n                    callback(error);\\\\n                }\\\\n            })\\\\n        } else {\\\\n            return \'0x\'+ crypto.randomBytes(size).toString(\'hex\');\\\\n        }\\\\n\\\\n    // is browser\\\\n    } else {\\\\n        var cryptoLib;\\\\n\\\\n        if (typeof crypto !== \'undefined\') {\\\\n            cryptoLib = crypto;\\\\n        } else if(typeof msCrypto !== \'undefined\') {\\\\n            cryptoLib = msCrypto;\\\\n        }\\\\n\\\\n        if (cryptoLib && cryptoLib.getRandomValues) {\\\\n            var randomBytes = cryptoLib.getRandomValues(new Uint8Array(size));\\\\n            var returnValue = \'0x\'+ Array.from(randomBytes).map(function(arr){ return arr.toString(16); }).join(\'\');\\\\n\\\\n            if(isCallback) {\\\\n                callback(null, returnValue);\\\\n            } else {\\\\n                return returnValue;\\\\n            }\\\\n\\\\n        // not crypto object\\\\n        } else {\\\\n            var error = new Error(\'No \\\\\\"crypto\\\\\\" object available. This Browser doesn\\\\\\\\\'t support generating secure random bytes.\');\\\\n\\\\n            if(isCallback) {\\\\n                callback(error);\\\\n            } else {\\\\n               throw error;\\\\n            }\\\\n        }\\\\n    }\\\\n};\\\\n\\\\n\\\\nmodule.exports = randomHex;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/randomhex/src/index.js\\\\n// module id = 307\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/randomhex/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(24);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/duplex-browser.js\\\\n// module id = 308\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/duplex-browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'// Copyright Joyent, Inc. and other Node contributors.\\\\n//\\\\n// Permission is hereby granted, free of charge, to any person obtaining a\\\\n// copy of this software and associated documentation files (the\\\\n// \\"Software\\"), to deal in the Software without restriction, including\\\\n// without limitation the rights to use, copy, modify, merge, publish,\\\\n// distribute, sublicense, and/or sell copies of the Software, and to permit\\\\n// persons to whom the Software is furnished to do so, subject to the\\\\n// following conditions:\\\\n//\\\\n// The above copyright notice and this permission notice shall be included\\\\n// in all copies or substantial portions of the Software.\\\\n//\\\\n// THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\\\\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\\\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\\\\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\\\\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\\\\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\\\\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\\\\n\\\\n// a passthrough stream.\\\\n// basically just the most minimal sort of Transform stream.\\\\n// Every written chunk gets output as-is.\\\\n\\\\n\\\\n\\\\nmodule.exports = PassThrough;\\\\n\\\\nvar Transform = __webpack_require__(150);\\\\n\\\\n/*<replacement>*/\\\\nvar util = __webpack_require__(38);\\\\nutil.inherits = __webpack_require__(0);\\\\n/*</replacement>*/\\\\n\\\\nutil.inherits(PassThrough, Transform);\\\\n\\\\nfunction PassThrough(options) {\\\\n  if (!(this instanceof PassThrough)) return new PassThrough(options);\\\\n\\\\n  Transform.call(this, options);\\\\n}\\\\n\\\\nPassThrough.prototype._transform = function (chunk, encoding, cb) {\\\\n  cb(null, chunk);\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/_stream_passthrough.js\\\\n// module id = 309\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/_stream_passthrough.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\n\\\\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\\\\\\"Cannot call a class as a function\\\\\\"); } }\\\\n\\\\nvar Buffer = __webpack_require__(2).Buffer;\\\\nvar util = __webpack_require__(380);\\\\n\\\\nfunction copyBuffer(src, target, offset) {\\\\n  src.copy(target, offset);\\\\n}\\\\n\\\\nmodule.exports = function () {\\\\n  function BufferList() {\\\\n    _classCallCheck(this, BufferList);\\\\n\\\\n    this.head = null;\\\\n    this.tail = null;\\\\n    this.length = 0;\\\\n  }\\\\n\\\\n  BufferList.prototype.push = function push(v) {\\\\n    var entry = { data: v, next: null };\\\\n    if (this.length > 0) this.tail.next = entry;else this.head = entry;\\\\n    this.tail = entry;\\\\n    ++this.length;\\\\n  };\\\\n\\\\n  BufferList.prototype.unshift = function unshift(v) {\\\\n    var entry = { data: v, next: this.head };\\\\n    if (this.length === 0) this.tail = entry;\\\\n    this.head = entry;\\\\n    ++this.length;\\\\n  };\\\\n\\\\n  BufferList.prototype.shift = function shift() {\\\\n    if (this.length === 0) return;\\\\n    var ret = this.head.data;\\\\n    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;\\\\n    --this.length;\\\\n    return ret;\\\\n  };\\\\n\\\\n  BufferList.prototype.clear = function clear() {\\\\n    this.head = this.tail = null;\\\\n    this.length = 0;\\\\n  };\\\\n\\\\n  BufferList.prototype.join = function join(s) {\\\\n    if (this.length === 0) return \'\';\\\\n    var p = this.head;\\\\n    var ret = \'\' + p.data;\\\\n    while (p = p.next) {\\\\n      ret += s + p.data;\\\\n    }return ret;\\\\n  };\\\\n\\\\n  BufferList.prototype.concat = function concat(n) {\\\\n    if (this.length === 0) return Buffer.alloc(0);\\\\n    if (this.length === 1) return this.head.data;\\\\n    var ret = Buffer.allocUnsafe(n >>> 0);\\\\n    var p = this.head;\\\\n    var i = 0;\\\\n    while (p) {\\\\n      copyBuffer(p.data, ret, i);\\\\n      i += p.data.length;\\\\n      p = p.next;\\\\n    }\\\\n    return ret;\\\\n  };\\\\n\\\\n  return BufferList;\\\\n}();\\\\n\\\\nif (util && util.inspect && util.inspect.custom) {\\\\n  module.exports.prototype[util.inspect.custom] = function () {\\\\n    var obj = util.inspect({ length: this.length });\\\\n    return this.constructor.name + \' \' + obj;\\\\n  };\\\\n}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/lib/internal/streams/BufferList.js\\\\n// module id = 310\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/lib/internal/streams/BufferList.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(88).PassThrough\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/passthrough.js\\\\n// module id = 311\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/passthrough.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(88).Transform\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/transform.js\\\\n// module id = 312\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/transform.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(87);\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/readable-stream/writable-browser.js\\\\n// module id = 313\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/readable-stream/writable-browser.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(global) {// This method of obtaining a reference to the global object needs to be\\\\n// kept identical to the way it is obtained in runtime.js\\\\nvar g =\\\\n  typeof global === \\"object\\" ? global :\\\\n  typeof window === \\"object\\" ? window :\\\\n  typeof self === \\"object\\" ? self : this;\\\\n\\\\n// Use `getOwnPropertyNames` because not all browsers support calling\\\\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\\\\nvar hadRuntime = g.regeneratorRuntime &&\\\\n  Object.getOwnPropertyNames(g).indexOf(\\"regeneratorRuntime\\") >= 0;\\\\n\\\\n// Save the old regeneratorRuntime in case it needs to be restored later.\\\\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\\\\n\\\\n// Force reevalutation of runtime.js.\\\\ng.regeneratorRuntime = undefined;\\\\n\\\\nmodule.exports = __webpack_require__(315);\\\\n\\\\nif (hadRuntime) {\\\\n  // Restore the original runtime.\\\\n  g.regeneratorRuntime = oldRuntime;\\\\n} else {\\\\n  // Remove the global property added by runtime.js.\\\\n  try {\\\\n    delete g.regeneratorRuntime;\\\\n  } catch(e) {\\\\n    g.regeneratorRuntime = undefined;\\\\n  }\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/regenerator-runtime/runtime-module.js\\\\n// module id = 314\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/regenerator-runtime/runtime-module.js\')},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(global) {/**\\\\n * Copyright (c) 2014, Facebook, Inc.\\\\n * All rights reserved.\\\\n *\\\\n * This source code is licensed under the BSD-style license found in the\\\\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\\\\n * additional grant of patent rights can be found in the PATENTS file in\\\\n * the same directory.\\\\n */\\\\n\\\\n!(function(global) {\\\\n  \\"use strict\\";\\\\n\\\\n  var Op = Object.prototype;\\\\n  var hasOwn = Op.hasOwnProperty;\\\\n  var undefined; // More compressible than void 0.\\\\n  var $Symbol = typeof Symbol === \\"function\\" ? Symbol : {};\\\\n  var iteratorSymbol = $Symbol.iterator || \\"@@iterator\\";\\\\n  var asyncIteratorSymbol = $Symbol.asyncIterator || \\"@@asyncIterator\\";\\\\n  var toStringTagSymbol = $Symbol.toStringTag || \\"@@toStringTag\\";\\\\n\\\\n  var inModule = typeof module === \\"object\\";\\\\n  var runtime = global.regeneratorRuntime;\\\\n  if (runtime) {\\\\n    if (inModule) {\\\\n      // If regeneratorRuntime is defined globally and we\\\\\'re in a module,\\\\n      // make the exports object identical to regeneratorRuntime.\\\\n      module.exports = runtime;\\\\n    }\\\\n    // Don\\\\\'t bother evaluating the rest of this file if the runtime was\\\\n    // already defined globally.\\\\n    return;\\\\n  }\\\\n\\\\n  // Define the runtime globally (as expected by generated code) as either\\\\n  // module.exports (if we\\\\\'re in a module) or a new, empty object.\\\\n  runtime = global.regeneratorRuntime = inModule ? module.exports : {};\\\\n\\\\n  function wrap(innerFn, outerFn, self, tryLocsList) {\\\\n    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\\\\n    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\\\\n    var generator = Object.create(protoGenerator.prototype);\\\\n    var context = new Context(tryLocsList || []);\\\\n\\\\n    // The ._invoke method unifies the implementations of the .next,\\\\n    // .throw, and .return methods.\\\\n    generator._invoke = makeInvokeMethod(innerFn, self, context);\\\\n\\\\n    return generator;\\\\n  }\\\\n  runtime.wrap = wrap;\\\\n\\\\n  // Try/catch helper to minimize deoptimizations. Returns a completion\\\\n  // record like context.tryEntries[i].completion. This interface could\\\\n  // have been (and was previously) designed to take a closure to be\\\\n  // invoked without arguments, but in all the cases we care about we\\\\n  // already have an existing method we want to call, so there\\\\\'s no need\\\\n  // to create a new function object. We can even get away with assuming\\\\n  // the method takes exactly one argument, since that happens to be true\\\\n  // in every case, so we don\\\\\'t have to touch the arguments object. The\\\\n  // only additional allocation required is the completion record, which\\\\n  // has a stable shape and so hopefully should be cheap to allocate.\\\\n  function tryCatch(fn, obj, arg) {\\\\n    try {\\\\n      return { type: \\"normal\\", arg: fn.call(obj, arg) };\\\\n    } catch (err) {\\\\n      return { type: \\"throw\\", arg: err };\\\\n    }\\\\n  }\\\\n\\\\n  var GenStateSuspendedStart = \\"suspendedStart\\";\\\\n  var GenStateSuspendedYield = \\"suspendedYield\\";\\\\n  var GenStateExecuting = \\"executing\\";\\\\n  var GenStateCompleted = \\"completed\\";\\\\n\\\\n  // Returning this object from the innerFn has the same effect as\\\\n  // breaking out of the dispatch switch statement.\\\\n  var ContinueSentinel = {};\\\\n\\\\n  // Dummy constructor functions that we use as the .constructor and\\\\n  // .constructor.prototype properties for functions that return Generator\\\\n  // objects. For full spec compliance, you may wish to configure your\\\\n  // minifier not to mangle the names of these two functions.\\\\n  function Generator() {}\\\\n  function GeneratorFunction() {}\\\\n  function GeneratorFunctionPrototype() {}\\\\n\\\\n  // This is a polyfill for %IteratorPrototype% for environments that\\\\n  // don\\\\\'t natively support it.\\\\n  var IteratorPrototype = {};\\\\n  IteratorPrototype[iteratorSymbol] = function () {\\\\n    return this;\\\\n  };\\\\n\\\\n  var getProto = Object.getPrototypeOf;\\\\n  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\\\\n  if (NativeIteratorPrototype &&\\\\n      NativeIteratorPrototype !== Op &&\\\\n      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\\\\n    // This environment has a native %IteratorPrototype%; use it instead\\\\n    // of the polyfill.\\\\n    IteratorPrototype = NativeIteratorPrototype;\\\\n  }\\\\n\\\\n  var Gp = GeneratorFunctionPrototype.prototype =\\\\n    Generator.prototype = Object.create(IteratorPrototype);\\\\n  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\\\\n  GeneratorFunctionPrototype.constructor = GeneratorFunction;\\\\n  GeneratorFunctionPrototype[toStringTagSymbol] =\\\\n    GeneratorFunction.displayName = \\"GeneratorFunction\\";\\\\n\\\\n  // Helper for defining the .next, .throw, and .return methods of the\\\\n  // Iterator interface in terms of a single ._invoke method.\\\\n  function defineIteratorMethods(prototype) {\\\\n    [\\"next\\", \\"throw\\", \\"return\\"].forEach(function(method) {\\\\n      prototype[method] = function(arg) {\\\\n        return this._invoke(method, arg);\\\\n      };\\\\n    });\\\\n  }\\\\n\\\\n  runtime.isGeneratorFunction = function(genFun) {\\\\n    var ctor = typeof genFun === \\"function\\" && genFun.constructor;\\\\n    return ctor\\\\n      ? ctor === GeneratorFunction ||\\\\n        // For the native GeneratorFunction constructor, the best we can\\\\n        // do is to check its .name property.\\\\n        (ctor.displayName || ctor.name) === \\"GeneratorFunction\\"\\\\n      : false;\\\\n  };\\\\n\\\\n  runtime.mark = function(genFun) {\\\\n    if (Object.setPrototypeOf) {\\\\n      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\\\\n    } else {\\\\n      genFun.__proto__ = GeneratorFunctionPrototype;\\\\n      if (!(toStringTagSymbol in genFun)) {\\\\n        genFun[toStringTagSymbol] = \\"GeneratorFunction\\";\\\\n      }\\\\n    }\\\\n    genFun.prototype = Object.create(Gp);\\\\n    return genFun;\\\\n  };\\\\n\\\\n  // Within the body of any async function, `await x` is transformed to\\\\n  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\\\\n  // `hasOwn.call(value, \\"__await\\")` to determine if the yielded value is\\\\n  // meant to be awaited.\\\\n  runtime.awrap = function(arg) {\\\\n    return { __await: arg };\\\\n  };\\\\n\\\\n  function AsyncIterator(generator) {\\\\n    function invoke(method, arg, resolve, reject) {\\\\n      var record = tryCatch(generator[method], generator, arg);\\\\n      if (record.type === \\"throw\\") {\\\\n        reject(record.arg);\\\\n      } else {\\\\n        var result = record.arg;\\\\n        var value = result.value;\\\\n        if (value &&\\\\n            typeof value === \\"object\\" &&\\\\n            hasOwn.call(value, \\"__await\\")) {\\\\n          return Promise.resolve(value.__await).then(function(value) {\\\\n            invoke(\\"next\\", value, resolve, reject);\\\\n          }, function(err) {\\\\n            invoke(\\"throw\\", err, resolve, reject);\\\\n          });\\\\n        }\\\\n\\\\n        return Promise.resolve(value).then(function(unwrapped) {\\\\n          // When a yielded Promise is resolved, its final value becomes\\\\n          // the .value of the Promise<{value,done}> result for the\\\\n          // current iteration. If the Promise is rejected, however, the\\\\n          // result for this iteration will be rejected with the same\\\\n          // reason. Note that rejections of yielded Promises are not\\\\n          // thrown back into the generator function, as is the case\\\\n          // when an awaited Promise is rejected. This difference in\\\\n          // behavior between yield and await is important, because it\\\\n          // allows the consumer to decide what to do with the yielded\\\\n          // rejection (swallow it and continue, manually .throw it back\\\\n          // into the generator, abandon iteration, whatever). With\\\\n          // await, by contrast, there is no opportunity to examine the\\\\n          // rejection reason outside the generator function, so the\\\\n          // only option is to throw it from the await expression, and\\\\n          // let the generator function handle the exception.\\\\n          result.value = unwrapped;\\\\n          resolve(result);\\\\n        }, reject);\\\\n      }\\\\n    }\\\\n\\\\n    if (typeof global.process === \\"object\\" && global.process.domain) {\\\\n      invoke = global.process.domain.bind(invoke);\\\\n    }\\\\n\\\\n    var previousPromise;\\\\n\\\\n    function enqueue(method, arg) {\\\\n      function callInvokeWithMethodAndArg() {\\\\n        return new Promise(function(resolve, reject) {\\\\n          invoke(method, arg, resolve, reject);\\\\n        });\\\\n      }\\\\n\\\\n      return previousPromise =\\\\n        // If enqueue has been called before, then we want to wait until\\\\n        // all previous Promises have been resolved before calling invoke,\\\\n        // so that results are always delivered in the correct order. If\\\\n        // enqueue has not been called before, then it is important to\\\\n        // call invoke immediately, without waiting on a callback to fire,\\\\n        // so that the async generator function has the opportunity to do\\\\n        // any necessary setup in a predictable way. This predictability\\\\n        // is why the Promise constructor synchronously invokes its\\\\n        // executor callback, and why async functions synchronously\\\\n        // execute code before the first await. Since we implement simple\\\\n        // async functions in terms of async generators, it is especially\\\\n        // important to get this right, even though it requires care.\\\\n        previousPromise ? previousPromise.then(\\\\n          callInvokeWithMethodAndArg,\\\\n          // Avoid propagating failures to Promises returned by later\\\\n          // invocations of the iterator.\\\\n          callInvokeWithMethodAndArg\\\\n        ) : callInvokeWithMethodAndArg();\\\\n    }\\\\n\\\\n    // Define the unified helper method that is used to implement .next,\\\\n    // .throw, and .return (see defineIteratorMethods).\\\\n    this._invoke = enqueue;\\\\n  }\\\\n\\\\n  defineIteratorMethods(AsyncIterator.prototype);\\\\n  AsyncIterator.prototype[asyncIteratorSymbol] = function () {\\\\n    return this;\\\\n  };\\\\n  runtime.AsyncIterator = AsyncIterator;\\\\n\\\\n  // Note that simple async functions are implemented on top of\\\\n  // AsyncIterator objects; they just return a Promise for the value of\\\\n  // the final result produced by the iterator.\\\\n  runtime.async = function(innerFn, outerFn, self, tryLocsList) {\\\\n    var iter = new AsyncIterator(\\\\n      wrap(innerFn, outerFn, self, tryLocsList)\\\\n    );\\\\n\\\\n    return runtime.isGeneratorFunction(outerFn)\\\\n      ? iter // If outerFn is a generator, return the full iterator.\\\\n      : iter.next().then(function(result) {\\\\n          return result.done ? result.value : iter.next();\\\\n        });\\\\n  };\\\\n\\\\n  function makeInvokeMethod(innerFn, self, context) {\\\\n    var state = GenStateSuspendedStart;\\\\n\\\\n    return function invoke(method, arg) {\\\\n      if (state === GenStateExecuting) {\\\\n        throw new Error(\\"Generator is already running\\");\\\\n      }\\\\n\\\\n      if (state === GenStateCompleted) {\\\\n        if (method === \\"throw\\") {\\\\n          throw arg;\\\\n        }\\\\n\\\\n        // Be forgiving, per 25.3.3.3.3 of the spec:\\\\n        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\\\\n        return doneResult();\\\\n      }\\\\n\\\\n      context.method = method;\\\\n      context.arg = arg;\\\\n\\\\n      while (true) {\\\\n        var delegate = context.delegate;\\\\n        if (delegate) {\\\\n          var delegateResult = maybeInvokeDelegate(delegate, context);\\\\n          if (delegateResult) {\\\\n            if (delegateResult === ContinueSentinel) continue;\\\\n            return delegateResult;\\\\n          }\\\\n        }\\\\n\\\\n        if (context.method === \\"next\\") {\\\\n          // Setting context._sent for legacy support of Babel\\\\\'s\\\\n          // function.sent implementation.\\\\n          context.sent = context._sent = context.arg;\\\\n\\\\n        } else if (context.method === \\"throw\\") {\\\\n          if (state === GenStateSuspendedStart) {\\\\n            state = GenStateCompleted;\\\\n            throw context.arg;\\\\n          }\\\\n\\\\n          context.dispatchException(context.arg);\\\\n\\\\n        } else if (context.method === \\"return\\") {\\\\n          context.abrupt(\\"return\\", context.arg);\\\\n        }\\\\n\\\\n        state = GenStateExecuting;\\\\n\\\\n        var record = tryCatch(innerFn, self, context);\\\\n        if (record.type === \\"normal\\") {\\\\n          // If an exception is thrown from innerFn, we leave state ===\\\\n          // GenStateExecuting and loop back for another invocation.\\\\n          state = context.done\\\\n            ? GenStateCompleted\\\\n            : GenStateSuspendedYield;\\\\n\\\\n          if (record.arg === ContinueSentinel) {\\\\n            continue;\\\\n          }\\\\n\\\\n          return {\\\\n            value: record.arg,\\\\n            done: context.done\\\\n          };\\\\n\\\\n        } else if (record.type === \\"throw\\") {\\\\n          state = GenStateCompleted;\\\\n          // Dispatch the exception by looping back around to the\\\\n          // context.dispatchException(context.arg) call above.\\\\n          context.method = \\"throw\\";\\\\n          context.arg = record.arg;\\\\n        }\\\\n      }\\\\n    };\\\\n  }\\\\n\\\\n  // Call delegate.iterator[context.method](context.arg) and handle the\\\\n  // result, either by returning a { value, done } result from the\\\\n  // delegate iterator, or by modifying context.method and context.arg,\\\\n  // setting context.delegate to null, and returning the ContinueSentinel.\\\\n  function maybeInvokeDelegate(delegate, context) {\\\\n    var method = delegate.iterator[context.method];\\\\n    if (method === undefined) {\\\\n      // A .throw or .return when the delegate iterator has no .throw\\\\n      // method always terminates the yield* loop.\\\\n      context.delegate = null;\\\\n\\\\n      if (context.method === \\"throw\\") {\\\\n        if (delegate.iterator.return) {\\\\n          // If the delegate iterator has a return method, give it a\\\\n          // chance to clean up.\\\\n          context.method = \\"return\\";\\\\n          context.arg = undefined;\\\\n          maybeInvokeDelegate(delegate, context);\\\\n\\\\n          if (context.method === \\"throw\\") {\\\\n            // If maybeInvokeDelegate(context) changed context.method from\\\\n            // \\"return\\" to \\"throw\\", let that override the TypeError below.\\\\n            return ContinueSentinel;\\\\n          }\\\\n        }\\\\n\\\\n        context.method = \\"throw\\";\\\\n        context.arg = new TypeError(\\\\n          \\"The iterator does not provide a \\\\\'throw\\\\\' method\\");\\\\n      }\\\\n\\\\n      return ContinueSentinel;\\\\n    }\\\\n\\\\n    var record = tryCatch(method, delegate.iterator, context.arg);\\\\n\\\\n    if (record.type === \\"throw\\") {\\\\n      context.method = \\"throw\\";\\\\n      context.arg = record.arg;\\\\n      context.delegate = null;\\\\n      return ContinueSentinel;\\\\n    }\\\\n\\\\n    var info = record.arg;\\\\n\\\\n    if (! info) {\\\\n      context.method = \\"throw\\";\\\\n      context.arg = new TypeError(\\"iterator result is not an object\\");\\\\n      context.delegate = null;\\\\n      return ContinueSentinel;\\\\n    }\\\\n\\\\n    if (info.done) {\\\\n      // Assign the result of the finished delegate to the temporary\\\\n      // variable specified by delegate.resultName (see delegateYield).\\\\n      context[delegate.resultName] = info.value;\\\\n\\\\n      // Resume execution at the desired location (see delegateYield).\\\\n      context.next = delegate.nextLoc;\\\\n\\\\n      // If context.method was \\"throw\\" but the delegate handled the\\\\n      // exception, let the outer generator proceed normally. If\\\\n      // context.method was \\"next\\", forget context.arg since it has been\\\\n      // \\"consumed\\" by the delegate iterator. If context.method was\\\\n      // \\"return\\", allow the original .return call to continue in the\\\\n      // outer generator.\\\\n      if (context.method !== \\"return\\") {\\\\n        context.method = \\"next\\";\\\\n        context.arg = undefined;\\\\n      }\\\\n\\\\n    } else {\\\\n      // Re-yield the result returned by the delegate method.\\\\n      return info;\\\\n    }\\\\n\\\\n    // The delegate iterator is finished, so forget it and continue with\\\\n    // the outer generator.\\\\n    context.delegate = null;\\\\n    return ContinueSentinel;\\\\n  }\\\\n\\\\n  // Define Generator.prototype.{next,throw,return} in terms of the\\\\n  // unified ._invoke helper method.\\\\n  defineIteratorMethods(Gp);\\\\n\\\\n  Gp[toStringTagSymbol] = \\"Generator\\";\\\\n\\\\n  // A Generator should always return itself as the iterator object when the\\\\n  // @@iterator function is called on it. Some browsers\\\\\' implementations of the\\\\n  // iterator prototype chain incorrectly implement this, causing the Generator\\\\n  // object to not be returned from this call. This ensures that doesn\\\\\'t happen.\\\\n  // See https://github.com/facebook/regenerator/issues/274 for more details.\\\\n  Gp[iteratorSymbol] = function() {\\\\n    return this;\\\\n  };\\\\n\\\\n  Gp.toString = function() {\\\\n    return \\"[object Generator]\\";\\\\n  };\\\\n\\\\n  function pushTryEntry(locs) {\\\\n    var entry = { tryLoc: locs[0] };\\\\n\\\\n    if (1 in locs) {\\\\n      entry.catchLoc = locs[1];\\\\n    }\\\\n\\\\n    if (2 in locs) {\\\\n      entry.finallyLoc = locs[2];\\\\n      entry.afterLoc = locs[3];\\\\n    }\\\\n\\\\n    this.tryEntries.push(entry);\\\\n  }\\\\n\\\\n  function resetTryEntry(entry) {\\\\n    var record = entry.completion || {};\\\\n    record.type = \\"normal\\";\\\\n    delete record.arg;\\\\n    entry.completion = record;\\\\n  }\\\\n\\\\n  function Context(tryLocsList) {\\\\n    // The root entry object (effectively a try statement without a catch\\\\n    // or a finally block) gives us a place to store values thrown from\\\\n    // locations where there is no enclosing try statement.\\\\n    this.tryEntries = [{ tryLoc: \\"root\\" }];\\\\n    tryLocsList.forEach(pushTryEntry, this);\\\\n    this.reset(true);\\\\n  }\\\\n\\\\n  runtime.keys = function(object) {\\\\n    var keys = [];\\\\n    for (var key in object) {\\\\n      keys.push(key);\\\\n    }\\\\n    keys.reverse();\\\\n\\\\n    // Rather than returning an object with a next method, we keep\\\\n    // things simple and return the next function itself.\\\\n    return function next() {\\\\n      while (keys.length) {\\\\n        var key = keys.pop();\\\\n        if (key in object) {\\\\n          next.value = key;\\\\n          next.done = false;\\\\n          return next;\\\\n        }\\\\n      }\\\\n\\\\n      // To avoid creating an additional object, we just hang the .value\\\\n      // and .done properties off the next function object itself. This\\\\n      // also ensures that the minifier will not anonymize the function.\\\\n      next.done = true;\\\\n      return next;\\\\n    };\\\\n  };\\\\n\\\\n  function values(iterable) {\\\\n    if (iterable) {\\\\n      var iteratorMethod = iterable[iteratorSymbol];\\\\n      if (iteratorMethod) {\\\\n        return iteratorMethod.call(iterable);\\\\n      }\\\\n\\\\n      if (typeof iterable.next === \\"function\\") {\\\\n        return iterable;\\\\n      }\\\\n\\\\n      if (!isNaN(iterable.length)) {\\\\n        var i = -1, next = function next() {\\\\n          while (++i < iterable.length) {\\\\n            if (hasOwn.call(iterable, i)) {\\\\n              next.value = iterable[i];\\\\n              next.done = false;\\\\n              return next;\\\\n            }\\\\n          }\\\\n\\\\n          next.value = undefined;\\\\n          next.done = true;\\\\n\\\\n          return next;\\\\n        };\\\\n\\\\n        return next.next = next;\\\\n      }\\\\n    }\\\\n\\\\n    // Return an iterator with no values.\\\\n    return { next: doneResult };\\\\n  }\\\\n  runtime.values = values;\\\\n\\\\n  function doneResult() {\\\\n    return { value: undefined, done: true };\\\\n  }\\\\n\\\\n  Context.prototype = {\\\\n    constructor: Context,\\\\n\\\\n    reset: function(skipTempReset) {\\\\n      this.prev = 0;\\\\n      this.next = 0;\\\\n      // Resetting context._sent for legacy support of Babel\\\\\'s\\\\n      // function.sent implementation.\\\\n      this.sent = this._sent = undefined;\\\\n      this.done = false;\\\\n      this.delegate = null;\\\\n\\\\n      this.method = \\"next\\";\\\\n      this.arg = undefined;\\\\n\\\\n      this.tryEntries.forEach(resetTryEntry);\\\\n\\\\n      if (!skipTempReset) {\\\\n        for (var name in this) {\\\\n          // Not sure about the optimal order of these conditions:\\\\n          if (name.charAt(0) === \\"t\\" &&\\\\n              hasOwn.call(this, name) &&\\\\n              !isNaN(+name.slice(1))) {\\\\n            this[name] = undefined;\\\\n          }\\\\n        }\\\\n      }\\\\n    },\\\\n\\\\n    stop: function() {\\\\n      this.done = true;\\\\n\\\\n      var rootEntry = this.tryEntries[0];\\\\n      var rootRecord = rootEntry.completion;\\\\n      if (rootRecord.type === \\"throw\\") {\\\\n        throw rootRecord.arg;\\\\n      }\\\\n\\\\n      return this.rval;\\\\n    },\\\\n\\\\n    dispatchException: function(exception) {\\\\n      if (this.done) {\\\\n        throw exception;\\\\n      }\\\\n\\\\n      var context = this;\\\\n      function handle(loc, caught) {\\\\n        record.type = \\"throw\\";\\\\n        record.arg = exception;\\\\n        context.next = loc;\\\\n\\\\n        if (caught) {\\\\n          // If the dispatched exception was caught by a catch block,\\\\n          // then let that catch block handle the exception normally.\\\\n          context.method = \\"next\\";\\\\n          context.arg = undefined;\\\\n        }\\\\n\\\\n        return !! caught;\\\\n      }\\\\n\\\\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\\\\n        var entry = this.tryEntries[i];\\\\n        var record = entry.completion;\\\\n\\\\n        if (entry.tryLoc === \\"root\\") {\\\\n          // Exception thrown outside of any try block that could handle\\\\n          // it, so set the completion value of the entire function to\\\\n          // throw the exception.\\\\n          return handle(\\"end\\");\\\\n        }\\\\n\\\\n        if (entry.tryLoc <= this.prev) {\\\\n          var hasCatch = hasOwn.call(entry, \\"catchLoc\\");\\\\n          var hasFinally = hasOwn.call(entry, \\"finallyLoc\\");\\\\n\\\\n          if (hasCatch && hasFinally) {\\\\n            if (this.prev < entry.catchLoc) {\\\\n              return handle(entry.catchLoc, true);\\\\n            } else if (this.prev < entry.finallyLoc) {\\\\n              return handle(entry.finallyLoc);\\\\n            }\\\\n\\\\n          } else if (hasCatch) {\\\\n            if (this.prev < entry.catchLoc) {\\\\n              return handle(entry.catchLoc, true);\\\\n            }\\\\n\\\\n          } else if (hasFinally) {\\\\n            if (this.prev < entry.finallyLoc) {\\\\n              return handle(entry.finallyLoc);\\\\n            }\\\\n\\\\n          } else {\\\\n            throw new Error(\\"try statement without catch or finally\\");\\\\n          }\\\\n        }\\\\n      }\\\\n    },\\\\n\\\\n    abrupt: function(type, arg) {\\\\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\\\\n        var entry = this.tryEntries[i];\\\\n        if (entry.tryLoc <= this.prev &&\\\\n            hasOwn.call(entry, \\"finallyLoc\\") &&\\\\n            this.prev < entry.finallyLoc) {\\\\n          var finallyEntry = entry;\\\\n          break;\\\\n        }\\\\n      }\\\\n\\\\n      if (finallyEntry &&\\\\n          (type === \\"break\\" ||\\\\n           type === \\"continue\\") &&\\\\n          finallyEntry.tryLoc <= arg &&\\\\n          arg <= finallyEntry.finallyLoc) {\\\\n        // Ignore the finally entry if control is not jumping to a\\\\n        // location outside the try/catch block.\\\\n        finallyEntry = null;\\\\n      }\\\\n\\\\n      var record = finallyEntry ? finallyEntry.completion : {};\\\\n      record.type = type;\\\\n      record.arg = arg;\\\\n\\\\n      if (finallyEntry) {\\\\n        this.method = \\"next\\";\\\\n        this.next = finallyEntry.finallyLoc;\\\\n        return ContinueSentinel;\\\\n      }\\\\n\\\\n      return this.complete(record);\\\\n    },\\\\n\\\\n    complete: function(record, afterLoc) {\\\\n      if (record.type === \\"throw\\") {\\\\n        throw record.arg;\\\\n      }\\\\n\\\\n      if (record.type === \\"break\\" ||\\\\n          record.type === \\"continue\\") {\\\\n        this.next = record.arg;\\\\n      } else if (record.type === \\"return\\") {\\\\n        this.rval = this.arg = record.arg;\\\\n        this.method = \\"return\\";\\\\n        this.next = \\"end\\";\\\\n      } else if (record.type === \\"normal\\" && afterLoc) {\\\\n        this.next = afterLoc;\\\\n      }\\\\n\\\\n      return ContinueSentinel;\\\\n    },\\\\n\\\\n    finish: function(finallyLoc) {\\\\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\\\\n        var entry = this.tryEntries[i];\\\\n        if (entry.finallyLoc === finallyLoc) {\\\\n          this.complete(entry.completion, entry.afterLoc);\\\\n          resetTryEntry(entry);\\\\n          return ContinueSentinel;\\\\n        }\\\\n      }\\\\n    },\\\\n\\\\n    \\"catch\\": function(tryLoc) {\\\\n      for (var i = this.tryEntries.length - 1; i >= 0; --i) {\\\\n        var entry = this.tryEntries[i];\\\\n        if (entry.tryLoc === tryLoc) {\\\\n          var record = entry.completion;\\\\n          if (record.type === \\"throw\\") {\\\\n            var thrown = record.arg;\\\\n            resetTryEntry(entry);\\\\n          }\\\\n          return thrown;\\\\n        }\\\\n      }\\\\n\\\\n      // The context.catch method must only be called with a location\\\\n      // argument that corresponds to a known catch block.\\\\n      throw new Error(\\"illegal catch attempt\\");\\\\n    },\\\\n\\\\n    delegateYield: function(iterable, resultName, nextLoc) {\\\\n      this.delegate = {\\\\n        iterator: values(iterable),\\\\n        resultName: resultName,\\\\n        nextLoc: nextLoc\\\\n      };\\\\n\\\\n      if (this.method === \\"next\\") {\\\\n        // Deliberately forget the last sent value so that we don\\\\\'t\\\\n        // accidentally pass it on to the delegate.\\\\n        this.arg = undefined;\\\\n      }\\\\n\\\\n      return ContinueSentinel;\\\\n    }\\\\n  };\\\\n})(\\\\n  // Among the various tricks for obtaining a reference to the global\\\\n  // object, this seems to be the most reliable technique that does not\\\\n  // use indirect eval (which violates Content Security Policy).\\\\n  typeof global === \\"object\\" ? global :\\\\n  typeof window === \\"object\\" ? window :\\\\n  typeof self === \\"object\\" ? self : this\\\\n);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/regenerator-runtime/runtime.js\\\\n// module id = 315\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/regenerator-runtime/runtime.js\')},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(317)\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/scrypt.js/js.js\\\\n// module id = 316\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/scrypt.js/js.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(Buffer) {var pbkdf2Sync = __webpack_require__(86).pbkdf2Sync\\\\n\\\\nvar MAX_VALUE = 0x7fffffff\\\\n\\\\n// N = Cpu cost, r = Memory cost, p = parallelization cost\\\\nfunction scrypt (key, salt, N, r, p, dkLen, progressCallback) {\\\\n  if (N === 0 || (N & (N - 1)) !== 0) throw Error(\'N must be > 0 and a power of 2\')\\\\n\\\\n  if (N > MAX_VALUE / 128 / r) throw Error(\'Parameter N is too large\')\\\\n  if (r > MAX_VALUE / 128 / p) throw Error(\'Parameter r is too large\')\\\\n\\\\n  var XY = new Buffer(256 * r)\\\\n  var V = new Buffer(128 * r * N)\\\\n\\\\n  // pseudo global\\\\n  var B32 = new Int32Array(16) // salsa20_8\\\\n  var x = new Int32Array(16) // salsa20_8\\\\n  var _X = new Buffer(64) // blockmix_salsa8\\\\n\\\\n  // pseudo global\\\\n  var B = pbkdf2Sync(key, salt, 1, p * 128 * r, \'sha256\')\\\\n\\\\n  var tickCallback\\\\n  if (progressCallback) {\\\\n    var totalOps = p * N * 2\\\\n    var currentOp = 0\\\\n\\\\n    tickCallback = function () {\\\\n      ++currentOp\\\\n\\\\n      // send progress notifications once every 1,000 ops\\\\n      if (currentOp % 1000 === 0) {\\\\n        progressCallback({\\\\n          current: currentOp,\\\\n          total: totalOps,\\\\n          percent: (currentOp / totalOps) * 100.0\\\\n        })\\\\n      }\\\\n    }\\\\n  }\\\\n\\\\n  for (var i = 0; i < p; i++) {\\\\n    smix(B, i * 128 * r, r, N, V, XY)\\\\n  }\\\\n\\\\n  return pbkdf2Sync(key, B, 1, dkLen, \'sha256\')\\\\n\\\\n  // all of these functions are actually moved to the top\\\\n  // due to function hoisting\\\\n\\\\n  function smix (B, Bi, r, N, V, XY) {\\\\n    var Xi = 0\\\\n    var Yi = 128 * r\\\\n    var i\\\\n\\\\n    B.copy(XY, Xi, Bi, Bi + Yi)\\\\n\\\\n    for (i = 0; i < N; i++) {\\\\n      XY.copy(V, i * Yi, Xi, Xi + Yi)\\\\n      blockmix_salsa8(XY, Xi, Yi, r)\\\\n\\\\n      if (tickCallback) tickCallback()\\\\n    }\\\\n\\\\n    for (i = 0; i < N; i++) {\\\\n      var offset = Xi + (2 * r - 1) * 64\\\\n      var j = XY.readUInt32LE(offset) & (N - 1)\\\\n      blockxor(V, j * Yi, XY, Xi, Yi)\\\\n      blockmix_salsa8(XY, Xi, Yi, r)\\\\n\\\\n      if (tickCallback) tickCallback()\\\\n    }\\\\n\\\\n    XY.copy(B, Bi, Xi, Xi + Yi)\\\\n  }\\\\n\\\\n  function blockmix_salsa8 (BY, Bi, Yi, r) {\\\\n    var i\\\\n\\\\n    arraycopy(BY, Bi + (2 * r - 1) * 64, _X, 0, 64)\\\\n\\\\n    for (i = 0; i < 2 * r; i++) {\\\\n      blockxor(BY, i * 64, _X, 0, 64)\\\\n      salsa20_8(_X)\\\\n      arraycopy(_X, 0, BY, Yi + (i * 64), 64)\\\\n    }\\\\n\\\\n    for (i = 0; i < r; i++) {\\\\n      arraycopy(BY, Yi + (i * 2) * 64, BY, Bi + (i * 64), 64)\\\\n    }\\\\n\\\\n    for (i = 0; i < r; i++) {\\\\n      arraycopy(BY, Yi + (i * 2 + 1) * 64, BY, Bi + (i + r) * 64, 64)\\\\n    }\\\\n  }\\\\n\\\\n  function R (a, b) {\\\\n    return (a << b) | (a >>> (32 - b))\\\\n  }\\\\n\\\\n  function salsa20_8 (B) {\\\\n    var i\\\\n\\\\n    for (i = 0; i < 16; i++) {\\\\n      B32[i] = (B[i * 4 + 0] & 0xff) << 0\\\\n      B32[i] |= (B[i * 4 + 1] & 0xff) << 8\\\\n      B32[i] |= (B[i * 4 + 2] & 0xff) << 16\\\\n      B32[i] |= (B[i * 4 + 3] & 0xff) << 24\\\\n      // B32[i] = B.readUInt32LE(i*4)   <--- this is signficantly slower even in Node.js\\\\n    }\\\\n\\\\n    arraycopy(B32, 0, x, 0, 16)\\\\n\\\\n    for (i = 8; i > 0; i -= 2) {\\\\n      x[ 4] ^= R(x[ 0] + x[12], 7)\\\\n      x[ 8] ^= R(x[ 4] + x[ 0], 9)\\\\n      x[12] ^= R(x[ 8] + x[ 4], 13)\\\\n      x[ 0] ^= R(x[12] + x[ 8], 18)\\\\n      x[ 9] ^= R(x[ 5] + x[ 1], 7)\\\\n      x[13] ^= R(x[ 9] + x[ 5], 9)\\\\n      x[ 1] ^= R(x[13] + x[ 9], 13)\\\\n      x[ 5] ^= R(x[ 1] + x[13], 18)\\\\n      x[14] ^= R(x[10] + x[ 6], 7)\\\\n      x[ 2] ^= R(x[14] + x[10], 9)\\\\n      x[ 6] ^= R(x[ 2] + x[14], 13)\\\\n      x[10] ^= R(x[ 6] + x[ 2], 18)\\\\n      x[ 3] ^= R(x[15] + x[11], 7)\\\\n      x[ 7] ^= R(x[ 3] + x[15], 9)\\\\n      x[11] ^= R(x[ 7] + x[ 3], 13)\\\\n      x[15] ^= R(x[11] + x[ 7], 18)\\\\n      x[ 1] ^= R(x[ 0] + x[ 3], 7)\\\\n      x[ 2] ^= R(x[ 1] + x[ 0], 9)\\\\n      x[ 3] ^= R(x[ 2] + x[ 1], 13)\\\\n      x[ 0] ^= R(x[ 3] + x[ 2], 18)\\\\n      x[ 6] ^= R(x[ 5] + x[ 4], 7)\\\\n      x[ 7] ^= R(x[ 6] + x[ 5], 9)\\\\n      x[ 4] ^= R(x[ 7] + x[ 6], 13)\\\\n      x[ 5] ^= R(x[ 4] + x[ 7], 18)\\\\n      x[11] ^= R(x[10] + x[ 9], 7)\\\\n      x[ 8] ^= R(x[11] + x[10], 9)\\\\n      x[ 9] ^= R(x[ 8] + x[11], 13)\\\\n      x[10] ^= R(x[ 9] + x[ 8], 18)\\\\n      x[12] ^= R(x[15] + x[14], 7)\\\\n      x[13] ^= R(x[12] + x[15], 9)\\\\n      x[14] ^= R(x[13] + x[12], 13)\\\\n      x[15] ^= R(x[14] + x[13], 18)\\\\n    }\\\\n\\\\n    for (i = 0; i < 16; ++i) B32[i] = x[i] + B32[i]\\\\n\\\\n    for (i = 0; i < 16; i++) {\\\\n      var bi = i * 4\\\\n      B[bi + 0] = (B32[i] >> 0 & 0xff)\\\\n      B[bi + 1] = (B32[i] >> 8 & 0xff)\\\\n      B[bi + 2] = (B32[i] >> 16 & 0xff)\\\\n      B[bi + 3] = (B32[i] >> 24 & 0xff)\\\\n      // B.writeInt32LE(B32[i], i*4)  //<--- this is signficantly slower even in Node.js\\\\n    }\\\\n  }\\\\n\\\\n  // naive approach... going back to loop unrolling may yield additional performance\\\\n  function blockxor (S, Si, D, Di, len) {\\\\n    for (var i = 0; i < len; i++) {\\\\n      D[Di + i] ^= S[Si + i]\\\\n    }\\\\n  }\\\\n}\\\\n\\\\nfunction arraycopy (src, srcPos, dest, destPos, length) {\\\\n  if (Buffer.isBuffer(src) && Buffer.isBuffer(dest)) {\\\\n    src.copy(dest, destPos, srcPos, srcPos + length)\\\\n  } else {\\\\n    while (length--) {\\\\n      dest[destPos++] = src[srcPos++]\\\\n    }\\\\n  }\\\\n}\\\\n\\\\nmodule.exports = scrypt\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/scryptsy/lib/scrypt.js\\\\n// module id = 317\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/scryptsy/lib/scrypt.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {\\\\n    \\"use strict\\";\\\\n\\\\n    if (global.setImmediate) {\\\\n        return;\\\\n    }\\\\n\\\\n    var nextHandle = 1; // Spec says greater than zero\\\\n    var tasksByHandle = {};\\\\n    var currentlyRunningATask = false;\\\\n    var doc = global.document;\\\\n    var registerImmediate;\\\\n\\\\n    function setImmediate(callback) {\\\\n      // Callback can either be a function or a string\\\\n      if (typeof callback !== \\"function\\") {\\\\n        callback = new Function(\\"\\" + callback);\\\\n      }\\\\n      // Copy function arguments\\\\n      var args = new Array(arguments.length - 1);\\\\n      for (var i = 0; i < args.length; i++) {\\\\n          args[i] = arguments[i + 1];\\\\n      }\\\\n      // Store and register the task\\\\n      var task = { callback: callback, args: args };\\\\n      tasksByHandle[nextHandle] = task;\\\\n      registerImmediate(nextHandle);\\\\n      return nextHandle++;\\\\n    }\\\\n\\\\n    function clearImmediate(handle) {\\\\n        delete tasksByHandle[handle];\\\\n    }\\\\n\\\\n    function run(task) {\\\\n        var callback = task.callback;\\\\n        var args = task.args;\\\\n        switch (args.length) {\\\\n        case 0:\\\\n            callback();\\\\n            break;\\\\n        case 1:\\\\n            callback(args[0]);\\\\n            break;\\\\n        case 2:\\\\n            callback(args[0], args[1]);\\\\n            break;\\\\n        case 3:\\\\n            callback(args[0], args[1], args[2]);\\\\n            break;\\\\n        default:\\\\n            callback.apply(undefined, args);\\\\n            break;\\\\n        }\\\\n    }\\\\n\\\\n    function runIfPresent(handle) {\\\\n        // From the spec: \\"Wait until any invocations of this algorithm started before this one have completed.\\"\\\\n        // So if we\\\\\'re currently running a task, we\\\\\'ll need to delay this invocation.\\\\n        if (currentlyRunningATask) {\\\\n            // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a\\\\n            // \\"too much recursion\\" error.\\\\n            setTimeout(runIfPresent, 0, handle);\\\\n        } else {\\\\n            var task = tasksByHandle[handle];\\\\n            if (task) {\\\\n                currentlyRunningATask = true;\\\\n                try {\\\\n                    run(task);\\\\n                } finally {\\\\n                    clearImmediate(handle);\\\\n                    currentlyRunningATask = false;\\\\n                }\\\\n            }\\\\n        }\\\\n    }\\\\n\\\\n    function installNextTickImplementation() {\\\\n        registerImmediate = function(handle) {\\\\n            process.nextTick(function () { runIfPresent(handle); });\\\\n        };\\\\n    }\\\\n\\\\n    function canUsePostMessage() {\\\\n        // The test against `importScripts` prevents this implementation from being installed inside a web worker,\\\\n        // where `global.postMessage` means something completely different and can\\\\\'t be used for this purpose.\\\\n        if (global.postMessage && !global.importScripts) {\\\\n            var postMessageIsAsynchronous = true;\\\\n            var oldOnMessage = global.onmessage;\\\\n            global.onmessage = function() {\\\\n                postMessageIsAsynchronous = false;\\\\n            };\\\\n            global.postMessage(\\"\\", \\"*\\");\\\\n            global.onmessage = oldOnMessage;\\\\n            return postMessageIsAsynchronous;\\\\n        }\\\\n    }\\\\n\\\\n    function installPostMessageImplementation() {\\\\n        // Installs an event handler on `global` for the `message` event: see\\\\n        // * https://developer.mozilla.org/en/DOM/window.postMessage\\\\n        // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages\\\\n\\\\n        var messagePrefix = \\"setImmediate$\\" + Math.random() + \\"$\\";\\\\n        var onGlobalMessage = function(event) {\\\\n            if (event.source === global &&\\\\n                typeof event.data === \\"string\\" &&\\\\n                event.data.indexOf(messagePrefix) === 0) {\\\\n                runIfPresent(+event.data.slice(messagePrefix.length));\\\\n            }\\\\n        };\\\\n\\\\n        if (global.addEventListener) {\\\\n            global.addEventListener(\\"message\\", onGlobalMessage, false);\\\\n        } else {\\\\n            global.attachEvent(\\"onmessage\\", onGlobalMessage);\\\\n        }\\\\n\\\\n        registerImmediate = function(handle) {\\\\n            global.postMessage(messagePrefix + handle, \\"*\\");\\\\n        };\\\\n    }\\\\n\\\\n    function installMessageChannelImplementation() {\\\\n        var channel = new MessageChannel();\\\\n        channel.port1.onmessage = function(event) {\\\\n            var handle = event.data;\\\\n            runIfPresent(handle);\\\\n        };\\\\n\\\\n        registerImmediate = function(handle) {\\\\n            channel.port2.postMessage(handle);\\\\n        };\\\\n    }\\\\n\\\\n    function installReadyStateChangeImplementation() {\\\\n        var html = doc.documentElement;\\\\n        registerImmediate = function(handle) {\\\\n            // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted\\\\n            // into the document. Do so, thus queuing up the task. Remember to clean up once it\\\\\'s been called.\\\\n            var script = doc.createElement(\\"script\\");\\\\n            script.onreadystatechange = function () {\\\\n                runIfPresent(handle);\\\\n                script.onreadystatechange = null;\\\\n                html.removeChild(script);\\\\n                script = null;\\\\n            };\\\\n            html.appendChild(script);\\\\n        };\\\\n    }\\\\n\\\\n    function installSetTimeoutImplementation() {\\\\n        registerImmediate = function(handle) {\\\\n            setTimeout(runIfPresent, 0, handle);\\\\n        };\\\\n    }\\\\n\\\\n    // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.\\\\n    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);\\\\n    attachTo = attachTo && attachTo.setTimeout ? attachTo : global;\\\\n\\\\n    // Don\\\\\'t get fooled by e.g. browserify environments.\\\\n    if ({}.toString.call(global.process) === \\"[object process]\\") {\\\\n        // For Node.js before 0.9\\\\n        installNextTickImplementation();\\\\n\\\\n    } else if (canUsePostMessage()) {\\\\n        // For non-IE10 modern browsers\\\\n        installPostMessageImplementation();\\\\n\\\\n    } else if (global.MessageChannel) {\\\\n        // For web workers, where supported\\\\n        installMessageChannelImplementation();\\\\n\\\\n    } else if (doc && \\"onreadystatechange\\" in doc.createElement(\\"script\\")) {\\\\n        // For IE 6–8\\\\n        installReadyStateChangeImplementation();\\\\n\\\\n    } else {\\\\n        // For older browsers\\\\n        installSetTimeoutImplementation();\\\\n    }\\\\n\\\\n    attachTo.setImmediate = setImmediate;\\\\n    attachTo.clearImmediate = clearImmediate;\\\\n}(typeof self === \\"undefined\\" ? typeof global === \\"undefined\\" ? this : global : self));\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(13)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/setimmediate/setImmediate.js\\\\n// module id = 318\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/setimmediate/setImmediate.js\')},function(module,exports,__webpack_require__){eval(\\"/*\\\\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined\\\\n * in FIPS PUB 180-1\\\\n * This source code is derived from sha1.js of the same repository.\\\\n * The difference between SHA-0 and SHA-1 is just a bitwise rotate left\\\\n * operation was added.\\\\n */\\\\n\\\\nvar inherits = __webpack_require__(0)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar K = [\\\\n  0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\\\\n]\\\\n\\\\nvar W = new Array(80)\\\\n\\\\nfunction Sha () {\\\\n  this.init()\\\\n  this._w = W\\\\n\\\\n  Hash.call(this, 64, 56)\\\\n}\\\\n\\\\ninherits(Sha, Hash)\\\\n\\\\nSha.prototype.init = function () {\\\\n  this._a = 0x67452301\\\\n  this._b = 0xefcdab89\\\\n  this._c = 0x98badcfe\\\\n  this._d = 0x10325476\\\\n  this._e = 0xc3d2e1f0\\\\n\\\\n  return this\\\\n}\\\\n\\\\nfunction rotl5 (num) {\\\\n  return (num << 5) | (num >>> 27)\\\\n}\\\\n\\\\nfunction rotl30 (num) {\\\\n  return (num << 30) | (num >>> 2)\\\\n}\\\\n\\\\nfunction ft (s, b, c, d) {\\\\n  if (s === 0) return (b & c) | ((~b) & d)\\\\n  if (s === 2) return (b & c) | (b & d) | (c & d)\\\\n  return b ^ c ^ d\\\\n}\\\\n\\\\nSha.prototype._update = function (M) {\\\\n  var W = this._w\\\\n\\\\n  var a = this._a | 0\\\\n  var b = this._b | 0\\\\n  var c = this._c | 0\\\\n  var d = this._d | 0\\\\n  var e = this._e | 0\\\\n\\\\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\\\\n  for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]\\\\n\\\\n  for (var j = 0; j < 80; ++j) {\\\\n    var s = ~~(j / 20)\\\\n    var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\\\\n\\\\n    e = d\\\\n    d = c\\\\n    c = rotl30(b)\\\\n    b = a\\\\n    a = t\\\\n  }\\\\n\\\\n  this._a = (a + this._a) | 0\\\\n  this._b = (b + this._b) | 0\\\\n  this._c = (c + this._c) | 0\\\\n  this._d = (d + this._d) | 0\\\\n  this._e = (e + this._e) | 0\\\\n}\\\\n\\\\nSha.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(20)\\\\n\\\\n  H.writeInt32BE(this._a | 0, 0)\\\\n  H.writeInt32BE(this._b | 0, 4)\\\\n  H.writeInt32BE(this._c | 0, 8)\\\\n  H.writeInt32BE(this._d | 0, 12)\\\\n  H.writeInt32BE(this._e | 0, 16)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha.js\\\\n// module id = 319\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined\\\\n * in FIPS PUB 180-1\\\\n * Version 2.1a Copyright Paul Johnston 2000 - 2002.\\\\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\\\\n * Distributed under the BSD License\\\\n * See http://pajhome.org.uk/crypt/md5 for details.\\\\n */\\\\n\\\\nvar inherits = __webpack_require__(0)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar K = [\\\\n  0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0\\\\n]\\\\n\\\\nvar W = new Array(80)\\\\n\\\\nfunction Sha1 () {\\\\n  this.init()\\\\n  this._w = W\\\\n\\\\n  Hash.call(this, 64, 56)\\\\n}\\\\n\\\\ninherits(Sha1, Hash)\\\\n\\\\nSha1.prototype.init = function () {\\\\n  this._a = 0x67452301\\\\n  this._b = 0xefcdab89\\\\n  this._c = 0x98badcfe\\\\n  this._d = 0x10325476\\\\n  this._e = 0xc3d2e1f0\\\\n\\\\n  return this\\\\n}\\\\n\\\\nfunction rotl1 (num) {\\\\n  return (num << 1) | (num >>> 31)\\\\n}\\\\n\\\\nfunction rotl5 (num) {\\\\n  return (num << 5) | (num >>> 27)\\\\n}\\\\n\\\\nfunction rotl30 (num) {\\\\n  return (num << 30) | (num >>> 2)\\\\n}\\\\n\\\\nfunction ft (s, b, c, d) {\\\\n  if (s === 0) return (b & c) | ((~b) & d)\\\\n  if (s === 2) return (b & c) | (b & d) | (c & d)\\\\n  return b ^ c ^ d\\\\n}\\\\n\\\\nSha1.prototype._update = function (M) {\\\\n  var W = this._w\\\\n\\\\n  var a = this._a | 0\\\\n  var b = this._b | 0\\\\n  var c = this._c | 0\\\\n  var d = this._d | 0\\\\n  var e = this._e | 0\\\\n\\\\n  for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4)\\\\n  for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16])\\\\n\\\\n  for (var j = 0; j < 80; ++j) {\\\\n    var s = ~~(j / 20)\\\\n    var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0\\\\n\\\\n    e = d\\\\n    d = c\\\\n    c = rotl30(b)\\\\n    b = a\\\\n    a = t\\\\n  }\\\\n\\\\n  this._a = (a + this._a) | 0\\\\n  this._b = (b + this._b) | 0\\\\n  this._c = (c + this._c) | 0\\\\n  this._d = (d + this._d) | 0\\\\n  this._e = (e + this._e) | 0\\\\n}\\\\n\\\\nSha1.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(20)\\\\n\\\\n  H.writeInt32BE(this._a | 0, 0)\\\\n  H.writeInt32BE(this._b | 0, 4)\\\\n  H.writeInt32BE(this._c | 0, 8)\\\\n  H.writeInt32BE(this._d | 0, 12)\\\\n  H.writeInt32BE(this._e | 0, 16)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha1\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha1.js\\\\n// module id = 320\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha1.js\\")},function(module,exports,__webpack_require__){eval(\\"/**\\\\n * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined\\\\n * in FIPS 180-2\\\\n * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.\\\\n * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet\\\\n *\\\\n */\\\\n\\\\nvar inherits = __webpack_require__(0)\\\\nvar Sha256 = __webpack_require__(153)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar W = new Array(64)\\\\n\\\\nfunction Sha224 () {\\\\n  this.init()\\\\n\\\\n  this._w = W // new Array(64)\\\\n\\\\n  Hash.call(this, 64, 56)\\\\n}\\\\n\\\\ninherits(Sha224, Sha256)\\\\n\\\\nSha224.prototype.init = function () {\\\\n  this._a = 0xc1059ed8\\\\n  this._b = 0x367cd507\\\\n  this._c = 0x3070dd17\\\\n  this._d = 0xf70e5939\\\\n  this._e = 0xffc00b31\\\\n  this._f = 0x68581511\\\\n  this._g = 0x64f98fa7\\\\n  this._h = 0xbefa4fa4\\\\n\\\\n  return this\\\\n}\\\\n\\\\nSha224.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(28)\\\\n\\\\n  H.writeInt32BE(this._a, 0)\\\\n  H.writeInt32BE(this._b, 4)\\\\n  H.writeInt32BE(this._c, 8)\\\\n  H.writeInt32BE(this._d, 12)\\\\n  H.writeInt32BE(this._e, 16)\\\\n  H.writeInt32BE(this._f, 20)\\\\n  H.writeInt32BE(this._g, 24)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha224\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha224.js\\\\n// module id = 321\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha224.js\\")},function(module,exports,__webpack_require__){eval(\\"var inherits = __webpack_require__(0)\\\\nvar SHA512 = __webpack_require__(154)\\\\nvar Hash = __webpack_require__(30)\\\\nvar Buffer = __webpack_require__(2).Buffer\\\\n\\\\nvar W = new Array(160)\\\\n\\\\nfunction Sha384 () {\\\\n  this.init()\\\\n  this._w = W\\\\n\\\\n  Hash.call(this, 128, 112)\\\\n}\\\\n\\\\ninherits(Sha384, SHA512)\\\\n\\\\nSha384.prototype.init = function () {\\\\n  this._ah = 0xcbbb9d5d\\\\n  this._bh = 0x629a292a\\\\n  this._ch = 0x9159015a\\\\n  this._dh = 0x152fecd8\\\\n  this._eh = 0x67332667\\\\n  this._fh = 0x8eb44a87\\\\n  this._gh = 0xdb0c2e0d\\\\n  this._hh = 0x47b5481d\\\\n\\\\n  this._al = 0xc1059ed8\\\\n  this._bl = 0x367cd507\\\\n  this._cl = 0x3070dd17\\\\n  this._dl = 0xf70e5939\\\\n  this._el = 0xffc00b31\\\\n  this._fl = 0x68581511\\\\n  this._gl = 0x64f98fa7\\\\n  this._hl = 0xbefa4fa4\\\\n\\\\n  return this\\\\n}\\\\n\\\\nSha384.prototype._hash = function () {\\\\n  var H = Buffer.allocUnsafe(48)\\\\n\\\\n  function writeInt64BE (h, l, offset) {\\\\n    H.writeInt32BE(h, offset)\\\\n    H.writeInt32BE(l, offset + 4)\\\\n  }\\\\n\\\\n  writeInt64BE(this._ah, this._al, 0)\\\\n  writeInt64BE(this._bh, this._bl, 8)\\\\n  writeInt64BE(this._ch, this._cl, 16)\\\\n  writeInt64BE(this._dh, this._dl, 24)\\\\n  writeInt64BE(this._eh, this._el, 32)\\\\n  writeInt64BE(this._fh, this._fl, 40)\\\\n\\\\n  return H\\\\n}\\\\n\\\\nmodule.exports = Sha384\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/sha.js/sha384.js\\\\n// module id = 322\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/sha.js/sha384.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"\\\\nmodule.exports = function (str) {\\\\n\\\\treturn encodeURIComponent(str).replace(/[!\'()*]/g, function (c) {\\\\n\\\\t\\\\treturn \'%\' + c.charCodeAt(0).toString(16).toUpperCase();\\\\n\\\\t});\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/strict-uri-encode/index.js\\\\n// module id = 323\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/strict-uri-encode/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var isHexPrefixed = __webpack_require__(279);\\\\n\\\\n/**\\\\n * Removes \'0x\' from a given `String` is present\\\\n * @param {String} str the string value\\\\n * @return {String|Optional} a string by pass if necessary\\\\n */\\\\nmodule.exports = function stripHexPrefix(str) {\\\\n  if (typeof str !== \'string\') {\\\\n    return str;\\\\n  }\\\\n\\\\n  return isHexPrefixed(str) ? str.slice(2) : str;\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/strip-hex-prefix/src/index.js\\\\n// module id = 324\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/strip-hex-prefix/src/index.js\\")},function(module,exports,__webpack_require__){eval(\'var unavailable = function unavailable() {\\\\n  throw \\"This swarm.js function isn\\\\\'t available on the browser.\\";\\\\n};\\\\n\\\\nvar fsp = { readFile: unavailable };\\\\nvar files = { download: unavailable, safeDownloadArchived: unavailable, directoryTree: unavailable };\\\\nvar os = { platform: unavailable, arch: unavailable };\\\\nvar path = { join: unavailable, slice: unavailable };\\\\nvar child_process = { spawn: unavailable };\\\\nvar mimetype = { lookup: unavailable };\\\\nvar defaultArchives = {};\\\\nvar downloadUrl = null;\\\\nvar request = __webpack_require__(369);\\\\nvar bytes = __webpack_require__(127);\\\\nvar hash = __webpack_require__(327);\\\\nvar pick = __webpack_require__(326);\\\\nvar swarm = __webpack_require__(328);\\\\n\\\\nmodule.exports = swarm({\\\\n  fsp: fsp,\\\\n  files: files,\\\\n  os: os,\\\\n  path: path,\\\\n  child_process: child_process,\\\\n  defaultArchives: defaultArchives,\\\\n  mimetype: mimetype,\\\\n  request: request,\\\\n  downloadUrl: downloadUrl,\\\\n  bytes: bytes,\\\\n  hash: hash,\\\\n  pick: pick\\\\n});\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/swarm-js/lib/api-browser.js\\\\n// module id = 325\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/swarm-js/lib/api-browser.js\')},function(module,exports){eval(\'var picker = function picker(type) {\\\\n  return function () {\\\\n    return new Promise(function (resolve, reject) {\\\\n      var fileLoader = function fileLoader(e) {\\\\n        var directory = {};\\\\n        var totalFiles = e.target.files.length;\\\\n        var loadedFiles = 0;\\\\n        [].map.call(e.target.files, function (file) {\\\\n          var reader = new FileReader();\\\\n          reader.onload = function (e) {\\\\n            var data = new Uint8Array(e.target.result);\\\\n            if (type === \\"directory\\") {\\\\n              var path = file.webkitRelativePath;\\\\n              directory[path.slice(path.indexOf(\\"/\\") + 1)] = {\\\\n                type: \\"text/plain\\",\\\\n                data: data\\\\n              };\\\\n              if (++loadedFiles === totalFiles) resolve(directory);\\\\n            } else if (type === \\"file\\") {\\\\n              var _path = file.webkitRelativePath;\\\\n              resolve({ \\"type\\": mimetype.lookup(_path), \\"data\\": data });\\\\n            } else {\\\\n              resolve(data);\\\\n            }\\\\n          };\\\\n          reader.readAsArrayBuffer(file);\\\\n        });\\\\n      };\\\\n\\\\n      var fileInput = void 0;\\\\n      if (type === \\"directory\\") {\\\\n        fileInput = document.createElement(\\"input\\");\\\\n        fileInput.addEventListener(\\"change\\", fileLoader);\\\\n        fileInput.type = \\"file\\";\\\\n        fileInput.webkitdirectory = true;\\\\n        fileInput.mozdirectory = true;\\\\n        fileInput.msdirectory = true;\\\\n        fileInput.odirectory = true;\\\\n        fileInput.directory = true;\\\\n      } else {\\\\n        fileInput = document.createElement(\\"input\\");\\\\n        fileInput.addEventListener(\\"change\\", fileLoader);\\\\n        fileInput.type = \\"file\\";\\\\n      };\\\\n\\\\n      var mouseEvent = document.createEvent(\\"MouseEvents\\");\\\\n      mouseEvent.initEvent(\\"click\\", true, false);\\\\n      fileInput.dispatchEvent(mouseEvent);\\\\n    });\\\\n  };\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  data: picker(\\"data\\"),\\\\n  file: picker(\\"file\\"),\\\\n  directory: picker(\\"directory\\")\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/swarm-js/lib/pick.js\\\\n// module id = 326\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/swarm-js/lib/pick.js\')},function(module,exports,__webpack_require__){eval(\'// Thanks https://github.com/axic/swarmhash\\\\n\\\\nvar keccak = __webpack_require__(128).keccak256;\\\\nvar Bytes = __webpack_require__(127);\\\\n\\\\nvar swarmHashBlock = function swarmHashBlock(length, data) {\\\\n  var lengthEncoded = Bytes.reverse(Bytes.pad(6, Bytes.fromNumber(length)));\\\\n  var bytes = Bytes.flatten([lengthEncoded, \\"0x0000\\", data]);\\\\n  return keccak(bytes).slice(2);\\\\n};\\\\n\\\\n// (Bytes | Uint8Array | String) -> String\\\\nvar swarmHash = function swarmHash(data) {\\\\n  if (typeof data === \\"string\\" && data.slice(0, 2) !== \\"0x\\") {\\\\n    data = Bytes.fromString(data);\\\\n  } else if (typeof data !== \\"string\\" && data.length !== undefined) {\\\\n    data = Bytes.fromUint8Array(data);\\\\n  }\\\\n\\\\n  var length = Bytes.length(data);\\\\n\\\\n  if (length <= 4096) {\\\\n    return swarmHashBlock(length, data);\\\\n  }\\\\n\\\\n  var maxSize = 4096;\\\\n  while (maxSize * (4096 / 32) < length) {\\\\n    maxSize *= 4096 / 32;\\\\n  }\\\\n\\\\n  var innerNodes = [];\\\\n  for (var i = 0; i < length; i += maxSize) {\\\\n    var size = maxSize < length - i ? maxSize : length - i;\\\\n    innerNodes.push(swarmHash(Bytes.slice(data, i, i + size)));\\\\n  }\\\\n\\\\n  return swarmHashBlock(length, Bytes.flatten(innerNodes));\\\\n};\\\\n\\\\nmodule.exports = swarmHash;\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/swarm-js/lib/swarm-hash.js\\\\n// module id = 327\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/swarm-js/lib/swarm-hash.js\')},function(module,exports){eval(\'// TODO: this is a temporary fix to hide those libraries from the browser. A\\\\n// slightly better long-term solution would be to split this file into two,\\\\n// separating the functions that are used on Node.js from the functions that\\\\n// are used only on the browser.\\\\nmodule.exports = function (_ref) {\\\\n  var fsp = _ref.fsp,\\\\n      files = _ref.files,\\\\n      os = _ref.os,\\\\n      path = _ref.path,\\\\n      child_process = _ref.child_process,\\\\n      mimetype = _ref.mimetype,\\\\n      defaultArchives = _ref.defaultArchives,\\\\n      request = _ref.request,\\\\n      downloadUrl = _ref.downloadUrl,\\\\n      bytes = _ref.bytes,\\\\n      hash = _ref.hash,\\\\n      pick = _ref.pick;\\\\n\\\\n\\\\n  // ∀ a . String -> JSON -> Map String a -o Map String a\\\\n  //   Inserts a key/val pair in an object impurely.\\\\n  var impureInsert = function impureInsert(key) {\\\\n    return function (val) {\\\\n      return function (map) {\\\\n        return map[key] = val, map;\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> JSON -> Map String JSON\\\\n  //   Merges an array of keys and an array of vals into an object.\\\\n  var toMap = function toMap(keys) {\\\\n    return function (vals) {\\\\n      var map = {};\\\\n      for (var i = 0, l = keys.length; i < l; ++i) {\\\\n        map[keys[i]] = vals[i];\\\\n      }return map;\\\\n    };\\\\n  };\\\\n\\\\n  // ∀ a . Map String a -> Map String a -> Map String a\\\\n  //   Merges two maps into one.\\\\n  var merge = function merge(a) {\\\\n    return function (b) {\\\\n      var map = {};\\\\n      for (var key in a) {\\\\n        map[key] = a[key];\\\\n      }for (var _key in b) {\\\\n        map[_key] = b[_key];\\\\n      }return map;\\\\n    };\\\\n  };\\\\n\\\\n  // ∀ a . [a] -> [a] -> Bool\\\\n  var equals = function equals(a) {\\\\n    return function (b) {\\\\n      if (a.length !== b.length) {\\\\n        return false;\\\\n      } else {\\\\n        for (var i = 0, l = a.length; i < a; ++i) {\\\\n          if (a[i] !== b[i]) return false;\\\\n        }\\\\n      }\\\\n      return true;\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> String\\\\n  var rawUrl = function rawUrl(swarmUrl) {\\\\n    return function (hash) {\\\\n      return swarmUrl + \\"/bzzr:/\\" + hash;\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> Promise Uint8Array\\\\n  //   Gets the raw contents of a Swarm hash address.\\\\n  var downloadData = function downloadData(swarmUrl) {\\\\n    return function (hash) {\\\\n      return request(rawUrl(swarmUrl)(hash), { responseType: \\"arraybuffer\\" }).then(function (arrayBuffer) {\\\\n        var uint8Array = new Uint8Array(arrayBuffer);\\\\n        var error404 = [52, 48, 52, 32, 112, 97, 103, 101, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 10];\\\\n        if (equals(uint8Array)(error404)) throw \\"Error 404.\\";\\\\n        return uint8Array;\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // type Entry = {\\"type\\": String, \\"hash\\": String}\\\\n  // type File = {\\"type\\": String, \\"data\\": Uint8Array}\\\\n\\\\n  // String -> String -> Promise (Map String Entry)\\\\n  //   Solves the manifest of a Swarm address recursively.\\\\n  //   Returns a map from full paths to entries.\\\\n  var downloadEntries = function downloadEntries(swarmUrl) {\\\\n    return function (hash) {\\\\n      var search = function search(hash) {\\\\n        return function (path) {\\\\n          return function (routes) {\\\\n            // Formats an entry to the Swarm.js type.\\\\n            var format = function format(entry) {\\\\n              return {\\\\n                type: entry.contentType,\\\\n                hash: entry.hash };\\\\n            };\\\\n\\\\n            // To download a single entry:\\\\n            //   if type is bzz-manifest, go deeper\\\\n            //   if not, add it to the routing table\\\\n            var downloadEntry = function downloadEntry(entry) {\\\\n              if (entry.path === undefined) {\\\\n                return Promise.resolve();\\\\n              } else {\\\\n                return entry.contentType === \\"application/bzz-manifest+json\\" ? search(entry.hash)(path + entry.path)(routes) : Promise.resolve(impureInsert(path + entry.path)(format(entry))(routes));\\\\n              }\\\\n            };\\\\n\\\\n            // Downloads the initial manifest and then each entry.\\\\n            return downloadData(swarmUrl)(hash).then(function (text) {\\\\n              return JSON.parse(toString(text)).entries;\\\\n            }).then(function (entries) {\\\\n              return Promise.all(entries.map(downloadEntry));\\\\n            }).then(function () {\\\\n              return routes;\\\\n            });\\\\n          };\\\\n        };\\\\n      };\\\\n\\\\n      return search(hash)(\\"\\")({});\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> Promise (Map String String)\\\\n  //   Same as `downloadEntries`, but returns only hashes (no types).\\\\n  var downloadRoutes = function downloadRoutes(swarmUrl) {\\\\n    return function (hash) {\\\\n      return downloadEntries(swarmUrl)(hash).then(function (entries) {\\\\n        return toMap(Object.keys(entries))(Object.keys(entries).map(function (route) {\\\\n          return entries[route].hash;\\\\n        }));\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> Promise (Map String File)\\\\n  //   Gets the entire directory tree in a Swarm address.\\\\n  //   Returns a promise mapping paths to file contents.\\\\n  var downloadDirectory = function downloadDirectory(swarmUrl) {\\\\n    return function (hash) {\\\\n      return downloadEntries(swarmUrl)(hash).then(function (entries) {\\\\n        var paths = Object.keys(entries);\\\\n        var hashs = paths.map(function (path) {\\\\n          return entries[path].hash;\\\\n        });\\\\n        var types = paths.map(function (path) {\\\\n          return entries[path].type;\\\\n        });\\\\n        var datas = hashs.map(downloadData(swarmUrl));\\\\n        var files = function files(datas) {\\\\n          return datas.map(function (data, i) {\\\\n            return { type: types[i], data: data };\\\\n          });\\\\n        };\\\\n        return Promise.all(datas).then(function (datas) {\\\\n          return toMap(paths)(files(datas));\\\\n        });\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> String -> Promise String\\\\n  //   Gets the raw contents of a Swarm hash address.\\\\n  //   Returns a promise with the downloaded file path.\\\\n  var downloadDataToDisk = function downloadDataToDisk(swarmUrl) {\\\\n    return function (hash) {\\\\n      return function (filePath) {\\\\n        return files.download(rawUrl(swarmUrl)(hash))(filePath);\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> String -> Promise (Map String String)\\\\n  //   Gets the entire directory tree in a Swarm address.\\\\n  //   Returns a promise mapping paths to file contents.\\\\n  var downloadDirectoryToDisk = function downloadDirectoryToDisk(swarmUrl) {\\\\n    return function (hash) {\\\\n      return function (dirPath) {\\\\n        return downloadRoutes(swarmUrl)(hash).then(function (routingTable) {\\\\n          var downloads = [];\\\\n          for (var route in routingTable) {\\\\n            if (route.length > 0) {\\\\n              var filePath = path.join(dirPath, route);\\\\n              downloads.push(downloadDataToDisk(swarmUrl)(routingTable[route])(filePath));\\\\n            };\\\\n          };\\\\n          return Promise.all(downloads).then(function () {\\\\n            return dirPath;\\\\n          });\\\\n        });\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> Uint8Array -> Promise String\\\\n  //   Uploads raw data to Swarm.\\\\n  //   Returns a promise with the uploaded hash.\\\\n  var uploadData = function uploadData(swarmUrl) {\\\\n    return function (data) {\\\\n      return request(swarmUrl + \\"/bzzr:/\\", {\\\\n        body: typeof data === \\"string\\" ? fromString(data) : data,\\\\n        method: \\"POST\\" });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> String -> File -> Promise String\\\\n  //   Uploads a file to the Swarm manifest at a given hash, under a specific\\\\n  //   route. Returns a promise containing the uploaded hash.\\\\n  //   FIXME: for some reasons Swarm-Gateways is sometimes returning\\\\n  //   error 404 (bad request), so we retry up to 3 times. Why?\\\\n  var uploadToManifest = function uploadToManifest(swarmUrl) {\\\\n    return function (hash) {\\\\n      return function (route) {\\\\n        return function (file) {\\\\n          var attempt = function attempt(n) {\\\\n            var slashRoute = route[0] === \\"/\\" ? route : \\"/\\" + route;\\\\n            var url = swarmUrl + \\"/bzz:/\\" + hash + slashRoute;\\\\n            var opt = {\\\\n              method: \\"PUT\\",\\\\n              headers: { \\"Content-Type\\": file.type },\\\\n              body: file.data };\\\\n            return request(url, opt).then(function (response) {\\\\n              if (response.indexOf(\\"error\\") !== -1) {\\\\n                throw response;\\\\n              }\\\\n              return response;\\\\n            }).catch(function (e) {\\\\n              return n > 0 && attempt(n - 1);\\\\n            });\\\\n          };\\\\n          return attempt(3);\\\\n        };\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> {type: String, data: Uint8Array} -> Promise String\\\\n  var uploadFile = function uploadFile(swarmUrl) {\\\\n    return function (file) {\\\\n      return uploadDirectory(swarmUrl)({ \\"\\": file });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> Promise String\\\\n  var uploadFileFromDisk = function uploadFileFromDisk(swarmUrl) {\\\\n    return function (filePath) {\\\\n      return fsp.readFile(filePath).then(function (data) {\\\\n        return uploadFile(swarmUrl)({ type: mimetype.lookup(filePath), data: data });\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> Map String File -> Promise String\\\\n  //   Uploads a directory to Swarm. The directory is\\\\n  //   represented as a map of routes and files.\\\\n  //   A default path is encoded by having a \\"\\" route.\\\\n  var uploadDirectory = function uploadDirectory(swarmUrl) {\\\\n    return function (directory) {\\\\n      return uploadData(swarmUrl)(\\"{}\\").then(function (hash) {\\\\n        var uploadRoute = function uploadRoute(route) {\\\\n          return function (hash) {\\\\n            return uploadToManifest(swarmUrl)(hash)(route)(directory[route]);\\\\n          };\\\\n        };\\\\n        var uploadToHash = function uploadToHash(hash, route) {\\\\n          return hash.then(uploadRoute(route));\\\\n        };\\\\n        return Object.keys(directory).reduce(uploadToHash, Promise.resolve(hash));\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // String -> Promise String\\\\n  var uploadDataFromDisk = function uploadDataFromDisk(swarmUrl) {\\\\n    return function (filePath) {\\\\n      return fsp.readFile(filePath).then(uploadData(swarmUrl));\\\\n    };\\\\n  };\\\\n\\\\n  // String -> Nullable String -> String -> Promise String\\\\n  var uploadDirectoryFromDisk = function uploadDirectoryFromDisk(swarmUrl) {\\\\n    return function (defaultPath) {\\\\n      return function (dirPath) {\\\\n        return files.directoryTree(dirPath).then(function (fullPaths) {\\\\n          return Promise.all(fullPaths.map(function (path) {\\\\n            return fsp.readFile(path);\\\\n          })).then(function (datas) {\\\\n            var paths = fullPaths.map(function (path) {\\\\n              return path.slice(dirPath.length);\\\\n            });\\\\n            var types = fullPaths.map(function (path) {\\\\n              return mimetype.lookup(path) || \\"text/plain\\";\\\\n            });\\\\n            return toMap(paths)(datas.map(function (data, i) {\\\\n              return { type: types[i], data: data };\\\\n            }));\\\\n          });\\\\n        }).then(function (directory) {\\\\n          return merge(defaultPath ? { \\"\\": directory[defaultPath] } : {})(directory);\\\\n        }).then(uploadDirectory(swarmUrl));\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> UploadInfo -> Promise String\\\\n  //   Simplified multi-type upload which calls the correct\\\\n  //   one based on the type of the argument given.\\\\n  var _upload = function _upload(swarmUrl) {\\\\n    return function (arg) {\\\\n      // Upload raw data from browser\\\\n      if (arg.pick === \\"data\\") {\\\\n        return pick.data().then(uploadData(swarmUrl));\\\\n\\\\n        // Upload a file from browser\\\\n      } else if (arg.pick === \\"file\\") {\\\\n        return pick.file().then(uploadFile(swarmUrl));\\\\n\\\\n        // Upload a directory from browser\\\\n      } else if (arg.pick === \\"directory\\") {\\\\n        return pick.directory().then(uploadDirectory(swarmUrl));\\\\n\\\\n        // Upload directory/file from disk\\\\n      } else if (arg.path) {\\\\n        switch (arg.kind) {\\\\n          case \\"data\\":\\\\n            return uploadDataFromDisk(swarmUrl)(arg.path);\\\\n          case \\"file\\":\\\\n            return uploadFileFromDisk(swarmUrl)(arg.path);\\\\n          case \\"directory\\":\\\\n            return uploadDirectoryFromDisk(swarmUrl)(arg.defaultFile)(arg.path);\\\\n        };\\\\n\\\\n        // Upload UTF-8 string or raw data (buffer)\\\\n      } else if (arg.length || typeof arg === \\"string\\") {\\\\n        return uploadData(swarmUrl)(arg);\\\\n\\\\n        // Upload directory with JSON\\\\n      } else if (arg instanceof Object) {\\\\n        return uploadDirectory(swarmUrl)(arg);\\\\n      }\\\\n\\\\n      return Promise.reject(new Error(\\"Bad arguments\\"));\\\\n    };\\\\n  };\\\\n\\\\n  // String -> String -> Nullable String -> Promise (String | Uint8Array | Map String Uint8Array)\\\\n  //   Simplified multi-type download which calls the correct function based on\\\\n  //   the type of the argument given, and on whether the Swwarm address has a\\\\n  //   directory or a file.\\\\n  var _download = function _download(swarmUrl) {\\\\n    return function (hash) {\\\\n      return function (path) {\\\\n        return isDirectory(swarmUrl)(hash).then(function (isDir) {\\\\n          if (isDir) {\\\\n            return path ? downloadDirectoryToDisk(swarmUrl)(hash)(path) : downloadDirectory(swarmUrl)(hash);\\\\n          } else {\\\\n            return path ? downloadDataToDisk(swarmUrl)(hash)(path) : downloadData(swarmUrl)(hash);\\\\n          }\\\\n        });\\\\n      };\\\\n    };\\\\n  };\\\\n\\\\n  // String -> Promise String\\\\n  //   Downloads the Swarm binaries into a path. Returns a promise that only\\\\n  //   resolves when the exact Swarm file is there, and verified to be correct.\\\\n  //   If it was already there to begin with, skips the download.\\\\n  var downloadBinary = function downloadBinary(path, archives) {\\\\n    var system = os.platform().replace(\\"win32\\", \\"windows\\") + \\"-\\" + (os.arch() === \\"x64\\" ? \\"amd64\\" : \\"386\\");\\\\n    var archive = (archives || defaultArchives)[system];\\\\n    var archiveUrl = downloadUrl + archive.archive + \\".tar.gz\\";\\\\n    var archiveMD5 = archive.archiveMD5;\\\\n    var binaryMD5 = archive.binaryMD5;\\\\n    return files.safeDownloadArchived(archiveUrl)(archiveMD5)(binaryMD5)(path);\\\\n  };\\\\n\\\\n  // type SwarmSetup = {\\\\n  //   account : String,\\\\n  //   password : String,\\\\n  //   dataDir : String,\\\\n  //   binPath : String,\\\\n  //   ensApi : String,\\\\n  //   onDownloadProgress : Number ~> (),\\\\n  //   archives : [{\\\\n  //     archive: String,\\\\n  //     binaryMD5: String,\\\\n  //     archiveMD5: String\\\\n  //   }]\\\\n  // }\\\\n\\\\n  // SwarmSetup ~> Promise Process\\\\n  //   Starts the Swarm process.\\\\n  var startProcess = function startProcess(swarmSetup) {\\\\n    return new Promise(function (resolve, reject) {\\\\n      var spawn = child_process.spawn;\\\\n\\\\n\\\\n      var hasString = function hasString(str) {\\\\n        return function (buffer) {\\\\n          return (\\\\\'\\\\\' + buffer).indexOf(str) !== -1;\\\\n        };\\\\n      };\\\\n      var account = swarmSetup.account,\\\\n          password = swarmSetup.password,\\\\n          dataDir = swarmSetup.dataDir,\\\\n          ensApi = swarmSetup.ensApi,\\\\n          privateKey = swarmSetup.privateKey;\\\\n\\\\n\\\\n      var STARTUP_TIMEOUT_SECS = 3;\\\\n      var WAITING_PASSWORD = 0;\\\\n      var STARTING = 1;\\\\n      var LISTENING = 2;\\\\n      var PASSWORD_PROMPT_HOOK = \\"Passphrase\\";\\\\n      var LISTENING_HOOK = \\"Swarm http proxy started\\";\\\\n\\\\n      var state = WAITING_PASSWORD;\\\\n\\\\n      var swarmProcess = spawn(swarmSetup.binPath, [\\\\\'--bzzaccount\\\\\', account || privateKey, \\\\\'--datadir\\\\\', dataDir, \\\\\'--ens-api\\\\\', ensApi]);\\\\n\\\\n      var handleProcessOutput = function handleProcessOutput(data) {\\\\n        if (state === WAITING_PASSWORD && hasString(PASSWORD_PROMPT_HOOK)(data)) {\\\\n          setTimeout(function () {\\\\n            state = STARTING;\\\\n            swarmProcess.stdin.write(password + \\\\\'\\\\\\\\n\\\\\');\\\\n          }, 500);\\\\n        } else if (hasString(LISTENING_HOOK)(data)) {\\\\n          state = LISTENING;\\\\n          clearTimeout(timeout);\\\\n          resolve(swarmProcess);\\\\n        }\\\\n      };\\\\n\\\\n      swarmProcess.stdout.on(\\\\\'data\\\\\', handleProcessOutput);\\\\n      swarmProcess.stderr.on(\\\\\'data\\\\\', handleProcessOutput);\\\\n      //swarmProcess.on(\\\\\'close\\\\\', () => setTimeout(restart, 2000));\\\\n\\\\n      var restart = function restart() {\\\\n        return startProcess(swarmSetup).then(resolve).catch(reject);\\\\n      };\\\\n      var error = function error() {\\\\n        return reject(new Error(\\"Couldn\\\\\'t start swarm process.\\"));\\\\n      };\\\\n      var timeout = setTimeout(error, 20000);\\\\n    });\\\\n  };\\\\n\\\\n  // Process ~> Promise ()\\\\n  //   Stops the Swarm process.\\\\n  var stopProcess = function stopProcess(process) {\\\\n    return new Promise(function (resolve, reject) {\\\\n      process.stderr.removeAllListeners(\\\\\'data\\\\\');\\\\n      process.stdout.removeAllListeners(\\\\\'data\\\\\');\\\\n      process.stdin.removeAllListeners(\\\\\'error\\\\\');\\\\n      process.removeAllListeners(\\\\\'error\\\\\');\\\\n      process.removeAllListeners(\\\\\'exit\\\\\');\\\\n      process.kill(\\\\\'SIGINT\\\\\');\\\\n\\\\n      var killTimeout = setTimeout(function () {\\\\n        return process.kill(\\\\\'SIGKILL\\\\\');\\\\n      }, 8000);\\\\n\\\\n      process.once(\\\\\'close\\\\\', function () {\\\\n        clearTimeout(killTimeout);\\\\n        resolve();\\\\n      });\\\\n    });\\\\n  };\\\\n\\\\n  // SwarmSetup -> (SwarmAPI -> Promise ()) -> Promise ()\\\\n  //   Receives a Swarm configuration object and a callback function. It then\\\\n  //   checks if a local Swarm node is running. If no local Swarm is found, it\\\\n  //   downloads the Swarm binaries to the dataDir (if not there), checksums,\\\\n  //   starts the Swarm process and calls the callback function with an API\\\\n  //   object using the local node. That callback must return a promise which\\\\n  //   will resolve when it is done using the API, so that this function can\\\\n  //   close the Swarm process properly. Returns a promise that resolves when the\\\\n  //   user is done with the API and the Swarm process is closed.\\\\n  //   TODO: check if Swarm process is already running (improve `isAvailable`)\\\\n  var local = function local(swarmSetup) {\\\\n    return function (useAPI) {\\\\n      return _isAvailable(\\"http://localhost:8500\\").then(function (isAvailable) {\\\\n        return isAvailable ? useAPI(at(\\"http://localhost:8500\\")).then(function () {}) : downloadBinary(swarmSetup.binPath, swarmSetup.archives).onData(function (data) {\\\\n          return (swarmSetup.onProgress || function () {})(data.length);\\\\n        }).then(function () {\\\\n          return startProcess(swarmSetup);\\\\n        }).then(function (process) {\\\\n          return useAPI(at(\\"http://localhost:8500\\")).then(function () {\\\\n            return process;\\\\n          });\\\\n        }).then(stopProcess);\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // String ~> Promise Bool\\\\n  //   Returns true if Swarm is available on `url`.\\\\n  //   Perfoms a test upload to determine that.\\\\n  //   TODO: improve this?\\\\n  var _isAvailable = function _isAvailable(swarmUrl) {\\\\n    var testFile = \\"test\\";\\\\n    var testHash = \\"c9a99c7d326dcc6316f32fe2625b311f6dc49a175e6877681ded93137d3569e7\\";\\\\n    return uploadData(swarmUrl)(testFile).then(function (hash) {\\\\n      return hash === testHash;\\\\n    }).catch(function () {\\\\n      return false;\\\\n    });\\\\n  };\\\\n\\\\n  // String -> String ~> Promise Bool\\\\n  //   Returns a Promise which is true if that Swarm address is a directory.\\\\n  //   Determines that by checking that it (i) is a JSON, (ii) has a .entries.\\\\n  //   TODO: improve this?\\\\n  var isDirectory = function isDirectory(swarmUrl) {\\\\n    return function (hash) {\\\\n      return downloadData(swarmUrl)(hash).then(function (data) {\\\\n        try {\\\\n          return !!JSON.parse(toString(data)).entries;\\\\n        } catch (e) {\\\\n          return false;\\\\n        }\\\\n      });\\\\n    };\\\\n  };\\\\n\\\\n  // Uncurries a function; used to allow the f(x,y,z) style on exports.\\\\n  var uncurry = function uncurry(f) {\\\\n    return function (a, b, c, d, e) {\\\\n      var p;\\\\n      // Hardcoded because efficiency (`arguments` is very slow).\\\\n      if (typeof a !== \\"undefined\\") p = f(a);\\\\n      if (typeof b !== \\"undefined\\") p = f(b);\\\\n      if (typeof c !== \\"undefined\\") p = f(c);\\\\n      if (typeof d !== \\"undefined\\") p = f(d);\\\\n      if (typeof e !== \\"undefined\\") p = f(e);\\\\n      return p;\\\\n    };\\\\n  };\\\\n\\\\n  // () -> Promise Bool\\\\n  //   Not sure how to mock Swarm to test it properly. Ideas?\\\\n  var test = function test() {\\\\n    return Promise.resolve(true);\\\\n  };\\\\n\\\\n  // Uint8Array -> String\\\\n  var toString = function toString(uint8Array) {\\\\n    return bytes.toString(bytes.fromUint8Array(uint8Array));\\\\n  };\\\\n\\\\n  // String -> Uint8Array\\\\n  var fromString = function fromString(string) {\\\\n    return bytes.toUint8Array(bytes.fromString(string));\\\\n  };\\\\n\\\\n  // String -> SwarmAPI\\\\n  //   Fixes the `swarmUrl`, returning an API where you don\\\\\'t have to pass it.\\\\n  var at = function at(swarmUrl) {\\\\n    return {\\\\n      download: function download(hash, path) {\\\\n        return _download(swarmUrl)(hash)(path);\\\\n      },\\\\n      downloadData: uncurry(downloadData(swarmUrl)),\\\\n      downloadDataToDisk: uncurry(downloadDataToDisk(swarmUrl)),\\\\n      downloadDirectory: uncurry(downloadDirectory(swarmUrl)),\\\\n      downloadDirectoryToDisk: uncurry(downloadDirectoryToDisk(swarmUrl)),\\\\n      downloadEntries: uncurry(downloadEntries(swarmUrl)),\\\\n      downloadRoutes: uncurry(downloadRoutes(swarmUrl)),\\\\n      isAvailable: function isAvailable() {\\\\n        return _isAvailable(swarmUrl);\\\\n      },\\\\n      upload: function upload(arg) {\\\\n        return _upload(swarmUrl)(arg);\\\\n      },\\\\n      uploadData: uncurry(uploadData(swarmUrl)),\\\\n      uploadFile: uncurry(uploadFile(swarmUrl)),\\\\n      uploadFileFromDisk: uncurry(uploadFile(swarmUrl)),\\\\n      uploadDataFromDisk: uncurry(uploadDataFromDisk(swarmUrl)),\\\\n      uploadDirectory: uncurry(uploadDirectory(swarmUrl)),\\\\n      uploadDirectoryFromDisk: uncurry(uploadDirectoryFromDisk(swarmUrl)),\\\\n      uploadToManifest: uncurry(uploadToManifest(swarmUrl)),\\\\n      pick: pick,\\\\n      hash: hash,\\\\n      fromString: fromString,\\\\n      toString: toString\\\\n    };\\\\n  };\\\\n\\\\n  return {\\\\n    at: at,\\\\n    local: local,\\\\n    download: _download,\\\\n    downloadBinary: downloadBinary,\\\\n    downloadData: downloadData,\\\\n    downloadDataToDisk: downloadDataToDisk,\\\\n    downloadDirectory: downloadDirectory,\\\\n    downloadDirectoryToDisk: downloadDirectoryToDisk,\\\\n    downloadEntries: downloadEntries,\\\\n    downloadRoutes: downloadRoutes,\\\\n    isAvailable: _isAvailable,\\\\n    startProcess: startProcess,\\\\n    stopProcess: stopProcess,\\\\n    upload: _upload,\\\\n    uploadData: uploadData,\\\\n    uploadDataFromDisk: uploadDataFromDisk,\\\\n    uploadFile: uploadFile,\\\\n    uploadFileFromDisk: uploadFileFromDisk,\\\\n    uploadDirectory: uploadDirectory,\\\\n    uploadDirectoryFromDisk: uploadDirectoryFromDisk,\\\\n    uploadToManifest: uploadToManifest,\\\\n    pick: pick,\\\\n    hash: hash,\\\\n    fromString: fromString,\\\\n    toString: toString\\\\n  };\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/swarm-js/lib/swarm.js\\\\n// module id = 328\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/swarm-js/lib/swarm.js\')},function(module,exports){eval(\\"\\\\nexports = module.exports = trim;\\\\n\\\\nfunction trim(str){\\\\n  return str.replace(/^\\\\\\\\s*|\\\\\\\\s*$/g, \'\');\\\\n}\\\\n\\\\nexports.left = function(str){\\\\n  return str.replace(/^\\\\\\\\s*/, \'\');\\\\n};\\\\n\\\\nexports.right = function(str){\\\\n  return str.replace(/\\\\\\\\s*$/, \'\');\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/trim/index.js\\\\n// module id = 329\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/trim/index.js\\")},function(module,exports){eval(\\"module.exports = urlSetQuery\\\\nfunction urlSetQuery (url, query) {\\\\n  if (query) {\\\\n    // remove optional leading symbols\\\\n    query = query.trim().replace(/^(\\\\\\\\?|#|&)/, \'\')\\\\n\\\\n    // don\'t append empty query\\\\n    query = query ? (\'?\' + query) : query\\\\n\\\\n    var parts = url.split(/[\\\\\\\\?\\\\\\\\#]/)\\\\n    var start = parts[0]\\\\n    if (query && /\\\\\\\\:\\\\\\\\/\\\\\\\\/[^\\\\\\\\/]*$/.test(start)) {\\\\n      // e.g. http://foo.com -> http://foo.com/\\\\n      start = start + \'/\'\\\\n    }\\\\n    var match = url.match(/(\\\\\\\\#.*)$/)\\\\n    url = start + query\\\\n    if (match) { // add hash back in\\\\n      url = url + match[0]\\\\n    }\\\\n  }\\\\n  return url\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/url-set-query/index.js\\\\n// module id = 330\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/url-set-query/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/utf8js v2.0.0 by @mathias */\\\\n;(function(root) {\\\\n\\\\n\\\\t// Detect free variables `exports`\\\\n\\\\tvar freeExports = typeof exports == \'object\' && exports;\\\\n\\\\n\\\\t// Detect free variable `module`\\\\n\\\\tvar freeModule = typeof module == \'object\' && module &&\\\\n\\\\t\\\\tmodule.exports == freeExports && module;\\\\n\\\\n\\\\t// Detect free variable `global`, from Node.js or Browserified code,\\\\n\\\\t// and use it as `root`\\\\n\\\\tvar freeGlobal = typeof global == \'object\' && global;\\\\n\\\\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\\\\n\\\\t\\\\troot = freeGlobal;\\\\n\\\\t}\\\\n\\\\n\\\\t/*--------------------------------------------------------------------------*/\\\\n\\\\n\\\\tvar stringFromCharCode = String.fromCharCode;\\\\n\\\\n\\\\t// Taken from https://mths.be/punycode\\\\n\\\\tfunction ucs2decode(string) {\\\\n\\\\t\\\\tvar output = [];\\\\n\\\\t\\\\tvar counter = 0;\\\\n\\\\t\\\\tvar length = string.length;\\\\n\\\\t\\\\tvar value;\\\\n\\\\t\\\\tvar extra;\\\\n\\\\t\\\\twhile (counter < length) {\\\\n\\\\t\\\\t\\\\tvalue = string.charCodeAt(counter++);\\\\n\\\\t\\\\t\\\\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\\\\n\\\\t\\\\t\\\\t\\\\t// high surrogate, and there is a next character\\\\n\\\\t\\\\t\\\\t\\\\textra = string.charCodeAt(counter++);\\\\n\\\\t\\\\t\\\\t\\\\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\\\\n\\\\t\\\\t\\\\t\\\\t\\\\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\\\\n\\\\t\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// unmatched surrogate; only append this code unit, in case the next\\\\n\\\\t\\\\t\\\\t\\\\t\\\\t// code unit is the high surrogate of a surrogate pair\\\\n\\\\t\\\\t\\\\t\\\\t\\\\toutput.push(value);\\\\n\\\\t\\\\t\\\\t\\\\t\\\\tcounter--;\\\\n\\\\t\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\toutput.push(value);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\treturn output;\\\\n\\\\t}\\\\n\\\\n\\\\t// Taken from https://mths.be/punycode\\\\n\\\\tfunction ucs2encode(array) {\\\\n\\\\t\\\\tvar length = array.length;\\\\n\\\\t\\\\tvar index = -1;\\\\n\\\\t\\\\tvar value;\\\\n\\\\t\\\\tvar output = \'\';\\\\n\\\\t\\\\twhile (++index < length) {\\\\n\\\\t\\\\t\\\\tvalue = array[index];\\\\n\\\\t\\\\t\\\\tif (value > 0xFFFF) {\\\\n\\\\t\\\\t\\\\t\\\\tvalue -= 0x10000;\\\\n\\\\t\\\\t\\\\t\\\\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\\\\n\\\\t\\\\t\\\\t\\\\tvalue = 0xDC00 | value & 0x3FF;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t\\\\toutput += stringFromCharCode(value);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\treturn output;\\\\n\\\\t}\\\\n\\\\n\\\\tfunction checkScalarValue(codePoint) {\\\\n\\\\t\\\\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\\\\n\\\\t\\\\t\\\\tthrow Error(\\\\n\\\\t\\\\t\\\\t\\\\t\'Lone surrogate U+\' + codePoint.toString(16).toUpperCase() +\\\\n\\\\t\\\\t\\\\t\\\\t\' is not a scalar value\'\\\\n\\\\t\\\\t\\\\t);\\\\n\\\\t\\\\t}\\\\n\\\\t}\\\\n\\\\t/*--------------------------------------------------------------------------*/\\\\n\\\\n\\\\tfunction createByte(codePoint, shift) {\\\\n\\\\t\\\\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\\\\n\\\\t}\\\\n\\\\n\\\\tfunction encodeCodePoint(codePoint) {\\\\n\\\\t\\\\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\\\\n\\\\t\\\\t\\\\treturn stringFromCharCode(codePoint);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tvar symbol = \'\';\\\\n\\\\t\\\\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\\\\n\\\\t\\\\t\\\\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\\\\n\\\\t\\\\t\\\\tcheckScalarValue(codePoint);\\\\n\\\\t\\\\t\\\\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\\\\n\\\\t\\\\t\\\\tsymbol += createByte(codePoint, 6);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\\\\n\\\\t\\\\t\\\\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\\\\n\\\\t\\\\t\\\\tsymbol += createByte(codePoint, 12);\\\\n\\\\t\\\\t\\\\tsymbol += createByte(codePoint, 6);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\\\\n\\\\t\\\\treturn symbol;\\\\n\\\\t}\\\\n\\\\n\\\\tfunction utf8encode(string) {\\\\n\\\\t\\\\tvar codePoints = ucs2decode(string);\\\\n\\\\t\\\\tvar length = codePoints.length;\\\\n\\\\t\\\\tvar index = -1;\\\\n\\\\t\\\\tvar codePoint;\\\\n\\\\t\\\\tvar byteString = \'\';\\\\n\\\\t\\\\twhile (++index < length) {\\\\n\\\\t\\\\t\\\\tcodePoint = codePoints[index];\\\\n\\\\t\\\\t\\\\tbyteString += encodeCodePoint(codePoint);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\treturn byteString;\\\\n\\\\t}\\\\n\\\\n\\\\t/*--------------------------------------------------------------------------*/\\\\n\\\\n\\\\tfunction readContinuationByte() {\\\\n\\\\t\\\\tif (byteIndex >= byteCount) {\\\\n\\\\t\\\\t\\\\tthrow Error(\'Invalid byte index\');\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tvar continuationByte = byteArray[byteIndex] & 0xFF;\\\\n\\\\t\\\\tbyteIndex++;\\\\n\\\\n\\\\t\\\\tif ((continuationByte & 0xC0) == 0x80) {\\\\n\\\\t\\\\t\\\\treturn continuationByte & 0x3F;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// If we end up here, it’s not a continuation byte\\\\n\\\\t\\\\tthrow Error(\'Invalid continuation byte\');\\\\n\\\\t}\\\\n\\\\n\\\\tfunction decodeSymbol() {\\\\n\\\\t\\\\tvar byte1;\\\\n\\\\t\\\\tvar byte2;\\\\n\\\\t\\\\tvar byte3;\\\\n\\\\t\\\\tvar byte4;\\\\n\\\\t\\\\tvar codePoint;\\\\n\\\\n\\\\t\\\\tif (byteIndex > byteCount) {\\\\n\\\\t\\\\t\\\\tthrow Error(\'Invalid byte index\');\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tif (byteIndex == byteCount) {\\\\n\\\\t\\\\t\\\\treturn false;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// Read first byte\\\\n\\\\t\\\\tbyte1 = byteArray[byteIndex] & 0xFF;\\\\n\\\\t\\\\tbyteIndex++;\\\\n\\\\n\\\\t\\\\t// 1-byte sequence (no continuation bytes)\\\\n\\\\t\\\\tif ((byte1 & 0x80) == 0) {\\\\n\\\\t\\\\t\\\\treturn byte1;\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// 2-byte sequence\\\\n\\\\t\\\\tif ((byte1 & 0xE0) == 0xC0) {\\\\n\\\\t\\\\t\\\\tvar byte2 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\\\\n\\\\t\\\\t\\\\tif (codePoint >= 0x80) {\\\\n\\\\t\\\\t\\\\t\\\\treturn codePoint;\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tthrow Error(\'Invalid continuation byte\');\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// 3-byte sequence (may include unpaired surrogates)\\\\n\\\\t\\\\tif ((byte1 & 0xF0) == 0xE0) {\\\\n\\\\t\\\\t\\\\tbyte2 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tbyte3 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\\\\n\\\\t\\\\t\\\\tif (codePoint >= 0x0800) {\\\\n\\\\t\\\\t\\\\t\\\\tcheckScalarValue(codePoint);\\\\n\\\\t\\\\t\\\\t\\\\treturn codePoint;\\\\n\\\\t\\\\t\\\\t} else {\\\\n\\\\t\\\\t\\\\t\\\\tthrow Error(\'Invalid continuation byte\');\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\t// 4-byte sequence\\\\n\\\\t\\\\tif ((byte1 & 0xF8) == 0xF0) {\\\\n\\\\t\\\\t\\\\tbyte2 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tbyte3 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tbyte4 = readContinuationByte();\\\\n\\\\t\\\\t\\\\tcodePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |\\\\n\\\\t\\\\t\\\\t\\\\t(byte3 << 0x06) | byte4;\\\\n\\\\t\\\\t\\\\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\\\\n\\\\t\\\\t\\\\t\\\\treturn codePoint;\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\n\\\\t\\\\tthrow Error(\'Invalid UTF-8 detected\');\\\\n\\\\t}\\\\n\\\\n\\\\tvar byteArray;\\\\n\\\\tvar byteCount;\\\\n\\\\tvar byteIndex;\\\\n\\\\tfunction utf8decode(byteString) {\\\\n\\\\t\\\\tbyteArray = ucs2decode(byteString);\\\\n\\\\t\\\\tbyteCount = byteArray.length;\\\\n\\\\t\\\\tbyteIndex = 0;\\\\n\\\\t\\\\tvar codePoints = [];\\\\n\\\\t\\\\tvar tmp;\\\\n\\\\t\\\\twhile ((tmp = decodeSymbol()) !== false) {\\\\n\\\\t\\\\t\\\\tcodePoints.push(tmp);\\\\n\\\\t\\\\t}\\\\n\\\\t\\\\treturn ucs2encode(codePoints);\\\\n\\\\t}\\\\n\\\\n\\\\t/*--------------------------------------------------------------------------*/\\\\n\\\\n\\\\tvar utf8 = {\\\\n\\\\t\\\\t\'version\': \'2.0.0\',\\\\n\\\\t\\\\t\'encode\': utf8encode,\\\\n\\\\t\\\\t\'decode\': utf8decode\\\\n\\\\t};\\\\n\\\\n\\\\t// Some AMD build optimizers, like r.js, check for specific condition patterns\\\\n\\\\t// like the following:\\\\n\\\\tif (\\\\n\\\\t\\\\ttrue\\\\n\\\\t) {\\\\n\\\\t\\\\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\\\\n\\\\t\\\\t\\\\treturn utf8;\\\\n\\\\t\\\\t}.call(exports, __webpack_require__, exports, module),\\\\n\\\\t\\\\t\\\\t\\\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\\\n\\\\t}\\\\telse if (freeExports && !freeExports.nodeType) {\\\\n\\\\t\\\\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\\\\n\\\\t\\\\t\\\\tfreeModule.exports = utf8;\\\\n\\\\t\\\\t} else { // in Narwhal or RingoJS v0.7.0-\\\\n\\\\t\\\\t\\\\tvar object = {};\\\\n\\\\t\\\\t\\\\tvar hasOwnProperty = object.hasOwnProperty;\\\\n\\\\t\\\\t\\\\tfor (var key in utf8) {\\\\n\\\\t\\\\t\\\\t\\\\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\\\\n\\\\t\\\\t\\\\t}\\\\n\\\\t\\\\t}\\\\n\\\\t} else { // in Rhino or a web browser\\\\n\\\\t\\\\troot.utf8 = utf8;\\\\n\\\\t}\\\\n\\\\n}(this));\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module), __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/utf8/utf8.js\\\\n// module id = 331\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/utf8/utf8.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(global) {\\\\n/**\\\\n * Module exports.\\\\n */\\\\n\\\\nmodule.exports = deprecate;\\\\n\\\\n/**\\\\n * Mark that a method should not be used.\\\\n * Returns a modified function which warns once by default.\\\\n *\\\\n * If `localStorage.noDeprecation = true` is set, then it is a no-op.\\\\n *\\\\n * If `localStorage.throwDeprecation = true` is set, then deprecated functions\\\\n * will throw an Error when invoked.\\\\n *\\\\n * If `localStorage.traceDeprecation = true` is set, then deprecated functions\\\\n * will invoke `console.trace()` instead of `console.error()`.\\\\n *\\\\n * @param {Function} fn - the function to deprecate\\\\n * @param {String} msg - the string to print to the console when `fn` is invoked\\\\n * @returns {Function} a new \\\\\\"deprecated\\\\\\" version of `fn`\\\\n * @api public\\\\n */\\\\n\\\\nfunction deprecate (fn, msg) {\\\\n  if (config(\'noDeprecation\')) {\\\\n    return fn;\\\\n  }\\\\n\\\\n  var warned = false;\\\\n  function deprecated() {\\\\n    if (!warned) {\\\\n      if (config(\'throwDeprecation\')) {\\\\n        throw new Error(msg);\\\\n      } else if (config(\'traceDeprecation\')) {\\\\n        console.trace(msg);\\\\n      } else {\\\\n        console.warn(msg);\\\\n      }\\\\n      warned = true;\\\\n    }\\\\n    return fn.apply(this, arguments);\\\\n  }\\\\n\\\\n  return deprecated;\\\\n}\\\\n\\\\n/**\\\\n * Checks `localStorage` for boolean values for the given `name`.\\\\n *\\\\n * @param {String} name\\\\n * @returns {Boolean}\\\\n * @api private\\\\n */\\\\n\\\\nfunction config (name) {\\\\n  // accessing global.localStorage can trigger a DOMException in sandboxed iframes\\\\n  try {\\\\n    if (!global.localStorage) return false;\\\\n  } catch (_) {\\\\n    return false;\\\\n  }\\\\n  var val = global.localStorage[name];\\\\n  if (null == val) return false;\\\\n  return String(val).toLowerCase() === \'true\';\\\\n}\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/util-deprecate/browser.js\\\\n// module id = 332\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/util-deprecate/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"var indexOf = __webpack_require__(278);\\\\n\\\\nvar Object_keys = function (obj) {\\\\n    if (Object.keys) return Object.keys(obj)\\\\n    else {\\\\n        var res = [];\\\\n        for (var key in obj) res.push(key)\\\\n        return res;\\\\n    }\\\\n};\\\\n\\\\nvar forEach = function (xs, fn) {\\\\n    if (xs.forEach) return xs.forEach(fn)\\\\n    else for (var i = 0; i < xs.length; i++) {\\\\n        fn(xs[i], i, xs);\\\\n    }\\\\n};\\\\n\\\\nvar defineProp = (function() {\\\\n    try {\\\\n        Object.defineProperty({}, \'_\', {});\\\\n        return function(obj, name, value) {\\\\n            Object.defineProperty(obj, name, {\\\\n                writable: true,\\\\n                enumerable: false,\\\\n                configurable: true,\\\\n                value: value\\\\n            })\\\\n        };\\\\n    } catch(e) {\\\\n        return function(obj, name, value) {\\\\n            obj[name] = value;\\\\n        };\\\\n    }\\\\n}());\\\\n\\\\nvar globals = [\'Array\', \'Boolean\', \'Date\', \'Error\', \'EvalError\', \'Function\',\\\\n\'Infinity\', \'JSON\', \'Math\', \'NaN\', \'Number\', \'Object\', \'RangeError\',\\\\n\'ReferenceError\', \'RegExp\', \'String\', \'SyntaxError\', \'TypeError\', \'URIError\',\\\\n\'decodeURI\', \'decodeURIComponent\', \'encodeURI\', \'encodeURIComponent\', \'escape\',\\\\n\'eval\', \'isFinite\', \'isNaN\', \'parseFloat\', \'parseInt\', \'undefined\', \'unescape\'];\\\\n\\\\nfunction Context() {}\\\\nContext.prototype = {};\\\\n\\\\nvar Script = exports.Script = function NodeScript (code) {\\\\n    if (!(this instanceof Script)) return new Script(code);\\\\n    this.code = code;\\\\n};\\\\n\\\\nScript.prototype.runInContext = function (context) {\\\\n    if (!(context instanceof Context)) {\\\\n        throw new TypeError(\\\\\\"needs a \'context\' argument.\\\\\\");\\\\n    }\\\\n    \\\\n    var iframe = document.createElement(\'iframe\');\\\\n    if (!iframe.style) iframe.style = {};\\\\n    iframe.style.display = \'none\';\\\\n    \\\\n    document.body.appendChild(iframe);\\\\n    \\\\n    var win = iframe.contentWindow;\\\\n    var wEval = win.eval, wExecScript = win.execScript;\\\\n\\\\n    if (!wEval && wExecScript) {\\\\n        // win.eval() magically appears when this is called in IE:\\\\n        wExecScript.call(win, \'null\');\\\\n        wEval = win.eval;\\\\n    }\\\\n    \\\\n    forEach(Object_keys(context), function (key) {\\\\n        win[key] = context[key];\\\\n    });\\\\n    forEach(globals, function (key) {\\\\n        if (context[key]) {\\\\n            win[key] = context[key];\\\\n        }\\\\n    });\\\\n    \\\\n    var winKeys = Object_keys(win);\\\\n\\\\n    var res = wEval.call(win, this.code);\\\\n    \\\\n    forEach(Object_keys(win), function (key) {\\\\n        // Avoid copying circular objects like `top` and `window` by only\\\\n        // updating existing context properties or new properties in the `win`\\\\n        // that was only introduced after the eval.\\\\n        if (key in context || indexOf(winKeys, key) === -1) {\\\\n            context[key] = win[key];\\\\n        }\\\\n    });\\\\n\\\\n    forEach(globals, function (key) {\\\\n        if (!(key in context)) {\\\\n            defineProp(context, key, win[key]);\\\\n        }\\\\n    });\\\\n    \\\\n    document.body.removeChild(iframe);\\\\n    \\\\n    return res;\\\\n};\\\\n\\\\nScript.prototype.runInThisContext = function () {\\\\n    return eval(this.code); // maybe...\\\\n};\\\\n\\\\nScript.prototype.runInNewContext = function (context) {\\\\n    var ctx = Script.createContext(context);\\\\n    var res = this.runInContext(ctx);\\\\n\\\\n    forEach(Object_keys(ctx), function (key) {\\\\n        context[key] = ctx[key];\\\\n    });\\\\n\\\\n    return res;\\\\n};\\\\n\\\\nforEach(Object_keys(Script.prototype), function (name) {\\\\n    exports[name] = Script[name] = function (code) {\\\\n        var s = Script(code);\\\\n        return s[name].apply(s, [].slice.call(arguments, 1));\\\\n    };\\\\n});\\\\n\\\\nexports.createScript = function (code) {\\\\n    return exports.Script(code);\\\\n};\\\\n\\\\nexports.createContext = Script.createContext = function (context) {\\\\n    var copy = new Context();\\\\n    if(typeof context === \'object\') {\\\\n        forEach(Object_keys(context), function (key) {\\\\n            copy[key] = context[key];\\\\n        });\\\\n    }\\\\n    return copy;\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/vm-browserify/index.js\\\\n// module id = 333\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/vm-browserify/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar swarm = __webpack_require__(325);\\\\n\\\\n\\\\nvar Bzz = function Bzz(provider) {\\\\n\\\\n    this.givenProvider = Bzz.givenProvider;\\\\n\\\\n    if (provider && provider._requestManager) {\\\\n        provider = provider.currentProvider;\\\\n    }\\\\n\\\\n    // only allow file picker when in browser\\\\n    if(typeof document !== \'undefined\') {\\\\n        this.pick = swarm.pick;\\\\n    }\\\\n\\\\n    this.setProvider(provider);\\\\n};\\\\n\\\\n// set default ethereum provider\\\\n/* jshint ignore:start */\\\\nBzz.givenProvider = null;\\\\nif(typeof ethereumProvider !== \'undefined\' && ethereumProvider.bzz) {\\\\n    Bzz.givenProvider = ethereumProvider.bzz;\\\\n}\\\\n/* jshint ignore:end */\\\\n\\\\nBzz.prototype.setProvider = function(provider) {\\\\n    // is ethereum provider\\\\n    if(_.isObject(provider) && _.isString(provider.bzz)) {\\\\n        provider = provider.bzz;\\\\n    // is no string, set default\\\\n    }\\\\n    // else if(!_.isString(provider)) {\\\\n    //      provider = \'http://swarm-gateways.net\'; // default to gateway\\\\n    // }\\\\n\\\\n\\\\n    if(_.isString(provider)) {\\\\n        this.currentProvider = provider;\\\\n    } else {\\\\n        this.currentProvider = null;\\\\n\\\\n        var noProviderError = new Error(\'No provider set, please set one using bzz.setProvider().\');\\\\n\\\\n        this.download = this.upload = this.isAvailable = function(){\\\\n            throw noProviderError;\\\\n        };\\\\n\\\\n        return false;\\\\n    }\\\\n\\\\n    // add functions\\\\n    this.download = swarm.at(provider).download;\\\\n    this.upload = swarm.at(provider).upload;\\\\n    this.isAvailable = swarm.at(provider).isAvailable;\\\\n\\\\n    return true;\\\\n};\\\\n\\\\n\\\\nmodule.exports = Bzz;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-bzz/src/index.js\\\\n// module id = 334\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-bzz/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file errors.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nmodule.exports = {\\\\n    ErrorResponse: function (result) {\\\\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : JSON.stringify(result);\\\\n        return new Error(\'Returned error: \' + message);\\\\n    },\\\\n    InvalidNumberOfParams: function (got, expected, method) {\\\\n        return new Error(\'Invalid number of parameters for \\\\\\"\'+ method +\'\\\\\\". Got \'+ got +\' expected \'+ expected +\'!\');\\\\n    },\\\\n    InvalidConnection: function (host){\\\\n        return new Error(\'CONNECTION ERROR: Couldn\\\\\\\\\'t connect to node \'+ host +\'.\');\\\\n    },\\\\n    InvalidProvider: function () {\\\\n        return new Error(\'Provider not set or invalid\');\\\\n    },\\\\n    InvalidResponse: function (result){\\\\n        var message = !!result && !!result.error && !!result.error.message ? result.error.message : \'Invalid JSON RPC response: \' + JSON.stringify(result);\\\\n        return new Error(message);\\\\n    },\\\\n    ConnectionTimeout: function (ms){\\\\n        return new Error(\'CONNECTION TIMEOUT: timeout of \' + ms + \' ms achived\');\\\\n    }\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-helpers/src/errors.js\\\\n// module id = 335\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-helpers/src/errors.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file formatters.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @author Marek Kotewicz <marek@parity.io>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar utils = __webpack_require__(10);\\\\nvar Iban = __webpack_require__(162);\\\\n\\\\n/**\\\\n * Should the format output to a big number\\\\n *\\\\n * @method outputBigNumberFormatter\\\\n * @param {String|Number|BigNumber} number\\\\n * @returns {BigNumber} object\\\\n */\\\\nvar outputBigNumberFormatter = function (number) {\\\\n    return utils.toBN(number).toString(10);\\\\n};\\\\n\\\\nvar isPredefinedBlockNumber = function (blockNumber) {\\\\n    return blockNumber === \'latest\' || blockNumber === \'pending\' || blockNumber === \'earliest\';\\\\n};\\\\n\\\\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\\\\n    if (this && (blockNumber === undefined || blockNumber === null)) {\\\\n        return this.defaultBlock;\\\\n    }\\\\n    if (blockNumber === \'genesis\' || blockNumber === \'earliest\') {\\\\n        return \'0x0\';\\\\n    }\\\\n    return inputBlockNumberFormatter(blockNumber);\\\\n};\\\\n\\\\nvar inputBlockNumberFormatter = function (blockNumber) {\\\\n    if (blockNumber === undefined) {\\\\n        return undefined;\\\\n    } else if (isPredefinedBlockNumber(blockNumber)) {\\\\n        return blockNumber;\\\\n    }\\\\n    return (utils.isHexStrict(blockNumber)) ? ((_.isString(blockNumber)) ? blockNumber.toLowerCase() : blockNumber) : utils.numberToHex(blockNumber);\\\\n};\\\\n\\\\n/**\\\\n * Formats the input of a transaction and converts all values to HEX\\\\n *\\\\n * @method _txInputFormatter\\\\n * @param {Object} transaction options\\\\n * @returns object\\\\n */\\\\nvar _txInputFormatter = function (options){\\\\n\\\\n    if (options.to) { // it might be contract creation\\\\n        options.to = inputAddressFormatter(options.to);\\\\n    }\\\\n\\\\n    if (options.data && options.input) {\\\\n        throw new Error(\'You can\\\\\\\\\'t have \\\\\\"data\\\\\\" and \\\\\\"input\\\\\\" as properties of transactions at the same time, please use either \\\\\\"data\\\\\\" or \\\\\\"input\\\\\\" instead.\');\\\\n    }\\\\n\\\\n    if (!options.data && options.input) {\\\\n        options.data = options.input;\\\\n        delete options.input;\\\\n    }\\\\n\\\\n    if(options.data && !utils.isHex(options.data)) {\\\\n        throw new Error(\'The data field must be HEX encoded data.\');\\\\n    }\\\\n\\\\n    // allow both\\\\n    if (options.gas || options.gasLimit) {\\\\n        options.gas = options.gas || options.gasLimit;\\\\n    }\\\\n\\\\n    [\'gasPrice\', \'gas\', \'value\', \'nonce\'].filter(function (key) {\\\\n        return options[key] !== undefined;\\\\n    }).forEach(function(key){\\\\n        options[key] = utils.numberToHex(options[key]);\\\\n    });\\\\n\\\\n    return options;\\\\n};\\\\n\\\\n/**\\\\n * Formats the input of a transaction and converts all values to HEX\\\\n *\\\\n * @method inputCallFormatter\\\\n * @param {Object} transaction options\\\\n * @returns object\\\\n*/\\\\nvar inputCallFormatter = function (options){\\\\n\\\\n    options = _txInputFormatter(options);\\\\n\\\\n    var from = options.from || (this ? this.defaultAccount : null);\\\\n\\\\n    if (from) {\\\\n        options.from = inputAddressFormatter(from);\\\\n    }\\\\n\\\\n\\\\n    return options;\\\\n};\\\\n\\\\n/**\\\\n * Formats the input of a transaction and converts all values to HEX\\\\n *\\\\n * @method inputTransactionFormatter\\\\n * @param {Object} options\\\\n * @returns object\\\\n*/\\\\nvar inputTransactionFormatter = function (options) {\\\\n\\\\n    options = _txInputFormatter(options);\\\\n\\\\n    // check from, only if not number, or object\\\\n    if (!_.isNumber(options.from) && !_.isObject(options.from)) {\\\\n        options.from = options.from || (this ? this.defaultAccount : null);\\\\n\\\\n        if (!options.from && !_.isNumber(options.from)) {\\\\n            throw new Error(\'The send transactions \\\\\\"from\\\\\\" field must be defined!\');\\\\n        }\\\\n\\\\n        options.from = inputAddressFormatter(options.from);\\\\n    }\\\\n\\\\n    return options;\\\\n};\\\\n\\\\n/**\\\\n * Hex encodes the data passed to eth_sign and personal_sign\\\\n *\\\\n * @method inputSignFormatter\\\\n * @param {String} data\\\\n * @returns {String}\\\\n */\\\\nvar inputSignFormatter = function (data) {\\\\n    return (utils.isHexStrict(data)) ? data : utils.utf8ToHex(data);\\\\n};\\\\n\\\\n/**\\\\n * Formats the output of a transaction to its proper values\\\\n *\\\\n * @method outputTransactionFormatter\\\\n * @param {Object} tx\\\\n * @returns {Object}\\\\n*/\\\\nvar outputTransactionFormatter = function (tx){\\\\n    if(tx.blockNumber !== null)\\\\n        tx.blockNumber = utils.hexToNumber(tx.blockNumber);\\\\n    if(tx.transactionIndex !== null)\\\\n        tx.transactionIndex = utils.hexToNumber(tx.transactionIndex);\\\\n    tx.nonce = utils.hexToNumber(tx.nonce);\\\\n    tx.gas = utils.hexToNumber(tx.gas);\\\\n    tx.gasPrice = outputBigNumberFormatter(tx.gasPrice);\\\\n    tx.value = outputBigNumberFormatter(tx.value);\\\\n\\\\n    if(tx.to && utils.isAddress(tx.to)) { // tx.to could be `0x0` or `null` while contract creation\\\\n        tx.to = utils.toChecksumAddress(tx.to);\\\\n    } else {\\\\n        tx.to = null; // set to `null` if invalid address\\\\n    }\\\\n\\\\n    if(tx.from) {\\\\n        tx.from = utils.toChecksumAddress(tx.from);\\\\n    }\\\\n\\\\n    return tx;\\\\n};\\\\n\\\\n/**\\\\n * Formats the output of a transaction receipt to its proper values\\\\n *\\\\n * @method outputTransactionReceiptFormatter\\\\n * @param {Object} receipt\\\\n * @returns {Object}\\\\n*/\\\\nvar outputTransactionReceiptFormatter = function (receipt){\\\\n    if(typeof receipt !== \'object\') {\\\\n        throw new Error(\'Received receipt is invalid: \'+ receipt);\\\\n    }\\\\n\\\\n    if(receipt.blockNumber !== null)\\\\n        receipt.blockNumber = utils.hexToNumber(receipt.blockNumber);\\\\n    if(receipt.transactionIndex !== null)\\\\n        receipt.transactionIndex = utils.hexToNumber(receipt.transactionIndex);\\\\n    receipt.cumulativeGasUsed = utils.hexToNumber(receipt.cumulativeGasUsed);\\\\n    receipt.gasUsed = utils.hexToNumber(receipt.gasUsed);\\\\n\\\\n    if(_.isArray(receipt.logs)) {\\\\n        receipt.logs = receipt.logs.map(outputLogFormatter);\\\\n    }\\\\n\\\\n    if(receipt.contractAddress) {\\\\n        receipt.contractAddress = utils.toChecksumAddress(receipt.contractAddress);\\\\n    }\\\\n\\\\n    return receipt;\\\\n};\\\\n\\\\n/**\\\\n * Formats the output of a block to its proper values\\\\n *\\\\n * @method outputBlockFormatter\\\\n * @param {Object} block\\\\n * @returns {Object}\\\\n*/\\\\nvar outputBlockFormatter = function(block) {\\\\n\\\\n    // transform to number\\\\n    block.gasLimit = utils.hexToNumber(block.gasLimit);\\\\n    block.gasUsed = utils.hexToNumber(block.gasUsed);\\\\n    block.size = utils.hexToNumber(block.size);\\\\n    block.timestamp = utils.hexToNumber(block.timestamp);\\\\n    if (block.number !== null)\\\\n        block.number = utils.hexToNumber(block.number);\\\\n\\\\n    if(block.difficulty)\\\\n        block.difficulty = outputBigNumberFormatter(block.difficulty);\\\\n    if(block.totalDifficulty)\\\\n        block.totalDifficulty = outputBigNumberFormatter(block.totalDifficulty);\\\\n\\\\n    if (_.isArray(block.transactions)) {\\\\n        block.transactions.forEach(function(item){\\\\n            if(!_.isString(item))\\\\n                return outputTransactionFormatter(item);\\\\n        });\\\\n    }\\\\n\\\\n    if (block.miner)\\\\n        block.miner = utils.toChecksumAddress(block.miner);\\\\n\\\\n    return block;\\\\n};\\\\n\\\\n/**\\\\n * Formats the input of a log\\\\n *\\\\n * @method inputLogFormatter\\\\n * @param {Object} log object\\\\n * @returns {Object} log\\\\n*/\\\\nvar inputLogFormatter = function(options) {\\\\n    var toTopic = function(value){\\\\n\\\\n        if(value === null || typeof value === \'undefined\')\\\\n            return null;\\\\n\\\\n        value = String(value);\\\\n\\\\n        if(value.indexOf(\'0x\') === 0)\\\\n            return value;\\\\n        else\\\\n            return utils.fromUtf8(value);\\\\n    };\\\\n\\\\n    // make sure topics, get converted to hex\\\\n    options.topics = options.topics || [];\\\\n    options.topics = options.topics.map(function(topic){\\\\n        return (_.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\\\\n    });\\\\n\\\\n    toTopic = null;\\\\n\\\\n    if (options.address) {\\\\n        options.address = (_.isArray(options.address)) ? options.address.map(function (addr) {\\\\n            return inputAddressFormatter(addr);\\\\n        }) : inputAddressFormatter(options.address);\\\\n    }\\\\n\\\\n    return options;\\\\n};\\\\n\\\\n/**\\\\n * Formats the output of a log\\\\n *\\\\n * @method outputLogFormatter\\\\n * @param {Object} log object\\\\n * @returns {Object} log\\\\n*/\\\\nvar outputLogFormatter = function(log) {\\\\n\\\\n    // generate a custom log id\\\\n    if(typeof log.blockHash === \'string\' &&\\\\n       typeof log.transactionHash === \'string\' &&\\\\n       typeof log.logIndex === \'string\') {\\\\n        var shaId = utils.sha3(log.blockHash.replace(\'0x\',\'\') + log.transactionHash.replace(\'0x\',\'\') + log.logIndex.replace(\'0x\',\'\'));\\\\n        log.id = \'log_\'+ shaId.replace(\'0x\',\'\').substr(0,8);\\\\n    } else if(!log.id) {\\\\n        log.id = null;\\\\n    }\\\\n\\\\n    if (log.blockNumber !== null)\\\\n        log.blockNumber = utils.hexToNumber(log.blockNumber);\\\\n    if (log.transactionIndex !== null)\\\\n        log.transactionIndex = utils.hexToNumber(log.transactionIndex);\\\\n    if (log.logIndex !== null)\\\\n        log.logIndex = utils.hexToNumber(log.logIndex);\\\\n\\\\n    if (log.address) {\\\\n        log.address = utils.toChecksumAddress(log.address);\\\\n    }\\\\n\\\\n    return log;\\\\n};\\\\n\\\\n/**\\\\n * Formats the input of a whisper post and converts all values to HEX\\\\n *\\\\n * @method inputPostFormatter\\\\n * @param {Object} transaction object\\\\n * @returns {Object}\\\\n*/\\\\nvar inputPostFormatter = function(post) {\\\\n\\\\n    // post.payload = utils.toHex(post.payload);\\\\n\\\\n    if (post.ttl)\\\\n        post.ttl = utils.numberToHex(post.ttl);\\\\n    if (post.workToProve)\\\\n        post.workToProve = utils.numberToHex(post.workToProve);\\\\n    if (post.priority)\\\\n        post.priority = utils.numberToHex(post.priority);\\\\n\\\\n    // fallback\\\\n    if (!_.isArray(post.topics)) {\\\\n        post.topics = post.topics ? [post.topics] : [];\\\\n    }\\\\n\\\\n    // format the following options\\\\n    post.topics = post.topics.map(function(topic){\\\\n        // convert only if not hex\\\\n        return (topic.indexOf(\'0x\') === 0) ? topic : utils.fromUtf8(topic);\\\\n    });\\\\n\\\\n    return post;\\\\n};\\\\n\\\\n/**\\\\n * Formats the output of a received post message\\\\n *\\\\n * @method outputPostFormatter\\\\n * @param {Object}\\\\n * @returns {Object}\\\\n */\\\\nvar outputPostFormatter = function(post){\\\\n\\\\n    post.expiry = utils.hexToNumber(post.expiry);\\\\n    post.sent = utils.hexToNumber(post.sent);\\\\n    post.ttl = utils.hexToNumber(post.ttl);\\\\n    post.workProved = utils.hexToNumber(post.workProved);\\\\n    // post.payloadRaw = post.payload;\\\\n    // post.payload = utils.hexToAscii(post.payload);\\\\n\\\\n    // if (utils.isJson(post.payload)) {\\\\n    //     post.payload = JSON.parse(post.payload);\\\\n    // }\\\\n\\\\n    // format the following options\\\\n    if (!post.topics) {\\\\n        post.topics = [];\\\\n    }\\\\n    post.topics = post.topics.map(function(topic){\\\\n        return utils.toUtf8(topic);\\\\n    });\\\\n\\\\n    return post;\\\\n};\\\\n\\\\nvar inputAddressFormatter = function (address) {\\\\n    var iban = new Iban(address);\\\\n    if (iban.isValid() && iban.isDirect()) {\\\\n        return iban.toAddress().toLowerCase();\\\\n    } else if (utils.isAddress(address)) {\\\\n        return \'0x\' + address.toLowerCase().replace(\'0x\',\'\');\\\\n    }\\\\n    throw new Error(\'Provided address \\\\\\"\'+ address +\'\\\\\\" is invalid, the capitalization checksum test failed, or its an indrect IBAN address which can\\\\\\\\\'t be converted.\');\\\\n};\\\\n\\\\n\\\\nvar outputSyncingFormatter = function(result) {\\\\n\\\\n    result.startingBlock = utils.hexToNumber(result.startingBlock);\\\\n    result.currentBlock = utils.hexToNumber(result.currentBlock);\\\\n    result.highestBlock = utils.hexToNumber(result.highestBlock);\\\\n    if (result.knownStates) {\\\\n        result.knownStates = utils.hexToNumber(result.knownStates);\\\\n        result.pulledStates = utils.hexToNumber(result.pulledStates);\\\\n    }\\\\n\\\\n    return result;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n    inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\\\\n    inputBlockNumberFormatter: inputBlockNumberFormatter,\\\\n    inputCallFormatter: inputCallFormatter,\\\\n    inputTransactionFormatter: inputTransactionFormatter,\\\\n    inputAddressFormatter: inputAddressFormatter,\\\\n    inputPostFormatter: inputPostFormatter,\\\\n    inputLogFormatter: inputLogFormatter,\\\\n    inputSignFormatter: inputSignFormatter,\\\\n    outputBigNumberFormatter: outputBigNumberFormatter,\\\\n    outputTransactionFormatter: outputTransactionFormatter,\\\\n    outputTransactionReceiptFormatter: outputTransactionReceiptFormatter,\\\\n    outputBlockFormatter: outputBlockFormatter,\\\\n    outputLogFormatter: outputLogFormatter,\\\\n    outputPostFormatter: outputPostFormatter,\\\\n    outputSyncingFormatter: outputSyncingFormatter\\\\n};\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-helpers/src/formatters.js\\\\n// module id = 336\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-helpers/src/formatters.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve\\\\n * The MIT License (MIT)\\\\n * \\\\n * Copyright (c) 2013-2015 Petka Antonov\\\\n * \\\\n * Permission is hereby granted, free of charge, to any person obtaining a copy\\\\n * of this software and associated documentation files (the \\"Software\\"), to deal\\\\n * in the Software without restriction, including without limitation the rights\\\\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\\\n * copies of the Software, and to permit persons to whom the Software is\\\\n * furnished to do so, subject to the following conditions:\\\\n * \\\\n * The above copyright notice and this permission notice shall be included in\\\\n * all copies or substantial portions of the Software.\\\\n * \\\\n * THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\\\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\\\\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\\\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\\\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\\\\n * THE SOFTWARE.\\\\n * \\\\n */\\\\n/**\\\\n * bluebird build version 3.3.1\\\\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\\\\n*/\\\\n!function(e){if(true)module.exports=e();else if(\\"function\\"==typeof define&&define.amd)define([],e);else{var f;\\"undefined\\"!=typeof window?f=window:\\"undefined\\"!=typeof global?f=global:\\"undefined\\"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_==\\"function\\"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\\"Cannot find module \\\\\'\\"+o+\\"\\\\\'\\");throw f.code=\\"MODULE_NOT_FOUND\\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_==\\"function\\"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar SomePromiseArray = Promise._SomePromiseArray;\\\\nfunction any(promises) {\\\\n    var ret = new SomePromiseArray(promises);\\\\n    var promise = ret.promise();\\\\n    ret.setHowMany(1);\\\\n    ret.setUnwrap();\\\\n    ret.init();\\\\n    return promise;\\\\n}\\\\n\\\\nPromise.any = function (promises) {\\\\n    return any(promises);\\\\n};\\\\n\\\\nPromise.prototype.any = function () {\\\\n    return any(this);\\\\n};\\\\n\\\\n};\\\\n\\\\n},{}],2:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar firstLineError;\\\\ntry {throw new Error(); } catch (e) {firstLineError = e;}\\\\nvar schedule = _dereq_(\\"./schedule\\");\\\\nvar Queue = _dereq_(\\"./queue\\");\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nfunction Async() {\\\\n    this._isTickUsed = false;\\\\n    this._lateQueue = new Queue(16);\\\\n    this._normalQueue = new Queue(16);\\\\n    this._haveDrainedQueues = false;\\\\n    this._trampolineEnabled = true;\\\\n    var self = this;\\\\n    this.drainQueues = function () {\\\\n        self._drainQueues();\\\\n    };\\\\n    this._schedule = schedule;\\\\n}\\\\n\\\\nAsync.prototype.enableTrampoline = function() {\\\\n    this._trampolineEnabled = true;\\\\n};\\\\n\\\\nAsync.prototype.disableTrampolineIfNecessary = function() {\\\\n    if (util.hasDevTools) {\\\\n        this._trampolineEnabled = false;\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype.haveItemsQueued = function () {\\\\n    return this._isTickUsed || this._haveDrainedQueues;\\\\n};\\\\n\\\\n\\\\nAsync.prototype.fatalError = function(e, isNode) {\\\\n    if (isNode) {\\\\n        process.stderr.write(\\"Fatal \\" + (e instanceof Error ? e.stack : e));\\\\n        process.exit(2);\\\\n    } else {\\\\n        this.throwLater(e);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype.throwLater = function(fn, arg) {\\\\n    if (arguments.length === 1) {\\\\n        arg = fn;\\\\n        fn = function () { throw arg; };\\\\n    }\\\\n    if (typeof setTimeout !== \\"undefined\\") {\\\\n        setTimeout(function() {\\\\n            fn(arg);\\\\n        }, 0);\\\\n    } else try {\\\\n        this._schedule(function() {\\\\n            fn(arg);\\\\n        });\\\\n    } catch (e) {\\\\n        throw new Error(\\"No async scheduler available\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n};\\\\n\\\\nfunction AsyncInvokeLater(fn, receiver, arg) {\\\\n    this._lateQueue.push(fn, receiver, arg);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nfunction AsyncInvoke(fn, receiver, arg) {\\\\n    this._normalQueue.push(fn, receiver, arg);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nfunction AsyncSettlePromises(promise) {\\\\n    this._normalQueue._pushOne(promise);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nif (!util.hasDevTools) {\\\\n    Async.prototype.invokeLater = AsyncInvokeLater;\\\\n    Async.prototype.invoke = AsyncInvoke;\\\\n    Async.prototype.settlePromises = AsyncSettlePromises;\\\\n} else {\\\\n    Async.prototype.invokeLater = function (fn, receiver, arg) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncInvokeLater.call(this, fn, receiver, arg);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                setTimeout(function() {\\\\n                    fn.call(receiver, arg);\\\\n                }, 100);\\\\n            });\\\\n        }\\\\n    };\\\\n\\\\n    Async.prototype.invoke = function (fn, receiver, arg) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncInvoke.call(this, fn, receiver, arg);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                fn.call(receiver, arg);\\\\n            });\\\\n        }\\\\n    };\\\\n\\\\n    Async.prototype.settlePromises = function(promise) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncSettlePromises.call(this, promise);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                promise._settlePromises();\\\\n            });\\\\n        }\\\\n    };\\\\n}\\\\n\\\\nAsync.prototype.invokeFirst = function (fn, receiver, arg) {\\\\n    this._normalQueue.unshift(fn, receiver, arg);\\\\n    this._queueTick();\\\\n};\\\\n\\\\nAsync.prototype._drainQueue = function(queue) {\\\\n    while (queue.length() > 0) {\\\\n        var fn = queue.shift();\\\\n        if (typeof fn !== \\"function\\") {\\\\n            fn._settlePromises();\\\\n            continue;\\\\n        }\\\\n        var receiver = queue.shift();\\\\n        var arg = queue.shift();\\\\n        fn.call(receiver, arg);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype._drainQueues = function () {\\\\n    this._drainQueue(this._normalQueue);\\\\n    this._reset();\\\\n    this._haveDrainedQueues = true;\\\\n    this._drainQueue(this._lateQueue);\\\\n};\\\\n\\\\nAsync.prototype._queueTick = function () {\\\\n    if (!this._isTickUsed) {\\\\n        this._isTickUsed = true;\\\\n        this._schedule(this.drainQueues);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype._reset = function () {\\\\n    this._isTickUsed = false;\\\\n};\\\\n\\\\nmodule.exports = Async;\\\\nmodule.exports.firstLineError = firstLineError;\\\\n\\\\n},{\\"./queue\\":26,\\"./schedule\\":29,\\"./util\\":36}],3:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\\\\nvar calledBind = false;\\\\nvar rejectThis = function(_, e) {\\\\n    this._reject(e);\\\\n};\\\\n\\\\nvar targetRejected = function(e, context) {\\\\n    context.promiseRejectionQueued = true;\\\\n    context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\\\\n};\\\\n\\\\nvar bindingResolved = function(thisArg, context) {\\\\n    if (((this._bitField & 50397184) === 0)) {\\\\n        this._resolveCallback(context.target);\\\\n    }\\\\n};\\\\n\\\\nvar bindingRejected = function(e, context) {\\\\n    if (!context.promiseRejectionQueued) this._reject(e);\\\\n};\\\\n\\\\nPromise.prototype.bind = function (thisArg) {\\\\n    if (!calledBind) {\\\\n        calledBind = true;\\\\n        Promise.prototype._propagateFrom = debug.propagateFromFunction();\\\\n        Promise.prototype._boundValue = debug.boundValueFunction();\\\\n    }\\\\n    var maybePromise = tryConvertToPromise(thisArg);\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._propagateFrom(this, 1);\\\\n    var target = this._target();\\\\n    ret._setBoundTo(maybePromise);\\\\n    if (maybePromise instanceof Promise) {\\\\n        var context = {\\\\n            promiseRejectionQueued: false,\\\\n            promise: ret,\\\\n            target: target,\\\\n            bindingPromise: maybePromise\\\\n        };\\\\n        target._then(INTERNAL, targetRejected, undefined, ret, context);\\\\n        maybePromise._then(\\\\n            bindingResolved, bindingRejected, undefined, ret, context);\\\\n        ret._setOnCancel(maybePromise);\\\\n    } else {\\\\n        ret._resolveCallback(target);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._setBoundTo = function (obj) {\\\\n    if (obj !== undefined) {\\\\n        this._bitField = this._bitField | 2097152;\\\\n        this._boundTo = obj;\\\\n    } else {\\\\n        this._bitField = this._bitField & (~2097152);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._isBound = function () {\\\\n    return (this._bitField & 2097152) === 2097152;\\\\n};\\\\n\\\\nPromise.bind = function (thisArg, value) {\\\\n    return Promise.resolve(value).bind(thisArg);\\\\n};\\\\n};\\\\n\\\\n},{}],4:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar old;\\\\nif (typeof Promise !== \\"undefined\\") old = Promise;\\\\nfunction noConflict() {\\\\n    try { if (Promise === bluebird) Promise = old; }\\\\n    catch (e) {}\\\\n    return bluebird;\\\\n}\\\\nvar bluebird = _dereq_(\\"./promise\\")();\\\\nbluebird.noConflict = noConflict;\\\\nmodule.exports = bluebird;\\\\n\\\\n},{\\"./promise\\":22}],5:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar cr = Object.create;\\\\nif (cr) {\\\\n    var callerCache = cr(null);\\\\n    var getterCache = cr(null);\\\\n    callerCache[\\" size\\"] = getterCache[\\" size\\"] = 0;\\\\n}\\\\n\\\\nmodule.exports = function(Promise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar isIdentifier = util.isIdentifier;\\\\n\\\\nvar getMethodCaller;\\\\nvar getGetter;\\\\nif (false) {\\\\nvar makeMethodCaller = function (methodName) {\\\\n    return new Function(\\"ensureMethod\\", \\"                                    \\\\\\\\n\\\\\\\\\\\\n        return function(obj) {                                               \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\'                                                     \\\\\\\\n\\\\\\\\\\\\n            var len = this.length;                                           \\\\\\\\n\\\\\\\\\\\\n            ensureMethod(obj, \\\\\'methodName\\\\\');                                 \\\\\\\\n\\\\\\\\\\\\n            switch(len) {                                                    \\\\\\\\n\\\\\\\\\\\\n                case 1: return obj.methodName(this[0]);                      \\\\\\\\n\\\\\\\\\\\\n                case 2: return obj.methodName(this[0], this[1]);             \\\\\\\\n\\\\\\\\\\\\n                case 3: return obj.methodName(this[0], this[1], this[2]);    \\\\\\\\n\\\\\\\\\\\\n                case 0: return obj.methodName();                             \\\\\\\\n\\\\\\\\\\\\n                default:                                                     \\\\\\\\n\\\\\\\\\\\\n                    return obj.methodName.apply(obj, this);                  \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n        };                                                                   \\\\\\\\n\\\\\\\\\\\\n        \\".replace(/methodName/g, methodName))(ensureMethod);\\\\n};\\\\n\\\\nvar makeGetter = function (propertyName) {\\\\n    return new Function(\\"obj\\", \\"                                             \\\\\\\\n\\\\\\\\\\\\n        \\\\\'use strict\\\\\';                                                        \\\\\\\\n\\\\\\\\\\\\n        return obj.propertyName;                                             \\\\\\\\n\\\\\\\\\\\\n        \\".replace(\\"propertyName\\", propertyName));\\\\n};\\\\n\\\\nvar getCompiled = function(name, compiler, cache) {\\\\n    var ret = cache[name];\\\\n    if (typeof ret !== \\"function\\") {\\\\n        if (!isIdentifier(name)) {\\\\n            return null;\\\\n        }\\\\n        ret = compiler(name);\\\\n        cache[name] = ret;\\\\n        cache[\\" size\\"]++;\\\\n        if (cache[\\" size\\"] > 512) {\\\\n            var keys = Object.keys(cache);\\\\n            for (var i = 0; i < 256; ++i) delete cache[keys[i]];\\\\n            cache[\\" size\\"] = keys.length - 256;\\\\n        }\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\ngetMethodCaller = function(name) {\\\\n    return getCompiled(name, makeMethodCaller, callerCache);\\\\n};\\\\n\\\\ngetGetter = function(name) {\\\\n    return getCompiled(name, makeGetter, getterCache);\\\\n};\\\\n}\\\\n\\\\nfunction ensureMethod(obj, methodName) {\\\\n    var fn;\\\\n    if (obj != null) fn = obj[methodName];\\\\n    if (typeof fn !== \\"function\\") {\\\\n        var message = \\"Object \\" + util.classString(obj) + \\" has no method \\\\\'\\" +\\\\n            util.toString(methodName) + \\"\\\\\'\\";\\\\n        throw new Promise.TypeError(message);\\\\n    }\\\\n    return fn;\\\\n}\\\\n\\\\nfunction caller(obj) {\\\\n    var methodName = this.pop();\\\\n    var fn = ensureMethod(obj, methodName);\\\\n    return fn.apply(obj, this);\\\\n}\\\\nPromise.prototype.call = function (methodName) {\\\\n    var args = [].slice.call(arguments, 1);;\\\\n    if (false) {\\\\n        if (canEvaluate) {\\\\n            var maybeCaller = getMethodCaller(methodName);\\\\n            if (maybeCaller !== null) {\\\\n                return this._then(\\\\n                    maybeCaller, undefined, undefined, args, undefined);\\\\n            }\\\\n        }\\\\n    }\\\\n    args.push(methodName);\\\\n    return this._then(caller, undefined, undefined, args, undefined);\\\\n};\\\\n\\\\nfunction namedGetter(obj) {\\\\n    return obj[this];\\\\n}\\\\nfunction indexedGetter(obj) {\\\\n    var index = +this;\\\\n    if (index < 0) index = Math.max(0, index + obj.length);\\\\n    return obj[index];\\\\n}\\\\nPromise.prototype.get = function (propertyName) {\\\\n    var isIndex = (typeof propertyName === \\"number\\");\\\\n    var getter;\\\\n    if (!isIndex) {\\\\n        if (canEvaluate) {\\\\n            var maybeGetter = getGetter(propertyName);\\\\n            getter = maybeGetter !== null ? maybeGetter : namedGetter;\\\\n        } else {\\\\n            getter = namedGetter;\\\\n        }\\\\n    } else {\\\\n        getter = indexedGetter;\\\\n    }\\\\n    return this._then(getter, undefined, undefined, propertyName, undefined);\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],6:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar async = Promise._async;\\\\n\\\\nPromise.prototype[\\"break\\"] = Promise.prototype.cancel = function() {\\\\n    if (!debug.cancellation()) return this._warn(\\"cancellation is disabled\\");\\\\n\\\\n    var promise = this;\\\\n    var child = promise;\\\\n    while (promise.isCancellable()) {\\\\n        if (!promise._cancelBy(child)) {\\\\n            if (child._isFollowing()) {\\\\n                child._followee().cancel();\\\\n            } else {\\\\n                child._cancelBranched();\\\\n            }\\\\n            break;\\\\n        }\\\\n\\\\n        var parent = promise._cancellationParent;\\\\n        if (parent == null || !parent.isCancellable()) {\\\\n            if (promise._isFollowing()) {\\\\n                promise._followee().cancel();\\\\n            } else {\\\\n                promise._cancelBranched();\\\\n            }\\\\n            break;\\\\n        } else {\\\\n            if (promise._isFollowing()) promise._followee().cancel();\\\\n            child = promise;\\\\n            promise = parent;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._branchHasCancelled = function() {\\\\n    this._branchesRemainingToCancel--;\\\\n};\\\\n\\\\nPromise.prototype._enoughBranchesHaveCancelled = function() {\\\\n    return this._branchesRemainingToCancel === undefined ||\\\\n           this._branchesRemainingToCancel <= 0;\\\\n};\\\\n\\\\nPromise.prototype._cancelBy = function(canceller) {\\\\n    if (canceller === this) {\\\\n        this._branchesRemainingToCancel = 0;\\\\n        this._invokeOnCancel();\\\\n        return true;\\\\n    } else {\\\\n        this._branchHasCancelled();\\\\n        if (this._enoughBranchesHaveCancelled()) {\\\\n            this._invokeOnCancel();\\\\n            return true;\\\\n        }\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPromise.prototype._cancelBranched = function() {\\\\n    if (this._enoughBranchesHaveCancelled()) {\\\\n        this._cancel();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._cancel = function() {\\\\n    if (!this.isCancellable()) return;\\\\n\\\\n    this._setCancelled();\\\\n    async.invoke(this._cancelPromises, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype._cancelPromises = function() {\\\\n    if (this._length() > 0) this._settlePromises();\\\\n};\\\\n\\\\nPromise.prototype._unsetOnCancel = function() {\\\\n    this._onCancelField = undefined;\\\\n};\\\\n\\\\nPromise.prototype.isCancellable = function() {\\\\n    return this.isPending() && !this.isCancelled();\\\\n};\\\\n\\\\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\\\\n    if (util.isArray(onCancelCallback)) {\\\\n        for (var i = 0; i < onCancelCallback.length; ++i) {\\\\n            this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\\\\n        }\\\\n    } else if (onCancelCallback !== undefined) {\\\\n        if (typeof onCancelCallback === \\"function\\") {\\\\n            if (!internalOnly) {\\\\n                var e = tryCatch(onCancelCallback).call(this._boundValue());\\\\n                if (e === errorObj) {\\\\n                    this._attachExtraTrace(e.e);\\\\n                    async.throwLater(e.e);\\\\n                }\\\\n            }\\\\n        } else {\\\\n            onCancelCallback._resultCancelled(this);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._invokeOnCancel = function() {\\\\n    var onCancelCallback = this._onCancel();\\\\n    this._unsetOnCancel();\\\\n    async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\\\\n};\\\\n\\\\nPromise.prototype._invokeInternalOnCancel = function() {\\\\n    if (this.isCancellable()) {\\\\n        this._doInvokeOnCancel(this._onCancel(), true);\\\\n        this._unsetOnCancel();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._resultCancelled = function() {\\\\n    this.cancel();\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],7:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(NEXT_FILTER) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar getKeys = _dereq_(\\"./es5\\").keys;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction catchFilter(instances, cb, promise) {\\\\n    return function(e) {\\\\n        var boundTo = promise._boundValue();\\\\n        predicateLoop: for (var i = 0; i < instances.length; ++i) {\\\\n            var item = instances[i];\\\\n\\\\n            if (item === Error ||\\\\n                (item != null && item.prototype instanceof Error)) {\\\\n                if (e instanceof item) {\\\\n                    return tryCatch(cb).call(boundTo, e);\\\\n                }\\\\n            } else if (typeof item === \\"function\\") {\\\\n                var matchesPredicate = tryCatch(item).call(boundTo, e);\\\\n                if (matchesPredicate === errorObj) {\\\\n                    return matchesPredicate;\\\\n                } else if (matchesPredicate) {\\\\n                    return tryCatch(cb).call(boundTo, e);\\\\n                }\\\\n            } else if (util.isObject(e)) {\\\\n                var keys = getKeys(item);\\\\n                for (var j = 0; j < keys.length; ++j) {\\\\n                    var key = keys[j];\\\\n                    if (item[key] != e[key]) {\\\\n                        continue predicateLoop;\\\\n                    }\\\\n                }\\\\n                return tryCatch(cb).call(boundTo, e);\\\\n            }\\\\n        }\\\\n        return NEXT_FILTER;\\\\n    };\\\\n}\\\\n\\\\nreturn catchFilter;\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],8:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar longStackTraces = false;\\\\nvar contextStack = [];\\\\n\\\\nPromise.prototype._promiseCreated = function() {};\\\\nPromise.prototype._pushContext = function() {};\\\\nPromise.prototype._popContext = function() {return null;};\\\\nPromise._peekContext = Promise.prototype._peekContext = function() {};\\\\n\\\\nfunction Context() {\\\\n    this._trace = new Context.CapturedTrace(peekContext());\\\\n}\\\\nContext.prototype._pushContext = function () {\\\\n    if (this._trace !== undefined) {\\\\n        this._trace._promiseCreated = null;\\\\n        contextStack.push(this._trace);\\\\n    }\\\\n};\\\\n\\\\nContext.prototype._popContext = function () {\\\\n    if (this._trace !== undefined) {\\\\n        var trace = contextStack.pop();\\\\n        var ret = trace._promiseCreated;\\\\n        trace._promiseCreated = null;\\\\n        return ret;\\\\n    }\\\\n    return null;\\\\n};\\\\n\\\\nfunction createContext() {\\\\n    if (longStackTraces) return new Context();\\\\n}\\\\n\\\\nfunction peekContext() {\\\\n    var lastIndex = contextStack.length - 1;\\\\n    if (lastIndex >= 0) {\\\\n        return contextStack[lastIndex];\\\\n    }\\\\n    return undefined;\\\\n}\\\\nContext.CapturedTrace = null;\\\\nContext.create = createContext;\\\\nContext.deactivateLongStackTraces = function() {};\\\\nContext.activateLongStackTraces = function() {\\\\n    var Promise_pushContext = Promise.prototype._pushContext;\\\\n    var Promise_popContext = Promise.prototype._popContext;\\\\n    var Promise_PeekContext = Promise._peekContext;\\\\n    var Promise_peekContext = Promise.prototype._peekContext;\\\\n    var Promise_promiseCreated = Promise.prototype._promiseCreated;\\\\n    Context.deactivateLongStackTraces = function() {\\\\n        Promise.prototype._pushContext = Promise_pushContext;\\\\n        Promise.prototype._popContext = Promise_popContext;\\\\n        Promise._peekContext = Promise_PeekContext;\\\\n        Promise.prototype._peekContext = Promise_peekContext;\\\\n        Promise.prototype._promiseCreated = Promise_promiseCreated;\\\\n        longStackTraces = false;\\\\n    };\\\\n    longStackTraces = true;\\\\n    Promise.prototype._pushContext = Context.prototype._pushContext;\\\\n    Promise.prototype._popContext = Context.prototype._popContext;\\\\n    Promise._peekContext = Promise.prototype._peekContext = peekContext;\\\\n    Promise.prototype._promiseCreated = function() {\\\\n        var ctx = this._peekContext();\\\\n        if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\\\\n    };\\\\n};\\\\nreturn Context;\\\\n};\\\\n\\\\n},{}],9:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, Context) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar async = Promise._async;\\\\nvar Warning = _dereq_(\\"./errors\\").Warning;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canAttachTrace = util.canAttachTrace;\\\\nvar unhandledRejectionHandled;\\\\nvar possiblyUnhandledRejection;\\\\nvar bluebirdFramePattern =\\\\n    /[\\\\\\\\\\\\\\\\\\\\\\\\/]bluebird[\\\\\\\\\\\\\\\\\\\\\\\\/]js[\\\\\\\\\\\\\\\\\\\\\\\\/](release|debug|instrumented)/;\\\\nvar stackFramePattern = null;\\\\nvar formatStack = null;\\\\nvar indentStackFrames = false;\\\\nvar printWarning;\\\\nvar debugging = !!(util.env(\\"BLUEBIRD_DEBUG\\") != 0 &&\\\\n                        (true ||\\\\n                         util.env(\\"BLUEBIRD_DEBUG\\") ||\\\\n                         util.env(\\"NODE_ENV\\") === \\"development\\"));\\\\n\\\\nvar warnings = !!(util.env(\\"BLUEBIRD_WARNINGS\\") != 0 &&\\\\n    (debugging || util.env(\\"BLUEBIRD_WARNINGS\\")));\\\\n\\\\nvar longStackTraces = !!(util.env(\\"BLUEBIRD_LONG_STACK_TRACES\\") != 0 &&\\\\n    (debugging || util.env(\\"BLUEBIRD_LONG_STACK_TRACES\\")));\\\\n\\\\nvar wForgottenReturn = util.env(\\"BLUEBIRD_W_FORGOTTEN_RETURN\\") != 0 &&\\\\n    (warnings || !!util.env(\\"BLUEBIRD_W_FORGOTTEN_RETURN\\"));\\\\n\\\\nPromise.prototype.suppressUnhandledRejections = function() {\\\\n    var target = this._target();\\\\n    target._bitField = ((target._bitField & (~1048576)) |\\\\n                      524288);\\\\n};\\\\n\\\\nPromise.prototype._ensurePossibleRejectionHandled = function () {\\\\n    if ((this._bitField & 524288) !== 0) return;\\\\n    this._setRejectionIsUnhandled();\\\\n    async.invokeLater(this._notifyUnhandledRejection, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\\\\n    fireRejectionEvent(\\"rejectionHandled\\",\\\\n                                  unhandledRejectionHandled, undefined, this);\\\\n};\\\\n\\\\nPromise.prototype._setReturnedNonUndefined = function() {\\\\n    this._bitField = this._bitField | 268435456;\\\\n};\\\\n\\\\nPromise.prototype._returnedNonUndefined = function() {\\\\n    return (this._bitField & 268435456) !== 0;\\\\n};\\\\n\\\\nPromise.prototype._notifyUnhandledRejection = function () {\\\\n    if (this._isRejectionUnhandled()) {\\\\n        var reason = this._settledValue();\\\\n        this._setUnhandledRejectionIsNotified();\\\\n        fireRejectionEvent(\\"unhandledRejection\\",\\\\n                                      possiblyUnhandledRejection, reason, this);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\\\\n    this._bitField = this._bitField | 262144;\\\\n};\\\\n\\\\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\\\\n    this._bitField = this._bitField & (~262144);\\\\n};\\\\n\\\\nPromise.prototype._isUnhandledRejectionNotified = function () {\\\\n    return (this._bitField & 262144) > 0;\\\\n};\\\\n\\\\nPromise.prototype._setRejectionIsUnhandled = function () {\\\\n    this._bitField = this._bitField | 1048576;\\\\n};\\\\n\\\\nPromise.prototype._unsetRejectionIsUnhandled = function () {\\\\n    this._bitField = this._bitField & (~1048576);\\\\n    if (this._isUnhandledRejectionNotified()) {\\\\n        this._unsetUnhandledRejectionIsNotified();\\\\n        this._notifyUnhandledRejectionIsHandled();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._isRejectionUnhandled = function () {\\\\n    return (this._bitField & 1048576) > 0;\\\\n};\\\\n\\\\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\\\\n    return warn(message, shouldUseOwnTrace, promise || this);\\\\n};\\\\n\\\\nPromise.onPossiblyUnhandledRejection = function (fn) {\\\\n    var domain = getDomain();\\\\n    possiblyUnhandledRejection =\\\\n        typeof fn === \\"function\\" ? (domain === null ? fn : domain.bind(fn))\\\\n                                 : undefined;\\\\n};\\\\n\\\\nPromise.onUnhandledRejectionHandled = function (fn) {\\\\n    var domain = getDomain();\\\\n    unhandledRejectionHandled =\\\\n        typeof fn === \\"function\\" ? (domain === null ? fn : domain.bind(fn))\\\\n                                 : undefined;\\\\n};\\\\n\\\\nvar disableLongStackTraces = function() {};\\\\nPromise.longStackTraces = function () {\\\\n    if (async.haveItemsQueued() && !config.longStackTraces) {\\\\n        throw new Error(\\"cannot enable long stack traces after promises have been created\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    if (!config.longStackTraces && longStackTracesIsSupported()) {\\\\n        var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\\\\n        var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\\\\n        config.longStackTraces = true;\\\\n        disableLongStackTraces = function() {\\\\n            if (async.haveItemsQueued() && !config.longStackTraces) {\\\\n                throw new Error(\\"cannot enable long stack traces after promises have been created\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n            }\\\\n            Promise.prototype._captureStackTrace = Promise_captureStackTrace;\\\\n            Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\\\\n            Context.deactivateLongStackTraces();\\\\n            async.enableTrampoline();\\\\n            config.longStackTraces = false;\\\\n        };\\\\n        Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\\\\n        Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\\\\n        Context.activateLongStackTraces();\\\\n        async.disableTrampolineIfNecessary();\\\\n    }\\\\n};\\\\n\\\\nPromise.hasLongStackTraces = function () {\\\\n    return config.longStackTraces && longStackTracesIsSupported();\\\\n};\\\\n\\\\nvar fireDomEvent = (function() {\\\\n    try {\\\\n        var event = document.createEvent(\\"CustomEvent\\");\\\\n        event.initCustomEvent(\\"testingtheevent\\", false, true, {});\\\\n        util.global.dispatchEvent(event);\\\\n        return function(name, event) {\\\\n            var domEvent = document.createEvent(\\"CustomEvent\\");\\\\n            domEvent.initCustomEvent(name.toLowerCase(), false, true, event);\\\\n            return !util.global.dispatchEvent(domEvent);\\\\n        };\\\\n    } catch (e) {}\\\\n    return function() {\\\\n        return false;\\\\n    };\\\\n})();\\\\n\\\\nvar fireGlobalEvent = (function() {\\\\n    if (util.isNode) {\\\\n        return function() {\\\\n            return process.emit.apply(process, arguments);\\\\n        };\\\\n    } else {\\\\n        if (!util.global) {\\\\n            return function() {\\\\n                return false;\\\\n            };\\\\n        }\\\\n        return function(name) {\\\\n            var methodName = \\"on\\" + name.toLowerCase();\\\\n            var method = util.global[methodName];\\\\n            if (!method) return false;\\\\n            method.apply(util.global, [].slice.call(arguments, 1));\\\\n            return true;\\\\n        };\\\\n    }\\\\n})();\\\\n\\\\nfunction generatePromiseLifecycleEventObject(name, promise) {\\\\n    return {promise: promise};\\\\n}\\\\n\\\\nvar eventToObjectGenerator = {\\\\n    promiseCreated: generatePromiseLifecycleEventObject,\\\\n    promiseFulfilled: generatePromiseLifecycleEventObject,\\\\n    promiseRejected: generatePromiseLifecycleEventObject,\\\\n    promiseResolved: generatePromiseLifecycleEventObject,\\\\n    promiseCancelled: generatePromiseLifecycleEventObject,\\\\n    promiseChained: function(name, promise, child) {\\\\n        return {promise: promise, child: child};\\\\n    },\\\\n    warning: function(name, warning) {\\\\n        return {warning: warning};\\\\n    },\\\\n    unhandledRejection: function (name, reason, promise) {\\\\n        return {reason: reason, promise: promise};\\\\n    },\\\\n    rejectionHandled: generatePromiseLifecycleEventObject\\\\n};\\\\n\\\\nvar activeFireEvent = function (name) {\\\\n    var globalEventFired = false;\\\\n    try {\\\\n        globalEventFired = fireGlobalEvent.apply(null, arguments);\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n        globalEventFired = true;\\\\n    }\\\\n\\\\n    var domEventFired = false;\\\\n    try {\\\\n        domEventFired = fireDomEvent(name,\\\\n                    eventToObjectGenerator[name].apply(null, arguments));\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n        domEventFired = true;\\\\n    }\\\\n\\\\n    return domEventFired || globalEventFired;\\\\n};\\\\n\\\\nPromise.config = function(opts) {\\\\n    opts = Object(opts);\\\\n    if (\\"longStackTraces\\" in opts) {\\\\n        if (opts.longStackTraces) {\\\\n            Promise.longStackTraces();\\\\n        } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\\\\n            disableLongStackTraces();\\\\n        }\\\\n    }\\\\n    if (\\"warnings\\" in opts) {\\\\n        var warningsOption = opts.warnings;\\\\n        config.warnings = !!warningsOption;\\\\n        wForgottenReturn = config.warnings;\\\\n\\\\n        if (util.isObject(warningsOption)) {\\\\n            if (\\"wForgottenReturn\\" in warningsOption) {\\\\n                wForgottenReturn = !!warningsOption.wForgottenReturn;\\\\n            }\\\\n        }\\\\n    }\\\\n    if (\\"cancellation\\" in opts && opts.cancellation && !config.cancellation) {\\\\n        if (async.haveItemsQueued()) {\\\\n            throw new Error(\\\\n                \\"cannot enable cancellation after promises are in use\\");\\\\n        }\\\\n        Promise.prototype._clearCancellationData =\\\\n            cancellationClearCancellationData;\\\\n        Promise.prototype._propagateFrom = cancellationPropagateFrom;\\\\n        Promise.prototype._onCancel = cancellationOnCancel;\\\\n        Promise.prototype._setOnCancel = cancellationSetOnCancel;\\\\n        Promise.prototype._attachCancellationCallback =\\\\n            cancellationAttachCancellationCallback;\\\\n        Promise.prototype._execute = cancellationExecute;\\\\n        propagateFromFunction = cancellationPropagateFrom;\\\\n        config.cancellation = true;\\\\n    }\\\\n    if (\\"monitoring\\" in opts) {\\\\n        if (opts.monitoring && !config.monitoring) {\\\\n            config.monitoring = true;\\\\n            Promise.prototype._fireEvent = activeFireEvent;\\\\n        } else if (!opts.monitoring && config.monitoring) {\\\\n            config.monitoring = false;\\\\n            Promise.prototype._fireEvent = defaultFireEvent;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nfunction defaultFireEvent() { return false; }\\\\n\\\\nPromise.prototype._fireEvent = defaultFireEvent;\\\\nPromise.prototype._execute = function(executor, resolve, reject) {\\\\n    try {\\\\n        executor(resolve, reject);\\\\n    } catch (e) {\\\\n        return e;\\\\n    }\\\\n};\\\\nPromise.prototype._onCancel = function () {};\\\\nPromise.prototype._setOnCancel = function (handler) { ; };\\\\nPromise.prototype._attachCancellationCallback = function(onCancel) {\\\\n    ;\\\\n};\\\\nPromise.prototype._captureStackTrace = function () {};\\\\nPromise.prototype._attachExtraTrace = function () {};\\\\nPromise.prototype._clearCancellationData = function() {};\\\\nPromise.prototype._propagateFrom = function (parent, flags) {\\\\n    ;\\\\n    ;\\\\n};\\\\n\\\\nfunction cancellationExecute(executor, resolve, reject) {\\\\n    var promise = this;\\\\n    try {\\\\n        executor(resolve, reject, function(onCancel) {\\\\n            if (typeof onCancel !== \\"function\\") {\\\\n                throw new TypeError(\\"onCancel must be a function, got: \\" +\\\\n                                    util.toString(onCancel));\\\\n            }\\\\n            promise._attachCancellationCallback(onCancel);\\\\n        });\\\\n    } catch (e) {\\\\n        return e;\\\\n    }\\\\n}\\\\n\\\\nfunction cancellationAttachCancellationCallback(onCancel) {\\\\n    if (!this.isCancellable()) return this;\\\\n\\\\n    var previousOnCancel = this._onCancel();\\\\n    if (previousOnCancel !== undefined) {\\\\n        if (util.isArray(previousOnCancel)) {\\\\n            previousOnCancel.push(onCancel);\\\\n        } else {\\\\n            this._setOnCancel([previousOnCancel, onCancel]);\\\\n        }\\\\n    } else {\\\\n        this._setOnCancel(onCancel);\\\\n    }\\\\n}\\\\n\\\\nfunction cancellationOnCancel() {\\\\n    return this._onCancelField;\\\\n}\\\\n\\\\nfunction cancellationSetOnCancel(onCancel) {\\\\n    this._onCancelField = onCancel;\\\\n}\\\\n\\\\nfunction cancellationClearCancellationData() {\\\\n    this._cancellationParent = undefined;\\\\n    this._onCancelField = undefined;\\\\n}\\\\n\\\\nfunction cancellationPropagateFrom(parent, flags) {\\\\n    if ((flags & 1) !== 0) {\\\\n        this._cancellationParent = parent;\\\\n        var branchesRemainingToCancel = parent._branchesRemainingToCancel;\\\\n        if (branchesRemainingToCancel === undefined) {\\\\n            branchesRemainingToCancel = 0;\\\\n        }\\\\n        parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\\\\n    }\\\\n    if ((flags & 2) !== 0 && parent._isBound()) {\\\\n        this._setBoundTo(parent._boundTo);\\\\n    }\\\\n}\\\\n\\\\nfunction bindingPropagateFrom(parent, flags) {\\\\n    if ((flags & 2) !== 0 && parent._isBound()) {\\\\n        this._setBoundTo(parent._boundTo);\\\\n    }\\\\n}\\\\nvar propagateFromFunction = bindingPropagateFrom;\\\\n\\\\nfunction boundValueFunction() {\\\\n    var ret = this._boundTo;\\\\n    if (ret !== undefined) {\\\\n        if (ret instanceof Promise) {\\\\n            if (ret.isFulfilled()) {\\\\n                return ret.value();\\\\n            } else {\\\\n                return undefined;\\\\n            }\\\\n        }\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction longStackTracesCaptureStackTrace() {\\\\n    this._trace = new CapturedTrace(this._peekContext());\\\\n}\\\\n\\\\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\\\\n    if (canAttachTrace(error)) {\\\\n        var trace = this._trace;\\\\n        if (trace !== undefined) {\\\\n            if (ignoreSelf) trace = trace._parent;\\\\n        }\\\\n        if (trace !== undefined) {\\\\n            trace.attachExtraTrace(error);\\\\n        } else if (!error.__stackCleaned__) {\\\\n            var parsed = parseStackAndMessage(error);\\\\n            util.notEnumerableProp(error, \\"stack\\",\\\\n                parsed.message + \\"\\\\\\\\n\\" + parsed.stack.join(\\"\\\\\\\\n\\"));\\\\n            util.notEnumerableProp(error, \\"__stackCleaned__\\", true);\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\\\\n                               parent) {\\\\n    if (returnValue === undefined && promiseCreated !== null &&\\\\n        wForgottenReturn) {\\\\n        if (parent !== undefined && parent._returnedNonUndefined()) return;\\\\n\\\\n        if (name) name = name + \\" \\";\\\\n        var msg = \\"a promise was created in a \\" + name +\\\\n            \\"handler but was not returned from it\\";\\\\n        promise._warn(msg, true, promiseCreated);\\\\n    }\\\\n}\\\\n\\\\nfunction deprecated(name, replacement) {\\\\n    var message = name +\\\\n        \\" is deprecated and will be removed in a future version.\\";\\\\n    if (replacement) message += \\" Use \\" + replacement + \\" instead.\\";\\\\n    return warn(message);\\\\n}\\\\n\\\\nfunction warn(message, shouldUseOwnTrace, promise) {\\\\n    if (!config.warnings) return;\\\\n    var warning = new Warning(message);\\\\n    var ctx;\\\\n    if (shouldUseOwnTrace) {\\\\n        promise._attachExtraTrace(warning);\\\\n    } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\\\\n        ctx.attachExtraTrace(warning);\\\\n    } else {\\\\n        var parsed = parseStackAndMessage(warning);\\\\n        warning.stack = parsed.message + \\"\\\\\\\\n\\" + parsed.stack.join(\\"\\\\\\\\n\\");\\\\n    }\\\\n\\\\n    if (!activeFireEvent(\\"warning\\", warning)) {\\\\n        formatAndLogError(warning, \\"\\", true);\\\\n    }\\\\n}\\\\n\\\\nfunction reconstructStack(message, stacks) {\\\\n    for (var i = 0; i < stacks.length - 1; ++i) {\\\\n        stacks[i].push(\\"From previous event:\\");\\\\n        stacks[i] = stacks[i].join(\\"\\\\\\\\n\\");\\\\n    }\\\\n    if (i < stacks.length) {\\\\n        stacks[i] = stacks[i].join(\\"\\\\\\\\n\\");\\\\n    }\\\\n    return message + \\"\\\\\\\\n\\" + stacks.join(\\"\\\\\\\\n\\");\\\\n}\\\\n\\\\nfunction removeDuplicateOrEmptyJumps(stacks) {\\\\n    for (var i = 0; i < stacks.length; ++i) {\\\\n        if (stacks[i].length === 0 ||\\\\n            ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\\\\n            stacks.splice(i, 1);\\\\n            i--;\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction removeCommonRoots(stacks) {\\\\n    var current = stacks[0];\\\\n    for (var i = 1; i < stacks.length; ++i) {\\\\n        var prev = stacks[i];\\\\n        var currentLastIndex = current.length - 1;\\\\n        var currentLastLine = current[currentLastIndex];\\\\n        var commonRootMeetPoint = -1;\\\\n\\\\n        for (var j = prev.length - 1; j >= 0; --j) {\\\\n            if (prev[j] === currentLastLine) {\\\\n                commonRootMeetPoint = j;\\\\n                break;\\\\n            }\\\\n        }\\\\n\\\\n        for (var j = commonRootMeetPoint; j >= 0; --j) {\\\\n            var line = prev[j];\\\\n            if (current[currentLastIndex] === line) {\\\\n                current.pop();\\\\n                currentLastIndex--;\\\\n            } else {\\\\n                break;\\\\n            }\\\\n        }\\\\n        current = prev;\\\\n    }\\\\n}\\\\n\\\\nfunction cleanStack(stack) {\\\\n    var ret = [];\\\\n    for (var i = 0; i < stack.length; ++i) {\\\\n        var line = stack[i];\\\\n        var isTraceLine = \\"    (No stack trace)\\" === line ||\\\\n            stackFramePattern.test(line);\\\\n        var isInternalFrame = isTraceLine && shouldIgnore(line);\\\\n        if (isTraceLine && !isInternalFrame) {\\\\n            if (indentStackFrames && line.charAt(0) !== \\" \\") {\\\\n                line = \\"    \\" + line;\\\\n            }\\\\n            ret.push(line);\\\\n        }\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction stackFramesAsArray(error) {\\\\n    var stack = error.stack.replace(/\\\\\\\\s+$/g, \\"\\").split(\\"\\\\\\\\n\\");\\\\n    for (var i = 0; i < stack.length; ++i) {\\\\n        var line = stack[i];\\\\n        if (\\"    (No stack trace)\\" === line || stackFramePattern.test(line)) {\\\\n            break;\\\\n        }\\\\n    }\\\\n    if (i > 0) {\\\\n        stack = stack.slice(i);\\\\n    }\\\\n    return stack;\\\\n}\\\\n\\\\nfunction parseStackAndMessage(error) {\\\\n    var stack = error.stack;\\\\n    var message = error.toString();\\\\n    stack = typeof stack === \\"string\\" && stack.length > 0\\\\n                ? stackFramesAsArray(error) : [\\"    (No stack trace)\\"];\\\\n    return {\\\\n        message: message,\\\\n        stack: cleanStack(stack)\\\\n    };\\\\n}\\\\n\\\\nfunction formatAndLogError(error, title, isSoft) {\\\\n    if (typeof console !== \\"undefined\\") {\\\\n        var message;\\\\n        if (util.isObject(error)) {\\\\n            var stack = error.stack;\\\\n            message = title + formatStack(stack, error);\\\\n        } else {\\\\n            message = title + String(error);\\\\n        }\\\\n        if (typeof printWarning === \\"function\\") {\\\\n            printWarning(message, isSoft);\\\\n        } else if (typeof console.log === \\"function\\" ||\\\\n            typeof console.log === \\"object\\") {\\\\n            console.log(message);\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\\\\n    var localEventFired = false;\\\\n    try {\\\\n        if (typeof localHandler === \\"function\\") {\\\\n            localEventFired = true;\\\\n            if (name === \\"rejectionHandled\\") {\\\\n                localHandler(promise);\\\\n            } else {\\\\n                localHandler(reason, promise);\\\\n            }\\\\n        }\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n    }\\\\n\\\\n    if (name === \\"unhandledRejection\\") {\\\\n        if (!activeFireEvent(name, reason, promise) && !localEventFired) {\\\\n            formatAndLogError(reason, \\"Unhandled rejection \\");\\\\n        }\\\\n    } else {\\\\n        activeFireEvent(name, promise);\\\\n    }\\\\n}\\\\n\\\\nfunction formatNonError(obj) {\\\\n    var str;\\\\n    if (typeof obj === \\"function\\") {\\\\n        str = \\"[function \\" +\\\\n            (obj.name || \\"anonymous\\") +\\\\n            \\"]\\";\\\\n    } else {\\\\n        str = obj && typeof obj.toString === \\"function\\"\\\\n            ? obj.toString() : util.toString(obj);\\\\n        var ruselessToString = /\\\\\\\\[object [a-zA-Z0-9$_]+\\\\\\\\]/;\\\\n        if (ruselessToString.test(str)) {\\\\n            try {\\\\n                var newStr = JSON.stringify(obj);\\\\n                str = newStr;\\\\n            }\\\\n            catch(e) {\\\\n\\\\n            }\\\\n        }\\\\n        if (str.length === 0) {\\\\n            str = \\"(empty array)\\";\\\\n        }\\\\n    }\\\\n    return (\\"(<\\" + snip(str) + \\">, no stack trace)\\");\\\\n}\\\\n\\\\nfunction snip(str) {\\\\n    var maxChars = 41;\\\\n    if (str.length < maxChars) {\\\\n        return str;\\\\n    }\\\\n    return str.substr(0, maxChars - 3) + \\"...\\";\\\\n}\\\\n\\\\nfunction longStackTracesIsSupported() {\\\\n    return typeof captureStackTrace === \\"function\\";\\\\n}\\\\n\\\\nvar shouldIgnore = function() { return false; };\\\\nvar parseLineInfoRegex = /[\\\\\\\\/<\\\\\\\\(]([^:\\\\\\\\/]+):(\\\\\\\\d+):(?:\\\\\\\\d+)\\\\\\\\)?\\\\\\\\s*$/;\\\\nfunction parseLineInfo(line) {\\\\n    var matches = line.match(parseLineInfoRegex);\\\\n    if (matches) {\\\\n        return {\\\\n            fileName: matches[1],\\\\n            line: parseInt(matches[2], 10)\\\\n        };\\\\n    }\\\\n}\\\\n\\\\nfunction setBounds(firstLineError, lastLineError) {\\\\n    if (!longStackTracesIsSupported()) return;\\\\n    var firstStackLines = firstLineError.stack.split(\\"\\\\\\\\n\\");\\\\n    var lastStackLines = lastLineError.stack.split(\\"\\\\\\\\n\\");\\\\n    var firstIndex = -1;\\\\n    var lastIndex = -1;\\\\n    var firstFileName;\\\\n    var lastFileName;\\\\n    for (var i = 0; i < firstStackLines.length; ++i) {\\\\n        var result = parseLineInfo(firstStackLines[i]);\\\\n        if (result) {\\\\n            firstFileName = result.fileName;\\\\n            firstIndex = result.line;\\\\n            break;\\\\n        }\\\\n    }\\\\n    for (var i = 0; i < lastStackLines.length; ++i) {\\\\n        var result = parseLineInfo(lastStackLines[i]);\\\\n        if (result) {\\\\n            lastFileName = result.fileName;\\\\n            lastIndex = result.line;\\\\n            break;\\\\n        }\\\\n    }\\\\n    if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\\\\n        firstFileName !== lastFileName || firstIndex >= lastIndex) {\\\\n        return;\\\\n    }\\\\n\\\\n    shouldIgnore = function(line) {\\\\n        if (bluebirdFramePattern.test(line)) return true;\\\\n        var info = parseLineInfo(line);\\\\n        if (info) {\\\\n            if (info.fileName === firstFileName &&\\\\n                (firstIndex <= info.line && info.line <= lastIndex)) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    };\\\\n}\\\\n\\\\nfunction CapturedTrace(parent) {\\\\n    this._parent = parent;\\\\n    this._promisesCreated = 0;\\\\n    var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\\\\n    captureStackTrace(this, CapturedTrace);\\\\n    if (length > 32) this.uncycle();\\\\n}\\\\nutil.inherits(CapturedTrace, Error);\\\\nContext.CapturedTrace = CapturedTrace;\\\\n\\\\nCapturedTrace.prototype.uncycle = function() {\\\\n    var length = this._length;\\\\n    if (length < 2) return;\\\\n    var nodes = [];\\\\n    var stackToIndex = {};\\\\n\\\\n    for (var i = 0, node = this; node !== undefined; ++i) {\\\\n        nodes.push(node);\\\\n        node = node._parent;\\\\n    }\\\\n    length = this._length = i;\\\\n    for (var i = length - 1; i >= 0; --i) {\\\\n        var stack = nodes[i].stack;\\\\n        if (stackToIndex[stack] === undefined) {\\\\n            stackToIndex[stack] = i;\\\\n        }\\\\n    }\\\\n    for (var i = 0; i < length; ++i) {\\\\n        var currentStack = nodes[i].stack;\\\\n        var index = stackToIndex[currentStack];\\\\n        if (index !== undefined && index !== i) {\\\\n            if (index > 0) {\\\\n                nodes[index - 1]._parent = undefined;\\\\n                nodes[index - 1]._length = 1;\\\\n            }\\\\n            nodes[i]._parent = undefined;\\\\n            nodes[i]._length = 1;\\\\n            var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\\\\n\\\\n            if (index < length - 1) {\\\\n                cycleEdgeNode._parent = nodes[index + 1];\\\\n                cycleEdgeNode._parent.uncycle();\\\\n                cycleEdgeNode._length =\\\\n                    cycleEdgeNode._parent._length + 1;\\\\n            } else {\\\\n                cycleEdgeNode._parent = undefined;\\\\n                cycleEdgeNode._length = 1;\\\\n            }\\\\n            var currentChildLength = cycleEdgeNode._length + 1;\\\\n            for (var j = i - 2; j >= 0; --j) {\\\\n                nodes[j]._length = currentChildLength;\\\\n                currentChildLength++;\\\\n            }\\\\n            return;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nCapturedTrace.prototype.attachExtraTrace = function(error) {\\\\n    if (error.__stackCleaned__) return;\\\\n    this.uncycle();\\\\n    var parsed = parseStackAndMessage(error);\\\\n    var message = parsed.message;\\\\n    var stacks = [parsed.stack];\\\\n\\\\n    var trace = this;\\\\n    while (trace !== undefined) {\\\\n        stacks.push(cleanStack(trace.stack.split(\\"\\\\\\\\n\\")));\\\\n        trace = trace._parent;\\\\n    }\\\\n    removeCommonRoots(stacks);\\\\n    removeDuplicateOrEmptyJumps(stacks);\\\\n    util.notEnumerableProp(error, \\"stack\\", reconstructStack(message, stacks));\\\\n    util.notEnumerableProp(error, \\"__stackCleaned__\\", true);\\\\n};\\\\n\\\\nvar captureStackTrace = (function stackDetection() {\\\\n    var v8stackFramePattern = /^\\\\\\\\s*at\\\\\\\\s*/;\\\\n    var v8stackFormatter = function(stack, error) {\\\\n        if (typeof stack === \\"string\\") return stack;\\\\n\\\\n        if (error.name !== undefined &&\\\\n            error.message !== undefined) {\\\\n            return error.toString();\\\\n        }\\\\n        return formatNonError(error);\\\\n    };\\\\n\\\\n    if (typeof Error.stackTraceLimit === \\"number\\" &&\\\\n        typeof Error.captureStackTrace === \\"function\\") {\\\\n        Error.stackTraceLimit += 6;\\\\n        stackFramePattern = v8stackFramePattern;\\\\n        formatStack = v8stackFormatter;\\\\n        var captureStackTrace = Error.captureStackTrace;\\\\n\\\\n        shouldIgnore = function(line) {\\\\n            return bluebirdFramePattern.test(line);\\\\n        };\\\\n        return function(receiver, ignoreUntil) {\\\\n            Error.stackTraceLimit += 6;\\\\n            captureStackTrace(receiver, ignoreUntil);\\\\n            Error.stackTraceLimit -= 6;\\\\n        };\\\\n    }\\\\n    var err = new Error();\\\\n\\\\n    if (typeof err.stack === \\"string\\" &&\\\\n        err.stack.split(\\"\\\\\\\\n\\")[0].indexOf(\\"stackDetection@\\") >= 0) {\\\\n        stackFramePattern = /@/;\\\\n        formatStack = v8stackFormatter;\\\\n        indentStackFrames = true;\\\\n        return function captureStackTrace(o) {\\\\n            o.stack = new Error().stack;\\\\n        };\\\\n    }\\\\n\\\\n    var hasStackAfterThrow;\\\\n    try { throw new Error(); }\\\\n    catch(e) {\\\\n        hasStackAfterThrow = (\\"stack\\" in e);\\\\n    }\\\\n    if (!(\\"stack\\" in err) && hasStackAfterThrow &&\\\\n        typeof Error.stackTraceLimit === \\"number\\") {\\\\n        stackFramePattern = v8stackFramePattern;\\\\n        formatStack = v8stackFormatter;\\\\n        return function captureStackTrace(o) {\\\\n            Error.stackTraceLimit += 6;\\\\n            try { throw new Error(); }\\\\n            catch(e) { o.stack = e.stack; }\\\\n            Error.stackTraceLimit -= 6;\\\\n        };\\\\n    }\\\\n\\\\n    formatStack = function(stack, error) {\\\\n        if (typeof stack === \\"string\\") return stack;\\\\n\\\\n        if ((typeof error === \\"object\\" ||\\\\n            typeof error === \\"function\\") &&\\\\n            error.name !== undefined &&\\\\n            error.message !== undefined) {\\\\n            return error.toString();\\\\n        }\\\\n        return formatNonError(error);\\\\n    };\\\\n\\\\n    return null;\\\\n\\\\n})([]);\\\\n\\\\nif (typeof console !== \\"undefined\\" && typeof console.warn !== \\"undefined\\") {\\\\n    printWarning = function (message) {\\\\n        console.warn(message);\\\\n    };\\\\n    if (util.isNode && process.stderr.isTTY) {\\\\n        printWarning = function(message, isSoft) {\\\\n            var color = isSoft ? \\"\\\\\\\\u001b[33m\\" : \\"\\\\\\\\u001b[31m\\";\\\\n            console.warn(color + message + \\"\\\\\\\\u001b[0m\\\\\\\\n\\");\\\\n        };\\\\n    } else if (!util.isNode && typeof (new Error().stack) === \\"string\\") {\\\\n        printWarning = function(message, isSoft) {\\\\n            console.warn(\\"%c\\" + message,\\\\n                        isSoft ? \\"color: darkorange\\" : \\"color: red\\");\\\\n        };\\\\n    }\\\\n}\\\\n\\\\nvar config = {\\\\n    warnings: warnings,\\\\n    longStackTraces: false,\\\\n    cancellation: false,\\\\n    monitoring: false\\\\n};\\\\n\\\\nif (longStackTraces) Promise.longStackTraces();\\\\n\\\\nreturn {\\\\n    longStackTraces: function() {\\\\n        return config.longStackTraces;\\\\n    },\\\\n    warnings: function() {\\\\n        return config.warnings;\\\\n    },\\\\n    cancellation: function() {\\\\n        return config.cancellation;\\\\n    },\\\\n    monitoring: function() {\\\\n        return config.monitoring;\\\\n    },\\\\n    propagateFromFunction: function() {\\\\n        return propagateFromFunction;\\\\n    },\\\\n    boundValueFunction: function() {\\\\n        return boundValueFunction;\\\\n    },\\\\n    checkForgottenReturns: checkForgottenReturns,\\\\n    setBounds: setBounds,\\\\n    warn: warn,\\\\n    deprecated: deprecated,\\\\n    CapturedTrace: CapturedTrace,\\\\n    fireDomEvent: fireDomEvent,\\\\n    fireGlobalEvent: fireGlobalEvent\\\\n};\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],10:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nfunction returner() {\\\\n    return this.value;\\\\n}\\\\nfunction thrower() {\\\\n    throw this.reason;\\\\n}\\\\n\\\\nPromise.prototype[\\"return\\"] =\\\\nPromise.prototype.thenReturn = function (value) {\\\\n    if (value instanceof Promise) value.suppressUnhandledRejections();\\\\n    return this._then(\\\\n        returner, undefined, undefined, {value: value}, undefined);\\\\n};\\\\n\\\\nPromise.prototype[\\"throw\\"] =\\\\nPromise.prototype.thenThrow = function (reason) {\\\\n    return this._then(\\\\n        thrower, undefined, undefined, {reason: reason}, undefined);\\\\n};\\\\n\\\\nPromise.prototype.catchThrow = function (reason) {\\\\n    if (arguments.length <= 1) {\\\\n        return this._then(\\\\n            undefined, thrower, undefined, {reason: reason}, undefined);\\\\n    } else {\\\\n        var _reason = arguments[1];\\\\n        var handler = function() {throw _reason;};\\\\n        return this.caught(reason, handler);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype.catchReturn = function (value) {\\\\n    if (arguments.length <= 1) {\\\\n        if (value instanceof Promise) value.suppressUnhandledRejections();\\\\n        return this._then(\\\\n            undefined, returner, undefined, {value: value}, undefined);\\\\n    } else {\\\\n        var _value = arguments[1];\\\\n        if (_value instanceof Promise) _value.suppressUnhandledRejections();\\\\n        var handler = function() {return _value;};\\\\n        return this.caught(value, handler);\\\\n    }\\\\n};\\\\n};\\\\n\\\\n},{}],11:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar PromiseReduce = Promise.reduce;\\\\nvar PromiseAll = Promise.all;\\\\n\\\\nfunction promiseAllThis() {\\\\n    return PromiseAll(this);\\\\n}\\\\n\\\\nfunction PromiseMapSeries(promises, fn) {\\\\n    return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\\\\n}\\\\n\\\\nPromise.prototype.each = function (fn) {\\\\n    return this.mapSeries(fn)\\\\n            ._then(promiseAllThis, undefined, undefined, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype.mapSeries = function (fn) {\\\\n    return PromiseReduce(this, fn, INTERNAL, INTERNAL);\\\\n};\\\\n\\\\nPromise.each = function (promises, fn) {\\\\n    return PromiseMapSeries(promises, fn)\\\\n            ._then(promiseAllThis, undefined, undefined, promises, undefined);\\\\n};\\\\n\\\\nPromise.mapSeries = PromiseMapSeries;\\\\n};\\\\n\\\\n},{}],12:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Objectfreeze = es5.freeze;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar inherits = util.inherits;\\\\nvar notEnumerableProp = util.notEnumerableProp;\\\\n\\\\nfunction subError(nameProperty, defaultMessage) {\\\\n    function SubError(message) {\\\\n        if (!(this instanceof SubError)) return new SubError(message);\\\\n        notEnumerableProp(this, \\"message\\",\\\\n            typeof message === \\"string\\" ? message : defaultMessage);\\\\n        notEnumerableProp(this, \\"name\\", nameProperty);\\\\n        if (Error.captureStackTrace) {\\\\n            Error.captureStackTrace(this, this.constructor);\\\\n        } else {\\\\n            Error.call(this);\\\\n        }\\\\n    }\\\\n    inherits(SubError, Error);\\\\n    return SubError;\\\\n}\\\\n\\\\nvar _TypeError, _RangeError;\\\\nvar Warning = subError(\\"Warning\\", \\"warning\\");\\\\nvar CancellationError = subError(\\"CancellationError\\", \\"cancellation error\\");\\\\nvar TimeoutError = subError(\\"TimeoutError\\", \\"timeout error\\");\\\\nvar AggregateError = subError(\\"AggregateError\\", \\"aggregate error\\");\\\\ntry {\\\\n    _TypeError = TypeError;\\\\n    _RangeError = RangeError;\\\\n} catch(e) {\\\\n    _TypeError = subError(\\"TypeError\\", \\"type error\\");\\\\n    _RangeError = subError(\\"RangeError\\", \\"range error\\");\\\\n}\\\\n\\\\nvar methods = (\\"join pop push shift unshift slice filter forEach some \\" +\\\\n    \\"every map indexOf lastIndexOf reduce reduceRight sort reverse\\").split(\\" \\");\\\\n\\\\nfor (var i = 0; i < methods.length; ++i) {\\\\n    if (typeof Array.prototype[methods[i]] === \\"function\\") {\\\\n        AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\\\\n    }\\\\n}\\\\n\\\\nes5.defineProperty(AggregateError.prototype, \\"length\\", {\\\\n    value: 0,\\\\n    configurable: false,\\\\n    writable: true,\\\\n    enumerable: true\\\\n});\\\\nAggregateError.prototype[\\"isOperational\\"] = true;\\\\nvar level = 0;\\\\nAggregateError.prototype.toString = function() {\\\\n    var indent = Array(level * 4 + 1).join(\\" \\");\\\\n    var ret = \\"\\\\\\\\n\\" + indent + \\"AggregateError of:\\" + \\"\\\\\\\\n\\";\\\\n    level++;\\\\n    indent = Array(level * 4 + 1).join(\\" \\");\\\\n    for (var i = 0; i < this.length; ++i) {\\\\n        var str = this[i] === this ? \\"[Circular AggregateError]\\" : this[i] + \\"\\";\\\\n        var lines = str.split(\\"\\\\\\\\n\\");\\\\n        for (var j = 0; j < lines.length; ++j) {\\\\n            lines[j] = indent + lines[j];\\\\n        }\\\\n        str = lines.join(\\"\\\\\\\\n\\");\\\\n        ret += str + \\"\\\\\\\\n\\";\\\\n    }\\\\n    level--;\\\\n    return ret;\\\\n};\\\\n\\\\nfunction OperationalError(message) {\\\\n    if (!(this instanceof OperationalError))\\\\n        return new OperationalError(message);\\\\n    notEnumerableProp(this, \\"name\\", \\"OperationalError\\");\\\\n    notEnumerableProp(this, \\"message\\", message);\\\\n    this.cause = message;\\\\n    this[\\"isOperational\\"] = true;\\\\n\\\\n    if (message instanceof Error) {\\\\n        notEnumerableProp(this, \\"message\\", message.message);\\\\n        notEnumerableProp(this, \\"stack\\", message.stack);\\\\n    } else if (Error.captureStackTrace) {\\\\n        Error.captureStackTrace(this, this.constructor);\\\\n    }\\\\n\\\\n}\\\\ninherits(OperationalError, Error);\\\\n\\\\nvar errorTypes = Error[\\"__BluebirdErrorTypes__\\"];\\\\nif (!errorTypes) {\\\\n    errorTypes = Objectfreeze({\\\\n        CancellationError: CancellationError,\\\\n        TimeoutError: TimeoutError,\\\\n        OperationalError: OperationalError,\\\\n        RejectionError: OperationalError,\\\\n        AggregateError: AggregateError\\\\n    });\\\\n    es5.defineProperty(Error, \\"__BluebirdErrorTypes__\\", {\\\\n        value: errorTypes,\\\\n        writable: false,\\\\n        enumerable: false,\\\\n        configurable: false\\\\n    });\\\\n}\\\\n\\\\nmodule.exports = {\\\\n    Error: Error,\\\\n    TypeError: _TypeError,\\\\n    RangeError: _RangeError,\\\\n    CancellationError: errorTypes.CancellationError,\\\\n    OperationalError: errorTypes.OperationalError,\\\\n    TimeoutError: errorTypes.TimeoutError,\\\\n    AggregateError: errorTypes.AggregateError,\\\\n    Warning: Warning\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],13:[function(_dereq_,module,exports){\\\\nvar isES5 = (function(){\\\\n    \\"use strict\\";\\\\n    return this === undefined;\\\\n})();\\\\n\\\\nif (isES5) {\\\\n    module.exports = {\\\\n        freeze: Object.freeze,\\\\n        defineProperty: Object.defineProperty,\\\\n        getDescriptor: Object.getOwnPropertyDescriptor,\\\\n        keys: Object.keys,\\\\n        names: Object.getOwnPropertyNames,\\\\n        getPrototypeOf: Object.getPrototypeOf,\\\\n        isArray: Array.isArray,\\\\n        isES5: isES5,\\\\n        propertyIsWritable: function(obj, prop) {\\\\n            var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\\\\n            return !!(!descriptor || descriptor.writable || descriptor.set);\\\\n        }\\\\n    };\\\\n} else {\\\\n    var has = {}.hasOwnProperty;\\\\n    var str = {}.toString;\\\\n    var proto = {}.constructor.prototype;\\\\n\\\\n    var ObjectKeys = function (o) {\\\\n        var ret = [];\\\\n        for (var key in o) {\\\\n            if (has.call(o, key)) {\\\\n                ret.push(key);\\\\n            }\\\\n        }\\\\n        return ret;\\\\n    };\\\\n\\\\n    var ObjectGetDescriptor = function(o, key) {\\\\n        return {value: o[key]};\\\\n    };\\\\n\\\\n    var ObjectDefineProperty = function (o, key, desc) {\\\\n        o[key] = desc.value;\\\\n        return o;\\\\n    };\\\\n\\\\n    var ObjectFreeze = function (obj) {\\\\n        return obj;\\\\n    };\\\\n\\\\n    var ObjectGetPrototypeOf = function (obj) {\\\\n        try {\\\\n            return Object(obj).constructor.prototype;\\\\n        }\\\\n        catch (e) {\\\\n            return proto;\\\\n        }\\\\n    };\\\\n\\\\n    var ArrayIsArray = function (obj) {\\\\n        try {\\\\n            return str.call(obj) === \\"[object Array]\\";\\\\n        }\\\\n        catch(e) {\\\\n            return false;\\\\n        }\\\\n    };\\\\n\\\\n    module.exports = {\\\\n        isArray: ArrayIsArray,\\\\n        keys: ObjectKeys,\\\\n        names: ObjectKeys,\\\\n        defineProperty: ObjectDefineProperty,\\\\n        getDescriptor: ObjectGetDescriptor,\\\\n        freeze: ObjectFreeze,\\\\n        getPrototypeOf: ObjectGetPrototypeOf,\\\\n        isES5: isES5,\\\\n        propertyIsWritable: function() {\\\\n            return true;\\\\n        }\\\\n    };\\\\n}\\\\n\\\\n},{}],14:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar PromiseMap = Promise.map;\\\\n\\\\nPromise.prototype.filter = function (fn, options) {\\\\n    return PromiseMap(this, fn, options, INTERNAL);\\\\n};\\\\n\\\\nPromise.filter = function (promises, fn, options) {\\\\n    return PromiseMap(promises, fn, options, INTERNAL);\\\\n};\\\\n};\\\\n\\\\n},{}],15:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, tryConvertToPromise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar CancellationError = Promise.CancellationError;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction PassThroughHandlerContext(promise, type, handler) {\\\\n    this.promise = promise;\\\\n    this.type = type;\\\\n    this.handler = handler;\\\\n    this.called = false;\\\\n    this.cancelPromise = null;\\\\n}\\\\n\\\\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\\\\n    return this.type === 0;\\\\n};\\\\n\\\\nfunction FinallyHandlerCancelReaction(finallyHandler) {\\\\n    this.finallyHandler = finallyHandler;\\\\n}\\\\n\\\\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\\\\n    checkCancel(this.finallyHandler);\\\\n};\\\\n\\\\nfunction checkCancel(ctx, reason) {\\\\n    if (ctx.cancelPromise != null) {\\\\n        if (arguments.length > 1) {\\\\n            ctx.cancelPromise._reject(reason);\\\\n        } else {\\\\n            ctx.cancelPromise._cancel();\\\\n        }\\\\n        ctx.cancelPromise = null;\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n}\\\\n\\\\nfunction succeed() {\\\\n    return finallyHandler.call(this, this.promise._target()._settledValue());\\\\n}\\\\nfunction fail(reason) {\\\\n    if (checkCancel(this, reason)) return;\\\\n    errorObj.e = reason;\\\\n    return errorObj;\\\\n}\\\\nfunction finallyHandler(reasonOrValue) {\\\\n    var promise = this.promise;\\\\n    var handler = this.handler;\\\\n\\\\n    if (!this.called) {\\\\n        this.called = true;\\\\n        var ret = this.isFinallyHandler()\\\\n            ? handler.call(promise._boundValue())\\\\n            : handler.call(promise._boundValue(), reasonOrValue);\\\\n        if (ret !== undefined) {\\\\n            promise._setReturnedNonUndefined();\\\\n            var maybePromise = tryConvertToPromise(ret, promise);\\\\n            if (maybePromise instanceof Promise) {\\\\n                if (this.cancelPromise != null) {\\\\n                    if (maybePromise.isCancelled()) {\\\\n                        var reason =\\\\n                            new CancellationError(\\"late cancellation observer\\");\\\\n                        promise._attachExtraTrace(reason);\\\\n                        errorObj.e = reason;\\\\n                        return errorObj;\\\\n                    } else if (maybePromise.isPending()) {\\\\n                        maybePromise._attachCancellationCallback(\\\\n                            new FinallyHandlerCancelReaction(this));\\\\n                    }\\\\n                }\\\\n                return maybePromise._then(\\\\n                    succeed, fail, undefined, this, undefined);\\\\n            }\\\\n        }\\\\n    }\\\\n\\\\n    if (promise.isRejected()) {\\\\n        checkCancel(this);\\\\n        errorObj.e = reasonOrValue;\\\\n        return errorObj;\\\\n    } else {\\\\n        checkCancel(this);\\\\n        return reasonOrValue;\\\\n    }\\\\n}\\\\n\\\\nPromise.prototype._passThrough = function(handler, type, success, fail) {\\\\n    if (typeof handler !== \\"function\\") return this.then();\\\\n    return this._then(success,\\\\n                      fail,\\\\n                      undefined,\\\\n                      new PassThroughHandlerContext(this, type, handler),\\\\n                      undefined);\\\\n};\\\\n\\\\nPromise.prototype.lastly =\\\\nPromise.prototype[\\"finally\\"] = function (handler) {\\\\n    return this._passThrough(handler,\\\\n                             0,\\\\n                             finallyHandler,\\\\n                             finallyHandler);\\\\n};\\\\n\\\\nPromise.prototype.tap = function (handler) {\\\\n    return this._passThrough(handler, 1, finallyHandler);\\\\n};\\\\n\\\\nreturn PassThroughHandlerContext;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],16:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          apiRejection,\\\\n                          INTERNAL,\\\\n                          tryConvertToPromise,\\\\n                          Proxyable,\\\\n                          debug) {\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar TypeError = errors.TypeError;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar errorObj = util.errorObj;\\\\nvar tryCatch = util.tryCatch;\\\\nvar yieldHandlers = [];\\\\n\\\\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\\\\n    for (var i = 0; i < yieldHandlers.length; ++i) {\\\\n        traceParent._pushContext();\\\\n        var result = tryCatch(yieldHandlers[i])(value);\\\\n        traceParent._popContext();\\\\n        if (result === errorObj) {\\\\n            traceParent._pushContext();\\\\n            var ret = Promise.reject(errorObj.e);\\\\n            traceParent._popContext();\\\\n            return ret;\\\\n        }\\\\n        var maybePromise = tryConvertToPromise(result, traceParent);\\\\n        if (maybePromise instanceof Promise) return maybePromise;\\\\n    }\\\\n    return null;\\\\n}\\\\n\\\\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\\\\n    var promise = this._promise = new Promise(INTERNAL);\\\\n    promise._captureStackTrace();\\\\n    promise._setOnCancel(this);\\\\n    this._stack = stack;\\\\n    this._generatorFunction = generatorFunction;\\\\n    this._receiver = receiver;\\\\n    this._generator = undefined;\\\\n    this._yieldHandlers = typeof yieldHandler === \\"function\\"\\\\n        ? [yieldHandler].concat(yieldHandlers)\\\\n        : yieldHandlers;\\\\n    this._yieldedPromise = null;\\\\n}\\\\nutil.inherits(PromiseSpawn, Proxyable);\\\\n\\\\nPromiseSpawn.prototype._isResolved = function() {\\\\n    return this._promise === null;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._cleanup = function() {\\\\n    this._promise = this._generator = null;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseCancelled = function() {\\\\n    if (this._isResolved()) return;\\\\n    var implementsReturn = typeof this._generator[\\"return\\"] !== \\"undefined\\";\\\\n\\\\n    var result;\\\\n    if (!implementsReturn) {\\\\n        var reason = new Promise.CancellationError(\\\\n            \\"generator .return() sentinel\\");\\\\n        Promise.coroutine.returnSentinel = reason;\\\\n        this._promise._attachExtraTrace(reason);\\\\n        this._promise._pushContext();\\\\n        result = tryCatch(this._generator[\\"throw\\"]).call(this._generator,\\\\n                                                         reason);\\\\n        this._promise._popContext();\\\\n        if (result === errorObj && result.e === reason) {\\\\n            result = null;\\\\n        }\\\\n    } else {\\\\n        this._promise._pushContext();\\\\n        result = tryCatch(this._generator[\\"return\\"]).call(this._generator,\\\\n                                                          undefined);\\\\n        this._promise._popContext();\\\\n    }\\\\n    var promise = this._promise;\\\\n    this._cleanup();\\\\n    if (result === errorObj) {\\\\n        promise._rejectCallback(result.e, false);\\\\n    } else {\\\\n        promise.cancel();\\\\n    }\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\\\\n    this._yieldedPromise = null;\\\\n    this._promise._pushContext();\\\\n    var result = tryCatch(this._generator.next).call(this._generator, value);\\\\n    this._promise._popContext();\\\\n    this._continue(result);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseRejected = function(reason) {\\\\n    this._yieldedPromise = null;\\\\n    this._promise._attachExtraTrace(reason);\\\\n    this._promise._pushContext();\\\\n    var result = tryCatch(this._generator[\\"throw\\"])\\\\n        .call(this._generator, reason);\\\\n    this._promise._popContext();\\\\n    this._continue(result);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._resultCancelled = function() {\\\\n    if (this._yieldedPromise instanceof Promise) {\\\\n        var promise = this._yieldedPromise;\\\\n        this._yieldedPromise = null;\\\\n        promise.cancel();\\\\n    }\\\\n};\\\\n\\\\nPromiseSpawn.prototype.promise = function () {\\\\n    return this._promise;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._run = function () {\\\\n    this._generator = this._generatorFunction.call(this._receiver);\\\\n    this._receiver =\\\\n        this._generatorFunction = undefined;\\\\n    this._promiseFulfilled(undefined);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._continue = function (result) {\\\\n    var promise = this._promise;\\\\n    if (result === errorObj) {\\\\n        this._cleanup();\\\\n        return promise._rejectCallback(result.e, false);\\\\n    }\\\\n\\\\n    var value = result.value;\\\\n    if (result.done === true) {\\\\n        this._cleanup();\\\\n        return promise._resolveCallback(value);\\\\n    } else {\\\\n        var maybePromise = tryConvertToPromise(value, this._promise);\\\\n        if (!(maybePromise instanceof Promise)) {\\\\n            maybePromise =\\\\n                promiseFromYieldHandler(maybePromise,\\\\n                                        this._yieldHandlers,\\\\n                                        this._promise);\\\\n            if (maybePromise === null) {\\\\n                this._promiseRejected(\\\\n                    new TypeError(\\\\n                        \\"A value %s was yielded that could not be treated as a promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\\\\\\\u000a\\".replace(\\"%s\\", value) +\\\\n                        \\"From coroutine:\\\\\\\\u000a\\" +\\\\n                        this._stack.split(\\"\\\\\\\\n\\").slice(1, -7).join(\\"\\\\\\\\n\\")\\\\n                    )\\\\n                );\\\\n                return;\\\\n            }\\\\n        }\\\\n        maybePromise = maybePromise._target();\\\\n        var bitField = maybePromise._bitField;\\\\n        ;\\\\n        if (((bitField & 50397184) === 0)) {\\\\n            this._yieldedPromise = maybePromise;\\\\n            maybePromise._proxy(this, null);\\\\n        } else if (((bitField & 33554432) !== 0)) {\\\\n            this._promiseFulfilled(maybePromise._value());\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            this._promiseRejected(maybePromise._reason());\\\\n        } else {\\\\n            this._promiseCancelled();\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.coroutine = function (generatorFunction, options) {\\\\n    if (typeof generatorFunction !== \\"function\\") {\\\\n        throw new TypeError(\\"generatorFunction must be a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var yieldHandler = Object(options).yieldHandler;\\\\n    var PromiseSpawn$ = PromiseSpawn;\\\\n    var stack = new Error().stack;\\\\n    return function () {\\\\n        var generator = generatorFunction.apply(this, arguments);\\\\n        var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\\\\n                                      stack);\\\\n        var ret = spawn.promise();\\\\n        spawn._generator = generator;\\\\n        spawn._promiseFulfilled(undefined);\\\\n        return ret;\\\\n    };\\\\n};\\\\n\\\\nPromise.coroutine.addYieldHandler = function(fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    yieldHandlers.push(fn);\\\\n};\\\\n\\\\nPromise.spawn = function (generatorFunction) {\\\\n    debug.deprecated(\\"Promise.spawn()\\", \\"Promise.coroutine()\\");\\\\n    if (typeof generatorFunction !== \\"function\\") {\\\\n        return apiRejection(\\"generatorFunction must be a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var spawn = new PromiseSpawn(generatorFunction, this);\\\\n    var ret = spawn.promise();\\\\n    spawn._run(Promise.spawn);\\\\n    return ret;\\\\n};\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],17:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar reject;\\\\n\\\\nif (false) {\\\\nif (canEvaluate) {\\\\n    var thenCallback = function(i) {\\\\n        return new Function(\\"value\\", \\"holder\\", \\"                             \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            holder.pIndex = value;                                           \\\\\\\\n\\\\\\\\\\\\n            holder.checkFulfillment(this);                                   \\\\\\\\n\\\\\\\\\\\\n            \\".replace(/Index/g, i));\\\\n    };\\\\n\\\\n    var promiseSetter = function(i) {\\\\n        return new Function(\\"promise\\", \\"holder\\", \\"                           \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            holder.pIndex = promise;                                         \\\\\\\\n\\\\\\\\\\\\n            \\".replace(/Index/g, i));\\\\n    };\\\\n\\\\n    var generateHolderClass = function(total) {\\\\n        var props = new Array(total);\\\\n        for (var i = 0; i < props.length; ++i) {\\\\n            props[i] = \\"this.p\\" + (i+1);\\\\n        }\\\\n        var assignment = props.join(\\" = \\") + \\" = null;\\";\\\\n        var cancellationCode= \\"var promise;\\\\\\\\n\\" + props.map(function(prop) {\\\\n            return \\"                                                         \\\\\\\\n\\\\\\\\\\\\n                promise = \\" + prop + \\";                                      \\\\\\\\n\\\\\\\\\\\\n                if (promise instanceof Promise) {                            \\\\\\\\n\\\\\\\\\\\\n                    promise.cancel();                                        \\\\\\\\n\\\\\\\\\\\\n                }                                                            \\\\\\\\n\\\\\\\\\\\\n            \\";\\\\n        }).join(\\"\\\\\\\\n\\");\\\\n        var passedArguments = props.join(\\", \\");\\\\n        var name = \\"Holder$\\" + total;\\\\n\\\\n\\\\n        var code = \\"return function(tryCatch, errorObj, Promise) {           \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            function [TheName](fn) {                                         \\\\\\\\n\\\\\\\\\\\\n                [TheProperties]                                              \\\\\\\\n\\\\\\\\\\\\n                this.fn = fn;                                                \\\\\\\\n\\\\\\\\\\\\n                this.now = 0;                                                \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            [TheName].prototype.checkFulfillment = function(promise) {       \\\\\\\\n\\\\\\\\\\\\n                var now = ++this.now;                                        \\\\\\\\n\\\\\\\\\\\\n                if (now === [TheTotal]) {                                    \\\\\\\\n\\\\\\\\\\\\n                    promise._pushContext();                                  \\\\\\\\n\\\\\\\\\\\\n                    var callback = this.fn;                                  \\\\\\\\n\\\\\\\\\\\\n                    var ret = tryCatch(callback)([ThePassedArguments]);      \\\\\\\\n\\\\\\\\\\\\n                    promise._popContext();                                   \\\\\\\\n\\\\\\\\\\\\n                    if (ret === errorObj) {                                  \\\\\\\\n\\\\\\\\\\\\n                        promise._rejectCallback(ret.e, false);               \\\\\\\\n\\\\\\\\\\\\n                    } else {                                                 \\\\\\\\n\\\\\\\\\\\\n                        promise._resolveCallback(ret);                       \\\\\\\\n\\\\\\\\\\\\n                    }                                                        \\\\\\\\n\\\\\\\\\\\\n                }                                                            \\\\\\\\n\\\\\\\\\\\\n            };                                                               \\\\\\\\n\\\\\\\\\\\\n                                                                             \\\\\\\\n\\\\\\\\\\\\n            [TheName].prototype._resultCancelled = function() {              \\\\\\\\n\\\\\\\\\\\\n                [CancellationCode]                                           \\\\\\\\n\\\\\\\\\\\\n            };                                                               \\\\\\\\n\\\\\\\\\\\\n                                                                             \\\\\\\\n\\\\\\\\\\\\n            return [TheName];                                                \\\\\\\\n\\\\\\\\\\\\n        }(tryCatch, errorObj, Promise);                                      \\\\\\\\n\\\\\\\\\\\\n        \\";\\\\n\\\\n        code = code.replace(/\\\\\\\\[TheName\\\\\\\\]/g, name)\\\\n            .replace(/\\\\\\\\[TheTotal\\\\\\\\]/g, total)\\\\n            .replace(/\\\\\\\\[ThePassedArguments\\\\\\\\]/g, passedArguments)\\\\n            .replace(/\\\\\\\\[TheProperties\\\\\\\\]/g, assignment)\\\\n            .replace(/\\\\\\\\[CancellationCode\\\\\\\\]/g, cancellationCode);\\\\n\\\\n        return new Function(\\"tryCatch\\", \\"errorObj\\", \\"Promise\\", code)\\\\n                           (tryCatch, errorObj, Promise);\\\\n    };\\\\n\\\\n    var holderClasses = [];\\\\n    var thenCallbacks = [];\\\\n    var promiseSetters = [];\\\\n\\\\n    for (var i = 0; i < 8; ++i) {\\\\n        holderClasses.push(generateHolderClass(i + 1));\\\\n        thenCallbacks.push(thenCallback(i + 1));\\\\n        promiseSetters.push(promiseSetter(i + 1));\\\\n    }\\\\n\\\\n    reject = function (reason) {\\\\n        this._reject(reason);\\\\n    };\\\\n}}\\\\n\\\\nPromise.join = function () {\\\\n    var last = arguments.length - 1;\\\\n    var fn;\\\\n    if (last > 0 && typeof arguments[last] === \\"function\\") {\\\\n        fn = arguments[last];\\\\n        if (false) {\\\\n            if (last <= 8 && canEvaluate) {\\\\n                var ret = new Promise(INTERNAL);\\\\n                ret._captureStackTrace();\\\\n                var HolderClass = holderClasses[last - 1];\\\\n                var holder = new HolderClass(fn);\\\\n                var callbacks = thenCallbacks;\\\\n\\\\n                for (var i = 0; i < last; ++i) {\\\\n                    var maybePromise = tryConvertToPromise(arguments[i], ret);\\\\n                    if (maybePromise instanceof Promise) {\\\\n                        maybePromise = maybePromise._target();\\\\n                        var bitField = maybePromise._bitField;\\\\n                        ;\\\\n                        if (((bitField & 50397184) === 0)) {\\\\n                            maybePromise._then(callbacks[i], reject,\\\\n                                               undefined, ret, holder);\\\\n                            promiseSetters[i](maybePromise, holder);\\\\n                        } else if (((bitField & 33554432) !== 0)) {\\\\n                            callbacks[i].call(ret,\\\\n                                              maybePromise._value(), holder);\\\\n                        } else if (((bitField & 16777216) !== 0)) {\\\\n                            ret._reject(maybePromise._reason());\\\\n                        } else {\\\\n                            ret._cancel();\\\\n                        }\\\\n                    } else {\\\\n                        callbacks[i].call(ret, maybePromise, holder);\\\\n                    }\\\\n                }\\\\n                if (!ret._isFateSealed()) {\\\\n                    ret._setAsyncGuaranteed();\\\\n                    ret._setOnCancel(holder);\\\\n                }\\\\n                return ret;\\\\n            }\\\\n        }\\\\n    }\\\\n    var args = [].slice.call(arguments);;\\\\n    if (fn) args.pop();\\\\n    var ret = new PromiseArray(args).promise();\\\\n    return fn !== undefined ? ret.spread(fn) : ret;\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],18:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          PromiseArray,\\\\n                          apiRejection,\\\\n                          tryConvertToPromise,\\\\n                          INTERNAL,\\\\n                          debug) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar EMPTY_ARRAY = [];\\\\n\\\\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\\\\n    this.constructor$(promises);\\\\n    this._promise._captureStackTrace();\\\\n    var domain = getDomain();\\\\n    this._callback = domain === null ? fn : domain.bind(fn);\\\\n    this._preservedValues = _filter === INTERNAL\\\\n        ? new Array(this.length())\\\\n        : null;\\\\n    this._limit = limit;\\\\n    this._inFlight = 0;\\\\n    this._queue = limit >= 1 ? [] : EMPTY_ARRAY;\\\\n    this._init$(undefined, -2);\\\\n}\\\\nutil.inherits(MappingPromiseArray, PromiseArray);\\\\n\\\\nMappingPromiseArray.prototype._init = function () {};\\\\n\\\\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    var values = this._values;\\\\n    var length = this.length();\\\\n    var preservedValues = this._preservedValues;\\\\n    var limit = this._limit;\\\\n\\\\n    if (index < 0) {\\\\n        index = (index * -1) - 1;\\\\n        values[index] = value;\\\\n        if (limit >= 1) {\\\\n            this._inFlight--;\\\\n            this._drainQueue();\\\\n            if (this._isResolved()) return true;\\\\n        }\\\\n    } else {\\\\n        if (limit >= 1 && this._inFlight >= limit) {\\\\n            values[index] = value;\\\\n            this._queue.push(index);\\\\n            return false;\\\\n        }\\\\n        if (preservedValues !== null) preservedValues[index] = value;\\\\n\\\\n        var promise = this._promise;\\\\n        var callback = this._callback;\\\\n        var receiver = promise._boundValue();\\\\n        promise._pushContext();\\\\n        var ret = tryCatch(callback).call(receiver, value, index, length);\\\\n        var promiseCreated = promise._popContext();\\\\n        debug.checkForgottenReturns(\\\\n            ret,\\\\n            promiseCreated,\\\\n            preservedValues !== null ? \\"Promise.filter\\" : \\"Promise.map\\",\\\\n            promise\\\\n        );\\\\n        if (ret === errorObj) {\\\\n            this._reject(ret.e);\\\\n            return true;\\\\n        }\\\\n\\\\n        var maybePromise = tryConvertToPromise(ret, this._promise);\\\\n        if (maybePromise instanceof Promise) {\\\\n            maybePromise = maybePromise._target();\\\\n            var bitField = maybePromise._bitField;\\\\n            ;\\\\n            if (((bitField & 50397184) === 0)) {\\\\n                if (limit >= 1) this._inFlight++;\\\\n                values[index] = maybePromise;\\\\n                maybePromise._proxy(this, (index + 1) * -1);\\\\n                return false;\\\\n            } else if (((bitField & 33554432) !== 0)) {\\\\n                ret = maybePromise._value();\\\\n            } else if (((bitField & 16777216) !== 0)) {\\\\n                this._reject(maybePromise._reason());\\\\n                return true;\\\\n            } else {\\\\n                this._cancel();\\\\n                return true;\\\\n            }\\\\n        }\\\\n        values[index] = ret;\\\\n    }\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= length) {\\\\n        if (preservedValues !== null) {\\\\n            this._filter(values, preservedValues);\\\\n        } else {\\\\n            this._resolve(values);\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nMappingPromiseArray.prototype._drainQueue = function () {\\\\n    var queue = this._queue;\\\\n    var limit = this._limit;\\\\n    var values = this._values;\\\\n    while (queue.length > 0 && this._inFlight < limit) {\\\\n        if (this._isResolved()) return;\\\\n        var index = queue.pop();\\\\n        this._promiseFulfilled(values[index], index);\\\\n    }\\\\n};\\\\n\\\\nMappingPromiseArray.prototype._filter = function (booleans, values) {\\\\n    var len = values.length;\\\\n    var ret = new Array(len);\\\\n    var j = 0;\\\\n    for (var i = 0; i < len; ++i) {\\\\n        if (booleans[i]) ret[j++] = values[i];\\\\n    }\\\\n    ret.length = j;\\\\n    this._resolve(ret);\\\\n};\\\\n\\\\nMappingPromiseArray.prototype.preservedValues = function () {\\\\n    return this._preservedValues;\\\\n};\\\\n\\\\nfunction map(promises, fn, options, _filter) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var limit = typeof options === \\"object\\" && options !== null\\\\n        ? options.concurrency\\\\n        : 0;\\\\n    limit = typeof limit === \\"number\\" &&\\\\n        isFinite(limit) && limit >= 1 ? limit : 0;\\\\n    return new MappingPromiseArray(promises, fn, limit, _filter).promise();\\\\n}\\\\n\\\\nPromise.prototype.map = function (fn, options) {\\\\n    return map(this, fn, options, null);\\\\n};\\\\n\\\\nPromise.map = function (promises, fn, options, _filter) {\\\\n    return map(promises, fn, options, _filter);\\\\n};\\\\n\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],19:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\n\\\\nPromise.method = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new Promise.TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    return function () {\\\\n        var ret = new Promise(INTERNAL);\\\\n        ret._captureStackTrace();\\\\n        ret._pushContext();\\\\n        var value = tryCatch(fn).apply(this, arguments);\\\\n        var promiseCreated = ret._popContext();\\\\n        debug.checkForgottenReturns(\\\\n            value, promiseCreated, \\"Promise.method\\", ret);\\\\n        ret._resolveFromSyncValue(value);\\\\n        return ret;\\\\n    };\\\\n};\\\\n\\\\nPromise.attempt = Promise[\\"try\\"] = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    ret._pushContext();\\\\n    var value;\\\\n    if (arguments.length > 1) {\\\\n        debug.deprecated(\\"calling Promise.try with more than 1 argument\\");\\\\n        var arg = arguments[1];\\\\n        var ctx = arguments[2];\\\\n        value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\\\\n                                  : tryCatch(fn).call(ctx, arg);\\\\n    } else {\\\\n        value = tryCatch(fn)();\\\\n    }\\\\n    var promiseCreated = ret._popContext();\\\\n    debug.checkForgottenReturns(\\\\n        value, promiseCreated, \\"Promise.try\\", ret);\\\\n    ret._resolveFromSyncValue(value);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._resolveFromSyncValue = function (value) {\\\\n    if (value === util.errorObj) {\\\\n        this._rejectCallback(value.e, false);\\\\n    } else {\\\\n        this._resolveCallback(value, true);\\\\n    }\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],20:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar maybeWrapAsError = util.maybeWrapAsError;\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar OperationalError = errors.OperationalError;\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\n\\\\nfunction isUntypedError(obj) {\\\\n    return obj instanceof Error &&\\\\n        es5.getPrototypeOf(obj) === Error.prototype;\\\\n}\\\\n\\\\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\\\\nfunction wrapAsOperationalError(obj) {\\\\n    var ret;\\\\n    if (isUntypedError(obj)) {\\\\n        ret = new OperationalError(obj);\\\\n        ret.name = obj.name;\\\\n        ret.message = obj.message;\\\\n        ret.stack = obj.stack;\\\\n        var keys = es5.keys(obj);\\\\n        for (var i = 0; i < keys.length; ++i) {\\\\n            var key = keys[i];\\\\n            if (!rErrorKey.test(key)) {\\\\n                ret[key] = obj[key];\\\\n            }\\\\n        }\\\\n        return ret;\\\\n    }\\\\n    util.markAsOriginatingFromRejection(obj);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction nodebackForPromise(promise, multiArgs) {\\\\n    return function(err, value) {\\\\n        if (promise === null) return;\\\\n        if (err) {\\\\n            var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\\\\n            promise._attachExtraTrace(wrapped);\\\\n            promise._reject(wrapped);\\\\n        } else if (!multiArgs) {\\\\n            promise._fulfill(value);\\\\n        } else {\\\\n            var args = [].slice.call(arguments, 1);;\\\\n            promise._fulfill(args);\\\\n        }\\\\n        promise = null;\\\\n    };\\\\n}\\\\n\\\\nmodule.exports = nodebackForPromise;\\\\n\\\\n},{\\"./errors\\":12,\\"./es5\\":13,\\"./util\\":36}],21:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar async = Promise._async;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction spreadAdapter(val, nodeback) {\\\\n    var promise = this;\\\\n    if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\\\\n    var ret =\\\\n        tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\n\\\\nfunction successAdapter(val, nodeback) {\\\\n    var promise = this;\\\\n    var receiver = promise._boundValue();\\\\n    var ret = val === undefined\\\\n        ? tryCatch(nodeback).call(receiver, null)\\\\n        : tryCatch(nodeback).call(receiver, null, val);\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\nfunction errorAdapter(reason, nodeback) {\\\\n    var promise = this;\\\\n    if (!reason) {\\\\n        var newReason = new Error(reason + \\"\\");\\\\n        newReason.cause = reason;\\\\n        reason = newReason;\\\\n    }\\\\n    var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\n\\\\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\\\\n                                                                     options) {\\\\n    if (typeof nodeback == \\"function\\") {\\\\n        var adapter = successAdapter;\\\\n        if (options !== undefined && Object(options).spread) {\\\\n            adapter = spreadAdapter;\\\\n        }\\\\n        this._then(\\\\n            adapter,\\\\n            errorAdapter,\\\\n            undefined,\\\\n            this,\\\\n            nodeback\\\\n        );\\\\n    }\\\\n    return this;\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],22:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function() {\\\\nvar makeSelfResolutionError = function () {\\\\n    return new TypeError(\\"circular promise resolution chain\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n};\\\\nvar reflectHandler = function() {\\\\n    return new Promise.PromiseInspection(this._target());\\\\n};\\\\nvar apiRejection = function(msg) {\\\\n    return Promise.reject(new TypeError(msg));\\\\n};\\\\nfunction Proxyable() {}\\\\nvar UNDEFINED_BINDING = {};\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nvar getDomain;\\\\nif (util.isNode) {\\\\n    getDomain = function() {\\\\n        var ret = process.domain;\\\\n        if (ret === undefined) ret = null;\\\\n        return ret;\\\\n    };\\\\n} else {\\\\n    getDomain = function() {\\\\n        return null;\\\\n    };\\\\n}\\\\nutil.notEnumerableProp(Promise, \\"_getDomain\\", getDomain);\\\\n\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Async = _dereq_(\\"./async\\");\\\\nvar async = new Async();\\\\nes5.defineProperty(Promise, \\"_async\\", {value: async});\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar TypeError = Promise.TypeError = errors.TypeError;\\\\nPromise.RangeError = errors.RangeError;\\\\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\\\\nPromise.TimeoutError = errors.TimeoutError;\\\\nPromise.OperationalError = errors.OperationalError;\\\\nPromise.RejectionError = errors.OperationalError;\\\\nPromise.AggregateError = errors.AggregateError;\\\\nvar INTERNAL = function(){};\\\\nvar APPLY = {};\\\\nvar NEXT_FILTER = {};\\\\nvar tryConvertToPromise = _dereq_(\\"./thenables\\")(Promise, INTERNAL);\\\\nvar PromiseArray =\\\\n    _dereq_(\\"./promise_array\\")(Promise, INTERNAL,\\\\n                               tryConvertToPromise, apiRejection, Proxyable);\\\\nvar Context = _dereq_(\\"./context\\")(Promise);\\\\n /*jshint unused:false*/\\\\nvar createContext = Context.create;\\\\nvar debug = _dereq_(\\"./debuggability\\")(Promise, Context);\\\\nvar CapturedTrace = debug.CapturedTrace;\\\\nvar PassThroughHandlerContext =\\\\n    _dereq_(\\"./finally\\")(Promise, tryConvertToPromise);\\\\nvar catchFilter = _dereq_(\\"./catch_filter\\")(NEXT_FILTER);\\\\nvar nodebackForPromise = _dereq_(\\"./nodeback\\");\\\\nvar errorObj = util.errorObj;\\\\nvar tryCatch = util.tryCatch;\\\\nfunction check(self, executor) {\\\\n    if (typeof executor !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(executor));\\\\n    }\\\\n    if (self.constructor !== Promise) {\\\\n        throw new TypeError(\\"the promise constructor cannot be invoked directly\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n}\\\\n\\\\nfunction Promise(executor) {\\\\n    this._bitField = 0;\\\\n    this._fulfillmentHandler0 = undefined;\\\\n    this._rejectionHandler0 = undefined;\\\\n    this._promise0 = undefined;\\\\n    this._receiver0 = undefined;\\\\n    if (executor !== INTERNAL) {\\\\n        check(this, executor);\\\\n        this._resolveFromExecutor(executor);\\\\n    }\\\\n    this._promiseCreated();\\\\n    this._fireEvent(\\"promiseCreated\\", this);\\\\n}\\\\n\\\\nPromise.prototype.toString = function () {\\\\n    return \\"[object Promise]\\";\\\\n};\\\\n\\\\nPromise.prototype.caught = Promise.prototype[\\"catch\\"] = function (fn) {\\\\n    var len = arguments.length;\\\\n    if (len > 1) {\\\\n        var catchInstances = new Array(len - 1),\\\\n            j = 0, i;\\\\n        for (i = 0; i < len - 1; ++i) {\\\\n            var item = arguments[i];\\\\n            if (util.isObject(item)) {\\\\n                catchInstances[j++] = item;\\\\n            } else {\\\\n                return apiRejection(\\"expecting an object but got \\" + util.classString(item));\\\\n            }\\\\n        }\\\\n        catchInstances.length = j;\\\\n        fn = arguments[i];\\\\n        return this.then(undefined, catchFilter(catchInstances, fn, this));\\\\n    }\\\\n    return this.then(undefined, fn);\\\\n};\\\\n\\\\nPromise.prototype.reflect = function () {\\\\n    return this._then(reflectHandler,\\\\n        reflectHandler, undefined, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype.then = function (didFulfill, didReject) {\\\\n    if (debug.warnings() && arguments.length > 0 &&\\\\n        typeof didFulfill !== \\"function\\" &&\\\\n        typeof didReject !== \\"function\\") {\\\\n        var msg = \\".then() only accepts functions but was passed: \\" +\\\\n                util.classString(didFulfill);\\\\n        if (arguments.length > 1) {\\\\n            msg += \\", \\" + util.classString(didReject);\\\\n        }\\\\n        this._warn(msg);\\\\n    }\\\\n    return this._then(didFulfill, didReject, undefined, undefined, undefined);\\\\n};\\\\n\\\\nPromise.prototype.done = function (didFulfill, didReject) {\\\\n    var promise =\\\\n        this._then(didFulfill, didReject, undefined, undefined, undefined);\\\\n    promise._setIsFinal();\\\\n};\\\\n\\\\nPromise.prototype.spread = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    return this.all()._then(fn, undefined, undefined, APPLY, undefined);\\\\n};\\\\n\\\\nPromise.prototype.toJSON = function () {\\\\n    var ret = {\\\\n        isFulfilled: false,\\\\n        isRejected: false,\\\\n        fulfillmentValue: undefined,\\\\n        rejectionReason: undefined\\\\n    };\\\\n    if (this.isFulfilled()) {\\\\n        ret.fulfillmentValue = this.value();\\\\n        ret.isFulfilled = true;\\\\n    } else if (this.isRejected()) {\\\\n        ret.rejectionReason = this.reason();\\\\n        ret.isRejected = true;\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype.all = function () {\\\\n    if (arguments.length > 0) {\\\\n        this._warn(\\".all() was passed arguments but it does not take any\\");\\\\n    }\\\\n    return new PromiseArray(this).promise();\\\\n};\\\\n\\\\nPromise.prototype.error = function (fn) {\\\\n    return this.caught(util.originatesFromRejection, fn);\\\\n};\\\\n\\\\nPromise.is = function (val) {\\\\n    return val instanceof Promise;\\\\n};\\\\n\\\\nPromise.fromNode = Promise.fromCallback = function(fn) {\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\\\\n                                         : false;\\\\n    var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\\\\n    if (result === errorObj) {\\\\n        ret._rejectCallback(result.e, true);\\\\n    }\\\\n    if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.all = function (promises) {\\\\n    return new PromiseArray(promises).promise();\\\\n};\\\\n\\\\nPromise.cast = function (obj) {\\\\n    var ret = tryConvertToPromise(obj);\\\\n    if (!(ret instanceof Promise)) {\\\\n        ret = new Promise(INTERNAL);\\\\n        ret._captureStackTrace();\\\\n        ret._setFulfilled();\\\\n        ret._rejectionHandler0 = obj;\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.resolve = Promise.fulfilled = Promise.cast;\\\\n\\\\nPromise.reject = Promise.rejected = function (reason) {\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    ret._rejectCallback(reason, true);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.setScheduler = function(fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var prev = async._schedule;\\\\n    async._schedule = fn;\\\\n    return prev;\\\\n};\\\\n\\\\nPromise.prototype._then = function (\\\\n    didFulfill,\\\\n    didReject,\\\\n    _,    receiver,\\\\n    internalData\\\\n) {\\\\n    var haveInternalData = internalData !== undefined;\\\\n    var promise = haveInternalData ? internalData : new Promise(INTERNAL);\\\\n    var target = this._target();\\\\n    var bitField = target._bitField;\\\\n\\\\n    if (!haveInternalData) {\\\\n        promise._propagateFrom(this, 3);\\\\n        promise._captureStackTrace();\\\\n        if (receiver === undefined &&\\\\n            ((this._bitField & 2097152) !== 0)) {\\\\n            if (!((bitField & 50397184) === 0)) {\\\\n                receiver = this._boundValue();\\\\n            } else {\\\\n                receiver = target === this ? undefined : this._boundTo;\\\\n            }\\\\n        }\\\\n        this._fireEvent(\\"promiseChained\\", this, promise);\\\\n    }\\\\n\\\\n    var domain = getDomain();\\\\n    if (!((bitField & 50397184) === 0)) {\\\\n        var handler, value, settler = target._settlePromiseCtx;\\\\n        if (((bitField & 33554432) !== 0)) {\\\\n            value = target._rejectionHandler0;\\\\n            handler = didFulfill;\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            value = target._fulfillmentHandler0;\\\\n            handler = didReject;\\\\n            target._unsetRejectionIsUnhandled();\\\\n        } else {\\\\n            settler = target._settlePromiseLateCancellationObserver;\\\\n            value = new CancellationError(\\"late cancellation observer\\");\\\\n            target._attachExtraTrace(value);\\\\n            handler = didReject;\\\\n        }\\\\n\\\\n        async.invoke(settler, target, {\\\\n            handler: domain === null ? handler\\\\n                : (typeof handler === \\"function\\" && domain.bind(handler)),\\\\n            promise: promise,\\\\n            receiver: receiver,\\\\n            value: value\\\\n        });\\\\n    } else {\\\\n        target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\\\\n    }\\\\n\\\\n    return promise;\\\\n};\\\\n\\\\nPromise.prototype._length = function () {\\\\n    return this._bitField & 65535;\\\\n};\\\\n\\\\nPromise.prototype._isFateSealed = function () {\\\\n    return (this._bitField & 117506048) !== 0;\\\\n};\\\\n\\\\nPromise.prototype._isFollowing = function () {\\\\n    return (this._bitField & 67108864) === 67108864;\\\\n};\\\\n\\\\nPromise.prototype._setLength = function (len) {\\\\n    this._bitField = (this._bitField & -65536) |\\\\n        (len & 65535);\\\\n};\\\\n\\\\nPromise.prototype._setFulfilled = function () {\\\\n    this._bitField = this._bitField | 33554432;\\\\n    this._fireEvent(\\"promiseFulfilled\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setRejected = function () {\\\\n    this._bitField = this._bitField | 16777216;\\\\n    this._fireEvent(\\"promiseRejected\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setFollowing = function () {\\\\n    this._bitField = this._bitField | 67108864;\\\\n    this._fireEvent(\\"promiseResolved\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setIsFinal = function () {\\\\n    this._bitField = this._bitField | 4194304;\\\\n};\\\\n\\\\nPromise.prototype._isFinal = function () {\\\\n    return (this._bitField & 4194304) > 0;\\\\n};\\\\n\\\\nPromise.prototype._unsetCancelled = function() {\\\\n    this._bitField = this._bitField & (~65536);\\\\n};\\\\n\\\\nPromise.prototype._setCancelled = function() {\\\\n    this._bitField = this._bitField | 65536;\\\\n    this._fireEvent(\\"promiseCancelled\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setAsyncGuaranteed = function() {\\\\n    this._bitField = this._bitField | 134217728;\\\\n};\\\\n\\\\nPromise.prototype._receiverAt = function (index) {\\\\n    var ret = index === 0 ? this._receiver0 : this[\\\\n            index * 4 - 4 + 3];\\\\n    if (ret === UNDEFINED_BINDING) {\\\\n        return undefined;\\\\n    } else if (ret === undefined && this._isBound()) {\\\\n        return this._boundValue();\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._promiseAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 2];\\\\n};\\\\n\\\\nPromise.prototype._fulfillmentHandlerAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 0];\\\\n};\\\\n\\\\nPromise.prototype._rejectionHandlerAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 1];\\\\n};\\\\n\\\\nPromise.prototype._boundValue = function() {};\\\\n\\\\nPromise.prototype._migrateCallback0 = function (follower) {\\\\n    var bitField = follower._bitField;\\\\n    var fulfill = follower._fulfillmentHandler0;\\\\n    var reject = follower._rejectionHandler0;\\\\n    var promise = follower._promise0;\\\\n    var receiver = follower._receiverAt(0);\\\\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\\\\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\\\\n};\\\\n\\\\nPromise.prototype._migrateCallbackAt = function (follower, index) {\\\\n    var fulfill = follower._fulfillmentHandlerAt(index);\\\\n    var reject = follower._rejectionHandlerAt(index);\\\\n    var promise = follower._promiseAt(index);\\\\n    var receiver = follower._receiverAt(index);\\\\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\\\\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\\\\n};\\\\n\\\\nPromise.prototype._addCallbacks = function (\\\\n    fulfill,\\\\n    reject,\\\\n    promise,\\\\n    receiver,\\\\n    domain\\\\n) {\\\\n    var index = this._length();\\\\n\\\\n    if (index >= 65535 - 4) {\\\\n        index = 0;\\\\n        this._setLength(0);\\\\n    }\\\\n\\\\n    if (index === 0) {\\\\n        this._promise0 = promise;\\\\n        this._receiver0 = receiver;\\\\n        if (typeof fulfill === \\"function\\") {\\\\n            this._fulfillmentHandler0 =\\\\n                domain === null ? fulfill : domain.bind(fulfill);\\\\n        }\\\\n        if (typeof reject === \\"function\\") {\\\\n            this._rejectionHandler0 =\\\\n                domain === null ? reject : domain.bind(reject);\\\\n        }\\\\n    } else {\\\\n        var base = index * 4 - 4;\\\\n        this[base + 2] = promise;\\\\n        this[base + 3] = receiver;\\\\n        if (typeof fulfill === \\"function\\") {\\\\n            this[base + 0] =\\\\n                domain === null ? fulfill : domain.bind(fulfill);\\\\n        }\\\\n        if (typeof reject === \\"function\\") {\\\\n            this[base + 1] =\\\\n                domain === null ? reject : domain.bind(reject);\\\\n        }\\\\n    }\\\\n    this._setLength(index + 1);\\\\n    return index;\\\\n};\\\\n\\\\nPromise.prototype._proxy = function (proxyable, arg) {\\\\n    this._addCallbacks(undefined, undefined, arg, proxyable, null);\\\\n};\\\\n\\\\nPromise.prototype._resolveCallback = function(value, shouldBind) {\\\\n    if (((this._bitField & 117506048) !== 0)) return;\\\\n    if (value === this)\\\\n        return this._rejectCallback(makeSelfResolutionError(), false);\\\\n    var maybePromise = tryConvertToPromise(value, this);\\\\n    if (!(maybePromise instanceof Promise)) return this._fulfill(value);\\\\n\\\\n    if (shouldBind) this._propagateFrom(maybePromise, 2);\\\\n\\\\n    var promise = maybePromise._target();\\\\n    var bitField = promise._bitField;\\\\n    if (((bitField & 50397184) === 0)) {\\\\n        var len = this._length();\\\\n        if (len > 0) promise._migrateCallback0(this);\\\\n        for (var i = 1; i < len; ++i) {\\\\n            promise._migrateCallbackAt(this, i);\\\\n        }\\\\n        this._setFollowing();\\\\n        this._setLength(0);\\\\n        this._setFollowee(promise);\\\\n    } else if (((bitField & 33554432) !== 0)) {\\\\n        this._fulfill(promise._value());\\\\n    } else if (((bitField & 16777216) !== 0)) {\\\\n        this._reject(promise._reason());\\\\n    } else {\\\\n        var reason = new CancellationError(\\"late cancellation observer\\");\\\\n        promise._attachExtraTrace(reason);\\\\n        this._reject(reason);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._rejectCallback =\\\\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\\\\n    var trace = util.ensureErrorObject(reason);\\\\n    var hasStack = trace === reason;\\\\n    if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\\\\n        var message = \\"a promise was rejected with a non-error: \\" +\\\\n            util.classString(reason);\\\\n        this._warn(message, true);\\\\n    }\\\\n    this._attachExtraTrace(trace, synchronous ? hasStack : false);\\\\n    this._reject(reason);\\\\n};\\\\n\\\\nPromise.prototype._resolveFromExecutor = function (executor) {\\\\n    var promise = this;\\\\n    this._captureStackTrace();\\\\n    this._pushContext();\\\\n    var synchronous = true;\\\\n    var r = this._execute(executor, function(value) {\\\\n        promise._resolveCallback(value);\\\\n    }, function (reason) {\\\\n        promise._rejectCallback(reason, synchronous);\\\\n    });\\\\n    synchronous = false;\\\\n    this._popContext();\\\\n\\\\n    if (r !== undefined) {\\\\n        promise._rejectCallback(r, true);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseFromHandler = function (\\\\n    handler, receiver, value, promise\\\\n) {\\\\n    var bitField = promise._bitField;\\\\n    if (((bitField & 65536) !== 0)) return;\\\\n    promise._pushContext();\\\\n    var x;\\\\n    if (receiver === APPLY) {\\\\n        if (!value || typeof value.length !== \\"number\\") {\\\\n            x = errorObj;\\\\n            x.e = new TypeError(\\"cannot .spread() a non-array: \\" +\\\\n                                    util.classString(value));\\\\n        } else {\\\\n            x = tryCatch(handler).apply(this._boundValue(), value);\\\\n        }\\\\n    } else {\\\\n        x = tryCatch(handler).call(receiver, value);\\\\n    }\\\\n    var promiseCreated = promise._popContext();\\\\n    bitField = promise._bitField;\\\\n    if (((bitField & 65536) !== 0)) return;\\\\n\\\\n    if (x === NEXT_FILTER) {\\\\n        promise._reject(value);\\\\n    } else if (x === errorObj || x === promise) {\\\\n        var err = x === promise ? makeSelfResolutionError() : x.e;\\\\n        promise._rejectCallback(err, false);\\\\n    } else {\\\\n        debug.checkForgottenReturns(x, promiseCreated, \\"\\",  promise, this);\\\\n        promise._resolveCallback(x);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._target = function() {\\\\n    var ret = this;\\\\n    while (ret._isFollowing()) ret = ret._followee();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._followee = function() {\\\\n    return this._rejectionHandler0;\\\\n};\\\\n\\\\nPromise.prototype._setFollowee = function(promise) {\\\\n    this._rejectionHandler0 = promise;\\\\n};\\\\n\\\\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\\\\n    var isPromise = promise instanceof Promise;\\\\n    var bitField = this._bitField;\\\\n    var asyncGuaranteed = ((bitField & 134217728) !== 0);\\\\n    if (((bitField & 65536) !== 0)) {\\\\n        if (isPromise) promise._invokeInternalOnCancel();\\\\n\\\\n        if (receiver instanceof PassThroughHandlerContext &&\\\\n            receiver.isFinallyHandler()) {\\\\n            receiver.cancelPromise = promise;\\\\n            if (tryCatch(handler).call(receiver, value) === errorObj) {\\\\n                promise._reject(errorObj.e);\\\\n            }\\\\n        } else if (handler === reflectHandler) {\\\\n            promise._fulfill(reflectHandler.call(receiver));\\\\n        } else if (receiver instanceof Proxyable) {\\\\n            receiver._promiseCancelled(promise);\\\\n        } else if (isPromise || promise instanceof PromiseArray) {\\\\n            promise._cancel();\\\\n        } else {\\\\n            receiver.cancel();\\\\n        }\\\\n    } else if (typeof handler === \\"function\\") {\\\\n        if (!isPromise) {\\\\n            handler.call(receiver, value, promise);\\\\n        } else {\\\\n            if (asyncGuaranteed) promise._setAsyncGuaranteed();\\\\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\\\\n        }\\\\n    } else if (receiver instanceof Proxyable) {\\\\n        if (!receiver._isResolved()) {\\\\n            if (((bitField & 33554432) !== 0)) {\\\\n                receiver._promiseFulfilled(value, promise);\\\\n            } else {\\\\n                receiver._promiseRejected(value, promise);\\\\n            }\\\\n        }\\\\n    } else if (isPromise) {\\\\n        if (asyncGuaranteed) promise._setAsyncGuaranteed();\\\\n        if (((bitField & 33554432) !== 0)) {\\\\n            promise._fulfill(value);\\\\n        } else {\\\\n            promise._reject(value);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\\\\n    var handler = ctx.handler;\\\\n    var promise = ctx.promise;\\\\n    var receiver = ctx.receiver;\\\\n    var value = ctx.value;\\\\n    if (typeof handler === \\"function\\") {\\\\n        if (!(promise instanceof Promise)) {\\\\n            handler.call(receiver, value, promise);\\\\n        } else {\\\\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\\\\n        }\\\\n    } else if (promise instanceof Promise) {\\\\n        promise._reject(value);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseCtx = function(ctx) {\\\\n    this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\\\\n};\\\\n\\\\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\\\\n    var promise = this._promise0;\\\\n    var receiver = this._receiverAt(0);\\\\n    this._promise0 = undefined;\\\\n    this._receiver0 = undefined;\\\\n    this._settlePromise(promise, handler, receiver, value);\\\\n};\\\\n\\\\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\\\\n    var base = index * 4 - 4;\\\\n    this[base + 2] =\\\\n    this[base + 3] =\\\\n    this[base + 0] =\\\\n    this[base + 1] = undefined;\\\\n};\\\\n\\\\nPromise.prototype._fulfill = function (value) {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 117506048) >>> 16)) return;\\\\n    if (value === this) {\\\\n        var err = makeSelfResolutionError();\\\\n        this._attachExtraTrace(err);\\\\n        return this._reject(err);\\\\n    }\\\\n    this._setFulfilled();\\\\n    this._rejectionHandler0 = value;\\\\n\\\\n    if ((bitField & 65535) > 0) {\\\\n        if (((bitField & 134217728) !== 0)) {\\\\n            this._settlePromises();\\\\n        } else {\\\\n            async.settlePromises(this);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._reject = function (reason) {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 117506048) >>> 16)) return;\\\\n    this._setRejected();\\\\n    this._fulfillmentHandler0 = reason;\\\\n\\\\n    if (this._isFinal()) {\\\\n        return async.fatalError(reason, util.isNode);\\\\n    }\\\\n\\\\n    if ((bitField & 65535) > 0) {\\\\n        if (((bitField & 134217728) !== 0)) {\\\\n            this._settlePromises();\\\\n        } else {\\\\n            async.settlePromises(this);\\\\n        }\\\\n    } else {\\\\n        this._ensurePossibleRejectionHandled();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._fulfillPromises = function (len, value) {\\\\n    for (var i = 1; i < len; i++) {\\\\n        var handler = this._fulfillmentHandlerAt(i);\\\\n        var promise = this._promiseAt(i);\\\\n        var receiver = this._receiverAt(i);\\\\n        this._clearCallbackDataAtIndex(i);\\\\n        this._settlePromise(promise, handler, receiver, value);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._rejectPromises = function (len, reason) {\\\\n    for (var i = 1; i < len; i++) {\\\\n        var handler = this._rejectionHandlerAt(i);\\\\n        var promise = this._promiseAt(i);\\\\n        var receiver = this._receiverAt(i);\\\\n        this._clearCallbackDataAtIndex(i);\\\\n        this._settlePromise(promise, handler, receiver, reason);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromises = function () {\\\\n    var bitField = this._bitField;\\\\n    var len = (bitField & 65535);\\\\n\\\\n    if (len > 0) {\\\\n        if (((bitField & 16842752) !== 0)) {\\\\n            var reason = this._fulfillmentHandler0;\\\\n            this._settlePromise0(this._rejectionHandler0, reason, bitField);\\\\n            this._rejectPromises(len, reason);\\\\n        } else {\\\\n            var value = this._rejectionHandler0;\\\\n            this._settlePromise0(this._fulfillmentHandler0, value, bitField);\\\\n            this._fulfillPromises(len, value);\\\\n        }\\\\n        this._setLength(0);\\\\n    }\\\\n    this._clearCancellationData();\\\\n};\\\\n\\\\nPromise.prototype._settledValue = function() {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 33554432) !== 0)) {\\\\n        return this._rejectionHandler0;\\\\n    } else if (((bitField & 16777216) !== 0)) {\\\\n        return this._fulfillmentHandler0;\\\\n    }\\\\n};\\\\n\\\\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\\\\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\\\\n\\\\nPromise.defer = Promise.pending = function() {\\\\n    debug.deprecated(\\"Promise.defer\\", \\"new Promise\\");\\\\n    var promise = new Promise(INTERNAL);\\\\n    return {\\\\n        promise: promise,\\\\n        resolve: deferResolve,\\\\n        reject: deferReject\\\\n    };\\\\n};\\\\n\\\\nutil.notEnumerableProp(Promise,\\\\n                       \\"_makeSelfResolutionError\\",\\\\n                       makeSelfResolutionError);\\\\n\\\\n_dereq_(\\"./method\\")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\\\\n    debug);\\\\n_dereq_(\\"./bind\\")(Promise, INTERNAL, tryConvertToPromise, debug);\\\\n_dereq_(\\"./cancel\\")(Promise, PromiseArray, apiRejection, debug);\\\\n_dereq_(\\"./direct_resolve\\")(Promise);\\\\n_dereq_(\\"./synchronous_inspection\\")(Promise);\\\\n_dereq_(\\"./join\\")(\\\\n    Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug);\\\\nPromise.Promise = Promise;\\\\n_dereq_(\\\\\'./map.js\\\\\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./using.js\\\\\')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\\\\n_dereq_(\\\\\'./timers.js\\\\\')(Promise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./generators.js\\\\\')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\\\\n_dereq_(\\\\\'./nodeify.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./call_get.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./props.js\\\\\')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\\\\n_dereq_(\\\\\'./race.js\\\\\')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\\\\n_dereq_(\\\\\'./reduce.js\\\\\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./settle.js\\\\\')(Promise, PromiseArray, debug);\\\\n_dereq_(\\\\\'./some.js\\\\\')(Promise, PromiseArray, apiRejection);\\\\n_dereq_(\\\\\'./promisify.js\\\\\')(Promise, INTERNAL);\\\\n_dereq_(\\\\\'./any.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./each.js\\\\\')(Promise, INTERNAL);\\\\n_dereq_(\\\\\'./filter.js\\\\\')(Promise, INTERNAL);\\\\n                                                         \\\\n    util.toFastProperties(Promise);                                          \\\\n    util.toFastProperties(Promise.prototype);                                \\\\n    function fillTypes(value) {                                              \\\\n        var p = new Promise(INTERNAL);                                       \\\\n        p._fulfillmentHandler0 = value;                                      \\\\n        p._rejectionHandler0 = value;                                        \\\\n        p._promise0 = value;                                                 \\\\n        p._receiver0 = value;                                                \\\\n    }                                                                        \\\\n    // Complete slack tracking, opt out of field-type tracking and           \\\\n    // stabilize map                                                         \\\\n    fillTypes({a: 1});                                                       \\\\n    fillTypes({b: 2});                                                       \\\\n    fillTypes({c: 3});                                                       \\\\n    fillTypes(1);                                                            \\\\n    fillTypes(function(){});                                                 \\\\n    fillTypes(undefined);                                                    \\\\n    fillTypes(false);                                                        \\\\n    fillTypes(new Promise(INTERNAL));                                        \\\\n    debug.setBounds(Async.firstLineError, util.lastLineError);               \\\\n    return Promise;                                                          \\\\n\\\\n};\\\\n\\\\n},{\\"./any.js\\":1,\\"./async\\":2,\\"./bind\\":3,\\"./call_get.js\\":5,\\"./cancel\\":6,\\"./catch_filter\\":7,\\"./context\\":8,\\"./debuggability\\":9,\\"./direct_resolve\\":10,\\"./each.js\\":11,\\"./errors\\":12,\\"./es5\\":13,\\"./filter.js\\":14,\\"./finally\\":15,\\"./generators.js\\":16,\\"./join\\":17,\\"./map.js\\":18,\\"./method\\":19,\\"./nodeback\\":20,\\"./nodeify.js\\":21,\\"./promise_array\\":23,\\"./promisify.js\\":24,\\"./props.js\\":25,\\"./race.js\\":27,\\"./reduce.js\\":28,\\"./settle.js\\":30,\\"./some.js\\":31,\\"./synchronous_inspection\\":32,\\"./thenables\\":33,\\"./timers.js\\":34,\\"./using.js\\":35,\\"./util\\":36}],23:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\\\\n    apiRejection, Proxyable) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar isArray = util.isArray;\\\\n\\\\nfunction toResolutionValue(val) {\\\\n    switch(val) {\\\\n    case -2: return [];\\\\n    case -3: return {};\\\\n    }\\\\n}\\\\n\\\\nfunction PromiseArray(values) {\\\\n    var promise = this._promise = new Promise(INTERNAL);\\\\n    if (values instanceof Promise) {\\\\n        promise._propagateFrom(values, 3);\\\\n    }\\\\n    promise._setOnCancel(this);\\\\n    this._values = values;\\\\n    this._length = 0;\\\\n    this._totalResolved = 0;\\\\n    this._init(undefined, -2);\\\\n}\\\\nutil.inherits(PromiseArray, Proxyable);\\\\n\\\\nPromiseArray.prototype.length = function () {\\\\n    return this._length;\\\\n};\\\\n\\\\nPromiseArray.prototype.promise = function () {\\\\n    return this._promise;\\\\n};\\\\n\\\\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\\\\n    var values = tryConvertToPromise(this._values, this._promise);\\\\n    if (values instanceof Promise) {\\\\n        values = values._target();\\\\n        var bitField = values._bitField;\\\\n        ;\\\\n        this._values = values;\\\\n\\\\n        if (((bitField & 50397184) === 0)) {\\\\n            this._promise._setAsyncGuaranteed();\\\\n            return values._then(\\\\n                init,\\\\n                this._reject,\\\\n                undefined,\\\\n                this,\\\\n                resolveValueIfEmpty\\\\n           );\\\\n        } else if (((bitField & 33554432) !== 0)) {\\\\n            values = values._value();\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            return this._reject(values._reason());\\\\n        } else {\\\\n            return this._cancel();\\\\n        }\\\\n    }\\\\n    values = util.asArray(values);\\\\n    if (values === null) {\\\\n        var err = apiRejection(\\\\n            \\"expecting an array or an iterable object but got \\" + util.classString(values)).reason();\\\\n        this._promise._rejectCallback(err, false);\\\\n        return;\\\\n    }\\\\n\\\\n    if (values.length === 0) {\\\\n        if (resolveValueIfEmpty === -5) {\\\\n            this._resolveEmptyArray();\\\\n        }\\\\n        else {\\\\n            this._resolve(toResolutionValue(resolveValueIfEmpty));\\\\n        }\\\\n        return;\\\\n    }\\\\n    this._iterate(values);\\\\n};\\\\n\\\\nPromiseArray.prototype._iterate = function(values) {\\\\n    var len = this.getActualLength(values.length);\\\\n    this._length = len;\\\\n    this._values = this.shouldCopyValues() ? new Array(len) : this._values;\\\\n    var result = this._promise;\\\\n    var isResolved = false;\\\\n    var bitField = null;\\\\n    for (var i = 0; i < len; ++i) {\\\\n        var maybePromise = tryConvertToPromise(values[i], result);\\\\n\\\\n        if (maybePromise instanceof Promise) {\\\\n            maybePromise = maybePromise._target();\\\\n            bitField = maybePromise._bitField;\\\\n        } else {\\\\n            bitField = null;\\\\n        }\\\\n\\\\n        if (isResolved) {\\\\n            if (bitField !== null) {\\\\n                maybePromise.suppressUnhandledRejections();\\\\n            }\\\\n        } else if (bitField !== null) {\\\\n            if (((bitField & 50397184) === 0)) {\\\\n                maybePromise._proxy(this, i);\\\\n                this._values[i] = maybePromise;\\\\n            } else if (((bitField & 33554432) !== 0)) {\\\\n                isResolved = this._promiseFulfilled(maybePromise._value(), i);\\\\n            } else if (((bitField & 16777216) !== 0)) {\\\\n                isResolved = this._promiseRejected(maybePromise._reason(), i);\\\\n            } else {\\\\n                isResolved = this._promiseCancelled(i);\\\\n            }\\\\n        } else {\\\\n            isResolved = this._promiseFulfilled(maybePromise, i);\\\\n        }\\\\n    }\\\\n    if (!isResolved) result._setAsyncGuaranteed();\\\\n};\\\\n\\\\nPromiseArray.prototype._isResolved = function () {\\\\n    return this._values === null;\\\\n};\\\\n\\\\nPromiseArray.prototype._resolve = function (value) {\\\\n    this._values = null;\\\\n    this._promise._fulfill(value);\\\\n};\\\\n\\\\nPromiseArray.prototype._cancel = function() {\\\\n    if (this._isResolved() || !this._promise.isCancellable()) return;\\\\n    this._values = null;\\\\n    this._promise._cancel();\\\\n};\\\\n\\\\nPromiseArray.prototype._reject = function (reason) {\\\\n    this._values = null;\\\\n    this._promise._rejectCallback(reason, false);\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    this._values[index] = value;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        this._resolve(this._values);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseCancelled = function() {\\\\n    this._cancel();\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseRejected = function (reason) {\\\\n    this._totalResolved++;\\\\n    this._reject(reason);\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype._resultCancelled = function() {\\\\n    if (this._isResolved()) return;\\\\n    var values = this._values;\\\\n    this._cancel();\\\\n    if (values instanceof Promise) {\\\\n        values.cancel();\\\\n    } else {\\\\n        for (var i = 0; i < values.length; ++i) {\\\\n            if (values[i] instanceof Promise) {\\\\n                values[i].cancel();\\\\n            }\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype.getActualLength = function (len) {\\\\n    return len;\\\\n};\\\\n\\\\nreturn PromiseArray;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],24:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar THIS = {};\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar nodebackForPromise = _dereq_(\\"./nodeback\\");\\\\nvar withAppended = util.withAppended;\\\\nvar maybeWrapAsError = util.maybeWrapAsError;\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar TypeError = _dereq_(\\"./errors\\").TypeError;\\\\nvar defaultSuffix = \\"Async\\";\\\\nvar defaultPromisified = {__isPromisified__: true};\\\\nvar noCopyProps = [\\\\n    \\"arity\\",    \\"length\\",\\\\n    \\"name\\",\\\\n    \\"arguments\\",\\\\n    \\"caller\\",\\\\n    \\"callee\\",\\\\n    \\"prototype\\",\\\\n    \\"__isPromisified__\\"\\\\n];\\\\nvar noCopyPropsPattern = new RegExp(\\"^(?:\\" + noCopyProps.join(\\"|\\") + \\")$\\");\\\\n\\\\nvar defaultFilter = function(name) {\\\\n    return util.isIdentifier(name) &&\\\\n        name.charAt(0) !== \\"_\\" &&\\\\n        name !== \\"constructor\\";\\\\n};\\\\n\\\\nfunction propsFilter(key) {\\\\n    return !noCopyPropsPattern.test(key);\\\\n}\\\\n\\\\nfunction isPromisified(fn) {\\\\n    try {\\\\n        return fn.__isPromisified__ === true;\\\\n    }\\\\n    catch (e) {\\\\n        return false;\\\\n    }\\\\n}\\\\n\\\\nfunction hasPromisified(obj, key, suffix) {\\\\n    var val = util.getDataPropertyOrDefault(obj, key + suffix,\\\\n                                            defaultPromisified);\\\\n    return val ? isPromisified(val) : false;\\\\n}\\\\nfunction checkValid(ret, suffix, suffixRegexp) {\\\\n    for (var i = 0; i < ret.length; i += 2) {\\\\n        var key = ret[i];\\\\n        if (suffixRegexp.test(key)) {\\\\n            var keyWithoutAsyncSuffix = key.replace(suffixRegexp, \\"\\");\\\\n            for (var j = 0; j < ret.length; j += 2) {\\\\n                if (ret[j] === keyWithoutAsyncSuffix) {\\\\n                    throw new TypeError(\\"Cannot promisify an API that has normal methods with \\\\\'%s\\\\\'-suffix\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\"\\\\n                        .replace(\\"%s\\", suffix));\\\\n                }\\\\n            }\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\\\\n    var keys = util.inheritedDataKeys(obj);\\\\n    var ret = [];\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var key = keys[i];\\\\n        var value = obj[key];\\\\n        var passesDefaultFilter = filter === defaultFilter\\\\n            ? true : defaultFilter(key, value, obj);\\\\n        if (typeof value === \\"function\\" &&\\\\n            !isPromisified(value) &&\\\\n            !hasPromisified(obj, key, suffix) &&\\\\n            filter(key, value, obj, passesDefaultFilter)) {\\\\n            ret.push(key, value);\\\\n        }\\\\n    }\\\\n    checkValid(ret, suffix, suffixRegexp);\\\\n    return ret;\\\\n}\\\\n\\\\nvar escapeIdentRegex = function(str) {\\\\n    return str.replace(/([$])/, \\"\\\\\\\\\\\\\\\\$\\");\\\\n};\\\\n\\\\nvar makeNodePromisifiedEval;\\\\nif (false) {\\\\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\\\\n    var ret = [likelyArgumentCount];\\\\n    var min = Math.max(0, likelyArgumentCount - 1 - 3);\\\\n    for(var i = likelyArgumentCount - 1; i >= min; --i) {\\\\n        ret.push(i);\\\\n    }\\\\n    for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\\\\n        ret.push(i);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nvar argumentSequence = function(argumentCount) {\\\\n    return util.filledRange(argumentCount, \\"_arg\\", \\"\\");\\\\n};\\\\n\\\\nvar parameterDeclaration = function(parameterCount) {\\\\n    return util.filledRange(\\\\n        Math.max(parameterCount, 3), \\"_arg\\", \\"\\");\\\\n};\\\\n\\\\nvar parameterCount = function(fn) {\\\\n    if (typeof fn.length === \\"number\\") {\\\\n        return Math.max(Math.min(fn.length, 1023 + 1), 0);\\\\n    }\\\\n    return 0;\\\\n};\\\\n\\\\nmakeNodePromisifiedEval =\\\\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\\\\n    var newParameterCount = Math.max(0, parameterCount(fn) - 1);\\\\n    var argumentOrder = switchCaseArgumentOrder(newParameterCount);\\\\n    var shouldProxyThis = typeof callback === \\"string\\" || receiver === THIS;\\\\n\\\\n    function generateCallForArgumentCount(count) {\\\\n        var args = argumentSequence(count).join(\\", \\");\\\\n        var comma = count > 0 ? \\", \\" : \\"\\";\\\\n        var ret;\\\\n        if (shouldProxyThis) {\\\\n            ret = \\"ret = callback.call(this, {{args}}, nodeback); break;\\\\\\\\n\\";\\\\n        } else {\\\\n            ret = receiver === undefined\\\\n                ? \\"ret = callback({{args}}, nodeback); break;\\\\\\\\n\\"\\\\n                : \\"ret = callback.call(receiver, {{args}}, nodeback); break;\\\\\\\\n\\";\\\\n        }\\\\n        return ret.replace(\\"{{args}}\\", args).replace(\\", \\", comma);\\\\n    }\\\\n\\\\n    function generateArgumentSwitchCase() {\\\\n        var ret = \\"\\";\\\\n        for (var i = 0; i < argumentOrder.length; ++i) {\\\\n            ret += \\"case \\" + argumentOrder[i] +\\":\\" +\\\\n                generateCallForArgumentCount(argumentOrder[i]);\\\\n        }\\\\n\\\\n        ret += \\"                                                             \\\\\\\\n\\\\\\\\\\\\n        default:                                                             \\\\\\\\n\\\\\\\\\\\\n            var args = new Array(len + 1);                                   \\\\\\\\n\\\\\\\\\\\\n            var i = 0;                                                       \\\\\\\\n\\\\\\\\\\\\n            for (var i = 0; i < len; ++i) {                                  \\\\\\\\n\\\\\\\\\\\\n               args[i] = arguments[i];                                       \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            args[i] = nodeback;                                              \\\\\\\\n\\\\\\\\\\\\n            [CodeForCall]                                                    \\\\\\\\n\\\\\\\\\\\\n            break;                                                           \\\\\\\\n\\\\\\\\\\\\n        \\".replace(\\"[CodeForCall]\\", (shouldProxyThis\\\\n                                ? \\"ret = callback.apply(this, args);\\\\\\\\n\\"\\\\n                                : \\"ret = callback.apply(receiver, args);\\\\\\\\n\\"));\\\\n        return ret;\\\\n    }\\\\n\\\\n    var getFunctionCode = typeof callback === \\"string\\"\\\\n                                ? (\\"this != null ? this[\\\\\'\\"+callback+\\"\\\\\'] : fn\\")\\\\n                                : \\"fn\\";\\\\n    var body = \\"\\\\\'use strict\\\\\';                                                \\\\\\\\n\\\\\\\\\\\\n        var ret = function (Parameters) {                                    \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            var len = arguments.length;                                      \\\\\\\\n\\\\\\\\\\\\n            var promise = new Promise(INTERNAL);                             \\\\\\\\n\\\\\\\\\\\\n            promise._captureStackTrace();                                    \\\\\\\\n\\\\\\\\\\\\n            var nodeback = nodebackForPromise(promise, \\" + multiArgs + \\");   \\\\\\\\n\\\\\\\\\\\\n            var ret;                                                         \\\\\\\\n\\\\\\\\\\\\n            var callback = tryCatch([GetFunctionCode]);                      \\\\\\\\n\\\\\\\\\\\\n            switch(len) {                                                    \\\\\\\\n\\\\\\\\\\\\n                [CodeForSwitchCase]                                          \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            if (ret === errorObj) {                                          \\\\\\\\n\\\\\\\\\\\\n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \\\\\\\\n\\\\\\\\\\\\n            return promise;                                                  \\\\\\\\n\\\\\\\\\\\\n        };                                                                   \\\\\\\\n\\\\\\\\\\\\n        notEnumerableProp(ret, \\\\\'__isPromisified__\\\\\', true);                   \\\\\\\\n\\\\\\\\\\\\n        return ret;                                                          \\\\\\\\n\\\\\\\\\\\\n    \\".replace(\\"[CodeForSwitchCase]\\", generateArgumentSwitchCase())\\\\n        .replace(\\"[GetFunctionCode]\\", getFunctionCode);\\\\n    body = body.replace(\\"Parameters\\", parameterDeclaration(newParameterCount));\\\\n    return new Function(\\"Promise\\",\\\\n                        \\"fn\\",\\\\n                        \\"receiver\\",\\\\n                        \\"withAppended\\",\\\\n                        \\"maybeWrapAsError\\",\\\\n                        \\"nodebackForPromise\\",\\\\n                        \\"tryCatch\\",\\\\n                        \\"errorObj\\",\\\\n                        \\"notEnumerableProp\\",\\\\n                        \\"INTERNAL\\",\\\\n                        body)(\\\\n                    Promise,\\\\n                    fn,\\\\n                    receiver,\\\\n                    withAppended,\\\\n                    maybeWrapAsError,\\\\n                    nodebackForPromise,\\\\n                    util.tryCatch,\\\\n                    util.errorObj,\\\\n                    util.notEnumerableProp,\\\\n                    INTERNAL);\\\\n};\\\\n}\\\\n\\\\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\\\\n    var defaultThis = (function() {return this;})();\\\\n    var method = callback;\\\\n    if (typeof method === \\"string\\") {\\\\n        callback = fn;\\\\n    }\\\\n    function promisified() {\\\\n        var _receiver = receiver;\\\\n        if (receiver === THIS) _receiver = this;\\\\n        var promise = new Promise(INTERNAL);\\\\n        promise._captureStackTrace();\\\\n        var cb = typeof method === \\"string\\" && this !== defaultThis\\\\n            ? this[method] : callback;\\\\n        var fn = nodebackForPromise(promise, multiArgs);\\\\n        try {\\\\n            cb.apply(_receiver, withAppended(arguments, fn));\\\\n        } catch(e) {\\\\n            promise._rejectCallback(maybeWrapAsError(e), true, true);\\\\n        }\\\\n        if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\\\\n        return promise;\\\\n    }\\\\n    util.notEnumerableProp(promisified, \\"__isPromisified__\\", true);\\\\n    return promisified;\\\\n}\\\\n\\\\nvar makeNodePromisified = canEvaluate\\\\n    ? makeNodePromisifiedEval\\\\n    : makeNodePromisifiedClosure;\\\\n\\\\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\\\\n    var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + \\"$\\");\\\\n    var methods =\\\\n        promisifiableMethods(obj, suffix, suffixRegexp, filter);\\\\n\\\\n    for (var i = 0, len = methods.length; i < len; i+= 2) {\\\\n        var key = methods[i];\\\\n        var fn = methods[i+1];\\\\n        var promisifiedKey = key + suffix;\\\\n        if (promisifier === makeNodePromisified) {\\\\n            obj[promisifiedKey] =\\\\n                makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\\\\n        } else {\\\\n            var promisified = promisifier(fn, function() {\\\\n                return makeNodePromisified(key, THIS, key,\\\\n                                           fn, suffix, multiArgs);\\\\n            });\\\\n            util.notEnumerableProp(promisified, \\"__isPromisified__\\", true);\\\\n            obj[promisifiedKey] = promisified;\\\\n        }\\\\n    }\\\\n    util.toFastProperties(obj);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction promisify(callback, receiver, multiArgs) {\\\\n    return makeNodePromisified(callback, receiver, undefined,\\\\n                                callback, null, multiArgs);\\\\n}\\\\n\\\\nPromise.promisify = function (fn, options) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    if (isPromisified(fn)) {\\\\n        return fn;\\\\n    }\\\\n    options = Object(options);\\\\n    var receiver = options.context === undefined ? THIS : options.context;\\\\n    var multiArgs = !!options.multiArgs;\\\\n    var ret = promisify(fn, receiver, multiArgs);\\\\n    util.copyDescriptors(fn, ret, propsFilter);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.promisifyAll = function (target, options) {\\\\n    if (typeof target !== \\"function\\" && typeof target !== \\"object\\") {\\\\n        throw new TypeError(\\"the target of promisifyAll must be an object or a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    options = Object(options);\\\\n    var multiArgs = !!options.multiArgs;\\\\n    var suffix = options.suffix;\\\\n    if (typeof suffix !== \\"string\\") suffix = defaultSuffix;\\\\n    var filter = options.filter;\\\\n    if (typeof filter !== \\"function\\") filter = defaultFilter;\\\\n    var promisifier = options.promisifier;\\\\n    if (typeof promisifier !== \\"function\\") promisifier = makeNodePromisified;\\\\n\\\\n    if (!util.isIdentifier(suffix)) {\\\\n        throw new RangeError(\\"suffix must be a valid identifier\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n\\\\n    var keys = util.inheritedDataKeys(target);\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var value = target[keys[i]];\\\\n        if (keys[i] !== \\"constructor\\" &&\\\\n            util.isClass(value)) {\\\\n            promisifyAll(value.prototype, suffix, filter, promisifier,\\\\n                multiArgs);\\\\n            promisifyAll(value, suffix, filter, promisifier, multiArgs);\\\\n        }\\\\n    }\\\\n\\\\n    return promisifyAll(target, suffix, filter, promisifier, multiArgs);\\\\n};\\\\n};\\\\n\\\\n\\\\n},{\\"./errors\\":12,\\"./nodeback\\":20,\\"./util\\":36}],25:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(\\\\n    Promise, PromiseArray, tryConvertToPromise, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar isObject = util.isObject;\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Es6Map;\\\\nif (typeof Map === \\"function\\") Es6Map = Map;\\\\n\\\\nvar mapToEntries = (function() {\\\\n    var index = 0;\\\\n    var size = 0;\\\\n\\\\n    function extractEntry(value, key) {\\\\n        this[index] = value;\\\\n        this[index + size] = key;\\\\n        index++;\\\\n    }\\\\n\\\\n    return function mapToEntries(map) {\\\\n        size = map.size;\\\\n        index = 0;\\\\n        var ret = new Array(map.size * 2);\\\\n        map.forEach(extractEntry, ret);\\\\n        return ret;\\\\n    };\\\\n})();\\\\n\\\\nvar entriesToMap = function(entries) {\\\\n    var ret = new Es6Map();\\\\n    var length = entries.length / 2 | 0;\\\\n    for (var i = 0; i < length; ++i) {\\\\n        var key = entries[length + i];\\\\n        var value = entries[i];\\\\n        ret.set(key, value);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nfunction PropertiesPromiseArray(obj) {\\\\n    var isMap = false;\\\\n    var entries;\\\\n    if (Es6Map !== undefined && obj instanceof Es6Map) {\\\\n        entries = mapToEntries(obj);\\\\n        isMap = true;\\\\n    } else {\\\\n        var keys = es5.keys(obj);\\\\n        var len = keys.length;\\\\n        entries = new Array(len * 2);\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var key = keys[i];\\\\n            entries[i] = obj[key];\\\\n            entries[i + len] = key;\\\\n        }\\\\n    }\\\\n    this.constructor$(entries);\\\\n    this._isMap = isMap;\\\\n    this._init$(undefined, -3);\\\\n}\\\\nutil.inherits(PropertiesPromiseArray, PromiseArray);\\\\n\\\\nPropertiesPromiseArray.prototype._init = function () {};\\\\n\\\\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    this._values[index] = value;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        var val;\\\\n        if (this._isMap) {\\\\n            val = entriesToMap(this._values);\\\\n        } else {\\\\n            val = {};\\\\n            var keyOffset = this.length();\\\\n            for (var i = 0, len = this.length(); i < len; ++i) {\\\\n                val[this._values[i + keyOffset]] = this._values[i];\\\\n            }\\\\n        }\\\\n        this._resolve(val);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return false;\\\\n};\\\\n\\\\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\\\\n    return len >> 1;\\\\n};\\\\n\\\\nfunction props(promises) {\\\\n    var ret;\\\\n    var castValue = tryConvertToPromise(promises);\\\\n\\\\n    if (!isObject(castValue)) {\\\\n        return apiRejection(\\"cannot await properties of a non-object\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    } else if (castValue instanceof Promise) {\\\\n        ret = castValue._then(\\\\n            Promise.props, undefined, undefined, undefined, undefined);\\\\n    } else {\\\\n        ret = new PropertiesPromiseArray(castValue).promise();\\\\n    }\\\\n\\\\n    if (castValue instanceof Promise) {\\\\n        ret._propagateFrom(castValue, 2);\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nPromise.prototype.props = function () {\\\\n    return props(this);\\\\n};\\\\n\\\\nPromise.props = function (promises) {\\\\n    return props(promises);\\\\n};\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],26:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\\\\n    for (var j = 0; j < len; ++j) {\\\\n        dst[j + dstIndex] = src[j + srcIndex];\\\\n        src[j + srcIndex] = void 0;\\\\n    }\\\\n}\\\\n\\\\nfunction Queue(capacity) {\\\\n    this._capacity = capacity;\\\\n    this._length = 0;\\\\n    this._front = 0;\\\\n}\\\\n\\\\nQueue.prototype._willBeOverCapacity = function (size) {\\\\n    return this._capacity < size;\\\\n};\\\\n\\\\nQueue.prototype._pushOne = function (arg) {\\\\n    var length = this.length();\\\\n    this._checkCapacity(length + 1);\\\\n    var i = (this._front + length) & (this._capacity - 1);\\\\n    this[i] = arg;\\\\n    this._length = length + 1;\\\\n};\\\\n\\\\nQueue.prototype._unshiftOne = function(value) {\\\\n    var capacity = this._capacity;\\\\n    this._checkCapacity(this.length() + 1);\\\\n    var front = this._front;\\\\n    var i = (((( front - 1 ) &\\\\n                    ( capacity - 1) ) ^ capacity ) - capacity );\\\\n    this[i] = value;\\\\n    this._front = i;\\\\n    this._length = this.length() + 1;\\\\n};\\\\n\\\\nQueue.prototype.unshift = function(fn, receiver, arg) {\\\\n    this._unshiftOne(arg);\\\\n    this._unshiftOne(receiver);\\\\n    this._unshiftOne(fn);\\\\n};\\\\n\\\\nQueue.prototype.push = function (fn, receiver, arg) {\\\\n    var length = this.length() + 3;\\\\n    if (this._willBeOverCapacity(length)) {\\\\n        this._pushOne(fn);\\\\n        this._pushOne(receiver);\\\\n        this._pushOne(arg);\\\\n        return;\\\\n    }\\\\n    var j = this._front + length - 3;\\\\n    this._checkCapacity(length);\\\\n    var wrapMask = this._capacity - 1;\\\\n    this[(j + 0) & wrapMask] = fn;\\\\n    this[(j + 1) & wrapMask] = receiver;\\\\n    this[(j + 2) & wrapMask] = arg;\\\\n    this._length = length;\\\\n};\\\\n\\\\nQueue.prototype.shift = function () {\\\\n    var front = this._front,\\\\n        ret = this[front];\\\\n\\\\n    this[front] = undefined;\\\\n    this._front = (front + 1) & (this._capacity - 1);\\\\n    this._length--;\\\\n    return ret;\\\\n};\\\\n\\\\nQueue.prototype.length = function () {\\\\n    return this._length;\\\\n};\\\\n\\\\nQueue.prototype._checkCapacity = function (size) {\\\\n    if (this._capacity < size) {\\\\n        this._resizeTo(this._capacity << 1);\\\\n    }\\\\n};\\\\n\\\\nQueue.prototype._resizeTo = function (capacity) {\\\\n    var oldCapacity = this._capacity;\\\\n    this._capacity = capacity;\\\\n    var front = this._front;\\\\n    var length = this._length;\\\\n    var moveItemsCount = (front + length) & (oldCapacity - 1);\\\\n    arrayMove(this, 0, this, oldCapacity, moveItemsCount);\\\\n};\\\\n\\\\nmodule.exports = Queue;\\\\n\\\\n},{}],27:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(\\\\n    Promise, INTERNAL, tryConvertToPromise, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nvar raceLater = function (promise) {\\\\n    return promise.then(function(array) {\\\\n        return race(array, promise);\\\\n    });\\\\n};\\\\n\\\\nfunction race(promises, parent) {\\\\n    var maybePromise = tryConvertToPromise(promises);\\\\n\\\\n    if (maybePromise instanceof Promise) {\\\\n        return raceLater(maybePromise);\\\\n    } else {\\\\n        promises = util.asArray(promises);\\\\n        if (promises === null)\\\\n            return apiRejection(\\"expecting an array or an iterable object but got \\" + util.classString(promises));\\\\n    }\\\\n\\\\n    var ret = new Promise(INTERNAL);\\\\n    if (parent !== undefined) {\\\\n        ret._propagateFrom(parent, 3);\\\\n    }\\\\n    var fulfill = ret._fulfill;\\\\n    var reject = ret._reject;\\\\n    for (var i = 0, len = promises.length; i < len; ++i) {\\\\n        var val = promises[i];\\\\n\\\\n        if (val === undefined && !(i in promises)) {\\\\n            continue;\\\\n        }\\\\n\\\\n        Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nPromise.race = function (promises) {\\\\n    return race(promises, undefined);\\\\n};\\\\n\\\\nPromise.prototype.race = function () {\\\\n    return race(this, undefined);\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],28:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          PromiseArray,\\\\n                          apiRejection,\\\\n                          tryConvertToPromise,\\\\n                          INTERNAL,\\\\n                          debug) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\n\\\\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\\\\n    this.constructor$(promises);\\\\n    var domain = getDomain();\\\\n    this._fn = domain === null ? fn : domain.bind(fn);\\\\n    if (initialValue !== undefined) {\\\\n        initialValue = Promise.resolve(initialValue);\\\\n        initialValue._attachCancellationCallback(this);\\\\n    }\\\\n    this._initialValue = initialValue;\\\\n    this._currentCancellable = null;\\\\n    this._eachValues = _each === INTERNAL ? [] : undefined;\\\\n    this._promise._captureStackTrace();\\\\n    this._init$(undefined, -5);\\\\n}\\\\nutil.inherits(ReductionPromiseArray, PromiseArray);\\\\n\\\\nReductionPromiseArray.prototype._gotAccum = function(accum) {\\\\n    if (this._eachValues !== undefined && accum !== INTERNAL) {\\\\n        this._eachValues.push(accum);\\\\n    }\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._eachComplete = function(value) {\\\\n    this._eachValues.push(value);\\\\n    return this._eachValues;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._init = function() {};\\\\n\\\\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\\\\n    this._resolve(this._eachValues !== undefined ? this._eachValues\\\\n                                                 : this._initialValue);\\\\n};\\\\n\\\\nReductionPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return false;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._resolve = function(value) {\\\\n    this._promise._resolveCallback(value);\\\\n    this._values = null;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\\\\n    if (sender === this._initialValue) return this._cancel();\\\\n    if (this._isResolved()) return;\\\\n    this._resultCancelled$();\\\\n    if (this._currentCancellable instanceof Promise) {\\\\n        this._currentCancellable.cancel();\\\\n    }\\\\n    if (this._initialValue instanceof Promise) {\\\\n        this._initialValue.cancel();\\\\n    }\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._iterate = function (values) {\\\\n    this._values = values;\\\\n    var value;\\\\n    var i;\\\\n    var length = values.length;\\\\n    if (this._initialValue !== undefined) {\\\\n        value = this._initialValue;\\\\n        i = 0;\\\\n    } else {\\\\n        value = Promise.resolve(values[0]);\\\\n        i = 1;\\\\n    }\\\\n\\\\n    this._currentCancellable = value;\\\\n\\\\n    if (!value.isRejected()) {\\\\n        for (; i < length; ++i) {\\\\n            var ctx = {\\\\n                accum: null,\\\\n                value: values[i],\\\\n                index: i,\\\\n                length: length,\\\\n                array: this\\\\n            };\\\\n            value = value._then(gotAccum, undefined, undefined, ctx, undefined);\\\\n        }\\\\n    }\\\\n\\\\n    if (this._eachValues !== undefined) {\\\\n        value = value\\\\n            ._then(this._eachComplete, undefined, undefined, this, undefined);\\\\n    }\\\\n    value._then(completed, completed, undefined, value, this);\\\\n};\\\\n\\\\nPromise.prototype.reduce = function (fn, initialValue) {\\\\n    return reduce(this, fn, initialValue, null);\\\\n};\\\\n\\\\nPromise.reduce = function (promises, fn, initialValue, _each) {\\\\n    return reduce(promises, fn, initialValue, _each);\\\\n};\\\\n\\\\nfunction completed(valueOrReason, array) {\\\\n    if (this.isFulfilled()) {\\\\n        array._resolve(valueOrReason);\\\\n    } else {\\\\n        array._reject(valueOrReason);\\\\n    }\\\\n}\\\\n\\\\nfunction reduce(promises, fn, initialValue, _each) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\\\\n    return array.promise();\\\\n}\\\\n\\\\nfunction gotAccum(accum) {\\\\n    this.accum = accum;\\\\n    this.array._gotAccum(accum);\\\\n    var value = tryConvertToPromise(this.value, this.array._promise);\\\\n    if (value instanceof Promise) {\\\\n        this.array._currentCancellable = value;\\\\n        return value._then(gotValue, undefined, undefined, this, undefined);\\\\n    } else {\\\\n        return gotValue.call(this, value);\\\\n    }\\\\n}\\\\n\\\\nfunction gotValue(value) {\\\\n    var array = this.array;\\\\n    var promise = array._promise;\\\\n    var fn = tryCatch(array._fn);\\\\n    promise._pushContext();\\\\n    var ret;\\\\n    if (array._eachValues !== undefined) {\\\\n        ret = fn.call(promise._boundValue(), value, this.index, this.length);\\\\n    } else {\\\\n        ret = fn.call(promise._boundValue(),\\\\n                              this.accum, value, this.index, this.length);\\\\n    }\\\\n    if (ret instanceof Promise) {\\\\n        array._currentCancellable = ret;\\\\n    }\\\\n    var promiseCreated = promise._popContext();\\\\n    debug.checkForgottenReturns(\\\\n        ret,\\\\n        promiseCreated,\\\\n        array._eachValues !== undefined ? \\"Promise.each\\" : \\"Promise.reduce\\",\\\\n        promise\\\\n    );\\\\n    return ret;\\\\n}\\\\n};\\\\n\\\\n},{\\"./util\\":36}],29:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar schedule;\\\\nvar noAsyncScheduler = function() {\\\\n    throw new Error(\\"No async scheduler available\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n};\\\\nif (util.isNode && typeof MutationObserver === \\"undefined\\") {\\\\n    var GlobalSetImmediate = global.setImmediate;\\\\n    var ProcessNextTick = process.nextTick;\\\\n    schedule = util.isRecentNode\\\\n                ? function(fn) { GlobalSetImmediate.call(global, fn); }\\\\n                : function(fn) { ProcessNextTick.call(process, fn); };\\\\n} else if ((typeof MutationObserver !== \\"undefined\\") &&\\\\n          !(typeof window !== \\"undefined\\" &&\\\\n            window.navigator &&\\\\n            window.navigator.standalone)) {\\\\n    schedule = (function() {\\\\n        var div = document.createElement(\\"div\\");\\\\n        var opts = {attributes: true};\\\\n        var toggleScheduled = false;\\\\n        var div2 = document.createElement(\\"div\\");\\\\n        var o2 = new MutationObserver(function() {\\\\n            div.classList.toggle(\\"foo\\");\\\\n          toggleScheduled = false;\\\\n        });\\\\n        o2.observe(div2, opts);\\\\n\\\\n        var scheduleToggle = function() {\\\\n            if (toggleScheduled) return;\\\\n          toggleScheduled = true;\\\\n          div2.classList.toggle(\\"foo\\");\\\\n        };\\\\n\\\\n        return function schedule(fn) {\\\\n          var o = new MutationObserver(function() {\\\\n            o.disconnect();\\\\n            fn();\\\\n          });\\\\n          o.observe(div, opts);\\\\n          scheduleToggle();\\\\n        };\\\\n    })();\\\\n} else if (typeof setImmediate !== \\"undefined\\") {\\\\n    schedule = function (fn) {\\\\n        setImmediate(fn);\\\\n    };\\\\n} else if (typeof setTimeout !== \\"undefined\\") {\\\\n    schedule = function (fn) {\\\\n        setTimeout(fn, 0);\\\\n    };\\\\n} else {\\\\n    schedule = noAsyncScheduler;\\\\n}\\\\nmodule.exports = schedule;\\\\n\\\\n},{\\"./util\\":36}],30:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\n    function(Promise, PromiseArray, debug) {\\\\nvar PromiseInspection = Promise.PromiseInspection;\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nfunction SettledPromiseArray(values) {\\\\n    this.constructor$(values);\\\\n}\\\\nutil.inherits(SettledPromiseArray, PromiseArray);\\\\n\\\\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\\\\n    this._values[index] = inspection;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        this._resolve(this._values);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    var ret = new PromiseInspection();\\\\n    ret._bitField = 33554432;\\\\n    ret._settledValueField = value;\\\\n    return this._promiseResolved(index, ret);\\\\n};\\\\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\\\\n    var ret = new PromiseInspection();\\\\n    ret._bitField = 16777216;\\\\n    ret._settledValueField = reason;\\\\n    return this._promiseResolved(index, ret);\\\\n};\\\\n\\\\nPromise.settle = function (promises) {\\\\n    debug.deprecated(\\".settle()\\", \\".reflect()\\");\\\\n    return new SettledPromiseArray(promises).promise();\\\\n};\\\\n\\\\nPromise.prototype.settle = function () {\\\\n    return Promise.settle(this);\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],31:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, PromiseArray, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar RangeError = _dereq_(\\"./errors\\").RangeError;\\\\nvar AggregateError = _dereq_(\\"./errors\\").AggregateError;\\\\nvar isArray = util.isArray;\\\\nvar CANCELLATION = {};\\\\n\\\\n\\\\nfunction SomePromiseArray(values) {\\\\n    this.constructor$(values);\\\\n    this._howMany = 0;\\\\n    this._unwrap = false;\\\\n    this._initialized = false;\\\\n}\\\\nutil.inherits(SomePromiseArray, PromiseArray);\\\\n\\\\nSomePromiseArray.prototype._init = function () {\\\\n    if (!this._initialized) {\\\\n        return;\\\\n    }\\\\n    if (this._howMany === 0) {\\\\n        this._resolve([]);\\\\n        return;\\\\n    }\\\\n    this._init$(undefined, -5);\\\\n    var isArrayResolved = isArray(this._values);\\\\n    if (!this._isResolved() &&\\\\n        isArrayResolved &&\\\\n        this._howMany > this._canPossiblyFulfill()) {\\\\n        this._reject(this._getRangeError(this.length()));\\\\n    }\\\\n};\\\\n\\\\nSomePromiseArray.prototype.init = function () {\\\\n    this._initialized = true;\\\\n    this._init();\\\\n};\\\\n\\\\nSomePromiseArray.prototype.setUnwrap = function () {\\\\n    this._unwrap = true;\\\\n};\\\\n\\\\nSomePromiseArray.prototype.howMany = function () {\\\\n    return this._howMany;\\\\n};\\\\n\\\\nSomePromiseArray.prototype.setHowMany = function (count) {\\\\n    this._howMany = count;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\\\\n    this._addFulfilled(value);\\\\n    if (this._fulfilled() === this.howMany()) {\\\\n        this._values.length = this.howMany();\\\\n        if (this.howMany() === 1 && this._unwrap) {\\\\n            this._resolve(this._values[0]);\\\\n        } else {\\\\n            this._resolve(this._values);\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n\\\\n};\\\\nSomePromiseArray.prototype._promiseRejected = function (reason) {\\\\n    this._addRejected(reason);\\\\n    return this._checkOutcome();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._promiseCancelled = function () {\\\\n    if (this._values instanceof Promise || this._values == null) {\\\\n        return this._cancel();\\\\n    }\\\\n    this._addRejected(CANCELLATION);\\\\n    return this._checkOutcome();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._checkOutcome = function() {\\\\n    if (this.howMany() > this._canPossiblyFulfill()) {\\\\n        var e = new AggregateError();\\\\n        for (var i = this.length(); i < this._values.length; ++i) {\\\\n            if (this._values[i] !== CANCELLATION) {\\\\n                e.push(this._values[i]);\\\\n            }\\\\n        }\\\\n        if (e.length > 0) {\\\\n            this._reject(e);\\\\n        } else {\\\\n            this._cancel();\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._fulfilled = function () {\\\\n    return this._totalResolved;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._rejected = function () {\\\\n    return this._values.length - this.length();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._addRejected = function (reason) {\\\\n    this._values.push(reason);\\\\n};\\\\n\\\\nSomePromiseArray.prototype._addFulfilled = function (value) {\\\\n    this._values[this._totalResolved++] = value;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\\\\n    return this.length() - this._rejected();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._getRangeError = function (count) {\\\\n    var message = \\"Input array must contain at least \\" +\\\\n            this._howMany + \\" items but contains only \\" + count + \\" items\\";\\\\n    return new RangeError(message);\\\\n};\\\\n\\\\nSomePromiseArray.prototype._resolveEmptyArray = function () {\\\\n    this._reject(this._getRangeError(0));\\\\n};\\\\n\\\\nfunction some(promises, howMany) {\\\\n    if ((howMany | 0) !== howMany || howMany < 0) {\\\\n        return apiRejection(\\"expecting a positive integer\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var ret = new SomePromiseArray(promises);\\\\n    var promise = ret.promise();\\\\n    ret.setHowMany(howMany);\\\\n    ret.init();\\\\n    return promise;\\\\n}\\\\n\\\\nPromise.some = function (promises, howMany) {\\\\n    return some(promises, howMany);\\\\n};\\\\n\\\\nPromise.prototype.some = function (howMany) {\\\\n    return some(this, howMany);\\\\n};\\\\n\\\\nPromise._SomePromiseArray = SomePromiseArray;\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],32:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nfunction PromiseInspection(promise) {\\\\n    if (promise !== undefined) {\\\\n        promise = promise._target();\\\\n        this._bitField = promise._bitField;\\\\n        this._settledValueField = promise._isFateSealed()\\\\n            ? promise._settledValue() : undefined;\\\\n    }\\\\n    else {\\\\n        this._bitField = 0;\\\\n        this._settledValueField = undefined;\\\\n    }\\\\n}\\\\n\\\\nPromiseInspection.prototype._settledValue = function() {\\\\n    return this._settledValueField;\\\\n};\\\\n\\\\nvar value = PromiseInspection.prototype.value = function () {\\\\n    if (!this.isFulfilled()) {\\\\n        throw new TypeError(\\"cannot get fulfillment value of a non-fulfilled promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nvar reason = PromiseInspection.prototype.error =\\\\nPromiseInspection.prototype.reason = function () {\\\\n    if (!this.isRejected()) {\\\\n        throw new TypeError(\\"cannot get rejection reason of a non-rejected promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\\\\n    return (this._bitField & 33554432) !== 0;\\\\n};\\\\n\\\\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\\\\n    return (this._bitField & 16777216) !== 0;\\\\n};\\\\n\\\\nvar isPending = PromiseInspection.prototype.isPending = function () {\\\\n    return (this._bitField & 50397184) === 0;\\\\n};\\\\n\\\\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\\\\n    return (this._bitField & 50331648) !== 0;\\\\n};\\\\n\\\\nPromiseInspection.prototype.isCancelled =\\\\nPromise.prototype._isCancelled = function() {\\\\n    return (this._bitField & 65536) === 65536;\\\\n};\\\\n\\\\nPromise.prototype.isCancelled = function() {\\\\n    return this._target()._isCancelled();\\\\n};\\\\n\\\\nPromise.prototype.isPending = function() {\\\\n    return isPending.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isRejected = function() {\\\\n    return isRejected.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isFulfilled = function() {\\\\n    return isFulfilled.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isResolved = function() {\\\\n    return isResolved.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.value = function() {\\\\n    return value.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.reason = function() {\\\\n    var target = this._target();\\\\n    target._unsetRejectionIsUnhandled();\\\\n    return reason.call(target);\\\\n};\\\\n\\\\nPromise.prototype._value = function() {\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nPromise.prototype._reason = function() {\\\\n    this._unsetRejectionIsUnhandled();\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nPromise.PromiseInspection = PromiseInspection;\\\\n};\\\\n\\\\n},{}],33:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar errorObj = util.errorObj;\\\\nvar isObject = util.isObject;\\\\n\\\\nfunction tryConvertToPromise(obj, context) {\\\\n    if (isObject(obj)) {\\\\n        if (obj instanceof Promise) return obj;\\\\n        var then = getThen(obj);\\\\n        if (then === errorObj) {\\\\n            if (context) context._pushContext();\\\\n            var ret = Promise.reject(then.e);\\\\n            if (context) context._popContext();\\\\n            return ret;\\\\n        } else if (typeof then === \\"function\\") {\\\\n            if (isAnyBluebirdPromise(obj)) {\\\\n                var ret = new Promise(INTERNAL);\\\\n                obj._then(\\\\n                    ret._fulfill,\\\\n                    ret._reject,\\\\n                    undefined,\\\\n                    ret,\\\\n                    null\\\\n                );\\\\n                return ret;\\\\n            }\\\\n            return doThenable(obj, then, context);\\\\n        }\\\\n    }\\\\n    return obj;\\\\n}\\\\n\\\\nfunction doGetThen(obj) {\\\\n    return obj.then;\\\\n}\\\\n\\\\nfunction getThen(obj) {\\\\n    try {\\\\n        return doGetThen(obj);\\\\n    } catch (e) {\\\\n        errorObj.e = e;\\\\n        return errorObj;\\\\n    }\\\\n}\\\\n\\\\nvar hasProp = {}.hasOwnProperty;\\\\nfunction isAnyBluebirdPromise(obj) {\\\\n    return hasProp.call(obj, \\"_promise0\\");\\\\n}\\\\n\\\\nfunction doThenable(x, then, context) {\\\\n    var promise = new Promise(INTERNAL);\\\\n    var ret = promise;\\\\n    if (context) context._pushContext();\\\\n    promise._captureStackTrace();\\\\n    if (context) context._popContext();\\\\n    var synchronous = true;\\\\n    var result = util.tryCatch(then).call(x, resolve, reject);\\\\n    synchronous = false;\\\\n\\\\n    if (promise && result === errorObj) {\\\\n        promise._rejectCallback(result.e, true, true);\\\\n        promise = null;\\\\n    }\\\\n\\\\n    function resolve(value) {\\\\n        if (!promise) return;\\\\n        promise._resolveCallback(value);\\\\n        promise = null;\\\\n    }\\\\n\\\\n    function reject(reason) {\\\\n        if (!promise) return;\\\\n        promise._rejectCallback(reason, synchronous, true);\\\\n        promise = null;\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nreturn tryConvertToPromise;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],34:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar TimeoutError = Promise.TimeoutError;\\\\n\\\\nfunction HandleWrapper(handle)  {\\\\n    this.handle = handle;\\\\n}\\\\n\\\\nHandleWrapper.prototype._resultCancelled = function() {\\\\n    clearTimeout(this.handle);\\\\n};\\\\n\\\\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\\\\nvar delay = Promise.delay = function (ms, value) {\\\\n    var ret;\\\\n    var handle;\\\\n    if (value !== undefined) {\\\\n        ret = Promise.resolve(value)\\\\n                ._then(afterValue, null, null, ms, undefined);\\\\n        if (debug.cancellation() && value instanceof Promise) {\\\\n            ret._setOnCancel(value);\\\\n        }\\\\n    } else {\\\\n        ret = new Promise(INTERNAL);\\\\n        handle = setTimeout(function() { ret._fulfill(); }, +ms);\\\\n        if (debug.cancellation()) {\\\\n            ret._setOnCancel(new HandleWrapper(handle));\\\\n        }\\\\n    }\\\\n    ret._setAsyncGuaranteed();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype.delay = function (ms) {\\\\n    return delay(ms, this);\\\\n};\\\\n\\\\nvar afterTimeout = function (promise, message, parent) {\\\\n    var err;\\\\n    if (typeof message !== \\"string\\") {\\\\n        if (message instanceof Error) {\\\\n            err = message;\\\\n        } else {\\\\n            err = new TimeoutError(\\"operation timed out\\");\\\\n        }\\\\n    } else {\\\\n        err = new TimeoutError(message);\\\\n    }\\\\n    util.markAsOriginatingFromRejection(err);\\\\n    promise._attachExtraTrace(err);\\\\n    promise._reject(err);\\\\n\\\\n    if (parent != null) {\\\\n        parent.cancel();\\\\n    }\\\\n};\\\\n\\\\nfunction successClear(value) {\\\\n    clearTimeout(this.handle);\\\\n    return value;\\\\n}\\\\n\\\\nfunction failureClear(reason) {\\\\n    clearTimeout(this.handle);\\\\n    throw reason;\\\\n}\\\\n\\\\nPromise.prototype.timeout = function (ms, message) {\\\\n    ms = +ms;\\\\n    var ret, parent;\\\\n\\\\n    var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\\\\n        if (ret.isPending()) {\\\\n            afterTimeout(ret, message, parent);\\\\n        }\\\\n    }, ms));\\\\n\\\\n    if (debug.cancellation()) {\\\\n        parent = this.then();\\\\n        ret = parent._then(successClear, failureClear,\\\\n                            undefined, handleWrapper, undefined);\\\\n        ret._setOnCancel(handleWrapper);\\\\n    } else {\\\\n        ret = this._then(successClear, failureClear,\\\\n                            undefined, handleWrapper, undefined);\\\\n    }\\\\n\\\\n    return ret;\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],35:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\\\\n    createContext, INTERNAL, debug) {\\\\n    var util = _dereq_(\\"./util\\");\\\\n    var TypeError = _dereq_(\\"./errors\\").TypeError;\\\\n    var inherits = _dereq_(\\"./util\\").inherits;\\\\n    var errorObj = util.errorObj;\\\\n    var tryCatch = util.tryCatch;\\\\n\\\\n    function thrower(e) {\\\\n        setTimeout(function(){throw e;}, 0);\\\\n    }\\\\n\\\\n    function castPreservingDisposable(thenable) {\\\\n        var maybePromise = tryConvertToPromise(thenable);\\\\n        if (maybePromise !== thenable &&\\\\n            typeof thenable._isDisposable === \\"function\\" &&\\\\n            typeof thenable._getDisposer === \\"function\\" &&\\\\n            thenable._isDisposable()) {\\\\n            maybePromise._setDisposable(thenable._getDisposer());\\\\n        }\\\\n        return maybePromise;\\\\n    }\\\\n    function dispose(resources, inspection) {\\\\n        var i = 0;\\\\n        var len = resources.length;\\\\n        var ret = new Promise(INTERNAL);\\\\n        function iterator() {\\\\n            if (i >= len) return ret._fulfill();\\\\n            var maybePromise = castPreservingDisposable(resources[i++]);\\\\n            if (maybePromise instanceof Promise &&\\\\n                maybePromise._isDisposable()) {\\\\n                try {\\\\n                    maybePromise = tryConvertToPromise(\\\\n                        maybePromise._getDisposer().tryDispose(inspection),\\\\n                        resources.promise);\\\\n                } catch (e) {\\\\n                    return thrower(e);\\\\n                }\\\\n                if (maybePromise instanceof Promise) {\\\\n                    return maybePromise._then(iterator, thrower,\\\\n                                              null, null, null);\\\\n                }\\\\n            }\\\\n            iterator();\\\\n        }\\\\n        iterator();\\\\n        return ret;\\\\n    }\\\\n\\\\n    function Disposer(data, promise, context) {\\\\n        this._data = data;\\\\n        this._promise = promise;\\\\n        this._context = context;\\\\n    }\\\\n\\\\n    Disposer.prototype.data = function () {\\\\n        return this._data;\\\\n    };\\\\n\\\\n    Disposer.prototype.promise = function () {\\\\n        return this._promise;\\\\n    };\\\\n\\\\n    Disposer.prototype.resource = function () {\\\\n        if (this.promise().isFulfilled()) {\\\\n            return this.promise().value();\\\\n        }\\\\n        return null;\\\\n    };\\\\n\\\\n    Disposer.prototype.tryDispose = function(inspection) {\\\\n        var resource = this.resource();\\\\n        var context = this._context;\\\\n        if (context !== undefined) context._pushContext();\\\\n        var ret = resource !== null\\\\n            ? this.doDispose(resource, inspection) : null;\\\\n        if (context !== undefined) context._popContext();\\\\n        this._promise._unsetDisposable();\\\\n        this._data = null;\\\\n        return ret;\\\\n    };\\\\n\\\\n    Disposer.isDisposer = function (d) {\\\\n        return (d != null &&\\\\n                typeof d.resource === \\"function\\" &&\\\\n                typeof d.tryDispose === \\"function\\");\\\\n    };\\\\n\\\\n    function FunctionDisposer(fn, promise, context) {\\\\n        this.constructor$(fn, promise, context);\\\\n    }\\\\n    inherits(FunctionDisposer, Disposer);\\\\n\\\\n    FunctionDisposer.prototype.doDispose = function (resource, inspection) {\\\\n        var fn = this.data();\\\\n        return fn.call(resource, resource, inspection);\\\\n    };\\\\n\\\\n    function maybeUnwrapDisposer(value) {\\\\n        if (Disposer.isDisposer(value)) {\\\\n            this.resources[this.index]._setDisposable(value);\\\\n            return value.promise();\\\\n        }\\\\n        return value;\\\\n    }\\\\n\\\\n    function ResourceList(length) {\\\\n        this.length = length;\\\\n        this.promise = null;\\\\n        this[length-1] = null;\\\\n    }\\\\n\\\\n    ResourceList.prototype._resultCancelled = function() {\\\\n        var len = this.length;\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var item = this[i];\\\\n            if (item instanceof Promise) {\\\\n                item.cancel();\\\\n            }\\\\n        }\\\\n    };\\\\n\\\\n    Promise.using = function () {\\\\n        var len = arguments.length;\\\\n        if (len < 2) return apiRejection(\\\\n                        \\"you must pass at least 2 arguments to Promise.using\\");\\\\n        var fn = arguments[len - 1];\\\\n        if (typeof fn !== \\"function\\") {\\\\n            return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n        }\\\\n        var input;\\\\n        var spreadArgs = true;\\\\n        if (len === 2 && Array.isArray(arguments[0])) {\\\\n            input = arguments[0];\\\\n            len = input.length;\\\\n            spreadArgs = false;\\\\n        } else {\\\\n            input = arguments;\\\\n            len--;\\\\n        }\\\\n        var resources = new ResourceList(len);\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var resource = input[i];\\\\n            if (Disposer.isDisposer(resource)) {\\\\n                var disposer = resource;\\\\n                resource = resource.promise();\\\\n                resource._setDisposable(disposer);\\\\n            } else {\\\\n                var maybePromise = tryConvertToPromise(resource);\\\\n                if (maybePromise instanceof Promise) {\\\\n                    resource =\\\\n                        maybePromise._then(maybeUnwrapDisposer, null, null, {\\\\n                            resources: resources,\\\\n                            index: i\\\\n                    }, undefined);\\\\n                }\\\\n            }\\\\n            resources[i] = resource;\\\\n        }\\\\n\\\\n        var reflectedResources = new Array(resources.length);\\\\n        for (var i = 0; i < reflectedResources.length; ++i) {\\\\n            reflectedResources[i] = Promise.resolve(resources[i]).reflect();\\\\n        }\\\\n\\\\n        var resultPromise = Promise.all(reflectedResources)\\\\n            .then(function(inspections) {\\\\n                for (var i = 0; i < inspections.length; ++i) {\\\\n                    var inspection = inspections[i];\\\\n                    if (inspection.isRejected()) {\\\\n                        errorObj.e = inspection.error();\\\\n                        return errorObj;\\\\n                    } else if (!inspection.isFulfilled()) {\\\\n                        resultPromise.cancel();\\\\n                        return;\\\\n                    }\\\\n                    inspections[i] = inspection.value();\\\\n                }\\\\n                promise._pushContext();\\\\n\\\\n                fn = tryCatch(fn);\\\\n                var ret = spreadArgs\\\\n                    ? fn.apply(undefined, inspections) : fn(inspections);\\\\n                var promiseCreated = promise._popContext();\\\\n                debug.checkForgottenReturns(\\\\n                    ret, promiseCreated, \\"Promise.using\\", promise);\\\\n                return ret;\\\\n            });\\\\n\\\\n        var promise = resultPromise.lastly(function() {\\\\n            var inspection = new Promise.PromiseInspection(resultPromise);\\\\n            return dispose(resources, inspection);\\\\n        });\\\\n        resources.promise = promise;\\\\n        promise._setOnCancel(resources);\\\\n        return promise;\\\\n    };\\\\n\\\\n    Promise.prototype._setDisposable = function (disposer) {\\\\n        this._bitField = this._bitField | 131072;\\\\n        this._disposer = disposer;\\\\n    };\\\\n\\\\n    Promise.prototype._isDisposable = function () {\\\\n        return (this._bitField & 131072) > 0;\\\\n    };\\\\n\\\\n    Promise.prototype._getDisposer = function () {\\\\n        return this._disposer;\\\\n    };\\\\n\\\\n    Promise.prototype._unsetDisposable = function () {\\\\n        this._bitField = this._bitField & (~131072);\\\\n        this._disposer = undefined;\\\\n    };\\\\n\\\\n    Promise.prototype.disposer = function (fn) {\\\\n        if (typeof fn === \\"function\\") {\\\\n            return new FunctionDisposer(fn, this, createContext());\\\\n        }\\\\n        throw new TypeError();\\\\n    };\\\\n\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],36:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar canEvaluate = typeof navigator == \\"undefined\\";\\\\n\\\\nvar errorObj = {e: {}};\\\\nvar tryCatchTarget;\\\\nvar globalObject = typeof self !== \\"undefined\\" ? self :\\\\n    typeof window !== \\"undefined\\" ? window :\\\\n    typeof global !== \\"undefined\\" ? global :\\\\n    this !== undefined ? this : null;\\\\n\\\\nfunction tryCatcher() {\\\\n    try {\\\\n        var target = tryCatchTarget;\\\\n        tryCatchTarget = null;\\\\n        return target.apply(this, arguments);\\\\n    } catch (e) {\\\\n        errorObj.e = e;\\\\n        return errorObj;\\\\n    }\\\\n}\\\\nfunction tryCatch(fn) {\\\\n    tryCatchTarget = fn;\\\\n    return tryCatcher;\\\\n}\\\\n\\\\nvar inherits = function(Child, Parent) {\\\\n    var hasProp = {}.hasOwnProperty;\\\\n\\\\n    function T() {\\\\n        this.constructor = Child;\\\\n        this.constructor$ = Parent;\\\\n        for (var propertyName in Parent.prototype) {\\\\n            if (hasProp.call(Parent.prototype, propertyName) &&\\\\n                propertyName.charAt(propertyName.length-1) !== \\"$\\"\\\\n           ) {\\\\n                this[propertyName + \\"$\\"] = Parent.prototype[propertyName];\\\\n            }\\\\n        }\\\\n    }\\\\n    T.prototype = Parent.prototype;\\\\n    Child.prototype = new T();\\\\n    return Child.prototype;\\\\n};\\\\n\\\\n\\\\nfunction isPrimitive(val) {\\\\n    return val == null || val === true || val === false ||\\\\n        typeof val === \\"string\\" || typeof val === \\"number\\";\\\\n\\\\n}\\\\n\\\\nfunction isObject(value) {\\\\n    return typeof value === \\"function\\" ||\\\\n           typeof value === \\"object\\" && value !== null;\\\\n}\\\\n\\\\nfunction maybeWrapAsError(maybeError) {\\\\n    if (!isPrimitive(maybeError)) return maybeError;\\\\n\\\\n    return new Error(safeToString(maybeError));\\\\n}\\\\n\\\\nfunction withAppended(target, appendee) {\\\\n    var len = target.length;\\\\n    var ret = new Array(len + 1);\\\\n    var i;\\\\n    for (i = 0; i < len; ++i) {\\\\n        ret[i] = target[i];\\\\n    }\\\\n    ret[i] = appendee;\\\\n    return ret;\\\\n}\\\\n\\\\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\\\\n    if (es5.isES5) {\\\\n        var desc = Object.getOwnPropertyDescriptor(obj, key);\\\\n\\\\n        if (desc != null) {\\\\n            return desc.get == null && desc.set == null\\\\n                    ? desc.value\\\\n                    : defaultValue;\\\\n        }\\\\n    } else {\\\\n        return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\\\\n    }\\\\n}\\\\n\\\\nfunction notEnumerableProp(obj, name, value) {\\\\n    if (isPrimitive(obj)) return obj;\\\\n    var descriptor = {\\\\n        value: value,\\\\n        configurable: true,\\\\n        enumerable: false,\\\\n        writable: true\\\\n    };\\\\n    es5.defineProperty(obj, name, descriptor);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction thrower(r) {\\\\n    throw r;\\\\n}\\\\n\\\\nvar inheritedDataKeys = (function() {\\\\n    var excludedPrototypes = [\\\\n        Array.prototype,\\\\n        Object.prototype,\\\\n        Function.prototype\\\\n    ];\\\\n\\\\n    var isExcludedProto = function(val) {\\\\n        for (var i = 0; i < excludedPrototypes.length; ++i) {\\\\n            if (excludedPrototypes[i] === val) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    };\\\\n\\\\n    if (es5.isES5) {\\\\n        var getKeys = Object.getOwnPropertyNames;\\\\n        return function(obj) {\\\\n            var ret = [];\\\\n            var visitedKeys = Object.create(null);\\\\n            while (obj != null && !isExcludedProto(obj)) {\\\\n                var keys;\\\\n                try {\\\\n                    keys = getKeys(obj);\\\\n                } catch (e) {\\\\n                    return ret;\\\\n                }\\\\n                for (var i = 0; i < keys.length; ++i) {\\\\n                    var key = keys[i];\\\\n                    if (visitedKeys[key]) continue;\\\\n                    visitedKeys[key] = true;\\\\n                    var desc = Object.getOwnPropertyDescriptor(obj, key);\\\\n                    if (desc != null && desc.get == null && desc.set == null) {\\\\n                        ret.push(key);\\\\n                    }\\\\n                }\\\\n                obj = es5.getPrototypeOf(obj);\\\\n            }\\\\n            return ret;\\\\n        };\\\\n    } else {\\\\n        var hasProp = {}.hasOwnProperty;\\\\n        return function(obj) {\\\\n            if (isExcludedProto(obj)) return [];\\\\n            var ret = [];\\\\n\\\\n            /*jshint forin:false */\\\\n            enumeration: for (var key in obj) {\\\\n                if (hasProp.call(obj, key)) {\\\\n                    ret.push(key);\\\\n                } else {\\\\n                    for (var i = 0; i < excludedPrototypes.length; ++i) {\\\\n                        if (hasProp.call(excludedPrototypes[i], key)) {\\\\n                            continue enumeration;\\\\n                        }\\\\n                    }\\\\n                    ret.push(key);\\\\n                }\\\\n            }\\\\n            return ret;\\\\n        };\\\\n    }\\\\n\\\\n})();\\\\n\\\\nvar thisAssignmentPattern = /this\\\\\\\\s*\\\\\\\\.\\\\\\\\s*\\\\\\\\S+\\\\\\\\s*=/;\\\\nfunction isClass(fn) {\\\\n    try {\\\\n        if (typeof fn === \\"function\\") {\\\\n            var keys = es5.names(fn.prototype);\\\\n\\\\n            var hasMethods = es5.isES5 && keys.length > 1;\\\\n            var hasMethodsOtherThanConstructor = keys.length > 0 &&\\\\n                !(keys.length === 1 && keys[0] === \\"constructor\\");\\\\n            var hasThisAssignmentAndStaticMethods =\\\\n                thisAssignmentPattern.test(fn + \\"\\") && es5.names(fn).length > 0;\\\\n\\\\n            if (hasMethods || hasMethodsOtherThanConstructor ||\\\\n                hasThisAssignmentAndStaticMethods) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    } catch (e) {\\\\n        return false;\\\\n    }\\\\n}\\\\n\\\\nfunction toFastProperties(obj) {\\\\n    /*jshint -W027,-W055,-W031*/\\\\n    function FakeConstructor() {}\\\\n    FakeConstructor.prototype = obj;\\\\n    var l = 8;\\\\n    while (l--) new FakeConstructor();\\\\n    return obj;\\\\n    eval(obj);\\\\n}\\\\n\\\\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\\\\nfunction isIdentifier(str) {\\\\n    return rident.test(str);\\\\n}\\\\n\\\\nfunction filledRange(count, prefix, suffix) {\\\\n    var ret = new Array(count);\\\\n    for(var i = 0; i < count; ++i) {\\\\n        ret[i] = prefix + i + suffix;\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction safeToString(obj) {\\\\n    try {\\\\n        return obj + \\"\\";\\\\n    } catch (e) {\\\\n        return \\"[no string representation]\\";\\\\n    }\\\\n}\\\\n\\\\nfunction isError(obj) {\\\\n    return obj !== null &&\\\\n           typeof obj === \\"object\\" &&\\\\n           typeof obj.message === \\"string\\" &&\\\\n           typeof obj.name === \\"string\\";\\\\n}\\\\n\\\\nfunction markAsOriginatingFromRejection(e) {\\\\n    try {\\\\n        notEnumerableProp(e, \\"isOperational\\", true);\\\\n    }\\\\n    catch(ignore) {}\\\\n}\\\\n\\\\nfunction originatesFromRejection(e) {\\\\n    if (e == null) return false;\\\\n    return ((e instanceof Error[\\"__BluebirdErrorTypes__\\"].OperationalError) ||\\\\n        e[\\"isOperational\\"] === true);\\\\n}\\\\n\\\\nfunction canAttachTrace(obj) {\\\\n    return isError(obj) && es5.propertyIsWritable(obj, \\"stack\\");\\\\n}\\\\n\\\\nvar ensureErrorObject = (function() {\\\\n    if (!(\\"stack\\" in new Error())) {\\\\n        return function(value) {\\\\n            if (canAttachTrace(value)) return value;\\\\n            try {throw new Error(safeToString(value));}\\\\n            catch(err) {return err;}\\\\n        };\\\\n    } else {\\\\n        return function(value) {\\\\n            if (canAttachTrace(value)) return value;\\\\n            return new Error(safeToString(value));\\\\n        };\\\\n    }\\\\n})();\\\\n\\\\nfunction classString(obj) {\\\\n    return {}.toString.call(obj);\\\\n}\\\\n\\\\nfunction copyDescriptors(from, to, filter) {\\\\n    var keys = es5.names(from);\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var key = keys[i];\\\\n        if (filter(key)) {\\\\n            try {\\\\n                es5.defineProperty(to, key, es5.getDescriptor(from, key));\\\\n            } catch (ignore) {}\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nvar asArray = function(v) {\\\\n    if (es5.isArray(v)) {\\\\n        return v;\\\\n    }\\\\n    return null;\\\\n};\\\\n\\\\nif (typeof Symbol !== \\"undefined\\" && Symbol.iterator) {\\\\n    var ArrayFrom = typeof Array.from === \\"function\\" ? function(v) {\\\\n        return Array.from(v);\\\\n    } : function(v) {\\\\n        var ret = [];\\\\n        var it = v[Symbol.iterator]();\\\\n        var itResult;\\\\n        while (!((itResult = it.next()).done)) {\\\\n            ret.push(itResult.value);\\\\n        }\\\\n        return ret;\\\\n    };\\\\n\\\\n    asArray = function(v) {\\\\n        if (es5.isArray(v)) {\\\\n            return v;\\\\n        } else if (v != null && typeof v[Symbol.iterator] === \\"function\\") {\\\\n            return ArrayFrom(v);\\\\n        }\\\\n        return null;\\\\n    };\\\\n}\\\\n\\\\nvar isNode = typeof process !== \\"undefined\\" &&\\\\n        classString(process).toLowerCase() === \\"[object process]\\";\\\\n\\\\nfunction env(key, def) {\\\\n    return isNode ? __webpack_require__.i({\\"NODE_ENV\\":\\"production\\",\\"DC_NETWORK\\":\\"ropsten\\",\\"PUBLIC_URL\\":\\"\\"})[key] : def;\\\\n}\\\\n\\\\nvar ret = {\\\\n    isClass: isClass,\\\\n    isIdentifier: isIdentifier,\\\\n    inheritedDataKeys: inheritedDataKeys,\\\\n    getDataPropertyOrDefault: getDataPropertyOrDefault,\\\\n    thrower: thrower,\\\\n    isArray: es5.isArray,\\\\n    asArray: asArray,\\\\n    notEnumerableProp: notEnumerableProp,\\\\n    isPrimitive: isPrimitive,\\\\n    isObject: isObject,\\\\n    isError: isError,\\\\n    canEvaluate: canEvaluate,\\\\n    errorObj: errorObj,\\\\n    tryCatch: tryCatch,\\\\n    inherits: inherits,\\\\n    withAppended: withAppended,\\\\n    maybeWrapAsError: maybeWrapAsError,\\\\n    toFastProperties: toFastProperties,\\\\n    filledRange: filledRange,\\\\n    toString: safeToString,\\\\n    canAttachTrace: canAttachTrace,\\\\n    ensureErrorObject: ensureErrorObject,\\\\n    originatesFromRejection: originatesFromRejection,\\\\n    markAsOriginatingFromRejection: markAsOriginatingFromRejection,\\\\n    classString: classString,\\\\n    copyDescriptors: copyDescriptors,\\\\n    hasDevTools: typeof chrome !== \\"undefined\\" && chrome &&\\\\n                 typeof chrome.loadTimes === \\"function\\",\\\\n    isNode: isNode,\\\\n    env: env,\\\\n    global: globalObject\\\\n};\\\\nret.isRecentNode = ret.isNode && (function() {\\\\n    var version = process.versions.node.split(\\".\\").map(Number);\\\\n    return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\\\\n})();\\\\n\\\\nif (ret.isNode) ret.toFastProperties(process);\\\\n\\\\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\\\\nmodule.exports = ret;\\\\n\\\\n},{\\"./es5\\":13}]},{},[4])(4)\\\\n});                    ;if (typeof window !== \\\\\'undefined\\\\\' && window !== null) {                               window.P = window.Promise;                                                     } else if (typeof self !== \\\\\'undefined\\\\\' && self !== null) {                             self.P = self.Promise;                                                         }\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13), __webpack_require__(4), __webpack_require__(53).setImmediate))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-promievent/~/bluebird/js/browser/bluebird.js\\\\n// module id = 337\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-promievent/node_modules/bluebird/js/browser/bluebird.js\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file batch.js\\\\n * @author Marek Kotewicz <marek@ethdev.com>\\\\n * @date 2015\\\\n */\\\\n\\\\n\\\\n\\\\nvar Jsonrpc = __webpack_require__(156);\\\\nvar errors = __webpack_require__(7).errors;\\\\n\\\\nvar Batch = function (requestManager) {\\\\n    this.requestManager = requestManager;\\\\n    this.requests = [];\\\\n};\\\\n\\\\n/**\\\\n * Should be called to add create new request to batch request\\\\n *\\\\n * @method add\\\\n * @param {Object} jsonrpc requet object\\\\n */\\\\nBatch.prototype.add = function (request) {\\\\n    this.requests.push(request);\\\\n};\\\\n\\\\n/**\\\\n * Should be called to execute batch request\\\\n *\\\\n * @method execute\\\\n */\\\\nBatch.prototype.execute = function () {\\\\n    var requests = this.requests;\\\\n    this.requestManager.sendBatch(requests, function (err, results) {\\\\n        results = results || [];\\\\n        requests.map(function (request, index) {\\\\n            return results[index] || {};\\\\n        }).forEach(function (result, index) {\\\\n            if (requests[index].callback) {\\\\n\\\\n                if (result && result.error) {\\\\n                    return requests[index].callback(errors.ErrorResponse(result));\\\\n                }\\\\n\\\\n                if (!Jsonrpc.isValidResponse(result)) {\\\\n                    return requests[index].callback(errors.InvalidResponse(result));\\\\n                }\\\\n\\\\n                requests[index].callback(null, (requests[index].format ? requests[index].format(result.result) : result.result));\\\\n            }\\\\n        });\\\\n    });\\\\n};\\\\n\\\\nmodule.exports = Batch;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-requestmanager/src/batch.js\\\\n// module id = 338\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-requestmanager/src/batch.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file givenProvider.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar givenProvider = null;\\\\n\\\\n// ADD GIVEN PROVIDER\\\\n/* jshint ignore:start */\\\\nvar global = Function(\'return this\')();\\\\n\\\\n// EthereumProvider\\\\nif(typeof global.ethereumProvider !== \'undefined\') {\\\\n    givenProvider = global.ethereumProvider;\\\\n\\\\n// Legacy web3.currentProvider\\\\n} else if(typeof global.web3 !== \'undefined\' && global.web3.currentProvider) {\\\\n\\\\n    if(global.web3.currentProvider.sendAsync) {\\\\n        global.web3.currentProvider.send = global.web3.currentProvider.sendAsync;\\\\n        delete global.web3.currentProvider.sendAsync;\\\\n    }\\\\n\\\\n    // if connection is \'ipcProviderWrapper\', add subscription support\\\\n    if(!global.web3.currentProvider.on &&\\\\n        global.web3.currentProvider.connection &&\\\\n        global.web3.currentProvider.connection.constructor.name === \'ipcProviderWrapper\') {\\\\n\\\\n        global.web3.currentProvider.on = function (type, callback) {\\\\n\\\\n            if(typeof callback !== \'function\')\\\\n                throw new Error(\'The second parameter callback must be a function.\');\\\\n\\\\n            switch(type){\\\\n                case \'data\':\\\\n                    this.connection.on(\'data\', function(data) {\\\\n                        var result = \'\';\\\\n\\\\n                        data = data.toString();\\\\n\\\\n                        try {\\\\n                            result = JSON.parse(data);\\\\n                        } catch(e) {\\\\n                            return callback(new Error(\'Couldn\\\\\\\\\'t parse response data\'+ data));\\\\n                        }\\\\n\\\\n                        // notification\\\\n                        if(!result.id && result.method.indexOf(\'_subscription\') !== -1) {\\\\n                            callback(null, result);\\\\n                        }\\\\n\\\\n                    });\\\\n                    break;\\\\n\\\\n                default:\\\\n                    this.connection.on(type, callback);\\\\n                    break;\\\\n            }\\\\n        };\\\\n    }\\\\n\\\\n    givenProvider = global.web3.currentProvider;\\\\n}\\\\n/* jshint ignore:end */\\\\n\\\\n\\\\nmodule.exports = givenProvider;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-requestmanager/src/givenProvider.js\\\\n// module id = 339\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-requestmanager/src/givenProvider.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar Jsonrpc = __webpack_require__(156);\\\\nvar BatchManager = __webpack_require__(338);\\\\nvar givenProvider = __webpack_require__(339);\\\\n\\\\n\\\\n\\\\n    /**\\\\n * It\'s responsible for passing messages to providers\\\\n * It\'s also responsible for polling the ethereum node for incoming messages\\\\n * Default poll timeout is 1 second\\\\n * Singleton\\\\n */\\\\nvar RequestManager = function RequestManager(provider) {\\\\n    this.provider = null;\\\\n    this.providers = RequestManager.providers;\\\\n\\\\n    this.setProvider(provider);\\\\n    this.subscriptions = {};\\\\n};\\\\n\\\\n\\\\n\\\\nRequestManager.givenProvider = givenProvider;\\\\n\\\\nRequestManager.providers = {\\\\n    WebsocketProvider: __webpack_require__(361),\\\\n    HttpProvider: __webpack_require__(359),\\\\n    IpcProvider: __webpack_require__(360)\\\\n};\\\\n\\\\n\\\\n\\\\n/**\\\\n * Should be used to set provider of request manager\\\\n *\\\\n * @method setProvider\\\\n * @param {Object} p\\\\n */\\\\nRequestManager.prototype.setProvider = function (p, net) {\\\\n    var _this = this;\\\\n\\\\n    // autodetect provider\\\\n    if(p && typeof p === \'string\' && this.providers) {\\\\n\\\\n        // HTTP\\\\n        if(/^http(s)?:\\\\\\\\/\\\\\\\\//i.test(p)) {\\\\n            p = new this.providers.HttpProvider(p);\\\\n\\\\n            // WS\\\\n        } else if(/^ws(s)?:\\\\\\\\/\\\\\\\\//i.test(p)) {\\\\n            p = new this.providers.WebsocketProvider(p);\\\\n\\\\n            // IPC\\\\n        } else if(p && typeof net === \'object\'  && typeof net.connect === \'function\') {\\\\n            p = new this.providers.IpcProvider(p, net);\\\\n\\\\n        } else if(p) {\\\\n            throw new Error(\'Can\\\\\\\\\'t autodetect provider for \\\\\\"\'+ p +\'\\\\\\"\');\\\\n        }\\\\n    }\\\\n\\\\n    // reset the old one before changing\\\\n    if(this.provider)\\\\n        this.clearSubscriptions();\\\\n\\\\n\\\\n    this.provider = p || null;\\\\n\\\\n    // listen to incoming notifications\\\\n    if(this.provider && this.provider.on) {\\\\n        this.provider.on(\'data\', function requestManagerNotification(err, result){\\\\n            if(!err) {\\\\n                if(_this.subscriptions[result.params.subscription] && _this.subscriptions[result.params.subscription].callback)\\\\n                    _this.subscriptions[result.params.subscription].callback(null, result.params.result);\\\\n            } else {\\\\n\\\\n                Object.keys(_this.subscriptions).forEach(function(id){\\\\n                    if(_this.subscriptions[id].callback)\\\\n                        _this.subscriptions[id].callback(err);\\\\n                });\\\\n            }\\\\n        });\\\\n    }\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Should be used to asynchronously send request\\\\n *\\\\n * @method sendAsync\\\\n * @param {Object} data\\\\n * @param {Function} callback\\\\n */\\\\nRequestManager.prototype.send = function (data, callback) {\\\\n    callback = callback || function(){};\\\\n\\\\n    if (!this.provider) {\\\\n        return callback(errors.InvalidProvider());\\\\n    }\\\\n\\\\n    var payload = Jsonrpc.toPayload(data.method, data.params);\\\\n    this.provider[this.provider.sendAsync ? \'sendAsync\' : \'send\'](payload, function (err, result) {\\\\n        if(result && result.id && payload.id !== result.id) return callback(new Error(\'Wrong response id \\\\\\"\'+ result.id +\'\\\\\\" (expected: \\\\\\"\'+ payload.id +\'\\\\\\") in \'+ JSON.stringify(payload)));\\\\n\\\\n        if (err) {\\\\n            return callback(err);\\\\n        }\\\\n\\\\n        if (result && result.error) {\\\\n            return callback(errors.ErrorResponse(result));\\\\n        }\\\\n\\\\n        if (!Jsonrpc.isValidResponse(result)) {\\\\n            return callback(errors.InvalidResponse(result));\\\\n        }\\\\n\\\\n        callback(null, result.result);\\\\n    });\\\\n};\\\\n\\\\n/**\\\\n * Should be called to asynchronously send batch request\\\\n *\\\\n * @method sendBatch\\\\n * @param {Array} batch data\\\\n * @param {Function} callback\\\\n */\\\\nRequestManager.prototype.sendBatch = function (data, callback) {\\\\n    if (!this.provider) {\\\\n        return callback(errors.InvalidProvider());\\\\n    }\\\\n\\\\n    var payload = Jsonrpc.toBatchPayload(data);\\\\n    this.provider[this.provider.sendAsync ? \'sendAsync\' : \'send\'](payload, function (err, results) {\\\\n        if (err) {\\\\n            return callback(err);\\\\n        }\\\\n\\\\n        if (!_.isArray(results)) {\\\\n            return callback(errors.InvalidResponse(results));\\\\n        }\\\\n\\\\n        callback(null, results);\\\\n    });\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Waits for notifications\\\\n *\\\\n * @method addSubscription\\\\n * @param {String} id           the subscription id\\\\n * @param {String} name         the subscription name\\\\n * @param {String} type         the subscription namespace (eth, personal, etc)\\\\n * @param {Function} callback   the callback to call for incoming notifications\\\\n */\\\\nRequestManager.prototype.addSubscription = function (id, name, type, callback) {\\\\n    if(this.provider.on) {\\\\n        this.subscriptions[id] = {\\\\n            callback: callback,\\\\n            type: type,\\\\n            name: name\\\\n        };\\\\n\\\\n    } else {\\\\n        throw new Error(\'The provider doesn\\\\\\\\\'t support subscriptions: \'+ this.provider.constructor.name);\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Waits for notifications\\\\n *\\\\n * @method removeSubscription\\\\n * @param {String} id           the subscription id\\\\n * @param {Function} callback   fired once the subscription is removed\\\\n */\\\\nRequestManager.prototype.removeSubscription = function (id, callback) {\\\\n    var _this = this;\\\\n\\\\n    if(this.subscriptions[id]) {\\\\n\\\\n        this.send({\\\\n            method: this.subscriptions[id].type + \'_unsubscribe\',\\\\n            params: [id]\\\\n        }, callback);\\\\n\\\\n        // remove subscription\\\\n        delete _this.subscriptions[id];\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to reset the subscriptions\\\\n *\\\\n * @method reset\\\\n */\\\\nRequestManager.prototype.clearSubscriptions = function (keepIsSyncing) {\\\\n    var _this = this;\\\\n\\\\n\\\\n    // uninstall all subscriptions\\\\n    Object.keys(this.subscriptions).forEach(function(id){\\\\n        if(!keepIsSyncing || _this.subscriptions[id].name !== \'syncing\')\\\\n            _this.removeSubscription(id);\\\\n    });\\\\n\\\\n\\\\n    //  reset notification callbacks etc.\\\\n    if(this.provider.reset)\\\\n        this.provider.reset();\\\\n};\\\\n\\\\nmodule.exports = {\\\\n    Manager: RequestManager,\\\\n    BatchManager: BatchManager\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-requestmanager/src/index.js\\\\n// module id = 340\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-requestmanager/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file subscription.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar EventEmitter = __webpack_require__(129);\\\\n\\\\n\\\\nfunction Subscription(options) {\\\\n    EventEmitter.call(this);\\\\n\\\\n    this.id = null;\\\\n    this.callback = null;\\\\n    this.arguments = null;\\\\n    this._reconnectIntervalId = null;\\\\n\\\\n    this.options = {\\\\n        subscription: options.subscription,\\\\n        type: options.type,\\\\n        requestManager: options.requestManager\\\\n    };\\\\n}\\\\n\\\\n// INHERIT\\\\nSubscription.prototype = Object.create(EventEmitter.prototype);\\\\nSubscription.prototype.constructor = Subscription;\\\\n\\\\n\\\\n/**\\\\n * Should be used to extract callback from array of arguments. Modifies input param\\\\n *\\\\n * @method extractCallback\\\\n * @param {Array} arguments\\\\n * @return {Function|Null} callback, if exists\\\\n */\\\\n\\\\nSubscription.prototype._extractCallback = function (args) {\\\\n    if (_.isFunction(args[args.length - 1])) {\\\\n        return args.pop(); // modify the args array!\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to check if the number of arguments is correct\\\\n *\\\\n * @method validateArgs\\\\n * @param {Array} arguments\\\\n * @throws {Error} if it is not\\\\n */\\\\n\\\\nSubscription.prototype._validateArgs = function (args) {\\\\n    var subscription = this.options.subscription;\\\\n\\\\n    if(!subscription)\\\\n        subscription = {};\\\\n\\\\n    if(!subscription.params)\\\\n        subscription.params = 0;\\\\n\\\\n    if (args.length !== subscription.params) {\\\\n        throw errors.InvalidNumberOfParams(args.length, subscription.params + 1, args[0]);\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Should be called to format input args of method\\\\n *\\\\n * @method formatInput\\\\n * @param {Array}\\\\n * @return {Array}\\\\n */\\\\n\\\\nSubscription.prototype._formatInput = function (args) {\\\\n    var subscription = this.options.subscription;\\\\n\\\\n    if (!subscription) {\\\\n        return args;\\\\n    }\\\\n\\\\n    if (!subscription.inputFormatter) {\\\\n        return args;\\\\n    }\\\\n\\\\n    var formattedArgs = subscription.inputFormatter.map(function (formatter, index) {\\\\n        return formatter ? formatter(args[index]) : args[index];\\\\n    });\\\\n\\\\n    return formattedArgs;\\\\n};\\\\n\\\\n/**\\\\n * Should be called to format output(result) of method\\\\n *\\\\n * @method formatOutput\\\\n * @param {Object}\\\\n * @return {Object}\\\\n */\\\\n\\\\nSubscription.prototype._formatOutput = function (result) {\\\\n    var subscription = this.options.subscription;\\\\n\\\\n    return (subscription && subscription.outputFormatter && result) ? subscription.outputFormatter(result) : result;\\\\n};\\\\n\\\\n/**\\\\n * Should create payload from given input args\\\\n *\\\\n * @method toPayload\\\\n * @param {Array} args\\\\n * @return {Object}\\\\n */\\\\nSubscription.prototype._toPayload = function (args) {\\\\n    var params = [];\\\\n    this.callback = this._extractCallback(args);\\\\n\\\\n    if (!this.subscriptionMethod) {\\\\n        this.subscriptionMethod = args.shift();\\\\n\\\\n        // replace subscription with given name\\\\n        if (this.options.subscription.subscriptionName) {\\\\n            this.subscriptionMethod = this.options.subscription.subscriptionName;\\\\n        }\\\\n    }\\\\n\\\\n    if (!this.arguments) {\\\\n        this.arguments = this._formatInput(args);\\\\n        this._validateArgs(this.arguments);\\\\n        args = []; // make empty after validation\\\\n\\\\n    }\\\\n\\\\n    // re-add subscriptionName\\\\n    params.push(this.subscriptionMethod);\\\\n    params = params.concat(this.arguments);\\\\n\\\\n\\\\n    if (args.length) {\\\\n        throw new Error(\'Only a callback is allowed as parameter on an already instantiated subscription.\');\\\\n    }\\\\n\\\\n    return {\\\\n        method: this.options.type + \'_subscribe\',\\\\n        params: params\\\\n    };\\\\n};\\\\n\\\\n/**\\\\n * Unsubscribes and clears callbacks\\\\n *\\\\n * @method unsubscribe\\\\n * @return {Object}\\\\n */\\\\nSubscription.prototype.unsubscribe = function(callback) {\\\\n    this.options.requestManager.removeSubscription(this.id, callback);\\\\n    this.id = null;\\\\n    this.removeAllListeners();\\\\n    clearInterval(this._reconnectIntervalId);\\\\n};\\\\n\\\\n/**\\\\n * Subscribes and watches for changes\\\\n *\\\\n * @method subscribe\\\\n * @param {String} subscription the subscription\\\\n * @param {Object} options the options object with address topics and fromBlock\\\\n * @return {Object}\\\\n */\\\\nSubscription.prototype.subscribe = function() {\\\\n    var _this = this;\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n    var payload = this._toPayload(args);\\\\n\\\\n    if(!payload) {\\\\n        return this;\\\\n    }\\\\n\\\\n    if(!this.options.requestManager.provider) {\\\\n        var err1 = new Error(\'No provider set.\');\\\\n        this.callback(err1, null, this);\\\\n        this.emit(\'error\', err1);\\\\n        return this;\\\\n    }\\\\n\\\\n    // throw error, if provider doesnt support subscriptions\\\\n    if(!this.options.requestManager.provider.on) {\\\\n        var err2 = new Error(\'The current provider doesn\\\\\\\\\'t support subscriptions: \'+ this.options.requestManager.provider.constructor.name);\\\\n        this.callback(err2, null, this);\\\\n        this.emit(\'error\', err2);\\\\n        return this;\\\\n    }\\\\n\\\\n    // if id is there unsubscribe first\\\\n    if (this.id) {\\\\n        this.unsubscribe();\\\\n    }\\\\n\\\\n    // store the params in the options object\\\\n    this.options.params = payload.params[1];\\\\n\\\\n    // get past logs, if fromBlock is available\\\\n    if(payload.params[0] === \'logs\' && _.isObject(payload.params[1]) && payload.params[1].hasOwnProperty(\'fromBlock\') && isFinite(payload.params[1].fromBlock)) {\\\\n        // send the subscription request\\\\n        this.options.requestManager.send({\\\\n            method: \'eth_getLogs\',\\\\n            params: [payload.params[1]]\\\\n        }, function (err, logs) {\\\\n            if(!err) {\\\\n                logs.forEach(function(log){\\\\n                    var output = _this._formatOutput(log);\\\\n                    _this.callback(null, output, _this);\\\\n                    _this.emit(\'data\', output);\\\\n                });\\\\n\\\\n                // TODO subscribe here? after the past logs?\\\\n\\\\n            } else {\\\\n                _this.callback(err, null, _this);\\\\n                _this.emit(\'error\', err);\\\\n            }\\\\n        });\\\\n    }\\\\n\\\\n    // create subscription\\\\n    // TODO move to separate function? so that past logs can go first?\\\\n\\\\n    if(typeof payload.params[1] === \'object\')\\\\n        delete payload.params[1].fromBlock;\\\\n\\\\n    this.options.requestManager.send(payload, function (err, result) {\\\\n        if(!err && result) {\\\\n            _this.id = result;\\\\n\\\\n            // call callback on notifications\\\\n            _this.options.requestManager.addSubscription(_this.id, payload.params[0] , _this.options.type, function(err, result) {\\\\n\\\\n                // TODO remove once its fixed in geth\\\\n                if(_.isArray(result))\\\\n                    result = result[0];\\\\n\\\\n                var output = _this._formatOutput(result);\\\\n\\\\n                if (!err) {\\\\n\\\\n                    if(_.isFunction(_this.options.subscription.subscriptionHandler)) {\\\\n                        return _this.options.subscription.subscriptionHandler.call(_this, output);\\\\n                    } else {\\\\n                        _this.emit(\'data\', output);\\\\n                    }\\\\n\\\\n                } else {\\\\n                    // unsubscribe, but keep listeners\\\\n                    _this.options.requestManager.removeSubscription(_this.id);\\\\n\\\\n                    // re-subscribe, if connection fails\\\\n                    if(_this.options.requestManager.provider.once) {\\\\n                        _this._reconnectIntervalId = setInterval(function () {\\\\n                            // TODO check if that makes sense!\\\\n                            _this.options.requestManager.provider.reconnect();\\\\n                        }, 500);\\\\n\\\\n                        _this.options.requestManager.provider.once(\'connect\', function () {\\\\n                            clearInterval(_this._reconnectIntervalId);\\\\n                            _this.subscribe(_this.callback);\\\\n                        });\\\\n                    }\\\\n                    _this.emit(\'error\', err);\\\\n                }\\\\n\\\\n                // call the callback, last so that unsubscribe there won\'t affect the emit above\\\\n                if (_.isFunction(_this.callback)) {\\\\n                    _this.callback(err, output, _this);\\\\n                }\\\\n            });\\\\n        } else if (_.isFunction(_this.callback)) {\\\\n            _this.callback(err, null, _this);\\\\n            _this.emit(\'error\', err);\\\\n        } else {\\\\n            // emit the event even if no callback was provided\\\\n            _this.emit(\'error\', err);\\\\n        }\\\\n    });\\\\n\\\\n    // return an object to cancel the subscription\\\\n    return this;\\\\n};\\\\n\\\\nmodule.exports = Subscription;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core-subscriptions/src/subscription.js\\\\n// module id = 341\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core-subscriptions/src/subscription.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file extend.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\nvar formatters = __webpack_require__(7).formatters;\\\\nvar Method = __webpack_require__(25);\\\\nvar utils = __webpack_require__(10);\\\\n\\\\n\\\\nvar extend = function (pckg) {\\\\n    /* jshint maxcomplexity:5 */\\\\n    var ex = function (extension) {\\\\n\\\\n        var extendedObject;\\\\n        if (extension.property) {\\\\n            if (!pckg[extension.property]) {\\\\n                pckg[extension.property] = {};\\\\n            }\\\\n            extendedObject = pckg[extension.property];\\\\n        } else {\\\\n            extendedObject = pckg;\\\\n        }\\\\n\\\\n        if (extension.methods) {\\\\n            extension.methods.forEach(function (method) {\\\\n                if(!(method instanceof Method)) {\\\\n                    method = new Method(method);\\\\n                }\\\\n\\\\n                method.attachToObject(extendedObject);\\\\n                method.setRequestManager(pckg._requestManager);\\\\n            });\\\\n        }\\\\n\\\\n        return pckg;\\\\n    };\\\\n\\\\n    ex.formatters = formatters;\\\\n    ex.utils = utils;\\\\n    ex.Method = Method;\\\\n\\\\n    return ex;\\\\n};\\\\n\\\\n\\\\n\\\\nmodule.exports = extend;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-core/src/extend.js\\\\n// module id = 342\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-core/src/extend.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) {\\\\n  \'use strict\';\\\\n\\\\n  // Utils\\\\n  function assert (val, msg) {\\\\n    if (!val) throw new Error(msg || \'Assertion failed\');\\\\n  }\\\\n\\\\n  // Could use `inherits` module, but don\'t want to move from single file\\\\n  // architecture yet.\\\\n  function inherits (ctor, superCtor) {\\\\n    ctor.super_ = superCtor;\\\\n    var TempCtor = function () {};\\\\n    TempCtor.prototype = superCtor.prototype;\\\\n    ctor.prototype = new TempCtor();\\\\n    ctor.prototype.constructor = ctor;\\\\n  }\\\\n\\\\n  // BN\\\\n\\\\n  function BN (number, base, endian) {\\\\n    if (BN.isBN(number)) {\\\\n      return number;\\\\n    }\\\\n\\\\n    this.negative = 0;\\\\n    this.words = null;\\\\n    this.length = 0;\\\\n\\\\n    // Reduction context\\\\n    this.red = null;\\\\n\\\\n    if (number !== null) {\\\\n      if (base === \'le\' || base === \'be\') {\\\\n        endian = base;\\\\n        base = 10;\\\\n      }\\\\n\\\\n      this._init(number || 0, base || 10, endian || \'be\');\\\\n    }\\\\n  }\\\\n  if (typeof module === \'object\') {\\\\n    module.exports = BN;\\\\n  } else {\\\\n    exports.BN = BN;\\\\n  }\\\\n\\\\n  BN.BN = BN;\\\\n  BN.wordSize = 26;\\\\n\\\\n  var Buffer;\\\\n  try {\\\\n    Buffer = __webpack_require__(1).Buffer;\\\\n  } catch (e) {\\\\n  }\\\\n\\\\n  BN.isBN = function isBN (num) {\\\\n    if (num instanceof BN) {\\\\n      return true;\\\\n    }\\\\n\\\\n    return num !== null && typeof num === \'object\' &&\\\\n      num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);\\\\n  };\\\\n\\\\n  BN.max = function max (left, right) {\\\\n    if (left.cmp(right) > 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.min = function min (left, right) {\\\\n    if (left.cmp(right) < 0) return left;\\\\n    return right;\\\\n  };\\\\n\\\\n  BN.prototype._init = function init (number, base, endian) {\\\\n    if (typeof number === \'number\') {\\\\n      return this._initNumber(number, base, endian);\\\\n    }\\\\n\\\\n    if (typeof number === \'object\') {\\\\n      return this._initArray(number, base, endian);\\\\n    }\\\\n\\\\n    if (base === \'hex\') {\\\\n      base = 16;\\\\n    }\\\\n    assert(base === (base | 0) && base >= 2 && base <= 36);\\\\n\\\\n    number = number.toString().replace(/\\\\\\\\s+/g, \'\');\\\\n    var start = 0;\\\\n    if (number[0] === \'-\') {\\\\n      start++;\\\\n    }\\\\n\\\\n    if (base === 16) {\\\\n      this._parseHex(number, start);\\\\n    } else {\\\\n      this._parseBase(number, base, start);\\\\n    }\\\\n\\\\n    if (number[0] === \'-\') {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    this.strip();\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initNumber = function _initNumber (number, base, endian) {\\\\n    if (number < 0) {\\\\n      this.negative = 1;\\\\n      number = -number;\\\\n    }\\\\n    if (number < 0x4000000) {\\\\n      this.words = [ number & 0x3ffffff ];\\\\n      this.length = 1;\\\\n    } else if (number < 0x10000000000000) {\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff\\\\n      ];\\\\n      this.length = 2;\\\\n    } else {\\\\n      assert(number < 0x20000000000000); // 2 ^ 53 (unsafe)\\\\n      this.words = [\\\\n        number & 0x3ffffff,\\\\n        (number / 0x4000000) & 0x3ffffff,\\\\n        1\\\\n      ];\\\\n      this.length = 3;\\\\n    }\\\\n\\\\n    if (endian !== \'le\') return;\\\\n\\\\n    // Reverse the bytes\\\\n    this._initArray(this.toArray(), base, endian);\\\\n  };\\\\n\\\\n  BN.prototype._initArray = function _initArray (number, base, endian) {\\\\n    // Perhaps a Uint8Array\\\\n    assert(typeof number.length === \'number\');\\\\n    if (number.length <= 0) {\\\\n      this.words = [ 0 ];\\\\n      this.length = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.length = Math.ceil(number.length / 3);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    var off = 0;\\\\n    if (endian === \'be\') {\\\\n      for (i = number.length - 1, j = 0; i >= 0; i -= 3) {\\\\n        w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    } else if (endian === \'le\') {\\\\n      for (i = 0, j = 0; i < number.length; i += 3) {\\\\n        w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16);\\\\n        this.words[j] |= (w << off) & 0x3ffffff;\\\\n        this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff;\\\\n        off += 24;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          j++;\\\\n        }\\\\n      }\\\\n    }\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  function parseHex (str, start, end) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r <<= 4;\\\\n\\\\n      // \'a\' - \'f\'\\\\n      if (c >= 49 && c <= 54) {\\\\n        r |= c - 49 + 0xa;\\\\n\\\\n      // \'A\' - \'F\'\\\\n      } else if (c >= 17 && c <= 22) {\\\\n        r |= c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r |= c & 0xf;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseHex = function _parseHex (number, start) {\\\\n    // Create possibly bigger array to ensure that it fits the number\\\\n    this.length = Math.ceil((number.length - start) / 6);\\\\n    this.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      this.words[i] = 0;\\\\n    }\\\\n\\\\n    var j, w;\\\\n    // Scan 24-bit chunks and add them to the number\\\\n    var off = 0;\\\\n    for (i = number.length - 6, j = 0; i >= start; i -= 6) {\\\\n      w = parseHex(number, i, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      // NOTE: `0x3fffff` is intentional here, 26bits max shift + 24bit hex limb\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n      off += 24;\\\\n      if (off >= 26) {\\\\n        off -= 26;\\\\n        j++;\\\\n      }\\\\n    }\\\\n    if (i + 6 !== start) {\\\\n      w = parseHex(number, start, i + 6);\\\\n      this.words[j] |= (w << off) & 0x3ffffff;\\\\n      this.words[j + 1] |= w >>> (26 - off) & 0x3fffff;\\\\n    }\\\\n    this.strip();\\\\n  };\\\\n\\\\n  function parseBase (str, start, end, mul) {\\\\n    var r = 0;\\\\n    var len = Math.min(str.length, end);\\\\n    for (var i = start; i < len; i++) {\\\\n      var c = str.charCodeAt(i) - 48;\\\\n\\\\n      r *= mul;\\\\n\\\\n      // \'a\'\\\\n      if (c >= 49) {\\\\n        r += c - 49 + 0xa;\\\\n\\\\n      // \'A\'\\\\n      } else if (c >= 17) {\\\\n        r += c - 17 + 0xa;\\\\n\\\\n      // \'0\' - \'9\'\\\\n      } else {\\\\n        r += c;\\\\n      }\\\\n    }\\\\n    return r;\\\\n  }\\\\n\\\\n  BN.prototype._parseBase = function _parseBase (number, base, start) {\\\\n    // Initialize as zero\\\\n    this.words = [ 0 ];\\\\n    this.length = 1;\\\\n\\\\n    // Find length of limb in base\\\\n    for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) {\\\\n      limbLen++;\\\\n    }\\\\n    limbLen--;\\\\n    limbPow = (limbPow / base) | 0;\\\\n\\\\n    var total = number.length - start;\\\\n    var mod = total % limbLen;\\\\n    var end = Math.min(total, total - mod) + start;\\\\n\\\\n    var word = 0;\\\\n    for (var i = start; i < end; i += limbLen) {\\\\n      word = parseBase(number, i, i + limbLen, base);\\\\n\\\\n      this.imuln(limbPow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n\\\\n    if (mod !== 0) {\\\\n      var pow = 1;\\\\n      word = parseBase(number, i, number.length, base);\\\\n\\\\n      for (i = 0; i < mod; i++) {\\\\n        pow *= base;\\\\n      }\\\\n\\\\n      this.imuln(pow);\\\\n      if (this.words[0] + word < 0x4000000) {\\\\n        this.words[0] += word;\\\\n      } else {\\\\n        this._iaddn(word);\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  BN.prototype.copy = function copy (dest) {\\\\n    dest.words = new Array(this.length);\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      dest.words[i] = this.words[i];\\\\n    }\\\\n    dest.length = this.length;\\\\n    dest.negative = this.negative;\\\\n    dest.red = this.red;\\\\n  };\\\\n\\\\n  BN.prototype.clone = function clone () {\\\\n    var r = new BN(null);\\\\n    this.copy(r);\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype._expand = function _expand (size) {\\\\n    while (this.length < size) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  // Remove leading `0` from `this`\\\\n  BN.prototype.strip = function strip () {\\\\n    while (this.length > 1 && this.words[this.length - 1] === 0) {\\\\n      this.length--;\\\\n    }\\\\n    return this._normSign();\\\\n  };\\\\n\\\\n  BN.prototype._normSign = function _normSign () {\\\\n    // -0 = 0\\\\n    if (this.length === 1 && this.words[0] === 0) {\\\\n      this.negative = 0;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.inspect = function inspect () {\\\\n    return (this.red ? \'<BN-R: \' : \'<BN: \') + this.toString(16) + \'>\';\\\\n  };\\\\n\\\\n  /*\\\\n\\\\n  var zeros = [];\\\\n  var groupSizes = [];\\\\n  var groupBases = [];\\\\n\\\\n  var s = \'\';\\\\n  var i = -1;\\\\n  while (++i < BN.wordSize) {\\\\n    zeros[i] = s;\\\\n    s += \'0\';\\\\n  }\\\\n  groupSizes[0] = 0;\\\\n  groupSizes[1] = 0;\\\\n  groupBases[0] = 0;\\\\n  groupBases[1] = 0;\\\\n  var base = 2 - 1;\\\\n  while (++base < 36 + 1) {\\\\n    var groupSize = 0;\\\\n    var groupBase = 1;\\\\n    while (groupBase < (1 << BN.wordSize) / base) {\\\\n      groupBase *= base;\\\\n      groupSize += 1;\\\\n    }\\\\n    groupSizes[base] = groupSize;\\\\n    groupBases[base] = groupBase;\\\\n  }\\\\n\\\\n  */\\\\n\\\\n  var zeros = [\\\\n    \'\',\\\\n    \'0\',\\\\n    \'00\',\\\\n    \'000\',\\\\n    \'0000\',\\\\n    \'00000\',\\\\n    \'000000\',\\\\n    \'0000000\',\\\\n    \'00000000\',\\\\n    \'000000000\',\\\\n    \'0000000000\',\\\\n    \'00000000000\',\\\\n    \'000000000000\',\\\\n    \'0000000000000\',\\\\n    \'00000000000000\',\\\\n    \'000000000000000\',\\\\n    \'0000000000000000\',\\\\n    \'00000000000000000\',\\\\n    \'000000000000000000\',\\\\n    \'0000000000000000000\',\\\\n    \'00000000000000000000\',\\\\n    \'000000000000000000000\',\\\\n    \'0000000000000000000000\',\\\\n    \'00000000000000000000000\',\\\\n    \'000000000000000000000000\',\\\\n    \'0000000000000000000000000\'\\\\n  ];\\\\n\\\\n  var groupSizes = [\\\\n    0, 0,\\\\n    25, 16, 12, 11, 10, 9, 8,\\\\n    8, 7, 7, 7, 7, 6, 6,\\\\n    6, 6, 6, 6, 6, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5,\\\\n    5, 5, 5, 5, 5, 5, 5\\\\n  ];\\\\n\\\\n  var groupBases = [\\\\n    0, 0,\\\\n    33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216,\\\\n    43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625,\\\\n    16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632,\\\\n    6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149,\\\\n    24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176\\\\n  ];\\\\n\\\\n  BN.prototype.toString = function toString (base, padding) {\\\\n    base = base || 10;\\\\n    padding = padding | 0 || 1;\\\\n\\\\n    var out;\\\\n    if (base === 16 || base === \'hex\') {\\\\n      out = \'\';\\\\n      var off = 0;\\\\n      var carry = 0;\\\\n      for (var i = 0; i < this.length; i++) {\\\\n        var w = this.words[i];\\\\n        var word = (((w << off) | carry) & 0xffffff).toString(16);\\\\n        carry = (w >>> (24 - off)) & 0xffffff;\\\\n        if (carry !== 0 || i !== this.length - 1) {\\\\n          out = zeros[6 - word.length] + word + out;\\\\n        } else {\\\\n          out = word + out;\\\\n        }\\\\n        off += 2;\\\\n        if (off >= 26) {\\\\n          off -= 26;\\\\n          i--;\\\\n        }\\\\n      }\\\\n      if (carry !== 0) {\\\\n        out = carry.toString(16) + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    if (base === (base | 0) && base >= 2 && base <= 36) {\\\\n      // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base));\\\\n      var groupSize = groupSizes[base];\\\\n      // var groupBase = Math.pow(base, groupSize);\\\\n      var groupBase = groupBases[base];\\\\n      out = \'\';\\\\n      var c = this.clone();\\\\n      c.negative = 0;\\\\n      while (!c.isZero()) {\\\\n        var r = c.modn(groupBase).toString(base);\\\\n        c = c.idivn(groupBase);\\\\n\\\\n        if (!c.isZero()) {\\\\n          out = zeros[groupSize - r.length] + r + out;\\\\n        } else {\\\\n          out = r + out;\\\\n        }\\\\n      }\\\\n      if (this.isZero()) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      while (out.length % padding !== 0) {\\\\n        out = \'0\' + out;\\\\n      }\\\\n      if (this.negative !== 0) {\\\\n        out = \'-\' + out;\\\\n      }\\\\n      return out;\\\\n    }\\\\n\\\\n    assert(false, \'Base should be between 2 and 36\');\\\\n  };\\\\n\\\\n  BN.prototype.toNumber = function toNumber () {\\\\n    var ret = this.words[0];\\\\n    if (this.length === 2) {\\\\n      ret += this.words[1] * 0x4000000;\\\\n    } else if (this.length === 3 && this.words[2] === 0x01) {\\\\n      // NOTE: at this stage it is known that the top bit is set\\\\n      ret += 0x10000000000000 + (this.words[1] * 0x4000000);\\\\n    } else if (this.length > 2) {\\\\n      assert(false, \'Number can only safely store up to 53 bits\');\\\\n    }\\\\n    return (this.negative !== 0) ? -ret : ret;\\\\n  };\\\\n\\\\n  BN.prototype.toJSON = function toJSON () {\\\\n    return this.toString(16);\\\\n  };\\\\n\\\\n  BN.prototype.toBuffer = function toBuffer (endian, length) {\\\\n    assert(typeof Buffer !== \'undefined\');\\\\n    return this.toArrayLike(Buffer, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArray = function toArray (endian, length) {\\\\n    return this.toArrayLike(Array, endian, length);\\\\n  };\\\\n\\\\n  BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) {\\\\n    var byteLength = this.byteLength();\\\\n    var reqLength = length || Math.max(1, byteLength);\\\\n    assert(byteLength <= reqLength, \'byte array longer than desired length\');\\\\n    assert(reqLength > 0, \'Requested array length <= 0\');\\\\n\\\\n    this.strip();\\\\n    var littleEndian = endian === \'le\';\\\\n    var res = new ArrayType(reqLength);\\\\n\\\\n    var b, i;\\\\n    var q = this.clone();\\\\n    if (!littleEndian) {\\\\n      // Assume big-endian\\\\n      for (i = 0; i < reqLength - byteLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[reqLength - i - 1] = b;\\\\n      }\\\\n    } else {\\\\n      for (i = 0; !q.isZero(); i++) {\\\\n        b = q.andln(0xff);\\\\n        q.iushrn(8);\\\\n\\\\n        res[i] = b;\\\\n      }\\\\n\\\\n      for (; i < reqLength; i++) {\\\\n        res[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  if (Math.clz32) {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      return 32 - Math.clz32(w);\\\\n    };\\\\n  } else {\\\\n    BN.prototype._countBits = function _countBits (w) {\\\\n      var t = w;\\\\n      var r = 0;\\\\n      if (t >= 0x1000) {\\\\n        r += 13;\\\\n        t >>>= 13;\\\\n      }\\\\n      if (t >= 0x40) {\\\\n        r += 7;\\\\n        t >>>= 7;\\\\n      }\\\\n      if (t >= 0x8) {\\\\n        r += 4;\\\\n        t >>>= 4;\\\\n      }\\\\n      if (t >= 0x02) {\\\\n        r += 2;\\\\n        t >>>= 2;\\\\n      }\\\\n      return r + t;\\\\n    };\\\\n  }\\\\n\\\\n  BN.prototype._zeroBits = function _zeroBits (w) {\\\\n    // Short-cut\\\\n    if (w === 0) return 26;\\\\n\\\\n    var t = w;\\\\n    var r = 0;\\\\n    if ((t & 0x1fff) === 0) {\\\\n      r += 13;\\\\n      t >>>= 13;\\\\n    }\\\\n    if ((t & 0x7f) === 0) {\\\\n      r += 7;\\\\n      t >>>= 7;\\\\n    }\\\\n    if ((t & 0xf) === 0) {\\\\n      r += 4;\\\\n      t >>>= 4;\\\\n    }\\\\n    if ((t & 0x3) === 0) {\\\\n      r += 2;\\\\n      t >>>= 2;\\\\n    }\\\\n    if ((t & 0x1) === 0) {\\\\n      r++;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  // Return number of used bits in a BN\\\\n  BN.prototype.bitLength = function bitLength () {\\\\n    var w = this.words[this.length - 1];\\\\n    var hi = this._countBits(w);\\\\n    return (this.length - 1) * 26 + hi;\\\\n  };\\\\n\\\\n  function toBitArray (num) {\\\\n    var w = new Array(num.bitLength());\\\\n\\\\n    for (var bit = 0; bit < w.length; bit++) {\\\\n      var off = (bit / 26) | 0;\\\\n      var wbit = bit % 26;\\\\n\\\\n      w[bit] = (num.words[off] & (1 << wbit)) >>> wbit;\\\\n    }\\\\n\\\\n    return w;\\\\n  }\\\\n\\\\n  // Number of trailing zero bits\\\\n  BN.prototype.zeroBits = function zeroBits () {\\\\n    if (this.isZero()) return 0;\\\\n\\\\n    var r = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var b = this._zeroBits(this.words[i]);\\\\n      r += b;\\\\n      if (b !== 26) break;\\\\n    }\\\\n    return r;\\\\n  };\\\\n\\\\n  BN.prototype.byteLength = function byteLength () {\\\\n    return Math.ceil(this.bitLength() / 8);\\\\n  };\\\\n\\\\n  BN.prototype.toTwos = function toTwos (width) {\\\\n    if (this.negative !== 0) {\\\\n      return this.abs().inotn(width).iaddn(1);\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.fromTwos = function fromTwos (width) {\\\\n    if (this.testn(width - 1)) {\\\\n      return this.notn(width).iaddn(1).ineg();\\\\n    }\\\\n    return this.clone();\\\\n  };\\\\n\\\\n  BN.prototype.isNeg = function isNeg () {\\\\n    return this.negative !== 0;\\\\n  };\\\\n\\\\n  // Return negative clone of `this`\\\\n  BN.prototype.neg = function neg () {\\\\n    return this.clone().ineg();\\\\n  };\\\\n\\\\n  BN.prototype.ineg = function ineg () {\\\\n    if (!this.isZero()) {\\\\n      this.negative ^= 1;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Or `num` with `this` in-place\\\\n  BN.prototype.iuor = function iuor (num) {\\\\n    while (this.length < num.length) {\\\\n      this.words[this.length++] = 0;\\\\n    }\\\\n\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      this.words[i] = this.words[i] | num.words[i];\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ior = function ior (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuor(num);\\\\n  };\\\\n\\\\n  // Or `num` with `this`\\\\n  BN.prototype.or = function or (num) {\\\\n    if (this.length > num.length) return this.clone().ior(num);\\\\n    return num.clone().ior(this);\\\\n  };\\\\n\\\\n  BN.prototype.uor = function uor (num) {\\\\n    if (this.length > num.length) return this.clone().iuor(num);\\\\n    return num.clone().iuor(this);\\\\n  };\\\\n\\\\n  // And `num` with `this` in-place\\\\n  BN.prototype.iuand = function iuand (num) {\\\\n    // b = min-length(num, this)\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      b = num;\\\\n    } else {\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = this.words[i] & num.words[i];\\\\n    }\\\\n\\\\n    this.length = b.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.iand = function iand (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuand(num);\\\\n  };\\\\n\\\\n  // And `num` with `this`\\\\n  BN.prototype.and = function and (num) {\\\\n    if (this.length > num.length) return this.clone().iand(num);\\\\n    return num.clone().iand(this);\\\\n  };\\\\n\\\\n  BN.prototype.uand = function uand (num) {\\\\n    if (this.length > num.length) return this.clone().iuand(num);\\\\n    return num.clone().iuand(this);\\\\n  };\\\\n\\\\n  // Xor `num` with `this` in-place\\\\n  BN.prototype.iuxor = function iuxor (num) {\\\\n    // a.length > b.length\\\\n    var a;\\\\n    var b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      this.words[i] = a.words[i] ^ b.words[i];\\\\n    }\\\\n\\\\n    if (this !== a) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ixor = function ixor (num) {\\\\n    assert((this.negative | num.negative) === 0);\\\\n    return this.iuxor(num);\\\\n  };\\\\n\\\\n  // Xor `num` with `this`\\\\n  BN.prototype.xor = function xor (num) {\\\\n    if (this.length > num.length) return this.clone().ixor(num);\\\\n    return num.clone().ixor(this);\\\\n  };\\\\n\\\\n  BN.prototype.uxor = function uxor (num) {\\\\n    if (this.length > num.length) return this.clone().iuxor(num);\\\\n    return num.clone().iuxor(this);\\\\n  };\\\\n\\\\n  // Not ``this`` with ``width`` bitwidth\\\\n  BN.prototype.inotn = function inotn (width) {\\\\n    assert(typeof width === \'number\' && width >= 0);\\\\n\\\\n    var bytesNeeded = Math.ceil(width / 26) | 0;\\\\n    var bitsLeft = width % 26;\\\\n\\\\n    // Extend the buffer with leading zeroes\\\\n    this._expand(bytesNeeded);\\\\n\\\\n    if (bitsLeft > 0) {\\\\n      bytesNeeded--;\\\\n    }\\\\n\\\\n    // Handle complete words\\\\n    for (var i = 0; i < bytesNeeded; i++) {\\\\n      this.words[i] = ~this.words[i] & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Handle the residue\\\\n    if (bitsLeft > 0) {\\\\n      this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft));\\\\n    }\\\\n\\\\n    // And remove leading zeroes\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.notn = function notn (width) {\\\\n    return this.clone().inotn(width);\\\\n  };\\\\n\\\\n  // Set `bit` of `this`\\\\n  BN.prototype.setn = function setn (bit, val) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n\\\\n    var off = (bit / 26) | 0;\\\\n    var wbit = bit % 26;\\\\n\\\\n    this._expand(off + 1);\\\\n\\\\n    if (val) {\\\\n      this.words[off] = this.words[off] | (1 << wbit);\\\\n    } else {\\\\n      this.words[off] = this.words[off] & ~(1 << wbit);\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Add `num` to `this` in-place\\\\n  BN.prototype.iadd = function iadd (num) {\\\\n    var r;\\\\n\\\\n    // negative + positive\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      this.negative = 0;\\\\n      r = this.isub(num);\\\\n      this.negative ^= 1;\\\\n      return this._normSign();\\\\n\\\\n    // positive + negative\\\\n    } else if (this.negative === 0 && num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      r = this.isub(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n    }\\\\n\\\\n    // a.length > b.length\\\\n    var a, b;\\\\n    if (this.length > num.length) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) + (b.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n      carry = r >>> 26;\\\\n    }\\\\n\\\\n    this.length = a.length;\\\\n    if (carry !== 0) {\\\\n      this.words[this.length] = carry;\\\\n      this.length++;\\\\n    // Copy the rest of the words\\\\n    } else if (a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Add `num` to `this`\\\\n  BN.prototype.add = function add (num) {\\\\n    var res;\\\\n    if (num.negative !== 0 && this.negative === 0) {\\\\n      num.negative = 0;\\\\n      res = this.sub(num);\\\\n      num.negative ^= 1;\\\\n      return res;\\\\n    } else if (num.negative === 0 && this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      res = num.sub(this);\\\\n      this.negative = 1;\\\\n      return res;\\\\n    }\\\\n\\\\n    if (this.length > num.length) return this.clone().iadd(num);\\\\n\\\\n    return num.clone().iadd(this);\\\\n  };\\\\n\\\\n  // Subtract `num` from `this` in-place\\\\n  BN.prototype.isub = function isub (num) {\\\\n    // this - (-num) = this + num\\\\n    if (num.negative !== 0) {\\\\n      num.negative = 0;\\\\n      var r = this.iadd(num);\\\\n      num.negative = 1;\\\\n      return r._normSign();\\\\n\\\\n    // -this - num = -(this + num)\\\\n    } else if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iadd(num);\\\\n      this.negative = 1;\\\\n      return this._normSign();\\\\n    }\\\\n\\\\n    // At this point both numbers are positive\\\\n    var cmp = this.cmp(num);\\\\n\\\\n    // Optimization - zeroify\\\\n    if (cmp === 0) {\\\\n      this.negative = 0;\\\\n      this.length = 1;\\\\n      this.words[0] = 0;\\\\n      return this;\\\\n    }\\\\n\\\\n    // a > b\\\\n    var a, b;\\\\n    if (cmp > 0) {\\\\n      a = this;\\\\n      b = num;\\\\n    } else {\\\\n      a = num;\\\\n      b = this;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (var i = 0; i < b.length; i++) {\\\\n      r = (a.words[i] | 0) - (b.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n    for (; carry !== 0 && i < a.length; i++) {\\\\n      r = (a.words[i] | 0) + carry;\\\\n      carry = r >> 26;\\\\n      this.words[i] = r & 0x3ffffff;\\\\n    }\\\\n\\\\n    // Copy rest of the words\\\\n    if (carry === 0 && i < a.length && a !== this) {\\\\n      for (; i < a.length; i++) {\\\\n        this.words[i] = a.words[i];\\\\n      }\\\\n    }\\\\n\\\\n    this.length = Math.max(this.length, i);\\\\n\\\\n    if (a !== this) {\\\\n      this.negative = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Subtract `num` from `this`\\\\n  BN.prototype.sub = function sub (num) {\\\\n    return this.clone().isub(num);\\\\n  };\\\\n\\\\n  function smallMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    var len = (self.length + num.length) | 0;\\\\n    out.length = len;\\\\n    len = (len - 1) | 0;\\\\n\\\\n    // Peel one iteration (compiler can\'t do it, because of code complexity)\\\\n    var a = self.words[0] | 0;\\\\n    var b = num.words[0] | 0;\\\\n    var r = a * b;\\\\n\\\\n    var lo = r & 0x3ffffff;\\\\n    var carry = (r / 0x4000000) | 0;\\\\n    out.words[0] = lo;\\\\n\\\\n    for (var k = 1; k < len; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = carry >>> 26;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = (k - j) | 0;\\\\n        a = self.words[i] | 0;\\\\n        b = num.words[j] | 0;\\\\n        r = a * b + rword;\\\\n        ncarry += (r / 0x4000000) | 0;\\\\n        rword = r & 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword | 0;\\\\n      carry = ncarry | 0;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry | 0;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  // TODO(indutny): it may be reasonable to omit it for users who don\'t need\\\\n  // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit\\\\n  // multiplication (like elliptic secp256k1).\\\\n  var comb10MulTo = function comb10MulTo (self, num, out) {\\\\n    var a = self.words;\\\\n    var b = num.words;\\\\n    var o = out.words;\\\\n    var c = 0;\\\\n    var lo;\\\\n    var mid;\\\\n    var hi;\\\\n    var a0 = a[0] | 0;\\\\n    var al0 = a0 & 0x1fff;\\\\n    var ah0 = a0 >>> 13;\\\\n    var a1 = a[1] | 0;\\\\n    var al1 = a1 & 0x1fff;\\\\n    var ah1 = a1 >>> 13;\\\\n    var a2 = a[2] | 0;\\\\n    var al2 = a2 & 0x1fff;\\\\n    var ah2 = a2 >>> 13;\\\\n    var a3 = a[3] | 0;\\\\n    var al3 = a3 & 0x1fff;\\\\n    var ah3 = a3 >>> 13;\\\\n    var a4 = a[4] | 0;\\\\n    var al4 = a4 & 0x1fff;\\\\n    var ah4 = a4 >>> 13;\\\\n    var a5 = a[5] | 0;\\\\n    var al5 = a5 & 0x1fff;\\\\n    var ah5 = a5 >>> 13;\\\\n    var a6 = a[6] | 0;\\\\n    var al6 = a6 & 0x1fff;\\\\n    var ah6 = a6 >>> 13;\\\\n    var a7 = a[7] | 0;\\\\n    var al7 = a7 & 0x1fff;\\\\n    var ah7 = a7 >>> 13;\\\\n    var a8 = a[8] | 0;\\\\n    var al8 = a8 & 0x1fff;\\\\n    var ah8 = a8 >>> 13;\\\\n    var a9 = a[9] | 0;\\\\n    var al9 = a9 & 0x1fff;\\\\n    var ah9 = a9 >>> 13;\\\\n    var b0 = b[0] | 0;\\\\n    var bl0 = b0 & 0x1fff;\\\\n    var bh0 = b0 >>> 13;\\\\n    var b1 = b[1] | 0;\\\\n    var bl1 = b1 & 0x1fff;\\\\n    var bh1 = b1 >>> 13;\\\\n    var b2 = b[2] | 0;\\\\n    var bl2 = b2 & 0x1fff;\\\\n    var bh2 = b2 >>> 13;\\\\n    var b3 = b[3] | 0;\\\\n    var bl3 = b3 & 0x1fff;\\\\n    var bh3 = b3 >>> 13;\\\\n    var b4 = b[4] | 0;\\\\n    var bl4 = b4 & 0x1fff;\\\\n    var bh4 = b4 >>> 13;\\\\n    var b5 = b[5] | 0;\\\\n    var bl5 = b5 & 0x1fff;\\\\n    var bh5 = b5 >>> 13;\\\\n    var b6 = b[6] | 0;\\\\n    var bl6 = b6 & 0x1fff;\\\\n    var bh6 = b6 >>> 13;\\\\n    var b7 = b[7] | 0;\\\\n    var bl7 = b7 & 0x1fff;\\\\n    var bh7 = b7 >>> 13;\\\\n    var b8 = b[8] | 0;\\\\n    var bl8 = b8 & 0x1fff;\\\\n    var bh8 = b8 >>> 13;\\\\n    var b9 = b[9] | 0;\\\\n    var bl9 = b9 & 0x1fff;\\\\n    var bh9 = b9 >>> 13;\\\\n\\\\n    out.negative = self.negative ^ num.negative;\\\\n    out.length = 19;\\\\n    /* k = 0 */\\\\n    lo = Math.imul(al0, bl0);\\\\n    mid = Math.imul(al0, bh0);\\\\n    mid = (mid + Math.imul(ah0, bl0)) | 0;\\\\n    hi = Math.imul(ah0, bh0);\\\\n    var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0;\\\\n    w0 &= 0x3ffffff;\\\\n    /* k = 1 */\\\\n    lo = Math.imul(al1, bl0);\\\\n    mid = Math.imul(al1, bh0);\\\\n    mid = (mid + Math.imul(ah1, bl0)) | 0;\\\\n    hi = Math.imul(ah1, bh0);\\\\n    lo = (lo + Math.imul(al0, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh1)) | 0;\\\\n    var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0;\\\\n    w1 &= 0x3ffffff;\\\\n    /* k = 2 */\\\\n    lo = Math.imul(al2, bl0);\\\\n    mid = Math.imul(al2, bh0);\\\\n    mid = (mid + Math.imul(ah2, bl0)) | 0;\\\\n    hi = Math.imul(ah2, bh0);\\\\n    lo = (lo + Math.imul(al1, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh2)) | 0;\\\\n    var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0;\\\\n    w2 &= 0x3ffffff;\\\\n    /* k = 3 */\\\\n    lo = Math.imul(al3, bl0);\\\\n    mid = Math.imul(al3, bh0);\\\\n    mid = (mid + Math.imul(ah3, bl0)) | 0;\\\\n    hi = Math.imul(ah3, bh0);\\\\n    lo = (lo + Math.imul(al2, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh3)) | 0;\\\\n    var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0;\\\\n    w3 &= 0x3ffffff;\\\\n    /* k = 4 */\\\\n    lo = Math.imul(al4, bl0);\\\\n    mid = Math.imul(al4, bh0);\\\\n    mid = (mid + Math.imul(ah4, bl0)) | 0;\\\\n    hi = Math.imul(ah4, bh0);\\\\n    lo = (lo + Math.imul(al3, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh4)) | 0;\\\\n    var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0;\\\\n    w4 &= 0x3ffffff;\\\\n    /* k = 5 */\\\\n    lo = Math.imul(al5, bl0);\\\\n    mid = Math.imul(al5, bh0);\\\\n    mid = (mid + Math.imul(ah5, bl0)) | 0;\\\\n    hi = Math.imul(ah5, bh0);\\\\n    lo = (lo + Math.imul(al4, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh5)) | 0;\\\\n    var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0;\\\\n    w5 &= 0x3ffffff;\\\\n    /* k = 6 */\\\\n    lo = Math.imul(al6, bl0);\\\\n    mid = Math.imul(al6, bh0);\\\\n    mid = (mid + Math.imul(ah6, bl0)) | 0;\\\\n    hi = Math.imul(ah6, bh0);\\\\n    lo = (lo + Math.imul(al5, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh6)) | 0;\\\\n    var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0;\\\\n    w6 &= 0x3ffffff;\\\\n    /* k = 7 */\\\\n    lo = Math.imul(al7, bl0);\\\\n    mid = Math.imul(al7, bh0);\\\\n    mid = (mid + Math.imul(ah7, bl0)) | 0;\\\\n    hi = Math.imul(ah7, bh0);\\\\n    lo = (lo + Math.imul(al6, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh7)) | 0;\\\\n    var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0;\\\\n    w7 &= 0x3ffffff;\\\\n    /* k = 8 */\\\\n    lo = Math.imul(al8, bl0);\\\\n    mid = Math.imul(al8, bh0);\\\\n    mid = (mid + Math.imul(ah8, bl0)) | 0;\\\\n    hi = Math.imul(ah8, bh0);\\\\n    lo = (lo + Math.imul(al7, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh8)) | 0;\\\\n    var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0;\\\\n    w8 &= 0x3ffffff;\\\\n    /* k = 9 */\\\\n    lo = Math.imul(al9, bl0);\\\\n    mid = Math.imul(al9, bh0);\\\\n    mid = (mid + Math.imul(ah9, bl0)) | 0;\\\\n    hi = Math.imul(ah9, bh0);\\\\n    lo = (lo + Math.imul(al8, bl1)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh1)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl1)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh1)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al0, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al0, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah0, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah0, bh9)) | 0;\\\\n    var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0;\\\\n    w9 &= 0x3ffffff;\\\\n    /* k = 10 */\\\\n    lo = Math.imul(al9, bl1);\\\\n    mid = Math.imul(al9, bh1);\\\\n    mid = (mid + Math.imul(ah9, bl1)) | 0;\\\\n    hi = Math.imul(ah9, bh1);\\\\n    lo = (lo + Math.imul(al8, bl2)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh2)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl2)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh2)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al1, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al1, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah1, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah1, bh9)) | 0;\\\\n    var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0;\\\\n    w10 &= 0x3ffffff;\\\\n    /* k = 11 */\\\\n    lo = Math.imul(al9, bl2);\\\\n    mid = Math.imul(al9, bh2);\\\\n    mid = (mid + Math.imul(ah9, bl2)) | 0;\\\\n    hi = Math.imul(ah9, bh2);\\\\n    lo = (lo + Math.imul(al8, bl3)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh3)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl3)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh3)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al2, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al2, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah2, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah2, bh9)) | 0;\\\\n    var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0;\\\\n    w11 &= 0x3ffffff;\\\\n    /* k = 12 */\\\\n    lo = Math.imul(al9, bl3);\\\\n    mid = Math.imul(al9, bh3);\\\\n    mid = (mid + Math.imul(ah9, bl3)) | 0;\\\\n    hi = Math.imul(ah9, bh3);\\\\n    lo = (lo + Math.imul(al8, bl4)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh4)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl4)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh4)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al3, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al3, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah3, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah3, bh9)) | 0;\\\\n    var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0;\\\\n    w12 &= 0x3ffffff;\\\\n    /* k = 13 */\\\\n    lo = Math.imul(al9, bl4);\\\\n    mid = Math.imul(al9, bh4);\\\\n    mid = (mid + Math.imul(ah9, bl4)) | 0;\\\\n    hi = Math.imul(ah9, bh4);\\\\n    lo = (lo + Math.imul(al8, bl5)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh5)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl5)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh5)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al4, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al4, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah4, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah4, bh9)) | 0;\\\\n    var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0;\\\\n    w13 &= 0x3ffffff;\\\\n    /* k = 14 */\\\\n    lo = Math.imul(al9, bl5);\\\\n    mid = Math.imul(al9, bh5);\\\\n    mid = (mid + Math.imul(ah9, bl5)) | 0;\\\\n    hi = Math.imul(ah9, bh5);\\\\n    lo = (lo + Math.imul(al8, bl6)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh6)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl6)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh6)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al5, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al5, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah5, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah5, bh9)) | 0;\\\\n    var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0;\\\\n    w14 &= 0x3ffffff;\\\\n    /* k = 15 */\\\\n    lo = Math.imul(al9, bl6);\\\\n    mid = Math.imul(al9, bh6);\\\\n    mid = (mid + Math.imul(ah9, bl6)) | 0;\\\\n    hi = Math.imul(ah9, bh6);\\\\n    lo = (lo + Math.imul(al8, bl7)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh7)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl7)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh7)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al6, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al6, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah6, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah6, bh9)) | 0;\\\\n    var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0;\\\\n    w15 &= 0x3ffffff;\\\\n    /* k = 16 */\\\\n    lo = Math.imul(al9, bl7);\\\\n    mid = Math.imul(al9, bh7);\\\\n    mid = (mid + Math.imul(ah9, bl7)) | 0;\\\\n    hi = Math.imul(ah9, bh7);\\\\n    lo = (lo + Math.imul(al8, bl8)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh8)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl8)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh8)) | 0;\\\\n    lo = (lo + Math.imul(al7, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al7, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah7, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah7, bh9)) | 0;\\\\n    var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0;\\\\n    w16 &= 0x3ffffff;\\\\n    /* k = 17 */\\\\n    lo = Math.imul(al9, bl8);\\\\n    mid = Math.imul(al9, bh8);\\\\n    mid = (mid + Math.imul(ah9, bl8)) | 0;\\\\n    hi = Math.imul(ah9, bh8);\\\\n    lo = (lo + Math.imul(al8, bl9)) | 0;\\\\n    mid = (mid + Math.imul(al8, bh9)) | 0;\\\\n    mid = (mid + Math.imul(ah8, bl9)) | 0;\\\\n    hi = (hi + Math.imul(ah8, bh9)) | 0;\\\\n    var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0;\\\\n    w17 &= 0x3ffffff;\\\\n    /* k = 18 */\\\\n    lo = Math.imul(al9, bl9);\\\\n    mid = Math.imul(al9, bh9);\\\\n    mid = (mid + Math.imul(ah9, bl9)) | 0;\\\\n    hi = Math.imul(ah9, bh9);\\\\n    var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0;\\\\n    c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0;\\\\n    w18 &= 0x3ffffff;\\\\n    o[0] = w0;\\\\n    o[1] = w1;\\\\n    o[2] = w2;\\\\n    o[3] = w3;\\\\n    o[4] = w4;\\\\n    o[5] = w5;\\\\n    o[6] = w6;\\\\n    o[7] = w7;\\\\n    o[8] = w8;\\\\n    o[9] = w9;\\\\n    o[10] = w10;\\\\n    o[11] = w11;\\\\n    o[12] = w12;\\\\n    o[13] = w13;\\\\n    o[14] = w14;\\\\n    o[15] = w15;\\\\n    o[16] = w16;\\\\n    o[17] = w17;\\\\n    o[18] = w18;\\\\n    if (c !== 0) {\\\\n      o[19] = c;\\\\n      out.length++;\\\\n    }\\\\n    return out;\\\\n  };\\\\n\\\\n  // Polyfill comb\\\\n  if (!Math.imul) {\\\\n    comb10MulTo = smallMulTo;\\\\n  }\\\\n\\\\n  function bigMulTo (self, num, out) {\\\\n    out.negative = num.negative ^ self.negative;\\\\n    out.length = self.length + num.length;\\\\n\\\\n    var carry = 0;\\\\n    var hncarry = 0;\\\\n    for (var k = 0; k < out.length - 1; k++) {\\\\n      // Sum all words with the same `i + j = k` and accumulate `ncarry`,\\\\n      // note that ncarry could be >= 0x3ffffff\\\\n      var ncarry = hncarry;\\\\n      hncarry = 0;\\\\n      var rword = carry & 0x3ffffff;\\\\n      var maxJ = Math.min(k, num.length - 1);\\\\n      for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {\\\\n        var i = k - j;\\\\n        var a = self.words[i] | 0;\\\\n        var b = num.words[j] | 0;\\\\n        var r = a * b;\\\\n\\\\n        var lo = r & 0x3ffffff;\\\\n        ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0;\\\\n        lo = (lo + rword) | 0;\\\\n        rword = lo & 0x3ffffff;\\\\n        ncarry = (ncarry + (lo >>> 26)) | 0;\\\\n\\\\n        hncarry += ncarry >>> 26;\\\\n        ncarry &= 0x3ffffff;\\\\n      }\\\\n      out.words[k] = rword;\\\\n      carry = ncarry;\\\\n      ncarry = hncarry;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      out.words[k] = carry;\\\\n    } else {\\\\n      out.length--;\\\\n    }\\\\n\\\\n    return out.strip();\\\\n  }\\\\n\\\\n  function jumboMulTo (self, num, out) {\\\\n    var fftm = new FFTM();\\\\n    return fftm.mulp(self, num, out);\\\\n  }\\\\n\\\\n  BN.prototype.mulTo = function mulTo (num, out) {\\\\n    var res;\\\\n    var len = this.length + num.length;\\\\n    if (this.length === 10 && num.length === 10) {\\\\n      res = comb10MulTo(this, num, out);\\\\n    } else if (len < 63) {\\\\n      res = smallMulTo(this, num, out);\\\\n    } else if (len < 1024) {\\\\n      res = bigMulTo(this, num, out);\\\\n    } else {\\\\n      res = jumboMulTo(this, num, out);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Cooley-Tukey algorithm for FFT\\\\n  // slightly revisited to rely on looping instead of recursion\\\\n\\\\n  function FFTM (x, y) {\\\\n    this.x = x;\\\\n    this.y = y;\\\\n  }\\\\n\\\\n  FFTM.prototype.makeRBT = function makeRBT (N) {\\\\n    var t = new Array(N);\\\\n    var l = BN.prototype._countBits(N) - 1;\\\\n    for (var i = 0; i < N; i++) {\\\\n      t[i] = this.revBin(i, l, N);\\\\n    }\\\\n\\\\n    return t;\\\\n  };\\\\n\\\\n  // Returns binary-reversed representation of `x`\\\\n  FFTM.prototype.revBin = function revBin (x, l, N) {\\\\n    if (x === 0 || x === N - 1) return x;\\\\n\\\\n    var rb = 0;\\\\n    for (var i = 0; i < l; i++) {\\\\n      rb |= (x & 1) << (l - i - 1);\\\\n      x >>= 1;\\\\n    }\\\\n\\\\n    return rb;\\\\n  };\\\\n\\\\n  // Performs \\\\\\"tweedling\\\\\\" phase, therefore \'emulating\'\\\\n  // behaviour of the recursive algorithm\\\\n  FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) {\\\\n    for (var i = 0; i < N; i++) {\\\\n      rtws[i] = rws[rbt[i]];\\\\n      itws[i] = iws[rbt[i]];\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) {\\\\n    this.permute(rbt, rws, iws, rtws, itws, N);\\\\n\\\\n    for (var s = 1; s < N; s <<= 1) {\\\\n      var l = s << 1;\\\\n\\\\n      var rtwdf = Math.cos(2 * Math.PI / l);\\\\n      var itwdf = Math.sin(2 * Math.PI / l);\\\\n\\\\n      for (var p = 0; p < N; p += l) {\\\\n        var rtwdf_ = rtwdf;\\\\n        var itwdf_ = itwdf;\\\\n\\\\n        for (var j = 0; j < s; j++) {\\\\n          var re = rtws[p + j];\\\\n          var ie = itws[p + j];\\\\n\\\\n          var ro = rtws[p + j + s];\\\\n          var io = itws[p + j + s];\\\\n\\\\n          var rx = rtwdf_ * ro - itwdf_ * io;\\\\n\\\\n          io = rtwdf_ * io + itwdf_ * ro;\\\\n          ro = rx;\\\\n\\\\n          rtws[p + j] = re + ro;\\\\n          itws[p + j] = ie + io;\\\\n\\\\n          rtws[p + j + s] = re - ro;\\\\n          itws[p + j + s] = ie - io;\\\\n\\\\n          /* jshint maxdepth : false */\\\\n          if (j !== l) {\\\\n            rx = rtwdf * rtwdf_ - itwdf * itwdf_;\\\\n\\\\n            itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;\\\\n            rtwdf_ = rx;\\\\n          }\\\\n        }\\\\n      }\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.guessLen13b = function guessLen13b (n, m) {\\\\n    var N = Math.max(m, n) | 1;\\\\n    var odd = N & 1;\\\\n    var i = 0;\\\\n    for (N = N / 2 | 0; N; N = N >>> 1) {\\\\n      i++;\\\\n    }\\\\n\\\\n    return 1 << i + 1 + odd;\\\\n  };\\\\n\\\\n  FFTM.prototype.conjugate = function conjugate (rws, iws, N) {\\\\n    if (N <= 1) return;\\\\n\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var t = rws[i];\\\\n\\\\n      rws[i] = rws[N - i - 1];\\\\n      rws[N - i - 1] = t;\\\\n\\\\n      t = iws[i];\\\\n\\\\n      iws[i] = -iws[N - i - 1];\\\\n      iws[N - i - 1] = -t;\\\\n    }\\\\n  };\\\\n\\\\n  FFTM.prototype.normalize13b = function normalize13b (ws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < N / 2; i++) {\\\\n      var w = Math.round(ws[2 * i + 1] / N) * 0x2000 +\\\\n        Math.round(ws[2 * i] / N) +\\\\n        carry;\\\\n\\\\n      ws[i] = w & 0x3ffffff;\\\\n\\\\n      if (w < 0x4000000) {\\\\n        carry = 0;\\\\n      } else {\\\\n        carry = w / 0x4000000 | 0;\\\\n      }\\\\n    }\\\\n\\\\n    return ws;\\\\n  };\\\\n\\\\n  FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) {\\\\n    var carry = 0;\\\\n    for (var i = 0; i < len; i++) {\\\\n      carry = carry + (ws[i] | 0);\\\\n\\\\n      rws[2 * i] = carry & 0x1fff; carry = carry >>> 13;\\\\n      rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13;\\\\n    }\\\\n\\\\n    // Pad with zeroes\\\\n    for (i = 2 * len; i < N; ++i) {\\\\n      rws[i] = 0;\\\\n    }\\\\n\\\\n    assert(carry === 0);\\\\n    assert((carry & ~0x1fff) === 0);\\\\n  };\\\\n\\\\n  FFTM.prototype.stub = function stub (N) {\\\\n    var ph = new Array(N);\\\\n    for (var i = 0; i < N; i++) {\\\\n      ph[i] = 0;\\\\n    }\\\\n\\\\n    return ph;\\\\n  };\\\\n\\\\n  FFTM.prototype.mulp = function mulp (x, y, out) {\\\\n    var N = 2 * this.guessLen13b(x.length, y.length);\\\\n\\\\n    var rbt = this.makeRBT(N);\\\\n\\\\n    var _ = this.stub(N);\\\\n\\\\n    var rws = new Array(N);\\\\n    var rwst = new Array(N);\\\\n    var iwst = new Array(N);\\\\n\\\\n    var nrws = new Array(N);\\\\n    var nrwst = new Array(N);\\\\n    var niwst = new Array(N);\\\\n\\\\n    var rmws = out.words;\\\\n    rmws.length = N;\\\\n\\\\n    this.convert13b(x.words, x.length, rws, N);\\\\n    this.convert13b(y.words, y.length, nrws, N);\\\\n\\\\n    this.transform(rws, _, rwst, iwst, N, rbt);\\\\n    this.transform(nrws, _, nrwst, niwst, N, rbt);\\\\n\\\\n    for (var i = 0; i < N; i++) {\\\\n      var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];\\\\n      iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];\\\\n      rwst[i] = rx;\\\\n    }\\\\n\\\\n    this.conjugate(rwst, iwst, N);\\\\n    this.transform(rwst, iwst, rmws, _, N, rbt);\\\\n    this.conjugate(rmws, _, N);\\\\n    this.normalize13b(rmws, N);\\\\n\\\\n    out.negative = x.negative ^ y.negative;\\\\n    out.length = x.length + y.length;\\\\n    return out.strip();\\\\n  };\\\\n\\\\n  // Multiply `this` by `num`\\\\n  BN.prototype.mul = function mul (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return this.mulTo(num, out);\\\\n  };\\\\n\\\\n  // Multiply employing FFT\\\\n  BN.prototype.mulf = function mulf (num) {\\\\n    var out = new BN(null);\\\\n    out.words = new Array(this.length + num.length);\\\\n    return jumboMulTo(this, num, out);\\\\n  };\\\\n\\\\n  // In-place Multiplication\\\\n  BN.prototype.imul = function imul (num) {\\\\n    return this.clone().mulTo(num, this);\\\\n  };\\\\n\\\\n  BN.prototype.imuln = function imuln (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n\\\\n    // Carry\\\\n    var carry = 0;\\\\n    for (var i = 0; i < this.length; i++) {\\\\n      var w = (this.words[i] | 0) * num;\\\\n      var lo = (w & 0x3ffffff) + (carry & 0x3ffffff);\\\\n      carry >>= 26;\\\\n      carry += (w / 0x4000000) | 0;\\\\n      // NOTE: lo is 27bit maximum\\\\n      carry += lo >>> 26;\\\\n      this.words[i] = lo & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.muln = function muln (num) {\\\\n    return this.clone().imuln(num);\\\\n  };\\\\n\\\\n  // `this` * `this`\\\\n  BN.prototype.sqr = function sqr () {\\\\n    return this.mul(this);\\\\n  };\\\\n\\\\n  // `this` * `this` in-place\\\\n  BN.prototype.isqr = function isqr () {\\\\n    return this.imul(this.clone());\\\\n  };\\\\n\\\\n  // Math.pow(`this`, `num`)\\\\n  BN.prototype.pow = function pow (num) {\\\\n    var w = toBitArray(num);\\\\n    if (w.length === 0) return new BN(1);\\\\n\\\\n    // Skip leading zeroes\\\\n    var res = this;\\\\n    for (var i = 0; i < w.length; i++, res = res.sqr()) {\\\\n      if (w[i] !== 0) break;\\\\n    }\\\\n\\\\n    if (++i < w.length) {\\\\n      for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {\\\\n        if (w[i] === 0) continue;\\\\n\\\\n        res = res.mul(q);\\\\n      }\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  // Shift-left in-place\\\\n  BN.prototype.iushln = function iushln (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n    var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r);\\\\n    var i;\\\\n\\\\n    if (r !== 0) {\\\\n      var carry = 0;\\\\n\\\\n      for (i = 0; i < this.length; i++) {\\\\n        var newCarry = this.words[i] & carryMask;\\\\n        var c = ((this.words[i] | 0) - newCarry) << r;\\\\n        this.words[i] = c | carry;\\\\n        carry = newCarry >>> (26 - r);\\\\n      }\\\\n\\\\n      if (carry) {\\\\n        this.words[i] = carry;\\\\n        this.length++;\\\\n      }\\\\n    }\\\\n\\\\n    if (s !== 0) {\\\\n      for (i = this.length - 1; i >= 0; i--) {\\\\n        this.words[i + s] = this.words[i];\\\\n      }\\\\n\\\\n      for (i = 0; i < s; i++) {\\\\n        this.words[i] = 0;\\\\n      }\\\\n\\\\n      this.length += s;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishln = function ishln (bits) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right in-place\\\\n  // NOTE: `hint` is a lowest bit before trailing zeroes\\\\n  // NOTE: if `extended` is present - it will be filled with destroyed bits\\\\n  BN.prototype.iushrn = function iushrn (bits, hint, extended) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var h;\\\\n    if (hint) {\\\\n      h = (hint - (hint % 26)) / 26;\\\\n    } else {\\\\n      h = 0;\\\\n    }\\\\n\\\\n    var r = bits % 26;\\\\n    var s = Math.min((bits - r) / 26, this.length);\\\\n    var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n    var maskedWords = extended;\\\\n\\\\n    h -= s;\\\\n    h = Math.max(0, h);\\\\n\\\\n    // Extended mode, copy masked part\\\\n    if (maskedWords) {\\\\n      for (var i = 0; i < s; i++) {\\\\n        maskedWords.words[i] = this.words[i];\\\\n      }\\\\n      maskedWords.length = s;\\\\n    }\\\\n\\\\n    if (s === 0) {\\\\n      // No-op, we should not move anything at all\\\\n    } else if (this.length > s) {\\\\n      this.length -= s;\\\\n      for (i = 0; i < this.length; i++) {\\\\n        this.words[i] = this.words[i + s];\\\\n      }\\\\n    } else {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    var carry = 0;\\\\n    for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {\\\\n      var word = this.words[i] | 0;\\\\n      this.words[i] = (carry << (26 - r)) | (word >>> r);\\\\n      carry = word & mask;\\\\n    }\\\\n\\\\n    // Push carried bits as a mask\\\\n    if (maskedWords && carry !== 0) {\\\\n      maskedWords.words[maskedWords.length++] = carry;\\\\n    }\\\\n\\\\n    if (this.length === 0) {\\\\n      this.words[0] = 0;\\\\n      this.length = 1;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.ishrn = function ishrn (bits, hint, extended) {\\\\n    // TODO(indutny): implement me\\\\n    assert(this.negative === 0);\\\\n    return this.iushrn(bits, hint, extended);\\\\n  };\\\\n\\\\n  // Shift-left\\\\n  BN.prototype.shln = function shln (bits) {\\\\n    return this.clone().ishln(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushln = function ushln (bits) {\\\\n    return this.clone().iushln(bits);\\\\n  };\\\\n\\\\n  // Shift-right\\\\n  BN.prototype.shrn = function shrn (bits) {\\\\n    return this.clone().ishrn(bits);\\\\n  };\\\\n\\\\n  BN.prototype.ushrn = function ushrn (bits) {\\\\n    return this.clone().iushrn(bits);\\\\n  };\\\\n\\\\n  // Test if n bit is set\\\\n  BN.prototype.testn = function testn (bit) {\\\\n    assert(typeof bit === \'number\' && bit >= 0);\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) return false;\\\\n\\\\n    // Check bit and return\\\\n    var w = this.words[s];\\\\n\\\\n    return !!(w & q);\\\\n  };\\\\n\\\\n  // Return only lowers bits of number (in-place)\\\\n  BN.prototype.imaskn = function imaskn (bits) {\\\\n    assert(typeof bits === \'number\' && bits >= 0);\\\\n    var r = bits % 26;\\\\n    var s = (bits - r) / 26;\\\\n\\\\n    assert(this.negative === 0, \'imaskn works only with positive numbers\');\\\\n\\\\n    if (this.length <= s) {\\\\n      return this;\\\\n    }\\\\n\\\\n    if (r !== 0) {\\\\n      s++;\\\\n    }\\\\n    this.length = Math.min(s, this.length);\\\\n\\\\n    if (r !== 0) {\\\\n      var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r);\\\\n      this.words[this.length - 1] &= mask;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  // Return only lowers bits of number\\\\n  BN.prototype.maskn = function maskn (bits) {\\\\n    return this.clone().imaskn(bits);\\\\n  };\\\\n\\\\n  // Add plain number `num` to `this`\\\\n  BN.prototype.iaddn = function iaddn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.isubn(-num);\\\\n\\\\n    // Possible sign change\\\\n    if (this.negative !== 0) {\\\\n      if (this.length === 1 && (this.words[0] | 0) < num) {\\\\n        this.words[0] = num - (this.words[0] | 0);\\\\n        this.negative = 0;\\\\n        return this;\\\\n      }\\\\n\\\\n      this.negative = 0;\\\\n      this.isubn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add without checks\\\\n    return this._iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype._iaddn = function _iaddn (num) {\\\\n    this.words[0] += num;\\\\n\\\\n    // Carry\\\\n    for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) {\\\\n      this.words[i] -= 0x4000000;\\\\n      if (i === this.length - 1) {\\\\n        this.words[i + 1] = 1;\\\\n      } else {\\\\n        this.words[i + 1]++;\\\\n      }\\\\n    }\\\\n    this.length = Math.max(this.length, i + 1);\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  // Subtract plain number `num` from `this`\\\\n  BN.prototype.isubn = function isubn (num) {\\\\n    assert(typeof num === \'number\');\\\\n    assert(num < 0x4000000);\\\\n    if (num < 0) return this.iaddn(-num);\\\\n\\\\n    if (this.negative !== 0) {\\\\n      this.negative = 0;\\\\n      this.iaddn(num);\\\\n      this.negative = 1;\\\\n      return this;\\\\n    }\\\\n\\\\n    this.words[0] -= num;\\\\n\\\\n    if (this.length === 1 && this.words[0] < 0) {\\\\n      this.words[0] = -this.words[0];\\\\n      this.negative = 1;\\\\n    } else {\\\\n      // Carry\\\\n      for (var i = 0; i < this.length && this.words[i] < 0; i++) {\\\\n        this.words[i] += 0x4000000;\\\\n        this.words[i + 1] -= 1;\\\\n      }\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.addn = function addn (num) {\\\\n    return this.clone().iaddn(num);\\\\n  };\\\\n\\\\n  BN.prototype.subn = function subn (num) {\\\\n    return this.clone().isubn(num);\\\\n  };\\\\n\\\\n  BN.prototype.iabs = function iabs () {\\\\n    this.negative = 0;\\\\n\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.abs = function abs () {\\\\n    return this.clone().iabs();\\\\n  };\\\\n\\\\n  BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) {\\\\n    var len = num.length + shift;\\\\n    var i;\\\\n\\\\n    this._expand(len);\\\\n\\\\n    var w;\\\\n    var carry = 0;\\\\n    for (i = 0; i < num.length; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      var right = (num.words[i] | 0) * mul;\\\\n      w -= right & 0x3ffffff;\\\\n      carry = (w >> 26) - ((right / 0x4000000) | 0);\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n    for (; i < this.length - shift; i++) {\\\\n      w = (this.words[i + shift] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i + shift] = w & 0x3ffffff;\\\\n    }\\\\n\\\\n    if (carry === 0) return this.strip();\\\\n\\\\n    // Subtraction overflow\\\\n    assert(carry === -1);\\\\n    carry = 0;\\\\n    for (i = 0; i < this.length; i++) {\\\\n      w = -(this.words[i] | 0) + carry;\\\\n      carry = w >> 26;\\\\n      this.words[i] = w & 0x3ffffff;\\\\n    }\\\\n    this.negative = 1;\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype._wordDiv = function _wordDiv (num, mode) {\\\\n    var shift = this.length - num.length;\\\\n\\\\n    var a = this.clone();\\\\n    var b = num;\\\\n\\\\n    // Normalize\\\\n    var bhi = b.words[b.length - 1] | 0;\\\\n    var bhiBits = this._countBits(bhi);\\\\n    shift = 26 - bhiBits;\\\\n    if (shift !== 0) {\\\\n      b = b.ushln(shift);\\\\n      a.iushln(shift);\\\\n      bhi = b.words[b.length - 1] | 0;\\\\n    }\\\\n\\\\n    // Initialize quotient\\\\n    var m = a.length - b.length;\\\\n    var q;\\\\n\\\\n    if (mode !== \'mod\') {\\\\n      q = new BN(null);\\\\n      q.length = m + 1;\\\\n      q.words = new Array(q.length);\\\\n      for (var i = 0; i < q.length; i++) {\\\\n        q.words[i] = 0;\\\\n      }\\\\n    }\\\\n\\\\n    var diff = a.clone()._ishlnsubmul(b, 1, m);\\\\n    if (diff.negative === 0) {\\\\n      a = diff;\\\\n      if (q) {\\\\n        q.words[m] = 1;\\\\n      }\\\\n    }\\\\n\\\\n    for (var j = m - 1; j >= 0; j--) {\\\\n      var qj = (a.words[b.length + j] | 0) * 0x4000000 +\\\\n        (a.words[b.length + j - 1] | 0);\\\\n\\\\n      // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max\\\\n      // (0x7ffffff)\\\\n      qj = Math.min((qj / bhi) | 0, 0x3ffffff);\\\\n\\\\n      a._ishlnsubmul(b, qj, j);\\\\n      while (a.negative !== 0) {\\\\n        qj--;\\\\n        a.negative = 0;\\\\n        a._ishlnsubmul(b, 1, j);\\\\n        if (!a.isZero()) {\\\\n          a.negative ^= 1;\\\\n        }\\\\n      }\\\\n      if (q) {\\\\n        q.words[j] = qj;\\\\n      }\\\\n    }\\\\n    if (q) {\\\\n      q.strip();\\\\n    }\\\\n    a.strip();\\\\n\\\\n    // Denormalize\\\\n    if (mode !== \'div\' && shift !== 0) {\\\\n      a.iushrn(shift);\\\\n    }\\\\n\\\\n    return {\\\\n      div: q || null,\\\\n      mod: a\\\\n    };\\\\n  };\\\\n\\\\n  // NOTE: 1) `mode` can be set to `mod` to request mod only,\\\\n  //       to `div` to request div only, or be absent to\\\\n  //       request both div & mod\\\\n  //       2) `positive` is true if unsigned mod is requested\\\\n  BN.prototype.divmod = function divmod (num, mode, positive) {\\\\n    assert(!num.isZero());\\\\n\\\\n    if (this.isZero()) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: new BN(0)\\\\n      };\\\\n    }\\\\n\\\\n    var div, mod, res;\\\\n    if (this.negative !== 0 && num.negative === 0) {\\\\n      res = this.neg().divmod(num, mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.iadd(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    if (this.negative === 0 && num.negative !== 0) {\\\\n      res = this.divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'mod\') {\\\\n        div = res.div.neg();\\\\n      }\\\\n\\\\n      return {\\\\n        div: div,\\\\n        mod: res.mod\\\\n      };\\\\n    }\\\\n\\\\n    if ((this.negative & num.negative) !== 0) {\\\\n      res = this.neg().divmod(num.neg(), mode);\\\\n\\\\n      if (mode !== \'div\') {\\\\n        mod = res.mod.neg();\\\\n        if (positive && mod.negative !== 0) {\\\\n          mod.isub(num);\\\\n        }\\\\n      }\\\\n\\\\n      return {\\\\n        div: res.div,\\\\n        mod: mod\\\\n      };\\\\n    }\\\\n\\\\n    // Both numbers are positive at this point\\\\n\\\\n    // Strip both numbers to approximate shift value\\\\n    if (num.length > this.length || this.cmp(num) < 0) {\\\\n      return {\\\\n        div: new BN(0),\\\\n        mod: this\\\\n      };\\\\n    }\\\\n\\\\n    // Very short reduction\\\\n    if (num.length === 1) {\\\\n      if (mode === \'div\') {\\\\n        return {\\\\n          div: this.divn(num.words[0]),\\\\n          mod: null\\\\n        };\\\\n      }\\\\n\\\\n      if (mode === \'mod\') {\\\\n        return {\\\\n          div: null,\\\\n          mod: new BN(this.modn(num.words[0]))\\\\n        };\\\\n      }\\\\n\\\\n      return {\\\\n        div: this.divn(num.words[0]),\\\\n        mod: new BN(this.modn(num.words[0]))\\\\n      };\\\\n    }\\\\n\\\\n    return this._wordDiv(num, mode);\\\\n  };\\\\n\\\\n  // Find `this` / `num`\\\\n  BN.prototype.div = function div (num) {\\\\n    return this.divmod(num, \'div\', false).div;\\\\n  };\\\\n\\\\n  // Find `this` % `num`\\\\n  BN.prototype.mod = function mod (num) {\\\\n    return this.divmod(num, \'mod\', false).mod;\\\\n  };\\\\n\\\\n  BN.prototype.umod = function umod (num) {\\\\n    return this.divmod(num, \'mod\', true).mod;\\\\n  };\\\\n\\\\n  // Find Round(`this` / `num`)\\\\n  BN.prototype.divRound = function divRound (num) {\\\\n    var dm = this.divmod(num);\\\\n\\\\n    // Fast case - exact division\\\\n    if (dm.mod.isZero()) return dm.div;\\\\n\\\\n    var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;\\\\n\\\\n    var half = num.ushrn(1);\\\\n    var r2 = num.andln(1);\\\\n    var cmp = mod.cmp(half);\\\\n\\\\n    // Round down\\\\n    if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;\\\\n\\\\n    // Round up\\\\n    return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);\\\\n  };\\\\n\\\\n  BN.prototype.modn = function modn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n    var p = (1 << 26) % num;\\\\n\\\\n    var acc = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      acc = (p * acc + (this.words[i] | 0)) % num;\\\\n    }\\\\n\\\\n    return acc;\\\\n  };\\\\n\\\\n  // In-place division by number\\\\n  BN.prototype.idivn = function idivn (num) {\\\\n    assert(num <= 0x3ffffff);\\\\n\\\\n    var carry = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var w = (this.words[i] | 0) + carry * 0x4000000;\\\\n      this.words[i] = (w / num) | 0;\\\\n      carry = w % num;\\\\n    }\\\\n\\\\n    return this.strip();\\\\n  };\\\\n\\\\n  BN.prototype.divn = function divn (num) {\\\\n    return this.clone().idivn(num);\\\\n  };\\\\n\\\\n  BN.prototype.egcd = function egcd (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var x = this;\\\\n    var y = p.clone();\\\\n\\\\n    if (x.negative !== 0) {\\\\n      x = x.umod(p);\\\\n    } else {\\\\n      x = x.clone();\\\\n    }\\\\n\\\\n    // A * x + B * y = x\\\\n    var A = new BN(1);\\\\n    var B = new BN(0);\\\\n\\\\n    // C * x + D * y = y\\\\n    var C = new BN(0);\\\\n    var D = new BN(1);\\\\n\\\\n    var g = 0;\\\\n\\\\n    while (x.isEven() && y.isEven()) {\\\\n      x.iushrn(1);\\\\n      y.iushrn(1);\\\\n      ++g;\\\\n    }\\\\n\\\\n    var yp = y.clone();\\\\n    var xp = x.clone();\\\\n\\\\n    while (!x.isZero()) {\\\\n      for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        x.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (A.isOdd() || B.isOdd()) {\\\\n            A.iadd(yp);\\\\n            B.isub(xp);\\\\n          }\\\\n\\\\n          A.iushrn(1);\\\\n          B.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        y.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (C.isOdd() || D.isOdd()) {\\\\n            C.iadd(yp);\\\\n            D.isub(xp);\\\\n          }\\\\n\\\\n          C.iushrn(1);\\\\n          D.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (x.cmp(y) >= 0) {\\\\n        x.isub(y);\\\\n        A.isub(C);\\\\n        B.isub(D);\\\\n      } else {\\\\n        y.isub(x);\\\\n        C.isub(A);\\\\n        D.isub(B);\\\\n      }\\\\n    }\\\\n\\\\n    return {\\\\n      a: C,\\\\n      b: D,\\\\n      gcd: y.iushln(g)\\\\n    };\\\\n  };\\\\n\\\\n  // This is reduced incarnation of the binary EEA\\\\n  // above, designated to invert members of the\\\\n  // _prime_ fields F(p) at a maximal speed\\\\n  BN.prototype._invmp = function _invmp (p) {\\\\n    assert(p.negative === 0);\\\\n    assert(!p.isZero());\\\\n\\\\n    var a = this;\\\\n    var b = p.clone();\\\\n\\\\n    if (a.negative !== 0) {\\\\n      a = a.umod(p);\\\\n    } else {\\\\n      a = a.clone();\\\\n    }\\\\n\\\\n    var x1 = new BN(1);\\\\n    var x2 = new BN(0);\\\\n\\\\n    var delta = b.clone();\\\\n\\\\n    while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {\\\\n      for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1);\\\\n      if (i > 0) {\\\\n        a.iushrn(i);\\\\n        while (i-- > 0) {\\\\n          if (x1.isOdd()) {\\\\n            x1.iadd(delta);\\\\n          }\\\\n\\\\n          x1.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1);\\\\n      if (j > 0) {\\\\n        b.iushrn(j);\\\\n        while (j-- > 0) {\\\\n          if (x2.isOdd()) {\\\\n            x2.iadd(delta);\\\\n          }\\\\n\\\\n          x2.iushrn(1);\\\\n        }\\\\n      }\\\\n\\\\n      if (a.cmp(b) >= 0) {\\\\n        a.isub(b);\\\\n        x1.isub(x2);\\\\n      } else {\\\\n        b.isub(a);\\\\n        x2.isub(x1);\\\\n      }\\\\n    }\\\\n\\\\n    var res;\\\\n    if (a.cmpn(1) === 0) {\\\\n      res = x1;\\\\n    } else {\\\\n      res = x2;\\\\n    }\\\\n\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(p);\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gcd = function gcd (num) {\\\\n    if (this.isZero()) return num.abs();\\\\n    if (num.isZero()) return this.abs();\\\\n\\\\n    var a = this.clone();\\\\n    var b = num.clone();\\\\n    a.negative = 0;\\\\n    b.negative = 0;\\\\n\\\\n    // Remove common factor of two\\\\n    for (var shift = 0; a.isEven() && b.isEven(); shift++) {\\\\n      a.iushrn(1);\\\\n      b.iushrn(1);\\\\n    }\\\\n\\\\n    do {\\\\n      while (a.isEven()) {\\\\n        a.iushrn(1);\\\\n      }\\\\n      while (b.isEven()) {\\\\n        b.iushrn(1);\\\\n      }\\\\n\\\\n      var r = a.cmp(b);\\\\n      if (r < 0) {\\\\n        // Swap `a` and `b` to make `a` always bigger than `b`\\\\n        var t = a;\\\\n        a = b;\\\\n        b = t;\\\\n      } else if (r === 0 || b.cmpn(1) === 0) {\\\\n        break;\\\\n      }\\\\n\\\\n      a.isub(b);\\\\n    } while (true);\\\\n\\\\n    return b.iushln(shift);\\\\n  };\\\\n\\\\n  // Invert number in the field F(num)\\\\n  BN.prototype.invm = function invm (num) {\\\\n    return this.egcd(num).a.umod(num);\\\\n  };\\\\n\\\\n  BN.prototype.isEven = function isEven () {\\\\n    return (this.words[0] & 1) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.isOdd = function isOdd () {\\\\n    return (this.words[0] & 1) === 1;\\\\n  };\\\\n\\\\n  // And first word and num\\\\n  BN.prototype.andln = function andln (num) {\\\\n    return this.words[0] & num;\\\\n  };\\\\n\\\\n  // Increment at the bit position in-line\\\\n  BN.prototype.bincn = function bincn (bit) {\\\\n    assert(typeof bit === \'number\');\\\\n    var r = bit % 26;\\\\n    var s = (bit - r) / 26;\\\\n    var q = 1 << r;\\\\n\\\\n    // Fast case: bit is much higher than all existing words\\\\n    if (this.length <= s) {\\\\n      this._expand(s + 1);\\\\n      this.words[s] |= q;\\\\n      return this;\\\\n    }\\\\n\\\\n    // Add bit and propagate, if needed\\\\n    var carry = q;\\\\n    for (var i = s; carry !== 0 && i < this.length; i++) {\\\\n      var w = this.words[i] | 0;\\\\n      w += carry;\\\\n      carry = w >>> 26;\\\\n      w &= 0x3ffffff;\\\\n      this.words[i] = w;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      this.words[i] = carry;\\\\n      this.length++;\\\\n    }\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.isZero = function isZero () {\\\\n    return this.length === 1 && this.words[0] === 0;\\\\n  };\\\\n\\\\n  BN.prototype.cmpn = function cmpn (num) {\\\\n    var negative = num < 0;\\\\n\\\\n    if (this.negative !== 0 && !negative) return -1;\\\\n    if (this.negative === 0 && negative) return 1;\\\\n\\\\n    this.strip();\\\\n\\\\n    var res;\\\\n    if (this.length > 1) {\\\\n      res = 1;\\\\n    } else {\\\\n      if (negative) {\\\\n        num = -num;\\\\n      }\\\\n\\\\n      assert(num <= 0x3ffffff, \'Number is too big\');\\\\n\\\\n      var w = this.words[0] | 0;\\\\n      res = w === num ? 0 : w < num ? -1 : 1;\\\\n    }\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Compare two numbers and return:\\\\n  // 1 - if `this` > `num`\\\\n  // 0 - if `this` == `num`\\\\n  // -1 - if `this` < `num`\\\\n  BN.prototype.cmp = function cmp (num) {\\\\n    if (this.negative !== 0 && num.negative === 0) return -1;\\\\n    if (this.negative === 0 && num.negative !== 0) return 1;\\\\n\\\\n    var res = this.ucmp(num);\\\\n    if (this.negative !== 0) return -res | 0;\\\\n    return res;\\\\n  };\\\\n\\\\n  // Unsigned comparison\\\\n  BN.prototype.ucmp = function ucmp (num) {\\\\n    // At this point both numbers have the same sign\\\\n    if (this.length > num.length) return 1;\\\\n    if (this.length < num.length) return -1;\\\\n\\\\n    var res = 0;\\\\n    for (var i = this.length - 1; i >= 0; i--) {\\\\n      var a = this.words[i] | 0;\\\\n      var b = num.words[i] | 0;\\\\n\\\\n      if (a === b) continue;\\\\n      if (a < b) {\\\\n        res = -1;\\\\n      } else if (a > b) {\\\\n        res = 1;\\\\n      }\\\\n      break;\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  BN.prototype.gtn = function gtn (num) {\\\\n    return this.cmpn(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gt = function gt (num) {\\\\n    return this.cmp(num) === 1;\\\\n  };\\\\n\\\\n  BN.prototype.gten = function gten (num) {\\\\n    return this.cmpn(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.gte = function gte (num) {\\\\n    return this.cmp(num) >= 0;\\\\n  };\\\\n\\\\n  BN.prototype.ltn = function ltn (num) {\\\\n    return this.cmpn(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lt = function lt (num) {\\\\n    return this.cmp(num) === -1;\\\\n  };\\\\n\\\\n  BN.prototype.lten = function lten (num) {\\\\n    return this.cmpn(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.lte = function lte (num) {\\\\n    return this.cmp(num) <= 0;\\\\n  };\\\\n\\\\n  BN.prototype.eqn = function eqn (num) {\\\\n    return this.cmpn(num) === 0;\\\\n  };\\\\n\\\\n  BN.prototype.eq = function eq (num) {\\\\n    return this.cmp(num) === 0;\\\\n  };\\\\n\\\\n  //\\\\n  // A reduce context, could be using montgomery or something better, depending\\\\n  // on the `m` itself.\\\\n  //\\\\n  BN.red = function red (num) {\\\\n    return new Red(num);\\\\n  };\\\\n\\\\n  BN.prototype.toRed = function toRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    assert(this.negative === 0, \'red works only with positives\');\\\\n    return ctx.convertTo(this)._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.fromRed = function fromRed () {\\\\n    assert(this.red, \'fromRed works only with numbers in reduction context\');\\\\n    return this.red.convertFrom(this);\\\\n  };\\\\n\\\\n  BN.prototype._forceRed = function _forceRed (ctx) {\\\\n    this.red = ctx;\\\\n    return this;\\\\n  };\\\\n\\\\n  BN.prototype.forceRed = function forceRed (ctx) {\\\\n    assert(!this.red, \'Already a number in reduction context\');\\\\n    return this._forceRed(ctx);\\\\n  };\\\\n\\\\n  BN.prototype.redAdd = function redAdd (num) {\\\\n    assert(this.red, \'redAdd works only with red numbers\');\\\\n    return this.red.add(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIAdd = function redIAdd (num) {\\\\n    assert(this.red, \'redIAdd works only with red numbers\');\\\\n    return this.red.iadd(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSub = function redSub (num) {\\\\n    assert(this.red, \'redSub works only with red numbers\');\\\\n    return this.red.sub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redISub = function redISub (num) {\\\\n    assert(this.red, \'redISub works only with red numbers\');\\\\n    return this.red.isub(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redShl = function redShl (num) {\\\\n    assert(this.red, \'redShl works only with red numbers\');\\\\n    return this.red.shl(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redMul = function redMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.mul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redIMul = function redIMul (num) {\\\\n    assert(this.red, \'redMul works only with red numbers\');\\\\n    this.red._verify2(this, num);\\\\n    return this.red.imul(this, num);\\\\n  };\\\\n\\\\n  BN.prototype.redSqr = function redSqr () {\\\\n    assert(this.red, \'redSqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqr(this);\\\\n  };\\\\n\\\\n  BN.prototype.redISqr = function redISqr () {\\\\n    assert(this.red, \'redISqr works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.isqr(this);\\\\n  };\\\\n\\\\n  // Square root over p\\\\n  BN.prototype.redSqrt = function redSqrt () {\\\\n    assert(this.red, \'redSqrt works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.sqrt(this);\\\\n  };\\\\n\\\\n  BN.prototype.redInvm = function redInvm () {\\\\n    assert(this.red, \'redInvm works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.invm(this);\\\\n  };\\\\n\\\\n  // Return negative clone of `this` % `red modulo`\\\\n  BN.prototype.redNeg = function redNeg () {\\\\n    assert(this.red, \'redNeg works only with red numbers\');\\\\n    this.red._verify1(this);\\\\n    return this.red.neg(this);\\\\n  };\\\\n\\\\n  BN.prototype.redPow = function redPow (num) {\\\\n    assert(this.red && !num.red, \'redPow(normalNum)\');\\\\n    this.red._verify1(this);\\\\n    return this.red.pow(this, num);\\\\n  };\\\\n\\\\n  // Prime numbers with efficient reduction\\\\n  var primes = {\\\\n    k256: null,\\\\n    p224: null,\\\\n    p192: null,\\\\n    p25519: null\\\\n  };\\\\n\\\\n  // Pseudo-Mersenne prime\\\\n  function MPrime (name, p) {\\\\n    // P = 2 ^ N - K\\\\n    this.name = name;\\\\n    this.p = new BN(p, 16);\\\\n    this.n = this.p.bitLength();\\\\n    this.k = new BN(1).iushln(this.n).isub(this.p);\\\\n\\\\n    this.tmp = this._tmp();\\\\n  }\\\\n\\\\n  MPrime.prototype._tmp = function _tmp () {\\\\n    var tmp = new BN(null);\\\\n    tmp.words = new Array(Math.ceil(this.n / 13));\\\\n    return tmp;\\\\n  };\\\\n\\\\n  MPrime.prototype.ireduce = function ireduce (num) {\\\\n    // Assumes that `num` is less than `P^2`\\\\n    // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P)\\\\n    var r = num;\\\\n    var rlen;\\\\n\\\\n    do {\\\\n      this.split(r, this.tmp);\\\\n      r = this.imulK(r);\\\\n      r = r.iadd(this.tmp);\\\\n      rlen = r.bitLength();\\\\n    } while (rlen > this.n);\\\\n\\\\n    var cmp = rlen < this.n ? -1 : r.ucmp(this.p);\\\\n    if (cmp === 0) {\\\\n      r.words[0] = 0;\\\\n      r.length = 1;\\\\n    } else if (cmp > 0) {\\\\n      r.isub(this.p);\\\\n    } else {\\\\n      r.strip();\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  MPrime.prototype.split = function split (input, out) {\\\\n    input.iushrn(this.n, 0, out);\\\\n  };\\\\n\\\\n  MPrime.prototype.imulK = function imulK (num) {\\\\n    return num.imul(this.k);\\\\n  };\\\\n\\\\n  function K256 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'k256\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f\');\\\\n  }\\\\n  inherits(K256, MPrime);\\\\n\\\\n  K256.prototype.split = function split (input, output) {\\\\n    // 256 = 9 * 26 + 22\\\\n    var mask = 0x3fffff;\\\\n\\\\n    var outLen = Math.min(input.length, 9);\\\\n    for (var i = 0; i < outLen; i++) {\\\\n      output.words[i] = input.words[i];\\\\n    }\\\\n    output.length = outLen;\\\\n\\\\n    if (input.length <= 9) {\\\\n      input.words[0] = 0;\\\\n      input.length = 1;\\\\n      return;\\\\n    }\\\\n\\\\n    // Shift by 9 limbs\\\\n    var prev = input.words[9];\\\\n    output.words[output.length++] = prev & mask;\\\\n\\\\n    for (i = 10; i < input.length; i++) {\\\\n      var next = input.words[i] | 0;\\\\n      input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22);\\\\n      prev = next;\\\\n    }\\\\n    prev >>>= 22;\\\\n    input.words[i - 10] = prev;\\\\n    if (prev === 0 && input.length > 10) {\\\\n      input.length -= 10;\\\\n    } else {\\\\n      input.length -= 9;\\\\n    }\\\\n  };\\\\n\\\\n  K256.prototype.imulK = function imulK (num) {\\\\n    // K = 0x1000003d1 = [ 0x40, 0x3d1 ]\\\\n    num.words[num.length] = 0;\\\\n    num.words[num.length + 1] = 0;\\\\n    num.length += 2;\\\\n\\\\n    // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390\\\\n    var lo = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var w = num.words[i] | 0;\\\\n      lo += w * 0x3d1;\\\\n      num.words[i] = lo & 0x3ffffff;\\\\n      lo = w * 0x40 + ((lo / 0x4000000) | 0);\\\\n    }\\\\n\\\\n    // Fast length reduction\\\\n    if (num.words[num.length - 1] === 0) {\\\\n      num.length--;\\\\n      if (num.words[num.length - 1] === 0) {\\\\n        num.length--;\\\\n      }\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  function P224 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p224\',\\\\n      \'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001\');\\\\n  }\\\\n  inherits(P224, MPrime);\\\\n\\\\n  function P192 () {\\\\n    MPrime.call(\\\\n      this,\\\\n      \'p192\',\\\\n      \'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff\');\\\\n  }\\\\n  inherits(P192, MPrime);\\\\n\\\\n  function P25519 () {\\\\n    // 2 ^ 255 - 19\\\\n    MPrime.call(\\\\n      this,\\\\n      \'25519\',\\\\n      \'7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed\');\\\\n  }\\\\n  inherits(P25519, MPrime);\\\\n\\\\n  P25519.prototype.imulK = function imulK (num) {\\\\n    // K = 0x13\\\\n    var carry = 0;\\\\n    for (var i = 0; i < num.length; i++) {\\\\n      var hi = (num.words[i] | 0) * 0x13 + carry;\\\\n      var lo = hi & 0x3ffffff;\\\\n      hi >>>= 26;\\\\n\\\\n      num.words[i] = lo;\\\\n      carry = hi;\\\\n    }\\\\n    if (carry !== 0) {\\\\n      num.words[num.length++] = carry;\\\\n    }\\\\n    return num;\\\\n  };\\\\n\\\\n  // Exported mostly for testing purposes, use plain name instead\\\\n  BN._prime = function prime (name) {\\\\n    // Cached version of prime\\\\n    if (primes[name]) return primes[name];\\\\n\\\\n    var prime;\\\\n    if (name === \'k256\') {\\\\n      prime = new K256();\\\\n    } else if (name === \'p224\') {\\\\n      prime = new P224();\\\\n    } else if (name === \'p192\') {\\\\n      prime = new P192();\\\\n    } else if (name === \'p25519\') {\\\\n      prime = new P25519();\\\\n    } else {\\\\n      throw new Error(\'Unknown prime \' + name);\\\\n    }\\\\n    primes[name] = prime;\\\\n\\\\n    return prime;\\\\n  };\\\\n\\\\n  //\\\\n  // Base reduction engine\\\\n  //\\\\n  function Red (m) {\\\\n    if (typeof m === \'string\') {\\\\n      var prime = BN._prime(m);\\\\n      this.m = prime.p;\\\\n      this.prime = prime;\\\\n    } else {\\\\n      assert(m.gtn(1), \'modulus must be greater than 1\');\\\\n      this.m = m;\\\\n      this.prime = null;\\\\n    }\\\\n  }\\\\n\\\\n  Red.prototype._verify1 = function _verify1 (a) {\\\\n    assert(a.negative === 0, \'red works only with positives\');\\\\n    assert(a.red, \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype._verify2 = function _verify2 (a, b) {\\\\n    assert((a.negative | b.negative) === 0, \'red works only with positives\');\\\\n    assert(a.red && a.red === b.red,\\\\n      \'red works only with red numbers\');\\\\n  };\\\\n\\\\n  Red.prototype.imod = function imod (a) {\\\\n    if (this.prime) return this.prime.ireduce(a)._forceRed(this);\\\\n    return a.umod(this.m)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.neg = function neg (a) {\\\\n    if (a.isZero()) {\\\\n      return a.clone();\\\\n    }\\\\n\\\\n    return this.m.sub(a)._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.add = function add (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.add(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.iadd = function iadd (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.iadd(b);\\\\n    if (res.cmp(this.m) >= 0) {\\\\n      res.isub(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.sub = function sub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.sub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Red.prototype.isub = function isub (a, b) {\\\\n    this._verify2(a, b);\\\\n\\\\n    var res = a.isub(b);\\\\n    if (res.cmpn(0) < 0) {\\\\n      res.iadd(this.m);\\\\n    }\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.shl = function shl (a, num) {\\\\n    this._verify1(a);\\\\n    return this.imod(a.ushln(num));\\\\n  };\\\\n\\\\n  Red.prototype.imul = function imul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.imul(b));\\\\n  };\\\\n\\\\n  Red.prototype.mul = function mul (a, b) {\\\\n    this._verify2(a, b);\\\\n    return this.imod(a.mul(b));\\\\n  };\\\\n\\\\n  Red.prototype.isqr = function isqr (a) {\\\\n    return this.imul(a, a.clone());\\\\n  };\\\\n\\\\n  Red.prototype.sqr = function sqr (a) {\\\\n    return this.mul(a, a);\\\\n  };\\\\n\\\\n  Red.prototype.sqrt = function sqrt (a) {\\\\n    if (a.isZero()) return a.clone();\\\\n\\\\n    var mod3 = this.m.andln(3);\\\\n    assert(mod3 % 2 === 1);\\\\n\\\\n    // Fast case\\\\n    if (mod3 === 3) {\\\\n      var pow = this.m.add(new BN(1)).iushrn(2);\\\\n      return this.pow(a, pow);\\\\n    }\\\\n\\\\n    // Tonelli-Shanks algorithm (Totally unoptimized and slow)\\\\n    //\\\\n    // Find Q and S, that Q * 2 ^ S = (P - 1)\\\\n    var q = this.m.subn(1);\\\\n    var s = 0;\\\\n    while (!q.isZero() && q.andln(1) === 0) {\\\\n      s++;\\\\n      q.iushrn(1);\\\\n    }\\\\n    assert(!q.isZero());\\\\n\\\\n    var one = new BN(1).toRed(this);\\\\n    var nOne = one.redNeg();\\\\n\\\\n    // Find quadratic non-residue\\\\n    // NOTE: Max is such because of generalized Riemann hypothesis.\\\\n    var lpow = this.m.subn(1).iushrn(1);\\\\n    var z = this.m.bitLength();\\\\n    z = new BN(2 * z * z).toRed(this);\\\\n\\\\n    while (this.pow(z, lpow).cmp(nOne) !== 0) {\\\\n      z.redIAdd(nOne);\\\\n    }\\\\n\\\\n    var c = this.pow(z, q);\\\\n    var r = this.pow(a, q.addn(1).iushrn(1));\\\\n    var t = this.pow(a, q);\\\\n    var m = s;\\\\n    while (t.cmp(one) !== 0) {\\\\n      var tmp = t;\\\\n      for (var i = 0; tmp.cmp(one) !== 0; i++) {\\\\n        tmp = tmp.redSqr();\\\\n      }\\\\n      assert(i < m);\\\\n      var b = this.pow(c, new BN(1).iushln(m - i - 1));\\\\n\\\\n      r = r.redMul(b);\\\\n      c = b.redSqr();\\\\n      t = t.redMul(c);\\\\n      m = i;\\\\n    }\\\\n\\\\n    return r;\\\\n  };\\\\n\\\\n  Red.prototype.invm = function invm (a) {\\\\n    var inv = a._invmp(this.m);\\\\n    if (inv.negative !== 0) {\\\\n      inv.negative = 0;\\\\n      return this.imod(inv).redNeg();\\\\n    } else {\\\\n      return this.imod(inv);\\\\n    }\\\\n  };\\\\n\\\\n  Red.prototype.pow = function pow (a, num) {\\\\n    if (num.isZero()) return new BN(1);\\\\n    if (num.cmpn(1) === 0) return a.clone();\\\\n\\\\n    var windowSize = 4;\\\\n    var wnd = new Array(1 << windowSize);\\\\n    wnd[0] = new BN(1).toRed(this);\\\\n    wnd[1] = a;\\\\n    for (var i = 2; i < wnd.length; i++) {\\\\n      wnd[i] = this.mul(wnd[i - 1], a);\\\\n    }\\\\n\\\\n    var res = wnd[0];\\\\n    var current = 0;\\\\n    var currentLen = 0;\\\\n    var start = num.bitLength() % 26;\\\\n    if (start === 0) {\\\\n      start = 26;\\\\n    }\\\\n\\\\n    for (i = num.length - 1; i >= 0; i--) {\\\\n      var word = num.words[i];\\\\n      for (var j = start - 1; j >= 0; j--) {\\\\n        var bit = (word >> j) & 1;\\\\n        if (res !== wnd[0]) {\\\\n          res = this.sqr(res);\\\\n        }\\\\n\\\\n        if (bit === 0 && current === 0) {\\\\n          currentLen = 0;\\\\n          continue;\\\\n        }\\\\n\\\\n        current <<= 1;\\\\n        current |= bit;\\\\n        currentLen++;\\\\n        if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;\\\\n\\\\n        res = this.mul(res, wnd[current]);\\\\n        currentLen = 0;\\\\n        current = 0;\\\\n      }\\\\n      start = 26;\\\\n    }\\\\n\\\\n    return res;\\\\n  };\\\\n\\\\n  Red.prototype.convertTo = function convertTo (num) {\\\\n    var r = num.umod(this.m);\\\\n\\\\n    return r === num ? r.clone() : r;\\\\n  };\\\\n\\\\n  Red.prototype.convertFrom = function convertFrom (num) {\\\\n    var res = num.clone();\\\\n    res.red = null;\\\\n    return res;\\\\n  };\\\\n\\\\n  //\\\\n  // Montgomery method engine\\\\n  //\\\\n\\\\n  BN.mont = function mont (num) {\\\\n    return new Mont(num);\\\\n  };\\\\n\\\\n  function Mont (m) {\\\\n    Red.call(this, m);\\\\n\\\\n    this.shift = this.m.bitLength();\\\\n    if (this.shift % 26 !== 0) {\\\\n      this.shift += 26 - (this.shift % 26);\\\\n    }\\\\n\\\\n    this.r = new BN(1).iushln(this.shift);\\\\n    this.r2 = this.imod(this.r.sqr());\\\\n    this.rinv = this.r._invmp(this.m);\\\\n\\\\n    this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);\\\\n    this.minv = this.minv.umod(this.r);\\\\n    this.minv = this.r.sub(this.minv);\\\\n  }\\\\n  inherits(Mont, Red);\\\\n\\\\n  Mont.prototype.convertTo = function convertTo (num) {\\\\n    return this.imod(num.ushln(this.shift));\\\\n  };\\\\n\\\\n  Mont.prototype.convertFrom = function convertFrom (num) {\\\\n    var r = this.imod(num.mul(this.rinv));\\\\n    r.red = null;\\\\n    return r;\\\\n  };\\\\n\\\\n  Mont.prototype.imul = function imul (a, b) {\\\\n    if (a.isZero() || b.isZero()) {\\\\n      a.words[0] = 0;\\\\n      a.length = 1;\\\\n      return a;\\\\n    }\\\\n\\\\n    var t = a.imul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.mul = function mul (a, b) {\\\\n    if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);\\\\n\\\\n    var t = a.mul(b);\\\\n    var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);\\\\n    var u = t.isub(c).iushrn(this.shift);\\\\n    var res = u;\\\\n    if (u.cmp(this.m) >= 0) {\\\\n      res = u.isub(this.m);\\\\n    } else if (u.cmpn(0) < 0) {\\\\n      res = u.iadd(this.m);\\\\n    }\\\\n\\\\n    return res._forceRed(this);\\\\n  };\\\\n\\\\n  Mont.prototype.invm = function invm (a) {\\\\n    // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R\\\\n    var res = this.imod(a._invmp(this.m).mul(this.r2));\\\\n    return res._forceRed(this);\\\\n  };\\\\n})(typeof module === \'undefined\' || module, this);\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(31)(module)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/~/bn.js/lib/bn.js\\\\n// module id = 343\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/node_modules/bn.js/lib/bn.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar formatters = __webpack_require__(7).formatters;\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\n/**\\\\n * SolidityTypeAddress is a protoype that represents address type\\\\n * It matches:\\\\n * address\\\\n * address[]\\\\n * address[4]\\\\n * address[][]\\\\n * address[3][]\\\\n * address[][6][], ...\\\\n */\\\\nvar SolidityTypeAddress = function () {\\\\n    this._inputFormatter = function(){\\\\n        var args = Array.prototype.slice.call(arguments);\\\\n        args[0] = (!args[0] || args[0] === \'0x0\') ? \'\' : formatters.inputAddressFormatter(args[0]);\\\\n        return f.formatInputInt.apply(this, args);\\\\n    };\\\\n    this._outputFormatter = f.formatOutputAddress;\\\\n};\\\\n\\\\nSolidityTypeAddress.prototype = new SolidityType({});\\\\nSolidityTypeAddress.prototype.constructor = SolidityTypeAddress;\\\\n\\\\nSolidityTypeAddress.prototype.isType = function (name) {\\\\n    return !!name.match(/address(\\\\\\\\[([0-9]*)\\\\\\\\])?/);\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeAddress;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/address.js\\\\n// module id = 344\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/address.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\n/**\\\\n * SolidityTypeBool is a protoype that represents bool type\\\\n * It matches:\\\\n * bool\\\\n * bool[]\\\\n * bool[4]\\\\n * bool[][]\\\\n * bool[3][]\\\\n * bool[][6][], ...\\\\n */\\\\nvar SolidityTypeBool = function () {\\\\n    this._inputFormatter = f.formatInputBool;\\\\n    this._outputFormatter = f.formatOutputBool;\\\\n};\\\\n\\\\nSolidityTypeBool.prototype = new SolidityType({});\\\\nSolidityTypeBool.prototype.constructor = SolidityTypeBool;\\\\n\\\\nSolidityTypeBool.prototype.isType = function (name) {\\\\n    return !!name.match(/^bool(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeBool;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/bool.js\\\\n// module id = 345\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/bool.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\n/**\\\\n * SolidityTypeBytes is a prototype that represents the bytes type.\\\\n * It matches:\\\\n * bytes\\\\n * bytes[]\\\\n * bytes[4]\\\\n * bytes[][]\\\\n * bytes[3][]\\\\n * bytes[][6][], ...\\\\n * bytes32\\\\n * bytes8[4]\\\\n * bytes[3][]\\\\n */\\\\nvar SolidityTypeBytes = function () {\\\\n    this._inputFormatter = f.formatInputBytes;\\\\n    this._outputFormatter = f.formatOutputBytes;\\\\n};\\\\n\\\\nSolidityTypeBytes.prototype = new SolidityType({});\\\\nSolidityTypeBytes.prototype.constructor = SolidityTypeBytes;\\\\n\\\\nSolidityTypeBytes.prototype.isType = function (name) {\\\\n    return !!name.match(/^bytes([0-9]{1,})(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeBytes;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/bytes.js\\\\n// module id = 346\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/bytes.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\nvar SolidityTypeDynamicBytes = function () {\\\\n    this._inputFormatter = f.formatInputDynamicBytes;\\\\n    this._outputFormatter = f.formatOutputDynamicBytes;\\\\n};\\\\n\\\\nSolidityTypeDynamicBytes.prototype = new SolidityType({});\\\\nSolidityTypeDynamicBytes.prototype.constructor = SolidityTypeDynamicBytes;\\\\n\\\\nSolidityTypeDynamicBytes.prototype.isType = function (name) {\\\\n    return !!name.match(/^bytes(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nSolidityTypeDynamicBytes.prototype.isDynamicType = function () {\\\\n    return true;\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeDynamicBytes;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/dynamicbytes.js\\\\n// module id = 347\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/dynamicbytes.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\n/**\\\\n * SolidityTypeInt is a protoype that represents int type\\\\n * It matches:\\\\n * int\\\\n * int[]\\\\n * int[4]\\\\n * int[][]\\\\n * int[3][]\\\\n * int[][6][], ...\\\\n * int32\\\\n * int64[]\\\\n * int8[4]\\\\n * int256[][]\\\\n * int[3][]\\\\n * int64[][6][], ...\\\\n */\\\\nvar SolidityTypeInt = function () {\\\\n    this._inputFormatter = f.formatInputInt;\\\\n    this._outputFormatter = f.formatOutputInt;\\\\n};\\\\n\\\\nSolidityTypeInt.prototype = new SolidityType({});\\\\nSolidityTypeInt.prototype.constructor = SolidityTypeInt;\\\\n\\\\nSolidityTypeInt.prototype.isType = function (name) {\\\\n    return !!name.match(/^int([0-9]*)?(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeInt;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/int.js\\\\n// module id = 348\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/int.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\nvar SolidityTypeString = function () {\\\\n    this._inputFormatter = f.formatInputString;\\\\n    this._outputFormatter = f.formatOutputString;\\\\n};\\\\n\\\\nSolidityTypeString.prototype = new SolidityType({});\\\\nSolidityTypeString.prototype.constructor = SolidityTypeString;\\\\n\\\\nSolidityTypeString.prototype.isType = function (name) {\\\\n    return !!name.match(/^string(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nSolidityTypeString.prototype.isDynamicType = function () {\\\\n    return true;\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeString;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/string.js\\\\n// module id = 349\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/string.js\\")},function(module,exports,__webpack_require__){eval(\\"var f = __webpack_require__(15);\\\\nvar SolidityType = __webpack_require__(27);\\\\n\\\\n/**\\\\n * SolidityTypeUInt is a protoype that represents uint type\\\\n * It matches:\\\\n * uint\\\\n * uint[]\\\\n * uint[4]\\\\n * uint[][]\\\\n * uint[3][]\\\\n * uint[][6][], ...\\\\n * uint32\\\\n * uint64[]\\\\n * uint8[4]\\\\n * uint256[][]\\\\n * uint[3][]\\\\n * uint64[][6][], ...\\\\n */\\\\nvar SolidityTypeUInt = function () {\\\\n    this._inputFormatter = f.formatInputInt;\\\\n    this._outputFormatter = f.formatOutputUInt;\\\\n};\\\\n\\\\nSolidityTypeUInt.prototype = new SolidityType({});\\\\nSolidityTypeUInt.prototype.constructor = SolidityTypeUInt;\\\\n\\\\nSolidityTypeUInt.prototype.isType = function (name) {\\\\n    return !!name.match(/^uint([0-9]*)?(\\\\\\\\[([0-9]*)\\\\\\\\])*$/);\\\\n};\\\\n\\\\nmodule.exports = SolidityTypeUInt;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-abi/src/types/uint.js\\\\n// module id = 350\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-abi/src/types/uint.js\\")},function(module,exports,__webpack_require__){eval(\'/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/* @preserve\\\\n * The MIT License (MIT)\\\\n * \\\\n * Copyright (c) 2013-2015 Petka Antonov\\\\n * \\\\n * Permission is hereby granted, free of charge, to any person obtaining a copy\\\\n * of this software and associated documentation files (the \\"Software\\"), to deal\\\\n * in the Software without restriction, including without limitation the rights\\\\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\\\\n * copies of the Software, and to permit persons to whom the Software is\\\\n * furnished to do so, subject to the following conditions:\\\\n * \\\\n * The above copyright notice and this permission notice shall be included in\\\\n * all copies or substantial portions of the Software.\\\\n * \\\\n * THE SOFTWARE IS PROVIDED \\"AS IS\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\\\\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\\\\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\\\\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\\\\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\\\\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\\\\n * THE SOFTWARE.\\\\n * \\\\n */\\\\n/**\\\\n * bluebird build version 3.3.1\\\\n * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each\\\\n*/\\\\n!function(e){if(true)module.exports=e();else if(\\"function\\"==typeof define&&define.amd)define([],e);else{var f;\\"undefined\\"!=typeof window?f=window:\\"undefined\\"!=typeof global?f=global:\\"undefined\\"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_==\\"function\\"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\\"Cannot find module \\\\\'\\"+o+\\"\\\\\'\\");throw f.code=\\"MODULE_NOT_FOUND\\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_==\\"function\\"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar SomePromiseArray = Promise._SomePromiseArray;\\\\nfunction any(promises) {\\\\n    var ret = new SomePromiseArray(promises);\\\\n    var promise = ret.promise();\\\\n    ret.setHowMany(1);\\\\n    ret.setUnwrap();\\\\n    ret.init();\\\\n    return promise;\\\\n}\\\\n\\\\nPromise.any = function (promises) {\\\\n    return any(promises);\\\\n};\\\\n\\\\nPromise.prototype.any = function () {\\\\n    return any(this);\\\\n};\\\\n\\\\n};\\\\n\\\\n},{}],2:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar firstLineError;\\\\ntry {throw new Error(); } catch (e) {firstLineError = e;}\\\\nvar schedule = _dereq_(\\"./schedule\\");\\\\nvar Queue = _dereq_(\\"./queue\\");\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nfunction Async() {\\\\n    this._isTickUsed = false;\\\\n    this._lateQueue = new Queue(16);\\\\n    this._normalQueue = new Queue(16);\\\\n    this._haveDrainedQueues = false;\\\\n    this._trampolineEnabled = true;\\\\n    var self = this;\\\\n    this.drainQueues = function () {\\\\n        self._drainQueues();\\\\n    };\\\\n    this._schedule = schedule;\\\\n}\\\\n\\\\nAsync.prototype.enableTrampoline = function() {\\\\n    this._trampolineEnabled = true;\\\\n};\\\\n\\\\nAsync.prototype.disableTrampolineIfNecessary = function() {\\\\n    if (util.hasDevTools) {\\\\n        this._trampolineEnabled = false;\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype.haveItemsQueued = function () {\\\\n    return this._isTickUsed || this._haveDrainedQueues;\\\\n};\\\\n\\\\n\\\\nAsync.prototype.fatalError = function(e, isNode) {\\\\n    if (isNode) {\\\\n        process.stderr.write(\\"Fatal \\" + (e instanceof Error ? e.stack : e));\\\\n        process.exit(2);\\\\n    } else {\\\\n        this.throwLater(e);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype.throwLater = function(fn, arg) {\\\\n    if (arguments.length === 1) {\\\\n        arg = fn;\\\\n        fn = function () { throw arg; };\\\\n    }\\\\n    if (typeof setTimeout !== \\"undefined\\") {\\\\n        setTimeout(function() {\\\\n            fn(arg);\\\\n        }, 0);\\\\n    } else try {\\\\n        this._schedule(function() {\\\\n            fn(arg);\\\\n        });\\\\n    } catch (e) {\\\\n        throw new Error(\\"No async scheduler available\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n};\\\\n\\\\nfunction AsyncInvokeLater(fn, receiver, arg) {\\\\n    this._lateQueue.push(fn, receiver, arg);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nfunction AsyncInvoke(fn, receiver, arg) {\\\\n    this._normalQueue.push(fn, receiver, arg);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nfunction AsyncSettlePromises(promise) {\\\\n    this._normalQueue._pushOne(promise);\\\\n    this._queueTick();\\\\n}\\\\n\\\\nif (!util.hasDevTools) {\\\\n    Async.prototype.invokeLater = AsyncInvokeLater;\\\\n    Async.prototype.invoke = AsyncInvoke;\\\\n    Async.prototype.settlePromises = AsyncSettlePromises;\\\\n} else {\\\\n    Async.prototype.invokeLater = function (fn, receiver, arg) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncInvokeLater.call(this, fn, receiver, arg);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                setTimeout(function() {\\\\n                    fn.call(receiver, arg);\\\\n                }, 100);\\\\n            });\\\\n        }\\\\n    };\\\\n\\\\n    Async.prototype.invoke = function (fn, receiver, arg) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncInvoke.call(this, fn, receiver, arg);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                fn.call(receiver, arg);\\\\n            });\\\\n        }\\\\n    };\\\\n\\\\n    Async.prototype.settlePromises = function(promise) {\\\\n        if (this._trampolineEnabled) {\\\\n            AsyncSettlePromises.call(this, promise);\\\\n        } else {\\\\n            this._schedule(function() {\\\\n                promise._settlePromises();\\\\n            });\\\\n        }\\\\n    };\\\\n}\\\\n\\\\nAsync.prototype.invokeFirst = function (fn, receiver, arg) {\\\\n    this._normalQueue.unshift(fn, receiver, arg);\\\\n    this._queueTick();\\\\n};\\\\n\\\\nAsync.prototype._drainQueue = function(queue) {\\\\n    while (queue.length() > 0) {\\\\n        var fn = queue.shift();\\\\n        if (typeof fn !== \\"function\\") {\\\\n            fn._settlePromises();\\\\n            continue;\\\\n        }\\\\n        var receiver = queue.shift();\\\\n        var arg = queue.shift();\\\\n        fn.call(receiver, arg);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype._drainQueues = function () {\\\\n    this._drainQueue(this._normalQueue);\\\\n    this._reset();\\\\n    this._haveDrainedQueues = true;\\\\n    this._drainQueue(this._lateQueue);\\\\n};\\\\n\\\\nAsync.prototype._queueTick = function () {\\\\n    if (!this._isTickUsed) {\\\\n        this._isTickUsed = true;\\\\n        this._schedule(this.drainQueues);\\\\n    }\\\\n};\\\\n\\\\nAsync.prototype._reset = function () {\\\\n    this._isTickUsed = false;\\\\n};\\\\n\\\\nmodule.exports = Async;\\\\nmodule.exports.firstLineError = firstLineError;\\\\n\\\\n},{\\"./queue\\":26,\\"./schedule\\":29,\\"./util\\":36}],3:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {\\\\nvar calledBind = false;\\\\nvar rejectThis = function(_, e) {\\\\n    this._reject(e);\\\\n};\\\\n\\\\nvar targetRejected = function(e, context) {\\\\n    context.promiseRejectionQueued = true;\\\\n    context.bindingPromise._then(rejectThis, rejectThis, null, this, e);\\\\n};\\\\n\\\\nvar bindingResolved = function(thisArg, context) {\\\\n    if (((this._bitField & 50397184) === 0)) {\\\\n        this._resolveCallback(context.target);\\\\n    }\\\\n};\\\\n\\\\nvar bindingRejected = function(e, context) {\\\\n    if (!context.promiseRejectionQueued) this._reject(e);\\\\n};\\\\n\\\\nPromise.prototype.bind = function (thisArg) {\\\\n    if (!calledBind) {\\\\n        calledBind = true;\\\\n        Promise.prototype._propagateFrom = debug.propagateFromFunction();\\\\n        Promise.prototype._boundValue = debug.boundValueFunction();\\\\n    }\\\\n    var maybePromise = tryConvertToPromise(thisArg);\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._propagateFrom(this, 1);\\\\n    var target = this._target();\\\\n    ret._setBoundTo(maybePromise);\\\\n    if (maybePromise instanceof Promise) {\\\\n        var context = {\\\\n            promiseRejectionQueued: false,\\\\n            promise: ret,\\\\n            target: target,\\\\n            bindingPromise: maybePromise\\\\n        };\\\\n        target._then(INTERNAL, targetRejected, undefined, ret, context);\\\\n        maybePromise._then(\\\\n            bindingResolved, bindingRejected, undefined, ret, context);\\\\n        ret._setOnCancel(maybePromise);\\\\n    } else {\\\\n        ret._resolveCallback(target);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._setBoundTo = function (obj) {\\\\n    if (obj !== undefined) {\\\\n        this._bitField = this._bitField | 2097152;\\\\n        this._boundTo = obj;\\\\n    } else {\\\\n        this._bitField = this._bitField & (~2097152);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._isBound = function () {\\\\n    return (this._bitField & 2097152) === 2097152;\\\\n};\\\\n\\\\nPromise.bind = function (thisArg, value) {\\\\n    return Promise.resolve(value).bind(thisArg);\\\\n};\\\\n};\\\\n\\\\n},{}],4:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar old;\\\\nif (typeof Promise !== \\"undefined\\") old = Promise;\\\\nfunction noConflict() {\\\\n    try { if (Promise === bluebird) Promise = old; }\\\\n    catch (e) {}\\\\n    return bluebird;\\\\n}\\\\nvar bluebird = _dereq_(\\"./promise\\")();\\\\nbluebird.noConflict = noConflict;\\\\nmodule.exports = bluebird;\\\\n\\\\n},{\\"./promise\\":22}],5:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar cr = Object.create;\\\\nif (cr) {\\\\n    var callerCache = cr(null);\\\\n    var getterCache = cr(null);\\\\n    callerCache[\\" size\\"] = getterCache[\\" size\\"] = 0;\\\\n}\\\\n\\\\nmodule.exports = function(Promise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar isIdentifier = util.isIdentifier;\\\\n\\\\nvar getMethodCaller;\\\\nvar getGetter;\\\\nif (false) {\\\\nvar makeMethodCaller = function (methodName) {\\\\n    return new Function(\\"ensureMethod\\", \\"                                    \\\\\\\\n\\\\\\\\\\\\n        return function(obj) {                                               \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\'                                                     \\\\\\\\n\\\\\\\\\\\\n            var len = this.length;                                           \\\\\\\\n\\\\\\\\\\\\n            ensureMethod(obj, \\\\\'methodName\\\\\');                                 \\\\\\\\n\\\\\\\\\\\\n            switch(len) {                                                    \\\\\\\\n\\\\\\\\\\\\n                case 1: return obj.methodName(this[0]);                      \\\\\\\\n\\\\\\\\\\\\n                case 2: return obj.methodName(this[0], this[1]);             \\\\\\\\n\\\\\\\\\\\\n                case 3: return obj.methodName(this[0], this[1], this[2]);    \\\\\\\\n\\\\\\\\\\\\n                case 0: return obj.methodName();                             \\\\\\\\n\\\\\\\\\\\\n                default:                                                     \\\\\\\\n\\\\\\\\\\\\n                    return obj.methodName.apply(obj, this);                  \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n        };                                                                   \\\\\\\\n\\\\\\\\\\\\n        \\".replace(/methodName/g, methodName))(ensureMethod);\\\\n};\\\\n\\\\nvar makeGetter = function (propertyName) {\\\\n    return new Function(\\"obj\\", \\"                                             \\\\\\\\n\\\\\\\\\\\\n        \\\\\'use strict\\\\\';                                                        \\\\\\\\n\\\\\\\\\\\\n        return obj.propertyName;                                             \\\\\\\\n\\\\\\\\\\\\n        \\".replace(\\"propertyName\\", propertyName));\\\\n};\\\\n\\\\nvar getCompiled = function(name, compiler, cache) {\\\\n    var ret = cache[name];\\\\n    if (typeof ret !== \\"function\\") {\\\\n        if (!isIdentifier(name)) {\\\\n            return null;\\\\n        }\\\\n        ret = compiler(name);\\\\n        cache[name] = ret;\\\\n        cache[\\" size\\"]++;\\\\n        if (cache[\\" size\\"] > 512) {\\\\n            var keys = Object.keys(cache);\\\\n            for (var i = 0; i < 256; ++i) delete cache[keys[i]];\\\\n            cache[\\" size\\"] = keys.length - 256;\\\\n        }\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\ngetMethodCaller = function(name) {\\\\n    return getCompiled(name, makeMethodCaller, callerCache);\\\\n};\\\\n\\\\ngetGetter = function(name) {\\\\n    return getCompiled(name, makeGetter, getterCache);\\\\n};\\\\n}\\\\n\\\\nfunction ensureMethod(obj, methodName) {\\\\n    var fn;\\\\n    if (obj != null) fn = obj[methodName];\\\\n    if (typeof fn !== \\"function\\") {\\\\n        var message = \\"Object \\" + util.classString(obj) + \\" has no method \\\\\'\\" +\\\\n            util.toString(methodName) + \\"\\\\\'\\";\\\\n        throw new Promise.TypeError(message);\\\\n    }\\\\n    return fn;\\\\n}\\\\n\\\\nfunction caller(obj) {\\\\n    var methodName = this.pop();\\\\n    var fn = ensureMethod(obj, methodName);\\\\n    return fn.apply(obj, this);\\\\n}\\\\nPromise.prototype.call = function (methodName) {\\\\n    var args = [].slice.call(arguments, 1);;\\\\n    if (false) {\\\\n        if (canEvaluate) {\\\\n            var maybeCaller = getMethodCaller(methodName);\\\\n            if (maybeCaller !== null) {\\\\n                return this._then(\\\\n                    maybeCaller, undefined, undefined, args, undefined);\\\\n            }\\\\n        }\\\\n    }\\\\n    args.push(methodName);\\\\n    return this._then(caller, undefined, undefined, args, undefined);\\\\n};\\\\n\\\\nfunction namedGetter(obj) {\\\\n    return obj[this];\\\\n}\\\\nfunction indexedGetter(obj) {\\\\n    var index = +this;\\\\n    if (index < 0) index = Math.max(0, index + obj.length);\\\\n    return obj[index];\\\\n}\\\\nPromise.prototype.get = function (propertyName) {\\\\n    var isIndex = (typeof propertyName === \\"number\\");\\\\n    var getter;\\\\n    if (!isIndex) {\\\\n        if (canEvaluate) {\\\\n            var maybeGetter = getGetter(propertyName);\\\\n            getter = maybeGetter !== null ? maybeGetter : namedGetter;\\\\n        } else {\\\\n            getter = namedGetter;\\\\n        }\\\\n    } else {\\\\n        getter = indexedGetter;\\\\n    }\\\\n    return this._then(getter, undefined, undefined, propertyName, undefined);\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],6:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, PromiseArray, apiRejection, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar async = Promise._async;\\\\n\\\\nPromise.prototype[\\"break\\"] = Promise.prototype.cancel = function() {\\\\n    if (!debug.cancellation()) return this._warn(\\"cancellation is disabled\\");\\\\n\\\\n    var promise = this;\\\\n    var child = promise;\\\\n    while (promise.isCancellable()) {\\\\n        if (!promise._cancelBy(child)) {\\\\n            if (child._isFollowing()) {\\\\n                child._followee().cancel();\\\\n            } else {\\\\n                child._cancelBranched();\\\\n            }\\\\n            break;\\\\n        }\\\\n\\\\n        var parent = promise._cancellationParent;\\\\n        if (parent == null || !parent.isCancellable()) {\\\\n            if (promise._isFollowing()) {\\\\n                promise._followee().cancel();\\\\n            } else {\\\\n                promise._cancelBranched();\\\\n            }\\\\n            break;\\\\n        } else {\\\\n            if (promise._isFollowing()) promise._followee().cancel();\\\\n            child = promise;\\\\n            promise = parent;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._branchHasCancelled = function() {\\\\n    this._branchesRemainingToCancel--;\\\\n};\\\\n\\\\nPromise.prototype._enoughBranchesHaveCancelled = function() {\\\\n    return this._branchesRemainingToCancel === undefined ||\\\\n           this._branchesRemainingToCancel <= 0;\\\\n};\\\\n\\\\nPromise.prototype._cancelBy = function(canceller) {\\\\n    if (canceller === this) {\\\\n        this._branchesRemainingToCancel = 0;\\\\n        this._invokeOnCancel();\\\\n        return true;\\\\n    } else {\\\\n        this._branchHasCancelled();\\\\n        if (this._enoughBranchesHaveCancelled()) {\\\\n            this._invokeOnCancel();\\\\n            return true;\\\\n        }\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPromise.prototype._cancelBranched = function() {\\\\n    if (this._enoughBranchesHaveCancelled()) {\\\\n        this._cancel();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._cancel = function() {\\\\n    if (!this.isCancellable()) return;\\\\n\\\\n    this._setCancelled();\\\\n    async.invoke(this._cancelPromises, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype._cancelPromises = function() {\\\\n    if (this._length() > 0) this._settlePromises();\\\\n};\\\\n\\\\nPromise.prototype._unsetOnCancel = function() {\\\\n    this._onCancelField = undefined;\\\\n};\\\\n\\\\nPromise.prototype.isCancellable = function() {\\\\n    return this.isPending() && !this.isCancelled();\\\\n};\\\\n\\\\nPromise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {\\\\n    if (util.isArray(onCancelCallback)) {\\\\n        for (var i = 0; i < onCancelCallback.length; ++i) {\\\\n            this._doInvokeOnCancel(onCancelCallback[i], internalOnly);\\\\n        }\\\\n    } else if (onCancelCallback !== undefined) {\\\\n        if (typeof onCancelCallback === \\"function\\") {\\\\n            if (!internalOnly) {\\\\n                var e = tryCatch(onCancelCallback).call(this._boundValue());\\\\n                if (e === errorObj) {\\\\n                    this._attachExtraTrace(e.e);\\\\n                    async.throwLater(e.e);\\\\n                }\\\\n            }\\\\n        } else {\\\\n            onCancelCallback._resultCancelled(this);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._invokeOnCancel = function() {\\\\n    var onCancelCallback = this._onCancel();\\\\n    this._unsetOnCancel();\\\\n    async.invoke(this._doInvokeOnCancel, this, onCancelCallback);\\\\n};\\\\n\\\\nPromise.prototype._invokeInternalOnCancel = function() {\\\\n    if (this.isCancellable()) {\\\\n        this._doInvokeOnCancel(this._onCancel(), true);\\\\n        this._unsetOnCancel();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._resultCancelled = function() {\\\\n    this.cancel();\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],7:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(NEXT_FILTER) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar getKeys = _dereq_(\\"./es5\\").keys;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction catchFilter(instances, cb, promise) {\\\\n    return function(e) {\\\\n        var boundTo = promise._boundValue();\\\\n        predicateLoop: for (var i = 0; i < instances.length; ++i) {\\\\n            var item = instances[i];\\\\n\\\\n            if (item === Error ||\\\\n                (item != null && item.prototype instanceof Error)) {\\\\n                if (e instanceof item) {\\\\n                    return tryCatch(cb).call(boundTo, e);\\\\n                }\\\\n            } else if (typeof item === \\"function\\") {\\\\n                var matchesPredicate = tryCatch(item).call(boundTo, e);\\\\n                if (matchesPredicate === errorObj) {\\\\n                    return matchesPredicate;\\\\n                } else if (matchesPredicate) {\\\\n                    return tryCatch(cb).call(boundTo, e);\\\\n                }\\\\n            } else if (util.isObject(e)) {\\\\n                var keys = getKeys(item);\\\\n                for (var j = 0; j < keys.length; ++j) {\\\\n                    var key = keys[j];\\\\n                    if (item[key] != e[key]) {\\\\n                        continue predicateLoop;\\\\n                    }\\\\n                }\\\\n                return tryCatch(cb).call(boundTo, e);\\\\n            }\\\\n        }\\\\n        return NEXT_FILTER;\\\\n    };\\\\n}\\\\n\\\\nreturn catchFilter;\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],8:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar longStackTraces = false;\\\\nvar contextStack = [];\\\\n\\\\nPromise.prototype._promiseCreated = function() {};\\\\nPromise.prototype._pushContext = function() {};\\\\nPromise.prototype._popContext = function() {return null;};\\\\nPromise._peekContext = Promise.prototype._peekContext = function() {};\\\\n\\\\nfunction Context() {\\\\n    this._trace = new Context.CapturedTrace(peekContext());\\\\n}\\\\nContext.prototype._pushContext = function () {\\\\n    if (this._trace !== undefined) {\\\\n        this._trace._promiseCreated = null;\\\\n        contextStack.push(this._trace);\\\\n    }\\\\n};\\\\n\\\\nContext.prototype._popContext = function () {\\\\n    if (this._trace !== undefined) {\\\\n        var trace = contextStack.pop();\\\\n        var ret = trace._promiseCreated;\\\\n        trace._promiseCreated = null;\\\\n        return ret;\\\\n    }\\\\n    return null;\\\\n};\\\\n\\\\nfunction createContext() {\\\\n    if (longStackTraces) return new Context();\\\\n}\\\\n\\\\nfunction peekContext() {\\\\n    var lastIndex = contextStack.length - 1;\\\\n    if (lastIndex >= 0) {\\\\n        return contextStack[lastIndex];\\\\n    }\\\\n    return undefined;\\\\n}\\\\nContext.CapturedTrace = null;\\\\nContext.create = createContext;\\\\nContext.deactivateLongStackTraces = function() {};\\\\nContext.activateLongStackTraces = function() {\\\\n    var Promise_pushContext = Promise.prototype._pushContext;\\\\n    var Promise_popContext = Promise.prototype._popContext;\\\\n    var Promise_PeekContext = Promise._peekContext;\\\\n    var Promise_peekContext = Promise.prototype._peekContext;\\\\n    var Promise_promiseCreated = Promise.prototype._promiseCreated;\\\\n    Context.deactivateLongStackTraces = function() {\\\\n        Promise.prototype._pushContext = Promise_pushContext;\\\\n        Promise.prototype._popContext = Promise_popContext;\\\\n        Promise._peekContext = Promise_PeekContext;\\\\n        Promise.prototype._peekContext = Promise_peekContext;\\\\n        Promise.prototype._promiseCreated = Promise_promiseCreated;\\\\n        longStackTraces = false;\\\\n    };\\\\n    longStackTraces = true;\\\\n    Promise.prototype._pushContext = Context.prototype._pushContext;\\\\n    Promise.prototype._popContext = Context.prototype._popContext;\\\\n    Promise._peekContext = Promise.prototype._peekContext = peekContext;\\\\n    Promise.prototype._promiseCreated = function() {\\\\n        var ctx = this._peekContext();\\\\n        if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;\\\\n    };\\\\n};\\\\nreturn Context;\\\\n};\\\\n\\\\n},{}],9:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, Context) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar async = Promise._async;\\\\nvar Warning = _dereq_(\\"./errors\\").Warning;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canAttachTrace = util.canAttachTrace;\\\\nvar unhandledRejectionHandled;\\\\nvar possiblyUnhandledRejection;\\\\nvar bluebirdFramePattern =\\\\n    /[\\\\\\\\\\\\\\\\\\\\\\\\/]bluebird[\\\\\\\\\\\\\\\\\\\\\\\\/]js[\\\\\\\\\\\\\\\\\\\\\\\\/](release|debug|instrumented)/;\\\\nvar stackFramePattern = null;\\\\nvar formatStack = null;\\\\nvar indentStackFrames = false;\\\\nvar printWarning;\\\\nvar debugging = !!(util.env(\\"BLUEBIRD_DEBUG\\") != 0 &&\\\\n                        (true ||\\\\n                         util.env(\\"BLUEBIRD_DEBUG\\") ||\\\\n                         util.env(\\"NODE_ENV\\") === \\"development\\"));\\\\n\\\\nvar warnings = !!(util.env(\\"BLUEBIRD_WARNINGS\\") != 0 &&\\\\n    (debugging || util.env(\\"BLUEBIRD_WARNINGS\\")));\\\\n\\\\nvar longStackTraces = !!(util.env(\\"BLUEBIRD_LONG_STACK_TRACES\\") != 0 &&\\\\n    (debugging || util.env(\\"BLUEBIRD_LONG_STACK_TRACES\\")));\\\\n\\\\nvar wForgottenReturn = util.env(\\"BLUEBIRD_W_FORGOTTEN_RETURN\\") != 0 &&\\\\n    (warnings || !!util.env(\\"BLUEBIRD_W_FORGOTTEN_RETURN\\"));\\\\n\\\\nPromise.prototype.suppressUnhandledRejections = function() {\\\\n    var target = this._target();\\\\n    target._bitField = ((target._bitField & (~1048576)) |\\\\n                      524288);\\\\n};\\\\n\\\\nPromise.prototype._ensurePossibleRejectionHandled = function () {\\\\n    if ((this._bitField & 524288) !== 0) return;\\\\n    this._setRejectionIsUnhandled();\\\\n    async.invokeLater(this._notifyUnhandledRejection, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype._notifyUnhandledRejectionIsHandled = function () {\\\\n    fireRejectionEvent(\\"rejectionHandled\\",\\\\n                                  unhandledRejectionHandled, undefined, this);\\\\n};\\\\n\\\\nPromise.prototype._setReturnedNonUndefined = function() {\\\\n    this._bitField = this._bitField | 268435456;\\\\n};\\\\n\\\\nPromise.prototype._returnedNonUndefined = function() {\\\\n    return (this._bitField & 268435456) !== 0;\\\\n};\\\\n\\\\nPromise.prototype._notifyUnhandledRejection = function () {\\\\n    if (this._isRejectionUnhandled()) {\\\\n        var reason = this._settledValue();\\\\n        this._setUnhandledRejectionIsNotified();\\\\n        fireRejectionEvent(\\"unhandledRejection\\",\\\\n                                      possiblyUnhandledRejection, reason, this);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._setUnhandledRejectionIsNotified = function () {\\\\n    this._bitField = this._bitField | 262144;\\\\n};\\\\n\\\\nPromise.prototype._unsetUnhandledRejectionIsNotified = function () {\\\\n    this._bitField = this._bitField & (~262144);\\\\n};\\\\n\\\\nPromise.prototype._isUnhandledRejectionNotified = function () {\\\\n    return (this._bitField & 262144) > 0;\\\\n};\\\\n\\\\nPromise.prototype._setRejectionIsUnhandled = function () {\\\\n    this._bitField = this._bitField | 1048576;\\\\n};\\\\n\\\\nPromise.prototype._unsetRejectionIsUnhandled = function () {\\\\n    this._bitField = this._bitField & (~1048576);\\\\n    if (this._isUnhandledRejectionNotified()) {\\\\n        this._unsetUnhandledRejectionIsNotified();\\\\n        this._notifyUnhandledRejectionIsHandled();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._isRejectionUnhandled = function () {\\\\n    return (this._bitField & 1048576) > 0;\\\\n};\\\\n\\\\nPromise.prototype._warn = function(message, shouldUseOwnTrace, promise) {\\\\n    return warn(message, shouldUseOwnTrace, promise || this);\\\\n};\\\\n\\\\nPromise.onPossiblyUnhandledRejection = function (fn) {\\\\n    var domain = getDomain();\\\\n    possiblyUnhandledRejection =\\\\n        typeof fn === \\"function\\" ? (domain === null ? fn : domain.bind(fn))\\\\n                                 : undefined;\\\\n};\\\\n\\\\nPromise.onUnhandledRejectionHandled = function (fn) {\\\\n    var domain = getDomain();\\\\n    unhandledRejectionHandled =\\\\n        typeof fn === \\"function\\" ? (domain === null ? fn : domain.bind(fn))\\\\n                                 : undefined;\\\\n};\\\\n\\\\nvar disableLongStackTraces = function() {};\\\\nPromise.longStackTraces = function () {\\\\n    if (async.haveItemsQueued() && !config.longStackTraces) {\\\\n        throw new Error(\\"cannot enable long stack traces after promises have been created\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    if (!config.longStackTraces && longStackTracesIsSupported()) {\\\\n        var Promise_captureStackTrace = Promise.prototype._captureStackTrace;\\\\n        var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace;\\\\n        config.longStackTraces = true;\\\\n        disableLongStackTraces = function() {\\\\n            if (async.haveItemsQueued() && !config.longStackTraces) {\\\\n                throw new Error(\\"cannot enable long stack traces after promises have been created\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n            }\\\\n            Promise.prototype._captureStackTrace = Promise_captureStackTrace;\\\\n            Promise.prototype._attachExtraTrace = Promise_attachExtraTrace;\\\\n            Context.deactivateLongStackTraces();\\\\n            async.enableTrampoline();\\\\n            config.longStackTraces = false;\\\\n        };\\\\n        Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace;\\\\n        Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace;\\\\n        Context.activateLongStackTraces();\\\\n        async.disableTrampolineIfNecessary();\\\\n    }\\\\n};\\\\n\\\\nPromise.hasLongStackTraces = function () {\\\\n    return config.longStackTraces && longStackTracesIsSupported();\\\\n};\\\\n\\\\nvar fireDomEvent = (function() {\\\\n    try {\\\\n        var event = document.createEvent(\\"CustomEvent\\");\\\\n        event.initCustomEvent(\\"testingtheevent\\", false, true, {});\\\\n        util.global.dispatchEvent(event);\\\\n        return function(name, event) {\\\\n            var domEvent = document.createEvent(\\"CustomEvent\\");\\\\n            domEvent.initCustomEvent(name.toLowerCase(), false, true, event);\\\\n            return !util.global.dispatchEvent(domEvent);\\\\n        };\\\\n    } catch (e) {}\\\\n    return function() {\\\\n        return false;\\\\n    };\\\\n})();\\\\n\\\\nvar fireGlobalEvent = (function() {\\\\n    if (util.isNode) {\\\\n        return function() {\\\\n            return process.emit.apply(process, arguments);\\\\n        };\\\\n    } else {\\\\n        if (!util.global) {\\\\n            return function() {\\\\n                return false;\\\\n            };\\\\n        }\\\\n        return function(name) {\\\\n            var methodName = \\"on\\" + name.toLowerCase();\\\\n            var method = util.global[methodName];\\\\n            if (!method) return false;\\\\n            method.apply(util.global, [].slice.call(arguments, 1));\\\\n            return true;\\\\n        };\\\\n    }\\\\n})();\\\\n\\\\nfunction generatePromiseLifecycleEventObject(name, promise) {\\\\n    return {promise: promise};\\\\n}\\\\n\\\\nvar eventToObjectGenerator = {\\\\n    promiseCreated: generatePromiseLifecycleEventObject,\\\\n    promiseFulfilled: generatePromiseLifecycleEventObject,\\\\n    promiseRejected: generatePromiseLifecycleEventObject,\\\\n    promiseResolved: generatePromiseLifecycleEventObject,\\\\n    promiseCancelled: generatePromiseLifecycleEventObject,\\\\n    promiseChained: function(name, promise, child) {\\\\n        return {promise: promise, child: child};\\\\n    },\\\\n    warning: function(name, warning) {\\\\n        return {warning: warning};\\\\n    },\\\\n    unhandledRejection: function (name, reason, promise) {\\\\n        return {reason: reason, promise: promise};\\\\n    },\\\\n    rejectionHandled: generatePromiseLifecycleEventObject\\\\n};\\\\n\\\\nvar activeFireEvent = function (name) {\\\\n    var globalEventFired = false;\\\\n    try {\\\\n        globalEventFired = fireGlobalEvent.apply(null, arguments);\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n        globalEventFired = true;\\\\n    }\\\\n\\\\n    var domEventFired = false;\\\\n    try {\\\\n        domEventFired = fireDomEvent(name,\\\\n                    eventToObjectGenerator[name].apply(null, arguments));\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n        domEventFired = true;\\\\n    }\\\\n\\\\n    return domEventFired || globalEventFired;\\\\n};\\\\n\\\\nPromise.config = function(opts) {\\\\n    opts = Object(opts);\\\\n    if (\\"longStackTraces\\" in opts) {\\\\n        if (opts.longStackTraces) {\\\\n            Promise.longStackTraces();\\\\n        } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) {\\\\n            disableLongStackTraces();\\\\n        }\\\\n    }\\\\n    if (\\"warnings\\" in opts) {\\\\n        var warningsOption = opts.warnings;\\\\n        config.warnings = !!warningsOption;\\\\n        wForgottenReturn = config.warnings;\\\\n\\\\n        if (util.isObject(warningsOption)) {\\\\n            if (\\"wForgottenReturn\\" in warningsOption) {\\\\n                wForgottenReturn = !!warningsOption.wForgottenReturn;\\\\n            }\\\\n        }\\\\n    }\\\\n    if (\\"cancellation\\" in opts && opts.cancellation && !config.cancellation) {\\\\n        if (async.haveItemsQueued()) {\\\\n            throw new Error(\\\\n                \\"cannot enable cancellation after promises are in use\\");\\\\n        }\\\\n        Promise.prototype._clearCancellationData =\\\\n            cancellationClearCancellationData;\\\\n        Promise.prototype._propagateFrom = cancellationPropagateFrom;\\\\n        Promise.prototype._onCancel = cancellationOnCancel;\\\\n        Promise.prototype._setOnCancel = cancellationSetOnCancel;\\\\n        Promise.prototype._attachCancellationCallback =\\\\n            cancellationAttachCancellationCallback;\\\\n        Promise.prototype._execute = cancellationExecute;\\\\n        propagateFromFunction = cancellationPropagateFrom;\\\\n        config.cancellation = true;\\\\n    }\\\\n    if (\\"monitoring\\" in opts) {\\\\n        if (opts.monitoring && !config.monitoring) {\\\\n            config.monitoring = true;\\\\n            Promise.prototype._fireEvent = activeFireEvent;\\\\n        } else if (!opts.monitoring && config.monitoring) {\\\\n            config.monitoring = false;\\\\n            Promise.prototype._fireEvent = defaultFireEvent;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nfunction defaultFireEvent() { return false; }\\\\n\\\\nPromise.prototype._fireEvent = defaultFireEvent;\\\\nPromise.prototype._execute = function(executor, resolve, reject) {\\\\n    try {\\\\n        executor(resolve, reject);\\\\n    } catch (e) {\\\\n        return e;\\\\n    }\\\\n};\\\\nPromise.prototype._onCancel = function () {};\\\\nPromise.prototype._setOnCancel = function (handler) { ; };\\\\nPromise.prototype._attachCancellationCallback = function(onCancel) {\\\\n    ;\\\\n};\\\\nPromise.prototype._captureStackTrace = function () {};\\\\nPromise.prototype._attachExtraTrace = function () {};\\\\nPromise.prototype._clearCancellationData = function() {};\\\\nPromise.prototype._propagateFrom = function (parent, flags) {\\\\n    ;\\\\n    ;\\\\n};\\\\n\\\\nfunction cancellationExecute(executor, resolve, reject) {\\\\n    var promise = this;\\\\n    try {\\\\n        executor(resolve, reject, function(onCancel) {\\\\n            if (typeof onCancel !== \\"function\\") {\\\\n                throw new TypeError(\\"onCancel must be a function, got: \\" +\\\\n                                    util.toString(onCancel));\\\\n            }\\\\n            promise._attachCancellationCallback(onCancel);\\\\n        });\\\\n    } catch (e) {\\\\n        return e;\\\\n    }\\\\n}\\\\n\\\\nfunction cancellationAttachCancellationCallback(onCancel) {\\\\n    if (!this.isCancellable()) return this;\\\\n\\\\n    var previousOnCancel = this._onCancel();\\\\n    if (previousOnCancel !== undefined) {\\\\n        if (util.isArray(previousOnCancel)) {\\\\n            previousOnCancel.push(onCancel);\\\\n        } else {\\\\n            this._setOnCancel([previousOnCancel, onCancel]);\\\\n        }\\\\n    } else {\\\\n        this._setOnCancel(onCancel);\\\\n    }\\\\n}\\\\n\\\\nfunction cancellationOnCancel() {\\\\n    return this._onCancelField;\\\\n}\\\\n\\\\nfunction cancellationSetOnCancel(onCancel) {\\\\n    this._onCancelField = onCancel;\\\\n}\\\\n\\\\nfunction cancellationClearCancellationData() {\\\\n    this._cancellationParent = undefined;\\\\n    this._onCancelField = undefined;\\\\n}\\\\n\\\\nfunction cancellationPropagateFrom(parent, flags) {\\\\n    if ((flags & 1) !== 0) {\\\\n        this._cancellationParent = parent;\\\\n        var branchesRemainingToCancel = parent._branchesRemainingToCancel;\\\\n        if (branchesRemainingToCancel === undefined) {\\\\n            branchesRemainingToCancel = 0;\\\\n        }\\\\n        parent._branchesRemainingToCancel = branchesRemainingToCancel + 1;\\\\n    }\\\\n    if ((flags & 2) !== 0 && parent._isBound()) {\\\\n        this._setBoundTo(parent._boundTo);\\\\n    }\\\\n}\\\\n\\\\nfunction bindingPropagateFrom(parent, flags) {\\\\n    if ((flags & 2) !== 0 && parent._isBound()) {\\\\n        this._setBoundTo(parent._boundTo);\\\\n    }\\\\n}\\\\nvar propagateFromFunction = bindingPropagateFrom;\\\\n\\\\nfunction boundValueFunction() {\\\\n    var ret = this._boundTo;\\\\n    if (ret !== undefined) {\\\\n        if (ret instanceof Promise) {\\\\n            if (ret.isFulfilled()) {\\\\n                return ret.value();\\\\n            } else {\\\\n                return undefined;\\\\n            }\\\\n        }\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction longStackTracesCaptureStackTrace() {\\\\n    this._trace = new CapturedTrace(this._peekContext());\\\\n}\\\\n\\\\nfunction longStackTracesAttachExtraTrace(error, ignoreSelf) {\\\\n    if (canAttachTrace(error)) {\\\\n        var trace = this._trace;\\\\n        if (trace !== undefined) {\\\\n            if (ignoreSelf) trace = trace._parent;\\\\n        }\\\\n        if (trace !== undefined) {\\\\n            trace.attachExtraTrace(error);\\\\n        } else if (!error.__stackCleaned__) {\\\\n            var parsed = parseStackAndMessage(error);\\\\n            util.notEnumerableProp(error, \\"stack\\",\\\\n                parsed.message + \\"\\\\\\\\n\\" + parsed.stack.join(\\"\\\\\\\\n\\"));\\\\n            util.notEnumerableProp(error, \\"__stackCleaned__\\", true);\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction checkForgottenReturns(returnValue, promiseCreated, name, promise,\\\\n                               parent) {\\\\n    if (returnValue === undefined && promiseCreated !== null &&\\\\n        wForgottenReturn) {\\\\n        if (parent !== undefined && parent._returnedNonUndefined()) return;\\\\n\\\\n        if (name) name = name + \\" \\";\\\\n        var msg = \\"a promise was created in a \\" + name +\\\\n            \\"handler but was not returned from it\\";\\\\n        promise._warn(msg, true, promiseCreated);\\\\n    }\\\\n}\\\\n\\\\nfunction deprecated(name, replacement) {\\\\n    var message = name +\\\\n        \\" is deprecated and will be removed in a future version.\\";\\\\n    if (replacement) message += \\" Use \\" + replacement + \\" instead.\\";\\\\n    return warn(message);\\\\n}\\\\n\\\\nfunction warn(message, shouldUseOwnTrace, promise) {\\\\n    if (!config.warnings) return;\\\\n    var warning = new Warning(message);\\\\n    var ctx;\\\\n    if (shouldUseOwnTrace) {\\\\n        promise._attachExtraTrace(warning);\\\\n    } else if (config.longStackTraces && (ctx = Promise._peekContext())) {\\\\n        ctx.attachExtraTrace(warning);\\\\n    } else {\\\\n        var parsed = parseStackAndMessage(warning);\\\\n        warning.stack = parsed.message + \\"\\\\\\\\n\\" + parsed.stack.join(\\"\\\\\\\\n\\");\\\\n    }\\\\n\\\\n    if (!activeFireEvent(\\"warning\\", warning)) {\\\\n        formatAndLogError(warning, \\"\\", true);\\\\n    }\\\\n}\\\\n\\\\nfunction reconstructStack(message, stacks) {\\\\n    for (var i = 0; i < stacks.length - 1; ++i) {\\\\n        stacks[i].push(\\"From previous event:\\");\\\\n        stacks[i] = stacks[i].join(\\"\\\\\\\\n\\");\\\\n    }\\\\n    if (i < stacks.length) {\\\\n        stacks[i] = stacks[i].join(\\"\\\\\\\\n\\");\\\\n    }\\\\n    return message + \\"\\\\\\\\n\\" + stacks.join(\\"\\\\\\\\n\\");\\\\n}\\\\n\\\\nfunction removeDuplicateOrEmptyJumps(stacks) {\\\\n    for (var i = 0; i < stacks.length; ++i) {\\\\n        if (stacks[i].length === 0 ||\\\\n            ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) {\\\\n            stacks.splice(i, 1);\\\\n            i--;\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction removeCommonRoots(stacks) {\\\\n    var current = stacks[0];\\\\n    for (var i = 1; i < stacks.length; ++i) {\\\\n        var prev = stacks[i];\\\\n        var currentLastIndex = current.length - 1;\\\\n        var currentLastLine = current[currentLastIndex];\\\\n        var commonRootMeetPoint = -1;\\\\n\\\\n        for (var j = prev.length - 1; j >= 0; --j) {\\\\n            if (prev[j] === currentLastLine) {\\\\n                commonRootMeetPoint = j;\\\\n                break;\\\\n            }\\\\n        }\\\\n\\\\n        for (var j = commonRootMeetPoint; j >= 0; --j) {\\\\n            var line = prev[j];\\\\n            if (current[currentLastIndex] === line) {\\\\n                current.pop();\\\\n                currentLastIndex--;\\\\n            } else {\\\\n                break;\\\\n            }\\\\n        }\\\\n        current = prev;\\\\n    }\\\\n}\\\\n\\\\nfunction cleanStack(stack) {\\\\n    var ret = [];\\\\n    for (var i = 0; i < stack.length; ++i) {\\\\n        var line = stack[i];\\\\n        var isTraceLine = \\"    (No stack trace)\\" === line ||\\\\n            stackFramePattern.test(line);\\\\n        var isInternalFrame = isTraceLine && shouldIgnore(line);\\\\n        if (isTraceLine && !isInternalFrame) {\\\\n            if (indentStackFrames && line.charAt(0) !== \\" \\") {\\\\n                line = \\"    \\" + line;\\\\n            }\\\\n            ret.push(line);\\\\n        }\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction stackFramesAsArray(error) {\\\\n    var stack = error.stack.replace(/\\\\\\\\s+$/g, \\"\\").split(\\"\\\\\\\\n\\");\\\\n    for (var i = 0; i < stack.length; ++i) {\\\\n        var line = stack[i];\\\\n        if (\\"    (No stack trace)\\" === line || stackFramePattern.test(line)) {\\\\n            break;\\\\n        }\\\\n    }\\\\n    if (i > 0) {\\\\n        stack = stack.slice(i);\\\\n    }\\\\n    return stack;\\\\n}\\\\n\\\\nfunction parseStackAndMessage(error) {\\\\n    var stack = error.stack;\\\\n    var message = error.toString();\\\\n    stack = typeof stack === \\"string\\" && stack.length > 0\\\\n                ? stackFramesAsArray(error) : [\\"    (No stack trace)\\"];\\\\n    return {\\\\n        message: message,\\\\n        stack: cleanStack(stack)\\\\n    };\\\\n}\\\\n\\\\nfunction formatAndLogError(error, title, isSoft) {\\\\n    if (typeof console !== \\"undefined\\") {\\\\n        var message;\\\\n        if (util.isObject(error)) {\\\\n            var stack = error.stack;\\\\n            message = title + formatStack(stack, error);\\\\n        } else {\\\\n            message = title + String(error);\\\\n        }\\\\n        if (typeof printWarning === \\"function\\") {\\\\n            printWarning(message, isSoft);\\\\n        } else if (typeof console.log === \\"function\\" ||\\\\n            typeof console.log === \\"object\\") {\\\\n            console.log(message);\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction fireRejectionEvent(name, localHandler, reason, promise) {\\\\n    var localEventFired = false;\\\\n    try {\\\\n        if (typeof localHandler === \\"function\\") {\\\\n            localEventFired = true;\\\\n            if (name === \\"rejectionHandled\\") {\\\\n                localHandler(promise);\\\\n            } else {\\\\n                localHandler(reason, promise);\\\\n            }\\\\n        }\\\\n    } catch (e) {\\\\n        async.throwLater(e);\\\\n    }\\\\n\\\\n    if (name === \\"unhandledRejection\\") {\\\\n        if (!activeFireEvent(name, reason, promise) && !localEventFired) {\\\\n            formatAndLogError(reason, \\"Unhandled rejection \\");\\\\n        }\\\\n    } else {\\\\n        activeFireEvent(name, promise);\\\\n    }\\\\n}\\\\n\\\\nfunction formatNonError(obj) {\\\\n    var str;\\\\n    if (typeof obj === \\"function\\") {\\\\n        str = \\"[function \\" +\\\\n            (obj.name || \\"anonymous\\") +\\\\n            \\"]\\";\\\\n    } else {\\\\n        str = obj && typeof obj.toString === \\"function\\"\\\\n            ? obj.toString() : util.toString(obj);\\\\n        var ruselessToString = /\\\\\\\\[object [a-zA-Z0-9$_]+\\\\\\\\]/;\\\\n        if (ruselessToString.test(str)) {\\\\n            try {\\\\n                var newStr = JSON.stringify(obj);\\\\n                str = newStr;\\\\n            }\\\\n            catch(e) {\\\\n\\\\n            }\\\\n        }\\\\n        if (str.length === 0) {\\\\n            str = \\"(empty array)\\";\\\\n        }\\\\n    }\\\\n    return (\\"(<\\" + snip(str) + \\">, no stack trace)\\");\\\\n}\\\\n\\\\nfunction snip(str) {\\\\n    var maxChars = 41;\\\\n    if (str.length < maxChars) {\\\\n        return str;\\\\n    }\\\\n    return str.substr(0, maxChars - 3) + \\"...\\";\\\\n}\\\\n\\\\nfunction longStackTracesIsSupported() {\\\\n    return typeof captureStackTrace === \\"function\\";\\\\n}\\\\n\\\\nvar shouldIgnore = function() { return false; };\\\\nvar parseLineInfoRegex = /[\\\\\\\\/<\\\\\\\\(]([^:\\\\\\\\/]+):(\\\\\\\\d+):(?:\\\\\\\\d+)\\\\\\\\)?\\\\\\\\s*$/;\\\\nfunction parseLineInfo(line) {\\\\n    var matches = line.match(parseLineInfoRegex);\\\\n    if (matches) {\\\\n        return {\\\\n            fileName: matches[1],\\\\n            line: parseInt(matches[2], 10)\\\\n        };\\\\n    }\\\\n}\\\\n\\\\nfunction setBounds(firstLineError, lastLineError) {\\\\n    if (!longStackTracesIsSupported()) return;\\\\n    var firstStackLines = firstLineError.stack.split(\\"\\\\\\\\n\\");\\\\n    var lastStackLines = lastLineError.stack.split(\\"\\\\\\\\n\\");\\\\n    var firstIndex = -1;\\\\n    var lastIndex = -1;\\\\n    var firstFileName;\\\\n    var lastFileName;\\\\n    for (var i = 0; i < firstStackLines.length; ++i) {\\\\n        var result = parseLineInfo(firstStackLines[i]);\\\\n        if (result) {\\\\n            firstFileName = result.fileName;\\\\n            firstIndex = result.line;\\\\n            break;\\\\n        }\\\\n    }\\\\n    for (var i = 0; i < lastStackLines.length; ++i) {\\\\n        var result = parseLineInfo(lastStackLines[i]);\\\\n        if (result) {\\\\n            lastFileName = result.fileName;\\\\n            lastIndex = result.line;\\\\n            break;\\\\n        }\\\\n    }\\\\n    if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName ||\\\\n        firstFileName !== lastFileName || firstIndex >= lastIndex) {\\\\n        return;\\\\n    }\\\\n\\\\n    shouldIgnore = function(line) {\\\\n        if (bluebirdFramePattern.test(line)) return true;\\\\n        var info = parseLineInfo(line);\\\\n        if (info) {\\\\n            if (info.fileName === firstFileName &&\\\\n                (firstIndex <= info.line && info.line <= lastIndex)) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    };\\\\n}\\\\n\\\\nfunction CapturedTrace(parent) {\\\\n    this._parent = parent;\\\\n    this._promisesCreated = 0;\\\\n    var length = this._length = 1 + (parent === undefined ? 0 : parent._length);\\\\n    captureStackTrace(this, CapturedTrace);\\\\n    if (length > 32) this.uncycle();\\\\n}\\\\nutil.inherits(CapturedTrace, Error);\\\\nContext.CapturedTrace = CapturedTrace;\\\\n\\\\nCapturedTrace.prototype.uncycle = function() {\\\\n    var length = this._length;\\\\n    if (length < 2) return;\\\\n    var nodes = [];\\\\n    var stackToIndex = {};\\\\n\\\\n    for (var i = 0, node = this; node !== undefined; ++i) {\\\\n        nodes.push(node);\\\\n        node = node._parent;\\\\n    }\\\\n    length = this._length = i;\\\\n    for (var i = length - 1; i >= 0; --i) {\\\\n        var stack = nodes[i].stack;\\\\n        if (stackToIndex[stack] === undefined) {\\\\n            stackToIndex[stack] = i;\\\\n        }\\\\n    }\\\\n    for (var i = 0; i < length; ++i) {\\\\n        var currentStack = nodes[i].stack;\\\\n        var index = stackToIndex[currentStack];\\\\n        if (index !== undefined && index !== i) {\\\\n            if (index > 0) {\\\\n                nodes[index - 1]._parent = undefined;\\\\n                nodes[index - 1]._length = 1;\\\\n            }\\\\n            nodes[i]._parent = undefined;\\\\n            nodes[i]._length = 1;\\\\n            var cycleEdgeNode = i > 0 ? nodes[i - 1] : this;\\\\n\\\\n            if (index < length - 1) {\\\\n                cycleEdgeNode._parent = nodes[index + 1];\\\\n                cycleEdgeNode._parent.uncycle();\\\\n                cycleEdgeNode._length =\\\\n                    cycleEdgeNode._parent._length + 1;\\\\n            } else {\\\\n                cycleEdgeNode._parent = undefined;\\\\n                cycleEdgeNode._length = 1;\\\\n            }\\\\n            var currentChildLength = cycleEdgeNode._length + 1;\\\\n            for (var j = i - 2; j >= 0; --j) {\\\\n                nodes[j]._length = currentChildLength;\\\\n                currentChildLength++;\\\\n            }\\\\n            return;\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nCapturedTrace.prototype.attachExtraTrace = function(error) {\\\\n    if (error.__stackCleaned__) return;\\\\n    this.uncycle();\\\\n    var parsed = parseStackAndMessage(error);\\\\n    var message = parsed.message;\\\\n    var stacks = [parsed.stack];\\\\n\\\\n    var trace = this;\\\\n    while (trace !== undefined) {\\\\n        stacks.push(cleanStack(trace.stack.split(\\"\\\\\\\\n\\")));\\\\n        trace = trace._parent;\\\\n    }\\\\n    removeCommonRoots(stacks);\\\\n    removeDuplicateOrEmptyJumps(stacks);\\\\n    util.notEnumerableProp(error, \\"stack\\", reconstructStack(message, stacks));\\\\n    util.notEnumerableProp(error, \\"__stackCleaned__\\", true);\\\\n};\\\\n\\\\nvar captureStackTrace = (function stackDetection() {\\\\n    var v8stackFramePattern = /^\\\\\\\\s*at\\\\\\\\s*/;\\\\n    var v8stackFormatter = function(stack, error) {\\\\n        if (typeof stack === \\"string\\") return stack;\\\\n\\\\n        if (error.name !== undefined &&\\\\n            error.message !== undefined) {\\\\n            return error.toString();\\\\n        }\\\\n        return formatNonError(error);\\\\n    };\\\\n\\\\n    if (typeof Error.stackTraceLimit === \\"number\\" &&\\\\n        typeof Error.captureStackTrace === \\"function\\") {\\\\n        Error.stackTraceLimit += 6;\\\\n        stackFramePattern = v8stackFramePattern;\\\\n        formatStack = v8stackFormatter;\\\\n        var captureStackTrace = Error.captureStackTrace;\\\\n\\\\n        shouldIgnore = function(line) {\\\\n            return bluebirdFramePattern.test(line);\\\\n        };\\\\n        return function(receiver, ignoreUntil) {\\\\n            Error.stackTraceLimit += 6;\\\\n            captureStackTrace(receiver, ignoreUntil);\\\\n            Error.stackTraceLimit -= 6;\\\\n        };\\\\n    }\\\\n    var err = new Error();\\\\n\\\\n    if (typeof err.stack === \\"string\\" &&\\\\n        err.stack.split(\\"\\\\\\\\n\\")[0].indexOf(\\"stackDetection@\\") >= 0) {\\\\n        stackFramePattern = /@/;\\\\n        formatStack = v8stackFormatter;\\\\n        indentStackFrames = true;\\\\n        return function captureStackTrace(o) {\\\\n            o.stack = new Error().stack;\\\\n        };\\\\n    }\\\\n\\\\n    var hasStackAfterThrow;\\\\n    try { throw new Error(); }\\\\n    catch(e) {\\\\n        hasStackAfterThrow = (\\"stack\\" in e);\\\\n    }\\\\n    if (!(\\"stack\\" in err) && hasStackAfterThrow &&\\\\n        typeof Error.stackTraceLimit === \\"number\\") {\\\\n        stackFramePattern = v8stackFramePattern;\\\\n        formatStack = v8stackFormatter;\\\\n        return function captureStackTrace(o) {\\\\n            Error.stackTraceLimit += 6;\\\\n            try { throw new Error(); }\\\\n            catch(e) { o.stack = e.stack; }\\\\n            Error.stackTraceLimit -= 6;\\\\n        };\\\\n    }\\\\n\\\\n    formatStack = function(stack, error) {\\\\n        if (typeof stack === \\"string\\") return stack;\\\\n\\\\n        if ((typeof error === \\"object\\" ||\\\\n            typeof error === \\"function\\") &&\\\\n            error.name !== undefined &&\\\\n            error.message !== undefined) {\\\\n            return error.toString();\\\\n        }\\\\n        return formatNonError(error);\\\\n    };\\\\n\\\\n    return null;\\\\n\\\\n})([]);\\\\n\\\\nif (typeof console !== \\"undefined\\" && typeof console.warn !== \\"undefined\\") {\\\\n    printWarning = function (message) {\\\\n        console.warn(message);\\\\n    };\\\\n    if (util.isNode && process.stderr.isTTY) {\\\\n        printWarning = function(message, isSoft) {\\\\n            var color = isSoft ? \\"\\\\\\\\u001b[33m\\" : \\"\\\\\\\\u001b[31m\\";\\\\n            console.warn(color + message + \\"\\\\\\\\u001b[0m\\\\\\\\n\\");\\\\n        };\\\\n    } else if (!util.isNode && typeof (new Error().stack) === \\"string\\") {\\\\n        printWarning = function(message, isSoft) {\\\\n            console.warn(\\"%c\\" + message,\\\\n                        isSoft ? \\"color: darkorange\\" : \\"color: red\\");\\\\n        };\\\\n    }\\\\n}\\\\n\\\\nvar config = {\\\\n    warnings: warnings,\\\\n    longStackTraces: false,\\\\n    cancellation: false,\\\\n    monitoring: false\\\\n};\\\\n\\\\nif (longStackTraces) Promise.longStackTraces();\\\\n\\\\nreturn {\\\\n    longStackTraces: function() {\\\\n        return config.longStackTraces;\\\\n    },\\\\n    warnings: function() {\\\\n        return config.warnings;\\\\n    },\\\\n    cancellation: function() {\\\\n        return config.cancellation;\\\\n    },\\\\n    monitoring: function() {\\\\n        return config.monitoring;\\\\n    },\\\\n    propagateFromFunction: function() {\\\\n        return propagateFromFunction;\\\\n    },\\\\n    boundValueFunction: function() {\\\\n        return boundValueFunction;\\\\n    },\\\\n    checkForgottenReturns: checkForgottenReturns,\\\\n    setBounds: setBounds,\\\\n    warn: warn,\\\\n    deprecated: deprecated,\\\\n    CapturedTrace: CapturedTrace,\\\\n    fireDomEvent: fireDomEvent,\\\\n    fireGlobalEvent: fireGlobalEvent\\\\n};\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],10:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nfunction returner() {\\\\n    return this.value;\\\\n}\\\\nfunction thrower() {\\\\n    throw this.reason;\\\\n}\\\\n\\\\nPromise.prototype[\\"return\\"] =\\\\nPromise.prototype.thenReturn = function (value) {\\\\n    if (value instanceof Promise) value.suppressUnhandledRejections();\\\\n    return this._then(\\\\n        returner, undefined, undefined, {value: value}, undefined);\\\\n};\\\\n\\\\nPromise.prototype[\\"throw\\"] =\\\\nPromise.prototype.thenThrow = function (reason) {\\\\n    return this._then(\\\\n        thrower, undefined, undefined, {reason: reason}, undefined);\\\\n};\\\\n\\\\nPromise.prototype.catchThrow = function (reason) {\\\\n    if (arguments.length <= 1) {\\\\n        return this._then(\\\\n            undefined, thrower, undefined, {reason: reason}, undefined);\\\\n    } else {\\\\n        var _reason = arguments[1];\\\\n        var handler = function() {throw _reason;};\\\\n        return this.caught(reason, handler);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype.catchReturn = function (value) {\\\\n    if (arguments.length <= 1) {\\\\n        if (value instanceof Promise) value.suppressUnhandledRejections();\\\\n        return this._then(\\\\n            undefined, returner, undefined, {value: value}, undefined);\\\\n    } else {\\\\n        var _value = arguments[1];\\\\n        if (_value instanceof Promise) _value.suppressUnhandledRejections();\\\\n        var handler = function() {return _value;};\\\\n        return this.caught(value, handler);\\\\n    }\\\\n};\\\\n};\\\\n\\\\n},{}],11:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar PromiseReduce = Promise.reduce;\\\\nvar PromiseAll = Promise.all;\\\\n\\\\nfunction promiseAllThis() {\\\\n    return PromiseAll(this);\\\\n}\\\\n\\\\nfunction PromiseMapSeries(promises, fn) {\\\\n    return PromiseReduce(promises, fn, INTERNAL, INTERNAL);\\\\n}\\\\n\\\\nPromise.prototype.each = function (fn) {\\\\n    return this.mapSeries(fn)\\\\n            ._then(promiseAllThis, undefined, undefined, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype.mapSeries = function (fn) {\\\\n    return PromiseReduce(this, fn, INTERNAL, INTERNAL);\\\\n};\\\\n\\\\nPromise.each = function (promises, fn) {\\\\n    return PromiseMapSeries(promises, fn)\\\\n            ._then(promiseAllThis, undefined, undefined, promises, undefined);\\\\n};\\\\n\\\\nPromise.mapSeries = PromiseMapSeries;\\\\n};\\\\n\\\\n},{}],12:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Objectfreeze = es5.freeze;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar inherits = util.inherits;\\\\nvar notEnumerableProp = util.notEnumerableProp;\\\\n\\\\nfunction subError(nameProperty, defaultMessage) {\\\\n    function SubError(message) {\\\\n        if (!(this instanceof SubError)) return new SubError(message);\\\\n        notEnumerableProp(this, \\"message\\",\\\\n            typeof message === \\"string\\" ? message : defaultMessage);\\\\n        notEnumerableProp(this, \\"name\\", nameProperty);\\\\n        if (Error.captureStackTrace) {\\\\n            Error.captureStackTrace(this, this.constructor);\\\\n        } else {\\\\n            Error.call(this);\\\\n        }\\\\n    }\\\\n    inherits(SubError, Error);\\\\n    return SubError;\\\\n}\\\\n\\\\nvar _TypeError, _RangeError;\\\\nvar Warning = subError(\\"Warning\\", \\"warning\\");\\\\nvar CancellationError = subError(\\"CancellationError\\", \\"cancellation error\\");\\\\nvar TimeoutError = subError(\\"TimeoutError\\", \\"timeout error\\");\\\\nvar AggregateError = subError(\\"AggregateError\\", \\"aggregate error\\");\\\\ntry {\\\\n    _TypeError = TypeError;\\\\n    _RangeError = RangeError;\\\\n} catch(e) {\\\\n    _TypeError = subError(\\"TypeError\\", \\"type error\\");\\\\n    _RangeError = subError(\\"RangeError\\", \\"range error\\");\\\\n}\\\\n\\\\nvar methods = (\\"join pop push shift unshift slice filter forEach some \\" +\\\\n    \\"every map indexOf lastIndexOf reduce reduceRight sort reverse\\").split(\\" \\");\\\\n\\\\nfor (var i = 0; i < methods.length; ++i) {\\\\n    if (typeof Array.prototype[methods[i]] === \\"function\\") {\\\\n        AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];\\\\n    }\\\\n}\\\\n\\\\nes5.defineProperty(AggregateError.prototype, \\"length\\", {\\\\n    value: 0,\\\\n    configurable: false,\\\\n    writable: true,\\\\n    enumerable: true\\\\n});\\\\nAggregateError.prototype[\\"isOperational\\"] = true;\\\\nvar level = 0;\\\\nAggregateError.prototype.toString = function() {\\\\n    var indent = Array(level * 4 + 1).join(\\" \\");\\\\n    var ret = \\"\\\\\\\\n\\" + indent + \\"AggregateError of:\\" + \\"\\\\\\\\n\\";\\\\n    level++;\\\\n    indent = Array(level * 4 + 1).join(\\" \\");\\\\n    for (var i = 0; i < this.length; ++i) {\\\\n        var str = this[i] === this ? \\"[Circular AggregateError]\\" : this[i] + \\"\\";\\\\n        var lines = str.split(\\"\\\\\\\\n\\");\\\\n        for (var j = 0; j < lines.length; ++j) {\\\\n            lines[j] = indent + lines[j];\\\\n        }\\\\n        str = lines.join(\\"\\\\\\\\n\\");\\\\n        ret += str + \\"\\\\\\\\n\\";\\\\n    }\\\\n    level--;\\\\n    return ret;\\\\n};\\\\n\\\\nfunction OperationalError(message) {\\\\n    if (!(this instanceof OperationalError))\\\\n        return new OperationalError(message);\\\\n    notEnumerableProp(this, \\"name\\", \\"OperationalError\\");\\\\n    notEnumerableProp(this, \\"message\\", message);\\\\n    this.cause = message;\\\\n    this[\\"isOperational\\"] = true;\\\\n\\\\n    if (message instanceof Error) {\\\\n        notEnumerableProp(this, \\"message\\", message.message);\\\\n        notEnumerableProp(this, \\"stack\\", message.stack);\\\\n    } else if (Error.captureStackTrace) {\\\\n        Error.captureStackTrace(this, this.constructor);\\\\n    }\\\\n\\\\n}\\\\ninherits(OperationalError, Error);\\\\n\\\\nvar errorTypes = Error[\\"__BluebirdErrorTypes__\\"];\\\\nif (!errorTypes) {\\\\n    errorTypes = Objectfreeze({\\\\n        CancellationError: CancellationError,\\\\n        TimeoutError: TimeoutError,\\\\n        OperationalError: OperationalError,\\\\n        RejectionError: OperationalError,\\\\n        AggregateError: AggregateError\\\\n    });\\\\n    es5.defineProperty(Error, \\"__BluebirdErrorTypes__\\", {\\\\n        value: errorTypes,\\\\n        writable: false,\\\\n        enumerable: false,\\\\n        configurable: false\\\\n    });\\\\n}\\\\n\\\\nmodule.exports = {\\\\n    Error: Error,\\\\n    TypeError: _TypeError,\\\\n    RangeError: _RangeError,\\\\n    CancellationError: errorTypes.CancellationError,\\\\n    OperationalError: errorTypes.OperationalError,\\\\n    TimeoutError: errorTypes.TimeoutError,\\\\n    AggregateError: errorTypes.AggregateError,\\\\n    Warning: Warning\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],13:[function(_dereq_,module,exports){\\\\nvar isES5 = (function(){\\\\n    \\"use strict\\";\\\\n    return this === undefined;\\\\n})();\\\\n\\\\nif (isES5) {\\\\n    module.exports = {\\\\n        freeze: Object.freeze,\\\\n        defineProperty: Object.defineProperty,\\\\n        getDescriptor: Object.getOwnPropertyDescriptor,\\\\n        keys: Object.keys,\\\\n        names: Object.getOwnPropertyNames,\\\\n        getPrototypeOf: Object.getPrototypeOf,\\\\n        isArray: Array.isArray,\\\\n        isES5: isES5,\\\\n        propertyIsWritable: function(obj, prop) {\\\\n            var descriptor = Object.getOwnPropertyDescriptor(obj, prop);\\\\n            return !!(!descriptor || descriptor.writable || descriptor.set);\\\\n        }\\\\n    };\\\\n} else {\\\\n    var has = {}.hasOwnProperty;\\\\n    var str = {}.toString;\\\\n    var proto = {}.constructor.prototype;\\\\n\\\\n    var ObjectKeys = function (o) {\\\\n        var ret = [];\\\\n        for (var key in o) {\\\\n            if (has.call(o, key)) {\\\\n                ret.push(key);\\\\n            }\\\\n        }\\\\n        return ret;\\\\n    };\\\\n\\\\n    var ObjectGetDescriptor = function(o, key) {\\\\n        return {value: o[key]};\\\\n    };\\\\n\\\\n    var ObjectDefineProperty = function (o, key, desc) {\\\\n        o[key] = desc.value;\\\\n        return o;\\\\n    };\\\\n\\\\n    var ObjectFreeze = function (obj) {\\\\n        return obj;\\\\n    };\\\\n\\\\n    var ObjectGetPrototypeOf = function (obj) {\\\\n        try {\\\\n            return Object(obj).constructor.prototype;\\\\n        }\\\\n        catch (e) {\\\\n            return proto;\\\\n        }\\\\n    };\\\\n\\\\n    var ArrayIsArray = function (obj) {\\\\n        try {\\\\n            return str.call(obj) === \\"[object Array]\\";\\\\n        }\\\\n        catch(e) {\\\\n            return false;\\\\n        }\\\\n    };\\\\n\\\\n    module.exports = {\\\\n        isArray: ArrayIsArray,\\\\n        keys: ObjectKeys,\\\\n        names: ObjectKeys,\\\\n        defineProperty: ObjectDefineProperty,\\\\n        getDescriptor: ObjectGetDescriptor,\\\\n        freeze: ObjectFreeze,\\\\n        getPrototypeOf: ObjectGetPrototypeOf,\\\\n        isES5: isES5,\\\\n        propertyIsWritable: function() {\\\\n            return true;\\\\n        }\\\\n    };\\\\n}\\\\n\\\\n},{}],14:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar PromiseMap = Promise.map;\\\\n\\\\nPromise.prototype.filter = function (fn, options) {\\\\n    return PromiseMap(this, fn, options, INTERNAL);\\\\n};\\\\n\\\\nPromise.filter = function (promises, fn, options) {\\\\n    return PromiseMap(promises, fn, options, INTERNAL);\\\\n};\\\\n};\\\\n\\\\n},{}],15:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, tryConvertToPromise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar CancellationError = Promise.CancellationError;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction PassThroughHandlerContext(promise, type, handler) {\\\\n    this.promise = promise;\\\\n    this.type = type;\\\\n    this.handler = handler;\\\\n    this.called = false;\\\\n    this.cancelPromise = null;\\\\n}\\\\n\\\\nPassThroughHandlerContext.prototype.isFinallyHandler = function() {\\\\n    return this.type === 0;\\\\n};\\\\n\\\\nfunction FinallyHandlerCancelReaction(finallyHandler) {\\\\n    this.finallyHandler = finallyHandler;\\\\n}\\\\n\\\\nFinallyHandlerCancelReaction.prototype._resultCancelled = function() {\\\\n    checkCancel(this.finallyHandler);\\\\n};\\\\n\\\\nfunction checkCancel(ctx, reason) {\\\\n    if (ctx.cancelPromise != null) {\\\\n        if (arguments.length > 1) {\\\\n            ctx.cancelPromise._reject(reason);\\\\n        } else {\\\\n            ctx.cancelPromise._cancel();\\\\n        }\\\\n        ctx.cancelPromise = null;\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n}\\\\n\\\\nfunction succeed() {\\\\n    return finallyHandler.call(this, this.promise._target()._settledValue());\\\\n}\\\\nfunction fail(reason) {\\\\n    if (checkCancel(this, reason)) return;\\\\n    errorObj.e = reason;\\\\n    return errorObj;\\\\n}\\\\nfunction finallyHandler(reasonOrValue) {\\\\n    var promise = this.promise;\\\\n    var handler = this.handler;\\\\n\\\\n    if (!this.called) {\\\\n        this.called = true;\\\\n        var ret = this.isFinallyHandler()\\\\n            ? handler.call(promise._boundValue())\\\\n            : handler.call(promise._boundValue(), reasonOrValue);\\\\n        if (ret !== undefined) {\\\\n            promise._setReturnedNonUndefined();\\\\n            var maybePromise = tryConvertToPromise(ret, promise);\\\\n            if (maybePromise instanceof Promise) {\\\\n                if (this.cancelPromise != null) {\\\\n                    if (maybePromise.isCancelled()) {\\\\n                        var reason =\\\\n                            new CancellationError(\\"late cancellation observer\\");\\\\n                        promise._attachExtraTrace(reason);\\\\n                        errorObj.e = reason;\\\\n                        return errorObj;\\\\n                    } else if (maybePromise.isPending()) {\\\\n                        maybePromise._attachCancellationCallback(\\\\n                            new FinallyHandlerCancelReaction(this));\\\\n                    }\\\\n                }\\\\n                return maybePromise._then(\\\\n                    succeed, fail, undefined, this, undefined);\\\\n            }\\\\n        }\\\\n    }\\\\n\\\\n    if (promise.isRejected()) {\\\\n        checkCancel(this);\\\\n        errorObj.e = reasonOrValue;\\\\n        return errorObj;\\\\n    } else {\\\\n        checkCancel(this);\\\\n        return reasonOrValue;\\\\n    }\\\\n}\\\\n\\\\nPromise.prototype._passThrough = function(handler, type, success, fail) {\\\\n    if (typeof handler !== \\"function\\") return this.then();\\\\n    return this._then(success,\\\\n                      fail,\\\\n                      undefined,\\\\n                      new PassThroughHandlerContext(this, type, handler),\\\\n                      undefined);\\\\n};\\\\n\\\\nPromise.prototype.lastly =\\\\nPromise.prototype[\\"finally\\"] = function (handler) {\\\\n    return this._passThrough(handler,\\\\n                             0,\\\\n                             finallyHandler,\\\\n                             finallyHandler);\\\\n};\\\\n\\\\nPromise.prototype.tap = function (handler) {\\\\n    return this._passThrough(handler, 1, finallyHandler);\\\\n};\\\\n\\\\nreturn PassThroughHandlerContext;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],16:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          apiRejection,\\\\n                          INTERNAL,\\\\n                          tryConvertToPromise,\\\\n                          Proxyable,\\\\n                          debug) {\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar TypeError = errors.TypeError;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar errorObj = util.errorObj;\\\\nvar tryCatch = util.tryCatch;\\\\nvar yieldHandlers = [];\\\\n\\\\nfunction promiseFromYieldHandler(value, yieldHandlers, traceParent) {\\\\n    for (var i = 0; i < yieldHandlers.length; ++i) {\\\\n        traceParent._pushContext();\\\\n        var result = tryCatch(yieldHandlers[i])(value);\\\\n        traceParent._popContext();\\\\n        if (result === errorObj) {\\\\n            traceParent._pushContext();\\\\n            var ret = Promise.reject(errorObj.e);\\\\n            traceParent._popContext();\\\\n            return ret;\\\\n        }\\\\n        var maybePromise = tryConvertToPromise(result, traceParent);\\\\n        if (maybePromise instanceof Promise) return maybePromise;\\\\n    }\\\\n    return null;\\\\n}\\\\n\\\\nfunction PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) {\\\\n    var promise = this._promise = new Promise(INTERNAL);\\\\n    promise._captureStackTrace();\\\\n    promise._setOnCancel(this);\\\\n    this._stack = stack;\\\\n    this._generatorFunction = generatorFunction;\\\\n    this._receiver = receiver;\\\\n    this._generator = undefined;\\\\n    this._yieldHandlers = typeof yieldHandler === \\"function\\"\\\\n        ? [yieldHandler].concat(yieldHandlers)\\\\n        : yieldHandlers;\\\\n    this._yieldedPromise = null;\\\\n}\\\\nutil.inherits(PromiseSpawn, Proxyable);\\\\n\\\\nPromiseSpawn.prototype._isResolved = function() {\\\\n    return this._promise === null;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._cleanup = function() {\\\\n    this._promise = this._generator = null;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseCancelled = function() {\\\\n    if (this._isResolved()) return;\\\\n    var implementsReturn = typeof this._generator[\\"return\\"] !== \\"undefined\\";\\\\n\\\\n    var result;\\\\n    if (!implementsReturn) {\\\\n        var reason = new Promise.CancellationError(\\\\n            \\"generator .return() sentinel\\");\\\\n        Promise.coroutine.returnSentinel = reason;\\\\n        this._promise._attachExtraTrace(reason);\\\\n        this._promise._pushContext();\\\\n        result = tryCatch(this._generator[\\"throw\\"]).call(this._generator,\\\\n                                                         reason);\\\\n        this._promise._popContext();\\\\n        if (result === errorObj && result.e === reason) {\\\\n            result = null;\\\\n        }\\\\n    } else {\\\\n        this._promise._pushContext();\\\\n        result = tryCatch(this._generator[\\"return\\"]).call(this._generator,\\\\n                                                          undefined);\\\\n        this._promise._popContext();\\\\n    }\\\\n    var promise = this._promise;\\\\n    this._cleanup();\\\\n    if (result === errorObj) {\\\\n        promise._rejectCallback(result.e, false);\\\\n    } else {\\\\n        promise.cancel();\\\\n    }\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseFulfilled = function(value) {\\\\n    this._yieldedPromise = null;\\\\n    this._promise._pushContext();\\\\n    var result = tryCatch(this._generator.next).call(this._generator, value);\\\\n    this._promise._popContext();\\\\n    this._continue(result);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._promiseRejected = function(reason) {\\\\n    this._yieldedPromise = null;\\\\n    this._promise._attachExtraTrace(reason);\\\\n    this._promise._pushContext();\\\\n    var result = tryCatch(this._generator[\\"throw\\"])\\\\n        .call(this._generator, reason);\\\\n    this._promise._popContext();\\\\n    this._continue(result);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._resultCancelled = function() {\\\\n    if (this._yieldedPromise instanceof Promise) {\\\\n        var promise = this._yieldedPromise;\\\\n        this._yieldedPromise = null;\\\\n        promise.cancel();\\\\n    }\\\\n};\\\\n\\\\nPromiseSpawn.prototype.promise = function () {\\\\n    return this._promise;\\\\n};\\\\n\\\\nPromiseSpawn.prototype._run = function () {\\\\n    this._generator = this._generatorFunction.call(this._receiver);\\\\n    this._receiver =\\\\n        this._generatorFunction = undefined;\\\\n    this._promiseFulfilled(undefined);\\\\n};\\\\n\\\\nPromiseSpawn.prototype._continue = function (result) {\\\\n    var promise = this._promise;\\\\n    if (result === errorObj) {\\\\n        this._cleanup();\\\\n        return promise._rejectCallback(result.e, false);\\\\n    }\\\\n\\\\n    var value = result.value;\\\\n    if (result.done === true) {\\\\n        this._cleanup();\\\\n        return promise._resolveCallback(value);\\\\n    } else {\\\\n        var maybePromise = tryConvertToPromise(value, this._promise);\\\\n        if (!(maybePromise instanceof Promise)) {\\\\n            maybePromise =\\\\n                promiseFromYieldHandler(maybePromise,\\\\n                                        this._yieldHandlers,\\\\n                                        this._promise);\\\\n            if (maybePromise === null) {\\\\n                this._promiseRejected(\\\\n                    new TypeError(\\\\n                        \\"A value %s was yielded that could not be treated as a promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\\\\\\\u000a\\".replace(\\"%s\\", value) +\\\\n                        \\"From coroutine:\\\\\\\\u000a\\" +\\\\n                        this._stack.split(\\"\\\\\\\\n\\").slice(1, -7).join(\\"\\\\\\\\n\\")\\\\n                    )\\\\n                );\\\\n                return;\\\\n            }\\\\n        }\\\\n        maybePromise = maybePromise._target();\\\\n        var bitField = maybePromise._bitField;\\\\n        ;\\\\n        if (((bitField & 50397184) === 0)) {\\\\n            this._yieldedPromise = maybePromise;\\\\n            maybePromise._proxy(this, null);\\\\n        } else if (((bitField & 33554432) !== 0)) {\\\\n            this._promiseFulfilled(maybePromise._value());\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            this._promiseRejected(maybePromise._reason());\\\\n        } else {\\\\n            this._promiseCancelled();\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.coroutine = function (generatorFunction, options) {\\\\n    if (typeof generatorFunction !== \\"function\\") {\\\\n        throw new TypeError(\\"generatorFunction must be a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var yieldHandler = Object(options).yieldHandler;\\\\n    var PromiseSpawn$ = PromiseSpawn;\\\\n    var stack = new Error().stack;\\\\n    return function () {\\\\n        var generator = generatorFunction.apply(this, arguments);\\\\n        var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler,\\\\n                                      stack);\\\\n        var ret = spawn.promise();\\\\n        spawn._generator = generator;\\\\n        spawn._promiseFulfilled(undefined);\\\\n        return ret;\\\\n    };\\\\n};\\\\n\\\\nPromise.coroutine.addYieldHandler = function(fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    yieldHandlers.push(fn);\\\\n};\\\\n\\\\nPromise.spawn = function (generatorFunction) {\\\\n    debug.deprecated(\\"Promise.spawn()\\", \\"Promise.coroutine()\\");\\\\n    if (typeof generatorFunction !== \\"function\\") {\\\\n        return apiRejection(\\"generatorFunction must be a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var spawn = new PromiseSpawn(generatorFunction, this);\\\\n    var ret = spawn.promise();\\\\n    spawn._run(Promise.spawn);\\\\n    return ret;\\\\n};\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],17:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, PromiseArray, tryConvertToPromise, INTERNAL) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar reject;\\\\n\\\\nif (false) {\\\\nif (canEvaluate) {\\\\n    var thenCallback = function(i) {\\\\n        return new Function(\\"value\\", \\"holder\\", \\"                             \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            holder.pIndex = value;                                           \\\\\\\\n\\\\\\\\\\\\n            holder.checkFulfillment(this);                                   \\\\\\\\n\\\\\\\\\\\\n            \\".replace(/Index/g, i));\\\\n    };\\\\n\\\\n    var promiseSetter = function(i) {\\\\n        return new Function(\\"promise\\", \\"holder\\", \\"                           \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            holder.pIndex = promise;                                         \\\\\\\\n\\\\\\\\\\\\n            \\".replace(/Index/g, i));\\\\n    };\\\\n\\\\n    var generateHolderClass = function(total) {\\\\n        var props = new Array(total);\\\\n        for (var i = 0; i < props.length; ++i) {\\\\n            props[i] = \\"this.p\\" + (i+1);\\\\n        }\\\\n        var assignment = props.join(\\" = \\") + \\" = null;\\";\\\\n        var cancellationCode= \\"var promise;\\\\\\\\n\\" + props.map(function(prop) {\\\\n            return \\"                                                         \\\\\\\\n\\\\\\\\\\\\n                promise = \\" + prop + \\";                                      \\\\\\\\n\\\\\\\\\\\\n                if (promise instanceof Promise) {                            \\\\\\\\n\\\\\\\\\\\\n                    promise.cancel();                                        \\\\\\\\n\\\\\\\\\\\\n                }                                                            \\\\\\\\n\\\\\\\\\\\\n            \\";\\\\n        }).join(\\"\\\\\\\\n\\");\\\\n        var passedArguments = props.join(\\", \\");\\\\n        var name = \\"Holder$\\" + total;\\\\n\\\\n\\\\n        var code = \\"return function(tryCatch, errorObj, Promise) {           \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            function [TheName](fn) {                                         \\\\\\\\n\\\\\\\\\\\\n                [TheProperties]                                              \\\\\\\\n\\\\\\\\\\\\n                this.fn = fn;                                                \\\\\\\\n\\\\\\\\\\\\n                this.now = 0;                                                \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            [TheName].prototype.checkFulfillment = function(promise) {       \\\\\\\\n\\\\\\\\\\\\n                var now = ++this.now;                                        \\\\\\\\n\\\\\\\\\\\\n                if (now === [TheTotal]) {                                    \\\\\\\\n\\\\\\\\\\\\n                    promise._pushContext();                                  \\\\\\\\n\\\\\\\\\\\\n                    var callback = this.fn;                                  \\\\\\\\n\\\\\\\\\\\\n                    var ret = tryCatch(callback)([ThePassedArguments]);      \\\\\\\\n\\\\\\\\\\\\n                    promise._popContext();                                   \\\\\\\\n\\\\\\\\\\\\n                    if (ret === errorObj) {                                  \\\\\\\\n\\\\\\\\\\\\n                        promise._rejectCallback(ret.e, false);               \\\\\\\\n\\\\\\\\\\\\n                    } else {                                                 \\\\\\\\n\\\\\\\\\\\\n                        promise._resolveCallback(ret);                       \\\\\\\\n\\\\\\\\\\\\n                    }                                                        \\\\\\\\n\\\\\\\\\\\\n                }                                                            \\\\\\\\n\\\\\\\\\\\\n            };                                                               \\\\\\\\n\\\\\\\\\\\\n                                                                             \\\\\\\\n\\\\\\\\\\\\n            [TheName].prototype._resultCancelled = function() {              \\\\\\\\n\\\\\\\\\\\\n                [CancellationCode]                                           \\\\\\\\n\\\\\\\\\\\\n            };                                                               \\\\\\\\n\\\\\\\\\\\\n                                                                             \\\\\\\\n\\\\\\\\\\\\n            return [TheName];                                                \\\\\\\\n\\\\\\\\\\\\n        }(tryCatch, errorObj, Promise);                                      \\\\\\\\n\\\\\\\\\\\\n        \\";\\\\n\\\\n        code = code.replace(/\\\\\\\\[TheName\\\\\\\\]/g, name)\\\\n            .replace(/\\\\\\\\[TheTotal\\\\\\\\]/g, total)\\\\n            .replace(/\\\\\\\\[ThePassedArguments\\\\\\\\]/g, passedArguments)\\\\n            .replace(/\\\\\\\\[TheProperties\\\\\\\\]/g, assignment)\\\\n            .replace(/\\\\\\\\[CancellationCode\\\\\\\\]/g, cancellationCode);\\\\n\\\\n        return new Function(\\"tryCatch\\", \\"errorObj\\", \\"Promise\\", code)\\\\n                           (tryCatch, errorObj, Promise);\\\\n    };\\\\n\\\\n    var holderClasses = [];\\\\n    var thenCallbacks = [];\\\\n    var promiseSetters = [];\\\\n\\\\n    for (var i = 0; i < 8; ++i) {\\\\n        holderClasses.push(generateHolderClass(i + 1));\\\\n        thenCallbacks.push(thenCallback(i + 1));\\\\n        promiseSetters.push(promiseSetter(i + 1));\\\\n    }\\\\n\\\\n    reject = function (reason) {\\\\n        this._reject(reason);\\\\n    };\\\\n}}\\\\n\\\\nPromise.join = function () {\\\\n    var last = arguments.length - 1;\\\\n    var fn;\\\\n    if (last > 0 && typeof arguments[last] === \\"function\\") {\\\\n        fn = arguments[last];\\\\n        if (false) {\\\\n            if (last <= 8 && canEvaluate) {\\\\n                var ret = new Promise(INTERNAL);\\\\n                ret._captureStackTrace();\\\\n                var HolderClass = holderClasses[last - 1];\\\\n                var holder = new HolderClass(fn);\\\\n                var callbacks = thenCallbacks;\\\\n\\\\n                for (var i = 0; i < last; ++i) {\\\\n                    var maybePromise = tryConvertToPromise(arguments[i], ret);\\\\n                    if (maybePromise instanceof Promise) {\\\\n                        maybePromise = maybePromise._target();\\\\n                        var bitField = maybePromise._bitField;\\\\n                        ;\\\\n                        if (((bitField & 50397184) === 0)) {\\\\n                            maybePromise._then(callbacks[i], reject,\\\\n                                               undefined, ret, holder);\\\\n                            promiseSetters[i](maybePromise, holder);\\\\n                        } else if (((bitField & 33554432) !== 0)) {\\\\n                            callbacks[i].call(ret,\\\\n                                              maybePromise._value(), holder);\\\\n                        } else if (((bitField & 16777216) !== 0)) {\\\\n                            ret._reject(maybePromise._reason());\\\\n                        } else {\\\\n                            ret._cancel();\\\\n                        }\\\\n                    } else {\\\\n                        callbacks[i].call(ret, maybePromise, holder);\\\\n                    }\\\\n                }\\\\n                if (!ret._isFateSealed()) {\\\\n                    ret._setAsyncGuaranteed();\\\\n                    ret._setOnCancel(holder);\\\\n                }\\\\n                return ret;\\\\n            }\\\\n        }\\\\n    }\\\\n    var args = [].slice.call(arguments);;\\\\n    if (fn) args.pop();\\\\n    var ret = new PromiseArray(args).promise();\\\\n    return fn !== undefined ? ret.spread(fn) : ret;\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],18:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          PromiseArray,\\\\n                          apiRejection,\\\\n                          tryConvertToPromise,\\\\n                          INTERNAL,\\\\n                          debug) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\nvar EMPTY_ARRAY = [];\\\\n\\\\nfunction MappingPromiseArray(promises, fn, limit, _filter) {\\\\n    this.constructor$(promises);\\\\n    this._promise._captureStackTrace();\\\\n    var domain = getDomain();\\\\n    this._callback = domain === null ? fn : domain.bind(fn);\\\\n    this._preservedValues = _filter === INTERNAL\\\\n        ? new Array(this.length())\\\\n        : null;\\\\n    this._limit = limit;\\\\n    this._inFlight = 0;\\\\n    this._queue = limit >= 1 ? [] : EMPTY_ARRAY;\\\\n    this._init$(undefined, -2);\\\\n}\\\\nutil.inherits(MappingPromiseArray, PromiseArray);\\\\n\\\\nMappingPromiseArray.prototype._init = function () {};\\\\n\\\\nMappingPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    var values = this._values;\\\\n    var length = this.length();\\\\n    var preservedValues = this._preservedValues;\\\\n    var limit = this._limit;\\\\n\\\\n    if (index < 0) {\\\\n        index = (index * -1) - 1;\\\\n        values[index] = value;\\\\n        if (limit >= 1) {\\\\n            this._inFlight--;\\\\n            this._drainQueue();\\\\n            if (this._isResolved()) return true;\\\\n        }\\\\n    } else {\\\\n        if (limit >= 1 && this._inFlight >= limit) {\\\\n            values[index] = value;\\\\n            this._queue.push(index);\\\\n            return false;\\\\n        }\\\\n        if (preservedValues !== null) preservedValues[index] = value;\\\\n\\\\n        var promise = this._promise;\\\\n        var callback = this._callback;\\\\n        var receiver = promise._boundValue();\\\\n        promise._pushContext();\\\\n        var ret = tryCatch(callback).call(receiver, value, index, length);\\\\n        var promiseCreated = promise._popContext();\\\\n        debug.checkForgottenReturns(\\\\n            ret,\\\\n            promiseCreated,\\\\n            preservedValues !== null ? \\"Promise.filter\\" : \\"Promise.map\\",\\\\n            promise\\\\n        );\\\\n        if (ret === errorObj) {\\\\n            this._reject(ret.e);\\\\n            return true;\\\\n        }\\\\n\\\\n        var maybePromise = tryConvertToPromise(ret, this._promise);\\\\n        if (maybePromise instanceof Promise) {\\\\n            maybePromise = maybePromise._target();\\\\n            var bitField = maybePromise._bitField;\\\\n            ;\\\\n            if (((bitField & 50397184) === 0)) {\\\\n                if (limit >= 1) this._inFlight++;\\\\n                values[index] = maybePromise;\\\\n                maybePromise._proxy(this, (index + 1) * -1);\\\\n                return false;\\\\n            } else if (((bitField & 33554432) !== 0)) {\\\\n                ret = maybePromise._value();\\\\n            } else if (((bitField & 16777216) !== 0)) {\\\\n                this._reject(maybePromise._reason());\\\\n                return true;\\\\n            } else {\\\\n                this._cancel();\\\\n                return true;\\\\n            }\\\\n        }\\\\n        values[index] = ret;\\\\n    }\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= length) {\\\\n        if (preservedValues !== null) {\\\\n            this._filter(values, preservedValues);\\\\n        } else {\\\\n            this._resolve(values);\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nMappingPromiseArray.prototype._drainQueue = function () {\\\\n    var queue = this._queue;\\\\n    var limit = this._limit;\\\\n    var values = this._values;\\\\n    while (queue.length > 0 && this._inFlight < limit) {\\\\n        if (this._isResolved()) return;\\\\n        var index = queue.pop();\\\\n        this._promiseFulfilled(values[index], index);\\\\n    }\\\\n};\\\\n\\\\nMappingPromiseArray.prototype._filter = function (booleans, values) {\\\\n    var len = values.length;\\\\n    var ret = new Array(len);\\\\n    var j = 0;\\\\n    for (var i = 0; i < len; ++i) {\\\\n        if (booleans[i]) ret[j++] = values[i];\\\\n    }\\\\n    ret.length = j;\\\\n    this._resolve(ret);\\\\n};\\\\n\\\\nMappingPromiseArray.prototype.preservedValues = function () {\\\\n    return this._preservedValues;\\\\n};\\\\n\\\\nfunction map(promises, fn, options, _filter) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var limit = typeof options === \\"object\\" && options !== null\\\\n        ? options.concurrency\\\\n        : 0;\\\\n    limit = typeof limit === \\"number\\" &&\\\\n        isFinite(limit) && limit >= 1 ? limit : 0;\\\\n    return new MappingPromiseArray(promises, fn, limit, _filter).promise();\\\\n}\\\\n\\\\nPromise.prototype.map = function (fn, options) {\\\\n    return map(this, fn, options, null);\\\\n};\\\\n\\\\nPromise.map = function (promises, fn, options, _filter) {\\\\n    return map(promises, fn, options, _filter);\\\\n};\\\\n\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],19:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\n\\\\nPromise.method = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new Promise.TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    return function () {\\\\n        var ret = new Promise(INTERNAL);\\\\n        ret._captureStackTrace();\\\\n        ret._pushContext();\\\\n        var value = tryCatch(fn).apply(this, arguments);\\\\n        var promiseCreated = ret._popContext();\\\\n        debug.checkForgottenReturns(\\\\n            value, promiseCreated, \\"Promise.method\\", ret);\\\\n        ret._resolveFromSyncValue(value);\\\\n        return ret;\\\\n    };\\\\n};\\\\n\\\\nPromise.attempt = Promise[\\"try\\"] = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    ret._pushContext();\\\\n    var value;\\\\n    if (arguments.length > 1) {\\\\n        debug.deprecated(\\"calling Promise.try with more than 1 argument\\");\\\\n        var arg = arguments[1];\\\\n        var ctx = arguments[2];\\\\n        value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg)\\\\n                                  : tryCatch(fn).call(ctx, arg);\\\\n    } else {\\\\n        value = tryCatch(fn)();\\\\n    }\\\\n    var promiseCreated = ret._popContext();\\\\n    debug.checkForgottenReturns(\\\\n        value, promiseCreated, \\"Promise.try\\", ret);\\\\n    ret._resolveFromSyncValue(value);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._resolveFromSyncValue = function (value) {\\\\n    if (value === util.errorObj) {\\\\n        this._rejectCallback(value.e, false);\\\\n    } else {\\\\n        this._resolveCallback(value, true);\\\\n    }\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],20:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar maybeWrapAsError = util.maybeWrapAsError;\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar OperationalError = errors.OperationalError;\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\n\\\\nfunction isUntypedError(obj) {\\\\n    return obj instanceof Error &&\\\\n        es5.getPrototypeOf(obj) === Error.prototype;\\\\n}\\\\n\\\\nvar rErrorKey = /^(?:name|message|stack|cause)$/;\\\\nfunction wrapAsOperationalError(obj) {\\\\n    var ret;\\\\n    if (isUntypedError(obj)) {\\\\n        ret = new OperationalError(obj);\\\\n        ret.name = obj.name;\\\\n        ret.message = obj.message;\\\\n        ret.stack = obj.stack;\\\\n        var keys = es5.keys(obj);\\\\n        for (var i = 0; i < keys.length; ++i) {\\\\n            var key = keys[i];\\\\n            if (!rErrorKey.test(key)) {\\\\n                ret[key] = obj[key];\\\\n            }\\\\n        }\\\\n        return ret;\\\\n    }\\\\n    util.markAsOriginatingFromRejection(obj);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction nodebackForPromise(promise, multiArgs) {\\\\n    return function(err, value) {\\\\n        if (promise === null) return;\\\\n        if (err) {\\\\n            var wrapped = wrapAsOperationalError(maybeWrapAsError(err));\\\\n            promise._attachExtraTrace(wrapped);\\\\n            promise._reject(wrapped);\\\\n        } else if (!multiArgs) {\\\\n            promise._fulfill(value);\\\\n        } else {\\\\n            var args = [].slice.call(arguments, 1);;\\\\n            promise._fulfill(args);\\\\n        }\\\\n        promise = null;\\\\n    };\\\\n}\\\\n\\\\nmodule.exports = nodebackForPromise;\\\\n\\\\n},{\\"./errors\\":12,\\"./es5\\":13,\\"./util\\":36}],21:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar async = Promise._async;\\\\nvar tryCatch = util.tryCatch;\\\\nvar errorObj = util.errorObj;\\\\n\\\\nfunction spreadAdapter(val, nodeback) {\\\\n    var promise = this;\\\\n    if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback);\\\\n    var ret =\\\\n        tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val));\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\n\\\\nfunction successAdapter(val, nodeback) {\\\\n    var promise = this;\\\\n    var receiver = promise._boundValue();\\\\n    var ret = val === undefined\\\\n        ? tryCatch(nodeback).call(receiver, null)\\\\n        : tryCatch(nodeback).call(receiver, null, val);\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\nfunction errorAdapter(reason, nodeback) {\\\\n    var promise = this;\\\\n    if (!reason) {\\\\n        var newReason = new Error(reason + \\"\\");\\\\n        newReason.cause = reason;\\\\n        reason = newReason;\\\\n    }\\\\n    var ret = tryCatch(nodeback).call(promise._boundValue(), reason);\\\\n    if (ret === errorObj) {\\\\n        async.throwLater(ret.e);\\\\n    }\\\\n}\\\\n\\\\nPromise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback,\\\\n                                                                     options) {\\\\n    if (typeof nodeback == \\"function\\") {\\\\n        var adapter = successAdapter;\\\\n        if (options !== undefined && Object(options).spread) {\\\\n            adapter = spreadAdapter;\\\\n        }\\\\n        this._then(\\\\n            adapter,\\\\n            errorAdapter,\\\\n            undefined,\\\\n            this,\\\\n            nodeback\\\\n        );\\\\n    }\\\\n    return this;\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],22:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function() {\\\\nvar makeSelfResolutionError = function () {\\\\n    return new TypeError(\\"circular promise resolution chain\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n};\\\\nvar reflectHandler = function() {\\\\n    return new Promise.PromiseInspection(this._target());\\\\n};\\\\nvar apiRejection = function(msg) {\\\\n    return Promise.reject(new TypeError(msg));\\\\n};\\\\nfunction Proxyable() {}\\\\nvar UNDEFINED_BINDING = {};\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nvar getDomain;\\\\nif (util.isNode) {\\\\n    getDomain = function() {\\\\n        var ret = process.domain;\\\\n        if (ret === undefined) ret = null;\\\\n        return ret;\\\\n    };\\\\n} else {\\\\n    getDomain = function() {\\\\n        return null;\\\\n    };\\\\n}\\\\nutil.notEnumerableProp(Promise, \\"_getDomain\\", getDomain);\\\\n\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Async = _dereq_(\\"./async\\");\\\\nvar async = new Async();\\\\nes5.defineProperty(Promise, \\"_async\\", {value: async});\\\\nvar errors = _dereq_(\\"./errors\\");\\\\nvar TypeError = Promise.TypeError = errors.TypeError;\\\\nPromise.RangeError = errors.RangeError;\\\\nvar CancellationError = Promise.CancellationError = errors.CancellationError;\\\\nPromise.TimeoutError = errors.TimeoutError;\\\\nPromise.OperationalError = errors.OperationalError;\\\\nPromise.RejectionError = errors.OperationalError;\\\\nPromise.AggregateError = errors.AggregateError;\\\\nvar INTERNAL = function(){};\\\\nvar APPLY = {};\\\\nvar NEXT_FILTER = {};\\\\nvar tryConvertToPromise = _dereq_(\\"./thenables\\")(Promise, INTERNAL);\\\\nvar PromiseArray =\\\\n    _dereq_(\\"./promise_array\\")(Promise, INTERNAL,\\\\n                               tryConvertToPromise, apiRejection, Proxyable);\\\\nvar Context = _dereq_(\\"./context\\")(Promise);\\\\n /*jshint unused:false*/\\\\nvar createContext = Context.create;\\\\nvar debug = _dereq_(\\"./debuggability\\")(Promise, Context);\\\\nvar CapturedTrace = debug.CapturedTrace;\\\\nvar PassThroughHandlerContext =\\\\n    _dereq_(\\"./finally\\")(Promise, tryConvertToPromise);\\\\nvar catchFilter = _dereq_(\\"./catch_filter\\")(NEXT_FILTER);\\\\nvar nodebackForPromise = _dereq_(\\"./nodeback\\");\\\\nvar errorObj = util.errorObj;\\\\nvar tryCatch = util.tryCatch;\\\\nfunction check(self, executor) {\\\\n    if (typeof executor !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(executor));\\\\n    }\\\\n    if (self.constructor !== Promise) {\\\\n        throw new TypeError(\\"the promise constructor cannot be invoked directly\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n}\\\\n\\\\nfunction Promise(executor) {\\\\n    this._bitField = 0;\\\\n    this._fulfillmentHandler0 = undefined;\\\\n    this._rejectionHandler0 = undefined;\\\\n    this._promise0 = undefined;\\\\n    this._receiver0 = undefined;\\\\n    if (executor !== INTERNAL) {\\\\n        check(this, executor);\\\\n        this._resolveFromExecutor(executor);\\\\n    }\\\\n    this._promiseCreated();\\\\n    this._fireEvent(\\"promiseCreated\\", this);\\\\n}\\\\n\\\\nPromise.prototype.toString = function () {\\\\n    return \\"[object Promise]\\";\\\\n};\\\\n\\\\nPromise.prototype.caught = Promise.prototype[\\"catch\\"] = function (fn) {\\\\n    var len = arguments.length;\\\\n    if (len > 1) {\\\\n        var catchInstances = new Array(len - 1),\\\\n            j = 0, i;\\\\n        for (i = 0; i < len - 1; ++i) {\\\\n            var item = arguments[i];\\\\n            if (util.isObject(item)) {\\\\n                catchInstances[j++] = item;\\\\n            } else {\\\\n                return apiRejection(\\"expecting an object but got \\" + util.classString(item));\\\\n            }\\\\n        }\\\\n        catchInstances.length = j;\\\\n        fn = arguments[i];\\\\n        return this.then(undefined, catchFilter(catchInstances, fn, this));\\\\n    }\\\\n    return this.then(undefined, fn);\\\\n};\\\\n\\\\nPromise.prototype.reflect = function () {\\\\n    return this._then(reflectHandler,\\\\n        reflectHandler, undefined, this, undefined);\\\\n};\\\\n\\\\nPromise.prototype.then = function (didFulfill, didReject) {\\\\n    if (debug.warnings() && arguments.length > 0 &&\\\\n        typeof didFulfill !== \\"function\\" &&\\\\n        typeof didReject !== \\"function\\") {\\\\n        var msg = \\".then() only accepts functions but was passed: \\" +\\\\n                util.classString(didFulfill);\\\\n        if (arguments.length > 1) {\\\\n            msg += \\", \\" + util.classString(didReject);\\\\n        }\\\\n        this._warn(msg);\\\\n    }\\\\n    return this._then(didFulfill, didReject, undefined, undefined, undefined);\\\\n};\\\\n\\\\nPromise.prototype.done = function (didFulfill, didReject) {\\\\n    var promise =\\\\n        this._then(didFulfill, didReject, undefined, undefined, undefined);\\\\n    promise._setIsFinal();\\\\n};\\\\n\\\\nPromise.prototype.spread = function (fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    return this.all()._then(fn, undefined, undefined, APPLY, undefined);\\\\n};\\\\n\\\\nPromise.prototype.toJSON = function () {\\\\n    var ret = {\\\\n        isFulfilled: false,\\\\n        isRejected: false,\\\\n        fulfillmentValue: undefined,\\\\n        rejectionReason: undefined\\\\n    };\\\\n    if (this.isFulfilled()) {\\\\n        ret.fulfillmentValue = this.value();\\\\n        ret.isFulfilled = true;\\\\n    } else if (this.isRejected()) {\\\\n        ret.rejectionReason = this.reason();\\\\n        ret.isRejected = true;\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype.all = function () {\\\\n    if (arguments.length > 0) {\\\\n        this._warn(\\".all() was passed arguments but it does not take any\\");\\\\n    }\\\\n    return new PromiseArray(this).promise();\\\\n};\\\\n\\\\nPromise.prototype.error = function (fn) {\\\\n    return this.caught(util.originatesFromRejection, fn);\\\\n};\\\\n\\\\nPromise.is = function (val) {\\\\n    return val instanceof Promise;\\\\n};\\\\n\\\\nPromise.fromNode = Promise.fromCallback = function(fn) {\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs\\\\n                                         : false;\\\\n    var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs));\\\\n    if (result === errorObj) {\\\\n        ret._rejectCallback(result.e, true);\\\\n    }\\\\n    if (!ret._isFateSealed()) ret._setAsyncGuaranteed();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.all = function (promises) {\\\\n    return new PromiseArray(promises).promise();\\\\n};\\\\n\\\\nPromise.cast = function (obj) {\\\\n    var ret = tryConvertToPromise(obj);\\\\n    if (!(ret instanceof Promise)) {\\\\n        ret = new Promise(INTERNAL);\\\\n        ret._captureStackTrace();\\\\n        ret._setFulfilled();\\\\n        ret._rejectionHandler0 = obj;\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.resolve = Promise.fulfilled = Promise.cast;\\\\n\\\\nPromise.reject = Promise.rejected = function (reason) {\\\\n    var ret = new Promise(INTERNAL);\\\\n    ret._captureStackTrace();\\\\n    ret._rejectCallback(reason, true);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.setScheduler = function(fn) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var prev = async._schedule;\\\\n    async._schedule = fn;\\\\n    return prev;\\\\n};\\\\n\\\\nPromise.prototype._then = function (\\\\n    didFulfill,\\\\n    didReject,\\\\n    _,    receiver,\\\\n    internalData\\\\n) {\\\\n    var haveInternalData = internalData !== undefined;\\\\n    var promise = haveInternalData ? internalData : new Promise(INTERNAL);\\\\n    var target = this._target();\\\\n    var bitField = target._bitField;\\\\n\\\\n    if (!haveInternalData) {\\\\n        promise._propagateFrom(this, 3);\\\\n        promise._captureStackTrace();\\\\n        if (receiver === undefined &&\\\\n            ((this._bitField & 2097152) !== 0)) {\\\\n            if (!((bitField & 50397184) === 0)) {\\\\n                receiver = this._boundValue();\\\\n            } else {\\\\n                receiver = target === this ? undefined : this._boundTo;\\\\n            }\\\\n        }\\\\n        this._fireEvent(\\"promiseChained\\", this, promise);\\\\n    }\\\\n\\\\n    var domain = getDomain();\\\\n    if (!((bitField & 50397184) === 0)) {\\\\n        var handler, value, settler = target._settlePromiseCtx;\\\\n        if (((bitField & 33554432) !== 0)) {\\\\n            value = target._rejectionHandler0;\\\\n            handler = didFulfill;\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            value = target._fulfillmentHandler0;\\\\n            handler = didReject;\\\\n            target._unsetRejectionIsUnhandled();\\\\n        } else {\\\\n            settler = target._settlePromiseLateCancellationObserver;\\\\n            value = new CancellationError(\\"late cancellation observer\\");\\\\n            target._attachExtraTrace(value);\\\\n            handler = didReject;\\\\n        }\\\\n\\\\n        async.invoke(settler, target, {\\\\n            handler: domain === null ? handler\\\\n                : (typeof handler === \\"function\\" && domain.bind(handler)),\\\\n            promise: promise,\\\\n            receiver: receiver,\\\\n            value: value\\\\n        });\\\\n    } else {\\\\n        target._addCallbacks(didFulfill, didReject, promise, receiver, domain);\\\\n    }\\\\n\\\\n    return promise;\\\\n};\\\\n\\\\nPromise.prototype._length = function () {\\\\n    return this._bitField & 65535;\\\\n};\\\\n\\\\nPromise.prototype._isFateSealed = function () {\\\\n    return (this._bitField & 117506048) !== 0;\\\\n};\\\\n\\\\nPromise.prototype._isFollowing = function () {\\\\n    return (this._bitField & 67108864) === 67108864;\\\\n};\\\\n\\\\nPromise.prototype._setLength = function (len) {\\\\n    this._bitField = (this._bitField & -65536) |\\\\n        (len & 65535);\\\\n};\\\\n\\\\nPromise.prototype._setFulfilled = function () {\\\\n    this._bitField = this._bitField | 33554432;\\\\n    this._fireEvent(\\"promiseFulfilled\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setRejected = function () {\\\\n    this._bitField = this._bitField | 16777216;\\\\n    this._fireEvent(\\"promiseRejected\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setFollowing = function () {\\\\n    this._bitField = this._bitField | 67108864;\\\\n    this._fireEvent(\\"promiseResolved\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setIsFinal = function () {\\\\n    this._bitField = this._bitField | 4194304;\\\\n};\\\\n\\\\nPromise.prototype._isFinal = function () {\\\\n    return (this._bitField & 4194304) > 0;\\\\n};\\\\n\\\\nPromise.prototype._unsetCancelled = function() {\\\\n    this._bitField = this._bitField & (~65536);\\\\n};\\\\n\\\\nPromise.prototype._setCancelled = function() {\\\\n    this._bitField = this._bitField | 65536;\\\\n    this._fireEvent(\\"promiseCancelled\\", this);\\\\n};\\\\n\\\\nPromise.prototype._setAsyncGuaranteed = function() {\\\\n    this._bitField = this._bitField | 134217728;\\\\n};\\\\n\\\\nPromise.prototype._receiverAt = function (index) {\\\\n    var ret = index === 0 ? this._receiver0 : this[\\\\n            index * 4 - 4 + 3];\\\\n    if (ret === UNDEFINED_BINDING) {\\\\n        return undefined;\\\\n    } else if (ret === undefined && this._isBound()) {\\\\n        return this._boundValue();\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._promiseAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 2];\\\\n};\\\\n\\\\nPromise.prototype._fulfillmentHandlerAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 0];\\\\n};\\\\n\\\\nPromise.prototype._rejectionHandlerAt = function (index) {\\\\n    return this[\\\\n            index * 4 - 4 + 1];\\\\n};\\\\n\\\\nPromise.prototype._boundValue = function() {};\\\\n\\\\nPromise.prototype._migrateCallback0 = function (follower) {\\\\n    var bitField = follower._bitField;\\\\n    var fulfill = follower._fulfillmentHandler0;\\\\n    var reject = follower._rejectionHandler0;\\\\n    var promise = follower._promise0;\\\\n    var receiver = follower._receiverAt(0);\\\\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\\\\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\\\\n};\\\\n\\\\nPromise.prototype._migrateCallbackAt = function (follower, index) {\\\\n    var fulfill = follower._fulfillmentHandlerAt(index);\\\\n    var reject = follower._rejectionHandlerAt(index);\\\\n    var promise = follower._promiseAt(index);\\\\n    var receiver = follower._receiverAt(index);\\\\n    if (receiver === undefined) receiver = UNDEFINED_BINDING;\\\\n    this._addCallbacks(fulfill, reject, promise, receiver, null);\\\\n};\\\\n\\\\nPromise.prototype._addCallbacks = function (\\\\n    fulfill,\\\\n    reject,\\\\n    promise,\\\\n    receiver,\\\\n    domain\\\\n) {\\\\n    var index = this._length();\\\\n\\\\n    if (index >= 65535 - 4) {\\\\n        index = 0;\\\\n        this._setLength(0);\\\\n    }\\\\n\\\\n    if (index === 0) {\\\\n        this._promise0 = promise;\\\\n        this._receiver0 = receiver;\\\\n        if (typeof fulfill === \\"function\\") {\\\\n            this._fulfillmentHandler0 =\\\\n                domain === null ? fulfill : domain.bind(fulfill);\\\\n        }\\\\n        if (typeof reject === \\"function\\") {\\\\n            this._rejectionHandler0 =\\\\n                domain === null ? reject : domain.bind(reject);\\\\n        }\\\\n    } else {\\\\n        var base = index * 4 - 4;\\\\n        this[base + 2] = promise;\\\\n        this[base + 3] = receiver;\\\\n        if (typeof fulfill === \\"function\\") {\\\\n            this[base + 0] =\\\\n                domain === null ? fulfill : domain.bind(fulfill);\\\\n        }\\\\n        if (typeof reject === \\"function\\") {\\\\n            this[base + 1] =\\\\n                domain === null ? reject : domain.bind(reject);\\\\n        }\\\\n    }\\\\n    this._setLength(index + 1);\\\\n    return index;\\\\n};\\\\n\\\\nPromise.prototype._proxy = function (proxyable, arg) {\\\\n    this._addCallbacks(undefined, undefined, arg, proxyable, null);\\\\n};\\\\n\\\\nPromise.prototype._resolveCallback = function(value, shouldBind) {\\\\n    if (((this._bitField & 117506048) !== 0)) return;\\\\n    if (value === this)\\\\n        return this._rejectCallback(makeSelfResolutionError(), false);\\\\n    var maybePromise = tryConvertToPromise(value, this);\\\\n    if (!(maybePromise instanceof Promise)) return this._fulfill(value);\\\\n\\\\n    if (shouldBind) this._propagateFrom(maybePromise, 2);\\\\n\\\\n    var promise = maybePromise._target();\\\\n    var bitField = promise._bitField;\\\\n    if (((bitField & 50397184) === 0)) {\\\\n        var len = this._length();\\\\n        if (len > 0) promise._migrateCallback0(this);\\\\n        for (var i = 1; i < len; ++i) {\\\\n            promise._migrateCallbackAt(this, i);\\\\n        }\\\\n        this._setFollowing();\\\\n        this._setLength(0);\\\\n        this._setFollowee(promise);\\\\n    } else if (((bitField & 33554432) !== 0)) {\\\\n        this._fulfill(promise._value());\\\\n    } else if (((bitField & 16777216) !== 0)) {\\\\n        this._reject(promise._reason());\\\\n    } else {\\\\n        var reason = new CancellationError(\\"late cancellation observer\\");\\\\n        promise._attachExtraTrace(reason);\\\\n        this._reject(reason);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._rejectCallback =\\\\nfunction(reason, synchronous, ignoreNonErrorWarnings) {\\\\n    var trace = util.ensureErrorObject(reason);\\\\n    var hasStack = trace === reason;\\\\n    if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) {\\\\n        var message = \\"a promise was rejected with a non-error: \\" +\\\\n            util.classString(reason);\\\\n        this._warn(message, true);\\\\n    }\\\\n    this._attachExtraTrace(trace, synchronous ? hasStack : false);\\\\n    this._reject(reason);\\\\n};\\\\n\\\\nPromise.prototype._resolveFromExecutor = function (executor) {\\\\n    var promise = this;\\\\n    this._captureStackTrace();\\\\n    this._pushContext();\\\\n    var synchronous = true;\\\\n    var r = this._execute(executor, function(value) {\\\\n        promise._resolveCallback(value);\\\\n    }, function (reason) {\\\\n        promise._rejectCallback(reason, synchronous);\\\\n    });\\\\n    synchronous = false;\\\\n    this._popContext();\\\\n\\\\n    if (r !== undefined) {\\\\n        promise._rejectCallback(r, true);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseFromHandler = function (\\\\n    handler, receiver, value, promise\\\\n) {\\\\n    var bitField = promise._bitField;\\\\n    if (((bitField & 65536) !== 0)) return;\\\\n    promise._pushContext();\\\\n    var x;\\\\n    if (receiver === APPLY) {\\\\n        if (!value || typeof value.length !== \\"number\\") {\\\\n            x = errorObj;\\\\n            x.e = new TypeError(\\"cannot .spread() a non-array: \\" +\\\\n                                    util.classString(value));\\\\n        } else {\\\\n            x = tryCatch(handler).apply(this._boundValue(), value);\\\\n        }\\\\n    } else {\\\\n        x = tryCatch(handler).call(receiver, value);\\\\n    }\\\\n    var promiseCreated = promise._popContext();\\\\n    bitField = promise._bitField;\\\\n    if (((bitField & 65536) !== 0)) return;\\\\n\\\\n    if (x === NEXT_FILTER) {\\\\n        promise._reject(value);\\\\n    } else if (x === errorObj || x === promise) {\\\\n        var err = x === promise ? makeSelfResolutionError() : x.e;\\\\n        promise._rejectCallback(err, false);\\\\n    } else {\\\\n        debug.checkForgottenReturns(x, promiseCreated, \\"\\",  promise, this);\\\\n        promise._resolveCallback(x);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._target = function() {\\\\n    var ret = this;\\\\n    while (ret._isFollowing()) ret = ret._followee();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype._followee = function() {\\\\n    return this._rejectionHandler0;\\\\n};\\\\n\\\\nPromise.prototype._setFollowee = function(promise) {\\\\n    this._rejectionHandler0 = promise;\\\\n};\\\\n\\\\nPromise.prototype._settlePromise = function(promise, handler, receiver, value) {\\\\n    var isPromise = promise instanceof Promise;\\\\n    var bitField = this._bitField;\\\\n    var asyncGuaranteed = ((bitField & 134217728) !== 0);\\\\n    if (((bitField & 65536) !== 0)) {\\\\n        if (isPromise) promise._invokeInternalOnCancel();\\\\n\\\\n        if (receiver instanceof PassThroughHandlerContext &&\\\\n            receiver.isFinallyHandler()) {\\\\n            receiver.cancelPromise = promise;\\\\n            if (tryCatch(handler).call(receiver, value) === errorObj) {\\\\n                promise._reject(errorObj.e);\\\\n            }\\\\n        } else if (handler === reflectHandler) {\\\\n            promise._fulfill(reflectHandler.call(receiver));\\\\n        } else if (receiver instanceof Proxyable) {\\\\n            receiver._promiseCancelled(promise);\\\\n        } else if (isPromise || promise instanceof PromiseArray) {\\\\n            promise._cancel();\\\\n        } else {\\\\n            receiver.cancel();\\\\n        }\\\\n    } else if (typeof handler === \\"function\\") {\\\\n        if (!isPromise) {\\\\n            handler.call(receiver, value, promise);\\\\n        } else {\\\\n            if (asyncGuaranteed) promise._setAsyncGuaranteed();\\\\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\\\\n        }\\\\n    } else if (receiver instanceof Proxyable) {\\\\n        if (!receiver._isResolved()) {\\\\n            if (((bitField & 33554432) !== 0)) {\\\\n                receiver._promiseFulfilled(value, promise);\\\\n            } else {\\\\n                receiver._promiseRejected(value, promise);\\\\n            }\\\\n        }\\\\n    } else if (isPromise) {\\\\n        if (asyncGuaranteed) promise._setAsyncGuaranteed();\\\\n        if (((bitField & 33554432) !== 0)) {\\\\n            promise._fulfill(value);\\\\n        } else {\\\\n            promise._reject(value);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseLateCancellationObserver = function(ctx) {\\\\n    var handler = ctx.handler;\\\\n    var promise = ctx.promise;\\\\n    var receiver = ctx.receiver;\\\\n    var value = ctx.value;\\\\n    if (typeof handler === \\"function\\") {\\\\n        if (!(promise instanceof Promise)) {\\\\n            handler.call(receiver, value, promise);\\\\n        } else {\\\\n            this._settlePromiseFromHandler(handler, receiver, value, promise);\\\\n        }\\\\n    } else if (promise instanceof Promise) {\\\\n        promise._reject(value);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromiseCtx = function(ctx) {\\\\n    this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value);\\\\n};\\\\n\\\\nPromise.prototype._settlePromise0 = function(handler, value, bitField) {\\\\n    var promise = this._promise0;\\\\n    var receiver = this._receiverAt(0);\\\\n    this._promise0 = undefined;\\\\n    this._receiver0 = undefined;\\\\n    this._settlePromise(promise, handler, receiver, value);\\\\n};\\\\n\\\\nPromise.prototype._clearCallbackDataAtIndex = function(index) {\\\\n    var base = index * 4 - 4;\\\\n    this[base + 2] =\\\\n    this[base + 3] =\\\\n    this[base + 0] =\\\\n    this[base + 1] = undefined;\\\\n};\\\\n\\\\nPromise.prototype._fulfill = function (value) {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 117506048) >>> 16)) return;\\\\n    if (value === this) {\\\\n        var err = makeSelfResolutionError();\\\\n        this._attachExtraTrace(err);\\\\n        return this._reject(err);\\\\n    }\\\\n    this._setFulfilled();\\\\n    this._rejectionHandler0 = value;\\\\n\\\\n    if ((bitField & 65535) > 0) {\\\\n        if (((bitField & 134217728) !== 0)) {\\\\n            this._settlePromises();\\\\n        } else {\\\\n            async.settlePromises(this);\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._reject = function (reason) {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 117506048) >>> 16)) return;\\\\n    this._setRejected();\\\\n    this._fulfillmentHandler0 = reason;\\\\n\\\\n    if (this._isFinal()) {\\\\n        return async.fatalError(reason, util.isNode);\\\\n    }\\\\n\\\\n    if ((bitField & 65535) > 0) {\\\\n        if (((bitField & 134217728) !== 0)) {\\\\n            this._settlePromises();\\\\n        } else {\\\\n            async.settlePromises(this);\\\\n        }\\\\n    } else {\\\\n        this._ensurePossibleRejectionHandled();\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._fulfillPromises = function (len, value) {\\\\n    for (var i = 1; i < len; i++) {\\\\n        var handler = this._fulfillmentHandlerAt(i);\\\\n        var promise = this._promiseAt(i);\\\\n        var receiver = this._receiverAt(i);\\\\n        this._clearCallbackDataAtIndex(i);\\\\n        this._settlePromise(promise, handler, receiver, value);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._rejectPromises = function (len, reason) {\\\\n    for (var i = 1; i < len; i++) {\\\\n        var handler = this._rejectionHandlerAt(i);\\\\n        var promise = this._promiseAt(i);\\\\n        var receiver = this._receiverAt(i);\\\\n        this._clearCallbackDataAtIndex(i);\\\\n        this._settlePromise(promise, handler, receiver, reason);\\\\n    }\\\\n};\\\\n\\\\nPromise.prototype._settlePromises = function () {\\\\n    var bitField = this._bitField;\\\\n    var len = (bitField & 65535);\\\\n\\\\n    if (len > 0) {\\\\n        if (((bitField & 16842752) !== 0)) {\\\\n            var reason = this._fulfillmentHandler0;\\\\n            this._settlePromise0(this._rejectionHandler0, reason, bitField);\\\\n            this._rejectPromises(len, reason);\\\\n        } else {\\\\n            var value = this._rejectionHandler0;\\\\n            this._settlePromise0(this._fulfillmentHandler0, value, bitField);\\\\n            this._fulfillPromises(len, value);\\\\n        }\\\\n        this._setLength(0);\\\\n    }\\\\n    this._clearCancellationData();\\\\n};\\\\n\\\\nPromise.prototype._settledValue = function() {\\\\n    var bitField = this._bitField;\\\\n    if (((bitField & 33554432) !== 0)) {\\\\n        return this._rejectionHandler0;\\\\n    } else if (((bitField & 16777216) !== 0)) {\\\\n        return this._fulfillmentHandler0;\\\\n    }\\\\n};\\\\n\\\\nfunction deferResolve(v) {this.promise._resolveCallback(v);}\\\\nfunction deferReject(v) {this.promise._rejectCallback(v, false);}\\\\n\\\\nPromise.defer = Promise.pending = function() {\\\\n    debug.deprecated(\\"Promise.defer\\", \\"new Promise\\");\\\\n    var promise = new Promise(INTERNAL);\\\\n    return {\\\\n        promise: promise,\\\\n        resolve: deferResolve,\\\\n        reject: deferReject\\\\n    };\\\\n};\\\\n\\\\nutil.notEnumerableProp(Promise,\\\\n                       \\"_makeSelfResolutionError\\",\\\\n                       makeSelfResolutionError);\\\\n\\\\n_dereq_(\\"./method\\")(Promise, INTERNAL, tryConvertToPromise, apiRejection,\\\\n    debug);\\\\n_dereq_(\\"./bind\\")(Promise, INTERNAL, tryConvertToPromise, debug);\\\\n_dereq_(\\"./cancel\\")(Promise, PromiseArray, apiRejection, debug);\\\\n_dereq_(\\"./direct_resolve\\")(Promise);\\\\n_dereq_(\\"./synchronous_inspection\\")(Promise);\\\\n_dereq_(\\"./join\\")(\\\\n    Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug);\\\\nPromise.Promise = Promise;\\\\n_dereq_(\\\\\'./map.js\\\\\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./using.js\\\\\')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug);\\\\n_dereq_(\\\\\'./timers.js\\\\\')(Promise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./generators.js\\\\\')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug);\\\\n_dereq_(\\\\\'./nodeify.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./call_get.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./props.js\\\\\')(Promise, PromiseArray, tryConvertToPromise, apiRejection);\\\\n_dereq_(\\\\\'./race.js\\\\\')(Promise, INTERNAL, tryConvertToPromise, apiRejection);\\\\n_dereq_(\\\\\'./reduce.js\\\\\')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug);\\\\n_dereq_(\\\\\'./settle.js\\\\\')(Promise, PromiseArray, debug);\\\\n_dereq_(\\\\\'./some.js\\\\\')(Promise, PromiseArray, apiRejection);\\\\n_dereq_(\\\\\'./promisify.js\\\\\')(Promise, INTERNAL);\\\\n_dereq_(\\\\\'./any.js\\\\\')(Promise);\\\\n_dereq_(\\\\\'./each.js\\\\\')(Promise, INTERNAL);\\\\n_dereq_(\\\\\'./filter.js\\\\\')(Promise, INTERNAL);\\\\n                                                         \\\\n    util.toFastProperties(Promise);                                          \\\\n    util.toFastProperties(Promise.prototype);                                \\\\n    function fillTypes(value) {                                              \\\\n        var p = new Promise(INTERNAL);                                       \\\\n        p._fulfillmentHandler0 = value;                                      \\\\n        p._rejectionHandler0 = value;                                        \\\\n        p._promise0 = value;                                                 \\\\n        p._receiver0 = value;                                                \\\\n    }                                                                        \\\\n    // Complete slack tracking, opt out of field-type tracking and           \\\\n    // stabilize map                                                         \\\\n    fillTypes({a: 1});                                                       \\\\n    fillTypes({b: 2});                                                       \\\\n    fillTypes({c: 3});                                                       \\\\n    fillTypes(1);                                                            \\\\n    fillTypes(function(){});                                                 \\\\n    fillTypes(undefined);                                                    \\\\n    fillTypes(false);                                                        \\\\n    fillTypes(new Promise(INTERNAL));                                        \\\\n    debug.setBounds(Async.firstLineError, util.lastLineError);               \\\\n    return Promise;                                                          \\\\n\\\\n};\\\\n\\\\n},{\\"./any.js\\":1,\\"./async\\":2,\\"./bind\\":3,\\"./call_get.js\\":5,\\"./cancel\\":6,\\"./catch_filter\\":7,\\"./context\\":8,\\"./debuggability\\":9,\\"./direct_resolve\\":10,\\"./each.js\\":11,\\"./errors\\":12,\\"./es5\\":13,\\"./filter.js\\":14,\\"./finally\\":15,\\"./generators.js\\":16,\\"./join\\":17,\\"./map.js\\":18,\\"./method\\":19,\\"./nodeback\\":20,\\"./nodeify.js\\":21,\\"./promise_array\\":23,\\"./promisify.js\\":24,\\"./props.js\\":25,\\"./race.js\\":27,\\"./reduce.js\\":28,\\"./settle.js\\":30,\\"./some.js\\":31,\\"./synchronous_inspection\\":32,\\"./thenables\\":33,\\"./timers.js\\":34,\\"./using.js\\":35,\\"./util\\":36}],23:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, tryConvertToPromise,\\\\n    apiRejection, Proxyable) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar isArray = util.isArray;\\\\n\\\\nfunction toResolutionValue(val) {\\\\n    switch(val) {\\\\n    case -2: return [];\\\\n    case -3: return {};\\\\n    }\\\\n}\\\\n\\\\nfunction PromiseArray(values) {\\\\n    var promise = this._promise = new Promise(INTERNAL);\\\\n    if (values instanceof Promise) {\\\\n        promise._propagateFrom(values, 3);\\\\n    }\\\\n    promise._setOnCancel(this);\\\\n    this._values = values;\\\\n    this._length = 0;\\\\n    this._totalResolved = 0;\\\\n    this._init(undefined, -2);\\\\n}\\\\nutil.inherits(PromiseArray, Proxyable);\\\\n\\\\nPromiseArray.prototype.length = function () {\\\\n    return this._length;\\\\n};\\\\n\\\\nPromiseArray.prototype.promise = function () {\\\\n    return this._promise;\\\\n};\\\\n\\\\nPromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {\\\\n    var values = tryConvertToPromise(this._values, this._promise);\\\\n    if (values instanceof Promise) {\\\\n        values = values._target();\\\\n        var bitField = values._bitField;\\\\n        ;\\\\n        this._values = values;\\\\n\\\\n        if (((bitField & 50397184) === 0)) {\\\\n            this._promise._setAsyncGuaranteed();\\\\n            return values._then(\\\\n                init,\\\\n                this._reject,\\\\n                undefined,\\\\n                this,\\\\n                resolveValueIfEmpty\\\\n           );\\\\n        } else if (((bitField & 33554432) !== 0)) {\\\\n            values = values._value();\\\\n        } else if (((bitField & 16777216) !== 0)) {\\\\n            return this._reject(values._reason());\\\\n        } else {\\\\n            return this._cancel();\\\\n        }\\\\n    }\\\\n    values = util.asArray(values);\\\\n    if (values === null) {\\\\n        var err = apiRejection(\\\\n            \\"expecting an array or an iterable object but got \\" + util.classString(values)).reason();\\\\n        this._promise._rejectCallback(err, false);\\\\n        return;\\\\n    }\\\\n\\\\n    if (values.length === 0) {\\\\n        if (resolveValueIfEmpty === -5) {\\\\n            this._resolveEmptyArray();\\\\n        }\\\\n        else {\\\\n            this._resolve(toResolutionValue(resolveValueIfEmpty));\\\\n        }\\\\n        return;\\\\n    }\\\\n    this._iterate(values);\\\\n};\\\\n\\\\nPromiseArray.prototype._iterate = function(values) {\\\\n    var len = this.getActualLength(values.length);\\\\n    this._length = len;\\\\n    this._values = this.shouldCopyValues() ? new Array(len) : this._values;\\\\n    var result = this._promise;\\\\n    var isResolved = false;\\\\n    var bitField = null;\\\\n    for (var i = 0; i < len; ++i) {\\\\n        var maybePromise = tryConvertToPromise(values[i], result);\\\\n\\\\n        if (maybePromise instanceof Promise) {\\\\n            maybePromise = maybePromise._target();\\\\n            bitField = maybePromise._bitField;\\\\n        } else {\\\\n            bitField = null;\\\\n        }\\\\n\\\\n        if (isResolved) {\\\\n            if (bitField !== null) {\\\\n                maybePromise.suppressUnhandledRejections();\\\\n            }\\\\n        } else if (bitField !== null) {\\\\n            if (((bitField & 50397184) === 0)) {\\\\n                maybePromise._proxy(this, i);\\\\n                this._values[i] = maybePromise;\\\\n            } else if (((bitField & 33554432) !== 0)) {\\\\n                isResolved = this._promiseFulfilled(maybePromise._value(), i);\\\\n            } else if (((bitField & 16777216) !== 0)) {\\\\n                isResolved = this._promiseRejected(maybePromise._reason(), i);\\\\n            } else {\\\\n                isResolved = this._promiseCancelled(i);\\\\n            }\\\\n        } else {\\\\n            isResolved = this._promiseFulfilled(maybePromise, i);\\\\n        }\\\\n    }\\\\n    if (!isResolved) result._setAsyncGuaranteed();\\\\n};\\\\n\\\\nPromiseArray.prototype._isResolved = function () {\\\\n    return this._values === null;\\\\n};\\\\n\\\\nPromiseArray.prototype._resolve = function (value) {\\\\n    this._values = null;\\\\n    this._promise._fulfill(value);\\\\n};\\\\n\\\\nPromiseArray.prototype._cancel = function() {\\\\n    if (this._isResolved() || !this._promise.isCancellable()) return;\\\\n    this._values = null;\\\\n    this._promise._cancel();\\\\n};\\\\n\\\\nPromiseArray.prototype._reject = function (reason) {\\\\n    this._values = null;\\\\n    this._promise._rejectCallback(reason, false);\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    this._values[index] = value;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        this._resolve(this._values);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseCancelled = function() {\\\\n    this._cancel();\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype._promiseRejected = function (reason) {\\\\n    this._totalResolved++;\\\\n    this._reject(reason);\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype._resultCancelled = function() {\\\\n    if (this._isResolved()) return;\\\\n    var values = this._values;\\\\n    this._cancel();\\\\n    if (values instanceof Promise) {\\\\n        values.cancel();\\\\n    } else {\\\\n        for (var i = 0; i < values.length; ++i) {\\\\n            if (values[i] instanceof Promise) {\\\\n                values[i].cancel();\\\\n            }\\\\n        }\\\\n    }\\\\n};\\\\n\\\\nPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return true;\\\\n};\\\\n\\\\nPromiseArray.prototype.getActualLength = function (len) {\\\\n    return len;\\\\n};\\\\n\\\\nreturn PromiseArray;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],24:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar THIS = {};\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar nodebackForPromise = _dereq_(\\"./nodeback\\");\\\\nvar withAppended = util.withAppended;\\\\nvar maybeWrapAsError = util.maybeWrapAsError;\\\\nvar canEvaluate = util.canEvaluate;\\\\nvar TypeError = _dereq_(\\"./errors\\").TypeError;\\\\nvar defaultSuffix = \\"Async\\";\\\\nvar defaultPromisified = {__isPromisified__: true};\\\\nvar noCopyProps = [\\\\n    \\"arity\\",    \\"length\\",\\\\n    \\"name\\",\\\\n    \\"arguments\\",\\\\n    \\"caller\\",\\\\n    \\"callee\\",\\\\n    \\"prototype\\",\\\\n    \\"__isPromisified__\\"\\\\n];\\\\nvar noCopyPropsPattern = new RegExp(\\"^(?:\\" + noCopyProps.join(\\"|\\") + \\")$\\");\\\\n\\\\nvar defaultFilter = function(name) {\\\\n    return util.isIdentifier(name) &&\\\\n        name.charAt(0) !== \\"_\\" &&\\\\n        name !== \\"constructor\\";\\\\n};\\\\n\\\\nfunction propsFilter(key) {\\\\n    return !noCopyPropsPattern.test(key);\\\\n}\\\\n\\\\nfunction isPromisified(fn) {\\\\n    try {\\\\n        return fn.__isPromisified__ === true;\\\\n    }\\\\n    catch (e) {\\\\n        return false;\\\\n    }\\\\n}\\\\n\\\\nfunction hasPromisified(obj, key, suffix) {\\\\n    var val = util.getDataPropertyOrDefault(obj, key + suffix,\\\\n                                            defaultPromisified);\\\\n    return val ? isPromisified(val) : false;\\\\n}\\\\nfunction checkValid(ret, suffix, suffixRegexp) {\\\\n    for (var i = 0; i < ret.length; i += 2) {\\\\n        var key = ret[i];\\\\n        if (suffixRegexp.test(key)) {\\\\n            var keyWithoutAsyncSuffix = key.replace(suffixRegexp, \\"\\");\\\\n            for (var j = 0; j < ret.length; j += 2) {\\\\n                if (ret[j] === keyWithoutAsyncSuffix) {\\\\n                    throw new TypeError(\\"Cannot promisify an API that has normal methods with \\\\\'%s\\\\\'-suffix\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\"\\\\n                        .replace(\\"%s\\", suffix));\\\\n                }\\\\n            }\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nfunction promisifiableMethods(obj, suffix, suffixRegexp, filter) {\\\\n    var keys = util.inheritedDataKeys(obj);\\\\n    var ret = [];\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var key = keys[i];\\\\n        var value = obj[key];\\\\n        var passesDefaultFilter = filter === defaultFilter\\\\n            ? true : defaultFilter(key, value, obj);\\\\n        if (typeof value === \\"function\\" &&\\\\n            !isPromisified(value) &&\\\\n            !hasPromisified(obj, key, suffix) &&\\\\n            filter(key, value, obj, passesDefaultFilter)) {\\\\n            ret.push(key, value);\\\\n        }\\\\n    }\\\\n    checkValid(ret, suffix, suffixRegexp);\\\\n    return ret;\\\\n}\\\\n\\\\nvar escapeIdentRegex = function(str) {\\\\n    return str.replace(/([$])/, \\"\\\\\\\\\\\\\\\\$\\");\\\\n};\\\\n\\\\nvar makeNodePromisifiedEval;\\\\nif (false) {\\\\nvar switchCaseArgumentOrder = function(likelyArgumentCount) {\\\\n    var ret = [likelyArgumentCount];\\\\n    var min = Math.max(0, likelyArgumentCount - 1 - 3);\\\\n    for(var i = likelyArgumentCount - 1; i >= min; --i) {\\\\n        ret.push(i);\\\\n    }\\\\n    for(var i = likelyArgumentCount + 1; i <= 3; ++i) {\\\\n        ret.push(i);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nvar argumentSequence = function(argumentCount) {\\\\n    return util.filledRange(argumentCount, \\"_arg\\", \\"\\");\\\\n};\\\\n\\\\nvar parameterDeclaration = function(parameterCount) {\\\\n    return util.filledRange(\\\\n        Math.max(parameterCount, 3), \\"_arg\\", \\"\\");\\\\n};\\\\n\\\\nvar parameterCount = function(fn) {\\\\n    if (typeof fn.length === \\"number\\") {\\\\n        return Math.max(Math.min(fn.length, 1023 + 1), 0);\\\\n    }\\\\n    return 0;\\\\n};\\\\n\\\\nmakeNodePromisifiedEval =\\\\nfunction(callback, receiver, originalName, fn, _, multiArgs) {\\\\n    var newParameterCount = Math.max(0, parameterCount(fn) - 1);\\\\n    var argumentOrder = switchCaseArgumentOrder(newParameterCount);\\\\n    var shouldProxyThis = typeof callback === \\"string\\" || receiver === THIS;\\\\n\\\\n    function generateCallForArgumentCount(count) {\\\\n        var args = argumentSequence(count).join(\\", \\");\\\\n        var comma = count > 0 ? \\", \\" : \\"\\";\\\\n        var ret;\\\\n        if (shouldProxyThis) {\\\\n            ret = \\"ret = callback.call(this, {{args}}, nodeback); break;\\\\\\\\n\\";\\\\n        } else {\\\\n            ret = receiver === undefined\\\\n                ? \\"ret = callback({{args}}, nodeback); break;\\\\\\\\n\\"\\\\n                : \\"ret = callback.call(receiver, {{args}}, nodeback); break;\\\\\\\\n\\";\\\\n        }\\\\n        return ret.replace(\\"{{args}}\\", args).replace(\\", \\", comma);\\\\n    }\\\\n\\\\n    function generateArgumentSwitchCase() {\\\\n        var ret = \\"\\";\\\\n        for (var i = 0; i < argumentOrder.length; ++i) {\\\\n            ret += \\"case \\" + argumentOrder[i] +\\":\\" +\\\\n                generateCallForArgumentCount(argumentOrder[i]);\\\\n        }\\\\n\\\\n        ret += \\"                                                             \\\\\\\\n\\\\\\\\\\\\n        default:                                                             \\\\\\\\n\\\\\\\\\\\\n            var args = new Array(len + 1);                                   \\\\\\\\n\\\\\\\\\\\\n            var i = 0;                                                       \\\\\\\\n\\\\\\\\\\\\n            for (var i = 0; i < len; ++i) {                                  \\\\\\\\n\\\\\\\\\\\\n               args[i] = arguments[i];                                       \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            args[i] = nodeback;                                              \\\\\\\\n\\\\\\\\\\\\n            [CodeForCall]                                                    \\\\\\\\n\\\\\\\\\\\\n            break;                                                           \\\\\\\\n\\\\\\\\\\\\n        \\".replace(\\"[CodeForCall]\\", (shouldProxyThis\\\\n                                ? \\"ret = callback.apply(this, args);\\\\\\\\n\\"\\\\n                                : \\"ret = callback.apply(receiver, args);\\\\\\\\n\\"));\\\\n        return ret;\\\\n    }\\\\n\\\\n    var getFunctionCode = typeof callback === \\"string\\"\\\\n                                ? (\\"this != null ? this[\\\\\'\\"+callback+\\"\\\\\'] : fn\\")\\\\n                                : \\"fn\\";\\\\n    var body = \\"\\\\\'use strict\\\\\';                                                \\\\\\\\n\\\\\\\\\\\\n        var ret = function (Parameters) {                                    \\\\\\\\n\\\\\\\\\\\\n            \\\\\'use strict\\\\\';                                                    \\\\\\\\n\\\\\\\\\\\\n            var len = arguments.length;                                      \\\\\\\\n\\\\\\\\\\\\n            var promise = new Promise(INTERNAL);                             \\\\\\\\n\\\\\\\\\\\\n            promise._captureStackTrace();                                    \\\\\\\\n\\\\\\\\\\\\n            var nodeback = nodebackForPromise(promise, \\" + multiArgs + \\");   \\\\\\\\n\\\\\\\\\\\\n            var ret;                                                         \\\\\\\\n\\\\\\\\\\\\n            var callback = tryCatch([GetFunctionCode]);                      \\\\\\\\n\\\\\\\\\\\\n            switch(len) {                                                    \\\\\\\\n\\\\\\\\\\\\n                [CodeForSwitchCase]                                          \\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            if (ret === errorObj) {                                          \\\\\\\\n\\\\\\\\\\\\n                promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\\\\\\\\n\\\\\\\\\\\\n            }                                                                \\\\\\\\n\\\\\\\\\\\\n            if (!promise._isFateSealed()) promise._setAsyncGuaranteed();     \\\\\\\\n\\\\\\\\\\\\n            return promise;                                                  \\\\\\\\n\\\\\\\\\\\\n        };                                                                   \\\\\\\\n\\\\\\\\\\\\n        notEnumerableProp(ret, \\\\\'__isPromisified__\\\\\', true);                   \\\\\\\\n\\\\\\\\\\\\n        return ret;                                                          \\\\\\\\n\\\\\\\\\\\\n    \\".replace(\\"[CodeForSwitchCase]\\", generateArgumentSwitchCase())\\\\n        .replace(\\"[GetFunctionCode]\\", getFunctionCode);\\\\n    body = body.replace(\\"Parameters\\", parameterDeclaration(newParameterCount));\\\\n    return new Function(\\"Promise\\",\\\\n                        \\"fn\\",\\\\n                        \\"receiver\\",\\\\n                        \\"withAppended\\",\\\\n                        \\"maybeWrapAsError\\",\\\\n                        \\"nodebackForPromise\\",\\\\n                        \\"tryCatch\\",\\\\n                        \\"errorObj\\",\\\\n                        \\"notEnumerableProp\\",\\\\n                        \\"INTERNAL\\",\\\\n                        body)(\\\\n                    Promise,\\\\n                    fn,\\\\n                    receiver,\\\\n                    withAppended,\\\\n                    maybeWrapAsError,\\\\n                    nodebackForPromise,\\\\n                    util.tryCatch,\\\\n                    util.errorObj,\\\\n                    util.notEnumerableProp,\\\\n                    INTERNAL);\\\\n};\\\\n}\\\\n\\\\nfunction makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) {\\\\n    var defaultThis = (function() {return this;})();\\\\n    var method = callback;\\\\n    if (typeof method === \\"string\\") {\\\\n        callback = fn;\\\\n    }\\\\n    function promisified() {\\\\n        var _receiver = receiver;\\\\n        if (receiver === THIS) _receiver = this;\\\\n        var promise = new Promise(INTERNAL);\\\\n        promise._captureStackTrace();\\\\n        var cb = typeof method === \\"string\\" && this !== defaultThis\\\\n            ? this[method] : callback;\\\\n        var fn = nodebackForPromise(promise, multiArgs);\\\\n        try {\\\\n            cb.apply(_receiver, withAppended(arguments, fn));\\\\n        } catch(e) {\\\\n            promise._rejectCallback(maybeWrapAsError(e), true, true);\\\\n        }\\\\n        if (!promise._isFateSealed()) promise._setAsyncGuaranteed();\\\\n        return promise;\\\\n    }\\\\n    util.notEnumerableProp(promisified, \\"__isPromisified__\\", true);\\\\n    return promisified;\\\\n}\\\\n\\\\nvar makeNodePromisified = canEvaluate\\\\n    ? makeNodePromisifiedEval\\\\n    : makeNodePromisifiedClosure;\\\\n\\\\nfunction promisifyAll(obj, suffix, filter, promisifier, multiArgs) {\\\\n    var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + \\"$\\");\\\\n    var methods =\\\\n        promisifiableMethods(obj, suffix, suffixRegexp, filter);\\\\n\\\\n    for (var i = 0, len = methods.length; i < len; i+= 2) {\\\\n        var key = methods[i];\\\\n        var fn = methods[i+1];\\\\n        var promisifiedKey = key + suffix;\\\\n        if (promisifier === makeNodePromisified) {\\\\n            obj[promisifiedKey] =\\\\n                makeNodePromisified(key, THIS, key, fn, suffix, multiArgs);\\\\n        } else {\\\\n            var promisified = promisifier(fn, function() {\\\\n                return makeNodePromisified(key, THIS, key,\\\\n                                           fn, suffix, multiArgs);\\\\n            });\\\\n            util.notEnumerableProp(promisified, \\"__isPromisified__\\", true);\\\\n            obj[promisifiedKey] = promisified;\\\\n        }\\\\n    }\\\\n    util.toFastProperties(obj);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction promisify(callback, receiver, multiArgs) {\\\\n    return makeNodePromisified(callback, receiver, undefined,\\\\n                                callback, null, multiArgs);\\\\n}\\\\n\\\\nPromise.promisify = function (fn, options) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        throw new TypeError(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    if (isPromisified(fn)) {\\\\n        return fn;\\\\n    }\\\\n    options = Object(options);\\\\n    var receiver = options.context === undefined ? THIS : options.context;\\\\n    var multiArgs = !!options.multiArgs;\\\\n    var ret = promisify(fn, receiver, multiArgs);\\\\n    util.copyDescriptors(fn, ret, propsFilter);\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.promisifyAll = function (target, options) {\\\\n    if (typeof target !== \\"function\\" && typeof target !== \\"object\\") {\\\\n        throw new TypeError(\\"the target of promisifyAll must be an object or a function\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    options = Object(options);\\\\n    var multiArgs = !!options.multiArgs;\\\\n    var suffix = options.suffix;\\\\n    if (typeof suffix !== \\"string\\") suffix = defaultSuffix;\\\\n    var filter = options.filter;\\\\n    if (typeof filter !== \\"function\\") filter = defaultFilter;\\\\n    var promisifier = options.promisifier;\\\\n    if (typeof promisifier !== \\"function\\") promisifier = makeNodePromisified;\\\\n\\\\n    if (!util.isIdentifier(suffix)) {\\\\n        throw new RangeError(\\"suffix must be a valid identifier\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n\\\\n    var keys = util.inheritedDataKeys(target);\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var value = target[keys[i]];\\\\n        if (keys[i] !== \\"constructor\\" &&\\\\n            util.isClass(value)) {\\\\n            promisifyAll(value.prototype, suffix, filter, promisifier,\\\\n                multiArgs);\\\\n            promisifyAll(value, suffix, filter, promisifier, multiArgs);\\\\n        }\\\\n    }\\\\n\\\\n    return promisifyAll(target, suffix, filter, promisifier, multiArgs);\\\\n};\\\\n};\\\\n\\\\n\\\\n},{\\"./errors\\":12,\\"./nodeback\\":20,\\"./util\\":36}],25:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(\\\\n    Promise, PromiseArray, tryConvertToPromise, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar isObject = util.isObject;\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar Es6Map;\\\\nif (typeof Map === \\"function\\") Es6Map = Map;\\\\n\\\\nvar mapToEntries = (function() {\\\\n    var index = 0;\\\\n    var size = 0;\\\\n\\\\n    function extractEntry(value, key) {\\\\n        this[index] = value;\\\\n        this[index + size] = key;\\\\n        index++;\\\\n    }\\\\n\\\\n    return function mapToEntries(map) {\\\\n        size = map.size;\\\\n        index = 0;\\\\n        var ret = new Array(map.size * 2);\\\\n        map.forEach(extractEntry, ret);\\\\n        return ret;\\\\n    };\\\\n})();\\\\n\\\\nvar entriesToMap = function(entries) {\\\\n    var ret = new Es6Map();\\\\n    var length = entries.length / 2 | 0;\\\\n    for (var i = 0; i < length; ++i) {\\\\n        var key = entries[length + i];\\\\n        var value = entries[i];\\\\n        ret.set(key, value);\\\\n    }\\\\n    return ret;\\\\n};\\\\n\\\\nfunction PropertiesPromiseArray(obj) {\\\\n    var isMap = false;\\\\n    var entries;\\\\n    if (Es6Map !== undefined && obj instanceof Es6Map) {\\\\n        entries = mapToEntries(obj);\\\\n        isMap = true;\\\\n    } else {\\\\n        var keys = es5.keys(obj);\\\\n        var len = keys.length;\\\\n        entries = new Array(len * 2);\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var key = keys[i];\\\\n            entries[i] = obj[key];\\\\n            entries[i + len] = key;\\\\n        }\\\\n    }\\\\n    this.constructor$(entries);\\\\n    this._isMap = isMap;\\\\n    this._init$(undefined, -3);\\\\n}\\\\nutil.inherits(PropertiesPromiseArray, PromiseArray);\\\\n\\\\nPropertiesPromiseArray.prototype._init = function () {};\\\\n\\\\nPropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    this._values[index] = value;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        var val;\\\\n        if (this._isMap) {\\\\n            val = entriesToMap(this._values);\\\\n        } else {\\\\n            val = {};\\\\n            var keyOffset = this.length();\\\\n            for (var i = 0, len = this.length(); i < len; ++i) {\\\\n                val[this._values[i + keyOffset]] = this._values[i];\\\\n            }\\\\n        }\\\\n        this._resolve(val);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nPropertiesPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return false;\\\\n};\\\\n\\\\nPropertiesPromiseArray.prototype.getActualLength = function (len) {\\\\n    return len >> 1;\\\\n};\\\\n\\\\nfunction props(promises) {\\\\n    var ret;\\\\n    var castValue = tryConvertToPromise(promises);\\\\n\\\\n    if (!isObject(castValue)) {\\\\n        return apiRejection(\\"cannot await properties of a non-object\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    } else if (castValue instanceof Promise) {\\\\n        ret = castValue._then(\\\\n            Promise.props, undefined, undefined, undefined, undefined);\\\\n    } else {\\\\n        ret = new PropertiesPromiseArray(castValue).promise();\\\\n    }\\\\n\\\\n    if (castValue instanceof Promise) {\\\\n        ret._propagateFrom(castValue, 2);\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nPromise.prototype.props = function () {\\\\n    return props(this);\\\\n};\\\\n\\\\nPromise.props = function (promises) {\\\\n    return props(promises);\\\\n};\\\\n};\\\\n\\\\n},{\\"./es5\\":13,\\"./util\\":36}],26:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nfunction arrayMove(src, srcIndex, dst, dstIndex, len) {\\\\n    for (var j = 0; j < len; ++j) {\\\\n        dst[j + dstIndex] = src[j + srcIndex];\\\\n        src[j + srcIndex] = void 0;\\\\n    }\\\\n}\\\\n\\\\nfunction Queue(capacity) {\\\\n    this._capacity = capacity;\\\\n    this._length = 0;\\\\n    this._front = 0;\\\\n}\\\\n\\\\nQueue.prototype._willBeOverCapacity = function (size) {\\\\n    return this._capacity < size;\\\\n};\\\\n\\\\nQueue.prototype._pushOne = function (arg) {\\\\n    var length = this.length();\\\\n    this._checkCapacity(length + 1);\\\\n    var i = (this._front + length) & (this._capacity - 1);\\\\n    this[i] = arg;\\\\n    this._length = length + 1;\\\\n};\\\\n\\\\nQueue.prototype._unshiftOne = function(value) {\\\\n    var capacity = this._capacity;\\\\n    this._checkCapacity(this.length() + 1);\\\\n    var front = this._front;\\\\n    var i = (((( front - 1 ) &\\\\n                    ( capacity - 1) ) ^ capacity ) - capacity );\\\\n    this[i] = value;\\\\n    this._front = i;\\\\n    this._length = this.length() + 1;\\\\n};\\\\n\\\\nQueue.prototype.unshift = function(fn, receiver, arg) {\\\\n    this._unshiftOne(arg);\\\\n    this._unshiftOne(receiver);\\\\n    this._unshiftOne(fn);\\\\n};\\\\n\\\\nQueue.prototype.push = function (fn, receiver, arg) {\\\\n    var length = this.length() + 3;\\\\n    if (this._willBeOverCapacity(length)) {\\\\n        this._pushOne(fn);\\\\n        this._pushOne(receiver);\\\\n        this._pushOne(arg);\\\\n        return;\\\\n    }\\\\n    var j = this._front + length - 3;\\\\n    this._checkCapacity(length);\\\\n    var wrapMask = this._capacity - 1;\\\\n    this[(j + 0) & wrapMask] = fn;\\\\n    this[(j + 1) & wrapMask] = receiver;\\\\n    this[(j + 2) & wrapMask] = arg;\\\\n    this._length = length;\\\\n};\\\\n\\\\nQueue.prototype.shift = function () {\\\\n    var front = this._front,\\\\n        ret = this[front];\\\\n\\\\n    this[front] = undefined;\\\\n    this._front = (front + 1) & (this._capacity - 1);\\\\n    this._length--;\\\\n    return ret;\\\\n};\\\\n\\\\nQueue.prototype.length = function () {\\\\n    return this._length;\\\\n};\\\\n\\\\nQueue.prototype._checkCapacity = function (size) {\\\\n    if (this._capacity < size) {\\\\n        this._resizeTo(this._capacity << 1);\\\\n    }\\\\n};\\\\n\\\\nQueue.prototype._resizeTo = function (capacity) {\\\\n    var oldCapacity = this._capacity;\\\\n    this._capacity = capacity;\\\\n    var front = this._front;\\\\n    var length = this._length;\\\\n    var moveItemsCount = (front + length) & (oldCapacity - 1);\\\\n    arrayMove(this, 0, this, oldCapacity, moveItemsCount);\\\\n};\\\\n\\\\nmodule.exports = Queue;\\\\n\\\\n},{}],27:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(\\\\n    Promise, INTERNAL, tryConvertToPromise, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nvar raceLater = function (promise) {\\\\n    return promise.then(function(array) {\\\\n        return race(array, promise);\\\\n    });\\\\n};\\\\n\\\\nfunction race(promises, parent) {\\\\n    var maybePromise = tryConvertToPromise(promises);\\\\n\\\\n    if (maybePromise instanceof Promise) {\\\\n        return raceLater(maybePromise);\\\\n    } else {\\\\n        promises = util.asArray(promises);\\\\n        if (promises === null)\\\\n            return apiRejection(\\"expecting an array or an iterable object but got \\" + util.classString(promises));\\\\n    }\\\\n\\\\n    var ret = new Promise(INTERNAL);\\\\n    if (parent !== undefined) {\\\\n        ret._propagateFrom(parent, 3);\\\\n    }\\\\n    var fulfill = ret._fulfill;\\\\n    var reject = ret._reject;\\\\n    for (var i = 0, len = promises.length; i < len; ++i) {\\\\n        var val = promises[i];\\\\n\\\\n        if (val === undefined && !(i in promises)) {\\\\n            continue;\\\\n        }\\\\n\\\\n        Promise.cast(val)._then(fulfill, reject, undefined, ret, null);\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nPromise.race = function (promises) {\\\\n    return race(promises, undefined);\\\\n};\\\\n\\\\nPromise.prototype.race = function () {\\\\n    return race(this, undefined);\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],28:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise,\\\\n                          PromiseArray,\\\\n                          apiRejection,\\\\n                          tryConvertToPromise,\\\\n                          INTERNAL,\\\\n                          debug) {\\\\nvar getDomain = Promise._getDomain;\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar tryCatch = util.tryCatch;\\\\n\\\\nfunction ReductionPromiseArray(promises, fn, initialValue, _each) {\\\\n    this.constructor$(promises);\\\\n    var domain = getDomain();\\\\n    this._fn = domain === null ? fn : domain.bind(fn);\\\\n    if (initialValue !== undefined) {\\\\n        initialValue = Promise.resolve(initialValue);\\\\n        initialValue._attachCancellationCallback(this);\\\\n    }\\\\n    this._initialValue = initialValue;\\\\n    this._currentCancellable = null;\\\\n    this._eachValues = _each === INTERNAL ? [] : undefined;\\\\n    this._promise._captureStackTrace();\\\\n    this._init$(undefined, -5);\\\\n}\\\\nutil.inherits(ReductionPromiseArray, PromiseArray);\\\\n\\\\nReductionPromiseArray.prototype._gotAccum = function(accum) {\\\\n    if (this._eachValues !== undefined && accum !== INTERNAL) {\\\\n        this._eachValues.push(accum);\\\\n    }\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._eachComplete = function(value) {\\\\n    this._eachValues.push(value);\\\\n    return this._eachValues;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._init = function() {};\\\\n\\\\nReductionPromiseArray.prototype._resolveEmptyArray = function() {\\\\n    this._resolve(this._eachValues !== undefined ? this._eachValues\\\\n                                                 : this._initialValue);\\\\n};\\\\n\\\\nReductionPromiseArray.prototype.shouldCopyValues = function () {\\\\n    return false;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._resolve = function(value) {\\\\n    this._promise._resolveCallback(value);\\\\n    this._values = null;\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._resultCancelled = function(sender) {\\\\n    if (sender === this._initialValue) return this._cancel();\\\\n    if (this._isResolved()) return;\\\\n    this._resultCancelled$();\\\\n    if (this._currentCancellable instanceof Promise) {\\\\n        this._currentCancellable.cancel();\\\\n    }\\\\n    if (this._initialValue instanceof Promise) {\\\\n        this._initialValue.cancel();\\\\n    }\\\\n};\\\\n\\\\nReductionPromiseArray.prototype._iterate = function (values) {\\\\n    this._values = values;\\\\n    var value;\\\\n    var i;\\\\n    var length = values.length;\\\\n    if (this._initialValue !== undefined) {\\\\n        value = this._initialValue;\\\\n        i = 0;\\\\n    } else {\\\\n        value = Promise.resolve(values[0]);\\\\n        i = 1;\\\\n    }\\\\n\\\\n    this._currentCancellable = value;\\\\n\\\\n    if (!value.isRejected()) {\\\\n        for (; i < length; ++i) {\\\\n            var ctx = {\\\\n                accum: null,\\\\n                value: values[i],\\\\n                index: i,\\\\n                length: length,\\\\n                array: this\\\\n            };\\\\n            value = value._then(gotAccum, undefined, undefined, ctx, undefined);\\\\n        }\\\\n    }\\\\n\\\\n    if (this._eachValues !== undefined) {\\\\n        value = value\\\\n            ._then(this._eachComplete, undefined, undefined, this, undefined);\\\\n    }\\\\n    value._then(completed, completed, undefined, value, this);\\\\n};\\\\n\\\\nPromise.prototype.reduce = function (fn, initialValue) {\\\\n    return reduce(this, fn, initialValue, null);\\\\n};\\\\n\\\\nPromise.reduce = function (promises, fn, initialValue, _each) {\\\\n    return reduce(promises, fn, initialValue, _each);\\\\n};\\\\n\\\\nfunction completed(valueOrReason, array) {\\\\n    if (this.isFulfilled()) {\\\\n        array._resolve(valueOrReason);\\\\n    } else {\\\\n        array._reject(valueOrReason);\\\\n    }\\\\n}\\\\n\\\\nfunction reduce(promises, fn, initialValue, _each) {\\\\n    if (typeof fn !== \\"function\\") {\\\\n        return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n    }\\\\n    var array = new ReductionPromiseArray(promises, fn, initialValue, _each);\\\\n    return array.promise();\\\\n}\\\\n\\\\nfunction gotAccum(accum) {\\\\n    this.accum = accum;\\\\n    this.array._gotAccum(accum);\\\\n    var value = tryConvertToPromise(this.value, this.array._promise);\\\\n    if (value instanceof Promise) {\\\\n        this.array._currentCancellable = value;\\\\n        return value._then(gotValue, undefined, undefined, this, undefined);\\\\n    } else {\\\\n        return gotValue.call(this, value);\\\\n    }\\\\n}\\\\n\\\\nfunction gotValue(value) {\\\\n    var array = this.array;\\\\n    var promise = array._promise;\\\\n    var fn = tryCatch(array._fn);\\\\n    promise._pushContext();\\\\n    var ret;\\\\n    if (array._eachValues !== undefined) {\\\\n        ret = fn.call(promise._boundValue(), value, this.index, this.length);\\\\n    } else {\\\\n        ret = fn.call(promise._boundValue(),\\\\n                              this.accum, value, this.index, this.length);\\\\n    }\\\\n    if (ret instanceof Promise) {\\\\n        array._currentCancellable = ret;\\\\n    }\\\\n    var promiseCreated = promise._popContext();\\\\n    debug.checkForgottenReturns(\\\\n        ret,\\\\n        promiseCreated,\\\\n        array._eachValues !== undefined ? \\"Promise.each\\" : \\"Promise.reduce\\",\\\\n        promise\\\\n    );\\\\n    return ret;\\\\n}\\\\n};\\\\n\\\\n},{\\"./util\\":36}],29:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar schedule;\\\\nvar noAsyncScheduler = function() {\\\\n    throw new Error(\\"No async scheduler available\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n};\\\\nif (util.isNode && typeof MutationObserver === \\"undefined\\") {\\\\n    var GlobalSetImmediate = global.setImmediate;\\\\n    var ProcessNextTick = process.nextTick;\\\\n    schedule = util.isRecentNode\\\\n                ? function(fn) { GlobalSetImmediate.call(global, fn); }\\\\n                : function(fn) { ProcessNextTick.call(process, fn); };\\\\n} else if ((typeof MutationObserver !== \\"undefined\\") &&\\\\n          !(typeof window !== \\"undefined\\" &&\\\\n            window.navigator &&\\\\n            window.navigator.standalone)) {\\\\n    schedule = (function() {\\\\n        var div = document.createElement(\\"div\\");\\\\n        var opts = {attributes: true};\\\\n        var toggleScheduled = false;\\\\n        var div2 = document.createElement(\\"div\\");\\\\n        var o2 = new MutationObserver(function() {\\\\n            div.classList.toggle(\\"foo\\");\\\\n          toggleScheduled = false;\\\\n        });\\\\n        o2.observe(div2, opts);\\\\n\\\\n        var scheduleToggle = function() {\\\\n            if (toggleScheduled) return;\\\\n          toggleScheduled = true;\\\\n          div2.classList.toggle(\\"foo\\");\\\\n        };\\\\n\\\\n        return function schedule(fn) {\\\\n          var o = new MutationObserver(function() {\\\\n            o.disconnect();\\\\n            fn();\\\\n          });\\\\n          o.observe(div, opts);\\\\n          scheduleToggle();\\\\n        };\\\\n    })();\\\\n} else if (typeof setImmediate !== \\"undefined\\") {\\\\n    schedule = function (fn) {\\\\n        setImmediate(fn);\\\\n    };\\\\n} else if (typeof setTimeout !== \\"undefined\\") {\\\\n    schedule = function (fn) {\\\\n        setTimeout(fn, 0);\\\\n    };\\\\n} else {\\\\n    schedule = noAsyncScheduler;\\\\n}\\\\nmodule.exports = schedule;\\\\n\\\\n},{\\"./util\\":36}],30:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\n    function(Promise, PromiseArray, debug) {\\\\nvar PromiseInspection = Promise.PromiseInspection;\\\\nvar util = _dereq_(\\"./util\\");\\\\n\\\\nfunction SettledPromiseArray(values) {\\\\n    this.constructor$(values);\\\\n}\\\\nutil.inherits(SettledPromiseArray, PromiseArray);\\\\n\\\\nSettledPromiseArray.prototype._promiseResolved = function (index, inspection) {\\\\n    this._values[index] = inspection;\\\\n    var totalResolved = ++this._totalResolved;\\\\n    if (totalResolved >= this._length) {\\\\n        this._resolve(this._values);\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nSettledPromiseArray.prototype._promiseFulfilled = function (value, index) {\\\\n    var ret = new PromiseInspection();\\\\n    ret._bitField = 33554432;\\\\n    ret._settledValueField = value;\\\\n    return this._promiseResolved(index, ret);\\\\n};\\\\nSettledPromiseArray.prototype._promiseRejected = function (reason, index) {\\\\n    var ret = new PromiseInspection();\\\\n    ret._bitField = 16777216;\\\\n    ret._settledValueField = reason;\\\\n    return this._promiseResolved(index, ret);\\\\n};\\\\n\\\\nPromise.settle = function (promises) {\\\\n    debug.deprecated(\\".settle()\\", \\".reflect()\\");\\\\n    return new SettledPromiseArray(promises).promise();\\\\n};\\\\n\\\\nPromise.prototype.settle = function () {\\\\n    return Promise.settle(this);\\\\n};\\\\n};\\\\n\\\\n},{\\"./util\\":36}],31:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports =\\\\nfunction(Promise, PromiseArray, apiRejection) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar RangeError = _dereq_(\\"./errors\\").RangeError;\\\\nvar AggregateError = _dereq_(\\"./errors\\").AggregateError;\\\\nvar isArray = util.isArray;\\\\nvar CANCELLATION = {};\\\\n\\\\n\\\\nfunction SomePromiseArray(values) {\\\\n    this.constructor$(values);\\\\n    this._howMany = 0;\\\\n    this._unwrap = false;\\\\n    this._initialized = false;\\\\n}\\\\nutil.inherits(SomePromiseArray, PromiseArray);\\\\n\\\\nSomePromiseArray.prototype._init = function () {\\\\n    if (!this._initialized) {\\\\n        return;\\\\n    }\\\\n    if (this._howMany === 0) {\\\\n        this._resolve([]);\\\\n        return;\\\\n    }\\\\n    this._init$(undefined, -5);\\\\n    var isArrayResolved = isArray(this._values);\\\\n    if (!this._isResolved() &&\\\\n        isArrayResolved &&\\\\n        this._howMany > this._canPossiblyFulfill()) {\\\\n        this._reject(this._getRangeError(this.length()));\\\\n    }\\\\n};\\\\n\\\\nSomePromiseArray.prototype.init = function () {\\\\n    this._initialized = true;\\\\n    this._init();\\\\n};\\\\n\\\\nSomePromiseArray.prototype.setUnwrap = function () {\\\\n    this._unwrap = true;\\\\n};\\\\n\\\\nSomePromiseArray.prototype.howMany = function () {\\\\n    return this._howMany;\\\\n};\\\\n\\\\nSomePromiseArray.prototype.setHowMany = function (count) {\\\\n    this._howMany = count;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._promiseFulfilled = function (value) {\\\\n    this._addFulfilled(value);\\\\n    if (this._fulfilled() === this.howMany()) {\\\\n        this._values.length = this.howMany();\\\\n        if (this.howMany() === 1 && this._unwrap) {\\\\n            this._resolve(this._values[0]);\\\\n        } else {\\\\n            this._resolve(this._values);\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n\\\\n};\\\\nSomePromiseArray.prototype._promiseRejected = function (reason) {\\\\n    this._addRejected(reason);\\\\n    return this._checkOutcome();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._promiseCancelled = function () {\\\\n    if (this._values instanceof Promise || this._values == null) {\\\\n        return this._cancel();\\\\n    }\\\\n    this._addRejected(CANCELLATION);\\\\n    return this._checkOutcome();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._checkOutcome = function() {\\\\n    if (this.howMany() > this._canPossiblyFulfill()) {\\\\n        var e = new AggregateError();\\\\n        for (var i = this.length(); i < this._values.length; ++i) {\\\\n            if (this._values[i] !== CANCELLATION) {\\\\n                e.push(this._values[i]);\\\\n            }\\\\n        }\\\\n        if (e.length > 0) {\\\\n            this._reject(e);\\\\n        } else {\\\\n            this._cancel();\\\\n        }\\\\n        return true;\\\\n    }\\\\n    return false;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._fulfilled = function () {\\\\n    return this._totalResolved;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._rejected = function () {\\\\n    return this._values.length - this.length();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._addRejected = function (reason) {\\\\n    this._values.push(reason);\\\\n};\\\\n\\\\nSomePromiseArray.prototype._addFulfilled = function (value) {\\\\n    this._values[this._totalResolved++] = value;\\\\n};\\\\n\\\\nSomePromiseArray.prototype._canPossiblyFulfill = function () {\\\\n    return this.length() - this._rejected();\\\\n};\\\\n\\\\nSomePromiseArray.prototype._getRangeError = function (count) {\\\\n    var message = \\"Input array must contain at least \\" +\\\\n            this._howMany + \\" items but contains only \\" + count + \\" items\\";\\\\n    return new RangeError(message);\\\\n};\\\\n\\\\nSomePromiseArray.prototype._resolveEmptyArray = function () {\\\\n    this._reject(this._getRangeError(0));\\\\n};\\\\n\\\\nfunction some(promises, howMany) {\\\\n    if ((howMany | 0) !== howMany || howMany < 0) {\\\\n        return apiRejection(\\"expecting a positive integer\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    var ret = new SomePromiseArray(promises);\\\\n    var promise = ret.promise();\\\\n    ret.setHowMany(howMany);\\\\n    ret.init();\\\\n    return promise;\\\\n}\\\\n\\\\nPromise.some = function (promises, howMany) {\\\\n    return some(promises, howMany);\\\\n};\\\\n\\\\nPromise.prototype.some = function (howMany) {\\\\n    return some(this, howMany);\\\\n};\\\\n\\\\nPromise._SomePromiseArray = SomePromiseArray;\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],32:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise) {\\\\nfunction PromiseInspection(promise) {\\\\n    if (promise !== undefined) {\\\\n        promise = promise._target();\\\\n        this._bitField = promise._bitField;\\\\n        this._settledValueField = promise._isFateSealed()\\\\n            ? promise._settledValue() : undefined;\\\\n    }\\\\n    else {\\\\n        this._bitField = 0;\\\\n        this._settledValueField = undefined;\\\\n    }\\\\n}\\\\n\\\\nPromiseInspection.prototype._settledValue = function() {\\\\n    return this._settledValueField;\\\\n};\\\\n\\\\nvar value = PromiseInspection.prototype.value = function () {\\\\n    if (!this.isFulfilled()) {\\\\n        throw new TypeError(\\"cannot get fulfillment value of a non-fulfilled promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nvar reason = PromiseInspection.prototype.error =\\\\nPromiseInspection.prototype.reason = function () {\\\\n    if (!this.isRejected()) {\\\\n        throw new TypeError(\\"cannot get rejection reason of a non-rejected promise\\\\\\\\u000a\\\\\\\\u000a    See http://goo.gl/MqrFmX\\\\\\\\u000a\\");\\\\n    }\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nvar isFulfilled = PromiseInspection.prototype.isFulfilled = function() {\\\\n    return (this._bitField & 33554432) !== 0;\\\\n};\\\\n\\\\nvar isRejected = PromiseInspection.prototype.isRejected = function () {\\\\n    return (this._bitField & 16777216) !== 0;\\\\n};\\\\n\\\\nvar isPending = PromiseInspection.prototype.isPending = function () {\\\\n    return (this._bitField & 50397184) === 0;\\\\n};\\\\n\\\\nvar isResolved = PromiseInspection.prototype.isResolved = function () {\\\\n    return (this._bitField & 50331648) !== 0;\\\\n};\\\\n\\\\nPromiseInspection.prototype.isCancelled =\\\\nPromise.prototype._isCancelled = function() {\\\\n    return (this._bitField & 65536) === 65536;\\\\n};\\\\n\\\\nPromise.prototype.isCancelled = function() {\\\\n    return this._target()._isCancelled();\\\\n};\\\\n\\\\nPromise.prototype.isPending = function() {\\\\n    return isPending.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isRejected = function() {\\\\n    return isRejected.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isFulfilled = function() {\\\\n    return isFulfilled.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.isResolved = function() {\\\\n    return isResolved.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.value = function() {\\\\n    return value.call(this._target());\\\\n};\\\\n\\\\nPromise.prototype.reason = function() {\\\\n    var target = this._target();\\\\n    target._unsetRejectionIsUnhandled();\\\\n    return reason.call(target);\\\\n};\\\\n\\\\nPromise.prototype._value = function() {\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nPromise.prototype._reason = function() {\\\\n    this._unsetRejectionIsUnhandled();\\\\n    return this._settledValue();\\\\n};\\\\n\\\\nPromise.PromiseInspection = PromiseInspection;\\\\n};\\\\n\\\\n},{}],33:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar errorObj = util.errorObj;\\\\nvar isObject = util.isObject;\\\\n\\\\nfunction tryConvertToPromise(obj, context) {\\\\n    if (isObject(obj)) {\\\\n        if (obj instanceof Promise) return obj;\\\\n        var then = getThen(obj);\\\\n        if (then === errorObj) {\\\\n            if (context) context._pushContext();\\\\n            var ret = Promise.reject(then.e);\\\\n            if (context) context._popContext();\\\\n            return ret;\\\\n        } else if (typeof then === \\"function\\") {\\\\n            if (isAnyBluebirdPromise(obj)) {\\\\n                var ret = new Promise(INTERNAL);\\\\n                obj._then(\\\\n                    ret._fulfill,\\\\n                    ret._reject,\\\\n                    undefined,\\\\n                    ret,\\\\n                    null\\\\n                );\\\\n                return ret;\\\\n            }\\\\n            return doThenable(obj, then, context);\\\\n        }\\\\n    }\\\\n    return obj;\\\\n}\\\\n\\\\nfunction doGetThen(obj) {\\\\n    return obj.then;\\\\n}\\\\n\\\\nfunction getThen(obj) {\\\\n    try {\\\\n        return doGetThen(obj);\\\\n    } catch (e) {\\\\n        errorObj.e = e;\\\\n        return errorObj;\\\\n    }\\\\n}\\\\n\\\\nvar hasProp = {}.hasOwnProperty;\\\\nfunction isAnyBluebirdPromise(obj) {\\\\n    return hasProp.call(obj, \\"_promise0\\");\\\\n}\\\\n\\\\nfunction doThenable(x, then, context) {\\\\n    var promise = new Promise(INTERNAL);\\\\n    var ret = promise;\\\\n    if (context) context._pushContext();\\\\n    promise._captureStackTrace();\\\\n    if (context) context._popContext();\\\\n    var synchronous = true;\\\\n    var result = util.tryCatch(then).call(x, resolve, reject);\\\\n    synchronous = false;\\\\n\\\\n    if (promise && result === errorObj) {\\\\n        promise._rejectCallback(result.e, true, true);\\\\n        promise = null;\\\\n    }\\\\n\\\\n    function resolve(value) {\\\\n        if (!promise) return;\\\\n        promise._resolveCallback(value);\\\\n        promise = null;\\\\n    }\\\\n\\\\n    function reject(reason) {\\\\n        if (!promise) return;\\\\n        promise._rejectCallback(reason, synchronous, true);\\\\n        promise = null;\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nreturn tryConvertToPromise;\\\\n};\\\\n\\\\n},{\\"./util\\":36}],34:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function(Promise, INTERNAL, debug) {\\\\nvar util = _dereq_(\\"./util\\");\\\\nvar TimeoutError = Promise.TimeoutError;\\\\n\\\\nfunction HandleWrapper(handle)  {\\\\n    this.handle = handle;\\\\n}\\\\n\\\\nHandleWrapper.prototype._resultCancelled = function() {\\\\n    clearTimeout(this.handle);\\\\n};\\\\n\\\\nvar afterValue = function(value) { return delay(+this).thenReturn(value); };\\\\nvar delay = Promise.delay = function (ms, value) {\\\\n    var ret;\\\\n    var handle;\\\\n    if (value !== undefined) {\\\\n        ret = Promise.resolve(value)\\\\n                ._then(afterValue, null, null, ms, undefined);\\\\n        if (debug.cancellation() && value instanceof Promise) {\\\\n            ret._setOnCancel(value);\\\\n        }\\\\n    } else {\\\\n        ret = new Promise(INTERNAL);\\\\n        handle = setTimeout(function() { ret._fulfill(); }, +ms);\\\\n        if (debug.cancellation()) {\\\\n            ret._setOnCancel(new HandleWrapper(handle));\\\\n        }\\\\n    }\\\\n    ret._setAsyncGuaranteed();\\\\n    return ret;\\\\n};\\\\n\\\\nPromise.prototype.delay = function (ms) {\\\\n    return delay(ms, this);\\\\n};\\\\n\\\\nvar afterTimeout = function (promise, message, parent) {\\\\n    var err;\\\\n    if (typeof message !== \\"string\\") {\\\\n        if (message instanceof Error) {\\\\n            err = message;\\\\n        } else {\\\\n            err = new TimeoutError(\\"operation timed out\\");\\\\n        }\\\\n    } else {\\\\n        err = new TimeoutError(message);\\\\n    }\\\\n    util.markAsOriginatingFromRejection(err);\\\\n    promise._attachExtraTrace(err);\\\\n    promise._reject(err);\\\\n\\\\n    if (parent != null) {\\\\n        parent.cancel();\\\\n    }\\\\n};\\\\n\\\\nfunction successClear(value) {\\\\n    clearTimeout(this.handle);\\\\n    return value;\\\\n}\\\\n\\\\nfunction failureClear(reason) {\\\\n    clearTimeout(this.handle);\\\\n    throw reason;\\\\n}\\\\n\\\\nPromise.prototype.timeout = function (ms, message) {\\\\n    ms = +ms;\\\\n    var ret, parent;\\\\n\\\\n    var handleWrapper = new HandleWrapper(setTimeout(function timeoutTimeout() {\\\\n        if (ret.isPending()) {\\\\n            afterTimeout(ret, message, parent);\\\\n        }\\\\n    }, ms));\\\\n\\\\n    if (debug.cancellation()) {\\\\n        parent = this.then();\\\\n        ret = parent._then(successClear, failureClear,\\\\n                            undefined, handleWrapper, undefined);\\\\n        ret._setOnCancel(handleWrapper);\\\\n    } else {\\\\n        ret = this._then(successClear, failureClear,\\\\n                            undefined, handleWrapper, undefined);\\\\n    }\\\\n\\\\n    return ret;\\\\n};\\\\n\\\\n};\\\\n\\\\n},{\\"./util\\":36}],35:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nmodule.exports = function (Promise, apiRejection, tryConvertToPromise,\\\\n    createContext, INTERNAL, debug) {\\\\n    var util = _dereq_(\\"./util\\");\\\\n    var TypeError = _dereq_(\\"./errors\\").TypeError;\\\\n    var inherits = _dereq_(\\"./util\\").inherits;\\\\n    var errorObj = util.errorObj;\\\\n    var tryCatch = util.tryCatch;\\\\n\\\\n    function thrower(e) {\\\\n        setTimeout(function(){throw e;}, 0);\\\\n    }\\\\n\\\\n    function castPreservingDisposable(thenable) {\\\\n        var maybePromise = tryConvertToPromise(thenable);\\\\n        if (maybePromise !== thenable &&\\\\n            typeof thenable._isDisposable === \\"function\\" &&\\\\n            typeof thenable._getDisposer === \\"function\\" &&\\\\n            thenable._isDisposable()) {\\\\n            maybePromise._setDisposable(thenable._getDisposer());\\\\n        }\\\\n        return maybePromise;\\\\n    }\\\\n    function dispose(resources, inspection) {\\\\n        var i = 0;\\\\n        var len = resources.length;\\\\n        var ret = new Promise(INTERNAL);\\\\n        function iterator() {\\\\n            if (i >= len) return ret._fulfill();\\\\n            var maybePromise = castPreservingDisposable(resources[i++]);\\\\n            if (maybePromise instanceof Promise &&\\\\n                maybePromise._isDisposable()) {\\\\n                try {\\\\n                    maybePromise = tryConvertToPromise(\\\\n                        maybePromise._getDisposer().tryDispose(inspection),\\\\n                        resources.promise);\\\\n                } catch (e) {\\\\n                    return thrower(e);\\\\n                }\\\\n                if (maybePromise instanceof Promise) {\\\\n                    return maybePromise._then(iterator, thrower,\\\\n                                              null, null, null);\\\\n                }\\\\n            }\\\\n            iterator();\\\\n        }\\\\n        iterator();\\\\n        return ret;\\\\n    }\\\\n\\\\n    function Disposer(data, promise, context) {\\\\n        this._data = data;\\\\n        this._promise = promise;\\\\n        this._context = context;\\\\n    }\\\\n\\\\n    Disposer.prototype.data = function () {\\\\n        return this._data;\\\\n    };\\\\n\\\\n    Disposer.prototype.promise = function () {\\\\n        return this._promise;\\\\n    };\\\\n\\\\n    Disposer.prototype.resource = function () {\\\\n        if (this.promise().isFulfilled()) {\\\\n            return this.promise().value();\\\\n        }\\\\n        return null;\\\\n    };\\\\n\\\\n    Disposer.prototype.tryDispose = function(inspection) {\\\\n        var resource = this.resource();\\\\n        var context = this._context;\\\\n        if (context !== undefined) context._pushContext();\\\\n        var ret = resource !== null\\\\n            ? this.doDispose(resource, inspection) : null;\\\\n        if (context !== undefined) context._popContext();\\\\n        this._promise._unsetDisposable();\\\\n        this._data = null;\\\\n        return ret;\\\\n    };\\\\n\\\\n    Disposer.isDisposer = function (d) {\\\\n        return (d != null &&\\\\n                typeof d.resource === \\"function\\" &&\\\\n                typeof d.tryDispose === \\"function\\");\\\\n    };\\\\n\\\\n    function FunctionDisposer(fn, promise, context) {\\\\n        this.constructor$(fn, promise, context);\\\\n    }\\\\n    inherits(FunctionDisposer, Disposer);\\\\n\\\\n    FunctionDisposer.prototype.doDispose = function (resource, inspection) {\\\\n        var fn = this.data();\\\\n        return fn.call(resource, resource, inspection);\\\\n    };\\\\n\\\\n    function maybeUnwrapDisposer(value) {\\\\n        if (Disposer.isDisposer(value)) {\\\\n            this.resources[this.index]._setDisposable(value);\\\\n            return value.promise();\\\\n        }\\\\n        return value;\\\\n    }\\\\n\\\\n    function ResourceList(length) {\\\\n        this.length = length;\\\\n        this.promise = null;\\\\n        this[length-1] = null;\\\\n    }\\\\n\\\\n    ResourceList.prototype._resultCancelled = function() {\\\\n        var len = this.length;\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var item = this[i];\\\\n            if (item instanceof Promise) {\\\\n                item.cancel();\\\\n            }\\\\n        }\\\\n    };\\\\n\\\\n    Promise.using = function () {\\\\n        var len = arguments.length;\\\\n        if (len < 2) return apiRejection(\\\\n                        \\"you must pass at least 2 arguments to Promise.using\\");\\\\n        var fn = arguments[len - 1];\\\\n        if (typeof fn !== \\"function\\") {\\\\n            return apiRejection(\\"expecting a function but got \\" + util.classString(fn));\\\\n        }\\\\n        var input;\\\\n        var spreadArgs = true;\\\\n        if (len === 2 && Array.isArray(arguments[0])) {\\\\n            input = arguments[0];\\\\n            len = input.length;\\\\n            spreadArgs = false;\\\\n        } else {\\\\n            input = arguments;\\\\n            len--;\\\\n        }\\\\n        var resources = new ResourceList(len);\\\\n        for (var i = 0; i < len; ++i) {\\\\n            var resource = input[i];\\\\n            if (Disposer.isDisposer(resource)) {\\\\n                var disposer = resource;\\\\n                resource = resource.promise();\\\\n                resource._setDisposable(disposer);\\\\n            } else {\\\\n                var maybePromise = tryConvertToPromise(resource);\\\\n                if (maybePromise instanceof Promise) {\\\\n                    resource =\\\\n                        maybePromise._then(maybeUnwrapDisposer, null, null, {\\\\n                            resources: resources,\\\\n                            index: i\\\\n                    }, undefined);\\\\n                }\\\\n            }\\\\n            resources[i] = resource;\\\\n        }\\\\n\\\\n        var reflectedResources = new Array(resources.length);\\\\n        for (var i = 0; i < reflectedResources.length; ++i) {\\\\n            reflectedResources[i] = Promise.resolve(resources[i]).reflect();\\\\n        }\\\\n\\\\n        var resultPromise = Promise.all(reflectedResources)\\\\n            .then(function(inspections) {\\\\n                for (var i = 0; i < inspections.length; ++i) {\\\\n                    var inspection = inspections[i];\\\\n                    if (inspection.isRejected()) {\\\\n                        errorObj.e = inspection.error();\\\\n                        return errorObj;\\\\n                    } else if (!inspection.isFulfilled()) {\\\\n                        resultPromise.cancel();\\\\n                        return;\\\\n                    }\\\\n                    inspections[i] = inspection.value();\\\\n                }\\\\n                promise._pushContext();\\\\n\\\\n                fn = tryCatch(fn);\\\\n                var ret = spreadArgs\\\\n                    ? fn.apply(undefined, inspections) : fn(inspections);\\\\n                var promiseCreated = promise._popContext();\\\\n                debug.checkForgottenReturns(\\\\n                    ret, promiseCreated, \\"Promise.using\\", promise);\\\\n                return ret;\\\\n            });\\\\n\\\\n        var promise = resultPromise.lastly(function() {\\\\n            var inspection = new Promise.PromiseInspection(resultPromise);\\\\n            return dispose(resources, inspection);\\\\n        });\\\\n        resources.promise = promise;\\\\n        promise._setOnCancel(resources);\\\\n        return promise;\\\\n    };\\\\n\\\\n    Promise.prototype._setDisposable = function (disposer) {\\\\n        this._bitField = this._bitField | 131072;\\\\n        this._disposer = disposer;\\\\n    };\\\\n\\\\n    Promise.prototype._isDisposable = function () {\\\\n        return (this._bitField & 131072) > 0;\\\\n    };\\\\n\\\\n    Promise.prototype._getDisposer = function () {\\\\n        return this._disposer;\\\\n    };\\\\n\\\\n    Promise.prototype._unsetDisposable = function () {\\\\n        this._bitField = this._bitField & (~131072);\\\\n        this._disposer = undefined;\\\\n    };\\\\n\\\\n    Promise.prototype.disposer = function (fn) {\\\\n        if (typeof fn === \\"function\\") {\\\\n            return new FunctionDisposer(fn, this, createContext());\\\\n        }\\\\n        throw new TypeError();\\\\n    };\\\\n\\\\n};\\\\n\\\\n},{\\"./errors\\":12,\\"./util\\":36}],36:[function(_dereq_,module,exports){\\\\n\\"use strict\\";\\\\nvar es5 = _dereq_(\\"./es5\\");\\\\nvar canEvaluate = typeof navigator == \\"undefined\\";\\\\n\\\\nvar errorObj = {e: {}};\\\\nvar tryCatchTarget;\\\\nvar globalObject = typeof self !== \\"undefined\\" ? self :\\\\n    typeof window !== \\"undefined\\" ? window :\\\\n    typeof global !== \\"undefined\\" ? global :\\\\n    this !== undefined ? this : null;\\\\n\\\\nfunction tryCatcher() {\\\\n    try {\\\\n        var target = tryCatchTarget;\\\\n        tryCatchTarget = null;\\\\n        return target.apply(this, arguments);\\\\n    } catch (e) {\\\\n        errorObj.e = e;\\\\n        return errorObj;\\\\n    }\\\\n}\\\\nfunction tryCatch(fn) {\\\\n    tryCatchTarget = fn;\\\\n    return tryCatcher;\\\\n}\\\\n\\\\nvar inherits = function(Child, Parent) {\\\\n    var hasProp = {}.hasOwnProperty;\\\\n\\\\n    function T() {\\\\n        this.constructor = Child;\\\\n        this.constructor$ = Parent;\\\\n        for (var propertyName in Parent.prototype) {\\\\n            if (hasProp.call(Parent.prototype, propertyName) &&\\\\n                propertyName.charAt(propertyName.length-1) !== \\"$\\"\\\\n           ) {\\\\n                this[propertyName + \\"$\\"] = Parent.prototype[propertyName];\\\\n            }\\\\n        }\\\\n    }\\\\n    T.prototype = Parent.prototype;\\\\n    Child.prototype = new T();\\\\n    return Child.prototype;\\\\n};\\\\n\\\\n\\\\nfunction isPrimitive(val) {\\\\n    return val == null || val === true || val === false ||\\\\n        typeof val === \\"string\\" || typeof val === \\"number\\";\\\\n\\\\n}\\\\n\\\\nfunction isObject(value) {\\\\n    return typeof value === \\"function\\" ||\\\\n           typeof value === \\"object\\" && value !== null;\\\\n}\\\\n\\\\nfunction maybeWrapAsError(maybeError) {\\\\n    if (!isPrimitive(maybeError)) return maybeError;\\\\n\\\\n    return new Error(safeToString(maybeError));\\\\n}\\\\n\\\\nfunction withAppended(target, appendee) {\\\\n    var len = target.length;\\\\n    var ret = new Array(len + 1);\\\\n    var i;\\\\n    for (i = 0; i < len; ++i) {\\\\n        ret[i] = target[i];\\\\n    }\\\\n    ret[i] = appendee;\\\\n    return ret;\\\\n}\\\\n\\\\nfunction getDataPropertyOrDefault(obj, key, defaultValue) {\\\\n    if (es5.isES5) {\\\\n        var desc = Object.getOwnPropertyDescriptor(obj, key);\\\\n\\\\n        if (desc != null) {\\\\n            return desc.get == null && desc.set == null\\\\n                    ? desc.value\\\\n                    : defaultValue;\\\\n        }\\\\n    } else {\\\\n        return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined;\\\\n    }\\\\n}\\\\n\\\\nfunction notEnumerableProp(obj, name, value) {\\\\n    if (isPrimitive(obj)) return obj;\\\\n    var descriptor = {\\\\n        value: value,\\\\n        configurable: true,\\\\n        enumerable: false,\\\\n        writable: true\\\\n    };\\\\n    es5.defineProperty(obj, name, descriptor);\\\\n    return obj;\\\\n}\\\\n\\\\nfunction thrower(r) {\\\\n    throw r;\\\\n}\\\\n\\\\nvar inheritedDataKeys = (function() {\\\\n    var excludedPrototypes = [\\\\n        Array.prototype,\\\\n        Object.prototype,\\\\n        Function.prototype\\\\n    ];\\\\n\\\\n    var isExcludedProto = function(val) {\\\\n        for (var i = 0; i < excludedPrototypes.length; ++i) {\\\\n            if (excludedPrototypes[i] === val) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    };\\\\n\\\\n    if (es5.isES5) {\\\\n        var getKeys = Object.getOwnPropertyNames;\\\\n        return function(obj) {\\\\n            var ret = [];\\\\n            var visitedKeys = Object.create(null);\\\\n            while (obj != null && !isExcludedProto(obj)) {\\\\n                var keys;\\\\n                try {\\\\n                    keys = getKeys(obj);\\\\n                } catch (e) {\\\\n                    return ret;\\\\n                }\\\\n                for (var i = 0; i < keys.length; ++i) {\\\\n                    var key = keys[i];\\\\n                    if (visitedKeys[key]) continue;\\\\n                    visitedKeys[key] = true;\\\\n                    var desc = Object.getOwnPropertyDescriptor(obj, key);\\\\n                    if (desc != null && desc.get == null && desc.set == null) {\\\\n                        ret.push(key);\\\\n                    }\\\\n                }\\\\n                obj = es5.getPrototypeOf(obj);\\\\n            }\\\\n            return ret;\\\\n        };\\\\n    } else {\\\\n        var hasProp = {}.hasOwnProperty;\\\\n        return function(obj) {\\\\n            if (isExcludedProto(obj)) return [];\\\\n            var ret = [];\\\\n\\\\n            /*jshint forin:false */\\\\n            enumeration: for (var key in obj) {\\\\n                if (hasProp.call(obj, key)) {\\\\n                    ret.push(key);\\\\n                } else {\\\\n                    for (var i = 0; i < excludedPrototypes.length; ++i) {\\\\n                        if (hasProp.call(excludedPrototypes[i], key)) {\\\\n                            continue enumeration;\\\\n                        }\\\\n                    }\\\\n                    ret.push(key);\\\\n                }\\\\n            }\\\\n            return ret;\\\\n        };\\\\n    }\\\\n\\\\n})();\\\\n\\\\nvar thisAssignmentPattern = /this\\\\\\\\s*\\\\\\\\.\\\\\\\\s*\\\\\\\\S+\\\\\\\\s*=/;\\\\nfunction isClass(fn) {\\\\n    try {\\\\n        if (typeof fn === \\"function\\") {\\\\n            var keys = es5.names(fn.prototype);\\\\n\\\\n            var hasMethods = es5.isES5 && keys.length > 1;\\\\n            var hasMethodsOtherThanConstructor = keys.length > 0 &&\\\\n                !(keys.length === 1 && keys[0] === \\"constructor\\");\\\\n            var hasThisAssignmentAndStaticMethods =\\\\n                thisAssignmentPattern.test(fn + \\"\\") && es5.names(fn).length > 0;\\\\n\\\\n            if (hasMethods || hasMethodsOtherThanConstructor ||\\\\n                hasThisAssignmentAndStaticMethods) {\\\\n                return true;\\\\n            }\\\\n        }\\\\n        return false;\\\\n    } catch (e) {\\\\n        return false;\\\\n    }\\\\n}\\\\n\\\\nfunction toFastProperties(obj) {\\\\n    /*jshint -W027,-W055,-W031*/\\\\n    function FakeConstructor() {}\\\\n    FakeConstructor.prototype = obj;\\\\n    var l = 8;\\\\n    while (l--) new FakeConstructor();\\\\n    return obj;\\\\n    eval(obj);\\\\n}\\\\n\\\\nvar rident = /^[a-z$_][a-z$_0-9]*$/i;\\\\nfunction isIdentifier(str) {\\\\n    return rident.test(str);\\\\n}\\\\n\\\\nfunction filledRange(count, prefix, suffix) {\\\\n    var ret = new Array(count);\\\\n    for(var i = 0; i < count; ++i) {\\\\n        ret[i] = prefix + i + suffix;\\\\n    }\\\\n    return ret;\\\\n}\\\\n\\\\nfunction safeToString(obj) {\\\\n    try {\\\\n        return obj + \\"\\";\\\\n    } catch (e) {\\\\n        return \\"[no string representation]\\";\\\\n    }\\\\n}\\\\n\\\\nfunction isError(obj) {\\\\n    return obj !== null &&\\\\n           typeof obj === \\"object\\" &&\\\\n           typeof obj.message === \\"string\\" &&\\\\n           typeof obj.name === \\"string\\";\\\\n}\\\\n\\\\nfunction markAsOriginatingFromRejection(e) {\\\\n    try {\\\\n        notEnumerableProp(e, \\"isOperational\\", true);\\\\n    }\\\\n    catch(ignore) {}\\\\n}\\\\n\\\\nfunction originatesFromRejection(e) {\\\\n    if (e == null) return false;\\\\n    return ((e instanceof Error[\\"__BluebirdErrorTypes__\\"].OperationalError) ||\\\\n        e[\\"isOperational\\"] === true);\\\\n}\\\\n\\\\nfunction canAttachTrace(obj) {\\\\n    return isError(obj) && es5.propertyIsWritable(obj, \\"stack\\");\\\\n}\\\\n\\\\nvar ensureErrorObject = (function() {\\\\n    if (!(\\"stack\\" in new Error())) {\\\\n        return function(value) {\\\\n            if (canAttachTrace(value)) return value;\\\\n            try {throw new Error(safeToString(value));}\\\\n            catch(err) {return err;}\\\\n        };\\\\n    } else {\\\\n        return function(value) {\\\\n            if (canAttachTrace(value)) return value;\\\\n            return new Error(safeToString(value));\\\\n        };\\\\n    }\\\\n})();\\\\n\\\\nfunction classString(obj) {\\\\n    return {}.toString.call(obj);\\\\n}\\\\n\\\\nfunction copyDescriptors(from, to, filter) {\\\\n    var keys = es5.names(from);\\\\n    for (var i = 0; i < keys.length; ++i) {\\\\n        var key = keys[i];\\\\n        if (filter(key)) {\\\\n            try {\\\\n                es5.defineProperty(to, key, es5.getDescriptor(from, key));\\\\n            } catch (ignore) {}\\\\n        }\\\\n    }\\\\n}\\\\n\\\\nvar asArray = function(v) {\\\\n    if (es5.isArray(v)) {\\\\n        return v;\\\\n    }\\\\n    return null;\\\\n};\\\\n\\\\nif (typeof Symbol !== \\"undefined\\" && Symbol.iterator) {\\\\n    var ArrayFrom = typeof Array.from === \\"function\\" ? function(v) {\\\\n        return Array.from(v);\\\\n    } : function(v) {\\\\n        var ret = [];\\\\n        var it = v[Symbol.iterator]();\\\\n        var itResult;\\\\n        while (!((itResult = it.next()).done)) {\\\\n            ret.push(itResult.value);\\\\n        }\\\\n        return ret;\\\\n    };\\\\n\\\\n    asArray = function(v) {\\\\n        if (es5.isArray(v)) {\\\\n            return v;\\\\n        } else if (v != null && typeof v[Symbol.iterator] === \\"function\\") {\\\\n            return ArrayFrom(v);\\\\n        }\\\\n        return null;\\\\n    };\\\\n}\\\\n\\\\nvar isNode = typeof process !== \\"undefined\\" &&\\\\n        classString(process).toLowerCase() === \\"[object process]\\";\\\\n\\\\nfunction env(key, def) {\\\\n    return isNode ? __webpack_require__.i({\\"NODE_ENV\\":\\"production\\",\\"DC_NETWORK\\":\\"ropsten\\",\\"PUBLIC_URL\\":\\"\\"})[key] : def;\\\\n}\\\\n\\\\nvar ret = {\\\\n    isClass: isClass,\\\\n    isIdentifier: isIdentifier,\\\\n    inheritedDataKeys: inheritedDataKeys,\\\\n    getDataPropertyOrDefault: getDataPropertyOrDefault,\\\\n    thrower: thrower,\\\\n    isArray: es5.isArray,\\\\n    asArray: asArray,\\\\n    notEnumerableProp: notEnumerableProp,\\\\n    isPrimitive: isPrimitive,\\\\n    isObject: isObject,\\\\n    isError: isError,\\\\n    canEvaluate: canEvaluate,\\\\n    errorObj: errorObj,\\\\n    tryCatch: tryCatch,\\\\n    inherits: inherits,\\\\n    withAppended: withAppended,\\\\n    maybeWrapAsError: maybeWrapAsError,\\\\n    toFastProperties: toFastProperties,\\\\n    filledRange: filledRange,\\\\n    toString: safeToString,\\\\n    canAttachTrace: canAttachTrace,\\\\n    ensureErrorObject: ensureErrorObject,\\\\n    originatesFromRejection: originatesFromRejection,\\\\n    markAsOriginatingFromRejection: markAsOriginatingFromRejection,\\\\n    classString: classString,\\\\n    copyDescriptors: copyDescriptors,\\\\n    hasDevTools: typeof chrome !== \\"undefined\\" && chrome &&\\\\n                 typeof chrome.loadTimes === \\"function\\",\\\\n    isNode: isNode,\\\\n    env: env,\\\\n    global: globalObject\\\\n};\\\\nret.isRecentNode = ret.isNode && (function() {\\\\n    var version = process.versions.node.split(\\".\\").map(Number);\\\\n    return (version[0] === 0 && version[1] > 10) || (version[0] > 0);\\\\n})();\\\\n\\\\nif (ret.isNode) ret.toFastProperties(process);\\\\n\\\\ntry {throw new Error(); } catch (e) {ret.lastLineError = e;}\\\\nmodule.exports = ret;\\\\n\\\\n},{\\"./es5\\":13}]},{},[4])(4)\\\\n});                    ;if (typeof window !== \\\\\'undefined\\\\\' && window !== null) {                               window.P = window.Promise;                                                     } else if (typeof self !== \\\\\'undefined\\\\\' && self !== null) {                             self.P = self.Promise;                                                         }\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(13), __webpack_require__(4), __webpack_require__(53).setImmediate))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/bluebird/js/browser/bluebird.js\\\\n// module id = 351\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/bluebird/js/browser/bluebird.js\')},function(module,exports){eval(\\"var generate = function generate(num, fn) {\\\\n  var a = [];\\\\n  for (var i = 0; i < num; ++i) {\\\\n    a.push(fn(i));\\\\n  }return a;\\\\n};\\\\n\\\\nvar replicate = function replicate(num, val) {\\\\n  return generate(num, function () {\\\\n    return val;\\\\n  });\\\\n};\\\\n\\\\nvar concat = function concat(a, b) {\\\\n  return a.concat(b);\\\\n};\\\\n\\\\nvar flatten = function flatten(a) {\\\\n  var r = [];\\\\n  for (var j = 0, J = a.length; j < J; ++j) {\\\\n    for (var i = 0, I = a[j].length; i < I; ++i) {\\\\n      r.push(a[j][i]);\\\\n    }\\\\n  }return r;\\\\n};\\\\n\\\\nvar chunksOf = function chunksOf(n, a) {\\\\n  var b = [];\\\\n  for (var i = 0, l = a.length; i < l; i += n) {\\\\n    b.push(a.slice(i, i + n));\\\\n  }return b;\\\\n};\\\\n\\\\nmodule.exports = {\\\\n  generate: generate,\\\\n  replicate: replicate,\\\\n  concat: concat,\\\\n  flatten: flatten,\\\\n  chunksOf: chunksOf\\\\n};\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/eth-lib/lib/array.js\\\\n// module id = 352\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/eth-lib/lib/array.js\\")},function(module,exports,__webpack_require__){eval(\\"/* WEBPACK VAR INJECTION */(function(global) {\\\\nvar rng;\\\\n\\\\nif (global.crypto && crypto.getRandomValues) {\\\\n  // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\\\\n  // Moderately fast, high quality\\\\n  var _rnds8 = new Uint8Array(16);\\\\n  rng = function whatwgRNG() {\\\\n    crypto.getRandomValues(_rnds8);\\\\n    return _rnds8;\\\\n  };\\\\n}\\\\n\\\\nif (!rng) {\\\\n  // Math.random()-based (RNG)\\\\n  //\\\\n  // If all else fails, use Math.random().  It\'s fast, but is of unspecified\\\\n  // quality.\\\\n  var  _rnds = new Array(16);\\\\n  rng = function() {\\\\n    for (var i = 0, r; i < 16; i++) {\\\\n      if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\\\\n      _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\\\\n    }\\\\n\\\\n    return _rnds;\\\\n  };\\\\n}\\\\n\\\\nmodule.exports = rng;\\\\n\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/uuid/rng-browser.js\\\\n// module id = 353\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/uuid/rng-browser.js\\")},function(module,exports,__webpack_require__){eval(\\"//     uuid.js\\\\n//\\\\n//     Copyright (c) 2010-2012 Robert Kieffer\\\\n//     MIT License - http://opensource.org/licenses/mit-license.php\\\\n\\\\n// Unique ID creation requires a high quality random # generator.  We feature\\\\n// detect to determine the best RNG source, normalizing to a function that\\\\n// returns 128-bits of randomness, since that\'s what\'s usually required\\\\nvar _rng = __webpack_require__(353);\\\\n\\\\n// Maps for number <-> hex string conversion\\\\nvar _byteToHex = [];\\\\nvar _hexToByte = {};\\\\nfor (var i = 0; i < 256; i++) {\\\\n  _byteToHex[i] = (i + 0x100).toString(16).substr(1);\\\\n  _hexToByte[_byteToHex[i]] = i;\\\\n}\\\\n\\\\n// **`parse()` - Parse a UUID into it\'s component bytes**\\\\nfunction parse(s, buf, offset) {\\\\n  var i = (buf && offset) || 0, ii = 0;\\\\n\\\\n  buf = buf || [];\\\\n  s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {\\\\n    if (ii < 16) { // Don\'t overflow!\\\\n      buf[i + ii++] = _hexToByte[oct];\\\\n    }\\\\n  });\\\\n\\\\n  // Zero out remaining bytes if string was short\\\\n  while (ii < 16) {\\\\n    buf[i + ii++] = 0;\\\\n  }\\\\n\\\\n  return buf;\\\\n}\\\\n\\\\n// **`unparse()` - Convert UUID byte array (ala parse()) into a string**\\\\nfunction unparse(buf, offset) {\\\\n  var i = offset || 0, bth = _byteToHex;\\\\n  return  bth[buf[i++]] + bth[buf[i++]] +\\\\n          bth[buf[i++]] + bth[buf[i++]] + \'-\' +\\\\n          bth[buf[i++]] + bth[buf[i++]] + \'-\' +\\\\n          bth[buf[i++]] + bth[buf[i++]] + \'-\' +\\\\n          bth[buf[i++]] + bth[buf[i++]] + \'-\' +\\\\n          bth[buf[i++]] + bth[buf[i++]] +\\\\n          bth[buf[i++]] + bth[buf[i++]] +\\\\n          bth[buf[i++]] + bth[buf[i++]];\\\\n}\\\\n\\\\n// **`v1()` - Generate time-based UUID**\\\\n//\\\\n// Inspired by https://github.com/LiosK/UUID.js\\\\n// and http://docs.python.org/library/uuid.html\\\\n\\\\n// random #\'s we need to init node and clockseq\\\\nvar _seedBytes = _rng();\\\\n\\\\n// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\\\\nvar _nodeId = [\\\\n  _seedBytes[0] | 0x01,\\\\n  _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\\\\n];\\\\n\\\\n// Per 4.2.2, randomize (14 bit) clockseq\\\\nvar _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\\\\n\\\\n// Previous uuid creation time\\\\nvar _lastMSecs = 0, _lastNSecs = 0;\\\\n\\\\n// See https://github.com/broofa/node-uuid for API details\\\\nfunction v1(options, buf, offset) {\\\\n  var i = buf && offset || 0;\\\\n  var b = buf || [];\\\\n\\\\n  options = options || {};\\\\n\\\\n  var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\\\\n\\\\n  // UUID timestamps are 100 nano-second units since the Gregorian epoch,\\\\n  // (1582-10-15 00:00).  JSNumbers aren\'t precise enough for this, so\\\\n  // time is handled internally as \'msecs\' (integer milliseconds) and \'nsecs\'\\\\n  // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\\\\n  var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\\\\n\\\\n  // Per 4.2.1.2, use count of uuid\'s generated during the current clock\\\\n  // cycle to simulate higher resolution clock\\\\n  var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\\\\n\\\\n  // Time since last uuid creation (in msecs)\\\\n  var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\\\\n\\\\n  // Per 4.2.1.2, Bump clockseq on clock regression\\\\n  if (dt < 0 && options.clockseq === undefined) {\\\\n    clockseq = clockseq + 1 & 0x3fff;\\\\n  }\\\\n\\\\n  // Reset nsecs if clock regresses (new clockseq) or we\'ve moved onto a new\\\\n  // time interval\\\\n  if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\\\\n    nsecs = 0;\\\\n  }\\\\n\\\\n  // Per 4.2.1.2 Throw error if too many uuids are requested\\\\n  if (nsecs >= 10000) {\\\\n    throw new Error(\'uuid.v1(): Can\\\\\\\\\'t create more than 10M uuids/sec\');\\\\n  }\\\\n\\\\n  _lastMSecs = msecs;\\\\n  _lastNSecs = nsecs;\\\\n  _clockseq = clockseq;\\\\n\\\\n  // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\\\\n  msecs += 12219292800000;\\\\n\\\\n  // `time_low`\\\\n  var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\\\\n  b[i++] = tl >>> 24 & 0xff;\\\\n  b[i++] = tl >>> 16 & 0xff;\\\\n  b[i++] = tl >>> 8 & 0xff;\\\\n  b[i++] = tl & 0xff;\\\\n\\\\n  // `time_mid`\\\\n  var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\\\\n  b[i++] = tmh >>> 8 & 0xff;\\\\n  b[i++] = tmh & 0xff;\\\\n\\\\n  // `time_high_and_version`\\\\n  b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\\\\n  b[i++] = tmh >>> 16 & 0xff;\\\\n\\\\n  // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\\\\n  b[i++] = clockseq >>> 8 | 0x80;\\\\n\\\\n  // `clock_seq_low`\\\\n  b[i++] = clockseq & 0xff;\\\\n\\\\n  // `node`\\\\n  var node = options.node || _nodeId;\\\\n  for (var n = 0; n < 6; n++) {\\\\n    b[i + n] = node[n];\\\\n  }\\\\n\\\\n  return buf ? buf : unparse(b);\\\\n}\\\\n\\\\n// **`v4()` - Generate random UUID**\\\\n\\\\n// See https://github.com/broofa/node-uuid for API details\\\\nfunction v4(options, buf, offset) {\\\\n  // Deprecated - \'format\' argument, as supported in v1.2\\\\n  var i = buf && offset || 0;\\\\n\\\\n  if (typeof(options) == \'string\') {\\\\n    buf = options == \'binary\' ? new Array(16) : null;\\\\n    options = null;\\\\n  }\\\\n  options = options || {};\\\\n\\\\n  var rnds = options.random || (options.rng || _rng)();\\\\n\\\\n  // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\\\\n  rnds[6] = (rnds[6] & 0x0f) | 0x40;\\\\n  rnds[8] = (rnds[8] & 0x3f) | 0x80;\\\\n\\\\n  // Copy bytes to buffer, if provided\\\\n  if (buf) {\\\\n    for (var ii = 0; ii < 16; ii++) {\\\\n      buf[i + ii] = rnds[ii];\\\\n    }\\\\n  }\\\\n\\\\n  return buf || unparse(rnds);\\\\n}\\\\n\\\\n// Export public API\\\\nvar uuid = v4;\\\\nuuid.v1 = v1;\\\\nuuid.v4 = v4;\\\\nuuid.parse = parse;\\\\nuuid.unparse = unparse;\\\\n\\\\nmodule.exports = uuid;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/~/uuid/uuid.js\\\\n// module id = 354\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/node_modules/uuid/uuid.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/* WEBPACK VAR INJECTION */(function(global, Buffer) {/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file accounts.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar core = __webpack_require__(26);\\\\nvar Method = __webpack_require__(25);\\\\nvar Promise = __webpack_require__(351);\\\\nvar Account = __webpack_require__(64);\\\\nvar Hash = __webpack_require__(159);\\\\nvar RLP = __webpack_require__(161);\\\\nvar Nat = __webpack_require__(160);\\\\nvar Bytes = __webpack_require__(92);\\\\nvar cryp = (typeof global === \'undefined\') ? __webpack_require__(40) : __webpack_require__(40);\\\\nvar scryptsy = __webpack_require__(316);\\\\nvar uuid = __webpack_require__(354);\\\\nvar utils = __webpack_require__(10);\\\\nvar helpers = __webpack_require__(7);\\\\n\\\\nvar isNot = function(value) {\\\\n    return (_.isUndefined(value) || _.isNull(value));\\\\n};\\\\n\\\\nvar trimLeadingZero = function (hex) {\\\\n    while (hex && hex.startsWith(\'0x0\')) {\\\\n        hex = \'0x\' + hex.slice(3);\\\\n    }\\\\n    return hex;\\\\n};\\\\n\\\\nvar makeEven = function (hex) {\\\\n    if(hex.length % 2 === 1) {\\\\n        hex = hex.replace(\'0x\', \'0x0\');\\\\n    }\\\\n    return hex;\\\\n};\\\\n\\\\n\\\\nvar Accounts = function Accounts() {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, arguments);\\\\n\\\\n    // remove unecessary core functions\\\\n    delete this.BatchRequest;\\\\n    delete this.extend;\\\\n\\\\n    var _ethereumCall = [\\\\n        new Method({\\\\n            name: \'getId\',\\\\n            call: \'net_version\',\\\\n            params: 0,\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'getGasPrice\',\\\\n            call: \'eth_gasPrice\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getTransactionCount\',\\\\n            call: \'eth_getTransactionCount\',\\\\n            params: 2,\\\\n            inputFormatter: [function (address) {\\\\n                if (utils.isAddress(address)) {\\\\n                    return address;\\\\n                } else {\\\\n                    throw new Error(\'Address \'+ address +\' is not a valid address to get the \\\\\\"transactionCount\\\\\\".\');\\\\n                }\\\\n            }, function () { return \'latest\'; }]\\\\n        })\\\\n    ];\\\\n    // attach methods to this._ethereumCall\\\\n    this._ethereumCall = {};\\\\n    _.each(_ethereumCall, function (method) {\\\\n        method.attachToObject(_this._ethereumCall);\\\\n        method.setRequestManager(_this._requestManager);\\\\n    });\\\\n\\\\n\\\\n    this.wallet = new Wallet(this);\\\\n};\\\\n\\\\nAccounts.prototype._addAccountFunctions = function (account) {\\\\n    var _this = this;\\\\n\\\\n    // add sign functions\\\\n    account.signTransaction = function signTransaction(tx, callback) {\\\\n        return _this.signTransaction(tx, account.privateKey, callback);\\\\n    };\\\\n    account.sign = function sign(data) {\\\\n        return _this.sign(data, account.privateKey);\\\\n    };\\\\n\\\\n    account.encrypt = function encrypt(password, options) {\\\\n        return _this.encrypt(account.privateKey, password, options);\\\\n    };\\\\n\\\\n\\\\n    return account;\\\\n};\\\\n\\\\nAccounts.prototype.create = function create(entropy) {\\\\n    return this._addAccountFunctions(Account.create(entropy || utils.randomHex(32)));\\\\n};\\\\n\\\\nAccounts.prototype.privateKeyToAccount = function privateKeyToAccount(privateKey) {\\\\n    return this._addAccountFunctions(Account.fromPrivate(privateKey));\\\\n};\\\\n\\\\nAccounts.prototype.signTransaction = function signTransaction(tx, privateKey, callback) {\\\\n    var _this = this,\\\\n        error = false,\\\\n        result;\\\\n\\\\n    callback = callback || function () {};\\\\n\\\\n    if (!tx) {\\\\n        error = new Error(\'No transaction object given!\');\\\\n\\\\n        callback(error);\\\\n        return Promise.reject(error);\\\\n    }\\\\n\\\\n    function signed (tx) {\\\\n\\\\n        if (!tx.gas && !tx.gasLimit) {\\\\n            error = new Error(\'\\\\\\"gas\\\\\\" is missing\');\\\\n        }\\\\n\\\\n        if (tx.nonce  < 0 ||\\\\n            tx.gas  < 0 ||\\\\n            tx.gasPrice  < 0 ||\\\\n            tx.chainId  < 0) {\\\\n            error = new Error(\'Gas, gasPrice, nonce or chainId is lower than 0\');\\\\n        }\\\\n\\\\n        if (error) {\\\\n            callback(error);\\\\n            return Promise.reject(new Error(\'\\\\\\"gas\\\\\\" is missing\'));\\\\n        }\\\\n\\\\n        try {\\\\n            tx = helpers.formatters.inputCallFormatter(tx);\\\\n\\\\n            var transaction = tx;\\\\n            transaction.to = tx.to || \'0x\';\\\\n            transaction.data = tx.data || \'0x\';\\\\n            transaction.value = tx.value || \'0x\';\\\\n            transaction.chainId = utils.numberToHex(tx.chainId);\\\\n\\\\n            var rlpEncoded = RLP.encode([\\\\n                Bytes.fromNat(transaction.nonce),\\\\n                Bytes.fromNat(transaction.gasPrice),\\\\n                Bytes.fromNat(transaction.gas),\\\\n                transaction.to.toLowerCase(),\\\\n                Bytes.fromNat(transaction.value),\\\\n                transaction.data,\\\\n                Bytes.fromNat(transaction.chainId || \\\\\\"0x1\\\\\\"),\\\\n                \\\\\\"0x\\\\\\",\\\\n                \\\\\\"0x\\\\\\"]);\\\\n\\\\n\\\\n            var hash = Hash.keccak256(rlpEncoded);\\\\n\\\\n            var signature = Account.makeSigner(Nat.toNumber(transaction.chainId || \\\\\\"0x1\\\\\\") * 2 + 35)(Hash.keccak256(rlpEncoded), privateKey);\\\\n\\\\n            var rawTx = RLP.decode(rlpEncoded).slice(0, 6).concat(Account.decodeSignature(signature));\\\\n\\\\n            rawTx[6] = makeEven(trimLeadingZero(rawTx[6]));\\\\n            rawTx[7] = makeEven(trimLeadingZero(rawTx[7]));\\\\n            rawTx[8] = makeEven(trimLeadingZero(rawTx[8]));\\\\n\\\\n            var rawTransaction = RLP.encode(rawTx);\\\\n\\\\n            var values = RLP.decode(rawTransaction);\\\\n            result = {\\\\n                messageHash: hash,\\\\n                v: trimLeadingZero(values[6]),\\\\n                r: trimLeadingZero(values[7]),\\\\n                s: trimLeadingZero(values[8]),\\\\n                rawTransaction: rawTransaction\\\\n            };\\\\n\\\\n        } catch(e) {\\\\n            callback(e);\\\\n            return Promise.reject(e);\\\\n        }\\\\n\\\\n        callback(null, result);\\\\n        return result;\\\\n    }\\\\n\\\\n    // Resolve immediately if nonce, chainId and price are provided\\\\n    if (tx.nonce !== undefined && tx.chainId !== undefined && tx.gasPrice !== undefined) {\\\\n        return Promise.resolve(signed(tx));\\\\n    }\\\\n\\\\n\\\\n    // Otherwise, get the missing info from the Ethereum Node\\\\n    return Promise.all([\\\\n        isNot(tx.chainId) ? _this._ethereumCall.getId() : tx.chainId,\\\\n        isNot(tx.gasPrice) ? _this._ethereumCall.getGasPrice() : tx.gasPrice,\\\\n        isNot(tx.nonce) ? _this._ethereumCall.getTransactionCount(_this.privateKeyToAccount(privateKey).address) : tx.nonce\\\\n    ]).then(function (args) {\\\\n        if (isNot(args[0]) || isNot(args[1]) || isNot(args[2])) {\\\\n            throw new Error(\'One of the values \\\\\\"chainId\\\\\\", \\\\\\"gasPrice\\\\\\", or \\\\\\"nonce\\\\\\" couldn\\\\\\\\\'t be fetched: \'+ JSON.stringify(args));\\\\n        }\\\\n        return signed(_.extend(tx, {chainId: args[0], gasPrice: args[1], nonce: args[2]}));\\\\n    });\\\\n};\\\\n\\\\n/* jshint ignore:start */\\\\nAccounts.prototype.recoverTransaction = function recoverTransaction(rawTx) {\\\\n    var values = RLP.decode(rawTx);\\\\n    var signature = Account.encodeSignature(values.slice(6,9));\\\\n    var recovery = Bytes.toNumber(values[6]);\\\\n    var extraData = recovery < 35 ? [] : [Bytes.fromNumber((recovery - 35) >> 1), \\\\\\"0x\\\\\\", \\\\\\"0x\\\\\\"];\\\\n    var signingData = values.slice(0,6).concat(extraData);\\\\n    var signingDataHex = RLP.encode(signingData);\\\\n    return Account.recover(Hash.keccak256(signingDataHex), signature);\\\\n};\\\\n/* jshint ignore:end */\\\\n\\\\nAccounts.prototype.hashMessage = function hashMessage(data) {\\\\n    var message = utils.isHexStrict(data) ? utils.hexToUtf8(data) : data;\\\\n    var ethMessage = \\\\\\"\\\\\\\\x19Ethereum Signed Message:\\\\\\\\n\\\\\\" + message.length + message;\\\\n    return Hash.keccak256s(ethMessage);\\\\n};\\\\n\\\\nAccounts.prototype.sign = function sign(data, privateKey) {\\\\n\\\\n    var hash = this.hashMessage(data);\\\\n    var signature = Account.sign(hash, privateKey);\\\\n    var vrs = Account.decodeSignature(signature);\\\\n    return {\\\\n        message: data,\\\\n        messageHash: hash,\\\\n        v: vrs[0],\\\\n        r: vrs[1],\\\\n        s: vrs[2],\\\\n        signature: signature\\\\n    };\\\\n};\\\\n\\\\nAccounts.prototype.recover = function recover(hash, signature) {\\\\n\\\\n    if (_.isObject(hash)) {\\\\n        return this.recover(hash.messageHash, Account.encodeSignature([hash.v, hash.r, hash.s]));\\\\n    }\\\\n\\\\n    if (!utils.isHexStrict(hash)) {\\\\n        hash = this.hashMessage(hash);\\\\n    }\\\\n\\\\n    if (arguments.length === 4) {\\\\n        return this.recover(hash, Account.encodeSignature([].slice.call(arguments, 1, 4))); // v, r, s\\\\n    }\\\\n    return Account.recover(hash, signature);\\\\n};\\\\n\\\\n// Taken from https://github.com/ethereumjs/ethereumjs-wallet\\\\nAccounts.prototype.decrypt = function (v3Keystore, password, nonStrict) {\\\\n    /* jshint maxcomplexity: 10 */\\\\n\\\\n    if(!_.isString(password)) {\\\\n        throw new Error(\'No password given.\');\\\\n    }\\\\n\\\\n    var json = (_.isObject(v3Keystore)) ? v3Keystore : JSON.parse(nonStrict ? v3Keystore.toLowerCase() : v3Keystore);\\\\n\\\\n    if (json.version !== 3) {\\\\n        throw new Error(\'Not a valid V3 wallet\');\\\\n    }\\\\n\\\\n    var derivedKey;\\\\n    var kdfparams;\\\\n    if (json.crypto.kdf === \'scrypt\') {\\\\n        kdfparams = json.crypto.kdfparams;\\\\n\\\\n        // FIXME: support progress reporting callback\\\\n        derivedKey = scryptsy(new Buffer(password), new Buffer(kdfparams.salt, \'hex\'), kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\\\\n    } else if (json.crypto.kdf === \'pbkdf2\') {\\\\n        kdfparams = json.crypto.kdfparams;\\\\n\\\\n        if (kdfparams.prf !== \'hmac-sha256\') {\\\\n            throw new Error(\'Unsupported parameters to PBKDF2\');\\\\n        }\\\\n\\\\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), new Buffer(kdfparams.salt, \'hex\'), kdfparams.c, kdfparams.dklen, \'sha256\');\\\\n    } else {\\\\n        throw new Error(\'Unsupported key derivation scheme\');\\\\n    }\\\\n\\\\n    var ciphertext = new Buffer(json.crypto.ciphertext, \'hex\');\\\\n\\\\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), ciphertext ])).replace(\'0x\',\'\');\\\\n    if (mac !== json.crypto.mac) {\\\\n        throw new Error(\'Key derivation failed - possibly wrong password\');\\\\n    }\\\\n\\\\n    var decipher = cryp.createDecipheriv(json.crypto.cipher, derivedKey.slice(0, 16), new Buffer(json.crypto.cipherparams.iv, \'hex\'));\\\\n    var seed = \'0x\'+ Buffer.concat([ decipher.update(ciphertext), decipher.final() ]).toString(\'hex\');\\\\n\\\\n    return this.privateKeyToAccount(seed);\\\\n};\\\\n\\\\nAccounts.prototype.encrypt = function (privateKey, password, options) {\\\\n    /* jshint maxcomplexity: 20 */\\\\n    var account = this.privateKeyToAccount(privateKey);\\\\n\\\\n    options = options || {};\\\\n    var salt = options.salt || cryp.randomBytes(32);\\\\n    var iv = options.iv || cryp.randomBytes(16);\\\\n\\\\n    var derivedKey;\\\\n    var kdf = options.kdf || \'scrypt\';\\\\n    var kdfparams = {\\\\n        dklen: options.dklen || 32,\\\\n        salt: salt.toString(\'hex\')\\\\n    };\\\\n\\\\n    if (kdf === \'pbkdf2\') {\\\\n        kdfparams.c = options.c || 262144;\\\\n        kdfparams.prf = \'hmac-sha256\';\\\\n        derivedKey = cryp.pbkdf2Sync(new Buffer(password), salt, kdfparams.c, kdfparams.dklen, \'sha256\');\\\\n    } else if (kdf === \'scrypt\') {\\\\n        // FIXME: support progress reporting callback\\\\n        kdfparams.n = options.n || 8192; // 2048 4096 8192 16384\\\\n        kdfparams.r = options.r || 8;\\\\n        kdfparams.p = options.p || 1;\\\\n        derivedKey = scryptsy(new Buffer(password), salt, kdfparams.n, kdfparams.r, kdfparams.p, kdfparams.dklen);\\\\n    } else {\\\\n        throw new Error(\'Unsupported kdf\');\\\\n    }\\\\n\\\\n    var cipher = cryp.createCipheriv(options.cipher || \'aes-128-ctr\', derivedKey.slice(0, 16), iv);\\\\n    if (!cipher) {\\\\n        throw new Error(\'Unsupported cipher\');\\\\n    }\\\\n\\\\n    var ciphertext = Buffer.concat([ cipher.update(new Buffer(account.privateKey.replace(\'0x\',\'\'), \'hex\')), cipher.final() ]);\\\\n\\\\n    var mac = utils.sha3(Buffer.concat([ derivedKey.slice(16, 32), new Buffer(ciphertext, \'hex\') ])).replace(\'0x\',\'\');\\\\n\\\\n    return {\\\\n        version: 3,\\\\n        id: uuid.v4({ random: options.uuid || cryp.randomBytes(16) }),\\\\n        address: account.address.toLowerCase().replace(\'0x\',\'\'),\\\\n        crypto: {\\\\n            ciphertext: ciphertext.toString(\'hex\'),\\\\n            cipherparams: {\\\\n                iv: iv.toString(\'hex\')\\\\n            },\\\\n            cipher: options.cipher || \'aes-128-ctr\',\\\\n            kdf: kdf,\\\\n            kdfparams: kdfparams,\\\\n            mac: mac.toString(\'hex\')\\\\n        }\\\\n    };\\\\n};\\\\n\\\\n\\\\n// Note: this is trying to follow closely the specs on\\\\n// http://web3js.readthedocs.io/en/1.0/web3-eth-accounts.html\\\\n\\\\nfunction Wallet(accounts) {\\\\n    this._accounts = accounts;\\\\n    this.length = 0;\\\\n    this.defaultKeyName = \\\\\\"web3js_wallet\\\\\\";\\\\n}\\\\n\\\\nWallet.prototype._findSafeIndex = function (pointer) {\\\\n    pointer = pointer || 0;\\\\n    if (_.has(this, pointer)) {\\\\n        return this._findSafeIndex(pointer + 1);\\\\n    } else {\\\\n        return pointer;\\\\n    }\\\\n};\\\\n\\\\nWallet.prototype._currentIndexes = function () {\\\\n    var keys = Object.keys(this);\\\\n    var indexes = keys\\\\n        .map(function(key) { return parseInt(key); })\\\\n        .filter(function(n) { return (n < 9e20); });\\\\n\\\\n    return indexes;\\\\n};\\\\n\\\\nWallet.prototype.create = function (numberOfAccounts, entropy) {\\\\n    for (var i = 0; i < numberOfAccounts; ++i) {\\\\n        this.add(this._accounts.create(entropy).privateKey);\\\\n    }\\\\n    return this;\\\\n};\\\\n\\\\nWallet.prototype.add = function (account) {\\\\n\\\\n    if (_.isString(account)) {\\\\n        account = this._accounts.privateKeyToAccount(account);\\\\n    }\\\\n    if (!this[account.address]) {\\\\n        account = this._accounts.privateKeyToAccount(account.privateKey);\\\\n        account.index = this._findSafeIndex();\\\\n\\\\n        this[account.index] = account;\\\\n        this[account.address] = account;\\\\n        this[account.address.toLowerCase()] = account;\\\\n\\\\n        this.length++;\\\\n\\\\n        return account;\\\\n    } else {\\\\n        return this[account.address];\\\\n    }\\\\n};\\\\n\\\\nWallet.prototype.remove = function (addressOrIndex) {\\\\n    var account = this[addressOrIndex];\\\\n\\\\n    if (account && account.address) {\\\\n        // address\\\\n        this[account.address].privateKey = null;\\\\n        delete this[account.address];\\\\n        // address lowercase\\\\n        this[account.address.toLowerCase()].privateKey = null;\\\\n        delete this[account.address.toLowerCase()];\\\\n        // index\\\\n        this[account.index].privateKey = null;\\\\n        delete this[account.index];\\\\n\\\\n        this.length--;\\\\n\\\\n        return true;\\\\n    } else {\\\\n        return false;\\\\n    }\\\\n};\\\\n\\\\nWallet.prototype.clear = function () {\\\\n    var _this = this;\\\\n    var indexes = this._currentIndexes();\\\\n\\\\n    indexes.forEach(function(index) {\\\\n        _this.remove(index);\\\\n    });\\\\n\\\\n    return this;\\\\n};\\\\n\\\\nWallet.prototype.encrypt = function (password, options) {\\\\n    var _this = this;\\\\n    var indexes = this._currentIndexes();\\\\n\\\\n    var accounts = indexes.map(function(index) {\\\\n        return _this[index].encrypt(password, options);\\\\n    });\\\\n\\\\n    return accounts;\\\\n};\\\\n\\\\n\\\\nWallet.prototype.decrypt = function (encryptedWallet, password) {\\\\n    var _this = this;\\\\n\\\\n    encryptedWallet.forEach(function (keystore) {\\\\n        var account = _this._accounts.decrypt(keystore, password);\\\\n\\\\n        if (account) {\\\\n            _this.add(account);\\\\n        } else {\\\\n            throw new Error(\'Couldn\\\\\\\\\'t decrypt accounts. Password wrong?\');\\\\n        }\\\\n    });\\\\n\\\\n    return this;\\\\n};\\\\n\\\\nWallet.prototype.save = function (password, keyName) {\\\\n    localStorage.setItem(keyName || this.defaultKeyName, JSON.stringify(this.encrypt(password)));\\\\n\\\\n    return true;\\\\n};\\\\n\\\\nWallet.prototype.load = function (password, keyName) {\\\\n    var keystore = localStorage.getItem(keyName || this.defaultKeyName);\\\\n\\\\n    if (keystore) {\\\\n        try {\\\\n            keystore = JSON.parse(keystore);\\\\n        } catch(e) {\\\\n\\\\n        }\\\\n    }\\\\n\\\\n    return this.decrypt(keystore || [], password);\\\\n};\\\\n\\\\nif (typeof localStorage === \'undefined\') {\\\\n    delete Wallet.prototype.save;\\\\n    delete Wallet.prototype.load;\\\\n}\\\\n\\\\n\\\\nmodule.exports = Accounts;\\\\n\\\\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4), __webpack_require__(1).Buffer))\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-accounts/src/index.js\\\\n// module id = 355\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-accounts/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file contract.js\\\\n *\\\\n * To initialize a contract use:\\\\n *\\\\n *  var Contract = require(\'web3-eth-contract\');\\\\n *  Contract.setProvider(\'ws://localhost:8546\');\\\\n *  var contract = new Contract(abi, address, ...);\\\\n *\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar core = __webpack_require__(26);\\\\nvar Method = __webpack_require__(25);\\\\nvar utils = __webpack_require__(10);\\\\nvar Subscription = __webpack_require__(57).subscription;\\\\nvar formatters = __webpack_require__(7).formatters;\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar promiEvent = __webpack_require__(155);\\\\nvar abi = __webpack_require__(157);\\\\n\\\\n\\\\n/**\\\\n * Should be called to create new contract instance\\\\n *\\\\n * @method Contract\\\\n * @constructor\\\\n * @param {Array} jsonInterface\\\\n * @param {String} address\\\\n * @param {Object} options\\\\n */\\\\nvar Contract = function Contract(jsonInterface, address, options) {\\\\n    var _this = this,\\\\n        args = Array.prototype.slice.call(arguments);\\\\n\\\\n    if(!(this instanceof Contract)) {\\\\n        throw new Error(\'Please use the \\\\\\"new\\\\\\" keyword to instantiate a web3.eth.contract() object!\');\\\\n    }\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, [this.constructor.currentProvider]);\\\\n\\\\n    this.clearSubscriptions = this._requestManager.clearSubscriptions;\\\\n\\\\n\\\\n\\\\n    if(!jsonInterface || !(Array.isArray(jsonInterface))) {\\\\n        throw new Error(\'You must provide the json interface of the contract when instantiating a contract object.\');\\\\n    }\\\\n\\\\n\\\\n\\\\n    // create the options object\\\\n    this.options = {};\\\\n\\\\n    var lastArg = args[args.length - 1];\\\\n    if(_.isObject(lastArg) && !_.isArray(lastArg)) {\\\\n        options = lastArg;\\\\n\\\\n        this.options = _.extend(this.options, this._getOrSetDefaultOptions(options));\\\\n        if(_.isObject(address)) {\\\\n            address = null;\\\\n        }\\\\n    }\\\\n\\\\n    // set address\\\\n    Object.defineProperty(this.options, \'address\', {\\\\n        set: function(value){\\\\n            if(value) {\\\\n                _this._address = utils.toChecksumAddress(formatters.inputAddressFormatter(value));\\\\n            }\\\\n        },\\\\n        get: function(){\\\\n            return _this._address;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n\\\\n    // add method and event signatures, when the jsonInterface gets set\\\\n    Object.defineProperty(this.options, \'jsonInterface\', {\\\\n        set: function(value){\\\\n            _this.methods = {};\\\\n            _this.events = {};\\\\n\\\\n            _this._jsonInterface = value.map(function(method) {\\\\n                var func,\\\\n                    funcName;\\\\n\\\\n                if (method.name) {\\\\n                    funcName = utils._jsonInterfaceMethodToString(method);\\\\n                }\\\\n\\\\n\\\\n                // function\\\\n                if (method.type === \'function\') {\\\\n                    method.signature = abi.encodeFunctionSignature(funcName);\\\\n                    func = _this._createTxObject.bind({\\\\n                        method: method,\\\\n                        parent: _this\\\\n                    });\\\\n\\\\n\\\\n                    // add method only if not one already exists\\\\n                    if(!_this.methods[method.name]) {\\\\n                        _this.methods[method.name] = func;\\\\n                    } else {\\\\n                        var cascadeFunc = _this._createTxObject.bind({\\\\n                            method: method,\\\\n                            parent: _this,\\\\n                            nextMethod: _this.methods[method.name]\\\\n                        });\\\\n                        _this.methods[method.name] = cascadeFunc;\\\\n                    }\\\\n\\\\n                    // definitely add the method based on its signature\\\\n                    _this.methods[method.signature] = func;\\\\n\\\\n                    // add method by name\\\\n                    _this.methods[funcName] = func;\\\\n\\\\n\\\\n                // event\\\\n                } else if (method.type === \'event\') {\\\\n                    method.signature = abi.encodeEventSignature(funcName);\\\\n                    var event = _this._on.bind(_this, method.signature);\\\\n\\\\n                    // add method only if not already exists\\\\n                    if(!_this.events[method.name] || _this.events[method.name].name === \'bound \')\\\\n                        _this.events[method.name] = event;\\\\n\\\\n                    // definitely add the method based on its signature\\\\n                    _this.events[method.signature] = event;\\\\n\\\\n                    // add event by name\\\\n                    _this.events[funcName] = event;\\\\n                }\\\\n\\\\n\\\\n                return method;\\\\n            });\\\\n\\\\n            // add allEvents\\\\n            _this.events.allEvents = _this._on.bind(_this, \'allevents\');\\\\n\\\\n            return _this._jsonInterface;\\\\n        },\\\\n        get: function(){\\\\n            return _this._jsonInterface;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n\\\\n    // get default account from the Class\\\\n    var defaultAccount = this.constructor.defaultAccount;\\\\n    var defaultBlock = this.constructor.defaultBlock || \'latest\';\\\\n\\\\n    Object.defineProperty(this, \'defaultAccount\', {\\\\n        get: function () {\\\\n            return defaultAccount;\\\\n        },\\\\n        set: function (val) {\\\\n            if(val) {\\\\n                defaultAccount = utils.toChecksumAddress(formatters.inputAddressFormatter(val));\\\\n            }\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n    Object.defineProperty(this, \'defaultBlock\', {\\\\n        get: function () {\\\\n            return defaultBlock;\\\\n        },\\\\n        set: function (val) {\\\\n            defaultBlock = val;\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n\\\\n    // properties\\\\n    this.methods = {};\\\\n    this.events = {};\\\\n\\\\n    this._address = null;\\\\n    this._jsonInterface = [];\\\\n\\\\n    // set getter/setter properties\\\\n    this.options.address = address;\\\\n    this.options.jsonInterface = jsonInterface;\\\\n\\\\n};\\\\n\\\\nContract.setProvider = function(provider, accounts) {\\\\n    // Contract.currentProvider = provider;\\\\n    core.packageInit(this, [provider]);\\\\n\\\\n    this._ethAccounts = accounts;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Get the callback and modiufy the array if necessary\\\\n *\\\\n * @method _getCallback\\\\n * @param {Array} args\\\\n * @return {Function} the callback\\\\n */\\\\nContract.prototype._getCallback = function getCallback(args) {\\\\n    if (args && _.isFunction(args[args.length - 1])) {\\\\n        return args.pop(); // modify the args array!\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n * Checks that no listener with name \\\\\\"newListener\\\\\\" or \\\\\\"removeListener\\\\\\" is added.\\\\n *\\\\n * @method _checkListener\\\\n * @param {String} type\\\\n * @param {String} event\\\\n * @return {Object} the contract instance\\\\n */\\\\nContract.prototype._checkListener = function(type, event){\\\\n    if(event === type) {\\\\n        throw new Error(\'The event \\\\\\"\'+ type +\'\\\\\\" is a reserved event name, you can\\\\\\\\\'t use it.\');\\\\n    }\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Use default values, if options are not available\\\\n *\\\\n * @method _getOrSetDefaultOptions\\\\n * @param {Object} options the options gived by the user\\\\n * @return {Object} the options with gaps filled by defaults\\\\n */\\\\nContract.prototype._getOrSetDefaultOptions = function getOrSetDefaultOptions(options) {\\\\n    var gasPrice = options.gasPrice ? String(options.gasPrice): null;\\\\n    var from = options.from ? utils.toChecksumAddress(formatters.inputAddressFormatter(options.from)) : null;\\\\n\\\\n    options.data = options.data || this.options.data;\\\\n\\\\n    options.from = from || this.options.from;\\\\n    options.gasPrice = gasPrice || this.options.gasPrice;\\\\n    options.gas = options.gas || options.gasLimit || this.options.gas;\\\\n\\\\n    // TODO replace with only gasLimit?\\\\n    delete options.gasLimit;\\\\n\\\\n    return options;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Should be used to encode indexed params and options to one final object\\\\n *\\\\n * @method _encodeEventABI\\\\n * @param {Object} event\\\\n * @param {Object} options\\\\n * @return {Object} everything combined together and encoded\\\\n */\\\\nContract.prototype._encodeEventABI = function (event, options) {\\\\n    options = options || {};\\\\n    var filter = options.filter || {},\\\\n        result = {};\\\\n\\\\n    [\'fromBlock\', \'toBlock\'].filter(function (f) {\\\\n        return options[f] !== undefined;\\\\n    }).forEach(function (f) {\\\\n        result[f] = formatters.inputBlockNumberFormatter(options[f]);\\\\n    });\\\\n\\\\n    // use given topics\\\\n    if(_.isArray(options.topics)) {\\\\n        result.topics = options.topics;\\\\n\\\\n    // create topics based on filter\\\\n    } else {\\\\n\\\\n        result.topics = [];\\\\n\\\\n        // add event signature\\\\n        if (event && !event.anonymous && event.name !== \'ALLEVENTS\') {\\\\n            result.topics.push(event.signature);\\\\n        }\\\\n\\\\n        // add event topics (indexed arguments)\\\\n        if (event.name !== \'ALLEVENTS\') {\\\\n            var indexedTopics = event.inputs.filter(function (i) {\\\\n                return i.indexed === true;\\\\n            }).map(function (i) {\\\\n                var value = filter[i.name];\\\\n                if (!value) {\\\\n                    return null;\\\\n                }\\\\n\\\\n                // TODO: https://github.com/ethereum/web3.js/issues/344\\\\n\\\\n                if (_.isArray(value)) {\\\\n                    return value.map(function (v) {\\\\n                        return abi.encodeParameter(i.type, v);\\\\n                    });\\\\n                }\\\\n                return abi.encodeParameter(i.type, value);\\\\n            });\\\\n\\\\n            result.topics = result.topics.concat(indexedTopics);\\\\n        }\\\\n\\\\n        if(!result.topics.length)\\\\n            delete result.topics;\\\\n    }\\\\n\\\\n    if(this.options.address) {\\\\n        result.address = this.options.address.toLowerCase();\\\\n    }\\\\n\\\\n    return result;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to decode indexed params and options\\\\n *\\\\n * @method _decodeEventABI\\\\n * @param {Object} data\\\\n * @return {Object} result object with decoded indexed && not indexed params\\\\n */\\\\nContract.prototype._decodeEventABI = function (data) {\\\\n    var event = this;\\\\n\\\\n    data.data = data.data || \'\';\\\\n    data.topics = data.topics || [];\\\\n    var result = formatters.outputLogFormatter(data);\\\\n\\\\n    // if allEvents get the right event\\\\n    if(event.name === \'ALLEVENTS\') {\\\\n        event = event.jsonInterface.find(function (intf) {\\\\n            return (intf.signature === data.topics[0]);\\\\n        }) || {anonymous: true};\\\\n    }\\\\n\\\\n    // create empty inputs if none are present (e.g. anonymous events on allEvents)\\\\n    event.inputs = event.inputs || [];\\\\n\\\\n\\\\n    var argTopics = event.anonymous ? data.topics : data.topics.slice(1);\\\\n\\\\n    result.returnValues = abi.decodeLog(event.inputs, data.data, argTopics);\\\\n    delete result.returnValues.__length__;\\\\n\\\\n    // add name\\\\n    result.event = event.name;\\\\n\\\\n    // add signature\\\\n    result.signature = (event.anonymous || !data.topics[0]) ? null : data.topics[0];\\\\n\\\\n    // move the data and topics to \\\\\\"raw\\\\\\"\\\\n    result.raw = {\\\\n        data: result.data,\\\\n        topics: result.topics\\\\n    };\\\\n    delete result.data;\\\\n    delete result.topics;\\\\n\\\\n\\\\n    return result;\\\\n};\\\\n\\\\n/**\\\\n * Encodes an ABI for a method, including signature or the method.\\\\n * Or when constructor encodes only the constructor parameters.\\\\n *\\\\n * @method _encodeMethodABI\\\\n * @param {Mixed} args the arguments to encode\\\\n * @param {String} the encoded ABI\\\\n */\\\\nContract.prototype._encodeMethodABI = function _encodeMethodABI() {\\\\n    var methodSignature = this._method.signature,\\\\n        args = this.arguments || [];\\\\n\\\\n    var signature = false,\\\\n        paramsABI = this._parent.options.jsonInterface.filter(function (json) {\\\\n            return ((methodSignature === \'constructor\' && json.type === methodSignature) ||\\\\n                ((json.signature === methodSignature || json.signature === methodSignature.replace(\'0x\',\'\') || json.name === methodSignature) && json.type === \'function\'));\\\\n        }).map(function (json) {\\\\n            var inputLength = (_.isArray(json.inputs)) ? json.inputs.length : 0;\\\\n\\\\n            if (inputLength !== args.length) {\\\\n                throw new Error(\'The number of arguments is not matching the methods required number. You need to pass \'+ inputLength +\' arguments.\');\\\\n            }\\\\n\\\\n            if (json.type === \'function\') {\\\\n                signature = json.signature;\\\\n            }\\\\n            return _.isArray(json.inputs) ? json.inputs.map(function (input) { return input.type; }) : [];\\\\n        }).map(function (types) {\\\\n            return abi.encodeParameters(types, args).replace(\'0x\',\'\');\\\\n        })[0] || \'\';\\\\n\\\\n    // return constructor\\\\n    if(methodSignature === \'constructor\') {\\\\n        if(!this._deployData)\\\\n            throw new Error(\'The contract has no contract data option set. This is necessary to append the constructor parameters.\');\\\\n\\\\n        return this._deployData + paramsABI;\\\\n\\\\n    // return method\\\\n    } else {\\\\n\\\\n        var returnValue = (signature) ? signature + paramsABI : paramsABI;\\\\n\\\\n        if(!returnValue) {\\\\n            throw new Error(\'Couldn\\\\\\\\\'t find a matching contract method named \\\\\\"\'+ this._method.name +\'\\\\\\".\');\\\\n        } else {\\\\n            return returnValue;\\\\n        }\\\\n    }\\\\n\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Decode method return values\\\\n *\\\\n * @method _decodeMethodReturn\\\\n * @param {Array} outputs\\\\n * @param {String} returnValues\\\\n * @return {Object} decoded output return values\\\\n */\\\\nContract.prototype._decodeMethodReturn = function (outputs, returnValues) {\\\\n    if (!returnValues) {\\\\n        return null;\\\\n    }\\\\n\\\\n    returnValues = returnValues.length >= 2 ? returnValues.slice(2) : returnValues;\\\\n    var result = abi.decodeParameters(outputs, returnValues);\\\\n\\\\n    if (result.__length__ === 1) {\\\\n        return result[0];\\\\n    } else {\\\\n        delete result.__length__;\\\\n        return result;\\\\n    }\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Deploys a contract and fire events based on its state: transactionHash, receipt\\\\n *\\\\n * All event listeners will be removed, once the last possible event is fired (\\\\\\"error\\\\\\", or \\\\\\"receipt\\\\\\")\\\\n *\\\\n * @method deploy\\\\n * @param {Object} options\\\\n * @param {Function} callback\\\\n * @return {Object} EventEmitter possible events are \\\\\\"error\\\\\\", \\\\\\"transactionHash\\\\\\" and \\\\\\"receipt\\\\\\"\\\\n */\\\\nContract.prototype.deploy = function(options, callback){\\\\n\\\\n    options = options || {};\\\\n\\\\n    options.arguments = options.arguments || [];\\\\n    options = this._getOrSetDefaultOptions(options);\\\\n\\\\n\\\\n    // return error, if no \\\\\\"data\\\\\\" is specified\\\\n    if(!options.data) {\\\\n        return utils._fireError(new Error(\'No \\\\\\"data\\\\\\" specified in neither the given options, nor the default options.\'), null, null, callback);\\\\n    }\\\\n\\\\n    var constructor = _.find(this.options.jsonInterface, function (method) {\\\\n        return (method.type === \'constructor\');\\\\n    }) || {};\\\\n    constructor.signature = \'constructor\';\\\\n\\\\n    return this._createTxObject.apply({\\\\n        method: constructor,\\\\n        parent: this,\\\\n        deployData: options.data,\\\\n        _ethAccounts: this.constructor._ethAccounts\\\\n    }, options.arguments);\\\\n\\\\n};\\\\n\\\\n/**\\\\n * Gets the event signature and outputformatters\\\\n *\\\\n * @method _generateEventOptions\\\\n * @param {Object} event\\\\n * @param {Object} options\\\\n * @param {Function} callback\\\\n * @return {Object} the event options object\\\\n */\\\\nContract.prototype._generateEventOptions = function() {\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n\\\\n    // get the callback\\\\n    var callback = this._getCallback(args);\\\\n\\\\n    // get the options\\\\n    var options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\\\\n\\\\n    var event = (_.isString(args[0])) ? args[0] : \'allevents\';\\\\n    event = (event.toLowerCase() === \'allevents\') ? {\\\\n            name: \'ALLEVENTS\',\\\\n            jsonInterface: this.options.jsonInterface\\\\n        } : this.options.jsonInterface.find(function (json) {\\\\n            return (json.type === \'event\' && (json.name === event || json.signature === \'0x\'+ event.replace(\'0x\',\'\')));\\\\n        });\\\\n\\\\n    if (!event) {\\\\n        throw new Error(\'Event \\\\\\"\' + event.name + \'\\\\\\" doesn\\\\\\\\\'t exist in this contract.\');\\\\n    }\\\\n\\\\n    if (!utils.isAddress(this.options.address)) {\\\\n        throw new Error(\'This contract object doesn\\\\\\\\\'t have address set yet, please set an address first.\');\\\\n    }\\\\n\\\\n    return {\\\\n        params: this._encodeEventABI(event, options),\\\\n        event: event,\\\\n        callback: callback\\\\n    };\\\\n};\\\\n\\\\n/**\\\\n * Adds event listeners and creates a subscription, and remove it once its fired.\\\\n *\\\\n * @method clone\\\\n * @return {Object} the event subscription\\\\n */\\\\nContract.prototype.clone = function() {\\\\n    return new this.constructor(this.options.jsonInterface, this.options.address, this.options);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Adds event listeners and creates a subscription, and remove it once its fired.\\\\n *\\\\n * @method once\\\\n * @param {String} event\\\\n * @param {Object} options\\\\n * @param {Function} callback\\\\n * @return {Object} the event subscription\\\\n */\\\\nContract.prototype.once = function(event, options, callback) {\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n\\\\n    // get the callback\\\\n    callback = this._getCallback(args);\\\\n\\\\n    if (!callback) {\\\\n        throw new Error(\'Once requires a callback as the second parameter.\');\\\\n    }\\\\n\\\\n    // don\'t allow fromBlock\\\\n    if (options)\\\\n        delete options.fromBlock;\\\\n\\\\n    // don\'t return as once shouldn\'t provide \\\\\\"on\\\\\\"\\\\n    this._on(event, options, function (err, res, sub) {\\\\n        sub.unsubscribe();\\\\n        if(_.isFunction(callback)){\\\\n            callback(err, res, sub);\\\\n        }\\\\n    });\\\\n\\\\n    return undefined;\\\\n};\\\\n\\\\n/**\\\\n * Adds event listeners and creates a subscription.\\\\n *\\\\n * @method _on\\\\n * @param {String} event\\\\n * @param {Object} options\\\\n * @param {Function} callback\\\\n * @return {Object} the event subscription\\\\n */\\\\nContract.prototype._on = function(){\\\\n    var subOptions = this._generateEventOptions.apply(this, arguments);\\\\n\\\\n\\\\n    // prevent the event \\\\\\"newListener\\\\\\" and \\\\\\"removeListener\\\\\\" from being overwritten\\\\n    this._checkListener(\'newListener\', subOptions.event.name, subOptions.callback);\\\\n    this._checkListener(\'removeListener\', subOptions.event.name, subOptions.callback);\\\\n\\\\n    // TODO check if listener already exists? and reuse subscription if options are the same.\\\\n\\\\n    // create new subscription\\\\n    var subscription = new Subscription({\\\\n        subscription: {\\\\n            params: 1,\\\\n            inputFormatter: [formatters.inputLogFormatter],\\\\n            outputFormatter: this._decodeEventABI.bind(subOptions.event),\\\\n            // DUBLICATE, also in web3-eth\\\\n            subscriptionHandler: function (output) {\\\\n                if(output.removed) {\\\\n                    this.emit(\'changed\', output);\\\\n                } else {\\\\n                    this.emit(\'data\', output);\\\\n                }\\\\n\\\\n                if (_.isFunction(this.callback)) {\\\\n                    this.callback(null, output, this);\\\\n                }\\\\n            }\\\\n        },\\\\n        type: \'eth\',\\\\n        requestManager: this._requestManager\\\\n    });\\\\n    subscription.subscribe(\'logs\', subOptions.params, subOptions.callback || function () {});\\\\n\\\\n    return subscription;\\\\n};\\\\n\\\\n/**\\\\n * Get past events from contracts\\\\n *\\\\n * @method getPastEvents\\\\n * @param {String} event\\\\n * @param {Object} options\\\\n * @param {Function} callback\\\\n * @return {Object} the promievent\\\\n */\\\\nContract.prototype.getPastEvents = function(){\\\\n    var subOptions = this._generateEventOptions.apply(this, arguments);\\\\n\\\\n    var getPastLogs = new Method({\\\\n        name: \'getPastLogs\',\\\\n        call: \'eth_getLogs\',\\\\n        params: 1,\\\\n        inputFormatter: [formatters.inputLogFormatter],\\\\n        outputFormatter: this._decodeEventABI.bind(subOptions.event)\\\\n    });\\\\n    getPastLogs.setRequestManager(this._requestManager);\\\\n    var call = getPastLogs.buildCall();\\\\n\\\\n    getPastLogs = null;\\\\n\\\\n    return call(subOptions.params, subOptions.callback);\\\\n};\\\\n\\\\n\\\\n/**\\\\n * returns the an object with call, send, estimate functions\\\\n *\\\\n * @method _createTxObject\\\\n * @returns {Object} an object with functions to call the methods\\\\n */\\\\nContract.prototype._createTxObject =  function _createTxObject(){\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n    var txObject = {};\\\\n\\\\n    if(this.method.type === \'function\') {\\\\n\\\\n        txObject.call = this.parent._executeMethod.bind(txObject, \'call\');\\\\n        txObject.call.request = this.parent._executeMethod.bind(txObject, \'call\', true); // to make batch requests\\\\n\\\\n    }\\\\n\\\\n    txObject.send = this.parent._executeMethod.bind(txObject, \'send\');\\\\n    txObject.send.request = this.parent._executeMethod.bind(txObject, \'send\', true); // to make batch requests\\\\n    txObject.encodeABI = this.parent._encodeMethodABI.bind(txObject);\\\\n    txObject.estimateGas = this.parent._executeMethod.bind(txObject, \'estimate\');\\\\n\\\\n    if (args && this.method.inputs && args.length !== this.method.inputs.length) {\\\\n        if (this.nextMethod) {\\\\n            return this.nextMethod.apply(null, args);\\\\n        }\\\\n        throw errors.InvalidNumberOfParams(args.length, this.method.inputs.length, this.method.name);\\\\n    }\\\\n\\\\n    txObject.arguments = args || [];\\\\n    txObject._method = this.method;\\\\n    txObject._parent = this.parent;\\\\n    txObject._ethAccounts = this.parent.constructor._ethAccounts || this._ethAccounts;\\\\n\\\\n    if(this.deployData) {\\\\n        txObject._deployData = this.deployData;\\\\n    }\\\\n\\\\n    return txObject;\\\\n};\\\\n\\\\n\\\\n/**\\\\n * Generates the options for the execute call\\\\n *\\\\n * @method _processExecuteArguments\\\\n * @param {Array} args\\\\n * @param {Promise} defer\\\\n */\\\\nContract.prototype._processExecuteArguments = function _processExecuteArguments(args, defer) {\\\\n    var processedArgs = {};\\\\n\\\\n    processedArgs.type = args.shift();\\\\n\\\\n    // get the callback\\\\n    processedArgs.callback = this._parent._getCallback(args);\\\\n\\\\n    // get block number to use for call\\\\n    if(processedArgs.type === \'call\' && args[args.length - 1] !== true && (_.isString(args[args.length - 1]) || isFinite(args[args.length - 1])))\\\\n        processedArgs.defaultBlock = args.pop();\\\\n\\\\n    // get the options\\\\n    processedArgs.options = (_.isObject(args[args.length - 1])) ? args.pop() : {};\\\\n\\\\n    // get the generateRequest argument for batch requests\\\\n    processedArgs.generateRequest = (args[args.length - 1] === true)? args.pop() : false;\\\\n\\\\n    processedArgs.options = this._parent._getOrSetDefaultOptions(processedArgs.options);\\\\n    processedArgs.options.data = this.encodeABI();\\\\n\\\\n    // add contract address\\\\n    if(!this._deployData && !utils.isAddress(this._parent.options.address))\\\\n        throw new Error(\'This contract object doesn\\\\\\\\\'t have address set yet, please set an address first.\');\\\\n\\\\n    if(!this._deployData)\\\\n        processedArgs.options.to = this._parent.options.address;\\\\n\\\\n    // return error, if no \\\\\\"data\\\\\\" is specified\\\\n    if(!processedArgs.options.data)\\\\n        return utils._fireError(new Error(\'Couldn\\\\\\\\\'t find a matching contract method, or the number of parameters is wrong.\'), defer.eventEmitter, defer.reject, processedArgs.callback);\\\\n\\\\n    return processedArgs;\\\\n};\\\\n\\\\n/**\\\\n * Executes a call, transact or estimateGas on a contract function\\\\n *\\\\n * @method _executeMethod\\\\n * @param {String} type the type this execute function should execute\\\\n * @param {Boolean} makeRequest if true, it simply returns the request parameters, rather than executing it\\\\n */\\\\nContract.prototype._executeMethod = function _executeMethod(){\\\\n    var _this = this,\\\\n        args = this._parent._processExecuteArguments.call(this, Array.prototype.slice.call(arguments), defer),\\\\n        defer = promiEvent((args.type !== \'send\')),\\\\n        ethAccounts = _this.constructor._ethAccounts || _this._ethAccounts;\\\\n\\\\n    // simple return request for batch requests\\\\n    if(args.generateRequest) {\\\\n\\\\n        var payload = {\\\\n            params: [formatters.inputCallFormatter.call(this._parent, args.options), formatters.inputDefaultBlockNumberFormatter.call(this._parent, args.defaultBlock)],\\\\n            callback: args.callback\\\\n        };\\\\n\\\\n        if(args.type === \'call\') {\\\\n            payload.method = \'eth_call\';\\\\n            payload.format = this._parent._decodeMethodReturn.bind(null, this._method.outputs);\\\\n        } else {\\\\n            payload.method = \'eth_sendTransaction\';\\\\n        }\\\\n\\\\n        return payload;\\\\n\\\\n    } else {\\\\n\\\\n        switch (args.type) {\\\\n            case \'estimate\':\\\\n\\\\n                var estimateGas = (new Method({\\\\n                    name: \'estimateGas\',\\\\n                    call: \'eth_estimateGas\',\\\\n                    params: 1,\\\\n                    inputFormatter: [formatters.inputCallFormatter],\\\\n                    outputFormatter: utils.hexToNumber,\\\\n                    requestManager: _this._parent._requestManager,\\\\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\\\\n                    defaultAccount: _this._parent.defaultAccount,\\\\n                    defaultBlock: _this._parent.defaultBlock\\\\n                })).createFunction();\\\\n\\\\n                return estimateGas(args.options, args.callback);\\\\n\\\\n            case \'call\':\\\\n\\\\n                // TODO check errors: missing \\\\\\"from\\\\\\" should give error on deploy and send, call ?\\\\n\\\\n                var call = (new Method({\\\\n                    name: \'call\',\\\\n                    call: \'eth_call\',\\\\n                    params: 2,\\\\n                    inputFormatter: [formatters.inputCallFormatter, formatters.inputDefaultBlockNumberFormatter],\\\\n                    // add output formatter for decoding\\\\n                    outputFormatter: function (result) {\\\\n                        return _this._parent._decodeMethodReturn(_this._method.outputs, result);\\\\n                    },\\\\n                    requestManager: _this._parent._requestManager,\\\\n                    accounts: ethAccounts, // is eth.accounts (necessary for wallet signing)\\\\n                    defaultAccount: _this._parent.defaultAccount,\\\\n                    defaultBlock: _this._parent.defaultBlock\\\\n                })).createFunction();\\\\n\\\\n                return call(args.options, args.defaultBlock, args.callback);\\\\n\\\\n            case \'send\':\\\\n\\\\n                // return error, if no \\\\\\"from\\\\\\" is specified\\\\n                if(!utils.isAddress(args.options.from)) {\\\\n                    return utils._fireError(new Error(\'No \\\\\\"from\\\\\\" address specified in neither the given options, nor the default options.\'), defer.eventEmitter, defer.reject, args.callback);\\\\n                }\\\\n\\\\n                if (_.isBoolean(this._method.payable) && !this._method.payable && args.options.value && args.options.value > 0) {\\\\n                    return utils._fireError(new Error(\'Can not send value to non-payable contract method or constructor\'), defer.eventEmitter, defer.reject, args.callback);\\\\n                }\\\\n\\\\n\\\\n                // make sure receipt logs are decoded\\\\n                var extraFormatters = {\\\\n                    receiptFormatter: function (receipt) {\\\\n                        if (_.isArray(receipt.logs)) {\\\\n\\\\n                            // decode logs\\\\n                            var events = _.map(receipt.logs, function(log) {\\\\n                                return _this._parent._decodeEventABI.call({\\\\n                                    name: \'ALLEVENTS\',\\\\n                                    jsonInterface: _this._parent.options.jsonInterface\\\\n                                }, log);\\\\n                            });\\\\n\\\\n                            // make log names keys\\\\n                            receipt.events = {};\\\\n                            var count = 0;\\\\n                            events.forEach(function (ev) {\\\\n                                if (ev.event) {\\\\n                                    // if > 1 of the same event, don\'t overwrite any existing events\\\\n                                    if (receipt.events[ev.event]) {\\\\n                                        if (Array.isArray(receipt.events[ ev.event ])) {\\\\n                                            receipt.events[ ev.event ].push(ev);\\\\n                                        } else {\\\\n                                            receipt.events[ev.event] = [receipt.events[ev.event], ev];\\\\n                                        }\\\\n                                    } else {\\\\n                                        receipt.events[ ev.event ] = ev;\\\\n                                    }\\\\n                                } else {\\\\n                                    receipt.events[count] = ev;\\\\n                                    count++;\\\\n                                }\\\\n                            });\\\\n\\\\n                            delete receipt.logs;\\\\n                        }\\\\n                        return receipt;\\\\n                    },\\\\n                    contractDeployFormatter: function (receipt) {\\\\n                        var newContract = _this._parent.clone();\\\\n                        newContract.options.address = receipt.contractAddress;\\\\n                        return newContract;\\\\n                    }\\\\n                };\\\\n\\\\n                var sendTransaction = (new Method({\\\\n                    name: \'sendTransaction\',\\\\n                    call: \'eth_sendTransaction\',\\\\n                    params: 1,\\\\n                    inputFormatter: [formatters.inputTransactionFormatter],\\\\n                    requestManager: _this._parent._requestManager,\\\\n                    accounts: _this.constructor._ethAccounts || _this._ethAccounts, // is eth.accounts (necessary for wallet signing)\\\\n                    defaultAccount: _this._parent.defaultAccount,\\\\n                    defaultBlock: _this._parent.defaultBlock,\\\\n                    extraFormatters: extraFormatters\\\\n                })).createFunction();\\\\n\\\\n                return sendTransaction(args.options, args.callback);\\\\n\\\\n        }\\\\n\\\\n    }\\\\n\\\\n};\\\\n\\\\nmodule.exports = Contract;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth-contract/src/index.js\\\\n// module id = 356\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth-contract/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file getNetworkType.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\n\\\\nvar getNetworkType = function (callback) {\\\\n    var _this = this,\\\\n        id;\\\\n\\\\n\\\\n    return this.net.getId()\\\\n        .then(function (givenId) {\\\\n\\\\n            id = givenId;\\\\n\\\\n            return _this.getBlock(0);\\\\n        })\\\\n        .then(function (genesis) {\\\\n            var returnValue = \'private\';\\\\n\\\\n            if (genesis.hash === \'0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3\' &&\\\\n                id === 1) {\\\\n                returnValue = \'main\';\\\\n            }\\\\n            if (genesis.hash === \'0cd786a2425d16f152c658316c423e6ce1181e15c3295826d7c9904cba9ce303\' &&\\\\n                id === 2) {\\\\n                returnValue = \'morden\';\\\\n            }\\\\n            if (genesis.hash === \'0x41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d\' &&\\\\n                id === 3) {\\\\n                returnValue = \'ropsten\';\\\\n            }\\\\n            if (genesis.hash === \'0x6341fd3daf94b748c72ced5a5b26028f2474f5f00d824504e4fa37a75767e177\' &&\\\\n                id === 4) {\\\\n                returnValue = \'rinkeby\';\\\\n            }\\\\n            if (genesis.hash === \'0xa3c565fc15c7478862d50ccd6561e3c06b24cc509bf388941c25ea985ce32cb9\' &&\\\\n                id === 42) {\\\\n                returnValue = \'kovan\';\\\\n            }\\\\n\\\\n            if (_.isFunction(callback)) {\\\\n                callback(null, returnValue);\\\\n            }\\\\n\\\\n            return returnValue;\\\\n        })\\\\n        .catch(function (err) {\\\\n            if (_.isFunction(callback)) {\\\\n                callback(err);\\\\n            } else {\\\\n                throw err;\\\\n            }\\\\n        });\\\\n};\\\\n\\\\nmodule.exports = getNetworkType;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth/src/getNetworkType.js\\\\n// module id = 357\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth/src/getNetworkType.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar core = __webpack_require__(26);\\\\nvar helpers = __webpack_require__(7);\\\\nvar Subscriptions = __webpack_require__(57).subscriptions;\\\\nvar Method = __webpack_require__(25);\\\\nvar utils = __webpack_require__(10);\\\\nvar Net = __webpack_require__(58);\\\\n\\\\nvar Personal = __webpack_require__(163);\\\\nvar BaseContract = __webpack_require__(356);\\\\nvar Iban = __webpack_require__(162);\\\\nvar Accounts = __webpack_require__(355);\\\\nvar abi = __webpack_require__(157);\\\\n\\\\nvar getNetworkType = __webpack_require__(357);\\\\nvar formatter = helpers.formatters;\\\\n\\\\n\\\\nvar blockCall = function (args) {\\\\n    return (_.isString(args[0]) && args[0].indexOf(\'0x\') === 0) ? \\\\\\"eth_getBlockByHash\\\\\\" : \\\\\\"eth_getBlockByNumber\\\\\\";\\\\n};\\\\n\\\\nvar transactionFromBlockCall = function (args) {\\\\n    return (_.isString(args[0]) && args[0].indexOf(\'0x\') === 0) ? \'eth_getTransactionByBlockHashAndIndex\' : \'eth_getTransactionByBlockNumberAndIndex\';\\\\n};\\\\n\\\\nvar uncleCall = function (args) {\\\\n    return (_.isString(args[0]) && args[0].indexOf(\'0x\') === 0) ? \'eth_getUncleByBlockHashAndIndex\' : \'eth_getUncleByBlockNumberAndIndex\';\\\\n};\\\\n\\\\nvar getBlockTransactionCountCall = function (args) {\\\\n    return (_.isString(args[0]) && args[0].indexOf(\'0x\') === 0) ? \'eth_getBlockTransactionCountByHash\' : \'eth_getBlockTransactionCountByNumber\';\\\\n};\\\\n\\\\nvar uncleCountCall = function (args) {\\\\n    return (_.isString(args[0]) && args[0].indexOf(\'0x\') === 0) ? \'eth_getUncleCountByBlockHash\' : \'eth_getUncleCountByBlockNumber\';\\\\n};\\\\n\\\\n\\\\nvar Eth = function Eth() {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, arguments);\\\\n\\\\n    // overwrite setProvider\\\\n    var setProvider = this.setProvider;\\\\n    this.setProvider = function () {\\\\n        setProvider.apply(_this, arguments);\\\\n        _this.net.setProvider.apply(_this, arguments);\\\\n        _this.personal.setProvider.apply(_this, arguments);\\\\n        _this.accounts.setProvider.apply(_this, arguments);\\\\n        _this.Contract.setProvider(_this.currentProvider, _this.accounts);\\\\n    };\\\\n\\\\n\\\\n    var defaultAccount = null;\\\\n    var defaultBlock = \'latest\';\\\\n\\\\n    Object.defineProperty(this, \'defaultAccount\', {\\\\n        get: function () {\\\\n            return defaultAccount;\\\\n        },\\\\n        set: function (val) {\\\\n            if(val) {\\\\n                defaultAccount = utils.toChecksumAddress(formatter.inputAddressFormatter(val));\\\\n            }\\\\n\\\\n            // also set on the Contract object\\\\n            _this.Contract.defaultAccount = defaultAccount;\\\\n            _this.personal.defaultAccount = defaultAccount;\\\\n\\\\n            // update defaultBlock\\\\n            methods.forEach(function(method) {\\\\n                method.defaultAccount = defaultAccount;\\\\n            });\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n    Object.defineProperty(this, \'defaultBlock\', {\\\\n        get: function () {\\\\n            return defaultBlock;\\\\n        },\\\\n        set: function (val) {\\\\n            defaultBlock = val;\\\\n            // also set on the Contract object\\\\n            _this.Contract.defaultBlock = defaultBlock;\\\\n            _this.personal.defaultBlock = defaultBlock;\\\\n\\\\n            // update defaultBlock\\\\n            methods.forEach(function(method) {\\\\n                method.defaultBlock = defaultBlock;\\\\n            });\\\\n\\\\n            return val;\\\\n        },\\\\n        enumerable: true\\\\n    });\\\\n\\\\n\\\\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\\\\n\\\\n    // add net\\\\n    this.net = new Net(this.currentProvider);\\\\n    // add chain detection\\\\n    this.net.getNetworkType = getNetworkType.bind(this);\\\\n\\\\n    // add accounts\\\\n    this.accounts = new Accounts(this.currentProvider);\\\\n\\\\n    // add personal\\\\n    this.personal = new Personal(this.currentProvider);\\\\n    this.personal.defaultAccount = this.defaultAccount;\\\\n\\\\n    // create a proxy Contract type for this instance, as a Contract\'s provider\\\\n    // is stored as a class member rather than an instance variable. If we do\\\\n    // not create this proxy type, changing the provider in one instance of\\\\n    // web3-eth would subsequently change the provider for _all_ contract\\\\n    // instances!\\\\n    var Contract = function Contract() {\\\\n        BaseContract.apply(this, arguments);\\\\n    };\\\\n\\\\n    Contract.setProvider = function() {\\\\n        BaseContract.setProvider.apply(this, arguments);\\\\n    };\\\\n\\\\n    // make our proxy Contract inherit from web3-eth-contract so that it has all\\\\n    // the right functionality and so that instanceof and friends work properly\\\\n    Contract.prototype = Object.create(BaseContract.prototype);\\\\n    Contract.prototype.constructor = Contract;\\\\n\\\\n    // add contract\\\\n    this.Contract = Contract;\\\\n    this.Contract.defaultAccount = this.defaultAccount;\\\\n    this.Contract.defaultBlock = this.defaultBlock;\\\\n    this.Contract.setProvider(this.currentProvider, this.accounts);\\\\n\\\\n    // add IBAN\\\\n    this.Iban = Iban;\\\\n\\\\n    // add ABI\\\\n    this.abi = abi;\\\\n\\\\n\\\\n    var methods = [\\\\n        new Method({\\\\n            name: \'getProtocolVersion\',\\\\n            call: \'eth_protocolVersion\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getCoinbase\',\\\\n            call: \'eth_coinbase\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'isMining\',\\\\n            call: \'eth_mining\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getHashrate\',\\\\n            call: \'eth_hashrate\',\\\\n            params: 0,\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'isSyncing\',\\\\n            call: \'eth_syncing\',\\\\n            params: 0,\\\\n            outputFormatter: formatter.outputSyncingFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getGasPrice\',\\\\n            call: \'eth_gasPrice\',\\\\n            params: 0,\\\\n            outputFormatter: formatter.outputBigNumberFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getAccounts\',\\\\n            call: \'eth_accounts\',\\\\n            params: 0,\\\\n            outputFormatter: utils.toChecksumAddress\\\\n        }),\\\\n        new Method({\\\\n            name: \'getBlockNumber\',\\\\n            call: \'eth_blockNumber\',\\\\n            params: 0,\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'getBalance\',\\\\n            call: \'eth_getBalance\',\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\\\\n            outputFormatter: formatter.outputBigNumberFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getStorageAt\',\\\\n            call: \'eth_getStorageAt\',\\\\n            params: 3,\\\\n            inputFormatter: [formatter.inputAddressFormatter, utils.numberToHex, formatter.inputDefaultBlockNumberFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'getCode\',\\\\n            call: \'eth_getCode\',\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'getBlock\',\\\\n            call: blockCall,\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputBlockNumberFormatter, function (val) { return !!val; }],\\\\n            outputFormatter: formatter.outputBlockFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getUncle\',\\\\n            call: uncleCall,\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\\\\n            outputFormatter: formatter.outputBlockFormatter,\\\\n\\\\n        }),\\\\n        new Method({\\\\n            name: \'getBlockTransactionCount\',\\\\n            call: getBlockTransactionCountCall,\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputBlockNumberFormatter],\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'getBlockUncleCount\',\\\\n            call: uncleCountCall,\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputBlockNumberFormatter],\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'getTransaction\',\\\\n            call: \'eth_getTransactionByHash\',\\\\n            params: 1,\\\\n            inputFormatter: [null],\\\\n            outputFormatter: formatter.outputTransactionFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getTransactionFromBlock\',\\\\n            call: transactionFromBlockCall,\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputBlockNumberFormatter, utils.numberToHex],\\\\n            outputFormatter: formatter.outputTransactionFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getTransactionReceipt\',\\\\n            call: \'eth_getTransactionReceipt\',\\\\n            params: 1,\\\\n            inputFormatter: [null],\\\\n            outputFormatter: formatter.outputTransactionReceiptFormatter\\\\n        }),\\\\n        new Method({\\\\n            name: \'getTransactionCount\',\\\\n            call: \'eth_getTransactionCount\',\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputAddressFormatter, formatter.inputDefaultBlockNumberFormatter],\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'sendSignedTransaction\',\\\\n            call: \'eth_sendRawTransaction\',\\\\n            params: 1,\\\\n            inputFormatter: [null]\\\\n        }),\\\\n        new Method({\\\\n            name: \'signTransaction\',\\\\n            call: \'eth_signTransaction\',\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputTransactionFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'sendTransaction\',\\\\n            call: \'eth_sendTransaction\',\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputTransactionFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'sign\',\\\\n            call: \'eth_sign\',\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputSignFormatter, formatter.inputAddressFormatter],\\\\n            transformPayload: function (payload) {\\\\n                payload.params.reverse();\\\\n                return payload;\\\\n            }\\\\n        }),\\\\n        new Method({\\\\n            name: \'call\',\\\\n            call: \'eth_call\',\\\\n            params: 2,\\\\n            inputFormatter: [formatter.inputCallFormatter, formatter.inputDefaultBlockNumberFormatter]\\\\n        }),\\\\n        new Method({\\\\n            name: \'estimateGas\',\\\\n            call: \'eth_estimateGas\',\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputCallFormatter],\\\\n            outputFormatter: utils.hexToNumber\\\\n        }),\\\\n        new Method({\\\\n            name: \'getCompilers\',\\\\n            call: \'eth_getCompilers\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'compile.solidity\',\\\\n            call: \'eth_compileSolidity\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'compile.lll\',\\\\n            call: \'eth_compileLLL\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'compile.serpent\',\\\\n            call: \'eth_compileSerpent\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'submitWork\',\\\\n            call: \'eth_submitWork\',\\\\n            params: 3\\\\n        }),\\\\n        new Method({\\\\n            name: \'getWork\',\\\\n            call: \'eth_getWork\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getPastLogs\',\\\\n            call: \'eth_getLogs\',\\\\n            params: 1,\\\\n            inputFormatter: [formatter.inputLogFormatter],\\\\n            outputFormatter: formatter.outputLogFormatter\\\\n        }),\\\\n\\\\n        // subscriptions\\\\n        new Subscriptions({\\\\n            name: \'subscribe\',\\\\n            type: \'eth\',\\\\n            subscriptions: {\\\\n                \'newBlockHeaders\': {\\\\n                    // TODO rename on RPC side?\\\\n                    subscriptionName: \'newHeads\', // replace subscription with this name\\\\n                    params: 0,\\\\n                    outputFormatter: formatter.outputBlockFormatter\\\\n                },\\\\n                \'pendingTransactions\': {\\\\n                    subscriptionName: \'newPendingTransactions\', // replace subscription with this name\\\\n                    params: 0\\\\n                },\\\\n                \'logs\': {\\\\n                    params: 1,\\\\n                    inputFormatter: [formatter.inputLogFormatter],\\\\n                    outputFormatter: formatter.outputLogFormatter,\\\\n                    // DUBLICATE, also in web3-eth-contract\\\\n                    subscriptionHandler: function (output) {\\\\n                        if(output.removed) {\\\\n                            this.emit(\'changed\', output);\\\\n                        } else {\\\\n                            this.emit(\'data\', output);\\\\n                        }\\\\n\\\\n                        if (_.isFunction(this.callback)) {\\\\n                            this.callback(null, output, this);\\\\n                        }\\\\n                    }\\\\n                },\\\\n                \'syncing\': {\\\\n                    params: 0,\\\\n                    outputFormatter: formatter.outputSyncingFormatter,\\\\n                    subscriptionHandler: function (output) {\\\\n                        var _this = this;\\\\n\\\\n                        // fire TRUE at start\\\\n                        if(this._isSyncing !== true) {\\\\n                            this._isSyncing = true;\\\\n                            this.emit(\'changed\', _this._isSyncing);\\\\n\\\\n                            if (_.isFunction(this.callback)) {\\\\n                                this.callback(null, _this._isSyncing, this);\\\\n                            }\\\\n\\\\n                            setTimeout(function () {\\\\n                                _this.emit(\'data\', output);\\\\n\\\\n                                if (_.isFunction(_this.callback)) {\\\\n                                    _this.callback(null, output, _this);\\\\n                                }\\\\n                            }, 0);\\\\n\\\\n                            // fire sync status\\\\n                        } else {\\\\n                            this.emit(\'data\', output);\\\\n                            if (_.isFunction(_this.callback)) {\\\\n                                this.callback(null, output, this);\\\\n                            }\\\\n\\\\n                            // wait for some time before fireing the FALSE\\\\n                            clearTimeout(this._isSyncingTimeout);\\\\n                            this._isSyncingTimeout = setTimeout(function () {\\\\n                                if(output.currentBlock > output.highestBlock - 200) {\\\\n                                    _this._isSyncing = false;\\\\n                                    _this.emit(\'changed\', _this._isSyncing);\\\\n\\\\n                                    if (_.isFunction(_this.callback)) {\\\\n                                        _this.callback(null, _this._isSyncing, _this);\\\\n                                    }\\\\n                                }\\\\n                            }, 500);\\\\n                        }\\\\n                    }\\\\n                }\\\\n            }\\\\n        })\\\\n    ];\\\\n\\\\n    methods.forEach(function(method) {\\\\n        method.attachToObject(_this);\\\\n        method.setRequestManager(_this._requestManager, _this.accounts); // second param means is eth.accounts (necessary for wallet signing)\\\\n        method.defaultBlock = _this.defaultBlock;\\\\n        method.defaultAccount = _this.defaultAccount;\\\\n    });\\\\n\\\\n};\\\\n\\\\ncore.addProviders(Eth);\\\\n\\\\n\\\\nmodule.exports = Eth;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-eth/src/index.js\\\\n// module id = 358\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-eth/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/** @file httpprovider.js\\\\n * @authors:\\\\n *   Marek Kotewicz <marek@parity.io>\\\\n *   Marian Oancea\\\\n *   Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2015\\\\n */\\\\n\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar XHR2 = __webpack_require__(375); // jshint ignore: line\\\\n\\\\n/**\\\\n * HttpProvider should be used to send rpc calls over http\\\\n */\\\\nvar HttpProvider = function HttpProvider(host, timeout, headers) {\\\\n    this.host = host || \'http://localhost:8545\';\\\\n    this.timeout = timeout || 0;\\\\n    this.connected = false;\\\\n    this.headers = headers;\\\\n};\\\\n\\\\nHttpProvider.prototype._prepareRequest = function(){\\\\n    var request = new XHR2();\\\\n\\\\n    request.open(\'POST\', this.host, true);\\\\n    request.setRequestHeader(\'Content-Type\',\'application/json\');\\\\n\\\\n    if(this.headers) {\\\\n        this.headers.forEach(function(header) {\\\\n            request.setRequestHeader(header.name, header.value);\\\\n        });\\\\n    }\\\\n\\\\n    return request;\\\\n};\\\\n\\\\n/**\\\\n * Should be used to make async request\\\\n *\\\\n * @method send\\\\n * @param {Object} payload\\\\n * @param {Function} callback triggered on end with (err, result)\\\\n */\\\\nHttpProvider.prototype.send = function (payload, callback) {\\\\n    var _this = this;\\\\n    var request = this._prepareRequest();\\\\n\\\\n\\\\n    request.onreadystatechange = function() {\\\\n        if (request.readyState === 4 && request.timeout !== 1) {\\\\n            var result = request.responseText;\\\\n            var error = null;\\\\n\\\\n            try {\\\\n                result = JSON.parse(result);\\\\n            } catch(e) {\\\\n                error = errors.InvalidResponse(request.responseText);\\\\n            }\\\\n\\\\n            _this.connected = true;\\\\n            callback(error, result);\\\\n        }\\\\n    };\\\\n\\\\n    request.ontimeout = function() {\\\\n        _this.connected = false;\\\\n        callback(errors.ConnectionTimeout(this.timeout));\\\\n    };\\\\n\\\\n    try {\\\\n        request.send(JSON.stringify(payload));\\\\n    } catch(error) {\\\\n        this.connected = false;\\\\n        callback(errors.InvalidConnection(this.host));\\\\n    }\\\\n};\\\\n\\\\n\\\\nmodule.exports = HttpProvider;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-providers-http/src/index.js\\\\n// module id = 359\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-providers-http/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/** @file index.js\\\\n * @authors:\\\\n *   Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar errors = __webpack_require__(7).errors;\\\\nvar oboe = __webpack_require__(284);\\\\n\\\\n\\\\nvar IpcProvider = function IpcProvider(path, net) {\\\\n    var _this = this;\\\\n    this.responseCallbacks = {};\\\\n    this.notificationCallbacks = [];\\\\n    this.path = path;\\\\n\\\\n    this.connection = net.connect({path: this.path});\\\\n\\\\n    this.addDefaultEvents();\\\\n\\\\n    // LISTEN FOR CONNECTION RESPONSES\\\\n    var callback = function(result) {\\\\n        /*jshint maxcomplexity: 6 */\\\\n\\\\n        var id = null;\\\\n\\\\n        // get the id which matches the returned id\\\\n        if(_.isArray(result)) {\\\\n            result.forEach(function(load){\\\\n                if(_this.responseCallbacks[load.id])\\\\n                    id = load.id;\\\\n            });\\\\n        } else {\\\\n            id = result.id;\\\\n        }\\\\n\\\\n        // notification\\\\n        if(!id && result.method.indexOf(\'_subscription\') !== -1) {\\\\n            _this.notificationCallbacks.forEach(function(callback){\\\\n                if(_.isFunction(callback))\\\\n                    callback(null, result);\\\\n            });\\\\n\\\\n            // fire the callback\\\\n        } else if(_this.responseCallbacks[id]) {\\\\n            _this.responseCallbacks[id](null, result);\\\\n            delete _this.responseCallbacks[id];\\\\n        }\\\\n    };\\\\n\\\\n    // use oboe.js for Sockets\\\\n    if (net.constructor.name === \'Socket\') {\\\\n        oboe(this.connection)\\\\n        .done(callback);\\\\n    } else {\\\\n        this.connection.on(\'data\', function(data){\\\\n            _this._parseResponse(data.toString()).forEach(callback);\\\\n        });\\\\n    }\\\\n};\\\\n\\\\n/**\\\\nWill add the error and end event to timeout existing calls\\\\n\\\\n@method addDefaultEvents\\\\n*/\\\\nIpcProvider.prototype.addDefaultEvents = function(){\\\\n    var _this = this;\\\\n\\\\n    this.connection.on(\'connect\', function(){\\\\n    });\\\\n\\\\n    this.connection.on(\'error\', function(){\\\\n        _this._timeout();\\\\n    });\\\\n\\\\n    this.connection.on(\'end\', function(){\\\\n        _this._timeout();\\\\n\\\\n        // inform notifications\\\\n        _this.notificationCallbacks.forEach(function (callback) {\\\\n            if (_.isFunction(callback))\\\\n                callback(new Error(\'IPC socket connection closed\'));\\\\n        });\\\\n    });\\\\n\\\\n    this.connection.on(\'timeout\', function(){\\\\n        _this._timeout();\\\\n    });\\\\n};\\\\n\\\\n\\\\n/**\\\\n Will parse the response and make an array out of it.\\\\n\\\\n NOTE, this exists for backwards compatibility reasons.\\\\n\\\\n @method _parseResponse\\\\n @param {String} data\\\\n */\\\\nIpcProvider.prototype._parseResponse = function(data) {\\\\n    var _this = this,\\\\n        returnValues = [];\\\\n\\\\n    // DE-CHUNKER\\\\n    var dechunkedData = data\\\\n        .replace(/\\\\\\\\}[\\\\\\\\n\\\\\\\\r]?\\\\\\\\{/g,\'}|--|{\') // }{\\\\n        .replace(/\\\\\\\\}\\\\\\\\][\\\\\\\\n\\\\\\\\r]?\\\\\\\\[\\\\\\\\{/g,\'}]|--|[{\') // }][{\\\\n        .replace(/\\\\\\\\}[\\\\\\\\n\\\\\\\\r]?\\\\\\\\[\\\\\\\\{/g,\'}|--|[{\') // }[{\\\\n        .replace(/\\\\\\\\}\\\\\\\\][\\\\\\\\n\\\\\\\\r]?\\\\\\\\{/g,\'}]|--|{\') // }]{\\\\n        .split(\'|--|\');\\\\n\\\\n    dechunkedData.forEach(function(data){\\\\n\\\\n        // prepend the last chunk\\\\n        if(_this.lastChunk)\\\\n            data = _this.lastChunk + data;\\\\n\\\\n        var result = null;\\\\n\\\\n        try {\\\\n            result = JSON.parse(data);\\\\n\\\\n        } catch(e) {\\\\n\\\\n            _this.lastChunk = data;\\\\n\\\\n            // start timeout to cancel all requests\\\\n            clearTimeout(_this.lastChunkTimeout);\\\\n            _this.lastChunkTimeout = setTimeout(function(){\\\\n                _this._timeout();\\\\n                throw errors.InvalidResponse(data);\\\\n            }, 1000 * 15);\\\\n\\\\n            return;\\\\n        }\\\\n\\\\n        // cancel timeout and set chunk to null\\\\n        clearTimeout(_this.lastChunkTimeout);\\\\n        _this.lastChunk = null;\\\\n\\\\n        if(result)\\\\n            returnValues.push(result);\\\\n    });\\\\n\\\\n    return returnValues;\\\\n};\\\\n\\\\n\\\\n/**\\\\nGet the adds a callback to the responseCallbacks object,\\\\nwhich will be called if a response matching the response Id will arrive.\\\\n\\\\n@method _addResponseCallback\\\\n*/\\\\nIpcProvider.prototype._addResponseCallback = function(payload, callback) {\\\\n    var id = payload.id || payload[0].id;\\\\n    var method = payload.method || payload[0].method;\\\\n\\\\n    this.responseCallbacks[id] = callback;\\\\n    this.responseCallbacks[id].method = method;\\\\n};\\\\n\\\\n/**\\\\nTimeout all requests when the end/error event is fired\\\\n\\\\n@method _timeout\\\\n*/\\\\nIpcProvider.prototype._timeout = function() {\\\\n    for(var key in this.responseCallbacks) {\\\\n        if(this.responseCallbacks.hasOwnProperty(key)){\\\\n            this.responseCallbacks[key](errors.InvalidConnection(\'on IPC\'));\\\\n            delete this.responseCallbacks[key];\\\\n        }\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n Try to reconnect\\\\n\\\\n @method reconnect\\\\n */\\\\nIpcProvider.prototype.reconnect = function() {\\\\n    this.connection.connect({path: this.path});\\\\n};\\\\n\\\\n\\\\nIpcProvider.prototype.send = function (payload, callback) {\\\\n    // try reconnect, when connection is gone\\\\n    if(!this.connection.writable)\\\\n        this.connection.connect({path: this.path});\\\\n\\\\n\\\\n    this.connection.write(JSON.stringify(payload));\\\\n    this._addResponseCallback(payload, callback);\\\\n};\\\\n\\\\n/**\\\\nSubscribes to provider events.provider\\\\n\\\\n@method on\\\\n@param {String} type    \'notification\', \'connect\', \'error\', \'end\' or \'data\'\\\\n@param {Function} callback   the callback to call\\\\n*/\\\\nIpcProvider.prototype.on = function (type, callback) {\\\\n\\\\n    if(typeof callback !== \'function\')\\\\n        throw new Error(\'The second parameter callback must be a function.\');\\\\n\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks.push(callback);\\\\n            break;\\\\n\\\\n        default:\\\\n            this.connection.on(type, callback);\\\\n            break;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n Subscribes to provider events.provider\\\\n\\\\n @method on\\\\n @param {String} type    \'connect\', \'error\', \'end\' or \'data\'\\\\n @param {Function} callback   the callback to call\\\\n */\\\\nIpcProvider.prototype.once = function (type, callback) {\\\\n\\\\n    if(typeof callback !== \'function\')\\\\n        throw new Error(\'The second parameter callback must be a function.\');\\\\n\\\\n    this.connection.once(type, callback);\\\\n};\\\\n\\\\n/**\\\\nRemoves event listener\\\\n\\\\n@method removeListener\\\\n@param {String} type    \'data\', \'connect\', \'error\', \'end\' or \'data\'\\\\n@param {Function} callback   the callback to call\\\\n*/\\\\nIpcProvider.prototype.removeListener = function (type, callback) {\\\\n    var _this = this;\\\\n\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks.forEach(function(cb, index){\\\\n                if(cb === callback)\\\\n                    _this.notificationCallbacks.splice(index, 1);\\\\n            });\\\\n            break;\\\\n\\\\n        default:\\\\n            this.connection.removeListener(type, callback);\\\\n            break;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\nRemoves all event listeners\\\\n\\\\n@method removeAllListeners\\\\n@param {String} type    \'data\', \'connect\', \'error\', \'end\' or \'data\'\\\\n*/\\\\nIpcProvider.prototype.removeAllListeners = function (type) {\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks = [];\\\\n            break;\\\\n\\\\n        default:\\\\n            this.connection.removeAllListeners(type);\\\\n            break;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\nResets the providers, clears all callbacks\\\\n\\\\n@method reset\\\\n*/\\\\nIpcProvider.prototype.reset = function () {\\\\n    this._timeout();\\\\n    this.notificationCallbacks = [];\\\\n\\\\n    this.connection.removeAllListeners(\'error\');\\\\n    this.connection.removeAllListeners(\'end\');\\\\n    this.connection.removeAllListeners(\'timeout\');\\\\n\\\\n    this.addDefaultEvents();\\\\n};\\\\n\\\\nmodule.exports = IpcProvider;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-providers-ipc/src/index.js\\\\n// module id = 360\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-providers-ipc/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/** @file WebsocketProvider.js\\\\n * @authors:\\\\n *   Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar errors = __webpack_require__(7).errors;\\\\n\\\\nvar Ws = null;\\\\nif (typeof window !== \'undefined\') {\\\\n    Ws = window.WebSocket;\\\\n} else {\\\\n    Ws = __webpack_require__(366).w3cwebsocket;\\\\n}\\\\n// Default connection ws://localhost:8546\\\\n\\\\n\\\\n\\\\nvar WebsocketProvider = function WebsocketProvider(url)  {\\\\n    var _this = this;\\\\n    this.responseCallbacks = {};\\\\n    this.notificationCallbacks = [];\\\\n    this.connection = new Ws(url);\\\\n\\\\n\\\\n    this.addDefaultEvents();\\\\n\\\\n\\\\n    // LISTEN FOR CONNECTION RESPONSES\\\\n    this.connection.onmessage = function(e) {\\\\n        /*jshint maxcomplexity: 6 */\\\\n        var data = (typeof e.data === \'string\') ? e.data : \'\';\\\\n\\\\n        _this._parseResponse(data).forEach(function(result){\\\\n\\\\n            var id = null;\\\\n\\\\n            // get the id which matches the returned id\\\\n            if(_.isArray(result)) {\\\\n                result.forEach(function(load){\\\\n                    if(_this.responseCallbacks[load.id])\\\\n                        id = load.id;\\\\n                });\\\\n            } else {\\\\n                id = result.id;\\\\n            }\\\\n\\\\n            // notification\\\\n            if(!id && result.method.indexOf(\'_subscription\') !== -1) {\\\\n                _this.notificationCallbacks.forEach(function(callback){\\\\n                    if(_.isFunction(callback))\\\\n                        callback(null, result);\\\\n                });\\\\n\\\\n                // fire the callback\\\\n            } else if(_this.responseCallbacks[id]) {\\\\n                _this.responseCallbacks[id](null, result);\\\\n                delete _this.responseCallbacks[id];\\\\n            }\\\\n        });\\\\n    };\\\\n};\\\\n\\\\n/**\\\\n Will add the error and end event to timeout existing calls\\\\n\\\\n @method addDefaultEvents\\\\n */\\\\nWebsocketProvider.prototype.addDefaultEvents = function(){\\\\n    var _this = this;\\\\n\\\\n    this.connection.onerror = function(){\\\\n        _this._timeout();\\\\n    };\\\\n\\\\n    this.connection.onclose = function(e){\\\\n        _this._timeout();\\\\n\\\\n        var noteCb = _this.notificationCallbacks;\\\\n\\\\n        // reset all requests and callbacks\\\\n        _this.reset();\\\\n\\\\n        // cancel subscriptions\\\\n        noteCb.forEach(function (callback) {\\\\n            if (_.isFunction(callback))\\\\n                callback(e);\\\\n        });\\\\n    };\\\\n\\\\n    // this.connection.on(\'timeout\', function(){\\\\n    //     _this._timeout();\\\\n    // });\\\\n};\\\\n\\\\n/**\\\\n Will parse the response and make an array out of it.\\\\n\\\\n @method _parseResponse\\\\n @param {String} data\\\\n */\\\\nWebsocketProvider.prototype._parseResponse = function(data) {\\\\n    var _this = this,\\\\n        returnValues = [];\\\\n\\\\n    // DE-CHUNKER\\\\n    var dechunkedData = data\\\\n        .replace(/\\\\\\\\}[\\\\\\\\n\\\\\\\\r]?\\\\\\\\{/g,\'}|--|{\') // }{\\\\n        .replace(/\\\\\\\\}\\\\\\\\][\\\\\\\\n\\\\\\\\r]?\\\\\\\\[\\\\\\\\{/g,\'}]|--|[{\') // }][{\\\\n        .replace(/\\\\\\\\}[\\\\\\\\n\\\\\\\\r]?\\\\\\\\[\\\\\\\\{/g,\'}|--|[{\') // }[{\\\\n        .replace(/\\\\\\\\}\\\\\\\\][\\\\\\\\n\\\\\\\\r]?\\\\\\\\{/g,\'}]|--|{\') // }]{\\\\n        .split(\'|--|\');\\\\n\\\\n    dechunkedData.forEach(function(data){\\\\n\\\\n        // prepend the last chunk\\\\n        if(_this.lastChunk)\\\\n            data = _this.lastChunk + data;\\\\n\\\\n        var result = null;\\\\n\\\\n        try {\\\\n            result = JSON.parse(data);\\\\n\\\\n        } catch(e) {\\\\n\\\\n            _this.lastChunk = data;\\\\n\\\\n            // start timeout to cancel all requests\\\\n            clearTimeout(_this.lastChunkTimeout);\\\\n            _this.lastChunkTimeout = setTimeout(function(){\\\\n                _this._timeout();\\\\n                throw errors.InvalidResponse(data);\\\\n            }, 1000 * 15);\\\\n\\\\n            return;\\\\n        }\\\\n\\\\n        // cancel timeout and set chunk to null\\\\n        clearTimeout(_this.lastChunkTimeout);\\\\n        _this.lastChunk = null;\\\\n\\\\n        if(result)\\\\n            returnValues.push(result);\\\\n    });\\\\n\\\\n    return returnValues;\\\\n};\\\\n\\\\n\\\\n/**\\\\n Get the adds a callback to the responseCallbacks object,\\\\n which will be called if a response matching the response Id will arrive.\\\\n\\\\n @method _addResponseCallback\\\\n */\\\\nWebsocketProvider.prototype._addResponseCallback = function(payload, callback) {\\\\n    var id = payload.id || payload[0].id;\\\\n    var method = payload.method || payload[0].method;\\\\n\\\\n    this.responseCallbacks[id] = callback;\\\\n    this.responseCallbacks[id].method = method;\\\\n};\\\\n\\\\n/**\\\\n Timeout all requests when the end/error event is fired\\\\n\\\\n @method _timeout\\\\n */\\\\nWebsocketProvider.prototype._timeout = function() {\\\\n    for(var key in this.responseCallbacks) {\\\\n        if(this.responseCallbacks.hasOwnProperty(key)){\\\\n            this.responseCallbacks[key](errors.InvalidConnection(\'on IPC\'));\\\\n            delete this.responseCallbacks[key];\\\\n        }\\\\n    }\\\\n};\\\\n\\\\n\\\\nWebsocketProvider.prototype.send = function (payload, callback) {\\\\n    var _this = this;\\\\n\\\\n    if (this.connection.readyState === this.connection.CONNECTING) {\\\\n        setTimeout(function () {\\\\n            _this.send(payload, callback);\\\\n        }, 10);\\\\n        return;\\\\n    }\\\\n\\\\n    // try reconnect, when connection is gone\\\\n    // if(!this.connection.writable)\\\\n    //     this.connection.connect({url: this.url});\\\\n    if (this.connection.readyState !== this.connection.OPEN) {\\\\n        console.error(\'connection not open on send()\');\\\\n        if (typeof this.connection.onerror === \'function\') {\\\\n            this.connection.onerror(new Error(\'connection not open\'));\\\\n        } else {\\\\n            console.error(\'no error callback\');\\\\n        }\\\\n        callback(new Error(\'connection not open\'));\\\\n        return;\\\\n    }\\\\n\\\\n    this.connection.send(JSON.stringify(payload));\\\\n    this._addResponseCallback(payload, callback);\\\\n};\\\\n\\\\n/**\\\\n Subscribes to provider events.provider\\\\n\\\\n @method on\\\\n @param {String} type    \'notifcation\', \'connect\', \'error\', \'end\' or \'data\'\\\\n @param {Function} callback   the callback to call\\\\n */\\\\nWebsocketProvider.prototype.on = function (type, callback) {\\\\n\\\\n    if(typeof callback !== \'function\')\\\\n        throw new Error(\'The second parameter callback must be a function.\');\\\\n\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks.push(callback);\\\\n            break;\\\\n\\\\n        case \'connect\':\\\\n            this.connection.onopen = callback;\\\\n            break;\\\\n\\\\n        case \'end\':\\\\n            this.connection.onclose = callback;\\\\n            break;\\\\n\\\\n        case \'error\':\\\\n            this.connection.onerror = callback;\\\\n            break;\\\\n\\\\n        // default:\\\\n        //     this.connection.on(type, callback);\\\\n        //     break;\\\\n    }\\\\n};\\\\n\\\\n// TODO add once\\\\n\\\\n/**\\\\n Removes event listener\\\\n\\\\n @method removeListener\\\\n @param {String} type    \'notifcation\', \'connect\', \'error\', \'end\' or \'data\'\\\\n @param {Function} callback   the callback to call\\\\n */\\\\nWebsocketProvider.prototype.removeListener = function (type, callback) {\\\\n    var _this = this;\\\\n\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks.forEach(function(cb, index){\\\\n                if(cb === callback)\\\\n                    _this.notificationCallbacks.splice(index, 1);\\\\n            });\\\\n            break;\\\\n\\\\n        // TODO remvoving connect missing\\\\n\\\\n        // default:\\\\n        //     this.connection.removeListener(type, callback);\\\\n        //     break;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n Removes all event listeners\\\\n\\\\n @method removeAllListeners\\\\n @param {String} type    \'notifcation\', \'connect\', \'error\', \'end\' or \'data\'\\\\n */\\\\nWebsocketProvider.prototype.removeAllListeners = function (type) {\\\\n    switch(type){\\\\n        case \'data\':\\\\n            this.notificationCallbacks = [];\\\\n            break;\\\\n\\\\n        // TODO remvoving connect properly missing\\\\n\\\\n        case \'connect\':\\\\n            this.connection.onopen = null;\\\\n            break;\\\\n\\\\n        case \'end\':\\\\n            this.connection.onclose = null;\\\\n            break;\\\\n\\\\n        case \'error\':\\\\n            this.connection.onerror = null;\\\\n            break;\\\\n\\\\n        default:\\\\n            // this.connection.removeAllListeners(type);\\\\n            break;\\\\n    }\\\\n};\\\\n\\\\n/**\\\\n Resets the providers, clears all callbacks\\\\n\\\\n @method reset\\\\n */\\\\nWebsocketProvider.prototype.reset = function () {\\\\n    this._timeout();\\\\n    this.notificationCallbacks = [];\\\\n\\\\n    // this.connection.removeAllListeners(\'error\');\\\\n    // this.connection.removeAllListeners(\'end\');\\\\n    // this.connection.removeAllListeners(\'timeout\');\\\\n\\\\n    this.addDefaultEvents();\\\\n};\\\\n\\\\nmodule.exports = WebsocketProvider;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-providers-ws/src/index.js\\\\n// module id = 361\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-providers-ws/src/index.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\nvar core = __webpack_require__(26);\\\\nvar Subscriptions = __webpack_require__(57).subscriptions;\\\\nvar Method = __webpack_require__(25);\\\\n// var formatters = require(\'web3-core-helpers\').formatters;\\\\nvar Net = __webpack_require__(58);\\\\n\\\\n\\\\nvar Shh = function Shh() {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager\\\\n    core.packageInit(this, arguments);\\\\n\\\\n    // overwrite setProvider\\\\n    var setProvider = this.setProvider;\\\\n    this.setProvider = function () {\\\\n        setProvider.apply(_this, arguments);\\\\n        _this.net.setProvider.apply(_this, arguments);\\\\n    };\\\\n\\\\n    this.clearSubscriptions = _this._requestManager.clearSubscriptions;\\\\n\\\\n    this.net = new Net(this.currentProvider);\\\\n\\\\n\\\\n    [\\\\n        new Subscriptions({\\\\n            name: \'subscribe\',\\\\n            type: \'shh\',\\\\n            subscriptions: {\\\\n                \'messages\': {\\\\n                    params: 1\\\\n                    // inputFormatter: [formatters.inputPostFormatter],\\\\n                    // outputFormatter: formatters.outputPostFormatter\\\\n                }\\\\n            }\\\\n        }),\\\\n\\\\n        new Method({\\\\n            name: \'getVersion\',\\\\n            call: \'shh_version\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'getInfo\',\\\\n            call: \'shh_info\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'setMaxMessageSize\',\\\\n            call: \'shh_setMaxMessageSize\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'setMinPoW\',\\\\n            call: \'shh_setMinPoW\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'markTrustedPeer\',\\\\n            call: \'shh_markTrustedPeer\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'newKeyPair\',\\\\n            call: \'shh_newKeyPair\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'addPrivateKey\',\\\\n            call: \'shh_addPrivateKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'deleteKeyPair\',\\\\n            call: \'shh_deleteKeyPair\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'hasKeyPair\',\\\\n            call: \'shh_hasKeyPair\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'getPublicKey\',\\\\n            call: \'shh_getPublicKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'getPrivateKey\',\\\\n            call: \'shh_getPrivateKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'newSymKey\',\\\\n            call: \'shh_newSymKey\',\\\\n            params: 0\\\\n        }),\\\\n        new Method({\\\\n            name: \'addSymKey\',\\\\n            call: \'shh_addSymKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'generateSymKeyFromPassword\',\\\\n            call: \'shh_generateSymKeyFromPassword\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'hasSymKey\',\\\\n            call: \'shh_hasSymKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'getSymKey\',\\\\n            call: \'shh_getSymKey\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'deleteSymKey\',\\\\n            call: \'shh_deleteSymKey\',\\\\n            params: 1\\\\n        }),\\\\n\\\\n        new Method({\\\\n            name: \'newMessageFilter\',\\\\n            call: \'shh_newMessageFilter\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'getFilterMessages\',\\\\n            call: \'shh_getFilterMessages\',\\\\n            params: 1\\\\n        }),\\\\n        new Method({\\\\n            name: \'deleteMessageFilter\',\\\\n            call: \'shh_deleteMessageFilter\',\\\\n            params: 1\\\\n        }),\\\\n\\\\n        new Method({\\\\n            name: \'post\',\\\\n            call: \'shh_post\',\\\\n            params: 1,\\\\n            inputFormatter: [null]\\\\n        })\\\\n    ].forEach(function(method) {\\\\n        method.attachToObject(_this);\\\\n        method.setRequestManager(_this._requestManager);\\\\n    });\\\\n};\\\\n\\\\ncore.addProviders(Shh);\\\\n\\\\n\\\\n\\\\nmodule.exports = Shh;\\\\n\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-shh/src/index.js\\\\n// module id = 362\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-shh/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"/*\\\\n This file is part of web3.js.\\\\n\\\\n web3.js is free software: you can redistribute it and/or modify\\\\n it under the terms of the GNU Lesser General Public License as published by\\\\n the Free Software Foundation, either version 3 of the License, or\\\\n (at your option) any later version.\\\\n\\\\n web3.js is distributed in the hope that it will be useful,\\\\n but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n GNU Lesser General Public License for more details.\\\\n\\\\n You should have received a copy of the GNU Lesser General Public License\\\\n along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n */\\\\n/**\\\\n * @file soliditySha3.js\\\\n * @author Fabian Vogelsteller <fabian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\nvar _ = __webpack_require__(5);\\\\nvar BN = __webpack_require__(164);\\\\nvar utils = __webpack_require__(165);\\\\n\\\\n\\\\nvar _elementaryName = function (name) {\\\\n    /*jshint maxcomplexity:false */\\\\n\\\\n    if (name.startsWith(\'int[\')) {\\\\n        return \'int256\' + name.slice(3);\\\\n    } else if (name === \'int\') {\\\\n        return \'int256\';\\\\n    } else if (name.startsWith(\'uint[\')) {\\\\n        return \'uint256\' + name.slice(4);\\\\n    } else if (name === \'uint\') {\\\\n        return \'uint256\';\\\\n    } else if (name.startsWith(\'fixed[\')) {\\\\n        return \'fixed128x128\' + name.slice(5);\\\\n    } else if (name === \'fixed\') {\\\\n        return \'fixed128x128\';\\\\n    } else if (name.startsWith(\'ufixed[\')) {\\\\n        return \'ufixed128x128\' + name.slice(6);\\\\n    } else if (name === \'ufixed\') {\\\\n        return \'ufixed128x128\';\\\\n    }\\\\n    return name;\\\\n};\\\\n\\\\n// Parse N from type<N>\\\\nvar _parseTypeN = function (type) {\\\\n    var typesize = /^\\\\\\\\D+(\\\\\\\\d+).*$/.exec(type);\\\\n    return typesize ? parseInt(typesize[1], 10) : null;\\\\n};\\\\n\\\\n// Parse N from type[<N>]\\\\nvar _parseTypeNArray = function (type) {\\\\n    var arraySize = /^\\\\\\\\D+\\\\\\\\d*\\\\\\\\[(\\\\\\\\d+)\\\\\\\\]$/.exec(type);\\\\n    return arraySize ? parseInt(arraySize[1], 10) : null;\\\\n};\\\\n\\\\nvar _parseNumber = function (arg) {\\\\n    var type = typeof arg;\\\\n    if (type === \'string\') {\\\\n        if (utils.isHexStrict(arg)) {\\\\n            return new BN(arg.replace(/0x/i,\'\'), 16);\\\\n        } else {\\\\n            return new BN(arg, 10);\\\\n        }\\\\n    } else if (type === \'number\') {\\\\n        return new BN(arg);\\\\n    } else if (utils.isBigNumber(arg)) {\\\\n        return new BN(arg.toString(10));\\\\n    } else if (utils.isBN(arg)) {\\\\n        return arg;\\\\n    } else {\\\\n        throw new Error(arg +\' is not a number\');\\\\n    }\\\\n};\\\\n\\\\nvar _solidityPack = function (type, value, arraySize) {\\\\n    /*jshint maxcomplexity:false */\\\\n\\\\n    var size, num;\\\\n    type = _elementaryName(type);\\\\n\\\\n\\\\n    if (type === \'bytes\') {\\\\n\\\\n        if (value.replace(/^0x/i,\'\').length % 2 !== 0) {\\\\n            throw new Error(\'Invalid bytes characters \'+ value.length);\\\\n        }\\\\n\\\\n        return value;\\\\n    } else if (type === \'string\') {\\\\n        return utils.utf8ToHex(value);\\\\n    } else if (type === \'bool\') {\\\\n        return value ? \'01\' : \'00\';\\\\n    } else if (type.startsWith(\'address\')) {\\\\n        if(arraySize) {\\\\n            size = 64;\\\\n        } else {\\\\n            size = 40;\\\\n        }\\\\n\\\\n        if(!utils.isAddress(value)) {\\\\n            throw new Error(value +\' is not a valid address, or the checksum is invalid.\');\\\\n        }\\\\n\\\\n        return utils.leftPad(value.toLowerCase(), size);\\\\n    }\\\\n\\\\n    size = _parseTypeN(type);\\\\n\\\\n    if (type.startsWith(\'bytes\')) {\\\\n\\\\n        if(!size) {\\\\n            throw new Error(\'bytes[] not yet supported in solidity\');\\\\n        }\\\\n\\\\n        // must be 32 byte slices when in an array\\\\n        if(arraySize) {\\\\n            size = 32;\\\\n        }\\\\n\\\\n        if (size < 1 || size > 32 || size < value.replace(/^0x/i,\'\').length / 2 ) {\\\\n            throw new Error(\'Invalid bytes\' + size +\' for \'+ value);\\\\n        }\\\\n\\\\n        return utils.rightPad(value, size * 2);\\\\n    } else if (type.startsWith(\'uint\')) {\\\\n\\\\n        if ((size % 8) || (size < 8) || (size > 256)) {\\\\n            throw new Error(\'Invalid uint\'+size+\' size\');\\\\n        }\\\\n\\\\n        num = _parseNumber(value);\\\\n        if (num.bitLength() > size) {\\\\n            throw new Error(\'Supplied uint exceeds width: \' + size + \' vs \' + num.bitLength());\\\\n        }\\\\n\\\\n        if(num.lt(new BN(0))) {\\\\n            throw new Error(\'Supplied uint \'+ num.toString() +\' is negative\');\\\\n        }\\\\n\\\\n        return size ? utils.leftPad(num.toString(\'hex\'), size/8 * 2) : num;\\\\n    } else if (type.startsWith(\'int\')) {\\\\n\\\\n        if ((size % 8) || (size < 8) || (size > 256)) {\\\\n            throw new Error(\'Invalid int\'+size+\' size\');\\\\n        }\\\\n\\\\n        num = _parseNumber(value);\\\\n        if (num.bitLength() > size) {\\\\n            throw new Error(\'Supplied int exceeds width: \' + size + \' vs \' + num.bitLength());\\\\n        }\\\\n\\\\n        if(num.lt(new BN(0))) {\\\\n            return num.toTwos(size).toString(\'hex\');\\\\n        } else {\\\\n            return size ? utils.leftPad(num.toString(\'hex\'), size/8 * 2) : num;\\\\n        }\\\\n\\\\n    } else {\\\\n        // FIXME: support all other types\\\\n        throw new Error(\'Unsupported or invalid type: \' + type);\\\\n    }\\\\n};\\\\n\\\\n\\\\nvar _processSoliditySha3Args = function (arg) {\\\\n    /*jshint maxcomplexity:false */\\\\n\\\\n    if(_.isArray(arg)) {\\\\n        throw new Error(\'Autodetection of array types is not supported.\');\\\\n    }\\\\n\\\\n    var type, value = \'\';\\\\n    var hexArg, arraySize;\\\\n\\\\n    // if type is given\\\\n    if (_.isObject(arg) && (arg.hasOwnProperty(\'v\') || arg.hasOwnProperty(\'t\') || arg.hasOwnProperty(\'value\') || arg.hasOwnProperty(\'type\'))) {\\\\n        type = arg.t || arg.type;\\\\n        value = arg.v || arg.value;\\\\n\\\\n    // otherwise try to guess the type\\\\n    } else {\\\\n\\\\n        type = utils.toHex(arg, true);\\\\n        value = utils.toHex(arg);\\\\n\\\\n        if (!type.startsWith(\'int\') && !type.startsWith(\'uint\')) {\\\\n            type = \'bytes\';\\\\n        }\\\\n    }\\\\n\\\\n    if ((type.startsWith(\'int\') || type.startsWith(\'uint\')) &&  typeof value === \'string\' && !/^(-)?0x/i.test(value)) {\\\\n        value = new BN(value);\\\\n    }\\\\n\\\\n    // get the array size\\\\n    if(_.isArray(value)) {\\\\n        arraySize = _parseTypeNArray(type);\\\\n        if(arraySize && value.length !== arraySize) {\\\\n            throw new Error(type +\' is not matching the given array \'+ JSON.stringify(value));\\\\n        } else {\\\\n            arraySize = value.length;\\\\n        }\\\\n    }\\\\n\\\\n\\\\n    if (_.isArray(value)) {\\\\n        hexArg = value.map(function (val) {\\\\n            return _solidityPack(type, val, arraySize).toString(\'hex\').replace(\'0x\',\'\');\\\\n        });\\\\n        return hexArg.join(\'\');\\\\n    } else {\\\\n        hexArg = _solidityPack(type, value, arraySize);\\\\n        return hexArg.toString(\'hex\').replace(\'0x\',\'\');\\\\n    }\\\\n\\\\n};\\\\n\\\\n/**\\\\n * Hashes solidity values to a sha3 hash using keccak 256\\\\n *\\\\n * @method soliditySha3\\\\n * @return {Object} the sha3\\\\n */\\\\nvar soliditySha3 = function () {\\\\n    /*jshint maxcomplexity:false */\\\\n\\\\n    var args = Array.prototype.slice.call(arguments);\\\\n\\\\n    var hexArgs = _.map(args, _processSoliditySha3Args);\\\\n\\\\n    // console.log(args, hexArgs);\\\\n    // console.log(\'0x\'+ hexArgs.join(\'\'));\\\\n\\\\n    return utils.sha3(\'0x\'+ hexArgs.join(\'\'));\\\\n};\\\\n\\\\n\\\\nmodule.exports = soliditySha3;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3-utils/src/soliditySha3.js\\\\n// module id = 363\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3-utils/src/soliditySha3.js\\")},function(module,exports){eval(\'module.exports = {\\"_args\\":[[\\"web3@1.0.0-beta.30\\",\\"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib\\"]],\\"_from\\":\\"web3@1.0.0-beta.30\\",\\"_id\\":\\"web3@1.0.0-beta.30\\",\\"_inBundle\\":false,\\"_integrity\\":\\"sha1-rT52GEWusvQKd2DN51eTdzpDHs0=\\",\\"_location\\":\\"/web3\\",\\"_phantomChildren\\":{},\\"_requested\\":{\\"type\\":\\"version\\",\\"registry\\":true,\\"raw\\":\\"web3@1.0.0-beta.30\\",\\"name\\":\\"web3\\",\\"escapedName\\":\\"web3\\",\\"rawSpec\\":\\"1.0.0-beta.30\\",\\"saveSpec\\":null,\\"fetchSpec\\":\\"1.0.0-beta.30\\"},\\"_requiredBy\\":[\\"/\\"],\\"_resolved\\":\\"https://registry.npmjs.org/web3/-/web3-1.0.0-beta.30.tgz\\",\\"_spec\\":\\"1.0.0-beta.30\\",\\"_where\\":\\"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib\\",\\"author\\":{\\"name\\":\\"ethereum.org\\"},\\"authors\\":[{\\"name\\":\\"Fabian Vogelsteller\\",\\"email\\":\\"fabian@ethereum.org\\",\\"homepage\\":\\"http://frozeman.de\\"},{\\"name\\":\\"Marek Kotewicz\\",\\"email\\":\\"marek@parity.io\\",\\"url\\":\\"https://github.com/debris\\"},{\\"name\\":\\"Marian Oancea\\",\\"url\\":\\"https://github.com/cubedro\\"},{\\"name\\":\\"Gav Wood\\",\\"email\\":\\"g@parity.io\\",\\"homepage\\":\\"http://gavwood.com\\"},{\\"name\\":\\"Jeffery Wilcke\\",\\"email\\":\\"jeffrey.wilcke@ethereum.org\\",\\"url\\":\\"https://github.com/obscuren\\"}],\\"bugs\\":{\\"url\\":\\"https://github.com/ethereum/web3.js/issues\\"},\\"dependencies\\":{\\"web3-bzz\\":\\"1.0.0-beta.30\\",\\"web3-core\\":\\"1.0.0-beta.30\\",\\"web3-eth\\":\\"1.0.0-beta.30\\",\\"web3-eth-personal\\":\\"1.0.0-beta.30\\",\\"web3-net\\":\\"1.0.0-beta.30\\",\\"web3-shh\\":\\"1.0.0-beta.30\\",\\"web3-utils\\":\\"1.0.0-beta.30\\"},\\"description\\":\\"Ethereum JavaScript API\\",\\"keywords\\":[\\"Ethereum\\",\\"JavaScript\\",\\"API\\"],\\"license\\":\\"LGPL-3.0\\",\\"main\\":\\"src/index.js\\",\\"name\\":\\"web3\\",\\"namespace\\":\\"ethereum\\",\\"repository\\":{\\"type\\":\\"git\\",\\"url\\":\\"https://github.com/ethereum/web3.js/tree/master/packages/web3\\"},\\"types\\":\\"index.d.ts\\",\\"version\\":\\"1.0.0-beta.30\\"}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3/package.json\\\\n// module id = 364\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3/package.json\')},function(module,exports,__webpack_require__){\\"use strict\\";eval(\\"/*\\\\n    This file is part of web3.js.\\\\n\\\\n    web3.js is free software: you can redistribute it and/or modify\\\\n    it under the terms of the GNU Lesser General Public License as published by\\\\n    the Free Software Foundation, either version 3 of the License, or\\\\n    (at your option) any later version.\\\\n\\\\n    web3.js is distributed in the hope that it will be useful,\\\\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\\\\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\\\n    GNU Lesser General Public License for more details.\\\\n\\\\n    You should have received a copy of the GNU Lesser General Public License\\\\n    along with web3.js.  If not, see <http://www.gnu.org/licenses/>.\\\\n*/\\\\n/**\\\\n * @file index.js\\\\n * @authors:\\\\n *   Fabian Vogelsteller <fabian@ethereum.org>\\\\n *   Gav Wood <gav@parity.io>\\\\n *   Jeffrey Wilcke <jeffrey.wilcke@ethereum.org>\\\\n *   Marek Kotewicz <marek@parity.io>\\\\n *   Marian Oancea <marian@ethereum.org>\\\\n * @date 2017\\\\n */\\\\n\\\\n\\\\n\\\\n\\\\nvar version = __webpack_require__(364).version;\\\\nvar core = __webpack_require__(26);\\\\nvar Eth = __webpack_require__(358);\\\\nvar Net = __webpack_require__(58);\\\\nvar Personal = __webpack_require__(163);\\\\nvar Shh = __webpack_require__(362);\\\\nvar Bzz = __webpack_require__(334);\\\\nvar utils = __webpack_require__(10);\\\\n\\\\nvar Web3 = function Web3() {\\\\n    var _this = this;\\\\n\\\\n    // sets _requestmanager etc\\\\n    core.packageInit(this, arguments);\\\\n\\\\n    this.version = version;\\\\n    this.utils = utils;\\\\n\\\\n    this.eth = new Eth(this);\\\\n    this.shh = new Shh(this);\\\\n    this.bzz = new Bzz(this);\\\\n\\\\n    // overwrite package setProvider\\\\n    var setProvider = this.setProvider;\\\\n    this.setProvider = function (provider, net) {\\\\n        setProvider.apply(_this, arguments);\\\\n\\\\n        this.eth.setProvider(provider, net);\\\\n        this.shh.setProvider(provider, net);\\\\n        this.bzz.setProvider(provider);\\\\n\\\\n        return true;\\\\n    };\\\\n};\\\\n\\\\nWeb3.version = version;\\\\nWeb3.utils = utils;\\\\nWeb3.modules = {\\\\n    Eth: Eth,\\\\n    Net: Net,\\\\n    Personal: Personal,\\\\n    Shh: Shh,\\\\n    Bzz: Bzz\\\\n};\\\\n\\\\ncore.addProviders(Web3);\\\\n\\\\nmodule.exports = Web3;\\\\n\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/web3/src/index.js\\\\n// module id = 365\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/web3/src/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var _global = (function() { return this || {}; })();\\\\nvar NativeWebSocket = _global.WebSocket || _global.MozWebSocket;\\\\nvar websocket_version = __webpack_require__(367);\\\\n\\\\n\\\\n/**\\\\n * Expose a W3C WebSocket class with just one or two arguments.\\\\n */\\\\nfunction W3CWebSocket(uri, protocols) {\\\\n\\\\tvar native_instance;\\\\n\\\\n\\\\tif (protocols) {\\\\n\\\\t\\\\tnative_instance = new NativeWebSocket(uri, protocols);\\\\n\\\\t}\\\\n\\\\telse {\\\\n\\\\t\\\\tnative_instance = new NativeWebSocket(uri);\\\\n\\\\t}\\\\n\\\\n\\\\t/**\\\\n\\\\t * \'native_instance\' is an instance of nativeWebSocket (the browser\'s WebSocket\\\\n\\\\t * class). Since it is an Object it will be returned as it is when creating an\\\\n\\\\t * instance of W3CWebSocket via \'new W3CWebSocket()\'.\\\\n\\\\t *\\\\n\\\\t * ECMAScript 5: http://bclary.com/2004/11/07/#a-13.2.2\\\\n\\\\t */\\\\n\\\\treturn native_instance;\\\\n}\\\\n\\\\n\\\\n/**\\\\n * Module exports.\\\\n */\\\\nmodule.exports = {\\\\n    \'w3cwebsocket\' : NativeWebSocket ? W3CWebSocket : null,\\\\n    \'version\'      : websocket_version\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/websocket/lib/browser.js\\\\n// module id = 366\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/websocket/lib/browser.js\\")},function(module,exports,__webpack_require__){eval(\\"module.exports = __webpack_require__(368).version;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/websocket/lib/version.js\\\\n// module id = 367\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/websocket/lib/version.js\\")},function(module,exports){eval(\'module.exports = {\\"_from\\":\\"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"_id\\":\\"websocket@1.0.24\\",\\"_inBundle\\":false,\\"_location\\":\\"/websocket\\",\\"_phantomChildren\\":{\\"is-typedarray\\":\\"1.0.0\\",\\"ms\\":\\"2.0.0\\"},\\"_requested\\":{\\"type\\":\\"git\\",\\"raw\\":\\"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"name\\":\\"websocket\\",\\"escapedName\\":\\"websocket\\",\\"rawSpec\\":\\"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"saveSpec\\":\\"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"fetchSpec\\":\\"git://github.com/frozeman/WebSocket-Node.git\\",\\"gitCommittish\\":\\"7004c39c42ac98875ab61126e5b4a925430f592c\\"},\\"_requiredBy\\":[\\"/web3-providers-ws\\"],\\"_resolved\\":\\"git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"_spec\\":\\"websocket@git://github.com/frozeman/WebSocket-Node.git#7004c39c42ac98875ab61126e5b4a925430f592c\\",\\"_where\\":\\"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib\\",\\"author\\":{\\"name\\":\\"Brian McKelvey\\",\\"email\\":\\"brian@worlize.com\\",\\"url\\":\\"https://www.worlize.com/\\"},\\"browser\\":\\"lib/browser.js\\",\\"bugs\\":{\\"url\\":\\"https://github.com/theturtle32/WebSocket-Node/issues\\"},\\"bundleDependencies\\":false,\\"config\\":{\\"verbose\\":false},\\"contributors\\":[{\\"name\\":\\"Iñaki Baz Castillo\\",\\"email\\":\\"ibc@aliax.net\\",\\"url\\":\\"http://dev.sipdoc.net\\"}],\\"dependencies\\":{\\"debug\\":\\"^2.2.0\\",\\"nan\\":\\"^2.3.3\\",\\"typedarray-to-buffer\\":\\"^3.1.2\\",\\"yaeti\\":\\"^0.0.6\\"},\\"deprecated\\":false,\\"description\\":\\"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.\\",\\"devDependencies\\":{\\"buffer-equal\\":\\"^1.0.0\\",\\"faucet\\":\\"^0.0.1\\",\\"gulp\\":\\"git+https://github.com/gulpjs/gulp.git#4.0\\",\\"gulp-jshint\\":\\"^2.0.4\\",\\"jshint\\":\\"^2.0.0\\",\\"jshint-stylish\\":\\"^2.2.1\\",\\"tape\\":\\"^4.0.1\\"},\\"directories\\":{\\"lib\\":\\"./lib\\"},\\"engines\\":{\\"node\\":\\">=0.8.0\\"},\\"homepage\\":\\"https://github.com/theturtle32/WebSocket-Node\\",\\"keywords\\":[\\"websocket\\",\\"websockets\\",\\"socket\\",\\"networking\\",\\"comet\\",\\"push\\",\\"RFC-6455\\",\\"realtime\\",\\"server\\",\\"client\\"],\\"license\\":\\"Apache-2.0\\",\\"main\\":\\"index\\",\\"name\\":\\"websocket\\",\\"repository\\":{\\"type\\":\\"git\\",\\"url\\":\\"git+https://github.com/theturtle32/WebSocket-Node.git\\"},\\"scripts\\":{\\"gulp\\":\\"gulp\\",\\"install\\":\\"(node-gyp rebuild 2> builderror.log) || (exit 0)\\",\\"test\\":\\"faucet test/unit\\"},\\"version\\":\\"1.0.24\\"}\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/websocket/package.json\\\\n// module id = 368\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/websocket/package.json\')},function(module,exports,__webpack_require__){eval(\\"var request = __webpack_require__(370)\\\\n\\\\nmodule.exports = function (url, options) {\\\\n  return new Promise(function (resolve, reject) {\\\\n    request(url, options, function (err, data) {\\\\n      if (err) reject(err);\\\\n      else resolve(data);\\\\n    });\\\\n  });\\\\n};\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr-request-promise/index.js\\\\n// module id = 369\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr-request-promise/index.js\\")},function(module,exports,__webpack_require__){eval(\\"var queryString = __webpack_require__(303)\\\\nvar setQuery = __webpack_require__(330)\\\\nvar assign = __webpack_require__(138)\\\\nvar ensureHeader = __webpack_require__(371)\\\\n\\\\n// this is replaced in the browser\\\\nvar request = __webpack_require__(373)\\\\n\\\\nvar mimeTypeJson = \'application/json\'\\\\nvar noop = function () {}\\\\n\\\\nmodule.exports = xhrRequest\\\\nfunction xhrRequest (url, opt, cb) {\\\\n  if (!url || typeof url !== \'string\') {\\\\n    throw new TypeError(\'must specify a URL\')\\\\n  }\\\\n  if (typeof opt === \'function\') {\\\\n    cb = opt\\\\n    opt = {}\\\\n  }\\\\n  if (cb && typeof cb !== \'function\') {\\\\n    throw new TypeError(\'expected cb to be undefined or a function\')\\\\n  }\\\\n\\\\n  cb = cb || noop\\\\n  opt = opt || {}\\\\n\\\\n  var defaultResponse = opt.json ? \'json\' : \'text\'\\\\n  opt = assign({ responseType: defaultResponse }, opt)\\\\n\\\\n  var headers = opt.headers || {}\\\\n  var method = (opt.method || \'GET\').toUpperCase()\\\\n  var query = opt.query\\\\n  if (query) {\\\\n    if (typeof query !== \'string\') {\\\\n      query = queryString.stringify(query)\\\\n    }\\\\n    url = setQuery(url, query)\\\\n  }\\\\n\\\\n  // allow json response\\\\n  if (opt.responseType === \'json\') {\\\\n    ensureHeader(headers, \'Accept\', mimeTypeJson)\\\\n  }\\\\n\\\\n  // if body content is json\\\\n  if (opt.json && method !== \'GET\' && method !== \'HEAD\') {\\\\n    ensureHeader(headers, \'Content-Type\', mimeTypeJson)\\\\n    opt.body = JSON.stringify(opt.body)\\\\n  }\\\\n\\\\n  opt.method = method\\\\n  opt.url = url\\\\n  opt.headers = headers\\\\n  delete opt.query\\\\n  delete opt.json\\\\n\\\\n  return request(opt, cb)\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr-request/index.js\\\\n// module id = 370\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr-request/index.js\\")},function(module,exports){eval(\\"module.exports = ensureHeader\\\\nfunction ensureHeader (headers, key, value) {\\\\n  var lower = key.toLowerCase()\\\\n  if (!headers[key] && !headers[lower]) {\\\\n    headers[key] = value\\\\n  }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr-request/lib/ensure-header.js\\\\n// module id = 371\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr-request/lib/ensure-header.js\\")},function(module,exports){eval(\\"module.exports = getResponse\\\\nfunction getResponse (opt, resp) {\\\\n  if (!resp) return null\\\\n  return {\\\\n    statusCode: resp.statusCode,\\\\n    headers: resp.headers,\\\\n    method: opt.method,\\\\n    url: opt.url,\\\\n    // the XHR object in browser, http response in Node\\\\n    rawRequest: resp.rawRequest ? resp.rawRequest : resp\\\\n  }\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr-request/lib/normalize-response.js\\\\n// module id = 372\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr-request/lib/normalize-response.js\\")},function(module,exports,__webpack_require__){eval(\\"var xhr = __webpack_require__(374)\\\\nvar normalize = __webpack_require__(372)\\\\nvar noop = function () {}\\\\n\\\\nmodule.exports = xhrRequest\\\\nfunction xhrRequest (opt, cb) {\\\\n  delete opt.uri\\\\n\\\\n  // for better JSON.parse error handling than xhr module\\\\n  var useJson = false\\\\n  if (opt.responseType === \'json\') {\\\\n    opt.responseType = \'text\'\\\\n    useJson = true\\\\n  }\\\\n\\\\n  var req = xhr(opt, function xhrRequestResult (err, resp, body) {\\\\n    if (useJson && !err) {\\\\n      try {\\\\n        var text = resp.rawRequest.responseText\\\\n        body = JSON.parse(text)\\\\n      } catch (e) {\\\\n        err = e\\\\n      }\\\\n    }\\\\n\\\\n    resp = normalize(opt, resp)\\\\n    if (err) cb(err, null, resp)\\\\n    else cb(err, body, resp)\\\\n    cb = noop\\\\n  })\\\\n\\\\n  // Patch abort() so that it also calls the callback, but with an error\\\\n  var onabort = req.onabort\\\\n  req.onabort = function () {\\\\n    var ret = onabort.apply(req, Array.prototype.slice.call(arguments))\\\\n    cb(new Error(\'XHR Aborted\'))\\\\n    cb = noop\\\\n    return ret\\\\n  }\\\\n\\\\n  return req\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr-request/lib/request-browser.js\\\\n// module id = 373\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr-request/lib/request-browser.js\\")},function(module,exports,__webpack_require__){\\"use strict\\";eval(\'\\\\nvar window = __webpack_require__(268)\\\\nvar isFunction = __webpack_require__(133)\\\\nvar parseHeaders = __webpack_require__(297)\\\\nvar xtend = __webpack_require__(376)\\\\n\\\\nmodule.exports = createXHR\\\\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\\\\ncreateXHR.XDomainRequest = \\"withCredentials\\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\\\\n\\\\nforEachArray([\\"get\\", \\"put\\", \\"post\\", \\"patch\\", \\"head\\", \\"delete\\"], function(method) {\\\\n    createXHR[method === \\"delete\\" ? \\"del\\" : method] = function(uri, options, callback) {\\\\n        options = initParams(uri, options, callback)\\\\n        options.method = method.toUpperCase()\\\\n        return _createXHR(options)\\\\n    }\\\\n})\\\\n\\\\nfunction forEachArray(array, iterator) {\\\\n    for (var i = 0; i < array.length; i++) {\\\\n        iterator(array[i])\\\\n    }\\\\n}\\\\n\\\\nfunction isEmpty(obj){\\\\n    for(var i in obj){\\\\n        if(obj.hasOwnProperty(i)) return false\\\\n    }\\\\n    return true\\\\n}\\\\n\\\\nfunction initParams(uri, options, callback) {\\\\n    var params = uri\\\\n\\\\n    if (isFunction(options)) {\\\\n        callback = options\\\\n        if (typeof uri === \\"string\\") {\\\\n            params = {uri:uri}\\\\n        }\\\\n    } else {\\\\n        params = xtend(options, {uri: uri})\\\\n    }\\\\n\\\\n    params.callback = callback\\\\n    return params\\\\n}\\\\n\\\\nfunction createXHR(uri, options, callback) {\\\\n    options = initParams(uri, options, callback)\\\\n    return _createXHR(options)\\\\n}\\\\n\\\\nfunction _createXHR(options) {\\\\n    if(typeof options.callback === \\"undefined\\"){\\\\n        throw new Error(\\"callback argument missing\\")\\\\n    }\\\\n\\\\n    var called = false\\\\n    var callback = function cbOnce(err, response, body){\\\\n        if(!called){\\\\n            called = true\\\\n            options.callback(err, response, body)\\\\n        }\\\\n    }\\\\n\\\\n    function readystatechange() {\\\\n        if (xhr.readyState === 4) {\\\\n            setTimeout(loadFunc, 0)\\\\n        }\\\\n    }\\\\n\\\\n    function getBody() {\\\\n        // Chrome with requestType=blob throws errors arround when even testing access to responseText\\\\n        var body = undefined\\\\n\\\\n        if (xhr.response) {\\\\n            body = xhr.response\\\\n        } else {\\\\n            body = xhr.responseText || getXml(xhr)\\\\n        }\\\\n\\\\n        if (isJson) {\\\\n            try {\\\\n                body = JSON.parse(body)\\\\n            } catch (e) {}\\\\n        }\\\\n\\\\n        return body\\\\n    }\\\\n\\\\n    function errorFunc(evt) {\\\\n        clearTimeout(timeoutTimer)\\\\n        if(!(evt instanceof Error)){\\\\n            evt = new Error(\\"\\" + (evt || \\"Unknown XMLHttpRequest Error\\") )\\\\n        }\\\\n        evt.statusCode = 0\\\\n        return callback(evt, failureResponse)\\\\n    }\\\\n\\\\n    // will load the data & process the response in a special response object\\\\n    function loadFunc() {\\\\n        if (aborted) return\\\\n        var status\\\\n        clearTimeout(timeoutTimer)\\\\n        if(options.useXDR && xhr.status===undefined) {\\\\n            //IE8 CORS GET successful response doesn\\\\\'t have a status field, but body is fine\\\\n            status = 200\\\\n        } else {\\\\n            status = (xhr.status === 1223 ? 204 : xhr.status)\\\\n        }\\\\n        var response = failureResponse\\\\n        var err = null\\\\n\\\\n        if (status !== 0){\\\\n            response = {\\\\n                body: getBody(),\\\\n                statusCode: status,\\\\n                method: method,\\\\n                headers: {},\\\\n                url: uri,\\\\n                rawRequest: xhr\\\\n            }\\\\n            if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\\\\n                response.headers = parseHeaders(xhr.getAllResponseHeaders())\\\\n            }\\\\n        } else {\\\\n            err = new Error(\\"Internal XMLHttpRequest Error\\")\\\\n        }\\\\n        return callback(err, response, response.body)\\\\n    }\\\\n\\\\n    var xhr = options.xhr || null\\\\n\\\\n    if (!xhr) {\\\\n        if (options.cors || options.useXDR) {\\\\n            xhr = new createXHR.XDomainRequest()\\\\n        }else{\\\\n            xhr = new createXHR.XMLHttpRequest()\\\\n        }\\\\n    }\\\\n\\\\n    var key\\\\n    var aborted\\\\n    var uri = xhr.url = options.uri || options.url\\\\n    var method = xhr.method = options.method || \\"GET\\"\\\\n    var body = options.body || options.data\\\\n    var headers = xhr.headers = options.headers || {}\\\\n    var sync = !!options.sync\\\\n    var isJson = false\\\\n    var timeoutTimer\\\\n    var failureResponse = {\\\\n        body: undefined,\\\\n        headers: {},\\\\n        statusCode: 0,\\\\n        method: method,\\\\n        url: uri,\\\\n        rawRequest: xhr\\\\n    }\\\\n\\\\n    if (\\"json\\" in options && options.json !== false) {\\\\n        isJson = true\\\\n        headers[\\"accept\\"] || headers[\\"Accept\\"] || (headers[\\"Accept\\"] = \\"application/json\\") //Don\\\\\'t override existing accept header declared by user\\\\n        if (method !== \\"GET\\" && method !== \\"HEAD\\") {\\\\n            headers[\\"content-type\\"] || headers[\\"Content-Type\\"] || (headers[\\"Content-Type\\"] = \\"application/json\\") //Don\\\\\'t override existing accept header declared by user\\\\n            body = JSON.stringify(options.json === true ? body : options.json)\\\\n        }\\\\n    }\\\\n\\\\n    xhr.onreadystatechange = readystatechange\\\\n    xhr.onload = loadFunc\\\\n    xhr.onerror = errorFunc\\\\n    // IE9 must have onprogress be set to a unique function.\\\\n    xhr.onprogress = function () {\\\\n        // IE must die\\\\n    }\\\\n    xhr.onabort = function(){\\\\n        aborted = true;\\\\n    }\\\\n    xhr.ontimeout = errorFunc\\\\n    xhr.open(method, uri, !sync, options.username, options.password)\\\\n    //has to be after open\\\\n    if(!sync) {\\\\n        xhr.withCredentials = !!options.withCredentials\\\\n    }\\\\n    // Cannot set timeout with sync request\\\\n    // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\\\\n    // both npm\\\\\'s request and jquery 1.x use this kind of timeout, so this is being consistent\\\\n    if (!sync && options.timeout > 0 ) {\\\\n        timeoutTimer = setTimeout(function(){\\\\n            if (aborted) return\\\\n            aborted = true//IE9 may still call readystatechange\\\\n            xhr.abort(\\"timeout\\")\\\\n            var e = new Error(\\"XMLHttpRequest timeout\\")\\\\n            e.code = \\"ETIMEDOUT\\"\\\\n            errorFunc(e)\\\\n        }, options.timeout )\\\\n    }\\\\n\\\\n    if (xhr.setRequestHeader) {\\\\n        for(key in headers){\\\\n            if(headers.hasOwnProperty(key)){\\\\n                xhr.setRequestHeader(key, headers[key])\\\\n            }\\\\n        }\\\\n    } else if (options.headers && !isEmpty(options.headers)) {\\\\n        throw new Error(\\"Headers cannot be set on an XDomainRequest object\\")\\\\n    }\\\\n\\\\n    if (\\"responseType\\" in options) {\\\\n        xhr.responseType = options.responseType\\\\n    }\\\\n\\\\n    if (\\"beforeSend\\" in options &&\\\\n        typeof options.beforeSend === \\"function\\"\\\\n    ) {\\\\n        options.beforeSend(xhr)\\\\n    }\\\\n\\\\n    // Microsoft Edge browser sends \\"undefined\\" when send is called with undefined value.\\\\n    // XMLHttpRequest spec says to pass null as body to indicate no body\\\\n    // See https://github.com/naugtur/xhr/issues/100.\\\\n    xhr.send(body || null)\\\\n\\\\n    return xhr\\\\n\\\\n\\\\n}\\\\n\\\\nfunction getXml(xhr) {\\\\n    // xhr.responseXML will throw Exception \\"InvalidStateError\\" or \\"DOMException\\"\\\\n    // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\\\\n    try {\\\\n        if (xhr.responseType === \\"document\\") {\\\\n            return xhr.responseXML\\\\n        }\\\\n        var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \\"parsererror\\"\\\\n        if (xhr.responseType === \\"\\" && !firefoxBugTakenEffect) {\\\\n            return xhr.responseXML\\\\n        }\\\\n    } catch (e) {}\\\\n\\\\n    return null\\\\n}\\\\n\\\\nfunction noop() {}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr/index.js\\\\n// module id = 374\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr/index.js\')},function(module,exports){eval(\\"module.exports = XMLHttpRequest;\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xhr2/lib/browser.js\\\\n// module id = 375\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xhr2/lib/browser.js\\")},function(module,exports){eval(\\"module.exports = extend\\\\n\\\\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\\\\n\\\\nfunction extend() {\\\\n    var target = {}\\\\n\\\\n    for (var i = 0; i < arguments.length; i++) {\\\\n        var source = arguments[i]\\\\n\\\\n        for (var key in source) {\\\\n            if (hasOwnProperty.call(source, key)) {\\\\n                target[key] = source[key]\\\\n            }\\\\n        }\\\\n    }\\\\n\\\\n    return target\\\\n}\\\\n\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// ./~/xtend/immutable.js\\\\n// module id = 376\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../node_modules/xtend/immutable.js\\")},function(module,exports){eval(\\"/* (ignored) */\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// buffer (ignored)\\\\n// module id = 377\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/bn.js/lib_buffer\\")},function(module,exports){eval(\\"/* (ignored) */\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// crypto (ignored)\\\\n// module id = 378\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/brorand_crypto\\")},function(module,exports){eval(\\"/* (ignored) */\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// util (ignored)\\\\n// module id = 379\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/readable-stream/lib_util\\")},function(module,exports){eval(\\"/* (ignored) */\\\\n\\\\n//////////////////\\\\n// WEBPACK FOOTER\\\\n// util (ignored)\\\\n// module id = 380\\\\n// module chunks = 0\\\\n\\\\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/readable-stream/lib/internal/streams_util\\")}]);", __webpack_require__.p + "405ef7c9bced98369b90.worker.js");\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/API/crypto.worker.js\n// module id = 1306\n// module chunks = 0\n\n//# sourceURL=API/crypto.worker.js')},function(module,exports,__webpack_require__){"use strict";eval("\n\n// http://stackoverflow.com/questions/10343913/how-to-create-a-web-worker-from-a-string\n\nvar URL = window.URL || window.webkitURL;\n\nmodule.exports = function (content, url) {\n  try {\n    try {\n      var blob;\n\n      try {\n        // BlobBuilder = Deprecated, but widely implemented\n        var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;\n\n        blob = new BlobBuilder();\n\n        blob.append(content);\n\n        blob = blob.getBlob();\n      } catch (e) {\n        // The proposed API\n        blob = new Blob([content]);\n      }\n\n      return new Worker(URL.createObjectURL(blob));\n    } catch (e) {\n      return new Worker('data:application/javascript,' + encodeURIComponent(content));\n    }\n  } catch (e) {\n    if (!url) {\n      throw Error('Inline worker is not supported');\n    }\n\n    return new Worker(url);\n  }\n};\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/worker-loader/dist/workers/InlineWorker.js\n// module id = 1307\n// module chunks = 0\n\n//# sourceURL=../node_modules/worker-loader/dist/workers/InlineWorker.js")},function(module,exports){eval("// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n  if (fn && cb) return wrappy(fn)(cb)\n\n  if (typeof fn !== 'function')\n    throw new TypeError('need wrapper function')\n\n  Object.keys(fn).forEach(function (k) {\n    wrapper[k] = fn[k]\n  })\n\n  return wrapper\n\n  function wrapper() {\n    var args = new Array(arguments.length)\n    for (var i = 0; i < args.length; i++) {\n      args[i] = arguments[i]\n    }\n    var ret = fn.apply(this, args)\n    var cb = args[args.length-1]\n    if (typeof ret === 'function' && ret !== cb) {\n      Object.keys(cb).forEach(function (k) {\n        ret[k] = cb[k]\n      })\n    }\n    return ret\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/wrappy/wrappy.js\n// module id = 1308\n// module chunks = 0\n\n//# sourceURL=../node_modules/wrappy/wrappy.js")},function(module,exports,__webpack_require__){eval("var request = __webpack_require__(1310)\n\nmodule.exports = function (url, options) {\n  return new Promise(function (resolve, reject) {\n    request(url, options, function (err, data) {\n      if (err) reject(err);\n      else resolve(data);\n    });\n  });\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr-request-promise/index.js\n// module id = 1309\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr-request-promise/index.js")},function(module,exports,__webpack_require__){eval("var queryString = __webpack_require__(1204)\nvar setQuery = __webpack_require__(1255)\nvar assign = __webpack_require__(295)\nvar ensureHeader = __webpack_require__(1311)\n\n// this is replaced in the browser\nvar request = __webpack_require__(1313)\n\nvar mimeTypeJson = 'application/json'\nvar noop = function () {}\n\nmodule.exports = xhrRequest\nfunction xhrRequest (url, opt, cb) {\n  if (!url || typeof url !== 'string') {\n    throw new TypeError('must specify a URL')\n  }\n  if (typeof opt === 'function') {\n    cb = opt\n    opt = {}\n  }\n  if (cb && typeof cb !== 'function') {\n    throw new TypeError('expected cb to be undefined or a function')\n  }\n\n  cb = cb || noop\n  opt = opt || {}\n\n  var defaultResponse = opt.json ? 'json' : 'text'\n  opt = assign({ responseType: defaultResponse }, opt)\n\n  var headers = opt.headers || {}\n  var method = (opt.method || 'GET').toUpperCase()\n  var query = opt.query\n  if (query) {\n    if (typeof query !== 'string') {\n      query = queryString.stringify(query)\n    }\n    url = setQuery(url, query)\n  }\n\n  // allow json response\n  if (opt.responseType === 'json') {\n    ensureHeader(headers, 'Accept', mimeTypeJson)\n  }\n\n  // if body content is json\n  if (opt.json && method !== 'GET' && method !== 'HEAD') {\n    ensureHeader(headers, 'Content-Type', mimeTypeJson)\n    opt.body = JSON.stringify(opt.body)\n  }\n\n  opt.method = method\n  opt.url = url\n  opt.headers = headers\n  delete opt.query\n  delete opt.json\n\n  return request(opt, cb)\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr-request/index.js\n// module id = 1310\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr-request/index.js")},function(module,exports){eval("module.exports = ensureHeader\nfunction ensureHeader (headers, key, value) {\n  var lower = key.toLowerCase()\n  if (!headers[key] && !headers[lower]) {\n    headers[key] = value\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr-request/lib/ensure-header.js\n// module id = 1311\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr-request/lib/ensure-header.js")},function(module,exports){eval("module.exports = getResponse\nfunction getResponse (opt, resp) {\n  if (!resp) return null\n  return {\n    statusCode: resp.statusCode,\n    headers: resp.headers,\n    method: opt.method,\n    url: opt.url,\n    // the XHR object in browser, http response in Node\n    rawRequest: resp.rawRequest ? resp.rawRequest : resp\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr-request/lib/normalize-response.js\n// module id = 1312\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr-request/lib/normalize-response.js")},function(module,exports,__webpack_require__){eval("var xhr = __webpack_require__(1314)\nvar normalize = __webpack_require__(1312)\nvar noop = function () {}\n\nmodule.exports = xhrRequest\nfunction xhrRequest (opt, cb) {\n  delete opt.uri\n\n  // for better JSON.parse error handling than xhr module\n  var useJson = false\n  if (opt.responseType === 'json') {\n    opt.responseType = 'text'\n    useJson = true\n  }\n\n  var req = xhr(opt, function xhrRequestResult (err, resp, body) {\n    if (useJson && !err) {\n      try {\n        var text = resp.rawRequest.responseText\n        body = JSON.parse(text)\n      } catch (e) {\n        err = e\n      }\n    }\n\n    resp = normalize(opt, resp)\n    if (err) cb(err, null, resp)\n    else cb(err, body, resp)\n    cb = noop\n  })\n\n  // Patch abort() so that it also calls the callback, but with an error\n  var onabort = req.onabort\n  req.onabort = function () {\n    var ret = onabort.apply(req, Array.prototype.slice.call(arguments))\n    cb(new Error('XHR Aborted'))\n    cb = noop\n    return ret\n  }\n\n  return req\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr-request/lib/request-browser.js\n// module id = 1313\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr-request/lib/request-browser.js")},function(module,exports,__webpack_require__){"use strict";eval('\nvar window = __webpack_require__(868)\nvar isFunction = __webpack_require__(428)\nvar parseHeaders = __webpack_require__(1149)\nvar xtend = __webpack_require__(73)\n\nmodule.exports = createXHR\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = "withCredentials" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray(["get", "put", "post", "patch", "head", "delete"], function(method) {\n    createXHR[method === "delete" ? "del" : method] = function(uri, options, callback) {\n        options = initParams(uri, options, callback)\n        options.method = method.toUpperCase()\n        return _createXHR(options)\n    }\n})\n\nfunction forEachArray(array, iterator) {\n    for (var i = 0; i < array.length; i++) {\n        iterator(array[i])\n    }\n}\n\nfunction isEmpty(obj){\n    for(var i in obj){\n        if(obj.hasOwnProperty(i)) return false\n    }\n    return true\n}\n\nfunction initParams(uri, options, callback) {\n    var params = uri\n\n    if (isFunction(options)) {\n        callback = options\n        if (typeof uri === "string") {\n            params = {uri:uri}\n        }\n    } else {\n        params = xtend(options, {uri: uri})\n    }\n\n    params.callback = callback\n    return params\n}\n\nfunction createXHR(uri, options, callback) {\n    options = initParams(uri, options, callback)\n    return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n    if(typeof options.callback === "undefined"){\n        throw new Error("callback argument missing")\n    }\n\n    var called = false\n    var callback = function cbOnce(err, response, body){\n        if(!called){\n            called = true\n            options.callback(err, response, body)\n        }\n    }\n\n    function readystatechange() {\n        if (xhr.readyState === 4) {\n            setTimeout(loadFunc, 0)\n        }\n    }\n\n    function getBody() {\n        // Chrome with requestType=blob throws errors arround when even testing access to responseText\n        var body = undefined\n\n        if (xhr.response) {\n            body = xhr.response\n        } else {\n            body = xhr.responseText || getXml(xhr)\n        }\n\n        if (isJson) {\n            try {\n                body = JSON.parse(body)\n            } catch (e) {}\n        }\n\n        return body\n    }\n\n    function errorFunc(evt) {\n        clearTimeout(timeoutTimer)\n        if(!(evt instanceof Error)){\n            evt = new Error("" + (evt || "Unknown XMLHttpRequest Error") )\n        }\n        evt.statusCode = 0\n        return callback(evt, failureResponse)\n    }\n\n    // will load the data & process the response in a special response object\n    function loadFunc() {\n        if (aborted) return\n        var status\n        clearTimeout(timeoutTimer)\n        if(options.useXDR && xhr.status===undefined) {\n            //IE8 CORS GET successful response doesn\'t have a status field, but body is fine\n            status = 200\n        } else {\n            status = (xhr.status === 1223 ? 204 : xhr.status)\n        }\n        var response = failureResponse\n        var err = null\n\n        if (status !== 0){\n            response = {\n                body: getBody(),\n                statusCode: status,\n                method: method,\n                headers: {},\n                url: uri,\n                rawRequest: xhr\n            }\n            if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n                response.headers = parseHeaders(xhr.getAllResponseHeaders())\n            }\n        } else {\n            err = new Error("Internal XMLHttpRequest Error")\n        }\n        return callback(err, response, response.body)\n    }\n\n    var xhr = options.xhr || null\n\n    if (!xhr) {\n        if (options.cors || options.useXDR) {\n            xhr = new createXHR.XDomainRequest()\n        }else{\n            xhr = new createXHR.XMLHttpRequest()\n        }\n    }\n\n    var key\n    var aborted\n    var uri = xhr.url = options.uri || options.url\n    var method = xhr.method = options.method || "GET"\n    var body = options.body || options.data\n    var headers = xhr.headers = options.headers || {}\n    var sync = !!options.sync\n    var isJson = false\n    var timeoutTimer\n    var failureResponse = {\n        body: undefined,\n        headers: {},\n        statusCode: 0,\n        method: method,\n        url: uri,\n        rawRequest: xhr\n    }\n\n    if ("json" in options && options.json !== false) {\n        isJson = true\n        headers["accept"] || headers["Accept"] || (headers["Accept"] = "application/json") //Don\'t override existing accept header declared by user\n        if (method !== "GET" && method !== "HEAD") {\n            headers["content-type"] || headers["Content-Type"] || (headers["Content-Type"] = "application/json") //Don\'t override existing accept header declared by user\n            body = JSON.stringify(options.json === true ? body : options.json)\n        }\n    }\n\n    xhr.onreadystatechange = readystatechange\n    xhr.onload = loadFunc\n    xhr.onerror = errorFunc\n    // IE9 must have onprogress be set to a unique function.\n    xhr.onprogress = function () {\n        // IE must die\n    }\n    xhr.onabort = function(){\n        aborted = true;\n    }\n    xhr.ontimeout = errorFunc\n    xhr.open(method, uri, !sync, options.username, options.password)\n    //has to be after open\n    if(!sync) {\n        xhr.withCredentials = !!options.withCredentials\n    }\n    // Cannot set timeout with sync request\n    // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n    // both npm\'s request and jquery 1.x use this kind of timeout, so this is being consistent\n    if (!sync && options.timeout > 0 ) {\n        timeoutTimer = setTimeout(function(){\n            if (aborted) return\n            aborted = true//IE9 may still call readystatechange\n            xhr.abort("timeout")\n            var e = new Error("XMLHttpRequest timeout")\n            e.code = "ETIMEDOUT"\n            errorFunc(e)\n        }, options.timeout )\n    }\n\n    if (xhr.setRequestHeader) {\n        for(key in headers){\n            if(headers.hasOwnProperty(key)){\n                xhr.setRequestHeader(key, headers[key])\n            }\n        }\n    } else if (options.headers && !isEmpty(options.headers)) {\n        throw new Error("Headers cannot be set on an XDomainRequest object")\n    }\n\n    if ("responseType" in options) {\n        xhr.responseType = options.responseType\n    }\n\n    if ("beforeSend" in options &&\n        typeof options.beforeSend === "function"\n    ) {\n        options.beforeSend(xhr)\n    }\n\n    // Microsoft Edge browser sends "undefined" when send is called with undefined value.\n    // XMLHttpRequest spec says to pass null as body to indicate no body\n    // See https://github.com/naugtur/xhr/issues/100.\n    xhr.send(body || null)\n\n    return xhr\n\n\n}\n\nfunction getXml(xhr) {\n    // xhr.responseXML will throw Exception "InvalidStateError" or "DOMException"\n    // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n    try {\n        if (xhr.responseType === "document") {\n            return xhr.responseXML\n        }\n        var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === "parsererror"\n        if (xhr.responseType === "" && !firefoxBugTakenEffect) {\n            return xhr.responseXML\n        }\n    } catch (e) {}\n\n    return null\n}\n\nfunction noop() {}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/xhr/index.js\n// module id = 1314\n// module chunks = 0\n\n//# sourceURL=../node_modules/xhr/index.js')},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(global, Buffer) {\n\nvar bitcore = module.exports;\n\n// module information\nbitcore.version = 'v' + __webpack_require__(1347).version;\nbitcore.versionGuard = function(version) {\n  if (version !== undefined) {\n    var message = 'More than one instance of zcash-bitcore-lib found. ' +\n      'Please make sure to require zcash-bitcore-lib and check that submodules do' +\n      ' not also include their own zcash-bitcore-lib dependency.';\n    // TODO: put this back if we start versioning again\n    //throw new Error(message);\n  }\n};\nbitcore.versionGuard(global._bitcore);\nglobal._bitcore = bitcore.version;\n\n// crypto\nbitcore.crypto = {};\nbitcore.crypto.BN = __webpack_require__(30);\nbitcore.crypto.ECDSA = __webpack_require__(566);\nbitcore.crypto.Hash = __webpack_require__(36);\nbitcore.crypto.Random = __webpack_require__(213);\nbitcore.crypto.Point = __webpack_require__(125);\nbitcore.crypto.Signature = __webpack_require__(55);\n\n// encoding\nbitcore.encoding = {};\nbitcore.encoding.Base58 = __webpack_require__(214);\nbitcore.encoding.Base58Check = __webpack_require__(158);\nbitcore.encoding.BufferReader = __webpack_require__(82);\nbitcore.encoding.BufferWriter = __webpack_require__(50);\nbitcore.encoding.Varint = __webpack_require__(1318);\n\n// utilities\nbitcore.util = {};\nbitcore.util.buffer = __webpack_require__(18);\nbitcore.util.js = __webpack_require__(24);\nbitcore.util.preconditions = __webpack_require__(13);\n\n// errors thrown by the library\nbitcore.errors = __webpack_require__(56);\n\n// main bitcoin library\nbitcore.Address = __webpack_require__(108);\nbitcore.Block = __webpack_require__(1317);\nbitcore.MerkleBlock = __webpack_require__(565);\nbitcore.BlockHeader = __webpack_require__(212);\nbitcore.HDPrivateKey = __webpack_require__(567);\nbitcore.HDPublicKey = __webpack_require__(568);\nbitcore.Networks = __webpack_require__(109);\nbitcore.Opcode = __webpack_require__(317);\nbitcore.PrivateKey = __webpack_require__(215);\nbitcore.PublicKey = __webpack_require__(66);\nbitcore.Script = __webpack_require__(57);\nbitcore.Transaction = __webpack_require__(216);\nbitcore.URI = __webpack_require__(1326);\nbitcore.Unit = __webpack_require__(320);\n\n// dependencies, subject to change\nbitcore.deps = {};\nbitcore.deps.bnjs = __webpack_require__(74);\nbitcore.deps.bs58 = __webpack_require__(571);\nbitcore.deps.Buffer = Buffer;\nbitcore.deps.elliptic = __webpack_require__(67);\nbitcore.deps._ = __webpack_require__(10);\n\n// Internal usage, exposed for testing/advanced tweaking\nbitcore._HDKeyCache = __webpack_require__(316);\nbitcore.Transaction.sighash = __webpack_require__(84);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/index.js\n// module id = 1315\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\nvar BlockHeader = __webpack_require__(212);\nvar BN = __webpack_require__(30);\nvar BufferUtil = __webpack_require__(18);\nvar BufferReader = __webpack_require__(82);\nvar BufferWriter = __webpack_require__(50);\nvar Hash = __webpack_require__(36);\nvar Transaction = __webpack_require__(216);\nvar $ = __webpack_require__(13);\n\n/**\n * Instantiate a Block from a Buffer, JSON object, or Object with\n * the properties of the Block\n *\n * @param {*} - A Buffer, JSON string, or Object\n * @returns {Block}\n * @constructor\n */\nfunction Block(arg) {\n  if (!(this instanceof Block)) {\n    return new Block(arg);\n  }\n  _.extend(this, Block._from(arg));\n  return this;\n}\n\n// https://github.com/bitcoin/bitcoin/blob/b5fa132329f0377d787a4a21c1686609c2bfaece/src/primitives/block.h#L14\nBlock.MAX_BLOCK_SIZE = 1000000;\n\n/**\n * @param {*} - A Buffer, JSON string or Object\n * @returns {Object} - An object representing block data\n * @throws {TypeError} - If the argument was not recognized\n * @private\n */\nBlock._from = function _from(arg) {\n  var info = {};\n  if (BufferUtil.isBuffer(arg)) {\n    info = Block._fromBufferReader(BufferReader(arg));\n  } else if (_.isObject(arg)) {\n    info = Block._fromObject(arg);\n  } else {\n    throw new TypeError('Unrecognized argument for Block');\n  }\n  return info;\n};\n\n/**\n * @param {Object} - A plain JavaScript object\n * @returns {Object} - An object representing block data\n * @private\n */\nBlock._fromObject = function _fromObject(data) {\n  var transactions = [];\n  data.transactions.forEach(function(tx) {\n    if (tx instanceof Transaction) {\n      transactions.push(tx);\n    } else {\n      transactions.push(Transaction().fromObject(tx));\n    }\n  });\n  var info = {\n    header: BlockHeader.fromObject(data.header),\n    transactions: transactions\n  };\n  return info;\n};\n\n/**\n * @param {Object} - A plain JavaScript object\n * @returns {Block} - An instance of block\n */\nBlock.fromObject = function fromObject(obj) {\n  var info = Block._fromObject(obj);\n  return new Block(info);\n};\n\n/**\n * @param {BufferReader} - Block data\n * @returns {Object} - An object representing the block data\n * @private\n */\nBlock._fromBufferReader = function _fromBufferReader(br) {\n  var info = {};\n  $.checkState(!br.finished(), 'No block data received');\n  info.header = BlockHeader.fromBufferReader(br);\n  var transactions = br.readVarintNum();\n  info.transactions = [];\n  for (var i = 0; i < transactions; i++) {\n    info.transactions.push(Transaction().fromBufferReader(br));\n  }\n  return info;\n};\n\n/**\n * @param {BufferReader} - A buffer reader of the block\n * @returns {Block} - An instance of block\n */\nBlock.fromBufferReader = function fromBufferReader(br) {\n  $.checkArgument(br, 'br is required');\n  var info = Block._fromBufferReader(br);\n  return new Block(info);\n};\n\n/**\n * @param {Buffer} - A buffer of the block\n * @returns {Block} - An instance of block\n */\nBlock.fromBuffer = function fromBuffer(buf) {\n  return Block.fromBufferReader(new BufferReader(buf));\n};\n\n/**\n * @param {string} - str - A hex encoded string of the block\n * @returns {Block} - A hex encoded string of the block\n */\nBlock.fromString = function fromString(str) {\n  var buf = new Buffer(str, 'hex');\n  return Block.fromBuffer(buf);\n};\n\n/**\n * @param {Binary} - Raw block binary data or buffer\n * @returns {Block} - An instance of block\n */\nBlock.fromRawBlock = function fromRawBlock(data) {\n  if (!BufferUtil.isBuffer(data)) {\n    data = new Buffer(data, 'binary');\n  }\n  var br = BufferReader(data);\n  br.pos = Block.Values.START_OF_BLOCK;\n  var info = Block._fromBufferReader(br);\n  return new Block(info);\n};\n\n/**\n * @returns {Object} - A plain object with the block properties\n */\nBlock.prototype.toObject = Block.prototype.toJSON = function toObject() {\n  var transactions = [];\n  this.transactions.forEach(function(tx) {\n    transactions.push(tx.toObject());\n  });\n  return {\n    header: this.header.toObject(),\n    transactions: transactions\n  };\n};\n\n/**\n * @returns {Buffer} - A buffer of the block\n */\nBlock.prototype.toBuffer = function toBuffer() {\n  return this.toBufferWriter().concat();\n};\n\n/**\n * @returns {string} - A hex encoded string of the block\n */\nBlock.prototype.toString = function toString() {\n  return this.toBuffer().toString('hex');\n};\n\n/**\n * @param {BufferWriter} - An existing instance of BufferWriter\n * @returns {BufferWriter} - An instance of BufferWriter representation of the Block\n */\nBlock.prototype.toBufferWriter = function toBufferWriter(bw) {\n  if (!bw) {\n    bw = new BufferWriter();\n  }\n  bw.write(this.header.toBuffer());\n  bw.writeVarintNum(this.transactions.length);\n  for (var i = 0; i < this.transactions.length; i++) {\n    this.transactions[i].toBufferWriter(bw);\n  }\n  return bw;\n};\n\n/**\n * Will iterate through each transaction and return an array of hashes\n * @returns {Array} - An array with transaction hashes\n */\nBlock.prototype.getTransactionHashes = function getTransactionHashes() {\n  var hashes = [];\n  if (this.transactions.length === 0) {\n    return [Block.Values.NULL_HASH];\n  }\n  for (var t = 0; t < this.transactions.length; t++) {\n    hashes.push(this.transactions[t]._getHash());\n  }\n  return hashes;\n};\n\n/**\n * Will build a merkle tree of all the transactions, ultimately arriving at\n * a single point, the merkle root.\n * @link https://en.bitcoin.it/wiki/Protocol_specification#Merkle_Trees\n * @returns {Array} - An array with each level of the tree after the other.\n */\nBlock.prototype.getMerkleTree = function getMerkleTree() {\n\n  var tree = this.getTransactionHashes();\n\n  var j = 0;\n  for (var size = this.transactions.length; size > 1; size = Math.floor((size + 1) / 2)) {\n    for (var i = 0; i < size; i += 2) {\n      var i2 = Math.min(i + 1, size - 1);\n      var buf = Buffer.concat([tree[j + i], tree[j + i2]]);\n      tree.push(Hash.sha256sha256(buf));\n    }\n    j += size;\n  }\n\n  return tree;\n};\n\n/**\n * Calculates the merkleRoot from the transactions.\n * @returns {Buffer} - A buffer of the merkle root hash\n */\nBlock.prototype.getMerkleRoot = function getMerkleRoot() {\n  var tree = this.getMerkleTree();\n  return tree[tree.length - 1];\n};\n\n/**\n * Verifies that the transactions in the block match the header merkle root\n * @returns {Boolean} - If the merkle roots match\n */\nBlock.prototype.validMerkleRoot = function validMerkleRoot() {\n\n  var h = new BN(this.header.merkleRoot.toString('hex'), 'hex');\n  var c = new BN(this.getMerkleRoot().toString('hex'), 'hex');\n\n  if (h.cmp(c) !== 0) {\n    return false;\n  }\n\n  return true;\n};\n\n/**\n * @returns {Buffer} - The little endian hash buffer of the header\n */\nBlock.prototype._getHash = function() {\n  return this.header._getHash();\n};\n\nvar idProperty = {\n  configurable: false,\n  enumerable: true,\n  /**\n   * @returns {string} - The big endian hash buffer of the header\n   */\n  get: function() {\n    if (!this._id) {\n      this._id = this.header.id;\n    }\n    return this._id;\n  },\n  set: _.noop\n};\nObject.defineProperty(Block.prototype, 'id', idProperty);\nObject.defineProperty(Block.prototype, 'hash', idProperty);\n\n/**\n * @returns {string} - A string formatted for the console\n */\nBlock.prototype.inspect = function inspect() {\n  return '<Block ' + this.id + '>';\n};\n\nBlock.Values = {\n  START_OF_BLOCK: 8, // Start of block in raw block data\n  NULL_HASH: new Buffer('0000000000000000000000000000000000000000000000000000000000000000', 'hex')\n};\n\nmodule.exports = Block;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/block/block.js\n// module id = 1316\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/block/block.js")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(1316);\n\nmodule.exports.BlockHeader = __webpack_require__(212);\nmodule.exports.MerkleBlock = __webpack_require__(565);\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/block/index.js\n// module id = 1317\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/block/index.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar BufferWriter = __webpack_require__(50);\nvar BufferReader = __webpack_require__(82);\nvar BN = __webpack_require__(30);\n\nvar Varint = function Varint(buf) {\n  if (!(this instanceof Varint))\n    return new Varint(buf);\n  if (Buffer.isBuffer(buf)) {\n    this.buf = buf;\n  } else if (typeof buf === 'number') {\n    var num = buf;\n    this.fromNumber(num);\n  } else if (buf instanceof BN) {\n    var bn = buf;\n    this.fromBN(bn);\n  } else if (buf) {\n    var obj = buf;\n    this.set(obj);\n  }\n};\n\nVarint.prototype.set = function(obj) {\n  this.buf = obj.buf || this.buf;\n  return this;\n};\n\nVarint.prototype.fromString = function(str) {\n  this.set({\n    buf: new Buffer(str, 'hex')\n  });\n  return this;\n};\n\nVarint.prototype.toString = function() {\n  return this.buf.toString('hex');\n};\n\nVarint.prototype.fromBuffer = function(buf) {\n  this.buf = buf;\n  return this;\n};\n\nVarint.prototype.fromBufferReader = function(br) {\n  this.buf = br.readVarintBuf();\n  return this;\n};\n\nVarint.prototype.fromBN = function(bn) {\n  this.buf = BufferWriter().writeVarintBN(bn).concat();\n  return this;\n};\n\nVarint.prototype.fromNumber = function(num) {\n  this.buf = BufferWriter().writeVarintNum(num).concat();\n  return this;\n};\n\nVarint.prototype.toBuffer = function() {\n  return this.buf;\n};\n\nVarint.prototype.toBN = function() {\n  return BufferReader(this.buf).readVarintBN();\n};\n\nVarint.prototype.toNumber = function() {\n  return BufferReader(this.buf).readVarintNum();\n};\n\nmodule.exports = Varint;\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/encoding/varint.js\n// module id = 1318\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/encoding/varint.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar docsURL = 'http://bitcore.io/';\n\nmodule.exports = [{\n  name: 'InvalidB58Char',\n  message: 'Invalid Base58 character: {0} in {1}'\n}, {\n  name: 'InvalidB58Checksum',\n  message: 'Invalid Base58 checksum for {0}'\n}, {\n  name: 'InvalidNetwork',\n  message: 'Invalid version for network: got {0}'\n}, {\n  name: 'InvalidState',\n  message: 'Invalid state: {0}'\n}, {\n  name: 'NotImplemented',\n  message: 'Function {0} was not implemented yet'\n}, {\n  name: 'InvalidNetworkArgument',\n  message: 'Invalid network: must be \"livenet\" or \"testnet\", got {0}'\n}, {\n  name: 'InvalidArgument',\n  message: function() {\n    return 'Invalid Argument' + (arguments[0] ? (': ' + arguments[0]) : '') +\n      (arguments[1] ? (' Documentation: ' + docsURL + arguments[1]) : '');\n  }\n}, {\n  name: 'AbstractMethodInvoked',\n  message: 'Abstract Method Invocation: {0}'\n}, {\n  name: 'InvalidArgumentType',\n  message: function() {\n    return 'Invalid Argument for ' + arguments[2] + ', expected ' + arguments[1] + ' but got ' + typeof arguments[0];\n  }\n}, {\n  name: 'Unit',\n  message: 'Internal Error on Unit {0}',\n  errors: [{\n    'name': 'UnknownCode',\n    'message': 'Unrecognized unit code: {0}'\n  }, {\n    'name': 'InvalidRate',\n    'message': 'Invalid exchange rate: {0}'\n  }]\n}, {\n  name: 'Transaction',\n  message: 'Internal Error on Transaction {0}',\n  errors: [{\n    name: 'Input',\n    message: 'Internal Error on Input {0}',\n    errors: [{\n      name: 'MissingScript',\n      message: 'Need a script to create an input'\n    }, {\n      name: 'UnsupportedScript',\n      message: 'Unsupported input script type: {0}'\n    }, {\n      name: 'MissingPreviousOutput',\n      message: 'No previous output information.'\n    }]\n  }, {\n    name: 'NeedMoreInfo',\n    message: '{0}'\n  }, {\n    name: 'InvalidSorting',\n    message: 'The sorting function provided did not return the change output as one of the array elements'\n  }, {\n    name: 'InvalidOutputAmountSum',\n    message: '{0}'\n  }, {\n    name: 'MissingSignatures',\n    message: 'Some inputs have not been fully signed'\n  }, {\n    name: 'InvalidIndex',\n    message: 'Invalid index: {0} is not between 0, {1}'\n  }, {\n    name: 'UnableToVerifySignature',\n    message: 'Unable to verify signature: {0}'\n  }, {\n    name: 'DustOutputs',\n    message: 'Dust amount detected in one output'\n  }, {\n    name: 'InvalidSatoshis',\n    message: 'Output satoshis are invalid',\n  }, {\n    name: 'FeeError',\n    message: 'Internal Error on Fee {0}',\n    errors: [{\n      name: 'TooSmall',\n      message: 'Fee is too small: {0}',\n    }, {\n      name: 'TooLarge',\n      message: 'Fee is too large: {0}',\n    }, {\n      name: 'Different',\n      message: 'Unspent value is different from specified fee: {0}',\n    }]\n  }, {\n    name: 'ChangeAddressMissing',\n    message: 'Change address is missing'\n  }, {\n    name: 'BlockHeightTooHigh',\n    message: 'Block Height can be at most 2^32 -1'\n  }, {\n    name: 'NLockTimeOutOfRange',\n    message: 'Block Height can only be between 0 and 499 999 999'\n  }, {\n    name: 'LockTimeTooEarly',\n    message: 'Lock Time can\\'t be earlier than UNIX date 500 000 000'\n  }]\n}, {\n  name: 'Script',\n  message: 'Internal Error on Script {0}',\n  errors: [{\n    name: 'UnrecognizedAddress',\n    message: 'Expected argument {0} to be an address'\n  }, {\n    name: 'CantDeriveAddress',\n    message: 'Can\\'t derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out.'\n  }, {\n    name: 'InvalidBuffer',\n    message: 'Invalid script buffer: can\\'t parse valid script from given buffer {0}'\n  }]\n}, {\n  name: 'HDPrivateKey',\n  message: 'Internal Error on HDPrivateKey {0}',\n  errors: [{\n    name: 'InvalidDerivationArgument',\n    message: 'Invalid derivation argument {0}, expected string, or number and boolean'\n  }, {\n    name: 'InvalidEntropyArgument',\n    message: 'Invalid entropy: must be an hexa string or binary buffer, got {0}',\n    errors: [{\n      name: 'TooMuchEntropy',\n      message: 'Invalid entropy: more than 512 bits is non standard, got \"{0}\"'\n    }, {\n      name: 'NotEnoughEntropy',\n      message: 'Invalid entropy: at least 128 bits needed, got \"{0}\"'\n    }]\n  }, {\n    name: 'InvalidLength',\n    message: 'Invalid length for xprivkey string in {0}'\n  }, {\n    name: 'InvalidPath',\n    message: 'Invalid derivation path: {0}'\n  }, {\n    name: 'UnrecognizedArgument',\n    message: 'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got \"{0}\"'\n  }]\n}, {\n  name: 'HDPublicKey',\n  message: 'Internal Error on HDPublicKey {0}',\n  errors: [{\n    name: 'ArgumentIsPrivateExtended',\n    message: 'Argument is an extended private key: {0}'\n  }, {\n    name: 'InvalidDerivationArgument',\n    message: 'Invalid derivation argument: got {0}'\n  }, {\n    name: 'InvalidLength',\n    message: 'Invalid length for xpubkey: got \"{0}\"'\n  }, {\n    name: 'InvalidPath',\n    message: 'Invalid derivation path, it should look like: \"m/1/100\", got \"{0}\"'\n  }, {\n    name: 'InvalidIndexCantDeriveHardened',\n    message: 'Invalid argument: creating a hardened path requires an HDPrivateKey'\n  }, {\n    name: 'MustSupplyArgument',\n    message: 'Must supply an argument to create a HDPublicKey'\n  }, {\n    name: 'UnrecognizedArgument',\n    message: 'Invalid argument for creation, must be string, json, buffer, or object'\n  }]\n}];\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/errors/spec.js\n// module id = 1319\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/errors/spec.js")},function(module,exports,__webpack_require__){"use strict";eval("/* WEBPACK VAR INJECTION */(function(Buffer) {\n\nvar _ = __webpack_require__(10);\n\nvar Script = __webpack_require__(569);\nvar Opcode = __webpack_require__(317);\nvar BN = __webpack_require__(30);\nvar Hash = __webpack_require__(36);\nvar Signature = __webpack_require__(55);\nvar PublicKey = __webpack_require__(66);\n\n/**\n * Bitcoin transactions contain scripts. Each input has a script called the\n * scriptSig, and each output has a script called the scriptPubkey. To validate\n * an input, the input's script is concatenated with the referenced output script,\n * and the result is executed. If at the end of execution the stack contains a\n * \"true\" value, then the transaction is valid.\n *\n * The primary way to use this class is via the verify function.\n * e.g., Interpreter().verify( ... );\n */\nvar Interpreter = function Interpreter(obj) {\n  if (!(this instanceof Interpreter)) {\n    return new Interpreter(obj);\n  }\n  if (obj) {\n    this.initialize();\n    this.set(obj);\n  } else {\n    this.initialize();\n  }\n};\n\n/**\n * Verifies a Script by executing it and returns true if it is valid.\n * This function needs to be provided with the scriptSig and the scriptPubkey\n * separately.\n * @param {Script} scriptSig - the script's first part (corresponding to the tx input)\n * @param {Script} scriptPubkey - the script's last part (corresponding to the tx output)\n * @param {Transaction=} tx - the Transaction containing the scriptSig in one input (used\n *    to check signature validity for some opcodes like OP_CHECKSIG)\n * @param {number} nin - index of the transaction input containing the scriptSig verified.\n * @param {number} flags - evaluation flags. See Interpreter.SCRIPT_* constants\n *\n * Translated from bitcoind's VerifyScript\n */\nInterpreter.prototype.verify = function(scriptSig, scriptPubkey, tx, nin, flags) {\n  var Transaction = __webpack_require__(216);\n  if (_.isUndefined(tx)) {\n    tx = new Transaction();\n  }\n  if (_.isUndefined(nin)) {\n    nin = 0;\n  }\n  if (_.isUndefined(flags)) {\n    flags = 0;\n  }\n  this.set({\n    script: scriptSig,\n    tx: tx,\n    nin: nin,\n    flags: flags\n  });\n  var stackCopy;\n\n  if ((flags & Interpreter.SCRIPT_VERIFY_SIGPUSHONLY) !== 0 && !scriptSig.isPushOnly()) {\n    this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY';\n    return false;\n  }\n\n  // evaluate scriptSig\n  if (!this.evaluate()) {\n    return false;\n  }\n\n  if (flags & Interpreter.SCRIPT_VERIFY_P2SH) {\n    stackCopy = this.stack.slice();\n  }\n\n  var stack = this.stack;\n  this.initialize();\n  this.set({\n    script: scriptPubkey,\n    stack: stack,\n    tx: tx,\n    nin: nin,\n    flags: flags\n  });\n\n  // evaluate scriptPubkey\n  if (!this.evaluate()) {\n    return false;\n  }\n\n  if (this.stack.length === 0) {\n    this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_RESULT';\n    return false;\n  }\n\n  var buf = this.stack[this.stack.length - 1];\n  if (!Interpreter.castToBool(buf)) {\n    this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_STACK';\n    return false;\n  }\n\n  // Additional validation for spend-to-script-hash transactions:\n  if ((flags & Interpreter.SCRIPT_VERIFY_P2SH) && scriptPubkey.isScriptHashOut()) {\n    // scriptSig must be literals-only or validation fails\n    if (!scriptSig.isPushOnly()) {\n      this.errstr = 'SCRIPT_ERR_SIG_PUSHONLY';\n      return false;\n    }\n\n    // stackCopy cannot be empty here, because if it was the\n    // P2SH  HASH <> EQUAL  scriptPubKey would be evaluated with\n    // an empty stack and the EvalScript above would return false.\n    if (stackCopy.length === 0) {\n      throw new Error('internal error - stack copy empty');\n    }\n\n    var redeemScriptSerialized = stackCopy[stackCopy.length - 1];\n    var redeemScript = Script.fromBuffer(redeemScriptSerialized);\n    stackCopy.pop();\n\n    this.initialize();\n    this.set({\n      script: redeemScript,\n      stack: stackCopy,\n      tx: tx,\n      nin: nin,\n      flags: flags\n    });\n\n    // evaluate redeemScript\n    if (!this.evaluate()) {\n      return false;\n    }\n\n    if (stackCopy.length === 0) {\n      this.errstr = 'SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK';\n      return false;\n    }\n\n    if (!Interpreter.castToBool(stackCopy[stackCopy.length - 1])) {\n      this.errstr = 'SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK';\n      return false;\n    } else {\n      return true;\n    }\n  }\n\n  return true;\n};\n\nmodule.exports = Interpreter;\n\nInterpreter.prototype.initialize = function(obj) {\n  this.stack = [];\n  this.altstack = [];\n  this.pc = 0;\n  this.pbegincodehash = 0;\n  this.nOpCount = 0;\n  this.vfExec = [];\n  this.errstr = '';\n  this.flags = 0;\n};\n\nInterpreter.prototype.set = function(obj) {\n  this.script = obj.script || this.script;\n  this.tx = obj.tx || this.tx;\n  this.nin = typeof obj.nin !== 'undefined' ? obj.nin : this.nin;\n  this.stack = obj.stack || this.stack;\n  this.altstack = obj.altack || this.altstack;\n  this.pc = typeof obj.pc !== 'undefined' ? obj.pc : this.pc;\n  this.pbegincodehash = typeof obj.pbegincodehash !== 'undefined' ? obj.pbegincodehash : this.pbegincodehash;\n  this.nOpCount = typeof obj.nOpCount !== 'undefined' ? obj.nOpCount : this.nOpCount;\n  this.vfExec = obj.vfExec || this.vfExec;\n  this.errstr = obj.errstr || this.errstr;\n  this.flags = typeof obj.flags !== 'undefined' ? obj.flags : this.flags;\n};\n\nInterpreter.true = new Buffer([1]);\nInterpreter.false = new Buffer([]);\n\nInterpreter.MAX_SCRIPT_ELEMENT_SIZE = 520;\n\nInterpreter.LOCKTIME_THRESHOLD = 500000000;\nInterpreter.LOCKTIME_THRESHOLD_BN = new BN(Interpreter.LOCKTIME_THRESHOLD);\n\n// flags taken from bitcoind\n// bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104\nInterpreter.SCRIPT_VERIFY_NONE = 0;\n\n// Evaluate P2SH subscripts (softfork safe, BIP16).\nInterpreter.SCRIPT_VERIFY_P2SH = (1 << 0);\n\n// Passing a non-strict-DER signature or one with undefined hashtype to a checksig operation causes script failure.\n// Passing a pubkey that is not (0x04 + 64 bytes) or (0x02 or 0x03 + 32 bytes) to checksig causes that pubkey to be\n// skipped (not softfork safe: this flag can widen the validity of OP_CHECKSIG OP_NOT).\nInterpreter.SCRIPT_VERIFY_STRICTENC = (1 << 1);\n\n// Passing a non-strict-DER signature to a checksig operation causes script failure (softfork safe, BIP62 rule 1)\nInterpreter.SCRIPT_VERIFY_DERSIG = (1 << 2);\n\n// Passing a non-strict-DER signature or one with S > order/2 to a checksig operation causes script failure\n// (softfork safe, BIP62 rule 5).\nInterpreter.SCRIPT_VERIFY_LOW_S = (1 << 3);\n\n// verify dummy stack item consumed by CHECKMULTISIG is of zero-length (softfork safe, BIP62 rule 7).\nInterpreter.SCRIPT_VERIFY_NULLDUMMY = (1 << 4);\n\n// Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2).\nInterpreter.SCRIPT_VERIFY_SIGPUSHONLY = (1 << 5);\n\n// Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct\n// pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating\n// any other push causes the script to fail (BIP62 rule 3).\n// In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4).\n// (softfork safe)\nInterpreter.SCRIPT_VERIFY_MINIMALDATA = (1 << 6);\n\n// Discourage use of NOPs reserved for upgrades (NOP1-10)\n//\n// Provided so that nodes can avoid accepting or mining transactions\n// containing executed NOP's whose meaning may change after a soft-fork,\n// thus rendering the script invalid; with this flag set executing\n// discouraged NOPs fails the script. This verification flag will never be\n// a mandatory flag applied to scripts in a block. NOPs that are not\n// executed, e.g.  within an unexecuted IF ENDIF block, are *not* rejected.\nInterpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS = (1 << 7);\n\n// CLTV See BIP65 for details.\nInterpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY = (1 << 9);\n\nInterpreter.castToBool = function(buf) {\n  for (var i = 0; i < buf.length; i++) {\n    if (buf[i] !== 0) {\n      // can be negative zero\n      if (i === buf.length - 1 && buf[i] === 0x80) {\n        return false;\n      }\n      return true;\n    }\n  }\n  return false;\n};\n\n/**\n * Translated from bitcoind's CheckSignatureEncoding\n */\nInterpreter.prototype.checkSignatureEncoding = function(buf) {\n  var sig;\n  if ((this.flags & (Interpreter.SCRIPT_VERIFY_DERSIG | Interpreter.SCRIPT_VERIFY_LOW_S | Interpreter.SCRIPT_VERIFY_STRICTENC)) !== 0 && !Signature.isTxDER(buf)) {\n    this.errstr = 'SCRIPT_ERR_SIG_DER_INVALID_FORMAT';\n    return false;\n  } else if ((this.flags & Interpreter.SCRIPT_VERIFY_LOW_S) !== 0) {\n    sig = Signature.fromTxFormat(buf);\n    if (!sig.hasLowS()) {\n      this.errstr = 'SCRIPT_ERR_SIG_DER_HIGH_S';\n      return false;\n    }\n  } else if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0) {\n    sig = Signature.fromTxFormat(buf);\n    if (!sig.hasDefinedHashtype()) {\n      this.errstr = 'SCRIPT_ERR_SIG_HASHTYPE';\n      return false;\n    }\n  }\n  return true;\n};\n\n/**\n * Translated from bitcoind's CheckPubKeyEncoding\n */\nInterpreter.prototype.checkPubkeyEncoding = function(buf) {\n  if ((this.flags & Interpreter.SCRIPT_VERIFY_STRICTENC) !== 0 && !PublicKey.isValid(buf)) {\n    this.errstr = 'SCRIPT_ERR_PUBKEYTYPE';\n    return false;\n  }\n  return true;\n};\n\n/**\n * Based on bitcoind's EvalScript function, with the inner loop moved to\n * Interpreter.prototype.step()\n * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104\n */\nInterpreter.prototype.evaluate = function() {\n  if (this.script.toBuffer().length > 10000) {\n    this.errstr = 'SCRIPT_ERR_SCRIPT_SIZE';\n    return false;\n  }\n\n  try {\n    while (this.pc < this.script.chunks.length) {\n      var fSuccess = this.step();\n      if (!fSuccess) {\n        return false;\n      }\n    }\n\n    // Size limits\n    if (this.stack.length + this.altstack.length > 1000) {\n      this.errstr = 'SCRIPT_ERR_STACK_SIZE';\n      return false;\n    }\n  } catch (e) {\n    this.errstr = 'SCRIPT_ERR_UNKNOWN_ERROR: ' + e;\n    return false;\n  }\n\n  if (this.vfExec.length > 0) {\n    this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL';\n    return false;\n  }\n\n  return true;\n};\n\n/**\n * Checks a locktime parameter with the transaction's locktime.\n * There are two times of nLockTime: lock-by-blockheight and lock-by-blocktime,\n * distinguished by whether nLockTime < LOCKTIME_THRESHOLD = 500000000\n *\n * See the corresponding code on bitcoin core:\n * https://github.com/bitcoin/bitcoin/blob/ffd75adce01a78b3461b3ff05bcc2b530a9ce994/src/script/interpreter.cpp#L1129\n *\n * @param {BN} nLockTime the locktime read from the script\n * @return {boolean} true if the transaction's locktime is less than or equal to\n *                   the transaction's locktime\n */\nInterpreter.prototype.checkLockTime = function(nLockTime) {\n\n  // We want to compare apples to apples, so fail the script\n  // unless the type of nLockTime being tested is the same as\n  // the nLockTime in the transaction.\n  if (!(\n    (this.tx.nLockTime <  Interpreter.LOCKTIME_THRESHOLD && nLockTime.lt(Interpreter.LOCKTIME_THRESHOLD_BN)) ||\n    (this.tx.nLockTime >= Interpreter.LOCKTIME_THRESHOLD && nLockTime.gte(Interpreter.LOCKTIME_THRESHOLD_BN))\n  )) {\n    return false;\n  }\n\n  // Now that we know we're comparing apples-to-apples, the\n  // comparison is a simple numeric one.\n  if (nLockTime.gt(new BN(this.tx.nLockTime))) {\n    return false;\n  }\n\n  // Finally the nLockTime feature can be disabled and thus\n  // CHECKLOCKTIMEVERIFY bypassed if every txin has been\n  // finalized by setting nSequence to maxint. The\n  // transaction would be allowed into the blockchain, making\n  // the opcode ineffective.\n  //\n  // Testing if this vin is not final is sufficient to\n  // prevent this condition. Alternatively we could test all\n  // inputs, but testing just this input minimizes the data\n  // required to prove correct CHECKLOCKTIMEVERIFY execution.\n  if (!this.tx.inputs[this.nin].isFinal()) {\n    return false;\n  }\n\n  return true;\n}\n\n/** \n * Based on the inner loop of bitcoind's EvalScript function\n * bitcoind commit: b5d1b1092998bc95313856d535c632ea5a8f9104\n */\nInterpreter.prototype.step = function() {\n\n  var fRequireMinimal = (this.flags & Interpreter.SCRIPT_VERIFY_MINIMALDATA) !== 0;\n\n  //bool fExec = !count(vfExec.begin(), vfExec.end(), false);\n  var fExec = (this.vfExec.indexOf(false) === -1);\n  var buf, buf1, buf2, spliced, n, x1, x2, bn, bn1, bn2, bufSig, bufPubkey, subscript;\n  var sig, pubkey;\n  var fValue, fSuccess;\n\n  // Read instruction\n  var chunk = this.script.chunks[this.pc];\n  this.pc++;\n  var opcodenum = chunk.opcodenum;\n  if (_.isUndefined(opcodenum)) {\n    this.errstr = 'SCRIPT_ERR_UNDEFINED_OPCODE';\n    return false;\n  }\n  if (chunk.buf && chunk.buf.length > Interpreter.MAX_SCRIPT_ELEMENT_SIZE) {\n    this.errstr = 'SCRIPT_ERR_PUSH_SIZE';\n    return false;\n  }\n\n  // Note how Opcode.OP_RESERVED does not count towards the opcode limit.\n  if (opcodenum > Opcode.OP_16 && ++(this.nOpCount) > 201) {\n    this.errstr = 'SCRIPT_ERR_OP_COUNT';\n    return false;\n  }\n\n\n  if (opcodenum === Opcode.OP_CAT ||\n    opcodenum === Opcode.OP_SUBSTR ||\n    opcodenum === Opcode.OP_LEFT ||\n    opcodenum === Opcode.OP_RIGHT ||\n    opcodenum === Opcode.OP_INVERT ||\n    opcodenum === Opcode.OP_AND ||\n    opcodenum === Opcode.OP_OR ||\n    opcodenum === Opcode.OP_XOR ||\n    opcodenum === Opcode.OP_2MUL ||\n    opcodenum === Opcode.OP_2DIV ||\n    opcodenum === Opcode.OP_MUL ||\n    opcodenum === Opcode.OP_DIV ||\n    opcodenum === Opcode.OP_MOD ||\n    opcodenum === Opcode.OP_LSHIFT ||\n    opcodenum === Opcode.OP_RSHIFT) {\n    this.errstr = 'SCRIPT_ERR_DISABLED_OPCODE';\n    return false;\n  }\n\n  if (fExec && 0 <= opcodenum && opcodenum <= Opcode.OP_PUSHDATA4) {\n    if (fRequireMinimal && !this.script.checkMinimalPush(this.pc - 1)) {\n      this.errstr = 'SCRIPT_ERR_MINIMALDATA';\n      return false;\n    }\n    if (!chunk.buf) {\n      this.stack.push(Interpreter.false);\n    } else if (chunk.len !== chunk.buf.length) {\n      throw new Error('Length of push value not equal to length of data');\n    } else {\n      this.stack.push(chunk.buf);\n    }\n  } else if (fExec || (Opcode.OP_IF <= opcodenum && opcodenum <= Opcode.OP_ENDIF)) {\n    switch (opcodenum) {\n      // Push value\n      case Opcode.OP_1NEGATE:\n      case Opcode.OP_1:\n      case Opcode.OP_2:\n      case Opcode.OP_3:\n      case Opcode.OP_4:\n      case Opcode.OP_5:\n      case Opcode.OP_6:\n      case Opcode.OP_7:\n      case Opcode.OP_8:\n      case Opcode.OP_9:\n      case Opcode.OP_10:\n      case Opcode.OP_11:\n      case Opcode.OP_12:\n      case Opcode.OP_13:\n      case Opcode.OP_14:\n      case Opcode.OP_15:\n      case Opcode.OP_16:\n        {\n          // ( -- value)\n          // ScriptNum bn((int)opcode - (int)(Opcode.OP_1 - 1));\n          n = opcodenum - (Opcode.OP_1 - 1);\n          buf = new BN(n).toScriptNumBuffer();\n          this.stack.push(buf);\n          // The result of these opcodes should always be the minimal way to push the data\n          // they push, so no need for a CheckMinimalPush here.\n        }\n        break;\n\n\n        //\n        // Control\n        //\n      case Opcode.OP_NOP:\n        break;\n\n      case Opcode.OP_NOP2:\n      case Opcode.OP_CHECKLOCKTIMEVERIFY:\n\n        if (!(this.flags & Interpreter.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)) {\n          // not enabled; treat as a NOP2\n          if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) {\n            this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS';\n            return false;\n          }\n          break;\n        }\n\n        if (this.stack.length < 1) {\n          this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n          return false;\n        }\n\n        // Note that elsewhere numeric opcodes are limited to\n        // operands in the range -2**31+1 to 2**31-1, however it is\n        // legal for opcodes to produce results exceeding that\n        // range. This limitation is implemented by CScriptNum's\n        // default 4-byte limit.\n        //\n        // If we kept to that limit we'd have a year 2038 problem,\n        // even though the nLockTime field in transactions\n        // themselves is uint32 which only becomes meaningless\n        // after the year 2106.\n        //\n        // Thus as a special case we tell CScriptNum to accept up\n        // to 5-byte bignums, which are good until 2**39-1, well\n        // beyond the 2**32-1 limit of the nLockTime field itself.\n        var nLockTime = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal, 5);\n\n        // In the rare event that the argument may be < 0 due to\n        // some arithmetic being done first, you can always use\n        // 0 MAX CHECKLOCKTIMEVERIFY.\n        if (nLockTime.lt(new BN(0))) {\n          this.errstr = 'SCRIPT_ERR_NEGATIVE_LOCKTIME';\n          return false;\n        }\n\n        // Actually compare the specified lock time with the transaction.\n        if (!this.checkLockTime(nLockTime)) {\n          this.errstr = 'SCRIPT_ERR_UNSATISFIED_LOCKTIME';\n          return false;\n        }\n        break;\n\n      case Opcode.OP_NOP1:\n      case Opcode.OP_NOP3:\n      case Opcode.OP_NOP4:\n      case Opcode.OP_NOP5:\n      case Opcode.OP_NOP6:\n      case Opcode.OP_NOP7:\n      case Opcode.OP_NOP8:\n      case Opcode.OP_NOP9:\n      case Opcode.OP_NOP10:\n        {\n          if (this.flags & Interpreter.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) {\n            this.errstr = 'SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS';\n            return false;\n          }\n        }\n        break;\n\n      case Opcode.OP_IF:\n      case Opcode.OP_NOTIF:\n        {\n          // <expression> if [statements] [else [statements]] endif\n          // bool fValue = false;\n          fValue = false;\n          if (fExec) {\n            if (this.stack.length < 1) {\n              this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL';\n              return false;\n            }\n            buf = this.stack.pop();\n            fValue = Interpreter.castToBool(buf);\n            if (opcodenum === Opcode.OP_NOTIF) {\n              fValue = !fValue;\n            }\n          }\n          this.vfExec.push(fValue);\n        }\n        break;\n\n      case Opcode.OP_ELSE:\n        {\n          if (this.vfExec.length === 0) {\n            this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL';\n            return false;\n          }\n          this.vfExec[this.vfExec.length - 1] = !this.vfExec[this.vfExec.length - 1];\n        }\n        break;\n\n      case Opcode.OP_ENDIF:\n        {\n          if (this.vfExec.length === 0) {\n            this.errstr = 'SCRIPT_ERR_UNBALANCED_CONDITIONAL';\n            return false;\n          }\n          this.vfExec.pop();\n        }\n        break;\n\n      case Opcode.OP_VERIFY:\n        {\n          // (true -- ) or\n          // (false -- false) and return\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - 1];\n          fValue = Interpreter.castToBool(buf);\n          if (fValue) {\n            this.stack.pop();\n          } else {\n            this.errstr = 'SCRIPT_ERR_VERIFY';\n            return false;\n          }\n        }\n        break;\n\n      case Opcode.OP_RETURN:\n        {\n          this.errstr = 'SCRIPT_ERR_OP_RETURN';\n          return false;\n        }\n        break;\n\n\n        //\n        // Stack ops\n        //\n      case Opcode.OP_TOALTSTACK:\n        {\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.altstack.push(this.stack.pop());\n        }\n        break;\n\n      case Opcode.OP_FROMALTSTACK:\n        {\n          if (this.altstack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_ALTSTACK_OPERATION';\n            return false;\n          }\n          this.stack.push(this.altstack.pop());\n        }\n        break;\n\n      case Opcode.OP_2DROP:\n        {\n          // (x1 x2 -- )\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.pop();\n          this.stack.pop();\n        }\n        break;\n\n      case Opcode.OP_2DUP:\n        {\n          // (x1 x2 -- x1 x2 x1 x2)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf1 = this.stack[this.stack.length - 2];\n          buf2 = this.stack[this.stack.length - 1];\n          this.stack.push(buf1);\n          this.stack.push(buf2);\n        }\n        break;\n\n      case Opcode.OP_3DUP:\n        {\n          // (x1 x2 x3 -- x1 x2 x3 x1 x2 x3)\n          if (this.stack.length < 3) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf1 = this.stack[this.stack.length - 3];\n          buf2 = this.stack[this.stack.length - 2];\n          var buf3 = this.stack[this.stack.length - 1];\n          this.stack.push(buf1);\n          this.stack.push(buf2);\n          this.stack.push(buf3);\n        }\n        break;\n\n      case Opcode.OP_2OVER:\n        {\n          // (x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2)\n          if (this.stack.length < 4) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf1 = this.stack[this.stack.length - 4];\n          buf2 = this.stack[this.stack.length - 3];\n          this.stack.push(buf1);\n          this.stack.push(buf2);\n        }\n        break;\n\n      case Opcode.OP_2ROT:\n        {\n          // (x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2)\n          if (this.stack.length < 6) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          spliced = this.stack.splice(this.stack.length - 6, 2);\n          this.stack.push(spliced[0]);\n          this.stack.push(spliced[1]);\n        }\n        break;\n\n      case Opcode.OP_2SWAP:\n        {\n          // (x1 x2 x3 x4 -- x3 x4 x1 x2)\n          if (this.stack.length < 4) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          spliced = this.stack.splice(this.stack.length - 4, 2);\n          this.stack.push(spliced[0]);\n          this.stack.push(spliced[1]);\n        }\n        break;\n\n      case Opcode.OP_IFDUP:\n        {\n          // (x - 0 | x x)\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - 1];\n          fValue = Interpreter.castToBool(buf);\n          if (fValue) {\n            this.stack.push(buf);\n          }\n        }\n        break;\n\n      case Opcode.OP_DEPTH:\n        {\n          // -- stacksize\n          buf = new BN(this.stack.length).toScriptNumBuffer();\n          this.stack.push(buf);\n        }\n        break;\n\n      case Opcode.OP_DROP:\n        {\n          // (x -- )\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.pop();\n        }\n        break;\n\n      case Opcode.OP_DUP:\n        {\n          // (x -- x x)\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.push(this.stack[this.stack.length - 1]);\n        }\n        break;\n\n      case Opcode.OP_NIP:\n        {\n          // (x1 x2 -- x2)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.splice(this.stack.length - 2, 1);\n        }\n        break;\n\n      case Opcode.OP_OVER:\n        {\n          // (x1 x2 -- x1 x2 x1)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.push(this.stack[this.stack.length - 2]);\n        }\n        break;\n\n      case Opcode.OP_PICK:\n      case Opcode.OP_ROLL:\n        {\n          // (xn ... x2 x1 x0 n - xn ... x2 x1 x0 xn)\n          // (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - 1];\n          bn = BN.fromScriptNumBuffer(buf, fRequireMinimal);\n          n = bn.toNumber();\n          this.stack.pop();\n          if (n < 0 || n >= this.stack.length) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - n - 1];\n          if (opcodenum === Opcode.OP_ROLL) {\n            this.stack.splice(this.stack.length - n - 1, 1);\n          }\n          this.stack.push(buf);\n        }\n        break;\n\n      case Opcode.OP_ROT:\n        {\n          // (x1 x2 x3 -- x2 x3 x1)\n          //  x2 x1 x3  after first swap\n          //  x2 x3 x1  after second swap\n          if (this.stack.length < 3) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          x1 = this.stack[this.stack.length - 3];\n          x2 = this.stack[this.stack.length - 2];\n          var x3 = this.stack[this.stack.length - 1];\n          this.stack[this.stack.length - 3] = x2;\n          this.stack[this.stack.length - 2] = x3;\n          this.stack[this.stack.length - 1] = x1;\n        }\n        break;\n\n      case Opcode.OP_SWAP:\n        {\n          // (x1 x2 -- x2 x1)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          x1 = this.stack[this.stack.length - 2];\n          x2 = this.stack[this.stack.length - 1];\n          this.stack[this.stack.length - 2] = x2;\n          this.stack[this.stack.length - 1] = x1;\n        }\n        break;\n\n      case Opcode.OP_TUCK:\n        {\n          // (x1 x2 -- x2 x1 x2)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          this.stack.splice(this.stack.length - 2, 0, this.stack[this.stack.length - 1]);\n        }\n        break;\n\n\n      case Opcode.OP_SIZE:\n        {\n          // (in -- in size)\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          bn = new BN(this.stack[this.stack.length - 1].length);\n          this.stack.push(bn.toScriptNumBuffer());\n        }\n        break;\n\n\n        //\n        // Bitwise logic\n        //\n      case Opcode.OP_EQUAL:\n      case Opcode.OP_EQUALVERIFY:\n        //case Opcode.OP_NOTEQUAL: // use Opcode.OP_NUMNOTEQUAL\n        {\n          // (x1 x2 - bool)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf1 = this.stack[this.stack.length - 2];\n          buf2 = this.stack[this.stack.length - 1];\n          var fEqual = buf1.toString('hex') === buf2.toString('hex');\n          this.stack.pop();\n          this.stack.pop();\n          this.stack.push(fEqual ? Interpreter.true : Interpreter.false);\n          if (opcodenum === Opcode.OP_EQUALVERIFY) {\n            if (fEqual) {\n              this.stack.pop();\n            } else {\n              this.errstr = 'SCRIPT_ERR_EQUALVERIFY';\n              return false;\n            }\n          }\n        }\n        break;\n\n\n        //\n        // Numeric\n        //\n      case Opcode.OP_1ADD:\n      case Opcode.OP_1SUB:\n      case Opcode.OP_NEGATE:\n      case Opcode.OP_ABS:\n      case Opcode.OP_NOT:\n      case Opcode.OP_0NOTEQUAL:\n        {\n          // (in -- out)\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - 1];\n          bn = BN.fromScriptNumBuffer(buf, fRequireMinimal);\n          switch (opcodenum) {\n            case Opcode.OP_1ADD:\n              bn = bn.add(BN.One);\n              break;\n            case Opcode.OP_1SUB:\n              bn = bn.sub(BN.One);\n              break;\n            case Opcode.OP_NEGATE:\n              bn = bn.neg();\n              break;\n            case Opcode.OP_ABS:\n              if (bn.cmp(BN.Zero) < 0) {\n                bn = bn.neg();\n              }\n              break;\n            case Opcode.OP_NOT:\n              bn = new BN((bn.cmp(BN.Zero) === 0) + 0);\n              break;\n            case Opcode.OP_0NOTEQUAL:\n              bn = new BN((bn.cmp(BN.Zero) !== 0) + 0);\n              break;\n              //default:      assert(!'invalid opcode'); break; // TODO: does this ever occur?\n          }\n          this.stack.pop();\n          this.stack.push(bn.toScriptNumBuffer());\n        }\n        break;\n\n      case Opcode.OP_ADD:\n      case Opcode.OP_SUB:\n      case Opcode.OP_BOOLAND:\n      case Opcode.OP_BOOLOR:\n      case Opcode.OP_NUMEQUAL:\n      case Opcode.OP_NUMEQUALVERIFY:\n      case Opcode.OP_NUMNOTEQUAL:\n      case Opcode.OP_LESSTHAN:\n      case Opcode.OP_GREATERTHAN:\n      case Opcode.OP_LESSTHANOREQUAL:\n      case Opcode.OP_GREATERTHANOREQUAL:\n      case Opcode.OP_MIN:\n      case Opcode.OP_MAX:\n        {\n          // (x1 x2 -- out)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal);\n          bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal);\n          bn = new BN(0);\n\n          switch (opcodenum) {\n            case Opcode.OP_ADD:\n              bn = bn1.add(bn2);\n              break;\n\n            case Opcode.OP_SUB:\n              bn = bn1.sub(bn2);\n              break;\n\n              // case Opcode.OP_BOOLAND:       bn = (bn1 != bnZero && bn2 != bnZero); break;\n            case Opcode.OP_BOOLAND:\n              bn = new BN(((bn1.cmp(BN.Zero) !== 0) && (bn2.cmp(BN.Zero) !== 0)) + 0);\n              break;\n              // case Opcode.OP_BOOLOR:        bn = (bn1 != bnZero || bn2 != bnZero); break;\n            case Opcode.OP_BOOLOR:\n              bn = new BN(((bn1.cmp(BN.Zero) !== 0) || (bn2.cmp(BN.Zero) !== 0)) + 0);\n              break;\n              // case Opcode.OP_NUMEQUAL:      bn = (bn1 == bn2); break;\n            case Opcode.OP_NUMEQUAL:\n              bn = new BN((bn1.cmp(bn2) === 0) + 0);\n              break;\n              // case Opcode.OP_NUMEQUALVERIFY:    bn = (bn1 == bn2); break;\n            case Opcode.OP_NUMEQUALVERIFY:\n              bn = new BN((bn1.cmp(bn2) === 0) + 0);\n              break;\n              // case Opcode.OP_NUMNOTEQUAL:     bn = (bn1 != bn2); break;\n            case Opcode.OP_NUMNOTEQUAL:\n              bn = new BN((bn1.cmp(bn2) !== 0) + 0);\n              break;\n              // case Opcode.OP_LESSTHAN:      bn = (bn1 < bn2); break;\n            case Opcode.OP_LESSTHAN:\n              bn = new BN((bn1.cmp(bn2) < 0) + 0);\n              break;\n              // case Opcode.OP_GREATERTHAN:     bn = (bn1 > bn2); break;\n            case Opcode.OP_GREATERTHAN:\n              bn = new BN((bn1.cmp(bn2) > 0) + 0);\n              break;\n              // case Opcode.OP_LESSTHANOREQUAL:   bn = (bn1 <= bn2); break;\n            case Opcode.OP_LESSTHANOREQUAL:\n              bn = new BN((bn1.cmp(bn2) <= 0) + 0);\n              break;\n              // case Opcode.OP_GREATERTHANOREQUAL:  bn = (bn1 >= bn2); break;\n            case Opcode.OP_GREATERTHANOREQUAL:\n              bn = new BN((bn1.cmp(bn2) >= 0) + 0);\n              break;\n            case Opcode.OP_MIN:\n              bn = (bn1.cmp(bn2) < 0 ? bn1 : bn2);\n              break;\n            case Opcode.OP_MAX:\n              bn = (bn1.cmp(bn2) > 0 ? bn1 : bn2);\n              break;\n              // default:           assert(!'invalid opcode'); break; //TODO: does this ever occur?\n          }\n          this.stack.pop();\n          this.stack.pop();\n          this.stack.push(bn.toScriptNumBuffer());\n\n          if (opcodenum === Opcode.OP_NUMEQUALVERIFY) {\n            // if (CastToBool(stacktop(-1)))\n            if (Interpreter.castToBool(this.stack[this.stack.length - 1])) {\n              this.stack.pop();\n            } else {\n              this.errstr = 'SCRIPT_ERR_NUMEQUALVERIFY';\n              return false;\n            }\n          }\n        }\n        break;\n\n      case Opcode.OP_WITHIN:\n        {\n          // (x min max -- out)\n          if (this.stack.length < 3) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          bn1 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 3], fRequireMinimal);\n          bn2 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 2], fRequireMinimal);\n          var bn3 = BN.fromScriptNumBuffer(this.stack[this.stack.length - 1], fRequireMinimal);\n          //bool fValue = (bn2 <= bn1 && bn1 < bn3);\n          fValue = (bn2.cmp(bn1) <= 0) && (bn1.cmp(bn3) < 0);\n          this.stack.pop();\n          this.stack.pop();\n          this.stack.pop();\n          this.stack.push(fValue ? Interpreter.true : Interpreter.false);\n        }\n        break;\n\n\n        //\n        // Crypto\n        //\n      case Opcode.OP_RIPEMD160:\n      case Opcode.OP_SHA1:\n      case Opcode.OP_SHA256:\n      case Opcode.OP_HASH160:\n      case Opcode.OP_HASH256:\n        {\n          // (in -- hash)\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          buf = this.stack[this.stack.length - 1];\n          //valtype vchHash((opcode == Opcode.OP_RIPEMD160 ||\n          //                 opcode == Opcode.OP_SHA1 || opcode == Opcode.OP_HASH160) ? 20 : 32);\n          var bufHash;\n          if (opcodenum === Opcode.OP_RIPEMD160) {\n            bufHash = Hash.ripemd160(buf);\n          } else if (opcodenum === Opcode.OP_SHA1) {\n            bufHash = Hash.sha1(buf);\n          } else if (opcodenum === Opcode.OP_SHA256) {\n            bufHash = Hash.sha256(buf);\n          } else if (opcodenum === Opcode.OP_HASH160) {\n            bufHash = Hash.sha256ripemd160(buf);\n          } else if (opcodenum === Opcode.OP_HASH256) {\n            bufHash = Hash.sha256sha256(buf);\n          }\n          this.stack.pop();\n          this.stack.push(bufHash);\n        }\n        break;\n\n      case Opcode.OP_CODESEPARATOR:\n        {\n          // Hash starts after the code separator\n          this.pbegincodehash = this.pc;\n        }\n        break;\n\n      case Opcode.OP_CHECKSIG:\n      case Opcode.OP_CHECKSIGVERIFY:\n        {\n          // (sig pubkey -- bool)\n          if (this.stack.length < 2) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n\n          bufSig = this.stack[this.stack.length - 2];\n          bufPubkey = this.stack[this.stack.length - 1];\n\n          // Subset of script starting at the most recent codeseparator\n          // CScript scriptCode(pbegincodehash, pend);\n          subscript = new Script().set({\n            chunks: this.script.chunks.slice(this.pbegincodehash)\n          });\n\n          // Drop the signature, since there's no way for a signature to sign itself\n          var tmpScript = new Script().add(bufSig);\n          subscript.findAndDelete(tmpScript);\n\n          if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) {\n            return false;\n          }\n\n          try {\n            sig = Signature.fromTxFormat(bufSig);\n            pubkey = PublicKey.fromBuffer(bufPubkey, false);\n            fSuccess = this.tx.verifySignature(sig, pubkey, this.nin, subscript);\n          } catch (e) {\n            //invalid sig or pubkey\n            fSuccess = false;\n          }\n\n          this.stack.pop();\n          this.stack.pop();\n          // stack.push_back(fSuccess ? vchTrue : vchFalse);\n          this.stack.push(fSuccess ? Interpreter.true : Interpreter.false);\n          if (opcodenum === Opcode.OP_CHECKSIGVERIFY) {\n            if (fSuccess) {\n              this.stack.pop();\n            } else {\n              this.errstr = 'SCRIPT_ERR_CHECKSIGVERIFY';\n              return false;\n            }\n          }\n        }\n        break;\n\n      case Opcode.OP_CHECKMULTISIG:\n      case Opcode.OP_CHECKMULTISIGVERIFY:\n        {\n          // ([sig ...] num_of_signatures [pubkey ...] num_of_pubkeys -- bool)\n\n          var i = 1;\n          if (this.stack.length < i) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n\n          var nKeysCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber();\n          if (nKeysCount < 0 || nKeysCount > 20) {\n            this.errstr = 'SCRIPT_ERR_PUBKEY_COUNT';\n            return false;\n          }\n          this.nOpCount += nKeysCount;\n          if (this.nOpCount > 201) {\n            this.errstr = 'SCRIPT_ERR_OP_COUNT';\n            return false;\n          }\n          // int ikey = ++i;\n          var ikey = ++i;\n          i += nKeysCount;\n          if (this.stack.length < i) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n\n          var nSigsCount = BN.fromScriptNumBuffer(this.stack[this.stack.length - i], fRequireMinimal).toNumber();\n          if (nSigsCount < 0 || nSigsCount > nKeysCount) {\n            this.errstr = 'SCRIPT_ERR_SIG_COUNT';\n            return false;\n          }\n          // int isig = ++i;\n          var isig = ++i;\n          i += nSigsCount;\n          if (this.stack.length < i) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n\n          // Subset of script starting at the most recent codeseparator\n          subscript = new Script().set({\n            chunks: this.script.chunks.slice(this.pbegincodehash)\n          });\n\n          // Drop the signatures, since there's no way for a signature to sign itself\n          for (var k = 0; k < nSigsCount; k++) {\n            bufSig = this.stack[this.stack.length - isig - k];\n            subscript.findAndDelete(new Script().add(bufSig));\n          }\n\n          fSuccess = true;\n          while (fSuccess && nSigsCount > 0) {\n            // valtype& vchSig  = stacktop(-isig);\n            bufSig = this.stack[this.stack.length - isig];\n            // valtype& vchPubKey = stacktop(-ikey);\n            bufPubkey = this.stack[this.stack.length - ikey];\n\n            if (!this.checkSignatureEncoding(bufSig) || !this.checkPubkeyEncoding(bufPubkey)) {\n              return false;\n            }\n\n            var fOk;\n            try {\n              sig = Signature.fromTxFormat(bufSig);\n              pubkey = PublicKey.fromBuffer(bufPubkey, false);\n              fOk = this.tx.verifySignature(sig, pubkey, this.nin, subscript);\n            } catch (e) {\n              //invalid sig or pubkey\n              fOk = false;\n            }\n\n            if (fOk) {\n              isig++;\n              nSigsCount--;\n            }\n            ikey++;\n            nKeysCount--;\n\n            // If there are more signatures left than keys left,\n            // then too many signatures have failed\n            if (nSigsCount > nKeysCount) {\n              fSuccess = false;\n            }\n          }\n\n          // Clean up stack of actual arguments\n          while (i-- > 1) {\n            this.stack.pop();\n          }\n\n          // A bug causes CHECKMULTISIG to consume one extra argument\n          // whose contents were not checked in any way.\n          //\n          // Unfortunately this is a potential source of mutability,\n          // so optionally verify it is exactly equal to zero prior\n          // to removing it from the stack.\n          if (this.stack.length < 1) {\n            this.errstr = 'SCRIPT_ERR_INVALID_STACK_OPERATION';\n            return false;\n          }\n          if ((this.flags & Interpreter.SCRIPT_VERIFY_NULLDUMMY) && this.stack[this.stack.length - 1].length) {\n            this.errstr = 'SCRIPT_ERR_SIG_NULLDUMMY';\n            return false;\n          }\n          this.stack.pop();\n\n          this.stack.push(fSuccess ? Interpreter.true : Interpreter.false);\n\n          if (opcodenum === Opcode.OP_CHECKMULTISIGVERIFY) {\n            if (fSuccess) {\n              this.stack.pop();\n            } else {\n              this.errstr = 'SCRIPT_ERR_CHECKMULTISIGVERIFY';\n              return false;\n            }\n          }\n        }\n        break;\n\n      default:\n        this.errstr = 'SCRIPT_ERR_BAD_OPCODE';\n        return false;\n    }\n  }\n\n  return true;\n};\n\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0).Buffer))\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/script/interpreter.js\n// module id = 1320\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/script/interpreter.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar inherits = __webpack_require__(75);\nvar Transaction = __webpack_require__(319);\nvar Input = __webpack_require__(159);\nvar Output = __webpack_require__(83);\nvar $ = __webpack_require__(13);\n\nvar Script = __webpack_require__(57);\nvar Signature = __webpack_require__(55);\nvar Sighash = __webpack_require__(84);\nvar PublicKey = __webpack_require__(66);\nvar BufferUtil = __webpack_require__(18);\nvar TransactionSignature = __webpack_require__(160);\n\n/**\n * @constructor\n */\nfunction MultiSigInput(input, pubkeys, threshold, signatures) {\n  Input.apply(this, arguments);\n  var self = this;\n  pubkeys = pubkeys || input.publicKeys;\n  threshold = threshold || input.threshold;\n  signatures = signatures || input.signatures;\n  this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); });\n  $.checkState(Script.buildMultisigOut(this.publicKeys, threshold).equals(this.output.script),\n    'Provided public keys don\\'t match to the provided output script');\n  this.publicKeyIndex = {};\n  _.each(this.publicKeys, function(publicKey, index) {\n    self.publicKeyIndex[publicKey.toString()] = index;\n  });\n  this.threshold = threshold;\n  // Empty array of signatures\n  this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length);\n}\ninherits(MultiSigInput, Input);\n\nMultiSigInput.prototype.toObject = function() {\n  var obj = Input.prototype.toObject.apply(this, arguments);\n  obj.threshold = this.threshold;\n  obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); });\n  obj.signatures = this._serializeSignatures();\n  return obj;\n};\n\nMultiSigInput.prototype._deserializeSignatures = function(signatures) {\n  return _.map(signatures, function(signature) {\n    if (!signature) {\n      return undefined;\n    }\n    return new TransactionSignature(signature);\n  });\n};\n\nMultiSigInput.prototype._serializeSignatures = function() {\n  return _.map(this.signatures, function(signature) {\n    if (!signature) {\n      return undefined;\n    }\n    return signature.toObject();\n  });\n};\n\nMultiSigInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) {\n  $.checkState(this.output instanceof Output);\n  sigtype = sigtype || Signature.SIGHASH_ALL;\n\n  var self = this;\n  var results = [];\n  _.each(this.publicKeys, function(publicKey) {\n    if (publicKey.toString() === privateKey.publicKey.toString()) {\n      results.push(new TransactionSignature({\n        publicKey: privateKey.publicKey,\n        prevTxId: self.prevTxId,\n        outputIndex: self.outputIndex,\n        inputIndex: index,\n        signature: Sighash.sign(transaction, privateKey, sigtype, index, self.output.script),\n        sigtype: sigtype\n      }));\n    }\n  });\n\n  return results;\n};\n\nMultiSigInput.prototype.addSignature = function(transaction, signature) {\n  $.checkState(!this.isFullySigned(), 'All needed signatures have already been added');\n  $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]),\n    'Signature has no matching public key');\n  $.checkState(this.isValidSignature(transaction, signature));\n  this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature;\n  this._updateScript();\n  return this;\n};\n\nMultiSigInput.prototype._updateScript = function() {\n  this.setScript(Script.buildMultisigIn(\n    this.publicKeys,\n    this.threshold,\n    this._createSignatures()\n  ));\n  return this;\n};\n\nMultiSigInput.prototype._createSignatures = function() {\n  return _.map(\n    _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }),\n    function(signature) {\n      return BufferUtil.concat([\n        signature.signature.toDER(),\n        BufferUtil.integerAsSingleByteBuffer(signature.sigtype)\n      ]);\n    }\n  );\n};\n\nMultiSigInput.prototype.clearSignatures = function() {\n  this.signatures = new Array(this.publicKeys.length);\n  this._updateScript();\n};\n\nMultiSigInput.prototype.isFullySigned = function() {\n  return this.countSignatures() === this.threshold;\n};\n\nMultiSigInput.prototype.countMissingSignatures = function() {\n  return this.threshold - this.countSignatures();\n};\n\nMultiSigInput.prototype.countSignatures = function() {\n  return _.reduce(this.signatures, function(sum, signature) {\n    return sum + (!!signature);\n  }, 0);\n};\n\nMultiSigInput.prototype.publicKeysWithoutSignature = function() {\n  var self = this;\n  return _.filter(this.publicKeys, function(publicKey) {\n    return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]);\n  });\n};\n\nMultiSigInput.prototype.isValidSignature = function(transaction, signature) {\n  // FIXME: Refactor signature so this is not necessary\n  signature.signature.nhashtype = signature.sigtype;\n  return Sighash.verify(\n    transaction,\n    signature.signature,\n    signature.publicKey,\n    signature.inputIndex,\n    this.output.script\n  );\n};\n\n/**\n *\n * @param {Buffer[]} signatures\n * @param {PublicKey[]} publicKeys\n * @param {Transaction} transaction\n * @param {Integer} inputIndex\n * @param {Input} input\n * @returns {TransactionSignature[]}\n */\nMultiSigInput.normalizeSignatures = function(transaction, input, inputIndex, signatures, publicKeys) {\n  return publicKeys.map(function (pubKey) {\n    var signatureMatch = null;\n    signatures = signatures.filter(function (signatureBuffer) {\n      if (signatureMatch) {\n        return true;\n      }\n\n      var signature = new TransactionSignature({\n        signature: Signature.fromTxFormat(signatureBuffer),\n        publicKey: pubKey,\n        prevTxId: input.prevTxId,\n        outputIndex: input.outputIndex,\n        inputIndex: inputIndex,\n        sigtype: Signature.SIGHASH_ALL\n      });\n\n      signature.signature.nhashtype = signature.sigtype;\n      var isMatch = Sighash.verify(\n          transaction,\n          signature.signature,\n          signature.publicKey,\n          signature.inputIndex,\n          input.output.script\n      );\n\n      if (isMatch) {\n        signatureMatch = signature;\n        return false;\n      }\n\n      return true;\n    });\n\n    return signatureMatch ? signatureMatch : null;\n  });\n};\n\nMultiSigInput.OPCODES_SIZE = 1; // 0\nMultiSigInput.SIGNATURE_SIZE = 73; // size (1) + DER (<=72)\n\nMultiSigInput.prototype._estimateSize = function() {\n  return MultiSigInput.OPCODES_SIZE +\n    this.threshold * MultiSigInput.SIGNATURE_SIZE;\n};\n\nmodule.exports = MultiSigInput;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/multisig.js\n// module id = 1321\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/multisig.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar inherits = __webpack_require__(75);\nvar Input = __webpack_require__(159);\nvar Output = __webpack_require__(83);\nvar $ = __webpack_require__(13);\n\nvar Script = __webpack_require__(57);\nvar Signature = __webpack_require__(55);\nvar Sighash = __webpack_require__(84);\nvar PublicKey = __webpack_require__(66);\nvar BufferUtil = __webpack_require__(18);\nvar TransactionSignature = __webpack_require__(160);\n\n/**\n * @constructor\n */\nfunction MultiSigScriptHashInput(input, pubkeys, threshold, signatures) {\n  Input.apply(this, arguments);\n  var self = this;\n  pubkeys = pubkeys || input.publicKeys;\n  threshold = threshold || input.threshold;\n  signatures = signatures || input.signatures;\n  this.publicKeys = _.sortBy(pubkeys, function(publicKey) { return publicKey.toString('hex'); });\n  this.redeemScript = Script.buildMultisigOut(this.publicKeys, threshold);\n  $.checkState(Script.buildScriptHashOut(this.redeemScript).equals(this.output.script),\n               'Provided public keys don\\'t hash to the provided output');\n  this.publicKeyIndex = {};\n  _.each(this.publicKeys, function(publicKey, index) {\n    self.publicKeyIndex[publicKey.toString()] = index;\n  });\n  this.threshold = threshold;\n  // Empty array of signatures\n  this.signatures = signatures ? this._deserializeSignatures(signatures) : new Array(this.publicKeys.length);\n}\ninherits(MultiSigScriptHashInput, Input);\n\nMultiSigScriptHashInput.prototype.toObject = function() {\n  var obj = Input.prototype.toObject.apply(this, arguments);\n  obj.threshold = this.threshold;\n  obj.publicKeys = _.map(this.publicKeys, function(publicKey) { return publicKey.toString(); });\n  obj.signatures = this._serializeSignatures();\n  return obj;\n};\n\nMultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) {\n  return _.map(signatures, function(signature) {\n    if (!signature) {\n      return undefined;\n    }\n    return new TransactionSignature(signature);\n  });\n};\n\nMultiSigScriptHashInput.prototype._serializeSignatures = function() {\n  return _.map(this.signatures, function(signature) {\n    if (!signature) {\n      return undefined;\n    }\n    return signature.toObject();\n  });\n};\n\nMultiSigScriptHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) {\n  $.checkState(this.output instanceof Output);\n  sigtype = sigtype || Signature.SIGHASH_ALL;\n\n  var self = this;\n  var results = [];\n  _.each(this.publicKeys, function(publicKey) {\n    if (publicKey.toString() === privateKey.publicKey.toString()) {\n      results.push(new TransactionSignature({\n        publicKey: privateKey.publicKey,\n        prevTxId: self.prevTxId,\n        outputIndex: self.outputIndex,\n        inputIndex: index,\n        signature: Sighash.sign(transaction, privateKey, sigtype, index, self.redeemScript),\n        sigtype: sigtype\n      }));\n    }\n  });\n  return results;\n};\n\nMultiSigScriptHashInput.prototype.addSignature = function(transaction, signature) {\n  $.checkState(!this.isFullySigned(), 'All needed signatures have already been added');\n  $.checkArgument(!_.isUndefined(this.publicKeyIndex[signature.publicKey.toString()]),\n                  'Signature has no matching public key');\n  $.checkState(this.isValidSignature(transaction, signature));\n  this.signatures[this.publicKeyIndex[signature.publicKey.toString()]] = signature;\n  this._updateScript();\n  return this;\n};\n\nMultiSigScriptHashInput.prototype._updateScript = function() {\n  this.setScript(Script.buildP2SHMultisigIn(\n    this.publicKeys,\n    this.threshold,\n    this._createSignatures(),\n    { cachedMultisig: this.redeemScript }\n  ));\n  return this;\n};\n\nMultiSigScriptHashInput.prototype._createSignatures = function() {\n  return _.map(\n    _.filter(this.signatures, function(signature) { return !_.isUndefined(signature); }),\n    function(signature) {\n      return BufferUtil.concat([\n        signature.signature.toDER(),\n        BufferUtil.integerAsSingleByteBuffer(signature.sigtype)\n      ]);\n    }\n  );\n};\n\nMultiSigScriptHashInput.prototype.clearSignatures = function() {\n  this.signatures = new Array(this.publicKeys.length);\n  this._updateScript();\n};\n\nMultiSigScriptHashInput.prototype.isFullySigned = function() {\n  return this.countSignatures() === this.threshold;\n};\n\nMultiSigScriptHashInput.prototype.countMissingSignatures = function() {\n  return this.threshold - this.countSignatures();\n};\n\nMultiSigScriptHashInput.prototype.countSignatures = function() {\n  return _.reduce(this.signatures, function(sum, signature) {\n    return sum + (!!signature);\n  }, 0);\n};\n\nMultiSigScriptHashInput.prototype.publicKeysWithoutSignature = function() {\n  var self = this;\n  return _.filter(this.publicKeys, function(publicKey) {\n    return !(self.signatures[self.publicKeyIndex[publicKey.toString()]]);\n  });\n};\n\nMultiSigScriptHashInput.prototype.isValidSignature = function(transaction, signature) {\n  // FIXME: Refactor signature so this is not necessary\n  signature.signature.nhashtype = signature.sigtype;\n  return Sighash.verify(\n      transaction,\n      signature.signature,\n      signature.publicKey,\n      signature.inputIndex,\n      this.redeemScript\n  );\n};\n\nMultiSigScriptHashInput.OPCODES_SIZE = 7; // serialized size (<=3) + 0 .. N .. M OP_CHECKMULTISIG\nMultiSigScriptHashInput.SIGNATURE_SIZE = 74; // size (1) + DER (<=72) + sighash (1)\nMultiSigScriptHashInput.PUBKEY_SIZE = 34; // size (1) + DER (<=33)\n\nMultiSigScriptHashInput.prototype._estimateSize = function() {\n  return MultiSigScriptHashInput.OPCODES_SIZE +\n    this.threshold * MultiSigScriptHashInput.SIGNATURE_SIZE +\n    this.publicKeys.length * MultiSigScriptHashInput.PUBKEY_SIZE;\n};\n\nmodule.exports = MultiSigScriptHashInput;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/multisigscripthash.js\n// module id = 1322\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/multisigscripthash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar inherits = __webpack_require__(75);\n\nvar $ = __webpack_require__(13);\nvar BufferUtil = __webpack_require__(18);\n\nvar Input = __webpack_require__(159);\nvar Output = __webpack_require__(83);\nvar Sighash = __webpack_require__(84);\nvar Script = __webpack_require__(57);\nvar Signature = __webpack_require__(55);\nvar TransactionSignature = __webpack_require__(160);\n\n/**\n * Represents a special kind of input of PayToPublicKey kind.\n * @constructor\n */\nfunction PublicKeyInput() {\n  Input.apply(this, arguments);\n}\ninherits(PublicKeyInput, Input);\n\n/**\n * @param {Transaction} transaction - the transaction to be signed\n * @param {PrivateKey} privateKey - the private key with which to sign the transaction\n * @param {number} index - the index of the input in the transaction input vector\n * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL\n * @return {Array} of objects that can be\n */\nPublicKeyInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype) {\n  $.checkState(this.output instanceof Output);\n  sigtype = sigtype || Signature.SIGHASH_ALL;\n  var publicKey = privateKey.toPublicKey();\n  if (publicKey.toString() === this.output.script.getPublicKey().toString('hex')) {\n    return [new TransactionSignature({\n      publicKey: publicKey,\n      prevTxId: this.prevTxId,\n      outputIndex: this.outputIndex,\n      inputIndex: index,\n      signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script),\n      sigtype: sigtype\n    })];\n  }\n  return [];\n};\n\n/**\n * Add the provided signature\n *\n * @param {Object} signature\n * @param {PublicKey} signature.publicKey\n * @param {Signature} signature.signature\n * @param {number=} signature.sigtype\n * @return {PublicKeyInput} this, for chaining\n */\nPublicKeyInput.prototype.addSignature = function(transaction, signature) {\n  $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid');\n  this.setScript(Script.buildPublicKeyIn(\n    signature.signature.toDER(),\n    signature.sigtype\n  ));\n  return this;\n};\n\n/**\n * Clear the input's signature\n * @return {PublicKeyHashInput} this, for chaining\n */\nPublicKeyInput.prototype.clearSignatures = function() {\n  this.setScript(Script.empty());\n  return this;\n};\n\n/**\n * Query whether the input is signed\n * @return {boolean}\n */\nPublicKeyInput.prototype.isFullySigned = function() {\n  return this.script.isPublicKeyIn();\n};\n\nPublicKeyInput.SCRIPT_MAX_SIZE = 73; // sigsize (1 + 72)\n\nPublicKeyInput.prototype._estimateSize = function() {\n  return PublicKeyInput.SCRIPT_MAX_SIZE;\n};\n\nmodule.exports = PublicKeyInput;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/publickey.js\n// module id = 1323\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/publickey.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar inherits = __webpack_require__(75);\n\nvar $ = __webpack_require__(13);\nvar BufferUtil = __webpack_require__(18);\n\nvar Hash = __webpack_require__(36);\nvar Input = __webpack_require__(159);\nvar Output = __webpack_require__(83);\nvar Sighash = __webpack_require__(84);\nvar Script = __webpack_require__(57);\nvar Signature = __webpack_require__(55);\nvar TransactionSignature = __webpack_require__(160);\n\n/**\n * Represents a special kind of input of PayToPublicKeyHash kind.\n * @constructor\n */\nfunction PublicKeyHashInput() {\n  Input.apply(this, arguments);\n}\ninherits(PublicKeyHashInput, Input);\n\n/* jshint maxparams: 5 */\n/**\n * @param {Transaction} transaction - the transaction to be signed\n * @param {PrivateKey} privateKey - the private key with which to sign the transaction\n * @param {number} index - the index of the input in the transaction input vector\n * @param {number=} sigtype - the type of signature, defaults to Signature.SIGHASH_ALL\n * @param {Buffer=} hashData - the precalculated hash of the public key associated with the privateKey provided\n * @return {Array} of objects that can be\n */\nPublicKeyHashInput.prototype.getSignatures = function(transaction, privateKey, index, sigtype, hashData) {\n  $.checkState(this.output instanceof Output);\n  hashData = hashData || Hash.sha256ripemd160(privateKey.publicKey.toBuffer());\n  sigtype = sigtype || Signature.SIGHASH_ALL;\n\n  if (BufferUtil.equals(hashData, this.output.script.getPublicKeyHash())) {\n    return [new TransactionSignature({\n      publicKey: privateKey.publicKey,\n      prevTxId: this.prevTxId,\n      outputIndex: this.outputIndex,\n      inputIndex: index,\n      signature: Sighash.sign(transaction, privateKey, sigtype, index, this.output.script),\n      sigtype: sigtype\n    })];\n  }\n  return [];\n};\n/* jshint maxparams: 3 */\n\n/**\n * Add the provided signature\n *\n * @param {Object} signature\n * @param {PublicKey} signature.publicKey\n * @param {Signature} signature.signature\n * @param {number=} signature.sigtype\n * @return {PublicKeyHashInput} this, for chaining\n */\nPublicKeyHashInput.prototype.addSignature = function(transaction, signature) {\n  $.checkState(this.isValidSignature(transaction, signature), 'Signature is invalid');\n  this.setScript(Script.buildPublicKeyHashIn(\n    signature.publicKey,\n    signature.signature.toDER(),\n    signature.sigtype\n  ));\n  return this;\n};\n\n/**\n * Clear the input's signature\n * @return {PublicKeyHashInput} this, for chaining\n */\nPublicKeyHashInput.prototype.clearSignatures = function() {\n  this.setScript(Script.empty());\n  return this;\n};\n\n/**\n * Query whether the input is signed\n * @return {boolean}\n */\nPublicKeyHashInput.prototype.isFullySigned = function() {\n  return this.script.isPublicKeyHashIn();\n};\n\nPublicKeyHashInput.SCRIPT_MAX_SIZE = 73 + 34; // sigsize (1 + 72) + pubkey (1 + 33)\n\nPublicKeyHashInput.prototype._estimateSize = function() {\n  return PublicKeyHashInput.SCRIPT_MAX_SIZE;\n};\n\nmodule.exports = PublicKeyHashInput;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/input/publickeyhash.js\n// module id = 1324\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/input/publickeyhash.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar $ = __webpack_require__(13);\nvar BN = __webpack_require__(30);\nvar buffer = __webpack_require__(0);\nvar BufferWriter = __webpack_require__(50);\nvar BufferUtil = __webpack_require__(18);\nvar JSUtil = __webpack_require__(24);\n\nvar ZCProof = __webpack_require__(1327);\n\nvar ZC_NUM_JS_INPUTS = 2;\nvar ZC_NUM_JS_OUTPUTS = 2;\n\n// leading + v + rho + r + memo + auth\nvar ZC_NOTECIPHERTEXT_SIZE = 1 + 8 + 32 + 32 + 512 + 16;\n\nfunction JSDescription(params) {\n  if (!(this instanceof JSDescription)) {\n    return new JSDescription(params);\n  }\n  this.nullifiers = [];\n  this.commitments = [];\n  this.ciphertexts = [];\n  this.macs = [];\n  if (params) {\n    return this._fromObject(params);\n  }\n}\n\nObject.defineProperty(JSDescription.prototype, 'vpub_old', {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    return this._vpub_old;\n  },\n  set: function(num) {\n    if (num instanceof BN) {\n      this._vpub_oldBN = num;\n      this._vpub_old = num.toNumber();\n    } else if (_.isString(num)) {\n      this._vpub_old = parseInt(num);\n      this._vpub_oldBN = BN.fromNumber(this._vpub_old);\n    } else {\n      $.checkArgument(\n        JSUtil.isNaturalNumber(num),\n        'vpub_old is not a natural number'\n      );\n      this._vpub_oldBN = BN.fromNumber(num);\n      this._vpub_old = num;\n    }\n    $.checkState(\n      JSUtil.isNaturalNumber(this._vpub_old),\n      'vpub_old is not a natural number'\n    );\n  }\n});\n\nObject.defineProperty(JSDescription.prototype, 'vpub_new', {\n  configurable: false,\n  enumerable: true,\n  get: function() {\n    return this._vpub_new;\n  },\n  set: function(num) {\n    if (num instanceof BN) {\n      this._vpub_newBN = num;\n      this._vpub_new = num.toNumber();\n    } else if (_.isString(num)) {\n      this._vpub_new = parseInt(num);\n      this._vpub_newBN = BN.fromNumber(this._vpub_new);\n    } else {\n      $.checkArgument(\n        JSUtil.isNaturalNumber(num),\n        'vpub_new is not a natural number'\n      );\n      this._vpub_newBN = BN.fromNumber(num);\n      this._vpub_new = num;\n    }\n    $.checkState(\n      JSUtil.isNaturalNumber(this._vpub_new),\n      'vpub_new is not a natural number'\n    );\n  }\n});\n\nJSDescription.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj));\n  var jsdesc = new JSDescription();\n  return jsdesc._fromObject(obj);\n};\n\nJSDescription.prototype._fromObject = function(params) {\n  var nullifiers = [];\n  _.each(params.nullifiers, function(nullifier) {\n    nullifiers.push(BufferUtil.reverse(new buffer.Buffer(nullifier, 'hex')));\n  });\n  var commitments = [];\n  _.each(params.commitments, function(commitment) {\n    commitments.push(BufferUtil.reverse(new buffer.Buffer(commitment, 'hex')));\n  });\n  var ciphertexts = [];\n  _.each(params.ciphertexts, function(ciphertext) {\n    ciphertexts.push(new buffer.Buffer(ciphertext, 'hex'));\n  });\n  var macs = [];\n  _.each(params.macs, function(mac) {\n    macs.push(BufferUtil.reverse(new buffer.Buffer(mac, 'hex')));\n  });\n  this.vpub_old = params.vpub_old;\n  this.vpub_new = params.vpub_new;\n  this.anchor = BufferUtil.reverse(new buffer.Buffer(params.anchor, 'hex'));\n  this.nullifiers = nullifiers;\n  this.commitments = commitments;\n  this.ephemeralKey = BufferUtil.reverse(new buffer.Buffer(params.ephemeralKey, 'hex'));\n  this.ciphertexts = ciphertexts;\n  this.randomSeed = BufferUtil.reverse(new buffer.Buffer(params.randomSeed, 'hex'));\n  this.macs = macs;\n  this.proof = ZCProof.fromObject(params.proof);\n  return this;\n};\n\nJSDescription.prototype.toObject = JSDescription.prototype.toJSON = function toObject() {\n  var nullifiers = [];\n  _.each(this.nullifiers, function(nullifier) {\n    nullifiers.push(BufferUtil.reverse(nullifier).toString('hex'));\n  });\n  var commitments = [];\n  _.each(this.commitments, function(commitment) {\n    commitments.push(BufferUtil.reverse(commitment).toString('hex'));\n  });\n  var ciphertexts = [];\n  _.each(this.ciphertexts, function(ciphertext) {\n    ciphertexts.push(ciphertext.toString('hex'));\n  });\n  var macs = [];\n  _.each(this.macs, function(mac) {\n    macs.push(BufferUtil.reverse(mac).toString('hex'));\n  });\n  var obj = {\n    vpub_old: this.vpub_old,\n    vpub_new: this.vpub_new,\n    anchor: BufferUtil.reverse(this.anchor).toString('hex'),\n    nullifiers: nullifiers,\n    commitments: commitments,\n    ephemeralKey: BufferUtil.reverse(this.ephemeralKey).toString('hex'),\n    ciphertexts: ciphertexts,\n    randomSeed: BufferUtil.reverse(this.randomSeed).toString('hex'),\n    macs: macs,\n    proof: this.proof.toObject(),\n  };\n  return obj;\n};\n\nJSDescription.fromBufferReader = function(br) {\n  var i;\n  var jsdesc = new JSDescription();\n  jsdesc.vpub_old = br.readUInt64LEBN();\n  jsdesc.vpub_new = br.readUInt64LEBN();\n  jsdesc.anchor = br.read(32);\n  for (i = 0; i < ZC_NUM_JS_INPUTS; i++) {\n    jsdesc.nullifiers.push(br.read(32));\n  }\n  for (i = 0; i < ZC_NUM_JS_OUTPUTS; i++) {\n    jsdesc.commitments.push(br.read(32));\n  }\n  jsdesc.ephemeralKey = br.read(32);\n  jsdesc.randomSeed = br.read(32);\n  for (i = 0; i < ZC_NUM_JS_INPUTS; i++) {\n    jsdesc.macs.push(br.read(32));\n  }\n  jsdesc.proof = ZCProof.fromBufferReader(br);\n  for (i = 0; i < ZC_NUM_JS_OUTPUTS; i++) {\n    jsdesc.ciphertexts.push(br.read(ZC_NOTECIPHERTEXT_SIZE));\n  }\n  return jsdesc;\n};\n\nJSDescription.prototype.toBufferWriter = function(writer) {\n  var i;\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  writer.writeUInt64LEBN(this._vpub_oldBN);\n  writer.writeUInt64LEBN(this._vpub_newBN);\n  writer.write(this.anchor);\n  for (i = 0; i < ZC_NUM_JS_INPUTS; i++) {\n    writer.write(this.nullifiers[i]);\n  }\n  for (i = 0; i < ZC_NUM_JS_OUTPUTS; i++) {\n    writer.write(this.commitments[i]);\n  }\n  writer.write(this.ephemeralKey);\n  writer.write(this.randomSeed);\n  for (i = 0; i < ZC_NUM_JS_INPUTS; i++) {\n    writer.write(this.macs[i]);\n  }\n  this.proof.toBufferWriter(writer);\n  for (i = 0; i < ZC_NUM_JS_OUTPUTS; i++) {\n    writer.write(this.ciphertexts[i]);\n  }\n  return writer;\n};\n\nmodule.exports = JSDescription;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/transaction/jsdescription.js\n// module id = 1325\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/transaction/jsdescription.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar _ = __webpack_require__(10);\nvar URL = __webpack_require__(157);\n\nvar Address = __webpack_require__(108);\nvar Unit = __webpack_require__(320);\n\n/**\n * Bitcore URI\n *\n * Instantiate an URI from a bitcoin URI String or an Object. An URI instance\n * can be created with a bitcoin uri string or an object. All instances of\n * URI are valid, the static method isValid allows checking before instantiation.\n *\n * All standard parameters can be found as members of the class, the address\n * is represented using an {Address} instance and the amount is represented in\n * satoshis. Any other non-standard parameters can be found under the extra member.\n *\n * @example\n * ```javascript\n *\n * var uri = new URI('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu?amount=1.2');\n * console.log(uri.address, uri.amount);\n * ```\n *\n * @param {string|Object} data - A bitcoin URI string or an Object\n * @param {Array.<string>=} knownParams - Required non-standard params\n * @throws {TypeError} Invalid bitcoin address\n * @throws {TypeError} Invalid amount\n * @throws {Error} Unknown required argument\n * @returns {URI} A new valid and frozen instance of URI\n * @constructor\n */\nvar URI = function(data, knownParams) {\n  if (!(this instanceof URI)) {\n    return new URI(data, knownParams);\n  }\n\n  this.extras = {};\n  this.knownParams = knownParams || [];\n  this.address = this.network = this.amount = this.message = null;\n\n  if (typeof(data) === 'string') {\n    var params = URI.parse(data);\n    if (params.amount) {\n      params.amount = this._parseAmount(params.amount);\n    }\n    this._fromObject(params);\n  } else if (typeof(data) === 'object') {\n    this._fromObject(data);\n  } else {\n    throw new TypeError('Unrecognized data format.');\n  }\n};\n\n/**\n * Instantiate a URI from a String\n *\n * @param {string} str - JSON string or object of the URI\n * @returns {URI} A new instance of a URI\n */\nURI.fromString = function fromString(str) {\n  if (typeof(str) !== 'string') {\n    throw new TypeError('Expected a string');\n  }\n  return new URI(str);\n};\n\n/**\n * Instantiate a URI from an Object\n *\n * @param {Object} data - object of the URI\n * @returns {URI} A new instance of a URI\n */\nURI.fromObject = function fromObject(json) {\n  return new URI(json);\n};\n\n/**\n * Check if an bitcoin URI string is valid\n *\n * @example\n * ```javascript\n *\n * var valid = URI.isValid('bitcoin:12A1MyfXbW6RhdRAZEqofac5jCQQjwEPBu');\n * // true\n * ```\n *\n * @param {string|Object} data - A bitcoin URI string or an Object\n * @param {Array.<string>=} knownParams - Required non-standard params\n * @returns {boolean} Result of uri validation\n */\nURI.isValid = function(arg, knownParams) {\n  try {\n    new URI(arg, knownParams);\n  } catch (err) {\n    return false;\n  }\n  return true;\n};\n\n/**\n * Convert a bitcoin URI string into a simple object.\n *\n * @param {string} uri - A bitcoin URI string\n * @throws {TypeError} Invalid bitcoin URI\n * @returns {Object} An object with the parsed params\n */\nURI.parse = function(uri) {\n  var info = URL.parse(uri, true);\n\n  if (info.protocol !== 'zcash:') {\n    throw new TypeError('Invalid zcash URI');\n  }\n\n  // workaround to host insensitiveness\n  var group = /[^:]*:\\/?\\/?([^?]*)/.exec(uri);\n  info.query.address = group && group[1] || undefined;\n\n  return info.query;\n};\n\nURI.Members = ['address', 'amount', 'message', 'label', 'r'];\n\n/**\n * Internal function to load the URI instance with an object.\n *\n * @param {Object} obj - Object with the information\n * @throws {TypeError} Invalid bitcoin address\n * @throws {TypeError} Invalid amount\n * @throws {Error} Unknown required argument\n */\nURI.prototype._fromObject = function(obj) {\n  /* jshint maxcomplexity: 10 */\n\n  if (!Address.isValid(obj.address)) {\n    throw new TypeError('Invalid zcash address');\n  }\n\n  this.address = new Address(obj.address);\n  this.network = this.address.network;\n  this.amount = obj.amount;\n\n  for (var key in obj) {\n    if (key === 'address' || key === 'amount') {\n      continue;\n    }\n\n    if (/^req-/.exec(key) && this.knownParams.indexOf(key) === -1) {\n      throw Error('Unknown required argument ' + key);\n    }\n\n    var destination = URI.Members.indexOf(key) > -1 ? this : this.extras;\n    destination[key] = obj[key];\n  }\n};\n\n/**\n * Internal function to transform a BTC string amount into satoshis\n *\n * @param {string} amount - Amount BTC string\n * @throws {TypeError} Invalid amount\n * @returns {Object} Amount represented in satoshis\n */\nURI.prototype._parseAmount = function(amount) {\n  amount = Number(amount);\n  if (isNaN(amount)) {\n    throw new TypeError('Invalid amount');\n  }\n  return Unit.fromBTC(amount).toSatoshis();\n};\n\nURI.prototype.toObject = URI.prototype.toJSON = function toObject() {\n  var json = {};\n  for (var i = 0; i < URI.Members.length; i++) {\n    var m = URI.Members[i];\n    if (this.hasOwnProperty(m) && typeof(this[m]) !== 'undefined') {\n      json[m] = this[m].toString();\n    }\n  }\n  _.extend(json, this.extras);\n  return json;\n};\n\n/**\n * Will return a the string representation of the URI\n *\n * @returns {string} Bitcoin URI string\n */\nURI.prototype.toString = function() {\n  var query = {};\n  if (this.amount) {\n    query.amount = Unit.fromSatoshis(this.amount).toBTC();\n  }\n  if (this.message) {\n    query.message = this.message;\n  }\n  if (this.label) {\n    query.label = this.label;\n  }\n  if (this.r) {\n    query.r = this.r;\n  }\n  _.extend(query, this.extras);\n\n  return URL.format({\n    protocol: 'zcash:',\n    host: this.address,\n    query: query\n  });\n};\n\n/**\n * Will return a string formatted for the console\n *\n * @returns {string} Bitcoin URI\n */\nURI.prototype.inspect = function() {\n  return '<URI: ' + this.toString() + '>';\n};\n\nmodule.exports = URI;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/uri.js\n// module id = 1326\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/uri.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar $ = __webpack_require__(13);\nvar buffer = __webpack_require__(0);\nvar BufferWriter = __webpack_require__(50);\n\nvar G1_PREFIX_MASK = 0x02;\nvar G2_PREFIX_MASK = 0x0a;\n\nfunction CompressedG1(params) {\n  if (!(this instanceof CompressedG1)) {\n    return new CompressedG1(params);\n  }\n  if (params) {\n    return this._fromObject(params);\n  }\n}\n\nCompressedG1.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj));\n  var pt = new CompressedG1();\n  return pt._fromObject(obj);\n};\n\nCompressedG1.prototype._fromObject = function(params) {\n  this.y_lsb = params.y_lsb;\n  this.x = new buffer.Buffer(params.x, 'hex');\n  return this;\n};\n\nCompressedG1.prototype.toObject = CompressedG1.prototype.toJSON = function toObject() {\n  var obj = {\n    y_lsb: this.y_lsb,\n    x: this.x.toString('hex'),\n  };\n  return obj;\n};\n\nCompressedG1.fromBufferReader = function(br) {\n  var pt = new CompressedG1();\n  var y_lsb = br.readUInt8();\n  pt.y_lsb = y_lsb & 1;\n  pt.x = br.read(32);\n  return pt;\n};\n\nCompressedG1.prototype.toBufferWriter = function(writer) {\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  writer.writeUInt8(G1_PREFIX_MASK | this.y_lsb);\n  writer.write(this.x);\n  return writer;\n};\n\nfunction CompressedG2(params) {\n  if (!(this instanceof CompressedG2)) {\n    return new CompressedG2(params);\n  }\n  if (params) {\n    return this._fromObject(params);\n  }\n}\n\nCompressedG2.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj));\n  var pt = new CompressedG2();\n  return pt._fromObject(obj);\n};\n\nCompressedG2.prototype._fromObject = function(params) {\n  this.y_gt = params.y_gt;\n  this.x = new buffer.Buffer(params.x, 'hex');\n  return this;\n};\n\nCompressedG2.prototype.toObject = CompressedG2.prototype.toJSON = function toObject() {\n  var obj = {\n    y_gt: this.y_gt,\n    x: this.x.toString('hex'),\n  };\n  return obj;\n};\n\nCompressedG2.fromBufferReader = function(br) {\n  var pt = new CompressedG2();\n  var y_gt = br.readUInt8();\n  pt.y_gt = y_gt & 1;\n  pt.x = br.read(64);\n  return pt;\n};\n\nCompressedG2.prototype.toBufferWriter = function(writer) {\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  writer.writeUInt8(G2_PREFIX_MASK | this.y_gt);\n  writer.write(this.x);\n  return writer;\n};\n\nfunction ZCProof(params) {\n  if (!(this instanceof ZCProof)) {\n    return new ZCProof(params);\n  }\n  if (params) {\n    return this._fromObject(params);\n  }\n}\n\nZCProof.fromObject = function(obj) {\n  $.checkArgument(_.isObject(obj));\n  var proof = new ZCProof();\n  return proof._fromObject(obj);\n};\n\nZCProof.prototype._fromObject = function(params) {\n  this.g_A       = CompressedG1.fromObject(params.g_A);\n  this.g_A_prime = CompressedG1.fromObject(params.g_A_prime);\n  this.g_B       = CompressedG2.fromObject(params.g_B);\n  this.g_B_prime = CompressedG1.fromObject(params.g_B_prime);\n  this.g_C       = CompressedG1.fromObject(params.g_C);\n  this.g_C_prime = CompressedG1.fromObject(params.g_C_prime);\n  this.g_K       = CompressedG1.fromObject(params.g_K);\n  this.g_H       = CompressedG1.fromObject(params.g_H);\n  return this;\n};\n\nZCProof.prototype.toObject = ZCProof.prototype.toJSON = function toObject() {\n  var obj = {\n    g_A:       this.g_A.toObject(),\n    g_A_prime: this.g_A_prime.toObject(),\n    g_B:       this.g_B.toObject(),\n    g_B_prime: this.g_B_prime.toObject(),\n    g_C:       this.g_C.toObject(),\n    g_C_prime: this.g_C_prime.toObject(),\n    g_K:       this.g_K.toObject(),\n    g_H:       this.g_H.toObject(),\n  };\n  return obj;\n};\n\nZCProof.fromBufferReader = function(br) {\n  var proof = new ZCProof();\n  proof.g_A       = CompressedG1.fromBufferReader(br);\n  proof.g_A_prime = CompressedG1.fromBufferReader(br);\n  proof.g_B       = CompressedG2.fromBufferReader(br);\n  proof.g_B_prime = CompressedG1.fromBufferReader(br);\n  proof.g_C       = CompressedG1.fromBufferReader(br);\n  proof.g_C_prime = CompressedG1.fromBufferReader(br);\n  proof.g_K       = CompressedG1.fromBufferReader(br);\n  proof.g_H       = CompressedG1.fromBufferReader(br);\n  return proof;\n};\n\nZCProof.prototype.toBufferWriter = function(writer) {\n  if (!writer) {\n    writer = new BufferWriter();\n  }\n  this.g_A.toBufferWriter(writer);\n  this.g_A_prime.toBufferWriter(writer);\n  this.g_B.toBufferWriter(writer);\n  this.g_B_prime.toBufferWriter(writer);\n  this.g_C.toBufferWriter(writer);\n  this.g_C_prime.toBufferWriter(writer);\n  this.g_K.toBufferWriter(writer);\n  this.g_H.toBufferWriter(writer);\n  return writer;\n};\n\nmodule.exports = ZCProof;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/lib/zcash/proof.js\n// module id = 1327\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/lib/zcash/proof.js")},function(module,exports){eval("\n\nmodule.exports = function(cmp,to){\n  var c = 0;\n  for(var i=0;i<cmp.length;++i){\n    if(i == to.length) break;\n    c = cmp[i] < to[i]?-1:cmp[i] > to[i]?1:0;    \n    if(c != 0) break;\n  }\n  if(c == 0){\n    if(to.length > cmp.length) c = -1;\n    else if(cmp.length > to.length) c = 1;\n  }\n  return c;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/buffer-compare/index.js\n// module id = 1328\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/buffer-compare/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar bn = __webpack_require__(74);\nvar elliptic = __webpack_require__(67);\n\nvar getNAF = elliptic.utils.getNAF;\nvar getJSF = elliptic.utils.getJSF;\nvar assert = elliptic.utils.assert;\n\nfunction BaseCurve(type, conf) {\n  this.type = type;\n  this.p = new bn(conf.p, 16);\n\n  // Use Montgomery, when there is no fast reduction for the prime\n  this.red = conf.prime ? bn.red(conf.prime) : bn.mont(this.p);\n\n  // Useful for many curves\n  this.zero = new bn(0).toRed(this.red);\n  this.one = new bn(1).toRed(this.red);\n  this.two = new bn(2).toRed(this.red);\n\n  // Curve configuration, optional\n  this.n = conf.n && new bn(conf.n, 16);\n  this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);\n\n  // Temporary arrays\n  this._wnafT1 = new Array(4);\n  this._wnafT2 = new Array(4);\n  this._wnafT3 = new Array(4);\n  this._wnafT4 = new Array(4);\n}\nmodule.exports = BaseCurve;\n\nBaseCurve.prototype.point = function point() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype.validate = function validate() {\n  throw new Error('Not implemented');\n};\n\nBaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {\n  var doubles = p._getDoubles();\n\n  var naf = getNAF(k, 1);\n  var I = (1 << (doubles.step + 1)) - (doubles.step % 2 === 0 ? 2 : 1);\n  I /= 3;\n\n  // Translate into more windowed form\n  var repr = [];\n  for (var j = 0; j < naf.length; j += doubles.step) {\n    var nafW = 0;\n    for (var k = j + doubles.step - 1; k >= j; k--)\n      nafW = (nafW << 1) + naf[k];\n    repr.push(nafW);\n  }\n\n  var a = this.jpoint(null, null, null);\n  var b = this.jpoint(null, null, null);\n  for (var i = I; i > 0; i--) {\n    for (var j = 0; j < repr.length; j++) {\n      var nafW = repr[j];\n      if (nafW === i)\n        b = b.mixedAdd(doubles.points[j]);\n      else if (nafW === -i)\n        b = b.mixedAdd(doubles.points[j].neg());\n    }\n    a = a.add(b);\n  }\n  return a.toP();\n};\n\nBaseCurve.prototype._wnafMul = function _wnafMul(p, k) {\n  var w = 4;\n\n  // Precompute window\n  var nafPoints = p._getNAFPoints(w);\n  w = nafPoints.wnd;\n  var wnd = nafPoints.points;\n\n  // Get NAF form\n  var naf = getNAF(k, w);\n\n  // Add `this`*(N+1) for every w-NAF index\n  var acc = this.jpoint(null, null, null);\n  for (var i = naf.length - 1; i >= 0; i--) {\n    // Count zeroes\n    for (var k = 0; i >= 0 && naf[i] === 0; i--)\n      k++;\n    if (i >= 0)\n      k++;\n    acc = acc.dblp(k);\n\n    if (i < 0)\n      break;\n    var z = naf[i];\n    assert(z !== 0);\n    if (p.type === 'affine') {\n      // J +- P\n      if (z > 0)\n        acc = acc.mixedAdd(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.mixedAdd(wnd[(-z - 1) >> 1].neg());\n    } else {\n      // J +- J\n      if (z > 0)\n        acc = acc.add(wnd[(z - 1) >> 1]);\n      else\n        acc = acc.add(wnd[(-z - 1) >> 1].neg());\n    }\n  }\n  return p.type === 'affine' ? acc.toP() : acc;\n};\n\nBaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW,\n                                                       points,\n                                                       coeffs,\n                                                       len) {\n  var wndWidth = this._wnafT1;\n  var wnd = this._wnafT2;\n  var naf = this._wnafT3;\n\n  // Fill all arrays\n  var max = 0;\n  for (var i = 0; i < len; i++) {\n    var p = points[i];\n    var nafPoints = p._getNAFPoints(defW);\n    wndWidth[i] = nafPoints.wnd;\n    wnd[i] = nafPoints.points;\n  }\n\n  // Comb small window NAFs\n  for (var i = len - 1; i >= 1; i -= 2) {\n    var a = i - 1;\n    var b = i;\n    if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {\n      naf[a] = getNAF(coeffs[a], wndWidth[a]);\n      naf[b] = getNAF(coeffs[b], wndWidth[b]);\n      max = Math.max(naf[a].length, max);\n      max = Math.max(naf[b].length, max);\n      continue;\n    }\n\n    var comb = [\n      points[a], /* 1 */\n      null, /* 3 */\n      null, /* 5 */\n      points[b] /* 7 */\n    ];\n\n    // Try to avoid Projective points, if possible\n    if (points[a].y.cmp(points[b].y) === 0) {\n      comb[1] = points[a].add(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].add(points[b].neg());\n    } else {\n      comb[1] = points[a].toJ().mixedAdd(points[b]);\n      comb[2] = points[a].toJ().mixedAdd(points[b].neg());\n    }\n\n    var index = [\n      -3, /* -1 -1 */\n      -1, /* -1 0 */\n      -5, /* -1 1 */\n      -7, /* 0 -1 */\n      0, /* 0 0 */\n      7, /* 0 1 */\n      5, /* 1 -1 */\n      1, /* 1 0 */\n      3  /* 1 1 */\n    ];\n\n    var jsf = getJSF(coeffs[a], coeffs[b]);\n    max = Math.max(jsf[0].length, max);\n    naf[a] = new Array(max);\n    naf[b] = new Array(max);\n    for (var j = 0; j < max; j++) {\n      var ja = jsf[0][j] | 0;\n      var jb = jsf[1][j] | 0;\n\n      naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];\n      naf[b][j] = 0;\n      wnd[a] = comb;\n    }\n  }\n\n  var acc = this.jpoint(null, null, null);\n  var tmp = this._wnafT4;\n  for (var i = max; i >= 0; i--) {\n    var k = 0;\n\n    while (i >= 0) {\n      var zero = true;\n      for (var j = 0; j < len; j++) {\n        tmp[j] = naf[j][i] | 0;\n        if (tmp[j] !== 0)\n          zero = false;\n      }\n      if (!zero)\n        break;\n      k++;\n      i--;\n    }\n    if (i >= 0)\n      k++;\n    acc = acc.dblp(k);\n    if (i < 0)\n      break;\n\n    for (var j = 0; j < len; j++) {\n      var z = tmp[j];\n      var p;\n      if (z === 0)\n        continue;\n      else if (z > 0)\n        p = wnd[j][(z - 1) >> 1];\n      else if (z < 0)\n        p = wnd[j][(-z - 1) >> 1].neg();\n\n      if (p.type === 'affine')\n        acc = acc.mixedAdd(p);\n      else\n        acc = acc.add(p);\n    }\n  }\n  // Zeroify references\n  for (var i = 0; i < len; i++)\n    wnd[i] = null;\n  return acc.toP();\n};\n\nfunction BasePoint(curve, type) {\n  this.curve = curve;\n  this.type = type;\n  this.precomputed = null;\n}\nBaseCurve.BasePoint = BasePoint;\n\nBasePoint.prototype.validate = function validate() {\n  return this.curve.validate(this);\n};\n\nBasePoint.prototype.precompute = function precompute(power) {\n  if (this.precomputed)\n    return this;\n\n  var precomputed = {\n    doubles: null,\n    naf: null,\n    beta: null\n  };\n  precomputed.naf = this._getNAFPoints(8);\n  precomputed.doubles = this._getDoubles(4, power);\n  precomputed.beta = this._getBeta();\n  this.precomputed = precomputed;\n\n  return this;\n};\n\nBasePoint.prototype._getDoubles = function _getDoubles(step, power) {\n  if (this.precomputed && this.precomputed.doubles)\n    return this.precomputed.doubles;\n\n  var doubles = [ this ];\n  var acc = this;\n  for (var i = 0; i < power; i += step) {\n    for (var j = 0; j < step; j++)\n      acc = acc.dbl();\n    doubles.push(acc);\n  }\n  return {\n    step: step,\n    points: doubles\n  };\n};\n\nBasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {\n  if (this.precomputed && this.precomputed.naf)\n    return this.precomputed.naf;\n\n  var res = [ this ];\n  var max = (1 << wnd) - 1;\n  var dbl = max === 1 ? null : this.dbl();\n  for (var i = 1; i < max; i++)\n    res[i] = res[i - 1].add(dbl);\n  return {\n    wnd: wnd,\n    points: res\n  };\n};\n\nBasePoint.prototype._getBeta = function _getBeta() {\n  return null;\n};\n\nBasePoint.prototype.dblp = function dblp(k) {\n  var r = this;\n  for (var i = 0; i < k; i++)\n    r = r.dbl();\n  return r;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curve/base.js\n// module id = 1329\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curve/base.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(217);\nvar elliptic = __webpack_require__(67);\nvar bn = __webpack_require__(74);\nvar inherits = __webpack_require__(75);\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction EdwardsCurve(conf) {\n  // NOTE: Important as we are creating point in Base.call()\n  this.twisted = (conf.a | 0) !== 1;\n  this.mOneA = this.twisted && (conf.a | 0) === -1;\n  this.extended = this.mOneA;\n\n  Base.call(this, 'edwards', conf);\n\n  this.a = new bn(conf.a, 16).mod(this.red.m).toRed(this.red);\n  this.c = new bn(conf.c, 16).toRed(this.red);\n  this.c2 = this.c.redSqr();\n  this.d = new bn(conf.d, 16).toRed(this.red);\n  this.dd = this.d.redAdd(this.d);\n\n  assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);\n  this.oneC = (conf.c | 0) === 1;\n}\ninherits(EdwardsCurve, Base);\nmodule.exports = EdwardsCurve;\n\nEdwardsCurve.prototype._mulA = function _mulA(num) {\n  if (this.mOneA)\n    return num.redNeg();\n  else\n    return this.a.redMul(num);\n};\n\nEdwardsCurve.prototype._mulC = function _mulC(num) {\n  if (this.oneC)\n    return num;\n  else\n    return this.c.redMul(num);\n};\n\n// Just for compatibility with Short curve\nEdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {\n  return this.point(x, y, z, t);\n};\n\nEdwardsCurve.prototype.pointFromX = function pointFromX(odd, x) {\n  x = new bn(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var x2 = x.redSqr();\n  var rhs = this.c2.redSub(this.a.redMul(x2));\n  var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));\n\n  var y = rhs.redMul(lhs.redInvm()).redSqrt();\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y, curve.one);\n};\n\nEdwardsCurve.prototype.validate = function validate(point) {\n  if (point.isInfinity())\n    return true;\n\n  // Curve: A * X^2 + Y^2 = C^2 * (1 + D * X^2 * Y^2)\n  point.normalize();\n\n  var x2 = point.x.redSqr();\n  var y2 = point.y.redSqr();\n  var lhs = x2.redMul(this.a).redAdd(y2);\n  var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));\n\n  return lhs.cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, y, z, t) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.zero;\n    this.y = this.curve.one;\n    this.z = this.curve.one;\n    this.t = this.curve.zero;\n    this.zOne = true;\n  } else {\n    this.x = new bn(x, 16);\n    this.y = new bn(y, 16);\n    this.z = z ? new bn(z, 16) : this.curve.one;\n    this.t = t && new bn(t, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n    if (this.t && !this.t.red)\n      this.t = this.t.toRed(this.curve.red);\n    this.zOne = this.z === this.curve.one;\n\n    // Use extended coordinates\n    if (this.curve.extended && !this.t) {\n      this.t = this.x.redMul(this.y);\n      if (!this.zOne)\n        this.t = this.t.redMul(this.z.redInvm());\n    }\n  }\n}\ninherits(Point, Base.BasePoint);\n\nEdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nEdwardsCurve.prototype.point = function point(x, y, z, t) {\n  return new Point(this, x, y, z, t);\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1], obj[2]);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.x.cmpn(0) === 0 &&\n         this.y.cmp(this.z) === 0;\n};\n\nPoint.prototype._extDbl = function _extDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #doubling-dbl-2008-hwcd\n  // 4M + 4S\n\n  // A = X1^2\n  var a = this.x.redSqr();\n  // B = Y1^2\n  var b = this.y.redSqr();\n  // C = 2 * Z1^2\n  var c = this.z.redSqr();\n  c = c.redIAdd(c);\n  // D = a * A\n  var d = this.curve._mulA(a);\n  // E = (X1 + Y1)^2 - A - B\n  var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);\n  // G = D + B\n  var g = d.redAdd(b);\n  // F = G - C\n  var f = g.redSub(c);\n  // H = D - B\n  var h = d.redSub(b);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projDbl = function _projDbl() {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #doubling-dbl-2008-bbjlp\n  //     #doubling-dbl-2007-bl\n  // and others\n  // Generally 3M + 4S or 2M + 4S\n\n  // B = (X1 + Y1)^2\n  var b = this.x.redAdd(this.y).redSqr();\n  // C = X1^2\n  var c = this.x.redSqr();\n  // D = Y1^2\n  var d = this.y.redSqr();\n\n  var nx;\n  var ny;\n  var nz;\n  if (this.curve.twisted) {\n    // E = a * C\n    var e = this.curve._mulA(c);\n    // F = E + D\n    var f = e.redAdd(d);\n    if (this.zOne) {\n      // X3 = (B - C - D) * (F - 2)\n      nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F^2 - 2 * F\n      nz = f.redSqr().redSub(f).redSub(f);\n    } else {\n      // H = Z1^2\n      var h = this.z.redSqr();\n      // J = F - 2 * H\n      var j = f.redSub(h).redISub(h);\n      // X3 = (B-C-D)*J\n      nx = b.redSub(c).redISub(d).redMul(j);\n      // Y3 = F * (E - D)\n      ny = f.redMul(e.redSub(d));\n      // Z3 = F * J\n      nz = f.redMul(j);\n    }\n  } else {\n    // E = C + D\n    var e = c.redAdd(d);\n    // H = (c * Z1)^2\n    var h = this.curve._mulC(this.c.redMul(this.z)).redSqr();\n    // J = E - 2 * H\n    var j = e.redSub(h).redSub(h);\n    // X3 = c * (B - E) * J\n    nx = this.curve._mulC(b.redISub(e)).redMul(j);\n    // Y3 = c * E * (C - D)\n    ny = this.curve._mulC(e).redMul(c.redISub(d));\n    // Z3 = E * J\n    nz = e.redMul(j);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  // Double in extended coordinates\n  if (this.curve.extended)\n    return this._extDbl();\n  else\n    return this._projDbl();\n};\n\nPoint.prototype._extAdd = function _extAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html\n  //     #addition-add-2008-hwcd-3\n  // 8M\n\n  // A = (Y1 - X1) * (Y2 - X2)\n  var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));\n  // B = (Y1 + X1) * (Y2 + X2)\n  var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));\n  // C = T1 * k * T2\n  var c = this.t.redMul(this.curve.dd).redMul(p.t);\n  // D = Z1 * 2 * Z2\n  var d = this.z.redMul(p.z.redAdd(p.z));\n  // E = B - A\n  var e = b.redSub(a);\n  // F = D - C\n  var f = d.redSub(c);\n  // G = D + C\n  var g = d.redAdd(c);\n  // H = B + A\n  var h = b.redAdd(a);\n  // X3 = E * F\n  var nx = e.redMul(f);\n  // Y3 = G * H\n  var ny = g.redMul(h);\n  // T3 = E * H\n  var nt = e.redMul(h);\n  // Z3 = F * G\n  var nz = f.redMul(g);\n  return this.curve.point(nx, ny, nz, nt);\n};\n\nPoint.prototype._projAdd = function _projAdd(p) {\n  // hyperelliptic.org/EFD/g1p/auto-twisted-projective.html\n  //     #addition-add-2008-bbjlp\n  //     #addition-add-2007-bl\n  // 10M + 1S\n\n  // A = Z1 * Z2\n  var a = this.z.redMul(p.z);\n  // B = A^2\n  var b = a.redSqr();\n  // C = X1 * X2\n  var c = this.x.redMul(p.x);\n  // D = Y1 * Y2\n  var d = this.y.redMul(p.y);\n  // E = d * C * D\n  var e = this.curve.d.redMul(c).redMul(d);\n  // F = B - E\n  var f = b.redSub(e);\n  // G = B + E\n  var g = b.redAdd(e);\n  // X3 = A * F * ((X1 + Y1) * (X2 + Y2) - C - D)\n  var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);\n  var nx = a.redMul(f).redMul(tmp);\n  var ny;\n  var nz;\n  if (this.curve.twisted) {\n    // Y3 = A * G * (D - a * C)\n    ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));\n    // Z3 = F * G\n    nz = f.redMul(g);\n  } else {\n    // Y3 = A * G * (D - C)\n    ny = a.redMul(g).redMul(d.redSub(c));\n    // Z3 = c * F * G\n    nz = this.curve._mulC(f).redMul(g);\n  }\n  return this.curve.point(nx, ny, nz);\n};\n\nPoint.prototype.add = function add(p) {\n  if (this.isInfinity())\n    return p;\n  if (p.isInfinity())\n    return this;\n\n  if (this.curve.extended)\n    return this._extAdd(p);\n  else\n    return this._projAdd(p);\n};\n\nPoint.prototype.mul = function mul(k) {\n  if (this.precomputed && this.precomputed.doubles)\n    return this.curve._fixedNafMul(this, k);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p, k2) {\n  return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2);\n};\n\nPoint.prototype.normalize = function normalize() {\n  if (this.zOne)\n    return this;\n\n  // Normalize coordinates\n  var zi = this.z.redInvm();\n  this.x = this.x.redMul(zi);\n  this.y = this.y.redMul(zi);\n  if (this.t)\n    this.t = this.t.redMul(zi);\n  this.z = this.curve.one;\n  this.zOne = true;\n  return this;\n};\n\nPoint.prototype.neg = function neg() {\n  return this.curve.point(this.x.redNeg(),\n                          this.y,\n                          this.z,\n                          this.t && this.t.redNeg());\n};\n\nPoint.prototype.getX = function getX() {\n  this.normalize();\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  this.normalize();\n  return this.y.fromRed();\n};\n\n// Compatibility with BaseCurve\nPoint.prototype.toP = Point.prototype.normalize;\nPoint.prototype.mixedAdd = Point.prototype.add;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curve/edwards.js\n// module id = 1330\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curve/edwards.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(217);\nvar bn = __webpack_require__(74);\nvar inherits = __webpack_require__(75);\nvar Base = curve.base;\n\nfunction MontCurve(conf) {\n  Base.call(this, 'mont', conf);\n\n  this.a = new bn(conf.a, 16).toRed(this.red);\n  this.b = new bn(conf.b, 16).toRed(this.red);\n  this.i4 = new bn(4).toRed(this.red).redInvm();\n  this.two = new bn(2).toRed(this.red);\n  this.a24 = this.i4.redMul(this.a.redAdd(this.two));\n}\ninherits(MontCurve, Base);\nmodule.exports = MontCurve;\n\nMontCurve.prototype.validate = function validate(point) {\n  var x = point.normalize().x;\n  var x2 = x.redSqr();\n  var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);\n  var y = rhs.redSqrt();\n\n  return y.redSqr().cmp(rhs) === 0;\n};\n\nfunction Point(curve, x, z) {\n  Base.BasePoint.call(this, curve, 'projective');\n  if (x === null && z === null) {\n    this.x = this.curve.one;\n    this.z = this.curve.zero;\n  } else {\n    this.x = new bn(x, 16);\n    this.z = new bn(z, 16);\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.z.red)\n      this.z = this.z.toRed(this.curve.red);\n  }\n}\ninherits(Point, Base.BasePoint);\n\nMontCurve.prototype.point = function point(x, z) {\n  return new Point(this, x, z);\n};\n\nMontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {\n  return Point.fromJSON(this, obj);\n};\n\nPoint.prototype.precompute = function precompute() {\n  // No-op\n};\n\nPoint.fromJSON = function fromJSON(curve, obj) {\n  return new Point(curve, obj[0], obj[1] || curve.one);\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' z: ' + this.z.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n\nPoint.prototype.dbl = function dbl() {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#doubling-dbl-1987-m-3\n  // 2M + 2S + 4A\n\n  // A = X1 + Z1\n  var a = this.x.redAdd(this.z);\n  // AA = A^2\n  var aa = a.redSqr();\n  // B = X1 - Z1\n  var b = this.x.redSub(this.z);\n  // BB = B^2\n  var bb = b.redSqr();\n  // C = AA - BB\n  var c = aa.redSub(bb);\n  // X3 = AA * BB\n  var nx = aa.redMul(bb);\n  // Z3 = C * (BB + A24 * C)\n  var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.add = function add() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.diffAdd = function diffAdd(p, diff) {\n  // http://hyperelliptic.org/EFD/g1p/auto-montgom-xz.html#diffadd-dadd-1987-m-3\n  // 4M + 2S + 6A\n\n  // A = X2 + Z2\n  var a = this.x.redAdd(this.z);\n  // B = X2 - Z2\n  var b = this.x.redSub(this.z);\n  // C = X3 + Z3\n  var c = p.x.redAdd(p.z);\n  // D = X3 - Z3\n  var d = p.x.redSub(p.z);\n  // DA = D * A\n  var da = d.redMul(a);\n  // CB = C * B\n  var cb = c.redMul(b);\n  // X5 = Z1 * (DA + CB)^2\n  var nx = diff.z.redMul(da.redAdd(cb).redSqr());\n  // Z5 = X1 * (DA - CB)^2\n  var nz = diff.x.redMul(da.redISub(cb).redSqr());\n  return this.curve.point(nx, nz);\n};\n\nPoint.prototype.mul = function mul(k) {\n  var t = k.clone();\n  var a = this; // (N / 2) * Q + Q\n  var b = this.curve.point(null, null); // (N / 2) * Q\n  var c = this; // Q\n\n  for (var bits = []; t.cmpn(0) !== 0; t.ishrn(1))\n    bits.push(t.andln(1));\n\n  for (var i = bits.length - 1; i >= 0; i--) {\n    if (bits[i] === 0) {\n      // N * Q + Q = ((N / 2) * Q + Q)) + (N / 2) * Q\n      a = a.diffAdd(b, c);\n      // N * Q = 2 * ((N / 2) * Q + Q))\n      b = b.dbl();\n    } else {\n      // N * Q = ((N / 2) * Q + Q) + ((N / 2) * Q)\n      b = a.diffAdd(b, c);\n      // N * Q + Q = 2 * ((N / 2) * Q + Q)\n      a = a.dbl();\n    }\n  }\n  return b;\n};\n\nPoint.prototype.mulAdd = function mulAdd() {\n  throw new Error('Not supported on Montgomery curve');\n};\n\nPoint.prototype.normalize = function normalize() {\n  this.x = this.x.redMul(this.z.redInvm());\n  this.z = this.curve.one;\n  return this;\n};\n\nPoint.prototype.getX = function getX() {\n  // Normalize coordinates\n  this.normalize();\n\n  return this.x.fromRed();\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curve/mont.js\n// module id = 1331\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curve/mont.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curve = __webpack_require__(217);\nvar elliptic = __webpack_require__(67);\nvar bn = __webpack_require__(74);\nvar inherits = __webpack_require__(75);\nvar Base = curve.base;\n\nvar assert = elliptic.utils.assert;\n\nfunction ShortCurve(conf) {\n  Base.call(this, 'short', conf);\n\n  this.a = new bn(conf.a, 16).toRed(this.red);\n  this.b = new bn(conf.b, 16).toRed(this.red);\n  this.tinv = this.two.redInvm();\n\n  this.zeroA = this.a.fromRed().cmpn(0) === 0;\n  this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;\n\n  // If the curve is endomorphic, precalculate beta and lambda\n  this.endo = this._getEndomorphism(conf);\n  this._endoWnafT1 = new Array(4);\n  this._endoWnafT2 = new Array(4);\n}\ninherits(ShortCurve, Base);\nmodule.exports = ShortCurve;\n\nShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {\n  // No efficient endomorphism\n  if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)\n    return;\n\n  // Compute beta and lambda, that lambda * P = (beta * Px; Py)\n  var beta;\n  var lambda;\n  if (conf.beta) {\n    beta = new bn(conf.beta, 16).toRed(this.red);\n  } else {\n    var betas = this._getEndoRoots(this.p);\n    // Choose the smallest beta\n    beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];\n    beta = beta.toRed(this.red);\n  }\n  if (conf.lambda) {\n    lambda = new bn(conf.lambda, 16);\n  } else {\n    // Choose the lambda that is matching selected beta\n    var lambdas = this._getEndoRoots(this.n);\n    if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {\n      lambda = lambdas[0];\n    } else {\n      lambda = lambdas[1];\n      assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);\n    }\n  }\n\n  // Get basis vectors, used for balanced length-two representation\n  var basis;\n  if (conf.basis) {\n    basis = conf.basis.map(function(vec) {\n      return {\n        a: new bn(vec.a, 16),\n        b: new bn(vec.b, 16)\n      };\n    });\n  } else {\n    basis = this._getEndoBasis(lambda);\n  }\n\n  return {\n    beta: beta,\n    lambda: lambda,\n    basis: basis\n  };\n};\n\nShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {\n  // Find roots of for x^2 + x + 1 in F\n  // Root = (-1 +- Sqrt(-3)) / 2\n  //\n  var red = num === this.p ? this.red : bn.mont(num);\n  var tinv = new bn(2).toRed(red).redInvm();\n  var ntinv = tinv.redNeg();\n\n  var s = new bn(3).toRed(red).redNeg().redSqrt().redMul(tinv);\n\n  var l1 = ntinv.redAdd(s).fromRed();\n  var l2 = ntinv.redSub(s).fromRed();\n  return [ l1, l2 ];\n};\n\nShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {\n  // aprxSqrt >= sqrt(this.n)\n  var aprxSqrt = this.n.shrn(Math.floor(this.n.bitLength() / 2));\n\n  // 3.74\n  // Run EGCD, until r(L + 1) < aprxSqrt\n  var u = lambda;\n  var v = this.n.clone();\n  var x1 = new bn(1);\n  var y1 = new bn(0);\n  var x2 = new bn(0);\n  var y2 = new bn(1);\n\n  // NOTE: all vectors are roots of: a + b * lambda = 0 (mod n)\n  var a0;\n  var b0;\n  // First vector\n  var a1;\n  var b1;\n  // Second vector\n  var a2;\n  var b2;\n\n  var prevR;\n  var i = 0;\n  var r;\n  var x;\n  while (u.cmpn(0) !== 0) {\n    var q = v.div(u);\n    r = v.sub(q.mul(u));\n    x = x2.sub(q.mul(x1));\n    var y = y2.sub(q.mul(y1));\n\n    if (!a1 && r.cmp(aprxSqrt) < 0) {\n      a0 = prevR.neg();\n      b0 = x1;\n      a1 = r.neg();\n      b1 = x;\n    } else if (a1 && ++i === 2) {\n      break;\n    }\n    prevR = r;\n\n    v = u;\n    u = r;\n    x2 = x1;\n    x1 = x;\n    y2 = y1;\n    y1 = y;\n  }\n  a2 = r.neg();\n  b2 = x;\n\n  var len1 = a1.sqr().add(b1.sqr());\n  var len2 = a2.sqr().add(b2.sqr());\n  if (len2.cmp(len1) >= 0) {\n    a2 = a0;\n    b2 = b0;\n  }\n\n  // Normalize signs\n  if (a1.sign) {\n    a1 = a1.neg();\n    b1 = b1.neg();\n  }\n  if (a2.sign) {\n    a2 = a2.neg();\n    b2 = b2.neg();\n  }\n\n  return [\n    { a: a1, b: b1 },\n    { a: a2, b: b2 }\n  ];\n};\n\nShortCurve.prototype._endoSplit = function _endoSplit(k) {\n  var basis = this.endo.basis;\n  var v1 = basis[0];\n  var v2 = basis[1];\n\n  var c1 = v2.b.mul(k).divRound(this.n);\n  var c2 = v1.b.neg().mul(k).divRound(this.n);\n\n  var p1 = c1.mul(v1.a);\n  var p2 = c2.mul(v2.a);\n  var q1 = c1.mul(v1.b);\n  var q2 = c2.mul(v2.b);\n\n  // Calculate answer\n  var k1 = k.sub(p1).sub(p2);\n  var k2 = q1.add(q2).neg();\n  return { k1: k1, k2: k2 };\n};\n\nShortCurve.prototype.pointFromX = function pointFromX(odd, x) {\n  x = new bn(x, 16);\n  if (!x.red)\n    x = x.toRed(this.red);\n\n  var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);\n  var y = y2.redSqrt();\n\n  // XXX Is there any way to tell if the number is odd without converting it\n  // to non-red form?\n  var isOdd = y.fromRed().isOdd();\n  if (odd && !isOdd || !odd && isOdd)\n    y = y.redNeg();\n\n  return this.point(x, y);\n};\n\nShortCurve.prototype.validate = function validate(point) {\n  if (point.inf)\n    return true;\n\n  var x = point.x;\n  var y = point.y;\n\n  var ax = this.a.redMul(x);\n  var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);\n  return y.redSqr().redISub(rhs).cmpn(0) === 0;\n};\n\nShortCurve.prototype._endoWnafMulAdd =\n    function _endoWnafMulAdd(points, coeffs) {\n  var npoints = this._endoWnafT1;\n  var ncoeffs = this._endoWnafT2;\n  for (var i = 0; i < points.length; i++) {\n    var split = this._endoSplit(coeffs[i]);\n    var p = points[i];\n    var beta = p._getBeta();\n\n    if (split.k1.sign) {\n      split.k1.sign = !split.k1.sign;\n      p = p.neg(true);\n    }\n    if (split.k2.sign) {\n      split.k2.sign = !split.k2.sign;\n      beta = beta.neg(true);\n    }\n\n    npoints[i * 2] = p;\n    npoints[i * 2 + 1] = beta;\n    ncoeffs[i * 2] = split.k1;\n    ncoeffs[i * 2 + 1] = split.k2;\n  }\n  var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2);\n\n  // Clean-up references to points and coefficients\n  for (var j = 0; j < i * 2; j++) {\n    npoints[j] = null;\n    ncoeffs[j] = null;\n  }\n  return res;\n};\n\nfunction Point(curve, x, y, isRed) {\n  Base.BasePoint.call(this, curve, 'affine');\n  if (x === null && y === null) {\n    this.x = null;\n    this.y = null;\n    this.inf = true;\n  } else {\n    this.x = new bn(x, 16);\n    this.y = new bn(y, 16);\n    // Force redgomery representation when loading from JSON\n    if (isRed) {\n      this.x.forceRed(this.curve.red);\n      this.y.forceRed(this.curve.red);\n    }\n    if (!this.x.red)\n      this.x = this.x.toRed(this.curve.red);\n    if (!this.y.red)\n      this.y = this.y.toRed(this.curve.red);\n    this.inf = false;\n  }\n}\ninherits(Point, Base.BasePoint);\n\nShortCurve.prototype.point = function point(x, y, isRed) {\n  return new Point(this, x, y, isRed);\n};\n\nShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {\n  return Point.fromJSON(this, obj, red);\n};\n\nPoint.prototype._getBeta = function _getBeta() {\n  if (!this.curve.endo)\n    return;\n\n  var pre = this.precomputed;\n  if (pre && pre.beta)\n    return pre.beta;\n\n  var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);\n  if (pre) {\n    var curve = this.curve;\n    var endoMul = function(p) {\n      return curve.point(p.x.redMul(curve.endo.beta), p.y);\n    };\n    pre.beta = beta;\n    beta.precomputed = {\n      beta: null,\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(endoMul)\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(endoMul)\n      }\n    };\n  }\n  return beta;\n};\n\nPoint.prototype.toJSON = function toJSON() {\n  if (!this.precomputed)\n    return [ this.x, this.y ];\n\n  return [ this.x, this.y, this.precomputed && {\n    doubles: this.precomputed.doubles && {\n      step: this.precomputed.doubles.step,\n      points: this.precomputed.doubles.points.slice(1)\n    },\n    naf: this.precomputed.naf && {\n      wnd: this.precomputed.naf.wnd,\n      points: this.precomputed.naf.points.slice(1)\n    }\n  } ];\n};\n\nPoint.fromJSON = function fromJSON(curve, obj, red) {\n  if (typeof obj === 'string')\n    obj = JSON.parse(obj);\n  var res = curve.point(obj[0], obj[1], red);\n  if (!obj[2])\n    return res;\n\n  function obj2point(obj) {\n    return curve.point(obj[0], obj[1], red);\n  }\n\n  var pre = obj[2];\n  res.precomputed = {\n    beta: null,\n    doubles: pre.doubles && {\n      step: pre.doubles.step,\n      points: [ res ].concat(pre.doubles.points.map(obj2point))\n    },\n    naf: pre.naf && {\n      wnd: pre.naf.wnd,\n      points: [ res ].concat(pre.naf.points.map(obj2point))\n    }\n  };\n  return res;\n};\n\nPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC Point Infinity>';\n  return '<EC Point x: ' + this.x.fromRed().toString(16, 2) +\n      ' y: ' + this.y.fromRed().toString(16, 2) + '>';\n};\n\nPoint.prototype.isInfinity = function isInfinity() {\n  return this.inf;\n};\n\nPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.inf)\n    return p;\n\n  // P + O = P\n  if (p.inf)\n    return this;\n\n  // P + P = 2P\n  if (this.eq(p))\n    return this.dbl();\n\n  // P + (-P) = O\n  if (this.neg().eq(p))\n    return this.curve.point(null, null);\n\n  // P + Q = O\n  if (this.x.cmp(p.x) === 0)\n    return this.curve.point(null, null);\n\n  var c = this.y.redSub(p.y);\n  if (c.cmpn(0) !== 0)\n    c = c.redMul(this.x.redSub(p.x).redInvm());\n  var nx = c.redSqr().redISub(this.x).redISub(p.x);\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.dbl = function dbl() {\n  if (this.inf)\n    return this;\n\n  // 2P = O\n  var ys1 = this.y.redAdd(this.y);\n  if (ys1.cmpn(0) === 0)\n    return this.curve.point(null, null);\n\n  var a = this.curve.a;\n\n  var x2 = this.x.redSqr();\n  var dyinv = ys1.redInvm();\n  var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);\n\n  var nx = c.redSqr().redISub(this.x.redAdd(this.x));\n  var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);\n  return this.curve.point(nx, ny);\n};\n\nPoint.prototype.getX = function getX() {\n  return this.x.fromRed();\n};\n\nPoint.prototype.getY = function getY() {\n  return this.y.fromRed();\n};\n\nPoint.prototype.mul = function mul(k) {\n  k = new bn(k, 16);\n\n  if (this.precomputed && this.precomputed.doubles)\n    return this.curve._fixedNafMul(this, k);\n  else if (this.curve.endo)\n    return this.curve._endoWnafMulAdd([ this ], [ k ]);\n  else\n    return this.curve._wnafMul(this, k);\n};\n\nPoint.prototype.mulAdd = function mulAdd(k1, p2, k2) {\n  var points = [ this, p2 ];\n  var coeffs = [ k1, k2 ];\n  if (this.curve.endo)\n    return this.curve._endoWnafMulAdd(points, coeffs);\n  else\n    return this.curve._wnafMulAdd(1, points, coeffs, 2);\n};\n\nPoint.prototype.eq = function eq(p) {\n  return this === p ||\n         this.inf === p.inf &&\n             (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);\n};\n\nPoint.prototype.neg = function neg(_precompute) {\n  if (this.inf)\n    return this;\n\n  var res = this.curve.point(this.x, this.y.redNeg());\n  if (_precompute && this.precomputed) {\n    var pre = this.precomputed;\n    var negate = function(p) {\n      return p.neg();\n    };\n    res.precomputed = {\n      naf: pre.naf && {\n        wnd: pre.naf.wnd,\n        points: pre.naf.points.map(negate)\n      },\n      doubles: pre.doubles && {\n        step: pre.doubles.step,\n        points: pre.doubles.points.map(negate)\n      }\n    };\n  }\n  return res;\n};\n\nPoint.prototype.toJ = function toJ() {\n  if (this.inf)\n    return this.curve.jpoint(null, null, null);\n\n  var res = this.curve.jpoint(this.x, this.y, this.curve.one);\n  return res;\n};\n\nfunction JPoint(curve, x, y, z) {\n  Base.BasePoint.call(this, curve, 'jacobian');\n  if (x === null && y === null && z === null) {\n    this.x = this.curve.one;\n    this.y = this.curve.one;\n    this.z = new bn(0);\n  } else {\n    this.x = new bn(x, 16);\n    this.y = new bn(y, 16);\n    this.z = new bn(z, 16);\n  }\n  if (!this.x.red)\n    this.x = this.x.toRed(this.curve.red);\n  if (!this.y.red)\n    this.y = this.y.toRed(this.curve.red);\n  if (!this.z.red)\n    this.z = this.z.toRed(this.curve.red);\n\n  this.zOne = this.z === this.curve.one;\n}\ninherits(JPoint, Base.BasePoint);\n\nShortCurve.prototype.jpoint = function jpoint(x, y, z) {\n  return new JPoint(this, x, y, z);\n};\n\nJPoint.prototype.toP = function toP() {\n  if (this.isInfinity())\n    return this.curve.point(null, null);\n\n  var zinv = this.z.redInvm();\n  var zinv2 = zinv.redSqr();\n  var ax = this.x.redMul(zinv2);\n  var ay = this.y.redMul(zinv2).redMul(zinv);\n\n  return this.curve.point(ax, ay);\n};\n\nJPoint.prototype.neg = function neg() {\n  return this.curve.jpoint(this.x, this.y.redNeg(), this.z);\n};\n\nJPoint.prototype.add = function add(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p;\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 12M + 4S + 7A\n  var pz2 = p.z.redSqr();\n  var z2 = this.z.redSqr();\n  var u1 = this.x.redMul(pz2);\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y.redMul(pz2.redMul(p.z));\n  var s2 = p.y.redMul(z2.redMul(this.z));\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(p.z).redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mixedAdd = function mixedAdd(p) {\n  // O + P = P\n  if (this.isInfinity())\n    return p.toJ();\n\n  // P + O = P\n  if (p.isInfinity())\n    return this;\n\n  // 8M + 3S + 7A\n  var z2 = this.z.redSqr();\n  var u1 = this.x;\n  var u2 = p.x.redMul(z2);\n  var s1 = this.y;\n  var s2 = p.y.redMul(z2).redMul(this.z);\n\n  var h = u1.redSub(u2);\n  var r = s1.redSub(s2);\n  if (h.cmpn(0) === 0) {\n    if (r.cmpn(0) !== 0)\n      return this.curve.jpoint(null, null, null);\n    else\n      return this.dbl();\n  }\n\n  var h2 = h.redSqr();\n  var h3 = h2.redMul(h);\n  var v = u1.redMul(h2);\n\n  var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);\n  var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));\n  var nz = this.z.redMul(h);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.dblp = function dblp(pow) {\n  if (pow === 0)\n    return this;\n  if (this.isInfinity())\n    return this;\n  if (!pow)\n    return this.dbl();\n\n  if (this.curve.zeroA || this.curve.threeA) {\n    var r = this;\n    for (var i = 0; i < pow; i++)\n      r = r.dbl();\n    return r;\n  }\n\n  // 1M + 2S + 1A + N * (4S + 5M + 8A)\n  // N = 1 => 6M + 6S + 9A\n  var a = this.curve.a;\n  var tinv = this.curve.tinv;\n\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  // Reuse results\n  var jyd = jy.redAdd(jy);\n  for (var i = 0; i < pow; i++) {\n    var jx2 = jx.redSqr();\n    var jyd2 = jyd.redSqr();\n    var jyd4 = jyd2.redSqr();\n    var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n    var t1 = jx.redMul(jyd2);\n    var nx = c.redSqr().redISub(t1.redAdd(t1));\n    var t2 = t1.redISub(nx);\n    var dny = c.redMul(t2);\n    dny = dny.redIAdd(dny).redISub(jyd4);\n    var nz = jyd.redMul(jz);\n    if (i + 1 < pow)\n      jz4 = jz4.redMul(jyd4);\n\n    jx = nx;\n    jz = nz;\n    jyd = dny;\n  }\n\n  return this.curve.jpoint(jx, jyd.redMul(tinv), jz);\n};\n\nJPoint.prototype.dbl = function dbl() {\n  if (this.isInfinity())\n    return this;\n\n  if (this.curve.zeroA)\n    return this._zeroDbl();\n  else if (this.curve.threeA)\n    return this._threeDbl();\n  else\n    return this._dbl();\n};\n\nJPoint.prototype._zeroDbl = function _zeroDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 14A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a; a = 0\n    var m = xx.redAdd(xx).redIAdd(xx);\n    // T = M ^ 2 - 2*S\n    var t = m.redSqr().redISub(s).redISub(s);\n\n    // 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2*Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html\n    //     #doubling-dbl-2009-l\n    // 2M + 5S + 13A\n\n    // A = X1^2\n    var a = this.x.redSqr();\n    // B = Y1^2\n    var b = this.y.redSqr();\n    // C = B^2\n    var c = b.redSqr();\n    // D = 2 * ((X1 + B)^2 - A - C)\n    var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);\n    d = d.redIAdd(d);\n    // E = 3 * A\n    var e = a.redAdd(a).redIAdd(a);\n    // F = E^2\n    var f = e.redSqr();\n\n    // 8 * C\n    var c8 = c.redIAdd(c);\n    c8 = c8.redIAdd(c8);\n    c8 = c8.redIAdd(c8);\n\n    // X3 = F - 2 * D\n    nx = f.redISub(d).redISub(d);\n    // Y3 = E * (D - X3) - 8 * C\n    ny = e.redMul(d.redISub(nx)).redISub(c8);\n    // Z3 = 2 * Y1 * Z1\n    nz = this.y.redMul(this.z);\n    nz = nz.redIAdd(nz);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._threeDbl = function _threeDbl() {\n  var nx;\n  var ny;\n  var nz;\n  // Z = 1\n  if (this.zOne) {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html\n    //     #doubling-mdbl-2007-bl\n    // 1M + 5S + 15A\n\n    // XX = X1^2\n    var xx = this.x.redSqr();\n    // YY = Y1^2\n    var yy = this.y.redSqr();\n    // YYYY = YY^2\n    var yyyy = yy.redSqr();\n    // S = 2 * ((X1 + YY)^2 - XX - YYYY)\n    var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n    s = s.redIAdd(s);\n    // M = 3 * XX + a\n    var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);\n    // T = M^2 - 2 * S\n    var t = m.redSqr().redISub(s).redISub(s);\n    // X3 = T\n    nx = t;\n    // Y3 = M * (S - T) - 8 * YYYY\n    var yyyy8 = yyyy.redIAdd(yyyy);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    yyyy8 = yyyy8.redIAdd(yyyy8);\n    ny = m.redMul(s.redISub(t)).redISub(yyyy8);\n    // Z3 = 2 * Y1\n    nz = this.y.redAdd(this.y);\n  } else {\n    // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b\n    // 3M + 5S\n\n    // delta = Z1^2\n    var delta = this.z.redSqr();\n    // gamma = Y1^2\n    var gamma = this.y.redSqr();\n    // beta = X1 * gamma\n    var beta = this.x.redMul(gamma);\n    // alpha = 3 * (X1 - delta) * (X1 + delta)\n    var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));\n    alpha = alpha.redAdd(alpha).redIAdd(alpha);\n    // X3 = alpha^2 - 8 * beta\n    var beta4 = beta.redIAdd(beta);\n    beta4 = beta4.redIAdd(beta4);\n    var beta8 = beta4.redAdd(beta4);\n    nx = alpha.redSqr().redISub(beta8);\n    // Z3 = (Y1 + Z1)^2 - gamma - delta\n    nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);\n    // Y3 = alpha * (4 * beta - X3) - 8 * gamma^2\n    var ggamma8 = gamma.redSqr();\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ggamma8 = ggamma8.redIAdd(ggamma8);\n    ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);\n  }\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype._dbl = function _dbl() {\n  var a = this.curve.a;\n\n  // 4M + 6S + 10A\n  var jx = this.x;\n  var jy = this.y;\n  var jz = this.z;\n  var jz4 = jz.redSqr().redSqr();\n\n  var jx2 = jx.redSqr();\n  var jy2 = jy.redSqr();\n\n  var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));\n\n  var jxd4 = jx.redAdd(jx);\n  jxd4 = jxd4.redIAdd(jxd4);\n  var t1 = jxd4.redMul(jy2);\n  var nx = c.redSqr().redISub(t1.redAdd(t1));\n  var t2 = t1.redISub(nx);\n\n  var jyd8 = jy2.redSqr();\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  jyd8 = jyd8.redIAdd(jyd8);\n  var ny = c.redMul(t2).redISub(jyd8);\n  var nz = jy.redAdd(jy).redMul(jz);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.trpl = function trpl() {\n  if (!this.curve.zeroA)\n    return this.dbl().add(this);\n\n  // hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-0.html#tripling-tpl-2007-bl\n  // 5M + 10S + ...\n\n  // XX = X1^2\n  var xx = this.x.redSqr();\n  // YY = Y1^2\n  var yy = this.y.redSqr();\n  // ZZ = Z1^2\n  var zz = this.z.redSqr();\n  // YYYY = YY^2\n  var yyyy = yy.redSqr();\n  // M = 3 * XX + a * ZZ2; a = 0\n  var m = xx.redAdd(xx).redIAdd(xx);\n  // MM = M^2\n  var mm = m.redSqr();\n  // E = 6 * ((X1 + YY)^2 - XX - YYYY) - MM\n  var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);\n  e = e.redIAdd(e);\n  e = e.redAdd(e).redIAdd(e);\n  e = e.redISub(mm);\n  // EE = E^2\n  var ee = e.redSqr();\n  // T = 16*YYYY\n  var t = yyyy.redIAdd(yyyy);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  t = t.redIAdd(t);\n  // U = (M + E)^2 - MM - EE - T\n  var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);\n  // X3 = 4 * (X1 * EE - 4 * YY * U)\n  var yyu4 = yy.redMul(u);\n  yyu4 = yyu4.redIAdd(yyu4);\n  yyu4 = yyu4.redIAdd(yyu4);\n  var nx = this.x.redMul(ee).redISub(yyu4);\n  nx = nx.redIAdd(nx);\n  nx = nx.redIAdd(nx);\n  // Y3 = 8 * Y1 * (U * (T - U) - E * EE)\n  var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  ny = ny.redIAdd(ny);\n  // Z3 = (Z1 + E)^2 - ZZ - EE\n  var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);\n\n  return this.curve.jpoint(nx, ny, nz);\n};\n\nJPoint.prototype.mul = function mul(k, kbase) {\n  k = new bn(k, kbase);\n\n  return this.curve._wnafMul(this, k);\n};\n\nJPoint.prototype.eq = function eq(p) {\n  if (p.type === 'affine')\n    return this.eq(p.toJ());\n\n  if (this === p)\n    return true;\n\n  // x1 * z2^2 == x2 * z1^2\n  var z2 = this.z.redSqr();\n  var pz2 = p.z.redSqr();\n  if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0)\n    return false;\n\n  // y1 * z2^3 == y2 * z1^3\n  var z3 = z2.redMul(this.z);\n  var pz3 = pz2.redMul(p.z);\n  return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;\n};\n\nJPoint.prototype.inspect = function inspect() {\n  if (this.isInfinity())\n    return '<EC JPoint Infinity>';\n  return '<EC JPoint x: ' + this.x.toString(16, 2) +\n      ' y: ' + this.y.toString(16, 2) +\n      ' z: ' + this.z.toString(16, 2) + '>';\n};\n\nJPoint.prototype.isInfinity = function isInfinity() {\n  // XXX This code assumes that zero is always zero in red\n  return this.z.cmpn(0) === 0;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curve/short.js\n// module id = 1332\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curve/short.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar curves = exports;\n\nvar hash = __webpack_require__(126);\nvar elliptic = __webpack_require__(67);\n\nvar assert = elliptic.utils.assert;\n\nfunction PresetCurve(options) {\n  if (options.type === 'short')\n    this.curve = new elliptic.curve.short(options);\n  else if (options.type === 'edwards')\n    this.curve = new elliptic.curve.edwards(options);\n  else\n    this.curve = new elliptic.curve.mont(options);\n  this.g = this.curve.g;\n  this.n = this.curve.n;\n  this.hash = options.hash;\n\n  assert(this.g.validate(), 'Invalid curve');\n  assert(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O');\n}\ncurves.PresetCurve = PresetCurve;\n\nfunction defineCurve(name, options) {\n  Object.defineProperty(curves, name, {\n    configurable: true,\n    enumerable: true,\n    get: function() {\n      var curve = new PresetCurve(options);\n      Object.defineProperty(curves, name, {\n        configurable: true,\n        enumerable: true,\n        value: curve\n      });\n      return curve;\n    }\n  });\n}\n\ndefineCurve('p192', {\n  type: 'short',\n  prime: 'p192',\n  p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc',\n  b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1',\n  n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012',\n    '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811'\n  ]\n});\n\ndefineCurve('p224', {\n  type: 'short',\n  prime: 'p224',\n  p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001',\n  a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe',\n  b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4',\n  n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21',\n    'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34'\n  ]\n});\n\ndefineCurve('p256', {\n  type: 'short',\n  prime: null,\n  p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff',\n  a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc',\n  b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b',\n  n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296',\n    '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5'\n  ]\n});\n\ndefineCurve('curve25519', {\n  type: 'mont',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '76d06',\n  b: '0',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '9'\n  ]\n});\n\ndefineCurve('ed25519', {\n  type: 'edwards',\n  prime: 'p25519',\n  p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed',\n  a: '-1',\n  c: '1',\n  // -121665 * (121666^(-1)) (mod P)\n  d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3',\n  n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed',\n  hash: hash.sha256,\n  gRed: false,\n  g: [\n    '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a',\n\n    // 4/5\n    '6666666666666666666666666666666666666666666666666666666666666658'\n  ]\n});\n\nvar pre;\ntry {\n  pre = __webpack_require__(1338);\n} catch (e) {\n  pre = undefined;\n}\n\ndefineCurve('secp256k1', {\n  type: 'short',\n  prime: 'k256',\n  p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f',\n  a: '0',\n  b: '7',\n  n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141',\n  h: '1',\n  hash: hash.sha256,\n\n  // Precomputed endomorphism\n  beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee',\n  lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72',\n  basis: [\n    {\n      a: '3086d221a7d46bcde86c90e49284eb15',\n      b: '-e4437ed6010e88286f547fa90abfe4c3'\n    },\n    {\n      a: '114ca50f7a8e2f3f657c1108d9d44cfd8',\n      b: '3086d221a7d46bcde86c90e49284eb15'\n    }\n  ],\n\n  gRed: false,\n  g: [\n    '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798',\n    '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8',\n    pre\n  ]\n});\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/curves.js\n// module id = 1333\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/curves.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar bn = __webpack_require__(74);\nvar elliptic = __webpack_require__(67);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nvar KeyPair = __webpack_require__(1335);\nvar Signature = __webpack_require__(1336);\n\nfunction EC(options) {\n  if (!(this instanceof EC))\n    return new EC(options);\n\n  // Shortcut `elliptic.ec(curve-name)`\n  if (typeof options === 'string') {\n    assert(elliptic.curves.hasOwnProperty(options), 'Unknown curve ' + options);\n\n    options = elliptic.curves[options];\n  }\n\n  // Shortcut for `elliptic.ec(elliptic.curves.curveName)`\n  if (options instanceof elliptic.curves.PresetCurve)\n    options = { curve: options };\n\n  this.curve = options.curve.curve;\n  this.n = this.curve.n;\n  this.nh = this.n.shrn(1);\n  this.g = this.curve.g;\n\n  // Point on curve\n  this.g = options.curve.g;\n  this.g.precompute(options.curve.n.bitLength() + 1);\n\n  // Hash for function for DRBG\n  this.hash = options.hash || options.curve.hash;\n}\nmodule.exports = EC;\n\nEC.prototype.keyPair = function keyPair(options) {\n  return new KeyPair(this, options);\n};\n\nEC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {\n  return KeyPair.fromPrivate(this, priv, enc);\n};\n\nEC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {\n  return KeyPair.fromPublic(this, pub, enc);\n};\n\nEC.prototype.genKeyPair = function genKeyPair(options) {\n  if (!options)\n    options = {};\n\n  // Instantiate Hmac_DRBG\n  var drbg = new elliptic.hmacDRBG({\n    hash: this.hash,\n    pers: options.pers,\n    entropy: options.entropy || elliptic.rand(this.hash.hmacStrength),\n    nonce: this.n.toArray()\n  });\n\n  var bytes = this.n.byteLength();\n  var ns2 = this.n.sub(new bn(2));\n  do {\n    var priv = new bn(drbg.generate(bytes));\n    if (priv.cmp(ns2) > 0)\n      continue;\n\n    priv.iaddn(1);\n    return this.keyFromPrivate(priv);\n  } while (true);\n};\n\nEC.prototype._truncateToN = function truncateToN(msg, truncOnly) {\n  var delta = msg.byteLength() * 8 - this.n.bitLength();\n  if (delta > 0)\n    msg = msg.shrn(delta);\n  if (!truncOnly && msg.cmp(this.n) >= 0)\n    return msg.sub(this.n);\n  else\n    return msg;\n};\n\nEC.prototype.sign = function sign(msg, key, enc, options) {\n  if (typeof enc === 'object') {\n    options = enc;\n    enc = null;\n  }\n  if (!options)\n    options = {};\n\n  key = this.keyFromPrivate(key, enc);\n  msg = this._truncateToN(new bn(msg, 16));\n\n  // Zero-extend key to provide enough entropy\n  var bytes = this.n.byteLength();\n  var bkey = key.getPrivate().toArray();\n  for (var i = bkey.length; i < 21; i++)\n    bkey.unshift(0);\n\n  // Zero-extend nonce to have the same byte size as N\n  var nonce = msg.toArray();\n  for (var i = nonce.length; i < bytes; i++)\n    nonce.unshift(0);\n\n  // Instantiate Hmac_DRBG\n  var drbg = new elliptic.hmacDRBG({\n    hash: this.hash,\n    entropy: bkey,\n    nonce: nonce\n  });\n\n  // Number of bytes to generate\n  var ns1 = this.n.sub(new bn(1));\n  do {\n    var k = new bn(drbg.generate(this.n.byteLength()));\n    k = this._truncateToN(k, true);\n    if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0)\n      continue;\n\n    var kp = this.g.mul(k);\n    if (kp.isInfinity())\n      continue;\n\n    var r = kp.getX().mod(this.n);\n    if (r.cmpn(0) === 0)\n      continue;\n\n    var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg)).mod(this.n);\n    if (s.cmpn(0) === 0)\n      continue;\n\n    // Use complement of `s`, if it is > `n / 2`\n    if (options.canonical && s.cmp(this.nh) > 0)\n      s = this.n.sub(s);\n\n    return new Signature({ r: r, s: s });\n  } while (true);\n};\n\nEC.prototype.verify = function verify(msg, signature, key, enc) {\n  msg = this._truncateToN(new bn(msg, 16));\n  key = this.keyFromPublic(key, enc);\n  signature = new Signature(signature, 'hex');\n\n  // Perform primitive values validation\n  var r = signature.r;\n  var s = signature.s;\n  if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0)\n    return false;\n  if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0)\n    return false;\n\n  // Validate signature\n  var sinv = s.invm(this.n);\n  var u1 = sinv.mul(msg).mod(this.n);\n  var u2 = sinv.mul(r).mod(this.n);\n\n  var p = this.g.mulAdd(u1, key.getPublic(), u2);\n  if (p.isInfinity())\n    return false;\n\n  return p.getX().mod(this.n).cmp(r) === 0;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/ec/index.js\n// module id = 1334\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/ec/index.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar bn = __webpack_require__(74);\n\nvar elliptic = __webpack_require__(67);\nvar utils = elliptic.utils;\n\nfunction KeyPair(ec, options) {\n  this.ec = ec;\n  this.priv = null;\n  this.pub = null;\n\n  // KeyPair(ec, { priv: ..., pub: ... })\n  if (options.priv)\n    this._importPrivate(options.priv, options.privEnc);\n  if (options.pub)\n    this._importPublic(options.pub, options.pubEnc);\n}\nmodule.exports = KeyPair;\n\nKeyPair.fromPublic = function fromPublic(ec, pub, enc) {\n  if (pub instanceof KeyPair)\n    return pub;\n\n  return new KeyPair(ec, {\n    pub: pub,\n    pubEnc: enc\n  });\n};\n\nKeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {\n  if (priv instanceof KeyPair)\n    return priv;\n\n  return new KeyPair(ec, {\n    priv: priv,\n    privEnc: enc\n  });\n};\n\nKeyPair.prototype.validate = function validate() {\n  var pub = this.getPublic();\n\n  if (pub.isInfinity())\n    return { result: false, reason: 'Invalid public key' };\n  if (!pub.validate())\n    return { result: false, reason: 'Public key is not a point' };\n  if (!pub.mul(this.ec.curve.n).isInfinity())\n    return { result: false, reason: 'Public key * N != O' };\n\n  return { result: true, reason: null };\n};\n\nKeyPair.prototype.getPublic = function getPublic(compact, enc) {\n  if (!this.pub)\n    this.pub = this.ec.g.mul(this.priv);\n\n  // compact is optional argument\n  if (typeof compact === 'string') {\n    enc = compact;\n    compact = null;\n  }\n\n  if (!enc)\n    return this.pub;\n\n  var len = this.ec.curve.p.byteLength();\n  var x = this.pub.getX().toArray();\n\n  for (var i = x.length; i < len; i++)\n    x.unshift(0);\n\n  var res;\n  if (this.ec.curve.type !== 'mont') {\n    if (compact) {\n      res = [ this.pub.getY().isEven() ? 0x02 : 0x03 ].concat(x);\n    } else {\n      var y = this.pub.getY().toArray();\n      for (var i = y.length; i < len; i++)\n        y.unshift(0);\n      var res = [ 0x04 ].concat(x, y);\n    }\n  } else {\n    res = x;\n  }\n\n  return utils.encode(res, enc);\n};\n\nKeyPair.prototype.getPrivate = function getPrivate(enc) {\n  if (enc === 'hex')\n    return this.priv.toString(16, 2);\n  else\n    return this.priv;\n};\n\nKeyPair.prototype._importPrivate = function _importPrivate(key, enc) {\n  this.priv = new bn(key, enc || 16);\n\n  // Ensure that the priv won't be bigger than n, otherwise we may fail\n  // in fixed multiplication method\n  this.priv = this.priv.mod(this.ec.curve.n);\n};\n\nKeyPair.prototype._importPublic = function _importPublic(key, enc) {\n  if (key.x || key.y) {\n    this.pub = this.ec.curve.point(key.x, key.y);\n    return;\n  }\n\n  key = utils.toArray(key, enc);\n  if (this.ec.curve.type !== 'mont')\n    return this._importPublicShort(key);\n  else\n    return this._importPublicMont(key);\n};\n\nKeyPair.prototype._importPublicShort = function _importPublicShort(key) {\n  var len = this.ec.curve.p.byteLength();\n  if (key[0] === 0x04 && key.length - 1 === 2 * len) {\n    this.pub = this.ec.curve.point(\n      key.slice(1, 1 + len),\n      key.slice(1 + len, 1 + 2 * len));\n  } else if ((key[0] === 0x02 || key[0] === 0x03) && key.length - 1 === len) {\n    this.pub = this.ec.curve.pointFromX(key[0] === 0x03, key.slice(1, 1 + len));\n  }\n};\n\nKeyPair.prototype._importPublicMont = function _importPublicMont(key) {\n  this.pub = this.ec.curve.point(key, 1);\n};\n\n// ECDH\nKeyPair.prototype.derive = function derive(pub) {\n  return pub.mul(this.priv).getX();\n};\n\n// ECDSA\nKeyPair.prototype.sign = function sign(msg) {\n  return this.ec.sign(msg, this);\n};\n\nKeyPair.prototype.verify = function verify(msg, signature) {\n  return this.ec.verify(msg, signature, this);\n};\n\nKeyPair.prototype.inspect = function inspect() {\n  return '<Key priv: ' + (this.priv && this.priv.toString(16, 2)) +\n         ' pub: ' + (this.pub && this.pub.inspect()) + ' >';\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/ec/key.js\n// module id = 1335\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/ec/key.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar bn = __webpack_require__(74);\n\nvar elliptic = __webpack_require__(67);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction Signature(options, enc) {\n  if (options instanceof Signature)\n    return options;\n\n  if (this._importDER(options, enc))\n    return;\n\n  assert(options.r && options.s, 'Signature without r or s');\n  this.r = new bn(options.r, 16);\n  this.s = new bn(options.s, 16);\n}\nmodule.exports = Signature;\n\nSignature.prototype._importDER = function _importDER(data, enc) {\n  data = utils.toArray(data, enc);\n  if (data.length < 6 || data[0] !== 0x30 || data[2] !== 0x02)\n    return false;\n  var total = data[1];\n  if (1 + total > data.length)\n    return false;\n  var rlen = data[3];\n  // Short length notation\n  if (rlen >= 0x80)\n    return false;\n  if (4 + rlen + 2 >= data.length)\n    return false;\n  if (data[4 + rlen] !== 0x02)\n    return false;\n  var slen = data[5 + rlen];\n  // Short length notation\n  if (slen >= 0x80)\n    return false;\n  if (4 + rlen + 2 + slen > data.length)\n    return false;\n\n  this.r = new bn(data.slice(4, 4 + rlen));\n  this.s = new bn(data.slice(4 + rlen + 2, 4 + rlen + 2 + slen));\n\n  return true;\n};\n\nSignature.prototype.toDER = function toDER(enc) {\n  var r = this.r.toArray();\n  var s = this.s.toArray();\n\n  // Pad values\n  if (r[0] & 0x80)\n    r = [ 0 ].concat(r);\n  // Pad values\n  if (s[0] & 0x80)\n    s = [ 0 ].concat(s);\n\n  var total = r.length + s.length + 4;\n  var res = [ 0x30, total, 0x02, r.length ];\n  res = res.concat(r, [ 0x02, s.length ], s);\n  return utils.encode(res, enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/ec/signature.js\n// module id = 1336\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/ec/signature.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar hash = __webpack_require__(126);\nvar elliptic = __webpack_require__(67);\nvar utils = elliptic.utils;\nvar assert = utils.assert;\n\nfunction HmacDRBG(options) {\n  if (!(this instanceof HmacDRBG))\n    return new HmacDRBG(options);\n  this.hash = options.hash;\n  this.predResist = !!options.predResist;\n\n  this.outLen = this.hash.outSize;\n  this.minEntropy = options.minEntropy || this.hash.hmacStrength;\n\n  this.reseed = null;\n  this.reseedInterval = null;\n  this.K = null;\n  this.V = null;\n\n  var entropy = utils.toArray(options.entropy, options.entropyEnc);\n  var nonce = utils.toArray(options.nonce, options.nonceEnc);\n  var pers = utils.toArray(options.pers, options.persEnc);\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n  this._init(entropy, nonce, pers);\n}\nmodule.exports = HmacDRBG;\n\nHmacDRBG.prototype._init = function init(entropy, nonce, pers) {\n  var seed = entropy.concat(nonce).concat(pers);\n\n  this.K = new Array(this.outLen / 8);\n  this.V = new Array(this.outLen / 8);\n  for (var i = 0; i < this.V.length; i++) {\n    this.K[i] = 0x00;\n    this.V[i] = 0x01;\n  }\n\n  this._update(seed);\n  this.reseed = 1;\n  this.reseedInterval = 0x1000000000000;  // 2^48\n};\n\nHmacDRBG.prototype._hmac = function hmac() {\n  return new hash.hmac(this.hash, this.K);\n};\n\nHmacDRBG.prototype._update = function update(seed) {\n  var kmac = this._hmac()\n                 .update(this.V)\n                 .update([ 0x00 ]);\n  if (seed)\n    kmac = kmac.update(seed);\n  this.K = kmac.digest();\n  this.V = this._hmac().update(this.V).digest();\n  if (!seed)\n    return;\n\n  this.K = this._hmac()\n               .update(this.V)\n               .update([ 0x01 ])\n               .update(seed)\n               .digest();\n  this.V = this._hmac().update(this.V).digest();\n};\n\nHmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {\n  // Optional entropy enc\n  if (typeof entropyEnc !== 'string') {\n    addEnc = add;\n    add = entropyEnc;\n    entropyEnc = null;\n  }\n\n  entropy = utils.toBuffer(entropy, entropyEnc);\n  add = utils.toBuffer(add, addEnc);\n\n  assert(entropy.length >= (this.minEntropy / 8),\n         'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits');\n\n  this._update(entropy.concat(add || []));\n  this.reseed = 1;\n};\n\nHmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {\n  if (this.reseed > this.reseedInterval)\n    throw new Error('Reseed is required');\n\n  // Optional encoding\n  if (typeof enc !== 'string') {\n    addEnc = add;\n    add = enc;\n    enc = null;\n  }\n\n  // Optional additional data\n  if (add) {\n    add = utils.toArray(add, addEnc);\n    this._update(add);\n  }\n\n  var temp = [];\n  while (temp.length < len) {\n    this.V = this._hmac().update(this.V).digest();\n    temp = temp.concat(this.V);\n  }\n\n  var res = temp.slice(0, len);\n  this._update(add);\n  this.reseed++;\n  return utils.encode(res, enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/hmac-drbg.js\n// module id = 1337\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/hmac-drbg.js")},function(module,exports){eval("module.exports = {\n  doubles: {\n    step: 4,\n    points: [\n      [\n        'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a',\n        'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821'\n      ],\n      [\n        '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508',\n        '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf'\n      ],\n      [\n        '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739',\n        'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695'\n      ],\n      [\n        '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640',\n        '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9'\n      ],\n      [\n        '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c',\n        '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36'\n      ],\n      [\n        '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda',\n        '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f'\n      ],\n      [\n        'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa',\n        '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999'\n      ],\n      [\n        '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0',\n        'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09'\n      ],\n      [\n        'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d',\n        '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d'\n      ],\n      [\n        'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d',\n        'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088'\n      ],\n      [\n        'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1',\n        '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d'\n      ],\n      [\n        '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0',\n        '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8'\n      ],\n      [\n        '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047',\n        '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a'\n      ],\n      [\n        '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862',\n        '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453'\n      ],\n      [\n        '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7',\n        '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160'\n      ],\n      [\n        '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd',\n        '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0'\n      ],\n      [\n        '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83',\n        '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6'\n      ],\n      [\n        '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a',\n        '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589'\n      ],\n      [\n        '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8',\n        'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17'\n      ],\n      [\n        'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d',\n        '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda'\n      ],\n      [\n        'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725',\n        '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd'\n      ],\n      [\n        '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754',\n        '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2'\n      ],\n      [\n        '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c',\n        '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6'\n      ],\n      [\n        'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6',\n        '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f'\n      ],\n      [\n        '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39',\n        'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01'\n      ],\n      [\n        'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891',\n        '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3'\n      ],\n      [\n        'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b',\n        'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f'\n      ],\n      [\n        'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03',\n        '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7'\n      ],\n      [\n        'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d',\n        'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78'\n      ],\n      [\n        'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070',\n        '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1'\n      ],\n      [\n        '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4',\n        'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150'\n      ],\n      [\n        '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da',\n        '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82'\n      ],\n      [\n        'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11',\n        '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc'\n      ],\n      [\n        '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e',\n        'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b'\n      ],\n      [\n        'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41',\n        '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51'\n      ],\n      [\n        'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef',\n        '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45'\n      ],\n      [\n        'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8',\n        'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120'\n      ],\n      [\n        '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d',\n        '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84'\n      ],\n      [\n        '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96',\n        '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d'\n      ],\n      [\n        '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd',\n        'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d'\n      ],\n      [\n        '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5',\n        '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8'\n      ],\n      [\n        'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266',\n        '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8'\n      ],\n      [\n        '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71',\n        '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac'\n      ],\n      [\n        '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac',\n        'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f'\n      ],\n      [\n        '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751',\n        '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962'\n      ],\n      [\n        'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e',\n        '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907'\n      ],\n      [\n        '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241',\n        'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec'\n      ],\n      [\n        'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3',\n        'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d'\n      ],\n      [\n        'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f',\n        '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414'\n      ],\n      [\n        '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19',\n        'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd'\n      ],\n      [\n        '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be',\n        'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0'\n      ],\n      [\n        'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9',\n        '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811'\n      ],\n      [\n        'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2',\n        '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1'\n      ],\n      [\n        'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13',\n        '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c'\n      ],\n      [\n        '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c',\n        'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73'\n      ],\n      [\n        '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba',\n        '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd'\n      ],\n      [\n        'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151',\n        'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405'\n      ],\n      [\n        '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073',\n        'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589'\n      ],\n      [\n        '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458',\n        '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e'\n      ],\n      [\n        '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b',\n        '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27'\n      ],\n      [\n        'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366',\n        'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1'\n      ],\n      [\n        '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa',\n        '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482'\n      ],\n      [\n        '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0',\n        '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945'\n      ],\n      [\n        'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787',\n        '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573'\n      ],\n      [\n        'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e',\n        'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82'\n      ]\n    ]\n  },\n  naf: {\n    wnd: 7,\n    points: [\n      [\n        'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9',\n        '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672'\n      ],\n      [\n        '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4',\n        'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6'\n      ],\n      [\n        '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc',\n        '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da'\n      ],\n      [\n        'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe',\n        'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37'\n      ],\n      [\n        '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb',\n        'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b'\n      ],\n      [\n        'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8',\n        'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81'\n      ],\n      [\n        'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e',\n        '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58'\n      ],\n      [\n        'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34',\n        '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77'\n      ],\n      [\n        '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c',\n        '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a'\n      ],\n      [\n        '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5',\n        '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c'\n      ],\n      [\n        '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f',\n        '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67'\n      ],\n      [\n        '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714',\n        '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402'\n      ],\n      [\n        'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729',\n        'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55'\n      ],\n      [\n        'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db',\n        '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482'\n      ],\n      [\n        '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4',\n        'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82'\n      ],\n      [\n        '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5',\n        'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396'\n      ],\n      [\n        '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479',\n        '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49'\n      ],\n      [\n        '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d',\n        '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf'\n      ],\n      [\n        '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f',\n        '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a'\n      ],\n      [\n        '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb',\n        'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7'\n      ],\n      [\n        'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9',\n        'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933'\n      ],\n      [\n        '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963',\n        '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a'\n      ],\n      [\n        '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74',\n        '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6'\n      ],\n      [\n        'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530',\n        'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37'\n      ],\n      [\n        '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b',\n        '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e'\n      ],\n      [\n        'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247',\n        'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6'\n      ],\n      [\n        'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1',\n        'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476'\n      ],\n      [\n        '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120',\n        '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40'\n      ],\n      [\n        '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435',\n        '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61'\n      ],\n      [\n        '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18',\n        '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683'\n      ],\n      [\n        'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8',\n        '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5'\n      ],\n      [\n        '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb',\n        '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b'\n      ],\n      [\n        'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f',\n        '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417'\n      ],\n      [\n        '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143',\n        'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868'\n      ],\n      [\n        '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba',\n        'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a'\n      ],\n      [\n        'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45',\n        'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6'\n      ],\n      [\n        '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a',\n        '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996'\n      ],\n      [\n        '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e',\n        'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e'\n      ],\n      [\n        'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8',\n        'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d'\n      ],\n      [\n        '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c',\n        '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2'\n      ],\n      [\n        '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519',\n        'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e'\n      ],\n      [\n        '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab',\n        '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437'\n      ],\n      [\n        '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca',\n        'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311'\n      ],\n      [\n        'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf',\n        '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4'\n      ],\n      [\n        '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610',\n        '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575'\n      ],\n      [\n        '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4',\n        'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d'\n      ],\n      [\n        '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c',\n        'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d'\n      ],\n      [\n        'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940',\n        'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629'\n      ],\n      [\n        'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980',\n        'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06'\n      ],\n      [\n        '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3',\n        '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374'\n      ],\n      [\n        '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf',\n        '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee'\n      ],\n      [\n        'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63',\n        '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1'\n      ],\n      [\n        'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448',\n        'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b'\n      ],\n      [\n        '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf',\n        '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661'\n      ],\n      [\n        '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5',\n        '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6'\n      ],\n      [\n        'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6',\n        '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e'\n      ],\n      [\n        '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5',\n        '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d'\n      ],\n      [\n        'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99',\n        'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc'\n      ],\n      [\n        '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51',\n        'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4'\n      ],\n      [\n        '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5',\n        '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c'\n      ],\n      [\n        'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5',\n        '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b'\n      ],\n      [\n        'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997',\n        '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913'\n      ],\n      [\n        '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881',\n        '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154'\n      ],\n      [\n        '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5',\n        '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865'\n      ],\n      [\n        '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66',\n        'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc'\n      ],\n      [\n        '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726',\n        'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224'\n      ],\n      [\n        '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede',\n        '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e'\n      ],\n      [\n        '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94',\n        '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6'\n      ],\n      [\n        '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31',\n        '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511'\n      ],\n      [\n        '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51',\n        'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b'\n      ],\n      [\n        'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252',\n        'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2'\n      ],\n      [\n        '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5',\n        'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c'\n      ],\n      [\n        'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b',\n        '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3'\n      ],\n      [\n        'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4',\n        '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d'\n      ],\n      [\n        'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f',\n        '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700'\n      ],\n      [\n        'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889',\n        '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4'\n      ],\n      [\n        '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246',\n        'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196'\n      ],\n      [\n        '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984',\n        '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4'\n      ],\n      [\n        '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a',\n        'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257'\n      ],\n      [\n        'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030',\n        'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13'\n      ],\n      [\n        'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197',\n        '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096'\n      ],\n      [\n        'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593',\n        'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38'\n      ],\n      [\n        'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef',\n        '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f'\n      ],\n      [\n        '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38',\n        '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448'\n      ],\n      [\n        'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a',\n        '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a'\n      ],\n      [\n        'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111',\n        '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4'\n      ],\n      [\n        '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502',\n        '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437'\n      ],\n      [\n        '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea',\n        'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7'\n      ],\n      [\n        'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26',\n        '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d'\n      ],\n      [\n        'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986',\n        '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a'\n      ],\n      [\n        'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e',\n        '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54'\n      ],\n      [\n        '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4',\n        '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77'\n      ],\n      [\n        'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda',\n        'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517'\n      ],\n      [\n        '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859',\n        'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10'\n      ],\n      [\n        'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f',\n        'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125'\n      ],\n      [\n        'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c',\n        '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e'\n      ],\n      [\n        '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942',\n        'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1'\n      ],\n      [\n        'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a',\n        '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2'\n      ],\n      [\n        'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80',\n        '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423'\n      ],\n      [\n        'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d',\n        '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8'\n      ],\n      [\n        '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1',\n        'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758'\n      ],\n      [\n        '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63',\n        'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375'\n      ],\n      [\n        'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352',\n        '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d'\n      ],\n      [\n        '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193',\n        'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec'\n      ],\n      [\n        '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00',\n        '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0'\n      ],\n      [\n        '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58',\n        'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c'\n      ],\n      [\n        'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7',\n        'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4'\n      ],\n      [\n        '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8',\n        'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f'\n      ],\n      [\n        '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e',\n        '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649'\n      ],\n      [\n        '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d',\n        'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826'\n      ],\n      [\n        '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b',\n        '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5'\n      ],\n      [\n        'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f',\n        'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87'\n      ],\n      [\n        '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6',\n        '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b'\n      ],\n      [\n        'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297',\n        '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc'\n      ],\n      [\n        '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a',\n        '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c'\n      ],\n      [\n        'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c',\n        'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f'\n      ],\n      [\n        'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52',\n        '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a'\n      ],\n      [\n        'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb',\n        'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46'\n      ],\n      [\n        '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065',\n        'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f'\n      ],\n      [\n        '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917',\n        '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03'\n      ],\n      [\n        '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9',\n        'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08'\n      ],\n      [\n        '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3',\n        '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8'\n      ],\n      [\n        '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57',\n        '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373'\n      ],\n      [\n        '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66',\n        'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3'\n      ],\n      [\n        '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8',\n        '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8'\n      ],\n      [\n        '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721',\n        '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1'\n      ],\n      [\n        '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180',\n        '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9'\n      ]\n    ]\n  }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/precomputed/secp256k1.js\n// module id = 1338\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js")},function(module,exports,__webpack_require__){"use strict";eval("\n\nvar utils = exports;\n\nutils.assert = function assert(val, msg) {\n  if (!val)\n    throw new Error(msg || 'Assertion failed');\n};\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg !== 'string') {\n    for (var i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n    return res;\n  }\n  if (!enc) {\n    for (var i = 0; i < msg.length; i++) {\n      var c = msg.charCodeAt(i);\n      var hi = c >> 8;\n      var lo = c & 0xff;\n      if (hi)\n        res.push(hi, lo);\n      else\n        res.push(lo);\n    }\n  } else if (enc === 'hex') {\n    msg = msg.replace(/[^a-z0-9]+/ig, '');\n    if (msg.length % 2 !== 0)\n      msg = '0' + msg;\n    for (var i = 0; i < msg.length; i += 2)\n      res.push(parseInt(msg[i] + msg[i + 1], 16));\n  }\n  return res;\n}\nutils.toArray = toArray;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nutils.zero2 = zero2;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nutils.toHex = toHex;\n\nutils.encode = function encode(arr, enc) {\n  if (enc === 'hex')\n    return toHex(arr);\n  else\n    return arr;\n};\n\n// Represent num in a w-NAF form\nfunction getNAF(num, w) {\n  var naf = [];\n  var ws = 1 << (w + 1);\n  var k = num.clone();\n  while (k.cmpn(1) >= 0) {\n    var z;\n    if (k.isOdd()) {\n      var mod = k.andln(ws - 1);\n      if (mod > (ws >> 1) - 1)\n        z = (ws >> 1) - mod;\n      else\n        z = mod;\n      k.isubn(z);\n    } else {\n      z = 0;\n    }\n    naf.push(z);\n\n    // Optimization, shift by word if possible\n    var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1;\n    for (var i = 1; i < shift; i++)\n      naf.push(0);\n    k.ishrn(shift);\n  }\n\n  return naf;\n}\nutils.getNAF = getNAF;\n\n// Represent k1, k2 in a Joint Sparse Form\nfunction getJSF(k1, k2) {\n  var jsf = [\n    [],\n    []\n  ];\n\n  k1 = k1.clone();\n  k2 = k2.clone();\n  var d1 = 0;\n  var d2 = 0;\n  while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {\n\n    // First phase\n    var m14 = (k1.andln(3) + d1) & 3;\n    var m24 = (k2.andln(3) + d2) & 3;\n    if (m14 === 3)\n      m14 = -1;\n    if (m24 === 3)\n      m24 = -1;\n    var u1;\n    if ((m14 & 1) === 0) {\n      u1 = 0;\n    } else {\n      var m8 = (k1.andln(7) + d1) & 7;\n      if ((m8 === 3 || m8 === 5) && m24 === 2)\n        u1 = -m14;\n      else\n        u1 = m14;\n    }\n    jsf[0].push(u1);\n\n    var u2;\n    if ((m24 & 1) === 0) {\n      u2 = 0;\n    } else {\n      var m8 = (k2.andln(7) + d2) & 7;\n      if ((m8 === 3 || m8 === 5) && m14 === 2)\n        u2 = -m24;\n      else\n        u2 = m24;\n    }\n    jsf[1].push(u2);\n\n    // Second phase\n    if (2 * d1 === u1 + 1)\n      d1 = 1 - d1;\n    if (2 * d2 === u2 + 1)\n      d2 = 1 - d2;\n    k1.ishrn(1);\n    k2.ishrn(1);\n  }\n\n  return jsf;\n}\nutils.getJSF = getJSF;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/lib/elliptic/utils.js\n// module id = 1339\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/lib/elliptic/utils.js")},function(module,exports,__webpack_require__){eval("var r;\n\nmodule.exports = function rand(len) {\n  if (!r)\n    r = new Rand(null);\n\n  return r.generate(len);\n};\n\nfunction Rand(rand) {\n  this.rand = rand;\n}\nmodule.exports.Rand = Rand;\n\nRand.prototype.generate = function generate(len) {\n  return this._rand(len);\n};\n\nif (typeof window === 'object') {\n  if (window.crypto && window.crypto.getRandomValues) {\n    // Modern browsers\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      window.crypto.getRandomValues(arr);\n      return arr;\n    };\n  } else if (window.msCrypto && window.msCrypto.getRandomValues) {\n    // IE\n    Rand.prototype._rand = function _rand(n) {\n      var arr = new Uint8Array(n);\n      window.msCrypto.getRandomValues(arr);\n      return arr;\n    };\n  } else {\n    // Old junk\n    Rand.prototype._rand = function() {\n      throw new Error('Not implemented yet');\n    };\n  }\n} else {\n  // Node.js or Web worker\n  try {\n    var crypto = __webpack_require__(60);\n\n    Rand.prototype._rand = function _rand(n) {\n      return crypto.randomBytes(n);\n    };\n  } catch (e) {\n    // Emulate crypto API using randy\n    Rand.prototype._rand = function _rand(n) {\n      var res = new Uint8Array(n);\n      for (var i = 0; i < res.length; i++)\n        res[i] = this.rand.getByte();\n      return res;\n    };\n  }\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/brorand/index.js\n// module id = 1340\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/brorand/index.js")},function(module,exports,__webpack_require__){eval("var hash = __webpack_require__(126);\nvar utils = hash.utils;\nvar assert = utils.assert;\n\nfunction BlockHash() {\n  this.pending = null;\n  this.pendingTotal = 0;\n  this.blockSize = this.constructor.blockSize;\n  this.outSize = this.constructor.outSize;\n  this.hmacStrength = this.constructor.hmacStrength;\n  this.padLength = this.constructor.padLength / 8;\n  this.endian = 'big';\n\n  this._delta8 = this.blockSize / 8;\n  this._delta32 = this.blockSize / 32;\n}\nexports.BlockHash = BlockHash;\n\nBlockHash.prototype.update = function update(msg, enc) {\n  // Convert message to array, pad it, and join into 32bit blocks\n  msg = utils.toArray(msg, enc);\n  if (!this.pending)\n    this.pending = msg;\n  else\n    this.pending = this.pending.concat(msg);\n  this.pendingTotal += msg.length;\n\n  // Enough data, try updating\n  if (this.pending.length >= this._delta8) {\n    msg = this.pending;\n\n    // Process pending data in blocks\n    var r = msg.length % this._delta8;\n    this.pending = msg.slice(msg.length - r, msg.length);\n    if (this.pending.length === 0)\n      this.pending = null;\n\n    msg = utils.join32(msg, 0, msg.length - r, this.endian);\n    for (var i = 0; i < msg.length; i += this._delta32)\n      this._update(msg, i, i + this._delta32);\n  }\n\n  return this;\n};\n\nBlockHash.prototype.digest = function digest(enc) {\n  this.update(this._pad());\n  assert(this.pending === null);\n\n  return this._digest(enc);\n};\n\nBlockHash.prototype._pad = function pad() {\n  var len = this.pendingTotal;\n  var bytes = this._delta8;\n  var k = bytes - ((len + this.padLength) % bytes);\n  var res = new Array(k + this.padLength);\n  res[0] = 0x80;\n  for (var i = 1; i < k; i++)\n    res[i] = 0;\n\n  // Append length\n  len <<= 3;\n  if (this.endian === 'big') {\n    for (var t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = len & 0xff;\n  } else {\n    res[i++] = len & 0xff;\n    res[i++] = (len >>> 8) & 0xff;\n    res[i++] = (len >>> 16) & 0xff;\n    res[i++] = (len >>> 24) & 0xff;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n    res[i++] = 0;\n\n    for (var t = 8; t < this.padLength; t++)\n      res[i++] = 0;\n  }\n\n  return res;\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash/common.js\n// module id = 1341\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash/common.js")},function(module,exports,__webpack_require__){eval("var hmac = exports;\n\nvar hash = __webpack_require__(126);\nvar utils = hash.utils;\nvar assert = utils.assert;\n\nfunction Hmac(hash, key, enc) {\n  if (!(this instanceof Hmac))\n    return new Hmac(hash, key, enc);\n  this.Hash = hash;\n  this.blockSize = hash.blockSize / 8;\n  this.outSize = hash.outSize / 8;\n  this.inner = null;\n  this.outer = null;\n\n  this._init(utils.toArray(key, enc));\n}\nmodule.exports = Hmac;\n\nHmac.prototype._init = function init(key) {\n  // Shorten key, if needed\n  if (key.length > this.blockSize)\n    key = new this.Hash().update(key).digest();\n  assert(key.length <= this.blockSize);\n\n  // Add padding to key\n  for (var i = key.length; i < this.blockSize; i++)\n    key.push(0);\n\n  for (var i = 0; i < key.length; i++)\n    key[i] ^= 0x36;\n  this.inner = new this.Hash().update(key);\n\n  // 0x36 ^ 0x5c = 0x6a\n  for (var i = 0; i < key.length; i++)\n    key[i] ^= 0x6a;\n  this.outer = new this.Hash().update(key);\n};\n\nHmac.prototype.update = function update(msg, enc) {\n  this.inner.update(msg, enc);\n  return this;\n};\n\nHmac.prototype.digest = function digest(enc) {\n  this.outer.update(this.inner.digest());\n  return this.outer.digest(enc);\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash/hmac.js\n// module id = 1342\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash/hmac.js")},function(module,exports,__webpack_require__){eval("var hash = __webpack_require__(126);\nvar utils = hash.utils;\n\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_3 = utils.sum32_3;\nvar sum32_4 = utils.sum32_4;\nvar BlockHash = hash.common.BlockHash;\n\nfunction RIPEMD160() {\n  if (!(this instanceof RIPEMD160))\n    return new RIPEMD160();\n\n  BlockHash.call(this);\n\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\n  this.endian = 'little';\n}\nutils.inherits(RIPEMD160, BlockHash);\nexports.ripemd160 = RIPEMD160;\n\nRIPEMD160.blockSize = 512;\nRIPEMD160.outSize = 160;\nRIPEMD160.hmacStrength = 192;\nRIPEMD160.padLength = 64;\n\nRIPEMD160.prototype._update = function update(msg, start) {\n  var A = this.h[0];\n  var B = this.h[1];\n  var C = this.h[2];\n  var D = this.h[3];\n  var E = this.h[4];\n  var Ah = A;\n  var Bh = B;\n  var Ch = C;\n  var Dh = D;\n  var Eh = E;\n  for (var j = 0; j < 80; j++) {\n    var T = sum32(\n      rotl32(\n        sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),\n        s[j]),\n      E);\n    A = E;\n    E = D;\n    D = rotl32(C, 10);\n    C = B;\n    B = T;\n    T = sum32(\n      rotl32(\n        sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),\n        sh[j]),\n      Eh);\n    Ah = Eh;\n    Eh = Dh;\n    Dh = rotl32(Ch, 10);\n    Ch = Bh;\n    Bh = T;\n  }\n  T = sum32_3(this.h[1], C, Dh);\n  this.h[1] = sum32_3(this.h[2], D, Eh);\n  this.h[2] = sum32_3(this.h[3], E, Ah);\n  this.h[3] = sum32_3(this.h[4], A, Bh);\n  this.h[4] = sum32_3(this.h[0], B, Ch);\n  this.h[0] = T;\n};\n\nRIPEMD160.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'little');\n  else\n    return utils.split32(this.h, 'little');\n};\n\nfunction f(j, x, y, z) {\n  if (j <= 15)\n    return x ^ y ^ z;\n  else if (j <= 31)\n    return (x & y) | ((~x) & z);\n  else if (j <= 47)\n    return (x | (~y)) ^ z;\n  else if (j <= 63)\n    return (x & z) | (y & (~z));\n  else\n    return x ^ (y | (~z));\n}\n\nfunction K(j) {\n  if (j <= 15)\n    return 0x00000000;\n  else if (j <= 31)\n    return 0x5a827999;\n  else if (j <= 47)\n    return 0x6ed9eba1;\n  else if (j <= 63)\n    return 0x8f1bbcdc;\n  else\n    return 0xa953fd4e;\n}\n\nfunction Kh(j) {\n  if (j <= 15)\n    return 0x50a28be6;\n  else if (j <= 31)\n    return 0x5c4dd124;\n  else if (j <= 47)\n    return 0x6d703ef3;\n  else if (j <= 63)\n    return 0x7a6d76e9;\n  else\n    return 0x00000000;\n}\n\nvar r = [\n  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n  7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n  3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n  1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n  4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13\n];\n\nvar rh = [\n  5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n  6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n  15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n  8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n  12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11\n];\n\nvar s = [\n  11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n  7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n  11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n  11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n  9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6\n];\n\nvar sh = [\n  8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n  9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n  9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n  15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n  8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11\n];\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash/ripemd.js\n// module id = 1343\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash/ripemd.js")},function(module,exports,__webpack_require__){eval("var hash = __webpack_require__(126);\nvar utils = hash.utils;\nvar assert = utils.assert;\n\nvar rotr32 = utils.rotr32;\nvar rotl32 = utils.rotl32;\nvar sum32 = utils.sum32;\nvar sum32_4 = utils.sum32_4;\nvar sum32_5 = utils.sum32_5;\nvar rotr64_hi = utils.rotr64_hi;\nvar rotr64_lo = utils.rotr64_lo;\nvar shr64_hi = utils.shr64_hi;\nvar shr64_lo = utils.shr64_lo;\nvar sum64 = utils.sum64;\nvar sum64_hi = utils.sum64_hi;\nvar sum64_lo = utils.sum64_lo;\nvar sum64_4_hi = utils.sum64_4_hi;\nvar sum64_4_lo = utils.sum64_4_lo;\nvar sum64_5_hi = utils.sum64_5_hi;\nvar sum64_5_lo = utils.sum64_5_lo;\nvar BlockHash = hash.common.BlockHash;\n\nvar sha256_K = [\n  0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,\n  0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\n  0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n  0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\n  0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,\n  0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n  0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,\n  0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\n  0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n  0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\n  0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,\n  0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n  0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,\n  0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\n  0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n  0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2\n];\n\nvar sha512_K = [\n  0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n  0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n  0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n  0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n  0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n  0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n  0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n  0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n  0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n  0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n  0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n  0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n  0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n  0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n  0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n  0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n  0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n  0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n  0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n  0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n  0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n  0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n  0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n  0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n  0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n  0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n  0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n  0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n  0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n  0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n  0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n  0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n  0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n  0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n  0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n  0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n  0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n  0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n  0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n  0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nvar sha1_K = [\n  0x5A827999, 0x6ED9EBA1,\n  0x8F1BBCDC, 0xCA62C1D6\n];\n\nfunction SHA256() {\n  if (!(this instanceof SHA256))\n    return new SHA256();\n\n  BlockHash.call(this);\n  this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,\n             0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ];\n  this.k = sha256_K;\n  this.W = new Array(64);\n}\nutils.inherits(SHA256, BlockHash);\nexports.sha256 = SHA256;\n\nSHA256.blockSize = 512;\nSHA256.outSize = 256;\nSHA256.hmacStrength = 192;\nSHA256.padLength = 64;\n\nSHA256.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i++)\n    W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n  var f = this.h[5];\n  var g = this.h[6];\n  var h = this.h[7];\n\n  assert(this.k.length === W.length);\n  for (var i = 0; i < W.length; i++) {\n    var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);\n    var T2 = sum32(s0_256(a), maj32(a, b, c));\n    h = g;\n    g = f;\n    f = e;\n    e = sum32(d, T1);\n    d = c;\n    c = b;\n    b = a;\n    a = sum32(T1, T2);\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n  this.h[5] = sum32(this.h[5], f);\n  this.h[6] = sum32(this.h[6], g);\n  this.h[7] = sum32(this.h[7], h);\n};\n\nSHA256.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction SHA224() {\n  if (!(this instanceof SHA224))\n    return new SHA224();\n\n  SHA256.call(this);\n  this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,\n             0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];\n}\nutils.inherits(SHA224, SHA256);\nexports.sha224 = SHA224;\n\nSHA224.blockSize = 512;\nSHA224.outSize = 224;\nSHA224.hmacStrength = 192;\nSHA224.padLength = 64;\n\nSHA224.prototype._digest = function digest(enc) {\n  // Just truncate output\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 7), 'big');\n  else\n    return utils.split32(this.h.slice(0, 7), 'big');\n};\n\nfunction SHA512() {\n  if (!(this instanceof SHA512))\n    return new SHA512();\n\n  BlockHash.call(this);\n  this.h = [ 0x6a09e667, 0xf3bcc908,\n             0xbb67ae85, 0x84caa73b,\n             0x3c6ef372, 0xfe94f82b,\n             0xa54ff53a, 0x5f1d36f1,\n             0x510e527f, 0xade682d1,\n             0x9b05688c, 0x2b3e6c1f,\n             0x1f83d9ab, 0xfb41bd6b,\n             0x5be0cd19, 0x137e2179 ];\n  this.k = sha512_K;\n  this.W = new Array(160);\n}\nutils.inherits(SHA512, BlockHash);\nexports.sha512 = SHA512;\n\nSHA512.blockSize = 1024;\nSHA512.outSize = 512;\nSHA512.hmacStrength = 192;\nSHA512.padLength = 128;\n\nSHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {\n  var W = this.W;\n\n  // 32 x 32bit words\n  for (var i = 0; i < 32; i++)\n    W[i] = msg[start + i];\n  for (; i < W.length; i += 2) {\n    var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);  // i - 2\n    var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);\n    var c1_hi = W[i - 14];  // i - 7\n    var c1_lo = W[i - 13];\n    var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);  // i - 15\n    var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);\n    var c3_hi = W[i - 32];  // i - 16\n    var c3_lo = W[i - 31];\n\n    W[i] = sum64_4_hi(c0_hi, c0_lo,\n                      c1_hi, c1_lo,\n                      c2_hi, c2_lo,\n                      c3_hi, c3_lo);\n    W[i + 1] = sum64_4_lo(c0_hi, c0_lo,\n                          c1_hi, c1_lo,\n                          c2_hi, c2_lo,\n                          c3_hi, c3_lo);\n  }\n};\n\nSHA512.prototype._update = function _update(msg, start) {\n  this._prepareBlock(msg, start);\n\n  var W = this.W;\n\n  var ah = this.h[0];\n  var al = this.h[1];\n  var bh = this.h[2];\n  var bl = this.h[3];\n  var ch = this.h[4];\n  var cl = this.h[5];\n  var dh = this.h[6];\n  var dl = this.h[7];\n  var eh = this.h[8];\n  var el = this.h[9];\n  var fh = this.h[10];\n  var fl = this.h[11];\n  var gh = this.h[12];\n  var gl = this.h[13];\n  var hh = this.h[14];\n  var hl = this.h[15];\n\n  assert(this.k.length === W.length);\n  for (var i = 0; i < W.length; i += 2) {\n    var c0_hi = hh;\n    var c0_lo = hl;\n    var c1_hi = s1_512_hi(eh, el);\n    var c1_lo = s1_512_lo(eh, el);\n    var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);\n    var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);\n    var c3_hi = this.k[i];\n    var c3_lo = this.k[i + 1];\n    var c4_hi = W[i];\n    var c4_lo = W[i + 1];\n\n    var T1_hi = sum64_5_hi(c0_hi, c0_lo,\n                           c1_hi, c1_lo,\n                           c2_hi, c2_lo,\n                           c3_hi, c3_lo,\n                           c4_hi, c4_lo);\n    var T1_lo = sum64_5_lo(c0_hi, c0_lo,\n                           c1_hi, c1_lo,\n                           c2_hi, c2_lo,\n                           c3_hi, c3_lo,\n                           c4_hi, c4_lo);\n\n    var c0_hi = s0_512_hi(ah, al);\n    var c0_lo = s0_512_lo(ah, al);\n    var c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);\n    var c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);\n\n    var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);\n    var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);\n\n    hh = gh;\n    hl = gl;\n\n    gh = fh;\n    gl = fl;\n\n    fh = eh;\n    fl = el;\n\n    eh = sum64_hi(dh, dl, T1_hi, T1_lo);\n    el = sum64_lo(dl, dl, T1_hi, T1_lo);\n\n    dh = ch;\n    dl = cl;\n\n    ch = bh;\n    cl = bl;\n\n    bh = ah;\n    bl = al;\n\n    ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);\n    al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);\n  }\n\n  sum64(this.h, 0, ah, al);\n  sum64(this.h, 2, bh, bl);\n  sum64(this.h, 4, ch, cl);\n  sum64(this.h, 6, dh, dl);\n  sum64(this.h, 8, eh, el);\n  sum64(this.h, 10, fh, fl);\n  sum64(this.h, 12, gh, gl);\n  sum64(this.h, 14, hh, hl);\n};\n\nSHA512.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction SHA384() {\n  if (!(this instanceof SHA384))\n    return new SHA384();\n\n  SHA512.call(this);\n  this.h = [ 0xcbbb9d5d, 0xc1059ed8,\n             0x629a292a, 0x367cd507,\n             0x9159015a, 0x3070dd17,\n             0x152fecd8, 0xf70e5939,\n             0x67332667, 0xffc00b31,\n             0x8eb44a87, 0x68581511,\n             0xdb0c2e0d, 0x64f98fa7,\n             0x47b5481d, 0xbefa4fa4 ];\n}\nutils.inherits(SHA384, SHA512);\nexports.sha384 = SHA384;\n\nSHA384.blockSize = 1024;\nSHA384.outSize = 384;\nSHA384.hmacStrength = 192;\nSHA384.padLength = 128;\n\nSHA384.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h.slice(0, 12), 'big');\n  else\n    return utils.split32(this.h.slice(0, 12), 'big');\n};\n\nfunction SHA1() {\n  if (!(this instanceof SHA1))\n    return new SHA1();\n\n  BlockHash.call(this);\n  this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe,\n             0x10325476, 0xc3d2e1f0 ];\n  this.W = new Array(80);\n}\n\nutils.inherits(SHA1, BlockHash);\nexports.sha1 = SHA1;\n\nSHA1.blockSize = 512;\nSHA1.outSize = 160;\nSHA1.hmacStrength = 80;\nSHA1.padLength = 64;\n\nSHA1.prototype._update = function _update(msg, start) {\n  var W = this.W;\n\n  for (var i = 0; i < 16; i++)\n    W[i] = msg[start + i];\n\n  for(; i < W.length; i++)\n    W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);\n\n  var a = this.h[0];\n  var b = this.h[1];\n  var c = this.h[2];\n  var d = this.h[3];\n  var e = this.h[4];\n\n  for (var i = 0; i < W.length; i++) {\n    var s = ~~(i / 20);\n    var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);\n    e = d;\n    d = c;\n    c = rotl32(b, 30);\n    b = a;\n    a = t;\n  }\n\n  this.h[0] = sum32(this.h[0], a);\n  this.h[1] = sum32(this.h[1], b);\n  this.h[2] = sum32(this.h[2], c);\n  this.h[3] = sum32(this.h[3], d);\n  this.h[4] = sum32(this.h[4], e);\n};\n\nSHA1.prototype._digest = function digest(enc) {\n  if (enc === 'hex')\n    return utils.toHex32(this.h, 'big');\n  else\n    return utils.split32(this.h, 'big');\n};\n\nfunction ch32(x, y, z) {\n  return (x & y) ^ ((~x) & z);\n}\n\nfunction maj32(x, y, z) {\n  return (x & y) ^ (x & z) ^ (y & z);\n}\n\nfunction p32(x, y, z) {\n  return x ^ y ^ z;\n}\n\nfunction s0_256(x) {\n  return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);\n}\n\nfunction s1_256(x) {\n  return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);\n}\n\nfunction g0_256(x) {\n  return rotr32(x, 7) ^ rotr32(x, 18) ^ (x >>> 3);\n}\n\nfunction g1_256(x) {\n  return rotr32(x, 17) ^ rotr32(x, 19) ^ (x >>> 10);\n}\n\nfunction ft_1(s, x, y, z) {\n  if (s === 0)\n    return ch32(x, y, z);\n  if (s === 1 || s === 3)\n    return p32(x, y, z);\n  if (s === 2)\n    return maj32(x, y, z);\n}\n\nfunction ch64_hi(xh, xl, yh, yl, zh, zl) {\n  var r = (xh & yh) ^ ((~xh) & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction ch64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ ((~xl) & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_hi(xh, xl, yh, yl, zh, zl) {\n  var r = (xh & yh) ^ (xh & zh) ^ (yh & zh);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction maj64_lo(xh, xl, yh, yl, zh, zl) {\n  var r = (xl & yl) ^ (xl & zl) ^ (yl & zl);\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 28);\n  var c1_hi = rotr64_hi(xl, xh, 2);  // 34\n  var c2_hi = rotr64_hi(xl, xh, 7);  // 39\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 28);\n  var c1_lo = rotr64_lo(xl, xh, 2);  // 34\n  var c2_lo = rotr64_lo(xl, xh, 7);  // 39\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 14);\n  var c1_hi = rotr64_hi(xh, xl, 18);\n  var c2_hi = rotr64_hi(xl, xh, 9);  // 41\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction s1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 14);\n  var c1_lo = rotr64_lo(xh, xl, 18);\n  var c2_lo = rotr64_lo(xl, xh, 9);  // 41\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 1);\n  var c1_hi = rotr64_hi(xh, xl, 8);\n  var c2_hi = shr64_hi(xh, xl, 7);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g0_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 1);\n  var c1_lo = rotr64_lo(xh, xl, 8);\n  var c2_lo = shr64_lo(xh, xl, 7);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_hi(xh, xl) {\n  var c0_hi = rotr64_hi(xh, xl, 19);\n  var c1_hi = rotr64_hi(xl, xh, 29);  // 61\n  var c2_hi = shr64_hi(xh, xl, 6);\n\n  var r = c0_hi ^ c1_hi ^ c2_hi;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\nfunction g1_512_lo(xh, xl) {\n  var c0_lo = rotr64_lo(xh, xl, 19);\n  var c1_lo = rotr64_lo(xl, xh, 29);  // 61\n  var c2_lo = shr64_lo(xh, xl, 6);\n\n  var r = c0_lo ^ c1_lo ^ c2_lo;\n  if (r < 0)\n    r += 0x100000000;\n  return r;\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash/sha.js\n// module id = 1344\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash/sha.js")},function(module,exports,__webpack_require__){eval("var utils = exports;\nvar inherits = __webpack_require__(75);\n\nfunction toArray(msg, enc) {\n  if (Array.isArray(msg))\n    return msg.slice();\n  if (!msg)\n    return [];\n  var res = [];\n  if (typeof msg === 'string') {\n    if (!enc) {\n      for (var i = 0; i < msg.length; i++) {\n        var c = msg.charCodeAt(i);\n        var hi = c >> 8;\n        var lo = c & 0xff;\n        if (hi)\n          res.push(hi, lo);\n        else\n          res.push(lo);\n      }\n    } else if (enc === 'hex') {\n      msg = msg.replace(/[^a-z0-9]+/ig, '');\n      if (msg.length % 2 !== 0)\n        msg = '0' + msg;\n      for (var i = 0; i < msg.length; i += 2)\n        res.push(parseInt(msg[i] + msg[i + 1], 16));\n    }\n  } else {\n    for (var i = 0; i < msg.length; i++)\n      res[i] = msg[i] | 0;\n  }\n  return res;\n}\nutils.toArray = toArray;\n\nfunction toHex(msg) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++)\n    res += zero2(msg[i].toString(16));\n  return res;\n}\nutils.toHex = toHex;\n\nfunction htonl(w) {\n  var res = (w >>> 24) |\n            ((w >>> 8) & 0xff00) |\n            ((w << 8) & 0xff0000) |\n            ((w & 0xff) << 24);\n  return res >>> 0;\n}\nutils.htonl = htonl;\n\nfunction toHex32(msg, endian) {\n  var res = '';\n  for (var i = 0; i < msg.length; i++) {\n    var w = msg[i];\n    if (endian === 'little')\n      w = htonl(w);\n    res += zero8(w.toString(16));\n  }\n  return res;\n}\nutils.toHex32 = toHex32;\n\nfunction zero2(word) {\n  if (word.length === 1)\n    return '0' + word;\n  else\n    return word;\n}\nutils.zero2 = zero2;\n\nfunction zero8(word) {\n  if (word.length === 7)\n    return '0' + word;\n  else if (word.length === 6)\n    return '00' + word;\n  else if (word.length === 5)\n    return '000' + word;\n  else if (word.length === 4)\n    return '0000' + word;\n  else if (word.length === 3)\n    return '00000' + word;\n  else if (word.length === 2)\n    return '000000' + word;\n  else if (word.length === 1)\n    return '0000000' + word;\n  else\n    return word;\n}\nutils.zero8 = zero8;\n\nfunction join32(msg, start, end, endian) {\n  var len = end - start;\n  assert(len % 4 === 0);\n  var res = new Array(len / 4);\n  for (var i = 0, k = start; i < res.length; i++, k += 4) {\n    var w;\n    if (endian === 'big')\n      w = (msg[k] << 24) | (msg[k + 1] << 16) | (msg[k + 2] << 8) | msg[k + 3];\n    else\n      w = (msg[k + 3] << 24) | (msg[k + 2] << 16) | (msg[k + 1] << 8) | msg[k];\n    res[i] = w >>> 0;\n  }\n  return res;\n}\nutils.join32 = join32;\n\nfunction split32(msg, endian) {\n  var res = new Array(msg.length * 4);\n  for (var i = 0, k = 0; i < msg.length; i++, k += 4) {\n    var m = msg[i];\n    if (endian === 'big') {\n      res[k] = m >>> 24;\n      res[k + 1] = (m >>> 16) & 0xff;\n      res[k + 2] = (m >>> 8) & 0xff;\n      res[k + 3] = m & 0xff;\n    } else {\n      res[k + 3] = m >>> 24;\n      res[k + 2] = (m >>> 16) & 0xff;\n      res[k + 1] = (m >>> 8) & 0xff;\n      res[k] = m & 0xff;\n    }\n  }\n  return res;\n}\nutils.split32 = split32;\n\nfunction rotr32(w, b) {\n  return (w >>> b) | (w << (32 - b));\n}\nutils.rotr32 = rotr32;\n\nfunction rotl32(w, b) {\n  return (w << b) | (w >>> (32 - b));\n}\nutils.rotl32 = rotl32;\n\nfunction sum32(a, b) {\n  return (a + b) >>> 0;\n}\nutils.sum32 = sum32;\n\nfunction sum32_3(a, b, c) {\n  return (a + b + c) >>> 0;\n}\nutils.sum32_3 = sum32_3;\n\nfunction sum32_4(a, b, c, d) {\n  return (a + b + c + d) >>> 0;\n}\nutils.sum32_4 = sum32_4;\n\nfunction sum32_5(a, b, c, d, e) {\n  return (a + b + c + d + e) >>> 0;\n}\nutils.sum32_5 = sum32_5;\n\nfunction assert(cond, msg) {\n  if (!cond)\n    throw new Error(msg || 'Assertion failed');\n}\nutils.assert = assert;\n\nutils.inherits = inherits;\n\nfunction sum64(buf, pos, ah, al) {\n  var bh = buf[pos];\n  var bl = buf[pos + 1];\n\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  buf[pos] = hi >>> 0;\n  buf[pos + 1] = lo;\n}\nexports.sum64 = sum64;\n\nfunction sum64_hi(ah, al, bh, bl) {\n  var lo = (al + bl) >>> 0;\n  var hi = (lo < al ? 1 : 0) + ah + bh;\n  return hi >>> 0;\n};\nexports.sum64_hi = sum64_hi;\n\nfunction sum64_lo(ah, al, bh, bl) {\n  var lo = al + bl;\n  return lo >>> 0;\n};\nexports.sum64_lo = sum64_lo;\n\nfunction sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + carry;\n  return hi >>> 0;\n};\nexports.sum64_4_hi = sum64_4_hi;\n\nfunction sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {\n  var lo = al + bl + cl + dl;\n  return lo >>> 0;\n};\nexports.sum64_4_lo = sum64_4_lo;\n\nfunction sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var carry = 0;\n  var lo = al;\n  lo = (lo + bl) >>> 0;\n  carry += lo < al ? 1 : 0;\n  lo = (lo + cl) >>> 0;\n  carry += lo < cl ? 1 : 0;\n  lo = (lo + dl) >>> 0;\n  carry += lo < dl ? 1 : 0;\n  lo = (lo + el) >>> 0;\n  carry += lo < el ? 1 : 0;\n\n  var hi = ah + bh + ch + dh + eh + carry;\n  return hi >>> 0;\n};\nexports.sum64_5_hi = sum64_5_hi;\n\nfunction sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {\n  var lo = al + bl + cl + dl + el;\n\n  return lo >>> 0;\n};\nexports.sum64_5_lo = sum64_5_lo;\n\nfunction rotr64_hi(ah, al, num) {\n  var r = (al << (32 - num)) | (ah >>> num);\n  return r >>> 0;\n};\nexports.rotr64_hi = rotr64_hi;\n\nfunction rotr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n};\nexports.rotr64_lo = rotr64_lo;\n\nfunction shr64_hi(ah, al, num) {\n  return ah >>> num;\n};\nexports.shr64_hi = shr64_hi;\n\nfunction shr64_lo(ah, al, num) {\n  var r = (ah << (32 - num)) | (al >>> num);\n  return r >>> 0;\n};\nexports.shr64_lo = shr64_lo;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/~/hash.js/lib/hash/utils.js\n// module id = 1345\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/node_modules/hash.js/lib/hash/utils.js")},function(module,exports){eval('module.exports = {"_from":"elliptic@=3.0.3","_id":"elliptic@3.0.3","_inBundle":false,"_integrity":"sha1-hlybQgv75VAGuflp+XoNLESWZZU=","_location":"/zcash-bitcore-lib/elliptic","_phantomChildren":{"inherits":"2.0.1"},"_requested":{"type":"version","registry":true,"raw":"elliptic@3.0.3","name":"elliptic","escapedName":"elliptic","rawSpec":"3.0.3","saveSpec":null,"fetchSpec":"3.0.3"},"_requiredBy":["/zcash-bitcore-lib"],"_resolved":"http://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","_shasum":"865c9b420bfbe55006b9f969f97a0d2c44966595","_spec":"elliptic@3.0.3","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/zcash-bitcore-lib","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"bundleDependencies":false,"dependencies":{"bn.js":"^2.0.0","brorand":"^1.0.1","hash.js":"^1.0.0","inherits":"^2.0.1"},"deprecated":false,"description":"EC cryptography","devDependencies":{"browserify":"^3.44.2","jscs":"^1.11.3","jshint":"^2.6.0","mocha":"^2.1.0","uglify-js":"^2.4.13"},"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"test":"make lint && mocha --reporter=spec test/*-test.js"},"version":"3.0.3"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/~/elliptic/package.json\n// module id = 1346\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/node_modules/elliptic/package.json')},function(module,exports){eval('module.exports = {"_from":"zcash-bitcore-lib@^0.13.20-rc3","_id":"zcash-bitcore-lib@0.13.20-rc3","_inBundle":false,"_integrity":"sha1-gToPVtz4t2vBQplRvqbRI2xQcAg=","_location":"/zcash-bitcore-lib","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"zcash-bitcore-lib@^0.13.20-rc3","name":"zcash-bitcore-lib","escapedName":"zcash-bitcore-lib","rawSpec":"^0.13.20-rc3","saveSpec":null,"fetchSpec":"^0.13.20-rc3"},"_requiredBy":["/ipld-zcash"],"_resolved":"https://registry.npmjs.org/zcash-bitcore-lib/-/zcash-bitcore-lib-0.13.20-rc3.tgz","_shasum":"813a0f56dcf8b76bc1429951bea6d1236c507008","_shrinkwrap":{"name":"bitcore","version":"0.13.19","dependencies":{"bn.js":{"version":"2.0.4","from":"bn.js@=2.0.4","resolved":"https://registry.npmjs.org/bn.js/-/bn.js-2.0.4.tgz"},"bs58":{"version":"2.0.0","from":"bs58@=2.0.0","resolved":"https://registry.npmjs.org/bs58/-/bs58-2.0.0.tgz"},"buffer-compare":{"version":"1.0.0","from":"buffer-compare@=1.0.0","resolved":"https://registry.npmjs.org/buffer-compare/-/buffer-compare-1.0.0.tgz"},"elliptic":{"version":"3.0.3","from":"elliptic@=3.0.3","resolved":"https://registry.npmjs.org/elliptic/-/elliptic-3.0.3.tgz","dependencies":{"brorand":{"version":"1.0.5","from":"brorand@^1.0.1","resolved":"https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz"},"hash.js":{"version":"1.0.3","from":"hash.js@=1.0.3","resolved":"https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz"}}},"inherits":{"version":"2.0.1","from":"inherits@=2.0.1","resolved":"https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"},"lodash":{"version":"3.10.1","from":"lodash@=3.10.1","resolved":"https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz"}}},"_spec":"zcash-bitcore-lib@^0.13.20-rc3","_where":"/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/ipld-zcash","author":{"name":"BitPay","email":"dev@bitpay.com"},"browser":{"request":"browser-request"},"bugs":{"url":"https://github.com/bitmex/zcash-bitcore-lib/issues"},"bundleDependencies":false,"contributors":[{"name":"Daniel Cousens","email":"bitcoin@dcousens.com"},{"name":"Esteban Ordano","email":"eordano@gmail.com"},{"name":"Gordon Hall","email":"gordon@bitpay.com"},{"name":"Jeff Garzik","email":"jgarzik@bitpay.com"},{"name":"Kyle Drake","email":"kyle@kyledrake.net"},{"name":"Manuel Araoz","email":"manuelaraoz@gmail.com"},{"name":"Matias Alejo Garcia","email":"ematiu@gmail.com"},{"name":"Ryan X. Charles","email":"ryanxcharles@gmail.com"},{"name":"Stefan Thomas","email":"moon@justmoon.net"},{"name":"Stephen Pair","email":"stephen@bitpay.com"},{"name":"Wei Lu","email":"luwei.here@gmail.com"},{"name":"Jack Grigg","email":"jack@z.cash"}],"dependencies":{"bn.js":"=2.0.4","bs58":"=2.0.0","buffer-compare":"=1.0.0","elliptic":"=3.0.3","inherits":"=2.0.1","lodash":"=3.10.1"},"deprecated":false,"description":"A pure and powerful JavaScript Zcash library.","devDependencies":{"brfs":"^1.2.0","chai":"^1.10.0","gulp":"^3.8.10","sinon":"^1.13.0","zcash-bitcore-build":"^0.5.4"},"homepage":"https://github.com/bitmex/zcash-bitcore-lib#readme","keywords":["zcash","transaction","address","p2p","ecies","cryptocurrency","blockchain","payment","bip21","bip32","bip37","bip69","bip70","multisig"],"license":"MIT","main":"index.js","name":"zcash-bitcore-lib","repository":{"type":"git","url":"git+https://github.com/bitmex/zcash-bitcore-lib.git"},"scripts":{"build":"gulp","coverage":"gulp coverage","lint":"gulp lint","test":"gulp test"},"version":"0.13.20-rc3"}\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/zcash-bitcore-lib/package.json\n// module id = 1347\n// module chunks = 0\n\n//# sourceURL=../node_modules/zcash-bitcore-lib/package.json')},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// buffer (ignored)\n// module id = 1348\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/bn.js/lib_buffer")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// crypto (ignored)\n// module id = 1349\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/brorand_crypto")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// ./init-assets (ignored)\n// module id = 1350\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/dc-messaging/node_modules/ipfs/src/core/components_./init-assets")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// ws (ignored)\n// module id = 1351\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/engine.io-client/lib/transports_ws")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// util (ignored)\n// module id = 1352\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/level-iterator-stream/node_modules/readable-stream/lib_util")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// ./leveldown (ignored)\n// module id = 1353\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/levelup/lib_./leveldown")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// fs (ignored)\n// module id = 1354\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/libp2p-multiplex/node_modules/pump_fs")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// pull-ws/server (ignored)\n// module id = 1355\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/libp2p-websockets/src_pull-ws/server")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// ws (ignored)\n// module id = 1356\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/pull-ws_ws")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// util (ignored)\n// module id = 1357\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/readable-stream/lib_util")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// util (ignored)\n// module id = 1358\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/readable-stream/lib/internal/streams_util")},function(module,exports){eval("/* (ignored) */\n\n//////////////////\n// WEBPACK FOOTER\n// crypto (ignored)\n// module id = 1359\n// module chunks = 0\n\n//# sourceURL=../ignored_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/node_modules/tweetnacl_crypto")},function(module,exports,__webpack_require__){eval("__webpack_require__(574);\nmodule.exports = __webpack_require__(573);\n\n\n//////////////////\n// WEBPACK FOOTER\n// multi ./scripts/config/polyfills.js ./src/index.js\n// module id = 1360\n// module chunks = 0\n\n//# sourceURL=../multi_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/scripts/config/polyfills.js_/Users/kellas/Projects/DCLabs/dc-dev/projects/dclib/src/index.js")}]);